@luzmo/analytics-components-kit 1.0.1-alpha.2 → 1.0.1-alpha.4
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/LICENSE +18 -0
- package/custom-elements.json +1550 -0
- package/lib/area-chart-slots.config-BLxiYX05.cjs +20 -0
- package/lib/area-chart-slots.config-C0c2ZzBh.js +52 -0
- package/lib/async-directive-CPjMHOPu.cjs +24 -0
- package/lib/async-directive-SCUUQ3Mh.js +114 -0
- package/lib/bar-chart-slots.config-GSSL7XVA.js +47 -0
- package/lib/bar-chart-slots.config-Jx1PveTM.cjs +20 -0
- package/lib/bar-chart.config-B57geUzJ.cjs +20 -0
- package/lib/bar-chart.config-CQ6HAvs2.js +153 -0
- package/lib/bar-chart.en-BqYbiHO3.cjs +20 -0
- package/lib/bar-chart.en-FwT00qdU.js +69 -0
- package/lib/bar-chart.fr-DGx9smEh.cjs +20 -0
- package/lib/bar-chart.fr-DbxKiM0j.js +44 -0
- package/lib/bar-chart.nl-BYzVExsz.cjs +20 -0
- package/lib/bar-chart.nl-ahX1ARpH.js +44 -0
- package/lib/button-base-B4PdJFVe.cjs +27 -0
- package/lib/button-base-CtfPWS-P.js +142 -0
- package/lib/column-chart.config-B57geUzJ.cjs +20 -0
- package/lib/column-chart.config-C9hP0kX7.js +153 -0
- package/lib/cs-DVZ0Tapy.js +89 -0
- package/lib/cs-I9E81keK.cjs +20 -0
- package/lib/da-DHy05oSR.js +97 -0
- package/lib/da-QkdvupDg.cjs +20 -0
- package/lib/de-Dn5mUzha.cjs +20 -0
- package/lib/de-iM39JlAt.js +109 -0
- package/lib/decompose-numeric-format-B3rVVHpO.cjs +20 -0
- package/lib/decompose-numeric-format-BuZcjH2k.js +39 -0
- package/lib/directive-helpers-BSB0tfc9.cjs +32 -0
- package/lib/directive-helpers-eY1rHtyn.js +154 -0
- package/lib/divider.module-BW8qaMVq.js +211 -0
- package/lib/divider.module-DEy88Ieh.cjs +20 -0
- package/lib/donut-chart-slots.config-BEwhfq27.js +39 -0
- package/lib/donut-chart-slots.config-DIp-24lO.cjs +20 -0
- package/lib/donut-chart.config-3DhKiSSM.js +177 -0
- package/lib/donut-chart.config-DLWJUlHx.cjs +20 -0
- package/lib/donut-chart.en-Blb9oSdU.cjs +20 -0
- package/lib/donut-chart.en-CzjT4-XN.js +85 -0
- package/lib/donut-chart.fr-BeTVa2wh.cjs +20 -0
- package/lib/donut-chart.fr-DftPrKbG.js +39 -0
- package/lib/donut-chart.nl-D9YGbOce.cjs +20 -0
- package/lib/donut-chart.nl-NMatXfhK.js +39 -0
- package/lib/draggable-data-item/index.cjs +20 -0
- package/lib/draggable-data-item/index.js +30 -0
- package/lib/droppable-slot/index.cjs +20 -0
- package/lib/droppable-slot/index.js +30 -0
- package/lib/en-BDBzmAXX.cjs +202 -0
- package/lib/en-CIeY2T5K.js +1980 -0
- package/lib/en-GB-BqYHIX1v.cjs +20 -0
- package/lib/en-GB-CYx--4nh.js +28 -0
- package/lib/es-CwyPlN5d.cjs +20 -0
- package/lib/es-KhTq4jX8.js +305 -0
- package/lib/fi-Dh_ebgpe.js +97 -0
- package/lib/fi-rijeZE5V.cjs +20 -0
- package/lib/fr-BcgE-6S_.cjs +20 -0
- package/lib/fr-CU727YF1.js +305 -0
- package/lib/get-css-variable-BHHQ0SnL.js +1444 -0
- package/lib/get-css-variable-D439CdH9.cjs +24 -0
- package/lib/he-Au3xg6lR.js +89 -0
- package/lib/he-O6Ih8Bqh.cjs +20 -0
- package/lib/hu-BnZ8y3xQ.cjs +20 -0
- package/lib/hu-DNJ-P_MW.js +97 -0
- package/lib/if-defined-BbzmSG-O.js +757 -0
- package/lib/if-defined-V7yEJWI3.cjs +54 -0
- package/lib/imageobject.config-B7ld9bj3.cjs +20 -0
- package/lib/imageobject.config-DZLp9Elq.js +127 -0
- package/lib/index-0314DjEl.cjs +20 -0
- package/lib/index-B9h2L_hV.js +3048 -0
- package/lib/index-BDXFsKUM.cjs +146 -0
- package/lib/index-Bd4cKS9O.js +155 -0
- package/lib/index-BmAD29P2.js +106 -0
- package/lib/index-Bo1DpZ-1.cjs +58 -0
- package/lib/index-C4ePDYEC.cjs +41 -0
- package/lib/index-C9xEN5Ji.js +82 -0
- package/lib/index-CBCm4_7S.js +869 -0
- package/lib/index-CM80_HQw.js +442 -0
- package/lib/index-CcF-9wyF.cjs +71 -0
- package/lib/index-CfEm5P0J.cjs +196 -0
- package/lib/index-CrWoFMZ3.cjs +22 -0
- package/lib/index-CtEJZdT0.js +1627 -0
- package/lib/index-CvX-HLY1.cjs +322 -0
- package/lib/index-D37RwuEH.js +1584 -0
- package/lib/index-D5puKlcm.cjs +96 -0
- package/lib/index-DGz6jCKo.cjs +26 -0
- package/lib/index-DJp_9h0l.js +327 -0
- package/lib/index-DSbgZduE.js +501 -0
- package/lib/index-D_KYpfBM.js +24 -0
- package/lib/index-DdtjeKYI.js +928 -0
- package/lib/index-Dj7PF4Q9.cjs +63 -0
- package/lib/index-Dq3HAOaM.js +127 -0
- package/lib/index-DrIA0eFE.js +392 -0
- package/lib/index-jt6FL_uE.cjs +20 -0
- package/lib/index-kJR406YZ.cjs +112 -0
- package/lib/index-v8ZTprPO.cjs +51 -0
- package/lib/index.cjs +875 -0
- package/lib/index.js +6411 -0
- package/lib/it-Bh5U73z6.js +305 -0
- package/lib/it-PshtLMkq.cjs +20 -0
- package/lib/ja-CCcHUL61.js +89 -0
- package/lib/ja-KIS2HdaG.cjs +20 -0
- package/lib/ko--l4qmjLV.cjs +20 -0
- package/lib/ko-DhapsZMM.js +89 -0
- package/lib/line-chart.config-BZcvfO2c.cjs +20 -0
- package/lib/line-chart.config-CIVN6uLI.js +115 -0
- package/lib/mk-B9HPSuKa.js +97 -0
- package/lib/mk-DZlj-edb.cjs +20 -0
- package/lib/nl-BKlDqOXb.cjs +20 -0
- package/lib/nl-BwSt5Bf4.js +109 -0
- package/lib/no-D-DofYnx.js +109 -0
- package/lib/no-D_SzxhTu.cjs +20 -0
- package/lib/observe-slot-text-DOYmGOZe.js +181 -0
- package/lib/observe-slot-text-oJ0a2KY9.cjs +42 -0
- package/lib/picker/index.cjs +20 -0
- package/lib/picker/index.js +32 -0
- package/lib/pl-D_L_0Boq.js +97 -0
- package/lib/pl-PIK23rK_.cjs +20 -0
- package/lib/popover-Bwnkg-5-.js +67 -0
- package/lib/popover-CQGN8nbX.cjs +32 -0
- package/lib/progress-circle/index.cjs +35 -0
- package/lib/progress-circle/index.js +104 -0
- package/lib/pt-B0BBS5VB.js +89 -0
- package/lib/pt-Dqlu4MS5.cjs +20 -0
- package/lib/ru-Vo-m3O_2.js +108 -0
- package/lib/ru-zyNDTB04.cjs +20 -0
- package/lib/sv-1DPTltNQ.cjs +20 -0
- package/lib/sv-CiozMaev.js +89 -0
- package/lib/textobject.config-C8opcGG4.js +52 -0
- package/lib/textobject.config-DbAajFz8.cjs +20 -0
- package/lib/tr-BkmWvOG2.cjs +20 -0
- package/lib/tr-D_D4i5iv.js +109 -0
- package/lib/zh-CN-DTZ4OmdP.cjs +20 -0
- package/lib/zh-CN-wsl7eFSd.js +89 -0
- package/lib/zh-TW-DTZ4OmdP.cjs +20 -0
- package/lib/zh-TW-wsl7eFSd.js +89 -0
- package/package.json +19 -24
- package/37.js +0 -1
- package/729.js +0 -1
- package/common-31743c5a.js +0 -13
- package/common-b02547a0.js +0 -1
- package/common-b49d9a9d.js +0 -1
- package/common-b5232813.js +0 -56
- package/common-cefd4f4c.js +0 -1
- package/common-d6cb565f.js +0 -1
- package/common-fd868059.js +0 -1
- package/common-fedaf338.js +0 -32
- package/edit-option-picker/index.js +0 -314
- package/edit-option-slider/index.js +0 -102
- package/edit-option-toggle/index.js +0 -114
- package/index.js +0 -346
- package/vendors-93cc3efa.js +0 -1
- package/vendors-bb3d84b5.js +0 -1
@@ -0,0 +1,1627 @@
|
|
1
|
+
/*! * A kit of modern Luzmo Web Components for analytics in your web application.
|
2
|
+
*
|
3
|
+
* Copyright © 2024 Luzmo
|
4
|
+
* All rights reserved.
|
5
|
+
* Luzmo web components (“Luzmo Web Components”)
|
6
|
+
* must be used according to the Luzmo Terms of Service.
|
7
|
+
* This license allows users with a current active Luzmo account
|
8
|
+
* to use the Luzmo Web Components. This license terminates
|
9
|
+
* automatically if a user no longer has an active Luzmo account.
|
10
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
11
|
+
*
|
12
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
13
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
14
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
15
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
16
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
17
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
|
+
* SOFTWARE.
|
19
|
+
* */
|
20
|
+
import { _ as ot, d as pt, a as lt, l as K, s as ht, g as X } from "./get-css-variable-BHHQ0SnL.js";
|
21
|
+
import { b as mt, S as E, L, r as S, E as P, x as s, n as i, e as O, T as N, o as b, f as gt, a as W } from "./if-defined-BbzmSG-O.js";
|
22
|
+
import { O as C, I as vt, j as ft, y as bt, i as zt, G as H, g as xt, J as yt, K as wt } from "./index-DdtjeKYI.js";
|
23
|
+
import { E as kt, c as it, d as Ct, a as G, b as _t, e as $t, i as Et, t as j, f as St, m as Tt, r as Y } from "./directive-helpers-eY1rHtyn.js";
|
24
|
+
import { F as Lt, s as qt } from "./divider.module-BW8qaMVq.js";
|
25
|
+
import "./progress-circle/index.js";
|
26
|
+
/**
|
27
|
+
* @license
|
28
|
+
* Copyright 2017 Google LLC
|
29
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
30
|
+
*/
|
31
|
+
let It;
|
32
|
+
function Pt(n) {
|
33
|
+
return (t, e) => mt(t, e, { get() {
|
34
|
+
return (this.renderRoot ?? It ?? (It = document.createDocumentFragment())).querySelectorAll(n);
|
35
|
+
} });
|
36
|
+
}
|
37
|
+
const Ot = ":host{box-sizing:border-box;min-block-size:var(--luzmo-field-label-min-height, var(--field-label-min-height));padding-block:var(--luzmo-field-label-padding-block, var(--luzmo-field-label-top-to-text, var(--field-label-top-to-text)) var(--luzmo-field-label-bottom-to-text, var(--field-label-bottom-to-text)));padding-inline:0;padding-inline:var(--luzmo-field-label-padding-inline, 0);margin-block:0;margin-block:var(--luzmo-field-label-margin-block, var(--luzmo-field-label-margin-block-start, 0) var(--luzmo-field-label-margin-block-end, 0));margin-inline:0;margin-inline:var(--luzmo-field-label-margin-inline, var(--luzmo-field-label-margin-inline-start, 0) var(--luzmo-field-label-margin-inline-end, 0));font-size:var(--luzmo-field-label-font-size, var(--field-label-font-size));font-weight:var(--luzmo-field-label-font-weight, var(--field-label-font-weight));line-height:var(--luzmo-field-label-line-height, var(--field-label-line-height));-webkit-font-smoothing:subpixel-antialiased;-moz-osx-font-smoothing:auto;color:var(--luzmo-field-label-color, var(--field-label-color));display:block;font-family:var(--luzmo-field-label-font-family, var(--luzmo-font-family))}:host(:lang(ja)),:host(:lang(ko)),:host(:lang(zh)){--luzmo-field-label-line-height: var( --luzmo-field-label-line-height-cjk, var(--field-label-line-height-cjk) )}:host([disabled]),:host([disabled]) .required-icon{--luzmo-field-label-color: var( --highcontrast-field-label-disabled-content-color, var( --luzmo-disabled-content-color, var(--field-label-disabled-content-color) ) )}.required-icon{display:inline-block;margin-block:0;margin-inline:var(--luzmo-field-label-text-to-asterisk, var(--field-label-text-to-asterisk)) 0;vertical-align:initial;vertical-align:var(--luzmo-field-label-asterisk-vertical-align, baseline)}:host([side-aligned=start]),:host([side-aligned=end]){vertical-align:top;margin-block-start:0;margin-block-end:0;margin-inline-end:var(--luzmo-field-label-side-padding-right, var(--field-label-side-padding-right));display:inline-flex;align-items:center;font-size:var(--luzmo-field-label-side-aligned-font-size, var(--field-label-side-aligned-font-size));block-size:var(--luzmo-field-label-side-aligned-height, var(--field-label-side-aligned-height))}:host([side-aligned=end]){text-align:end}@media (forced-colors: active){:host{--highcontrast-field-label-disabled-content-color: GrayText}}:host{--field-label-color: var(--luzmo-font-color);--field-label-font-weight: var(--luzmo-font-weight);--field-label-line-height: var(--luzmo-line-height);--field-label-line-height-cjk: 1.5;--field-label-disabled-content-color: var(--luzmo-font-color-disabled)}:host{--field-label-min-height: var(--luzmo-component-height-xs);--field-label-side-aligned-height: var(--luzmo-component-height);--field-label-top-to-text: calc(var(--luzmo-spacing-2));--field-label-bottom-to-text: var(--luzmo-spacing-2);--field-label-side-aligned-font-size: var(--luzmo-font-size);--field-label-font-size: var(--luzmo-font-size-s);--field-label-side-padding-right: var(--luzmo-spacing-4);--field-label-text-to-asterisk: 0px}:host([size=s]){--field-label-min-height: var(--luzmo-component-height-xxs);--field-label-side-aligned-height: var(--luzmo-component-height-s);--field-label-top-to-text: calc(var(--luzmo-spacing-1));--field-label-bottom-to-text: var(--luzmo-spacing-1);--field-label-side-aligned-font-size: var(--luzmo-font-size-s);--field-label-font-size: var(--luzmo-font-size-xs);--field-label-side-padding-right: var(--luzmo-spacing-3);--field-label-text-to-asterisk: 0px}:host([size=l]){--field-label-min-height: var(--luzmo-component-height-xs);--field-label-side-aligned-height: var(--luzmo-component-height-l);--field-label-top-to-text: var(--luzmo-spacing-3);--field-label-bottom-to-text: calc( var(--luzmo-spacing-2) + var(--luzmo-spacing-1) );--field-label-side-aligned-font-size: var(--luzmo-font-size-l);--field-label-font-size: var(--luzmo-font-size);--field-label-side-padding-right: var(--luzmo-spacing-4);--field-label-text-to-asterisk: var(--luzmo-spacing-1)}:host([size=xl]){--field-label-min-height: var(--luzmo-component-height-s);--field-label-side-aligned-height: var(--luzmo-component-height-xl);--field-label-top-to-text: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--field-label-bottom-to-text: var(--luzmo-spacing-3);--field-label-side-aligned-font-size: var(--luzmo-font-size-xl);--field-label-font-size: var(--luzmo-font-size-l);--field-label-side-padding-right: var(--luzmo-spacing-4);--field-label-text-to-asterisk: var(--luzmo-spacing-1)}label{display:inline-block}";
|
38
|
+
var Dt = Object.defineProperty, A = (n, t, e, l) => {
|
39
|
+
for (var o = void 0, a = n.length - 1, r; a >= 0; a--)
|
40
|
+
(r = n[a]) && (o = r(t, e, o) || o);
|
41
|
+
return o && Dt(t, e, o), o;
|
42
|
+
};
|
43
|
+
const jt = () => s`
|
44
|
+
<div class="icon-container required-icon">*</div>
|
45
|
+
`;
|
46
|
+
class D extends E(L, {
|
47
|
+
noDefaultSize: !0
|
48
|
+
}) {
|
49
|
+
constructor() {
|
50
|
+
super(...arguments), this.disabled = !1, this.id = "", this.for = "", this.required = !1, this.resolvedElement = new kt(this);
|
51
|
+
}
|
52
|
+
static get styles() {
|
53
|
+
return [S(Ot)];
|
54
|
+
}
|
55
|
+
handleClick(t) {
|
56
|
+
if (!this.target || this.disabled || t.defaultPrevented)
|
57
|
+
return;
|
58
|
+
this.target.focus();
|
59
|
+
const e = this.getRootNode(), l = this.target, o = l.getRootNode(), a = o.host;
|
60
|
+
o === e && l.forceFocusVisible ? l.forceFocusVisible() : a && a.forceFocusVisible && a.forceFocusVisible();
|
61
|
+
}
|
62
|
+
applyTargetLabel(t) {
|
63
|
+
if (this.target = t || this.target, this.target) {
|
64
|
+
const e = this.target.applyFocusElementLabel, l = this.target.focusElement || this.target, o = l.getRootNode();
|
65
|
+
e !== void 0 ? e(this.labelText, this) : o === this.getRootNode() ? (t ? it : Ct)(l, "aria-labelledby", [this.id]) : t ? l.setAttribute("aria-label", this.labelText) : l.removeAttribute("aria-label");
|
66
|
+
}
|
67
|
+
}
|
68
|
+
async manageTarget() {
|
69
|
+
this.applyTargetLabel();
|
70
|
+
const t = this.resolvedElement.element;
|
71
|
+
if (!t) {
|
72
|
+
this.target = t;
|
73
|
+
return;
|
74
|
+
}
|
75
|
+
t.localName.search("-") > 0 && await customElements.whenDefined(t.localName), t.updateComplete !== void 0 && await t.updateComplete, this.applyTargetLabel(t);
|
76
|
+
}
|
77
|
+
get labelText() {
|
78
|
+
const t = this.slotEl.assignedNodes({ flatten: !0 });
|
79
|
+
return t.length === 0 ? "" : t.map(
|
80
|
+
(l) => (l.textContent || /* c8 ignore next */
|
81
|
+
"").trim()
|
82
|
+
).join(" ");
|
83
|
+
}
|
84
|
+
render() {
|
85
|
+
return s`
|
86
|
+
<label>
|
87
|
+
<slot></slot>
|
88
|
+
${this.required ? s` ${jt()} ` : P}
|
89
|
+
</label>
|
90
|
+
`;
|
91
|
+
}
|
92
|
+
firstUpdated(t) {
|
93
|
+
super.firstUpdated(t), this.addEventListener("click", this.handleClick);
|
94
|
+
}
|
95
|
+
willUpdate(t) {
|
96
|
+
this.hasAttribute("id") || this.setAttribute("id", `${this.tagName.toLowerCase()}-${G()}`), t.has("for") && (this.resolvedElement.selector = this.for ? `#${this.for}` : ""), (t.has("id") || t.has(_t)) && this.manageTarget();
|
97
|
+
}
|
98
|
+
}
|
99
|
+
A([
|
100
|
+
i({ type: Boolean, reflect: !0 })
|
101
|
+
], D.prototype, "disabled");
|
102
|
+
A([
|
103
|
+
i({ type: String })
|
104
|
+
], D.prototype, "id");
|
105
|
+
A([
|
106
|
+
i({ type: String })
|
107
|
+
], D.prototype, "for");
|
108
|
+
A([
|
109
|
+
i({ type: Boolean, reflect: !0 })
|
110
|
+
], D.prototype, "required");
|
111
|
+
A([
|
112
|
+
O("slot")
|
113
|
+
], D.prototype, "slotEl");
|
114
|
+
A([
|
115
|
+
i({ type: String, reflect: !0, attribute: "side-aligned" })
|
116
|
+
], D.prototype, "sideAligned");
|
117
|
+
/**
|
118
|
+
* @license
|
119
|
+
* Copyright 2020 Google LLC
|
120
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
121
|
+
*/
|
122
|
+
const At = $t(class extends Et {
|
123
|
+
constructor(n) {
|
124
|
+
if (super(n), n.type !== j.PROPERTY && n.type !== j.ATTRIBUTE && n.type !== j.BOOLEAN_ATTRIBUTE) throw Error("The `live` directive is not allowed on child or event bindings");
|
125
|
+
if (!St(n)) throw Error("`live` bindings can only contain a single expression");
|
126
|
+
}
|
127
|
+
render(n) {
|
128
|
+
return n;
|
129
|
+
}
|
130
|
+
update(n, [t]) {
|
131
|
+
if (t === N || t === P) return t;
|
132
|
+
const e = n.element, l = n.name;
|
133
|
+
if (n.type === j.PROPERTY) {
|
134
|
+
if (t === e[l]) return N;
|
135
|
+
} else if (n.type === j.BOOLEAN_ATTRIBUTE) {
|
136
|
+
if (!!t === e.hasAttribute(l)) return N;
|
137
|
+
} else if (n.type === j.ATTRIBUTE && e.getAttribute(l) === t + "") return N;
|
138
|
+
return Tt(n), t;
|
139
|
+
}
|
140
|
+
});
|
141
|
+
class Bt {
|
142
|
+
constructor(t, { mode: e } = { mode: "internal" }) {
|
143
|
+
this.mode = "internal", this.handleSlotchange = ({
|
144
|
+
target: l
|
145
|
+
}) => {
|
146
|
+
this.handleHelpText(l), this.handleNegativeHelpText(l);
|
147
|
+
}, this.host = t, this.id = `luzmo-help-text-${G()}`, this.mode = e;
|
148
|
+
}
|
149
|
+
get isInternal() {
|
150
|
+
return this.mode === "internal";
|
151
|
+
}
|
152
|
+
render(t) {
|
153
|
+
return s`
|
154
|
+
<div
|
155
|
+
id=${b(this.isInternal ? this.id : void 0)}
|
156
|
+
aria-live="assertive"
|
157
|
+
>
|
158
|
+
<slot
|
159
|
+
name=${t ? "negative-help-text" : `pass-through-help-text-${G()}`}
|
160
|
+
@slotchange=${this.handleSlotchange}
|
161
|
+
>
|
162
|
+
<slot name="help-text"></slot>
|
163
|
+
</slot>
|
164
|
+
</div>
|
165
|
+
`;
|
166
|
+
}
|
167
|
+
addId() {
|
168
|
+
const t = this.helpTextElement ? this.helpTextElement.id : this.id;
|
169
|
+
this.conditionId = it(
|
170
|
+
this.host,
|
171
|
+
"aria-describedby",
|
172
|
+
t
|
173
|
+
), this.host.hasAttribute("tabindex") && (this.previousTabindex = Number.parseFloat(
|
174
|
+
this.host.getAttribute("tabindex")
|
175
|
+
)), this.host.tabIndex = 0;
|
176
|
+
}
|
177
|
+
removeId() {
|
178
|
+
this.conditionId && (this.conditionId(), delete this.conditionId), !this.helpTextElement && (this.previousTabindex ? this.host.tabIndex = this.previousTabindex : this.host.removeAttribute("tabindex"));
|
179
|
+
}
|
180
|
+
handleHelpText(t) {
|
181
|
+
if (this.isInternal)
|
182
|
+
return;
|
183
|
+
this.helpTextElement && this.helpTextElement.id === this.id && this.helpTextElement.removeAttribute("id"), this.removeId();
|
184
|
+
const l = t.assignedElements()[0];
|
185
|
+
this.helpTextElement = l, l && (l.id || (l.id = this.id), this.addId());
|
186
|
+
}
|
187
|
+
handleNegativeHelpText(t) {
|
188
|
+
if (t.name !== "negative-help-text")
|
189
|
+
return;
|
190
|
+
t.assignedElements().forEach(
|
191
|
+
(l) => l.variant = "negative"
|
192
|
+
);
|
193
|
+
}
|
194
|
+
}
|
195
|
+
function nt(n, { mode: t } = { mode: "internal" }) {
|
196
|
+
class e extends n {
|
197
|
+
constructor() {
|
198
|
+
super(...arguments), this.helpTextManager = new Bt(this, { mode: t });
|
199
|
+
}
|
200
|
+
get helpTextId() {
|
201
|
+
return this.helpTextManager.id;
|
202
|
+
}
|
203
|
+
renderHelpText(o) {
|
204
|
+
return this.helpTextManager.render(o);
|
205
|
+
}
|
206
|
+
}
|
207
|
+
return e;
|
208
|
+
}
|
209
|
+
const Ft = '#text-field{--luzmo-text-field-input-line-height: var( --luzmo-text-field-height, var(--text-field-height) );text-overflow:ellipsis;inline-size:var(--luzmo-text-field-width, 240px);grid-template-rows:auto auto auto;grid-template-columns:auto auto;margin:0;display:inline-grid;position:relative;overflow:visible}:host([quiet]) #text-field:after{content:"";pointer-events:none;inline-size:100%;block-size:var(--luzmo-text-field-focus-indicator-width, 2px);position:absolute;inset-block-end:calc((var(--luzmo-text-field-focus-indicator-gap, 2px) + var(--luzmo-text-field-focus-indicator-width, 2px)) * -1);inset-inline-start:0}:host([quiet][focused]) #text-field:after{background-color:var(--highcontrast-text-field-focus-indicator-color, var(--luzmo-text-field-focus-indicator-color, var(--luzmo-color-informative)))}:host([quiet][invalid]) #text-field .input{padding-inline-end:calc(var(--luzmo-text-field-icon-spacing-inline-start-invalid, var(--text-field-icon-spacing-inline-start-invalid)) + var(--luzmo-text-field-icon-size-invalid, var(--text-field-icon-size-invalid)))}:host([quiet][valid]) #text-field .input{padding-inline-end:calc(var(--luzmo-text-field-icon-spacing-inline-start-valid, var(--text-field-icon-spacing-inline-start-valid)) + var(--luzmo-text-field-icon-size-valid, var(--text-field-icon-size-valid)))}:host([invalid]) #text-field .icon,:host([valid]) #text-field .icon{pointer-events:all;grid-area:2/2;margin-inline-start:auto;position:absolute;inset-block-start:0;display:flex;align-items:center;justify-content:center}#text-field.luzmo-text-field--sideLabel .icon{grid-area:1/2/span 1/span 1}:host([valid]) #text-field .icon{font-size:var(--luzmo-text-field-icon-size-valid, var(--text-field-icon-size-valid));color:var(--highcontrast-text-field-icon-color-valid, var(--luzmo-text-field-icon-color-valid, var(--luzmo-color-positive)));inset-block-start:var(--luzmo-text-field-icon-spacing-block-valid, var(--text-field-icon-spacing-block-valid));inset-block-end:var(--luzmo-text-field-icon-spacing-block-valid, var(--text-field-icon-spacing-block-valid));inset-inline-end:var(--luzmo-text-field-icon-spacing-inline-end-valid, var(--text-field-icon-spacing-inline-end-valid))}:host([invalid]) #text-field .icon{font-size:var(--luzmo-text-field-icon-size-invalid, var(--text-field-icon-size-invalid));color:var(--highcontrast-text-field-icon-color-invalid, var(--luzmo-text-field-icon-color-invalid, var(--luzmo-color-negative)));inset-block-start:var(--luzmo-text-field-icon-spacing-block-invalid, var(--text-field-icon-spacing-block-invalid));inset-block-end:var(--luzmo-text-field-icon-spacing-block-invalid, var(--text-field-icon-spacing-block-invalid));inset-inline-end:var(--luzmo-text-field-icon-spacing-inline-end-invalid, var(--text-field-icon-spacing-inline-end-invalid))}:host([disabled]) #text-field .icon,:host([readonly]) #text-field .icon{color:#0000}:host([quiet]) .icon{padding-inline-end:0}:host([quiet][valid]) .icon{inset-inline-end:var(--luzmo-text-field-icon-spacing-inline-end-quiet-valid, 0px)}:host([quiet][invalid]) .icon{inset-inline-end:var(--luzmo-text-field-icon-spacing-inline-end-quiet-invalid, 0px)}#text-field .luzmo-field-label{grid-area:1/1/auto/span 1;margin-block-end:var(--luzmo-text-field-label-spacing-block, 0px)}:host([quiet]) .luzmo-field-label{margin-block-end:var(--luzmo-text-field-label-spacing-block-quiet, var(--text-field-label-spacing-block-quiet))}:host([disabled]) .luzmo-field-label{color:var(--luzmo-text-field-text-color-disabled, var(--luzmo-font-color-disabled))}#text-field .luzmo-help-text{grid-area:3/1/auto/span 2;margin-block-start:var(--luzmo-text-field-helptext-spacing-block, 0px)}.luzmo-text-field-characterCount{inline-size:auto;font-size:var(--luzmo-text-field-character-count-font-size, var(--text-field-character-count-font-size));font-family:var(--luzmo-text-field-character-count-font-family, var(--luzmo-font-family));font-weight:var(--luzmo-text-field-character-count-font-weight, var(--luzmo-font-weight));grid-area:1/2/auto/span 1;justify-content:flex-end;align-items:flex-end;margin-block-end:var(--luzmo-text-field-character-count-spacing-block, var(--text-field-character-count-spacing-block));margin-inline-start:var(--luzmo-text-field-character-count-spacing-inline, 12px);margin-inline-end:0;padding-inline-end:calc(var(--luzmo-text-field-corner-radius, var(--luzmo-border-radius)) / 2);display:inline-flex}:host([quiet]) .luzmo-text-field-characterCount{margin-block-end:var(--luzmo-text-field-character-count-spacing-block-quiet, var(--text-field-character-count-spacing-block-quiet))}.input{text-align:var(--luzmo-text-field-text-align, start);line-height:var(--luzmo-text-field-input-line-height);box-sizing:border-box;inline-size:100%;min-inline-size:var(--luzmo-text-field-min-width, 1.5);block-size:var(--luzmo-text-field-height, var(--text-field-height));padding-block-start:calc(var(--luzmo-text-field-spacing-block-start, var(--luzmo-spacing-3)) - var(--luzmo-text-field-border-width, var(--luzmo-border-width)));padding-block-end:calc(var(--luzmo-text-field-spacing-block-end, var(--luzmo-spacing-3)) - var(--luzmo-text-field-border-width, var(--luzmo-border-width)));padding-inline:calc(var(--luzmo-text-field-spacing-inline, var(--text-field-spacing-inline)) - var(--luzmo-text-field-border-width, var(--luzmo-border-width)));vertical-align:top;background-color:var(--luzmo-text-field-background-color, var(--luzmo-background-color));border-color:var(--highcontrast-text-field-border-color, var(--luzmo-text-field-border-color, var(--luzmo-border-color)));border-style:solid;border-width:var(--luzmo-text-field-border-width, var(--luzmo-border-width));border-radius:var(--luzmo-text-field-corner-radius, var(--luzmo-border-radius));transition:border-color var(--luzmo-text-field-animation-duration, var(--luzmo-animation-duration)) ease-in-out;font-size:var(--luzmo-text-field-placeholder-font-size, var(--text-field-placeholder-font-size));font-family:var(--luzmo-text-field-font-family, var(--luzmo-font-family));font-weight:var(--luzmo-text-field-font-weight, var(--luzmo-font-weight));color:var(--highcontrast-text-field-text-color-default, var(--luzmo-text-field-text-color-default, var(--luzmo-font-color)));text-overflow:ellipsis;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;grid-area:2/1/auto/span 2;margin:0}:host([type=number]) .input{-moz-appearance:text-field}:host([type=number]) .input::-webkit-inner-spin-button,:host([type=number]) .input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.input:-moz-ui-invalid{box-shadow:none}.input::placeholder{opacity:1;font-size:var(--luzmo-text-field-placeholder-font-size, var(--text-field-placeholder-font-size));font-family:var(--luzmo-text-field-font-family, var(--luzmo-font-family));font-weight:var(--luzmo-text-field-font-weight, var(--luzmo-font-weight));color:var(--highcontrast-text-field-text-color-default, var(--luzmo-text-field-placeholder-text-color-default, var(--luzmo-font-color-disabled)));transition:color var(--luzmo-text-field-animation-duration, var(--luzmo-animation-duration)) ease-in-out}.input:lang(ja)::placeholder,.input:lang(ko)::placeholder,.input:lang(zh)::placeholder{font-style:normal}:host([focused]) .input,.input:focus{border-color:var(--highcontrast-text-field-border-color-focus, var(--luzmo-text-field-border-color-focus, var(--luzmo-primary)));color:var(--highcontrast-text-field-text-color-focus, var(--luzmo-text-field-text-color-focus, var(--luzmo-font-color-hard)))}:host([focused]) .input::placeholder,.input:focus::placeholder{color:var(--highcontrast-text-field-text-color-focus, var(--luzmo-text-field-placeholder-text-color-focus, var(--luzmo-color-disabled)))}:host([focused]) .input{border-color:var(--highcontrast-text-field-border-color-keyboard-focus, var(--luzmo-text-field-border-color-keyboard-focus, var(--luzmo-primary)));outline:var(--luzmo-text-field-focus-indicator-width, 0) solid;outline-color:var(--highcontrast-text-field-focus-indicator-color, var(--luzmo-text-field-focus-indicator-color, var(--luzmo-color-informative)));outline-offset:var(--luzmo-text-field-focus-indicator-gap, 2px);color:var(--highcontrast-text-field-text-color-keyboard-focus, var(--luzmo-text-field-text-color-keyboard-focus, var(--luzmo-font-color-hard)))}:host([focused]) .input::placeholder{color:var(--highcontrast-text-field-text-color-keyboard-focus, var(--luzmo-text-field-placeholder-text-color-keyboard-focus, var(--luzmo-color-disabled)))}:host([valid]) .input{color:var(--highcontrast-text-field-text-color-valid, var(--luzmo-text-field-text-color-valid, var(--luzmo-font-color)));padding-inline-end:calc(var(--luzmo-text-field-icon-spacing-inline-start-valid, var(--text-field-icon-spacing-inline-start-valid)) + var(--luzmo-text-field-icon-size-valid, var(--text-field-icon-size-valid)) + var(--luzmo-text-field-icon-spacing-inline-end-valid, var(--text-field-icon-spacing-inline-end-valid)) - var(--luzmo-text-field-border-width, var(--luzmo-border-width)))}:host([invalid]) .input{color:var(--highcontrast-text-field-text-color-invalid, var(--luzmo-text-field-text-color-invalid, var(--luzmo-font-color)));border-color:var(--highcontrast-text-field-border-color-invalid-default, var(--luzmo-text-field-border-color-invalid-default, var(luzmo-danger-color)));padding-inline-end:calc(var(--luzmo-text-field-icon-spacing-inline-start-invalid, var(--text-field-icon-spacing-inline-start-invalid)) + var(--luzmo-text-field-icon-size-invalid, var(--text-field-icon-size-invalid)) + var(--luzmo-text-field-icon-spacing-inline-end-invalid, var(--text-field-icon-spacing-inline-end-invalid)) - var(--luzmo-text-field-border-width, var(--luzmo-border-width)))}:host([invalid]) .input:focus,:host([invalid][focused]) .input,:host([invalid]:focus) .input{border-color:var(--highcontrast-text-field-border-color-invalid-focus, var(--luzmo-text-field-border-color-invalid-focus, var(luzmo-danger-color)))}:host([invalid]) .input:focus-visible,:host([invalid][focused]) .input{border-color:var(--highcontrast-text-field-border-color-invalid-keyboard-focus, var(--luzmo-text-field-border-color-invalid-keyboard-focus, var(luzmo-danger-color)))}.input:disabled,:host([disabled]) #text-field .input{background-color:var(--luzmo-text-field-background-color-disabled, var(--luzmo-background-color-disabled));resize:none;opacity:1;border-color:#0000}.input:disabled,.input:disabled::placeholder,:host([disabled]) #text-field .input,:host([disabled]) #text-field .input::placeholder{color:var(--highcontrast-text-field-text-color-disabled, var(--luzmo-text-field-text-color-disabled, var(--luzmo-font-color-disabled)))}:host([border=none]) .input{border-width:0;outline:none}:host([quiet]) .input{padding-block-start:var(--luzmo-text-field-spacing-block-start, var(--luzmo-spacing-2));padding-inline:var(--luzmo-text-field-spacing-inline-quiet, 0px);background-color:initial;resize:none;border-block-start-width:0;border-inline-width:0;border-radius:0;outline:none;margin-block-end:var(--luzmo-text-field-spacing-block-quiet, 0px);overflow-y:hidden}:host([quiet][disabled]) .input,.input:disabled{background-color:initial;border-color:var(--luzmo-text-field-border-color-disabled, var(--luzmo-border-color-disabled))}:host([quiet][disabled]) .input,:host([quiet][disabled]) .input::placeholder,.input:disabled,.input:disabled::placeholder{color:var(--highcontrast-text-field-text-color-disabled, var(--luzmo-text-field-text-color-disabled, var(--luzmo-color-disabled)))}.input:read-only,:host([readonly]) #text-field .input{background-color:initial;color:var(--highcontrast-text-field-text-color-readonly, var(--luzmo-text-field-text-color-readonly, var(--luzmo-font-color)));border-color:#0000;outline:none}.input:read-only::placeholder,:host([readonly]) #text-field .input::placeholder{color:var(--highcontrast-text-field-text-color-readonly, var(--luzmo-text-field-text-color-readonly, var(--luzmo-color-disabled)));background-color:initial}@media (hover: hover){.input:hover,#text-field:hover .input{border-color:var(--highcontrast-text-field-border-color-hover, var(--luzmo-text-field-border-color-hover, rgba(var(--luzmo-primary-rgb), .3)))}.input:hover,#text-field:hover .input{color:var(--highcontrast-text-field-text-color-hover, var(--luzmo-text-field-text-color-hover, var(--luzmo-font-color-hard)))}.input:hover::placeholder,#text-field:hover .input::placeholder{color:var(--highcontrast-text-field-text-color-hover, var(--luzmo-text-field-placeholder-text-color-hover, var(--luzmo-color-disabled)))}:host([focused]) .input:hover,:host([focused]) #text-field:hover .input,.input:focus:hover{border-color:var(--highcontrast-text-field-border-color-focus-hover, var(--luzmo-text-field-border-color-focus-hover, var(--luzmo-primary)))}:host([focused]) .input:hover,.input:focus:hover{color:var(--highcontrast-text-field-text-color-focus-hover, var(--luzmo-text-field-text-color-focus-hover, var(--luzmo-font-color-hard)))}:host([focused]) .input:hover::placeholder,.input:focus:hover::placeholder{color:var(--highcontrast-text-field-text-color-focus-hover, var(--luzmo-text-field-placeholder-text-color-focus-hover, var(--luzmo-color-disabled)))}:host([invalid]) .input:hover:not(.is-disabled),:host([invalid]:hover):not(.is-disabled) .input{border-color:var(--highcontrast-text-field-border-color-invalid-hover, var(--luzmo-text-field-border-color-invalid-hover, var(luzmo-danger-color)))}:host([invalid]) .input:focus:hover,:host([invalid][focused]) .input:hover,:host([invalid]:focus) .input:hover{border-color:var(--highcontrast-text-field-border-color-invalid-focus-hover, var(--luzmo-text-field-border-color-invalid-focus-hover, var(luzmo-danger-color)))}:host([disabled]) #text-field:hover .input{background-color:var(--luzmo-text-field-background-color-disabled, var(--luzmo-background-color-disabled));resize:none;opacity:1;border-color:#0000}:host([quiet][disabled]:hover) .input,:host([disabled]) #text-field:hover .input,:host([disabled]) #text-field:hover .input::placeholder{color:var(--highcontrast-text-field-text-color-disabled, var(--luzmo-text-field-text-color-disabled, var(--luzmo-font-color-disabled)))}:host([quiet][disabled]:hover) .input{background-color:initial;border-color:var(--luzmo-text-field-border-color-disabled, var(--luzmo-border-color-disabled))}:host([quiet][disabled]:hover) .input::placeholder{color:var(--highcontrast-text-field-text-color-disabled, var(--luzmo-text-field-text-color-disabled, var(--luzmo-font-color-disabled)))}:host([readonly]) #text-field:hover .input{border-color:#0000;outline:none}:host([readonly]) #text-field:hover .input,:host([readonly]) #text-field:hover .input::placeholder{background-color:initial;color:var(--highcontrast-text-field-text-color-readonly, var(--luzmo-text-field-text-color-readonly, var(--luzmo-font-color)))}}.luzmo-text-field--sideLabel{grid-template-rows:auto auto;grid-template-columns:auto auto auto}.luzmo-text-field--sideLabel:after{grid-area:1/2/span 1/span 1}.luzmo-text-field--sideLabel .luzmo-field-label{grid-area:1/1/span 2/span 1;margin-inline-end:var(--luzmo-text-field-label-spacing-inline-side-label, var(--text-field-label-spacing-inline-side-label))}.luzmo-text-field--sideLabel .luzmo-text-field-characterCount{grid-area:1/3/auto/span 1;align-items:flex-start;margin-block-start:var(--luzmo-text-field-character-count-spacing-block-side, var(--text-field-character-count-spacing-block-side));margin-inline-start:var(--luzmo-text-field-character-count-spacing-inline-side, 12px)}.luzmo-text-field--sideLabel .luzmo-help-text{grid-area:2/2/auto/span 1}.luzmo-text-field--sideLabel .input,.luzmo-text-field--sideLabel .icon{grid-area:1/2/span 1/span 1}:host([multiline]){--luzmo-text-field-input-line-height: normal}:host([multiline]) .input{min-inline-size:var(--luzmo-text-area-min-inline-size, 112px);min-block-size:var(--luzmo-text-area-min-block-size, 56px);resize:inherit}:host([multiline][grows]) .input{grid-row:2}:host([multiline][grows]) .luzmo-text-field--sideLabel .input{grid-row:1}:host([multiline][quiet]) .input{min-block-size:var(--luzmo-text-area-min-block-size-quiet, var(--text-area-min-block-size-quiet));resize:none;overflow-y:hidden}@media (forced-colors: active){:host{--highcontrast-text-field-border-color-hover: Highlight;--highcontrast-text-field-border-color-focus: Highlight;--highcontrast-text-field-border-color-keyboard-focus: CanvasText;--highcontrast-text-field-focus-indicator-color: Highlight;--highcontrast-text-field-border-color-invalid-default: Highlight;--highcontrast-text-field-border-color-invalid-hover: Highlight;--highcontrast-text-field-border-color-invalid-focus: Highlight;--highcontrast-text-field-border-color-invalid-keyboard-focus: Highlight;--highcontrast-text-field-text-color-valid: CanvasText;--highcontrast-text-field-text-color-invalid: CanvasText}#text-field .input{--highcontrast-text-field-text-color-default: CanvasText;--highcontrast-text-field-text-color-hover: CanvasText;--highcontrast-text-field-text-color-keyboard-focus: CanvasText;--highcontrast-text-field-text-color-disabled: GrayText;--highcontrast-text-field-text-color-readonly: CanvasText}#text-field .input::placeholder{--highcontrast-text-field-text-color-default: GrayText;--highcontrast-text-field-text-color-hover: GrayText;--highcontrast-text-field-text-color-keyboard-focus: GrayText;--highcontrast-text-field-text-color-disabled: GrayText;--highcontrast-text-field-text-color-readonly: CanvasText}}:host{display:inline-flex;flex-direction:column;inline-size:var(--luzmo-text-field-width, 240px)}:host([multiline]){resize:both}:host([multiline][readonly]){resize:none}:host([disabled]:focus-visible){outline:none}#text-field{inline-size:100%}#text-field,textarea{resize:inherit}.input{min-inline-size:var(--luzmo-text-field-min-width, 1.5)}:host([focused]) .input{caret-color:var(--swc-test-caret-color);forced-color-adjust:var(--swc-test-forced-color-adjust)}#sizer{block-size:auto;word-break:break-word;opacity:0;white-space:pre-line}.icon,.icon-workflow{pointer-events:none}:host([multiline]) #text-field{display:inline-grid;--luzmo-text-field-input-line-height: normal}:host([multiline]) textarea{transition:box-shadow var(--luzmo-animation-duration) ease-in-out,border-color var(--luzmo-animation-duration) ease-in-out}:host([multiline]:not([quiet])) #text-field:after{box-shadow:none}:host([multiline][rows]) .input{block-size:auto;resize:none}:host([multiline][rows="1"]) .input{min-block-size:auto}:host([disabled][quiet]) #text-field .input,:host([disabled][quiet]) #text-field:hover .input,:host([quiet]) .input :disabled{background-color:#0000;border-color:var(--luzmo-text-field-border-color-disabled, var(--luzmo-border-color-disabled));color:var(--highcontrast-text-field-text-color-disabled, var(--luzmo-text-field-text-color-disabled, var(--luzmo-font-color-disabled)))}:host([disabled]) #text-field .icon.icon-search,:host([readonly]) #text-field .icon.icon-search{color:var(--highcontrast-text-field-text-color-disabled, var(--luzmo-text-field-text-color-disabled, var(--luzmo-font-color-disabled)))}:host([multiline][grows]:not([quiet])) #text-field:after{grid-area:unset;min-block-size:calc(var(--luzmo-text-area-min-block-size, var(--luzmo-text-area-min-block-size)) + var(--luzmo-text-field-focus-indicator-gap, 2px) * 2)}:host([multiline][grows]:not([rows])) .input:not(#sizer){position:absolute;top:0;left:0;height:100%;resize:none;overflow:hidden}:host{--text-field-height: var(--luzmo-component-height);--text-field-label-spacing-block-quiet: -8px;--text-field-label-spacing-inline-side-label: 12px;--text-field-placeholder-font-size: 14px;--text-field-spacing-inline: 12px;--text-field-icon-size-invalid: 18px;--text-field-icon-size-valid: 10px;--text-field-icon-spacing-inline-end-invalid: 12px;--text-field-icon-spacing-inline-end-valid: 15px;--text-field-icon-spacing-block-invalid: 7px;--text-field-icon-spacing-block-valid: 4px;--text-field-icon-spacing-inline-start-invalid: var(--luzmo-spacing-4);--text-field-icon-spacing-inline-start-valid: var(--luzmo-spacing-4);--text-field-character-count-font-size: var(--luzmo-font-size-s);--text-field-character-count-spacing-block: 5px;--text-field-character-count-spacing-block-quiet: -3px;--text-field-character-count-spacing-block-side: 8px;--text-area-min-block-size-quiet: var(--luzmo-component-height)}:host([size=s]){--text-field-height: var(--luzmo-component-height-s);--text-field-label-spacing-block-quiet: -8px;--text-field-label-spacing-inline-side-label: 8px;--text-field-placeholder-font-size: 12px;--text-field-spacing-inline: 9px;--text-field-icon-size-invalid: 16px;--text-field-icon-size-valid: 10px;--text-field-icon-spacing-inline-end-invalid: 9px;--text-field-icon-spacing-inline-end-valid: 11px;--text-field-icon-spacing-block-invalid: 2px;--text-field-icon-spacing-block-valid: -1px;--text-field-icon-spacing-inline-start-invalid: var(--luzmo-spacing-3);--text-field-icon-spacing-inline-start-valid: var(--luzmo-spacing-3);--text-field-character-count-font-size: var(--luzmo-font-size-xs);--text-field-character-count-spacing-block: 5px;--text-field-character-count-spacing-block-quiet: -3px;--text-field-character-count-spacing-block-side: 4px;--text-area-min-block-size-quiet: var(--luzmo-component-height-s)}:host([size=l]){--text-field-height: var(--luzmo-component-height-l);--text-field-label-spacing-block-quiet: -12px;--text-field-label-spacing-inline-side-label: 12px;--text-field-placeholder-font-size: 16px;--text-field-spacing-inline: 15px;--text-field-icon-size-invalid: 20px;--text-field-icon-size-valid: 12px;--text-field-icon-spacing-inline-end-invalid: 15px;--text-field-icon-spacing-inline-end-valid: 17px;--text-field-icon-spacing-block-invalid: 10px;--text-field-icon-spacing-block-valid: 8px;--text-field-icon-spacing-inline-start-invalid: 15px;--text-field-icon-spacing-inline-start-valid: 15px;--text-field-character-count-font-size: var(--luzmo-font-size);--text-field-character-count-spacing-block: 9px;--text-field-character-count-spacing-block-quiet: -3px;--text-field-character-count-spacing-block-side: 11px;--text-area-min-block-size-quiet: var(--luzmo-component-height-l)}:host([size=xl]){--text-field-height: var(--luzmo-component-height-xl);--text-field-label-spacing-block-quiet: -15px;--text-field-label-spacing-inline-side-label: 12px;--text-field-placeholder-font-size: 18px;--text-field-spacing-inline: 15px;--text-field-icon-size-invalid: 22px;--text-field-icon-size-valid: 14px;--text-field-icon-spacing-inline-end-invalid: 18px;--text-field-icon-spacing-inline-end-valid: 20px;--text-field-icon-spacing-block-invalid: 12px;--text-field-icon-spacing-block-valid: 13px;--text-field-icon-spacing-inline-start-invalid: 18px;--text-field-icon-spacing-inline-start-valid: 18px;--text-field-character-count-font-size: var(--luzmo-font-size-l);--text-field-character-count-spacing-block: 11px;--text-field-character-count-spacing-block-quiet: -4px;--text-field-character-count-spacing-block-side: 14px;--text-area-min-block-size-quiet: var(--luzmo-component-height-xl)}';
|
210
|
+
var Mt = Object.defineProperty, Rt = Object.getOwnPropertyDescriptor, p = (n, t, e, l) => {
|
211
|
+
for (var o = l > 1 ? void 0 : l ? Rt(t, e) : t, a = n.length - 1, r; a >= 0; a--)
|
212
|
+
(r = n[a]) && (o = (l ? r(t, e, o) : r(o)) || o);
|
213
|
+
return l && o && Mt(t, e, o), o;
|
214
|
+
};
|
215
|
+
const Ut = ["text", "url", "tel", "email", "password"];
|
216
|
+
class h extends nt(
|
217
|
+
E(Lt, {
|
218
|
+
noDefaultSize: !0
|
219
|
+
})
|
220
|
+
) {
|
221
|
+
constructor() {
|
222
|
+
super(...arguments), this.allowedKeys = "", this.focused = !1, this.invalid = !1, this.label = "", this.placeholder = "", this._type = "text", this.grows = !1, this.maxlength = -1, this.minlength = -1, this.multiline = !1, this.readonly = !1, this.rows = -1, this.valid = !1, this._value = "", this.quiet = !1, this.required = !1;
|
223
|
+
}
|
224
|
+
static get styles() {
|
225
|
+
return [S(Ft)];
|
226
|
+
}
|
227
|
+
set type(t) {
|
228
|
+
const e = this._type;
|
229
|
+
this._type = t, this.requestUpdate("type", e);
|
230
|
+
}
|
231
|
+
get type() {
|
232
|
+
return Ut.find((t) => t === this._type) ?? "text";
|
233
|
+
}
|
234
|
+
set value(t) {
|
235
|
+
if (t === this.value)
|
236
|
+
return;
|
237
|
+
const e = this._value;
|
238
|
+
this._value = t, this.requestUpdate("value", e);
|
239
|
+
}
|
240
|
+
get value() {
|
241
|
+
return this._value;
|
242
|
+
}
|
243
|
+
get focusElement() {
|
244
|
+
return this.inputElement;
|
245
|
+
}
|
246
|
+
/**
|
247
|
+
* Sets the start and end positions of the current selection.
|
248
|
+
*
|
249
|
+
* @param selectionStart The 0-based index of the first selected character. An index greater than the length of the
|
250
|
+
* element's value is treated as pointing to the end of the value.
|
251
|
+
* @param selectionEnd The 0-based index of the character after the last selected character. An index greater than
|
252
|
+
* the length of the element's value is treated as pointing to the end of the value.
|
253
|
+
* @param [selectionDirection="none"] A string indicating the direction in which the selection is considered to
|
254
|
+
* have been performed.
|
255
|
+
*/
|
256
|
+
setSelectionRange(t, e, l = "none") {
|
257
|
+
this.inputElement.setSelectionRange(
|
258
|
+
t,
|
259
|
+
e,
|
260
|
+
l
|
261
|
+
);
|
262
|
+
}
|
263
|
+
/**
|
264
|
+
* Selects all the text.
|
265
|
+
*/
|
266
|
+
select() {
|
267
|
+
this.inputElement.select();
|
268
|
+
}
|
269
|
+
handleInput(t) {
|
270
|
+
if (this.allowedKeys && this.inputElement.value && !new RegExp(`^[${this.allowedKeys}]*$`, "u").test(this.inputElement.value)) {
|
271
|
+
const o = this.inputElement.selectionStart - 1;
|
272
|
+
this.inputElement.value = this.value.toString(), this.inputElement.setSelectionRange(o, o);
|
273
|
+
return;
|
274
|
+
}
|
275
|
+
this.value = this.inputElement.value;
|
276
|
+
}
|
277
|
+
handleChange() {
|
278
|
+
this.dispatchEvent(
|
279
|
+
new Event("change", {
|
280
|
+
bubbles: !0,
|
281
|
+
composed: !0
|
282
|
+
})
|
283
|
+
);
|
284
|
+
}
|
285
|
+
onFocus() {
|
286
|
+
this.focused = !this.readonly && !0;
|
287
|
+
}
|
288
|
+
onBlur(t) {
|
289
|
+
this.focused = !this.readonly && !1;
|
290
|
+
}
|
291
|
+
handleInputElementPointerdown() {
|
292
|
+
}
|
293
|
+
renderStateIcons() {
|
294
|
+
return this.invalid ? s`
|
295
|
+
<div id="invalid" class="icon">${C(vt)}</div>
|
296
|
+
` : this.valid ? s`
|
297
|
+
<div id="valid" class="icon">${C(ft)}</div>
|
298
|
+
` : P;
|
299
|
+
}
|
300
|
+
get displayValue() {
|
301
|
+
return this.value.toString();
|
302
|
+
}
|
303
|
+
// prettier-ignore
|
304
|
+
get renderMultiline() {
|
305
|
+
return s`
|
306
|
+
${this.multiline && this.grows && this.rows === -1 ? s`
|
307
|
+
<div id="sizer" class="input" aria-hidden="true">${this.value}​
|
308
|
+
</div>
|
309
|
+
` : P}
|
310
|
+
<!-- @ts-ignore -->
|
311
|
+
<textarea
|
312
|
+
name=${b(this.name || void 0)}
|
313
|
+
aria-describedby=${this.helpTextId}
|
314
|
+
aria-label=${this.label || this.appliedLabel || this.placeholder}
|
315
|
+
aria-invalid=${b(this.invalid || void 0)}
|
316
|
+
class="input"
|
317
|
+
maxlength=${b(this.maxlength > -1 ? this.maxlength : void 0)}
|
318
|
+
minlength=${b(this.minlength > -1 ? this.minlength : void 0)}
|
319
|
+
title=${this.invalid ? "" : P}
|
320
|
+
pattern=${b(this.pattern)}
|
321
|
+
placeholder=${this.placeholder}
|
322
|
+
.value=${this.displayValue}
|
323
|
+
@change=${this.handleChange}
|
324
|
+
@input=${this.handleInput}
|
325
|
+
@focus=${this.onFocus}
|
326
|
+
@blur=${this.onBlur}
|
327
|
+
?disabled=${this.disabled}
|
328
|
+
?required=${this.required}
|
329
|
+
?readonly=${this.readonly}
|
330
|
+
rows=${b(this.rows > -1 ? this.rows : void 0)}
|
331
|
+
autocomplete=${b(this.autocomplete)}
|
332
|
+
></textarea>
|
333
|
+
`;
|
334
|
+
}
|
335
|
+
get renderInput() {
|
336
|
+
return s`
|
337
|
+
<!-- @ts-ignore -->
|
338
|
+
<input
|
339
|
+
name=${b(this.name || void 0)}
|
340
|
+
type=${this.type}
|
341
|
+
aria-describedby=${this.helpTextId}
|
342
|
+
aria-label=${this.label || this.appliedLabel || this.placeholder}
|
343
|
+
aria-invalid=${b(this.invalid || void 0)}
|
344
|
+
class="input"
|
345
|
+
title=${this.invalid ? "" : P}
|
346
|
+
maxlength=${b(this.maxlength > -1 ? this.maxlength : void 0)}
|
347
|
+
minlength=${b(this.minlength > -1 ? this.minlength : void 0)}
|
348
|
+
pattern=${b(this.pattern)}
|
349
|
+
placeholder=${this.placeholder}
|
350
|
+
.value=${At(this.displayValue)}
|
351
|
+
@change=${this.handleChange}
|
352
|
+
@input=${this.handleInput}
|
353
|
+
@pointerdown=${this.handleInputElementPointerdown}
|
354
|
+
@focus=${this.onFocus}
|
355
|
+
@blur=${this.onBlur}
|
356
|
+
?disabled=${this.disabled}
|
357
|
+
?required=${this.required}
|
358
|
+
?readonly=${this.readonly}
|
359
|
+
autocomplete=${b(this.autocomplete)}
|
360
|
+
/>
|
361
|
+
`;
|
362
|
+
}
|
363
|
+
renderField() {
|
364
|
+
return s`
|
365
|
+
${this.renderStateIcons()}
|
366
|
+
${this.multiline ? this.renderMultiline : this.renderInput}
|
367
|
+
`;
|
368
|
+
}
|
369
|
+
render() {
|
370
|
+
return s`
|
371
|
+
<div id="text-field">${this.renderField()}</div>
|
372
|
+
${this.renderHelpText(this.invalid)}
|
373
|
+
`;
|
374
|
+
}
|
375
|
+
update(t) {
|
376
|
+
(t.has("value") || t.has("required") && this.required) && this.updateComplete.then(() => {
|
377
|
+
this.checkValidity();
|
378
|
+
}), super.update(t);
|
379
|
+
}
|
380
|
+
checkValidity() {
|
381
|
+
let t = this.inputElement.checkValidity();
|
382
|
+
return (this.required || this.value && this.pattern) && ((this.disabled || this.multiline) && this.pattern && (t = new RegExp(`^${this.pattern}$`, "u").test(this.value.toString())), this.minlength !== void 0 && (t = t && this.value.toString().length >= this.minlength), this.valid = t, this.invalid = !t), t;
|
383
|
+
}
|
384
|
+
}
|
385
|
+
p([
|
386
|
+
Y()
|
387
|
+
], h.prototype, "appliedLabel", 2);
|
388
|
+
p([
|
389
|
+
i({ attribute: "allowed-keys" })
|
390
|
+
], h.prototype, "allowedKeys", 2);
|
391
|
+
p([
|
392
|
+
i({ type: Boolean, reflect: !0 })
|
393
|
+
], h.prototype, "focused", 2);
|
394
|
+
p([
|
395
|
+
O(".input:not(#sizer)")
|
396
|
+
], h.prototype, "inputElement", 2);
|
397
|
+
p([
|
398
|
+
i({ type: Boolean, reflect: !0 })
|
399
|
+
], h.prototype, "invalid", 2);
|
400
|
+
p([
|
401
|
+
i()
|
402
|
+
], h.prototype, "label", 2);
|
403
|
+
p([
|
404
|
+
i({ type: String, reflect: !0 })
|
405
|
+
], h.prototype, "name", 2);
|
406
|
+
p([
|
407
|
+
i()
|
408
|
+
], h.prototype, "placeholder", 2);
|
409
|
+
p([
|
410
|
+
Y()
|
411
|
+
], h.prototype, "type", 1);
|
412
|
+
p([
|
413
|
+
i({ attribute: "type", reflect: !0 })
|
414
|
+
], h.prototype, "_type", 2);
|
415
|
+
p([
|
416
|
+
i()
|
417
|
+
], h.prototype, "pattern", 2);
|
418
|
+
p([
|
419
|
+
i({ type: Boolean, reflect: !0 })
|
420
|
+
], h.prototype, "grows", 2);
|
421
|
+
p([
|
422
|
+
i({ type: Number })
|
423
|
+
], h.prototype, "maxlength", 2);
|
424
|
+
p([
|
425
|
+
i({ type: Number })
|
426
|
+
], h.prototype, "minlength", 2);
|
427
|
+
p([
|
428
|
+
i({ type: Boolean, reflect: !0 })
|
429
|
+
], h.prototype, "multiline", 2);
|
430
|
+
p([
|
431
|
+
i({ type: Boolean, reflect: !0 })
|
432
|
+
], h.prototype, "readonly", 2);
|
433
|
+
p([
|
434
|
+
i({ type: Number })
|
435
|
+
], h.prototype, "rows", 2);
|
436
|
+
p([
|
437
|
+
i({ type: Boolean, reflect: !0 })
|
438
|
+
], h.prototype, "valid", 2);
|
439
|
+
p([
|
440
|
+
i({ type: String })
|
441
|
+
], h.prototype, "value", 1);
|
442
|
+
p([
|
443
|
+
i({ type: Boolean, reflect: !0 })
|
444
|
+
], h.prototype, "quiet", 2);
|
445
|
+
p([
|
446
|
+
i({ type: Boolean, reflect: !0 })
|
447
|
+
], h.prototype, "required", 2);
|
448
|
+
p([
|
449
|
+
i({ type: String, reflect: !0 })
|
450
|
+
], h.prototype, "autocomplete", 2);
|
451
|
+
class at extends h {
|
452
|
+
constructor() {
|
453
|
+
super(...arguments), this._value = "";
|
454
|
+
}
|
455
|
+
set value(t) {
|
456
|
+
if (t === this.value)
|
457
|
+
return;
|
458
|
+
const e = this._value;
|
459
|
+
this._value = t, this.requestUpdate("value", e);
|
460
|
+
}
|
461
|
+
get value() {
|
462
|
+
return this._value;
|
463
|
+
}
|
464
|
+
}
|
465
|
+
p([
|
466
|
+
i({ type: String })
|
467
|
+
], at.prototype, "value", 1);
|
468
|
+
var Nt = Object.defineProperty, rt = (n, t, e, l) => {
|
469
|
+
for (var o = void 0, a = n.length - 1, r; a >= 0; a--)
|
470
|
+
(r = n[a]) && (o = r(t, e, o) || o);
|
471
|
+
return o && Nt(t, e, o), o;
|
472
|
+
};
|
473
|
+
const J = class J extends E(L, {
|
474
|
+
validSizes: ["s", "m", "l"],
|
475
|
+
noDefaultSize: !0
|
476
|
+
}) {
|
477
|
+
constructor() {
|
478
|
+
super(...arguments), this.vertical = !1;
|
479
|
+
}
|
480
|
+
render() {
|
481
|
+
return s``;
|
482
|
+
}
|
483
|
+
firstUpdated(t) {
|
484
|
+
super.firstUpdated(t), this.setAttribute("role", "separator");
|
485
|
+
}
|
486
|
+
updated(t) {
|
487
|
+
super.updated(t), t.has("vertical") && (this.vertical ? this.setAttribute("aria-orientation", "vertical") : this.removeAttribute("aria-orientation"));
|
488
|
+
}
|
489
|
+
};
|
490
|
+
J.styles = [S(qt)];
|
491
|
+
let M = J;
|
492
|
+
rt([
|
493
|
+
i({ type: Boolean, reflect: !0 })
|
494
|
+
], M.prototype, "vertical");
|
495
|
+
rt([
|
496
|
+
i({ type: String, reflect: !0, attribute: "static-color" })
|
497
|
+
], M.prototype, "staticColor");
|
498
|
+
customElements.get("luzmo-divider") || customElements.define("luzmo-divider", M);
|
499
|
+
/**
|
500
|
+
* @license
|
501
|
+
* Copyright 2017 Google LLC
|
502
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
503
|
+
*/
|
504
|
+
const Ht = Symbol();
|
505
|
+
class st {
|
506
|
+
get taskComplete() {
|
507
|
+
return this.t || (this.i === 1 ? this.t = new Promise((t, e) => {
|
508
|
+
this.o = t, this.h = e;
|
509
|
+
}) : this.i === 3 ? this.t = Promise.reject(this.l) : this.t = Promise.resolve(this.u)), this.t;
|
510
|
+
}
|
511
|
+
constructor(t, e, l) {
|
512
|
+
var a;
|
513
|
+
this.p = 0, this.i = 0, (this._ = t).addController(this);
|
514
|
+
const o = typeof e == "object" ? e : { task: e, args: l };
|
515
|
+
this.v = o.task, this.j = o.args, this.m = o.argsEqual ?? Vt, this.k = o.onComplete, this.A = o.onError, this.autoRun = o.autoRun ?? !0, "initialValue" in o && (this.u = o.initialValue, this.i = 2, this.O = (a = this.T) == null ? void 0 : a.call(this));
|
516
|
+
}
|
517
|
+
hostUpdate() {
|
518
|
+
this.autoRun === !0 && this.S();
|
519
|
+
}
|
520
|
+
hostUpdated() {
|
521
|
+
this.autoRun === "afterUpdate" && this.S();
|
522
|
+
}
|
523
|
+
T() {
|
524
|
+
if (this.j === void 0) return;
|
525
|
+
const t = this.j();
|
526
|
+
if (!Array.isArray(t)) throw Error("The args function must return an array");
|
527
|
+
return t;
|
528
|
+
}
|
529
|
+
async S() {
|
530
|
+
const t = this.T(), e = this.O;
|
531
|
+
this.O = t, t === e || t === void 0 || e !== void 0 && this.m(e, t) || await this.run(t);
|
532
|
+
}
|
533
|
+
async run(t) {
|
534
|
+
var r, d, c, u, v;
|
535
|
+
let e, l;
|
536
|
+
t ?? (t = this.T()), this.O = t, this.i === 1 ? (r = this.q) == null || r.abort() : (this.t = void 0, this.o = void 0, this.h = void 0), this.i = 1, this.autoRun === "afterUpdate" ? queueMicrotask(() => this._.requestUpdate()) : this._.requestUpdate();
|
537
|
+
const o = ++this.p;
|
538
|
+
this.q = new AbortController();
|
539
|
+
let a = !1;
|
540
|
+
try {
|
541
|
+
e = await this.v(t, { signal: this.q.signal });
|
542
|
+
} catch (m) {
|
543
|
+
a = !0, l = m;
|
544
|
+
}
|
545
|
+
if (this.p === o) {
|
546
|
+
if (e === Ht) this.i = 0;
|
547
|
+
else {
|
548
|
+
if (a === !1) {
|
549
|
+
try {
|
550
|
+
(d = this.k) == null || d.call(this, e);
|
551
|
+
} catch {
|
552
|
+
}
|
553
|
+
this.i = 2, (c = this.o) == null || c.call(this, e);
|
554
|
+
} else {
|
555
|
+
try {
|
556
|
+
(u = this.A) == null || u.call(this, l);
|
557
|
+
} catch {
|
558
|
+
}
|
559
|
+
this.i = 3, (v = this.h) == null || v.call(this, l);
|
560
|
+
}
|
561
|
+
this.u = e, this.l = l;
|
562
|
+
}
|
563
|
+
this._.requestUpdate();
|
564
|
+
}
|
565
|
+
}
|
566
|
+
abort(t) {
|
567
|
+
var e;
|
568
|
+
this.i === 1 && ((e = this.q) == null || e.abort(t));
|
569
|
+
}
|
570
|
+
get value() {
|
571
|
+
return this.u;
|
572
|
+
}
|
573
|
+
get error() {
|
574
|
+
return this.l;
|
575
|
+
}
|
576
|
+
get status() {
|
577
|
+
return this.i;
|
578
|
+
}
|
579
|
+
render(t) {
|
580
|
+
var e, l, o, a;
|
581
|
+
switch (this.i) {
|
582
|
+
case 0:
|
583
|
+
return (e = t.initial) == null ? void 0 : e.call(t);
|
584
|
+
case 1:
|
585
|
+
return (l = t.pending) == null ? void 0 : l.call(t);
|
586
|
+
case 2:
|
587
|
+
return (o = t.complete) == null ? void 0 : o.call(t, this.value);
|
588
|
+
case 3:
|
589
|
+
return (a = t.error) == null ? void 0 : a.call(t, this.error);
|
590
|
+
default:
|
591
|
+
throw Error("Unexpected status: " + this.i);
|
592
|
+
}
|
593
|
+
}
|
594
|
+
}
|
595
|
+
const Vt = (n, t) => n === t || n.length === t.length && n.every((e, l) => !gt(e, t[l]));
|
596
|
+
customElements.get("luzmo-field-label") || customElements.define("luzmo-field-label", D);
|
597
|
+
const Gt = "@media (forced-colors: active){:host{--highcontrast-helptext-content-color-default: CanvasText;--highcontrast-helptext-icon-color-default: CanvasText}:host,.text,.icon{forced-color-adjust:none}}:host{--helptext-bottom-to-workflow-icon: 3px;color:var(--highcontrast-helptext-content-color-default, var(--luzmo-helptext-content-color-default, var(--helptext-content-color-default)));font-size:var(var(--luzmo-helptext-font-size, var(--helptext-font-size)), 12px);min-block-size:var(var(--luzmo-helptext-min-height, var(--helptext-min-height)), 24px);display:flex}.icon{block-size:var(var(--luzmo-helptext-icon-size, var(--helptext-icon-size)), 18px);inline-size:var(var(--luzmo-helptext-icon-size, var(--helptext-icon-size)), 18px);flex-shrink:0;margin-inline-end:var(var(--luzmo-helptext-text-to-visual, var(--helptext-text-to-visual)), 7px);padding-block-start:var(var(--luzmo-helptext-top-to-workflow-icon, var(--helptext-top-to-workflow-icon)), 3px);padding-block-end:var(var(--luzmo-helptext-bottom-to-workflow-icon, --helptext-bottom-to-workflow-icon), 3px)}.text{line-height:var(var(--luzmo-helptext-line-height, var(--helptext-line-height), 1.3));padding-block-start:var(var(--luzmo-helptext-top-to-text, var(--helptext-top-to-text)), 4px);padding-block-end:var(var(--luzmo-helptext-bottom-to-text, var(--helptext-bottom-to-text)), 5px)}:host(:lang(ja)) .text,:host(:lang(ko)) .text,:host(:lang(zh)) .text{line-height:var(var(--luzmo-helptext-line-height-cjk, var(--helptext-line-height-cjk)), 1.4)}:host([variant=neutral]) .text{color:var(--highcontrast-helptext-content-color-default, var(--luzmo-helptext-content-color-default, var(--helptext-content-color-default)))}:host([variant=neutral]) .icon{color:var(--highcontrast-helptext-icon-color-default, var(--luzmo-helptext-icon-color-default, var(--helptext-icon-color-default)))}:host([variant=negative]) .text{color:var(--highcontrast-helptext-content-color-default, var(--luzmo-helptext-content-color-default, var(--luzmo-font-color)))}:host([variant=negative]) .icon{color:var(--highcontrast-helptext-icon-color-default, var(--luzmo-helptext-icon-color-default, var(--helptext-icon-color-default)))}:host([disabled]) .text{color:var(--highcontrast-helptext-content-color-default, var(--luzmo-helptext-content-color-default, var(--luzmo-font-color)))}:host([disabled]) .icon{color:var(--highcontrast-helptext-icon-color-default, var(--luzmo-helptext-icon-color-default, var(--helptext-icon-color-default)))}:host{--helptext-line-height: 1.3;--helptext-content-color-default: var(--luzmo-font-color);--helptext-icon-color-default: var(--luzmo-font-color);--helptext-disabled-content-color: var(--luzmo-font-color-disabled)}:host([variant=neutral]){--helptext-content-color-default: var(var(--luzmo-font-color));--helptext-icon-color-default: var(var(--luzmo-font-color))}:host([variant=negative]){--helptext-content-color-default: var(var(--luzmo-color-negative));--helptext-icon-color-default: var(var(--luzmo-color-negative))}:host([disabled]){--helptext-content-color-default: var(--luzmo-font-color-disabled);--helptext-icon-color-default: var(--luzmo-font-color-disabled)}:host(:lang(ja)){--helptext-line-height-cjk: 1.4}:host(:lang(zh)){--helptext-line-height-cjk: 1.4}:host(:lang(ko)){--helptext-line-height-cjk: 1.4}:host([size=s]){--helptext-min-height: 24px;--helptext-icon-size: 16px;--helptext-font-size: 12px;--helptext-text-to-visual: 7px;--helptext-top-to-workflow-icon: 4px;--helptext-top-to-text: 4px;--helptext-bottom-to-text: 5px}:host{--helptext-min-height: 24px;--helptext-icon-size: 18px;--helptext-font-size: 12px;--helptext-text-to-visual: 7px;--helptext-top-to-workflow-icon: 3px;--helptext-top-to-text: 4px;--helptext-bottom-to-text: 5px}:host([size=l]){--helptext-min-height: 32px;--helptext-icon-size: 20px;--helptext-font-size: 14px;--helptext-text-to-visual: 8px;--helptext-top-to-workflow-icon: 6px;--helptext-top-to-text: 6px;--helptext-bottom-to-text: 5px}:host([size=xl]){--helptext-min-height: 40px;--helptext-icon-size: 22px;--helptext-font-size: 16px;--helptext-text-to-visual: 9px;--helptext-top-to-workflow-icon: 9px;--helptext-top-to-text: 9px;--helptext-bottom-to-text: 12px}";
|
598
|
+
var Kt = Object.defineProperty, dt = (n, t, e, l) => {
|
599
|
+
for (var o = void 0, a = n.length - 1, r; a >= 0; a--)
|
600
|
+
(r = n[a]) && (o = r(t, e, o) || o);
|
601
|
+
return o && Kt(t, e, o), o;
|
602
|
+
};
|
603
|
+
class Z extends E(L, {
|
604
|
+
noDefaultSize: !0
|
605
|
+
}) {
|
606
|
+
constructor() {
|
607
|
+
super(...arguments), this.icon = !1, this.variant = "neutral";
|
608
|
+
}
|
609
|
+
static get styles() {
|
610
|
+
return [S(Gt)];
|
611
|
+
}
|
612
|
+
render() {
|
613
|
+
return s`
|
614
|
+
${this.variant === "negative" && this.icon ? s` ${C(bt)} ` : P}
|
615
|
+
<div class="text"><slot></slot></div>
|
616
|
+
`;
|
617
|
+
}
|
618
|
+
}
|
619
|
+
dt([
|
620
|
+
i({ type: Boolean, reflect: !0 })
|
621
|
+
], Z.prototype, "icon");
|
622
|
+
dt([
|
623
|
+
i({ reflect: !0 })
|
624
|
+
], Z.prototype, "variant");
|
625
|
+
customElements.get("luzmo-text-field") || customElements.define("luzmo-text-field", at);
|
626
|
+
customElements.get("luzmo-help-text") || customElements.define("luzmo-help-text", Z);
|
627
|
+
const Wt = ":host{display:inline-block}:host luzmo-text-field{width:100%}";
|
628
|
+
var Yt = Object.defineProperty, f = (n, t, e, l) => {
|
629
|
+
for (var o = void 0, a = n.length - 1, r; a >= 0; a--)
|
630
|
+
(r = n[a]) && (o = r(t, e, o) || o);
|
631
|
+
return o && Yt(t, e, o), o;
|
632
|
+
};
|
633
|
+
class g extends nt(
|
634
|
+
E(L, {
|
635
|
+
noDefaultSize: !0
|
636
|
+
})
|
637
|
+
) {
|
638
|
+
constructor() {
|
639
|
+
super(...arguments), this.allowedKeys = "", this.i18nPlaceholder = {}, this.type = "text", this.grows = !1, this.maxlength = -1, this.minlength = -1, this.multiline = !1, this.rows = -1, this.quiet = !1, this.disabled = !1, this.required = !1, this.readonly = !1, this.language = "en", this.defaultLanguage = "en", this.value = {};
|
640
|
+
}
|
641
|
+
static get styles() {
|
642
|
+
return [S(Wt)];
|
643
|
+
}
|
644
|
+
get _localizedValue() {
|
645
|
+
const t = { ...this.value };
|
646
|
+
return t[this.language] ?? t[this.defaultLanguage] ?? Object.values(t)[0] ?? "";
|
647
|
+
}
|
648
|
+
get _localizedPlaceholder() {
|
649
|
+
const t = { ...this.i18nPlaceholder };
|
650
|
+
return t[this.language] ?? t[this.defaultLanguage] ?? Object.values(t)[0] ?? "";
|
651
|
+
}
|
652
|
+
handleChange(t) {
|
653
|
+
t.stopPropagation(), t.preventDefault();
|
654
|
+
const e = t.target;
|
655
|
+
this.value[this.language] !== e.value && (this.value = { ...this.value, [this.language]: e.value }, this.dispatchEvent(
|
656
|
+
new CustomEvent("change", {
|
657
|
+
bubbles: !0,
|
658
|
+
composed: !0,
|
659
|
+
cancelable: !0,
|
660
|
+
detail: { value: this.value }
|
661
|
+
})
|
662
|
+
));
|
663
|
+
}
|
664
|
+
render() {
|
665
|
+
return s`
|
666
|
+
<luzmo-text-field
|
667
|
+
.value=${this._localizedValue}
|
668
|
+
.size=${this.size}
|
669
|
+
.placeholder=${this._localizedPlaceholder}
|
670
|
+
.name=${this.name}
|
671
|
+
.allowedKeys=${this.allowedKeys}
|
672
|
+
.type=${this.type}
|
673
|
+
.pattern=${this.pattern}
|
674
|
+
.maxlength=${this.maxlength}
|
675
|
+
.minlength=${this.minlength}
|
676
|
+
?multiline=${this.multiline}
|
677
|
+
?grows=${this.grows}
|
678
|
+
.rows=${this.rows}
|
679
|
+
?quiet=${this.quiet}
|
680
|
+
?disabled=${this.disabled}
|
681
|
+
?readonly=${this.readonly}
|
682
|
+
?required=${this.required}
|
683
|
+
@input=${this.handleChange}
|
684
|
+
@change=${this.handleChange}
|
685
|
+
></luzmo-text-field>
|
686
|
+
`;
|
687
|
+
}
|
688
|
+
}
|
689
|
+
f([
|
690
|
+
i({ attribute: "allowed-keys" })
|
691
|
+
], g.prototype, "allowedKeys");
|
692
|
+
f([
|
693
|
+
i({ type: String, reflect: !0 })
|
694
|
+
], g.prototype, "name");
|
695
|
+
f([
|
696
|
+
i({ type: Object, attribute: "i18n-placeholder" })
|
697
|
+
], g.prototype, "i18nPlaceholder");
|
698
|
+
f([
|
699
|
+
i({ attribute: "type", reflect: !0 })
|
700
|
+
], g.prototype, "type");
|
701
|
+
f([
|
702
|
+
i()
|
703
|
+
], g.prototype, "pattern");
|
704
|
+
f([
|
705
|
+
i({ type: Boolean, reflect: !0 })
|
706
|
+
], g.prototype, "grows");
|
707
|
+
f([
|
708
|
+
i({ type: Number })
|
709
|
+
], g.prototype, "maxlength");
|
710
|
+
f([
|
711
|
+
i({ type: Number })
|
712
|
+
], g.prototype, "minlength");
|
713
|
+
f([
|
714
|
+
i({ type: Boolean, reflect: !0 })
|
715
|
+
], g.prototype, "multiline");
|
716
|
+
f([
|
717
|
+
i({ type: Number })
|
718
|
+
], g.prototype, "rows");
|
719
|
+
f([
|
720
|
+
i({ type: Boolean, reflect: !0 })
|
721
|
+
], g.prototype, "quiet");
|
722
|
+
f([
|
723
|
+
i({ type: Boolean, reflect: !0 })
|
724
|
+
], g.prototype, "disabled");
|
725
|
+
f([
|
726
|
+
i({ type: Boolean, reflect: !0 })
|
727
|
+
], g.prototype, "required");
|
728
|
+
f([
|
729
|
+
i({ type: Boolean, reflect: !0 })
|
730
|
+
], g.prototype, "readonly");
|
731
|
+
f([
|
732
|
+
i({ type: String, reflect: !0 })
|
733
|
+
], g.prototype, "autocomplete");
|
734
|
+
f([
|
735
|
+
i({ type: String, reflect: !0 })
|
736
|
+
], g.prototype, "language");
|
737
|
+
f([
|
738
|
+
i({ type: String, reflect: !0 })
|
739
|
+
], g.prototype, "defaultLanguage");
|
740
|
+
f([
|
741
|
+
i({ type: Object, reflect: !0 })
|
742
|
+
], g.prototype, "value");
|
743
|
+
customElements.get("luzmo-multi-language-field") || customElements.define("luzmo-multi-language-field", g);
|
744
|
+
const Zt = ":host{font-family:var(--luzmo-display-settings-font-family, var(--luzmo-font-family));font-size:var(--luzmo-display-settings-font-size, var(--display-settings-font-size));color:var(--luzmo-display-settings-font-color, var(--luzmo-font-color))}.settings-container{display:flex;flex-direction:column;gap:var(--luzmo-spacing-2)}.settings-row{display:flex;justify-content:flex-start;align-items:center;gap:var(--luzmo-display-settings-gap, var(--display-settings-gap))}luzmo-divider{margin:var(--luzmo-display-settings-ids-container-vertical-margin, var(--display-settings-ids-container-vertical-margin)) 0}.setting{display:flex;align-items:center}.label-action-container{display:flex;align-items:center;justify-content:space-between;gap:var(--luzmo-display-settings-info-to-remove-icon-gap, var(--display-settings-info-to-remove-icon-gap))}.id-button,.remove-button{outline:none;cursor:pointer;border:none;background:none;font-size:var(--luzmo-display-settings-font-size, var(--display-settings-font-size));color:var(--luzmo-display-settings-font-color, var(--luzmo-font-color))}.remove-button{display:block;width:var(--luzmo-display-settings-remove-button-size, var(--display-settings-remove-button-size));height:var(--luzmo-display-settings-remove-button-size, var(--display-settings-remove-button-size));border-radius:var(--luzmo-display-settings-remove-button-border-radius, 50%)}.remove-button:hover{background-color:var(--luzmo-display-settings-remove-button-background-color-hover, var(--luzmo-background-color-hover))}.remove-button:active,.remove-button:focus{background-color:var(--luzmo-display-settings-remove-button-background-color-down, var(--luzmo-background-color-down))}.remove-button:focus-visible{box-shadow:0 0 0 var(--luzmo-display-settings-remove-button-indicator-thickness, var(--display-settings-remove-button-indicator-thickness)) var(--highcontrast-remove-button-indicator-color, var(--luzmo-display-settings-remove-button-indicator-color, var(--display-settings-remove-button-indicator-color)))}.ids-container{display:flex;flex-direction:column;gap:var(--luzmo-display-settings-gap, var(--display-settings-gap));border-radius:50%}.id-label{text-transform:var(--luzmo-display-settings-id-label-text-transform, var(--display-settings-id-label-text-transform));font-size:var(--luzmo-display-settings-id-label-font-size, var(--display-settings-id-label-font-size));color:var(--luzmo-display-settings-id-label-color, var(--display-settings-id-label-color))}:host{--display-settings-font-family: var(--luzmo-font-family);--display-settings-id-label-text-transform: uppercase;--display-settings-id-label-color: var(--luzmo-secondary);--display-settings-remove-button-indicator-color: var(--luzmo-primary);--display-settings-remove-button-indicator-thickness: var( --luzmo-border-width )}:host{--display-settings-font-size: var(--luzmo-font-size);--display-settings-id-label-font-size: var(--luzmo-font-size-s);--display-settings-gap: var(--luzmo-spacing-3);--display-settings-ids-container-vertical-margin: var(--luzmo-spacing-4);--display-settings-info-to-remove-icon-gap: var(--luzmo-spacing-5);--display-settings-remove-button-size: var(--luzmo-component-height)}:host([size=s]){--display-settings-id-label-font-size: var(--luzmo-font-size-s);--display-settings-font-size: var(--luzmo-font-size-s);--display-settings-gap: var(--luzmo-spacing-3);--display-settings-ids-container-vertical-margin: var(--luzmo-spacing-3);--display-settings-info-to-remove-icon-gap: var(--luzmo-spacing-4);--display-settings-remove-button-size: var(--luzmo-component-height-s)}:host([size=l]){--display-settings-id-label-font-size: var(--luzmo-font-size);--display-settings-font-size: var(--luzmo-font-size-l);--display-settings-gap: var(--luzmo-spacing-4);--display-settings-ids-container-vertical-margin: var(--luzmo-spacing-5);--display-settings-info-to-remove-icon-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--display-settings-remove-button-size: var(--luzmo-component-height-l)}:host([size=xl]){--display-settings-id-label-font-size: var(--luzmo-font-size-l);--display-settings-font-size: var(--luzmo-font-size-xl);--display-settings-gap: var(--luzmo-spacing-5);--display-settings-ids-container-vertical-margin: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--display-settings-info-to-remove-icon-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-2) );--display-settings-remove-button-size: var(--luzmo-component-height-xl)}";
|
745
|
+
var Jt = Object.defineProperty, y = (n, t, e, l) => {
|
746
|
+
for (var o = void 0, a = n.length - 1, r; a >= 0; a--)
|
747
|
+
(r = n[a]) && (o = r(t, e, o) || o);
|
748
|
+
return o && Jt(t, e, o), o;
|
749
|
+
};
|
750
|
+
class x extends E(L, {
|
751
|
+
validSizes: Object.values(W)
|
752
|
+
}) {
|
753
|
+
constructor() {
|
754
|
+
super(...arguments), this._loadDisplaySettings = new st(this, {
|
755
|
+
task: async ([t, e, l]) => {
|
756
|
+
const o = [];
|
757
|
+
this.grandTotals && o.push("grandTotals"), this.periodOverPeriod && o.push("periodOverPeriod"), (e === "numeric" || e === "mixed" && (t == null ? void 0 : t.type) === "numeric") && o.push("numeric"), e !== "numeric" && (t == null ? void 0 : t.type) === "datetime" && o.push("datetime"), !["numeric", "mixed"].includes(e ?? "") && (t == null ? void 0 : t.type) === "numeric" && !this.binningDisabled && o.push("binning"), o.length > 0 && (o.includes("numeric") && !this._settingsTypeLoaded.numeric ? (await import("./index-CM80_HQw.js"), this._settingsTypeLoaded.numeric = !0) : o.includes("datetime") && !this._settingsTypeLoaded.datetime ? (await import("./en-CIeY2T5K.js").then((a) => a.i), this._settingsTypeLoaded.periodOverPeriod = !0) : o.includes("binning") && !this._settingsTypeLoaded.binning ? (await import("./index-Dq3HAOaM.js"), this._settingsTypeLoaded.binning = !0) : o.includes("grandTotals") && !this._settingsTypeLoaded.grandTotals ? (await import("./index-BmAD29P2.js"), this._settingsTypeLoaded.grandTotals = !0) : o.includes("periodOverPeriod") && !this._settingsTypeLoaded.periodOverPeriod && (await import("./index-DJp_9h0l.js").then((a) => a.i), this._settingsTypeLoaded.periodOverPeriod = !0));
|
758
|
+
},
|
759
|
+
args: () => [this.slotContent, this.slotType, this.hideDisplaySettings]
|
760
|
+
}), this.language = "en", this.contentLanguage = "en", this.slotType = "numeric", this.slotContent = {}, this._showIds = !1, this.measureColumns = [], this._settingsTypeLoaded = {
|
761
|
+
binning: !1,
|
762
|
+
datetime: !1,
|
763
|
+
numeric: !1,
|
764
|
+
grandTotals: !1,
|
765
|
+
periodOverPeriod: !1,
|
766
|
+
hierarchy: !0
|
767
|
+
}, this._currentSlotContent = {};
|
768
|
+
}
|
769
|
+
static get styles() {
|
770
|
+
return [S(Zt)];
|
771
|
+
}
|
772
|
+
willUpdate(t) {
|
773
|
+
t.has("slotContent") && (this._currentSlotContent = structuredClone(this.slotContent));
|
774
|
+
}
|
775
|
+
_onSlotContentChange(t) {
|
776
|
+
t.stopPropagation(), t.preventDefault(), this._currentSlotContent = structuredClone(t.detail.slotContent), this._sendEvent();
|
777
|
+
}
|
778
|
+
_onLabelChange() {
|
779
|
+
this._currentSlotContent = structuredClone(this._currentSlotContent), this._currentSlotContent.label = this._multiLanguageFieldElement.value || {}, this._sendEvent();
|
780
|
+
}
|
781
|
+
_sendEvent() {
|
782
|
+
this.dispatchEvent(
|
783
|
+
new CustomEvent("slot-content-changed", {
|
784
|
+
bubbles: !0,
|
785
|
+
composed: !0,
|
786
|
+
cancelable: !0,
|
787
|
+
detail: {
|
788
|
+
slotContent: { ...this._currentSlotContent }
|
789
|
+
}
|
790
|
+
})
|
791
|
+
);
|
792
|
+
}
|
793
|
+
_removeEvent() {
|
794
|
+
this.dispatchEvent(
|
795
|
+
new CustomEvent("remove-slot-content", {
|
796
|
+
bubbles: !0,
|
797
|
+
composed: !0,
|
798
|
+
cancelable: !0,
|
799
|
+
detail: {
|
800
|
+
slotContent: this._currentSlotContent
|
801
|
+
}
|
802
|
+
})
|
803
|
+
);
|
804
|
+
}
|
805
|
+
_toggleIds() {
|
806
|
+
this._showIds = !this._showIds;
|
807
|
+
}
|
808
|
+
_renderDisplaySettings() {
|
809
|
+
return s`<div class="settings-container">
|
810
|
+
<div class="settings-row">
|
811
|
+
<div class="setting">
|
812
|
+
<div class="label-container">
|
813
|
+
<luzmo-field-label side-aligned="start" .size=${this.size}
|
814
|
+
>Label:</luzmo-field-label
|
815
|
+
>
|
816
|
+
<luzmo-multi-language-field
|
817
|
+
.language=${this.language}
|
818
|
+
.value=${this._currentSlotContent.label}
|
819
|
+
.size=${this.size}
|
820
|
+
debounce="200"
|
821
|
+
@change=${this._onLabelChange}
|
822
|
+
></luzmo-multi-language-field>
|
823
|
+
</div>
|
824
|
+
<div class="label-action-container">
|
825
|
+
<button class="id-button" @click=${this._toggleIds}>
|
826
|
+
${C(zt)}
|
827
|
+
<luzmo-tooltip self-managed placement="top" size=${this.size}>
|
828
|
+
Show dataset and column id's
|
829
|
+
</luzmo-tooltip>
|
830
|
+
</button>
|
831
|
+
${this.showRemoveButton ? s`<button
|
832
|
+
class="remove-button"
|
833
|
+
@click=${this._removeEvent}
|
834
|
+
>
|
835
|
+
${C(H)}
|
836
|
+
<luzmo-tooltip
|
837
|
+
self-managed
|
838
|
+
placement="top"
|
839
|
+
size=${this.size}
|
840
|
+
>
|
841
|
+
Remove
|
842
|
+
</luzmo-tooltip>
|
843
|
+
</button>` : ""}
|
844
|
+
</div>
|
845
|
+
</div>
|
846
|
+
</div>
|
847
|
+
${this.grandTotals ? s`<luzmo-display-settings-grand-totals
|
848
|
+
.language=${this.language}
|
849
|
+
.slotContent=${this._currentSlotContent}
|
850
|
+
.size=${this.size}
|
851
|
+
@slot-content-changed=${this._onSlotContentChange}
|
852
|
+
></luzmo-display-settings-grand-totals>` : ""}
|
853
|
+
${this.slotType === "numeric" || this.slotType === "mixed" && this.slotContent.type === "numeric" ? s`<luzmo-display-settings-numeric
|
854
|
+
.language=${this.language}
|
855
|
+
.slotContent=${this._currentSlotContent}
|
856
|
+
.size=${this.size}
|
857
|
+
.measureColumns=${this.measureColumns}
|
858
|
+
@slot-content-changed=${this._onSlotContentChange}
|
859
|
+
></luzmo-display-settings-numeric>` : ""}
|
860
|
+
${this.slotType !== "numeric" && this.slotContent.type === "datetime" ? s`<luzmo-display-settings-datetime
|
861
|
+
.language=${this.language}
|
862
|
+
.contentLanguage=${this.contentLanguage}
|
863
|
+
.slotContent=${this._currentSlotContent}
|
864
|
+
.size=${this.size}
|
865
|
+
@slot-content-changed=${this._onSlotContentChange}
|
866
|
+
></luzmo-display-settings-datetime>` : ""}
|
867
|
+
${!["numeric", "mixed"].includes(this.slotType ?? "") && this.slotContent.type === "numeric" && !this.binningDisabled ? s`<luzmo-display-settings-binning
|
868
|
+
.language=${this.language}
|
869
|
+
.slotContent=${this._currentSlotContent}
|
870
|
+
.size=${this.size}
|
871
|
+
@slot-content-changed=${this._onSlotContentChange}
|
872
|
+
></luzmo-display-settings-binning>` : ""}
|
873
|
+
${this.periodOverPeriod ? s`<luzmo-display-settings-period-over-period
|
874
|
+
.language=${this.language}
|
875
|
+
.slotContent=${this._currentSlotContent}
|
876
|
+
.size=${this.size}
|
877
|
+
@slot-content-changed=${this._onSlotContentChange}
|
878
|
+
></luzmo-display-settings-period-over-period>` : ""}
|
879
|
+
</div>
|
880
|
+
${this._showIds ? s` <luzmo-divider></luzmo-divider>
|
881
|
+
<div class="ids-container">
|
882
|
+
<div>
|
883
|
+
<span class="id-label">Column: </span>
|
884
|
+
${this._currentSlotContent.columnId ?? this._currentSlotContent.column}
|
885
|
+
</div>
|
886
|
+
<div>
|
887
|
+
<span class="id-label">Dataset: </span>
|
888
|
+
${this._currentSlotContent.datasetId ?? this._currentSlotContent.set}
|
889
|
+
</div>
|
890
|
+
<div></div>
|
891
|
+
</div>` : ""}`;
|
892
|
+
}
|
893
|
+
render() {
|
894
|
+
return this._loadDisplaySettings.render({
|
895
|
+
pending: () => s`<luzmo-progress-circle
|
896
|
+
indeterminate
|
897
|
+
.size=${this.size}
|
898
|
+
></luzmo-progress-circle>`,
|
899
|
+
complete: () => this._renderDisplaySettings(),
|
900
|
+
error: (t) => this._renderDisplaySettings()
|
901
|
+
});
|
902
|
+
}
|
903
|
+
}
|
904
|
+
y([
|
905
|
+
i({ type: String })
|
906
|
+
], x.prototype, "language");
|
907
|
+
y([
|
908
|
+
i({ type: String, attribute: "content-language" })
|
909
|
+
], x.prototype, "contentLanguage");
|
910
|
+
y([
|
911
|
+
i({ type: Boolean, attribute: "hide-display-settings" })
|
912
|
+
], x.prototype, "hideDisplaySettings");
|
913
|
+
y([
|
914
|
+
i({ type: Boolean, attribute: "binning-disabled" })
|
915
|
+
], x.prototype, "binningDisabled");
|
916
|
+
y([
|
917
|
+
i({ type: Boolean, attribute: "grand-totals" })
|
918
|
+
], x.prototype, "grandTotals");
|
919
|
+
y([
|
920
|
+
i({ type: Boolean, attribute: "period-over-period" })
|
921
|
+
], x.prototype, "periodOverPeriod");
|
922
|
+
y([
|
923
|
+
i({ type: Boolean, attribute: "show-remove-button" })
|
924
|
+
], x.prototype, "showRemoveButton");
|
925
|
+
y([
|
926
|
+
i({ type: String, attribute: "slot-type" })
|
927
|
+
], x.prototype, "slotType");
|
928
|
+
y([
|
929
|
+
i()
|
930
|
+
], x.prototype, "slotContent");
|
931
|
+
y([
|
932
|
+
Y()
|
933
|
+
], x.prototype, "_showIds");
|
934
|
+
y([
|
935
|
+
i({ type: Array, reflect: !1 })
|
936
|
+
], x.prototype, "measureColumns");
|
937
|
+
y([
|
938
|
+
O("luzmo-multi-language-field")
|
939
|
+
], x.prototype, "_multiLanguageFieldElement");
|
940
|
+
customElements.get("luzmo-display-settings") || customElements.define("luzmo-display-settings", x);
|
941
|
+
var Qt = {
|
942
|
+
large: 700
|
943
|
+
};
|
944
|
+
function Xt(n) {
|
945
|
+
n.animate([{
|
946
|
+
backgroundColor: "var(--ds-background-selected, #E9F2FF)"
|
947
|
+
}, {}], {
|
948
|
+
duration: Qt.large,
|
949
|
+
/**
|
950
|
+
* This is equivalent to the browser default, but we are making it
|
951
|
+
* explicit to avoid relying on implicit behavior.
|
952
|
+
*
|
953
|
+
* This curve is not part of `@atlaskit/motion` but it was an intentional
|
954
|
+
* design decision to use this curve.
|
955
|
+
*/
|
956
|
+
easing: "cubic-bezier(0.25, 0.1, 0.25, 1.0)",
|
957
|
+
iterations: 1
|
958
|
+
});
|
959
|
+
}
|
960
|
+
function tt(n, t) {
|
961
|
+
var e = Object.keys(n);
|
962
|
+
if (Object.getOwnPropertySymbols) {
|
963
|
+
var l = Object.getOwnPropertySymbols(n);
|
964
|
+
t && (l = l.filter(function(o) {
|
965
|
+
return Object.getOwnPropertyDescriptor(n, o).enumerable;
|
966
|
+
})), e.push.apply(e, l);
|
967
|
+
}
|
968
|
+
return e;
|
969
|
+
}
|
970
|
+
function et(n) {
|
971
|
+
for (var t = 1; t < arguments.length; t++) {
|
972
|
+
var e = arguments[t] != null ? arguments[t] : {};
|
973
|
+
t % 2 ? tt(Object(e), !0).forEach(function(l) {
|
974
|
+
ot(n, l, e[l]);
|
975
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(e)) : tt(Object(e)).forEach(function(l) {
|
976
|
+
Object.defineProperty(n, l, Object.getOwnPropertyDescriptor(e, l));
|
977
|
+
});
|
978
|
+
}
|
979
|
+
return n;
|
980
|
+
}
|
981
|
+
var te = {
|
982
|
+
top: function(t, e) {
|
983
|
+
return Math.abs(e.y - t.top);
|
984
|
+
},
|
985
|
+
right: function(t, e) {
|
986
|
+
return Math.abs(t.right - e.x);
|
987
|
+
},
|
988
|
+
bottom: function(t, e) {
|
989
|
+
return Math.abs(t.bottom - e.y);
|
990
|
+
},
|
991
|
+
left: function(t, e) {
|
992
|
+
return Math.abs(e.x - t.left);
|
993
|
+
}
|
994
|
+
}, ct = Symbol("closestEdge");
|
995
|
+
function ee(n, t) {
|
996
|
+
var e, l, o = t.element, a = t.input, r = t.allowedEdges, d = {
|
997
|
+
x: a.clientX,
|
998
|
+
y: a.clientY
|
999
|
+
}, c = o.getBoundingClientRect(), u = r.map(function(m) {
|
1000
|
+
return {
|
1001
|
+
edge: m,
|
1002
|
+
value: te[m](c, d)
|
1003
|
+
};
|
1004
|
+
}), v = (e = (l = u.sort(function(m, k) {
|
1005
|
+
return m.value - k.value;
|
1006
|
+
})[0]) === null || l === void 0 ? void 0 : l.edge) !== null && e !== void 0 ? e : null;
|
1007
|
+
return et(et({}, n), {}, ot({}, ct, v));
|
1008
|
+
}
|
1009
|
+
function V(n) {
|
1010
|
+
var t;
|
1011
|
+
return (t = n[ct]) !== null && t !== void 0 ? t : null;
|
1012
|
+
}
|
1013
|
+
const oe = ':host{font-family:var(--luzmo-slot-menu-list-font-family, var(--luzmo-font-family));font-size:var(--luzmo-slot-menu-list-font-size, var(--slot-menu-list-font-size));color:var(--luzmo-slot-menu-listfont-color, var(--luzmo-font-color))}:host{margin:0;padding:0;list-style:none;border-right:var(--luzmo-slot-menu-list-border-right-width, var(--luzmo-border-width)) solid var(--luzmo-slot-menu-list-border-right-color, var(--luzmo-border-color))}:host li{position:relative;cursor:pointer}:host li:hover{background-color:var(--luzmo-slot-menu-list-background-color-hover, var(--slot-menu-list-background-color-hover))}:host .active{background-color:var(--luzmo-slot-menu-list-active-background-color, var(--slot-menu-list-active-background-color));color:var(--luzmo-slot-menu-list-active-color, var(--slot-menu-list-active-color))}:host .active:hover{background-color:var(--luzmo-slot-menu-list-active-background-color-hover, var(--slot-menu-list-active-background-color-hover))}.drop-indicator{position:absolute;left:0;right:0;height:var(--luzmo-slot-menu-list-drop-indicator-height, var(--slot-menu-list-drop-indicator-height));background-color:var(--luzmo-slot-menu-list-drop-indicator-color, var(--slot-menu-list-drop-indicator-color))}.drop-indicator:before{content:"";display:block;width:100%;border:var(--luzmo-slot-menu-list-drop-indicator-height, var(--slot-menu-list-drop-indicator-height)) solid var(--luzmo-slot-menu-list-drop-indicator-color, var(--slot-menu-list-drop-indicator-color));border-radius:50%;position:absolute;background:var(--luzmo-slot-menu-list-drop-indicator-background, var(--luzmo-background-color));left:calc(-.5 * (var(--luzmo-slot-menu-list-drop-indicator-circle-size, var(--slot-menu-list-drop-indicator-circle-size)) + var(--luzmo-slot-menu-list-drop-indicator-height, var(--slot-menu-list-drop-indicator-height))));top:calc(-.5 * (var(--luzmo-slot-menu-list-drop-indicator-circle-size, var(--slot-menu-list-drop-indicator-circle-size)) + var(--luzmo-slot-menu-list-drop-indicator-height, var(--slot-menu-list-drop-indicator-height))));height:var(--luzmo-slot-menu-list-drop-indicator-circle-size, var(--slot-menu-list-drop-indicator-circle-size));width:var(--luzmo-slot-menu-list-drop-indicator-circle-size, var(--slot-menu-list-drop-indicator-circle-size))}.drop-indicator[data-edge=top]{top:calc(-.5 * var(--luzmo-slot-menu-list-drop-indicator-height, var(--slot-menu-list-drop-indicator-height)))}.drop-indicator[data-edge=bottom]{bottom:calc(-.5 * var(--luzmo-slot-menu-list-drop-indicator-height, var(--slot-menu-list-drop-indicator-height)))}.draggable-slot-content{display:flex;justify-content:space-between;gap:var(--luzmo-slot-menu-label-to-icon-gap, var(--slot-menu-label-to-icon-gap));align-items:center}.draggable-slot-content .draggable-slot-content-label,.draggable-slot-content .draggable-slot-content-remove{padding-block-start:var(--luzmo-slot-menu-list-item-vertical-padding, var(--slot-menu-list-item-vertical-padding));padding-block-end:var(--luzmo-slot-menu-list-item-vertical-padding, var(--slot-menu-list-item-vertical-padding))}.draggable-slot-content .draggable-slot-content-label{padding-inline-start:var(--luzmo-slot-menu-list-item-horizontal-padding, var(--slot-menu-list-item-horizontal-padding));flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.draggable-slot-content .draggable-slot-content-remove{padding-inline-end:var(--luzmo-slot-menu-list-item-horizontal-padding, var(--slot-menu-list-item-horizontal-padding));flex:0 0 auto}:host{--slot-menu-list-active-background-color: var(--luzmo-primary);--slot-menu-list-active-background-color-hover: var(--luzmo-primary-hover);--slot-menu-list-active-color: var(--luzmo-primary-inverse-color);--slot-menu-list-background-color-hover: var(--luzmo-background-color-hover);--slot-menu-list-drop-indicator-color: var(--luzmo-font-color-down);--slot-menu-list-drop-indicator-height: 2px;--slot-menu-list-drop-indicator-circle-size: 4px}:host{--slot-menu-display-settings-min-width: 19rem;--slot-menu-min-height: calc(var(--luzmo-component-height) * 2);--slot-menu-font-size: var(--luzmo-font-size);--slot-menu-list-item-horizontal-padding: var(--luzmo-spacing-4);--slot-menu-list-item-vertical-padding: var(--luzmo-spacing-3);--slot-menu-label-to-icon-gap: var(--luzmo-spacing-3)}:host([size=s]){--slot-menu-display-settings-min-width: 16rem;--slot-menu-min-height: calc(var(--luzmo-component-height-s) * 2);--slot-menu-font-size: var(--luzmo-font-size-s);--slot-menu-list-item-horizontal-padding: var(--luzmo-spacing-3);--slot-menu-list-item-vertical-padding: var(--luzmo-spacing-3);--slot-menu-label-to-icon-gap: var(--luzmo-spacing-2)}:host([size=l]){--slot-menu-display-settings-min-width: 23rem;--slot-menu-min-height: calc(var(--luzmo-component-height-l) * 2);--slot-menu-font-size: var(--luzmo-font-size-l);--slot-menu-list-item-horizontal-padding: var(--luzmo-spacing-5);--slot-menu-list-item-vertical-padding: var(--luzmo-spacing-3);--slot-menu-label-to-icon-gap: var(--luzmo-spacing-4)}:host([size=xl]){--slot-menu-display-settings-min-width: 26rem;--slot-menu-min-height: calc(var(--luzmo-component-height-xl) * 2);--slot-menu-font-size: var(--luzmo-font-size-xl);--slot-menu-list-item-horizontal-padding: var(--luzmo-spacing-5);--slot-menu-list-item-vertical-padding: var(--luzmo-spacing-4);--slot-menu-label-to-icon-gap: var(--luzmo-spacing-5)}';
|
1014
|
+
var le = Object.defineProperty, R = (n, t, e, l) => {
|
1015
|
+
for (var o = void 0, a = n.length - 1, r; a >= 0; a--)
|
1016
|
+
(r = n[a]) && (o = r(t, e, o) || o);
|
1017
|
+
return o && le(t, e, o), o;
|
1018
|
+
};
|
1019
|
+
class B extends E(L, {
|
1020
|
+
validSizes: Object.values(W)
|
1021
|
+
}) {
|
1022
|
+
constructor() {
|
1023
|
+
super(...arguments), this.language = "en", this.contentLanguage = "en", this.slotContents = [], this.activeIndex = 0, this._sendChangeEvent = () => {
|
1024
|
+
this.dispatchEvent(
|
1025
|
+
new CustomEvent("slot-list-changed", {
|
1026
|
+
bubbles: !0,
|
1027
|
+
composed: !0,
|
1028
|
+
cancelable: !0,
|
1029
|
+
detail: {
|
1030
|
+
slotContents: structuredClone(this.slotContents),
|
1031
|
+
activeIndex: this.activeIndex
|
1032
|
+
}
|
1033
|
+
})
|
1034
|
+
);
|
1035
|
+
}, this._cleanupFns = [], this._attachAll = () => {
|
1036
|
+
[...this._draggableSlotContentElements].forEach((t) => {
|
1037
|
+
const e = this._sendChangeEvent.bind(this), l = this, o = pt({
|
1038
|
+
element: t,
|
1039
|
+
onGenerateDragPreview({ nativeSetDragImage: r }) {
|
1040
|
+
ht({
|
1041
|
+
nativeSetDragImage: r,
|
1042
|
+
render({ container: d }) {
|
1043
|
+
var v;
|
1044
|
+
const c = document.createElement("div");
|
1045
|
+
c.classList.add("drag-preview");
|
1046
|
+
const u = {};
|
1047
|
+
[
|
1048
|
+
[
|
1049
|
+
"borderColor",
|
1050
|
+
"--luzmo-slot-menu-list-border-color",
|
1051
|
+
"--luzmo-border-color"
|
1052
|
+
],
|
1053
|
+
[
|
1054
|
+
"backgroundColor",
|
1055
|
+
"--luzmo-slot-menu-list-background-color",
|
1056
|
+
"--luzmo-background-color"
|
1057
|
+
],
|
1058
|
+
[
|
1059
|
+
"color",
|
1060
|
+
"--luzmo-slot-menu-list-font-color",
|
1061
|
+
"--slot-menu-list-font-color"
|
1062
|
+
],
|
1063
|
+
[
|
1064
|
+
"fontSize",
|
1065
|
+
"--luzmo-slot-menu-list-font-size",
|
1066
|
+
"--slot-menu-list-font-size"
|
1067
|
+
],
|
1068
|
+
[
|
1069
|
+
"horizontalPadding",
|
1070
|
+
"--luzmo-slot-menu-list-item-horizontal-padding",
|
1071
|
+
"--slot-menu-list-item-horizontal-padding"
|
1072
|
+
],
|
1073
|
+
[
|
1074
|
+
"verticalPadding",
|
1075
|
+
"--luzmo-slot-menu-list-item-vertical-padding",
|
1076
|
+
"--slot-menu-list-item-vertical-padding"
|
1077
|
+
],
|
1078
|
+
[
|
1079
|
+
"borderRadius",
|
1080
|
+
"--luzmo-slot-menu-list-border-radius",
|
1081
|
+
"--luzmo-border-radius"
|
1082
|
+
],
|
1083
|
+
[
|
1084
|
+
"fontFamily",
|
1085
|
+
"--luzmo-slot-menu-list-font-family",
|
1086
|
+
"--luzmo-font-family"
|
1087
|
+
]
|
1088
|
+
].forEach(([m, k, q]) => {
|
1089
|
+
const T = X(t, k) || X(t, q);
|
1090
|
+
u[m] = T;
|
1091
|
+
}), c.textContent = ((v = t.querySelector("[data-task-content]")) == null ? void 0 : v.textContent) ?? // worst case fallback if we set up our data-* up wrong
|
1092
|
+
t.textContent, Object.assign(c.style, {
|
1093
|
+
border: `1px solid ${u.borderColor}`,
|
1094
|
+
backgroundColor: u.backgroundColor,
|
1095
|
+
borderRadius: u.borderRadius,
|
1096
|
+
fontFamily: u.fontFamily,
|
1097
|
+
fontSize: u.fontSize,
|
1098
|
+
color: u.color,
|
1099
|
+
paddingInline: `${u.horizontalPadding}`,
|
1100
|
+
paddingBlock: `${u.verticalPadding}`
|
1101
|
+
}), d.append(c);
|
1102
|
+
}
|
1103
|
+
});
|
1104
|
+
},
|
1105
|
+
getInitialData() {
|
1106
|
+
var c;
|
1107
|
+
const r = t.parentElement;
|
1108
|
+
let d = 0;
|
1109
|
+
return r && (d = [...((c = r.parentElement) == null ? void 0 : c.children) ?? []].indexOf(
|
1110
|
+
r
|
1111
|
+
)), {
|
1112
|
+
index: d
|
1113
|
+
};
|
1114
|
+
},
|
1115
|
+
onDragStart() {
|
1116
|
+
t.style.opacity = "0.5";
|
1117
|
+
},
|
1118
|
+
onDrop() {
|
1119
|
+
t.style.opacity = "1";
|
1120
|
+
}
|
1121
|
+
});
|
1122
|
+
this._cleanupFns.push(o);
|
1123
|
+
const a = lt({
|
1124
|
+
element: t,
|
1125
|
+
canDrop({ source: r }) {
|
1126
|
+
var d;
|
1127
|
+
return r.element === t ? !1 : (d = r == null ? void 0 : r.element) == null ? void 0 : d.classList.contains("draggable-slot-content");
|
1128
|
+
},
|
1129
|
+
getData(r) {
|
1130
|
+
return ee(
|
1131
|
+
{},
|
1132
|
+
{
|
1133
|
+
element: t,
|
1134
|
+
input: r.input,
|
1135
|
+
allowedEdges: ["top", "bottom"]
|
1136
|
+
}
|
1137
|
+
);
|
1138
|
+
},
|
1139
|
+
getIsSticky() {
|
1140
|
+
return !0;
|
1141
|
+
},
|
1142
|
+
onDragEnter({ self: r }) {
|
1143
|
+
const d = V(r.data);
|
1144
|
+
if (!d)
|
1145
|
+
return;
|
1146
|
+
const c = document.createElement("div");
|
1147
|
+
c.classList.add("drop-indicator"), c.dataset.edge = d, t.after(c);
|
1148
|
+
},
|
1149
|
+
onDrag({ self: r }) {
|
1150
|
+
var u, v, m;
|
1151
|
+
const d = V(r.data);
|
1152
|
+
if (!d) {
|
1153
|
+
(u = t.nextElementSibling) == null || u.remove();
|
1154
|
+
return;
|
1155
|
+
}
|
1156
|
+
if (((v = t.nextElementSibling) == null ? void 0 : v.getAttribute("data-edge")) === d)
|
1157
|
+
return;
|
1158
|
+
(m = t.nextElementSibling) == null || m.remove();
|
1159
|
+
const c = document.createElement("div");
|
1160
|
+
c.classList.add("drop-indicator"), c.dataset.edge = d, t.after(c);
|
1161
|
+
},
|
1162
|
+
onDragLeave() {
|
1163
|
+
var r;
|
1164
|
+
(r = t.nextElementSibling) == null || r.remove();
|
1165
|
+
},
|
1166
|
+
onDrop({ self: r, source: d }) {
|
1167
|
+
var v, m, k, q;
|
1168
|
+
(v = t.nextElementSibling) == null || v.remove();
|
1169
|
+
const c = V(r.data), u = r.element.parentElement;
|
1170
|
+
if (typeof d.data.index == "number" && u) {
|
1171
|
+
let T = [...((m = u.parentElement) == null ? void 0 : m.children) ?? []].indexOf(
|
1172
|
+
u
|
1173
|
+
);
|
1174
|
+
c === "bottom" && d.data.index >= T && T < (((q = (k = u == null ? void 0 : u.parentElement) == null ? void 0 : k.children) == null ? void 0 : q.length) ?? 0) - 1 ? T += 1 : c === "top" && T > d.data.index && (T -= 1);
|
1175
|
+
const I = l.activeIndex, F = d.data.index, U = T, ut = l.slotContents[F];
|
1176
|
+
l.slotContents.splice(F, 1), l.slotContents.splice(U, 0, ut), F === I ? l.activeIndex = U : F < I && U >= I ? l.activeIndex = I - 1 : F > I && U <= I && (l.activeIndex = I + 1);
|
1177
|
+
}
|
1178
|
+
c && (Xt(d.element), l.requestUpdate(), e());
|
1179
|
+
}
|
1180
|
+
});
|
1181
|
+
this._cleanupFns.push(a);
|
1182
|
+
});
|
1183
|
+
}, this._detachAll = () => {
|
1184
|
+
this._cleanupFns.forEach((t) => t()), this._cleanupFns = [];
|
1185
|
+
};
|
1186
|
+
}
|
1187
|
+
static get styles() {
|
1188
|
+
return [S(oe)];
|
1189
|
+
}
|
1190
|
+
willUpdate(t) {
|
1191
|
+
this._detachAll();
|
1192
|
+
}
|
1193
|
+
updated(t) {
|
1194
|
+
this._attachAll();
|
1195
|
+
}
|
1196
|
+
setActiveIndex(t) {
|
1197
|
+
this.activeIndex = t, this._sendChangeEvent();
|
1198
|
+
}
|
1199
|
+
removeSlotContent(t) {
|
1200
|
+
this.slotContents = this.slotContents.filter(
|
1201
|
+
(e, l) => l !== t
|
1202
|
+
), this.activeIndex === t ? this.activeIndex = t : this.slotContents.length > 0 && // go one down if index < activeIndex
|
1203
|
+
this.activeIndex > t && this.activeIndex--, this._sendChangeEvent();
|
1204
|
+
}
|
1205
|
+
render() {
|
1206
|
+
const t = this.slotContents.map(
|
1207
|
+
(e, l) => {
|
1208
|
+
const o = K(e.label, this.contentLanguage);
|
1209
|
+
return s`<li class=${l === this.activeIndex ? "active" : ""}>
|
1210
|
+
<div class="draggable-slot-content">
|
1211
|
+
<div
|
1212
|
+
class="draggable-slot-content-label"
|
1213
|
+
@click=${this.setActiveIndex.bind(this, l)}
|
1214
|
+
>
|
1215
|
+
${o}
|
1216
|
+
</div>
|
1217
|
+
<div
|
1218
|
+
class="draggable-slot-content-remove"
|
1219
|
+
@click=${this.removeSlotContent.bind(this, l)}
|
1220
|
+
>
|
1221
|
+
${C(H)}
|
1222
|
+
</div>
|
1223
|
+
</div>
|
1224
|
+
</li>`;
|
1225
|
+
}
|
1226
|
+
);
|
1227
|
+
return s`<div>${t}</div>`;
|
1228
|
+
}
|
1229
|
+
}
|
1230
|
+
R([
|
1231
|
+
i({ type: String, reflect: !0 })
|
1232
|
+
], B.prototype, "language");
|
1233
|
+
R([
|
1234
|
+
i({ type: String, attribute: "content-language", reflect: !0 })
|
1235
|
+
], B.prototype, "contentLanguage");
|
1236
|
+
R([
|
1237
|
+
Pt(".draggable-slot-content")
|
1238
|
+
], B.prototype, "_draggableSlotContentElements");
|
1239
|
+
R([
|
1240
|
+
i()
|
1241
|
+
], B.prototype, "slotContents");
|
1242
|
+
R([
|
1243
|
+
i({ type: Number })
|
1244
|
+
], B.prototype, "activeIndex");
|
1245
|
+
customElements.get("luzmo-slot-menu-list") || customElements.define("luzmo-slot-menu-list", B);
|
1246
|
+
const ie = ":host{font-family:var(--luzmo-slot-menu-font-family, var(--luzmo-font-family));font-size:var(--luzmo-slot-menu-font-size, var(--slot-menu-font-size));color:var(--luzmo-slot-menu-font-color, var(--luzmo-font-color));display:block;width:fit-content}luzmo-slot-menu-list{min-width:var(--luzmo-slot-menu-list-min-width, var(--slot-menu-list-min-width));max-width:var(--luzmo-slot-menu-list-max-width, var(--slot-menu-list-max-width))}.slot-contents-container{position:relative;border:var(--luzmo-slot-menu-border-width, var(--luzmo-border-width)) solid var(--luzmo-slot-menu-border-color, var(--luzmo-border-color));border-radius:var(--luzmo-slot-menu-border-radius, var(--luzmo-border-radius));background:var(--luzmo-slot-menu-background-color, var(--luzmo-background-color));border-top-left-radius:0}.slot-contents-container .inner-container{display:flex}.slot-contents-container .inner-container luzmo-display-settings{min-width:var(--luzmo-slot-menu-display-settings-min-width, var(--slot-menu-display-settings-min-width));padding:var(--luzmo-slot-menu-display-settings-vertical-padding, var(--slot-menu-display-settings-vertical-padding)) var(--luzmo-slot-menu-display-settings-horizontal-padding, var(--slot-menu-display-settings-horizontal-padding))}:host([variant=popup]) .slot-contents-container{overflow:hidden;border-top-left-radius:var(--luzmo-slot-menu-border-radius, var(--luzmo-border-radius));--slot-menu-popup-filter: drop-shadow( var( --luzmo-slot-menu-popup-shadow-horizontal, var(--slot-menu-popup-shadow-horizontal) ) var( --luzmo-slot-menu-popup-shadow-vertical, var(--slot-menu-popup-shadow-vertical) ) var( --luzmo-slot-menu-popup-shadow-blur, var(--slot-menu-popup-shadow-blur) ) var( --luzmo-slot-menu-popup-shadow-color, var(--slot-menu-popup-shadow-color) ) );filter:var(--luzmo-slot-menu-popup-filter, var(--slot-menu-popup-filter))}.slot-menu-top-menu{display:flex;align-items:center;border-radius:var(--luzmo-slot-menu-border-radius, var(--luzmo-border-radius));border-bottom-left-radius:0;border-bottom-right-radius:0;overflow:hidden;width:fit-content}.drag-handle{background-color:var(--luzmo-slot-menu-drag-handle-background-color, var(--luzmo-background-color-highlight));cursor:grab;width:fit-content;border:var(--luzmo-slot-menu-border-width, var(--luzmo-border-width)) solid var(--luzmo-slot-menu-border-color, var(--luzmo-background-color-highlight));font-size:var(--luzmo-slot-menu-drag-handle-size, var(--slot-menu-drag-handle-size));padding:var(--luzmo-slot-menu-drag-handle-vertical-padding, var(--slot-menu-drag-handle-vertical-padding)) var(--luzmo-slot-menu-drag-handle-horizontal-padding, var(--slot-menu-drag-handle-horizontal-padding))}.drag-handle:hover{background-color:var(--luzmo-slot-menu-drag-handle-background-color-hover, var(--luzmo-background-color-highlight-hover))}.slot-content-action{display:flex;flex:0 1 auto;max-width:var(--luzmo-slot-menu-top-menu-label-max-width, var(--slot-menu-top-menu-label-max-width));gap:var(--luzmo-slot-menu-label-to-icon-gap, var(--slot-menu-label-to-icon-gap));background-color:var(--luzmo-slot-menu-content-label-background-color, var(--luzmo-primary));color:var(--luzmo-slot-menu-content-label-color, var(--luzmo-primary-inverse-color));border:var(--luzmo-slot-menu-border-width, var(--luzmo-border-width)) solid var(--luzmo-slot-menu-content-label-border-color, var(--luzmo-primary));padding:var(--luzmo-slot-menu-drag-handle-vertical-padding, var(--slot-menu-drag-handle-vertical-padding)) var(--luzmo-slot-menu-drag-handle-horizontal-padding, var(--slot-menu-drag-handle-horizontal-padding))}.slot-content-action:hover{background-color:var(--luzmo-slot-menu-content-label-background-color-hover, var(--luzmo-primary-hover))}.slot-content-action:focus{background-color:var(--luzmo-slot-menu-content-label-background-color-focus, var(--luzmo-primary-focus))}.slot-content-action .slot-content-label{flex:1 1 auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.slot-content-action .slot-content-remove{flex:0 0 auto;cursor:pointer}.close{position:absolute;right:1rem;cursor:pointer;top:calc(-2 * var(--luzmo-slot-menu-border-width, var(--luzmo-border-width)));background-color:var(--luzmo-slot-menu-close-button-background-color, var(--luzmo-background-color-highlight));font-size:var(--luzmo-slot-menu-close-button-size, var(--slot-menu-close-button-size));border:var(--luzmo-slot-menu-border-width, var(--luzmo-border-width)) solid var(--luzmo-slot-menu-border-color, var(--luzmo-border-color));border-radius:var(--luzmo-slot-menu-border-radius, var(--luzmo-border-radius));border-top-left-radius:0;border-top-right-radius:0;padding:var(--luzmo-slot-menu-close-button-vertical-padding, var(--slot-menu-close-button-vertical-padding)) var(--luzmo-slot-menu-close-button-horizontal-padding, var(--slot-menu-close-button-horizontal-padding))}.close:hover{background-color:var(--luzmo-slot-menu-close-button-background-color-hover, var(--luzmo-background-color-highlight-hover))}:host{--slot-menu-display-settings-min-width: 19rem;--slot-menu-min-height: calc(var(--luzmo-component-height) * 2);--slot-menu-font-size: var(--luzmo-font-size);--slot-menu-display-settings-horizontal-padding: var(--luzmo-spacing-5);--slot-menu-display-settings-vertical-padding: var(--luzmo-spacing-4);--slot-menu-top-menu-label-max-width: 12rem;--slot-menu-list-min-width: 8rem;--slot-menu-list-max-width: 12rem;--slot-menu-label-to-icon-gap: var(--luzmo-spacing-3);--slot-menu-drag-handle-size: var(--luzmo-font-size);--slot-menu-drag-handle-vertical-padding: var(--luzmo-spacing-2);--slot-menu-drag-handle-horizontal-padding: var(--luzmo-spacing-3);--slot-menu-close-button-size: var(--luzmo-font-size-s);--slot-menu-close-button-vertical-padding: var(--luzmo-spacing-2);--slot-menu-close-button-horizontal-padding: calc( var(--luzmo-spacing-2) + var(--luzmo-spacing-1) );--slot-menu-popup-shadow-horizontal: 0;--slot-menu-popup-shadow-vertical: 1px;--slot-menu-popup-shadow-blur: 4px;--slot-menu-popup-shadow-color: var(--luzmo-border-color)}:host([size=s]){--slot-menu-display-settings-min-width: 16rem;--slot-menu-min-height: calc(var(--luzmo-component-height-s) * 2);--slot-menu-font-size: var(--luzmo-font-size-s);--slot-menu-display-settings-horizontal-padding: var(--luzmo-spacing-4);--slot-menu-display-settings-vertical-padding: var(--luzmo-spacing-3);--slot-menu-top-menu-label-max-width: 10rem;--slot-menu-list-min-width: 6rem;--slot-menu-list-max-width: 10rem;--slot-menu-label-to-icon-gap: var(--luzmo-spacing-2);--slot-menu-drag-handle-size: var(--luzmo-font-size-s);--slot-menu-drag-handle-vertical-padding: var(--luzmo-spacing-2);--slot-menu-drag-handle-horizontal-padding: var(--luzmo-spacing-3);--slot-menu-close-button-size: var(--luzmo-font-size-xs);--slot-menu-close-button-vertical-padding: var(--luzmo-spacing-2);--slot-menu-close-button-horizontal-padding: calc( var(--luzmo-spacing-2) + var(--luzmo-spacing-1) )}:host([size=l]){--slot-menu-display-settings-min-width: 23rem;--slot-menu-min-height: calc(var(--luzmo-component-height-l) * 2);--slot-menu-font-size: var(--luzmo-font-size-l);--slot-menu-display-settings-horizontal-padding: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--slot-menu-display-settings-vertical-padding: var(--luzmo-spacing-5);--slot-menu-top-menu-label-max-width: 14rem;--slot-menu-list-min-width: 9rem;--slot-menu-list-max-width: 14rem;--slot-menu-label-to-icon-gap: var(--luzmo-spacing-4);--slot-menu-drag-handle-size: var(--luzmo-font-size-l);--slot-menu-drag-handle-vertical-padding: var(--luzmo-spacing-3);--slot-menu-drag-handle-horizontal-padding: var(--luzmo-spacing-3);--slot-menu-close-button-size: var(--luzmo-font-size);--slot-menu-close-button-vertical-padding: calc( var(--luzmo-spacing-2) + var(--luzmo-spacing-1) );--slot-menu-close-button-horizontal-padding: var(--luzmo-spacing-3)}:host([size=xl]){--slot-menu-display-settings-min-width: 26rem;--slot-menu-min-height: calc(var(--luzmo-component-height-xl) * 2);--slot-menu-font-size: var(--luzmo-font-size-xl);--slot-menu-display-settings-horizontal-padding: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-2) );--slot-menu-display-settings-vertical-padding: var(--luzmo-spacing-5);--slot-menu-top-menu-label-max-width: 16rem;--slot-menu-list-min-width: 10rem;--slot-menu-list-max-width: 16rem;--slot-menu-label-to-icon-gap: var(--luzmo-spacing-5);--slot-menu-drag-handle-size: var(--luzmo-font-size-xl);--slot-menu-drag-handle-vertical-padding: var(--luzmo-spacing-3);--slot-menu-drag-handle-horizontal-padding: var(--luzmo-spacing-4);--slot-menu-close-button-size: var(--luzmo-font-size-l);--slot-menu-close-button-vertical-padding: var(--luzmo-spacing-3);--slot-menu-close-button-horizontal-padding: var(--luzmo-spacing-3)}";
|
1247
|
+
var ne = Object.defineProperty, _ = (n, t, e, l) => {
|
1248
|
+
for (var o = void 0, a = n.length - 1, r; a >= 0; a--)
|
1249
|
+
(r = n[a]) && (o = r(t, e, o) || o);
|
1250
|
+
return o && ne(t, e, o), o;
|
1251
|
+
};
|
1252
|
+
class w extends E(L, {
|
1253
|
+
validSizes: Object.values(W)
|
1254
|
+
}) {
|
1255
|
+
constructor() {
|
1256
|
+
super(...arguments), this.language = "en", this.contentLanguage = "en", this.slotType = "numeric", this.variant = "draggable", this.slotContents = [], this._slotListData = [], this._slotContents = [], this._currentSlotContent = {}, this._activeIndex = 0;
|
1257
|
+
}
|
1258
|
+
static get styles() {
|
1259
|
+
return [S(ie)];
|
1260
|
+
}
|
1261
|
+
disconnectedCallback() {
|
1262
|
+
super.disconnectedCallback();
|
1263
|
+
}
|
1264
|
+
_sendChangeEvent() {
|
1265
|
+
this.dispatchEvent(
|
1266
|
+
new CustomEvent("slot-contents-changed", {
|
1267
|
+
bubbles: !0,
|
1268
|
+
composed: !0,
|
1269
|
+
cancelable: !0,
|
1270
|
+
detail: {
|
1271
|
+
slotContents: [...this._slotContents]
|
1272
|
+
}
|
1273
|
+
})
|
1274
|
+
);
|
1275
|
+
}
|
1276
|
+
_sendCloseEvent() {
|
1277
|
+
this.dispatchEvent(
|
1278
|
+
new CustomEvent("close", {
|
1279
|
+
bubbles: !0,
|
1280
|
+
composed: !0,
|
1281
|
+
cancelable: !0
|
1282
|
+
})
|
1283
|
+
);
|
1284
|
+
}
|
1285
|
+
willUpdate(t) {
|
1286
|
+
var e;
|
1287
|
+
t.has("slotContents") && (this._slotContents = structuredClone(this.slotContents), this._slotListData = structuredClone(this.slotContents), this._currentSlotContent = ((e = this._slotContents) == null ? void 0 : e[this._activeIndex ?? 0]) ?? {});
|
1288
|
+
}
|
1289
|
+
updated(t) {
|
1290
|
+
this.updateContentLabel();
|
1291
|
+
}
|
1292
|
+
_handleSlotListChange(t) {
|
1293
|
+
var l;
|
1294
|
+
this._slotContents = structuredClone(t.detail.slotContents);
|
1295
|
+
const e = t.detail.activeIndex;
|
1296
|
+
e !== this._activeIndex && (this._activeIndex = e), this._currentSlotContent = ((l = this._slotContents) == null ? void 0 : l[this._activeIndex ?? 0]) ?? {}, this.displaySettingsElement.slotContent = this._currentSlotContent, this._slotContents.length <= 1 && this.requestUpdate(), this._sendChangeEvent();
|
1297
|
+
}
|
1298
|
+
_handleSlotContentChange(t) {
|
1299
|
+
this._slotContents[this._activeIndex] = structuredClone(
|
1300
|
+
t.detail.slotContent
|
1301
|
+
), this._slotListData = structuredClone(this._slotContents), this.slotMenuListElement && (this.slotMenuListElement.slotContents = this._slotListData), this.updateContentLabel(), this._sendChangeEvent();
|
1302
|
+
}
|
1303
|
+
// we set & update the label manually to not lose focus when typing in the display settings bc of rerender
|
1304
|
+
updateContentLabel() {
|
1305
|
+
if (this.slotContentLabelElement) {
|
1306
|
+
const t = K(
|
1307
|
+
this._slotContents[this._activeIndex].label,
|
1308
|
+
this.contentLanguage
|
1309
|
+
);
|
1310
|
+
this.slotContentLabelElement.textContent = t;
|
1311
|
+
}
|
1312
|
+
}
|
1313
|
+
removeSlotContent(t) {
|
1314
|
+
this._slotContents = this._slotContents.filter(
|
1315
|
+
(e, l) => l !== t
|
1316
|
+
), this._currentSlotContent = {}, this._sendChangeEvent(), this._sendCloseEvent(), this.requestUpdate();
|
1317
|
+
}
|
1318
|
+
close() {
|
1319
|
+
this._sendCloseEvent();
|
1320
|
+
}
|
1321
|
+
_removeActiveSlotContent() {
|
1322
|
+
this.removeSlotContent(this._activeIndex);
|
1323
|
+
}
|
1324
|
+
render() {
|
1325
|
+
return s`<div class="slot-menu-top-menu">
|
1326
|
+
${this.variant === "draggable" ? s`<div class="drag-handle">${C(xt)}</div>` : ""}
|
1327
|
+
${this._slotContents.length === 1 && this.variant !== "popup" ? s` <div class="slot-content-action">
|
1328
|
+
<div class="slot-content-label"></div>
|
1329
|
+
<div
|
1330
|
+
class="slot-content-remove"
|
1331
|
+
@click=${this.removeSlotContent.bind(this, 0)}
|
1332
|
+
>
|
1333
|
+
${C(H)}
|
1334
|
+
</div>
|
1335
|
+
</div>` : ""}
|
1336
|
+
</div>
|
1337
|
+
<div
|
1338
|
+
class="slot-contents-container ${this._slotContents.length > 1 ? "multiple" : ""}"
|
1339
|
+
>
|
1340
|
+
${this.variant === "popup" ? "" : s`<div class="close" @click=${this.close}>
|
1341
|
+
${C(yt)}
|
1342
|
+
</div>`}
|
1343
|
+
<div class="inner-container">
|
1344
|
+
${this._slotContents.length > 1 ? s`<luzmo-slot-menu-list
|
1345
|
+
.slotContents=${this._slotListData}
|
1346
|
+
.activeIndex=${this._activeIndex}
|
1347
|
+
@slot-list-changed=${this._handleSlotListChange}
|
1348
|
+
></luzmo-slot-menu-list>` : ""}
|
1349
|
+
<luzmo-display-settings
|
1350
|
+
.size=${this.size}
|
1351
|
+
.language=${this.language}
|
1352
|
+
.contentLanguage=${this.contentLanguage}
|
1353
|
+
.slotContent=${this._currentSlotContent}
|
1354
|
+
.slotType=${this.slotType}
|
1355
|
+
.showRemoveButton=${this.variant === "popup" && this._slotContents.length === 1}
|
1356
|
+
@slot-content-changed=${this._handleSlotContentChange}
|
1357
|
+
@remove-slot-content=${this._removeActiveSlotContent}
|
1358
|
+
></luzmo-display-settings>
|
1359
|
+
</div>
|
1360
|
+
</div>`;
|
1361
|
+
}
|
1362
|
+
}
|
1363
|
+
_([
|
1364
|
+
i({ type: String, reflect: !0 })
|
1365
|
+
], w.prototype, "language");
|
1366
|
+
_([
|
1367
|
+
i({ type: String, attribute: "content-language", reflect: !0 })
|
1368
|
+
], w.prototype, "contentLanguage");
|
1369
|
+
_([
|
1370
|
+
i({ type: String, attribute: "slot-type", reflect: !0 })
|
1371
|
+
], w.prototype, "slotType");
|
1372
|
+
_([
|
1373
|
+
i({ type: Boolean, attribute: "no-drag", reflect: !0 })
|
1374
|
+
], w.prototype, "noDrag");
|
1375
|
+
_([
|
1376
|
+
i({ type: Boolean, attribute: "no-close", reflect: !0 })
|
1377
|
+
], w.prototype, "noClose");
|
1378
|
+
_([
|
1379
|
+
i({ type: String, reflect: !0 })
|
1380
|
+
], w.prototype, "variant");
|
1381
|
+
_([
|
1382
|
+
i({ type: Boolean, attribute: "no-top-menu-label", reflect: !0 })
|
1383
|
+
], w.prototype, "noTopMenuLabel");
|
1384
|
+
_([
|
1385
|
+
i()
|
1386
|
+
], w.prototype, "slotContents");
|
1387
|
+
_([
|
1388
|
+
O(".slot-content-label")
|
1389
|
+
], w.prototype, "slotContentLabelElement");
|
1390
|
+
_([
|
1391
|
+
O("luzmo-display-settings")
|
1392
|
+
], w.prototype, "displaySettingsElement");
|
1393
|
+
_([
|
1394
|
+
O("luzmo-slot-menu-list")
|
1395
|
+
], w.prototype, "slotMenuListElement");
|
1396
|
+
customElements.get("luzmo-slot-menu") || customElements.define("luzmo-slot-menu", w);
|
1397
|
+
const ae = ":host{font-family:var(--luzmo-droppable-slot-font-family, var(--luzmo-font-family))}.droppable-slot[filled]{cursor:pointer;border:var(--luzmo-droppable-slot-filled-border-width, var(--droppable-slot-filled-border-width)) var(--luzmo-droppable-slot-filled-border-style, var(--droppable-slot-filled-border-style)) var(--luzmo-droppable-slot-filled-border-color, var(--droppable-slot-filled-border-color));background-color:var(--luzmo-droppable-slot-filled-background-color, var(--droppable-slot-filled-background-color));color:var(--luzmo-droppable-slot-filled-color, var(--droppable-slot-filled-color))}.droppable-slot{color:var(--luzmo-droppable-slot-font-color, var(--droppable-slot-font-color));border:var(--luzmo-droppable-slot-border-width, var(--droppable-slot-border-width)) var(--luzmo-droppable-slot-border-style, var(--droppable-slot-border-style)) var(--luzmo-droppable-slot-border-color, var(--droppable-slot-border-color));background-color:var(--luzmo-droppable-slot-background-color, var(--droppable-slot-background-color));display:flex;justify-content:space-between;align-items:center;padding-left:var(--luzmo-droppable-slot-edge-to-label, var(--droppable-slot-edge-to-label));gap:var(--luzmo-spacing-5);border-radius:var(--luzmo-border-radius);height:var(--luzmo-droppable-slot-height, var(--droppable-slot-height));cursor:move}:host([disabled]) .droppable-slot{background-color:var(--luzmo-droppable-slot-background-color-disabled, var(--droppable-slot-background-color-disabled));color:var(--luzmo-droppable-slot-color-disabled, var(--droppable-slot-color-disabled));cursor:not-allowed}:host([disabled]) .drag-handle-icon{opacity:.25;font-size:12px}.drag-handle-icon{opacity:.5;font-size:12px}.droppable-slot-label{font-size:var(--luzmo-droppable-slot-label-font-size, var(--droppable-slot-label-font-size));flex-grow:1;margin-right:var(--luzmo-droppable-slot-text-to-controls, var(--droppable-slot-text-to-controls));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.controls{height:100%;display:flex;align-items:center;gap:var(--luzmo-droppable-slot-controls-gap, var(--droppable-slot-controls-gap));background-color:var(--luzmo-droppable-slot-controls-background-color, var(--droppable-slot-controls-background-color));color:var(--luzmo-droppable-slot-controls-color, var(--droppable-slot-controls-color));margin-right:var(--luzmo-droppable-slot-controls-to-edge, var(--droppable-slot-controls-to-edge));padding:0 var(--luzmo-droppable-slot-controls-horizontal-padding, var(--droppable-slot-controls-horizontal-padding))}.controls div{cursor:pointer;height:100%;display:flex;align-items:center;padding:0 var(--luzmo-droppable-slot-controls-control-horizontal-padding, var(--droppable-slot-controls-control-horizontal-padding))}luzmo-slot-menu[placement=bottom],luzmo-slot-menu[placement=top],luzmo-slot-menu[placement=bottom-start],luzmo-slot-menu[placement=top-start],luzmo-slot-menu[placement=bottom-end],luzmo-slot-menu[placement=top-end]{margin:var(--luzmo-droppable-slot-overlay-vertical-gap, var(--droppable-slot-overlay-vertical-gap)) 0}luzmo-slot-menu[placement=left],luzmo-slot-menu[placement=right],luzmo-slot-menu[placement=left-start],luzmo-slot-menu[placement=right-start],luzmo-slot-menu[placement=left-end],luzmo-slot-menu[placement=right-end]{margin:0 var(--luzmo-droppable-slot-overlay-horizontal-gap, var(--droppable-slot-overlay-horizontal-gap))}:host{--droppable-slot-border-width: var(--luzmo-border-width);--droppable-slot-border-style: dashed;--droppable-slot-border-color: var(--luzmo-border-color);--droppable-slot-background-color: transparent;--droppable-slot-font-color: var(--luzmo-font-color);--droppable-slot-controls-background-color: var(--luzmo-primary-down);--droppable-slot-controls-color: var(--luzmo-primary-inverse-color);--droppable-slot-text-to-controls: var(--luzmo-spacing-3);--droppable-slot-controls-to-edge: 0;--droppable-slot-controls-gap: var(--luzmo-spacing-2);--droppable-slot-controls-horizontal-padding: var(--luzmo-spacing-2);--droppable-slot-controls-control-horizontal-padding: var(--luzmo-spacing-3);--droppable-slot-filled-background-color: var(--luzmo-primary);--droppable-slot-filled-color: var(--luzmo-primary-inverse-color);--droppable-slot-filled-border-width: var(--luzmo-border-width);--droppable-slot-filled-border-style: solid;--droppable-slot-filled-border-color: var(--luzmo-primary-down);--droppable-slot-height: var(--luzmo-component-height);--droppable-slot-label-font-size: var(--luzmo-font-size);--droppable-slot-icon-type-font-size: var(--luzmo-font-size);--droppable-slot-edge-to-label: var(--luzmo-spacing-5);--droppable-slot-color-disabled: var(--luzmo-color-disabled);--droppable-slot-background-color-disabled: var( --luzmo-background-color-disabled )}:host([accept-drag]){--droppable-slot-filled-background-color: var(--luzmo-color-positive);--droppable-slot-filled-color: white;--droppable-slot-filled-border-color: var(--luzmo-color-positive-down);--droppable-slot-controls-background-color: var(--luzmo-color-positive-down);--droppable-slot-controls-color: white;--droppable-slot-background-color: var(--luzmo-color-positive);--droppable-slot-font-color: white}:host{--droppable-slot-height: var(--luzmo-component-height);--droppable-slot-label-font-size: var(--luzmo-font-size);--droppable-slot-icon-type-font-size: var(--luzmo-font-size);--droppable-slot-horizontal-padding: var(--luzmo-spacing-4);--droppable-slot-overlay-horizontal-gap: var(--luzmo-spacing-4);--droppable-slot-overlay-vertical-gap: var(--luzmo-spacing-4)}:host([size=s]){--droppable-slot-height: var(--luzmo-component-height-s);--droppable-slot-label-font-size: var(--luzmo-font-size-s);--droppable-slot-icon-type-font-size: var(--luzmo-font-size-s);--droppable-slot-horizontal-padding: var(--luzmo-spacing-4);--droppable-slot-overlay-horizontal-gap: var(--luzmo-spacing-4);--droppable-slot-overlay-vertical-gap: var(--luzmo-spacing-4)}:host([size=l]){--droppable-slot-height: var(--luzmo-component-height-l);--droppable-slot-label-font-size: var(--luzmo-font-size-l);--droppable-slot-icon-type-font-size: var(--luzmo-font-size-l);--droppable-slot-horizontal-padding: var(--luzmo-spacing-5);--droppable-slot-overlay-horizontal-gap: var(--luzmo-spacing-5);--droppable-slot-overlay-vertical-gap: var(--luzmo-spacing-5)}:host([size=xl]){--droppable-slot-height: var(--luzmo-component-height-xl);--droppable-slot-label-font-size: var(--luzmo-font-size-xl);--droppable-slot-icon-type-font-size: var(--luzmo-font-size-xl);--droppable-slot-horizontal-padding: var(--luzmo-spacing-5);--droppable-slot-overlay-horizontal-gap: var(--luzmo-spacing-5);--droppable-slot-overlay-vertical-gap: var(--luzmo-spacing-5)}:host{box-sizing:border-box}";
|
1398
|
+
var re = Object.defineProperty, $ = (n, t, e, l) => {
|
1399
|
+
for (var o = void 0, a = n.length - 1, r; a >= 0; a--)
|
1400
|
+
(r = n[a]) && (o = r(t, e, o) || o);
|
1401
|
+
return o && re(t, e, o), o;
|
1402
|
+
};
|
1403
|
+
const Q = class Q extends E(L, {
|
1404
|
+
validSizes: ["s", "m", "l", "xl"],
|
1405
|
+
noDefaultSize: !0
|
1406
|
+
}) {
|
1407
|
+
constructor() {
|
1408
|
+
super(...arguments), this._loadSlotsConfig = new st(this, {
|
1409
|
+
task: async ([t]) => {
|
1410
|
+
if (t && t !== this._itemTypeLoaded) {
|
1411
|
+
const e = /* @__PURE__ */ Object.assign({
|
1412
|
+
"./item-slots-configs/area-chart-slots.config.ts": () => import("./area-chart-slots.config-C0c2ZzBh.js"),
|
1413
|
+
"./item-slots-configs/bar-chart-slots.config.ts": () => import("./bar-chart-slots.config-GSSL7XVA.js"),
|
1414
|
+
"./item-slots-configs/donut-chart-slots.config.ts": () => import("./donut-chart-slots.config-BEwhfq27.js")
|
1415
|
+
});
|
1416
|
+
if (e[`./item-slots-configs/${t}-slots.config.ts`]) {
|
1417
|
+
const l = await e[`./item-slots-configs/${t}-slots.config.ts`]();
|
1418
|
+
this._slotsConfig = (l == null ? void 0 : l.default) ?? {};
|
1419
|
+
}
|
1420
|
+
return this._slotsConfig;
|
1421
|
+
}
|
1422
|
+
},
|
1423
|
+
args: () => [this.itemType, this.language]
|
1424
|
+
}), this.slotConfiguration = {}, this.slotContents = [], this.language = "en", this.menu = "default", this.placement = "bottom-end", this.changedSlotContents = (t) => {
|
1425
|
+
this.dispatchEvent(
|
1426
|
+
new CustomEvent("slot-contents-changed", {
|
1427
|
+
bubbles: !0,
|
1428
|
+
composed: !0,
|
1429
|
+
cancelable: !0,
|
1430
|
+
detail: {
|
1431
|
+
slotContents: t
|
1432
|
+
}
|
1433
|
+
})
|
1434
|
+
);
|
1435
|
+
}, this._currentSlotContents = [];
|
1436
|
+
}
|
1437
|
+
disconnectedCallback() {
|
1438
|
+
super.disconnectedCallback(), this._cleanupDroppable();
|
1439
|
+
}
|
1440
|
+
emptySlotContents(t) {
|
1441
|
+
t.preventDefault(), t.stopPropagation(), this.slotContents = [], this.changedSlotContents([]);
|
1442
|
+
}
|
1443
|
+
willUpdate(t) {
|
1444
|
+
t.has("slotContents") && (this._currentSlotContents = structuredClone(this.slotContents));
|
1445
|
+
}
|
1446
|
+
firstUpdated(t) {
|
1447
|
+
this._cleanupDroppable || (this._cleanupDroppable = lt({
|
1448
|
+
element: this,
|
1449
|
+
onDrop: (e) => {
|
1450
|
+
var r, d, c, u;
|
1451
|
+
const l = { ...(r = e.source) == null ? void 0 : r.data }, o = {
|
1452
|
+
...(l == null ? void 0 : l.label) ?? { en: "Untitled" }
|
1453
|
+
}, a = l == null ? void 0 : l.type;
|
1454
|
+
if (a === "datetime" && !l.level && (l.level = l.lowestLevel ?? (l.subtype === "date" ? 5 : 9)), a === "datetime" && ((c = (d = e == null ? void 0 : e.source) == null ? void 0 : d.element) != null && c.hasAttribute("sublevel"))) {
|
1455
|
+
const v = [
|
1456
|
+
"(Yr)",
|
1457
|
+
"(Qtr)",
|
1458
|
+
"(Mth)",
|
1459
|
+
"(Wk)",
|
1460
|
+
"(Date)",
|
1461
|
+
"(Hr)",
|
1462
|
+
"(Min)",
|
1463
|
+
"(Sec)",
|
1464
|
+
"(Msec)"
|
1465
|
+
], m = (l == null ? void 0 : l.level) ?? 1, k = Object.keys(o);
|
1466
|
+
for (const q of k)
|
1467
|
+
o[q] = `${o[q]} ${v[m - 1]}`;
|
1468
|
+
l.label = o;
|
1469
|
+
}
|
1470
|
+
this.slotContents = (u = this.slotConfiguration) != null && u.canAcceptMultipleColumns ? [...this.slotContents ?? [], l] : [l], this.removeAttribute("accept-drag"), this.changedSlotContents(this.slotContents);
|
1471
|
+
},
|
1472
|
+
canDrop: ({ source: e }) => {
|
1473
|
+
var o, a, r, d, c, u, v, m, k;
|
1474
|
+
if (![
|
1475
|
+
"LUZMO-DRAGGABLE-DATA-ITEM-LEVEL",
|
1476
|
+
"LUZMO-DRAGGABLE-DATA-ITEM"
|
1477
|
+
].includes((o = e.element) == null ? void 0 : o.tagName))
|
1478
|
+
return !1;
|
1479
|
+
const l = ((r = (a = this.slotConfiguration) == null ? void 0 : a.acceptableColumnTypes) == null ? void 0 : r.length) > 0 ? this.slotConfiguration.acceptableColumnTypes : ["numeric", "hierarchy", "datetime"];
|
1480
|
+
return (d = e == null ? void 0 : e.data) != null && d.type && !l.includes((c = e == null ? void 0 : e.data) == null ? void 0 : c.type) ? !1 : !((u = e == null ? void 0 : e.data) != null && u.subtype && ((m = (v = this.slotConfiguration) == null ? void 0 : v.acceptableColumnSubtypes) == null ? void 0 : m.length) > 0 && !this.slotConfiguration.acceptableColumnSubtypes.includes(
|
1481
|
+
(k = e == null ? void 0 : e.data) == null ? void 0 : k.subtype
|
1482
|
+
));
|
1483
|
+
},
|
1484
|
+
getDropEffect: () => "link",
|
1485
|
+
onDragEnter: (e) => {
|
1486
|
+
this.setAttribute("accept-drag", "");
|
1487
|
+
},
|
1488
|
+
onDragLeave: (e) => {
|
1489
|
+
this.removeAttribute("accept-drag");
|
1490
|
+
}
|
1491
|
+
}));
|
1492
|
+
}
|
1493
|
+
updated(t) {
|
1494
|
+
this.createFullLabel();
|
1495
|
+
}
|
1496
|
+
_onSlotMenuChanges(t) {
|
1497
|
+
var e;
|
1498
|
+
t.preventDefault(), t.stopPropagation(), this.slotContents.length === ((e = t.detail.slotContents) == null ? void 0 : e.length) ? (this._currentSlotContents = t.detail.slotContents, this.createFullLabel(), this.changedSlotContents(this._currentSlotContents)) : (this.slotContents = t.detail.slotContents, this.changedSlotContents(this.slotContents));
|
1499
|
+
}
|
1500
|
+
// we update the label outside the lit render method to not lose focus when typing in the display settings bc of rerender
|
1501
|
+
// we use a copy of slotContents '_currentSlotContents' to not trigger a rerender when the slotContents change from the slot-menu
|
1502
|
+
createFullLabel() {
|
1503
|
+
var l, o, a, r, d, c, u;
|
1504
|
+
let t = "";
|
1505
|
+
((l = this._currentSlotContents) == null ? void 0 : l.length) === 1 ? t = K((a = (o = this._currentSlotContents) == null ? void 0 : o[0]) == null ? void 0 : a.label, this.language) ?? "Untitled" : ((r = this._currentSlotContents) == null ? void 0 : r.length) > 1 && (t = `${this._currentSlotContents.length} items`);
|
1506
|
+
let e = "";
|
1507
|
+
this.label ? e = this.label : (d = this.slotConfiguration) != null && d.label && (e = this.slotConfiguration.label), e = e || "Untitled", ((c = this._currentSlotContents) == null ? void 0 : c.length) > 0 && (e += ((u = this._currentSlotContents) == null ? void 0 : u.length) > 1 ? `: ${this._currentSlotContents.length} items` : `: ${t}`), this._droppableSlotLabelElement && (this._droppableSlotLabelElement.textContent = e);
|
1508
|
+
}
|
1509
|
+
droppableSlotMarkup() {
|
1510
|
+
var t, e, l, o;
|
1511
|
+
return s`
|
1512
|
+
<div
|
1513
|
+
class="droppable-slot"
|
1514
|
+
?filled=${((t = this.slotContents) == null ? void 0 : t.length) > 0}
|
1515
|
+
id="trigger"
|
1516
|
+
>
|
1517
|
+
<div class="droppable-slot-label"></div>
|
1518
|
+
${((e = this.slotContents) == null ? void 0 : e.length) > 0 && !(this.hideConfiguration && this.hideDelete) ? s`<div class="controls">
|
1519
|
+
${this.hideConfiguration ? "" : s`<div>
|
1520
|
+
${C(wt)}
|
1521
|
+
<luzmo-tooltip
|
1522
|
+
self-managed
|
1523
|
+
placement="top"
|
1524
|
+
size=${this.size}
|
1525
|
+
>
|
1526
|
+
edit
|
1527
|
+
</luzmo-tooltip>
|
1528
|
+
</div> `}
|
1529
|
+
${this.hideDelete ? "" : s`<div @click=${this.emptySlotContents}>
|
1530
|
+
${C(H)}
|
1531
|
+
<luzmo-tooltip
|
1532
|
+
self-managed
|
1533
|
+
placement="top"
|
1534
|
+
size=${this.size}
|
1535
|
+
>
|
1536
|
+
Delete
|
1537
|
+
</luzmo-tooltip>
|
1538
|
+
</div>`}
|
1539
|
+
</div>` : ""}
|
1540
|
+
${((l = this.slotContents) == null ? void 0 : l.length) > 0 ? s`<luzmo-overlay
|
1541
|
+
trigger="trigger@click"
|
1542
|
+
.placement=${this.placement}
|
1543
|
+
>
|
1544
|
+
<luzmo-slot-menu
|
1545
|
+
language=${this.language}
|
1546
|
+
content-language=${this.language}
|
1547
|
+
slot-type=${(o = this.slotConfiguration) == null ? void 0 : o.type}
|
1548
|
+
.slotContents=${this._currentSlotContents}
|
1549
|
+
variant="popup"
|
1550
|
+
.size=${this.size}
|
1551
|
+
@slot-contents-changed=${this._onSlotMenuChanges}
|
1552
|
+
></luzmo-slot-menu>
|
1553
|
+
</luzmo-overlay>` : ""}
|
1554
|
+
</div>
|
1555
|
+
`;
|
1556
|
+
}
|
1557
|
+
render() {
|
1558
|
+
return this._loadSlotsConfig.render({
|
1559
|
+
pending: () => s`<p>Loading...</p>`,
|
1560
|
+
complete: (t) => {
|
1561
|
+
if (this.slotName && this.itemType && t) {
|
1562
|
+
const e = t.find(
|
1563
|
+
(l) => l.name === this.slotName
|
1564
|
+
);
|
1565
|
+
e && (this.slotConfiguration = e);
|
1566
|
+
}
|
1567
|
+
return this.droppableSlotMarkup();
|
1568
|
+
},
|
1569
|
+
error: (t) => s`
|
1570
|
+
<div>
|
1571
|
+
Could not load droppable slot: '${this.slotName}' of chart
|
1572
|
+
'${this.itemType}': ${t}.
|
1573
|
+
</div>
|
1574
|
+
`
|
1575
|
+
});
|
1576
|
+
}
|
1577
|
+
};
|
1578
|
+
Q.styles = S(ae);
|
1579
|
+
let z = Q;
|
1580
|
+
$([
|
1581
|
+
i({ type: String, reflect: !0, attribute: "item-type" })
|
1582
|
+
], z.prototype, "itemType");
|
1583
|
+
$([
|
1584
|
+
i({ type: String, reflect: !0, attribute: "slot-name" })
|
1585
|
+
], z.prototype, "slotName");
|
1586
|
+
$([
|
1587
|
+
i({ type: Object })
|
1588
|
+
], z.prototype, "slotConfiguration");
|
1589
|
+
$([
|
1590
|
+
i({ type: Object })
|
1591
|
+
], z.prototype, "slotContents");
|
1592
|
+
$([
|
1593
|
+
i({ type: String, reflect: !0 })
|
1594
|
+
], z.prototype, "label");
|
1595
|
+
$([
|
1596
|
+
i({ type: String, reflect: !0 })
|
1597
|
+
], z.prototype, "language");
|
1598
|
+
$([
|
1599
|
+
i({ type: String, reflect: !0 })
|
1600
|
+
], z.prototype, "menu");
|
1601
|
+
$([
|
1602
|
+
i({ type: String, reflect: !0 })
|
1603
|
+
], z.prototype, "placement");
|
1604
|
+
$([
|
1605
|
+
i({ type: Boolean, reflect: !0, attribute: "hide-delete" })
|
1606
|
+
], z.prototype, "hideDelete");
|
1607
|
+
$([
|
1608
|
+
i({ type: Boolean, reflect: !0, attribute: "hide-configuration" })
|
1609
|
+
], z.prototype, "hideConfiguration");
|
1610
|
+
$([
|
1611
|
+
O(".droppable-slot-label")
|
1612
|
+
], z.prototype, "_droppableSlotLabelElement");
|
1613
|
+
customElements.get("luzmo-droppable-slot") || customElements.define("luzmo-droppable-slot", z);
|
1614
|
+
export {
|
1615
|
+
M as D,
|
1616
|
+
D as F,
|
1617
|
+
Z as H,
|
1618
|
+
h as L,
|
1619
|
+
nt as M,
|
1620
|
+
at as a,
|
1621
|
+
x as b,
|
1622
|
+
z as c,
|
1623
|
+
g as d,
|
1624
|
+
w as e,
|
1625
|
+
B as f,
|
1626
|
+
st as h
|
1627
|
+
};
|