@limetech/lime-elements 36.4.0-next.3 → 36.4.0-next.4

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.
Files changed (43) hide show
  1. package/dist/cjs/lime-elements.cjs.js +1 -1
  2. package/dist/cjs/limel-action-bar-item_2.cjs.entry.js +97 -0
  3. package/dist/cjs/limel-action-bar.cjs.entry.js +106 -0
  4. package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +5 -1
  5. package/dist/cjs/{limel-menu-list.cjs.entry.js → limel-menu_2.cjs.entry.js} +121 -0
  6. package/dist/cjs/{limel-popover_4.cjs.entry.js → limel-popover_2.cjs.entry.js} +0 -97
  7. package/dist/cjs/limel-tooltip_2.cjs.entry.js +104 -0
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/collection/collection-manifest.json +3 -0
  10. package/dist/collection/components/action-bar/action-bar-item/action-bar-item.css +129 -0
  11. package/dist/collection/components/action-bar/action-bar-item/action-bar-item.js +144 -0
  12. package/dist/collection/components/action-bar/action-bar-item/action-bar-overflow-menu.js +106 -0
  13. package/dist/collection/components/action-bar/action-bar.css +50 -0
  14. package/dist/collection/components/action-bar/action-bar.js +244 -0
  15. package/dist/collection/components/action-bar/action-bar.types.js +1 -0
  16. package/dist/collection/components/action-bar/isItem.js +3 -0
  17. package/dist/esm/lime-elements.js +1 -1
  18. package/dist/esm/limel-action-bar-item_2.entry.js +92 -0
  19. package/dist/esm/limel-action-bar.entry.js +102 -0
  20. package/dist/esm/limel-flatpickr-adapter.entry.js +5 -1
  21. package/dist/esm/{limel-menu-list.entry.js → limel-menu_2.entry.js} +122 -2
  22. package/dist/esm/{limel-popover_4.entry.js → limel-popover_2.entry.js} +1 -96
  23. package/dist/esm/limel-tooltip_2.entry.js +99 -0
  24. package/dist/esm/loader.js +1 -1
  25. package/dist/lime-elements/lime-elements.esm.js +1 -1
  26. package/dist/lime-elements/p-3cdc210b.entry.js +1 -0
  27. package/dist/lime-elements/p-7112ebf8.entry.js +1 -0
  28. package/dist/lime-elements/{p-3c10149f.entry.js → p-a030e9ab.entry.js} +6 -5
  29. package/dist/lime-elements/p-b526ebd4.entry.js +1 -0
  30. package/dist/lime-elements/p-c823809f.entry.js +1 -0
  31. package/dist/lime-elements/{p-4e5865a7.entry.js → p-da4d1bc1.entry.js} +1 -1
  32. package/dist/types/components/action-bar/action-bar-item/action-bar-item.d.ts +33 -0
  33. package/dist/types/components/action-bar/action-bar-item/action-bar-overflow-menu.d.ts +25 -0
  34. package/dist/types/components/action-bar/action-bar.d.ts +79 -0
  35. package/dist/types/components/action-bar/action-bar.types.d.ts +8 -0
  36. package/dist/types/components/action-bar/isItem.d.ts +3 -0
  37. package/dist/types/components.d.ts +143 -16
  38. package/dist/types/interface.d.ts +1 -0
  39. package/package.json +10 -11
  40. package/dist/cjs/limel-menu.cjs.entry.js +0 -127
  41. package/dist/esm/limel-menu.entry.js +0 -123
  42. package/dist/lime-elements/p-50dbd665.entry.js +0 -1
  43. package/dist/lime-elements/p-d16b27b9.entry.js +0 -1
@@ -0,0 +1,244 @@
1
+ import { h, Host, } from '@stencil/core';
2
+ import { isItem } from './isItem';
3
+ /**
4
+ * An action bar is a user interface element commonly found in software applications and websites.
5
+ * It typically appears at the top of the screen or within a specific section
6
+ * and serves as a centralized hub for accessing various actions and commands
7
+ * relevant to the current context or page.
8
+ *
9
+ * The action bar often contains a set of clickable icons or buttons (icons + labels)
10
+ * that represent specific actions, such as saving, deleting, editing, sharing,
11
+ * or bulk operations for selected items.
12
+ *
13
+ * The purpose of an action bar is to provide quick and convenient access to
14
+ * frequently used functionalities, enabling users to perform common tasks efficiently.
15
+ * It enhances usability by organizing important actions in a visually prominent and easily accessible location.
16
+ *
17
+ * The action bar's design and layout can vary based on the platform or application,
18
+ * but its primary goal remains consistent—to
19
+ * empower users to interact with the software and perform desired actions effortlessly.
20
+ * @exampleComponent limel-example-action-bar
21
+ * @exampleComponent limel-example-action-bar-overflow-menu
22
+ * @exampleComponent limel-example-action-bar-colors
23
+ * @exampleComponent limel-example-action-bar-floating
24
+ * @exampleComponent limel-example-action-bar-styling
25
+ * @exampleComponent limel-example-action-bar-as-primary-component
26
+ * @private
27
+ */
28
+ export class ActionBar {
29
+ constructor() {
30
+ this.firstRender = true;
31
+ this.actionBarItems = [];
32
+ this.renderActionBarItem = (item, index) => {
33
+ return (h("limel-action-bar-item", { item: item, onSelect: this.handleSelect, isVisible: this.isVisible(index) }));
34
+ };
35
+ this.renderOverflowMenu = (items) => {
36
+ if (!(this.actions.length - this.overflowCutoff)) {
37
+ return;
38
+ }
39
+ return (h("limel-action-bar-overflow-menu", { openDirection: this.openDirection, items: items, onSelect: this.handleSelect }));
40
+ };
41
+ this.handleSelect = (event) => {
42
+ event.stopPropagation();
43
+ if (isItem(event.detail)) {
44
+ this.itemSelected.emit(event.detail);
45
+ }
46
+ };
47
+ this.handleIntersection = (entries) => {
48
+ const intersectingItems = entries.filter((entry) => entry.isIntersecting);
49
+ const notIntersectingItems = entries.filter((entry) => !entry.isIntersecting);
50
+ if (this.firstRender) {
51
+ this.overflowCutoff = intersectingItems.length;
52
+ }
53
+ else {
54
+ this.overflowCutoff =
55
+ this.overflowCutoff +
56
+ intersectingItems.length -
57
+ notIntersectingItems.length;
58
+ }
59
+ this.firstRender = false;
60
+ };
61
+ this.actions = [];
62
+ this.accessibleLabel = undefined;
63
+ this.layout = undefined;
64
+ this.openDirection = undefined;
65
+ this.overflowCutoff = this.actions.length;
66
+ }
67
+ render() {
68
+ let overflowActions = [];
69
+ if (this.actions.length) {
70
+ overflowActions = this.actions.slice(this.overflowCutoff);
71
+ }
72
+ return (h(Host, { "aria-label": this.accessibleLabel, class: {
73
+ 'is-full-width': this.layout === 'fullWidth',
74
+ 'is-floating': this.layout === 'floating',
75
+ } }, h("div", { class: "items" }, this.actions.map(this.renderActionBarItem)), this.renderOverflowMenu(overflowActions)));
76
+ }
77
+ componentDidRender() {
78
+ var _a;
79
+ if (this.haveItemsChanged()) {
80
+ (_a = this.intersectionObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
81
+ this.createIntersectionObserver();
82
+ }
83
+ }
84
+ disconnectedCallback() {
85
+ var _a;
86
+ (_a = this.intersectionObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
87
+ this.actionBarItems = [];
88
+ }
89
+ isVisible(index) {
90
+ return index < this.overflowCutoff;
91
+ }
92
+ createIntersectionObserver() {
93
+ const options = {
94
+ root: this.host.shadowRoot.querySelector('.items'),
95
+ rootMargin: '0px',
96
+ threshold: 1.0,
97
+ };
98
+ this.actionBarItems = [];
99
+ this.intersectionObserver = new IntersectionObserver(this.handleIntersection, options);
100
+ this.host.shadowRoot
101
+ .querySelectorAll('limel-action-bar-item')
102
+ .forEach((actionBarItem) => {
103
+ this.observe(actionBarItem);
104
+ });
105
+ }
106
+ observe(actionBarItem) {
107
+ this.intersectionObserver.observe(actionBarItem);
108
+ this.actionBarItems.push(actionBarItem);
109
+ }
110
+ haveItemsChanged() {
111
+ const someItemRemoved = this.actionBarItems.some((actionBarItem) => !this.host.shadowRoot.contains(actionBarItem));
112
+ const someItemAdded = Array.from(this.host.shadowRoot.querySelectorAll('limel-action-bar-item')).some((actionBarItem) => !this.actionBarItems.includes(actionBarItem));
113
+ return someItemRemoved || someItemAdded;
114
+ }
115
+ static get is() { return "limel-action-bar"; }
116
+ static get encapsulation() { return "shadow"; }
117
+ static get originalStyleUrls() {
118
+ return {
119
+ "$": ["action-bar.scss"]
120
+ };
121
+ }
122
+ static get styleUrls() {
123
+ return {
124
+ "$": ["action-bar.css"]
125
+ };
126
+ }
127
+ static get properties() {
128
+ return {
129
+ "actions": {
130
+ "type": "unknown",
131
+ "mutable": false,
132
+ "complexType": {
133
+ "original": "Array<ActionBarItem | ListSeparator>",
134
+ "resolved": "(ListSeparator | ActionBarItem)[]",
135
+ "references": {
136
+ "Array": {
137
+ "location": "global"
138
+ },
139
+ "ActionBarItem": {
140
+ "location": "import",
141
+ "path": "./action-bar.types"
142
+ },
143
+ "ListSeparator": {
144
+ "location": "import",
145
+ "path": "../list/list-item.types"
146
+ }
147
+ }
148
+ },
149
+ "required": false,
150
+ "optional": false,
151
+ "docs": {
152
+ "tags": [],
153
+ "text": "Items that are placed in the action bar.\nThese represent primary actions."
154
+ },
155
+ "defaultValue": "[]"
156
+ },
157
+ "accessibleLabel": {
158
+ "type": "string",
159
+ "mutable": false,
160
+ "complexType": {
161
+ "original": "string",
162
+ "resolved": "string",
163
+ "references": {}
164
+ },
165
+ "required": false,
166
+ "optional": true,
167
+ "docs": {
168
+ "tags": [],
169
+ "text": "A label used to describe the purpose of the element to users\nof assistive technologies, like screen readers.\nExample value: \"toolbar\""
170
+ },
171
+ "attribute": "accessible-label",
172
+ "reflect": true
173
+ },
174
+ "layout": {
175
+ "type": "string",
176
+ "mutable": false,
177
+ "complexType": {
178
+ "original": "'fullWidth' | 'floating'",
179
+ "resolved": "\"floating\" | \"fullWidth\"",
180
+ "references": {}
181
+ },
182
+ "required": false,
183
+ "optional": true,
184
+ "docs": {
185
+ "tags": [],
186
+ "text": "- When set to `fullWidth`, the component will take the\nentire width of its container.\n- When set to `floating`, the component will get basic stylings\nto visualize the floating state.\n:::note\nYou should still properly position the component\naccording to the structure of your user interface.\nFor example, use an `absolute` or `fixed` position.\n:::"
187
+ },
188
+ "attribute": "layout",
189
+ "reflect": true
190
+ },
191
+ "openDirection": {
192
+ "type": "string",
193
+ "mutable": false,
194
+ "complexType": {
195
+ "original": "OpenDirection",
196
+ "resolved": "\"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\"",
197
+ "references": {
198
+ "OpenDirection": {
199
+ "location": "import",
200
+ "path": "../menu/menu.types"
201
+ }
202
+ }
203
+ },
204
+ "required": false,
205
+ "optional": false,
206
+ "docs": {
207
+ "tags": [],
208
+ "text": "Defines the location that the content of the overflow menu\nappears, in relation to its trigger."
209
+ },
210
+ "attribute": "open-direction",
211
+ "reflect": true
212
+ }
213
+ };
214
+ }
215
+ static get states() {
216
+ return {
217
+ "overflowCutoff": {}
218
+ };
219
+ }
220
+ static get events() {
221
+ return [{
222
+ "method": "itemSelected",
223
+ "name": "itemSelected",
224
+ "bubbles": true,
225
+ "cancelable": true,
226
+ "composed": true,
227
+ "docs": {
228
+ "tags": [],
229
+ "text": "Fired when a action bar item has been clicked."
230
+ },
231
+ "complexType": {
232
+ "original": "ActionBarItem",
233
+ "resolved": "ActionBarItem",
234
+ "references": {
235
+ "ActionBarItem": {
236
+ "location": "import",
237
+ "path": "./action-bar.types"
238
+ }
239
+ }
240
+ }
241
+ }];
242
+ }
243
+ static get elementRef() { return "host"; }
244
+ }
@@ -0,0 +1,3 @@
1
+ export function isItem(item) {
2
+ return !('separator' in item);
3
+ }
@@ -13,5 +13,5 @@ const patchBrowser = () => {
13
13
  };
14
14
 
15
15
  patchBrowser().then(options => {
16
- return bootstrapLazy([["limel-color-picker",[[1,"limel-color-picker",{"value":[513],"label":[513],"helperText":[513,"helper-text"],"tooltipLabel":[513,"tooltip-label"],"required":[516],"readonly":[516],"isOpen":[32]}]]],["limel-dock",[[1,"limel-dock",{"dockItems":[16],"dockFooterItems":[16],"accessibleLabel":[513,"accessible-label"],"expanded":[516],"allowResize":[516,"allow-resize"],"mobileBreakPoint":[514,"mobile-break-point"],"useMobileLayout":[32]}]]],["limel-picker",[[1,"limel-picker",{"disabled":[4],"readonly":[516],"label":[1],"searchLabel":[1,"search-label"],"helperText":[513,"helper-text"],"leadingIcon":[1,"leading-icon"],"emptyResultMessage":[1,"empty-result-message"],"required":[4],"value":[16],"searcher":[16],"multiple":[4],"delimiter":[513],"actions":[16],"actionPosition":[1,"action-position"],"actionScrollBehavior":[1,"action-scroll-behavior"],"badgeIcons":[516,"badge-icons"],"items":[32],"textValue":[32],"loading":[32],"chips":[32]}]]],["limel-split-button",[[1,"limel-split-button",{"label":[513],"primary":[516],"icon":[513],"disabled":[516],"items":[16]}]]],["limel-date-picker",[[1,"limel-date-picker",{"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"required":[516],"value":[16],"type":[513],"format":[513],"language":[513],"formatter":[16],"formattedValue":[32],"internalFormat":[32],"showPortal":[32]}]]],["limel-button-group",[[1,"limel-button-group",{"value":[16],"disabled":[516],"selectedButtonId":[32]}]]],["limel-select",[[1,"limel-select",{"disabled":[516],"readonly":[516],"invalid":[516],"required":[516],"label":[513],"helperText":[513,"helper-text"],"value":[16],"options":[16],"multiple":[4],"menuOpen":[32]}]]],["limel-file",[[1,"limel-file",{"value":[16],"label":[513],"required":[516],"disabled":[516],"readonly":[516],"accept":[513],"language":[1],"isDraggingOverDropZone":[32]}]]],["limel-info-tile",[[1,"limel-info-tile",{"value":[520],"icon":[1],"label":[513],"prefix":[513],"suffix":[513],"disabled":[516],"badge":[520],"loading":[516],"link":[16],"progress":[16]}]]],["limel-snackbar",[[1,"limel-snackbar",{"message":[1],"timeout":[2],"actionText":[1,"action-text"],"dismissible":[4],"multiline":[4],"language":[1],"show":[64]}]]],["limel-tab-panel",[[1,"limel-tab-panel",{"tabs":[1040]}]]],["limel-table",[[1,"limel-table",{"data":[16],"columns":[16],"mode":[1],"layout":[1],"pageSize":[2,"page-size"],"totalRows":[2,"total-rows"],"sorting":[16],"activeRow":[1040],"movableColumns":[4,"movable-columns"],"loading":[4],"page":[2],"emptyMessage":[1,"empty-message"],"aggregates":[16],"selectable":[4],"selection":[16]}]]],["limel-collapsible-section",[[1,"limel-collapsible-section",{"isOpen":[1540,"is-open"],"header":[513],"actions":[16]}]]],["limel-dialog",[[1,"limel-dialog",{"heading":[1],"fullscreen":[516],"open":[1540],"closingActions":[16]}]]],["limel-progress-flow",[[1,"limel-progress-flow",{"flowItems":[16],"disabled":[4],"readonly":[4]}]]],["limel-shortcut",[[1,"limel-shortcut",{"icon":[513],"label":[513],"disabled":[516],"badge":[520],"link":[16]}]]],["limel-banner",[[1,"limel-banner",{"message":[513],"icon":[513],"isOpen":[32],"open":[64],"close":[64]}]]],["limel-callout",[[1,"limel-callout",{"heading":[513],"icon":[513],"type":[513],"language":[1]}]]],["limel-slider",[[1,"limel-slider",{"disabled":[516],"readonly":[516],"factor":[514],"label":[513],"helperText":[513,"helper-text"],"unit":[513],"value":[514],"valuemax":[514],"valuemin":[514],"step":[514],"percentageClass":[32]}]]],["limel-code-editor",[[1,"limel-code-editor",{"value":[1],"language":[1],"readonly":[4],"lineNumbers":[4,"line-numbers"],"fold":[4],"lint":[4],"colorScheme":[1,"color-scheme"],"random":[32]}]]],["limel-config",[[1,"limel-config",{"config":[16]}]]],["limel-flex-container",[[1,"limel-flex-container",{"direction":[513],"justify":[513],"align":[513],"reverse":[516]}]]],["limel-form",[[1,"limel-form",{"schema":[16],"value":[16],"disabled":[4],"propsFactory":[16],"transformErrors":[16],"errors":[16]}]]],["limel-grid",[[1,"limel-grid"]]],["limel-switch",[[1,"limel-switch",{"label":[513],"disabled":[516],"readonly":[516],"value":[516],"fieldId":[32]}]]],["limel-dock-button",[[0,"limel-dock-button",{"item":[16],"expanded":[516],"useMobileLayout":[516,"use-mobile-layout"],"isOpen":[32]}]]],["limel-color-picker-palette",[[1,"limel-color-picker-palette",{"value":[513],"label":[513],"helperText":[513,"helper-text"],"required":[516]}]]],["limel-menu-list",[[1,"limel-menu-list",{"items":[16],"badgeIcons":[4,"badge-icons"],"iconSize":[1,"icon-size"],"type":[1],"maxLinesSecondaryText":[2,"max-lines-secondary-text"]}]]],["limel-menu",[[1,"limel-menu",{"items":[16],"disabled":[516],"openDirection":[513,"open-direction"],"open":[1540],"badgeIcons":[516,"badge-icons"],"gridLayout":[516,"grid-layout"]}]]],["limel-icon-button",[[1,"limel-icon-button",{"icon":[513],"elevated":[516],"label":[513],"disabled":[516]}]]],["limel-tab-bar",[[1,"limel-tab-bar",{"tabs":[1040],"canScrollLeft":[32],"canScrollRight":[32]},[[9,"resize","handleWindowResize"]]]]],["limel-checkbox",[[1,"limel-checkbox",{"disabled":[516],"readonly":[516],"label":[513],"helperText":[513,"helper-text"],"checked":[516],"indeterminate":[516],"required":[516],"modified":[32]}]]],["limel-header",[[1,"limel-header",{"icon":[1],"heading":[1],"subheading":[1],"supportingText":[1,"supporting-text"]}]]],["limel-progress-flow-item",[[0,"limel-progress-flow-item",{"item":[16],"disabled":[4],"readonly":[4]}]]],["limel-flatpickr-adapter",[[1,"limel-flatpickr-adapter",{"value":[16],"type":[1],"format":[1],"isOpen":[4,"is-open"],"inputElement":[16],"language":[1],"formatter":[16]}]]],["limel-helper-line",[[1,"limel-helper-line",{"helperText":[513,"helper-text"],"length":[514],"maxLength":[514,"max-length"],"invalid":[516],"helperTextId":[513,"helper-text-id"]}]]],["limel-icon",[[1,"limel-icon",{"size":[513],"name":[513],"badge":[516]}]]],["limel-chip-set",[[1,"limel-chip-set",{"value":[16],"type":[513],"label":[513],"helperText":[513,"helper-text"],"disabled":[516],"readonly":[516],"inputType":[513,"input-type"],"maxItems":[514,"max-items"],"required":[516],"searchLabel":[513,"search-label"],"emptyInputOnBlur":[516,"empty-input-on-blur"],"clearAllButton":[4,"clear-all-button"],"leadingIcon":[513,"leading-icon"],"delimiter":[513],"language":[1],"editMode":[32],"textValue":[32],"blurred":[32],"inputChipIndexSelected":[32],"getEditMode":[64],"setFocus":[64],"emptyInput":[64]}]]],["limel-button",[[1,"limel-button",{"label":[513],"primary":[516],"outlined":[516],"icon":[513],"disabled":[516],"loading":[516],"loadingFailed":[516,"loading-failed"],"justLoaded":[32]}]]],["limel-circular-progress_2",[[1,"limel-circular-progress",{"value":[2],"maxValue":[2,"max-value"],"prefix":[513],"suffix":[1],"displayPercentageColors":[4,"display-percentage-colors"],"size":[513]}],[1,"limel-linear-progress",{"value":[2],"indeterminate":[4]}]]],["limel-portal",[[1,"limel-portal",{"openDirection":[1,"open-direction"],"position":[1],"containerId":[1,"container-id"],"containerStyle":[16],"parent":[16],"inheritParentWidth":[4,"inherit-parent-width"],"visible":[4]}]]],["limel-input-field",[[1,"limel-input-field",{"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"prefix":[513],"suffix":[513],"required":[516],"value":[513],"trailingIcon":[513,"trailing-icon"],"leadingIcon":[513,"leading-icon"],"pattern":[513],"type":[513],"formatNumber":[516,"format-number"],"step":[520],"max":[514],"min":[514],"maxlength":[514],"minlength":[514],"completions":[16],"showLink":[516,"show-link"],"isFocused":[32],"isModified":[32],"showCompletions":[32]}]]],["limel-spinner",[[1,"limel-spinner",{"size":[513],"limeBranded":[4,"lime-branded"]}]]],["limel-badge",[[1,"limel-badge",{"label":[520]}]]],["limel-list_2",[[1,"limel-list",{"items":[16],"badgeIcons":[4,"badge-icons"],"iconSize":[1,"icon-size"],"type":[1],"maxLinesSecondaryText":[2,"max-lines-secondary-text"]}],[1,"limel-menu-surface",{"open":[4],"allowClicksElement":[16]}]]],["limel-popover_4",[[1,"limel-popover",{"open":[4],"openDirection":[513,"open-direction"]}],[1,"limel-tooltip",{"elementId":[513,"element-id"],"label":[513],"helperLabel":[513,"helper-label"],"maxlength":[514],"open":[32]}],[1,"limel-popover-surface",{"contentCollection":[16]}],[1,"limel-tooltip-content",{"label":[513],"helperLabel":[513,"helper-label"],"maxlength":[514]}]]]], options);
16
+ return bootstrapLazy([["limel-color-picker",[[1,"limel-color-picker",{"value":[513],"label":[513],"helperText":[513,"helper-text"],"tooltipLabel":[513,"tooltip-label"],"required":[516],"readonly":[516],"isOpen":[32]}]]],["limel-action-bar",[[1,"limel-action-bar",{"actions":[16],"accessibleLabel":[513,"accessible-label"],"layout":[513],"openDirection":[513,"open-direction"],"overflowCutoff":[32]}]]],["limel-dock",[[1,"limel-dock",{"dockItems":[16],"dockFooterItems":[16],"accessibleLabel":[513,"accessible-label"],"expanded":[516],"allowResize":[516,"allow-resize"],"mobileBreakPoint":[514,"mobile-break-point"],"useMobileLayout":[32]}]]],["limel-picker",[[1,"limel-picker",{"disabled":[4],"readonly":[516],"label":[1],"searchLabel":[1,"search-label"],"helperText":[513,"helper-text"],"leadingIcon":[1,"leading-icon"],"emptyResultMessage":[1,"empty-result-message"],"required":[4],"value":[16],"searcher":[16],"multiple":[4],"delimiter":[513],"actions":[16],"actionPosition":[1,"action-position"],"actionScrollBehavior":[1,"action-scroll-behavior"],"badgeIcons":[516,"badge-icons"],"items":[32],"textValue":[32],"loading":[32],"chips":[32]}]]],["limel-split-button",[[1,"limel-split-button",{"label":[513],"primary":[516],"icon":[513],"disabled":[516],"items":[16]}]]],["limel-date-picker",[[1,"limel-date-picker",{"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"required":[516],"value":[16],"type":[513],"format":[513],"language":[513],"formatter":[16],"formattedValue":[32],"internalFormat":[32],"showPortal":[32]}]]],["limel-button-group",[[1,"limel-button-group",{"value":[16],"disabled":[516],"selectedButtonId":[32]}]]],["limel-select",[[1,"limel-select",{"disabled":[516],"readonly":[516],"invalid":[516],"required":[516],"label":[513],"helperText":[513,"helper-text"],"value":[16],"options":[16],"multiple":[4],"menuOpen":[32]}]]],["limel-file",[[1,"limel-file",{"value":[16],"label":[513],"required":[516],"disabled":[516],"readonly":[516],"accept":[513],"language":[1],"isDraggingOverDropZone":[32]}]]],["limel-info-tile",[[1,"limel-info-tile",{"value":[520],"icon":[1],"label":[513],"prefix":[513],"suffix":[513],"disabled":[516],"badge":[520],"loading":[516],"link":[16],"progress":[16]}]]],["limel-snackbar",[[1,"limel-snackbar",{"message":[1],"timeout":[2],"actionText":[1,"action-text"],"dismissible":[4],"multiline":[4],"language":[1],"show":[64]}]]],["limel-tab-panel",[[1,"limel-tab-panel",{"tabs":[1040]}]]],["limel-table",[[1,"limel-table",{"data":[16],"columns":[16],"mode":[1],"layout":[1],"pageSize":[2,"page-size"],"totalRows":[2,"total-rows"],"sorting":[16],"activeRow":[1040],"movableColumns":[4,"movable-columns"],"loading":[4],"page":[2],"emptyMessage":[1,"empty-message"],"aggregates":[16],"selectable":[4],"selection":[16]}]]],["limel-collapsible-section",[[1,"limel-collapsible-section",{"isOpen":[1540,"is-open"],"header":[513],"actions":[16]}]]],["limel-dialog",[[1,"limel-dialog",{"heading":[1],"fullscreen":[516],"open":[1540],"closingActions":[16]}]]],["limel-progress-flow",[[1,"limel-progress-flow",{"flowItems":[16],"disabled":[4],"readonly":[4]}]]],["limel-shortcut",[[1,"limel-shortcut",{"icon":[513],"label":[513],"disabled":[516],"badge":[520],"link":[16]}]]],["limel-banner",[[1,"limel-banner",{"message":[513],"icon":[513],"isOpen":[32],"open":[64],"close":[64]}]]],["limel-callout",[[1,"limel-callout",{"heading":[513],"icon":[513],"type":[513],"language":[1]}]]],["limel-slider",[[1,"limel-slider",{"disabled":[516],"readonly":[516],"factor":[514],"label":[513],"helperText":[513,"helper-text"],"unit":[513],"value":[514],"valuemax":[514],"valuemin":[514],"step":[514],"percentageClass":[32]}]]],["limel-code-editor",[[1,"limel-code-editor",{"value":[1],"language":[1],"readonly":[4],"lineNumbers":[4,"line-numbers"],"fold":[4],"lint":[4],"colorScheme":[1,"color-scheme"],"random":[32]}]]],["limel-config",[[1,"limel-config",{"config":[16]}]]],["limel-flex-container",[[1,"limel-flex-container",{"direction":[513],"justify":[513],"align":[513],"reverse":[516]}]]],["limel-form",[[1,"limel-form",{"schema":[16],"value":[16],"disabled":[4],"propsFactory":[16],"transformErrors":[16],"errors":[16]}]]],["limel-grid",[[1,"limel-grid"]]],["limel-switch",[[1,"limel-switch",{"label":[513],"disabled":[516],"readonly":[516],"value":[516],"fieldId":[32]}]]],["limel-icon",[[1,"limel-icon",{"size":[513],"name":[513],"badge":[516]}]]],["limel-dock-button",[[0,"limel-dock-button",{"item":[16],"expanded":[516],"useMobileLayout":[516,"use-mobile-layout"],"isOpen":[32]}]]],["limel-color-picker-palette",[[1,"limel-color-picker-palette",{"value":[513],"label":[513],"helperText":[513,"helper-text"],"required":[516]}]]],["limel-badge",[[1,"limel-badge",{"label":[520]}]]],["limel-tab-bar",[[1,"limel-tab-bar",{"tabs":[1040],"canScrollLeft":[32],"canScrollRight":[32]},[[9,"resize","handleWindowResize"]]]]],["limel-checkbox",[[1,"limel-checkbox",{"disabled":[516],"readonly":[516],"label":[513],"helperText":[513,"helper-text"],"checked":[516],"indeterminate":[516],"required":[516],"modified":[32]}]]],["limel-header",[[1,"limel-header",{"icon":[1],"heading":[1],"subheading":[1],"supportingText":[1,"supporting-text"]}]]],["limel-progress-flow-item",[[0,"limel-progress-flow-item",{"item":[16],"disabled":[4],"readonly":[4]}]]],["limel-flatpickr-adapter",[[1,"limel-flatpickr-adapter",{"value":[16],"type":[1],"format":[1],"isOpen":[4,"is-open"],"inputElement":[16],"language":[1],"formatter":[16]}]]],["limel-action-bar-item_2",[[0,"limel-action-bar-overflow-menu",{"items":[16],"openDirection":[513,"open-direction"]}],[0,"limel-action-bar-item",{"item":[16],"isVisible":[516,"is-visible"]}]]],["limel-chip-set",[[1,"limel-chip-set",{"value":[16],"type":[513],"label":[513],"helperText":[513,"helper-text"],"disabled":[516],"readonly":[516],"inputType":[513,"input-type"],"maxItems":[514,"max-items"],"required":[516],"searchLabel":[513,"search-label"],"emptyInputOnBlur":[516,"empty-input-on-blur"],"clearAllButton":[4,"clear-all-button"],"leadingIcon":[513,"leading-icon"],"delimiter":[513],"language":[1],"editMode":[32],"textValue":[32],"blurred":[32],"inputChipIndexSelected":[32],"getEditMode":[64],"setFocus":[64],"emptyInput":[64]}]]],["limel-button",[[1,"limel-button",{"label":[513],"primary":[516],"outlined":[516],"icon":[513],"disabled":[516],"loading":[516],"loadingFailed":[516,"loading-failed"],"justLoaded":[32]}]]],["limel-circular-progress_2",[[1,"limel-circular-progress",{"value":[2],"maxValue":[2,"max-value"],"prefix":[513],"suffix":[1],"displayPercentageColors":[4,"display-percentage-colors"],"size":[513]}],[1,"limel-linear-progress",{"value":[2],"indeterminate":[4]}]]],["limel-list_2",[[1,"limel-list",{"items":[16],"badgeIcons":[4,"badge-icons"],"iconSize":[1,"icon-size"],"type":[1],"maxLinesSecondaryText":[2,"max-lines-secondary-text"]}],[1,"limel-menu-surface",{"open":[4],"allowClicksElement":[16]}]]],["limel-input-field",[[1,"limel-input-field",{"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"prefix":[513],"suffix":[513],"required":[516],"value":[513],"trailingIcon":[513,"trailing-icon"],"leadingIcon":[513,"leading-icon"],"pattern":[513],"type":[513],"formatNumber":[516,"format-number"],"step":[520],"max":[514],"min":[514],"maxlength":[514],"minlength":[514],"completions":[16],"showLink":[516,"show-link"],"isFocused":[32],"isModified":[32],"showCompletions":[32]}]]],["limel-icon-button",[[1,"limel-icon-button",{"icon":[513],"elevated":[516],"label":[513],"disabled":[516]}]]],["limel-spinner",[[1,"limel-spinner",{"size":[513],"limeBranded":[4,"lime-branded"]}]]],["limel-menu_2",[[1,"limel-menu",{"items":[16],"disabled":[516],"openDirection":[513,"open-direction"],"open":[1540],"badgeIcons":[516,"badge-icons"],"gridLayout":[516,"grid-layout"]}],[1,"limel-menu-list",{"items":[16],"badgeIcons":[4,"badge-icons"],"iconSize":[1,"icon-size"],"type":[1],"maxLinesSecondaryText":[2,"max-lines-secondary-text"]}]]],["limel-popover_2",[[1,"limel-popover",{"open":[4],"openDirection":[513,"open-direction"]}],[1,"limel-popover-surface",{"contentCollection":[16]}]]],["limel-helper-line",[[1,"limel-helper-line",{"helperText":[513,"helper-text"],"length":[514],"maxLength":[514,"max-length"],"invalid":[516],"helperTextId":[513,"helper-text-id"]}]]],["limel-portal",[[1,"limel-portal",{"openDirection":[1,"open-direction"],"position":[1],"containerId":[1,"container-id"],"containerStyle":[16],"parent":[16],"inheritParentWidth":[4,"inherit-parent-width"],"visible":[4]}]]],["limel-tooltip_2",[[1,"limel-tooltip",{"elementId":[513,"element-id"],"label":[513],"helperLabel":[513,"helper-label"],"maxlength":[514],"open":[32]}],[1,"limel-tooltip-content",{"label":[513],"helperLabel":[513,"helper-label"],"maxlength":[514]}]]]], options);
17
17
  });
@@ -0,0 +1,92 @@
1
+ import { r as registerInstance, c as createEvent, h } from './index-cdfd351d.js';
2
+ import { c as createRandomString } from './random-string-2246b81e.js';
3
+
4
+ const actionBarItemCss = "limel-action-bar-item{transition:opacity 0.2s ease-in-out;position:relative;display:flex;align-items:center}limel-action-bar-item:not([is-visible]){opacity:0}button{all:unset;box-sizing:border-box;display:flex;align-items:center;justify-content:center;gap:0.25rem;width:100%;min-width:var(--action-bar-item-height);max-width:var(--action-bar-item-max-width, 10rem);height:var(--action-bar-item-height);border-radius:var(--action-bar-item-height);font-size:0.875rem;padding:0 0.25rem}button:not([disabled]){transition:color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;cursor:pointer;color:var(--limel-action-bar-item-text-color);background-color:var(--action-bar-background-color)}button:not([disabled]):hover{color:var(--limel-action-bar-item-text-color);background-color:var(--action-bar-background-color);box-shadow:var(--button-shadow-hovered)}button:not([disabled]):active{background-color:var(--action-bar-background-color);box-shadow:var(--button-shadow-inset-pressed);transform:translate3d(0, 0.05rem, 0)}button:not([disabled]):focus{outline:none}button:not([disabled]):focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}button:has(.text){padding:0 0.5rem}button[disabled]{opacity:0.4}.text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:0 0.25rem}limel-icon{flex-shrink:0;width:calc(var(--action-bar-item-height) - 0.75rem);height:calc(var(--action-bar-item-height) - 0.75rem);color:var(--action-bar-item-icon-color, var(--limel-action-bar-item-text-color))}limel-tooltip{position:absolute;bottom:0;left:0;right:0}div[role=separator]{width:1px;height:1.5rem;border-radius:var(--action-bar-item-height);background-color:var(--limel-action-bar-item-text-color);opacity:0.2}@media (pointer: fine){div[role=separator]{margin-right:0.5rem;margin-left:0.5rem}}limel-menu{--notification-badge-background-color:rgb(var(--contrast-600));--notification-badge-text-color:rgb(var(--contrast-1200))}limel-menu[open] button{box-shadow:var(--button-shadow-inset)}button[slot=trigger]{animation:fade-in ease-out 0.25s;font-size:0.75rem;font-weight:bold;transform:translate3d(0, 0, 0)}@keyframes fade-in{0%{scale:0.8;opacity:0}100%{scale:1;opacity:1}}";
5
+
6
+ const ActionBarButton = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.select = createEvent(this, "select", 7);
10
+ this.handleClick = (event) => {
11
+ event.stopPropagation();
12
+ this.select.emit(this.item);
13
+ };
14
+ this.item = undefined;
15
+ this.isVisible = true;
16
+ this.tooltipId = createRandomString();
17
+ }
18
+ render() {
19
+ if (!this.isItem(this.item) && this.item.separator) {
20
+ return h("div", { role: "separator" });
21
+ }
22
+ return (h("button", { id: this.tooltipId, type: "button", onClick: this.handleClick, disabled: this.isDisabled() }, this.renderIcon(), this.renderLabel(), this.renderTooltip()));
23
+ }
24
+ isItem(item) {
25
+ return !('separator' in item);
26
+ }
27
+ isDisabled() {
28
+ if (this.isItem(this.item) && this.item.disabled) {
29
+ return true;
30
+ }
31
+ if (!this.isVisible) {
32
+ return true;
33
+ }
34
+ }
35
+ renderIcon() {
36
+ if (this.isItem(this.item) && !this.item.icon) {
37
+ return;
38
+ }
39
+ if ('icon' in this.item) {
40
+ return (h("limel-icon", { name: this.item.icon, style: {
41
+ '--action-bar-item-icon-color': `${this.item.iconColor}`,
42
+ } }));
43
+ }
44
+ }
45
+ renderLabel() {
46
+ if (!this.isItem(this.item) || this.item.iconOnly) {
47
+ return;
48
+ }
49
+ return h("span", { class: "text" }, this.item.text);
50
+ }
51
+ renderTooltip() {
52
+ if (!this.isItem(this.item)) {
53
+ return;
54
+ }
55
+ if (this.item.text) {
56
+ return (h("limel-tooltip", { elementId: this.tooltipId, label: this.item.text, helperLabel: this.item.commandText }));
57
+ }
58
+ if (this.item.commandText) {
59
+ return (h("limel-tooltip", { elementId: this.tooltipId, label: this.item.commandText }));
60
+ }
61
+ }
62
+ };
63
+ ActionBarButton.style = actionBarItemCss;
64
+
65
+ const ActionBarOverflowMenu = class {
66
+ constructor(hostRef) {
67
+ registerInstance(this, hostRef);
68
+ this.select = createEvent(this, "select", 7);
69
+ this.countOverflowedItems = () => {
70
+ return `+${this.numberOfMenuItems}`;
71
+ };
72
+ this.handleSelect = (event) => {
73
+ event.stopPropagation();
74
+ this.select.emit(event.detail);
75
+ };
76
+ this.items = undefined;
77
+ this.openDirection = 'bottom-end';
78
+ }
79
+ render() {
80
+ return [
81
+ h("limel-menu", { openDirection: this.openDirection, items: this.items, onSelect: this.handleSelect }, h("button", { slot: "trigger" }, this.countOverflowedItems())),
82
+ ];
83
+ }
84
+ get numberOfMenuItems() {
85
+ return this.items.filter((item) => this.isMenuItem(item)).length;
86
+ }
87
+ isMenuItem(item) {
88
+ return !('separator' in item);
89
+ }
90
+ };
91
+
92
+ export { ActionBarButton as limel_action_bar_item, ActionBarOverflowMenu as limel_action_bar_overflow_menu };
@@ -0,0 +1,102 @@
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-cdfd351d.js';
2
+
3
+ function isItem(item) {
4
+ return !('separator' in item);
5
+ }
6
+
7
+ const actionBarCss = ":host(limel-action-bar){--action-bar-item-height:2rem;--limel-action-bar-item-text-color:var(\n --action-bar-item-text-color,\n rgb(var(--contrast-1100))\n );box-sizing:border-box;display:inline-flex;align-items:center;padding:0.125rem 0.25rem;max-width:100%;border-radius:var(--action-bar-border-radius);background-color:var(--action-bar-background-color, rgb(var(--contrast-100)))}:host(limel-action-bar),.items{gap:0.25rem}@media (pointer: coarse){:host(limel-action-bar),.items{gap:0.5rem}}.items{display:inline-flex;max-width:100%;min-width:0}:host(limel-action-bar.is-full-width){width:100%}:host(limel-action-bar.is-floating){--action-bar-border-radius:100vw;padding-right:0.125rem;padding-left:0.125rem;max-width:calc(100% - 2rem);box-shadow:var(--shadow-depth-16)}";
8
+
9
+ const ActionBar = class {
10
+ constructor(hostRef) {
11
+ registerInstance(this, hostRef);
12
+ this.itemSelected = createEvent(this, "itemSelected", 7);
13
+ this.firstRender = true;
14
+ this.actionBarItems = [];
15
+ this.renderActionBarItem = (item, index) => {
16
+ return (h("limel-action-bar-item", { item: item, onSelect: this.handleSelect, isVisible: this.isVisible(index) }));
17
+ };
18
+ this.renderOverflowMenu = (items) => {
19
+ if (!(this.actions.length - this.overflowCutoff)) {
20
+ return;
21
+ }
22
+ return (h("limel-action-bar-overflow-menu", { openDirection: this.openDirection, items: items, onSelect: this.handleSelect }));
23
+ };
24
+ this.handleSelect = (event) => {
25
+ event.stopPropagation();
26
+ if (isItem(event.detail)) {
27
+ this.itemSelected.emit(event.detail);
28
+ }
29
+ };
30
+ this.handleIntersection = (entries) => {
31
+ const intersectingItems = entries.filter((entry) => entry.isIntersecting);
32
+ const notIntersectingItems = entries.filter((entry) => !entry.isIntersecting);
33
+ if (this.firstRender) {
34
+ this.overflowCutoff = intersectingItems.length;
35
+ }
36
+ else {
37
+ this.overflowCutoff =
38
+ this.overflowCutoff +
39
+ intersectingItems.length -
40
+ notIntersectingItems.length;
41
+ }
42
+ this.firstRender = false;
43
+ };
44
+ this.actions = [];
45
+ this.accessibleLabel = undefined;
46
+ this.layout = undefined;
47
+ this.openDirection = undefined;
48
+ this.overflowCutoff = this.actions.length;
49
+ }
50
+ render() {
51
+ let overflowActions = [];
52
+ if (this.actions.length) {
53
+ overflowActions = this.actions.slice(this.overflowCutoff);
54
+ }
55
+ return (h(Host, { "aria-label": this.accessibleLabel, class: {
56
+ 'is-full-width': this.layout === 'fullWidth',
57
+ 'is-floating': this.layout === 'floating',
58
+ } }, h("div", { class: "items" }, this.actions.map(this.renderActionBarItem)), this.renderOverflowMenu(overflowActions)));
59
+ }
60
+ componentDidRender() {
61
+ var _a;
62
+ if (this.haveItemsChanged()) {
63
+ (_a = this.intersectionObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
64
+ this.createIntersectionObserver();
65
+ }
66
+ }
67
+ disconnectedCallback() {
68
+ var _a;
69
+ (_a = this.intersectionObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
70
+ this.actionBarItems = [];
71
+ }
72
+ isVisible(index) {
73
+ return index < this.overflowCutoff;
74
+ }
75
+ createIntersectionObserver() {
76
+ const options = {
77
+ root: this.host.shadowRoot.querySelector('.items'),
78
+ rootMargin: '0px',
79
+ threshold: 1.0,
80
+ };
81
+ this.actionBarItems = [];
82
+ this.intersectionObserver = new IntersectionObserver(this.handleIntersection, options);
83
+ this.host.shadowRoot
84
+ .querySelectorAll('limel-action-bar-item')
85
+ .forEach((actionBarItem) => {
86
+ this.observe(actionBarItem);
87
+ });
88
+ }
89
+ observe(actionBarItem) {
90
+ this.intersectionObserver.observe(actionBarItem);
91
+ this.actionBarItems.push(actionBarItem);
92
+ }
93
+ haveItemsChanged() {
94
+ const someItemRemoved = this.actionBarItems.some((actionBarItem) => !this.host.shadowRoot.contains(actionBarItem));
95
+ const someItemAdded = Array.from(this.host.shadowRoot.querySelectorAll('limel-action-bar-item')).some((actionBarItem) => !this.actionBarItems.includes(actionBarItem));
96
+ return someItemRemoved || someItemAdded;
97
+ }
98
+ get host() { return getElement(this); }
99
+ };
100
+ ActionBar.style = actionBarCss;
101
+
102
+ export { ActionBar as limel_action_bar };
@@ -6908,7 +6908,11 @@ function style(node, value) {
6908
6908
  node.setAttribute("style", value);
6909
6909
  } else if (isObject(value)) {
6910
6910
  forEach(value, (val, key) => {
6911
- if (isNumber(val) && isUnitlessNumber[key] !== 0) {
6911
+ if (key.indexOf("-") === 0) {
6912
+ // CSS custom properties (variables) start with `-` (e.g. `--my-variable`)
6913
+ // and must be assigned via `setProperty`.
6914
+ node.style.setProperty(key, val);
6915
+ } else if (isNumber(val) && isUnitlessNumber[key] !== 0) {
6912
6916
  node.style[key] = val + "px";
6913
6917
  } else {
6914
6918
  node.style[key] = val;
@@ -1,11 +1,131 @@
1
- import { h, r as registerInstance, c as createEvent, g as getElement } from './index-cdfd351d.js';
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-cdfd351d.js';
2
+ import { c as createRandomString } from './random-string-2246b81e.js';
3
+ import { z as zipObject } from './zipObject-2bb1968e.js';
2
4
  import { M as MDCMenuSurfaceFoundation, c as cssClasses$1, a as MDCListFoundation, n as numbers$1, b as MDCMenuSurface, d as MDCList, s as strings$1 } from './component-fffa3419.js';
3
5
  import { M as MDCFoundation, a as MDCComponent } from './component-410aad5a.js';
4
6
  import { c as closest } from './ponyfill-30263d5e.js';
5
7
  import { M as MDCRipple } from './component-5b4ac85a.js';
8
+ import './_assignValue-fb2bf80a.js';
9
+ import './_defineProperty-2105cb48.js';
10
+ import './_getNative-93d6bfe9.js';
11
+ import './eq-c1c7f528.js';
12
+ import './isObject-c74e273c.js';
6
13
  import './keyboard-4b9e12e3.js';
7
14
  import './util-f1bde91c.js';
8
15
 
16
+ const menuCss = ":host(limel-menu){isolation:isolate;position:relative;display:inline-block;--badge-background-color:var(\n --notification-badge-background-color,\n rgb(var(--color-red-default))\n );--badge-text-color:var(\n --notification-badge-text-color,\n rgb(var(--color-white))\n )}:host([hidden]){display:none}.menu__trigger{border-color:transparent;border-width:1px;border-style:solid;background:none;color:rgb(var(--contrast-800));height:2.25rem}.menu__trigger-enabled:hover{border-color:rgb(var(--contrast-800));color:rgb(var(--contrast-1100))}.mdc-menu-surface--anchor{position:relative}limel-badge{position:absolute;top:-0.25rem;right:-0.25rem}";
17
+
18
+ const Menu = class {
19
+ constructor(hostRef) {
20
+ registerInstance(this, hostRef);
21
+ this.cancel = createEvent(this, "cancel", 7);
22
+ this.select = createEvent(this, "select", 7);
23
+ this.setTriggerAttributes = (element) => {
24
+ const attributes = {
25
+ 'aria-haspopup': true,
26
+ 'aria-expanded': this.open,
27
+ disabled: this.disabled,
28
+ role: 'button',
29
+ };
30
+ for (const [key, value] of Object.entries(attributes)) {
31
+ if (!value) {
32
+ element.removeAttribute(key);
33
+ }
34
+ else {
35
+ element.setAttribute(key, String(value));
36
+ }
37
+ }
38
+ };
39
+ this.onClose = () => {
40
+ this.cancel.emit();
41
+ this.open = false;
42
+ };
43
+ this.onTriggerClick = (event) => {
44
+ event.stopPropagation();
45
+ if (this.disabled) {
46
+ return;
47
+ }
48
+ this.open = !this.open;
49
+ };
50
+ this.handleSelect = (event) => {
51
+ event.stopPropagation();
52
+ this.select.emit(event.detail);
53
+ this.open = false;
54
+ };
55
+ this.setListElement = (element) => {
56
+ this.list = element;
57
+ };
58
+ this.focusMenuItem = () => {
59
+ var _a;
60
+ const activeElement = this.list.shadowRoot.activeElement;
61
+ activeElement === null || activeElement === void 0 ? void 0 : activeElement.blur();
62
+ const MenuItems = this.items.filter(this.isMenuItem);
63
+ const selectedIndex = Math.max(MenuItems.findIndex((item) => item.selected), 0);
64
+ const menuElements = Array.from(this.list.shadowRoot.querySelectorAll('[role="menuitem"]'));
65
+ (_a = menuElements[selectedIndex]) === null || _a === void 0 ? void 0 : _a.focus();
66
+ };
67
+ this.renderNotificationBadge = () => {
68
+ if (this.items.some(this.hasNotificationBadge)) {
69
+ return h("limel-badge", null);
70
+ }
71
+ };
72
+ this.hasNotificationBadge = (item) => this.isMenuItem(item) && item.badge !== undefined;
73
+ this.items = [];
74
+ this.disabled = false;
75
+ this.openDirection = 'bottom-start';
76
+ this.open = false;
77
+ this.badgeIcons = false;
78
+ this.gridLayout = false;
79
+ this.portalId = createRandomString();
80
+ }
81
+ openWatcher() {
82
+ if (!this.open) {
83
+ return;
84
+ }
85
+ const observer = new IntersectionObserver(() => {
86
+ observer.unobserve(this.list);
87
+ this.focusMenuItem();
88
+ });
89
+ observer.observe(this.list);
90
+ }
91
+ render() {
92
+ const cssProperties = this.getCssProperties();
93
+ const dropdownZIndex = getComputedStyle(this.host).getPropertyValue('--dropdown-z-index');
94
+ return (h("div", { class: "mdc-menu-surface--anchor", onClick: this.onTriggerClick }, h("slot", { name: "trigger" }), this.renderNotificationBadge(), h("limel-portal", { visible: this.open, containerId: this.portalId, openDirection: this.openDirection, position: "absolute", containerStyle: { 'z-index': dropdownZIndex } }, h("limel-menu-surface", { open: this.open, onDismiss: this.onClose, style: cssProperties, class: {
95
+ 'has-grid-layout': this.gridLayout,
96
+ } }, h("limel-menu-list", { class: {
97
+ 'has-grid-layout has-interactive-items': this.gridLayout,
98
+ }, items: this.items, type: "menu", badgeIcons: this.badgeIcons, onSelect: this.handleSelect, ref: this.setListElement })))));
99
+ }
100
+ componentDidRender() {
101
+ const slotElement = this.host.shadowRoot.querySelector('slot');
102
+ slotElement.assignedElements().forEach(this.setTriggerAttributes);
103
+ }
104
+ getCssProperties() {
105
+ const propertyNames = [
106
+ '--menu-surface-width',
107
+ '--list-grid-item-max-width',
108
+ '--list-grid-item-min-width',
109
+ '--list-grid-gap',
110
+ '--notification-badge-background-color',
111
+ '--notification-badge-text-color',
112
+ ];
113
+ const style = getComputedStyle(this.host);
114
+ const values = propertyNames.map((property) => {
115
+ return style.getPropertyValue(property);
116
+ });
117
+ return zipObject(propertyNames, values);
118
+ }
119
+ isMenuItem(item) {
120
+ return !('separator' in item);
121
+ }
122
+ get host() { return getElement(this); }
123
+ static get watchers() { return {
124
+ "open": ["openWatcher"]
125
+ }; }
126
+ };
127
+ Menu.style = menuCss;
128
+
9
129
  /*! *****************************************************************************
10
130
  Copyright (c) Microsoft Corporation.
11
131
 
@@ -863,4 +983,4 @@ const MenuList = class {
863
983
  };
864
984
  MenuList.style = menuListCss;
865
985
 
866
- export { MenuList as limel_menu_list };
986
+ export { Menu as limel_menu, MenuList as limel_menu_list };