@limetech/lime-elements 34.0.0-next.2 → 34.0.0-next.6
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/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-menu.cjs.entry.js +1 -40
- package/dist/cjs/limel-picker.cjs.entry.js +0 -8
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/menu/menu.js +2 -84
- package/dist/collection/components/picker/picker.js +0 -29
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-menu.entry.js +1 -40
- package/dist/esm/limel-picker.entry.js +0 -8
- package/dist/esm/loader.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/p-33f3e1db.entry.js +16 -0
- package/dist/lime-elements/p-845e645a.entry.js +1 -0
- package/dist/types/components/dialog/dialog.types.d.ts +0 -4
- package/dist/types/components/menu/menu.d.ts +0 -17
- package/dist/types/components/picker/picker.d.ts +0 -8
- package/dist/types/components.d.ts +0 -30
- package/package.json +1 -1
- package/dist/lime-elements/p-692f31f1.entry.js +0 -16
- package/dist/lime-elements/p-de017026.entry.js +0 -1
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["limel-picker.cjs",[[1,"limel-picker",{"disabled":[4],"readonly":[516],"label":[1],"searchLabel":[1,"search-label"],"leadingIcon":[1,"leading-icon"],"emptyResultMessage":[1,"empty-result-message"],"required":[4],"value":[16],"searcher":[16],"multiple":[4],"delimiter":[513],"
|
|
18
|
+
return index.bootstrapLazy([["limel-picker.cjs",[[1,"limel-picker",{"disabled":[4],"readonly":[516],"label":[1],"searchLabel":[1,"search-label"],"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"],"items":[32],"textValue":[32],"loading":[32],"chips":[32]}]]],["limel-date-picker.cjs",[[1,"limel-date-picker",{"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"helperText":[513,"helper-text"],"required":[516],"value":[16],"type":[513],"format":[513],"language":[513],"formattedValue":[32],"internalFormat":[32],"showPortal":[32]}]]],["limel-button-group.cjs",[[1,"limel-button-group",{"value":[16],"disabled":[516],"selectedButtonId":[32]}]]],["limel-select.cjs",[[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-tab-panel.cjs",[[1,"limel-tab-panel",{"tabs":[1040]}]]],["limel-file.cjs",[[1,"limel-file",{"value":[16],"label":[513],"required":[516],"disabled":[516],"readonly":[516],"accept":[513],"language":[1],"isDraggingOverDropZone":[32]}]]],["limel-menu.cjs",[[1,"limel-menu",{"items":[16],"disabled":[516],"openDirection":[513,"open-direction"],"open":[1540],"badgeIcons":[516,"badge-icons"],"gridLayout":[516,"grid-layout"]}]]],["limel-button.cjs",[[1,"limel-button",{"label":[513],"primary":[516],"outlined":[516],"icon":[513],"disabled":[516],"loading":[516]}]]],["limel-collapsible-section.cjs",[[1,"limel-collapsible-section",{"isOpen":[1540,"is-open"],"header":[1],"actions":[16]}]]],["limel-dialog.cjs",[[1,"limel-dialog",{"heading":[1],"fullscreen":[516],"open":[1540],"closingActions":[16]}]]],["limel-popover.cjs",[[1,"limel-popover",{"open":[4]}]]],["limel-progress-flow.cjs",[[1,"limel-progress-flow",{"flowItems":[16],"disabled":[4],"readonly":[4]}]]],["limel-banner.cjs",[[1,"limel-banner",{"message":[513],"icon":[513],"isOpen":[32],"open":[64],"close":[64]}]]],["limel-table.cjs",[[1,"limel-table",{"data":[16],"columns":[16],"mode":[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"]}]]],["limel-checkbox.cjs",[[1,"limel-checkbox",{"disabled":[516],"readonly":[516],"label":[513],"checked":[516],"required":[516],"modified":[32]}]]],["limel-circular-progress.cjs",[[1,"limel-circular-progress",{"value":[2],"maxValue":[2,"max-value"],"suffix":[1],"displayPercentageColors":[4,"display-percentage-colors"],"size":[513]}]]],["limel-code-editor.cjs",[[1,"limel-code-editor",{"value":[1],"language":[1],"readonly":[4],"lineNumbers":[4,"line-numbers"],"colorScheme":[1,"color-scheme"],"random":[32]}]]],["limel-config.cjs",[[1,"limel-config",{"config":[16]}]]],["limel-flex-container.cjs",[[1,"limel-flex-container",{"direction":[513],"justify":[513],"align":[513],"reverse":[516]}]]],["limel-form.cjs",[[1,"limel-form",{"schema":[16],"value":[16],"propsFactory":[16]}]]],["limel-grid.cjs",[[1,"limel-grid"]]],["limel-linear-progress.cjs",[[1,"limel-linear-progress",{"value":[2],"indeterminate":[4]}]]],["limel-slider.cjs",[[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-snackbar.cjs",[[1,"limel-snackbar",{"message":[1],"timeout":[2],"actionText":[1,"action-text"],"dismissible":[4],"multiline":[4],"language":[1],"show":[64]}]]],["limel-switch.cjs",[[1,"limel-switch",{"label":[513],"disabled":[516],"readonly":[516],"value":[516],"fieldId":[32]}]]],["limel-tab-bar.cjs",[[1,"limel-tab-bar",{"tabs":[1040],"canScrollLeft":[32],"canScrollRight":[32]},[[9,"resize","handleWindowResize"]]]]],["limel-tooltip.cjs",[[1,"limel-tooltip",{"label":[513],"helperLabel":[513,"helper-label"],"elementId":[513,"element-id"],"open":[32]}]]],["limel-header.cjs",[[1,"limel-header",{"icon":[1],"heading":[1],"subheading":[1],"supportingText":[1,"supporting-text"]}]]],["limel-progress-flow-item.cjs",[[0,"limel-progress-flow-item",{"item":[16],"disabled":[4],"readonly":[4]}]]],["limel-menu-list.cjs",[[1,"limel-menu-list",{"items":[16],"badgeIcons":[4,"badge-icons"],"iconSize":[1,"icon-size"],"type":[1],"maxLinesSecondaryText":[2,"max-lines-secondary-text"]}]]],["limel-popover-surface.cjs",[[1,"limel-popover-surface",{"contentCollection":[16]}]]],["limel-icon.cjs",[[1,"limel-icon",{"size":[513],"name":[513],"badge":[516]}]]],["limel-flatpickr-adapter_2.cjs",[[1,"limel-input-field",{"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"helperText":[513,"helper-text"],"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]}],[1,"limel-flatpickr-adapter",{"value":[16],"type":[1],"format":[1],"isOpen":[4,"is-open"],"inputElement":[16],"language":[1]}]]],["limel-chip-set.cjs",[[1,"limel-chip-set",{"value":[16],"type":[513],"label":[513],"disabled":[516],"readonly":[516],"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-tooltip-content.cjs",[[1,"limel-tooltip-content",{"label":[513],"helperLabel":[513,"helper-label"]}]]],["limel-icon-button.cjs",[[1,"limel-icon-button",{"icon":[513],"elevated":[516],"label":[513],"disabled":[516],"relayout":[64]}]]],["limel-spinner.cjs",[[1,"limel-spinner",{"size":[513],"limeBranded":[4,"lime-branded"]}]]],["limel-badge.cjs",[[1,"limel-badge",{"label":[514]}]]],["limel-portal.cjs",[[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-list_2.cjs",[[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]}]]]], options);
|
|
19
19
|
});
|
|
@@ -16,13 +16,6 @@ let Menu = class {
|
|
|
16
16
|
index.registerInstance(this, hostRef);
|
|
17
17
|
this.cancel = index.createEvent(this, "cancel", 7);
|
|
18
18
|
this.select = index.createEvent(this, "select", 7);
|
|
19
|
-
/**
|
|
20
|
-
* Is displayed on the default trigger button.
|
|
21
|
-
*
|
|
22
|
-
* @deprecated Use with default trigger has been deprecated.
|
|
23
|
-
* Please supply your own trigger element.
|
|
24
|
-
*/
|
|
25
|
-
this.label = '';
|
|
26
19
|
/**
|
|
27
20
|
* A list of items and separators to show in the menu.
|
|
28
21
|
*/
|
|
@@ -47,14 +40,6 @@ let Menu = class {
|
|
|
47
40
|
* Renders list items in a grid layout, rather than a vertical list
|
|
48
41
|
*/
|
|
49
42
|
this.gridLayout = false;
|
|
50
|
-
/**
|
|
51
|
-
* Defines whether the menu should have a fixed position on the screen.
|
|
52
|
-
*
|
|
53
|
-
* @deprecated Fixed position was used to get around a bug in the placement
|
|
54
|
-
* of the menu. This bug has since been fixed, which makes this attribute
|
|
55
|
-
* obsolete.
|
|
56
|
-
*/
|
|
57
|
-
this.fixed = false;
|
|
58
43
|
this.setTriggerAttributes = (element) => {
|
|
59
44
|
const attributes = {
|
|
60
45
|
'aria-haspopup': true,
|
|
@@ -125,11 +110,7 @@ let Menu = class {
|
|
|
125
110
|
render() {
|
|
126
111
|
const cssProperties = this.getCssProperties();
|
|
127
112
|
const dropdownZIndex = getComputedStyle(this.host).getPropertyValue('--dropdown-z-index');
|
|
128
|
-
|
|
129
|
-
'limel-portal--fixed': this.fixed,
|
|
130
|
-
};
|
|
131
|
-
const portalPosition = this.getPortalPosition();
|
|
132
|
-
return (index.h("div", { class: "mdc-menu-surface--anchor", onClick: this.onTriggerClick }, index.h("slot", { name: "trigger" }, this.renderTrigger()), index.h("limel-portal", { class: portalClasses, style: portalPosition, visible: this.open, containerId: this.portalId, openDirection: this.openDirection, position: this.fixed ? 'fixed' : 'absolute', containerStyle: { 'z-index': dropdownZIndex } }, index.h("limel-menu-surface", { open: this.open, onDismiss: this.onClose, style: cssProperties }, index.h("limel-menu-list", { class: {
|
|
113
|
+
return (index.h("div", { class: "mdc-menu-surface--anchor", onClick: this.onTriggerClick }, index.h("slot", { name: "trigger" }), index.h("limel-portal", { visible: this.open, containerId: this.portalId, openDirection: this.openDirection, position: "absolute", containerStyle: { 'z-index': dropdownZIndex } }, index.h("limel-menu-surface", { open: this.open, onDismiss: this.onClose, style: cssProperties }, index.h("limel-menu-list", { class: {
|
|
133
114
|
'has-grid-layout has-interactive-items': this.gridLayout,
|
|
134
115
|
}, items: this.items, type: "menu", badgeIcons: this.badgeIcons, onChange: this.onListChange, ref: this.setListElement })))));
|
|
135
116
|
}
|
|
@@ -137,26 +118,6 @@ let Menu = class {
|
|
|
137
118
|
const slotElement = this.host.shadowRoot.querySelector('slot');
|
|
138
119
|
slotElement.assignedElements().forEach(this.setTriggerAttributes);
|
|
139
120
|
}
|
|
140
|
-
renderTrigger() {
|
|
141
|
-
return (index.h("button", { class: `
|
|
142
|
-
menu__trigger
|
|
143
|
-
${this.disabled ? '' : 'menu__trigger-enabled'}
|
|
144
|
-
`, disabled: this.disabled }, index.h("span", null, this.label)));
|
|
145
|
-
}
|
|
146
|
-
getPortalPosition() {
|
|
147
|
-
if (!this.fixed) {
|
|
148
|
-
return {};
|
|
149
|
-
}
|
|
150
|
-
const rect = this.host.getBoundingClientRect();
|
|
151
|
-
const portalPosition = {
|
|
152
|
-
top: `${rect.y + rect.height}px`,
|
|
153
|
-
left: `${rect.x}px`,
|
|
154
|
-
};
|
|
155
|
-
if (this.openDirection === 'left') {
|
|
156
|
-
portalPosition.left = `${rect.x + rect.width}px`;
|
|
157
|
-
}
|
|
158
|
-
return portalPosition;
|
|
159
|
-
}
|
|
160
121
|
getCssProperties() {
|
|
161
122
|
const propertyNames = [
|
|
162
123
|
'--menu-surface-width',
|
|
@@ -255,14 +255,6 @@ let Picker = class {
|
|
|
255
255
|
* Sets delimiters between chips. Works only when `multiple` is `true`.
|
|
256
256
|
*/
|
|
257
257
|
this.delimiter = null;
|
|
258
|
-
/**
|
|
259
|
-
* True if the dropdown list should be displayed without cutting the content
|
|
260
|
-
*
|
|
261
|
-
* @deprecated This was used for a workaround, and isn't needed any
|
|
262
|
-
* longer. Setting it has no effect, and the property will be removed
|
|
263
|
-
* in the next major version.
|
|
264
|
-
*/
|
|
265
|
-
this.displayFullList = false;
|
|
266
258
|
/**
|
|
267
259
|
* Static actions that can be clicked by the user.
|
|
268
260
|
*/
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["limel-picker.cjs",[[1,"limel-picker",{"disabled":[4],"readonly":[516],"label":[1],"searchLabel":[1,"search-label"],"leadingIcon":[1,"leading-icon"],"emptyResultMessage":[1,"empty-result-message"],"required":[4],"value":[16],"searcher":[16],"multiple":[4],"delimiter":[513],"
|
|
17
|
+
return index.bootstrapLazy([["limel-picker.cjs",[[1,"limel-picker",{"disabled":[4],"readonly":[516],"label":[1],"searchLabel":[1,"search-label"],"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"],"items":[32],"textValue":[32],"loading":[32],"chips":[32]}]]],["limel-date-picker.cjs",[[1,"limel-date-picker",{"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"helperText":[513,"helper-text"],"required":[516],"value":[16],"type":[513],"format":[513],"language":[513],"formattedValue":[32],"internalFormat":[32],"showPortal":[32]}]]],["limel-button-group.cjs",[[1,"limel-button-group",{"value":[16],"disabled":[516],"selectedButtonId":[32]}]]],["limel-select.cjs",[[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-tab-panel.cjs",[[1,"limel-tab-panel",{"tabs":[1040]}]]],["limel-file.cjs",[[1,"limel-file",{"value":[16],"label":[513],"required":[516],"disabled":[516],"readonly":[516],"accept":[513],"language":[1],"isDraggingOverDropZone":[32]}]]],["limel-menu.cjs",[[1,"limel-menu",{"items":[16],"disabled":[516],"openDirection":[513,"open-direction"],"open":[1540],"badgeIcons":[516,"badge-icons"],"gridLayout":[516,"grid-layout"]}]]],["limel-button.cjs",[[1,"limel-button",{"label":[513],"primary":[516],"outlined":[516],"icon":[513],"disabled":[516],"loading":[516]}]]],["limel-collapsible-section.cjs",[[1,"limel-collapsible-section",{"isOpen":[1540,"is-open"],"header":[1],"actions":[16]}]]],["limel-dialog.cjs",[[1,"limel-dialog",{"heading":[1],"fullscreen":[516],"open":[1540],"closingActions":[16]}]]],["limel-popover.cjs",[[1,"limel-popover",{"open":[4]}]]],["limel-progress-flow.cjs",[[1,"limel-progress-flow",{"flowItems":[16],"disabled":[4],"readonly":[4]}]]],["limel-banner.cjs",[[1,"limel-banner",{"message":[513],"icon":[513],"isOpen":[32],"open":[64],"close":[64]}]]],["limel-table.cjs",[[1,"limel-table",{"data":[16],"columns":[16],"mode":[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"]}]]],["limel-checkbox.cjs",[[1,"limel-checkbox",{"disabled":[516],"readonly":[516],"label":[513],"checked":[516],"required":[516],"modified":[32]}]]],["limel-circular-progress.cjs",[[1,"limel-circular-progress",{"value":[2],"maxValue":[2,"max-value"],"suffix":[1],"displayPercentageColors":[4,"display-percentage-colors"],"size":[513]}]]],["limel-code-editor.cjs",[[1,"limel-code-editor",{"value":[1],"language":[1],"readonly":[4],"lineNumbers":[4,"line-numbers"],"colorScheme":[1,"color-scheme"],"random":[32]}]]],["limel-config.cjs",[[1,"limel-config",{"config":[16]}]]],["limel-flex-container.cjs",[[1,"limel-flex-container",{"direction":[513],"justify":[513],"align":[513],"reverse":[516]}]]],["limel-form.cjs",[[1,"limel-form",{"schema":[16],"value":[16],"propsFactory":[16]}]]],["limel-grid.cjs",[[1,"limel-grid"]]],["limel-linear-progress.cjs",[[1,"limel-linear-progress",{"value":[2],"indeterminate":[4]}]]],["limel-slider.cjs",[[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-snackbar.cjs",[[1,"limel-snackbar",{"message":[1],"timeout":[2],"actionText":[1,"action-text"],"dismissible":[4],"multiline":[4],"language":[1],"show":[64]}]]],["limel-switch.cjs",[[1,"limel-switch",{"label":[513],"disabled":[516],"readonly":[516],"value":[516],"fieldId":[32]}]]],["limel-tab-bar.cjs",[[1,"limel-tab-bar",{"tabs":[1040],"canScrollLeft":[32],"canScrollRight":[32]},[[9,"resize","handleWindowResize"]]]]],["limel-tooltip.cjs",[[1,"limel-tooltip",{"label":[513],"helperLabel":[513,"helper-label"],"elementId":[513,"element-id"],"open":[32]}]]],["limel-header.cjs",[[1,"limel-header",{"icon":[1],"heading":[1],"subheading":[1],"supportingText":[1,"supporting-text"]}]]],["limel-progress-flow-item.cjs",[[0,"limel-progress-flow-item",{"item":[16],"disabled":[4],"readonly":[4]}]]],["limel-menu-list.cjs",[[1,"limel-menu-list",{"items":[16],"badgeIcons":[4,"badge-icons"],"iconSize":[1,"icon-size"],"type":[1],"maxLinesSecondaryText":[2,"max-lines-secondary-text"]}]]],["limel-popover-surface.cjs",[[1,"limel-popover-surface",{"contentCollection":[16]}]]],["limel-icon.cjs",[[1,"limel-icon",{"size":[513],"name":[513],"badge":[516]}]]],["limel-flatpickr-adapter_2.cjs",[[1,"limel-input-field",{"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"helperText":[513,"helper-text"],"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]}],[1,"limel-flatpickr-adapter",{"value":[16],"type":[1],"format":[1],"isOpen":[4,"is-open"],"inputElement":[16],"language":[1]}]]],["limel-chip-set.cjs",[[1,"limel-chip-set",{"value":[16],"type":[513],"label":[513],"disabled":[516],"readonly":[516],"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-tooltip-content.cjs",[[1,"limel-tooltip-content",{"label":[513],"helperLabel":[513,"helper-label"]}]]],["limel-icon-button.cjs",[[1,"limel-icon-button",{"icon":[513],"elevated":[516],"label":[513],"disabled":[516],"relayout":[64]}]]],["limel-spinner.cjs",[[1,"limel-spinner",{"size":[513],"limeBranded":[4,"lime-branded"]}]]],["limel-badge.cjs",[[1,"limel-badge",{"label":[514]}]]],["limel-portal.cjs",[[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-list_2.cjs",[[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]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -14,13 +14,6 @@ import { zipObject } from 'lodash-es';
|
|
|
14
14
|
*/
|
|
15
15
|
export class Menu {
|
|
16
16
|
constructor() {
|
|
17
|
-
/**
|
|
18
|
-
* Is displayed on the default trigger button.
|
|
19
|
-
*
|
|
20
|
-
* @deprecated Use with default trigger has been deprecated.
|
|
21
|
-
* Please supply your own trigger element.
|
|
22
|
-
*/
|
|
23
|
-
this.label = '';
|
|
24
17
|
/**
|
|
25
18
|
* A list of items and separators to show in the menu.
|
|
26
19
|
*/
|
|
@@ -45,14 +38,6 @@ export class Menu {
|
|
|
45
38
|
* Renders list items in a grid layout, rather than a vertical list
|
|
46
39
|
*/
|
|
47
40
|
this.gridLayout = false;
|
|
48
|
-
/**
|
|
49
|
-
* Defines whether the menu should have a fixed position on the screen.
|
|
50
|
-
*
|
|
51
|
-
* @deprecated Fixed position was used to get around a bug in the placement
|
|
52
|
-
* of the menu. This bug has since been fixed, which makes this attribute
|
|
53
|
-
* obsolete.
|
|
54
|
-
*/
|
|
55
|
-
this.fixed = false;
|
|
56
41
|
this.setTriggerAttributes = (element) => {
|
|
57
42
|
const attributes = {
|
|
58
43
|
'aria-haspopup': true,
|
|
@@ -123,13 +108,9 @@ export class Menu {
|
|
|
123
108
|
render() {
|
|
124
109
|
const cssProperties = this.getCssProperties();
|
|
125
110
|
const dropdownZIndex = getComputedStyle(this.host).getPropertyValue('--dropdown-z-index');
|
|
126
|
-
const portalClasses = {
|
|
127
|
-
'limel-portal--fixed': this.fixed,
|
|
128
|
-
};
|
|
129
|
-
const portalPosition = this.getPortalPosition();
|
|
130
111
|
return (h("div", { class: "mdc-menu-surface--anchor", onClick: this.onTriggerClick },
|
|
131
|
-
h("slot", { name: "trigger" }
|
|
132
|
-
h("limel-portal", {
|
|
112
|
+
h("slot", { name: "trigger" }),
|
|
113
|
+
h("limel-portal", { visible: this.open, containerId: this.portalId, openDirection: this.openDirection, position: "absolute", containerStyle: { 'z-index': dropdownZIndex } },
|
|
133
114
|
h("limel-menu-surface", { open: this.open, onDismiss: this.onClose, style: cssProperties },
|
|
134
115
|
h("limel-menu-list", { class: {
|
|
135
116
|
'has-grid-layout has-interactive-items': this.gridLayout,
|
|
@@ -139,27 +120,6 @@ export class Menu {
|
|
|
139
120
|
const slotElement = this.host.shadowRoot.querySelector('slot');
|
|
140
121
|
slotElement.assignedElements().forEach(this.setTriggerAttributes);
|
|
141
122
|
}
|
|
142
|
-
renderTrigger() {
|
|
143
|
-
return (h("button", { class: `
|
|
144
|
-
menu__trigger
|
|
145
|
-
${this.disabled ? '' : 'menu__trigger-enabled'}
|
|
146
|
-
`, disabled: this.disabled },
|
|
147
|
-
h("span", null, this.label)));
|
|
148
|
-
}
|
|
149
|
-
getPortalPosition() {
|
|
150
|
-
if (!this.fixed) {
|
|
151
|
-
return {};
|
|
152
|
-
}
|
|
153
|
-
const rect = this.host.getBoundingClientRect();
|
|
154
|
-
const portalPosition = {
|
|
155
|
-
top: `${rect.y + rect.height}px`,
|
|
156
|
-
left: `${rect.x}px`,
|
|
157
|
-
};
|
|
158
|
-
if (this.openDirection === 'left') {
|
|
159
|
-
portalPosition.left = `${rect.x + rect.width}px`;
|
|
160
|
-
}
|
|
161
|
-
return portalPosition;
|
|
162
|
-
}
|
|
163
123
|
getCssProperties() {
|
|
164
124
|
const propertyNames = [
|
|
165
125
|
'--menu-surface-width',
|
|
@@ -185,27 +145,6 @@ export class Menu {
|
|
|
185
145
|
"$": ["menu.css"]
|
|
186
146
|
}; }
|
|
187
147
|
static get properties() { return {
|
|
188
|
-
"label": {
|
|
189
|
-
"type": "string",
|
|
190
|
-
"mutable": false,
|
|
191
|
-
"complexType": {
|
|
192
|
-
"original": "string",
|
|
193
|
-
"resolved": "string",
|
|
194
|
-
"references": {}
|
|
195
|
-
},
|
|
196
|
-
"required": false,
|
|
197
|
-
"optional": false,
|
|
198
|
-
"docs": {
|
|
199
|
-
"tags": [{
|
|
200
|
-
"name": "deprecated",
|
|
201
|
-
"text": "Use with default trigger has been deprecated.\nPlease supply your own trigger element."
|
|
202
|
-
}],
|
|
203
|
-
"text": "Is displayed on the default trigger button."
|
|
204
|
-
},
|
|
205
|
-
"attribute": "label",
|
|
206
|
-
"reflect": true,
|
|
207
|
-
"defaultValue": "''"
|
|
208
|
-
},
|
|
209
148
|
"items": {
|
|
210
149
|
"type": "unknown",
|
|
211
150
|
"mutable": false,
|
|
@@ -328,27 +267,6 @@ export class Menu {
|
|
|
328
267
|
"attribute": "grid-layout",
|
|
329
268
|
"reflect": true,
|
|
330
269
|
"defaultValue": "false"
|
|
331
|
-
},
|
|
332
|
-
"fixed": {
|
|
333
|
-
"type": "boolean",
|
|
334
|
-
"mutable": false,
|
|
335
|
-
"complexType": {
|
|
336
|
-
"original": "boolean",
|
|
337
|
-
"resolved": "boolean",
|
|
338
|
-
"references": {}
|
|
339
|
-
},
|
|
340
|
-
"required": false,
|
|
341
|
-
"optional": false,
|
|
342
|
-
"docs": {
|
|
343
|
-
"tags": [{
|
|
344
|
-
"name": "deprecated",
|
|
345
|
-
"text": "Fixed position was used to get around a bug in the placement\nof the menu. This bug has since been fixed, which makes this attribute\nobsolete."
|
|
346
|
-
}],
|
|
347
|
-
"text": "Defines whether the menu should have a fixed position on the screen."
|
|
348
|
-
},
|
|
349
|
-
"attribute": "fixed",
|
|
350
|
-
"reflect": false,
|
|
351
|
-
"defaultValue": "false"
|
|
352
270
|
}
|
|
353
271
|
}; }
|
|
354
272
|
static get events() { return [{
|
|
@@ -36,14 +36,6 @@ export class Picker {
|
|
|
36
36
|
* Sets delimiters between chips. Works only when `multiple` is `true`.
|
|
37
37
|
*/
|
|
38
38
|
this.delimiter = null;
|
|
39
|
-
/**
|
|
40
|
-
* True if the dropdown list should be displayed without cutting the content
|
|
41
|
-
*
|
|
42
|
-
* @deprecated This was used for a workaround, and isn't needed any
|
|
43
|
-
* longer. Setting it has no effect, and the property will be removed
|
|
44
|
-
* in the next major version.
|
|
45
|
-
*/
|
|
46
|
-
this.displayFullList = false;
|
|
47
39
|
/**
|
|
48
40
|
* Static actions that can be clicked by the user.
|
|
49
41
|
*/
|
|
@@ -634,27 +626,6 @@ export class Picker {
|
|
|
634
626
|
"reflect": true,
|
|
635
627
|
"defaultValue": "null"
|
|
636
628
|
},
|
|
637
|
-
"displayFullList": {
|
|
638
|
-
"type": "boolean",
|
|
639
|
-
"mutable": false,
|
|
640
|
-
"complexType": {
|
|
641
|
-
"original": "boolean",
|
|
642
|
-
"resolved": "boolean",
|
|
643
|
-
"references": {}
|
|
644
|
-
},
|
|
645
|
-
"required": false,
|
|
646
|
-
"optional": false,
|
|
647
|
-
"docs": {
|
|
648
|
-
"tags": [{
|
|
649
|
-
"name": "deprecated",
|
|
650
|
-
"text": "This was used for a workaround, and isn't needed any\nlonger. Setting it has no effect, and the property will be removed\nin the next major version."
|
|
651
|
-
}],
|
|
652
|
-
"text": "True if the dropdown list should be displayed without cutting the content"
|
|
653
|
-
},
|
|
654
|
-
"attribute": "display-full-list",
|
|
655
|
-
"reflect": false,
|
|
656
|
-
"defaultValue": "false"
|
|
657
|
-
},
|
|
658
629
|
"actions": {
|
|
659
630
|
"type": "unknown",
|
|
660
631
|
"mutable": false,
|
|
@@ -13,5 +13,5 @@ const patchBrowser = () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["limel-picker",[[1,"limel-picker",{"disabled":[4],"readonly":[516],"label":[1],"searchLabel":[1,"search-label"],"leadingIcon":[1,"leading-icon"],"emptyResultMessage":[1,"empty-result-message"],"required":[4],"value":[16],"searcher":[16],"multiple":[4],"delimiter":[513],"
|
|
16
|
+
return bootstrapLazy([["limel-picker",[[1,"limel-picker",{"disabled":[4],"readonly":[516],"label":[1],"searchLabel":[1,"search-label"],"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"],"items":[32],"textValue":[32],"loading":[32],"chips":[32]}]]],["limel-date-picker",[[1,"limel-date-picker",{"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"helperText":[513,"helper-text"],"required":[516],"value":[16],"type":[513],"format":[513],"language":[513],"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-tab-panel",[[1,"limel-tab-panel",{"tabs":[1040]}]]],["limel-file",[[1,"limel-file",{"value":[16],"label":[513],"required":[516],"disabled":[516],"readonly":[516],"accept":[513],"language":[1],"isDraggingOverDropZone":[32]}]]],["limel-menu",[[1,"limel-menu",{"items":[16],"disabled":[516],"openDirection":[513,"open-direction"],"open":[1540],"badgeIcons":[516,"badge-icons"],"gridLayout":[516,"grid-layout"]}]]],["limel-button",[[1,"limel-button",{"label":[513],"primary":[516],"outlined":[516],"icon":[513],"disabled":[516],"loading":[516]}]]],["limel-collapsible-section",[[1,"limel-collapsible-section",{"isOpen":[1540,"is-open"],"header":[1],"actions":[16]}]]],["limel-dialog",[[1,"limel-dialog",{"heading":[1],"fullscreen":[516],"open":[1540],"closingActions":[16]}]]],["limel-popover",[[1,"limel-popover",{"open":[4]}]]],["limel-progress-flow",[[1,"limel-progress-flow",{"flowItems":[16],"disabled":[4],"readonly":[4]}]]],["limel-banner",[[1,"limel-banner",{"message":[513],"icon":[513],"isOpen":[32],"open":[64],"close":[64]}]]],["limel-table",[[1,"limel-table",{"data":[16],"columns":[16],"mode":[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"]}]]],["limel-checkbox",[[1,"limel-checkbox",{"disabled":[516],"readonly":[516],"label":[513],"checked":[516],"required":[516],"modified":[32]}]]],["limel-circular-progress",[[1,"limel-circular-progress",{"value":[2],"maxValue":[2,"max-value"],"suffix":[1],"displayPercentageColors":[4,"display-percentage-colors"],"size":[513]}]]],["limel-code-editor",[[1,"limel-code-editor",{"value":[1],"language":[1],"readonly":[4],"lineNumbers":[4,"line-numbers"],"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],"propsFactory":[16]}]]],["limel-grid",[[1,"limel-grid"]]],["limel-linear-progress",[[1,"limel-linear-progress",{"value":[2],"indeterminate":[4]}]]],["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-snackbar",[[1,"limel-snackbar",{"message":[1],"timeout":[2],"actionText":[1,"action-text"],"dismissible":[4],"multiline":[4],"language":[1],"show":[64]}]]],["limel-switch",[[1,"limel-switch",{"label":[513],"disabled":[516],"readonly":[516],"value":[516],"fieldId":[32]}]]],["limel-tab-bar",[[1,"limel-tab-bar",{"tabs":[1040],"canScrollLeft":[32],"canScrollRight":[32]},[[9,"resize","handleWindowResize"]]]]],["limel-tooltip",[[1,"limel-tooltip",{"label":[513],"helperLabel":[513,"helper-label"],"elementId":[513,"element-id"],"open":[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-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-popover-surface",[[1,"limel-popover-surface",{"contentCollection":[16]}]]],["limel-icon",[[1,"limel-icon",{"size":[513],"name":[513],"badge":[516]}]]],["limel-flatpickr-adapter_2",[[1,"limel-input-field",{"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"helperText":[513,"helper-text"],"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]}],[1,"limel-flatpickr-adapter",{"value":[16],"type":[1],"format":[1],"isOpen":[4,"is-open"],"inputElement":[16],"language":[1]}]]],["limel-chip-set",[[1,"limel-chip-set",{"value":[16],"type":[513],"label":[513],"disabled":[516],"readonly":[516],"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-tooltip-content",[[1,"limel-tooltip-content",{"label":[513],"helperLabel":[513,"helper-label"]}]]],["limel-icon-button",[[1,"limel-icon-button",{"icon":[513],"elevated":[516],"label":[513],"disabled":[516],"relayout":[64]}]]],["limel-spinner",[[1,"limel-spinner",{"size":[513],"limeBranded":[4,"lime-branded"]}]]],["limel-badge",[[1,"limel-badge",{"label":[514]}]]],["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-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]}]]]], options);
|
|
17
17
|
});
|
|
@@ -12,13 +12,6 @@ let Menu = class {
|
|
|
12
12
|
registerInstance(this, hostRef);
|
|
13
13
|
this.cancel = createEvent(this, "cancel", 7);
|
|
14
14
|
this.select = createEvent(this, "select", 7);
|
|
15
|
-
/**
|
|
16
|
-
* Is displayed on the default trigger button.
|
|
17
|
-
*
|
|
18
|
-
* @deprecated Use with default trigger has been deprecated.
|
|
19
|
-
* Please supply your own trigger element.
|
|
20
|
-
*/
|
|
21
|
-
this.label = '';
|
|
22
15
|
/**
|
|
23
16
|
* A list of items and separators to show in the menu.
|
|
24
17
|
*/
|
|
@@ -43,14 +36,6 @@ let Menu = class {
|
|
|
43
36
|
* Renders list items in a grid layout, rather than a vertical list
|
|
44
37
|
*/
|
|
45
38
|
this.gridLayout = false;
|
|
46
|
-
/**
|
|
47
|
-
* Defines whether the menu should have a fixed position on the screen.
|
|
48
|
-
*
|
|
49
|
-
* @deprecated Fixed position was used to get around a bug in the placement
|
|
50
|
-
* of the menu. This bug has since been fixed, which makes this attribute
|
|
51
|
-
* obsolete.
|
|
52
|
-
*/
|
|
53
|
-
this.fixed = false;
|
|
54
39
|
this.setTriggerAttributes = (element) => {
|
|
55
40
|
const attributes = {
|
|
56
41
|
'aria-haspopup': true,
|
|
@@ -121,11 +106,7 @@ let Menu = class {
|
|
|
121
106
|
render() {
|
|
122
107
|
const cssProperties = this.getCssProperties();
|
|
123
108
|
const dropdownZIndex = getComputedStyle(this.host).getPropertyValue('--dropdown-z-index');
|
|
124
|
-
|
|
125
|
-
'limel-portal--fixed': this.fixed,
|
|
126
|
-
};
|
|
127
|
-
const portalPosition = this.getPortalPosition();
|
|
128
|
-
return (h("div", { class: "mdc-menu-surface--anchor", onClick: this.onTriggerClick }, h("slot", { name: "trigger" }, this.renderTrigger()), h("limel-portal", { class: portalClasses, style: portalPosition, visible: this.open, containerId: this.portalId, openDirection: this.openDirection, position: this.fixed ? 'fixed' : 'absolute', containerStyle: { 'z-index': dropdownZIndex } }, h("limel-menu-surface", { open: this.open, onDismiss: this.onClose, style: cssProperties }, h("limel-menu-list", { class: {
|
|
109
|
+
return (h("div", { class: "mdc-menu-surface--anchor", onClick: this.onTriggerClick }, h("slot", { name: "trigger" }), 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 }, h("limel-menu-list", { class: {
|
|
129
110
|
'has-grid-layout has-interactive-items': this.gridLayout,
|
|
130
111
|
}, items: this.items, type: "menu", badgeIcons: this.badgeIcons, onChange: this.onListChange, ref: this.setListElement })))));
|
|
131
112
|
}
|
|
@@ -133,26 +114,6 @@ let Menu = class {
|
|
|
133
114
|
const slotElement = this.host.shadowRoot.querySelector('slot');
|
|
134
115
|
slotElement.assignedElements().forEach(this.setTriggerAttributes);
|
|
135
116
|
}
|
|
136
|
-
renderTrigger() {
|
|
137
|
-
return (h("button", { class: `
|
|
138
|
-
menu__trigger
|
|
139
|
-
${this.disabled ? '' : 'menu__trigger-enabled'}
|
|
140
|
-
`, disabled: this.disabled }, h("span", null, this.label)));
|
|
141
|
-
}
|
|
142
|
-
getPortalPosition() {
|
|
143
|
-
if (!this.fixed) {
|
|
144
|
-
return {};
|
|
145
|
-
}
|
|
146
|
-
const rect = this.host.getBoundingClientRect();
|
|
147
|
-
const portalPosition = {
|
|
148
|
-
top: `${rect.y + rect.height}px`,
|
|
149
|
-
left: `${rect.x}px`,
|
|
150
|
-
};
|
|
151
|
-
if (this.openDirection === 'left') {
|
|
152
|
-
portalPosition.left = `${rect.x + rect.width}px`;
|
|
153
|
-
}
|
|
154
|
-
return portalPosition;
|
|
155
|
-
}
|
|
156
117
|
getCssProperties() {
|
|
157
118
|
const propertyNames = [
|
|
158
119
|
'--menu-surface-width',
|
|
@@ -251,14 +251,6 @@ let Picker = class {
|
|
|
251
251
|
* Sets delimiters between chips. Works only when `multiple` is `true`.
|
|
252
252
|
*/
|
|
253
253
|
this.delimiter = null;
|
|
254
|
-
/**
|
|
255
|
-
* True if the dropdown list should be displayed without cutting the content
|
|
256
|
-
*
|
|
257
|
-
* @deprecated This was used for a workaround, and isn't needed any
|
|
258
|
-
* longer. Setting it has no effect, and the property will be removed
|
|
259
|
-
* in the next major version.
|
|
260
|
-
*/
|
|
261
|
-
this.displayFullList = false;
|
|
262
254
|
/**
|
|
263
255
|
* Static actions that can be clicked by the user.
|
|
264
256
|
*/
|
package/dist/esm/loader.js
CHANGED
|
@@ -10,7 +10,7 @@ const patchEsm = () => {
|
|
|
10
10
|
const defineCustomElements = (win, options) => {
|
|
11
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
12
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["limel-picker",[[1,"limel-picker",{"disabled":[4],"readonly":[516],"label":[1],"searchLabel":[1,"search-label"],"leadingIcon":[1,"leading-icon"],"emptyResultMessage":[1,"empty-result-message"],"required":[4],"value":[16],"searcher":[16],"multiple":[4],"delimiter":[513],"
|
|
13
|
+
return bootstrapLazy([["limel-picker",[[1,"limel-picker",{"disabled":[4],"readonly":[516],"label":[1],"searchLabel":[1,"search-label"],"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"],"items":[32],"textValue":[32],"loading":[32],"chips":[32]}]]],["limel-date-picker",[[1,"limel-date-picker",{"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"helperText":[513,"helper-text"],"required":[516],"value":[16],"type":[513],"format":[513],"language":[513],"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-tab-panel",[[1,"limel-tab-panel",{"tabs":[1040]}]]],["limel-file",[[1,"limel-file",{"value":[16],"label":[513],"required":[516],"disabled":[516],"readonly":[516],"accept":[513],"language":[1],"isDraggingOverDropZone":[32]}]]],["limel-menu",[[1,"limel-menu",{"items":[16],"disabled":[516],"openDirection":[513,"open-direction"],"open":[1540],"badgeIcons":[516,"badge-icons"],"gridLayout":[516,"grid-layout"]}]]],["limel-button",[[1,"limel-button",{"label":[513],"primary":[516],"outlined":[516],"icon":[513],"disabled":[516],"loading":[516]}]]],["limel-collapsible-section",[[1,"limel-collapsible-section",{"isOpen":[1540,"is-open"],"header":[1],"actions":[16]}]]],["limel-dialog",[[1,"limel-dialog",{"heading":[1],"fullscreen":[516],"open":[1540],"closingActions":[16]}]]],["limel-popover",[[1,"limel-popover",{"open":[4]}]]],["limel-progress-flow",[[1,"limel-progress-flow",{"flowItems":[16],"disabled":[4],"readonly":[4]}]]],["limel-banner",[[1,"limel-banner",{"message":[513],"icon":[513],"isOpen":[32],"open":[64],"close":[64]}]]],["limel-table",[[1,"limel-table",{"data":[16],"columns":[16],"mode":[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"]}]]],["limel-checkbox",[[1,"limel-checkbox",{"disabled":[516],"readonly":[516],"label":[513],"checked":[516],"required":[516],"modified":[32]}]]],["limel-circular-progress",[[1,"limel-circular-progress",{"value":[2],"maxValue":[2,"max-value"],"suffix":[1],"displayPercentageColors":[4,"display-percentage-colors"],"size":[513]}]]],["limel-code-editor",[[1,"limel-code-editor",{"value":[1],"language":[1],"readonly":[4],"lineNumbers":[4,"line-numbers"],"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],"propsFactory":[16]}]]],["limel-grid",[[1,"limel-grid"]]],["limel-linear-progress",[[1,"limel-linear-progress",{"value":[2],"indeterminate":[4]}]]],["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-snackbar",[[1,"limel-snackbar",{"message":[1],"timeout":[2],"actionText":[1,"action-text"],"dismissible":[4],"multiline":[4],"language":[1],"show":[64]}]]],["limel-switch",[[1,"limel-switch",{"label":[513],"disabled":[516],"readonly":[516],"value":[516],"fieldId":[32]}]]],["limel-tab-bar",[[1,"limel-tab-bar",{"tabs":[1040],"canScrollLeft":[32],"canScrollRight":[32]},[[9,"resize","handleWindowResize"]]]]],["limel-tooltip",[[1,"limel-tooltip",{"label":[513],"helperLabel":[513,"helper-label"],"elementId":[513,"element-id"],"open":[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-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-popover-surface",[[1,"limel-popover-surface",{"contentCollection":[16]}]]],["limel-icon",[[1,"limel-icon",{"size":[513],"name":[513],"badge":[516]}]]],["limel-flatpickr-adapter_2",[[1,"limel-input-field",{"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"helperText":[513,"helper-text"],"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]}],[1,"limel-flatpickr-adapter",{"value":[16],"type":[1],"format":[1],"isOpen":[4,"is-open"],"inputElement":[16],"language":[1]}]]],["limel-chip-set",[[1,"limel-chip-set",{"value":[16],"type":[513],"label":[513],"disabled":[516],"readonly":[516],"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-tooltip-content",[[1,"limel-tooltip-content",{"label":[513],"helperLabel":[513,"helper-label"]}]]],["limel-icon-button",[[1,"limel-icon-button",{"icon":[513],"elevated":[516],"label":[513],"disabled":[516],"relayout":[64]}]]],["limel-spinner",[[1,"limel-spinner",{"size":[513],"limeBranded":[4,"lime-branded"]}]]],["limel-badge",[[1,"limel-badge",{"label":[514]}]]],["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-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]}]]]], options);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as l}from"./p-92146da6.js";(()=>{const l=import.meta.url,i={};return""!==l&&(i.resourcesUrl=new URL(".",l).href),e(i)})().then((e=>l([["p-
|
|
1
|
+
import{p as e,b as l}from"./p-92146da6.js";(()=>{const l=import.meta.url,i={};return""!==l&&(i.resourcesUrl=new URL(".",l).href),e(i)})().then((e=>l([["p-33f3e1db",[[1,"limel-picker",{disabled:[4],readonly:[516],label:[1],searchLabel:[1,"search-label"],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"],items:[32],textValue:[32],loading:[32],chips:[32]}]]],["p-041ae00c",[[1,"limel-date-picker",{disabled:[516],readonly:[516],invalid:[516],label:[513],helperText:[513,"helper-text"],required:[516],value:[16],type:[513],format:[513],language:[513],formattedValue:[32],internalFormat:[32],showPortal:[32]}]]],["p-c35874db",[[1,"limel-button-group",{value:[16],disabled:[516],selectedButtonId:[32]}]]],["p-3525d50c",[[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]}]]],["p-4b5af81b",[[1,"limel-tab-panel",{tabs:[1040]}]]],["p-a1153d2a",[[1,"limel-file",{value:[16],label:[513],required:[516],disabled:[516],readonly:[516],accept:[513],language:[1],isDraggingOverDropZone:[32]}]]],["p-845e645a",[[1,"limel-menu",{items:[16],disabled:[516],openDirection:[513,"open-direction"],open:[1540],badgeIcons:[516,"badge-icons"],gridLayout:[516,"grid-layout"]}]]],["p-510bb5a4",[[1,"limel-button",{label:[513],primary:[516],outlined:[516],icon:[513],disabled:[516],loading:[516]}]]],["p-9d362dd5",[[1,"limel-collapsible-section",{isOpen:[1540,"is-open"],header:[1],actions:[16]}]]],["p-85094bfc",[[1,"limel-dialog",{heading:[1],fullscreen:[516],open:[1540],closingActions:[16]}]]],["p-227d2c5a",[[1,"limel-popover",{open:[4]}]]],["p-d070f0e7",[[1,"limel-progress-flow",{flowItems:[16],disabled:[4],readonly:[4]}]]],["p-fc30b8e3",[[1,"limel-banner",{message:[513],icon:[513],isOpen:[32],open:[64],close:[64]}]]],["p-587bd6ca",[[1,"limel-table",{data:[16],columns:[16],mode:[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"]}]]],["p-8d8bd2ab",[[1,"limel-checkbox",{disabled:[516],readonly:[516],label:[513],checked:[516],required:[516],modified:[32]}]]],["p-34c7872e",[[1,"limel-circular-progress",{value:[2],maxValue:[2,"max-value"],suffix:[1],displayPercentageColors:[4,"display-percentage-colors"],size:[513]}]]],["p-1d7c7d5e",[[1,"limel-code-editor",{value:[1],language:[1],readonly:[4],lineNumbers:[4,"line-numbers"],colorScheme:[1,"color-scheme"],random:[32]}]]],["p-31fecf5d",[[1,"limel-config",{config:[16]}]]],["p-7476efe0",[[1,"limel-flex-container",{direction:[513],justify:[513],align:[513],reverse:[516]}]]],["p-f079f1fd",[[1,"limel-form",{schema:[16],value:[16],propsFactory:[16]}]]],["p-b386bfeb",[[1,"limel-grid"]]],["p-64549ba6",[[1,"limel-linear-progress",{value:[2],indeterminate:[4]}]]],["p-03c28bee",[[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]}]]],["p-c8c8a946",[[1,"limel-snackbar",{message:[1],timeout:[2],actionText:[1,"action-text"],dismissible:[4],multiline:[4],language:[1],show:[64]}]]],["p-90f3e17c",[[1,"limel-switch",{label:[513],disabled:[516],readonly:[516],value:[516],fieldId:[32]}]]],["p-ff0217b3",[[1,"limel-tab-bar",{tabs:[1040],canScrollLeft:[32],canScrollRight:[32]},[[9,"resize","handleWindowResize"]]]]],["p-bbc1bb01",[[1,"limel-tooltip",{label:[513],helperLabel:[513,"helper-label"],elementId:[513,"element-id"],open:[32]}]]],["p-1fb5340d",[[1,"limel-header",{icon:[1],heading:[1],subheading:[1],supportingText:[1,"supporting-text"]}]]],["p-e5738ec6",[[0,"limel-progress-flow-item",{item:[16],disabled:[4],readonly:[4]}]]],["p-df55ee67",[[1,"limel-menu-list",{items:[16],badgeIcons:[4,"badge-icons"],iconSize:[1,"icon-size"],type:[1],maxLinesSecondaryText:[2,"max-lines-secondary-text"]}]]],["p-4932c029",[[1,"limel-popover-surface",{contentCollection:[16]}]]],["p-be56ffab",[[1,"limel-icon",{size:[513],name:[513],badge:[516]}]]],["p-a3dadae7",[[1,"limel-input-field",{disabled:[516],readonly:[516],invalid:[516],label:[513],helperText:[513,"helper-text"],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]}],[1,"limel-flatpickr-adapter",{value:[16],type:[1],format:[1],isOpen:[4,"is-open"],inputElement:[16],language:[1]}]]],["p-b5d6abc3",[[1,"limel-chip-set",{value:[16],type:[513],label:[513],disabled:[516],readonly:[516],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]}]]],["p-f4495f59",[[1,"limel-tooltip-content",{label:[513],helperLabel:[513,"helper-label"]}]]],["p-143705b1",[[1,"limel-icon-button",{icon:[513],elevated:[516],label:[513],disabled:[516],relayout:[64]}]]],["p-e881e98d",[[1,"limel-spinner",{size:[513],limeBranded:[4,"lime-branded"]}]]],["p-d2c74396",[[1,"limel-badge",{label:[514]}]]],["p-f2df64ec",[[1,"limel-portal",{openDirection:[1,"open-direction"],position:[1],containerId:[1,"container-id"],containerStyle:[16],parent:[16],inheritParentWidth:[4,"inherit-parent-width"],visible:[4]}]]],["p-8d1ab246",[[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]}]]]],e)));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{r as t,c as i,h as s,g as e}from"./p-92146da6.js";import{i as n}from"./p-0534b23b.js";import{T as h,b as r,E as o,c as l,d as a,a as c,A as u,e as d,f,g as p}from"./p-216ffe20.js";import{c as m}from"./p-6c094f3f.js";function v(t){return"function"==typeof t?t():t}function y(){var t={};return t.promise=new Promise((function(i,s){t.resolve=i,t.reject=s})),t}function g(t){var i=null,s=null,e=new Promise((function(t,e){i=t,s=e}));return t&&t.then((function(t){i&&i(t)}),(function(t){s&&s(t)})),{promise:e,resolve:function(t){i&&i(t)},reject:function(t){s&&s(t)},cancel:function(){i=null,s=null}}}
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
5
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
6
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
|
|
8
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
9
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
10
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
11
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
12
|
+
|
|
13
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
14
|
+
and limitations under the License.
|
|
15
|
+
***************************************************************************** */
|
|
16
|
+
var b=function(){return(b=Object.assign||function(t){for(var i,s=1,e=arguments.length;s<e;s++)for(var n in i=arguments[s])Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n]);return t}).apply(this,arguments)},w={key:function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return null},onlyResolvesLast:!0},C=function(){function t(t){this.config=t,this.debounceSingleton=null,this.debounceCache={}}return t.prototype._createDebouncedFunction=function(){var t,i,s=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},e=void 0,n=void 0,h=void 0,r=[];return function(){var l=v(i),a=(new Date).getTime(),c=!e||a-e>l;e=a;for(var u=arguments.length,d=Array(u),f=0;f<u;f++)d[f]=arguments[f];if(c&&s.leading)return s.accumulate?Promise.resolve(t.call(this,[d])).then((function(t){return t[0]})):Promise.resolve(t.call.apply(t,[this].concat(d)));if(n?clearTimeout(h):n=y(),r.push(d),h=setTimeout(o.bind(this),l),s.accumulate){var p=r.length-1;return n.promise.then((function(t){return t[p]}))}return n.promise};function o(){var i=n;clearTimeout(h),Promise.resolve(s.accumulate?t.call(this,r):t.apply(this,r[r.length-1])).then(i.resolve,i.reject),r=[],n=null}}(this.config.func,this.config.wait,this.config.options);return this.config.options.onlyResolvesLast&&(t=s,i=null,s=function(){for(var s=[],e=0;e<arguments.length;e++)s[e]=arguments[e];i&&i();var n=g(t.apply(void 0,s));return i=n.cancel,n.promise}),{func:s}},t.prototype.getDebouncedFunction=function(t){var i,s=(i=this.config.options).key.apply(i,t);return null==s?(this.debounceSingleton||(this.debounceSingleton=this._createDebouncedFunction()),this.debounceSingleton):(this.debounceCache[s]||(this.debounceCache[s]=this._createDebouncedFunction()),this.debounceCache[s])},t}();let D=class{constructor(s){t(this,s),this.change=i(this,"change",7),this.interact=i(this,"interact",7),this.action=i(this,"action",7),this.disabled=!1,this.readonly=!1,this.required=!1,this.multiple=!1,this.delimiter=null,this.actions=[],this.actionPosition="bottom",this.actionScrollBehavior="sticky",this.textValue="",this.loading=!1,this.chips=[],this.chipSetEditMode=!1,this.handleTextInput=this.handleTextInput.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleDropdownKeyDown=this.handleDropdownKeyDown.bind(this),this.handleInputFieldFocus=this.handleInputFieldFocus.bind(this),this.handleChange=this.handleChange.bind(this),this.handleInteract=this.handleInteract.bind(this),this.handleListChange=this.handleListChange.bind(this),this.handleActionListChange=this.handleActionListChange.bind(this),this.handleStopEditAndBlur=this.handleStopEditAndBlur.bind(this),this.createDebouncedSearcher=this.createDebouncedSearcher.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.onListKeyDown=this.onListKeyDown.bind(this),this.portalId=m()}componentWillLoad(){this.chips=this.createChips(this.value)}componentDidLoad(){this.createDebouncedSearcher(this.searcher),this.chipSet=this.host.shadowRoot.querySelector("limel-chip-set")}async componentWillUpdate(){this.chipSetEditMode=!1,this.chipSet&&(this.chipSetEditMode=await this.chipSet.getEditMode())}render(){this.chips.forEach((t=>{"iconBackgroundColor"in t&&t.iconBackgroundColor&&(t.iconFillColor="rgb(var(--color-white))")}));const t={};return this.multiple||(t.maxItems=1),[s("limel-chip-set",Object.assign({type:"input",label:this.label,leadingIcon:this.leadingIcon,value:this.chips,disabled:this.disabled,delimiter:this.renderDelimiter(),readonly:this.readonly,required:this.required,searchLabel:this.searchLabel,onInput:this.handleTextInput,onKeyDown:this.handleInputKeyDown,onChange:this.handleChange,onInteract:this.handleInteract,onStartEdit:this.handleInputFieldFocus,onStopEdit:this.handleStopEditAndBlur,emptyInputOnBlur:!1,clearAllButton:this.multiple},t)),this.renderDropdown()]}onChangeValue(){this.chips=this.createChips(this.value)}createDebouncedSearcher(t){var i,s,e;"function"==typeof t&&(this.debouncedSearch=(i=t,500,s=b({},w,undefined),e=new C({func:i,wait:500,options:s}),function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return e.getDebouncedFunction(t).func.apply(void 0,t)}))}renderDelimiter(){return this.multiple?this.delimiter:null}createChips(t){return t?this.multiple?t.map(this.createChip):[this.createChip(t)]:[]}createChip(t){return{id:`${t.value}`,text:t.text,removable:!0,icon:t.icon,iconBackgroundColor:t.iconColor,value:t}}renderDropdown(){const t=this.getDropdownContent(),i=[];if(this.shouldShowDropDownContent()){const s=this.getActionContent();"top"===this.actionPosition&&i.push(s),t&&i.push(t),"bottom"===this.actionPosition&&i.push(s)}return this.renderPortal(i)}getActionContent(){var t,i;return 0===(null!==(i=null===(t=this.actions)||void 0===t?void 0:t.length)&&void 0!==i?i:0)?null:[s("limel-list",{class:{"static-actions-list":!0,"is-on-top":"top"===this.actionPosition,"is-at-bottom":"bottom"===this.actionPosition,"has-position-sticky":"sticky"===this.actionScrollBehavior},badgeIcons:!0,type:"selectable",onChange:this.handleActionListChange,items:this.actions.map(this.removeUnusedPropertiesOnAction)})]}removeUnusedPropertiesOnAction(t){return Object.assign(Object.assign({},t),{actions:[]})}shouldShowDropDownContent(){return!this.isFull()&&!!this.chipSetEditMode}getDropdownContent(){if(this.shouldShowDropDownContent())return this.loading?this.renderSpinner():this.items&&this.items.length?this.renderListResult():this.renderEmptyMessage()}isFull(){return!this.multiple&&!!this.value}renderSpinner(){return s("div",{style:{width:"100%",display:"flex","align-items":"center","justify-content":"center",padding:"1rem 0"}},s("limel-spinner",{limeBranded:!1}))}renderEmptyMessage(){if(this.emptyResultMessage)return s("p",{style:{color:"var(--lime-light-grey, #{$lime-light-grey})","text-align":"center"}},this.emptyResultMessage)}renderListResult(){const t=this.items.some((t=>"icon"in t&&!!t.icon));return s("limel-list",{badgeIcons:t,onChange:this.handleListChange,onKeyDown:this.onListKeyDown,type:"selectable",items:this.items})}onListKeyDown(t){const i=[h,r,o].includes(t.key),s=[l,a,c].includes(t.keyCode);(i||s)&&this.chipSet.setFocus()}renderPortal(t=[]){const i=getComputedStyle(this.host).getPropertyValue("--dropdown-z-index");return s("limel-portal",{visible:t.length>0,containerId:this.portalId,inheritParentWidth:!0,containerStyle:{"z-index":i}},s("limel-menu-surface",{open:t.length>0,allowClicksElement:this.host,style:{"--menu-surface-width":"100%","max-height":"inherit",display:"flex"},onDismiss:this.handleCloseMenu},t))}handleStopEditAndBlur(){const t=this.host.shadowRoot.activeElement||document.activeElement,i=document.querySelector(`#${this.portalId}`);n(t,this.host)||n(t,i)||this.clearInputField()}async handleTextInput(t){t.stopPropagation();const i=t.detail;this.textValue=i,this.loading=!0;const s=""===i?this.searcher:this.debouncedSearch,e=await s(i);this.handleSearchResult(i,e)}handleListChange(t){var i;if(t.stopPropagation(),!this.value||this.value!==t.detail){let i=t.detail;this.multiple&&(i=[...this.value,t.detail]),this.change.emit(i),this.items=[]}this.multiple&&(null===(i=this.chipSet)||void 0===i||i.setFocus(!0))}handleActionListChange(t){t.stopPropagation(),t.detail&&(this.action.emit(t.detail.value),this.items=[])}async handleInputFieldFocus(){this.loading=!0;const t=this.textValue,i=await this.searcher(t);this.handleSearchResult(t,i)}handleChange(t){t.stopPropagation();let i=null;this.multiple&&(i=t.detail.map((t=>this.value.find((i=>`${i.value}`===t.id))))),this.change.emit(i)}handleInteract(t){t.stopPropagation(),this.interact.emit(t.detail?t.detail.value:t.detail)}handleInputKeyDown(t){const i=!(t.key!==h&&t.keyCode!==l||t.altKey||t.metaKey||t.shiftKey),s=t.key===u||t.keyCode===d,e=t.key===f||t.keyCode===p;if(!i&&!s&&!e)return;const n=document.querySelector(` #${this.portalId} limel-list`);n&&(t.preventDefault(),i||e?n.shadowRoot.querySelector(".mdc-deprecated-list-item:first-child").focus():s&&n.shadowRoot.querySelector(".mdc-deprecated-list-item:last-child").focus())}handleDropdownKeyDown(t){(t.key===r||t.keyCode===a)&&(t.preventDefault(),this.textValue="",this.chipSet.setFocus(!0))}handleSearchResult(t,i){if(t===this.textValue){if(this.items=i,this.multiple){const t=this.value;this.items=i.filter((i=>!t.includes(i)))}this.loading=!1}}handleCloseMenu(){this.clearInputField()}clearInputField(){this.chipSet.emptyInput(),this.textValue="",this.handleSearchResult("",[])}get host(){return e(this)}static get watchers(){return{value:["onChangeValue"],searcher:["createDebouncedSearcher"]}}};D.style=":host{position:relative;display:block}:host([hidden]){display:none}";export{D as limel_picker}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as s,g as e}from"./p-92146da6.js";import{c as r}from"./p-6c094f3f.js";import{z as o}from"./p-7c4d91f5.js";import"./p-acfbf7ac.js";import"./p-8bbe3720.js";import"./p-fc610f15.js";let n=class{constructor(s){t(this,s),this.cancel=i(this,"cancel",7),this.select=i(this,"select",7),this.items=[],this.disabled=!1,this.openDirection="right",this.open=!1,this.badgeIcons=!1,this.gridLayout=!1,this.setTriggerAttributes=t=>{const i={"aria-haspopup":!0,"aria-expanded":this.open,disabled:this.disabled,role:"button"};for(const[s,e]of Object.entries(i))e?t.setAttribute(s,String(e)):t.removeAttribute(s)},this.onClose=()=>{this.cancel.emit(),this.open=!1},this.onTriggerClick=t=>{t.stopPropagation(),this.disabled||(this.open=!this.open)},this.onListChange=t=>{this.items=this.items.map((i=>i===t.detail?t.detail:i)),this.select.emit(t.detail),this.open=!1},this.setListElement=t=>{this.list=t},this.focusMenuItem=()=>{var t;const i=this.list.shadowRoot.activeElement;null==i||i.blur();const s=this.items.filter(this.isMenuItem),e=Math.max(s.findIndex((t=>t.selected)),0);null===(t=Array.from(this.list.shadowRoot.querySelectorAll('[role="menuitem"]'))[e])||void 0===t||t.focus()},this.portalId=r()}componentDidLoad(){this.host.querySelector('[slot="trigger"]')||console.warn("Using limel-menu with the default trigger is deprecated. Please provide your own trigger element.")}openWatcher(){if(!this.open)return;const t=new IntersectionObserver((()=>{t.unobserve(this.list),this.focusMenuItem()}));t.observe(this.list)}render(){const t=this.getCssProperties(),i=getComputedStyle(this.host).getPropertyValue("--dropdown-z-index");return s("div",{class:"mdc-menu-surface--anchor",onClick:this.onTriggerClick},s("slot",{name:"trigger"}),s("limel-portal",{visible:this.open,containerId:this.portalId,openDirection:this.openDirection,position:"absolute",containerStyle:{"z-index":i}},s("limel-menu-surface",{open:this.open,onDismiss:this.onClose,style:t},s("limel-menu-list",{class:{"has-grid-layout has-interactive-items":this.gridLayout},items:this.items,type:"menu",badgeIcons:this.badgeIcons,onChange:this.onListChange,ref:this.setListElement}))))}componentDidRender(){this.host.shadowRoot.querySelector("slot").assignedElements().forEach(this.setTriggerAttributes)}getCssProperties(){const t=["--menu-surface-width","--list-grid-item-max-width","--list-grid-item-min-width","--list-grid-gap"],i=getComputedStyle(this.host),s=t.map((t=>i.getPropertyValue(t)));return o(t,s)}isMenuItem(t){return!("separator"in t)}get host(){return e(this)}static get watchers(){return{open:["openWatcher"]}}};n.style=":host{display:inline-block}: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}";export{n as limel_menu}
|
|
@@ -11,13 +11,6 @@ import { ListSeparator, MenuItem, OpenDirection } from '@limetech/lime-elements'
|
|
|
11
11
|
* @exampleComponent limel-example-menu-hotkeys
|
|
12
12
|
*/
|
|
13
13
|
export declare class Menu {
|
|
14
|
-
/**
|
|
15
|
-
* Is displayed on the default trigger button.
|
|
16
|
-
*
|
|
17
|
-
* @deprecated Use with default trigger has been deprecated.
|
|
18
|
-
* Please supply your own trigger element.
|
|
19
|
-
*/
|
|
20
|
-
label: string;
|
|
21
14
|
/**
|
|
22
15
|
* A list of items and separators to show in the menu.
|
|
23
16
|
*/
|
|
@@ -42,14 +35,6 @@ export declare class Menu {
|
|
|
42
35
|
* Renders list items in a grid layout, rather than a vertical list
|
|
43
36
|
*/
|
|
44
37
|
gridLayout: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Defines whether the menu should have a fixed position on the screen.
|
|
47
|
-
*
|
|
48
|
-
* @deprecated Fixed position was used to get around a bug in the placement
|
|
49
|
-
* of the menu. This bug has since been fixed, which makes this attribute
|
|
50
|
-
* obsolete.
|
|
51
|
-
*/
|
|
52
|
-
fixed: boolean;
|
|
53
38
|
/**
|
|
54
39
|
* Is emitted when the menu is cancelled.
|
|
55
40
|
*/
|
|
@@ -66,12 +51,10 @@ export declare class Menu {
|
|
|
66
51
|
protected openWatcher(): void;
|
|
67
52
|
render(): any;
|
|
68
53
|
componentDidRender(): void;
|
|
69
|
-
private renderTrigger;
|
|
70
54
|
private setTriggerAttributes;
|
|
71
55
|
private onClose;
|
|
72
56
|
private onTriggerClick;
|
|
73
57
|
private onListChange;
|
|
74
|
-
private getPortalPosition;
|
|
75
58
|
private getCssProperties;
|
|
76
59
|
private setListElement;
|
|
77
60
|
private focusMenuItem;
|
|
@@ -56,14 +56,6 @@ export declare class Picker {
|
|
|
56
56
|
* Sets delimiters between chips. Works only when `multiple` is `true`.
|
|
57
57
|
*/
|
|
58
58
|
delimiter: string;
|
|
59
|
-
/**
|
|
60
|
-
* True if the dropdown list should be displayed without cutting the content
|
|
61
|
-
*
|
|
62
|
-
* @deprecated This was used for a workaround, and isn't needed any
|
|
63
|
-
* longer. Setting it has no effect, and the property will be removed
|
|
64
|
-
* in the next major version.
|
|
65
|
-
*/
|
|
66
|
-
displayFullList: boolean;
|
|
67
59
|
/**
|
|
68
60
|
* Static actions that can be clicked by the user.
|
|
69
61
|
*/
|
|
@@ -561,11 +561,6 @@ export namespace Components {
|
|
|
561
561
|
* Sets the disabled state of the menu.
|
|
562
562
|
*/
|
|
563
563
|
"disabled": boolean;
|
|
564
|
-
/**
|
|
565
|
-
* Defines whether the menu should have a fixed position on the screen.
|
|
566
|
-
* @deprecated Fixed position was used to get around a bug in the placement of the menu. This bug has since been fixed, which makes this attribute obsolete.
|
|
567
|
-
*/
|
|
568
|
-
"fixed": boolean;
|
|
569
564
|
/**
|
|
570
565
|
* Renders list items in a grid layout, rather than a vertical list
|
|
571
566
|
*/
|
|
@@ -574,11 +569,6 @@ export namespace Components {
|
|
|
574
569
|
* A list of items and separators to show in the menu.
|
|
575
570
|
*/
|
|
576
571
|
"items": Array<MenuItem | ListSeparator>;
|
|
577
|
-
/**
|
|
578
|
-
* Is displayed on the default trigger button.
|
|
579
|
-
* @deprecated Use with default trigger has been deprecated. Please supply your own trigger element.
|
|
580
|
-
*/
|
|
581
|
-
"label": string;
|
|
582
572
|
/**
|
|
583
573
|
* Sets the open state of the menu.
|
|
584
574
|
*/
|
|
@@ -641,11 +631,6 @@ export namespace Components {
|
|
|
641
631
|
* True if the picker should be disabled
|
|
642
632
|
*/
|
|
643
633
|
"disabled": boolean;
|
|
644
|
-
/**
|
|
645
|
-
* True if the dropdown list should be displayed without cutting the content
|
|
646
|
-
* @deprecated This was used for a workaround, and isn't needed any longer. Setting it has no effect, and the property will be removed in the next major version.
|
|
647
|
-
*/
|
|
648
|
-
"displayFullList": boolean;
|
|
649
634
|
/**
|
|
650
635
|
* A message to display when the search returned an empty result
|
|
651
636
|
*/
|
|
@@ -1879,11 +1864,6 @@ declare namespace LocalJSX {
|
|
|
1879
1864
|
* Sets the disabled state of the menu.
|
|
1880
1865
|
*/
|
|
1881
1866
|
"disabled"?: boolean;
|
|
1882
|
-
/**
|
|
1883
|
-
* Defines whether the menu should have a fixed position on the screen.
|
|
1884
|
-
* @deprecated Fixed position was used to get around a bug in the placement of the menu. This bug has since been fixed, which makes this attribute obsolete.
|
|
1885
|
-
*/
|
|
1886
|
-
"fixed"?: boolean;
|
|
1887
1867
|
/**
|
|
1888
1868
|
* Renders list items in a grid layout, rather than a vertical list
|
|
1889
1869
|
*/
|
|
@@ -1892,11 +1872,6 @@ declare namespace LocalJSX {
|
|
|
1892
1872
|
* A list of items and separators to show in the menu.
|
|
1893
1873
|
*/
|
|
1894
1874
|
"items"?: Array<MenuItem | ListSeparator>;
|
|
1895
|
-
/**
|
|
1896
|
-
* Is displayed on the default trigger button.
|
|
1897
|
-
* @deprecated Use with default trigger has been deprecated. Please supply your own trigger element.
|
|
1898
|
-
*/
|
|
1899
|
-
"label"?: string;
|
|
1900
1875
|
/**
|
|
1901
1876
|
* Is emitted when the menu is cancelled.
|
|
1902
1877
|
*/
|
|
@@ -1979,11 +1954,6 @@ declare namespace LocalJSX {
|
|
|
1979
1954
|
* True if the picker should be disabled
|
|
1980
1955
|
*/
|
|
1981
1956
|
"disabled"?: boolean;
|
|
1982
|
-
/**
|
|
1983
|
-
* True if the dropdown list should be displayed without cutting the content
|
|
1984
|
-
* @deprecated This was used for a workaround, and isn't needed any longer. Setting it has no effect, and the property will be removed in the next major version.
|
|
1985
|
-
*/
|
|
1986
|
-
"displayFullList"?: boolean;
|
|
1987
1957
|
/**
|
|
1988
1958
|
* A message to display when the search returned an empty result
|
|
1989
1959
|
*/
|
package/package.json
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,g as e}from"./p-92146da6.js";import{i as n}from"./p-0534b23b.js";import{T as h,b as r,E as o,c as l,d as a,a as c,A as u,e as d,f,g as p}from"./p-216ffe20.js";import{c as m}from"./p-6c094f3f.js";function v(t){return"function"==typeof t?t():t}function y(){var t={};return t.promise=new Promise((function(i,s){t.resolve=i,t.reject=s})),t}function g(t){var i=null,s=null,e=new Promise((function(t,e){i=t,s=e}));return t&&t.then((function(t){i&&i(t)}),(function(t){s&&s(t)})),{promise:e,resolve:function(t){i&&i(t)},reject:function(t){s&&s(t)},cancel:function(){i=null,s=null}}}
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
5
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
6
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
|
|
8
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
9
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
10
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
11
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
12
|
-
|
|
13
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
14
|
-
and limitations under the License.
|
|
15
|
-
***************************************************************************** */
|
|
16
|
-
var b=function(){return(b=Object.assign||function(t){for(var i,s=1,e=arguments.length;s<e;s++)for(var n in i=arguments[s])Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n]);return t}).apply(this,arguments)},w={key:function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return null},onlyResolvesLast:!0},C=function(){function t(t){this.config=t,this.debounceSingleton=null,this.debounceCache={}}return t.prototype._createDebouncedFunction=function(){var t,i,s=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},e=void 0,n=void 0,h=void 0,r=[];return function(){var l=v(i),a=(new Date).getTime(),c=!e||a-e>l;e=a;for(var u=arguments.length,d=Array(u),f=0;f<u;f++)d[f]=arguments[f];if(c&&s.leading)return s.accumulate?Promise.resolve(t.call(this,[d])).then((function(t){return t[0]})):Promise.resolve(t.call.apply(t,[this].concat(d)));if(n?clearTimeout(h):n=y(),r.push(d),h=setTimeout(o.bind(this),l),s.accumulate){var p=r.length-1;return n.promise.then((function(t){return t[p]}))}return n.promise};function o(){var i=n;clearTimeout(h),Promise.resolve(s.accumulate?t.call(this,r):t.apply(this,r[r.length-1])).then(i.resolve,i.reject),r=[],n=null}}(this.config.func,this.config.wait,this.config.options);return this.config.options.onlyResolvesLast&&(t=s,i=null,s=function(){for(var s=[],e=0;e<arguments.length;e++)s[e]=arguments[e];i&&i();var n=g(t.apply(void 0,s));return i=n.cancel,n.promise}),{func:s}},t.prototype.getDebouncedFunction=function(t){var i,s=(i=this.config.options).key.apply(i,t);return null==s?(this.debounceSingleton||(this.debounceSingleton=this._createDebouncedFunction()),this.debounceSingleton):(this.debounceCache[s]||(this.debounceCache[s]=this._createDebouncedFunction()),this.debounceCache[s])},t}();let D=class{constructor(s){t(this,s),this.change=i(this,"change",7),this.interact=i(this,"interact",7),this.action=i(this,"action",7),this.disabled=!1,this.readonly=!1,this.required=!1,this.multiple=!1,this.delimiter=null,this.displayFullList=!1,this.actions=[],this.actionPosition="bottom",this.actionScrollBehavior="sticky",this.textValue="",this.loading=!1,this.chips=[],this.chipSetEditMode=!1,this.handleTextInput=this.handleTextInput.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleDropdownKeyDown=this.handleDropdownKeyDown.bind(this),this.handleInputFieldFocus=this.handleInputFieldFocus.bind(this),this.handleChange=this.handleChange.bind(this),this.handleInteract=this.handleInteract.bind(this),this.handleListChange=this.handleListChange.bind(this),this.handleActionListChange=this.handleActionListChange.bind(this),this.handleStopEditAndBlur=this.handleStopEditAndBlur.bind(this),this.createDebouncedSearcher=this.createDebouncedSearcher.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.onListKeyDown=this.onListKeyDown.bind(this),this.portalId=m()}componentWillLoad(){this.chips=this.createChips(this.value)}componentDidLoad(){this.createDebouncedSearcher(this.searcher),this.chipSet=this.host.shadowRoot.querySelector("limel-chip-set")}async componentWillUpdate(){this.chipSetEditMode=!1,this.chipSet&&(this.chipSetEditMode=await this.chipSet.getEditMode())}render(){this.chips.forEach((t=>{"iconBackgroundColor"in t&&t.iconBackgroundColor&&(t.iconFillColor="rgb(var(--color-white))")}));const t={};return this.multiple||(t.maxItems=1),[s("limel-chip-set",Object.assign({type:"input",label:this.label,leadingIcon:this.leadingIcon,value:this.chips,disabled:this.disabled,delimiter:this.renderDelimiter(),readonly:this.readonly,required:this.required,searchLabel:this.searchLabel,onInput:this.handleTextInput,onKeyDown:this.handleInputKeyDown,onChange:this.handleChange,onInteract:this.handleInteract,onStartEdit:this.handleInputFieldFocus,onStopEdit:this.handleStopEditAndBlur,emptyInputOnBlur:!1,clearAllButton:this.multiple},t)),this.renderDropdown()]}onChangeValue(){this.chips=this.createChips(this.value)}createDebouncedSearcher(t){var i,s,e;"function"==typeof t&&(this.debouncedSearch=(i=t,500,s=b({},w,undefined),e=new C({func:i,wait:500,options:s}),function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return e.getDebouncedFunction(t).func.apply(void 0,t)}))}renderDelimiter(){return this.multiple?this.delimiter:null}createChips(t){return t?this.multiple?t.map(this.createChip):[this.createChip(t)]:[]}createChip(t){return{id:`${t.value}`,text:t.text,removable:!0,icon:t.icon,iconBackgroundColor:t.iconColor,value:t}}renderDropdown(){const t=this.getDropdownContent(),i=[];if(this.shouldShowDropDownContent()){const s=this.getActionContent();"top"===this.actionPosition&&i.push(s),t&&i.push(t),"bottom"===this.actionPosition&&i.push(s)}return this.renderPortal(i)}getActionContent(){var t,i;return 0===(null!==(i=null===(t=this.actions)||void 0===t?void 0:t.length)&&void 0!==i?i:0)?null:[s("limel-list",{class:{"static-actions-list":!0,"is-on-top":"top"===this.actionPosition,"is-at-bottom":"bottom"===this.actionPosition,"has-position-sticky":"sticky"===this.actionScrollBehavior},badgeIcons:!0,type:"selectable",onChange:this.handleActionListChange,items:this.actions.map(this.removeUnusedPropertiesOnAction)})]}removeUnusedPropertiesOnAction(t){return Object.assign(Object.assign({},t),{actions:[]})}shouldShowDropDownContent(){return!this.isFull()&&!!this.chipSetEditMode}getDropdownContent(){if(this.shouldShowDropDownContent())return this.loading?this.renderSpinner():this.items&&this.items.length?this.renderListResult():this.renderEmptyMessage()}isFull(){return!this.multiple&&!!this.value}renderSpinner(){return s("div",{style:{width:"100%",display:"flex","align-items":"center","justify-content":"center",padding:"1rem 0"}},s("limel-spinner",{limeBranded:!1}))}renderEmptyMessage(){if(this.emptyResultMessage)return s("p",{style:{color:"var(--lime-light-grey, #{$lime-light-grey})","text-align":"center"}},this.emptyResultMessage)}renderListResult(){const t=this.items.some((t=>"icon"in t&&!!t.icon));return s("limel-list",{badgeIcons:t,onChange:this.handleListChange,onKeyDown:this.onListKeyDown,type:"selectable",items:this.items})}onListKeyDown(t){const i=[h,r,o].includes(t.key),s=[l,a,c].includes(t.keyCode);(i||s)&&this.chipSet.setFocus()}renderPortal(t=[]){const i=getComputedStyle(this.host).getPropertyValue("--dropdown-z-index");return s("limel-portal",{visible:t.length>0,containerId:this.portalId,inheritParentWidth:!0,containerStyle:{"z-index":i}},s("limel-menu-surface",{open:t.length>0,allowClicksElement:this.host,style:{"--menu-surface-width":"100%","max-height":"inherit",display:"flex"},onDismiss:this.handleCloseMenu},t))}handleStopEditAndBlur(){const t=this.host.shadowRoot.activeElement||document.activeElement,i=document.querySelector(`#${this.portalId}`);n(t,this.host)||n(t,i)||this.clearInputField()}async handleTextInput(t){t.stopPropagation();const i=t.detail;this.textValue=i,this.loading=!0;const s=""===i?this.searcher:this.debouncedSearch,e=await s(i);this.handleSearchResult(i,e)}handleListChange(t){var i;if(t.stopPropagation(),!this.value||this.value!==t.detail){let i=t.detail;this.multiple&&(i=[...this.value,t.detail]),this.change.emit(i),this.items=[]}this.multiple&&(null===(i=this.chipSet)||void 0===i||i.setFocus(!0))}handleActionListChange(t){t.stopPropagation(),t.detail&&(this.action.emit(t.detail.value),this.items=[])}async handleInputFieldFocus(){this.loading=!0;const t=this.textValue,i=await this.searcher(t);this.handleSearchResult(t,i)}handleChange(t){t.stopPropagation();let i=null;this.multiple&&(i=t.detail.map((t=>this.value.find((i=>`${i.value}`===t.id))))),this.change.emit(i)}handleInteract(t){t.stopPropagation(),this.interact.emit(t.detail?t.detail.value:t.detail)}handleInputKeyDown(t){const i=!(t.key!==h&&t.keyCode!==l||t.altKey||t.metaKey||t.shiftKey),s=t.key===u||t.keyCode===d,e=t.key===f||t.keyCode===p;if(!i&&!s&&!e)return;const n=document.querySelector(` #${this.portalId} limel-list`);n&&(t.preventDefault(),i||e?n.shadowRoot.querySelector(".mdc-deprecated-list-item:first-child").focus():s&&n.shadowRoot.querySelector(".mdc-deprecated-list-item:last-child").focus())}handleDropdownKeyDown(t){(t.key===r||t.keyCode===a)&&(t.preventDefault(),this.textValue="",this.chipSet.setFocus(!0))}handleSearchResult(t,i){if(t===this.textValue){if(this.items=i,this.multiple){const t=this.value;this.items=i.filter((i=>!t.includes(i)))}this.loading=!1}}handleCloseMenu(){this.clearInputField()}clearInputField(){this.chipSet.emptyInput(),this.textValue="",this.handleSearchResult("",[])}get host(){return e(this)}static get watchers(){return{value:["onChangeValue"],searcher:["createDebouncedSearcher"]}}};D.style=":host{position:relative;display:block}:host([hidden]){display:none}";export{D as limel_picker}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,g as e}from"./p-92146da6.js";import{c as r}from"./p-6c094f3f.js";import{z as n}from"./p-7c4d91f5.js";import"./p-acfbf7ac.js";import"./p-8bbe3720.js";import"./p-fc610f15.js";let o=class{constructor(s){t(this,s),this.cancel=i(this,"cancel",7),this.select=i(this,"select",7),this.label="",this.items=[],this.disabled=!1,this.openDirection="right",this.open=!1,this.badgeIcons=!1,this.gridLayout=!1,this.fixed=!1,this.setTriggerAttributes=t=>{const i={"aria-haspopup":!0,"aria-expanded":this.open,disabled:this.disabled,role:"button"};for(const[s,e]of Object.entries(i))e?t.setAttribute(s,String(e)):t.removeAttribute(s)},this.onClose=()=>{this.cancel.emit(),this.open=!1},this.onTriggerClick=t=>{t.stopPropagation(),this.disabled||(this.open=!this.open)},this.onListChange=t=>{this.items=this.items.map((i=>i===t.detail?t.detail:i)),this.select.emit(t.detail),this.open=!1},this.setListElement=t=>{this.list=t},this.focusMenuItem=()=>{var t;const i=this.list.shadowRoot.activeElement;null==i||i.blur();const s=this.items.filter(this.isMenuItem),e=Math.max(s.findIndex((t=>t.selected)),0);null===(t=Array.from(this.list.shadowRoot.querySelectorAll('[role="menuitem"]'))[e])||void 0===t||t.focus()},this.portalId=r()}componentDidLoad(){this.host.querySelector('[slot="trigger"]')||console.warn("Using limel-menu with the default trigger is deprecated. Please provide your own trigger element.")}openWatcher(){if(!this.open)return;const t=new IntersectionObserver((()=>{t.unobserve(this.list),this.focusMenuItem()}));t.observe(this.list)}render(){const t=this.getCssProperties(),i=getComputedStyle(this.host).getPropertyValue("--dropdown-z-index"),e={"limel-portal--fixed":this.fixed},r=this.getPortalPosition();return s("div",{class:"mdc-menu-surface--anchor",onClick:this.onTriggerClick},s("slot",{name:"trigger"},this.renderTrigger()),s("limel-portal",{class:e,style:r,visible:this.open,containerId:this.portalId,openDirection:this.openDirection,position:this.fixed?"fixed":"absolute",containerStyle:{"z-index":i}},s("limel-menu-surface",{open:this.open,onDismiss:this.onClose,style:t},s("limel-menu-list",{class:{"has-grid-layout has-interactive-items":this.gridLayout},items:this.items,type:"menu",badgeIcons:this.badgeIcons,onChange:this.onListChange,ref:this.setListElement}))))}componentDidRender(){this.host.shadowRoot.querySelector("slot").assignedElements().forEach(this.setTriggerAttributes)}renderTrigger(){return s("button",{class:`\n menu__trigger\n ${this.disabled?"":"menu__trigger-enabled"}\n `,disabled:this.disabled},s("span",null,this.label))}getPortalPosition(){if(!this.fixed)return{};const t=this.host.getBoundingClientRect(),i={top:`${t.y+t.height}px`,left:`${t.x}px`};return"left"===this.openDirection&&(i.left=`${t.x+t.width}px`),i}getCssProperties(){const t=["--menu-surface-width","--list-grid-item-max-width","--list-grid-item-min-width","--list-grid-gap"],i=getComputedStyle(this.host),s=t.map((t=>i.getPropertyValue(t)));return n(t,s)}isMenuItem(t){return!("separator"in t)}get host(){return e(this)}static get watchers(){return{open:["openWatcher"]}}};o.style=":host{display:inline-block}: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}";export{o as limel_menu}
|