@ukic/web-components 3.27.0 → 3.28.0
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/components/close-icon.js +1 -2
- package/components/close-icon.js.map +1 -1
- package/components/ic-data-list.js +1 -1
- package/components/ic-data-list.js.map +1 -1
- package/components/ic-data-row.js +1 -1
- package/components/ic-data-row.js.map +1 -1
- package/components/ic-pagination-bar.js.map +1 -1
- package/components/ic-pagination-item2.js +1 -1
- package/components/ic-pagination-item2.js.map +1 -1
- package/components/ic-pagination2.js +12 -8
- package/components/ic-pagination2.js.map +1 -1
- package/components/ic-popover-menu.js +34 -12
- package/components/ic-popover-menu.js.map +1 -1
- package/components/ic-search-bar.js +2 -6
- package/components/ic-search-bar.js.map +1 -1
- package/components/ic-section-container2.js +2 -2
- package/components/ic-skeleton.js +2 -2
- package/components/ic-skip-link.js +2 -2
- package/components/ic-status-tag.js +2 -2
- package/components/ic-step.js +13 -13
- package/components/ic-stepper.js +2 -2
- package/components/ic-switch.js +4 -4
- package/components/ic-tab-context.js +1 -1
- package/components/ic-tab-group.js +2 -2
- package/components/ic-tab-panel.js +2 -2
- package/components/ic-theme.js +1 -1
- package/components/ic-toast-region.js +1 -1
- package/components/ic-toast.js +5 -5
- package/components/ic-toggle-button-group.js +2 -2
- package/components/ic-toggle-button.js +2 -2
- package/dist/cjs/{close-icon-7f6ef8e4.js → close-icon-30d8bb41.js} +2 -3
- package/dist/cjs/close-icon-30d8bb41.js.map +1 -0
- package/dist/cjs/ic-alert.cjs.entry.js +1 -1
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-list.cjs.entry.js +1 -1
- package/dist/cjs/ic-data-list.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-row.cjs.entry.js +1 -1
- package/dist/cjs/ic-data-row.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ic-pagination-item.cjs.entry.js +1 -1
- package/dist/cjs/ic-pagination-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-pagination_3.cjs.entry.js +12 -8
- package/dist/cjs/ic-pagination_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-popover-menu.cjs.entry.js +33 -11
- package/dist/cjs/ic-popover-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-search-bar.cjs.entry.js +2 -6
- package/dist/cjs/ic-search-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-section-container.cjs.entry.js +2 -2
- package/dist/cjs/ic-section-container.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-side-navigation.cjs.entry.js +1 -1
- package/dist/cjs/ic-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/ic-skip-link.cjs.entry.js +2 -2
- package/dist/cjs/ic-status-tag.cjs.entry.js +2 -2
- package/dist/cjs/ic-step.cjs.entry.js +13 -13
- package/dist/cjs/ic-stepper.cjs.entry.js +2 -2
- package/dist/cjs/ic-switch.cjs.entry.js +4 -4
- package/dist/cjs/ic-tab-context.cjs.entry.js +1 -1
- package/dist/cjs/ic-tab-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/ic-theme.cjs.entry.js +1 -1
- package/dist/cjs/ic-toast-region.cjs.entry.js +1 -1
- package/dist/cjs/ic-toast.cjs.entry.js +6 -6
- package/dist/cjs/ic-toggle-button-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-toggle-button.cjs.entry.js +2 -2
- package/dist/collection/assets/close-icon.svg +1 -2
- package/dist/collection/components/ic-data-list/ic-data-list.css +4 -0
- package/dist/collection/components/ic-data-row/ic-data-row.css +1 -1
- package/dist/collection/components/ic-pagination/ic-pagination.js +12 -8
- package/dist/collection/components/ic-pagination/ic-pagination.js.map +1 -1
- package/dist/collection/components/ic-pagination-item/ic-pagination-item.css +2 -1
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.css +4 -4
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.js +36 -11
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.js.map +1 -1
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.stories.js +72 -0
- package/dist/collection/components/ic-search-bar/ic-search-bar.js +1 -1
- package/dist/collection/components/ic-search-bar/ic-search-bar.js.map +1 -1
- package/dist/collection/components/ic-section-container/ic-section-container.js +2 -2
- package/dist/collection/components/ic-skeleton/ic-skeleton.js +2 -2
- package/dist/collection/components/ic-skip-link/ic-skip-link.js +2 -2
- package/dist/collection/components/ic-status-tag/ic-status-tag.js +2 -2
- package/dist/collection/components/ic-step/ic-step.js +13 -13
- package/dist/collection/components/ic-stepper/ic-stepper.js +2 -2
- package/dist/collection/components/ic-switch/ic-switch.js +4 -4
- package/dist/collection/components/ic-tab-context/ic-tab-context.js +1 -1
- package/dist/collection/components/ic-tab-group/ic-tab-group.js +2 -2
- package/dist/collection/components/ic-tab-panel/ic-tab-panel.js +2 -2
- package/dist/collection/components/ic-theme/ic-theme.js +1 -1
- package/dist/collection/components/ic-toast/ic-toast.js +5 -5
- package/dist/collection/components/ic-toast-region/ic-toast-region.js +1 -1
- package/dist/collection/components/ic-toggle-button/ic-toggle-button.js +2 -2
- package/dist/collection/components/ic-toggle-button-group/ic-toggle-button-group.js +2 -2
- package/dist/components/close-icon.js +1 -2
- package/dist/components/close-icon.js.map +1 -1
- package/dist/components/ic-data-list.js +1 -1
- package/dist/components/ic-data-list.js.map +1 -1
- package/dist/components/ic-data-row.js +1 -1
- package/dist/components/ic-data-row.js.map +1 -1
- package/dist/components/ic-pagination-item2.js +1 -1
- package/dist/components/ic-pagination-item2.js.map +1 -1
- package/dist/components/ic-pagination2.js +12 -8
- package/dist/components/ic-pagination2.js.map +1 -1
- package/dist/components/ic-popover-menu.js +34 -12
- package/dist/components/ic-popover-menu.js.map +1 -1
- package/dist/components/ic-radio-group.js.map +1 -1
- package/dist/components/ic-search-bar.js +2 -6
- package/dist/components/ic-search-bar.js.map +1 -1
- package/dist/components/ic-section-container2.js +2 -2
- package/dist/components/ic-side-navigation.js.map +1 -1
- package/dist/components/ic-skeleton.js +2 -2
- package/dist/components/ic-skeleton.js.map +1 -1
- package/dist/components/ic-skip-link.js +2 -2
- package/dist/components/ic-status-tag.js +2 -2
- package/dist/components/ic-step.js +13 -13
- package/dist/components/ic-stepper.js +2 -2
- package/dist/components/ic-switch.js +4 -4
- package/dist/components/ic-tab-context.js +1 -1
- package/dist/components/ic-tab-group.js +2 -2
- package/dist/components/ic-tab-panel.js +2 -2
- package/dist/components/ic-theme.js +1 -1
- package/dist/components/ic-toast-region.js +1 -1
- package/dist/components/ic-toast.js +5 -5
- package/dist/components/ic-toggle-button-group.js +2 -2
- package/dist/components/ic-toggle-button.js +2 -2
- package/dist/core/core.esm.js +1 -1
- package/dist/core/{p-23fb87be.entry.js → p-0558baed.entry.js} +2 -2
- package/dist/core/{p-a0c54a50.entry.js → p-0740be66.entry.js} +2 -2
- package/dist/core/{p-d0dd9f2c.entry.js → p-0cd21e04.entry.js} +2 -2
- package/dist/core/p-0cd21e04.entry.js.map +1 -0
- package/dist/core/{p-bb52e752.entry.js → p-1043f3dd.entry.js} +2 -2
- package/dist/core/{p-74a3a450.entry.js → p-1843357b.entry.js} +2 -2
- package/dist/core/{p-b58fb588.entry.js → p-2251df98.entry.js} +2 -2
- package/dist/core/{p-cf87b6db.entry.js → p-2bb815ef.entry.js} +2 -2
- package/dist/core/p-308be45e.entry.js +2 -0
- package/dist/core/p-308be45e.entry.js.map +1 -0
- package/dist/core/p-4b61e92e.entry.js +2 -0
- package/dist/core/{p-99b20121.entry.js.map → p-4b61e92e.entry.js.map} +1 -1
- package/dist/core/p-56ab6fb7.entry.js +2 -0
- package/dist/core/p-56ab6fb7.entry.js.map +1 -0
- package/dist/core/{p-fd9ea62a.entry.js → p-75f91c8c.entry.js} +2 -2
- package/dist/core/p-77f011e7.entry.js +2 -0
- package/dist/core/p-77f011e7.entry.js.map +1 -0
- package/dist/core/{p-70ca7796.entry.js → p-85db7e71.entry.js} +2 -2
- package/dist/core/{p-ab104baa.entry.js → p-987b08f9.entry.js} +2 -2
- package/dist/core/p-98dee727.entry.js.map +1 -1
- package/dist/core/{p-85ac0d78.entry.js → p-9b144bed.entry.js} +2 -2
- package/dist/core/{p-d1220d2a.entry.js → p-a8d98164.entry.js} +2 -2
- package/dist/core/p-a8d98164.entry.js.map +1 -0
- package/dist/core/{p-a7c263bd.entry.js → p-ba8799ea.entry.js} +2 -2
- package/dist/core/p-ba8799ea.entry.js.map +1 -0
- package/dist/core/{p-85232cec.entry.js → p-bf06d022.entry.js} +2 -2
- package/dist/core/{p-c41fd2cf.entry.js → p-c0f6f568.entry.js} +2 -2
- package/dist/core/p-c391e323.js +2 -0
- package/dist/core/{p-271ee0bc.entry.js → p-c75c316b.entry.js} +2 -2
- package/dist/core/{p-970e190c.entry.js → p-e0b52a71.entry.js} +2 -2
- package/dist/core/{p-3da9774b.entry.js → p-ef91cf17.entry.js} +2 -2
- package/dist/core/{p-d7c6fc8d.entry.js → p-f8e5d8f8.entry.js} +2 -2
- package/dist/core/{p-6b5edd6b.entry.js → p-f9daecc7.entry.js} +2 -2
- package/dist/esm/{close-icon-539ec8d1.js → close-icon-0db44bf2.js} +2 -3
- package/dist/esm/close-icon-0db44bf2.js.map +1 -0
- package/dist/esm/ic-alert.entry.js +1 -1
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-data-list.entry.js +1 -1
- package/dist/esm/ic-data-list.entry.js.map +1 -1
- package/dist/esm/ic-data-row.entry.js +1 -1
- package/dist/esm/ic-data-row.entry.js.map +1 -1
- package/dist/esm/ic-dialog.entry.js +1 -1
- package/dist/esm/ic-pagination-item.entry.js +1 -1
- package/dist/esm/ic-pagination-item.entry.js.map +1 -1
- package/dist/esm/ic-pagination_3.entry.js +12 -8
- package/dist/esm/ic-pagination_3.entry.js.map +1 -1
- package/dist/esm/ic-popover-menu.entry.js +34 -12
- package/dist/esm/ic-popover-menu.entry.js.map +1 -1
- package/dist/esm/ic-search-bar.entry.js +2 -6
- package/dist/esm/ic-search-bar.entry.js.map +1 -1
- package/dist/esm/ic-section-container.entry.js +2 -2
- package/dist/esm/ic-section-container.entry.js.map +1 -1
- package/dist/esm/ic-side-navigation.entry.js +1 -1
- package/dist/esm/ic-skeleton.entry.js +2 -2
- package/dist/esm/ic-skip-link.entry.js +2 -2
- package/dist/esm/ic-status-tag.entry.js +2 -2
- package/dist/esm/ic-step.entry.js +13 -13
- package/dist/esm/ic-stepper.entry.js +2 -2
- package/dist/esm/ic-switch.entry.js +4 -4
- package/dist/esm/ic-tab-context.entry.js +1 -1
- package/dist/esm/ic-tab-group.entry.js +2 -2
- package/dist/esm/ic-tab-panel.entry.js +2 -2
- package/dist/esm/ic-theme.entry.js +1 -1
- package/dist/esm/ic-toast-region.entry.js +1 -1
- package/dist/esm/ic-toast.entry.js +6 -6
- package/dist/esm/ic-toggle-button-group.entry.js +2 -2
- package/dist/esm/ic-toggle-button.entry.js +2 -2
- package/dist/types/components/ic-popover-menu/ic-popover-menu.d.ts +4 -0
- package/hydrate/index.js +96 -73
- package/hydrate/index.mjs +96 -73
- package/package.json +8 -9
- package/dist/cjs/close-icon-7f6ef8e4.js.map +0 -1
- package/dist/collection/assets/clear-icon.svg +0 -3
- package/dist/core/p-023cf5d9.entry.js +0 -2
- package/dist/core/p-023cf5d9.entry.js.map +0 -1
- package/dist/core/p-2424f82f.entry.js +0 -2
- package/dist/core/p-2424f82f.entry.js.map +0 -1
- package/dist/core/p-99b20121.entry.js +0 -2
- package/dist/core/p-a7c263bd.entry.js.map +0 -1
- package/dist/core/p-d0dd9f2c.entry.js.map +0 -1
- package/dist/core/p-d1220d2a.entry.js.map +0 -1
- package/dist/core/p-e0b66371.entry.js +0 -2
- package/dist/core/p-e0b66371.entry.js.map +0 -1
- package/dist/core/p-f074ef5b.js +0 -2
- package/dist/esm/close-icon-539ec8d1.js.map +0 -1
- /package/dist/core/{p-23fb87be.entry.js.map → p-0558baed.entry.js.map} +0 -0
- /package/dist/core/{p-a0c54a50.entry.js.map → p-0740be66.entry.js.map} +0 -0
- /package/dist/core/{p-bb52e752.entry.js.map → p-1043f3dd.entry.js.map} +0 -0
- /package/dist/core/{p-74a3a450.entry.js.map → p-1843357b.entry.js.map} +0 -0
- /package/dist/core/{p-b58fb588.entry.js.map → p-2251df98.entry.js.map} +0 -0
- /package/dist/core/{p-cf87b6db.entry.js.map → p-2bb815ef.entry.js.map} +0 -0
- /package/dist/core/{p-fd9ea62a.entry.js.map → p-75f91c8c.entry.js.map} +0 -0
- /package/dist/core/{p-70ca7796.entry.js.map → p-85db7e71.entry.js.map} +0 -0
- /package/dist/core/{p-ab104baa.entry.js.map → p-987b08f9.entry.js.map} +0 -0
- /package/dist/core/{p-85ac0d78.entry.js.map → p-9b144bed.entry.js.map} +0 -0
- /package/dist/core/{p-85232cec.entry.js.map → p-bf06d022.entry.js.map} +0 -0
- /package/dist/core/{p-c41fd2cf.entry.js.map → p-c0f6f568.entry.js.map} +0 -0
- /package/dist/core/{p-f074ef5b.js.map → p-c391e323.js.map} +0 -0
- /package/dist/core/{p-271ee0bc.entry.js.map → p-c75c316b.entry.js.map} +0 -0
- /package/dist/core/{p-970e190c.entry.js.map → p-e0b52a71.entry.js.map} +0 -0
- /package/dist/core/{p-3da9774b.entry.js.map → p-ef91cf17.entry.js.map} +0 -0
- /package/dist/core/{p-d7c6fc8d.entry.js.map → p-f8e5d8f8.entry.js.map} +0 -0
- /package/dist/core/{p-6b5edd6b.entry.js.map → p-f9daecc7.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["icSearchBarCss","IcSearchBarStyle0","inputIds","SearchBar","constructor","hostRef","this","hasTimedOut","inputId","menuCloseFromMenuChangeEvent","menuId","preLoad","preventSubmit","prevNoOption","retryButtonClick","retryViaKeyPress","truncateValue","clearButtonFocused","open","searchSubmitFocused","showClearButton","autocapitalize","autocomplete","autocorrect","autofocus","charactersUntilSuggestion","disabled","disableAutoFiltering","debounce","emptyOptionListText","focusOnLoad","fullWidth","helperText","hideLabel","assistiveHintText","labelField","loading","loadingErrorLabel","loadingLabel","name","placeholder","preventFormSubmitOnSearch","readonly","required","searchMode","size","spellcheck","theme","valueField","filteredOptions","options","value","handleClear","ev","keyboardEvent","mouseEvent","type","code","_a","inputEl","setAttribute","clearTimeout","timeoutTimer","showMenuWithNoInput","setMenuChange","el","setFocus","icClear","emit","preventDefault","onInput","target","icInput","length","rawFilteredOptions","getFilteredMenuOptions","debounceAriaLiveUpdate","onInputBlur","relatedTarget","icSearchBarBlur","onInputFocus","icSearchBarFocus","handleClearBlur","icClearBlur","handleSubmitSearchBlur","icSubmitSearchBlur","setInputValue","newValue","label","getLabelFromValue","handleMouseDown","handleSubmitSearchFocus","handleSubmitSearch","highlightedValue","undefined","icSubmitSearch","form","closest","searchSubmitButton","handleHiddenFormButtonClick","handleSubmitSearchKeyDown","key","handleRetry","detail","keyPressed","icRetryLoad","triggerLoading","loadingOption","timeout","window","setTimeout","timedOut","handleOptionSelect","icOptionSelect","handleMenuOptionHighlight","optionId","replace","ariaActiveDescendant","handleMenuChange","icMenuChange","handleHostFocus","handleHostBlur","menu","focus","updateSearchResultAriaLive","handleFocusClearButton","renderAssistiveHintEl","input","shadowRoot","querySelector","Object","keys","hasOptionsOrFilterDisabled","assistiveHintEl","document","createElement","innerText","id","style","display","_b","after","call","searchResultsStatusEl","hadNoOptions","isSubmitDisabled","updateSearchButtonType","searchButtonType","watchCharactersUntilSuggestionHandler","watchDisabledHandler","removeDisabledFalse","debounceChanged","icChange","debounceEvent","loadingHandler","preventFormSubmitOnSearchHandler","filteredOptionsHandler","newOptions","some","opt","watchOptionsHandler","watchValueHandler","connectedCallback","disconnectedCallback","remove","componentWillLoad","componentDidLoad","onComponentRequiredPropUndefined","prop","propName","componentWillRender","handleSetFirstOption","find","filteredOption","handleKeyDown","event","icKeydown","handleKeyboardOpen","handleKeyUp","debounceAriaLive","render","disabledMode","describedBy","getInputDescribedByText","trim","describedById","hasSuggestedSearch","menuOpen","menuRendered","labelValue","renderHiddenInput","h","Host","class","onFocus","onBlur","for","slot","ref","anchorEl","role","autoFocus","inputmode","innerHTML","clearIcon","onClick","onMouseDown","onKeyDown","variant","searchIcon","fullwidth","activationType","autofocusOnSelected","inputLabel","onMenuOptionSelect","onMenuStateChange","onMenuOptionId","onRetryButtonClicked","parentEl","searchBar"],"sources":["src/components/ic-search-bar/ic-search-bar.css?tag=ic-search-bar&encapsulation=shadow","src/components/ic-search-bar/ic-search-bar.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n/**\n * @prop --ic-z-index-menu: z-index of search bar menu\n */\n\n:host(.ic-search-bar-search) {\n display: block;\n\n --divider-height: 1.5rem;\n --ic-input-label-helpertext-padding: var(--ic-space-xs);\n --border-color: var(--ic-search-bar-outline);\n --input-bg-color: var(--ic-search-bar-background);\n --border-color-disabled: var(--ic-search-bar-outline-disabled);\n --menu-item-text-color: var(--ic-search-bar-dropdown-option-text);\n --menu-item-desc-text-color: var(--ic-search-bar-dropdown-option-description);\n --menu-bg-color: var(--ic-search-bar-dropdown-background);\n --menu-border-color: var(--ic-search-bar-dropdown-outline);\n}\n\n:host(.ic-search-bar-disabled) {\n --ic-input-label-text-color: var(--ic-search-bar-label-disabled);\n --ic-input-label-helper-text-color: var(--ic-search-bar-subtitle-disabled);\n}\n\n:host(.ic-search-bar-search:hover) {\n --border-color: var(--ic-search-bar-outline-hover);\n}\n\n:host(.ic-search-bar-search:active) {\n --border-color: var(--ic-search-bar-outline-pressed);\n}\n\n:host(.ic-search-bar-search.ic-search-bar-small) {\n --divider-height: 1rem;\n}\n\n:host(.ic-search-bar-full-width) {\n width: 100%;\n}\n\n/* Custom Input */\n\n::placeholder {\n color: var(--ic-search-bar-placeholder-text);\n opacity: 1;\n}\n\ninput {\n border: 0;\n border-radius: var(--ic-border-radius);\n color: var(--ic-search-bar-filled-text);\n background-color: var(--input-bg-color);\n line-height: 1.5rem;\n letter-spacing: 0.005rem;\n width: 100%;\n padding-right: var(--ic-space-xs);\n padding-left: var(--ic-space-xs);\n caret-color: var(--ic-search-bar-filled-text-cursor);\n}\n\ninput:focus {\n border: 0;\n outline: 0;\n}\n\ninput:disabled,\ninput:disabled::placeholder {\n color: var(--ic-search-bar-disabled-text);\n}\n\n/* Chrome, Safari, Edge */\ninput::-webkit-outer-spin-button,\ninput::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n.no-left-pad {\n padding-left: 0;\n}\n\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-decoration,\ninput[type=\"search\"]::-webkit-search-results-button,\ninput[type=\"search\"]::-webkit-search-results-decoration {\n display: none;\n}\n\ninput[type=\"search\"].truncate-value {\n width: 100%;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n/* CLEAR */\n\n.clear-button-container {\n align-items: center;\n margin-right: var(--ic-space-1px);\n display: none;\n visibility: hidden;\n}\n\n.clear-button {\n border-radius: var(--ic-border-radius);\n transition: box-shadow var(--ic-easing-transition),\n border-radius var(--ic-easing-transition);\n}\n\n.clear-button:focus,\n.clear-button:active {\n background-color: var(--ic-color-focus-inner);\n box-shadow: inset 0 0 0 0.125rem var(--ic-color-focus-outer);\n border-radius: 0.25rem;\n}\n\n.clear-button-unfocused * {\n fill: var(--ic-search-bar-clear-button);\n}\n\n.clear-button:focus,\n.clear-button:active * {\n fill: var(--ic-atoms-input-clear-button-focus);\n}\n\n.clear-button-visible {\n visibility: visible;\n display: flex;\n}\n\n.search-submit-button-container {\n display: flex;\n align-items: center;\n}\n\n.search-submit-button-unfocused * {\n fill: var(--ic-search-bar-filled-icon);\n}\n\n.search-submit-button-disabled * {\n fill: var(--ic-search-bar-icon-disabled);\n}\n\n.search-submit-button-disabled .ic-tooltip-container {\n display: none !important;\n}\n\n.search-submit-button:focus,\n.search-submit-button:active {\n background-color: var(--ic-color-focus-inner) !important;\n box-shadow: inset 0 0 0 0.125rem var(--ic-color-focus-outer) !important;\n border-radius: var(--ic-space-xxs);\n}\n\n.search-submit-button:focus,\n.search-submit-button:active * {\n fill: white;\n}\n\n.divider {\n width: var(--ic-border-width);\n background-color: var(--ic-search-bar-dropdown-divider);\n height: var(--divider-height);\n}\n\n.menu-container {\n width: var(--input-width, 20rem);\n position: relative;\n top: var(--ic-space-xxxs);\n}\n\n.menu-container.fullwidth {\n width: 100%;\n}\n\n.no-results {\n cursor: not-allowed;\n}\n\n.search-results-status {\n border: 0;\n clip: rect(0, 0, 0, 0, 0);\n height: var(--ic-space-1px);\n margin-bottom: calc(-1 * var(--ic-space-1px));\n margin-right: calc(-1 * var(--ic-space-1px));\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: var(--ic-space-1px);\n}\n\n@media (forced-colors: active) {\n .search-submit-button-unfocused * {\n fill: canvastext;\n }\n\n .search-submit-button-disabled * {\n fill: GrayText;\n }\n}\n\n/* Breakpoint value chosen as it's a small amount bigger than the search bar's default width */\n@media screen AND (max-width: 22rem) {\n .menu-container {\n max-width: var(--menu-width, var(--input-width, 20rem));\n width: 100%;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .clear-button {\n transition: none;\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n Method,\n h,\n} from \"@stencil/core\";\n\nimport {\n IcAutocompleteTypes,\n IcAutocorrectStates,\n IcMenuOption,\n IcMultiValueEventDetail,\n IcSizesNoLarge,\n IcThemeMode,\n} from \"../../utils/types\";\nimport {\n getInputDescribedByText,\n renderHiddenInput,\n handleHiddenFormButtonClick,\n getLabelFromValue,\n onComponentRequiredPropUndefined,\n getFilteredMenuOptions,\n removeDisabledFalse,\n debounceEvent,\n} from \"../../utils/helpers\";\nimport {\n IcSearchBarBlurEventDetail,\n IcSearchBarSearchModes,\n} from \"./ic-search-bar.types\";\nimport { IcValueEventDetail, IcBlurEventDetail } from \"../../utils/types\";\nimport {\n IcMenuChangeEventDetail,\n IcMenuOptionIdEventDetail,\n IcOptionSelectEventDetail,\n} from \"../ic-menu/ic-menu.types\";\n\nimport clearIcon from \"../../assets/clear-icon.svg\";\nimport searchIcon from \"../../assets/search-icon.svg\";\nimport { IcButtonTypes } from \"../ic-button/ic-button.types\";\n\nlet inputIds = 0;\n\n/**\n * @slot helper-text - Content is set as the helper text for the search bar.\n */\n@Component({\n tag: \"ic-search-bar\",\n styleUrl: \"ic-search-bar.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class SearchBar {\n private anchorEl?: HTMLElement;\n private assistiveHintEl?: HTMLSpanElement;\n private debounceAriaLive?: number;\n private hasTimedOut = false;\n private inputEl?: HTMLInputElement;\n private inputId = `ic-search-bar-input-${inputIds++}`;\n private menu?: HTMLIcMenuElement;\n private menuCloseFromMenuChangeEvent = false;\n private menuId = `${this.inputId}-menu`;\n private preLoad = true;\n private preventSubmit = false;\n private prevNoOption = false;\n private retryButtonClick = false;\n private retryViaKeyPress = false;\n private timeoutTimer?: number;\n private truncateValue = false;\n private searchSubmitButton?: HTMLIcButtonElement;\n\n @Element() el: HTMLIcSearchBarElement;\n\n @State() ariaActiveDescendant?: string;\n @State() clearButtonFocused = false;\n @State() highlightedValue?: string;\n @State() open = false;\n @State() searchSubmitFocused = false;\n @State() showClearButton = false;\n\n /**\n * The automatic capitalisation of the text value as it is entered/edited by the user.\n * Available options: \"off\", \"none\", \"on\", \"sentences\", \"words\", \"characters\".\n */\n @Prop() autocapitalize = \"off\";\n\n /**\n * The state of autocompletion the browser can apply on the text value.\n */\n @Prop() autocomplete: IcAutocompleteTypes = \"off\";\n\n /**\n * The state of autocorrection the browser can apply when the user is entering/editing the text value.\n */\n @Prop() autocorrect: IcAutocorrectStates = \"off\";\n\n /**\n * If `true`, the form control will have input focus when the page loads.\n */\n @Prop() autofocus = false;\n\n /**\n * The number of characters until suggestions appear. The submit button will be disabled until the inputted value is equal to or greater than this number.\n */\n @Prop() charactersUntilSuggestion = 2;\n @Watch(\"charactersUntilSuggestion\")\n watchCharactersUntilSuggestionHandler(): void {\n if (this.showMenuWithNoInput()) {\n this.filteredOptions = this.options;\n }\n }\n\n /**\n * If `true`, the disabled state will be set.\n */\n @Prop() disabled = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el as HTMLElement);\n }\n\n /**\n * Specify whether to disable the built in filtering. For example, if options will already be filtered from external source.\n * If `true`, all options provided will be displayed.\n */\n @Prop() disableAutoFiltering = false;\n\n /**\n * The amount of time, in milliseconds, to wait to trigger the `icChange` event after each keystroke.\n */\n @Prop() debounce = 0;\n @Watch(\"debounce\")\n private debounceChanged() {\n this.icChange = debounceEvent(this.icChange, this.debounce);\n }\n\n /**\n * The text displayed when there are no options in the option list.\n */\n @Prop() emptyOptionListText = \"No results found\";\n\n /**\n * If `true`, the search bar will be focused when component loaded.\n */\n @Prop() focusOnLoad = false;\n\n /**\n * Specify whether the search bar fills the full width of the container.\n * If `true`, this overrides the --input-width CSS variable.\n */\n @Prop() fullWidth = false;\n\n /**\n * The helper text that will be displayed for additional field guidance.\n */\n @Prop() helperText = \"\";\n\n /**\n * If `true`, the label will be hidden and the required label value will be applied as an aria-label.\n */\n @Prop() hideLabel = false;\n\n /**\n * The hint text for the hidden assistive description element.\n */\n @Prop() assistiveHintText =\n \"When autocomplete results are available use the up and down arrows to choose and press enter to select\";\n\n /**\n * The label for the search bar.\n */\n @Prop() label!: string;\n\n /**\n * The custom name for the label field to correspond with the IcMenuOption type.\n */\n @Prop() labelField = \"label\";\n\n /**\n * Trigger loading state when fetching options asynchronously\n */\n @Prop({ mutable: true }) loading = false;\n @Watch(\"loading\")\n loadingHandler(newValue: boolean): void {\n if (newValue && !this.hasTimedOut) {\n this.preLoad = false;\n this.triggerLoading();\n }\n }\n\n /**\n * Change the message displayed when external loading times out.\n */\n @Prop() loadingErrorLabel = \"Loading Error\";\n\n /**\n * Change the message displayed whilst the options are being loaded externally.\n */\n @Prop() loadingLabel = \"Loading...\";\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name = this.inputId;\n\n /**\n * The placeholder value to display.\n */\n @Prop() placeholder = \"Search\";\n\n /**\n * If `true` the parent form will not submit when the icSubmitSearch event fires.\n */\n @Prop() preventFormSubmitOnSearch = false;\n @State() searchButtonType: IcButtonTypes;\n @Watch(\"preventFormSubmitOnSearch\")\n preventFormSubmitOnSearchHandler(): void {\n this.updateSearchButtonType();\n }\n\n /**\n * If `true`, the readonly state will be set.\n */\n @Prop() readonly = false;\n\n /**\n * If `true`, the search bar will require a value.\n */\n @Prop() required = false;\n\n /**\n * Specify the mode search bar uses to search. `navigation` allows for quick lookups of a set of values, `query` allows for more general searches.\n */\n @Prop() searchMode: IcSearchBarSearchModes = \"navigation\";\n\n /**\n * The size of the search bar component.\n */\n @Prop() size: IcSizesNoLarge = \"medium\";\n\n /**\n * If `true`, the value of the search will have its spelling and grammar checked.\n */\n @Prop() spellcheck = false;\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop() theme: IcThemeMode = \"inherit\";\n\n /**\n * If using external filtering, set a timeout for when loading takes too long.\n */\n @Prop() timeout?: number;\n\n /**\n * The custom name for the value field to correspond with the IcMenuOption type.\n */\n @Prop() valueField = \"value\";\n\n @State() filteredOptions: IcMenuOption[] = [];\n @Watch(\"filteredOptions\")\n filteredOptionsHandler(newOptions: IcMenuOption[]): void {\n this.hasTimedOut = newOptions.some((opt) => opt.timedOut);\n }\n\n /**\n * The suggested search options.\n */\n @Prop() options: IcMenuOption[] = [];\n @Watch(\"options\")\n watchOptionsHandler(newOptions: IcMenuOption[]): void {\n if (this.disableAutoFiltering) {\n if (!this.hasTimedOut) {\n this.loading = false;\n clearTimeout(this.timeoutTimer);\n if (newOptions.length > 0) {\n this.filteredOptions = newOptions;\n } else {\n if (this.hadNoOptions()) {\n return;\n }\n this.setMenuChange(true);\n if (!this.preLoad) {\n this.filteredOptions = [\n {\n [this.labelField]: this.emptyOptionListText,\n [this.valueField]: \"\",\n },\n ];\n }\n this.preLoad = true;\n }\n }\n } else if (this.showMenuWithNoInput()) {\n this.filteredOptions = newOptions;\n }\n this.debounceAriaLiveUpdate();\n }\n\n /**\n * The value of the search input.\n */\n @Prop({ reflect: true, mutable: true }) value = \"\";\n @Watch(\"value\")\n watchValueHandler(newValue: string): void {\n this.setInputValue(newValue);\n this.icChange.emit({ value: newValue });\n }\n\n // The icChange event is defined here so that it appears as an event for search bar\n /**\n * Emitted when the value has changed.\n */\n @Event() icChange: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when value is cleared with clear button\n */\n @Event() icClear: EventEmitter<void>;\n private handleClear = (ev: Event) => {\n const keyboardEvent = ev as KeyboardEvent;\n const mouseEvent = ev as MouseEvent;\n\n if (\n mouseEvent.type === \"click\" ||\n keyboardEvent.code === \"Enter\" ||\n keyboardEvent.code === \"Space\"\n ) {\n this.value = \"\";\n this.inputEl?.setAttribute(\"value\", \"\");\n this.loading = false;\n clearTimeout(this.timeoutTimer);\n this.filteredOptions = this.options;\n this.showMenuWithNoInput() && this.setMenuChange(true);\n this.el.setFocus();\n\n this.icClear.emit();\n ev.preventDefault();\n\n this.preventSubmit = true;\n }\n };\n\n // The icInput event is defined here so that it appears as an event for search bar\n /**\n * Emitted when a keyboard input occurred.\n */\n @Event() icInput: EventEmitter<IcValueEventDetail>;\n private onInput = ({ target }: Event) => {\n this.value = (target as HTMLInputElement).value;\n this.icInput.emit({ value: this.value });\n\n if (this.options.length > 0) {\n this.setMenuChange(true);\n\n this.preLoad = false;\n\n if (this.disableAutoFiltering === false) {\n const rawFilteredOptions = getFilteredMenuOptions(\n this.options,\n this.value,\n this.labelField\n );\n\n this.filteredOptions =\n rawFilteredOptions.length > 0\n ? rawFilteredOptions\n : [\n {\n [this.labelField]: this.emptyOptionListText,\n [this.valueField]: \"\",\n },\n ];\n }\n }\n\n if (!this.showClearButton) this.showClearButton = true;\n\n this.debounceAriaLiveUpdate();\n };\n\n private onInputBlur = ({ target, relatedTarget }: FocusEvent) => {\n this.icSearchBarBlur.emit({\n value: (target as HTMLInputElement).value,\n relatedTarget,\n });\n };\n\n private onInputFocus = ({ target }: Event) => {\n this.icSearchBarFocus.emit({ value: (target as HTMLInputElement).value });\n\n this.showClearButton = true;\n };\n\n /**\n * Emitted when option is highlighted within the menu\n */\n @Event() icOptionSelect: EventEmitter<IcOptionSelectEventDetail>;\n\n /**\n * Emitted when the state of the menu changes (i.e. open or close)\n */\n @Event() icMenuChange: EventEmitter<IcMenuChangeEventDetail>;\n\n /**\n * @internal - Emitted when blur is invoked from clear button\n */\n @Event() icClearBlur: EventEmitter<IcBlurEventDetail>;\n private handleClearBlur = ({ relatedTarget }: FocusEvent) => {\n this.icClearBlur.emit({ relatedTarget });\n\n this.clearButtonFocused = false;\n };\n\n /**\n * Emitted when the 'retry loading' button is clicked\n */\n @Event() icRetryLoad: EventEmitter<IcMultiValueEventDetail>;\n\n /**\n * Emitted when the search value has been submitted\n */\n @Event() icSubmitSearch: EventEmitter<IcValueEventDetail>;\n\n /**\n * @internal - Emitted when blur is invoked from search submit button\n */\n @Event() icSubmitSearchBlur: EventEmitter<IcBlurEventDetail>;\n private handleSubmitSearchBlur = ({ relatedTarget }: FocusEvent) => {\n this.icSubmitSearchBlur.emit({ relatedTarget });\n\n this.searchSubmitFocused = false;\n };\n\n /**\n * Emitted when blur is invoked from ic-search-bar\n */\n @Event() icSearchBarBlur: EventEmitter<IcSearchBarBlurEventDetail>;\n\n /**\n * Emitted when focus is invoked from ic-search-bar\n */\n @Event() icSearchBarFocus: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when a keydown event occurred.\n */\n @Event() icKeydown: EventEmitter<{ event: KeyboardEvent }>;\n\n connectedCallback(): void {\n this.debounceChanged();\n }\n\n disconnectedCallback(): void {\n this.assistiveHintEl?.remove();\n }\n\n componentWillLoad(): void {\n this.setInputValue(this.value);\n\n removeDisabledFalse(this.disabled, this.el as HTMLElement);\n\n this.updateSearchButtonType();\n }\n\n componentDidLoad(): void {\n if (this.focusOnLoad) {\n this.el.setFocus();\n }\n\n if (this.hasOptionsOrFilterDisabled()) {\n this.renderAssistiveHintEl();\n if (this.disableAutoFiltering || this.showMenuWithNoInput()) {\n this.filteredOptions = this.options;\n }\n }\n\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Search Bar\"\n );\n }\n\n componentWillRender(): void {\n if (this.prevNoOption && this.menu && !this.hasTimedOut) {\n this.menu.handleSetFirstOption();\n this.prevNoOption = false;\n }\n if (\n this.filteredOptions.find(\n (filteredOption) =>\n filteredOption[this.labelField] === this.emptyOptionListText ||\n filteredOption[this.labelField] === this.loadingErrorLabel ||\n filteredOption[this.labelField] === this.loadingLabel\n )\n ) {\n this.prevNoOption = true;\n }\n }\n\n @Listen(\"keydown\", {})\n handleKeyDown(event: KeyboardEvent): void {\n this.icKeydown.emit({ event });\n if (this.menu && this.open) {\n this.menu.handleKeyboardOpen(event);\n }\n }\n\n @Listen(\"keyup\", {})\n handleKeyUp(ev: KeyboardEvent): void {\n if (ev.key === \"Enter\") {\n if (this.preventSubmit || this.isSubmitDisabled()) {\n return;\n }\n\n this.handleSubmitSearch();\n this.setMenuChange(false);\n }\n\n if (ev.key === \"Escape\") {\n this.setMenuChange(false);\n }\n\n if (this.preventSubmit) {\n this.preventSubmit = false;\n }\n }\n\n /**\n * Sets focus on the native `input`.\n */\n @Method()\n async setFocus(): Promise<void> {\n this.retryViaKeyPress = false;\n this.retryButtonClick = false;\n this.inputEl?.focus();\n }\n\n private setInputValue = (newValue: string) => {\n if (this.inputEl) {\n const label = getLabelFromValue(\n newValue,\n this.options,\n this.valueField,\n this.labelField\n );\n if (label) this.inputEl.value = label;\n else if (this.inputEl.value !== newValue) {\n this.inputEl.value = newValue;\n }\n }\n };\n\n private handleMouseDown = (ev: Event) => {\n ev.preventDefault();\n };\n\n private handleSubmitSearchFocus = () => {\n this.searchSubmitFocused = true;\n };\n\n private handleSubmitSearch = () => {\n if (this.highlightedValue) this.value = this.highlightedValue;\n this.highlightedValue = undefined;\n this.icSubmitSearch.emit({ value: this.value });\n\n const form = this.el.closest<HTMLFormElement>(\"FORM\");\n\n if (this.searchSubmitButton && !!form && !this.preventSubmit) {\n handleHiddenFormButtonClick(form, this.searchSubmitButton);\n }\n };\n\n private debounceAriaLiveUpdate() {\n clearTimeout(this.debounceAriaLive);\n\n this.debounceAriaLive = window.setTimeout(() => {\n this.updateSearchResultAriaLive();\n }, 500);\n }\n\n private handleSubmitSearchKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === \" \") {\n ev.preventDefault();\n this.handleSubmitSearch();\n }\n };\n\n private handleRetry = (ev: CustomEvent<IcMultiValueEventDetail>) => {\n this.retryViaKeyPress = ev.detail.keyPressed === \"Enter\";\n this.icRetryLoad.emit({ value: ev.detail.value });\n this.triggerLoading();\n this.retryButtonClick = true;\n };\n\n private triggerLoading = () => {\n const loadingOption: IcMenuOption[] = [\n {\n [this.labelField]: this.loadingLabel,\n [this.valueField]: \"\",\n loading: true,\n },\n ];\n if (this.filteredOptions !== loadingOption)\n this.filteredOptions = loadingOption;\n if (this.timeout) {\n this.timeoutTimer = window.setTimeout(() => {\n this.filteredOptions = [\n {\n [this.labelField]: this.loadingErrorLabel,\n [this.valueField]: \"\",\n timedOut: true,\n },\n ];\n }, this.timeout);\n }\n };\n\n private handleOptionSelect = (ev: CustomEvent) => {\n if (ev.detail.label === this.emptyOptionListText) {\n this.el.setFocus();\n return;\n }\n\n this.value = ev.detail.value;\n this.icOptionSelect.emit({ value: this.value });\n };\n\n private handleMenuOptionHighlight = (\n ev: CustomEvent<IcMenuOptionIdEventDetail>\n ) => {\n const { optionId } = ev.detail;\n if (optionId)\n this.highlightedValue = optionId.replace(`${this.menuId}-`, \"\");\n this.ariaActiveDescendant = optionId || \"\";\n };\n\n private handleMenuChange = (ev: CustomEvent<IcMenuChangeEventDetail>) => {\n this.setMenuChange(ev.detail.open);\n if (!ev.detail.open) {\n this.menuCloseFromMenuChangeEvent = true;\n }\n };\n\n private setMenuChange = (open: boolean) => {\n if (this.open !== open) {\n this.open = open;\n this.icMenuChange.emit({ open });\n }\n };\n\n private handleHostFocus = () => {\n if (\n this.options &&\n (this.value || this.showMenuWithNoInput()) &&\n !this.menuCloseFromMenuChangeEvent\n ) {\n this.setMenuChange(true);\n }\n this.truncateValue = false;\n this.showMenuWithNoInput() && this.debounceAriaLiveUpdate();\n\n this.icSearchBarFocus.emit();\n };\n\n private handleHostBlur = ({ relatedTarget }: FocusEvent) => {\n if (\n this.open &&\n this.options &&\n relatedTarget !== this.menu &&\n !this.retryViaKeyPress &&\n !this.retryButtonClick\n ) {\n this.setMenuChange(false);\n }\n\n if (this.retryButtonClick || this.retryViaKeyPress) {\n this.inputEl?.focus();\n }\n\n this.showClearButton = false;\n this.menuCloseFromMenuChangeEvent = false;\n this.truncateValue = true;\n this.icSearchBarBlur.emit({\n relatedTarget,\n value: this.value,\n });\n this.retryViaKeyPress = false;\n this.retryButtonClick = false;\n this.showMenuWithNoInput() && this.updateSearchResultAriaLive();\n };\n\n private handleFocusClearButton = () => {\n this.clearButtonFocused = true;\n };\n\n private renderAssistiveHintEl = () => {\n const input = this.el.shadowRoot?.querySelector(`#${this.inputId}`);\n\n if (\n input &&\n Object.keys(input).length > 0 &&\n this.hasOptionsOrFilterDisabled()\n ) {\n this.assistiveHintEl = document.createElement(\"span\");\n this.assistiveHintEl.innerText = this.assistiveHintText;\n this.assistiveHintEl.id = `${this.inputId}-assistive-hint`;\n this.assistiveHintEl.style.display = \"none\";\n input.after?.(this.assistiveHintEl);\n }\n };\n\n private updateSearchResultAriaLive = () => {\n const searchResultsStatusEl =\n this.el.shadowRoot?.querySelector<HTMLParagraphElement>(\n \".search-results-status\"\n );\n\n if (searchResultsStatusEl) {\n if (\n !this.open ||\n (this.value === \"\" && !this.showMenuWithNoInput()) ||\n this.value.length < this.charactersUntilSuggestion\n ) {\n searchResultsStatusEl.innerText = \"\";\n } else if (\n this.hasOptionsOrFilterDisabled() &&\n this.filteredOptions.length > 0 &&\n this.open &&\n !this.filteredOptions[0].loading\n ) {\n searchResultsStatusEl.innerText = this.hadNoOptions()\n ? this.emptyOptionListText\n : `${this.filteredOptions.length} result${\n this.filteredOptions.length > 1 ? \"s\" : \"\"\n } available`;\n }\n }\n };\n\n private hasOptionsOrFilterDisabled = () =>\n this.options.length > 0 || this.disableAutoFiltering;\n\n private hadNoOptions = () =>\n this.filteredOptions.length === 1 &&\n this.filteredOptions[0][this.labelField] === this.emptyOptionListText &&\n this.searchMode === \"navigation\";\n\n private isSubmitDisabled = () =>\n !this.value ||\n this.value.length < this.charactersUntilSuggestion ||\n this.disabled ||\n this.hadNoOptions() ||\n this.hasTimedOut ||\n this.loading;\n\n private showMenuWithNoInput = () => this.charactersUntilSuggestion === 0;\n private updateSearchButtonType = () => {\n this.searchButtonType =\n !!this.el.closest<HTMLFormElement>(\"FORM\") &&\n !this.preventFormSubmitOnSearch\n ? \"submit\"\n : \"button\";\n };\n\n render() {\n const {\n inputId,\n name,\n label,\n required,\n size,\n placeholder,\n helperText,\n disabled,\n value,\n readonly,\n spellcheck,\n fullWidth,\n options,\n open,\n hideLabel,\n menuId,\n ariaActiveDescendant,\n truncateValue,\n autofocus,\n autocapitalize,\n autocomplete,\n filteredOptions,\n theme,\n charactersUntilSuggestion,\n labelField,\n valueField,\n loadingLabel,\n loadingErrorLabel,\n searchMode,\n showClearButton,\n searchSubmitFocused,\n clearButtonFocused,\n searchButtonType,\n } = this;\n\n const disabledMode = readonly || disabled;\n\n const describedBy = getInputDescribedByText(\n this.el,\n inputId,\n helperText !== \"\",\n false\n ).trim();\n\n let describedById = undefined;\n\n if (describedBy !== \"\" && this.hasOptionsOrFilterDisabled()) {\n describedById = `${describedBy} ${inputId}-assistive-hint`;\n } else if (this.hasOptionsOrFilterDisabled()) {\n describedById = `${inputId}-assistive-hint`;\n } else if (describedBy !== \"\") {\n describedById = describedBy;\n }\n\n const hasSuggestedSearch =\n (!!value || this.showMenuWithNoInput()) &&\n this.hasOptionsOrFilterDisabled();\n const menuOpen = hasSuggestedSearch && open && filteredOptions.length > 0;\n const menuRendered = menuOpen && value.length >= charactersUntilSuggestion;\n\n const labelValue = getLabelFromValue(\n value,\n options,\n valueField,\n labelField\n );\n\n renderHiddenInput(this.el as HTMLElement, value, name, disabledMode);\n\n return (\n <Host\n class={{\n \"ic-search-bar-search\": true,\n \"ic-search-bar-full-width\": fullWidth,\n \"ic-search-bar-disabled\": disabled,\n \"ic-search-bar-small\": size === \"small\",\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n }}\n onFocus={this.handleHostFocus}\n onBlur={this.handleHostBlur}\n >\n <ic-input-container readonly={readonly} disabled={disabledMode}>\n {!hideLabel && (\n <ic-input-label\n for={inputId}\n label={label}\n helperText={helperText}\n required={required}\n disabled={disabledMode && !readonly}\n readonly={readonly}\n >\n <slot name=\"helper-text\" slot=\"helper-text\"></slot>\n </ic-input-label>\n )}\n <ic-input-component-container\n ref={(el) => (this.anchorEl = el)}\n size={size}\n disabled={disabledMode}\n readonly={readonly}\n fullWidth={fullWidth}\n >\n <input\n id={inputId}\n name={name}\n ref={(el) => (this.inputEl = el)}\n value={options && !!labelValue ? labelValue : value}\n class={{\n \"no-left-pad\": readonly,\n readonly,\n \"truncate-value\": truncateValue,\n }}\n placeholder={placeholder}\n required={required}\n disabled={disabledMode}\n readonly={readonly}\n onInput={this.onInput}\n onBlur={this.onInputBlur}\n onFocus={this.onInputFocus}\n aria-label={hideLabel ? label : undefined}\n aria-activedescendant={ariaActiveDescendant}\n aria-expanded={\n options.length > 0 && menuRendered ? `${menuOpen}` : undefined\n }\n aria-owns={menuRendered ? menuId : undefined}\n aria-describedby={describedById}\n aria-controls={menuRendered ? menuId : undefined}\n aria-haspopup={options.length > 0 ? \"listbox\" : undefined}\n aria-autocomplete={hasSuggestedSearch ? \"list\" : undefined}\n role={options.length > 0 && menuRendered ? \"combobox\" : undefined}\n autocomplete={autocomplete}\n autocapitalize={autocapitalize}\n autoFocus={autofocus}\n spellcheck={spellcheck}\n inputmode=\"search\"\n ></input>\n <div\n class={{\n \"clear-button-container\": true,\n \"clear-button-visible\":\n !!value && !disabledMode && showClearButton,\n }}\n >\n <ic-button\n id=\"clear-button\"\n class={{\n \"clear-button\": true,\n \"clear-button-unfocused\": !clearButtonFocused,\n }}\n aria-label=\"Clear\"\n innerHTML={clearIcon}\n onClick={this.handleClear}\n onMouseDown={this.handleMouseDown}\n size={size}\n onFocus={this.handleFocusClearButton}\n onBlur={this.handleClearBlur}\n onKeyDown={this.handleClear}\n type={\"button\"}\n variant=\"icon-tertiary\"\n theme={clearButtonFocused ? \"light\" : \"dark\"}\n ></ic-button>\n <div class=\"divider\"></div>\n </div>\n <div\n class={{\n \"search-submit-button-container\": true,\n \"search-submit-button-disabled\": this.isSubmitDisabled(),\n }}\n >\n <ic-button\n id=\"search-submit-button\"\n aria-label=\"Search\"\n ref={(el) => (this.searchSubmitButton = el)}\n class={{\n \"search-submit-button\": true,\n \"search-submit-button-small\": size === \"small\",\n \"search-submit-button-unfocused\": !searchSubmitFocused,\n \"search-submit-button-disabled\": this.isSubmitDisabled(),\n }}\n disabled={this.isSubmitDisabled()}\n innerHTML={searchIcon}\n size={size}\n onClick={this.handleSubmitSearch}\n onMouseDown={this.handleMouseDown}\n onBlur={this.handleSubmitSearchBlur}\n onFocus={this.handleSubmitSearchFocus}\n onKeyDown={this.handleSubmitSearchKeyDown}\n type={searchButtonType}\n variant=\"icon-tertiary\"\n theme={searchSubmitFocused ? \"light\" : \"dark\"}\n ></ic-button>\n </div>\n </ic-input-component-container>\n <div\n class={{\n \"menu-container\": true,\n fullwidth: fullWidth,\n }}\n >\n {menuRendered && this.anchorEl && this.inputEl && (\n <ic-menu\n class={{\n \"no-results\":\n this.hadNoOptions() ||\n (filteredOptions.length === 1 &&\n (filteredOptions[0][labelField] === loadingLabel ||\n filteredOptions[0][labelField] === loadingErrorLabel)),\n }}\n activationType=\"manual\"\n anchorEl={this.anchorEl}\n autofocusOnSelected={false}\n searchMode={searchMode}\n inputEl={this.inputEl}\n inputLabel={label}\n ref={(el) => (this.menu = el)}\n fullWidth={fullWidth}\n menuId={menuId}\n open={true}\n options={filteredOptions}\n onMenuOptionSelect={this.handleOptionSelect}\n onMenuStateChange={this.handleMenuChange}\n onMenuOptionId={this.handleMenuOptionHighlight}\n onRetryButtonClicked={this.handleRetry}\n parentEl={this.el as HTMLElement}\n value={value}\n labelField={labelField}\n valueField={valueField}\n searchBar={true}\n ></ic-menu>\n )}\n </div>\n </ic-input-container>\n <div\n aria-live=\"polite\"\n role=\"status\"\n class=\"search-results-status\"\n ></div>\n </Host>\n );\n }\n}\n"],"mappings":"qvCAAA,MAAMA,EAAiB,q5MACvB,MAAAC,EAAeD,EC8Cf,IAAIE,EAAW,E,MAYFC,EAAS,MAPtB,WAAAC,CAAAC,G,0gBAWUC,KAAAC,YAAc,MAEdD,KAAAE,QAAU,uBAAuBN,MAEjCI,KAAAG,6BAA+B,MAC/BH,KAAAI,OAAS,GAAGJ,KAAKE,eACjBF,KAAAK,QAAU,KACVL,KAAAM,cAAgB,MAChBN,KAAAO,aAAe,MACfP,KAAAQ,iBAAmB,MACnBR,KAAAS,iBAAmB,MAEnBT,KAAAU,cAAgB,MAMfV,KAAAW,mBAAqB,MAErBX,KAAAY,KAAO,MACPZ,KAAAa,oBAAsB,MACtBb,KAAAc,gBAAkB,MAMnBd,KAAAe,eAAiB,MAKjBf,KAAAgB,aAAoC,MAKpChB,KAAAiB,YAAmC,MAKnCjB,KAAAkB,UAAY,MAKZlB,KAAAmB,0BAA4B,EAW5BnB,KAAAoB,SAAW,MAUXpB,KAAAqB,qBAAuB,MAKvBrB,KAAAsB,SAAW,EASXtB,KAAAuB,oBAAsB,mBAKtBvB,KAAAwB,YAAc,MAMdxB,KAAAyB,UAAY,MAKZzB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KAAgBG,GAClCW,EAAgB,GAAGd,KAAgBE,IAE3C8K,eAAe,SACfZ,SAAUjM,KAAKiM,SACfa,oBAAqB,MACrBxK,WAAYA,EACZe,QAASrD,KAAKqD,QACd0J,WAAY7H,EACZ8G,IAAMrI,GAAQ3D,KAAKoH,KAAOzD,EAC1BlC,UAAWA,EACXrB,OAAQA,EACRQ,KAAM,KACNgC,QAASD,EACTqK,mBAAoBhN,KAAK0G,mBACzBuG,kBAAmBjN,KAAKgH,iBACxBkG,eAAgBlN,KAAK4G,0BACrBuG,qBAAsBnN,KAAKgG,YAC3BoH,SAAUpN,KAAK2D,GACfd,MAAOA,EACPhB,WAAYA,EACZa,WAAYA,EACZ2K,UAAW,SAKnB5B,EAAA,OAAA1F,IAAA,uDACY,SACVmG,KAAK,SACLP,MAAM,0B","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["icSearchBarCss","IcSearchBarStyle0","inputIds","SearchBar","constructor","hostRef","this","hasTimedOut","inputId","menuCloseFromMenuChangeEvent","menuId","preLoad","preventSubmit","prevNoOption","retryButtonClick","retryViaKeyPress","truncateValue","clearButtonFocused","open","searchSubmitFocused","showClearButton","autocapitalize","autocomplete","autocorrect","autofocus","charactersUntilSuggestion","disabled","disableAutoFiltering","debounce","emptyOptionListText","focusOnLoad","fullWidth","helperText","hideLabel","assistiveHintText","labelField","loading","loadingErrorLabel","loadingLabel","name","placeholder","preventFormSubmitOnSearch","readonly","required","searchMode","size","spellcheck","theme","valueField","filteredOptions","options","value","handleClear","ev","keyboardEvent","mouseEvent","type","code","_a","inputEl","setAttribute","clearTimeout","timeoutTimer","showMenuWithNoInput","setMenuChange","el","setFocus","icClear","emit","preventDefault","onInput","target","icInput","length","rawFilteredOptions","getFilteredMenuOptions","debounceAriaLiveUpdate","onInputBlur","relatedTarget","icSearchBarBlur","onInputFocus","icSearchBarFocus","handleClearBlur","icClearBlur","handleSubmitSearchBlur","icSubmitSearchBlur","setInputValue","newValue","label","getLabelFromValue","handleMouseDown","handleSubmitSearchFocus","handleSubmitSearch","highlightedValue","undefined","icSubmitSearch","form","closest","searchSubmitButton","handleHiddenFormButtonClick","handleSubmitSearchKeyDown","key","handleRetry","detail","keyPressed","icRetryLoad","triggerLoading","loadingOption","timeout","window","setTimeout","timedOut","handleOptionSelect","icOptionSelect","handleMenuOptionHighlight","optionId","replace","ariaActiveDescendant","handleMenuChange","icMenuChange","handleHostFocus","handleHostBlur","menu","focus","updateSearchResultAriaLive","handleFocusClearButton","renderAssistiveHintEl","input","shadowRoot","querySelector","Object","keys","hasOptionsOrFilterDisabled","assistiveHintEl","document","createElement","innerText","id","style","display","_b","after","call","searchResultsStatusEl","hadNoOptions","isSubmitDisabled","updateSearchButtonType","searchButtonType","watchCharactersUntilSuggestionHandler","watchDisabledHandler","removeDisabledFalse","debounceChanged","icChange","debounceEvent","loadingHandler","preventFormSubmitOnSearchHandler","filteredOptionsHandler","newOptions","some","opt","watchOptionsHandler","watchValueHandler","connectedCallback","disconnectedCallback","remove","componentWillLoad","componentDidLoad","onComponentRequiredPropUndefined","prop","propName","componentWillRender","handleSetFirstOption","find","filteredOption","handleKeyDown","event","icKeydown","handleKeyboardOpen","handleKeyUp","debounceAriaLive","render","disabledMode","describedBy","getInputDescribedByText","trim","describedById","hasSuggestedSearch","menuOpen","menuRendered","labelValue","renderHiddenInput","h","Host","class","onFocus","onBlur","for","slot","ref","anchorEl","role","autoFocus","inputmode","innerHTML","clearIcon","onClick","onMouseDown","onKeyDown","variant","searchIcon","fullwidth","activationType","autofocusOnSelected","inputLabel","onMenuOptionSelect","onMenuStateChange","onMenuOptionId","onRetryButtonClicked","parentEl","searchBar"],"sources":["src/components/ic-search-bar/ic-search-bar.css?tag=ic-search-bar&encapsulation=shadow","src/components/ic-search-bar/ic-search-bar.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n/**\n * @prop --ic-z-index-menu: z-index of search bar menu\n */\n\n:host(.ic-search-bar-search) {\n display: block;\n\n --divider-height: 1.5rem;\n --ic-input-label-helpertext-padding: var(--ic-space-xs);\n --border-color: var(--ic-search-bar-outline);\n --input-bg-color: var(--ic-search-bar-background);\n --border-color-disabled: var(--ic-search-bar-outline-disabled);\n --menu-item-text-color: var(--ic-search-bar-dropdown-option-text);\n --menu-item-desc-text-color: var(--ic-search-bar-dropdown-option-description);\n --menu-bg-color: var(--ic-search-bar-dropdown-background);\n --menu-border-color: var(--ic-search-bar-dropdown-outline);\n}\n\n:host(.ic-search-bar-disabled) {\n --ic-input-label-text-color: var(--ic-search-bar-label-disabled);\n --ic-input-label-helper-text-color: var(--ic-search-bar-subtitle-disabled);\n}\n\n:host(.ic-search-bar-search:hover) {\n --border-color: var(--ic-search-bar-outline-hover);\n}\n\n:host(.ic-search-bar-search:active) {\n --border-color: var(--ic-search-bar-outline-pressed);\n}\n\n:host(.ic-search-bar-search.ic-search-bar-small) {\n --divider-height: 1rem;\n}\n\n:host(.ic-search-bar-full-width) {\n width: 100%;\n}\n\n/* Custom Input */\n\n::placeholder {\n color: var(--ic-search-bar-placeholder-text);\n opacity: 1;\n}\n\ninput {\n border: 0;\n border-radius: var(--ic-border-radius);\n color: var(--ic-search-bar-filled-text);\n background-color: var(--input-bg-color);\n line-height: 1.5rem;\n letter-spacing: 0.005rem;\n width: 100%;\n padding-right: var(--ic-space-xs);\n padding-left: var(--ic-space-xs);\n caret-color: var(--ic-search-bar-filled-text-cursor);\n}\n\ninput:focus {\n border: 0;\n outline: 0;\n}\n\ninput:disabled,\ninput:disabled::placeholder {\n color: var(--ic-search-bar-disabled-text);\n}\n\n/* Chrome, Safari, Edge */\ninput::-webkit-outer-spin-button,\ninput::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n.no-left-pad {\n padding-left: 0;\n}\n\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-decoration,\ninput[type=\"search\"]::-webkit-search-results-button,\ninput[type=\"search\"]::-webkit-search-results-decoration {\n display: none;\n}\n\ninput[type=\"search\"].truncate-value {\n width: 100%;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n/* CLEAR */\n\n.clear-button-container {\n align-items: center;\n margin-right: var(--ic-space-1px);\n display: none;\n visibility: hidden;\n}\n\n.clear-button {\n border-radius: var(--ic-border-radius);\n transition: box-shadow var(--ic-easing-transition),\n border-radius var(--ic-easing-transition);\n}\n\n.clear-button:focus,\n.clear-button:active {\n background-color: var(--ic-color-focus-inner);\n box-shadow: inset 0 0 0 0.125rem var(--ic-color-focus-outer);\n border-radius: 0.25rem;\n}\n\n.clear-button-unfocused * {\n fill: var(--ic-search-bar-clear-button);\n}\n\n.clear-button:focus,\n.clear-button:active * {\n fill: var(--ic-atoms-input-clear-button-focus);\n}\n\n.clear-button-visible {\n visibility: visible;\n display: flex;\n}\n\n.search-submit-button-container {\n display: flex;\n align-items: center;\n}\n\n.search-submit-button-unfocused * {\n fill: var(--ic-search-bar-filled-icon);\n}\n\n.search-submit-button-disabled * {\n fill: var(--ic-search-bar-icon-disabled);\n}\n\n.search-submit-button-disabled .ic-tooltip-container {\n display: none !important;\n}\n\n.search-submit-button:focus,\n.search-submit-button:active {\n background-color: var(--ic-color-focus-inner) !important;\n box-shadow: inset 0 0 0 0.125rem var(--ic-color-focus-outer) !important;\n border-radius: var(--ic-space-xxs);\n}\n\n.search-submit-button:focus,\n.search-submit-button:active * {\n fill: white;\n}\n\n.divider {\n width: var(--ic-border-width);\n background-color: var(--ic-search-bar-dropdown-divider);\n height: var(--divider-height);\n}\n\n.menu-container {\n width: var(--input-width, 20rem);\n position: relative;\n top: var(--ic-space-xxxs);\n}\n\n.menu-container.fullwidth {\n width: 100%;\n}\n\n.no-results {\n cursor: not-allowed;\n}\n\n.search-results-status {\n border: 0;\n clip: rect(0, 0, 0, 0, 0);\n height: var(--ic-space-1px);\n margin-bottom: calc(-1 * var(--ic-space-1px));\n margin-right: calc(-1 * var(--ic-space-1px));\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: var(--ic-space-1px);\n}\n\n@media (forced-colors: active) {\n .search-submit-button-unfocused * {\n fill: canvastext;\n }\n\n .search-submit-button-disabled * {\n fill: GrayText;\n }\n}\n\n/* Breakpoint value chosen as it's a small amount bigger than the search bar's default width */\n@media screen AND (max-width: 22rem) {\n .menu-container {\n max-width: var(--menu-width, var(--input-width, 20rem));\n width: 100%;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .clear-button {\n transition: none;\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n Method,\n h,\n} from \"@stencil/core\";\n\nimport {\n IcAutocompleteTypes,\n IcAutocorrectStates,\n IcMenuOption,\n IcMultiValueEventDetail,\n IcSizesNoLarge,\n IcThemeMode,\n} from \"../../utils/types\";\nimport {\n getInputDescribedByText,\n renderHiddenInput,\n handleHiddenFormButtonClick,\n getLabelFromValue,\n onComponentRequiredPropUndefined,\n getFilteredMenuOptions,\n removeDisabledFalse,\n debounceEvent,\n} from \"../../utils/helpers\";\nimport {\n IcSearchBarBlurEventDetail,\n IcSearchBarSearchModes,\n} from \"./ic-search-bar.types\";\nimport { IcValueEventDetail, IcBlurEventDetail } from \"../../utils/types\";\nimport {\n IcMenuChangeEventDetail,\n IcMenuOptionIdEventDetail,\n IcOptionSelectEventDetail,\n} from \"../ic-menu/ic-menu.types\";\n\nimport clearIcon from \"../../assets/close-icon.svg\";\nimport searchIcon from \"../../assets/search-icon.svg\";\nimport { IcButtonTypes } from \"../ic-button/ic-button.types\";\n\nlet inputIds = 0;\n\n/**\n * @slot helper-text - Content is set as the helper text for the search bar.\n */\n@Component({\n tag: \"ic-search-bar\",\n styleUrl: \"ic-search-bar.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class SearchBar {\n private anchorEl?: HTMLElement;\n private assistiveHintEl?: HTMLSpanElement;\n private debounceAriaLive?: number;\n private hasTimedOut = false;\n private inputEl?: HTMLInputElement;\n private inputId = `ic-search-bar-input-${inputIds++}`;\n private menu?: HTMLIcMenuElement;\n private menuCloseFromMenuChangeEvent = false;\n private menuId = `${this.inputId}-menu`;\n private preLoad = true;\n private preventSubmit = false;\n private prevNoOption = false;\n private retryButtonClick = false;\n private retryViaKeyPress = false;\n private timeoutTimer?: number;\n private truncateValue = false;\n private searchSubmitButton?: HTMLIcButtonElement;\n\n @Element() el: HTMLIcSearchBarElement;\n\n @State() ariaActiveDescendant?: string;\n @State() clearButtonFocused = false;\n @State() highlightedValue?: string;\n @State() open = false;\n @State() searchSubmitFocused = false;\n @State() showClearButton = false;\n\n /**\n * The automatic capitalisation of the text value as it is entered/edited by the user.\n * Available options: \"off\", \"none\", \"on\", \"sentences\", \"words\", \"characters\".\n */\n @Prop() autocapitalize = \"off\";\n\n /**\n * The state of autocompletion the browser can apply on the text value.\n */\n @Prop() autocomplete: IcAutocompleteTypes = \"off\";\n\n /**\n * The state of autocorrection the browser can apply when the user is entering/editing the text value.\n */\n @Prop() autocorrect: IcAutocorrectStates = \"off\";\n\n /**\n * If `true`, the form control will have input focus when the page loads.\n */\n @Prop() autofocus = false;\n\n /**\n * The number of characters until suggestions appear. The submit button will be disabled until the inputted value is equal to or greater than this number.\n */\n @Prop() charactersUntilSuggestion = 2;\n @Watch(\"charactersUntilSuggestion\")\n watchCharactersUntilSuggestionHandler(): void {\n if (this.showMenuWithNoInput()) {\n this.filteredOptions = this.options;\n }\n }\n\n /**\n * If `true`, the disabled state will be set.\n */\n @Prop() disabled = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el as HTMLElement);\n }\n\n /**\n * Specify whether to disable the built in filtering. For example, if options will already be filtered from external source.\n * If `true`, all options provided will be displayed.\n */\n @Prop() disableAutoFiltering = false;\n\n /**\n * The amount of time, in milliseconds, to wait to trigger the `icChange` event after each keystroke.\n */\n @Prop() debounce = 0;\n @Watch(\"debounce\")\n private debounceChanged() {\n this.icChange = debounceEvent(this.icChange, this.debounce);\n }\n\n /**\n * The text displayed when there are no options in the option list.\n */\n @Prop() emptyOptionListText = \"No results found\";\n\n /**\n * If `true`, the search bar will be focused when component loaded.\n */\n @Prop() focusOnLoad = false;\n\n /**\n * Specify whether the search bar fills the full width of the container.\n * If `true`, this overrides the --input-width CSS variable.\n */\n @Prop() fullWidth = false;\n\n /**\n * The helper text that will be displayed for additional field guidance.\n */\n @Prop() helperText = \"\";\n\n /**\n * If `true`, the label will be hidden and the required label value will be applied as an aria-label.\n */\n @Prop() hideLabel = false;\n\n /**\n * The hint text for the hidden assistive description element.\n */\n @Prop() assistiveHintText =\n \"When autocomplete results are available use the up and down arrows to choose and press enter to select\";\n\n /**\n * The label for the search bar.\n */\n @Prop() label!: string;\n\n /**\n * The custom name for the label field to correspond with the IcMenuOption type.\n */\n @Prop() labelField = \"label\";\n\n /**\n * Trigger loading state when fetching options asynchronously\n */\n @Prop({ mutable: true }) loading = false;\n @Watch(\"loading\")\n loadingHandler(newValue: boolean): void {\n if (newValue && !this.hasTimedOut) {\n this.preLoad = false;\n this.triggerLoading();\n }\n }\n\n /**\n * Change the message displayed when external loading times out.\n */\n @Prop() loadingErrorLabel = \"Loading Error\";\n\n /**\n * Change the message displayed whilst the options are being loaded externally.\n */\n @Prop() loadingLabel = \"Loading...\";\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name = this.inputId;\n\n /**\n * The placeholder value to display.\n */\n @Prop() placeholder = \"Search\";\n\n /**\n * If `true` the parent form will not submit when the icSubmitSearch event fires.\n */\n @Prop() preventFormSubmitOnSearch = false;\n @State() searchButtonType: IcButtonTypes;\n @Watch(\"preventFormSubmitOnSearch\")\n preventFormSubmitOnSearchHandler(): void {\n this.updateSearchButtonType();\n }\n\n /**\n * If `true`, the readonly state will be set.\n */\n @Prop() readonly = false;\n\n /**\n * If `true`, the search bar will require a value.\n */\n @Prop() required = false;\n\n /**\n * Specify the mode search bar uses to search. `navigation` allows for quick lookups of a set of values, `query` allows for more general searches.\n */\n @Prop() searchMode: IcSearchBarSearchModes = \"navigation\";\n\n /**\n * The size of the search bar component.\n */\n @Prop() size: IcSizesNoLarge = \"medium\";\n\n /**\n * If `true`, the value of the search will have its spelling and grammar checked.\n */\n @Prop() spellcheck = false;\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop() theme: IcThemeMode = \"inherit\";\n\n /**\n * If using external filtering, set a timeout for when loading takes too long.\n */\n @Prop() timeout?: number;\n\n /**\n * The custom name for the value field to correspond with the IcMenuOption type.\n */\n @Prop() valueField = \"value\";\n\n @State() filteredOptions: IcMenuOption[] = [];\n @Watch(\"filteredOptions\")\n filteredOptionsHandler(newOptions: IcMenuOption[]): void {\n this.hasTimedOut = newOptions.some((opt) => opt.timedOut);\n }\n\n /**\n * The suggested search options.\n */\n @Prop() options: IcMenuOption[] = [];\n @Watch(\"options\")\n watchOptionsHandler(newOptions: IcMenuOption[]): void {\n if (this.disableAutoFiltering) {\n if (!this.hasTimedOut) {\n this.loading = false;\n clearTimeout(this.timeoutTimer);\n if (newOptions.length > 0) {\n this.filteredOptions = newOptions;\n } else {\n if (this.hadNoOptions()) {\n return;\n }\n this.setMenuChange(true);\n if (!this.preLoad) {\n this.filteredOptions = [\n {\n [this.labelField]: this.emptyOptionListText,\n [this.valueField]: \"\",\n },\n ];\n }\n this.preLoad = true;\n }\n }\n } else if (this.showMenuWithNoInput()) {\n this.filteredOptions = newOptions;\n }\n this.debounceAriaLiveUpdate();\n }\n\n /**\n * The value of the search input.\n */\n @Prop({ reflect: true, mutable: true }) value = \"\";\n @Watch(\"value\")\n watchValueHandler(newValue: string): void {\n this.setInputValue(newValue);\n this.icChange.emit({ value: newValue });\n }\n\n // The icChange event is defined here so that it appears as an event for search bar\n /**\n * Emitted when the value has changed.\n */\n @Event() icChange: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when value is cleared with clear button\n */\n @Event() icClear: EventEmitter<void>;\n private handleClear = (ev: Event) => {\n const keyboardEvent = ev as KeyboardEvent;\n const mouseEvent = ev as MouseEvent;\n\n if (\n mouseEvent.type === \"click\" ||\n keyboardEvent.code === \"Enter\" ||\n keyboardEvent.code === \"Space\"\n ) {\n this.value = \"\";\n this.inputEl?.setAttribute(\"value\", \"\");\n this.loading = false;\n clearTimeout(this.timeoutTimer);\n this.filteredOptions = this.options;\n this.showMenuWithNoInput() && this.setMenuChange(true);\n this.el.setFocus();\n\n this.icClear.emit();\n ev.preventDefault();\n\n this.preventSubmit = true;\n }\n };\n\n // The icInput event is defined here so that it appears as an event for search bar\n /**\n * Emitted when a keyboard input occurred.\n */\n @Event() icInput: EventEmitter<IcValueEventDetail>;\n private onInput = ({ target }: Event) => {\n this.value = (target as HTMLInputElement).value;\n this.icInput.emit({ value: this.value });\n\n if (this.options.length > 0) {\n this.setMenuChange(true);\n\n this.preLoad = false;\n\n if (this.disableAutoFiltering === false) {\n const rawFilteredOptions = getFilteredMenuOptions(\n this.options,\n this.value,\n this.labelField\n );\n\n this.filteredOptions =\n rawFilteredOptions.length > 0\n ? rawFilteredOptions\n : [\n {\n [this.labelField]: this.emptyOptionListText,\n [this.valueField]: \"\",\n },\n ];\n }\n }\n\n if (!this.showClearButton) this.showClearButton = true;\n\n this.debounceAriaLiveUpdate();\n };\n\n private onInputBlur = ({ target, relatedTarget }: FocusEvent) => {\n this.icSearchBarBlur.emit({\n value: (target as HTMLInputElement).value,\n relatedTarget,\n });\n };\n\n private onInputFocus = ({ target }: Event) => {\n this.icSearchBarFocus.emit({ value: (target as HTMLInputElement).value });\n\n this.showClearButton = true;\n };\n\n /**\n * Emitted when option is highlighted within the menu\n */\n @Event() icOptionSelect: EventEmitter<IcOptionSelectEventDetail>;\n\n /**\n * Emitted when the state of the menu changes (i.e. open or close)\n */\n @Event() icMenuChange: EventEmitter<IcMenuChangeEventDetail>;\n\n /**\n * @internal - Emitted when blur is invoked from clear button\n */\n @Event() icClearBlur: EventEmitter<IcBlurEventDetail>;\n private handleClearBlur = ({ relatedTarget }: FocusEvent) => {\n this.icClearBlur.emit({ relatedTarget });\n\n this.clearButtonFocused = false;\n };\n\n /**\n * Emitted when the 'retry loading' button is clicked\n */\n @Event() icRetryLoad: EventEmitter<IcMultiValueEventDetail>;\n\n /**\n * Emitted when the search value has been submitted\n */\n @Event() icSubmitSearch: EventEmitter<IcValueEventDetail>;\n\n /**\n * @internal - Emitted when blur is invoked from search submit button\n */\n @Event() icSubmitSearchBlur: EventEmitter<IcBlurEventDetail>;\n private handleSubmitSearchBlur = ({ relatedTarget }: FocusEvent) => {\n this.icSubmitSearchBlur.emit({ relatedTarget });\n\n this.searchSubmitFocused = false;\n };\n\n /**\n * Emitted when blur is invoked from ic-search-bar\n */\n @Event() icSearchBarBlur: EventEmitter<IcSearchBarBlurEventDetail>;\n\n /**\n * Emitted when focus is invoked from ic-search-bar\n */\n @Event() icSearchBarFocus: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when a keydown event occurred.\n */\n @Event() icKeydown: EventEmitter<{ event: KeyboardEvent }>;\n\n connectedCallback(): void {\n this.debounceChanged();\n }\n\n disconnectedCallback(): void {\n this.assistiveHintEl?.remove();\n }\n\n componentWillLoad(): void {\n this.setInputValue(this.value);\n\n removeDisabledFalse(this.disabled, this.el as HTMLElement);\n\n this.updateSearchButtonType();\n }\n\n componentDidLoad(): void {\n if (this.focusOnLoad) {\n this.el.setFocus();\n }\n\n if (this.hasOptionsOrFilterDisabled()) {\n this.renderAssistiveHintEl();\n if (this.disableAutoFiltering || this.showMenuWithNoInput()) {\n this.filteredOptions = this.options;\n }\n }\n\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Search Bar\"\n );\n }\n\n componentWillRender(): void {\n if (this.prevNoOption && this.menu && !this.hasTimedOut) {\n this.menu.handleSetFirstOption();\n this.prevNoOption = false;\n }\n if (\n this.filteredOptions.find(\n (filteredOption) =>\n filteredOption[this.labelField] === this.emptyOptionListText ||\n filteredOption[this.labelField] === this.loadingErrorLabel ||\n filteredOption[this.labelField] === this.loadingLabel\n )\n ) {\n this.prevNoOption = true;\n }\n }\n\n @Listen(\"keydown\", {})\n handleKeyDown(event: KeyboardEvent): void {\n this.icKeydown.emit({ event });\n if (this.menu && this.open) {\n this.menu.handleKeyboardOpen(event);\n }\n }\n\n @Listen(\"keyup\", {})\n handleKeyUp(ev: KeyboardEvent): void {\n if (ev.key === \"Enter\") {\n if (this.preventSubmit || this.isSubmitDisabled()) {\n return;\n }\n\n this.handleSubmitSearch();\n this.setMenuChange(false);\n }\n\n if (ev.key === \"Escape\") {\n this.setMenuChange(false);\n }\n\n if (this.preventSubmit) {\n this.preventSubmit = false;\n }\n }\n\n /**\n * Sets focus on the native `input`.\n */\n @Method()\n async setFocus(): Promise<void> {\n this.retryViaKeyPress = false;\n this.retryButtonClick = false;\n this.inputEl?.focus();\n }\n\n private setInputValue = (newValue: string) => {\n if (this.inputEl) {\n const label = getLabelFromValue(\n newValue,\n this.options,\n this.valueField,\n this.labelField\n );\n if (label) this.inputEl.value = label;\n else if (this.inputEl.value !== newValue) {\n this.inputEl.value = newValue;\n }\n }\n };\n\n private handleMouseDown = (ev: Event) => {\n ev.preventDefault();\n };\n\n private handleSubmitSearchFocus = () => {\n this.searchSubmitFocused = true;\n };\n\n private handleSubmitSearch = () => {\n if (this.highlightedValue) this.value = this.highlightedValue;\n this.highlightedValue = undefined;\n this.icSubmitSearch.emit({ value: this.value });\n\n const form = this.el.closest<HTMLFormElement>(\"FORM\");\n\n if (this.searchSubmitButton && !!form && !this.preventSubmit) {\n handleHiddenFormButtonClick(form, this.searchSubmitButton);\n }\n };\n\n private debounceAriaLiveUpdate() {\n clearTimeout(this.debounceAriaLive);\n\n this.debounceAriaLive = window.setTimeout(() => {\n this.updateSearchResultAriaLive();\n }, 500);\n }\n\n private handleSubmitSearchKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === \" \") {\n ev.preventDefault();\n this.handleSubmitSearch();\n }\n };\n\n private handleRetry = (ev: CustomEvent<IcMultiValueEventDetail>) => {\n this.retryViaKeyPress = ev.detail.keyPressed === \"Enter\";\n this.icRetryLoad.emit({ value: ev.detail.value });\n this.triggerLoading();\n this.retryButtonClick = true;\n };\n\n private triggerLoading = () => {\n const loadingOption: IcMenuOption[] = [\n {\n [this.labelField]: this.loadingLabel,\n [this.valueField]: \"\",\n loading: true,\n },\n ];\n if (this.filteredOptions !== loadingOption)\n this.filteredOptions = loadingOption;\n if (this.timeout) {\n this.timeoutTimer = window.setTimeout(() => {\n this.filteredOptions = [\n {\n [this.labelField]: this.loadingErrorLabel,\n [this.valueField]: \"\",\n timedOut: true,\n },\n ];\n }, this.timeout);\n }\n };\n\n private handleOptionSelect = (ev: CustomEvent) => {\n if (ev.detail.label === this.emptyOptionListText) {\n this.el.setFocus();\n return;\n }\n\n this.value = ev.detail.value;\n this.icOptionSelect.emit({ value: this.value });\n };\n\n private handleMenuOptionHighlight = (\n ev: CustomEvent<IcMenuOptionIdEventDetail>\n ) => {\n const { optionId } = ev.detail;\n if (optionId)\n this.highlightedValue = optionId.replace(`${this.menuId}-`, \"\");\n this.ariaActiveDescendant = optionId || \"\";\n };\n\n private handleMenuChange = (ev: CustomEvent<IcMenuChangeEventDetail>) => {\n this.setMenuChange(ev.detail.open);\n if (!ev.detail.open) {\n this.menuCloseFromMenuChangeEvent = true;\n }\n };\n\n private setMenuChange = (open: boolean) => {\n if (this.open !== open) {\n this.open = open;\n this.icMenuChange.emit({ open });\n }\n };\n\n private handleHostFocus = () => {\n if (\n this.options &&\n (this.value || this.showMenuWithNoInput()) &&\n !this.menuCloseFromMenuChangeEvent\n ) {\n this.setMenuChange(true);\n }\n this.truncateValue = false;\n this.showMenuWithNoInput() && this.debounceAriaLiveUpdate();\n\n this.icSearchBarFocus.emit();\n };\n\n private handleHostBlur = ({ relatedTarget }: FocusEvent) => {\n if (\n this.open &&\n this.options &&\n relatedTarget !== this.menu &&\n !this.retryViaKeyPress &&\n !this.retryButtonClick\n ) {\n this.setMenuChange(false);\n }\n\n if (this.retryButtonClick || this.retryViaKeyPress) {\n this.inputEl?.focus();\n }\n\n this.showClearButton = false;\n this.menuCloseFromMenuChangeEvent = false;\n this.truncateValue = true;\n this.icSearchBarBlur.emit({\n relatedTarget,\n value: this.value,\n });\n this.retryViaKeyPress = false;\n this.retryButtonClick = false;\n this.showMenuWithNoInput() && this.updateSearchResultAriaLive();\n };\n\n private handleFocusClearButton = () => {\n this.clearButtonFocused = true;\n };\n\n private renderAssistiveHintEl = () => {\n const input = this.el.shadowRoot?.querySelector(`#${this.inputId}`);\n\n if (\n input &&\n Object.keys(input).length > 0 &&\n this.hasOptionsOrFilterDisabled()\n ) {\n this.assistiveHintEl = document.createElement(\"span\");\n this.assistiveHintEl.innerText = this.assistiveHintText;\n this.assistiveHintEl.id = `${this.inputId}-assistive-hint`;\n this.assistiveHintEl.style.display = \"none\";\n input.after?.(this.assistiveHintEl);\n }\n };\n\n private updateSearchResultAriaLive = () => {\n const searchResultsStatusEl =\n this.el.shadowRoot?.querySelector<HTMLParagraphElement>(\n \".search-results-status\"\n );\n\n if (searchResultsStatusEl) {\n if (\n !this.open ||\n (this.value === \"\" && !this.showMenuWithNoInput()) ||\n this.value.length < this.charactersUntilSuggestion\n ) {\n searchResultsStatusEl.innerText = \"\";\n } else if (\n this.hasOptionsOrFilterDisabled() &&\n this.filteredOptions.length > 0 &&\n this.open &&\n !this.filteredOptions[0].loading\n ) {\n searchResultsStatusEl.innerText = this.hadNoOptions()\n ? this.emptyOptionListText\n : `${this.filteredOptions.length} result${\n this.filteredOptions.length > 1 ? \"s\" : \"\"\n } available`;\n }\n }\n };\n\n private hasOptionsOrFilterDisabled = () =>\n this.options.length > 0 || this.disableAutoFiltering;\n\n private hadNoOptions = () =>\n this.filteredOptions.length === 1 &&\n this.filteredOptions[0][this.labelField] === this.emptyOptionListText &&\n this.searchMode === \"navigation\";\n\n private isSubmitDisabled = () =>\n !this.value ||\n this.value.length < this.charactersUntilSuggestion ||\n this.disabled ||\n this.hadNoOptions() ||\n this.hasTimedOut ||\n this.loading;\n\n private showMenuWithNoInput = () => this.charactersUntilSuggestion === 0;\n private updateSearchButtonType = () => {\n this.searchButtonType =\n !!this.el.closest<HTMLFormElement>(\"FORM\") &&\n !this.preventFormSubmitOnSearch\n ? \"submit\"\n : \"button\";\n };\n\n render() {\n const {\n inputId,\n name,\n label,\n required,\n size,\n placeholder,\n helperText,\n disabled,\n value,\n readonly,\n spellcheck,\n fullWidth,\n options,\n open,\n hideLabel,\n menuId,\n ariaActiveDescendant,\n truncateValue,\n autofocus,\n autocapitalize,\n autocomplete,\n filteredOptions,\n theme,\n charactersUntilSuggestion,\n labelField,\n valueField,\n loadingLabel,\n loadingErrorLabel,\n searchMode,\n showClearButton,\n searchSubmitFocused,\n clearButtonFocused,\n searchButtonType,\n } = this;\n\n const disabledMode = readonly || disabled;\n\n const describedBy = getInputDescribedByText(\n this.el,\n inputId,\n helperText !== \"\",\n false\n ).trim();\n\n let describedById = undefined;\n\n if (describedBy !== \"\" && this.hasOptionsOrFilterDisabled()) {\n describedById = `${describedBy} ${inputId}-assistive-hint`;\n } else if (this.hasOptionsOrFilterDisabled()) {\n describedById = `${inputId}-assistive-hint`;\n } else if (describedBy !== \"\") {\n describedById = describedBy;\n }\n\n const hasSuggestedSearch =\n (!!value || this.showMenuWithNoInput()) &&\n this.hasOptionsOrFilterDisabled();\n const menuOpen = hasSuggestedSearch && open && filteredOptions.length > 0;\n const menuRendered = menuOpen && value.length >= charactersUntilSuggestion;\n\n const labelValue = getLabelFromValue(\n value,\n options,\n valueField,\n labelField\n );\n\n renderHiddenInput(this.el as HTMLElement, value, name, disabledMode);\n\n return (\n <Host\n class={{\n \"ic-search-bar-search\": true,\n \"ic-search-bar-full-width\": fullWidth,\n \"ic-search-bar-disabled\": disabled,\n \"ic-search-bar-small\": size === \"small\",\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n }}\n onFocus={this.handleHostFocus}\n onBlur={this.handleHostBlur}\n >\n <ic-input-container readonly={readonly} disabled={disabledMode}>\n {!hideLabel && (\n <ic-input-label\n for={inputId}\n label={label}\n helperText={helperText}\n required={required}\n disabled={disabledMode && !readonly}\n readonly={readonly}\n >\n <slot name=\"helper-text\" slot=\"helper-text\"></slot>\n </ic-input-label>\n )}\n <ic-input-component-container\n ref={(el) => (this.anchorEl = el)}\n size={size}\n disabled={disabledMode}\n readonly={readonly}\n fullWidth={fullWidth}\n >\n <input\n id={inputId}\n name={name}\n ref={(el) => (this.inputEl = el)}\n value={options && !!labelValue ? labelValue : value}\n class={{\n \"no-left-pad\": readonly,\n readonly,\n \"truncate-value\": truncateValue,\n }}\n placeholder={placeholder}\n required={required}\n disabled={disabledMode}\n readonly={readonly}\n onInput={this.onInput}\n onBlur={this.onInputBlur}\n onFocus={this.onInputFocus}\n aria-label={hideLabel ? label : undefined}\n aria-activedescendant={ariaActiveDescendant}\n aria-expanded={\n options.length > 0 && menuRendered ? `${menuOpen}` : undefined\n }\n aria-owns={menuRendered ? menuId : undefined}\n aria-describedby={describedById}\n aria-controls={menuRendered ? menuId : undefined}\n aria-haspopup={options.length > 0 ? \"listbox\" : undefined}\n aria-autocomplete={hasSuggestedSearch ? \"list\" : undefined}\n role={options.length > 0 && menuRendered ? \"combobox\" : undefined}\n autocomplete={autocomplete}\n autocapitalize={autocapitalize}\n autoFocus={autofocus}\n spellcheck={spellcheck}\n inputmode=\"search\"\n ></input>\n <div\n class={{\n \"clear-button-container\": true,\n \"clear-button-visible\":\n !!value && !disabledMode && showClearButton,\n }}\n >\n <ic-button\n id=\"clear-button\"\n class={{\n \"clear-button\": true,\n \"clear-button-unfocused\": !clearButtonFocused,\n }}\n aria-label=\"Clear\"\n innerHTML={clearIcon}\n onClick={this.handleClear}\n onMouseDown={this.handleMouseDown}\n size={size}\n onFocus={this.handleFocusClearButton}\n onBlur={this.handleClearBlur}\n onKeyDown={this.handleClear}\n type={\"button\"}\n variant=\"icon-tertiary\"\n theme={clearButtonFocused ? \"light\" : \"dark\"}\n ></ic-button>\n <div class=\"divider\"></div>\n </div>\n <div\n class={{\n \"search-submit-button-container\": true,\n \"search-submit-button-disabled\": this.isSubmitDisabled(),\n }}\n >\n <ic-button\n id=\"search-submit-button\"\n aria-label=\"Search\"\n ref={(el) => (this.searchSubmitButton = el)}\n class={{\n \"search-submit-button\": true,\n \"search-submit-button-small\": size === \"small\",\n \"search-submit-button-unfocused\": !searchSubmitFocused,\n \"search-submit-button-disabled\": this.isSubmitDisabled(),\n }}\n disabled={this.isSubmitDisabled()}\n innerHTML={searchIcon}\n size={size}\n onClick={this.handleSubmitSearch}\n onMouseDown={this.handleMouseDown}\n onBlur={this.handleSubmitSearchBlur}\n onFocus={this.handleSubmitSearchFocus}\n onKeyDown={this.handleSubmitSearchKeyDown}\n type={searchButtonType}\n variant=\"icon-tertiary\"\n theme={searchSubmitFocused ? \"light\" : \"dark\"}\n ></ic-button>\n </div>\n </ic-input-component-container>\n <div\n class={{\n \"menu-container\": true,\n fullwidth: fullWidth,\n }}\n >\n {menuRendered && this.anchorEl && this.inputEl && (\n <ic-menu\n class={{\n \"no-results\":\n this.hadNoOptions() ||\n (filteredOptions.length === 1 &&\n (filteredOptions[0][labelField] === loadingLabel ||\n filteredOptions[0][labelField] === loadingErrorLabel)),\n }}\n activationType=\"manual\"\n anchorEl={this.anchorEl}\n autofocusOnSelected={false}\n searchMode={searchMode}\n inputEl={this.inputEl}\n inputLabel={label}\n ref={(el) => (this.menu = el)}\n fullWidth={fullWidth}\n menuId={menuId}\n open={true}\n options={filteredOptions}\n onMenuOptionSelect={this.handleOptionSelect}\n onMenuStateChange={this.handleMenuChange}\n onMenuOptionId={this.handleMenuOptionHighlight}\n onRetryButtonClicked={this.handleRetry}\n parentEl={this.el as HTMLElement}\n value={value}\n labelField={labelField}\n valueField={valueField}\n searchBar={true}\n ></ic-menu>\n )}\n </div>\n </ic-input-container>\n <div\n aria-live=\"polite\"\n role=\"status\"\n class=\"search-results-status\"\n ></div>\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ACLP,MAAM,0B","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,c as t,h as i,H as o,g as s}from"./p-8e4e97b4.js";import{E as n,e as a,i as r}from"./p-eeb8d98a.js";import{c as l}from"./p-68a5aaff.js";import"./p-6215e2ae.js";const c='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}@media (prefers-reduced-motion: no-preference){:host .opening-from-parent{animation:slide-in var(--ic-transition-duration-slow) ease-in-out}:host .opening-from-child{animation:slide-out var(--ic-transition-duration-slow) ease-in-out}}:host .ic-popover-menu{border-radius:var(--ic-border-radius);color:var(--ic-popover-nav-text);--ic-typography-color:var(--ic-popover-nav-text);position:relative;z-index:var(--ic-z-index-popover);box-sizing:border-box;box-shadow:var(--ic-elevation-overlay);display:none}:host(.on-dialog){inset:auto !important}:host(.on-dialog-fix-translate){transform:translate(0, var(--ic-space-xs)) !important}:host(.on-dialog-translate-y){transform:translate(0, calc(-1 * var(--translate-y))) !important}.menu{border:var(--ic-border-default);border-color:var(--ic-popover-border);border-radius:var(--ic-border-radius);background-color:var(--ic-popover-background);visibility:hidden;height:0;display:flex;flex-direction:column}:host .ic-popover-menu:focus-within{box-shadow:var(--ic-border-focus)}.menu:focus-visible{outline:none}:host .ic-popover-menu-open{display:block;min-width:calc(20rem - var(--ic-space-xl));width:var(--popover-width, 20rem);max-width:calc(100vw - var(--ic-space-xl))}:host .ic-popover-menu-open .menu{visibility:visible;height:-moz-fit-content;height:fit-content;max-height:var(--max-height, -moz-fit-content);max-height:var(--max-height, fit-content);overflow-y:auto;overflow-x:hidden}.parent-label{--ic-typography-color:var(--ic-popover-parent-label);margin:var(--ic-space-xs) var(--ic-space-xs) 0}@keyframes slide-in{from{opacity:0;transform:translateX(10rem)}to{opacity:1;transform:translateX(0)}}@keyframes slide-out{from{opacity:0;transform:translateX(-10rem)}to{opacity:1;transform:translateX(0)}}';const h=c;const d="div.menu-body";const p=class{constructor(i){e(this,i);this.icPopoverClosed=t(this,"icPopoverClosed",7);this.ARIA_LABEL="aria-label";this.popoverMenuEls=[];this.openingFromChild=false;this.openingFromParent=false;this.popperProps={};this.fixedPositioning=false;this.submenuLevel=1;this.theme="inherit";this.open=undefined;this.setButtonFocus=()=>{var e;(e=this.popoverMenuEls[this.currentFocus])===null||e===void 0?void 0:e.focus()};this.findAnchorEl=e=>{let t=null;if(!e){this.submenuId===undefined&&console.error("No anchor specified for popover component")}else{t=document.querySelector(e.indexOf("#")===0?e:"#"+e);if(t===null){console.error(`Popover anchor element '${e}' not found`)}}return t};this.isNotPopoverMenuEl=e=>{const t=e.target;const{id:i,tagName:o}=t;const s=this.anchorEl&&t===this.anchorEl;return!s&&i!==this.anchor&&o!=="IC-MENU-ITEM"&&o!=="IC-MENU-GROUP"&&o!=="IC-POPOVER-MENU"};this.getNextItemToSelect=(e,t)=>{const i=this.popoverMenuEls.length-1;if(e<1){e=0}let o=t?e+1:e-1;if(o<0){o=i}else if(o>i){o=0}return o};this.addMenuItems=e=>{var t;for(let i=0;i<e.length;i++){const o=e[i];if(o.tagName==="IC-MENU-ITEM"){this.popoverMenuEls.push(o)}else if(o.tagName==="IC-MENU-GROUP"){const e=(t=o.shadowRoot)===null||t===void 0?void 0:t.querySelector(".menu-items-wrapper");if(e){const t=n(e);t&&this.addMenuItems(t)}}}};this.getMenuAriaLabel=()=>{let e=this.el.getAttribute(this.ARIA_LABEL);if(e){this.menuAriaLabel=e;this.el.removeAttribute(this.ARIA_LABEL)}else if(this.menuAriaLabel){e=this.menuAriaLabel}if(!e)return null;if(a(this.submenuId)){return`${e}, within nested level ${this.submenuLevel} ${this.parentLabel} submenu,`}else{return e}};this.handleBackButtonClick=()=>{var e;(e=this.parentPopover)===null||e===void 0?void 0:e.openFromChild();this.open=false};this.initPopperJS=()=>{var e;const t=(e=this.el.shadowRoot)===null||e===void 0?void 0:e.querySelector(".ic-popover-menu");if(this.anchorEl){this.popperInstance=l(this.anchorEl,t,Object.assign({strategy:this.fixedPositioning?"fixed":"absolute",placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,4]}},{name:"flip",options:{fallbackPlacements:["top-start","top-end","bottom-end"],rootBoundary:"viewport"}}]},this.popperProps))}}}watchOpenHandler(){var e;const t=(e=this.el.parentElement)===null||e===void 0?void 0:e.querySelectorAll(`ic-popover-menu`);if(this.open){if(t.length>0){t.forEach((e=>{if(e!==this.el){e.open=false}}))}if(this.parentPopover!==undefined&&!this.popoverMenuEls.some((e=>e.id))){this.backButton&&this.popoverMenuEls.unshift(this.backButton)}this.currentFocus=0;setTimeout(this.setButtonFocus,50)}else if(this.popperInstance){if(t.length>0){t.forEach((e=>{if(e!==this.el){e.open=false}}))}this.popperInstance.destroy();this.popperInstance=null}}disconnectedCallback(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}}componentDidLoad(){var e;const t=(e=this.el.shadowRoot)===null||e===void 0?void 0:e.querySelector(d);if(t){const e=n(t);if(e!==null){this.addMenuItems(e)}}if(this.submenuId===undefined&&this.el.getAttribute(this.ARIA_LABEL)===null){console.error(`No aria-label specified for popover menu component - aria-label required`)}this.watchOpenHandler()}componentWillRender(){const e=this.el.querySelector('[slot="anchor"]');if(e){this.anchorEl=e}else{this.anchorEl=this.findAnchorEl(this.anchor)}}componentDidRender(){if(this.open&&!this.popperInstance){this.initPopperJS()}}handleMenuItemClick(e){if(!e.detail.submenuTriggerFor&&e.detail.label!=="Back"){this.closeMenu(false,e.detail)}}handleSubmenuChange(e){const t=e.target;this.open=false;const i=document.querySelector(`ic-popover-menu[submenu-id=${t.submenuTriggerFor}]`);i.parentPopover=this.el;i.anchor=this.anchor;i.ariaLabel=this.el.getAttribute(this.ARIA_LABEL);i.openFromParent();i.submenuLevel=this.submenuLevel+1;i.parentLabel=t.label}handleClick(e){if(this.open&&this.isNotPopoverMenuEl(e)){this.closeMenu()}}handleKeyDown(e){switch(e.key){case"ArrowDown":case"ArrowUp":e.preventDefault();this.currentFocus=this.getNextItemToSelect(this.currentFocus,e.key==="ArrowDown");this.setButtonFocus();break;case"Home":this.currentFocus=0;this.setButtonFocus();break;case"End":this.currentFocus=this.popoverMenuEls.length-1;this.setButtonFocus();break;case"Escape":case"Tab":e.preventDefault();if(this.open){this.closeMenu(true);this.el.blur()}break}}async openFromChild(){this.open=true;this.openingFromChild=true;setTimeout((()=>this.openingFromChild=false),1e3)}async openFromParent(){this.open=true;this.openingFromParent=true;setTimeout((()=>this.openingFromParent=false),1e3)}async closeMenu(e=false,t){var i;this.open=false;if(this.parentPopover){this.parentPopover.closeMenu(e,t)}else{if(e){(i=this.anchorEl)===null||i===void 0?void 0:i.focus()}this.icPopoverClosed.emit(t)}}async setExternalPopperProps(e){this.popperProps=e}render(){return i(o,{key:"7f6ecb546f399d0b1b5da98ede2923e196314f54",class:{[`ic-theme-${this.theme}`]:this.theme!=="inherit"}},r(this.el,"anchor")&&i("slot",{key:"70e80e8ce605af1076d48399bd19ef337fba4e69",name:"anchor"}),i("div",{key:"d5bae4e0dc2318a501855154eb6f8f904eba823e",class:{["ic-popover-menu"]:true,["ic-popover-menu-open"]:!!this.open}},i("div",{key:"552017695fedbac167dfba7972a93ec8fded05ed",id:this.parentPopover===undefined?`ic-popover-submenu-${this.submenuId}`:"",class:{menu:true}},i("span",{key:"d7acdf61f5003080acfb2fcfb906ade2ea029285",class:{"opening-from-parent":this.openingFromParent,"opening-from-child":this.openingFromChild}},a(this.submenuId)&&i("span",{key:"25b80b6353fb4e169c7af7738a5c14ce7284431c"},i("span",{key:"2241c3237bf2c032768b13560e1d2fc64d65491b",role:"menu"},i("ic-menu-item",{key:"814abfe87aa94ed2d6422b0e8c8186f77415370b",class:"ic-popover-submenu-back-button",ref:e=>this.backButton=e,label:"Back",onClick:this.handleBackButtonClick,id:`ic-popover-submenu-back-button-${this.submenuLevel}`},i("svg",{key:"5489c92487057e827a2ddc0b7ae3117ead6914ac",slot:"icon",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"submenu-back-icon"},i("path",{key:"ad3b776b8cd8272231f98fa5e3826ceace0c81a2",d:"M20 11H7.83L13.42 5.41L12 4L4 12L12 20L13.41 18.59L7.83 13H20V11Z",fill:"currentColor"})))),i("ic-typography",{key:"d78a1a238211a3676b5f0cbc2f0f0565914915c8",variant:"subtitle-small",class:"parent-label"},this.parentLabel)),i("div",{key:"9e4590864d5595d7bcdd13a7a193f6ad5b3f3f5c",class:"menu-body","aria-label":this.getMenuAriaLabel(),role:"menu"},i("slot",{key:"c2a730872a8782847df15906996d290d2d0b23a5"}))))))}static get delegatesFocus(){return true}get el(){return s(this)}static get watchers(){return{open:["watchOpenHandler"]}}};p.style=h;export{p as ic_popover_menu};
|
|
2
|
+
//# sourceMappingURL=p-56ab6fb7.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["icPopoverMenuCss","IcPopoverMenuStyle0","MENU_SELECTOR","PopoverMenu","constructor","hostRef","this","ARIA_LABEL","popoverMenuEls","openingFromChild","openingFromParent","popperProps","fixedPositioning","submenuLevel","theme","open","undefined","setButtonFocus","_a","currentFocus","focus","findAnchorEl","anchor","anchorElement","submenuId","console","error","document","querySelector","indexOf","isNotPopoverMenuEl","ev","target","id","tagName","isAnchor","anchorEl","getNextItemToSelect","currentItem","movingDown","numButtons","length","nextItem","addMenuItems","elements","i","el","push","groupSlotWrapper","shadowRoot","menuGroupElements","getSlotElements","getMenuAriaLabel","ariaLabel","getAttribute","menuAriaLabel","removeAttribute","isPropDefined","parentLabel","handleBackButtonClick","parentPopover","openFromChild","initPopperJS","popoverMenu","popperInstance","createPopper","Object","assign","strategy","placement","modifiers","name","options","offset","fallbackPlacements","rootBoundary","watchOpenHandler","popoverArr","parentElement","querySelectorAll","forEach","popover","some","menuItem","backButton","unshift","setTimeout","destroy","disconnectedCallback","componentDidLoad","slotWrapper","popoverMenuElements","componentWillRender","slottedAnchor","componentDidRender","handleMenuItemClick","detail","submenuTriggerFor","label","closeMenu","handleSubmenuChange","childEl","openFromParent","handleClick","handleKeyDown","key","preventDefault","blur","setFocusToAnchor","menuElement","icPopoverClosed","emit","setExternalPopperProps","props","render","h","Host","class","isSlotUsed","menu","role","ref","onClick","slot","viewBox","fill","xmlns","d","variant"],"sources":["src/components/ic-popover-menu/ic-popover-menu.css?tag=ic-popover-menu&encapsulation=shadow","src/components/ic-popover-menu/ic-popover-menu.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n/**\n* @prop --ic-z-index-popover: z-index of popover menu. \n* @prop --max-height: Maximum height of the popover menu.\n* @prop --popover-width: Default width of the popover menu.\n*/\n\n@media (prefers-reduced-motion: no-preference) {\n :host .opening-from-parent {\n animation: slide-in var(--ic-transition-duration-slow) ease-in-out;\n }\n\n :host .opening-from-child {\n animation: slide-out var(--ic-transition-duration-slow) ease-in-out;\n }\n}\n\n:host .ic-popover-menu {\n border-radius: var(--ic-border-radius);\n color: var(--ic-popover-nav-text);\n\n --ic-typography-color: var(--ic-popover-nav-text);\n\n position: relative;\n z-index: var(--ic-z-index-popover);\n box-sizing: border-box;\n box-shadow: var(--ic-elevation-overlay);\n display: none;\n}\n\n:host(.on-dialog) {\n inset: auto !important;\n}\n\n:host(.on-dialog-fix-translate) {\n transform: translate(0, var(--ic-space-xs)) !important;\n}\n\n:host(.on-dialog-translate-y) {\n transform: translate(0, calc(-1 * var(--translate-y))) !important;\n}\n\n.menu {\n border: var(--ic-border-default);\n border-color: var(--ic-popover-border);\n border-radius: var(--ic-border-radius);\n background-color: var(--ic-popover-background);\n visibility: hidden;\n height: 0;\n display: flex;\n flex-direction: column;\n}\n\n:host .ic-popover-menu:focus-within {\n box-shadow: var(--ic-border-focus);\n}\n\n.menu:focus-visible {\n outline: none;\n}\n\n:host .ic-popover-menu-open {\n display: block;\n min-width: calc(20rem - var(--ic-space-xl));\n width: var(--popover-width, 20rem);\n max-width: calc(100vw - var(--ic-space-xl));\n}\n\n:host .ic-popover-menu-open .menu {\n visibility: visible;\n height: fit-content;\n max-height: var(--max-height, fit-content);\n overflow-y: auto;\n overflow-x: hidden;\n}\n\n.parent-label {\n --ic-typography-color: var(--ic-popover-parent-label);\n\n margin: var(--ic-space-xs) var(--ic-space-xs) 0;\n}\n\n@keyframes slide-in {\n from {\n opacity: 0;\n transform: translateX(10rem);\n }\n\n to {\n opacity: 1;\n transform: translateX(0);\n }\n}\n\n@keyframes slide-out {\n from {\n opacity: 0;\n transform: translateX(-10rem);\n }\n\n to {\n opacity: 1;\n transform: translateX(0);\n }\n}\n","import {\n Component,\n Element,\n Host,\n h,\n Prop,\n Listen,\n Watch,\n State,\n Method,\n Event,\n EventEmitter,\n} from \"@stencil/core\";\nimport {\n getSlotElements,\n isPropDefined,\n isSlotUsed,\n} from \"../../utils/helpers\";\nimport {\n createPopper,\n Instance as PopperInstance,\n Options,\n} from \"@popperjs/core\";\nimport { IcThemeMode } from \"../../utils/types\";\n\nconst MENU_SELECTOR = \"div.menu-body\";\n\n/**\n * @slot anchor - The default anchor element for the popover menu. This will take precedence over the `anchor` prop.\n */\n@Component({\n tag: \"ic-popover-menu\",\n styleUrl: \"ic-popover-menu.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class PopoverMenu {\n private anchorEl: HTMLElement | null;\n private ARIA_LABEL: string = \"aria-label\";\n private backButton?: HTMLIcMenuItemElement;\n private currentFocus: number;\n private popoverMenuEls: HTMLIcMenuItemElement[] = [];\n private popperInstance: PopperInstance | null;\n private menuAriaLabel?: string;\n\n @Element() el: HTMLIcPopoverMenuElement;\n\n @State() openingFromChild: boolean = false;\n @State() openingFromParent: boolean = false;\n @State() popperProps: Partial<Options> = {};\n\n /**\n * The ID of the element the popover menu will anchor itself to. This is required unless the popover is a submenu.\n */\n @Prop() anchor?: string;\n\n /**\n * Setting to `true` can help in situations where tooltip content is clipped by a parent element.\n */\n @Prop() fixedPositioning: boolean = false;\n\n /**\n * @internal The parent popover menu of a child popover menu.\n */\n @Prop() parentLabel?: string;\n\n /**\n * @internal The parent popover menu of a child popover menu.\n */\n @Prop() parentPopover?: HTMLIcPopoverMenuElement;\n\n /**\n * The unique identifier for a popover submenu.\n */\n @Prop() submenuId?: string;\n\n /**\n * @internal The level of menu being displayed.\n */\n @Prop() submenuLevel?: number = 1;\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop() theme?: IcThemeMode = \"inherit\";\n\n /**\n * If `true`, the popover menu will be displayed.\n */\n @Prop({ reflect: true, mutable: true }) open?: boolean | undefined =\n undefined;\n\n @Watch(\"open\")\n watchOpenHandler(): void {\n const popoverArr = this.el.parentElement?.querySelectorAll(\n `ic-popover-menu`\n ) as NodeListOf<HTMLIcPopoverMenuElement>;\n if (this.open) {\n if (popoverArr.length > 0) {\n popoverArr.forEach((popover) => {\n if (popover !== this.el) {\n popover.open = false;\n }\n });\n }\n if (\n this.parentPopover !== undefined &&\n !this.popoverMenuEls.some((menuItem) => menuItem.id)\n ) {\n this.backButton && this.popoverMenuEls.unshift(this.backButton);\n }\n\n this.currentFocus = 0;\n // Needed so that anchorEl isn't always focused\n setTimeout(this.setButtonFocus, 50);\n } else if (this.popperInstance) {\n if (popoverArr.length > 0) {\n popoverArr.forEach((popover) => {\n if (popover !== this.el) {\n popover.open = false;\n }\n });\n }\n this.popperInstance.destroy();\n this.popperInstance = null;\n }\n }\n\n /**\n * Emitted when the popover menu is closed.\n */\n @Event() icPopoverClosed: EventEmitter<HTMLIcMenuItemElement>;\n\n disconnectedCallback(): void {\n if (this.popperInstance) {\n this.popperInstance.destroy();\n this.popperInstance = null;\n }\n }\n\n componentDidLoad(): void {\n const slotWrapper = this.el.shadowRoot?.querySelector(MENU_SELECTOR);\n if (slotWrapper) {\n const popoverMenuElements = getSlotElements(slotWrapper);\n\n if (popoverMenuElements !== null) {\n this.addMenuItems(popoverMenuElements);\n }\n }\n\n if (\n this.submenuId === undefined &&\n this.el.getAttribute(this.ARIA_LABEL) === null\n ) {\n console.error(\n `No aria-label specified for popover menu component - aria-label required`\n );\n }\n\n this.watchOpenHandler();\n }\n\n componentWillRender(): void {\n const slottedAnchor = this.el.querySelector(\n '[slot=\"anchor\"]'\n ) as HTMLElement | null;\n\n if (slottedAnchor) {\n this.anchorEl = slottedAnchor;\n } else {\n this.anchorEl = this.findAnchorEl(this.anchor);\n }\n }\n\n componentDidRender(): void {\n if (this.open && !this.popperInstance) {\n this.initPopperJS();\n }\n }\n\n @Listen(\"handleMenuItemClick\")\n handleMenuItemClick(ev: CustomEvent<HTMLIcMenuItemElement>): void {\n if (!ev.detail.submenuTriggerFor && ev.detail.label !== \"Back\") {\n this.closeMenu(false, ev.detail);\n }\n }\n\n // This is listening for the event emitted when a menu item is acting as a trigger button\n @Listen(\"triggerPopoverMenuInstance\", { capture: true })\n handleSubmenuChange(ev: Event): void {\n // Finds the trigger menu item that has emitted the event\n const target = ev.target as HTMLIcMenuItemElement;\n this.open = false;\n\n // Find the popover menu that the menu item triggers (i.e. submenu-trigger-for === submenu-id).\n const childEl = document.querySelector(\n `ic-popover-menu[submenu-id=${target.submenuTriggerFor}]`\n ) as HTMLIcPopoverMenuElement;\n // Set the parent popover menu of the submenu and open the submenu\n childEl.parentPopover = this.el;\n childEl.anchor = this.anchor;\n childEl.ariaLabel = this.el.getAttribute(this.ARIA_LABEL);\n childEl.openFromParent();\n childEl.submenuLevel = this.submenuLevel! + 1;\n // Set the label in the submenu using the label of the menu item that has emitted the event\n childEl.parentLabel = target.label;\n }\n\n @Listen(\"click\", { target: \"document\" })\n handleClick(ev: Event): void {\n if (this.open && this.isNotPopoverMenuEl(ev)) {\n // If menu is open and the next click on the document is not a popover El, close the popover\n this.closeMenu();\n }\n }\n\n // Manages the keyboard navigation in the popover menu\n @Listen(\"keydown\", {})\n handleKeyDown(ev: KeyboardEvent): void {\n switch (ev.key) {\n case \"ArrowDown\":\n case \"ArrowUp\":\n ev.preventDefault();\n this.currentFocus = this.getNextItemToSelect(\n this.currentFocus,\n ev.key === \"ArrowDown\"\n );\n this.setButtonFocus();\n break;\n case \"Home\":\n //Sets home focus as first element, or back button\n this.currentFocus = 0;\n this.setButtonFocus();\n break;\n case \"End\":\n //Sets end focus as last element\n this.currentFocus = this.popoverMenuEls.length - 1;\n this.setButtonFocus();\n break;\n case \"Escape\":\n case \"Tab\":\n ev.preventDefault();\n if (this.open) {\n this.closeMenu(true);\n this.el.blur();\n }\n break;\n }\n }\n\n /**\n * @internal Opens the menu from the child menu.\n */\n @Method()\n async openFromChild(): Promise<void> {\n this.open = true;\n this.openingFromChild = true;\n\n setTimeout(() => (this.openingFromChild = false), 1000);\n }\n\n /**\n * @internal Opens the menu from the parent menu.\n */\n @Method()\n async openFromParent(): Promise<void> {\n this.open = true;\n this.openingFromParent = true;\n\n setTimeout(() => (this.openingFromParent = false), 1000);\n }\n\n private setButtonFocus = () => {\n this.popoverMenuEls[this.currentFocus]?.focus();\n };\n\n // Checks that the popover menu has an anchor\n private findAnchorEl = (anchor: string | undefined): HTMLElement | null => {\n let anchorElement: HTMLElement | null = null;\n if (!anchor) {\n this.submenuId === undefined &&\n console.error(\"No anchor specified for popover component\");\n } else {\n anchorElement = document.querySelector(\n anchor.indexOf(\"#\") === 0 ? anchor : \"#\" + anchor\n );\n if (anchorElement === null) {\n console.error(`Popover anchor element '${anchor}' not found`);\n }\n }\n return anchorElement;\n };\n\n private isNotPopoverMenuEl = (ev: Event) => {\n const target = ev.target as HTMLElement;\n const { id, tagName } = target;\n const isAnchor = this.anchorEl && target === this.anchorEl;\n return (\n !isAnchor &&\n id !== this.anchor &&\n tagName !== \"IC-MENU-ITEM\" &&\n tagName !== \"IC-MENU-GROUP\" &&\n tagName !== \"IC-POPOVER-MENU\"\n );\n };\n\n /**\n * @internal Close the menu, emit icPopoverClosed of the root popover\n * @param setFocusToAnchor when true return focus to anchor element when menu is closed\n */\n @Method()\n async closeMenu(\n setFocusToAnchor = false,\n menuElement?: HTMLIcMenuItemElement\n ): Promise<void> {\n this.open = false;\n if (this.parentPopover) {\n this.parentPopover.closeMenu(setFocusToAnchor, menuElement);\n } else {\n if (setFocusToAnchor) {\n this.anchorEl?.focus();\n }\n this.icPopoverClosed.emit(menuElement);\n }\n }\n\n /**\n * @internal This method allows props to be added to the PopperJS createPopper instance outside of the popover menu\n * @param props object - createPopper props set externally\n */\n @Method()\n async setExternalPopperProps<T extends Partial<Options>>(props: T) {\n this.popperProps = props;\n }\n\n private getNextItemToSelect = (\n currentItem: number,\n movingDown: boolean\n ): number => {\n const numButtons = this.popoverMenuEls.length - 1;\n\n if (currentItem < 1) {\n currentItem = 0;\n }\n\n let nextItem = movingDown ? currentItem + 1 : currentItem - 1;\n\n // Check if wrap around necessary\n if (nextItem < 0) {\n nextItem = numButtons;\n } else if (nextItem > numButtons) {\n nextItem = 0;\n }\n\n return nextItem;\n };\n\n private addMenuItems = (elements: Element[] | NodeListOf<ChildNode>) => {\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i] as HTMLIcMenuItemElement;\n if (el.tagName === \"IC-MENU-ITEM\") {\n this.popoverMenuEls.push(el);\n } else if (el.tagName === \"IC-MENU-GROUP\") {\n const groupSlotWrapper = el.shadowRoot?.querySelector(\n \".menu-items-wrapper\"\n );\n if (groupSlotWrapper) {\n const menuGroupElements = getSlotElements(groupSlotWrapper);\n menuGroupElements && this.addMenuItems(menuGroupElements);\n }\n }\n }\n };\n\n private getMenuAriaLabel = (): string | null => {\n let ariaLabel = this.el.getAttribute(this.ARIA_LABEL);\n if (ariaLabel) {\n this.menuAriaLabel = ariaLabel;\n this.el.removeAttribute(this.ARIA_LABEL);\n } else if (this.menuAriaLabel) {\n ariaLabel = this.menuAriaLabel;\n }\n if (!ariaLabel) return null;\n if (isPropDefined(this.submenuId)) {\n return `${ariaLabel}, within nested level ${this.submenuLevel} ${this.parentLabel} submenu,`;\n } else {\n return ariaLabel;\n }\n };\n\n private handleBackButtonClick = (): void => {\n this.parentPopover?.openFromChild();\n this.open = false;\n };\n\n private initPopperJS = () => {\n const popoverMenu = this.el.shadowRoot?.querySelector(\n \".ic-popover-menu\"\n ) as HTMLElement;\n if (this.anchorEl) {\n this.popperInstance = createPopper(this.anchorEl, popoverMenu, {\n strategy: this.fixedPositioning ? \"fixed\" : \"absolute\",\n placement: \"bottom-start\",\n modifiers: [\n {\n name: \"offset\",\n options: {\n offset: [0, 4],\n },\n },\n {\n name: \"flip\",\n options: {\n fallbackPlacements: [\"top-start\", \"top-end\", \"bottom-end\"],\n rootBoundary: \"viewport\",\n },\n },\n ],\n ...this.popperProps,\n });\n }\n };\n\n render() {\n return (\n <Host\n class={{\n [`ic-theme-${this.theme}`]: this.theme !== \"inherit\",\n }}\n >\n {isSlotUsed(this.el, \"anchor\") && <slot name=\"anchor\"></slot>}\n <div\n class={{\n [\"ic-popover-menu\"]: true,\n [\"ic-popover-menu-open\"]: !!this.open,\n }}\n >\n <div\n id={\n this.parentPopover === undefined\n ? `ic-popover-submenu-${this.submenuId}`\n : \"\"\n }\n class={{\n menu: true,\n }}\n >\n <span\n class={{\n \"opening-from-parent\": this.openingFromParent,\n \"opening-from-child\": this.openingFromChild,\n }}\n >\n {isPropDefined(this.submenuId) && (\n <span>\n <span role=\"menu\">\n <ic-menu-item\n class=\"ic-popover-submenu-back-button\"\n ref={(el) => (this.backButton = el)}\n label=\"Back\"\n onClick={this.handleBackButtonClick}\n id={`ic-popover-submenu-back-button-${this.submenuLevel}`}\n >\n <svg\n slot=\"icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"submenu-back-icon\"\n >\n <path\n d=\"M20 11H7.83L13.42 5.41L12 4L4 12L12 20L13.41 18.59L7.83 13H20V11Z\"\n fill=\"currentColor\"\n />\n </svg>\n </ic-menu-item>\n </span>\n <ic-typography variant=\"subtitle-small\" class=\"parent-label\">\n {this.parentLabel}\n </ic-typography>\n </span>\n )}\n <div\n class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KAAKqD,sBACd1B,GAAI,kCAAkC3B,KAAKO,gBAE3CsG,EAAA,OAAAV,IAAA,2CACEkB,KAAK,OACLC,QAAQ,YACRC,KAAK,OACLC,MAAM,6BACNT,MAAM,qBAENF,EAAA,QAAAV,IAAA,2CACEsB,EAAE,oEACFF,KAAK,oBAKbV,EAAA,iBAAAV,IAAA,2CAAeuB,QAAQ,iBAAiBX,MAAM,gBAC3C/G,KAAKoD,cAIZyD,EAAA,OAAAV,IAAA,2CACEY,MAAM,YAAW,aACL/G,KAAK8C,mBACjBoE,KAAK,QAELL,EAAA,QAAAV,IAAA,iD","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,h as t,H as a,g as c}from"./p-8e4e97b4.js";import{C as s}from"./p-c2e091d7.js";import{e as i,i as r}from"./p-eeb8d98a.js";import"./p-6215e2ae.js";const o=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.99935 4.32666L13.0193 13H2.97935L7.99935 4.32666ZM7.99935 1.66666L0.666016 14.3333H15.3327L7.99935 1.66666ZM8.66602 11H7.33268V12.3333H8.66602V11ZM8.66602 6.99999H7.33268V9.66666H8.66602V6.99999Z" fill="currentColor"/>\n</svg>`;const n=':host{display:flex;flex:auto;--ic-typography-color:currentcolor}.step{display:flex;flex:1 1 0}.step-icon{display:flex;justify-content:center}.heading,::slotted([slot="heading"]),.subheading,.step-status,.next-step{white-space:pre-line}.next-step{color:var(--ic-stepper-compact-step-next-text)}.visually-hidden{position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden}.visually-hidden:dir(rtl){right:-9999px}:host(.ic-step-compact){-moz-column-gap:var(--ic-space-sm);column-gap:var(--ic-space-sm);--compact-step-inner-color:var(--ic-step-indicator-status-current);--compact-step-outer-color:var(--ic-step-indicator-status-remaining);--compact-step-circular-line-width:var(--ic-space-xxs)}:host(.ic-step-compact) .step{-moz-column-gap:var(--ic-space-sm);column-gap:var(--ic-space-sm)}:host(.ic-step-compact) .step:not(.current){display:none;opacity:0;visibility:hidden}.compact-step-progress-indicator{margin:var(--ic-space-xs) 0 0}:host ic-loading-indicator::part(ic-loading-container){border-radius:50%}:host() ic-loading-indicator::part(ic-loading-container){background-color:var(--ic-step-indicator-background)}:host(.ic-step-compact) .heading-area{display:flex;flex-direction:column;width:14.25rem}:host(.ic-step-compact) .heading,:host(.ic-step-compact) ::slotted([slot="heading"]){color:var(--ic-stepper-compact-step-title)}:host(.ic-step-compact) .disabled .heading,:host(.ic-step-compact) .disabled ::slotted([slot="heading"]){color:var(--ic-stepper-compact-step-title-disabled)}.info-line{display:flex;-moz-column-gap:var(--ic-space-xs);column-gap:var(--ic-space-xs)}.step-status{display:flex;color:var(--ic-stepper-compact-step-requirement-text);-moz-column-gap:var(--ic-space-xxxs);column-gap:var(--ic-space-xxxs)}.compact-step-completed .step-status{color:var(--ic-stepper-compact-step-completed-text)}.compact-step-disabled :is(.heading,.step-status){color:var(--ic-stepper-compact-step-requirement-text-disabled)}.step-num{color:var(--ic-stepper-compact-step-stage-text);white-space:nowrap}:host(.ic-step-compact) .step-icon{margin:var(--ic-space-xxxs)}:host(.ic-step-compact) .step-icon svg{width:var(--ic-space-md);height:var(--ic-space-md)}:host(.ic-step-default) .step{flex-direction:column}:host(.ic-step-default.last-step){flex-grow:initial}.step-top{display:flex;width:100%;align-items:center;align-self:flex-start;height:2.5rem}:host(.ic-step-default) .step-icon{border-radius:50%;background-color:var(--ic-step-number-inactive)}.step-icon-inner{width:var(--ic-space-xl);height:var(--ic-space-xl);display:flex;justify-content:center;align-items:center;border-radius:50%;color:var(--ic-step-number-text-inactive)}:host(.ic-step-default) .current{color:var(--ic-status-info-default)}:host(.ic-step-default) .heading-area{margin:var(--ic-space-xs) 0;padding-right:var(--ic-space-xs);width:100%}:host(.ic-step-default) .heading,:host(.ic-step-default) ::slotted([slot="heading"]),.subheading{width:-moz-fit-content;width:fit-content}.heading,::slotted([slot="heading"]){color:var(--ic-step-title)}.current .heading,.current ::slotted([slot="heading"]){color:var(--ic-step-title-current)}.completed .heading,.completed ::slotted([slot="heading"]){color:var(--ic-step-title-success)}.disabled .heading,.disabled ::slotted([slot="heading"]){color:var(--ic-step-title-disabled)}.subheading{color:var(--ic-step-title-status-text-inactive)}.current .subheading{color:var(--ic-step-title-status-text-current)}.disabled .subheading{color:var(--ic-step-title-status-text-disabled)}:host(.ic-step-default) .completed{color:var(--ic-status-success-default)}.active .step-icon-inner{box-shadow:inset var(--ic-step-number-inactive-outline) 0 0 0 0.125rem}.current .step-icon-inner{background-color:var(--ic-step-number-background-active);color:var(--ic-step-number-text-current)}.disabled{color:var(--ic-color-text-disabled-mid)}.disabled .step-icon-inner{border:var(--ic-border-width) dashed var(--ic-step-number-disabled);width:calc(var(--ic-space-xl) - var(--ic-space-xxxs));height:calc(var(--ic-space-xl) - var(--ic-space-xxxs));color:var(--ic-step-number-text-disabled)}.disabled .step-icon{background-color:transparent !important}.completed .step-icon-inner{background:var(--ic-step-number-background-success);box-shadow:inset var(--ic-step-number-background-success) 0 0 0\n var(--ic-space-xxxs);border-radius:100%}:host(.ic-step-default) .current .step-icon{border:var(--ic-space-xxxs) solid var(--ic-step-number-current-outline);padding:var(--ic-space-xxxs);margin:0 calc(-1 * var(--ic-space-xxxs));background-color:var(--ic-step-number-current-outer-fill);}.step-connect{height:var(--ic-space-xxxs);background-color:var(--ic-stepper-connector-remaining-status);margin:0 var(--ic-space-xs);border-radius:var(--ic-space-xxs);width:100%}.aligned-full-width.step-connect{min-width:6.25rem;width:100%}.disabled .step-connect{height:0;background-color:rgb(0 0 0 / 0%);border-top:0.125rem dashed var(--ic-stepper-connector-disabled);border-radius:0}.completed .step-connect{background-color:var(--ic-stepper-connector-success)}.step-connect-inner{width:70%;display:flex;flex:auto;height:var(--ic-space-xxxs);border-radius:var(--ic-space-xxs);background-color:var(--ic-stepper-connector-current-status)}.step-icon-inner .check-icon{padding-top:var(--ic-space-xxs)}.step-icon-inner .check-icon svg{width:var(--ic-space-md);height:auto}.step-icon-inner .check-icon>svg>path{fill:var(--ic-step-number-icon-success)}@media (forced-colors: active){.compact-step-disabled :is(.heading,.step-status){color:GrayText}.step-connect:not(.disabled .step-connect){border:var(--ic-border-hc)}.active .step-icon-inner,.completed .step-icon-inner,.current .step-icon-inner{forced-color-adjust:none;box-shadow:inset canvastext 0 0 0 0.125rem;background-color:transparent;color:canvastext}:host(.ic-step-default) .current .step-icon{padding:0;border:none}.disabled,.disabled .heading-area,.disabled .step-icon-inner,.disabled .heading,.disabled ::slotted([slot="heading"]){color:GrayText}.step-connect-inner,.completed .step-connect{background-color:canvastext}.step-icon-inner .check-icon>svg>path{fill:canvastext}}';const d=n;const p=class{constructor(t){e(this,t);this.current=false;this.icI18n={next:"Next",step:"Step",steps:"Steps",of:"of",lastStep:"Last step",completed:"Completed",notRequired:"Not required",required:"Required",optional:"Optional"};this.theme="inherit";this.type="active"}typeChangeHandler(){if(this.variant==="compact"&&this.type==="current"){this.current=true}else{this.current=false}}render(){var e,c;const{compactStepStyling:n,current:d,heading:p,icI18n:l,lastStep:h,lastStepNum:u,nextStepHeading:b,progress:f,status:g,stepNum:m,subheading:v,theme:x,type:y,variant:k}=this;let w="";const $=i(p)&&p!==""||r(this.el,"heading");if(y==="completed"){w=`. ${l.completed}`}else if(y==="disabled"){w=`. ${l.notRequired}`}else if(g==="required"){w=`. ${l.required}`}else if(g==="optional"){w=`. ${l.optional}`}let H;if(g&&i(g)){H=g[0].toUpperCase()+g.slice(1)}let q;if(y==="disabled"||n==="disabled"){q=l.notRequired}else if(n==="completed"){q=l.completed}let L;if(y==="completed"||n==="completed"){L=t("span",{key:"4d1011a9a12449bd324aff3f404522fde6912be3",class:"check-icon step-icon","aria-hidden":"true",innerHTML:s})}else if(y==="disabled"||n==="disabled"){L=t("span",{key:"7825f61e87546bcaa9100c439239022abb0f3eb7",class:"warning-icon step-icon","aria-hidden":"true",innerHTML:o})}const S=t("div",{key:"82c7c26c90ce286582f7ef477129d2ce241200c1",class:{["step"]:true,["current"]:!!d,[`compact-step-${n}`]:!!n,["disabled"]:y==="disabled"||n==="disabled"}},t("ic-loading-indicator",{key:"d3d1b2aa382bd8b307433f16aa05f644b275902f",class:{"compact-step-progress-indicator":true,"not-required":y==="disabled"||n==="disabled"},"aria-hidden":"true",size:"small","inner-label":m,progress:f}),t("div",{key:"d0f78f477b4fe29b2ac33798712b70c0c3d2ce41",class:"heading-area"},r(this.el,"heading")?t("slot",{name:"heading"}):t("ic-typography",{variant:"h4",class:"heading"},p),t("div",{key:"f9a074c126d393ec82cf72621e5941c32dbd72fb",class:"info-line"},t("ic-typography",{key:"1b6bd91bcb1013fa1e23a9e9af49d3da1f25448e",variant:"caption",class:"step-num"},`${m} ${l.of} ${u}`,t("span",{key:"753bbc4c12a2b968cde11238f46ff4ffbc4f39fd",class:"visually-hidden"},` ${l.steps}`)),(this.subheading||y==="completed"||y==="disabled"||this.variant==="compact"&&!!n&&n!=="active"||!!g)&&t("div",{key:"93968f9752cf90df5f67994a3942f38d94323b50",class:"step-status"},L!==undefined&&L,(v||q)&&t("ic-typography",{key:"d1879f9dc5a7ea2e9b468fc95593056527e08095",variant:"caption"},v!==null&&i(v)?v:y==="disabled"||k==="compact"&&n==="disabled"||y==="completed"||k==="compact"&&n==="completed"?q:g&&H))),h?t("ic-typography",{variant:"subtitle-small",class:"next-step"},l.lastStep):i(b)&&t("ic-typography",{variant:"subtitle-small",class:"next-step"},l.next,t("span",{class:"visually-hidden"}," ",l.step),":"," ",this.nextStepHeading)));let j;if(y!=="completed"){j=t("ic-typography",{key:"e76d3c6f2fc82ae27e9f19af2ad29374c75271b1",variant:"subtitle-small"},t("span",{key:"2ada7f696f0e90ecca298a2109d9aaeb70777a1a",class:"step-icon-inner","aria-hidden":"true"},this.stepNum))}else{j=t("div",{key:"195a5f5dd31061a4059020d7fa1d65b15eb29a11",class:"step-icon-inner","aria-hidden":"true"},t("span",{key:"d11d3bf512968fa286309bcd69faa20cd12d3396",class:"check-icon",innerHTML:s}))}const M=y==="current"&&t("div",{key:"5564ceeb1d40367572f3ae679e7212a2a2a53578",class:"step-connect-inner"});const z=!h&&t("div",{key:"fae846f5c7d46ad65c7d21a2785526ed6d841444",class:{["step-connect"]:true,["aligned-full-width"]:!!(((e=this.el.parentElement)===null||e===void 0?void 0:e.classList.contains("ic-stepper-default"))&&!this.el.parentElement.classList.contains("ic-stepper-aligned-left"))}},M);const C=t("div",{key:"f02d7139a59a46207e7bd308cf90ffd42c14a93e",class:{["step"]:true,[`${y}`]:true}},t("div",{key:"d3cb91eb9ae01c50255fefe75c9cf15dac9899a2",class:"step-top"},t("div",{key:"71afc47b70d57c6d98aacd824c304e661d97a97d",class:"step-icon"},j),z),($||v||g)&&t("div",{key:"7b11bdfc83c4071d6aff8f026e7ab32f2033a666",class:"heading-area"},r(this.el,"heading")?t("slot",{name:"heading"}):t("ic-typography",{variant:"subtitle-large",class:"heading"},p),$&&(v||g)&&t("ic-typography",{key:"10da1844c1af5252f89bc59254e23c45c5400a2d",variant:"caption",class:"subheading"},v!==null&&i(v)?v:H)));return t(a,{key:"6605252cf1e05ba81b2adbcf6e41f2c9c23b1f09",role:"listitem","aria-label":`${l.step} ${m}${w}`,"aria-current":(d||y==="current")&&"step",class:{["aligned-full-width"]:!!(((c=this.el.parentElement)===null||c===void 0?void 0:c.classList.contains("ic-stepper-default"))&&!this.el.parentElement.classList.contains("ic-stepper-aligned-left")),[`ic-step-${k}`]:true,[`ic-theme-${x}`]:this.theme!=="inherit"}},k==="compact"?S:C)}get el(){return c(this)}static get watchers(){return{type:["typeChangeHandler"]}}};p.style=d;export{p as ic_step};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,h as t,H as a,g as c}from"./p-8e4e97b4.js";import{C as s}from"./p-c2e091d7.js";import{e as i,i as r}from"./p-eeb8d98a.js";import"./p-6215e2ae.js";const o=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.99935 4.32666L13.0193 13H2.97935L7.99935 4.32666ZM7.99935 1.66666L0.666016 14.3333H15.3327L7.99935 1.66666ZM8.66602 11H7.33268V12.3333H8.66602V11ZM8.66602 6.99999H7.33268V9.66666H8.66602V6.99999Z" fill="currentColor"/>\n</svg>`;const n=':host{display:flex;flex:auto;--ic-typography-color:currentcolor}.step{display:flex;flex:1 1 0}.step-icon{display:flex;justify-content:center}.heading,::slotted([slot="heading"]),.subheading,.step-status,.next-step{white-space:pre-line}.next-step{color:var(--ic-stepper-compact-step-next-text)}.visually-hidden{position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden}.visually-hidden:dir(rtl){right:-9999px}:host(.ic-step-compact){-moz-column-gap:var(--ic-space-sm);column-gap:var(--ic-space-sm);--compact-step-inner-color:var(--ic-step-indicator-status-current);--compact-step-outer-color:var(--ic-step-indicator-status-remaining);--compact-step-circular-line-width:var(--ic-space-xxs)}:host(.ic-step-compact) .step{-moz-column-gap:var(--ic-space-sm);column-gap:var(--ic-space-sm)}:host(.ic-step-compact) .step:not(.current){display:none;opacity:0;visibility:hidden}.compact-step-progress-indicator{margin:var(--ic-space-xs) 0 0}:host ic-loading-indicator::part(ic-loading-container){border-radius:50%}:host() ic-loading-indicator::part(ic-loading-container){background-color:var(--ic-step-indicator-background)}:host(.ic-step-compact) .heading-area{display:flex;flex-direction:column;width:14.25rem}:host(.ic-step-compact) .heading,:host(.ic-step-compact) ::slotted([slot="heading"]){color:var(--ic-stepper-compact-step-title)}:host(.ic-step-compact) .disabled .heading,:host(.ic-step-compact) .disabled ::slotted([slot="heading"]){color:var(--ic-stepper-compact-step-title-disabled)}.info-line{display:flex;-moz-column-gap:var(--ic-space-xs);column-gap:var(--ic-space-xs)}.step-status{display:flex;color:var(--ic-stepper-compact-step-requirement-text);-moz-column-gap:var(--ic-space-xxxs);column-gap:var(--ic-space-xxxs)}.compact-step-completed .step-status{color:var(--ic-stepper-compact-step-completed-text)}.compact-step-disabled :is(.heading,.step-status){color:var(--ic-stepper-compact-step-requirement-text-disabled)}.step-num{color:var(--ic-stepper-compact-step-stage-text);white-space:nowrap}:host(.ic-step-compact) .step-icon{margin:var(--ic-space-xxxs)}:host(.ic-step-compact) .step-icon svg{width:var(--ic-space-md);height:var(--ic-space-md)}:host(.ic-step-default) .step{flex-direction:column}:host(.ic-step-default.last-step){flex-grow:initial}.step-top{display:flex;width:100%;align-items:center;align-self:flex-start;height:2.5rem}:host(.ic-step-default) .step-icon{border-radius:50%;background-color:var(--ic-step-number-inactive)}.step-icon-inner{width:var(--ic-space-xl);height:var(--ic-space-xl);display:flex;justify-content:center;align-items:center;border-radius:50%;color:var(--ic-step-number-text-inactive)}:host(.ic-step-default) .current{color:var(--ic-status-info-default)}:host(.ic-step-default) .heading-area{margin:var(--ic-space-xs) 0;padding-right:var(--ic-space-xs);width:100%}:host(.ic-step-default) .heading,:host(.ic-step-default) ::slotted([slot="heading"]),.subheading{width:-moz-fit-content;width:fit-content}.heading,::slotted([slot="heading"]){color:var(--ic-step-title)}.current .heading,.current ::slotted([slot="heading"]){color:var(--ic-step-title-current)}.completed .heading,.completed ::slotted([slot="heading"]){color:var(--ic-step-title-success)}.disabled .heading,.disabled ::slotted([slot="heading"]){color:var(--ic-step-title-disabled)}.subheading{color:var(--ic-step-title-status-text-inactive)}.current .subheading{color:var(--ic-step-title-status-text-current)}.disabled .subheading{color:var(--ic-step-title-status-text-disabled)}:host(.ic-step-default) .completed{color:var(--ic-status-success-default)}.active .step-icon-inner{box-shadow:inset var(--ic-step-number-inactive-outline) 0 0 0 0.125rem}.current .step-icon-inner{background-color:var(--ic-step-number-background-active);color:var(--ic-step-number-text-current)}.disabled{color:var(--ic-color-text-disabled-mid)}.disabled .step-icon-inner{border:var(--ic-border-width) dashed var(--ic-step-number-disabled);width:calc(var(--ic-space-xl) - var(--ic-space-xxxs));height:calc(var(--ic-space-xl) - var(--ic-space-xxxs));color:var(--ic-step-number-text-disabled)}.disabled .step-icon{background-color:transparent !important}.completed .step-icon-inner{background:var(--ic-step-number-background-success);box-shadow:inset var(--ic-step-number-background-success) 0 0 0\n var(--ic-space-xxxs);border-radius:100%}:host(.ic-step-default) .current .step-icon{border:var(--ic-space-xxxs) solid var(--ic-step-number-current-outline);padding:var(--ic-space-xxxs);margin:0 calc(-1 * var(--ic-space-xxxs));background-color:var(--ic-step-number-current-outer-fill);}.step-connect{height:var(--ic-space-xxxs);background-color:var(--ic-stepper-connector-remaining-status);margin:0 var(--ic-space-xs);border-radius:var(--ic-space-xxs);width:100%}.aligned-full-width.step-connect{min-width:6.25rem;width:100%}.disabled .step-connect{height:0;background-color:rgb(0 0 0 / 0%);border-top:0.125rem dashed var(--ic-stepper-connector-disabled);border-radius:0}.completed .step-connect{background-color:var(--ic-stepper-connector-success)}.step-connect-inner{width:70%;display:flex;flex:auto;height:var(--ic-space-xxxs);border-radius:var(--ic-space-xxs);background-color:var(--ic-stepper-connector-current-status)}.step-icon-inner .check-icon{padding-top:var(--ic-space-xxs)}.step-icon-inner .check-icon svg{width:var(--ic-space-md);height:auto}.step-icon-inner .check-icon>svg>path{fill:var(--ic-step-number-icon-success)}@media (forced-colors: active){.compact-step-disabled :is(.heading,.step-status){color:GrayText}.step-connect:not(.disabled .step-connect){border:var(--ic-border-hc)}.active .step-icon-inner,.completed .step-icon-inner,.current .step-icon-inner{forced-color-adjust:none;box-shadow:inset canvastext 0 0 0 0.125rem;background-color:transparent;color:canvastext}:host(.ic-step-default) .current .step-icon{padding:0;border:none}.disabled,.disabled .heading-area,.disabled .step-icon-inner,.disabled .heading,.disabled ::slotted([slot="heading"]){color:GrayText}.step-connect-inner,.completed .step-connect{background-color:canvastext}.step-icon-inner .check-icon>svg>path{fill:canvastext}}';const d=n;const p=class{constructor(t){e(this,t);this.current=false;this.icI18n={next:"Next",step:"Step",steps:"Steps",of:"of",lastStep:"Last step",completed:"Completed",notRequired:"Not required",required:"Required",optional:"Optional"};this.theme="inherit";this.type="active"}typeChangeHandler(){if(this.variant==="compact"&&this.type==="current"){this.current=true}else{this.current=false}}render(){var e,c;const{compactStepStyling:n,current:d,heading:p,icI18n:l,lastStep:h,lastStepNum:u,nextStepHeading:b,progress:g,status:f,stepNum:m,subheading:v,theme:x,type:y,variant:k}=this;let w="";const $=i(p)&&p!==""||r(this.el,"heading");if(y==="completed"){w=`. ${l.completed}`}else if(y==="disabled"){w=`. ${l.notRequired}`}else if(f==="required"){w=`. ${l.required}`}else if(f==="optional"){w=`. ${l.optional}`}let H;if(f&&i(f)){H=f[0].toUpperCase()+f.slice(1)}let q;if(y==="disabled"||n==="disabled"){q=l.notRequired}else if(n==="completed"){q=l.completed}let L;if(y==="completed"||n==="completed"){L=t("span",{key:"b90ba4eba47bd4dda8a547010d3e701f07e96ff1",class:"check-icon step-icon","aria-hidden":"true",innerHTML:s})}else if(y==="disabled"||n==="disabled"){L=t("span",{key:"46566361dcad0d5a29ad7f28fe2224f5ac813152",class:"warning-icon step-icon","aria-hidden":"true",innerHTML:o})}const S=t("div",{key:"f5f4f7d6a4923975cb16a023a128e948f6af8d37",class:{["step"]:true,["current"]:!!d,[`compact-step-${n}`]:!!n,["disabled"]:y==="disabled"||n==="disabled"}},t("ic-loading-indicator",{key:"9c68a687dfe74aef9d5402a22b849be5adde9e9e",class:{"compact-step-progress-indicator":true,"not-required":y==="disabled"||n==="disabled"},"aria-hidden":"true",size:"small","inner-label":m,progress:g}),t("div",{key:"e084007d227386e58d9f709bc5c2cf7b4a316626",class:"heading-area"},r(this.el,"heading")?t("slot",{name:"heading"}):t("ic-typography",{variant:"h4",class:"heading"},p),t("div",{key:"4010df0644f1cffe57f8f34bf165ede6743836b9",class:"info-line"},t("ic-typography",{key:"cd19369014430c710590a2e8feba86224022444e",variant:"caption",class:"step-num"},`${m} ${l.of} ${u}`,t("span",{key:"75135b7a00db90e483ad6dcfdd624cc3f8e90202",class:"visually-hidden"},` ${l.steps}`)),(this.subheading||y==="completed"||y==="disabled"||this.variant==="compact"&&!!n&&n!=="active"||!!f)&&t("div",{key:"adeabd1fd1668c0689ccba491b17579d5491dc2d",class:"step-status"},L!==undefined&&L,(v||q)&&t("ic-typography",{key:"f3454673badfbbdd1b5e15e92902050c51a2b07b",variant:"caption"},v!==null&&i(v)?v:y==="disabled"||k==="compact"&&n==="disabled"||y==="completed"||k==="compact"&&n==="completed"?q:f&&H))),h?t("ic-typography",{variant:"subtitle-small",class:"next-step"},l.lastStep):i(b)&&t("ic-typography",{variant:"subtitle-small",class:"next-step"},l.next,t("span",{class:"visually-hidden"}," ",l.step),":"," ",this.nextStepHeading)));let j;if(y!=="completed"){j=t("ic-typography",{key:"44128ff95829366b8b12045763fdb2a5aea9e21b",variant:"subtitle-small"},t("span",{key:"d3bacdb5ba89356a38cd92470eb84272a3996fde",class:"step-icon-inner","aria-hidden":"true"},this.stepNum))}else{j=t("div",{key:"fb984a7273ba46b3fdc088349e9fce02b8f3d586",class:"step-icon-inner","aria-hidden":"true"},t("span",{key:"510ba94dc70ec87727f9d2cdc603e032c22922ce",class:"check-icon",innerHTML:s}))}const M=y==="current"&&t("div",{key:"4b5eff7f3e115a8416a0d7b57780e1cab7681058",class:"step-connect-inner"});const z=!h&&t("div",{key:"e3550d0d527981b7e455d7f2c36ad925f551bde2",class:{["step-connect"]:true,["aligned-full-width"]:!!(((e=this.el.parentElement)===null||e===void 0?void 0:e.classList.contains("ic-stepper-default"))&&!this.el.parentElement.classList.contains("ic-stepper-aligned-left"))}},M);const C=t("div",{key:"244453c9e732a101832a953a438c93322e2e0e09",class:{["step"]:true,[`${y}`]:true}},t("div",{key:"65bed254efe5970c3c115d18cd60f597670ce6b0",class:"step-top"},t("div",{key:"a8e79bfa9ded3a224d634a30062799611ff654ff",class:"step-icon"},j),z),($||v||f)&&t("div",{key:"526d11252e72905887bf6fbfd0a40efdb3a15f60",class:"heading-area"},r(this.el,"heading")?t("slot",{name:"heading"}):t("ic-typography",{variant:"subtitle-large",class:"heading"},p),$&&(v||f)&&t("ic-typography",{key:"13c8779c38422f01ad9b1b38acf224fcb85a0767",variant:"caption",class:"subheading"},v!==null&&i(v)?v:H)));return t(a,{key:"92aa3a74f7b073e325a21c446b7d4cce619b9dea",role:"listitem","aria-label":`${l.step} ${m}${w}`,"aria-current":(d||y==="current")&&"step",class:{["aligned-full-width"]:!!(((c=this.el.parentElement)===null||c===void 0?void 0:c.classList.contains("ic-stepper-default"))&&!this.el.parentElement.classList.contains("ic-stepper-aligned-left")),[`ic-step-${k}`]:true,[`ic-theme-${x}`]:this.theme!=="inherit"}},k==="compact"?S:C)}get el(){return c(this)}static get watchers(){return{type:["typeChangeHandler"]}}};p.style=d;export{p as ic_step};
|
|
2
|
+
//# sourceMappingURL=p-75f91c8c.entry.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,c as t,h as o,g as i}from"./p-8e4e97b4.js";import{r as a,C as r}from"./p-eeb8d98a.js";import"./p-6215e2ae.js";const n='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}a{text-align:center}.item-container{display:flex;justify-content:center;align-items:center;width:calc(var(--ic-space-xl) + var(--ic-space-sm));height:var(--ic-space-xl);margin:var(--ic-space-xxs) var(--ic-space-xxxs);cursor:pointer;text-decoration:none}button{background:none;border:none;outline:inherit;position:relative}.ellipsis{pointer-events:none;--ic-typography-color:var(--ic-pagination-ellipsis)}.monochrome .ellipsis{--ic-typography-color:var(--ic-pagination-ellipsis-monochrome)}.item-container:focus{box-shadow:var(--ic-border-focus);outline:var(--ic-hc-focus-outline);border-radius:var(--ic-border-radius);transition:var(--ic-easing-transition-fast)}.page{--ic-typography-color:var(--ic-pagination-page-number)}.monochrome .page{--ic-typography-color:var(--ic-pagination-page-number-monochrome)}.simple-current{min-width:calc(var(--ic-space-xxl));padding:0 var(--ic-space-xs);height:var(--ic-space-lg);cursor:default}.item-container.page:hover:not(.selected):not(:focus){border-radius:var(--ic-border-radius);background-color:var(--ic-pagination-hover)}.item-container.page:active:not(.selected):not(:focus){background-color:var(--ic-pagination-pressed)}.monochrome .item-container.page:hover:not(.selected):not(:focus){background-color:var(--ic-pagination-hover-monochrome)}.monochrome .item-container.page:active:not(.selected):not(:focus){background-color:var(--ic-pagination-pressed-monochrome)}.selected{pointer-events:none;outline:none}.selected::after{content:"";height:var(--ic-space-xxs);width:100%;position:absolute;bottom:0;background-color:var(--ic-pagination-selected-banner)}.monochrome .selected::after{background-color:var(--ic-pagination-selected-banner-monochrome)}.page-selected{--ic-typography-color:var(--ic-pagination-text)}.item-container.page.light:hover:not(.selected):not(:focus){background-color:var(--ic-action-light-bg-hover)}.item-container.page.light:active:not(.selected):not(:focus){background-color:var(--ic-action-light-bg-pressed)}ic-typography.light,ic-typography.page-selected.light{--ic-typography-color:var(--ic-architectural-white)}.selected.light::after{content:"";height:var(--ic-space-xxs);width:100%;position:absolute;bottom:0;background-color:var(--ic-action-monochrome)}.item-container.page.dark:hover:not(.selected):not(:focus){background-color:var(--ic-action-dark-bg-hover)}.item-container.page.dark:active:not(.selected):not(:focus){background-color:var(--ic-action-dark-bg-pressed)}ic-typography.dark{--ic-typography-color:var(--ic-color-text-primary)}.selected.dark::after{content:"";height:var(--ic-space-xxs);width:100%;position:absolute;bottom:0;background-color:var(--ic-action-monochrome-dark)}.disabled{--ic-typography-color:var(--ic-pagination-text-disabled);pointer-events:none;cursor:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.disabled.page ic-typography{--ic-typography-color:var(--ic-pagination-page-number-disabled)}.disabled.ellipsis{--ic-typography-color:var(--ic-pagination-ellipsis-disabled)}.monochrome .disabled.page{--ic-typography-color:var(--ic-pagination-page-number-monochrome-disabled)}.monochrome .disabled.ellipsis{--ic-typography-color:var(--ic-pagination-ellipsis-monochrome-disabled)}@media (forced-colors: active){.selected::after{background-color:Highlight}.selected.light::after{background-color:Highlight}.selected.dark::after{background-color:Highlight}.disabled{--ic-typography-color:GrayText}}@media (prefers-reduced-motion: reduce){.item-container:focus{transition:none}}';const c=n;const s=class{constructor(o){e(this,o);this.paginationItemClick=t(this,"paginationItemClick",7);this.disabled=false;this.label="Page";this.monochrome=false;this.selected=false;this.theme="inherit";this.handleClick=()=>{this.paginationItemClick.emit({page:this.page||null})}}watchDisabledHandler(){a(this.disabled,this.el)}watchLabelHandler(){this.capitalizedLabel=r(this.label)}componentWillLoad(){this.watchLabelHandler();a(this.disabled,this.el)}render(){const{page:e,selected:t,type:i,disabled:a,label:r,capitalizedLabel:n,monochrome:c}=this;return o("a",{key:"1ed788f91d47fcaf163a11cf910c9269ca83466c",class:{["monochrome"]:!!c}},i==="ellipsis"?o("div",{class:{["item-container"]:true,["ellipsis"]:true,["disabled"]:!!a}},o("ic-typography",{variant:"label"},"...")):i==="page"?o("button",{disabled:a,onClick:this.handleClick,tabindex:t?"-1":"0",role:"button","aria-current":t&&"page","aria-label":t?`${r}: ${e}`:`Go to ${r} ${e}`,class:{["selected"]:!a&&t,["disabled"]:!!a,["item-container"]:true,["page"]:i==="page"}},o("ic-typography",{variant:"label",class:{["page-selected"]:t,["disabled"]:!!a}},e)):o("ic-typography",{"aria-live":"polite",class:{[`simple-current`]:true,["disabled"]:!!a},variant:"label"},n," ",e))}get el(){return i(this)}static get watchers(){return{disabled:["watchDisabledHandler"],label:["watchLabelHandler"]}}};s.style=c;export{s as ic_pagination_item};
|
|
2
|
+
//# sourceMappingURL=p-77f011e7.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["icPaginationItemCss","IcPaginationItemStyle0","PaginationItem","constructor","hostRef","this","disabled","label","monochrome","selected","theme","handleClick","paginationItemClick","emit","page","watchDisabledHandler","removeDisabledFalse","el","watchLabelHandler","capitalizedLabel","capitalize","componentWillLoad","render","type","h","key","class","variant","onClick","tabindex","role"],"sources":["src/components/ic-pagination-item/ic-pagination-item.css?tag=ic-pagination-item&encapsulation=shadow","src/components/ic-pagination-item/ic-pagination-item.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\na {\n text-align: center;\n}\n\n.item-container {\n display: flex;\n justify-content: center;\n align-items: center;\n width: calc(var(--ic-space-xl) + var(--ic-space-sm));\n height: var(--ic-space-xl);\n margin: var(--ic-space-xxs) var(--ic-space-xxxs);\n cursor: pointer;\n text-decoration: none;\n}\n\nbutton {\n background: none;\n border: none;\n outline: inherit;\n position: relative;\n}\n\n.ellipsis {\n pointer-events: none;\n\n --ic-typography-color: var(--ic-pagination-ellipsis);\n}\n\n.monochrome .ellipsis {\n --ic-typography-color: var(--ic-pagination-ellipsis-monochrome);\n}\n\n.item-container:focus {\n box-shadow: var(--ic-border-focus);\n outline: var(--ic-hc-focus-outline);\n border-radius: var(--ic-border-radius);\n transition: var(--ic-easing-transition-fast);\n}\n\n.page {\n --ic-typography-color: var(--ic-pagination-page-number);\n}\n\n.monochrome .page {\n --ic-typography-color: var(--ic-pagination-page-number-monochrome);\n}\n\n.simple-current {\n min-width: calc(var(--ic-space-xxl));\n padding: 0 var(--ic-space-xs);\n height: var(--ic-space-lg);\n cursor: default;\n}\n\n/** DEFAULT STATES **/\n.item-container.page:hover:not(.selected):not(:focus) {\n border-radius: var(--ic-border-radius);\n background-color: var(--ic-pagination-hover);\n}\n\n.item-container.page:active:not(.selected):not(:focus) {\n background-color: var(--ic-pagination-pressed);\n}\n\n.monochrome .item-container.page:hover:not(.selected):not(:focus) {\n background-color: var(--ic-pagination-hover-monochrome);\n}\n\n.monochrome .item-container.page:active:not(.selected):not(:focus) {\n background-color: var(--ic-pagination-pressed-monochrome);\n}\n\n.selected {\n pointer-events: none;\n outline: none;\n}\n\n.selected::after {\n content: \"\";\n height: var(--ic-space-xxs);\n width: 100%;\n position: absolute;\n bottom: 0;\n background-color: var(--ic-pagination-selected-banner);\n}\n\n.monochrome .selected::after {\n background-color: var(--ic-pagination-selected-banner-monochrome);\n}\n\n.page-selected {\n --ic-typography-color: var(--ic-pagination-text);\n}\n\n/** LIGHT STATES **/\n.item-container.page.light:hover:not(.selected):not(:focus) {\n background-color: var(--ic-action-light-bg-hover);\n}\n\n.item-container.page.light:active:not(.selected):not(:focus) {\n background-color: var(--ic-action-light-bg-pressed);\n}\n\nic-typography.light,\nic-typography.page-selected.light {\n --ic-typography-color: var(--ic-architectural-white);\n}\n\n.selected.light::after {\n content: \"\";\n height: var(--ic-space-xxs);\n width: 100%;\n position: absolute;\n bottom: 0;\n background-color: var(--ic-action-monochrome);\n}\n\n/** DARK STATES **/\n.item-container.page.dark:hover:not(.selected):not(:focus) {\n background-color: var(--ic-action-dark-bg-hover);\n}\n\n.item-container.page.dark:active:not(.selected):not(:focus) {\n background-color: var(--ic-action-dark-bg-pressed);\n}\n\nic-typography.dark {\n --ic-typography-color: var(--ic-color-text-primary);\n}\n\n.selected.dark::after {\n content: \"\";\n height: var(--ic-space-xxs);\n width: 100%;\n position: absolute;\n bottom: 0;\n background-color: var(--ic-action-monochrome-dark);\n}\n\n.disabled {\n --ic-typography-color: var(--ic-pagination-text-disabled);\n\n pointer-events: none;\n cursor: none;\n user-select: none;\n}\n\n.disabled.page ic-typography {\n --ic-typography-color: var(--ic-pagination-page-number-disabled);\n}\n\n.disabled.ellipsis {\n --ic-typography-color: var(--ic-pagination-ellipsis-disabled);\n}\n\n.monochrome .disabled.page {\n --ic-typography-color: var(--ic-pagination-page-number-monochrome-disabled);\n}\n\n.monochrome .disabled.ellipsis {\n --ic-typography-color: var(--ic-pagination-ellipsis-monochrome-disabled);\n}\n\n@media (forced-colors: active) {\n .selected::after {\n background-color: Highlight;\n }\n\n .selected.light::after {\n background-color: Highlight;\n }\n\n .selected.dark::after {\n background-color: Highlight;\n }\n\n .disabled {\n --ic-typography-color: GrayText;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .item-container:focus {\n transition: none;\n }\n}\n","import {\n Component,\n Prop,\n State,\n Element,\n h,\n Event,\n EventEmitter,\n Watch,\n} from \"@stencil/core\";\nimport { IcPaginationItemType } from \"./ic-pagination-item.types\";\nimport { IcThemeMode } from \"../../utils/types\";\nimport { removeDisabledFalse, capitalize } from \"../../utils/helpers\";\n\n@Component({\n tag: \"ic-pagination-item\",\n styleUrl: \"ic-pagination-item.css\",\n shadow: true,\n})\nexport class PaginationItem {\n @Element() el: HTMLIcPaginationItemElement;\n\n @State() capitalizedLabel: string;\n\n /**\n * If `true`, the pagination item will be disabled.\n */\n @Prop() disabled?: boolean = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n /**\n * The label for the pagination item (applicable when simple pagination is being used).\n */\n @Prop() label?: string = \"Page\";\n\n @Watch(\"label\")\n watchLabelHandler(): void {\n this.capitalizedLabel = capitalize(this.label!);\n }\n\n /**\n * If `true`, the pagination item will display as black in the light theme, and white in dark theme.\n */\n @Prop() monochrome?: boolean = false;\n\n /**\n * The current page number.\n */\n @Prop() page?: number;\n\n /**\n * If `true`, the pagination item will be selected.\n */\n @Prop() selected: boolean = false;\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop() theme?: IcThemeMode = \"inherit\";\n\n /**\n * The type of pagination item - 'page' or 'ellipsis'.\n */\n @Prop() type: IcPaginationItemType;\n\n /**\n * @internal - Emitted when a pagination item is clicked.\n */\n @Event() paginationItemClick: EventEmitter<{ page: number | null }>;\n\n componentWillLoad(): void {\n this.watchLabelHandler();\n removeDisabledFalse(this.disabled, this.el);\n }\n\n private handleClick = () => {\n this.paginationItemClick.emit({ page: this.page || null });\n };\n\n render() {\n const {\n page,\n selected,\n type,\n disabled,\n label,\n capitalizedLabel,\n monochrome,\n } = this;\n\n return (\n <a class={{ [\"monochrome\"]: !!monochrome }}>\n {type === \"ellipsis\" ? (\n <div\n class={{\n [\"item-container\"]: true,\n [\"ellipsis\"]: true,\n [\"disabled\"]: !!disabled,\n }}\n >\n <ic-typography variant=\"label\">...</ic-typography>\n </div>\n ) : type === \"page\" ? (\n <button\n disabled={disabled}\n onClick={this.handleClick}\n tabindex={selected ? \"-1\" : \"0\"}\n role=\"button\"\n aria-current={selected && \"page\"}\n aria-label={\n selected ? `${label}: ${page}` : `Go to ${label} ${page}`\n }\n class={{\n [\"selected\"]: !disabled && selected,\n [\"disabled\"]: !!disabled,\n [\"item-container\"]: true,\n [\"page\"]: type === \"page\",\n }}\n >\n <ic-typography\n variant=\"label\"\n class={{\n [\"page-selected\"]: selected,\n [\"disabled\"]: !!disabled,\n }}\n >\n {page}\n </ic-typography>\n </button>\n ) : (\n <ic-typography\n aria-live=\"polite\"\n class={{\n [`simple-current`]: true,\n [\"disabled\"]: !!disabled,\n }}\n variant=\"label\"\n >\n {capitalizedLabel} {page}\n </ic-typography>\n )}\n </a>\n );\n }\n}\n"],"mappings":"4HAAA,MAAMA,EAAsB,gxLAC5B,MAAAC,EAAeD,E,MCkBFE,EAAc,MAL3B,WAAAC,CAAAC,G,mEAaUC,KAAAC,SAAqB,MASrBD,KAAAE,MAAiB,OAUjBF,KAAAG,WAAuB,MAUvBH,KAAAI,SAAoB,MAKpBJ,KAAAK,MAAsB,UAiBtBL,KAAAM,YAAc,KACpBN,KAAKO,oBAAoBC,KAAK,CAAEC,KAAMT,KAAKS,MAAQ,MAAO,C,CAlD5D,oBAAAC,GACEC,EAAoBX,KAAKC,SAAUD,KAAKY,G,CAS1C,iBAAAC,GACEb,KAAKc,iBAAmBC,EAAWf,KAAKE,M,CAiC1C,iBAAAc,GACEhB,KAAKa,oBACLF,EAAoBX,KAAKC,SAAUD,KAAKY,G,CAO1C,MAAAK,GACE,MAAMR,KACJA,EAAIL,SACJA,EAAQc,KACRA,EAAIjB,SACJA,EAAQC,MACRA,EAAKY,iBACLA,EAAgBX,WAChBA,GACEH,KAEJ,OACEmB,EAAA,KAAAC,IAAA,2CAAGC,MAAO,CAAE,CAAC,gBAAiBlB,IAC3Be,IAAS,WACRC,EAAA,OACEE,MAAO,CACL,CAAC,kBAAmB,KACpB,CAAC,YAAa,KACd,CAAC,cAAepB,IAGlBkB,EAAA,iBAAeG,QAAQ,SAAO,QAE9BJ,IAAS,OACXC,EAAA,UACElB,SAAUA,EACVsB,QAASvB,KAAKM,YACdkB,SAAUpB,EAAW,KAAO,IAC5BqB,KAAK,SAAQ,eACCrB,GAAY,OAAM,aAE9BA,EAAW,GAAGF,MAAUO,IAAS,SAASP,KAASO,IAErDY,MAAO,CACL,CAAC,aAAcpB,GAAYG,EAC3B,CAAC,cAAeH,EAChB,CAAC,kBAAmB,KACpB,CAAC,QAASiB,IAAS,SAGrBC,EAAA,iBACEG,QAAQ,QACRD,MAAO,CACL,CAAC,iBAAkBjB,EACnB,CAAC,cAAeH,IAGjBQ,IAILU,EAAA,6BACY,SACVE,MAAO,CACL,CAAC,kBAAmB,KACpB,CAAC,cAAepB,GAElBqB,QAAQ,SAEPR,EAAgB,IAAGL,G","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as i,c as t,h as e,F as s,H as o,g as a}from"./p-8e4e97b4.js";import{c as n}from"./p-f074ef5b.js";import{h as r,u as l,v as d,w as h,i as c,o as g}from"./p-eeb8d98a.js";import"./p-6215e2ae.js";const p='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;min-height:100% !important;background:rgb(0 0 0 / 60%);z-index:var(--ic-z-index-dialog);opacity:0}:host(.ic-dialog-fade-in){opacity:1}:host(.disable-height-constraint){background:none;justify-content:unset;align-items:unset}.dialog.disable-height-constraint{max-height:none;position:relative}.dialog.disable-height-constraint .content-area{overflow-y:visible}@media (prefers-reduced-motion: no-preference){:host{transition:opacity var(--ic-easing-transition-slow)}.dialog{transform:translateY(-3rem);transition:transform 1000s}:host(.ic-dialog-fade-in) .dialog{transform:translateY(0);transition:transform var(--ic-easing-transition-slow)}}:host(.ic-dialog-hidden){display:none}.dialog{background-color:var(--ic-dialog-background);color:var(--ic-dialog-text-primary);--ic-typography-color:var(--ic-dialog-text-primary);border:var(--ic-space-1px) solid var(--ic-dialog-border);border-radius:var(--ic-border-radius);padding:var(--ic-space-xs) 0 var(--ic-space-md);display:flex;flex-direction:column;box-sizing:border-box;overflow-x:visible}.small{width:50%;max-width:25rem;min-height:11rem;max-height:70vh}.medium{width:70vw;max-width:44rem;min-height:12.5rem;max-height:70vh}.large{width:90vw;max-width:62.5rem;min-height:12.5rem;max-height:90vh}.heading-area{display:flex;margin-bottom:var(--ic-space-xs);padding:0 var(--ic-space-md)}.heading{overflow-wrap:break-word}.close-icon{margin-left:auto}.close-icon>svg{color:var(--ic-dialog-clear-button)}.content-area{padding:0 var(--ic-space-md);margin:0;overflow-y:auto}#dialog-content{margin-bottom:var(--ic-space-sm)}#dialog-content ::slotted(ic-typography){overflow-wrap:break-word}#dialog-content ::slotted(*){position:relative}.dialog-controls{margin-top:auto;padding:var(--ic-space-xs) var(--ic-space-md) 0;display:flex;justify-content:flex-end;gap:var(--ic-space-md)}.dialog-control-button{width:-moz-fit-content;width:fit-content}.backdrop{overflow-y:auto;position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:rgb(0 0 0 / 60%);z-index:var(--ic-z-index-dialog);padding-top:16px;padding-bottom:16px}.heading ic-typography{--ic-typography-color:var(--ic-dialog-text-primary)}.label ic-typography{--ic-typography-color:var(--ic-dialog-label)}@media (min-width: 800px){.large:not(.disable-width-constraint)>.content-area{width:75%}}@media (max-width: 576px){.dialog{width:100vw;height:100vh;max-width:none;max-height:none;box-sizing:border-box}.backdrop{padding:0}.dialog.disable-height-constraint{height:auto;min-height:100vh}}@media (max-width: 364px){.dialog-control-button{width:unset}}';const m=p;const b=class{constructor(o){i(this,o);this.icDialogCancelled=t(this,"icDialogCancelled",7);this.icDialogClosed=t(this,"icDialogClosed",7);this.icDialogConfirmed=t(this,"icDialogConfirmed",7);this.icDialogOpened=t(this,"icDialogOpened",7);this.contentAreaMutationObserver=null;this.DATA_GETS_FOCUS="data-gets-focus";this.DIALOG_CONTROLS="dialog-controls";this.dialogHeight=0;this.focusAttemptCount=0;this.interactiveElementList=[];this.resizeObserver=null;this.dialogRendered=false;this.fadeIn=false;this.closeOnBackdropClick=true;this.destructive=false;this.dismissLabel="Dismiss";this.disableHeightConstraint=false;this.disableWidthConstraint=false;this.hideCloseButton=false;this.hideDefaultControls=false;this.open=false;this.size="small";this.theme="inherit";this.dialogOpened=()=>{var i,t;this.dialogRendered=true;if(this.disableHeightConstraint){(i=this.dialogEl)===null||i===void 0?void 0:i.show()}else{(t=this.dialogEl)===null||t===void 0?void 0:t.showModal()}setTimeout((()=>{this.fadeIn=true;if(this.backdropEl&&this.disableHeightConstraint&&this.backdropEl.scrollTop!==0){this.backdropEl.scrollTop=0}}),10);setTimeout((()=>{this.getInteractiveElements();this.setInitialFocus();r(this.runResizeObserver)}),75);setTimeout((()=>{this.icDialogOpened.emit()}),80)};this.runResizeObserver=()=>{if(this.dialogEl){this.resizeObserver=new ResizeObserver((()=>{clearTimeout(this.resizeTimeout);this.resizeTimeout=window.setTimeout(this.resizeObserverCallback,80)}));this.resizeObserver.observe(this.dialogEl)}};this.resizeObserverCallback=()=>{if(this.dialogEl&&this.dialogEl.clientHeight!==this.dialogHeight){this.dialogHeight=this.dialogEl.clientHeight}};this.removeSlotChangeListener=()=>{var i;if(this.contentArea){this.contentArea.removeEventListener("slotchange",this.getInteractiveElements);(i=this.contentAreaMutationObserver)===null||i===void 0?void 0:i.disconnect()}};this.setContentAreaMutationObserver=()=>{var i;const t=(i=this.el.shadowRoot)===null||i===void 0?void 0:i.querySelector("#dialog-content");if(t){const{contentAreaSlot:i,contentAreaMutationObserver:e}=l(t||null,this.getInteractiveElements);this.contentArea=i;this.contentAreaMutationObserver=e}};this.focusLast=()=>{if(this.interactiveElementList.length>0){d(this.focusAttemptCount,this.interactiveElementList.length-1,this.interactiveElementList,true)}};this.focusFirst=()=>{if(this.interactiveElementList.length>0){d(this.focusAttemptCount,0,this.interactiveElementList)}};this.setInitialFocus=()=>{this.sourceElement=document.activeElement;if(!this.interactiveElementList.length){setTimeout((()=>{this.getInteractiveElements();if(this.interactiveElementList.length){this.setInitialFocus()}}),10);return}let i=this.interactiveElementList.findIndex((i=>i.hasAttribute(this.DATA_GETS_FOCUS)));if(i===-1){i=0}if(this.interactiveElementList[i]){const t=d(this.focusAttemptCount,i,this.interactiveElementList);if(t){this.focusAttemptCount=t.newFocusAttemptCount}}};this.closeIconClick=()=>{this.open=false};this.getInteractiveElements=()=>{var i;this.interactiveElementList=Array.from(((i=this.el.shadowRoot)===null||i===void 0?void 0:i.querySelectorAll("ic-button"))||[]);const t=h(this.el);if(t.length>0){if(t[0].slot!==this.DIALOG_CONTROLS){t[0].setAttribute(this.DATA_GETS_FOCUS,"")}else if(!this.destructive){t[t.length-1].setAttribute(this.DATA_GETS_FOCUS,"")}}if(t.length>0&&this.interactiveElementList.length>0){if(this.interactiveElementList[0].classList.contains("close-icon")){this.interactiveElementList=[this.interactiveElementList[0],...t,...this.interactiveElementList.slice(1)]}else{this.interactiveElementList=[...t,...this.interactiveElementList]}}};this.renderDialog=()=>{const{hideDefaultControls:i,size:t,heading:o,label:a,destructive:r,dismissLabel:l,hideCloseButton:d,disableHeightConstraint:h,disableWidthConstraint:g,closeIconClick:p,DIALOG_CONTROLS:m}=this;const b=c(this.el,m);return e("dialog",{class:{dialog:true,[`${t}`]:true,"disable-height-constraint":!!h,"disable-width-constraint":!!g},"aria-labelledby":"dialog-label dialog-heading","aria-describedby":"dialog-alert dialog-content",ref:i=>this.dialogEl=i},e("div",{tabindex:"0",onFocus:this.focusLast}),e("div",{class:"heading-area"},e("div",{class:"heading-content"},e("div",{class:"label"},e("slot",{name:"label"},e("ic-typography",{variant:"label",id:"dialog-label"},a))),e("div",{class:"heading"},e("slot",{name:"heading"},e("ic-typography",{variant:"h4",id:"dialog-heading"},o)))),!d&&e("ic-button",{class:"close-icon",variant:"icon-tertiary",innerHTML:n,"aria-label":l,onClick:p,"data-gets-focus":r||i&&!b?"":null})),e("div",{class:"content-area"},c(this.el,"alert")&&e("slot",{name:"alert"}),e("div",{id:"dialog-content"},e("slot",null))),(b||!i)&&e("div",{class:{[m]:true}},b?e("slot",{name:m}):e(s,null,e("ic-button",{variant:"tertiary",onClick:()=>this.cancelDialog(),class:"dialog-control-button","data-gets-focus":null},"Cancel"),e("ic-button",{variant:r?"destructive":"primary",onClick:()=>this.confirmDialog(),class:"dialog-control-button","data-gets-focus":""},"Confirm"))),e("div",{tabindex:"0",onFocus:this.focusFirst}))}}watchOpenHandler(){if(this.open){this.dialogOpened()}else{this.fadeIn=false;if(this.resizeObserver!==null){this.resizeObserver.disconnect()}setTimeout((()=>{var i,t;this.dialogRendered=false;(i=this.dialogEl)===null||i===void 0?void 0:i.close();(t=this.sourceElement)===null||t===void 0?void 0:t.focus();this.dialogHeight=0;this.icDialogClosed.emit()}),80)}}disconnectedCallback(){this.removeSlotChangeListener()}componentDidLoad(){this.setContentAreaMutationObserver();if(this.open){this.dialogOpened()}!c(this.el,"heading")&&g([{prop:this.heading,propName:"heading"}],"Dialog")}componentDidRender(){document.body.style.overflow=getComputedStyle(this.el).display!=="none"&&this.disableHeightConstraint?"hidden":"auto"}handleKeyboard(i){if(this.dialogRendered){switch(i.key){case"Escape":if(!i.repeat){this.open=false}i.stopImmediatePropagation();break}}}handleClick(i){if(this.dialogEl&&this.closeOnBackdropClick&&i.composedPath().indexOf(this.dialogEl)<=0){const{top:t,height:e,left:s,width:o}=this.dialogEl.getBoundingClientRect();const a=t<=i.clientY&&i.clientY<=t+e&&s<=i.clientX&&i.clientX<=s+o;if(!a){this.open=false}}}async cancelDialog(){this.icDialogCancelled.emit();this.open=false}async confirmDialog(){this.icDialogConfirmed.emit()}render(){const{dialogRendered:i,disableHeightConstraint:t,fadeIn:s,theme:a,size:n}=this;return e(o,{key:"81eec3ff249b58950bfd8b0e525e46d8a5688db3",class:{"ic-dialog-hidden":!i,"ic-dialog-fade-in":s,"disable-height-constraint":!!t,[`ic-theme-${a}`]:a!=="inherit",[`ic-dialog-size-${n}`]:n!=undefined}},t?e("div",{class:"backdrop",ref:i=>this.backdropEl=i},this.renderDialog()):this.renderDialog())}get el(){return a(this)}static get watchers(){return{open:["watchOpenHandler"]}}};b.style=m;export{b as ic_dialog};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as i,c as t,h as e,F as s,H as o,g as a}from"./p-8e4e97b4.js";import{c as n}from"./p-c391e323.js";import{h as r,u as l,v as d,w as h,i as c,o as g}from"./p-eeb8d98a.js";import"./p-6215e2ae.js";const p='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;min-height:100% !important;background:rgb(0 0 0 / 60%);z-index:var(--ic-z-index-dialog);opacity:0}:host(.ic-dialog-fade-in){opacity:1}:host(.disable-height-constraint){background:none;justify-content:unset;align-items:unset}.dialog.disable-height-constraint{max-height:none;position:relative}.dialog.disable-height-constraint .content-area{overflow-y:visible}@media (prefers-reduced-motion: no-preference){:host{transition:opacity var(--ic-easing-transition-slow)}.dialog{transform:translateY(-3rem);transition:transform 1000s}:host(.ic-dialog-fade-in) .dialog{transform:translateY(0);transition:transform var(--ic-easing-transition-slow)}}:host(.ic-dialog-hidden){display:none}.dialog{background-color:var(--ic-dialog-background);color:var(--ic-dialog-text-primary);--ic-typography-color:var(--ic-dialog-text-primary);border:var(--ic-space-1px) solid var(--ic-dialog-border);border-radius:var(--ic-border-radius);padding:var(--ic-space-xs) 0 var(--ic-space-md);display:flex;flex-direction:column;box-sizing:border-box;overflow-x:visible}.small{width:50%;max-width:25rem;min-height:11rem;max-height:70vh}.medium{width:70vw;max-width:44rem;min-height:12.5rem;max-height:70vh}.large{width:90vw;max-width:62.5rem;min-height:12.5rem;max-height:90vh}.heading-area{display:flex;margin-bottom:var(--ic-space-xs);padding:0 var(--ic-space-md)}.heading{overflow-wrap:break-word}.close-icon{margin-left:auto}.close-icon>svg{color:var(--ic-dialog-clear-button)}.content-area{padding:0 var(--ic-space-md);margin:0;overflow-y:auto}#dialog-content{margin-bottom:var(--ic-space-sm)}#dialog-content ::slotted(ic-typography){overflow-wrap:break-word}#dialog-content ::slotted(*){position:relative}.dialog-controls{margin-top:auto;padding:var(--ic-space-xs) var(--ic-space-md) 0;display:flex;justify-content:flex-end;gap:var(--ic-space-md)}.dialog-control-button{width:-moz-fit-content;width:fit-content}.backdrop{overflow-y:auto;position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:rgb(0 0 0 / 60%);z-index:var(--ic-z-index-dialog);padding-top:16px;padding-bottom:16px}.heading ic-typography{--ic-typography-color:var(--ic-dialog-text-primary)}.label ic-typography{--ic-typography-color:var(--ic-dialog-label)}@media (min-width: 800px){.large:not(.disable-width-constraint)>.content-area{width:75%}}@media (max-width: 576px){.dialog{width:100vw;height:100vh;max-width:none;max-height:none;box-sizing:border-box}.backdrop{padding:0}.dialog.disable-height-constraint{height:auto;min-height:100vh}}@media (max-width: 364px){.dialog-control-button{width:unset}}';const m=p;const b=class{constructor(o){i(this,o);this.icDialogCancelled=t(this,"icDialogCancelled",7);this.icDialogClosed=t(this,"icDialogClosed",7);this.icDialogConfirmed=t(this,"icDialogConfirmed",7);this.icDialogOpened=t(this,"icDialogOpened",7);this.contentAreaMutationObserver=null;this.DATA_GETS_FOCUS="data-gets-focus";this.DIALOG_CONTROLS="dialog-controls";this.dialogHeight=0;this.focusAttemptCount=0;this.interactiveElementList=[];this.resizeObserver=null;this.dialogRendered=false;this.fadeIn=false;this.closeOnBackdropClick=true;this.destructive=false;this.dismissLabel="Dismiss";this.disableHeightConstraint=false;this.disableWidthConstraint=false;this.hideCloseButton=false;this.hideDefaultControls=false;this.open=false;this.size="small";this.theme="inherit";this.dialogOpened=()=>{var i,t;this.dialogRendered=true;if(this.disableHeightConstraint){(i=this.dialogEl)===null||i===void 0?void 0:i.show()}else{(t=this.dialogEl)===null||t===void 0?void 0:t.showModal()}setTimeout((()=>{this.fadeIn=true;if(this.backdropEl&&this.disableHeightConstraint&&this.backdropEl.scrollTop!==0){this.backdropEl.scrollTop=0}}),10);setTimeout((()=>{this.getInteractiveElements();this.setInitialFocus();r(this.runResizeObserver)}),75);setTimeout((()=>{this.icDialogOpened.emit()}),80)};this.runResizeObserver=()=>{if(this.dialogEl){this.resizeObserver=new ResizeObserver((()=>{clearTimeout(this.resizeTimeout);this.resizeTimeout=window.setTimeout(this.resizeObserverCallback,80)}));this.resizeObserver.observe(this.dialogEl)}};this.resizeObserverCallback=()=>{if(this.dialogEl&&this.dialogEl.clientHeight!==this.dialogHeight){this.dialogHeight=this.dialogEl.clientHeight}};this.removeSlotChangeListener=()=>{var i;if(this.contentArea){this.contentArea.removeEventListener("slotchange",this.getInteractiveElements);(i=this.contentAreaMutationObserver)===null||i===void 0?void 0:i.disconnect()}};this.setContentAreaMutationObserver=()=>{var i;const t=(i=this.el.shadowRoot)===null||i===void 0?void 0:i.querySelector("#dialog-content");if(t){const{contentAreaSlot:i,contentAreaMutationObserver:e}=l(t||null,this.getInteractiveElements);this.contentArea=i;this.contentAreaMutationObserver=e}};this.focusLast=()=>{if(this.interactiveElementList.length>0){d(this.focusAttemptCount,this.interactiveElementList.length-1,this.interactiveElementList,true)}};this.focusFirst=()=>{if(this.interactiveElementList.length>0){d(this.focusAttemptCount,0,this.interactiveElementList)}};this.setInitialFocus=()=>{this.sourceElement=document.activeElement;if(!this.interactiveElementList.length){setTimeout((()=>{this.getInteractiveElements();if(this.interactiveElementList.length){this.setInitialFocus()}}),10);return}let i=this.interactiveElementList.findIndex((i=>i.hasAttribute(this.DATA_GETS_FOCUS)));if(i===-1){i=0}if(this.interactiveElementList[i]){const t=d(this.focusAttemptCount,i,this.interactiveElementList);if(t){this.focusAttemptCount=t.newFocusAttemptCount}}};this.closeIconClick=()=>{this.open=false};this.getInteractiveElements=()=>{var i;this.interactiveElementList=Array.from(((i=this.el.shadowRoot)===null||i===void 0?void 0:i.querySelectorAll("ic-button"))||[]);const t=h(this.el);if(t.length>0){if(t[0].slot!==this.DIALOG_CONTROLS){t[0].setAttribute(this.DATA_GETS_FOCUS,"")}else if(!this.destructive){t[t.length-1].setAttribute(this.DATA_GETS_FOCUS,"")}}if(t.length>0&&this.interactiveElementList.length>0){if(this.interactiveElementList[0].classList.contains("close-icon")){this.interactiveElementList=[this.interactiveElementList[0],...t,...this.interactiveElementList.slice(1)]}else{this.interactiveElementList=[...t,...this.interactiveElementList]}}};this.renderDialog=()=>{const{hideDefaultControls:i,size:t,heading:o,label:a,destructive:r,dismissLabel:l,hideCloseButton:d,disableHeightConstraint:h,disableWidthConstraint:g,closeIconClick:p,DIALOG_CONTROLS:m}=this;const b=c(this.el,m);return e("dialog",{class:{dialog:true,[`${t}`]:true,"disable-height-constraint":!!h,"disable-width-constraint":!!g},"aria-labelledby":"dialog-label dialog-heading","aria-describedby":"dialog-alert dialog-content",ref:i=>this.dialogEl=i},e("div",{tabindex:"0",onFocus:this.focusLast}),e("div",{class:"heading-area"},e("div",{class:"heading-content"},e("div",{class:"label"},e("slot",{name:"label"},e("ic-typography",{variant:"label",id:"dialog-label"},a))),e("div",{class:"heading"},e("slot",{name:"heading"},e("ic-typography",{variant:"h4",id:"dialog-heading"},o)))),!d&&e("ic-button",{class:"close-icon",variant:"icon-tertiary",innerHTML:n,"aria-label":l,onClick:p,"data-gets-focus":r||i&&!b?"":null})),e("div",{class:"content-area"},c(this.el,"alert")&&e("slot",{name:"alert"}),e("div",{id:"dialog-content"},e("slot",null))),(b||!i)&&e("div",{class:{[m]:true}},b?e("slot",{name:m}):e(s,null,e("ic-button",{variant:"tertiary",onClick:()=>this.cancelDialog(),class:"dialog-control-button","data-gets-focus":null},"Cancel"),e("ic-button",{variant:r?"destructive":"primary",onClick:()=>this.confirmDialog(),class:"dialog-control-button","data-gets-focus":""},"Confirm"))),e("div",{tabindex:"0",onFocus:this.focusFirst}))}}watchOpenHandler(){if(this.open){this.dialogOpened()}else{this.fadeIn=false;if(this.resizeObserver!==null){this.resizeObserver.disconnect()}setTimeout((()=>{var i,t;this.dialogRendered=false;(i=this.dialogEl)===null||i===void 0?void 0:i.close();(t=this.sourceElement)===null||t===void 0?void 0:t.focus();this.dialogHeight=0;this.icDialogClosed.emit()}),80)}}disconnectedCallback(){this.removeSlotChangeListener()}componentDidLoad(){this.setContentAreaMutationObserver();if(this.open){this.dialogOpened()}!c(this.el,"heading")&&g([{prop:this.heading,propName:"heading"}],"Dialog")}componentDidRender(){document.body.style.overflow=getComputedStyle(this.el).display!=="none"&&this.disableHeightConstraint?"hidden":"auto"}handleKeyboard(i){if(this.dialogRendered){switch(i.key){case"Escape":if(!i.repeat){this.open=false}i.stopImmediatePropagation();break}}}handleClick(i){if(this.dialogEl&&this.closeOnBackdropClick&&i.composedPath().indexOf(this.dialogEl)<=0){const{top:t,height:e,left:s,width:o}=this.dialogEl.getBoundingClientRect();const a=t<=i.clientY&&i.clientY<=t+e&&s<=i.clientX&&i.clientX<=s+o;if(!a){this.open=false}}}async cancelDialog(){this.icDialogCancelled.emit();this.open=false}async confirmDialog(){this.icDialogConfirmed.emit()}render(){const{dialogRendered:i,disableHeightConstraint:t,fadeIn:s,theme:a,size:n}=this;return e(o,{key:"81eec3ff249b58950bfd8b0e525e46d8a5688db3",class:{"ic-dialog-hidden":!i,"ic-dialog-fade-in":s,"disable-height-constraint":!!t,[`ic-theme-${a}`]:a!=="inherit",[`ic-dialog-size-${n}`]:n!=undefined}},t?e("div",{class:"backdrop",ref:i=>this.backdropEl=i},this.renderDialog()):this.renderDialog())}get el(){return a(this)}static get watchers(){return{open:["watchOpenHandler"]}}};b.style=m;export{b as ic_dialog};
|
|
2
|
+
//# sourceMappingURL=p-85db7e71.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,h as i,H as s,g as e}from"./p-8e4e97b4.js";import{p as h,h as l}from"./p-eeb8d98a.js";import"./p-6215e2ae.js";const o=":host{display:flex;width:100%}.step-item-list{display:flex;margin:0;padding:0}:host(.ic-stepper-default:not(.ic-stepper-aligned-left)) .step-item-list{flex:auto}:host(.ic-stepper-compact) ul ::slotted(ic-step){display:none}:host(.ic-stepper-compact) ul ::slotted(ic-step.show){display:flex}:host(.ic-stepper-compact) ul ::slotted(ic-step.hide){display:none;opacity:0;visibility:hidden}";const n=o;const d=class{constructor(i){t(this,i);var s;this.resizeObserver=null;this.visuallyHidden="visually-hidden";this.alignedFullWidth=true;this.autoSetStepTitles=true;this.lastStepWidth=0;this.noOfResizes=0;this.stepperWidth=(s=document.querySelector("ic-stepper"))===null||s===void 0?void 0:s.getBoundingClientRect().width;this.stepTypes=[];this.variantOverride=this.variant!=="compact";this.aligned="full-width";this.connectorWidth=100;this.hideStepInfo=false;this.icI18n={next:"Next",step:"Step",steps:"Steps",of:"of",lastStep:"Last step",completed:"Completed",notRequired:"Not required",required:"Required",optional:"Optional"};this.theme="inherit";this.variant="default";this.stepHeading=(t,i=false)=>{var s,e,h,l;if(t.hasAttribute("heading")&&t.getAttribute("heading")!==""){return t.getAttribute("heading")||undefined}const o=(s=t.shadowRoot)===null||s===void 0?void 0:s.querySelector('slot[name="heading"]');const n=((e=o===null||o===void 0?void 0:o.assignedNodes)===null||e===void 0?void 0:e.call(o))||[];for(const t of n){const i=t.nodeType===Node.TEXT_NODE?(h=t.textContent)===null||h===void 0?void 0:h.trim():(l=t.innerText)===null||l===void 0?void 0:l.trim();if(i)return i}if(i&&t.heading){return t.heading}return undefined};this.getChildren=()=>{this.steps=Array.from(this.el.querySelectorAll("ic-step"));this.stepsWithStepTitles=this.steps.filter((t=>!!this.stepHeading(t,false)))};this.checkStepTitles=()=>{if(this.stepsWithStepTitles.length<this.steps.length&&this.variantOverride&&this.variant==="compact"){this.noOfResizes=this.noOfResizes+1;if(this.noOfResizes===1){console.error(`The prop 'heading' is required for all steps of the Stepper component (compact variant)`)}}};this.setStepTypes=()=>{this.getChildren();this.stepTypes=[];for(let t=0;t<this.steps.length;t++){this.stepTypes.push("active")}};this.setStepperWidth=()=>{this.alignedFullWidth=this.variant==="default"&&this.aligned==="full-width";const t=this.steps[this.steps.length-1];t.style.maxWidth="none";if(this.alignedFullWidth){this.stepperWidth=this.el.offsetWidth;t.style.maxWidth=h(`${this.stepperWidth/this.steps.length}px`);this.lastStepWidth=t.offsetWidth}};this.initialiseStepStates=()=>{this.steps.forEach(((t,i)=>{var s,e,l;if(this.icI18n!==undefined){t.icI18n=this.icI18n}t.variant=this.variant;t.stepNum=i+1;t.lastStep=i===this.steps.length-1;t.lastStepNum=this.steps.length;if(t.type!=="current"){t.current=false;this.stepTypes[i]=t.type}else{t.current=true}const o=t.shadowRoot&&t.shadowRoot.querySelector(".step > .heading-area");if(this.stepsWithStepTitles.length==0&&this.variantOverride){if(this.variant==="compact"){this.autoSetStepTitles=true;if(this.autoSetStepTitles){t.heading="Step "+t.stepNum;o&&((s=o===null||o===void 0?void 0:o.querySelector(".heading"))===null||s===void 0?void 0:s.setAttribute("aria-hidden","true"))}}if(this.variant==="default"){this.autoSetStepTitles=false;if(!this.autoSetStepTitles){t.heading=undefined;o&&((e=o===null||o===void 0?void 0:o.querySelector(".heading"))===null||e===void 0?void 0:e.removeAttribute("aria-hidden"))}}}if(this.variant==="compact"){if(t.current===true||t.type==="current"){t.classList.remove("hide");t.classList.add("show")}else if(t.classList.contains("show")){t.classList.remove("show");t.classList.add("hide")}if(!t.lastStep){const s=this.steps[i+1];t.nextStepHeading=this.stepHeading(s,true);t.progress=t.stepNum/this.steps.length*100}else if(t.lastStep&&this.stepTypes[i]!=="completed"){t.progress=95}else{t.progress=100}if(this.hideStepInfo&&o!==null){o.classList.remove(this.visuallyHidden)}t.compactStepStyling=this.stepTypes[i]}if(this.variant==="default"){if(!t.lastStep){if(this.alignedFullWidth&&this.stepperWidth!==undefined){t.style.width=h(`${(this.stepperWidth-this.lastStepWidth)/(this.steps.length-1)}px`);t.style.minWidth=h("148px")}}else if(t.lastStep){t.classList.add("last-step");if(this.alignedFullWidth){t.style.maxWidth=`${this.lastStepWidth}px`}else if(this.connectorWidth){t.style.maxWidth=this.connectorWidth>100?h(`${this.connectorWidth+48}px`):h("148px")}}if(this.aligned==="left"&&this.connectorWidth){t.style.width=this.connectorWidth>100?h(`${this.connectorWidth+48}px`):h("148px");const i=(l=t.shadowRoot)===null||l===void 0?void 0:l.querySelector(".step > .step-top > .step-connect");if(i){i.style.width=this.connectorWidth>100?h(`${this.connectorWidth}px`):h("100px")}}if(this.hideStepInfo&&o!==null){o.classList.add(this.visuallyHidden)}}}))};this.setHideStepInfo=()=>{this.steps.forEach((t=>{var i,s,e;const h=(i=t.shadowRoot)===null||i===void 0?void 0:i.querySelector(".step > .heading-area");if(h){if(this.hideStepInfo){(s=h.classList)===null||s===void 0?void 0:s.add(this.visuallyHidden)}else{(e=h.classList)===null||e===void 0?void 0:e.remove(this.visuallyHidden)}}}))};this.overrideVariant=()=>{if(this.variantOverride){let t=148*this.steps.length;if(this.aligned==="left"&&this.connectorWidth&&this.connectorWidth>100){t=(this.connectorWidth+48)*this.steps.length}if(this.el.clientWidth<t){this.variant="compact"}else{this.variant="default"}}};this.resizeObserverCallback=()=>{this.getChildren();this.checkStepTitles();this.overrideVariant();this.setStepperWidth();this.initialiseStepStates();this.handleThemeChange()};this.runResizeObserver=()=>{this.resizeObserver=new ResizeObserver((()=>{this.resizeObserverCallback()}));this.resizeObserver.observe(this.el)}}handleThemeChange(){this.getChildren();this.steps.forEach((t=>{t.theme=this.theme}))}handlePropChange(){this.setHideStepInfo();this.getChildren()}disconnectedCallback(){if(this.resizeObserver!==null){this.resizeObserver.disconnect()}}componentWillLoad(){this.setStepTypes();this.handleThemeChange();if(this.variant==="compact"){this.variantOverride=false}}componentWillRender(){this.initialiseStepStates()}componentDidLoad(){l(this.runResizeObserver)}render(){return i(s,{key:"
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,h as i,H as s,g as e}from"./p-8e4e97b4.js";import{p as h,h as l}from"./p-eeb8d98a.js";import"./p-6215e2ae.js";const o=":host{display:flex;width:100%}.step-item-list{display:flex;margin:0;padding:0}:host(.ic-stepper-default:not(.ic-stepper-aligned-left)) .step-item-list{flex:auto}:host(.ic-stepper-compact) ul ::slotted(ic-step){display:none}:host(.ic-stepper-compact) ul ::slotted(ic-step.show){display:flex}:host(.ic-stepper-compact) ul ::slotted(ic-step.hide){display:none;opacity:0;visibility:hidden}";const n=o;const d=class{constructor(i){t(this,i);var s;this.resizeObserver=null;this.visuallyHidden="visually-hidden";this.alignedFullWidth=true;this.autoSetStepTitles=true;this.lastStepWidth=0;this.noOfResizes=0;this.stepperWidth=(s=document.querySelector("ic-stepper"))===null||s===void 0?void 0:s.getBoundingClientRect().width;this.stepTypes=[];this.variantOverride=this.variant!=="compact";this.aligned="full-width";this.connectorWidth=100;this.hideStepInfo=false;this.icI18n={next:"Next",step:"Step",steps:"Steps",of:"of",lastStep:"Last step",completed:"Completed",notRequired:"Not required",required:"Required",optional:"Optional"};this.theme="inherit";this.variant="default";this.stepHeading=(t,i=false)=>{var s,e,h,l;if(t.hasAttribute("heading")&&t.getAttribute("heading")!==""){return t.getAttribute("heading")||undefined}const o=(s=t.shadowRoot)===null||s===void 0?void 0:s.querySelector('slot[name="heading"]');const n=((e=o===null||o===void 0?void 0:o.assignedNodes)===null||e===void 0?void 0:e.call(o))||[];for(const t of n){const i=t.nodeType===Node.TEXT_NODE?(h=t.textContent)===null||h===void 0?void 0:h.trim():(l=t.innerText)===null||l===void 0?void 0:l.trim();if(i)return i}if(i&&t.heading){return t.heading}return undefined};this.getChildren=()=>{this.steps=Array.from(this.el.querySelectorAll("ic-step"));this.stepsWithStepTitles=this.steps.filter((t=>!!this.stepHeading(t,false)))};this.checkStepTitles=()=>{if(this.stepsWithStepTitles.length<this.steps.length&&this.variantOverride&&this.variant==="compact"){this.noOfResizes=this.noOfResizes+1;if(this.noOfResizes===1){console.error(`The prop 'heading' is required for all steps of the Stepper component (compact variant)`)}}};this.setStepTypes=()=>{this.getChildren();this.stepTypes=[];for(let t=0;t<this.steps.length;t++){this.stepTypes.push("active")}};this.setStepperWidth=()=>{this.alignedFullWidth=this.variant==="default"&&this.aligned==="full-width";const t=this.steps[this.steps.length-1];t.style.maxWidth="none";if(this.alignedFullWidth){this.stepperWidth=this.el.offsetWidth;t.style.maxWidth=h(`${this.stepperWidth/this.steps.length}px`);this.lastStepWidth=t.offsetWidth}};this.initialiseStepStates=()=>{this.steps.forEach(((t,i)=>{var s,e,l;if(this.icI18n!==undefined){t.icI18n=this.icI18n}t.variant=this.variant;t.stepNum=i+1;t.lastStep=i===this.steps.length-1;t.lastStepNum=this.steps.length;if(t.type!=="current"){t.current=false;this.stepTypes[i]=t.type}else{t.current=true}const o=t.shadowRoot&&t.shadowRoot.querySelector(".step > .heading-area");if(this.stepsWithStepTitles.length==0&&this.variantOverride){if(this.variant==="compact"){this.autoSetStepTitles=true;if(this.autoSetStepTitles){t.heading="Step "+t.stepNum;o&&((s=o===null||o===void 0?void 0:o.querySelector(".heading"))===null||s===void 0?void 0:s.setAttribute("aria-hidden","true"))}}if(this.variant==="default"){this.autoSetStepTitles=false;if(!this.autoSetStepTitles){t.heading=undefined;o&&((e=o===null||o===void 0?void 0:o.querySelector(".heading"))===null||e===void 0?void 0:e.removeAttribute("aria-hidden"))}}}if(this.variant==="compact"){if(t.current===true||t.type==="current"){t.classList.remove("hide");t.classList.add("show")}else if(t.classList.contains("show")){t.classList.remove("show");t.classList.add("hide")}if(!t.lastStep){const s=this.steps[i+1];t.nextStepHeading=this.stepHeading(s,true);t.progress=t.stepNum/this.steps.length*100}else if(t.lastStep&&this.stepTypes[i]!=="completed"){t.progress=95}else{t.progress=100}if(this.hideStepInfo&&o!==null){o.classList.remove(this.visuallyHidden)}t.compactStepStyling=this.stepTypes[i]}if(this.variant==="default"){if(!t.lastStep){if(this.alignedFullWidth&&this.stepperWidth!==undefined){t.style.width=h(`${(this.stepperWidth-this.lastStepWidth)/(this.steps.length-1)}px`);t.style.minWidth=h("148px")}}else if(t.lastStep){t.classList.add("last-step");if(this.alignedFullWidth){t.style.maxWidth=`${this.lastStepWidth}px`}else if(this.connectorWidth){t.style.maxWidth=this.connectorWidth>100?h(`${this.connectorWidth+48}px`):h("148px")}}if(this.aligned==="left"&&this.connectorWidth){t.style.width=this.connectorWidth>100?h(`${this.connectorWidth+48}px`):h("148px");const i=(l=t.shadowRoot)===null||l===void 0?void 0:l.querySelector(".step > .step-top > .step-connect");if(i){i.style.width=this.connectorWidth>100?h(`${this.connectorWidth}px`):h("100px")}}if(this.hideStepInfo&&o!==null){o.classList.add(this.visuallyHidden)}}}))};this.setHideStepInfo=()=>{this.steps.forEach((t=>{var i,s,e;const h=(i=t.shadowRoot)===null||i===void 0?void 0:i.querySelector(".step > .heading-area");if(h){if(this.hideStepInfo){(s=h.classList)===null||s===void 0?void 0:s.add(this.visuallyHidden)}else{(e=h.classList)===null||e===void 0?void 0:e.remove(this.visuallyHidden)}}}))};this.overrideVariant=()=>{if(this.variantOverride){let t=148*this.steps.length;if(this.aligned==="left"&&this.connectorWidth&&this.connectorWidth>100){t=(this.connectorWidth+48)*this.steps.length}if(this.el.clientWidth<t){this.variant="compact"}else{this.variant="default"}}};this.resizeObserverCallback=()=>{this.getChildren();this.checkStepTitles();this.overrideVariant();this.setStepperWidth();this.initialiseStepStates();this.handleThemeChange()};this.runResizeObserver=()=>{this.resizeObserver=new ResizeObserver((()=>{this.resizeObserverCallback()}));this.resizeObserver.observe(this.el)}}handleThemeChange(){this.getChildren();this.steps.forEach((t=>{t.theme=this.theme}))}handlePropChange(){this.setHideStepInfo();this.getChildren()}disconnectedCallback(){if(this.resizeObserver!==null){this.resizeObserver.disconnect()}}componentWillLoad(){this.setStepTypes();this.handleThemeChange();if(this.variant==="compact"){this.variantOverride=false}}componentWillRender(){this.initialiseStepStates()}componentDidLoad(){l(this.runResizeObserver)}render(){return i(s,{key:"43ebd8034b0dc4cad15543c27a8c668b9e7326af",class:{[`ic-stepper-${this.variant}`]:true,["ic-stepper-aligned-left"]:this.variant==="default"&&this.aligned==="left",[`ic-theme-${this.theme}`]:this.theme!=="inherit"}},i("ul",{key:"8952857df3eb9fef64eb467ee2c89c78672b9c22",class:"step-item-list"},i("slot",{key:"e22c1e35f0679a1caf67c1552ea3534932c76949"})))}get el(){return e(this)}static get watchers(){return{theme:["handleThemeChange"],hideStepInfo:["handlePropChange"],variant:["handlePropChange"]}}};d.style=n;export{d as ic_stepper};
|
|
2
|
+
//# sourceMappingURL=p-987b08f9.entry.js.map
|