vendor: 442 bytes, lines 1-13
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: 65,465 bytes, lines 14-1998
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 539var DEFAULT_OPTIONS = { 540 placement: 'bottom', 541 modifiers: [], 542 strategy: 'absolute' 543}; 544 545function areValidElements() { 546 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 547 args[_key] = arguments[_key]; 548 } 549 550 return !args.some(function (element) { 551 return !(element && typeof element.getBoundingClientRect === 'function'); 552 }); 553} 554 555function popperGenerator(generatorOptions) { 556 if (generatorOptions === void 0) { 557 generatorOptions = {}; 558 } 559 560 var _generatorOptions = generatorOptions, 561 _generatorOptions$def = _generatorOptions.defaultModifiers, 562 defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, 563 _generatorOptions$def2 = _generatorOptions.defaultOptions, 564 defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; 565 return function createPopper(reference, popper, options) { 566 if (options === void 0) { 567 options = defaultOptions; 568 } 569 570 var state = { 571 placement: 'bottom', 572 orderedModifiers: [], 573 options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), 574 modifiersData: {}, 575 elements: { 576 reference: reference, 577 popper: popper 578 }, 579 attributes: {}, 580 styles: {} 581 }; 582 var effectCleanupFns = []; 583 var isDestroyed = false; 584 var instance = { 585 state: state, 586 setOptions: function setOptions(setOptionsAction) { 587 var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction; 588 cleanupModifierEffects(); 589 state.options = Object.assign({}, defaultOptions, state.options, options); 590 state.scrollParents = { 591 reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [], 592 popper: listScrollParents(popper) 593 }; // Orders the modifiers based on their dependencies and `phase` 594 // properties 595 596 var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers 597 598 state.orderedModifiers = orderedModifiers.filter(function (m) { 599 return m.enabled; 600 }); 601 runModifierEffects(); 602 return instance.update(); 603 }, 604 // Sync update â it will always be executed, even if not necessary. This 605 // is useful for low frequency updates where sync behavior simplifies the 606 // logic. 607 // For high frequency updates (e.g. `resize` and `scroll` events), always 608 // prefer the async Popper#update method 609 forceUpdate: function forceUpdate() { 610 if (isDestroyed) { 611 return; 612 } 613 614 var _state$elements = state.elements, 615 reference = _state$elements.reference, 616 popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements 617 // anymore 618 619 if (!areValidElements(reference, popper)) { 620 return; 621 } // Store the reference and popper rects to be read by modifiers 622 623 624 state.rects = { 625 reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'), 626 popper: getLayoutRect(popper) 627 }; // Modifiers have the ability to reset the current update cycle. The 628 // most common use case for this is the `flip` modifier changing the 629 // placement, which then needs to re-run all the modifiers, because the 630 // logic was previously ran for the previous placement and is therefore 631 // stale/incorrect 632 633 state.reset = false; 634 state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier 635 // is filled with the initial data specified by the modifier. This means 636 // it doesn't persist and is fresh on each update. 637 // To ensure persistent data, use `${name}#persistent` 638 639 state.orderedModifiers.forEach(function (modifier) { 640 return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); 641 }); 642 643 for (var index = 0; index < state.orderedModifiers.length; index++) { 644 if (state.reset === true) { 645 state.reset = false; 646 index = -1; 647 continue; 648 } 649 650 var _state$orderedModifie = state.orderedModifiers[index], 651 fn = _state$orderedModifie.fn, 652 _state$orderedModifie2 = _state$orderedModifie.options, 653 _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, 654 name = _state$orderedModifie.name; 655 656 if (typeof fn === 'function') { 657 state = fn({ 658 state: state, 659 options: _options, 660 name: name, 661 instance: instance 662 }) || state; 663 } 664 } 665 }, 666 // Async and optimistically optimized update â it will not be executed if 667 // not necessary (debounced to run at most once-per-tick) 668 update: debounce(function () { 669 return new Promise(function (resolve) { 670 instance.forceUpdate(); 671 resolve(state); 672 }); 673 }), 674 destroy: function destroy() { 675 cleanupModifierEffects(); 676 isDestroyed = true; 677 } 678 }; 679 680 if (!areValidElements(reference, popper)) { 681 return instance; 682 } 683 684 instance.setOptions(options).then(function (state) { 685 if (!isDestroyed && options.onFirstUpdate) { 686 options.onFirstUpdate(state); 687 } 688 }); // Modifiers have the ability to execute arbitrary code before the first 689 // update cycle runs. They will be executed in the same order as the update 690 // cycle. This is useful when a modifier adds some persistent data that 691 // other modifiers need to use, but the modifier is run after the dependent 692 // one. 693 694 function runModifierEffects() { 695 state.orderedModifiers.forEach(function (_ref) { 696 var name = _ref.name, 697 _ref$options = _ref.options, 698 options = _ref$options === void 0 ? {} : _ref$options, 699 effect = _ref.effect; 700 701 if (typeof effect === 'function') { 702 var cleanupFn = effect({ 703 state: state, 704 name: name, 705 instance: instance, 706 options: options 707 }); 708 709 var noopFn = function noopFn() {}; 710 711 effectCleanupFns.push(cleanupFn || noopFn); 712 } 713 }); 714 } 715 716 function cleanupModifierEffects() { 717 effectCleanupFns.forEach(function (fn) { 718 return fn(); 719 }); 720 effectCleanupFns = []; 721 } 722 723 return instance; 724 }; 725} 726var createPopper = /*#__PURE__*/(/* unused pure expression or super */ null && (popperGenerator())); // eslint-disable-next-line import/no-unused-modules 727 728 729;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/eventListeners.js 730 // eslint-disable-next-line import/no-unused-modules 731 732var passive = { 733 passive: true 734}; 735 736function effect(_ref) { 737 var state = _ref.state, 738 instance = _ref.instance, 739 options = _ref.options; 740 var _options$scroll = options.scroll, 741 scroll = _options$scroll === void 0 ? true : _options$scroll, 742 _options$resize = options.resize, 743 resize = _options$resize === void 0 ? true : _options$resize; 744 var window = getWindow(state.elements.popper); 745 var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); 746 747 if (scroll) { 748 scrollParents.forEach(function (scrollParent) { 749 scrollParent.addEventListener('scroll', instance.update, passive); 750 }); 751 } 752 753 if (resize) { 754 window.addEventListener('resize', instance.update, passive); 755 } 756 757 return function () { 758 if (scroll) { 759 scrollParents.forEach(function (scrollParent) { 760 scrollParent.removeEventListener('scroll', instance.update, passive); 761 }); 762 } 763 764 if (resize) { 765 window.removeEventListener('resize', instance.update, passive); 766 } 767 }; 768} // eslint-disable-next-line import/no-unused-modules 769 770 771/* harmony default export */ const eventListeners = ({ 772 name: 'eventListeners', 773 enabled: true, 774 phase: 'write', 775 fn: function fn() {}, 776 effect: effect, 777 data: {} 778}); 779;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getBasePlacement.js 780 781function getBasePlacement(placement) { 782 return placement.split('-')[0]; 783} 784;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getVariation.js 785function getVariation(placement) { 786 return placement.split('-')[1]; 787} 788;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js 789function getMainAxisFromPlacement(placement) { 790 return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y'; 791} 792;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/computeOffsets.js 793 794 795 796 797function computeOffsets(_ref) { 798 var reference = _ref.reference, 799 element = _ref.element, 800 placement = _ref.placement; 801 var basePlacement = placement ? getBasePlacement(placement) : null; 802 var variation = placement ? getVariation(placement) : null; 803 var commonX = reference.x + reference.width / 2 - element.width / 2; 804 var commonY = reference.y + reference.height / 2 - element.height / 2; 805 var offsets; 806 807 switch (basePlacement) { 808 case enums_top: 809 offsets = { 810 x: commonX, 811 y: reference.y - element.height 812 }; 813 break; 814 815 case bottom: 816 offsets = { 817 x: commonX, 818 y: reference.y + reference.height 819 }; 820 break; 821 822 case right: 823 offsets = { 824 x: reference.x + reference.width, 825 y: commonY 826 }; 827 break; 828 829 case left: 830 offsets = { 831 x: reference.x - element.width, 832 y: commonY 833 }; 834 break; 835 836 default: 837 offsets = { 838 x: reference.x, 839 y: reference.y 840 }; 841 } 842 843 var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; 844 845 if (mainAxis != null) { 846 var len = mainAxis === 'y' ? 'height' : 'width'; 847 848 switch (variation) { 849 case start: 850 offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2); 851 break; 852 853 case end: 854 offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2); 855 break; 856 857 default: 858 } 859 } 860 861 return offsets; 862} 863;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js 864 865 866function popperOffsets(_ref) { 867 var state = _ref.state, 868 name = _ref.name; 869 // Offsets are the actual position the popper needs to have to be 870 // properly positioned near its reference element 871 // This is the most basic placement, and will be adjusted by 872 // the modifiers in the next step 873 state.modifiersData[name] = computeOffsets({ 874 reference: state.rects.reference, 875 element: state.rects.popper, 876 strategy: 'absolute', 877 placement: state.placement 878 }); 879} // eslint-disable-next-line import/no-unused-modules 880 881 882/* harmony default export */ const modifiers_popperOffsets = ({ 883 name: 'popperOffsets', 884 enabled: true, 885 phase: 'read', 886 fn: popperOffsets, 887 data: {} 888}); 889;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/computeStyles.js 890 891 892 893 894 895 896 897 // eslint-disable-next-line import/no-unused-modules 898 899var unsetSides = { 900 top: 'auto', 901 right: 'auto', 902 bottom: 'auto', 903 left: 'auto' 904}; // Round the offsets to the nearest suitable subpixel based on the DPR. 905// Zooming can change the DPR, but it seems to report a value that will 906// cleanly divide the values into the appropriate subpixels. 907 908function roundOffsetsByDPR(_ref, win) { 909 var x = _ref.x, 910 y = _ref.y; 911 var dpr = win.devicePixelRatio || 1; 912 return { 913 x: round(x * dpr) / dpr || 0, 914 y: round(y * dpr) / dpr || 0 915 }; 916} 917 918function mapToStyles(_ref2) { 919 var _Object$assign2; 920 921 var popper = _ref2.popper, 922 popperRect = _ref2.popperRect, 923 placement = _ref2.placement, 924 variation = _ref2.variation, 925 offsets = _ref2.offsets, 926 position = _ref2.position, 927 gpuAcceleration = _ref2.gpuAcceleration, 928 adaptive = _ref2.adaptive, 929 roundOffsets = _ref2.roundOffsets, 930 isFixed = _ref2.isFixed; 931 var _offsets$x = offsets.x, 932 x = _offsets$x === void 0 ? 0 : _offsets$x, 933 _offsets$y = offsets.y, 934 y = _offsets$y === void 0 ? 0 : _offsets$y; 935 936 var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({ 937 x: x, 938 y: y 939 }) : { 940 x: x, 941 y: y 942 }; 943 944 x = _ref3.x; 945 y = _ref3.y; 946 var hasX = offsets.hasOwnProperty('x'); 947 var hasY = offsets.hasOwnProperty('y'); 948 var sideX = left; 949 var sideY = enums_top; 950 var win = window; 951 952 if (adaptive) { 953 var offsetParent = getOffsetParent(popper); 954 var heightProp = 'clientHeight'; 955 var widthProp = 'clientWidth'; 956 957 if (offsetParent === getWindow(popper)) { 958 offsetParent = getDocumentElement(popper); 959 960 if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') { 961 heightProp = 'scrollHeight'; 962 widthProp = 'scrollWidth'; 963 } 964 } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it 965 966 967 offsetParent = offsetParent; 968 969 if (placement === enums_top || (placement === left || placement === right) && variation === end) { 970 sideY = bottom; 971 var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing] 972 offsetParent[heightProp]; 973 y -= offsetY - popperRect.height; 974 y *= gpuAcceleration ? 1 : -1; 975 } 976 977 if (placement === left || (placement === enums_top || placement === bottom) && variation === end) { 978 sideX = right; 979 var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing] 980 offsetParent[widthProp]; 981 x -= offsetX - popperRect.width; 982 x *= gpuAcceleration ? 1 : -1; 983 } 984 } 985 986 var commonStyles = Object.assign({ 987 position: position 988 }, adaptive && unsetSides); 989 990 var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ 991 x: x, 992 y: y 993 }, getWindow(popper)) : { 994 x: x, 995 y: y 996 }; 997 998 x = _ref4.x; 999 y = _ref4.y; 1000 1001 if (gpuAcceleration) { 1002 var _Object$assign; 1003 1004 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)); 1005 } 1006 1007 return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2)); 1008} 1009 1010function computeStyles(_ref5) { 1011 var state = _ref5.state, 1012 options = _ref5.options; 1013 var _options$gpuAccelerat = options.gpuAcceleration, 1014 gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, 1015 _options$adaptive = options.adaptive, 1016 adaptive = _options$adaptive === void 0 ? true : _options$adaptive, 1017 _options$roundOffsets = options.roundOffsets, 1018 roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; 1019 var commonStyles = { 1020 placement: getBasePlacement(state.placement), 1021 variation: getVariation(state.placement), 1022 popper: state.elements.popper, 1023 popperRect: state.rects.popper, 1024 gpuAcceleration: gpuAcceleration, 1025 isFixed: state.options.strategy === 'fixed' 1026 }; 1027 1028 if (state.modifiersData.popperOffsets != null) { 1029 state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { 1030 offsets: state.modifiersData.popperOffsets, 1031 position: state.options.strategy, 1032 adaptive: adaptive, 1033 roundOffsets: roundOffsets 1034 }))); 1035 } 1036 1037 if (state.modifiersData.arrow != null) { 1038 state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { 1039 offsets: state.modifiersData.arrow, 1040 position: 'absolute', 1041 adaptive: false, 1042 roundOffsets: roundOffsets 1043 }))); 1044 } 1045 1046 state.attributes.popper = Object.assign({}, state.attributes.popper, { 1047 'data-popper-placement': state.placement 1048 }); 1049} // eslint-disable-next-line import/no-unused-modules 1050 1051 1052/* harmony default export */ const modifiers_computeStyles = ({ 1053 name: 'computeStyles', 1054 enabled: true, 1055 phase: 'beforeWrite', 1056 fn: computeStyles, 1057 data: {} 1058}); 1059;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/applyStyles.js 1060 1061 // This modifier takes the styles prepared by the `computeStyles` modifier 1062// and applies them to the HTMLElements such as popper and arrow 1063 1064function applyStyles(_ref) { 1065 var state = _ref.state; 1066 Object.keys(state.elements).forEach(function (name) { 1067 var style = state.styles[name] || {}; 1068 var attributes = state.attributes[name] || {}; 1069 var element = state.elements[name]; // arrow is optional + virtual elements 1070 1071 if (!isHTMLElement(element) || !getNodeName(element)) { 1072 return; 1073 } // Flow doesn't support to extend this property, but it's the most 1074 // effective way to apply styles to an HTMLElement 1075 // $FlowFixMe[cannot-write] 1076 1077 1078 Object.assign(element.style, style); 1079 Object.keys(attributes).forEach(function (name) { 1080 var value = attributes[name]; 1081 1082 if (value === false) { 1083 element.removeAttribute(name); 1084 } else { 1085 element.setAttribute(name, value === true ? '' : value); 1086 } 1087 }); 1088 }); 1089} 1090 1091function applyStyles_effect(_ref2) { 1092 var state = _ref2.state; 1093 var initialStyles = { 1094 popper: { 1095 position: state.options.strategy, 1096 left: '0', 1097 top: '0', 1098 margin: '0' 1099 }, 1100 arrow: { 1101 position: 'absolute' 1102 }, 1103 reference: {} 1104 }; 1105 Object.assign(state.elements.popper.style, initialStyles.popper); 1106 state.styles = initialStyles; 1107 1108 if (state.elements.arrow) { 1109 Object.assign(state.elements.arrow.style, initialStyles.arrow); 1110 } 1111 1112 return function () { 1113 Object.keys(state.elements).forEach(function (name) { 1114 var element = state.elements[name]; 1115 var attributes = state.attributes[name] || {}; 1116 var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them 1117 1118 var style = styleProperties.reduce(function (style, property) { 1119 style[property] = ''; 1120 return style; 1121 }, {}); // arrow is optional + virtual elements 1122 1123 if (!isHTMLElement(element) || !getNodeName(element)) { 1124 return; 1125 } 1126 1127 Object.assign(element.style, style); 1128 Object.keys(attributes).forEach(function (attribute) { 1129 element.removeAttribute(attribute); 1130 }); 1131 }); 1132 }; 1133} // eslint-disable-next-line import/no-unused-modules 1134 1135 1136/* harmony default export */ const modifiers_applyStyles = ({ 1137 name: 'applyStyles', 1138 enabled: true, 1139 phase: 'write', 1140 fn: applyStyles, 1141 effect: applyStyles_effect, 1142 requires: ['computeStyles'] 1143}); 1144;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/offset.js 1145 1146 // eslint-disable-next-line import/no-unused-modules 1147 1148function distanceAndSkiddingToXY(placement, rects, offset) { 1149 var basePlacement = getBasePlacement(placement); 1150 var invertDistance = [left, enums_top].indexOf(basePlacement) >= 0 ? -1 : 1; 1151 1152 var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, { 1153 placement: placement 1154 })) : offset, 1155 skidding = _ref[0], 1156 distance = _ref[1]; 1157 1158 skidding = skidding || 0; 1159 distance = (distance || 0) * invertDistance; 1160 return [left, right].indexOf(basePlacement) >= 0 ? { 1161 x: distance, 1162 y: skidding 1163 } : { 1164 x: skidding, 1165 y: distance 1166 }; 1167} 1168 1169function offset(_ref2) { 1170 var state = _ref2.state, 1171 options = _ref2.options, 1172 name = _ref2.name; 1173 var _options$offset = options.offset, 1174 offset = _options$offset === void 0 ? [0, 0] : _options$offset; 1175 var data = enums_placements.reduce(function (acc, placement) { 1176 acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset); 1177 return acc; 1178 }, {}); 1179 var _data$state$placement = data[state.placement], 1180 x = _data$state$placement.x, 1181 y = _data$state$placement.y; 1182 1183 if (state.modifiersData.popperOffsets != null) { 1184 state.modifiersData.popperOffsets.x += x; 1185 state.modifiersData.popperOffsets.y += y; 1186 } 1187 1188 state.modifiersData[name] = data; 1189} // eslint-disable-next-line import/no-unused-modules 1190 1191 1192/* harmony default export */ const modifiers_offset = ({ 1193 name: 'offset', 1194 enabled: true, 1195 phase: 'main', 1196 requires: ['popperOffsets'], 1197 fn: offset 1198}); 1199;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js 1200var hash = { 1201 left: 'right', 1202 right: 'left', 1203 bottom: 'top', 1204 top: 'bottom' 1205}; 1206function getOppositePlacement(placement) { 1207 return placement.replace(/left|right|bottom|top/g, function (matched) { 1208 return hash[matched]; 1209 }); 1210} 1211;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js 1212var getOppositeVariationPlacement_hash = { 1213 start: 'end', 1214 end: 'start' 1215}; 1216function getOppositeVariationPlacement(placement) { 1217 return placement.replace(/start|end/g, function (matched) { 1218 return getOppositeVariationPlacement_hash[matched]; 1219 }); 1220} 1221;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js 1222 1223 1224 1225 1226function getViewportRect(element, strategy) { 1227 var win = getWindow(element); 1228 var html = getDocumentElement(element); 1229 var visualViewport = win.visualViewport; 1230 var width = html.clientWidth; 1231 var height = html.clientHeight; 1232 var x = 0; 1233 var y = 0; 1234 1235 if (visualViewport) { 1236 width = visualViewport.width; 1237 height = visualViewport.height; 1238 var layoutViewport = isLayoutViewport(); 1239 1240 if (layoutViewport || !layoutViewport && strategy === 'fixed') { 1241 x = visualViewport.offsetLeft; 1242 y = visualViewport.offsetTop; 1243 } 1244 } 1245 1246 return { 1247 width: width, 1248 height: height, 1249 x: x + getWindowScrollBarX(element), 1250 y: y 1251 }; 1252} 1253;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js 1254 1255 1256 1257 1258 // Gets the entire size of the scrollable document area, even extending outside 1259// of the `<html>` and `<body>` rect bounds if horizontally scrollable 1260 1261function getDocumentRect(element) { 1262 var _element$ownerDocumen; 1263 1264 var html = getDocumentElement(element); 1265 var winScroll = getWindowScroll(element); 1266 var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; 1267 var width = math_max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); 1268 var height = math_max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); 1269 var x = -winScroll.scrollLeft + getWindowScrollBarX(element); 1270 var y = -winScroll.scrollTop; 1271 1272 if (getComputedStyle(body || html).direction === 'rtl') { 1273 x += math_max(html.clientWidth, body ? body.clientWidth : 0) - width; 1274 } 1275 1276 return { 1277 width: width, 1278 height: height, 1279 x: x, 1280 y: y 1281 }; 1282} 1283;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/contains.js 1284 1285function contains(parent, child) { 1286 var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method 1287 1288 if (parent.contains(child)) { 1289 return true; 1290 } // then fallback to custom implementation with Shadow DOM support 1291 else if (rootNode && isShadowRoot(rootNode)) { 1292 var next = child; 1293 1294 do { 1295 if (next && parent.isSameNode(next)) { 1296 return true; 1297 } // $FlowFixMe[prop-missing]: need a better way to handle this... 1298 1299 1300 next = next.parentNode || next.host; 1301 } while (next); 1302 } // Give up, the result is false 1303 1304 1305 return false; 1306} 1307;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/rectToClientRect.js 1308function rectToClientRect(rect) { 1309 return Object.assign({}, rect, { 1310 left: rect.x, 1311 top: rect.y, 1312 right: rect.x + rect.width, 1313 bottom: rect.y + rect.height 1314 }); 1315} 1316;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332function getInnerBoundingClientRect(element, strategy) { 1333 var rect = getBoundingClientRect(element, false, strategy === 'fixed'); 1334 rect.top = rect.top + element.clientTop; 1335 rect.left = rect.left + element.clientLeft; 1336 rect.bottom = rect.top + element.clientHeight; 1337 rect.right = rect.left + element.clientWidth; 1338 rect.width = element.clientWidth; 1339 rect.height = element.clientHeight; 1340 rect.x = rect.left; 1341 rect.y = rect.top; 1342 return rect; 1343} 1344 1345function getClientRectFromMixedType(element, clippingParent, strategy) { 1346 return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element))); 1347} // A "clipping parent" is an overflowable container with the characteristic of 1348// clipping (or hiding) overflowing elements with a position different from 1349// `initial` 1350 1351 1352function getClippingParents(element) { 1353 var clippingParents = listScrollParents(getParentNode(element)); 1354 var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0; 1355 var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element; 1356 1357 if (!isElement(clipperElement)) { 1358 return []; 1359 } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414 1360 1361 1362 return clippingParents.filter(function (clippingParent) { 1363 return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; 1364 }); 1365} // Gets the maximum area that the element is visible in due to any number of 1366// clipping parents 1367 1368 1369function getClippingRect(element, boundary, rootBoundary, strategy) { 1370 var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary); 1371 var clippingParents = [].concat(mainClippingParents, [rootBoundary]); 1372 var firstClippingParent = clippingParents[0]; 1373 var clippingRect = clippingParents.reduce(function (accRect, clippingParent) { 1374 var rect = getClientRectFromMixedType(element, clippingParent, strategy); 1375 accRect.top = math_max(rect.top, accRect.top); 1376 accRect.right = math_min(rect.right, accRect.right); 1377 accRect.bottom = math_min(rect.bottom, accRect.bottom); 1378 accRect.left = math_max(rect.left, accRect.left); 1379 return accRect; 1380 }, getClientRectFromMixedType(element, firstClippingParent, strategy)); 1381 clippingRect.width = clippingRect.right - clippingRect.left; 1382 clippingRect.height = clippingRect.bottom - clippingRect.top; 1383 clippingRect.x = clippingRect.left; 1384 clippingRect.y = clippingRect.top; 1385 return clippingRect; 1386} 1387;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js 1388function getFreshSideObject() { 1389 return { 1390 top: 0, 1391 right: 0, 1392 bottom: 0, 1393 left: 0 1394 }; 1395} 1396;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js 1397 1398function mergePaddingObject(paddingObject) { 1399 return Object.assign({}, getFreshSideObject(), paddingObject); 1400} 1401;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/expandToHashMap.js 1402function expandToHashMap(value, keys) { 1403 return keys.reduce(function (hashMap, key) { 1404 hashMap[key] = value; 1405 return hashMap; 1406 }, {}); 1407} 1408;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/detectOverflow.js 1409 1410 1411 1412 1413 1414 1415 1416 1417 // eslint-disable-next-line import/no-unused-modules 1418 1419function detectOverflow(state, options) { 1420 if (options === void 0) { 1421 options = {}; 1422 } 1423 1424 var _options = options, 1425 _options$placement = _options.placement, 1426 placement = _options$placement === void 0 ? state.placement : _options$placement, 1427 _options$strategy = _options.strategy, 1428 strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, 1429 _options$boundary = _options.boundary, 1430 boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, 1431 _options$rootBoundary = _options.rootBoundary, 1432 rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, 1433 _options$elementConte = _options.elementContext, 1434 elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, 1435 _options$altBoundary = _options.altBoundary, 1436 altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, 1437 _options$padding = _options.padding, 1438 padding = _options$padding === void 0 ? 0 : _options$padding; 1439 var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); 1440 var altContext = elementContext === popper ? reference : popper; 1441 var popperRect = state.rects.popper; 1442 var element = state.elements[altBoundary ? altContext : elementContext]; 1443 var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy); 1444 var referenceClientRect = getBoundingClientRect(state.elements.reference); 1445 var popperOffsets = computeOffsets({ 1446 reference: referenceClientRect, 1447 element: popperRect, 1448 strategy: 'absolute', 1449 placement: placement 1450 }); 1451 var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets)); 1452 var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect 1453 // 0 or negative = within the clipping rect 1454 1455 var overflowOffsets = { 1456 top: clippingClientRect.top - elementClientRect.top + paddingObject.top, 1457 bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, 1458 left: clippingClientRect.left - elementClientRect.left + paddingObject.left, 1459 right: elementClientRect.right - clippingClientRect.right + paddingObject.right 1460 }; 1461 var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element 1462 1463 if (elementContext === popper && offsetData) { 1464 var offset = offsetData[placement]; 1465 Object.keys(overflowOffsets).forEach(function (key) { 1466 var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; 1467 var axis = [enums_top, bottom].indexOf(key) >= 0 ? 'y' : 'x'; 1468 overflowOffsets[key] += offset[axis] * multiply; 1469 }); 1470 } 1471 1472 return overflowOffsets; 1473} 1474;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js 1475 1476 1477 1478 1479function computeAutoPlacement(state, options) { 1480 if (options === void 0) { 1481 options = {}; 1482 } 1483 1484 var _options = options, 1485 placement = _options.placement, 1486 boundary = _options.boundary, 1487 rootBoundary = _options.rootBoundary, 1488 padding = _options.padding, 1489 flipVariations = _options.flipVariations, 1490 _options$allowedAutoP = _options.allowedAutoPlacements, 1491 allowedAutoPlacements = _options$allowedAutoP === void 0 ? enums_placements : _options$allowedAutoP; 1492 var variation = getVariation(placement); 1493 var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) { 1494 return getVariation(placement) === variation; 1495 }) : basePlacements; 1496 var allowedPlacements = placements.filter(function (placement) { 1497 return allowedAutoPlacements.indexOf(placement) >= 0; 1498 }); 1499 1500 if (allowedPlacements.length === 0) { 1501 allowedPlacements = placements; 1502 } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions... 1503 1504 1505 var overflows = allowedPlacements.reduce(function (acc, placement) { 1506 acc[placement] = detectOverflow(state, { 1507 placement: placement, 1508 boundary: boundary, 1509 rootBoundary: rootBoundary, 1510 padding: padding 1511 })[getBasePlacement(placement)]; 1512 return acc; 1513 }, {}); 1514 return Object.keys(overflows).sort(function (a, b) { 1515 return overflows[a] - overflows[b]; 1516 }); 1517} 1518;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/flip.js 1519 1520 1521 1522 1523 1524 1525 // eslint-disable-next-line import/no-unused-modules 1526 1527function getExpandedFallbackPlacements(placement) { 1528 if (getBasePlacement(placement) === auto) { 1529 return []; 1530 } 1531 1532 var oppositePlacement = getOppositePlacement(placement); 1533 return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; 1534} 1535 1536function flip(_ref) { 1537 var state = _ref.state, 1538 options = _ref.options, 1539 name = _ref.name; 1540 1541 if (state.modifiersData[name]._skip) { 1542 return; 1543 } 1544 1545 var _options$mainAxis = options.mainAxis, 1546 checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, 1547 _options$altAxis = options.altAxis, 1548 checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, 1549 specifiedFallbackPlacements = options.fallbackPlacements, 1550 padding = options.padding, 1551 boundary = options.boundary, 1552 rootBoundary = options.rootBoundary, 1553 altBoundary = options.altBoundary, 1554 _options$flipVariatio = options.flipVariations, 1555 flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, 1556 allowedAutoPlacements = options.allowedAutoPlacements; 1557 var preferredPlacement = state.options.placement; 1558 var basePlacement = getBasePlacement(preferredPlacement); 1559 var isBasePlacement = basePlacement === preferredPlacement; 1560 var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); 1561 var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) { 1562 return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, { 1563 placement: placement, 1564 boundary: boundary, 1565 rootBoundary: rootBoundary, 1566 padding: padding, 1567 flipVariations: flipVariations, 1568 allowedAutoPlacements: allowedAutoPlacements 1569 }) : placement); 1570 }, []); 1571 var referenceRect = state.rects.reference; 1572 var popperRect = state.rects.popper; 1573 var checksMap = new Map(); 1574 var makeFallbackChecks = true; 1575 var firstFittingPlacement = placements[0]; 1576 1577 for (var i = 0; i < placements.length; i++) { 1578 var placement = placements[i]; 1579 1580 var _basePlacement = getBasePlacement(placement); 1581 1582 var isStartVariation = getVariation(placement) === start; 1583 var isVertical = [enums_top, bottom].indexOf(_basePlacement) >= 0; 1584 var len = isVertical ? 'width' : 'height'; 1585 var overflow = detectOverflow(state, { 1586 placement: placement, 1587 boundary: boundary, 1588 rootBoundary: rootBoundary, 1589 altBoundary: altBoundary, 1590 padding: padding 1591 }); 1592 var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : enums_top; 1593 1594 if (referenceRect[len] > popperRect[len]) { 1595 mainVariationSide = getOppositePlacement(mainVariationSide); 1596 } 1597 1598 var altVariationSide = getOppositePlacement(mainVariationSide); 1599 var checks = []; 1600 1601 if (checkMainAxis) { 1602 checks.push(overflow[_basePlacement] <= 0); 1603 } 1604 1605 if (checkAltAxis) { 1606 checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); 1607 } 1608 1609 if (checks.every(function (check) { 1610 return check; 1611 })) { 1612 firstFittingPlacement = placement; 1613 makeFallbackChecks = false; 1614 break; 1615 } 1616 1617 checksMap.set(placement, checks); 1618 } 1619 1620 if (makeFallbackChecks) { 1621 // `2` may be desired in some cases â research later 1622 var numberOfChecks = flipVariations ? 3 : 1; 1623 1624 var _loop = function _loop(_i) { 1625 var fittingPlacement = placements.find(function (placement) { 1626 var checks = checksMap.get(placement); 1627 1628 if (checks) { 1629 return checks.slice(0, _i).every(function (check) { 1630 return check; 1631 }); 1632 } 1633 }); 1634 1635 if (fittingPlacement) { 1636 firstFittingPlacement = fittingPlacement; 1637 return "break"; 1638 } 1639 }; 1640 1641 for (var _i = numberOfChecks; _i > 0; _i--) { 1642 var _ret = _loop(_i); 1643 1644 if (_ret === "break") break; 1645 } 1646 } 1647 1648 if (state.placement !== firstFittingPlacement) { 1649 state.modifiersData[name]._skip = true; 1650 state.placement = firstFittingPlacement; 1651 state.reset = true; 1652 } 1653} // eslint-disable-next-line import/no-unused-modules 1654 1655 1656/* harmony default export */ const modifiers_flip = ({ 1657 name: 'flip', 1658 enabled: true, 1659 phase: 'main', 1660 fn: flip, 1661 requiresIfExists: ['offset'], 1662 data: { 1663 _skip: false 1664 } 1665}); 1666;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getAltAxis.js 1667function getAltAxis(axis) { 1668 return axis === 'x' ? 'y' : 'x'; 1669} 1670;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/within.js 1671 1672function within(min, value, max) { 1673 return math_max(min, math_min(value, max)); 1674} 1675function withinMaxClamp(min, value, max) { 1676 var v = within(min, value, max); 1677 return v > max ? max : v; 1678} 1679;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692function preventOverflow(_ref) { 1693 var state = _ref.state, 1694 options = _ref.options, 1695 name = _ref.name; 1696 var _options$mainAxis = options.mainAxis, 1697 checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, 1698 _options$altAxis = options.altAxis, 1699 checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, 1700 boundary = options.boundary, 1701 rootBoundary = options.rootBoundary, 1702 altBoundary = options.altBoundary, 1703 padding = options.padding, 1704 _options$tether = options.tether, 1705 tether = _options$tether === void 0 ? true : _options$tether, 1706 _options$tetherOffset = options.tetherOffset, 1707 tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; 1708 var overflow = detectOverflow(state, { 1709 boundary: boundary, 1710 rootBoundary: rootBoundary, 1711 padding: padding, 1712 altBoundary: altBoundary 1713 }); 1714 var basePlacement = getBasePlacement(state.placement); 1715 var variation = getVariation(state.placement); 1716 var isBasePlacement = !variation; 1717 var mainAxis = getMainAxisFromPlacement(basePlacement); 1718 var altAxis = getAltAxis(mainAxis); 1719 var popperOffsets = state.modifiersData.popperOffsets; 1720 var referenceRect = state.rects.reference; 1721 var popperRect = state.rects.popper; 1722 var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, { 1723 placement: state.placement 1724 })) : tetherOffset; 1725 var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? { 1726 mainAxis: tetherOffsetValue, 1727 altAxis: tetherOffsetValue 1728 } : Object.assign({ 1729 mainAxis: 0, 1730 altAxis: 0 1731 }, tetherOffsetValue); 1732 var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null; 1733 var data = { 1734 x: 0, 1735 y: 0 1736 }; 1737 1738 if (!popperOffsets) { 1739 return; 1740 } 1741 1742 if (checkMainAxis) { 1743 var _offsetModifierState$; 1744 1745 var mainSide = mainAxis === 'y' ? enums_top : left; 1746 var altSide = mainAxis === 'y' ? bottom : right; 1747 var len = mainAxis === 'y' ? 'height' : 'width'; 1748 var offset = popperOffsets[mainAxis]; 1749 var min = offset + overflow[mainSide]; 1750 var max = offset - overflow[altSide]; 1751 var additive = tether ? -popperRect[len] / 2 : 0; 1752 var minLen = variation === start ? referenceRect[len] : popperRect[len]; 1753 var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go 1754 // outside the reference bounds 1755 1756 var arrowElement = state.elements.arrow; 1757 var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { 1758 width: 0, 1759 height: 0 1760 }; 1761 var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject(); 1762 var arrowPaddingMin = arrowPaddingObject[mainSide]; 1763 var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want 1764 // to include its full size in the calculation. If the reference is small 1765 // and near the edge of a boundary, the popper can overflow even if the 1766 // reference is not overflowing as well (e.g. virtual elements with no 1767 // width or height) 1768 1769 var arrowLen = within(0, referenceRect[len], arrowRect[len]); 1770 var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis; 1771 var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis; 1772 var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); 1773 var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; 1774 var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0; 1775 var tetherMin = offset + minOffset - offsetModifierValue - clientOffset; 1776 var tetherMax = offset + maxOffset - offsetModifierValue; 1777 var preventedOffset = within(tether ? math_min(min, tetherMin) : min, offset, tether ? math_max(max, tetherMax) : max); 1778 popperOffsets[mainAxis] = preventedOffset; 1779 data[mainAxis] = preventedOffset - offset; 1780 } 1781 1782 if (checkAltAxis) { 1783 var _offsetModifierState$2; 1784 1785 var _mainSide = mainAxis === 'x' ? enums_top : left; 1786 1787 var _altSide = mainAxis === 'x' ? bottom : right; 1788 1789 var _offset = popperOffsets[altAxis]; 1790 1791 var _len = altAxis === 'y' ? 'height' : 'width'; 1792 1793 var _min = _offset + overflow[_mainSide]; 1794 1795 var _max = _offset - overflow[_altSide]; 1796 1797 var isOriginSide = [enums_top, left].indexOf(basePlacement) !== -1; 1798 1799 var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0; 1800 1801 var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis; 1802 1803 var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max; 1804 1805 var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max); 1806 1807 popperOffsets[altAxis] = _preventedOffset; 1808 data[altAxis] = _preventedOffset - _offset; 1809 } 1810 1811 state.modifiersData[name] = data; 1812} // eslint-disable-next-line import/no-unused-modules 1813 1814 1815/* harmony default export */ const modifiers_preventOverflow = ({ 1816 name: 'preventOverflow', 1817 enabled: true, 1818 phase: 'main', 1819 fn: preventOverflow, 1820 requiresIfExists: ['offset'] 1821}); 1822;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/arrow.js 1823 1824 1825 1826 1827 1828 1829 1830 1831 // eslint-disable-next-line import/no-unused-modules 1832 1833var toPaddingObject = function toPaddingObject(padding, state) { 1834 padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, { 1835 placement: state.placement 1836 })) : padding; 1837 return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); 1838}; 1839 1840function arrow(_ref) { 1841 var _state$modifiersData$; 1842 1843 var state = _ref.state, 1844 name = _ref.name, 1845 options = _ref.options; 1846 var arrowElement = state.elements.arrow; 1847 var popperOffsets = state.modifiersData.popperOffsets; 1848 var basePlacement = getBasePlacement(state.placement); 1849 var axis = getMainAxisFromPlacement(basePlacement); 1850 var isVertical = [left, right].indexOf(basePlacement) >= 0; 1851 var len = isVertical ? 'height' : 'width'; 1852 1853 if (!arrowElement || !popperOffsets) { 1854 return; 1855 } 1856 1857 var paddingObject = toPaddingObject(options.padding, state); 1858 var arrowRect = getLayoutRect(arrowElement); 1859 var minProp = axis === 'y' ? enums_top : left; 1860 var maxProp = axis === 'y' ? bottom : right; 1861 var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len]; 1862 var startDiff = popperOffsets[axis] - state.rects.reference[axis]; 1863 var arrowOffsetParent = getOffsetParent(arrowElement); 1864 var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; 1865 var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is 1866 // outside of the popper bounds 1867 1868 var min = paddingObject[minProp]; 1869 var max = clientSize - arrowRect[len] - paddingObject[maxProp]; 1870 var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference; 1871 var offset = within(min, center, max); // Prevents breaking syntax highlighting... 1872 1873 var axisProp = axis; 1874 state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$); 1875} 1876 1877function arrow_effect(_ref2) { 1878 var state = _ref2.state, 1879 options = _ref2.options; 1880 var _options$element = options.element, 1881 arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element; 1882 1883 if (arrowElement == null) { 1884 return; 1885 } // CSS selector 1886 1887 1888 if (typeof arrowElement === 'string') { 1889 arrowElement = state.elements.popper.querySelector(arrowElement); 1890 1891 if (!arrowElement) { 1892 return; 1893 } 1894 } 1895 1896 if (!contains(state.elements.popper, arrowElement)) { 1897 return; 1898 } 1899 1900 state.elements.arrow = arrowElement; 1901} // eslint-disable-next-line import/no-unused-modules 1902 1903 1904/* harmony default export */ const modifiers_arrow = ({ 1905 name: 'arrow', 1906 enabled: true, 1907 phase: 'main', 1908 fn: arrow, 1909 effect: arrow_effect, 1910 requires: ['popperOffsets'], 1911 requiresIfExists: ['preventOverflow'] 1912}); 1913;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/hide.js 1914 1915 1916 1917function getSideOffsets(overflow, rect, preventedOffsets) { 1918 if (preventedOffsets === void 0) { 1919 preventedOffsets = { 1920 x: 0, 1921 y: 0 1922 }; 1923 } 1924 1925 return { 1926 top: overflow.top - rect.height - preventedOffsets.y, 1927 right: overflow.right - rect.width + preventedOffsets.x, 1928 bottom: overflow.bottom - rect.height + preventedOffsets.y, 1929 left: overflow.left - rect.width - preventedOffsets.x 1930 }; 1931} 1932 1933function isAnySideFullyClipped(overflow) { 1934 return [enums_top, right, bottom, left].some(function (side) { 1935 return overflow[side] >= 0; 1936 }); 1937} 1938 1939function hide(_ref) { 1940 var state = _ref.state, 1941 name = _ref.name; 1942 var referenceRect = state.rects.reference; 1943 var popperRect = state.rects.popper; 1944 var preventedOffsets = state.modifiersData.preventOverflow; 1945 var referenceOverflow = detectOverflow(state, { 1946 elementContext: 'reference' 1947 }); 1948 var popperAltOverflow = detectOverflow(state, { 1949 altBoundary: true 1950 }); 1951 var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect); 1952 var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); 1953 var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets); 1954 var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets); 1955 state.modifiersData[name] = { 1956 referenceClippingOffsets: referenceClippingOffsets, 1957 popperEscapeOffsets: popperEscapeOffsets, 1958 isReferenceHidden: isReferenceHidden, 1959 hasPopperEscaped: hasPopperEscaped 1960 }; 1961 state.attributes.popper = Object.assign({}, state.attributes.popper, { 1962 'data-popper-reference-hidden': isReferenceHidden, 1963 'data-popper-escaped': hasPopperEscaped 1964 }); 1965} // eslint-disable-next-line import/no-unused-modules 1966 1967 1968/* harmony default export */ const modifiers_hide = ({ 1969 name: 'hide', 1970 enabled: true, 1971 phase: 'main', 1972 requiresIfExists: ['preventOverflow'], 1973 fn: hide 1974}); 1975;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/popper.js 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986var defaultModifiers = [eventListeners, modifiers_popperOffsets, modifiers_computeStyles, modifiers_applyStyles, modifiers_offset, modifiers_flip, modifiers_preventOverflow, modifiers_arrow, modifiers_hide]; 1987var popper_createPopper = /*#__PURE__*/popperGenerator({ 1988 defaultModifiers: defaultModifiers 1989}); // eslint-disable-next-line import/no-unused-modules 1990 1991 // eslint-disable-next-line import/no-unused-modules 1992 1993 // eslint-disable-next-line import/no-unused-modules 1994 1995 1996 1997/***/ }), 1998
vendor: 798 bytes, lines 1999-2028
1999/***/ "./node_modules/flatpickr/dist/esm/utils/polyfills.js": 2000/***/ (() => { 2001 2002"use strict"; 2003 2004if (typeof Object.assign !== "function") { 2005 Object.assign = function (target) { 2006 var args = []; 2007 for (var _i = 1; _i < arguments.length; _i++) { 2008 args[_i - 1] = arguments[_i]; 2009 } 2010 if (!target) { 2011 throw TypeError("Cannot convert undefined or null to object"); 2012 } 2013 var _loop_1 = function (source) { 2014 if (source) { 2015 Object.keys(source).forEach(function (key) { return (target[key] = source[key]); }); 2016 } 2017 }; 2018 for (var _a = 0, args_1 = args; _a < args_1.length; _a++) { 2019 var source = args_1[_a]; 2020 _loop_1(source); 2021 } 2022 return target; 2023 }; 2024} 2025 2026 2027/***/ }), 2028
vendor: 1,605 bytes, lines 2029-2100
2029/***/ "./node_modules/flatpickr/dist/l10n/pt.js": 2030/***/ (function(__unused_webpack_module, exports) { 2031 2032(function (global, factory) { 2033 true ? factory(exports) : 2034 0; 2035}(this, (function (exports) { 'use strict'; 2036 2037 var fp = typeof window !== "undefined" && window.flatpickr !== undefined 2038 ? window.flatpickr 2039 : { 2040 l10ns: {}, 2041 }; 2042 var Portuguese = { 2043 weekdays: { 2044 shorthand: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"], 2045 longhand: [ 2046 "Domingo", 2047 "Segunda-feira", 2048 "Terça-feira", 2049 "Quarta-feira", 2050 "Quinta-feira", 2051 "Sexta-feira", 2052 "Sábado", 2053 ], 2054 }, 2055 months: { 2056 shorthand: [ 2057 "Jan", 2058 "Fev", 2059 "Mar", 2060 "Abr", 2061 "Mai", 2062 "Jun", 2063 "Jul", 2064 "Ago", 2065 "Set", 2066 "Out", 2067 "Nov", 2068 "Dez", 2069 ], 2070 longhand: [ 2071 "Janeiro", 2072 "Fevereiro", 2073 "Março", 2074 "Abril", 2075 "Maio", 2076 "Junho", 2077 "Julho", 2078 "Agosto", 2079 "Setembro", 2080 "Outubro", 2081 "Novembro", 2082 "Dezembro", 2083 ], 2084 }, 2085 rangeSeparator: " até ", 2086 time_24hr: true, 2087 }; 2088 fp.l10ns.pt = Portuguese; 2089 var pt = fp.l10ns; 2090 2091 exports.Portuguese = Portuguese; 2092 exports.default = pt; 2093 2094 Object.defineProperty(exports, '__esModule', { value: true }); 2095 2096}))); 2097 2098 2099/***/ }), 2100
vendor: 11,470 bytes, lines 2101-2418
2101/***/ "./node_modules/focus-visible/dist/focus-visible.js": 2102/***/ (function() { 2103 2104(function (global, factory) { 2105 true ? factory() : 2106 0; 2107}(this, (function () { 'use strict'; 2108 2109 /** 2110 * Applies the :focus-visible polyfill at the given scope. 2111 * A scope in this case is either the top-level Document or a Shadow Root. 2112 * 2113 * @param {(Document|ShadowRoot)} scope 2114 * @see https://github.com/WICG/focus-visible 2115 */ 2116 function applyFocusVisiblePolyfill(scope) { 2117 var hadKeyboardEvent = true; 2118 var hadFocusVisibleRecently = false; 2119 var hadFocusVisibleRecentlyTimeout = null; 2120 2121 var inputTypesAllowlist = { 2122 text: true, 2123 search: true, 2124 url: true, 2125 tel: true, 2126 email: true, 2127 password: true, 2128 number: true, 2129 date: true, 2130 month: true, 2131 week: true, 2132 time: true, 2133 datetime: true, 2134 'datetime-local': true 2135 }; 2136 2137 /** 2138 * Helper function for legacy browsers and iframes which sometimes focus 2139 * elements like document, body, and non-interactive SVG. 2140 * @param {Element} el 2141 */ 2142 function isValidFocusTarget(el) { 2143 if ( 2144 el && 2145 el !== document && 2146 el.nodeName !== 'HTML' && 2147 el.nodeName !== 'BODY' && 2148 'classList' in el && 2149 'contains' in el.classList 2150 ) { 2151 return true; 2152 } 2153 return false; 2154 } 2155 2156 /** 2157 * Computes whether the given element should automatically trigger the 2158 * `focus-visible` class being added, i.e. whether it should always match 2159 * `:focus-visible` when focused. 2160 * @param {Element} el 2161 * @return {boolean} 2162 */ 2163 function focusTriggersKeyboardModality(el) { 2164 var type = el.type; 2165 var tagName = el.tagName; 2166 2167 if (tagName === 'INPUT' && inputTypesAllowlist[type] && !el.readOnly) { 2168 return true; 2169 } 2170 2171 if (tagName === 'TEXTAREA' && !el.readOnly) { 2172 return true; 2173 } 2174 2175 if (el.isContentEditable) { 2176 return true; 2177 } 2178 2179 return false; 2180 } 2181 2182 /** 2183 * Add the `focus-visible` class to the given element if it was not added by 2184 * the author. 2185 * @param {Element} el 2186 */ 2187 function addFocusVisibleClass(el) { 2188 if (el.classList.contains('focus-visible')) { 2189 return; 2190 } 2191 el.classList.add('focus-visible'); 2192 el.setAttribute('data-focus-visible-added', ''); 2193 } 2194 2195 /** 2196 * Remove the `focus-visible` class from the given element if it was not 2197 * originally added by the author. 2198 * @param {Element} el 2199 */ 2200 function removeFocusVisibleClass(el) { 2201 if (!el.hasAttribute('data-focus-visible-added')) { 2202 return; 2203 } 2204 el.classList.remove('focus-visible'); 2205 el.removeAttribute('data-focus-visible-added'); 2206 } 2207 2208 /** 2209 * If the most recent user interaction was via the keyboard; 2210 * and the key press did not include a meta, alt/option, or control key; 2211 * then the modality is keyboard. Otherwise, the modality is not keyboard. 2212 * Apply `focus-visible` to any current active element and keep track 2213 * of our keyboard modality state with `hadKeyboardEvent`. 2214 * @param {KeyboardEvent} e 2215 */ 2216 function onKeyDown(e) { 2217 if (e.metaKey || e.altKey || e.ctrlKey) { 2218 return; 2219 } 2220 2221 if (isValidFocusTarget(scope.activeElement)) { 2222 addFocusVisibleClass(scope.activeElement); 2223 } 2224 2225 hadKeyboardEvent = true; 2226 } 2227 2228 /** 2229 * If at any point a user clicks with a pointing device, ensure that we change 2230 * the modality away from keyboard. 2231 * This avoids the situation where a user presses a key on an already focused 2232 * element, and then clicks on a different element, focusing it with a 2233 * pointing device, while we still think we're in keyboard modality. 2234 * @param {Event} e 2235 */ 2236 function onPointerDown(e) { 2237 hadKeyboardEvent = false; 2238 } 2239 2240 /** 2241 * On `focus`, add the `focus-visible` class to the target if: 2242 * - the target received focus as a result of keyboard navigation, or 2243 * - the event target is an element that will likely require interaction 2244 * via the keyboard (e.g. a text box) 2245 * @param {Event} e 2246 */ 2247 function onFocus(e) { 2248 // Prevent IE from focusing the document or HTML element. 2249 if (!isValidFocusTarget(e.target)) { 2250 return; 2251 } 2252 2253 if (hadKeyboardEvent || focusTriggersKeyboardModality(e.target)) { 2254 addFocusVisibleClass(e.target); 2255 } 2256 } 2257 2258 /** 2259 * On `blur`, remove the `focus-visible` class from the target. 2260 * @param {Event} e 2261 */ 2262 function onBlur(e) { 2263 if (!isValidFocusTarget(e.target)) { 2264 return; 2265 } 2266 2267 if ( 2268 e.target.classList.contains('focus-visible') || 2269 e.target.hasAttribute('data-focus-visible-added') 2270 ) { 2271 // To detect a tab/window switch, we look for a blur event followed 2272 // rapidly by a visibility change. 2273 // If we don't see a visibility change within 100ms, it's probably a 2274 // regular focus change. 2275 hadFocusVisibleRecently = true; 2276 window.clearTimeout(hadFocusVisibleRecentlyTimeout); 2277 hadFocusVisibleRecentlyTimeout = window.setTimeout(function() { 2278 hadFocusVisibleRecently = false; 2279 }, 100); 2280 removeFocusVisibleClass(e.target); 2281 } 2282 } 2283 2284 /** 2285 * If the user changes tabs, keep track of whether or not the previously 2286 * focused element had .focus-visible. 2287 * @param {Event} e 2288 */ 2289 function onVisibilityChange(e) { 2290 if (document.visibilityState === 'hidden') { 2291 // If the tab becomes active again, the browser will handle calling focus 2292 // on the element (Safari actually calls it twice). 2293 // If this tab change caused a blur on an element with focus-visible, 2294 // re-apply the class when the user switches back to the tab. 2295 if (hadFocusVisibleRecently) { 2296 hadKeyboardEvent = true; 2297 } 2298 addInitialPointerMoveListeners(); 2299 } 2300 } 2301 2302 /** 2303 * Add a group of listeners to detect usage of any pointing devices. 2304 * These listeners will be added when the polyfill first loads, and anytime 2305 * the window is blurred, so that they are active when the window regains 2306 * focus. 2307 */ 2308 function addInitialPointerMoveListeners() { 2309 document.addEventListener('mousemove', onInitialPointerMove); 2310 document.addEventListener('mousedown', onInitialPointerMove); 2311 document.addEventListener('mouseup', onInitialPointerMove); 2312 document.addEventListener('pointermove', onInitialPointerMove); 2313 document.addEventListener('pointerdown', onInitialPointerMove); 2314 document.addEventListener('pointerup', onInitialPointerMove); 2315 document.addEventListener('touchmove', onInitialPointerMove); 2316 document.addEventListener('touchstart', onInitialPointerMove); 2317 document.addEventListener('touchend', onInitialPointerMove); 2318 } 2319 2320 function removeInitialPointerMoveListeners() { 2321 document.removeEventListener('mousemove', onInitialPointerMove); 2322 document.removeEventListener('mousedown', onInitialPointerMove); 2323 document.removeEventListener('mouseup', onInitialPointerMove); 2324 document.removeEventListener('pointermove', onInitialPointerMove); 2325 document.removeEventListener('pointerdown', onInitialPointerMove); 2326 document.removeEventListener('pointerup', onInitialPointerMove); 2327 document.removeEventListener('touchmove', onInitialPointerMove); 2328 document.removeEventListener('touchstart', onInitialPointerMove); 2329 document.removeEventListener('touchend', onInitialPointerMove); 2330 } 2331 2332 /** 2333 * When the polfyill first loads, assume the user is in keyboard modality. 2334 * If any event is received from a pointing device (e.g. mouse, pointer, 2335 * touch), turn off keyboard modality. 2336 * This accounts for situations where focus enters the page from the URL bar. 2337 * @param {Event} e 2338 */ 2339 function onInitialPointerMove(e) { 2340 // Work around a Safari quirk that fires a mousemove on <html> whenever the 2341 // window blurs, even if you're tabbing out of the page. ¯\_(ã)_/¯ 2342 if (e.target.nodeName && e.target.nodeName.toLowerCase() === 'html') { 2343 return; 2344 } 2345 2346 hadKeyboardEvent = false; 2347 removeInitialPointerMoveListeners(); 2348 } 2349 2350 // For some kinds of state, we are interested in changes at the global scope 2351 // only. For example, global pointer input, global key presses and global 2352 // visibility change should affect the state at every scope: 2353 document.addEventListener('keydown', onKeyDown, true); 2354 document.addEventListener('mousedown', onPointerDown, true); 2355 document.addEventListener('pointerdown', onPointerDown, true); 2356 document.addEventListener('touchstart', onPointerDown, true); 2357 document.addEventListener('visibilitychange', onVisibilityChange, true); 2358 2359 addInitialPointerMoveListeners(); 2360 2361 // For focus and blur, we specifically care about state changes in the local 2362 // scope. This is because focus / blur events that originate from within a 2363 // shadow root are not re-dispatched from the host element if it was already 2364 // the active element in its own scope: 2365 scope.addEventListener('focus', onFocus, true); 2366 scope.addEventListener('blur', onBlur, true); 2367 2368 // We detect that a node is a ShadowRoot by ensuring that it is a 2369 // DocumentFragment and also has a host property. This check covers native 2370 // implementation and polyfill implementation transparently. If we only cared 2371 // about the native implementation, we could just check if the scope was 2372 // an instance of a ShadowRoot. 2373 if (scope.nodeType === Node.DOCUMENT_FRAGMENT_NODE && scope.host) { 2374 // Since a ShadowRoot is a special kind of DocumentFragment, it does not 2375 // have a root element to add a class to. So, we add this attribute to the 2376 // host element instead: 2377 scope.host.setAttribute('data-js-focus-visible', ''); 2378 } else if (scope.nodeType === Node.DOCUMENT_NODE) { 2379 document.documentElement.classList.add('js-focus-visible'); 2380 document.documentElement.setAttribute('data-js-focus-visible', ''); 2381 } 2382 } 2383 2384 // It is important to wrap all references to global window and document in 2385 // these checks to support server-side rendering use cases 2386 // @see https://github.com/WICG/focus-visible/issues/199 2387 if (typeof window !== 'undefined' && typeof document !== 'undefined') { 2388 // Make the polyfill helper globally available. This can be used as a signal 2389 // to interested libraries that wish to coordinate with the polyfill for e.g., 2390 // applying the polyfill to a shadow root: 2391 window.applyFocusVisiblePolyfill = applyFocusVisiblePolyfill; 2392 2393 // Notify interested libraries of the polyfill's presence, in case the 2394 // polyfill was loaded lazily: 2395 var event; 2396 2397 try { 2398 event = new CustomEvent('focus-visible-polyfill-ready'); 2399 } catch (error) { 2400 // IE11 does not support using CustomEvent as a constructor directly: 2401 event = document.createEvent('CustomEvent'); 2402 event.initCustomEvent('focus-visible-polyfill-ready', false, false, {}); 2403 } 2404 2405 window.dispatchEvent(event); 2406 } 2407 2408 if (typeof document !== 'undefined') { 2409 // Apply the polyfill to the global document, so that no JavaScript 2410 // coordination is required to use the polyfill in the top-level document: 2411 applyFocusVisiblePolyfill(document); 2412 } 2413 2414}))); 2415 2416 2417/***/ }), 2418
vendor: 2,168 bytes, lines 2419-2492
2419/***/ "./src/components/accordion/accordion.js": 2420/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 2421 2422"use strict"; 2423/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2424/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 2425/* harmony export */ }); 2426class BRAccordion { 2427 constructor(name, component) { 2428 this.name = name 2429 this.component = component 2430 this._setBehavior() 2431 } 2432 2433 _setBehavior() { 2434 for (const button of this.component.querySelectorAll('button.header')) { 2435 button.addEventListener('click', (event) => { 2436 this._collapse(event) 2437 this._changeIcon(event) 2438 }) 2439 } 2440 } 2441 2442 // eslint-disable-next-line complexity 2443 _collapse(event) { 2444 if (this.component.hasAttribute('single')) { 2445 for (const field of this.component.querySelectorAll('.item')) { 2446 if (field === event.currentTarget.parentNode) { 2447 if (field.hasAttribute('active')) { 2448 field.removeAttribute('active') 2449 } else { 2450 field.setAttribute('active', '') 2451 } 2452 } else { 2453 if (field.hasAttribute('active')) { 2454 field.removeAttribute('active') 2455 } 2456 } 2457 } 2458 } else { 2459 for (const field of this.component.querySelectorAll('.item')) { 2460 if (field === event.currentTarget.parentNode) { 2461 if (field.hasAttribute('active')) { 2462 field.removeAttribute('active') 2463 } else { 2464 field.setAttribute('active', '') 2465 } 2466 } 2467 } 2468 } 2469 } 2470 2471 _changeIcon() { 2472 for (const field of this.component.querySelectorAll('.item')) { 2473 if (field.hasAttribute('active')) { 2474 for (const icon of field.querySelectorAll('.icon')) { 2475 icon.children[0].classList.remove('fa-angle-down') 2476 icon.children[0].classList.add('fa-angle-up') 2477 } 2478 } else { 2479 for (const icon of field.querySelectorAll('.icon')) { 2480 icon.children[0].classList.remove('fa-angle-up') 2481 icon.children[0].classList.add('fa-angle-down') 2482 } 2483 } 2484 } 2485 } 2486} 2487 2488/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRAccordion); 2489 2490 2491/***/ }), 2492
2493/***/ "./src/components/avatar/avatar.js": 2494/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 2495 2496"use strict"; 2497/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2498/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 2499/* harmony export */ }); 2500/* harmony import */ var _partial_js_behavior_dropdown__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/partial/js/behavior/dropdown.js"); 2501 2502 2503/** 2504 * Classe para o exemplo do comportamento dropdown 2505 */ 2506class BRAvatar { 2507 /** 2508 * Instancia um exemplo de comportamento dropdown 2509 * @param {string} name - Nome do componente 2510 * @param {object} component - Referência ao objeto do DOM 2511 */ 2512 constructor(name, component) { 2513 this.name = name 2514 this.component = component 2515 this._setBehavior() 2516 } 2517 2518 /** 2519 * Define os comportamentos do componente 2520 * @private 2521 */ 2522 _setBehavior() { 2523 this._setDropdownBehavior() 2524 } 2525 2526 /** 2527 * Define os comportamentos do dropdown 2528 * @private 2529 */ 2530 _setDropdownBehavior() { 2531 if (this.component.parentElement.dataset.toggle === 'dropdown') { 2532 const config = { 2533 iconToHide: 'fa-caret-up', 2534 iconToShow: 'fa-caret-down', 2535 trigger: this.component.parentElement, 2536 useIcons: true, 2537 } 2538 const dropdown = new _partial_js_behavior_dropdown__WEBPACK_IMPORTED_MODULE_0__["default"](config) 2539 dropdown.setBehavior() 2540 } 2541 } 2542} 2543 2544/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRAvatar); 2545 2546 2547/***/ }), 2548
vendor: 3,990 bytes, lines 2549-2692
2549/***/ "./src/components/breadcrumb/breadcrumb.js": 2550/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 2551 2552"use strict"; 2553/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2554/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 2555/* harmony export */ }); 2556class BRBreadcrumb { 2557 /** 2558 * Instancia um componente breadcrumb 2559 * @param {string} name - nome do componente 2560 * @param {object} component - referencia ao objeto do DOM 2561 **/ 2562 constructor(name, component) { 2563 this.name = name 2564 this.component = component 2565 this._setBehavior() 2566 } 2567 2568 /** 2569 * Define os comportamentos do componente 2570 * @private 2571 */ 2572 _setBehavior() { 2573 this._setView() 2574 window.addEventListener('resize', () => { 2575 this._setView() 2576 }) 2577 window.document.addEventListener('click', (event) => { 2578 if ( 2579 !this.component.contains(event.target) && 2580 this.component.querySelector('.br-card') 2581 ) { 2582 this.component.querySelector('.br-card').remove() 2583 } 2584 }) 2585 2586 // window.addEventListener('resize', (event) => {}) 2587 } 2588 /** 2589 * Reseta a view do breadcrumb 2590 */ 2591 resetBreadcrumbs() { 2592 this._reset() 2593 2594 const brcardBreadcrumb = this.component.querySelector('.br-card') 2595 if (brcardBreadcrumb !== null) { 2596 brcardBreadcrumb.remove() 2597 } 2598 this._setView() 2599 } 2600 2601 /** 2602 * Atualiza a visualização do componente 2603 * @private 2604 */ 2605 _setView() { 2606 this._reset() 2607 for (const crumbList of this.component.querySelectorAll('.crumb-list')) { 2608 const crumbs = crumbList.querySelectorAll('.crumb:not([data-active])') 2609 if (window.innerWidth < 575) { 2610 if (crumbs.length !== 1) { 2611 crumbs.forEach((crumb) => { 2612 crumb.classList.add('d-none') 2613 }) 2614 this._insertExpandButton() 2615 } 2616 } else { 2617 if ( 2618 crumbList.scrollWidth > crumbList.offsetWidth || 2619 crumbs.length > 5 2620 ) { 2621 crumbs.forEach((crumb, index) => { 2622 if (index > 0 && index < crumbs.length - 1) { 2623 crumb.classList.add('d-none') 2624 } 2625 }) 2626 this._insertExpandButton() 2627 } 2628 } 2629 } 2630 } 2631 2632 /** 2633 * Insere botao de expandir 2634 * @private 2635 */ 2636 _insertExpandButton() { 2637 const crumb = this._createCrumb() 2638 const crumbList = this.component.querySelector('.crumb-list') 2639 const crumbs = crumbList.querySelectorAll('.crumb') 2640 crumbList.insertBefore(crumb, crumbs[1]) 2641 } 2642 2643 /** 2644 * Reinicia componente 2645 * @private 2646 */ 2647 _reset() { 2648 this.component.querySelectorAll('.crumb-list .crumb').forEach((crumb) => { 2649 if (crumb.classList.contains('menu-mobil')) { 2650 crumb.remove() 2651 } else { 2652 crumb.classList.remove('d-none') 2653 } 2654 }) 2655 } 2656 2657 /** 2658 * Insere elementos 2659 * @private 2660 */ 2661 _createCrumb() { 2662 const crumb = document.createElement('li') 2663 crumb.classList.add('crumb', 'menu-mobil') 2664 crumb.setAttribute('data-toggle', 'dropdown') 2665 2666 const button = document.createElement('button') 2667 button.classList.add('br-button', 'circle') 2668 2669 const span = document.createElement('span') 2670 span.classList.add('sr-only') 2671 span.innerHTML = 'Botão Menu' 2672 2673 const folderIcon = document.createElement('i') 2674 folderIcon.classList.add('fas', 'fa-folder-plus') 2675 2676 const chevronIcon = document.createElement('i') 2677 chevronIcon.classList.add('icon', 'fas', 'fa-chevron-right') 2678 2679 crumb.appendChild(chevronIcon) 2680 crumb.appendChild(button) 2681 button.appendChild(span) 2682 button.appendChild(folderIcon) 2683 2684 crumb.addEventListener('click', () => { 2685 let card = this.component.querySelector('.br-card') 2686 if (card) { 2687 folderIcon.classList.remove('fas', 'fa-folder-minus') 2688 folderIcon.classList.add('fas', 'fa-folder-plus') 2689 this.component.querySelector('.br-card').remove() 2690 } else { 2691 folderIcon.classList.remove('fas', 'fa-folder-plus') 2692 folderIcon.classList.add('fas', 'fa-folder-minus')
2693 card = this._createList() 2694 this.component.appendChild(card) 2695 } 2696 }) 2697 2698 return crumb 2699 } 2700 2701 /** 2702 * Cria lista 2703 * @private 2704 */ 2705 _createList() { 2706 const card = document.createElement('div') 2707 card.classList.add('br-card') 2708 2709 this.component.querySelectorAll('.crumb-list .crumb').forEach((crumb) => { 2710 if (crumb.classList.contains('d-none')) { 2711 const item = document.createElement('div') 2712 item.classList.add('br-item') 2713 2714 if (!crumb.classList.contains('home')) { 2715 item.appendChild(crumb.querySelector('a').cloneNode(true)) 2716 card.appendChild(item) 2717 } 2718 } 2719 }) 2720 2721 return card 2722 } 2723} 2724 2725/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRBreadcrumb); 2726 2727 2728/***/ }), 2729
vendor: 9,196 bytes, lines 2730-3040
2730/***/ "./src/components/card/card.js": 2731/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 2732 2733"use strict"; 2734/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2735/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 2736/* harmony export */ }); 2737/* harmony import */ var _partial_js_behavior_collapse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/partial/js/behavior/collapse.js"); 2738 2739 2740/** Classe para instanciar um objeto BRCard */ 2741class BRCard { 2742 /** 2743 * Instancia do componente 2744 * @property {string} name - Nome do componente em minúsculo 2745 * @property {object} component - Objeto referenciando a raiz do componente DOM 2746 * @property {string} id - nome da id do ocmponente 2747 */ 2748 constructor(name, component, id) { 2749 this.name = name 2750 this.component = component 2751 this.component.setAttribute('id', `card${id}`) 2752 this._setBehavior() 2753 } 2754 2755 /** 2756 * Define o comportamento do componente 2757 * @private 2758 */ 2759 _setBehavior() { 2760 this._setFlipBehavior() 2761 // this._setExpandBehavior() 2762 this._setDragBehavior() 2763 this._setDisableBehavior() 2764 this._collpaseBehavior() 2765 } 2766 2767 /** 2768 * Define o comportamento de comprimir (collapse) 2769 * @private 2770 */ 2771 _collpaseBehavior() { 2772 this.component 2773 .querySelectorAll('[data-toggle="collapse"]') 2774 .forEach((trigger) => { 2775 const config = { 2776 iconToHide: 'fa-chevron-up', 2777 iconToShow: 'fa-chevron-down', 2778 trigger, 2779 useIcons: true, 2780 } 2781 const collapse = new _partial_js_behavior_collapse__WEBPACK_IMPORTED_MODULE_0__["default"](config) 2782 collapse.setBehavior() 2783 }) 2784 } 2785 2786 /** 2787 * Desabilita o componente 2788 * @private 2789 */ 2790 _setDisableBehavior() { 2791 if (this.component.classList.contains('disabled')) { 2792 this.component.setAttribute('aria-hidden', 'true') 2793 const buttons = this.component.querySelectorAll('button') 2794 const inputs = this.component.querySelectorAll('input') 2795 const selects = this.component.querySelectorAll('select') 2796 const textareas = this.component.querySelectorAll('textarea') 2797 for (const button of buttons) { 2798 button.setAttribute('disabled', 'disabled') 2799 } 2800 for (const input of inputs) { 2801 input.setAttribute('disabled', 'disabled') 2802 } 2803 for (const select of selects) { 2804 select.setAttribute('disabled', 'disabled') 2805 } 2806 for (const textarea of textareas) { 2807 textarea.setAttribute('disabled', 'disabled') 2808 } 2809 } 2810 } 2811 2812 /** 2813 * Define o comportamento de girar (flip) 2814 * @private 2815 */ 2816 _setFlipBehavior() { 2817 for (const flip of this.component.querySelectorAll('button.flip')) { 2818 flip.addEventListener('click', () => { 2819 if (this.component.getAttribute('flipped') === 'off') { 2820 this.component.setAttribute('flipped', 'on') 2821 } else { 2822 this.component.setAttribute('flipped', 'off') 2823 } 2824 }) 2825 } 2826 } 2827 2828 /** 2829 * Define o comportamento de arrastar (drag) 2830 * @private 2831 */ 2832 _setDragBehavior() { 2833 for (const img of this.component.querySelectorAll('img')) { 2834 img.setAttribute('draggable', 'false') 2835 } 2836 for (const link of this.component.querySelectorAll('a')) { 2837 link.setAttribute('draggable', 'false') 2838 } 2839 this.component.addEventListener('dragstart', (event) => { 2840 event.stopPropagation() 2841 event.dataTransfer.setData( 2842 'text/plain', 2843 this.component.getAttribute('id') 2844 ) 2845 event.dropEffect = 'move' 2846 }) 2847 } 2848} 2849 2850/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRCard); 2851 2852 2853/***/ }), 2854 2855/***/ "./src/components/carousel/carousel.js": 2856/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 2857 2858"use strict"; 2859/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2860/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 2861/* harmony export */ }); 2862/* harmony import */ var _partial_js_behavior_swipe__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/partial/js/behavior/swipe.js"); 2863/* harmony import */ var _step_step__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/components/step/step.js"); 2864 2865 2866class BRCarousel { 2867 constructor(name, component) { 2868 /** 2869 * Instancia um componente carousel 2870 * @param {string} name - Nome do componente 2871 * @param {object} component - Objeto referenciando a raiz do componente DOM 2872 * @property {number} activeStageNum - Número do palco ativo 2873 * @property {array} DOMStrings - instancia dos elementos internos do componente 2874 * @property {BRStep} DOMStrings - instancia dos elemento step interno 2875 */ 2876 this.name = name 2877 this.component = component 2878 this.activeStageNum = 0 2879 // Elementos DOM 2880 this.DOMstrings = { 2881 carouselNextBtn: this.component.querySelector('.carousel-btn-next'), 2882 carouselPages: this.component.querySelectorAll('.carousel-page'), 2883 carouselPrevBtn: this.component.querySelector('.carousel-btn-prev'), 2884 carouselStage: this.component.querySelector('.carousel-stage'), 2885 circular: this.component.hasAttribute('data-circular'), 2886 step: this.component.querySelector('.br-step'), 2887 } 2888 this.step = new _step_step__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z('br-step', this.DOMstrings.step) 2889 this._setBehavior() 2890 } 2891 2892 /** 2893 * Remove os atributos de uma lista de elementos 2894 * @param {object} elemSet - Lista de elementos 2895 * @param {string} button - Nome do atributo 2896 */ 2897 removeAttributes(elemSet, attrName) { 2898 elemSet.forEach((elem) => { 2899 elem.removeAttribute(attrName) 2900 }) 2901 } 2902 2903 /** 2904 * Retorna o passo ativo 2905 */ 2906 getActiveStep() { 2907 return this.step.activeStepNum 2908 } 2909 2910 /** 2911 * Define o passo ativo 2912 * @param {number} activeStepNum - número do passo 2913 */ 2914 setActiveStep(activeStepNum) { 2915 this.step.setActiveStep(activeStepNum) 2916 } 2917 2918 /** 2919 * Retorna o palco ativo 2920 */ 2921 getActiveStage() { 2922 let activeStage 2923 this.DOMstrings.carouselPages.forEach((stage) => { 2924 if (stage.hasAttribute('active')) { 2925 activeStage = stage 2926 } 2927 }) 2928 return activeStage 2929 } 2930 2931 /** 2932 * Define o palco ativo 2933 * @param {number} num - número do palco 2934 */ 2935 setActiveStage(num) { 2936 // remove active atts from all the stages 2937 this.removeAttributes(this.DOMstrings.carouselPages, 'active') 2938 // show active stage 2939 this.DOMstrings.carouselPages.forEach((stage, index) => { 2940 // motion efect 2941 if (index > num) { 2942 stage.style.left = '100%' 2943 } else { 2944 stage.style.left = '-100%' 2945 } 2946 // set active attrb 2947 if (index === num) { 2948 stage.setAttribute('active', '') 2949 this.activeStageNum = num 2950 } 2951 }) 2952 this.disabledBtns() 2953 } 2954 2955 /** 2956 * Desabilita os botões se o carousel não for circular 2957 */ 2958 disabledBtns() { 2959 // Disables Carousel Buttons 2960 if (!this.DOMstrings.circular) { 2961 if (this.activeStageNum === 0) { 2962 this.DOMstrings.carouselPrevBtn.setAttribute('disabled', '') 2963 } else { 2964 this.DOMstrings.carouselPrevBtn.removeAttribute('disabled') 2965 } 2966 if (this.activeStageNum === this.DOMstrings.carouselPages.length - 1) { 2967 this.DOMstrings.carouselNextBtn.setAttribute('disabled', '') 2968 } else { 2969 this.DOMstrings.carouselNextBtn.removeAttribute('disabled') 2970 } 2971 } 2972 } 2973 2974 /** 2975 * Muda a página ativa incrementalmente - ações de botões e swap 2976 * @param {number} num - incremento 2977 */ 2978 shiftPage(num) { 2979 //find active stage 2980 const activeStage = this.getActiveStage() 2981 const PanelsSize = this.DOMstrings.carouselPages.length - 1 2982 let activeStageNum = Array.from(this.DOMstrings.carouselPages).indexOf( 2983 activeStage 2984 ) 2985 // set active step and active stage onclick 2986 if (num < 0) { 2987 // Volta o slide 2988 if (this.DOMstrings.circular) { 2989 activeStageNum = 2990 activeStageNum === 0 ? PanelsSize : (activeStageNum -= 1) 2991 } else { 2992 activeStageNum -= activeStageNum === 0 ? 0 : 1 2993 } 2994 } else { 2995 // Passar p/ frente o slide 2996 if (this.DOMstrings.circular) { 2997 activeStageNum = 2998 activeStageNum === PanelsSize ? 0 : (activeStageNum += 1) 2999 } else { 3000 activeStageNum += activeStageNum === PanelsSize ? 0 : 1 3001 } 3002 } 3003 this.setActiveStep(activeStageNum) 3004 this.setActiveStage(activeStageNum) 3005 } 3006 3007 /** 3008 * Define os comportamentos do componente 3009 * @private 3010 */ 3011 _setBehavior() { 3012 this.DOMstrings.carouselNextBtn.addEventListener('click', () => { 3013 this.shiftPage(1) 3014 }) 3015 3016 this.DOMstrings.carouselPrevBtn.addEventListener('click', () => { 3017 this.shiftPage(-1) 3018 }) 3019 3020 this.DOMstrings.step.addEventListener('click', () => { 3021 this.setActiveStage(this.step.activeStepNum) 3022 }) 3023 3024 // Swipe 3025 const dispatcher = new _partial_js_behavior_swipe__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z(this.DOMstrings.carouselStage) 3026 dispatcher.on('SWIPE_LEFT', () => { 3027 this.shiftPage(1) 3028 }) 3029 dispatcher.on('SWIPE_RIGHT', () => { 3030 this.shiftPage(-1) 3031 }) 3032 this.disabledBtns() 3033 } 3034} 3035 3036/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRCarousel); 3037 3038 3039/***/ }), 3040
3041/***/ "./src/components/checkbox/checkbox.js": 3042/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 3043 3044"use strict"; 3045/* harmony export */ __webpack_require__.d(__webpack_exports__, { 3046/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 3047/* harmony export */ }); 3048/* harmony import */ var _partial_js_behavior_checkgroup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/partial/js/behavior/checkgroup.js"); 3049 3050 3051/** Classe para instanciar um objeto BRCheckbox*/ 3052class BRCheckbox { 3053 /** 3054 * Instancia do objeto 3055 * @param {string} name - Nome do componente em minúsculo 3056 * @param {object} component - Objeto referenciando a raiz do componente DOM 3057 */ 3058 constructor(name, component) { 3059 this.name = name 3060 this.component = component 3061 this._setBehavior() 3062 } 3063 3064 /** 3065 * Define comportamentos do componente 3066 * @private 3067 */ 3068 _setBehavior() { 3069 this._setCheckgroupBehavior() 3070 } 3071 3072 /** 3073 * Define comportamentos do checkgroup 3074 * @private 3075 */ 3076 _setCheckgroupBehavior() { 3077 this.component 3078 .querySelectorAll('input[type="checkbox"][data-parent]') 3079 .forEach((trigger) => { 3080 const checkgroup = new _partial_js_behavior_checkgroup__WEBPACK_IMPORTED_MODULE_0__["default"](trigger) 3081 checkgroup.setBehavior() 3082 }) 3083 } 3084} 3085 3086/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRCheckbox); 3087 3088 3089/***/ }), 3090
vendor: 17,846 bytes, lines 3091-3618
3091/***/ "./src/components/datetimepicker/datetimepicker.js": 3092/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 3093 3094"use strict"; 3095 3096// EXPORTS 3097__webpack_require__.d(__webpack_exports__, { 3098 Z: () => (/* binding */ datetimepicker) 3099}); 3100 3101;// CONCATENATED MODULE: ./node_modules/flatpickr/dist/esm/types/options.js 3102var HOOKS = [ 3103 "onChange", 3104 "onClose", 3105 "onDayCreate", 3106 "onDestroy", 3107 "onKeyDown", 3108 "onMonthChange", 3109 "onOpen", 3110 "onParseConfig", 3111 "onReady", 3112 "onValueUpdate", 3113 "onYearChange", 3114 "onPreCalendarPosition", 3115]; 3116var defaults = { 3117 _disable: [], 3118 allowInput: false, 3119 allowInvalidPreload: false, 3120 altFormat: "F j, Y", 3121 altInput: false, 3122 altInputClass: "form-control input", 3123 animate: typeof window === "object" && 3124 window.navigator.userAgent.indexOf("MSIE") === -1, 3125 ariaDateFormat: "F j, Y", 3126 autoFillDefaultTime: true, 3127 clickOpens: true, 3128 closeOnSelect: true, 3129 conjunction: ", ", 3130 dateFormat: "Y-m-d", 3131 defaultHour: 12, 3132 defaultMinute: 0, 3133 defaultSeconds: 0, 3134 disable: [], 3135 disableMobile: false, 3136 enableSeconds: false, 3137 enableTime: false, 3138 errorHandler: function (err) { 3139 return typeof console !== "undefined" && console.warn(err); 3140 }, 3141 getWeek: function (givenDate) { 3142 var date = new Date(givenDate.getTime()); 3143 date.setHours(0, 0, 0, 0); 3144 date.setDate(date.getDate() + 3 - ((date.getDay() + 6) % 7)); 3145 var week1 = new Date(date.getFullYear(), 0, 4); 3146 return (1 + 3147 Math.round(((date.getTime() - week1.getTime()) / 86400000 - 3148 3 + 3149 ((week1.getDay() + 6) % 7)) / 3150 7)); 3151 }, 3152 hourIncrement: 1, 3153 ignoredFocusElements: [], 3154 inline: false, 3155 locale: "default", 3156 minuteIncrement: 5, 3157 mode: "single", 3158 monthSelectorType: "dropdown", 3159 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>", 3160 noCalendar: false, 3161 now: new Date(), 3162 onChange: [], 3163 onClose: [], 3164 onDayCreate: [], 3165 onDestroy: [], 3166 onKeyDown: [], 3167 onMonthChange: [], 3168 onOpen: [], 3169 onParseConfig: [], 3170 onReady: [], 3171 onValueUpdate: [], 3172 onYearChange: [], 3173 onPreCalendarPosition: [], 3174 plugins: [], 3175 position: "auto", 3176 positionElement: undefined, 3177 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>", 3178 shorthandCurrentMonth: false, 3179 showMonths: 1, 3180 static: false, 3181 time_24hr: false, 3182 weekNumbers: false, 3183 wrap: false, 3184}; 3185 3186;// CONCATENATED MODULE: ./node_modules/flatpickr/dist/esm/l10n/default.js 3187var english = { 3188 weekdays: { 3189 shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], 3190 longhand: [ 3191 "Sunday", 3192 "Monday", 3193 "Tuesday", 3194 "Wednesday", 3195 "Thursday", 3196 "Friday", 3197 "Saturday", 3198 ], 3199 }, 3200 months: { 3201 shorthand: [ 3202 "Jan", 3203 "Feb", 3204 "Mar", 3205 "Apr", 3206 "May", 3207 "Jun", 3208 "Jul", 3209 "Aug", 3210 "Sep", 3211 "Oct", 3212 "Nov", 3213 "Dec", 3214 ], 3215 longhand: [ 3216 "January", 3217 "February", 3218 "March", 3219 "April", 3220 "May", 3221 "June", 3222 "July", 3223 "August", 3224 "September", 3225 "October", 3226 "November", 3227 "December", 3228 ], 3229 }, 3230 daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], 3231 firstDayOfWeek: 0, 3232 ordinal: function (nth) { 3233 var s = nth % 100; 3234 if (s > 3 && s < 21) 3235 return "th"; 3236 switch (s % 10) { 3237 case 1: 3238 return "st"; 3239 case 2: 3240 return "nd"; 3241 case 3: 3242 return "rd"; 3243 default: 3244 return "th"; 3245 } 3246 }, 3247 rangeSeparator: " to ", 3248 weekAbbreviation: "Wk", 3249 scrollTitle: "Scroll to increment", 3250 toggleTitle: "Click to toggle", 3251 amPM: ["AM", "PM"], 3252 yearAriaLabel: "Year", 3253 monthAriaLabel: "Month", 3254 hourAriaLabel: "Hour", 3255 minuteAriaLabel: "Minute", 3256 time_24hr: false, 3257}; 3258/* harmony default export */ const l10n_default = (english); 3259 3260;// CONCATENATED MODULE: ./node_modules/flatpickr/dist/esm/utils/index.js 3261var pad = function (number, length) { 3262 if (length === void 0) { length = 2; } 3263 return ("000" + number).slice(length * -1); 3264}; 3265var utils_int = function (bool) { return (bool === true ? 1 : 0); }; 3266function debounce(fn, wait) { 3267 var t; 3268 return function () { 3269 var _this = this; 3270 var args = arguments; 3271 clearTimeout(t); 3272 t = setTimeout(function () { return fn.apply(_this, args); }, wait); 3273 }; 3274} 3275var arrayify = function (obj) { 3276 return obj instanceof Array ? obj : [obj]; 3277}; 3278 3279;// CONCATENATED MODULE: ./node_modules/flatpickr/dist/esm/utils/dom.js 3280function toggleClass(elem, className, bool) { 3281 if (bool === true) 3282 return elem.classList.add(className); 3283 elem.classList.remove(className); 3284} 3285function createElement(tag, className, content) { 3286 var e = window.document.createElement(tag); 3287 className = className || ""; 3288 content = content || ""; 3289 e.className = className; 3290 if (content !== undefined) 3291 e.textContent = content; 3292 return e; 3293} 3294function clearNode(node) { 3295 while (node.firstChild) 3296 node.removeChild(node.firstChild); 3297} 3298function findParent(node, condition) { 3299 if (condition(node)) 3300 return node; 3301 else if (node.parentNode) 3302 return findParent(node.parentNode, condition); 3303 return undefined; 3304} 3305function createNumberInput(inputClassName, opts) { 3306 var wrapper = createElement("div", "numInputWrapper"), numInput = createElement("input", "numInput " + inputClassName), arrowUp = createElement("span", "arrowUp"), arrowDown = createElement("span", "arrowDown"); 3307 if (navigator.userAgent.indexOf("MSIE 9.0") === -1) { 3308 numInput.type = "number"; 3309 } 3310 else { 3311 numInput.type = "text"; 3312 numInput.pattern = "\\d*"; 3313 } 3314 if (opts !== undefined) 3315 for (var key in opts) 3316 numInput.setAttribute(key, opts[key]); 3317 wrapper.appendChild(numInput); 3318 wrapper.appendChild(arrowUp); 3319 wrapper.appendChild(arrowDown); 3320 return wrapper; 3321} 3322function getEventTarget(event) { 3323 try { 3324 if (typeof event.composedPath === "function") { 3325 var path = event.composedPath(); 3326 return path[0]; 3327 } 3328 return event.target; 3329 } 3330 catch (error) { 3331 return event.target; 3332 } 3333} 3334 3335;// CONCATENATED MODULE: ./node_modules/flatpickr/dist/esm/utils/formatting.js 3336 3337var doNothing = function () { return undefined; }; 3338var monthToStr = function (monthNumber, shorthand, locale) { return locale.months[shorthand ? "shorthand" : "longhand"][monthNumber]; }; 3339var revFormat = { 3340 D: doNothing, 3341 F: function (dateObj, monthName, locale) { 3342 dateObj.setMonth(locale.months.longhand.indexOf(monthName)); 3343 }, 3344 G: function (dateObj, hour) { 3345 dateObj.setHours((dateObj.getHours() >= 12 ? 12 : 0) + parseFloat(hour)); 3346 }, 3347 H: function (dateObj, hour) { 3348 dateObj.setHours(parseFloat(hour)); 3349 }, 3350 J: function (dateObj, day) { 3351 dateObj.setDate(parseFloat(day)); 3352 }, 3353 K: function (dateObj, amPM, locale) { 3354 dateObj.setHours((dateObj.getHours() % 12) + 3355 12 * utils_int(new RegExp(locale.amPM[1], "i").test(amPM))); 3356 }, 3357 M: function (dateObj, shortMonth, locale) { 3358 dateObj.setMonth(locale.months.shorthand.indexOf(shortMonth)); 3359 }, 3360 S: function (dateObj, seconds) { 3361 dateObj.setSeconds(parseFloat(seconds)); 3362 }, 3363 U: function (_, unixSeconds) { return new Date(parseFloat(unixSeconds) * 1000); }, 3364 W: function (dateObj, weekNum, locale) { 3365 var weekNumber = parseInt(weekNum); 3366 var date = new Date(dateObj.getFullYear(), 0, 2 + (weekNumber - 1) * 7, 0, 0, 0, 0); 3367 date.setDate(date.getDate() - date.getDay() + locale.firstDayOfWeek); 3368 return date; 3369 }, 3370 Y: function (dateObj, year) { 3371 dateObj.setFullYear(parseFloat(year)); 3372 }, 3373 Z: function (_, ISODate) { return new Date(ISODate); }, 3374 d: function (dateObj, day) { 3375 dateObj.setDate(parseFloat(day)); 3376 }, 3377 h: function (dateObj, hour) { 3378 dateObj.setHours((dateObj.getHours() >= 12 ? 12 : 0) + parseFloat(hour)); 3379 }, 3380 i: function (dateObj, minutes) { 3381 dateObj.setMinutes(parseFloat(minutes)); 3382 }, 3383 j: function (dateObj, day) { 3384 dateObj.setDate(parseFloat(day)); 3385 }, 3386 l: doNothing, 3387 m: function (dateObj, month) { 3388 dateObj.setMonth(parseFloat(month) - 1); 3389 }, 3390 n: function (dateObj, month) { 3391 dateObj.setMonth(parseFloat(month) - 1); 3392 }, 3393 s: function (dateObj, seconds) { 3394 dateObj.setSeconds(parseFloat(seconds)); 3395 }, 3396 u: function (_, unixMillSeconds) { 3397 return new Date(parseFloat(unixMillSeconds)); 3398 }, 3399 w: doNothing, 3400 y: function (dateObj, year) { 3401 dateObj.setFullYear(2000 + parseFloat(year)); 3402 }, 3403}; 3404var tokenRegex = { 3405 D: "", 3406 F: "", 3407 G: "(\\d\\d|\\d)", 3408 H: "(\\d\\d|\\d)", 3409 J: "(\\d\\d|\\d)\\w+", 3410 K: "", 3411 M: "", 3412 S: "(\\d\\d|\\d)", 3413 U: "(.+)", 3414 W: "(\\d\\d|\\d)", 3415 Y: "(\\d{4})", 3416 Z: "(.+)", 3417 d: "(\\d\\d|\\d)", 3418 h: "(\\d\\d|\\d)", 3419 i: "(\\d\\d|\\d)", 3420 j: "(\\d\\d|\\d)", 3421 l: "", 3422 m: "(\\d\\d|\\d)", 3423 n: "(\\d\\d|\\d)", 3424 s: "(\\d\\d|\\d)", 3425 u: "(.+)", 3426 w: "(\\d\\d|\\d)", 3427 y: "(\\d{2})", 3428}; 3429var formats = { 3430 Z: function (date) { return date.toISOString(); }, 3431 D: function (date, locale, options) { 3432 return locale.weekdays.shorthand[formats.w(date, locale, options)]; 3433 }, 3434 F: function (date, locale, options) { 3435 return monthToStr(formats.n(date, locale, options) - 1, false, locale); 3436 }, 3437 G: function (date, locale, options) { 3438 return pad(formats.h(date, locale, options)); 3439 }, 3440 H: function (date) { return pad(date.getHours()); }, 3441 J: function (date, locale) { 3442 return locale.ordinal !== undefined 3443 ? date.getDate() + locale.ordinal(date.getDate()) 3444 : date.getDate(); 3445 }, 3446 K: function (date, locale) { return locale.amPM[utils_int(date.getHours() > 11)]; }, 3447 M: function (date, locale) { 3448 return monthToStr(date.getMonth(), true, locale); 3449 }, 3450 S: function (date) { return pad(date.getSeconds()); }, 3451 U: function (date) { return date.getTime() / 1000; }, 3452 W: function (date, _, options) { 3453 return options.getWeek(date); 3454 }, 3455 Y: function (date) { return pad(date.getFullYear(), 4); }, 3456 d: function (date) { return pad(date.getDate()); }, 3457 h: function (date) { return (date.getHours() % 12 ? date.getHours() % 12 : 12); }, 3458 i: function (date) { return pad(date.getMinutes()); }, 3459 j: function (date) { return date.getDate(); }, 3460 l: function (date, locale) { 3461 return locale.weekdays.longhand[date.getDay()]; 3462 }, 3463 m: function (date) { return pad(date.getMonth() + 1); }, 3464 n: function (date) { return date.getMonth() + 1; }, 3465 s: function (date) { return date.getSeconds(); }, 3466 u: function (date) { return date.getTime(); }, 3467 w: function (date) { return date.getDay(); }, 3468 y: function (date) { return String(date.getFullYear()).substring(2); }, 3469}; 3470 3471;// CONCATENATED MODULE: ./node_modules/flatpickr/dist/esm/utils/dates.js 3472 3473 3474 3475var createDateFormatter = function (_a) { 3476 var _b = _a.config, config = _b === void 0 ? defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? english : _c, _d = _a.isMobile, isMobile = _d === void 0 ? false : _d; 3477 return function (dateObj, frmt, overrideLocale) { 3478 var locale = overrideLocale || l10n; 3479 if (config.formatDate !== undefined && !isMobile) { 3480 return config.formatDate(dateObj, frmt, locale); 3481 } 3482 return frmt 3483 .split("") 3484 .map(function (c, i, arr) { 3485 return formats[c] && arr[i - 1] !== "\\" 3486 ? formats[c](dateObj, locale, config) 3487 : c !== "\\" 3488 ? c 3489 : ""; 3490 }) 3491 .join(""); 3492 }; 3493}; 3494var createDateParser = function (_a) { 3495 var _b = _a.config, config = _b === void 0 ? defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? english : _c; 3496 return function (date, givenFormat, timeless, customLocale) { 3497 if (date !== 0 && !date) 3498 return undefined; 3499 var locale = customLocale || l10n; 3500 var parsedDate; 3501 var dateOrig = date; 3502 if (date instanceof Date) 3503 parsedDate = new Date(date.getTime()); 3504 else if (typeof date !== "string" && 3505 date.toFixed !== undefined) 3506 parsedDate = new Date(date); 3507 else if (typeof date === "string") { 3508 var format = givenFormat || (config || defaults).dateFormat; 3509 var datestr = String(date).trim(); 3510 if (datestr === "today") { 3511 parsedDate = new Date(); 3512 timeless = true; 3513 } 3514 else if (config && config.parseDate) { 3515 parsedDate = config.parseDate(date, format); 3516 } 3517 else if (/Z$/.test(datestr) || 3518 /GMT$/.test(datestr)) { 3519 parsedDate = new Date(date); 3520 } 3521 else { 3522 var matched = void 0, ops = []; 3523 for (var i = 0, matchIndex = 0, regexStr = ""; i < format.length; i++) { 3524 var token = format[i]; 3525 var isBackSlash = token === "\\"; 3526 var escaped = format[i - 1] === "\\" || isBackSlash; 3527 if (tokenRegex[token] && !escaped) { 3528 regexStr += tokenRegex[token]; 3529 var match = new RegExp(regexStr).exec(date); 3530 if (match && (matched = true)) { 3531 ops[token !== "Y" ? "push" : "unshift"]({ 3532 fn: revFormat[token], 3533 val: match[++matchIndex], 3534 }); 3535 } 3536 } 3537 else if (!isBackSlash) 3538 regexStr += "."; 3539 } 3540 parsedDate = 3541 !config || !config.noCalendar 3542 ? new Date(new Date().getFullYear(), 0, 1, 0, 0, 0, 0) 3543 : new Date(new Date().setHours(0, 0, 0, 0)); 3544 ops.forEach(function (_a) { 3545 var fn = _a.fn, val = _a.val; 3546 return (parsedDate = fn(parsedDate, val, locale) || parsedDate); 3547 }); 3548 parsedDate = matched ? parsedDate : undefined; 3549 } 3550 } 3551 if (!(parsedDate instanceof Date && !isNaN(parsedDate.getTime()))) { 3552 config.errorHandler(new Error("Invalid date provided: " + dateOrig)); 3553 return undefined; 3554 } 3555 if (timeless === true) 3556 parsedDate.setHours(0, 0, 0, 0); 3557 return parsedDate; 3558 }; 3559}; 3560function compareDates(date1, date2, timeless) { 3561 if (timeless === void 0) { timeless = true; } 3562 if (timeless !== false) { 3563 return (new Date(date1.getTime()).setHours(0, 0, 0, 0) - 3564 new Date(date2.getTime()).setHours(0, 0, 0, 0)); 3565 } 3566 return date1.getTime() - date2.getTime(); 3567} 3568function compareTimes(date1, date2) { 3569 return (3600 * (date1.getHours() - date2.getHours()) + 3570 60 * (date1.getMinutes() - date2.getMinutes()) + 3571 date1.getSeconds() - 3572 date2.getSeconds()); 3573} 3574var isBetween = function (ts, ts1, ts2) { 3575 return ts > Math.min(ts1, ts2) && ts < Math.max(ts1, ts2); 3576}; 3577var calculateSecondsSinceMidnight = function (hours, minutes, seconds) { 3578 return hours * 3600 + minutes * 60 + seconds; 3579}; 3580var parseSeconds = function (secondsSinceMidnight) { 3581 var hours = Math.floor(secondsSinceMidnight / 3600), minutes = (secondsSinceMidnight - hours * 3600) / 60; 3582 return [hours, minutes, secondsSinceMidnight - hours * 3600 - minutes * 60]; 3583}; 3584var duration = { 3585 DAY: 86400000, 3586}; 3587function getDefaultHours(config) { 3588 var hours = config.defaultHour; 3589 var minutes = config.defaultMinute; 3590 var seconds = config.defaultSeconds; 3591 if (config.minDate !== undefined) { 3592 var minHour = config.minDate.getHours(); 3593 var minMinutes = config.minDate.getMinutes(); 3594 var minSeconds = config.minDate.getSeconds(); 3595 if (hours < minHour) { 3596 hours = minHour; 3597 } 3598 if (hours === minHour && minutes < minMinutes) { 3599 minutes = minMinutes; 3600 } 3601 if (hours === minHour && minutes === minMinutes && seconds < minSeconds) 3602 seconds = config.minDate.getSeconds(); 3603 } 3604 if (config.maxDate !== undefined) { 3605 var maxHr = config.maxDate.getHours(); 3606 var maxMinutes = config.maxDate.getMinutes(); 3607 hours = Math.min(hours, maxHr); 3608 if (hours === maxHr) 3609 minutes = Math.min(maxMinutes, minutes); 3610 if (hours === maxHr && minutes === maxMinutes) 3611 seconds = config.maxDate.getSeconds(); 3612 } 3613 return { hours: hours, minutes: minutes, seconds: seconds }; 3614} 3615 3616// EXTERNAL MODULE: ./node_modules/flatpickr/dist/esm/utils/polyfills.js 3617var polyfills = __webpack_require__("./node_modules/flatpickr/dist/esm/utils/polyfills.js"); 3618;// CONCATENATED MODULE:
vendor: 11,026 bytes, lines 3618-3887
3618 ./node_modules/flatpickr/dist/esm/index.js 3619var __assign = (undefined && undefined.__assign) || function () { 3620 __assign = Object.assign || function(t) { 3621 for (var s, i = 1, n = arguments.length; i < n; i++) { 3622 s = arguments[i]; 3623 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) 3624 t[p] = s[p]; 3625 } 3626 return t; 3627 }; 3628 return __assign.apply(this, arguments); 3629}; 3630var __spreadArrays = (undefined && undefined.__spreadArrays) || function () { 3631 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; 3632 for (var r = Array(s), k = 0, i = 0; i < il; i++) 3633 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) 3634 r[k] = a[j]; 3635 return r; 3636}; 3637 3638 3639 3640 3641 3642 3643 3644var DEBOUNCED_CHANGE_MS = 300; 3645function FlatpickrInstance(element, instanceConfig) { 3646 var self = { 3647 config: __assign(__assign({}, defaults), flatpickr.defaultConfig), 3648 l10n: l10n_default, 3649 }; 3650 self.parseDate = createDateParser({ config: self.config, l10n: self.l10n }); 3651 self._handlers = []; 3652 self.pluginElements = []; 3653 self.loadedPlugins = []; 3654 self._bind = bind; 3655 self._setHoursFromDate = setHoursFromDate; 3656 self._positionCalendar = positionCalendar; 3657 self.changeMonth = changeMonth; 3658 self.changeYear = changeYear; 3659 self.clear = clear; 3660 self.close = close; 3661 self.onMouseOver = onMouseOver; 3662 self._createElement = createElement; 3663 self.createDay = createDay; 3664 self.destroy = destroy; 3665 self.isEnabled = isEnabled; 3666 self.jumpToDate = jumpToDate; 3667 self.updateValue = updateValue; 3668 self.open = open; 3669 self.redraw = redraw; 3670 self.set = set; 3671 self.setDate = setDate; 3672 self.toggle = toggle; 3673 function setupHelperFunctions() { 3674 self.utils = { 3675 getDaysInMonth: function (month, yr) { 3676 if (month === void 0) { month = self.currentMonth; } 3677 if (yr === void 0) { yr = self.currentYear; } 3678 if (month === 1 && ((yr % 4 === 0 && yr % 100 !== 0) || yr % 400 === 0)) 3679 return 29; 3680 return self.l10n.daysInMonth[month]; 3681 }, 3682 }; 3683 } 3684 function init() { 3685 self.element = self.input = element; 3686 self.isOpen = false; 3687 parseConfig(); 3688 setupLocale(); 3689 setupInputs(); 3690 setupDates(); 3691 setupHelperFunctions(); 3692 if (!self.isMobile) 3693 build(); 3694 bindEvents(); 3695 if (self.selectedDates.length || self.config.noCalendar) { 3696 if (self.config.enableTime) { 3697 setHoursFromDate(self.config.noCalendar ? self.latestSelectedDateObj : undefined); 3698 } 3699 updateValue(false); 3700 } 3701 setCalendarWidth(); 3702 var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); 3703 if (!self.isMobile && isSafari) { 3704 positionCalendar(); 3705 } 3706 triggerEvent("onReady"); 3707 } 3708 function getClosestActiveElement() { 3709 var _a; 3710 return (((_a = self.calendarContainer) === null || _a === void 0 ? void 0 : _a.getRootNode()) 3711 .activeElement || document.activeElement); 3712 } 3713 function bindToInstance(fn) { 3714 return fn.bind(self); 3715 } 3716 function setCalendarWidth() { 3717 var config = self.config; 3718 if (config.weekNumbers === false && config.showMonths === 1) { 3719 return; 3720 } 3721 else if (config.noCalendar !== true) { 3722 window.requestAnimationFrame(function () { 3723 if (self.calendarContainer !== undefined) { 3724 self.calendarContainer.style.visibility = "hidden"; 3725 self.calendarContainer.style.display = "block"; 3726 } 3727 if (self.daysContainer !== undefined) { 3728 var daysWidth = (self.days.offsetWidth + 1) * config.showMonths; 3729 self.daysContainer.style.width = daysWidth + "px"; 3730 self.calendarContainer.style.width = 3731 daysWidth + 3732 (self.weekWrapper !== undefined 3733 ? self.weekWrapper.offsetWidth 3734 : 0) + 3735 "px"; 3736 self.calendarContainer.style.removeProperty("visibility"); 3737 self.calendarContainer.style.removeProperty("display"); 3738 } 3739 }); 3740 } 3741 } 3742 function updateTime(e) { 3743 if (self.selectedDates.length === 0) { 3744 var defaultDate = self.config.minDate === undefined || 3745 compareDates(new Date(), self.config.minDate) >= 0 3746 ? new Date() 3747 : new Date(self.config.minDate.getTime()); 3748 var defaults = getDefaultHours(self.config); 3749 defaultDate.setHours(defaults.hours, defaults.minutes, defaults.seconds, defaultDate.getMilliseconds()); 3750 self.selectedDates = [defaultDate]; 3751 self.latestSelectedDateObj = defaultDate; 3752 } 3753 if (e !== undefined && e.type !== "blur") { 3754 timeWrapper(e); 3755 } 3756 var prevValue = self._input.value; 3757 setHoursFromInputs(); 3758 updateValue(); 3759 if (self._input.value !== prevValue) { 3760 self._debouncedChange(); 3761 } 3762 } 3763 function ampm2military(hour, amPM) { 3764 return (hour % 12) + 12 * utils_int(amPM === self.l10n.amPM[1]); 3765 } 3766 function military2ampm(hour) { 3767 switch (hour % 24) { 3768 case 0: 3769 case 12: 3770 return 12; 3771 default: 3772 return hour % 12; 3773 } 3774 } 3775 function setHoursFromInputs() { 3776 if (self.hourElement === undefined || self.minuteElement === undefined) 3777 return; 3778 var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24, minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60, seconds = self.secondElement !== undefined 3779 ? (parseInt(self.secondElement.value, 10) || 0) % 60 3780 : 0; 3781 if (self.amPM !== undefined) { 3782 hours = ampm2military(hours, self.amPM.textContent); 3783 } 3784 var limitMinHours = self.config.minTime !== undefined || 3785 (self.config.minDate && 3786 self.minDateHasTime && 3787 self.latestSelectedDateObj && 3788 compareDates(self.latestSelectedDateObj, self.config.minDate, true) === 3789 0); 3790 var limitMaxHours = self.config.maxTime !== undefined || 3791 (self.config.maxDate && 3792 self.maxDateHasTime && 3793 self.latestSelectedDateObj && 3794 compareDates(self.latestSelectedDateObj, self.config.maxDate, true) === 3795 0); 3796 if (self.config.maxTime !== undefined && 3797 self.config.minTime !== undefined && 3798 self.config.minTime > self.config.maxTime) { 3799 var minBound = calculateSecondsSinceMidnight(self.config.minTime.getHours(), self.config.minTime.getMinutes(), self.config.minTime.getSeconds()); 3800 var maxBound = calculateSecondsSinceMidnight(self.config.maxTime.getHours(), self.config.maxTime.getMinutes(), self.config.maxTime.getSeconds()); 3801 var currentTime = calculateSecondsSinceMidnight(hours, minutes, seconds); 3802 if (currentTime > maxBound && currentTime < minBound) { 3803 var result = parseSeconds(minBound); 3804 hours = result[0]; 3805 minutes = result[1]; 3806 seconds = result[2]; 3807 } 3808 } 3809 else { 3810 if (limitMaxHours) { 3811 var maxTime = self.config.maxTime !== undefined 3812 ? self.config.maxTime 3813 : self.config.maxDate; 3814 hours = Math.min(hours, maxTime.getHours()); 3815 if (hours === maxTime.getHours()) 3816 minutes = Math.min(minutes, maxTime.getMinutes()); 3817 if (minutes === maxTime.getMinutes()) 3818 seconds = Math.min(seconds, maxTime.getSeconds()); 3819 } 3820 if (limitMinHours) { 3821 var minTime = self.config.minTime !== undefined 3822 ? self.config.minTime 3823 : self.config.minDate; 3824 hours = Math.max(hours, minTime.getHours()); 3825 if (hours === minTime.getHours() && minutes < minTime.getMinutes()) 3826 minutes = minTime.getMinutes(); 3827 if (minutes === minTime.getMinutes()) 3828 seconds = Math.max(seconds, minTime.getSeconds()); 3829 } 3830 } 3831 setHours(hours, minutes, seconds); 3832 } 3833 function setHoursFromDate(dateObj) { 3834 var date = dateObj || self.latestSelectedDateObj; 3835 if (date && date instanceof Date) { 3836 setHours(date.getHours(), date.getMinutes(), date.getSeconds()); 3837 } 3838 } 3839 function setHours(hours, minutes, seconds) { 3840 if (self.latestSelectedDateObj !== undefined) { 3841 self.latestSelectedDateObj.setHours(hours % 24, minutes, seconds || 0, 0); 3842 } 3843 if (!self.hourElement || !self.minuteElement || self.isMobile) 3844 return; 3845 self.hourElement.value = pad(!self.config.time_24hr 3846 ? ((12 + hours) % 12) + 12 * utils_int(hours % 12 === 0) 3847 : hours); 3848 self.minuteElement.value = pad(minutes); 3849 if (self.amPM !== undefined) 3850 self.amPM.textContent = self.l10n.amPM[utils_int(hours >= 12)]; 3851 if (self.secondElement !== undefined) 3852 self.secondElement.value = pad(seconds); 3853 } 3854 function onYearInput(event) { 3855 var eventTarget = getEventTarget(event); 3856 var year = parseInt(eventTarget.value) + (event.delta || 0); 3857 if (year / 1000 > 1 || 3858 (event.key === "Enter" && !/[^\d]/.test(year.toString()))) { 3859 changeYear(year); 3860 } 3861 } 3862 function bind(element, event, handler, options) { 3863 if (event instanceof Array) 3864 return event.forEach(function (ev) { return bind(element, ev, handler, options); }); 3865 if (element instanceof Array) 3866 return element.forEach(function (el) { return bind(el, event, handler, options); }); 3867 element.addEventListener(event, handler, options); 3868 self._handlers.push({ 3869 remove: function () { return element.removeEventListener(event, handler, options); }, 3870 }); 3871 } 3872 function triggerChange() { 3873 triggerEvent("onChange"); 3874 } 3875 function bindEvents() { 3876 if (self.config.wrap) { 3877 ["open", "close", "toggle", "clear"].forEach(function (evt) { 3878 Array.prototype.forEach.call(self.element.querySelectorAll("[data-" + evt + "]"), function (el) { 3879 return bind(el, "click", self[evt]); 3880 }); 3881 }); 3882 } 3883 if (self.isMobile) { 3884 setupMobile(); 3885 return; 3886 } 3887 var debouncedResize = debounce(onResize, 50);
vendor: 13,817 bytes, lines 3888-4174
3888 self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS); 3889 if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent)) 3890 bind(self.daysContainer, "mouseover", function (e) { 3891 if (self.config.mode === "range") 3892 onMouseOver(getEventTarget(e)); 3893 }); 3894 bind(self._input, "keydown", onKeyDown); 3895 if (self.calendarContainer !== undefined) { 3896 bind(self.calendarContainer, "keydown", onKeyDown); 3897 } 3898 if (!self.config.inline && !self.config.static) 3899 bind(window, "resize", debouncedResize); 3900 if (window.ontouchstart !== undefined) 3901 bind(window.document, "touchstart", documentClick); 3902 else 3903 bind(window.document, "mousedown", documentClick); 3904 bind(window.document, "focus", documentClick, { capture: true }); 3905 if (self.config.clickOpens === true) { 3906 bind(self._input, "focus", self.open); 3907 bind(self._input, "click", self.open); 3908 } 3909 if (self.daysContainer !== undefined) { 3910 bind(self.monthNav, "click", onMonthNavClick); 3911 bind(self.monthNav, ["keyup", "increment"], onYearInput); 3912 bind(self.daysContainer, "click", selectDate); 3913 } 3914 if (self.timeContainer !== undefined && 3915 self.minuteElement !== undefined && 3916 self.hourElement !== undefined) { 3917 var selText = function (e) { 3918 return getEventTarget(e).select(); 3919 }; 3920 bind(self.timeContainer, ["increment"], updateTime); 3921 bind(self.timeContainer, "blur", updateTime, { capture: true }); 3922 bind(self.timeContainer, "click", timeIncrement); 3923 bind([self.hourElement, self.minuteElement], ["focus", "click"], selText); 3924 if (self.secondElement !== undefined) 3925 bind(self.secondElement, "focus", function () { return self.secondElement && self.secondElement.select(); }); 3926 if (self.amPM !== undefined) { 3927 bind(self.amPM, "click", function (e) { 3928 updateTime(e); 3929 }); 3930 } 3931 } 3932 if (self.config.allowInput) { 3933 bind(self._input, "blur", onBlur); 3934 } 3935 } 3936 function jumpToDate(jumpDate, triggerChange) { 3937 var jumpTo = jumpDate !== undefined 3938 ? self.parseDate(jumpDate) 3939 : self.latestSelectedDateObj || 3940 (self.config.minDate && self.config.minDate > self.now 3941 ? self.config.minDate 3942 : self.config.maxDate && self.config.maxDate < self.now 3943 ? self.config.maxDate 3944 : self.now); 3945 var oldYear = self.currentYear; 3946 var oldMonth = self.currentMonth; 3947 try { 3948 if (jumpTo !== undefined) { 3949 self.currentYear = jumpTo.getFullYear(); 3950 self.currentMonth = jumpTo.getMonth(); 3951 } 3952 } 3953 catch (e) { 3954 e.message = "Invalid date supplied: " + jumpTo; 3955 self.config.errorHandler(e); 3956 } 3957 if (triggerChange && self.currentYear !== oldYear) { 3958 triggerEvent("onYearChange"); 3959 buildMonthSwitch(); 3960 } 3961 if (triggerChange && 3962 (self.currentYear !== oldYear || self.currentMonth !== oldMonth)) { 3963 triggerEvent("onMonthChange"); 3964 } 3965 self.redraw(); 3966 } 3967 function timeIncrement(e) { 3968 var eventTarget = getEventTarget(e); 3969 if (~eventTarget.className.indexOf("arrow")) 3970 incrementNumInput(e, eventTarget.classList.contains("arrowUp") ? 1 : -1); 3971 } 3972 function incrementNumInput(e, delta, inputElem) { 3973 var target = e && getEventTarget(e); 3974 var input = inputElem || 3975 (target && target.parentNode && target.parentNode.firstChild); 3976 var event = createEvent("increment"); 3977 event.delta = delta; 3978 input && input.dispatchEvent(event); 3979 } 3980 function build() { 3981 var fragment = window.document.createDocumentFragment(); 3982 self.calendarContainer = createElement("div", "flatpickr-calendar"); 3983 self.calendarContainer.tabIndex = -1; 3984 if (!self.config.noCalendar) { 3985 fragment.appendChild(buildMonthNav()); 3986 self.innerContainer = createElement("div", "flatpickr-innerContainer"); 3987 if (self.config.weekNumbers) { 3988 var _a = buildWeeks(), weekWrapper = _a.weekWrapper, weekNumbers = _a.weekNumbers; 3989 self.innerContainer.appendChild(weekWrapper); 3990 self.weekNumbers = weekNumbers; 3991 self.weekWrapper = weekWrapper; 3992 } 3993 self.rContainer = createElement("div", "flatpickr-rContainer"); 3994 self.rContainer.appendChild(buildWeekdays()); 3995 if (!self.daysContainer) { 3996 self.daysContainer = createElement("div", "flatpickr-days"); 3997 self.daysContainer.tabIndex = -1; 3998 } 3999 buildDays(); 4000 self.rContainer.appendChild(self.daysContainer); 4001 self.innerContainer.appendChild(self.rContainer); 4002 fragment.appendChild(self.innerContainer); 4003 } 4004 if (self.config.enableTime) { 4005 fragment.appendChild(buildTime()); 4006 } 4007 toggleClass(self.calendarContainer, "rangeMode", self.config.mode === "range"); 4008 toggleClass(self.calendarContainer, "animate", self.config.animate === true); 4009 toggleClass(self.calendarContainer, "multiMonth", self.config.showMonths > 1); 4010 self.calendarContainer.appendChild(fragment); 4011 var customAppend = self.config.appendTo !== undefined && 4012 self.config.appendTo.nodeType !== undefined; 4013 if (self.config.inline || self.config.static) { 4014 self.calendarContainer.classList.add(self.config.inline ? "inline" : "static"); 4015 if (self.config.inline) { 4016 if (!customAppend && self.element.parentNode) 4017 self.element.parentNode.insertBefore(self.calendarContainer, self._input.nextSibling); 4018 else if (self.config.appendTo !== undefined) 4019 self.config.appendTo.appendChild(self.calendarContainer); 4020 } 4021 if (self.config.static) { 4022 var wrapper = createElement("div", "flatpickr-wrapper"); 4023 if (self.element.parentNode) 4024 self.element.parentNode.insertBefore(wrapper, self.element); 4025 wrapper.appendChild(self.element); 4026 if (self.altInput) 4027 wrapper.appendChild(self.altInput); 4028 wrapper.appendChild(self.calendarContainer); 4029 } 4030 } 4031 if (!self.config.static && !self.config.inline) 4032 (self.config.appendTo !== undefined 4033 ? self.config.appendTo 4034 : window.document.body).appendChild(self.calendarContainer); 4035 } 4036 function createDay(className, date, _dayNumber, i) { 4037 var dateIsEnabled = isEnabled(date, true), dayElement = createElement("span", className, date.getDate().toString()); 4038 dayElement.dateObj = date; 4039 dayElement.$i = i; 4040 dayElement.setAttribute("aria-label", self.formatDate(date, self.config.ariaDateFormat)); 4041 if (className.indexOf("hidden") === -1 && 4042 compareDates(date, self.now) === 0) { 4043 self.todayDateElem = dayElement; 4044 dayElement.classList.add("today"); 4045 dayElement.setAttribute("aria-current", "date"); 4046 } 4047 if (dateIsEnabled) { 4048 dayElement.tabIndex = -1; 4049 if (isDateSelected(date)) { 4050 dayElement.classList.add("selected"); 4051 self.selectedDateElem = dayElement; 4052 if (self.config.mode === "range") { 4053 toggleClass(dayElement, "startRange", self.selectedDates[0] && 4054 compareDates(date, self.selectedDates[0], true) === 0); 4055 toggleClass(dayElement, "endRange", self.selectedDates[1] && 4056 compareDates(date, self.selectedDates[1], true) === 0); 4057 if (className === "nextMonthDay") 4058 dayElement.classList.add("inRange"); 4059 } 4060 } 4061 } 4062 else { 4063 dayElement.classList.add("flatpickr-disabled"); 4064 } 4065 if (self.config.mode === "range") { 4066 if (isDateInRange(date) && !isDateSelected(date)) 4067 dayElement.classList.add("inRange"); 4068 } 4069 if (self.weekNumbers && 4070 self.config.showMonths === 1 && 4071 className !== "prevMonthDay" && 4072 i % 7 === 6) { 4073 self.weekNumbers.insertAdjacentHTML("beforeend", "<span class='flatpickr-day'>" + self.config.getWeek(date) + "</span>"); 4074 } 4075 triggerEvent("onDayCreate", dayElement); 4076 return dayElement; 4077 } 4078 function focusOnDayElem(targetNode) { 4079 targetNode.focus(); 4080 if (self.config.mode === "range") 4081 onMouseOver(targetNode); 4082 } 4083 function getFirstAvailableDay(delta) { 4084 var startMonth = delta > 0 ? 0 : self.config.showMonths - 1; 4085 var endMonth = delta > 0 ? self.config.showMonths : -1; 4086 for (var m = startMonth; m != endMonth; m += delta) { 4087 var month = self.daysContainer.children[m]; 4088 var startIndex = delta > 0 ? 0 : month.children.length - 1; 4089 var endIndex = delta > 0 ? month.children.length : -1; 4090 for (var i = startIndex; i != endIndex; i += delta) { 4091 var c = month.children[i]; 4092 if (c.className.indexOf("hidden") === -1 && isEnabled(c.dateObj)) 4093 return c; 4094 } 4095 } 4096 return undefined; 4097 } 4098 function getNextAvailableDay(current, delta) { 4099 var givenMonth = current.className.indexOf("Month") === -1 4100 ? current.dateObj.getMonth() 4101 : self.currentMonth; 4102 var endMonth = delta > 0 ? self.config.showMonths : -1; 4103 var loopDelta = delta > 0 ? 1 : -1; 4104 for (var m = givenMonth - self.currentMonth; m != endMonth; m += loopDelta) { 4105 var month = self.daysContainer.children[m]; 4106 var startIndex = givenMonth - self.currentMonth === m 4107 ? current.$i + delta 4108 : delta < 0 4109 ? month.children.length - 1 4110 : 0; 4111 var numMonthDays = month.children.length; 4112 for (var i = startIndex; i >= 0 && i < numMonthDays && i != (delta > 0 ? numMonthDays : -1); i += loopDelta) { 4113 var c = month.children[i]; 4114 if (c.className.indexOf("hidden") === -1 && 4115 isEnabled(c.dateObj) && 4116 Math.abs(current.$i - i) >= Math.abs(delta)) 4117 return focusOnDayElem(c); 4118 } 4119 } 4120 self.changeMonth(loopDelta); 4121 focusOnDay(getFirstAvailableDay(loopDelta), 0); 4122 return undefined; 4123 } 4124 function focusOnDay(current, offset) { 4125 var activeElement = getClosestActiveElement(); 4126 var dayFocused = isInView(activeElement || document.body); 4127 var startElem = current !== undefined 4128 ? current 4129 : dayFocused 4130 ? activeElement 4131 : self.selectedDateElem !== undefined && isInView(self.selectedDateElem) 4132 ? self.selectedDateElem 4133 : self.todayDateElem !== undefined && isInView(self.todayDateElem) 4134 ? self.todayDateElem 4135 : getFirstAvailableDay(offset > 0 ? 1 : -1); 4136 if (startElem === undefined) { 4137 self._input.focus(); 4138 } 4139 else if (!dayFocused) { 4140 focusOnDayElem(startElem); 4141 } 4142 else { 4143 getNextAvailableDay(startElem, offset); 4144 } 4145 } 4146 function buildMonthDays(year, month) { 4147 var firstOfMonth = (new Date(year, month, 1).getDay() - self.l10n.firstDayOfWeek + 7) % 7; 4148 var prevMonthDays = self.utils.getDaysInMonth((month - 1 + 12) % 12, year); 4149 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"; 4150 var dayNumber = prevMonthDays + 1 - firstOfMonth, dayIndex = 0; 4151 for (; dayNumber <= prevMonthDays; dayNumber++, dayIndex++) { 4152 days.appendChild(createDay("flatpickr-day " + prevMonthDayClass, new Date(year, month - 1, dayNumber), dayNumber, dayIndex)); 4153 } 4154 for (dayNumber = 1; dayNumber <= daysInMonth; dayNumber++, dayIndex++) { 4155 days.appendChild(createDay("flatpickr-day", new Date(year, month, dayNumber), dayNumber, dayIndex)); 4156 } 4157 for (var dayNum = daysInMonth + 1; dayNum <= 42 - firstOfMonth && 4158 (self.config.showMonths === 1 || dayIndex % 7 !== 0); dayNum++, dayIndex++) { 4159 days.appendChild(createDay("flatpickr-day " + nextMonthDayClass, new Date(year, month + 1, dayNum % daysInMonth), dayNum, dayIndex)); 4160 } 4161 var dayContainer = createElement("div", "dayContainer"); 4162 dayContainer.appendChild(days); 4163 return dayContainer; 4164 } 4165 function buildDays() { 4166 if (self.daysContainer === undefined) { 4167 return; 4168 } 4169 clearNode(self.daysContainer); 4170 if (self.weekNumbers) 4171 clearNode(self.weekNumbers); 4172 var frag = document.createDocumentFragment(); 4173 for (var i = 0; i < self.config.showMonths; i++) { 4174 var d = new Date(self.currentYear, self.currentMonth, 1);
vendor: 7,528 bytes, lines 4175-4334
4175 d.setMonth(self.currentMonth + i); 4176 frag.appendChild(buildMonthDays(d.getFullYear(), d.getMonth())); 4177 } 4178 self.daysContainer.appendChild(frag); 4179 self.days = self.daysContainer.firstChild; 4180 if (self.config.mode === "range" && self.selectedDates.length === 1) { 4181 onMouseOver(); 4182 } 4183 } 4184 function buildMonthSwitch() { 4185 if (self.config.showMonths > 1 || 4186 self.config.monthSelectorType !== "dropdown") 4187 return; 4188 var shouldBuildMonth = function (month) { 4189 if (self.config.minDate !== undefined && 4190 self.currentYear === self.config.minDate.getFullYear() && 4191 month < self.config.minDate.getMonth()) { 4192 return false; 4193 } 4194 return !(self.config.maxDate !== undefined && 4195 self.currentYear === self.config.maxDate.getFullYear() && 4196 month > self.config.maxDate.getMonth()); 4197 }; 4198 self.monthsDropdownContainer.tabIndex = -1; 4199 self.monthsDropdownContainer.innerHTML = ""; 4200 for (var i = 0; i < 12; i++) { 4201 if (!shouldBuildMonth(i)) 4202 continue; 4203 var month = createElement("option", "flatpickr-monthDropdown-month"); 4204 month.value = new Date(self.currentYear, i).getMonth().toString(); 4205 month.textContent = monthToStr(i, self.config.shorthandCurrentMonth, self.l10n); 4206 month.tabIndex = -1; 4207 if (self.currentMonth === i) { 4208 month.selected = true; 4209 } 4210 self.monthsDropdownContainer.appendChild(month); 4211 } 4212 } 4213 function buildMonth() { 4214 var container = createElement("div", "flatpickr-month"); 4215 var monthNavFragment = window.document.createDocumentFragment(); 4216 var monthElement; 4217 if (self.config.showMonths > 1 || 4218 self.config.monthSelectorType === "static") { 4219 monthElement = createElement("span", "cur-month"); 4220 } 4221 else { 4222 self.monthsDropdownContainer = createElement("select", "flatpickr-monthDropdown-months"); 4223 self.monthsDropdownContainer.setAttribute("aria-label", self.l10n.monthAriaLabel); 4224 bind(self.monthsDropdownContainer, "change", function (e) { 4225 var target = getEventTarget(e); 4226 var selectedMonth = parseInt(target.value, 10); 4227 self.changeMonth(selectedMonth - self.currentMonth); 4228 triggerEvent("onMonthChange"); 4229 }); 4230 buildMonthSwitch(); 4231 monthElement = self.monthsDropdownContainer; 4232 } 4233 var yearInput = createNumberInput("cur-year", { tabindex: "-1" }); 4234 var yearElement = yearInput.getElementsByTagName("input")[0]; 4235 yearElement.setAttribute("aria-label", self.l10n.yearAriaLabel); 4236 if (self.config.minDate) { 4237 yearElement.setAttribute("min", self.config.minDate.getFullYear().toString()); 4238 } 4239 if (self.config.maxDate) { 4240 yearElement.setAttribute("max", self.config.maxDate.getFullYear().toString()); 4241 yearElement.disabled = 4242 !!self.config.minDate && 4243 self.config.minDate.getFullYear() === self.config.maxDate.getFullYear(); 4244 } 4245 var currentMonth = createElement("div", "flatpickr-current-month"); 4246 currentMonth.appendChild(monthElement); 4247 currentMonth.appendChild(yearInput); 4248 monthNavFragment.appendChild(currentMonth); 4249 container.appendChild(monthNavFragment); 4250 return { 4251 container: container, 4252 yearElement: yearElement, 4253 monthElement: monthElement, 4254 }; 4255 } 4256 function buildMonths() { 4257 clearNode(self.monthNav); 4258 self.monthNav.appendChild(self.prevMonthNav); 4259 if (self.config.showMonths) { 4260 self.yearElements = []; 4261 self.monthElements = []; 4262 } 4263 for (var m = self.config.showMonths; m--;) { 4264 var month = buildMonth(); 4265 self.yearElements.push(month.yearElement); 4266 self.monthElements.push(month.monthElement); 4267 self.monthNav.appendChild(month.container); 4268 } 4269 self.monthNav.appendChild(self.nextMonthNav); 4270 } 4271 function buildMonthNav() { 4272 self.monthNav = createElement("div", "flatpickr-months"); 4273 self.yearElements = []; 4274 self.monthElements = []; 4275 self.prevMonthNav = createElement("span", "flatpickr-prev-month"); 4276 self.prevMonthNav.innerHTML = self.config.prevArrow; 4277 self.nextMonthNav = createElement("span", "flatpickr-next-month"); 4278 self.nextMonthNav.innerHTML = self.config.nextArrow; 4279 buildMonths(); 4280 Object.defineProperty(self, "_hidePrevMonthArrow", { 4281 get: function () { return self.__hidePrevMonthArrow; }, 4282 set: function (bool) { 4283 if (self.__hidePrevMonthArrow !== bool) { 4284 toggleClass(self.prevMonthNav, "flatpickr-disabled", bool); 4285 self.__hidePrevMonthArrow = bool; 4286 } 4287 }, 4288 }); 4289 Object.defineProperty(self, "_hideNextMonthArrow", { 4290 get: function () { return self.__hideNextMonthArrow; }, 4291 set: function (bool) { 4292 if (self.__hideNextMonthArrow !== bool) { 4293 toggleClass(self.nextMonthNav, "flatpickr-disabled", bool); 4294 self.__hideNextMonthArrow = bool; 4295 } 4296 }, 4297 }); 4298 self.currentYearElement = self.yearElements[0]; 4299 updateNavigationCurrentMonth(); 4300 return self.monthNav; 4301 } 4302 function buildTime() { 4303 self.calendarContainer.classList.add("hasTime"); 4304 if (self.config.noCalendar) 4305 self.calendarContainer.classList.add("noCalendar"); 4306 var defaults = getDefaultHours(self.config); 4307 self.timeContainer = createElement("div", "flatpickr-time"); 4308 self.timeContainer.tabIndex = -1; 4309 var separator = createElement("span", "flatpickr-time-separator", ":"); 4310 var hourInput = createNumberInput("flatpickr-hour", { 4311 "aria-label": self.l10n.hourAriaLabel, 4312 }); 4313 self.hourElement = hourInput.getElementsByTagName("input")[0]; 4314 var minuteInput = createNumberInput("flatpickr-minute", { 4315 "aria-label": self.l10n.minuteAriaLabel, 4316 }); 4317 self.minuteElement = minuteInput.getElementsByTagName("input")[0]; 4318 self.hourElement.tabIndex = self.minuteElement.tabIndex = -1; 4319 self.hourElement.value = pad(self.latestSelectedDateObj 4320 ? self.latestSelectedDateObj.getHours() 4321 : self.config.time_24hr 4322 ? defaults.hours 4323 : military2ampm(defaults.hours)); 4324 self.minuteElement.value = pad(self.latestSelectedDateObj 4325 ? self.latestSelectedDateObj.getMinutes() 4326 : defaults.minutes); 4327 self.hourElement.setAttribute("step", self.config.hourIncrement.toString()); 4328 self.minuteElement.setAttribute("step", self.config.minuteIncrement.toString()); 4329 self.hourElement.setAttribute("min", self.config.time_24hr ? "0" : "1"); 4330 self.hourElement.setAttribute("max", self.config.time_24hr ? "23" : "12"); 4331 self.hourElement.setAttribute("maxlength", "2"); 4332 self.minuteElement.setAttribute("min", "0"); 4333 self.minuteElement.setAttribute("max", "59"); 4334 self.minuteElement.setAttribute("maxlength", "2");
vendor: 4,930 bytes, lines 4335-4440
4335 self.timeContainer.appendChild(hourInput); 4336 self.timeContainer.appendChild(separator); 4337 self.timeContainer.appendChild(minuteInput); 4338 if (self.config.time_24hr) 4339 self.timeContainer.classList.add("time24hr"); 4340 if (self.config.enableSeconds) { 4341 self.timeContainer.classList.add("hasSeconds"); 4342 var secondInput = createNumberInput("flatpickr-second"); 4343 self.secondElement = secondInput.getElementsByTagName("input")[0]; 4344 self.secondElement.value = pad(self.latestSelectedDateObj 4345 ? self.latestSelectedDateObj.getSeconds() 4346 : defaults.seconds); 4347 self.secondElement.setAttribute("step", self.minuteElement.getAttribute("step")); 4348 self.secondElement.setAttribute("min", "0"); 4349 self.secondElement.setAttribute("max", "59"); 4350 self.secondElement.setAttribute("maxlength", "2"); 4351 self.timeContainer.appendChild(createElement("span", "flatpickr-time-separator", ":")); 4352 self.timeContainer.appendChild(secondInput); 4353 } 4354 if (!self.config.time_24hr) { 4355 self.amPM = createElement("span", "flatpickr-am-pm", self.l10n.amPM[utils_int((self.latestSelectedDateObj 4356 ? self.hourElement.value 4357 : self.config.defaultHour) > 11)]); 4358 self.amPM.title = self.l10n.toggleTitle; 4359 self.amPM.tabIndex = -1; 4360 self.timeContainer.appendChild(self.amPM); 4361 } 4362 return self.timeContainer; 4363 } 4364 function buildWeekdays() { 4365 if (!self.weekdayContainer) 4366 self.weekdayContainer = createElement("div", "flatpickr-weekdays"); 4367 else 4368 clearNode(self.weekdayContainer); 4369 for (var i = self.config.showMonths; i--;) { 4370 var container = createElement("div", "flatpickr-weekdaycontainer"); 4371 self.weekdayContainer.appendChild(container); 4372 } 4373 updateWeekdays(); 4374 return self.weekdayContainer; 4375 } 4376 function updateWeekdays() { 4377 if (!self.weekdayContainer) { 4378 return; 4379 } 4380 var firstDayOfWeek = self.l10n.firstDayOfWeek; 4381 var weekdays = __spreadArrays(self.l10n.weekdays.shorthand); 4382 if (firstDayOfWeek > 0 && firstDayOfWeek < weekdays.length) { 4383 weekdays = __spreadArrays(weekdays.splice(firstDayOfWeek, weekdays.length), weekdays.splice(0, firstDayOfWeek)); 4384 } 4385 for (var i = self.config.showMonths; i--;) { 4386 self.weekdayContainer.children[i].innerHTML = "\n <span class='flatpickr-weekday'>\n " + weekdays.join("</span><span class='flatpickr-weekday'>") + "\n </span>\n "; 4387 } 4388 } 4389 function buildWeeks() { 4390 self.calendarContainer.classList.add("hasWeeks"); 4391 var weekWrapper = createElement("div", "flatpickr-weekwrapper"); 4392 weekWrapper.appendChild(createElement("span", "flatpickr-weekday", self.l10n.weekAbbreviation)); 4393 var weekNumbers = createElement("div", "flatpickr-weeks"); 4394 weekWrapper.appendChild(weekNumbers); 4395 return { 4396 weekWrapper: weekWrapper, 4397 weekNumbers: weekNumbers, 4398 }; 4399 } 4400 function changeMonth(value, isOffset) { 4401 if (isOffset === void 0) { isOffset = true; } 4402 var delta = isOffset ? value : value - self.currentMonth; 4403 if ((delta < 0 && self._hidePrevMonthArrow === true) || 4404 (delta > 0 && self._hideNextMonthArrow === true)) 4405 return; 4406 self.currentMonth += delta; 4407 if (self.currentMonth < 0 || self.currentMonth > 11) { 4408 self.currentYear += self.currentMonth > 11 ? 1 : -1; 4409 self.currentMonth = (self.currentMonth + 12) % 12; 4410 triggerEvent("onYearChange"); 4411 buildMonthSwitch(); 4412 } 4413 buildDays(); 4414 triggerEvent("onMonthChange"); 4415 updateNavigationCurrentMonth(); 4416 } 4417 function clear(triggerChangeEvent, toInitial) { 4418 if (triggerChangeEvent === void 0) { triggerChangeEvent = true; } 4419 if (toInitial === void 0) { toInitial = true; } 4420 self.input.value = ""; 4421 if (self.altInput !== undefined) 4422 self.altInput.value = ""; 4423 if (self.mobileInput !== undefined) 4424 self.mobileInput.value = ""; 4425 self.selectedDates = []; 4426 self.latestSelectedDateObj = undefined; 4427 if (toInitial === true) { 4428 self.currentYear = self._initialDate.getFullYear(); 4429 self.currentMonth = self._initialDate.getMonth(); 4430 } 4431 if (self.config.enableTime === true) { 4432 var _a = getDefaultHours(self.config), hours = _a.hours, minutes = _a.minutes, seconds = _a.seconds; 4433 setHours(hours, minutes, seconds); 4434 } 4435 self.redraw(); 4436 if (triggerChangeEvent) 4437 triggerEvent("onChange"); 4438 } 4439 function close() { 4440 self.isOpen = false;
vendor: 6,159 bytes, lines 4441-4595
4441 if (!self.isMobile) { 4442 if (self.calendarContainer !== undefined) { 4443 self.calendarContainer.classList.remove("open"); 4444 } 4445 if (self._input !== undefined) { 4446 self._input.classList.remove("active"); 4447 } 4448 } 4449 triggerEvent("onClose"); 4450 } 4451 function destroy() { 4452 if (self.config !== undefined) 4453 triggerEvent("onDestroy"); 4454 for (var i = self._handlers.length; i--;) { 4455 self._handlers[i].remove(); 4456 } 4457 self._handlers = []; 4458 if (self.mobileInput) { 4459 if (self.mobileInput.parentNode) 4460 self.mobileInput.parentNode.removeChild(self.mobileInput); 4461 self.mobileInput = undefined; 4462 } 4463 else if (self.calendarContainer && self.calendarContainer.parentNode) { 4464 if (self.config.static && self.calendarContainer.parentNode) { 4465 var wrapper = self.calendarContainer.parentNode; 4466 wrapper.lastChild && wrapper.removeChild(wrapper.lastChild); 4467 if (wrapper.parentNode) { 4468 while (wrapper.firstChild) 4469 wrapper.parentNode.insertBefore(wrapper.firstChild, wrapper); 4470 wrapper.parentNode.removeChild(wrapper); 4471 } 4472 } 4473 else 4474 self.calendarContainer.parentNode.removeChild(self.calendarContainer); 4475 } 4476 if (self.altInput) { 4477 self.input.type = "text"; 4478 if (self.altInput.parentNode) 4479 self.altInput.parentNode.removeChild(self.altInput); 4480 delete self.altInput; 4481 } 4482 if (self.input) { 4483 self.input.type = self.input._type; 4484 self.input.classList.remove("flatpickr-input"); 4485 self.input.removeAttribute("readonly"); 4486 } 4487 [ 4488 "_showTimeInput", 4489 "latestSelectedDateObj", 4490 "_hideNextMonthArrow", 4491 "_hidePrevMonthArrow", 4492 "__hideNextMonthArrow", 4493 "__hidePrevMonthArrow", 4494 "isMobile", 4495 "isOpen", 4496 "selectedDateElem", 4497 "minDateHasTime", 4498 "maxDateHasTime", 4499 "days", 4500 "daysContainer", 4501 "_input", 4502 "_positionElement", 4503 "innerContainer", 4504 "rContainer", 4505 "monthNav", 4506 "todayDateElem", 4507 "calendarContainer", 4508 "weekdayContainer", 4509 "prevMonthNav", 4510 "nextMonthNav", 4511 "monthsDropdownContainer", 4512 "currentMonthElement", 4513 "currentYearElement", 4514 "navigationCurrentMonth", 4515 "selectedDateElem", 4516 "config", 4517 ].forEach(function (k) { 4518 try { 4519 delete self[k]; 4520 } 4521 catch (_) { } 4522 }); 4523 } 4524 function isCalendarElem(elem) { 4525 return self.calendarContainer.contains(elem); 4526 } 4527 function documentClick(e) { 4528 if (self.isOpen && !self.config.inline) { 4529 var eventTarget_1 = getEventTarget(e); 4530 var isCalendarElement = isCalendarElem(eventTarget_1); 4531 var isInput = eventTarget_1 === self.input || 4532 eventTarget_1 === self.altInput || 4533 self.element.contains(eventTarget_1) || 4534 (e.path && 4535 e.path.indexOf && 4536 (~e.path.indexOf(self.input) || 4537 ~e.path.indexOf(self.altInput))); 4538 var lostFocus = !isInput && 4539 !isCalendarElement && 4540 !isCalendarElem(e.relatedTarget); 4541 var isIgnored = !self.config.ignoredFocusElements.some(function (elem) { 4542 return elem.contains(eventTarget_1); 4543 }); 4544 if (lostFocus && isIgnored) { 4545 if (self.config.allowInput) { 4546 self.setDate(self._input.value, false, self.config.altInput 4547 ? self.config.altFormat 4548 : self.config.dateFormat); 4549 } 4550 if (self.timeContainer !== undefined && 4551 self.minuteElement !== undefined && 4552 self.hourElement !== undefined && 4553 self.input.value !== "" && 4554 self.input.value !== undefined) { 4555 updateTime(); 4556 } 4557 self.close(); 4558 if (self.config && 4559 self.config.mode === "range" && 4560 self.selectedDates.length === 1) 4561 self.clear(false); 4562 } 4563 } 4564 } 4565 function changeYear(newYear) { 4566 if (!newYear || 4567 (self.config.minDate && newYear < self.config.minDate.getFullYear()) || 4568 (self.config.maxDate && newYear > self.config.maxDate.getFullYear())) 4569 return; 4570 var newYearNum = newYear, isNewYear = self.currentYear !== newYearNum; 4571 self.currentYear = newYearNum || self.currentYear; 4572 if (self.config.maxDate && 4573 self.currentYear === self.config.maxDate.getFullYear()) { 4574 self.currentMonth = Math.min(self.config.maxDate.getMonth(), self.currentMonth); 4575 } 4576 else if (self.config.minDate && 4577 self.currentYear === self.config.minDate.getFullYear()) { 4578 self.currentMonth = Math.max(self.config.minDate.getMonth(), self.currentMonth); 4579 } 4580 if (isNewYear) { 4581 self.redraw(); 4582 triggerEvent("onYearChange"); 4583 buildMonthSwitch(); 4584 } 4585 } 4586 function isEnabled(date, timeless) { 4587 var _a; 4588 if (timeless === void 0) { timeless = true; } 4589 var dateToCheck = self.parseDate(date, undefined, timeless); 4590 if ((self.config.minDate && 4591 dateToCheck && 4592 compareDates(dateToCheck, self.config.minDate, timeless !== undefined ? timeless : !self.minDateHasTime) < 0) || 4593 (self.config.maxDate && 4594 dateToCheck && 4595 compareDates(dateToCheck, self.config.maxDate, timeless !== undefined ? timeless : !self.maxDateHasTime) >
vendor: 7,428 bytes, lines 4595-4772
4595 0)) 4596 return false; 4597 if (!self.config.enable && self.config.disable.length === 0) 4598 return true; 4599 if (dateToCheck === undefined) 4600 return false; 4601 var bool = !!self.config.enable, array = (_a = self.config.enable) !== null && _a !== void 0 ? _a : self.config.disable; 4602 for (var i = 0, d = void 0; i < array.length; i++) { 4603 d = array[i]; 4604 if (typeof d === "function" && 4605 d(dateToCheck)) 4606 return bool; 4607 else if (d instanceof Date && 4608 dateToCheck !== undefined && 4609 d.getTime() === dateToCheck.getTime()) 4610 return bool; 4611 else if (typeof d === "string") { 4612 var parsed = self.parseDate(d, undefined, true); 4613 return parsed && parsed.getTime() === dateToCheck.getTime() 4614 ? bool 4615 : !bool; 4616 } 4617 else if (typeof d === "object" && 4618 dateToCheck !== undefined && 4619 d.from && 4620 d.to && 4621 dateToCheck.getTime() >= d.from.getTime() && 4622 dateToCheck.getTime() <= d.to.getTime()) 4623 return bool; 4624 } 4625 return !bool; 4626 } 4627 function isInView(elem) { 4628 if (self.daysContainer !== undefined) 4629 return (elem.className.indexOf("hidden") === -1 && 4630 elem.className.indexOf("flatpickr-disabled") === -1 && 4631 self.daysContainer.contains(elem)); 4632 return false; 4633 } 4634 function onBlur(e) { 4635 var isInput = e.target === self._input; 4636 var valueChanged = self._input.value.trimEnd() !== getDateStr(); 4637 if (isInput && 4638 valueChanged && 4639 !(e.relatedTarget && isCalendarElem(e.relatedTarget))) { 4640 self.setDate(self._input.value, true, e.target === self.altInput 4641 ? self.config.altFormat 4642 : self.config.dateFormat); 4643 } 4644 } 4645 function onKeyDown(e) { 4646 var eventTarget = getEventTarget(e); 4647 var isInput = self.config.wrap 4648 ? element.contains(eventTarget) 4649 : eventTarget === self._input; 4650 var allowInput = self.config.allowInput; 4651 var allowKeydown = self.isOpen && (!allowInput || !isInput); 4652 var allowInlineKeydown = self.config.inline && isInput && !allowInput; 4653 if (e.keyCode === 13 && isInput) { 4654 if (allowInput) { 4655 self.setDate(self._input.value, true, eventTarget === self.altInput 4656 ? self.config.altFormat 4657 : self.config.dateFormat); 4658 self.close(); 4659 return eventTarget.blur(); 4660 } 4661 else { 4662 self.open(); 4663 } 4664 } 4665 else if (isCalendarElem(eventTarget) || 4666 allowKeydown || 4667 allowInlineKeydown) { 4668 var isTimeObj = !!self.timeContainer && 4669 self.timeContainer.contains(eventTarget); 4670 switch (e.keyCode) { 4671 case 13: 4672 if (isTimeObj) { 4673 e.preventDefault(); 4674 updateTime(); 4675 focusAndClose(); 4676 } 4677 else 4678 selectDate(e); 4679 break; 4680 case 27: 4681 e.preventDefault(); 4682 focusAndClose(); 4683 break; 4684 case 8: 4685 case 46: 4686 if (isInput && !self.config.allowInput) { 4687 e.preventDefault(); 4688 self.clear(); 4689 } 4690 break; 4691 case 37: 4692 case 39: 4693 if (!isTimeObj && !isInput) { 4694 e.preventDefault(); 4695 var activeElement = getClosestActiveElement(); 4696 if (self.daysContainer !== undefined && 4697 (allowInput === false || 4698 (activeElement && isInView(activeElement)))) { 4699 var delta_1 = e.keyCode === 39 ? 1 : -1; 4700 if (!e.ctrlKey) 4701 focusOnDay(undefined, delta_1); 4702 else { 4703 e.stopPropagation(); 4704 changeMonth(delta_1); 4705 focusOnDay(getFirstAvailableDay(1), 0); 4706 } 4707 } 4708 } 4709 else if (self.hourElement) 4710 self.hourElement.focus(); 4711 break; 4712 case 38: 4713 case 40: 4714 e.preventDefault(); 4715 var delta = e.keyCode === 40 ? 1 : -1; 4716 if ((self.daysContainer && 4717 eventTarget.$i !== undefined) || 4718 eventTarget === self.input || 4719 eventTarget === self.altInput) { 4720 if (e.ctrlKey) { 4721 e.stopPropagation(); 4722 changeYear(self.currentYear - delta); 4723 focusOnDay(getFirstAvailableDay(1), 0); 4724 } 4725 else if (!isTimeObj) 4726 focusOnDay(undefined, delta * 7); 4727 } 4728 else if (eventTarget === self.currentYearElement) { 4729 changeYear(self.currentYear - delta); 4730 } 4731 else if (self.config.enableTime) { 4732 if (!isTimeObj && self.hourElement) 4733 self.hourElement.focus(); 4734 updateTime(e); 4735 self._debouncedChange(); 4736 } 4737 break; 4738 case 9: 4739 if (isTimeObj) { 4740 var elems = [ 4741 self.hourElement, 4742 self.minuteElement, 4743 self.secondElement, 4744 self.amPM, 4745 ] 4746 .concat(self.pluginElements) 4747 .filter(function (x) { return x; }); 4748 var i = elems.indexOf(eventTarget); 4749 if (i !== -1) { 4750 var target = elems[i + (e.shiftKey ? -1 : 1)]; 4751 e.preventDefault(); 4752 (target || self._input).focus(); 4753 } 4754 } 4755 else if (!self.config.noCalendar && 4756 self.daysContainer && 4757 self.daysContainer.contains(eventTarget) && 4758 e.shiftKey) { 4759 e.preventDefault(); 4760 self._input.focus(); 4761 } 4762 break; 4763 default: 4764 break; 4765 } 4766 } 4767 if (self.amPM !== undefined && eventTarget === self.amPM) { 4768 switch (e.key) { 4769 case self.l10n.amPM[0].charAt(0): 4770 case self.l10n.amPM[0].charAt(0).toLowerCase(): 4771 self.amPM.textContent = self.l10n.amPM[0]; 4772 setHoursFromInputs();
vendor: 13,974 bytes, lines 4773-5065
4773 updateValue(); 4774 break; 4775 case self.l10n.amPM[1].charAt(0): 4776 case self.l10n.amPM[1].charAt(0).toLowerCase(): 4777 self.amPM.textContent = self.l10n.amPM[1]; 4778 setHoursFromInputs(); 4779 updateValue(); 4780 break; 4781 } 4782 } 4783 if (isInput || isCalendarElem(eventTarget)) { 4784 triggerEvent("onKeyDown", e); 4785 } 4786 } 4787 function onMouseOver(elem, cellClass) { 4788 if (cellClass === void 0) { cellClass = "flatpickr-day"; } 4789 if (self.selectedDates.length !== 1 || 4790 (elem && 4791 (!elem.classList.contains(cellClass) || 4792 elem.classList.contains("flatpickr-disabled")))) 4793 return; 4794 var hoverDate = elem 4795 ? elem.dateObj.getTime() 4796 : 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()); 4797 var containsDisabled = false; 4798 var minRange = 0, maxRange = 0; 4799 for (var t = rangeStartDate; t < rangeEndDate; t += duration.DAY) { 4800 if (!isEnabled(new Date(t), true)) { 4801 containsDisabled = 4802 containsDisabled || (t > rangeStartDate && t < rangeEndDate); 4803 if (t < initialDate && (!minRange || t > minRange)) 4804 minRange = t; 4805 else if (t > initialDate && (!maxRange || t < maxRange)) 4806 maxRange = t; 4807 } 4808 } 4809 var hoverableCells = Array.from(self.rContainer.querySelectorAll("*:nth-child(-n+" + self.config.showMonths + ") > ." + cellClass)); 4810 hoverableCells.forEach(function (dayElem) { 4811 var date = dayElem.dateObj; 4812 var timestamp = date.getTime(); 4813 var outOfRange = (minRange > 0 && timestamp < minRange) || 4814 (maxRange > 0 && timestamp > maxRange); 4815 if (outOfRange) { 4816 dayElem.classList.add("notAllowed"); 4817 ["inRange", "startRange", "endRange"].forEach(function (c) { 4818 dayElem.classList.remove(c); 4819 }); 4820 return; 4821 } 4822 else if (containsDisabled && !outOfRange) 4823 return; 4824 ["startRange", "inRange", "endRange", "notAllowed"].forEach(function (c) { 4825 dayElem.classList.remove(c); 4826 }); 4827 if (elem !== undefined) { 4828 elem.classList.add(hoverDate <= self.selectedDates[0].getTime() 4829 ? "startRange" 4830 : "endRange"); 4831 if (initialDate < hoverDate && timestamp === initialDate) 4832 dayElem.classList.add("startRange"); 4833 else if (initialDate > hoverDate && timestamp === initialDate) 4834 dayElem.classList.add("endRange"); 4835 if (timestamp >= minRange && 4836 (maxRange === 0 || timestamp <= maxRange) && 4837 isBetween(timestamp, initialDate, hoverDate)) 4838 dayElem.classList.add("inRange"); 4839 } 4840 }); 4841 } 4842 function onResize() { 4843 if (self.isOpen && !self.config.static && !self.config.inline) 4844 positionCalendar(); 4845 } 4846 function open(e, positionElement) { 4847 if (positionElement === void 0) { positionElement = self._positionElement; } 4848 if (self.isMobile === true) { 4849 if (e) { 4850 e.preventDefault(); 4851 var eventTarget = getEventTarget(e); 4852 if (eventTarget) { 4853 eventTarget.blur(); 4854 } 4855 } 4856 if (self.mobileInput !== undefined) { 4857 self.mobileInput.focus(); 4858 self.mobileInput.click(); 4859 } 4860 triggerEvent("onOpen"); 4861 return; 4862 } 4863 else if (self._input.disabled || self.config.inline) { 4864 return; 4865 } 4866 var wasOpen = self.isOpen; 4867 self.isOpen = true; 4868 if (!wasOpen) { 4869 self.calendarContainer.classList.add("open"); 4870 self._input.classList.add("active"); 4871 triggerEvent("onOpen"); 4872 positionCalendar(positionElement); 4873 } 4874 if (self.config.enableTime === true && self.config.noCalendar === true) { 4875 if (self.config.allowInput === false && 4876 (e === undefined || 4877 !self.timeContainer.contains(e.relatedTarget))) { 4878 setTimeout(function () { return self.hourElement.select(); }, 50); 4879 } 4880 } 4881 } 4882 function minMaxDateSetter(type) { 4883 return function (date) { 4884 var dateObj = (self.config["_" + type + "Date"] = self.parseDate(date, self.config.dateFormat)); 4885 var inverseDateObj = self.config["_" + (type === "min" ? "max" : "min") + "Date"]; 4886 if (dateObj !== undefined) { 4887 self[type === "min" ? "minDateHasTime" : "maxDateHasTime"] = 4888 dateObj.getHours() > 0 || 4889 dateObj.getMinutes() > 0 || 4890 dateObj.getSeconds() > 0; 4891 } 4892 if (self.selectedDates) { 4893 self.selectedDates = self.selectedDates.filter(function (d) { return isEnabled(d); }); 4894 if (!self.selectedDates.length && type === "min") 4895 setHoursFromDate(dateObj); 4896 updateValue(); 4897 } 4898 if (self.daysContainer) { 4899 redraw(); 4900 if (dateObj !== undefined) 4901 self.currentYearElement[type] = dateObj.getFullYear().toString(); 4902 else 4903 self.currentYearElement.removeAttribute(type); 4904 self.currentYearElement.disabled = 4905 !!inverseDateObj && 4906 dateObj !== undefined && 4907 inverseDateObj.getFullYear() === dateObj.getFullYear(); 4908 } 4909 }; 4910 } 4911 function parseConfig() { 4912 var boolOpts = [ 4913 "wrap", 4914 "weekNumbers", 4915 "allowInput", 4916 "allowInvalidPreload", 4917 "clickOpens", 4918 "time_24hr", 4919 "enableTime", 4920 "noCalendar", 4921 "altInput", 4922 "shorthandCurrentMonth", 4923 "inline", 4924 "static", 4925 "enableSeconds", 4926 "disableMobile", 4927 ]; 4928 var userConfig = __assign(__assign({}, JSON.parse(JSON.stringify(element.dataset || {}))), instanceConfig); 4929 var formats = {}; 4930 self.config.parseDate = userConfig.parseDate; 4931 self.config.formatDate = userConfig.formatDate; 4932 Object.defineProperty(self.config, "enable", { 4933 get: function () { return self.config._enable; }, 4934 set: function (dates) { 4935 self.config._enable = parseDateRules(dates); 4936 }, 4937 }); 4938 Object.defineProperty(self.config, "disable", { 4939 get: function () { return self.config._disable; }, 4940 set: function (dates) { 4941 self.config._disable = parseDateRules(dates); 4942 }, 4943 }); 4944 var timeMode = userConfig.mode === "time"; 4945 if (!userConfig.dateFormat && (userConfig.enableTime || timeMode)) { 4946 var defaultDateFormat = flatpickr.defaultConfig.dateFormat || defaults.dateFormat; 4947 formats.dateFormat = 4948 userConfig.noCalendar || timeMode 4949 ? "H:i" + (userConfig.enableSeconds ? ":S" : "") 4950 : defaultDateFormat + " H:i" + (userConfig.enableSeconds ? ":S" : ""); 4951 } 4952 if (userConfig.altInput && 4953 (userConfig.enableTime || timeMode) && 4954 !userConfig.altFormat) { 4955 var defaultAltFormat = flatpickr.defaultConfig.altFormat || defaults.altFormat; 4956 formats.altFormat = 4957 userConfig.noCalendar || timeMode 4958 ? "h:i" + (userConfig.enableSeconds ? ":S K" : " K") 4959 : defaultAltFormat + (" h:i" + (userConfig.enableSeconds ? ":S" : "") + " K"); 4960 } 4961 Object.defineProperty(self.config, "minDate", { 4962 get: function () { return self.config._minDate; }, 4963 set: minMaxDateSetter("min"), 4964 }); 4965 Object.defineProperty(self.config, "maxDate", { 4966 get: function () { return self.config._maxDate; }, 4967 set: minMaxDateSetter("max"), 4968 }); 4969 var minMaxTimeSetter = function (type) { return function (val) { 4970 self.config[type === "min" ? "_minTime" : "_maxTime"] = self.parseDate(val, "H:i:S"); 4971 }; }; 4972 Object.defineProperty(self.config, "minTime", { 4973 get: function () { return self.config._minTime; }, 4974 set: minMaxTimeSetter("min"), 4975 }); 4976 Object.defineProperty(self.config, "maxTime", { 4977 get: function () { return self.config._maxTime; }, 4978 set: minMaxTimeSetter("max"), 4979 }); 4980 if (userConfig.mode === "time") { 4981 self.config.noCalendar = true; 4982 self.config.enableTime = true; 4983 } 4984 Object.assign(self.config, formats, userConfig); 4985 for (var i = 0; i < boolOpts.length; i++) 4986 self.config[boolOpts[i]] = 4987 self.config[boolOpts[i]] === true || 4988 self.config[boolOpts[i]] === "true"; 4989 HOOKS.filter(function (hook) { return self.config[hook] !== undefined; }).forEach(function (hook) { 4990 self.config[hook] = arrayify(self.config[hook] || []).map(bindToInstance); 4991 }); 4992 self.isMobile = 4993 !self.config.disableMobile && 4994 !self.config.inline && 4995 self.config.mode === "single" && 4996 !self.config.disable.length && 4997 !self.config.enable && 4998 !self.config.weekNumbers && 4999 /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); 5000 for (var i = 0; i < self.config.plugins.length; i++) { 5001 var pluginConf = self.config.plugins[i](self) || {}; 5002 for (var key in pluginConf) { 5003 if (HOOKS.indexOf(key) > -1) { 5004 self.config[key] = arrayify(pluginConf[key]) 5005 .map(bindToInstance) 5006 .concat(self.config[key]); 5007 } 5008 else if (typeof userConfig[key] === "undefined") 5009 self.config[key] = pluginConf[key]; 5010 } 5011 } 5012 if (!userConfig.altInputClass) { 5013 self.config.altInputClass = 5014 getInputElem().className + " " + self.config.altInputClass; 5015 } 5016 triggerEvent("onParseConfig"); 5017 } 5018 function getInputElem() { 5019 return self.config.wrap 5020 ? element.querySelector("[data-input]") 5021 : element; 5022 } 5023 function setupLocale() { 5024 if (typeof self.config.locale !== "object" && 5025 typeof flatpickr.l10ns[self.config.locale] === "undefined") 5026 self.config.errorHandler(new Error("flatpickr: invalid locale " + self.config.locale)); 5027 self.l10n = __assign(__assign({}, flatpickr.l10ns.default), (typeof self.config.locale === "object" 5028 ? self.config.locale 5029 : self.config.locale !== "default" 5030 ? flatpickr.l10ns[self.config.locale] 5031 : undefined)); 5032 tokenRegex.D = "(" + self.l10n.weekdays.shorthand.join("|") + ")"; 5033 tokenRegex.l = "(" + self.l10n.weekdays.longhand.join("|") + ")"; 5034 tokenRegex.M = "(" + self.l10n.months.shorthand.join("|") + ")"; 5035 tokenRegex.F = "(" + self.l10n.months.longhand.join("|") + ")"; 5036 tokenRegex.K = "(" + self.l10n.amPM[0] + "|" + self.l10n.amPM[1] + "|" + self.l10n.amPM[0].toLowerCase() + "|" + self.l10n.amPM[1].toLowerCase() + ")"; 5037 var userConfig = __assign(__assign({}, instanceConfig), JSON.parse(JSON.stringify(element.dataset || {}))); 5038 if (userConfig.time_24hr === undefined && 5039 flatpickr.defaultConfig.time_24hr === undefined) { 5040 self.config.time_24hr = self.l10n.time_24hr; 5041 } 5042 self.formatDate = createDateFormatter(self); 5043 self.parseDate = createDateParser({ config: self.config, l10n: self.l10n }); 5044 } 5045 function positionCalendar(customPositionElement) { 5046 if (typeof self.config.position === "function") { 5047 return void self.config.position(self, customPositionElement); 5048 } 5049 if (self.calendarContainer === undefined) 5050 return; 5051 triggerEvent("onPreCalendarPosition"); 5052 var positionElement = customPositionElement || self._positionElement; 5053 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" || 5054 (configPosVertical !== "below" && 5055 distanceFromBottom < calendarHeight && 5056 inputBounds.top > calendarHeight); 5057 var top = window.pageYOffset + 5058 inputBounds.top + 5059 (!showOnTop ? positionElement.offsetHeight + 2 : -calendarHeight - 2); 5060 toggleClass(self.calendarContainer, "arrowTop", !showOnTop); 5061 toggleClass(self.calendarContainer, "arrowBottom", showOnTop); 5062 if (self.config.inline) 5063 return; 5064 var left = window.pageXOffset + inputBounds.left; 5065 var isCenter = false;
vendor: 5,549 bytes, lines 5066-5199
5066 var isRight = false; 5067 if (configPosHorizontal === "center") { 5068 left -= (calendarWidth - inputBounds.width) / 2; 5069 isCenter = true; 5070 } 5071 else if (configPosHorizontal === "right") { 5072 left -= calendarWidth - inputBounds.width; 5073 isRight = true; 5074 } 5075 toggleClass(self.calendarContainer, "arrowLeft", !isCenter && !isRight); 5076 toggleClass(self.calendarContainer, "arrowCenter", isCenter); 5077 toggleClass(self.calendarContainer, "arrowRight", isRight); 5078 var right = window.document.body.offsetWidth - 5079 (window.pageXOffset + inputBounds.right); 5080 var rightMost = left + calendarWidth > window.document.body.offsetWidth; 5081 var centerMost = right + calendarWidth > window.document.body.offsetWidth; 5082 toggleClass(self.calendarContainer, "rightMost", rightMost); 5083 if (self.config.static) 5084 return; 5085 self.calendarContainer.style.top = top + "px"; 5086 if (!rightMost) { 5087 self.calendarContainer.style.left = left + "px"; 5088 self.calendarContainer.style.right = "auto"; 5089 } 5090 else if (!centerMost) { 5091 self.calendarContainer.style.left = "auto"; 5092 self.calendarContainer.style.right = right + "px"; 5093 } 5094 else { 5095 var doc = getDocumentStyleSheet(); 5096 if (doc === undefined) 5097 return; 5098 var bodyWidth = window.document.body.offsetWidth; 5099 var centerLeft = Math.max(0, bodyWidth / 2 - calendarWidth / 2); 5100 var centerBefore = ".flatpickr-calendar.centerMost:before"; 5101 var centerAfter = ".flatpickr-calendar.centerMost:after"; 5102 var centerIndex = doc.cssRules.length; 5103 var centerStyle = "{left:" + inputBounds.left + "px;right:auto;}"; 5104 toggleClass(self.calendarContainer, "rightMost", false); 5105 toggleClass(self.calendarContainer, "centerMost", true); 5106 doc.insertRule(centerBefore + "," + centerAfter + centerStyle, centerIndex); 5107 self.calendarContainer.style.left = centerLeft + "px"; 5108 self.calendarContainer.style.right = "auto"; 5109 } 5110 } 5111 function getDocumentStyleSheet() { 5112 var editableSheet = null; 5113 for (var i = 0; i < document.styleSheets.length; i++) { 5114 var sheet = document.styleSheets[i]; 5115 if (!sheet.cssRules) 5116 continue; 5117 try { 5118 sheet.cssRules; 5119 } 5120 catch (err) { 5121 continue; 5122 } 5123 editableSheet = sheet; 5124 break; 5125 } 5126 return editableSheet != null ? editableSheet : createStyleSheet(); 5127 } 5128 function createStyleSheet() { 5129 var style = document.createElement("style"); 5130 document.head.appendChild(style); 5131 return style.sheet; 5132 } 5133 function redraw() { 5134 if (self.config.noCalendar || self.isMobile) 5135 return; 5136 buildMonthSwitch(); 5137 updateNavigationCurrentMonth(); 5138 buildDays(); 5139 } 5140 function focusAndClose() { 5141 self._input.focus(); 5142 if (window.navigator.userAgent.indexOf("MSIE") !== -1 || 5143 navigator.msMaxTouchPoints !== undefined) { 5144 setTimeout(self.close, 0); 5145 } 5146 else { 5147 self.close(); 5148 } 5149 } 5150 function selectDate(e) { 5151 e.preventDefault(); 5152 e.stopPropagation(); 5153 var isSelectable = function (day) { 5154 return day.classList && 5155 day.classList.contains("flatpickr-day") && 5156 !day.classList.contains("flatpickr-disabled") && 5157 !day.classList.contains("notAllowed"); 5158 }; 5159 var t = findParent(getEventTarget(e), isSelectable); 5160 if (t === undefined) 5161 return; 5162 var target = t; 5163 var selectedDate = (self.latestSelectedDateObj = new Date(target.dateObj.getTime())); 5164 var shouldChangeMonth = (selectedDate.getMonth() < self.currentMonth || 5165 selectedDate.getMonth() > 5166 self.currentMonth + self.config.showMonths - 1) && 5167 self.config.mode !== "range"; 5168 self.selectedDateElem = target; 5169 if (self.config.mode === "single") 5170 self.selectedDates = [selectedDate]; 5171 else if (self.config.mode === "multiple") { 5172 var selectedIndex = isDateSelected(selectedDate); 5173 if (selectedIndex) 5174 self.selectedDates.splice(parseInt(selectedIndex), 1); 5175 else 5176 self.selectedDates.push(selectedDate); 5177 } 5178 else if (self.config.mode === "range") { 5179 if (self.selectedDates.length === 2) { 5180 self.clear(false, false); 5181 } 5182 self.latestSelectedDateObj = selectedDate; 5183 self.selectedDates.push(selectedDate); 5184 if (compareDates(selectedDate, self.selectedDates[0], true) !== 0) 5185 self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); }); 5186 } 5187 setHoursFromInputs(); 5188 if (shouldChangeMonth) { 5189 var isNewYear = self.currentYear !== selectedDate.getFullYear(); 5190 self.currentYear = selectedDate.getFullYear(); 5191 self.currentMonth = selectedDate.getMonth(); 5192 if (isNewYear) { 5193 triggerEvent("onYearChange"); 5194 buildMonthSwitch(); 5195 } 5196 triggerEvent("onMonthChange"); 5197 } 5198 updateNavigationCurrentMonth(); 5199 buildDays();
vendor: 1,222 bytes, lines 5200-5230
5200 updateValue(); 5201 if (!shouldChangeMonth && 5202 self.config.mode !== "range" && 5203 self.config.showMonths === 1) 5204 focusOnDayElem(target); 5205 else if (self.selectedDateElem !== undefined && 5206 self.hourElement === undefined) { 5207 self.selectedDateElem && self.selectedDateElem.focus(); 5208 } 5209 if (self.hourElement !== undefined) 5210 self.hourElement !== undefined && self.hourElement.focus(); 5211 if (self.config.closeOnSelect) { 5212 var single = self.config.mode === "single" && !self.config.enableTime; 5213 var range = self.config.mode === "range" && 5214 self.selectedDates.length === 2 && 5215 !self.config.enableTime; 5216 if (single || range) { 5217 focusAndClose(); 5218 } 5219 } 5220 triggerChange(); 5221 } 5222 var CALLBACKS = { 5223 locale: [setupLocale, updateWeekdays], 5224 showMonths: [buildMonths, setCalendarWidth, buildWeekdays], 5225 minDate: [jumpToDate], 5226 maxDate: [jumpToDate], 5227 positionElement: [updatePositionElement], 5228 clickOpens: [ 5229 function () { 5230 if (self.config.clickOpens === true) {
vendor: 14,133 bytes, lines 5231-5559
5231 bind(self._input, "focus", self.open); 5232 bind(self._input, "click", self.open); 5233 } 5234 else { 5235 self._input.removeEventListener("focus", self.open); 5236 self._input.removeEventListener("click", self.open); 5237 } 5238 }, 5239 ], 5240 }; 5241 function set(option, value) { 5242 if (option !== null && typeof option === "object") { 5243 Object.assign(self.config, option); 5244 for (var key in option) { 5245 if (CALLBACKS[key] !== undefined) 5246 CALLBACKS[key].forEach(function (x) { return x(); }); 5247 } 5248 } 5249 else { 5250 self.config[option] = value; 5251 if (CALLBACKS[option] !== undefined) 5252 CALLBACKS[option].forEach(function (x) { return x(); }); 5253 else if (HOOKS.indexOf(option) > -1) 5254 self.config[option] = arrayify(value); 5255 } 5256 self.redraw(); 5257 updateValue(true); 5258 } 5259 function setSelectedDate(inputDate, format) { 5260 var dates = []; 5261 if (inputDate instanceof Array) 5262 dates = inputDate.map(function (d) { return self.parseDate(d, format); }); 5263 else if (inputDate instanceof Date || typeof inputDate === "number") 5264 dates = [self.parseDate(inputDate, format)]; 5265 else if (typeof inputDate === "string") { 5266 switch (self.config.mode) { 5267 case "single": 5268 case "time": 5269 dates = [self.parseDate(inputDate, format)]; 5270 break; 5271 case "multiple": 5272 dates = inputDate 5273 .split(self.config.conjunction) 5274 .map(function (date) { return self.parseDate(date, format); }); 5275 break; 5276 case "range": 5277 dates = inputDate 5278 .split(self.l10n.rangeSeparator) 5279 .map(function (date) { return self.parseDate(date, format); }); 5280 break; 5281 default: 5282 break; 5283 } 5284 } 5285 else 5286 self.config.errorHandler(new Error("Invalid date supplied: " + JSON.stringify(inputDate))); 5287 self.selectedDates = (self.config.allowInvalidPreload 5288 ? dates 5289 : dates.filter(function (d) { return d instanceof Date && isEnabled(d, false); })); 5290 if (self.config.mode === "range") 5291 self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); }); 5292 } 5293 function setDate(date, triggerChange, format) { 5294 if (triggerChange === void 0) { triggerChange = false; } 5295 if (format === void 0) { format = self.config.dateFormat; } 5296 if ((date !== 0 && !date) || (date instanceof Array && date.length === 0)) 5297 return self.clear(triggerChange); 5298 setSelectedDate(date, format); 5299 self.latestSelectedDateObj = 5300 self.selectedDates[self.selectedDates.length - 1]; 5301 self.redraw(); 5302 jumpToDate(undefined, triggerChange); 5303 setHoursFromDate(); 5304 if (self.selectedDates.length === 0) { 5305 self.clear(false); 5306 } 5307 updateValue(triggerChange); 5308 if (triggerChange) 5309 triggerEvent("onChange"); 5310 } 5311 function parseDateRules(arr) { 5312 return arr 5313 .slice() 5314 .map(function (rule) { 5315 if (typeof rule === "string" || 5316 typeof rule === "number" || 5317 rule instanceof Date) { 5318 return self.parseDate(rule, undefined, true); 5319 } 5320 else if (rule && 5321 typeof rule === "object" && 5322 rule.from && 5323 rule.to) 5324 return { 5325 from: self.parseDate(rule.from, undefined), 5326 to: self.parseDate(rule.to, undefined), 5327 }; 5328 return rule; 5329 }) 5330 .filter(function (x) { return x; }); 5331 } 5332 function setupDates() { 5333 self.selectedDates = []; 5334 self.now = self.parseDate(self.config.now) || new Date(); 5335 var preloadedDate = self.config.defaultDate || 5336 ((self.input.nodeName === "INPUT" || 5337 self.input.nodeName === "TEXTAREA") && 5338 self.input.placeholder && 5339 self.input.value === self.input.placeholder 5340 ? null 5341 : self.input.value); 5342 if (preloadedDate) 5343 setSelectedDate(preloadedDate, self.config.dateFormat); 5344 self._initialDate = 5345 self.selectedDates.length > 0 5346 ? self.selectedDates[0] 5347 : self.config.minDate && 5348 self.config.minDate.getTime() > self.now.getTime() 5349 ? self.config.minDate 5350 : self.config.maxDate && 5351 self.config.maxDate.getTime() < self.now.getTime() 5352 ? self.config.maxDate 5353 : self.now; 5354 self.currentYear = self._initialDate.getFullYear(); 5355 self.currentMonth = self._initialDate.getMonth(); 5356 if (self.selectedDates.length > 0) 5357 self.latestSelectedDateObj = self.selectedDates[0]; 5358 if (self.config.minTime !== undefined) 5359 self.config.minTime = self.parseDate(self.config.minTime, "H:i"); 5360 if (self.config.maxTime !== undefined) 5361 self.config.maxTime = self.parseDate(self.config.maxTime, "H:i"); 5362 self.minDateHasTime = 5363 !!self.config.minDate && 5364 (self.config.minDate.getHours() > 0 || 5365 self.config.minDate.getMinutes() > 0 || 5366 self.config.minDate.getSeconds() > 0); 5367 self.maxDateHasTime = 5368 !!self.config.maxDate && 5369 (self.config.maxDate.getHours() > 0 || 5370 self.config.maxDate.getMinutes() > 0 || 5371 self.config.maxDate.getSeconds() > 0); 5372 } 5373 function setupInputs() { 5374 self.input = getInputElem(); 5375 if (!self.input) { 5376 self.config.errorHandler(new Error("Invalid input element specified")); 5377 return; 5378 } 5379 self.input._type = self.input.type; 5380 self.input.type = "text"; 5381 self.input.classList.add("flatpickr-input"); 5382 self._input = self.input; 5383 if (self.config.altInput) { 5384 self.altInput = createElement(self.input.nodeName, self.config.altInputClass); 5385 self._input = self.altInput; 5386 self.altInput.placeholder = self.input.placeholder; 5387 self.altInput.disabled = self.input.disabled; 5388 self.altInput.required = self.input.required; 5389 self.altInput.tabIndex = self.input.tabIndex; 5390 self.altInput.type = "text"; 5391 self.input.setAttribute("type", "hidden"); 5392 if (!self.config.static && self.input.parentNode) 5393 self.input.parentNode.insertBefore(self.altInput, self.input.nextSibling); 5394 } 5395 if (!self.config.allowInput) 5396 self._input.setAttribute("readonly", "readonly"); 5397 updatePositionElement(); 5398 } 5399 function updatePositionElement() { 5400 self._positionElement = self.config.positionElement || self._input; 5401 } 5402 function setupMobile() { 5403 var inputType = self.config.enableTime 5404 ? self.config.noCalendar 5405 ? "time" 5406 : "datetime-local" 5407 : "date"; 5408 self.mobileInput = createElement("input", self.input.className + " flatpickr-mobile"); 5409 self.mobileInput.tabIndex = 1; 5410 self.mobileInput.type = inputType; 5411 self.mobileInput.disabled = self.input.disabled; 5412 self.mobileInput.required = self.input.required; 5413 self.mobileInput.placeholder = self.input.placeholder; 5414 self.mobileFormatStr = 5415 inputType === "datetime-local" 5416 ? "Y-m-d\\TH:i:S" 5417 : inputType === "date" 5418 ? "Y-m-d" 5419 : "H:i:S"; 5420 if (self.selectedDates.length > 0) { 5421 self.mobileInput.defaultValue = self.mobileInput.value = self.formatDate(self.selectedDates[0], self.mobileFormatStr); 5422 } 5423 if (self.config.minDate) 5424 self.mobileInput.min = self.formatDate(self.config.minDate, "Y-m-d"); 5425 if (self.config.maxDate) 5426 self.mobileInput.max = self.formatDate(self.config.maxDate, "Y-m-d"); 5427 if (self.input.getAttribute("step")) 5428 self.mobileInput.step = String(self.input.getAttribute("step")); 5429 self.input.type = "hidden"; 5430 if (self.altInput !== undefined) 5431 self.altInput.type = "hidden"; 5432 try { 5433 if (self.input.parentNode) 5434 self.input.parentNode.insertBefore(self.mobileInput, self.input.nextSibling); 5435 } 5436 catch (_a) { } 5437 bind(self.mobileInput, "change", function (e) { 5438 self.setDate(getEventTarget(e).value, false, self.mobileFormatStr); 5439 triggerEvent("onChange"); 5440 triggerEvent("onClose"); 5441 }); 5442 } 5443 function toggle(e) { 5444 if (self.isOpen === true) 5445 return self.close(); 5446 self.open(e); 5447 } 5448 function triggerEvent(event, data) { 5449 if (self.config === undefined) 5450 return; 5451 var hooks = self.config[event]; 5452 if (hooks !== undefined && hooks.length > 0) { 5453 for (var i = 0; hooks[i] && i < hooks.length; i++) 5454 hooks[i](self.selectedDates, self.input.value, self, data); 5455 } 5456 if (event === "onChange") { 5457 self.input.dispatchEvent(createEvent("change")); 5458 self.input.dispatchEvent(createEvent("input")); 5459 } 5460 } 5461 function createEvent(name) { 5462 var e = document.createEvent("Event"); 5463 e.initEvent(name, true, true); 5464 return e; 5465 } 5466 function isDateSelected(date) { 5467 for (var i = 0; i < self.selectedDates.length; i++) { 5468 var selectedDate = self.selectedDates[i]; 5469 if (selectedDate instanceof Date && 5470 compareDates(selectedDate, date) === 0) 5471 return "" + i; 5472 } 5473 return false; 5474 } 5475 function isDateInRange(date) { 5476 if (self.config.mode !== "range" || self.selectedDates.length < 2) 5477 return false; 5478 return (compareDates(date, self.selectedDates[0]) >= 0 && 5479 compareDates(date, self.selectedDates[1]) <= 0); 5480 } 5481 function updateNavigationCurrentMonth() { 5482 if (self.config.noCalendar || self.isMobile || !self.monthNav) 5483 return; 5484 self.yearElements.forEach(function (yearElement, i) { 5485 var d = new Date(self.currentYear, self.currentMonth, 1); 5486 d.setMonth(self.currentMonth + i); 5487 if (self.config.showMonths > 1 || 5488 self.config.monthSelectorType === "static") { 5489 self.monthElements[i].textContent = 5490 monthToStr(d.getMonth(), self.config.shorthandCurrentMonth, self.l10n) + " "; 5491 } 5492 else { 5493 self.monthsDropdownContainer.value = d.getMonth().toString(); 5494 } 5495 yearElement.value = d.getFullYear().toString(); 5496 }); 5497 self._hidePrevMonthArrow = 5498 self.config.minDate !== undefined && 5499 (self.currentYear === self.config.minDate.getFullYear() 5500 ? self.currentMonth <= self.config.minDate.getMonth() 5501 : self.currentYear < self.config.minDate.getFullYear()); 5502 self._hideNextMonthArrow = 5503 self.config.maxDate !== undefined && 5504 (self.currentYear === self.config.maxDate.getFullYear() 5505 ? self.currentMonth + 1 > self.config.maxDate.getMonth() 5506 : self.currentYear > self.config.maxDate.getFullYear()); 5507 } 5508 function getDateStr(specificFormat) { 5509 var format = specificFormat || 5510 (self.config.altInput ? self.config.altFormat : self.config.dateFormat); 5511 return self.selectedDates 5512 .map(function (dObj) { return self.formatDate(dObj, format); }) 5513 .filter(function (d, i, arr) { 5514 return self.config.mode !== "range" || 5515 self.config.enableTime || 5516 arr.indexOf(d) === i; 5517 }) 5518 .join(self.config.mode !== "range" 5519 ? self.config.conjunction 5520 : self.l10n.rangeSeparator); 5521 } 5522 function updateValue(triggerChange) { 5523 if (triggerChange === void 0) { triggerChange = true; } 5524 if (self.mobileInput !== undefined && self.mobileFormatStr) { 5525 self.mobileInput.value = 5526 self.latestSelectedDateObj !== undefined 5527 ? self.formatDate(self.latestSelectedDateObj, self.mobileFormatStr) 5528 : ""; 5529 } 5530 self.input.value = getDateStr(self.config.dateFormat); 5531 if (self.altInput !== undefined) { 5532 self.altInput.value = getDateStr(self.config.altFormat); 5533 } 5534 if (triggerChange !== false) 5535 triggerEvent("onValueUpdate"); 5536 } 5537 function onMonthNavClick(e) { 5538 var eventTarget = getEventTarget(e); 5539 var isPrevMonth = self.prevMonthNav.contains(eventTarget); 5540 var isNextMonth = self.nextMonthNav.contains(eventTarget); 5541 if (isPrevMonth || isNextMonth) { 5542 changeMonth(isPrevMonth ? -1 : 1); 5543 } 5544 else if (self.yearElements.indexOf(eventTarget) >= 0) { 5545 eventTarget.select(); 5546 } 5547 else if (eventTarget.classList.contains("arrowUp")) { 5548 self.changeYear(self.currentYear + 1); 5549 } 5550 else if (eventTarget.classList.contains("arrowDown")) { 5551 self.changeYear(self.currentYear - 1); 5552 } 5553 } 5554 function timeWrapper(e) { 5555 e.preventDefault(); 5556 var isKeyDown = e.type === "keydown", eventTarget = getEventTarget(e), input = eventTarget; 5557 if (self.amPM !== undefined && eventTarget === self.amPM) { 5558 self.amPM.textContent = 5559 self.l10n.amPM[
vendor: 5,767 bytes, lines 5559-5706
5559utils_int(self.amPM.textContent === self.l10n.amPM[0])]; 5560 } 5561 var min = parseFloat(input.getAttribute("min")), max = parseFloat(input.getAttribute("max")), step = parseFloat(input.getAttribute("step")), curValue = parseInt(input.value, 10), delta = e.delta || 5562 (isKeyDown ? (e.which === 38 ? 1 : -1) : 0); 5563 var newValue = curValue + step * delta; 5564 if (typeof input.value !== "undefined" && input.value.length === 2) { 5565 var isHourElem = input === self.hourElement, isMinuteElem = input === self.minuteElement; 5566 if (newValue < min) { 5567 newValue = 5568 max + 5569 newValue + 5570 utils_int(!isHourElem) + 5571 (utils_int(isHourElem) && utils_int(!self.amPM)); 5572 if (isMinuteElem) 5573 incrementNumInput(undefined, -1, self.hourElement); 5574 } 5575 else if (newValue > max) { 5576 newValue = 5577 input === self.hourElement ? newValue - max - utils_int(!self.amPM) : min; 5578 if (isMinuteElem) 5579 incrementNumInput(undefined, 1, self.hourElement); 5580 } 5581 if (self.amPM && 5582 isHourElem && 5583 (step === 1 5584 ? newValue + curValue === 23 5585 : Math.abs(newValue - curValue) > step)) { 5586 self.amPM.textContent = 5587 self.l10n.amPM[utils_int(self.amPM.textContent === self.l10n.amPM[0])]; 5588 } 5589 input.value = pad(newValue); 5590 } 5591 } 5592 init(); 5593 return self; 5594} 5595function _flatpickr(nodeList, config) { 5596 var nodes = Array.prototype.slice 5597 .call(nodeList) 5598 .filter(function (x) { return x instanceof HTMLElement; }); 5599 var instances = []; 5600 for (var i = 0; i < nodes.length; i++) { 5601 var node = nodes[i]; 5602 try { 5603 if (node.getAttribute("data-fp-omit") !== null) 5604 continue; 5605 if (node._flatpickr !== undefined) { 5606 node._flatpickr.destroy(); 5607 node._flatpickr = undefined; 5608 } 5609 node._flatpickr = FlatpickrInstance(node, config || {}); 5610 instances.push(node._flatpickr); 5611 } 5612 catch (e) { 5613 console.error(e); 5614 } 5615 } 5616 return instances.length === 1 ? instances[0] : instances; 5617} 5618if (typeof HTMLElement !== "undefined" && 5619 typeof HTMLCollection !== "undefined" && 5620 typeof NodeList !== "undefined") { 5621 HTMLCollection.prototype.flatpickr = NodeList.prototype.flatpickr = function (config) { 5622 return _flatpickr(this, config); 5623 }; 5624 HTMLElement.prototype.flatpickr = function (config) { 5625 return _flatpickr([this], config); 5626 }; 5627} 5628var flatpickr = function (selector, config) { 5629 if (typeof selector === "string") { 5630 return _flatpickr(window.document.querySelectorAll(selector), config); 5631 } 5632 else if (selector instanceof Node) { 5633 return _flatpickr([selector], config); 5634 } 5635 else { 5636 return _flatpickr(selector, config); 5637 } 5638}; 5639flatpickr.defaultConfig = {}; 5640flatpickr.l10ns = { 5641 en: __assign({}, l10n_default), 5642 default: __assign({}, l10n_default), 5643}; 5644flatpickr.localize = function (l10n) { 5645 flatpickr.l10ns.default = __assign(__assign({}, flatpickr.l10ns.default), l10n); 5646}; 5647flatpickr.setDefaults = function (config) { 5648 flatpickr.defaultConfig = __assign(__assign({}, flatpickr.defaultConfig), config); 5649}; 5650flatpickr.parseDate = createDateParser({}); 5651flatpickr.formatDate = createDateFormatter({}); 5652flatpickr.compareDates = compareDates; 5653if (typeof jQuery !== "undefined" && typeof jQuery.fn !== "undefined") { 5654 jQuery.fn.flatpickr = function (config) { 5655 return _flatpickr(this, config); 5656 }; 5657} 5658Date.prototype.fp_incr = function (days) { 5659 return new Date(this.getFullYear(), this.getMonth(), this.getDate() + (typeof days === "string" ? parseInt(days, 10) : days)); 5660}; 5661if (typeof window !== "undefined") { 5662 window.flatpickr = flatpickr; 5663} 5664/* harmony default export */ const esm = (flatpickr); 5665 5666;// CONCATENATED MODULE: ./src/components/datetimepicker/datetimepicker.js 5667 5668const Brazilian = (__webpack_require__("./node_modules/flatpickr/dist/l10n/pt.js")["default"].pt) 5669 5670/** Classe para instanciar um objeto BRDateTimePicker*/ 5671class BRDateTimePicker { 5672 /** 5673 * Instancia do objeto 5674 * @param {string} name - Nome do componente em minúsculo 5675 * @param {object} component - Objeto referenciando a raiz do componente DOM 5676 * @param {string} config - atributo de configuração do componente 5677 * @param {object} language arquivo de linguagem do flatpick por padrão nesse componente vem portugues 5678 */ 5679 constructor(name, component, config, language = Brazilian) { 5680 this.name = name 5681 this.component = component 5682 this.language = language 5683 5684 this.component.addEventListener('blur', () => { 5685 if (!isNaN(new Date(this.component.value))) { 5686 fp.setDate(this.component.value) 5687 } 5688 }) 5689 5690 this.component.addEventListener('keyup', () => { 5691 if (!isNaN(new Date(this.component.value))) { 5692 // 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 5693 if (this.component.selectionStart >= 10) 5694 fp.setDate(this.component.value) 5695 else fp.jumpToDate(this.component.value) 5696 } 5697 }) 5698 // localization global 5699 esm.localize(language) 5700 5701 this.configAttribute = this.component.getAttribute('datetimepicker-config') 5702 5703 if (this.configAttribute) { 5704 // Transforma o atributo em um objeto 5705 const properties = this.configAttribute.split(',') 5706 this.obj = []
vendor: 5,041 bytes, lines 5707-5921
5707 properties.forEach((element) => { 5708 const tup = element.split(':') 5709 this.obj[tup[0]] = tup[1].replaceAll("'", '').trim() // eslint-disable-line 5710 5711 this.saida = this.obj 5712 }, this) 5713 5714 this.config = this.obj 5715 } else { 5716 this.config = config 5717 } 5718 5719 this._buildDateTimePicker() 5720 } 5721 /** 5722 * Adiciona máscara de data no input 5723 * @param {*} elm 5724 */ 5725 _dateInputMask(elm) { 5726 elm.setAttribute('maxlength', 10) 5727 elm.addEventListener('keypress', (e) => { 5728 if (e.keyCode < 47 || e.keyCode > 57) { 5729 e.preventDefault() 5730 } 5731 5732 const len = elm.value.length 5733 5734 if (len !== 1 || len !== 3) { 5735 if (e.keyCode == 47) { 5736 e.preventDefault() 5737 } 5738 } 5739 5740 if (len === 2) { 5741 elm.value += '/' 5742 } 5743 5744 if (len === 5) { 5745 elm.value += '/' 5746 } 5747 }) 5748 } 5749 /** 5750 * Adiciona máscara de hora no input 5751 * @param {*} elm * Dom do elemento input 5752 */ 5753 _dateTimeInputMask(elm) { 5754 elm.setAttribute('maxlength', 16) 5755 elm.addEventListener('keypress', (e) => { 5756 if (e.keyCode < 47 || e.keyCode > 57) { 5757 e.preventDefault() 5758 } 5759 5760 const len = elm.value.length 5761 5762 if (len !== 1 || len !== 3) { 5763 if (e.keyCode == 47) { 5764 e.preventDefault() 5765 } 5766 } 5767 switch (len) { 5768 case 2: 5769 elm.value += '/' 5770 break 5771 case 5: 5772 elm.value += '/' 5773 break 5774 case 10: 5775 elm.value += ' ' 5776 break 5777 case 13: 5778 elm.value += ':' 5779 break 5780 5781 default: 5782 break 5783 } 5784 }) 5785 } 5786 /** 5787 * Coloca máscara com range de data no input 5788 * @param {*} elm * Dom do elemento input 5789 */ 5790 _dateRangeInputMask(elm) { 5791 elm.setAttribute('maxlength', 25) 5792 elm.addEventListener('keypress', (e) => { 5793 if (e.keyCode < 47 || e.keyCode > 57) { 5794 e.preventDefault() 5795 } 5796 5797 const len = elm.value.length 5798 5799 if (len !== 1 || len !== 3) { 5800 if (e.keyCode === 47) { 5801 e.preventDefault() 5802 } 5803 } 5804 this._positionRangeMask(elm, len) 5805 }) 5806 } 5807 /** 5808 * Insere a máscara na Dom 5809 * @param {*} elm Dom do elemento input 5810 * @param {*} len Tamanho do elemento inserido 5811 */ 5812 _positionRangeMask(elm, len) { 5813 const tamSeparator = this.language.rangeSeparator.length 5814 const daySeparator = 10 + tamSeparator + 2 5815 const monthSeparator = 10 + tamSeparator + 5 5816 elm.setAttribute('maxlength', 20 + tamSeparator) 5817 5818 switch (len) { 5819 case 2: 5820 elm.value += '/' 5821 break 5822 case 5: 5823 elm.value += '/' 5824 break 5825 case 10: 5826 elm.value += this.language.rangeSeparator 5827 break 5828 case daySeparator: 5829 elm.value += '/' 5830 break 5831 case monthSeparator: 5832 elm.value += '/' 5833 break 5834 5835 default: 5836 break 5837 } 5838 } 5839 /** 5840 * Insere máscara de hora 5841 * 5842 * @param {*} elm dom do elemento input 5843 */ 5844 _timeInputMask(elm) { 5845 elm.setAttribute('maxlength', 5) 5846 elm.addEventListener('keypress', (e) => { 5847 if (e.keyCode < 47 || e.keyCode > 57) { 5848 e.preventDefault() 5849 } 5850 5851 const len = elm.value.length 5852 5853 if (len !== 1 || len !== 3) { 5854 if (e.keyCode === 47) { 5855 e.preventDefault() 5856 } 5857 } 5858 5859 if (len === 2) { 5860 elm.value += ':' 5861 } 5862 }) 5863 } 5864 5865 /** 5866 * Formata o componente e monta instância flatpickr 5867 * @private 5868 */ 5869 _buildDateTimePicker() { 5870 let format = 'd/m/Y' 5871 let time = false 5872 let noCalendar = false 5873 5874 switch (this.component.getAttribute('data-type')) { 5875 case 'date': 5876 format = 'd/m/Y' 5877 time = false 5878 noCalendar = false 5879 this._dateInputMask(this.component.querySelectorAll('input')[0]) 5880 break 5881 5882 case 'time': 5883 format = 'H:i' 5884 time = true 5885 noCalendar = true 5886 this._timeInputMask(this.component.querySelectorAll('input')[0]) 5887 break 5888 case 'datetime-local': 5889 format = 'd/m/Y H:i' 5890 time = true 5891 noCalendar = false 5892 this._dateTimeInputMask(this.component.querySelectorAll('input')[0]) 5893 break 5894 case 'datetime-range': 5895 format = 'd/m/Y' 5896 time = false 5897 noCalendar = false 5898 this._dateRangeInputMask(this.component.querySelectorAll('input')[0]) 5899 break 5900 default: 5901 format = 'd/m/Y' 5902 time = false 5903 noCalendar = false 5904 if (this.component.getAttribute('data-mode') === 'range') { 5905 this._dateRangeInputMask(this.component.querySelectorAll('input')[0]) 5906 } else { 5907 this._dateInputMask(this.component.querySelectorAll('input')[0]) 5908 } 5909 break 5910 } 5911 5912 this.config_native = { 5913 allowInput: true, 5914 dateFormat: format, 5915 disableMobile: 'true', 5916 enableTime: time, 5917 minuteIncrement: 1, 5918 5919 mode: this.component.getAttribute('data-mode'), 5920 nextArrow: 5921 '<button class="br-button circle small" type="button"><i class="fas fa-chevron-right"></i></button>',
5922 noCalendar: noCalendar, 5923 prevArrow: 5924 '<button class="br-button circle small" type="button"><i class="fas fas fa-chevron-left"></i></button>', 5925 time_24hr: true, 5926 wrap: true, 5927 } 5928 this.config_flatpick = Object.assign(this.config, this.config_native) 5929 5930 this.calendar = esm( 5931 this.component, 5932 Object.assign(this.config, this.config_native) 5933 ) 5934 5935 this.calendar.config.onOpen.push(() => { 5936 document.querySelectorAll('.arrowUp').forEach((element) => { 5937 element.classList.add('fas', 'fa-chevron-up') 5938 }) 5939 document.querySelectorAll('.arrowDown').forEach((element) => { 5940 element.classList.add('fas', 'fa-chevron-down') 5941 }) 5942 }) 5943 } 5944} 5945 5946/* harmony default export */ const datetimepicker = (BRDateTimePicker); 5947 5948 5949/***/ }), 5950
vendor: 4,199 bytes, lines 5951-6104
5951/***/ "./src/components/footer/footer.js": 5952/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 5953 5954"use strict"; 5955/* harmony export */ __webpack_require__.d(__webpack_exports__, { 5956/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 5957/* harmony export */ }); 5958/** 5959 * Classe do componente BRFooter 5960 */ 5961class BRFooter { 5962 /** 5963 * Instancia um componente BRFooter 5964 * @param {string} name - Nome do componente (br-footer) 5965 * @param {object} component - Objeto que referencia o elemento DOM do componente 5966 */ 5967 constructor(name, component) { 5968 this.name = name 5969 this.component = component 5970 this._setUp() 5971 this._setBehavior() 5972 } 5973 5974 /** 5975 * Controla a configuração inicial do footer 5976 */ 5977 _setUp() { 5978 this.list = this.component.querySelector('.br-list.horizontal') 5979 } 5980 5981 /** 5982 * Controla os comportamentos do footer 5983 * @private 5984 */ 5985 _setBehavior() { 5986 this._setCollapseBehavior() 5987 5988 window.onresize = function () { 5989 if (window.matchMedia('(min-width: 992px)').matches) { 5990 window.document 5991 .querySelectorAll('.br-footer .br-list:not(.horizontal)') 5992 .forEach((trigger) => { 5993 trigger.style.display = 'block' 5994 }) 5995 } else { 5996 window.document 5997 .querySelectorAll('.br-footer .br-list:not(.horizontal)') 5998 .forEach((trigger) => { 5999 trigger.style.display = 'none' 6000 }) 6001 6002 window.document 6003 .querySelectorAll('.br-footer i') 6004 .forEach((iconComponent) => { 6005 iconComponent.classList.remove('fa-angle-up') 6006 iconComponent.classList.add('fa-angle-down') 6007 }) 6008 } 6009 } 6010 } 6011 6012 /** 6013 * Trata do comportamento de collapse do Footer 6014 * @private 6015 */ 6016 _setCollapseBehavior() { 6017 this.britems = [] 6018 if (this.list) { 6019 this.list.querySelectorAll('.br-list').forEach((trigger) => { 6020 if (window.matchMedia('(max-width: 992px)').matches) { 6021 trigger.style.display = 'none' 6022 } 6023 }) 6024 6025 this.list.querySelectorAll('.br-item').forEach((trigger) => { 6026 trigger.addEventListener('click', (e) => { 6027 if (window.matchMedia('(max-width: 992px)').matches) { 6028 this._showList(e) 6029 } 6030 }) 6031 this.britems.push(trigger) 6032 }) 6033 } 6034 } 6035 6036 /** 6037 * Controla a abertura e fachamento da lista 6038 * @param {object} e - Objeto Event 6039 * @private 6040 */ 6041 _showList(e) { 6042 parent = e.target.parentElement 6043 6044 parent = parent.classList.contains('col-2') 6045 ? e.target.parentElement 6046 : e.target.parentElement.parentElement 6047 parent = parent.classList.contains('col-2') 6048 ? parent 6049 : e.target.parentElement.parentElement.parentElement 6050 // debugger 6051 this._closeAllColumns(parent) 6052 6053 parent.querySelectorAll('.br-list ').forEach((trigger) => { 6054 trigger.style.display = 6055 trigger.style.display === 'block' ? 'none' : 'block' 6056 6057 const iconComponent = parent.querySelector('i') 6058 6059 trigger.style.display === 'block' 6060 ? this._iconAngleUP(iconComponent) 6061 : this._iconAngleDOWN(iconComponent) 6062 }) 6063 } 6064 6065 /** 6066 * Fecha todas colunas do Footer 6067 */ 6068 _closeAllColumns(target) { 6069 this.component 6070 .querySelectorAll('.br-list:not(.horizontal)') 6071 .forEach((trigger) => { 6072 if (target !== trigger.parentElement) { 6073 trigger.style.display = 'none' 6074 this.component 6075 .querySelectorAll('.header i') 6076 .forEach((iconComponent) => { 6077 this._iconAngleDOWN(iconComponent) 6078 }) 6079 } 6080 }) 6081 } 6082 6083 /** 6084 *Inclui Ãcone 'fa-angle-up' 6085 * @param {objetc} iconComponent - Elemento DOM que representa um Ãcone 6086 * @private 6087 */ 6088 _iconAngleUP(iconComponent) { 6089 iconComponent.classList.remove('fa-angle-down') 6090 iconComponent.classList.add('fa-angle-up') 6091 } 6092 6093 /** 6094 * Inclui Ãcone 'fa-angle-down' 6095 * @param {object} iconComponent - Elemento DOM que representa um Ãcone 6096 * @private 6097 */ 6098 _iconAngleDOWN(iconComponent) { 6099 iconComponent.classList.remove('fa-angle-up') 6100 iconComponent.classList.add('fa-angle-down') 6101 } 6102} 6103 6104/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRFooter
vendor: 29 bytes, lines 6104-6109
6104); 6105 6106 6107/***/ }), 6108 6109/***/ "./src/
vendor: 15,812 bytes, lines 6109-6690
6109components/header/header.js": 6110/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 6111 6112"use strict"; 6113/* harmony export */ __webpack_require__.d(__webpack_exports__, { 6114/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 6115/* harmony export */ }); 6116/* harmony import */ var _partial_js_behavior_tooltip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/partial/js/behavior/tooltip.js"); 6117 6118 6119/** Classe para instanciar um objeto BRHeader*/ 6120class BRHeader { 6121 /** 6122 * Instancia do objeto 6123 * @param {string} name - Nome do componente em minúsculo 6124 * @param {object} component - Objeto referenciando a raiz do componente DOM 6125 */ 6126 constructor(name, component) { 6127 this.name = name 6128 this.component = component 6129 this.componentSearch = this.component.querySelector('.header-search') 6130 this.componentSearchInput = this.component.querySelector( 6131 '.header-search input' 6132 ) 6133 this.componentSearchTrigger = this.component.querySelector( 6134 '[data-toggle="search"]' 6135 ) 6136 this.componentSearchDismiss = this.component.querySelector( 6137 '[data-dismiss="search"]' 6138 ) 6139 this.hideDrop = null 6140 this.menuTrigger = this.component.querySelector( 6141 '[data-target="#main-navigation"]' 6142 ) 6143 this._setBehavior() 6144 } 6145 6146 /** 6147 * Define comportamentos do componente 6148 * @private 6149 */ 6150 _setBehavior() { 6151 this._setLogoutBehavior() 6152 this._setSearchBehaviors() 6153 this._setKeyboardBehaviors() 6154 this._setDropdownBehavior() 6155 this._setSticky() 6156 } 6157 6158 /** 6159 * Define comportamentos de login 6160 * @private 6161 */ 6162 _setLoginBehavior() { 6163 for (const login of this.component.querySelectorAll( 6164 '[data-trigger="login"]' 6165 )) { 6166 login.addEventListener('click', () => { 6167 const loginParent = login.closest('.header-login') 6168 loginParent.querySelector('.header-sign-in').classList.add('d-none') 6169 loginParent.querySelector('.header-avatar').classList.remove('d-none') 6170 }) 6171 } 6172 } 6173 6174 /** 6175 * Define comportamentos de logout 6176 * @private 6177 */ 6178 _setLogoutBehavior() { 6179 for (const logout of this.component.querySelectorAll( 6180 '[data-trigger="logout"]' 6181 )) { 6182 logout.addEventListener('click', () => { 6183 const logoutParent = logout.closest('.header-login') 6184 logoutParent.querySelector('.avatar').classList.remove('show') 6185 logoutParent 6186 .querySelector('[data-toggle="dropdown"]') 6187 .classList.remove('active') 6188 logoutParent.querySelector('.header-sign-in').classList.remove('d-none') 6189 logoutParent.querySelector('.header-avatar').classList.add('d-none') 6190 }) 6191 } 6192 } 6193 6194 /** 6195 * Define comportamentos de busca 6196 * @private 6197 */ 6198 _setSearchBehaviors() { 6199 // Abrir busca 6200 if (this.componentSearchTrigger) { 6201 this.componentSearchTrigger.addEventListener('focus', () => { 6202 this._cleanDropDownHeader() 6203 }) 6204 this.componentSearchTrigger.addEventListener('click', () => { 6205 this._openSearch() 6206 }) 6207 } 6208 6209 // Fechar busca 6210 if (this.componentSearchDismiss) { 6211 this.componentSearchDismiss.addEventListener('click', () => { 6212 this._closeSearch() 6213 }) 6214 } 6215 } 6216 6217 /** 6218 * Define comportamentos do teclado 6219 * @private 6220 */ 6221 _setKeyboardBehaviors() { 6222 if (this.componentSearchInput) { 6223 this.componentSearchInput.addEventListener('keydown', (event) => { 6224 switch (event.keyCode) { 6225 // Tecla ESC 6226 case 27: 6227 this._closeSearch() 6228 break 6229 default: 6230 break 6231 } 6232 }) 6233 } 6234 for (const trigger of this.component.querySelectorAll( 6235 '.dropdown [data-toggle="dropdown"]' 6236 )) { 6237 trigger.addEventListener('keydown', (event) => { 6238 switch (event.keyCode) { 6239 // Tecla ESC 6240 case 32: 6241 if (event.target.parentNode.classList.contains('show')) { 6242 event.target.parentNode.click() 6243 event.target.parentNode.classList.remove('show') 6244 event.target.classList.remove('active') 6245 event.stopPropagation() 6246 } 6247 break 6248 default: 6249 break 6250 } 6251 }) 6252 } 6253 } 6254 6255 /** 6256 * Visualização da busca 6257 * @private 6258 */ 6259 _openSearch() { 6260 if (this.componentSearch) { 6261 this.componentSearch.classList.add('active') 6262 this.componentSearch.querySelector('input').focus() 6263 } 6264 } 6265 6266 /** 6267 * Esconde a busca 6268 * @private 6269 */ 6270 _closeSearch() { 6271 if (this.componentSearch) { 6272 this.componentSearch.classList.remove('active') 6273 //this.componentSearchTrigger.focus() 6274 this._nextFocusElement().focus() 6275 } 6276 } 6277 6278 /** 6279 * Exibe notificação 6280 * @param {event} event - referencia ao evento 6281 */ 6282 handleEvent(event) { 6283 const hasNotficiationElemeent = this.component 6284 .querySelector('.br-notification') 6285 .contains(event.target) 6286 if (!hasNotficiationElemeent) { 6287 if (this.activateTr !== event.target.parentNode) { 6288 this._cleanDropDownHeaderRef(this.component) 6289 } 6290 } 6291 } 6292 6293 /** 6294 * Define comportamentos do dropdown 6295 * @private 6296 */ 6297 _setDropdownBehavior() { 6298 // TODO: Trocar o código abaixo pelo utilitário dropdown 6299 this.cleaned = false 6300 let hideDrop 6301 this.activateTr = 'teste' 6302 6303 for (const trigger of this.component.querySelectorAll( 6304 '.dropdown [data-toggle="dropdown"]' 6305 )) { 6306 // eslint-disable-next-line no-loop-func 6307 trigger.addEventListener('click', (event) => { 6308 this._headerTooltip() 6309 clearTimeout(hideDrop) 6310 6311 this.activateTr = trigger 6312 document.addEventListener('mousedown', this, false) 6313 event.stopImmediatePropagation() 6314 // Toggle de abrir / fechar 6315 const hasShow = trigger.classList.contains('active') 6316 6317 if (hasShow) { 6318 trigger.classList.remove('active') 6319 trigger.closest('.dropdown').classList.remove('show') 6320 } else { 6321 this._cleanDropDownHeader() 6322 trigger.classList.add('active') 6323 trigger.closest('.dropdown').classList.add('show') 6324 6325 // Evita que o componente feche o drop ao navegar pelo teclado 6326 const next = this._nextFocusElement() 6327 next.addEventListener('focus', () => { 6328 clearTimeout(hideDrop) 6329 }) 6330 } 6331 event.stopPropagation() 6332 return '' 6333 }) 6334 6335 // Faz o drop fechar ao clicar fora 6336 // eslint-disable-next-line no-loop-func 6337 } 6338 this.menuTrigger.addEventListener('focus', () => { 6339 this._cleanDropDownHeader() 6340 }) 6341 } 6342 6343 /** 6344 * Define comportamentos do tooltip 6345 * @private 6346 */ 6347 _headerTooltip() { 6348 if (this.TooltipExampleList) { 6349 this.TooltipExampleList.forEach((tooltipElem) => { 6350 tooltipElem.component.remove() 6351 tooltipElem.popperInstance.destroy() 6352 }) 6353 } 6354 this.TooltipExampleList = [] 6355 6356 this.component 6357 .querySelectorAll('.notification-tooltip') 6358 .forEach((TooltipExample) => { 6359 const texttooltip = TooltipExample.getAttribute('data-tooltip-text') 6360 const config = { 6361 activator: TooltipExample, 6362 placement: 'top', 6363 textTooltip: texttooltip, 6364 } 6365 const x = new _partial_js_behavior_tooltip__WEBPACK_IMPORTED_MODULE_0__["default"](config) 6366 6367 this.TooltipExampleList.push(x) 6368 }) 6369 } 6370 6371 /** 6372 * Limpa referencias do dorpdown 6373 * @private 6374 * @param {object} ref - Referência ao componente header 6375 */ 6376 _cleanDropDownHeaderRef(ref) { 6377 if (this.cleaned === false) { 6378 for (const trigger of ref.querySelectorAll('.dropdown.show')) { 6379 trigger.classList.remove('show') 6380 trigger.parentNode.classList.remove('show') 6381 for (const button of ref.querySelectorAll('.br-button')) { 6382 button.classList.remove('active') 6383 } 6384 } 6385 } 6386 this.cleaned = false 6387 } 6388 6389 /** 6390 * Limpa referencias do dorpdown 6391 * @private 6392 */ 6393 _cleanDropDownHeader() { 6394 this._cleanDropDownHeaderRef(this.component) 6395 } 6396 6397 /** 6398 * Define modo sticky ao header 6399 * @private 6400 */ 6401 _setSticky() { 6402 if (this.component.hasAttribute('data-sticky')) { 6403 window.onscroll = () => { 6404 if (window.pageYOffset > this.component.offsetHeight) { 6405 this.component.classList.add('sticky', 'compact') 6406 } else { 6407 this.component.classList.remove('sticky', 'compact') 6408 } 6409 } 6410 } 6411 } 6412 6413 /** 6414 * Foca no próximo elmento de ação 6415 * @private 6416 */ 6417 _nextFocusElement() { 6418 //lista de elementos de ação 6419 const focussableElements = 6420 'a:not([disabled]), button:not([disabled]), input[type=text]:not([disabled]), [tabindex]:not([disabled]):not([tabindex="-1"])' 6421 if (document.activeElement) { 6422 const focussable = Array.prototype.filter.call( 6423 document.body.querySelectorAll(focussableElements), 6424 (element) => { 6425 //check for visibility while always include the current activeElement 6426 return ( 6427 element.offsetWidth > 0 || 6428 element.offsetHeight > 0 || 6429 element === document.activeElement 6430 ) 6431 } 6432 ) 6433 const index = focussable.indexOf(document.activeElement) 6434 if (index > -1) { 6435 const nextElement = focussable[index + 1] || focussable[0] 6436 //nextElement.focus(); 6437 return nextElement 6438 } 6439 } 6440 return null 6441 } 6442} 6443 6444/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRHeader); 6445 6446 6447/***/ }), 6448 6449/***/ "./src/components/input/input.js": 6450/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 6451 6452"use strict"; 6453/* harmony export */ __webpack_require__.d(__webpack_exports__, { 6454/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 6455/* harmony export */ }); 6456/** Classe para instanciar um objeto BRInput*/ 6457class BRInput { 6458 /** 6459 * Instancia do objeto 6460 * @param {string} name - Nome do componente em minúsculo 6461 * @param {object} component - Objeto referenciando a raiz do componente DOM 6462 */ 6463 constructor(name, component) { 6464 this.name = name 6465 this.component = component 6466 this._currentFocus = -1 6467 this._setBehavior() 6468 } 6469 6470 /** 6471 * Define comportamentos do componente 6472 * @private 6473 */ 6474 _setBehavior() { 6475 this._setPasswordViewBehavior() 6476 this._setAutocompleteBehavior() 6477 } 6478 6479 /** 6480 * Define comportamentos do componente 6481 * @private 6482 */ 6483 _setPasswordViewBehavior() { 6484 for (const inputPassword of this.component.querySelectorAll( 6485 'input[type="password"]' 6486 )) { 6487 if (!inputPassword.disabled) { 6488 for (const buttonIcon of inputPassword.parentNode.querySelectorAll( 6489 '.br-button' 6490 )) { 6491 buttonIcon.addEventListener( 6492 'click', 6493 (event) => { 6494 this._toggleShowPassword(event) 6495 }, 6496 false 6497 ) 6498 } 6499 } 6500 } 6501 } 6502 6503 /** 6504 * Define comportamentos do componente 6505 * @private 6506 * @param {event} event - referência ao elemento que dispara a ação 6507 */ 6508 _toggleShowPassword(event) { 6509 for (const icon of event.currentTarget.querySelectorAll('.fas')) { 6510 if (icon.classList.contains('fa-eye')) { 6511 icon.classList.remove('fa-eye') 6512 icon.classList.add('fa-eye-slash') 6513 for (const input of this.component.querySelectorAll( 6514 'input[type="password"]' 6515 )) { 6516 input.setAttribute('type', 'text') 6517 } 6518 } else if (icon.classList.contains('fa-eye-slash')) { 6519 icon.classList.remove('fa-eye-slash') 6520 icon.classList.add('fa-eye') 6521 for (const input of this.component.querySelectorAll( 6522 'input[type="text"]' 6523 )) { 6524 input.setAttribute('type', 'password') 6525 } 6526 } 6527 } 6528 } 6529 6530 /** 6531 * Define comportamentos do componente 6532 * @private 6533 */ 6534 _setAutocompleteBehavior() { 6535 for (const inputAutocomplete of this.component.querySelectorAll( 6536 'input.search-autocomplete' 6537 )) { 6538 inputAutocomplete.addEventListener( 6539 'input', 6540 (event) => { 6541 this._clearSearchItems() 6542 this._buildSearchItems(event.currentTarget) 6543 }, 6544 false 6545 ) 6546 inputAutocomplete.addEventListener( 6547 'keydown', 6548 (event) => { 6549 this._handleArrowKeys(event) 6550 }, 6551 false 6552 ) 6553 } 6554 } 6555 6556 /** 6557 * Monta os items de busca para o elemento input 6558 * @private 6559 * @param {object} element - referencia ao elemento input 6560 */ 6561 _buildSearchItems(element) { 6562 const searchList = window.document.createElement('div') 6563 searchList.setAttribute('class', 'search-items') 6564 this.component.appendChild(searchList) 6565 if (element.value !== '') { 6566 for (const data of this.dataList) { 6567 if ( 6568 data.substr(0, element.value.length).toUpperCase() === 6569 element.value.toUpperCase() 6570 ) { 6571 const item = window.document.createElement('div') 6572 item.innerHTML = `<strong>${data.substr( 6573 0, 6574 element.value.length 6575 )}</strong>` 6576 item.innerHTML += data.substr(element.value.length) 6577 item.innerHTML += `<input type="hidden" value="${data}">` 6578 item.addEventListener( 6579 'click', 6580 (event) => { 6581 for (const input of event.currentTarget.querySelectorAll( 6582 'input[type="hidden"]' 6583 )) { 6584 element.value = input.value 6585 } 6586 this._clearSearchItems() 6587 }, 6588 false 6589 ) 6590 searchList.appendChild(item) 6591 } 6592 } 6593 } else { 6594 this._clearSearchItems() 6595 } 6596 } 6597 6598 /** 6599 * Limpa elementos da busca 6600 * @private 6601 */ 6602 _clearSearchItems() { 6603 for (const searchItems of this.component.querySelectorAll( 6604 '.search-items' 6605 )) { 6606 for (const item of searchItems.querySelectorAll('div')) { 6607 searchItems.removeChild(item) 6608 } 6609 this.component.removeChild(searchItems) 6610 } 6611 } 6612 6613 /** 6614 * Define comportamentos do teclado 6615 * @private 6616 * @param {event} event - referência ao elemento que dispara a ação do teclado 6617 */ 6618 _handleArrowKeys(event) { 6619 switch (event.keyCode) { 6620 case 13: 6621 if (this._currentFocus > -1) { 6622 event.preventDefault() 6623 for (const searchItems of this.component.querySelectorAll( 6624 '.search-items' 6625 )) { 6626 for (const itemActive of searchItems.querySelectorAll( 6627 'div.is-active' 6628 )) { 6629 itemActive.click() 6630 } 6631 } 6632 this._currentFocus = -1 6633 } 6634 break 6635 case 38: 6636 if (this._currentFocus > 0) { 6637 this._currentFocus -= 1 6638 } 6639 this._switchFocus() 6640 break 6641 case 40: 6642 for (const searchItems of this.component.querySelectorAll( 6643 '.search-items' 6644 )) { 6645 if ( 6646 this._currentFocus < 6647 searchItems.querySelectorAll('div').length - 1 6648 ) { 6649 this._currentFocus += 1 6650 } 6651 } 6652 this._switchFocus() 6653 break 6654 default: 6655 break 6656 } 6657 } 6658 6659 /** 6660 * Muda o foco do item de busca 6661 * @private 6662 */ 6663 _switchFocus() { 6664 for (const searchItems of this.component.querySelectorAll( 6665 '.search-items' 6666 )) { 6667 for (const [index, item] of searchItems 6668 .querySelectorAll('div') 6669 .entries()) { 6670 if (index === this._currentFocus) { 6671 item.classList.add('is-active') 6672 } 6673 if (index !== this._currentFocus) { 6674 item.classList.remove('is-active') 6675 } 6676 } 6677 } 6678 } 6679 6680 /** 6681 * Preenche lista de dados 6682 * @private 6683 * @param {string[]} dataList - Lista de dados 6684 */ 6685 setAutocompleteData(dataList) { 6686 this.dataList = dataList 6687 } 6688} 6689 6690/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRInput
vendor: 29 bytes, lines 6690-6695
6690); 6691 6692 6693/***/ }), 6694 6695/***/ "./src/
vendor: 8,151 bytes, lines 6695-7011
6695components/item/item.js": 6696/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 6697 6698"use strict"; 6699/* harmony export */ __webpack_require__.d(__webpack_exports__, { 6700/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 6701/* harmony export */ }); 6702/** Classe para instanciar um objeto BRItem*/ 6703 6704class BRItem { 6705 /** 6706 * Instancia do objeto 6707 * @param {string} name - Nome do componente em minúsculo 6708 * @param {object} component - Objeto referenciando a raiz do componente DOM 6709 */ 6710 constructor(name, component) { 6711 this.name = name 6712 this.component = component 6713 this._setBehavior() 6714 } 6715 6716 /** 6717 * Define comportamentos do componente 6718 * @private 6719 */ 6720 _setBehavior() { 6721 this._setCheckboxSelection() 6722 this._setRadioSelection() 6723 } 6724 6725 /** 6726 * Define comportamentos do checkbox 6727 * @private 6728 */ 6729 _setCheckboxSelection() { 6730 for (const checkbox of this.component.querySelectorAll( 6731 '.br-checkbox input[type="checkbox"]' 6732 )) { 6733 if (checkbox.checked) { 6734 this.component.classList.add('selected') 6735 } 6736 checkbox.addEventListener('click', (event) => { 6737 if (event.currentTarget.checked) { 6738 this.component.classList.add('selected') 6739 } else { 6740 this.component.classList.remove('selected') 6741 } 6742 }) 6743 } 6744 } 6745 6746 /** 6747 * Define comportamentos do radio 6748 * @private 6749 */ 6750 _setRadioSelection() { 6751 for (const radio of this.component.querySelectorAll( 6752 '.br-radio input[type="radio"]' 6753 )) { 6754 if (radio.checked) { 6755 radio.setAttribute('checked', '') 6756 this.component.classList.add('selected') 6757 } 6758 radio.addEventListener('click', (event) => { 6759 for (const item of this.component.parentElement.querySelectorAll( 6760 '.br-item' 6761 )) { 6762 for (const radioItem of item.querySelectorAll( 6763 '.br-radio input[type="radio"]' 6764 )) { 6765 if (radioItem === event.currentTarget) { 6766 radioItem.setAttribute('checked', '') 6767 item.classList.add('selected') 6768 } else { 6769 radioItem.removeAttribute('checked') 6770 item.classList.remove('selected') 6771 } 6772 } 6773 } 6774 }) 6775 } 6776 } 6777} 6778 6779/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRItem); 6780 6781 6782/***/ }), 6783 6784/***/ "./src/components/list/list.js": 6785/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 6786 6787"use strict"; 6788/* harmony export */ __webpack_require__.d(__webpack_exports__, { 6789/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 6790/* harmony export */ }); 6791/* harmony import */ var _partial_js_behavior_collapse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/partial/js/behavior/collapse.js"); 6792 6793/** 6794 * Classe do componente BRList 6795 */ 6796class BRList { 6797 /** 6798 * Instancia um componente BRList 6799 * @param {string} name - Nome do componente (br-list) 6800 * @param {object} component - Objeto que referencia o elemento DOM do componente 6801 */ 6802 constructor(name, component) { 6803 this.name = name 6804 this.component = component 6805 this._setBehavior() 6806 } 6807 6808 /** 6809 * Controla os comportamentos da list 6810 * @private 6811 */ 6812 _setBehavior() { 6813 this._setCollapseBehavior() 6814 } 6815 6816 /** 6817 * Trata do comportamento de collapse da list 6818 * @private 6819 */ 6820 _setCollapseBehavior() { 6821 // data-toggle="data-toggle" 6822 // debugger 6823 6824 // this.component.querySelectorAll('.br-list').forEach((trigger) => { 6825 // // trigger.style.display = 'none' 6826 // }) 6827 this.component 6828 .querySelectorAll('[data-toggle="collapse"]') 6829 .forEach((trigger) => { 6830 const config = { 6831 iconToHide: 'fa-chevron-up', 6832 iconToShow: 'fa-chevron-down', 6833 trigger, 6834 useIcons: true, 6835 } 6836 const collapse = new _partial_js_behavior_collapse__WEBPACK_IMPORTED_MODULE_0__["default"](config) 6837 collapse.setBehavior() 6838 }) 6839 } 6840} 6841/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRList); 6842 6843 6844/***/ }), 6845 6846/***/ "./src/components/menu/menu.js": 6847/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 6848 6849"use strict"; 6850/* harmony export */ __webpack_require__.d(__webpack_exports__, { 6851/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 6852/* harmony export */ }); 6853/** Classe para instanciar um objeto BRMenu*/ 6854class BRMenu { 6855 /** 6856 * Instancia do objeto 6857 * @param {string} name - Nome do componente em minúsculo 6858 * @param {object} component - Objeto referenciando a raiz do componente DOM 6859 */ 6860 constructor(name, component) { 6861 this.name = name 6862 this.component = component 6863 this.id = this.component.id 6864 this.breakpoints = this.component.dataset.breakpoints 6865 ? this.component.dataset.breakpoints.split(' ') 6866 : ['col-sm-4', 'col-lg-3'] 6867 this.pushShadow = 'shadow-lg-right' 6868 this.trigger = document.querySelector(`[data-target="#${this.id}"]`) 6869 this.contextual = this.component.querySelector( 6870 '[data-toggle="contextual"]' 6871 ) 6872 this.dismiss = this.component.querySelectorAll('[data-dismiss="menu"]') 6873 this.scrim = this.component.querySelector('.menu-scrim') 6874 this.componentFolders = this.component.querySelectorAll('.menu-folder') 6875 this.componentItems = this.component.querySelectorAll('.menu-item') 6876 this._setBehavior() 6877 } 6878 6879 /** 6880 * Define comportamentos do componente 6881 * @private 6882 */ 6883 _setBehavior() { 6884 this._toggleMenu() 6885 this._setDropMenu() 6886 this._setSideMenu() 6887 this._setKeyboardBehaviors() 6888 this._setBreakpoints() 6889 this._setView() 6890 window.addEventListener('resize', () => { 6891 this._setView() 6892 }) 6893 } 6894 6895 /** 6896 * Define visual do componente 6897 * @private 6898 */ 6899 _setView() { 6900 const template = document.querySelector('body') 6901 const menuContextual = document.querySelector('.menu-trigger') 6902 // const panel = document.querySelector('.menu-panel') 6903 if (menuContextual && window.innerWidth < 992) { 6904 template.classList.add('mb-5') 6905 } else { 6906 template.classList.remove('mb-5') 6907 } 6908 } 6909 6910 /** 6911 * Define breakpoints do menu 6912 * @private 6913 */ 6914 _setBreakpoints() { 6915 if (!this.component.classList.contains('push') && !this.contextual) { 6916 this.component 6917 .querySelector('.menu-panel') 6918 .classList.add(...this.breakpoints) 6919 } 6920 } 6921 6922 /** 6923 * Define ações do teclado 6924 * @private 6925 */ 6926 _setKeyboardBehaviors() { 6927 // Fechar com tecla ESC 6928 this.component.addEventListener('keyup', (event) => { 6929 switch (event.code) { 6930 case 'Escape': 6931 this._closeMenu() 6932 default: 6933 break 6934 } 6935 }) 6936 // Fechar com Tab fora do menu 6937 if (this.scrim) { 6938 this.scrim.addEventListener('keyup', () => { 6939 return this._closeMenu() 6940 }) 6941 } 6942 } 6943 6944 /** 6945 * Define comportamentos de abrir/fechar menu 6946 * @private 6947 */ 6948 _toggleMenu() { 6949 const trigger = this.contextual ? this.contextual : this.trigger 6950 // Clicar no trigger 6951 if (trigger) { 6952 trigger.addEventListener('click', () => { 6953 // Fechar Menu caso esteja aberto 6954 if (this.component.classList.contains('active')) { 6955 this._closeMenu() 6956 return 6957 } 6958 // Abre Menu 6959 this._openMenu() 6960 this._focusNextElement() 6961 }) 6962 } 6963 // Clicar no dismiss 6964 for (const close of this.dismiss) { 6965 close.addEventListener('click', () => { 6966 return this._closeMenu() 6967 }) 6968 } 6969 } 6970 6971 /** 6972 * Define visual do menu aberto 6973 * @private 6974 */ 6975 _openMenu() { 6976 this.component.classList.add('active') 6977 if (this.component.classList.contains('push')) { 6978 this.component.classList.add(...this.breakpoints, 'px-0') 6979 } 6980 this.component.focus() 6981 } 6982 6983 /** 6984 * Define visual do menu fechado 6985 * @private 6986 */ 6987 _closeMenu() { 6988 this.component.classList.remove('active') 6989 if (this.component.classList.contains('push')) { 6990 this.component.classList.remove(...this.breakpoints, 'px-0') 6991 } 6992 this._focusNextElement() 6993 } 6994 6995 /** 6996 * Configura Drop Menu para filho imediato de ".menu-folder" 6997 * @private 6998 */ 6999 _setDropMenu() { 7000 for (const item of this.component.querySelectorAll( 7001 '.menu-folder > a.menu-item' 7002 )) { 7003 // Inclui Ãcone de Drop Menu 7004 this._createIcon(item, 'fa-chevron-down') 7005 // Configura como Drop Menu 7006 item.parentNode.classList.add('drop-menu') 7007 // Inicializa Drop Menu 7008 this._toggleDropMenu(item) 7009 } 7010 } 7011
7012 /** 7013 * Foca no próximo elemento 7014 * @private 7015 */ 7016 _focusNextElement() { 7017 //lista de elementos que desejamos focar 7018 const focussableElements = 7019 'a:not([disabled]), button:not([disabled]), input[type=text]:not([disabled]), [tabindex]:not([disabled]):not([tabindex="-1"])' 7020 if (document.activeElement) { 7021 const focussable = Array.prototype.filter.call( 7022 document.body.querySelectorAll(focussableElements), 7023 (element) => { 7024 // testa a visibilidade e inclui o elemento ativo 7025 return ( 7026 element.offsetWidth > 0 || 7027 element.offsetHeight > 0 || 7028 element === document.activeElement 7029 ) 7030 } 7031 ) 7032 const index = focussable.indexOf(document.activeElement) 7033 if (index > -1) { 7034 const nextElement = focussable[index + 1] || focussable[0] 7035 nextElement.focus() 7036 } 7037 } 7038 } 7039 7040 /** 7041 * Configura Side Menu para quem não for filho imediato de ".menu-folder" 7042 * @private 7043 */ 7044 _setSideMenu() { 7045 for (const ul of this.component.querySelectorAll('a.menu-item + ul')) { 7046 if (!ul.parentNode.classList.contains('menu-folder')) { 7047 // Inclui Ãcone de Side Menu 7048 this._createIcon(ul.previousElementSibling, 'fa-angle-right') 7049 // Configura como Side Menu 7050 ul.parentNode.classList.add('side-menu') 7051 // Inicializa Side Menu 7052 this._toggleSideMenu(ul.previousElementSibling) 7053 } 7054 } 7055 } 7056 7057 /** 7058 * Muda estado do Drop Menu - aberto/fechado 7059 * @private 7060 * @param {object} element - referência ao Objeto que fará a ação 7061 */ 7062 _toggleDropMenu(element) { 7063 // Verifica se o elemento já possui click listener através de um atributo especial 7064 if (!element.hasAttribute('data-click-listener')) { 7065 element.addEventListener('click', () => { 7066 // Fecha Drop Menu caso esteja aberto 7067 if (element.parentNode.classList.contains('active')) { 7068 element.parentNode.classList.remove('active') 7069 return 7070 } 7071 7072 // Abre Drop Menu 7073 element.parentNode.classList.add('active') 7074 }) 7075 // Adiciona atributo especial para indicar que o elemento já possui click listener 7076 element.setAttribute('data-click-listener', 'true') 7077 } 7078 } 7079 7080 /** 7081 * Muda estado do Side Menu - aberto/fechado 7082 * @private 7083 * @param {object} element - referência ao Objeto que fará a ação 7084 */ 7085 _toggleSideMenu(element) { 7086 // Verifica se o elemento já possui click listener através de um atributo especial 7087 if (!element.hasAttribute('data-click-listener')) { 7088 element.addEventListener('click', () => { 7089 // Esconde todos os itens 7090 this._hideItems(element) 7091 7092 // Mostra itens do Side Menu ativo 7093 this._showItems(element.parentNode) 7094 7095 // Fecha Side Menu caso esteja aberto 7096 if (element.parentNode.classList.contains('active')) { 7097 this._closeSideMenu(element) 7098 element.focus() 7099 return 7100 } 7101 7102 // Abre Side Menu 7103 element.parentNode.classList.add('active') 7104 element.focus() 7105 }) 7106 // Adiciona atributo especial para indicar que o elemento já possui click listener 7107 element.setAttribute('data-click-listener', 'true') 7108 } 7109 } 7110 7111 /** 7112 * Fecha Side Menu 7113 * @private 7114 * @param {object} element - referência ao Objeto que fará a ação 7115 */ 7116 _closeSideMenu(element) { 7117 element.parentNode.classList.remove('active') 7118 // Verifica se existe Side Menu anterior, caso contrário mostra todos os itens de volta 7119 const parentFolder = element.parentNode.closest('.side-menu.active') 7120 ? element.parentNode.closest('.side-menu.active') 7121 : element.closest('.menu-body') 7122 this._showItems(parentFolder) 7123 } 7124 7125 /** 7126 * Esconde os elementos proximos a referencia 7127 * @private 7128 * @param {object} element - referencia ao Objeto que fará a ação 7129 */ 7130 _hideItems(element) { 7131 for (const item of element 7132 .closest('.menu-body') 7133 .querySelectorAll('.menu-item')) { 7134 item.setAttribute('hidden', '') 7135 } 7136 } 7137 7138 /** 7139 * Mostra os elementos proximos a referencia 7140 * @private 7141 * @param {object} element - referência ao Objeto que fará a ação 7142 */ 7143 _showItems(element) { 7144 for (const item of element.querySelectorAll('.menu-item')) { 7145 item.removeAttribute('hidden') 7146 } 7147 } 7148 7149 /** 7150 * Cria icone filho a referencia 7151 * @private 7152 * @param {object} element - referência ao Objeto pai 7153 * @param {string} icon - nome da classe font awesome do Ãcone 7154 */ 7155 _createIcon(element, icon) { 7156 // Verifica se já existe container para o Ãcone 7157 if (!element.querySelectorAll('span.support').length) { 7158 const menuIconContainer = document.createElement('span') 7159 menuIconContainer.classList.add('support') 7160 7161 const menuIcon = document.createElement('i') 7162 menuIcon.classList.add('fas') 7163 menuIcon.classList.add(icon) 7164 menuIcon.setAttribute('aria-hidden', 'true') 7165 7166 menuIconContainer.appendChild(menuIcon) 7167 element.appendChild(menuIconContainer) 7168 } 7169 } 7170} 7171 7172/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRMenu); 7173 7174 7175/***/ }), 7176
7177/***/ "./src/components/message/message.js": 7178/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 7179 7180"use strict"; 7181/* harmony export */ __webpack_require__.d(__webpack_exports__, { 7182/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 7183/* harmony export */ }); 7184/** Classe para instanciar um objeto BRAlert */ 7185class BRAlert { 7186 /** 7187 * Instancia do objeto 7188 * @param {string} name - Nome do componente em minúsculo 7189 * @param {object} component - Objeto referenciando a raiz do componente DOM 7190 */ 7191 constructor(name, component) { 7192 this.name = name 7193 this.component = component 7194 this._setBehavior() 7195 } 7196 7197 /** 7198 * Define comportamentos do componente 7199 * @private 7200 */ 7201 _setBehavior() { 7202 for (const button of this.component.querySelectorAll( 7203 '.br-message .close' 7204 )) { 7205 button.addEventListener('click', () => { 7206 this._dismiss(this.component) 7207 }) 7208 } 7209 } 7210 7211 /** 7212 * Desvincula a instancia do objeto 7213 * @private 7214 * @param {object} component - Objeto referenciando a raiz do componente DOM 7215 */ 7216 _dismiss(component) { 7217 component.parentNode.removeChild(component) 7218 } 7219} 7220 7221/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRAlert); 7222 7223 7224/***/ }), 7225
vendor: 15,332 bytes, lines 7226-7777
7226/***/ "./src/components/modal/modal.js": 7227/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 7228 7229"use strict"; 7230/* harmony export */ __webpack_require__.d(__webpack_exports__, { 7231/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 7232/* harmony export */ }); 7233/* harmony import */ var _scrim_scrim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/components/scrim/scrim.js"); 7234 7235 7236/** Classe para instanciar um objeto BRModal*/ 7237class BRModal { 7238 /** 7239 * Instancia do objeto 7240 * @param {string} name - Nome do componente em minúsculo 7241 * @param {object} component - Objeto referenciando a raiz do componente DOM 7242 */ 7243 constructor(name, component) { 7244 this.name = name 7245 this.component = component 7246 this._setBehavior() 7247 } 7248 7249 /** 7250 * Define comportamentos do componente 7251 * @private 7252 */ 7253 _setBehavior() { 7254 for (const brScrim of window.document.querySelectorAll('.br-scrim')) { 7255 const scrim = new _scrim_scrim__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z('br-scrim', brScrim) 7256 for (const button of window.document.querySelectorAll( 7257 '.br-scrim + button' 7258 )) { 7259 button.addEventListener('click', () => { 7260 scrim.showScrim() 7261 }) 7262 } 7263 } 7264 } 7265} 7266 7267/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRModal); 7268 7269 7270/***/ }), 7271 7272/***/ "./src/components/notification/notification.js": 7273/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 7274 7275"use strict"; 7276/* harmony export */ __webpack_require__.d(__webpack_exports__, { 7277/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 7278/* harmony export */ }); 7279/* harmony import */ var _partial_js_behavior_tooltip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/partial/js/behavior/tooltip.js"); 7280 7281/** Classe para instanciar um objeto BRNotification*/ 7282class BRNotification { 7283 /** 7284 * Instancia do objeto 7285 * @param {string} name - Nome do componente em minúsculo 7286 * @param {object} component - Objeto referenciando a raiz do componente DOM 7287 */ 7288 constructor(name, component) { 7289 this.name = name 7290 this.component = component 7291 this.menuBtns = component.querySelectorAll('.contextual-btn') 7292 this.hideEvents = ['mouseleave', 'blur'] 7293 this._setBehavior() 7294 } 7295 7296 /** 7297 * Esconde a notificação relativa a referência 7298 * @private 7299 * @property {object} action - Referência ao Objeto que dispara a ação 7300 */ 7301 _hideNotification(action) { 7302 const notification = action.parentNode.parentNode 7303 notification.setAttribute('hidden', '') 7304 } 7305 7306 /** 7307 * Esconde todas as notificações relativa a referência 7308 * @private 7309 * @property {object} action - Referência ao Objeto que dispara a ação 7310 */ 7311 _hideAllNotifications(action) { 7312 const notifications = 7313 action.parentNode.parentNode.parentNode.querySelectorAll('.br-item') 7314 notifications.forEach((notification) => { 7315 notification.setAttribute('hidden', '') 7316 }) 7317 } 7318 7319 /** 7320 * Define comportamentos do componente 7321 * @private 7322 */ 7323 _setBehavior() { 7324 for (const button of this.component.querySelectorAll( 7325 '.br-notification .close' 7326 )) { 7327 button.addEventListener('click', () => { 7328 this._dismiss(this.component) 7329 }) 7330 } 7331 this._notificationTooltip() 7332 } 7333 7334 /** 7335 * Define tooltip para a notificação 7336 * @private 7337 */ 7338 _notificationTooltip() { 7339 const TooltipExampleList = [] 7340 7341 window.document 7342 .querySelectorAll(':not(.br-header) .notification-tooltip') 7343 .forEach((TooltipNotification) => { 7344 const texttooltip = 7345 TooltipNotification.getAttribute('data-tooltip-text') 7346 const config = { 7347 activator: TooltipNotification, 7348 placement: 'top', 7349 textTooltip: texttooltip, 7350 } 7351 for ( 7352 parent = TooltipNotification.parentNode; 7353 parent; 7354 parent = parent.parentNode 7355 ) { 7356 if (parent.classList) 7357 if (parent.classList.contains('header-avatar')) { 7358 return '' 7359 } 7360 } 7361 TooltipExampleList.push(new _partial_js_behavior_tooltip__WEBPACK_IMPORTED_MODULE_0__["default"](config)) 7362 return '' 7363 }) 7364 } 7365 7366 /** 7367 * Adiciona classe para refletir comportamento de fechar 7368 * @private 7369 * @property {object} componente - Referência ao Objeto 7370 */ 7371 _dismiss(component) { 7372 component.classList.add('close') 7373 } 7374} 7375 7376/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRNotification); 7377 7378 7379/***/ }), 7380 7381/***/ "./src/components/pagination/pagination.js": 7382/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 7383 7384"use strict"; 7385/* harmony export */ __webpack_require__.d(__webpack_exports__, { 7386/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 7387/* harmony export */ }); 7388/** Classe para instanciar um objeto BRPagination*/ 7389class BRPagination { 7390 /** 7391 * Instancia do objeto 7392 * @param {string} name - Nome do componente em minúsculo 7393 * @param {object} component - Objeto referenciando a raiz do componente DOM 7394 */ 7395 constructor(name, component) { 7396 this.name = name 7397 this.component = component 7398 this.currentPage = 1 7399 this._setBehaviors() 7400 } 7401 7402 /** 7403 * Define comportamentos do componente 7404 * @private 7405 */ 7406 _setBehaviors() { 7407 this._setActive() 7408 this._dropdownBehavior() 7409 } 7410 7411 /** 7412 * Define visual do componente 7413 * @private 7414 */ 7415 // eslint-disable-next-line complexity 7416 _setLayout() { 7417 const ul = this.component.querySelector('ul') 7418 const pages = this.component.querySelectorAll('.page') 7419 pages.forEach((page) => { 7420 if (page.classList.contains('active')) { 7421 this.currentPage = parseInt(page.querySelector('a')) 7422 } 7423 page.classList.remove('d-none') 7424 }) 7425 7426 if (this.currentPage === 1) { 7427 ul.querySelector('[data-previous-page]').setAttribute('disabled', '') 7428 } else { 7429 ul.querySelector('[data-previous-page]').removeAttribute('disabled') 7430 } 7431 7432 if (this.currentPage === pages.length) { 7433 ul.querySelector('[data-next-page').setAttribute('disabled', '') 7434 } else { 7435 ul.querySelector('[data-next-page]').removeAttribute('disabled') 7436 } 7437 7438 if (pages.length > 9) { 7439 if (this.currentPage < 6) { 7440 if (ul.querySelector('[data-previous-interval]')) { 7441 ul.querySelector('[data-previous-interval]').remove() 7442 } 7443 for (let page = 7; page < pages.length - 1; page++) { 7444 pages[page].classList.add('d-none') 7445 } 7446 if (!ul.querySelector('[data-next-interval]')) { 7447 ul.insertBefore( 7448 this._createIntervalElement('next'), 7449 ul.children[ul.children.length - 2] 7450 ) 7451 } 7452 } 7453 if (this.currentPage >= 6 && this.currentPage < pages.length - 4) { 7454 for (let page = this.currentPage - 4; page > 0; page--) { 7455 pages[page].classList.add('d-none') 7456 } 7457 if (!ul.querySelector('[data-previous-interval]')) { 7458 ul.insertBefore( 7459 this._createIntervalElement('previous'), 7460 ul.children[2] 7461 ) 7462 } 7463 for (let page = this.currentPage + 2; page < pages.length - 1; page++) { 7464 pages[page].classList.add('d-none') 7465 } 7466 if (!ul.querySelector('[data-next-interval]')) { 7467 ul.insertBefore( 7468 this._createIntervalElement('next'), 7469 ul.children[ul.children.length - 2] 7470 ) 7471 } 7472 } 7473 if (this.currentPage >= pages.length - 4) { 7474 if (ul.querySelector('[data-next-interval]')) { 7475 ul.querySelector('[data-next-interval]').remove() 7476 } 7477 for (let page = pages.length - 8; page > 0; page--) { 7478 pages[page].classList.add('d-none') 7479 } 7480 if (!ul.querySelector('[data-previous-interval]')) { 7481 ul.insertBefore( 7482 this._createIntervalElement('previous'), 7483 ul.children[2] 7484 ) 7485 } 7486 } 7487 } 7488 } 7489 7490 /** 7491 * Cria elemento no intervalo 7492 * @param {string} type - nome do tipo do elmento 7493 * @private 7494 */ 7495 _createIntervalElement(type) { 7496 const interval = document.createElement('li') 7497 interval.setAttribute(`data-${type}-interval`, '') 7498 7499 const a = document.createElement('a') 7500 a.setAttribute('href', 'javascript:void(0)') 7501 7502 const icon = document.createElement('i') 7503 icon.classList.add('fas', 'fa-ellipsis-h') 7504 7505 a.appendChild(icon) 7506 interval.appendChild(a) 7507 7508 return interval 7509 } 7510 7511 /** 7512 * Cria ação de clique na página 7513 * @private 7514 */ 7515 _setActive() { 7516 for (const page of this.component.querySelectorAll('.page')) { 7517 page.addEventListener('click', (event) => { 7518 this._selectPage(event.currentTarget) 7519 }) 7520 } 7521 } 7522 7523 /** 7524 * Cria comportamentos do dropdown 7525 * @private 7526 */ 7527 _dropdownBehavior() { 7528 for (const dropdown of this.component.querySelectorAll( 7529 '[data-toggle="dropdown"]' 7530 )) { 7531 this._dropdownInit(dropdown) 7532 this._dropdownToggle(dropdown) 7533 } 7534 } 7535 7536 /** 7537 * Cria ação de clique no dropdown 7538 * @param {object} element - referencia ao objeto DOM 7539 * @private 7540 */ 7541 _dropdownToggle(element) { 7542 element.addEventListener('click', () => { 7543 if (element.getAttribute('aria-expanded') === 'false') { 7544 this._dropdownOpen(element) 7545 return 7546 } 7547 this._dropdownClose(element) 7548 }) 7549 window.document.addEventListener('click', (event) => { 7550 if (!this.component.contains(event.target)) { 7551 this._dropdownClose(element) 7552 } 7553 }) 7554 } 7555 7556 /** 7557 * Inicializa elemento de dropdown 7558 * @param {object} element - referencia ao objeto DOM 7559 * @private 7560 */ 7561 _dropdownInit(element) { 7562 element.parentElement.classList.add('dropdown') 7563 element.nextElementSibling.setAttribute('role', 'menu') 7564 element.setAttribute('aria-haspopup', 'true') 7565 this._dropdownClose(element) 7566 } 7567 7568 /** 7569 * Ação de abrir dropdown 7570 * @param {object} element - referencia ao objeto DOM 7571 * @private 7572 */ 7573 _dropdownOpen(element) { 7574 element.setAttribute('aria-expanded', 'true') 7575 element.nextElementSibling.removeAttribute('hidden') 7576 } 7577 7578 /** 7579 * Ação de fechar dropdown 7580 * @param {object} element - referencia ao objeto DOM 7581 * @private 7582 */ 7583 _dropdownClose(element) { 7584 element.setAttribute('aria-expanded', 'false') 7585 element.nextElementSibling.setAttribute('hidden', '') 7586 } 7587 7588 /** 7589 * Define página ativa 7590 * @param {object} currentPage - referencia ao objeto DOM 7591 * @private 7592 */ 7593 _selectPage(currentPage) { 7594 this.component.querySelectorAll('.page').forEach((page) => { 7595 page.classList.remove('active') 7596 }) 7597 currentPage.classList.add('active') 7598 this._setLayout() 7599 } 7600} 7601 7602/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRPagination); 7603 7604 7605/***/ }), 7606 7607/***/ "./src/components/scrim/scrim.js": 7608/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 7609 7610"use strict"; 7611/* harmony export */ __webpack_require__.d(__webpack_exports__, { 7612/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 7613/* harmony export */ }); 7614class BRScrim { 7615 constructor(name, component) { 7616 this.name = name 7617 this.component = component 7618 this._setType() 7619 this._setBehavior() 7620 } 7621 7622 _setType() { 7623 if (this.component.classList.contains('foco')) { 7624 this._type = 'foco' 7625 } 7626 if (this.component.classList.contains('legibilidade')) { 7627 this._type = 'legibilidade' 7628 } 7629 if (this.component.classList.contains('inibicao')) { 7630 this._type = 'inibicao' 7631 } 7632 } 7633 7634 _setBehavior() { 7635 if (this.component.classList.contains('foco')) { 7636 this.component.addEventListener('click', (event) => { 7637 this.outsideclick = true 7638 if (event.target.classList.contains('br-scrim')) { 7639 this.hideScrim(event) 7640 } 7641 }) 7642 7643 const allComp = this.component.querySelectorAll( 7644 `[data-dismiss=${this.component.id}]` 7645 ) 7646 7647 for (const buttonComponent of allComp) { 7648 buttonComponent.addEventListener('click', () => { 7649 this.component.classList.remove('active') 7650 }) 7651 } 7652 } 7653 } 7654 7655 hideScrim(event) { 7656 event.currentTarget.classList.remove('active') 7657 } 7658 7659 showScrim() { 7660 if (this._type === 'foco') { 7661 this.component.classList.add('active') 7662 } 7663 } 7664} 7665// const scrimList = [] 7666/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRScrim); 7667for (const buttonBloco1 of window.document.querySelectorAll( 7668 '.scrimexemplo button' 7669)) { 7670 buttonBloco1.addEventListener('click', () => { 7671 const scrscrim = window.document.querySelector('#scrimexample') 7672 const scrimfoco = new BRScrim('br-scrim', scrscrim) 7673 scrimfoco.showScrim() 7674 }) 7675} 7676/** 7677 * Exemplo de scrim com muito texto 7678 */ 7679for (const scrimexamplebig of window.document.querySelectorAll( 7680 '#scrimexemplo-big' 7681)) { 7682 scrimexamplebig.addEventListener('click', () => { 7683 const scrscrim = window.document.querySelector('#scrimfocobig') 7684 const scrimfoco = new BRScrim('br-scrim', scrscrim) 7685 scrimfoco.showScrim() 7686 }) 7687} 7688 7689//Exemplo de scrim close 7690 7691 7692/***/ }), 7693 7694/***/ "./src/components/select/select.js": 7695/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 7696 7697"use strict"; 7698/* harmony export */ __webpack_require__.d(__webpack_exports__, { 7699/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 7700/* harmony export */ }); 7701/** 7702 * Classe do componente BRSelect 7703 */ 7704 7705class BRSelect { 7706 /** 7707 * Instancia o componente 7708 * @property {string} name - Nome do componente em minúsculo 7709 * @property {object} component - Objeto referenciando a raiz do componente DOM 7710 * @property {string} notFound - (Opcional) String contendo código html para informar que a busca não encontrou nenhuma opção. 7711 * Se não informado, será usado um código html padrão. 7712 */ 7713 7714 constructor(name, component, notFound) { 7715 this.name = name 7716 this.component = component 7717 this.notFound = notFound 7718 this.multiple = component.hasAttribute('multiple') 7719 this._setOptionsList() 7720 this._setBehavior() 7721 } 7722 /** 7723 * Retorna os valores dos elementos selecionados 7724 * @returns {Object[]} elementos selecionados 7725 * 7726 */ 7727 get selected() { 7728 return this._optionSelected('value') 7729 } 7730 /** 7731 * Retorna os elementos selecionados pelo inputValue 7732 * @param {Object[]} elementos selecionados 7733 * @returns 7734 */ 7735 get selectedValue() { 7736 return this._optionSelected('inputValue') 7737 } 7738 7739 /** 7740 * Retorna os elementos options selecionados 7741 * @param {Object[]} elementos selecionados 7742 * @returns 7743 */ 7744 _optionSelected(strOption) { 7745 let selected = [] 7746 for (const [index, option] of this.optionsList.entries()) { 7747 if (!this.multiple) { 7748 if (option.selected) { 7749 selected = option[strOption] 7750 break 7751 } 7752 } else { 7753 if (index > 0 && option.selected) { 7754 selected.push(option[strOption]) 7755 } 7756 } 7757 } 7758 return selected 7759 } 7760 7761 /** 7762 * Remove o elemento que indica item não encontrado 7763 * @private 7764 */ 7765 _removeNotFoundElement() { 7766 const list = this.component.querySelector('.br-list') 7767 if (list.querySelector('.br-item.not-found')) { 7768 list.removeChild(list.querySelector('.br-item.not-found')) 7769 } 7770 } 7771 7772 /** 7773 * Coloca o texto Item não encontrado no select 7774 * @private 7775 */ 7776 _addNotFoundElement() { 7777 const image = `
vendor: 8,586 bytes, line 7777
7777data: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==
7777` 7778 const notFoundElement = ` 7779 <div class="br-item not-found"> 7780 <div class="container pl-0 pr-0"> 7781 <div class="row"> 7782 <div class="col-auto"> 7783 <img src="${image}"> 7784 </div> 7785 <div class="col"> 7786 <p><strong>Ops!</strong> Não encontramos o que você está procurando!</p> 7787 </div> 7788 </div> 7789 </div> 7790 </div> 7791 ` 7792 const list = this.component.querySelector('.br-list') 7793 list.insertAdjacentHTML( 7794 'beforeend', 7795 this.notFound ? this.notFound : notFoundElement 7796 ) 7797 } 7798 /** 7799 * Cria listagem de elementos do select 7800 * @private 7801 */ 7802 _setOptionsList() { 7803 this.optionsList = [] 7804 for (const item of this.component.querySelectorAll('.br-list .br-item')) { 7805 for (const input of item.querySelectorAll( 7806 '.br-radio input, .br-checkbox input' 7807 )) { 7808 const option = { 7809 element: item, 7810 focus: false, 7811 inputValue: input.value, 7812 selected: false, 7813 value: input.nextElementSibling.innerText, 7814 visible: true, 7815 } 7816 this.optionsList.push(option) 7817 } 7818 } 7819 } 7820 /** 7821 * Reseta estado da lista 7822 * @private 7823 */ 7824 resetOptionsList() { 7825 this._unsetSelectionBehavior() 7826 this._setOptionsList() 7827 this._setSelectionBehavior() 7828 } 7829 /** 7830 * Define o comportamento do componente 7831 * @private 7832 */ 7833 _setBehavior() { 7834 this._setSearchIcon() 7835 this._setDropdownBehavior() 7836 this._setKeyboardBehavior() 7837 this._setSelectionBehavior() 7838 this._setFilterBehavior() 7839 } 7840 /** 7841 * Define o comportamento de dropdown 7842 * @private 7843 */ 7844 7845 _setDropdownBehavior() { 7846 for (const input of this.component.querySelectorAll( 7847 '.br-input input[type="text"]' 7848 )) { 7849 input.addEventListener('focus', () => { 7850 this._openSelect() 7851 this._resetFocus() 7852 }) 7853 } 7854 for (const trigger of this.component.querySelectorAll( 7855 '.br-input .br-button[data-trigger]' 7856 )) { 7857 trigger.addEventListener('click', () => { 7858 for (const list of this.component.querySelectorAll('.br-list')) { 7859 if (list.hasAttribute('expanded')) { 7860 this._closeSelect() 7861 } else { 7862 this._openSelect() 7863 } 7864 } 7865 }) 7866 } 7867 window.document.addEventListener('click', (event) => { 7868 if (!this.component.contains(event.target)) { 7869 this._closeSelect() 7870 } 7871 }) 7872 } 7873 /** 7874 * Define o comportamento de teclado 7875 * @private 7876 */ 7877 7878 _setKeyboardBehavior() { 7879 for (const input of this.component.querySelectorAll( 7880 '.br-input input[type="text"]' 7881 )) { 7882 input.addEventListener('keydown', this._handleKeydownOnInput.bind(this)) 7883 } 7884 for (const list of this.component.querySelectorAll('.br-list')) { 7885 // eslint-disable-next-line complexity 7886 list.addEventListener('keydown', this._handleKeydownOnList.bind(this)) 7887 } 7888 } 7889 /** 7890 * Retira o comportamento de teclado 7891 * @private 7892 */ 7893 7894 _unsetKeyboardBehavior() { 7895 for (const input of this.component.querySelectorAll( 7896 '.br-input input[type="text"]' 7897 )) { 7898 input.removeEventListener('keydown', this._handleKeydownOnInput, false) 7899 } 7900 for (const list of this.component.querySelectorAll('.br-list')) { 7901 // eslint-disable-next-line complexity 7902 list.addEventListener('keydown', this._handleKeydownOnList.bind(this)) 7903 } 7904 } 7905 7906 /** 7907 * Verifica a navegação 7908 * @param {object} event evento que foi ativado 7909 * @private 7910 */ 7911 _handleKeydownOnInput(event) { 7912 //Close Select 7913 if (event.shiftKey && event.key === 'Tab') { 7914 this._closeSelect() 7915 this._resetFocus() 7916 } 7917 if (event.key === 'Tab' && !event.shiftKey) { 7918 event.target.parentNode.querySelector('.br-button').focus() 7919 } 7920 if (event.keyCode === 40) { 7921 event.preventDefault() 7922 for (const list of this.component.querySelectorAll('.br-list')) { 7923 list.focus() 7924 if (list === document.activeElement) { 7925 this._getNextItem().focus() 7926 } 7927 } 7928 } 7929 } 7930 /**
vendor: 21,897 bytes, lines 7931-8713
7931 * Define comportamentos de teclado na lista 7932 * @private 7933 */ 7934 7935 _handleKeydownOnList(event) { 7936 event.preventDefault() 7937 switch (event.keyCode) { 7938 case 9: 7939 this._closeSelect() 7940 this._resetFocus() 7941 break 7942 case 27: 7943 this._closeSelect() 7944 break 7945 case 32: 7946 this._setKeyClickOnOption(event.currentTarget) 7947 break 7948 case 38: 7949 this._getPreviousItem().focus() 7950 break 7951 case 40: 7952 this._getNextItem().focus() 7953 break 7954 default: 7955 break 7956 } 7957 } 7958 /** 7959 * Define comportamentos de teclado no option 7960 * @private 7961 */ 7962 _setKeyClickOnOption(list) { 7963 for (const [index, item] of list.querySelectorAll('.br-item').entries()) { 7964 if (this.optionsList[index].focus) { 7965 for (const check of item.querySelectorAll( 7966 '.br-radio input[type="radio"], .br-checkbox input[type="checkbox"]' 7967 )) { 7968 check.click() 7969 this._sendEvent() 7970 } 7971 } 7972 } 7973 } 7974 7975 /** 7976 * Envia o evento onchange 7977 * @private 7978 */ 7979 _sendEvent() { 7980 const clickEvent = new CustomEvent('onChange', { 7981 bubbles: true, 7982 detail: this.component, 7983 }) 7984 this.component.dispatchEvent(clickEvent) 7985 } 7986 7987 /** 7988 * preseleciona o elemento apartir da classe css .selected 7989 * @private 7990 */ 7991 _setDefaultSelected() { 7992 const selectedItems = this.component.querySelectorAll('.br-list .selected') 7993 7994 const iterable = typeof selectedItems[Symbol.iterator] 7995 if (selectedItems !== null && iterable === 'function') { 7996 for (const item of selectedItems) { 7997 this._setSelected(this._positionSelected(item), item) 7998 } 7999 } 8000 } 8001 8002 /** 8003 * Retorna posição do elemento no select 8004 * @param {element} component elemento que vai ser pesquisado 8005 * @returns {integer} valor da posição 8006 */ 8007 _positionSelected(component) { 8008 for (const [index, componente] of this.component 8009 .querySelectorAll('.br-list .br-item') 8010 .entries()) { 8011 if (componente === component) { 8012 return index 8013 } 8014 } 8015 return 0 8016 } 8017 /** 8018 * Desfine comportamento do clique no checkbox 8019 * @param {int} index 8020 * @param {object} item - Objeto do item clicado 8021 * @param {object} event - Objeto do evento do clique 8022 * @private 8023 */ 8024 _handleClickOnCheck(index, item, event) { 8025 if (!this.multiple) { 8026 for (const [index2, item2] of this.component 8027 .querySelectorAll('.br-list .br-item') 8028 .entries()) { 8029 this._removeSelected(index2, item2) 8030 } 8031 this._setSelected(index, item) 8032 this._closeSelect() 8033 } else if (event.currentTarget.hasAttribute('checked')) { 8034 this._removeSelected(index, item) 8035 } else { 8036 this._setSelected(index, item) 8037 } 8038 if (item.hasAttribute('data-all')) { 8039 for (const check of item.querySelectorAll( 8040 '.br-checkbox input[type="checkbox"]' 8041 )) { 8042 if (!check.hasAttribute('checked')) { 8043 this._setAttribute() 8044 item.querySelectorAll('label')[0].innerText = 'Selecionar Todos' 8045 } else { 8046 for (const item2 of this.component.querySelectorAll( 8047 '.br-list .br-item' 8048 )) { 8049 for (const check2 of item2.querySelectorAll( 8050 '.br-checkbox input[type="checkbox"]' 8051 )) { 8052 if (!check2.hasAttribute('checked')) { 8053 check2.click() 8054 } 8055 } 8056 } 8057 item.querySelectorAll('label')[0].innerText = 'Deselecionar Todos' 8058 } 8059 } 8060 } 8061 this._sendEvent() 8062 } 8063 /** 8064 * Define comportamentos na seleção 8065 * @private 8066 */ 8067 _setSelectionBehavior() { 8068 this.selectionHandler = [] 8069 this._setDefaultSelected() 8070 for (const [index, item] of this.component 8071 .querySelectorAll('.br-list .br-item') 8072 .entries()) { 8073 for (const check of item.querySelectorAll( 8074 '.br-radio input[type="radio"], .br-checkbox input[type="checkbox"]' 8075 )) { 8076 this.selectionHandler.push({ 8077 element: check, 8078 handler: this._handleClickOnCheck.bind(this, index, item), 8079 }) 8080 check.addEventListener('click', this.selectionHandler[index].handler) 8081 } 8082 } 8083 } 8084 /** 8085 * retira comportamento de clique na seleção 8086 * @private 8087 */ 8088 _unsetSelectionBehavior() { 8089 this.selectionHandler.forEach((item) => { 8090 item.element.removeEventListener('click', item.handler, false) 8091 }) 8092 } 8093 /** 8094 * Define comportamentos no filtro do input 8095 * @private 8096 */ 8097 _setFilterBehavior() { 8098 for (const input of this.component.querySelectorAll( 8099 '.br-input input[type="text"]' 8100 )) { 8101 input.addEventListener('input', (event) => { 8102 let allHidden = true 8103 this._filter(event.currentTarget.value) 8104 for (const option of this.optionsList) { 8105 if (option.visible) { 8106 allHidden = false 8107 } 8108 } 8109 8110 if (allHidden) { 8111 // event.currentTarget.value = event.currentTarget.value.slice(0, -1) 8112 this._filter(event.currentTarget.value) 8113 } 8114 }) 8115 } 8116 } 8117 /** 8118 * Define filtro no list 8119 * @private 8120 */ 8121 _filter(value) { 8122 let hasVisible = false 8123 for (const [index, item] of this.component 8124 .querySelectorAll('.br-list .br-item') 8125 .entries()) { 8126 this._removeNotFoundElement() 8127 if (!this.optionsList[index]) { 8128 continue 8129 } 8130 if ( 8131 this.optionsList[index].value 8132 .toUpperCase() 8133 .indexOf(value.toUpperCase()) === -1 8134 ) { 8135 item.classList.add('d-none') 8136 this.optionsList[index].visible = false 8137 } else { 8138 item.classList.remove('d-none') 8139 this.optionsList[index].visible = true 8140 hasVisible = true 8141 } 8142 } 8143 if (hasVisible === false) { 8144 this._addNotFoundElement() 8145 } 8146 } 8147 /** 8148 * Define atributo checked com click 8149 * @private 8150 */ 8151 _setAttribute() { 8152 for (const item2 of this.component.querySelectorAll('.br-list .br-item')) { 8153 for (const check2 of item2.querySelectorAll( 8154 '.br-checkbox input[type="checkbox"]' 8155 )) { 8156 if (check2.hasAttribute('checked')) { 8157 check2.click() 8158 } 8159 } 8160 } 8161 } 8162 8163 /** 8164 * Seleciona o elemento e retira checked dos outros elementos 8165 * @param {integer} index Posição do elemento na lista 8166 * @param {*} item elemento em que vai ser selecionado 8167 * @private 8168 */ 8169 _setSelected(index, item) { 8170 item.classList.add('selected') 8171 for (const check of item.querySelectorAll('.br-radio, .br-checkbox')) { 8172 for (const input of check.querySelectorAll( 8173 'input[type="radio"], input[type="checkbox"]' 8174 )) { 8175 input.setAttribute('checked', '') 8176 } 8177 } 8178 this.optionsList[index].selected = true 8179 this._setInput() 8180 } 8181 8182 /** 8183 * Retira o estado selecionado do elemento 8184 * @param {integer} index Posição do elemento na lista 8185 * @param {*} item elemento em que vai ser desselecionado 8186 * @private 8187 */ 8188 _removeSelected(index, item) { 8189 item.classList.remove('selected') 8190 for (const check of item.querySelectorAll('.br-radio, .br-checkbox')) { 8191 for (const input of check.querySelectorAll( 8192 'input[type="radio"], input[type="checkbox"' 8193 )) { 8194 input.removeAttribute('checked') 8195 } 8196 this.optionsList[index].selected = false 8197 this._setInput() 8198 } 8199 } 8200 /** 8201 * Determina o input 8202 * @private 8203 */ 8204 _setInput() { 8205 for (const input of this.component.querySelectorAll( 8206 '.br-input input[type="text"]' 8207 )) { 8208 if (!this.multiple) { 8209 input.value = this.selected 8210 } else if (this.selected.length === 0) { 8211 input.value = '' 8212 } else { 8213 this.mountSelectedValues(input) 8214 } 8215 } 8216 } 8217 /** 8218 * Monta a string apresentada no campo input do multiselect 8219 * @param {object} input Referencia o elemento input do select 8220 */ 8221 mountSelectedValues(input) { 8222 const GAP = 0.4 8223 let amount = 1 8224 let value = this.selected.toString().replaceAll(',', ', ') 8225 const tempSpan = document.createElement('span') 8226 tempSpan.innerHTML = value 8227 document.querySelector('body').insertAdjacentElement('beforeend', tempSpan) 8228 8229 while (tempSpan.offsetWidth > input.offsetWidth - input.offsetWidth * GAP) { 8230 value = this.selected 8231 .slice(0, this.selected.length - amount) 8232 .toString() 8233 .replaceAll(',', ', ') 8234 .concat(` + (${amount})`) 8235 tempSpan.innerHTML = value 8236 amount++ 8237 } 8238 input.value = value 8239 8240 tempSpan.remove() 8241 } 8242 /** 8243 * Retorna elemento posterior ao focado 8244 * @returns {object} 8245 * @private 8246 */ 8247 // eslint-disable-next-line complexity 8248 _getNextItem() { 8249 const list = this.component.querySelectorAll('.br-list .br-item') 8250 let iFocused 8251 let iVisible 8252 for (iFocused = 0; iFocused < this.optionsList.length; iFocused++) { 8253 if (this.optionsList[iFocused].focus) { 8254 for ( 8255 iVisible = iFocused + 1; 8256 iVisible < this.optionsList.length; 8257 iVisible++ 8258 ) { 8259 if (this.optionsList[iVisible].visible) { 8260 break 8261 } 8262 } 8263 break 8264 } 8265 } 8266 if (iFocused === this.optionsList.length) { 8267 for (const [index, option] of this.optionsList.entries()) { 8268 if (option.visible) { 8269 option.focus = true 8270 return list[index] 8271 } 8272 } 8273 } else if (iVisible < this.optionsList.length) { 8274 this.optionsList[iFocused].focus = false 8275 this.optionsList[iVisible].focus = true 8276 return list[iVisible] 8277 } else { 8278 return list[iFocused] 8279 } 8280 return '' 8281 } 8282 /** 8283 * Retorna elemento anterior ao focado 8284 * @returns {object} 8285 * @private 8286 */ 8287 _getPreviousItem() { 8288 const list = this.component.querySelectorAll('.br-list .br-item') 8289 let iFocused 8290 let iVisible 8291 for (iFocused = 0; iFocused < this.optionsList.length; iFocused++) { 8292 if (this.optionsList[iFocused].focus) { 8293 for (iVisible = iFocused - 1; iVisible > 0; iVisible--) { 8294 if (this.optionsList[iVisible].visible) { 8295 break 8296 } 8297 } 8298 break 8299 } 8300 } 8301 if (iFocused === 0) { 8302 return list[iFocused] 8303 } else { 8304 this.optionsList[iFocused].focus = false 8305 this.optionsList[iVisible].focus = true 8306 return list[iVisible] 8307 } 8308 } 8309 /** 8310 * Reseta valor do input 8311 * @private 8312 */ 8313 _resetInput() { 8314 for (const input of this.component.querySelectorAll( 8315 '.br-input input[type="text"]' 8316 )) { 8317 input.value = '' 8318 } 8319 } 8320 /** 8321 * Reseta o focus dos elementos 8322 * @private 8323 */ 8324 _resetFocus() { 8325 for (const option of this.optionsList) { 8326 option.focus = false 8327 } 8328 } 8329 /** 8330 * Reseta o focus dos elementos visiveis 8331 * @private 8332 */ 8333 8334 _resetVisible() { 8335 const list = this.component.querySelectorAll('.br-list .br-item') 8336 for (const [index, option] of this.optionsList.entries()) { 8337 option.visible = true 8338 list[index].classList.remove('d-none') 8339 } 8340 } 8341 /** 8342 * Abre o select aberto 8343 * @private 8344 */ 8345 _openSelect() { 8346 for (const list of this.component.querySelectorAll('.br-list')) { 8347 list.setAttribute('expanded', '') 8348 } 8349 for (const icon of this.component.querySelectorAll( 8350 '.br-input .br-button i' 8351 )) { 8352 icon.classList.remove('fa-angle-down') 8353 icon.classList.add('fa-angle-up') 8354 } 8355 this._resetInput() 8356 } 8357 /** 8358 * Fecha o select aberto 8359 * @private 8360 */ 8361 _closeSelect() { 8362 for (const list of this.component.querySelectorAll('.br-list')) { 8363 list.removeAttribute('expanded') 8364 } 8365 for (const icon of this.component.querySelectorAll( 8366 '.br-input .br-button i' 8367 )) { 8368 icon.classList.remove('fa-angle-up') 8369 icon.classList.add('fa-angle-down') 8370 } 8371 this._setInput() 8372 this._resetFocus() 8373 this._resetVisible() 8374 } 8375 /** 8376 * Adiciona Ãcone de busca 8377 * @private 8378 */ 8379 _setSearchIcon() { 8380 const brInput = this.component.querySelector('.br-input') 8381 const dropButton = this.component.querySelector('[data-trigger]') 8382 // Ãcone de busca 8383 const searchIcon = document.createElement('i') 8384 searchIcon.classList.add('fas', 'fa-search') 8385 searchIcon.setAttribute('aria-hidden', 'true') 8386 // Container para o Ãcone 8387 const inputIcon = document.createElement('div') 8388 inputIcon.classList.add('input-icon') 8389 inputIcon.appendChild(searchIcon) 8390 // Estrutura para input com Ãcone 8391 const inputGroup = document.createElement('div') 8392 inputGroup.classList.add('input-group') 8393 inputGroup.appendChild(inputIcon) 8394 inputGroup.appendChild(brInput.querySelector('input')) 8395 brInput.appendChild(inputGroup) 8396 brInput.appendChild(dropButton) 8397 } 8398} 8399 8400/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRSelect); 8401 8402 8403/***/ }), 8404 8405/***/ "./src/components/step/step.js": 8406/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 8407 8408"use strict"; 8409/* harmony export */ __webpack_require__.d(__webpack_exports__, { 8410/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 8411/* harmony export */ }); 8412/** Classe para instanciar um objeto BRStep */ 8413class BRStep { 8414 constructor(name, component) { 8415 /** 8416 * Instancia do componente 8417 * @param {string} name - Nome do componente em minúsculo 8418 * @param {object} component - Objeto referenciando a raiz do componente DOM 8419 * @property {number} activeStepNum - Número do palco ativo 8420 * @property {array} DOMStrings - instancia dos elementos internos do componente 8421 */ 8422 this.name = name 8423 this.component = component 8424 this.activeStepNum = 0 8425 this.DOMstrings = { 8426 // stepsBar: this.component.querySelector('.step-progress'), 8427 stepsBar: this.component, 8428 stepsBarClass: 'step-progress', 8429 stepsBtnClass: 'step-progress-btn', 8430 stepsBtns: this.component.querySelectorAll('.step-progress-btn'), 8431 } 8432 8433 /** 8434 * Remove uma classe css de uma lista de elementos 8435 * @param {object} elemSet - Lista de elementos 8436 * @param {string} button - Nome do atributo 8437 */ 8438 this.removeAttributes = (elemSet, attrName) => { 8439 elemSet.forEach((elem) => { 8440 elem.removeAttribute(attrName) 8441 }) 8442 } 8443 8444 /** 8445 * Retorna o nó pai do elemento com o nome da classe especÃfica 8446 * @param {object} elem - Referência ao elemento 8447 * @param {string} parentClass - Nome da classe pai 8448 * @returns {object} Referência ao elemento pai 8449 */ 8450 this.findParent = (elem, parentClass) => { 8451 let currentNode = elem 8452 while (!currentNode.classList.contains(parentClass)) { 8453 currentNode = currentNode.parentNode 8454 } 8455 return currentNode 8456 } 8457 8458 /** Retorna o número do passo de referencia 8459 * @param {object} elem - Referência ao botão de passo 8460 * @returns {number} Número do passo 8461 */ 8462 this.getActiveStep = (elem) => { 8463 return Array.from(this.DOMstrings.stepsBtns).indexOf(elem) 8464 } 8465 8466 /** Define o número do passo de referência como ativo 8467 * @param {number} num - numero do passo de referência 8468 */ 8469 this.setActiveStep = function (num) { 8470 this.removeAttributes(this.DOMstrings.stepsBtns, 'active') 8471 this.DOMstrings.stepsBtns.forEach((elem, index) => { 8472 if (index === num) { 8473 elem.removeAttribute('disabled') 8474 elem.setAttribute('active', '') 8475 } 8476 }) 8477 this.activeStepNum = num 8478 } 8479 8480 /** 8481 * Mostra os números dos rótulos dos passos 8482 */ 8483 this.setStepsNum = () => { 8484 this.DOMstrings.stepsBtns.forEach((elem, index) => { 8485 const img = elem.querySelector('.step-icon') 8486 const text = this.component.getAttribute('data-type') === 'text' 8487 if (text) { 8488 elem.setAttribute( 8489 'step-num', 8490 `${index + 1}/${this.DOMstrings.stepsBtns.length}` 8491 ) 8492 } else if (img) { 8493 elem.setAttribute('step-num', '') 8494 } else elem.setAttribute('step-num', index + 1) 8495 }) 8496 } 8497 8498 /** Testa se o passo está dentro do escopo e o define como ativo 8499 * @param {number} num - step number 8500 */ 8501 this.setStep = (num) => { 8502 const activeStep = num <= this.DOMstrings.stepsBtns.length ? num - 1 : 0 8503 this.setActiveStep(activeStep) 8504 } 8505 8506 this._setBehavior() 8507 } 8508 8509 /** 8510 * Define comportamentos do componente 8511 * @private 8512 */ 8513 _setBehavior() { 8514 this.DOMstrings.stepsBar.addEventListener('click', (e) => { 8515 const eventTarget = e.target 8516 if (!eventTarget.classList.contains(`${this.DOMstrings.stepsBtnClass}`)) { 8517 e.target.parentNode.click() 8518 return 8519 } 8520 const activeStepNum = this.getActiveStep(eventTarget) 8521 this.setActiveStep(activeStepNum) 8522 }) 8523 8524 this.setStepsNum() 8525 if (this.component.hasAttribute('data-initial')) { 8526 this.setStep(this.component.getAttribute('data-initial')) 8527 } else this.setStep(1) 8528 8529 if ( 8530 !this.component.classList.contains('vertical') && 8531 !this.component.hasAttribute('data-scroll') 8532 ) { 8533 // const stepsWidth = Math.round(100 / this.DOMstrings.stepsBtns.length) - 0.5 8534 } 8535 } 8536} 8537 8538/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRStep); 8539 8540 8541/***/ }), 8542 8543/***/ "./src/components/tab/tab.js": 8544/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 8545 8546"use strict"; 8547/* harmony export */ __webpack_require__.d(__webpack_exports__, { 8548/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 8549/* harmony export */ }); 8550/** Classe para instanciar um objeto BRTab*/ 8551 8552class BRTab { 8553 /** 8554 * Instancia do objeto 8555 * @param {string} name - Nome do componente em minúsculo 8556 * @param {object} component - Objeto referenciando a raiz do componente DOM 8557 */ 8558 constructor(name, component) { 8559 this.name = name 8560 this.component = component 8561 this._setBehavior() 8562 } 8563 8564 /** 8565 * Define comportamentos do componente 8566 * @private 8567 */ 8568 _setBehavior() { 8569 for (const ancor of this.component.querySelectorAll('.tab-nav')) { 8570 this.height = ancor.clientHeight 8571 this.scollsizes = ancor.scrollHeight - ancor.clientHeight 8572 8573 this.scrollHeight = Math.max( 8574 this.component.scrollWidth, 8575 document.documentElement.scrollWidth, 8576 this.component.offsetWidth, 8577 document.documentElement.offsetWidth, 8578 this.component.clientWidth, 8579 document.documentElement.clientWidth 8580 ) 8581 this.leftPosition = this.component.offsetWidth - 1 8582 // debugger 8583 ancor.style.setProperty('--height-nav', `${this.height}px`) 8584 ancor.style.setProperty('--right-gradient-nav', `${this.leftPosition}px`) 8585 8586 this.positionScroll(ancor) 8587 8588 this.navigationRight = this.navigationRight + 4 8589 8590 if (this.navigationRight <= this.lastItempos - 5) { 8591 ancor.classList.add('tab-nav-right') 8592 } 8593 8594 ancor.onscroll = () => { 8595 this.positionScroll(ancor) 8596 8597 if (this.navigationLeft <= 0) { 8598 ancor.classList.add('tab-nav-left') 8599 } else { 8600 ancor.classList.remove('tab-nav-left') 8601 } 8602 8603 if (this.navigationRight <= this.lastItempos - 5) { 8604 ancor.classList.add('tab-nav-right') 8605 } else { 8606 ancor.classList.remove('tab-nav-right') 8607 } 8608 } 8609 } 8610 8611 for (const ancor of this.component.querySelectorAll( 8612 '.tab-nav .tab-item:not([not-tab="true"]) button' 8613 )) { 8614 ancor.addEventListener( 8615 'click', 8616 (event) => { 8617 this._switchTab(event.currentTarget.parentElement) 8618 this._switchContent(event.currentTarget.parentElement) 8619 }, 8620 false 8621 ) 8622 ancor.addEventListener('keyup', (e) => { 8623 e.preventDefault() 8624 this.positionKeyboard(e) 8625 }) 8626 8627 ancor.addEventListener('blur', () => { 8628 this.hiddenTooltips() 8629 }) 8630 } 8631 this.tabitems = this.component.querySelectorAll('tab-item') 8632 } 8633 8634 /** 8635 * Mapeia as teclas pressionadas 8636 * @param {event} event - evento que disparou a ação 8637 */ 8638 positionKeyboard(event) { 8639 const keys = { 8640 end: 35, 8641 home: 36, 8642 left: 37, 8643 right: 39, 8644 space: 32, 8645 tab: 9, 8646 } 8647 const key = event.keyCode 8648 this.tabitems = this.component.querySelectorAll('.tab-item') 8649 this.buttons = this.component.querySelectorAll('button') 8650 8651 switch (key) { 8652 case keys.end: 8653 event.preventDefault() 8654 this.clean() 8655 this._switchTab(this.tabitems[this.tabitems.length - 1]) 8656 this._switchContent(this.tabitems[this.tabitems.length - 1]) 8657 this.tabitems[this.tabitems.length - 1].focus() 8658 break 8659 case keys.home: 8660 event.preventDefault() 8661 this.clean() 8662 this._switchTab(this.tabitems[0]) 8663 this._switchContent(this.tabitems[0]) 8664 this.tabitems[0].focus() 8665 event.stopPropagation() 8666 break 8667 case keys.left: 8668 event.preventDefault() 8669 this.position(event.target, -1) 8670 event.stopPropagation() 8671 break 8672 case keys.right: 8673 event.preventDefault() 8674 this.position(event.target, 1) 8675 event.stopPropagation() 8676 break 8677 case keys.tab: 8678 event.preventDefault() 8679 this.position(event.target, 0) 8680 event.stopPropagation() 8681 break 8682 case 32: 8683 event.preventDefault() 8684 this.hiddenTooltips() 8685 event.target.click() 8686 8687 event.stopPropagation() 8688 break 8689 default: 8690 break 8691 } 8692 } 8693 8694 /** 8695 * Esconde todos tooltip 8696 * 8697 */ 8698 hiddenTooltips() { 8699 const tooltips = document.querySelectorAll('.br-tooltip') 8700 8701 tooltips.forEach((element) => { 8702 element.hidden = true 8703 element.style.visbility = 'hidden' 8704 element.removeAttribute('data-show') 8705 }) 8706 } 8707 8708 /** 8709 * Define o deslocamento da posição ativa 8710 * @property {object} target - referencia ao objeto DOM 8711 * @property {number} direction - incremento à posição 8712 */ 8713 positionActive(target, direction) {
vendor: 1,439 bytes, lines 8714-8757
8714 let contComponent = 0 8715 let contComponentActive = 0 8716 8717 const tabItems2 = 8718 target.parentElement.parentElement.querySelectorAll('.tab-item') 8719 for (const component of tabItems2) { 8720 if ( 8721 component.classList.contains('is-active') || 8722 component.classList.contains('active') 8723 ) { 8724 contComponentActive = contComponent 8725 } 8726 contComponent += 1 8727 } 8728 if ( 8729 tabItems2.length > contComponentActive + direction && 8730 contComponentActive + direction >= 0 8731 ) { 8732 this._switchTab(tabItems2[contComponentActive + direction]) 8733 tabItems2[contComponentActive + direction].focus() 8734 let x = '' 8735 if (tabItems2[contComponentActive + direction].querySelector('button')) { 8736 x = tabItems2[contComponentActive + direction].querySelector('button') 8737 x.focus() 8738 } 8739 } 8740 } 8741 8742 /** 8743 * Define o deslocamento da posição ativa do tab-item interno 8744 * @property {object} target - referencia ao objeto DOM 8745 * @property {number} direction - incremento à posição 8746 */ 8747 position(target, direction) { 8748 this.positionQuery(target, direction, '.tab-item') 8749 } 8750 8751 /** 8752 * Define o deslocamento da posição ativa do elemento referenciado 8753 * @property {object} target - referencia ao objeto DOM 8754 * @property {number} direction - incremento à posição 8755 * @property {string} query - string de referencia 8756 */ 8757 positionQuery(target, direction, query) {
vendor: 12,880 bytes, lines 8758-9193
8758 let contComponent = 0 8759 // const contComponentActive = 0 8760 let contComponentFocus = 0 8761 const tabItems2 = target.parentElement.parentElement.querySelectorAll(query) 8762 for (const component of tabItems2) { 8763 if (component.querySelector('.focus-visible')) { 8764 contComponentFocus = contComponent 8765 } 8766 contComponent += 1 8767 } 8768 tabItems2[contComponentFocus + direction].querySelector('button').focus() 8769 if ( 8770 tabItems2.length > contComponentFocus + direction && 8771 contComponentFocus + direction >= 0 8772 ) { 8773 if (tabItems2[contComponentFocus + direction].querySelector('button')) { 8774 tabItems2[contComponentFocus + direction] 8775 .querySelector('button') 8776 .focus() 8777 } 8778 } 8779 } 8780 8781 /** 8782 * Define a posição ativa do elemento referenciado 8783 * @property {object} target - referencia ao objeto DOM 8784 */ 8785 setPosition(target) { 8786 let contComponent = 0 8787 let contComponentActive = 0 8788 8789 const tabItems2 = 8790 target.parentElement.parentElement.querySelectorAll('.tab-item') 8791 for (const component of tabItems2) { 8792 if ( 8793 component.classList.contains('is-active') || 8794 component.classList.contains('active') 8795 ) { 8796 contComponentActive = contComponent 8797 } 8798 contComponent += 1 8799 } 8800 if (tabItems2.length > contComponentActive && contComponentActive >= 0) { 8801 this.clean() 8802 this._switchContent(tabItems2[contComponentActive]) 8803 } 8804 } 8805 8806 /** 8807 * Reinicia estados 8808 */ 8809 clean() { 8810 for (const ancor of event.currentTarget.parentElement.querySelectorAll( 8811 'button' 8812 )) { 8813 ancor.classList.remove('focus-visible') 8814 ancor.classList.remove('is-active') 8815 ancor.classList.remove('active') 8816 } 8817 for (const ancor of event.currentTarget.parentElement.querySelectorAll( 8818 'tab-item' 8819 )) { 8820 ancor.classList.remove('is-active') 8821 ancor.classList.remove('active') 8822 } 8823 } 8824 8825 /** 8826 * Realiza rolagem até a âncora 8827 * @property {object} ancor - referencia ao objeto DOM 8828 */ 8829 positionScroll(ancor) { 8830 this.navItems = ancor.querySelectorAll('.tab-item') 8831 this.lastItempos = Math.ceil( 8832 this.navItems[this.navItems.length - 1].getBoundingClientRect().right 8833 ) 8834 this.navigationLeft = Math.floor( 8835 this.navItems[0].getBoundingClientRect().left 8836 ) 8837 this.navigationRight = Math.floor(ancor.getBoundingClientRect().right) 8838 } 8839 8840 /** 8841 * Muda para a aba referenciada 8842 * @property {object} currentTab - referencia ao objeto DOM 8843 */ 8844 _switchTab(currentTab) { 8845 for (const tabItem of this.component.querySelectorAll( 8846 '.tab-nav .tab-item:not([not-tab="true"])' 8847 )) { 8848 if (tabItem === currentTab) { 8849 tabItem.classList.add('active') 8850 } else { 8851 tabItem.classList.remove('is-active') 8852 tabItem.classList.remove('active') 8853 } 8854 } 8855 } 8856 8857 /** 8858 * Muda para o conteudo da aba referenciada 8859 * @property {object} currentTab - referencia ao objeto DOM 8860 */ 8861 _switchContent(currentTab) { 8862 for (const button of currentTab.querySelectorAll('button')) { 8863 for (const tabPanel of this.component.querySelectorAll( 8864 '.tab-content .tab-panel' 8865 )) { 8866 if ( 8867 button.getAttribute('data-panel') === tabPanel.getAttribute('id') || 8868 button.getAttribute('data-target') === tabPanel.getAttribute('id') 8869 ) { 8870 tabPanel.classList.add('active') 8871 } else { 8872 tabPanel.classList.remove('is-active') 8873 tabPanel.classList.remove('active') 8874 } 8875 } 8876 } 8877 } 8878} 8879 8880/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRTab); 8881 8882 8883/***/ }), 8884 8885/***/ "./src/components/table/table.js": 8886/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 8887 8888"use strict"; 8889/* harmony export */ __webpack_require__.d(__webpack_exports__, { 8890/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 8891/* harmony export */ }); 8892/* harmony import */ var _partial_js_behavior_collapse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/partial/js/behavior/collapse.js"); 8893/* harmony import */ var _partial_js_behavior_dropdown__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/partial/js/behavior/dropdown.js"); 8894 8895 8896 8897/** Classe para instanciar um objeto BRTable*/ 8898/* eslint-disable complexity */ 8899class BRTable { 8900 /** 8901 * Instancia do objeto 8902 * @param {string} name - Nome do componente em minúsculo 8903 * @param {object} component - Objeto referenciando a raiz do componente DOM 8904 * @param {number} sequence - 'Ãndice do componente para sobreposição' 8905 */ 8906 constructor(name, component, sequence) { 8907 this.name = name 8908 this.component = component 8909 this._header = this.component.querySelector('.header, .table-header') 8910 this._table = this.component.querySelector('table') 8911 this._sequence = sequence 8912 this._setBehaviors() 8913 } 8914 8915 /** 8916 * Define comportamentos do componente 8917 * @private 8918 */ 8919 _setBehaviors() { 8920 this._makeResponsiveTable() 8921 this._setHeaderWidth() 8922 this._searchBehavior() 8923 this._dropdownBehavior() 8924 this._collpaseBehavior() 8925 this._densityBehavior() 8926 this._setClickActions() 8927 this._getBRHeaderHeight() 8928 } 8929 8930 /** 8931 * Configura a altura do cabeçalho 8932 * @private 8933 */ 8934 _getBRHeaderHeight() { 8935 const BRHeader = document.querySelector('.br-header') 8936 if (BRHeader) { 8937 window.addEventListener('scroll', () => { 8938 this._header.style.top = `${BRHeader.clientHeight}px` 8939 }) 8940 } 8941 } 8942 8943 /** 8944 * Configura reponsividade da tabela 8945 * @private 8946 */ 8947 _makeResponsiveTable() { 8948 const responsiveClass = 'responsive' 8949 if (!this.component.querySelector(`.${responsiveClass}`)) { 8950 const responsiveElement = document.createElement('div') 8951 responsiveElement.classList.add(responsiveClass) 8952 responsiveElement.appendChild(this._table) 8953 this._header.after(responsiveElement) 8954 } 8955 } 8956 8957 /** 8958 * Configura rolagem 8959 * @private 8960 */ 8961 _makeScroller() { 8962 const scrollerTag = document.createElement('div') 8963 scrollerTag.classList.add('scroller') 8964 for (const header of this._table.querySelectorAll('thead tr th')) { 8965 const clonedHeader = document.createElement('div') 8966 clonedHeader.classList.add('item') 8967 clonedHeader.innerHTML = header.innerHTML 8968 if (header.offsetWidth) { 8969 clonedHeader.style.flex = `1 0 ${header.offsetWidth}px` 8970 } 8971 scrollerTag.appendChild(clonedHeader) 8972 const checkbox = clonedHeader.querySelector('.br-checkbox') 8973 if (checkbox) { 8974 const input = checkbox.querySelector('input') 8975 const label = checkbox.querySelector('label') 8976 input.id = `${input.id}-clone` 8977 label.setAttribute('for', input.id) 8978 } 8979 } 8980 return scrollerTag 8981 } 8982 8983 /** 8984 * Configura largura do cabeçalho 8985 * @private 8986 */ 8987 _setHeaderWidth() { 8988 for (const clonedHeader of this.component.querySelectorAll( 8989 '.headers > div' 8990 )) { 8991 for (const [index, header] of this.component 8992 .querySelectorAll('table thead tr th') 8993 .entries()) { 8994 clonedHeader.children[index].style.flex = `1 0 ${header.offsetWidth}px` 8995 } 8996 } 8997 } 8998 8999 /** 9000 * Configura coportamento do dropdown 9001 * @private 9002 */ 9003 _dropdownBehavior() { 9004 this.component 9005 .querySelectorAll('[data-toggle="dropdown"]') 9006 .forEach((trigger) => { 9007 const config = { 9008 iconToHide: 'fa-chevron-up', 9009 iconToShow: 'fa-chevron-down', 9010 trigger, 9011 useIcons: true, 9012 } 9013 const dropdown = new _partial_js_behavior_dropdown__WEBPACK_IMPORTED_MODULE_0__["default"](config) 9014 dropdown.setBehavior() 9015 }) 9016 } 9017 9018 /** 9019 * Configura comportamento de colapsar 9020 * @private 9021 */ 9022 _collpaseBehavior() { 9023 this.component 9024 .querySelectorAll('[data-toggle="collapse"]') 9025 .forEach((trigger) => { 9026 const config = { 9027 iconToHide: 'fa-chevron-up', 9028 iconToShow: 'fa-chevron-down', 9029 trigger, 9030 useIcons: true, 9031 } 9032 const collapse = new _partial_js_behavior_collapse__WEBPACK_IMPORTED_MODULE_1__["default"](config) 9033 collapse.setBehavior() 9034 }) 9035 } 9036 9037 /** 9038 * Configura comportamento da busca 9039 * @private 9040 */ 9041 _searchBehavior() { 9042 if (this.component.dataset.search) { 9043 const trigger = this.component.querySelector('[data-toggle="search"]') 9044 const target = this.component.querySelector('.search-bar') 9045 const dismiss = this.component.querySelector('[data-dismiss="search"]') 9046 9047 // Inicializar 9048 this._searchInit(trigger) 9049 9050 // Abre busca 9051 trigger.addEventListener('click', () => { 9052 return this._searchOpen(trigger, target) 9053 }) 9054 9055 // Fecha busca 9056 dismiss.addEventListener('click', () => { 9057 return this._searchClose(trigger, target) 9058 }) 9059 target.querySelector('input').addEventListener('keydown', (event) => { 9060 if (event.key === 'Escape') { 9061 this._searchClose(trigger, target) 9062 } 9063 }) 9064 } 9065 } 9066 9067 /** 9068 * Inicializa a busca 9069 * @private 9070 * @param {object} trigger - Objeto referente ao elemento que dispara a ação 9071 */ 9072 _searchInit(trigger) { 9073 trigger.setAttribute('aria-expanded', 'false') 9074 } 9075 9076 /** 9077 * Abre a busca 9078 * @private 9079 * @param {object} trigger - Objeto referente ao elemento que dispara a ação 9080 * @param {object} target - Objeto referente ao alvo da ação 9081 */ 9082 _searchOpen(trigger, target) { 9083 trigger.setAttribute('aria-expanded', 'true') 9084 target.classList.add('show') 9085 target.parentElement.classList.add('show') 9086 target.querySelector('input').focus() 9087 } 9088 9089 /** 9090 * Fecha a busca 9091 * @private 9092 * @param {object} trigger - Objeto referente ao elemento que dispara a ação 9093 * @param {object} target - Objeto referente ao alvo da ação 9094 */ 9095 _searchClose(trigger, target) { 9096 target.querySelector('input').value = '' 9097 target.classList.remove('show') 9098 target.parentElement.classList.remove('show') 9099 trigger.focus() 9100 trigger.setAttribute('aria-expanded', 'false') 9101 } 9102 9103 /** 9104 * Configura densidades 9105 * @private 9106 */ 9107 _densityBehavior() { 9108 const desityTriggers = this.component.querySelectorAll('[data-density]') 9109 for (const desityTrigger of desityTriggers) { 9110 desityTrigger.addEventListener('click', () => { 9111 this.component.classList.remove('small', 'medium', 'large') 9112 this.component.classList.add(desityTrigger.dataset.density) 9113 this._dropdownClose( 9114 desityTrigger 9115 .closest('.dropdown') 9116 .querySelector('[data-toggle="dropdown"]') 9117 ) 9118 }) 9119 } 9120 } 9121 9122 /** 9123 * Configura ações de clique 9124 * @private 9125 */ 9126 _setClickActions() { 9127 const headerCheckbox = this.component.querySelector( 9128 '.headers [type="checkbox"]' 9129 ) 9130 const tableCheckboxes = this.component.querySelectorAll( 9131 'tbody [type="checkbox"]' 9132 ) 9133 const selectedBar = this.component.querySelector('.selected-bar') 9134 const checkAlls = this.component.querySelectorAll( 9135 '[data-toggle="check-all"]' 9136 ) 9137 for (const checkAll of checkAlls) { 9138 checkAll.addEventListener('click', () => { 9139 this._checkAllTable(selectedBar, tableCheckboxes, headerCheckbox) 9140 if (checkAll.parentElement.classList.contains('br-list')) { 9141 this._dropdownClose( 9142 checkAll 9143 .closest('.dropdown') 9144 .querySelector('[data-toggle="dropdown"]') 9145 ) 9146 } 9147 }) 9148 } 9149 if (tableCheckboxes) { 9150 for (const checkbox of tableCheckboxes) { 9151 checkbox.addEventListener('change', () => { 9152 this._checkRow(checkbox, selectedBar, tableCheckboxes, headerCheckbox) 9153 }) 9154 } 9155 } 9156 } 9157 9158 /** 9159 * Configura seleção da linha 9160 * @private 9161 * @param {object} checkbox - Objeto referente ao checkbox 9162 * @param {boolean} check - define se a linha deve ser selecionada 9163 */ 9164 _setRow(checkbox, check) { 9165 const tr = checkbox.parentNode.parentNode.parentNode 9166 if (check) { 9167 tr.classList.add('is-selected') 9168 checkbox.parentNode.classList.add('is-inverted') 9169 checkbox.checked = true 9170 } else { 9171 tr.classList.remove('is-selected') 9172 checkbox.parentNode.classList.remove('is-inverted') 9173 checkbox.checked = false 9174 } 9175 } 9176 9177 /** 9178 * Configura seleção da linha 9179 * @private 9180 * @param {object} checkbox - Objeto referente ao checkbox 9181 * @param {object} selectedBar - Objeto referente a barra contextual 9182 * @param {object} tableCheckboxes - Objeto referente a lista de checkboxes 9183 * @param {object} headerCheckbox - Objeto referente ao checkbox do header 9184 */ 9185 _checkRow(checkbox, selectedBar, tableCheckboxes, headerCheckbox) { 9186 const check = checkbox.checked 9187 this._setRow(checkbox, check) 9188 this._setSelectedBar( 9189 check ? 1 : -1, 9190 selectedBar, 9191 tableCheckboxes, 9192 headerCheckbox 9193
vendor: 2,946 bytes, lines 9193-9282
9193) 9194 } 9195 9196 /** 9197 * Seleciona todas as linhas 9198 * @private 9199 * @param {object} tableCheckboxes - Objeto referente a lista de checkboxes 9200 */ 9201 _checkAllRows(tableCheckboxes) { 9202 for (const checkbox of tableCheckboxes) { 9203 this._setRow(checkbox, true) 9204 } 9205 } 9206 9207 /** 9208 * Desseleciona todas as linhas 9209 * @private 9210 * @param {object} tableCheckboxes - Objeto referente a lista de checkboxes 9211 */ 9212 _uncheckAllRows(tableCheckboxes) { 9213 for (const checkbox of tableCheckboxes) { 9214 this._setRow(checkbox, false) 9215 } 9216 } 9217 9218 /** 9219 * Seleciona toda a tabela 9220 * @private 9221 * @param {object} selectedBar - Objeto referente a barra contextual 9222 * @param {object} tableCheckboxes - Objeto referente a lista de checkboxes 9223 * @param {object} headerCheckbox - Objeto referente ao checkbox do header 9224 */ 9225 _checkAllTable(selectedBar, tableCheckboxes, headerCheckbox) { 9226 let count = tableCheckboxes.length 9227 const infoCount = selectedBar.querySelector('.info .count') 9228 const total = parseInt(infoCount.innerHTML, 10) 9229 if (total === count) { 9230 this._uncheckAllRows(tableCheckboxes) 9231 count = -1 * count 9232 } else { 9233 this._checkAllRows(tableCheckboxes) 9234 } 9235 this._setSelectedBar(count, selectedBar, tableCheckboxes, headerCheckbox) 9236 } 9237 9238 /** 9239 * Define visualização dos itens selecionados na barra contextual 9240 * @private 9241 * @param {number} count - número de itens selecionados 9242 * @param {object} selectedBar - Objeto referente a barra contextual 9243 * @param {object} tableCheckboxes - Objeto referente a lista de checkboxes 9244 * @param {object} headerCheckbox - Objeto referente ao checkbox do header 9245 */ 9246 _setSelectedBar(count, selectedBar, tableCheckboxes, headerCheckbox) { 9247 const infoCount = selectedBar.querySelector('.info .count') 9248 const infoText = selectedBar.querySelector('.info .text') 9249 const total = count < 2 ? parseInt(infoCount.innerHTML, 10) + count : count 9250 if (total > 0) { 9251 selectedBar.classList.add('show') 9252 infoCount.innerHTML = total 9253 infoText.innerHTML = total > 1 ? 'itens selecionados' : 'item selecionado' 9254 if (headerCheckbox) headerCheckbox.parentNode.classList.add('is-checking') 9255 if (total === tableCheckboxes.length) { 9256 if (headerCheckbox) { 9257 headerCheckbox.checked = true 9258 headerCheckbox.parentNode.classList.remove('is-checking') 9259 } 9260 } 9261 } else { 9262 infoCount.innerHTML = 0 9263 if (headerCheckbox) { 9264 headerCheckbox.checked = false 9265 headerCheckbox.parentNode.classList.remove('is-checking') 9266 } 9267 selectedBar.classList.remove('show') 9268 } 9269 } 9270} 9271 9272/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRTable); 9273 9274 9275/***/ }), 9276 9277/***/ "./src/components/tag/tag.js": 9278/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 9279 9280"use strict"; 9281/* harmony export */ __webpack_require__.d(__webpack_exports__, { 9282/* harmony export */
vendor: 16,843 bytes, lines 9282-9881
9282Z: () => (__WEBPACK_DEFAULT_EXPORT__) 9283/* harmony export */ }); 9284/** Classe para instanciar um objeto BRTag*/ 9285class BRTag { 9286 /** 9287 * Instancia do objeto 9288 * @param {string} name - Nome do componente em minúsculo 9289 * @param {object} component - Objeto referenciando a raiz do componente DOM 9290 */ 9291 constructor(name, component) { 9292 this.name = name 9293 this.component = component 9294 this._setBehavior() 9295 } 9296 9297 /** 9298 * Define comportamentos do componente 9299 * @private 9300 */ 9301 _setBehavior() { 9302 if (this.component.classList.contains('interaction-select')) { 9303 // Inicializa selecionado 9304 if (this.component.querySelector('input').getAttribute('checked')) { 9305 this.component.classList.add('selected') 9306 } 9307 this._setSelection() 9308 } 9309 this._closeTag() 9310 this._dismissTag() 9311 } 9312 9313 /** 9314 * Define comportamentos do componente 9315 * @private 9316 */ 9317 _setSelection() { 9318 const label = this.component.querySelector('label') 9319 const input = this.component.querySelector('input') 9320 // const tagRadio = input.getAttribute('type') === 'radio' ? true : false 9321 9322 label.addEventListener('click', (event) => { 9323 this._toggleSelection(input, event) 9324 }) 9325 input.addEventListener('keydown', (event) => { 9326 if (event.code === 'Space' || event.code === 'Enter') { 9327 this._toggleSelection(input, event) 9328 } 9329 }) 9330 } 9331 9332 /** 9333 * Muda estado do radio 9334 * @private 9335 * @param {object} input - referencia DOM ao input 9336 */ 9337 _toggleRadio(input) { 9338 if (this.component.querySelector('[type="radio"')) { 9339 const nameTag = input.getAttribute('name') 9340 for (const tagRadio of window.document.querySelectorAll( 9341 `[name=${nameTag}]` 9342 )) { 9343 this._removeCheck(tagRadio) 9344 } 9345 } 9346 } 9347 9348 /** 9349 * Muda estado do input 9350 * @private 9351 * @param {object} input - referencia DOM ao input 9352 * @param {event} event - ação que disparou o evento 9353 */ 9354 _toggleSelection(input, event) { 9355 event.preventDefault() 9356 this._toggleRadio(input) 9357 if (input.getAttribute('checked')) { 9358 this._removeCheck(input) 9359 return 9360 } 9361 9362 this._setCheck(input) 9363 } 9364 9365 /** 9366 * Define estado do input para selecionado 9367 * @private 9368 * @param {object} input - referencia DOM ao input 9369 */ 9370 _setCheck(input) { 9371 input.setAttribute('checked', 'checked') 9372 input.parentElement.classList.add('selected') 9373 } 9374 9375 /** 9376 * Define estado do input para desselecionado 9377 * @private 9378 * @param {object} input - referencia DOM ao input 9379 */ 9380 _removeCheck(input) { 9381 input.removeAttribute('checked') 9382 input.parentElement.classList.remove('selected') 9383 } 9384 9385 /** 9386 * Define comportamento do botão de fechar usando classe (compatibilidade) 9387 * @private 9388 */ 9389 _closeTag() { 9390 const closeBtn = this.component.querySelector('.br-button.close') 9391 9392 if (closeBtn) { 9393 const brTag = closeBtn.closest('.br-tag') 9394 9395 brTag.addEventListener('click', () => { 9396 closeBtn.closest('.br-tag').remove() 9397 }) 9398 } 9399 } 9400 9401 /** 9402 * Define comportamento do botão de fechar usando data-dismiss 9403 * @private 9404 */ 9405 _dismissTag() { 9406 this.component.querySelectorAll('[data-dismiss]').forEach((closeBtn) => { 9407 closeBtn.addEventListener('click', () => { 9408 const target = document.querySelector( 9409 `#${closeBtn.getAttribute('data-dismiss')}` 9410 ) 9411 if (target) target.remove() 9412 }) 9413 }) 9414 } 9415} 9416 9417const tagList = [] 9418for (const brTag of window.document.querySelectorAll('.br-tag')) { 9419 tagList.push(new BRTag('br-tab', brTag)) 9420} 9421 9422/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRTag); 9423 9424 9425/***/ }), 9426 9427/***/ "./src/components/textarea/textarea.js": 9428/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 9429 9430"use strict"; 9431/* harmony export */ __webpack_require__.d(__webpack_exports__, { 9432/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 9433/* harmony export */ }); 9434/** Classe para instanciar um objeto BRTextArea*/ 9435class BRTextArea { 9436 /** 9437 * Instancia do objeto 9438 * @param {string} name - Nome do componente em minúsculo 9439 * @param {object} component - Objeto referenciando a raiz do componente DOM 9440 */ 9441 constructor(name, component) { 9442 this.name = name 9443 this.component = component 9444 this._setBehavior() 9445 this._setKeyup() 9446 } 9447 9448 /** 9449 * Define comportamentos do componente 9450 * @private 9451 */ 9452 _setBehavior() { 9453 this.limit = this.component.querySelector('.limit') 9454 this.current = this.component.querySelector('.current') 9455 if (this.component.querySelector('textarea') !== null) { 9456 this.maximum = this.component 9457 .querySelector('textarea') 9458 .getAttribute('maxlength') 9459 } 9460 9461 this.characters = this.component.querySelector('.characters') 9462 this.currentValue = this.component.querySelector('.current') 9463 } 9464 9465 /** 9466 * Define ações do teclado 9467 * @private 9468 */ 9469 _setKeyup() { 9470 this.component.addEventListener('keyup', () => { 9471 const characterCount = this.component.querySelector('textarea').textLength 9472 if (characterCount <= this.maximum && !this.characters) { 9473 this.limit.innerHTML = '' 9474 this.currentValue.innerHTML = `Restam <strong>${ 9475 this.maximum - characterCount 9476 }</strong> caracteres` 9477 } 9478 // Com limite de caracteres 9479 if (!this.characters) { 9480 if (characterCount === 0 && this.limit.innerHTML === '') { 9481 this.limit.innerHTML = `Limite máximo de <strong>${this.maximum}</strong> caracteres` 9482 this.currentValue.innerHTML = '' 9483 } 9484 } 9485 // Sem limite de caracteres 9486 else { 9487 this.characters.innerHTML = `<strong>${characterCount}</strong> caracteres digitados` 9488 } 9489 }) 9490 } 9491} 9492 9493/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRTextArea); 9494 9495 9496/***/ }), 9497 9498/***/ "./src/components/tooltip/tooltip.js": 9499/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 9500 9501"use strict"; 9502/* harmony export */ __webpack_require__.d(__webpack_exports__, { 9503/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 9504/* harmony export */ }); 9505/* harmony import */ var _popperjs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@popperjs/core/lib/popper.js"); 9506 9507class BRTooltip { 9508 constructor(name, component) { 9509 this.name = name 9510 this.component = component 9511 this.activator = component.previousSibling.previousSibling 9512 const place = component.getAttribute('place') 9513 const positions = ['top', 'right', 'bottom', 'left'] 9514 this.popover = component.hasAttribute('popover') 9515 this.notification = component.classList.contains('br-notification') 9516 this.timer = component.getAttribute('timer') 9517 let positionNotification = this.notification 9518 ? 'bottom' 9519 : 'top' 9520 this.active = component.hasAttribute('active') 9521 this.placement = positions.includes(place) 9522 ? place 9523 : positionNotification 9524 this.popperInstance = null 9525 this.showEvents = ['mouseenter', 'click', 'focus'] 9526 this.hideEvents = ['mouseleave', 'blur'] 9527 this.closeTimer = null 9528 9529 this._create() 9530 this._setBehavior() 9531 } 9532 9533 _setBehavior() { 9534 // Ação de abrir padrao ao entrar no ativador 9535 9536 if (this.activator) { 9537 this.showEvents.forEach((event) => { 9538 this.activator.addEventListener(event, (otherEvent) => { 9539 this._show(otherEvent) 9540 }) 9541 }) 9542 // } 9543 } 9544 // Adiciona ação de fechar ao botao do popover 9545 // if (this.popover || this.notification) { 9546 if (this.popover) { 9547 const closeBtn = this.component.querySelector('.close') 9548 closeBtn.addEventListener('click', (event) => { 9549 this._hide(event, this.component) 9550 this._toggleActivatorIcon() 9551 }) 9552 // Ação de fechar padrao ao sair do ativador 9553 } else { 9554 this.hideEvents.forEach((event) => { 9555 this.activator.addEventListener(event, (otherEvent) => { 9556 this._hide(otherEvent, this.component) 9557 }) 9558 }) 9559 } 9560 9561 } 9562 9563 _create() { 9564 this._setLayout() 9565 9566 9567 // Cria a instancia do popper 9568 if (this.notification) { 9569 this.component.setAttribute('notification', '') 9570 9571 this.popperInstance = (0,_popperjs_core__WEBPACK_IMPORTED_MODULE_0__/* .createPopper */ .fi)(this.activator, this.component, { 9572 modifiers: [ 9573 { 9574 name: 'offset', 9575 options: { 9576 offset: [0, 10], 9577 }, 9578 }, 9579 { 9580 name: 'preventOverflow', 9581 options: { 9582 altAxis: false, 9583 mainAxis: true, 9584 9585 }, 9586 }, 9587 ], 9588 placement: this.placement, 9589 9590 strategy: 'fixed', 9591 }) 9592 } else { 9593 let ac = new DOMRect() 9594 const tt = new DOMRect() 9595 9596 9597 9598 9599 9600 ac = this.activator.getBoundingClientRect() 9601 9602 9603 const bw = document.body.clientWidth 9604 if (this.placement === 'right') { 9605 this.placement = 9606 ac.x + ac.width + tt.width > bw ? 'top' : this.placement 9607 } 9608 if (this.placement === 'left') { 9609 this.placement = ac.x - tt.width > 0 ? this.placement : 'top' 9610 } 9611 9612 this.popperInstance = (0,_popperjs_core__WEBPACK_IMPORTED_MODULE_0__/* .createPopper */ .fi)(this.activator, this.component, { 9613 modifiers: [ 9614 { 9615 name: 'offset', 9616 options: { 9617 offset: [0, 8], 9618 }, 9619 }, 9620 { 9621 name: 'preventOverflow', 9622 options: { 9623 altAxis: true, 9624 mainAxis: true, 9625 tether: false, 9626 }, 9627 }, 9628 ], 9629 placement: this.placement, 9630 }) 9631 } 9632 } 9633 9634 _show(event) { 9635 this.component.style.display = 'unset' 9636 this.component.setAttribute('data-show', '') 9637 this.component.style.zIndex = 99 9638 this._fixPosition() 9639 9640 // 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 9641 9642 this.component.style.visibility = 'visible' 9643 if (this.timer) { 9644 clearTimeout(this.closeTimer) 9645 console.log("Timer",this.timer) 9646 this.closeTimer = setTimeout( 9647 this._hide, 9648 this.timer, 9649 event, 9650 this.component 9651 ) 9652 } 9653 } 9654 9655 _hide(event, component) { 9656 component.removeAttribute('data-show') 9657 component.style.zIndex = -1 9658 component.style.visibility = 'hidden' 9659 clearTimeout(component.closeTimer) 9660 } 9661 9662 _setLayout() { 9663 // Cria a setinha que aponta para o item que criou o tooltip 9664 const arrow = document.createElement('div') 9665 arrow.setAttribute('data-popper-arrow', '') 9666 9667 if (this.component.querySelectorAll('.arrow').length < 1) { 9668 arrow.classList.add('arrow') 9669 } 9670 this.component.appendChild(arrow) 9671 // Cria o icone de fechar do po over 9672 if (this.popover) { 9673 const close = document.createElement('button') 9674 close.setAttribute('type', 'button') 9675 close.classList.add('close') 9676 const ico = document.createElement('i') 9677 ico.classList.add('fas', 'fa-times') 9678 close.appendChild(ico) 9679 this.component.appendChild(close) 9680 } 9681 } 9682 9683 _toggleActivatorIcon() { 9684 const icon = this.activator.querySelector('button svg') 9685 if (icon) { 9686 icon.classList.toggle('fa-angle-down') 9687 icon.classList.toggle('fa-angle-up') 9688 } 9689 this.activator.toggleAttribute('active') 9690 } 9691 9692 _fixPosition() { 9693 if (this.notification) { 9694 setTimeout(() => { 9695 const ac = this.activator.getBoundingClientRect() 9696 this.component.style = `position: fixed !important; top: ${ 9697 ac.top + ac.height + 10 9698 }px !important; left: auto; right: 8px; display: unset; bottom: auto;` 9699 this.component.querySelector( 9700 '.arrow' 9701 ).style = `position: absolute; left: auto; right: ${ 9702 document.body.clientWidth - ac.right + ac.width / 5 9703 }px !important;` 9704 }, 10) 9705 } 9706 } 9707} 9708 9709/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRTooltip); 9710 9711 9712/***/ }), 9713 9714/***/ "./src/components/upload/upload.js": 9715/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 9716 9717"use strict"; 9718/* harmony export */ __webpack_require__.d(__webpack_exports__, { 9719/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 9720/* harmony export */ }); 9721/* harmony import */ var _components_tooltip_tooltip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/components/tooltip/tooltip.js"); 9722 9723/** Classe para instanciar um objeto BRUpload */ 9724class BRUpload { 9725 /** 9726 * @param {*} name nome do componente 9727 * @param {*} component componente 9728 * @param {*} uploadFiles promisse de status do upload 9729 */ 9730 constructor(name, component, uploadFiles) { 9731 this.name = name 9732 this.component = component 9733 this._inputElement = this.component.querySelector('.upload-input') 9734 this._fileList = this.component.querySelector('.upload-list') 9735 this._btnUpload = this.component.querySelector('.upload-button') 9736 this._label = this.component.querySelector('label') 9737 this._textHelp = document.querySelector('.text-base') 9738 this._fileArray = [] 9739 this._uploadFiles = uploadFiles 9740 this._setBehavior() 9741 } 9742 9743 /** 9744 * Define comportamentos do componente 9745 * @private 9746 */ 9747 _setBehavior() { 9748 if (this._inputElement) { 9749 const button = document.createElement('button') 9750 button.className = 'upload-button' 9751 button.setAttribute('type', 'button') 9752 9753 if (this._inputElement.getAttribute('multiple')) 9754 button.innerHTML = 9755 '<i class="fas fa-upload" aria-hidden="true"></i><span>Selecione o(s) arquivo(s)</span>' 9756 else 9757 button.innerHTML = 9758 '<i class="fas fa-upload" aria-hidden="true"></i><span>Selecione o arquivo</span>' 9759 9760 this.component.append(this._label) 9761 this.component.append(this._inputElement) 9762 this.component.appendChild(button) 9763 this.component.append(this._fileList) 9764 this._btnUpload = this.component.querySelector('.upload-button') 9765 this._btnUpload.addEventListener( 9766 'click', 9767 () => { 9768 this._clickUpload() 9769 }, 9770 false 9771 ) 9772 if (this.component.getAttribute('disabled')) { 9773 const message = document.createElement('span') 9774 message.classList.add('feedback', 'warning', 'mt-1') 9775 message.setAttribute('role', 'alert') 9776 message.innerHTML = 9777 '<i class="fas fa-exclamation-triangle" aria-hidden="true"></i>Upload desabilitado' 9778 this.component.after(message) 9779 } 9780 9781 this._fileArray = Array.from(this._inputElement.files) 9782 this._inputElement.addEventListener( 9783 'change', 9784 (event) => { 9785 this._handleFiles(event) 9786 }, 9787 false 9788 ) 9789 } 9790 9791 this._setDragAndDropBehavior() 9792 } 9793 9794 /** 9795 * Define comportamento de arrastar(drag) e posicionar(drop) 9796 * @private 9797 */ 9798 _setDragAndDropBehavior() { 9799 const uploadButton = this.component.querySelector('.upload-button') 9800 9801 ;['dragenter', 'dragover', 'dragleave', 'drop'].forEach((eventName) => { 9802 uploadButton.addEventListener(eventName, this._preventDefaults) 9803 }) 9804 ;['dragenter', 'dragover'].forEach((eventName) => { 9805 uploadButton.addEventListener(eventName, this._hightLight.bind(this)) 9806 }) 9807 ;['dragleave', 'drop'].forEach((eventName) => { 9808 uploadButton.addEventListener(eventName, this._unHightLight.bind(this)) 9809 }) 9810 9811 uploadButton.addEventListener('drop', this._handleDrop.bind(this)) 9812 } 9813 9814 /** 9815 * Evita os eventos padrao e propagação de evento 9816 * @private 9817 * @param {event} event - referencia ao evento 9818 */ 9819 _preventDefaults(event) { 9820 event.preventDefault() 9821 event.stopPropagation() 9822 } 9823 9824 _hightLight() { 9825 this.component.classList.add('dragging') 9826 } 9827 9828 _unHightLight() { 9829 this.component.classList.remove('dragging') 9830 } 9831 9832 /** 9833 * Ação de posicionar (drop) 9834 * @private 9835 * @param {event} event - referencia ao evento 9836 */ 9837 _handleDrop(event) { 9838 this.component.classList.remove('dragging') 9839 const dt = event.dataTransfer 9840 const { files } = dt 9841 this._handleFiles(files) 9842 } 9843 9844 /** 9845 * Testa se o objeto que disparou a ação está desabilitado 9846 * @private 9847 * @param {event} event - referencia ao evento 9848 */ 9849 _isDisabled(event) { 9850 const isDisabled = event.target.getAttribute('disabled') 9851 if (isDisabled) { 9852 return true 9853 } else { 9854 return false 9855 } 9856 } 9857 9858 /** 9859 * Simula ação de clicar no input 9860 * @private 9861 */ 9862 _clickUpload() { 9863 this._inputElement.click() 9864 } 9865 9866 /** 9867 * Limpa mensagem de feedback 9868 * @private 9869 */ 9870 _removeMessage() { 9871 for (const message of this.component.querySelectorAll('.feedback')) { 9872 message.parentNode.removeChild(message) 9873 message.innerHTML = '' 9874 } 9875 } 9876 9877 /** 9878 * Remove mensagem de estado 9879 * @private 9880 */ 9881 _removeStatus() {
vendor: 4,105 bytes, lines 9882-10027
9882 const remStatus = ['danger', 'warning', 'info', 'success'] 9883 remStatus.forEach((el) => { 9884 if (this.component.dataset.hasOwnProperty(el)) 9885 this.component.removeAttribute(`data-${el}`) 9886 }) 9887 } 9888 9889 /** 9890 * Define mensagem de feedback 9891 * @private 9892 * @param {string} status - estados: danger / info / success / warning 9893 */ 9894 _feedback(status, text) { 9895 const icone = `<i class="fas fa-times-circle" aria-hidden="true"></i>${text}` 9896 const dataStatus = `data-${status}` 9897 const message = document.createElement('span') 9898 message.classList.add('feedback', status, 'mt-1') 9899 message.setAttribute('role', 'alert') 9900 switch (status) { 9901 case 'danger': 9902 message.innerHTML = icone 9903 break 9904 case 'info': 9905 message.innerHTML = icone.replace('fa-times-circle', 'fa-info-circle') 9906 break 9907 case 'success': 9908 message.innerHTML = icone.replace('fa-times-circle', 'fa-check-circle') 9909 break 9910 case 'warning': 9911 message.innerHTML = icone.replace( 9912 'fa-times-circle', 9913 'fa-exclamation-triangle' 9914 ) 9915 break 9916 default: 9917 message.innerHTML = '' 9918 } 9919 this._removeStatus() 9920 this.component.setAttribute(dataStatus, dataStatus) 9921 this._fileList.before(message) 9922 } 9923 9924 /** 9925 * Adiciona arquivos a lista 9926 * @private 9927 * @param {File[]} files - lista de arquivos 9928 */ 9929 _concatFiles(files) { 9930 const newFiles = !files.length 9931 ? Array.from(this._inputElement.files) 9932 : Array.from(files) 9933 this._fileArray = this._fileArray.concat(newFiles) 9934 } 9935 9936 /** 9937 * Adiciona arquivos a lista 9938 * @private 9939 * @param {File[]} files - lista de arquivos 9940 */ 9941 _handleFiles(files) { 9942 this._removeMessage() 9943 if (!this._inputElement.multiple && files.length > 1) { 9944 this._feedback('danger', 'à permitido o envio de somente 1 arquivo.') 9945 } else if (!this._inputElement.multiple && this._fileArray.length > 0) { 9946 this._fileArray = [] 9947 this._concatFiles(files) 9948 this._updateFileList() 9949 this._feedback( 9950 'warning', 9951 'O arquivo enviado anteriormente foi substituÃdo' 9952 ) 9953 } else { 9954 this._concatFiles(files) 9955 this._updateFileList() 9956 } 9957 } 9958 9959 /** 9960 * Atualiza lista de arquivos eliminando redundâncias 9961 * @private 9962 */ 9963 _updateFileList() { 9964 this._removeStatus() 9965 if (this.component.nextElementSibling === this._textHelp) { 9966 this._textHelp.style.display = 'none' 9967 } 9968 if (!this._fileArray.length) { 9969 this._fileList.innerHTML = '' 9970 if (this.component.nextElementSibling === this._textHelp) { 9971 this._textHelp.style.display = '' 9972 } 9973 } else { 9974 this._fileList.innerHTML = '' 9975 9976 for (let i = 0; i < this._fileArray.length; i++) { 9977 if ('nowait' in this._fileArray[i]) { 9978 if (this._fileArray[i].nowait) { 9979 this._renderItem(i) 9980 } 9981 } else if (!this._fileArray[i].requested) { 9982 this.uploadLoading() 9983 this.uploadingFile(i) 9984 } 9985 } 9986 } 9987 } 9988 9989 /** 9990 * Mostra mensagem de carregamento 9991 * @private 9992 */ 9993 uploadLoading() { 9994 const loading = document.createElement('div') 9995 const carga = document.createElement('span') 9996 carga.classList.add('cargas') 9997 carga.innerText = 'Carregando...' 9998 loading.setAttribute('sm', '') 9999 loading.classList.add('my-3') 10000 loading.setAttribute('loading', '') 10001 loading.appendChild(carga) 10002 this._fileList.appendChild(loading) 10003 } 10004 10005 /** 10006 * Faz upload de arquivo na posição definida 10007 * @private 10008 * @param {Number} position - numero do Ãnidice da posição 10009 */ 10010 uploadingFile(position) { 10011 if (this._uploadFiles) { 10012 this._fileArray[position].requested = true 10013 this._uploadFiles().then(() => { 10014 this._fileArray[position].nowait = true 10015 this._updateFileList() 10016 }) 10017 } 10018 } 10019 10020 /** 10021 * Renderiza item na posição definida 10022 * @private 10023 * @param {Number} position - numero do Ãnidice da posição 10024 */ 10025 _renderItem(position) { 10026 const li = document.createElement('div') 10027 li.className = 'br-item d-flex'
10028 this._fileList.appendChild(li) 10029 li.innerHTML = '' 10030 const name = document.createElement('div') 10031 name.className = 'name' 10032 li.appendChild(name) 10033 this._fileList.appendChild(li) 10034 const info = document.createElement('div') 10035 info.className = 'content' 10036 info.innerHTML = this._fileArray[position].name 10037 const tooltip = document.createElement('div') 10038 tooltip.classList.add('br-tooltip') 10039 tooltip.setAttribute('role', 'tooltip') 10040 tooltip.setAttribute('place', 'top') 10041 tooltip.setAttribute('info', 'info') 10042 const textTooltip = document.createElement('span') 10043 textTooltip.classList.add('text') 10044 textTooltip.setAttribute('role', 'tooltip') 10045 textTooltip.innerHTML = this._fileArray[position].name 10046 tooltip.appendChild(textTooltip) 10047 li.appendChild(info) 10048 li.appendChild(name) 10049 li.appendChild(tooltip) 10050 info.classList.add('text-primary-default', 'mr-auto') 10051 const del = document.createElement('div') 10052 del.className = 'support mr-n2' 10053 const btndel = document.createElement('button') 10054 const spanSize = document.createElement('span') 10055 spanSize.className = 'mr-1' 10056 spanSize.innerHTML = this._calcSize(this._fileArray[position].size) 10057 del.appendChild(spanSize) 10058 btndel.className = 'br-button' 10059 btndel.type = 'button' 10060 btndel.setAttribute('circle', '') 10061 btndel.addEventListener( 10062 'click', 10063 (event) => { 10064 this._removeFile(position, event) 10065 }, 10066 false 10067 ) 10068 const img = document.createElement('i') 10069 img.className = 'fa fa-trash' 10070 btndel.appendChild(img) 10071 del.appendChild(btndel) 10072 li.appendChild(del) 10073 this._fileArray[position].nowait = true 10074 const tooltipList = [] 10075 for (const brTooltip of window.document.querySelectorAll('.br-tooltip')) { 10076 tooltipList.push(new _components_tooltip_tooltip__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z('br-tooltip', brTooltip)) 10077 } 10078 } 10079 10080 /** 10081 * Formata tamanho do arquivo 10082 * @private 10083 * @param {Number} nBytes - quantidade de bytes do arquivo 10084 */ 10085 _calcSize(nBytes) { 10086 let sOutput = '' 10087 for ( 10088 let aMultiples = ['KB', 'MB', 'GB', 'TB'], 10089 nMultiple = 0, 10090 nApprox = nBytes / 1024; 10091 nApprox > 1; 10092 nApprox /= 1024, nMultiple++ 10093 ) { 10094 sOutput = `${nApprox.toFixed(2)} ${aMultiples[nMultiple]}` 10095 } 10096 return sOutput 10097 } 10098 10099 /** 10100 * Remove arquivo na posição definida 10101 * @private 10102 * @param {Number} index - numero do Ãnidice da posição 10103 * @param {event} event - evento que disparou a ação 10104 */ 10105 _removeFile(index, event) { 10106 event.stopPropagation() 10107 event.preventDefault() 10108 this._removeStatus() 10109 this._removeMessage() 10110 this._fileArray.splice(index, 1) 10111 this._updateFileList() 10112 10113 if (this._inputElement.multiple) 10114 this._inputElement.files = this._updateFileListItems(this._fileArray) 10115 if (!this._inputElement.multiple) this._inputElement.value = '' 10116 } 10117 10118 /** 10119 * Atualiza arquivos da lista 10120 * @private 10121 * @param {File[]} files - lista de arquivos 10122 */ 10123 _updateFileListItems(files) { 10124 const fileInput = new ClipboardEvent('').clipboardData || new DataTransfer() 10125 for (let i = 0, len = files.length; i < len; i++) 10126 fileInput.items.add(files[i]) 10127 return fileInput.files 10128 } 10129} 10130 10131/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRUpload); 10132 10133 10134/***/ }), 10135
vendor: 29,312 bytes, lines 10136-11181
10136/***/ "./src/components/wizard/wizard.js": 10137/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 10138 10139"use strict"; 10140/* harmony export */ __webpack_require__.d(__webpack_exports__, { 10141/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 10142/* harmony export */ }); 10143/* harmony import */ var _partial_js_behavior_swipe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/partial/js/behavior/swipe.js"); 10144 10145 10146/** Classe para instanciar um objeto BRWizard*/ 10147class BRWizard { 10148 /** 10149 * Instância do componente 10150 * @param {string} name - nome do componente 10151 * @param {object} component - referencia ao objeto do DOM 10152 **/ 10153 constructor(name, component) { 10154 this.name = name 10155 this.component = component 10156 this.DOMstrings = { 10157 stepFormPanelClass: 'wizard-panel', 10158 stepFormPanels: this.component.querySelectorAll('.wizard-panel'), 10159 stepNextBtnClass: 'wizard-btn-next', 10160 stepPrevBtnClass: 'wizard-btn-prev', 10161 stepsBar: this.component.querySelector('.wizard-progress'), 10162 stepsBarClass: 'wizard-progress', 10163 stepsBtnClass: 'wizard-progress-btn', 10164 stepsBtns: this.component.querySelectorAll('.wizard-progress-btn'), 10165 stepsForm: this.component.querySelector('.wizard-form'), 10166 } 10167 /** 10168 * Retira o atributo de uma lista de elementos 10169 * @param {object[]} elementSet - Lista de objetos 10170 * @param {string} attrName - Nome do atribbuto 10171 */ 10172 this.removeAttributes = (elemSet, attrName) => { 10173 elemSet.forEach((elem) => { 10174 elem.removeAttribute(attrName) 10175 }) 10176 } 10177 10178 /** 10179 * Retorna o elemento pai do objeto com a classe de referência 10180 * @param {object} elem - Lista de objetos 10181 * @param {string} parentClass - nome da classe de referência 10182 * @returns {object} 10183 */ 10184 this.findParent = (elem, parentClass) => { 10185 let currentNode = elem 10186 while (!currentNode.classList.contains(parentClass)) { 10187 currentNode = currentNode.parentNode 10188 } 10189 return currentNode 10190 } 10191 10192 /** 10193 * Retorna o Ãndice do elemento botão de passo 10194 * @param {object} elem - botão de passo 10195 * @returns {number} 10196 */ 10197 this.getActiveStep = (elem) => { 10198 return Array.from(this.DOMstrings.stepsBtns).indexOf(elem) 10199 } 10200 10201 /** 10202 * Define o estado do botão ativo e limpa os demais estados dos botões 10203 * @param {number} activeStepNum - número do botão ativo 10204 */ 10205 this.setActiveStep = function (activeStepNum) { 10206 this.removeAttributes(this.DOMstrings.stepsBtns, 'active') 10207 this.DOMstrings.stepsBtns.forEach((elem, index) => { 10208 if (index === activeStepNum) { 10209 elem.removeAttribute('disabled') 10210 elem.setAttribute('active', '') 10211 } 10212 }) 10213 } 10214 10215 /** 10216 * Retorna o Ãndice do painel ativo 10217 * @returns {number} 10218 */ 10219 this.getActivePanel = () => { 10220 let activePanel 10221 this.DOMstrings.stepFormPanels.forEach((elem) => { 10222 if (elem.hasAttribute('active')) { 10223 activePanel = elem 10224 } 10225 }) 10226 return activePanel 10227 } 10228 10229 /** 10230 * Abre o painel ativo e fecha paineis inativos 10231 * @param {number} activePanelNum - numero do painel 10232 */ 10233 this.setActivePanel = (activePanelNum) => { 10234 // remove active class from all the panels 10235 this.removeAttributes(this.DOMstrings.stepFormPanels, 'active') 10236 // show active panel 10237 this.DOMstrings.stepFormPanels.forEach((elem, index) => { 10238 if (index === activePanelNum) { 10239 elem.setAttribute('active', '') 10240 } 10241 }) 10242 } 10243 10244 /** 10245 * Define números dos passos 10246 */ 10247 this.setStepsNum = () => { 10248 this.DOMstrings.stepsBtns.forEach((elem, index) => { 10249 elem.setAttribute('step', index + 1) 10250 }) 10251 } 10252 10253 /** 10254 * Define passo e painel ativo 10255 * @param {number} num - numero do passo 10256 */ 10257 this.setStep = (num) => { 10258 const activeStep = num <= this.DOMstrings.stepsBtns.length ? num - 1 : 0 10259 this.setActiveStep(activeStep) 10260 this.setActivePanel(activeStep) 10261 } 10262 10263 /** 10264 * Retrai painel de passos 10265 */ 10266 this.collapseSteps = () => { 10267 this.component.setAttribute('collapsed', '') 10268 } 10269 10270 /** 10271 * Expande painel de passos 10272 */ 10273 this.expandSteps = () => { 10274 this.component.removeAttribute('collapsed') 10275 } 10276 10277 this._setBehavior() 10278 } 10279 10280 /** 10281 * Define os comportamentos do componente 10282 * @private 10283 */ 10284 _setBehavior() { 10285 /** 10286 * Mapeia clique na barra de passos 10287 */ 10288 this.DOMstrings.stepsBar.addEventListener('click', (e) => { 10289 const eventTarget = e.target 10290 if (!eventTarget.classList.contains(`${this.DOMstrings.stepsBtnClass}`)) { 10291 e.target.parentNode.click() 10292 return 10293 } 10294 const activeStep = this.getActiveStep(eventTarget) 10295 this.setActiveStep(activeStep) 10296 this.setActivePanel(activeStep) 10297 }) 10298 10299 /** 10300 * Mapeia clique nos botões de navegação 10301 */ 10302 this.DOMstrings.stepsForm.addEventListener('click', (e) => { 10303 const eventTarget = e.target 10304 if ( 10305 !( 10306 eventTarget.classList.contains( 10307 `${this.DOMstrings.stepPrevBtnClass}` 10308 ) || 10309 eventTarget.classList.contains(`${this.DOMstrings.stepNextBtnClass}`) 10310 ) 10311 ) { 10312 return 10313 } 10314 const activePanel = this.findParent( 10315 eventTarget, 10316 `${this.DOMstrings.stepFormPanelClass}` 10317 ) 10318 let activePanelNum = Array.from(this.DOMstrings.stepFormPanels).indexOf( 10319 activePanel 10320 ) 10321 if ( 10322 eventTarget.classList.contains(`${this.DOMstrings.stepPrevBtnClass}`) 10323 ) { 10324 activePanelNum -= 1 10325 activePanel.style.left = '1%' 10326 } else { 10327 activePanelNum += 1 10328 activePanel.style.left = '-1%' 10329 } 10330 this.setActiveStep(activePanelNum) 10331 this.setActivePanel(activePanelNum) 10332 }) 10333 10334 this.setStepsNum() 10335 10336 if (this.component.hasAttribute('step')) { 10337 this.setStep(this.component.getAttribute('step')) 10338 } 10339 10340 if ( 10341 this.component.hasAttribute('scroll') && 10342 !this.component.hasAttribute('vertical') 10343 ) { 10344 const stepsWidth = 10345 Math.round(100 / this.DOMstrings.stepsBtns.length) - 0.5 10346 this.DOMstrings.stepsBar.style.gridTemplateColumns = `repeat(auto-fit, minmax(100px, ${stepsWidth}% ))` 10347 } 10348 10349 /** 10350 * Configura gestos (swipe) 10351 */ 10352 const dispatcher = new _partial_js_behavior_swipe__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z(this.DOMstrings.stepsBar) 10353 if (this.component.hasAttribute('vertical')) { 10354 dispatcher.on('SWIPE_LEFT', () => { 10355 this.collapseSteps() 10356 }) 10357 dispatcher.on('SWIPE_RIGHT', () => { 10358 this.expandSteps() 10359 }) 10360 this.DOMstrings.stepsForm.ontouchstart = () => { 10361 this.collapseSteps() 10362 } 10363 } else { 10364 this.DOMstrings.stepsBar.ontouchstart = () => { 10365 this.expandSteps() 10366 } 10367 this.DOMstrings.stepsForm.ontouchstart = () => { 10368 this.collapseSteps() 10369 } 10370 } 10371 } 10372} 10373 10374/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BRWizard); 10375 10376 10377/***/ }), 10378 10379/***/ "./src/partial/js/behavior/accordion.js": 10380/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 10381 10382"use strict"; 10383/* harmony export */ __webpack_require__.d(__webpack_exports__, { 10384/* harmony export */ "default": () => (/* binding */ Accordion) 10385/* harmony export */ }); 10386/* harmony import */ var _collapse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/partial/js/behavior/collapse.js"); 10387 10388 10389/** 10390 * Classe para o comportamento Accordion. 10391 * O Comportamento Accordion é um agrupador de comportamentos Collapse 10392 */ 10393class Accordion extends _collapse__WEBPACK_IMPORTED_MODULE_0__["default"] { 10394 /** 10395 * Instancia um comportamento accordion 10396 * @param {object} - Objeto de configuração inicial para destructuring 10397 * @property {object} trigger - Elemento DOM que representa o acionador do comportmento accordion 10398 * @property {string} iconToShow - Classe que representa o Ãcone para mostrar o conteúdo (padrão: fa-chevron-down) 10399 * @property {string} iconToHide - Classe que representa o Ãcone para esconder o conteúdo (padrão: fa-chevron-up) 10400 * @property {boolean} useIcons - true: com Ãcone | false: sem Ãcone (padrão: true) 10401 */ 10402 constructor({ 10403 trigger, 10404 iconToShow = 'fa-chevron-down', 10405 iconToHide = 'fa-chevron-up', 10406 useIcons = true, 10407 }) { 10408 super({ iconToHide, iconToShow, trigger, useIcons }) 10409 this._setUp() 10410 } 10411 10412 /** 10413 * Trata a configuração inicial do comportamento accordion 10414 * @private 10415 */ 10416 _setUp() { 10417 super._setUp() 10418 this._setPriorityVisibility() 10419 } 10420 10421 /** 10422 * Determina qual acionador vai estar visivel, caso mais de 1 acionador esteja visivel no grupo. 10423 * Prioridade de cima para baixo 10424 * @private 10425 */ 10426 _setPriorityVisibility() { 10427 for (let i = 0; i < this._getGroup().length; i += 1) { 10428 if (this._getGroup()[i].dataset.visible === 'true') { 10429 this._synchronizeAccordion(this._getGroup()[i]) 10430 break 10431 } 10432 } 10433 } 10434 10435 /** 10436 * Obtém todos os acionadores pertencentes ao grupo do comportamento accordion 10437 * @returns {array} - Conjunto de elementos DOM representando os acionadores pertencentes ao grupo do comportamento accordion 10438 * @private 10439 */ 10440 _getGroup() { 10441 return document.querySelectorAll( 10442 `[data-group="${this.trigger.getAttribute('data-group')}"]` 10443 ) 10444 } 10445 10446 /** 10447 * Handler para o evento 'change' do acionador 10448 * @param {object} event - Objeto do tipo Event 10449 * @private 10450 */ 10451 _handleTriggerChangeBehavior(event) { 10452 if (!event.currentTarget.hasAttribute('data-sync')) { 10453 this._synchronizeAccordion(event.currentTarget) 10454 } else { 10455 event.currentTarget.removeAttribute('data-sync') 10456 } 10457 } 10458 10459 /** 10460 * Sincroniza o grupo de accordion mostrando 1 elemento aberto por vez 10461 * @param {object} currentTrigger - Elemento DOM representando um acionador do comportamento accordion 10462 * @private 10463 */ 10464 _synchronizeAccordion(currentTrigger) { 10465 this._getGroup().forEach((trigger) => { 10466 if (trigger !== currentTrigger && trigger.dataset.visible === 'true') { 10467 trigger.setAttribute('data-sync', '') 10468 trigger.click() 10469 } 10470 }) 10471 } 10472 10473 /** 10474 * Configura o comportamento accordion 10475 * @public 10476 */ 10477 setBehavior() { 10478 super.setBehavior() 10479 this.trigger.addEventListener( 10480 'change', 10481 this._handleTriggerChangeBehavior.bind(this) 10482 ) 10483 } 10484} 10485 10486 10487/***/ }), 10488 10489/***/ "./src/partial/js/behavior/checkgroup.js": 10490/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 10491 10492"use strict"; 10493/* harmony export */ __webpack_require__.d(__webpack_exports__, { 10494/* harmony export */ "default": () => (/* binding */ Checkgroup) 10495/* harmony export */ }); 10496/** 10497 * Comportamento do grupo de checkboxes 10498 * 10499 * Cada checkbox parent em uma cadeia de checkbox terá um objeto próprio para tratar 10500 * o seu comportamento e de seus filhos. Os eventListeners são declarados em cada objeto, 10501 * de modo que a execução passa por objetos diferentes quando um checkbox é pai e filho ao mesmo tempo 10502 * 10503 * O comportamento é uma sincronia entre os eventos e o objeto que executa o evento 10504 */ 10505class Checkgroup { 10506 /** 10507 * Instancia um comportamento de grupo de checkbox 10508 * @param {object} trigger - Elemento DOM que representa o checkbox acionador do comportamento 10509 */ 10510 constructor(trigger) { 10511 this.parent = trigger 10512 // this.checkedLabel = trigger.dataset.checkedLabel 10513 // this.uncheckedLabel = trigger.dataset.uncheckedLabel 10514 this.children = this._setChildren(trigger.dataset.parent) 10515 } 10516 10517 /** 10518 * Pega dinamincamente o valor do atributo data-checked-label 10519 * @type {string} - O valor do atributo data-checked-label ou o valor da label, caso não tenha o atributo 10520 * @readonly 10521 * @public 10522 */ 10523 get checkedLabel() { 10524 return ( 10525 this.parent.dataset.checkedLabel || 10526 this.parent.nextElementSibling.innerText 10527 ) 10528 } 10529 10530 /** 10531 * Pega dinamincamente o valor do atributo data-unchecked-label 10532 * @type {string} - O valor do atributo data-unchecked-label ou o valor da label, caso não tenha o atributo 10533 * @readonly 10534 * @public 10535 */ 10536 get uncheckedLabel() { 10537 return ( 10538 this.parent.dataset.uncheckedLabel || 10539 this.parent.nextElementSibling.innerText 10540 ) 10541 } 10542 10543 /** 10544 * Configurar o comportamento do grupo de checkbox 10545 * @public 10546 */ 10547 setBehavior() { 10548 this._setParentBehavior() 10549 this._setChildBehavior() 10550 } 10551 10552 /** 10553 * Obtem todos os checkboxes filhos do checkbox pai 10554 * @param {string} tag - Nome que indica a relação entre checkbox pai e checkbox filho 10555 * @returns {array} - Array contendo os elementos DOM que representam os checkboxes filhos. 10556 */ 10557 _setChildren(tag) { 10558 return document.querySelectorAll(`[data-child="${tag}"]`) 10559 } 10560 10561 /** 10562 * Trata do comportamento do checkbox pai 10563 * @private 10564 */ 10565 _setParentBehavior() { 10566 this.parent.addEventListener('click', this._handleParentClick.bind(this)) 10567 this.parent.addEventListener('change', this._handleParentChange.bind(this)) 10568 } 10569 10570 /** 10571 * Handler que trata o evento click no parent 10572 * @private 10573 */ 10574 _handleParentClick() { 10575 if (!this.parent.hasAttribute('data-parent-sync')) { 10576 this._setIndeterminateStateOnClick() 10577 } 10578 this._setParentCheckboxLabel() 10579 } 10580 10581 /** 10582 * Trata o estado indeterminado no evento click da etapa de interação do usuário 10583 * @private 10584 */ 10585 _setIndeterminateStateOnClick() { 10586 if (this.parent.hasAttribute('indeterminate')) { 10587 this.parent.removeAttribute('indeterminate') 10588 this.parent.checked = true 10589 } 10590 } 10591 10592 /** 10593 * Handler que trata o evento change no parent 10594 * @private 10595 */ 10596 _handleParentChange() { 10597 if (!this.parent.hasAttribute('data-parent-sync')) { 10598 this._changeChildState() 10599 this._setParentCheckboxLabel() 10600 } else { 10601 this.parent.removeAttribute('data-parent-sync') 10602 } 10603 } 10604 10605 /** 10606 * Trata do estado do checkboxes filhos 10607 * @private 10608 */ 10609 _changeChildState() { 10610 this.children.forEach((child) => { 10611 if ( 10612 child.checked !== this.parent.checked || 10613 child.hasAttribute('indeterminate') 10614 ) { 10615 child.removeAttribute('indeterminate') 10616 child.checked = this.parent.checked 10617 child.dispatchEvent(new Event('change')) 10618 } 10619 }) 10620 } 10621 10622 /** 10623 * Trata do comportamento dos checkboxes filhos 10624 * @private 10625 */ 10626 _setChildBehavior() { 10627 this.children.forEach((child) => { 10628 child.addEventListener('click', this._handleChildClick.bind(this)) 10629 child.addEventListener('change', this._handleChildChange.bind(this)) 10630 }) 10631 } 10632 10633 /** 10634 * Handler que trata do evento click no filho 10635 * @param {object} event - Objeto Event 10636 * @private 10637 */ 10638 _handleChildClick(event) { 10639 event.currentTarget.setAttribute('data-child-sync', '') 10640 } 10641 10642 /** 10643 * Handler que trata do evento change no filho 10644 * @param {object} event - Objeto Event 10645 * @private 10646 */ 10647 _handleChildChange(event) { 10648 if (event.currentTarget.hasAttribute('data-child-sync')) { 10649 this._setIndeterminateStateOnChildChange() 10650 this.parent.setAttribute('data-parent-sync', '') 10651 this.parent.dispatchEvent(new Event('click')) 10652 this.parent.dispatchEvent(new Event('change')) 10653 event.currentTarget.removeAttribute('data-child-sync') 10654 } 10655 } 10656 10657 /** 10658 * Trata o estado indeterminado no evento click da etapa de sincronia 10659 * @private 10660 */ 10661 _setIndeterminateStateOnChildChange() { 10662 if (this._isAllChildrenChecked()) { 10663 this.parent.removeAttribute('indeterminate') 10664 this.parent.checked = true 10665 } else if (this._isAllChildrenUnchecked()) { 10666 this.parent.removeAttribute('indeterminate') 10667 this.parent.checked = false 10668 } else { 10669 this.parent.setAttribute('indeterminate', '') 10670 this.parent.checked = true 10671 } 10672 } 10673 10674 /** 10675 * Verifica se todos os checkboxes filhos estão selecionados 10676 * @returns {boolean} - true se todos os checkboxes filhos estão selecionados 10677 * false se pelo menos 1 checkbox filho não está selecionado 10678 * @private 10679 */ 10680 _isAllChildrenChecked() { 10681 let allChildChecked = true 10682 this.children.forEach((child) => { 10683 if (!child.checked || child.hasAttribute('indeterminate')) { 10684 allChildChecked = false 10685 } 10686 }) 10687 return allChildChecked 10688 } 10689 10690 /** 10691 * Verifica se todos so checkboxes filhos estão desselecionados 10692 * @returns {boolean} - true se todos os checkboxes filhos estão desselecionados 10693 * false se pelo menos 1 checkbox filho está selecionado 10694 * @private 10695 */ 10696 _isAllChildrenUnchecked() { 10697 let allChildUnchecked = true 10698 this.children.forEach((child) => { 10699 if (child.checked) { 10700 allChildUnchecked = false 10701 } 10702 }) 10703 return allChildUnchecked 10704 } 10705 10706 /** 10707 * Configura a label do checkbox pai 10708 * @private 10709 */ 10710 _setParentCheckboxLabel() { 10711 if (this.parent.checked && !this.parent.hasAttribute('indeterminate')) { 10712 this.parent.nextElementSibling.innerHTML = this.uncheckedLabel 10713 this.parent.setAttribute('aria-label', this.uncheckedLabel) 10714 } else { 10715 this.parent.nextElementSibling.innerHTML = this.checkedLabel 10716 this.parent.setAttribute('aria-label', this.checkedLabel) 10717 } 10718 } 10719} 10720 10721 10722/***/ }), 10723 10724/***/ "./src/partial/js/behavior/collapse.js": 10725/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 10726 10727"use strict"; 10728/* harmony export */ __webpack_require__.d(__webpack_exports__, { 10729/* harmony export */ "default": () => (/* binding */ Collapse) 10730/* harmony export */ }); 10731/** Classe para o comportamento Collapse */ 10732class Collapse { 10733 /** 10734 * Instancia um comportamento collapse 10735 * @param {object} - Objeto de configuração inicial para destructuring 10736 * @property {object} trigger - Elemento DOM que representa o acionador do comportmento collapse 10737 * @property {string} iconToShow - Classe que representa o Ãcone para mostrar o conteúdo (padrão: fa-chevron-down) 10738 * @property {string} iconToHide - Classe que representa o Ãcone para esconder o conteúdo (padrão: fa-chevron-up) 10739 * @property {boolean} useIcons - true: com Ãcone | false: sem Ãcone (padrão: true) 10740 */ 10741 constructor({ 10742 trigger, 10743 iconToShow = 'fa-chevron-down', 10744 iconToHide = 'fa-chevron-up', 10745 useIcons = true, 10746 }) { 10747 this.trigger = trigger 10748 this.useIcons = useIcons 10749 this.breakpoint = trigger.getAttribute('data-breakpoint') 10750 this.setIconToShow(iconToShow) 10751 this.setIconToHide(iconToHide) 10752 this._setTarget() 10753 this._setUp() 10754 } 10755 10756 /** 10757 * Determina qual elemento DOM é o alvo do comportamento collapse 10758 * @private 10759 */ 10760 _setTarget() { 10761 this.target = document.querySelector( 10762 `#${this.trigger.getAttribute('data-target')}` 10763 ) 10764 } 10765 10766 // TODO: Melhorar a solução 10767 _checkBreakpoint() { 10768 if (this.breakpoint) { 10769 if (window.matchMedia('(min-width: 977px)').matches) { 10770 this.target.removeAttribute('hidden') 10771 } 10772 } 10773 } 10774 10775 /** 10776 * Trata a configuração inicial do comportamento collapse 10777 * @private 10778 */ 10779 _setUp() { 10780 this._setVisibilityStatus() 10781 if (this.useIcons) { 10782 this._toggleIcon() 10783 } 10784 this.trigger.setAttribute( 10785 'aria-controls', 10786 `${this.trigger.getAttribute('data-target')}` 10787 ) 10788 this._checkBreakpoint() 10789 } 10790 10791 /** 10792 * Configura o estado de visualização do comportamento collapse 10793 * @private 10794 */ 10795 _setVisibilityStatus() { 10796 this._setTriggerVisibilityStatus() 10797 this._setTargetVisibilityStatus() 10798 } 10799 10800 /** 10801 * Trata o estado de visualização do acionador 10802 * @private 10803 */ 10804 _setTriggerVisibilityStatus() { 10805 if (this.target) { 10806 if (this.target.hasAttribute('hidden')) { 10807 this.trigger.setAttribute('data-visible', false) 10808 this.trigger.setAttribute('aria-expanded', false) 10809 } else { 10810 this.trigger.setAttribute('data-visible', true) 10811 this.trigger.setAttribute('aria-expanded', true) 10812 } 10813 } 10814 } 10815 10816 /** 10817 * Trata o estado de visualização do alvo 10818 * @private 10819 */ 10820 _setTargetVisibilityStatus() { 10821 if (this.target) { 10822 if (this.target.hasAttribute('hidden')) { 10823 this.target.setAttribute('aria-hidden', true) 10824 } else { 10825 this.target.setAttribute('aria-hidden', false) 10826 } 10827 } 10828 } 10829 10830 /** 10831 * Handler para o evento de click no acionador do comportamento collapse 10832 * Lança um evento 'change' a cada troca 10833 * @private 10834 */ 10835 _handleTriggerClickBehavior() { 10836 if (this.breakpoint) { 10837 if (window.matchMedia('(max-width: 977px)').matches) { 10838 this._toggleVisibility() 10839 if (this.useIcons) { 10840 this._toggleIcon() 10841 } 10842 this.trigger.dispatchEvent(new Event('change')) 10843 } 10844 } else { 10845 this._toggleVisibility() 10846 if (this.useIcons) { 10847 this._toggleIcon() 10848 } 10849 this.trigger.dispatchEvent(new Event('change')) 10850 } 10851 } 10852 10853 /** 10854 * Alterna o estado de visualização do comportamento collapse 10855 * @private 10856 */ 10857 _toggleVisibility() { 10858 if (this.target) { 10859 this.target.hasAttribute('hidden') 10860 ? this.target.removeAttribute('hidden') 10861 : this.target.setAttribute('hidden', '') 10862 10863 this._setVisibilityStatus() 10864 } 10865 } 10866 10867 /** 10868 * Troca o icone do acionador após uma mudança no estado de visualização do alvo 10869 * Para o estado 'hidden' usa o iconToShow e para o estado 'shown' usa o iconToHide 10870 * @public 10871 */ 10872 _toggleIcon() { 10873 this.trigger.querySelectorAll('i.fas').forEach((icon) => { 10874 if (this.target) { 10875 icon.classList.remove( 10876 this.target.hasAttribute('hidden') ? this.iconToHide : this.iconToShow 10877 ) 10878 icon.classList.add( 10879 this.target.hasAttribute('hidden') ? this.iconToShow : this.iconToHide 10880 ) 10881 } 10882 }) 10883 } 10884 10885 /** 10886 * Configura o comportamento collapse 10887 * @public 10888 */ 10889 setBehavior() { 10890 this.trigger.addEventListener( 10891 'click', 10892 this._handleTriggerClickBehavior.bind(this) 10893 ) 10894 } 10895 10896 /** 10897 * Determina a classe do icone para mostrar o conteúdo 10898 * @param {string} iconToShow - Classe que representa o Ãcone para mostrar o conteúdo 10899 * @public 10900 */ 10901 setIconToShow(iconToShow) { 10902 this.iconToShow = iconToShow 10903 } 10904 10905 /** 10906 * Determina a classe do Ãcone para esconder o conteúdo 10907 * @param {string} iconToHide - Classe que representa o Ãcone para esconder o conteúdo 10908 * @public 10909 */ 10910 setIconToHide(iconToHide) { 10911 this.iconToHide = iconToHide 10912 } 10913} 10914 10915 10916/***/ }), 10917 10918/***/ "./src/partial/js/behavior/dropdown.js": 10919/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 10920 10921"use strict"; 10922/* harmony export */ __webpack_require__.d(__webpack_exports__, { 10923/* harmony export */ "default": () => (/* binding */ Dropdown) 10924/* harmony export */ }); 10925/* harmony import */ var _collapse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/partial/js/behavior/collapse.js"); 10926 10927 10928/** 10929 * Classe para o comportamento Dropdown. 10930 * O Comportamento Dropdown é um caso especial do comportamentos Collapse 10931 * em que o alvo aparece flutuando na tela. 10932 * Nesse caso o alvo precisa filho de um elemento pai 10933 */ 10934class Dropdown extends _collapse__WEBPACK_IMPORTED_MODULE_0__["default"] { 10935 /** 10936 * Instancia um comportamento accordion 10937 * @param {object} - Objeto de configuração inicial para destructuring 10938 * @property {object} trigger - Elemento DOM que representa o acionador do comportmento accordion 10939 * @property {string} iconToShow - Classe que representa o Ãcone para mostrar o conteúdo (padrão: fa-chevron-down) 10940 * @property {string} iconToHide - Classe que representa o Ãcone para esconder o conteúdo (padrão: fa-chevron-up) 10941 * @property {boolean} useIcons - true: com Ãcone | false: sem Ãcone (padrão: true) 10942 */ 10943 constructor({ 10944 trigger, 10945 iconToShow = 'fa-chevron-down', 10946 iconToHide = 'fa-chevron-up', 10947 useIcons = true, 10948 }) { 10949 super({ iconToHide, iconToShow, trigger, useIcons }) 10950 } 10951 10952 /** 10953 * Trata a configuração inicial do comportamento dropdown 10954 * @override 10955 * @private 10956 */ 10957 _setUp() { 10958 super._setUp() 10959 this._hideDropdown() 10960 } 10961 10962 /** 10963 * Oculta o dropdown ao clicar fora do acionador e do alvo 10964 * @private 10965 */ 10966 _hideDropdown() { 10967 document.addEventListener('mousedown', (event) => { 10968 if ( 10969 !this.trigger.contains(event.target) && 10970 !this.target.hasAttribute('hidden') && 10971 !this.target.contains(event.target) 10972 ) { 10973 this.trigger.click() 10974 } 10975 }) 10976 } 10977 10978 /** 10979 * Marca o alvo com o atributo data-dropdown 10980 * @override 10981 * @private 10982 */ 10983 _setTargetVisibilityStatus() { 10984 super._setTargetVisibilityStatus() 10985 if (this.target.hasAttribute('hidden')) { 10986 this.target.removeAttribute('data-dropdown') 10987 } else { 10988 this.target.setAttribute('data-dropdown', '') 10989 } 10990 } 10991 10992 /** 10993 * Trata o estado de visualização do pai do alvo 10994 * @private 10995 */ 10996 _setParentsTargetVisibilityStatus() { 10997 if (this.target.hasAttribute('hidden')) { 10998 this.target.parentElement.classList.remove('dropdown') 10999 } else { 11000 this.target.parentElement.classList.add('dropdown') 11001 } 11002 } 11003 11004 /** 11005 * Handler para o evento de click no acionador do comportamento dropdown 11006 * Lança um evento 'change' a cada troca 11007 * @override 11008 * @private 11009 */ 11010 _handleTriggerClickBehavior() { 11011 super._handleTriggerClickBehavior() 11012 this._setParentsTargetVisibilityStatus() 11013 } 11014 11015 /** 11016 * Configura o comportamento dropdown 11017 * @override 11018 * @public 11019 */ 11020 setBehavior() { 11021 super.setBehavior() 11022 } 11023} 11024 11025 11026/***/ }), 11027 11028/***/ "./src/partial/js/behavior/scrim.js": 11029/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 11030 11031"use strict"; 11032/* harmony export */ __webpack_require__.d(__webpack_exports__, { 11033/* harmony export */ "default": () => (/* binding */ Scrim) 11034/* harmony export */ }); 11035/** Classe para o comportamento scrim */ 11036class Scrim { 11037 /** 11038 * Instancia um comportamento scrim 11039 * @param {object} - Objeto de configuração inicial para destructuring 11040 * @property {object} trigger - Elemento DOM que representa o acionador do comportmento scrim 11041 * @property {string} closeElement - Elemento Dom do trigger que fecha o scrim 11042 */ 11043 constructor({ trigger, closeElement }) { 11044 this.trigger = trigger 11045 this.closeElement = this.elementHideScrim(closeElement) 11046 if (this.trigger) { 11047 this.setBehavior() 11048 } 11049 } 11050 11051 /** 11052 * Alterna o estado de visualização do comportamento scrim 11053 * @private 11054 */ 11055 showScrim() { 11056 if (this.trigger) { 11057 this.trigger.classList.add('active') 11058 this.trigger.setAttribute('data-visible', true) 11059 this.trigger.setAttribute('aria-expanded', true) 11060 } 11061 } 11062 /** 11063 * Alterna o estado de escondido do comportamento scrim 11064 * @private 11065 */ 11066 hideScrim() { 11067 this.trigger.classList.remove('active') 11068 this.trigger.setAttribute('data-visible', false) 11069 this.trigger.setAttribute('aria-expanded', false) 11070 } 11071 11072 /** 11073 * Seta o elemento Dom que vai fechar o scrim 11074 * @public 11075 */ 11076 elementHideScrim(element) { 11077 if (this.trigger.querySelectorAll(element)) { 11078 this.trigger.querySelectorAll(element).forEach((element) => { 11079 this.closeElement = element 11080 this._setCloseClick() 11081 }) 11082 } 11083 } 11084 11085 /** 11086 * Adiciona listener de fechamento no elemento que fecha o scrim 11087 * @private 11088 */ 11089 _setCloseClick() { 11090 this.closeElement.addEventListener('click', () => { 11091 this.hideScrim() 11092 }) 11093 } 11094 /** 11095 * Configura o comportamento scrim 11096 * @public 11097 */ 11098 setBehavior() { 11099 this.trigger.addEventListener('click', (event) => { 11100 if (event.target.getAttribute('data-scrim')) { 11101 this.hideScrim() 11102 } 11103 }) 11104 } 11105} 11106 11107 11108/***/ }), 11109 11110/***/ "./src/partial/js/behavior/swipe.js": 11111/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 11112 11113"use strict"; 11114/* harmony export */ __webpack_require__.d(__webpack_exports__, { 11115/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) 11116/* harmony export */ }); 11117/* unused harmony export Swipe */ 11118class Swipe { 11119 constructor(element) { 11120 this.evtMap = { 11121 SWIPE_DOWN: [], 11122 SWIPE_LEFT: [], 11123 SWIPE_RIGHT: [], 11124 SWIPE_UP: [], 11125 } 11126 this.xDown = null 11127 this.yDown = null 11128 this.element = element 11129 11130 element.addEventListener( 11131 'touchstart', 11132 (evt) => { 11133 return this.handleTouchStart(evt) 11134 }, 11135 false 11136 ) 11137 element.addEventListener( 11138 'touchend', 11139 (evt) => { 11140 return this.handleTouchEnd(evt) 11141 }, 11142 false 11143 ) 11144 } 11145 11146 on(evt, cb) { 11147 this.evtMap[evt].push(cb) 11148 } 11149 11150 off(evt, lcb) { 11151 this.evtMap[evt] = this.evtMap[evt].filter((cb) => { 11152 return cb !== lcb 11153 }) 11154 } 11155 11156 trigger(evt, data) { 11157 this.evtMap[evt].map((handler) => { 11158 return handler(data) 11159 }) 11160 } 11161 11162 handleTouchStart(evt) { 11163 this.xDown = evt.touches[0].clientX 11164 this.yDown = evt.touches[0].clientY 11165 } 11166 11167 handleTouchEnd(evt) { 11168 const deltaX = evt.changedTouches[0].clientX - this.xDown 11169 const deltaY = evt.changedTouches[0].clientY - this.yDown 11170 if (Math.abs(deltaX) > Math.abs(deltaY)) { 11171 deltaX < 0 ? this.trigger('SWIPE_LEFT') : this.trigger('SWIPE_RIGHT') 11172 } else { 11173 deltaY > 0 ? this.trigger('SWIPE_DOWN') : this.trigger('SWIPE_UP') 11174 } 11175 } 11176} 11177/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Swipe); 11178 11179 11180/***/ }), 11181
11182/***/ "./src/partial/js/behavior/tooltip.js": 11183/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 11184 11185"use strict"; 11186/* harmony export */ __webpack_require__.d(__webpack_exports__, { 11187/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) 11188/* harmony export */ }); 11189/* harmony import */ var _popperjs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/@popperjs/core/lib/popper.js"); 11190 11191// import 'tippy.js/dist/tippy.css' // optional for styling 11192class Tooltip { 11193 /** 11194 * Instancia um comportamento Tooltip 11195 * @param {object} - Objeto de configuração inicial para tooltip 11196 * @property {object} component - Elemento DOM do tooltip (opcional se tiver o textTooltip) 11197 * @property {object} activator - Elemento DOM que representa o acionador do comportmento tooltip 11198 * @property {string} place -Local onde vai aparecer o tooltip ('top', 'right', 'bottom', 'left') 11199 * @property {string} timer - Tempo em que vai aparecer o tooltip em milisegunto (opcional) 11200 * @property {string} textTooltip - Texto que vai ser mostrado quando não estiver instaciado o atributo component 11201 * @property {string} type - Tipo de tooltip (info, warning) padrão info 11202 * @property {boolean} onActivator - Adiciona o tooltip dentro do elemento ativador padrão false 11203 */ 11204
vendor: 6,549 bytes, lines 11205-11441
11205 constructor({ 11206 component, 11207 activator, 11208 place = 'top', 11209 timer, 11210 active, 11211 textTooltip, 11212 type = 'info', 11213 onActivator = false 11214 }) { 11215 11216 const text_tooltip = textTooltip ? textTooltip : component 11217 this.onActivator = onActivator 11218 this.activator = activator 11219 this.component = component 11220 ? component 11221 : this._setContent(text_tooltip, type) 11222 11223 this.place = 11224 this.component.getAttribute('place') === null 11225 ? this.component.getAttribute('place') 11226 : place 11227 const positions = ['top', 'right', 'bottom', 'left'] 11228 this.popover = this.component.hasAttribute('popover') 11229 this.notification = this.component.classList.contains('br-notification') 11230 this.timer = this.component.getAttribute('timer') 11231 ? this.component.getAttribute('timer') 11232 : timer 11233 this.active = this.component.hasAttribute('active') 11234 ? this.component.hasAttribute('active') 11235 : active 11236 this.placement = positions.includes(place) 11237 ? place 11238 : this.notification 11239 11240 11241 this.popperInstance = null 11242 this.showEvents = ['mouseenter', 'click', 'focus'] 11243 this.hideEvents = ['mouseleave', 'blur'] 11244 this.closeTimer = null 11245 this._create() 11246 this._setBehavior() 11247 } 11248 /** 11249 * Instancializa o behavior 11250 */ 11251 _setBehavior() { 11252 // Ação de abrir padrao ao entrar no ativador 11253 if (this.activator) { 11254 this.showEvents.forEach((event) => { 11255 this.activator.addEventListener(event, (otherEvent) => { 11256 this._show(otherEvent) 11257 }) 11258 }) 11259 } 11260 // Adiciona ação de fechar ao botao do popover 11261 11262 if (this.popover) { 11263 const closeBtn = this.component.querySelector('.close') 11264 closeBtn.addEventListener('click', (event) => { 11265 this._hide(event, this.component) 11266 this._toggleActivatorIcon() 11267 }) 11268 // Ação de fechar padrao ao sair do ativador 11269 } else { 11270 this.hideEvents.forEach((event) => { 11271 this.activator.addEventListener(event, (otherEvent) => { 11272 this._hide(otherEvent, this.component) 11273 }) 11274 }) 11275 } 11276 } 11277 /** 11278 * Inclui o conteudo do tooltip 11279 * @param {*} contentText conteudo do texto do tooltip 11280 * @param {*} type tipo de tooltip 11281 * @returns - retorna o objeto com tooltip 11282 */ 11283 _setContent(contentText, type) { 11284 const text_tooltip = document.createElement('div') 11285 text_tooltip.setAttribute('role', 'tooltip') 11286 text_tooltip.setAttribute('place', 'top') 11287 text_tooltip.setAttribute(type, type) 11288 text_tooltip.innerText = `${contentText}` 11289 text_tooltip.classList.add('br-tooltip') 11290 //TODO: Retirar sample que utiliza não conflita com tooltip componente que está sendo depreciado 11291 text_tooltip.classList.add('sample') 11292 if (this.activator && this.onActivator) { 11293 this.activator.appendChild(text_tooltip) 11294 }else{ 11295 document.body.appendChild(text_tooltip) 11296 } 11297 11298 return text_tooltip 11299 } 11300 11301 /** 11302 * Cria a instancia do popper 11303 * @private 11304 */ 11305 11306 _create() { 11307 this._setLayout() 11308 11309 if (this.notification) { 11310 this.component.setAttribute('notification', '') 11311 this.popperInstance = (0,_popperjs_core__WEBPACK_IMPORTED_MODULE_0__/* .createPopper */ .fi)(this.activator, this.component, { 11312 modifiers: [ 11313 { 11314 name: 'offset', 11315 options: { 11316 offset: [0, 8], 11317 }, 11318 }, 11319 { 11320 name: 'preventOverflow', 11321 options: { 11322 altAxis: false, // false by default 11323 mainAxis: true, // true by default 11324 11325 }, 11326 }, 11327 {name: 'flip',options: {fallbackPlacements: ['top', 'right'],},}, 11328 ], 11329 // placement: this.placement, 11330 placement: 'bottom', 11331 strategy: 'fixed', 11332 }) 11333 } else { 11334 11335 11336 11337 this.popperInstance = (0,_popperjs_core__WEBPACK_IMPORTED_MODULE_0__/* .createPopper */ .fi)(this.activator, this.component, { 11338 modifiers: [ 11339 { 11340 name: 'offset', 11341 options: { 11342 offset: [0, 8], 11343 }, 11344 }, 11345 { 11346 name: 'preventOverflow', 11347 options: { 11348 altAxis: true, 11349 mainAxis: true, 11350 11351 11352 }, 11353 }, 11354 {name: 'flip',options: {fallbackPlacements: ['top', 'right',"bottom","left"],},}, 11355 ], 11356 placement: this.placement, 11357 }) 11358 } 11359 } 11360 /** 11361 * Mostra o tooltip e define o timeout se tiver 11362 * @param {object} event evento javascript 11363 */ 11364 _show(event) { 11365 11366 this.component.style.display = 'unset' 11367 this.component.setAttribute('data-show', '') 11368 this.component.style.zIndex = 9999 11369 this.popperInstance.update() 11370 // 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 11371 this.component.style.visibility = 'visible' 11372 if (this.timer) { 11373 console.log("timer",this.timer) 11374 clearTimeout(this.closeTimer) 11375 this.closeTimer = setTimeout( 11376 this._hide, 11377 this.timer, 11378 event, 11379 this.component 11380 ) 11381 } 11382 } 11383 11384 11385 11386 /** 11387 * Esconde o componente 11388 * @private 11389 */ 11390 _hide(event, component) { 11391 component.removeAttribute('data-show') 11392 component.style.zIndex = -1 11393 component.style.visibility = 'hidden' 11394 clearTimeout(component.closeTimer) 11395 } 11396 /** 11397 * Cria o laytout do tooltip 11398 * @private 11399 */ 11400 _setLayout() { 11401 // Cria a setinha que aponta para o item que criou o tooltip 11402 const arrow = document.createElement('div') 11403 arrow.setAttribute('data-popper-arrow', '') 11404 11405 if (this.component.querySelectorAll('.arrow').length < 1) { 11406 arrow.classList.add('arrow') 11407 } 11408 this.component.appendChild(arrow) 11409 // Cria o icone de fechar do po over 11410 if (this.popover) { 11411 const close = document.createElement('button') 11412 close.setAttribute('type', 'button') 11413 close.classList.add('close') 11414 const ico = document.createElement('i') 11415 ico.classList.add('fas', 'fa-times') 11416 close.appendChild(ico) 11417 this.component.appendChild(close) 11418 } 11419 } 11420 /** 11421 * Muda icone da seta 11422 * @private 11423 */ 11424 _toggleActivatorIcon() { 11425 const icon = this.activator.querySelector('button svg') 11426 if (icon) { 11427 icon.classList.toggle('fa-angle-down') 11428 icon.classList.toggle('fa-angle-up') 11429 } 11430 this.activator.toggleAttribute('active') 11431 } 11432 11433 11434} 11435 11436/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Tooltip); 11437 11438 11439 11440/***/ }), 11441
11442/***/ "./src/partial/js/globals-class.js": 11443/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 11444 11445"use strict"; 11446 11447// EXPORTS 11448__webpack_require__.d(__webpack_exports__, { 11449 Dropdown: () => (/* reexport */ dropdown["default"]), 11450 Globals: () => (/* binding */ Globals) 11451}); 11452 11453// UNUSED EXPORTS: Accordion, BRAccordion, BRAvatar, BRBreadcrumb, BRCard, BRCheckbox, BRDateTimePicker, BRFooter, BRHeader, BRInput, BRItem, BRList, BRMenu, BRMessage, BRModal, BRNotification, BRPagination, BRScrim, BRSelect, BRTab, BRTable, BRTag, BRTextarea, BRTooltip, BRUpload, BRWizard, Checkgroup, Collapse, Swipe, default 11454 11455// EXTERNAL MODULE: ./src/components/accordion/accordion.js 11456var accordion = __webpack_require__("./src/components/accordion/accordion.js"); 11457// EXTERNAL MODULE: ./src/components/avatar/avatar.js 11458var avatar = __webpack_require__("./src/components/avatar/avatar.js"); 11459// EXTERNAL MODULE: ./src/components/breadcrumb/breadcrumb.js 11460var breadcrumb = __webpack_require__("./src/components/breadcrumb/breadcrumb.js"); 11461// EXTERNAL MODULE: ./src/components/card/card.js 11462var card = __webpack_require__("./src/components/card/card.js"); 11463// EXTERNAL MODULE: ./src/components/carousel/carousel.js 11464var carousel = __webpack_require__("./src/components/carousel/carousel.js"); 11465// EXTERNAL MODULE: ./src/components/checkbox/checkbox.js 11466var checkbox_checkbox = __webpack_require__("./src/components/checkbox/checkbox.js"); 11467// EXTERNAL MODULE: ./src/components/datetimepicker/datetimepicker.js + 7 modules 11468var datetimepicker = __webpack_require__("./src/components/datetimepicker/datetimepicker.js"); 11469// EXTERNAL MODULE: ./src/components/footer/footer.js 11470var footer = __webpack_require__("./src/components/footer/footer.js"); 11471// EXTERNAL MODULE: ./src/components/header/header.js 11472var header = __webpack_require__("./src/components/header/header.js"); 11473// EXTERNAL MODULE: ./src/components/input/input.js 11474var input = __webpack_require__("./src/components/input/input.js"); 11475;// CONCATENATED MODULE: ./src/components/input/input-data.js 11476/** 11477 * Dados para popular o input de exemplo 11478 * @constant {string[]} */ 11479const inputData = [ 11480 'Afeganistão', 11481 'Ãfrica do Sul', 11482 'Albânia', 11483 'Alemanha', 11484 'Andorra', 11485 'Angola', 11486 'Anguilla', 11487 'Antártida', 11488 'AntÃgua e Barbuda', 11489 'Antilhas Holandesas', 11490 'Arábia Saudita', 11491 'Argélia', 11492 'Argentina', 11493 'Armênia', 11494 'Aruba', 11495 'Austrália', 11496 'Ãustria', 11497 'Azerbaijão', 11498 'Bahamas', 11499 'Bahrein', 11500 'Bangladesh', 11501 'Barbados', 11502 'Belarus', 11503 'Bélgica', 11504 'Belize', 11505 'Benin', 11506 'Bermudas', 11507 'BolÃvia', 11508 'Bósnia-Herzegóvina', 11509 'Botsuana', 11510 'Brasil', 11511 'Brunei', 11512 'Bulgária', 11513 'Burkina Fasso', 11514 'Burundi', 11515 'Butão', 11516 'Cabo Verde', 11517 'Camarões', 11518 'Camboja', 11519 'Canadá', 11520 'Cazaquistão', 11521 'Chade', 11522 'Chile', 11523 'China', 11524 'Chipre', 11525 'Cingapura', 11526 'Colômbia', 11527 'Congo', 11528 'Coréia do Norte', 11529 'Coréia do Sul', 11530 'Costa do Marfim', 11531 'Costa Rica', 11532 'Croácia (Hrvatska)', 11533 'Cuba', 11534 'Dinamarca', 11535 'Djibuti', 11536 'Dominica', 11537 'Egito', 11538 'El Salvador', 11539 'Emirados Ãrabes Unidos', 11540 'Equador', 11541 'Eritréia', 11542 'Eslováquia', 11543 'Eslovênia', 11544 'Espanha', 11545 'Estados Unidos', 11546 'Estônia', 11547 'Etiópia', 11548 'Fiji', 11549 'Filipinas', 11550 'Finlândia', 11551 'França', 11552 'Gabão', 11553 'Gâmbia', 11554 'Gana', 11555 'Geórgia', 11556 'Gibraltar', 11557 'Grã-Bretanha (Reino Unido, UK)', 11558 'Granada', 11559 'Grécia', 11560 'Groelândia', 11561 'Guadalupe', 11562 'Guam (Território dos Estados Unidos)', 11563 'Guatemala', 11564 'Guernsey', 11565 'Guiana', 11566 'Guiana Francesa', 11567 'Guiné', 11568 'Guiné Equatorial', 11569 'Guiné-Bissau', 11570 'Haiti', 11571 'Holanda', 11572 'Honduras', 11573 'Hong Kong', 11574 'Hungria', 11575 'Iêmen', 11576 'Ilha Bouvet (Território da Noruega)', 11577 'Ilha do Homem', 11578 'Ilha Natal', 11579 'Ilha Pitcairn', 11580 'Ilha Reunião', 11581 'Ilhas Aland', 11582 'Ilhas Cayman', 11583 'Ilhas Cocos', 11584 'Ilhas Comores', 11585 'Ilhas Cook', 11586 'Ilhas Faroes', 11587 'Ilhas Falkland (Malvinas)', 11588 'Ilhas Geórgia do Sul e Sandwich do Sul', 11589 'Ilhas Heard e McDonald (Território da Austrália)', 11590 'Ilhas Marianas do Norte', 11591 'Ilhas Marshall', 11592 'Ilhas Menores dos Estados Unidos', 11593 'Ilhas Norfolk', 11594 'Ilhas Seychelles',
vendor: 13,989 bytes, lines 11595-12105
11595 'Ilhas Solomão', 11596 'Ilhas Svalbard e Jan Mayen', 11597 'Ilhas Tokelau', 11598 'Ilhas Turks e Caicos', 11599 'Ilhas Virgens (Estados Unidos)', 11600 'Ilhas Virgens (Inglaterra)', 11601 'Ilhas Wallis e Futuna', 11602 'Ãndia', 11603 'Indonésia', 11604 'Irã', 11605 'Iraque', 11606 'Irlanda', 11607 'Islândia', 11608 'Israel', 11609 'Itália', 11610 'Jamaica', 11611 'Japão', 11612 'Jersey', 11613 'Jordânia', 11614 'Kênia', 11615 'Kiribati', 11616 'Kuait', 11617 'Laos', 11618 'Látvia', 11619 'Lesoto', 11620 'LÃbano', 11621 'Libéria', 11622 'LÃbia', 11623 'Liechtenstein', 11624 'Lituânia', 11625 'Luxemburgo', 11626 'Macau', 11627 'Macedônia (República Yugoslava)', 11628 'Madagascar', 11629 'Malásia', 11630 'Malaui', 11631 'Maldivas', 11632 'Mali', 11633 'Malta', 11634 'Marrocos', 11635 'Martinica', 11636 'MaurÃcio', 11637 'Mauritânia', 11638 'Mayotte', 11639 'México', 11640 'Micronésia', 11641 'Moçambique', 11642 'Moldova', 11643 'Mônaco', 11644 'Mongólia', 11645 'Montenegro', 11646 'Montserrat', 11647 'Myanma', 11648 'NamÃbia', 11649 'Nauru', 11650 'Nepal', 11651 'Nicarágua', 11652 'NÃger', 11653 'Nigéria', 11654 'Niue', 11655 'Noruega', 11656 'Nova Caledônia', 11657 'Nova Zelândia', 11658 'Omã', 11659 'Palau', 11660 'Panamá', 11661 'Papua-Nova Guiné', 11662 'Paquistão', 11663 'Paraguai', 11664 'Peru', 11665 'Polinésia Francesa', 11666 'Polônia', 11667 'Porto Rico', 11668 'Portugal', 11669 'Qatar', 11670 'Quirguistão', 11671 'República Centro-Africana', 11672 'República Democrática do Congo', 11673 'República Dominicana', 11674 'República Tcheca', 11675 'Romênia', 11676 'Ruanda', 11677 'Rússia (antiga URSS) - Federação Russa', 11678 'Saara Ocidental', 11679 'Saint Vincente e Granadinas', 11680 'Samoa Americana', 11681 'Samoa Ocidental', 11682 'San Marino', 11683 'Santa Helena', 11684 'Santa Lúcia', 11685 'São Bartolomeu', 11686 'São Cristóvão e Névis', 11687 'São Martim', 11688 'São Tomé e PrÃncipe', 11689 'Senegal', 11690 'Serra Leoa', 11691 'Sérvia', 11692 'SÃria', 11693 'Somália', 11694 'Sri Lanka', 11695 'St. Pierre and Miquelon', 11696 'Suazilândia', 11697 'Sudão', 11698 'Suécia', 11699 'SuÃça', 11700 'Suriname', 11701 'Tadjiquistão', 11702 'Tailândia', 11703 'Taiwan', 11704 'Tanzânia', 11705 'Território Britânico do Oceano Ãndico', 11706 'Territórios do Sul da França', 11707 'Territórios Palestinos Ocupados', 11708 'Timor Leste', 11709 'Togo', 11710 'Tonga', 11711 'Trinidad and Tobago', 11712 'TunÃsia', 11713 'Turcomenistão', 11714 'Turquia', 11715 'Tuvalu', 11716 'Ucrânia', 11717 'Uganda', 11718 'Uruguai', 11719 'Uzbequistão', 11720 'Vanuatu', 11721 'Vaticano', 11722 'Venezuela', 11723 'Vietnã', 11724 'Zâmbia', 11725 'Zimbábue', 11726] 11727 11728/* harmony default export */ const input_data = (inputData); 11729 11730// EXTERNAL MODULE: ./src/components/item/item.js 11731var item = __webpack_require__("./src/components/item/item.js"); 11732// EXTERNAL MODULE: ./src/components/list/list.js 11733var list = __webpack_require__("./src/components/list/list.js"); 11734// EXTERNAL MODULE: ./src/components/menu/menu.js 11735var menu = __webpack_require__("./src/components/menu/menu.js"); 11736// EXTERNAL MODULE: ./src/components/message/message.js 11737var message = __webpack_require__("./src/components/message/message.js"); 11738// EXTERNAL MODULE: ./src/components/modal/modal.js 11739var modal = __webpack_require__("./src/components/modal/modal.js"); 11740// EXTERNAL MODULE: ./src/components/notification/notification.js 11741var notification = __webpack_require__("./src/components/notification/notification.js"); 11742// EXTERNAL MODULE: ./src/components/pagination/pagination.js 11743var pagination = __webpack_require__("./src/components/pagination/pagination.js"); 11744// EXTERNAL MODULE: ./src/components/scrim/scrim.js 11745var scrim_scrim = __webpack_require__("./src/components/scrim/scrim.js"); 11746// EXTERNAL MODULE: ./src/components/select/select.js 11747var select_select = __webpack_require__("./src/components/select/select.js"); 11748// EXTERNAL MODULE: ./src/components/step/step.js 11749var step = __webpack_require__("./src/components/step/step.js"); 11750// EXTERNAL MODULE: ./src/components/tab/tab.js 11751var tab = __webpack_require__("./src/components/tab/tab.js"); 11752// EXTERNAL MODULE: ./src/components/table/table.js 11753var table = __webpack_require__("./src/components/table/table.js"); 11754// EXTERNAL MODULE: ./src/components/tag/tag.js 11755var tag = __webpack_require__("./src/components/tag/tag.js"); 11756// EXTERNAL MODULE: ./src/components/textarea/textarea.js 11757var textarea_textarea = __webpack_require__("./src/components/textarea/textarea.js"); 11758// EXTERNAL MODULE: ./src/components/tooltip/tooltip.js 11759var tooltip = __webpack_require__("./src/components/tooltip/tooltip.js"); 11760// EXTERNAL MODULE: ./src/components/upload/upload.js 11761var upload = __webpack_require__("./src/components/upload/upload.js"); 11762// EXTERNAL MODULE: ./src/components/wizard/wizard.js 11763var wizard = __webpack_require__("./src/components/wizard/wizard.js"); 11764// EXTERNAL MODULE: ./src/partial/js/behavior/dropdown.js 11765var dropdown = __webpack_require__("./src/partial/js/behavior/dropdown.js"); 11766;// CONCATENATED MODULE: ./src/partial/js/globals-class.js 11767// Script Templates 11768 11769 11770 11771 11772 11773document.addEventListener("DOMContentLoaded", function() { 11774 // Converte a string hexadecimal de volta para HTML 11775 function base64ToHtml(base64) { 11776 return decodeURIComponent(escape(window.atob(base64))); 11777 } 11778 11779 // String base64 do HTML com estilos inline 11780 var base64String = "PGRpdiBjbGFzcz0iY29udGFpbmVyLWxnIj4KICAgIDxkaXYgY2xhc3M9ImluZm8iPgogICAgICAgIDxkaXYgY2xhc3M9InRleHQtZG93bi0wMSB0ZXh0LW1lZGl1bSBwYi0zIj4KICAgICAgICAgICAgRGVzZW52b2x2aWRvIHBlbG8gU1RJIC0gVW5pdmVyc2lkYWRlIEZlZGVyYWwgZG8gUGlhdcOtCiAgICAgICAgPC9kaXY+CiAgICA8L2Rpdj4KPC9kaXY+"; 11781 11782 // Decodifica o base64 para HTML 11783 var decodedHtml = base64ToHtml(base64String); 11784 11785 // Cria um div com o conteúdo decodificado 11786 var div = document.createElement('div'); 11787 div.innerHTML = decodedHtml; 11788 11789 // Adiciona o conteúdo antes do fechamento do footer 11790 var footer = document.querySelector('footer'); 11791 if (footer) { 11792 footer.insertAdjacentElement('beforeend', div); 11793 } 11794}); 11795 11796 11797 11798 11799 // Dados para o autocomplete do input 11800 11801 11802 11803 11804 11805 11806 11807 11808 11809 11810 11811 11812 11813 11814 11815 11816 11817 11818 11819 11820 11821 11822 11823class Globals { 11824 initInstanceAll() { 11825 this.initInstanceAccordion() 11826 this.initInstanceAvatar() 11827 this.initInstanceBreadcrumb() 11828 this.initInstanceCard() 11829 this.initInstanceCarousel() 11830 this.initInstanceCheckbox() 11831 this.initInstanceDateTimePicker() 11832 this.initInstanceFooter() 11833 this.initInstanceInput() 11834 this.initInstanceHeader() 11835 this.initInstanceItem() 11836 this.initInstanceList() 11837 this.initInstanceMenu() 11838 this.initInstanceMessage() 11839 this.initInstanceModal() 11840 this.initInstanceNotification() 11841 this.initInstancePagination() 11842 this.initInstanceScrim() 11843 this.initInstanceSelect() 11844 this.initInstanceStep() 11845 this.initInstanceTable() 11846 this.initInstanceTabs() 11847 this.initInstanceTextarea() 11848 this.initInstanceUpload() 11849 this.initInstanceWizard() 11850 this.initInstanceTooltip() 11851 } 11852 11853 initInstanceAccordion() { 11854 const accordionList = [] 11855 for (const brAccordion of window.document.querySelectorAll( 11856 '.br-accordion' 11857 )) { 11858 accordionList.push(new accordion/* default */.Z('br-accordion', brAccordion)) 11859 } 11860 } 11861 11862 initInstanceAvatar() { 11863 const avatarList = [] 11864 for (const brAvatar of window.document.querySelectorAll('.br-avatar')) { 11865 avatarList.push(new avatar/* default */.Z('br-avatar', brAvatar)) 11866 } 11867 } 11868 11869 initInstanceBreadcrumb() { 11870 const breadcrumbList = [] 11871 for (const brBreadcrumb of window.document.querySelectorAll( 11872 '.br-breadcrumb' 11873 )) { 11874 breadcrumbList.push(new breadcrumb/* default */.Z('br-breadcrumb', brBreadcrumb)) 11875 } 11876 } 11877 11878 initInstanceDateTimePicker() { 11879 const datetimepickerList = [] 11880 for (const brDateTimePicker of window.document.querySelectorAll( 11881 '.br-datetimepicker' 11882 )) { 11883 datetimepickerList.push( 11884 new datetimepicker/* default */.Z('br-datetimepicker', brDateTimePicker, {}) 11885 ) 11886 } 11887 } 11888 11889 initInstanceHeader() { 11890 const headerList = [] 11891 for (const brHeader of window.document.querySelectorAll('.br-header')) { 11892 headerList.push(new header/* default */.Z('br-header', brHeader)) 11893 } 11894 } 11895 initInstanceFooter() { 11896 const listFooter = [] 11897 for (const brFooter of window.document.querySelectorAll('.br-footer')) { 11898 listFooter.push(new footer/* default */.Z('br-footer', brFooter)) 11899 } 11900 } 11901 11902 initInstanceInput() { 11903 const inputList = [] 11904 for (const brInput of window.document.querySelectorAll('.br-input')) { 11905 inputList.push(new input/* default */.Z('br-input', brInput)) 11906 } 11907 for (const brInput of inputList) { 11908 brInput.component 11909 .querySelectorAll('input.search-autocomplete') 11910 .forEach(() => { 11911 brInput.setAutocompleteData(input_data) 11912 }) 11913 } 11914 } 11915 11916 initInstanceItem() { 11917 const itemList = [] 11918 for (const brItem of window.document.querySelectorAll('.br-item')) { 11919 itemList.push(new item/* default */.Z('br-item', brItem)) 11920 } 11921 } 11922 11923 initInstanceList() { 11924 const listList = [] 11925 for (const brList of window.document.querySelectorAll( 11926 '.br-list:not([data-sub])' 11927 )) { 11928 listList.push(new list/* default */.Z('br-list', brList)) 11929 } 11930 } 11931 11932 initInstanceMenu() { 11933 const menuList = [] 11934 for (const brMenu of window.document.querySelectorAll('.br-menu')) { 11935 menuList.push(new menu/* default */.Z('br-menu', brMenu)) 11936 } 11937 } 11938 11939 initInstanceMessage() { 11940 const alertList = [] 11941 for (const brMessage of window.document.querySelectorAll('.br-message')) { 11942 alertList.push(new message/* default */.Z('br-message', brMessage)) 11943 } 11944 } 11945 11946 initInstanceModal() { 11947 const modalList = [] 11948 for (const brModal of window.document.querySelectorAll('.br-modal')) { 11949 modalList.push(new modal/* default */.Z('br-modal', brModal)) 11950 } 11951 for (const brScrim of window.document.querySelectorAll('.br-scrim')) { 11952 const scrim = new scrim_scrim/* default */.Z('br-scrim', brScrim) 11953 for (const button of window.document.querySelectorAll( 11954 '.br-scrim + button' 11955 )) { 11956 button.addEventListener('click', () => { 11957 scrim.showScrim() 11958 }) 11959 } 11960 } 11961 } 11962 11963 initInstanceNotification() { 11964 const notificationList = [] 11965 for (const brNotification of window.document.querySelectorAll( 11966 '.br-notification' 11967 )) { 11968 notificationList.push( 11969 new notification/* default */.Z('br-notification', brNotification) 11970 ) 11971 } 11972 } 11973 11974 initInstancePagination() { 11975 const paginationList = [] 11976 for (const brPagination of window.document.querySelectorAll( 11977 '.br-pagination' 11978 )) { 11979 paginationList.push(new pagination/* default */.Z('br-pagination', brPagination)) 11980 } 11981 } 11982 11983 initInstanceScrim() { 11984 const scrimList = [] 11985 for (const brScrim of window.document.querySelectorAll('.br-scrim')) { 11986 scrimList.push(new scrim_scrim/* default */.Z('br-scrim', brScrim)) 11987 } 11988 for (const buttonBloco1 of window.document.querySelectorAll( 11989 '.bloco1 button' 11990 )) { 11991 buttonBloco1.addEventListener('click', () => { 11992 for (const brScrim of scrimList) { 11993 brScrim.showScrim() 11994 } 11995 }) 11996 } 11997 } 11998 11999 initInstanceSelect() { 12000 const selectList = [] 12001 for (const brSelect of window.document.querySelectorAll('.br-select')) { 12002 const brselect = new select_select/* default */.Z('br-select', brSelect) 12003 //Exemplo de uso de listener do select 12004 // brSelect.addEventListener('onChange', () => {}) 12005 12006 selectList.push(brselect) 12007 } 12008 } 12009 12010 initInstanceTable() { 12011 const tableList = [] 12012 for (const [index, brTable] of window.document 12013 .querySelectorAll('.br-table') 12014 .entries()) { 12015 tableList.push(new table/* default */.Z('br-table', brTable, index)) 12016 } 12017 } 12018 12019 initInstanceTag() { 12020 const tagList = [] 12021 for (const brTag of window.document.querySelectorAll('.br-tag')) { 12022 tagList.push(new tag/* default */.Z('br-tag', brTag)) 12023 } 12024 } 12025 12026 initInstanceTabs() { 12027 const abasList = [] 12028 for (const brTab of window.document.querySelectorAll('.br-tab')) { 12029 abasList.push(new tab/* default */.Z('br-tab', brTab)) 12030 } 12031 } 12032 12033 initInstanceTooltip() { 12034 const tooltipList = [] 12035 for (const brTooltip of window.document.querySelectorAll('.br-tooltip')) { 12036 tooltipList.push(new tooltip/* default */.Z('br-tooltip', brTooltip)) 12037 } 12038 } 12039 12040 initInstanceUpload() { 12041 const uploadList = [] 12042 function uploadTimeout() { 12043 return new Promise((resolve) => { 12044 // Colocar aqui um upload para o servidor e retirar o timeout 12045 return setTimeout(resolve, 500) 12046 }) 12047 } 12048 for (const brUpload of window.document.querySelectorAll('.br-upload')) { 12049 uploadList.push(new upload/* default */.Z('br-upload', brUpload, uploadTimeout)) 12050 } 12051 } 12052 12053 initInstanceStep() { 12054 const stepList = [] 12055 for (const brStep of window.document.querySelectorAll('.br-step')) { 12056 stepList.push(new step/* default */.Z('br-step', brStep)) 12057 } 12058 } 12059 12060 initInstanceWizard() { 12061 const wizardList = [] 12062 for (const brWizard of window.document.querySelectorAll('.br-wizard')) { 12063 wizardList.push(new wizard/* default */.Z('br-wizard', brWizard)) 12064 } 12065 } 12066 12067 initInstanceCard() { 12068 const listCard = [] 12069 for (const brCard of window.document.querySelectorAll('.br-card')) { 12070 listCard.push(new card/* default */.Z('br-card', brCard)) 12071 } 12072 } 12073 initInstanceCarousel() { 12074 const carouselList = [] 12075 for (const brCarousel of window.document.querySelectorAll('.br-carousel')) { 12076 carouselList.push(new carousel/* default */.Z('br-carousel', brCarousel)) 12077 } 12078 } 12079 12080 initInstanceCheckbox() { 12081 const checkboxList = [] 12082 for (const brCheckbox of window.document.querySelectorAll('.br-checkbox')) { 12083 checkboxList.push(new checkbox_checkbox/* default */.Z('br-checkbox', brCheckbox)) 12084 } 12085 } 12086 12087 initInstanceTextarea() { 12088 const textareaList = [] 12089 for (const brTextarea of window.document.querySelectorAll('.br-textarea')) { 12090 textareaList.push(new textarea_textarea/* default */.Z('br-textarea', brTextarea)) 12091 } 12092 } 12093 initInstanceWizard() { 12094 const wizardList = [] 12095 for (const brWizard of window.document.querySelectorAll('.br-wizard')) { 12096 wizardList.push(new wizard/* default */.Z('br-wizard', brWizard)) 12097 } 12098 } 12099} 12100 12101 12102 12103 12104 12105/***/ })
vendor: 2,421 bytes, lines 12105-12166
12105 12106 12107/******/ }); 12108/************************************************************************/ 12109/******/ // The module cache 12110/******/ var __webpack_module_cache__ = {}; 12111/******/ 12112/******/ // The require function 12113/******/ function __webpack_require__(moduleId) { 12114/******/ // Check if module is in cache 12115/******/ var cachedModule = __webpack_module_cache__[moduleId]; 12116/******/ if (cachedModule !== undefined) { 12117/******/ return cachedModule.exports; 12118/******/ } 12119/******/ // Create a new module (and put it into the cache) 12120/******/ var module = __webpack_module_cache__[moduleId] = { 12121/******/ // no module.id needed 12122/******/ // no module.loaded needed 12123/******/ exports: {} 12124/******/ }; 12125/******/ 12126/******/ // Execute the module function 12127/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); 12128/******/ 12129/******/ // Return the exports of the module 12130/******/ return module.exports; 12131/******/ } 12132/******/ 12133/************************************************************************/ 12134/******/ /* webpack/runtime/define property getters */ 12135/******/ (() => { 12136/******/ // define getter functions for harmony exports 12137/******/ __webpack_require__.d = (exports, definition) => { 12138/******/ for(var key in definition) { 12139/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 12140/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 12141/******/ } 12142/******/ } 12143/******/ }; 12144/******/ })(); 12145/******/ 12146/******/ /* webpack/runtime/hasOwnProperty shorthand */ 12147/******/ (() => { 12148/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 12149/******/ })(); 12150/******/ 12151/******/ /* webpack/runtime/make namespace object */ 12152/******/ (() => { 12153/******/ // define __esModule on exports 12154/******/ __webpack_require__.r = (exports) => { 12155/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 12156/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 12157/******/ } 12158/******/ Object.defineProperty(exports, '__esModule', { value: true }); 12159/******/ }; 12160/******/ })(); 12161/******/ 12162/************************************************************************/ 12163var __webpack_exports__ = {}; 12164// This entry need to be wrapped in an IIFE because it need to be in strict mode. 12165(() => { 12166"use strict";
vendor: 15,214 bytes, lines 12167-12653
12167// ESM COMPAT FLAG 12168__webpack_require__.r(__webpack_exports__); 12169 12170// EXPORTS 12171__webpack_require__.d(__webpack_exports__, { 12172 Accordion: () => (/* reexport */ behavior_accordion["default"]), 12173 BRAccordion: () => (/* reexport */ accordion/* default */.Z), 12174 BRAlert: () => (/* reexport */ message/* default */.Z), 12175 BRBreadcrumb: () => (/* reexport */ breadcrumb/* default */.Z), 12176 BRCard: () => (/* reexport */ card/* default */.Z), 12177 BRCarousel: () => (/* reexport */ carousel/* default */.Z), 12178 BRCheckbox: () => (/* reexport */ checkbox_checkbox/* default */.Z), 12179 BRDateTimePicker: () => (/* reexport */ datetimepicker/* default */.Z), 12180 BRFooter: () => (/* reexport */ footer/* default */.Z), 12181 BRHeader: () => (/* reexport */ header/* default */.Z), 12182 BRInput: () => (/* reexport */ input/* default */.Z), 12183 BRItem: () => (/* reexport */ item/* default */.Z), 12184 BRList: () => (/* reexport */ list/* default */.Z), 12185 BRMenu: () => (/* reexport */ menu/* default */.Z), 12186 BRModal: () => (/* reexport */ modal/* default */.Z), 12187 BRNotification: () => (/* reexport */ notification/* default */.Z), 12188 BRPagination: () => (/* reexport */ pagination/* default */.Z), 12189 BRScrim: () => (/* reexport */ scrim/* default */.Z), 12190 BRSelect: () => (/* reexport */ select_select/* default */.Z), 12191 BRStep: () => (/* reexport */ step/* default */.Z), 12192 BRTab: () => (/* reexport */ tab/* default */.Z), 12193 BRTable: () => (/* reexport */ table/* default */.Z), 12194 BRTag: () => (/* reexport */ tag/* default */.Z), 12195 BRTextarea: () => (/* reexport */ textarea_textarea/* default */.Z), 12196 BRTooltip: () => (/* reexport */ tooltip/* default */.Z), 12197 BRUpload: () => (/* reexport */ upload/* default */.Z), 12198 BRWizard: () => (/* reexport */ wizard/* default */.Z), 12199 Checkgroup: () => (/* reexport */ behavior_checkgroup["default"]), 12200 Collapse: () => (/* reexport */ behavior_collapse["default"]), 12201 Dropdown: () => (/* reexport */ globals_class.Dropdown), 12202 Globals: () => (/* reexport */ globals_class.Globals), 12203 Swipe: () => (/* reexport */ swipe/* default */.Z), 12204 Tooltip: () => (/* reexport */ behavior_tooltip["default"]), 12205 behavior: () => (/* binding */ behavior), 12206 globals: () => (/* binding */ globals) 12207}); 12208 12209// EXTERNAL MODULE: ./node_modules/focus-visible/dist/focus-visible.js 12210var focus_visible = __webpack_require__("./node_modules/focus-visible/dist/focus-visible.js"); 12211// EXTERNAL MODULE: ./src/components/accordion/accordion.js 12212var accordion = __webpack_require__("./src/components/accordion/accordion.js"); 12213// EXTERNAL MODULE: ./src/components/breadcrumb/breadcrumb.js 12214var breadcrumb = __webpack_require__("./src/components/breadcrumb/breadcrumb.js"); 12215// EXTERNAL MODULE: ./src/components/card/card.js 12216var card = __webpack_require__("./src/components/card/card.js"); 12217// EXTERNAL MODULE: ./src/components/carousel/carousel.js 12218var carousel = __webpack_require__("./src/components/carousel/carousel.js"); 12219// EXTERNAL MODULE: ./src/components/checkbox/checkbox.js 12220var checkbox_checkbox = __webpack_require__("./src/components/checkbox/checkbox.js"); 12221// EXTERNAL MODULE: ./src/components/datetimepicker/datetimepicker.js + 7 modules 12222var datetimepicker = __webpack_require__("./src/components/datetimepicker/datetimepicker.js"); 12223// EXTERNAL MODULE: ./src/components/footer/footer.js 12224var footer = __webpack_require__("./src/components/footer/footer.js"); 12225// EXTERNAL MODULE: ./src/components/header/header.js 12226var header = __webpack_require__("./src/components/header/header.js"); 12227// EXTERNAL MODULE: ./src/components/input/input.js 12228var input = __webpack_require__("./src/components/input/input.js"); 12229// EXTERNAL MODULE: ./src/components/item/item.js 12230var item = __webpack_require__("./src/components/item/item.js"); 12231// EXTERNAL MODULE: ./src/components/list/list.js 12232var list = __webpack_require__("./src/components/list/list.js"); 12233// EXTERNAL MODULE: ./src/components/menu/menu.js 12234var menu = __webpack_require__("./src/components/menu/menu.js"); 12235// EXTERNAL MODULE: ./src/components/message/message.js 12236var message = __webpack_require__("./src/components/message/message.js"); 12237// EXTERNAL MODULE: ./src/components/modal/modal.js 12238var modal = __webpack_require__("./src/components/modal/modal.js"); 12239// EXTERNAL MODULE: ./src/components/notification/notification.js 12240var notification = __webpack_require__("./src/components/notification/notification.js"); 12241// EXTERNAL MODULE: ./src/components/pagination/pagination.js 12242var pagination = __webpack_require__("./src/components/pagination/pagination.js"); 12243// EXTERNAL MODULE: ./src/components/scrim/scrim.js 12244var scrim = __webpack_require__("./src/components/scrim/scrim.js"); 12245// EXTERNAL MODULE: ./src/components/select/select.js 12246var select_select = __webpack_require__("./src/components/select/select.js"); 12247// EXTERNAL MODULE: ./src/components/step/step.js 12248var step = __webpack_require__("./src/components/step/step.js"); 12249// EXTERNAL MODULE: ./src/components/tab/tab.js 12250var tab = __webpack_require__("./src/components/tab/tab.js"); 12251// EXTERNAL MODULE: ./src/components/table/table.js 12252var table = __webpack_require__("./src/components/table/table.js"); 12253// EXTERNAL MODULE: ./src/components/tag/tag.js 12254var tag = __webpack_require__("./src/components/tag/tag.js"); 12255// EXTERNAL MODULE: ./src/components/textarea/textarea.js 12256var textarea_textarea = __webpack_require__("./src/components/textarea/textarea.js"); 12257// EXTERNAL MODULE: ./src/components/tooltip/tooltip.js 12258var tooltip = __webpack_require__("./src/components/tooltip/tooltip.js"); 12259// EXTERNAL MODULE: ./src/components/upload/upload.js 12260var upload = __webpack_require__("./src/components/upload/upload.js"); 12261// EXTERNAL MODULE: ./src/components/wizard/wizard.js 12262var wizard = __webpack_require__("./src/components/wizard/wizard.js"); 12263// EXTERNAL MODULE: ./src/partial/js/behavior/accordion.js 12264var behavior_accordion = __webpack_require__("./src/partial/js/behavior/accordion.js"); 12265// EXTERNAL MODULE: ./src/partial/js/behavior/checkgroup.js 12266var behavior_checkgroup = __webpack_require__("./src/partial/js/behavior/checkgroup.js"); 12267// EXTERNAL MODULE: ./src/partial/js/behavior/collapse.js 12268var behavior_collapse = __webpack_require__("./src/partial/js/behavior/collapse.js"); 12269// EXTERNAL MODULE: ./src/partial/js/behavior/swipe.js 12270var swipe = __webpack_require__("./src/partial/js/behavior/swipe.js"); 12271// EXTERNAL MODULE: ./src/partial/js/behavior/tooltip.js 12272var behavior_tooltip = __webpack_require__("./src/partial/js/behavior/tooltip.js"); 12273;// CONCATENATED MODULE: ./src/util/accordion/accordion.js 12274 12275 12276/** 12277 * Classe para o exemplo do comportamento accordion 12278 */ 12279class AccordionExample { 12280 /** 12281 * Instancia um exemplo de comportamento accordion 12282 * @param {object} element - Elemento DOM que representa um componente contento um comportamento de accordion 12283 */ 12284 constructor(element) { 12285 this.element = element 12286 this._setBehavior() 12287 } 12288 /** 12289 * Inicia comportamento do exemplo 12290 */ 12291 _setBehavior() { 12292 this._setAccordionBehavior() 12293 } 12294 /** 12295 * Encontra os data-toggle accordion e coloca util Accordion 12296 */ 12297 _setAccordionBehavior() { 12298 this.element 12299 .querySelectorAll('[data-toggle="accordion"]') 12300 .forEach((trigger) => { 12301 const config = { 12302 iconToHide: 'fa-chevron-up', 12303 iconToShow: 'fa-chevron-down', 12304 trigger, 12305 useIcons: true, 12306 } 12307 const accordion = new behavior_accordion["default"](config) 12308 accordion.setBehavior() 12309 }) 12310 } 12311} 12312 12313/* harmony default export */ const accordion_accordion = (AccordionExample); 12314 12315;// CONCATENATED MODULE: ./src/util/checkgroup/checkgroup.js 12316 12317 12318/** 12319 * Classe para o exemplo do comportamento checkgroup 12320 */ 12321class CheckgroupExample { 12322 /** 12323 * Instancia um exemplo de comportamento checkgroup 12324 * @param {object} element - Elemento DOM que representa um componente contento um comportamento de checkgroup 12325 */ 12326 constructor(element) { 12327 this.element = element 12328 this._setBehavior() 12329 } 12330 /** 12331 * Inicia comportamento do exemplo 12332 * @private 12333 */ 12334 _setBehavior() { 12335 this._setCheckgroupBehavior() 12336 } 12337 12338 /** 12339 * Encontra os data-toggle checkbox com data-parent e coloca util Checkgroup 12340 * @private 12341 */ 12342 12343 _setCheckgroupBehavior() { 12344 this.element 12345 .querySelectorAll('input[type="checkbox"][data-parent]') 12346 .forEach((trigger) => { 12347 const checkgroup = new behavior_checkgroup["default"](trigger) 12348 checkgroup.setBehavior() 12349 }) 12350 } 12351} 12352 12353/* harmony default export */ const checkgroup = (CheckgroupExample); 12354 12355;// CONCATENATED MODULE: ./src/util/collapse/collapse.js 12356 12357 12358/** 12359 * Classe para o exemplo do comportamento collapse 12360 */ 12361class CollapseExample { 12362 /** 12363 * Instancia um exemplo de comportamento collapse 12364 * @param {object} element - Elemento DOM que representa um componente contento um comportamento de collapse 12365 */ 12366 constructor(element) { 12367 this.element = element 12368 this._setBehavior() 12369 } 12370 /** 12371 * Instancia o utilitario 12372 * @private 12373 */ 12374 _setBehavior() { 12375 this._setCollapseBehavior() 12376 } 12377 /** 12378 * Instancia o utilitario no data-toggle collapse 12379 * @private 12380 */ 12381 _setCollapseBehavior() { 12382 this.element 12383 .querySelectorAll('[data-toggle="collapse"]') 12384 .forEach((trigger) => { 12385 const config = { 12386 iconToHide: 'fa-chevron-up', 12387 iconToShow: 'fa-chevron-down', 12388 trigger, 12389 useIcons: true, 12390 } 12391 const collapse = new behavior_collapse["default"](config) 12392 collapse.setBehavior() 12393 }) 12394 } 12395} 12396 12397/* harmony default export */ const collapse = (CollapseExample); 12398 12399// EXTERNAL MODULE: ./src/partial/js/behavior/dropdown.js 12400var behavior_dropdown = __webpack_require__("./src/partial/js/behavior/dropdown.js"); 12401;// CONCATENATED MODULE: ./src/util/dropdown/dropdown.js 12402 12403 12404/** 12405 * Classe para o exemplo do comportamento dropdown 12406 */ 12407class DropdownExample { 12408 /** 12409 * Instancia um exemplo de comportamento dropdown 12410 * @param {object} element - Elemento DOM que representa um componente contento um comportamento de dropdown 12411 */ 12412 constructor(element) { 12413 this.element = element 12414 this._setBehavior() 12415 } 12416 /** 12417 * Inicia comportamento do exemplo 12418 */ 12419 _setBehavior() { 12420 this._setDropdownBehavior() 12421 } 12422 12423 /** 12424 * Encontra os data-toggle dropdown e coloca util Dropdown 12425 */ 12426 _setDropdownBehavior() { 12427 this.element 12428 .querySelectorAll('[data-toggle="dropdown"]') 12429 .forEach((trigger) => { 12430 const config = { 12431 iconToHide: 'fa-chevron-up', 12432 iconToShow: 'fa-chevron-down', 12433 trigger, 12434 useIcons: true, 12435 } 12436 const dropdown = new behavior_dropdown["default"](config) 12437 dropdown.setBehavior() 12438 }) 12439 } 12440} 12441 12442/* harmony default export */ const dropdown = (DropdownExample); 12443 12444// EXTERNAL MODULE: ./src/partial/js/behavior/scrim.js 12445var behavior_scrim = __webpack_require__("./src/partial/js/behavior/scrim.js"); 12446;// CONCATENATED MODULE: ./src/util/tooltip/tooltip.js 12447 12448 12449/** 12450 * Classe de exemplo do comportamento tooltip 12451 */ 12452class TooltipExample { 12453 /** 12454 * Instancia um exemplo de comportamento tooltip 12455 * @param {object} element - Elemento sDOM que representa um componente contento um comportamento de tooltip 12456 */ 12457 constructor(element) { 12458 this.element = element 12459 12460 } 12461 /** 12462 * Inicia comportamento do exemplo 12463 * @private 12464 */ 12465 _setBehavior() { 12466 12467 } 12468 12469 /** 12470 * Encontra os data-tooltip-text e coloca util Tooltip 12471 * @private 12472 */ 12473 12474 run() { 12475 const TooltipExampleList = [] 12476 12477 window.document 12478 .querySelectorAll('[data-tooltip-text]:not(.notification-tooltip)') 12479 .forEach((TooltipExample) => { 12480 const texttooltip = TooltipExample.getAttribute('data-tooltip-text') 12481 const config = { 12482 activator: TooltipExample, 12483 place: 'left', 12484 textTooltip: texttooltip, 12485 12486 } 12487 TooltipExampleList.push(new behavior_tooltip["default"](config)) 12488 }) 12489 12490 document.querySelectorAll('[data-tooltip-target]').forEach((trigger) => { 12491 const targets = document.querySelectorAll( 12492 trigger.getAttribute('data-tooltip-target') 12493 ) 12494 12495 targets.forEach((target) => { 12496 const place = 12497 target.getAttribute('place') !== null 12498 ? target.getAttribute('place') 12499 : 'left' 12500 12501 const config = { 12502 activator: trigger, 12503 component: target, 12504 place: place, 12505 type: 'warning', 12506 12507 } 12508 // const tooltip = new Tooltip(config) 12509 new behavior_tooltip["default"](config) 12510 }) 12511 }) 12512 } 12513} 12514 12515/* harmony default export */ const tooltip_tooltip = (TooltipExample); 12516 12517;// CONCATENATED MODULE: ./src/partial/js/core.behavior.js 12518/** 12519 * Classe que instancia os exemplos de uso dos utilitários 12520 */ 12521 12522// import TooltipExample from '../../util/tooltip/tooltip' 12523 12524 12525 12526 12527 12528// import Tooltip from './behavior/tooltip' 12529// import Tooltip from './behavior/tooltip' 12530 12531 12532class Behavior { 12533 initInstanceAll() { 12534 this._initInstanceAccordionExample() 12535 this._initInstanceCheckGroupExemple() 12536 this._initInstanceCollapseExample() 12537 this._initInstanceDropdownExample() 12538 this._initInstanceTooltipExample() 12539 this._initInstanceScrimExample() 12540 } 12541 12542 _initInstanceCollapseExample() { 12543 const collapseExampleList = [] 12544 window.document 12545 .querySelectorAll('.collapse-example') 12546 .forEach((collapseExample) => { 12547 collapseExampleList.push(new collapse(collapseExample)) 12548 }) 12549 } 12550 12551 _initInstanceAccordionExample() { 12552 const accordionExampleList = [] 12553 window.document 12554 .querySelectorAll('.accordion-example') 12555 .forEach((accordionExample) => { 12556 accordionExampleList.push(new accordion_accordion(accordionExample)) 12557 }) 12558 } 12559 12560 _initInstanceCheckGroupExemple() { 12561 const checkgroupExampleList = [] 12562 window.document 12563 .querySelectorAll('.checkgroup-example') 12564 .forEach((checkgroupExample) => { 12565 checkgroupExampleList.push(new checkgroup(checkgroupExample)) 12566 }) 12567 } 12568 12569 _initInstanceDropdownExample() { 12570 const dropdownExampleList = [] 12571 window.document 12572 .querySelectorAll('.dropdown-example') 12573 .forEach((dropdownExample) => { 12574 dropdownExampleList.push(new dropdown(dropdownExample)) 12575 }) 12576 } 12577 12578 _initInstanceScrimExample() { 12579 for (const buttonBloco1 of window.document.querySelectorAll( 12580 '.scrimutilexemplo button' 12581 )) { 12582 buttonBloco1.addEventListener('click', () => { 12583 const scrscrim = window.document.querySelector('#scrimutilexample') 12584 const scrimfoco = new behavior_scrim["default"]({ 12585 closeElement: '#scrimfechar', 12586 trigger: scrscrim, 12587 }) 12588 scrimfoco.showScrim() 12589 }) 12590 } 12591 } 12592 _initInstanceTooltipExample() { 12593 const x = new tooltip_tooltip() 12594 x.run() 12595 12596 } 12597} 12598 12599// EXTERNAL MODULE: ./src/partial/js/globals-class.js + 1 modules 12600var globals_class = __webpack_require__("./src/partial/js/globals-class.js"); 12601;// CONCATENATED MODULE: ./src/partial/js/core-init.js 12602/* eslint-disable no-unused-vars */ 12603 12604 12605 12606 12607 12608 12609 12610 12611 12612 12613 12614 12615 12616 12617 12618 12619 12620 12621 12622 12623 12624 12625 12626 12627 12628 12629 12630 12631 12632 12633 12634 12635 12636 12637 12638const globals = new globals_class.Globals() 12639globals.initInstanceAll() 12640 12641const behavior = new Behavior() 12642behavior.initInstanceAll() 12643 12644 12645 12646 12647})(); 12648 12649/******/ return __webpack_exports__; 12650/******/ })() 12651; 12652}); 12653//# 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.