@luzmo/analytics-components-kit 1.0.1-alpha.3 → 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 +6367 -302
- 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 +16 -12
- package/lib/37.js +0 -1
- package/lib/729.js +0 -1
- package/lib/common-31743c5a.js +0 -13
- package/lib/common-b02547a0.js +0 -1
- package/lib/common-b49d9a9d.js +0 -1
- package/lib/common-b5232813.js +0 -56
- package/lib/common-cefd4f4c.js +0 -1
- package/lib/common-d6cb565f.js +0 -1
- package/lib/common-fd868059.js +0 -1
- package/lib/common-fedaf338.js +0 -32
- package/lib/edit-option-picker/index.js +0 -314
- package/lib/edit-option-slider/index.js +0 -102
- package/lib/edit-option-toggle/index.js +0 -114
- package/lib/vendors-93cc3efa.js +0 -1
- package/lib/vendors-bb3d84b5.js +0 -1
@@ -0,0 +1,442 @@
|
|
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 { d as v } from "./decompose-numeric-format-BuZcjH2k.js";
|
21
|
+
import { S as b, a as F, L as A, r as L, x as n, n as p, e as m } from "./if-defined-BbzmSG-O.js";
|
22
|
+
import "./index-Bd4cKS9O.js";
|
23
|
+
import "./index-DSbgZduE.js";
|
24
|
+
import "./index-CtEJZdT0.js";
|
25
|
+
import "./index-D37RwuEH.js";
|
26
|
+
import "./index-CBCm4_7S.js";
|
27
|
+
import "./index-D_KYpfBM.js";
|
28
|
+
import { O as $, T as S } from "./index-DdtjeKYI.js";
|
29
|
+
import { r as D } from "./directive-helpers-eY1rHtyn.js";
|
30
|
+
import { r as C } from "./index-B9h2L_hV.js";
|
31
|
+
const E = ":host .settings-container{display:flex;flex-direction:column;gap:var(--luzmo-spacing-2)}:host .settings-row{display:flex;justify-content:flex-start;align-items:center;gap:var(--luzmo-display-settings-numeric-gap, var(--display-settings-numeric-gap))}.duration-angle-down-icon{margin-inline-start:var(--luzmo-numeric-duration-levels-dropdown-icon-margin-inline-start, var(--numeric-duration-levels-dropdown-icon-margin-inline-start))}:host{--display-settings-numeric-gap: var(--luzmo-spacing-3);--numeric-duration-levels-dropdown-icon-margin-inline-start: var( --luzmo-spacing-2 )}:host([size=s]){--display-settings-numeric-gap: var(--luzmo-spacing-3);--numeric-duration-levels-dropdown-icon-margin-inline-start: var( --luzmo-spacing-1 )}:host([size=l]){--display-settings-numeric-gap: var(--luzmo-spacing-4);--numeric-duration-levels-dropdown-icon-margin-inline-start: var( --luzmo-spacing-3 )}:host([size=xl]){--display-settings-numeric-gap: var(--luzmo-spacing-5);--numeric-duration-levels-dropdown-icon-margin-inline-start: var( --luzmo-spacing-4 )}", N = {
|
32
|
+
sum: "Sum",
|
33
|
+
cumulativesum: "Cumulative sum",
|
34
|
+
average: "Average",
|
35
|
+
weightedaverage: "Weighted average",
|
36
|
+
median: "Median",
|
37
|
+
count: "Count",
|
38
|
+
distinctcount: "Distinct count",
|
39
|
+
min: "Minimum",
|
40
|
+
max: "Maximum",
|
41
|
+
stddev: "Standard deviation",
|
42
|
+
rate: "Rate"
|
43
|
+
}, f = {
|
44
|
+
general: "123",
|
45
|
+
percentage: "%",
|
46
|
+
scientific: "SI"
|
47
|
+
}, y = {
|
48
|
+
time: "Time",
|
49
|
+
short: "Short",
|
50
|
+
long: "Long"
|
51
|
+
}, z = {
|
52
|
+
Auto: { auto: !0 },
|
53
|
+
"1,000.00": {
|
54
|
+
auto: !1,
|
55
|
+
thousandSeparator: ",",
|
56
|
+
decimalSeparator: "."
|
57
|
+
},
|
58
|
+
"1.000,00": {
|
59
|
+
auto: !1,
|
60
|
+
thousandSeparator: ".",
|
61
|
+
decimalSeparator: ","
|
62
|
+
},
|
63
|
+
"1000.00": { auto: !1, decimalSeparator: "." },
|
64
|
+
"1000,00": { auto: !1, decimalSeparator: "," }
|
65
|
+
}, w = {
|
66
|
+
levels: [
|
67
|
+
{ level: 1, label: "years" },
|
68
|
+
{ level: 2, label: "quarters" },
|
69
|
+
{ level: 3, label: "months" },
|
70
|
+
{ level: 4, label: "weeks" },
|
71
|
+
{ level: 5, label: "days" },
|
72
|
+
{ level: 6, label: "hours" },
|
73
|
+
{ level: 7, label: "minutes" },
|
74
|
+
{ level: 8, label: "seconds" },
|
75
|
+
{ level: 9, label: "milliseconds" }
|
76
|
+
]
|
77
|
+
};
|
78
|
+
var M = Object.defineProperty, r = (g, t, e, i) => {
|
79
|
+
for (var a = void 0, s = g.length - 1, l; s >= 0; s--)
|
80
|
+
(l = g[s]) && (a = l(t, e, a) || a);
|
81
|
+
return a && M(t, e, a), a;
|
82
|
+
};
|
83
|
+
class o extends b(A, {
|
84
|
+
validSizes: Object.values(F)
|
85
|
+
}) {
|
86
|
+
constructor() {
|
87
|
+
super(...arguments), this.slotContent = {}, this.measureColumns = [], this._durationLevels = [], this._renderDurationLevelMenu = !1, this._sendEvent = () => {
|
88
|
+
const t = { ...this.slotContent };
|
89
|
+
t.format = this._format, t.aggregationFunc = this._aggregationFunc, this._aggregationWeightColumn ? t.aggregationWeight = { ...this._aggregationWeightColumn } : this._aggregationFunc === "rate" && (t.aggregationFunc = "average"), this._displayMode === "duration" ? (t.duration = t.duration ?? {}, t.duration.format = this._durationFormat, t.duration.levels = this._durationLevels) : delete t.duration, this.dispatchEvent(
|
90
|
+
new CustomEvent("slot-content-changed", {
|
91
|
+
bubbles: !0,
|
92
|
+
composed: !0,
|
93
|
+
cancelable: !0,
|
94
|
+
detail: {
|
95
|
+
slotContent: t
|
96
|
+
}
|
97
|
+
})
|
98
|
+
);
|
99
|
+
};
|
100
|
+
}
|
101
|
+
static get styles() {
|
102
|
+
return [L(E)];
|
103
|
+
}
|
104
|
+
_parseSavedNumericFormatSettings() {
|
105
|
+
var t, e, i, a, s, l, d, c, h, _;
|
106
|
+
if (this._displayMode = ((t = this.slotContent) == null ? void 0 : t.subtype) === "duration" ? ((a = (i = (e = this.slotContent) == null ? void 0 : e.duration) == null ? void 0 : i.levels) == null ? void 0 : a.length) === 1 ? "numeric" : "duration" : "numeric", this._durationFormat = ((l = (s = this.slotContent) == null ? void 0 : s.duration) == null ? void 0 : l.format) ?? "short", this._durationLevels = ((c = (d = this.slotContent) == null ? void 0 : d.duration) == null ? void 0 : c.levels) ?? [1], this._displayMode === "duration")
|
107
|
+
this._precision = 2, this._commaDecimals = !1, this._thousandSeparator = !1;
|
108
|
+
else {
|
109
|
+
this._format = ((h = this.slotContent) == null ? void 0 : h.format) ?? ".0f";
|
110
|
+
const u = v(this._format ?? ".0f");
|
111
|
+
this._isAuto = ((_ = u.typeFormat) == null ? void 0 : _.includes("a")) ?? !1, ["%", "a%", "y", "ay"].includes(u.typeFormat) ? this._displayAs = "percentage" : ["s", "as", "w", "aw"].includes(u.typeFormat) ? this._displayAs = "scientific" : this._displayAs = "general", this._precision = u.precision ? Number.parseInt(u.precision.replace(".", ""), 10) : this._displayAs === "scientific" ? 1 : 0, this._commaDecimals = ["z", "az", "y", "ay", "w", "aw"].includes(
|
112
|
+
u.typeFormat
|
113
|
+
), this._thousandSeparator = u.comma === ",", this._isAuto ? this._numericFormatGroup = "Auto" : this._commaDecimals && this._thousandSeparator ? this._numericFormatGroup = "1.000,00" : !this._commaDecimals && this._thousandSeparator ? this._numericFormatGroup = "1,000.00" : this._commaDecimals && !this._thousandSeparator ? this._numericFormatGroup = "1000,00" : !this._commaDecimals && !this._thousandSeparator && (this._numericFormatGroup = "1000.00");
|
114
|
+
}
|
115
|
+
}
|
116
|
+
_setNumericDisplayAs() {
|
117
|
+
var t, e;
|
118
|
+
this._displayAs = ((e = (t = this._displayAsElement) == null ? void 0 : t.selected) == null ? void 0 : e[0]) ?? "general", this._displayAs === "scientific" && (this._precision = Math.max(this._precision ?? 0, 1), this._thousandSeparator = !1), this._setNumericFormat(), this._sendEvent(), this.requestUpdate();
|
119
|
+
}
|
120
|
+
_setNumericSeparators(t) {
|
121
|
+
const e = z[(t == null ? void 0 : t.detail) ?? "Auto"];
|
122
|
+
this._thousandSeparator = [",", "."].includes(
|
123
|
+
(e == null ? void 0 : e.thousandSeparator) ?? ""
|
124
|
+
), this._commaDecimals = (e == null ? void 0 : e.decimalSeparator) === ",", this._isAuto = e == null ? void 0 : e.auto, this._setNumericFormat(), this._sendEvent();
|
125
|
+
}
|
126
|
+
_setPrecision() {
|
127
|
+
this._precision = this._precisionElement.value, this._setNumericFormat(), this._sendEvent();
|
128
|
+
}
|
129
|
+
_setNumericFormat() {
|
130
|
+
var i;
|
131
|
+
let t = "f";
|
132
|
+
const e = this.slotContent.subtype === "duration" ? this._durationLevels && ((i = this._durationLevels) == null ? void 0 : i.length) === 1 ? "numeric" : "duration" : "numeric";
|
133
|
+
this._maxDurationLevel = Math.min(...this._durationLevels), e === "duration" ? (!["time", "short", "long"].includes(this._durationFormat ?? "") || this._maxDurationLevel < 6 && this._durationFormat === "time") && (this._durationFormat = "short") : (this._displayAs === "general" && this._commaDecimals ? t = "z" : this._displayAs === "percentage" && this._commaDecimals ? t = "y" : this._displayAs === "scientific" && this._commaDecimals ? t = "w" : this._displayAs === "percentage" ? t = "%" : this._displayAs === "scientific" && (t = "s"), this._format = (this._thousandSeparator || this._isAuto ? "," : "") + "." + this._precision + (this._isAuto ? "a" : "") + t);
|
134
|
+
}
|
135
|
+
_setAggregationFunc() {
|
136
|
+
const t = this._aggregationFunc, e = this.slotContent.format;
|
137
|
+
if (this._aggregationElement.value !== t) {
|
138
|
+
if (this._aggregationFunc = this._aggregationElement.value, t === "rate") {
|
139
|
+
const i = v(e), a = ["%", "y", "a%", "ay"].includes(
|
140
|
+
i.typeFormat
|
141
|
+
);
|
142
|
+
this.slotContent.subtype === "currency" && a && this._setNumericDisplayAs();
|
143
|
+
}
|
144
|
+
this._sendEvent(), (this._aggregationFunc === "rate" || t === "rate") && this.requestUpdate();
|
145
|
+
}
|
146
|
+
}
|
147
|
+
_setAggregationWeight() {
|
148
|
+
const t = this._aggregationWeightElement.value;
|
149
|
+
if (t === "none")
|
150
|
+
this._aggregationWeightColumn = void 0;
|
151
|
+
else {
|
152
|
+
const e = this.measureColumns.find(
|
153
|
+
(i) => i.columnId === t
|
154
|
+
);
|
155
|
+
this._aggregationWeightColumn = {
|
156
|
+
column: e == null ? void 0 : e.columnId,
|
157
|
+
set: e == null ? void 0 : e.datasetId,
|
158
|
+
columnSubType: e == null ? void 0 : e.subtype
|
159
|
+
};
|
160
|
+
}
|
161
|
+
this._sendEvent();
|
162
|
+
}
|
163
|
+
_setDurationLevels() {
|
164
|
+
const t = this._durationLevels, e = this._durationLevelsElement.value.split(",").filter((i) => i !== "").map((i) => Number.parseInt(i, 10));
|
165
|
+
this._durationLevels = ((e == null ? void 0 : e.length) ?? 0) >= 1 ? e : t, this._maxDurationLevel = Math.min(...this._durationLevels), this._fillTimeDurationLevels(), this._setNumericFormat(), this._sendEvent(), this.requestUpdate();
|
166
|
+
}
|
167
|
+
_setDurationFormat() {
|
168
|
+
var t, e;
|
169
|
+
this._durationFormat = (e = (t = this._durationFormatElement) == null ? void 0 : t.selected) == null ? void 0 : e[0], this._fillTimeDurationLevels(), this._setNumericFormat(), this._sendEvent(), this.requestUpdate();
|
170
|
+
}
|
171
|
+
_fillTimeDurationLevels() {
|
172
|
+
if (this._durationFormat === "time") {
|
173
|
+
const t = this._durationLevels.sort().at(-1);
|
174
|
+
if ([7, 8, 9].includes(t)) {
|
175
|
+
const e = {
|
176
|
+
lev7: [6],
|
177
|
+
lev8: [6, 7],
|
178
|
+
lev9: [6, 7, 8]
|
179
|
+
};
|
180
|
+
for (const i of e["lev" + t])
|
181
|
+
this._durationLevels.includes(i) || this._durationLevels.push(i);
|
182
|
+
this._durationLevels = [...this._durationLevels].sort();
|
183
|
+
}
|
184
|
+
}
|
185
|
+
}
|
186
|
+
// TODO set in upper level the same format for all measures remove this comment once implemented
|
187
|
+
/* private setMeasureNumericFormat(
|
188
|
+
slot: any,
|
189
|
+
changedContent: any,
|
190
|
+
changedFormatGroup: string
|
191
|
+
): void {
|
192
|
+
if (
|
193
|
+
slot.name === 'measure' &&
|
194
|
+
changedContent.type === 'numeric' &&
|
195
|
+
changedContent.subtype !== 'duration'
|
196
|
+
) {
|
197
|
+
slot.content.forEach((content: any) => {
|
198
|
+
if (
|
199
|
+
content.format !== changedContent.format &&
|
200
|
+
content.datasetId === changedContent.datasetId &&
|
201
|
+
((content.columnId && content.columnId === changedContent.columnId) ||
|
202
|
+
(content.formula && content.formula === changedContent.formula))
|
203
|
+
) {
|
204
|
+
let contentNumericFormatGroup = 'general';
|
205
|
+
const contentDecomp = decomposeNumericFormat(content.format);
|
206
|
+
|
207
|
+
if (['%', 'a%', 'y', 'ay'].includes(contentDecomp.typeFormat)) {
|
208
|
+
contentNumericFormatGroup = 'percentage';
|
209
|
+
} else if (
|
210
|
+
['s', 'as', 'w', 'aw'].includes(contentDecomp.typeFormat)
|
211
|
+
) {
|
212
|
+
contentNumericFormatGroup = 'scientific';
|
213
|
+
}
|
214
|
+
|
215
|
+
if (contentNumericFormatGroup === changedFormatGroup) {
|
216
|
+
content.format = changedContent.format;
|
217
|
+
}
|
218
|
+
}
|
219
|
+
});
|
220
|
+
}
|
221
|
+
} */
|
222
|
+
willUpdate(t) {
|
223
|
+
var e, i, a;
|
224
|
+
t.has("slotContent") && (this._parseSavedNumericFormatSettings(), this._aggregationFunc = ((e = this.slotContent) == null ? void 0 : e.aggregationFunc) ?? ((i = this.slotContent) == null ? void 0 : i.type) === "numeric" ? "sum" : "count", this._aggregationWeightColumn = (a = this.slotContent) == null ? void 0 : a.aggregationWeight);
|
225
|
+
}
|
226
|
+
firstUpdated(t) {
|
227
|
+
var e;
|
228
|
+
(e = this.slotContent) != null && e.duration && this._durationLevelsOverlay.addEventListener(
|
229
|
+
"slottable-request",
|
230
|
+
(i) => {
|
231
|
+
this._renderDurationLevelMenu = i.data !== C;
|
232
|
+
}
|
233
|
+
);
|
234
|
+
}
|
235
|
+
_renderDurationLevelsSettings() {
|
236
|
+
const t = w.levels.map((e) => {
|
237
|
+
let i = !1;
|
238
|
+
return this._durationFormat === "time" && e.level >= 6 && this._durationLevels.includes(e.level) && e.level !== Math.max(...this._durationLevels) && (i = !0), this._durationLevels.length === 1 && this._durationLevels.includes(e.level) && (i = !0), n`<luzmo-menu-item
|
239
|
+
value=${e.level}
|
240
|
+
?selected=${this._durationLevels.includes(e.level)}
|
241
|
+
?disabled=${i}
|
242
|
+
>
|
243
|
+
${e.label}
|
244
|
+
</luzmo-menu-item>`;
|
245
|
+
});
|
246
|
+
return n` <div class="setting">
|
247
|
+
<luzmo-field-label for="duration-levels">
|
248
|
+
Duration levels
|
249
|
+
</luzmo-field-label>
|
250
|
+
<luzmo-action-button id="trigger" size=${this.size}>
|
251
|
+
${this._durationLevels.length}
|
252
|
+
${this._durationLevels.length === 1 ? "level" : "levels"} active
|
253
|
+
<span class="duration-angle-down-icon">
|
254
|
+
${$(S)}
|
255
|
+
</span>
|
256
|
+
</luzmo-action-button>
|
257
|
+
<luzmo-overlay
|
258
|
+
id="duration-levels-overlay"
|
259
|
+
trigger="trigger@click"
|
260
|
+
type="auto"
|
261
|
+
placement="bottom-start"
|
262
|
+
type="page"
|
263
|
+
>
|
264
|
+
<luzmo-popover style="position: relative">
|
265
|
+
${this._renderDurationLevelMenu ? n` <luzmo-menu
|
266
|
+
id="duration-levels"
|
267
|
+
size=${this.size}
|
268
|
+
selects="multiple"
|
269
|
+
.value=${this._durationLevels.join(",")}
|
270
|
+
@change=${this._setDurationLevels}
|
271
|
+
>
|
272
|
+
${t}
|
273
|
+
</luzmo-menu>` : ""}
|
274
|
+
</luzmo-popover>
|
275
|
+
</luzmo-overlay>
|
276
|
+
</div>`;
|
277
|
+
}
|
278
|
+
_renderDurationFormatSettings() {
|
279
|
+
const t = Object.keys(y).map((e) => e === "time" && (this._maxDurationLevel ?? 1) < 6 ? "" : n`<luzmo-action-button value=${e}>
|
280
|
+
${y[e]}
|
281
|
+
</luzmo-action-button>`);
|
282
|
+
return n` <div class="setting">
|
283
|
+
<luzmo-field-label for="duration-format">Format</luzmo-field-label>
|
284
|
+
<luzmo-action-group
|
285
|
+
emphasized
|
286
|
+
id="duration-format"
|
287
|
+
size=${this.size}
|
288
|
+
compact=""
|
289
|
+
.selected=${[this._durationFormat ?? "short"]}
|
290
|
+
selects="single"
|
291
|
+
@change=${this._setDurationFormat}
|
292
|
+
>
|
293
|
+
${t}
|
294
|
+
</luzmo-action-group>
|
295
|
+
</div>`;
|
296
|
+
}
|
297
|
+
_renderNumericDisplayAsSettings() {
|
298
|
+
const t = Object.keys(f).map(
|
299
|
+
(e) => n`<luzmo-action-button value=${e}
|
300
|
+
>${f[e]}</luzmo-action-button
|
301
|
+
>`
|
302
|
+
);
|
303
|
+
return n`<div class="setting">
|
304
|
+
<luzmo-field-label for="display-as">Display as</luzmo-field-label>
|
305
|
+
<luzmo-action-group
|
306
|
+
emphasized
|
307
|
+
id="display-as"
|
308
|
+
size=${this.size}
|
309
|
+
compact=""
|
310
|
+
.selected=${[this._displayAs]}
|
311
|
+
selects="single"
|
312
|
+
@change=${this._setNumericDisplayAs}
|
313
|
+
>
|
314
|
+
${t}
|
315
|
+
</luzmo-action-group>
|
316
|
+
</div>`;
|
317
|
+
}
|
318
|
+
_renderNumericFormatSettings() {
|
319
|
+
const t = Object.keys(z).map(
|
320
|
+
(e) => n`<luzmo-menu-item value=${e}>${e}</luzmo-menu-item>`
|
321
|
+
);
|
322
|
+
return n` <div class="setting">
|
323
|
+
<luzmo-field-label for="format">Format</luzmo-field-label>
|
324
|
+
<luzmo-picker
|
325
|
+
id="format"
|
326
|
+
size=${this.size}
|
327
|
+
variant="highlight"
|
328
|
+
value=${this._numericFormatGroup ?? "Auto"}
|
329
|
+
@change=${this._setNumericSeparators}
|
330
|
+
>
|
331
|
+
${t}
|
332
|
+
</luzmo-picker>
|
333
|
+
</div>
|
334
|
+
<div class="setting">
|
335
|
+
<luzmo-field-label for="precision" id="precision-label"
|
336
|
+
>${this._displayAs === "scientific" ? "Precision" : "Decimals"}</luzmo-field-label
|
337
|
+
>
|
338
|
+
<luzmo-number-field
|
339
|
+
id="precision"
|
340
|
+
min=${this._displayAs === "scientific" ? 1 : 0}
|
341
|
+
max="22"
|
342
|
+
size=${this.size}
|
343
|
+
value=${this._precision ?? (this._displayAs === "scientific" ? 1 : 0)}
|
344
|
+
@change=${this._setPrecision}
|
345
|
+
></luzmo-number-field>
|
346
|
+
</div>`;
|
347
|
+
}
|
348
|
+
_renderAggregationSettings() {
|
349
|
+
var i, a;
|
350
|
+
const t = Object.entries(N).map(
|
351
|
+
([s, l]) => n`<luzmo-menu-item value=${s}>${l}</luzmo-menu-item>`
|
352
|
+
), e = [
|
353
|
+
n`<luzmo-menu-item value="none">No weight</luzmo-menu-item>`,
|
354
|
+
...this.measureColumns.map((s) => {
|
355
|
+
var d, c, h;
|
356
|
+
const l = ((d = s == null ? void 0 : s.label) == null ? void 0 : d[this.language ?? "en"]) ?? ((h = s == null ? void 0 : s.label) == null ? void 0 : h[(c = Object.keys(s == null ? void 0 : s.label)) == null ? void 0 : c[0]]) ?? "Untitled";
|
357
|
+
return n`<luzmo-menu-item value=${s.id}>
|
358
|
+
${l}
|
359
|
+
</luzmo-menu-item>`;
|
360
|
+
})
|
361
|
+
];
|
362
|
+
return n`<div class="settings-row">
|
363
|
+
<div class="setting">
|
364
|
+
<luzmo-field-label for="aggregation">Aggregation</luzmo-field-label>
|
365
|
+
<luzmo-picker
|
366
|
+
id="aggregation"
|
367
|
+
size=${this.size}
|
368
|
+
variant="highlight"
|
369
|
+
value=${this._aggregationFunc ?? (((i = this.slotContent) == null ? void 0 : i.type) === "numeric" ? "sum" : "count")}
|
370
|
+
@change=${this._setAggregationFunc}
|
371
|
+
>
|
372
|
+
${t}
|
373
|
+
</luzmo-picker>
|
374
|
+
</div>
|
375
|
+
${this._aggregationFunc === "rate" ? n`<div class="setting">
|
376
|
+
<luzmo-field-label for="weighting-column">
|
377
|
+
Denominator
|
378
|
+
</luzmo-field-label>
|
379
|
+
<luzmo-picker
|
380
|
+
id="weighting-column"
|
381
|
+
size=${this.size}
|
382
|
+
variant="highlight"
|
383
|
+
value=${((a = this._aggregationWeightColumn) == null ? void 0 : a.column) ?? "none"}
|
384
|
+
@change=${this._setAggregationWeight}
|
385
|
+
>
|
386
|
+
${e}
|
387
|
+
</luzmo-picker>
|
388
|
+
</div>` : ""}
|
389
|
+
</div>`;
|
390
|
+
}
|
391
|
+
render() {
|
392
|
+
var t;
|
393
|
+
return n`<div class="settings-container">
|
394
|
+
<div class="settings-row">
|
395
|
+
${this._displayMode === "duration" ? this._renderDurationLevelsSettings() : this._renderNumericDisplayAsSettings()}
|
396
|
+
${((t = this._durationLevels) == null ? void 0 : t.length) > 1 ? this._renderDurationFormatSettings() : this._renderNumericFormatSettings()}
|
397
|
+
</div>
|
398
|
+
${this._renderAggregationSettings()}
|
399
|
+
</div>
|
400
|
+
</div>`;
|
401
|
+
}
|
402
|
+
}
|
403
|
+
r([
|
404
|
+
p({ type: String, reflect: !0 })
|
405
|
+
], o.prototype, "language");
|
406
|
+
r([
|
407
|
+
p({ type: Object, reflect: !0 })
|
408
|
+
], o.prototype, "slotContent");
|
409
|
+
r([
|
410
|
+
p({ type: Array, reflect: !1 })
|
411
|
+
], o.prototype, "measureColumns");
|
412
|
+
r([
|
413
|
+
m("#display-as")
|
414
|
+
], o.prototype, "_displayAsElement");
|
415
|
+
r([
|
416
|
+
m("#precision")
|
417
|
+
], o.prototype, "_precisionElement");
|
418
|
+
r([
|
419
|
+
m("#aggregation")
|
420
|
+
], o.prototype, "_aggregationElement");
|
421
|
+
r([
|
422
|
+
m("#weighting-column")
|
423
|
+
], o.prototype, "_aggregationWeightElement");
|
424
|
+
r([
|
425
|
+
m("#duration-levels")
|
426
|
+
], o.prototype, "_durationLevelsElement");
|
427
|
+
r([
|
428
|
+
m("#duration-format")
|
429
|
+
], o.prototype, "_durationFormatElement");
|
430
|
+
r([
|
431
|
+
m("#duration-levels-overlay")
|
432
|
+
], o.prototype, "_durationLevelsOverlay");
|
433
|
+
r([
|
434
|
+
D()
|
435
|
+
], o.prototype, "_renderDurationLevelMenu");
|
436
|
+
customElements.get("luzmo-display-settings-numeric") || customElements.define(
|
437
|
+
"luzmo-display-settings-numeric",
|
438
|
+
o
|
439
|
+
);
|
440
|
+
export {
|
441
|
+
o as LuzmoDisplaySettingsNumeric
|
442
|
+
};
|
@@ -0,0 +1,71 @@
|
|
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
|
+
"use strict";const t=require("./if-defined-V7yEJWI3.cjs"),f=require("./get-css-variable-D439CdH9.cjs"),e=require("./index-Bo1DpZ-1.cjs");require("./index-jt6FL_uE.cjs");const F=":host{font-family:var(--luzmo-draggable-data-item-level-font-family, var(--luzmo-font-family));color:var(--luzmo-draggable-data-item-level-font-color, var(--draggable-data-item-level-font-color))}.draggable-data-item-level{transition:background-color var(--luzmo-animation-duration);background-color:var(--luzmo-draggable-data-item-level-background-color, var(--draggable-data-item-level-background-color));display:flex;justify-content:space-between;align-items:center;padding:0 var(--luzmo-draggable-data-item-level-horizontal-padding, var(--draggable-data-item-level-horizontal-padding));gap:var(--luzmo-draggable-data-item-level-gap, var(--draggable-data-item-level-gap));border-radius:var(--luzmo-draggable-data-item-level-border-radius, var(--draggable-data-item-level-border-radius));border-width:var(--luzmo-draggable-data-item-level-border-width, var(--draggable-data-item-level-border-width));border-style:var(--luzmo-draggable-data-item-level-border-style, var(--draggable-data-item-level-border-style));border-color:var(--luzmo-draggable-data-item-level-border-color, var(--draggable-data-item-level-border-color));height:var(--luzmo-draggable-data-item-level-height, var(--draggable-data-item-level-height));cursor:move}.draggable-data-item-level:hover{background-color:var(--luzmo-draggable-data-item-level-background-color-hover, var(--draggable-data-item-level-background-color-hover))}.draggable-data-item-level .data-label{font-size:var(--luzmo-draggable-data-item-level-label-font-size, var(--draggable-data-item-level-label-font-size));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host([sublevel]) .draggable-data-item-level{height:var(--luzmo-draggable-data-item-level-sublevel-height, var(--draggable-data-item-level-sublevel-height));background-color:var(--luzmo-draggable-data-item-level-sublevel-background-color, var(--draggable-data-item-level-sublevel-background-color));border-color:var(--luzmo-draggable-data-item-level-sublevel-border-color, var(--draggable-data-item-level-sublevel-border-color));margin-inline-start:var(--luzmo-draggable-data-item-level-sublevel-margin-inline-start, var(--draggable-data-item-level-sublevel-margin-inline-start))}:host([sublevel]) .draggable-data-item-level:hover{background-color:var(--luzmo-draggable-data-item-level-sublevel-background-color-hover, var(--draggable-data-item-level-sublevel-background-color-hover))}:host([sublevel]) .draggable-data-item-level .drag-handle-icon{width:var(--luzmo-draggable-data-item-level-sublevel-drag-handle-width, var(--draggable-data-item-level-sublevel-drag-handle-width));text-align:center}:host([disabled]) .draggable-data-item-level{background-color:var(--luzmo-draggable-data-item-level-background-color-disabled, var(--draggable-data-item-level-background-color-disabled));color:var(--luzmo-draggable-data-item-level-color-disabled, var(--draggable-data-item-level-color-disabled));cursor:not-allowed}:host([disabled]) .drag-handle-icon{opacity:.25}:host([sublevel][disabled]) .draggable-data-item-level{background-color:var(--luzmo-draggable-data-item-level-sublevel-background-color-disabled, var(--draggable-data-item-level-sublevel-background-color-disabled))}.drag-handle-icon{opacity:.6;font-size:var(--luzmo-draggable-data-item-level-drag-handle-size, var(--luzmo-draggable-data-item-level-drag-handle-size));width:var(--luzmo-draggable-data-item-level-drag-handle-width, var(--luzmo-draggable-data-item-level-drag-handle-width));text-align:center}.data-icon-type{width:var(--luzmo-draggable-data-item-level-data-icon-width, var(--luzmo-draggable-data-item-level-data-icon-width));text-align:center}.data-label{flex-grow:1}.data-description{height:100%;display:flex;align-items:center;background-color:transparent;outline:none;border:none;font-size:var(--luzmo-draggable-data-item-level-label-font-size, var(--draggable-data-item-level-label-font-size))}:host([variant=highlight]){--draggable-data-item-level-background-color: var( --luzmo-background-color-highlight );--draggable-data-item-level-border-color: var( --luzmo-background-color-highlight );--draggable-data-item-level-background-color-hover: var( --luzmo-background-color-highlight-hover )}:host{--draggable-data-item-level-height: var(--luzmo-component-height);--draggable-data-item-level-label-font-size: var(--luzmo-font-size);--draggable-data-item-level-icon-type-size: var(--luzmo-font-size);--draggable-data-item-level-horizontal-padding: var(--luzmo-spacing-5);--draggable-data-item-level-border-width: var(--luzmo-border-width);--draggable-data-item-level-border-style: solid;--draggable-data-item-level-border-color: var(--luzmo-border-color-hover);--draggable-data-item-level-border-radius: var(--luzmo-border-radius);--draggable-data-item-level-gap: var(--luzmo-spacing-4);--draggable-data-item-level-font-color: var(--luzmo-font-color);--draggable-data-item-level-color-disabled: var(--luzmo-color-disabled);--draggable-data-item-level-background-color-disabled: var( --luzmo-background-color-disabled );--luzmo-draggable-data-item-level-drag-handle-size: var(--luzmo-font-size-s);--luzmo-draggable-data-item-level-drag-handle-width: var( --draggable-data-item-level-icon-type-size );--luzmo-draggable-data-item-level-data-icon-width: calc( var(--draggable-data-item-level-icon-type-size) + var(--luzmo-spacing-3) );--draggable-data-item-level-sublevel-height: var(--luzmo-component-height-s);--draggable-data-item-level-sublevel-border-color: transparent;--draggable-data-item-level-sublevel-background-color: transparent;--draggable-data-item-level-sublevel-background-color-disabled: transparent;--draggable-data-item-level-sublevel-margin-inline-start: calc( var(--draggable-data-item-level-gap) + var(--luzmo-draggable-data-item-level-drag-handle-width) );--luzmo-draggable-data-item-level-sublevel-drag-handle-width: var( --luzmo-draggable-data-item-level-data-icon-width );--draggable-data-item-level-sublevel-background-color-hover: rgba( var(--luzmo-border-color-rgb), .05 )}:host([hide-type-icon]){--draggable-data-item-level-sublevel-margin-inline-start: var( --draggable-data-item-level-gap )}:host([size=s]){--draggable-data-item-level-height: var(--luzmo-component-height-s);--draggable-data-item-level-label-font-size: var(--luzmo-font-size-s);--draggable-data-item-level-icon-type-size: var(--luzmo-font-size-s);--draggable-data-item-level-horizontal-padding: var(--luzmo-spacing-4);--draggable-data-item-level-border-radius: var(--luzmo-border-radius);--draggable-data-item-level-gap: var(--luzmo-spacing-3);--draggable-data-item-level-sublevel-height: var(--luzmo-component-height-xs);--luzmo-draggable-data-item-level-drag-handle-size: var(--luzmo-font-size-xs)}:host([size=l]){--draggable-data-item-level-height: var(--luzmo-component-height-l);--draggable-data-item-level-label-font-size: var(--luzmo-font-size-l);--draggable-data-item-level-icon-type-size: var(--luzmo-font-size-l);--draggable-data-item-level-horizontal-padding: var(--luzmo-spacing-5);--draggable-data-item-level-border-radius: var(--luzmo-border-radius-l);--draggable-data-item-level-gap: var(--luzmo-spacing-5);--draggable-data-item-level-sublevel-height: var(--luzmo-component-height);--luzmo-draggable-data-item-level-drag-handle-size: var(--luzmo-font-size)}:host([size=xl]){--draggable-data-item-level-height: var(--luzmo-component-height-xl);--draggable-data-item-level-label-font-size: var(--luzmo-font-size-xl);--draggable-data-item-level-icon-type-size: var(--luzmo-font-size-xl);--draggable-data-item-level-horizontal-padding: var(--luzmo-spacing-5);--draggable-data-item-level-border-radius: var(--luzmo-border-radius-xl);--draggable-data-item-level-gap: var(--luzmo-spacing-5);--draggable-data-item-level-sublevel-height: var(--luzmo-component-height-l);--luzmo-draggable-data-item-level-drag-handle-size: var(--luzmo-font-size-l)}:host{box-sizing:border-box}",n={array:{s:e.D0,m:e.w0,l:e.x0,xl:e.x0},coordinates:{s:e.A0,m:e.Z0,l:e.u0,xl:e.u0},currency:{s:e.V0,m:e.H0,l:e.p0,xl:e.p0},date:{s:e.a0,m:e.o0,l:e.t,xl:e.t},datetime:{s:e.n0,m:e.z0,l:e.l0,xl:e.l0},duration:{s:e.k0,m:e.S0,l:e.f0,xl:e.f0},hierarchy:{s:e.E0,m:e.P0,l:e.U0,xl:e.U0},image:{s:e.O0,m:e.Q0,l:e.N0,xl:e.N0},numeric:{s:e.X0,m:e.Y0,l:e._0,xl:e._0},time:{s:e.M2,m:e.L2,l:e.r2,xl:e.r2},topography:{s:e.W1,m:e.W1,l:e.W1,xl:e.W1},ipaddress:{s:e.x2,m:e.B2,l:e.F2,xl:e.F2}},M=(l,a)=>(a==null?void 0:a.type)==="array"?n.array[l]:(a==null?void 0:a.type)==="image"?n.image[l]:(a==null?void 0:a.type)==="spatial"?(a==null?void 0:a.subtype)==="topography"?n.topography[l]:n.coordinates[l]:(a==null?void 0:a.type)==="numeric"?(a==null?void 0:a.subtype)==="currency"?n.currency[l]:(a==null?void 0:a.subtype)==="duration"?n.duration[l]:n.numeric[l]:(a==null?void 0:a.type)==="datetime"?(a==null?void 0:a.subtype)==="time"?n.time[l]:(a==null?void 0:a.subtype)==="date"?n.date[l]:n.datetime[l]:(a==null?void 0:a.type)==="hierarchy"&&(a==null?void 0:a.subtype)==="ipaddress"?n.ipaddress[l]:n.hierarchy[l],R=l=>{var m,c,z,y,w,S,C,D,E,O,P,_,I,L,T,j,B;const a=l.source.element;let r="";(y=(z=(c=(m=l.source)==null?void 0:m.element)==null?void 0:c.renderRoot)==null?void 0:z.querySelector(".data-label"))!=null&&y.textContent&&(r=(C=(S=(w=l.source)==null?void 0:w.element)==null?void 0:S.renderRoot)==null?void 0:C.querySelector(".data-label").textContent),r||(r=f.localize((E=(D=l==null?void 0:l.source)==null?void 0:D.data)==null?void 0:E.label,(P=(O=l==null?void 0:l.source)==null?void 0:O.element)==null?void 0:P.language),r=r||"Untitled");const v=(I=(_=l==null?void 0:l.source)==null?void 0:_.data)==null?void 0:I.type,i=(T=(L=l==null?void 0:l.source)==null?void 0:L.data)==null?void 0:T.subtype,d=M(a.size,{type:v,subtype:i}),o={};[["borderColor","--luzmo-draggable-data-item-level-border-color","--draggable-data-item-level-border-color"],["backgroundColor","--luzmo-draggable-data-item-level-background-color","--draggable-data-item-level-background-color"],["color","--luzmo-draggable-data-item-level-font-color","--draggable-data-item-level-font-color"],["fontSize","--luzmo-draggable-data-item-level-label-font-size","--draggable-data-item-level-label-font-size"],["height","--luzmo-draggable-data-item-level-height","--draggable-data-item-level-height"],["borderRadius","--luzmo-draggable-data-item-level-border-radius","--draggable-data-item-level-border-radius"],["fontFamily","--luzmo-draggable-data-item-level-font-family","--luzmo-font-family"],["horizontalPadding","--luzmo-draggable-data-item-level-horizontal-padding","--draggable-data-item-level-horizontal-padding"],["gap","--luzmo-draggable-data-item-level-gap","--draggable-data-item-level-gap"]].forEach(([x,q,V])=>{const W=f.getCssVariableValue(a,q)||f.getCssVariableValue(a,V);o[x]=W});const u=document.createElement("div"),g=document.createElement("div");if(u.innerHTML=r,!((B=(j=l==null?void 0:l.source)==null?void 0:j.element)!=null&&B.sublevel)){const x=document.createElement("luzmo-icon");x.icon=d,g.append(x)}return g.append(u),Object.assign(g.style,{display:"flex",alignItems:"center",height:o.height,border:`1px solid ${o.borderColor}`,backgroundColor:o.backgroundColor,borderRadius:o.borderRadius,fontFamily:o.fontFamily,fontSize:o.fontSize,color:o.color,padding:`0 ${o.horizontalPadding}`,gap:o.gap}),g};var U=Object.defineProperty,h=(l,a,r,v)=>{for(var i=void 0,d=l.length-1,o;d>=0;d--)(o=l[d])&&(i=o(a,r,i)||i);return i&&U(a,r,i),i};const k=class k extends t.SizedMixin(t.LuzmoElement,{validSizes:["s","m","l","xl"],noDefaultSize:!0}){constructor(){super(...arguments),this.language="en",this.data={},this.dataItemLevelDropped=a=>{this.dispatchEvent(new CustomEvent("data-item-dropped",{bubbles:!0,composed:!0,cancelable:!0,detail:{data:a}}))}}disconnectedCallback(){super.disconnectedCallback(),this._cleanupDraggable()}firstUpdated(a){this._cleanupDraggable=f.draggable({element:this,canDrag:()=>!this.disabled,onDragStart:()=>{this.style.opacity="0.5"},onDrop:()=>{this.style.opacity="1",this.dataItemLevelDropped(this.data)},getInitialData:()=>{const r={...this.data};return this.label&&this.language&&!this.sublevel&&(r.label={},r.label[this.language]=this.label),this.description&&this.language&&(r.description={},r.description[this.language]=this.description),r},onGenerateDragPreview:r=>{const v=r.nativeSetDragImage;f.setCustomNativeDragPreview({render({container:i}){const d=R(r);i.append(d)},nativeSetDragImage:v})}})}render(){var v,i,d,o,u,g,m,c,z,y;const a=this.label??((i=(v=this.data)==null?void 0:v.label)==null?void 0:i[this.language])??((u=(d=this.data)==null?void 0:d.label)==null?void 0:u[Object.keys((o=this.data)==null?void 0:o.label)[0]])??"Untitled",r=this.description??((m=(g=this.data)==null?void 0:g.description)==null?void 0:m[this.language])??((y=(c=this.data)==null?void 0:c.description)==null?void 0:y[Object.keys((z=this.data)==null?void 0:z.description)[0]]);return t.x`
|
21
|
+
<div class="draggable-data-item-level">
|
22
|
+
<div class="drag-handle-icon">
|
23
|
+
${this.sublevel?e.O2(e.b0):e.O2(e.W)}
|
24
|
+
</div>
|
25
|
+
${this.sublevel||this.hideTypeIcon?"":t.x`<div class="data-icon-type">
|
26
|
+
${e.O2(M(this.size,this.data))}
|
27
|
+
</div>`}
|
28
|
+
<div class="data-label">${a}</div>
|
29
|
+
${r?t.x`<button class="data-description">
|
30
|
+
${e.O2(e.p1)}
|
31
|
+
<luzmo-tooltip self-managed placement="top" size=${this.size}>
|
32
|
+
${r}
|
33
|
+
</luzmo-tooltip>
|
34
|
+
</button>`:""}
|
35
|
+
</div>
|
36
|
+
`}};k.styles=t.r(F);let s=k;h([t.n({type:String,reflect:!0})],s.prototype,"variant");h([t.n({type:Boolean,reflect:!0,attribute:"hide-type-icon"})],s.prototype,"hideTypeIcon");h([t.n({type:Boolean,reflect:!0})],s.prototype,"sublevel");h([t.n({type:String,reflect:!0})],s.prototype,"language");h([t.n({type:Boolean,reflect:!0})],s.prototype,"disabled");h([t.n({type:String,reflect:!0})],s.prototype,"label");h([t.n({type:String,reflect:!0})],s.prototype,"description");h([t.n({type:Object})],s.prototype,"data");customElements.get("luzmo-draggable-data-item-level")||customElements.define("luzmo-draggable-data-item-level",s);const H=":host{--draggable-data-item-sublevels-margin-vertical: var(--luzmo-spacing-1);--draggable-data-item-sublevels-gap: 0}:host([size=s]){--draggable-data-item-sublevels-margin-vertical: var(--luzmo-spacing-1)}:host([size=l]){--draggable-data-item-sublevels-margin-vertical: var(--luzmo-spacing-2)}:host([size=xl]){--draggable-data-item-sublevels-margin-vertical: var(--luzmo-spacing-3)}.draggable-data-item-sublevels{display:flex;flex-direction:column;gap:var(--luzmo-draggable-data-item-sublevels-gap, var(--draggable-data-item-sublevels-gap));margin:var(--luzmo-draggable-data-item-sublevels-margin-vertical, var(--draggable-data-item-sublevels-margin-vertical)) 0}:host{box-sizing:border-box}";var N=Object.defineProperty,p=(l,a,r,v)=>{for(var i=void 0,d=l.length-1,o;d>=0;d--)(o=l[d])&&(i=o(a,r,i)||i);return i&&N(a,r,i),i};const $=class $ extends t.SizedMixin(t.LuzmoElement,{validSizes:["s","m","l","xl"],noDefaultSize:!0}){constructor(){super(...arguments),this.language="en",this.data={}}renderSublevels(){var r,v,i,d,o;let a;if(((r=this.data)==null?void 0:r.type)==="datetime"){a=((v=this.data)==null?void 0:v.subtype)==="date"?this.data.lowestLevel??5:this.data.lowestLevel??9;const u=["Year","Quarter","Month","Week","Day","Hour","Minute","Second","Millisecond"];return t.x`
|
37
|
+
<div class="draggable-data-item-sublevels">
|
38
|
+
${Array.from({length:a},(g,m)=>{const c=u[m],z={...this.data,level:m+1};return t.x`<luzmo-draggable-data-item-level
|
39
|
+
sublevel
|
40
|
+
.data=${z}
|
41
|
+
.language=${this.language}
|
42
|
+
.size=${this.size}
|
43
|
+
.variant=${this.variant}
|
44
|
+
.disabled=${this.disabled}
|
45
|
+
.label=${c}
|
46
|
+
?hide-type-icon=${this.hideTypeIcon}
|
47
|
+
></luzmo-draggable-data-item-level>`})}
|
48
|
+
</div>
|
49
|
+
`}else if(((i=this.data)==null?void 0:i.type)==="hierarchy"&&((o=(d=this.data)==null?void 0:d.hierarchyLevels)==null?void 0:o.length)>2){const u=this.data.hierarchyLevels.filter(g=>(g==null?void 0:g.level)>=1).map((g,m)=>{const c={...this.data,level:m,label:g.label};return t.x`<luzmo-draggable-data-item-level
|
50
|
+
sublevel
|
51
|
+
.data=${c}
|
52
|
+
.language=${this.language}
|
53
|
+
.size=${this.size}
|
54
|
+
.variant=${this.variant}
|
55
|
+
.disabled=${this.disabled}
|
56
|
+
?hide-type-icon=${this.hideTypeIcon}
|
57
|
+
></luzmo-draggable-data-item-level>`});return t.x`
|
58
|
+
<div class="draggable-data-item-sublevels">${u}</div>
|
59
|
+
`}return t.x``}render(){return t.x`
|
60
|
+
<luzmo-draggable-data-item-level
|
61
|
+
.data=${this.data}
|
62
|
+
.language=${this.language}
|
63
|
+
.size=${this.size}
|
64
|
+
.variant=${this.variant}
|
65
|
+
.disabled=${this.disabled}
|
66
|
+
.label=${this.label}
|
67
|
+
.description=${this.description}
|
68
|
+
?hide-type-icon=${this.hideTypeIcon}
|
69
|
+
></luzmo-draggable-data-item-level>
|
70
|
+
${this.hideSublevels?"":this.renderSublevels()}
|
71
|
+
`}};$.styles=t.r(H);let b=$;p([t.n({type:String,reflect:!0})],b.prototype,"variant");p([t.n({type:String,reflect:!0})],b.prototype,"language");p([t.n({type:Boolean,reflect:!0})],b.prototype,"disabled");p([t.n({type:Boolean,reflect:!0,attribute:"hide-sublevels"})],b.prototype,"hideSublevels");p([t.n({type:Boolean,reflect:!0,attribute:"hide-type-icon"})],b.prototype,"hideTypeIcon");p([t.n({type:String,reflect:!0})],b.prototype,"label");p([t.n({type:String,reflect:!0})],b.prototype,"description");p([t.n({type:Object})],b.prototype,"data");customElements.get("luzmo-draggable-data-item")||customElements.define("luzmo-draggable-data-item",b);exports.LuzmoDraggableDataItem=b;exports.LuzmoDraggableDataItemLevel=s;
|