1(function webpackUniversalModuleDefinition(root, factory) { 2 if(typeof exports === 'object' && typeof module === 'object') 3 module.exports = factory(); 4 else if(typeof define === 'function' && define.amd) 5 define("core", [], factory); 6 else if(typeof exports === 'object') 7 exports["core"] = factory(); 8 else 9 root["core"] = factory(); 10})(self, () => { 11return /******/ (() => { // webpackBootstrap 12/******/ var __webpack_modules__ = ({ 13
vendor: 68,246 bytes, lines 14-2026
14/***/ "./node_modules/@popperjs/core/lib/popper.js": 15/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 16 17"use strict"; 18 19// EXPORTS 20__webpack_require__.d(__webpack_exports__, { 21 "fi": () => (/* binding */ popper_createPopper) 22}); 23 24// UNUSED EXPORTS: applyStyles, arrow, computeStyles, createPopperLite, defaultModifiers, detectOverflow, eventListeners, flip, hide, offset, popperGenerator, popperOffsets, preventOverflow 25 26;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindow.js 27function getWindow(node) { 28 if (node == null) { 29 return window; 30 } 31 32 if (node.toString() !== '[object Window]') { 33 var ownerDocument = node.ownerDocument; 34 return ownerDocument ? ownerDocument.defaultView || window : window; 35 } 36 37 return node; 38} 39;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js 40 41 42function isElement(node) { 43 var OwnElement = getWindow(node).Element; 44 return node instanceof OwnElement || node instanceof Element; 45} 46 47function isHTMLElement(node) { 48 var OwnElement = getWindow(node).HTMLElement; 49 return node instanceof OwnElement || node instanceof HTMLElement; 50} 51 52function isShadowRoot(node) { 53 // IE 11 has no ShadowRoot 54 if (typeof ShadowRoot === 'undefined') { 55 return false; 56 } 57 58 var OwnElement = getWindow(node).ShadowRoot; 59 return node instanceof OwnElement || node instanceof ShadowRoot; 60} 61 62 63;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/math.js 64var math_max = Math.max; 65var math_min = Math.min; 66var round = Math.round; 67;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/userAgent.js 68function getUAString() { 69 var uaData = navigator.userAgentData; 70 71 if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) { 72 return uaData.brands.map(function (item) { 73 return item.brand + "/" + item.version; 74 }).join(' '); 75 } 76 77 return navigator.userAgent; 78} 79;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js 80 81function isLayoutViewport() { 82 return !/^((?!chrome|android).)*safari/i.test(getUAString()); 83} 84;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js 85 86 87 88 89function getBoundingClientRect(element, includeScale, isFixedStrategy) { 90 if (includeScale === void 0) { 91 includeScale = false; 92 } 93 94 if (isFixedStrategy === void 0) { 95 isFixedStrategy = false; 96 } 97 98 var clientRect = element.getBoundingClientRect(); 99 var scaleX = 1; 100 var scaleY = 1; 101 102 if (includeScale && isHTMLElement(element)) { 103 scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1; 104 scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1; 105 } 106 107 var _ref = isElement(element) ? getWindow(element) : window, 108 visualViewport = _ref.visualViewport; 109 110 var addVisualOffsets = !isLayoutViewport() && isFixedStrategy; 111 var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX; 112 var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY; 113 var width = clientRect.width / scaleX; 114 var height = clientRect.height / scaleY; 115 return { 116 width: width, 117 height: height, 118 top: y, 119 right: x + width, 120 bottom: y + height, 121 left: x, 122 x: x, 123 y: y 124 }; 125} 126;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js 127 128function getWindowScroll(node) { 129 var win = getWindow(node); 130 var scrollLeft = win.pageXOffset; 131 var scrollTop = win.pageYOffset; 132 return { 133 scrollLeft: scrollLeft, 134 scrollTop: scrollTop 135 }; 136} 137;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js 138function getHTMLElementScroll(element) { 139 return { 140 scrollLeft: element.scrollLeft, 141 scrollTop: element.scrollTop 142 }; 143} 144;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js 145 146 147 148 149function getNodeScroll(node) { 150 if (node === getWindow(node) || !isHTMLElement(node)) { 151 return getWindowScroll(node); 152 } else { 153 return getHTMLElementScroll(node); 154 } 155} 156;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js 157function getNodeName(element) { 158 return element ? (element.nodeName || '').toLowerCase() : null; 159} 160;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js 161 162function getDocumentElement(element) { 163 // $FlowFixMe[incompatible-return]: assume body is always available 164 return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing] 165 element.document) || window.document).documentElement; 166} 167;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js 168 169 170 171function getWindowScrollBarX(element) { 172 // If <html> has a CSS width greater than the viewport, then this will be 173 // incorrect for RTL. 174 // Popper 1 is broken in this case and never had a bug report so let's assume 175 // it's not an issue. I don't think anyone ever specifies width on <html> 176 // anyway. 177 // Browsers where the left scrollbar doesn't cause an issue report `0` for 178 // this (e.g. Edge 2019, IE11, Safari) 179 return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; 180} 181;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js 182 183function getComputedStyle(element) { 184 return getWindow(element).getComputedStyle(element); 185} 186;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js 187 188function isScrollParent(element) { 189 // Firefox wants us to check `-x` and `-y` variations as well 190 var _getComputedStyle = getComputedStyle(element), 191 overflow = _getComputedStyle.overflow, 192 overflowX = _getComputedStyle.overflowX, 193 overflowY = _getComputedStyle.overflowY; 194 195 return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); 196} 197;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js 198 199 200 201 202 203 204 205 206 207function isElementScaled(element) { 208 var rect = element.getBoundingClientRect(); 209 var scaleX = round(rect.width) / element.offsetWidth || 1; 210 var scaleY = round(rect.height) / element.offsetHeight || 1; 211 return scaleX !== 1 || scaleY !== 1; 212} // Returns the composite rect of an element relative to its offsetParent. 213// Composite means it takes into account transforms as well as layout. 214 215 216function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { 217 if (isFixed === void 0) { 218 isFixed = false; 219 } 220 221 var isOffsetParentAnElement = isHTMLElement(offsetParent); 222 var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); 223 var documentElement = getDocumentElement(offsetParent); 224 var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed); 225 var scroll = { 226 scrollLeft: 0, 227 scrollTop: 0 228 }; 229 var offsets = { 230 x: 0, 231 y: 0 232 }; 233 234 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { 235 if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078 236 isScrollParent(documentElement)) { 237 scroll = getNodeScroll(offsetParent); 238 } 239 240 if (isHTMLElement(offsetParent)) { 241 offsets = getBoundingClientRect(offsetParent, true); 242 offsets.x += offsetParent.clientLeft; 243 offsets.y += offsetParent.clientTop; 244 } else if (documentElement) { 245 offsets.x = getWindowScrollBarX(documentElement); 246 } 247 } 248 249 return { 250 x: rect.left + scroll.scrollLeft - offsets.x, 251 y: rect.top + scroll.scrollTop - offsets.y, 252 width: rect.width, 253 height: rect.height 254 }; 255} 256;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js 257 // Returns the layout rect of an element relative to its offsetParent. Layout 258// means it doesn't take into account transforms. 259 260function getLayoutRect(element) { 261 var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed. 262 // Fixes https://github.com/popperjs/popper-core/issues/1223 263 264 var width = element.offsetWidth; 265 var height = element.offsetHeight; 266 267 if (Math.abs(clientRect.width - width) <= 1) { 268 width = clientRect.width; 269 } 270 271 if (Math.abs(clientRect.height - height) <= 1) { 272 height = clientRect.height; 273 } 274 275 return { 276 x: element.offsetLeft, 277 y: element.offsetTop, 278 width: width, 279 height: height 280 }; 281} 282;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js 283 284 285 286function getParentNode(element) { 287 if (getNodeName(element) === 'html') { 288 return element; 289 } 290 291 return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle 292 // $FlowFixMe[incompatible-return] 293 // $FlowFixMe[prop-missing] 294 element.assignedSlot || // step into the shadow DOM of the parent of a slotted node 295 element.parentNode || ( // DOM Element detected 296 isShadowRoot(element) ? element.host : null) || // ShadowRoot detected 297 // $FlowFixMe[incompatible-call]: HTMLElement is a Node 298 getDocumentElement(element) // fallback 299 300 ); 301} 302;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js 303 304 305 306 307function getScrollParent(node) { 308 if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) { 309 // $FlowFixMe[incompatible-return]: assume body is always available 310 return node.ownerDocument.body; 311 } 312 313 if (isHTMLElement(node) && isScrollParent(node)) { 314 return node; 315 } 316 317 return getScrollParent(getParentNode(node)); 318} 319;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js 320 321 322 323 324/* 325given a DOM element, return the list of all scroll parents, up the list of ancesors 326until we get to the top window object. This list is what we attach scroll listeners 327to, because if any of these parent elements scroll, we'll need to re-calculate the 328reference element's position. 329*/ 330 331function listScrollParents(element, list) { 332 var _element$ownerDocumen; 333 334 if (list === void 0) { 335 list = []; 336 } 337 338 var scrollParent = getScrollParent(element); 339 var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); 340 var win = getWindow(scrollParent); 341 var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; 342 var updatedList = list.concat(target); 343 return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here 344 updatedList.concat(listScrollParents(getParentNode(target))); 345} 346;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js 347 348function isTableElement(element) { 349 return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0; 350} 351;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js 352 353 354 355 356 357 358 359 360function getTrueOffsetParent(element) { 361 if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 362 getComputedStyle(element).position === 'fixed') { 363 return null; 364 } 365 366 return element.offsetParent; 367} // `.offsetParent` reports `null` for fixed elements, while absolute elements 368// return the containing block 369 370 371function getContainingBlock(element) { 372 var isFirefox = /firefox/i.test(getUAString()); 373 var isIE = /Trident/i.test(getUAString()); 374 375 if (isIE && isHTMLElement(element)) { 376 // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport 377 var elementCss = getComputedStyle(element); 378 379 if (elementCss.position === 'fixed') { 380 return null; 381 } 382 } 383 384 var currentNode = getParentNode(element); 385 386 if (isShadowRoot(currentNode)) { 387 currentNode = currentNode.host; 388 } 389 390 while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) { 391 var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that 392 // create a containing block. 393 // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block 394 395 if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') { 396 return currentNode; 397 } else { 398 currentNode = currentNode.parentNode; 399 } 400 } 401 402 return null; 403} // Gets the closest ancestor positioned element. Handles some edge cases, 404// such as table ancestors and cross browser bugs. 405 406 407function getOffsetParent(element) { 408 var window = getWindow(element); 409 var offsetParent = getTrueOffsetParent(element); 410 411 while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') { 412 offsetParent = getTrueOffsetParent(offsetParent); 413 } 414 415 if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) { 416 return window; 417 } 418 419 return offsetParent || getContainingBlock(element) || window; 420} 421;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/enums.js 422var enums_top = 'top'; 423var bottom = 'bottom'; 424var right = 'right'; 425var left = 'left'; 426var auto = 'auto'; 427var basePlacements = [enums_top, bottom, right, left]; 428var start = 'start'; 429var end = 'end'; 430var clippingParents = 'clippingParents'; 431var viewport = 'viewport'; 432var popper = 'popper'; 433var reference = 'reference'; 434var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) { 435 return acc.concat([placement + "-" + start, placement + "-" + end]); 436}, []); 437var enums_placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) { 438 return acc.concat([placement, placement + "-" + start, placement + "-" + end]); 439}, []); // modifiers that need to read the DOM 440 441var beforeRead = 'beforeRead'; 442var read = 'read'; 443var afterRead = 'afterRead'; // pure-logic modifiers 444 445var beforeMain = 'beforeMain'; 446var main = 'main'; 447var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state) 448 449var beforeWrite = 'beforeWrite'; 450var write = 'write'; 451var afterWrite = 'afterWrite'; 452var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; 453;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/orderModifiers.js 454 // source: https://stackoverflow.com/questions/49875255 455 456function order(modifiers) { 457 var map = new Map(); 458 var visited = new Set(); 459 var result = []; 460 modifiers.forEach(function (modifier) { 461 map.set(modifier.name, modifier); 462 }); // On visiting object, check for its dependencies and visit them recursively 463 464 function sort(modifier) { 465 visited.add(modifier.name); 466 var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []); 467 requires.forEach(function (dep) { 468 if (!visited.has(dep)) { 469 var depModifier = map.get(dep); 470 471 if (depModifier) { 472 sort(depModifier); 473 } 474 } 475 }); 476 result.push(modifier); 477 } 478 479 modifiers.forEach(function (modifier) { 480 if (!visited.has(modifier.name)) { 481 // check for visited object 482 sort(modifier); 483 } 484 }); 485 return result; 486} 487 488function orderModifiers(modifiers) { 489 // order based on dependencies 490 var orderedModifiers = order(modifiers); // order based on phase 491 492 return modifierPhases.reduce(function (acc, phase) { 493 return acc.concat(orderedModifiers.filter(function (modifier) { 494 return modifier.phase === phase; 495 })); 496 }, []); 497} 498;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/debounce.js 499function debounce(fn) { 500 var pending; 501 return function () { 502 if (!pending) { 503 pending = new Promise(function (resolve) { 504 Promise.resolve().then(function () { 505 pending = undefined; 506 resolve(fn()); 507 }); 508 }); 509 } 510 511 return pending; 512 }; 513} 514;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/mergeByName.js 515function mergeByName(modifiers) { 516 var merged = modifiers.reduce(function (merged, current) { 517 var existing = merged[current.name]; 518 merged[current.name] = existing ? Object.assign({}, existing, current, { 519 options: Object.assign({}, existing.options, current.options), 520 data: Object.assign({}, existing.data, current.data) 521 }) : current; 522 return merged; 523 }, {}); // IE11 does not support Object.values 524 525 return Object.keys(merged).map(function (key) { 526 return merged[key]; 527 }); 528} 529;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/createPopper.js 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.'; 545var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.'; 546var DEFAULT_OPTIONS = { 547 placement: 'bottom', 548 modifiers: [], 549 strategy: 'absolute' 550}; 551 552function areValidElements() { 553 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 554 args[_key] = arguments[_key]; 555 } 556 557 return !args.some(function (element) { 558 return !(element && typeof element.getBoundingClientRect === 'function'); 559 }); 560} 561 562function popperGenerator(generatorOptions) { 563 if (generatorOptions === void 0) { 564 generatorOptions = {}; 565 } 566 567 var _generatorOptions = generatorOptions, 568 _generatorOptions$def = _generatorOptions.defaultModifiers, 569 defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, 570 _generatorOptions$def2 = _generatorOptions.defaultOptions, 571 defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; 572 return function createPopper(reference, popper, options) { 573 if (options === void 0) { 574 options = defaultOptions; 575 } 576 577 var state = { 578 placement: 'bottom', 579 orderedModifiers: [], 580 options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), 581 modifiersData: {}, 582 elements: { 583 reference: reference, 584 popper: popper 585 }, 586 attributes: {}, 587 styles: {} 588 }; 589 var effectCleanupFns = []; 590 var isDestroyed = false; 591 var instance = { 592 state: state, 593 setOptions: function setOptions(setOptionsAction) { 594 var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction; 595 cleanupModifierEffects(); 596 state.options = Object.assign({}, defaultOptions, state.options, options); 597 state.scrollParents = { 598 reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [], 599 popper: listScrollParents(popper) 600 }; // Orders the modifiers based on their dependencies and `phase` 601 // properties 602 603 var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers 604 605 state.orderedModifiers = orderedModifiers.filter(function (m) { 606 return m.enabled; 607 }); // Validate the provided modifiers so that the consumer will get warned 608 // if one of the modifiers is invalid for any reason 609 610 if (false) { var _getComputedStyle, marginTop, marginRight, marginBottom, marginLeft, flipModifier, modifiers; } 611 612 runModifierEffects(); 613 return instance.update(); 614 }, 615 // Sync update â it will always be executed, even if not necessary. This 616 // is useful for low frequency updates where sync behavior simplifies the 617 // logic. 618 // For high frequency updates (e.g. `resize` and `scroll` events), always 619 // prefer the async Popper#update method 620 forceUpdate: function forceUpdate() { 621 if (isDestroyed) { 622 return; 623 } 624 625 var _state$elements = state.elements, 626 reference = _state$elements.reference, 627 popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements 628 // anymore 629 630 if (!areValidElements(reference, popper)) { 631 if (false) {} 632 633 return; 634 } // Store the reference and popper rects to be read by modifiers 635 636 637 state.rects = { 638 reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'), 639 popper: getLayoutRect(popper) 640 }; // Modifiers have the ability to reset the current update cycle. The 641 // most common use case for this is the `flip` modifier changing the 642 // placement, which then needs to re-run all the modifiers, because the 643 // logic was previously ran for the previous placement and is therefore 644 // stale/incorrect 645 646 state.reset = false; 647 state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier 648 // is filled with the initial data specified by the modifier. This means 649 // it doesn't persist and is fresh on each update. 650 // To ensure persistent data, use `${name}#persistent` 651 652 state.orderedModifiers.forEach(function (modifier) { 653 return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); 654 }); 655 var __debug_loops__ = 0; 656 657 for (var index = 0; index < state.orderedModifiers.length; index++) { 658 if (false) {} 659 660 if (state.reset === true) { 661 state.reset = false; 662 index = -1; 663 continue; 664 } 665 666 var _state$orderedModifie = state.orderedModifiers[index], 667 fn = _state$orderedModifie.fn, 668 _state$orderedModifie2 = _state$orderedModifie.options, 669 _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, 670 name = _state$orderedModifie.name; 671 672 if (typeof fn === 'function') { 673 state = fn({ 674 state: state, 675 options: _options, 676 name: name, 677 instance: instance 678 }) || state; 679 } 680 } 681 }, 682 // Async and optimistically optimized update â it will not be executed if 683 // not necessary (debounced to run at most once-per-tick) 684 update: debounce(function () { 685 return new Promise(function (resolve) { 686 instance.forceUpdate(); 687 resolve(state); 688 }); 689 }), 690 destroy: function destroy() { 691 cleanupModifierEffects(); 692 isDestroyed = true; 693 } 694 }; 695 696 if (!areValidElements(reference, popper)) { 697 if (false) {} 698 699 return instance; 700 } 701 702 instance.setOptions(options).then(function (state) { 703 if (!isDestroyed && options.onFirstUpdate) { 704 options.onFirstUpdate(state); 705 } 706 }); // Modifiers have the ability to execute arbitrary code before the first 707 // update cycle runs. They will be executed in the same order as the update 708 // cycle. This is useful when a modifier adds some persistent data that 709 // other modifiers need to use, but the modifier is run after the dependent 710 // one. 711 712 function runModifierEffects() { 713 state.orderedModifiers.forEach(function (_ref3) { 714 var name = _ref3.name, 715 _ref3$options = _ref3.options, 716 options = _ref3$options === void 0 ? {} : _ref3$options, 717 effect = _ref3.effect; 718 719 if (typeof effect === 'function') { 720 var cleanupFn = effect({ 721 state: state, 722 name: name, 723 instance: instance, 724 options: options 725 }); 726 727 var noopFn = function noopFn() {}; 728 729 effectCleanupFns.push(cleanupFn || noopFn); 730 } 731 }); 732 } 733 734 function cleanupModifierEffects() { 735 effectCleanupFns.forEach(function (fn) { 736 return fn(); 737 }); 738 effectCleanupFns = []; 739 } 740 741 return instance; 742 }; 743} 744var createPopper = /*#__PURE__*/(/* unused pure expression or super */ null && (popperGenerator())); // eslint-disable-next-line import/no-unused-modules 745 746 747;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/eventListeners.js 748 // eslint-disable-next-line import/no-unused-modules 749 750var passive = { 751 passive: true 752}; 753 754function effect(_ref) { 755 var state = _ref.state, 756 instance = _ref.instance, 757 options = _ref.options; 758 var _options$scroll = options.scroll, 759 scroll = _options$scroll === void 0 ? true : _options$scroll, 760 _options$resize = options.resize, 761 resize = _options$resize === void 0 ? true : _options$resize; 762 var window = getWindow(state.elements.popper); 763 var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); 764 765 if (scroll) { 766 scrollParents.forEach(function (scrollParent) { 767 scrollParent.addEventListener('scroll', instance.update, passive); 768 }); 769 } 770 771 if (resize) { 772 window.addEventListener('resize', instance.update, passive); 773 } 774 775 return function () { 776 if (scroll) { 777 scrollParents.forEach(function (scrollParent) { 778 scrollParent.removeEventListener('scroll', instance.update, passive); 779 }); 780 } 781 782 if (resize) { 783 window.removeEventListener('resize', instance.update, passive); 784 } 785 }; 786} // eslint-disable-next-line import/no-unused-modules 787 788 789/* harmony default export */ const eventListeners = ({ 790 name: 'eventListeners', 791 enabled: true, 792 phase: 'write', 793 fn: function fn() {}, 794 effect: effect, 795 data: {} 796}); 797;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getBasePlacement.js 798 799function getBasePlacement(placement) { 800 return placement.split('-')[0]; 801} 802;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getVariation.js 803function getVariation(placement) { 804 return placement.split('-')[1]; 805} 806;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js 807function getMainAxisFromPlacement(placement) { 808 return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y'; 809} 810;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/computeOffsets.js 811 812 813 814 815function computeOffsets(_ref) { 816 var reference = _ref.reference, 817 element = _ref.element, 818 placement = _ref.placement; 819 var basePlacement = placement ? getBasePlacement(placement) : null; 820 var variation = placement ? getVariation(placement) : null; 821 var commonX = reference.x + reference.width / 2 - element.width / 2; 822 var commonY = reference.y + reference.height / 2 - element.height / 2; 823 var offsets; 824 825 switch (basePlacement) { 826 case enums_top: 827 offsets = { 828 x: commonX, 829 y: reference.y - element.height 830 }; 831 break; 832 833 case bottom: 834 offsets = { 835 x: commonX, 836 y: reference.y + reference.height 837 }; 838 break; 839 840 case right: 841 offsets = { 842 x: reference.x + reference.width, 843 y: commonY 844 }; 845 break; 846 847 case left: 848 offsets = { 849 x: reference.x - element.width, 850 y: commonY 851 }; 852 break; 853 854 default: 855 offsets = { 856 x: reference.x, 857 y: reference.y 858 }; 859 } 860 861 var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; 862 863 if (mainAxis != null) { 864 var len = mainAxis === 'y' ? 'height' : 'width'; 865 866 switch (variation) { 867 case start: 868 offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2); 869 break; 870 871 case end: 872 offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2); 873 break; 874 875 default: 876 } 877 } 878 879 return offsets; 880} 881;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js 882 883 884function popperOffsets(_ref) { 885 var state = _ref.state, 886 name = _ref.name; 887 // Offsets are the actual position the popper needs to have to be 888 // properly positioned near its reference element 889 // This is the most basic placement, and will be adjusted by 890 // the modifiers in the next step 891 state.modifiersData[name] = computeOffsets({ 892 reference: state.rects.reference, 893 element: state.rects.popper, 894 strategy: 'absolute', 895 placement: state.placement 896 }); 897} // eslint-disable-next-line import/no-unused-modules 898 899 900/* harmony default export */ const modifiers_popperOffsets = ({ 901 name: 'popperOffsets', 902 enabled: true, 903 phase: 'read', 904 fn: popperOffsets, 905 data: {} 906}); 907;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/computeStyles.js 908 909 910 911 912 913 914 915 // eslint-disable-next-line import/no-unused-modules 916 917var unsetSides = { 918 top: 'auto', 919 right: 'auto', 920 bottom: 'auto', 921 left: 'auto' 922}; // Round the offsets to the nearest suitable subpixel based on the DPR. 923// Zooming can change the DPR, but it seems to report a value that will 924// cleanly divide the values into the appropriate subpixels. 925 926function roundOffsetsByDPR(_ref, win) { 927 var x = _ref.x, 928 y = _ref.y; 929 var dpr = win.devicePixelRatio || 1; 930 return { 931 x: round(x * dpr) / dpr || 0, 932 y: round(y * dpr) / dpr || 0 933 }; 934} 935 936function mapToStyles(_ref2) { 937 var _Object$assign2; 938 939 var popper = _ref2.popper, 940 popperRect = _ref2.popperRect, 941 placement = _ref2.placement, 942 variation = _ref2.variation, 943 offsets = _ref2.offsets, 944 position = _ref2.position, 945 gpuAcceleration = _ref2.gpuAcceleration, 946 adaptive = _ref2.adaptive, 947 roundOffsets = _ref2.roundOffsets, 948 isFixed = _ref2.isFixed; 949 var _offsets$x = offsets.x, 950 x = _offsets$x === void 0 ? 0 : _offsets$x, 951 _offsets$y = offsets.y, 952 y = _offsets$y === void 0 ? 0 : _offsets$y; 953 954 var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({ 955 x: x, 956 y: y 957 }) : { 958 x: x, 959 y: y 960 }; 961 962 x = _ref3.x; 963 y = _ref3.y; 964 var hasX = offsets.hasOwnProperty('x'); 965 var hasY = offsets.hasOwnProperty('y'); 966 var sideX = left; 967 var sideY = enums_top; 968 var win = window; 969 970 if (adaptive) { 971 var offsetParent = getOffsetParent(popper); 972 var heightProp = 'clientHeight'; 973 var widthProp = 'clientWidth'; 974 975 if (offsetParent === getWindow(popper)) { 976 offsetParent = getDocumentElement(popper); 977 978 if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') { 979 heightProp = 'scrollHeight'; 980 widthProp = 'scrollWidth'; 981 } 982 } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it 983 984 985 offsetParent = offsetParent; 986 987 if (placement === enums_top || (placement === left || placement === right) && variation === end) { 988 sideY = bottom; 989 var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing] 990 offsetParent[heightProp]; 991 y -= offsetY - popperRect.height; 992 y *= gpuAcceleration ? 1 : -1; 993 } 994 995 if (placement === left || (placement === enums_top || placement === bottom) && variation === end) { 996 sideX = right; 997 var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing] 998 offsetParent[widthProp]; 999 x -= offsetX - popperRect.width; 1000 x *= gpuAcceleration ? 1 : -1; 1001 } 1002 } 1003 1004 var commonStyles = Object.assign({ 1005 position: position 1006 }, adaptive && unsetSides); 1007 1008 var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ 1009 x: x, 1010 y: y 1011 }, getWindow(popper)) : { 1012 x: x, 1013 y: y 1014 }; 1015 1016 x = _ref4.x; 1017 y = _ref4.y; 1018 1019 if (gpuAcceleration) { 1020 var _Object$assign; 1021 1022 return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); 1023 } 1024 1025 return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2)); 1026} 1027 1028function computeStyles(_ref5) { 1029 var state = _ref5.state, 1030 options = _ref5.options; 1031 var _options$gpuAccelerat = options.gpuAcceleration, 1032 gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, 1033 _options$adaptive = options.adaptive, 1034 adaptive = _options$adaptive === void 0 ? true : _options$adaptive, 1035 _options$roundOffsets = options.roundOffsets, 1036 roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; 1037 1038 if (false) { var transitionProperty; } 1039 1040 var commonStyles = { 1041 placement: getBasePlacement(state.placement), 1042 variation: getVariation(state.placement), 1043 popper: state.elements.popper, 1044 popperRect: state.rects.popper, 1045 gpuAcceleration: gpuAcceleration, 1046 isFixed: state.options.strategy === 'fixed' 1047 }; 1048 1049 if (state.modifiersData.popperOffsets != null) { 1050 state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { 1051 offsets: state.modifiersData.popperOffsets, 1052 position: state.options.strategy, 1053 adaptive: adaptive, 1054 roundOffsets: roundOffsets 1055 }))); 1056 } 1057 1058 if (state.modifiersData.arrow != null) { 1059 state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { 1060 offsets: state.modifiersData.arrow, 1061 position: 'absolute', 1062 adaptive: false, 1063 roundOffsets: roundOffsets 1064 }))); 1065 } 1066 1067 state.attributes.popper = Object.assign({}, state.attributes.popper, { 1068 'data-popper-placement': state.placement 1069 }); 1070} // eslint-disable-next-line import/no-unused-modules 1071 1072 1073/* harmony default export */ const modifiers_computeStyles = ({ 1074 name: 'computeStyles', 1075 enabled: true, 1076 phase: 'beforeWrite', 1077 fn: computeStyles, 1078 data: {} 1079}); 1080;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/applyStyles.js 1081 1082 // This modifier takes the styles prepared by the `computeStyles` modifier 1083// and applies them to the HTMLElements such as popper and arrow 1084 1085function applyStyles(_ref) { 1086 var state = _ref.state; 1087 Object.keys(state.elements).forEach(function (name) { 1088 var style = state.styles[name] || {}; 1089 var attributes = state.attributes[name] || {}; 1090 var element = state.elements[name]; // arrow is optional + virtual elements 1091 1092 if (!isHTMLElement(element) || !getNodeName(element)) { 1093 return; 1094 } // Flow doesn't support to extend this property, but it's the most 1095 // effective way to apply styles to an HTMLElement 1096 // $FlowFixMe[cannot-write] 1097 1098 1099 Object.assign(element.style, style); 1100 Object.keys(attributes).forEach(function (name) { 1101 var value = attributes[name]; 1102 1103 if (value === false) { 1104 element.removeAttribute(name); 1105 } else { 1106 element.setAttribute(name, value === true ? '' : value); 1107 } 1108 }); 1109 }); 1110} 1111 1112function applyStyles_effect(_ref2) { 1113 var state = _ref2.state; 1114 var initialStyles = { 1115 popper: { 1116 position: state.options.strategy, 1117 left: '0', 1118 top: '0', 1119 margin: '0' 1120 }, 1121 arrow: { 1122 position: 'absolute' 1123 }, 1124 reference: {} 1125 }; 1126 Object.assign(state.elements.popper.style, initialStyles.popper); 1127 state.styles = initialStyles; 1128 1129 if (state.elements.arrow) { 1130 Object.assign(state.elements.arrow.style, initialStyles.arrow); 1131 } 1132 1133 return function () { 1134 Object.keys(state.elements).forEach(function (name) { 1135 var element = state.elements[name]; 1136 var attributes = state.attributes[name] || {}; 1137 var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them 1138 1139 var style = styleProperties.reduce(function (style, property) { 1140 style[property] = ''; 1141 return style; 1142 }, {}); // arrow is optional + virtual elements 1143 1144 if (!isHTMLElement(element) || !getNodeName(element)) { 1145 return; 1146 } 1147 1148 Object.assign(element.style, style); 1149 Object.keys(attributes).forEach(function (attribute) { 1150 element.removeAttribute(attribute); 1151 }); 1152 }); 1153 }; 1154} // eslint-disable-next-line import/no-unused-modules 1155 1156 1157/* harmony default export */ const modifiers_applyStyles = ({ 1158 name: 'applyStyles', 1159 enabled: true, 1160 phase: 'write', 1161 fn: applyStyles, 1162 effect: applyStyles_effect, 1163 requires: ['computeStyles'] 1164}); 1165;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/offset.js 1166 1167 // eslint-disable-next-line import/no-unused-modules 1168 1169function distanceAndSkiddingToXY(placement, rects, offset) { 1170 var basePlacement = getBasePlacement(placement); 1171 var invertDistance = [left, enums_top].indexOf(basePlacement) >= 0 ? -1 : 1; 1172 1173 var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, { 1174 placement: placement 1175 })) : offset, 1176 skidding = _ref[0], 1177 distance = _ref[1]; 1178 1179 skidding = skidding || 0; 1180 distance = (distance || 0) * invertDistance; 1181 return [left, right].indexOf(basePlacement) >= 0 ? { 1182 x: distance, 1183 y: skidding 1184 } : { 1185 x: skidding, 1186 y: distance 1187 }; 1188} 1189 1190function offset(_ref2) { 1191 var state = _ref2.state, 1192 options = _ref2.options, 1193 name = _ref2.name; 1194 var _options$offset = options.offset, 1195 offset = _options$offset === void 0 ? [0, 0] : _options$offset; 1196 var data = enums_placements.reduce(function (acc, placement) { 1197 acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset); 1198 return acc; 1199 }, {}); 1200 var _data$state$placement = data[state.placement], 1201 x = _data$state$placement.x, 1202 y = _data$state$placement.y; 1203 1204 if (state.modifiersData.popperOffsets != null) { 1205 state.modifiersData.popperOffsets.x += x; 1206 state.modifiersData.popperOffsets.y += y; 1207 } 1208 1209 state.modifiersData[name] = data; 1210} // eslint-disable-next-line import/no-unused-modules 1211 1212 1213/* harmony default export */ const modifiers_offset = ({ 1214 name: 'offset', 1215 enabled: true, 1216 phase: 'main', 1217 requires: ['popperOffsets'], 1218 fn: offset 1219}); 1220;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js 1221var hash = { 1222 left: 'right', 1223 right: 'left', 1224 bottom: 'top', 1225 top: 'bottom' 1226}; 1227function getOppositePlacement(placement) { 1228 return placement.replace(/left|right|bottom|top/g, function (matched) { 1229 return hash[matched]; 1230 }); 1231} 1232;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js 1233var getOppositeVariationPlacement_hash = { 1234 start: 'end', 1235 end: 'start' 1236}; 1237function getOppositeVariationPlacement(placement) { 1238 return placement.replace(/start|end/g, function (matched) { 1239 return getOppositeVariationPlacement_hash[matched]; 1240 }); 1241} 1242;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js 1243 1244 1245 1246 1247function getViewportRect(element, strategy) { 1248 var win = getWindow(element); 1249 var html = getDocumentElement(element); 1250 var visualViewport = win.visualViewport; 1251 var width = html.clientWidth; 1252 var height = html.clientHeight; 1253 var x = 0; 1254 var y = 0; 1255 1256 if (visualViewport) { 1257 width = visualViewport.width; 1258 height = visualViewport.height; 1259 var layoutViewport = isLayoutViewport(); 1260 1261 if (layoutViewport || !layoutViewport && strategy === 'fixed') { 1262 x = visualViewport.offsetLeft; 1263 y = visualViewport.offsetTop; 1264 } 1265 } 1266 1267 return { 1268 width: width, 1269 height: height, 1270 x: x + getWindowScrollBarX(element), 1271 y: y 1272 }; 1273} 1274;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js 1275 1276 1277 1278 1279 // Gets the entire size of the scrollable document area, even extending outside 1280// of the `<html>` and `<body>` rect bounds if horizontally scrollable 1281 1282function getDocumentRect(element) { 1283 var _element$ownerDocumen; 1284 1285 var html = getDocumentElement(element); 1286 var winScroll = getWindowScroll(element); 1287 var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; 1288 var width = math_max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); 1289 var height = math_max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); 1290 var x = -winScroll.scrollLeft + getWindowScrollBarX(element); 1291 var y = -winScroll.scrollTop; 1292 1293 if (getComputedStyle(body || html).direction === 'rtl') { 1294 x += math_max(html.clientWidth, body ? body.clientWidth : 0) - width; 1295 } 1296 1297 return { 1298 width: width, 1299 height: height, 1300 x: x, 1301 y: y 1302 }; 1303} 1304;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/contains.js 1305 1306function contains(parent, child) { 1307 var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method 1308 1309 if (parent.contains(child)) { 1310 return true; 1311 } // then fallback to custom implementation with Shadow DOM support 1312 else if (rootNode && isShadowRoot(rootNode)) { 1313 var next = child; 1314 1315 do { 1316 if (next && parent.isSameNode(next)) { 1317 return true; 1318 } // $FlowFixMe[prop-missing]: need a better way to handle this... 1319 1320 1321 next = next.parentNode || next.host; 1322 } while (next); 1323 } // Give up, the result is false 1324 1325 1326 return false; 1327} 1328;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/rectToClientRect.js 1329function rectToClientRect(rect) { 1330 return Object.assign({}, rect, { 1331 left: rect.x, 1332 top: rect.y, 1333 right: rect.x + rect.width, 1334 bottom: rect.y + rect.height 1335 }); 1336} 1337;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353function getInnerBoundingClientRect(element, strategy) { 1354 var rect = getBoundingClientRect(element, false, strategy === 'fixed'); 1355 rect.top = rect.top + element.clientTop; 1356 rect.left = rect.left + element.clientLeft; 1357 rect.bottom = rect.top + element.clientHeight; 1358 rect.right = rect.left + element.clientWidth; 1359 rect.width = element.clientWidth; 1360 rect.height = element.clientHeight; 1361 rect.x = rect.left; 1362 rect.y = rect.top; 1363 return rect; 1364} 1365 1366function getClientRectFromMixedType(element, clippingParent, strategy) { 1367 return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element))); 1368} // A "clipping parent" is an overflowable container with the characteristic of 1369// clipping (or hiding) overflowing elements with a position different from 1370// `initial` 1371 1372 1373function getClippingParents(element) { 1374 var clippingParents = listScrollParents(getParentNode(element)); 1375 var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0; 1376 var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element; 1377 1378 if (!isElement(clipperElement)) { 1379 return []; 1380 } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414 1381 1382 1383 return clippingParents.filter(function (clippingParent) { 1384 return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; 1385 }); 1386} // Gets the maximum area that the element is visible in due to any number of 1387// clipping parents 1388 1389 1390function getClippingRect(element, boundary, rootBoundary, strategy) { 1391 var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary); 1392 var clippingParents = [].concat(mainClippingParents, [rootBoundary]); 1393 var firstClippingParent = clippingParents[0]; 1394 var clippingRect = clippingParents.reduce(function (accRect, clippingParent) { 1395 var rect = getClientRectFromMixedType(element, clippingParent, strategy); 1396 accRect.top = math_max(rect.top, accRect.top); 1397 accRect.right = math_min(rect.right, accRect.right); 1398 accRect.bottom = math_min(rect.bottom, accRect.bottom); 1399 accRect.left = math_max(rect.left, accRect.left); 1400 return accRect; 1401 }, getClientRectFromMixedType(element, firstClippingParent, strategy)); 1402 clippingRect.width = clippingRect.right - clippingRect.left; 1403 clippingRect.height = clippingRect.bottom - clippingRect.top; 1404 clippingRect.x = clippingRect.left; 1405 clippingRect.y = clippingRect.top; 1406 return clippingRect; 1407} 1408;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js 1409function getFreshSideObject() { 1410 return { 1411 top: 0, 1412 right: 0, 1413 bottom: 0, 1414 left: 0 1415 }; 1416} 1417;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js 1418 1419function mergePaddingObject(paddingObject) { 1420 return Object.assign({}, getFreshSideObject(), paddingObject); 1421} 1422;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/expandToHashMap.js 1423function expandToHashMap(value, keys) { 1424 return keys.reduce(function (hashMap, key) { 1425 hashMap[key] = value; 1426 return hashMap; 1427 }, {}); 1428} 1429;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/detectOverflow.js 1430 1431 1432 1433 1434 1435 1436 1437 1438 // eslint-disable-next-line import/no-unused-modules 1439 1440function detectOverflow(state, options) { 1441 if (options === void 0) { 1442 options = {}; 1443 } 1444 1445 var _options = options, 1446 _options$placement = _options.placement, 1447 placement = _options$placement === void 0 ? state.placement : _options$placement, 1448 _options$strategy = _options.strategy, 1449 strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, 1450 _options$boundary = _options.boundary, 1451 boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, 1452 _options$rootBoundary = _options.rootBoundary, 1453 rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, 1454 _options$elementConte = _options.elementContext, 1455 elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, 1456 _options$altBoundary = _options.altBoundary, 1457 altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, 1458 _options$padding = _options.padding, 1459 padding = _options$padding === void 0 ? 0 : _options$padding; 1460 var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); 1461 var altContext = elementContext === popper ? reference : popper; 1462 var popperRect = state.rects.popper; 1463 var element = state.elements[altBoundary ? altContext : elementContext]; 1464 var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy); 1465 var referenceClientRect = getBoundingClientRect(state.elements.reference); 1466 var popperOffsets = computeOffsets({ 1467 reference: referenceClientRect, 1468 element: popperRect, 1469 strategy: 'absolute', 1470 placement: placement 1471 }); 1472 var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets)); 1473 var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect 1474 // 0 or negative = within the clipping rect 1475 1476 var overflowOffsets = { 1477 top: clippingClientRect.top - elementClientRect.top + paddingObject.top, 1478 bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, 1479 left: clippingClientRect.left - elementClientRect.left + paddingObject.left, 1480 right: elementClientRect.right - clippingClientRect.right + paddingObject.right 1481 }; 1482 var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element 1483 1484 if (elementContext === popper && offsetData) { 1485 var offset = offsetData[placement]; 1486 Object.keys(overflowOffsets).forEach(function (key) { 1487 var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; 1488 var axis = [enums_top, bottom].indexOf(key) >= 0 ? 'y' : 'x'; 1489 overflowOffsets[key] += offset[axis] * multiply; 1490 }); 1491 } 1492 1493 return overflowOffsets; 1494} 1495;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js 1496 1497 1498 1499 1500function computeAutoPlacement(state, options) { 1501 if (options === void 0) { 1502 options = {}; 1503 } 1504 1505 var _options = options, 1506 placement = _options.placement, 1507 boundary = _options.boundary, 1508 rootBoundary = _options.rootBoundary, 1509 padding = _options.padding, 1510 flipVariations = _options.flipVariations, 1511 _options$allowedAutoP = _options.allowedAutoPlacements, 1512 allowedAutoPlacements = _options$allowedAutoP === void 0 ? enums_placements : _options$allowedAutoP; 1513 var variation = getVariation(placement); 1514 var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) { 1515 return getVariation(placement) === variation; 1516 }) : basePlacements; 1517 var allowedPlacements = placements.filter(function (placement) { 1518 return allowedAutoPlacements.indexOf(placement) >= 0; 1519 }); 1520 1521 if (allowedPlacements.length === 0) { 1522 allowedPlacements = placements; 1523 1524 if (false) {} 1525 } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions... 1526 1527 1528 var overflows = allowedPlacements.reduce(function (acc, placement) { 1529 acc[placement] = detectOverflow(state, { 1530 placement: placement, 1531 boundary: boundary, 1532 rootBoundary: rootBoundary, 1533 padding: padding 1534 })[getBasePlacement(placement)]; 1535 return acc; 1536 }, {}); 1537 return Object.keys(overflows).sort(function (a, b) { 1538 return overflows[a] - overflows[b]; 1539 }); 1540} 1541;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/flip.js 1542 1543 1544 1545 1546 1547 1548 // eslint-disable-next-line import/no-unused-modules 1549 1550function getExpandedFallbackPlacements(placement) { 1551 if (getBasePlacement(placement) === auto) { 1552 return []; 1553 } 1554 1555 var oppositePlacement = getOppositePlacement(placement); 1556 return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; 1557} 1558 1559function flip(_ref) { 1560 var state = _ref.state, 1561 options = _ref.options, 1562 name = _ref.name; 1563 1564 if (state.modifiersData[name]._skip) { 1565 return; 1566 } 1567 1568 var _options$mainAxis = options.mainAxis, 1569 checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, 1570 _options$altAxis = options.altAxis, 1571 checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, 1572 specifiedFallbackPlacements = options.fallbackPlacements, 1573 padding = options.padding, 1574 boundary = options.boundary, 1575 rootBoundary = options.rootBoundary, 1576 altBoundary = options.altBoundary, 1577 _options$flipVariatio = options.flipVariations, 1578 flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, 1579 allowedAutoPlacements = options.allowedAutoPlacements; 1580 var preferredPlacement = state.options.placement; 1581 var basePlacement = getBasePlacement(preferredPlacement); 1582 var isBasePlacement = basePlacement === preferredPlacement; 1583 var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); 1584 var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) { 1585 return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, { 1586 placement: placement, 1587 boundary: boundary, 1588 rootBoundary: rootBoundary, 1589 padding: padding, 1590 flipVariations: flipVariations, 1591 allowedAutoPlacements: allowedAutoPlacements 1592 }) : placement); 1593 }, []); 1594 var referenceRect = state.rects.reference; 1595 var popperRect = state.rects.popper; 1596 var checksMap = new Map(); 1597 var makeFallbackChecks = true; 1598 var firstFittingPlacement = placements[0]; 1599 1600 for (var i = 0; i < placements.length; i++) { 1601 var placement = placements[i]; 1602 1603 var _basePlacement = getBasePlacement(placement); 1604 1605 var isStartVariation = getVariation(placement) === start; 1606 var isVertical = [enums_top, bottom].indexOf(_basePlacement) >= 0; 1607 var len = isVertical ? 'width' : 'height'; 1608 var overflow = detectOverflow(state, { 1609 placement: placement, 1610 boundary: boundary, 1611 rootBoundary: rootBoundary, 1612 altBoundary: altBoundary, 1613 padding: padding 1614 }); 1615 var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : enums_top; 1616 1617 if (referenceRect[len] > popperRect[len]) { 1618 mainVariationSide = getOppositePlacement(mainVariationSide); 1619 } 1620 1621 var altVariationSide = getOppositePlacement(mainVariationSide); 1622 var checks = []; 1623 1624 if (checkMainAxis) { 1625 checks.push(overflow[_basePlacement] <= 0); 1626 } 1627 1628 if (checkAltAxis) { 1629 checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); 1630 } 1631 1632 if (checks.every(function (check) { 1633 return check; 1634 })) { 1635 firstFittingPlacement = placement; 1636 makeFallbackChecks = false; 1637 break; 1638 } 1639 1640 checksMap.set(placement, checks); 1641 } 1642 1643 if (makeFallbackChecks) { 1644 // `2` may be desired in some cases â research later 1645 var numberOfChecks = flipVariations ? 3 : 1; 1646 1647 var _loop = function _loop(_i) { 1648 var fittingPlacement = placements.find(function (placement) { 1649 var checks = checksMap.get(placement); 1650 1651 if (checks) { 1652 return checks.slice(0, _i).every(function (check) { 1653 return check; 1654 }); 1655 } 1656 }); 1657 1658 if (fittingPlacement) { 1659 firstFittingPlacement = fittingPlacement; 1660 return "break"; 1661 } 1662 }; 1663 1664 for (var _i = numberOfChecks; _i > 0; _i--) { 1665 var _ret = _loop(_i); 1666 1667 if (_ret === "break") break; 1668 } 1669 } 1670 1671 if (state.placement !== firstFittingPlacement) { 1672 state.modifiersData[name]._skip = true; 1673 state.placement = firstFittingPlacement; 1674 state.reset = true; 1675 } 1676} // eslint-disable-next-line import/no-unused-modules 1677 1678 1679/* harmony default export */ const modifiers_flip = ({ 1680 name: 'flip', 1681 enabled: true, 1682 phase: 'main', 1683 fn: flip, 1684 requiresIfExists: ['offset'], 1685 data: { 1686 _skip: false 1687 } 1688}); 1689;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getAltAxis.js 1690function getAltAxis(axis) { 1691 return axis === 'x' ? 'y' : 'x'; 1692} 1693;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/within.js 1694 1695function within(min, value, max) { 1696 return math_max(min, math_min(value, max)); 1697} 1698function withinMaxClamp(min, value, max) { 1699 var v = within(min, value, max); 1700 return v > max ? max : v; 1701} 1702;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715function preventOverflow(_ref) { 1716 var state = _ref.state, 1717 options = _ref.options, 1718 name = _ref.name; 1719 var _options$mainAxis = options.mainAxis, 1720 checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, 1721 _options$altAxis = options.altAxis, 1722 checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, 1723 boundary = options.boundary, 1724 rootBoundary = options.rootBoundary, 1725 altBoundary = options.altBoundary, 1726 padding = options.padding, 1727 _options$tether = options.tether, 1728 tether = _options$tether === void 0 ? true : _options$tether, 1729 _options$tetherOffset = options.tetherOffset, 1730 tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; 1731 var overflow = detectOverflow(state, { 1732 boundary: boundary, 1733 rootBoundary: rootBoundary, 1734 padding: padding, 1735 altBoundary: altBoundary 1736 }); 1737 var basePlacement = getBasePlacement(state.placement); 1738 var variation = getVariation(state.placement); 1739 var isBasePlacement = !variation; 1740 var mainAxis = getMainAxisFromPlacement(basePlacement); 1741 var altAxis = getAltAxis(mainAxis); 1742 var popperOffsets = state.modifiersData.popperOffsets; 1743 var referenceRect = state.rects.reference; 1744 var popperRect = state.rects.popper; 1745 var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, { 1746 placement: state.placement 1747 })) : tetherOffset; 1748 var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? { 1749 mainAxis: tetherOffsetValue, 1750 altAxis: tetherOffsetValue 1751 } : Object.assign({ 1752 mainAxis: 0, 1753 altAxis: 0 1754 }, tetherOffsetValue); 1755 var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null; 1756 var data = { 1757 x: 0, 1758 y: 0 1759 }; 1760 1761 if (!popperOffsets) { 1762 return; 1763 } 1764 1765 if (checkMainAxis) { 1766 var _offsetModifierState$; 1767 1768 var mainSide = mainAxis === 'y' ? enums_top : left; 1769 var altSide = mainAxis === 'y' ? bottom : right; 1770 var len = mainAxis === 'y' ? 'height' : 'width'; 1771 var offset = popperOffsets[mainAxis]; 1772 var min = offset + overflow[mainSide]; 1773 var max = offset - overflow[altSide]; 1774 var additive = tether ? -popperRect[len] / 2 : 0; 1775 var minLen = variation === start ? referenceRect[len] : popperRect[len]; 1776 var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go 1777 // outside the reference bounds 1778 1779 var arrowElement = state.elements.arrow; 1780 var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { 1781 width: 0, 1782 height: 0 1783 }; 1784 var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject(); 1785 var arrowPaddingMin = arrowPaddingObject[mainSide]; 1786 var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want 1787 // to include its full size in the calculation. If the reference is small 1788 // and near the edge of a boundary, the popper can overflow even if the 1789 // reference is not overflowing as well (e.g. virtual elements with no 1790 // width or height) 1791 1792 var arrowLen = within(0, referenceRect[len], arrowRect[len]); 1793 var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis; 1794 var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis; 1795 var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); 1796 var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; 1797 var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0; 1798 var tetherMin = offset + minOffset - offsetModifierValue - clientOffset; 1799 var tetherMax = offset + maxOffset - offsetModifierValue; 1800 var preventedOffset = within(tether ? math_min(min, tetherMin) : min, offset, tether ? math_max(max, tetherMax) : max); 1801 popperOffsets[mainAxis] = preventedOffset; 1802 data[mainAxis] = preventedOffset - offset; 1803 } 1804 1805 if (checkAltAxis) { 1806 var _offsetModifierState$2; 1807 1808 var _mainSide = mainAxis === 'x' ? enums_top : left; 1809 1810 var _altSide = mainAxis === 'x' ? bottom : right; 1811 1812 var _offset = popperOffsets[altAxis]; 1813 1814 var _len = altAxis === 'y' ? 'height' : 'width'; 1815 1816 var _min = _offset + overflow[_mainSide]; 1817 1818 var _max = _offset - overflow[_altSide]; 1819 1820 var isOriginSide = [enums_top, left].indexOf(basePlacement) !== -1; 1821 1822 var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0; 1823 1824 var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis; 1825 1826 var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max; 1827 1828 var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max); 1829 1830 popperOffsets[altAxis] = _preventedOffset; 1831 data[altAxis] = _preventedOffset - _offset; 1832 } 1833 1834 state.modifiersData[name] = data; 1835} // eslint-disable-next-line import/no-unused-modules 1836 1837 1838/* harmony default export */ const modifiers_preventOverflow = ({ 1839 name: 'preventOverflow', 1840 enabled: true, 1841 phase: 'main', 1842 fn: preventOverflow, 1843 requiresIfExists: ['offset'] 1844}); 1845;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/arrow.js 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 // eslint-disable-next-line import/no-unused-modules 1856 1857var toPaddingObject = function toPaddingObject(padding, state) { 1858 padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, { 1859 placement: state.placement 1860 })) : padding; 1861 return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); 1862}; 1863 1864function arrow(_ref) { 1865 var _state$modifiersData$; 1866 1867 var state = _ref.state, 1868 name = _ref.name, 1869 options = _ref.options; 1870 var arrowElement = state.elements.arrow; 1871 var popperOffsets = state.modifiersData.popperOffsets; 1872 var basePlacement = getBasePlacement(state.placement); 1873 var axis = getMainAxisFromPlacement(basePlacement); 1874 var isVertical = [left, right].indexOf(basePlacement) >= 0; 1875 var len = isVertical ? 'height' : 'width'; 1876 1877 if (!arrowElement || !popperOffsets) { 1878 return; 1879 } 1880 1881 var paddingObject = toPaddingObject(options.padding, state); 1882 var arrowRect = getLayoutRect(arrowElement); 1883 var minProp = axis === 'y' ? enums_top : left; 1884 var maxProp = axis === 'y' ? bottom : right; 1885 var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len]; 1886 var startDiff = popperOffsets[axis] - state.rects.reference[axis]; 1887 var arrowOffsetParent = getOffsetParent(arrowElement); 1888 var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; 1889 var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is 1890 // outside of the popper bounds 1891 1892 var min = paddingObject[minProp]; 1893 var max = clientSize - arrowRect[len] - paddingObject[maxProp]; 1894 var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference; 1895 var offset = within(min, center, max); // Prevents breaking syntax highlighting... 1896 1897 var axisProp = axis; 1898 state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$); 1899} 1900 1901function arrow_effect(_ref2) { 1902 var state = _ref2.state, 1903 options = _ref2.options; 1904 var _options$element = options.element, 1905 arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element; 1906 1907 if (arrowElement == null) { 1908 return; 1909 } // CSS selector 1910 1911 1912 if (typeof arrowElement === 'string') { 1913 arrowElement = state.elements.popper.querySelector(arrowElement); 1914 1915 if (!arrowElement) { 1916 return; 1917 } 1918 } 1919 1920 if (false) {} 1921 1922 if (!contains(state.elements.popper, arrowElement)) { 1923 if (false) {} 1924 1925 return; 1926 } 1927 1928 state.elements.arrow = arrowElement; 1929} // eslint-disable-next-line import/no-unused-modules 1930 1931 1932/* harmony default export */ const modifiers_arrow = ({ 1933 name: 'arrow', 1934 enabled: true, 1935 phase: 'main', 1936 fn: arrow, 1937 effect: arrow_effect, 1938 requires: ['popperOffsets'], 1939 requiresIfExists: ['preventOverflow'] 1940}); 1941;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/hide.js 1942 1943 1944 1945function getSideOffsets(overflow, rect, preventedOffsets) { 1946 if (preventedOffsets === void 0) { 1947 preventedOffsets = { 1948 x: 0, 1949 y: 0 1950 }; 1951 } 1952 1953 return { 1954 top: overflow.top - rect.height - preventedOffsets.y, 1955 right: overflow.right - rect.width + preventedOffsets.x, 1956 bottom: overflow.bottom - rect.height + preventedOffsets.y, 1957 left: overflow.left - rect.width - preventedOffsets.x 1958 }; 1959} 1960 1961function isAnySideFullyClipped(overflow) { 1962 return [enums_top, right, bottom, left].some(function (side) { 1963 return overflow[side] >= 0; 1964 }); 1965} 1966 1967function hide(_ref) { 1968 var state = _ref.state, 1969 name = _ref.name; 1970 var referenceRect = state.rects.reference; 1971 var popperRect = state.rects.popper; 1972 var preventedOffsets = state.modifiersData.preventOverflow; 1973 var referenceOverflow = detectOverflow(state, { 1974 elementContext: 'reference' 1975 }); 1976 var popperAltOverflow = detectOverflow(state, { 1977 altBoundary: true 1978 }); 1979 var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect); 1980 var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); 1981 var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets); 1982 var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets); 1983 state.modifiersData[name] = { 1984 referenceClippingOffsets: referenceClippingOffsets, 1985 popperEscapeOffsets: popperEscapeOffsets, 1986 isReferenceHidden: isReferenceHidden, 1987 hasPopperEscaped: hasPopperEscaped 1988 }; 1989 state.attributes.popper = Object.assign({}, state.attributes.popper, { 1990 'data-popper-reference-hidden': isReferenceHidden, 1991 'data-popper-escaped': hasPopperEscaped 1992 }); 1993} // eslint-disable-next-line import/no-unused-modules 1994 1995 1996/* harmony default export */ const modifiers_hide = ({ 1997 name: 'hide', 1998 enabled: true, 1999 phase: 'main', 2000 requiresIfExists: ['preventOverflow'], 2001 fn: hide 2002}); 2003;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/popper.js 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014var defaultModifiers = [eventListeners, modifiers_popperOffsets, modifiers_computeStyles, modifiers_applyStyles, modifiers_offset, modifiers_flip, modifiers_preventOverflow, modifiers_arrow, modifiers_hide]; 2015var popper_createPopper = /*#__PURE__*/popperGenerator({ 2016 defaultModifiers: defaultModifiers 2017}); // eslint-disable-next-line import/no-unused-modules 2018 2019 // eslint-disable-next-line import/no-unused-modules 2020 2021 // eslint-disable-next-line import/no-unused-modules 2022 2023 2024 2025/***/ }), 2026
vendor: 828 bytes, lines 2027-2056
2027/***/ "./node_modules/flatpickr/dist/esm/utils/polyfills.js": 2028/***/ (() => { 2029 2030"use strict"; 2031 2032if (typeof Object.assign !== "function") { 2033 Object.assign = function (target) { 2034 var args = []; 2035 for (var _i = 1; _i < arguments.length; _i++) { 2036 args[_i - 1] = arguments[_i]; 2037 } 2038 if (!target) { 2039 throw TypeError("Cannot convert undefined or null to object"); 2040 } 2041 var _loop_1 = function (source) { 2042 if (source) { 2043 Object.keys(source).forEach(function (key) { return (target[key] = source[key]); }); 2044 } 2045 }; 2046 for (var _a = 0, args_1 = args; _a < args_1.length; _a++) { 2047 var source = args_1[_a]; 2048 _loop_1(source); 2049 } 2050 return target; 2051 }; 2052} 2053 2054 2055/***/ }), 2056
vendor: 1,677 bytes, lines 2057-2128
2057/***/ "./node_modules/flatpickr/dist/l10n/pt.js": 2058/***/ (function(__unused_webpack_module, exports) { 2059 2060(function (global, factory) { 2061 true ? factory(exports) : 2062 0; 2063}(this, (function (exports) { 'use strict'; 2064 2065 var fp = typeof window !== "undefined" && window.flatpickr !== undefined 2066 ? window.flatpickr 2067 : { 2068 l10ns: {}, 2069 }; 2070 var Portuguese = { 2071 weekdays: { 2072 shorthand: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"], 2073 longhand: [ 2074 "Domingo", 2075 "Segunda-feira", 2076 "Terça-feira", 2077 "Quarta-feira", 2078 "Quinta-feira", 2079 "Sexta-feira", 2080 "Sábado", 2081 ], 2082 }, 2083 months: { 2084 shorthand: [ 2085 "Jan", 2086 "Fev", 2087 "Mar", 2088 "Abr", 2089 "Mai", 2090 "Jun", 2091 "Jul", 2092 "Ago", 2093 "Set", 2094 "Out", 2095 "Nov", 2096 "Dez", 2097 ], 2098 longhand: [ 2099 "Janeiro", 2100 "Fevereiro", 2101 "Março", 2102 "Abril", 2103 "Maio", 2104 "Junho", 2105 "Julho", 2106 "Agosto", 2107 "Setembro", 2108 "Outubro", 2109 "Novembro", 2110 "Dezembro", 2111 ], 2112 }, 2113 rangeSeparator: " até ", 2114 time_24hr: true, 2115 }; 2116 fp.l10ns.pt = Portuguese; 2117 var pt = fp.l10ns; 2118 2119 exports.Portuguese = Portuguese; 2120 exports.default = pt; 2121 2122 Object.defineProperty(exports, '__esModule', { value: true }); 2123 2124}))); 2125 2126 2127/***/ }), 2128
vendor: 11,788 bytes, lines 2129-2446
2129/***/ "./node_modules/focus-visible/dist/focus-visible.js": 2130/***/ (function() { 2131 2132(function (global, factory) { 2133 true ? factory() : 2134 0; 2135}(this, (function () { 'use strict'; 2136 2137 /** 2138 * Applies the :focus-visible polyfill at the given scope. 2139 * A scope in this case is either the top-level Document or a Shadow Root. 2140 * 2141 * @param {(Document|ShadowRoot)} scope 2142 * @see https://github.com/WICG/focus-visible 2143 */ 2144 function applyFocusVisiblePolyfill(scope) { 2145 var hadKeyboardEvent = true; 2146 var hadFocusVisibleRecently = false; 2147 var hadFocusVisibleRecentlyTimeout = null; 2148 2149 var inputTypesAllowlist = { 2150 text: true, 2151 search: true, 2152 url: true, 2153 tel: true, 2154 email: true, 2155 password: true, 2156 number: true, 2157 date: true, 2158 month: true, 2159 week: true, 2160 time: true, 2161 datetime: true, 2162 'datetime-local': true 2163 }; 2164 2165 /** 2166 * Helper function for legacy browsers and iframes which sometimes focus 2167 * elements like document, body, and non-interactive SVG. 2168 * @param {Element} el 2169 */ 2170 function isValidFocusTarget(el) { 2171 if ( 2172 el && 2173 el !== document && 2174 el.nodeName !== 'HTML' && 2175 el.nodeName !== 'BODY' && 2176 'classList' in el && 2177 'contains' in el.classList 2178 ) { 2179 return true; 2180 } 2181 return false; 2182 } 2183 2184 /** 2185 * Computes whether the given element should automatically trigger the 2186 * `focus-visible` class being added, i.e. whether it should always match 2187 * `:focus-visible` when focused. 2188 * @param {Element} el 2189 * @return {boolean} 2190 */ 2191 function focusTriggersKeyboardModality(el) { 2192 var type = el.type; 2193 var tagName = el.tagName; 2194 2195 if (tagName === 'INPUT' && inputTypesAllowlist[type] && !el.readOnly) { 2196 return true; 2197 } 2198 2199 if (tagName === 'TEXTAREA' && !el.readOnly) { 2200 return true; 2201 } 2202 2203 if (el.isContentEditable) { 2204 return true; 2205 } 2206 2207 return false; 2208 } 2209 2210 /** 2211 * Add the `focus-visible` class to the given element if it was not added by 2212 * the author. 2213 * @param {Element} el 2214 */ 2215 function addFocusVisibleClass(el) { 2216 if (el.classList.contains('focus-visible')) { 2217 return; 2218 } 2219 el.classList.add('focus-visible'); 2220 el.setAttribute('data-focus-visible-added', ''); 2221 } 2222 2223 /** 2224 * Remove the `focus-visible` class from the given element if it was not 2225 * originally added by the author. 2226 * @param {Element} el 2227 */ 2228 function removeFocusVisibleClass(el) { 2229 if (!el.hasAttribute('data-focus-visible-added')) { 2230 return; 2231 } 2232 el.classList.remove('focus-visible'); 2233 el.removeAttribute('data-focus-visible-added'); 2234 } 2235 2236 /** 2237 * If the most recent user interaction was via the keyboard; 2238 * and the key press did not include a meta, alt/option, or control key; 2239 * then the modality is keyboard. Otherwise, the modality is not keyboard. 2240 * Apply `focus-visible` to any current active element and keep track 2241 * of our keyboard modality state with `hadKeyboardEvent`. 2242 * @param {KeyboardEvent} e 2243 */ 2244 function onKeyDown(e) { 2245 if (e.metaKey || e.altKey || e.ctrlKey) { 2246 return; 2247 } 2248 2249 if (isValidFocusTarget(scope.activeElement)) { 2250 addFocusVisibleClass(scope.activeElement); 2251 } 2252 2253 hadKeyboardEvent = true; 2254 } 2255 2256 /** 2257 * If at any point a user clicks with a pointing device, ensure that we change 2258 * the modality away from keyboard. 2259 * This avoids the situation where a user presses a key on an already focused 2260 * element, and then clicks on a different element, focusing it with a 2261 * pointing device, while we still think we're in keyboard modality. 2262 * @param {Event} e 2263 */ 2264 function onPointerDown(e) { 2265 hadKeyboardEvent = false; 2266 } 2267 2268 /** 2269 * On `focus`, add the `focus-visible` class to the target if: 2270 * - the target received focus as a result of keyboard navigation, or 2271 * - the event target is an element that will likely require interaction 2272 * via the keyboard (e.g. a text box) 2273 * @param {Event} e 2274 */ 2275 function onFocus(e) { 2276 // Prevent IE from focusing the document or HTML element. 2277 if (!isValidFocusTarget(e.target)) { 2278 return; 2279 } 2280 2281 if (hadKeyboardEvent || focusTriggersKeyboardModality(e.target)) { 2282 addFocusVisibleClass(e.target); 2283 } 2284 } 2285 2286 /** 2287 * On `blur`, remove the `focus-visible` class from the target. 2288 * @param {Event} e 2289 */ 2290 function onBlur(e) { 2291 if (!isValidFocusTarget(e.target)) { 2292 return; 2293 } 2294 2295 if ( 2296 e.target.classList.contains('focus-visible') || 2297 e.target.hasAttribute('data-focus-visible-added') 2298 ) { 2299 // To detect a tab/window switch, we look for a blur event followed 2300 // rapidly by a visibility change. 2301 // If we don't see a visibility change within 100ms, it's probably a 2302 // regular focus change. 2303 hadFocusVisibleRecently = true; 2304 window.clearTimeout(hadFocusVisibleRecentlyTimeout); 2305 hadFocusVisibleRecentlyTimeout = window.setTimeout(function() { 2306 hadFocusVisibleRecently = false; 2307 }, 100); 2308 removeFocusVisibleClass(e.target); 2309 } 2310 } 2311 2312 /** 2313 * If the user changes tabs, keep track of whether or not the previously 2314 * focused element had .focus-visible. 2315 * @param {Event} e 2316 */ 2317 function onVisibilityChange(e) { 2318 if (document.visibilityState === 'hidden') { 2319 // If the tab becomes active again, the browser will handle calling focus 2320 // on the element (Safari actually calls it twice). 2321 // If this tab change caused a blur on an element with focus-visible, 2322 // re-apply the class when the user switches back to the tab. 2323 if (hadFocusVisibleRecently) { 2324 hadKeyboardEvent = true; 2325 } 2326 addInitialPointerMoveListeners(); 2327 } 2328 } 2329 2330 /** 2331 * Add a group of listeners to detect usage of any pointing devices. 2332 * These listeners will be added when the polyfill first loads, and anytime 2333 * the window is blurred, so that they are active when the window regains 2334 * focus. 2335 */ 2336 function addInitialPointerMoveListeners() { 2337 document.addEventListener('mousemove', onInitialPointerMove); 2338 document.addEventListener('mousedown', onInitialPointerMove); 2339 document.addEventListener('mouseup', onInitialPointerMove); 2340 document.addEventListener('pointermove', onInitialPointerMove); 2341 document.addEventListener('pointerdown', onInitialPointerMove); 2342 document.addEventListener('pointerup', onInitialPointerMove); 2343 document.addEventListener('touchmove', onInitialPointerMove); 2344 document.addEventListener('touchstart', onInitialPointerMove); 2345 document.addEventListener('touchend', onInitialPointerMove); 2346 } 2347 2348 function removeInitialPointerMoveListeners() { 2349 document.removeEventListener('mousemove', onInitialPointerMove); 2350 document.removeEventListener('mousedown', onInitialPointerMove); 2351 document.removeEventListener('mouseup', onInitialPointerMove); 2352 document.removeEventListener('pointermove', onInitialPointerMove); 2353 document.removeEventListener('pointerdown', onInitialPointerMove); 2354 document.removeEventListener('pointerup', onInitialPointerMove); 2355 document.removeEventListener('touchmove', onInitialPointerMove); 2356 document.removeEventListener('touchstart', onInitialPointerMove); 2357 document.removeEventListener('touchend', onInitialPointerMove); 2358 } 2359 2360 /** 2361 * When the polfyill first loads, assume the user is in keyboard modality. 2362 * If any event is received from a pointing device (e.g. mouse, pointer, 2363 * touch), turn off keyboard modality. 2364 * This accounts for situations where focus enters the page from the URL bar. 2365 * @param {Event} e 2366 */ 2367 function onInitialPointerMove(e) { 2368 // Work around a Safari quirk that fires a mousemove on <html> whenever the 2369 // window blurs, even if you're tabbing out of the page. ¯\_(ã)_/¯ 2370 if (e.target.nodeName && e.target.nodeName.toLowerCase() === 'html') { 2371 return; 2372 } 2373 2374 hadKeyboardEvent = false; 2375 removeInitialPointerMoveListeners(); 2376 } 2377 2378 // For some kinds of state, we are interested in changes at the global scope 2379 // only. For example, global pointer input, global key presses and global 2380 // visibility change should affect the state at every scope: 2381 document.addEventListener('keydown', onKeyDown, true); 2382 document.addEventListener('mousedown', onPointerDown, true); 2383 document.addEventListener('pointerdown', onPointerDown, true); 2384 document.addEventListener('touchstart', onPointerDown, true); 2385 document.addEventListener('visibilitychange', onVisibilityChange, true); 2386 2387 addInitialPointerMoveListeners(); 2388 2389 // For focus and blur, we specifically care about state changes in the local 2390 // scope. This is because focus / blur events that originate from within a 2391 // shadow root are not re-dispatched from the host element if it was already 2392 // the active element in its own scope: 2393 scope.addEventListener('focus', onFocus, true); 2394 scope.addEventListener('blur', onBlur, true); 2395 2396 // We detect that a node is a ShadowRoot by ensuring that it is a 2397 // DocumentFragment and also has a host property. This check covers native 2398 // implementation and polyfill implementation transparently. If we only cared 2399 // about the native implementation, we could just check if the scope was 2400 // an instance of a ShadowRoot. 2401 if (scope.nodeType === Node.DOCUMENT_FRAGMENT_NODE && scope.host) { 2402 // Since a ShadowRoot is a special kind of DocumentFragment, it does not 2403 // have a root element to add a class to. So, we add this attribute to the 2404 // host element instead: 2405 scope.host.setAttribute('data-js-focus-visible', ''); 2406 } else if (scope.nodeType === Node.DOCUMENT_NODE) { 2407 document.documentElement.classList.add('js-focus-visible'); 2408 document.documentElement.setAttribute('data-js-focus-visible', ''); 2409 } 2410 } 2411 2412 // It is important to wrap all references to global window and document in 2413 // these checks to support server-side rendering use cases 2414 // @see https://github.com/WICG/focus-visible/issues/199 2415 if (typeof window !== 'undefined' && typeof document !== 'undefined') { 2416 // Make the polyfill helper globally available. This can be used as a signal 2417 // to interested libraries that wish to coordinate with the polyfill for e.g., 2418 // applying the polyfill to a shadow root: 2419 window.applyFocusVisiblePolyfill = applyFocusVisiblePolyfill; 2420 2421 // Notify interested libraries of the polyfill's presence, in case the 2422 // polyfill was loaded lazily: 2423 var event; 2424 2425 try { 2426 event = new CustomEvent('focus-visible-polyfill-ready'); 2427 } catch (error) { 2428 // IE11 does not support using CustomEvent as a constructor directly: 2429 event = document.createEvent('CustomEvent'); 2430 event.initCustomEvent('focus-visible-polyfill-ready', false, false, {}); 2431 } 2432 2433 window.dispatchEvent(event); 2434 } 2435 2436 if (typeof document !== 'undefined') { 2437 // Apply the polyfill to the global document, so that no JavaScript 2438 // coordination is required to use the polyfill in the top-level document: 2439 applyFocusVisiblePolyfill(document); 2440 } 2441 2442}))); 2443 2444 2445/***/ }), 2446
vendor: 2,244 bytes, lines 2447-2520
2447/***/ "./src/components/accordion/accordion.js": 2448/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 2449 2450"use strict"; 2451/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2452/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 2453/* harmony export */ }); 2454class BRAccordion { 2455 constructor(name, component) { 2456 this.name = name 2457 this.component = component 2458 this._setBehavior() 2459 } 2460 2461 _setBehavior() { 2462 for (const button of this.component.querySelectorAll('button.header')) { 2463 button.addEventListener('click', (event) => { 2464 this._collapse(event) 2465 this._changeIcon(event) 2466 }) 2467 } 2468 } 2469 2470 // eslint-disable-next-line complexity 2471 _collapse(event) { 2472 if (this.component.hasAttribute('single')) { 2473 for (const field of this.component.querySelectorAll('.item')) { 2474 if (field === event.currentTarget.parentNode) { 2475 if (field.hasAttribute('active')) { 2476 field.removeAttribute('active') 2477 } else { 2478 field.setAttribute('active', '') 2479 } 2480 } else { 2481 if (field.hasAttribute('active')) { 2482 field.removeAttribute('active') 2483 } 2484 } 2485 } 2486 } else { 2487 for (const field of this.component.querySelectorAll('.item')) { 2488 if (field === event.currentTarget.parentNode) { 2489 if (field.hasAttribute('active')) { 2490 field.removeAttribute('active') 2491 } else { 2492 field.setAttribute('active', '') 2493 } 2494 } 2495 } 2496 } 2497 } 2498 2499 _changeIcon() { 2500 for (const field of this.component.querySelectorAll('.item')) { 2501 if (field.hasAttribute('active')) { 2502 for (const icon of field.querySelectorAll('.icon')) { 2503 icon.children[0].classList.remove('fa-angle-down') 2504 icon.children[0].classList.add('fa-angle-up') 2505 } 2506 } else { 2507 for (const icon of field.querySelectorAll('.icon')) { 2508 icon.children[0].classList.remove('fa-angle-up') 2509 icon.children[0].classList.add('fa-angle-down') 2510 } 2511 } 2512 } 2513 } 2514} 2515 2516/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRAccordion); 2517 2518 2519/***/ }), 2520
2521/***/ "./src/components/avatar/avatar.js": 2522/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 2523 2524"use strict"; 2525/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2526/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 2527/* harmony export */ }); 2528/* harmony import */ var _partial_js_behavior_dropdown__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/partial/js/behavior/dropdown.js"); 2529 2530 2531/** 2532 * Classe para o exemplo do comportamento dropdown 2533 */ 2534class BRAvatar { 2535 /** 2536 * Instancia um exemplo de comportamento dropdown 2537 * @param {string} name - Nome do componente 2538 * @param {object} component - Referência ao objeto do DOM 2539 */ 2540 constructor(name, component) { 2541 this.name = name 2542 this.component = component 2543 this._setBehavior() 2544 } 2545 2546 /** 2547 * Define os comportamentos do componente 2548 * @private 2549 */ 2550 _setBehavior() { 2551 this._setDropdownBehavior() 2552 } 2553 2554 /** 2555 * Define os comportamentos do dropdown 2556 * @private 2557 */ 2558 _setDropdownBehavior() { 2559 if (this.component.parentElement.dataset.toggle === 'dropdown') { 2560 const config = { 2561 iconToHide: 'fa-caret-up', 2562 iconToShow: 'fa-caret-down', 2563 trigger: this.component.parentElement, 2564 useIcons: true, 2565 } 2566 const dropdown = new _partial_js_behavior_dropdown__WEBPACK_IMPORTED_MODULE_0__["default"](config) 2567 dropdown.setBehavior() 2568 } 2569 } 2570} 2571 2572/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRAvatar); 2573 2574 2575/***/ }), 2576
vendor: 4,136 bytes, lines 2577-2720
2577/***/ "./src/components/breadcrumb/breadcrumb.js": 2578/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 2579 2580"use strict"; 2581/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2582/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 2583/* harmony export */ }); 2584class BRBreadcrumb { 2585 /** 2586 * Instancia um componente breadcrumb 2587 * @param {string} name - nome do componente 2588 * @param {object} component - referencia ao objeto do DOM 2589 **/ 2590 constructor(name, component) { 2591 this.name = name 2592 this.component = component 2593 this._setBehavior() 2594 } 2595 2596 /** 2597 * Define os comportamentos do componente 2598 * @private 2599 */ 2600 _setBehavior() { 2601 this._setView() 2602 window.addEventListener('resize', () => { 2603 this._setView() 2604 }) 2605 window.document.addEventListener('click', (event) => { 2606 if ( 2607 !this.component.contains(event.target) && 2608 this.component.querySelector('.br-card') 2609 ) { 2610 this.component.querySelector('.br-card').remove() 2611 } 2612 }) 2613 2614 // window.addEventListener('resize', (event) => {}) 2615 } 2616 /** 2617 * Reseta a view do breadcrumb 2618 */ 2619 resetBreadcrumbs() { 2620 this._reset() 2621 2622 const brcardBreadcrumb = this.component.querySelector('.br-card') 2623 if (brcardBreadcrumb !== null) { 2624 brcardBreadcrumb.remove() 2625 } 2626 this._setView() 2627 } 2628 2629 /** 2630 * Atualiza a visualização do componente 2631 * @private 2632 */ 2633 _setView() { 2634 this._reset() 2635 for (const crumbList of this.component.querySelectorAll('.crumb-list')) { 2636 const crumbs = crumbList.querySelectorAll('.crumb:not([data-active])') 2637 if (window.innerWidth < 575) { 2638 if (crumbs.length !== 1) { 2639 crumbs.forEach((crumb) => { 2640 crumb.classList.add('d-none') 2641 }) 2642 this._insertExpandButton() 2643 } 2644 } else { 2645 if ( 2646 crumbList.scrollWidth > crumbList.offsetWidth || 2647 crumbs.length > 5 2648 ) { 2649 crumbs.forEach((crumb, index) => { 2650 if (index > 0 && index < crumbs.length - 1) { 2651 crumb.classList.add('d-none') 2652 } 2653 }) 2654 this._insertExpandButton() 2655 } 2656 } 2657 } 2658 } 2659 2660 /** 2661 * Insere botao de expandir 2662 * @private 2663 */ 2664 _insertExpandButton() { 2665 const crumb = this._createCrumb() 2666 const crumbList = this.component.querySelector('.crumb-list') 2667 const crumbs = crumbList.querySelectorAll('.crumb') 2668 crumbList.insertBefore(crumb, crumbs[1]) 2669 } 2670 2671 /** 2672 * Reinicia componente 2673 * @private 2674 */ 2675 _reset() { 2676 this.component.querySelectorAll('.crumb-list .crumb').forEach((crumb) => { 2677 if (crumb.classList.contains('menu-mobil')) { 2678 crumb.remove() 2679 } else { 2680 crumb.classList.remove('d-none') 2681 } 2682 }) 2683 } 2684 2685 /** 2686 * Insere elementos 2687 * @private 2688 */ 2689 _createCrumb() { 2690 const crumb = document.createElement('li') 2691 crumb.classList.add('crumb', 'menu-mobil') 2692 crumb.setAttribute('data-toggle', 'dropdown') 2693 2694 const button = document.createElement('button') 2695 button.classList.add('br-button', 'circle') 2696 2697 const span = document.createElement('span') 2698 span.classList.add('sr-only') 2699 span.innerHTML = 'Botão Menu' 2700 2701 const folderIcon = document.createElement('i') 2702 folderIcon.classList.add('fas', 'fa-folder-plus') 2703 2704 const chevronIcon = document.createElement('i') 2705 chevronIcon.classList.add('icon', 'fas', 'fa-chevron-right') 2706 2707 crumb.appendChild(chevronIcon) 2708 crumb.appendChild(button) 2709 button.appendChild(span) 2710 button.appendChild(folderIcon) 2711 2712 crumb.addEventListener('click', () => { 2713 let card = this.component.querySelector('.br-card') 2714 if (card) { 2715 folderIcon.classList.remove('fas', 'fa-folder-minus') 2716 folderIcon.classList.add('fas', 'fa-folder-plus') 2717 this.component.querySelector('.br-card').remove() 2718 } else { 2719 folderIcon.classList.remove('fas', 'fa-folder-plus') 2720 folderIcon.classList.add('fas', 'fa-folder-minus')
2721 card = this._createList() 2722 this.component.appendChild(card) 2723 } 2724 }) 2725 2726 return crumb 2727 } 2728 2729 /** 2730 * Cria lista 2731 * @private 2732 */ 2733 _createList() { 2734 const card = document.createElement('div') 2735 card.classList.add('br-card') 2736 2737 this.component.querySelectorAll('.crumb-list .crumb').forEach((crumb) => { 2738 if (crumb.classList.contains('d-none')) { 2739 const item = document.createElement('div') 2740 item.classList.add('br-item') 2741 2742 if (!crumb.classList.contains('home')) { 2743 item.appendChild(crumb.querySelector('a').cloneNode(true)) 2744 card.appendChild(item) 2745 } 2746 } 2747 }) 2748 2749 return card 2750 } 2751} 2752 2753/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRBreadcrumb); 2754 2755 2756/***/ }), 2757
vendor: 9,511 bytes, lines 2758-3068
2758/***/ "./src/components/card/card.js": 2759/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 2760 2761"use strict"; 2762/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2763/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 2764/* harmony export */ }); 2765/* harmony import */ var _partial_js_behavior_collapse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/partial/js/behavior/collapse.js"); 2766 2767 2768/** Classe para instanciar um objeto BRCard */ 2769class BRCard { 2770 /** 2771 * Instancia do componente 2772 * @property {string} name - Nome do componente em minúsculo 2773 * @property {object} component - Objeto referenciando a raiz do componente DOM 2774 * @property {string} id - nome da id do ocmponente 2775 */ 2776 constructor(name, component, id) { 2777 this.name = name 2778 this.component = component 2779 this.component.setAttribute('id', `card${id}`) 2780 this._setBehavior() 2781 } 2782 2783 /** 2784 * Define o comportamento do componente 2785 * @private 2786 */ 2787 _setBehavior() { 2788 this._setFlipBehavior() 2789 // this._setExpandBehavior() 2790 this._setDragBehavior() 2791 this._setDisableBehavior() 2792 this._collpaseBehavior() 2793 } 2794 2795 /** 2796 * Define o comportamento de comprimir (collapse) 2797 * @private 2798 */ 2799 _collpaseBehavior() { 2800 this.component 2801 .querySelectorAll('[data-toggle="collapse"]') 2802 .forEach((trigger) => { 2803 const config = { 2804 iconToHide: 'fa-chevron-up', 2805 iconToShow: 'fa-chevron-down', 2806 trigger, 2807 useIcons: true, 2808 } 2809 const collapse = new _partial_js_behavior_collapse__WEBPACK_IMPORTED_MODULE_0__["default"](config) 2810 collapse.setBehavior() 2811 }) 2812 } 2813 2814 /** 2815 * Desabilita o componente 2816 * @private 2817 */ 2818 _setDisableBehavior() { 2819 if (this.component.classList.contains('disabled')) { 2820 this.component.setAttribute('aria-hidden', 'true') 2821 const buttons = this.component.querySelectorAll('button') 2822 const inputs = this.component.querySelectorAll('input') 2823 const selects = this.component.querySelectorAll('select') 2824 const textareas = this.component.querySelectorAll('textarea') 2825 for (const button of buttons) { 2826 button.setAttribute('disabled', 'disabled') 2827 } 2828 for (const input of inputs) { 2829 input.setAttribute('disabled', 'disabled') 2830 } 2831 for (const select of selects) { 2832 select.setAttribute('disabled', 'disabled') 2833 } 2834 for (const textarea of textareas) { 2835 textarea.setAttribute('disabled', 'disabled') 2836 } 2837 } 2838 } 2839 2840 /** 2841 * Define o comportamento de girar (flip) 2842 * @private 2843 */ 2844 _setFlipBehavior() { 2845 for (const flip of this.component.querySelectorAll('button.flip')) { 2846 flip.addEventListener('click', () => { 2847 if (this.component.getAttribute('flipped') === 'off') { 2848 this.component.setAttribute('flipped', 'on') 2849 } else { 2850 this.component.setAttribute('flipped', 'off') 2851 } 2852 }) 2853 } 2854 } 2855 2856 /** 2857 * Define o comportamento de arrastar (drag) 2858 * @private 2859 */ 2860 _setDragBehavior() { 2861 for (const img of this.component.querySelectorAll('img')) { 2862 img.setAttribute('draggable', 'false') 2863 } 2864 for (const link of this.component.querySelectorAll('a')) { 2865 link.setAttribute('draggable', 'false') 2866 } 2867 this.component.addEventListener('dragstart', (event) => { 2868 event.stopPropagation() 2869 event.dataTransfer.setData( 2870 'text/plain', 2871 this.component.getAttribute('id') 2872 ) 2873 event.dropEffect = 'move' 2874 }) 2875 } 2876} 2877 2878/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRCard); 2879 2880 2881/***/ }), 2882 2883/***/ "./src/components/carousel/carousel.js": 2884/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 2885 2886"use strict"; 2887/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2888/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 2889/* harmony export */ }); 2890/* harmony import */ var _partial_js_behavior_swipe__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/partial/js/behavior/swipe.js"); 2891/* harmony import */ var _step_step__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/components/step/step.js"); 2892 2893 2894class BRCarousel { 2895 constructor(name, component) { 2896 /** 2897 * Instancia um componente carousel 2898 * @param {string} name - Nome do componente 2899 * @param {object} component - Objeto referenciando a raiz do componente DOM 2900 * @property {number} activeStageNum - Número do palco ativo 2901 * @property {array} DOMStrings - instancia dos elementos internos do componente 2902 * @property {BRStep} DOMStrings - instancia dos elemento step interno 2903 */ 2904 this.name = name 2905 this.component = component 2906 this.activeStageNum = 0 2907 // Elementos DOM 2908 this.DOMstrings = { 2909 carouselNextBtn: this.component.querySelector('.carousel-btn-next'), 2910 carouselPages: this.component.querySelectorAll('.carousel-page'), 2911 carouselPrevBtn: this.component.querySelector('.carousel-btn-prev'), 2912 carouselStage: this.component.querySelector('.carousel-stage'), 2913 circular: this.component.hasAttribute('data-circular'), 2914 step: this.component.querySelector('.br-step'), 2915 } 2916 this.step = new _step_step__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z('br-step', this.DOMstrings.step) 2917 this._setBehavior() 2918 } 2919 2920 /** 2921 * Remove os atributos de uma lista de elementos 2922 * @param {object} elemSet - Lista de elementos 2923 * @param {string} button - Nome do atributo 2924 */ 2925 removeAttributes(elemSet, attrName) { 2926 elemSet.forEach((elem) => { 2927 elem.removeAttribute(attrName) 2928 }) 2929 } 2930 2931 /** 2932 * Retorna o passo ativo 2933 */ 2934 getActiveStep() { 2935 return this.step.activeStepNum 2936 } 2937 2938 /** 2939 * Define o passo ativo 2940 * @param {number} activeStepNum - número do passo 2941 */ 2942 setActiveStep(activeStepNum) { 2943 this.step.setActiveStep(activeStepNum) 2944 } 2945 2946 /** 2947 * Retorna o palco ativo 2948 */ 2949 getActiveStage() { 2950 let activeStage 2951 this.DOMstrings.carouselPages.forEach((stage) => { 2952 if (stage.hasAttribute('active')) { 2953 activeStage = stage 2954 } 2955 }) 2956 return activeStage 2957 } 2958 2959 /** 2960 * Define o palco ativo 2961 * @param {number} num - número do palco 2962 */ 2963 setActiveStage(num) { 2964 // remove active atts from all the stages 2965 this.removeAttributes(this.DOMstrings.carouselPages, 'active') 2966 // show active stage 2967 this.DOMstrings.carouselPages.forEach((stage, index) => { 2968 // motion efect 2969 if (index > num) { 2970 stage.style.left = '100%' 2971 } else { 2972 stage.style.left = '-100%' 2973 } 2974 // set active attrb 2975 if (index === num) { 2976 stage.setAttribute('active', '') 2977 this.activeStageNum = num 2978 } 2979 }) 2980 this.disabledBtns() 2981 } 2982 2983 /** 2984 * Desabilita os botões se o carousel não for circular 2985 */ 2986 disabledBtns() { 2987 // Disables Carousel Buttons 2988 if (!this.DOMstrings.circular) { 2989 if (this.activeStageNum === 0) { 2990 this.DOMstrings.carouselPrevBtn.setAttribute('disabled', '') 2991 } else { 2992 this.DOMstrings.carouselPrevBtn.removeAttribute('disabled') 2993 } 2994 if (this.activeStageNum === this.DOMstrings.carouselPages.length - 1) { 2995 this.DOMstrings.carouselNextBtn.setAttribute('disabled', '') 2996 } else { 2997 this.DOMstrings.carouselNextBtn.removeAttribute('disabled') 2998 } 2999 } 3000 } 3001 3002 /** 3003 * Muda a página ativa incrementalmente - ações de botões e swap 3004 * @param {number} num - incremento 3005 */ 3006 shiftPage(num) { 3007 //find active stage 3008 const activeStage = this.getActiveStage() 3009 const PanelsSize = this.DOMstrings.carouselPages.length - 1 3010 let activeStageNum = Array.from(this.DOMstrings.carouselPages).indexOf( 3011 activeStage 3012 ) 3013 // set active step and active stage onclick 3014 if (num < 0) { 3015 // Volta o slide 3016 if (this.DOMstrings.circular) { 3017 activeStageNum = 3018 activeStageNum === 0 ? PanelsSize : (activeStageNum -= 1) 3019 } else { 3020 activeStageNum -= activeStageNum === 0 ? 0 : 1 3021 } 3022 } else { 3023 // Passar p/ frente o slide 3024 if (this.DOMstrings.circular) { 3025 activeStageNum = 3026 activeStageNum === PanelsSize ? 0 : (activeStageNum += 1) 3027 } else { 3028 activeStageNum += activeStageNum === PanelsSize ? 0 : 1 3029 } 3030 } 3031 this.setActiveStep(activeStageNum) 3032 this.setActiveStage(activeStageNum) 3033 } 3034 3035 /** 3036 * Define os comportamentos do componente 3037 * @private 3038 */ 3039 _setBehavior() { 3040 this.DOMstrings.carouselNextBtn.addEventListener('click', () => { 3041 this.shiftPage(1) 3042 }) 3043 3044 this.DOMstrings.carouselPrevBtn.addEventListener('click', () => { 3045 this.shiftPage(-1) 3046 }) 3047 3048 this.DOMstrings.step.addEventListener('click', () => { 3049 this.setActiveStage(this.step.activeStepNum) 3050 }) 3051 3052 // Swipe 3053 const dispatcher = new _partial_js_behavior_swipe__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z(this.DOMstrings.carouselStage) 3054 dispatcher.on('SWIPE_LEFT', () => { 3055 this.shiftPage(1) 3056 }) 3057 dispatcher.on('SWIPE_RIGHT', () => { 3058 this.shiftPage(-1) 3059 }) 3060 this.disabledBtns() 3061 } 3062} 3063 3064/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRCarousel); 3065 3066 3067/***/ }), 3068
3069/***/ "./src/components/checkbox/checkbox.js": 3070/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 3071 3072"use strict"; 3073/* harmony export */ __webpack_require__.d(__webpack_exports__, { 3074/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 3075/* harmony export */ }); 3076/* harmony import */ var _partial_js_behavior_checkgroup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/partial/js/behavior/checkgroup.js"); 3077 3078 3079/** Classe para instanciar um objeto BRCheckbox*/ 3080class BRCheckbox { 3081 /** 3082 * Instancia do objeto 3083 * @param {string} name - Nome do componente em minúsculo 3084 * @param {object} component - Objeto referenciando a raiz do componente DOM 3085 */ 3086 constructor(name, component) { 3087 this.name = name 3088 this.component = component 3089 this._setBehavior() 3090 } 3091 3092 /** 3093 * Define comportamentos do componente 3094 * @private 3095 */ 3096 _setBehavior() { 3097 this._setCheckgroupBehavior() 3098 } 3099 3100 /** 3101 * Define comportamentos do checkgroup 3102 * @private 3103 */ 3104 _setCheckgroupBehavior() { 3105 this.component 3106 .querySelectorAll('input[type="checkbox"][data-parent]') 3107 .forEach((trigger) => { 3108 const checkgroup = new _partial_js_behavior_checkgroup__WEBPACK_IMPORTED_MODULE_0__["default"](trigger) 3109 checkgroup.setBehavior() 3110 }) 3111 } 3112} 3113 3114/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRCheckbox); 3115 3116 3117/***/ }), 3118
vendor: 4,279 bytes, lines 3119-3244
3119/***/ "./src/components/cookiebar/cookiebar-data.js": 3120/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 3121 3122"use strict"; 3123/* harmony export */ __webpack_require__.d(__webpack_exports__, { 3124/* harmony export */ "B": () => (/* binding */ CookiebarData) 3125/* harmony export */ }); 3126/** Classe que representa os dados do cookiebar */ 3127class CookiebarData { 3128 /** 3129 * Instancia um objeto de dados do cookiebar. Objeto contém as propriedades contidas no JSON de entrada em uma lÃngua especÃfica 3130 * @param {string} json - JSON de entrada de dados 3131 * @param {string} lang - LÃngua para filtrar o JSON de entrada 3132 */ 3133 constructor(json, lang) { 3134 this.PRIORITY_LEVELS = 5 3135 Object.assign(this, this._filterByLang(json, lang)) 3136 this._setDataCoherenceByPriority(this.PRIORITY_LEVELS) 3137 } 3138 3139 /** 3140 * Filtra um JSON pela lÃngua correspondente 3141 * @param {string} json - Dados no formato JSON (array de objetos) 3142 * @param {string} lang - LÃngua para filtrar o array vindo do json 3143 * @returns Objeto javascript contendo as propriedade vindas do JSON filtradas pela lÃngua 3144 * @private 3145 */ 3146 _filterByLang(json, lang) { 3147 const list = JSON.parse(json) 3148 const data = list.filter((element) => { 3149 return element.lang === lang 3150 }) 3151 if (data.length > 0) { 3152 // Existe dados na lingua especificada 3153 return data[0] // Retorna o primeiro. Se existir mais objetos na mesma lÃngua, os demais serão ignorados. 3154 } else { 3155 // Não existe dados na lingua especificada 3156 return list[0] // Retorna o primeiro que encontrar 3157 } 3158 } 3159 3160 /** 3161 * Consolida os dados iniciais baseado em uma hierarquia de prioridades 3162 * @private 3163 */ 3164 _setDataCoherenceByPriority() { 3165 this.selectAll = !this.allOptOut ? true : this.selectAll 3166 this.cookieGroups.forEach((groupData) => { 3167 groupData.groupOptOut = !this.allOptOut ? false : groupData.groupOptOut 3168 groupData.groupSelected = 3169 this.selectAll || !groupData.groupOptOut 3170 ? true 3171 : groupData.groupSelected 3172 groupData.cookieList.forEach((cookieData) => { 3173 cookieData.cookieOptOut = !groupData.groupOptOut 3174 ? false 3175 : cookieData.cookieOptOut 3176 cookieData.cookieSelected = 3177 groupData.groupSelected || !cookieData.cookieOptOut 3178 ? groupData.groupSelected 3179 : cookieData.cookieSelected 3180 }) 3181 }) 3182 this._setIndeterminateState() 3183 } 3184 3185 /** 3186 * Controla a configuração do estado indeterminado dos checkboxes 3187 * @private 3188 */ 3189 _setIndeterminateState() { 3190 this._setGroupIndeterminateState() 3191 this._setAllIndeterminateState() 3192 } 3193 3194 /** 3195 * Trata a configuração do estado indeterminado dos checkboxes dos grupos de cookies 3196 * @private 3197 */ 3198 _setGroupIndeterminateState() { 3199 this.cookieGroups.forEach((groupData) => { 3200 let allChecked = true 3201 let allUnchecked = true 3202 3203 groupData.cookieList.forEach((cookieData) => { 3204 cookieData.cookieSelected 3205 ? (allUnchecked = false) 3206 : (allChecked = false) 3207 }) 3208 3209 groupData.groupSelected = allChecked ? true : allUnchecked ? false : true 3210 groupData.groupIndeterminated = allChecked || allUnchecked ? false : true 3211 }) 3212 } 3213 3214 /** 3215 * Trata a configuração do estado indeterminado do checkbox geral 3216 * @private 3217 */ 3218 _setAllIndeterminateState() { 3219 let allChecked = true 3220 let allUnchecked = true 3221 let indeterminated = false 3222 this.cookieGroups.forEach((groupData) => { 3223 groupData.groupSelected ? (allUnchecked = false) : (allChecked = false) 3224 3225 if (groupData.groupIndeterminated) { 3226 indeterminated = true 3227 } 3228 }) 3229 3230 this.selectAll = allChecked ? true : allUnchecked ? false : true 3231 this.allIndeterminated = indeterminated 3232 ? true 3233 : allChecked || allUnchecked 3234 ? false 3235 : true 3236 } 3237 3238 /** 3239 * Calcula a quantidade de cookies selecionados em 1 grupo de cookies 3240 * @param {object} groupData - Objeto com dados de 1 grupo de cookies 3241 * @returns {number} - Quantidade de cookies selecionados em 1 grupo de cookies 3242 * @public 3243 */ 3244 getCookiesCheckedAmount(groupData) {
vendor: 1,135 bytes, lines 3245-3288
3245 let count = 0 3246 groupData.cookieList.forEach((cookieData) => { 3247 if (cookieData.cookieSelected) count += 1 3248 }) 3249 return count 3250 } 3251 3252 /** 3253 * Calcula a quantidade total de cookies em 1 grupo de cookies 3254 * @param {object} groupData - Objeto com dados de 1 grupo de cookies 3255 * @returns {number} - Quantidade total de cookies em 1 grupo de cookies 3256 * @public 3257 */ 3258 getCookiesAmount(groupData) { 3259 let count = 0 3260 groupData.cookieList.forEach(() => { 3261 count += 1 3262 }) 3263 return count 3264 } 3265 3266 /** 3267 * Ler um arquivo json local 3268 * @param {string} path - Caminho para o arquivo 3269 * @param {function} callback - Função de callback que recebe a conteúdo do arquivo 3270 * @public 3271 * @static 3272 */ 3273 static loadJSON(path, callback) { 3274 const rawFile = new XMLHttpRequest() 3275 rawFile.overrideMimeType('application/json') 3276 rawFile.open('GET', path, true) 3277 rawFile.onreadystatechange = () => { 3278 if (rawFile.readyState === 4 && rawFile.status === 200) { 3279 callback(rawFile.responseText) 3280 } 3281 } 3282 rawFile.send(null) 3283 } 3284} 3285 3286 3287/***/ }), 3288
vendor: 5,187 bytes, lines 3289-3478
3289/***/ "./src/components/cookiebar/cookiebar-templates.js": 3290/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 3291 3292"use strict"; 3293 3294// EXPORTS 3295__webpack_require__.d(__webpack_exports__, { 3296 "y": () => (/* binding */ CookiebarTemplates) 3297}); 3298 3299;// CONCATENATED MODULE: ./src/components/cookiebar/cookiebar-labels.js 3300/** Classe para tratamento das labels do cookiebar */ 3301class CookiebarLabels { 3302 /** 3303 * Instancia um objeto de labels do cookiebar 3304 * @param {object} data - Objeto de dados do cookiebar 3305 */ 3306 constructor(data) { 3307 this.data = data 3308 } 3309 3310 /** 3311 * Trata a label para a informação de atualização 3312 * @returns {string} - Label para a informação de atualização 3313 * @public 3314 */ 3315 setLastUpdateLabel() { 3316 return this.data.lastUpdateLabel || 'Ãltima atualização' 3317 } 3318 3319 /** 3320 * Trata a label para o tÃtulo da lista de grupos de cookies 3321 * @returns {string} - Label para o tÃtulo da lista de grupos de cookies 3322 * @public 3323 */ 3324 setCookieGroupsLabel() { 3325 return this.data.cookieGroupsLabel || 'Classes de cookies' 3326 } 3327 3328 /** 3329 * Trata a label para o checkbox geral desselecionado 3330 * @returns {string} - Label para o checkbox geral desselecionado 3331 * @public 3332 */ 3333 setUnselectAllLabel() { 3334 return this.data.unselectAllLabel || 'Desselecionar tudo' 3335 } 3336 3337 /** 3338 * Trata a label para o checkbox geral selecionado 3339 * @returns {string} - Label para o checkbox geral selecionado 3340 * @public 3341 */ 3342 setSelectAllLabel() { 3343 return this.data.selectAllLabel || 'Selecionar tudo' 3344 } 3345 3346 /** 3347 * Trata a label para o checkbox geral 3348 * @returns {string} - Label para o checkbox geral 3349 * @public 3350 */ 3351 setCheckAllLabel() { 3352 if (this.data.selectAll && !this.data.allIndeterminated) { 3353 return this.setUnselectAllLabel() 3354 } else { 3355 return this.setSelectAllLabel() 3356 } 3357 } 3358 3359 /** 3360 * Trata a label para o checkbox do grupo de cookies desselecionado 3361 * @returns {string} - Label para o checkbox do grupo de cookies desselecionado 3362 * @public 3363 */ 3364 setUnselectAllGroupLabel() { 3365 return this.data.unselectAllGroupLabel || 'Desselecionar toda classe' 3366 } 3367 3368 /** 3369 * Trata a label para o checkbox do grupo de cookies selecionado 3370 * @returns {string} - Label para o checkbox do grupo de cookies selecionado 3371 * @public 3372 */ 3373 setSelectAllGroupLabel() { 3374 return this.data.selectAllGroupLabel || 'Selecionar toda classe' 3375 } 3376 3377 /** 3378 * Trata a label para o checkbox do grupo de cookies 3379 * @param {object} groupData - Objeto com dados de 1 grupo de cookies 3380 * @returns {string} - Label para checkbox do grupo de cookies 3381 * @public 3382 */ 3383 setCheckGroupLabel(groupData) { 3384 if (groupData.groupSelected && !groupData.groupIndeterminated) { 3385 return this.setUnselectAllGroupLabel() 3386 } else { 3387 return this.setSelectAllGroupLabel() 3388 } 3389 } 3390 3391 /** 3392 * Trata a label para o grupo de cookies 'opt-in' 3393 * @returns {string} - Label para grupo de cookies 'opt-in' 3394 * @public 3395 */ 3396 setAlwaysActiveLabel() { 3397 return this.data.alwaysActiveLabel || 'Sempre ativo' 3398 } 3399 3400 /** 3401 * Trata a label para cookie habilitado 3402 * @returns {string} - Label para cookie habilitado 3403 * @publi 3404 */ 3405 setCheckCookieEnabledLabel() { 3406 return this.data.onLabel || 'Ligado' 3407 } 3408 3409 /** 3410 * Trata a label para cookie desabilitado 3411 * @returns {string} - Label para cookie desabilitado 3412 * @public 3413 */ 3414 setCheckCookieDisabledLabel() { 3415 return this.data.offLabel || 'Desligado' 3416 } 3417 3418 /** 3419 * Trata a label para o nome do cookie 3420 * @returns {string} - Label para o nome do cookie 3421 * @public 3422 */ 3423 setCookieNameLabel() { 3424 return this.data.cookieNameLabel || 'Cookies' 3425 } 3426 3427 /** 3428 * Trata a label para o vencimento do cookie 3429 * @returns {string} - Label para o vencimento do cookie 3430 * @public 3431 */ 3432 setCookieExpiresLabel() { 3433 return this.data.expiresLabel || 'Vencimento' 3434 } 3435 3436 /** 3437 * Trata a label para o domÃnio do cookie 3438 * @returns {string} - Label para o domÃnio do cookie 3439 * @public 3440 */ 3441 setCookieDomainLabel() { 3442 return this.data.domainLabel || 'DomÃnio' 3443 } 3444 3445 /** 3446 * Trata a label para e empresa do cookie 3447 * @returns {string} - Label para a empresa do cookie 3448 * @public 3449 */ 3450 setCookieEnterpriseLabel() { 3451 return this.data.enterpriseLabel || 'Empresa' 3452 } 3453 3454 /** 3455 * Trata a label para a finalidade do cookie 3456 * @returns {string} - Label para a finalidade do cookie 3457 * @public 3458 */ 3459 setCookiePurposeLabel() { 3460 return this.data.purposeLabel || 'Finalidade' 3461 } 3462 3463 /** 3464 * Trata a label para a descrição do cookie 3465 * @returns {string} - Label para a descrição do cookie 3466 * @public 3467 */ 3468 setCookieDescriptionLabel() { 3469 return this.data.descriptionLabel || 'Descrição' 3470 } 3471 3472 /** 3473 * Trata a label para o botão de polÃticas/definições de cookies 3474 * @returns {string} - Label para o botão de polÃticas/definições de cookies 3475 * @public 3476 */ 3477 setPoliticsButtonLabel() { 3478 return this.data.allOptOut
3479 ? this.data.optOutButton || 'Definir Cookies' 3480 : this.data.optInButton || 'Ver PolÃtica de Cookies' 3481 } 3482 3483 /** 3484 * Trata a label para o botão de aceite 3485 * @returns {string} - Label para o botão de aceite 3486 * @public 3487 */ 3488 setAcceptButtonLabel() { 3489 return this.data.acceptButton || 'Aceitar' 3490 } 3491} 3492 3493;// CONCATENATED MODULE: ./src/components/cookiebar/cookiebar-templates.js 3494 3495 3496/** Classe que contém os templates do cookiebar */ 3497class CookiebarTemplates { 3498 /** 3499 * Instancia um objeto template com os dados do cookiebar 3500 * @param {object} data - Objeto de dados do cookiebar 3501 */ 3502 constructor(data) { 3503 this.data = data 3504 this.labels = new CookiebarLabels(this.data) 3505 } 3506 3507 /** 3508 * Cria um template para a área de conteúdo global 3509 * @returns {string} - Elemento DOM que representa a área de conteúdo global 3510 * @public 3511 */ 3512 setGlobalContentArea() { 3513 return `<div class="br-modal"> 3514 <div class="br-card" id="card0"> 3515 <div class="container-fluid p-1 p-2xh"> 3516 <div class="wrapper p-2xh"> 3517 ${this._setIntroductoryContentArea()} 3518 <div class="br-modal-body"> 3519 ${this._setInfoText()} 3520 ${this._setMainContentArea()} 3521 ${this._setComplementaryContentArea()} 3522 </div> 3523 </div> 3524 ${this._setActionArea()} 3525 </div> 3526 </div> 3527 </div>` 3528 } 3529 3530 /** 3531 * Cria um template para a área de conteúdo introdutório 3532 * @returns {string} - Elemento DOM que representa a área de conteúdo introdutório 3533 * @private 3534 */ 3535 _setIntroductoryContentArea() { 3536 return `<div class="br-modal-header entry-content"> 3537 ${this._setMainTitle()} 3538 ${this._setLastUpdate()} 3539 ${this._setEntryText()} 3540 </div>` 3541 } 3542 3543 /** 3544 * Cria um template para a área de conteúdo principal 3545 * @returns {string} - Elemento DOM que representa a área de conteúdo principal 3546 * @private 3547 */ 3548 _setMainContentArea() { 3549 return `<div class="br-list main-content"> 3550 ${this._setMainContentHeader()} 3551 ${this._setCookieGroups()} 3552 ${ 3553 this.data.noteList && this.data.noteList.length 3554 ? this._setNotifications() 3555 : '' 3556 } 3557 </div>` 3558 } 3559 3560 /** 3561 * Cria um template para a área de acões 3562 * @returns {string} - Elemento DOM que representa a área de ações 3563 * @private 3564 */ 3565 _setActionArea() { 3566 return `<div class="br-modal-footer actions justify-content-end"> 3567 ${this._setPoliticsButton()} 3568 ${this._setAcceptButton()} 3569 </div>` 3570 } 3571 3572 /** 3573 * Cria um template para o tÃtulo principal 3574 * @returns {string} - Elemento DOM que representa o tÃtulo principal 3575 * @private 3576 */ 3577 _setMainTitle() { 3578 return `<div class="br-modal-title"> 3579 <div class="row"> 3580 <div class="col-sm"> 3581 <h1>${this.data.mainTitle}</h1> 3582 </div> 3583 <div class="col-sm-auto order-first order-sm-last"> 3584 ${this._setCloseButton()} 3585 </div> 3586 </div> 3587 </div>` 3588 } 3589 3590 /** 3591 * Cria um template para informações sobre atualização 3592 * @returns {string} - Elemento DOM que representa a informação sobre atualização 3593 * @private 3594 */ 3595 _setLastUpdate() { 3596 return `<p class="last-update">${this.labels.setLastUpdateLabel()}: <span>${ 3597 this.data.lastUpdate 3598 }</span></p>` 3599 } 3600 3601 /** 3602 * Cria um template para o texto introdutório 3603 * @returns {string} - Elemento DOM que representa o texto introdutório 3604 * @private 3605 */ 3606 _setEntryText() { 3607 return `<p class="entry-text">${this.data.entryText}</p>` 3608 } 3609 3610 /** 3611 * Cria um template para o texto descritivo 3612 * @returns {string} - Elemento DOM que representa o texto descritivo 3613 * @private 3614 */ 3615 _setInfoText() { 3616 return `<p class="info-text">${this.data.infoText}</p>` 3617 } 3618 3619 /** 3620 * Cria um template para o header da área de conteúdo principal 3621 * @returns {string} - Elemeto DOM que representa o header da área de conteúdo principal 3622 * @private 3623 */ 3624 _setMainContentHeader() { 3625 return `<div class="header"> 3626 <div class="row justify-content-between flex-fill"> 3627 <div class="col-12 col-sm align-self-center mb-2"> 3628 <div class="title">${this.labels.setCookieGroupsLabel()}</div> 3629 </div>
3630 <div class="col-12 align-self-center"> 3631 ${this.data.allOptOut ? this._setCheckAll() : ''} 3632 </div> 3633 <div class="col-12 text-sm-right message mt-1"> 3634 ${this.setAllAlertMessage()} 3635 </div> 3636 </div> 3637 </div>` 3638 } 3639 3640 /** 3641 * Cria um template para o grupo de cookies 3642 * @returns {string} - Elemento DOM que representa os grupos de cookies 3643 * @private 3644 */ 3645 _setCookieGroups() { 3646 let groupTemplates = '' 3647 this.data.cookieGroups.forEach((groupData, groupIndex) => { 3648 groupTemplates += `<hr> 3649 <div class="br-item group-info"> 3650 <div class="row mb-1"> 3651 <div class="col-12 col-sm align-self-center order-4 order-sm-1"> 3652 ${this._setGroupName(groupData)} 3653 </div> 3654 <div class="col align-self-center order-1 order-sm-2"> 3655 ${ 3656 groupData.groupOptOut 3657 ? this._setCheckGroup(groupData, groupIndex) 3658 : `<span class="always-active float-sm-right"> 3659 ${this.labels.setAlwaysActiveLabel()} 3660 </span>` 3661 } 3662 </div> 3663 <div class="col col-sm-auto align-self-center order-2 order-sm-3"> 3664 ${this._setGroupButton()} 3665 </div> 3666 <div class="col-12 col-sm-12 order-3 order-sm-4 text-sm-right message mt-1 mb-1"> 3667 ${this.setGroupAlertMessage(groupData)} 3668 </div> 3669 </div> 3670 <div class="row"> 3671 <div class="col"> 3672 <p class="group-description">${this._setGroupDescription( 3673 groupData 3674 )}</p> 3675 </div> 3676 </div> 3677 </div> 3678 <div class="br-list cookie-info"> 3679 <div class="br-item"> 3680 <div class="row"> 3681 <div class="col"> 3682 ${this._setCookieInfo(groupData, groupIndex)} 3683 </div> 3684 </div> 3685 </div> 3686 </div>` 3687 }) 3688 return groupTemplates 3689 } 3690 3691 /** 3692 * Cria um template para o nome do grupo de cookies 3693 * @param {object} groupData - Objeto com dados de 1 grupo de cookies 3694 * @returns {string} - Elemento DOM que representa o nome do grupo de cookies 3695 * @orivate 3696 */ 3697 _setGroupName(groupData) { 3698 return `<span class="group-name" title="Expandir">${ 3699 groupData.groupName 3700 }</span> 3701 <span class="cookies-checked" title="Expandir">(${ 3702 groupData.groupOptOut 3703 ? `${this.data.getCookiesCheckedAmount(groupData)} de ` 3704 : '' 3705 }</span><span class="group-size" title="Expandir">${this.data.getCookiesAmount( 3706 groupData 3707 )})</span>` 3708 } 3709 3710 /** 3711 * Cria um template para a descrição do grupo de cookies 3712 * @param {object} groupData - Objeto com dados de 1 grupo de cookies 3713 * @returns {string} - Elemento DOM que representa a descrição do grupo de cookies 3714 * @private 3715 */ 3716 _setGroupDescription(groupData) { 3717 return `<p class="group-description">${groupData.groupText}</p>` 3718 } 3719 3720 /** 3721 * Cria um template para as informações dos cookies 3722 * @param {object} groupData - Objeto com dados de 1 grupo de cookies 3723 * @param {number} groupIndex - Ãndice do grupo de cookies 3724 * @returns {string} - Elemento DOM que representa as informações dos cookies 3725 * @private 3726 */ 3727 _setCookieInfo(groupData, groupIndex) {
3728 let cookieTemplates = '' 3729 groupData.cookieList.forEach((cookieData, cookieIndex) => { 3730 cookieTemplates += `<div class="br-card"> 3731 <div class="card-content"> 3732 <div class="row mb-1"> 3733 <div class="col-12 text-right"> 3734 ${ 3735 cookieData.cookieOptOut 3736 ? this._setCheckCookie( 3737 groupIndex, 3738 cookieData, 3739 cookieIndex 3740 ) 3741 : '' 3742 } 3743 </div> 3744 <div class="col-12 message text-right mb-1 mt-1"> 3745 ${this.setCookieAlertMessage(cookieData)} 3746 </div> 3747 </div> 3748 <div class="row"> 3749 <div class="fixed-width cookie-term"> 3750 <span>${this.labels.setCookieNameLabel()}</span> 3751 </div> 3752 <div class="col-12 col-sm mb-1 cookie-data"> 3753 <span>${cookieData.cookieName}</span> 3754 </div> 3755 </div> 3756 <div class="row"> 3757 <div class="fixed-width cookie-term"> 3758 <span>${this.labels.setCookieExpiresLabel()}</span> 3759 </div> 3760 <div class="col-12 col-sm mb-1 cookie-data"> 3761 <span>${cookieData.expires}</span> 3762 </div> 3763 </div> 3764 <div class="row"> 3765 <div class="fixed-width cookie-term"> 3766 <span>${this.labels.setCookieDomainLabel()}</span> 3767 </div> 3768 <div class="col-12 col-sm mb-1 cookie-data"> 3769 <span>${cookieData.domain}</span> 3770 </div> 3771 </div> 3772 <div class="row"> 3773 <div class="fixed-width cookie-term"> 3774 <span>${this.labels.setCookieEnterpriseLabel()}</span> 3775 </div> 3776 <div class="col-12 col-sm mb-1 cookie-data"> 3777 <span>${cookieData.entreprise}</span> 3778 </div> 3779 </div> 3780 <div class="row"> 3781 <div class="fixed-width cookie-term"> 3782 <span>${this.labels.setCookiePurposeLabel()}</span> 3783 </div> 3784 <div class="col-12 col-sm mb-1 cookie-data"> 3785 <span>${cookieData.purpose}</span> 3786 </div> 3787 </div> 3788 <div class="row"> 3789 <div class="fixed-width cookie-term"> 3790 <span>${this.labels.setCookieDescriptionLabel()}</span> 3791 </div> 3792 <div class="col-12 col-sm mb-1 cookie-data"> 3793 <span>${cookieData.description}</span> 3794 </div> 3795 </div> 3796 </div> 3797 </div>` 3798 }) 3799 return cookieTemplates 3800 } 3801 3802 /** 3803 * Cria um template para a lista de notificações 3804 * @returns {string} - Elemento DOM que representa a lista de notificações 3805 * @private 3806 */ 3807 _setNotifications() { 3808 return `<hr> 3809 <div class="br-item"> 3810 <div class="row"> 3811 <div class="col align-self-center">
3812 <span class="group-name" title="Expandir"> 3813 ${this.data.noteTitle}</span> 3814 </div> 3815 <div class="col-auto"> 3816 ${this._setGroupButton()} 3817 </div> 3818 </div> 3819 </div> 3820 <div class="br-list"> 3821 ${this._setNotificationInfo()} 3822 </div> 3823 <hr>` 3824 } 3825 3826 /** 3827 * Cria um template para as informações das notificações 3828 * @returns {string} - Elemento DOM que representa as informações das notificações 3829 * @private 3830 */ 3831 _setNotificationInfo() { 3832 let notificationTemplates = '' 3833 this.data.noteList.forEach((notificationData) => { 3834 notificationTemplates += `<div class="br-item notes"> 3835 <div class="row"> 3836 <div class="col"> 3837 <p>${notificationData.question}</p> 3838 <p>${notificationData.answer}</p> 3839 </div> 3840 </div> 3841 </div>` 3842 }) 3843 return notificationTemplates 3844 } 3845 3846 /** 3847 * Cria um template para a área de conteúdo complementar 3848 * @returns {string} - Elemento DOM que representa a área de conteúdo complementar 3849 * @private 3850 */ 3851 _setComplementaryContentArea() { 3852 return `<div class="br-list complementary-content"> 3853 ${this._setLinkInfo()} 3854 </div>` 3855 } 3856 3857 /** 3858 * Cria um templata para as informações dos links 3859 * @returns {string} - Elemento DOM que representa as informações dos links 3860 * @private 3861 */ 3862 _setLinkInfo() { 3863 let linkTemplates = '' 3864 this.data.links.forEach((linkData) => { 3865 linkTemplates += `<div class="br-item text-center"> 3866 <div class="row"> 3867 <div class="col"> 3868 <a href="${linkData.url}">${linkData.name}<i class="fas fa-external-link-alt" aria-hidden="true"></i> 3869 </a> 3870 </div> 3871 </div> 3872 </div>` 3873 }) 3874 return linkTemplates 3875 } 3876 3877 /** 3878 * Cria um template pra o botão de polÃticas de cookies 3879 * @returns {string} - Elemento DOM que representa o botão de politicas de cookies 3880 * @private 3881 */ 3882 _setPoliticsButton() { 3883 return `<button class="br-button secondary small" type="button" aria-label="${this.labels.setPoliticsButtonLabel()}">${this.labels.setPoliticsButtonLabel()}</button>` 3884 } 3885 3886 /** 3887 * Cria um template pra o botão de aceite 3888 * @returns {string} - Elemento DOM que representa o botão de aceite 3889 * @private 3890 */ 3891 _setAcceptButton() { 3892 return `<button class="br-button primary small" type="button" aria-label="${this.labels.setAcceptButtonLabel()}">${this.labels.setAcceptButtonLabel()}</button>` 3893 } 3894 /** 3895 * Cria um template para o botão de fechar 3896 * @returns {string} - Elemento DOM que represeta o botão de fechar 3897 * @private 3898 */ 3899 _setCloseButton() { 3900 return `<button class="br-button close circle small float-right" type="button" data-dismiss="br-modal" aria-label="${ 3901 this.data.closeLabel || 'fechar' 3902 }"> 3903 <i class="fas fa-times"></i> 3904 </button>` 3905 } 3906 3907 /** 3908 * Cria um template para botão de abrir/fechar do brupo de cookies 3909 * @returns {string} - Elemento DOM que representa o botão de abrir/fechar do grupo de cookies 3910 * @private 3911 */ 3912 _setGroupButton() { 3913 return `<button class="br-button circle small float-right" type="button" title="Expandir" aria-label="Expandir"> 3914 <i class="fas fa-angle-down" aria-hidden="true"></i> 3915 </button>` 3916 } 3917 3918 /** 3919 * Cria um template para o checkbox de seleção geral 3920 * @returns {string} - Elemento DOM que representa o checkbox de seleção geral 3921 * @private 3922 */ 3923 _setCheckAll() { 3924 return `<div class="br-checkbox"> 3925 <input 3926 id="check-all" 3927 name="check-all" 3928 type="checkbox" 3929 aria-label="${this.labels.setCheckAllLabel()}" 3930 ${this.data.selectAll ? 'checked' : ''} 3931 ${this.data.allIndeterminated ? 'indeterminate' : ''} 3932 tabindex="0" 3933 data-parent="check-all" 3934 data-checked-label="${this.labels.setSelectAllLabel()}" 3935 data-unchecked-label="${this.labels.setUnselectAllLabel()}" 3936 /> 3937 <label for="check-all"> 3938 ${this.labels.setCheckAllLabel()} 3939 </label> 3940 </div>` 3941 } 3942 3943 /** 3944 * Cria um template para o checkbox de seleção do grupo de cookies 3945 * @param {object} groupData - Objeto com dados de 1 grupo de cookies 3946 * @param {number} groupIndex - Ãndice do grupo de cookies 3947 * @returns {string} - Elemento DOM que representa o checkbox de seleção do grupo de cookies 3948 * @private 3949 */ 3950 _setCheckGroup(groupData, groupIndex) { 3951 return `<div class="br-checkbox"> 3952 <input 3953 id="${`check-group-${groupIndex}`}" 3954 name="${`check-group-${groupIndex}`}" 3955 type="checkbox" 3956 aria-label="${this.labels.setCheckGroupLabel(groupData)}" 3957 ${groupData.groupSelected ? 'checked' : ''} 3958 ${groupData.groupIndeterminated ? 'indeterminate' : ''} 3959 tabindex="0" 3960 data-child="check-all" 3961 data-parent="${`check-group-${groupIndex}`}" 3962 data-checked-label="${this.labels.setSelectAllGroupLabel()}" 3963 data-unchecked-label="${this.labels.setUnselectAllGroupLabel()}" 3964 /> 3965 <label for="${`check-group-${groupIndex}`}"> 3966 ${this.labels.setCheckGroupLabel(groupData)} 3967 </label> 3968 </div>` 3969 } 3970 3971 /** 3972 * Cria um template para checkbox(switch) de seleção do cookie 3973 * @param {number} groupIndex - Ãndice do grupo de cookies 3974 * @param {object} cookieData - Objeto com dados de 1 cookie 3975 * @param {number} cookieIndex - Ãndice do cookie 3976 * @returns {string} - Elemento DOM que representa o checkbox(switch) de seleção do cookie 3977 * @private 3978 */ 3979 _setCheckCookie(groupIndex, cookieData, cookieIndex) { 3980 return `<div class="br-switch small icon"> 3981 <input 3982 id="${`check-cookie-${groupIndex}-${cookieIndex}`}" 3983 name="${`check-cookie-${groupIndex}-${cookieIndex}`}" 3984 type="checkbox" 3985 ${cookieData.cookieSelected ? 'checked' : ''} 3986 tabindex="-1" 3987 data-child="${`check-group-${groupIndex}`}" 3988 /> 3989 <label 3990 for="${`check-cookie-${groupIndex}-${cookieIndex}`}" 3991 aria-label="${ 3992 cookieData.cookieSelected 3993 ? this.labels.setCheckCookieEnabledLabel() 3994 : this.labels.setCheckCookieDisabledLabel() 3995 }"> 3996 </label> 3997 <div 3998 class="switch-data" 3999 data-enabled="${this.labels.setCheckCookieEnabledLabel()}" 4000 data-disabled="${this.labels.setCheckCookieDisabledLabel()}"> 4001 </div> 4002 </div>` 4003 } 4004 4005 /** 4006 * Cria um template para a mensagem de alerta geral 4007 * @returns {string} - Elemento DOM que representa a mensagem de alerta geral ou uma string vazia 4008 * @public 4009 */ 4010 setAllAlertMessage() { 4011 return this.data.allAlertMessage 4012 ? `<span class="feedback warning ${ 4013 !this.data.selectAll || this.data.allIndeterminated ? '' : 'd-none' 4014 }" role="alert"> 4015 <i class="fas fa-exclamation-triangle" aria-hidden="true"></i> 4016 ${this.data.allAlertMessage} 4017 </span>` 4018 : '' 4019 } 4020 4021 /** 4022 * Cria um template para a mensagem de alerta para o grupo de cookies 4023 * @param {object} groupData - Objeto com dados de 1 grupo de cookies 4024 * @returns {string} - Elemento DOM que representa a mensagem de alerta para o grupo de cookies 4025 * @public 4026 */ 4027 setGroupAlertMessage(groupData) { 4028 return groupData.groupAlertMessage 4029 ? `<span class="feedback warning ${ 4030 !groupData.groupSelected || groupData.groupIndeterminated 4031 ? '' 4032 : 'd-none' 4033 }" role="alert"> 4034 <i class="fas fa-exclamation-triangle" aria-hidden="true"></i> 4035 ${groupData.groupAlertMessage} 4036 </span>` 4037 : '' 4038 } 4039 4040 /** 4041 * Cria um template para a mensagem de alerta para o cookie 4042 * @param {object} cookieData - Objeto com dados de 1 cookie 4043 * @returns {string} - Elemento DOM que representa a mensagem de alerta para o cookie 4044 * @public 4045 */ 4046 setCookieAlertMessage(cookieData) { 4047 return cookieData.alertMessage 4048 ? `<span class="feedback warning ${ 4049 !cookieData.cookieSelected ? '' : 'd-none' 4050 }" role="alert"> 4051 <i class="fas fa-exclamation-triangle" aria-hidden="true"></i> 4052 ${cookieData.alertMessage} 4053 </span>` 4054 : '' 4055 } 4056} 4057 4058 4059/***/ }), 4060
vendor: 8,973 bytes, lines 4061-4335
4061/***/ "./src/components/cookiebar/cookiebar.js": 4062/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 4063 4064"use strict"; 4065 4066// EXPORTS 4067__webpack_require__.d(__webpack_exports__, { 4068 "Z": () => (/* binding */ BRCookiebar) 4069}); 4070 4071// EXTERNAL MODULE: ./src/partial/js/behavior/checkgroup.js 4072var checkgroup = __webpack_require__("./src/partial/js/behavior/checkgroup.js"); 4073// EXTERNAL MODULE: ./src/components/cookiebar/cookiebar-data.js 4074var cookiebar_data = __webpack_require__("./src/components/cookiebar/cookiebar-data.js"); 4075// EXTERNAL MODULE: ./src/components/cookiebar/cookiebar-templates.js + 1 modules 4076var cookiebar_templates = __webpack_require__("./src/components/cookiebar/cookiebar-templates.js"); 4077;// CONCATENATED MODULE: ./src/components/cookiebar/selectors.js 4078/** Constantes representando seletores para o cookiebar */ 4079const POLITICS_BUTTON = '.actions .br-button.secondary' 4080const ACCEPT_BUTTON = '.actions .br-button.primary' 4081const ACTION_BUTTONS = `${POLITICS_BUTTON}, ${ACCEPT_BUTTON}` 4082const CLOSE_BUTTON = '.br-modal-header .br-button.close' 4083const CONTAINER_FLUID = '.br-modal > .br-card .container-fluid' 4084const WRAPPER = '.br-modal > .br-card .wrapper' 4085const MODAL_FOOTER = '.br-modal > .br-card .br-modal-footer' 4086const GROUP_INFO = '.main-content .group-info' 4087const COOKIE_CARD = '.main-content .cookie-info .br-card' 4088const BROAD_ALERT = 4089 '.header .row:nth-child(1) div:nth-child(3) .feedback' 4090const GROUP_ALERT = '.row:nth-child(1) div:nth-child(4) .feedback' 4091const COOKIE_ALERT = '.row:nth-child(1) div:nth-child(2) .feedback' 4092const BR_CHECKBOX = '.br-checkbox input[type="checkbox"]' 4093const BR_SWITCH = '.br-switch input[type="checkbox"]' 4094const CHECKBOX = `${BR_CHECKBOX}, ${BR_SWITCH}` 4095const PARENT_CHECKBOX = '.main-content .br-checkbox input[data-parent]' 4096const COOKIES_CHECKED = '.main-content .br-item .cookies-checked' 4097const GROUP_BUTTON = '.main-content .br-item .br-button' 4098const GROUP_NAME = '.main-content .br-item .group-name' 4099const GROUP_SIZE = '.main-content .br-item .group-size' 4100const BUTTON_ICON = '.br-button i.fas' 4101 4102;// CONCATENATED MODULE: ./src/components/cookiebar/cookiebar.js 4103 4104 4105 4106 4107 4108/** Classe para instanciar um objeto cookiebar */ 4109class BRCookiebar { 4110 /** 4111 * Instancia um objeto cookiebar 4112 * @param {object} objeto - Objeto para destructuring com as propriedades abaixo 4113 * @property {string} name - Nome do componente em minúsculo (br-cookiebar) 4114 * @property {object} component - Objeto referenciando a raiz do componente DOM 4115 * @property {string} json - JSON de entrada com dados do cookiebar 4116 * @property {string} lang - Lingua para filtrar o JSON de entrada 4117 * @property {string} mode - Mode de renderização do cookibar ('default' | 'open') 4118 * @property {function} callback - Chamada no aceite do cookiebar com o JSON de saÃda como argumento 4119 */ 4120 constructor({ name, component, json, lang, mode = 'default', callback }) { 4121 this.name = name 4122 this.component = component 4123 this.data = new cookiebar_data/* CookiebarData */.B(json, lang) 4124 this.templates = new cookiebar_templates/* CookiebarTemplates */.y(this.data) 4125 this.mode = mode 4126 this.callback = callback 4127 this._setUp() 4128 } 4129 4130 /** 4131 * Controla a instanciação do cookiebar 4132 * @private 4133 */ 4134 _setUp() { 4135 this._buildCookiebar() 4136 this._setBehavior() 4137 this._showCookiebar() 4138 } 4139 4140 /** 4141 * Controla a construção do cookiebar com o uso de templates 4142 * @private 4143 */ 4144 _buildCookiebar() { 4145 this.component.innerHTML = this.templates.setGlobalContentArea() 4146 } 4147 4148 /** 4149 * Controla o comportamento dos itens interativos do cookiebar 4150 * @private 4151 */ 4152 _setBehavior() { 4153 this._setAcceptButtonBehavior() 4154 this._setPoliticsButtonBehavior() 4155 this._setCloseButtonBehavior() 4156 this._setToggleGroupBehavior() 4157 this._setCheckboxBehavior() 4158 this._setSelectionBehavior() 4159 this._setWindowResizeBehavior() 4160 } 4161 4162 /** 4163 * Trata o comportamento do botão de aceite do cookiebar 4164 * @private 4165 */ 4166 _setAcceptButtonBehavior() { 4167 const acceptButton = this.component.querySelector(ACCEPT_BUTTON) 4168 4169 // Trata o aceite do cookiebar 4170 acceptButton.addEventListener('click', () => { 4171 this._hideCookiebar() 4172 // this._resetCookiebar() 4173 document.body.style.overflowY = 'auto' 4174 this.callback(this._setOutputJSON()) 4175 }) 4176 4177 // (Navegação por teclado) Mantém o foco no cookiebar quando ele está aberto 4178 acceptButton.addEventListener('keydown', (event) => { 4179 if (event.key === 'Tab') { 4180 if (!this.component.classList.contains('default')) { 4181 this.component.focus() 4182 } 4183 } 4184 }) 4185 4186 this._setActionButtonResponsive(acceptButton) 4187 } 4188 4189 /** 4190 * Trata o comportamento do botão de polÃticas/definições de cookies 4191 * @private 4192 */ 4193 _setPoliticsButtonBehavior() { 4194 this.component 4195 .querySelectorAll(POLITICS_BUTTON) 4196 .forEach((politicsButton) => { 4197 // Expande o cookiebar 4198 politicsButton.addEventListener('click', () => { 4199 politicsButton.classList.add('d-none') 4200 this.component.classList.remove('default') 4201 this.component.focus() 4202 document.body.style.overflowY = 'hidden' 4203 this._setOpenView() 4204 }) 4205 4206 this._setActionButtonResponsive(politicsButton) 4207 }) 4208 } 4209 4210 /** 4211 * Trata o comportamento do botão de fechar do cookiebar no modo open 4212 * @orivate 4213 */ 4214 _setCloseButtonBehavior() { 4215 this.component 4216 .querySelectorAll(CLOSE_BUTTON) 4217 .forEach((closeButton) => { 4218 // encolhe o cookiebar (volta ao cookiebar default) 4219 closeButton.addEventListener('click', () => { 4220 this.component.classList.add('default') 4221 switch (this.mode) { 4222 case 'open': 4223 this._hideCookiebar() 4224 // this._resetCookiebar() 4225 default: 4226 } 4227 4228 this.component 4229 .querySelector(POLITICS_BUTTON) 4230 .classList.remove('d-none') 4231 document.body.style.overflowY = 'auto' 4232 4233 this._setDefaultView() 4234 }) 4235 }) 4236 } 4237 4238 /** 4239 * Trata o redimensionamento da tela 4240 * @private 4241 */ 4242 _setWindowResizeBehavior() { 4243 window.addEventListener('resize', () => { 4244 if (!this.component.classList.contains('default')) { 4245 this._setOpenView() 4246 } 4247 this.component 4248 .querySelectorAll(ACTION_BUTTONS) 4249 .forEach((button) => { 4250 this._setActionButtonResponsive(button) 4251 }) 4252 }) 4253 } 4254 4255 /** 4256 * Trata a responsividade de um botão de ação baseado na largura da tela 4257 * @param {object} button - Elemento DOM que representa um botão de ação 4258 * @private 4259 */ 4260 _setActionButtonResponsive(button) { 4261 if (window.matchMedia('(max-width: 574px)').matches) { 4262 button.classList.add('block') 4263 } 4264 if (window.matchMedia('(min-width: 575px)').matches) { 4265 button.classList.remove('block') 4266 } 4267 } 4268 4269 /** 4270 * Trata a abertura/fechamento do grupo de cookies 4271 * @private 4272 */ 4273 _setToggleGroupBehavior() { 4274 this.component 4275 .querySelectorAll( 4276 `${`${GROUP_BUTTON}, ${GROUP_NAME}, ${COOKIES_CHECKED}, ${GROUP_SIZE}`}` 4277 ) 4278 .forEach((clickable) => { 4279 clickable.addEventListener( 4280 'click', 4281 this._handleToggleGroupClick.bind(this) 4282 ) 4283 }) 4284 } 4285 4286 /** 4287 * Handler que trata do evento de click no grupo 4288 * @param {object} event - Objeto Event 4289 * @private 4290 */ 4291 _handleToggleGroupClick(event) { 4292 const element = this._getParentElementByClass( 4293 event.currentTarget, 4294 'br-item' 4295 ) 4296 if (element.classList.contains('open')) { 4297 element.classList.remove('open') 4298 element.nextElementSibling 4299 .querySelectorAll(BR_SWITCH) 4300 .forEach((check) => { 4301 check.setAttribute('tabindex', -1) 4302 }) 4303 this._setGroupAttributes(element, 'Expandir') 4304 this._toggleIcon(element, 'fa-angle-up', 'fa-angle-down') 4305 } else { 4306 element.classList.add('open') 4307 element.nextElementSibling 4308 .querySelectorAll(BR_SWITCH) 4309 .forEach((check) => { 4310 check.setAttribute('tabindex', 0) 4311 }) 4312 this._setGroupAttributes(element, 'Retrair') 4313 this._toggleIcon(element, 'fa-angle-down', 'fa-angle-up') 4314 this._scrollUp(element) 4315 } 4316 } 4317 4318 /** 4319 * Trata do comportamento do grupo de checkboxes do cookiebar 4320 * @private 4321 */ 4322 _setCheckboxBehavior() { 4323 this.component 4324 .querySelectorAll(PARENT_CHECKBOX) 4325 .forEach((trigger) => { 4326 this.checkgroupBehavior = new checkgroup["default"](trigger) 4327 this.checkgroupBehavior.setBehavior() 4328 }) 4329 } 4330 4331 /** 4332 * Trata da seleção dos checkboxes 4333 * @private 4334 */ 4335 _setSelectionBehavior() {
vendor: 5,301 bytes, lines 4336-4502
4336 this.component.querySelectorAll(CHECKBOX).forEach((checkbox) => { 4337 checkbox.addEventListener('change', this._controlSelection.bind(this)) 4338 }) 4339 } 4340 4341 /** 4342 * Handler para o evento change na seleção dos checkboxes 4343 * @param {object} event - Objeto eventDOM 4344 * @private 4345 */ 4346 _controlSelection(event) { 4347 const segment = event.currentTarget.id.split('-') 4348 switch (segment[1]) { 4349 case 'all': 4350 this._setCheckAllBehavior(event.currentTarget) 4351 break 4352 case 'group': 4353 this._setCheckgroupBehavior(event.currentTarget, segment[2]) 4354 break 4355 case 'cookie': 4356 this._setCheckCookieBehavior( 4357 event.currentTarget, 4358 segment[2], 4359 segment[3] 4360 ) 4361 break 4362 default: 4363 } 4364 } 4365 4366 /** 4367 * Trata a seleção do checkbox geral 4368 * @param {object} checkbox - Elemento DOM que represeta um checkbox geral 4369 * @private 4370 */ 4371 _setCheckAllBehavior(checkbox) { 4372 this.data.selectAll = checkbox.checked 4373 this.data.allIndeterminated = checkbox.hasAttribute('indeterminate') 4374 ? true 4375 : false 4376 this._displayBroadAlertMessage() 4377 } 4378 4379 /** 4380 * Trata da seleção do checkbox de grupo 4381 * @param {object} checkbox - Elemento DOM que represta um checkbox de grupo 4382 * @param {number} groupIndex - Ãndice do grupo 4383 * @private 4384 */ 4385 _setCheckgroupBehavior(checkbox, groupIndex) { 4386 this.data.cookieGroups[groupIndex].groupSelected = checkbox.checked 4387 this.data.cookieGroups[groupIndex].groupIndeterminated = 4388 checkbox.hasAttribute('indeterminate') ? true : false 4389 this.data.cookieGroups[groupIndex].cookieList.forEach( 4390 (cookieData, cookieIndex) => { 4391 if (!cookieData.cookieOptOut) { 4392 cookieData.cookieSelected = checkbox.checked 4393 this._displayCookieAlertMessage(groupIndex, cookieIndex) 4394 } 4395 } 4396 ) 4397 this._displayGroupAlertMessage(groupIndex) 4398 } 4399 4400 /** 4401 * Trata da seleção do checkbox de cookie 4402 * @param {object} checkbox - Elemento DOM que represeta um checkbox de cookie 4403 * @param {number} groupIndex - Ãndice do grupo 4404 * @param {number} cookieIndex - Ãndicd do cookie dentro do grupo 4405 * @private 4406 */ 4407 _setCheckCookieBehavior(checkbox, groupIndex, cookieIndex) { 4408 this.data.cookieGroups[groupIndex].cookieList[cookieIndex].cookieSelected = 4409 checkbox.checked 4410 this._displayCookieAlertMessage(groupIndex, cookieIndex) 4411 } 4412 4413 /** 4414 * Controla a apresentação da mensagem geral 4415 * @private 4416 */ 4417 _displayBroadAlertMessage() { 4418 this.component 4419 .querySelectorAll(BROAD_ALERT) 4420 .forEach((broadAlert) => { 4421 if ( 4422 this.data.allAlertMessage && 4423 (!this.data.selectAll || this.data.allIndeterminated) 4424 ) { 4425 broadAlert.classList.remove('d-none') 4426 } else { 4427 broadAlert.classList.add('d-none') 4428 } 4429 }) 4430 } 4431 4432 /** 4433 * Controla a apresentação da mensagem de grupo 4434 * @param {number} groupIndex - Ãndice do grupo 4435 * @private 4436 */ 4437 _displayGroupAlertMessage(groupIndex) { 4438 const group = this.component.querySelectorAll(GROUP_INFO)[ 4439 groupIndex 4440 ] 4441 group.querySelectorAll(GROUP_ALERT).forEach((groupAlert) => { 4442 if ( 4443 this.data.cookieGroups[groupIndex].groupAlertMessage && 4444 (!this.data.cookieGroups[groupIndex].groupSelected || 4445 this.data.cookieGroups[groupIndex].groupIndeterminated) 4446 ) { 4447 groupAlert.classList.remove('d-none') 4448 } else { 4449 groupAlert.classList.add('d-none') 4450 } 4451 }) 4452 } 4453 4454 /** 4455 * Controla a apresentação da mensagem de cookie 4456 * @param {number} groupIndex - Ãndice do grupo 4457 * @param {number} cookieIndex - Ãndice do cookie dentro do grupo 4458 */ 4459 _displayCookieAlertMessage(groupIndex, cookieIndex) { 4460 const group = this.component.querySelectorAll(GROUP_INFO)[ 4461 groupIndex 4462 ] 4463 const cookie = group.nextElementSibling.querySelectorAll( 4464 COOKIE_CARD 4465 )[cookieIndex] 4466 cookie.querySelectorAll(COOKIE_ALERT).forEach((cookieAlert) => { 4467 if ( 4468 this.data.cookieGroups[groupIndex].cookieList[cookieIndex] 4469 .alertMessage && 4470 !this.data.cookieGroups[groupIndex].cookieList[cookieIndex] 4471 .cookieSelected 4472 ) { 4473 cookieAlert.classList.remove('d-none') 4474 } else { 4475 cookieAlert.classList.add('d-none') 4476 } 4477 }) 4478 } 4479 4480 /** 4481 * Busca um elemento DOM pai com uma determinada classe 4482 * @param {object} element - Elemento DOM 4483 * @param {string} className - Nome de uma classe para busca 4484 * @returns {object} - Elemento DOM representando que contém uma determinada classe 4485 * @private 4486 */ 4487 _getParentElementByClass(element, className) { 4488 parent = element.parentNode 4489 while (!parent.classList.contains(className)) { 4490 parent = parent.parentNode 4491 } 4492 return parent 4493 } 4494 4495 /** 4496 * Troca a classe do icone 4497 * @param {object} element - Elemento DOM referente ao icone 4498 * @param {string} oldIcon - Classe do icone que será retirada 4499 * @param {string} newIcon - Classe do icone que será incluido 4500 * @private 4501 */ 4502 _toggleIcon(element, oldIcon, newIcon) {
vendor: 16,398 bytes, lines 4503-5039
4503 element.querySelectorAll(BUTTON_ICON).forEach((icon) => { 4504 icon.classList.remove(oldIcon) 4505 icon.classList.add(newIcon) 4506 }) 4507 } 4508 4509 /** 4510 * Trata a label do atributo title e aria-label 4511 * @param {object} element - Elemento DOM referente ao grupo 4512 * @param {string} label - Label para o title e aria-label 4513 * @private 4514 */ 4515 _setGroupAttributes(element, label) { 4516 element 4517 .querySelectorAll( 4518 `${`${GROUP_BUTTON}, ${GROUP_NAME}, ${COOKIES_CHECKED}, ${GROUP_SIZE}`}` 4519 ) 4520 .forEach((item) => { 4521 item.setAttribute('title', label) 4522 item.setAttribute('aria-label', label) 4523 }) 4524 } 4525 4526 /** 4527 * Trata a rolagem da tela do grupo de cookies aberto 4528 * @param {object} element - Elemento DOM que representa a grupo de cookies 4529 * @private 4530 */ 4531 _scrollUp(element) { 4532 setTimeout(() => { 4533 this.component.querySelectorAll(WRAPPER).forEach(() => { 4534 setTimeout(() => { 4535 element.scrollIntoView({ 4536 behavior: 'smooth', 4537 block: 'start', 4538 }) 4539 }, 150) 4540 }, 5000) 4541 }) 4542 } 4543 4544 /** 4545 * Mostra o cookiebar na tela com foco e no modo escolhido 4546 * @private 4547 */ 4548 _showCookiebar() { 4549 this.component.classList.remove('d-none') 4550 this.component.focus() 4551 switch (this.mode) { 4552 case 'open': 4553 this.component.classList.remove('default') 4554 this.component 4555 .querySelectorAll(POLITICS_BUTTON) 4556 .forEach((button) => { 4557 button.classList.add('d-none') 4558 }) 4559 document.body.style.overflowY = 'hidden' 4560 this._setOpenView() 4561 default: 4562 } 4563 } 4564 4565 /** 4566 * Oculta o cookiebar na tela 4567 * @private 4568 */ 4569 _hideCookiebar() { 4570 this.component.classList.add('d-none') 4571 } 4572 4573 /** 4574 * Configura a altura da parte rolável do cookiebar de acordo com a altura da janela 4575 * @private 4576 */ 4577 _setOpenView() { 4578 const wrapper = this.component.querySelector(WRAPPER) 4579 const containerFluid = this.component.querySelector( 4580 CONTAINER_FLUID 4581 ) 4582 const modalFooter = this.component.querySelector(MODAL_FOOTER) 4583 const padding = window 4584 .getComputedStyle(containerFluid, null) 4585 .getPropertyValue('padding-top') 4586 .match(/\d+/) 4587 const height = `${ 4588 window.innerHeight - padding * 2 - modalFooter.offsetHeight 4589 }px` 4590 wrapper.style.height = height 4591 } 4592 4593 /** 4594 * Configura a altura do cookiebar no modo default 4595 * @private 4596 */ 4597 _setDefaultView() { 4598 this.component.querySelector(WRAPPER).removeAttribute('style') 4599 } 4600 4601 /** 4602 * Cria o JSON de saÃda do cookiebar 4603 * @returns {string} - JSON de saÃda do cookiebar 4604 * @private 4605 */ 4606 _setOutputJSON() { 4607 this.output = {} 4608 this.output.selectAll = this.data.allIndeterminated 4609 ? 'indeterminated' 4610 : this.data.selectAll 4611 this.output.cookieGroups = [] 4612 this.data.cookieGroups.forEach((groupData) => { 4613 const cookies = [] 4614 groupData.cookieList.forEach((cookieData) => { 4615 cookies.push({ 4616 cookieId: cookieData.cookieId, 4617 cookieSelected: cookieData.cookieSelected, 4618 }) 4619 }) 4620 this.output.cookieGroups.push({ 4621 cookieList: cookies, 4622 groupId: groupData.groupId, 4623 groupSelected: groupData.groupIndeterminated 4624 ? 'indeterminated' 4625 : groupData.groupSelected, 4626 }) 4627 }) 4628 return JSON.stringify(this.output) 4629 } 4630 4631 static createCookiebar(json, callback) { 4632 const brCookiebar = document.createElement('div') 4633 brCookiebar.classList.add('br-cookiebar', 'default', 'd-none') 4634 brCookiebar.setAttribute('tabindex', 1) 4635 4636 document.body.appendChild(brCookiebar) 4637 4638 const params = { 4639 callback, 4640 component: brCookiebar, 4641 json, 4642 lang: 'pt-br', 4643 mode: 'default', 4644 name: 'br-cookiebar', 4645 } 4646 4647 return new BRCookiebar(params) 4648 } 4649} 4650 4651 4652/***/ }), 4653 4654/***/ "./src/components/datetimepicker/datetimepicker.js": 4655/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 4656 4657"use strict"; 4658 4659// EXPORTS 4660__webpack_require__.d(__webpack_exports__, { 4661 "Z": () => (/* binding */ datetimepicker) 4662}); 4663 4664;// CONCATENATED MODULE: ./node_modules/flatpickr/dist/esm/types/options.js 4665var HOOKS = [ 4666 "onChange", 4667 "onClose", 4668 "onDayCreate", 4669 "onDestroy", 4670 "onKeyDown", 4671 "onMonthChange", 4672 "onOpen", 4673 "onParseConfig", 4674 "onReady", 4675 "onValueUpdate", 4676 "onYearChange", 4677 "onPreCalendarPosition", 4678]; 4679var defaults = { 4680 _disable: [], 4681 allowInput: false, 4682 allowInvalidPreload: false, 4683 altFormat: "F j, Y", 4684 altInput: false, 4685 altInputClass: "form-control input", 4686 animate: typeof window === "object" && 4687 window.navigator.userAgent.indexOf("MSIE") === -1, 4688 ariaDateFormat: "F j, Y", 4689 autoFillDefaultTime: true, 4690 clickOpens: true, 4691 closeOnSelect: true, 4692 conjunction: ", ", 4693 dateFormat: "Y-m-d", 4694 defaultHour: 12, 4695 defaultMinute: 0, 4696 defaultSeconds: 0, 4697 disable: [], 4698 disableMobile: false, 4699 enableSeconds: false, 4700 enableTime: false, 4701 errorHandler: function (err) { 4702 return typeof console !== "undefined" && console.warn(err); 4703 }, 4704 getWeek: function (givenDate) { 4705 var date = new Date(givenDate.getTime()); 4706 date.setHours(0, 0, 0, 0); 4707 date.setDate(date.getDate() + 3 - ((date.getDay() + 6) % 7)); 4708 var week1 = new Date(date.getFullYear(), 0, 4); 4709 return (1 + 4710 Math.round(((date.getTime() - week1.getTime()) / 86400000 - 4711 3 + 4712 ((week1.getDay() + 6) % 7)) / 4713 7)); 4714 }, 4715 hourIncrement: 1, 4716 ignoredFocusElements: [], 4717 inline: false, 4718 locale: "default", 4719 minuteIncrement: 5, 4720 mode: "single", 4721 monthSelectorType: "dropdown", 4722 nextArrow: "<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>", 4723 noCalendar: false, 4724 now: new Date(), 4725 onChange: [], 4726 onClose: [], 4727 onDayCreate: [], 4728 onDestroy: [], 4729 onKeyDown: [], 4730 onMonthChange: [], 4731 onOpen: [], 4732 onParseConfig: [], 4733 onReady: [], 4734 onValueUpdate: [], 4735 onYearChange: [], 4736 onPreCalendarPosition: [], 4737 plugins: [], 4738 position: "auto", 4739 positionElement: undefined, 4740 prevArrow: "<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>", 4741 shorthandCurrentMonth: false, 4742 showMonths: 1, 4743 static: false, 4744 time_24hr: false, 4745 weekNumbers: false, 4746 wrap: false, 4747}; 4748 4749;// CONCATENATED MODULE: ./node_modules/flatpickr/dist/esm/l10n/default.js 4750var english = { 4751 weekdays: { 4752 shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], 4753 longhand: [ 4754 "Sunday", 4755 "Monday", 4756 "Tuesday", 4757 "Wednesday", 4758 "Thursday", 4759 "Friday", 4760 "Saturday", 4761 ], 4762 }, 4763 months: { 4764 shorthand: [ 4765 "Jan", 4766 "Feb", 4767 "Mar", 4768 "Apr", 4769 "May", 4770 "Jun", 4771 "Jul", 4772 "Aug", 4773 "Sep", 4774 "Oct", 4775 "Nov", 4776 "Dec", 4777 ], 4778 longhand: [ 4779 "January", 4780 "February", 4781 "March", 4782 "April", 4783 "May", 4784 "June", 4785 "July", 4786 "August", 4787 "September", 4788 "October", 4789 "November", 4790 "December", 4791 ], 4792 }, 4793 daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], 4794 firstDayOfWeek: 0, 4795 ordinal: function (nth) { 4796 var s = nth % 100; 4797 if (s > 3 && s < 21) 4798 return "th"; 4799 switch (s % 10) { 4800 case 1: 4801 return "st"; 4802 case 2: 4803 return "nd"; 4804 case 3: 4805 return "rd"; 4806 default: 4807 return "th"; 4808 } 4809 }, 4810 rangeSeparator: " to ", 4811 weekAbbreviation: "Wk", 4812 scrollTitle: "Scroll to increment", 4813 toggleTitle: "Click to toggle", 4814 amPM: ["AM", "PM"], 4815 yearAriaLabel: "Year", 4816 monthAriaLabel: "Month", 4817 hourAriaLabel: "Hour", 4818 minuteAriaLabel: "Minute", 4819 time_24hr: false, 4820}; 4821/* harmony default export */ const l10n_default = (english); 4822 4823;// CONCATENATED MODULE: ./node_modules/flatpickr/dist/esm/utils/index.js 4824var pad = function (number, length) { 4825 if (length === void 0) { length = 2; } 4826 return ("000" + number).slice(length * -1); 4827}; 4828var utils_int = function (bool) { return (bool === true ? 1 : 0); }; 4829function debounce(fn, wait) { 4830 var t; 4831 return function () { 4832 var _this = this; 4833 var args = arguments; 4834 clearTimeout(t); 4835 t = setTimeout(function () { return fn.apply(_this, args); }, wait); 4836 }; 4837} 4838var arrayify = function (obj) { 4839 return obj instanceof Array ? obj : [obj]; 4840}; 4841 4842;// CONCATENATED MODULE: ./node_modules/flatpickr/dist/esm/utils/dom.js 4843function toggleClass(elem, className, bool) { 4844 if (bool === true) 4845 return elem.classList.add(className); 4846 elem.classList.remove(className); 4847} 4848function createElement(tag, className, content) { 4849 var e = window.document.createElement(tag); 4850 className = className || ""; 4851 content = content || ""; 4852 e.className = className; 4853 if (content !== undefined) 4854 e.textContent = content; 4855 return e; 4856} 4857function clearNode(node) { 4858 while (node.firstChild) 4859 node.removeChild(node.firstChild); 4860} 4861function findParent(node, condition) { 4862 if (condition(node)) 4863 return node; 4864 else if (node.parentNode) 4865 return findParent(node.parentNode, condition); 4866 return undefined; 4867} 4868function createNumberInput(inputClassName, opts) { 4869 var wrapper = createElement("div", "numInputWrapper"), numInput = createElement("input", "numInput " + inputClassName), arrowUp = createElement("span", "arrowUp"), arrowDown = createElement("span", "arrowDown"); 4870 if (navigator.userAgent.indexOf("MSIE 9.0") === -1) { 4871 numInput.type = "number"; 4872 } 4873 else { 4874 numInput.type = "text"; 4875 numInput.pattern = "\\d*"; 4876 } 4877 if (opts !== undefined) 4878 for (var key in opts) 4879 numInput.setAttribute(key, opts[key]); 4880 wrapper.appendChild(numInput); 4881 wrapper.appendChild(arrowUp); 4882 wrapper.appendChild(arrowDown); 4883 return wrapper; 4884} 4885function getEventTarget(event) { 4886 try { 4887 if (typeof event.composedPath === "function") { 4888 var path = event.composedPath(); 4889 return path[0]; 4890 } 4891 return event.target; 4892 } 4893 catch (error) { 4894 return event.target; 4895 } 4896} 4897 4898;// CONCATENATED MODULE: ./node_modules/flatpickr/dist/esm/utils/formatting.js 4899 4900var doNothing = function () { return undefined; }; 4901var monthToStr = function (monthNumber, shorthand, locale) { return locale.months[shorthand ? "shorthand" : "longhand"][monthNumber]; }; 4902var revFormat = { 4903 D: doNothing, 4904 F: function (dateObj, monthName, locale) { 4905 dateObj.setMonth(locale.months.longhand.indexOf(monthName)); 4906 }, 4907 G: function (dateObj, hour) { 4908 dateObj.setHours((dateObj.getHours() >= 12 ? 12 : 0) + parseFloat(hour)); 4909 }, 4910 H: function (dateObj, hour) { 4911 dateObj.setHours(parseFloat(hour)); 4912 }, 4913 J: function (dateObj, day) { 4914 dateObj.setDate(parseFloat(day)); 4915 }, 4916 K: function (dateObj, amPM, locale) { 4917 dateObj.setHours((dateObj.getHours() % 12) + 4918 12 * utils_int(new RegExp(locale.amPM[1], "i").test(amPM))); 4919 }, 4920 M: function (dateObj, shortMonth, locale) { 4921 dateObj.setMonth(locale.months.shorthand.indexOf(shortMonth)); 4922 }, 4923 S: function (dateObj, seconds) { 4924 dateObj.setSeconds(parseFloat(seconds)); 4925 }, 4926 U: function (_, unixSeconds) { return new Date(parseFloat(unixSeconds) * 1000); }, 4927 W: function (dateObj, weekNum, locale) { 4928 var weekNumber = parseInt(weekNum); 4929 var date = new Date(dateObj.getFullYear(), 0, 2 + (weekNumber - 1) * 7, 0, 0, 0, 0); 4930 date.setDate(date.getDate() - date.getDay() + locale.firstDayOfWeek); 4931 return date; 4932 }, 4933 Y: function (dateObj, year) { 4934 dateObj.setFullYear(parseFloat(year)); 4935 }, 4936 Z: function (_, ISODate) { return new Date(ISODate); }, 4937 d: function (dateObj, day) { 4938 dateObj.setDate(parseFloat(day)); 4939 }, 4940 h: function (dateObj, hour) { 4941 dateObj.setHours((dateObj.getHours() >= 12 ? 12 : 0) + parseFloat(hour)); 4942 }, 4943 i: function (dateObj, minutes) { 4944 dateObj.setMinutes(parseFloat(minutes)); 4945 }, 4946 j: function (dateObj, day) { 4947 dateObj.setDate(parseFloat(day)); 4948 }, 4949 l: doNothing, 4950 m: function (dateObj, month) { 4951 dateObj.setMonth(parseFloat(month) - 1); 4952 }, 4953 n: function (dateObj, month) { 4954 dateObj.setMonth(parseFloat(month) - 1); 4955 }, 4956 s: function (dateObj, seconds) { 4957 dateObj.setSeconds(parseFloat(seconds)); 4958 }, 4959 u: function (_, unixMillSeconds) { 4960 return new Date(parseFloat(unixMillSeconds)); 4961 }, 4962 w: doNothing, 4963 y: function (dateObj, year) { 4964 dateObj.setFullYear(2000 + parseFloat(year)); 4965 }, 4966}; 4967var tokenRegex = { 4968 D: "", 4969 F: "", 4970 G: "(\\d\\d|\\d)", 4971 H: "(\\d\\d|\\d)", 4972 J: "(\\d\\d|\\d)\\w+", 4973 K: "", 4974 M: "", 4975 S: "(\\d\\d|\\d)", 4976 U: "(.+)", 4977 W: "(\\d\\d|\\d)", 4978 Y: "(\\d{4})", 4979 Z: "(.+)", 4980 d: "(\\d\\d|\\d)", 4981 h: "(\\d\\d|\\d)", 4982 i: "(\\d\\d|\\d)", 4983 j: "(\\d\\d|\\d)", 4984 l: "", 4985 m: "(\\d\\d|\\d)", 4986 n: "(\\d\\d|\\d)", 4987 s: "(\\d\\d|\\d)", 4988 u: "(.+)", 4989 w: "(\\d\\d|\\d)", 4990 y: "(\\d{2})", 4991}; 4992var formats = { 4993 Z: function (date) { return date.toISOString(); }, 4994 D: function (date, locale, options) { 4995 return locale.weekdays.shorthand[formats.w(date, locale, options)]; 4996 }, 4997 F: function (date, locale, options) { 4998 return monthToStr(formats.n(date, locale, options) - 1, false, locale); 4999 }, 5000 G: function (date, locale, options) { 5001 return pad(formats.h(date, locale, options)); 5002 }, 5003 H: function (date) { return pad(date.getHours()); }, 5004 J: function (date, locale) { 5005 return locale.ordinal !== undefined 5006 ? date.getDate() + locale.ordinal(date.getDate()) 5007 : date.getDate(); 5008 }, 5009 K: function (date, locale) { return locale.amPM[utils_int(date.getHours() > 11)]; }, 5010 M: function (date, locale) { 5011 return monthToStr(date.getMonth(), true, locale); 5012 }, 5013 S: function (date) { return pad(date.getSeconds()); }, 5014 U: function (date) { return date.getTime() / 1000; }, 5015 W: function (date, _, options) { 5016 return options.getWeek(date); 5017 }, 5018 Y: function (date) { return pad(date.getFullYear(), 4); }, 5019 d: function (date) { return pad(date.getDate()); }, 5020 h: function (date) { return (date.getHours() % 12 ? date.getHours() % 12 : 12); }, 5021 i: function (date) { return pad(date.getMinutes()); }, 5022 j: function (date) { return date.getDate(); }, 5023 l: function (date, locale) { 5024 return locale.weekdays.longhand[date.getDay()]; 5025 }, 5026 m: function (date) { return pad(date.getMonth() + 1); }, 5027 n: function (date) { return date.getMonth() + 1; }, 5028 s: function (date) { return date.getSeconds(); }, 5029 u: function (date) { return date.getTime(); }, 5030 w: function (date) { return date.getDay(); }, 5031 y: function (date) { return String(date.getFullYear()).substring(2); }, 5032}; 5033 5034;// CONCATENATED MODULE: ./node_modules/flatpickr/dist/esm/utils/dates.js 5035 5036 5037 5038var createDateFormatter = function (_a) { 5039 var _b = _a.config, config = _b === void 0 ? defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? english : _
vendor: 3,590 bytes, lines 5039-5122
5039c, _d = _a.isMobile, isMobile = _d === void 0 ? false : _d; 5040 return function (dateObj, frmt, overrideLocale) { 5041 var locale = overrideLocale || l10n; 5042 if (config.formatDate !== undefined && !isMobile) { 5043 return config.formatDate(dateObj, frmt, locale); 5044 } 5045 return frmt 5046 .split("") 5047 .map(function (c, i, arr) { 5048 return formats[c] && arr[i - 1] !== "\\" 5049 ? formats[c](dateObj, locale, config) 5050 : c !== "\\" 5051 ? c 5052 : ""; 5053 }) 5054 .join(""); 5055 }; 5056}; 5057var createDateParser = function (_a) { 5058 var _b = _a.config, config = _b === void 0 ? defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? english : _c; 5059 return function (date, givenFormat, timeless, customLocale) { 5060 if (date !== 0 && !date) 5061 return undefined; 5062 var locale = customLocale || l10n; 5063 var parsedDate; 5064 var dateOrig = date; 5065 if (date instanceof Date) 5066 parsedDate = new Date(date.getTime()); 5067 else if (typeof date !== "string" && 5068 date.toFixed !== undefined) 5069 parsedDate = new Date(date); 5070 else if (typeof date === "string") { 5071 var format = givenFormat || (config || defaults).dateFormat; 5072 var datestr = String(date).trim(); 5073 if (datestr === "today") { 5074 parsedDate = new Date(); 5075 timeless = true; 5076 } 5077 else if (config && config.parseDate) { 5078 parsedDate = config.parseDate(date, format); 5079 } 5080 else if (/Z$/.test(datestr) || 5081 /GMT$/.test(datestr)) { 5082 parsedDate = new Date(date); 5083 } 5084 else { 5085 var matched = void 0, ops = []; 5086 for (var i = 0, matchIndex = 0, regexStr = ""; i < format.length; i++) { 5087 var token = format[i]; 5088 var isBackSlash = token === "\\"; 5089 var escaped = format[i - 1] === "\\" || isBackSlash; 5090 if (tokenRegex[token] && !escaped) { 5091 regexStr += tokenRegex[token]; 5092 var match = new RegExp(regexStr).exec(date); 5093 if (match && (matched = true)) { 5094 ops[token !== "Y" ? "push" : "unshift"]({ 5095 fn: revFormat[token], 5096 val: match[++matchIndex], 5097 }); 5098 } 5099 } 5100 else if (!isBackSlash) 5101 regexStr += "."; 5102 } 5103 parsedDate = 5104 !config || !config.noCalendar 5105 ? new Date(new Date().getFullYear(), 0, 1, 0, 0, 0, 0) 5106 : new Date(new Date().setHours(0, 0, 0, 0)); 5107 ops.forEach(function (_a) { 5108 var fn = _a.fn, val = _a.val; 5109 return (parsedDate = fn(parsedDate, val, locale) || parsedDate); 5110 }); 5111 parsedDate = matched ? parsedDate : undefined; 5112 } 5113 } 5114 if (!(parsedDate instanceof Date && !isNaN(parsedDate.getTime()))) { 5115 config.errorHandler(new Error("Invalid date provided: " + dateOrig)); 5116 return undefined; 5117 } 5118 if (timeless === true) 5119 parsedDate.setHours(0, 0, 0, 0); 5120 return parsedDate; 5121 }; 5122};
vendor: 2,841 bytes, lines 5123-5192
5123function compareDates(date1, date2, timeless) { 5124 if (timeless === void 0) { timeless = true; } 5125 if (timeless !== false) { 5126 return (new Date(date1.getTime()).setHours(0, 0, 0, 0) - 5127 new Date(date2.getTime()).setHours(0, 0, 0, 0)); 5128 } 5129 return date1.getTime() - date2.getTime(); 5130} 5131function compareTimes(date1, date2) { 5132 return (3600 * (date1.getHours() - date2.getHours()) + 5133 60 * (date1.getMinutes() - date2.getMinutes()) + 5134 date1.getSeconds() - 5135 date2.getSeconds()); 5136} 5137var isBetween = function (ts, ts1, ts2) { 5138 return ts > Math.min(ts1, ts2) && ts < Math.max(ts1, ts2); 5139}; 5140var calculateSecondsSinceMidnight = function (hours, minutes, seconds) { 5141 return hours * 3600 + minutes * 60 + seconds; 5142}; 5143var parseSeconds = function (secondsSinceMidnight) { 5144 var hours = Math.floor(secondsSinceMidnight / 3600), minutes = (secondsSinceMidnight - hours * 3600) / 60; 5145 return [hours, minutes, secondsSinceMidnight - hours * 3600 - minutes * 60]; 5146}; 5147var duration = { 5148 DAY: 86400000, 5149}; 5150function getDefaultHours(config) { 5151 var hours = config.defaultHour; 5152 var minutes = config.defaultMinute; 5153 var seconds = config.defaultSeconds; 5154 if (config.minDate !== undefined) { 5155 var minHour = config.minDate.getHours(); 5156 var minMinutes = config.minDate.getMinutes(); 5157 var minSeconds = config.minDate.getSeconds(); 5158 if (hours < minHour) { 5159 hours = minHour; 5160 } 5161 if (hours === minHour && minutes < minMinutes) { 5162 minutes = minMinutes; 5163 } 5164 if (hours === minHour && minutes === minMinutes && seconds < minSeconds) 5165 seconds = config.minDate.getSeconds(); 5166 } 5167 if (config.maxDate !== undefined) { 5168 var maxHr = config.maxDate.getHours(); 5169 var maxMinutes = config.maxDate.getMinutes(); 5170 hours = Math.min(hours, maxHr); 5171 if (hours === maxHr) 5172 minutes = Math.min(maxMinutes, minutes); 5173 if (hours === maxHr && minutes === maxMinutes) 5174 seconds = config.maxDate.getSeconds(); 5175 } 5176 return { hours: hours, minutes: minutes, seconds: seconds }; 5177} 5178 5179// EXTERNAL MODULE: ./node_modules/flatpickr/dist/esm/utils/polyfills.js 5180var polyfills = __webpack_require__("./node_modules/flatpickr/dist/esm/utils/polyfills.js"); 5181;// CONCATENATED MODULE: ./node_modules/flatpickr/dist/esm/index.js 5182var __assign = (undefined && undefined.__assign) || function () { 5183 __assign = Object.assign || function(t) { 5184 for (var s, i = 1, n = arguments.length; i < n; i++) { 5185 s = arguments[i]; 5186 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) 5187 t[p] = s[p]; 5188 } 5189 return t; 5190 }; 5191 return __assign.apply(this, arguments); 5192};
vendor: 4,914 bytes, lines 5193-5320
5193var __spreadArrays = (undefined && undefined.__spreadArrays) || function () { 5194 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; 5195 for (var r = Array(s), k = 0, i = 0; i < il; i++) 5196 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) 5197 r[k] = a[j]; 5198 return r; 5199}; 5200 5201 5202 5203 5204 5205 5206 5207var DEBOUNCED_CHANGE_MS = 300; 5208function FlatpickrInstance(element, instanceConfig) { 5209 var self = { 5210 config: __assign(__assign({}, defaults), flatpickr.defaultConfig), 5211 l10n: l10n_default, 5212 }; 5213 self.parseDate = createDateParser({ config: self.config, l10n: self.l10n }); 5214 self._handlers = []; 5215 self.pluginElements = []; 5216 self.loadedPlugins = []; 5217 self._bind = bind; 5218 self._setHoursFromDate = setHoursFromDate; 5219 self._positionCalendar = positionCalendar; 5220 self.changeMonth = changeMonth; 5221 self.changeYear = changeYear; 5222 self.clear = clear; 5223 self.close = close; 5224 self.onMouseOver = onMouseOver; 5225 self._createElement = createElement; 5226 self.createDay = createDay; 5227 self.destroy = destroy; 5228 self.isEnabled = isEnabled; 5229 self.jumpToDate = jumpToDate; 5230 self.updateValue = updateValue; 5231 self.open = open; 5232 self.redraw = redraw; 5233 self.set = set; 5234 self.setDate = setDate; 5235 self.toggle = toggle; 5236 function setupHelperFunctions() { 5237 self.utils = { 5238 getDaysInMonth: function (month, yr) { 5239 if (month === void 0) { month = self.currentMonth; } 5240 if (yr === void 0) { yr = self.currentYear; } 5241 if (month === 1 && ((yr % 4 === 0 && yr % 100 !== 0) || yr % 400 === 0)) 5242 return 29; 5243 return self.l10n.daysInMonth[month]; 5244 }, 5245 }; 5246 } 5247 function init() { 5248 self.element = self.input = element; 5249 self.isOpen = false; 5250 parseConfig(); 5251 setupLocale(); 5252 setupInputs(); 5253 setupDates(); 5254 setupHelperFunctions(); 5255 if (!self.isMobile) 5256 build(); 5257 bindEvents(); 5258 if (self.selectedDates.length || self.config.noCalendar) { 5259 if (self.config.enableTime) { 5260 setHoursFromDate(self.config.noCalendar ? self.latestSelectedDateObj : undefined); 5261 } 5262 updateValue(false); 5263 } 5264 setCalendarWidth(); 5265 var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); 5266 if (!self.isMobile && isSafari) { 5267 positionCalendar(); 5268 } 5269 triggerEvent("onReady"); 5270 } 5271 function getClosestActiveElement() { 5272 var _a; 5273 return (((_a = self.calendarContainer) === null || _a === void 0 ? void 0 : _a.getRootNode()) 5274 .activeElement || document.activeElement); 5275 } 5276 function bindToInstance(fn) { 5277 return fn.bind(self); 5278 } 5279 function setCalendarWidth() { 5280 var config = self.config; 5281 if (config.weekNumbers === false && config.showMonths === 1) { 5282 return; 5283 } 5284 else if (config.noCalendar !== true) { 5285 window.requestAnimationFrame(function () { 5286 if (self.calendarContainer !== undefined) { 5287 self.calendarContainer.style.visibility = "hidden"; 5288 self.calendarContainer.style.display = "block"; 5289 } 5290 if (self.daysContainer !== undefined) { 5291 var daysWidth = (self.days.offsetWidth + 1) * config.showMonths; 5292 self.daysContainer.style.width = daysWidth + "px"; 5293 self.calendarContainer.style.width = 5294 daysWidth + 5295 (self.weekWrapper !== undefined 5296 ? self.weekWrapper.offsetWidth 5297 : 0) + 5298 "px"; 5299 self.calendarContainer.style.removeProperty("visibility"); 5300 self.calendarContainer.style.removeProperty("display"); 5301 } 5302 }); 5303 } 5304 } 5305 function updateTime(e) { 5306 if (self.selectedDates.length === 0) { 5307 var defaultDate = self.config.minDate === undefined || 5308 compareDates(new Date(), self.config.minDate) >= 0 5309 ? new Date() 5310 : new Date(self.config.minDate.getTime()); 5311 var defaults = getDefaultHours(self.config); 5312 defaultDate.setHours(defaults.hours, defaults.minutes, defaults.seconds, defaultDate.getMilliseconds()); 5313 self.selectedDates = [defaultDate]; 5314 self.latestSelectedDateObj = defaultDate; 5315 } 5316 if (e !== undefined && e.type !== "blur") { 5317 timeWrapper(e); 5318 } 5319 var prevValue = self._input.value; 5320 setHoursFromInputs();
vendor: 84,190 bytes, lines 5321-7161
5321 updateValue(); 5322 if (self._input.value !== prevValue) { 5323 self._debouncedChange(); 5324 } 5325 } 5326 function ampm2military(hour, amPM) { 5327 return (hour % 12) + 12 * utils_int(amPM === self.l10n.amPM[1]); 5328 } 5329 function military2ampm(hour) { 5330 switch (hour % 24) { 5331 case 0: 5332 case 12: 5333 return 12; 5334 default: 5335 return hour % 12; 5336 } 5337 } 5338 function setHoursFromInputs() { 5339 if (self.hourElement === undefined || self.minuteElement === undefined) 5340 return; 5341 var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24, minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60, seconds = self.secondElement !== undefined 5342 ? (parseInt(self.secondElement.value, 10) || 0) % 60 5343 : 0; 5344 if (self.amPM !== undefined) { 5345 hours = ampm2military(hours, self.amPM.textContent); 5346 } 5347 var limitMinHours = self.config.minTime !== undefined || 5348 (self.config.minDate && 5349 self.minDateHasTime && 5350 self.latestSelectedDateObj && 5351 compareDates(self.latestSelectedDateObj, self.config.minDate, true) === 5352 0); 5353 var limitMaxHours = self.config.maxTime !== undefined || 5354 (self.config.maxDate && 5355 self.maxDateHasTime && 5356 self.latestSelectedDateObj && 5357 compareDates(self.latestSelectedDateObj, self.config.maxDate, true) === 5358 0); 5359 if (self.config.maxTime !== undefined && 5360 self.config.minTime !== undefined && 5361 self.config.minTime > self.config.maxTime) { 5362 var minBound = calculateSecondsSinceMidnight(self.config.minTime.getHours(), self.config.minTime.getMinutes(), self.config.minTime.getSeconds()); 5363 var maxBound = calculateSecondsSinceMidnight(self.config.maxTime.getHours(), self.config.maxTime.getMinutes(), self.config.maxTime.getSeconds()); 5364 var currentTime = calculateSecondsSinceMidnight(hours, minutes, seconds); 5365 if (currentTime > maxBound && currentTime < minBound) { 5366 var result = parseSeconds(minBound); 5367 hours = result[0]; 5368 minutes = result[1]; 5369 seconds = result[2]; 5370 } 5371 } 5372 else { 5373 if (limitMaxHours) { 5374 var maxTime = self.config.maxTime !== undefined 5375 ? self.config.maxTime 5376 : self.config.maxDate; 5377 hours = Math.min(hours, maxTime.getHours()); 5378 if (hours === maxTime.getHours()) 5379 minutes = Math.min(minutes, maxTime.getMinutes()); 5380 if (minutes === maxTime.getMinutes()) 5381 seconds = Math.min(seconds, maxTime.getSeconds()); 5382 } 5383 if (limitMinHours) { 5384 var minTime = self.config.minTime !== undefined 5385 ? self.config.minTime 5386 : self.config.minDate; 5387 hours = Math.max(hours, minTime.getHours()); 5388 if (hours === minTime.getHours() && minutes < minTime.getMinutes()) 5389 minutes = minTime.getMinutes(); 5390 if (minutes === minTime.getMinutes()) 5391 seconds = Math.max(seconds, minTime.getSeconds()); 5392 } 5393 } 5394 setHours(hours, minutes, seconds); 5395 } 5396 function setHoursFromDate(dateObj) { 5397 var date = dateObj || self.latestSelectedDateObj; 5398 if (date && date instanceof Date) { 5399 setHours(date.getHours(), date.getMinutes(), date.getSeconds()); 5400 } 5401 } 5402 function setHours(hours, minutes, seconds) { 5403 if (self.latestSelectedDateObj !== undefined) { 5404 self.latestSelectedDateObj.setHours(hours % 24, minutes, seconds || 0, 0); 5405 } 5406 if (!self.hourElement || !self.minuteElement || self.isMobile) 5407 return; 5408 self.hourElement.value = pad(!self.config.time_24hr 5409 ? ((12 + hours) % 12) + 12 * utils_int(hours % 12 === 0) 5410 : hours); 5411 self.minuteElement.value = pad(minutes); 5412 if (self.amPM !== undefined) 5413 self.amPM.textContent = self.l10n.amPM[utils_int(hours >= 12)]; 5414 if (self.secondElement !== undefined) 5415 self.secondElement.value = pad(seconds); 5416 } 5417 function onYearInput(event) { 5418 var eventTarget = getEventTarget(event); 5419 var year = parseInt(eventTarget.value) + (event.delta || 0); 5420 if (year / 1000 > 1 || 5421 (event.key === "Enter" && !/[^\d]/.test(year.toString()))) { 5422 changeYear(year); 5423 } 5424 } 5425 function bind(element, event, handler, options) { 5426 if (event instanceof Array) 5427 return event.forEach(function (ev) { return bind(element, ev, handler, options); }); 5428 if (element instanceof Array) 5429 return element.forEach(function (el) { return bind(el, event, handler, options); }); 5430 element.addEventListener(event, handler, options); 5431 self._handlers.push({ 5432 remove: function () { return element.removeEventListener(event, handler, options); }, 5433 }); 5434 } 5435 function triggerChange() { 5436 triggerEvent("onChange"); 5437 } 5438 function bindEvents() { 5439 if (self.config.wrap) { 5440 ["open", "close", "toggle", "clear"].forEach(function (evt) { 5441 Array.prototype.forEach.call(self.element.querySelectorAll("[data-" + evt + "]"), function (el) { 5442 return bind(el, "click", self[evt]); 5443 }); 5444 }); 5445 } 5446 if (self.isMobile) { 5447 setupMobile(); 5448 return; 5449 } 5450 var debouncedResize = debounce(onResize, 50); 5451 self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS); 5452 if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent)) 5453 bind(self.daysContainer, "mouseover", function (e) { 5454 if (self.config.mode === "range") 5455 onMouseOver(getEventTarget(e)); 5456 }); 5457 bind(self._input, "keydown", onKeyDown); 5458 if (self.calendarContainer !== undefined) { 5459 bind(self.calendarContainer, "keydown", onKeyDown); 5460 } 5461 if (!self.config.inline && !self.config.static) 5462 bind(window, "resize", debouncedResize); 5463 if (window.ontouchstart !== undefined) 5464 bind(window.document, "touchstart", documentClick); 5465 else 5466 bind(window.document, "mousedown", documentClick); 5467 bind(window.document, "focus", documentClick, { capture: true }); 5468 if (self.config.clickOpens === true) { 5469 bind(self._input, "focus", self.open); 5470 bind(self._input, "click", self.open); 5471 } 5472 if (self.daysContainer !== undefined) { 5473 bind(self.monthNav, "click", onMonthNavClick); 5474 bind(self.monthNav, ["keyup", "increment"], onYearInput); 5475 bind(self.daysContainer, "click", selectDate); 5476 } 5477 if (self.timeContainer !== undefined && 5478 self.minuteElement !== undefined && 5479 self.hourElement !== undefined) { 5480 var selText = function (e) { 5481 return getEventTarget(e).select(); 5482 }; 5483 bind(self.timeContainer, ["increment"], updateTime); 5484 bind(self.timeContainer, "blur", updateTime, { capture: true }); 5485 bind(self.timeContainer, "click", timeIncrement); 5486 bind([self.hourElement, self.minuteElement], ["focus", "click"], selText); 5487 if (self.secondElement !== undefined) 5488 bind(self.secondElement, "focus", function () { return self.secondElement && self.secondElement.select(); }); 5489 if (self.amPM !== undefined) { 5490 bind(self.amPM, "click", function (e) { 5491 updateTime(e); 5492 }); 5493 } 5494 } 5495 if (self.config.allowInput) { 5496 bind(self._input, "blur", onBlur); 5497 } 5498 } 5499 function jumpToDate(jumpDate, triggerChange) { 5500 var jumpTo = jumpDate !== undefined 5501 ? self.parseDate(jumpDate) 5502 : self.latestSelectedDateObj || 5503 (self.config.minDate && self.config.minDate > self.now 5504 ? self.config.minDate 5505 : self.config.maxDate && self.config.maxDate < self.now 5506 ? self.config.maxDate 5507 : self.now); 5508 var oldYear = self.currentYear; 5509 var oldMonth = self.currentMonth; 5510 try { 5511 if (jumpTo !== undefined) { 5512 self.currentYear = jumpTo.getFullYear(); 5513 self.currentMonth = jumpTo.getMonth(); 5514 } 5515 } 5516 catch (e) { 5517 e.message = "Invalid date supplied: " + jumpTo; 5518 self.config.errorHandler(e); 5519 } 5520 if (triggerChange && self.currentYear !== oldYear) { 5521 triggerEvent("onYearChange"); 5522 buildMonthSwitch(); 5523 } 5524 if (triggerChange && 5525 (self.currentYear !== oldYear || self.currentMonth !== oldMonth)) { 5526 triggerEvent("onMonthChange"); 5527 } 5528 self.redraw(); 5529 } 5530 function timeIncrement(e) { 5531 var eventTarget = getEventTarget(e); 5532 if (~eventTarget.className.indexOf("arrow")) 5533 incrementNumInput(e, eventTarget.classList.contains("arrowUp") ? 1 : -1); 5534 } 5535 function incrementNumInput(e, delta, inputElem) { 5536 var target = e && getEventTarget(e); 5537 var input = inputElem || 5538 (target && target.parentNode && target.parentNode.firstChild); 5539 var event = createEvent("increment"); 5540 event.delta = delta; 5541 input && input.dispatchEvent(event); 5542 } 5543 function build() { 5544 var fragment = window.document.createDocumentFragment(); 5545 self.calendarContainer = createElement("div", "flatpickr-calendar"); 5546 self.calendarContainer.tabIndex = -1; 5547 if (!self.config.noCalendar) { 5548 fragment.appendChild(buildMonthNav()); 5549 self.innerContainer = createElement("div", "flatpickr-innerContainer"); 5550 if (self.config.weekNumbers) { 5551 var _a = buildWeeks(), weekWrapper = _a.weekWrapper, weekNumbers = _a.weekNumbers; 5552 self.innerContainer.appendChild(weekWrapper); 5553 self.weekNumbers = weekNumbers; 5554 self.weekWrapper = weekWrapper; 5555 } 5556 self.rContainer = createElement("div", "flatpickr-rContainer"); 5557 self.rContainer.appendChild(buildWeekdays()); 5558 if (!self.daysContainer) { 5559 self.daysContainer = createElement("div", "flatpickr-days"); 5560 self.daysContainer.tabIndex = -1; 5561 } 5562 buildDays(); 5563 self.rContainer.appendChild(self.daysContainer); 5564 self.innerContainer.appendChild(self.rContainer); 5565 fragment.appendChild(self.innerContainer); 5566 } 5567 if (self.config.enableTime) { 5568 fragment.appendChild(buildTime()); 5569 } 5570 toggleClass(self.calendarContainer, "rangeMode", self.config.mode === "range"); 5571 toggleClass(self.calendarContainer, "animate", self.config.animate === true); 5572 toggleClass(self.calendarContainer, "multiMonth", self.config.showMonths > 1); 5573 self.calendarContainer.appendChild(fragment); 5574 var customAppend = self.config.appendTo !== undefined && 5575 self.config.appendTo.nodeType !== undefined; 5576 if (self.config.inline || self.config.static) { 5577 self.calendarContainer.classList.add(self.config.inline ? "inline" : "static"); 5578 if (self.config.inline) { 5579 if (!customAppend && self.element.parentNode) 5580 self.element.parentNode.insertBefore(self.calendarContainer, self._input.nextSibling); 5581 else if (self.config.appendTo !== undefined) 5582 self.config.appendTo.appendChild(self.calendarContainer); 5583 } 5584 if (self.config.static) { 5585 var wrapper = createElement("div", "flatpickr-wrapper"); 5586 if (self.element.parentNode) 5587 self.element.parentNode.insertBefore(wrapper, self.element); 5588 wrapper.appendChild(self.element); 5589 if (self.altInput) 5590 wrapper.appendChild(self.altInput); 5591 wrapper.appendChild(self.calendarContainer); 5592 } 5593 } 5594 if (!self.config.static && !self.config.inline) 5595 (self.config.appendTo !== undefined 5596 ? self.config.appendTo 5597 : window.document.body).appendChild(self.calendarContainer); 5598 } 5599 function createDay(className, date, _dayNumber, i) { 5600 var dateIsEnabled = isEnabled(date, true), dayElement = createElement("span", className, date.getDate().toString()); 5601 dayElement.dateObj = date; 5602 dayElement.$i = i; 5603 dayElement.setAttribute("aria-label", self.formatDate(date, self.config.ariaDateFormat)); 5604 if (className.indexOf("hidden") === -1 && 5605 compareDates(date, self.now) === 0) { 5606 self.todayDateElem = dayElement; 5607 dayElement.classList.add("today"); 5608 dayElement.setAttribute("aria-current", "date"); 5609 } 5610 if (dateIsEnabled) { 5611 dayElement.tabIndex = -1; 5612 if (isDateSelected(date)) { 5613 dayElement.classList.add("selected"); 5614 self.selectedDateElem = dayElement; 5615 if (self.config.mode === "range") { 5616 toggleClass(dayElement, "startRange", self.selectedDates[0] && 5617 compareDates(date, self.selectedDates[0], true) === 0); 5618 toggleClass(dayElement, "endRange", self.selectedDates[1] && 5619 compareDates(date, self.selectedDates[1], true) === 0); 5620 if (className === "nextMonthDay") 5621 dayElement.classList.add("inRange"); 5622 } 5623 } 5624 } 5625 else { 5626 dayElement.classList.add("flatpickr-disabled"); 5627 } 5628 if (self.config.mode === "range") { 5629 if (isDateInRange(date) && !isDateSelected(date)) 5630 dayElement.classList.add("inRange"); 5631 } 5632 if (self.weekNumbers && 5633 self.config.showMonths === 1 && 5634 className !== "prevMonthDay" && 5635 i % 7 === 6) { 5636 self.weekNumbers.insertAdjacentHTML("beforeend", "<span class='flatpickr-day'>" + self.config.getWeek(date) + "</span>"); 5637 } 5638 triggerEvent("onDayCreate", dayElement); 5639 return dayElement; 5640 } 5641 function focusOnDayElem(targetNode) { 5642 targetNode.focus(); 5643 if (self.config.mode === "range") 5644 onMouseOver(targetNode); 5645 } 5646 function getFirstAvailableDay(delta) { 5647 var startMonth = delta > 0 ? 0 : self.config.showMonths - 1; 5648 var endMonth = delta > 0 ? self.config.showMonths : -1; 5649 for (var m = startMonth; m != endMonth; m += delta) { 5650 var month = self.daysContainer.children[m]; 5651 var startIndex = delta > 0 ? 0 : month.children.length - 1; 5652 var endIndex = delta > 0 ? month.children.length : -1; 5653 for (var i = startIndex; i != endIndex; i += delta) { 5654 var c = month.children[i]; 5655 if (c.className.indexOf("hidden") === -1 && isEnabled(c.dateObj)) 5656 return c; 5657 } 5658 } 5659 return undefined; 5660 } 5661 function getNextAvailableDay(current, delta) { 5662 var givenMonth = current.className.indexOf("Month") === -1 5663 ? current.dateObj.getMonth() 5664 : self.currentMonth; 5665 var endMonth = delta > 0 ? self.config.showMonths : -1; 5666 var loopDelta = delta > 0 ? 1 : -1; 5667 for (var m = givenMonth - self.currentMonth; m != endMonth; m += loopDelta) { 5668 var month = self.daysContainer.children[m]; 5669 var startIndex = givenMonth - self.currentMonth === m 5670 ? current.$i + delta 5671 : delta < 0 5672 ? month.children.length - 1 5673 : 0; 5674 var numMonthDays = month.children.length; 5675 for (var i = startIndex; i >= 0 && i < numMonthDays && i != (delta > 0 ? numMonthDays : -1); i += loopDelta) { 5676 var c = month.children[i]; 5677 if (c.className.indexOf("hidden") === -1 && 5678 isEnabled(c.dateObj) && 5679 Math.abs(current.$i - i) >= Math.abs(delta)) 5680 return focusOnDayElem(c); 5681 } 5682 } 5683 self.changeMonth(loopDelta); 5684 focusOnDay(getFirstAvailableDay(loopDelta), 0); 5685 return undefined; 5686 } 5687 function focusOnDay(current, offset) { 5688 var activeElement = getClosestActiveElement(); 5689 var dayFocused = isInView(activeElement || document.body); 5690 var startElem = current !== undefined 5691 ? current 5692 : dayFocused 5693 ? activeElement 5694 : self.selectedDateElem !== undefined && isInView(self.selectedDateElem) 5695 ? self.selectedDateElem 5696 : self.todayDateElem !== undefined && isInView(self.todayDateElem) 5697 ? self.todayDateElem 5698 : getFirstAvailableDay(offset > 0 ? 1 : -1); 5699 if (startElem === undefined) { 5700 self._input.focus(); 5701 } 5702 else if (!dayFocused) { 5703 focusOnDayElem(startElem); 5704 } 5705 else { 5706 getNextAvailableDay(startElem, offset); 5707 } 5708 } 5709 function buildMonthDays(year, month) { 5710 var firstOfMonth = (new Date(year, month, 1).getDay() - self.l10n.firstDayOfWeek + 7) % 7; 5711 var prevMonthDays = self.utils.getDaysInMonth((month - 1 + 12) % 12, year); 5712 var daysInMonth = self.utils.getDaysInMonth(month, year), days = window.document.createDocumentFragment(), isMultiMonth = self.config.showMonths > 1, prevMonthDayClass = isMultiMonth ? "prevMonthDay hidden" : "prevMonthDay", nextMonthDayClass = isMultiMonth ? "nextMonthDay hidden" : "nextMonthDay"; 5713 var dayNumber = prevMonthDays + 1 - firstOfMonth, dayIndex = 0; 5714 for (; dayNumber <= prevMonthDays; dayNumber++, dayIndex++) { 5715 days.appendChild(createDay("flatpickr-day " + prevMonthDayClass, new Date(year, month - 1, dayNumber), dayNumber, dayIndex)); 5716 } 5717 for (dayNumber = 1; dayNumber <= daysInMonth; dayNumber++, dayIndex++) { 5718 days.appendChild(createDay("flatpickr-day", new Date(year, month, dayNumber), dayNumber, dayIndex)); 5719 } 5720 for (var dayNum = daysInMonth + 1; dayNum <= 42 - firstOfMonth && 5721 (self.config.showMonths === 1 || dayIndex % 7 !== 0); dayNum++, dayIndex++) { 5722 days.appendChild(createDay("flatpickr-day " + nextMonthDayClass, new Date(year, month + 1, dayNum % daysInMonth), dayNum, dayIndex)); 5723 } 5724 var dayContainer = createElement("div", "dayContainer"); 5725 dayContainer.appendChild(days); 5726 return dayContainer; 5727 } 5728 function buildDays() { 5729 if (self.daysContainer === undefined) { 5730 return; 5731 } 5732 clearNode(self.daysContainer); 5733 if (self.weekNumbers) 5734 clearNode(self.weekNumbers); 5735 var frag = document.createDocumentFragment(); 5736 for (var i = 0; i < self.config.showMonths; i++) { 5737 var d = new Date(self.currentYear, self.currentMonth, 1); 5738 d.setMonth(self.currentMonth + i); 5739 frag.appendChild(buildMonthDays(d.getFullYear(), d.getMonth())); 5740 } 5741 self.daysContainer.appendChild(frag); 5742 self.days = self.daysContainer.firstChild; 5743 if (self.config.mode === "range" && self.selectedDates.length === 1) { 5744 onMouseOver(); 5745 } 5746 } 5747 function buildMonthSwitch() { 5748 if (self.config.showMonths > 1 || 5749 self.config.monthSelectorType !== "dropdown") 5750 return; 5751 var shouldBuildMonth = function (month) { 5752 if (self.config.minDate !== undefined && 5753 self.currentYear === self.config.minDate.getFullYear() && 5754 month < self.config.minDate.getMonth()) { 5755 return false; 5756 } 5757 return !(self.config.maxDate !== undefined && 5758 self.currentYear === self.config.maxDate.getFullYear() && 5759 month > self.config.maxDate.getMonth()); 5760 }; 5761 self.monthsDropdownContainer.tabIndex = -1; 5762 self.monthsDropdownContainer.innerHTML = ""; 5763 for (var i = 0; i < 12; i++) { 5764 if (!shouldBuildMonth(i)) 5765 continue; 5766 var month = createElement("option", "flatpickr-monthDropdown-month"); 5767 month.value = new Date(self.currentYear, i).getMonth().toString(); 5768 month.textContent = monthToStr(i, self.config.shorthandCurrentMonth, self.l10n); 5769 month.tabIndex = -1; 5770 if (self.currentMonth === i) { 5771 month.selected = true; 5772 } 5773 self.monthsDropdownContainer.appendChild(month); 5774 } 5775 } 5776 function buildMonth() { 5777 var container = createElement("div", "flatpickr-month"); 5778 var monthNavFragment = window.document.createDocumentFragment(); 5779 var monthElement; 5780 if (self.config.showMonths > 1 || 5781 self.config.monthSelectorType === "static") { 5782 monthElement = createElement("span", "cur-month"); 5783 } 5784 else { 5785 self.monthsDropdownContainer = createElement("select", "flatpickr-monthDropdown-months"); 5786 self.monthsDropdownContainer.setAttribute("aria-label", self.l10n.monthAriaLabel); 5787 bind(self.monthsDropdownContainer, "change", function (e) { 5788 var target = getEventTarget(e); 5789 var selectedMonth = parseInt(target.value, 10); 5790 self.changeMonth(selectedMonth - self.currentMonth); 5791 triggerEvent("onMonthChange"); 5792 }); 5793 buildMonthSwitch(); 5794 monthElement = self.monthsDropdownContainer; 5795 } 5796 var yearInput = createNumberInput("cur-year", { tabindex: "-1" }); 5797 var yearElement = yearInput.getElementsByTagName("input")[0]; 5798 yearElement.setAttribute("aria-label", self.l10n.yearAriaLabel); 5799 if (self.config.minDate) { 5800 yearElement.setAttribute("min", self.config.minDate.getFullYear().toString()); 5801 } 5802 if (self.config.maxDate) { 5803 yearElement.setAttribute("max", self.config.maxDate.getFullYear().toString()); 5804 yearElement.disabled = 5805 !!self.config.minDate && 5806 self.config.minDate.getFullYear() === self.config.maxDate.getFullYear(); 5807 } 5808 var currentMonth = createElement("div", "flatpickr-current-month"); 5809 currentMonth.appendChild(monthElement); 5810 currentMonth.appendChild(yearInput); 5811 monthNavFragment.appendChild(currentMonth); 5812 container.appendChild(monthNavFragment); 5813 return { 5814 container: container, 5815 yearElement: yearElement, 5816 monthElement: monthElement, 5817 }; 5818 } 5819 function buildMonths() { 5820 clearNode(self.monthNav); 5821 self.monthNav.appendChild(self.prevMonthNav); 5822 if (self.config.showMonths) { 5823 self.yearElements = []; 5824 self.monthElements = []; 5825 } 5826 for (var m = self.config.showMonths; m--;) { 5827 var month = buildMonth(); 5828 self.yearElements.push(month.yearElement); 5829 self.monthElements.push(month.monthElement); 5830 self.monthNav.appendChild(month.container); 5831 } 5832 self.monthNav.appendChild(self.nextMonthNav); 5833 } 5834 function buildMonthNav() { 5835 self.monthNav = createElement("div", "flatpickr-months"); 5836 self.yearElements = []; 5837 self.monthElements = []; 5838 self.prevMonthNav = createElement("span", "flatpickr-prev-month"); 5839 self.prevMonthNav.innerHTML = self.config.prevArrow; 5840 self.nextMonthNav = createElement("span", "flatpickr-next-month"); 5841 self.nextMonthNav.innerHTML = self.config.nextArrow; 5842 buildMonths(); 5843 Object.defineProperty(self, "_hidePrevMonthArrow", { 5844 get: function () { return self.__hidePrevMonthArrow; }, 5845 set: function (bool) { 5846 if (self.__hidePrevMonthArrow !== bool) { 5847 toggleClass(self.prevMonthNav, "flatpickr-disabled", bool); 5848 self.__hidePrevMonthArrow = bool; 5849 } 5850 }, 5851 }); 5852 Object.defineProperty(self, "_hideNextMonthArrow", { 5853 get: function () { return self.__hideNextMonthArrow; }, 5854 set: function (bool) { 5855 if (self.__hideNextMonthArrow !== bool) { 5856 toggleClass(self.nextMonthNav, "flatpickr-disabled", bool); 5857 self.__hideNextMonthArrow = bool; 5858 } 5859 }, 5860 }); 5861 self.currentYearElement = self.yearElements[0]; 5862 updateNavigationCurrentMonth(); 5863 return self.monthNav; 5864 } 5865 function buildTime() { 5866 self.calendarContainer.classList.add("hasTime"); 5867 if (self.config.noCalendar) 5868 self.calendarContainer.classList.add("noCalendar"); 5869 var defaults = getDefaultHours(self.config); 5870 self.timeContainer = createElement("div", "flatpickr-time"); 5871 self.timeContainer.tabIndex = -1; 5872 var separator = createElement("span", "flatpickr-time-separator", ":"); 5873 var hourInput = createNumberInput("flatpickr-hour", { 5874 "aria-label": self.l10n.hourAriaLabel, 5875 }); 5876 self.hourElement = hourInput.getElementsByTagName("input")[0]; 5877 var minuteInput = createNumberInput("flatpickr-minute", { 5878 "aria-label": self.l10n.minuteAriaLabel, 5879 }); 5880 self.minuteElement = minuteInput.getElementsByTagName("input")[0]; 5881 self.hourElement.tabIndex = self.minuteElement.tabIndex = -1; 5882 self.hourElement.value = pad(self.latestSelectedDateObj 5883 ? self.latestSelectedDateObj.getHours() 5884 : self.config.time_24hr 5885 ? defaults.hours 5886 : military2ampm(defaults.hours)); 5887 self.minuteElement.value = pad(self.latestSelectedDateObj 5888 ? self.latestSelectedDateObj.getMinutes() 5889 : defaults.minutes); 5890 self.hourElement.setAttribute("step", self.config.hourIncrement.toString()); 5891 self.minuteElement.setAttribute("step", self.config.minuteIncrement.toString()); 5892 self.hourElement.setAttribute("min", self.config.time_24hr ? "0" : "1"); 5893 self.hourElement.setAttribute("max", self.config.time_24hr ? "23" : "12"); 5894 self.hourElement.setAttribute("maxlength", "2"); 5895 self.minuteElement.setAttribute("min", "0"); 5896 self.minuteElement.setAttribute("max", "59"); 5897 self.minuteElement.setAttribute("maxlength", "2"); 5898 self.timeContainer.appendChild(hourInput); 5899 self.timeContainer.appendChild(separator); 5900 self.timeContainer.appendChild(minuteInput); 5901 if (self.config.time_24hr) 5902 self.timeContainer.classList.add("time24hr"); 5903 if (self.config.enableSeconds) { 5904 self.timeContainer.classList.add("hasSeconds"); 5905 var secondInput = createNumberInput("flatpickr-second"); 5906 self.secondElement = secondInput.getElementsByTagName("input")[0]; 5907 self.secondElement.value = pad(self.latestSelectedDateObj 5908 ? self.latestSelectedDateObj.getSeconds() 5909 : defaults.seconds); 5910 self.secondElement.setAttribute("step", self.minuteElement.getAttribute("step")); 5911 self.secondElement.setAttribute("min", "0"); 5912 self.secondElement.setAttribute("max", "59"); 5913 self.secondElement.setAttribute("maxlength", "2"); 5914 self.timeContainer.appendChild(createElement("span", "flatpickr-time-separator", ":")); 5915 self.timeContainer.appendChild(secondInput); 5916 } 5917 if (!self.config.time_24hr) { 5918 self.amPM = createElement("span", "flatpickr-am-pm", self.l10n.amPM[utils_int((self.latestSelectedDateObj 5919 ? self.hourElement.value 5920 : self.config.defaultHour) > 11)]); 5921 self.amPM.title = self.l10n.toggleTitle; 5922 self.amPM.tabIndex = -1; 5923 self.timeContainer.appendChild(self.amPM); 5924 } 5925 return self.timeContainer; 5926 } 5927 function buildWeekdays() { 5928 if (!self.weekdayContainer) 5929 self.weekdayContainer = createElement("div", "flatpickr-weekdays"); 5930 else 5931 clearNode(self.weekdayContainer); 5932 for (var i = self.config.showMonths; i--;) { 5933 var container = createElement("div", "flatpickr-weekdaycontainer"); 5934 self.weekdayContainer.appendChild(container); 5935 } 5936 updateWeekdays(); 5937 return self.weekdayContainer; 5938 } 5939 function updateWeekdays() { 5940 if (!self.weekdayContainer) { 5941 return; 5942 } 5943 var firstDayOfWeek = self.l10n.firstDayOfWeek; 5944 var weekdays = __spreadArrays(self.l10n.weekdays.shorthand); 5945 if (firstDayOfWeek > 0 && firstDayOfWeek < weekdays.length) { 5946 weekdays = __spreadArrays(weekdays.splice(firstDayOfWeek, weekdays.length), weekdays.splice(0, firstDayOfWeek)); 5947 } 5948 for (var i = self.config.showMonths; i--;) { 5949 self.weekdayContainer.children[i].innerHTML = "\n <span class='flatpickr-weekday'>\n " + weekdays.join("</span><span class='flatpickr-weekday'>") + "\n </span>\n "; 5950 } 5951 } 5952 function buildWeeks() { 5953 self.calendarContainer.classList.add("hasWeeks"); 5954 var weekWrapper = createElement("div", "flatpickr-weekwrapper"); 5955 weekWrapper.appendChild(createElement("span", "flatpickr-weekday", self.l10n.weekAbbreviation)); 5956 var weekNumbers = createElement("div", "flatpickr-weeks"); 5957 weekWrapper.appendChild(weekNumbers); 5958 return { 5959 weekWrapper: weekWrapper, 5960 weekNumbers: weekNumbers, 5961 }; 5962 } 5963 function changeMonth(value, isOffset) { 5964 if (isOffset === void 0) { isOffset = true; } 5965 var delta = isOffset ? value : value - self.currentMonth; 5966 if ((delta < 0 && self._hidePrevMonthArrow === true) || 5967 (delta > 0 && self._hideNextMonthArrow === true)) 5968 return; 5969 self.currentMonth += delta; 5970 if (self.currentMonth < 0 || self.currentMonth > 11) { 5971 self.currentYear += self.currentMonth > 11 ? 1 : -1; 5972 self.currentMonth = (self.currentMonth + 12) % 12; 5973 triggerEvent("onYearChange"); 5974 buildMonthSwitch(); 5975 } 5976 buildDays(); 5977 triggerEvent("onMonthChange"); 5978 updateNavigationCurrentMonth(); 5979 } 5980 function clear(triggerChangeEvent, toInitial) { 5981 if (triggerChangeEvent === void 0) { triggerChangeEvent = true; } 5982 if (toInitial === void 0) { toInitial = true; } 5983 self.input.value = ""; 5984 if (self.altInput !== undefined) 5985 self.altInput.value = ""; 5986 if (self.mobileInput !== undefined) 5987 self.mobileInput.value = ""; 5988 self.selectedDates = []; 5989 self.latestSelectedDateObj = undefined; 5990 if (toInitial === true) { 5991 self.currentYear = self._initialDate.getFullYear(); 5992 self.currentMonth = self._initialDate.getMonth(); 5993 } 5994 if (self.config.enableTime === true) { 5995 var _a = getDefaultHours(self.config), hours = _a.hours, minutes = _a.minutes, seconds = _a.seconds; 5996 setHours(hours, minutes, seconds); 5997 } 5998 self.redraw(); 5999 if (triggerChangeEvent) 6000 triggerEvent("onChange"); 6001 } 6002 function close() { 6003 self.isOpen = false; 6004 if (!self.isMobile) { 6005 if (self.calendarContainer !== undefined) { 6006 self.calendarContainer.classList.remove("open"); 6007 } 6008 if (self._input !== undefined) { 6009 self._input.classList.remove("active"); 6010 } 6011 } 6012 triggerEvent("onClose"); 6013 } 6014 function destroy() { 6015 if (self.config !== undefined) 6016 triggerEvent("onDestroy"); 6017 for (var i = self._handlers.length; i--;) { 6018 self._handlers[i].remove(); 6019 } 6020 self._handlers = []; 6021 if (self.mobileInput) { 6022 if (self.mobileInput.parentNode) 6023 self.mobileInput.parentNode.removeChild(self.mobileInput); 6024 self.mobileInput = undefined; 6025 } 6026 else if (self.calendarContainer && self.calendarContainer.parentNode) { 6027 if (self.config.static && self.calendarContainer.parentNode) { 6028 var wrapper = self.calendarContainer.parentNode; 6029 wrapper.lastChild && wrapper.removeChild(wrapper.lastChild); 6030 if (wrapper.parentNode) { 6031 while (wrapper.firstChild) 6032 wrapper.parentNode.insertBefore(wrapper.firstChild, wrapper); 6033 wrapper.parentNode.removeChild(wrapper); 6034 } 6035 } 6036 else 6037 self.calendarContainer.parentNode.removeChild(self.calendarContainer); 6038 } 6039 if (self.altInput) { 6040 self.input.type = "text"; 6041 if (self.altInput.parentNode) 6042 self.altInput.parentNode.removeChild(self.altInput); 6043 delete self.altInput; 6044 } 6045 if (self.input) { 6046 self.input.type = self.input._type; 6047 self.input.classList.remove("flatpickr-input"); 6048 self.input.removeAttribute("readonly"); 6049 } 6050 [ 6051 "_showTimeInput", 6052 "latestSelectedDateObj", 6053 "_hideNextMonthArrow", 6054 "_hidePrevMonthArrow", 6055 "__hideNextMonthArrow", 6056 "__hidePrevMonthArrow", 6057 "isMobile", 6058 "isOpen", 6059 "selectedDateElem", 6060 "minDateHasTime", 6061 "maxDateHasTime", 6062 "days", 6063 "daysContainer", 6064 "_input", 6065 "_positionElement", 6066 "innerContainer", 6067 "rContainer", 6068 "monthNav", 6069 "todayDateElem", 6070 "calendarContainer", 6071 "weekdayContainer", 6072 "prevMonthNav", 6073 "nextMonthNav", 6074 "monthsDropdownContainer", 6075 "currentMonthElement", 6076 "currentYearElement", 6077 "navigationCurrentMonth", 6078 "selectedDateElem", 6079 "config", 6080 ].forEach(function (k) { 6081 try { 6082 delete self[k]; 6083 } 6084 catch (_) { } 6085 }); 6086 } 6087 function isCalendarElem(elem) { 6088 return self.calendarContainer.contains(elem); 6089 } 6090 function documentClick(e) { 6091 if (self.isOpen && !self.config.inline) { 6092 var eventTarget_1 = getEventTarget(e); 6093 var isCalendarElement = isCalendarElem(eventTarget_1); 6094 var isInput = eventTarget_1 === self.input || 6095 eventTarget_1 === self.altInput || 6096 self.element.contains(eventTarget_1) || 6097 (e.path && 6098 e.path.indexOf && 6099 (~e.path.indexOf(self.input) || 6100 ~e.path.indexOf(self.altInput))); 6101 var lostFocus = !isInput && 6102 !isCalendarElement && 6103 !isCalendarElem(e.relatedTarget); 6104 var isIgnored = !self.config.ignoredFocusElements.some(function (elem) { 6105 return elem.contains(eventTarget_1); 6106 }); 6107 if (lostFocus && isIgnored) { 6108 if (self.config.allowInput) { 6109 self.setDate(self._input.value, false, self.config.altInput 6110 ? self.config.altFormat 6111 : self.config.dateFormat); 6112 } 6113 if (self.timeContainer !== undefined && 6114 self.minuteElement !== undefined && 6115 self.hourElement !== undefined && 6116 self.input.value !== "" && 6117 self.input.value !== undefined) { 6118 updateTime(); 6119 } 6120 self.close(); 6121 if (self.config && 6122 self.config.mode === "range" && 6123 self.selectedDates.length === 1) 6124 self.clear(false); 6125 } 6126 } 6127 } 6128 function changeYear(newYear) { 6129 if (!newYear || 6130 (self.config.minDate && newYear < self.config.minDate.getFullYear()) || 6131 (self.config.maxDate && newYear > self.config.maxDate.getFullYear())) 6132 return; 6133 var newYearNum = newYear, isNewYear = self.currentYear !== newYearNum; 6134 self.currentYear = newYearNum || self.currentYear; 6135 if (self.config.maxDate && 6136 self.currentYear === self.config.maxDate.getFullYear()) { 6137 self.currentMonth = Math.min(self.config.maxDate.getMonth(), self.currentMonth); 6138 } 6139 else if (self.config.minDate && 6140 self.currentYear === self.config.minDate.getFullYear()) { 6141 self.currentMonth = Math.max(self.config.minDate.getMonth(), self.currentMonth); 6142 } 6143 if (isNewYear) { 6144 self.redraw(); 6145 triggerEvent("onYearChange"); 6146 buildMonthSwitch(); 6147 } 6148 } 6149 function isEnabled(date, timeless) { 6150 var _a; 6151 if (timeless === void 0) { timeless = true; } 6152 var dateToCheck = self.parseDate(date, undefined, timeless); 6153 if ((self.config.minDate && 6154 dateToCheck && 6155 compareDates(dateToCheck, self.config.minDate, timeless !== undefined ? timeless : !self.minDateHasTime) < 0) || 6156 (self.config.maxDate && 6157 dateToCheck && 6158 compareDates(dateToCheck, self.config.maxDate, timeless !== undefined ? timeless : !self.maxDateHasTime) > 0)) 6159 return false; 6160 if (!self.config.enable && self.config.disable.length === 0) 6161 return true; 6162 if (dateToCheck === undefined) 6163 return false; 6164 var bool = !!self.config.enable, array = (_a = self.config.enable) !== null && _a !== void 0 ? _a : self.config.disable; 6165 for (var i = 0, d = void 0; i < array.length; i++) { 6166 d = array[i]; 6167 if (typeof d === "function" && 6168 d(dateToCheck)) 6169 return bool; 6170 else if (d instanceof Date && 6171 dateToCheck !== undefined && 6172 d.getTime() === dateToCheck.getTime()) 6173 return bool; 6174 else if (typeof d === "string") { 6175 var parsed = self.parseDate(d, undefined, true); 6176 return parsed && parsed.getTime() === dateToCheck.getTime() 6177 ? bool 6178 : !bool; 6179 } 6180 else if (typeof d === "object" && 6181 dateToCheck !== undefined && 6182 d.from && 6183 d.to && 6184 dateToCheck.getTime() >= d.from.getTime() && 6185 dateToCheck.getTime() <= d.to.getTime()) 6186 return bool; 6187 } 6188 return !bool; 6189 } 6190 function isInView(elem) { 6191 if (self.daysContainer !== undefined) 6192 return (elem.className.indexOf("hidden") === -1 && 6193 elem.className.indexOf("flatpickr-disabled") === -1 && 6194 self.daysContainer.contains(elem)); 6195 return false; 6196 } 6197 function onBlur(e) { 6198 var isInput = e.target === self._input; 6199 var valueChanged = self._input.value.trimEnd() !== getDateStr(); 6200 if (isInput && 6201 valueChanged && 6202 !(e.relatedTarget && isCalendarElem(e.relatedTarget))) { 6203 self.setDate(self._input.value, true, e.target === self.altInput 6204 ? self.config.altFormat 6205 : self.config.dateFormat); 6206 } 6207 } 6208 function onKeyDown(e) { 6209 var eventTarget = getEventTarget(e); 6210 var isInput = self.config.wrap 6211 ? element.contains(eventTarget) 6212 : eventTarget === self._input; 6213 var allowInput = self.config.allowInput; 6214 var allowKeydown = self.isOpen && (!allowInput || !isInput); 6215 var allowInlineKeydown = self.config.inline && isInput && !allowInput; 6216 if (e.keyCode === 13 && isInput) { 6217 if (allowInput) { 6218 self.setDate(self._input.value, true, eventTarget === self.altInput 6219 ? self.config.altFormat 6220 : self.config.dateFormat); 6221 self.close(); 6222 return eventTarget.blur(); 6223 } 6224 else { 6225 self.open(); 6226 } 6227 } 6228 else if (isCalendarElem(eventTarget) || 6229 allowKeydown || 6230 allowInlineKeydown) { 6231 var isTimeObj = !!self.timeContainer && 6232 self.timeContainer.contains(eventTarget); 6233 switch (e.keyCode) { 6234 case 13: 6235 if (isTimeObj) { 6236 e.preventDefault(); 6237 updateTime(); 6238 focusAndClose(); 6239 } 6240 else 6241 selectDate(e); 6242 break; 6243 case 27: 6244 e.preventDefault(); 6245 focusAndClose(); 6246 break; 6247 case 8: 6248 case 46: 6249 if (isInput && !self.config.allowInput) { 6250 e.preventDefault(); 6251 self.clear(); 6252 } 6253 break; 6254 case 37: 6255 case 39: 6256 if (!isTimeObj && !isInput) { 6257 e.preventDefault(); 6258 var activeElement = getClosestActiveElement(); 6259 if (self.daysContainer !== undefined && 6260 (allowInput === false || 6261 (activeElement && isInView(activeElement)))) { 6262 var delta_1 = e.keyCode === 39 ? 1 : -1; 6263 if (!e.ctrlKey) 6264 focusOnDay(undefined, delta_1); 6265 else { 6266 e.stopPropagation(); 6267 changeMonth(delta_1); 6268 focusOnDay(getFirstAvailableDay(1), 0); 6269 } 6270 } 6271 } 6272 else if (self.hourElement) 6273 self.hourElement.focus(); 6274 break; 6275 case 38: 6276 case 40: 6277 e.preventDefault(); 6278 var delta = e.keyCode === 40 ? 1 : -1; 6279 if ((self.daysContainer && 6280 eventTarget.$i !== undefined) || 6281 eventTarget === self.input || 6282 eventTarget === self.altInput) { 6283 if (e.ctrlKey) { 6284 e.stopPropagation(); 6285 changeYear(self.currentYear - delta); 6286 focusOnDay(getFirstAvailableDay(1), 0); 6287 } 6288 else if (!isTimeObj) 6289 focusOnDay(undefined, delta * 7); 6290 } 6291 else if (eventTarget === self.currentYearElement) { 6292 changeYear(self.currentYear - delta); 6293 } 6294 else if (self.config.enableTime) { 6295 if (!isTimeObj && self.hourElement) 6296 self.hourElement.focus(); 6297 updateTime(e); 6298 self._debouncedChange(); 6299 } 6300 break; 6301 case 9: 6302 if (isTimeObj) { 6303 var elems = [ 6304 self.hourElement, 6305 self.minuteElement, 6306 self.secondElement, 6307 self.amPM, 6308 ] 6309 .concat(self.pluginElements) 6310 .filter(function (x) { return x; }); 6311 var i = elems.indexOf(eventTarget); 6312 if (i !== -1) { 6313 var target = elems[i + (e.shiftKey ? -1 : 1)]; 6314 e.preventDefault(); 6315 (target || self._input).focus(); 6316 } 6317 } 6318 else if (!self.config.noCalendar && 6319 self.daysContainer && 6320 self.daysContainer.contains(eventTarget) && 6321 e.shiftKey) { 6322 e.preventDefault(); 6323 self._input.focus(); 6324 } 6325 break; 6326 default: 6327 break; 6328 } 6329 } 6330 if (self.amPM !== undefined && eventTarget === self.amPM) { 6331 switch (e.key) { 6332 case self.l10n.amPM[0].charAt(0): 6333 case self.l10n.amPM[0].charAt(0).toLowerCase(): 6334 self.amPM.textContent = self.l10n.amPM[0]; 6335 setHoursFromInputs(); 6336 updateValue(); 6337 break; 6338 case self.l10n.amPM[1].charAt(0): 6339 case self.l10n.amPM[1].charAt(0).toLowerCase(): 6340 self.amPM.textContent = self.l10n.amPM[1]; 6341 setHoursFromInputs(); 6342 updateValue(); 6343 break; 6344 } 6345 } 6346 if (isInput || isCalendarElem(eventTarget)) { 6347 triggerEvent("onKeyDown", e); 6348 } 6349 } 6350 function onMouseOver(elem, cellClass) { 6351 if (cellClass === void 0) { cellClass = "flatpickr-day"; } 6352 if (self.selectedDates.length !== 1 || 6353 (elem && 6354 (!elem.classList.contains(cellClass) || 6355 elem.classList.contains("flatpickr-disabled")))) 6356 return; 6357 var hoverDate = elem 6358 ? elem.dateObj.getTime() 6359 : self.days.firstElementChild.dateObj.getTime(), initialDate = self.parseDate(self.selectedDates[0], undefined, true).getTime(), rangeStartDate = Math.min(hoverDate, self.selectedDates[0].getTime()), rangeEndDate = Math.max(hoverDate, self.selectedDates[0].getTime()); 6360 var containsDisabled = false; 6361 var minRange = 0, maxRange = 0; 6362 for (var t = rangeStartDate; t < rangeEndDate; t += duration.DAY) { 6363 if (!isEnabled(new Date(t), true)) { 6364 containsDisabled = 6365 containsDisabled || (t > rangeStartDate && t < rangeEndDate); 6366 if (t < initialDate && (!minRange || t > minRange)) 6367 minRange = t; 6368 else if (t > initialDate && (!maxRange || t < maxRange)) 6369 maxRange = t; 6370 } 6371 } 6372 var hoverableCells = Array.from(self.rContainer.querySelectorAll("*:nth-child(-n+" + self.config.showMonths + ") > ." + cellClass)); 6373 hoverableCells.forEach(function (dayElem) { 6374 var date = dayElem.dateObj; 6375 var timestamp = date.getTime(); 6376 var outOfRange = (minRange > 0 && timestamp < minRange) || 6377 (maxRange > 0 && timestamp > maxRange); 6378 if (outOfRange) { 6379 dayElem.classList.add("notAllowed"); 6380 ["inRange", "startRange", "endRange"].forEach(function (c) { 6381 dayElem.classList.remove(c); 6382 }); 6383 return; 6384 } 6385 else if (containsDisabled && !outOfRange) 6386 return; 6387 ["startRange", "inRange", "endRange", "notAllowed"].forEach(function (c) { 6388 dayElem.classList.remove(c); 6389 }); 6390 if (elem !== undefined) { 6391 elem.classList.add(hoverDate <= self.selectedDates[0].getTime() 6392 ? "startRange" 6393 : "endRange"); 6394 if (initialDate < hoverDate && timestamp === initialDate) 6395 dayElem.classList.add("startRange"); 6396 else if (initialDate > hoverDate && timestamp === initialDate) 6397 dayElem.classList.add("endRange"); 6398 if (timestamp >= minRange && 6399 (maxRange === 0 || timestamp <= maxRange) && 6400 isBetween(timestamp, initialDate, hoverDate)) 6401 dayElem.classList.add("inRange"); 6402 } 6403 }); 6404 } 6405 function onResize() { 6406 if (self.isOpen && !self.config.static && !self.config.inline) 6407 positionCalendar(); 6408 } 6409 function open(e, positionElement) { 6410 if (positionElement === void 0) { positionElement = self._positionElement; } 6411 if (self.isMobile === true) { 6412 if (e) { 6413 e.preventDefault(); 6414 var eventTarget = getEventTarget(e); 6415 if (eventTarget) { 6416 eventTarget.blur(); 6417 } 6418 } 6419 if (self.mobileInput !== undefined) { 6420 self.mobileInput.focus(); 6421 self.mobileInput.click(); 6422 } 6423 triggerEvent("onOpen"); 6424 return; 6425 } 6426 else if (self._input.disabled || self.config.inline) { 6427 return; 6428 } 6429 var wasOpen = self.isOpen; 6430 self.isOpen = true; 6431 if (!wasOpen) { 6432 self.calendarContainer.classList.add("open"); 6433 self._input.classList.add("active"); 6434 triggerEvent("onOpen"); 6435 positionCalendar(positionElement); 6436 } 6437 if (self.config.enableTime === true && self.config.noCalendar === true) { 6438 if (self.config.allowInput === false && 6439 (e === undefined || 6440 !self.timeContainer.contains(e.relatedTarget))) { 6441 setTimeout(function () { return self.hourElement.select(); }, 50); 6442 } 6443 } 6444 } 6445 function minMaxDateSetter(type) { 6446 return function (date) { 6447 var dateObj = (self.config["_" + type + "Date"] = self.parseDate(date, self.config.dateFormat)); 6448 var inverseDateObj = self.config["_" + (type === "min" ? "max" : "min") + "Date"]; 6449 if (dateObj !== undefined) { 6450 self[type === "min" ? "minDateHasTime" : "maxDateHasTime"] = 6451 dateObj.getHours() > 0 || 6452 dateObj.getMinutes() > 0 || 6453 dateObj.getSeconds() > 0; 6454 } 6455 if (self.selectedDates) { 6456 self.selectedDates = self.selectedDates.filter(function (d) { return isEnabled(d); }); 6457 if (!self.selectedDates.length && type === "min") 6458 setHoursFromDate(dateObj); 6459 updateValue(); 6460 } 6461 if (self.daysContainer) { 6462 redraw(); 6463 if (dateObj !== undefined) 6464 self.currentYearElement[type] = dateObj.getFullYear().toString(); 6465 else 6466 self.currentYearElement.removeAttribute(type); 6467 self.currentYearElement.disabled = 6468 !!inverseDateObj && 6469 dateObj !== undefined && 6470 inverseDateObj.getFullYear() === dateObj.getFullYear(); 6471 } 6472 }; 6473 } 6474 function parseConfig() { 6475 var boolOpts = [ 6476 "wrap", 6477 "weekNumbers", 6478 "allowInput", 6479 "allowInvalidPreload", 6480 "clickOpens", 6481 "time_24hr", 6482 "enableTime", 6483 "noCalendar", 6484 "altInput", 6485 "shorthandCurrentMonth", 6486 "inline", 6487 "static", 6488 "enableSeconds", 6489 "disableMobile", 6490 ]; 6491 var userConfig = __assign(__assign({}, JSON.parse(JSON.stringify(element.dataset || {}))), instanceConfig); 6492 var formats = {}; 6493 self.config.parseDate = userConfig.parseDate; 6494 self.config.formatDate = userConfig.formatDate; 6495 Object.defineProperty(self.config, "enable", { 6496 get: function () { return self.config._enable; }, 6497 set: function (dates) { 6498 self.config._enable = parseDateRules(dates); 6499 }, 6500 }); 6501 Object.defineProperty(self.config, "disable", { 6502 get: function () { return self.config._disable; }, 6503 set: function (dates) { 6504 self.config._disable = parseDateRules(dates); 6505 }, 6506 }); 6507 var timeMode = userConfig.mode === "time"; 6508 if (!userConfig.dateFormat && (userConfig.enableTime || timeMode)) { 6509 var defaultDateFormat = flatpickr.defaultConfig.dateFormat || defaults.dateFormat; 6510 formats.dateFormat = 6511 userConfig.noCalendar || timeMode 6512 ? "H:i" + (userConfig.enableSeconds ? ":S" : "") 6513 : defaultDateFormat + " H:i" + (userConfig.enableSeconds ? ":S" : ""); 6514 } 6515 if (userConfig.altInput && 6516 (userConfig.enableTime || timeMode) && 6517 !userConfig.altFormat) { 6518 var defaultAltFormat = flatpickr.defaultConfig.altFormat || defaults.altFormat; 6519 formats.altFormat = 6520 userConfig.noCalendar || timeMode 6521 ? "h:i" + (userConfig.enableSeconds ? ":S K" : " K") 6522 : defaultAltFormat + (" h:i" + (userConfig.enableSeconds ? ":S" : "") + " K"); 6523 } 6524 Object.defineProperty(self.config, "minDate", { 6525 get: function () { return self.config._minDate; }, 6526 set: minMaxDateSetter("min"), 6527 }); 6528 Object.defineProperty(self.config, "maxDate", { 6529 get: function () { return self.config._maxDate; }, 6530 set: minMaxDateSetter("max"), 6531 }); 6532 var minMaxTimeSetter = function (type) { return function (val) { 6533 self.config[type === "min" ? "_minTime" : "_maxTime"] = self.parseDate(val, "H:i:S"); 6534 }; }; 6535 Object.defineProperty(self.config, "minTime", { 6536 get: function () { return self.config._minTime; }, 6537 set: minMaxTimeSetter("min"), 6538 }); 6539 Object.defineProperty(self.config, "maxTime", { 6540 get: function () { return self.config._maxTime; }, 6541 set: minMaxTimeSetter("max"), 6542 }); 6543 if (userConfig.mode === "time") { 6544 self.config.noCalendar = true; 6545 self.config.enableTime = true; 6546 } 6547 Object.assign(self.config, formats, userConfig); 6548 for (var i = 0; i < boolOpts.length; i++) 6549 self.config[boolOpts[i]] = 6550 self.config[boolOpts[i]] === true || 6551 self.config[boolOpts[i]] === "true"; 6552 HOOKS.filter(function (hook) { return self.config[hook] !== undefined; }).forEach(function (hook) { 6553 self.config[hook] = arrayify(self.config[hook] || []).map(bindToInstance); 6554 }); 6555 self.isMobile = 6556 !self.config.disableMobile && 6557 !self.config.inline && 6558 self.config.mode === "single" && 6559 !self.config.disable.length && 6560 !self.config.enable && 6561 !self.config.weekNumbers && 6562 /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); 6563 for (var i = 0; i < self.config.plugins.length; i++) { 6564 var pluginConf = self.config.plugins[i](self) || {}; 6565 for (var key in pluginConf) { 6566 if (HOOKS.indexOf(key) > -1) { 6567 self.config[key] = arrayify(pluginConf[key]) 6568 .map(bindToInstance) 6569 .concat(self.config[key]); 6570 } 6571 else if (typeof userConfig[key] === "undefined") 6572 self.config[key] = pluginConf[key]; 6573 } 6574 } 6575 if (!userConfig.altInputClass) { 6576 self.config.altInputClass = 6577 getInputElem().className + " " + self.config.altInputClass; 6578 } 6579 triggerEvent("onParseConfig"); 6580 } 6581 function getInputElem() { 6582 return self.config.wrap 6583 ? element.querySelector("[data-input]") 6584 : element; 6585 } 6586 function setupLocale() { 6587 if (typeof self.config.locale !== "object" && 6588 typeof flatpickr.l10ns[self.config.locale] === "undefined") 6589 self.config.errorHandler(new Error("flatpickr: invalid locale " + self.config.locale)); 6590 self.l10n = __assign(__assign({}, flatpickr.l10ns.default), (typeof self.config.locale === "object" 6591 ? self.config.locale 6592 : self.config.locale !== "default" 6593 ? flatpickr.l10ns[self.config.locale] 6594 : undefined)); 6595 tokenRegex.D = "(" + self.l10n.weekdays.shorthand.join("|") + ")"; 6596 tokenRegex.l = "(" + self.l10n.weekdays.longhand.join("|") + ")"; 6597 tokenRegex.M = "(" + self.l10n.months.shorthand.join("|") + ")"; 6598 tokenRegex.F = "(" + self.l10n.months.longhand.join("|") + ")"; 6599 tokenRegex.K = "(" + self.l10n.amPM[0] + "|" + self.l10n.amPM[1] + "|" + self.l10n.amPM[0].toLowerCase() + "|" + self.l10n.amPM[1].toLowerCase() + ")"; 6600 var userConfig = __assign(__assign({}, instanceConfig), JSON.parse(JSON.stringify(element.dataset || {}))); 6601 if (userConfig.time_24hr === undefined && 6602 flatpickr.defaultConfig.time_24hr === undefined) { 6603 self.config.time_24hr = self.l10n.time_24hr; 6604 } 6605 self.formatDate = createDateFormatter(self); 6606 self.parseDate = createDateParser({ config: self.config, l10n: self.l10n }); 6607 } 6608 function positionCalendar(customPositionElement) { 6609 if (typeof self.config.position === "function") { 6610 return void self.config.position(self, customPositionElement); 6611 } 6612 if (self.calendarContainer === undefined) 6613 return; 6614 triggerEvent("onPreCalendarPosition"); 6615 var positionElement = customPositionElement || self._positionElement; 6616 var calendarHeight = Array.prototype.reduce.call(self.calendarContainer.children, (function (acc, child) { return acc + child.offsetHeight; }), 0), calendarWidth = self.calendarContainer.offsetWidth, configPos = self.config.position.split(" "), configPosVertical = configPos[0], configPosHorizontal = configPos.length > 1 ? configPos[1] : null, inputBounds = positionElement.getBoundingClientRect(), distanceFromBottom = window.innerHeight - inputBounds.bottom, showOnTop = configPosVertical === "above" || 6617 (configPosVertical !== "below" && 6618 distanceFromBottom < calendarHeight && 6619 inputBounds.top > calendarHeight); 6620 var top = window.pageYOffset + 6621 inputBounds.top + 6622 (!showOnTop ? positionElement.offsetHeight + 2 : -calendarHeight - 2); 6623 toggleClass(self.calendarContainer, "arrowTop", !showOnTop); 6624 toggleClass(self.calendarContainer, "arrowBottom", showOnTop); 6625 if (self.config.inline) 6626 return; 6627 var left = window.pageXOffset + inputBounds.left; 6628 var isCenter = false; 6629 var isRight = false; 6630 if (configPosHorizontal === "center") { 6631 left -= (calendarWidth - inputBounds.width) / 2; 6632 isCenter = true; 6633 } 6634 else if (configPosHorizontal === "right") { 6635 left -= calendarWidth - inputBounds.width; 6636 isRight = true; 6637 } 6638 toggleClass(self.calendarContainer, "arrowLeft", !isCenter && !isRight); 6639 toggleClass(self.calendarContainer, "arrowCenter", isCenter); 6640 toggleClass(self.calendarContainer, "arrowRight", isRight); 6641 var right = window.document.body.offsetWidth - 6642 (window.pageXOffset + inputBounds.right); 6643 var rightMost = left + calendarWidth > window.document.body.offsetWidth; 6644 var centerMost = right + calendarWidth > window.document.body.offsetWidth; 6645 toggleClass(self.calendarContainer, "rightMost", rightMost); 6646 if (self.config.static) 6647 return; 6648 self.calendarContainer.style.top = top + "px"; 6649 if (!rightMost) { 6650 self.calendarContainer.style.left = left + "px"; 6651 self.calendarContainer.style.right = "auto"; 6652 } 6653 else if (!centerMost) { 6654 self.calendarContainer.style.left = "auto"; 6655 self.calendarContainer.style.right = right + "px"; 6656 } 6657 else { 6658 var doc = getDocumentStyleSheet(); 6659 if (doc === undefined) 6660 return; 6661 var bodyWidth = window.document.body.offsetWidth; 6662 var centerLeft = Math.max(0, bodyWidth / 2 - calendarWidth / 2); 6663 var centerBefore = ".flatpickr-calendar.centerMost:before"; 6664 var centerAfter = ".flatpickr-calendar.centerMost:after"; 6665 var centerIndex = doc.cssRules.length; 6666 var centerStyle = "{left:" + inputBounds.left + "px;right:auto;}"; 6667 toggleClass(self.calendarContainer, "rightMost", false); 6668 toggleClass(self.calendarContainer, "centerMost", true); 6669 doc.insertRule(centerBefore + "," + centerAfter + centerStyle, centerIndex); 6670 self.calendarContainer.style.left = centerLeft + "px"; 6671 self.calendarContainer.style.right = "auto"; 6672 } 6673 } 6674 function getDocumentStyleSheet() { 6675 var editableSheet = null; 6676 for (var i = 0; i < document.styleSheets.length; i++) { 6677 var sheet = document.styleSheets[i]; 6678 if (!sheet.cssRules) 6679 continue; 6680 try { 6681 sheet.cssRules; 6682 } 6683 catch (err) { 6684 continue; 6685 } 6686 editableSheet = sheet; 6687 break; 6688 } 6689 return editableSheet != null ? editableSheet : createStyleSheet(); 6690 } 6691 function createStyleSheet() { 6692 var style = document.createElement("style"); 6693 document.head.appendChild(style); 6694 return style.sheet; 6695 } 6696 function redraw() { 6697 if (self.config.noCalendar || self.isMobile) 6698 return; 6699 buildMonthSwitch(); 6700 updateNavigationCurrentMonth(); 6701 buildDays(); 6702 } 6703 function focusAndClose() { 6704 self._input.focus(); 6705 if (window.navigator.userAgent.indexOf("MSIE") !== -1 || 6706 navigator.msMaxTouchPoints !== undefined) { 6707 setTimeout(self.close, 0); 6708 } 6709 else { 6710 self.close(); 6711 } 6712 } 6713 function selectDate(e) { 6714 e.preventDefault(); 6715 e.stopPropagation(); 6716 var isSelectable = function (day) { 6717 return day.classList && 6718 day.classList.contains("flatpickr-day") && 6719 !day.classList.contains("flatpickr-disabled") && 6720 !day.classList.contains("notAllowed"); 6721 }; 6722 var t = findParent(getEventTarget(e), isSelectable); 6723 if (t === undefined) 6724 return; 6725 var target = t; 6726 var selectedDate = (self.latestSelectedDateObj = new Date(target.dateObj.getTime())); 6727 var shouldChangeMonth = (selectedDate.getMonth() < self.currentMonth || 6728 selectedDate.getMonth() > 6729 self.currentMonth + self.config.showMonths - 1) && 6730 self.config.mode !== "range"; 6731 self.selectedDateElem = target; 6732 if (self.config.mode === "single") 6733 self.selectedDates = [selectedDate]; 6734 else if (self.config.mode === "multiple") { 6735 var selectedIndex = isDateSelected(selectedDate); 6736 if (selectedIndex) 6737 self.selectedDates.splice(parseInt(selectedIndex), 1); 6738 else 6739 self.selectedDates.push(selectedDate); 6740 } 6741 else if (self.config.mode === "range") { 6742 if (self.selectedDates.length === 2) { 6743 self.clear(false, false); 6744 } 6745 self.latestSelectedDateObj = selectedDate; 6746 self.selectedDates.push(selectedDate); 6747 if (compareDates(selectedDate, self.selectedDates[0], true) !== 0) 6748 self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); }); 6749 } 6750 setHoursFromInputs(); 6751 if (shouldChangeMonth) { 6752 var isNewYear = self.currentYear !== selectedDate.getFullYear(); 6753 self.currentYear = selectedDate.getFullYear(); 6754 self.currentMonth = selectedDate.getMonth(); 6755 if (isNewYear) { 6756 triggerEvent("onYearChange"); 6757 buildMonthSwitch(); 6758 } 6759 triggerEvent("onMonthChange"); 6760 } 6761 updateNavigationCurrentMonth(); 6762 buildDays(); 6763 updateValue(); 6764 if (!shouldChangeMonth && 6765 self.config.mode !== "range" && 6766 self.config.showMonths === 1) 6767 focusOnDayElem(target); 6768 else if (self.selectedDateElem !== undefined && 6769 self.hourElement === undefined) { 6770 self.selectedDateElem && self.selectedDateElem.focus(); 6771 } 6772 if (self.hourElement !== undefined) 6773 self.hourElement !== undefined && self.hourElement.focus(); 6774 if (self.config.closeOnSelect) { 6775 var single = self.config.mode === "single" && !self.config.enableTime; 6776 var range = self.config.mode === "range" && 6777 self.selectedDates.length === 2 && 6778 !self.config.enableTime; 6779 if (single || range) { 6780 focusAndClose(); 6781 } 6782 } 6783 triggerChange(); 6784 } 6785 var CALLBACKS = { 6786 locale: [setupLocale, updateWeekdays], 6787 showMonths: [buildMonths, setCalendarWidth, buildWeekdays], 6788 minDate: [jumpToDate], 6789 maxDate: [jumpToDate], 6790 positionElement: [updatePositionElement], 6791 clickOpens: [ 6792 function () { 6793 if (self.config.clickOpens === true) { 6794 bind(self._input, "focus", self.open); 6795 bind(self._input, "click", self.open); 6796 } 6797 else { 6798 self._input.removeEventListener("focus", self.open); 6799 self._input.removeEventListener("click", self.open); 6800 } 6801 }, 6802 ], 6803 }; 6804 function set(option, value) { 6805 if (option !== null && typeof option === "object") { 6806 Object.assign(self.config, option); 6807 for (var key in option) { 6808 if (CALLBACKS[key] !== undefined) 6809 CALLBACKS[key].forEach(function (x) { return x(); }); 6810 } 6811 } 6812 else { 6813 self.config[option] = value; 6814 if (CALLBACKS[option] !== undefined) 6815 CALLBACKS[option].forEach(function (x) { return x(); }); 6816 else if (HOOKS.indexOf(option) > -1) 6817 self.config[option] = arrayify(value); 6818 } 6819 self.redraw(); 6820 updateValue(true); 6821 } 6822 function setSelectedDate(inputDate, format) { 6823 var dates = []; 6824 if (inputDate instanceof Array) 6825 dates = inputDate.map(function (d) { return self.parseDate(d, format); }); 6826 else if (inputDate instanceof Date || typeof inputDate === "number") 6827 dates = [self.parseDate(inputDate, format)]; 6828 else if (typeof inputDate === "string") { 6829 switch (self.config.mode) { 6830 case "single": 6831 case "time": 6832 dates = [self.parseDate(inputDate, format)]; 6833 break; 6834 case "multiple": 6835 dates = inputDate 6836 .split(self.config.conjunction) 6837 .map(function (date) { return self.parseDate(date, format); }); 6838 break; 6839 case "range": 6840 dates = inputDate 6841 .split(self.l10n.rangeSeparator) 6842 .map(function (date) { return self.parseDate(date, format); }); 6843 break; 6844 default: 6845 break; 6846 } 6847 } 6848 else 6849 self.config.errorHandler(new Error("Invalid date supplied: " + JSON.stringify(inputDate))); 6850 self.selectedDates = (self.config.allowInvalidPreload 6851 ? dates 6852 : dates.filter(function (d) { return d instanceof Date && isEnabled(d, false); })); 6853 if (self.config.mode === "range") 6854 self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); }); 6855 } 6856 function setDate(date, triggerChange, format) { 6857 if (triggerChange === void 0) { triggerChange = false; } 6858 if (format === void 0) { format = self.config.dateFormat; } 6859 if ((date !== 0 && !date) || (date instanceof Array && date.length === 0)) 6860 return self.clear(triggerChange); 6861 setSelectedDate(date, format); 6862 self.latestSelectedDateObj = 6863 self.selectedDates[self.selectedDates.length - 1]; 6864 self.redraw(); 6865 jumpToDate(undefined, triggerChange); 6866 setHoursFromDate(); 6867 if (self.selectedDates.length === 0) { 6868 self.clear(false); 6869 } 6870 updateValue(triggerChange); 6871 if (triggerChange) 6872 triggerEvent("onChange"); 6873 } 6874 function parseDateRules(arr) { 6875 return arr 6876 .slice() 6877 .map(function (rule) { 6878 if (typeof rule === "string" || 6879 typeof rule === "number" || 6880 rule instanceof Date) { 6881 return self.parseDate(rule, undefined, true); 6882 } 6883 else if (rule && 6884 typeof rule === "object" && 6885 rule.from && 6886 rule.to) 6887 return { 6888 from: self.parseDate(rule.from, undefined), 6889 to: self.parseDate(rule.to, undefined), 6890 }; 6891 return rule; 6892 }) 6893 .filter(function (x) { return x; }); 6894 } 6895 function setupDates() { 6896 self.selectedDates = []; 6897 self.now = self.parseDate(self.config.now) || new Date(); 6898 var preloadedDate = self.config.defaultDate || 6899 ((self.input.nodeName === "INPUT" || 6900 self.input.nodeName === "TEXTAREA") && 6901 self.input.placeholder && 6902 self.input.value === self.input.placeholder 6903 ? null 6904 : self.input.value); 6905 if (preloadedDate) 6906 setSelectedDate(preloadedDate, self.config.dateFormat); 6907 self._initialDate = 6908 self.selectedDates.length > 0 6909 ? self.selectedDates[0] 6910 : self.config.minDate && 6911 self.config.minDate.getTime() > self.now.getTime() 6912 ? self.config.minDate 6913 : self.config.maxDate && 6914 self.config.maxDate.getTime() < self.now.getTime() 6915 ? self.config.maxDate 6916 : self.now; 6917 self.currentYear = self._initialDate.getFullYear(); 6918 self.currentMonth = self._initialDate.getMonth(); 6919 if (self.selectedDates.length > 0) 6920 self.latestSelectedDateObj = self.selectedDates[0]; 6921 if (self.config.minTime !== undefined) 6922 self.config.minTime = self.parseDate(self.config.minTime, "H:i"); 6923 if (self.config.maxTime !== undefined) 6924 self.config.maxTime = self.parseDate(self.config.maxTime, "H:i"); 6925 self.minDateHasTime = 6926 !!self.config.minDate && 6927 (self.config.minDate.getHours() > 0 || 6928 self.config.minDate.getMinutes() > 0 || 6929 self.config.minDate.getSeconds() > 0); 6930 self.maxDateHasTime = 6931 !!self.config.maxDate && 6932 (self.config.maxDate.getHours() > 0 || 6933 self.config.maxDate.getMinutes() > 0 || 6934 self.config.maxDate.getSeconds() > 0); 6935 } 6936 function setupInputs() { 6937 self.input = getInputElem(); 6938 if (!self.input) { 6939 self.config.errorHandler(new Error("Invalid input element specified")); 6940 return; 6941 } 6942 self.input._type = self.input.type; 6943 self.input.type = "text"; 6944 self.input.classList.add("flatpickr-input"); 6945 self._input = self.input; 6946 if (self.config.altInput) { 6947 self.altInput = createElement(self.input.nodeName, self.config.altInputClass); 6948 self._input = self.altInput; 6949 self.altInput.placeholder = self.input.placeholder; 6950 self.altInput.disabled = self.input.disabled; 6951 self.altInput.required = self.input.required; 6952 self.altInput.tabIndex = self.input.tabIndex; 6953 self.altInput.type = "text"; 6954 self.input.setAttribute("type", "hidden"); 6955 if (!self.config.static && self.input.parentNode) 6956 self.input.parentNode.insertBefore(self.altInput, self.input.nextSibling); 6957 } 6958 if (!self.config.allowInput) 6959 self._input.setAttribute("readonly", "readonly"); 6960 updatePositionElement(); 6961 } 6962 function updatePositionElement() { 6963 self._positionElement = self.config.positionElement || self._input; 6964 } 6965 function setupMobile() { 6966 var inputType = self.config.enableTime 6967 ? self.config.noCalendar 6968 ? "time" 6969 : "datetime-local" 6970 : "date"; 6971 self.mobileInput = createElement("input", self.input.className + " flatpickr-mobile"); 6972 self.mobileInput.tabIndex = 1; 6973 self.mobileInput.type = inputType; 6974 self.mobileInput.disabled = self.input.disabled; 6975 self.mobileInput.required = self.input.required; 6976 self.mobileInput.placeholder = self.input.placeholder; 6977 self.mobileFormatStr = 6978 inputType === "datetime-local" 6979 ? "Y-m-d\\TH:i:S" 6980 : inputType === "date" 6981 ? "Y-m-d" 6982 : "H:i:S"; 6983 if (self.selectedDates.length > 0) { 6984 self.mobileInput.defaultValue = self.mobileInput.value = self.formatDate(self.selectedDates[0], self.mobileFormatStr); 6985 } 6986 if (self.config.minDate) 6987 self.mobileInput.min = self.formatDate(self.config.minDate, "Y-m-d"); 6988 if (self.config.maxDate) 6989 self.mobileInput.max = self.formatDate(self.config.maxDate, "Y-m-d"); 6990 if (self.input.getAttribute("step")) 6991 self.mobileInput.step = String(self.input.getAttribute("step")); 6992 self.input.type = "hidden"; 6993 if (self.altInput !== undefined) 6994 self.altInput.type = "hidden"; 6995 try { 6996 if (self.input.parentNode) 6997 self.input.parentNode.insertBefore(self.mobileInput, self.input.nextSibling); 6998 } 6999 catch (_a) { } 7000 bind(self.mobileInput, "change", function (e) { 7001 self.setDate(getEventTarget(e).value, false, self.mobileFormatStr); 7002 triggerEvent("onChange"); 7003 triggerEvent("onClose"); 7004 }); 7005 } 7006 function toggle(e) { 7007 if (self.isOpen === true) 7008 return self.close(); 7009 self.open(e); 7010 } 7011 function triggerEvent(event, data) { 7012 if (self.config === undefined) 7013 return; 7014 var hooks = self.config[event]; 7015 if (hooks !== undefined && hooks.length > 0) { 7016 for (var i = 0; hooks[i] && i < hooks.length; i++) 7017 hooks[i](self.selectedDates, self.input.value, self, data); 7018 } 7019 if (event === "onChange") { 7020 self.input.dispatchEvent(createEvent("change")); 7021 self.input.dispatchEvent(createEvent("input")); 7022 } 7023 } 7024 function createEvent(name) { 7025 var e = document.createEvent("Event"); 7026 e.initEvent(name, true, true); 7027 return e; 7028 } 7029 function isDateSelected(date) { 7030 for (var i = 0; i < self.selectedDates.length; i++) { 7031 var selectedDate = self.selectedDates[i]; 7032 if (selectedDate instanceof Date && 7033 compareDates(selectedDate, date) === 0) 7034 return "" + i; 7035 } 7036 return false; 7037 } 7038 function isDateInRange(date) { 7039 if (self.config.mode !== "range" || self.selectedDates.length < 2) 7040 return false; 7041 return (compareDates(date, self.selectedDates[0]) >= 0 && 7042 compareDates(date, self.selectedDates[1]) <= 0); 7043 } 7044 function updateNavigationCurrentMonth() { 7045 if (self.config.noCalendar || self.isMobile || !self.monthNav) 7046 return; 7047 self.yearElements.forEach(function (yearElement, i) { 7048 var d = new Date(self.currentYear, self.currentMonth, 1); 7049 d.setMonth(self.currentMonth + i); 7050 if (self.config.showMonths > 1 || 7051 self.config.monthSelectorType === "static") { 7052 self.monthElements[i].textContent = 7053 monthToStr(d.getMonth(), self.config.shorthandCurrentMonth, self.l10n) + " "; 7054 } 7055 else { 7056 self.monthsDropdownContainer.value = d.getMonth().toString(); 7057 } 7058 yearElement.value = d.getFullYear().toString(); 7059 }); 7060 self._hidePrevMonthArrow = 7061 self.config.minDate !== undefined && 7062 (self.currentYear === self.config.minDate.getFullYear() 7063 ? self.currentMonth <= self.config.minDate.getMonth() 7064 : self.currentYear < self.config.minDate.getFullYear()); 7065 self._hideNextMonthArrow = 7066 self.config.maxDate !== undefined && 7067 (self.currentYear === self.config.maxDate.getFullYear() 7068 ? self.currentMonth + 1 > self.config.maxDate.getMonth() 7069 : self.currentYear > self.config.maxDate.getFullYear()); 7070 } 7071 function getDateStr(specificFormat) { 7072 var format = specificFormat || 7073 (self.config.altInput ? self.config.altFormat : self.config.dateFormat); 7074 return self.selectedDates 7075 .map(function (dObj) { return self.formatDate(dObj, format); }) 7076 .filter(function (d, i, arr) { 7077 return self.config.mode !== "range" || 7078 self.config.enableTime || 7079 arr.indexOf(d) === i; 7080 }) 7081 .join(self.config.mode !== "range" 7082 ? self.config.conjunction 7083 : self.l10n.rangeSeparator); 7084 } 7085 function updateValue(triggerChange) { 7086 if (triggerChange === void 0) { triggerChange = true; } 7087 if (self.mobileInput !== undefined && self.mobileFormatStr) { 7088 self.mobileInput.value = 7089 self.latestSelectedDateObj !== undefined 7090 ? self.formatDate(self.latestSelectedDateObj, self.mobileFormatStr) 7091 : ""; 7092 } 7093 self.input.value = getDateStr(self.config.dateFormat); 7094 if (self.altInput !== undefined) { 7095 self.altInput.value = getDateStr(self.config.altFormat); 7096 } 7097 if (triggerChange !== false) 7098 triggerEvent("onValueUpdate"); 7099 } 7100 function onMonthNavClick(e) { 7101 var eventTarget = getEventTarget(e); 7102 var isPrevMonth = self.prevMonthNav.contains(eventTarget); 7103 var isNextMonth = self.nextMonthNav.contains(eventTarget); 7104 if (isPrevMonth || isNextMonth) { 7105 changeMonth(isPrevMonth ? -1 : 1); 7106 } 7107 else if (self.yearElements.indexOf(eventTarget) >= 0) { 7108 eventTarget.select(); 7109 } 7110 else if (eventTarget.classList.contains("arrowUp")) { 7111 self.changeYear(self.currentYear + 1); 7112 } 7113 else if (eventTarget.classList.contains("arrowDown")) { 7114 self.changeYear(self.currentYear - 1); 7115 } 7116 } 7117 function timeWrapper(e) { 7118 e.preventDefault(); 7119 var isKeyDown = e.type === "keydown", eventTarget = getEventTarget(e), input = eventTarget; 7120 if (self.amPM !== undefined && eventTarget === self.amPM) { 7121 self.amPM.textContent = 7122 self.l10n.amPM[utils_int(self.amPM.textContent === self.l10n.amPM[0])]; 7123 } 7124 var min = parseFloat(input.getAttribute("min")), max = parseFloat(input.getAttribute("max")), step = parseFloat(input.getAttribute("step")), curValue = parseInt(input.value, 10), delta = e.delta || 7125 (isKeyDown ? (e.which === 38 ? 1 : -1) : 0); 7126 var newValue = curValue + step * delta; 7127 if (typeof input.value !== "undefined" && input.value.length === 2) { 7128 var isHourElem = input === self.hourElement, isMinuteElem = input === self.minuteElement; 7129 if (newValue < min) { 7130 newValue = 7131 max + 7132 newValue + 7133 utils_int(!isHourElem) + 7134 (utils_int(isHourElem) && utils_int(!self.amPM)); 7135 if (isMinuteElem) 7136 incrementNumInput(undefined, -1, self.hourElement); 7137 } 7138 else if (newValue > max) { 7139 newValue = 7140 input === self.hourElement ? newValue - max - utils_int(!self.amPM) : min; 7141 if (isMinuteElem) 7142 incrementNumInput(undefined, 1, self.hourElement); 7143 } 7144 if (self.amPM && 7145 isHourElem && 7146 (step === 1 7147 ? newValue + curValue === 23 7148 : Math.abs(newValue - curValue) > step)) { 7149 self.amPM.textContent = 7150 self.l10n.amPM[utils_int(self.amPM.textContent === self.l10n.amPM[0])]; 7151 } 7152 input.value = pad(newValue); 7153 } 7154 } 7155 init(); 7156 return self; 7157} 7158function _flatpickr(nodeList, config) { 7159 var nodes = Array.prototype.slice 7160 .call(nodeList) 7161 .filter(function (x) { return x instanceof HTMLElement; });
vendor: 9,325 bytes, lines 7162-7484
7162 var instances = []; 7163 for (var i = 0; i < nodes.length; i++) { 7164 var node = nodes[i]; 7165 try { 7166 if (node.getAttribute("data-fp-omit") !== null) 7167 continue; 7168 if (node._flatpickr !== undefined) { 7169 node._flatpickr.destroy(); 7170 node._flatpickr = undefined; 7171 } 7172 node._flatpickr = FlatpickrInstance(node, config || {}); 7173 instances.push(node._flatpickr); 7174 } 7175 catch (e) { 7176 console.error(e); 7177 } 7178 } 7179 return instances.length === 1 ? instances[0] : instances; 7180} 7181if (typeof HTMLElement !== "undefined" && 7182 typeof HTMLCollection !== "undefined" && 7183 typeof NodeList !== "undefined") { 7184 HTMLCollection.prototype.flatpickr = NodeList.prototype.flatpickr = function (config) { 7185 return _flatpickr(this, config); 7186 }; 7187 HTMLElement.prototype.flatpickr = function (config) { 7188 return _flatpickr([this], config); 7189 }; 7190} 7191var flatpickr = function (selector, config) { 7192 if (typeof selector === "string") { 7193 return _flatpickr(window.document.querySelectorAll(selector), config); 7194 } 7195 else if (selector instanceof Node) { 7196 return _flatpickr([selector], config); 7197 } 7198 else { 7199 return _flatpickr(selector, config); 7200 } 7201}; 7202flatpickr.defaultConfig = {}; 7203flatpickr.l10ns = { 7204 en: __assign({}, l10n_default), 7205 default: __assign({}, l10n_default), 7206}; 7207flatpickr.localize = function (l10n) { 7208 flatpickr.l10ns.default = __assign(__assign({}, flatpickr.l10ns.default), l10n); 7209}; 7210flatpickr.setDefaults = function (config) { 7211 flatpickr.defaultConfig = __assign(__assign({}, flatpickr.defaultConfig), config); 7212}; 7213flatpickr.parseDate = createDateParser({}); 7214flatpickr.formatDate = createDateFormatter({}); 7215flatpickr.compareDates = compareDates; 7216if (typeof jQuery !== "undefined" && typeof jQuery.fn !== "undefined") { 7217 jQuery.fn.flatpickr = function (config) { 7218 return _flatpickr(this, config); 7219 }; 7220} 7221Date.prototype.fp_incr = function (days) { 7222 return new Date(this.getFullYear(), this.getMonth(), this.getDate() + (typeof days === "string" ? parseInt(days, 10) : days)); 7223}; 7224if (typeof window !== "undefined") { 7225 window.flatpickr = flatpickr; 7226} 7227/* harmony default export */ const esm = (flatpickr); 7228 7229;// CONCATENATED MODULE: ./src/components/datetimepicker/datetimepicker.js 7230 7231const Brazilian = (__webpack_require__("./node_modules/flatpickr/dist/l10n/pt.js")["default"].pt) 7232 7233/** Classe para instanciar um objeto BRDateTimePicker*/ 7234class BRDateTimePicker { 7235 /** 7236 * Instancia do objeto 7237 * @param {string} name - Nome do componente em minúsculo 7238 * @param {object} component - Objeto referenciando a raiz do componente DOM 7239 * @param {string} config - atributo de configuração do componente 7240 * @param {object} language arquivo de linguagem do flatpick por padrão nesse componente vem portugues 7241 */ 7242 constructor(name, component, config, language = Brazilian) { 7243 this.name = name 7244 this.component = component 7245 this.language = language 7246 7247 this.component.addEventListener('blur', () => { 7248 if (!isNaN(new Date(this.component.value))) { 7249 fp.setDate(this.component.value) 7250 } 7251 }) 7252 7253 this.component.addEventListener('keyup', () => { 7254 if (!isNaN(new Date(this.component.value))) { 7255 // if the cursor is at the end of the edit and we have a full sized date, allow the date to immediately change, otherwise just move to the correct month without actually changing it 7256 if (this.component.selectionStart >= 10) 7257 fp.setDate(this.component.value) 7258 else fp.jumpToDate(this.component.value) 7259 } 7260 }) 7261 // localization global 7262 esm.localize(language) 7263 7264 this.configAttribute = this.component.getAttribute('datetimepicker-config') 7265 7266 if (this.configAttribute) { 7267 // Transforma o atributo em um objeto 7268 const properties = this.configAttribute.split(',') 7269 this.obj = [] 7270 properties.forEach((element) => { 7271 const tup = element.split(':') 7272 this.obj[tup[0]] = tup[1].replaceAll("'", '').trim() // eslint-disable-line 7273 7274 this.saida = this.obj 7275 }, this) 7276 7277 this.config = this.obj 7278 } else { 7279 this.config = config 7280 } 7281 7282 this._buildDateTimePicker() 7283 } 7284 /** 7285 * Adiciona máscara de data no input 7286 * @param {*} elm 7287 */ 7288 _dateInputMask(elm) { 7289 elm.setAttribute('maxlength', 10) 7290 elm.addEventListener('keypress', (e) => { 7291 if (e.keyCode < 47 || e.keyCode > 57) { 7292 e.preventDefault() 7293 } 7294 7295 const len = elm.value.length 7296 7297 if (len !== 1 || len !== 3) { 7298 if (e.keyCode == 47) { 7299 e.preventDefault() 7300 } 7301 } 7302 7303 if (len === 2) { 7304 elm.value += '/' 7305 } 7306 7307 if (len === 5) { 7308 elm.value += '/' 7309 } 7310 }) 7311 } 7312 /** 7313 * Adiciona máscara de hora no input 7314 * @param {*} elm * Dom do elemento input 7315 */ 7316 _dateTimeInputMask(elm) { 7317 elm.setAttribute('maxlength', 16) 7318 elm.addEventListener('keypress', (e) => { 7319 if (e.keyCode < 47 || e.keyCode > 57) { 7320 e.preventDefault() 7321 } 7322 7323 const len = elm.value.length 7324 7325 if (len !== 1 || len !== 3) { 7326 if (e.keyCode == 47) { 7327 e.preventDefault() 7328 } 7329 } 7330 switch (len) { 7331 case 2: 7332 elm.value += '/' 7333 break 7334 case 5: 7335 elm.value += '/' 7336 break 7337 case 10: 7338 elm.value += ' ' 7339 break 7340 case 13: 7341 elm.value += ':' 7342 break 7343 7344 default: 7345 break 7346 } 7347 }) 7348 } 7349 /** 7350 * Coloca máscara com range de data no input 7351 * @param {*} elm * Dom do elemento input 7352 */ 7353 _dateRangeInputMask(elm) { 7354 elm.setAttribute('maxlength', 25) 7355 elm.addEventListener('keypress', (e) => { 7356 if (e.keyCode < 47 || e.keyCode > 57) { 7357 e.preventDefault() 7358 } 7359 7360 const len = elm.value.length 7361 7362 if (len !== 1 || len !== 3) { 7363 if (e.keyCode === 47) { 7364 e.preventDefault() 7365 } 7366 } 7367 this._positionRangeMask(elm, len) 7368 }) 7369 } 7370 /** 7371 * Insere a máscara na Dom 7372 * @param {*} elm Dom do elemento input 7373 * @param {*} len Tamanho do elemento inserido 7374 */ 7375 _positionRangeMask(elm, len) { 7376 const tamSeparator = this.language.rangeSeparator.length 7377 const daySeparator = 10 + tamSeparator + 2 7378 const monthSeparator = 10 + tamSeparator + 5 7379 elm.setAttribute('maxlength', 20 + tamSeparator) 7380 7381 switch (len) { 7382 case 2: 7383 elm.value += '/' 7384 break 7385 case 5: 7386 elm.value += '/' 7387 break 7388 case 10: 7389 elm.value += this.language.rangeSeparator 7390 break 7391 case daySeparator: 7392 elm.value += '/' 7393 break 7394 case monthSeparator: 7395 elm.value += '/' 7396 break 7397 7398 default: 7399 break 7400 } 7401 } 7402 /** 7403 * Insere máscara de hora 7404 * 7405 * @param {*} elm dom do elemento input 7406 */ 7407 _timeInputMask(elm) { 7408 elm.setAttribute('maxlength', 5) 7409 elm.addEventListener('keypress', (e) => { 7410 if (e.keyCode < 47 || e.keyCode > 57) { 7411 e.preventDefault() 7412 } 7413 7414 const len = elm.value.length 7415 7416 if (len !== 1 || len !== 3) { 7417 if (e.keyCode === 47) { 7418 e.preventDefault() 7419 } 7420 } 7421 7422 if (len === 2) { 7423 elm.value += ':' 7424 } 7425 }) 7426 } 7427 7428 /** 7429 * Formata o componente e monta instância flatpickr 7430 * @private 7431 */ 7432 _buildDateTimePicker() { 7433 let format = 'd/m/Y' 7434 let time = false 7435 let noCalendar = false 7436 7437 switch (this.component.getAttribute('data-type')) { 7438 case 'date': 7439 format = 'd/m/Y' 7440 time = false 7441 noCalendar = false 7442 this._dateInputMask(this.component.querySelectorAll('input')[0]) 7443 break 7444 7445 case 'time': 7446 format = 'H:i' 7447 time = true 7448 noCalendar = true 7449 this._timeInputMask(this.component.querySelectorAll('input')[0]) 7450 break 7451 case 'datetime-local': 7452 format = 'd/m/Y H:i' 7453 time = true 7454 noCalendar = false 7455 this._dateTimeInputMask(this.component.querySelectorAll('input')[0]) 7456 break 7457 case 'datetime-range': 7458 format = 'd/m/Y' 7459 time = false 7460 noCalendar = false 7461 this._dateRangeInputMask(this.component.querySelectorAll('input')[0]) 7462 break 7463 default: 7464 format = 'd/m/Y' 7465 time = false 7466 noCalendar = false 7467 if (this.component.getAttribute('data-mode') === 'range') { 7468 this._dateRangeInputMask(this.component.querySelectorAll('input')[0]) 7469 } else { 7470 this._dateInputMask(this.component.querySelectorAll('input')[0]) 7471 } 7472 break 7473 } 7474 7475 this.config_native = { 7476 allowInput: true, 7477 dateFormat: format, 7478 disableMobile: 'true', 7479 enableTime: time, 7480 minuteIncrement: 1, 7481 7482 mode: this.component.getAttribute('data-mode'), 7483 nextArrow: 7484 '<button class="br-button circle small" type="button"><i class="fas fa-chevron-right"></i></button>',
7485 noCalendar: noCalendar, 7486 prevArrow: 7487 '<button class="br-button circle small" type="button"><i class="fas fas fa-chevron-left"></i></button>', 7488 time_24hr: true, 7489 wrap: true, 7490 } 7491 this.config_flatpick = Object.assign(this.config, this.config_native) 7492 7493 this.calendar = esm( 7494 this.component, 7495 Object.assign(this.config, this.config_native) 7496 ) 7497 7498 this.calendar.config.onOpen.push(() => { 7499 document.querySelectorAll('.arrowUp').forEach((element) => { 7500 element.classList.add('fas', 'fa-chevron-up') 7501 }) 7502 document.querySelectorAll('.arrowDown').forEach((element) => { 7503 element.classList.add('fas', 'fa-chevron-down') 7504 }) 7505 }) 7506 } 7507} 7508 7509/* harmony default export */ const datetimepicker = (BRDateTimePicker); 7510 7511 7512/***/ }), 7513
vendor: 29,543 bytes, lines 7514-8582
7514/***/ "./src/components/footer/footer.js": 7515/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 7516 7517"use strict"; 7518/* harmony export */ __webpack_require__.d(__webpack_exports__, { 7519/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 7520/* harmony export */ }); 7521/** 7522 * Classe do componente BRFooter 7523 */ 7524class BRFooter { 7525 /** 7526 * Instancia um componente BRFooter 7527 * @param {string} name - Nome do componente (br-footer) 7528 * @param {object} component - Objeto que referencia o elemento DOM do componente 7529 */ 7530 constructor(name, component) { 7531 this.name = name 7532 this.component = component 7533 this._setUp() 7534 this._setBehavior() 7535 } 7536 7537 /** 7538 * Controla a configuração inicial do footer 7539 */ 7540 _setUp() { 7541 this.list = this.component.querySelector('.br-list.horizontal') 7542 } 7543 7544 /** 7545 * Controla os comportamentos do footer 7546 * @private 7547 */ 7548 _setBehavior() { 7549 this._setCollapseBehavior() 7550 7551 window.onresize = function () { 7552 if (window.matchMedia('(min-width: 992px)').matches) { 7553 window.document 7554 .querySelectorAll('.br-footer .br-list:not(.horizontal)') 7555 .forEach((trigger) => { 7556 trigger.style.display = 'block' 7557 }) 7558 } else { 7559 window.document 7560 .querySelectorAll('.br-footer .br-list:not(.horizontal)') 7561 .forEach((trigger) => { 7562 trigger.style.display = 'none' 7563 }) 7564 7565 window.document 7566 .querySelectorAll('.br-footer i') 7567 .forEach((iconComponent) => { 7568 iconComponent.classList.remove('fa-angle-up') 7569 iconComponent.classList.add('fa-angle-down') 7570 }) 7571 } 7572 } 7573 } 7574 7575 /** 7576 * Trata do comportamento de collapse do Footer 7577 * @private 7578 */ 7579 _setCollapseBehavior() { 7580 this.britems = [] 7581 if (this.list) { 7582 this.list.querySelectorAll('.br-list').forEach((trigger) => { 7583 if (window.matchMedia('(max-width: 992px)').matches) { 7584 trigger.style.display = 'none' 7585 } 7586 }) 7587 7588 this.list.querySelectorAll('.br-item').forEach((trigger) => { 7589 trigger.addEventListener('click', (e) => { 7590 if (window.matchMedia('(max-width: 992px)').matches) { 7591 this._showList(e) 7592 } 7593 }) 7594 this.britems.push(trigger) 7595 }) 7596 } 7597 } 7598 7599 /** 7600 * Controla a abertura e fachamento da lista 7601 * @param {object} e - Objeto Event 7602 * @private 7603 */ 7604 _showList(e) { 7605 parent = e.target.parentElement 7606 7607 parent = parent.classList.contains('col-2') 7608 ? e.target.parentElement 7609 : e.target.parentElement.parentElement 7610 parent = parent.classList.contains('col-2') 7611 ? parent 7612 : e.target.parentElement.parentElement.parentElement 7613 // debugger 7614 this._closeAllColumns(parent) 7615 7616 parent.querySelectorAll('.br-list ').forEach((trigger) => { 7617 trigger.style.display = 7618 trigger.style.display === 'block' ? 'none' : 'block' 7619 7620 const iconComponent = parent.querySelector('i') 7621 7622 trigger.style.display === 'block' 7623 ? this._iconAngleUP(iconComponent) 7624 : this._iconAngleDOWN(iconComponent) 7625 }) 7626 } 7627 7628 /** 7629 * Fecha todas colunas do Footer 7630 */ 7631 _closeAllColumns(target) { 7632 this.component 7633 .querySelectorAll('.br-list:not(.horizontal)') 7634 .forEach((trigger) => { 7635 if (target !== trigger.parentElement) { 7636 trigger.style.display = 'none' 7637 this.component 7638 .querySelectorAll('.header i') 7639 .forEach((iconComponent) => { 7640 this._iconAngleDOWN(iconComponent) 7641 }) 7642 } 7643 }) 7644 } 7645 7646 /** 7647 *Inclui Ãcone 'fa-angle-up' 7648 * @param {objetc} iconComponent - Elemento DOM que representa um Ãcone 7649 * @private 7650 */ 7651 _iconAngleUP(iconComponent) { 7652 iconComponent.classList.remove('fa-angle-down') 7653 iconComponent.classList.add('fa-angle-up') 7654 } 7655 7656 /** 7657 * Inclui Ãcone 'fa-angle-down' 7658 * @param {object} iconComponent - Elemento DOM que representa um Ãcone 7659 * @private 7660 */ 7661 _iconAngleDOWN(iconComponent) { 7662 iconComponent.classList.remove('fa-angle-up') 7663 iconComponent.classList.add('fa-angle-down') 7664 } 7665} 7666 7667/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRFooter); 7668 7669 7670/***/ }), 7671 7672/***/ "./src/components/header/header.js": 7673/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 7674 7675"use strict"; 7676/* harmony export */ __webpack_require__.d(__webpack_exports__, { 7677/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 7678/* harmony export */ }); 7679/* harmony import */ var _partial_js_behavior_tooltip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/partial/js/behavior/tooltip.js"); 7680 7681 7682/** Classe para instanciar um objeto BRHeader*/ 7683class BRHeader { 7684 /** 7685 * Instancia do objeto 7686 * @param {string} name - Nome do componente em minúsculo 7687 * @param {object} component - Objeto referenciando a raiz do componente DOM 7688 */ 7689 constructor(name, component) { 7690 this.name = name 7691 this.component = component 7692 this.componentSearch = this.component.querySelector('.header-search') 7693 this.componentSearchInput = this.component.querySelector( 7694 '.header-search input' 7695 ) 7696 this.componentSearchTrigger = this.component.querySelector( 7697 '[data-toggle="search"]' 7698 ) 7699 this.componentSearchDismiss = this.component.querySelector( 7700 '[data-dismiss="search"]' 7701 ) 7702 this.hideDrop = null 7703 this.menuTrigger = this.component.querySelector( 7704 '[data-target="#main-navigation"]' 7705 ) 7706 this._setBehavior() 7707 } 7708 7709 /** 7710 * Define comportamentos do componente 7711 * @private 7712 */ 7713 _setBehavior() { 7714 this._setLogoutBehavior() 7715 this._setSearchBehaviors() 7716 this._setKeyboardBehaviors() 7717 this._setDropdownBehavior() 7718 this._setSticky() 7719 } 7720 7721 /** 7722 * Define comportamentos de login 7723 * @private 7724 */ 7725 _setLoginBehavior() { 7726 for (const login of this.component.querySelectorAll( 7727 '[data-trigger="login"]' 7728 )) { 7729 login.addEventListener('click', () => { 7730 const loginParent = login.closest('.header-login') 7731 loginParent.querySelector('.header-sign-in').classList.add('d-none') 7732 loginParent.querySelector('.header-avatar').classList.remove('d-none') 7733 }) 7734 } 7735 } 7736 7737 /** 7738 * Define comportamentos de logout 7739 * @private 7740 */ 7741 _setLogoutBehavior() { 7742 for (const logout of this.component.querySelectorAll( 7743 '[data-trigger="logout"]' 7744 )) { 7745 logout.addEventListener('click', () => { 7746 const logoutParent = logout.closest('.header-login') 7747 logoutParent.querySelector('.avatar').classList.remove('show') 7748 logoutParent 7749 .querySelector('[data-toggle="dropdown"]') 7750 .classList.remove('active') 7751 logoutParent.querySelector('.header-sign-in').classList.remove('d-none') 7752 logoutParent.querySelector('.header-avatar').classList.add('d-none') 7753 }) 7754 } 7755 } 7756 7757 /** 7758 * Define comportamentos de busca 7759 * @private 7760 */ 7761 _setSearchBehaviors() { 7762 // Abrir busca 7763 if (this.componentSearchTrigger) { 7764 this.componentSearchTrigger.addEventListener('focus', () => { 7765 this._cleanDropDownHeader() 7766 }) 7767 this.componentSearchTrigger.addEventListener('click', () => { 7768 this._openSearch() 7769 }) 7770 } 7771 7772 // Fechar busca 7773 if (this.componentSearchDismiss) { 7774 this.componentSearchDismiss.addEventListener('click', () => { 7775 this._closeSearch() 7776 }) 7777 } 7778 } 7779 7780 /** 7781 * Define comportamentos do teclado 7782 * @private 7783 */ 7784 _setKeyboardBehaviors() { 7785 if (this.componentSearchInput) { 7786 this.componentSearchInput.addEventListener('keydown', (event) => { 7787 switch (event.keyCode) { 7788 // Tecla ESC 7789 case 27: 7790 this._closeSearch() 7791 break 7792 default: 7793 break 7794 } 7795 }) 7796 } 7797 for (const trigger of this.component.querySelectorAll( 7798 '.dropdown [data-toggle="dropdown"]' 7799 )) { 7800 trigger.addEventListener('keydown', (event) => { 7801 switch (event.keyCode) { 7802 // Tecla ESC 7803 case 32: 7804 if (event.target.parentNode.classList.contains('show')) { 7805 event.target.parentNode.click() 7806 event.target.parentNode.classList.remove('show') 7807 event.target.classList.remove('active') 7808 event.stopPropagation() 7809 } 7810 break 7811 default: 7812 break 7813 } 7814 }) 7815 } 7816 } 7817 7818 /** 7819 * Visualização da busca 7820 * @private 7821 */ 7822 _openSearch() { 7823 if (this.componentSearch) { 7824 this.componentSearch.classList.add('active') 7825 this.componentSearch.querySelector('input').focus() 7826 } 7827 } 7828 7829 /** 7830 * Esconde a busca 7831 * @private 7832 */ 7833 _closeSearch() { 7834 if (this.componentSearch) { 7835 this.componentSearch.classList.remove('active') 7836 //this.componentSearchTrigger.focus() 7837 this._nextFocusElement().focus() 7838 } 7839 } 7840 7841 /** 7842 * Exibe notificação 7843 * @param {event} event - referencia ao evento 7844 */ 7845 handleEvent(event) { 7846 const hasNotficiationElemeent = this.component 7847 .querySelector('.br-notification') 7848 .contains(event.target) 7849 if (!hasNotficiationElemeent) { 7850 if (this.activateTr !== event.target.parentNode) { 7851 this._cleanDropDownHeaderRef(this.component) 7852 } 7853 } 7854 } 7855 7856 /** 7857 * Define comportamentos do dropdown 7858 * @private 7859 */ 7860 _setDropdownBehavior() { 7861 // TODO: Trocar o código abaixo pelo utilitário dropdown 7862 this.cleaned = false 7863 let hideDrop 7864 this.activateTr = 'teste' 7865 7866 for (const trigger of this.component.querySelectorAll( 7867 '.dropdown [data-toggle="dropdown"]' 7868 )) { 7869 // eslint-disable-next-line no-loop-func 7870 trigger.addEventListener('click', (event) => { 7871 this._headerTooltip() 7872 clearTimeout(hideDrop) 7873 7874 this.activateTr = trigger 7875 document.addEventListener('mousedown', this, false) 7876 event.stopImmediatePropagation() 7877 // Toggle de abrir / fechar 7878 const hasShow = trigger.classList.contains('active') 7879 7880 if (hasShow) { 7881 trigger.classList.remove('active') 7882 trigger.closest('.dropdown').classList.remove('show') 7883 } else { 7884 this._cleanDropDownHeader() 7885 trigger.classList.add('active') 7886 trigger.closest('.dropdown').classList.add('show') 7887 7888 // Evita que o componente feche o drop ao navegar pelo teclado 7889 const next = this._nextFocusElement() 7890 next.addEventListener('focus', () => { 7891 clearTimeout(hideDrop) 7892 }) 7893 } 7894 event.stopPropagation() 7895 return '' 7896 }) 7897 7898 // Faz o drop fechar ao clicar fora 7899 // eslint-disable-next-line no-loop-func 7900 } 7901 this.menuTrigger.addEventListener('focus', () => { 7902 this._cleanDropDownHeader() 7903 }) 7904 } 7905 7906 /** 7907 * Define comportamentos do tooltip 7908 * @private 7909 */ 7910 _headerTooltip() { 7911 if (this.TooltipExampleList) { 7912 this.TooltipExampleList.forEach((tooltipElem) => { 7913 tooltipElem.component.remove() 7914 tooltipElem.popperInstance.destroy() 7915 }) 7916 } 7917 this.TooltipExampleList = [] 7918 7919 this.component 7920 .querySelectorAll('.notification-tooltip') 7921 .forEach((TooltipExample) => { 7922 const texttooltip = TooltipExample.getAttribute('data-tooltip-text') 7923 const config = { 7924 activator: TooltipExample, 7925 placement: 'top', 7926 textTooltip: texttooltip, 7927 } 7928 const x = new _partial_js_behavior_tooltip__WEBPACK_IMPORTED_MODULE_0__["default"](config) 7929 7930 this.TooltipExampleList.push(x) 7931 }) 7932 } 7933 7934 /** 7935 * Limpa referencias do dorpdown 7936 * @private 7937 * @param {object} ref - Referência ao componente header 7938 */ 7939 _cleanDropDownHeaderRef(ref) { 7940 if (this.cleaned === false) { 7941 for (const trigger of ref.querySelectorAll('.dropdown.show')) { 7942 trigger.classList.remove('show') 7943 trigger.parentNode.classList.remove('show') 7944 for (const button of ref.querySelectorAll('.br-button')) { 7945 button.classList.remove('active') 7946 } 7947 } 7948 } 7949 this.cleaned = false 7950 } 7951 7952 /** 7953 * Limpa referencias do dorpdown 7954 * @private 7955 */ 7956 _cleanDropDownHeader() { 7957 this._cleanDropDownHeaderRef(this.component) 7958 } 7959 7960 /** 7961 * Define modo sticky ao header 7962 * @private 7963 */ 7964 _setSticky() { 7965 if (this.component.hasAttribute('data-sticky')) { 7966 window.onscroll = () => { 7967 if (window.pageYOffset > this.component.offsetHeight) { 7968 this.component.classList.add('sticky', 'compact') 7969 } else { 7970 this.component.classList.remove('sticky', 'compact') 7971 } 7972 } 7973 } 7974 } 7975 7976 /** 7977 * Foca no próximo elmento de ação 7978 * @private 7979 */ 7980 _nextFocusElement() { 7981 //lista de elementos de ação 7982 const focussableElements = 7983 'a:not([disabled]), button:not([disabled]), input[type=text]:not([disabled]), [tabindex]:not([disabled]):not([tabindex="-1"])' 7984 if (document.activeElement) { 7985 const focussable = Array.prototype.filter.call( 7986 document.body.querySelectorAll(focussableElements), 7987 (element) => { 7988 //check for visibility while always include the current activeElement 7989 return ( 7990 element.offsetWidth > 0 || 7991 element.offsetHeight > 0 || 7992 element === document.activeElement 7993 ) 7994 } 7995 ) 7996 const index = focussable.indexOf(document.activeElement) 7997 if (index > -1) { 7998 const nextElement = focussable[index + 1] || focussable[0] 7999 //nextElement.focus(); 8000 return nextElement 8001 } 8002 } 8003 return null 8004 } 8005} 8006 8007/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRHeader); 8008 8009 8010/***/ }), 8011 8012/***/ "./src/components/input/input.js": 8013/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 8014 8015"use strict"; 8016/* harmony export */ __webpack_require__.d(__webpack_exports__, { 8017/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 8018/* harmony export */ }); 8019/** Classe para instanciar um objeto BRInput*/ 8020class BRInput { 8021 /** 8022 * Instancia do objeto 8023 * @param {string} name - Nome do componente em minúsculo 8024 * @param {object} component - Objeto referenciando a raiz do componente DOM 8025 */ 8026 constructor(name, component) { 8027 this.name = name 8028 this.component = component 8029 this._currentFocus = -1 8030 this._setBehavior() 8031 } 8032 8033 /** 8034 * Define comportamentos do componente 8035 * @private 8036 */ 8037 _setBehavior() { 8038 this._setPasswordViewBehavior() 8039 this._setAutocompleteBehavior() 8040 } 8041 8042 /** 8043 * Define comportamentos do componente 8044 * @private 8045 */ 8046 _setPasswordViewBehavior() { 8047 for (const inputPassword of this.component.querySelectorAll( 8048 'input[type="password"]' 8049 )) { 8050 if (!inputPassword.disabled) { 8051 for (const buttonIcon of inputPassword.parentNode.querySelectorAll( 8052 '.br-button' 8053 )) { 8054 buttonIcon.addEventListener( 8055 'click', 8056 (event) => { 8057 this._toggleShowPassword(event) 8058 }, 8059 false 8060 ) 8061 } 8062 } 8063 } 8064 } 8065 8066 /** 8067 * Define comportamentos do componente 8068 * @private 8069 * @param {event} event - referência ao elemento que dispara a ação 8070 */ 8071 _toggleShowPassword(event) { 8072 for (const icon of event.currentTarget.querySelectorAll('.fas')) { 8073 if (icon.classList.contains('fa-eye')) { 8074 icon.classList.remove('fa-eye') 8075 icon.classList.add('fa-eye-slash') 8076 for (const input of this.component.querySelectorAll( 8077 'input[type="password"]' 8078 )) { 8079 input.setAttribute('type', 'text') 8080 } 8081 } else if (icon.classList.contains('fa-eye-slash')) { 8082 icon.classList.remove('fa-eye-slash') 8083 icon.classList.add('fa-eye') 8084 for (const input of this.component.querySelectorAll( 8085 'input[type="text"]' 8086 )) { 8087 input.setAttribute('type', 'password') 8088 } 8089 } 8090 } 8091 } 8092 8093 /** 8094 * Define comportamentos do componente 8095 * @private 8096 */ 8097 _setAutocompleteBehavior() { 8098 for (const inputAutocomplete of this.component.querySelectorAll( 8099 'input.search-autocomplete' 8100 )) { 8101 inputAutocomplete.addEventListener( 8102 'input', 8103 (event) => { 8104 this._clearSearchItems() 8105 this._buildSearchItems(event.currentTarget) 8106 }, 8107 false 8108 ) 8109 inputAutocomplete.addEventListener( 8110 'keydown', 8111 (event) => { 8112 this._handleArrowKeys(event) 8113 }, 8114 false 8115 ) 8116 } 8117 } 8118 8119 /** 8120 * Monta os items de busca para o elemento input 8121 * @private 8122 * @param {object} element - referencia ao elemento input 8123 */ 8124 _buildSearchItems(element) { 8125 const searchList = window.document.createElement('div') 8126 searchList.setAttribute('class', 'search-items') 8127 this.component.appendChild(searchList) 8128 if (element.value !== '') { 8129 for (const data of this.dataList) { 8130 if ( 8131 data.substr(0, element.value.length).toUpperCase() === 8132 element.value.toUpperCase() 8133 ) { 8134 const item = window.document.createElement('div') 8135 item.innerHTML = `<strong>${data.substr( 8136 0, 8137 element.value.length 8138 )}</strong>` 8139 item.innerHTML += data.substr(element.value.length) 8140 item.innerHTML += `<input type="hidden" value="${data}">` 8141 item.addEventListener( 8142 'click', 8143 (event) => { 8144 for (const input of event.currentTarget.querySelectorAll( 8145 'input[type="hidden"]' 8146 )) { 8147 element.value = input.value 8148 } 8149 this._clearSearchItems() 8150 }, 8151 false 8152 ) 8153 searchList.appendChild(item) 8154 } 8155 } 8156 } else { 8157 this._clearSearchItems() 8158 } 8159 } 8160 8161 /** 8162 * Limpa elementos da busca 8163 * @private 8164 */ 8165 _clearSearchItems() { 8166 for (const searchItems of this.component.querySelectorAll( 8167 '.search-items' 8168 )) { 8169 for (const item of searchItems.querySelectorAll('div')) { 8170 searchItems.removeChild(item) 8171 } 8172 this.component.removeChild(searchItems) 8173 } 8174 } 8175 8176 /** 8177 * Define comportamentos do teclado 8178 * @private 8179 * @param {event} event - referência ao elemento que dispara a ação do teclado 8180 */ 8181 _handleArrowKeys(event) { 8182 switch (event.keyCode) { 8183 case 13: 8184 if (this._currentFocus > -1) { 8185 event.preventDefault() 8186 for (const searchItems of this.component.querySelectorAll( 8187 '.search-items' 8188 )) { 8189 for (const itemActive of searchItems.querySelectorAll( 8190 'div.is-active' 8191 )) { 8192 itemActive.click() 8193 } 8194 } 8195 this._currentFocus = -1 8196 } 8197 break 8198 case 38: 8199 if (this._currentFocus > 0) { 8200 this._currentFocus -= 1 8201 } 8202 this._switchFocus() 8203 break 8204 case 40: 8205 for (const searchItems of this.component.querySelectorAll( 8206 '.search-items' 8207 )) { 8208 if ( 8209 this._currentFocus < 8210 searchItems.querySelectorAll('div').length - 1 8211 ) { 8212 this._currentFocus += 1 8213 } 8214 } 8215 this._switchFocus() 8216 break 8217 default: 8218 break 8219 } 8220 } 8221 8222 /** 8223 * Muda o foco do item de busca 8224 * @private 8225 */ 8226 _switchFocus() { 8227 for (const searchItems of this.component.querySelectorAll( 8228 '.search-items' 8229 )) { 8230 for (const [index, item] of searchItems 8231 .querySelectorAll('div') 8232 .entries()) { 8233 if (index === this._currentFocus) { 8234 item.classList.add('is-active') 8235 } 8236 if (index !== this._currentFocus) { 8237 item.classList.remove('is-active') 8238 } 8239 } 8240 } 8241 } 8242 8243 /** 8244 * Preenche lista de dados 8245 * @private 8246 * @param {string[]} dataList - Lista de dados 8247 */ 8248 setAutocompleteData(dataList) { 8249 this.dataList = dataList 8250 } 8251} 8252 8253/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRInput); 8254 8255 8256/***/ }), 8257 8258/***/ "./src/components/item/item.js": 8259/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 8260 8261"use strict"; 8262/* harmony export */ __webpack_require__.d(__webpack_exports__, { 8263/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 8264/* harmony export */ }); 8265/** Classe para instanciar um objeto BRItem*/ 8266 8267class BRItem { 8268 /** 8269 * Instancia do objeto 8270 * @param {string} name - Nome do componente em minúsculo 8271 * @param {object} component - Objeto referenciando a raiz do componente DOM 8272 */ 8273 constructor(name, component) { 8274 this.name = name 8275 this.component = component 8276 this._setBehavior() 8277 } 8278 8279 /** 8280 * Define comportamentos do componente 8281 * @private 8282 */ 8283 _setBehavior() { 8284 this._setCheckboxSelection() 8285 this._setRadioSelection() 8286 } 8287 8288 /** 8289 * Define comportamentos do checkbox 8290 * @private 8291 */ 8292 _setCheckboxSelection() { 8293 for (const checkbox of this.component.querySelectorAll( 8294 '.br-checkbox input[type="checkbox"]' 8295 )) { 8296 if (checkbox.checked) { 8297 this.component.classList.add('selected') 8298 } 8299 checkbox.addEventListener('click', (event) => { 8300 if (event.currentTarget.checked) { 8301 this.component.classList.add('selected') 8302 } else { 8303 this.component.classList.remove('selected') 8304 } 8305 }) 8306 } 8307 } 8308 8309 /** 8310 * Define comportamentos do radio 8311 * @private 8312 */ 8313 _setRadioSelection() { 8314 for (const radio of this.component.querySelectorAll( 8315 '.br-radio input[type="radio"]' 8316 )) { 8317 if (radio.checked) { 8318 radio.setAttribute('checked', '') 8319 this.component.classList.add('selected') 8320 } 8321 radio.addEventListener('click', (event) => { 8322 for (const item of this.component.parentElement.querySelectorAll( 8323 '.br-item' 8324 )) { 8325 for (const radioItem of item.querySelectorAll( 8326 '.br-radio input[type="radio"]' 8327 )) { 8328 if (radioItem === event.currentTarget) { 8329 radioItem.setAttribute('checked', '') 8330 item.classList.add('selected') 8331 } else { 8332 radioItem.removeAttribute('checked') 8333 item.classList.remove('selected') 8334 } 8335 } 8336 } 8337 }) 8338 } 8339 } 8340} 8341 8342/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRItem); 8343 8344 8345/***/ }), 8346 8347/***/ "./src/components/list/list.js": 8348/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 8349 8350"use strict"; 8351/* harmony export */ __webpack_require__.d(__webpack_exports__, { 8352/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 8353/* harmony export */ }); 8354/* harmony import */ var _partial_js_behavior_collapse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/partial/js/behavior/collapse.js"); 8355 8356/** 8357 * Classe do componente BRList 8358 */ 8359class BRList { 8360 /** 8361 * Instancia um componente BRList 8362 * @param {string} name - Nome do componente (br-list) 8363 * @param {object} component - Objeto que referencia o elemento DOM do componente 8364 */ 8365 constructor(name, component) { 8366 this.name = name 8367 this.component = component 8368 this._setBehavior() 8369 } 8370 8371 /** 8372 * Controla os comportamentos da list 8373 * @private 8374 */ 8375 _setBehavior() { 8376 this._setCollapseBehavior() 8377 } 8378 8379 /** 8380 * Trata do comportamento de collapse da list 8381 * @private 8382 */ 8383 _setCollapseBehavior() { 8384 // data-toggle="data-toggle" 8385 // debugger 8386 8387 // this.component.querySelectorAll('.br-list').forEach((trigger) => { 8388 // // trigger.style.display = 'none' 8389 // }) 8390 this.component 8391 .querySelectorAll('[data-toggle="collapse"]') 8392 .forEach((trigger) => { 8393 const config = { 8394 iconToHide: 'fa-chevron-up', 8395 iconToShow: 'fa-chevron-down', 8396 trigger, 8397 useIcons: true, 8398 } 8399 const collapse = new _partial_js_behavior_collapse__WEBPACK_IMPORTED_MODULE_0__["default"](config) 8400 collapse.setBehavior() 8401 }) 8402 } 8403} 8404/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRList); 8405 8406 8407/***/ }), 8408 8409/***/ "./src/components/menu/menu.js": 8410/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 8411 8412"use strict"; 8413/* harmony export */ __webpack_require__.d(__webpack_exports__, { 8414/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 8415/* harmony export */ }); 8416/** Classe para instanciar um objeto BRMenu*/ 8417class BRMenu { 8418 /** 8419 * Instancia do objeto 8420 * @param {string} name - Nome do componente em minúsculo 8421 * @param {object} component - Objeto referenciando a raiz do componente DOM 8422 */ 8423 constructor(name, component) { 8424 this.name = name 8425 this.component = component 8426 this.id = this.component.id 8427 this.breakpoints = this.component.dataset.breakpoints 8428 ? this.component.dataset.breakpoints.split(' ') 8429 : ['col-sm-4', 'col-lg-3'] 8430 this.pushShadow = 'shadow-lg-right' 8431 this.trigger = document.querySelector(`[data-target="#${this.id}"]`) 8432 this.contextual = this.component.querySelector( 8433 '[data-toggle="contextual"]' 8434 ) 8435 this.dismiss = this.component.querySelectorAll('[data-dismiss="menu"]') 8436 this.scrim = this.component.querySelector('.menu-scrim') 8437 this.componentFolders = this.component.querySelectorAll('.menu-folder') 8438 this.componentItems = this.component.querySelectorAll('.menu-item') 8439 this._setBehavior() 8440 } 8441 8442 /** 8443 * Define comportamentos do componente 8444 * @private 8445 */ 8446 _setBehavior() { 8447 this._toggleMenu() 8448 this._setDropMenu() 8449 this._setSideMenu() 8450 this._setKeyboardBehaviors() 8451 this._setBreakpoints() 8452 this._setView() 8453 window.addEventListener('resize', () => { 8454 this._setView() 8455 }) 8456 } 8457 8458 /** 8459 * Define visual do componente 8460 * @private 8461 */ 8462 _setView() { 8463 const template = document.querySelector('body') 8464 const menuContextual = document.querySelector('.menu-trigger') 8465 // const panel = document.querySelector('.menu-panel') 8466 if (menuContextual && window.innerWidth < 992) { 8467 template.classList.add('mb-5') 8468 } else { 8469 template.classList.remove('mb-5') 8470 } 8471 } 8472 8473 /** 8474 * Define breakpoints do menu 8475 * @private 8476 */ 8477 _setBreakpoints() { 8478 if (!this.component.classList.contains('push') && !this.contextual) { 8479 this.component 8480 .querySelector('.menu-panel') 8481 .classList.add(...this.breakpoints) 8482 } 8483 } 8484 8485 /** 8486 * Define ações do teclado 8487 * @private 8488 */ 8489 _setKeyboardBehaviors() { 8490 // Fechar com tecla ESC 8491 this.component.addEventListener('keyup', (event) => { 8492 switch (event.code) { 8493 case 'Escape': 8494 this._closeMenu() 8495 default: 8496 break 8497 } 8498 }) 8499 // Fechar com Tab fora do menu 8500 if (this.scrim) { 8501 this.scrim.addEventListener('keyup', () => { 8502 return this._closeMenu() 8503 }) 8504 } 8505 } 8506 8507 /** 8508 * Define comportamentos de abrir/fechar menu 8509 * @private 8510 */ 8511 _toggleMenu() { 8512 const trigger = this.contextual ? this.contextual : this.trigger 8513 // Clicar no trigger 8514 if (trigger) { 8515 trigger.addEventListener('click', () => { 8516 // Fechar Menu caso esteja aberto 8517 if (this.component.classList.contains('active')) { 8518 this._closeMenu() 8519 return 8520 } 8521 // Abre Menu 8522 this._openMenu() 8523 this._focusNextElement() 8524 }) 8525 } 8526 // Clicar no dismiss 8527 for (const close of this.dismiss) { 8528 close.addEventListener('click', () => { 8529 return this._closeMenu() 8530 }) 8531 } 8532 } 8533 8534 /** 8535 * Define visual do menu aberto 8536 * @private 8537 */ 8538 _openMenu() { 8539 this.component.classList.add('active') 8540 if (this.component.classList.contains('push')) { 8541 this.component.classList.add(...this.breakpoints, 'px-0') 8542 } 8543 this.component.focus() 8544 } 8545 8546 /** 8547 * Define visual do menu fechado 8548 * @private 8549 */ 8550 _closeMenu() { 8551 this.component.classList.remove('active') 8552 if (this.component.classList.contains('push')) { 8553 this.component.classList.remove(...this.breakpoints, 'px-0') 8554 } 8555 this._focusNextElement() 8556 } 8557 8558 /** 8559 * Configura Drop Menu para filho imediato de ".menu-folder" 8560 * @private 8561 */ 8562 _setDropMenu() { 8563 for (const item of this.component.querySelectorAll( 8564 '.menu-folder > a.menu-item' 8565 )) { 8566 // Inclui Ãcone de Drop Menu 8567 this._createIcon(item, 'fa-chevron-down') 8568 // Configura como Drop Menu 8569 item.parentNode.classList.add('drop-menu') 8570 // Inicializa Drop Menu 8571 this._toggleDropMenu(item) 8572 } 8573 } 8574 8575 /** 8576 * Foca no próximo elemento 8577 * @private 8578 */ 8579 _focusNextElement() { 8580 //lista de elementos que desejamos focar 8581 const focussableElements = 8582 'a:not([disabled]), button:not([disabled]), input[type=text]:not([disabled]), [tabindex]:not
8582([disabled]):not([tabindex="-1"])' 8583 if (document.activeElement) { 8584 const focussable = Array.prototype.filter.call( 8585 document.body.querySelectorAll(focussableElements), 8586 (element) => { 8587 // testa a visibilidade e inclui o elemento ativo 8588 return ( 8589 element.offsetWidth > 0 || 8590 element.offsetHeight > 0 || 8591 element === document.activeElement 8592 ) 8593 } 8594 ) 8595 const index = focussable.indexOf(document.activeElement) 8596 if (index > -1) { 8597 const nextElement = focussable[index + 1] || focussable[0] 8598 nextElement.focus() 8599 } 8600 } 8601 } 8602 8603 /** 8604 * Configura Side Menu para quem não for filho imediato de ".menu-folder" 8605 * @private 8606 */ 8607 _setSideMenu() { 8608 for (const ul of this.component.querySelectorAll('a.menu-item + ul')) { 8609 if (!ul.parentNode.classList.contains('menu-folder')) { 8610 // Inclui Ãcone de Side Menu 8611 this._createIcon(ul.previousElementSibling, 'fa-angle-right') 8612 // Configura como Side Menu 8613 ul.parentNode.classList.add('side-menu') 8614 // Inicializa Side Menu 8615 this._toggleSideMenu(ul.previousElementSibling) 8616 } 8617 } 8618 } 8619 8620 /** 8621 * Muda estado do Drop Menu - aberto/fechado 8622 * @private 8623 * @param {object} element - referência ao Objeto que fará a ação 8624 */ 8625 _toggleDropMenu(element) { 8626 // Verifica se o elemento já possui click listener através de um atributo especial 8627 if (!element.hasAttribute('data-click-listener')) { 8628 element.addEventListener('click', () => { 8629 // Fecha Drop Menu caso esteja aberto 8630 if (element.parentNode.classList.contains('active')) { 8631 element.parentNode.classList.remove('active') 8632 return 8633 } 8634 8635 // Abre Drop Menu 8636 element.parentNode.classList.add('active') 8637 }) 8638 // Adiciona atributo especial para indicar que o elemento já possui click listener 8639 element.setAttribute('data-click-listener', 'true') 8640 } 8641 } 8642 8643 /** 8644 * Muda estado do Side Menu - aberto/fechado 8645 * @private 8646 * @param {object} element - referência ao Objeto que fará a ação 8647 */ 8648 _toggleSideMenu(element) { 8649 // Verifica se o elemento já possui click listener através de um atributo especial 8650 if (!element.hasAttribute('data-click-listener')) { 8651 element.addEventListener('click', () => { 8652 // Esconde todos os itens 8653 this._hideItems(element) 8654 8655 // Mostra itens do Side Menu ativo 8656 this._showItems(element.parentNode) 8657 8658 // Fecha Side Menu caso esteja aberto 8659 if (element.parentNode.classList.contains('active')) { 8660 this._closeSideMenu(element) 8661 element.focus() 8662 return 8663 } 8664 8665 // Abre Side Menu 8666 element.parentNode.classList.add('active') 8667 element.focus() 8668 }) 8669 // Adiciona atributo especial para indicar que o elemento já possui click listener 8670 element.setAttribute('data-click-listener', 'true') 8671 } 8672 } 8673 8674 /** 8675 * Fecha Side Menu 8676 * @private 8677 * @param {object} element - referência ao Objeto que fará a ação 8678 */ 8679 _closeSideMenu(element) { 8680 element.parentNode.classList.remove('active') 8681 // Verifica se existe Side Menu anterior, caso contrário mostra todos os itens de volta 8682 const parentFolder = element.parentNode.closest('.side-menu.active') 8683 ? element.parentNode.closest('.side-menu.active') 8684 : element.closest('.menu-body') 8685 this._showItems(parentFolder) 8686 } 8687 8688 /** 8689 * Esconde os elementos proximos a referencia 8690 * @private 8691 * @param {object} element - referencia ao Objeto que fará a ação 8692 */ 8693 _hideItems(element) { 8694 for (const item of element 8695 .closest('.menu-body') 8696 .querySelectorAll('.menu-item')) { 8697 item.setAttribute('hidden', '') 8698 } 8699 } 8700 8701 /** 8702 * Mostra os elementos proximos a referencia 8703 * @private 8704 * @param {object} element - referência ao Objeto que fará a ação 8705 */ 8706 _showItems(element) { 8707 for (const item of element.querySelectorAll('.menu-item')) { 8708 item.removeAttribute('hidden') 8709 } 8710 } 8711 8712 /** 8713 * Cria icone filho a referencia 8714 * @private 8715 * @param {object} element - referência ao Objeto pai 8716 * @param {string} icon - nome da classe font awesome do Ãcone 8717 */ 8718 _createIcon(element, icon) { 8719 // Verifica se já existe container para o Ãcone 8720 if (!element.querySelectorAll('span.support').length) { 8721 const menuIconContainer = document.createElement('span') 8722 menuIconContainer.classList.add('support') 8723 8724 const menuIcon = document.createElement('i') 8725 menuIcon.classList.add('fas') 8726 menuIcon.classList.add(icon) 8727 menuIcon.setAttribute('aria-hidden', 'true') 8728 8729 menuIconContainer.appendChild(menuIcon) 8730 element.appendChild(menuIconContainer) 8731 } 8732 } 8733} 8734 8735/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRMenu); 8736 8737 8738/***/ }), 8739
8740/***/ "./src/components/message/message.js": 8741/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 8742 8743"use strict"; 8744/* harmony export */ __webpack_require__.d(__webpack_exports__, { 8745/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 8746/* harmony export */ }); 8747/** Classe para instanciar um objeto BRAlert */ 8748class BRAlert { 8749 /** 8750 * Instancia do objeto 8751 * @param {string} name - Nome do componente em minúsculo 8752 * @param {object} component - Objeto referenciando a raiz do componente DOM 8753 */ 8754 constructor(name, component) { 8755 this.name = name 8756 this.component = component 8757 this._setBehavior() 8758 } 8759 8760 /** 8761 * Define comportamentos do componente 8762 * @private 8763 */ 8764 _setBehavior() { 8765 for (const button of this.component.querySelectorAll( 8766 '.br-message .close' 8767 )) { 8768 button.addEventListener('click', () => { 8769 this._dismiss(this.component) 8770 }) 8771 } 8772 } 8773 8774 /** 8775 * Desvincula a instancia do objeto 8776 * @private 8777 * @param {object} component - Objeto referenciando a raiz do componente DOM 8778 */ 8779 _dismiss(component) { 8780 component.parentNode.removeChild(component) 8781 } 8782} 8783 8784/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRAlert); 8785 8786 8787/***/ }), 8788
vendor: 15,893 bytes, lines 8789-9340
8789/***/ "./src/components/modal/modal.js": 8790/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 8791 8792"use strict"; 8793/* harmony export */ __webpack_require__.d(__webpack_exports__, { 8794/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 8795/* harmony export */ }); 8796/* harmony import */ var _scrim_scrim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/components/scrim/scrim.js"); 8797 8798 8799/** Classe para instanciar um objeto BRModal*/ 8800class BRModal { 8801 /** 8802 * Instancia do objeto 8803 * @param {string} name - Nome do componente em minúsculo 8804 * @param {object} component - Objeto referenciando a raiz do componente DOM 8805 */ 8806 constructor(name, component) { 8807 this.name = name 8808 this.component = component 8809 this._setBehavior() 8810 } 8811 8812 /** 8813 * Define comportamentos do componente 8814 * @private 8815 */ 8816 _setBehavior() { 8817 for (const brScrim of window.document.querySelectorAll('.br-scrim')) { 8818 const scrim = new _scrim_scrim__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z('br-scrim', brScrim) 8819 for (const button of window.document.querySelectorAll( 8820 '.br-scrim + button' 8821 )) { 8822 button.addEventListener('click', () => { 8823 scrim.showScrim() 8824 }) 8825 } 8826 } 8827 } 8828} 8829 8830/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRModal); 8831 8832 8833/***/ }), 8834 8835/***/ "./src/components/notification/notification.js": 8836/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 8837 8838"use strict"; 8839/* harmony export */ __webpack_require__.d(__webpack_exports__, { 8840/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 8841/* harmony export */ }); 8842/* harmony import */ var _partial_js_behavior_tooltip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/partial/js/behavior/tooltip.js"); 8843 8844/** Classe para instanciar um objeto BRNotification*/ 8845class BRNotification { 8846 /** 8847 * Instancia do objeto 8848 * @param {string} name - Nome do componente em minúsculo 8849 * @param {object} component - Objeto referenciando a raiz do componente DOM 8850 */ 8851 constructor(name, component) { 8852 this.name = name 8853 this.component = component 8854 this.menuBtns = component.querySelectorAll('.contextual-btn') 8855 this.hideEvents = ['mouseleave', 'blur'] 8856 this._setBehavior() 8857 } 8858 8859 /** 8860 * Esconde a notificação relativa a referência 8861 * @private 8862 * @property {object} action - Referência ao Objeto que dispara a ação 8863 */ 8864 _hideNotification(action) { 8865 const notification = action.parentNode.parentNode 8866 notification.setAttribute('hidden', '') 8867 } 8868 8869 /** 8870 * Esconde todas as notificações relativa a referência 8871 * @private 8872 * @property {object} action - Referência ao Objeto que dispara a ação 8873 */ 8874 _hideAllNotifications(action) { 8875 const notifications = 8876 action.parentNode.parentNode.parentNode.querySelectorAll('.br-item') 8877 notifications.forEach((notification) => { 8878 notification.setAttribute('hidden', '') 8879 }) 8880 } 8881 8882 /** 8883 * Define comportamentos do componente 8884 * @private 8885 */ 8886 _setBehavior() { 8887 for (const button of this.component.querySelectorAll( 8888 '.br-notification .close' 8889 )) { 8890 button.addEventListener('click', () => { 8891 this._dismiss(this.component) 8892 }) 8893 } 8894 this._notificationTooltip() 8895 } 8896 8897 /** 8898 * Define tooltip para a notificação 8899 * @private 8900 */ 8901 _notificationTooltip() { 8902 const TooltipExampleList = [] 8903 8904 window.document 8905 .querySelectorAll(':not(.br-header) .notification-tooltip') 8906 .forEach((TooltipNotification) => { 8907 const texttooltip = 8908 TooltipNotification.getAttribute('data-tooltip-text') 8909 const config = { 8910 activator: TooltipNotification, 8911 placement: 'top', 8912 textTooltip: texttooltip, 8913 } 8914 for ( 8915 parent = TooltipNotification.parentNode; 8916 parent; 8917 parent = parent.parentNode 8918 ) { 8919 if (parent.classList) 8920 if (parent.classList.contains('header-avatar')) { 8921 return '' 8922 } 8923 } 8924 TooltipExampleList.push(new _partial_js_behavior_tooltip__WEBPACK_IMPORTED_MODULE_0__["default"](config)) 8925 return '' 8926 }) 8927 } 8928 8929 /** 8930 * Adiciona classe para refletir comportamento de fechar 8931 * @private 8932 * @property {object} componente - Referência ao Objeto 8933 */ 8934 _dismiss(component) { 8935 component.classList.add('close') 8936 } 8937} 8938 8939/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRNotification); 8940 8941 8942/***/ }), 8943 8944/***/ "./src/components/pagination/pagination.js": 8945/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 8946 8947"use strict"; 8948/* harmony export */ __webpack_require__.d(__webpack_exports__, { 8949/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 8950/* harmony export */ }); 8951/** Classe para instanciar um objeto BRPagination*/ 8952class BRPagination { 8953 /** 8954 * Instancia do objeto 8955 * @param {string} name - Nome do componente em minúsculo 8956 * @param {object} component - Objeto referenciando a raiz do componente DOM 8957 */ 8958 constructor(name, component) { 8959 this.name = name 8960 this.component = component 8961 this.currentPage = 1 8962 this._setBehaviors() 8963 } 8964 8965 /** 8966 * Define comportamentos do componente 8967 * @private 8968 */ 8969 _setBehaviors() { 8970 this._setActive() 8971 this._dropdownBehavior() 8972 } 8973 8974 /** 8975 * Define visual do componente 8976 * @private 8977 */ 8978 // eslint-disable-next-line complexity 8979 _setLayout() { 8980 const ul = this.component.querySelector('ul') 8981 const pages = this.component.querySelectorAll('.page') 8982 pages.forEach((page) => { 8983 if (page.classList.contains('active')) { 8984 this.currentPage = parseInt(page.querySelector('a')) 8985 } 8986 page.classList.remove('d-none') 8987 }) 8988 8989 if (this.currentPage === 1) { 8990 ul.querySelector('[data-previous-page]').setAttribute('disabled', '') 8991 } else { 8992 ul.querySelector('[data-previous-page]').removeAttribute('disabled') 8993 } 8994 8995 if (this.currentPage === pages.length) { 8996 ul.querySelector('[data-next-page').setAttribute('disabled', '') 8997 } else { 8998 ul.querySelector('[data-next-page]').removeAttribute('disabled') 8999 } 9000 9001 if (pages.length > 9) { 9002 if (this.currentPage < 6) { 9003 if (ul.querySelector('[data-previous-interval]')) { 9004 ul.querySelector('[data-previous-interval]').remove() 9005 } 9006 for (let page = 7; page < pages.length - 1; page++) { 9007 pages[page].classList.add('d-none') 9008 } 9009 if (!ul.querySelector('[data-next-interval]')) { 9010 ul.insertBefore( 9011 this._createIntervalElement('next'), 9012 ul.children[ul.children.length - 2] 9013 ) 9014 } 9015 } 9016 if (this.currentPage >= 6 && this.currentPage < pages.length - 4) { 9017 for (let page = this.currentPage - 4; page > 0; page--) { 9018 pages[page].classList.add('d-none') 9019 } 9020 if (!ul.querySelector('[data-previous-interval]')) { 9021 ul.insertBefore( 9022 this._createIntervalElement('previous'), 9023 ul.children[2] 9024 ) 9025 } 9026 for (let page = this.currentPage + 2; page < pages.length - 1; page++) { 9027 pages[page].classList.add('d-none') 9028 } 9029 if (!ul.querySelector('[data-next-interval]')) { 9030 ul.insertBefore( 9031 this._createIntervalElement('next'), 9032 ul.children[ul.children.length - 2] 9033 ) 9034 } 9035 } 9036 if (this.currentPage >= pages.length - 4) { 9037 if (ul.querySelector('[data-next-interval]')) { 9038 ul.querySelector('[data-next-interval]').remove() 9039 } 9040 for (let page = pages.length - 8; page > 0; page--) { 9041 pages[page].classList.add('d-none') 9042 } 9043 if (!ul.querySelector('[data-previous-interval]')) { 9044 ul.insertBefore( 9045 this._createIntervalElement('previous'), 9046 ul.children[2] 9047 ) 9048 } 9049 } 9050 } 9051 } 9052 9053 /** 9054 * Cria elemento no intervalo 9055 * @param {string} type - nome do tipo do elmento 9056 * @private 9057 */ 9058 _createIntervalElement(type) { 9059 const interval = document.createElement('li') 9060 interval.setAttribute(`data-${type}-interval`, '') 9061 9062 const a = document.createElement('a') 9063 a.setAttribute('href', 'javascript:void(0)') 9064 9065 const icon = document.createElement('i') 9066 icon.classList.add('fas', 'fa-ellipsis-h') 9067 9068 a.appendChild(icon) 9069 interval.appendChild(a) 9070 9071 return interval 9072 } 9073 9074 /** 9075 * Cria ação de clique na página 9076 * @private 9077 */ 9078 _setActive() { 9079 for (const page of this.component.querySelectorAll('.page')) { 9080 page.addEventListener('click', (event) => { 9081 this._selectPage(event.currentTarget) 9082 }) 9083 } 9084 } 9085 9086 /** 9087 * Cria comportamentos do dropdown 9088 * @private 9089 */ 9090 _dropdownBehavior() { 9091 for (const dropdown of this.component.querySelectorAll( 9092 '[data-toggle="dropdown"]' 9093 )) { 9094 this._dropdownInit(dropdown) 9095 this._dropdownToggle(dropdown) 9096 } 9097 } 9098 9099 /** 9100 * Cria ação de clique no dropdown 9101 * @param {object} element - referencia ao objeto DOM 9102 * @private 9103 */ 9104 _dropdownToggle(element) { 9105 element.addEventListener('click', () => { 9106 if (element.getAttribute('aria-expanded') === 'false') { 9107 this._dropdownOpen(element) 9108 return 9109 } 9110 this._dropdownClose(element) 9111 }) 9112 window.document.addEventListener('click', (event) => { 9113 if (!this.component.contains(event.target)) { 9114 this._dropdownClose(element) 9115 } 9116 }) 9117 } 9118 9119 /** 9120 * Inicializa elemento de dropdown 9121 * @param {object} element - referencia ao objeto DOM 9122 * @private 9123 */ 9124 _dropdownInit(element) { 9125 element.parentElement.classList.add('dropdown') 9126 element.nextElementSibling.setAttribute('role', 'menu') 9127 element.setAttribute('aria-haspopup', 'true') 9128 this._dropdownClose(element) 9129 } 9130 9131 /** 9132 * Ação de abrir dropdown 9133 * @param {object} element - referencia ao objeto DOM 9134 * @private 9135 */ 9136 _dropdownOpen(element) { 9137 element.setAttribute('aria-expanded', 'true') 9138 element.nextElementSibling.removeAttribute('hidden') 9139 } 9140 9141 /** 9142 * Ação de fechar dropdown 9143 * @param {object} element - referencia ao objeto DOM 9144 * @private 9145 */ 9146 _dropdownClose(element) { 9147 element.setAttribute('aria-expanded', 'false') 9148 element.nextElementSibling.setAttribute('hidden', '') 9149 } 9150 9151 /** 9152 * Define página ativa 9153 * @param {object} currentPage - referencia ao objeto DOM 9154 * @private 9155 */ 9156 _selectPage(currentPage) { 9157 this.component.querySelectorAll('.page').forEach((page) => { 9158 page.classList.remove('active') 9159 }) 9160 currentPage.classList.add('active') 9161 this._setLayout() 9162 } 9163} 9164 9165/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRPagination); 9166 9167 9168/***/ }), 9169 9170/***/ "./src/components/scrim/scrim.js": 9171/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 9172 9173"use strict"; 9174/* harmony export */ __webpack_require__.d(__webpack_exports__, { 9175/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 9176/* harmony export */ }); 9177class BRScrim { 9178 constructor(name, component) { 9179 this.name = name 9180 this.component = component 9181 this._setType() 9182 this._setBehavior() 9183 } 9184 9185 _setType() { 9186 if (this.component.classList.contains('foco')) { 9187 this._type = 'foco' 9188 } 9189 if (this.component.classList.contains('legibilidade')) { 9190 this._type = 'legibilidade' 9191 } 9192 if (this.component.classList.contains('inibicao')) { 9193 this._type = 'inibicao' 9194 } 9195 } 9196 9197 _setBehavior() { 9198 if (this.component.classList.contains('foco')) { 9199 this.component.addEventListener('click', (event) => { 9200 this.outsideclick = true 9201 if (event.target.classList.contains('br-scrim')) { 9202 this.hideScrim(event) 9203 } 9204 }) 9205 9206 const allComp = this.component.querySelectorAll( 9207 `[data-dismiss=${this.component.id}]` 9208 ) 9209 9210 for (const buttonComponent of allComp) { 9211 buttonComponent.addEventListener('click', () => { 9212 this.component.classList.remove('active') 9213 }) 9214 } 9215 } 9216 } 9217 9218 hideScrim(event) { 9219 event.currentTarget.classList.remove('active') 9220 } 9221 9222 showScrim() { 9223 if (this._type === 'foco') { 9224 this.component.classList.add('active') 9225 } 9226 } 9227} 9228// const scrimList = [] 9229/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRScrim); 9230for (const buttonBloco1 of window.document.querySelectorAll( 9231 '.scrimexemplo button' 9232)) { 9233 buttonBloco1.addEventListener('click', () => { 9234 const scrscrim = window.document.querySelector('#scrimexample') 9235 const scrimfoco = new BRScrim('br-scrim', scrscrim) 9236 scrimfoco.showScrim() 9237 }) 9238} 9239/** 9240 * Exemplo de scrim com muito texto 9241 */ 9242for (const scrimexamplebig of window.document.querySelectorAll( 9243 '#scrimexemplo-big' 9244)) { 9245 scrimexamplebig.addEventListener('click', () => { 9246 const scrscrim = window.document.querySelector('#scrimfocobig') 9247 const scrimfoco = new BRScrim('br-scrim', scrscrim) 9248 scrimfoco.showScrim() 9249 }) 9250} 9251 9252//Exemplo de scrim close 9253 9254 9255/***/ }), 9256 9257/***/ "./src/components/select/select.js": 9258/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 9259 9260"use strict"; 9261/* harmony export */ __webpack_require__.d(__webpack_exports__, { 9262/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 9263/* harmony export */ }); 9264/** 9265 * Classe do componente BRSelect 9266 */ 9267 9268class BRSelect { 9269 /** 9270 * Instancia o componente 9271 * @property {string} name - Nome do componente em minúsculo 9272 * @property {object} component - Objeto referenciando a raiz do componente DOM 9273 * @property {string} notFound - (Opcional) String contendo código html para informar que a busca não encontrou nenhuma opção. 9274 * Se não informado, será usado um código html padrão. 9275 */ 9276 9277 constructor(name, component, notFound) { 9278 this.name = name 9279 this.component = component 9280 this.notFound = notFound 9281 this.multiple = component.hasAttribute('multiple') 9282 this._setOptionsList() 9283 this._setBehavior() 9284 } 9285 /** 9286 * Retorna os valores dos elementos selecionados 9287 * @returns {Object[]} elementos selecionados 9288 * 9289 */ 9290 get selected() { 9291 return this._optionSelected('value') 9292 } 9293 /** 9294 * Retorna os elementos selecionados pelo inputValue 9295 * @param {Object[]} elementos selecionados 9296 * @returns 9297 */ 9298 get selectedValue() { 9299 return this._optionSelected('inputValue') 9300 } 9301 9302 /** 9303 * Retorna os elementos options selecionados 9304 * @param {Object[]} elementos selecionados 9305 * @returns 9306 */ 9307 _optionSelected(strOption) { 9308 let selected = [] 9309 for (const [index, option] of this.optionsList.entries()) { 9310 if (!this.multiple) { 9311 if (option.selected) { 9312 selected = option[strOption] 9313 break 9314 } 9315 } else { 9316 if (index > 0 && option.selected) { 9317 selected.push(option[strOption]) 9318 } 9319 } 9320 } 9321 return selected 9322 } 9323 9324 /** 9325 * Remove o elemento que indica item não encontrado 9326 * @private 9327 */ 9328 _removeNotFoundElement() { 9329 const list = this.component.querySelector('.br-list') 9330 if (list.querySelector('.br-item.not-found')) { 9331 list.removeChild(list.querySelector('.br-item.not-found')) 9332 } 9333 } 9334 9335 /** 9336 * Coloca o texto Item não encontrado no select 9337 * @private 9338 */ 9339 _addNotFoundElement() { 9340 const image = `
vendor: 8,586 bytes, line 9340
9340data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGYAAABCCAYAAACl4qNCAAAABHNCSVQICAgIfAhkiAAAGMxJREFUeF7NXQl8FOXZf2bPbLKbbLIJARJChEQSCFc4IqAY/CiIgMZardYD0R9SW/3EVlAkSoAPQaAai1awleKnrVYR0wattVKxthWUI4AYCCEkMeQix26OPWdn+jwzzGaz2WM22YDv78dv1sx7/+e5n/eVgctU4mesH+9WqlZyttaZjEIdxznNsTzn1oDbYVaoY5qAUdWDSnuKc3Xtsh7fcewyTet7Owwz2DPT5z72Y85lfRrHmSB3LIZh6kAdvZ9RGbd0HSr6Vm67cOrlN5/S1/9m92xQKrN5HjI4u2OY22ZLUGg00YxaFc27ORfPslZ1QnwrA0wb73ZdAKX6qzFLbv5b6fCpVjljGQv+mg7ApptLFh+QU9+7zqABE59XNMHpbHuDZ22Twp1UrwlqYv+mYJSPdR7ecmYg/UypPxzt+PM/7nS0mhdxVnueu7t7eH/7U8UZWhil8jgDijcr1m56I1A/xoIPjApQFwPw5raSxSvCGW9QgDHkrbnWbWv5K/CcPpzJBK7Ls0qdaR/HxP60+9CapnD6zHn7tZmu2gvPuFra5nJOpyqctrLqKhiLIipqP+eyb6/etiMoZRAFmUsWVMvpN+LARI+9ewHPqN9DORIjZwLh1EEWZ2FUmuVdR1/+U6h241/91TJbQ8NK1tKZGapupN5zTtc3mnjjjsrnXnjFX58JBft249/b20oWPR5qzIgCo8+4eyyvi/mSBz421MD9f89zjEb/VvfiF5dCEcP59jPhzR13Wc9VbWLbLSP7P8bAWqKcatEMSXz59Mq163x7QnBWIDDI3oKXSAITFTNheQXPcyNCDRqJ9wqlujIqKfv6lr8/Wk/9TXt/16iOqu/2OurqJ0ai/0j0gbKoQpuaes+ph1Z87dufqaC0oLVkcUmgcSIGjGHaqp1ue/tDkViQ3D4Ynm9TqQ3zRzycPtVWXVOMAl0rt+3lqsdo1G5NcuIjZ54o2uE9ZkJBKVENKQVF/uYSEWBiZzyewXZ2fAsoWC7XgqVx4iZqWa3JFXmhHuGFaFNSnjmz6tn/6w1OYLYWEWD0k/+3hGNtt0R4LUG7Y5QAcRMUoIm/nKMOaCxek2haWfHMc7+S08uAgYkf9VCc06Bs4jm2/2yERxnOKFDdxyfvBkDC4912YJRR+HTiKyIIVCnQEhR+M06InxIF6kFUMeRsXrh1cPqsOinhtspnNv1Famss+HCSkuGLWj9YVODd34CBiZ35TCHb2bgh3En2AoG1oUdGh39yCQChpS38ZpTaXgCBQgmEizFXBWrDgKce9pQj0YBRKDrxA5tQXbyjWuqP1GgOmGJzycIy6W8DXl3M5EeP86xdtrtFogQgEBAAAsIDggSQQCVIQYDveARIgQCxVlBoo8E4GZBS6J1Ymkv/JnTjvNgKQxbNA01SYiT2b1D7UETryqo2FeNKApcBAxOd84ADP21NsEF4ZE+oQeE+K5ECqDqxKJFVeQAS3iEgRCUCQFiHqIaEiQCgC9mXDtRxvUcyHzwM5kNHEDQNpC79CT77z1EHFQ2fznWpw58tX7nWw2nIfQOgQc+ASDUDAkY//dnbOVvDuwEXxLEIhkoEgxQ2kh9UpL8FBKg3eDznhLjxGohK7qEUaczGPX8BtqMT2M4uGHrbYohK7bcL7HLiAoxW27bk+ZeSihjRSCZ3jZJhd7d+sDh/4MBMeeIVzmn5mb8VEZWQHCFARApAGSJQCxIXRwARBV0CzQMQUguBSVLGi4KihrIQO9Y/URIoRC30VMcbcRwVcA5HnykRJaG3WHj/fSnapMQnzxRu3CLNB22bIsmuGRDFGPJWf+i2ttzUa6E+VIK6VHgAscjiVMiOqB+GAaVeCQnTkJ3hf9OmSptLT6mgjwoBR6VBSezQDfTfvMsFbpsdbk1pgHP/PAa1bTzE58+AC7oMT70rzfbwgzpXtWV7hr8PZUDA6HNXfMu5urOljkUqQXmi0PSmEoGNcaTwhqYgFqmK5AvKIFAwYLoGf7s6PJup1NE7Djg7vVcA+qWQWjoAPbwC1TBqtaA4EFDZfCN8ev2/waxkIP0xpF5crXbeYlDqtCLlcJzQTqHBNleIkniNbkrN1uKj0h5KrpqBATP9qUaMSCZ7gEHhTewJlV2BJfUI8ktsTAZAInjEjixgGBsDSlUbgop/ww0XVGyyd6jgb84lUg2BRF8/UYwgwhA8VUw0zNPVwG+zDqAlqoD8jRx8fpKHmKxMiMkcDUp8T0VtjBUoTGWIUIQiTD6p1Ol+d25z8TIPMLeWHnDzbMGAgNGNW9KJm6jn8cujzfQYhYI2JW6gByCPwSgpAv4oCKmAYEWqURvdEDtGATkoa0ZpUXsjuYNUIPRJGp74C4OKGvHvgnrduyidnbAx+22o6GBh8moOpmapICV2InS53KCMMwhs8UxSAnAom4gSrwTVKPUxp85tfCHHA0zBh/cj3ykbEDDROQ/akX1pySAU7RGiEi82JgOgHhmEwLqsuOkIssoOxglINVYrfJU9AeKQ3fSnvHrwIOz8+mNIT0awkZjKqnioWVkEIzdvBguxQiw3T5wAh3OuFijuSoCDMtFR8/Lv+ixwYMCMX8b7szn6GoxEJaI2FJiCiP05UcY7wJRHcqVTYDFnJk7rDyZCm5ONjXDdjh6nbprRCCdWrIBFu3fDv6qrhTr35ObCJ6nJaB8ZBPZ2JRQClckws/LZbV9KCyU3zYCA0Y27vxv5V7Rfg9Hbou/l9xLlgK8M4pxdAmsyZCkgOlUHbFc3sOYOODN5ugcY+tL33X8/rP74Y1iYleXZ3D/ceWdA8D48fRqIcojqnsrPh/FDh/YB5q2jR8H0g3zQjUi5IrImZlTa3aceW/NHDztDORMeMPmfqeKY47cwLDvBbW8eynY13IeUgMwZ1VT82kXfFtkqZI+gnPF1uQQASAAK1WTtEHJOirqEo6EJ++DgdE6uZ9Npk69NTxcogb5+qXj/lkNevhRDwOiuSoPEufmgjNbJ6SKidXTpIx4vf7zQE9U03bqvRBYwyfcej7FV7dvhtjX9kHfZRHWGNlPYaNEoFEDo5XIJDpDodEDej0BSiRrConPSJAhkKi6zRVCLy7Nku+Fkb5Y3MHdePRo+rDwHDpNJ8BxQ8WZnl8MoVekNxZUbt/XKAwgJTPycV2e5rLWlnLVFjHwgCJJK29vvdckoFFbma9Ff8ntJFITUQSAS63JbWyE6TYeWvcGzIW6rDeWLU6CYG8uroBMteQMKZ3qqUSV2oREplcSYGGjp7oZ2m02gIjtZ9/jSiXWkNlQ3JS4OHPiuA4W+mf5ZzPCYrRXeRUN0TzdAXoIS6hbfLthA5Ekg1ZvYqUofI8g6snXIeKW/R1p70yQlbK4o3LRaWhO5Z4ICY7rh1RRHW3k557YZeqhEVHd5oNiJaHP0ACS5XC5Z5cI7icUhGAxZ7na0UdrxN7I/dNXEjI6CmBF6wdCTFk7sRPpSq1/aKZsSwqm4DFe+Fh2ibozpzGoAqENn95QFM6DBlCoYrQJHQNBIDZc8CgTSYICjHzf24W8eesyjpZhCyRj9tFUnOXu7R8cWJuvxeyEbI3c8L36hvYNbIkAEgmAs4pNn0fikisj+WEsN6NKG4z8NqHRiNFraDKIU0RoXN+e73/5/OPstu+56nMtSBIbyeW5vBTiEVDPdxMC53OtRQ+uJwBHVkhpN7h16DoZarRuZdlf5L9a8I00+qIwxzt2x1Nl0ZFevlaK7RbAzBMck+bTwK7/k26KnwMLoSa4ZpAjMA0M20CUoAgqNAdzdTaBO0ELqyGnAMX7c82Q4kt9ECBGgwYibsvPn46Cx6aIwDT2yLSpdyLqoDE0eAl3Ibs7X1MJVI9OEv3vXoffnzldDclKSUJ/qJSWaYNOWX0Nq+Wn4HeoPbdjltZhn04EMYNykBWA1TRQUADEehLLO3gUXvz1AnySoVGqImpyAXgUMPyRELqZtys0deWTJ8lrvvQ7IyvTXFB7hupt6VCKamuC+v+SdJQ+xUgRIMC7R/qBN5Z0W+vyRDXQJHmUOrW+VwYguew7ZViKCYwGn4wHZX/aZ7aMhPt4nCCO7tf+KM/MXwqGvj8G9SJTnVQpoww8AUORVj1oGuoy+qQuWL1YD23JS6GzI+DmgnpQUMR+bKtbQXLlhm8etJc3YLzBjbz+lqan4jQ1V4F5+Dg8bw2iiGKOnjxuVAaQKRh0t+LcE1uWyoJZlAE1iFGiTdKAx6QWZQU5GEuwubrnsrW16M1cgokiWG268DT7/QrTnpuai5X/0hPDbOO91NDL77BF4A5MwOg8gVQX67MyIGKPqBOP+s2ufnyutTwoz+11y0k8OZnaffL2i12aQdxhZEh6TELzHVIhVsZ11+IsFXWoqUoYDooab0M+F3lqf3aQYCWk3rnYz1n5Y9j4PBjCz594C//5SzMGbOmUyHC2/ADHjl4Fm+Ay/8+oFTNoUaG84ASMevDsiGlpUyrDlp1cVveYB5tbSsrYPFvu3/OOv27rQYa7Y5z1LohZM6BNZGcoQztYC0VeNQKOQR1AScJLBP2uiGBKgrtZ2YBV+Y2t+N2UwgJFYGQ2YPX4qNGcUBf1QfIFpqz0CKffeMWAXDio55qrNxbh5jOSVFSKZlHjudzcTF72Ta63Zf4RmS3JFVHkp7lEDSm0MRKUAGLKHgzJKdK/ILc4WVH+wtB8JmiLQq7vOw1v7UJ/c8QLV86aYUaMzoEHd4/bx14a1VKHMFBWO+GgeLtZ+AylL7hQ0R19PgfNiC6DcQLbuFJ7BiibJ9FpF4XMevk5xf3PJrWZq4xeYoUuPJlkOFTcTIFJhLedBn2EEQ04agtPXxR5qs0i2UECLxedFymyRWdiuC4MKzDXTc+HgV544VchZpYy4Ci58d14ARlKfpUb2unpofL9UAIRAG373jwL3p1B2q5JSr6p8+mlB5RTO0jCqA8TGAgJDL3RZd7dwzg4T/kP10AmmWZkoQ/rvRyJg3OjGZzu6MOXo45Ab4PkgBgEYb1Y2NXciCv/jsucjAUObTsE1b08AydG63/9RoBZj3hQwXjM1YL+YNLIOTwMUSRXoFAD9lk4CCBQjHQ3wPiKgn/b0HmfTodvUqOsnzh4dUoaEWhlNmkAhA3LNQvnq8sO3TxtUirnu2hlwx4NPBp3+S5sLofLMN0KdURnZUFVZ7mFl3mFpYmONe0o9mTpDFs/32y/aQHVnn92U5i1bfCsKwJgwasbxfCEqUv9CxO4XSGv2psmgqDpqnBg+2/I3G0ovouJsboEPNr8VCkfP+7x0lG8B9OWyE9/A/yy4HVovlPvt7423/gRvvPUu/OPj93u995YxeXlT4YXX/xp0Po8svQWOff0foU7mmBw4iyANu/OHaAbEh+03I71Jmzr0+oqn1v1LGtRYUJrve05TopjddEAU118pATPm+Y1z7HW1n6K5MmBkiFqI5B2NzWiYaeG91a9GBBjqpATZYsHiG/32Z0YPddmJU5A/e2ZAYGbNuga27CwNGxhJxoTr1DQf48Bljb2v+/Cv3hQIQMhd5oqlfDJpIr1YmfdhmozCXzbhVz5E9g4GqUiqMtkwJGNI1uzdsFt2t8EoxreTA//8j0BdI9NSIX1k4PNT3hQza9YMBMaT4+13Xv4oRlKXwwGmo5wHewOPjvWoz7rKtt9Ag5H4QG9cie/ZTP+W//bNW62V55+QvXsyKkqufHe3Fd4vel1GC7GKHGCIMqbMnAfVNd95+t2180VYcs+P/Y7jLfynoIH56zc+CZ9i0I4hf5nceI0EijAQBrKs3+wiZ5uYeOCn+AVm1FMrzJzNFlEHFbEzBzkj8Yveu/73EQfm8VVrEYg7BEohuZI+MjUgMN4UM3fuDbCuOPhZW38Uk/qAaPnLiXh2nubBVu+xIcW1M+5brCd2BSTVPsBM/P2vf2gpO9VbWsrexsAVSfgT1ZDHeM+zv5XdoxyKkd3ZpYreFJOXNw2F/0dhUwwJf8pJC5a8gdF2sJxEmYJ+Xd+CeRJbu8u2r5JNMVdvWPOas6XFk4AW7qID1RdYGUYOyS0TaVYW7hy9nZj9ZmV+DEzvedibeOiqwHAinTbxU1DOvItyxj+vJYKiaJm3RpC1bf179u8uBDFZw92GnvquNvSToYyJNCsLd0berOz666+D517ZGzbFjFh2n182Ro73ztNIJYJjJXDBWzW+6D65c3ZAivEFJvvFjR/Yqmt7HTsLd+H+6gsGJrIzSrDYUyg/XDzYrKy/FJP20/t7Wf0EiLUata5GH1kSYPOU0YkfdR7atDAgML7XaFy9/umdztbWsI+Ft33+HzzNZQL7hQZImD2jF+8lUKREcMo3vtLAeLOy/soYEv5k9XNuLXSf48FxUR4gEhCKmKEvdx3c8KhsGZO1df0j9roL28OlkpZPPoOu8gqP887bs0oqJSUxkKr8fZAx06+dD0eOiRHJ/mplI5Yvh+7zol3Sn6IakntXx/6HPXF+3z4YOiyDhxHQwBGPmOWfPx9V85sXLLzTKd83j+3oZBdRCxU6cucLjGRgkoPvSgv/SAATnbMEJXRYW+TZe4VGzyaOv9lQvXtOYDuGrH3EfJL3DQ2ZRas+cbVbfhDOl9D17RkBDHLk6ceO6ZM0R5QiHCrC55VWl71Z2fTpU+HFXeH7yqLG3CUko3hyIMLYLJUx88uOL1b19hP5tBfsGF85M+b5wjH2uqaTmCkSsZsuSPBTAp1CrYqoryyM/fBU9bZjbr55ITz53O6g3fgzMHXjlvYLFMpc1abPn4+EENTdEDAenLlxzeuu5hb5/vkQO0Qpr8TGKC3ovacj58TsDzDe6vKCBfOhcGtwb7c/YIhikCWFPbzalHXccuCXIS/X8wCTcCkJwGukqIxnnqjDzBZT2KP7aeCx/PFdOFpZZmwTmEwJkZiCp4/4YWOgAzN2qNx0042wZovg6A1YIkUxiqh4u370rdmN78yoDrWgHmBQCUCjp7q1ZKGHrq9a8/h0sNo/xWzE4MHrUKPgeymCGa53+Z5FUwRvcagiRRZD1WNRQ6QkQSpulHm5194IDz26Jnxgxi4RT2DLLMTClPHZSzo++7ms1NKQGVuji56c6e7o/ARXMaAb+0hldmKGDD3D0cpm5YhZlKGKFMAKVc/3/QM/WwkP/iygy0qoHgmKUSdPWG359NHNcufXBxgxPuDaLWVrUEc5L27Itrd3/oW1WPwefZYzmBSTcba2heWS+ef+j4SIob/yUck70Fgvuvr9AUObHqrMvmEBZGaND5tiojEPTW5RGkdu6/yiMPRkvDrsA0ygiBq1ydq27mV03S/nneHfDyYZmS48JRaOjAm2+CW3zfHE4tPSR0Nt9TkwzpwuXMTg7uqC0lf+LHfvBgUYgX1pTes7Dq1bG+5E/LKyYLed5hRvTHZYbZvwVtY7wmVvUtLfjOQMiLVgCGAApbPD4qEkt5uFE0cPCb0lF9wknm/Bc/sTjSkwnB/Y3TIOhx1OnRBS7ISE+rLDYmptKIphlGqX0jRuacf+n/+hP8sMKmPElBomjgPnS96sjQZacPastmbfuw852s33smZLLoZ0ZWX/ucxmwW9W/9Z7/ZlvyDbSfTKkBVqra6HtH1+EbNOfCsGAUeqHN2uTx93UUnKHiGg/SkjhTxk0GN0yB7tYc17j8ZiGvZ/c4Wgz34JG5GSMfqb5m4t3GLb+D3tAyszsx7z9NpGS7MgDISQYIjiNe/dh0ntP4qJ3Q0Ybj1eipAjZpm7zWdnTYKISQJd5W5/6eLqhWxWb/pLl818EV/NkjBQSGO8+6EANZtO0Y/LAulAXO2duWL2IYd0LkM3McXf2XGsi9UceZ7pjTCrkrhHYBV0jgrdgcHiaS3qKV5D0EKR0qst3fQSIb1oqnTAghYP6onbOdgVYayl6hTnYeLmQQiseUuKszTK2S6yi0JmEs6dSQbXZjWC9x3DsI51fbepZlOwe+1YMCxhqTsoBZodVE2uTLnhGoJDVBb6Be8HZg7HVHx/4KbKwH7Ft7dNYS8cApty/phRJpNh7uO75YKMhIKwyZtinamPaL1o/vM9/clv/pjuw+8pEoErz8RhGma8MCjSfPASJr2u8y15V+2NXV/cMW1V1/669CGPBlAjRXYlh3p4Lm8Jo3beqQhNzSqE2vKPL/NGLTW9OFK3VCJewKSbC48Oc82Xz2786ci/vcM5zNF9MwrB2xIZwtCIgeE0JK3pfBlSUUabT+H/o2KtwXNxlObL93IA6k9H4igPjPcc5NWXjUIbd6LhQv9je0DwVlYUYcnxSKIGKHNDo2gCFZjiYj9WFjLsH2h/UqlCGRHUoVNHHeIXm7zHJ03bWvz1VnMRlKt8rYHzXnF93PJVnmfFoQEzCsz14EwMzDEHT2OsbNXgAyum2Odqs56tsaoOh1tGm1LJdw9pdzkkuRqUfhflro7Hd1e7uRk82KV7hhQ6yntv/MJbSiZpZG9onuOmuemVcxmHgmQoVz59sfHv6qcuEgd9h/gsitjFaPKd5sQAAAABJRU5ErkJggg==
9340` 9341 const notFoundElement = ` 9342 <div class="br-item not-found"> 9343 <div class="container pl-0 pr-0"> 9344 <div class="row"> 9345 <div class="col-auto"> 9346 <img src="${image}"> 9347 </div> 9348 <div class="col"> 9349 <p><strong>Ops!</strong> Não encontramos o que você está procurando!</p> 9350 </div> 9351 </div> 9352 </div> 9353 </div> 9354 ` 9355 const list = this.component.querySelector('.br-list') 9356 list.insertAdjacentHTML( 9357 'beforeend', 9358 this.notFound ? this.notFound : notFoundElement 9359 ) 9360 } 9361 /** 9362 * Cria listagem de elementos do select 9363 * @private 9364 */ 9365 _setOptionsList() { 9366 this.optionsList = [] 9367 for (const item of this.component.querySelectorAll('.br-list .br-item')) { 9368 for (const input of item.querySelectorAll( 9369 '.br-radio input, .br-checkbox input' 9370 )) { 9371 const option = { 9372 element: item, 9373 focus: false, 9374 inputValue: input.value, 9375 selected: false, 9376 value: input.nextElementSibling.innerText, 9377 visible: true, 9378 } 9379 this.optionsList.push(option) 9380 } 9381 } 9382 } 9383 /** 9384 * Reseta estado da lista 9385 * @private 9386 */ 9387 resetOptionsList() { 9388 this._unsetSelectionBehavior() 9389 this._setOptionsList() 9390 this._setSelectionBehavior() 9391 } 9392 /** 9393 * Define o comportamento do componente 9394 * @private 9395 */ 9396 _setBehavior() { 9397 this._setSearchIcon() 9398 this._setDropdownBehavior() 9399 this._setKeyboardBehavior() 9400 this._setSelectionBehavior() 9401 this._setFilterBehavior() 9402 } 9403 /** 9404 * Define o comportamento de dropdown 9405 * @private 9406 */ 9407 9408 _setDropdownBehavior() { 9409 for (const input of this.component.querySelectorAll( 9410 '.br-input input[type="text"]' 9411 )) { 9412 input.addEventListener('focus', () => { 9413 this._openSelect() 9414 this._resetFocus() 9415 }) 9416 } 9417 for (const trigger of this.component.querySelectorAll( 9418 '.br-input .br-button[data-trigger]' 9419 )) { 9420 trigger.addEventListener('click', () => { 9421 for (const list of this.component.querySelectorAll('.br-list')) { 9422 if (list.hasAttribute('expanded')) { 9423 this._closeSelect() 9424 } else { 9425 this._openSelect() 9426 } 9427 } 9428 }) 9429 } 9430 window.document.addEventListener('click', (event) => { 9431 if (!this.component.contains(event.target)) { 9432 this._closeSelect() 9433 } 9434 }) 9435 } 9436 /** 9437 * Define o comportamento de teclado 9438 * @private 9439 */ 9440 9441 _setKeyboardBehavior() { 9442 for (const input of this.component.querySelectorAll( 9443 '.br-input input[type="text"]' 9444 )) { 9445 input.addEventListener('keydown', this._handleKeydownOnInput.bind(this)) 9446 } 9447 for (const list of this.component.querySelectorAll('.br-list')) { 9448 // eslint-disable-next-line complexity 9449 list.addEventListener('keydown', this._handleKeydownOnList.bind(this)) 9450 } 9451 } 9452 /** 9453 * Retira o comportamento de teclado 9454 * @private 9455 */ 9456 9457 _unsetKeyboardBehavior() { 9458 for (const input of this.component.querySelectorAll( 9459 '.br-input input[type="text"]' 9460 )) { 9461 input.removeEventListener('keydown', this._handleKeydownOnInput, false) 9462 } 9463 for (const list of this.component.querySelectorAll('.br-list')) { 9464 // eslint-disable-next-line complexity 9465 list.addEventListener('keydown', this._handleKeydownOnList.bind(this)) 9466 } 9467 } 9468 9469 /** 9470 * Verifica a navegação 9471 * @param {object} event evento que foi ativado 9472 * @private 9473 */ 9474 _handleKeydownOnInput(event) { 9475 //Close Select 9476 if (event.shiftKey && event.key === 'Tab') { 9477 this._closeSelect() 9478 this._resetFocus() 9479 } 9480 if (event.key === 'Tab' && !event.shiftKey) { 9481 event.target.parentNode.querySelector('.br-button').focus() 9482 } 9483 if (event.keyCode === 40) { 9484 event.preventDefault() 9485 for (const list of this.component.querySelectorAll('.br-list')) { 9486 list.focus() 9487 if (list === document.activeElement) { 9488 this._getNextItem().focus() 9489 } 9490 } 9491 } 9492 } 9493 /**
vendor: 57,970 bytes, lines 9494-11444
9494 * Define comportamentos de teclado na lista 9495 * @private 9496 */ 9497 9498 _handleKeydownOnList(event) { 9499 event.preventDefault() 9500 switch (event.keyCode) { 9501 case 9: 9502 this._closeSelect() 9503 this._resetFocus() 9504 break 9505 case 27: 9506 this._closeSelect() 9507 break 9508 case 32: 9509 this._setKeyClickOnOption(event.currentTarget) 9510 break 9511 case 38: 9512 this._getPreviousItem().focus() 9513 break 9514 case 40: 9515 this._getNextItem().focus() 9516 break 9517 default: 9518 break 9519 } 9520 } 9521 /** 9522 * Define comportamentos de teclado no option 9523 * @private 9524 */ 9525 _setKeyClickOnOption(list) { 9526 for (const [index, item] of list.querySelectorAll('.br-item').entries()) { 9527 if (this.optionsList[index].focus) { 9528 for (const check of item.querySelectorAll( 9529 '.br-radio input[type="radio"], .br-checkbox input[type="checkbox"]' 9530 )) { 9531 check.click() 9532 this._sendEvent() 9533 } 9534 } 9535 } 9536 } 9537 9538 /** 9539 * Envia o evento onchange 9540 * @private 9541 */ 9542 _sendEvent() { 9543 const clickEvent = new CustomEvent('onChange', { 9544 bubbles: true, 9545 detail: this.component, 9546 }) 9547 this.component.dispatchEvent(clickEvent) 9548 } 9549 9550 /** 9551 * preseleciona o elemento apartir da classe css .selected 9552 * @private 9553 */ 9554 _setDefaultSelected() { 9555 const selectedItems = this.component.querySelectorAll('.br-list .selected') 9556 9557 const iterable = typeof selectedItems[Symbol.iterator] 9558 if (selectedItems !== null && iterable === 'function') { 9559 for (const item of selectedItems) { 9560 this._setSelected(this._positionSelected(item), item) 9561 } 9562 } 9563 } 9564 9565 /** 9566 * Retorna posição do elemento no select 9567 * @param {element} component elemento que vai ser pesquisado 9568 * @returns {integer} valor da posição 9569 */ 9570 _positionSelected(component) { 9571 for (const [index, componente] of this.component 9572 .querySelectorAll('.br-list .br-item') 9573 .entries()) { 9574 if (componente === component) { 9575 return index 9576 } 9577 } 9578 return 0 9579 } 9580 /** 9581 * Desfine comportamento do clique no checkbox 9582 * @param {int} index 9583 * @param {object} item - Objeto do item clicado 9584 * @param {object} event - Objeto do evento do clique 9585 * @private 9586 */ 9587 _handleClickOnCheck(index, item, event) { 9588 if (!this.multiple) { 9589 for (const [index2, item2] of this.component 9590 .querySelectorAll('.br-list .br-item') 9591 .entries()) { 9592 this._removeSelected(index2, item2) 9593 } 9594 this._setSelected(index, item) 9595 this._closeSelect() 9596 } else if (event.currentTarget.hasAttribute('checked')) { 9597 this._removeSelected(index, item) 9598 } else { 9599 this._setSelected(index, item) 9600 } 9601 if (item.hasAttribute('data-all')) { 9602 for (const check of item.querySelectorAll( 9603 '.br-checkbox input[type="checkbox"]' 9604 )) { 9605 if (!check.hasAttribute('checked')) { 9606 this._setAttribute() 9607 item.querySelectorAll('label')[0].innerText = 'Selecionar Todos' 9608 } else { 9609 for (const item2 of this.component.querySelectorAll( 9610 '.br-list .br-item' 9611 )) { 9612 for (const check2 of item2.querySelectorAll( 9613 '.br-checkbox input[type="checkbox"]' 9614 )) { 9615 if (!check2.hasAttribute('checked')) { 9616 check2.click() 9617 } 9618 } 9619 } 9620 item.querySelectorAll('label')[0].innerText = 'Deselecionar Todos' 9621 } 9622 } 9623 } 9624 this._sendEvent() 9625 } 9626 /** 9627 * Define comportamentos na seleção 9628 * @private 9629 */ 9630 _setSelectionBehavior() { 9631 this.selectionHandler = [] 9632 this._setDefaultSelected() 9633 for (const [index, item] of this.component 9634 .querySelectorAll('.br-list .br-item') 9635 .entries()) { 9636 for (const check of item.querySelectorAll( 9637 '.br-radio input[type="radio"], .br-checkbox input[type="checkbox"]' 9638 )) { 9639 this.selectionHandler.push({ 9640 element: check, 9641 handler: this._handleClickOnCheck.bind(this, index, item), 9642 }) 9643 check.addEventListener('click', this.selectionHandler[index].handler) 9644 } 9645 } 9646 } 9647 /** 9648 * retira comportamento de clique na seleção 9649 * @private 9650 */ 9651 _unsetSelectionBehavior() { 9652 this.selectionHandler.forEach((item) => { 9653 item.element.removeEventListener('click', item.handler, false) 9654 }) 9655 } 9656 /** 9657 * Define comportamentos no filtro do input 9658 * @private 9659 */ 9660 _setFilterBehavior() { 9661 for (const input of this.component.querySelectorAll( 9662 '.br-input input[type="text"]' 9663 )) { 9664 input.addEventListener('input', (event) => { 9665 let allHidden = true 9666 this._filter(event.currentTarget.value) 9667 for (const option of this.optionsList) { 9668 if (option.visible) { 9669 allHidden = false 9670 } 9671 } 9672 9673 if (allHidden) { 9674 // event.currentTarget.value = event.currentTarget.value.slice(0, -1) 9675 this._filter(event.currentTarget.value) 9676 } 9677 }) 9678 } 9679 } 9680 /** 9681 * Define filtro no list 9682 * @private 9683 */ 9684 _filter(value) { 9685 let hasVisible = false 9686 for (const [index, item] of this.component 9687 .querySelectorAll('.br-list .br-item') 9688 .entries()) { 9689 this._removeNotFoundElement() 9690 if (!this.optionsList[index]) { 9691 continue 9692 } 9693 if ( 9694 this.optionsList[index].value 9695 .toUpperCase() 9696 .indexOf(value.toUpperCase()) === -1 9697 ) { 9698 item.classList.add('d-none') 9699 this.optionsList[index].visible = false 9700 } else { 9701 item.classList.remove('d-none') 9702 this.optionsList[index].visible = true 9703 hasVisible = true 9704 } 9705 } 9706 if (hasVisible === false) { 9707 this._addNotFoundElement() 9708 } 9709 } 9710 /** 9711 * Define atributo checked com click 9712 * @private 9713 */ 9714 _setAttribute() { 9715 for (const item2 of this.component.querySelectorAll('.br-list .br-item')) { 9716 for (const check2 of item2.querySelectorAll( 9717 '.br-checkbox input[type="checkbox"]' 9718 )) { 9719 if (check2.hasAttribute('checked')) { 9720 check2.click() 9721 } 9722 } 9723 } 9724 } 9725 9726 /** 9727 * Seleciona o elemento e retira checked dos outros elementos 9728 * @param {integer} index Posição do elemento na lista 9729 * @param {*} item elemento em que vai ser selecionado 9730 * @private 9731 */ 9732 _setSelected(index, item) { 9733 item.classList.add('selected') 9734 for (const check of item.querySelectorAll('.br-radio, .br-checkbox')) { 9735 for (const input of check.querySelectorAll( 9736 'input[type="radio"], input[type="checkbox"]' 9737 )) { 9738 input.setAttribute('checked', '') 9739 } 9740 } 9741 this.optionsList[index].selected = true 9742 this._setInput() 9743 } 9744 9745 /** 9746 * Retira o estado selecionado do elemento 9747 * @param {integer} index Posição do elemento na lista 9748 * @param {*} item elemento em que vai ser desselecionado 9749 * @private 9750 */ 9751 _removeSelected(index, item) { 9752 item.classList.remove('selected') 9753 for (const check of item.querySelectorAll('.br-radio, .br-checkbox')) { 9754 for (const input of check.querySelectorAll( 9755 'input[type="radio"], input[type="checkbox"' 9756 )) { 9757 input.removeAttribute('checked') 9758 } 9759 this.optionsList[index].selected = false 9760 this._setInput() 9761 } 9762 } 9763 /** 9764 * Determina o input 9765 * @private 9766 */ 9767 _setInput() { 9768 for (const input of this.component.querySelectorAll( 9769 '.br-input input[type="text"]' 9770 )) { 9771 if (!this.multiple) { 9772 input.value = this.selected 9773 } else if (this.selected.length === 0) { 9774 input.value = '' 9775 } else { 9776 this.mountSelectedValues(input) 9777 } 9778 } 9779 } 9780 /** 9781 * Monta a string apresentada no campo input do multiselect 9782 * @param {object} input Referencia o elemento input do select 9783 */ 9784 mountSelectedValues(input) { 9785 const GAP = 0.4 9786 let amount = 1 9787 let value = this.selected.toString().replaceAll(',', ', ') 9788 const tempSpan = document.createElement('span') 9789 tempSpan.innerHTML = value 9790 document.querySelector('body').insertAdjacentElement('beforeend', tempSpan) 9791 9792 while (tempSpan.offsetWidth > input.offsetWidth - input.offsetWidth * GAP) { 9793 value = this.selected 9794 .slice(0, this.selected.length - amount) 9795 .toString() 9796 .replaceAll(',', ', ') 9797 .concat(` + (${amount})`) 9798 tempSpan.innerHTML = value 9799 amount++ 9800 } 9801 input.value = value 9802 9803 tempSpan.remove() 9804 } 9805 /** 9806 * Retorna elemento posterior ao focado 9807 * @returns {object} 9808 * @private 9809 */ 9810 // eslint-disable-next-line complexity 9811 _getNextItem() { 9812 const list = this.component.querySelectorAll('.br-list .br-item') 9813 let iFocused 9814 let iVisible 9815 for (iFocused = 0; iFocused < this.optionsList.length; iFocused++) { 9816 if (this.optionsList[iFocused].focus) { 9817 for ( 9818 iVisible = iFocused + 1; 9819 iVisible < this.optionsList.length; 9820 iVisible++ 9821 ) { 9822 if (this.optionsList[iVisible].visible) { 9823 break 9824 } 9825 } 9826 break 9827 } 9828 } 9829 if (iFocused === this.optionsList.length) { 9830 for (const [index, option] of this.optionsList.entries()) { 9831 if (option.visible) { 9832 option.focus = true 9833 return list[index] 9834 } 9835 } 9836 } else if (iVisible < this.optionsList.length) { 9837 this.optionsList[iFocused].focus = false 9838 this.optionsList[iVisible].focus = true 9839 return list[iVisible] 9840 } else { 9841 return list[iFocused] 9842 } 9843 return '' 9844 } 9845 /** 9846 * Retorna elemento anterior ao focado 9847 * @returns {object} 9848 * @private 9849 */ 9850 _getPreviousItem() { 9851 const list = this.component.querySelectorAll('.br-list .br-item') 9852 let iFocused 9853 let iVisible 9854 for (iFocused = 0; iFocused < this.optionsList.length; iFocused++) { 9855 if (this.optionsList[iFocused].focus) { 9856 for (iVisible = iFocused - 1; iVisible > 0; iVisible--) { 9857 if (this.optionsList[iVisible].visible) { 9858 break 9859 } 9860 } 9861 break 9862 } 9863 } 9864 if (iFocused === 0) { 9865 return list[iFocused] 9866 } else { 9867 this.optionsList[iFocused].focus = false 9868 this.optionsList[iVisible].focus = true 9869 return list[iVisible] 9870 } 9871 } 9872 /** 9873 * Reseta valor do input 9874 * @private 9875 */ 9876 _resetInput() { 9877 for (const input of this.component.querySelectorAll( 9878 '.br-input input[type="text"]' 9879 )) { 9880 input.value = '' 9881 } 9882 } 9883 /** 9884 * Reseta o focus dos elementos 9885 * @private 9886 */ 9887 _resetFocus() { 9888 for (const option of this.optionsList) { 9889 option.focus = false 9890 } 9891 } 9892 /** 9893 * Reseta o focus dos elementos visiveis 9894 * @private 9895 */ 9896 9897 _resetVisible() { 9898 const list = this.component.querySelectorAll('.br-list .br-item') 9899 for (const [index, option] of this.optionsList.entries()) { 9900 option.visible = true 9901 list[index].classList.remove('d-none') 9902 } 9903 } 9904 /** 9905 * Abre o select aberto 9906 * @private 9907 */ 9908 _openSelect() { 9909 for (const list of this.component.querySelectorAll('.br-list')) { 9910 list.setAttribute('expanded', '') 9911 } 9912 for (const icon of this.component.querySelectorAll( 9913 '.br-input .br-button i' 9914 )) { 9915 icon.classList.remove('fa-angle-down') 9916 icon.classList.add('fa-angle-up') 9917 } 9918 this._resetInput() 9919 } 9920 /** 9921 * Fecha o select aberto 9922 * @private 9923 */ 9924 _closeSelect() { 9925 for (const list of this.component.querySelectorAll('.br-list')) { 9926 list.removeAttribute('expanded') 9927 } 9928 for (const icon of this.component.querySelectorAll( 9929 '.br-input .br-button i' 9930 )) { 9931 icon.classList.remove('fa-angle-up') 9932 icon.classList.add('fa-angle-down') 9933 } 9934 this._setInput() 9935 this._resetFocus() 9936 this._resetVisible() 9937 } 9938 /** 9939 * Adiciona Ãcone de busca 9940 * @private 9941 */ 9942 _setSearchIcon() { 9943 const brInput = this.component.querySelector('.br-input') 9944 const dropButton = this.component.querySelector('[data-trigger]') 9945 // Ãcone de busca 9946 const searchIcon = document.createElement('i') 9947 searchIcon.classList.add('fas', 'fa-search') 9948 searchIcon.setAttribute('aria-hidden', 'true') 9949 // Container para o Ãcone 9950 const inputIcon = document.createElement('div') 9951 inputIcon.classList.add('input-icon') 9952 inputIcon.appendChild(searchIcon) 9953 // Estrutura para input com Ãcone 9954 const inputGroup = document.createElement('div') 9955 inputGroup.classList.add('input-group') 9956 inputGroup.appendChild(inputIcon) 9957 inputGroup.appendChild(brInput.querySelector('input')) 9958 brInput.appendChild(inputGroup) 9959 brInput.appendChild(dropButton) 9960 } 9961} 9962 9963/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRSelect); 9964 9965 9966/***/ }), 9967 9968/***/ "./src/components/step/step.js": 9969/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 9970 9971"use strict"; 9972/* harmony export */ __webpack_require__.d(__webpack_exports__, { 9973/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 9974/* harmony export */ }); 9975/** Classe para instanciar um objeto BRStep */ 9976class BRStep { 9977 constructor(name, component) { 9978 /** 9979 * Instancia do componente 9980 * @param {string} name - Nome do componente em minúsculo 9981 * @param {object} component - Objeto referenciando a raiz do componente DOM 9982 * @property {number} activeStepNum - Número do palco ativo 9983 * @property {array} DOMStrings - instancia dos elementos internos do componente 9984 */ 9985 this.name = name 9986 this.component = component 9987 this.activeStepNum = 0 9988 this.DOMstrings = { 9989 // stepsBar: this.component.querySelector('.step-progress'), 9990 stepsBar: this.component, 9991 stepsBarClass: 'step-progress', 9992 stepsBtnClass: 'step-progress-btn', 9993 stepsBtns: this.component.querySelectorAll('.step-progress-btn'), 9994 } 9995 9996 /** 9997 * Remove uma classe css de uma lista de elementos 9998 * @param {object} elemSet - Lista de elementos 9999 * @param {string} button - Nome do atributo 10000 */ 10001 this.removeAttributes = (elemSet, attrName) => { 10002 elemSet.forEach((elem) => { 10003 elem.removeAttribute(attrName) 10004 }) 10005 } 10006 10007 /** 10008 * Retorna o nó pai do elemento com o nome da classe especÃfica 10009 * @param {object} elem - Referência ao elemento 10010 * @param {string} parentClass - Nome da classe pai 10011 * @returns {object} Referência ao elemento pai 10012 */ 10013 this.findParent = (elem, parentClass) => { 10014 let currentNode = elem 10015 while (!currentNode.classList.contains(parentClass)) { 10016 currentNode = currentNode.parentNode 10017 } 10018 return currentNode 10019 } 10020 10021 /** Retorna o número do passo de referencia 10022 * @param {object} elem - Referência ao botão de passo 10023 * @returns {number} Número do passo 10024 */ 10025 this.getActiveStep = (elem) => { 10026 return Array.from(this.DOMstrings.stepsBtns).indexOf(elem) 10027 } 10028 10029 /** Define o número do passo de referência como ativo 10030 * @param {number} num - numero do passo de referência 10031 */ 10032 this.setActiveStep = function (num) { 10033 this.removeAttributes(this.DOMstrings.stepsBtns, 'active') 10034 this.DOMstrings.stepsBtns.forEach((elem, index) => { 10035 if (index === num) { 10036 elem.removeAttribute('disabled') 10037 elem.setAttribute('active', '') 10038 } 10039 }) 10040 this.activeStepNum = num 10041 } 10042 10043 /** 10044 * Mostra os números dos rótulos dos passos 10045 */ 10046 this.setStepsNum = () => { 10047 this.DOMstrings.stepsBtns.forEach((elem, index) => { 10048 const img = elem.querySelector('.step-icon') 10049 const text = this.component.getAttribute('data-type') === 'text' 10050 if (text) { 10051 elem.setAttribute( 10052 'step-num', 10053 `${index + 1}/${this.DOMstrings.stepsBtns.length}` 10054 ) 10055 } else if (img) { 10056 elem.setAttribute('step-num', '') 10057 } else elem.setAttribute('step-num', index + 1) 10058 }) 10059 } 10060 10061 /** Testa se o passo está dentro do escopo e o define como ativo 10062 * @param {number} num - step number 10063 */ 10064 this.setStep = (num) => { 10065 const activeStep = num <= this.DOMstrings.stepsBtns.length ? num - 1 : 0 10066 this.setActiveStep(activeStep) 10067 } 10068 10069 this._setBehavior() 10070 } 10071 10072 /** 10073 * Define comportamentos do componente 10074 * @private 10075 */ 10076 _setBehavior() { 10077 this.DOMstrings.stepsBar.addEventListener('click', (e) => { 10078 const eventTarget = e.target 10079 if (!eventTarget.classList.contains(`${this.DOMstrings.stepsBtnClass}`)) { 10080 e.target.parentNode.click() 10081 return 10082 } 10083 const activeStepNum = this.getActiveStep(eventTarget) 10084 this.setActiveStep(activeStepNum) 10085 }) 10086 10087 this.setStepsNum() 10088 if (this.component.hasAttribute('data-initial')) { 10089 this.setStep(this.component.getAttribute('data-initial')) 10090 } else this.setStep(1) 10091 10092 if ( 10093 !this.component.classList.contains('vertical') && 10094 !this.component.hasAttribute('data-scroll') 10095 ) { 10096 // const stepsWidth = Math.round(100 / this.DOMstrings.stepsBtns.length) - 0.5 10097 } 10098 } 10099} 10100 10101/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRStep); 10102 10103 10104/***/ }), 10105 10106/***/ "./src/components/tab/tab.js": 10107/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 10108 10109"use strict"; 10110/* harmony export */ __webpack_require__.d(__webpack_exports__, { 10111/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 10112/* harmony export */ }); 10113/** Classe para instanciar um objeto BRTab*/ 10114 10115class BRTab { 10116 /** 10117 * Instancia do objeto 10118 * @param {string} name - Nome do componente em minúsculo 10119 * @param {object} component - Objeto referenciando a raiz do componente DOM 10120 */ 10121 constructor(name, component) { 10122 this.name = name 10123 this.component = component 10124 this._setBehavior() 10125 } 10126 10127 /** 10128 * Define comportamentos do componente 10129 * @private 10130 */ 10131 _setBehavior() { 10132 for (const ancor of this.component.querySelectorAll('.tab-nav')) { 10133 this.height = ancor.clientHeight 10134 this.scollsizes = ancor.scrollHeight - ancor.clientHeight 10135 10136 this.scrollHeight = Math.max( 10137 this.component.scrollWidth, 10138 document.documentElement.scrollWidth, 10139 this.component.offsetWidth, 10140 document.documentElement.offsetWidth, 10141 this.component.clientWidth, 10142 document.documentElement.clientWidth 10143 ) 10144 this.leftPosition = this.component.offsetWidth - 1 10145 // debugger 10146 ancor.style.setProperty('--height-nav', `${this.height}px`) 10147 ancor.style.setProperty('--right-gradient-nav', `${this.leftPosition}px`) 10148 10149 this.positionScroll(ancor) 10150 10151 this.navigationRight = this.navigationRight + 4 10152 10153 if (this.navigationRight <= this.lastItempos - 5) { 10154 ancor.classList.add('tab-nav-right') 10155 } 10156 10157 ancor.onscroll = () => { 10158 this.positionScroll(ancor) 10159 10160 if (this.navigationLeft <= 0) { 10161 ancor.classList.add('tab-nav-left') 10162 } else { 10163 ancor.classList.remove('tab-nav-left') 10164 } 10165 10166 if (this.navigationRight <= this.lastItempos - 5) { 10167 ancor.classList.add('tab-nav-right') 10168 } else { 10169 ancor.classList.remove('tab-nav-right') 10170 } 10171 } 10172 } 10173 10174 for (const ancor of this.component.querySelectorAll( 10175 '.tab-nav .tab-item:not([not-tab="true"]) button' 10176 )) { 10177 ancor.addEventListener( 10178 'click', 10179 (event) => { 10180 this._switchTab(event.currentTarget.parentElement) 10181 this._switchContent(event.currentTarget.parentElement) 10182 }, 10183 false 10184 ) 10185 ancor.addEventListener('keyup', (e) => { 10186 e.preventDefault() 10187 this.positionKeyboard(e) 10188 }) 10189 10190 ancor.addEventListener('blur', () => { 10191 this.hiddenTooltips() 10192 }) 10193 } 10194 this.tabitems = this.component.querySelectorAll('tab-item') 10195 } 10196 10197 /** 10198 * Mapeia as teclas pressionadas 10199 * @param {event} event - evento que disparou a ação 10200 */ 10201 positionKeyboard(event) { 10202 const keys = { 10203 end: 35, 10204 home: 36, 10205 left: 37, 10206 right: 39, 10207 space: 32, 10208 tab: 9, 10209 } 10210 const key = event.keyCode 10211 this.tabitems = this.component.querySelectorAll('.tab-item') 10212 this.buttons = this.component.querySelectorAll('button') 10213 10214 switch (key) { 10215 case keys.end: 10216 event.preventDefault() 10217 this.clean() 10218 this._switchTab(this.tabitems[this.tabitems.length - 1]) 10219 this._switchContent(this.tabitems[this.tabitems.length - 1]) 10220 this.tabitems[this.tabitems.length - 1].focus() 10221 break 10222 case keys.home: 10223 event.preventDefault() 10224 this.clean() 10225 this._switchTab(this.tabitems[0]) 10226 this._switchContent(this.tabitems[0]) 10227 this.tabitems[0].focus() 10228 event.stopPropagation() 10229 break 10230 case keys.left: 10231 event.preventDefault() 10232 this.position(event.target, -1) 10233 event.stopPropagation() 10234 break 10235 case keys.right: 10236 event.preventDefault() 10237 this.position(event.target, 1) 10238 event.stopPropagation() 10239 break 10240 case keys.tab: 10241 event.preventDefault() 10242 this.position(event.target, 0) 10243 event.stopPropagation() 10244 break 10245 case 32: 10246 event.preventDefault() 10247 this.hiddenTooltips() 10248 event.target.click() 10249 10250 event.stopPropagation() 10251 break 10252 default: 10253 break 10254 } 10255 } 10256 10257 /** 10258 * Esconde todos tooltip 10259 * 10260 */ 10261 hiddenTooltips() { 10262 const tooltips = document.querySelectorAll('.br-tooltip') 10263 10264 tooltips.forEach((element) => { 10265 element.hidden = true 10266 element.style.visbility = 'hidden' 10267 element.removeAttribute('data-show') 10268 }) 10269 } 10270 10271 /** 10272 * Define o deslocamento da posição ativa 10273 * @property {object} target - referencia ao objeto DOM 10274 * @property {number} direction - incremento à posição 10275 */ 10276 positionActive(target, direction) { 10277 let contComponent = 0 10278 let contComponentActive = 0 10279 10280 const tabItems2 = 10281 target.parentElement.parentElement.querySelectorAll('.tab-item') 10282 for (const component of tabItems2) { 10283 if ( 10284 component.classList.contains('is-active') || 10285 component.classList.contains('active') 10286 ) { 10287 contComponentActive = contComponent 10288 } 10289 contComponent += 1 10290 } 10291 if ( 10292 tabItems2.length > contComponentActive + direction && 10293 contComponentActive + direction >= 0 10294 ) { 10295 this._switchTab(tabItems2[contComponentActive + direction]) 10296 tabItems2[contComponentActive + direction].focus() 10297 let x = '' 10298 if (tabItems2[contComponentActive + direction].querySelector('button')) { 10299 x = tabItems2[contComponentActive + direction].querySelector('button') 10300 x.focus() 10301 } 10302 } 10303 } 10304 10305 /** 10306 * Define o deslocamento da posição ativa do tab-item interno 10307 * @property {object} target - referencia ao objeto DOM 10308 * @property {number} direction - incremento à posição 10309 */ 10310 position(target, direction) { 10311 this.positionQuery(target, direction, '.tab-item') 10312 } 10313 10314 /** 10315 * Define o deslocamento da posição ativa do elemento referenciado 10316 * @property {object} target - referencia ao objeto DOM 10317 * @property {number} direction - incremento à posição 10318 * @property {string} query - string de referencia 10319 */ 10320 positionQuery(target, direction, query) { 10321 let contComponent = 0 10322 // const contComponentActive = 0 10323 let contComponentFocus = 0 10324 const tabItems2 = target.parentElement.parentElement.querySelectorAll(query) 10325 for (const component of tabItems2) { 10326 if (component.querySelector('.focus-visible')) { 10327 contComponentFocus = contComponent 10328 } 10329 contComponent += 1 10330 } 10331 tabItems2[contComponentFocus + direction].querySelector('button').focus() 10332 if ( 10333 tabItems2.length > contComponentFocus + direction && 10334 contComponentFocus + direction >= 0 10335 ) { 10336 if (tabItems2[contComponentFocus + direction].querySelector('button')) { 10337 tabItems2[contComponentFocus + direction] 10338 .querySelector('button') 10339 .focus() 10340 } 10341 } 10342 } 10343 10344 /** 10345 * Define a posição ativa do elemento referenciado 10346 * @property {object} target - referencia ao objeto DOM 10347 */ 10348 setPosition(target) { 10349 let contComponent = 0 10350 let contComponentActive = 0 10351 10352 const tabItems2 = 10353 target.parentElement.parentElement.querySelectorAll('.tab-item') 10354 for (const component of tabItems2) { 10355 if ( 10356 component.classList.contains('is-active') || 10357 component.classList.contains('active') 10358 ) { 10359 contComponentActive = contComponent 10360 } 10361 contComponent += 1 10362 } 10363 if (tabItems2.length > contComponentActive && contComponentActive >= 0) { 10364 this.clean() 10365 this._switchContent(tabItems2[contComponentActive]) 10366 } 10367 } 10368 10369 /** 10370 * Reinicia estados 10371 */ 10372 clean() { 10373 for (const ancor of event.currentTarget.parentElement.querySelectorAll( 10374 'button' 10375 )) { 10376 ancor.classList.remove('focus-visible') 10377 ancor.classList.remove('is-active') 10378 ancor.classList.remove('active') 10379 } 10380 for (const ancor of event.currentTarget.parentElement.querySelectorAll( 10381 'tab-item' 10382 )) { 10383 ancor.classList.remove('is-active') 10384 ancor.classList.remove('active') 10385 } 10386 } 10387 10388 /** 10389 * Realiza rolagem até a âncora 10390 * @property {object} ancor - referencia ao objeto DOM 10391 */ 10392 positionScroll(ancor) { 10393 this.navItems = ancor.querySelectorAll('.tab-item') 10394 this.lastItempos = Math.ceil( 10395 this.navItems[this.navItems.length - 1].getBoundingClientRect().right 10396 ) 10397 this.navigationLeft = Math.floor( 10398 this.navItems[0].getBoundingClientRect().left 10399 ) 10400 this.navigationRight = Math.floor(ancor.getBoundingClientRect().right) 10401 } 10402 10403 /** 10404 * Muda para a aba referenciada 10405 * @property {object} currentTab - referencia ao objeto DOM 10406 */ 10407 _switchTab(currentTab) { 10408 for (const tabItem of this.component.querySelectorAll( 10409 '.tab-nav .tab-item:not([not-tab="true"])' 10410 )) { 10411 if (tabItem === currentTab) { 10412 tabItem.classList.add('active') 10413 } else { 10414 tabItem.classList.remove('is-active') 10415 tabItem.classList.remove('active') 10416 } 10417 } 10418 } 10419 10420 /** 10421 * Muda para o conteudo da aba referenciada 10422 * @property {object} currentTab - referencia ao objeto DOM 10423 */ 10424 _switchContent(currentTab) { 10425 for (const button of currentTab.querySelectorAll('button')) { 10426 for (const tabPanel of this.component.querySelectorAll( 10427 '.tab-content .tab-panel' 10428 )) { 10429 if ( 10430 button.getAttribute('data-panel') === tabPanel.getAttribute('id') || 10431 button.getAttribute('data-target') === tabPanel.getAttribute('id') 10432 ) { 10433 tabPanel.classList.add('active') 10434 } else { 10435 tabPanel.classList.remove('is-active') 10436 tabPanel.classList.remove('active') 10437 } 10438 } 10439 } 10440 } 10441} 10442 10443/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRTab); 10444 10445 10446/***/ }), 10447 10448/***/ "./src/components/table/table.js": 10449/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 10450 10451"use strict"; 10452/* harmony export */ __webpack_require__.d(__webpack_exports__, { 10453/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 10454/* harmony export */ }); 10455/* harmony import */ var _partial_js_behavior_collapse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/partial/js/behavior/collapse.js"); 10456/* harmony import */ var _partial_js_behavior_dropdown__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/partial/js/behavior/dropdown.js"); 10457 10458 10459 10460/** Classe para instanciar um objeto BRTable*/ 10461/* eslint-disable complexity */ 10462class BRTable { 10463 /** 10464 * Instancia do objeto 10465 * @param {string} name - Nome do componente em minúsculo 10466 * @param {object} component - Objeto referenciando a raiz do componente DOM 10467 * @param {number} sequence - 'Ãndice do componente para sobreposição' 10468 */ 10469 constructor(name, component, sequence) { 10470 this.name = name 10471 this.component = component 10472 this._header = this.component.querySelector('.header, .table-header') 10473 this._table = this.component.querySelector('table') 10474 this._sequence = sequence 10475 this._setBehaviors() 10476 } 10477 10478 /** 10479 * Define comportamentos do componente 10480 * @private 10481 */ 10482 _setBehaviors() { 10483 this._makeResponsiveTable() 10484 this._setHeaderWidth() 10485 this._searchBehavior() 10486 this._dropdownBehavior() 10487 this._collpaseBehavior() 10488 this._densityBehavior() 10489 this._setClickActions() 10490 this._getBRHeaderHeight() 10491 } 10492 10493 /** 10494 * Configura a altura do cabeçalho 10495 * @private 10496 */ 10497 _getBRHeaderHeight() { 10498 const BRHeader = document.querySelector('.br-header') 10499 if (BRHeader) { 10500 window.addEventListener('scroll', () => { 10501 this._header.style.top = `${BRHeader.clientHeight}px` 10502 }) 10503 } 10504 } 10505 10506 /** 10507 * Configura reponsividade da tabela 10508 * @private 10509 */ 10510 _makeResponsiveTable() { 10511 const responsiveClass = 'responsive' 10512 if (!this.component.querySelector(`.${responsiveClass}`)) { 10513 const responsiveElement = document.createElement('div') 10514 responsiveElement.classList.add(responsiveClass) 10515 responsiveElement.appendChild(this._table) 10516 this._header.after(responsiveElement) 10517 } 10518 } 10519 10520 /** 10521 * Configura rolagem 10522 * @private 10523 */ 10524 _makeScroller() { 10525 const scrollerTag = document.createElement('div') 10526 scrollerTag.classList.add('scroller') 10527 for (const header of this._table.querySelectorAll('thead tr th')) { 10528 const clonedHeader = document.createElement('div') 10529 clonedHeader.classList.add('item') 10530 clonedHeader.innerHTML = header.innerHTML 10531 if (header.offsetWidth) { 10532 clonedHeader.style.flex = `1 0 ${header.offsetWidth}px` 10533 } 10534 scrollerTag.appendChild(clonedHeader) 10535 const checkbox = clonedHeader.querySelector('.br-checkbox') 10536 if (checkbox) { 10537 const input = checkbox.querySelector('input') 10538 const label = checkbox.querySelector('label') 10539 input.id = `${input.id}-clone` 10540 label.setAttribute('for', input.id) 10541 } 10542 } 10543 return scrollerTag 10544 } 10545 10546 /** 10547 * Configura largura do cabeçalho 10548 * @private 10549 */ 10550 _setHeaderWidth() { 10551 for (const clonedHeader of this.component.querySelectorAll( 10552 '.headers > div' 10553 )) { 10554 for (const [index, header] of this.component 10555 .querySelectorAll('table thead tr th') 10556 .entries()) { 10557 clonedHeader.children[index].style.flex = `1 0 ${header.offsetWidth}px` 10558 } 10559 } 10560 } 10561 10562 /** 10563 * Configura coportamento do dropdown 10564 * @private 10565 */ 10566 _dropdownBehavior() { 10567 this.component 10568 .querySelectorAll('[data-toggle="dropdown"]') 10569 .forEach((trigger) => { 10570 const config = { 10571 iconToHide: 'fa-chevron-up', 10572 iconToShow: 'fa-chevron-down', 10573 trigger, 10574 useIcons: true, 10575 } 10576 const dropdown = new _partial_js_behavior_dropdown__WEBPACK_IMPORTED_MODULE_0__["default"](config) 10577 dropdown.setBehavior() 10578 }) 10579 } 10580 10581 /** 10582 * Configura comportamento de colapsar 10583 * @private 10584 */ 10585 _collpaseBehavior() { 10586 this.component 10587 .querySelectorAll('[data-toggle="collapse"]') 10588 .forEach((trigger) => { 10589 const config = { 10590 iconToHide: 'fa-chevron-up', 10591 iconToShow: 'fa-chevron-down', 10592 trigger, 10593 useIcons: true, 10594 } 10595 const collapse = new _partial_js_behavior_collapse__WEBPACK_IMPORTED_MODULE_1__["default"](config) 10596 collapse.setBehavior() 10597 }) 10598 } 10599 10600 /** 10601 * Configura comportamento da busca 10602 * @private 10603 */ 10604 _searchBehavior() { 10605 if (this.component.dataset.search) { 10606 const trigger = this.component.querySelector('[data-toggle="search"]') 10607 const target = this.component.querySelector('.search-bar') 10608 const dismiss = this.component.querySelector('[data-dismiss="search"]') 10609 10610 // Inicializar 10611 this._searchInit(trigger) 10612 10613 // Abre busca 10614 trigger.addEventListener('click', () => { 10615 return this._searchOpen(trigger, target) 10616 }) 10617 10618 // Fecha busca 10619 dismiss.addEventListener('click', () => { 10620 return this._searchClose(trigger, target) 10621 }) 10622 target.querySelector('input').addEventListener('keydown', (event) => { 10623 if (event.key === 'Escape') { 10624 this._searchClose(trigger, target) 10625 } 10626 }) 10627 } 10628 } 10629 10630 /** 10631 * Inicializa a busca 10632 * @private 10633 * @param {object} trigger - Objeto referente ao elemento que dispara a ação 10634 */ 10635 _searchInit(trigger) { 10636 trigger.setAttribute('aria-expanded', 'false') 10637 } 10638 10639 /** 10640 * Abre a busca 10641 * @private 10642 * @param {object} trigger - Objeto referente ao elemento que dispara a ação 10643 * @param {object} target - Objeto referente ao alvo da ação 10644 */ 10645 _searchOpen(trigger, target) { 10646 trigger.setAttribute('aria-expanded', 'true') 10647 target.classList.add('show') 10648 target.parentElement.classList.add('show') 10649 target.querySelector('input').focus() 10650 } 10651 10652 /** 10653 * Fecha a busca 10654 * @private 10655 * @param {object} trigger - Objeto referente ao elemento que dispara a ação 10656 * @param {object} target - Objeto referente ao alvo da ação 10657 */ 10658 _searchClose(trigger, target) { 10659 target.querySelector('input').value = '' 10660 target.classList.remove('show') 10661 target.parentElement.classList.remove('show') 10662 trigger.focus() 10663 trigger.setAttribute('aria-expanded', 'false') 10664 } 10665 10666 /** 10667 * Configura densidades 10668 * @private 10669 */ 10670 _densityBehavior() { 10671 const desityTriggers = this.component.querySelectorAll('[data-density]') 10672 for (const desityTrigger of desityTriggers) { 10673 desityTrigger.addEventListener('click', () => { 10674 this.component.classList.remove('small', 'medium', 'large') 10675 this.component.classList.add(desityTrigger.dataset.density) 10676 this._dropdownClose( 10677 desityTrigger 10678 .closest('.dropdown') 10679 .querySelector('[data-toggle="dropdown"]') 10680 ) 10681 }) 10682 } 10683 } 10684 10685 /** 10686 * Configura ações de clique 10687 * @private 10688 */ 10689 _setClickActions() { 10690 const headerCheckbox = this.component.querySelector( 10691 '.headers [type="checkbox"]' 10692 ) 10693 const tableCheckboxes = this.component.querySelectorAll( 10694 'tbody [type="checkbox"]' 10695 ) 10696 const selectedBar = this.component.querySelector('.selected-bar') 10697 const checkAlls = this.component.querySelectorAll( 10698 '[data-toggle="check-all"]' 10699 ) 10700 for (const checkAll of checkAlls) { 10701 checkAll.addEventListener('click', () => { 10702 this._checkAllTable(selectedBar, tableCheckboxes, headerCheckbox) 10703 if (checkAll.parentElement.classList.contains('br-list')) { 10704 this._dropdownClose( 10705 checkAll 10706 .closest('.dropdown') 10707 .querySelector('[data-toggle="dropdown"]') 10708 ) 10709 } 10710 }) 10711 } 10712 if (tableCheckboxes) { 10713 for (const checkbox of tableCheckboxes) { 10714 checkbox.addEventListener('change', () => { 10715 this._checkRow(checkbox, selectedBar, tableCheckboxes, headerCheckbox) 10716 }) 10717 } 10718 } 10719 } 10720 10721 /** 10722 * Configura seleção da linha 10723 * @private 10724 * @param {object} checkbox - Objeto referente ao checkbox 10725 * @param {boolean} check - define se a linha deve ser selecionada 10726 */ 10727 _setRow(checkbox, check) { 10728 const tr = checkbox.parentNode.parentNode.parentNode 10729 if (check) { 10730 tr.classList.add('is-selected') 10731 checkbox.parentNode.classList.add('is-inverted') 10732 checkbox.checked = true 10733 } else { 10734 tr.classList.remove('is-selected') 10735 checkbox.parentNode.classList.remove('is-inverted') 10736 checkbox.checked = false 10737 } 10738 } 10739 10740 /** 10741 * Configura seleção da linha 10742 * @private 10743 * @param {object} checkbox - Objeto referente ao checkbox 10744 * @param {object} selectedBar - Objeto referente a barra contextual 10745 * @param {object} tableCheckboxes - Objeto referente a lista de checkboxes 10746 * @param {object} headerCheckbox - Objeto referente ao checkbox do header 10747 */ 10748 _checkRow(checkbox, selectedBar, tableCheckboxes, headerCheckbox) { 10749 const check = checkbox.checked 10750 this._setRow(checkbox, check) 10751 this._setSelectedBar( 10752 check ? 1 : -1, 10753 selectedBar, 10754 tableCheckboxes, 10755 headerCheckbox 10756 ) 10757 } 10758 10759 /** 10760 * Seleciona todas as linhas 10761 * @private 10762 * @param {object} tableCheckboxes - Objeto referente a lista de checkboxes 10763 */ 10764 _checkAllRows(tableCheckboxes) { 10765 for (const checkbox of tableCheckboxes) { 10766 this._setRow(checkbox, true) 10767 } 10768 } 10769 10770 /** 10771 * Desseleciona todas as linhas 10772 * @private 10773 * @param {object} tableCheckboxes - Objeto referente a lista de checkboxes 10774 */ 10775 _uncheckAllRows(tableCheckboxes) { 10776 for (const checkbox of tableCheckboxes) { 10777 this._setRow(checkbox, false) 10778 } 10779 } 10780 10781 /** 10782 * Seleciona toda a tabela 10783 * @private 10784 * @param {object} selectedBar - Objeto referente a barra contextual 10785 * @param {object} tableCheckboxes - Objeto referente a lista de checkboxes 10786 * @param {object} headerCheckbox - Objeto referente ao checkbox do header 10787 */ 10788 _checkAllTable(selectedBar, tableCheckboxes, headerCheckbox) { 10789 let count = tableCheckboxes.length 10790 const infoCount = selectedBar.querySelector('.info .count') 10791 const total = parseInt(infoCount.innerHTML, 10) 10792 if (total === count) { 10793 this._uncheckAllRows(tableCheckboxes) 10794 count = -1 * count 10795 } else { 10796 this._checkAllRows(tableCheckboxes) 10797 } 10798 this._setSelectedBar(count, selectedBar, tableCheckboxes, headerCheckbox) 10799 } 10800 10801 /** 10802 * Define visualização dos itens selecionados na barra contextual 10803 * @private 10804 * @param {number} count - número de itens selecionados 10805 * @param {object} selectedBar - Objeto referente a barra contextual 10806 * @param {object} tableCheckboxes - Objeto referente a lista de checkboxes 10807 * @param {object} headerCheckbox - Objeto referente ao checkbox do header 10808 */ 10809 _setSelectedBar(count, selectedBar, tableCheckboxes, headerCheckbox) { 10810 const infoCount = selectedBar.querySelector('.info .count') 10811 const infoText = selectedBar.querySelector('.info .text') 10812 const total = count < 2 ? parseInt(infoCount.innerHTML, 10) + count : count 10813 if (total > 0) { 10814 selectedBar.classList.add('show') 10815 infoCount.innerHTML = total 10816 infoText.innerHTML = total > 1 ? 'itens selecionados' : 'item selecionado' 10817 if (headerCheckbox) headerCheckbox.parentNode.classList.add('is-checking') 10818 if (total === tableCheckboxes.length) { 10819 if (headerCheckbox) { 10820 headerCheckbox.checked = true 10821 headerCheckbox.parentNode.classList.remove('is-checking') 10822 } 10823 } 10824 } else { 10825 infoCount.innerHTML = 0 10826 if (headerCheckbox) { 10827 headerCheckbox.checked = false 10828 headerCheckbox.parentNode.classList.remove('is-checking') 10829 } 10830 selectedBar.classList.remove('show') 10831 } 10832 } 10833} 10834 10835/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRTable); 10836 10837 10838/***/ }), 10839 10840/***/ "./src/components/tag/tag.js": 10841/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 10842 10843"use strict"; 10844/* harmony export */ __webpack_require__.d(__webpack_exports__, { 10845/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 10846/* harmony export */ }); 10847/** Classe para instanciar um objeto BRTag*/ 10848class BRTag { 10849 /** 10850 * Instancia do objeto 10851 * @param {string} name - Nome do componente em minúsculo 10852 * @param {object} component - Objeto referenciando a raiz do componente DOM 10853 */ 10854 constructor(name, component) { 10855 this.name = name 10856 this.component = component 10857 this._setBehavior() 10858 } 10859 10860 /** 10861 * Define comportamentos do componente 10862 * @private 10863 */ 10864 _setBehavior() { 10865 if (this.component.classList.contains('interaction-select')) { 10866 // Inicializa selecionado 10867 if (this.component.querySelector('input').getAttribute('checked')) { 10868 this.component.classList.add('selected') 10869 } 10870 this._setSelection() 10871 } 10872 this._closeTag() 10873 this._dismissTag() 10874 } 10875 10876 /** 10877 * Define comportamentos do componente 10878 * @private 10879 */ 10880 _setSelection() { 10881 const label = this.component.querySelector('label') 10882 const input = this.component.querySelector('input') 10883 // const tagRadio = input.getAttribute('type') === 'radio' ? true : false 10884 10885 label.addEventListener('click', (event) => { 10886 this._toggleSelection(input, event) 10887 }) 10888 input.addEventListener('keydown', (event) => { 10889 if (event.code === 'Space' || event.code === 'Enter') { 10890 this._toggleSelection(input, event) 10891 } 10892 }) 10893 } 10894 10895 /** 10896 * Muda estado do radio 10897 * @private 10898 * @param {object} input - referencia DOM ao input 10899 */ 10900 _toggleRadio(input) { 10901 if (this.component.querySelector('[type="radio"')) { 10902 const nameTag = input.getAttribute('name') 10903 for (const tagRadio of window.document.querySelectorAll( 10904 `[name=${nameTag}]` 10905 )) { 10906 this._removeCheck(tagRadio) 10907 } 10908 } 10909 } 10910 10911 /** 10912 * Muda estado do input 10913 * @private 10914 * @param {object} input - referencia DOM ao input 10915 * @param {event} event - ação que disparou o evento 10916 */ 10917 _toggleSelection(input, event) { 10918 event.preventDefault() 10919 this._toggleRadio(input) 10920 if (input.getAttribute('checked')) { 10921 this._removeCheck(input) 10922 return 10923 } 10924 10925 this._setCheck(input) 10926 } 10927 10928 /** 10929 * Define estado do input para selecionado 10930 * @private 10931 * @param {object} input - referencia DOM ao input 10932 */ 10933 _setCheck(input) { 10934 input.setAttribute('checked', 'checked') 10935 input.parentElement.classList.add('selected') 10936 } 10937 10938 /** 10939 * Define estado do input para desselecionado 10940 * @private 10941 * @param {object} input - referencia DOM ao input 10942 */ 10943 _removeCheck(input) { 10944 input.removeAttribute('checked') 10945 input.parentElement.classList.remove('selected') 10946 } 10947 10948 /** 10949 * Define comportamento do botão de fechar usando classe (compatibilidade) 10950 * @private 10951 */ 10952 _closeTag() { 10953 const closeBtn = this.component.querySelector('.br-button.close') 10954 10955 if (closeBtn) { 10956 const brTag = closeBtn.closest('.br-tag') 10957 10958 brTag.addEventListener('click', () => { 10959 closeBtn.closest('.br-tag').remove() 10960 }) 10961 } 10962 } 10963 10964 /** 10965 * Define comportamento do botão de fechar usando data-dismiss 10966 * @private 10967 */ 10968 _dismissTag() { 10969 this.component.querySelectorAll('[data-dismiss]').forEach((closeBtn) => { 10970 closeBtn.addEventListener('click', () => { 10971 const target = document.querySelector( 10972 `#${closeBtn.getAttribute('data-dismiss')}` 10973 ) 10974 if (target) target.remove() 10975 }) 10976 }) 10977 } 10978} 10979 10980const tagList = [] 10981for (const brTag of window.document.querySelectorAll('.br-tag')) { 10982 tagList.push(new BRTag('br-tab', brTag)) 10983} 10984 10985/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRTag); 10986 10987 10988/***/ }), 10989 10990/***/ "./src/components/textarea/textarea.js": 10991/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 10992 10993"use strict"; 10994/* harmony export */ __webpack_require__.d(__webpack_exports__, { 10995/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 10996/* harmony export */ }); 10997/** Classe para instanciar um objeto BRTextArea*/ 10998class BRTextArea { 10999 /** 11000 * Instancia do objeto 11001 * @param {string} name - Nome do componente em minúsculo 11002 * @param {object} component - Objeto referenciando a raiz do componente DOM 11003 */ 11004 constructor(name, component) { 11005 this.name = name 11006 this.component = component 11007 this._setBehavior() 11008 this._setKeyup() 11009 } 11010 11011 /** 11012 * Define comportamentos do componente 11013 * @private 11014 */ 11015 _setBehavior() { 11016 this.limit = this.component.querySelector('.limit') 11017 this.current = this.component.querySelector('.current') 11018 if (this.component.querySelector('textarea') !== null) { 11019 this.maximum = this.component 11020 .querySelector('textarea') 11021 .getAttribute('maxlength') 11022 } 11023 11024 this.characters = this.component.querySelector('.characters') 11025 this.currentValue = this.component.querySelector('.current') 11026 } 11027 11028 /** 11029 * Define ações do teclado 11030 * @private 11031 */ 11032 _setKeyup() { 11033 this.component.addEventListener('keyup', () => { 11034 const characterCount = this.component.querySelector('textarea').textLength 11035 if (characterCount <= this.maximum && !this.characters) { 11036 this.limit.innerHTML = '' 11037 this.currentValue.innerHTML = `Restam <strong>${ 11038 this.maximum - characterCount 11039 }</strong> caracteres` 11040 } 11041 // Com limite de caracteres 11042 if (!this.characters) { 11043 if (characterCount === 0 && this.limit.innerHTML === '') { 11044 this.limit.innerHTML = `Limite máximo de <strong>${this.maximum}</strong> caracteres` 11045 this.currentValue.innerHTML = '' 11046 } 11047 } 11048 // Sem limite de caracteres 11049 else { 11050 this.characters.innerHTML = `<strong>${characterCount}</strong> caracteres digitados` 11051 } 11052 }) 11053 } 11054} 11055 11056/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRTextArea); 11057 11058 11059/***/ }), 11060 11061/***/ "./src/components/tooltip/tooltip.js": 11062/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 11063 11064"use strict"; 11065/* harmony export */ __webpack_require__.d(__webpack_exports__, { 11066/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 11067/* harmony export */ }); 11068/* harmony import */ var _popperjs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@popperjs/core/lib/popper.js"); 11069 11070class BRTooltip { 11071 constructor(name, component) { 11072 this.name = name 11073 this.component = component 11074 this.activator = component.previousSibling.previousSibling 11075 const place = component.getAttribute('place') 11076 const positions = ['top', 'right', 'bottom', 'left'] 11077 this.popover = component.hasAttribute('popover') 11078 this.notification = component.classList.contains('br-notification') 11079 this.timer = component.getAttribute('timer') 11080 let positionNotification = this.notification 11081 ? 'bottom' 11082 : 'top' 11083 this.active = component.hasAttribute('active') 11084 this.placement = positions.includes(place) 11085 ? place 11086 : positionNotification 11087 this.popperInstance = null 11088 this.showEvents = ['mouseenter', 'click', 'focus'] 11089 this.hideEvents = ['mouseleave', 'blur'] 11090 this.closeTimer = null 11091 11092 this._create() 11093 this._setBehavior() 11094 } 11095 11096 _setBehavior() { 11097 // Ação de abrir padrao ao entrar no ativador 11098 11099 if (this.activator) { 11100 this.showEvents.forEach((event) => { 11101 this.activator.addEventListener(event, (otherEvent) => { 11102 this._show(otherEvent) 11103 }) 11104 }) 11105 // } 11106 } 11107 // Adiciona ação de fechar ao botao do popover 11108 // if (this.popover || this.notification) { 11109 if (this.popover) { 11110 const closeBtn = this.component.querySelector('.close') 11111 closeBtn.addEventListener('click', (event) => { 11112 this._hide(event, this.component) 11113 this._toggleActivatorIcon() 11114 }) 11115 // Ação de fechar padrao ao sair do ativador 11116 } else { 11117 this.hideEvents.forEach((event) => { 11118 this.activator.addEventListener(event, (otherEvent) => { 11119 this._hide(otherEvent, this.component) 11120 }) 11121 }) 11122 } 11123 11124 } 11125 11126 _create() { 11127 this._setLayout() 11128 11129 11130 // Cria a instancia do popper 11131 if (this.notification) { 11132 this.component.setAttribute('notification', '') 11133 11134 this.popperInstance = (0,_popperjs_core__WEBPACK_IMPORTED_MODULE_0__/* .createPopper */ .fi)(this.activator, this.component, { 11135 modifiers: [ 11136 { 11137 name: 'offset', 11138 options: { 11139 offset: [0, 10], 11140 }, 11141 }, 11142 { 11143 name: 'preventOverflow', 11144 options: { 11145 altAxis: false, 11146 mainAxis: true, 11147 11148 }, 11149 }, 11150 ], 11151 placement: this.placement, 11152 11153 strategy: 'fixed', 11154 }) 11155 } else { 11156 let ac = new DOMRect() 11157 const tt = new DOMRect() 11158 11159 11160 11161 11162 11163 ac = this.activator.getBoundingClientRect() 11164 11165 11166 const bw = document.body.clientWidth 11167 if (this.placement === 'right') { 11168 this.placement = 11169 ac.x + ac.width + tt.width > bw ? 'top' : this.placement 11170 } 11171 if (this.placement === 'left') { 11172 this.placement = ac.x - tt.width > 0 ? this.placement : 'top' 11173 } 11174 11175 this.popperInstance = (0,_popperjs_core__WEBPACK_IMPORTED_MODULE_0__/* .createPopper */ .fi)(this.activator, this.component, { 11176 modifiers: [ 11177 { 11178 name: 'offset', 11179 options: { 11180 offset: [0, 8], 11181 }, 11182 }, 11183 { 11184 name: 'preventOverflow', 11185 options: { 11186 altAxis: true, 11187 mainAxis: true, 11188 tether: false, 11189 }, 11190 }, 11191 ], 11192 placement: this.placement, 11193 }) 11194 } 11195 } 11196 11197 _show(event) { 11198 this.component.style.display = 'unset' 11199 this.component.setAttribute('data-show', '') 11200 this.component.style.zIndex = 99 11201 this._fixPosition() 11202 11203 // Importante pois "display: none" conflitua com a instancia do componente e precisa ser setado aqui já que pelo css ativa o efeito fade no primeiro carregamento 11204 11205 this.component.style.visibility = 'visible' 11206 if (this.timer) { 11207 clearTimeout(this.closeTimer) 11208 console.log("Timer",this.timer) 11209 this.closeTimer = setTimeout( 11210 this._hide, 11211 this.timer, 11212 event, 11213 this.component 11214 ) 11215 } 11216 } 11217 11218 _hide(event, component) { 11219 component.removeAttribute('data-show') 11220 component.style.zIndex = -1 11221 component.style.visibility = 'hidden' 11222 clearTimeout(component.closeTimer) 11223 } 11224 11225 _setLayout() { 11226 // Cria a setinha que aponta para o item que criou o tooltip 11227 const arrow = document.createElement('div') 11228 arrow.setAttribute('data-popper-arrow', '') 11229 11230 if (this.component.querySelectorAll('.arrow').length < 1) { 11231 arrow.classList.add('arrow') 11232 } 11233 this.component.appendChild(arrow) 11234 // Cria o icone de fechar do po over 11235 if (this.popover) { 11236 const close = document.createElement('button') 11237 close.setAttribute('type', 'button') 11238 close.classList.add('close') 11239 const ico = document.createElement('i') 11240 ico.classList.add('fas', 'fa-times') 11241 close.appendChild(ico) 11242 this.component.appendChild(close) 11243 } 11244 } 11245 11246 _toggleActivatorIcon() { 11247 const icon = this.activator.querySelector('button svg') 11248 if (icon) { 11249 icon.classList.toggle('fa-angle-down') 11250 icon.classList.toggle('fa-angle-up') 11251 } 11252 this.activator.toggleAttribute('active') 11253 } 11254 11255 _fixPosition() { 11256 if (this.notification) { 11257 setTimeout(() => { 11258 const ac = this.activator.getBoundingClientRect() 11259 this.component.style = `position: fixed !important; top: ${ 11260 ac.top + ac.height + 10 11261 }px !important; left: auto; right: 8px; display: unset; bottom: auto;` 11262 this.component.querySelector( 11263 '.arrow' 11264 ).style = `position: absolute; left: auto; right: ${ 11265 document.body.clientWidth - ac.right + ac.width / 5 11266 }px !important;` 11267 }, 10) 11268 } 11269 } 11270} 11271 11272/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRTooltip); 11273 11274 11275/***/ }), 11276 11277/***/ "./src/components/upload/upload.js": 11278/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 11279 11280"use strict"; 11281/* harmony export */ __webpack_require__.d(__webpack_exports__, { 11282/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 11283/* harmony export */ }); 11284/* harmony import */ var _components_tooltip_tooltip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/components/tooltip/tooltip.js"); 11285 11286/** Classe para instanciar um objeto BRUpload */ 11287class BRUpload { 11288 /** 11289 * @param {*} name nome do componente 11290 * @param {*} component componente 11291 * @param {*} uploadFiles promisse de status do upload 11292 */ 11293 constructor(name, component, uploadFiles) { 11294 this.name = name 11295 this.component = component 11296 this._inputElement = this.component.querySelector('.upload-input') 11297 this._fileList = this.component.querySelector('.upload-list') 11298 this._btnUpload = this.component.querySelector('.upload-button') 11299 this._label = this.component.querySelector('label') 11300 this._textHelp = document.querySelector('.text-base') 11301 this._fileArray = [] 11302 this._uploadFiles = uploadFiles 11303 this._setBehavior() 11304 } 11305 11306 /** 11307 * Define comportamentos do componente 11308 * @private 11309 */ 11310 _setBehavior() { 11311 if (this._inputElement) { 11312 const button = document.createElement('button') 11313 button.className = 'upload-button' 11314 button.setAttribute('type', 'button') 11315 11316 if (this._inputElement.getAttribute('multiple')) 11317 button.innerHTML = 11318 '<i class="fas fa-upload" aria-hidden="true"></i><span>Selecione o(s) arquivo(s)</span>' 11319 else 11320 button.innerHTML = 11321 '<i class="fas fa-upload" aria-hidden="true"></i><span>Selecione o arquivo</span>' 11322 11323 this.component.append(this._label) 11324 this.component.append(this._inputElement) 11325 this.component.appendChild(button) 11326 this.component.append(this._fileList) 11327 this._btnUpload = this.component.querySelector('.upload-button') 11328 this._btnUpload.addEventListener( 11329 'click', 11330 () => { 11331 this._clickUpload() 11332 }, 11333 false 11334 ) 11335 if (this.component.getAttribute('disabled')) { 11336 const message = document.createElement('span') 11337 message.classList.add('feedback', 'warning', 'mt-1') 11338 message.setAttribute('role', 'alert') 11339 message.innerHTML = 11340 '<i class="fas fa-exclamation-triangle" aria-hidden="true"></i>Upload desabilitado' 11341 this.component.after(message) 11342 } 11343 11344 this._fileArray = Array.from(this._inputElement.files) 11345 this._inputElement.addEventListener( 11346 'change', 11347 (event) => { 11348 this._handleFiles(event) 11349 }, 11350 false 11351 ) 11352 } 11353 11354 this._setDragAndDropBehavior() 11355 } 11356 11357 /** 11358 * Define comportamento de arrastar(drag) e posicionar(drop) 11359 * @private 11360 */ 11361 _setDragAndDropBehavior() { 11362 const uploadButton = this.component.querySelector('.upload-button') 11363 11364 ;['dragenter', 'dragover', 'dragleave', 'drop'].forEach((eventName) => { 11365 uploadButton.addEventListener(eventName, this._preventDefaults) 11366 }) 11367 ;['dragenter', 'dragover'].forEach((eventName) => { 11368 uploadButton.addEventListener(eventName, this._hightLight.bind(this)) 11369 }) 11370 ;['dragleave', 'drop'].forEach((eventName) => { 11371 uploadButton.addEventListener(eventName, this._unHightLight.bind(this)) 11372 }) 11373 11374 uploadButton.addEventListener('drop', this._handleDrop.bind(this)) 11375 } 11376 11377 /** 11378 * Evita os eventos padrao e propagação de evento 11379 * @private 11380 * @param {event} event - referencia ao evento 11381 */ 11382 _preventDefaults(event) { 11383 event.preventDefault() 11384 event.stopPropagation() 11385 } 11386 11387 _hightLight() { 11388 this.component.classList.add('dragging') 11389 } 11390 11391 _unHightLight() { 11392 this.component.classList.remove('dragging') 11393 } 11394 11395 /** 11396 * Ação de posicionar (drop) 11397 * @private 11398 * @param {event} event - referencia ao evento 11399 */ 11400 _handleDrop(event) { 11401 this.component.classList.remove('dragging') 11402 const dt = event.dataTransfer 11403 const { files } = dt 11404 this._handleFiles(files) 11405 } 11406 11407 /** 11408 * Testa se o objeto que disparou a ação está desabilitado 11409 * @private 11410 * @param {event} event - referencia ao evento 11411 */ 11412 _isDisabled(event) { 11413 const isDisabled = event.target.getAttribute('disabled') 11414 if (isDisabled) { 11415 return true 11416 } else { 11417 return false 11418 } 11419 } 11420 11421 /** 11422 * Simula ação de clicar no input 11423 * @private 11424 */ 11425 _clickUpload() { 11426 this._inputElement.click() 11427 } 11428 11429 /** 11430 * Limpa mensagem de feedback 11431 * @private 11432 */ 11433 _removeMessage() { 11434 for (const message of this.component.querySelectorAll('.feedback')) { 11435 message.parentNode.removeChild(message) 11436 message.innerHTML = '' 11437 } 11438 } 11439 11440 /** 11441 * Remove mensagem de estado 11442 * @private 11443 */ 11444 _removeStatus() {
vendor: 4,251 bytes, lines 11445-11590
11445 const remStatus = ['danger', 'warning', 'info', 'success'] 11446 remStatus.forEach((el) => { 11447 if (this.component.dataset.hasOwnProperty(el)) 11448 this.component.removeAttribute(`data-${el}`) 11449 }) 11450 } 11451 11452 /** 11453 * Define mensagem de feedback 11454 * @private 11455 * @param {string} status - estados: danger / info / success / warning 11456 */ 11457 _feedback(status, text) { 11458 const icone = `<i class="fas fa-times-circle" aria-hidden="true"></i>${text}` 11459 const dataStatus = `data-${status}` 11460 const message = document.createElement('span') 11461 message.classList.add('feedback', status, 'mt-1') 11462 message.setAttribute('role', 'alert') 11463 switch (status) { 11464 case 'danger': 11465 message.innerHTML = icone 11466 break 11467 case 'info': 11468 message.innerHTML = icone.replace('fa-times-circle', 'fa-info-circle') 11469 break 11470 case 'success': 11471 message.innerHTML = icone.replace('fa-times-circle', 'fa-check-circle') 11472 break 11473 case 'warning': 11474 message.innerHTML = icone.replace( 11475 'fa-times-circle', 11476 'fa-exclamation-triangle' 11477 ) 11478 break 11479 default: 11480 message.innerHTML = '' 11481 } 11482 this._removeStatus() 11483 this.component.setAttribute(dataStatus, dataStatus) 11484 this._fileList.before(message) 11485 } 11486 11487 /** 11488 * Adiciona arquivos a lista 11489 * @private 11490 * @param {File[]} files - lista de arquivos 11491 */ 11492 _concatFiles(files) { 11493 const newFiles = !files.length 11494 ? Array.from(this._inputElement.files) 11495 : Array.from(files) 11496 this._fileArray = this._fileArray.concat(newFiles) 11497 } 11498 11499 /** 11500 * Adiciona arquivos a lista 11501 * @private 11502 * @param {File[]} files - lista de arquivos 11503 */ 11504 _handleFiles(files) { 11505 this._removeMessage() 11506 if (!this._inputElement.multiple && files.length > 1) { 11507 this._feedback('danger', 'à permitido o envio de somente 1 arquivo.') 11508 } else if (!this._inputElement.multiple && this._fileArray.length > 0) { 11509 this._fileArray = [] 11510 this._concatFiles(files) 11511 this._updateFileList() 11512 this._feedback( 11513 'warning', 11514 'O arquivo enviado anteriormente foi substituÃdo' 11515 ) 11516 } else { 11517 this._concatFiles(files) 11518 this._updateFileList() 11519 } 11520 } 11521 11522 /** 11523 * Atualiza lista de arquivos eliminando redundâncias 11524 * @private 11525 */ 11526 _updateFileList() { 11527 this._removeStatus() 11528 if (this.component.nextElementSibling === this._textHelp) { 11529 this._textHelp.style.display = 'none' 11530 } 11531 if (!this._fileArray.length) { 11532 this._fileList.innerHTML = '' 11533 if (this.component.nextElementSibling === this._textHelp) { 11534 this._textHelp.style.display = '' 11535 } 11536 } else { 11537 this._fileList.innerHTML = '' 11538 11539 for (let i = 0; i < this._fileArray.length; i++) { 11540 if ('nowait' in this._fileArray[i]) { 11541 if (this._fileArray[i].nowait) { 11542 this._renderItem(i) 11543 } 11544 } else if (!this._fileArray[i].requested) { 11545 this.uploadLoading() 11546 this.uploadingFile(i) 11547 } 11548 } 11549 } 11550 } 11551 11552 /** 11553 * Mostra mensagem de carregamento 11554 * @private 11555 */ 11556 uploadLoading() { 11557 const loading = document.createElement('div') 11558 const carga = document.createElement('span') 11559 carga.classList.add('cargas') 11560 carga.innerText = 'Carregando...' 11561 loading.setAttribute('sm', '') 11562 loading.classList.add('my-3') 11563 loading.setAttribute('loading', '') 11564 loading.appendChild(carga) 11565 this._fileList.appendChild(loading) 11566 } 11567 11568 /** 11569 * Faz upload de arquivo na posição definida 11570 * @private 11571 * @param {Number} position - numero do Ãnidice da posição 11572 */ 11573 uploadingFile(position) { 11574 if (this._uploadFiles) { 11575 this._fileArray[position].requested = true 11576 this._uploadFiles().then(() => { 11577 this._fileArray[position].nowait = true 11578 this._updateFileList() 11579 }) 11580 } 11581 } 11582 11583 /** 11584 * Renderiza item na posição definida 11585 * @private 11586 * @param {Number} position - numero do Ãnidice da posição 11587 */ 11588 _renderItem(position) { 11589 const li = document.createElement('div') 11590 li.className = 'br-item d-flex'
11591 this._fileList.appendChild(li) 11592 li.innerHTML = '' 11593 const name = document.createElement('div') 11594 name.className = 'name' 11595 li.appendChild(name) 11596 this._fileList.appendChild(li) 11597 const info = document.createElement('div') 11598 info.className = 'content' 11599 info.innerHTML = this._fileArray[position].name 11600 const tooltip = document.createElement('div') 11601 tooltip.classList.add('br-tooltip') 11602 tooltip.setAttribute('role', 'tooltip') 11603 tooltip.setAttribute('place', 'top') 11604 tooltip.setAttribute('info', 'info') 11605 const textTooltip = document.createElement('span') 11606 textTooltip.classList.add('text') 11607 textTooltip.setAttribute('role', 'tooltip') 11608 textTooltip.innerHTML = this._fileArray[position].name 11609 tooltip.appendChild(textTooltip) 11610 li.appendChild(info) 11611 li.appendChild(name) 11612 li.appendChild(tooltip) 11613 info.classList.add('text-primary-default', 'mr-auto') 11614 const del = document.createElement('div') 11615 del.className = 'support mr-n2' 11616 const btndel = document.createElement('button') 11617 const spanSize = document.createElement('span') 11618 spanSize.className = 'mr-1' 11619 spanSize.innerHTML = this._calcSize(this._fileArray[position].size) 11620 del.appendChild(spanSize) 11621 btndel.className = 'br-button' 11622 btndel.type = 'button' 11623 btndel.setAttribute('circle', '') 11624 btndel.addEventListener( 11625 'click', 11626 (event) => { 11627 this._removeFile(position, event) 11628 }, 11629 false 11630 ) 11631 const img = document.createElement('i') 11632 img.className = 'fa fa-trash' 11633 btndel.appendChild(img) 11634 del.appendChild(btndel) 11635 li.appendChild(del) 11636 this._fileArray[position].nowait = true 11637 const tooltipList = [] 11638 for (const brTooltip of window.document.querySelectorAll('.br-tooltip')) { 11639 tooltipList.push(new _components_tooltip_tooltip__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z('br-tooltip', brTooltip)) 11640 } 11641 } 11642 11643 /** 11644 * Formata tamanho do arquivo 11645 * @private 11646 * @param {Number} nBytes - quantidade de bytes do arquivo 11647 */ 11648 _calcSize(nBytes) { 11649 let sOutput = '' 11650 for ( 11651 let aMultiples = ['KB', 'MB', 'GB', 'TB'], 11652 nMultiple = 0, 11653 nApprox = nBytes / 1024; 11654 nApprox > 1; 11655 nApprox /= 1024, nMultiple++ 11656 ) { 11657 sOutput = `${nApprox.toFixed(2)} ${aMultiples[nMultiple]}` 11658 } 11659 return sOutput 11660 } 11661 11662 /** 11663 * Remove arquivo na posição definida 11664 * @private 11665 * @param {Number} index - numero do Ãnidice da posição 11666 * @param {event} event - evento que disparou a ação 11667 */ 11668 _removeFile(index, event) { 11669 event.stopPropagation() 11670 event.preventDefault() 11671 this._removeStatus() 11672 this._removeMessage() 11673 this._fileArray.splice(index, 1) 11674 this._updateFileList() 11675 11676 if (this._inputElement.multiple) 11677 this._inputElement.files = this._updateFileListItems(this._fileArray) 11678 if (!this._inputElement.multiple) this._inputElement.value = '' 11679 } 11680 11681 /** 11682 * Atualiza arquivos da lista 11683 * @private 11684 * @param {File[]} files - lista de arquivos 11685 */ 11686 _updateFileListItems(files) { 11687 const fileInput = new ClipboardEvent('').clipboardData || new DataTransfer() 11688 for (let i = 0, len = files.length; i < len; i++) 11689 fileInput.items.add(files[i]) 11690 return fileInput.files 11691 } 11692} 11693 11694/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRUpload); 11695 11696 11697/***/ }), 11698
vendor: 38,493 bytes, lines 11699-13004
11699/***/ "./src/components/wizard/wizard.js": 11700/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 11701 11702"use strict"; 11703/* harmony export */ __webpack_require__.d(__webpack_exports__, { 11704/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 11705/* harmony export */ }); 11706/* harmony import */ var _partial_js_behavior_swipe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/partial/js/behavior/swipe.js"); 11707 11708 11709/** Classe para instanciar um objeto BRWizard*/ 11710class BRWizard { 11711 /** 11712 * Instância do componente 11713 * @param {string} name - nome do componente 11714 * @param {object} component - referencia ao objeto do DOM 11715 **/ 11716 constructor(name, component) { 11717 this.name = name 11718 this.component = component 11719 this.DOMstrings = { 11720 stepFormPanelClass: 'wizard-panel', 11721 stepFormPanels: this.component.querySelectorAll('.wizard-panel'), 11722 stepNextBtnClass: 'wizard-btn-next', 11723 stepPrevBtnClass: 'wizard-btn-prev', 11724 stepsBar: this.component.querySelector('.wizard-progress'), 11725 stepsBarClass: 'wizard-progress', 11726 stepsBtnClass: 'wizard-progress-btn', 11727 stepsBtns: this.component.querySelectorAll('.wizard-progress-btn'), 11728 stepsForm: this.component.querySelector('.wizard-form'), 11729 } 11730 /** 11731 * Retira o atributo de uma lista de elementos 11732 * @param {object[]} elementSet - Lista de objetos 11733 * @param {string} attrName - Nome do atribbuto 11734 */ 11735 this.removeAttributes = (elemSet, attrName) => { 11736 elemSet.forEach((elem) => { 11737 elem.removeAttribute(attrName) 11738 }) 11739 } 11740 11741 /** 11742 * Retorna o elemento pai do objeto com a classe de referência 11743 * @param {object} elem - Lista de objetos 11744 * @param {string} parentClass - nome da classe de referência 11745 * @returns {object} 11746 */ 11747 this.findParent = (elem, parentClass) => { 11748 let currentNode = elem 11749 while (!currentNode.classList.contains(parentClass)) { 11750 currentNode = currentNode.parentNode 11751 } 11752 return currentNode 11753 } 11754 11755 /** 11756 * Retorna o Ãndice do elemento botão de passo 11757 * @param {object} elem - botão de passo 11758 * @returns {number} 11759 */ 11760 this.getActiveStep = (elem) => { 11761 return Array.from(this.DOMstrings.stepsBtns).indexOf(elem) 11762 } 11763 11764 /** 11765 * Define o estado do botão ativo e limpa os demais estados dos botões 11766 * @param {number} activeStepNum - número do botão ativo 11767 */ 11768 this.setActiveStep = function (activeStepNum) { 11769 this.removeAttributes(this.DOMstrings.stepsBtns, 'active') 11770 this.DOMstrings.stepsBtns.forEach((elem, index) => { 11771 if (index === activeStepNum) { 11772 elem.removeAttribute('disabled') 11773 elem.setAttribute('active', '') 11774 } 11775 }) 11776 } 11777 11778 /** 11779 * Retorna o Ãndice do painel ativo 11780 * @returns {number} 11781 */ 11782 this.getActivePanel = () => { 11783 let activePanel 11784 this.DOMstrings.stepFormPanels.forEach((elem) => { 11785 if (elem.hasAttribute('active')) { 11786 activePanel = elem 11787 } 11788 }) 11789 return activePanel 11790 } 11791 11792 /** 11793 * Abre o painel ativo e fecha paineis inativos 11794 * @param {number} activePanelNum - numero do painel 11795 */ 11796 this.setActivePanel = (activePanelNum) => { 11797 // remove active class from all the panels 11798 this.removeAttributes(this.DOMstrings.stepFormPanels, 'active') 11799 // show active panel 11800 this.DOMstrings.stepFormPanels.forEach((elem, index) => { 11801 if (index === activePanelNum) { 11802 elem.setAttribute('active', '') 11803 } 11804 }) 11805 } 11806 11807 /** 11808 * Define números dos passos 11809 */ 11810 this.setStepsNum = () => { 11811 this.DOMstrings.stepsBtns.forEach((elem, index) => { 11812 elem.setAttribute('step', index + 1) 11813 }) 11814 } 11815 11816 /** 11817 * Define passo e painel ativo 11818 * @param {number} num - numero do passo 11819 */ 11820 this.setStep = (num) => { 11821 const activeStep = num <= this.DOMstrings.stepsBtns.length ? num - 1 : 0 11822 this.setActiveStep(activeStep) 11823 this.setActivePanel(activeStep) 11824 } 11825 11826 /** 11827 * Retrai painel de passos 11828 */ 11829 this.collapseSteps = () => { 11830 this.component.setAttribute('collapsed', '') 11831 } 11832 11833 /** 11834 * Expande painel de passos 11835 */ 11836 this.expandSteps = () => { 11837 this.component.removeAttribute('collapsed') 11838 } 11839 11840 this._setBehavior() 11841 } 11842 11843 /** 11844 * Define os comportamentos do componente 11845 * @private 11846 */ 11847 _setBehavior() { 11848 /** 11849 * Mapeia clique na barra de passos 11850 */ 11851 this.DOMstrings.stepsBar.addEventListener('click', (e) => { 11852 const eventTarget = e.target 11853 if (!eventTarget.classList.contains(`${this.DOMstrings.stepsBtnClass}`)) { 11854 e.target.parentNode.click() 11855 return 11856 } 11857 const activeStep = this.getActiveStep(eventTarget) 11858 this.setActiveStep(activeStep) 11859 this.setActivePanel(activeStep) 11860 }) 11861 11862 /** 11863 * Mapeia clique nos botões de navegação 11864 */ 11865 this.DOMstrings.stepsForm.addEventListener('click', (e) => { 11866 const eventTarget = e.target 11867 if ( 11868 !( 11869 eventTarget.classList.contains( 11870 `${this.DOMstrings.stepPrevBtnClass}` 11871 ) || 11872 eventTarget.classList.contains(`${this.DOMstrings.stepNextBtnClass}`) 11873 ) 11874 ) { 11875 return 11876 } 11877 const activePanel = this.findParent( 11878 eventTarget, 11879 `${this.DOMstrings.stepFormPanelClass}` 11880 ) 11881 let activePanelNum = Array.from(this.DOMstrings.stepFormPanels).indexOf( 11882 activePanel 11883 ) 11884 if ( 11885 eventTarget.classList.contains(`${this.DOMstrings.stepPrevBtnClass}`) 11886 ) { 11887 activePanelNum -= 1 11888 activePanel.style.left = '1%' 11889 } else { 11890 activePanelNum += 1 11891 activePanel.style.left = '-1%' 11892 } 11893 this.setActiveStep(activePanelNum) 11894 this.setActivePanel(activePanelNum) 11895 }) 11896 11897 this.setStepsNum() 11898 11899 if (this.component.hasAttribute('step')) { 11900 this.setStep(this.component.getAttribute('step')) 11901 } 11902 11903 if ( 11904 this.component.hasAttribute('scroll') && 11905 !this.component.hasAttribute('vertical') 11906 ) { 11907 const stepsWidth = 11908 Math.round(100 / this.DOMstrings.stepsBtns.length) - 0.5 11909 this.DOMstrings.stepsBar.style.gridTemplateColumns = `repeat(auto-fit, minmax(100px, ${stepsWidth}% ))` 11910 } 11911 11912 /** 11913 * Configura gestos (swipe) 11914 */ 11915 const dispatcher = new _partial_js_behavior_swipe__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z(this.DOMstrings.stepsBar) 11916 if (this.component.hasAttribute('vertical')) { 11917 dispatcher.on('SWIPE_LEFT', () => { 11918 this.collapseSteps() 11919 }) 11920 dispatcher.on('SWIPE_RIGHT', () => { 11921 this.expandSteps() 11922 }) 11923 this.DOMstrings.stepsForm.ontouchstart = () => { 11924 this.collapseSteps() 11925 } 11926 } else { 11927 this.DOMstrings.stepsBar.ontouchstart = () => { 11928 this.expandSteps() 11929 } 11930 this.DOMstrings.stepsForm.ontouchstart = () => { 11931 this.collapseSteps() 11932 } 11933 } 11934 } 11935} 11936 11937/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRWizard); 11938 11939 11940/***/ }), 11941 11942/***/ "./src/partial/js/behavior/accordion.js": 11943/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 11944 11945"use strict"; 11946/* harmony export */ __webpack_require__.d(__webpack_exports__, { 11947/* harmony export */ "default": () => (/* binding */ Accordion) 11948/* harmony export */ }); 11949/* harmony import */ var _collapse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/partial/js/behavior/collapse.js"); 11950 11951 11952/** 11953 * Classe para o comportamento Accordion. 11954 * O Comportamento Accordion é um agrupador de comportamentos Collapse 11955 */ 11956class Accordion extends _collapse__WEBPACK_IMPORTED_MODULE_0__["default"] { 11957 /** 11958 * Instancia um comportamento accordion 11959 * @param {object} - Objeto de configuração inicial para destructuring 11960 * @property {object} trigger - Elemento DOM que representa o acionador do comportmento accordion 11961 * @property {string} iconToShow - Classe que representa o Ãcone para mostrar o conteúdo (padrão: fa-chevron-down) 11962 * @property {string} iconToHide - Classe que representa o Ãcone para esconder o conteúdo (padrão: fa-chevron-up) 11963 * @property {boolean} useIcons - true: com Ãcone | false: sem Ãcone (padrão: true) 11964 */ 11965 constructor({ 11966 trigger, 11967 iconToShow = 'fa-chevron-down', 11968 iconToHide = 'fa-chevron-up', 11969 useIcons = true, 11970 }) { 11971 super({ iconToHide, iconToShow, trigger, useIcons }) 11972 this._setUp() 11973 } 11974 11975 /** 11976 * Trata a configuração inicial do comportamento accordion 11977 * @private 11978 */ 11979 _setUp() { 11980 super._setUp() 11981 this._setPriorityVisibility() 11982 } 11983 11984 /** 11985 * Determina qual acionador vai estar visivel, caso mais de 1 acionador esteja visivel no grupo. 11986 * Prioridade de cima para baixo 11987 * @private 11988 */ 11989 _setPriorityVisibility() { 11990 for (let i = 0; i < this._getGroup().length; i += 1) { 11991 if (this._getGroup()[i].dataset.visible === 'true') { 11992 this._synchronizeAccordion(this._getGroup()[i]) 11993 break 11994 } 11995 } 11996 } 11997 11998 /** 11999 * Obtém todos os acionadores pertencentes ao grupo do comportamento accordion 12000 * @returns {array} - Conjunto de elementos DOM representando os acionadores pertencentes ao grupo do comportamento accordion 12001 * @private 12002 */ 12003 _getGroup() { 12004 return document.querySelectorAll( 12005 `[data-group="${this.trigger.getAttribute('data-group')}"]` 12006 ) 12007 } 12008 12009 /** 12010 * Handler para o evento 'change' do acionador 12011 * @param {object} event - Objeto do tipo Event 12012 * @private 12013 */ 12014 _handleTriggerChangeBehavior(event) { 12015 if (!event.currentTarget.hasAttribute('data-sync')) { 12016 this._synchronizeAccordion(event.currentTarget) 12017 } else { 12018 event.currentTarget.removeAttribute('data-sync') 12019 } 12020 } 12021 12022 /** 12023 * Sincroniza o grupo de accordion mostrando 1 elemento aberto por vez 12024 * @param {object} currentTrigger - Elemento DOM representando um acionador do comportamento accordion 12025 * @private 12026 */ 12027 _synchronizeAccordion(currentTrigger) { 12028 this._getGroup().forEach((trigger) => { 12029 if (trigger !== currentTrigger && trigger.dataset.visible === 'true') { 12030 trigger.setAttribute('data-sync', '') 12031 trigger.click() 12032 } 12033 }) 12034 } 12035 12036 /** 12037 * Configura o comportamento accordion 12038 * @public 12039 */ 12040 setBehavior() { 12041 super.setBehavior() 12042 this.trigger.addEventListener( 12043 'change', 12044 this._handleTriggerChangeBehavior.bind(this) 12045 ) 12046 } 12047} 12048 12049 12050/***/ }), 12051 12052/***/ "./src/partial/js/behavior/checkgroup.js": 12053/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 12054 12055"use strict"; 12056/* harmony export */ __webpack_require__.d(__webpack_exports__, { 12057/* harmony export */ "default": () => (/* binding */ Checkgroup) 12058/* harmony export */ }); 12059/** 12060 * Comportamento do grupo de checkboxes 12061 * 12062 * Cada checkbox parent em uma cadeia de checkbox terá um objeto próprio para tratar 12063 * o seu comportamento e de seus filhos. Os eventListeners são declarados em cada objeto, 12064 * de modo que a execução passa por objetos diferentes quando um checkbox é pai e filho ao mesmo tempo 12065 * 12066 * O comportamento é uma sincronia entre os eventos e o objeto que executa o evento 12067 */ 12068class Checkgroup { 12069 /** 12070 * Instancia um comportamento de grupo de checkbox 12071 * @param {object} trigger - Elemento DOM que representa o checkbox acionador do comportamento 12072 */ 12073 constructor(trigger) { 12074 this.parent = trigger 12075 // this.checkedLabel = trigger.dataset.checkedLabel 12076 // this.uncheckedLabel = trigger.dataset.uncheckedLabel 12077 this.children = this._setChildren(trigger.dataset.parent) 12078 } 12079 12080 /** 12081 * Pega dinamincamente o valor do atributo data-checked-label 12082 * @type {string} - O valor do atributo data-checked-label ou o valor da label, caso não tenha o atributo 12083 * @readonly 12084 * @public 12085 */ 12086 get checkedLabel() { 12087 return ( 12088 this.parent.dataset.checkedLabel || 12089 this.parent.nextElementSibling.innerText 12090 ) 12091 } 12092 12093 /** 12094 * Pega dinamincamente o valor do atributo data-unchecked-label 12095 * @type {string} - O valor do atributo data-unchecked-label ou o valor da label, caso não tenha o atributo 12096 * @readonly 12097 * @public 12098 */ 12099 get uncheckedLabel() { 12100 return ( 12101 this.parent.dataset.uncheckedLabel || 12102 this.parent.nextElementSibling.innerText 12103 ) 12104 } 12105 12106 /** 12107 * Configurar o comportamento do grupo de checkbox 12108 * @public 12109 */ 12110 setBehavior() { 12111 this._setParentBehavior() 12112 this._setChildBehavior() 12113 } 12114 12115 /** 12116 * Obtem todos os checkboxes filhos do checkbox pai 12117 * @param {string} tag - Nome que indica a relação entre checkbox pai e checkbox filho 12118 * @returns {array} - Array contendo os elementos DOM que representam os checkboxes filhos. 12119 */ 12120 _setChildren(tag) { 12121 return document.querySelectorAll(`[data-child="${tag}"]`) 12122 } 12123 12124 /** 12125 * Trata do comportamento do checkbox pai 12126 * @private 12127 */ 12128 _setParentBehavior() { 12129 this.parent.addEventListener('click', this._handleParentClick.bind(this)) 12130 this.parent.addEventListener('change', this._handleParentChange.bind(this)) 12131 } 12132 12133 /** 12134 * Handler que trata o evento click no parent 12135 * @private 12136 */ 12137 _handleParentClick() { 12138 if (!this.parent.hasAttribute('data-parent-sync')) { 12139 this._setIndeterminateStateOnClick() 12140 } 12141 this._setParentCheckboxLabel() 12142 } 12143 12144 /** 12145 * Trata o estado indeterminado no evento click da etapa de interação do usuário 12146 * @private 12147 */ 12148 _setIndeterminateStateOnClick() { 12149 if (this.parent.hasAttribute('indeterminate')) { 12150 this.parent.removeAttribute('indeterminate') 12151 this.parent.checked = true 12152 } 12153 } 12154 12155 /** 12156 * Handler que trata o evento change no parent 12157 * @private 12158 */ 12159 _handleParentChange() { 12160 if (!this.parent.hasAttribute('data-parent-sync')) { 12161 this._changeChildState() 12162 this._setParentCheckboxLabel() 12163 } else { 12164 this.parent.removeAttribute('data-parent-sync') 12165 } 12166 } 12167 12168 /** 12169 * Trata do estado do checkboxes filhos 12170 * @private 12171 */ 12172 _changeChildState() { 12173 this.children.forEach((child) => { 12174 if ( 12175 child.checked !== this.parent.checked || 12176 child.hasAttribute('indeterminate') 12177 ) { 12178 child.removeAttribute('indeterminate') 12179 child.checked = this.parent.checked 12180 child.dispatchEvent(new Event('change')) 12181 } 12182 }) 12183 } 12184 12185 /** 12186 * Trata do comportamento dos checkboxes filhos 12187 * @private 12188 */ 12189 _setChildBehavior() { 12190 this.children.forEach((child) => { 12191 child.addEventListener('click', this._handleChildClick.bind(this)) 12192 child.addEventListener('change', this._handleChildChange.bind(this)) 12193 }) 12194 } 12195 12196 /** 12197 * Handler que trata do evento click no filho 12198 * @param {object} event - Objeto Event 12199 * @private 12200 */ 12201 _handleChildClick(event) { 12202 event.currentTarget.setAttribute('data-child-sync', '') 12203 } 12204 12205 /** 12206 * Handler que trata do evento change no filho 12207 * @param {object} event - Objeto Event 12208 * @private 12209 */ 12210 _handleChildChange(event) { 12211 if (event.currentTarget.hasAttribute('data-child-sync')) { 12212 this._setIndeterminateStateOnChildChange() 12213 this.parent.setAttribute('data-parent-sync', '') 12214 this.parent.dispatchEvent(new Event('click')) 12215 this.parent.dispatchEvent(new Event('change')) 12216 event.currentTarget.removeAttribute('data-child-sync') 12217 } 12218 } 12219 12220 /** 12221 * Trata o estado indeterminado no evento click da etapa de sincronia 12222 * @private 12223 */ 12224 _setIndeterminateStateOnChildChange() { 12225 if (this._isAllChildrenChecked()) { 12226 this.parent.removeAttribute('indeterminate') 12227 this.parent.checked = true 12228 } else if (this._isAllChildrenUnchecked()) { 12229 this.parent.removeAttribute('indeterminate') 12230 this.parent.checked = false 12231 } else { 12232 this.parent.setAttribute('indeterminate', '') 12233 this.parent.checked = true 12234 } 12235 } 12236 12237 /** 12238 * Verifica se todos os checkboxes filhos estão selecionados 12239 * @returns {boolean} - true se todos os checkboxes filhos estão selecionados 12240 * false se pelo menos 1 checkbox filho não está selecionado 12241 * @private 12242 */ 12243 _isAllChildrenChecked() { 12244 let allChildChecked = true 12245 this.children.forEach((child) => { 12246 if (!child.checked || child.hasAttribute('indeterminate')) { 12247 allChildChecked = false 12248 } 12249 }) 12250 return allChildChecked 12251 } 12252 12253 /** 12254 * Verifica se todos so checkboxes filhos estão desselecionados 12255 * @returns {boolean} - true se todos os checkboxes filhos estão desselecionados 12256 * false se pelo menos 1 checkbox filho está selecionado 12257 * @private 12258 */ 12259 _isAllChildrenUnchecked() { 12260 let allChildUnchecked = true 12261 this.children.forEach((child) => { 12262 if (child.checked) { 12263 allChildUnchecked = false 12264 } 12265 }) 12266 return allChildUnchecked 12267 } 12268 12269 /** 12270 * Configura a label do checkbox pai 12271 * @private 12272 */ 12273 _setParentCheckboxLabel() { 12274 if (this.parent.checked && !this.parent.hasAttribute('indeterminate')) { 12275 this.parent.nextElementSibling.innerHTML = this.uncheckedLabel 12276 this.parent.setAttribute('aria-label', this.uncheckedLabel) 12277 } else { 12278 this.parent.nextElementSibling.innerHTML = this.checkedLabel 12279 this.parent.setAttribute('aria-label', this.checkedLabel) 12280 } 12281 } 12282} 12283 12284 12285/***/ }), 12286 12287/***/ "./src/partial/js/behavior/collapse.js": 12288/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 12289 12290"use strict"; 12291/* harmony export */ __webpack_require__.d(__webpack_exports__, { 12292/* harmony export */ "default": () => (/* binding */ Collapse) 12293/* harmony export */ }); 12294/** Classe para o comportamento Collapse */ 12295class Collapse { 12296 /** 12297 * Instancia um comportamento collapse 12298 * @param {object} - Objeto de configuração inicial para destructuring 12299 * @property {object} trigger - Elemento DOM que representa o acionador do comportmento collapse 12300 * @property {string} iconToShow - Classe que representa o Ãcone para mostrar o conteúdo (padrão: fa-chevron-down) 12301 * @property {string} iconToHide - Classe que representa o Ãcone para esconder o conteúdo (padrão: fa-chevron-up) 12302 * @property {boolean} useIcons - true: com Ãcone | false: sem Ãcone (padrão: true) 12303 */ 12304 constructor({ 12305 trigger, 12306 iconToShow = 'fa-chevron-down', 12307 iconToHide = 'fa-chevron-up', 12308 useIcons = true, 12309 }) { 12310 this.trigger = trigger 12311 this.useIcons = useIcons 12312 this.breakpoint = trigger.getAttribute('data-breakpoint') 12313 this.setIconToShow(iconToShow) 12314 this.setIconToHide(iconToHide) 12315 this._setTarget() 12316 this._setUp() 12317 } 12318 12319 /** 12320 * Determina qual elemento DOM é o alvo do comportamento collapse 12321 * @private 12322 */ 12323 _setTarget() { 12324 this.target = document.querySelector( 12325 `#${this.trigger.getAttribute('data-target')}` 12326 ) 12327 } 12328 12329 // TODO: Melhorar a solução 12330 _checkBreakpoint() { 12331 if (this.breakpoint) { 12332 if (window.matchMedia('(min-width: 977px)').matches) { 12333 this.target.removeAttribute('hidden') 12334 } 12335 } 12336 } 12337 12338 /** 12339 * Trata a configuração inicial do comportamento collapse 12340 * @private 12341 */ 12342 _setUp() { 12343 this._setVisibilityStatus() 12344 if (this.useIcons) { 12345 this._toggleIcon() 12346 } 12347 this.trigger.setAttribute( 12348 'aria-controls', 12349 `${this.trigger.getAttribute('data-target')}` 12350 ) 12351 this._checkBreakpoint() 12352 } 12353 12354 /** 12355 * Configura o estado de visualização do comportamento collapse 12356 * @private 12357 */ 12358 _setVisibilityStatus() { 12359 this._setTriggerVisibilityStatus() 12360 this._setTargetVisibilityStatus() 12361 } 12362 12363 /** 12364 * Trata o estado de visualização do acionador 12365 * @private 12366 */ 12367 _setTriggerVisibilityStatus() { 12368 if (this.target) { 12369 if (this.target.hasAttribute('hidden')) { 12370 this.trigger.setAttribute('data-visible', false) 12371 this.trigger.setAttribute('aria-expanded', false) 12372 } else { 12373 this.trigger.setAttribute('data-visible', true) 12374 this.trigger.setAttribute('aria-expanded', true) 12375 } 12376 } 12377 } 12378 12379 /** 12380 * Trata o estado de visualização do alvo 12381 * @private 12382 */ 12383 _setTargetVisibilityStatus() { 12384 if (this.target) { 12385 if (this.target.hasAttribute('hidden')) { 12386 this.target.setAttribute('aria-hidden', true) 12387 } else { 12388 this.target.setAttribute('aria-hidden', false) 12389 } 12390 } 12391 } 12392 12393 /** 12394 * Handler para o evento de click no acionador do comportamento collapse 12395 * Lança um evento 'change' a cada troca 12396 * @private 12397 */ 12398 _handleTriggerClickBehavior() { 12399 if (this.breakpoint) { 12400 if (window.matchMedia('(max-width: 977px)').matches) { 12401 this._toggleVisibility() 12402 if (this.useIcons) { 12403 this._toggleIcon() 12404 } 12405 this.trigger.dispatchEvent(new Event('change')) 12406 } 12407 } else { 12408 this._toggleVisibility() 12409 if (this.useIcons) { 12410 this._toggleIcon() 12411 } 12412 this.trigger.dispatchEvent(new Event('change')) 12413 } 12414 } 12415 12416 /** 12417 * Alterna o estado de visualização do comportamento collapse 12418 * @private 12419 */ 12420 _toggleVisibility() { 12421 if (this.target) { 12422 this.target.hasAttribute('hidden') 12423 ? this.target.removeAttribute('hidden') 12424 : this.target.setAttribute('hidden', '') 12425 12426 this._setVisibilityStatus() 12427 } 12428 } 12429 12430 /** 12431 * Troca o icone do acionador após uma mudança no estado de visualização do alvo 12432 * Para o estado 'hidden' usa o iconToShow e para o estado 'shown' usa o iconToHide 12433 * @public 12434 */ 12435 _toggleIcon() { 12436 this.trigger.querySelectorAll('i.fas').forEach((icon) => { 12437 if (this.target) { 12438 icon.classList.remove( 12439 this.target.hasAttribute('hidden') ? this.iconToHide : this.iconToShow 12440 ) 12441 icon.classList.add( 12442 this.target.hasAttribute('hidden') ? this.iconToShow : this.iconToHide 12443 ) 12444 } 12445 }) 12446 } 12447 12448 /** 12449 * Configura o comportamento collapse 12450 * @public 12451 */ 12452 setBehavior() { 12453 this.trigger.addEventListener( 12454 'click', 12455 this._handleTriggerClickBehavior.bind(this) 12456 ) 12457 } 12458 12459 /** 12460 * Determina a classe do icone para mostrar o conteúdo 12461 * @param {string} iconToShow - Classe que representa o Ãcone para mostrar o conteúdo 12462 * @public 12463 */ 12464 setIconToShow(iconToShow) { 12465 this.iconToShow = iconToShow 12466 } 12467 12468 /** 12469 * Determina a classe do Ãcone para esconder o conteúdo 12470 * @param {string} iconToHide - Classe que representa o Ãcone para esconder o conteúdo 12471 * @public 12472 */ 12473 setIconToHide(iconToHide) { 12474 this.iconToHide = iconToHide 12475 } 12476} 12477 12478 12479/***/ }), 12480 12481/***/ "./src/partial/js/behavior/dropdown.js": 12482/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 12483 12484"use strict"; 12485/* harmony export */ __webpack_require__.d(__webpack_exports__, { 12486/* harmony export */ "default": () => (/* binding */ Dropdown) 12487/* harmony export */ }); 12488/* harmony import */ var _collapse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/partial/js/behavior/collapse.js"); 12489 12490 12491/** 12492 * Classe para o comportamento Dropdown. 12493 * O Comportamento Dropdown é um caso especial do comportamentos Collapse 12494 * em que o alvo aparece flutuando na tela. 12495 * Nesse caso o alvo precisa filho de um elemento pai 12496 */ 12497class Dropdown extends _collapse__WEBPACK_IMPORTED_MODULE_0__["default"] { 12498 /** 12499 * Instancia um comportamento accordion 12500 * @param {object} - Objeto de configuração inicial para destructuring 12501 * @property {object} trigger - Elemento DOM que representa o acionador do comportmento accordion 12502 * @property {string} iconToShow - Classe que representa o Ãcone para mostrar o conteúdo (padrão: fa-chevron-down) 12503 * @property {string} iconToHide - Classe que representa o Ãcone para esconder o conteúdo (padrão: fa-chevron-up) 12504 * @property {boolean} useIcons - true: com Ãcone | false: sem Ãcone (padrão: true) 12505 */ 12506 constructor({ 12507 trigger, 12508 iconToShow = 'fa-chevron-down', 12509 iconToHide = 'fa-chevron-up', 12510 useIcons = true, 12511 }) { 12512 super({ iconToHide, iconToShow, trigger, useIcons }) 12513 } 12514 12515 /** 12516 * Trata a configuração inicial do comportamento dropdown 12517 * @override 12518 * @private 12519 */ 12520 _setUp() { 12521 super._setUp() 12522 this._hideDropdown() 12523 } 12524 12525 /** 12526 * Oculta o dropdown ao clicar fora do acionador e do alvo 12527 * @private 12528 */ 12529 _hideDropdown() { 12530 document.addEventListener('mousedown', (event) => { 12531 if ( 12532 !this.trigger.contains(event.target) && 12533 !this.target.hasAttribute('hidden') && 12534 !this.target.contains(event.target) 12535 ) { 12536 this.trigger.click() 12537 } 12538 }) 12539 } 12540 12541 /** 12542 * Marca o alvo com o atributo data-dropdown 12543 * @override 12544 * @private 12545 */ 12546 _setTargetVisibilityStatus() { 12547 super._setTargetVisibilityStatus() 12548 if (this.target.hasAttribute('hidden')) { 12549 this.target.removeAttribute('data-dropdown') 12550 } else { 12551 this.target.setAttribute('data-dropdown', '') 12552 } 12553 } 12554 12555 /** 12556 * Trata o estado de visualização do pai do alvo 12557 * @private 12558 */ 12559 _setParentsTargetVisibilityStatus() { 12560 if (this.target.hasAttribute('hidden')) { 12561 this.target.parentElement.classList.remove('dropdown') 12562 } else { 12563 this.target.parentElement.classList.add('dropdown') 12564 } 12565 } 12566 12567 /** 12568 * Handler para o evento de click no acionador do comportamento dropdown 12569 * Lança um evento 'change' a cada troca 12570 * @override 12571 * @private 12572 */ 12573 _handleTriggerClickBehavior() { 12574 super._handleTriggerClickBehavior() 12575 this._setParentsTargetVisibilityStatus() 12576 } 12577 12578 /** 12579 * Configura o comportamento dropdown 12580 * @override 12581 * @public 12582 */ 12583 setBehavior() { 12584 super.setBehavior() 12585 } 12586} 12587 12588 12589/***/ }), 12590 12591/***/ "./src/partial/js/behavior/scrim.js": 12592/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 12593 12594"use strict"; 12595/* harmony export */ __webpack_require__.d(__webpack_exports__, { 12596/* harmony export */ "default": () => (/* binding */ Scrim) 12597/* harmony export */ }); 12598/** Classe para o comportamento scrim */ 12599class Scrim { 12600 /** 12601 * Instancia um comportamento scrim 12602 * @param {object} - Objeto de configuração inicial para destructuring 12603 * @property {object} trigger - Elemento DOM que representa o acionador do comportmento scrim 12604 * @property {string} closeElement - Elemento Dom do trigger que fecha o scrim 12605 */ 12606 constructor({ trigger, closeElement }) { 12607 this.trigger = trigger 12608 this.closeElement = this.elementHideScrim(closeElement) 12609 if (this.trigger) { 12610 this.setBehavior() 12611 } 12612 } 12613 12614 /** 12615 * Alterna o estado de visualização do comportamento scrim 12616 * @private 12617 */ 12618 showScrim() { 12619 if (this.trigger) { 12620 this.trigger.classList.add('active') 12621 this.trigger.setAttribute('data-visible', true) 12622 this.trigger.setAttribute('aria-expanded', true) 12623 } 12624 } 12625 /** 12626 * Alterna o estado de escondido do comportamento scrim 12627 * @private 12628 */ 12629 hideScrim() { 12630 this.trigger.classList.remove('active') 12631 this.trigger.setAttribute('data-visible', false) 12632 this.trigger.setAttribute('aria-expanded', false) 12633 } 12634 12635 /** 12636 * Seta o elemento Dom que vai fechar o scrim 12637 * @public 12638 */ 12639 elementHideScrim(element) { 12640 if (this.trigger.querySelectorAll(element)) { 12641 this.trigger.querySelectorAll(element).forEach((element) => { 12642 this.closeElement = element 12643 this._setCloseClick() 12644 }) 12645 } 12646 } 12647 12648 /** 12649 * Adiciona listener de fechamento no elemento que fecha o scrim 12650 * @private 12651 */ 12652 _setCloseClick() { 12653 this.closeElement.addEventListener('click', () => { 12654 this.hideScrim() 12655 }) 12656 } 12657 /** 12658 * Configura o comportamento scrim 12659 * @public 12660 */ 12661 setBehavior() { 12662 this.trigger.addEventListener('click', (event) => { 12663 if (event.target.getAttribute('data-scrim')) { 12664 this.hideScrim() 12665 } 12666 }) 12667 } 12668} 12669 12670 12671/***/ }), 12672 12673/***/ "./src/partial/js/behavior/swipe.js": 12674/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 12675 12676"use strict"; 12677/* harmony export */ __webpack_require__.d(__webpack_exports__, { 12678/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__) 12679/* harmony export */ }); 12680/* unused harmony export Swipe */ 12681class Swipe { 12682 constructor(element) { 12683 this.evtMap = { 12684 SWIPE_DOWN: [], 12685 SWIPE_LEFT: [], 12686 SWIPE_RIGHT: [], 12687 SWIPE_UP: [], 12688 } 12689 this.xDown = null 12690 this.yDown = null 12691 this.element = element 12692 12693 element.addEventListener( 12694 'touchstart', 12695 (evt) => { 12696 return this.handleTouchStart(evt) 12697 }, 12698 false 12699 ) 12700 element.addEventListener( 12701 'touchend', 12702 (evt) => { 12703 return this.handleTouchEnd(evt) 12704 }, 12705 false 12706 ) 12707 } 12708 12709 on(evt, cb) { 12710 this.evtMap[evt].push(cb) 12711 } 12712 12713 off(evt, lcb) { 12714 this.evtMap[evt] = this.evtMap[evt].filter((cb) => { 12715 return cb !== lcb 12716 }) 12717 } 12718 12719 trigger(evt, data) { 12720 this.evtMap[evt].map((handler) => { 12721 return handler(data) 12722 }) 12723 } 12724 12725 handleTouchStart(evt) { 12726 this.xDown = evt.touches[0].clientX 12727 this.yDown = evt.touches[0].clientY 12728 } 12729 12730 handleTouchEnd(evt) { 12731 const deltaX = evt.changedTouches[0].clientX - this.xDown 12732 const deltaY = evt.changedTouches[0].clientY - this.yDown 12733 if (Math.abs(deltaX) > Math.abs(deltaY)) { 12734 deltaX < 0 ? this.trigger('SWIPE_LEFT') : this.trigger('SWIPE_RIGHT') 12735 } else { 12736 deltaY > 0 ? this.trigger('SWIPE_DOWN') : this.trigger('SWIPE_UP') 12737 } 12738 } 12739} 12740/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Swipe); 12741 12742 12743/***/ }), 12744 12745/***/ "./src/partial/js/behavior/tooltip.js": 12746/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 12747 12748"use strict"; 12749/* harmony export */ __webpack_require__.d(__webpack_exports__, { 12750/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 12751/* harmony export */ }); 12752/* harmony import */ var _popperjs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@popperjs/core/lib/popper.js"); 12753 12754// import 'tippy.js/dist/tippy.css' // optional for styling 12755class Tooltip { 12756 /** 12757 * Instancia um comportamento Tooltip 12758 * @param {object} - Objeto de configuração inicial para tooltip 12759 * @property {object} component - Elemento DOM do tooltip (opcional se tiver o textTooltip) 12760 * @property {object} activator - Elemento DOM que representa o acionador do comportmento tooltip 12761 * @property {string} place -Local onde vai aparecer o tooltip ('top', 'right', 'bottom', 'left') 12762 * @property {string} timer - Tempo em que vai aparecer o tooltip em milisegunto (opcional) 12763 * @property {string} textTooltip - Texto que vai ser mostrado quando não estiver instaciado o atributo component 12764 * @property {string} type - Tipo de tooltip (info, warning) padrão info 12765 * @property {boolean} onActivator - Adiciona o tooltip dentro do elemento ativador padrão false 12766 */ 12767 12768 constructor({ 12769 component, 12770 activator, 12771 place = 'top', 12772 timer, 12773 active, 12774 textTooltip, 12775 type = 'info', 12776 onActivator = false 12777 }) { 12778 12779 const text_tooltip = textTooltip ? textTooltip : component 12780 this.onActivator = onActivator 12781 this.activator = activator 12782 this.component = component 12783 ? component 12784 : this._setContent(text_tooltip, type) 12785 12786 this.place = 12787 this.component.getAttribute('place') === null 12788 ? this.component.getAttribute('place') 12789 : place 12790 const positions = ['top', 'right', 'bottom', 'left'] 12791 this.popover = this.component.hasAttribute('popover') 12792 this.notification = this.component.classList.contains('br-notification') 12793 this.timer = this.component.getAttribute('timer') 12794 ? this.component.getAttribute('timer') 12795 : timer 12796 this.active = this.component.hasAttribute('active') 12797 ? this.component.hasAttribute('active') 12798 : active 12799 this.placement = positions.includes(place) 12800 ? place 12801 : this.notification 12802 12803 12804 this.popperInstance = null 12805 this.showEvents = ['mouseenter', 'click', 'focus'] 12806 this.hideEvents = ['mouseleave', 'blur'] 12807 this.closeTimer = null 12808 this._create() 12809 this._setBehavior() 12810 } 12811 /** 12812 * Instancializa o behavior 12813 */ 12814 _setBehavior() { 12815 // Ação de abrir padrao ao entrar no ativador 12816 if (this.activator) { 12817 this.showEvents.forEach((event) => { 12818 this.activator.addEventListener(event, (otherEvent) => { 12819 this._show(otherEvent) 12820 }) 12821 }) 12822 } 12823 // Adiciona ação de fechar ao botao do popover 12824 12825 if (this.popover) { 12826 const closeBtn = this.component.querySelector('.close') 12827 closeBtn.addEventListener('click', (event) => { 12828 this._hide(event, this.component) 12829 this._toggleActivatorIcon() 12830 }) 12831 // Ação de fechar padrao ao sair do ativador 12832 } else { 12833 this.hideEvents.forEach((event) => { 12834 this.activator.addEventListener(event, (otherEvent) => { 12835 this._hide(otherEvent, this.component) 12836 }) 12837 }) 12838 } 12839 } 12840 /** 12841 * Inclui o conteudo do tooltip 12842 * @param {*} contentText conteudo do texto do tooltip 12843 * @param {*} type tipo de tooltip 12844 * @returns - retorna o objeto com tooltip 12845 */ 12846 _setContent(contentText, type) { 12847 const text_tooltip = document.createElement('div') 12848 text_tooltip.setAttribute('role', 'tooltip') 12849 text_tooltip.setAttribute('place', 'top') 12850 text_tooltip.setAttribute(type, type) 12851 text_tooltip.innerText = `${contentText}` 12852 text_tooltip.classList.add('br-tooltip') 12853 //TODO: Retirar sample que utiliza não conflita com tooltip componente que está sendo depreciado 12854 text_tooltip.classList.add('sample') 12855 if (this.activator && this.onActivator) { 12856 this.activator.appendChild(text_tooltip) 12857 }else{ 12858 document.body.appendChild(text_tooltip) 12859 } 12860 12861 return text_tooltip 12862 } 12863 12864 /** 12865 * Cria a instancia do popper 12866 * @private 12867 */ 12868 12869 _create() { 12870 this._setLayout() 12871 12872 if (this.notification) { 12873 this.component.setAttribute('notification', '') 12874 this.popperInstance = (0,_popperjs_core__WEBPACK_IMPORTED_MODULE_0__/* .createPopper */ .fi)(this.activator, this.component, { 12875 modifiers: [ 12876 { 12877 name: 'offset', 12878 options: { 12879 offset: [0, 8], 12880 }, 12881 }, 12882 { 12883 name: 'preventOverflow', 12884 options: { 12885 altAxis: false, // false by default 12886 mainAxis: true, // true by default 12887 12888 }, 12889 }, 12890 {name: 'flip',options: {fallbackPlacements: ['top', 'right'],},}, 12891 ], 12892 // placement: this.placement, 12893 placement: 'bottom', 12894 strategy: 'fixed', 12895 }) 12896 } else { 12897 12898 12899 12900 this.popperInstance = (0,_popperjs_core__WEBPACK_IMPORTED_MODULE_0__/* .createPopper */ .fi)(this.activator, this.component, { 12901 modifiers: [ 12902 { 12903 name: 'offset', 12904 options: { 12905 offset: [0, 8], 12906 }, 12907 }, 12908 { 12909 name: 'preventOverflow', 12910 options: { 12911 altAxis: true, 12912 mainAxis: true, 12913 12914 12915 }, 12916 }, 12917 {name: 'flip',options: {fallbackPlacements: ['top', 'right',"bottom","left"],},}, 12918 ], 12919 placement: this.placement, 12920 }) 12921 } 12922 } 12923 /** 12924 * Mostra o tooltip e define o timeout se tiver 12925 * @param {object} event evento javascript 12926 */ 12927 _show(event) { 12928 12929 this.component.style.display = 'unset' 12930 this.component.setAttribute('data-show', '') 12931 this.component.style.zIndex = 9999 12932 this.popperInstance.update() 12933 // Importante pois "display: none" conflitua com a instancia do componente e precisa ser setado aqui já que pelo css ativa o efeito fade no primeiro carregamento 12934 this.component.style.visibility = 'visible' 12935 if (this.timer) { 12936 console.log("timer",this.timer) 12937 clearTimeout(this.closeTimer) 12938 this.closeTimer = setTimeout( 12939 this._hide, 12940 this.timer, 12941 event, 12942 this.component 12943 ) 12944 } 12945 } 12946 12947 12948 12949 /** 12950 * Esconde o componente 12951 * @private 12952 */ 12953 _hide(event, component) { 12954 component.removeAttribute('data-show') 12955 component.style.zIndex = -1 12956 component.style.visibility = 'hidden' 12957 clearTimeout(component.closeTimer) 12958 } 12959 /** 12960 * Cria o laytout do tooltip 12961 * @private 12962 */ 12963 _setLayout() { 12964 // Cria a setinha que aponta para o item que criou o tooltip 12965 const arrow = document.createElement('div') 12966 arrow.setAttribute('data-popper-arrow', '') 12967 12968 if (this.component.querySelectorAll('.arrow').length < 1) { 12969 arrow.classList.add('arrow') 12970 } 12971 this.component.appendChild(arrow) 12972 // Cria o icone de fechar do po over 12973 if (this.popover) { 12974 const close = document.createElement('button') 12975 close.setAttribute('type', 'button') 12976 close.classList.add('close') 12977 const ico = document.createElement('i') 12978 ico.classList.add('fas', 'fa-times') 12979 close.appendChild(ico) 12980 this.component.appendChild(close) 12981 } 12982 } 12983 /** 12984 * Muda icone da seta 12985 * @private 12986 */ 12987 _toggleActivatorIcon() { 12988 const icon = this.activator.querySelector('button svg') 12989 if (icon) { 12990 icon.classList.toggle('fa-angle-down') 12991 icon.classList.toggle('fa-angle-up') 12992 } 12993 this.activator.toggleAttribute('active') 12994 } 12995 12996 12997} 12998 12999/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Tooltip); 13000 13001 13002 13003/***/ }), 13004
13005/***/ "./src/partial/js/globals-class.js": 13006/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 13007 13008"use strict"; 13009 13010// EXPORTS 13011__webpack_require__.d(__webpack_exports__, { 13012 "Dropdown": () => (/* reexport */ dropdown["default"]), 13013 "Globals": () => (/* binding */ Globals) 13014}); 13015 13016// UNUSED EXPORTS: Accordion, BRAccordion, BRAvatar, BRBreadcrumb, BRCard, BRCheckbox, BRCookiebar, BRDateTimePicker, BRFooter, BRHeader, BRInput, BRItem, BRList, BRMenu, BRMessage, BRModal, BRNotification, BRPagination, BRScrim, BRSelect, BRTab, BRTable, BRTag, BRTextarea, BRTooltip, BRUpload, BRWizard, Checkgroup, Collapse, Swipe, default 13017 13018// EXTERNAL MODULE: ./src/components/accordion/accordion.js 13019var accordion = __webpack_require__("./src/components/accordion/accordion.js"); 13020// EXTERNAL MODULE: ./src/components/avatar/avatar.js 13021var avatar = __webpack_require__("./src/components/avatar/avatar.js"); 13022// EXTERNAL MODULE: ./src/components/breadcrumb/breadcrumb.js 13023var breadcrumb = __webpack_require__("./src/components/breadcrumb/breadcrumb.js"); 13024// EXTERNAL MODULE: ./src/components/card/card.js 13025var card = __webpack_require__("./src/components/card/card.js"); 13026// EXTERNAL MODULE: ./src/components/carousel/carousel.js 13027var carousel = __webpack_require__("./src/components/carousel/carousel.js"); 13028// EXTERNAL MODULE: ./src/components/checkbox/checkbox.js 13029var checkbox_checkbox = __webpack_require__("./src/components/checkbox/checkbox.js"); 13030// EXTERNAL MODULE: ./src/components/cookiebar/cookiebar.js + 1 modules 13031var cookiebar = __webpack_require__("./src/components/cookiebar/cookiebar.js"); 13032;// CONCATENATED MODULE: ./src/components/cookiebar/jsonData.js 13033const jsonData = `[ 13034 { 13035 "lang": "pt-br", 13036 "allOptOut": true, 13037 "acceptButton": "Aceitar", 13038 "optOutButton": "Definir Cookies", 13039 "optInButton": "Ver PolÃtica de Cookies", 13040 "infoText": "Minim pariatur amet laboris sint consectetur enim do voluptate", 13041 "mainTitle": "Exercitation et proident", 13042 "lastUpdate": "01/02/2021", 13043 "entryText": "Lorem, ipsum dolor sit amet consectetur adipisicing elit. Doloribus aspernatur neque culpa nisi alias. Voluptatem dicta nihil magnam, cumque voluptatum animi distinctio molestias recusandae ipsam, sapiente unde error repellendus quibusdam?", 13044 "selectAll": false, 13045 "allAlertMessage": "Ao desativar essa opção, sua navegação ficará comprometida", 13046 "closeLabel": "fechar", 13047 "lastUpdateLabel": "Ãltima atualização", 13048 "cookieGroupsLabel": "Classes de cookies", 13049 "selectAllLabel": "Selecionar tudo", 13050 "unselectAllLabel": "Desselecionar tudo", 13051 "selectAllGroupLabel": "Selecionar toda classe", 13052 "unselectAllGroupLabel": "Desselecionar toda classe", 13053 "onLabel": "Ligado", 13054 "offLabel": "Desligado", 13055 "alwaysActiveLabel": "Sempre ativo", 13056 "cookieNameLabel": "Cookies", 13057 "expiresLabel": "Vencimento", 13058 "domainLabel": "DomÃnio", 13059 "enterpriseLabel": "Empresa", 13060 "purposeLabel": "Finalidade", 13061 "descriptionLabel": "Descrição", 13062 "cookieGroups": [ 13063 { 13064 "groupId": "necessarios", 13065 "groupName": "Estritamente necessários", 13066 "groupOptOut": false, 13067 "groupSelected": false, 13068 "groupAlertMessage": "Alerta group 0", 13069 "groupText": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Nostrum delectus fuga omnis, placeat harum id aliquam, blanditiis consectetur est cupiditate ipsam alias vitae veritatis beatae, aperiam totam assumenda. Sed, modi!", 13070 "cookieList": [ 13071 { 13072 "cookieId": "necessario-1", 13073 "cookieOptOut": false, 13074 "cookieSelected": false, 13075 "alertMessage": "Alerta group 0 - cookie 0", 13076 "cookieName": "optimizelyEndUserId", 13077 "expires": "30 minutos", 13078 "domain": "serpro.gov.br", 13079 "entreprise": "Serpro", 13080 "purpose": "Autorização", 13081 "description": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Qui numquam inventore fuga consectetur minus accusantium sapiente, distinctio dolorum illum, doloremque rem deleniti recusandae quod rerum quidem amet? Unde, laudantium cum." 13082 }, 13083 { 13084 "cookieId": "necessario-2", 13085 "cookieOptOut": false, 13086 "cookieSelected": false, 13087 "alertMessage": "Alerta group 0 - cookie 1", 13088 "cookieName": "optimizelyEndUserId", 13089 "expires": "30 minutos", 13090 "domain": "serpro.gov.br", 13091 "entreprise": "Serpro", 13092 "purpose": "Autorização", 13093 "description": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Qui numquam inventore fuga consectetur minus accusantium sapiente, distinctio dolorum illum, doloremque rem deleniti recusandae quod rerum quidem amet? Unde, laudantium cum." 13094 } 13095 ] 13096 }, 13097 { 13098 "groupId": "desempenho", 13099 "groupName": "Desempenho, funcionamento, marketing e personalização", 13100 "groupOptOut": true, 13101 "groupSelected": true, 13102 "groupAlertMessage": "Alerta group 1", 13103 "groupText": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Nostrum delectus fuga omnis, placeat harum id aliquam, blanditiis consectetur est cupiditate ipsam alias vitae veritatis beatae, aperiam totam assumenda. Sed, modi!", 13104 "cookieList": [ 13105 { 13106 "cookieId": "desempenho-2", 13107 "cookieOptOut": true, 13108 "cookieSelected": false, 13109 "alertMessage": "Alerta group 1 - cookie 1", 13110 "cookieName": "optimizelyEndUserId", 13111 "expires": "30 minutos", 13112 "domain": "serpro.gov.br", 13113 "entreprise": "Serpro", 13114 "purpose": "Autorização", 13115 "description": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Qui numquam inventore fuga consectetur minus accusantium sapiente, distinctio dolorum illum, doloremque rem deleniti recusandae quod rerum quidem amet? Unde, laudantium cum." 13116 }, 13117 { 13118 "cookieId": "desempenho-2", 13119 "cookieOptOut": true, 13120 "cookieSelected": false, 13121 "cookieName": "optimizelyEndUserId", 13122 "expires": "30 minutos", 13123 "domain": "serpro.gov.br", 13124 "entreprise": "Serpro", 13125 "purpose": "Autorização", 13126 "description": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Qui numquam inventore fuga consectetur minus accusantium sapiente, distinctio dolorum illum, doloremque rem deleniti recusandae quod rerum quidem amet? Unde, laudantium cum." 13127 } 13128 ] 13129 }, 13130 { 13131 "groupId": "experiencia", 13132 "groupName": "Experiência do site", 13133 "groupOptOut": true, 13134 "groupSelected": false, 13135 "groupAlertMessage": "Ao desativar essa opção, sua navegação ficará comprometida", 13136 "groupText": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Nostrum delectus fuga omnis, placeat harum id aliquam, blanditiis consectetur est cupiditate ipsam alias vitae veritatis beatae, aperiam totam assumenda. Sed, modi!", 13137 "cookieList": [ 13138 { 13139 "cookieId": "experiencia-1", 13140 "cookieOptOut": false, 13141 "cookieSelected": false, 13142 "alertMessage": "Alerta group 2 - cookie 0", 13143 "cookieName": "optimizelyEndUserId", 13144 "expires": "30 minutos", 13145 "domain": "serpro.gov.br", 13146 "entreprise": "Serpro", 13147 "purpose": "Autorização", 13148 "description": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Qui numquam inventore fuga consectetur minus accusantium sapiente, distinctio dolorum illum, doloremque rem deleniti recusandae quod rerum quidem amet? Unde, laudantium cum." 13149 }, 13150 { 13151 "cookieId": "experiencia-2", 13152 "cookieOptOut": true, 13153 "cookieSelected": false, 13154 "cookieName": "optimizelyEndUserId", 13155 "expires": "30 minutos", 13156 "domain": "serpro.gov.br", 13157 "entreprise": "Serpro", 13158 "purpose": "Autorização", 13159 "description": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Qui numquam inventore fuga consectetur minus accusantium sapiente, distinctio dolorum illum, doloremque rem deleniti recusandae quod rerum quidem amet? Unde, laudantium cum." 13160 } 13161 ] 13162 } 13163 ], 13164 "noteTitle": "Aviso sobre cookies", 13165 "noteList": [ 13166 { 13167 "question": "O que são cookies?", 13168 "answer": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Aperiam eius distinctio rerum ad, maxime alias vel minima, asperiores sequi eveniet non optio officiis quaerat reiciendis quae odio explicabo ut debitis?" 13169 }, 13170 { 13171 "question": "Durabilidade?", 13172 "answer": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Aperiam eius distinctio rerum ad, maxime alias vel minima, asperiores sequi eveniet non optio officiis quaerat reiciendis quae odio explicabo ut debitis?" 13173 }, 13174 { 13175 "question": "Proveniência?", 13176 "answer": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Aperiam eius distinctio rerum ad, maxime alias vel minima, asperiores sequi eveniet non optio officiis quaerat reiciendis quae odio explicabo ut debitis?" 13177 }, 13178 { 13179 "question": "Finalidade?", 13180 "answer": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Aperiam eius distinctio rerum ad, maxime alias vel minima, asperiores sequi eveniet non optio officiis quaerat reiciendis quae odio explicabo ut debitis?" 13181 } 13182 ], 13183 "links": [ 13184 { 13185 "name": "Declaração de Conformidade com os PrincÃpios de Proteção de Dados", 13186 "url": "#" 13187 } 13188 ] 13189 } 13190]` 13191 13192/* harmony default export */ const cookiebar_jsonData = (jsonData); 13193 13194// EXTERNAL MODULE: ./src/components/datetimepicker/datetimepicker.js + 7 modules 13195var datetimepicker = __webpack_require__("./src/components/datetimepicker/datetimepicker.js"); 13196// EXTERNAL MODULE: ./src/components/footer/footer.js 13197var footer = __webpack_require__("./src/components/footer/footer.js"); 13198// EXTERNAL MODULE: ./src/components/header/header.js 13199var header = __webpack_require__("./src/components/header/header.js"); 13200// EXTERNAL MODULE: ./src/components/input/input.js 13201var input = __webpack_require__("./src/components/input/input.js"); 13202;// CONCATENATED MODULE: ./src/components/input/input-data.js 13203/** 13204 * Dados para popular o input de exemplo 13205 * @constant {string[]} */ 13206const inputData = [ 13207 'Afeganistão', 13208 'Ãfrica do Sul', 13209 'Albânia', 13210 'Alemanha', 13211 'Andorra', 13212 'Angola', 13213 'Anguilla', 13214 'Antártida', 13215 'AntÃgua e Barbuda', 13216 'Antilhas Holandesas', 13217 'Arábia Saudita', 13218 'Argélia', 13219 'Argentina', 13220 'Armênia', 13221 'Aruba', 13222 'Austrália', 13223 'Ãustria', 13224 'Azerbaijão', 13225 'Bahamas', 13226 'Bahrein', 13227 'Bangladesh', 13228 'Barbados', 13229 'Belarus', 13230 'Bélgica', 13231 'Belize', 13232 'Benin', 13233 'Bermudas', 13234 'BolÃvia', 13235 'Bósnia-Herzegóvina', 13236 'Botsuana', 13237 'Brasil', 13238 'Brunei', 13239 'Bulgária', 13240 'Burkina Fasso', 13241 'Burundi', 13242 'Butão', 13243 'Cabo Verde', 13244 'Camarões', 13245 'Camboja', 13246 'Canadá', 13247 'Cazaquistão', 13248 'Chade', 13249 'Chile', 13250 'China', 13251 'Chipre', 13252 'Cingapura', 13253 'Colômbia', 13254 'Congo', 13255 'Coréia do Norte', 13256 'Coréia do Sul', 13257 'Costa do Marfim', 13258 'Costa Rica', 13259 'Croácia (Hrvatska)', 13260 'Cuba', 13261 'Dinamarca', 13262 'Djibuti', 13263 'Dominica', 13264 'Egito', 13265 'El Salvador', 13266 'Emirados Ãrabes Unidos', 13267 'Equador', 13268 'Eritréia', 13269 'Eslováquia', 13270 'Eslovênia', 13271 'Espanha', 13272 'Estados Unidos',
vendor: 14,537 bytes, lines 13273-13809
13273 'Estônia', 13274 'Etiópia', 13275 'Fiji', 13276 'Filipinas', 13277 'Finlândia', 13278 'França', 13279 'Gabão', 13280 'Gâmbia', 13281 'Gana', 13282 'Geórgia', 13283 'Gibraltar', 13284 'Grã-Bretanha (Reino Unido, UK)', 13285 'Granada', 13286 'Grécia', 13287 'Groelândia', 13288 'Guadalupe', 13289 'Guam (Território dos Estados Unidos)', 13290 'Guatemala', 13291 'Guernsey', 13292 'Guiana', 13293 'Guiana Francesa', 13294 'Guiné', 13295 'Guiné Equatorial', 13296 'Guiné-Bissau', 13297 'Haiti', 13298 'Holanda', 13299 'Honduras', 13300 'Hong Kong', 13301 'Hungria', 13302 'Iêmen', 13303 'Ilha Bouvet (Território da Noruega)', 13304 'Ilha do Homem', 13305 'Ilha Natal', 13306 'Ilha Pitcairn', 13307 'Ilha Reunião', 13308 'Ilhas Aland', 13309 'Ilhas Cayman', 13310 'Ilhas Cocos', 13311 'Ilhas Comores', 13312 'Ilhas Cook', 13313 'Ilhas Faroes', 13314 'Ilhas Falkland (Malvinas)', 13315 'Ilhas Geórgia do Sul e Sandwich do Sul', 13316 'Ilhas Heard e McDonald (Território da Austrália)', 13317 'Ilhas Marianas do Norte', 13318 'Ilhas Marshall', 13319 'Ilhas Menores dos Estados Unidos', 13320 'Ilhas Norfolk', 13321 'Ilhas Seychelles', 13322 'Ilhas Solomão', 13323 'Ilhas Svalbard e Jan Mayen', 13324 'Ilhas Tokelau', 13325 'Ilhas Turks e Caicos', 13326 'Ilhas Virgens (Estados Unidos)', 13327 'Ilhas Virgens (Inglaterra)', 13328 'Ilhas Wallis e Futuna', 13329 'Ãndia', 13330 'Indonésia', 13331 'Irã', 13332 'Iraque', 13333 'Irlanda', 13334 'Islândia', 13335 'Israel', 13336 'Itália', 13337 'Jamaica', 13338 'Japão', 13339 'Jersey', 13340 'Jordânia', 13341 'Kênia', 13342 'Kiribati', 13343 'Kuait', 13344 'Laos', 13345 'Látvia', 13346 'Lesoto', 13347 'LÃbano', 13348 'Libéria', 13349 'LÃbia', 13350 'Liechtenstein', 13351 'Lituânia', 13352 'Luxemburgo', 13353 'Macau', 13354 'Macedônia (República Yugoslava)', 13355 'Madagascar', 13356 'Malásia', 13357 'Malaui', 13358 'Maldivas', 13359 'Mali', 13360 'Malta', 13361 'Marrocos', 13362 'Martinica', 13363 'MaurÃcio', 13364 'Mauritânia', 13365 'Mayotte', 13366 'México', 13367 'Micronésia', 13368 'Moçambique', 13369 'Moldova', 13370 'Mônaco', 13371 'Mongólia', 13372 'Montenegro', 13373 'Montserrat', 13374 'Myanma', 13375 'NamÃbia', 13376 'Nauru', 13377 'Nepal', 13378 'Nicarágua', 13379 'NÃger', 13380 'Nigéria', 13381 'Niue', 13382 'Noruega', 13383 'Nova Caledônia', 13384 'Nova Zelândia', 13385 'Omã', 13386 'Palau', 13387 'Panamá', 13388 'Papua-Nova Guiné', 13389 'Paquistão', 13390 'Paraguai', 13391 'Peru', 13392 'Polinésia Francesa', 13393 'Polônia', 13394 'Porto Rico', 13395 'Portugal', 13396 'Qatar', 13397 'Quirguistão', 13398 'República Centro-Africana', 13399 'República Democrática do Congo', 13400 'República Dominicana', 13401 'República Tcheca', 13402 'Romênia', 13403 'Ruanda', 13404 'Rússia (antiga URSS) - Federação Russa', 13405 'Saara Ocidental', 13406 'Saint Vincente e Granadinas', 13407 'Samoa Americana', 13408 'Samoa Ocidental', 13409 'San Marino', 13410 'Santa Helena', 13411 'Santa Lúcia', 13412 'São Bartolomeu', 13413 'São Cristóvão e Névis', 13414 'São Martim', 13415 'São Tomé e PrÃncipe', 13416 'Senegal', 13417 'Serra Leoa', 13418 'Sérvia', 13419 'SÃria', 13420 'Somália', 13421 'Sri Lanka', 13422 'St. Pierre and Miquelon', 13423 'Suazilândia', 13424 'Sudão', 13425 'Suécia', 13426 'SuÃça', 13427 'Suriname', 13428 'Tadjiquistão', 13429 'Tailândia', 13430 'Taiwan', 13431 'Tanzânia', 13432 'Território Britânico do Oceano Ãndico', 13433 'Territórios do Sul da França', 13434 'Territórios Palestinos Ocupados', 13435 'Timor Leste', 13436 'Togo', 13437 'Tonga', 13438 'Trinidad and Tobago', 13439 'TunÃsia', 13440 'Turcomenistão', 13441 'Turquia', 13442 'Tuvalu', 13443 'Ucrânia', 13444 'Uganda', 13445 'Uruguai', 13446 'Uzbequistão', 13447 'Vanuatu', 13448 'Vaticano', 13449 'Venezuela', 13450 'Vietnã', 13451 'Zâmbia', 13452 'Zimbábue', 13453] 13454 13455/* harmony default export */ const input_data = (inputData); 13456 13457// EXTERNAL MODULE: ./src/components/item/item.js 13458var item = __webpack_require__("./src/components/item/item.js"); 13459// EXTERNAL MODULE: ./src/components/list/list.js 13460var list = __webpack_require__("./src/components/list/list.js"); 13461// EXTERNAL MODULE: ./src/components/menu/menu.js 13462var menu = __webpack_require__("./src/components/menu/menu.js"); 13463// EXTERNAL MODULE: ./src/components/message/message.js 13464var message = __webpack_require__("./src/components/message/message.js"); 13465// EXTERNAL MODULE: ./src/components/modal/modal.js 13466var modal = __webpack_require__("./src/components/modal/modal.js"); 13467// EXTERNAL MODULE: ./src/components/notification/notification.js 13468var notification = __webpack_require__("./src/components/notification/notification.js"); 13469// EXTERNAL MODULE: ./src/components/pagination/pagination.js 13470var pagination = __webpack_require__("./src/components/pagination/pagination.js"); 13471// EXTERNAL MODULE: ./src/components/scrim/scrim.js 13472var scrim_scrim = __webpack_require__("./src/components/scrim/scrim.js"); 13473// EXTERNAL MODULE: ./src/components/select/select.js 13474var select_select = __webpack_require__("./src/components/select/select.js"); 13475// EXTERNAL MODULE: ./src/components/step/step.js 13476var step = __webpack_require__("./src/components/step/step.js"); 13477// EXTERNAL MODULE: ./src/components/tab/tab.js 13478var tab = __webpack_require__("./src/components/tab/tab.js"); 13479// EXTERNAL MODULE: ./src/components/table/table.js 13480var table = __webpack_require__("./src/components/table/table.js"); 13481// EXTERNAL MODULE: ./src/components/tag/tag.js 13482var tag = __webpack_require__("./src/components/tag/tag.js"); 13483// EXTERNAL MODULE: ./src/components/textarea/textarea.js 13484var textarea_textarea = __webpack_require__("./src/components/textarea/textarea.js"); 13485// EXTERNAL MODULE: ./src/components/tooltip/tooltip.js 13486var tooltip = __webpack_require__("./src/components/tooltip/tooltip.js"); 13487// EXTERNAL MODULE: ./src/components/upload/upload.js 13488var upload = __webpack_require__("./src/components/upload/upload.js"); 13489// EXTERNAL MODULE: ./src/components/wizard/wizard.js 13490var wizard = __webpack_require__("./src/components/wizard/wizard.js"); 13491// EXTERNAL MODULE: ./src/partial/js/behavior/dropdown.js 13492var dropdown = __webpack_require__("./src/partial/js/behavior/dropdown.js"); 13493;// CONCATENATED MODULE: ./src/partial/js/globals-class.js 13494// Script Templates 13495 13496 13497 13498 13499 13500 13501 13502 // dados para instanciação do cookiebar 13503 13504 13505 13506 13507 // Dados para o autocomplete do input 13508 13509 13510 13511 13512 13513 13514 13515 13516 13517 13518 13519 13520 13521 13522 13523 13524 13525 13526 13527 13528 13529 13530 13531class Globals { 13532 initInstanceAll() { 13533 this.initInstanceAccordion() 13534 this.initInstanceAvatar() 13535 this.initInstanceBreadcrumb() 13536 this.initInstanceCard() 13537 this.initInstanceCarousel() 13538 this.initInstanceCheckbox() 13539 this.initInstanceCookiebar() 13540 this.initInstanceDateTimePicker() 13541 this.initInstanceFooter() 13542 this.initInstanceInput() 13543 this.initInstanceHeader() 13544 this.initInstanceItem() 13545 this.initInstanceList() 13546 this.initInstanceMenu() 13547 this.initInstanceMessage() 13548 this.initInstanceModal() 13549 this.initInstanceNotification() 13550 this.initInstancePagination() 13551 this.initInstanceScrim() 13552 this.initInstanceSelect() 13553 this.initInstanceStep() 13554 this.initInstanceTable() 13555 this.initInstanceTabs() 13556 this.initInstanceTextarea() 13557 this.initInstanceUpload() 13558 this.initInstanceWizard() 13559 this.initInstanceTooltip() 13560 } 13561 13562 initInstanceAccordion() { 13563 const accordionList = [] 13564 for (const brAccordion of window.document.querySelectorAll( 13565 '.br-accordion' 13566 )) { 13567 accordionList.push(new accordion/* default */.Z('br-accordion', brAccordion)) 13568 } 13569 } 13570 13571 initInstanceAvatar() { 13572 const avatarList = [] 13573 for (const brAvatar of window.document.querySelectorAll('.br-avatar')) { 13574 avatarList.push(new avatar/* default */.Z('br-avatar', brAvatar)) 13575 } 13576 } 13577 13578 initInstanceBreadcrumb() { 13579 const breadcrumbList = [] 13580 for (const brBreadcrumb of window.document.querySelectorAll( 13581 '.br-breadcrumb' 13582 )) { 13583 breadcrumbList.push(new breadcrumb/* default */.Z('br-breadcrumb', brBreadcrumb)) 13584 } 13585 } 13586 13587 initInstanceDateTimePicker() { 13588 const datetimepickerList = [] 13589 for (const brDateTimePicker of window.document.querySelectorAll( 13590 '.br-datetimepicker' 13591 )) { 13592 datetimepickerList.push( 13593 new datetimepicker/* default */.Z('br-datetimepicker', brDateTimePicker, {}) 13594 ) 13595 } 13596 } 13597 13598 initInstanceHeader() { 13599 const headerList = [] 13600 for (const brHeader of window.document.querySelectorAll('.br-header')) { 13601 headerList.push(new header/* default */.Z('br-header', brHeader)) 13602 } 13603 } 13604 initInstanceFooter() { 13605 const listFooter = [] 13606 for (const brFooter of window.document.querySelectorAll('.br-footer')) { 13607 listFooter.push(new footer/* default */.Z('br-footer', brFooter)) 13608 } 13609 } 13610 13611 initInstanceInput() { 13612 const inputList = [] 13613 for (const brInput of window.document.querySelectorAll('.br-input')) { 13614 inputList.push(new input/* default */.Z('br-input', brInput)) 13615 } 13616 for (const brInput of inputList) { 13617 brInput.component 13618 .querySelectorAll('input.search-autocomplete') 13619 .forEach(() => { 13620 brInput.setAutocompleteData(input_data) 13621 }) 13622 } 13623 } 13624 13625 initInstanceItem() { 13626 const itemList = [] 13627 for (const brItem of window.document.querySelectorAll('.br-item')) { 13628 itemList.push(new item/* default */.Z('br-item', brItem)) 13629 } 13630 } 13631 13632 initInstanceList() { 13633 const listList = [] 13634 for (const brList of window.document.querySelectorAll( 13635 '.br-list:not([data-sub])' 13636 )) { 13637 listList.push(new list/* default */.Z('br-list', brList)) 13638 } 13639 } 13640 13641 initInstanceMenu() { 13642 const menuList = [] 13643 for (const brMenu of window.document.querySelectorAll('.br-menu')) { 13644 menuList.push(new menu/* default */.Z('br-menu', brMenu)) 13645 } 13646 } 13647 13648 initInstanceMessage() { 13649 const alertList = [] 13650 for (const brMessage of window.document.querySelectorAll('.br-message')) { 13651 alertList.push(new message/* default */.Z('br-message', brMessage)) 13652 } 13653 } 13654 13655 initInstanceModal() { 13656 const modalList = [] 13657 for (const brModal of window.document.querySelectorAll('.br-modal')) { 13658 modalList.push(new modal/* default */.Z('br-modal', brModal)) 13659 } 13660 for (const brScrim of window.document.querySelectorAll('.br-scrim')) { 13661 const scrim = new scrim_scrim/* default */.Z('br-scrim', brScrim) 13662 for (const button of window.document.querySelectorAll( 13663 '.br-scrim + button' 13664 )) { 13665 button.addEventListener('click', () => { 13666 scrim.showScrim() 13667 }) 13668 } 13669 } 13670 } 13671 13672 initInstanceNotification() { 13673 const notificationList = [] 13674 for (const brNotification of window.document.querySelectorAll( 13675 '.br-notification' 13676 )) { 13677 notificationList.push( 13678 new notification/* default */.Z('br-notification', brNotification) 13679 ) 13680 } 13681 } 13682 13683 initInstancePagination() { 13684 const paginationList = [] 13685 for (const brPagination of window.document.querySelectorAll( 13686 '.br-pagination' 13687 )) { 13688 paginationList.push(new pagination/* default */.Z('br-pagination', brPagination)) 13689 } 13690 } 13691 13692 initInstanceScrim() { 13693 const scrimList = [] 13694 for (const brScrim of window.document.querySelectorAll('.br-scrim')) { 13695 scrimList.push(new scrim_scrim/* default */.Z('br-scrim', brScrim)) 13696 } 13697 for (const buttonBloco1 of window.document.querySelectorAll( 13698 '.bloco1 button' 13699 )) { 13700 buttonBloco1.addEventListener('click', () => { 13701 for (const brScrim of scrimList) { 13702 brScrim.showScrim() 13703 } 13704 }) 13705 } 13706 } 13707 13708 initInstanceSelect() { 13709 const selectList = [] 13710 for (const brSelect of window.document.querySelectorAll('.br-select')) { 13711 const brselect = new select_select/* default */.Z('br-select', brSelect) 13712 //Exemplo de uso de listener do select 13713 // brSelect.addEventListener('onChange', () => {}) 13714 13715 selectList.push(brselect) 13716 } 13717 } 13718 13719 initInstanceTable() { 13720 const tableList = [] 13721 for (const [index, brTable] of window.document 13722 .querySelectorAll('.br-table') 13723 .entries()) { 13724 tableList.push(new table/* default */.Z('br-table', brTable, index)) 13725 } 13726 } 13727 13728 initInstanceTag() { 13729 const tagList = [] 13730 for (const brTag of window.document.querySelectorAll('.br-tag')) { 13731 tagList.push(new tag/* default */.Z('br-tag', brTag)) 13732 } 13733 } 13734 13735 initInstanceTabs() { 13736 const abasList = [] 13737 for (const brTab of window.document.querySelectorAll('.br-tab')) { 13738 abasList.push(new tab/* default */.Z('br-tab', brTab)) 13739 } 13740 } 13741 13742 initInstanceTooltip() { 13743 const tooltipList = [] 13744 for (const brTooltip of window.document.querySelectorAll('.br-tooltip')) { 13745 tooltipList.push(new tooltip/* default */.Z('br-tooltip', brTooltip)) 13746 } 13747 } 13748 13749 initInstanceUpload() { 13750 const uploadList = [] 13751 function uploadTimeout() { 13752 return new Promise((resolve) => { 13753 // Colocar aqui um upload para o servidor e retirar o timeout 13754 return setTimeout(resolve, 500) 13755 }) 13756 } 13757 for (const brUpload of window.document.querySelectorAll('.br-upload')) { 13758 uploadList.push(new upload/* default */.Z('br-upload', brUpload, uploadTimeout)) 13759 } 13760 } 13761 13762 initInstanceStep() { 13763 const stepList = [] 13764 for (const brStep of window.document.querySelectorAll('.br-step')) { 13765 stepList.push(new step/* default */.Z('br-step', brStep)) 13766 } 13767 } 13768 13769 initInstanceWizard() { 13770 const wizardList = [] 13771 for (const brWizard of window.document.querySelectorAll('.br-wizard')) { 13772 wizardList.push(new wizard/* default */.Z('br-wizard', brWizard)) 13773 } 13774 } 13775 13776 initInstanceCard() { 13777 const listCard = [] 13778 for (const brCard of window.document.querySelectorAll('.br-card')) { 13779 listCard.push(new card/* default */.Z('br-card', brCard)) 13780 } 13781 } 13782 initInstanceCarousel() { 13783 const carouselList = [] 13784 for (const brCarousel of window.document.querySelectorAll('.br-carousel')) { 13785 carouselList.push(new carousel/* default */.Z('br-carousel', brCarousel)) 13786 } 13787 } 13788 13789 initInstanceCheckbox() { 13790 const checkboxList = [] 13791 for (const brCheckbox of window.document.querySelectorAll('.br-checkbox')) { 13792 checkboxList.push(new checkbox_checkbox/* default */.Z('br-checkbox', brCheckbox)) 13793 } 13794 } 13795 13796 initInstanceCookiebar() { 13797 /** Exemplo de instanciação de um objeto cookiebar */ 13798 const cookiebarList = [] 13799 for (const brCookiebar of window.document.querySelectorAll( 13800 '.br-cookiebar' 13801 )) { 13802 const params = { 13803 // callback: (outputJSON) => { console.log(JSON.parse(outputJSON)) console.log(outputJSON) }, 13804 component: brCookiebar, 13805 json: cookiebar_jsonData, 13806 lang: 'pt-br', 13807 mode: 'default', 13808 name: 'br-cookiebar', 13809 }
13810 // CookiebarData.loadJSON('./data.json', (response) => { 13811 // return (params.json = response) 13812 // }) 13813 cookiebarList.push(new cookiebar/* default */.Z(params)) 13814 } 13815 13816 /** Exemplo de instanciação do cookibar apenas sem necessidade de um HTML base */ 13817 // BRCookiebar.createCookiebar(jsonData, showOutput) 13818 } 13819 13820 initInstanceTextarea() { 13821 const textareaList = [] 13822 for (const brTextarea of window.document.querySelectorAll('.br-textarea')) { 13823 textareaList.push(new textarea_textarea/* default */.Z('br-textarea', brTextarea)) 13824 } 13825 } 13826 initInstanceWizard() { 13827 const wizardList = [] 13828 for (const brWizard of window.document.querySelectorAll('.br-wizard')) { 13829 wizardList.push(new wizard/* default */.Z('br-wizard', brWizard)) 13830 } 13831 } 13832} 13833 13834 13835 13836 13837/***/ })
vendor: 5,031 bytes, lines 13837-13943
13837 13838 13839/******/ }); 13840/************************************************************************/ 13841/******/ // The module cache 13842/******/ var __webpack_module_cache__ = {}; 13843/******/ 13844/******/ // The require function 13845/******/ function __webpack_require__(moduleId) { 13846/******/ // Check if module is in cache 13847/******/ var cachedModule = __webpack_module_cache__[moduleId]; 13848/******/ if (cachedModule !== undefined) { 13849/******/ return cachedModule.exports; 13850/******/ } 13851/******/ // Create a new module (and put it into the cache) 13852/******/ var module = __webpack_module_cache__[moduleId] = { 13853/******/ // no module.id needed 13854/******/ // no module.loaded needed 13855/******/ exports: {} 13856/******/ }; 13857/******/ 13858/******/ // Execute the module function 13859/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); 13860/******/ 13861/******/ // Return the exports of the module 13862/******/ return module.exports; 13863/******/ } 13864/******/ 13865/************************************************************************/ 13866/******/ /* webpack/runtime/define property getters */ 13867/******/ (() => { 13868/******/ // define getter functions for harmony exports 13869/******/ __webpack_require__.d = (exports, definition) => { 13870/******/ for(var key in definition) { 13871/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 13872/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 13873/******/ } 13874/******/ } 13875/******/ }; 13876/******/ })(); 13877/******/ 13878/******/ /* webpack/runtime/hasOwnProperty shorthand */ 13879/******/ (() => { 13880/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 13881/******/ })(); 13882/******/ 13883/******/ /* webpack/runtime/make namespace object */ 13884/******/ (() => { 13885/******/ // define __esModule on exports 13886/******/ __webpack_require__.r = (exports) => { 13887/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 13888/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 13889/******/ } 13890/******/ Object.defineProperty(exports, '__esModule', { value: true }); 13891/******/ }; 13892/******/ })(); 13893/******/ 13894/************************************************************************/ 13895var __webpack_exports__ = {}; 13896// This entry need to be wrapped in an IIFE because it need to be in strict mode. 13897(() => { 13898"use strict"; 13899// ESM COMPAT FLAG 13900__webpack_require__.r(__webpack_exports__); 13901 13902// EXPORTS 13903__webpack_require__.d(__webpack_exports__, { 13904 "Accordion": () => (/* reexport */ behavior_accordion["default"]), 13905 "BRAccordion": () => (/* reexport */ accordion/* default */.Z), 13906 "BRAlert": () => (/* reexport */ message/* default */.Z), 13907 "BRBreadcrumb": () => (/* reexport */ breadcrumb/* default */.Z), 13908 "BRCard": () => (/* reexport */ card/* default */.Z), 13909 "BRCarousel": () => (/* reexport */ carousel/* default */.Z), 13910 "BRCheckbox": () => (/* reexport */ checkbox_checkbox/* default */.Z), 13911 "BRCookiebar": () => (/* reexport */ cookiebar/* default */.Z), 13912 "BRDateTimePicker": () => (/* reexport */ datetimepicker/* default */.Z), 13913 "BRFooter": () => (/* reexport */ footer/* default */.Z), 13914 "BRHeader": () => (/* reexport */ header/* default */.Z), 13915 "BRInput": () => (/* reexport */ input/* default */.Z), 13916 "BRItem": () => (/* reexport */ item/* default */.Z), 13917 "BRList": () => (/* reexport */ list/* default */.Z), 13918 "BRMenu": () => (/* reexport */ menu/* default */.Z), 13919 "BRModal": () => (/* reexport */ modal/* default */.Z), 13920 "BRNotification": () => (/* reexport */ notification/* default */.Z), 13921 "BRPagination": () => (/* reexport */ pagination/* default */.Z), 13922 "BRScrim": () => (/* reexport */ scrim/* default */.Z), 13923 "BRSelect": () => (/* reexport */ select_select/* default */.Z), 13924 "BRStep": () => (/* reexport */ step/* default */.Z), 13925 "BRTab": () => (/* reexport */ tab/* default */.Z), 13926 "BRTable": () => (/* reexport */ table/* default */.Z), 13927 "BRTag": () => (/* reexport */ tag/* default */.Z), 13928 "BRTextarea": () => (/* reexport */ textarea_textarea/* default */.Z), 13929 "BRTooltip": () => (/* reexport */ tooltip/* default */.Z), 13930 "BRUpload": () => (/* reexport */ upload/* default */.Z), 13931 "BRWizard": () => (/* reexport */ wizard/* default */.Z), 13932 "Checkgroup": () => (/* reexport */ behavior_checkgroup["default"]), 13933 "Collapse": () => (/* reexport */ behavior_collapse["default"]), 13934 "Dropdown": () => (/* reexport */ globals_class.Dropdown), 13935 "Globals": () => (/* reexport */ globals_class.Globals), 13936 "Swipe": () => (/* reexport */ swipe/* default */.Z), 13937 "Tooltip": () => (/* reexport */ behavior_tooltip["default"]), 13938 "behavior": () => (/* binding */ behavior), 13939 "globals": () => (/* binding */ globals) 13940}); 13941 13942// EXTERNAL MODULE: ./node_modules/focus-visible/dist/focus-visible.js 13943var focus_visible = __webpack_require__("./node_modules/focus-visible/dist/focus-visible.js");
vendor: 13,443 bytes, lines 13944-14388
13944// EXTERNAL MODULE: ./src/components/accordion/accordion.js 13945var accordion = __webpack_require__("./src/components/accordion/accordion.js"); 13946// EXTERNAL MODULE: ./src/components/breadcrumb/breadcrumb.js 13947var breadcrumb = __webpack_require__("./src/components/breadcrumb/breadcrumb.js"); 13948// EXTERNAL MODULE: ./src/components/card/card.js 13949var card = __webpack_require__("./src/components/card/card.js"); 13950// EXTERNAL MODULE: ./src/components/carousel/carousel.js 13951var carousel = __webpack_require__("./src/components/carousel/carousel.js"); 13952// EXTERNAL MODULE: ./src/components/checkbox/checkbox.js 13953var checkbox_checkbox = __webpack_require__("./src/components/checkbox/checkbox.js"); 13954// EXTERNAL MODULE: ./src/components/cookiebar/cookiebar.js + 1 modules 13955var cookiebar = __webpack_require__("./src/components/cookiebar/cookiebar.js"); 13956// EXTERNAL MODULE: ./src/components/datetimepicker/datetimepicker.js + 7 modules 13957var datetimepicker = __webpack_require__("./src/components/datetimepicker/datetimepicker.js"); 13958// EXTERNAL MODULE: ./src/components/footer/footer.js 13959var footer = __webpack_require__("./src/components/footer/footer.js"); 13960// EXTERNAL MODULE: ./src/components/header/header.js 13961var header = __webpack_require__("./src/components/header/header.js"); 13962// EXTERNAL MODULE: ./src/components/input/input.js 13963var input = __webpack_require__("./src/components/input/input.js"); 13964// EXTERNAL MODULE: ./src/components/item/item.js 13965var item = __webpack_require__("./src/components/item/item.js"); 13966// EXTERNAL MODULE: ./src/components/list/list.js 13967var list = __webpack_require__("./src/components/list/list.js"); 13968// EXTERNAL MODULE: ./src/components/menu/menu.js 13969var menu = __webpack_require__("./src/components/menu/menu.js"); 13970// EXTERNAL MODULE: ./src/components/message/message.js 13971var message = __webpack_require__("./src/components/message/message.js"); 13972// EXTERNAL MODULE: ./src/components/modal/modal.js 13973var modal = __webpack_require__("./src/components/modal/modal.js"); 13974// EXTERNAL MODULE: ./src/components/notification/notification.js 13975var notification = __webpack_require__("./src/components/notification/notification.js"); 13976// EXTERNAL MODULE: ./src/components/pagination/pagination.js 13977var pagination = __webpack_require__("./src/components/pagination/pagination.js"); 13978// EXTERNAL MODULE: ./src/components/scrim/scrim.js 13979var scrim = __webpack_require__("./src/components/scrim/scrim.js"); 13980// EXTERNAL MODULE: ./src/components/select/select.js 13981var select_select = __webpack_require__("./src/components/select/select.js"); 13982// EXTERNAL MODULE: ./src/components/step/step.js 13983var step = __webpack_require__("./src/components/step/step.js"); 13984// EXTERNAL MODULE: ./src/components/tab/tab.js 13985var tab = __webpack_require__("./src/components/tab/tab.js"); 13986// EXTERNAL MODULE: ./src/components/table/table.js 13987var table = __webpack_require__("./src/components/table/table.js"); 13988// EXTERNAL MODULE: ./src/components/tag/tag.js 13989var tag = __webpack_require__("./src/components/tag/tag.js"); 13990// EXTERNAL MODULE: ./src/components/textarea/textarea.js 13991var textarea_textarea = __webpack_require__("./src/components/textarea/textarea.js"); 13992// EXTERNAL MODULE: ./src/components/tooltip/tooltip.js 13993var tooltip = __webpack_require__("./src/components/tooltip/tooltip.js"); 13994// EXTERNAL MODULE: ./src/components/upload/upload.js 13995var upload = __webpack_require__("./src/components/upload/upload.js"); 13996// EXTERNAL MODULE: ./src/components/wizard/wizard.js 13997var wizard = __webpack_require__("./src/components/wizard/wizard.js"); 13998// EXTERNAL MODULE: ./src/partial/js/behavior/accordion.js 13999var behavior_accordion = __webpack_require__("./src/partial/js/behavior/accordion.js"); 14000// EXTERNAL MODULE: ./src/partial/js/behavior/checkgroup.js 14001var behavior_checkgroup = __webpack_require__("./src/partial/js/behavior/checkgroup.js"); 14002// EXTERNAL MODULE: ./src/partial/js/behavior/collapse.js 14003var behavior_collapse = __webpack_require__("./src/partial/js/behavior/collapse.js"); 14004// EXTERNAL MODULE: ./src/partial/js/behavior/swipe.js 14005var swipe = __webpack_require__("./src/partial/js/behavior/swipe.js"); 14006// EXTERNAL MODULE: ./src/partial/js/behavior/tooltip.js 14007var behavior_tooltip = __webpack_require__("./src/partial/js/behavior/tooltip.js"); 14008;// CONCATENATED MODULE: ./src/util/accordion/accordion.js 14009 14010 14011/** 14012 * Classe para o exemplo do comportamento accordion 14013 */ 14014class AccordionExample { 14015 /** 14016 * Instancia um exemplo de comportamento accordion 14017 * @param {object} element - Elemento DOM que representa um componente contento um comportamento de accordion 14018 */ 14019 constructor(element) { 14020 this.element = element 14021 this._setBehavior() 14022 } 14023 /** 14024 * Inicia comportamento do exemplo 14025 */ 14026 _setBehavior() { 14027 this._setAccordionBehavior() 14028 } 14029 /** 14030 * Encontra os data-toggle accordion e coloca util Accordion 14031 */ 14032 _setAccordionBehavior() { 14033 this.element 14034 .querySelectorAll('[data-toggle="accordion"]') 14035 .forEach((trigger) => { 14036 const config = { 14037 iconToHide: 'fa-chevron-up', 14038 iconToShow: 'fa-chevron-down', 14039 trigger, 14040 useIcons: true, 14041 } 14042 const accordion = new behavior_accordion["default"](config) 14043 accordion.setBehavior() 14044 }) 14045 } 14046} 14047 14048/* harmony default export */ const accordion_accordion = (AccordionExample); 14049 14050;// CONCATENATED MODULE: ./src/util/checkgroup/checkgroup.js 14051 14052 14053/** 14054 * Classe para o exemplo do comportamento checkgroup 14055 */ 14056class CheckgroupExample { 14057 /** 14058 * Instancia um exemplo de comportamento checkgroup 14059 * @param {object} element - Elemento DOM que representa um componente contento um comportamento de checkgroup 14060 */ 14061 constructor(element) { 14062 this.element = element 14063 this._setBehavior() 14064 } 14065 /** 14066 * Inicia comportamento do exemplo 14067 * @private 14068 */ 14069 _setBehavior() { 14070 this._setCheckgroupBehavior() 14071 } 14072 14073 /** 14074 * Encontra os data-toggle checkbox com data-parent e coloca util Checkgroup 14075 * @private 14076 */ 14077 14078 _setCheckgroupBehavior() { 14079 this.element 14080 .querySelectorAll('input[type="checkbox"][data-parent]') 14081 .forEach((trigger) => { 14082 const checkgroup = new behavior_checkgroup["default"](trigger) 14083 checkgroup.setBehavior() 14084 }) 14085 } 14086} 14087 14088/* harmony default export */ const checkgroup = (CheckgroupExample); 14089 14090;// CONCATENATED MODULE: ./src/util/collapse/collapse.js 14091 14092 14093/** 14094 * Classe para o exemplo do comportamento collapse 14095 */ 14096class CollapseExample { 14097 /** 14098 * Instancia um exemplo de comportamento collapse 14099 * @param {object} element - Elemento DOM que representa um componente contento um comportamento de collapse 14100 */ 14101 constructor(element) { 14102 this.element = element 14103 this._setBehavior() 14104 } 14105 /** 14106 * Instancia o utilitario 14107 * @private 14108 */ 14109 _setBehavior() { 14110 this._setCollapseBehavior() 14111 } 14112 /** 14113 * Instancia o utilitario no data-toggle collapse 14114 * @private 14115 */ 14116 _setCollapseBehavior() { 14117 this.element 14118 .querySelectorAll('[data-toggle="collapse"]') 14119 .forEach((trigger) => { 14120 const config = { 14121 iconToHide: 'fa-chevron-up', 14122 iconToShow: 'fa-chevron-down', 14123 trigger, 14124 useIcons: true, 14125 } 14126 const collapse = new behavior_collapse["default"](config) 14127 collapse.setBehavior() 14128 }) 14129 } 14130} 14131 14132/* harmony default export */ const collapse = (CollapseExample); 14133 14134// EXTERNAL MODULE: ./src/partial/js/behavior/dropdown.js 14135var behavior_dropdown = __webpack_require__("./src/partial/js/behavior/dropdown.js"); 14136;// CONCATENATED MODULE: ./src/util/dropdown/dropdown.js 14137 14138 14139/** 14140 * Classe para o exemplo do comportamento dropdown 14141 */ 14142class DropdownExample { 14143 /** 14144 * Instancia um exemplo de comportamento dropdown 14145 * @param {object} element - Elemento DOM que representa um componente contento um comportamento de dropdown 14146 */ 14147 constructor(element) { 14148 this.element = element 14149 this._setBehavior() 14150 } 14151 /** 14152 * Inicia comportamento do exemplo 14153 */ 14154 _setBehavior() { 14155 this._setDropdownBehavior() 14156 } 14157 14158 /** 14159 * Encontra os data-toggle dropdown e coloca util Dropdown 14160 */ 14161 _setDropdownBehavior() { 14162 this.element 14163 .querySelectorAll('[data-toggle="dropdown"]') 14164 .forEach((trigger) => { 14165 const config = { 14166 iconToHide: 'fa-chevron-up', 14167 iconToShow: 'fa-chevron-down', 14168 trigger, 14169 useIcons: true, 14170 } 14171 const dropdown = new behavior_dropdown["default"](config) 14172 dropdown.setBehavior() 14173 }) 14174 } 14175} 14176 14177/* harmony default export */ const dropdown = (DropdownExample); 14178 14179// EXTERNAL MODULE: ./src/partial/js/behavior/scrim.js 14180var behavior_scrim = __webpack_require__("./src/partial/js/behavior/scrim.js"); 14181;// CONCATENATED MODULE: ./src/util/tooltip/tooltip.js 14182 14183 14184/** 14185 * Classe de exemplo do comportamento tooltip 14186 */ 14187class TooltipExample { 14188 /** 14189 * Instancia um exemplo de comportamento tooltip 14190 * @param {object} element - Elemento sDOM que representa um componente contento um comportamento de tooltip 14191 */ 14192 constructor(element) { 14193 this.element = element 14194 14195 } 14196 /** 14197 * Inicia comportamento do exemplo 14198 * @private 14199 */ 14200 _setBehavior() { 14201 14202 } 14203 14204 /** 14205 * Encontra os data-tooltip-text e coloca util Tooltip 14206 * @private 14207 */ 14208 14209 run() { 14210 const TooltipExampleList = [] 14211 14212 window.document 14213 .querySelectorAll('[data-tooltip-text]:not(.notification-tooltip)') 14214 .forEach((TooltipExample) => { 14215 const texttooltip = TooltipExample.getAttribute('data-tooltip-text') 14216 const config = { 14217 activator: TooltipExample, 14218 place: 'left', 14219 textTooltip: texttooltip, 14220 14221 } 14222 TooltipExampleList.push(new behavior_tooltip["default"](config)) 14223 }) 14224 14225 document.querySelectorAll('[data-tooltip-target]').forEach((trigger) => { 14226 const targets = document.querySelectorAll( 14227 trigger.getAttribute('data-tooltip-target') 14228 ) 14229 14230 targets.forEach((target) => { 14231 const place = 14232 target.getAttribute('place') !== null 14233 ? target.getAttribute('place') 14234 : 'left' 14235 14236 const config = { 14237 activator: trigger, 14238 component: target, 14239 place: place, 14240 type: 'warning', 14241 14242 } 14243 // const tooltip = new Tooltip(config) 14244 new behavior_tooltip["default"](config) 14245 }) 14246 }) 14247 } 14248} 14249 14250/* harmony default export */ const tooltip_tooltip = (TooltipExample); 14251 14252;// CONCATENATED MODULE: ./src/partial/js/core.behavior.js 14253/** 14254 * Classe que instancia os exemplos de uso dos utilitários 14255 */ 14256 14257// import TooltipExample from '../../util/tooltip/tooltip' 14258 14259 14260 14261 14262 14263// import Tooltip from './behavior/tooltip' 14264// import Tooltip from './behavior/tooltip' 14265 14266 14267class Behavior { 14268 initInstanceAll() { 14269 this._initInstanceAccordionExample() 14270 this._initInstanceCheckGroupExemple() 14271 this._initInstanceCollapseExample() 14272 this._initInstanceDropdownExample() 14273 this._initInstanceTooltipExample() 14274 this._initInstanceScrimExample() 14275 } 14276 14277 _initInstanceCollapseExample() { 14278 const collapseExampleList = [] 14279 window.document 14280 .querySelectorAll('.collapse-example') 14281 .forEach((collapseExample) => { 14282 collapseExampleList.push(new collapse(collapseExample)) 14283 }) 14284 } 14285 14286 _initInstanceAccordionExample() { 14287 const accordionExampleList = [] 14288 window.document 14289 .querySelectorAll('.accordion-example') 14290 .forEach((accordionExample) => { 14291 accordionExampleList.push(new accordion_accordion(accordionExample)) 14292 }) 14293 } 14294 14295 _initInstanceCheckGroupExemple() { 14296 const checkgroupExampleList = [] 14297 window.document 14298 .querySelectorAll('.checkgroup-example') 14299 .forEach((checkgroupExample) => { 14300 checkgroupExampleList.push(new checkgroup(checkgroupExample)) 14301 }) 14302 } 14303 14304 _initInstanceDropdownExample() { 14305 const dropdownExampleList = [] 14306 window.document 14307 .querySelectorAll('.dropdown-example') 14308 .forEach((dropdownExample) => { 14309 dropdownExampleList.push(new dropdown(dropdownExample)) 14310 }) 14311 } 14312 14313 _initInstanceScrimExample() { 14314 for (const buttonBloco1 of window.document.querySelectorAll( 14315 '.scrimutilexemplo button' 14316 )) { 14317 buttonBloco1.addEventListener('click', () => { 14318 const scrscrim = window.document.querySelector('#scrimutilexample') 14319 const scrimfoco = new behavior_scrim["default"]({ 14320 closeElement: '#scrimfechar', 14321 trigger: scrscrim, 14322 }) 14323 scrimfoco.showScrim() 14324 }) 14325 } 14326 } 14327 _initInstanceTooltipExample() { 14328 const x = new tooltip_tooltip() 14329 x.run() 14330 14331 } 14332} 14333 14334// EXTERNAL MODULE: ./src/partial/js/globals-class.js + 2 modules 14335var globals_class = __webpack_require__("./src/partial/js/globals-class.js"); 14336;// CONCATENATED MODULE: ./src/partial/js/core-init.js 14337/* eslint-disable no-unused-vars */ 14338 14339 14340 14341 14342 14343 14344 14345 14346 14347 14348 14349 14350 14351 14352 14353 14354 14355 14356 14357 14358 14359 14360 14361 14362 14363 14364 14365 14366 14367 14368 14369 14370 14371 14372 14373 14374const globals = new globals_class.Globals() 14375globals.initInstanceAll() 14376 14377const behavior = new Behavior() 14378behavior.initInstanceAll() 14379 14380 14381 14382})(); 14383 14384/******/ return __webpack_exports__; 14385/******/ })() 14386; 14387}); 14388//# sourceMappingURL=core-init.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.