@limetech/lime-elements 36.0.0-next.2 → 36.0.0-next.22
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/{dateFormatter-05d80b12.js → dateFormatter-d7a8d40d.js} +1 -1
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-button.cjs.entry.js +32 -16
- package/dist/cjs/limel-chip-set.cjs.entry.js +1 -3
- package/dist/cjs/limel-code-editor.cjs.entry.js +1588 -2
- package/dist/cjs/{limel-color-picker-palette_2.cjs.entry.js → limel-color-picker-palette.cjs.entry.js} +0 -112
- package/dist/cjs/limel-date-picker.cjs.entry.js +3 -3
- package/dist/cjs/limel-dock-button.cjs.entry.js +86 -0
- package/dist/cjs/limel-dock.cjs.entry.js +104 -0
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +5 -11
- package/dist/cjs/limel-form.cjs.entry.js +1 -1
- package/dist/cjs/limel-icon-button.cjs.entry.js +2 -35
- package/dist/cjs/limel-input-field.cjs.entry.js +13 -6
- 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/limel-select.cjs.entry.js +4 -5
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{moment-5cfac5cd.js → moment-d1e35cdc.js} +2 -2
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/button/button.css +40 -4
- package/dist/collection/components/button/button.js +56 -20
- package/dist/collection/components/chip-set/chip-set.js +1 -3
- package/dist/collection/components/code-editor/code-editor.css +153 -1
- package/dist/collection/components/code-editor/code-editor.js +82 -2
- package/dist/collection/components/date-picker/date-picker.js +18 -1
- package/dist/collection/components/date-picker/pickers/MonthPicker.js +1 -3
- package/dist/collection/components/date-picker/pickers/QuarterPicker.js +1 -3
- package/dist/collection/components/date-picker/pickers/YearPicker.js +1 -3
- package/dist/collection/components/dock/dock-button/dock-button.css +72 -0
- package/dist/collection/components/dock/dock-button/dock-button.js +204 -0
- package/dist/collection/components/dock/dock.css +107 -0
- package/dist/collection/components/dock/dock.js +300 -0
- package/dist/collection/components/dock/dock.types.js +1 -0
- package/dist/collection/components/icon-button/icon-button.css +21 -20
- package/dist/collection/components/icon-button/icon-button.js +2 -52
- package/dist/collection/components/input-field/input-field.js +32 -7
- package/dist/collection/components/select/select.css +8 -10
- package/dist/collection/components/select/select.template.js +3 -4
- package/dist/collection/style/internal/codemirror-tooltip.scss +19 -0
- package/dist/esm/{dateFormatter-2cad0292.js → dateFormatter-784c3334.js} +1 -1
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-button.entry.js +33 -17
- package/dist/esm/limel-chip-set.entry.js +1 -3
- package/dist/esm/limel-code-editor.entry.js +1588 -2
- package/dist/esm/{limel-color-picker-palette_2.entry.js → limel-color-picker-palette.entry.js} +2 -113
- package/dist/esm/limel-date-picker.entry.js +3 -3
- package/dist/esm/limel-dock-button.entry.js +82 -0
- package/dist/esm/limel-dock.entry.js +100 -0
- package/dist/esm/limel-flatpickr-adapter.entry.js +5 -11
- package/dist/esm/limel-form.entry.js +1 -1
- package/dist/esm/limel-icon-button.entry.js +2 -35
- package/dist/esm/limel-input-field.entry.js +13 -6
- 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/limel-select.entry.js +4 -5
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{moment-367e51c5.js → moment-faa8a4a8.js} +2 -2
- package/dist/lime-elements/lime-elements.css +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-0aedee4b.entry.js +1 -0
- package/dist/lime-elements/{p-7e571ec6.entry.js → p-0ba0c38a.entry.js} +1 -1
- package/dist/lime-elements/{p-08251941.entry.js → p-19f72dab.entry.js} +1 -1
- package/dist/lime-elements/p-1dfccbc5.entry.js +1 -0
- package/dist/lime-elements/p-212895da.entry.js +1 -0
- package/dist/lime-elements/p-457cf741.entry.js +37 -0
- package/dist/lime-elements/p-6b1bc80f.entry.js +1 -0
- package/dist/lime-elements/{p-d76f896d.js → p-73df4d83.js} +1 -1
- package/dist/lime-elements/p-93cd2268.entry.js +1 -0
- package/dist/lime-elements/p-93f42a32.entry.js +1 -0
- package/dist/lime-elements/p-945afca2.js +3 -0
- package/dist/lime-elements/p-aaa11eb2.entry.js +1 -0
- package/dist/lime-elements/p-bd098a11.entry.js +1 -0
- package/dist/lime-elements/{p-af0ec482.entry.js → p-c544c05b.entry.js} +1 -1
- package/dist/lime-elements/p-f41567a1.entry.js +1 -0
- package/dist/lime-elements/style/internal/codemirror-tooltip.scss +19 -0
- package/dist/types/components/button/button.d.ts +10 -3
- package/dist/types/components/code-editor/code-editor.d.ts +14 -0
- package/dist/types/components/date-picker/date-picker.d.ts +4 -0
- package/dist/types/components/dock/dock-button/dock-button.d.ts +48 -0
- package/dist/types/components/dock/dock.d.ts +83 -0
- package/dist/types/components/dock/dock.types.d.ts +53 -0
- package/dist/types/components/icon-button/icon-button.d.ts +0 -11
- package/dist/types/components/input-field/input-field.d.ts +6 -0
- package/dist/types/components.d.ts +167 -4
- package/dist/types/interface.d.ts +1 -0
- package/package.json +5 -5
- 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-3af5f9ad.js +0 -3
- package/dist/lime-elements/p-404e1465.entry.js +0 -1
- package/dist/lime-elements/p-6966b5df.entry.js +0 -1
- package/dist/lime-elements/p-705334c1.entry.js +0 -1
- package/dist/lime-elements/p-75152d89.entry.js +0 -1
- package/dist/lime-elements/p-7ee4b825.entry.js +0 -1
- package/dist/lime-elements/p-87453b45.entry.js +0 -1
- package/dist/lime-elements/p-bd8c9384.entry.js +0 -1
- package/dist/lime-elements/p-d1ee4501.entry.js +0 -37
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 };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-11cd0b60.js';
|
|
2
2
|
import { c as createRandomString } from './random-string-2246b81e.js';
|
|
3
3
|
import { i as isIOSDevice, a as isAndroidDevice } from './device-39db3b5f.js';
|
|
4
|
-
import { D as DateFormatter } from './dateFormatter-
|
|
4
|
+
import { D as DateFormatter } from './dateFormatter-784c3334.js';
|
|
5
5
|
import { M as MDCTextField } from './component-288691f3.js';
|
|
6
6
|
import './_commonjsHelpers-5ec8f9b7.js';
|
|
7
|
-
import './moment-
|
|
7
|
+
import './moment-faa8a4a8.js';
|
|
8
8
|
import './component-410aad5a.js';
|
|
9
9
|
import './component-5b4ac85a.js';
|
|
10
10
|
import './ponyfill-30263d5e.js';
|
|
@@ -112,7 +112,7 @@ const DatePicker = class {
|
|
|
112
112
|
}
|
|
113
113
|
const dropdownZIndex = getComputedStyle(this.host).getPropertyValue('--dropdown-z-index');
|
|
114
114
|
return [
|
|
115
|
-
h("limel-input-field", Object.assign({ disabled: this.disabled, readonly: this.readonly, invalid: this.invalid, label: this.label, helperText: this.helperText, required: this.required, value: this.formattedValue, onFocus: this.showCalendar, onBlur: this.hideCalendar, onClick: this.onInputClick, onChange: this.handleInputElementChange, ref: (el) => (this.textField = el) }, inputProps)),
|
|
115
|
+
h("limel-input-field", Object.assign({ disabled: this.disabled, readonly: this.readonly, invalid: this.invalid, label: this.label, placeholder: this.placeholder, helperText: this.helperText, required: this.required, value: this.formattedValue, onFocus: this.showCalendar, onBlur: this.hideCalendar, onClick: this.onInputClick, onChange: this.handleInputElementChange, ref: (el) => (this.textField = el) }, inputProps)),
|
|
116
116
|
h("limel-portal", { containerId: this.portalId, visible: this.showPortal, containerStyle: { 'z-index': dropdownZIndex } }, h("limel-flatpickr-adapter", { format: this.internalFormat, language: this.language, type: this.type, value: this.value, ref: (el) => (this.datePickerCalendar = el), isOpen: this.showPortal, onChange: this.handleCalendarChange })),
|
|
117
117
|
];
|
|
118
118
|
}
|
|
@@ -0,0 +1,82 @@
|
|
|
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;grid-template-columns:100%}.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, var(--limel-dock-item-text-color))}";
|
|
5
|
+
|
|
6
|
+
const DockButton = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
this.itemSelected = createEvent(this, "itemSelected", 7);
|
|
10
|
+
this.menuOpen = createEvent(this, "menuOpen", 7);
|
|
11
|
+
this.close = createEvent(this, "close", 7);
|
|
12
|
+
/**
|
|
13
|
+
* When the dock is expanded or collapsed, dock items
|
|
14
|
+
* show labels and tooltips as suitable for the layout.
|
|
15
|
+
*/
|
|
16
|
+
this.expanded = false;
|
|
17
|
+
/**
|
|
18
|
+
* When dock is using mobile layout, dock items
|
|
19
|
+
* show labels and tooltips as suitable for the layout.
|
|
20
|
+
*/
|
|
21
|
+
this.useMobileLayout = false;
|
|
22
|
+
/**
|
|
23
|
+
* Indicated whether the popover that renders a component is open.
|
|
24
|
+
*/
|
|
25
|
+
this.isOpen = false;
|
|
26
|
+
this.openPopover = (event) => {
|
|
27
|
+
event.stopPropagation();
|
|
28
|
+
this.isOpen = true;
|
|
29
|
+
this.menuOpen.emit(this.item);
|
|
30
|
+
};
|
|
31
|
+
this.onPopoverClose = () => {
|
|
32
|
+
this.isOpen = false;
|
|
33
|
+
this.close.emit();
|
|
34
|
+
};
|
|
35
|
+
this.handleClick = (event) => {
|
|
36
|
+
event.stopPropagation();
|
|
37
|
+
this.itemSelected.emit(this.item);
|
|
38
|
+
};
|
|
39
|
+
this.tooltipId = createRandomString();
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
var _a, _b;
|
|
43
|
+
if ((_b = (_a = this.item) === null || _a === void 0 ? void 0 : _a.dockMenu) === null || _b === void 0 ? void 0 : _b.componentName) {
|
|
44
|
+
return this.renderPopover();
|
|
45
|
+
}
|
|
46
|
+
return this.renderButton(this.handleClick);
|
|
47
|
+
}
|
|
48
|
+
renderPopover() {
|
|
49
|
+
var _a;
|
|
50
|
+
const CustomComponent = (_a = this.item) === null || _a === void 0 ? void 0 : _a.dockMenu.componentName;
|
|
51
|
+
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 }))));
|
|
52
|
+
}
|
|
53
|
+
renderButton(handleClick, slot) {
|
|
54
|
+
var _a;
|
|
55
|
+
return (h("button", { slot: slot, tabindex: "0", id: this.tooltipId, type: "button", class: {
|
|
56
|
+
button: true,
|
|
57
|
+
selected: (_a = this.item) === null || _a === void 0 ? void 0 : _a.selected,
|
|
58
|
+
}, onClick: handleClick }, this.renderIcon(), this.renderLabel(), this.renderTooltip()));
|
|
59
|
+
}
|
|
60
|
+
renderIcon() {
|
|
61
|
+
if (!this.item.icon) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
return h("limel-icon", { name: this.item.icon, class: "icon" });
|
|
65
|
+
}
|
|
66
|
+
renderLabel() {
|
|
67
|
+
if (this.expanded) {
|
|
68
|
+
return h("span", { class: "text" }, this.item.label);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
renderTooltip() {
|
|
72
|
+
if (!this.expanded && this.item.label) {
|
|
73
|
+
return (h("limel-tooltip", { elementId: this.tooltipId, label: this.item.label, helperLabel: this.item.helperLabel }));
|
|
74
|
+
}
|
|
75
|
+
if (this.expanded && this.item.helperLabel) {
|
|
76
|
+
return (h("limel-tooltip", { elementId: this.tooltipId, label: this.item.helperLabel }));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
DockButton.style = dockButtonCss;
|
|
81
|
+
|
|
82
|
+
export { DockButton as limel_dock_button };
|
|
@@ -0,0 +1,100 @@
|
|
|
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,\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, var(--limel-dock-item-text-color))}";
|
|
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
|
+
this.menuOpen = createEvent(this, "menuOpen", 7);
|
|
11
|
+
this.close = createEvent(this, "close", 7);
|
|
12
|
+
this.dockExpanded = createEvent(this, "dockExpanded", 7);
|
|
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 }));
|
|
60
|
+
};
|
|
61
|
+
this.handleResize = () => {
|
|
62
|
+
if (window.innerWidth <= this.mobileBreakPoint) {
|
|
63
|
+
this.useMobileLayout = true;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
this.useMobileLayout = false;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
this.toggleDockWidth = () => {
|
|
70
|
+
this.expanded = !this.expanded;
|
|
71
|
+
this.dockExpanded.emit(this.expanded);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
componentDidLoad() {
|
|
75
|
+
this.resizeObserver = new ResizeObserver(this.handleResize);
|
|
76
|
+
this.resizeObserver.observe(document.body);
|
|
77
|
+
}
|
|
78
|
+
disconnectedCallback() {
|
|
79
|
+
this.resizeObserver.disconnect();
|
|
80
|
+
}
|
|
81
|
+
render() {
|
|
82
|
+
return (h(Host, { class: {
|
|
83
|
+
dock: true,
|
|
84
|
+
expanded: this.expanded,
|
|
85
|
+
'has-mobile-layout': this.useMobileLayout,
|
|
86
|
+
} }, h("nav", { "aria-label": this.accessibleLabel }, this.dockItems.map(this.renderDockItem), this.renderSeparator(), this.dockFooterItems.map(this.renderDockItem)), this.renderExpandShrinkToggle()));
|
|
87
|
+
}
|
|
88
|
+
renderExpandShrinkToggle() {
|
|
89
|
+
if (this.useMobileLayout || !this.allowResize) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
return (h("button", { class: {
|
|
93
|
+
'expand-shrink': true,
|
|
94
|
+
expanded: this.expanded,
|
|
95
|
+
}, onClick: this.toggleDockWidth }, h("limel-icon", { name: "angle_right" })));
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
Dock.style = dockCss;
|
|
99
|
+
|
|
100
|
+
export { Dock as limel_dock };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-11cd0b60.js';
|
|
2
2
|
import { t as translate } from './translations-682e905e.js';
|
|
3
3
|
import { c as createCommonjsModule, a as commonjsGlobal, g as getDefaultExportFromCjs } from './_commonjsHelpers-5ec8f9b7.js';
|
|
4
|
-
import { D as DateFormatter } from './dateFormatter-
|
|
5
|
-
import { m as moment } from './moment-
|
|
4
|
+
import { D as DateFormatter } from './dateFormatter-784c3334.js';
|
|
5
|
+
import { m as moment } from './moment-faa8a4a8.js';
|
|
6
6
|
import { i as isIOSDevice, a as isAndroidDevice } from './device-39db3b5f.js';
|
|
7
7
|
import { e as eq } from './eq-c1c7f528.js';
|
|
8
8
|
import { b as isArrayLike$1, a as isIndex } from './isArrayLike-385e0f31.js';
|
|
@@ -7026,9 +7026,7 @@ class MonthPicker extends Picker {
|
|
|
7026
7026
|
})));
|
|
7027
7027
|
}
|
|
7028
7028
|
renderMonth(month, fp) {
|
|
7029
|
-
return (createElement("div", { className: "datepicker-month",
|
|
7030
|
-
// eslint-disable-next-line react/jsx-no-bind
|
|
7031
|
-
onClick: () => {
|
|
7029
|
+
return (createElement("div", { className: "datepicker-month", onClick: () => {
|
|
7032
7030
|
const date = moment([fp.currentYear]).month(month).toDate();
|
|
7033
7031
|
fp.setDate(date, true);
|
|
7034
7032
|
fp.close();
|
|
@@ -7147,9 +7145,7 @@ class QuarterPicker extends Picker {
|
|
|
7147
7145
|
})));
|
|
7148
7146
|
}
|
|
7149
7147
|
renderQuarter(quarter, fp) {
|
|
7150
|
-
return (createElement("div", { className: "datepicker-quarter", id: `datepicker-quarter-${quarter}`,
|
|
7151
|
-
// eslint-disable-next-line react/jsx-no-bind
|
|
7152
|
-
onClick: () => {
|
|
7148
|
+
return (createElement("div", { className: "datepicker-quarter", id: `datepicker-quarter-${quarter}`, onClick: () => {
|
|
7153
7149
|
const date = moment([fp.currentYear])
|
|
7154
7150
|
.quarter(quarter)
|
|
7155
7151
|
.toDate();
|
|
@@ -7431,9 +7427,7 @@ class YearPicker extends Picker {
|
|
|
7431
7427
|
})));
|
|
7432
7428
|
}
|
|
7433
7429
|
renderYear(year, fp) {
|
|
7434
|
-
return (createElement("div", { className: "datepicker-year",
|
|
7435
|
-
// eslint-disable-next-line react/jsx-no-bind
|
|
7436
|
-
onClick: () => {
|
|
7430
|
+
return (createElement("div", { className: "datepicker-year", onClick: () => {
|
|
7437
7431
|
const date = moment(year).toDate();
|
|
7438
7432
|
fp.setDate(date, true);
|
|
7439
7433
|
fp.close();
|
|
@@ -9,7 +9,7 @@ import { b as baseAssignValue$1 } from './_assignValue-fb2bf80a.js';
|
|
|
9
9
|
import { b as baseGetTag$1 } from './isObject-c74e273c.js';
|
|
10
10
|
import { i as isObjectLike$1 } from './isObjectLike-38996507.js';
|
|
11
11
|
import { a as arrayIncludes$1, b as arrayIncludesWith$1, c as baseRest$1, d as baseFlatten$1, i as isArrayLikeObject$1 } from './_arrayIncludesWith-969bccda.js';
|
|
12
|
-
import { m as moment } from './moment-
|
|
12
|
+
import { m as moment } from './moment-faa8a4a8.js';
|
|
13
13
|
import { i as isMultiple } from './multiple-254f4b61.js';
|
|
14
14
|
import { c as createRandomString } from './random-string-2246b81e.js';
|
|
15
15
|
import './eq-c1c7f528.js';
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, g as getElement } from './index-11cd0b60.js';
|
|
2
|
-
import { M as MDCRipple } from './component-5b4ac85a.js';
|
|
3
|
-
import './component-410aad5a.js';
|
|
4
|
-
import './ponyfill-30263d5e.js';
|
|
5
2
|
|
|
6
|
-
const iconButtonCss = ".mdc-icon-button{font-size:24px;width:48px;height:48px;padding:12px}.mdc-icon-button.mdc-icon-button--reduced-size{width:40px;height:40px;padding:8px}.mdc-icon-button.mdc-icon-button--reduced-size.mdc-icon-button--touch{margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-icon-button .mdc-icon-button__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}.mdc-icon-button:disabled{color:rgba(0, 0, 0, 0.38);color:var(--mdc-theme-text-disabled-on-light, rgba(0, 0, 0, 0.38))}.mdc-icon-button svg,.mdc-icon-button img{width:24px;height:24px}.mdc-icon-button{display:inline-block;position:relative;box-sizing:border-box;border:none;outline:none;background-color:transparent;fill:currentColor;color:inherit;text-decoration:none;cursor:pointer;user-select:none;overflow:visible}.mdc-icon-button .mdc-icon-button__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}.mdc-icon-button:disabled{cursor:default;pointer-events:none}.mdc-icon-button--display-flex{align-items:center;display:inline-flex;justify-content:center}.mdc-icon-button__icon{display:inline-block}.mdc-icon-button__icon.mdc-icon-button__icon--on{display:none}.mdc-icon-button--touch{margin-top:0px;margin-bottom:0px}.mdc-icon-button--on .mdc-icon-button__icon{display:none}.mdc-icon-button--on .mdc-icon-button__icon.mdc-icon-button__icon--on{display:inline-block}@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-icon-button{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);will-change:transform, opacity}.mdc-icon-button .mdc-icon-button__ripple::before,.mdc-icon-button .mdc-icon-button__ripple::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:\"\"}.mdc-icon-button .mdc-icon-button__ripple::before{transition:opacity 15ms linear, background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-icon-button .mdc-icon-button__ripple::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-icon-button.mdc-ripple-upgraded .mdc-icon-button__ripple::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-icon-button.mdc-ripple-upgraded .mdc-icon-button__ripple::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-icon-button.mdc-ripple-upgraded--unbounded .mdc-icon-button__ripple::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-icon-button.mdc-ripple-upgraded--foreground-activation .mdc-icon-button__ripple::after{animation:mdc-ripple-fg-radius-in 225ms forwards, mdc-ripple-fg-opacity-in 75ms forwards}.mdc-icon-button.mdc-ripple-upgraded--foreground-deactivation .mdc-icon-button__ripple::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-icon-button .mdc-icon-button__ripple::before,.mdc-icon-button .mdc-icon-button__ripple::after{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-icon-button.mdc-ripple-upgraded .mdc-icon-button__ripple::before,.mdc-icon-button.mdc-ripple-upgraded .mdc-icon-button__ripple::after{top:var(--mdc-ripple-top, calc(50% - 50%));left:var(--mdc-ripple-left, calc(50% - 50%));width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-icon-button.mdc-ripple-upgraded .mdc-icon-button__ripple::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-icon-button .mdc-icon-button__ripple::before,.mdc-icon-button .mdc-icon-button__ripple::after{background-color:#000;background-color:var(--mdc-ripple-color, #000)}.mdc-icon-button:hover .mdc-icon-button__ripple::before,.mdc-icon-button.mdc-ripple-surface--hover .mdc-icon-button__ripple::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-icon-button.mdc-ripple-upgraded--background-focused .mdc-icon-button__ripple::before,.mdc-icon-button:not(.mdc-ripple-upgraded):focus .mdc-icon-button__ripple::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-icon-button:not(.mdc-ripple-upgraded) .mdc-icon-button__ripple::after{transition:opacity 150ms linear}.mdc-icon-button:not(.mdc-ripple-upgraded):active .mdc-icon-button__ripple::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-icon-button.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-icon-button .mdc-icon-button__ripple{pointer-events:none;z-index:1}
|
|
3
|
+
const iconButtonCss = ".mdc-icon-button{font-size:24px;width:48px;height:48px;padding:12px}.mdc-icon-button.mdc-icon-button--reduced-size{width:40px;height:40px;padding:8px}.mdc-icon-button.mdc-icon-button--reduced-size.mdc-icon-button--touch{margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-icon-button .mdc-icon-button__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}.mdc-icon-button:disabled{color:rgba(0, 0, 0, 0.38);color:var(--mdc-theme-text-disabled-on-light, rgba(0, 0, 0, 0.38))}.mdc-icon-button svg,.mdc-icon-button img{width:24px;height:24px}.mdc-icon-button{display:inline-block;position:relative;box-sizing:border-box;border:none;outline:none;background-color:transparent;fill:currentColor;color:inherit;text-decoration:none;cursor:pointer;user-select:none;overflow:visible}.mdc-icon-button .mdc-icon-button__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}.mdc-icon-button:disabled{cursor:default;pointer-events:none}.mdc-icon-button--display-flex{align-items:center;display:inline-flex;justify-content:center}.mdc-icon-button__icon{display:inline-block}.mdc-icon-button__icon.mdc-icon-button__icon--on{display:none}.mdc-icon-button--touch{margin-top:0px;margin-bottom:0px}.mdc-icon-button--on .mdc-icon-button__icon{display:none}.mdc-icon-button--on .mdc-icon-button__icon.mdc-icon-button__icon--on{display:inline-block}@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-icon-button{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);will-change:transform, opacity}.mdc-icon-button .mdc-icon-button__ripple::before,.mdc-icon-button .mdc-icon-button__ripple::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:\"\"}.mdc-icon-button .mdc-icon-button__ripple::before{transition:opacity 15ms linear, background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-icon-button .mdc-icon-button__ripple::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-icon-button.mdc-ripple-upgraded .mdc-icon-button__ripple::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-icon-button.mdc-ripple-upgraded .mdc-icon-button__ripple::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-icon-button.mdc-ripple-upgraded--unbounded .mdc-icon-button__ripple::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-icon-button.mdc-ripple-upgraded--foreground-activation .mdc-icon-button__ripple::after{animation:mdc-ripple-fg-radius-in 225ms forwards, mdc-ripple-fg-opacity-in 75ms forwards}.mdc-icon-button.mdc-ripple-upgraded--foreground-deactivation .mdc-icon-button__ripple::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-icon-button .mdc-icon-button__ripple::before,.mdc-icon-button .mdc-icon-button__ripple::after{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-icon-button.mdc-ripple-upgraded .mdc-icon-button__ripple::before,.mdc-icon-button.mdc-ripple-upgraded .mdc-icon-button__ripple::after{top:var(--mdc-ripple-top, calc(50% - 50%));left:var(--mdc-ripple-left, calc(50% - 50%));width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-icon-button.mdc-ripple-upgraded .mdc-icon-button__ripple::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-icon-button .mdc-icon-button__ripple::before,.mdc-icon-button .mdc-icon-button__ripple::after{background-color:#000;background-color:var(--mdc-ripple-color, #000)}.mdc-icon-button:hover .mdc-icon-button__ripple::before,.mdc-icon-button.mdc-ripple-surface--hover .mdc-icon-button__ripple::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-icon-button.mdc-ripple-upgraded--background-focused .mdc-icon-button__ripple::before,.mdc-icon-button:not(.mdc-ripple-upgraded):focus .mdc-icon-button__ripple::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-icon-button:not(.mdc-ripple-upgraded) .mdc-icon-button__ripple::after{transition:opacity 150ms linear}.mdc-icon-button:not(.mdc-ripple-upgraded):active .mdc-icon-button__ripple::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-icon-button.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-icon-button .mdc-icon-button__ripple{pointer-events:none;z-index:1}:host([hidden]){display:none}:host([disabled]){pointer-events:none}.mdc-icon-button{transition:background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:2.25rem;width:2.25rem;padding:0.125rem;border-radius:50%;background-color:var(--icon-background-color, transparent)}.mdc-icon-button:hover{box-shadow:var(--button-shadow-hovered)}.mdc-icon-button:active{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}:host([elevated]) .mdc-icon-button:not(:hover):not(:active):not(:focus-visible){box-shadow:var(--button-shadow-normal)}.mdc-icon-button:disabled{color:var(--mdc-theme-text-disabled-on-background)}.mdc-icon-button:focus-visible{box-shadow:var(--shadow-depth-8-focused);border-radius:50%}limel-icon{width:1.25rem;height:1.25rem}";
|
|
7
4
|
|
|
8
5
|
const IconButton = class {
|
|
9
6
|
constructor(hostRef) {
|
|
@@ -17,23 +14,6 @@ const IconButton = class {
|
|
|
17
14
|
* Set to `true` to disable the button.
|
|
18
15
|
*/
|
|
19
16
|
this.disabled = false;
|
|
20
|
-
this.removeFocusedStyleOnClick =
|
|
21
|
-
this.removeFocusedStyleOnClick.bind(this);
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* If the button is hidden or inside another element that is animating
|
|
25
|
-
* while the button is instantiated, the hover-highlight may become
|
|
26
|
-
* misaligned. If so, calling this method will make the button re-layout
|
|
27
|
-
* the highlight.
|
|
28
|
-
*/
|
|
29
|
-
async relayout() {
|
|
30
|
-
if (this.mdcIconButtonRipple) {
|
|
31
|
-
this.mdcIconButtonRipple.layout();
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
removeFocusedStyleOnClick() {
|
|
35
|
-
const mdcButton = this.host.shadowRoot.querySelector('.mdc-icon-button');
|
|
36
|
-
mdcButton.classList.remove('mdc-ripple-upgraded--background-focused');
|
|
37
17
|
}
|
|
38
18
|
connectedCallback() {
|
|
39
19
|
this.initialize();
|
|
@@ -46,26 +26,13 @@ const IconButton = class {
|
|
|
46
26
|
if (!element) {
|
|
47
27
|
return;
|
|
48
28
|
}
|
|
49
|
-
this.mdcIconButtonRipple = new MDCRipple(element);
|
|
50
|
-
this.mdcIconButtonRipple.unbounded = true;
|
|
51
|
-
this.host.addEventListener('click', this.removeFocusedStyleOnClick);
|
|
52
|
-
}
|
|
53
|
-
disconnectedCallback() {
|
|
54
|
-
var _a;
|
|
55
|
-
(_a = this.mdcIconButtonRipple) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
56
|
-
this.host.removeEventListener('click', this.removeFocusedStyleOnClick);
|
|
57
29
|
}
|
|
58
30
|
render() {
|
|
59
31
|
const buttonAttributes = {};
|
|
60
32
|
if (this.host.hasAttribute('tabindex')) {
|
|
61
33
|
buttonAttributes.tabindex = this.host.getAttribute('tabindex');
|
|
62
34
|
}
|
|
63
|
-
|
|
64
|
-
if (this.elevated) {
|
|
65
|
-
iconAttributes.badge = true;
|
|
66
|
-
iconAttributes.size = 'small';
|
|
67
|
-
}
|
|
68
|
-
return (h("button", Object.assign({ class: "mdc-icon-button", disabled: this.disabled, "aria-label": this.label, title: this.label }, buttonAttributes), h("div", { class: "mdc-icon-button__ripple" }), h("limel-icon", Object.assign({ name: this.icon }, iconAttributes))));
|
|
35
|
+
return (h("button", Object.assign({ class: "mdc-icon-button", disabled: this.disabled, "aria-label": this.label, title: this.label }, buttonAttributes), h("limel-icon", { name: this.icon, badge: true })));
|
|
69
36
|
}
|
|
70
37
|
get host() { return getElement(this); }
|
|
71
38
|
};
|
|
@@ -303,6 +303,7 @@ const InputField = class {
|
|
|
303
303
|
this.getContainerClassList = () => {
|
|
304
304
|
const classList = {
|
|
305
305
|
'mdc-text-field': true,
|
|
306
|
+
'mdc-text-field--no-label': !this.label,
|
|
306
307
|
'mdc-text-field--outlined': true,
|
|
307
308
|
'mdc-text-field--invalid': this.isInvalid(),
|
|
308
309
|
'mdc-text-field--disabled': this.disabled || this.readonly,
|
|
@@ -329,7 +330,7 @@ const InputField = class {
|
|
|
329
330
|
return;
|
|
330
331
|
}
|
|
331
332
|
const type = this.type === 'urlAsText' ? 'text' : this.type;
|
|
332
|
-
return (h("input", Object.assign({}, properties, { type: type, pattern: this.pattern, onWheel: this.handleWheel, onKeyDown: this.onKeyDown, value: this.value })));
|
|
333
|
+
return (h("input", Object.assign({}, properties, { type: type, pattern: this.pattern, onWheel: this.handleWheel, onKeyDown: this.onKeyDown, value: this.value, placeholder: this.placeholder })));
|
|
333
334
|
};
|
|
334
335
|
this.renderTextarea = (properties) => {
|
|
335
336
|
if (this.type !== 'textarea') {
|
|
@@ -451,6 +452,16 @@ const InputField = class {
|
|
|
451
452
|
}
|
|
452
453
|
return this.limelInputField.shadowRoot.querySelector(elementName);
|
|
453
454
|
};
|
|
455
|
+
this.renderLabel = (labelId) => {
|
|
456
|
+
const labelClassList = {
|
|
457
|
+
'mdc-floating-label': true,
|
|
458
|
+
'mdc-floating-label--float-above': !!this.value || this.isFocused || this.readonly,
|
|
459
|
+
};
|
|
460
|
+
if (!this.label) {
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
return (h("span", { class: "mdc-notched-outline__notch" }, h("span", { class: labelClassList, id: labelId }, this.label)));
|
|
464
|
+
};
|
|
454
465
|
this.renderLeadingIcon = () => {
|
|
455
466
|
if (this.type === 'textarea') {
|
|
456
467
|
return;
|
|
@@ -711,12 +722,8 @@ const InputField = class {
|
|
|
711
722
|
properties['aria-controls'] = helperTextId;
|
|
712
723
|
properties['aria-describedby'] = helperTextId;
|
|
713
724
|
}
|
|
714
|
-
const labelClassList = {
|
|
715
|
-
'mdc-floating-label': true,
|
|
716
|
-
'mdc-floating-label--float-above': !!this.value || this.isFocused || this.readonly,
|
|
717
|
-
};
|
|
718
725
|
return [
|
|
719
|
-
h("label", { class: this.getContainerClassList() }, h("span", { class: "mdc-notched-outline", tabindex: "-1" }, h("span", { class: "mdc-notched-outline__leading" }),
|
|
726
|
+
h("label", { class: this.getContainerClassList() }, h("span", { class: "mdc-notched-outline", tabindex: "-1" }, h("span", { class: "mdc-notched-outline__leading" }), this.renderLabel(labelId), h("span", { class: "mdc-notched-outline__trailing" })), this.renderLeadingIcon(), this.renderEmptyValueForReadonly(), this.renderPrefix(), this.renderInput(properties), this.renderSuffix(), this.renderTextarea(properties), this.renderFormattedNumber(), this.renderTrailingLinkOrButton()),
|
|
720
727
|
this.renderHelperLine(),
|
|
721
728
|
this.renderAutocompleteList(),
|
|
722
729
|
];
|