@limetech/lime-elements 36.0.0-next.4 → 36.0.0-next.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-button.cjs.entry.js +2 -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-dock-button.cjs.entry.js +79 -0
- package/dist/cjs/limel-dock.cjs.entry.js +105 -0
- package/dist/cjs/{limel-list_3.cjs.entry.js → limel-list_2.cjs.entry.js} +0 -2018
- package/dist/cjs/limel-popover_4.cjs.entry.js +239 -0
- package/dist/cjs/limel-portal.cjs.entry.js +2024 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/button/button.css +3 -0
- package/dist/collection/components/button/button.js +1 -2
- package/dist/collection/components/dock/dock-button/dock-button.css +71 -0
- package/dist/collection/components/dock/dock-button/dock-button.js +187 -0
- package/dist/collection/components/dock/dock.css +107 -0
- package/dist/collection/components/dock/dock.js +254 -0
- package/dist/collection/components/dock/dock.types.js +1 -0
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-button.entry.js +2 -2
- package/dist/esm/{limel-color-picker-palette_2.entry.js → limel-color-picker-palette.entry.js} +2 -113
- package/dist/esm/limel-dock-button.entry.js +75 -0
- package/dist/esm/limel-dock.entry.js +101 -0
- package/dist/esm/{limel-list_3.entry.js → limel-list_2.entry.js} +1 -2018
- package/dist/esm/limel-popover_4.entry.js +232 -0
- package/dist/esm/limel-portal.entry.js +2020 -0
- package/dist/esm/loader.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/p-009de50e.entry.js +1 -0
- package/dist/lime-elements/{p-08251941.entry.js → p-19f72dab.entry.js} +1 -1
- package/dist/lime-elements/p-1dfccbc5.entry.js +1 -0
- package/dist/lime-elements/p-93cd2268.entry.js +1 -0
- package/dist/lime-elements/p-b9af1b40.entry.js +1 -0
- package/dist/lime-elements/p-bd098a11.entry.js +1 -0
- package/dist/lime-elements/p-fabea4b5.entry.js +1 -0
- package/dist/types/components/dock/dock-button/dock-button.d.ts +36 -0
- package/dist/types/components/dock/dock.d.ts +71 -0
- package/dist/types/components/dock/dock.types.d.ts +53 -0
- package/dist/types/components.d.ts +108 -0
- package/dist/types/interface.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/limel-popover-surface.cjs.entry.js +0 -32
- package/dist/cjs/limel-tooltip_2.cjs.entry.js +0 -102
- package/dist/esm/limel-popover-surface.entry.js +0 -28
- package/dist/esm/limel-tooltip_2.entry.js +0 -97
- package/dist/lime-elements/p-22569fb6.entry.js +0 -1
- package/dist/lime-elements/p-2fbfc1ea.entry.js +0 -1
- package/dist/lime-elements/p-705334c1.entry.js +0 -1
- package/dist/lime-elements/p-87453b45.entry.js +0 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-11cd0b60.js';
|
|
2
|
+
|
|
3
|
+
const dockCss = ":host(limel-dock){--dock-item-height:2.75rem;--dock-padding:0.25rem;--dock-expand-shrink-button-height:1rem;--limel-dock-item-text-color:var(\n --dock-item-text-color--deselected,\n rgb(var(--contrast-1100))\n );--limel-dock-item-text-color--selected:var(\n --dock-item-text-color--selected,\n rgb(var(--contrast-1300))\n );isolation:isolate;position:relative;display:inline-flex;flex-direction:column;background-color:var(--dock-background-color, rgb(var(--contrast-100)));box-shadow:0.1875rem 0 0.375rem -0.125rem rgba(var(--color-black), 0.15), 0.1875rem 0 0.625rem -0.125rem rgba(var(--color-black), 0.05)}:host(limel-dock:not(.has-mobile-layout)){height:100%;width:calc(var(--dock-padding) * 2 + var(--dock-item-height))}:host(limel-dock.expanded){width:var(--dock-expanded-max-width, max-content)}.footer-separator{margin-top:auto;justify-self:flex-end}nav{box-sizing:border-box;display:inline-flex;flex-direction:column;gap:0.375rem;flex-grow:1;padding:var(--dock-padding);overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none}nav::-webkit-scrollbar{display:none}:host(limel-dock.has-mobile-layout) nav{justify-content:space-between;flex-direction:row}.expand-shrink{all:unset;box-sizing:border-box;transition:background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;cursor:pointer;display:flex;justify-content:center;align-items:center;height:var(--dock-expand-shrink-button-height);padding:0 0.5rem;margin:var(--dock-padding);border-radius:0.375rem}.expand-shrink:hover{box-shadow:var(--button-shadow-hovered)}.expand-shrink:active{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}.expand-shrink.expanded{justify-content:flex-end}.expand-shrink.expanded limel-icon{transform:rotateY(180deg)}.expand-shrink:focus-visible{box-shadow:var(--shadow-depth-8-focused)}.expand-shrink limel-icon{width:calc(var(--dock-expand-shrink-button-height) - 0.25rem);color:var(--dock-item-icon-color--deselected, var(--button-text))}";
|
|
4
|
+
|
|
5
|
+
const DEFAULT_MOBILE_BREAKPOINT = 700;
|
|
6
|
+
const Dock = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
this.itemSelected = createEvent(this, "itemSelected", 7);
|
|
10
|
+
/**
|
|
11
|
+
* Items that are placed in the dock.
|
|
12
|
+
*/
|
|
13
|
+
this.dockItems = [];
|
|
14
|
+
/**
|
|
15
|
+
* Items that are placed at the bottom of the dock. (Or at the end in mobile
|
|
16
|
+
* layout.)
|
|
17
|
+
*/
|
|
18
|
+
this.dockFooterItems = [];
|
|
19
|
+
/**
|
|
20
|
+
* Defines the width of the component, when it loads.
|
|
21
|
+
* - `true`: shows both icons and labels of the Dock items.
|
|
22
|
+
* - `false`: only shows icons of the doc items, and displays
|
|
23
|
+
* their labels as tooltip.
|
|
24
|
+
*
|
|
25
|
+
* Note: when `useMobileLayout` is `true`, labels will always
|
|
26
|
+
* be shown as tooltips. Read more below…
|
|
27
|
+
*/
|
|
28
|
+
this.expanded = false;
|
|
29
|
+
/**
|
|
30
|
+
* Set to `false` if you do not want to allow end-users
|
|
31
|
+
* to exapnd or shrink the Dock. This will hide the
|
|
32
|
+
* expand/shrink button, and the only things that defines
|
|
33
|
+
* the layout will be the `expanded` property, and
|
|
34
|
+
* the `mobileBreakPoint`.
|
|
35
|
+
*/
|
|
36
|
+
this.allowResize = true;
|
|
37
|
+
/**
|
|
38
|
+
* Defines the breakpoint in pixles, at which the component will be rendered
|
|
39
|
+
* in a hoizontal layout. Default breakpoint is `700` pixels, which means
|
|
40
|
+
* when the screen size is smaller than `700px`, the component will automatically
|
|
41
|
+
* switch to a horizontal layout.
|
|
42
|
+
*/
|
|
43
|
+
this.mobileBreakPoint = DEFAULT_MOBILE_BREAKPOINT;
|
|
44
|
+
/**
|
|
45
|
+
* Is used to render the component horizontally, and place
|
|
46
|
+
* the Dock items in a row.
|
|
47
|
+
*/
|
|
48
|
+
this.useMobileLayout = false;
|
|
49
|
+
this.renderSeparator = () => {
|
|
50
|
+
return this.useMobileLayout ? null : h("span", { class: "footer-separator" });
|
|
51
|
+
};
|
|
52
|
+
this.renderDockItem = (item) => {
|
|
53
|
+
return (h("limel-dock-button", { class: {
|
|
54
|
+
'dock-item': true,
|
|
55
|
+
selected: item.selected,
|
|
56
|
+
}, item: item, expanded: this.expanded && !this.useMobileLayout, useMobileLayout: this.useMobileLayout, onInteract: this.handleDockItemClick }));
|
|
57
|
+
};
|
|
58
|
+
this.handleDockItemClick = (event) => {
|
|
59
|
+
if (!event.detail.selected) {
|
|
60
|
+
this.itemSelected.emit(event.detail);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
this.handleResize = () => {
|
|
64
|
+
if (window.innerWidth <= this.mobileBreakPoint) {
|
|
65
|
+
this.useMobileLayout = true;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
this.useMobileLayout = false;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
this.toggleDockWidth = () => {
|
|
72
|
+
this.expanded = !this.expanded;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
componentDidLoad() {
|
|
76
|
+
this.resizeObserver = new ResizeObserver(this.handleResize);
|
|
77
|
+
this.resizeObserver.observe(document.body);
|
|
78
|
+
}
|
|
79
|
+
disconnectedCallback() {
|
|
80
|
+
this.resizeObserver.disconnect();
|
|
81
|
+
}
|
|
82
|
+
render() {
|
|
83
|
+
return (h(Host, { class: {
|
|
84
|
+
dock: true,
|
|
85
|
+
expanded: this.expanded,
|
|
86
|
+
'has-mobile-layout': this.useMobileLayout,
|
|
87
|
+
} }, h("nav", { "aria-label": this.accessibleLabel }, this.dockItems.map(this.renderDockItem), this.renderSeparator(), this.dockFooterItems.map(this.renderDockItem)), this.renderExpandShrinkToggle()));
|
|
88
|
+
}
|
|
89
|
+
renderExpandShrinkToggle() {
|
|
90
|
+
if (this.useMobileLayout || !this.allowResize) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
return (h("button", { class: {
|
|
94
|
+
'expand-shrink': true,
|
|
95
|
+
expanded: this.expanded,
|
|
96
|
+
}, onClick: this.toggleDockWidth }, h("limel-icon", { name: "angle_right" })));
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
Dock.style = dockCss;
|
|
100
|
+
|
|
101
|
+
export { Dock as limel_dock };
|