le-kit 0.1.18 → 0.2.0
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/index-pT2cVC5w.js.map +1 -1
- package/dist/cjs/le-button_13.cjs.entry.js +24 -28
- package/dist/cjs/le-card.cjs.entry.js +1 -1
- package/dist/cjs/le-combobox.cjs.entry.js +1 -1
- package/dist/cjs/le-header-placeholder.cjs.entry.js +1 -1
- package/dist/cjs/le-icon.cjs.entry.js +108 -0
- package/dist/cjs/le-kit.cjs.js +1 -1
- package/dist/cjs/le-multiselect.cjs.entry.js +3 -3
- package/dist/cjs/le-navigation.cjs.entry.js +499 -0
- package/dist/cjs/le-number-input.cjs.entry.js +1 -1
- package/dist/cjs/le-round-progress.cjs.entry.js +1 -1
- package/dist/cjs/le-segmented-control.cjs.entry.js +1 -1
- package/dist/cjs/le-stack.cjs.entry.js +1 -1
- package/dist/cjs/le-tab-bar.cjs.entry.js +1 -1
- package/dist/cjs/le-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/le-tab.cjs.entry.js +1 -1
- package/dist/cjs/le-tabs.cjs.entry.js +2 -2
- package/dist/cjs/le-tag.cjs.entry.js +1 -1
- package/dist/cjs/le-turntable.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/assets/icons/chevron-down.svg +3 -0
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/le-button/le-button.css +24 -24
- package/dist/collection/components/le-button/le-button.js +2 -2
- package/dist/collection/components/le-button/le-button.js.map +1 -1
- package/dist/collection/components/le-card/le-card.js +1 -1
- package/dist/collection/components/le-checkbox/le-checkbox.js +1 -1
- package/dist/collection/components/le-collapse/le-collapse.css +3 -3
- package/dist/collection/components/le-collapse/le-collapse.js +11 -15
- package/dist/collection/components/le-collapse/le-collapse.js.map +1 -1
- package/dist/collection/components/le-combobox/le-combobox.js +1 -1
- package/dist/collection/components/le-current-heading/le-current-heading.js +1 -1
- package/dist/collection/components/le-dropdown-base/le-dropdown-base.js +1 -1
- package/dist/collection/components/le-header/le-header.js +2 -2
- package/dist/collection/components/le-header-placeholder/le-header-placeholder.js +1 -1
- package/dist/collection/components/le-icon/le-icon.css +13 -0
- package/dist/collection/components/le-icon/le-icon.js +168 -0
- package/dist/collection/components/le-icon/le-icon.js.map +1 -0
- package/dist/collection/components/le-multiselect/le-multiselect.js +3 -3
- package/dist/collection/components/le-navigation/le-navigation.css +323 -0
- package/dist/collection/components/le-navigation/le-navigation.js +742 -0
- package/dist/collection/components/le-navigation/le-navigation.js.map +1 -0
- package/dist/collection/components/le-number-input/le-number-input.js +1 -1
- package/dist/collection/components/le-popover/le-popover.js +3 -3
- package/dist/collection/components/le-popup/le-popup.js +7 -7
- package/dist/collection/components/le-round-progress/le-round-progress.js +1 -1
- package/dist/collection/components/le-scroll-progress/le-scroll-progress.js +1 -1
- package/dist/collection/components/le-segmented-control/le-segmented-control.js +1 -1
- package/dist/collection/components/le-select/le-select.js +2 -2
- package/dist/collection/components/le-slot/le-slot.js +1 -1
- package/dist/collection/components/le-stack/le-stack.js +1 -1
- package/dist/collection/components/le-string-input/le-string-input.js +2 -2
- package/dist/collection/components/le-tab/le-tab.js +1 -1
- package/dist/collection/components/le-tab-bar/le-tab-bar.js +1 -1
- package/dist/collection/components/le-tab-panel/le-tab-panel.js +2 -2
- package/dist/collection/components/le-tabs/le-tabs.js +2 -2
- package/dist/collection/components/le-tag/le-tag.js +1 -1
- package/dist/collection/components/le-turntable/le-turntable.js +1 -1
- package/dist/collection/dist/components/assets/custom-elements.json +2149 -1404
- package/dist/collection/dist/components/assets/icons/chevron-down.json +13 -0
- package/dist/collection/dist/components/assets/icons/chevron-down.svg +3 -0
- package/dist/collection/types/options.js.map +1 -1
- package/dist/components/assets/custom-elements.json +2149 -1404
- package/dist/components/assets/icons/chevron-down.json +13 -0
- package/dist/components/assets/icons/chevron-down.svg +3 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/le-button2.js +8 -8
- package/dist/components/le-button2.js.map +1 -1
- package/dist/components/le-card.js +1 -1
- package/dist/components/le-collapse.js +1 -137
- package/dist/components/le-collapse.js.map +1 -1
- package/dist/components/le-collapse2.js +138 -0
- package/dist/components/le-collapse2.js.map +1 -0
- package/dist/components/le-combobox.js +1 -1
- package/dist/components/le-current-heading.js +1 -1
- package/dist/components/le-dropdown-base2.js +1 -1
- package/dist/components/le-header-placeholder.js +1 -1
- package/dist/components/le-header.js +2 -2
- package/dist/components/le-icon.d.ts +11 -0
- package/dist/components/le-icon.js +9 -0
- package/dist/components/le-icon.js.map +1 -0
- package/dist/components/le-icon2.js +133 -0
- package/dist/components/le-icon2.js.map +1 -0
- package/dist/components/le-multiselect.js +3 -3
- package/dist/components/le-navigation.d.ts +11 -0
- package/dist/components/le-navigation.js +598 -0
- package/dist/components/le-navigation.js.map +1 -0
- package/dist/components/le-number-input.js +1 -1
- package/dist/components/le-popover2.js +3 -3
- package/dist/components/le-round-progress.js +1 -1
- package/dist/components/le-scroll-progress.js +1 -1
- package/dist/components/le-segmented-control.js +1 -1
- package/dist/components/le-stack.js +1 -1
- package/dist/components/le-tab-bar.js +1 -1
- package/dist/components/le-tab-panel.js +2 -2
- package/dist/components/le-tab2.js +1 -1
- package/dist/components/le-tabs.js +2 -2
- package/dist/components/le-tag2.js +1 -1
- package/dist/components/le-turntable.js +1 -1
- package/dist/docs.json +515 -27
- package/dist/esm/index-CNv6tzAt.js.map +1 -1
- package/dist/esm/le-button_13.entry.js +24 -28
- package/dist/esm/le-card.entry.js +1 -1
- package/dist/esm/le-combobox.entry.js +1 -1
- package/dist/esm/le-header-placeholder.entry.js +1 -1
- package/dist/esm/le-icon.entry.js +106 -0
- package/dist/esm/le-icon.entry.js.map +1 -0
- package/dist/esm/le-kit.js +1 -1
- package/dist/esm/le-multiselect.entry.js +3 -3
- package/dist/esm/le-navigation.entry.js +497 -0
- package/dist/esm/le-navigation.entry.js.map +1 -0
- package/dist/esm/le-number-input.entry.js +1 -1
- package/dist/esm/le-round-progress.entry.js +1 -1
- package/dist/esm/le-segmented-control.entry.js +1 -1
- package/dist/esm/le-stack.entry.js +1 -1
- package/dist/esm/le-tab-bar.entry.js +1 -1
- package/dist/esm/le-tab-panel.entry.js +2 -2
- package/dist/esm/le-tab.entry.js +1 -1
- package/dist/esm/le-tabs.entry.js +2 -2
- package/dist/esm/le-tag.entry.js +1 -1
- package/dist/esm/le-turntable.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/le-kit/dist/components/assets/custom-elements.json +2149 -1404
- package/dist/le-kit/dist/components/assets/icons/chevron-down.json +13 -0
- package/dist/le-kit/dist/components/assets/icons/chevron-down.svg +3 -0
- package/dist/le-kit/le-kit.esm.js +1 -1
- package/dist/le-kit/{p-b3531106.entry.js → p-0ac4397c.entry.js} +2 -2
- package/dist/le-kit/{p-31c3649c.entry.js → p-25a29e69.entry.js} +2 -2
- package/dist/le-kit/p-2ec60692.entry.js +2 -0
- package/dist/le-kit/{p-269fb44f.entry.js → p-511fbb63.entry.js} +2 -2
- package/dist/le-kit/{p-8afe6862.entry.js → p-58120921.entry.js} +2 -2
- package/dist/le-kit/{p-c83a1255.entry.js → p-5ceb06d8.entry.js} +2 -2
- package/dist/le-kit/p-8c5a8f1e.entry.js +2 -0
- package/dist/le-kit/p-8c5a8f1e.entry.js.map +1 -0
- package/dist/le-kit/{p-deef1f4d.entry.js → p-9a3bdbe1.entry.js} +2 -2
- package/dist/le-kit/p-CNv6tzAt.js.map +1 -1
- package/dist/le-kit/{p-e4618b36.entry.js → p-a0d2c580.entry.js} +2 -2
- package/dist/le-kit/{p-629c5e13.entry.js → p-a8963634.entry.js} +2 -2
- package/dist/le-kit/p-b1dc7e06.entry.js +2 -0
- package/dist/le-kit/p-b1dc7e06.entry.js.map +1 -0
- package/dist/le-kit/p-bb160082.entry.js +2 -0
- package/dist/le-kit/p-bb160082.entry.js.map +1 -0
- package/dist/le-kit/{p-7d316315.entry.js → p-de5638c9.entry.js} +2 -2
- package/dist/le-kit/{p-d2a5d431.entry.js → p-df9389f0.entry.js} +2 -2
- package/dist/le-kit/{p-684adc9f.entry.js → p-e24d3e33.entry.js} +2 -2
- package/dist/le-kit/{p-95cf203e.entry.js → p-ec20e438.entry.js} +2 -2
- package/dist/le-kit/{p-9ba2bfb3.entry.js → p-f4f2c3e7.entry.js} +2 -2
- package/dist/types/components/le-collapse/le-collapse.d.ts +5 -3
- package/dist/types/components/le-icon/le-icon.d.ts +28 -0
- package/dist/types/components/le-navigation/le-navigation.d.ts +112 -0
- package/dist/types/components.d.ts +194 -10
- package/dist/types/types/options.d.ts +5 -0
- package/package.json +1 -1
- package/dist/collection/dist/components/assets/.gitkeep +0 -1
- package/dist/components/assets/.gitkeep +0 -1
- package/dist/le-kit/dist/components/assets/.gitkeep +0 -1
- package/dist/le-kit/p-3829f572.entry.js +0 -2
- package/dist/le-kit/p-3829f572.entry.js.map +0 -1
- package/dist/le-kit/p-e07d4b78.entry.js +0 -2
- /package/dist/le-kit/{p-b3531106.entry.js.map → p-0ac4397c.entry.js.map} +0 -0
- /package/dist/le-kit/{p-31c3649c.entry.js.map → p-25a29e69.entry.js.map} +0 -0
- /package/dist/le-kit/{p-e07d4b78.entry.js.map → p-2ec60692.entry.js.map} +0 -0
- /package/dist/le-kit/{p-269fb44f.entry.js.map → p-511fbb63.entry.js.map} +0 -0
- /package/dist/le-kit/{p-8afe6862.entry.js.map → p-58120921.entry.js.map} +0 -0
- /package/dist/le-kit/{p-c83a1255.entry.js.map → p-5ceb06d8.entry.js.map} +0 -0
- /package/dist/le-kit/{p-deef1f4d.entry.js.map → p-9a3bdbe1.entry.js.map} +0 -0
- /package/dist/le-kit/{p-e4618b36.entry.js.map → p-a0d2c580.entry.js.map} +0 -0
- /package/dist/le-kit/{p-629c5e13.entry.js.map → p-a8963634.entry.js.map} +0 -0
- /package/dist/le-kit/{p-7d316315.entry.js.map → p-de5638c9.entry.js.map} +0 -0
- /package/dist/le-kit/{p-d2a5d431.entry.js.map → p-df9389f0.entry.js.map} +0 -0
- /package/dist/le-kit/{p-684adc9f.entry.js.map → p-e24d3e33.entry.js.map} +0 -0
- /package/dist/le-kit/{p-95cf203e.entry.js.map → p-ec20e438.entry.js.map} +0 -0
- /package/dist/le-kit/{p-9ba2bfb3.entry.js.map → p-f4f2c3e7.entry.js.map} +0 -0
|
@@ -25,7 +25,7 @@ const LeCard$1 = /*@__PURE__*/ proxyCustomElement(class LeCard extends HTMLEleme
|
|
|
25
25
|
*/
|
|
26
26
|
interactive = false;
|
|
27
27
|
render() {
|
|
28
|
-
return (h("le-component", { key: '
|
|
28
|
+
return (h("le-component", { key: 'b7eb138d4df55f27716d53c41ff7e1035e058cbe', component: "le-card", hostClass: classnames(`variant-${this.variant}`, { 'interactive': this.interactive }) }, h("div", { key: 'db58aceaf332727671c73f121bd7c7b7c00c798e', class: "card", part: "card" }, h("div", { key: '1eb45033cee8e18dc9edfaba3341b1c8df8c737c', class: "card-header", part: "header" }, h("le-slot", { key: 'e77e29b0cf5965063554a50936fa0e9026fbc73a', name: "header", label: "Header", description: "Card title", type: "text", tag: "h3" }, h("slot", { key: 'b67e02c52fbfa2a7b1ed58e0c1537355af9a125e', name: "header" }))), h("div", { key: 'bcdbdc7c2e7addaaa4892d41cf5af2e43260c876', class: "card-content", part: "content" }, h("le-slot", { key: 'e4dc82322cbcb0ca884ac55c7805fa860fdaf588', name: "", label: "Content", description: "Card content", type: "textarea", tag: "p", required: true }, h("slot", { key: 'e9576903dfc9c04c01614207078ee02a03d9f4b8' }))), h("div", { key: '6f684335dfc5acd55cbd832e2cd6f8a468df7a9a', class: "card-footer", part: "footer" }, h("le-slot", { key: 'b4013edc8431ba54f44cabd4763916c6e83bc6a8', name: "footer", label: "Footer", description: "Card footer with actions", "allowed-components": "le-button,le-link" }, h("slot", { key: '9e9d1c9d99beb2d877a9b8d59b13659e0c9c6459', name: "footer" }))))));
|
|
29
29
|
}
|
|
30
30
|
static get style() { return leCardDefaultCss(); }
|
|
31
31
|
}, [769, "le-card", {
|
|
@@ -1,140 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as defineCustomElement$2, a as defineCustomElement$3, b as defineCustomElement$4, c as defineCustomElement$5, e as defineCustomElement$8, f as defineCustomElement$9, g as defineCustomElement$a } from './le-button2.js';
|
|
3
|
-
import { d as defineCustomElement$7 } from './le-dropdown-base2.js';
|
|
4
|
-
import { d as defineCustomElement$6 } from './le-popover2.js';
|
|
5
|
-
|
|
6
|
-
const leCollapseCss = () => `:host{--le-collapse-duration:var(--le-transition-normal);display:grid;grid-template-rows:1fr;opacity:1;transition:grid-template-rows var(--le-collapse-duration),
|
|
7
|
-
opacity var(--le-collapse-duration)}:host([data-open="false"]),:host([open="false"]){grid-template-rows:0fr;opacity:0}:host([no-fading][data-open="false"]),:host([no-fading][open="false"]){opacity:1}.region{display:flex;flex-direction:column;justify-content:flex-end;overflow:hidden}:host([scroll-down]) .region{justify-content:flex-start}`;
|
|
8
|
-
|
|
9
|
-
const LeCollapse$1 = /*@__PURE__*/ proxyCustomElement(class LeCollapse extends HTMLElement {
|
|
10
|
-
constructor(registerHost) {
|
|
11
|
-
super();
|
|
12
|
-
if (registerHost !== false) {
|
|
13
|
-
this.__registerHost();
|
|
14
|
-
}
|
|
15
|
-
this.__attachShadow();
|
|
16
|
-
}
|
|
17
|
-
get el() { return this; }
|
|
18
|
-
/** Whether the content should be shown. */
|
|
19
|
-
open = true;
|
|
20
|
-
/** Whether the content should scroll down from the top when open. */
|
|
21
|
-
scrollDown = false;
|
|
22
|
-
/** Stop fading the content when collapsing/expanding. */
|
|
23
|
-
noFading = false;
|
|
24
|
-
/** If true, collapse/expand based on the nearest header shrink event. */
|
|
25
|
-
collapseOnHeaderShrink = false;
|
|
26
|
-
/**
|
|
27
|
-
* Handles `leHeaderShrinkChange` events from the `le-header`.
|
|
28
|
-
* In case multiple headers are present, only the nearest one in the DOM tree is used.
|
|
29
|
-
*/
|
|
30
|
-
handleHeaderShrink(ev) {
|
|
31
|
-
const e = ev;
|
|
32
|
-
this.headerShrunk = !!e.detail?.shrunk;
|
|
33
|
-
}
|
|
34
|
-
headerShrunk = false;
|
|
35
|
-
componentWillLoad() {
|
|
36
|
-
// Stencil boolean props default to `false` when the attribute is missing.
|
|
37
|
-
// For this component, the desired default is open=true.
|
|
38
|
-
if (!this.el.hasAttribute('open')) {
|
|
39
|
-
this.open = true;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
componentDidLoad() {
|
|
43
|
-
this.applyOpenState();
|
|
44
|
-
}
|
|
45
|
-
onOpenChange() {
|
|
46
|
-
this.applyOpenState();
|
|
47
|
-
}
|
|
48
|
-
onDrivenStateChange() {
|
|
49
|
-
this.applyOpenState();
|
|
50
|
-
}
|
|
51
|
-
shouldBeOpen() {
|
|
52
|
-
if (!this.open)
|
|
53
|
-
return false;
|
|
54
|
-
if (this.collapseOnHeaderShrink && this.headerShrunk)
|
|
55
|
-
return false;
|
|
56
|
-
return true;
|
|
57
|
-
}
|
|
58
|
-
applyOpenState() {
|
|
59
|
-
const nextOpen = this.shouldBeOpen();
|
|
60
|
-
this.el.toggleAttribute('data-open', nextOpen);
|
|
61
|
-
}
|
|
62
|
-
render() {
|
|
63
|
-
return (h(Host, { key: '30fe288583bae1645ce00714de95c40ed92b7af0', "data-open": this.shouldBeOpen() ? 'true' : 'false' }, h("le-component", { key: '5fdc1e83caaff73fedb61d7286fc56f03fa8127a', component: "le-collapse" }, h("div", { key: '185df372a5039be23abf42ff262ef2d3eaa1602f', class: "region", part: "region" }, h("slot", { key: '1790f5457264342d71aecb94a67ce4ee11149af2' })))));
|
|
64
|
-
}
|
|
65
|
-
static get watchers() { return {
|
|
66
|
-
"open": ["onOpenChange"],
|
|
67
|
-
"headerShrunk": ["onDrivenStateChange"]
|
|
68
|
-
}; }
|
|
69
|
-
static get style() { return leCollapseCss(); }
|
|
70
|
-
}, [769, "le-collapse", {
|
|
71
|
-
"open": [1540],
|
|
72
|
-
"scrollDown": [516, "scroll-down"],
|
|
73
|
-
"noFading": [516, "no-fading"],
|
|
74
|
-
"collapseOnHeaderShrink": [516, "collapse-on-header-shrink"],
|
|
75
|
-
"headerShrunk": [32]
|
|
76
|
-
}, [[8, "leHeaderShrinkChange", "handleHeaderShrink"]], {
|
|
77
|
-
"open": ["onOpenChange"],
|
|
78
|
-
"headerShrunk": ["onDrivenStateChange"]
|
|
79
|
-
}]);
|
|
80
|
-
function defineCustomElement$1() {
|
|
81
|
-
if (typeof customElements === "undefined") {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
const components = ["le-collapse", "le-button", "le-checkbox", "le-component", "le-dropdown-base", "le-popover", "le-popup", "le-select", "le-slot", "le-string-input"];
|
|
85
|
-
components.forEach(tagName => { switch (tagName) {
|
|
86
|
-
case "le-collapse":
|
|
87
|
-
if (!customElements.get(transformTag(tagName))) {
|
|
88
|
-
customElements.define(transformTag(tagName), LeCollapse$1);
|
|
89
|
-
}
|
|
90
|
-
break;
|
|
91
|
-
case "le-button":
|
|
92
|
-
if (!customElements.get(transformTag(tagName))) {
|
|
93
|
-
defineCustomElement$a();
|
|
94
|
-
}
|
|
95
|
-
break;
|
|
96
|
-
case "le-checkbox":
|
|
97
|
-
if (!customElements.get(transformTag(tagName))) {
|
|
98
|
-
defineCustomElement$9();
|
|
99
|
-
}
|
|
100
|
-
break;
|
|
101
|
-
case "le-component":
|
|
102
|
-
if (!customElements.get(transformTag(tagName))) {
|
|
103
|
-
defineCustomElement$8();
|
|
104
|
-
}
|
|
105
|
-
break;
|
|
106
|
-
case "le-dropdown-base":
|
|
107
|
-
if (!customElements.get(transformTag(tagName))) {
|
|
108
|
-
defineCustomElement$7();
|
|
109
|
-
}
|
|
110
|
-
break;
|
|
111
|
-
case "le-popover":
|
|
112
|
-
if (!customElements.get(transformTag(tagName))) {
|
|
113
|
-
defineCustomElement$6();
|
|
114
|
-
}
|
|
115
|
-
break;
|
|
116
|
-
case "le-popup":
|
|
117
|
-
if (!customElements.get(transformTag(tagName))) {
|
|
118
|
-
defineCustomElement$5();
|
|
119
|
-
}
|
|
120
|
-
break;
|
|
121
|
-
case "le-select":
|
|
122
|
-
if (!customElements.get(transformTag(tagName))) {
|
|
123
|
-
defineCustomElement$4();
|
|
124
|
-
}
|
|
125
|
-
break;
|
|
126
|
-
case "le-slot":
|
|
127
|
-
if (!customElements.get(transformTag(tagName))) {
|
|
128
|
-
defineCustomElement$3();
|
|
129
|
-
}
|
|
130
|
-
break;
|
|
131
|
-
case "le-string-input":
|
|
132
|
-
if (!customElements.get(transformTag(tagName))) {
|
|
133
|
-
defineCustomElement$2();
|
|
134
|
-
}
|
|
135
|
-
break;
|
|
136
|
-
} });
|
|
137
|
-
}
|
|
1
|
+
import { L as LeCollapse$1, d as defineCustomElement$1 } from './le-collapse2.js';
|
|
138
2
|
|
|
139
3
|
const LeCollapse = LeCollapse$1;
|
|
140
4
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"le-collapse.js","mappings":"
|
|
1
|
+
{"file":"le-collapse.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host, transformTag } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$1, a as defineCustomElement$2, b as defineCustomElement$3, c as defineCustomElement$4, e as defineCustomElement$7, f as defineCustomElement$8, g as defineCustomElement$9 } from './le-button2.js';
|
|
3
|
+
import { d as defineCustomElement$6 } from './le-dropdown-base2.js';
|
|
4
|
+
import { d as defineCustomElement$5 } from './le-popover2.js';
|
|
5
|
+
|
|
6
|
+
const leCollapseCss = () => `:host{--le-collapse-duration:var(--le-transition-normal);display:grid;grid-template-rows:1fr;opacity:1;transition:grid-template-rows var(--le-collapse-duration),
|
|
7
|
+
opacity var(--le-collapse-duration)}:host([data-open="false"]),:host([closed]){grid-template-rows:0fr;opacity:0}:host([no-fading][data-open="false"]),:host([no-fading][closed]){opacity:1}.region{display:flex;flex-direction:column;justify-content:flex-end;overflow:hidden}.region.scroll-down{justify-content:flex-start}`;
|
|
8
|
+
|
|
9
|
+
const LeCollapse = /*@__PURE__*/ proxyCustomElement(class LeCollapse extends HTMLElement {
|
|
10
|
+
constructor(registerHost) {
|
|
11
|
+
super();
|
|
12
|
+
if (registerHost !== false) {
|
|
13
|
+
this.__registerHost();
|
|
14
|
+
}
|
|
15
|
+
this.__attachShadow();
|
|
16
|
+
}
|
|
17
|
+
get el() { return this; }
|
|
18
|
+
/**
|
|
19
|
+
* Since Stencil boolean props default to `false` when the attribute is missing.
|
|
20
|
+
* instead of `open` defaulting to `true`, using a `closed` prop.
|
|
21
|
+
*/
|
|
22
|
+
closed = false;
|
|
23
|
+
/** Whether the content should scroll down from the top when open. */
|
|
24
|
+
scrollDown = false;
|
|
25
|
+
/** Stop fading the content when collapsing/expanding. */
|
|
26
|
+
noFading = false;
|
|
27
|
+
/** If true, collapse/expand based on the nearest header shrink event. */
|
|
28
|
+
collapseOnHeaderShrink = false;
|
|
29
|
+
/**
|
|
30
|
+
* Handles `leHeaderShrinkChange` events from the `le-header`.
|
|
31
|
+
* In case multiple headers are present, only the nearest one in the DOM tree is used.
|
|
32
|
+
*/
|
|
33
|
+
handleHeaderShrink(ev) {
|
|
34
|
+
const e = ev;
|
|
35
|
+
this.headerShrunk = !!e.detail?.shrunk;
|
|
36
|
+
}
|
|
37
|
+
headerShrunk = false;
|
|
38
|
+
componentDidLoad() {
|
|
39
|
+
this.applyOpenState();
|
|
40
|
+
}
|
|
41
|
+
onOpenChange() {
|
|
42
|
+
this.applyOpenState();
|
|
43
|
+
}
|
|
44
|
+
onDrivenStateChange() {
|
|
45
|
+
this.applyOpenState();
|
|
46
|
+
}
|
|
47
|
+
shouldBeOpen() {
|
|
48
|
+
if (this.closed)
|
|
49
|
+
return false;
|
|
50
|
+
if (this.collapseOnHeaderShrink && this.headerShrunk)
|
|
51
|
+
return false;
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
applyOpenState() {
|
|
55
|
+
const nextOpen = this.shouldBeOpen();
|
|
56
|
+
this.el.toggleAttribute('data-open', nextOpen);
|
|
57
|
+
}
|
|
58
|
+
render() {
|
|
59
|
+
return (h(Host, { key: '946501d440fa391cfea13283072c387fd1e98b65', "data-open": this.shouldBeOpen() ? 'true' : 'false' }, h("le-component", { key: 'fb5c7e9f9e15dc3ef440f9703977ee7f09ffe676', component: "le-collapse" }, h("div", { key: '83ec865adb8a11cc9de7a6a173b85245414360e8', class: { 'region': true, 'scroll-down': this.scrollDown }, part: "region" }, h("slot", { key: '6b402e2beac8bde188da48719f47e5f9fc12581d' })))));
|
|
60
|
+
}
|
|
61
|
+
static get watchers() { return {
|
|
62
|
+
"open": ["onOpenChange"],
|
|
63
|
+
"headerShrunk": ["onDrivenStateChange"]
|
|
64
|
+
}; }
|
|
65
|
+
static get style() { return leCollapseCss(); }
|
|
66
|
+
}, [769, "le-collapse", {
|
|
67
|
+
"closed": [1540],
|
|
68
|
+
"scrollDown": [516, "scroll-down"],
|
|
69
|
+
"noFading": [516, "no-fading"],
|
|
70
|
+
"collapseOnHeaderShrink": [516, "collapse-on-header-shrink"],
|
|
71
|
+
"headerShrunk": [32]
|
|
72
|
+
}, [[8, "leHeaderShrinkChange", "handleHeaderShrink"]], {
|
|
73
|
+
"open": ["onOpenChange"],
|
|
74
|
+
"headerShrunk": ["onDrivenStateChange"]
|
|
75
|
+
}]);
|
|
76
|
+
function defineCustomElement() {
|
|
77
|
+
if (typeof customElements === "undefined") {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const components = ["le-collapse", "le-button", "le-checkbox", "le-component", "le-dropdown-base", "le-popover", "le-popup", "le-select", "le-slot", "le-string-input"];
|
|
81
|
+
components.forEach(tagName => { switch (tagName) {
|
|
82
|
+
case "le-collapse":
|
|
83
|
+
if (!customElements.get(transformTag(tagName))) {
|
|
84
|
+
customElements.define(transformTag(tagName), LeCollapse);
|
|
85
|
+
}
|
|
86
|
+
break;
|
|
87
|
+
case "le-button":
|
|
88
|
+
if (!customElements.get(transformTag(tagName))) {
|
|
89
|
+
defineCustomElement$9();
|
|
90
|
+
}
|
|
91
|
+
break;
|
|
92
|
+
case "le-checkbox":
|
|
93
|
+
if (!customElements.get(transformTag(tagName))) {
|
|
94
|
+
defineCustomElement$8();
|
|
95
|
+
}
|
|
96
|
+
break;
|
|
97
|
+
case "le-component":
|
|
98
|
+
if (!customElements.get(transformTag(tagName))) {
|
|
99
|
+
defineCustomElement$7();
|
|
100
|
+
}
|
|
101
|
+
break;
|
|
102
|
+
case "le-dropdown-base":
|
|
103
|
+
if (!customElements.get(transformTag(tagName))) {
|
|
104
|
+
defineCustomElement$6();
|
|
105
|
+
}
|
|
106
|
+
break;
|
|
107
|
+
case "le-popover":
|
|
108
|
+
if (!customElements.get(transformTag(tagName))) {
|
|
109
|
+
defineCustomElement$5();
|
|
110
|
+
}
|
|
111
|
+
break;
|
|
112
|
+
case "le-popup":
|
|
113
|
+
if (!customElements.get(transformTag(tagName))) {
|
|
114
|
+
defineCustomElement$4();
|
|
115
|
+
}
|
|
116
|
+
break;
|
|
117
|
+
case "le-select":
|
|
118
|
+
if (!customElements.get(transformTag(tagName))) {
|
|
119
|
+
defineCustomElement$3();
|
|
120
|
+
}
|
|
121
|
+
break;
|
|
122
|
+
case "le-slot":
|
|
123
|
+
if (!customElements.get(transformTag(tagName))) {
|
|
124
|
+
defineCustomElement$2();
|
|
125
|
+
}
|
|
126
|
+
break;
|
|
127
|
+
case "le-string-input":
|
|
128
|
+
if (!customElements.get(transformTag(tagName))) {
|
|
129
|
+
defineCustomElement$1();
|
|
130
|
+
}
|
|
131
|
+
break;
|
|
132
|
+
} });
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export { LeCollapse as L, defineCustomElement as d };
|
|
136
|
+
//# sourceMappingURL=le-collapse2.js.map
|
|
137
|
+
|
|
138
|
+
//# sourceMappingURL=le-collapse2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"le-collapse2.js","mappings":";;;;;AAAA,MAAM,aAAa,GAAG,MAAM,CAAC;AAC7B,kUAAkU,CAAC;;MCwBtT,UAAU,iBAAAA,kBAAA,CAAA,MAAA,UAAA,SAAA,WAAA,CAAA;;;;;;;;;AAGrB;;;AAGG;IACqC,MAAM,GAAY,KAAK;;IAGZ,UAAU,GAAY,KAAK;;IAG7B,QAAQ,GAAY,KAAK;;IAGT,sBAAsB,GACrF,KAAK;AAEP;;;AAGG;AAEH,IAAA,kBAAkB,CAAC,EAAS,EAAA;QAC1B,MAAM,CAAC,GAAG,EAAsC;QAChD,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,MAAM;;IAGvB,YAAY,GAAY,KAAK;IAE9C,gBAAgB,GAAA;QACd,IAAI,CAAC,cAAc,EAAE;;IAIb,YAAY,GAAA;QACpB,IAAI,CAAC,cAAc,EAAE;;IAIb,mBAAmB,GAAA;QAC3B,IAAI,CAAC,cAAc,EAAE;;IAGf,YAAY,GAAA;QAClB,IAAI,IAAI,CAAC,MAAM;AAAE,YAAA,OAAO,KAAK;AAC7B,QAAA,IAAI,IAAI,CAAC,sBAAsB,IAAI,IAAI,CAAC,YAAY;AAAE,YAAA,OAAO,KAAK;AAClE,QAAA,OAAO,IAAI;;IAGL,cAAc,GAAA;AACpB,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,EAAE;QACpC,IAAI,CAAC,EAAE,CAAC,eAAe,CAAC,WAAW,EAAE,QAAQ,CAAC;;IAGhD,MAAM,GAAA;AACJ,QAAA,QACE,CAAA,CAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,WAAA,EAAY,IAAI,CAAC,YAAY,EAAE,GAAG,MAAM,GAAG,OAAO,EAAA,EACrD,CAAc,CAAA,cAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,SAAS,EAAC,aAAa,EAAA,EACnC,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,EAAC,QAAQ,EAAA,EAC3E,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAa,CACT,CACO,CACV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement"],"sources":["src/components/le-collapse/le-collapse.css?tag=le-collapse&encapsulation=shadow","src/components/le-collapse/le-collapse.tsx"],"sourcesContent":[":host {\n --le-collapse-duration: var(--le-transition-normal);\n\n display: grid;\n grid-template-rows: 1fr;\n opacity: 1;\n transition:\n grid-template-rows var(--le-collapse-duration),\n opacity var(--le-collapse-duration);\n}\n\n:host([data-open=\"false\"]),\n:host([closed]) {\n grid-template-rows: 0fr;\n opacity: 0;\n}\n:host([no-fading][data-open=\"false\"]),\n:host([no-fading][closed]) {\n opacity: 1;\n}\n\n.region {\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n overflow: hidden;\n}\n\n.region.scroll-down {\n justify-content: flex-start;\n}\n","import { Component, Element, h, Host, Listen, Prop, State, Watch } from '@stencil/core';\n\nexport type LeCollapseAnimation = 'fade' | 'collapse' | 'fade-collapse';\n\n/**\n * Animated show/hide wrapper.\n *\n * Supports height collapse (auto->0) and/or fading.\n * Can optionally listen to the nearest `le-header` shrink events.\n *\n * @slot - Content to animate\n *\n * @cssprop --le-collapse-duration - Transition duration\n *\n * @csspart region - Collapsible region\n * @csspart content - Inner content\n *\n * @cmsEditable true\n * @cmsCategory Layout\n */\n@Component({\n tag: 'le-collapse',\n styleUrl: 'le-collapse.css',\n shadow: true,\n})\nexport class LeCollapse {\n @Element() el: HTMLElement;\n\n /**\n * Since Stencil boolean props default to `false` when the attribute is missing.\n * instead of `open` defaulting to `true`, using a `closed` prop.\n */\n @Prop({ mutable: true, reflect: true }) closed: boolean = false;\n\n /** Whether the content should scroll down from the top when open. */\n @Prop({ attribute: 'scroll-down', reflect: true }) scrollDown: boolean = false;\n\n /** Stop fading the content when collapsing/expanding. */\n @Prop({ attribute: 'no-fading', reflect: true }) noFading: boolean = false;\n\n /** If true, collapse/expand based on the nearest header shrink event. */\n @Prop({ attribute: 'collapse-on-header-shrink', reflect: true }) collapseOnHeaderShrink: boolean =\n false;\n\n /**\n * Handles `leHeaderShrinkChange` events from the `le-header`.\n * In case multiple headers are present, only the nearest one in the DOM tree is used.\n */\n @Listen('leHeaderShrinkChange', { target: 'window' })\n handleHeaderShrink(ev: Event) {\n const e = ev as CustomEvent<{ shrunk: boolean }>;\n this.headerShrunk = !!e.detail?.shrunk;\n }\n\n @State() private headerShrunk: boolean = false;\n\n componentDidLoad() {\n this.applyOpenState();\n }\n\n @Watch('open')\n protected onOpenChange() {\n this.applyOpenState();\n }\n\n @Watch('headerShrunk')\n protected onDrivenStateChange() {\n this.applyOpenState();\n }\n\n private shouldBeOpen() {\n if (this.closed) return false;\n if (this.collapseOnHeaderShrink && this.headerShrunk) return false;\n return true;\n }\n\n private applyOpenState() {\n const nextOpen = this.shouldBeOpen();\n this.el.toggleAttribute('data-open', nextOpen);\n }\n\n render() {\n return (\n <Host data-open={this.shouldBeOpen() ? 'true' : 'false'}>\n <le-component component=\"le-collapse\">\n <div class={{ 'region': true, 'scroll-down': this.scrollDown }} part=\"region\">\n <slot></slot>\n </div>\n </le-component>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -229,7 +229,7 @@ const LeCombobox$1 = /*@__PURE__*/ proxyCustomElement(class LeCombobox extends H
|
|
|
229
229
|
}
|
|
230
230
|
render() {
|
|
231
231
|
const hasValue = this.inputValue.length > 0;
|
|
232
|
-
return (h("le-component", { key: '
|
|
232
|
+
return (h("le-component", { key: '5d1aae34a01c8e9d4744dee3921ad07733961158', component: "le-combobox" }, h("le-dropdown-base", { key: '449d64f2b8744828709c32051d4c6528621e7c4d', ref: el => (this.dropdownEl = el), options: this.parsedOptions, value: this.value, disabled: this.disabled, filterFn: this.filterOption, filterQuery: this.inputValue, emptyText: this.emptyText, fullWidth: this.fullWidth, closeOnClickOutside: false, onLeOptionSelect: this.handleOptionSelect, onLeDropdownOpen: this.handleDropdownOpen, onLeDropdownClose: this.handleDropdownClose }, h("div", { key: '5d4c616f2c55fba8ca5836a27af445123ef0755d', slot: "trigger", class: { 'combobox-trigger': true, 'is-open': this.open } }, h("le-string-input", { key: '70f876a2a8842ce3fd20994e11501bc7766e6570', mode: "default", hideDescription: true, inputRef: el => (this.inputEl = el), type: "text", class: "combobox-input", value: this.inputValue, placeholder: this.placeholder, disabled: this.disabled, "aria-haspopup": "listbox", "aria-expanded": this.open ? 'true' : 'false', "aria-autocomplete": "list", onInput: this.handleInputChange, onFocus: this.handleInputFocus, onKeyDown: this.handleInputKeyDown }), hasValue && !this.disabled && (h("button", { key: 'ca5e8bdd951650f63c2284bf4d4634964462838c', type: "button", class: "combobox-clear", onClick: this.handleClear, "aria-label": "Clear", tabIndex: -1 }, h("svg", { key: '49b3e50b68a9c5f8a6c0708a43a60be559f6cdd8', viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("path", { key: '33b347862ce2321bcc38823a3b25774f06e625f3', d: "M4 4l8 8M12 4l-8 8" })))), h("span", { key: 'aa4080873acd15706757f33c032ad4c0caa03f01', class: "combobox-arrow" }, h("svg", { key: '86782ee6405d553baecac64d6a780a79dd5deda0', viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("path", { key: '93cc4e3a3898c7f9b4149c2bd54934f7d9d4519b', d: "M4 6l4 4 4-4" }))))), this.name && h("input", { key: 'b0766761f5e8f48428af5e1a360cb2a51a9bf316', type: "hidden", name: this.name, value: this.value?.toString() ?? '' })));
|
|
233
233
|
}
|
|
234
234
|
static get watchers() { return {
|
|
235
235
|
"value": ["handleValueChange"],
|
|
@@ -58,7 +58,7 @@ const LeCurrentHeading$1 = /*@__PURE__*/ proxyCustomElement(class LeCurrentHeadi
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
render() {
|
|
61
|
-
return (h(Host, { key: '
|
|
61
|
+
return (h(Host, { key: 'd6773c072799d0337b7d2bade9de2c169e35d3c8' }, this.activeText ? (h("span", { class: "title", part: "title" }, this.activeText)) : (h("slot", null))));
|
|
62
62
|
}
|
|
63
63
|
static get watchers() { return {
|
|
64
64
|
"selector": ["onSelectorChange"]
|
|
@@ -338,7 +338,7 @@ const LeDropdownBase = /*@__PURE__*/ proxyCustomElement(class LeDropdownBase ext
|
|
|
338
338
|
}
|
|
339
339
|
render() {
|
|
340
340
|
const dropdownWidth = this.width || (this.triggerWidth ? `${this.triggerWidth}px` : undefined);
|
|
341
|
-
return (h(Host, { key: '
|
|
341
|
+
return (h(Host, { key: 'eeb6316ffb006adb8d53f3c2f81cadde32d261ae' }, h("le-popover", { key: '703c57bf2185590df226787778ad67cd423ce943', ref: el => (this.popoverEl = el), position: "bottom", align: "start", showClose: false, closeOnClickOutside: this.closeOnClickOutside, closeOnEscape: true, offset: 4, width: dropdownWidth, minWidth: "150px", "trigger-full-width": this.fullWidth, onLePopoverOpen: this.handlePopoverOpen, onLePopoverClose: this.handlePopoverClose }, h("slot", { key: 'bc401b4af80c9e6d15c4f5fe2a5ff2687b9ae582', name: "trigger", slot: "trigger" }), h("slot", { key: '3414d6eb1d4fecfe642b31e2a1abd271c83ab2df', name: "header" }), h("div", { key: '685d0aa6e15b6a191d517e194ae96302cfb4a191', class: "dropdown-list", role: "listbox", "aria-multiselectable": this.multiple ? 'true' : undefined, ref: el => (this.listEl = el), style: { maxHeight: this.maxHeight } }, this.renderOptions()))));
|
|
342
342
|
}
|
|
343
343
|
static get watchers() { return {
|
|
344
344
|
"options": ["handleOptionsChange"],
|
|
@@ -8,7 +8,7 @@ const LeHeaderPlaceholder$1 = /*@__PURE__*/ proxyCustomElement(class LeHeaderPla
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
render() {
|
|
11
|
-
return (h(Host, { key: '
|
|
11
|
+
return (h(Host, { key: '53a4cd451e1b53a4be3b6b20c82e12f53a982a17', "aria-hidden": "true", style: {
|
|
12
12
|
display: 'block',
|
|
13
13
|
height: 'var(--le-header-height, 64px)',
|
|
14
14
|
} }));
|
|
@@ -243,7 +243,7 @@ const LeHeader$1 = /*@__PURE__*/ proxyCustomElement(class LeHeader extends HTMLE
|
|
|
243
243
|
'is-hidden': !this.revealed,
|
|
244
244
|
'is-shrunk': this.shrunk,
|
|
245
245
|
});
|
|
246
|
-
return (h(Host, { key: '
|
|
246
|
+
return (h(Host, { key: '564328055a69a1646c7f9030ac274a30c3baad0a', class: hostClass, onMouseEnter: () => {
|
|
247
247
|
if (!this.expandOnHover)
|
|
248
248
|
return;
|
|
249
249
|
this.hoverActive = true;
|
|
@@ -253,7 +253,7 @@ const LeHeader$1 = /*@__PURE__*/ proxyCustomElement(class LeHeader extends HTMLE
|
|
|
253
253
|
return;
|
|
254
254
|
this.hoverActive = false;
|
|
255
255
|
this.scheduleUpdate(true);
|
|
256
|
-
} }, h("le-component", { key: '
|
|
256
|
+
} }, h("le-component", { key: 'a9feac7b7229ed250b4c2cade7e5dce8bb79e634', component: "le-header" }, h("header", { key: 'acebe4ea5222593e65190a35515c60ee7e15549a', class: "header", part: "header", role: "banner", ref: el => (this.headerEl = el) }, h("div", { key: 'bf37e677a5058e4e9bf74a4f6a3c62112daaea20', class: "inner", part: "inner" }, h("div", { key: 'd6886dba1b0e8003a2080f03f6bfe3fa0ffdca18', class: "row", part: "row" }, h("div", { key: 'd4c328bb74c955fa377a06f1a33783750bd83237', class: "start", part: "start" }, h("le-slot", { key: '1b9d58c81f8a498637eefd7a1310c961b014d1a5', name: "start", label: "Start", description: "Logo / back button / nav", "allowed-components": "le-button,le-text,le-tag,le-box,le-stack" }, h("slot", { key: 'd5c2727c4f427b60cad9575c0e74a18e7b229462', name: "start" }))), h("div", { key: '35831f9dfb3ff584cdc573081ebdeef1968f06c7', class: "title", part: "title" }, h("le-slot", { key: 'bed684a7880dfa79b4b7585dcb3c2bd024e0cc93', name: "title", label: "Title", description: "Header title", type: "text", tag: "span" }, h("span", { key: 'f523ee36ff1f0c6a2793e5d813d6b9a9c632f2bf', class: "title-slot", part: "title" }, h("slot", { key: '39e750e3f4231406552187e961ae7e9a206d240b', name: "title" })))), h("div", { key: 'c99435b41a905b6780c07e7103125d7c439af7cb', class: "end", part: "end" }, h("le-slot", { key: 'efca1aadcf9108add84dbb5a2ea539fb95e795c6', name: "end", label: "End", description: "Actions", "allowed-components": "le-button,le-text,le-tag,le-box,le-stack" }, h("slot", { key: 'd04b78ca1eeb1cbae4b3575f03231b93ed4d9692', name: "end" })))), h("div", { key: 'd83bda303c5fcd63da3e0419bd9276677d8f5cc7', class: "secondary", part: "secondary" }, h("le-slot", { key: '1f5f6d317e969c54d87a6ad516fed071e72f342c', name: "", label: "Secondary", description: "Secondary row content", "allowed-components": "le-tabs,le-tab-bar,le-select,le-combobox,le-text,le-stack,le-box" }, h("slot", { key: 'fb5a6a434190658f8fb55e3bc21d5f952a559ad5' }))))))));
|
|
257
257
|
}
|
|
258
258
|
static get watchers() { return {
|
|
259
259
|
"revealOnScroll": ["onBehaviorPropsChange"],
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface LeIcon extends Components.LeIcon, HTMLElement {}
|
|
4
|
+
export const LeIcon: {
|
|
5
|
+
prototype: LeIcon;
|
|
6
|
+
new (): LeIcon;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { L as LeIcon$1, d as defineCustomElement$1 } from './le-icon2.js';
|
|
2
|
+
|
|
3
|
+
const LeIcon = LeIcon$1;
|
|
4
|
+
const defineCustomElement = defineCustomElement$1;
|
|
5
|
+
|
|
6
|
+
export { LeIcon, defineCustomElement };
|
|
7
|
+
//# sourceMappingURL=le-icon.js.map
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=le-icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"le-icon.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, Build, h, transformTag, getAssetPath } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const leIconCss = () => `:host{display:inline-block;width:var(--le-icon-size, var(--le-size-4));height:var(--le-icon-size, var(--le-size-4));color:var(--le-icon-color, var(--le-color-text-primary))}:host svg{display:block;fill:currentColor}`;
|
|
4
|
+
|
|
5
|
+
const iconCache = {};
|
|
6
|
+
const requestCache = {};
|
|
7
|
+
async function fetchIcon({ name }) {
|
|
8
|
+
if (iconCache[name]) {
|
|
9
|
+
return iconCache[name];
|
|
10
|
+
}
|
|
11
|
+
if (!requestCache[name]) {
|
|
12
|
+
requestCache[name] = fetch(getAssetPath(`./assets/icons/${name}.json`))
|
|
13
|
+
.then(resp => resp.json())
|
|
14
|
+
.catch(() => {
|
|
15
|
+
console.error(`"${name}" is not a valid name`);
|
|
16
|
+
return '';
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
const path = await requestCache[name];
|
|
20
|
+
iconCache[name] = path;
|
|
21
|
+
return path;
|
|
22
|
+
}
|
|
23
|
+
const LeIcon = /*@__PURE__*/ proxyCustomElement(class LeIcon extends HTMLElement {
|
|
24
|
+
constructor(registerHost) {
|
|
25
|
+
super();
|
|
26
|
+
if (registerHost !== false) {
|
|
27
|
+
this.__registerHost();
|
|
28
|
+
}
|
|
29
|
+
this.__attachShadow();
|
|
30
|
+
}
|
|
31
|
+
get el() { return this; }
|
|
32
|
+
/**
|
|
33
|
+
* Name of the icon to display. Corresponds to a JSON file in the assets folder.
|
|
34
|
+
* For example, "search" will load the "search.json" file.
|
|
35
|
+
*/
|
|
36
|
+
name = null;
|
|
37
|
+
/**
|
|
38
|
+
* Size of the icon in pixels. Default is 16.
|
|
39
|
+
*/
|
|
40
|
+
size = 16;
|
|
41
|
+
iconData = null;
|
|
42
|
+
visible = false;
|
|
43
|
+
async loadIconData() {
|
|
44
|
+
const { name, visible } = this;
|
|
45
|
+
if (!Build.isBrowser || !name || !visible) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
this.iconData = await fetchIcon({ name });
|
|
49
|
+
}
|
|
50
|
+
intersectionObserver;
|
|
51
|
+
connectedCallback() {
|
|
52
|
+
this.waitUntilVisible(() => {
|
|
53
|
+
this.visible = true;
|
|
54
|
+
this.loadIconData();
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
disconnectedCallback() {
|
|
58
|
+
if (this.intersectionObserver) {
|
|
59
|
+
this.intersectionObserver.disconnect();
|
|
60
|
+
this.intersectionObserver = null;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async componentWillLoad() {
|
|
64
|
+
this.loadIconData();
|
|
65
|
+
}
|
|
66
|
+
waitUntilVisible(callback) {
|
|
67
|
+
if (!Build.isBrowser ||
|
|
68
|
+
typeof window === 'undefined' ||
|
|
69
|
+
!window.IntersectionObserver) {
|
|
70
|
+
callback();
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
this.intersectionObserver = new IntersectionObserver(entries => {
|
|
74
|
+
entries.forEach(entry => {
|
|
75
|
+
if (entry.isIntersecting) {
|
|
76
|
+
this.intersectionObserver.disconnect();
|
|
77
|
+
this.intersectionObserver = null;
|
|
78
|
+
callback();
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}, { rootMargin: '50px' });
|
|
82
|
+
this.intersectionObserver.observe(this.el);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Renders the SVG content out of a JSON data in a format:
|
|
86
|
+
* { "viewBox": "...", children: [{ "tag": "g", ""children": [ ... ], ...attrs }, ...] }
|
|
87
|
+
*
|
|
88
|
+
* @returns JSX.Element | null
|
|
89
|
+
*/
|
|
90
|
+
renderSVGContent(children) {
|
|
91
|
+
if (!children || children.length === 0) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
const createElement = node => {
|
|
95
|
+
const { tag, children, ...attrs } = node;
|
|
96
|
+
return h(tag, attrs, children ? children.map(createElement) : null);
|
|
97
|
+
};
|
|
98
|
+
const svgElements = children.map(createElement);
|
|
99
|
+
return svgElements;
|
|
100
|
+
}
|
|
101
|
+
render() {
|
|
102
|
+
return (h("svg", { key: 'bf1ded84a38f5d8fdb1723476f4709dc58f71def', xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", height: this.size, width: this.size, viewBox: this.iconData?.viewBox || `0 0 ${this.size} ${this.size}` }, this.renderSVGContent(this.iconData?.children)));
|
|
103
|
+
}
|
|
104
|
+
static get watchers() { return {
|
|
105
|
+
"name": ["loadIconData"]
|
|
106
|
+
}; }
|
|
107
|
+
static get style() { return leIconCss(); }
|
|
108
|
+
}, [769, "le-icon", {
|
|
109
|
+
"name": [1],
|
|
110
|
+
"size": [2],
|
|
111
|
+
"iconData": [32],
|
|
112
|
+
"visible": [32]
|
|
113
|
+
}, undefined, {
|
|
114
|
+
"name": ["loadIconData"]
|
|
115
|
+
}]);
|
|
116
|
+
function defineCustomElement() {
|
|
117
|
+
if (typeof customElements === "undefined") {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const components = ["le-icon"];
|
|
121
|
+
components.forEach(tagName => { switch (tagName) {
|
|
122
|
+
case "le-icon":
|
|
123
|
+
if (!customElements.get(transformTag(tagName))) {
|
|
124
|
+
customElements.define(transformTag(tagName), LeIcon);
|
|
125
|
+
}
|
|
126
|
+
break;
|
|
127
|
+
} });
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export { LeIcon as L, defineCustomElement as d };
|
|
131
|
+
//# sourceMappingURL=le-icon2.js.map
|
|
132
|
+
|
|
133
|
+
//# sourceMappingURL=le-icon2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"le-icon2.js","mappings":"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","names":["__stencil_proxyCustomElement"],"sources":["src/components/le-icon/le-icon.css?tag=le-icon&encapsulation=shadow","src/components/le-icon/le-icon.tsx"],"sourcesContent":[":host {\n display: inline-block;\n\n width: var(--le-icon-size, var(--le-size-4));\n height: var(--le-icon-size, var(--le-size-4));\n\n color: var(--le-icon-color, var(--le-color-text-primary));\n}\n\n:host svg {\n display: block;\n fill: currentColor;\n}\n","/**\n * Based on the script from Paul Andreson's article:\n * https://paulcpederson.com/articles/stencil-icons/\n */\nimport { Build, Component, Element, getAssetPath, h, Prop, State, Watch } from '@stencil/core';\n\nconst iconCache = {};\nconst requestCache = {};\n\nasync function fetchIcon({ name }): Promise<string> {\n if (iconCache[name]) {\n return iconCache[name];\n }\n if (!requestCache[name]) {\n requestCache[name] = fetch(getAssetPath(`./assets/icons/${name}.json`))\n .then(resp => resp.json())\n .catch(() => {\n console.error(`\"${name}\" is not a valid name`);\n return '';\n });\n }\n\n const path = await requestCache[name];\n iconCache[name] = path;\n\n return path;\n}\n\n@Component({\n tag: 'le-icon',\n styleUrl: 'le-icon.css',\n shadow: true,\n})\nexport class LeIcon {\n @Element() el: HTMLElement;\n\n /**\n * Name of the icon to display. Corresponds to a JSON file in the assets folder.\n * For example, \"search\" will load the \"search.json\" file.\n */\n @Prop() name: string = null;\n\n /**\n * Size of the icon in pixels. Default is 16.\n */\n @Prop() size: number = 16;\n\n @State() private iconData: any = null;\n\n @State() private visible = false;\n\n @Watch('name') private async loadIconData(): Promise<void> {\n const { name, visible } = this;\n\n if (!Build.isBrowser || !name || !visible) {\n return;\n }\n\n this.iconData = await fetchIcon({ name });\n }\n\n private intersectionObserver: IntersectionObserver;\n\n connectedCallback(): void {\n this.waitUntilVisible(() => {\n this.visible = true;\n this.loadIconData();\n });\n }\n\n disconnectedCallback(): void {\n if (this.intersectionObserver) {\n this.intersectionObserver.disconnect();\n this.intersectionObserver = null;\n }\n }\n\n async componentWillLoad(): Promise<void> {\n this.loadIconData();\n }\n\n private waitUntilVisible(callback: () => void): void {\n if (\n !Build.isBrowser ||\n typeof window === 'undefined' ||\n !(window as any).IntersectionObserver\n ) {\n callback();\n return;\n }\n\n this.intersectionObserver = new IntersectionObserver(\n entries => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n this.intersectionObserver.disconnect();\n this.intersectionObserver = null;\n callback();\n }\n });\n },\n { rootMargin: '50px' },\n );\n\n this.intersectionObserver.observe(this.el);\n }\n\n /**\n * Renders the SVG content out of a JSON data in a format:\n * { \"viewBox\": \"...\", children: [{ \"tag\": \"g\", \"\"children\": [ ... ], ...attrs }, ...] }\n *\n * @returns JSX.Element | null\n */\n private renderSVGContent(children?: any[]) {\n if (!children || children.length === 0) {\n return null;\n }\n\n const createElement = node => {\n const { tag, children, ...attrs } = node;\n return h(tag, attrs, children ? children.map(createElement) : null);\n };\n\n const svgElements = children.map(createElement);\n return svgElements;\n }\n\n render() {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n height={this.size}\n width={this.size}\n viewBox={this.iconData?.viewBox || `0 0 ${this.size} ${this.size}`}\n >\n {this.renderSVGContent(this.iconData?.children)}\n </svg>\n );\n }\n}\n"],"version":3}
|
|
@@ -292,13 +292,13 @@ const LeMultiselect$1 = /*@__PURE__*/ proxyCustomElement(class LeMultiselect ext
|
|
|
292
292
|
render() {
|
|
293
293
|
const hasSelections = this.selectedOptions.length > 0;
|
|
294
294
|
const atMaxSelections = this.maxSelections && this.value.length >= this.maxSelections;
|
|
295
|
-
return (h("le-component", { key: '
|
|
295
|
+
return (h("le-component", { key: '6fa8274a23f2cc144150442ca9478d405fa9db59', component: "le-multiselect" }, h("le-dropdown-base", { key: 'eccf77b1d40bcc1dbae6d6e73523199dba89c02a', ref: el => (this.dropdownEl = el), options: this.effectiveOptions, value: this.value, multiple: true, disabled: this.disabled, filterFn: this.searchable ? this.filterOption : undefined, filterQuery: this.searchQuery, emptyText: this.emptyText, showCheckboxes: true, fullWidth: this.fullWidth, onLeOptionSelect: this.handleOptionSelect, onLeDropdownOpen: this.handleDropdownOpen, onLeDropdownClose: this.handleDropdownClose }, h("div", { key: '3c665ad3efc5543a9afcb836c8a996030460723a', slot: "trigger", class: {
|
|
296
296
|
'multiselect-trigger': true,
|
|
297
297
|
'has-selections': hasSelections,
|
|
298
298
|
'is-open': this.open,
|
|
299
299
|
'is-disabled': this.disabled,
|
|
300
|
-
}, tabIndex: this.disabled ? -1 : 0, role: "combobox", "aria-haspopup": "listbox", "aria-expanded": this.open ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : undefined, onClick: this.handleTriggerClick, onKeyDown: this.handleTriggerKeyDown }, this.renderTags(), h("div", { key: '
|
|
301
|
-
this.value.map(val => (h("input", { type: "hidden", name: this.name, value: val.toString(), key: val.toString() }))), atMaxSelections && (h("span", { key: '
|
|
300
|
+
}, tabIndex: this.disabled ? -1 : 0, role: "combobox", "aria-haspopup": "listbox", "aria-expanded": this.open ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : undefined, onClick: this.handleTriggerClick, onKeyDown: this.handleTriggerKeyDown }, this.renderTags(), h("div", { key: 'a19d6d1dfa9bfb757874bb4e39f75e3dc8e4f101', class: "multiselect-actions" }, hasSelections && !this.disabled && (h("button", { key: 'f639279dd53a1eaff6ff146c57129d598bc55ca5', type: "button", class: "multiselect-clear", onClick: this.handleClearAll, "aria-label": "Clear all", tabIndex: -1 }, h("svg", { key: 'a5458f2d7dae924b7f943df067269beca1d9bfdd', viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("path", { key: 'c2fd9f943f0496e2c0e0ecbb79e1a16993cb796d', d: "M4 4l8 8M12 4l-8 8" })))), h("span", { key: 'bd7fc5ef0af6b937fea089881f3d5fc881219247', class: "multiselect-arrow" }, h("svg", { key: '180c1c3b35713fc5de0aade07ef3524dd674cca5', viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("path", { key: '48c1e6e3f2c0c20b52d2ba551d2720e5da5f0bed', d: "M4 6l4 4 4-4" }))))), this.searchable && this.open && (h("div", { key: '3b6dbe407a4d33065ff50496c14a71ebd27e71bb', class: "multiselect-search", slot: "header" }, h("le-string-input", { key: '35ed3a229b0ca6f4e1f9e8732c94a531af2d7fb3', mode: "default", inputRef: el => (this.inputEl = el), class: "search-input", placeholder: "Search...", value: this.searchQuery, onInput: this.handleSearchInput })))), this.name &&
|
|
301
|
+
this.value.map(val => (h("input", { type: "hidden", name: this.name, value: val.toString(), key: val.toString() }))), atMaxSelections && (h("span", { key: '214ee34c77755375045fce655129736ff4a1ef0f', class: "multiselect-status" }, "Maximum ", this.maxSelections, " selections"))));
|
|
302
302
|
}
|
|
303
303
|
static get watchers() { return {
|
|
304
304
|
"value": ["handleValueChange"],
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface LeNavigation extends Components.LeNavigation, HTMLElement {}
|
|
4
|
+
export const LeNavigation: {
|
|
5
|
+
prototype: LeNavigation;
|
|
6
|
+
new (): LeNavigation;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|