@luzmo/analytics-components-kit 1.0.1-alpha.52 → 1.0.1-alpha.53

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.
Files changed (42) hide show
  1. package/components/display-settings/display-settings.d.ts +1 -0
  2. package/components/display-settings/index.cjs +1 -1
  3. package/components/display-settings/index.js +1 -1
  4. package/components/display-settings-datetime/display-settings-datetime.d.ts +1 -1
  5. package/components/display-settings-datetime/index.cjs +43 -56
  6. package/components/display-settings-datetime/index.js +81 -95
  7. package/components/display-settings-numeric/index.cjs +17 -17
  8. package/components/display-settings-numeric/index.js +80 -80
  9. package/components/droppable-slot/index.cjs +1 -1
  10. package/components/droppable-slot/index.js +1 -1
  11. package/components/edit-item/index.cjs +2 -2
  12. package/components/edit-item/index.js +4 -4
  13. package/components/edit-option/index.cjs +1 -1
  14. package/components/edit-option/index.js +1 -1
  15. package/components/{en-GB-BtLbN8o_.js → en-GB-UzDYaNfY.js} +1 -1
  16. package/components/{en-GB-Dd11ROdW.cjs → en-GB-cN3S24Cg.cjs} +1 -1
  17. package/components/{formatter-CQDms6fU.js → formatter-CqU9_98M.js} +1 -0
  18. package/components/{formatter-DiJYkB6b.cjs → formatter-Lo9PMcxy.cjs} +1 -1
  19. package/components/{heat-map-options.config-DQya-lag.js → heat-map-options.config-BnLWe8jS.js} +16 -14
  20. package/components/heat-map-options.config-DVH-Bb5-.cjs +20 -0
  21. package/components/{index-CSfR7FMV.cjs → index-BYO1LMBt.cjs} +1 -1
  22. package/components/{index-BPVXrhaX.js → index-CShrqT1H.js} +3 -3
  23. package/components/index-D05oY5ND.cjs +178 -0
  24. package/components/{index-fmbD10nN.js → index-DV63kOPg.js} +269 -242
  25. package/components/index.cjs +1 -1
  26. package/components/index.js +3 -3
  27. package/components/{marker-map-options.config-CYoq89Oz.js → marker-map-options.config-DPJ955tt.js} +1 -1
  28. package/components/{marker-map-options.config-_XFv5XWK.cjs → marker-map-options.config-_FYZzRwA.cjs} +1 -1
  29. package/components/slot-contents-picker/index.cjs +1 -1
  30. package/components/slot-contents-picker/index.js +1 -1
  31. package/components/slot-menu/index.cjs +8 -8
  32. package/components/slot-menu/index.js +88 -76
  33. package/components/slot-menu-list/index.cjs +1 -1
  34. package/components/slot-menu-list/index.js +9 -10
  35. package/components/{symbol-map-options.config-Bj-UuL9m.js → symbol-map-options.config-DdDA4aa7.js} +1 -1
  36. package/components/{symbol-map-options.config-sdPlHspI.cjs → symbol-map-options.config-m-lwLTtu.cjs} +1 -1
  37. package/components/utils.cjs +1 -1
  38. package/components/utils.js +1 -1
  39. package/custom-elements.json +6 -0
  40. package/package.json +1 -1
  41. package/components/heat-map-options.config-BQ-Afrbi.cjs +0 -20
  42. package/components/index-3X8Iuo7y.cjs +0 -174
@@ -25,15 +25,15 @@ import "../index-BC1LV3vH.js";
25
25
  import "../index-DsP81c4M.js";
26
26
  import "../index-B2ngKWOI.js";
27
27
  import "../index-C3N6qTxJ.js";
28
- import { r as k, x as a, n as d } from "../property-DCzt3DR1.js";
29
- import { m as i, g as x, t as w, s as F } from "../set-locale-GI34z_M7.js";
30
- import { l as $ } from "../localized-decorator-Bl5gcI6n.js";
31
- import { v as p, z as c } from "../luzmo-icons-CVeTZ59u.js";
32
- import { S as _, f, D as v } from "../formatter-CQDms6fU.js";
33
- import { a as A, b as z, W as g } from "../periods.const-B7FKokcH.js";
28
+ import { r as k, x as s, n as d } from "../property-DCzt3DR1.js";
29
+ import { m as l, g as w, t as F, s as $ } from "../set-locale-GI34z_M7.js";
30
+ import { l as x } from "../localized-decorator-Bl5gcI6n.js";
31
+ import { v as c, z as p } from "../luzmo-icons-CVeTZ59u.js";
32
+ import { a as A, S as _, f, D as v } from "../formatter-CqU9_98M.js";
33
+ import { a as L, b as z, W as g } from "../periods.const-B7FKokcH.js";
34
34
  import { e as n } from "../query-Ddbd72Um.js";
35
- import { L } from "../focusable-BbymtxWI.js";
36
- import { S as D, E } from "../sized-mixin-BGzkX2g1.js";
35
+ import { L as D } from "../focusable-BbymtxWI.js";
36
+ import { S as E, E as M } from "../sized-mixin-BGzkX2g1.js";
37
37
  const b = () => {
38
38
  if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
39
39
  const t = document.createElement("style");
@@ -42,18 +42,18 @@ const b = () => {
42
42
  };
43
43
  b();
44
44
  const y = {
45
- "~": () => i("Auto", { desc: "Automatic setting of the option" }),
45
+ "~": () => l("Auto", { desc: "Automatic setting of the option" }),
46
46
  "/": () => "/",
47
47
  "-": () => "-",
48
48
  ".": () => "."
49
- }, M = ":host{font-family:var(--luzmo-display-settings-datetime-font-family, var(--luzmo-font-family))}: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-datetime-gap, var(--display-settings-datetime-gap))}:host .example-container{line-height:var(--luzmo-display-settings-datetime-example-height, var(--display-settings-datetime-example-height));font-size:var(--luzmo-display-settings-datetime-example-font-size, var(--display-settings-datetime-example-font-size));color:var(--luzmo-display-settings-datetime-example-color, var(--display-settings-datetime-example-color))}:host .example-container .example-label{font-weight:var(--luzmo-display-settings-datetime-example-label-font-weight, var(--display-settings-datetime-example-label-font-weight));color:var(--luzmo-display-settings-datetime-example-label-color, var(--display-settings-datetime-example-label-color))}:host .example-container .example-language{text-transform:uppercase;color:var(--luzmo-display-settings-datetime-example-language-color, var(--display-settings-datetime-example-language-color))}:host{--display-settings-datetime-example-font-size: var(--luzmo-font-size);--display-settings-datetime-example-color: var(--luzmo-font-color);--display-settings-datetime-example-label-font-weight: bold;--display-settings-datetime-example-label-color: var(--luzmo-primary);--display-settings-datetime-example-language-color: var(--luzmo-primary)}:host{--display-settings-datetime-gap: var(--luzmo-spacing-3);--display-settings-datetime-example-height: var(--luzmo-component-height);--display-settings-datetime-example-font-size: var(--luzmo-font-size-s)}:host([size=s]){--display-settings-datetime-gap: var(--luzmo-spacing-3);--display-settings-datetime-example-height: var(--luzmo-component-height-s);--display-settings-datetime-example-font-size: var(--luzmo-font-size-s)}:host([size=l]){--display-settings-datetime-gap: var(--luzmo-spacing-4);--display-settings-datetime-example-height: var(--luzmo-component-height-l);--display-settings-datetime-example-font-size: var(--luzmo-font-size)}:host([size=xl]){--display-settings-datetime-gap: var(--luzmo-spacing-5);--display-settings-datetime-example-height: var(--luzmo-component-height-xl);--display-settings-datetime-example-font-size: var(--luzmo-font-size-l)}";
50
- var C = Object.defineProperty, N = Object.getOwnPropertyDescriptor, m = (t, e, s, o) => {
51
- for (var l = o > 1 ? void 0 : o ? N(e, s) : e, h = t.length - 1, u; h >= 0; h--)
52
- (u = t[h]) && (l = (o ? u(e, s, l) : u(l)) || l);
53
- return o && l && C(e, s, l), l;
49
+ }, N = ":host{font-family:var(--luzmo-display-settings-datetime-font-family, var(--luzmo-font-family))}: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-datetime-gap, var(--display-settings-datetime-gap))}:host{--display-settings-datetime-example-font-size: var(--luzmo-font-size);--display-settings-datetime-example-color: var(--luzmo-font-color);--display-settings-datetime-example-label-font-weight: bold;--display-settings-datetime-example-label-color: var(--luzmo-primary);--display-settings-datetime-example-language-color: var(--luzmo-primary)}:host{--display-settings-datetime-gap: var(--luzmo-spacing-3);--display-settings-datetime-example-height: var(--luzmo-component-height);--display-settings-datetime-example-font-size: var(--luzmo-font-size-s)}:host([size=s]){--display-settings-datetime-gap: var(--luzmo-spacing-3);--display-settings-datetime-example-height: var(--luzmo-component-height-s);--display-settings-datetime-example-font-size: var(--luzmo-font-size-s)}:host([size=l]){--display-settings-datetime-gap: var(--luzmo-spacing-4);--display-settings-datetime-example-height: var(--luzmo-component-height-l);--display-settings-datetime-example-font-size: var(--luzmo-font-size)}:host([size=xl]){--display-settings-datetime-gap: var(--luzmo-spacing-5);--display-settings-datetime-example-height: var(--luzmo-component-height-xl);--display-settings-datetime-example-font-size: var(--luzmo-font-size-l)}";
50
+ var C = Object.defineProperty, T = Object.getOwnPropertyDescriptor, m = (t, e, a, o) => {
51
+ for (var i = o > 1 ? void 0 : o ? T(e, a) : e, h = t.length - 1, u; h >= 0; h--)
52
+ (u = t[h]) && (i = (o ? u(e, a, i) : u(i)) || i);
53
+ return o && i && C(e, a, i), i;
54
54
  };
55
- let r = class extends D(L, {
56
- validSizes: Object.values(E)
55
+ let r = class extends E(D, {
56
+ validSizes: Object.values(M)
57
57
  }) {
58
58
  constructor() {
59
59
  super(...arguments), this._loadLocaleFormatsConfig = new S(this, {
@@ -63,9 +63,9 @@ let r = class extends D(L, {
63
63
  "../../utils/formatter/formats/cs.ts": () => import("../cs-DVZ0Tapy.js"),
64
64
  "../../utils/formatter/formats/da.ts": () => import("../da-DHy05oSR.js"),
65
65
  "../../utils/formatter/formats/de.ts": () => import("../de-iM39JlAt.js"),
66
- "../../utils/formatter/formats/en-GB.ts": () => import("../en-GB-BtLbN8o_.js"),
66
+ "../../utils/formatter/formats/en-GB.ts": () => import("../en-GB-UzDYaNfY.js"),
67
67
  "../../utils/formatter/formats/en-US.ts": () => Promise.resolve().then(() => O),
68
- "../../utils/formatter/formats/en.ts": () => Promise.resolve().then(() => T),
68
+ "../../utils/formatter/formats/en.ts": () => Promise.resolve().then(() => I),
69
69
  "../../utils/formatter/formats/es.ts": () => import("../es-KhTq4jX8.js"),
70
70
  "../../utils/formatter/formats/fi.ts": () => import("../fi-Dh_ebgpe.js"),
71
71
  "../../utils/formatter/formats/fr.ts": () => import("../fr-CU727YF1.js"),
@@ -86,8 +86,8 @@ let r = class extends D(L, {
86
86
  "../../utils/formatter/formats/zh-TW.ts": () => import("../zh-TW-wsl7eFSd.js")
87
87
  });
88
88
  if (e[`../../utils/formatter/formats/${t}.ts`]) {
89
- const s = await e[`../../utils/formatter/formats/${t}.ts`]();
90
- this._localeFormats = (s == null ? void 0 : s.default) ?? {};
89
+ const a = await e[`../../utils/formatter/formats/${t}.ts`]();
90
+ this._localeFormats = (a == null ? void 0 : a.default) ?? {};
91
91
  }
92
92
  return this._contentLanguageLoaded = t, this._localeFormats;
93
93
  }
@@ -107,16 +107,27 @@ let r = class extends D(L, {
107
107
  };
108
108
  }
109
109
  static get styles() {
110
- return [k(M)];
110
+ return [k(N)];
111
111
  }
112
112
  _parseSlotContent() {
113
113
  var t, e;
114
- this._dateLevel = this.slotContent.level ?? ((t = this.slotContent) == null ? void 0 : t.lowestLevel) ?? 5, this._displayAs = ((e = this.slotContent) == null ? void 0 : e.datetimeDisplayMode) ?? "default", this._displayAs === "weekday_number" && (this._displayAs = "day_in_week", this._weekDayAndMonthInYearFormat = "number"), this._displayAs === "weekday_name" && (this._displayAs = "day_in_week"), this._displayAs === "month_number" && (this._displayAs = "month_in_year", this._weekDayAndMonthInYearFormat = "number"), this._displayAs === "month_name" && (this._displayAs = "month_in_year");
114
+ this._dateLevel = this.slotContent.level ?? ((t = this.slotContent) == null ? void 0 : t.lowestLevel) ?? 5, this._displayAs = ((e = this.slotContent) == null ? void 0 : e.datetimeDisplayMode) ?? "default", this._displayAs === "weekday_number" && (this._displayAs = "day_in_week", this._weekDayAndMonthInYearFormat = "number"), this._displayAs === "weekday_name" && (this._displayAs = "day_in_week"), this._displayAs === "month_number" && (this._displayAs = "month_in_year", this._weekDayAndMonthInYearFormat = "number"), this._displayAs === "month_name" && (this._displayAs = "month_in_year"), this._parseSavedFormat();
115
+ }
116
+ _parseSavedFormat() {
117
+ var a;
118
+ const t = ((a = this.slotContent) == null ? void 0 : a.format) ?? A, e = t.match(/[./-]/);
119
+ if (this._dateSeparator = e ? e[0] : "~", t.includes("%amd"))
120
+ this._dateFormat = "auto";
121
+ else {
122
+ const o = t.indexOf("%d"), i = t.indexOf("%m");
123
+ o !== -1 && i !== -1 && (this._dateFormat = o < i ? "ddmm" : "mmdd");
124
+ }
125
+ this._24hFormat = t.includes("%H"), this._monthName = /%B|%b/.test(t), this._weekDay = /%a|%A/.test(t), this._monthName && (this._monthNameFormat = t.includes("%b") ? "short" : "long"), this._weekDay && (this._weekDayAndMonthInYearFormat = t.includes("%a") ? "short" : "long");
115
126
  }
116
127
  _calculateFormat() {
117
- var s;
128
+ var a;
118
129
  let t;
119
- const e = ((s = this._localeFormats) == null ? void 0 : s.smartDateFormats) ?? _;
130
+ const e = ((a = this._localeFormats) == null ? void 0 : a.smartDateFormats) ?? _;
120
131
  this._monthName ? (t = e.filter(
121
132
  (o) => o.monthType === "name" && o.longText === (this._monthNameFormat === "long") && o.weekday === this._weekDay
122
133
  ), t.length > 0 ? this._format = t[0].key : (this._weekDayAndMonthInYearFormat = "short", this._weekDay = !0, this._format = "%a %e %B %Y")) : (t = this._dateLevel && this._dateLevel === 4 ? e.filter(
@@ -162,18 +173,18 @@ let r = class extends D(L, {
162
173
  this._currentSlotContent = { ...this.slotContent }, this._calculateFormat(), this._currentSlotContent.format = this._format, this._displayAs === "default" ? delete this._currentSlotContent.datetimeDisplayMode : (this._currentSlotContent.datetimeDisplayMode = this._displayAs, this._displayAs === "week_in_year" ? this._currentSlotContent.datetimeDisplayMode = this._weekDayAndMonthInYearFormat === "number" ? "week_number" : "week_name" : this._displayAs === "month_in_year" ? this._currentSlotContent.datetimeDisplayMode = this._weekDayAndMonthInYearFormat === "number" ? "month_number" : "month_name" : this._displayAs === "day_in_week" && (this._currentSlotContent.datetimeDisplayMode = this._weekDayAndMonthInYearFormat === "number" ? "weekday_number" : "weekday_name", this._currentSlotContent.weekStart = this._weekStart), this._weekDayAndMonthInYearFormat && (this._dateLevel === 3 ? this._currentSlotContent.monthNameFormat = this._weekDayAndMonthInYearFormat : this._dateLevel === 5 && (this._currentSlotContent.weekDayNameFormat = this._weekDayAndMonthInYearFormat)));
163
174
  }
164
175
  willUpdate(t) {
165
- t.has("slotContent") && (this._parseSlotContent(), this._calculateSlotContent()), t.has("language") && this.language !== x() && ([...w].includes(this.language ?? "en") || this.language === "en") && F(this.language);
176
+ t.has("slotContent") && (this._parseSlotContent(), this._calculateSlotContent()), t.has("language") && this.language !== w() && ([...F].includes(this.language ?? "en") || this.language === "en") && $(this.language);
166
177
  }
167
178
  _renderDisplaySettings() {
168
- var e, s;
169
- const t = (s = (e = A) == null ? void 0 : e[`level${this._dateLevel ?? 0}`]) == null ? void 0 : s.map(
170
- (o) => a`<luzmo-menu-item value=${o.key}>
179
+ var e, a;
180
+ const t = (a = (e = L) == null ? void 0 : e[`level${this._dateLevel ?? 0}`]) == null ? void 0 : a.map(
181
+ (o) => s`<luzmo-menu-item value=${o.key}>
171
182
  ${o.i18n()}
172
183
  </luzmo-menu-item>`
173
184
  );
174
- return a`<div class="setting">
185
+ return s`<div class="setting">
175
186
  <luzmo-field-label for="display-as"
176
- >${i("Display", {
187
+ >${l("Display", {
177
188
  desc: "Label for display setting"
178
189
  })}</luzmo-field-label
179
190
  >
@@ -191,12 +202,12 @@ let r = class extends D(L, {
191
202
  _renderWeekDayAndMonthNameFormatSettings() {
192
203
  const t = Object.keys(
193
204
  z
194
- ).map((e) => a`<luzmo-action-button value=${e}>
205
+ ).map((e) => s`<luzmo-action-button value=${e}>
195
206
  ${z[e]()}
196
207
  </luzmo-action-button>`);
197
- return a` <div class="setting">
208
+ return s` <div class="setting">
198
209
  <luzmo-field-label for="weekday-and-month-in-year-format"
199
- >${i("Format", {
210
+ >${l("Format", {
200
211
  desc: "Label for format setting"
201
212
  })}</luzmo-field-label
202
213
  >
@@ -214,9 +225,9 @@ let r = class extends D(L, {
214
225
  </div>`;
215
226
  }
216
227
  _renderMonthNameFormatSettings() {
217
- return a` <div class="setting">
228
+ return s` <div class="setting">
218
229
  <luzmo-field-label for="month-name-format"
219
- >${i("Format", {
230
+ >${l("Format", {
220
231
  desc: "Label for format setting"
221
232
  })}</luzmo-field-label
222
233
  >
@@ -230,10 +241,10 @@ let r = class extends D(L, {
230
241
  @change=${this._setMonthNameFormat}
231
242
  >
232
243
  <luzmo-action-button value="short">
233
- ${i("Short", { desc: "Short format option" })}
244
+ ${l("Short", { desc: "Short format option" })}
234
245
  </luzmo-action-button>
235
246
  <luzmo-action-button value="long">
236
- ${i("Long", { desc: "Long format option" })}
247
+ ${l("Long", { desc: "Long format option" })}
237
248
  </luzmo-action-button>
238
249
  </luzmo-action-group>
239
250
  </div>`;
@@ -241,13 +252,13 @@ let r = class extends D(L, {
241
252
  _renderWeekFormatSettings() {
242
253
  var o;
243
254
  const t = ((o = this._localeFormats) == null ? void 0 : o.smartDateFormats) ?? _, e = t.find(
244
- (l) => l.mmdd === !0 && l.separator === this._dateSeparator && l.monthType === "number"
245
- ), s = t.find(
246
- (l) => l.mmdd === !1 && l.separator === this._dateSeparator && l.monthType === "number"
255
+ (i) => i.mmdd === !0 && i.separator === this._dateSeparator && i.monthType === "number"
256
+ ), a = t.find(
257
+ (i) => i.mmdd === !1 && i.separator === this._dateSeparator && i.monthType === "number"
247
258
  );
248
- return a` <div class="setting">
259
+ return s` <div class="setting">
249
260
  <luzmo-field-label for="week-format"
250
- >${i("Format", {
261
+ >${l("Format", {
251
262
  desc: "Label for format setting"
252
263
  })}</luzmo-field-label
253
264
  >
@@ -265,7 +276,7 @@ let r = class extends D(L, {
265
276
  {
266
277
  ...this._currentSlotContent,
267
278
  type: "datetime",
268
- format: s == null ? void 0 : s.key
279
+ format: a == null ? void 0 : a.key
269
280
  },
270
281
  {
271
282
  localFormats: this._localeFormats,
@@ -291,13 +302,13 @@ let r = class extends D(L, {
291
302
  }
292
303
  _renderWeekStartsOnSettings() {
293
304
  const t = Object.keys(g).map(
294
- (e) => a`<luzmo-menu-item value=${e}>
305
+ (e) => s`<luzmo-menu-item value=${e}>
295
306
  ${g[e]()}
296
307
  </luzmo-menu-item>`
297
308
  );
298
- return a`<div class="setting">
309
+ return s`<div class="setting">
299
310
  <luzmo-field-label for="week-start"
300
- >${i("Week starts on", {
311
+ >${l("Week starts on", {
301
312
  desc: "Label for week start setting"
302
313
  })}</luzmo-field-label
303
314
  >
@@ -313,9 +324,9 @@ let r = class extends D(L, {
313
324
  </div>`;
314
325
  }
315
326
  _renderMonthNameSettings() {
316
- return a`<div class="settings-">
327
+ return s`<div class="settings-">
317
328
  <luzmo-field-label for="month-name"
318
- >${i("Month", { desc: "Month format setting" })}</luzmo-field-label
329
+ >${l("Month", { desc: "Month format setting" })}</luzmo-field-label
319
330
  >
320
331
  <luzmo-action-button
321
332
  id="month-name"
@@ -328,17 +339,17 @@ let r = class extends D(L, {
328
339
  <luzmo-icon
329
340
  slot="icon"
330
341
  .size=${this.size}
331
- .icon=${this._monthName ? p : c}
342
+ .icon=${this._monthName ? c : p}
332
343
  ></luzmo-icon>
333
- ${i("Name")}
344
+ ${l("Name")}
334
345
  </luzmo-action-button>
335
346
  </div>`;
336
347
  }
337
348
  _renderDateFormatSettings() {
338
349
  const t = this._dateSeparator === "~" ? "/" : this._dateSeparator;
339
- return a`<div class="setting">
350
+ return s`<div class="setting">
340
351
  <luzmo-field-label for="date-format"
341
- >${i("Format", {
352
+ >${l("Format", {
342
353
  desc: "Label for format setting"
343
354
  })}</luzmo-field-label
344
355
  >
@@ -350,7 +361,7 @@ let r = class extends D(L, {
350
361
  @change=${this._setDateFormat}
351
362
  >
352
363
  <luzmo-menu-item value="auto">
353
- ${i("Auto", { desc: "Automatic setting of the option" })}
364
+ ${l("Auto", { desc: "Automatic setting of the option" })}
354
365
  </luzmo-menu-item>
355
366
  <luzmo-menu-item value="mmdd">12${t}31</luzmo-menu-item>
356
367
  <luzmo-menu-item value="ddmm">31${t}12</luzmo-menu-item>
@@ -359,13 +370,13 @@ let r = class extends D(L, {
359
370
  }
360
371
  _renderSeparatorSettings() {
361
372
  const t = Object.keys(y).map(
362
- (e) => a`<luzmo-menu-item value=${e}>
373
+ (e) => s`<luzmo-menu-item value=${e}>
363
374
  ${y[e]()}
364
375
  </luzmo-menu-item>`
365
376
  );
366
- return a`<div class="setting">
377
+ return s`<div class="setting">
367
378
  <luzmo-field-label for="date-separator"
368
- >${i("Separator", {
379
+ >${l("Separator", {
369
380
  desc: "Label for date separator setting"
370
381
  })}</luzmo-field-label
371
382
  >
@@ -381,9 +392,9 @@ let r = class extends D(L, {
381
392
  </div>`;
382
393
  }
383
394
  _render24hFormatSettings() {
384
- return a`<div class="settings-">
395
+ return s`<div class="settings-">
385
396
  <luzmo-field-label for="format-24h"
386
- >${i("24h", {
397
+ >${l("24h", {
387
398
  desc: "Label for 24h format setting"
388
399
  })}</luzmo-field-label
389
400
  >
@@ -398,15 +409,15 @@ let r = class extends D(L, {
398
409
  <luzmo-icon
399
410
  slot="icon"
400
411
  .size=${this.size}
401
- .icon=${this._24hFormat ? p : c}
412
+ .icon=${this._24hFormat ? c : p}
402
413
  ></luzmo-icon>
403
414
  </luzmo-action-button>
404
415
  </div>`;
405
416
  }
406
417
  _renderWeekdaySettings() {
407
- return a`<div class="settings-">
418
+ return s`<div class="settings-">
408
419
  <luzmo-field-label for="weekday"
409
- >${i("Weekday", {
420
+ >${l("Weekday", {
410
421
  desc: "Label for weekday setting"
411
422
  })}</luzmo-field-label
412
423
  >
@@ -421,39 +432,22 @@ let r = class extends D(L, {
421
432
  <luzmo-icon
422
433
  slot="icon"
423
434
  .size=${this.size}
424
- .icon=${this._weekDay ? p : c}
435
+ .icon=${this._weekDay ? c : p}
425
436
  ></luzmo-icon>
426
- ${i("Show")}
437
+ ${l("Show")}
427
438
  </luzmo-action-button>
428
439
  </div>`;
429
440
  }
430
- _renderExampleFormat() {
431
- return a`<span class="example">
432
- ${f(
433
- {
434
- ...this._currentSlotContent,
435
- type: "datetime"
436
- },
437
- {
438
- localFormats: this._localeFormats,
439
- level: this._dateLevel
440
- }
441
- )(!this._displayAs || this._displayAs === "default" ? /* @__PURE__ */ new Date() : 1)}
442
- </span>
443
- ${(this._dateSeparator === "~" || this._dateFormat === "auto") && !this._monthName ? a`<span class="example-language">
444
- (${this.contentLanguage})
445
- </span>` : ""}`;
446
- }
447
441
  _renderAllSettings() {
448
- return a`<div class="settings-container">
449
- ${this._dateLevel && ![1, 9].includes(this._dateLevel) ? a` <div class="settings-row">
442
+ return s`<div class="settings-container">
443
+ ${this._dateLevel && ![1, 9].includes(this._dateLevel) ? s` <div class="settings-row">
450
444
  ${this._renderDisplaySettings()}
451
445
  ${this._dateLevel && this._dateLevel >= 5 && this._displayAs === "day_in_week" ? this._renderWeekStartsOnSettings() : ""}
452
446
  </div>` : ""}
453
- ${["month_in_year", "day_in_week"].includes(this._displayAs ?? "") ? a` <div class="settings-row">
447
+ ${["month_in_year", "day_in_week"].includes(this._displayAs ?? "") ? s` <div class="settings-row">
454
448
  ${this._renderWeekDayAndMonthNameFormatSettings()}
455
449
  </div>` : ""}
456
- ${this._dateLevel && this._dateLevel > 1 && this._displayAs === "default" ? a` <div class="settings-row">
450
+ ${this._dateLevel && this._dateLevel > 1 && this._displayAs === "default" ? s` <div class="settings-row">
457
451
  ${this._dateLevel && this._dateLevel !== 4 && this._dateLevel !== 2 ? this._renderMonthNameSettings() : ""}
458
452
  ${this._dateLevel && this._dateLevel !== 4 && this._dateLevel > 2 && this._monthName ? this._renderMonthNameFormatSettings() : ""}
459
453
  ${this._dateLevel && this._dateLevel === 4 && !this._monthName ? this._renderWeekFormatSettings() : ""}
@@ -462,19 +456,11 @@ let r = class extends D(L, {
462
456
  ${this._dateLevel && this._dateLevel >= 5 && this._monthName ? this._renderWeekdaySettings() : ""}
463
457
  ${this._dateLevel && this._dateLevel > 5 ? this._render24hFormatSettings() : ""}
464
458
  </div>` : ""}
465
- <div class="settings-row">
466
- <div class="example-container">
467
- <span class="example-label"
468
- >${i("Example:", { desc: "Label for example format" })}</span
469
- >
470
- ${this._renderExampleFormat()}
471
- </div>
472
- </div>
473
459
  </div>`;
474
460
  }
475
461
  render() {
476
462
  return this._loadLocaleFormatsConfig.render({
477
- pending: () => a`<luzmo-progress-circle
463
+ pending: () => s`<luzmo-progress-circle
478
464
  indeterminate
479
465
  .size=${this.size}
480
466
  ></luzmo-progress-circle>`,
@@ -526,7 +512,7 @@ m([
526
512
  n("#format-24h")
527
513
  ], r.prototype, "_format24hElement", 2);
528
514
  r = m([
529
- $()
515
+ x()
530
516
  ], r);
531
517
  customElements.get("luzmo-display-settings-datetime") || customElements.define(
532
518
  "luzmo-display-settings-datetime",
@@ -535,7 +521,7 @@ customElements.get("luzmo-display-settings-datetime") || customElements.define(
535
521
  const O = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
536
522
  __proto__: null,
537
523
  default: v
538
- }, Symbol.toStringTag, { value: "Module" })), T = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
524
+ }, Symbol.toStringTag, { value: "Module" })), I = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
539
525
  __proto__: null,
540
526
  default: v
541
527
  }, Symbol.toStringTag, { value: "Module" }));
@@ -17,7 +17,7 @@
17
17
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
18
  * SOFTWARE.
19
19
  * */
20
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../set-locale-DCPlazsZ.cjs"),A=require("../localized-decorator-DIXYZ3RL.cjs");require("../index-Dy_5M3M5.cjs");require("../index-CnP-Q5Bw.cjs");require("../index-j8UKjHqY.cjs");require("../index-tXl_aMnZ.cjs");require("../index-MPM_B4re.cjs");require("../index-Ck5VRoXN.cjs");require("../index-BoXbQm2o.cjs");const f=require("../decompose-numeric-format-B3rVVHpO.cjs"),o=require("../property-Cu4Q1hS4.cjs"),p=require("../luzmo-icons-DonyjSXg.cjs"),D=require("../index-CUvucmA0.cjs");require("../index-CYeQkVeJ.cjs");const y=require("../calculate-data-item-icon-Dn-9Kd0U.cjs"),z=require("../localize-r7ALOUy_.cjs"),N=require("../state-fyl3IYMu.cjs"),g=require("../query-D5qWDopr.cjs"),w=require("../focusable-DAGGGYyz.cjs"),b=require("../sized-mixin-j_7aJM4b.cjs"),x=":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))}.dataset-header{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;font-weight:600;text-transform:uppercase;margin:.5rem 1rem}.no-weight-label{margin-left:1rem}.with-secondary-icon{clip-path:polygon(0 0,60% 0,65% 60%,100% 65%,100% 100%,0 100%)}.secondary-icon{position:absolute;bottom:45%;left:60%;width:auto;font-size:.75em;line-height:1}.data-icon-type{width:1.5rem;text-align:center;position:relative;display:inline-block}: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 )}",C={sum:()=>n.msg("Sum",{desc:"Numeric Aggregation option"}),cumulativesum:()=>n.msg("Cumulative sum",{desc:"Numeric Aggregation option"}),average:()=>n.msg("Average",{desc:"Numeric Aggregation option"}),median:()=>n.msg("Median",{desc:"Numeric Aggregation option"}),count:()=>n.msg("Count",{desc:"Numeric Aggregation option"}),distinctcount:()=>n.msg("Distinct count",{desc:"Numeric Aggregation option"}),min:()=>n.msg("Minimum",{desc:"Numeric Aggregation option"}),max:()=>n.msg("Maximum",{desc:"Numeric Aggregation option"}),stddev:()=>n.msg("Standard deviation",{desc:"Numeric Aggregation option"}),rate:()=>n.msg("Rate",{desc:"Numeric Aggregation option"})},L={general:"123",percentage:"%",scientific:"SI"},F={time:()=>n.msg("Time",{desc:"Time format option"}),short:()=>n.msg("Short",{desc:"Short format option"}),long:()=>n.msg("Long",{desc:"Long format option"})},S={Auto:{auto:!0,label:()=>n.msg("Auto",{desc:"Automatic setting of the option"})},"1,000.00":{auto:!1,label:()=>"1,000.00",thousandSeparator:",",decimalSeparator:".",hiddenFor:"scientific"},"1.000,00":{auto:!1,label:()=>"1.000,00",thousandSeparator:".",decimalSeparator:",",hiddenFor:"scientific"},"1000.00":{auto:!1,label:()=>"1000.00",decimalSeparator:"."},"1000,00":{auto:!1,label:()=>"1000,00",decimalSeparator:","}},E={levels:[{level:1,label:"years"},{level:2,label:"quarters"},{level:3,label:"months"},{level:4,label:"weeks"},{level:5,label:"days"},{level:6,label:"hours"},{level:7,label:"minutes"},{level:8,label:"seconds"},{level:9,label:"milliseconds"}]};var q=Object.defineProperty,I=Object.getOwnPropertyDescriptor,l=(v,e,t,i)=>{for(var s=i>1?void 0:i?I(e,t):e,a=v.length-1,r;a>=0;a--)(r=v[a])&&(s=(i?r(e,t,s):r(s))||s);return i&&s&&q(e,t,s),s};exports.LuzmoDisplaySettingsNumeric=class extends b.SizedMixin(w.LuzmoElement,{validSizes:Object.values(b.ElementSizes)}){constructor(){super(...arguments),this.language="en",this.slotContent={},this.measureColumns=[],this._durationLevels=[],this._renderDurationLevelMenu=!1,this._sendEvent=()=>{const e={...this.slotContent};e.format=this._format,e.aggregationFunc=this._aggregationFunc,this._aggregationWeightColumn?e.aggregationWeight={...this._aggregationWeightColumn}:delete e.aggregationWeight,this._displayMode==="duration"?(e.duration=e.duration??{},e.duration.format=this._durationFormat,e.duration.levels=this._durationLevels):delete e.duration,this.dispatchEvent(new CustomEvent("slot-content-changed",{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:e}}))}}static get styles(){return[o.r(x)]}_parseSavedNumericFormatSettings(){var e,t,i,s,a,r,c,u,d,h;if(this._displayMode=((e=this.slotContent)==null?void 0:e.subtype)==="duration"?((s=(i=(t=this.slotContent)==null?void 0:t.duration)==null?void 0:i.levels)==null?void 0:s.length)===1?"numeric":"duration":"numeric",this._durationFormat=((r=(a=this.slotContent)==null?void 0:a.duration)==null?void 0:r.format)??"short",this._durationLevels=((u=(c=this.slotContent)==null?void 0:c.duration)==null?void 0:u.levels)??[1],this._displayMode==="duration")this._precision=2,this._commaDecimals=!1,this._thousandSeparator=!1;else{this._format=((d=this.slotContent)==null?void 0:d.format)??".0f";const m=f.decomposeNumericFormat(this._format??".0f");this._isAuto=((h=m.typeFormat)==null?void 0:h.includes("a"))??!1,["%","a%","y","ay"].includes(m.typeFormat)?this._displayAs="percentage":["s","as","w","aw"].includes(m.typeFormat)?this._displayAs="scientific":this._displayAs="general",this._precision=m.precision?Number.parseInt(m.precision.replace(".",""),10):this._displayAs==="scientific"?1:0,this._commaDecimals=["z","az","y","ay","w","aw"].includes(m.typeFormat),this._thousandSeparator=m.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")}}_setNumericDisplayAs(){var e,t;this._displayAs=((t=(e=this._displayAsElement)==null?void 0:e.selected)==null?void 0:t[0])??"general",this._displayAs==="scientific"&&(this._precision=Math.max(this._precision??0,1),this._thousandSeparator=!1),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_setNumericSeparators(e){const t=S[(e==null?void 0:e.detail)??"Auto"];this._thousandSeparator=[",","."].includes((t==null?void 0:t.thousandSeparator)??""),this._commaDecimals=(t==null?void 0:t.decimalSeparator)===",",this._isAuto=t==null?void 0:t.auto,this._setNumericFormat(),this._sendEvent()}_setPrecision(){this._precision=this._precisionElement.value,this._setNumericFormat(),this._sendEvent()}_setNumericFormat(){var i;let e="f";const t=this.slotContent.subtype==="duration"?this._durationLevels&&((i=this._durationLevels)==null?void 0:i.length)===1?"numeric":"duration":"numeric";this._maxDurationLevel=Math.min(...this._durationLevels),t==="duration"?(!["time","short","long"].includes(this._durationFormat??"")||this._maxDurationLevel<6&&this._durationFormat==="time")&&(this._durationFormat="short"):(this._displayAs==="general"&&this._commaDecimals?e="z":this._displayAs==="percentage"&&this._commaDecimals?e="y":this._displayAs==="scientific"&&this._commaDecimals?e="w":this._displayAs==="percentage"?e="%":this._displayAs==="scientific"&&(e="s"),this._format=(this._thousandSeparator||this._isAuto?",":"")+"."+this._precision+(this._isAuto?"a":"")+e)}_setAggregationFunc(){var a;const e=this._aggregationElement.value,t=this._aggregationFunc,i=this.slotContent.format;if(e!==(t==="weightedaverage"?"average":t)){if(this._aggregationFunc=e==="average"&&((a=this._aggregationWeightColumn)!=null&&a.column)?"weightedaverage":e,t==="rate"){const r=f.decomposeNumericFormat(i),c=["%","y","a%","ay"].includes(r.typeFormat);this.slotContent.subtype==="currency"&&c&&this._setNumericDisplayAs()}this._sendEvent(),(this._aggregationFunc==="rate"||t==="rate")&&this.requestUpdate()}}_setAggregationWeight(){var i;const e=this._aggregationWeightElement.value,t=this._aggregationFunc;if(e==="none")this._aggregationWeightColumn=void 0,this._aggregationFunc==="weightedaverage"&&(this._aggregationFunc="average");else{let s,a;for(const r of this.measureColumns??[]){const c=(i=r.columns)==null?void 0:i.find(u=>u.id===e);if(c){s=c,a=r.datasetId;break}}s&&(this._aggregationWeightColumn={column:s.id,set:a,columnSubType:s.subtype}),this._aggregationFunc==="average"&&(this._aggregationFunc="weightedaverage")}this._sendEvent(),this.requestUpdate(),(t==="weightedaverage"&&this._aggregationFunc==="average"||t==="average"&&this._aggregationFunc==="weightedaverage")&&this.requestUpdate()}_setDurationLevels(){const e=this._durationLevels,t=this._durationLevelsElement.value.split(",").filter(i=>i!=="").map(i=>Number.parseInt(i,10));this._durationLevels=((t==null?void 0:t.length)??0)>=1?t:e,this._maxDurationLevel=Math.min(...this._durationLevels),this._fillTimeDurationLevels(),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_setDurationFormat(){var e,t;this._durationFormat=(t=(e=this._durationFormatElement)==null?void 0:e.selected)==null?void 0:t[0],this._fillTimeDurationLevels(),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_fillTimeDurationLevels(){if(this._durationFormat==="time"){const e=this._durationLevels.sort().at(-1);if([7,8,9].includes(e)){const t={lev7:[6],lev8:[6,7],lev9:[6,7,8]};for(const i of t["lev"+e])this._durationLevels.includes(i)||this._durationLevels.push(i);this._durationLevels=[...this._durationLevels].sort()}}}willUpdate(e){var t,i,s,a,r;e.has("slotContent")&&(this._parseSavedNumericFormatSettings(),this._aggregationFunc=((t=this.slotContent)==null?void 0:t.aggregationFunc)??(((i=this.slotContent)==null?void 0:i.type)==="numeric"?"sum":"count"),this._aggregationWeightColumn=(s=this.slotContent)==null?void 0:s.aggregationWeight,this._isFormula=((a=this.slotContent)==null?void 0:a.formula)||((r=this.slotContent)==null?void 0:r.formulaId)),e.has("language")&&this.language!==n.getLocale()&&([...n.targetLocales].includes(this.language??"en")||this.language==="en")&&n.setLocale(this.language)}firstUpdated(){var e;(e=this.slotContent)!=null&&e.duration&&this._durationLevelsOverlay.addEventListener("slottable-request",t=>{this._renderDurationLevelMenu=t.data!==D.a})}_renderDurationLevelsSettings(){const e=E.levels.map(t=>{let i=!1;return this._durationFormat==="time"&&t.level>=6&&this._durationLevels.includes(t.level)&&t.level!==Math.max(...this._durationLevels)&&(i=!0),this._durationLevels.length===1&&this._durationLevels.includes(t.level)&&(i=!0),o.x`<luzmo-menu-item
20
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../set-locale-DCPlazsZ.cjs"),A=require("../localized-decorator-DIXYZ3RL.cjs");require("../index-Dy_5M3M5.cjs");require("../index-CnP-Q5Bw.cjs");require("../index-j8UKjHqY.cjs");require("../index-tXl_aMnZ.cjs");require("../index-MPM_B4re.cjs");require("../index-Ck5VRoXN.cjs");require("../index-BoXbQm2o.cjs");const _=require("../decompose-numeric-format-B3rVVHpO.cjs"),o=require("../property-Cu4Q1hS4.cjs"),g=require("../luzmo-icons-DonyjSXg.cjs"),D=require("../index-CUvucmA0.cjs");require("../index-CYeQkVeJ.cjs");const f=require("../calculate-data-item-icon-Dn-9Kd0U.cjs"),y=require("../localize-r7ALOUy_.cjs"),N=require("../state-fyl3IYMu.cjs"),c=require("../query-D5qWDopr.cjs"),w=require("../focusable-DAGGGYyz.cjs"),z=require("../sized-mixin-j_7aJM4b.cjs"),x=":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))}.dataset-header{max-width:100%;font-weight:600;text-transform:uppercase;margin:.5rem 1rem;color:var(--luzmo-font-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:default}.no-weight-label{margin-left:1rem}.with-secondary-icon{clip-path:polygon(0 0,60% 0,65% 60%,100% 65%,100% 100%,0 100%)}.secondary-icon{position:absolute;bottom:45%;left:60%;width:auto;font-size:.75em;line-height:1}.data-icon-type{width:1.5rem;text-align:center;position:relative;display:inline-block}: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 )}",C={sum:()=>n.msg("Sum",{desc:"Numeric Aggregation option"}),cumulativesum:()=>n.msg("Cumulative sum",{desc:"Numeric Aggregation option"}),average:()=>n.msg("Average",{desc:"Numeric Aggregation option"}),median:()=>n.msg("Median",{desc:"Numeric Aggregation option"}),count:()=>n.msg("Count",{desc:"Numeric Aggregation option"}),distinctcount:()=>n.msg("Distinct count",{desc:"Numeric Aggregation option"}),min:()=>n.msg("Minimum",{desc:"Numeric Aggregation option"}),max:()=>n.msg("Maximum",{desc:"Numeric Aggregation option"}),stddev:()=>n.msg("Standard deviation",{desc:"Numeric Aggregation option"}),rate:()=>n.msg("Rate",{desc:"Numeric Aggregation option"})},b={general:"123",percentage:"%",scientific:"SI"},L={time:()=>n.msg("Time",{desc:"Time format option"}),short:()=>n.msg("Short",{desc:"Short format option"}),long:()=>n.msg("Long",{desc:"Long format option"})},F={Auto:{auto:!0,label:()=>n.msg("Auto",{desc:"Automatic setting of the option"})},"1,000.00":{auto:!1,label:()=>"1,000.00",thousandSeparator:",",decimalSeparator:".",hiddenFor:"scientific"},"1.000,00":{auto:!1,label:()=>"1.000,00",thousandSeparator:".",decimalSeparator:",",hiddenFor:"scientific"},"1000.00":{auto:!1,label:()=>"1000.00",decimalSeparator:"."},"1000,00":{auto:!1,label:()=>"1000,00",decimalSeparator:","}},E={levels:[{level:1,label:"years"},{level:2,label:"quarters"},{level:3,label:"months"},{level:4,label:"weeks"},{level:5,label:"days"},{level:6,label:"hours"},{level:7,label:"minutes"},{level:8,label:"seconds"},{level:9,label:"milliseconds"}]};var q=Object.defineProperty,I=Object.getOwnPropertyDescriptor,u=(d,e,t,i)=>{for(var s=i>1?void 0:i?I(e,t):e,a=d.length-1,r;a>=0;a--)(r=d[a])&&(s=(i?r(e,t,s):r(s))||s);return i&&s&&q(e,t,s),s};exports.LuzmoDisplaySettingsNumeric=class extends z.SizedMixin(w.LuzmoElement,{validSizes:Object.values(z.ElementSizes)}){constructor(){super(...arguments),this.language="en",this.slotContent={},this.measureColumns=[],this._durationLevels=[],this._renderDurationLevelMenu=!1,this._sendEvent=()=>{const e={...this.slotContent};e.format=this._format,e.aggregationFunc=this._aggregationFunc,this._aggregationWeightColumn?e.aggregationWeight={...this._aggregationWeightColumn}:delete e.aggregationWeight,this._displayMode==="duration"?(e.duration=e.duration??{},e.duration.format=this._durationFormat,e.duration.levels=this._durationLevels):delete e.duration,this.dispatchEvent(new CustomEvent("slot-content-changed",{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:e}}))}}static get styles(){return[o.r(x)]}_parseSavedNumericFormatSettings(){var e,t,i,s,a,r,m;if(this._displayMode=((e=this.slotContent)==null?void 0:e.subtype)==="duration"?"duration":"numeric",this._durationFormat=((i=(t=this.slotContent)==null?void 0:t.duration)==null?void 0:i.format)??"short",this._durationLevels=((a=(s=this.slotContent)==null?void 0:s.duration)==null?void 0:a.levels)??[1],this._displayMode==="duration")this._precision=2,this._commaDecimals=!1,this._thousandSeparator=!1;else{this._format=((r=this.slotContent)==null?void 0:r.format)??".0f";const l=_.decomposeNumericFormat(this._format??".0f");this._isAuto=((m=l.typeFormat)==null?void 0:m.includes("a"))??!1,["%","a%","y","ay"].includes(l.typeFormat)?this._displayAs="percentage":["s","as","w","aw"].includes(l.typeFormat)?this._displayAs="scientific":this._displayAs="general",this._precision=l.precision?Number.parseInt(l.precision.replace(".",""),10):this._displayAs==="scientific"?1:0,this._commaDecimals=["z","az","y","ay","w","aw"].includes(l.typeFormat),this._thousandSeparator=l.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")}}_setNumericDisplayAs(){var e,t;this._displayAs=((t=(e=this._displayAsElement)==null?void 0:e.selected)==null?void 0:t[0])??"general",this._displayAs==="scientific"&&(this._precision=Math.max(this._precision??0,1),this._thousandSeparator=!1),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_setNumericSeparators(e){const t=F[(e==null?void 0:e.detail)??"Auto"];this._thousandSeparator=[",","."].includes((t==null?void 0:t.thousandSeparator)??""),this._commaDecimals=(t==null?void 0:t.decimalSeparator)===",",this._isAuto=t==null?void 0:t.auto,this._setNumericFormat(),this._sendEvent()}_setPrecision(){this._precision=this._precisionElement.value,this._setNumericFormat(),this._sendEvent()}_setNumericFormat(){var i;let e="f";const t=this.slotContent.subtype==="duration"?this._durationLevels&&((i=this._durationLevels)==null?void 0:i.length)===1?"numeric":"duration":"numeric";this._maxDurationLevel=Math.min(...this._durationLevels),t==="duration"?(!["time","short","long"].includes(this._durationFormat??"")||this._maxDurationLevel<6&&this._durationFormat==="time")&&(this._durationFormat="short"):(this._displayAs==="general"&&this._commaDecimals?e="z":this._displayAs==="percentage"&&this._commaDecimals?e="y":this._displayAs==="scientific"&&this._commaDecimals?e="w":this._displayAs==="percentage"?e="%":this._displayAs==="scientific"&&(e="s"),this._format=(this._thousandSeparator||this._isAuto?",":"")+"."+this._precision+(this._isAuto?"a":"")+e)}_setAggregationFunc(){var a;const e=this._aggregationElement.value,t=this._aggregationFunc,i=this.slotContent.format;if(e!==(t==="weightedaverage"?"average":t)){if(this._aggregationFunc=e==="average"&&((a=this._aggregationWeightColumn)!=null&&a.column)?"weightedaverage":e,t==="rate"){const r=_.decomposeNumericFormat(i),m=["%","y","a%","ay"].includes(r.typeFormat);this.slotContent.subtype==="currency"&&m&&this._setNumericDisplayAs()}this._sendEvent(),(this._aggregationFunc==="rate"||t==="rate")&&this.requestUpdate()}}_setAggregationWeight(){var i;const e=this._aggregationWeightElement.value,t=this._aggregationFunc;if(e==="none")this._aggregationWeightColumn=void 0,this._aggregationFunc==="weightedaverage"&&(this._aggregationFunc="average");else{let s,a;for(const r of this.measureColumns??[]){const m=(i=r.columns)==null?void 0:i.find(l=>l.id===e);if(m){s=m,a=r.datasetId;break}}s&&(this._aggregationWeightColumn={column:s.id,set:a,columnSubType:s.subtype}),this._aggregationFunc==="average"&&(this._aggregationFunc="weightedaverage")}this._sendEvent(),this.requestUpdate(),(t==="weightedaverage"&&this._aggregationFunc==="average"||t==="average"&&this._aggregationFunc==="weightedaverage")&&this.requestUpdate()}_setDurationLevels(){const e=this._durationLevels,t=this._durationLevelsElement.value.split(",").filter(i=>i!=="").map(i=>Number.parseInt(i,10));this._durationLevels=((t==null?void 0:t.length)??0)>=1?t:e,this._maxDurationLevel=Math.min(...this._durationLevels),this._fillTimeDurationLevels(),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_setDurationFormat(){var e,t;this._durationFormat=(t=(e=this._durationFormatElement)==null?void 0:e.selected)==null?void 0:t[0],this._fillTimeDurationLevels(),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_fillTimeDurationLevels(){if(this._durationFormat==="time"){const e=this._durationLevels.sort().at(-1);if([7,8,9].includes(e)){const t={lev7:[6],lev8:[6,7],lev9:[6,7,8]};for(const i of t["lev"+e])this._durationLevels.includes(i)||this._durationLevels.push(i);this._durationLevels=[...this._durationLevels].sort()}}}willUpdate(e){var t,i,s,a,r;e.has("slotContent")&&(this._parseSavedNumericFormatSettings(),this._aggregationFunc=((t=this.slotContent)==null?void 0:t.aggregationFunc)??(((i=this.slotContent)==null?void 0:i.type)==="numeric"?"sum":"count"),this._aggregationWeightColumn=(s=this.slotContent)==null?void 0:s.aggregationWeight,this._isFormula=((a=this.slotContent)==null?void 0:a.formula)||((r=this.slotContent)==null?void 0:r.formulaId)),e.has("language")&&this.language!==n.getLocale()&&([...n.targetLocales].includes(this.language??"en")||this.language==="en")&&n.setLocale(this.language)}firstUpdated(){var e;(e=this.slotContent)!=null&&e.duration&&this._durationLevelsOverlay.addEventListener("slottable-request",t=>{this._renderDurationLevelMenu=t.data!==D.a})}_renderDurationLevelsSettings(){const e=E.levels.map(t=>{let i=!1;return this._durationFormat==="time"&&t.level>=6&&this._durationLevels.includes(t.level)&&t.level!==Math.max(...this._durationLevels)&&(i=!0),this._durationLevels.length===1&&this._durationLevels.includes(t.level)&&(i=!0),o.x`<luzmo-menu-item
21
21
  value=${t.level}
22
22
  ?selected=${this._durationLevels.includes(t.level)}
23
23
  ?disabled=${i}
@@ -31,7 +31,7 @@
31
31
  ${this._durationLevels.length}
32
32
  ${this._durationLevels.length===1?"level":"levels"} active
33
33
  <span class="duration-angle-down-icon">
34
- ${p.y3(p.T)}
34
+ ${g.y3(g.T)}
35
35
  </span>
36
36
  </luzmo-action-button>
37
37
  <luzmo-overlay
@@ -53,8 +53,8 @@
53
53
  </luzmo-menu>`:""}
54
54
  </luzmo-popover>
55
55
  </luzmo-overlay>
56
- </div>`}_renderDurationFormatSettings(){const e=Object.keys(F).map(t=>t==="time"&&(this._maxDurationLevel??1)<6?"":o.x`<luzmo-action-button value=${t}>
57
- ${F[t]()}
56
+ </div>`}_renderDurationFormatSettings(){const e=Object.keys(L).map(t=>t==="time"&&(this._maxDurationLevel??1)<6?"":o.x`<luzmo-action-button value=${t}>
57
+ ${L[t]()}
58
58
  </luzmo-action-button>`);return o.x` <div class="setting">
59
59
  <luzmo-field-label for="duration-format">
60
60
  ${n.msg("Format",{desc:"Label for format setting"})}
@@ -70,8 +70,8 @@
70
70
  >
71
71
  ${e}
72
72
  </luzmo-action-group>
73
- </div>`}_renderNumericDisplayAsSettings(){const e=Object.keys(L).map(t=>o.x`<luzmo-action-button value=${t}
74
- >${L[t]}</luzmo-action-button
73
+ </div>`}_renderNumericDisplayAsSettings(){const e=Object.keys(b).map(t=>o.x`<luzmo-action-button value=${t}
74
+ >${b[t]}</luzmo-action-button
75
75
  >`);return o.x`<div class="setting">
76
76
  <luzmo-field-label for="display-as">
77
77
  ${n.msg("Display as",{desc:"Label for display as setting for the datetime field"})}
@@ -87,7 +87,7 @@
87
87
  >
88
88
  ${e}
89
89
  </luzmo-action-group>
90
- </div>`}_renderNumericFormatSettings(){const e=Object.entries(S).filter(([,{hiddenFor:t}])=>!t||t!==this._displayAs).map(([t,{label:i}])=>o.x`<luzmo-menu-item value=${t}>${i()}</luzmo-menu-item>`);return o.x` <div class="setting">
90
+ </div>`}_renderNumericFormatSettings(){const e=Object.entries(F).filter(([,{hiddenFor:t}])=>!t||t!==this._displayAs).map(([t,{label:i}])=>o.x`<luzmo-menu-item value=${t}>${i()}</luzmo-menu-item>`);return o.x` <div class="setting">
91
91
  <luzmo-field-label for="format">
92
92
  ${n.msg("Format",{desc:"Label for format setting"})}
93
93
  </luzmo-field-label>
@@ -115,25 +115,25 @@
115
115
  ></luzmo-number-field>
116
116
  </div>`}_renderAggregationSettings(){var i;const e=Object.entries(C).filter(([s])=>{var a;return["count","distinctcount"].includes(s)||((a=this.slotContent)==null?void 0:a.type)==="numeric"}).map(([s,a])=>o.x`<luzmo-menu-item value=${s}>${a()}</luzmo-menu-item>`),t=[o.x`<luzmo-menu-item value="none" class="no-weight">
117
117
  <span class="no-weight-label">No weight</span>
118
- </luzmo-menu-item>`,...(this.measureColumns??[]).flatMap(s=>{const a=typeof s.datasetName=="object"?z.localize(s.datasetName,this.language):s.datasetName,r=o.x`<div class="dataset-header">
118
+ </luzmo-menu-item>`,...(this.measureColumns??[]).flatMap(s=>{const a=typeof s.datasetName=="object"?y.localize(s.datasetName,this.language):s.datasetName,r=o.x`<div class="dataset-header">
119
119
  ${a}
120
120
  <luzmo-tooltip self-managed placement="right" size=${this.size}>
121
121
  ${a}
122
122
  </luzmo-tooltip>
123
- </div>`,c=(s.columns??[]).map(u=>{const d=typeof u.name=="object"?z.localize(u.name,this.language):u.name,h=p.y3(y.calculateDataItemIcon(u,"s")),m=u.expression?y.calculateDataItemSecondaryIcon("derived","s"):void 0,_=!!m,$=_?o.x`<span class="secondary-icon"
124
- >${p.y3(m)}</span
125
- >`:o.E;return o.x`<luzmo-menu-item value=${u.id}>
123
+ </div>`,m=(s.columns??[]).map(l=>{const h=typeof l.name=="object"?y.localize(l.name,this.language):l.name,S=g.y3(f.calculateDataItemIcon(l,"s")),p=l.expression?f.calculateDataItemSecondaryIcon("derived","s"):void 0,v=!!p,$=v?o.x`<span class="secondary-icon"
124
+ >${g.y3(p)}</span
125
+ >`:o.E;return o.x`<luzmo-menu-item value=${l.id}>
126
126
  <span class="data-icon-type" slot="icon">
127
- <span class=${_?"with-secondary-icon":""}
128
- >${h}</span
127
+ <span class=${v?"with-secondary-icon":""}
128
+ >${S}</span
129
129
  >
130
130
  ${$}
131
131
  </span>
132
- <span class="column-label text-truncate">${d}</span>
132
+ <span class="column-label text-truncate">${h}</span>
133
133
  <luzmo-tooltip self-managed placement="right" size=${this.size}>
134
- ${d}
134
+ ${h}
135
135
  </luzmo-tooltip>
136
- </luzmo-menu-item>`});return[r,...c]})];return o.x`<div class="settings-row">
136
+ </luzmo-menu-item>`});return[r,...m]})];return o.x`<div class="settings-row">
137
137
  <div class="setting">
138
138
  <luzmo-field-label for="aggregation">
139
139
  ${n.msg("Aggregation",{desc:"Label for aggregation setting"})}
@@ -180,4 +180,4 @@
180
180
  </div>
181
181
  ${this._isFormula?o.E:this._renderAggregationSettings()}
182
182
  </div>
183
- </div>`}};l([o.n({type:String,reflect:!0})],exports.LuzmoDisplaySettingsNumeric.prototype,"language",2);l([o.n({type:Object,reflect:!0})],exports.LuzmoDisplaySettingsNumeric.prototype,"slotContent",2);l([o.n({type:Array,reflect:!1})],exports.LuzmoDisplaySettingsNumeric.prototype,"measureColumns",2);l([g.e("#display-as")],exports.LuzmoDisplaySettingsNumeric.prototype,"_displayAsElement",2);l([g.e("#precision")],exports.LuzmoDisplaySettingsNumeric.prototype,"_precisionElement",2);l([g.e("#aggregation")],exports.LuzmoDisplaySettingsNumeric.prototype,"_aggregationElement",2);l([g.e("#weighting-column")],exports.LuzmoDisplaySettingsNumeric.prototype,"_aggregationWeightElement",2);l([g.e("#duration-levels")],exports.LuzmoDisplaySettingsNumeric.prototype,"_durationLevelsElement",2);l([g.e("#duration-format")],exports.LuzmoDisplaySettingsNumeric.prototype,"_durationFormatElement",2);l([g.e("#duration-levels-overlay")],exports.LuzmoDisplaySettingsNumeric.prototype,"_durationLevelsOverlay",2);l([N.r()],exports.LuzmoDisplaySettingsNumeric.prototype,"_renderDurationLevelMenu",2);exports.LuzmoDisplaySettingsNumeric=l([A.localized()],exports.LuzmoDisplaySettingsNumeric);customElements.get("luzmo-display-settings-numeric")||customElements.define("luzmo-display-settings-numeric",exports.LuzmoDisplaySettingsNumeric);
183
+ </div>`}};u([o.n({type:String,reflect:!0})],exports.LuzmoDisplaySettingsNumeric.prototype,"language",2);u([o.n({type:Object,reflect:!0})],exports.LuzmoDisplaySettingsNumeric.prototype,"slotContent",2);u([o.n({type:Array,reflect:!1})],exports.LuzmoDisplaySettingsNumeric.prototype,"measureColumns",2);u([c.e("#display-as")],exports.LuzmoDisplaySettingsNumeric.prototype,"_displayAsElement",2);u([c.e("#precision")],exports.LuzmoDisplaySettingsNumeric.prototype,"_precisionElement",2);u([c.e("#aggregation")],exports.LuzmoDisplaySettingsNumeric.prototype,"_aggregationElement",2);u([c.e("#weighting-column")],exports.LuzmoDisplaySettingsNumeric.prototype,"_aggregationWeightElement",2);u([c.e("#duration-levels")],exports.LuzmoDisplaySettingsNumeric.prototype,"_durationLevelsElement",2);u([c.e("#duration-format")],exports.LuzmoDisplaySettingsNumeric.prototype,"_durationFormatElement",2);u([c.e("#duration-levels-overlay")],exports.LuzmoDisplaySettingsNumeric.prototype,"_durationLevelsOverlay",2);u([N.r()],exports.LuzmoDisplaySettingsNumeric.prototype,"_renderDurationLevelMenu",2);exports.LuzmoDisplaySettingsNumeric=u([A.localized()],exports.LuzmoDisplaySettingsNumeric);customElements.get("luzmo-display-settings-numeric")||customElements.define("luzmo-display-settings-numeric",exports.LuzmoDisplaySettingsNumeric);