@limetech/lime-elements 36.0.0-next.2 → 36.0.0-next.20
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 +84 -0
- package/dist/cjs/limel-dock.cjs.entry.js +103 -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 +183 -0
- package/dist/collection/components/dock/dock.css +107 -0
- package/dist/collection/components/dock/dock.js +280 -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 +80 -0
- package/dist/esm/limel-dock.entry.js +99 -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-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-457cf741.entry.js +37 -0
- package/dist/lime-elements/p-55706501.entry.js +1 -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-a43e4844.entry.js +1 -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 +44 -0
- package/dist/types/components/dock/dock.d.ts +79 -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 +159 -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
|
@@ -3,14 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-2a28697b.js');
|
|
6
|
-
const randomString = require('./random-string-4c3b7f1c.js');
|
|
7
|
-
const keycodes = require('./keycodes-3949f425.js');
|
|
8
|
-
const zipObject = require('./zipObject-93a471fa.js');
|
|
9
|
-
require('./_assignValue-7c18d8d6.js');
|
|
10
|
-
require('./_defineProperty-8f56146d.js');
|
|
11
|
-
require('./_getNative-60328036.js');
|
|
12
|
-
require('./eq-9a943b00.js');
|
|
13
|
-
require('./isObject-e28b7997.js');
|
|
14
6
|
|
|
15
7
|
const colors = [
|
|
16
8
|
'red',
|
|
@@ -82,108 +74,4 @@ const Palette = class {
|
|
|
82
74
|
};
|
|
83
75
|
Palette.style = colorPickerPaletteCss;
|
|
84
76
|
|
|
85
|
-
/**
|
|
86
|
-
* Check if an element is a descendant of another
|
|
87
|
-
*
|
|
88
|
-
* If the child element is a descendant of a limel-portal, this function will
|
|
89
|
-
* go back through the portal and check the original tree recursively
|
|
90
|
-
*
|
|
91
|
-
* @param {HTMLElement} element the parent element
|
|
92
|
-
* @param {HTMLElement} child the child element to check
|
|
93
|
-
* @returns {boolean} `true` if child is a descendant of element, taking
|
|
94
|
-
* portals into account
|
|
95
|
-
*/
|
|
96
|
-
function portalContains(element, child) {
|
|
97
|
-
var _a;
|
|
98
|
-
if (element.contains(child) || ((_a = element.shadowRoot) === null || _a === void 0 ? void 0 : _a.contains(child))) {
|
|
99
|
-
return true;
|
|
100
|
-
}
|
|
101
|
-
const parent = findParent(child);
|
|
102
|
-
if (!parent) {
|
|
103
|
-
return false;
|
|
104
|
-
}
|
|
105
|
-
return portalContains(element, parent);
|
|
106
|
-
}
|
|
107
|
-
function findParent(element) {
|
|
108
|
-
const portal = element.closest('.limel-portal--container');
|
|
109
|
-
if (portal) {
|
|
110
|
-
return portal.portalSource;
|
|
111
|
-
}
|
|
112
|
-
const rootNode = element.getRootNode();
|
|
113
|
-
return rootNode.host;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const popoverCss = ".trigger-anchor{display:inline-block;position:relative}";
|
|
117
|
-
|
|
118
|
-
const Popover = class {
|
|
119
|
-
constructor(hostRef) {
|
|
120
|
-
index.registerInstance(this, hostRef);
|
|
121
|
-
this.close = index.createEvent(this, "close", 7);
|
|
122
|
-
/**
|
|
123
|
-
* True if the content within the popover should be visible
|
|
124
|
-
*/
|
|
125
|
-
this.open = false;
|
|
126
|
-
this.handleGlobalKeyPress = (event) => {
|
|
127
|
-
if (event.key !== keycodes.ESCAPE) {
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
event.stopPropagation();
|
|
131
|
-
event.preventDefault();
|
|
132
|
-
this.close.emit();
|
|
133
|
-
};
|
|
134
|
-
this.portalId = randomString.createRandomString();
|
|
135
|
-
this.globalClickListener = this.globalClickListener.bind(this);
|
|
136
|
-
}
|
|
137
|
-
watchOpen() {
|
|
138
|
-
this.setupGlobalHandlers();
|
|
139
|
-
}
|
|
140
|
-
componentWillLoad() {
|
|
141
|
-
this.setupGlobalHandlers();
|
|
142
|
-
}
|
|
143
|
-
setupGlobalHandlers() {
|
|
144
|
-
if (this.open) {
|
|
145
|
-
document.addEventListener('click', this.globalClickListener, {
|
|
146
|
-
capture: true,
|
|
147
|
-
});
|
|
148
|
-
document.addEventListener('keyup', this.handleGlobalKeyPress);
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
document.removeEventListener('click', this.globalClickListener);
|
|
152
|
-
document.removeEventListener('keyup', this.handleGlobalKeyPress);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
render() {
|
|
156
|
-
const cssProperties = this.getCssProperties();
|
|
157
|
-
const popoverZIndex = getComputedStyle(this.host).getPropertyValue('--popover-z-index');
|
|
158
|
-
return (index.h("div", { class: "trigger-anchor" }, index.h("slot", { name: "trigger" }), index.h("limel-portal", { visible: this.open, containerId: this.portalId, containerStyle: { 'z-index': popoverZIndex }, openDirection: this.openDirection }, index.h("limel-popover-surface", { contentCollection: this.host.children, style: cssProperties }))));
|
|
159
|
-
}
|
|
160
|
-
globalClickListener(event) {
|
|
161
|
-
const element = event.target;
|
|
162
|
-
const clickedInside = portalContains(this.host, element);
|
|
163
|
-
if (this.open && !clickedInside) {
|
|
164
|
-
event.stopPropagation();
|
|
165
|
-
event.preventDefault();
|
|
166
|
-
this.close.emit();
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
getCssProperties() {
|
|
170
|
-
const propertyNames = [
|
|
171
|
-
'--popover-surface-width',
|
|
172
|
-
'--popover-body-background-color',
|
|
173
|
-
'--popover-border-radius',
|
|
174
|
-
];
|
|
175
|
-
const style = getComputedStyle(this.host);
|
|
176
|
-
const values = propertyNames.map((property) => {
|
|
177
|
-
return style.getPropertyValue(property);
|
|
178
|
-
});
|
|
179
|
-
return zipObject.zipObject(propertyNames, values);
|
|
180
|
-
}
|
|
181
|
-
get host() { return index.getElement(this); }
|
|
182
|
-
static get watchers() { return {
|
|
183
|
-
"open": ["watchOpen"]
|
|
184
|
-
}; }
|
|
185
|
-
};
|
|
186
|
-
Popover.style = popoverCss;
|
|
187
|
-
|
|
188
77
|
exports.limel_color_picker_palette = Palette;
|
|
189
|
-
exports.limel_popover = Popover;
|
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-2a28697b.js');
|
|
6
6
|
const randomString = require('./random-string-4c3b7f1c.js');
|
|
7
7
|
const device = require('./device-c5841113.js');
|
|
8
|
-
const dateFormatter = require('./dateFormatter-
|
|
8
|
+
const dateFormatter = require('./dateFormatter-d7a8d40d.js');
|
|
9
9
|
const component = require('./component-ae3bfacf.js');
|
|
10
10
|
require('./_commonjsHelpers-0c557e26.js');
|
|
11
|
-
require('./moment-
|
|
11
|
+
require('./moment-d1e35cdc.js');
|
|
12
12
|
require('./component-67144c1c.js');
|
|
13
13
|
require('./component-cf490570.js');
|
|
14
14
|
require('./ponyfill-98ca4766.js');
|
|
@@ -116,7 +116,7 @@ const DatePicker = class {
|
|
|
116
116
|
}
|
|
117
117
|
const dropdownZIndex = getComputedStyle(this.host).getPropertyValue('--dropdown-z-index');
|
|
118
118
|
return [
|
|
119
|
-
index.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)),
|
|
119
|
+
index.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)),
|
|
120
120
|
index.h("limel-portal", { containerId: this.portalId, visible: this.showPortal, containerStyle: { 'z-index': dropdownZIndex } }, index.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 })),
|
|
121
121
|
];
|
|
122
122
|
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-2a28697b.js');
|
|
6
|
+
const randomString = require('./random-string-4c3b7f1c.js');
|
|
7
|
+
|
|
8
|
+
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))}";
|
|
9
|
+
|
|
10
|
+
const DockButton = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
this.itemSelected = index.createEvent(this, "itemSelected", 7);
|
|
14
|
+
this.close = index.createEvent(this, "close", 7);
|
|
15
|
+
/**
|
|
16
|
+
* When the dock is expanded or collapsed, dock items
|
|
17
|
+
* show labels and tooltips as suitable for the layout.
|
|
18
|
+
*/
|
|
19
|
+
this.expanded = false;
|
|
20
|
+
/**
|
|
21
|
+
* When dock is using mobile layout, dock items
|
|
22
|
+
* show labels and tooltips as suitable for the layout.
|
|
23
|
+
*/
|
|
24
|
+
this.useMobileLayout = false;
|
|
25
|
+
/**
|
|
26
|
+
* Indicated whether the popover that renders a component is open.
|
|
27
|
+
*/
|
|
28
|
+
this.isOpen = false;
|
|
29
|
+
this.openPopover = (event) => {
|
|
30
|
+
event.stopPropagation();
|
|
31
|
+
this.isOpen = true;
|
|
32
|
+
};
|
|
33
|
+
this.onPopoverClose = () => {
|
|
34
|
+
this.isOpen = false;
|
|
35
|
+
this.close.emit();
|
|
36
|
+
};
|
|
37
|
+
this.handleClick = (event) => {
|
|
38
|
+
event.stopPropagation();
|
|
39
|
+
this.itemSelected.emit(this.item);
|
|
40
|
+
};
|
|
41
|
+
this.tooltipId = randomString.createRandomString();
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
var _a, _b;
|
|
45
|
+
if ((_b = (_a = this.item) === null || _a === void 0 ? void 0 : _a.dockMenu) === null || _b === void 0 ? void 0 : _b.componentName) {
|
|
46
|
+
return this.renderPopover();
|
|
47
|
+
}
|
|
48
|
+
return this.renderButton(this.handleClick);
|
|
49
|
+
}
|
|
50
|
+
renderPopover() {
|
|
51
|
+
var _a;
|
|
52
|
+
const CustomComponent = (_a = this.item) === null || _a === void 0 ? void 0 : _a.dockMenu.componentName;
|
|
53
|
+
return (index.h("limel-popover", { openDirection: this.useMobileLayout ? 'top' : 'right', open: this.isOpen || this.item.dockMenu.menuOpen, onClose: this.onPopoverClose }, this.renderButton(this.openPopover, 'trigger'), index.h(CustomComponent, Object.assign({}, (this.item.dockMenu.props || {}), { onClose: this.onPopoverClose }))));
|
|
54
|
+
}
|
|
55
|
+
renderButton(handleClick, slot) {
|
|
56
|
+
var _a;
|
|
57
|
+
return (index.h("button", { slot: slot, tabindex: "0", id: this.tooltipId, type: "button", class: {
|
|
58
|
+
button: true,
|
|
59
|
+
selected: (_a = this.item) === null || _a === void 0 ? void 0 : _a.selected,
|
|
60
|
+
}, onClick: handleClick }, this.renderIcon(), this.renderLabel(), this.renderTooltip()));
|
|
61
|
+
}
|
|
62
|
+
renderIcon() {
|
|
63
|
+
if (!this.item.icon) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
return index.h("limel-icon", { name: this.item.icon, class: "icon" });
|
|
67
|
+
}
|
|
68
|
+
renderLabel() {
|
|
69
|
+
if (this.expanded) {
|
|
70
|
+
return index.h("span", { class: "text" }, this.item.label);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
renderTooltip() {
|
|
74
|
+
if (!this.expanded && this.item.label) {
|
|
75
|
+
return (index.h("limel-tooltip", { elementId: this.tooltipId, label: this.item.label, helperLabel: this.item.helperLabel }));
|
|
76
|
+
}
|
|
77
|
+
if (this.expanded && this.item.helperLabel) {
|
|
78
|
+
return (index.h("limel-tooltip", { elementId: this.tooltipId, label: this.item.helperLabel }));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
DockButton.style = dockButtonCss;
|
|
83
|
+
|
|
84
|
+
exports.limel_dock_button = DockButton;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-2a28697b.js');
|
|
6
|
+
|
|
7
|
+
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))}";
|
|
8
|
+
|
|
9
|
+
const DEFAULT_MOBILE_BREAKPOINT = 700;
|
|
10
|
+
const Dock = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
this.itemSelected = index.createEvent(this, "itemSelected", 7);
|
|
14
|
+
this.close = index.createEvent(this, "close", 7);
|
|
15
|
+
this.dockExpanded = index.createEvent(this, "dockExpanded", 7);
|
|
16
|
+
/**
|
|
17
|
+
* Items that are placed in the dock.
|
|
18
|
+
*/
|
|
19
|
+
this.dockItems = [];
|
|
20
|
+
/**
|
|
21
|
+
* Items that are placed at the bottom of the dock. (Or at the end in mobile
|
|
22
|
+
* layout.)
|
|
23
|
+
*/
|
|
24
|
+
this.dockFooterItems = [];
|
|
25
|
+
/**
|
|
26
|
+
* Defines the width of the component, when it loads.
|
|
27
|
+
* - `true`: shows both icons and labels of the Dock items.
|
|
28
|
+
* - `false`: only shows icons of the doc items, and displays
|
|
29
|
+
* their labels as tooltip.
|
|
30
|
+
*
|
|
31
|
+
* Note: when `useMobileLayout` is `true`, labels will always
|
|
32
|
+
* be shown as tooltips. Read more below…
|
|
33
|
+
*/
|
|
34
|
+
this.expanded = false;
|
|
35
|
+
/**
|
|
36
|
+
* Set to `false` if you do not want to allow end-users
|
|
37
|
+
* to exapnd or shrink the Dock. This will hide the
|
|
38
|
+
* expand/shrink button, and the only things that defines
|
|
39
|
+
* the layout will be the `expanded` property, and
|
|
40
|
+
* the `mobileBreakPoint`.
|
|
41
|
+
*/
|
|
42
|
+
this.allowResize = true;
|
|
43
|
+
/**
|
|
44
|
+
* Defines the breakpoint in pixles, at which the component will be rendered
|
|
45
|
+
* in a hoizontal layout. Default breakpoint is `700` pixels, which means
|
|
46
|
+
* when the screen size is smaller than `700px`, the component will automatically
|
|
47
|
+
* switch to a horizontal layout.
|
|
48
|
+
*/
|
|
49
|
+
this.mobileBreakPoint = DEFAULT_MOBILE_BREAKPOINT;
|
|
50
|
+
/**
|
|
51
|
+
* Is used to render the component horizontally, and place
|
|
52
|
+
* the Dock items in a row.
|
|
53
|
+
*/
|
|
54
|
+
this.useMobileLayout = false;
|
|
55
|
+
this.renderSeparator = () => {
|
|
56
|
+
return this.useMobileLayout ? null : index.h("span", { class: "footer-separator" });
|
|
57
|
+
};
|
|
58
|
+
this.renderDockItem = (item) => {
|
|
59
|
+
return (index.h("limel-dock-button", { class: {
|
|
60
|
+
'dock-item': true,
|
|
61
|
+
selected: item.selected,
|
|
62
|
+
}, item: item, expanded: this.expanded && !this.useMobileLayout, useMobileLayout: this.useMobileLayout }));
|
|
63
|
+
};
|
|
64
|
+
this.handleResize = () => {
|
|
65
|
+
if (window.innerWidth <= this.mobileBreakPoint) {
|
|
66
|
+
this.useMobileLayout = true;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
this.useMobileLayout = false;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
this.toggleDockWidth = () => {
|
|
73
|
+
this.expanded = !this.expanded;
|
|
74
|
+
this.dockExpanded.emit(this.expanded);
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
componentDidLoad() {
|
|
78
|
+
this.resizeObserver = new ResizeObserver(this.handleResize);
|
|
79
|
+
this.resizeObserver.observe(document.body);
|
|
80
|
+
}
|
|
81
|
+
disconnectedCallback() {
|
|
82
|
+
this.resizeObserver.disconnect();
|
|
83
|
+
}
|
|
84
|
+
render() {
|
|
85
|
+
return (index.h(index.Host, { class: {
|
|
86
|
+
dock: true,
|
|
87
|
+
expanded: this.expanded,
|
|
88
|
+
'has-mobile-layout': this.useMobileLayout,
|
|
89
|
+
} }, index.h("nav", { "aria-label": this.accessibleLabel }, this.dockItems.map(this.renderDockItem), this.renderSeparator(), this.dockFooterItems.map(this.renderDockItem)), this.renderExpandShrinkToggle()));
|
|
90
|
+
}
|
|
91
|
+
renderExpandShrinkToggle() {
|
|
92
|
+
if (this.useMobileLayout || !this.allowResize) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
return (index.h("button", { class: {
|
|
96
|
+
'expand-shrink': true,
|
|
97
|
+
expanded: this.expanded,
|
|
98
|
+
}, onClick: this.toggleDockWidth }, index.h("limel-icon", { name: "angle_right" })));
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
Dock.style = dockCss;
|
|
102
|
+
|
|
103
|
+
exports.limel_dock = Dock;
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-2a28697b.js');
|
|
6
6
|
const translations = require('./translations-5a8d7f6c.js');
|
|
7
7
|
const _commonjsHelpers = require('./_commonjsHelpers-0c557e26.js');
|
|
8
|
-
const dateFormatter = require('./dateFormatter-
|
|
9
|
-
const moment = require('./moment-
|
|
8
|
+
const dateFormatter = require('./dateFormatter-d7a8d40d.js');
|
|
9
|
+
const moment = require('./moment-d1e35cdc.js');
|
|
10
10
|
const device = require('./device-c5841113.js');
|
|
11
11
|
const eq = require('./eq-9a943b00.js');
|
|
12
12
|
const isArrayLike$1 = require('./isArrayLike-ac53bdac.js');
|
|
@@ -7030,9 +7030,7 @@ class MonthPicker extends Picker {
|
|
|
7030
7030
|
})));
|
|
7031
7031
|
}
|
|
7032
7032
|
renderMonth(month, fp) {
|
|
7033
|
-
return (createElement("div", { className: "datepicker-month",
|
|
7034
|
-
// eslint-disable-next-line react/jsx-no-bind
|
|
7035
|
-
onClick: () => {
|
|
7033
|
+
return (createElement("div", { className: "datepicker-month", onClick: () => {
|
|
7036
7034
|
const date = moment.moment([fp.currentYear]).month(month).toDate();
|
|
7037
7035
|
fp.setDate(date, true);
|
|
7038
7036
|
fp.close();
|
|
@@ -7151,9 +7149,7 @@ class QuarterPicker extends Picker {
|
|
|
7151
7149
|
})));
|
|
7152
7150
|
}
|
|
7153
7151
|
renderQuarter(quarter, fp) {
|
|
7154
|
-
return (createElement("div", { className: "datepicker-quarter", id: `datepicker-quarter-${quarter}`,
|
|
7155
|
-
// eslint-disable-next-line react/jsx-no-bind
|
|
7156
|
-
onClick: () => {
|
|
7152
|
+
return (createElement("div", { className: "datepicker-quarter", id: `datepicker-quarter-${quarter}`, onClick: () => {
|
|
7157
7153
|
const date = moment.moment([fp.currentYear])
|
|
7158
7154
|
.quarter(quarter)
|
|
7159
7155
|
.toDate();
|
|
@@ -7435,9 +7431,7 @@ class YearPicker extends Picker {
|
|
|
7435
7431
|
})));
|
|
7436
7432
|
}
|
|
7437
7433
|
renderYear(year, fp) {
|
|
7438
|
-
return (createElement("div", { className: "datepicker-year",
|
|
7439
|
-
// eslint-disable-next-line react/jsx-no-bind
|
|
7440
|
-
onClick: () => {
|
|
7434
|
+
return (createElement("div", { className: "datepicker-year", onClick: () => {
|
|
7441
7435
|
const date = moment.moment(year).toDate();
|
|
7442
7436
|
fp.setDate(date, true);
|
|
7443
7437
|
fp.close();
|
|
@@ -13,7 +13,7 @@ const _assignValue$1 = require('./_assignValue-7c18d8d6.js');
|
|
|
13
13
|
const isObject$3 = require('./isObject-e28b7997.js');
|
|
14
14
|
const isObjectLike$1 = require('./isObjectLike-3e3f0cba.js');
|
|
15
15
|
const _arrayIncludesWith$1 = require('./_arrayIncludesWith-29083f83.js');
|
|
16
|
-
const moment = require('./moment-
|
|
16
|
+
const moment = require('./moment-d1e35cdc.js');
|
|
17
17
|
const multiple = require('./multiple-8fab83eb.js');
|
|
18
18
|
const randomString = require('./random-string-4c3b7f1c.js');
|
|
19
19
|
require('./eq-9a943b00.js');
|
|
@@ -3,11 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-2a28697b.js');
|
|
6
|
-
const component = require('./component-cf490570.js');
|
|
7
|
-
require('./component-67144c1c.js');
|
|
8
|
-
require('./ponyfill-98ca4766.js');
|
|
9
6
|
|
|
10
|
-
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}
|
|
7
|
+
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}";
|
|
11
8
|
|
|
12
9
|
const IconButton = class {
|
|
13
10
|
constructor(hostRef) {
|
|
@@ -21,23 +18,6 @@ const IconButton = class {
|
|
|
21
18
|
* Set to `true` to disable the button.
|
|
22
19
|
*/
|
|
23
20
|
this.disabled = false;
|
|
24
|
-
this.removeFocusedStyleOnClick =
|
|
25
|
-
this.removeFocusedStyleOnClick.bind(this);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* If the button is hidden or inside another element that is animating
|
|
29
|
-
* while the button is instantiated, the hover-highlight may become
|
|
30
|
-
* misaligned. If so, calling this method will make the button re-layout
|
|
31
|
-
* the highlight.
|
|
32
|
-
*/
|
|
33
|
-
async relayout() {
|
|
34
|
-
if (this.mdcIconButtonRipple) {
|
|
35
|
-
this.mdcIconButtonRipple.layout();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
removeFocusedStyleOnClick() {
|
|
39
|
-
const mdcButton = this.host.shadowRoot.querySelector('.mdc-icon-button');
|
|
40
|
-
mdcButton.classList.remove('mdc-ripple-upgraded--background-focused');
|
|
41
21
|
}
|
|
42
22
|
connectedCallback() {
|
|
43
23
|
this.initialize();
|
|
@@ -50,26 +30,13 @@ const IconButton = class {
|
|
|
50
30
|
if (!element) {
|
|
51
31
|
return;
|
|
52
32
|
}
|
|
53
|
-
this.mdcIconButtonRipple = new component.MDCRipple(element);
|
|
54
|
-
this.mdcIconButtonRipple.unbounded = true;
|
|
55
|
-
this.host.addEventListener('click', this.removeFocusedStyleOnClick);
|
|
56
|
-
}
|
|
57
|
-
disconnectedCallback() {
|
|
58
|
-
var _a;
|
|
59
|
-
(_a = this.mdcIconButtonRipple) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
60
|
-
this.host.removeEventListener('click', this.removeFocusedStyleOnClick);
|
|
61
33
|
}
|
|
62
34
|
render() {
|
|
63
35
|
const buttonAttributes = {};
|
|
64
36
|
if (this.host.hasAttribute('tabindex')) {
|
|
65
37
|
buttonAttributes.tabindex = this.host.getAttribute('tabindex');
|
|
66
38
|
}
|
|
67
|
-
|
|
68
|
-
if (this.elevated) {
|
|
69
|
-
iconAttributes.badge = true;
|
|
70
|
-
iconAttributes.size = 'small';
|
|
71
|
-
}
|
|
72
|
-
return (index.h("button", Object.assign({ class: "mdc-icon-button", disabled: this.disabled, "aria-label": this.label, title: this.label }, buttonAttributes), index.h("div", { class: "mdc-icon-button__ripple" }), index.h("limel-icon", Object.assign({ name: this.icon }, iconAttributes))));
|
|
39
|
+
return (index.h("button", Object.assign({ class: "mdc-icon-button", disabled: this.disabled, "aria-label": this.label, title: this.label }, buttonAttributes), index.h("limel-icon", { name: this.icon, badge: true })));
|
|
73
40
|
}
|
|
74
41
|
get host() { return index.getElement(this); }
|
|
75
42
|
};
|
|
@@ -307,6 +307,7 @@ const InputField = class {
|
|
|
307
307
|
this.getContainerClassList = () => {
|
|
308
308
|
const classList = {
|
|
309
309
|
'mdc-text-field': true,
|
|
310
|
+
'mdc-text-field--no-label': !this.label,
|
|
310
311
|
'mdc-text-field--outlined': true,
|
|
311
312
|
'mdc-text-field--invalid': this.isInvalid(),
|
|
312
313
|
'mdc-text-field--disabled': this.disabled || this.readonly,
|
|
@@ -333,7 +334,7 @@ const InputField = class {
|
|
|
333
334
|
return;
|
|
334
335
|
}
|
|
335
336
|
const type = this.type === 'urlAsText' ? 'text' : this.type;
|
|
336
|
-
return (index.h("input", Object.assign({}, properties, { type: type, pattern: this.pattern, onWheel: this.handleWheel, onKeyDown: this.onKeyDown, value: this.value })));
|
|
337
|
+
return (index.h("input", Object.assign({}, properties, { type: type, pattern: this.pattern, onWheel: this.handleWheel, onKeyDown: this.onKeyDown, value: this.value, placeholder: this.placeholder })));
|
|
337
338
|
};
|
|
338
339
|
this.renderTextarea = (properties) => {
|
|
339
340
|
if (this.type !== 'textarea') {
|
|
@@ -455,6 +456,16 @@ const InputField = class {
|
|
|
455
456
|
}
|
|
456
457
|
return this.limelInputField.shadowRoot.querySelector(elementName);
|
|
457
458
|
};
|
|
459
|
+
this.renderLabel = (labelId) => {
|
|
460
|
+
const labelClassList = {
|
|
461
|
+
'mdc-floating-label': true,
|
|
462
|
+
'mdc-floating-label--float-above': !!this.value || this.isFocused || this.readonly,
|
|
463
|
+
};
|
|
464
|
+
if (!this.label) {
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
return (index.h("span", { class: "mdc-notched-outline__notch" }, index.h("span", { class: labelClassList, id: labelId }, this.label)));
|
|
468
|
+
};
|
|
458
469
|
this.renderLeadingIcon = () => {
|
|
459
470
|
if (this.type === 'textarea') {
|
|
460
471
|
return;
|
|
@@ -715,12 +726,8 @@ const InputField = class {
|
|
|
715
726
|
properties['aria-controls'] = helperTextId;
|
|
716
727
|
properties['aria-describedby'] = helperTextId;
|
|
717
728
|
}
|
|
718
|
-
const labelClassList = {
|
|
719
|
-
'mdc-floating-label': true,
|
|
720
|
-
'mdc-floating-label--float-above': !!this.value || this.isFocused || this.readonly,
|
|
721
|
-
};
|
|
722
729
|
return [
|
|
723
|
-
index.h("label", { class: this.getContainerClassList() }, index.h("span", { class: "mdc-notched-outline", tabindex: "-1" }, index.h("span", { class: "mdc-notched-outline__leading" }),
|
|
730
|
+
index.h("label", { class: this.getContainerClassList() }, index.h("span", { class: "mdc-notched-outline", tabindex: "-1" }, index.h("span", { class: "mdc-notched-outline__leading" }), this.renderLabel(labelId), index.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()),
|
|
724
731
|
this.renderHelperLine(),
|
|
725
732
|
this.renderAutocompleteList(),
|
|
726
733
|
];
|