le-kit 0.2.5 → 0.3.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/dist/cjs/le-bar.cjs.entry.js +428 -0
- package/dist/cjs/le-box.cjs.entry.js +1 -1
- package/dist/cjs/le-button_13.cjs.entry.js +17 -17
- package/dist/cjs/le-card.cjs.entry.js +1 -1
- package/dist/cjs/le-combobox.cjs.entry.js +1 -1
- package/dist/cjs/le-header-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/le-icon.cjs.entry.js +1 -1
- package/dist/cjs/le-kit.cjs.js +1 -1
- package/dist/cjs/le-multiselect.cjs.entry.js +3 -3
- package/dist/cjs/le-navigation.cjs.entry.js +62 -251
- package/dist/cjs/le-number-input.cjs.entry.js +1 -1
- package/dist/cjs/le-round-progress.cjs.entry.js +1 -1
- package/dist/cjs/le-segmented-control.cjs.entry.js +1 -1
- package/dist/cjs/le-stack.cjs.entry.js +1 -1
- package/dist/cjs/le-tab-bar.cjs.entry.js +1 -1
- package/dist/cjs/le-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/le-tab.cjs.entry.js +1 -1
- package/dist/cjs/le-tabs.cjs.entry.js +2 -2
- package/dist/cjs/le-tag.cjs.entry.js +1 -1
- package/dist/cjs/le-turntable.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/le-bar/le-bar.css +255 -0
- package/dist/collection/components/le-bar/le-bar.js +628 -0
- package/dist/collection/components/le-bar/le-bar.js.map +1 -0
- package/dist/collection/components/le-box/le-box.js +1 -1
- package/dist/collection/components/le-button/le-button.js +1 -1
- package/dist/collection/components/le-card/le-card.js +1 -1
- package/dist/collection/components/le-checkbox/le-checkbox.js +1 -1
- package/dist/collection/components/le-collapse/le-collapse.js +1 -1
- package/dist/collection/components/le-combobox/le-combobox.js +1 -1
- package/dist/collection/components/le-current-heading/le-current-heading.js +1 -1
- package/dist/collection/components/le-dropdown-base/le-dropdown-base.js +1 -1
- package/dist/collection/components/le-header/le-header.js +2 -2
- package/dist/collection/components/le-header-placeholder/le-header-placeholder.js +1 -1
- package/dist/collection/components/le-icon/le-icon.js +1 -1
- package/dist/collection/components/le-multiselect/le-multiselect.js +3 -3
- package/dist/collection/components/le-navigation/le-navigation.css +29 -47
- package/dist/collection/components/le-navigation/le-navigation.js +63 -252
- package/dist/collection/components/le-navigation/le-navigation.js.map +1 -1
- package/dist/collection/components/le-number-input/le-number-input.js +1 -1
- package/dist/collection/components/le-popover/le-popover.js +3 -3
- package/dist/collection/components/le-popup/le-popup.js +1 -1
- package/dist/collection/components/le-round-progress/le-round-progress.js +1 -1
- package/dist/collection/components/le-scroll-progress/le-scroll-progress.js +1 -1
- package/dist/collection/components/le-segmented-control/le-segmented-control.js +1 -1
- package/dist/collection/components/le-select/le-select.js +2 -2
- package/dist/collection/components/le-slot/le-slot.js +1 -1
- package/dist/collection/components/le-stack/le-stack.js +1 -1
- package/dist/collection/components/le-string-input/le-string-input.js +2 -2
- package/dist/collection/components/le-tab/le-tab.js +1 -1
- package/dist/collection/components/le-tab-bar/le-tab-bar.js +1 -1
- package/dist/collection/components/le-tab-panel/le-tab-panel.js +2 -2
- package/dist/collection/components/le-tabs/le-tabs.js +2 -2
- package/dist/collection/components/le-tag/le-tag.js +1 -1
- package/dist/collection/components/le-turntable/le-turntable.js +1 -1
- package/dist/collection/dist/components/assets/custom-elements.json +2220 -1819
- package/dist/components/assets/custom-elements.json +2220 -1819
- package/dist/components/le-bar.d.ts +11 -0
- package/dist/components/le-bar.js +9 -0
- package/dist/components/le-bar.js.map +1 -0
- package/dist/components/le-bar2.js +473 -0
- package/dist/components/le-bar2.js.map +1 -0
- package/dist/components/le-box.js +1 -1
- package/dist/components/le-button2.js +8 -8
- package/dist/components/le-card.js +1 -1
- package/dist/components/le-collapse2.js +1 -1
- package/dist/components/le-combobox.js +1 -1
- package/dist/components/le-current-heading.js +1 -1
- package/dist/components/le-dropdown-base2.js +1 -1
- package/dist/components/le-header-placeholder.js +1 -1
- package/dist/components/le-header.js +2 -2
- package/dist/components/le-icon2.js +1 -1
- package/dist/components/le-multiselect.js +3 -3
- package/dist/components/le-navigation.js +71 -254
- package/dist/components/le-navigation.js.map +1 -1
- package/dist/components/le-number-input.js +1 -1
- package/dist/components/le-popover2.js +3 -3
- package/dist/components/le-round-progress.js +1 -1
- package/dist/components/le-scroll-progress.js +1 -1
- package/dist/components/le-segmented-control.js +1 -1
- package/dist/components/le-stack.js +1 -1
- package/dist/components/le-tab-bar.js +1 -1
- package/dist/components/le-tab-panel.js +2 -2
- package/dist/components/le-tab2.js +1 -1
- package/dist/components/le-tabs.js +2 -2
- package/dist/components/le-tag2.js +1 -1
- package/dist/components/le-turntable.js +1 -1
- package/dist/docs.json +404 -13
- package/dist/esm/le-bar.entry.js +426 -0
- package/dist/esm/le-bar.entry.js.map +1 -0
- package/dist/esm/le-box.entry.js +1 -1
- package/dist/esm/le-button_13.entry.js +17 -17
- package/dist/esm/le-card.entry.js +1 -1
- package/dist/esm/le-combobox.entry.js +1 -1
- package/dist/esm/le-header-placeholder.entry.js +1 -1
- package/dist/esm/le-icon.entry.js +1 -1
- package/dist/esm/le-kit.js +1 -1
- package/dist/esm/le-multiselect.entry.js +3 -3
- package/dist/esm/le-navigation.entry.js +62 -251
- package/dist/esm/le-navigation.entry.js.map +1 -1
- package/dist/esm/le-number-input.entry.js +1 -1
- package/dist/esm/le-round-progress.entry.js +1 -1
- package/dist/esm/le-segmented-control.entry.js +1 -1
- package/dist/esm/le-stack.entry.js +1 -1
- package/dist/esm/le-tab-bar.entry.js +1 -1
- package/dist/esm/le-tab-panel.entry.js +2 -2
- package/dist/esm/le-tab.entry.js +1 -1
- package/dist/esm/le-tabs.entry.js +2 -2
- package/dist/esm/le-tag.entry.js +1 -1
- package/dist/esm/le-turntable.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/le-kit/dist/components/assets/custom-elements.json +2220 -1819
- package/dist/le-kit/le-kit.esm.js +1 -1
- package/dist/le-kit/{p-00cd6dc4.entry.js → p-07705c61.entry.js} +2 -2
- package/dist/le-kit/{p-0b5ab6ec.entry.js → p-0a270831.entry.js} +2 -2
- package/dist/le-kit/p-2102a152.entry.js +2 -0
- package/dist/le-kit/{p-02699578.entry.js.map → p-2102a152.entry.js.map} +1 -1
- package/dist/le-kit/{p-76d03b1e.entry.js → p-244ff3d7.entry.js} +2 -2
- package/dist/le-kit/{p-a5e21c8e.entry.js → p-249db213.entry.js} +2 -2
- package/dist/le-kit/{p-348a4e39.entry.js → p-3a0a57e9.entry.js} +2 -2
- package/dist/le-kit/{p-2db32332.entry.js → p-4b88b0da.entry.js} +2 -2
- package/dist/le-kit/p-4f11ea11.entry.js +2 -0
- package/dist/le-kit/p-4f11ea11.entry.js.map +1 -0
- package/dist/le-kit/p-53d9c363.entry.js +2 -0
- package/dist/le-kit/p-53d9c363.entry.js.map +1 -0
- package/dist/le-kit/{p-9f409d74.entry.js → p-61edb398.entry.js} +2 -2
- package/dist/le-kit/{p-17ace252.entry.js → p-6d0090c1.entry.js} +2 -2
- package/dist/le-kit/{p-91421993.entry.js → p-73f7de28.entry.js} +2 -2
- package/dist/le-kit/{p-8907cf95.entry.js → p-764005e3.entry.js} +2 -2
- package/dist/le-kit/{p-509caf7f.entry.js → p-94f774af.entry.js} +2 -2
- package/dist/le-kit/p-ac822433.entry.js +2 -0
- package/dist/le-kit/{p-995f6de8.entry.js → p-b21277e8.entry.js} +2 -2
- package/dist/le-kit/{p-65fa68c3.entry.js → p-b6997587.entry.js} +2 -2
- package/dist/le-kit/{p-0aab5747.entry.js → p-c0ccc9aa.entry.js} +2 -2
- package/dist/le-kit/{p-b4dcb4df.entry.js → p-ebd86d4f.entry.js} +2 -2
- package/dist/types/components/le-bar/le-bar.d.ts +125 -0
- package/dist/types/components/le-navigation/le-navigation.d.ts +10 -18
- package/dist/types/components.d.ts +148 -0
- package/package.json +1 -1
- package/dist/le-kit/p-02699578.entry.js +0 -2
- package/dist/le-kit/p-a1c26c46.entry.js +0 -2
- package/dist/le-kit/p-a1c26c46.entry.js.map +0 -1
- package/dist/le-kit/p-ccf4c548.entry.js +0 -2
- /package/dist/le-kit/{p-00cd6dc4.entry.js.map → p-07705c61.entry.js.map} +0 -0
- /package/dist/le-kit/{p-0b5ab6ec.entry.js.map → p-0a270831.entry.js.map} +0 -0
- /package/dist/le-kit/{p-76d03b1e.entry.js.map → p-244ff3d7.entry.js.map} +0 -0
- /package/dist/le-kit/{p-a5e21c8e.entry.js.map → p-249db213.entry.js.map} +0 -0
- /package/dist/le-kit/{p-348a4e39.entry.js.map → p-3a0a57e9.entry.js.map} +0 -0
- /package/dist/le-kit/{p-2db32332.entry.js.map → p-4b88b0da.entry.js.map} +0 -0
- /package/dist/le-kit/{p-9f409d74.entry.js.map → p-61edb398.entry.js.map} +0 -0
- /package/dist/le-kit/{p-17ace252.entry.js.map → p-6d0090c1.entry.js.map} +0 -0
- /package/dist/le-kit/{p-91421993.entry.js.map → p-73f7de28.entry.js.map} +0 -0
- /package/dist/le-kit/{p-8907cf95.entry.js.map → p-764005e3.entry.js.map} +0 -0
- /package/dist/le-kit/{p-509caf7f.entry.js.map → p-94f774af.entry.js.map} +0 -0
- /package/dist/le-kit/{p-ccf4c548.entry.js.map → p-ac822433.entry.js.map} +0 -0
- /package/dist/le-kit/{p-995f6de8.entry.js.map → p-b21277e8.entry.js.map} +0 -0
- /package/dist/le-kit/{p-65fa68c3.entry.js.map → p-b6997587.entry.js.map} +0 -0
- /package/dist/le-kit/{p-0aab5747.entry.js.map → p-c0ccc9aa.entry.js.map} +0 -0
- /package/dist/le-kit/{p-b4dcb4df.entry.js.map → p-ebd86d4f.entry.js.map} +0 -0
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CNRmviSz.js');
|
|
4
|
+
var utils = require('./utils-CZG22_vQ.js');
|
|
5
|
+
|
|
6
|
+
const leBarCss = () => `:host{display:block;--le-bar-gap:var(--le-spacing-2);--le-bar-padding:var(--le-spacing-2);--le-bar-min-height:2.5rem;--le-bar-background:transparent;--le-bar-border-color:var(--le-color-border);--le-bar-border-radius:var(--le-radius-md);--le-bar-button-size:2rem;--le-bar-button-color:var(--le-color-text-primary);--le-bar-button-hover-bg:var(--le-color-gray-100);--le-bar-button-border-radius:var(--le-radius-sm);--le-bar-arrow-size:1.5rem;--le-bar-popover-min-width:200px;--le-bar-popover-gap:var(--le-spacing-1)}.bar-container{display:flex;align-items:center;gap:var(--le-bar-gap);min-height:var(--le-bar-min-height);background:var(--le-bar-background);border-radius:var(--le-bar-border-radius);padding:var(--le-bar-padding)}.bar-container.align-start{justify-content:flex-start}.bar-container.align-end .bar-items{justify-content:flex-end}.bar-container.align-center .bar-items{justify-content:center}.bar-container.align-stretch .bar-items{justify-content:space-evenly}.bar-items{display:flex;flex-wrap:wrap;align-items:center;gap:var(--le-bar-gap);overflow:hidden;min-width:0;flex:1 1 0%;position:relative}.bar-items[style*="height"]{overflow:hidden}.bar-items.is-scrollable{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;scrollbar-width:none;-ms-overflow-style:none}.bar-items.is-scrollable::-webkit-scrollbar{display:none}.bar-items.is-scrollable ::slotted(*){scroll-snap-align:start;flex-shrink:0}.bar-items.is-wrapping{flex-wrap:wrap;overflow:visible;height:auto !important}.bar-controls{display:flex;align-items:center;gap:var(--le-spacing-1);flex-shrink:0}.bar-controls-start{order:-1}.bar-controls-end{order:1}.bar-more-button,.bar-hamburger-button,.bar-all-menu-button{display:inline-flex;align-items:center;justify-content:center;width:var(--le-bar-button-size);height:var(--le-bar-button-size);padding:0;border:none;background:transparent;color:var(--le-bar-button-color);border-radius:var(--le-bar-button-border-radius);cursor:pointer;transition:background-color 0.15s ease}.bar-more-button:hover,.bar-hamburger-button:hover,.bar-all-menu-button:hover{background:var(--le-bar-button-hover-bg)}.bar-more-button:focus-visible,.bar-hamburger-button:focus-visible,.bar-all-menu-button:focus-visible{outline:2px solid var(--le-color-focus);outline-offset:2px}.bar-arrow{display:inline-flex;align-items:center;justify-content:center;width:var(--le-bar-arrow-size);height:var(--le-bar-arrow-size);padding:0;border:none;background:transparent;color:var(--le-bar-button-color);border-radius:var(--le-bar-button-border-radius);cursor:pointer;transition:background-color 0.15s ease, opacity 0.15s ease}.bar-arrow:hover:not(:disabled){background:var(--le-bar-button-hover-bg)}.bar-arrow:focus-visible{outline:2px solid var(--le-color-focus);outline-offset:2px}.bar-arrow:disabled,.bar-arrow.disabled{opacity:0.3;cursor:not-allowed}.arrow-icon-start{transform:rotate(90deg)}.arrow-icon-end{transform:rotate(-90deg)}.bar-overflow-trigger,.bar-all-menu-trigger{display:inline-flex}.bar-popover-content{display:flex;flex-direction:column;gap:var(--le-bar-popover-gap);min-width:var(--le-bar-popover-min-width);padding:var(--le-spacing-2)}.bar-popover-item{cursor:pointer}.bar-popover-item:hover{background:var(--le-bar-button-hover-bg);border-radius:var(--le-bar-button-border-radius)}:host(.hamburger-active) .bar-items{visibility:hidden;pointer-events:none}`;
|
|
7
|
+
|
|
8
|
+
const LeBar = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
index.registerInstance(this, hostRef);
|
|
11
|
+
this.leBarOverflowChange = index.createEvent(this, "leBarOverflowChange");
|
|
12
|
+
}
|
|
13
|
+
get el() { return index.getElement(this); }
|
|
14
|
+
/**
|
|
15
|
+
* Overflow behavior when items don't fit on one row.
|
|
16
|
+
* - `more`: Overflow items appear in a "more" dropdown
|
|
17
|
+
* - `scroll`: Items scroll horizontally with optional arrows
|
|
18
|
+
* - `hamburger`: All items go into a hamburger menu if any overflow
|
|
19
|
+
* - `wrap`: Items wrap to additional rows
|
|
20
|
+
*/
|
|
21
|
+
overflow = 'more';
|
|
22
|
+
/**
|
|
23
|
+
* Alignment of items within the bar (maps to justify-content).
|
|
24
|
+
*/
|
|
25
|
+
alignItems = 'start';
|
|
26
|
+
/**
|
|
27
|
+
* Show scroll arrows when overflow is "scroll".
|
|
28
|
+
*/
|
|
29
|
+
arrows = false;
|
|
30
|
+
/**
|
|
31
|
+
* Disable the internal overflow popover.
|
|
32
|
+
* When true, the bar still detects overflow and hides items,
|
|
33
|
+
* but doesn't render its own popover. Use this when providing
|
|
34
|
+
* custom overflow handling via the leBarOverflowChange event.
|
|
35
|
+
*/
|
|
36
|
+
disablePopover = false;
|
|
37
|
+
/**
|
|
38
|
+
* Show an "all items" menu button.
|
|
39
|
+
* - `false`: Don't show
|
|
40
|
+
* - `true` or `'end'`: Show at end
|
|
41
|
+
* - `'start'`: Show at start
|
|
42
|
+
*/
|
|
43
|
+
showAllMenu = false;
|
|
44
|
+
/**
|
|
45
|
+
* Emitted when overflow state changes.
|
|
46
|
+
*/
|
|
47
|
+
leBarOverflowChange;
|
|
48
|
+
/** Whether the hamburger/more popover is open */
|
|
49
|
+
popoverOpen = false;
|
|
50
|
+
/** Whether hamburger mode is active (for hamburger overflow) */
|
|
51
|
+
hamburgerActive = false;
|
|
52
|
+
/** IDs of items that are overflowing */
|
|
53
|
+
overflowingIds = new Set();
|
|
54
|
+
/** Whether we can scroll left */
|
|
55
|
+
canScrollStart = false;
|
|
56
|
+
/** Whether we can scroll right */
|
|
57
|
+
canScrollEnd = false;
|
|
58
|
+
/** Whether the all-menu popover is open */
|
|
59
|
+
allMenuOpen = false;
|
|
60
|
+
/** Current height of the items container (for overflow handling) */
|
|
61
|
+
containerHeight = null;
|
|
62
|
+
itemsContainerEl;
|
|
63
|
+
moreButtonEl;
|
|
64
|
+
resizeObserver;
|
|
65
|
+
mutationObserver;
|
|
66
|
+
instanceId = utils.generateId('le-bar');
|
|
67
|
+
// Map to track item elements and their IDs
|
|
68
|
+
itemMap = new Map();
|
|
69
|
+
// Prevent multiple recalculations in the same frame
|
|
70
|
+
pendingRecalc = null;
|
|
71
|
+
handleOverflowChange() {
|
|
72
|
+
this.resetOverflowState();
|
|
73
|
+
this.scheduleOverflowRecalc();
|
|
74
|
+
}
|
|
75
|
+
handleSlotChange() {
|
|
76
|
+
this.scheduleOverflowRecalc();
|
|
77
|
+
}
|
|
78
|
+
connectedCallback() {
|
|
79
|
+
this.setupObservers();
|
|
80
|
+
}
|
|
81
|
+
componentDidLoad() {
|
|
82
|
+
this.scheduleOverflowRecalc();
|
|
83
|
+
}
|
|
84
|
+
componentDidRender() {
|
|
85
|
+
// Recalculate after render in case children changed
|
|
86
|
+
this.scheduleOverflowRecalc();
|
|
87
|
+
}
|
|
88
|
+
disconnectedCallback() {
|
|
89
|
+
this.resizeObserver?.disconnect();
|
|
90
|
+
this.mutationObserver?.disconnect();
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Force recalculation of overflow state.
|
|
94
|
+
*/
|
|
95
|
+
async recalculate() {
|
|
96
|
+
this.computeOverflow();
|
|
97
|
+
}
|
|
98
|
+
setupObservers() {
|
|
99
|
+
// ResizeObserver for container size changes
|
|
100
|
+
if (typeof ResizeObserver !== 'undefined') {
|
|
101
|
+
this.resizeObserver = new ResizeObserver(() => {
|
|
102
|
+
this.computeOverflow();
|
|
103
|
+
this.updateScrollState();
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
// MutationObserver for child changes
|
|
107
|
+
this.mutationObserver = new MutationObserver(() => {
|
|
108
|
+
this.scheduleOverflowRecalc();
|
|
109
|
+
});
|
|
110
|
+
this.mutationObserver.observe(this.el, {
|
|
111
|
+
childList: true,
|
|
112
|
+
subtree: false,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
observeContainer(el) {
|
|
116
|
+
if (!this.resizeObserver)
|
|
117
|
+
return;
|
|
118
|
+
this.resizeObserver.disconnect();
|
|
119
|
+
if (el)
|
|
120
|
+
this.resizeObserver.observe(el);
|
|
121
|
+
}
|
|
122
|
+
scheduleOverflowRecalc() {
|
|
123
|
+
// Debounce recalculations to prevent infinite loops
|
|
124
|
+
if (this.pendingRecalc !== null) {
|
|
125
|
+
cancelAnimationFrame(this.pendingRecalc);
|
|
126
|
+
}
|
|
127
|
+
this.pendingRecalc = requestAnimationFrame(() => {
|
|
128
|
+
this.pendingRecalc = null;
|
|
129
|
+
this.computeOverflow();
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
resetOverflowState() {
|
|
133
|
+
this.hamburgerActive = false;
|
|
134
|
+
this.overflowingIds = new Set();
|
|
135
|
+
this.containerHeight = null;
|
|
136
|
+
this.popoverOpen = false;
|
|
137
|
+
}
|
|
138
|
+
getSlottedItems() {
|
|
139
|
+
// Get direct children from the light DOM (excluding named slot elements)
|
|
140
|
+
return Array.from(this.el.children).filter((el) => el instanceof HTMLElement && !el.hasAttribute('slot'));
|
|
141
|
+
}
|
|
142
|
+
getItemId(el, index) {
|
|
143
|
+
return el.id || el.dataset.barId || `${this.instanceId}-item-${index}`;
|
|
144
|
+
}
|
|
145
|
+
computeOverflow() {
|
|
146
|
+
if (this.overflow === 'wrap' || this.overflow === 'scroll') {
|
|
147
|
+
// No overflow handling needed for wrap/scroll modes
|
|
148
|
+
this.resetOverflowState();
|
|
149
|
+
this.updateScrollState();
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const container = this.itemsContainerEl;
|
|
153
|
+
if (!container)
|
|
154
|
+
return;
|
|
155
|
+
const items = this.getSlottedItems();
|
|
156
|
+
if (items.length === 0) {
|
|
157
|
+
this.resetOverflowState();
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
// Build item map
|
|
161
|
+
this.itemMap.clear();
|
|
162
|
+
items.forEach((item, index) => {
|
|
163
|
+
const id = this.getItemId(item, index);
|
|
164
|
+
this.itemMap.set(id, item);
|
|
165
|
+
});
|
|
166
|
+
// Get the position of items to determine which are on the first row
|
|
167
|
+
const itemRects = items.map((item, index) => ({
|
|
168
|
+
item,
|
|
169
|
+
id: this.getItemId(item, index),
|
|
170
|
+
rect: item.getBoundingClientRect(),
|
|
171
|
+
}));
|
|
172
|
+
if (itemRects.length === 0) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
// Find the first row's top position (accounting for vertical alignment)
|
|
176
|
+
const containerRect = container.getBoundingClientRect();
|
|
177
|
+
const topValues = itemRects.map(i => i.rect.top - containerRect.top);
|
|
178
|
+
const minTop = Math.min(...topValues);
|
|
179
|
+
// Items are on the first row if their top is close to minTop
|
|
180
|
+
// Allow some tolerance for alignment differences
|
|
181
|
+
const tolerance = 15;
|
|
182
|
+
const firstRowItems = itemRects.filter(i => i.rect.top - containerRect.top <= minTop + tolerance);
|
|
183
|
+
const overflowItems = itemRects.filter(i => i.rect.top - containerRect.top > minTop + tolerance);
|
|
184
|
+
// Calculate the height of the first row
|
|
185
|
+
const firstRowBottom = firstRowItems.length > 0
|
|
186
|
+
? Math.max(...firstRowItems.map(i => i.rect.bottom - containerRect.top))
|
|
187
|
+
: 0;
|
|
188
|
+
if (this.overflow === 'hamburger') {
|
|
189
|
+
// In hamburger mode, if ANY item overflows, all go into the menu
|
|
190
|
+
const shouldHamburger = overflowItems.length > 0;
|
|
191
|
+
if (shouldHamburger !== this.hamburgerActive) {
|
|
192
|
+
this.hamburgerActive = shouldHamburger;
|
|
193
|
+
this.emitOverflowChange();
|
|
194
|
+
}
|
|
195
|
+
// Set height to show only first row (or hide all if hamburger is active)
|
|
196
|
+
if (shouldHamburger && firstRowBottom > 0) {
|
|
197
|
+
this.containerHeight = firstRowBottom;
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
this.containerHeight = null;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
// 'more' mode
|
|
205
|
+
const newOverflowingIds = new Set(overflowItems.map(i => i.id));
|
|
206
|
+
// Check if we need to make room for the "more" button
|
|
207
|
+
if (newOverflowingIds.size > 0 && this.moreButtonEl) {
|
|
208
|
+
const moreRect = this.moreButtonEl.getBoundingClientRect();
|
|
209
|
+
const moreTop = moreRect.top - containerRect.top;
|
|
210
|
+
// If "more" button is not on the first row, we need to hide one more item
|
|
211
|
+
if (moreTop > minTop + tolerance) {
|
|
212
|
+
// Find the last visible item and move it to overflow
|
|
213
|
+
const lastVisible = firstRowItems[firstRowItems.length - 1];
|
|
214
|
+
if (lastVisible) {
|
|
215
|
+
newOverflowingIds.add(lastVisible.id);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
// Check if overflow state changed
|
|
220
|
+
const hasChanged = newOverflowingIds.size !== this.overflowingIds.size ||
|
|
221
|
+
![...newOverflowingIds].every(id => this.overflowingIds.has(id));
|
|
222
|
+
if (hasChanged) {
|
|
223
|
+
this.overflowingIds = newOverflowingIds;
|
|
224
|
+
this.emitOverflowChange();
|
|
225
|
+
}
|
|
226
|
+
// Set container height to show only first row
|
|
227
|
+
if (newOverflowingIds.size > 0 && firstRowBottom > 0) {
|
|
228
|
+
this.containerHeight = firstRowBottom;
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
this.containerHeight = null;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
emitOverflowChange() {
|
|
236
|
+
this.leBarOverflowChange.emit({
|
|
237
|
+
overflowingIds: [...this.overflowingIds],
|
|
238
|
+
hamburgerActive: this.hamburgerActive,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
updateScrollState() {
|
|
242
|
+
if (this.overflow !== 'scroll' || !this.itemsContainerEl) {
|
|
243
|
+
this.canScrollStart = false;
|
|
244
|
+
this.canScrollEnd = false;
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
const el = this.itemsContainerEl;
|
|
248
|
+
this.canScrollStart = el.scrollLeft > 0;
|
|
249
|
+
this.canScrollEnd = el.scrollLeft < el.scrollWidth - el.clientWidth - 1;
|
|
250
|
+
}
|
|
251
|
+
handleScroll = () => {
|
|
252
|
+
this.updateScrollState();
|
|
253
|
+
};
|
|
254
|
+
scrollToStart = () => {
|
|
255
|
+
if (!this.itemsContainerEl)
|
|
256
|
+
return;
|
|
257
|
+
const items = this.getSlottedItems();
|
|
258
|
+
const container = this.itemsContainerEl;
|
|
259
|
+
// Find the scroll position of the previous item
|
|
260
|
+
const currentScroll = container.scrollLeft;
|
|
261
|
+
let targetScroll = 0;
|
|
262
|
+
for (let i = items.length - 1; i >= 0; i--) {
|
|
263
|
+
const item = items[i];
|
|
264
|
+
// Calculate item's left edge relative to container's scroll position
|
|
265
|
+
const itemLeft = item.offsetLeft - container.offsetLeft;
|
|
266
|
+
// If this item starts before current scroll position, scroll to it
|
|
267
|
+
if (itemLeft < currentScroll - 1) {
|
|
268
|
+
targetScroll = itemLeft;
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
container.scrollTo({ left: targetScroll, behavior: 'smooth' });
|
|
273
|
+
// Update scroll state after animation
|
|
274
|
+
setTimeout(() => this.updateScrollState(), 300);
|
|
275
|
+
};
|
|
276
|
+
scrollToEnd = () => {
|
|
277
|
+
if (!this.itemsContainerEl)
|
|
278
|
+
return;
|
|
279
|
+
const container = this.itemsContainerEl;
|
|
280
|
+
const items = this.getSlottedItems();
|
|
281
|
+
if (items.length === 0)
|
|
282
|
+
return;
|
|
283
|
+
const containerWidth = container.clientWidth;
|
|
284
|
+
const currentScroll = container.scrollLeft;
|
|
285
|
+
let targetScroll = container.scrollWidth - containerWidth;
|
|
286
|
+
for (const item of items) {
|
|
287
|
+
// Calculate item's right edge relative to container
|
|
288
|
+
const itemLeft = item.offsetLeft - container.offsetLeft;
|
|
289
|
+
// If this is the next item to scroll to from left to right then scroll to it
|
|
290
|
+
if (itemLeft > currentScroll + 1) {
|
|
291
|
+
targetScroll = itemLeft;
|
|
292
|
+
break;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
container.scrollTo({ left: Math.max(0, targetScroll), behavior: 'smooth' });
|
|
296
|
+
// Update scroll state after animation
|
|
297
|
+
setTimeout(() => this.updateScrollState(), 300);
|
|
298
|
+
};
|
|
299
|
+
togglePopover = () => {
|
|
300
|
+
this.popoverOpen = !this.popoverOpen;
|
|
301
|
+
};
|
|
302
|
+
closePopover = () => {
|
|
303
|
+
this.popoverOpen = false;
|
|
304
|
+
};
|
|
305
|
+
toggleAllMenu = () => {
|
|
306
|
+
this.allMenuOpen = !this.allMenuOpen;
|
|
307
|
+
};
|
|
308
|
+
closeAllMenu = () => {
|
|
309
|
+
this.allMenuOpen = false;
|
|
310
|
+
};
|
|
311
|
+
handleItemClick = (_e, id) => {
|
|
312
|
+
// Close popover when an item inside is clicked
|
|
313
|
+
const originalItem = this.itemMap.get(id);
|
|
314
|
+
if (originalItem) {
|
|
315
|
+
// Clone the click to the original item
|
|
316
|
+
const cloneEvent = new MouseEvent('click', {
|
|
317
|
+
bubbles: true,
|
|
318
|
+
cancelable: true,
|
|
319
|
+
view: window,
|
|
320
|
+
});
|
|
321
|
+
originalItem.dispatchEvent(cloneEvent);
|
|
322
|
+
}
|
|
323
|
+
this.closePopover();
|
|
324
|
+
this.closeAllMenu();
|
|
325
|
+
};
|
|
326
|
+
renderMoreButton() {
|
|
327
|
+
const hasSlottedMore = this.el.querySelector('[slot="more"]');
|
|
328
|
+
return (index.h("button", { class: "bar-more-button", part: "more-button", ref: el => (this.moreButtonEl = el), onClick: this.togglePopover, "aria-expanded": String(this.popoverOpen), "aria-haspopup": "true" }, hasSlottedMore ? index.h("slot", { name: "more" }) : index.h("le-icon", { name: "ellipsis-horizontal" })));
|
|
329
|
+
}
|
|
330
|
+
renderHamburgerButton() {
|
|
331
|
+
const hasSlottedHamburger = this.el.querySelector('[slot="hamburger"]');
|
|
332
|
+
return (index.h("button", { class: "bar-hamburger-button", part: "hamburger-button", onClick: this.togglePopover, "aria-expanded": String(this.popoverOpen), "aria-haspopup": "true" }, hasSlottedHamburger ? index.h("slot", { name: "hamburger" }) : index.h("le-icon", { name: "hamburger" })));
|
|
333
|
+
}
|
|
334
|
+
renderScrollArrows() {
|
|
335
|
+
if (!this.arrows || this.overflow !== 'scroll')
|
|
336
|
+
return null;
|
|
337
|
+
const hasSlottedStartArrow = this.el.querySelector('[slot="start-arrow"]');
|
|
338
|
+
const hasSlottedEndArrow = this.el.querySelector('[slot="end-arrow"]');
|
|
339
|
+
return [
|
|
340
|
+
index.h("button", { class: utils.classnames('bar-arrow', 'bar-arrow-start', {
|
|
341
|
+
disabled: !this.canScrollStart,
|
|
342
|
+
}), part: "arrow-start", onClick: this.scrollToStart, disabled: !this.canScrollStart, "aria-label": "Scroll to start" }, hasSlottedStartArrow ? (index.h("slot", { name: "start-arrow" })) : (index.h("le-icon", { name: "chevron-down", class: "arrow-icon-start" }))),
|
|
343
|
+
index.h("button", { class: utils.classnames('bar-arrow', 'bar-arrow-end', {
|
|
344
|
+
disabled: !this.canScrollEnd,
|
|
345
|
+
}), part: "arrow-end", onClick: this.scrollToEnd, disabled: !this.canScrollEnd, "aria-label": "Scroll to end" }, hasSlottedEndArrow ? (index.h("slot", { name: "end-arrow" })) : (index.h("le-icon", { name: "chevron-down", class: "arrow-icon-end" }))),
|
|
346
|
+
];
|
|
347
|
+
}
|
|
348
|
+
renderAllMenuButton() {
|
|
349
|
+
if (!this.showAllMenu)
|
|
350
|
+
return null;
|
|
351
|
+
const hasSlottedAllMenu = this.el.querySelector('[slot="all-menu"]');
|
|
352
|
+
return (index.h("button", { class: "bar-all-menu-button", part: "all-menu-button", onClick: this.toggleAllMenu, "aria-expanded": String(this.allMenuOpen), "aria-haspopup": "true" }, hasSlottedAllMenu ? index.h("slot", { name: "all-menu" }) : index.h("le-icon", { name: "hamburger" })));
|
|
353
|
+
}
|
|
354
|
+
renderPopoverContent(itemsToShow) {
|
|
355
|
+
return (index.h("div", { class: "bar-popover-content", part: "popover-content" }, itemsToShow.map(({ id, item }) => (index.h("div", { class: "bar-popover-item", key: id, onClick: (e) => this.handleItemClick(e, id), innerHTML: item.outerHTML })))));
|
|
356
|
+
}
|
|
357
|
+
renderOverflowPopover() {
|
|
358
|
+
if (this.overflow !== 'more' && this.overflow !== 'hamburger')
|
|
359
|
+
return null;
|
|
360
|
+
const items = this.getSlottedItems();
|
|
361
|
+
let itemsToShow = [];
|
|
362
|
+
if (this.overflow === 'hamburger' && this.hamburgerActive) {
|
|
363
|
+
// Show all items in hamburger mode
|
|
364
|
+
itemsToShow = items.map((item, index) => ({
|
|
365
|
+
id: this.getItemId(item, index),
|
|
366
|
+
item,
|
|
367
|
+
}));
|
|
368
|
+
}
|
|
369
|
+
else if (this.overflow === 'more' && this.overflowingIds.size > 0) {
|
|
370
|
+
// Show only overflowing items
|
|
371
|
+
itemsToShow = items
|
|
372
|
+
.map((item, index) => ({
|
|
373
|
+
id: this.getItemId(item, index),
|
|
374
|
+
item,
|
|
375
|
+
}))
|
|
376
|
+
.filter(({ id }) => this.overflowingIds.has(id));
|
|
377
|
+
}
|
|
378
|
+
if (itemsToShow.length === 0)
|
|
379
|
+
return null;
|
|
380
|
+
return (index.h("le-popover", { mode: "default", open: this.popoverOpen, position: "bottom", align: "end", showClose: false, closeOnClickOutside: true, closeOnEscape: true, onLePopoverClose: this.closePopover }, index.h("div", { slot: "trigger", class: "bar-overflow-trigger" }, this.overflow === 'hamburger' ? this.renderHamburgerButton() : this.renderMoreButton()), this.renderPopoverContent(itemsToShow)));
|
|
381
|
+
}
|
|
382
|
+
renderAllMenuPopover() {
|
|
383
|
+
if (!this.showAllMenu)
|
|
384
|
+
return null;
|
|
385
|
+
const items = this.getSlottedItems();
|
|
386
|
+
const itemsToShow = items.map((item, index) => ({
|
|
387
|
+
id: this.getItemId(item, index),
|
|
388
|
+
item,
|
|
389
|
+
}));
|
|
390
|
+
const position = this.showAllMenu === 'start' ? 'start' : 'end';
|
|
391
|
+
return (index.h("le-popover", { mode: "default", open: this.allMenuOpen, position: "bottom", align: position, showClose: false, closeOnClickOutside: true, closeOnEscape: true, onLePopoverClose: this.closeAllMenu }, index.h("div", { slot: "trigger", class: "bar-all-menu-trigger" }, this.renderAllMenuButton()), this.renderPopoverContent(itemsToShow)));
|
|
392
|
+
}
|
|
393
|
+
render() {
|
|
394
|
+
const showOverflowButton = !this.disablePopover &&
|
|
395
|
+
((this.overflow === 'more' && this.overflowingIds.size > 0) ||
|
|
396
|
+
(this.overflow === 'hamburger' && this.hamburgerActive));
|
|
397
|
+
const containerStyle = {};
|
|
398
|
+
if (this.containerHeight !== null &&
|
|
399
|
+
(this.overflow === 'more' || this.overflow === 'hamburger')) {
|
|
400
|
+
containerStyle.height = `${this.containerHeight}px`;
|
|
401
|
+
}
|
|
402
|
+
const showAllMenuAtStart = this.showAllMenu === 'start';
|
|
403
|
+
const showAllMenuAtEnd = this.showAllMenu === true || this.showAllMenu === 'end';
|
|
404
|
+
return (index.h(index.Host, { key: 'ee31d28cdad15267c6a31503d1a102d050114af1', class: utils.classnames({
|
|
405
|
+
'overflow-more': this.overflow === 'more',
|
|
406
|
+
'overflow-scroll': this.overflow === 'scroll',
|
|
407
|
+
'overflow-hamburger': this.overflow === 'hamburger',
|
|
408
|
+
'overflow-wrap': this.overflow === 'wrap',
|
|
409
|
+
'hamburger-active': this.hamburgerActive,
|
|
410
|
+
'has-overflow': this.overflowingIds.size > 0 || this.hamburgerActive,
|
|
411
|
+
}) }, index.h("div", { key: 'd9dbc7ccd3256697362f701dcef24b26e6c36765', class: utils.classnames('bar-container', {
|
|
412
|
+
[`align-${this.alignItems}`]: true,
|
|
413
|
+
}), part: "container" }, this.overflow === 'scroll' && this.arrows && (index.h("div", { key: '08e73b775740388f2b6bdb5f85965870713d119c', class: "bar-controls bar-controls-start" }, this.renderScrollArrows()?.[0])), showAllMenuAtStart && (index.h("div", { key: '919e6491693afb2095c4100744f53aa266f142d1', class: "bar-controls bar-controls-start" }, this.renderAllMenuPopover())), index.h("div", { key: '9a8251f1a1fe359efc266fb4787010f140ab4f5a', class: utils.classnames('bar-items', {
|
|
414
|
+
'is-scrollable': this.overflow === 'scroll',
|
|
415
|
+
'is-wrapping': this.overflow === 'wrap',
|
|
416
|
+
}), style: containerStyle, ref: el => {
|
|
417
|
+
this.itemsContainerEl = el;
|
|
418
|
+
this.observeContainer(el);
|
|
419
|
+
}, onScroll: this.overflow === 'scroll' ? this.handleScroll : undefined }, index.h("slot", { key: '89f54e7a897583fec944db086958f5211df4e347' })), showOverflowButton && (index.h("div", { key: 'b7a2eab419de82a26d8af0a352706737c07f3d5e', class: "bar-controls bar-controls-end" }, this.renderOverflowPopover())), showAllMenuAtEnd && (index.h("div", { key: '1dd1b9d97f389f4668a69643f8ff4424c847e85f', class: "bar-controls bar-controls-end" }, this.renderAllMenuPopover())), this.overflow === 'scroll' && this.arrows && (index.h("div", { key: '5f0abf7e091380b5e6769127271c192b56e8f573', class: "bar-controls bar-controls-end" }, this.renderScrollArrows()?.[1])))));
|
|
420
|
+
}
|
|
421
|
+
static get watchers() { return {
|
|
422
|
+
"overflow": ["handleOverflowChange"]
|
|
423
|
+
}; }
|
|
424
|
+
};
|
|
425
|
+
LeBar.style = leBarCss();
|
|
426
|
+
|
|
427
|
+
exports.le_bar = LeBar;
|
|
428
|
+
//# sourceMappingURL=le-bar.entry.cjs.js.map
|
|
@@ -175,7 +175,7 @@ const LeBox = class {
|
|
|
175
175
|
'display-flex': this.displayFlex,
|
|
176
176
|
[`inner-${this.innerDirection}`]: this.displayFlex,
|
|
177
177
|
});
|
|
178
|
-
return (index.h(index.Host, { key: '
|
|
178
|
+
return (index.h(index.Host, { key: '2d64b5a59e9eb12701ffd68ee2db293868b232a1', style: hostStyle, class: hostClass }, index.h("le-component", { key: '3b4c73ad636e9a884a212d6ca06ffbe55b3c438f', component: "le-box" }, index.h("div", { key: '00f1a922ba7d8c2c070d8254da9d4b9335e82bff', class: "box", part: "box" }, index.h("div", { key: 'bd974a033501e5b99d56892329017b95c95e753c', class: "content", part: "content", style: contentStyle }, index.h("le-slot", { key: '62ddce60dc17d6da11c033b2b94f1a3ce69f69da', name: "", description: "Content inside this flex item", type: "slot", "allowed-components": "le-text,le-card,le-button,le-stack,le-box" }, index.h("slot", { key: '780fdfd1873ad3a629d1afbfcd0d5ca60cd4c679' })))))));
|
|
179
179
|
}
|
|
180
180
|
};
|
|
181
181
|
LeBox.style = leBoxDefaultCss();
|
|
@@ -103,7 +103,7 @@ const LeButton = class {
|
|
|
103
103
|
const attrs = this.href
|
|
104
104
|
? { href: this.href, target: this.target, role: 'button' }
|
|
105
105
|
: { type: this.type, disabled: this.disabled };
|
|
106
|
-
return (index.h(index.Host, { key: '
|
|
106
|
+
return (index.h(index.Host, { key: '44fc577066f362e17d74b9a426caf98c5c146203', class: classes }, index.h("le-component", { key: '7fcb11591ecaf0dc69510a6e5fa1a481dc822bb1', component: "le-button" }, index.h(TagType, { key: '9065b7f4df2dffa763f0e2c8ad64fda4af80d4a6', class: utils.classnames('le-button-container', `le-button-align-${this.align}`), part: "button", ...attrs, onClick: this.handleClick }, this.iconOnly !== undefined ? (index.h("slot", { name: "icon-only" }, typeof this.iconOnly === 'string' ? this.iconOnly : null)) : (index.h(index.Fragment, null, index.h("span", { class: "le-button-label" }, this.iconStart && (index.h("span", { class: "icon-start", part: "icon-start" }, this.iconStart)), index.h("le-slot", { name: "", description: "Button text", type: "text", class: "content", part: "content" }, index.h("slot", null))), this.iconEnd && (index.h("span", { class: "icon-end", part: "icon-end" }, this.iconEnd))))))));
|
|
107
107
|
}
|
|
108
108
|
};
|
|
109
109
|
LeButton.style = leButtonCss();
|
|
@@ -157,7 +157,7 @@ const LeCheckbox = class {
|
|
|
157
157
|
});
|
|
158
158
|
};
|
|
159
159
|
render() {
|
|
160
|
-
return (index.h("le-component", { key: '
|
|
160
|
+
return (index.h("le-component", { key: '31d975847b6d3bd137a6436d5f91f0af2c035576', component: "le-checkbox", hostClass: utils.classnames({ 'disabled': this.disabled }) }, index.h("div", { key: '64d079beaf930bf4ebb244cc6511c1ed048b4699', class: "le-checkbox-wrapper" }, index.h("label", { key: '4ba352ae7cf709afd25d1ff5cc93fe87ff305920', class: "le-checkbox-label" }, index.h("span", { key: 'ee33b972a07d2a46f3beff8ba19a3902891f21d1', class: "le-checkbox-input" }, index.h("input", { key: '74825406b4b16e4fc0d351ec8266c2a14776fc3d', type: "checkbox", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled, onChange: this.handleChange })), index.h("span", { key: 'c6badbadb976ddaeeade6b75a6ac0f547c95cffb', class: "le-checkbox-text" }, index.h("le-slot", { key: '6cf2e6c835838db1a0a9ed8398b9b3e638ea640b', name: "", type: "text", tag: "span" }, index.h("slot", { key: 'a587324c7e8e91a1c3ab9bafad7d0030510e5272' })))), index.h("div", { key: '0a8aff276f51027e25b9367d6e50b2eefc1a9148', class: "le-checkbox-description" }, index.h("le-slot", { key: '33b411d6b69cba44d3821b4bb6ab3a5c72e4e517', name: "description", type: "text", tag: "div", label: "Description" }, index.h("slot", { key: '266af814c2a16aa1cd3a51db8dabb1bf952cf7a7', name: "description" }))))));
|
|
161
161
|
}
|
|
162
162
|
};
|
|
163
163
|
LeCheckbox.style = leCheckboxCss();
|
|
@@ -211,7 +211,7 @@ const LeCollapse = class {
|
|
|
211
211
|
this.el.toggleAttribute('data-open', nextOpen);
|
|
212
212
|
}
|
|
213
213
|
render() {
|
|
214
|
-
return (index.h(index.Host, { key: '
|
|
214
|
+
return (index.h(index.Host, { key: '19e96b22f47116cb9f5dc6ca9fc4ba8de2cb4299', "data-open": this.shouldBeOpen() ? 'true' : 'false' }, index.h("le-component", { key: '0c16c094b155580849f59553c3e2ecb359f99816', component: "le-collapse" }, index.h("div", { key: '28448db4a519e558ac9c40dccddf123a462899b0', class: { 'region': true, 'scroll-down': this.scrollDown }, part: "region" }, index.h("slot", { key: 'd14269819d746b985cf3b87052c9efdea08271d1' })))));
|
|
215
215
|
}
|
|
216
216
|
static get watchers() { return {
|
|
217
217
|
"open": ["onOpenChange"],
|
|
@@ -517,7 +517,7 @@ const LeCurrentHeading = class {
|
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
519
|
render() {
|
|
520
|
-
return (index.h(index.Host, { key: '
|
|
520
|
+
return (index.h(index.Host, { key: '684d2369883e7810ef0966f08f8ef835b8cf9343' }, this.activeText ? (index.h("span", { class: "title", part: "title" }, this.activeText)) : (index.h("slot", null))));
|
|
521
521
|
}
|
|
522
522
|
static get watchers() { return {
|
|
523
523
|
"selector": ["onSelectorChange"]
|
|
@@ -857,7 +857,7 @@ const LeDropdownBase = class {
|
|
|
857
857
|
}
|
|
858
858
|
render() {
|
|
859
859
|
const dropdownWidth = this.width || (this.triggerWidth ? `${this.triggerWidth}px` : undefined);
|
|
860
|
-
return (index.h(index.Host, { key: '
|
|
860
|
+
return (index.h(index.Host, { key: 'b8eb1155a22937ab148b5d3b91ec9ab688257dd9' }, index.h("le-popover", { key: '2dc509b3ef0f72b34d4e1d8d7556ded7569dc256', ref: el => (this.popoverEl = el), position: "bottom", align: "start", showClose: false, closeOnClickOutside: this.closeOnClickOutside, closeOnEscape: true, offset: 4, width: dropdownWidth, minWidth: "150px", "trigger-full-width": this.fullWidth, onLePopoverOpen: this.handlePopoverOpen, onLePopoverClose: this.handlePopoverClose }, index.h("slot", { key: '516aac3b9b267298e01dc38ab3f779015e3c1c37', name: "trigger", slot: "trigger" }), index.h("slot", { key: '38866292e03c304a2f7f4026bbc99972cd2b07c6', name: "header" }), index.h("div", { key: '9fa533a22f3235100150c24a4a95a51d9bad99a7', class: "dropdown-list", role: "listbox", "aria-multiselectable": this.multiple ? 'true' : undefined, ref: el => (this.listEl = el), style: { maxHeight: this.maxHeight } }, this.renderOptions()))));
|
|
861
861
|
}
|
|
862
862
|
static get watchers() { return {
|
|
863
863
|
"options": ["handleOptionsChange"],
|
|
@@ -1101,7 +1101,7 @@ const LeHeader = class {
|
|
|
1101
1101
|
'is-hidden': !this.revealed,
|
|
1102
1102
|
'is-shrunk': this.shrunk,
|
|
1103
1103
|
});
|
|
1104
|
-
return (index.h(index.Host, { key: '
|
|
1104
|
+
return (index.h(index.Host, { key: '8226ce910c1f3538c9f753ae966555843e9de0ae', class: hostClass, onMouseEnter: () => {
|
|
1105
1105
|
if (!this.expandOnHover)
|
|
1106
1106
|
return;
|
|
1107
1107
|
this.hoverActive = true;
|
|
@@ -1111,7 +1111,7 @@ const LeHeader = class {
|
|
|
1111
1111
|
return;
|
|
1112
1112
|
this.hoverActive = false;
|
|
1113
1113
|
this.scheduleUpdate(true);
|
|
1114
|
-
} }, index.h("le-component", { key: '
|
|
1114
|
+
} }, index.h("le-component", { key: '4ab9f55d577bbe626743d98ecceff43421297e04', component: "le-header" }, index.h("header", { key: '324780d62bce16b6b5031f99f60e77040b303536', class: "header", part: "header", role: "banner", ref: el => (this.headerEl = el) }, index.h("div", { key: 'b85650426cf45c1e33e34472a44dc2153817cd19', class: "inner", part: "inner" }, index.h("div", { key: 'e5480cb4eeb609671b3a54e0e62078249024dd19', class: "row", part: "row" }, index.h("div", { key: '659abffd71c2316aa61bfd3c678faf8bd3b60e5c', class: "start", part: "start" }, index.h("le-slot", { key: '31e3c153875787983c4a0e40bd8cd7fcf1766972', name: "start", label: "Start", description: "Logo / back button / nav", "allowed-components": "le-button,le-text,le-tag,le-box,le-stack" }, index.h("slot", { key: '770f771ccb01d471a4f2042e90b18b4e8f9aaea8', name: "start" }))), index.h("div", { key: 'db5e4915c79b33fd839b91d2172d2ebd4ceb47fd', class: "title", part: "title" }, index.h("le-slot", { key: '038f08471fbfca1c923cd0f3e7985b9edfba1895', name: "title", label: "Title", description: "Header title", type: "text", tag: "span" }, index.h("span", { key: 'fbb502918f0fd021ba8fd75ee9f36116fa0c77d2', class: "title-slot", part: "title" }, index.h("slot", { key: '99c46d12df0e52ac659af0fb2db0e7051cb2cc35', name: "title" })))), index.h("div", { key: 'c1b43c42fbe2858c3144dd4388da21a0fcf9d9dc', class: "end", part: "end" }, index.h("le-slot", { key: '13d1e92425997130378c80ac0eff7974a5ad5a97', name: "end", label: "End", description: "Actions", "allowed-components": "le-button,le-text,le-tag,le-box,le-stack" }, index.h("slot", { key: 'ac1902fe3c990a358f6dbf64b7215eeb2bfd9cd4', name: "end" })))), index.h("div", { key: '07ede1a18c5400d68ea32cef965e7b2534db9d47', class: "secondary", part: "secondary" }, index.h("le-slot", { key: '4eede5a0616d82da0996878b41cea2000b1030e7', name: "", label: "Secondary", description: "Secondary row content", "allowed-components": "le-tabs,le-tab-bar,le-select,le-combobox,le-text,le-stack,le-box" }, index.h("slot", { key: 'c6b287cd00c3f5fc95931078307e5d0b007ec53b' }))))))));
|
|
1115
1115
|
}
|
|
1116
1116
|
static get watchers() { return {
|
|
1117
1117
|
"revealOnScroll": ["onBehaviorPropsChange"],
|
|
@@ -1737,12 +1737,12 @@ const LePopover = class {
|
|
|
1737
1737
|
popoverStyles.minWidth = this.minWidth;
|
|
1738
1738
|
if (this.maxWidth)
|
|
1739
1739
|
popoverStyles.maxWidth = this.maxWidth;
|
|
1740
|
-
return (index.h(index.Host, { key: '
|
|
1740
|
+
return (index.h(index.Host, { key: '16aec5e624881b728716d00fc6827b5b9c4049b1', "trigger-full-width": this.triggerFullWidth }, index.h("div", { key: 'f4171fc444414c68d43b4a081b574fb6ccbc3dfe', class: utils.classnames('le-popover-trigger', {
|
|
1741
1741
|
'le-popover-trigger-full-width': this.triggerFullWidth,
|
|
1742
|
-
}), ref: el => (this.triggerEl = el), onClick: this.handleTriggerClick, part: "trigger" }, index.h("slot", { key: '
|
|
1742
|
+
}), ref: el => (this.triggerEl = el), onClick: this.handleTriggerClick, part: "trigger" }, index.h("slot", { key: '039a6b55fc666443605178c6f86ecd0155bfab1f', name: "trigger" }, index.h("button", { key: 'f7140509d06b764d3da9086a895036bccb72b939', type: "button", class: "le-popover-default-trigger" }, index.h("span", { key: 'd618acd932b9489020373820a81bde4bc8ec01e6' }, "\u2295")))), index.h("div", { key: '678d09edfa103eecd3fe04b03933d8c4c7c7f847', id: this.uniqueId, class: "le-popover-content",
|
|
1743
1743
|
// Always use manual mode so nested popovers can be open together.
|
|
1744
1744
|
// We implement click-outside and Escape handling ourselves.
|
|
1745
|
-
popover: "manual", ref: el => (this.popoverEl = el), style: popoverStyles, "data-fallback-open": this.supportsPopoverApi ? undefined : String(this.open) }, (this.popoverTitle || this.showClose) && (index.h("div", { key: '
|
|
1745
|
+
popover: "manual", ref: el => (this.popoverEl = el), style: popoverStyles, "data-fallback-open": this.supportsPopoverApi ? undefined : String(this.open) }, (this.popoverTitle || this.showClose) && (index.h("div", { key: '98404abda58b31d5a405be271180924bc140cb45', class: "le-popover-header" }, this.popoverTitle && index.h("span", { key: '43b1559400087ea256485c4755bf2db61feff3de', class: "le-popover-title" }, this.popoverTitle), this.showClose && (index.h("button", { key: '99ef18a9f3b0268b0010bc3cb1637a9409a47888', type: "button", class: "le-popover-close", onClick: () => this.hide(), "aria-label": "Close" }, "\u00D7")))), index.h("div", { key: '1631159f18e60932960449f86da91cd00f859fac', class: "le-popover-body", part: "content" }, index.h("slot", { key: '87a4a321122749546b18d1706dd39911eab3b843' })))));
|
|
1746
1746
|
}
|
|
1747
1747
|
};
|
|
1748
1748
|
LePopover.style = lePopoverCss();
|
|
@@ -1953,7 +1953,7 @@ const LePopup = class {
|
|
|
1953
1953
|
}
|
|
1954
1954
|
render() {
|
|
1955
1955
|
const positionClass = `le-popup-position-${this.position}`;
|
|
1956
|
-
return (index.h("dialog", { key: '
|
|
1956
|
+
return (index.h("dialog", { key: '75ff06ac2532818f2951283fb455d165d1b13e89', class: `le-popup-dialog ${positionClass}`, part: "dialog", ref: el => (this.dialogEl = el), onClick: this.handleBackdropClick }, index.h("le-component", { key: '0fea1c4ea66d8457c66bf5e14b08b7ac3251a9cc', component: "le-popup" }, index.h("div", { key: 'eb95845004b27cdba2e817b2f296a59ae1d62552', class: "le-popup-container", part: "container" }, this.renderHeader(), this.renderBody(), this.renderFooter()))));
|
|
1957
1957
|
}
|
|
1958
1958
|
};
|
|
1959
1959
|
LePopup.style = lePopupCss();
|
|
@@ -2061,7 +2061,7 @@ const LeScrollProgress = class {
|
|
|
2061
2061
|
}
|
|
2062
2062
|
render() {
|
|
2063
2063
|
const width = `${this.progress * 100}%`;
|
|
2064
|
-
return (index.h(index.Host, { key: '
|
|
2064
|
+
return (index.h(index.Host, { key: '5aa4fc59f57bbb1de387debf27b4a39c073c85bf' }, index.h("div", { key: '7bce9ba58ce43340c6e1c56afe7cb50eb0117079', class: "track", part: "track", "aria-hidden": "true" }, index.h("div", { key: 'adc0c2fe77b49d9496c67d05ce2b1a38dcafef05', class: "fill", part: "fill", style: { width } }))));
|
|
2065
2065
|
}
|
|
2066
2066
|
static get watchers() { return {
|
|
2067
2067
|
"trackScrollProgress": ["onTrackChange"]
|
|
@@ -2236,13 +2236,13 @@ const LeSelect = class {
|
|
|
2236
2236
|
}
|
|
2237
2237
|
render() {
|
|
2238
2238
|
const hasValue = this.selectedOption !== undefined;
|
|
2239
|
-
return (index.h("le-component", { key: '
|
|
2239
|
+
return (index.h("le-component", { key: '1659550d258d0d647cefa5715cc9cbcf5ac3b6c7', component: "le-select" }, index.h("le-dropdown-base", { key: '4210afe927afaf35adeb25794d684d8bf6265604', ref: el => (this.dropdownEl = el), options: this.parsedOptions, value: this.value, disabled: this.disabled, filterFn: this.searchable ? this.filterOption : undefined, filterQuery: this.searchQuery, onLeOptionSelect: this.handleOptionSelect, onLeDropdownOpen: this.handleDropdownOpen, onLeDropdownClose: this.handleDropdownClose, fullWidth: this.fullWidth }, index.h("le-button", { key: '204b62bae909fb979f84f79ab64a7405f44df0a7', variant: this.variant && this.variant !== 'default' ? this.variant : 'outlined', slot: "trigger", align: "space-between", class: {
|
|
2240
2240
|
'select-trigger': true,
|
|
2241
2241
|
'has-value': hasValue,
|
|
2242
2242
|
'is-open': this.open,
|
|
2243
2243
|
}, mode: "default", size: this.size, disabled: this.disabled, "aria-haspopup": "listbox", "aria-expanded": this.open ? 'true' : 'false', onClick: this.handleTriggerClick, onKeyDown: this.handleTriggerKeyDown, fullWidth: this.fullWidth, iconStart: hasValue && this.selectedOption?.iconStart
|
|
2244
2244
|
? this.renderIcon(this.selectedOption.iconStart)
|
|
2245
|
-
: null, iconEnd: index.h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", "stroke-width": "2" }, index.h("path", { d: "M4 6l4 4 4-4" })) }, index.h("span", { key: '
|
|
2245
|
+
: null, iconEnd: index.h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", "stroke-width": "2" }, index.h("path", { d: "M4 6l4 4 4-4" })) }, index.h("span", { key: 'abb56957a4ddf6b39c3554b26e46c0ad51e022be', class: "trigger-label" }, hasValue ? this.selectedOption.label : this.placeholder)), this.searchable && this.open && (index.h("div", { key: '25d58fdfddc45f7fde1a41defdbd50dbddd70ea5', class: "multiselect-search", slot: "header" }, index.h("le-string-input", { key: '81b290d28bed6190b9ec165897ec2e7d758575bf', mode: "default", inputRef: el => (this.inputEl = el), class: "search-input", placeholder: "Search...", value: this.searchQuery, onInput: this.handleSearchInput })))), this.name && index.h("input", { key: '70e413d81035cdd61bfdaeae27ba3ced0a25f544', type: "hidden", name: this.name, value: this.value?.toString() ?? '' })));
|
|
2246
2246
|
}
|
|
2247
2247
|
static get watchers() { return {
|
|
2248
2248
|
"value": ["handleValueChange"],
|
|
@@ -2586,7 +2586,7 @@ const LeSlot = class {
|
|
|
2586
2586
|
render() {
|
|
2587
2587
|
const displayLabel = this.label || this.name;
|
|
2588
2588
|
// Always render the same structure, CSS handles visibility via .admin-mode class
|
|
2589
|
-
return (index.h(index.Host, { key: '
|
|
2589
|
+
return (index.h(index.Host, { key: '02bfcbc32ff96bcbdcb531430283b67a257a8333', class: {
|
|
2590
2590
|
'admin-mode': this.adminMode,
|
|
2591
2591
|
'invalid-html': !this.isValidHtml,
|
|
2592
2592
|
}, role: this.adminMode ? 'region' : undefined, "aria-label": this.adminMode ? `Slot: ${displayLabel}` : undefined, "data-slot-name": this.name, "data-slot-type": this.type, "data-allowed": this.allowedComponents, "data-multiple": this.multiple, "data-required": this.required }, this.adminMode ? (index.h("div", { class: "le-slot-container" }, index.h("div", { class: utils.classnames('le-slot-header', {
|
|
@@ -2724,11 +2724,11 @@ const LeStringInput = class {
|
|
|
2724
2724
|
ev.stopPropagation();
|
|
2725
2725
|
};
|
|
2726
2726
|
render() {
|
|
2727
|
-
return (index.h("le-component", { key: '
|
|
2727
|
+
return (index.h("le-component", { key: 'd77913214c129e32a8707b984d2a32cc9daa27b0', component: "le-string-input", hostClass: utils.classnames({ disabled: this.disabled }) }, index.h("div", { key: '0059b3a7b915096469c0c9ad4f24f431cff96d30', class: "le-input-wrapper" }, this.label && (index.h("label", { key: '20cac379c5a5a3ff6554997fb8a1504b5fdbac02', class: "le-input-label", htmlFor: this.name }, this.label)), index.h("div", { key: '7a5460949f07c16e333fe4fd641e5d003aeddeaf', class: "le-input-container", part: "container" }, this.iconStart && index.h("span", { key: 'bd1996639dfafab0f77149f5a66debcbf9d229f7', class: "icon-start" }, this.iconStart), index.h("input", { key: 'e768f8af9b47ce493dd8d0aee01655ee48521f15', ref: el => {
|
|
2728
2728
|
if (this.inputRef) {
|
|
2729
2729
|
this.inputRef(el);
|
|
2730
2730
|
}
|
|
2731
|
-
}, id: this.name, type: this.type, name: this.name, value: this.value, placeholder: this.placeholder, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInput, onChange: this.handleChange, onClick: this.handleClick }), this.iconEnd && index.h("span", { key: '
|
|
2731
|
+
}, id: this.name, type: this.type, name: this.name, value: this.value, placeholder: this.placeholder, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInput, onChange: this.handleChange, onClick: this.handleClick }), this.iconEnd && index.h("span", { key: 'afe7c876edccbf0fa15f838ef3ccf8a0cbb51fca', class: "icon-end" }, this.iconEnd)), !this.hideDescription && (index.h("div", { key: '9a4d068a1b3fffd9b5beae410382631ec0c4f737', class: "le-input-description" }, index.h("le-slot", { key: 'bc738beb28f7d7c6890f09a4a5b2a59cd328a625', name: "description", type: "text", tag: "p", label: "Description" }, index.h("slot", { key: '716953e93011f8b2d323f19b0c21a30997ea566e', name: "description" })))))));
|
|
2732
2732
|
}
|
|
2733
2733
|
};
|
|
2734
2734
|
LeStringInput.style = leStringInputCss();
|
|
@@ -20,7 +20,7 @@ const LeCard = class {
|
|
|
20
20
|
*/
|
|
21
21
|
interactive = false;
|
|
22
22
|
render() {
|
|
23
|
-
return (index.h("le-component", { key: '
|
|
23
|
+
return (index.h("le-component", { key: '3b9b4c5f234bb3ac5d479a777c8069428baa4d8c', component: "le-card", hostClass: utils.classnames(`variant-${this.variant}`, { 'interactive': this.interactive }) }, index.h("div", { key: '7cad2dc42768d03b8d9af5dc52a8acc0d79027c0', class: "card", part: "card" }, index.h("div", { key: 'd00e14de2a216afd1362605849c387e8fa7cc522', class: "card-header", part: "header" }, index.h("le-slot", { key: 'a09922eae71962506351a6b3ddc4b2253573fa6d', name: "header", label: "Header", description: "Card title", type: "text", tag: "h3" }, index.h("slot", { key: '624efcc1f6e06e2876fb00d0b4efa10fdfd9083b', name: "header" }))), index.h("div", { key: '9aba5630de5d4fe24dbc59b5607fbb530ebd41e8', class: "card-content", part: "content" }, index.h("le-slot", { key: 'a6de438f65b747e6ecf8b7c573168c99cde3eb62', name: "", label: "Content", description: "Card content", type: "textarea", tag: "p", required: true }, index.h("slot", { key: 'bca044329a0b88ad3f041aab94b702434124179c' }))), index.h("div", { key: '1c08846aa15cd44f71f6d79968412634009eea03', class: "card-footer", part: "footer" }, index.h("le-slot", { key: '4b65f8c6dd68e5995b42ed4ef18fa504d3b4f182', name: "footer", label: "Footer", description: "Card footer with actions", "allowed-components": "le-button,le-link" }, index.h("slot", { key: 'db199113de94b26bf19d0665938f5048a3587134', name: "footer" }))))));
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
LeCard.style = leCardDefaultCss();
|