@limetech/lime-elements 35.1.0-next.9 → 36.0.0-next.11
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-button.cjs.entry.js +32 -16
- package/dist/cjs/limel-chip-set.cjs.entry.js +8 -5
- package/dist/cjs/{limel-color-picker-palette_2.cjs.entry.js → limel-color-picker-palette.cjs.entry.js} +0 -112
- package/dist/cjs/limel-color-picker.cjs.entry.js +1 -1
- package/dist/cjs/limel-date-picker.cjs.entry.js +6 -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 +3 -9
- package/dist/cjs/limel-form.cjs.entry.js +3 -0
- package/dist/cjs/limel-icon-button.cjs.entry.js +2 -35
- package/dist/cjs/{limel-list_3.cjs.entry.js → limel-list_2.cjs.entry.js} +2 -1990
- package/dist/cjs/limel-menu.cjs.entry.js +2 -2
- package/dist/cjs/limel-picker.cjs.entry.js +1 -1
- 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 +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- 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.css +7 -0
- package/dist/collection/components/chip-set/chip-set.js +27 -4
- package/dist/collection/components/color-picker/color-picker.js +1 -1
- package/dist/collection/components/date-picker/date-picker.css +6 -1
- package/dist/collection/components/date-picker/date-picker.js +4 -4
- 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 +71 -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/form/templates/common.js +3 -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/list/list-renderer.js +2 -2
- package/dist/collection/components/menu/menu.js +6 -6
- package/dist/collection/components/picker/picker.js +1 -1
- package/dist/collection/components/popover/popover.js +23 -1
- package/dist/collection/components/portal/portal.js +39 -9
- package/dist/collection/components/select/select.template.js +2 -2
- package/dist/collection/components/tooltip/tooltip.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 +8 -5
- package/dist/esm/{limel-color-picker-palette_2.entry.js → limel-color-picker-palette.entry.js} +2 -113
- package/dist/esm/limel-color-picker.entry.js +1 -1
- package/dist/esm/limel-date-picker.entry.js +6 -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 +3 -9
- package/dist/esm/limel-form.entry.js +3 -0
- package/dist/esm/limel-icon-button.entry.js +2 -35
- package/dist/esm/{limel-list_3.entry.js → limel-list_2.entry.js} +3 -1990
- package/dist/esm/limel-menu.entry.js +2 -2
- package/dist/esm/limel-picker.entry.js +1 -1
- 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 +2 -2
- 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-19f72dab.entry.js +1 -0
- package/dist/lime-elements/p-1dfccbc5.entry.js +1 -0
- package/dist/lime-elements/p-5ad60e14.entry.js +126 -0
- package/dist/lime-elements/p-64f068a8.entry.js +1 -0
- package/dist/lime-elements/p-6b1bc80f.entry.js +1 -0
- package/dist/lime-elements/p-75152d89.entry.js +1 -0
- package/dist/lime-elements/{p-6d50aa71.entry.js → p-7e571ec6.entry.js} +1 -1
- package/dist/lime-elements/p-93cd2268.entry.js +1 -0
- package/dist/lime-elements/p-995bbd2a.entry.js +1 -0
- package/dist/lime-elements/p-a43e4844.entry.js +1 -0
- package/dist/lime-elements/p-b0b4e46f.entry.js +37 -0
- package/dist/lime-elements/p-bd098a11.entry.js +1 -0
- package/dist/lime-elements/p-c3f04c6d.entry.js +1 -0
- package/dist/lime-elements/p-f0e872b6.entry.js +16 -0
- package/dist/types/components/button/button.d.ts +10 -3
- package/dist/types/components/chip-set/chip-set.d.ts +7 -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/menu/menu.d.ts +2 -2
- package/dist/types/components/menu/menu.types.d.ts +1 -1
- package/dist/types/components/popover/popover.d.ts +5 -0
- package/dist/types/components/portal/portal.d.ts +2 -0
- package/dist/types/components.d.ts +145 -6
- package/dist/types/interface.d.ts +1 -0
- package/package.json +2 -3
- 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-2754e134.entry.js +0 -1
- package/dist/lime-elements/p-36ecbd03.entry.js +0 -1
- package/dist/lime-elements/p-404e1465.entry.js +0 -1
- package/dist/lime-elements/p-4d5a874a.entry.js +0 -1
- package/dist/lime-elements/p-5908c21d.entry.js +0 -1
- package/dist/lime-elements/p-705334c1.entry.js +0 -1
- package/dist/lime-elements/p-84f933f7.entry.js +0 -16
- package/dist/lime-elements/p-bd8c9384.entry.js +0 -1
- package/dist/lime-elements/p-d1ee4501.entry.js +0 -37
- package/dist/lime-elements/p-e80dd2ff.entry.js +0 -1
- package/dist/lime-elements/p-e83dddcd.entry.js +0 -126
- package/dist/lime-elements/p-eb13837f.entry.js +0 -1
|
@@ -0,0 +1,80 @@
|
|
|
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, 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.close = createEvent(this, "close", 7);
|
|
11
|
+
/**
|
|
12
|
+
* When the dock is expanded or collapsed, dock items
|
|
13
|
+
* show labels and tooltips as suitable for the layout.
|
|
14
|
+
*/
|
|
15
|
+
this.expanded = false;
|
|
16
|
+
/**
|
|
17
|
+
* When dock is using mobile layout, dock items
|
|
18
|
+
* show labels and tooltips as suitable for the layout.
|
|
19
|
+
*/
|
|
20
|
+
this.useMobileLayout = false;
|
|
21
|
+
/**
|
|
22
|
+
* Indicated whether the popover that renders a component is open.
|
|
23
|
+
*/
|
|
24
|
+
this.isOpen = false;
|
|
25
|
+
this.openPopover = (event) => {
|
|
26
|
+
event.stopPropagation();
|
|
27
|
+
this.isOpen = true;
|
|
28
|
+
};
|
|
29
|
+
this.onPopoverClose = () => {
|
|
30
|
+
this.isOpen = false;
|
|
31
|
+
this.close.emit();
|
|
32
|
+
};
|
|
33
|
+
this.handleClick = (event) => {
|
|
34
|
+
event.stopPropagation();
|
|
35
|
+
this.itemSelected.emit(this.item);
|
|
36
|
+
};
|
|
37
|
+
this.tooltipId = createRandomString();
|
|
38
|
+
}
|
|
39
|
+
render() {
|
|
40
|
+
var _a, _b;
|
|
41
|
+
if ((_b = (_a = this.item) === null || _a === void 0 ? void 0 : _a.dockMenu) === null || _b === void 0 ? void 0 : _b.componentName) {
|
|
42
|
+
return this.renderPopover();
|
|
43
|
+
}
|
|
44
|
+
return this.renderButton(this.handleClick);
|
|
45
|
+
}
|
|
46
|
+
renderPopover() {
|
|
47
|
+
var _a;
|
|
48
|
+
const CustomComponent = (_a = this.item) === null || _a === void 0 ? void 0 : _a.dockMenu.componentName;
|
|
49
|
+
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 }))));
|
|
50
|
+
}
|
|
51
|
+
renderButton(handleClick, slot) {
|
|
52
|
+
var _a;
|
|
53
|
+
return (h("button", { slot: slot, tabindex: "0", id: this.tooltipId, type: "button", class: {
|
|
54
|
+
button: true,
|
|
55
|
+
selected: (_a = this.item) === null || _a === void 0 ? void 0 : _a.selected,
|
|
56
|
+
}, onClick: handleClick }, this.renderIcon(), this.renderLabel(), this.renderTooltip()));
|
|
57
|
+
}
|
|
58
|
+
renderIcon() {
|
|
59
|
+
if (!this.item.icon) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
return h("limel-icon", { name: this.item.icon, class: "icon" });
|
|
63
|
+
}
|
|
64
|
+
renderLabel() {
|
|
65
|
+
if (this.expanded) {
|
|
66
|
+
return h("span", { class: "text" }, this.item.label);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
renderTooltip() {
|
|
70
|
+
if (!this.expanded && this.item.label) {
|
|
71
|
+
return (h("limel-tooltip", { elementId: this.tooltipId, label: this.item.label, helperLabel: this.item.helperLabel }));
|
|
72
|
+
}
|
|
73
|
+
if (this.expanded && this.item.helperLabel) {
|
|
74
|
+
return (h("limel-tooltip", { elementId: this.tooltipId, label: this.item.helperLabel }));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
DockButton.style = dockButtonCss;
|
|
79
|
+
|
|
80
|
+
export { DockButton as limel_dock_button };
|
|
@@ -0,0 +1,99 @@
|
|
|
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.close = createEvent(this, "close", 7);
|
|
11
|
+
this.dockExpanded = createEvent(this, "dockExpanded", 7);
|
|
12
|
+
/**
|
|
13
|
+
* Items that are placed in the dock.
|
|
14
|
+
*/
|
|
15
|
+
this.dockItems = [];
|
|
16
|
+
/**
|
|
17
|
+
* Items that are placed at the bottom of the dock. (Or at the end in mobile
|
|
18
|
+
* layout.)
|
|
19
|
+
*/
|
|
20
|
+
this.dockFooterItems = [];
|
|
21
|
+
/**
|
|
22
|
+
* Defines the width of the component, when it loads.
|
|
23
|
+
* - `true`: shows both icons and labels of the Dock items.
|
|
24
|
+
* - `false`: only shows icons of the doc items, and displays
|
|
25
|
+
* their labels as tooltip.
|
|
26
|
+
*
|
|
27
|
+
* Note: when `useMobileLayout` is `true`, labels will always
|
|
28
|
+
* be shown as tooltips. Read more below…
|
|
29
|
+
*/
|
|
30
|
+
this.expanded = false;
|
|
31
|
+
/**
|
|
32
|
+
* Set to `false` if you do not want to allow end-users
|
|
33
|
+
* to exapnd or shrink the Dock. This will hide the
|
|
34
|
+
* expand/shrink button, and the only things that defines
|
|
35
|
+
* the layout will be the `expanded` property, and
|
|
36
|
+
* the `mobileBreakPoint`.
|
|
37
|
+
*/
|
|
38
|
+
this.allowResize = true;
|
|
39
|
+
/**
|
|
40
|
+
* Defines the breakpoint in pixles, at which the component will be rendered
|
|
41
|
+
* in a hoizontal layout. Default breakpoint is `700` pixels, which means
|
|
42
|
+
* when the screen size is smaller than `700px`, the component will automatically
|
|
43
|
+
* switch to a horizontal layout.
|
|
44
|
+
*/
|
|
45
|
+
this.mobileBreakPoint = DEFAULT_MOBILE_BREAKPOINT;
|
|
46
|
+
/**
|
|
47
|
+
* Is used to render the component horizontally, and place
|
|
48
|
+
* the Dock items in a row.
|
|
49
|
+
*/
|
|
50
|
+
this.useMobileLayout = false;
|
|
51
|
+
this.renderSeparator = () => {
|
|
52
|
+
return this.useMobileLayout ? null : h("span", { class: "footer-separator" });
|
|
53
|
+
};
|
|
54
|
+
this.renderDockItem = (item) => {
|
|
55
|
+
return (h("limel-dock-button", { class: {
|
|
56
|
+
'dock-item': true,
|
|
57
|
+
selected: item.selected,
|
|
58
|
+
}, item: item, expanded: this.expanded && !this.useMobileLayout, useMobileLayout: this.useMobileLayout }));
|
|
59
|
+
};
|
|
60
|
+
this.handleResize = () => {
|
|
61
|
+
if (window.innerWidth <= this.mobileBreakPoint) {
|
|
62
|
+
this.useMobileLayout = true;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
this.useMobileLayout = false;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
this.toggleDockWidth = () => {
|
|
69
|
+
this.expanded = !this.expanded;
|
|
70
|
+
this.dockExpanded.emit(this.expanded);
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
componentDidLoad() {
|
|
74
|
+
this.resizeObserver = new ResizeObserver(this.handleResize);
|
|
75
|
+
this.resizeObserver.observe(document.body);
|
|
76
|
+
}
|
|
77
|
+
disconnectedCallback() {
|
|
78
|
+
this.resizeObserver.disconnect();
|
|
79
|
+
}
|
|
80
|
+
render() {
|
|
81
|
+
return (h(Host, { class: {
|
|
82
|
+
dock: true,
|
|
83
|
+
expanded: this.expanded,
|
|
84
|
+
'has-mobile-layout': this.useMobileLayout,
|
|
85
|
+
} }, h("nav", { "aria-label": this.accessibleLabel }, this.dockItems.map(this.renderDockItem), this.renderSeparator(), this.dockFooterItems.map(this.renderDockItem)), this.renderExpandShrinkToggle()));
|
|
86
|
+
}
|
|
87
|
+
renderExpandShrinkToggle() {
|
|
88
|
+
if (this.useMobileLayout || !this.allowResize) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
return (h("button", { class: {
|
|
92
|
+
'expand-shrink': true,
|
|
93
|
+
expanded: this.expanded,
|
|
94
|
+
}, onClick: this.toggleDockWidth }, h("limel-icon", { name: "angle_right" })));
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
Dock.style = dockCss;
|
|
98
|
+
|
|
99
|
+
export { Dock as limel_dock };
|
|
@@ -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();
|
|
@@ -23745,6 +23745,9 @@ function findTitle(data, fieldSchema, formSchema) {
|
|
|
23745
23745
|
if (!firstEntry) {
|
|
23746
23746
|
return null;
|
|
23747
23747
|
}
|
|
23748
|
+
if (!subSchema.properties) {
|
|
23749
|
+
return null;
|
|
23750
|
+
}
|
|
23748
23751
|
const [key, value] = firstEntry;
|
|
23749
23752
|
return findTitle(value, subSchema.properties[key], formSchema);
|
|
23750
23753
|
}
|
|
@@ -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
|
};
|