@limetech/lime-elements 36.0.0-next.6 → 36.0.0-next.7
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-color-picker-palette_2.cjs.entry.js → limel-color-picker-palette.cjs.entry.js} +0 -112
- package/dist/cjs/limel-dock-button.cjs.entry.js +79 -0
- package/dist/cjs/limel-dock.cjs.entry.js +105 -0
- package/dist/cjs/{limel-list_3.cjs.entry.js → limel-list_2.cjs.entry.js} +0 -2018
- package/dist/cjs/limel-popover_4.cjs.entry.js +239 -0
- package/dist/cjs/limel-portal.cjs.entry.js +2024 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/dock/dock-button/dock-button.css +71 -0
- package/dist/collection/components/dock/dock-button/dock-button.js +187 -0
- package/dist/collection/components/dock/dock.css +107 -0
- package/dist/collection/components/dock/dock.js +254 -0
- package/dist/collection/components/dock/dock.types.js +1 -0
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/{limel-color-picker-palette_2.entry.js → limel-color-picker-palette.entry.js} +2 -113
- package/dist/esm/limel-dock-button.entry.js +75 -0
- package/dist/esm/limel-dock.entry.js +101 -0
- package/dist/esm/{limel-list_3.entry.js → limel-list_2.entry.js} +1 -2018
- package/dist/esm/limel-popover_4.entry.js +232 -0
- package/dist/esm/limel-portal.entry.js +2020 -0
- package/dist/esm/loader.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/p-009de50e.entry.js +1 -0
- package/dist/lime-elements/{p-08251941.entry.js → p-19f72dab.entry.js} +1 -1
- package/dist/lime-elements/p-93cd2268.entry.js +1 -0
- package/dist/lime-elements/p-b9af1b40.entry.js +1 -0
- package/dist/lime-elements/p-bd098a11.entry.js +1 -0
- package/dist/lime-elements/p-fabea4b5.entry.js +1 -0
- package/dist/types/components/dock/dock-button/dock-button.d.ts +36 -0
- package/dist/types/components/dock/dock.d.ts +71 -0
- package/dist/types/components/dock/dock.types.d.ts +53 -0
- package/dist/types/components.d.ts +108 -0
- package/dist/types/interface.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/limel-popover-surface.cjs.entry.js +0 -32
- package/dist/cjs/limel-tooltip_2.cjs.entry.js +0 -102
- package/dist/esm/limel-popover-surface.entry.js +0 -28
- package/dist/esm/limel-tooltip_2.entry.js +0 -97
- package/dist/lime-elements/p-22569fb6.entry.js +0 -1
- package/dist/lime-elements/p-705334c1.entry.js +0 -1
- package/dist/lime-elements/p-87453b45.entry.js +0 -1
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { Component, Event, h, Host, Prop, State, } from '@stencil/core';
|
|
2
|
+
const DEFAULT_MOBILE_BREAKPOINT = 700;
|
|
3
|
+
/**
|
|
4
|
+
* @exampleComponent limel-example-dock-basic
|
|
5
|
+
* @exampleComponent limel-example-dock-custom-component
|
|
6
|
+
* @exampleComponent limel-example-dock-mobile
|
|
7
|
+
* @exampleComponent limel-example-dock-expanded
|
|
8
|
+
* @exampleComponent limel-example-dock-colors-css
|
|
9
|
+
* @private
|
|
10
|
+
*/
|
|
11
|
+
export class Dock {
|
|
12
|
+
constructor() {
|
|
13
|
+
/**
|
|
14
|
+
* Items that are placed in the dock.
|
|
15
|
+
*/
|
|
16
|
+
this.dockItems = [];
|
|
17
|
+
/**
|
|
18
|
+
* Items that are placed at the bottom of the dock. (Or at the end in mobile
|
|
19
|
+
* layout.)
|
|
20
|
+
*/
|
|
21
|
+
this.dockFooterItems = [];
|
|
22
|
+
/**
|
|
23
|
+
* Defines the width of the component, when it loads.
|
|
24
|
+
* - `true`: shows both icons and labels of the Dock items.
|
|
25
|
+
* - `false`: only shows icons of the doc items, and displays
|
|
26
|
+
* their labels as tooltip.
|
|
27
|
+
*
|
|
28
|
+
* Note: when `useMobileLayout` is `true`, labels will always
|
|
29
|
+
* be shown as tooltips. Read more below…
|
|
30
|
+
*/
|
|
31
|
+
this.expanded = false;
|
|
32
|
+
/**
|
|
33
|
+
* Set to `false` if you do not want to allow end-users
|
|
34
|
+
* to exapnd or shrink the Dock. This will hide the
|
|
35
|
+
* expand/shrink button, and the only things that defines
|
|
36
|
+
* the layout will be the `expanded` property, and
|
|
37
|
+
* the `mobileBreakPoint`.
|
|
38
|
+
*/
|
|
39
|
+
this.allowResize = true;
|
|
40
|
+
/**
|
|
41
|
+
* Defines the breakpoint in pixles, at which the component will be rendered
|
|
42
|
+
* in a hoizontal layout. Default breakpoint is `700` pixels, which means
|
|
43
|
+
* when the screen size is smaller than `700px`, the component will automatically
|
|
44
|
+
* switch to a horizontal layout.
|
|
45
|
+
*/
|
|
46
|
+
this.mobileBreakPoint = DEFAULT_MOBILE_BREAKPOINT;
|
|
47
|
+
/**
|
|
48
|
+
* Is used to render the component horizontally, and place
|
|
49
|
+
* the Dock items in a row.
|
|
50
|
+
*/
|
|
51
|
+
this.useMobileLayout = false;
|
|
52
|
+
this.renderSeparator = () => {
|
|
53
|
+
return this.useMobileLayout ? null : h("span", { class: "footer-separator" });
|
|
54
|
+
};
|
|
55
|
+
this.renderDockItem = (item) => {
|
|
56
|
+
return (h("limel-dock-button", { class: {
|
|
57
|
+
'dock-item': true,
|
|
58
|
+
selected: item.selected,
|
|
59
|
+
}, item: item, expanded: this.expanded && !this.useMobileLayout, useMobileLayout: this.useMobileLayout, onInteract: this.handleDockItemClick }));
|
|
60
|
+
};
|
|
61
|
+
this.handleDockItemClick = (event) => {
|
|
62
|
+
if (!event.detail.selected) {
|
|
63
|
+
this.itemSelected.emit(event.detail);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
this.handleResize = () => {
|
|
67
|
+
if (window.innerWidth <= this.mobileBreakPoint) {
|
|
68
|
+
this.useMobileLayout = true;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
this.useMobileLayout = false;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
this.toggleDockWidth = () => {
|
|
75
|
+
this.expanded = !this.expanded;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
componentDidLoad() {
|
|
79
|
+
this.resizeObserver = new ResizeObserver(this.handleResize);
|
|
80
|
+
this.resizeObserver.observe(document.body);
|
|
81
|
+
}
|
|
82
|
+
disconnectedCallback() {
|
|
83
|
+
this.resizeObserver.disconnect();
|
|
84
|
+
}
|
|
85
|
+
render() {
|
|
86
|
+
return (h(Host, { class: {
|
|
87
|
+
dock: true,
|
|
88
|
+
expanded: this.expanded,
|
|
89
|
+
'has-mobile-layout': this.useMobileLayout,
|
|
90
|
+
} },
|
|
91
|
+
h("nav", { "aria-label": this.accessibleLabel },
|
|
92
|
+
this.dockItems.map(this.renderDockItem),
|
|
93
|
+
this.renderSeparator(),
|
|
94
|
+
this.dockFooterItems.map(this.renderDockItem)),
|
|
95
|
+
this.renderExpandShrinkToggle()));
|
|
96
|
+
}
|
|
97
|
+
renderExpandShrinkToggle() {
|
|
98
|
+
if (this.useMobileLayout || !this.allowResize) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
return (h("button", { class: {
|
|
102
|
+
'expand-shrink': true,
|
|
103
|
+
expanded: this.expanded,
|
|
104
|
+
}, onClick: this.toggleDockWidth },
|
|
105
|
+
h("limel-icon", { name: "angle_right" })));
|
|
106
|
+
}
|
|
107
|
+
static get is() { return "limel-dock"; }
|
|
108
|
+
static get encapsulation() { return "shadow"; }
|
|
109
|
+
static get originalStyleUrls() { return {
|
|
110
|
+
"$": ["dock.scss"]
|
|
111
|
+
}; }
|
|
112
|
+
static get styleUrls() { return {
|
|
113
|
+
"$": ["dock.css"]
|
|
114
|
+
}; }
|
|
115
|
+
static get properties() { return {
|
|
116
|
+
"dockItems": {
|
|
117
|
+
"type": "unknown",
|
|
118
|
+
"mutable": false,
|
|
119
|
+
"complexType": {
|
|
120
|
+
"original": "DockItem[]",
|
|
121
|
+
"resolved": "DockItem[]",
|
|
122
|
+
"references": {
|
|
123
|
+
"DockItem": {
|
|
124
|
+
"location": "import",
|
|
125
|
+
"path": "./dock.types"
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"required": false,
|
|
130
|
+
"optional": false,
|
|
131
|
+
"docs": {
|
|
132
|
+
"tags": [],
|
|
133
|
+
"text": "Items that are placed in the dock."
|
|
134
|
+
},
|
|
135
|
+
"defaultValue": "[]"
|
|
136
|
+
},
|
|
137
|
+
"dockFooterItems": {
|
|
138
|
+
"type": "unknown",
|
|
139
|
+
"mutable": false,
|
|
140
|
+
"complexType": {
|
|
141
|
+
"original": "DockItem[]",
|
|
142
|
+
"resolved": "DockItem[]",
|
|
143
|
+
"references": {
|
|
144
|
+
"DockItem": {
|
|
145
|
+
"location": "import",
|
|
146
|
+
"path": "./dock.types"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"required": false,
|
|
151
|
+
"optional": true,
|
|
152
|
+
"docs": {
|
|
153
|
+
"tags": [],
|
|
154
|
+
"text": "Items that are placed at the bottom of the dock. (Or at the end in mobile\nlayout.)"
|
|
155
|
+
},
|
|
156
|
+
"defaultValue": "[]"
|
|
157
|
+
},
|
|
158
|
+
"accessibleLabel": {
|
|
159
|
+
"type": "string",
|
|
160
|
+
"mutable": false,
|
|
161
|
+
"complexType": {
|
|
162
|
+
"original": "string",
|
|
163
|
+
"resolved": "string",
|
|
164
|
+
"references": {}
|
|
165
|
+
},
|
|
166
|
+
"required": false,
|
|
167
|
+
"optional": true,
|
|
168
|
+
"docs": {
|
|
169
|
+
"tags": [],
|
|
170
|
+
"text": "A label used to describe the purpose of the navigation element to users\nof assistive technologies, like screen readers. Especially useful when\nthere are multiple navigation elements in the user interface.\nExample value: \"Primary navigation\""
|
|
171
|
+
},
|
|
172
|
+
"attribute": "accessible-label",
|
|
173
|
+
"reflect": true
|
|
174
|
+
},
|
|
175
|
+
"expanded": {
|
|
176
|
+
"type": "boolean",
|
|
177
|
+
"mutable": false,
|
|
178
|
+
"complexType": {
|
|
179
|
+
"original": "boolean",
|
|
180
|
+
"resolved": "boolean",
|
|
181
|
+
"references": {}
|
|
182
|
+
},
|
|
183
|
+
"required": false,
|
|
184
|
+
"optional": true,
|
|
185
|
+
"docs": {
|
|
186
|
+
"tags": [],
|
|
187
|
+
"text": "Defines the width of the component, when it loads.\n- `true`: shows both icons and labels of the Dock items.\n- `false`: only shows icons of the doc items, and displays\ntheir labels as tooltip.\n\nNote: when `useMobileLayout` is `true`, labels will always\nbe shown as tooltips. Read more below\u2026"
|
|
188
|
+
},
|
|
189
|
+
"attribute": "expanded",
|
|
190
|
+
"reflect": true,
|
|
191
|
+
"defaultValue": "false"
|
|
192
|
+
},
|
|
193
|
+
"allowResize": {
|
|
194
|
+
"type": "boolean",
|
|
195
|
+
"mutable": false,
|
|
196
|
+
"complexType": {
|
|
197
|
+
"original": "boolean",
|
|
198
|
+
"resolved": "boolean",
|
|
199
|
+
"references": {}
|
|
200
|
+
},
|
|
201
|
+
"required": false,
|
|
202
|
+
"optional": true,
|
|
203
|
+
"docs": {
|
|
204
|
+
"tags": [],
|
|
205
|
+
"text": "Set to `false` if you do not want to allow end-users\nto exapnd or shrink the Dock. This will hide the\nexpand/shrink button, and the only things that defines\nthe layout will be the `expanded` property, and\nthe `mobileBreakPoint`."
|
|
206
|
+
},
|
|
207
|
+
"attribute": "allow-resize",
|
|
208
|
+
"reflect": true,
|
|
209
|
+
"defaultValue": "true"
|
|
210
|
+
},
|
|
211
|
+
"mobileBreakPoint": {
|
|
212
|
+
"type": "number",
|
|
213
|
+
"mutable": false,
|
|
214
|
+
"complexType": {
|
|
215
|
+
"original": "number",
|
|
216
|
+
"resolved": "number",
|
|
217
|
+
"references": {}
|
|
218
|
+
},
|
|
219
|
+
"required": false,
|
|
220
|
+
"optional": true,
|
|
221
|
+
"docs": {
|
|
222
|
+
"tags": [],
|
|
223
|
+
"text": "Defines the breakpoint in pixles, at which the component will be rendered\nin a hoizontal layout. Default breakpoint is `700` pixels, which means\nwhen the screen size is smaller than `700px`, the component will automatically\nswitch to a horizontal layout."
|
|
224
|
+
},
|
|
225
|
+
"attribute": "mobile-break-point",
|
|
226
|
+
"reflect": true,
|
|
227
|
+
"defaultValue": "DEFAULT_MOBILE_BREAKPOINT"
|
|
228
|
+
}
|
|
229
|
+
}; }
|
|
230
|
+
static get states() { return {
|
|
231
|
+
"useMobileLayout": {}
|
|
232
|
+
}; }
|
|
233
|
+
static get events() { return [{
|
|
234
|
+
"method": "itemSelected",
|
|
235
|
+
"name": "itemSelected",
|
|
236
|
+
"bubbles": true,
|
|
237
|
+
"cancelable": true,
|
|
238
|
+
"composed": true,
|
|
239
|
+
"docs": {
|
|
240
|
+
"tags": [],
|
|
241
|
+
"text": "Fired when a Dock item has been selected from the dock."
|
|
242
|
+
},
|
|
243
|
+
"complexType": {
|
|
244
|
+
"original": "DockItem",
|
|
245
|
+
"resolved": "DockItem",
|
|
246
|
+
"references": {
|
|
247
|
+
"DockItem": {
|
|
248
|
+
"location": "import",
|
|
249
|
+
"path": "./dock.types"
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}]; }
|
|
254
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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-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-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],"loadingFailed":[516,"loading-failed"],"justLoaded":[32]}]]],["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-
|
|
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-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],"loadingFailed":[516,"loading-failed"],"justLoaded":[32]}]]],["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-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"],"aggregates":[16],"selectable":[4],"selection":[16]}]]],["limel-banner",[[1,"limel-banner",{"message":[513],"icon":[513],"isOpen":[32],"open":[64],"close":[64]}]]],["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],"disabled":[4],"propsFactory":[16],"transformErrors":[16],"errors":[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-dock-button",[[0,"limel-dock-button",{"item":[16],"expanded":[516],"useMobileLayout":[516,"use-mobile-layout"],"isOpen":[32]}]]],["limel-input-field",[[1,"limel-input-field",{"disabled":[516],"readonly":[516],"invalid":[516],"label":[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-color-picker-palette",[[1,"limel-color-picker-palette",{"value":[513],"label":[513],"helperText":[513,"helper-text"],"required":[516]}]]],["limel-tab-bar",[[1,"limel-tab-bar",{"tabs":[1040],"canScrollLeft":[32],"canScrollRight":[32]},[[9,"resize","handleWindowResize"]]]]],["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-checkbox",[[1,"limel-checkbox",{"disabled":[516],"readonly":[516],"label":[513],"helperText":[513,"helper-text"],"checked":[516],"indeterminate":[516],"required":[516],"modified":[32]}]]],["limel-flatpickr-adapter",[[1,"limel-flatpickr-adapter",{"value":[16],"type":[1],"format":[1],"isOpen":[4,"is-open"],"inputElement":[16],"language":[1]}]]],["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-badge",[[1,"limel-badge",{"label":[514]}]]],["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-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-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]}]]],["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);
|
|
17
17
|
});
|
package/dist/esm/{limel-color-picker-palette_2.entry.js → limel-color-picker-palette.entry.js}
RENAMED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h
|
|
2
|
-
import { c as createRandomString } from './random-string-2246b81e.js';
|
|
3
|
-
import { b as ESCAPE } from './keycodes-9f971b46.js';
|
|
4
|
-
import { z as zipObject } from './zipObject-2bb1968e.js';
|
|
5
|
-
import './_assignValue-fb2bf80a.js';
|
|
6
|
-
import './_defineProperty-2105cb48.js';
|
|
7
|
-
import './_getNative-93d6bfe9.js';
|
|
8
|
-
import './eq-c1c7f528.js';
|
|
9
|
-
import './isObject-c74e273c.js';
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-11cd0b60.js';
|
|
10
2
|
|
|
11
3
|
const colors = [
|
|
12
4
|
'red',
|
|
@@ -78,107 +70,4 @@ const Palette = class {
|
|
|
78
70
|
};
|
|
79
71
|
Palette.style = colorPickerPaletteCss;
|
|
80
72
|
|
|
81
|
-
|
|
82
|
-
* Check if an element is a descendant of another
|
|
83
|
-
*
|
|
84
|
-
* If the child element is a descendant of a limel-portal, this function will
|
|
85
|
-
* go back through the portal and check the original tree recursively
|
|
86
|
-
*
|
|
87
|
-
* @param {HTMLElement} element the parent element
|
|
88
|
-
* @param {HTMLElement} child the child element to check
|
|
89
|
-
* @returns {boolean} `true` if child is a descendant of element, taking
|
|
90
|
-
* portals into account
|
|
91
|
-
*/
|
|
92
|
-
function portalContains(element, child) {
|
|
93
|
-
var _a;
|
|
94
|
-
if (element.contains(child) || ((_a = element.shadowRoot) === null || _a === void 0 ? void 0 : _a.contains(child))) {
|
|
95
|
-
return true;
|
|
96
|
-
}
|
|
97
|
-
const parent = findParent(child);
|
|
98
|
-
if (!parent) {
|
|
99
|
-
return false;
|
|
100
|
-
}
|
|
101
|
-
return portalContains(element, parent);
|
|
102
|
-
}
|
|
103
|
-
function findParent(element) {
|
|
104
|
-
const portal = element.closest('.limel-portal--container');
|
|
105
|
-
if (portal) {
|
|
106
|
-
return portal.portalSource;
|
|
107
|
-
}
|
|
108
|
-
const rootNode = element.getRootNode();
|
|
109
|
-
return rootNode.host;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const popoverCss = ".trigger-anchor{display:inline-block;position:relative}";
|
|
113
|
-
|
|
114
|
-
const Popover = class {
|
|
115
|
-
constructor(hostRef) {
|
|
116
|
-
registerInstance(this, hostRef);
|
|
117
|
-
this.close = createEvent(this, "close", 7);
|
|
118
|
-
/**
|
|
119
|
-
* True if the content within the popover should be visible
|
|
120
|
-
*/
|
|
121
|
-
this.open = false;
|
|
122
|
-
this.handleGlobalKeyPress = (event) => {
|
|
123
|
-
if (event.key !== ESCAPE) {
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
event.stopPropagation();
|
|
127
|
-
event.preventDefault();
|
|
128
|
-
this.close.emit();
|
|
129
|
-
};
|
|
130
|
-
this.portalId = createRandomString();
|
|
131
|
-
this.globalClickListener = this.globalClickListener.bind(this);
|
|
132
|
-
}
|
|
133
|
-
watchOpen() {
|
|
134
|
-
this.setupGlobalHandlers();
|
|
135
|
-
}
|
|
136
|
-
componentWillLoad() {
|
|
137
|
-
this.setupGlobalHandlers();
|
|
138
|
-
}
|
|
139
|
-
setupGlobalHandlers() {
|
|
140
|
-
if (this.open) {
|
|
141
|
-
document.addEventListener('click', this.globalClickListener, {
|
|
142
|
-
capture: true,
|
|
143
|
-
});
|
|
144
|
-
document.addEventListener('keyup', this.handleGlobalKeyPress);
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
document.removeEventListener('click', this.globalClickListener);
|
|
148
|
-
document.removeEventListener('keyup', this.handleGlobalKeyPress);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
render() {
|
|
152
|
-
const cssProperties = this.getCssProperties();
|
|
153
|
-
const popoverZIndex = getComputedStyle(this.host).getPropertyValue('--popover-z-index');
|
|
154
|
-
return (h("div", { class: "trigger-anchor" }, h("slot", { name: "trigger" }), h("limel-portal", { visible: this.open, containerId: this.portalId, containerStyle: { 'z-index': popoverZIndex }, openDirection: this.openDirection }, h("limel-popover-surface", { contentCollection: this.host.children, style: cssProperties }))));
|
|
155
|
-
}
|
|
156
|
-
globalClickListener(event) {
|
|
157
|
-
const element = event.target;
|
|
158
|
-
const clickedInside = portalContains(this.host, element);
|
|
159
|
-
if (this.open && !clickedInside) {
|
|
160
|
-
event.stopPropagation();
|
|
161
|
-
event.preventDefault();
|
|
162
|
-
this.close.emit();
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
getCssProperties() {
|
|
166
|
-
const propertyNames = [
|
|
167
|
-
'--popover-surface-width',
|
|
168
|
-
'--popover-body-background-color',
|
|
169
|
-
'--popover-border-radius',
|
|
170
|
-
];
|
|
171
|
-
const style = getComputedStyle(this.host);
|
|
172
|
-
const values = propertyNames.map((property) => {
|
|
173
|
-
return style.getPropertyValue(property);
|
|
174
|
-
});
|
|
175
|
-
return zipObject(propertyNames, values);
|
|
176
|
-
}
|
|
177
|
-
get host() { return getElement(this); }
|
|
178
|
-
static get watchers() { return {
|
|
179
|
-
"open": ["watchOpen"]
|
|
180
|
-
}; }
|
|
181
|
-
};
|
|
182
|
-
Popover.style = popoverCss;
|
|
183
|
-
|
|
184
|
-
export { Palette as limel_color_picker_palette, Popover as limel_popover };
|
|
73
|
+
export { Palette as limel_color_picker_palette };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-11cd0b60.js';
|
|
2
|
+
import { c as createRandomString } from './random-string-2246b81e.js';
|
|
3
|
+
|
|
4
|
+
const dockButtonCss = ".button{all:unset;box-sizing:border-box;display:flex;align-items:center;position:relative;width:100%;height:var(--dock-item-height);border-radius:0.375rem;font-size:0.875rem;padding:0 0.5rem;min-width:var(--dock-item-height);color:var(--limel-dock-item-text-color);background-color:var(--dock-background-color)}.button:focus-visible{box-shadow:var(--shadow-depth-8-focused)}.dock-item:not(.selected) .button:not(.disabled){cursor:pointer;transition:background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out}.dock-item:not(.selected) .button:not(.disabled):hover{box-shadow:var(--button-shadow-hovered)}.dock-item:not(.selected) .button:not(.disabled):active{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}.button:hover{z-index:1}.button.selected{color:var(--limel-dock-item-text-color--selected);background-color:var(--dock-item-background-color--selected, rgb(var(--contrast-200)));box-shadow:var(--button-shadow-inset)}.button.selected .icon{color:var(--limel-dock-item-text--selected)}limel-popover{display:grid}.text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding-left:0.5rem;padding-right:0.75rem}.icon{flex-shrink:0;width:calc(var(--dock-item-height) - 1rem);height:calc(var(--dock-item-height) - 1rem);color:var(--dock-item-icon-color--deselected, var(--limel-dock-item-text-color))}";
|
|
5
|
+
|
|
6
|
+
const DockButton = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
this.interact = createEvent(this, "interact", 7);
|
|
10
|
+
this.close = createEvent(this, "close", 7);
|
|
11
|
+
/**
|
|
12
|
+
* @inheritdoc
|
|
13
|
+
*/
|
|
14
|
+
this.expanded = false;
|
|
15
|
+
/**
|
|
16
|
+
* @inheritdoc
|
|
17
|
+
*/
|
|
18
|
+
this.useMobileLayout = false;
|
|
19
|
+
this.isOpen = false;
|
|
20
|
+
this.openPopover = (event) => {
|
|
21
|
+
event.stopPropagation();
|
|
22
|
+
this.isOpen = true;
|
|
23
|
+
};
|
|
24
|
+
this.onPopoverClose = () => {
|
|
25
|
+
this.isOpen = false;
|
|
26
|
+
this.close.emit();
|
|
27
|
+
};
|
|
28
|
+
this.handleClick = (event) => {
|
|
29
|
+
event.stopPropagation();
|
|
30
|
+
this.interact.emit(this.item);
|
|
31
|
+
};
|
|
32
|
+
this.tooltipId = createRandomString();
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
var _a, _b;
|
|
36
|
+
if ((_b = (_a = this.item) === null || _a === void 0 ? void 0 : _a.dockMenu) === null || _b === void 0 ? void 0 : _b.componentName) {
|
|
37
|
+
return this.renderPopover();
|
|
38
|
+
}
|
|
39
|
+
return this.renderButton(this.handleClick);
|
|
40
|
+
}
|
|
41
|
+
renderPopover() {
|
|
42
|
+
var _a;
|
|
43
|
+
const CustomComponent = (_a = this.item) === null || _a === void 0 ? void 0 : _a.dockMenu.componentName;
|
|
44
|
+
return (h("limel-popover", { openDirection: this.useMobileLayout ? 'top' : 'right', open: this.isOpen || this.item.dockMenu.menuOpen, onClose: this.onPopoverClose }, this.renderButton(this.openPopover, 'trigger'), h(CustomComponent, Object.assign({}, (this.item.dockMenu.props || {}), { onClose: this.onPopoverClose }))));
|
|
45
|
+
}
|
|
46
|
+
renderButton(handleClick, slot) {
|
|
47
|
+
var _a;
|
|
48
|
+
return (h("button", { slot: slot, tabindex: "0", id: this.tooltipId, type: "button", class: {
|
|
49
|
+
button: true,
|
|
50
|
+
selected: (_a = this.item) === null || _a === void 0 ? void 0 : _a.selected,
|
|
51
|
+
}, onClick: handleClick }, this.renderIcon(), this.renderLabel(), this.renderTooltip()));
|
|
52
|
+
}
|
|
53
|
+
renderIcon() {
|
|
54
|
+
if (!this.item.icon) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
return h("limel-icon", { name: this.item.icon, class: "icon" });
|
|
58
|
+
}
|
|
59
|
+
renderLabel() {
|
|
60
|
+
if (this.expanded) {
|
|
61
|
+
return h("span", { class: "text" }, this.item.label);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
renderTooltip() {
|
|
65
|
+
if (!this.expanded && this.item.label) {
|
|
66
|
+
return (h("limel-tooltip", { elementId: this.tooltipId, label: this.item.label, helperLabel: this.item.helperLabel }));
|
|
67
|
+
}
|
|
68
|
+
if (this.expanded && this.item.helperLabel) {
|
|
69
|
+
return (h("limel-tooltip", { elementId: this.tooltipId, label: this.item.helperLabel }));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
DockButton.style = dockButtonCss;
|
|
74
|
+
|
|
75
|
+
export { DockButton as limel_dock_button };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-11cd0b60.js';
|
|
2
|
+
|
|
3
|
+
const dockCss = ":host(limel-dock){--dock-item-height:2.75rem;--dock-padding:0.25rem;--dock-expand-shrink-button-height:1rem;--limel-dock-item-text-color:var(\n --dock-item-text-color--deselected,\n rgb(var(--contrast-1100))\n );--limel-dock-item-text-color--selected:var(\n --dock-item-text-color--selected,\n rgb(var(--contrast-1300))\n );isolation:isolate;position:relative;display:inline-flex;flex-direction:column;background-color:var(--dock-background-color, rgb(var(--contrast-100)));box-shadow:0.1875rem 0 0.375rem -0.125rem rgba(var(--color-black), 0.15), 0.1875rem 0 0.625rem -0.125rem rgba(var(--color-black), 0.05)}:host(limel-dock:not(.has-mobile-layout)){height:100%;width:calc(var(--dock-padding) * 2 + var(--dock-item-height))}:host(limel-dock.expanded){width:var(--dock-expanded-max-width, max-content)}.footer-separator{margin-top:auto;justify-self:flex-end}nav{box-sizing:border-box;display:inline-flex;flex-direction:column;gap:0.375rem;flex-grow:1;padding:var(--dock-padding);overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none}nav::-webkit-scrollbar{display:none}:host(limel-dock.has-mobile-layout) nav{justify-content:space-between;flex-direction:row}.expand-shrink{all:unset;box-sizing:border-box;transition:background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;cursor:pointer;display:flex;justify-content:center;align-items:center;height:var(--dock-expand-shrink-button-height);padding:0 0.5rem;margin:var(--dock-padding);border-radius:0.375rem}.expand-shrink:hover{box-shadow:var(--button-shadow-hovered)}.expand-shrink:active{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}.expand-shrink.expanded{justify-content:flex-end}.expand-shrink.expanded limel-icon{transform:rotateY(180deg)}.expand-shrink:focus-visible{box-shadow:var(--shadow-depth-8-focused)}.expand-shrink limel-icon{width:calc(var(--dock-expand-shrink-button-height) - 0.25rem);color:var(--dock-item-icon-color--deselected, var(--button-text))}";
|
|
4
|
+
|
|
5
|
+
const DEFAULT_MOBILE_BREAKPOINT = 700;
|
|
6
|
+
const Dock = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
this.itemSelected = createEvent(this, "itemSelected", 7);
|
|
10
|
+
/**
|
|
11
|
+
* Items that are placed in the dock.
|
|
12
|
+
*/
|
|
13
|
+
this.dockItems = [];
|
|
14
|
+
/**
|
|
15
|
+
* Items that are placed at the bottom of the dock. (Or at the end in mobile
|
|
16
|
+
* layout.)
|
|
17
|
+
*/
|
|
18
|
+
this.dockFooterItems = [];
|
|
19
|
+
/**
|
|
20
|
+
* Defines the width of the component, when it loads.
|
|
21
|
+
* - `true`: shows both icons and labels of the Dock items.
|
|
22
|
+
* - `false`: only shows icons of the doc items, and displays
|
|
23
|
+
* their labels as tooltip.
|
|
24
|
+
*
|
|
25
|
+
* Note: when `useMobileLayout` is `true`, labels will always
|
|
26
|
+
* be shown as tooltips. Read more below…
|
|
27
|
+
*/
|
|
28
|
+
this.expanded = false;
|
|
29
|
+
/**
|
|
30
|
+
* Set to `false` if you do not want to allow end-users
|
|
31
|
+
* to exapnd or shrink the Dock. This will hide the
|
|
32
|
+
* expand/shrink button, and the only things that defines
|
|
33
|
+
* the layout will be the `expanded` property, and
|
|
34
|
+
* the `mobileBreakPoint`.
|
|
35
|
+
*/
|
|
36
|
+
this.allowResize = true;
|
|
37
|
+
/**
|
|
38
|
+
* Defines the breakpoint in pixles, at which the component will be rendered
|
|
39
|
+
* in a hoizontal layout. Default breakpoint is `700` pixels, which means
|
|
40
|
+
* when the screen size is smaller than `700px`, the component will automatically
|
|
41
|
+
* switch to a horizontal layout.
|
|
42
|
+
*/
|
|
43
|
+
this.mobileBreakPoint = DEFAULT_MOBILE_BREAKPOINT;
|
|
44
|
+
/**
|
|
45
|
+
* Is used to render the component horizontally, and place
|
|
46
|
+
* the Dock items in a row.
|
|
47
|
+
*/
|
|
48
|
+
this.useMobileLayout = false;
|
|
49
|
+
this.renderSeparator = () => {
|
|
50
|
+
return this.useMobileLayout ? null : h("span", { class: "footer-separator" });
|
|
51
|
+
};
|
|
52
|
+
this.renderDockItem = (item) => {
|
|
53
|
+
return (h("limel-dock-button", { class: {
|
|
54
|
+
'dock-item': true,
|
|
55
|
+
selected: item.selected,
|
|
56
|
+
}, item: item, expanded: this.expanded && !this.useMobileLayout, useMobileLayout: this.useMobileLayout, onInteract: this.handleDockItemClick }));
|
|
57
|
+
};
|
|
58
|
+
this.handleDockItemClick = (event) => {
|
|
59
|
+
if (!event.detail.selected) {
|
|
60
|
+
this.itemSelected.emit(event.detail);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
this.handleResize = () => {
|
|
64
|
+
if (window.innerWidth <= this.mobileBreakPoint) {
|
|
65
|
+
this.useMobileLayout = true;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
this.useMobileLayout = false;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
this.toggleDockWidth = () => {
|
|
72
|
+
this.expanded = !this.expanded;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
componentDidLoad() {
|
|
76
|
+
this.resizeObserver = new ResizeObserver(this.handleResize);
|
|
77
|
+
this.resizeObserver.observe(document.body);
|
|
78
|
+
}
|
|
79
|
+
disconnectedCallback() {
|
|
80
|
+
this.resizeObserver.disconnect();
|
|
81
|
+
}
|
|
82
|
+
render() {
|
|
83
|
+
return (h(Host, { class: {
|
|
84
|
+
dock: true,
|
|
85
|
+
expanded: this.expanded,
|
|
86
|
+
'has-mobile-layout': this.useMobileLayout,
|
|
87
|
+
} }, h("nav", { "aria-label": this.accessibleLabel }, this.dockItems.map(this.renderDockItem), this.renderSeparator(), this.dockFooterItems.map(this.renderDockItem)), this.renderExpandShrinkToggle()));
|
|
88
|
+
}
|
|
89
|
+
renderExpandShrinkToggle() {
|
|
90
|
+
if (this.useMobileLayout || !this.allowResize) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
return (h("button", { class: {
|
|
94
|
+
'expand-shrink': true,
|
|
95
|
+
expanded: this.expanded,
|
|
96
|
+
}, onClick: this.toggleDockWidth }, h("limel-icon", { name: "angle_right" })));
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
Dock.style = dockCss;
|
|
100
|
+
|
|
101
|
+
export { Dock as limel_dock };
|