le-kit 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/le-icon.cjs.entry.js +3 -1
- package/dist/cjs/le-kit.cjs.js +1 -1
- package/dist/cjs/le-navigation.cjs.entry.js +109 -37
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/le-icon/le-icon.js +3 -1
- package/dist/collection/components/le-icon/le-icon.js.map +1 -1
- package/dist/collection/components/le-navigation/le-navigation.css +4 -0
- package/dist/collection/components/le-navigation/le-navigation.js +152 -36
- package/dist/collection/components/le-navigation/le-navigation.js.map +1 -1
- package/dist/collection/dist/components/assets/custom-elements.json +5149 -5001
- package/dist/collection/dist/components/assets/icons/ellipsis-horizontal.json +14 -0
- package/dist/collection/dist/components/assets/icons/ellipsis-vertical.json +14 -0
- package/dist/collection/dist/components/assets/icons/hamburger.json +14 -0
- package/dist/collection/types/options.js.map +1 -1
- package/dist/components/assets/custom-elements.json +5149 -5001
- package/dist/components/assets/icons/ellipsis-horizontal.json +14 -0
- package/dist/components/assets/icons/ellipsis-vertical.json +14 -0
- package/dist/components/assets/icons/hamburger.json +14 -0
- package/dist/components/le-icon2.js +3 -1
- package/dist/components/le-icon2.js.map +1 -1
- package/dist/components/le-navigation.js +112 -37
- package/dist/components/le-navigation.js.map +1 -1
- package/dist/docs.json +95 -6
- package/dist/esm/le-icon.entry.js +3 -1
- package/dist/esm/le-icon.entry.js.map +1 -1
- package/dist/esm/le-kit.js +1 -1
- package/dist/esm/le-navigation.entry.js +109 -37
- package/dist/esm/le-navigation.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/le-kit/dist/components/assets/custom-elements.json +5149 -5001
- package/dist/le-kit/dist/components/assets/icons/ellipsis-horizontal.json +14 -0
- package/dist/le-kit/dist/components/assets/icons/ellipsis-vertical.json +14 -0
- package/dist/le-kit/dist/components/assets/icons/hamburger.json +14 -0
- package/dist/le-kit/le-kit.esm.js +1 -1
- package/dist/le-kit/p-409db53a.entry.js +2 -0
- package/dist/le-kit/p-409db53a.entry.js.map +1 -0
- package/dist/le-kit/p-b78ae198.entry.js +2 -0
- package/dist/le-kit/p-b78ae198.entry.js.map +1 -0
- package/dist/types/components/le-navigation/le-navigation.d.ts +17 -0
- package/dist/types/components.d.ts +20 -0
- package/dist/types/types/options.d.ts +5 -0
- package/package.json +2 -2
- package/dist/le-kit/dist/components/themes/base.css +0 -89
- package/dist/le-kit/dist/components/themes/dark.css +0 -103
- package/dist/le-kit/dist/components/themes/default.css +0 -111
- package/dist/le-kit/dist/components/themes/gradient.css +0 -103
- package/dist/le-kit/dist/components/themes/index.css +0 -76
- package/dist/le-kit/dist/components/themes/minimal.css +0 -103
- package/dist/le-kit/dist/components/themes/warm.css +0 -103
- package/dist/le-kit/p-bb160082.entry.js +0 -2
- package/dist/le-kit/p-bb160082.entry.js.map +0 -1
- package/dist/le-kit/p-f2fa3bf5.entry.js +0 -2
- package/dist/le-kit/p-f2fa3bf5.entry.js.map +0 -1
- /package/dist/collection/dist/{components/themes → themes}/base.css +0 -0
- /package/dist/collection/dist/{components/themes → themes}/dark.css +0 -0
- /package/dist/collection/dist/{components/themes → themes}/default.css +0 -0
- /package/dist/collection/dist/{components/themes → themes}/gradient.css +0 -0
- /package/dist/collection/dist/{components/themes → themes}/index.css +0 -0
- /package/dist/collection/dist/{components/themes → themes}/minimal.css +0 -0
- /package/dist/collection/dist/{components/themes → themes}/warm.css +0 -0
- /package/dist/{components → le-kit/dist}/themes/base.css +0 -0
- /package/dist/{components → le-kit/dist}/themes/dark.css +0 -0
- /package/dist/{components → le-kit/dist}/themes/default.css +0 -0
- /package/dist/{components → le-kit/dist}/themes/gradient.css +0 -0
- /package/dist/{components → le-kit/dist}/themes/index.css +0 -0
- /package/dist/{components → le-kit/dist}/themes/minimal.css +0 -0
- /package/dist/{components → le-kit/dist}/themes/warm.css +0 -0
|
@@ -11,6 +11,7 @@ async function fetchIcon({ name }) {
|
|
|
11
11
|
return iconCache[name];
|
|
12
12
|
}
|
|
13
13
|
if (!requestCache[name]) {
|
|
14
|
+
console.log(`Fetching icon "${name}"`, index.getAssetPath(`./assets/icons/${name}.json`));
|
|
14
15
|
requestCache[name] = fetch(index.getAssetPath(`./assets/icons/${name}.json`))
|
|
15
16
|
.then(resp => resp.json())
|
|
16
17
|
.catch(() => {
|
|
@@ -96,8 +97,9 @@ const LeIcon = class {
|
|
|
96
97
|
return svgElements;
|
|
97
98
|
}
|
|
98
99
|
render() {
|
|
99
|
-
return (index.h("svg", { key: '
|
|
100
|
+
return (index.h("svg", { key: '5419a60a1190bf66b9051796e0c8ae6f10a15ffc', xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", height: this.size, width: this.size, viewBox: this.iconData?.viewBox || `0 0 ${this.size} ${this.size}` }, this.renderSVGContent(this.iconData?.children)));
|
|
100
101
|
}
|
|
102
|
+
static get assetsDirs() { return ["icons"]; }
|
|
101
103
|
static get watchers() { return {
|
|
102
104
|
"name": ["loadIconData"]
|
|
103
105
|
}; }
|
package/dist/cjs/le-kit.cjs.js
CHANGED
|
@@ -18,7 +18,7 @@ var patchBrowser = () => {
|
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(async (options) => {
|
|
20
20
|
await index.globalScripts();
|
|
21
|
-
return index.bootstrapLazy([["le-button_13.cjs",[[769,"le-header",{"isStatic":[516,"static"],"sticky":[516],"fixed":[516],"revealOnScroll":[513,"reveal-on-scroll"],"shrinkOffset":[513,"shrink-offset"],"expandOnHover":[516,"expand-on-hover"],"revealed":[32],"shrunk":[32],"placeholderHeight":[32],"hoverActive":[32]},[[9,"scroll","onWindowScroll"],[9,"resize","onWindowResize"]],{"revealOnScroll":["onBehaviorPropsChange"],"shrinkOffset":["onBehaviorPropsChange"],"fixed":["onBehaviorPropsChange"],"sticky":["onBehaviorPropsChange"],"isStatic":["onBehaviorPropsChange"]}],[769,"le-current-heading",{"selector":[1],"activeText":[32]},[[9,"scroll","onScroll"],[9,"resize","onResize"]],{"selector":["onSelectorChange"]}],[769,"le-scroll-progress",{"trackScrollProgress":[513,"track-scroll-progress"],"progress":[32]},[[9,"scroll","onScroll"],[9,"resize","onResize"]],{"trackScrollProgress":["onTrackChange"]}],[769,"le-collapse",{"closed":[1540],"scrollDown":[516,"scroll-down"],"noFading":[516,"no-fading"],"collapseOnHeaderShrink":[516,"collapse-on-header-shrink"],"headerShrunk":[32]},[[8,"leHeaderShrinkChange","handleHeaderShrink"]],{"open":["onOpenChange"],"headerShrunk":["onDrivenStateChange"]}],[769,"le-dropdown-base",{"options":[16],"value":[8],"multiple":[4],"open":[1540],"disabled":[516],"filterFn":[16],"filterQuery":[1,"filter-query"],"emptyText":[1,"empty-text"],"showCheckboxes":[4,"show-checkboxes"],"maxHeight":[1,"max-height"],"width":[1],"fullWidth":[4,"full-width"],"closeOnClickOutside":[4,"close-on-click-outside"],"focusedIndex":[32],"filteredOptions":[32],"show":[64],"hide":[64],"toggle":[64]},null,{"options":["handleOptionsChange"],"filterQuery":["handleOptionsChange"]}],[769,"le-popup",{"mode":[1537],"open":[1540],"type":[1],"popupTitle":[1,"popup-title"],"message":[1],"modal":[4],"position":[1],"confirmText":[1,"confirm-text"],"cancelText":[1,"cancel-text"],"placeholder":[1],"defaultValue":[1,"default-value"],"closeOnBackdrop":[4,"close-on-backdrop"],"inputValue":[32],"show":[64],"hide":[64]}],[769,"le-button",{"mode":[1537],"variant":[1],"color":[1],"size":[1],"selected":[4],"fullWidth":[516,"full-width"],"iconOnly":[1,"icon-only"],"iconStart":[1,"icon-start"],"iconEnd":[1,"icon-end"],"disabled":[4],"type":[1],"href":[1],"target":[1],"align":[1]}],[769,"le-checkbox",{"checked":[1540],"disabled":[4],"name":[1],"value":[1],"externalId":[1,"external-id"]}],[769,"le-component",{"component":[1],"displayName":[1,"display-name"],"hostClass":[1,"host-class"],"hostStyle":[16],"adminMode":[32],"componentMeta":[32],"propertyValues":[32]}],[769,"le-select",{"options":[1],"value":[1032],"placeholder":[1],"disabled":[516],"required":[4],"name":[1],"fullWidth":[4,"full-width"],"size":[513],"variant":[513],"searchable":[4],"emptyText":[1,"empty-text"],"open":[1540],"selectedOption":[32],"searchQuery":[32],"showDropdown":[64],"hideDropdown":[64]},null,{"value":["handleValueChange"],"options":["handleOptionsChange"]}],[769,"le-slot",{"type":[1],"name":[1],"label":[1],"description":[1],"allowedComponents":[1,"allowed-components"],"multiple":[4],"required":[4],"placeholder":[1],"tag":[1],"slotStyle":[1,"slot-style"],"adminMode":[32],"textValue":[32],"isValidHtml":[32],"availableComponents":[32],"pickerOpen":[32]}],[769,"le-string-input",{"inputRef":[16],"mode":[1537],"value":[1537],"name":[1],"type":[1],"label":[1],"iconStart":[1,"icon-start"],"iconEnd":[1,"icon-end"],"placeholder":[1],"hideDescription":[4,"hide-description"],"disabled":[4],"readonly":[4],"externalId":[1,"external-id"]}],[769,"le-popover",{"mode":[1537],"open":[1540],"position":[1],"align":[1],"popoverTitle":[1,"popover-title"],"showClose":[4,"show-close"],"closeOnClickOutside":[4,"close-on-click-outside"],"closeOnEscape":[4,"close-on-escape"],"offset":[2],"width":[1],"minWidth":[1,"min-width"],"maxWidth":[1,"max-width"],"triggerFullWidth":[4,"trigger-full-width"],"isPositioned":[32],"updatePosition":[64],"show":[64],"hide":[64],"toggle":[64]}]]],["le-navigation.cjs",[[769,"le-navigation",{"items":[1],"orientation":[513],"wrap":[516],"overflowMode":[513,"overflow-mode"],"activeUrl":[1,"active-url"],"searchable":[4],"searchPlaceholder":[1,"search-placeholder"],"emptyText":[1,"empty-text"],"submenuSearchable":[4,"submenu-searchable"],"searchQuery":[32],"openState":[32],"overflowIds":[32],"hamburgerActive":[32],"submenuQueries":[32]},null,{"items":["handleLayoutInputsChange"],"orientation":["handleLayoutInputsChange"],"wrap":["handleLayoutInputsChange"],"overflowMode":["handleLayoutInputsChange"]}]]],["le-multiselect.cjs",[[769,"le-multiselect",{"options":[1],"value":[1040],"placeholder":[1],"disabled":[516],"required":[4],"name":[1],"fullWidth":[516,"full-width"],"size":[513],"maxSelections":[2,"max-selections"],"showSelectAll":[1032,"show-select-all"],"searchable":[4],"emptyText":[1,"empty-text"],"open":[1540],"selectAllLabel":[32],"deselectAllLabel":[32],"selectedOptions":[32],"searchQuery":[32],"showDropdown":[64],"hideDropdown":[64],"clearSelection":[64]},null,{"value":["handleValueChange"],"options":["handleOptionsChange"],"showSelectAll":["handleShowSelectAllChange"]}]]],["le-segmented-control.cjs",[[769,"le-segmented-control",{"options":[16],"value":[1032],"size":[1],"overflow":[1],"fullWidth":[4,"full-width"],"disabled":[4],"segmentConfigs":[32],"focusedIndex":[32],"isDeclarativeMode":[32]},[[0,"slotchange","handleSlotChange"]],{"options":["tabsChanged"]}]]],["le-tab-bar.cjs",[[769,"le-tab-bar",{"tabs":[16],"selected":[1032],"fullWidth":[4,"full-width"],"showLabels":[4,"show-labels"],"position":[1],"size":[1],"bordered":[4],"tabConfigs":[32],"isDeclarativeMode":[32],"focusedIndex":[32]},[[0,"slotchange","handleSlotChange"]],{"selected":["selectedChanged"],"tabs":["tabsChanged"]}]]],["le-tabs.cjs",[[769,"le-tabs",{"tabs":[16],"selected":[1032],"orientation":[1],"position":[1],"variant":[1],"fullWidth":[4,"full-width"],"size":[1],"wrap":[4],"overflow":[1],"tabConfigs":[32],"focusedIndex":[32],"isDeclarativeMode":[32]},[[0,"slotchange","handleSlotChange"]],{"selected":["selectedChanged"],"tabs":["tabsChanged"]}]]],["le-box.cjs",[[769,"le-box",{"grow":[2],"shrink":[2],"basis":[1],"width":[1],"height":[1],"minWidth":[1,"min-width"],"maxWidth":[1,"max-width"],"minHeight":[1,"min-height"],"maxHeight":[1,"max-height"],"background":[1],"borderRadius":[1,"border-radius"],"border":[1],"alignSelf":[1,"align-self"],"alignContent":[1,"align-content"],"justifyContent":[1,"justify-content"],"padding":[1],"order":[2],"displayFlex":[4,"display-flex"],"innerDirection":[1,"inner-direction"],"innerGap":[1,"inner-gap"]}]]],["le-card.cjs",[[769,"le-card",{"variant":[1],"interactive":[4]}]]],["le-combobox.cjs",[[769,"le-combobox",{"options":[1],"value":[1032],"placeholder":[1],"disabled":[516],"required":[4],"name":[1],"fullWidth":[516,"full-width"],"size":[513],"allowCustom":[4,"allow-custom"],"minSearchLength":[2,"min-search-length"],"emptyText":[1,"empty-text"],"open":[1540],"inputValue":[32],"selectedOption":[32],"showDropdown":[64],"hideDropdown":[64],"focusInput":[64]},[[8,"click","handleWindowClick"]],{"value":["handleValueChange"],"options":["handleOptionsChange"]}]]],["le-number-input.cjs",[[769,"le-number-input",{"value":[1538],"name":[1],"label":[1],"placeholder":[1],"min":[2],"max":[2],"step":[2],"required":[4],"disabled":[4],"readonly":[4],"iconStart":[1,"icon-start"],"showSpinners":[4,"show-spinners"],"externalId":[1,"external-id"],"isValid":[32],"validationMessage":[32]},null,{"value":["valueChanged"]}]]],["le-stack.cjs",[[769,"le-stack",{"direction":[1],"gap":[1],"align":[1],"justify":[1],"wrap":[4],"alignContent":[1,"align-content"],"reverse":[4],"maxItems":[2,"max-items"],"fullWidth":[4,"full-width"],"fullHeight":[4,"full-height"],"padding":[1]}]]],["le-tab-panel.cjs",[[769,"le-tab-panel",{"label":[1],"value":[1],"iconStart":[1,"icon-start"],"iconEnd":[1,"icon-end"],"disabled":[4],"lazy":[4],"active":[32],"hasBeenActive":[32],"getValue":[64],"getTabConfig":[64],"setActive":[64]},null,{"active":["activeChanged"]}]]],["le-text.cjs",[[769,"le-text",{"variant":[1537],"align":[513],"color":[1],"truncate":[4],"maxLines":[2,"max-lines"],"adminMode":[32],"content":[32],"isFocused":[32],"selectionState":[32]},null,{"variant":["onVariantChange"]}]]],["le-header-placeholder.cjs",[[256,"le-header-placeholder"]]],["le-round-progress.cjs",[[769,"le-round-progress",{"value":[2],"padding":[2],"paths":[1],"params":[32]},null,{"value":["updateValue"],"padding":["updatePadding"],"paths":["updateProgressBackgrounds"]}]]],["le-turntable.cjs",[[769,"le-turntable",{"center":[1],"value":[2]},[[9,"mousemove","handleMouseMove"],[9,"mouseup","handleMouseUp"],[9,"resize","handleWindowResize"]],{"value":["updateValue"]}]]],["le-tag.cjs",[[769,"le-tag",{"label":[1],"mode":[1537],"icon":[1],"dismissible":[4],"disabled":[516],"size":[513],"variant":[513]}]]],["le-icon.cjs",[[769,"le-icon",{"name":[1],"size":[2],"iconData":[32],"visible":[32]},null,{"name":["loadIconData"]}]]],["le-tab.cjs",[[769,"le-tab",{"mode":[1537],"label":[1],"value":[1],"variant":[1],"position":[1],"size":[1],"focusable":[4],"selected":[4],"fullWidth":[516,"full-width"],"icon":[1],"showLabel":[4,"show-label"],"iconStart":[1,"icon-start"],"iconEnd":[1,"icon-end"],"disabled":[4],"href":[1],"target":[1],"align":[1],"getTabConfig":[64]}]]]], options);
|
|
21
|
+
return index.bootstrapLazy([["le-button_13.cjs",[[769,"le-header",{"isStatic":[516,"static"],"sticky":[516],"fixed":[516],"revealOnScroll":[513,"reveal-on-scroll"],"shrinkOffset":[513,"shrink-offset"],"expandOnHover":[516,"expand-on-hover"],"revealed":[32],"shrunk":[32],"placeholderHeight":[32],"hoverActive":[32]},[[9,"scroll","onWindowScroll"],[9,"resize","onWindowResize"]],{"revealOnScroll":["onBehaviorPropsChange"],"shrinkOffset":["onBehaviorPropsChange"],"fixed":["onBehaviorPropsChange"],"sticky":["onBehaviorPropsChange"],"isStatic":["onBehaviorPropsChange"]}],[769,"le-current-heading",{"selector":[1],"activeText":[32]},[[9,"scroll","onScroll"],[9,"resize","onResize"]],{"selector":["onSelectorChange"]}],[769,"le-scroll-progress",{"trackScrollProgress":[513,"track-scroll-progress"],"progress":[32]},[[9,"scroll","onScroll"],[9,"resize","onResize"]],{"trackScrollProgress":["onTrackChange"]}],[769,"le-collapse",{"closed":[1540],"scrollDown":[516,"scroll-down"],"noFading":[516,"no-fading"],"collapseOnHeaderShrink":[516,"collapse-on-header-shrink"],"headerShrunk":[32]},[[8,"leHeaderShrinkChange","handleHeaderShrink"]],{"open":["onOpenChange"],"headerShrunk":["onDrivenStateChange"]}],[769,"le-dropdown-base",{"options":[16],"value":[8],"multiple":[4],"open":[1540],"disabled":[516],"filterFn":[16],"filterQuery":[1,"filter-query"],"emptyText":[1,"empty-text"],"showCheckboxes":[4,"show-checkboxes"],"maxHeight":[1,"max-height"],"width":[1],"fullWidth":[4,"full-width"],"closeOnClickOutside":[4,"close-on-click-outside"],"focusedIndex":[32],"filteredOptions":[32],"show":[64],"hide":[64],"toggle":[64]},null,{"options":["handleOptionsChange"],"filterQuery":["handleOptionsChange"]}],[769,"le-popup",{"mode":[1537],"open":[1540],"type":[1],"popupTitle":[1,"popup-title"],"message":[1],"modal":[4],"position":[1],"confirmText":[1,"confirm-text"],"cancelText":[1,"cancel-text"],"placeholder":[1],"defaultValue":[1,"default-value"],"closeOnBackdrop":[4,"close-on-backdrop"],"inputValue":[32],"show":[64],"hide":[64]}],[769,"le-button",{"mode":[1537],"variant":[1],"color":[1],"size":[1],"selected":[4],"fullWidth":[516,"full-width"],"iconOnly":[1,"icon-only"],"iconStart":[1,"icon-start"],"iconEnd":[1,"icon-end"],"disabled":[4],"type":[1],"href":[1],"target":[1],"align":[1]}],[769,"le-checkbox",{"checked":[1540],"disabled":[4],"name":[1],"value":[1],"externalId":[1,"external-id"]}],[769,"le-component",{"component":[1],"displayName":[1,"display-name"],"hostClass":[1,"host-class"],"hostStyle":[16],"adminMode":[32],"componentMeta":[32],"propertyValues":[32]}],[769,"le-select",{"options":[1],"value":[1032],"placeholder":[1],"disabled":[516],"required":[4],"name":[1],"fullWidth":[4,"full-width"],"size":[513],"variant":[513],"searchable":[4],"emptyText":[1,"empty-text"],"open":[1540],"selectedOption":[32],"searchQuery":[32],"showDropdown":[64],"hideDropdown":[64]},null,{"value":["handleValueChange"],"options":["handleOptionsChange"]}],[769,"le-slot",{"type":[1],"name":[1],"label":[1],"description":[1],"allowedComponents":[1,"allowed-components"],"multiple":[4],"required":[4],"placeholder":[1],"tag":[1],"slotStyle":[1,"slot-style"],"adminMode":[32],"textValue":[32],"isValidHtml":[32],"availableComponents":[32],"pickerOpen":[32]}],[769,"le-string-input",{"inputRef":[16],"mode":[1537],"value":[1537],"name":[1],"type":[1],"label":[1],"iconStart":[1,"icon-start"],"iconEnd":[1,"icon-end"],"placeholder":[1],"hideDescription":[4,"hide-description"],"disabled":[4],"readonly":[4],"externalId":[1,"external-id"]}],[769,"le-popover",{"mode":[1537],"open":[1540],"position":[1],"align":[1],"popoverTitle":[1,"popover-title"],"showClose":[4,"show-close"],"closeOnClickOutside":[4,"close-on-click-outside"],"closeOnEscape":[4,"close-on-escape"],"offset":[2],"width":[1],"minWidth":[1,"min-width"],"maxWidth":[1,"max-width"],"triggerFullWidth":[4,"trigger-full-width"],"isPositioned":[32],"updatePosition":[64],"show":[64],"hide":[64],"toggle":[64]}]]],["le-navigation.cjs",[[769,"le-navigation",{"items":[1],"orientation":[513],"wrap":[516],"overflowMode":[513,"overflow-mode"],"minVisibleItemsForMore":[2,"min-visible-items-for-more"],"hamburgerAlign":[513,"hamburger-align"],"activeUrl":[1,"active-url"],"searchable":[4],"searchPlaceholder":[1,"search-placeholder"],"emptyText":[1,"empty-text"],"submenuSearchable":[4,"submenu-searchable"],"searchQuery":[32],"openState":[32],"overflowIds":[32],"hamburgerActive":[32],"fallbackHamburger":[32],"submenuQueries":[32]},null,{"items":["handleLayoutInputsChange"],"orientation":["handleLayoutInputsChange"],"wrap":["handleLayoutInputsChange"],"overflowMode":["handleLayoutInputsChange"]}]]],["le-multiselect.cjs",[[769,"le-multiselect",{"options":[1],"value":[1040],"placeholder":[1],"disabled":[516],"required":[4],"name":[1],"fullWidth":[516,"full-width"],"size":[513],"maxSelections":[2,"max-selections"],"showSelectAll":[1032,"show-select-all"],"searchable":[4],"emptyText":[1,"empty-text"],"open":[1540],"selectAllLabel":[32],"deselectAllLabel":[32],"selectedOptions":[32],"searchQuery":[32],"showDropdown":[64],"hideDropdown":[64],"clearSelection":[64]},null,{"value":["handleValueChange"],"options":["handleOptionsChange"],"showSelectAll":["handleShowSelectAllChange"]}]]],["le-segmented-control.cjs",[[769,"le-segmented-control",{"options":[16],"value":[1032],"size":[1],"overflow":[1],"fullWidth":[4,"full-width"],"disabled":[4],"segmentConfigs":[32],"focusedIndex":[32],"isDeclarativeMode":[32]},[[0,"slotchange","handleSlotChange"]],{"options":["tabsChanged"]}]]],["le-tab-bar.cjs",[[769,"le-tab-bar",{"tabs":[16],"selected":[1032],"fullWidth":[4,"full-width"],"showLabels":[4,"show-labels"],"position":[1],"size":[1],"bordered":[4],"tabConfigs":[32],"isDeclarativeMode":[32],"focusedIndex":[32]},[[0,"slotchange","handleSlotChange"]],{"selected":["selectedChanged"],"tabs":["tabsChanged"]}]]],["le-tabs.cjs",[[769,"le-tabs",{"tabs":[16],"selected":[1032],"orientation":[1],"position":[1],"variant":[1],"fullWidth":[4,"full-width"],"size":[1],"wrap":[4],"overflow":[1],"tabConfigs":[32],"focusedIndex":[32],"isDeclarativeMode":[32]},[[0,"slotchange","handleSlotChange"]],{"selected":["selectedChanged"],"tabs":["tabsChanged"]}]]],["le-box.cjs",[[769,"le-box",{"grow":[2],"shrink":[2],"basis":[1],"width":[1],"height":[1],"minWidth":[1,"min-width"],"maxWidth":[1,"max-width"],"minHeight":[1,"min-height"],"maxHeight":[1,"max-height"],"background":[1],"borderRadius":[1,"border-radius"],"border":[1],"alignSelf":[1,"align-self"],"alignContent":[1,"align-content"],"justifyContent":[1,"justify-content"],"padding":[1],"order":[2],"displayFlex":[4,"display-flex"],"innerDirection":[1,"inner-direction"],"innerGap":[1,"inner-gap"]}]]],["le-card.cjs",[[769,"le-card",{"variant":[1],"interactive":[4]}]]],["le-combobox.cjs",[[769,"le-combobox",{"options":[1],"value":[1032],"placeholder":[1],"disabled":[516],"required":[4],"name":[1],"fullWidth":[516,"full-width"],"size":[513],"allowCustom":[4,"allow-custom"],"minSearchLength":[2,"min-search-length"],"emptyText":[1,"empty-text"],"open":[1540],"inputValue":[32],"selectedOption":[32],"showDropdown":[64],"hideDropdown":[64],"focusInput":[64]},[[8,"click","handleWindowClick"]],{"value":["handleValueChange"],"options":["handleOptionsChange"]}]]],["le-number-input.cjs",[[769,"le-number-input",{"value":[1538],"name":[1],"label":[1],"placeholder":[1],"min":[2],"max":[2],"step":[2],"required":[4],"disabled":[4],"readonly":[4],"iconStart":[1,"icon-start"],"showSpinners":[4,"show-spinners"],"externalId":[1,"external-id"],"isValid":[32],"validationMessage":[32]},null,{"value":["valueChanged"]}]]],["le-stack.cjs",[[769,"le-stack",{"direction":[1],"gap":[1],"align":[1],"justify":[1],"wrap":[4],"alignContent":[1,"align-content"],"reverse":[4],"maxItems":[2,"max-items"],"fullWidth":[4,"full-width"],"fullHeight":[4,"full-height"],"padding":[1]}]]],["le-tab-panel.cjs",[[769,"le-tab-panel",{"label":[1],"value":[1],"iconStart":[1,"icon-start"],"iconEnd":[1,"icon-end"],"disabled":[4],"lazy":[4],"active":[32],"hasBeenActive":[32],"getValue":[64],"getTabConfig":[64],"setActive":[64]},null,{"active":["activeChanged"]}]]],["le-text.cjs",[[769,"le-text",{"variant":[1537],"align":[513],"color":[1],"truncate":[4],"maxLines":[2,"max-lines"],"adminMode":[32],"content":[32],"isFocused":[32],"selectionState":[32]},null,{"variant":["onVariantChange"]}]]],["le-header-placeholder.cjs",[[256,"le-header-placeholder"]]],["le-round-progress.cjs",[[769,"le-round-progress",{"value":[2],"padding":[2],"paths":[1],"params":[32]},null,{"value":["updateValue"],"padding":["updatePadding"],"paths":["updateProgressBackgrounds"]}]]],["le-turntable.cjs",[[769,"le-turntable",{"center":[1],"value":[2]},[[9,"mousemove","handleMouseMove"],[9,"mouseup","handleMouseUp"],[9,"resize","handleWindowResize"]],{"value":["updateValue"]}]]],["le-tag.cjs",[[769,"le-tag",{"label":[1],"mode":[1537],"icon":[1],"dismissible":[4],"disabled":[516],"size":[513],"variant":[513]}]]],["le-icon.cjs",[[769,"le-icon",{"name":[1],"size":[2],"iconData":[32],"visible":[32]},null,{"name":["loadIconData"]}]]],["le-tab.cjs",[[769,"le-tab",{"mode":[1537],"label":[1],"value":[1],"variant":[1],"position":[1],"size":[1],"focusable":[4],"selected":[4],"fullWidth":[516,"full-width"],"icon":[1],"showLabel":[4,"show-label"],"iconStart":[1,"icon-start"],"iconEnd":[1,"icon-end"],"disabled":[4],"href":[1],"target":[1],"align":[1],"getTabConfig":[64]}]]]], options);
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
exports.setNonce = index.setNonce;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var index = require('./index-pT2cVC5w.js');
|
|
4
4
|
var utils = require('./utils-ByTskwtC.js');
|
|
5
5
|
|
|
6
|
-
const leNavigationCss = () => `:host{display:block;--le-nav-radius:var(--le-radius-md);--le-nav-gap:var(--le-spacing-2);--le-nav-item-padding-x:var(--le-spacing-1);--le-nav-item-padding-y:var(--le-spacing-2);--le-nav-item-gap:var(--le-spacing-2);--le-nav-color:var(--le-color-text-primary);--le-nav-muted:var(--le-color-text-secondary);--le-nav-hover-bg:var(--le-color-gray-100);--le-nav-selected-bg:var(--le-color-primary);--le-nav-selected-color:var(--le-color-primary-contrast)}.nav-vertical{display:flex;flex-direction:column;gap:var(--le-nav-gap)}.nav-search{width:100%}.nav-search-input{--le-input-radius:var(--le-radius-md)}.nav-empty{padding:var(--le-spacing-2);color:var(--le-nav-muted);font-size:var(--le-font-size-sm)}.nav-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--le-spacing-1)}.nav-row{display:flex;align-items:stretch;gap:var(--le-spacing-1);border-radius:var(--le-nav-radius)}.nav-row:hover{background:var(--le-nav-hover-bg)}.nav-toggle,.nav-toggle-spacer{box-sizing:border-box;width:var(--le-spacing-4);min-width:var(--le-spacing-4);display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:var(--le-nav-radius);color:inherit}.nav-toggle{background:transparent;cursor:pointer;opacity:0.4}.nav-toggle:hover:not(:disabled){opacity:1}.nav-toggle:focus-visible{outline:2px solid var(--le-color-focus);outline-offset:2px;opacity:1}.nav-chevron{display:inline-block;transition:transform var(--le-transition-fast)}.nav-chevron svg{display:block;width:var(--le-spacing-4);height:var(--le-spacing-4)}.nav-node>div>button>.nav-chevron{transform:rotate(-90deg)}.nav-node.open>div>button>.nav-chevron{transform:rotate(0deg)}.nav-item{flex:1;display:inline-flex;align-items:center;gap:var(--le-nav-item-gap);padding:var(--le-nav-item-padding-y) var(--le-nav-item-padding-x) var(--le-nav-item-padding-y) 0;border-radius:var(--le-nav-radius);border:1px solid transparent;background:transparent;text-decoration:none;color:var(--le-nav-color);font-family:var(--le-font-family-base);font-size:var(--le-font-size-md);line-height:var(--le-line-height-tight);cursor:pointer}.nav-item:focus-visible{outline:2px solid var(--le-color-focus);outline-offset:2px}.nav-node.selected>.nav-row{background:var(--le-nav-selected-bg);color:var(--le-nav-selected-color)}.nav-node.selected>.nav-row>.nav-item{color:inherit}.nav-node.disabled>.nav-row>.nav-item{opacity:0.5;cursor:not-allowed}.nav-text{display:flex;flex-direction:column;min-width:0}.nav-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.nav-description{color:color-mix(in srgb, var(--le-nav-muted) 90%, transparent);font-size:var(--le-font-size-sm);line-height:var(--le-line-height-tight)}.nav-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.nav-icon-end{margin-left:auto}.nav-children{margin-top:var(--le-spacing-1)}.nav-horizontal{display:flex;align-items:center;gap:var(--le-spacing-2)}.nav-horizontal-shell{position:relative}.nav-horizontal-measure{position:absolute;left:-10000px;top:-10000px;visibility:hidden;pointer-events:none;display:flex;align-items:center;gap:var(--le-spacing-2);flex-wrap:wrap}.nav-horizontal.wrap{flex-wrap:wrap}.nav-horizontal.nowrap{flex-wrap:nowrap;overflow:hidden}.h-item{display:flex;align-items:center}.h-link{display:inline-flex;align-items:center;gap:var(--le-spacing-2);padding:var(--le-spacing-2) var(--le-spacing-3);border-radius:var(--le-nav-radius);border:1px solid transparent;background:transparent;text-decoration:none;color:var(--le-nav-color);font-family:var(--le-font-family-base);font-size:var(--le-font-size-md);cursor:pointer}.h-link:hover{background:var(--le-nav-hover-bg)}.h-link:focus-visible{outline:2px solid var(--le-color-focus);outline-offset:2px}.h-link.disabled,.h-trigger.disabled{opacity:0.5;pointer-events:none}.h-link.selected,.h-trigger.selected{background:var(--le-nav-selected-bg);color:var(--le-nav-selected-color)}.h-label{white-space:nowrap}.h-trigger{display:inline-flex;align-items:center;gap:var(--le-spacing-1);border-radius:var(--le-nav-radius)}.h-submenu-toggle{width:var(--le-spacing-3);height:var(--le-spacing-3);display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:var(--le-nav-radius);background:transparent;color:currentColor;cursor:pointer}.h-submenu-toggle:hover{background:var(--le-nav-hover-bg)}.more-trigger-wrap{display:flex;align-items:center}.more-trigger-wrap.is-measure{position:absolute;visibility:hidden;pointer-events:none}.more-trigger-wrap.is-visible{position:static;visibility:visible}.overflow-trigger{display:inline-flex;align-items:center;justify-content:center;gap:var(--le-spacing-2);padding:var(--le-spacing-2) var(--le-spacing-3);border-radius:var(--le-nav-radius);border:1px solid transparent;background:transparent;color:var(--le-nav-color);cursor:pointer;font-family:var(--le-font-family-base);font-size:var(--le-font-size-md)}.overflow-trigger:hover{background:var(--le-nav-hover-bg)}.overflow-trigger:focus-visible{outline:2px solid var(--le-color-focus);outline-offset:2px}le-popover::part(content){padding:var(--le-spacing-1)}`;
|
|
6
|
+
const leNavigationCss = () => `:host{display:block;--le-nav-radius:var(--le-radius-md);--le-nav-gap:var(--le-spacing-2);--le-nav-item-padding-x:var(--le-spacing-1);--le-nav-item-padding-y:var(--le-spacing-2);--le-nav-item-gap:var(--le-spacing-2);--le-nav-color:var(--le-color-text-primary);--le-nav-muted:var(--le-color-text-secondary);--le-nav-hover-bg:var(--le-color-gray-100);--le-nav-selected-bg:var(--le-color-primary);--le-nav-selected-color:var(--le-color-primary-contrast)}.nav-vertical{display:flex;flex-direction:column;gap:var(--le-nav-gap)}.nav-search{width:100%}.nav-search-input{--le-input-radius:var(--le-radius-md)}.nav-empty{padding:var(--le-spacing-2);color:var(--le-nav-muted);font-size:var(--le-font-size-sm)}.nav-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--le-spacing-1)}.nav-row{display:flex;align-items:stretch;gap:var(--le-spacing-1);border-radius:var(--le-nav-radius)}.nav-row:hover{background:var(--le-nav-hover-bg)}.nav-toggle,.nav-toggle-spacer{box-sizing:border-box;width:var(--le-spacing-4);min-width:var(--le-spacing-4);display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:var(--le-nav-radius);color:inherit}.nav-toggle{background:transparent;cursor:pointer;opacity:0.4}.nav-toggle:hover:not(:disabled){opacity:1}.nav-toggle:focus-visible{outline:2px solid var(--le-color-focus);outline-offset:2px;opacity:1}.nav-chevron{display:inline-block;transition:transform var(--le-transition-fast)}.nav-chevron svg{display:block;width:var(--le-spacing-4);height:var(--le-spacing-4)}.nav-node>div>button>.nav-chevron{transform:rotate(-90deg)}.nav-node.open>div>button>.nav-chevron{transform:rotate(0deg)}.nav-item{flex:1;display:inline-flex;align-items:center;gap:var(--le-nav-item-gap);padding:var(--le-nav-item-padding-y) var(--le-nav-item-padding-x) var(--le-nav-item-padding-y) 0;border-radius:var(--le-nav-radius);border:1px solid transparent;background:transparent;text-decoration:none;color:var(--le-nav-color);font-family:var(--le-font-family-base);font-size:var(--le-font-size-md);line-height:var(--le-line-height-tight);cursor:pointer}.nav-item:focus-visible{outline:2px solid var(--le-color-focus);outline-offset:2px}.nav-node.selected>.nav-row{background:var(--le-nav-selected-bg);color:var(--le-nav-selected-color)}.nav-node.selected>.nav-row>.nav-item{color:inherit}.nav-node.disabled>.nav-row>.nav-item{opacity:0.5;cursor:not-allowed}.nav-text{display:flex;flex-direction:column;min-width:0}.nav-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.nav-description{color:color-mix(in srgb, var(--le-nav-muted) 90%, transparent);font-size:var(--le-font-size-sm);line-height:var(--le-line-height-tight)}.nav-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.nav-icon-end{margin-left:auto}.nav-children{margin-top:var(--le-spacing-1)}.nav-horizontal{display:flex;align-items:center;gap:var(--le-spacing-2)}.nav-horizontal.hamburger-align-end{justify-content:flex-end}.nav-horizontal-shell{position:relative}.nav-horizontal-measure{position:absolute;left:-10000px;top:-10000px;visibility:hidden;pointer-events:none;display:flex;align-items:center;gap:var(--le-spacing-2);flex-wrap:wrap}.nav-horizontal.wrap{flex-wrap:wrap}.nav-horizontal.nowrap{flex-wrap:nowrap;overflow:hidden}.h-item{display:flex;align-items:center}.h-link{display:inline-flex;align-items:center;gap:var(--le-spacing-2);padding:var(--le-spacing-2) var(--le-spacing-3);border-radius:var(--le-nav-radius);border:1px solid transparent;background:transparent;text-decoration:none;color:var(--le-nav-color);font-family:var(--le-font-family-base);font-size:var(--le-font-size-md);cursor:pointer}.h-link:hover{background:var(--le-nav-hover-bg)}.h-link:focus-visible{outline:2px solid var(--le-color-focus);outline-offset:2px}.h-link.disabled,.h-trigger.disabled{opacity:0.5;pointer-events:none}.h-link.selected,.h-trigger.selected{background:var(--le-nav-selected-bg);color:var(--le-nav-selected-color)}.h-label{white-space:nowrap}.h-trigger{display:inline-flex;align-items:center;gap:var(--le-spacing-1);border-radius:var(--le-nav-radius)}.h-submenu-toggle{width:var(--le-spacing-3);height:var(--le-spacing-3);display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:var(--le-nav-radius);background:transparent;color:currentColor;cursor:pointer}.h-submenu-toggle:hover{background:var(--le-nav-hover-bg)}.more-trigger-wrap{display:flex;align-items:center}.more-trigger-wrap.is-measure{position:absolute;visibility:hidden;pointer-events:none}.more-trigger-wrap.is-visible{position:static;visibility:visible}.overflow-trigger{display:inline-flex;align-items:center;justify-content:center;gap:var(--le-spacing-2);padding:var(--le-spacing-2) var(--le-spacing-3);border-radius:var(--le-nav-radius);border:1px solid transparent;background:transparent;color:var(--le-nav-color);cursor:pointer;font-family:var(--le-font-family-base);font-size:var(--le-font-size-md)}.overflow-trigger:hover{background:var(--le-nav-hover-bg)}.overflow-trigger:focus-visible{outline:2px solid var(--le-color-focus);outline-offset:2px}le-popover::part(content){padding:var(--le-spacing-1)}`;
|
|
7
7
|
|
|
8
8
|
const LeNavigation = class {
|
|
9
9
|
constructor(hostRef) {
|
|
@@ -32,6 +32,15 @@ const LeNavigation = class {
|
|
|
32
32
|
* - hamburger: turns the whole nav into a hamburger popover
|
|
33
33
|
*/
|
|
34
34
|
overflowMode = 'more';
|
|
35
|
+
/**
|
|
36
|
+
* Minimum number of visible top-level items required to use the "More" overflow.
|
|
37
|
+
* If fewer would be visible, the navigation falls back to hamburger.
|
|
38
|
+
*/
|
|
39
|
+
minVisibleItemsForMore = 2;
|
|
40
|
+
/**
|
|
41
|
+
* Alignment of the hamburger trigger within the row.
|
|
42
|
+
*/
|
|
43
|
+
hamburgerAlign = 'start';
|
|
35
44
|
/**
|
|
36
45
|
* Active url for automatic selection.
|
|
37
46
|
*/
|
|
@@ -67,14 +76,30 @@ const LeNavigation = class {
|
|
|
67
76
|
openState = {};
|
|
68
77
|
overflowIds = [];
|
|
69
78
|
hamburgerActive = false;
|
|
79
|
+
fallbackHamburger = false;
|
|
70
80
|
submenuQueries = {};
|
|
71
81
|
navContainerEl;
|
|
72
82
|
measureEl;
|
|
73
83
|
measureMoreEl;
|
|
74
84
|
topItemEls = new Map();
|
|
75
85
|
popoverRefs = new Map();
|
|
86
|
+
moreTriggerEl;
|
|
87
|
+
hamburgerPopoverEl;
|
|
88
|
+
morePopoverEl;
|
|
76
89
|
resizeObserver;
|
|
77
90
|
instanceId = utils.generateId('le-nav');
|
|
91
|
+
partFromOptionPart(base, part) {
|
|
92
|
+
const raw = (part ?? '').trim();
|
|
93
|
+
if (!raw)
|
|
94
|
+
return base;
|
|
95
|
+
const tokens = raw
|
|
96
|
+
.split(/\s+/)
|
|
97
|
+
.map(t => t.replace(/[^a-zA-Z0-9_-]/g, ''))
|
|
98
|
+
.filter(Boolean);
|
|
99
|
+
if (tokens.length === 0)
|
|
100
|
+
return base;
|
|
101
|
+
return [base, ...tokens.map(t => `${base}-${t}`)].join(' ');
|
|
102
|
+
}
|
|
78
103
|
handleLayoutInputsChange() {
|
|
79
104
|
this.scheduleOverflowRecalc();
|
|
80
105
|
}
|
|
@@ -229,10 +254,12 @@ const LeNavigation = class {
|
|
|
229
254
|
computeOverflow() {
|
|
230
255
|
// Only applies to horizontal, non-wrapping navs.
|
|
231
256
|
if (this.orientation !== 'horizontal' || this.wrap) {
|
|
232
|
-
if (this.overflowIds.length)
|
|
257
|
+
if (!this.overflowIds || this.overflowIds.length)
|
|
233
258
|
this.overflowIds = [];
|
|
234
259
|
if (this.hamburgerActive)
|
|
235
260
|
this.hamburgerActive = false;
|
|
261
|
+
if (this.fallbackHamburger)
|
|
262
|
+
this.fallbackHamburger = false;
|
|
236
263
|
return;
|
|
237
264
|
}
|
|
238
265
|
const container = this.navContainerEl;
|
|
@@ -247,12 +274,34 @@ const LeNavigation = class {
|
|
|
247
274
|
if (shouldHamburger !== this.hamburgerActive) {
|
|
248
275
|
this.hamburgerActive = shouldHamburger;
|
|
249
276
|
}
|
|
250
|
-
if (this.overflowIds.length)
|
|
277
|
+
if (!this.overflowIds || this.overflowIds.length)
|
|
251
278
|
this.overflowIds = [];
|
|
279
|
+
if (this.fallbackHamburger)
|
|
280
|
+
this.fallbackHamburger = false;
|
|
252
281
|
return;
|
|
253
282
|
}
|
|
254
283
|
// overflowMode === 'more'
|
|
255
|
-
this.
|
|
284
|
+
if (this.hamburgerActive)
|
|
285
|
+
this.hamburgerActive = false;
|
|
286
|
+
const computedOverflow = this.computeOverflowMoreByWrap(availableWidth);
|
|
287
|
+
if (!computedOverflow)
|
|
288
|
+
return;
|
|
289
|
+
// Fallback to hamburger when "More" would leave too few items visible
|
|
290
|
+
// or when the trigger itself cannot fit the row.
|
|
291
|
+
const visibleCount = this.parsedItems.length - computedOverflow.length;
|
|
292
|
+
const moreWidth = this.moreTriggerEl?.getBoundingClientRect().width ?? 0;
|
|
293
|
+
const minVisible = Math.max(0, Number(this.minVisibleItemsForMore) || 0);
|
|
294
|
+
const shouldFallback = (computedOverflow.length > 0 && visibleCount < minVisible) ||
|
|
295
|
+
(moreWidth > 0 && moreWidth > availableWidth);
|
|
296
|
+
if (shouldFallback !== this.fallbackHamburger) {
|
|
297
|
+
this.fallbackHamburger = shouldFallback;
|
|
298
|
+
}
|
|
299
|
+
const nextOverflow = shouldFallback ? [] : computedOverflow;
|
|
300
|
+
const same = nextOverflow.length === this.overflowIds?.length &&
|
|
301
|
+
nextOverflow.every((v, i) => v === this.overflowIds[i]);
|
|
302
|
+
if (!same) {
|
|
303
|
+
this.overflowIds = nextOverflow;
|
|
304
|
+
}
|
|
256
305
|
}
|
|
257
306
|
computeOverflowMoreByWrap(availableWidth) {
|
|
258
307
|
const container = this.navContainerEl;
|
|
@@ -260,9 +309,17 @@ const LeNavigation = class {
|
|
|
260
309
|
const measureMore = this.measureMoreEl;
|
|
261
310
|
const items = this.parsedItems;
|
|
262
311
|
if (!container || !measure)
|
|
263
|
-
return;
|
|
312
|
+
return null;
|
|
264
313
|
// Ensure measurement container matches visible container width.
|
|
265
314
|
measure.style.width = `${availableWidth}px`;
|
|
315
|
+
// Keep the measured "More" width aligned with the real trigger width (supports slotted content).
|
|
316
|
+
const realMoreWidth = this.moreTriggerEl?.getBoundingClientRect().width;
|
|
317
|
+
if (measureMore && realMoreWidth && realMoreWidth > 0) {
|
|
318
|
+
const btn = measureMore.querySelector('button');
|
|
319
|
+
if (btn) {
|
|
320
|
+
btn.style.width = `${realMoreWidth}px`;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
266
323
|
const allIds = this.getTopLevelIds(items);
|
|
267
324
|
const itemEls = allIds
|
|
268
325
|
.map(id => measure.querySelector(`[data-nav-id="${CSS.escape(id)}"]`))
|
|
@@ -275,10 +332,7 @@ const LeNavigation = class {
|
|
|
275
332
|
measureMore.style.display = 'none';
|
|
276
333
|
}
|
|
277
334
|
if (itemEls.length === 0) {
|
|
278
|
-
|
|
279
|
-
this.overflowIds = [];
|
|
280
|
-
}
|
|
281
|
-
return;
|
|
335
|
+
return [];
|
|
282
336
|
}
|
|
283
337
|
const firstRowTop = Math.min(...itemEls.map(el => el.offsetTop));
|
|
284
338
|
const overflowSet = new Set();
|
|
@@ -291,10 +345,7 @@ const LeNavigation = class {
|
|
|
291
345
|
overflowSet.add(id);
|
|
292
346
|
});
|
|
293
347
|
if (overflowSet.size === 0) {
|
|
294
|
-
|
|
295
|
-
this.overflowIds = [];
|
|
296
|
-
}
|
|
297
|
-
return;
|
|
348
|
+
return [];
|
|
298
349
|
}
|
|
299
350
|
// Pass 2: show "More" and iteratively move items into overflow until "More" fits on row 1.
|
|
300
351
|
if (measureMore) {
|
|
@@ -325,11 +376,7 @@ const LeNavigation = class {
|
|
|
325
376
|
overflowSet.add(lastId);
|
|
326
377
|
}
|
|
327
378
|
const overflowIds = allIds.filter(id => overflowSet.has(id));
|
|
328
|
-
|
|
329
|
-
overflowIds.every((v, i) => v === this.overflowIds[i]);
|
|
330
|
-
if (!same) {
|
|
331
|
-
this.overflowIds = overflowIds;
|
|
332
|
-
}
|
|
379
|
+
return overflowIds;
|
|
333
380
|
}
|
|
334
381
|
renderHorizontalMeasureItem(item, index$1) {
|
|
335
382
|
const id = this.getItemId(item, String(index$1));
|
|
@@ -342,9 +389,9 @@ const LeNavigation = class {
|
|
|
342
389
|
if (!hasChildren) {
|
|
343
390
|
return (index.h("div", { class: "h-item", ref: setRef, "data-nav-id": id }, index.h("span", { class: "h-link" }, item.iconStart && (index.h("span", { class: "nav-icon", "aria-hidden": "true" }, item.iconStart)), index.h("span", { class: "h-label" }, item.label), item.iconEnd && (index.h("span", { class: "nav-icon nav-icon-end", "aria-hidden": "true" }, item.iconEnd)))));
|
|
344
391
|
}
|
|
345
|
-
return (index.h("div", { class: "h-item", ref: setRef, "data-nav-id": id }, index.h("span", { class: "h-trigger" }, index.h("span", { class: "h-link" }, item.iconStart && (index.h("span", { class: "nav-icon", "aria-hidden": "true" }, item.iconStart)), index.h("span", { class: "h-label" }, item.label)), index.h("span", { class: "h-submenu-toggle", "aria-hidden": "true" }, index.h("
|
|
392
|
+
return (index.h("div", { class: "h-item", ref: setRef, "data-nav-id": id }, index.h("span", { class: "h-trigger" }, index.h("span", { class: "h-link" }, item.iconStart && (index.h("span", { class: "nav-icon", "aria-hidden": "true" }, item.iconStart)), index.h("span", { class: "h-label" }, item.label)), index.h("span", { class: "h-submenu-toggle", "aria-hidden": "true" }, index.h("le-icon", { name: "chevron-down" })))));
|
|
346
393
|
}
|
|
347
|
-
renderVerticalList(items, { depth, pathPrefix, autoOpenIds, searchable, searchQuery, searchPlaceholder, emptyText, submenuId, }) {
|
|
394
|
+
renderVerticalList(items, { depth, pathPrefix, autoOpenIds, searchable, searchQuery, searchPlaceholder, emptyText, submenuId, closePopover, }) {
|
|
348
395
|
const query = searchQuery ?? '';
|
|
349
396
|
const openFromSearch = autoOpenIds ?? new Set();
|
|
350
397
|
const filtered = query ? this.filterTree(items, query, pathPrefix, openFromSearch) : items;
|
|
@@ -359,21 +406,28 @@ const LeNavigation = class {
|
|
|
359
406
|
const attrs = TagType === 'a'
|
|
360
407
|
? { href: item.href, role: 'treeitem' }
|
|
361
408
|
: { type: 'button', role: 'treeitem' };
|
|
409
|
+
const itemPart = this.partFromOptionPart('item', item.part);
|
|
362
410
|
return (index.h("li", { class: utils.classnames('nav-node', {
|
|
363
411
|
'disabled': item.disabled,
|
|
364
412
|
'selected': item.selected || (this.activeUrl && item.href === this.activeUrl),
|
|
365
413
|
open,
|
|
366
414
|
'has-children': hasChildren,
|
|
367
|
-
}), key: id, role: "none" }, index.h("div", { class: "nav-row", style: { paddingLeft } }, hasChildren ? (index.h("button", { type: "button", class: "nav-toggle", "aria-label": open ? 'Collapse' : 'Expand', "aria-expanded": open ? 'true' : 'false', onClick: (e) => this.handleToggle(e, item, id), disabled: item.disabled }, index.h("le-icon", { name: "chevron-down", class: "nav-chevron", "aria-hidden": "true" }))) : (index.h("span", { class: "nav-toggle-spacer", "aria-hidden": "true" })), index.h(TagType, { class: "nav-item", ...attrs, "aria-disabled": item.disabled ? 'true' : undefined, onClick: (e) => {
|
|
415
|
+
}), key: id, role: "none" }, index.h("div", { class: "nav-row", style: { paddingLeft } }, hasChildren ? (index.h("button", { type: "button", class: "nav-toggle", "aria-label": open ? 'Collapse' : 'Expand', "aria-expanded": open ? 'true' : 'false', onClick: (e) => this.handleToggle(e, item, id), disabled: item.disabled }, index.h("le-icon", { name: "chevron-down", class: "nav-chevron", "aria-hidden": "true" }))) : (index.h("span", { class: "nav-toggle-spacer", "aria-hidden": "true" })), index.h(TagType, { class: "nav-item", part: itemPart, ...attrs, "aria-disabled": item.disabled ? 'true' : undefined, onClick: (e) => {
|
|
368
416
|
// For buttons, also toggle if this is a purely structural node.
|
|
369
417
|
this.handleItemSelect(e, item, id);
|
|
370
418
|
if (!item.href && hasChildren && !item.disabled) {
|
|
371
419
|
this.handleToggle(e, item, id);
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
if (!item.disabled && closePopover) {
|
|
423
|
+
closePopover();
|
|
372
424
|
}
|
|
373
425
|
} }, item.iconStart && (index.h("span", { class: "nav-icon", "aria-hidden": "true" }, item.iconStart)), index.h("span", { class: "nav-text" }, index.h("span", { class: "nav-label" }, item.label), item.description && (index.h("span", { class: "nav-description" }, item.description))), item.iconEnd && (index.h("span", { class: "nav-icon nav-icon-end", "aria-hidden": "true" }, item.iconEnd)))), hasChildren && (index.h("le-collapse", { class: "nav-children", closed: !open, noFading: true, role: "group" }, this.renderVerticalList(children, {
|
|
374
426
|
depth: depth + 1,
|
|
375
427
|
pathPrefix: path,
|
|
376
428
|
autoOpenIds: openFromSearch,
|
|
429
|
+
submenuId,
|
|
430
|
+
closePopover,
|
|
377
431
|
})))));
|
|
378
432
|
})))));
|
|
379
433
|
}
|
|
@@ -386,25 +440,28 @@ const LeNavigation = class {
|
|
|
386
440
|
const attrs = TagType === 'a'
|
|
387
441
|
? { href: item.href, role: 'menuitem' }
|
|
388
442
|
: { type: 'button', role: 'menuitem' };
|
|
443
|
+
const itemPart = this.partFromOptionPart('item', item.part);
|
|
389
444
|
return (index.h("div", { class: "h-item" }, index.h(TagType, { class: utils.classnames('h-link', {
|
|
390
445
|
disabled: item.disabled,
|
|
391
446
|
selected: item.selected || (this.activeUrl && item.href === this.activeUrl),
|
|
392
|
-
}), ...attrs, "aria-disabled": item.disabled ? 'true' : undefined, onClick: (e) => this.handleItemSelect(e, item, id) }, item.iconStart && (index.h("span", { class: "nav-icon", "aria-hidden": "true" }, item.iconStart)), index.h("span", { class: "h-label" }, item.label), item.iconEnd && (index.h("span", { class: "nav-icon nav-icon-end", "aria-hidden": "true" }, item.iconEnd)))));
|
|
447
|
+
}), part: itemPart, ...attrs, "aria-disabled": item.disabled ? 'true' : undefined, onClick: (e) => this.handleItemSelect(e, item, id) }, item.iconStart && (index.h("span", { class: "nav-icon", "aria-hidden": "true" }, item.iconStart)), index.h("span", { class: "h-label" }, item.label), item.iconEnd && (index.h("span", { class: "nav-icon nav-icon-end", "aria-hidden": "true" }, item.iconEnd)))));
|
|
393
448
|
}
|
|
394
449
|
const submenuId = id;
|
|
450
|
+
const itemPart = this.partFromOptionPart('item', item.part);
|
|
395
451
|
return (index.h("div", { class: "h-item" }, index.h("le-popover", { ref: el => {
|
|
396
452
|
if (el)
|
|
397
453
|
this.popoverRefs.set(submenuId, el);
|
|
398
454
|
}, mode: "default", showClose: false, closeOnClickOutside: true, closeOnEscape: true, position: "bottom", align: "start", minWidth: "240px" }, index.h("div", { slot: "trigger", class: utils.classnames('h-trigger', {
|
|
399
455
|
disabled: item.disabled,
|
|
400
456
|
selected: item.selected || (this.activeUrl && item.href === this.activeUrl),
|
|
401
|
-
}), role: "menuitem", "aria-disabled": item.disabled ? 'true' : undefined, onClick: (e) => {
|
|
457
|
+
}), part: itemPart, role: "menuitem", "aria-disabled": item.disabled ? 'true' : undefined, onClick: (e) => {
|
|
402
458
|
// Don’t let le-popover auto-toggle from its internal wrapper.
|
|
403
459
|
e.stopPropagation();
|
|
404
460
|
if (item.disabled)
|
|
405
461
|
return;
|
|
406
462
|
if (item.href) {
|
|
407
463
|
this.handleItemSelect(e, item, id);
|
|
464
|
+
this.popoverRefs.get(submenuId)?.hide();
|
|
408
465
|
}
|
|
409
466
|
else {
|
|
410
467
|
this.popoverRefs.get(submenuId)?.toggle();
|
|
@@ -412,18 +469,12 @@ const LeNavigation = class {
|
|
|
412
469
|
} }, item.href ? (index.h("a", { class: "h-link", href: item.href, onClick: (e) => {
|
|
413
470
|
e.stopPropagation();
|
|
414
471
|
this.handleItemSelect(e, item, id);
|
|
415
|
-
} }, item.iconStart && (index.h("span", { class: "nav-icon", "aria-hidden": "true" }, item.iconStart)), index.h("span", { class: "h-label" }, item.label))) : (index.h("button", { type: "button", class: "h-link", onClick: (e) => {
|
|
472
|
+
} }, item.iconStart && (index.h("span", { class: "nav-icon", "aria-hidden": "true" }, item.iconStart)), index.h("span", { class: "h-label" }, item.label), index.h("span", { class: "nav-chevron", "aria-hidden": "true" }, index.h("le-icon", { name: "chevron-down" })))) : (index.h("button", { type: "button", class: "h-link", onClick: (e) => {
|
|
416
473
|
e.stopPropagation();
|
|
417
474
|
if (item.disabled)
|
|
418
475
|
return;
|
|
419
476
|
this.popoverRefs.get(submenuId)?.toggle();
|
|
420
|
-
} }, item.iconStart && (index.h("span", { class: "nav-icon", "aria-hidden": "true" }, item.iconStart)), index.h("span", { class: "h-label" }, item.label)
|
|
421
|
-
e.preventDefault();
|
|
422
|
-
e.stopPropagation();
|
|
423
|
-
if (item.disabled)
|
|
424
|
-
return;
|
|
425
|
-
this.popoverRefs.get(submenuId)?.toggle();
|
|
426
|
-
} }, index.h("span", { class: "nav-chevron", "aria-hidden": "true" }, index.h("le-icon", { name: "chevron-down" })))), index.h("div", { class: "popover-menu" }, this.renderVerticalList(children, {
|
|
477
|
+
} }, item.iconStart && (index.h("span", { class: "nav-icon", "aria-hidden": "true" }, item.iconStart)), index.h("span", { class: "h-label" }, item.label), index.h("span", { class: "nav-chevron", "aria-hidden": "true" }, index.h("le-icon", { name: "chevron-down" }))))), index.h("div", { class: "popover-menu" }, this.renderVerticalList(children, {
|
|
427
478
|
depth: 0,
|
|
428
479
|
pathPrefix: String(index$1),
|
|
429
480
|
searchable: this.submenuSearchable,
|
|
@@ -431,6 +482,7 @@ const LeNavigation = class {
|
|
|
431
482
|
searchPlaceholder: this.searchPlaceholder,
|
|
432
483
|
emptyText: this.emptyText,
|
|
433
484
|
submenuId,
|
|
485
|
+
closePopover: () => this.popoverRefs.get(submenuId)?.hide(),
|
|
434
486
|
})))));
|
|
435
487
|
}
|
|
436
488
|
renderHorizontal() {
|
|
@@ -443,24 +495,35 @@ const LeNavigation = class {
|
|
|
443
495
|
overflowItems.push(item);
|
|
444
496
|
}
|
|
445
497
|
});
|
|
446
|
-
|
|
447
|
-
|
|
498
|
+
const showHamburger = !this.wrap &&
|
|
499
|
+
((this.overflowMode === 'hamburger' && this.hamburgerActive) ||
|
|
500
|
+
(this.overflowMode === 'more' && this.fallbackHamburger));
|
|
501
|
+
// Hamburger mode: show a single trigger if anything overflows (or when forced for "more").
|
|
502
|
+
if (showHamburger) {
|
|
448
503
|
return (index.h("div", { class: "nav-horizontal-shell" }, index.h("div", { class: "nav-horizontal-measure", "aria-hidden": "true", ref: el => {
|
|
449
504
|
this.measureEl = el;
|
|
450
505
|
} }, items.map((item, index) => this.renderHorizontalMeasureItem(item, index)), index.h("div", { class: "h-item", ref: el => {
|
|
451
506
|
this.measureMoreEl = el;
|
|
452
|
-
} }, index.h("button", { type: "button", class: "overflow-trigger" }, "More"))), index.h("div", { class:
|
|
507
|
+
} }, index.h("button", { type: "button", class: "overflow-trigger" }, "More"))), index.h("div", { class: utils.classnames('nav-horizontal', {
|
|
508
|
+
'hamburger-align-end': this.hamburgerAlign === 'end',
|
|
509
|
+
}), ref: el => {
|
|
453
510
|
this.navContainerEl = el;
|
|
454
511
|
this.setupResizeObserver();
|
|
455
512
|
this.observeContainer(this.navContainerEl);
|
|
456
|
-
} }, index.h("le-popover", {
|
|
513
|
+
} }, index.h("le-popover", { ref: el => {
|
|
514
|
+
this.hamburgerPopoverEl = el;
|
|
515
|
+
}, mode: "default", showClose: false, closeOnClickOutside: true, closeOnEscape: true, position: "bottom", align: "end", minWidth: "260px" }, index.h("button", { slot: "trigger", type: "button", class: "overflow-trigger", part: "hamburger-trigger", "aria-label": "Open menu" }, index.h("slot", { name: "hamburger-trigger" }, index.h("le-icon", { name: "hamburger" }))), index.h("div", { class: "popover-menu" }, this.renderVerticalList(items, {
|
|
516
|
+
depth: 0,
|
|
517
|
+
pathPrefix: '',
|
|
518
|
+
closePopover: () => this.hamburgerPopoverEl?.hide(),
|
|
519
|
+
}))))));
|
|
457
520
|
}
|
|
458
521
|
const showMore = !this.wrap && this.overflowMode === 'more' && overflowItems.length > 0;
|
|
459
522
|
return (index.h("div", { class: "nav-horizontal-shell", role: "menubar" }, index.h("div", { class: "nav-horizontal-measure", "aria-hidden": "true", ref: el => {
|
|
460
523
|
this.measureEl = el;
|
|
461
524
|
} }, items.map((item, index) => this.renderHorizontalMeasureItem(item, index)), index.h("div", { class: "h-item", ref: el => {
|
|
462
525
|
this.measureMoreEl = el;
|
|
463
|
-
} }, index.h("button", { type: "button", class: "overflow-trigger" }, "
|
|
526
|
+
} }, index.h("button", { type: "button", class: "overflow-trigger" }, index.h("le-icon", { name: "ellipsis-horizontal" })))), index.h("div", { class: utils.classnames('nav-horizontal', {
|
|
464
527
|
wrap: this.wrap,
|
|
465
528
|
nowrap: !this.wrap,
|
|
466
529
|
}), ref: el => {
|
|
@@ -476,7 +539,16 @@ const LeNavigation = class {
|
|
|
476
539
|
}), index.h("div", { class: utils.classnames('more-trigger-wrap', {
|
|
477
540
|
'is-visible': showMore,
|
|
478
541
|
'is-measure': !showMore,
|
|
479
|
-
}) }, index.h("le-popover", {
|
|
542
|
+
}) }, index.h("le-popover", { ref: el => {
|
|
543
|
+
this.morePopoverEl = el;
|
|
544
|
+
}, mode: "default", position: "bottom", align: "end", minWidth: "260px", showClose: false }, index.h("button", { slot: "trigger", type: "button", class: "overflow-trigger", part: "more-trigger", "aria-label": "More", ref: el => {
|
|
545
|
+
if (el)
|
|
546
|
+
this.moreTriggerEl = el;
|
|
547
|
+
} }, index.h("slot", { name: "more-trigger" }, index.h("le-icon", { name: "ellipsis-horizontal" }))), index.h("div", { class: "popover-menu" }, this.renderVerticalList(overflowItems, {
|
|
548
|
+
depth: 0,
|
|
549
|
+
pathPrefix: '',
|
|
550
|
+
closePopover: () => this.morePopoverEl?.hide(),
|
|
551
|
+
})))))));
|
|
480
552
|
}
|
|
481
553
|
render() {
|
|
482
554
|
const items = this.parsedItems;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -5,7 +5,7 @@ var index = require('./index-pT2cVC5w.js');
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await index.globalScripts();
|
|
8
|
-
return index.bootstrapLazy([["le-button_13.cjs",[[769,"le-header",{"isStatic":[516,"static"],"sticky":[516],"fixed":[516],"revealOnScroll":[513,"reveal-on-scroll"],"shrinkOffset":[513,"shrink-offset"],"expandOnHover":[516,"expand-on-hover"],"revealed":[32],"shrunk":[32],"placeholderHeight":[32],"hoverActive":[32]},[[9,"scroll","onWindowScroll"],[9,"resize","onWindowResize"]],{"revealOnScroll":["onBehaviorPropsChange"],"shrinkOffset":["onBehaviorPropsChange"],"fixed":["onBehaviorPropsChange"],"sticky":["onBehaviorPropsChange"],"isStatic":["onBehaviorPropsChange"]}],[769,"le-current-heading",{"selector":[1],"activeText":[32]},[[9,"scroll","onScroll"],[9,"resize","onResize"]],{"selector":["onSelectorChange"]}],[769,"le-scroll-progress",{"trackScrollProgress":[513,"track-scroll-progress"],"progress":[32]},[[9,"scroll","onScroll"],[9,"resize","onResize"]],{"trackScrollProgress":["onTrackChange"]}],[769,"le-collapse",{"closed":[1540],"scrollDown":[516,"scroll-down"],"noFading":[516,"no-fading"],"collapseOnHeaderShrink":[516,"collapse-on-header-shrink"],"headerShrunk":[32]},[[8,"leHeaderShrinkChange","handleHeaderShrink"]],{"open":["onOpenChange"],"headerShrunk":["onDrivenStateChange"]}],[769,"le-dropdown-base",{"options":[16],"value":[8],"multiple":[4],"open":[1540],"disabled":[516],"filterFn":[16],"filterQuery":[1,"filter-query"],"emptyText":[1,"empty-text"],"showCheckboxes":[4,"show-checkboxes"],"maxHeight":[1,"max-height"],"width":[1],"fullWidth":[4,"full-width"],"closeOnClickOutside":[4,"close-on-click-outside"],"focusedIndex":[32],"filteredOptions":[32],"show":[64],"hide":[64],"toggle":[64]},null,{"options":["handleOptionsChange"],"filterQuery":["handleOptionsChange"]}],[769,"le-popup",{"mode":[1537],"open":[1540],"type":[1],"popupTitle":[1,"popup-title"],"message":[1],"modal":[4],"position":[1],"confirmText":[1,"confirm-text"],"cancelText":[1,"cancel-text"],"placeholder":[1],"defaultValue":[1,"default-value"],"closeOnBackdrop":[4,"close-on-backdrop"],"inputValue":[32],"show":[64],"hide":[64]}],[769,"le-button",{"mode":[1537],"variant":[1],"color":[1],"size":[1],"selected":[4],"fullWidth":[516,"full-width"],"iconOnly":[1,"icon-only"],"iconStart":[1,"icon-start"],"iconEnd":[1,"icon-end"],"disabled":[4],"type":[1],"href":[1],"target":[1],"align":[1]}],[769,"le-checkbox",{"checked":[1540],"disabled":[4],"name":[1],"value":[1],"externalId":[1,"external-id"]}],[769,"le-component",{"component":[1],"displayName":[1,"display-name"],"hostClass":[1,"host-class"],"hostStyle":[16],"adminMode":[32],"componentMeta":[32],"propertyValues":[32]}],[769,"le-select",{"options":[1],"value":[1032],"placeholder":[1],"disabled":[516],"required":[4],"name":[1],"fullWidth":[4,"full-width"],"size":[513],"variant":[513],"searchable":[4],"emptyText":[1,"empty-text"],"open":[1540],"selectedOption":[32],"searchQuery":[32],"showDropdown":[64],"hideDropdown":[64]},null,{"value":["handleValueChange"],"options":["handleOptionsChange"]}],[769,"le-slot",{"type":[1],"name":[1],"label":[1],"description":[1],"allowedComponents":[1,"allowed-components"],"multiple":[4],"required":[4],"placeholder":[1],"tag":[1],"slotStyle":[1,"slot-style"],"adminMode":[32],"textValue":[32],"isValidHtml":[32],"availableComponents":[32],"pickerOpen":[32]}],[769,"le-string-input",{"inputRef":[16],"mode":[1537],"value":[1537],"name":[1],"type":[1],"label":[1],"iconStart":[1,"icon-start"],"iconEnd":[1,"icon-end"],"placeholder":[1],"hideDescription":[4,"hide-description"],"disabled":[4],"readonly":[4],"externalId":[1,"external-id"]}],[769,"le-popover",{"mode":[1537],"open":[1540],"position":[1],"align":[1],"popoverTitle":[1,"popover-title"],"showClose":[4,"show-close"],"closeOnClickOutside":[4,"close-on-click-outside"],"closeOnEscape":[4,"close-on-escape"],"offset":[2],"width":[1],"minWidth":[1,"min-width"],"maxWidth":[1,"max-width"],"triggerFullWidth":[4,"trigger-full-width"],"isPositioned":[32],"updatePosition":[64],"show":[64],"hide":[64],"toggle":[64]}]]],["le-navigation.cjs",[[769,"le-navigation",{"items":[1],"orientation":[513],"wrap":[516],"overflowMode":[513,"overflow-mode"],"activeUrl":[1,"active-url"],"searchable":[4],"searchPlaceholder":[1,"search-placeholder"],"emptyText":[1,"empty-text"],"submenuSearchable":[4,"submenu-searchable"],"searchQuery":[32],"openState":[32],"overflowIds":[32],"hamburgerActive":[32],"submenuQueries":[32]},null,{"items":["handleLayoutInputsChange"],"orientation":["handleLayoutInputsChange"],"wrap":["handleLayoutInputsChange"],"overflowMode":["handleLayoutInputsChange"]}]]],["le-multiselect.cjs",[[769,"le-multiselect",{"options":[1],"value":[1040],"placeholder":[1],"disabled":[516],"required":[4],"name":[1],"fullWidth":[516,"full-width"],"size":[513],"maxSelections":[2,"max-selections"],"showSelectAll":[1032,"show-select-all"],"searchable":[4],"emptyText":[1,"empty-text"],"open":[1540],"selectAllLabel":[32],"deselectAllLabel":[32],"selectedOptions":[32],"searchQuery":[32],"showDropdown":[64],"hideDropdown":[64],"clearSelection":[64]},null,{"value":["handleValueChange"],"options":["handleOptionsChange"],"showSelectAll":["handleShowSelectAllChange"]}]]],["le-segmented-control.cjs",[[769,"le-segmented-control",{"options":[16],"value":[1032],"size":[1],"overflow":[1],"fullWidth":[4,"full-width"],"disabled":[4],"segmentConfigs":[32],"focusedIndex":[32],"isDeclarativeMode":[32]},[[0,"slotchange","handleSlotChange"]],{"options":["tabsChanged"]}]]],["le-tab-bar.cjs",[[769,"le-tab-bar",{"tabs":[16],"selected":[1032],"fullWidth":[4,"full-width"],"showLabels":[4,"show-labels"],"position":[1],"size":[1],"bordered":[4],"tabConfigs":[32],"isDeclarativeMode":[32],"focusedIndex":[32]},[[0,"slotchange","handleSlotChange"]],{"selected":["selectedChanged"],"tabs":["tabsChanged"]}]]],["le-tabs.cjs",[[769,"le-tabs",{"tabs":[16],"selected":[1032],"orientation":[1],"position":[1],"variant":[1],"fullWidth":[4,"full-width"],"size":[1],"wrap":[4],"overflow":[1],"tabConfigs":[32],"focusedIndex":[32],"isDeclarativeMode":[32]},[[0,"slotchange","handleSlotChange"]],{"selected":["selectedChanged"],"tabs":["tabsChanged"]}]]],["le-box.cjs",[[769,"le-box",{"grow":[2],"shrink":[2],"basis":[1],"width":[1],"height":[1],"minWidth":[1,"min-width"],"maxWidth":[1,"max-width"],"minHeight":[1,"min-height"],"maxHeight":[1,"max-height"],"background":[1],"borderRadius":[1,"border-radius"],"border":[1],"alignSelf":[1,"align-self"],"alignContent":[1,"align-content"],"justifyContent":[1,"justify-content"],"padding":[1],"order":[2],"displayFlex":[4,"display-flex"],"innerDirection":[1,"inner-direction"],"innerGap":[1,"inner-gap"]}]]],["le-card.cjs",[[769,"le-card",{"variant":[1],"interactive":[4]}]]],["le-combobox.cjs",[[769,"le-combobox",{"options":[1],"value":[1032],"placeholder":[1],"disabled":[516],"required":[4],"name":[1],"fullWidth":[516,"full-width"],"size":[513],"allowCustom":[4,"allow-custom"],"minSearchLength":[2,"min-search-length"],"emptyText":[1,"empty-text"],"open":[1540],"inputValue":[32],"selectedOption":[32],"showDropdown":[64],"hideDropdown":[64],"focusInput":[64]},[[8,"click","handleWindowClick"]],{"value":["handleValueChange"],"options":["handleOptionsChange"]}]]],["le-number-input.cjs",[[769,"le-number-input",{"value":[1538],"name":[1],"label":[1],"placeholder":[1],"min":[2],"max":[2],"step":[2],"required":[4],"disabled":[4],"readonly":[4],"iconStart":[1,"icon-start"],"showSpinners":[4,"show-spinners"],"externalId":[1,"external-id"],"isValid":[32],"validationMessage":[32]},null,{"value":["valueChanged"]}]]],["le-stack.cjs",[[769,"le-stack",{"direction":[1],"gap":[1],"align":[1],"justify":[1],"wrap":[4],"alignContent":[1,"align-content"],"reverse":[4],"maxItems":[2,"max-items"],"fullWidth":[4,"full-width"],"fullHeight":[4,"full-height"],"padding":[1]}]]],["le-tab-panel.cjs",[[769,"le-tab-panel",{"label":[1],"value":[1],"iconStart":[1,"icon-start"],"iconEnd":[1,"icon-end"],"disabled":[4],"lazy":[4],"active":[32],"hasBeenActive":[32],"getValue":[64],"getTabConfig":[64],"setActive":[64]},null,{"active":["activeChanged"]}]]],["le-text.cjs",[[769,"le-text",{"variant":[1537],"align":[513],"color":[1],"truncate":[4],"maxLines":[2,"max-lines"],"adminMode":[32],"content":[32],"isFocused":[32],"selectionState":[32]},null,{"variant":["onVariantChange"]}]]],["le-header-placeholder.cjs",[[256,"le-header-placeholder"]]],["le-round-progress.cjs",[[769,"le-round-progress",{"value":[2],"padding":[2],"paths":[1],"params":[32]},null,{"value":["updateValue"],"padding":["updatePadding"],"paths":["updateProgressBackgrounds"]}]]],["le-turntable.cjs",[[769,"le-turntable",{"center":[1],"value":[2]},[[9,"mousemove","handleMouseMove"],[9,"mouseup","handleMouseUp"],[9,"resize","handleWindowResize"]],{"value":["updateValue"]}]]],["le-tag.cjs",[[769,"le-tag",{"label":[1],"mode":[1537],"icon":[1],"dismissible":[4],"disabled":[516],"size":[513],"variant":[513]}]]],["le-icon.cjs",[[769,"le-icon",{"name":[1],"size":[2],"iconData":[32],"visible":[32]},null,{"name":["loadIconData"]}]]],["le-tab.cjs",[[769,"le-tab",{"mode":[1537],"label":[1],"value":[1],"variant":[1],"position":[1],"size":[1],"focusable":[4],"selected":[4],"fullWidth":[516,"full-width"],"icon":[1],"showLabel":[4,"show-label"],"iconStart":[1,"icon-start"],"iconEnd":[1,"icon-end"],"disabled":[4],"href":[1],"target":[1],"align":[1],"getTabConfig":[64]}]]]], options);
|
|
8
|
+
return index.bootstrapLazy([["le-button_13.cjs",[[769,"le-header",{"isStatic":[516,"static"],"sticky":[516],"fixed":[516],"revealOnScroll":[513,"reveal-on-scroll"],"shrinkOffset":[513,"shrink-offset"],"expandOnHover":[516,"expand-on-hover"],"revealed":[32],"shrunk":[32],"placeholderHeight":[32],"hoverActive":[32]},[[9,"scroll","onWindowScroll"],[9,"resize","onWindowResize"]],{"revealOnScroll":["onBehaviorPropsChange"],"shrinkOffset":["onBehaviorPropsChange"],"fixed":["onBehaviorPropsChange"],"sticky":["onBehaviorPropsChange"],"isStatic":["onBehaviorPropsChange"]}],[769,"le-current-heading",{"selector":[1],"activeText":[32]},[[9,"scroll","onScroll"],[9,"resize","onResize"]],{"selector":["onSelectorChange"]}],[769,"le-scroll-progress",{"trackScrollProgress":[513,"track-scroll-progress"],"progress":[32]},[[9,"scroll","onScroll"],[9,"resize","onResize"]],{"trackScrollProgress":["onTrackChange"]}],[769,"le-collapse",{"closed":[1540],"scrollDown":[516,"scroll-down"],"noFading":[516,"no-fading"],"collapseOnHeaderShrink":[516,"collapse-on-header-shrink"],"headerShrunk":[32]},[[8,"leHeaderShrinkChange","handleHeaderShrink"]],{"open":["onOpenChange"],"headerShrunk":["onDrivenStateChange"]}],[769,"le-dropdown-base",{"options":[16],"value":[8],"multiple":[4],"open":[1540],"disabled":[516],"filterFn":[16],"filterQuery":[1,"filter-query"],"emptyText":[1,"empty-text"],"showCheckboxes":[4,"show-checkboxes"],"maxHeight":[1,"max-height"],"width":[1],"fullWidth":[4,"full-width"],"closeOnClickOutside":[4,"close-on-click-outside"],"focusedIndex":[32],"filteredOptions":[32],"show":[64],"hide":[64],"toggle":[64]},null,{"options":["handleOptionsChange"],"filterQuery":["handleOptionsChange"]}],[769,"le-popup",{"mode":[1537],"open":[1540],"type":[1],"popupTitle":[1,"popup-title"],"message":[1],"modal":[4],"position":[1],"confirmText":[1,"confirm-text"],"cancelText":[1,"cancel-text"],"placeholder":[1],"defaultValue":[1,"default-value"],"closeOnBackdrop":[4,"close-on-backdrop"],"inputValue":[32],"show":[64],"hide":[64]}],[769,"le-button",{"mode":[1537],"variant":[1],"color":[1],"size":[1],"selected":[4],"fullWidth":[516,"full-width"],"iconOnly":[1,"icon-only"],"iconStart":[1,"icon-start"],"iconEnd":[1,"icon-end"],"disabled":[4],"type":[1],"href":[1],"target":[1],"align":[1]}],[769,"le-checkbox",{"checked":[1540],"disabled":[4],"name":[1],"value":[1],"externalId":[1,"external-id"]}],[769,"le-component",{"component":[1],"displayName":[1,"display-name"],"hostClass":[1,"host-class"],"hostStyle":[16],"adminMode":[32],"componentMeta":[32],"propertyValues":[32]}],[769,"le-select",{"options":[1],"value":[1032],"placeholder":[1],"disabled":[516],"required":[4],"name":[1],"fullWidth":[4,"full-width"],"size":[513],"variant":[513],"searchable":[4],"emptyText":[1,"empty-text"],"open":[1540],"selectedOption":[32],"searchQuery":[32],"showDropdown":[64],"hideDropdown":[64]},null,{"value":["handleValueChange"],"options":["handleOptionsChange"]}],[769,"le-slot",{"type":[1],"name":[1],"label":[1],"description":[1],"allowedComponents":[1,"allowed-components"],"multiple":[4],"required":[4],"placeholder":[1],"tag":[1],"slotStyle":[1,"slot-style"],"adminMode":[32],"textValue":[32],"isValidHtml":[32],"availableComponents":[32],"pickerOpen":[32]}],[769,"le-string-input",{"inputRef":[16],"mode":[1537],"value":[1537],"name":[1],"type":[1],"label":[1],"iconStart":[1,"icon-start"],"iconEnd":[1,"icon-end"],"placeholder":[1],"hideDescription":[4,"hide-description"],"disabled":[4],"readonly":[4],"externalId":[1,"external-id"]}],[769,"le-popover",{"mode":[1537],"open":[1540],"position":[1],"align":[1],"popoverTitle":[1,"popover-title"],"showClose":[4,"show-close"],"closeOnClickOutside":[4,"close-on-click-outside"],"closeOnEscape":[4,"close-on-escape"],"offset":[2],"width":[1],"minWidth":[1,"min-width"],"maxWidth":[1,"max-width"],"triggerFullWidth":[4,"trigger-full-width"],"isPositioned":[32],"updatePosition":[64],"show":[64],"hide":[64],"toggle":[64]}]]],["le-navigation.cjs",[[769,"le-navigation",{"items":[1],"orientation":[513],"wrap":[516],"overflowMode":[513,"overflow-mode"],"minVisibleItemsForMore":[2,"min-visible-items-for-more"],"hamburgerAlign":[513,"hamburger-align"],"activeUrl":[1,"active-url"],"searchable":[4],"searchPlaceholder":[1,"search-placeholder"],"emptyText":[1,"empty-text"],"submenuSearchable":[4,"submenu-searchable"],"searchQuery":[32],"openState":[32],"overflowIds":[32],"hamburgerActive":[32],"fallbackHamburger":[32],"submenuQueries":[32]},null,{"items":["handleLayoutInputsChange"],"orientation":["handleLayoutInputsChange"],"wrap":["handleLayoutInputsChange"],"overflowMode":["handleLayoutInputsChange"]}]]],["le-multiselect.cjs",[[769,"le-multiselect",{"options":[1],"value":[1040],"placeholder":[1],"disabled":[516],"required":[4],"name":[1],"fullWidth":[516,"full-width"],"size":[513],"maxSelections":[2,"max-selections"],"showSelectAll":[1032,"show-select-all"],"searchable":[4],"emptyText":[1,"empty-text"],"open":[1540],"selectAllLabel":[32],"deselectAllLabel":[32],"selectedOptions":[32],"searchQuery":[32],"showDropdown":[64],"hideDropdown":[64],"clearSelection":[64]},null,{"value":["handleValueChange"],"options":["handleOptionsChange"],"showSelectAll":["handleShowSelectAllChange"]}]]],["le-segmented-control.cjs",[[769,"le-segmented-control",{"options":[16],"value":[1032],"size":[1],"overflow":[1],"fullWidth":[4,"full-width"],"disabled":[4],"segmentConfigs":[32],"focusedIndex":[32],"isDeclarativeMode":[32]},[[0,"slotchange","handleSlotChange"]],{"options":["tabsChanged"]}]]],["le-tab-bar.cjs",[[769,"le-tab-bar",{"tabs":[16],"selected":[1032],"fullWidth":[4,"full-width"],"showLabels":[4,"show-labels"],"position":[1],"size":[1],"bordered":[4],"tabConfigs":[32],"isDeclarativeMode":[32],"focusedIndex":[32]},[[0,"slotchange","handleSlotChange"]],{"selected":["selectedChanged"],"tabs":["tabsChanged"]}]]],["le-tabs.cjs",[[769,"le-tabs",{"tabs":[16],"selected":[1032],"orientation":[1],"position":[1],"variant":[1],"fullWidth":[4,"full-width"],"size":[1],"wrap":[4],"overflow":[1],"tabConfigs":[32],"focusedIndex":[32],"isDeclarativeMode":[32]},[[0,"slotchange","handleSlotChange"]],{"selected":["selectedChanged"],"tabs":["tabsChanged"]}]]],["le-box.cjs",[[769,"le-box",{"grow":[2],"shrink":[2],"basis":[1],"width":[1],"height":[1],"minWidth":[1,"min-width"],"maxWidth":[1,"max-width"],"minHeight":[1,"min-height"],"maxHeight":[1,"max-height"],"background":[1],"borderRadius":[1,"border-radius"],"border":[1],"alignSelf":[1,"align-self"],"alignContent":[1,"align-content"],"justifyContent":[1,"justify-content"],"padding":[1],"order":[2],"displayFlex":[4,"display-flex"],"innerDirection":[1,"inner-direction"],"innerGap":[1,"inner-gap"]}]]],["le-card.cjs",[[769,"le-card",{"variant":[1],"interactive":[4]}]]],["le-combobox.cjs",[[769,"le-combobox",{"options":[1],"value":[1032],"placeholder":[1],"disabled":[516],"required":[4],"name":[1],"fullWidth":[516,"full-width"],"size":[513],"allowCustom":[4,"allow-custom"],"minSearchLength":[2,"min-search-length"],"emptyText":[1,"empty-text"],"open":[1540],"inputValue":[32],"selectedOption":[32],"showDropdown":[64],"hideDropdown":[64],"focusInput":[64]},[[8,"click","handleWindowClick"]],{"value":["handleValueChange"],"options":["handleOptionsChange"]}]]],["le-number-input.cjs",[[769,"le-number-input",{"value":[1538],"name":[1],"label":[1],"placeholder":[1],"min":[2],"max":[2],"step":[2],"required":[4],"disabled":[4],"readonly":[4],"iconStart":[1,"icon-start"],"showSpinners":[4,"show-spinners"],"externalId":[1,"external-id"],"isValid":[32],"validationMessage":[32]},null,{"value":["valueChanged"]}]]],["le-stack.cjs",[[769,"le-stack",{"direction":[1],"gap":[1],"align":[1],"justify":[1],"wrap":[4],"alignContent":[1,"align-content"],"reverse":[4],"maxItems":[2,"max-items"],"fullWidth":[4,"full-width"],"fullHeight":[4,"full-height"],"padding":[1]}]]],["le-tab-panel.cjs",[[769,"le-tab-panel",{"label":[1],"value":[1],"iconStart":[1,"icon-start"],"iconEnd":[1,"icon-end"],"disabled":[4],"lazy":[4],"active":[32],"hasBeenActive":[32],"getValue":[64],"getTabConfig":[64],"setActive":[64]},null,{"active":["activeChanged"]}]]],["le-text.cjs",[[769,"le-text",{"variant":[1537],"align":[513],"color":[1],"truncate":[4],"maxLines":[2,"max-lines"],"adminMode":[32],"content":[32],"isFocused":[32],"selectionState":[32]},null,{"variant":["onVariantChange"]}]]],["le-header-placeholder.cjs",[[256,"le-header-placeholder"]]],["le-round-progress.cjs",[[769,"le-round-progress",{"value":[2],"padding":[2],"paths":[1],"params":[32]},null,{"value":["updateValue"],"padding":["updatePadding"],"paths":["updateProgressBackgrounds"]}]]],["le-turntable.cjs",[[769,"le-turntable",{"center":[1],"value":[2]},[[9,"mousemove","handleMouseMove"],[9,"mouseup","handleMouseUp"],[9,"resize","handleWindowResize"]],{"value":["updateValue"]}]]],["le-tag.cjs",[[769,"le-tag",{"label":[1],"mode":[1537],"icon":[1],"dismissible":[4],"disabled":[516],"size":[513],"variant":[513]}]]],["le-icon.cjs",[[769,"le-icon",{"name":[1],"size":[2],"iconData":[32],"visible":[32]},null,{"name":["loadIconData"]}]]],["le-tab.cjs",[[769,"le-tab",{"mode":[1537],"label":[1],"value":[1],"variant":[1],"position":[1],"size":[1],"focusable":[4],"selected":[4],"fullWidth":[516,"full-width"],"icon":[1],"showLabel":[4,"show-label"],"iconStart":[1,"icon-start"],"iconEnd":[1,"icon-end"],"disabled":[4],"href":[1],"target":[1],"align":[1],"getTabConfig":[64]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
exports.setNonce = index.setNonce;
|
|
@@ -10,6 +10,7 @@ async function fetchIcon({ name }) {
|
|
|
10
10
|
return iconCache[name];
|
|
11
11
|
}
|
|
12
12
|
if (!requestCache[name]) {
|
|
13
|
+
console.log(`Fetching icon "${name}"`, getAssetPath(`./assets/icons/${name}.json`));
|
|
13
14
|
requestCache[name] = fetch(getAssetPath(`./assets/icons/${name}.json`))
|
|
14
15
|
.then(resp => resp.json())
|
|
15
16
|
.catch(() => {
|
|
@@ -93,7 +94,7 @@ export class LeIcon {
|
|
|
93
94
|
return svgElements;
|
|
94
95
|
}
|
|
95
96
|
render() {
|
|
96
|
-
return (h("svg", { key: '
|
|
97
|
+
return (h("svg", { key: '5419a60a1190bf66b9051796e0c8ae6f10a15ffc', xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", height: this.size, width: this.size, viewBox: this.iconData?.viewBox || `0 0 ${this.size} ${this.size}` }, this.renderSVGContent(this.iconData?.children)));
|
|
97
98
|
}
|
|
98
99
|
static get is() { return "le-icon"; }
|
|
99
100
|
static get encapsulation() { return "shadow"; }
|
|
@@ -107,6 +108,7 @@ export class LeIcon {
|
|
|
107
108
|
"$": ["le-icon.css"]
|
|
108
109
|
};
|
|
109
110
|
}
|
|
111
|
+
static get assetsDirs() { return ["icons"]; }
|
|
110
112
|
static get properties() {
|
|
111
113
|
return {
|
|
112
114
|
"name": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"le-icon.js","sourceRoot":"","sources":["../../../src/components/le-icon/le-icon.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE/F,MAAM,SAAS,GAAG,EAAE,CAAC;AACrB,MAAM,YAAY,GAAG,EAAE,CAAC;AAExB,KAAK,UAAU,SAAS,CAAC,EAAE,IAAI,EAAE;IAC/B,IAAI,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QACpB,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IACD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,YAAY,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,kBAAkB,IAAI,OAAO,CAAC,CAAC;aACpE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;aACzB,KAAK,CAAC,GAAG,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,uBAAuB,CAAC,CAAC;YAC/C,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;IACP,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,CAAC;IACtC,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAEvB,OAAO,IAAI,CAAC;AACd,CAAC;
|
|
1
|
+
{"version":3,"file":"le-icon.js","sourceRoot":"","sources":["../../../src/components/le-icon/le-icon.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE/F,MAAM,SAAS,GAAG,EAAE,CAAC;AACrB,MAAM,YAAY,GAAG,EAAE,CAAC;AAExB,KAAK,UAAU,SAAS,CAAC,EAAE,IAAI,EAAE;IAC/B,IAAI,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QACpB,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IACD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,GAAG,EAAE,YAAY,CAAC,kBAAkB,IAAI,OAAO,CAAC,CAAC,CAAC;QACpF,YAAY,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,kBAAkB,IAAI,OAAO,CAAC,CAAC;aACpE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;aACzB,KAAK,CAAC,GAAG,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,uBAAuB,CAAC,CAAC;YAC/C,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;IACP,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,CAAC;IACtC,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAEvB,OAAO,IAAI,CAAC;AACd,CAAC;AAQD,MAAM,OAAO,MAAM;IACN,EAAE,CAAc;IAE3B;;;OAGG;IACK,IAAI,GAAW,IAAI,CAAC;IAE5B;;OAEG;IACK,IAAI,GAAW,EAAE,CAAC;IAET,QAAQ,GAAQ,IAAI,CAAC;IAErB,OAAO,GAAG,KAAK,CAAC;IAEV,KAAK,CAAC,YAAY;QACvC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAE/B,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAC1C,OAAO;QACT,CAAC;QAED,IAAI,CAAC,QAAQ,GAAG,MAAM,SAAS,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5C,CAAC;IAEO,oBAAoB,CAAuB;IAEnD,iBAAiB;QACf,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE;YACzB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;YACpB,IAAI,CAAC,YAAY,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,oBAAoB;QAClB,IAAI,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC9B,IAAI,CAAC,oBAAoB,CAAC,UAAU,EAAE,CAAC;YACvC,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC;QACnC,CAAC;IACH,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAEO,gBAAgB,CAAC,QAAoB;QAC3C,IACE,CAAC,KAAK,CAAC,SAAS;YAChB,OAAO,MAAM,KAAK,WAAW;YAC7B,CAAE,MAAc,CAAC,oBAAoB,EACrC,CAAC;YACD,QAAQ,EAAE,CAAC;YACX,OAAO;QACT,CAAC;QAED,IAAI,CAAC,oBAAoB,GAAG,IAAI,oBAAoB,CAClD,OAAO,CAAC,EAAE;YACR,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBACtB,IAAI,KAAK,CAAC,cAAc,EAAE,CAAC;oBACzB,IAAI,CAAC,oBAAoB,CAAC,UAAU,EAAE,CAAC;oBACvC,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC;oBACjC,QAAQ,EAAE,CAAC;gBACb,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,EACD,EAAE,UAAU,EAAE,MAAM,EAAE,CACvB,CAAC;QAEF,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED;;;;;OAKG;IACK,gBAAgB,CAAC,QAAgB;QACvC,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvC,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,aAAa,GAAG,IAAI,CAAC,EAAE;YAC3B,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC;YACzC,OAAO,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACtE,CAAC,CAAC;QAEF,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAChD,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,MAAM;QACJ,OAAO,CACL,4DACE,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,cAAc,EACnB,MAAM,EAAE,IAAI,CAAC,IAAI,EACjB,KAAK,EAAE,IAAI,CAAC,IAAI,EAChB,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,IAAI,OAAO,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,IAEjE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAC3C,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["/**\n * Based on the script from Paul Andreson's article:\n * https://paulcpederson.com/articles/stencil-icons/\n */\nimport { Build, Component, Element, getAssetPath, h, Prop, State, Watch } from '@stencil/core';\n\nconst iconCache = {};\nconst requestCache = {};\n\nasync function fetchIcon({ name }): Promise<string> {\n if (iconCache[name]) {\n return iconCache[name];\n }\n if (!requestCache[name]) {\n console.log(`Fetching icon \"${name}\"`, getAssetPath(`./assets/icons/${name}.json`));\n requestCache[name] = fetch(getAssetPath(`./assets/icons/${name}.json`))\n .then(resp => resp.json())\n .catch(() => {\n console.error(`\"${name}\" is not a valid name`);\n return '';\n });\n }\n\n const path = await requestCache[name];\n iconCache[name] = path;\n\n return path;\n}\n\n@Component({\n tag: 'le-icon',\n styleUrl: 'le-icon.css',\n shadow: true,\n assetsDirs: ['icons'],\n})\nexport class LeIcon {\n @Element() el: HTMLElement;\n\n /**\n * Name of the icon to display. Corresponds to a JSON file in the assets folder.\n * For example, \"search\" will load the \"search.json\" file.\n */\n @Prop() name: string = null;\n\n /**\n * Size of the icon in pixels. Default is 16.\n */\n @Prop() size: number = 16;\n\n @State() private iconData: any = null;\n\n @State() private visible = false;\n\n @Watch('name') private async loadIconData(): Promise<void> {\n const { name, visible } = this;\n\n if (!Build.isBrowser || !name || !visible) {\n return;\n }\n\n this.iconData = await fetchIcon({ name });\n }\n\n private intersectionObserver: IntersectionObserver;\n\n connectedCallback(): void {\n this.waitUntilVisible(() => {\n this.visible = true;\n this.loadIconData();\n });\n }\n\n disconnectedCallback(): void {\n if (this.intersectionObserver) {\n this.intersectionObserver.disconnect();\n this.intersectionObserver = null;\n }\n }\n\n async componentWillLoad(): Promise<void> {\n this.loadIconData();\n }\n\n private waitUntilVisible(callback: () => void): void {\n if (\n !Build.isBrowser ||\n typeof window === 'undefined' ||\n !(window as any).IntersectionObserver\n ) {\n callback();\n return;\n }\n\n this.intersectionObserver = new IntersectionObserver(\n entries => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n this.intersectionObserver.disconnect();\n this.intersectionObserver = null;\n callback();\n }\n });\n },\n { rootMargin: '50px' },\n );\n\n this.intersectionObserver.observe(this.el);\n }\n\n /**\n * Renders the SVG content out of a JSON data in a format:\n * { \"viewBox\": \"...\", children: [{ \"tag\": \"g\", \"\"children\": [ ... ], ...attrs }, ...] }\n *\n * @returns JSX.Element | null\n */\n private renderSVGContent(children?: any[]) {\n if (!children || children.length === 0) {\n return null;\n }\n\n const createElement = node => {\n const { tag, children, ...attrs } = node;\n return h(tag, attrs, children ? children.map(createElement) : null);\n };\n\n const svgElements = children.map(createElement);\n return svgElements;\n }\n\n render() {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n height={this.size}\n width={this.size}\n viewBox={this.iconData?.viewBox || `0 0 ${this.size} ${this.size}`}\n >\n {this.renderSVGContent(this.iconData?.children)}\n </svg>\n );\n }\n}\n"]}
|