@cscfi/csc-ui 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/c-autocomplete_16.cjs.entry.js +6 -8
- package/dist/cjs/c-autocomplete_16.cjs.entry.js.map +1 -1
- package/dist/cjs/csc-ui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/c-autocomplete/c-autocomplete.js +6 -13
- package/dist/collection/components/c-autocomplete/c-autocomplete.js.map +1 -1
- package/dist/collection/components/c-dropdown/c-dropdown.js +0 -1
- package/dist/collection/components/c-dropdown/c-dropdown.js.map +1 -1
- package/dist/components/c-autocomplete.js +7 -8
- package/dist/components/c-autocomplete.js.map +1 -1
- package/dist/components/c-dropdown2.js +0 -1
- package/dist/components/c-dropdown2.js.map +1 -1
- package/dist/csc-ui/csc-ui.esm.js +1 -1
- package/dist/csc-ui/csc-ui.esm.js.map +1 -1
- package/dist/csc-ui/p-6062aaff.entry.js +2 -0
- package/dist/csc-ui/p-6062aaff.entry.js.map +1 -0
- package/dist/esm/c-autocomplete_16.entry.js +6 -8
- package/dist/esm/c-autocomplete_16.entry.js.map +1 -1
- package/dist/esm/csc-ui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/c-autocomplete/c-autocomplete.d.ts +1 -1
- package/package.json +1 -1
- package/dist/csc-ui/p-ee753bac.entry.js +0 -2
- package/dist/csc-ui/p-ee753bac.entry.js.map +0 -1
package/dist/cjs/csc-ui.cjs.js
CHANGED
|
@@ -17,7 +17,7 @@ const patchBrowser = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(options => {
|
|
20
|
-
return index.bootstrapLazy(JSON.parse("[[\"c-data-table.cjs\",[[1,\"c-data-table\",{\"data\":[16],\"externalData\":[4,\"external-data\"],\"headers\":[16],\"hideFooter\":[4,\"hide-footer\"],\"footerOptions\":[16],\"loading\":[4],\"loadingText\":[1,\"loading-text\"],\"noDataText\":[1,\"no-data-text\"],\"pagination\":[1040],\"selectable\":[4],\"singleSelection\":[4,\"single-selection\"],\"selectionProperty\":[1,\"selection-property\"],\"singleExpansion\":[4,\"single-expansion\"],\"sortBy\":[1032,\"sort-by\"],\"sortDirection\":[1025,\"sort-direction\"],\"stickyHeader\":[4,\"sticky-header\"],\"horizontalScrolling\":[4,\"horizontal-scrolling\"],\"_activeRows\":[32],\"_data\":[32],\"_isIndeterminate\":[32],\"_isPaginationSimple\":[32],\"_selections\":[32],\"hasOverflow\":[32],\"hiddenHeaders\":[32],\"initiallyHiddenHeaders\":[32],\"forceRender\":[32],\"breakpoints\":[32],\"markedFooterWidth\":[32],\"parentWidth\":[32],\"firstCellHidden\":[32],\"lastCellHidden\":[32],\"clearSelections\":[64],\"getData\":[64]},null,{\"hiddenHeaders\":[\"onHiddenHeaderChange\"],\"data\":[\"onDataChange\"],\"headers\":[\"onHeaderChange\"],\"singleSelection\":[\"onSingleSelectionChange\"],\"loading\":[\"onLoadingChange\"]}]]],[\"c-navigation-button.cjs\",[[1,\"c-navigation-button\"]]],[\"c-side-navigation.cjs\",[[1,\"c-side-navigation\",{\"mobile\":[4],\"menuVisible\":[1028,\"menu-visible\"]},[[0,\"itemChange\",\"handleChange\"]]]]],[\"c-tabs.cjs\",[[1,\"c-tabs\",{\"value\":[1032],\"borderless\":[4],\"disableAnimation\":[4,\"disable-animation\"],\"justify\":[1],\"mobileBreakpoint\":[2,\"mobile-breakpoint\"],\"vertical\":[4],\"isOverflowing\":[32],\"isMobile\":[32],\"scrollOffset\":[32]},[[1,\"tabFocus\",\"tabFocusHandler\"],[1,\"tabChange\",\"tabChangeHandler\"],[2,\"keydown\",\"handleKeyDown\"],[2,\"keyup\",\"handleKeyUp\"]],{\"justify\":[\"onJustificationChange\"],\"value\":[\"onExternalValueChange\"],\"scrollOffset\":[\"onScrollOffsetChange\"]}]]],[\"c-tag.cjs\",[[1,\"c-tag\",{\"active\":[4],\"block\":[4],\"fit\":[4],\"flat\":[4],\"closeable\":[4],\"badge\":[8]}]]],[\"c-swiper.cjs\",[[4,\"c-swiper\",{\"value\":[1544],\"elementId\":[1,\"id\"],\"isBeginning\":[32],\"isEnd\":[32],\"statusText\":[32]},[[0,\"changeValue\",\"onTabClick\"],[2,\"keyup\",\"handleKeyUp\"]]]]],[\"c-side-navigation-item.cjs\",[[1,\"c-side-navigation-item\",{\"active\":[4],\"href\":[1],\"target\":[1],\"loading\":[4]},[[0,\"itemChange\",\"handleChange\"]],{\"active\":[\"onActiveChange\"]}]]],[\"c-sub-navigation-item.cjs\",[[1,\"c-sub-navigation-item\",{\"active\":[4],\"focusable\":[4],\"href\":[1],\"target\":[1],\"loading\":[4]}]]],[\"c-text-field.cjs\",[[65,\"c-text-field\",{\"autofocus\":[4],\"autocapitalize\":[1],\"autocorrect\":[1],\"autocomplete\":[1],\"disabled\":[4],\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"hostId\":[1,\"id\"],\"trimWhitespace\":[4,\"trim-whitespace\"],\"label\":[1],\"max\":[2],\"min\":[2],\"name\":[1],\"number\":[4],\"placeholder\":[1],\"readonly\":[4],\"required\":[4],\"rows\":[2],\"shadow\":[4],\"step\":[2],\"type\":[1],\"valid\":[4],\"validate\":[4],\"validateOnBlur\":[4,\"validate-on-blur\"],\"validation\":[1],\"value\":[1025],\"isFocused\":[32],\"labelWidth\":[32],\"preSlotWidth\":[32],\"messageOptions\":[32]}]]],[\"c-toasts.cjs\",[[1,\"c-toasts\",{\"absolute\":[4],\"horizontal\":[1],\"vertical\":[1],\"messages\":[32],\"addToast\":[64],\"removeToast\":[64]}]]],[\"c-accordion-item.cjs\",[[1,\"c-accordion-item\",{\"collapsable\":[4],\"heading\":[1],\"value\":[8],\"expanded\":[4],\"outlined\":[4]},[[2,\"keydown\",\"handleKeyDown\"],[0,\"changeValue\",\"stop\"]]]]],[\"c-list-item.cjs\",[[1,\"c-list-item\",{\"active\":[4],\"disabled\":[4],\"disabledByParent\":[4,\"disabled-by-parent\"],\"hoverable\":[4],\"ripple\":[4],\"href\":[1],\"target\":[1]},null,{\"active\":[\"onActiveChange\"]}]]],[\"c-login-card-actions.cjs\",[[1,\"c-login-card-actions\",{\"align\":[1],\"justify\":[1]}]]],[\"c-otp-input.cjs\",[[65,\"c-otp-input\",{\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"elementId\":[1,\"id\"],\"length\":[2],\"valid\":[4],\"validation\":[1],\"statusText\":[32]},null,{\"validation\":[\"onValidationMessageChange\"]}]]],[\"c-radio-group.cjs\",[[65,\"c-radio-group\",{\"value\":[1032],\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"inline\":[4],\"label\":[1],\"color\":[1],\"items\":[16],\"disabled\":[4],\"returnObject\":[4,\"return-object\"],\"required\":[4],\"valid\":[4],\"validation\":[1],\"messageOptions\":[32]},null,{\"validation\":[\"onValidationMessageChange\"],\"valid\":[\"onValidChange\"]}]]],[\"c-swiper-tab.cjs\",[[1,\"c-swiper-tab\",{\"disabled\":[4],\"active\":[4],\"label\":[1],\"hostId\":[1,\"id\"],\"setsize\":[2],\"position\":[2],\"value\":[8]},[[1,\"click\",\"onTabClick\"]]]]],[\"c-tab.cjs\",[[1,\"c-tab\",{\"active\":[4],\"disabled\":[4],\"hostId\":[1,\"id\"],\"position\":[2],\"setsize\":[2],\"value\":[8]},[[1,\"focus\",\"onTabFocus\"],[1,\"keydown\",\"handleKeydown\"]]]]],[\"c-accordion.cjs\",[[1,\"c-accordion\",{\"value\":[1032],\"mandatory\":[4],\"multiple\":[4],\"outlined\":[4]},[[1,\"itemChange\",\"onAccordionItemChange\"]],{\"value\":[\"watchPropHandler\"]}]]],[\"c-alert.cjs\",[[1,\"c-alert\",{\"type\":[1]}]]],[\"c-csc-logo.cjs\",[[1,\"c-csc-logo\",{\"width\":[2]}]]],[\"c-link.cjs\",[[1,\"c-link\",{\"href\":[1],\"underline\":[4],\"target\":[1],\"weight\":[1]}]]],[\"c-list.cjs\",[[0,\"c-list\",{\"disabled\":[4]},null,{\"disabled\":[\"onDisabledChange\"]}]]],[\"c-list-item-title.cjs\",[[1,\"c-list-item-title\",{\"active\":[4]}]]],[\"c-login-button.cjs\",[[1,\"c-login-button\",{\"href\":[1],\"src\":[1],\"alt\":[1]}]]],[\"c-login-buttons.cjs\",[[1,\"c-login-buttons\"]]],[\"c-login-card.cjs\",[[4,\"c-login-card\",{\"backgroundPosition\":[1,\"background-position\"],\"mobileBreakpoint\":[2,\"mobile-breakpoint\"],\"overlay\":[4],\"overlayBlendMode\":[1,\"overlay-blend-mode\"],\"src\":[1],\"path\":[32],\"imageHeight\":[32]}]]],[\"c-login-card-content.cjs\",[[1,\"c-login-card-content\"]]],[\"c-login-card-title.cjs\",[[1,\"c-login-card-title\"]]],[\"c-main.cjs\",[[1,\"c-main\"]]],[\"c-modal.cjs\",[[1,\"c-modal\",{\"value\":[4],\"dismissable\":[4],\"width\":[8],\"zIndex\":[2,\"z-index\"],\"disableBackdropBlur\":[4,\"disable-backdrop-blur\"],\"innerValue\":[32],\"animateModal\":[32]},null,{\"value\":[\"onValueChange\"]}]]],[\"c-option-value.cjs\",[[1,\"c-option-value\"]]],[\"c-page.cjs\",[[1,\"c-page\",{\"scrollIndicator\":[4,\"scroll-indicator\"]}]]],[\"c-progress-bar.cjs\",[[1,\"c-progress-bar\",{\"value\":[2],\"hideDetails\":[4,\"hide-details\"],\"singleLine\":[4,\"single-line\"],\"label\":[1],\"indeterminate\":[4]}]]],[\"c-radio.cjs\",[[1,\"c-radio\",{\"checked\":[4],\"disabled\":[4],\"value\":[1]}]]],[\"c-row.cjs\",[[1,\"c-row\",{\"gap\":[2],\"nowrap\":[4],\"align\":[1],\"justify\":[1]}]]],[\"c-side-navigation-title.cjs\",[[1,\"c-side-navigation-title\"]]],[\"c-slider.cjs\",[[1,\"c-slider\",{\"hostId\":[1,\"id\"],\"hostName\":[1,\"name\"],\"ariaLabel\":[1,\"aria-label\"],\"max\":[1],\"min\":[1],\"step\":[1],\"value\":[8],\"unit\":[1],\"ticks\":[4],\"labels\":[4],\"disableTooltip\":[4,\"disable-tooltip\"],\"label\":[1],\"disabled\":[4],\"segments\":[1],\"trackPosition\":[32],\"tickPositions\":[32]},null,{\"segments\":[\"onSegmentChange\"],\"value\":[\"onValueChange\"]}]]],[\"c-status.cjs\",[[1,\"c-status\",{\"type\":[1]}]]],[\"c-step.cjs\",[[1,\"c-step\",{\"complete\":[4],\"current\":[4]}]]],[\"c-steps.cjs\",[[1,\"c-steps\",{\"value\":[8],\"isMobile\":[32],\"label\":[32]},null,{\"value\":[\"watchPropHandler\"]}]]],[\"c-switch.cjs\",[[65,\"c-switch\",{\"checked\":[1028],\"value\":[8],\"trueValue\":[8,\"true-value\"],\"falseValue\":[8,\"false-value\"],\"hostDisabled\":[4,\"disabled\"],\"hostId\":[1,\"id\"],\"required\":[4],\"hasLabel\":[32]}]]],[\"c-tab-buttons.cjs\",[[1,\"c-tab-buttons\",{\"value\":[1032],\"mandatory\":[4],\"tabs\":[4],\"size\":[1],\"hostDisabled\":[4,\"disabled\"]},[[1,\"tabFocus\",\"tabFocusHandler\"],[2,\"keyup\",\"handleKeyUp\"],[1,\"tabChange\",\"onTabChange\"]],{\"value\":[\"onValueChange\"]}]]],[\"c-tab-item.cjs\",[[1,\"c-tab-item\",{\"value\":[8],\"active\":[4]}]]],[\"c-tab-items.cjs\",[[1,\"c-tab-items\",{\"value\":[8],\"disableAnimation\":[4,\"disable-animation\"],\"activeTab\":[32]},[[1,\"contentChange\",\"tabContentChangeHandler\"]],{\"value\":[\"onValueChange\"]}]]],[\"c-table.cjs\",[[4,\"c-table\",{\"mobileBreakpoint\":[2,\"mobile-breakpoint\"],\"responsive\":[4]}]]],[\"c-tags.cjs\",[[1,\"c-tags\"]]],[\"c-toolbar.cjs\",[[1,\"c-toolbar\"]]],[\"c-autocomplete_16.cjs\",[[65,\"c-autocomplete\",{\"items\":[16],\"value\":[8],\"query\":[1],\"hostId\":[1,\"id\"],\"disabled\":[4],\"label\":[1],\"name\":[1],\"placeholder\":[1],\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"loading\":[4],\"required\":[4],\"valid\":[4],\"validate\":[4],\"validateOnBlur\":[4,\"validate-on-blur\"],\"validation\":[1],\"shadow\":[4],\"returnObject\":[4,\"return-object\"],\"itemsPerPage\":[2,\"items-per-page\"],\"optionElements\":[32],\"currentIndex\":[32],\"dropdownVisible\":[32],\"statusText\":[32],\"optionElementsExist\":[32],\"reset\":[64]},[[1,\"keydown\",\"handleKeyDown\"],[0,\"dropdownStateChange\",\"onDropdownStateChange\"],[0,\"selectOption\",\"onSelectOption\"]],{\"query\":[\"handleQueryChange\"]}],[65,\"c-select\",{\"items\":[16],\"value\":[8],\"hostId\":[1,\"id\"],\"clearable\":[4],\"disabled\":[4],\"label\":[1],\"name\":[1],\"placeholder\":[1],\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"loading\":[4],\"required\":[4],\"valid\":[4],\"validate\":[4],\"validateOnBlur\":[4,\"validate-on-blur\"],\"validation\":[1],\"shadow\":[4],\"returnObject\":[4,\"return-object\"],\"itemsPerPage\":[2,\"items-per-page\"],\"optionAsSelection\":[4,\"option-as-selection\"],\"optionElements\":[32],\"currentIndex\":[32],\"dropdownVisible\":[32],\"statusText\":[32],\"optionElementsExist\":[32],\"reset\":[64]},[[1,\"keydown\",\"handleKeyDown\"],[0,\"dropdownStateChange\",\"onDropdownStateChange\"],[0,\"selectOption\",\"onSelectOption\"]]],[1,\"c-card\",{\"fullscreen\":[4],\"isFullscreen\":[32],\"exitFullscreen\":[64],\"enterFullscreen\":[64]}],[1,\"c-button\",{\"inverted\":[4],\"outlined\":[4],\"ghost\":[4],\"danger\":[4],\"grouped\":[4],\"text\":[4],\"loading\":[4],\"fit\":[4],\"noRadius\":[4,\"no-radius\"],\"type\":[1],\"disabled\":[516],\"value\":[8],\"hostId\":[1,\"id\"],\"size\":[1],\"href\":[1],\"target\":[1],\"tabs\":[4]},[[1,\"focus\",\"onTabFocus\"]]],[1,\"c-card-content\"],[1,\"c-card-title\"],[1,\"c-option\",{\"selected\":[4],\"disabled\":[4],\"name\":[1],\"value\":[8]}],[1,\"c-card-actions\",{\"align\":[1],\"justify\":[1]}],[1,\"c-dropdown\",{\"itemsPerPage\":[2,\"items-per-page\"],\"parent\":[16],\"items\":[16],\"index\":[2],\"hostId\":[1,\"id\"],\"type\":[1],\"itemType\":[1,\"item-type\"],\"renderedList\":[32],\"isOpen\":[32],\"statusText\":[32],\"setStatusText\":[64],\"focusItem\":[64],\"open\":[64],\"close\":[64],\"selectItem\":[64],\"updateList\":[64]},null,{\"items\":[\"optionsWatcher\"],\"isOpen\":[\"stateWatcher\"],\"index\":[\"handleIndexChange\"]}],[4,\"c-input\",{\"active\":[4],\"autofocus\":[4],\"disabled\":[4],\"form\":[4],\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"hostId\":[1,\"id\"],\"inputId\":[1,\"input-id\"],\"items\":[16],\"itemsPerPage\":[2,\"items-per-page\"],\"label\":[1],\"max\":[2],\"min\":[2],\"name\":[1],\"placeholder\":[1],\"readonly\":[4],\"required\":[4],\"rows\":[2],\"shadow\":[4],\"step\":[2],\"type\":[1],\"valid\":[4],\"validate\":[4],\"validateOnBlur\":[4,\"validate-on-blur\"],\"validation\":[1],\"value\":[8],\"variant\":[1],\"isFocused\":[32],\"labelWidth\":[32],\"preSlotWidth\":[32],\"statusText\":[32],\"currentIndex\":[32],\"reset\":[64]},null,{\"valid\":[\"onValidChange\"],\"validation\":[\"onValidationMessageChange\"],\"value\":[\"onValueChange\"],\"placeholder\":[\"onPlaceholderChange\"]}],[1,\"c-message\",{\"hint\":[1],\"inputId\":[1,\"input-id\"],\"valid\":[4],\"validation\":[1],\"messageOptions\":[32]},null,{\"valid\":[\"onValidChange\"],\"validation\":[\"onValidationMessageChange\"],\"hint\":[\"onHintMessageChange\"]}],[1,\"c-icon-button\",{\"badge\":[1],\"danger\":[4],\"loading\":[4],\"text\":[4],\"inverted\":[4],\"outlined\":[4],\"path\":[1],\"ghost\":[4],\"disabled\":[4],\"size\":[1]}],[1,\"c-badge\"],[1,\"c-icon\",{\"path\":[1],\"size\":[2],\"color\":[1]}],[1,\"c-spinner\",{\"color\":[1],\"size\":[2],\"width\":[2]}],[1,\"c-ripple\",{\"createRipple\":[64]}]]],[\"c-toast.cjs\",[[1,\"c-toast\",{\"message\":[16],\"closeToast\":[64]}]]],[\"c-loader.cjs\",[[1,\"c-loader\",{\"contentdelay\":[2],\"hide\":[4],\"size\":[2],\"width\":[2]},null,{\"hide\":[\"onElementHide\"]}]]],[\"c-menu_2.cjs\",[[1,\"c-menu\",{\"items\":[16],\"contentClass\":[1,\"content-class\"],\"custom\":[4],\"small\":[4],\"flat\":[4],\"itemsPerPage\":[2,\"items-per-page\"],\"menuItemsComponent\":[32],\"menuWrapperComponent\":[32],\"currentIndex\":[32],\"active\":[32]},[[2,\"keydown\",\"handleKeyDown\"]]],[1,\"c-menu-items\",{\"items\":[16],\"small\":[4],\"active\":[4],\"parentType\":[1,\"parent-type\"],\"parent\":[16],\"top\":[2],\"index\":[2],\"itemsPerPage\":[2,\"items-per-page\"],\"scrollingParent\":[32],\"isInView\":[32],\"currentIndex\":[32]},[[2,\"keydown\",\"handleKeyDown\"]],{\"currentIndex\":[\"onIndexChange\"]}]]],[\"c-checkbox_3.cjs\",[[1,\"c-pagination\",{\"value\":[16],\"hideDetails\":[4,\"hide-details\"],\"simple\":[4],\"size\":[1],\"hideRange\":[4,\"hide-range\"],\"itemsPerPageOptions\":[16],\"_currentPage\":[32],\"_itemsPerPage\":[32],\"_totalVisible\":[32],\"tick\":[32]},null,{\"value\":[\"valueHandler\"]}],[65,\"c-checkbox\",{\"checked\":[1028],\"disabled\":[4],\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"indeterminate\":[4],\"label\":[1],\"required\":[4],\"valid\":[4],\"validation\":[1],\"value\":[8],\"trueValue\":[8,\"true-value\"],\"falseValue\":[8,\"false-value\"],\"hostName\":[1,\"name\"],\"messageOptions\":[32]},[[1,\"keydown\",\"handleKeyDown\"]],{\"validation\":[\"onValidationMessageChange\"],\"valid\":[\"onValidChange\"]}],[1,\"c-spacer\"]]]]"), options);
|
|
20
|
+
return index.bootstrapLazy(JSON.parse("[[\"c-data-table.cjs\",[[1,\"c-data-table\",{\"data\":[16],\"externalData\":[4,\"external-data\"],\"headers\":[16],\"hideFooter\":[4,\"hide-footer\"],\"footerOptions\":[16],\"loading\":[4],\"loadingText\":[1,\"loading-text\"],\"noDataText\":[1,\"no-data-text\"],\"pagination\":[1040],\"selectable\":[4],\"singleSelection\":[4,\"single-selection\"],\"selectionProperty\":[1,\"selection-property\"],\"singleExpansion\":[4,\"single-expansion\"],\"sortBy\":[1032,\"sort-by\"],\"sortDirection\":[1025,\"sort-direction\"],\"stickyHeader\":[4,\"sticky-header\"],\"horizontalScrolling\":[4,\"horizontal-scrolling\"],\"_activeRows\":[32],\"_data\":[32],\"_isIndeterminate\":[32],\"_isPaginationSimple\":[32],\"_selections\":[32],\"hasOverflow\":[32],\"hiddenHeaders\":[32],\"initiallyHiddenHeaders\":[32],\"forceRender\":[32],\"breakpoints\":[32],\"markedFooterWidth\":[32],\"parentWidth\":[32],\"firstCellHidden\":[32],\"lastCellHidden\":[32],\"clearSelections\":[64],\"getData\":[64]},null,{\"hiddenHeaders\":[\"onHiddenHeaderChange\"],\"data\":[\"onDataChange\"],\"headers\":[\"onHeaderChange\"],\"singleSelection\":[\"onSingleSelectionChange\"],\"loading\":[\"onLoadingChange\"]}]]],[\"c-navigation-button.cjs\",[[1,\"c-navigation-button\"]]],[\"c-side-navigation.cjs\",[[1,\"c-side-navigation\",{\"mobile\":[4],\"menuVisible\":[1028,\"menu-visible\"]},[[0,\"itemChange\",\"handleChange\"]]]]],[\"c-tabs.cjs\",[[1,\"c-tabs\",{\"value\":[1032],\"borderless\":[4],\"disableAnimation\":[4,\"disable-animation\"],\"justify\":[1],\"mobileBreakpoint\":[2,\"mobile-breakpoint\"],\"vertical\":[4],\"isOverflowing\":[32],\"isMobile\":[32],\"scrollOffset\":[32]},[[1,\"tabFocus\",\"tabFocusHandler\"],[1,\"tabChange\",\"tabChangeHandler\"],[2,\"keydown\",\"handleKeyDown\"],[2,\"keyup\",\"handleKeyUp\"]],{\"justify\":[\"onJustificationChange\"],\"value\":[\"onExternalValueChange\"],\"scrollOffset\":[\"onScrollOffsetChange\"]}]]],[\"c-tag.cjs\",[[1,\"c-tag\",{\"active\":[4],\"block\":[4],\"fit\":[4],\"flat\":[4],\"closeable\":[4],\"badge\":[8]}]]],[\"c-swiper.cjs\",[[4,\"c-swiper\",{\"value\":[1544],\"elementId\":[1,\"id\"],\"isBeginning\":[32],\"isEnd\":[32],\"statusText\":[32]},[[0,\"changeValue\",\"onTabClick\"],[2,\"keyup\",\"handleKeyUp\"]]]]],[\"c-side-navigation-item.cjs\",[[1,\"c-side-navigation-item\",{\"active\":[4],\"href\":[1],\"target\":[1],\"loading\":[4]},[[0,\"itemChange\",\"handleChange\"]],{\"active\":[\"onActiveChange\"]}]]],[\"c-sub-navigation-item.cjs\",[[1,\"c-sub-navigation-item\",{\"active\":[4],\"focusable\":[4],\"href\":[1],\"target\":[1],\"loading\":[4]}]]],[\"c-text-field.cjs\",[[65,\"c-text-field\",{\"autofocus\":[4],\"autocapitalize\":[1],\"autocorrect\":[1],\"autocomplete\":[1],\"disabled\":[4],\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"hostId\":[1,\"id\"],\"trimWhitespace\":[4,\"trim-whitespace\"],\"label\":[1],\"max\":[2],\"min\":[2],\"name\":[1],\"number\":[4],\"placeholder\":[1],\"readonly\":[4],\"required\":[4],\"rows\":[2],\"shadow\":[4],\"step\":[2],\"type\":[1],\"valid\":[4],\"validate\":[4],\"validateOnBlur\":[4,\"validate-on-blur\"],\"validation\":[1],\"value\":[1025],\"isFocused\":[32],\"labelWidth\":[32],\"preSlotWidth\":[32],\"messageOptions\":[32]}]]],[\"c-toasts.cjs\",[[1,\"c-toasts\",{\"absolute\":[4],\"horizontal\":[1],\"vertical\":[1],\"messages\":[32],\"addToast\":[64],\"removeToast\":[64]}]]],[\"c-accordion-item.cjs\",[[1,\"c-accordion-item\",{\"collapsable\":[4],\"heading\":[1],\"value\":[8],\"expanded\":[4],\"outlined\":[4]},[[2,\"keydown\",\"handleKeyDown\"],[0,\"changeValue\",\"stop\"]]]]],[\"c-list-item.cjs\",[[1,\"c-list-item\",{\"active\":[4],\"disabled\":[4],\"disabledByParent\":[4,\"disabled-by-parent\"],\"hoverable\":[4],\"ripple\":[4],\"href\":[1],\"target\":[1]},null,{\"active\":[\"onActiveChange\"]}]]],[\"c-login-card-actions.cjs\",[[1,\"c-login-card-actions\",{\"align\":[1],\"justify\":[1]}]]],[\"c-otp-input.cjs\",[[65,\"c-otp-input\",{\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"elementId\":[1,\"id\"],\"length\":[2],\"valid\":[4],\"validation\":[1],\"statusText\":[32]},null,{\"validation\":[\"onValidationMessageChange\"]}]]],[\"c-radio-group.cjs\",[[65,\"c-radio-group\",{\"value\":[1032],\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"inline\":[4],\"label\":[1],\"color\":[1],\"items\":[16],\"disabled\":[4],\"returnObject\":[4,\"return-object\"],\"required\":[4],\"valid\":[4],\"validation\":[1],\"messageOptions\":[32]},null,{\"validation\":[\"onValidationMessageChange\"],\"valid\":[\"onValidChange\"]}]]],[\"c-swiper-tab.cjs\",[[1,\"c-swiper-tab\",{\"disabled\":[4],\"active\":[4],\"label\":[1],\"hostId\":[1,\"id\"],\"setsize\":[2],\"position\":[2],\"value\":[8]},[[1,\"click\",\"onTabClick\"]]]]],[\"c-tab.cjs\",[[1,\"c-tab\",{\"active\":[4],\"disabled\":[4],\"hostId\":[1,\"id\"],\"position\":[2],\"setsize\":[2],\"value\":[8]},[[1,\"focus\",\"onTabFocus\"],[1,\"keydown\",\"handleKeydown\"]]]]],[\"c-accordion.cjs\",[[1,\"c-accordion\",{\"value\":[1032],\"mandatory\":[4],\"multiple\":[4],\"outlined\":[4]},[[1,\"itemChange\",\"onAccordionItemChange\"]],{\"value\":[\"watchPropHandler\"]}]]],[\"c-alert.cjs\",[[1,\"c-alert\",{\"type\":[1]}]]],[\"c-csc-logo.cjs\",[[1,\"c-csc-logo\",{\"width\":[2]}]]],[\"c-link.cjs\",[[1,\"c-link\",{\"href\":[1],\"underline\":[4],\"target\":[1],\"weight\":[1]}]]],[\"c-list.cjs\",[[0,\"c-list\",{\"disabled\":[4]},null,{\"disabled\":[\"onDisabledChange\"]}]]],[\"c-list-item-title.cjs\",[[1,\"c-list-item-title\",{\"active\":[4]}]]],[\"c-login-button.cjs\",[[1,\"c-login-button\",{\"href\":[1],\"src\":[1],\"alt\":[1]}]]],[\"c-login-buttons.cjs\",[[1,\"c-login-buttons\"]]],[\"c-login-card.cjs\",[[4,\"c-login-card\",{\"backgroundPosition\":[1,\"background-position\"],\"mobileBreakpoint\":[2,\"mobile-breakpoint\"],\"overlay\":[4],\"overlayBlendMode\":[1,\"overlay-blend-mode\"],\"src\":[1],\"path\":[32],\"imageHeight\":[32]}]]],[\"c-login-card-content.cjs\",[[1,\"c-login-card-content\"]]],[\"c-login-card-title.cjs\",[[1,\"c-login-card-title\"]]],[\"c-main.cjs\",[[1,\"c-main\"]]],[\"c-modal.cjs\",[[1,\"c-modal\",{\"value\":[4],\"dismissable\":[4],\"width\":[8],\"zIndex\":[2,\"z-index\"],\"disableBackdropBlur\":[4,\"disable-backdrop-blur\"],\"innerValue\":[32],\"animateModal\":[32]},null,{\"value\":[\"onValueChange\"]}]]],[\"c-option-value.cjs\",[[1,\"c-option-value\"]]],[\"c-page.cjs\",[[1,\"c-page\",{\"scrollIndicator\":[4,\"scroll-indicator\"]}]]],[\"c-progress-bar.cjs\",[[1,\"c-progress-bar\",{\"value\":[2],\"hideDetails\":[4,\"hide-details\"],\"singleLine\":[4,\"single-line\"],\"label\":[1],\"indeterminate\":[4]}]]],[\"c-radio.cjs\",[[1,\"c-radio\",{\"checked\":[4],\"disabled\":[4],\"value\":[1]}]]],[\"c-row.cjs\",[[1,\"c-row\",{\"gap\":[2],\"nowrap\":[4],\"align\":[1],\"justify\":[1]}]]],[\"c-side-navigation-title.cjs\",[[1,\"c-side-navigation-title\"]]],[\"c-slider.cjs\",[[1,\"c-slider\",{\"hostId\":[1,\"id\"],\"hostName\":[1,\"name\"],\"ariaLabel\":[1,\"aria-label\"],\"max\":[1],\"min\":[1],\"step\":[1],\"value\":[8],\"unit\":[1],\"ticks\":[4],\"labels\":[4],\"disableTooltip\":[4,\"disable-tooltip\"],\"label\":[1],\"disabled\":[4],\"segments\":[1],\"trackPosition\":[32],\"tickPositions\":[32]},null,{\"segments\":[\"onSegmentChange\"],\"value\":[\"onValueChange\"]}]]],[\"c-status.cjs\",[[1,\"c-status\",{\"type\":[1]}]]],[\"c-step.cjs\",[[1,\"c-step\",{\"complete\":[4],\"current\":[4]}]]],[\"c-steps.cjs\",[[1,\"c-steps\",{\"value\":[8],\"isMobile\":[32],\"label\":[32]},null,{\"value\":[\"watchPropHandler\"]}]]],[\"c-switch.cjs\",[[65,\"c-switch\",{\"checked\":[1028],\"value\":[8],\"trueValue\":[8,\"true-value\"],\"falseValue\":[8,\"false-value\"],\"hostDisabled\":[4,\"disabled\"],\"hostId\":[1,\"id\"],\"required\":[4],\"hasLabel\":[32]}]]],[\"c-tab-buttons.cjs\",[[1,\"c-tab-buttons\",{\"value\":[1032],\"mandatory\":[4],\"tabs\":[4],\"size\":[1],\"hostDisabled\":[4,\"disabled\"]},[[1,\"tabFocus\",\"tabFocusHandler\"],[2,\"keyup\",\"handleKeyUp\"],[1,\"tabChange\",\"onTabChange\"]],{\"value\":[\"onValueChange\"]}]]],[\"c-tab-item.cjs\",[[1,\"c-tab-item\",{\"value\":[8],\"active\":[4]}]]],[\"c-tab-items.cjs\",[[1,\"c-tab-items\",{\"value\":[8],\"disableAnimation\":[4,\"disable-animation\"],\"activeTab\":[32]},[[1,\"contentChange\",\"tabContentChangeHandler\"]],{\"value\":[\"onValueChange\"]}]]],[\"c-table.cjs\",[[4,\"c-table\",{\"mobileBreakpoint\":[2,\"mobile-breakpoint\"],\"responsive\":[4]}]]],[\"c-tags.cjs\",[[1,\"c-tags\"]]],[\"c-toolbar.cjs\",[[1,\"c-toolbar\"]]],[\"c-autocomplete_16.cjs\",[[65,\"c-autocomplete\",{\"items\":[16],\"value\":[8],\"query\":[1],\"hostId\":[1,\"id\"],\"disabled\":[4],\"label\":[1],\"name\":[1],\"placeholder\":[1],\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"loading\":[4],\"required\":[4],\"valid\":[4],\"validate\":[4],\"validateOnBlur\":[4,\"validate-on-blur\"],\"validation\":[1],\"shadow\":[4],\"returnObject\":[4,\"return-object\"],\"itemsPerPage\":[2,\"items-per-page\"],\"optionElements\":[32],\"currentIndex\":[32],\"dropdownVisible\":[32],\"statusText\":[32],\"optionElementsExist\":[32],\"reset\":[64]},[[0,\"dropdownStateChange\",\"onDropdownStateChange\"],[0,\"selectOption\",\"onSelectOption\"]],{\"query\":[\"handleQueryChange\"]}],[65,\"c-select\",{\"items\":[16],\"value\":[8],\"hostId\":[1,\"id\"],\"clearable\":[4],\"disabled\":[4],\"label\":[1],\"name\":[1],\"placeholder\":[1],\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"loading\":[4],\"required\":[4],\"valid\":[4],\"validate\":[4],\"validateOnBlur\":[4,\"validate-on-blur\"],\"validation\":[1],\"shadow\":[4],\"returnObject\":[4,\"return-object\"],\"itemsPerPage\":[2,\"items-per-page\"],\"optionAsSelection\":[4,\"option-as-selection\"],\"optionElements\":[32],\"currentIndex\":[32],\"dropdownVisible\":[32],\"statusText\":[32],\"optionElementsExist\":[32],\"reset\":[64]},[[1,\"keydown\",\"handleKeyDown\"],[0,\"dropdownStateChange\",\"onDropdownStateChange\"],[0,\"selectOption\",\"onSelectOption\"]]],[1,\"c-card\",{\"fullscreen\":[4],\"isFullscreen\":[32],\"exitFullscreen\":[64],\"enterFullscreen\":[64]}],[1,\"c-button\",{\"inverted\":[4],\"outlined\":[4],\"ghost\":[4],\"danger\":[4],\"grouped\":[4],\"text\":[4],\"loading\":[4],\"fit\":[4],\"noRadius\":[4,\"no-radius\"],\"type\":[1],\"disabled\":[516],\"value\":[8],\"hostId\":[1,\"id\"],\"size\":[1],\"href\":[1],\"target\":[1],\"tabs\":[4]},[[1,\"focus\",\"onTabFocus\"]]],[1,\"c-card-content\"],[1,\"c-card-title\"],[1,\"c-option\",{\"selected\":[4],\"disabled\":[4],\"name\":[1],\"value\":[8]}],[1,\"c-card-actions\",{\"align\":[1],\"justify\":[1]}],[1,\"c-dropdown\",{\"itemsPerPage\":[2,\"items-per-page\"],\"parent\":[16],\"items\":[16],\"index\":[2],\"hostId\":[1,\"id\"],\"type\":[1],\"itemType\":[1,\"item-type\"],\"renderedList\":[32],\"isOpen\":[32],\"statusText\":[32],\"setStatusText\":[64],\"focusItem\":[64],\"open\":[64],\"close\":[64],\"selectItem\":[64],\"updateList\":[64]},null,{\"items\":[\"optionsWatcher\"],\"isOpen\":[\"stateWatcher\"],\"index\":[\"handleIndexChange\"]}],[4,\"c-input\",{\"active\":[4],\"autofocus\":[4],\"disabled\":[4],\"form\":[4],\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"hostId\":[1,\"id\"],\"inputId\":[1,\"input-id\"],\"items\":[16],\"itemsPerPage\":[2,\"items-per-page\"],\"label\":[1],\"max\":[2],\"min\":[2],\"name\":[1],\"placeholder\":[1],\"readonly\":[4],\"required\":[4],\"rows\":[2],\"shadow\":[4],\"step\":[2],\"type\":[1],\"valid\":[4],\"validate\":[4],\"validateOnBlur\":[4,\"validate-on-blur\"],\"validation\":[1],\"value\":[8],\"variant\":[1],\"isFocused\":[32],\"labelWidth\":[32],\"preSlotWidth\":[32],\"statusText\":[32],\"currentIndex\":[32],\"reset\":[64]},null,{\"valid\":[\"onValidChange\"],\"validation\":[\"onValidationMessageChange\"],\"value\":[\"onValueChange\"],\"placeholder\":[\"onPlaceholderChange\"]}],[1,\"c-message\",{\"hint\":[1],\"inputId\":[1,\"input-id\"],\"valid\":[4],\"validation\":[1],\"messageOptions\":[32]},null,{\"valid\":[\"onValidChange\"],\"validation\":[\"onValidationMessageChange\"],\"hint\":[\"onHintMessageChange\"]}],[1,\"c-icon-button\",{\"badge\":[1],\"danger\":[4],\"loading\":[4],\"text\":[4],\"inverted\":[4],\"outlined\":[4],\"path\":[1],\"ghost\":[4],\"disabled\":[4],\"size\":[1]}],[1,\"c-badge\"],[1,\"c-icon\",{\"path\":[1],\"size\":[2],\"color\":[1]}],[1,\"c-spinner\",{\"color\":[1],\"size\":[2],\"width\":[2]}],[1,\"c-ripple\",{\"createRipple\":[64]}]]],[\"c-toast.cjs\",[[1,\"c-toast\",{\"message\":[16],\"closeToast\":[64]}]]],[\"c-loader.cjs\",[[1,\"c-loader\",{\"contentdelay\":[2],\"hide\":[4],\"size\":[2],\"width\":[2]},null,{\"hide\":[\"onElementHide\"]}]]],[\"c-menu_2.cjs\",[[1,\"c-menu\",{\"items\":[16],\"contentClass\":[1,\"content-class\"],\"custom\":[4],\"small\":[4],\"flat\":[4],\"itemsPerPage\":[2,\"items-per-page\"],\"menuItemsComponent\":[32],\"menuWrapperComponent\":[32],\"currentIndex\":[32],\"active\":[32]},[[2,\"keydown\",\"handleKeyDown\"]]],[1,\"c-menu-items\",{\"items\":[16],\"small\":[4],\"active\":[4],\"parentType\":[1,\"parent-type\"],\"parent\":[16],\"top\":[2],\"index\":[2],\"itemsPerPage\":[2,\"items-per-page\"],\"scrollingParent\":[32],\"isInView\":[32],\"currentIndex\":[32]},[[2,\"keydown\",\"handleKeyDown\"]],{\"currentIndex\":[\"onIndexChange\"]}]]],[\"c-checkbox_3.cjs\",[[1,\"c-pagination\",{\"value\":[16],\"hideDetails\":[4,\"hide-details\"],\"simple\":[4],\"size\":[1],\"hideRange\":[4,\"hide-range\"],\"itemsPerPageOptions\":[16],\"_currentPage\":[32],\"_itemsPerPage\":[32],\"_totalVisible\":[32],\"tick\":[32]},null,{\"value\":[\"valueHandler\"]}],[65,\"c-checkbox\",{\"checked\":[1028],\"disabled\":[4],\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"indeterminate\":[4],\"label\":[1],\"required\":[4],\"valid\":[4],\"validation\":[1],\"value\":[8],\"trueValue\":[8,\"true-value\"],\"falseValue\":[8,\"false-value\"],\"hostName\":[1,\"name\"],\"messageOptions\":[32]},[[1,\"keydown\",\"handleKeyDown\"]],{\"validation\":[\"onValidationMessageChange\"],\"valid\":[\"onValidChange\"]}],[1,\"c-spacer\"]]]]"), options);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.setNonce = index.setNonce;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@ const index = require('./index-91ba22ab.js');
|
|
|
6
6
|
|
|
7
7
|
const defineCustomElements = (win, options) => {
|
|
8
8
|
if (typeof window === 'undefined') return undefined;
|
|
9
|
-
return index.bootstrapLazy(JSON.parse("[[\"c-data-table.cjs\",[[1,\"c-data-table\",{\"data\":[16],\"externalData\":[4,\"external-data\"],\"headers\":[16],\"hideFooter\":[4,\"hide-footer\"],\"footerOptions\":[16],\"loading\":[4],\"loadingText\":[1,\"loading-text\"],\"noDataText\":[1,\"no-data-text\"],\"pagination\":[1040],\"selectable\":[4],\"singleSelection\":[4,\"single-selection\"],\"selectionProperty\":[1,\"selection-property\"],\"singleExpansion\":[4,\"single-expansion\"],\"sortBy\":[1032,\"sort-by\"],\"sortDirection\":[1025,\"sort-direction\"],\"stickyHeader\":[4,\"sticky-header\"],\"horizontalScrolling\":[4,\"horizontal-scrolling\"],\"_activeRows\":[32],\"_data\":[32],\"_isIndeterminate\":[32],\"_isPaginationSimple\":[32],\"_selections\":[32],\"hasOverflow\":[32],\"hiddenHeaders\":[32],\"initiallyHiddenHeaders\":[32],\"forceRender\":[32],\"breakpoints\":[32],\"markedFooterWidth\":[32],\"parentWidth\":[32],\"firstCellHidden\":[32],\"lastCellHidden\":[32],\"clearSelections\":[64],\"getData\":[64]},null,{\"hiddenHeaders\":[\"onHiddenHeaderChange\"],\"data\":[\"onDataChange\"],\"headers\":[\"onHeaderChange\"],\"singleSelection\":[\"onSingleSelectionChange\"],\"loading\":[\"onLoadingChange\"]}]]],[\"c-navigation-button.cjs\",[[1,\"c-navigation-button\"]]],[\"c-side-navigation.cjs\",[[1,\"c-side-navigation\",{\"mobile\":[4],\"menuVisible\":[1028,\"menu-visible\"]},[[0,\"itemChange\",\"handleChange\"]]]]],[\"c-tabs.cjs\",[[1,\"c-tabs\",{\"value\":[1032],\"borderless\":[4],\"disableAnimation\":[4,\"disable-animation\"],\"justify\":[1],\"mobileBreakpoint\":[2,\"mobile-breakpoint\"],\"vertical\":[4],\"isOverflowing\":[32],\"isMobile\":[32],\"scrollOffset\":[32]},[[1,\"tabFocus\",\"tabFocusHandler\"],[1,\"tabChange\",\"tabChangeHandler\"],[2,\"keydown\",\"handleKeyDown\"],[2,\"keyup\",\"handleKeyUp\"]],{\"justify\":[\"onJustificationChange\"],\"value\":[\"onExternalValueChange\"],\"scrollOffset\":[\"onScrollOffsetChange\"]}]]],[\"c-tag.cjs\",[[1,\"c-tag\",{\"active\":[4],\"block\":[4],\"fit\":[4],\"flat\":[4],\"closeable\":[4],\"badge\":[8]}]]],[\"c-swiper.cjs\",[[4,\"c-swiper\",{\"value\":[1544],\"elementId\":[1,\"id\"],\"isBeginning\":[32],\"isEnd\":[32],\"statusText\":[32]},[[0,\"changeValue\",\"onTabClick\"],[2,\"keyup\",\"handleKeyUp\"]]]]],[\"c-side-navigation-item.cjs\",[[1,\"c-side-navigation-item\",{\"active\":[4],\"href\":[1],\"target\":[1],\"loading\":[4]},[[0,\"itemChange\",\"handleChange\"]],{\"active\":[\"onActiveChange\"]}]]],[\"c-sub-navigation-item.cjs\",[[1,\"c-sub-navigation-item\",{\"active\":[4],\"focusable\":[4],\"href\":[1],\"target\":[1],\"loading\":[4]}]]],[\"c-text-field.cjs\",[[65,\"c-text-field\",{\"autofocus\":[4],\"autocapitalize\":[1],\"autocorrect\":[1],\"autocomplete\":[1],\"disabled\":[4],\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"hostId\":[1,\"id\"],\"trimWhitespace\":[4,\"trim-whitespace\"],\"label\":[1],\"max\":[2],\"min\":[2],\"name\":[1],\"number\":[4],\"placeholder\":[1],\"readonly\":[4],\"required\":[4],\"rows\":[2],\"shadow\":[4],\"step\":[2],\"type\":[1],\"valid\":[4],\"validate\":[4],\"validateOnBlur\":[4,\"validate-on-blur\"],\"validation\":[1],\"value\":[1025],\"isFocused\":[32],\"labelWidth\":[32],\"preSlotWidth\":[32],\"messageOptions\":[32]}]]],[\"c-toasts.cjs\",[[1,\"c-toasts\",{\"absolute\":[4],\"horizontal\":[1],\"vertical\":[1],\"messages\":[32],\"addToast\":[64],\"removeToast\":[64]}]]],[\"c-accordion-item.cjs\",[[1,\"c-accordion-item\",{\"collapsable\":[4],\"heading\":[1],\"value\":[8],\"expanded\":[4],\"outlined\":[4]},[[2,\"keydown\",\"handleKeyDown\"],[0,\"changeValue\",\"stop\"]]]]],[\"c-list-item.cjs\",[[1,\"c-list-item\",{\"active\":[4],\"disabled\":[4],\"disabledByParent\":[4,\"disabled-by-parent\"],\"hoverable\":[4],\"ripple\":[4],\"href\":[1],\"target\":[1]},null,{\"active\":[\"onActiveChange\"]}]]],[\"c-login-card-actions.cjs\",[[1,\"c-login-card-actions\",{\"align\":[1],\"justify\":[1]}]]],[\"c-otp-input.cjs\",[[65,\"c-otp-input\",{\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"elementId\":[1,\"id\"],\"length\":[2],\"valid\":[4],\"validation\":[1],\"statusText\":[32]},null,{\"validation\":[\"onValidationMessageChange\"]}]]],[\"c-radio-group.cjs\",[[65,\"c-radio-group\",{\"value\":[1032],\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"inline\":[4],\"label\":[1],\"color\":[1],\"items\":[16],\"disabled\":[4],\"returnObject\":[4,\"return-object\"],\"required\":[4],\"valid\":[4],\"validation\":[1],\"messageOptions\":[32]},null,{\"validation\":[\"onValidationMessageChange\"],\"valid\":[\"onValidChange\"]}]]],[\"c-swiper-tab.cjs\",[[1,\"c-swiper-tab\",{\"disabled\":[4],\"active\":[4],\"label\":[1],\"hostId\":[1,\"id\"],\"setsize\":[2],\"position\":[2],\"value\":[8]},[[1,\"click\",\"onTabClick\"]]]]],[\"c-tab.cjs\",[[1,\"c-tab\",{\"active\":[4],\"disabled\":[4],\"hostId\":[1,\"id\"],\"position\":[2],\"setsize\":[2],\"value\":[8]},[[1,\"focus\",\"onTabFocus\"],[1,\"keydown\",\"handleKeydown\"]]]]],[\"c-accordion.cjs\",[[1,\"c-accordion\",{\"value\":[1032],\"mandatory\":[4],\"multiple\":[4],\"outlined\":[4]},[[1,\"itemChange\",\"onAccordionItemChange\"]],{\"value\":[\"watchPropHandler\"]}]]],[\"c-alert.cjs\",[[1,\"c-alert\",{\"type\":[1]}]]],[\"c-csc-logo.cjs\",[[1,\"c-csc-logo\",{\"width\":[2]}]]],[\"c-link.cjs\",[[1,\"c-link\",{\"href\":[1],\"underline\":[4],\"target\":[1],\"weight\":[1]}]]],[\"c-list.cjs\",[[0,\"c-list\",{\"disabled\":[4]},null,{\"disabled\":[\"onDisabledChange\"]}]]],[\"c-list-item-title.cjs\",[[1,\"c-list-item-title\",{\"active\":[4]}]]],[\"c-login-button.cjs\",[[1,\"c-login-button\",{\"href\":[1],\"src\":[1],\"alt\":[1]}]]],[\"c-login-buttons.cjs\",[[1,\"c-login-buttons\"]]],[\"c-login-card.cjs\",[[4,\"c-login-card\",{\"backgroundPosition\":[1,\"background-position\"],\"mobileBreakpoint\":[2,\"mobile-breakpoint\"],\"overlay\":[4],\"overlayBlendMode\":[1,\"overlay-blend-mode\"],\"src\":[1],\"path\":[32],\"imageHeight\":[32]}]]],[\"c-login-card-content.cjs\",[[1,\"c-login-card-content\"]]],[\"c-login-card-title.cjs\",[[1,\"c-login-card-title\"]]],[\"c-main.cjs\",[[1,\"c-main\"]]],[\"c-modal.cjs\",[[1,\"c-modal\",{\"value\":[4],\"dismissable\":[4],\"width\":[8],\"zIndex\":[2,\"z-index\"],\"disableBackdropBlur\":[4,\"disable-backdrop-blur\"],\"innerValue\":[32],\"animateModal\":[32]},null,{\"value\":[\"onValueChange\"]}]]],[\"c-option-value.cjs\",[[1,\"c-option-value\"]]],[\"c-page.cjs\",[[1,\"c-page\",{\"scrollIndicator\":[4,\"scroll-indicator\"]}]]],[\"c-progress-bar.cjs\",[[1,\"c-progress-bar\",{\"value\":[2],\"hideDetails\":[4,\"hide-details\"],\"singleLine\":[4,\"single-line\"],\"label\":[1],\"indeterminate\":[4]}]]],[\"c-radio.cjs\",[[1,\"c-radio\",{\"checked\":[4],\"disabled\":[4],\"value\":[1]}]]],[\"c-row.cjs\",[[1,\"c-row\",{\"gap\":[2],\"nowrap\":[4],\"align\":[1],\"justify\":[1]}]]],[\"c-side-navigation-title.cjs\",[[1,\"c-side-navigation-title\"]]],[\"c-slider.cjs\",[[1,\"c-slider\",{\"hostId\":[1,\"id\"],\"hostName\":[1,\"name\"],\"ariaLabel\":[1,\"aria-label\"],\"max\":[1],\"min\":[1],\"step\":[1],\"value\":[8],\"unit\":[1],\"ticks\":[4],\"labels\":[4],\"disableTooltip\":[4,\"disable-tooltip\"],\"label\":[1],\"disabled\":[4],\"segments\":[1],\"trackPosition\":[32],\"tickPositions\":[32]},null,{\"segments\":[\"onSegmentChange\"],\"value\":[\"onValueChange\"]}]]],[\"c-status.cjs\",[[1,\"c-status\",{\"type\":[1]}]]],[\"c-step.cjs\",[[1,\"c-step\",{\"complete\":[4],\"current\":[4]}]]],[\"c-steps.cjs\",[[1,\"c-steps\",{\"value\":[8],\"isMobile\":[32],\"label\":[32]},null,{\"value\":[\"watchPropHandler\"]}]]],[\"c-switch.cjs\",[[65,\"c-switch\",{\"checked\":[1028],\"value\":[8],\"trueValue\":[8,\"true-value\"],\"falseValue\":[8,\"false-value\"],\"hostDisabled\":[4,\"disabled\"],\"hostId\":[1,\"id\"],\"required\":[4],\"hasLabel\":[32]}]]],[\"c-tab-buttons.cjs\",[[1,\"c-tab-buttons\",{\"value\":[1032],\"mandatory\":[4],\"tabs\":[4],\"size\":[1],\"hostDisabled\":[4,\"disabled\"]},[[1,\"tabFocus\",\"tabFocusHandler\"],[2,\"keyup\",\"handleKeyUp\"],[1,\"tabChange\",\"onTabChange\"]],{\"value\":[\"onValueChange\"]}]]],[\"c-tab-item.cjs\",[[1,\"c-tab-item\",{\"value\":[8],\"active\":[4]}]]],[\"c-tab-items.cjs\",[[1,\"c-tab-items\",{\"value\":[8],\"disableAnimation\":[4,\"disable-animation\"],\"activeTab\":[32]},[[1,\"contentChange\",\"tabContentChangeHandler\"]],{\"value\":[\"onValueChange\"]}]]],[\"c-table.cjs\",[[4,\"c-table\",{\"mobileBreakpoint\":[2,\"mobile-breakpoint\"],\"responsive\":[4]}]]],[\"c-tags.cjs\",[[1,\"c-tags\"]]],[\"c-toolbar.cjs\",[[1,\"c-toolbar\"]]],[\"c-autocomplete_16.cjs\",[[65,\"c-autocomplete\",{\"items\":[16],\"value\":[8],\"query\":[1],\"hostId\":[1,\"id\"],\"disabled\":[4],\"label\":[1],\"name\":[1],\"placeholder\":[1],\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"loading\":[4],\"required\":[4],\"valid\":[4],\"validate\":[4],\"validateOnBlur\":[4,\"validate-on-blur\"],\"validation\":[1],\"shadow\":[4],\"returnObject\":[4,\"return-object\"],\"itemsPerPage\":[2,\"items-per-page\"],\"optionElements\":[32],\"currentIndex\":[32],\"dropdownVisible\":[32],\"statusText\":[32],\"optionElementsExist\":[32],\"reset\":[64]},[[1,\"keydown\",\"handleKeyDown\"],[0,\"dropdownStateChange\",\"onDropdownStateChange\"],[0,\"selectOption\",\"onSelectOption\"]],{\"query\":[\"handleQueryChange\"]}],[65,\"c-select\",{\"items\":[16],\"value\":[8],\"hostId\":[1,\"id\"],\"clearable\":[4],\"disabled\":[4],\"label\":[1],\"name\":[1],\"placeholder\":[1],\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"loading\":[4],\"required\":[4],\"valid\":[4],\"validate\":[4],\"validateOnBlur\":[4,\"validate-on-blur\"],\"validation\":[1],\"shadow\":[4],\"returnObject\":[4,\"return-object\"],\"itemsPerPage\":[2,\"items-per-page\"],\"optionAsSelection\":[4,\"option-as-selection\"],\"optionElements\":[32],\"currentIndex\":[32],\"dropdownVisible\":[32],\"statusText\":[32],\"optionElementsExist\":[32],\"reset\":[64]},[[1,\"keydown\",\"handleKeyDown\"],[0,\"dropdownStateChange\",\"onDropdownStateChange\"],[0,\"selectOption\",\"onSelectOption\"]]],[1,\"c-card\",{\"fullscreen\":[4],\"isFullscreen\":[32],\"exitFullscreen\":[64],\"enterFullscreen\":[64]}],[1,\"c-button\",{\"inverted\":[4],\"outlined\":[4],\"ghost\":[4],\"danger\":[4],\"grouped\":[4],\"text\":[4],\"loading\":[4],\"fit\":[4],\"noRadius\":[4,\"no-radius\"],\"type\":[1],\"disabled\":[516],\"value\":[8],\"hostId\":[1,\"id\"],\"size\":[1],\"href\":[1],\"target\":[1],\"tabs\":[4]},[[1,\"focus\",\"onTabFocus\"]]],[1,\"c-card-content\"],[1,\"c-card-title\"],[1,\"c-option\",{\"selected\":[4],\"disabled\":[4],\"name\":[1],\"value\":[8]}],[1,\"c-card-actions\",{\"align\":[1],\"justify\":[1]}],[1,\"c-dropdown\",{\"itemsPerPage\":[2,\"items-per-page\"],\"parent\":[16],\"items\":[16],\"index\":[2],\"hostId\":[1,\"id\"],\"type\":[1],\"itemType\":[1,\"item-type\"],\"renderedList\":[32],\"isOpen\":[32],\"statusText\":[32],\"setStatusText\":[64],\"focusItem\":[64],\"open\":[64],\"close\":[64],\"selectItem\":[64],\"updateList\":[64]},null,{\"items\":[\"optionsWatcher\"],\"isOpen\":[\"stateWatcher\"],\"index\":[\"handleIndexChange\"]}],[4,\"c-input\",{\"active\":[4],\"autofocus\":[4],\"disabled\":[4],\"form\":[4],\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"hostId\":[1,\"id\"],\"inputId\":[1,\"input-id\"],\"items\":[16],\"itemsPerPage\":[2,\"items-per-page\"],\"label\":[1],\"max\":[2],\"min\":[2],\"name\":[1],\"placeholder\":[1],\"readonly\":[4],\"required\":[4],\"rows\":[2],\"shadow\":[4],\"step\":[2],\"type\":[1],\"valid\":[4],\"validate\":[4],\"validateOnBlur\":[4,\"validate-on-blur\"],\"validation\":[1],\"value\":[8],\"variant\":[1],\"isFocused\":[32],\"labelWidth\":[32],\"preSlotWidth\":[32],\"statusText\":[32],\"currentIndex\":[32],\"reset\":[64]},null,{\"valid\":[\"onValidChange\"],\"validation\":[\"onValidationMessageChange\"],\"value\":[\"onValueChange\"],\"placeholder\":[\"onPlaceholderChange\"]}],[1,\"c-message\",{\"hint\":[1],\"inputId\":[1,\"input-id\"],\"valid\":[4],\"validation\":[1],\"messageOptions\":[32]},null,{\"valid\":[\"onValidChange\"],\"validation\":[\"onValidationMessageChange\"],\"hint\":[\"onHintMessageChange\"]}],[1,\"c-icon-button\",{\"badge\":[1],\"danger\":[4],\"loading\":[4],\"text\":[4],\"inverted\":[4],\"outlined\":[4],\"path\":[1],\"ghost\":[4],\"disabled\":[4],\"size\":[1]}],[1,\"c-badge\"],[1,\"c-icon\",{\"path\":[1],\"size\":[2],\"color\":[1]}],[1,\"c-spinner\",{\"color\":[1],\"size\":[2],\"width\":[2]}],[1,\"c-ripple\",{\"createRipple\":[64]}]]],[\"c-toast.cjs\",[[1,\"c-toast\",{\"message\":[16],\"closeToast\":[64]}]]],[\"c-loader.cjs\",[[1,\"c-loader\",{\"contentdelay\":[2],\"hide\":[4],\"size\":[2],\"width\":[2]},null,{\"hide\":[\"onElementHide\"]}]]],[\"c-menu_2.cjs\",[[1,\"c-menu\",{\"items\":[16],\"contentClass\":[1,\"content-class\"],\"custom\":[4],\"small\":[4],\"flat\":[4],\"itemsPerPage\":[2,\"items-per-page\"],\"menuItemsComponent\":[32],\"menuWrapperComponent\":[32],\"currentIndex\":[32],\"active\":[32]},[[2,\"keydown\",\"handleKeyDown\"]]],[1,\"c-menu-items\",{\"items\":[16],\"small\":[4],\"active\":[4],\"parentType\":[1,\"parent-type\"],\"parent\":[16],\"top\":[2],\"index\":[2],\"itemsPerPage\":[2,\"items-per-page\"],\"scrollingParent\":[32],\"isInView\":[32],\"currentIndex\":[32]},[[2,\"keydown\",\"handleKeyDown\"]],{\"currentIndex\":[\"onIndexChange\"]}]]],[\"c-checkbox_3.cjs\",[[1,\"c-pagination\",{\"value\":[16],\"hideDetails\":[4,\"hide-details\"],\"simple\":[4],\"size\":[1],\"hideRange\":[4,\"hide-range\"],\"itemsPerPageOptions\":[16],\"_currentPage\":[32],\"_itemsPerPage\":[32],\"_totalVisible\":[32],\"tick\":[32]},null,{\"value\":[\"valueHandler\"]}],[65,\"c-checkbox\",{\"checked\":[1028],\"disabled\":[4],\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"indeterminate\":[4],\"label\":[1],\"required\":[4],\"valid\":[4],\"validation\":[1],\"value\":[8],\"trueValue\":[8,\"true-value\"],\"falseValue\":[8,\"false-value\"],\"hostName\":[1,\"name\"],\"messageOptions\":[32]},[[1,\"keydown\",\"handleKeyDown\"]],{\"validation\":[\"onValidationMessageChange\"],\"valid\":[\"onValidChange\"]}],[1,\"c-spacer\"]]]]"), options);
|
|
9
|
+
return index.bootstrapLazy(JSON.parse("[[\"c-data-table.cjs\",[[1,\"c-data-table\",{\"data\":[16],\"externalData\":[4,\"external-data\"],\"headers\":[16],\"hideFooter\":[4,\"hide-footer\"],\"footerOptions\":[16],\"loading\":[4],\"loadingText\":[1,\"loading-text\"],\"noDataText\":[1,\"no-data-text\"],\"pagination\":[1040],\"selectable\":[4],\"singleSelection\":[4,\"single-selection\"],\"selectionProperty\":[1,\"selection-property\"],\"singleExpansion\":[4,\"single-expansion\"],\"sortBy\":[1032,\"sort-by\"],\"sortDirection\":[1025,\"sort-direction\"],\"stickyHeader\":[4,\"sticky-header\"],\"horizontalScrolling\":[4,\"horizontal-scrolling\"],\"_activeRows\":[32],\"_data\":[32],\"_isIndeterminate\":[32],\"_isPaginationSimple\":[32],\"_selections\":[32],\"hasOverflow\":[32],\"hiddenHeaders\":[32],\"initiallyHiddenHeaders\":[32],\"forceRender\":[32],\"breakpoints\":[32],\"markedFooterWidth\":[32],\"parentWidth\":[32],\"firstCellHidden\":[32],\"lastCellHidden\":[32],\"clearSelections\":[64],\"getData\":[64]},null,{\"hiddenHeaders\":[\"onHiddenHeaderChange\"],\"data\":[\"onDataChange\"],\"headers\":[\"onHeaderChange\"],\"singleSelection\":[\"onSingleSelectionChange\"],\"loading\":[\"onLoadingChange\"]}]]],[\"c-navigation-button.cjs\",[[1,\"c-navigation-button\"]]],[\"c-side-navigation.cjs\",[[1,\"c-side-navigation\",{\"mobile\":[4],\"menuVisible\":[1028,\"menu-visible\"]},[[0,\"itemChange\",\"handleChange\"]]]]],[\"c-tabs.cjs\",[[1,\"c-tabs\",{\"value\":[1032],\"borderless\":[4],\"disableAnimation\":[4,\"disable-animation\"],\"justify\":[1],\"mobileBreakpoint\":[2,\"mobile-breakpoint\"],\"vertical\":[4],\"isOverflowing\":[32],\"isMobile\":[32],\"scrollOffset\":[32]},[[1,\"tabFocus\",\"tabFocusHandler\"],[1,\"tabChange\",\"tabChangeHandler\"],[2,\"keydown\",\"handleKeyDown\"],[2,\"keyup\",\"handleKeyUp\"]],{\"justify\":[\"onJustificationChange\"],\"value\":[\"onExternalValueChange\"],\"scrollOffset\":[\"onScrollOffsetChange\"]}]]],[\"c-tag.cjs\",[[1,\"c-tag\",{\"active\":[4],\"block\":[4],\"fit\":[4],\"flat\":[4],\"closeable\":[4],\"badge\":[8]}]]],[\"c-swiper.cjs\",[[4,\"c-swiper\",{\"value\":[1544],\"elementId\":[1,\"id\"],\"isBeginning\":[32],\"isEnd\":[32],\"statusText\":[32]},[[0,\"changeValue\",\"onTabClick\"],[2,\"keyup\",\"handleKeyUp\"]]]]],[\"c-side-navigation-item.cjs\",[[1,\"c-side-navigation-item\",{\"active\":[4],\"href\":[1],\"target\":[1],\"loading\":[4]},[[0,\"itemChange\",\"handleChange\"]],{\"active\":[\"onActiveChange\"]}]]],[\"c-sub-navigation-item.cjs\",[[1,\"c-sub-navigation-item\",{\"active\":[4],\"focusable\":[4],\"href\":[1],\"target\":[1],\"loading\":[4]}]]],[\"c-text-field.cjs\",[[65,\"c-text-field\",{\"autofocus\":[4],\"autocapitalize\":[1],\"autocorrect\":[1],\"autocomplete\":[1],\"disabled\":[4],\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"hostId\":[1,\"id\"],\"trimWhitespace\":[4,\"trim-whitespace\"],\"label\":[1],\"max\":[2],\"min\":[2],\"name\":[1],\"number\":[4],\"placeholder\":[1],\"readonly\":[4],\"required\":[4],\"rows\":[2],\"shadow\":[4],\"step\":[2],\"type\":[1],\"valid\":[4],\"validate\":[4],\"validateOnBlur\":[4,\"validate-on-blur\"],\"validation\":[1],\"value\":[1025],\"isFocused\":[32],\"labelWidth\":[32],\"preSlotWidth\":[32],\"messageOptions\":[32]}]]],[\"c-toasts.cjs\",[[1,\"c-toasts\",{\"absolute\":[4],\"horizontal\":[1],\"vertical\":[1],\"messages\":[32],\"addToast\":[64],\"removeToast\":[64]}]]],[\"c-accordion-item.cjs\",[[1,\"c-accordion-item\",{\"collapsable\":[4],\"heading\":[1],\"value\":[8],\"expanded\":[4],\"outlined\":[4]},[[2,\"keydown\",\"handleKeyDown\"],[0,\"changeValue\",\"stop\"]]]]],[\"c-list-item.cjs\",[[1,\"c-list-item\",{\"active\":[4],\"disabled\":[4],\"disabledByParent\":[4,\"disabled-by-parent\"],\"hoverable\":[4],\"ripple\":[4],\"href\":[1],\"target\":[1]},null,{\"active\":[\"onActiveChange\"]}]]],[\"c-login-card-actions.cjs\",[[1,\"c-login-card-actions\",{\"align\":[1],\"justify\":[1]}]]],[\"c-otp-input.cjs\",[[65,\"c-otp-input\",{\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"elementId\":[1,\"id\"],\"length\":[2],\"valid\":[4],\"validation\":[1],\"statusText\":[32]},null,{\"validation\":[\"onValidationMessageChange\"]}]]],[\"c-radio-group.cjs\",[[65,\"c-radio-group\",{\"value\":[1032],\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"inline\":[4],\"label\":[1],\"color\":[1],\"items\":[16],\"disabled\":[4],\"returnObject\":[4,\"return-object\"],\"required\":[4],\"valid\":[4],\"validation\":[1],\"messageOptions\":[32]},null,{\"validation\":[\"onValidationMessageChange\"],\"valid\":[\"onValidChange\"]}]]],[\"c-swiper-tab.cjs\",[[1,\"c-swiper-tab\",{\"disabled\":[4],\"active\":[4],\"label\":[1],\"hostId\":[1,\"id\"],\"setsize\":[2],\"position\":[2],\"value\":[8]},[[1,\"click\",\"onTabClick\"]]]]],[\"c-tab.cjs\",[[1,\"c-tab\",{\"active\":[4],\"disabled\":[4],\"hostId\":[1,\"id\"],\"position\":[2],\"setsize\":[2],\"value\":[8]},[[1,\"focus\",\"onTabFocus\"],[1,\"keydown\",\"handleKeydown\"]]]]],[\"c-accordion.cjs\",[[1,\"c-accordion\",{\"value\":[1032],\"mandatory\":[4],\"multiple\":[4],\"outlined\":[4]},[[1,\"itemChange\",\"onAccordionItemChange\"]],{\"value\":[\"watchPropHandler\"]}]]],[\"c-alert.cjs\",[[1,\"c-alert\",{\"type\":[1]}]]],[\"c-csc-logo.cjs\",[[1,\"c-csc-logo\",{\"width\":[2]}]]],[\"c-link.cjs\",[[1,\"c-link\",{\"href\":[1],\"underline\":[4],\"target\":[1],\"weight\":[1]}]]],[\"c-list.cjs\",[[0,\"c-list\",{\"disabled\":[4]},null,{\"disabled\":[\"onDisabledChange\"]}]]],[\"c-list-item-title.cjs\",[[1,\"c-list-item-title\",{\"active\":[4]}]]],[\"c-login-button.cjs\",[[1,\"c-login-button\",{\"href\":[1],\"src\":[1],\"alt\":[1]}]]],[\"c-login-buttons.cjs\",[[1,\"c-login-buttons\"]]],[\"c-login-card.cjs\",[[4,\"c-login-card\",{\"backgroundPosition\":[1,\"background-position\"],\"mobileBreakpoint\":[2,\"mobile-breakpoint\"],\"overlay\":[4],\"overlayBlendMode\":[1,\"overlay-blend-mode\"],\"src\":[1],\"path\":[32],\"imageHeight\":[32]}]]],[\"c-login-card-content.cjs\",[[1,\"c-login-card-content\"]]],[\"c-login-card-title.cjs\",[[1,\"c-login-card-title\"]]],[\"c-main.cjs\",[[1,\"c-main\"]]],[\"c-modal.cjs\",[[1,\"c-modal\",{\"value\":[4],\"dismissable\":[4],\"width\":[8],\"zIndex\":[2,\"z-index\"],\"disableBackdropBlur\":[4,\"disable-backdrop-blur\"],\"innerValue\":[32],\"animateModal\":[32]},null,{\"value\":[\"onValueChange\"]}]]],[\"c-option-value.cjs\",[[1,\"c-option-value\"]]],[\"c-page.cjs\",[[1,\"c-page\",{\"scrollIndicator\":[4,\"scroll-indicator\"]}]]],[\"c-progress-bar.cjs\",[[1,\"c-progress-bar\",{\"value\":[2],\"hideDetails\":[4,\"hide-details\"],\"singleLine\":[4,\"single-line\"],\"label\":[1],\"indeterminate\":[4]}]]],[\"c-radio.cjs\",[[1,\"c-radio\",{\"checked\":[4],\"disabled\":[4],\"value\":[1]}]]],[\"c-row.cjs\",[[1,\"c-row\",{\"gap\":[2],\"nowrap\":[4],\"align\":[1],\"justify\":[1]}]]],[\"c-side-navigation-title.cjs\",[[1,\"c-side-navigation-title\"]]],[\"c-slider.cjs\",[[1,\"c-slider\",{\"hostId\":[1,\"id\"],\"hostName\":[1,\"name\"],\"ariaLabel\":[1,\"aria-label\"],\"max\":[1],\"min\":[1],\"step\":[1],\"value\":[8],\"unit\":[1],\"ticks\":[4],\"labels\":[4],\"disableTooltip\":[4,\"disable-tooltip\"],\"label\":[1],\"disabled\":[4],\"segments\":[1],\"trackPosition\":[32],\"tickPositions\":[32]},null,{\"segments\":[\"onSegmentChange\"],\"value\":[\"onValueChange\"]}]]],[\"c-status.cjs\",[[1,\"c-status\",{\"type\":[1]}]]],[\"c-step.cjs\",[[1,\"c-step\",{\"complete\":[4],\"current\":[4]}]]],[\"c-steps.cjs\",[[1,\"c-steps\",{\"value\":[8],\"isMobile\":[32],\"label\":[32]},null,{\"value\":[\"watchPropHandler\"]}]]],[\"c-switch.cjs\",[[65,\"c-switch\",{\"checked\":[1028],\"value\":[8],\"trueValue\":[8,\"true-value\"],\"falseValue\":[8,\"false-value\"],\"hostDisabled\":[4,\"disabled\"],\"hostId\":[1,\"id\"],\"required\":[4],\"hasLabel\":[32]}]]],[\"c-tab-buttons.cjs\",[[1,\"c-tab-buttons\",{\"value\":[1032],\"mandatory\":[4],\"tabs\":[4],\"size\":[1],\"hostDisabled\":[4,\"disabled\"]},[[1,\"tabFocus\",\"tabFocusHandler\"],[2,\"keyup\",\"handleKeyUp\"],[1,\"tabChange\",\"onTabChange\"]],{\"value\":[\"onValueChange\"]}]]],[\"c-tab-item.cjs\",[[1,\"c-tab-item\",{\"value\":[8],\"active\":[4]}]]],[\"c-tab-items.cjs\",[[1,\"c-tab-items\",{\"value\":[8],\"disableAnimation\":[4,\"disable-animation\"],\"activeTab\":[32]},[[1,\"contentChange\",\"tabContentChangeHandler\"]],{\"value\":[\"onValueChange\"]}]]],[\"c-table.cjs\",[[4,\"c-table\",{\"mobileBreakpoint\":[2,\"mobile-breakpoint\"],\"responsive\":[4]}]]],[\"c-tags.cjs\",[[1,\"c-tags\"]]],[\"c-toolbar.cjs\",[[1,\"c-toolbar\"]]],[\"c-autocomplete_16.cjs\",[[65,\"c-autocomplete\",{\"items\":[16],\"value\":[8],\"query\":[1],\"hostId\":[1,\"id\"],\"disabled\":[4],\"label\":[1],\"name\":[1],\"placeholder\":[1],\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"loading\":[4],\"required\":[4],\"valid\":[4],\"validate\":[4],\"validateOnBlur\":[4,\"validate-on-blur\"],\"validation\":[1],\"shadow\":[4],\"returnObject\":[4,\"return-object\"],\"itemsPerPage\":[2,\"items-per-page\"],\"optionElements\":[32],\"currentIndex\":[32],\"dropdownVisible\":[32],\"statusText\":[32],\"optionElementsExist\":[32],\"reset\":[64]},[[0,\"dropdownStateChange\",\"onDropdownStateChange\"],[0,\"selectOption\",\"onSelectOption\"]],{\"query\":[\"handleQueryChange\"]}],[65,\"c-select\",{\"items\":[16],\"value\":[8],\"hostId\":[1,\"id\"],\"clearable\":[4],\"disabled\":[4],\"label\":[1],\"name\":[1],\"placeholder\":[1],\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"loading\":[4],\"required\":[4],\"valid\":[4],\"validate\":[4],\"validateOnBlur\":[4,\"validate-on-blur\"],\"validation\":[1],\"shadow\":[4],\"returnObject\":[4,\"return-object\"],\"itemsPerPage\":[2,\"items-per-page\"],\"optionAsSelection\":[4,\"option-as-selection\"],\"optionElements\":[32],\"currentIndex\":[32],\"dropdownVisible\":[32],\"statusText\":[32],\"optionElementsExist\":[32],\"reset\":[64]},[[1,\"keydown\",\"handleKeyDown\"],[0,\"dropdownStateChange\",\"onDropdownStateChange\"],[0,\"selectOption\",\"onSelectOption\"]]],[1,\"c-card\",{\"fullscreen\":[4],\"isFullscreen\":[32],\"exitFullscreen\":[64],\"enterFullscreen\":[64]}],[1,\"c-button\",{\"inverted\":[4],\"outlined\":[4],\"ghost\":[4],\"danger\":[4],\"grouped\":[4],\"text\":[4],\"loading\":[4],\"fit\":[4],\"noRadius\":[4,\"no-radius\"],\"type\":[1],\"disabled\":[516],\"value\":[8],\"hostId\":[1,\"id\"],\"size\":[1],\"href\":[1],\"target\":[1],\"tabs\":[4]},[[1,\"focus\",\"onTabFocus\"]]],[1,\"c-card-content\"],[1,\"c-card-title\"],[1,\"c-option\",{\"selected\":[4],\"disabled\":[4],\"name\":[1],\"value\":[8]}],[1,\"c-card-actions\",{\"align\":[1],\"justify\":[1]}],[1,\"c-dropdown\",{\"itemsPerPage\":[2,\"items-per-page\"],\"parent\":[16],\"items\":[16],\"index\":[2],\"hostId\":[1,\"id\"],\"type\":[1],\"itemType\":[1,\"item-type\"],\"renderedList\":[32],\"isOpen\":[32],\"statusText\":[32],\"setStatusText\":[64],\"focusItem\":[64],\"open\":[64],\"close\":[64],\"selectItem\":[64],\"updateList\":[64]},null,{\"items\":[\"optionsWatcher\"],\"isOpen\":[\"stateWatcher\"],\"index\":[\"handleIndexChange\"]}],[4,\"c-input\",{\"active\":[4],\"autofocus\":[4],\"disabled\":[4],\"form\":[4],\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"hostId\":[1,\"id\"],\"inputId\":[1,\"input-id\"],\"items\":[16],\"itemsPerPage\":[2,\"items-per-page\"],\"label\":[1],\"max\":[2],\"min\":[2],\"name\":[1],\"placeholder\":[1],\"readonly\":[4],\"required\":[4],\"rows\":[2],\"shadow\":[4],\"step\":[2],\"type\":[1],\"valid\":[4],\"validate\":[4],\"validateOnBlur\":[4,\"validate-on-blur\"],\"validation\":[1],\"value\":[8],\"variant\":[1],\"isFocused\":[32],\"labelWidth\":[32],\"preSlotWidth\":[32],\"statusText\":[32],\"currentIndex\":[32],\"reset\":[64]},null,{\"valid\":[\"onValidChange\"],\"validation\":[\"onValidationMessageChange\"],\"value\":[\"onValueChange\"],\"placeholder\":[\"onPlaceholderChange\"]}],[1,\"c-message\",{\"hint\":[1],\"inputId\":[1,\"input-id\"],\"valid\":[4],\"validation\":[1],\"messageOptions\":[32]},null,{\"valid\":[\"onValidChange\"],\"validation\":[\"onValidationMessageChange\"],\"hint\":[\"onHintMessageChange\"]}],[1,\"c-icon-button\",{\"badge\":[1],\"danger\":[4],\"loading\":[4],\"text\":[4],\"inverted\":[4],\"outlined\":[4],\"path\":[1],\"ghost\":[4],\"disabled\":[4],\"size\":[1]}],[1,\"c-badge\"],[1,\"c-icon\",{\"path\":[1],\"size\":[2],\"color\":[1]}],[1,\"c-spinner\",{\"color\":[1],\"size\":[2],\"width\":[2]}],[1,\"c-ripple\",{\"createRipple\":[64]}]]],[\"c-toast.cjs\",[[1,\"c-toast\",{\"message\":[16],\"closeToast\":[64]}]]],[\"c-loader.cjs\",[[1,\"c-loader\",{\"contentdelay\":[2],\"hide\":[4],\"size\":[2],\"width\":[2]},null,{\"hide\":[\"onElementHide\"]}]]],[\"c-menu_2.cjs\",[[1,\"c-menu\",{\"items\":[16],\"contentClass\":[1,\"content-class\"],\"custom\":[4],\"small\":[4],\"flat\":[4],\"itemsPerPage\":[2,\"items-per-page\"],\"menuItemsComponent\":[32],\"menuWrapperComponent\":[32],\"currentIndex\":[32],\"active\":[32]},[[2,\"keydown\",\"handleKeyDown\"]]],[1,\"c-menu-items\",{\"items\":[16],\"small\":[4],\"active\":[4],\"parentType\":[1,\"parent-type\"],\"parent\":[16],\"top\":[2],\"index\":[2],\"itemsPerPage\":[2,\"items-per-page\"],\"scrollingParent\":[32],\"isInView\":[32],\"currentIndex\":[32]},[[2,\"keydown\",\"handleKeyDown\"]],{\"currentIndex\":[\"onIndexChange\"]}]]],[\"c-checkbox_3.cjs\",[[1,\"c-pagination\",{\"value\":[16],\"hideDetails\":[4,\"hide-details\"],\"simple\":[4],\"size\":[1],\"hideRange\":[4,\"hide-range\"],\"itemsPerPageOptions\":[16],\"_currentPage\":[32],\"_itemsPerPage\":[32],\"_totalVisible\":[32],\"tick\":[32]},null,{\"value\":[\"valueHandler\"]}],[65,\"c-checkbox\",{\"checked\":[1028],\"disabled\":[4],\"hideDetails\":[4,\"hide-details\"],\"hint\":[1],\"indeterminate\":[4],\"label\":[1],\"required\":[4],\"valid\":[4],\"validation\":[1],\"value\":[8],\"trueValue\":[8,\"true-value\"],\"falseValue\":[8,\"false-value\"],\"hostName\":[1,\"name\"],\"messageOptions\":[32]},[[1,\"keydown\",\"handleKeyDown\"]],{\"validation\":[\"onValidationMessageChange\"],\"valid\":[\"onValidChange\"]}],[1,\"c-spacer\"]]]]"), options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -12,8 +12,7 @@ export class CAutocomplete {
|
|
|
12
12
|
? { name: selection.name, value: selection.value }
|
|
13
13
|
: selection.value;
|
|
14
14
|
this.changeValue.emit(this.value);
|
|
15
|
-
this.
|
|
16
|
-
this.changeQuery.emit(selection.value);
|
|
15
|
+
this.changeQuery.emit(this.query);
|
|
17
16
|
this.internals.setFormValue(selection.value.toString());
|
|
18
17
|
}
|
|
19
18
|
if (this.optionElements.length && !this.optionElementsExist) {
|
|
@@ -96,7 +95,7 @@ export class CAutocomplete {
|
|
|
96
95
|
this.changeQuery.emit('');
|
|
97
96
|
this._dropdownElement.updateList();
|
|
98
97
|
}
|
|
99
|
-
|
|
98
|
+
_handleKeyDown(event) {
|
|
100
99
|
const alphanumeric = /^[0-9a-zA-Z ]+$/;
|
|
101
100
|
if (event.key.match(alphanumeric) && event.key.length === 1) {
|
|
102
101
|
if (!this.dropdownVisible) {
|
|
@@ -193,9 +192,9 @@ export class CAutocomplete {
|
|
|
193
192
|
handleQueryChange() {
|
|
194
193
|
this._updateStatusText();
|
|
195
194
|
}
|
|
196
|
-
_updateInput(
|
|
195
|
+
_updateInput() {
|
|
197
196
|
this._dropdownElement.open();
|
|
198
|
-
this.query =
|
|
197
|
+
this.query = this._inputElement.value;
|
|
199
198
|
this.changeQuery.emit(this.query);
|
|
200
199
|
this._dropdownElement.updateList();
|
|
201
200
|
}
|
|
@@ -214,7 +213,7 @@ export class CAutocomplete {
|
|
|
214
213
|
}
|
|
215
214
|
_renderInputElement() {
|
|
216
215
|
var _a;
|
|
217
|
-
return (h("div", { class: "c-input-menu__input" }, h("input", { type: "text", ref: (el) => (this._inputElement = el), "aria-expanded": this.dropdownVisible.toString(), "aria-owns": this._inputId + '-items', "aria-autocomplete": "list", autocomplete: "off", class: "c-input__input", role: "combobox", value: this.query, name: (_a = this.name) !== null && _a !== void 0 ? _a : null, onInput: (
|
|
216
|
+
return (h("div", { class: "c-input-menu__input" }, h("input", { type: "text", ref: (el) => (this._inputElement = el), "aria-expanded": this.dropdownVisible.toString(), "aria-owns": this._inputId + '-items', "aria-autocomplete": "list", autocomplete: "off", class: "c-input__input", role: "combobox", value: this.query, name: (_a = this.name) !== null && _a !== void 0 ? _a : null, onInput: () => this._updateInput(), onFocus: () => this._onInputFocus() })));
|
|
218
217
|
}
|
|
219
218
|
componentWillLoad() {
|
|
220
219
|
CAutocomplete._uniqueId += 1;
|
|
@@ -248,7 +247,7 @@ export class CAutocomplete {
|
|
|
248
247
|
}
|
|
249
248
|
render() {
|
|
250
249
|
const itemType = this.optionElementsExist ? 'option' : 'item';
|
|
251
|
-
return (h(Host, null, h("c-dropdown", { ref: (el) => (this._dropdownElement = el), id: `${this._id}-dropdown`, index: this.currentIndex, "items-per-page": this.itemsPerPage, "item-type": itemType, items: this._items, parent: this.el, type: "autocomplete" }, h("c-input", { slot: "default", ref: (el) => (this._cInputElement = el), active: this.dropdownVisible, disabled: this.disabled, "hide-details": this.hideDetails, hint: this.hint, id: this.hostId, "input-id": this._inputId, label: this.label, name: this.name, placeholder: this.placeholder, required: this.required, shadow: this.shadow, valid: this.valid, validate: this.validate, "validate-on-blur": this.validateOnBlur, validation: this.validation, value: this.query, variant: "select" }, h("slot", { name: "pre", slot: "pre" }), h("div", { class: "c-input__content" }, this._renderInputElement(), this.loading && this._renderLoader(), !this.loading && this.value && this._renderReset(), !this.loading && !this.value && this._renderChevron(), h("slot", { onSlotchange: () => this._handleSlotChange() })), h("slot", { name: "post", slot: "post" })))));
|
|
250
|
+
return (h(Host, null, h("c-dropdown", { ref: (el) => (this._dropdownElement = el), id: `${this._id}-dropdown`, index: this.currentIndex, "items-per-page": this.itemsPerPage, "item-type": itemType, items: this._items, parent: this.el, type: "autocomplete", onKeyDown: (event) => this._handleKeyDown(event) }, h("c-input", { slot: "default", ref: (el) => (this._cInputElement = el), active: this.dropdownVisible, disabled: this.disabled, "hide-details": this.hideDetails, hint: this.hint, id: this.hostId, "input-id": this._inputId, label: this.label, name: this.name, placeholder: this.placeholder, required: this.required, shadow: this.shadow, valid: this.valid, validate: this.validate, "validate-on-blur": this.validateOnBlur, validation: this.validation, value: this.query, variant: "select" }, h("slot", { name: "pre", slot: "pre" }), h("div", { class: "c-input__content" }, this._renderInputElement(), this.loading && this._renderLoader(), !this.loading && this.value && this._renderReset(), !this.loading && !this.value && this._renderChevron(), h("slot", { onSlotchange: () => this._handleSlotChange() })), h("slot", { name: "post", slot: "post" })))));
|
|
252
251
|
}
|
|
253
252
|
static get is() { return "c-autocomplete"; }
|
|
254
253
|
static get encapsulation() { return "shadow"; }
|
|
@@ -688,12 +687,6 @@ export class CAutocomplete {
|
|
|
688
687
|
}
|
|
689
688
|
static get listeners() {
|
|
690
689
|
return [{
|
|
691
|
-
"name": "keydown",
|
|
692
|
-
"method": "handleKeyDown",
|
|
693
|
-
"target": undefined,
|
|
694
|
-
"capture": false,
|
|
695
|
-
"passive": true
|
|
696
|
-
}, {
|
|
697
690
|
"name": "dropdownStateChange",
|
|
698
691
|
"method": "onDropdownStateChange",
|
|
699
692
|
"target": undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"c-autocomplete.js","sourceRoot":"","sources":["../../../../src/components/c-autocomplete/c-autocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,SAAS,EACT,IAAI,EACJ,CAAC,EACD,IAAI,EACJ,KAAK,EACL,OAAO,EACP,KAAK,EAEL,MAAM,EACN,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAWnD,MAAM,OAAO,aAAa;;IAgBhB,uBAAkB,GAAG,KAAK,CAAC;IAE3B,cAAS,GAAG,IAAI,CAAC;IAsSjB,sBAAiB,GA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA9iBc,uBAAS,GAAG,CAAC,AAAJ,CAAK","sourcesContent":["import {\n AttachInternals,\n Component,\n Host,\n h,\n Prop,\n State,\n Element,\n Event,\n EventEmitter,\n Listen,\n Watch,\n Method,\n} from '@stencil/core';\nimport { CAutocompleteItem } from '../../types';\nimport { mdiChevronDown, mdiClose } from '@mdi/js';\n\n/**\n * @group Form\n */\n@Component({\n tag: 'c-autocomplete',\n styleUrl: 'c-autocomplete.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class CAutocomplete {\n @Element() el: HTMLCAutocompleteElement;\n\n // eslint-disable-next-line\n @AttachInternals() internals: ElementInternals;\n\n private static _uniqueId = 0;\n\n private _dropdownElement: HTMLCDropdownElement;\n\n private _inputElement: HTMLInputElement;\n\n private _cInputElement: HTMLCInputElement;\n\n private _inputId: string;\n\n private _preventDialogOpen = false;\n\n private _debounce = null;\n\n private get _id() {\n return this.hostId || `autocomplete_${CAutocomplete._uniqueId}`;\n }\n\n /**\n * Dropdown items\n */\n @Prop() items: CAutocompleteItem[] = [];\n\n /**\n * Selected item\n */\n @Prop() value: string | number | CAutocompleteItem = null;\n\n /**\n * Search string\n */\n @Prop() query: string = null;\n\n /**\n * Id of the element\n */\n @Prop({ attribute: 'id' }) hostId: string;\n\n /**\n * Disable the input\n */\n @Prop() disabled = false;\n\n /**\n * Element label\n */\n @Prop() label: string;\n\n /**\n * Input field name\n */\n @Prop() name: string;\n\n /**\n * Placeholder text\n */\n @Prop() placeholder = '';\n\n /**\n * Hide the hint and error messages\n */\n @Prop() hideDetails = false;\n\n /**\n * Hint text for the input\n */\n @Prop() hint = '';\n\n /**\n * Show loading state\n */\n @Prop() loading = false;\n\n /**\n * Show required validation\n */\n @Prop() required = false;\n\n /**\n * Set the validíty of the input\n */\n @Prop() valid = true;\n\n /**\n * Manual validation\n */\n @Prop() validate = false;\n\n /**\n * Validate the input on blur\n */\n @Prop() validateOnBlur = false;\n\n /**\n * Custom validation message\n */\n @Prop() validation = 'Required field';\n\n /**\n * Shadow variant\n */\n @Prop() shadow = false;\n\n /**\n * Return object instead of value\n */\n @Prop() returnObject = false;\n\n /**\n * Triggered when text is typed\n */\n @Event() changeQuery: EventEmitter;\n\n /**\n * Triggered when option is selected\n */\n @Event({ bubbles: false }) changeValue: EventEmitter;\n\n /**\n * Items per page before adding scroll\n */\n @Prop() itemsPerPage = 6;\n\n @State() optionElements: NodeListOf<HTMLCOptionElement>;\n\n @State() currentIndex: number = null;\n\n @State() dropdownVisible = false;\n\n @State() statusText = '';\n\n @State() optionElementsExist = false;\n\n /**\n * Reset autocomplete state\n */\n @Method()\n async reset() {\n this.query = '';\n\n this.changeValue.emit(null);\n\n this.internals.setFormValue(null);\n\n this.changeQuery.emit('');\n\n this._dropdownElement.updateList();\n }\n\n @Listen('keydown', { passive: true })\n handleKeyDown(event: KeyboardEvent) {\n const alphanumeric = /^[0-9a-zA-Z ]+$/;\n\n if (event.key.match(alphanumeric) && event.key.length === 1) {\n if (!this.dropdownVisible) {\n this._dropdownElement.open();\n\n return;\n }\n\n this._inputElement.focus();\n\n return;\n }\n\n if (event.key === 'Escape') {\n event.preventDefault();\n\n this._preventDialogOpen = true;\n this._dropdownElement.close();\n\n requestAnimationFrame(() => {\n this._inputElement.focus();\n });\n\n return;\n }\n\n if (event.key === 'Tab') {\n this._inputElement.focus();\n\n requestAnimationFrame(() => {\n this._dropdownElement.close();\n });\n\n return;\n }\n\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n\n if (!this._items.length) return;\n\n if (!this.dropdownVisible || this.currentIndex === null) {\n this.currentIndex = 0;\n this._dropdownElement.open();\n this._dropdownElement.focusItem(this.currentIndex);\n\n return;\n }\n\n this.currentIndex = Math.min(\n this.currentIndex + 1,\n this._items.length - 1,\n );\n\n this._dropdownElement.focusItem(this.currentIndex);\n\n return;\n }\n\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n\n if (this.currentIndex === 0) {\n this._dropdownElement.close();\n this._inputElement.focus();\n }\n\n if (!this.dropdownVisible || this.currentIndex === null) {\n this.currentIndex = this._items.length - 1;\n this._dropdownElement.open();\n this._dropdownElement.focusItem(this.currentIndex);\n\n return;\n }\n\n this.currentIndex = Math.max(this.currentIndex - 1, 0);\n\n this._dropdownElement.focusItem(this.currentIndex);\n }\n\n if (event.key === 'Enter') {\n event.preventDefault();\n\n if (this.currentIndex === null) return;\n\n this._dropdownElement.selectItem(this.currentIndex);\n }\n\n if (event.key === 'Home' && this.dropdownVisible) {\n this.currentIndex = 0;\n }\n\n if (event.key === 'End' && this.dropdownVisible) {\n this.currentIndex = this._items.length - 1;\n }\n }\n\n @Listen('dropdownStateChange')\n onDropdownStateChange(event: CustomEvent<boolean>) {\n const isOpen = event.detail;\n\n this.dropdownVisible = isOpen;\n\n if (!isOpen) {\n requestAnimationFrame(() => {\n this.currentIndex = null;\n });\n }\n }\n\n @Listen('selectOption')\n onSelectOption(event: CustomEvent<{ name: string; value: string }>) {\n this._dropdownElement.close();\n\n const { name, value } = event.detail;\n\n this.value = this.returnObject ? event.detail : value;\n\n this.changeValue.emit(this.value);\n\n this.internals.setFormValue(value);\n\n this.query = name;\n\n this.changeQuery.emit(name);\n\n this._preventDialogOpen = true;\n\n if (this.optionElementsExist) {\n Array.from(this.optionElements).forEach((item) => {\n item.selected = item.value === value && item.name === name;\n });\n\n this._dropdownElement.updateList();\n }\n\n this._inputElement.focus();\n }\n\n @Watch('query')\n handleQueryChange() {\n this._updateStatusText();\n }\n\n private _updateInput(event: InputEvent) {\n this._dropdownElement.open();\n\n this.query = (event.target as HTMLInputElement).value;\n\n this.changeQuery.emit(this.query);\n\n this._dropdownElement.updateList();\n }\n\n private _handleSlotChange = () => {\n this.optionElements = this.el.querySelectorAll('c-option');\n\n const selection = Array.from(this.optionElements).find(\n (option) => option.selected,\n );\n\n if (selection) {\n this.value = this.returnObject\n ? { name: selection.name, value: selection.value }\n : selection.value;\n\n this.changeValue.emit(this.value);\n\n this.query = selection.name.toString();\n\n this.changeQuery.emit(selection.value);\n\n this.internals.setFormValue(selection.value.toString());\n }\n\n if (this.optionElements.length && !this.optionElementsExist) {\n this.optionElementsExist = true;\n }\n };\n\n private _toggleDropdown = (event) => {\n event.stopPropagation();\n\n if (this.dropdownVisible) {\n this._dropdownElement.close();\n\n return;\n }\n\n this._dropdownElement.open();\n };\n\n private _onButtonKeyDown = (\n src: 'chevron' | 'reset',\n event: KeyboardEvent,\n ) => {\n event.stopPropagation();\n\n if (event.key !== 'Tab') event.preventDefault();\n\n if (['Enter', ' '].includes(event.key)) {\n if (src === 'chevron') {\n this._toggleDropdown(event);\n\n return;\n }\n\n this._reset(event);\n\n this._preventDialogOpen = true;\n\n this._inputElement.focus();\n }\n };\n\n private _renderLoader() {\n return <c-spinner color=\"var(--_c-autocomplete-active-color)\" size={20} />;\n }\n\n private _renderChevron() {\n const classes = {\n 'c-input-menu__chevron': true,\n 'c-input-menu__chevron--active': this.dropdownVisible,\n };\n\n return (\n <c-icon-button\n size=\"x-small\"\n class={classes}\n text\n onClick={(event) => this._toggleDropdown(event)}\n onKeyDown={(event) => this._onButtonKeyDown('chevron', event)}\n >\n <c-icon path={mdiChevronDown} size={24} />\n </c-icon-button>\n );\n }\n\n private _reset = (event) => {\n event.stopPropagation();\n\n this.query = '';\n\n this.value = null;\n\n this.changeValue.emit(null);\n\n this.internals.setFormValue(null);\n\n this.changeQuery.emit('');\n\n this._preventDialogOpen = true;\n\n this._cInputElement.reset();\n\n this._inputElement.focus();\n\n this._dropdownElement.updateList();\n };\n\n private _renderReset() {\n return (\n <c-icon-button\n aria-label=\"\"\n size=\"x-small\"\n text\n onClick={(event) => this._reset(event)}\n onKeyDown={(event) => this._onButtonKeyDown('reset', event)}\n >\n <c-icon path={mdiClose} size={20} />\n </c-icon-button>\n );\n }\n\n private _onInputFocus = () => {\n if (!this._preventDialogOpen) {\n this._dropdownElement.open();\n }\n\n this._updateStatusText();\n\n this._preventDialogOpen = false;\n };\n\n private _renderInputElement() {\n return (\n <div class=\"c-input-menu__input\">\n <input\n type=\"text\"\n ref={(el) => (this._inputElement = el)}\n aria-expanded={this.dropdownVisible.toString()}\n aria-owns={this._inputId + '-items'}\n aria-autocomplete=\"list\"\n autocomplete=\"off\"\n class=\"c-input__input\"\n role=\"combobox\"\n value={this.query}\n name={this.name ?? null}\n onInput={(event) => this._updateInput(event)}\n onFocus={() => this._onInputFocus()}\n />\n </div>\n );\n }\n\n componentWillLoad() {\n CAutocomplete._uniqueId += 1;\n\n this._inputId =\n 'input_' +\n (this.hostId || this.label || this.placeholder).replace(\n /[^a-zA-Z0-9-_]/g,\n '',\n );\n }\n\n private get _items() {\n return this.optionElementsExist ? this.optionElements : this.items;\n }\n\n private _updateStatusText() {\n if (this._debounce !== null) {\n clearTimeout(this._debounce);\n this._debounce = null;\n }\n\n this._debounce = window.setTimeout(() => {\n const ending = !!this._items.length\n ? ' or navigate using the up and down arrows'\n : '';\n\n if (this.currentIndex === null) {\n this.statusText = this._items.length\n ? `${this._items.length} result${\n this._items.length !== 1 ? 's' : ''\n } available`\n : 'No search results available';\n }\n\n if (this.query !== null && this._items.length) {\n this.statusText += ', input a search query to filter the results';\n }\n\n this._dropdownElement.setStatusText(this.statusText + ending);\n\n this._debounce = null;\n }, 1400);\n }\n\n render() {\n const itemType = this.optionElementsExist ? 'option' : 'item';\n\n return (\n <Host>\n <c-dropdown\n ref={(el) => (this._dropdownElement = el)}\n id={`${this._id}-dropdown`}\n index={this.currentIndex}\n items-per-page={this.itemsPerPage}\n item-type={itemType}\n items={\n this._items as NodeListOf<HTMLCOptionElement> & CAutocompleteItem[]\n }\n parent={this.el}\n type=\"autocomplete\"\n >\n <c-input\n slot=\"default\"\n ref={(el) => (this._cInputElement = el)}\n active={this.dropdownVisible}\n disabled={this.disabled}\n hide-details={this.hideDetails}\n hint={this.hint}\n id={this.hostId}\n input-id={this._inputId}\n label={this.label}\n name={this.name}\n placeholder={this.placeholder}\n required={this.required}\n shadow={this.shadow}\n valid={this.valid}\n validate={this.validate}\n validate-on-blur={this.validateOnBlur}\n validation={this.validation}\n value={this.query}\n variant=\"select\"\n >\n <slot name=\"pre\" slot=\"pre\"></slot>\n\n <div class=\"c-input__content\">\n {this._renderInputElement()}\n\n {this.loading && this._renderLoader()}\n\n {!this.loading && this.value && this._renderReset()}\n\n {!this.loading && !this.value && this._renderChevron()}\n\n <slot onSlotchange={() => this._handleSlotChange()}></slot>\n </div>\n\n <slot name=\"post\" slot=\"post\"></slot>\n </c-input>\n </c-dropdown>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"c-autocomplete.js","sourceRoot":"","sources":["../../../../src/components/c-autocomplete/c-autocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,SAAS,EACT,IAAI,EACJ,CAAC,EACD,IAAI,EACJ,KAAK,EACL,OAAO,EACP,KAAK,EAEL,MAAM,EACN,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAWnD,MAAM,OAAO,aAAa;;IAgBhB,uBAAkB,GAAG,KAAK,CAAC;IAE3B,cAAS,GAAG,IAAI,CAAC;IAqSjB,sBAAiB,GAAG,GAAG,EAAE;MAC/B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;MAE3D,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,cA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA5iBc,uBAAS,GAAG,CAAC,AAAJ,CAAK","sourcesContent":["import {\n AttachInternals,\n Component,\n Host,\n h,\n Prop,\n State,\n Element,\n Event,\n EventEmitter,\n Listen,\n Watch,\n Method,\n} from '@stencil/core';\nimport { CAutocompleteItem } from '../../types';\nimport { mdiChevronDown, mdiClose } from '@mdi/js';\n\n/**\n * @group Form\n */\n@Component({\n tag: 'c-autocomplete',\n styleUrl: 'c-autocomplete.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class CAutocomplete {\n @Element() el: HTMLCAutocompleteElement;\n\n // eslint-disable-next-line\n @AttachInternals() internals: ElementInternals;\n\n private static _uniqueId = 0;\n\n private _dropdownElement: HTMLCDropdownElement;\n\n private _inputElement: HTMLInputElement;\n\n private _cInputElement: HTMLCInputElement;\n\n private _inputId: string;\n\n private _preventDialogOpen = false;\n\n private _debounce = null;\n\n private get _id() {\n return this.hostId || `autocomplete_${CAutocomplete._uniqueId}`;\n }\n\n /**\n * Dropdown items\n */\n @Prop() items: CAutocompleteItem[] = [];\n\n /**\n * Selected item\n */\n @Prop() value: string | number | CAutocompleteItem = null;\n\n /**\n * Search string\n */\n @Prop() query: string = null;\n\n /**\n * Id of the element\n */\n @Prop({ attribute: 'id' }) hostId: string;\n\n /**\n * Disable the input\n */\n @Prop() disabled = false;\n\n /**\n * Element label\n */\n @Prop() label: string;\n\n /**\n * Input field name\n */\n @Prop() name: string;\n\n /**\n * Placeholder text\n */\n @Prop() placeholder = '';\n\n /**\n * Hide the hint and error messages\n */\n @Prop() hideDetails = false;\n\n /**\n * Hint text for the input\n */\n @Prop() hint = '';\n\n /**\n * Show loading state\n */\n @Prop() loading = false;\n\n /**\n * Show required validation\n */\n @Prop() required = false;\n\n /**\n * Set the validíty of the input\n */\n @Prop() valid = true;\n\n /**\n * Manual validation\n */\n @Prop() validate = false;\n\n /**\n * Validate the input on blur\n */\n @Prop() validateOnBlur = false;\n\n /**\n * Custom validation message\n */\n @Prop() validation = 'Required field';\n\n /**\n * Shadow variant\n */\n @Prop() shadow = false;\n\n /**\n * Return object instead of value\n */\n @Prop() returnObject = false;\n\n /**\n * Triggered when text is typed\n */\n @Event() changeQuery: EventEmitter;\n\n /**\n * Triggered when option is selected\n */\n @Event({ bubbles: false }) changeValue: EventEmitter;\n\n /**\n * Items per page before adding scroll\n */\n @Prop() itemsPerPage = 6;\n\n @State() optionElements: NodeListOf<HTMLCOptionElement>;\n\n @State() currentIndex: number = null;\n\n @State() dropdownVisible = false;\n\n @State() statusText = '';\n\n @State() optionElementsExist = false;\n\n /**\n * Reset autocomplete state\n */\n @Method()\n async reset() {\n this.query = '';\n\n this.changeValue.emit(null);\n\n this.internals.setFormValue(null);\n\n this.changeQuery.emit('');\n\n this._dropdownElement.updateList();\n }\n\n private _handleKeyDown(event: KeyboardEvent) {\n const alphanumeric = /^[0-9a-zA-Z ]+$/;\n\n if (event.key.match(alphanumeric) && event.key.length === 1) {\n if (!this.dropdownVisible) {\n this._dropdownElement.open();\n\n return;\n }\n\n this._inputElement.focus();\n\n return;\n }\n\n if (event.key === 'Escape') {\n event.preventDefault();\n\n this._preventDialogOpen = true;\n this._dropdownElement.close();\n\n requestAnimationFrame(() => {\n this._inputElement.focus();\n });\n\n return;\n }\n\n if (event.key === 'Tab') {\n this._inputElement.focus();\n\n requestAnimationFrame(() => {\n this._dropdownElement.close();\n });\n\n return;\n }\n\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n\n if (!this._items.length) return;\n\n if (!this.dropdownVisible || this.currentIndex === null) {\n this.currentIndex = 0;\n this._dropdownElement.open();\n this._dropdownElement.focusItem(this.currentIndex);\n\n return;\n }\n\n this.currentIndex = Math.min(\n this.currentIndex + 1,\n this._items.length - 1,\n );\n\n this._dropdownElement.focusItem(this.currentIndex);\n\n return;\n }\n\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n\n if (this.currentIndex === 0) {\n this._dropdownElement.close();\n this._inputElement.focus();\n }\n\n if (!this.dropdownVisible || this.currentIndex === null) {\n this.currentIndex = this._items.length - 1;\n this._dropdownElement.open();\n this._dropdownElement.focusItem(this.currentIndex);\n\n return;\n }\n\n this.currentIndex = Math.max(this.currentIndex - 1, 0);\n\n this._dropdownElement.focusItem(this.currentIndex);\n }\n\n if (event.key === 'Enter') {\n event.preventDefault();\n\n if (this.currentIndex === null) return;\n\n this._dropdownElement.selectItem(this.currentIndex);\n }\n\n if (event.key === 'Home' && this.dropdownVisible) {\n this.currentIndex = 0;\n }\n\n if (event.key === 'End' && this.dropdownVisible) {\n this.currentIndex = this._items.length - 1;\n }\n }\n\n @Listen('dropdownStateChange')\n onDropdownStateChange(event: CustomEvent<boolean>) {\n const isOpen = event.detail;\n\n this.dropdownVisible = isOpen;\n\n if (!isOpen) {\n requestAnimationFrame(() => {\n this.currentIndex = null;\n });\n }\n }\n\n @Listen('selectOption')\n onSelectOption(event: CustomEvent<{ name: string; value: string }>) {\n this._dropdownElement.close();\n\n const { name, value } = event.detail;\n\n this.value = this.returnObject ? event.detail : value;\n\n this.changeValue.emit(this.value);\n\n this.internals.setFormValue(value);\n\n this.query = name;\n\n this.changeQuery.emit(name);\n\n this._preventDialogOpen = true;\n\n if (this.optionElementsExist) {\n Array.from(this.optionElements).forEach((item) => {\n item.selected = item.value === value && item.name === name;\n });\n\n this._dropdownElement.updateList();\n }\n\n this._inputElement.focus();\n }\n\n @Watch('query')\n handleQueryChange() {\n this._updateStatusText();\n }\n\n private _updateInput() {\n this._dropdownElement.open();\n\n this.query = this._inputElement.value;\n\n this.changeQuery.emit(this.query);\n\n this._dropdownElement.updateList();\n }\n\n private _handleSlotChange = () => {\n this.optionElements = this.el.querySelectorAll('c-option');\n\n const selection = Array.from(this.optionElements).find(\n (option) => option.selected,\n );\n\n if (selection) {\n this.value = this.returnObject\n ? { name: selection.name, value: selection.value }\n : selection.value;\n\n this.changeValue.emit(this.value);\n\n this.changeQuery.emit(this.query);\n\n this.internals.setFormValue(selection.value.toString());\n }\n\n if (this.optionElements.length && !this.optionElementsExist) {\n this.optionElementsExist = true;\n }\n };\n\n private _toggleDropdown = (event) => {\n event.stopPropagation();\n\n if (this.dropdownVisible) {\n this._dropdownElement.close();\n\n return;\n }\n\n this._dropdownElement.open();\n };\n\n private _onButtonKeyDown = (\n src: 'chevron' | 'reset',\n event: KeyboardEvent,\n ) => {\n event.stopPropagation();\n\n if (event.key !== 'Tab') event.preventDefault();\n\n if (['Enter', ' '].includes(event.key)) {\n if (src === 'chevron') {\n this._toggleDropdown(event);\n\n return;\n }\n\n this._reset(event);\n\n this._preventDialogOpen = true;\n\n this._inputElement.focus();\n }\n };\n\n private _renderLoader() {\n return <c-spinner color=\"var(--_c-autocomplete-active-color)\" size={20} />;\n }\n\n private _renderChevron() {\n const classes = {\n 'c-input-menu__chevron': true,\n 'c-input-menu__chevron--active': this.dropdownVisible,\n };\n\n return (\n <c-icon-button\n size=\"x-small\"\n class={classes}\n text\n onClick={(event) => this._toggleDropdown(event)}\n onKeyDown={(event) => this._onButtonKeyDown('chevron', event)}\n >\n <c-icon path={mdiChevronDown} size={24} />\n </c-icon-button>\n );\n }\n\n private _reset = (event) => {\n event.stopPropagation();\n\n this.query = '';\n\n this.value = null;\n\n this.changeValue.emit(null);\n\n this.internals.setFormValue(null);\n\n this.changeQuery.emit('');\n\n this._preventDialogOpen = true;\n\n this._cInputElement.reset();\n\n this._inputElement.focus();\n\n this._dropdownElement.updateList();\n };\n\n private _renderReset() {\n return (\n <c-icon-button\n aria-label=\"\"\n size=\"x-small\"\n text\n onClick={(event) => this._reset(event)}\n onKeyDown={(event) => this._onButtonKeyDown('reset', event)}\n >\n <c-icon path={mdiClose} size={20} />\n </c-icon-button>\n );\n }\n\n private _onInputFocus = () => {\n if (!this._preventDialogOpen) {\n this._dropdownElement.open();\n }\n\n this._updateStatusText();\n\n this._preventDialogOpen = false;\n };\n\n private _renderInputElement() {\n return (\n <div class=\"c-input-menu__input\">\n <input\n type=\"text\"\n ref={(el) => (this._inputElement = el)}\n aria-expanded={this.dropdownVisible.toString()}\n aria-owns={this._inputId + '-items'}\n aria-autocomplete=\"list\"\n autocomplete=\"off\"\n class=\"c-input__input\"\n role=\"combobox\"\n value={this.query}\n name={this.name ?? null}\n onInput={() => this._updateInput()}\n onFocus={() => this._onInputFocus()}\n />\n </div>\n );\n }\n\n componentWillLoad() {\n CAutocomplete._uniqueId += 1;\n\n this._inputId =\n 'input_' +\n (this.hostId || this.label || this.placeholder).replace(\n /[^a-zA-Z0-9-_]/g,\n '',\n );\n }\n\n private get _items() {\n return this.optionElementsExist ? this.optionElements : this.items;\n }\n\n private _updateStatusText() {\n if (this._debounce !== null) {\n clearTimeout(this._debounce);\n this._debounce = null;\n }\n\n this._debounce = window.setTimeout(() => {\n const ending = !!this._items.length\n ? ' or navigate using the up and down arrows'\n : '';\n\n if (this.currentIndex === null) {\n this.statusText = this._items.length\n ? `${this._items.length} result${\n this._items.length !== 1 ? 's' : ''\n } available`\n : 'No search results available';\n }\n\n if (this.query !== null && this._items.length) {\n this.statusText += ', input a search query to filter the results';\n }\n\n this._dropdownElement.setStatusText(this.statusText + ending);\n\n this._debounce = null;\n }, 1400);\n }\n\n render() {\n const itemType = this.optionElementsExist ? 'option' : 'item';\n\n return (\n <Host>\n <c-dropdown\n ref={(el) => (this._dropdownElement = el)}\n id={`${this._id}-dropdown`}\n index={this.currentIndex}\n items-per-page={this.itemsPerPage}\n item-type={itemType}\n items={\n this._items as NodeListOf<HTMLCOptionElement> & CAutocompleteItem[]\n }\n parent={this.el}\n type=\"autocomplete\"\n onKeyDown={(event) => this._handleKeyDown(event)}\n >\n <c-input\n slot=\"default\"\n ref={(el) => (this._cInputElement = el)}\n active={this.dropdownVisible}\n disabled={this.disabled}\n hide-details={this.hideDetails}\n hint={this.hint}\n id={this.hostId}\n input-id={this._inputId}\n label={this.label}\n name={this.name}\n placeholder={this.placeholder}\n required={this.required}\n shadow={this.shadow}\n valid={this.valid}\n validate={this.validate}\n validate-on-blur={this.validateOnBlur}\n validation={this.validation}\n value={this.query}\n variant=\"select\"\n >\n <slot name=\"pre\" slot=\"pre\"></slot>\n\n <div class=\"c-input__content\">\n {this._renderInputElement()}\n\n {this.loading && this._renderLoader()}\n\n {!this.loading && this.value && this._renderReset()}\n\n {!this.loading && !this.value && this._renderChevron()}\n\n <slot onSlotchange={() => this._handleSlotChange()}></slot>\n </div>\n\n <slot name=\"post\" slot=\"post\"></slot>\n </c-input>\n </c-dropdown>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -161,7 +161,6 @@ export class CDropdown {
|
|
|
161
161
|
inputSlot = 'input-bottom';
|
|
162
162
|
this._dialog.style.top = 'auto';
|
|
163
163
|
this._dialog.style.bottom = `${innerHeight - inputSize.top - 44}px`;
|
|
164
|
-
this._inputElement.scrollIntoView();
|
|
165
164
|
}
|
|
166
165
|
}
|
|
167
166
|
this._dummyElement.style.width = `${this._getParentPosition().width}px`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"c-dropdown.js","sourceRoot":"","sources":["../../../../src/components/c-dropdown/c-dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,CAAC,EACD,OAAO,EACP,MAAM,EACN,KAAK,EACL,KAAK,EAEL,KAAK,GACN,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAO9C,MAAM,OAAO,SAAS;;IAwDZ,cAAS,GAAG,IAAI,CAAC;IAcjB,cAAS,GAAG,KAAK,CAAC;IAElB,eAAU,GAAoB,EAAE,CAAC;IA8JjC,eAAU,GAAG;MACnB,MAAM,EAAE,CAAC;MACT,KAAK,EAAE,CAAC;KACT,CAAC;IAEM,iBAAY,GAAG,KAAK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AAG,EAAE,CAAC,EAC9B,EAAE,EAAE,GAAG,IAAI,CAAC,MAAM,WAAW,EAC7B,IAAI,EAAC,SAAS,mBACC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,EACrC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,EACtD,QAAQ,EAAC,IAAI,IAEZ,IAAI,CAAC,YAAY,CACf;QAEL,WACE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,sBAAsB,EAAE,IAAI,EAAE;UAElE,YAAM,IAAI,EAAC,cAAc,GAAQ,CAC7B,CACC,CACJ,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { mdiAlert } from '@mdi/js';\nimport {\n Component,\n Host,\n Prop,\n h,\n Element,\n Method,\n Watch,\n Event,\n EventEmitter,\n State,\n} from '@stencil/core';\nimport { CAutocompleteItem, CSelectItem } from '../../types';\nimport { getScrollParent } from '../../utils';\n\n@Component({\n tag: 'c-dropdown',\n styleUrl: 'c-dropdown.scss',\n shadow: true,\n})\nexport class CDropdown {\n @Element() el: HTMLCDropdownElement;\n\n /**\n * Items per page before adding scroll\n */\n @Prop() itemsPerPage: number;\n\n /**\n * Dropdown parent\n */\n @Prop() parent: HTMLCSelectElement | HTMLCAutocompleteElement;\n\n /**\n * Dropdown options\n */\n @Prop() items:\n | NodeListOf<HTMLCOptionElement>\n | CAutocompleteItem[]\n | CSelectItem[];\n\n /**\n * Current index value\n */\n @Prop() index: number;\n\n /**\n * Id of the element\n */\n @Prop({ attribute: 'id' }) hostId: string;\n\n /**\n * Triggered when option is selected\n */\n @Event() selectOption: EventEmitter;\n\n /**\n * Type of the parent element\n */\n @Prop() type: 'select' | 'autocomplete';\n\n /**\n * Type of items\n */\n @Prop() itemType: 'option' | 'item';\n\n /**\n * Triggered when dropdown opens or closes\n */\n @Event() dropdownStateChange: EventEmitter<boolean>;\n\n /**\n * Dropdown dialog element\n */\n private _dialog: HTMLDialogElement;\n\n private _debounce = null;\n\n private _list: HTMLUListElement;\n\n private _outsideClickFn: () => void;\n\n private _resizeObserver: ResizeObserver;\n\n private _inputElement: HTMLCInputElement;\n\n private _dummyElement: HTMLDivElement;\n\n private _scrollParent: HTMLElement;\n\n private _isMobile = false;\n\n private _listItems: HTMLLIElement[] = [];\n\n @State() renderedList = null;\n\n @State() isOpen = false;\n\n @State() statusText = '';\n\n @Watch('items')\n optionsWatcher() {\n requestAnimationFrame(() => {\n this.renderedList = this._renderList();\n });\n }\n\n @Watch('isOpen')\n async stateWatcher(isOpen) {\n this.dropdownStateChange.emit(isOpen);\n\n this._scrollParent = this._scrollParent || (await getScrollParent(this.el));\n\n this._scrollParent.style.overflow = isOpen ? 'hidden' : null;\n }\n\n @Watch('index')\n handleIndexChange(index) {\n requestAnimationFrame(() => {\n this._updateStatusText();\n\n this._listItems[index]?.focus();\n });\n }\n\n /**\n * @private\n */\n @Method()\n async setStatusText(text: string) {\n requestAnimationFrame(() => {\n this.statusText = text;\n });\n }\n\n /**\n * @private\n */\n @Method()\n async focusItem(index: number) {\n requestAnimationFrame(() => {\n this._listItems[index]?.focus();\n });\n }\n\n /**\n * Open dropdown\n */\n @Method()\n async open() {\n if (this._dialog.open) return;\n\n this._outsideClickFn = this._handleOutsideClick.bind(this);\n\n window.addEventListener('click', this._outsideClickFn);\n\n requestAnimationFrame(() => {\n this.isOpen = true;\n\n this._positionMenu();\n });\n }\n\n /**\n * Open dropdown\n */\n @Method()\n async close() {\n this._dialog.close();\n\n this.isOpen = false;\n\n this._inputElement.slot = 'default';\n\n this._inputElement.hideDetails = this._hideDetails;\n\n this._dummyElement.style.width = '0';\n this._dummyElement.style.display = 'none';\n this._dialog.style.width = '0';\n\n window.removeEventListener('click', this._outsideClickFn);\n }\n\n private _setIsMobile() {\n this._isMobile = window.matchMedia(\n 'only screen and (max-width: 760px)',\n ).matches;\n }\n\n componentDidLoad() {\n this._setIsMobile();\n\n this._hideDetails = this.parent.hideDetails;\n\n this._inputElement = this.el.querySelector('c-input');\n\n this._resizeObserver = new ResizeObserver((entries) => {\n if (!this._dialog.open) return;\n\n requestAnimationFrame(() => {\n if (!Array.isArray(entries) || !entries.length) return;\n\n this._setIsMobile();\n\n this.close();\n });\n });\n\n this._resizeObserver.observe(window.document.body);\n\n requestAnimationFrame(() => {\n this.renderedList = this._renderList();\n });\n }\n\n /**\n * Select item\n * @returns the disabled status of the input\n */\n @Method()\n async selectItem(index: number) {\n const item = this._listItems[index];\n\n if (item.classList.contains('disabled')) {\n return true;\n }\n\n this._listItems[index].click();\n\n return false;\n }\n\n /**\n * Update list items\n */\n @Method()\n async updateList() {\n requestAnimationFrame(() => {\n this.renderedList = this._renderList();\n });\n }\n\n private _handleOutsideClick(event) {\n if (!this.isOpen) return;\n\n if (!event.composedPath().includes(this._dialog)) {\n this.close();\n }\n }\n\n private _inputSize = {\n height: 0,\n width: 0,\n };\n\n private _openedOnTop = false;\n\n private _hideDetails = false;\n\n private _highlightMatchingText(value: string) {\n const { query } = this.parent as HTMLCAutocompleteElement;\n\n if (this.parent.tagName === 'C-SELECT' || query === '') return value;\n\n const regex = new RegExp(query, 'gi');\n\n const highlighted = value\n .replace(/(<([^>]+)>)/gi, '')\n .replace(regex, (match) => `<mark>${match}</mark>`);\n\n return highlighted;\n }\n\n private _getParentPosition() {\n return this.parent.shadowRoot\n .querySelector('.c-input__slot')\n .getBoundingClientRect();\n }\n\n private _positionMenu() {\n const { innerWidth, innerHeight } = window;\n\n this._dialog.style.width = 'auto';\n this._dialog.style.opacity = '0';\n\n this._dialog.showModal();\n\n requestAnimationFrame(() => {\n let inputSlot = 'input-top';\n\n const { top: parentTop, width } = this._getParentPosition();\n\n const inputSize = this.el.getBoundingClientRect();\n\n this._inputSize = {\n height: inputSize.height,\n width: inputSize.width,\n };\n\n if (!this._isMobile) {\n this._dialog.style.width = `${width}px`;\n this._dialog.style.top = `${inputSize.top}px`;\n this._dialog.style.bottom = 'auto';\n this._dialog.style.left = `${inputSize.left}px`;\n\n const { bottom, right, height } = this._dialog.getBoundingClientRect();\n\n const isInView = {\n x: right < innerWidth,\n y: bottom < innerHeight,\n };\n\n const fitsOnTop = parentTop - height > 0;\n\n if (!fitsOnTop && !isInView.y) {\n this._dialog.style.maxHeight = `${parentTop}px`;\n }\n\n if (!isInView.y || this._openedOnTop) {\n this._openedOnTop = true;\n\n this._inputElement.hideDetails = true;\n inputSlot = 'input-bottom';\n\n this._dialog.style.top = 'auto';\n this._dialog.style.bottom = `${innerHeight - inputSize.top - 44}px`;\n this._inputElement.scrollIntoView();\n }\n }\n\n this._dummyElement.style.width = `${this._getParentPosition().width}px`;\n this._dummyElement.style.height = `${this._inputSize.height}px`;\n this._dummyElement.style.display = 'block';\n this._dummyElement.slot = 'default';\n\n this._inputElement.slot = inputSlot;\n\n this._inputElement.hideDetails = true;\n\n this._dialog.style.opacity = '1';\n\n const input = this.parent.shadowRoot.querySelector('input');\n\n input.focus();\n });\n }\n\n private _emptyItem() {\n const { query, loading } = this.parent as HTMLCAutocompleteElement;\n\n if (!query || loading) return;\n\n return (\n <li>\n <c-icon path={mdiAlert} size={18} color=\"var(--c-warning-600)\"></c-icon>\n No suggestions found\n </li>\n );\n }\n\n private _renderList() {\n return this.itemType === 'option'\n ? this._renderOptionsList()\n : this._renderItemsList();\n }\n\n private _renderOptionsList() {\n if (!this.items.length) return this._emptyItem();\n\n const options = Array.from(this.items) as HTMLCOptionElement[];\n\n this._listItems.length = 0;\n\n return options.map((option, index) => {\n const optionValue = option.querySelector('c-option-value');\n\n if (optionValue) {\n optionValue.innerHTML = this._highlightMatchingText(\n optionValue.textContent,\n );\n }\n\n return (\n <li\n ref={(el) => this._listItems.push(el)}\n id={`${this.hostId}-option-${option.value}`}\n tabindex=\"-1\"\n role=\"option\"\n aria-set-size={this.items.length.toString()}\n aria-pos-in-set={(index + 1).toString()}\n aria-selected={(!!option.selected).toString()}\n class={{ disabled: !!option.disabled }}\n data-name={option.name}\n onClick={(event) => {\n if (option.disabled) {\n event.preventDefault();\n\n return;\n }\n\n this.selectOption.emit({ name: option.name, value: option.value });\n }}\n innerHTML={option.outerHTML}\n ></li>\n );\n });\n }\n\n private _renderItemsList() {\n if (!this.items.length) return this._emptyItem();\n\n this._listItems.length = 0;\n\n return (this.items as unknown as CAutocompleteItem[]).map((item, index) => {\n return (\n <li\n ref={(el) => this._listItems.push(el)}\n id={`${this.hostId}-option-${item.value}`}\n tabindex=\"-1\"\n role=\"option\"\n aria-set-size={this.items.length.toString()}\n aria-pos-in-set={(index + 1).toString()}\n aria-selected={(this.index === index).toString()}\n class={{ disabled: !!item.disabled }}\n data-name={item.name}\n onClick={(event) => {\n if (item.disabled) {\n event.preventDefault();\n\n return;\n }\n\n this.selectOption.emit({ name: item.name, value: item.value });\n }}\n >\n <span innerHTML={this._highlightMatchingText(item.name)}></span>\n </li>\n );\n });\n }\n\n private _updateStatusText() {\n if (this._debounce !== null) {\n clearTimeout(this._debounce);\n this._debounce = null;\n }\n\n this._debounce = window.setTimeout(() => {\n const selection = this._listItems[this.index];\n\n const ending = !!this.items.length\n ? ', to navigate use up and down arrows'\n : '';\n\n const total = this._listItems.length;\n\n const position = this.index + 1;\n\n const isDisabled = !!selection?.classList?.contains('disabled');\n\n const beginning = isDisabled ? 'Disabled option - ' : '';\n\n let selectionText = !!selection\n ? `${beginning}${selection.dataset.name} - ${position} of ${total} is highlighted`\n : null;\n\n if (this.index === null && this.type === 'autocomplete') {\n selectionText = this.items.length\n ? `${this.items.length} result${\n this.items.length !== 1 ? 's' : ''\n } available`\n : 'No search results available';\n }\n\n this.statusText = `${selectionText || ending}`;\n\n this._debounce = null;\n }, 1400);\n }\n\n render() {\n if (\n !this._isMobile &&\n this._dialog &&\n this.itemsPerPage &&\n this.itemsPerPage > 0 &&\n this.items.length > this.itemsPerPage\n ) {\n this._dialog.style.maxHeight = 42 * (this.itemsPerPage + 0.5) + 60 + 'px';\n this._list.style.maxHeight = 42 * (this.itemsPerPage + 0.5) + 'px';\n }\n\n return (\n <Host>\n <slot name=\"default\"></slot>\n\n <div class=\"dummy\" ref={(el) => (this._dummyElement = el)}></div>\n\n <dialog\n tabindex=\"-1\"\n ref={(el) => (this._dialog = el)}\n class={{ mobile: this._isMobile }}\n onCancel={() => this.close()}\n >\n <div\n id={'announce-' + this.hostId}\n class=\"visuallyhidden\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {this.statusText}\n </div>\n\n <div class=\"input-top-wrapper\">\n <slot name=\"input-top\"></slot>\n </div>\n\n <ul\n ref={(el) => (this._list = el)}\n id={`${this.hostId}--results`}\n role=\"listbox\"\n aria-expanded={this.isOpen.toString()}\n class={{ active: this.isOpen, mobile: this._isMobile }}\n tabindex=\"-1\"\n >\n {this.renderedList}\n </ul>\n\n <div\n class={{ active: this._openedOnTop, 'input-bottom-wrapper': true }}\n >\n <slot name=\"input-bottom\"></slot>\n </div>\n </dialog>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"c-dropdown.js","sourceRoot":"","sources":["../../../../src/components/c-dropdown/c-dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,CAAC,EACD,OAAO,EACP,MAAM,EACN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from '@stencil/core';\nimport { CAutocompleteItem, CSelectItem } from '../../types';\nimport { getScrollParent } from '../../utils';\n\n@Component({\n tag: 'c-dropdown',\n styleUrl: 'c-dropdown.scss',\n shadow: true,\n})\nexport class CDropdown {\n @Element() el: HTMLCDropdownElement;\n\n /**\n * Items per page before adding scroll\n */\n @Prop() itemsPerPage: number;\n\n /**\n * Dropdown parent\n */\n @Prop() parent: HTMLCSelectElement | HTMLCAutocompleteElement;\n\n /**\n * Dropdown options\n */\n @Prop() items:\n | NodeListOf<HTMLCOptionElement>\n | CAutocompleteItem[]\n | CSelectItem[];\n\n /**\n * Current index value\n */\n @Prop() index: number;\n\n /**\n * Id of the element\n */\n @Prop({ attribute: 'id' }) hostId: string;\n\n /**\n * Triggered when option is selected\n */\n @Event() selectOption: EventEmitter;\n\n /**\n * Type of the parent element\n */\n @Prop() type: 'select' | 'autocomplete';\n\n /**\n * Type of items\n */\n @Prop() itemType: 'option' | 'item';\n\n /**\n * Triggered when dropdown opens or closes\n */\n @Event() dropdownStateChange: EventEmitter<boolean>;\n\n /**\n * Dropdown dialog element\n */\n private _dialog: HTMLDialogElement;\n\n private _debounce = null;\n\n private _list: HTMLUListElement;\n\n private _outsideClickFn: () => void;\n\n private _resizeObserver: ResizeObserver;\n\n private _inputElement: HTMLCInputElement;\n\n private _dummyElement: HTMLDivElement;\n\n private _scrollParent: HTMLElement;\n\n private _isMobile = false;\n\n private _listItems: HTMLLIElement[] = [];\n\n @State() renderedList = null;\n\n @State() isOpen = false;\n\n @State() statusText = '';\n\n @Watch('items')\n optionsWatcher() {\n requestAnimationFrame(() => {\n this.renderedList = this._renderList();\n });\n }\n\n @Watch('isOpen')\n async stateWatcher(isOpen) {\n this.dropdownStateChange.emit(isOpen);\n\n this._scrollParent = this._scrollParent || (await getScrollParent(this.el));\n\n this._scrollParent.style.overflow = isOpen ? 'hidden' : null;\n }\n\n @Watch('index')\n handleIndexChange(index) {\n requestAnimationFrame(() => {\n this._updateStatusText();\n\n this._listItems[index]?.focus();\n });\n }\n\n /**\n * @private\n */\n @Method()\n async setStatusText(text: string) {\n requestAnimationFrame(() => {\n this.statusText = text;\n });\n }\n\n /**\n * @private\n */\n @Method()\n async focusItem(index: number) {\n requestAnimationFrame(() => {\n this._listItems[index]?.focus();\n });\n }\n\n /**\n * Open dropdown\n */\n @Method()\n async open() {\n if (this._dialog.open) return;\n\n this._outsideClickFn = this._handleOutsideClick.bind(this);\n\n window.addEventListener('click', this._outsideClickFn);\n\n requestAnimationFrame(() => {\n this.isOpen = true;\n\n this._positionMenu();\n });\n }\n\n /**\n * Open dropdown\n */\n @Method()\n async close() {\n this._dialog.close();\n\n this.isOpen = false;\n\n this._inputElement.slot = 'default';\n\n this._inputElement.hideDetails = this._hideDetails;\n\n this._dummyElement.style.width = '0';\n this._dummyElement.style.display = 'none';\n this._dialog.style.width = '0';\n\n window.removeEventListener('click', this._outsideClickFn);\n }\n\n private _setIsMobile() {\n this._isMobile = window.matchMedia(\n 'only screen and (max-width: 760px)',\n ).matches;\n }\n\n componentDidLoad() {\n this._setIsMobile();\n\n this._hideDetails = this.parent.hideDetails;\n\n this._inputElement = this.el.querySelector('c-input');\n\n this._resizeObserver = new ResizeObserver((entries) => {\n if (!this._dialog.open) return;\n\n requestAnimationFrame(() => {\n if (!Array.isArray(entries) || !entries.length) return;\n\n this._setIsMobile();\n\n this.close();\n });\n });\n\n this._resizeObserver.observe(window.document.body);\n\n requestAnimationFrame(() => {\n this.renderedList = this._renderList();\n });\n }\n\n /**\n * Select item\n * @returns the disabled status of the input\n */\n @Method()\n async selectItem(index: number) {\n const item = this._listItems[index];\n\n if (item.classList.contains('disabled')) {\n return true;\n }\n\n this._listItems[index].click();\n\n return false;\n }\n\n /**\n * Update list items\n */\n @Method()\n async updateList() {\n requestAnimationFrame(() => {\n this.renderedList = this._renderList();\n });\n }\n\n private _handleOutsideClick(event) {\n if (!this.isOpen) return;\n\n if (!event.composedPath().includes(this._dialog)) {\n this.close();\n }\n }\n\n private _inputSize = {\n height: 0,\n width: 0,\n };\n\n private _openedOnTop = false;\n\n private _hideDetails = false;\n\n private _highlightMatchingText(value: string) {\n const { query } = this.parent as HTMLCAutocompleteElement;\n\n if (this.parent.tagName === 'C-SELECT' || query === '') return value;\n\n const regex = new RegExp(query, 'gi');\n\n const highlighted = value\n .replace(/(<([^>]+)>)/gi, '')\n .replace(regex, (match) => `<mark>${match}</mark>`);\n\n return highlighted;\n }\n\n private _getParentPosition() {\n return this.parent.shadowRoot\n .querySelector('.c-input__slot')\n .getBoundingClientRect();\n }\n\n private _positionMenu() {\n const { innerWidth, innerHeight } = window;\n\n this._dialog.style.width = 'auto';\n this._dialog.style.opacity = '0';\n\n this._dialog.showModal();\n\n requestAnimationFrame(() => {\n let inputSlot = 'input-top';\n\n const { top: parentTop, width } = this._getParentPosition();\n\n const inputSize = this.el.getBoundingClientRect();\n\n this._inputSize = {\n height: inputSize.height,\n width: inputSize.width,\n };\n\n if (!this._isMobile) {\n this._dialog.style.width = `${width}px`;\n this._dialog.style.top = `${inputSize.top}px`;\n this._dialog.style.bottom = 'auto';\n this._dialog.style.left = `${inputSize.left}px`;\n\n const { bottom, right, height } = this._dialog.getBoundingClientRect();\n\n const isInView = {\n x: right < innerWidth,\n y: bottom < innerHeight,\n };\n\n const fitsOnTop = parentTop - height > 0;\n\n if (!fitsOnTop && !isInView.y) {\n this._dialog.style.maxHeight = `${parentTop}px`;\n }\n\n if (!isInView.y || this._openedOnTop) {\n this._openedOnTop = true;\n\n this._inputElement.hideDetails = true;\n inputSlot = 'input-bottom';\n\n this._dialog.style.top = 'auto';\n this._dialog.style.bottom = `${innerHeight - inputSize.top - 44}px`;\n }\n }\n\n this._dummyElement.style.width = `${this._getParentPosition().width}px`;\n this._dummyElement.style.height = `${this._inputSize.height}px`;\n this._dummyElement.style.display = 'block';\n this._dummyElement.slot = 'default';\n\n this._inputElement.slot = inputSlot;\n\n this._inputElement.hideDetails = true;\n\n this._dialog.style.opacity = '1';\n\n const input = this.parent.shadowRoot.querySelector('input');\n\n input.focus();\n });\n }\n\n private _emptyItem() {\n const { query, loading } = this.parent as HTMLCAutocompleteElement;\n\n if (!query || loading) return;\n\n return (\n <li>\n <c-icon path={mdiAlert} size={18} color=\"var(--c-warning-600)\"></c-icon>\n No suggestions found\n </li>\n );\n }\n\n private _renderList() {\n return this.itemType === 'option'\n ? this._renderOptionsList()\n : this._renderItemsList();\n }\n\n private _renderOptionsList() {\n if (!this.items.length) return this._emptyItem();\n\n const options = Array.from(this.items) as HTMLCOptionElement[];\n\n this._listItems.length = 0;\n\n return options.map((option, index) => {\n const optionValue = option.querySelector('c-option-value');\n\n if (optionValue) {\n optionValue.innerHTML = this._highlightMatchingText(\n optionValue.textContent,\n );\n }\n\n return (\n <li\n ref={(el) => this._listItems.push(el)}\n id={`${this.hostId}-option-${option.value}`}\n tabindex=\"-1\"\n role=\"option\"\n aria-set-size={this.items.length.toString()}\n aria-pos-in-set={(index + 1).toString()}\n aria-selected={(!!option.selected).toString()}\n class={{ disabled: !!option.disabled }}\n data-name={option.name}\n onClick={(event) => {\n if (option.disabled) {\n event.preventDefault();\n\n return;\n }\n\n this.selectOption.emit({ name: option.name, value: option.value });\n }}\n innerHTML={option.outerHTML}\n ></li>\n );\n });\n }\n\n private _renderItemsList() {\n if (!this.items.length) return this._emptyItem();\n\n this._listItems.length = 0;\n\n return (this.items as unknown as CAutocompleteItem[]).map((item, index) => {\n return (\n <li\n ref={(el) => this._listItems.push(el)}\n id={`${this.hostId}-option-${item.value}`}\n tabindex=\"-1\"\n role=\"option\"\n aria-set-size={this.items.length.toString()}\n aria-pos-in-set={(index + 1).toString()}\n aria-selected={(this.index === index).toString()}\n class={{ disabled: !!item.disabled }}\n data-name={item.name}\n onClick={(event) => {\n if (item.disabled) {\n event.preventDefault();\n\n return;\n }\n\n this.selectOption.emit({ name: item.name, value: item.value });\n }}\n >\n <span innerHTML={this._highlightMatchingText(item.name)}></span>\n </li>\n );\n });\n }\n\n private _updateStatusText() {\n if (this._debounce !== null) {\n clearTimeout(this._debounce);\n this._debounce = null;\n }\n\n this._debounce = window.setTimeout(() => {\n const selection = this._listItems[this.index];\n\n const ending = !!this.items.length\n ? ', to navigate use up and down arrows'\n : '';\n\n const total = this._listItems.length;\n\n const position = this.index + 1;\n\n const isDisabled = !!selection?.classList?.contains('disabled');\n\n const beginning = isDisabled ? 'Disabled option - ' : '';\n\n let selectionText = !!selection\n ? `${beginning}${selection.dataset.name} - ${position} of ${total} is highlighted`\n : null;\n\n if (this.index === null && this.type === 'autocomplete') {\n selectionText = this.items.length\n ? `${this.items.length} result${\n this.items.length !== 1 ? 's' : ''\n } available`\n : 'No search results available';\n }\n\n this.statusText = `${selectionText || ending}`;\n\n this._debounce = null;\n }, 1400);\n }\n\n render() {\n if (\n !this._isMobile &&\n this._dialog &&\n this.itemsPerPage &&\n this.itemsPerPage > 0 &&\n this.items.length > this.itemsPerPage\n ) {\n this._dialog.style.maxHeight = 42 * (this.itemsPerPage + 0.5) + 60 + 'px';\n this._list.style.maxHeight = 42 * (this.itemsPerPage + 0.5) + 'px';\n }\n\n return (\n <Host>\n <slot name=\"default\"></slot>\n\n <div class=\"dummy\" ref={(el) => (this._dummyElement = el)}></div>\n\n <dialog\n tabindex=\"-1\"\n ref={(el) => (this._dialog = el)}\n class={{ mobile: this._isMobile }}\n onCancel={() => this.close()}\n >\n <div\n id={'announce-' + this.hostId}\n class=\"visuallyhidden\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {this.statusText}\n </div>\n\n <div class=\"input-top-wrapper\">\n <slot name=\"input-top\"></slot>\n </div>\n\n <ul\n ref={(el) => (this._list = el)}\n id={`${this.hostId}--results`}\n role=\"listbox\"\n aria-expanded={this.isOpen.toString()}\n class={{ active: this.isOpen, mobile: this._isMobile }}\n tabindex=\"-1\"\n >\n {this.renderedList}\n </ul>\n\n <div\n class={{ active: this._openedOnTop, 'input-bottom-wrapper': true }}\n >\n <slot name=\"input-bottom\"></slot>\n </div>\n </dialog>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -29,8 +29,7 @@ const CAutocomplete$1 = proxyCustomElement(class CAutocomplete extends HTMLEleme
|
|
|
29
29
|
? { name: selection.name, value: selection.value }
|
|
30
30
|
: selection.value;
|
|
31
31
|
this.changeValue.emit(this.value);
|
|
32
|
-
this.
|
|
33
|
-
this.changeQuery.emit(selection.value);
|
|
32
|
+
this.changeQuery.emit(this.query);
|
|
34
33
|
this.internals.setFormValue(selection.value.toString());
|
|
35
34
|
}
|
|
36
35
|
if (this.optionElements.length && !this.optionElementsExist) {
|
|
@@ -113,7 +112,7 @@ const CAutocomplete$1 = proxyCustomElement(class CAutocomplete extends HTMLEleme
|
|
|
113
112
|
this.changeQuery.emit('');
|
|
114
113
|
this._dropdownElement.updateList();
|
|
115
114
|
}
|
|
116
|
-
|
|
115
|
+
_handleKeyDown(event) {
|
|
117
116
|
const alphanumeric = /^[0-9a-zA-Z ]+$/;
|
|
118
117
|
if (event.key.match(alphanumeric) && event.key.length === 1) {
|
|
119
118
|
if (!this.dropdownVisible) {
|
|
@@ -210,9 +209,9 @@ const CAutocomplete$1 = proxyCustomElement(class CAutocomplete extends HTMLEleme
|
|
|
210
209
|
handleQueryChange() {
|
|
211
210
|
this._updateStatusText();
|
|
212
211
|
}
|
|
213
|
-
_updateInput(
|
|
212
|
+
_updateInput() {
|
|
214
213
|
this._dropdownElement.open();
|
|
215
|
-
this.query =
|
|
214
|
+
this.query = this._inputElement.value;
|
|
216
215
|
this.changeQuery.emit(this.query);
|
|
217
216
|
this._dropdownElement.updateList();
|
|
218
217
|
}
|
|
@@ -231,7 +230,7 @@ const CAutocomplete$1 = proxyCustomElement(class CAutocomplete extends HTMLEleme
|
|
|
231
230
|
}
|
|
232
231
|
_renderInputElement() {
|
|
233
232
|
var _a;
|
|
234
|
-
return (h("div", { class: "c-input-menu__input" }, h("input", { type: "text", ref: (el) => (this._inputElement = el), "aria-expanded": this.dropdownVisible.toString(), "aria-owns": this._inputId + '-items', "aria-autocomplete": "list", autocomplete: "off", class: "c-input__input", role: "combobox", value: this.query, name: (_a = this.name) !== null && _a !== void 0 ? _a : null, onInput: (
|
|
233
|
+
return (h("div", { class: "c-input-menu__input" }, h("input", { type: "text", ref: (el) => (this._inputElement = el), "aria-expanded": this.dropdownVisible.toString(), "aria-owns": this._inputId + '-items', "aria-autocomplete": "list", autocomplete: "off", class: "c-input__input", role: "combobox", value: this.query, name: (_a = this.name) !== null && _a !== void 0 ? _a : null, onInput: () => this._updateInput(), onFocus: () => this._onInputFocus() })));
|
|
235
234
|
}
|
|
236
235
|
componentWillLoad() {
|
|
237
236
|
CAutocomplete._uniqueId += 1;
|
|
@@ -265,7 +264,7 @@ const CAutocomplete$1 = proxyCustomElement(class CAutocomplete extends HTMLEleme
|
|
|
265
264
|
}
|
|
266
265
|
render() {
|
|
267
266
|
const itemType = this.optionElementsExist ? 'option' : 'item';
|
|
268
|
-
return (h(Host, null, h("c-dropdown", { ref: (el) => (this._dropdownElement = el), id: `${this._id}-dropdown`, index: this.currentIndex, "items-per-page": this.itemsPerPage, "item-type": itemType, items: this._items, parent: this.el, type: "autocomplete" }, h("c-input", { slot: "default", ref: (el) => (this._cInputElement = el), active: this.dropdownVisible, disabled: this.disabled, "hide-details": this.hideDetails, hint: this.hint, id: this.hostId, "input-id": this._inputId, label: this.label, name: this.name, placeholder: this.placeholder, required: this.required, shadow: this.shadow, valid: this.valid, validate: this.validate, "validate-on-blur": this.validateOnBlur, validation: this.validation, value: this.query, variant: "select" }, h("slot", { name: "pre", slot: "pre" }), h("div", { class: "c-input__content" }, this._renderInputElement(), this.loading && this._renderLoader(), !this.loading && this.value && this._renderReset(), !this.loading && !this.value && this._renderChevron(), h("slot", { onSlotchange: () => this._handleSlotChange() })), h("slot", { name: "post", slot: "post" })))));
|
|
267
|
+
return (h(Host, null, h("c-dropdown", { ref: (el) => (this._dropdownElement = el), id: `${this._id}-dropdown`, index: this.currentIndex, "items-per-page": this.itemsPerPage, "item-type": itemType, items: this._items, parent: this.el, type: "autocomplete", onKeyDown: (event) => this._handleKeyDown(event) }, h("c-input", { slot: "default", ref: (el) => (this._cInputElement = el), active: this.dropdownVisible, disabled: this.disabled, "hide-details": this.hideDetails, hint: this.hint, id: this.hostId, "input-id": this._inputId, label: this.label, name: this.name, placeholder: this.placeholder, required: this.required, shadow: this.shadow, valid: this.valid, validate: this.validate, "validate-on-blur": this.validateOnBlur, validation: this.validation, value: this.query, variant: "select" }, h("slot", { name: "pre", slot: "pre" }), h("div", { class: "c-input__content" }, this._renderInputElement(), this.loading && this._renderLoader(), !this.loading && this.value && this._renderReset(), !this.loading && !this.value && this._renderChevron(), h("slot", { onSlotchange: () => this._handleSlotChange() })), h("slot", { name: "post", slot: "post" })))));
|
|
269
268
|
}
|
|
270
269
|
static get formAssociated() { return true; }
|
|
271
270
|
get el() { return this; }
|
|
@@ -299,7 +298,7 @@ const CAutocomplete$1 = proxyCustomElement(class CAutocomplete extends HTMLEleme
|
|
|
299
298
|
"statusText": [32],
|
|
300
299
|
"optionElementsExist": [32],
|
|
301
300
|
"reset": [64]
|
|
302
|
-
}, [[
|
|
301
|
+
}, [[0, "dropdownStateChange", "onDropdownStateChange"], [0, "selectOption", "onSelectOption"]], {
|
|
303
302
|
"query": ["handleQueryChange"]
|
|
304
303
|
}]);
|
|
305
304
|
CAutocomplete$1._uniqueId = 0;
|