@luzmo/analytics-components-kit 1.0.1-alpha.50 → 1.0.1-alpha.51
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/components/display-settings-numeric/helpers/constants.d.ts +1 -0
- package/components/display-settings-numeric/index.cjs +16 -10
- package/components/display-settings-numeric/index.js +52 -34
- package/components/draggable-data-item/draggable-data-item.d.ts +0 -1
- package/components/draggable-data-item/index.cjs +5 -8
- package/components/draggable-data-item/index.js +32 -38
- package/components/draggable-data-item-level/draggable-data-item-level.d.ts +1 -1
- package/components/draggable-data-item-level/index.cjs +6 -6
- package/components/draggable-data-item-level/index.js +106 -113
- package/components/droppable-slot/droppable-slot.d.ts +4 -1
- package/components/droppable-slot/index.cjs +14 -12
- package/components/droppable-slot/index.js +138 -118
- package/components/filter-item/index.cjs +1 -1
- package/components/filter-item/index.js +1 -1
- package/components/filter-value-picker-hierarchy/index.cjs +1 -1
- package/components/filter-value-picker-hierarchy/index.js +1 -1
- package/components/filter-value-picker-numeric/index.cjs +1 -1
- package/components/filter-value-picker-numeric/index.js +1 -1
- package/components/{index-Delpl7qa.js → index-Cyo2hwg7.js} +1 -1
- package/components/{index-eBsINoH9.cjs → index-DpHum3lw.cjs} +1 -1
- package/components/slot-menu/index.cjs +11 -11
- package/components/slot-menu/index.js +165 -157
- package/components/slot-menu/slot-menu.d.ts +1 -1
- package/custom-elements.json +19 -42
- package/item-definitions/box-plot/box-plot-options.config.d.ts +1 -1
- package/item-definitions/choropleth-map/choropleth-map-options.config.d.ts +1 -1
- package/item-definitions/hexbin-map/hexbin-map-options.config.d.ts +1 -1
- package/item-definitions/route-map/route-map-options.config.d.ts +1 -1
- package/item-definitions/spike-map/spike-map-options.config.d.ts +1 -1
- package/package.json +1 -1
- package/utils/data-broker/index.d.ts +1 -1
@@ -17,19 +17,20 @@
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
18
|
* SOFTWARE.
|
19
19
|
* */
|
20
|
-
import { a as
|
21
|
-
import { a as
|
20
|
+
import { a as k } from "../get-css-variable-YlLiVgo8.js";
|
21
|
+
import { a as w, r as z, i as S, s as $ } from "../index-Ct7UvUif.js";
|
22
22
|
import { l as E } from "../localized-decorator-Bl5gcI6n.js";
|
23
|
-
import { m as
|
23
|
+
import { m as g, g as D, t as L, s as O } from "../set-locale-GI34z_M7.js";
|
24
24
|
import { h as T } from "../task-Bh_X-xIU.js";
|
25
|
-
import { a8 as
|
25
|
+
import { a8 as v, ab as A, a7 as I } from "../luzmo-icons-CVeTZ59u.js";
|
26
26
|
import "../index-BmshD32H.js";
|
27
|
-
import {
|
28
|
-
import {
|
27
|
+
import { d as y } from "../index-Cyo2hwg7.js";
|
28
|
+
import { l as M } from "../localize-BX7q0S0M.js";
|
29
|
+
import { x as m, r as P, n as u } from "../property-DCzt3DR1.js";
|
29
30
|
import { r as U } from "../state-nDsQPund.js";
|
30
|
-
import { e as
|
31
|
-
import { L as
|
32
|
-
import { S as
|
31
|
+
import { e as x } from "../query-Ddbd72Um.js";
|
32
|
+
import { L as B } from "../focusable-BbymtxWI.js";
|
33
|
+
import { S as F } from "../sized-mixin-BGzkX2g1.js";
|
33
34
|
import "../slot-menu/index.js";
|
34
35
|
const _ = () => {
|
35
36
|
if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
|
@@ -43,7 +44,7 @@ _();
|
|
43
44
|
* Copyright 2021 Google LLC
|
44
45
|
* SPDX-License-Identifier: BSD-3-Clause
|
45
46
|
*/
|
46
|
-
class
|
47
|
+
class N {
|
47
48
|
get value() {
|
48
49
|
return this.o;
|
49
50
|
}
|
@@ -76,33 +77,33 @@ class G {
|
|
76
77
|
* Copyright 2021 Google LLC
|
77
78
|
* SPDX-License-Identifier: BSD-3-Clause
|
78
79
|
*/
|
79
|
-
class
|
80
|
+
class j extends Event {
|
80
81
|
constructor(o, e) {
|
81
82
|
super("context-provider", { bubbles: !0, composed: !0 }), this.context = o, this.contextTarget = e;
|
82
83
|
}
|
83
84
|
}
|
84
|
-
class
|
85
|
+
class G extends N {
|
85
86
|
constructor(o, e, l) {
|
86
|
-
var r,
|
87
|
-
super(e.context !== void 0 ? e.initialValue : l), this.onContextRequest = (
|
88
|
-
if (
|
89
|
-
const
|
90
|
-
|
91
|
-
}, this.onProviderRequest = (
|
92
|
-
if (
|
93
|
-
const
|
94
|
-
for (const [
|
95
|
-
|
96
|
-
}, this.host = o, e.context !== void 0 ? this.context = e.context : this.context = e, this.attachListeners(), (
|
87
|
+
var r, a;
|
88
|
+
super(e.context !== void 0 ? e.initialValue : l), this.onContextRequest = (i) => {
|
89
|
+
if (i.context !== this.context) return;
|
90
|
+
const s = i.contextTarget ?? i.composedPath()[0];
|
91
|
+
s !== this.host && (i.stopPropagation(), this.addCallback(i.callback, s, i.subscribe));
|
92
|
+
}, this.onProviderRequest = (i) => {
|
93
|
+
if (i.context !== this.context || (i.contextTarget ?? i.composedPath()[0]) === this.host) return;
|
94
|
+
const s = /* @__PURE__ */ new Set();
|
95
|
+
for (const [n, { consumerHost: p }] of this.subscriptions) s.has(n) || (s.add(n), p.dispatchEvent(new w(this.context, p, n, !0)));
|
96
|
+
i.stopPropagation();
|
97
|
+
}, this.host = o, e.context !== void 0 ? this.context = e.context : this.context = e, this.attachListeners(), (a = (r = this.host).addController) == null || a.call(r, this);
|
97
98
|
}
|
98
99
|
attachListeners() {
|
99
100
|
this.host.addEventListener("context-request", this.onContextRequest), this.host.addEventListener("context-provider", this.onProviderRequest);
|
100
101
|
}
|
101
102
|
hostConnected() {
|
102
|
-
this.host.dispatchEvent(new
|
103
|
+
this.host.dispatchEvent(new j(this.context, this.host));
|
103
104
|
}
|
104
105
|
}
|
105
|
-
class
|
106
|
+
class R {
|
106
107
|
constructor() {
|
107
108
|
this.slotContents = z([]), this.slotsContents = z([]), this.periodOverPeriodEnabled = z(!1), this._popEnabledChartTypes = [
|
108
109
|
"area-chart",
|
@@ -121,16 +122,16 @@ class F {
|
|
121
122
|
])).has(o);
|
122
123
|
}
|
123
124
|
setPeriodOverPeriodEnabled(o) {
|
124
|
-
var
|
125
|
-
const e = this.slotsContents.get() ?? [], l = ((
|
126
|
-
(
|
127
|
-
)) == null ? void 0 :
|
128
|
-
return this.periodOverPeriodEnabled.set(
|
125
|
+
var s, n;
|
126
|
+
const e = this.slotsContents.get() ?? [], l = ((s = e.find(
|
127
|
+
(p) => ["y-axis", "x-axis"].includes(p.name)
|
128
|
+
)) == null ? void 0 : s.content) ?? [], r = (l == null ? void 0 : l[0]) ?? null, a = ((n = e.find((p) => p.name === "measure")) == null ? void 0 : n.content) ?? [], i = r && this._popEnabledChartTypes.includes(o) && r.type === "datetime" && !this.isArrayColumnType(r.type) && !r.datetimeDisplayMode && r.level !== 4 && a.length > 0;
|
129
|
+
return this.periodOverPeriodEnabled.set(i), i;
|
129
130
|
}
|
130
131
|
/** Replace the full list (e.g. after dropping or re-ordering). */
|
131
132
|
setContents(o, e) {
|
132
133
|
if (this.slotContents.set(o), this.activeIndex.get() >= o.length && this.activeIndex.set(o.length > 0 ? o.length - 1 : 0), e) {
|
133
|
-
const l = structuredClone(this.slotsContents.get()) ?? [], r = l.find((
|
134
|
+
const l = structuredClone(this.slotsContents.get()) ?? [], r = l.find((a) => a.name === e);
|
134
135
|
r && (r.content = o), this.setFullContents(l);
|
135
136
|
}
|
136
137
|
}
|
@@ -154,20 +155,20 @@ class F {
|
|
154
155
|
this.slotContents.set(e), this.activeIndex.get() >= e.length && this.activeIndex.set(e.length > 0 ? e.length - 1 : 0);
|
155
156
|
}
|
156
157
|
}
|
157
|
-
const
|
158
|
-
Category: () =>
|
159
|
-
Measure: () =>
|
160
|
-
Legend: () =>
|
161
|
-
"Y-Axis": () =>
|
162
|
-
"X-Axis": () =>
|
163
|
-
"Group by": () =>
|
158
|
+
const q = ":host{font-family:var(--luzmo-droppable-slot-font-family, var(--luzmo-font-family));--slot-height: var( --luzmo-droppable-slot-height, var(--droppable-slot-height) )}.droppable-slot-wrapper{position:relative;width:var(--slot-height);min-width:var(--slot-height);height:auto;overflow:visible}.droppable-slot[filled]{border:var(--luzmo-droppable-slot-filled-border-width, var(--droppable-slot-filled-border-width)) var(--luzmo-droppable-slot-filled-border-style, var(--droppable-slot-filled-border-style)) var(--luzmo-droppable-slot-filled-border-color, var(--droppable-slot-filled-border-color));background-color:var(--luzmo-droppable-slot-filled-background-color, var(--droppable-slot-filled-background-color));color:var(--luzmo-droppable-slot-filled-color, var(--droppable-slot-filled-color));padding-right:0;gap:var(--luzmo-spacing-5)}.droppable-slot[filled]>*:not(luzmo-overlay){cursor:pointer}.droppable-slot{background-color:var(--luzmo-droppable-slot-background-color, var(--droppable-slot-background-color));color:var(--luzmo-droppable-slot-font-color, var(--droppable-slot-font-color));border:var(--luzmo-droppable-slot-border-width, var(--droppable-slot-border-width)) var(--luzmo-droppable-slot-border-style, var(--droppable-slot-border-style)) var(--luzmo-droppable-slot-border-color, var(--droppable-slot-border-color));display:flex;justify-content:space-between;align-items:center;padding-left:var(--luzmo-droppable-slot-edge-to-label, var(--droppable-slot-edge-to-label));padding-right:var(--luzmo-droppable-slot-label-to-controls, var(--droppable-slot-label-to-controls));border-radius:var(--luzmo-droppable-slot-border-radius, var(--droppable-slot-border-radius));height:var(--luzmo-droppable-slot-height, var(--droppable-slot-height))}:host([accept-drag]) .droppable-slot{background-color:var(--luzmo-droppable-slot-accept-drag-background-color, var(--droppable-slot-accept-drag-background-color));color:var(--luzmo-droppable-slot-accept-drag-font-color, var(--droppable-slot-accept-drag-font-color));border-color:var(--luzmo-droppable-slot-accept-drag-border-color, var(--droppable-slot-accept-drag-border-color));animation:dropelementpulse 1s infinite ease-in-out}:host([accept-drag]) .controls{background-color:var(--luzmo-droppable-slot-accept-drag-controls-background-color, var(--droppable-slot-accept-drag-controls-background-color));color:var(--luzmo-droppable-slot-accept-drag-controls-color, var(--droppable-slot-accept-drag-controls-color))}@keyframes dropelementpulse{0%{box-shadow:0 0 0 0 var(--luzmo-droppable-slot-pulse-color, var(--droppable-slot-pulse-color)),0 0 0 0 var(--luzmo-droppable-slot-pulse-color, var(--droppable-slot-pulse-color))}to{box-shadow:0 0 0 1rem transparent,0 0 0 1rem transparent}}:host([disabled]) .droppable-slot{background-color:var(--luzmo-droppable-slot-background-color-disabled, var(--droppable-slot-background-color-disabled));color:var(--luzmo-droppable-slot-color-disabled, var(--droppable-slot-color-disabled));cursor:not-allowed}:host([disabled]) .drag-handle-icon{opacity:.25;font-size:12px}.drag-handle-icon{opacity:.5;font-size:12px}.droppable-slot-label{font-size:var(--luzmo-droppable-slot-label-font-size, var(--droppable-slot-label-font-size));flex-grow:1;margin-right:var(--luzmo-droppable-slot-text-to-controls, var(--droppable-slot-text-to-controls));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.controls{height:100%;display:flex;align-items:center;gap:var(--luzmo-droppable-slot-controls-gap, var(--droppable-slot-controls-gap));background-color:var(--luzmo-droppable-slot-controls-background-color, var(--droppable-slot-controls-background-color));color:var(--luzmo-droppable-slot-controls-color, var(--droppable-slot-controls-color));margin-right:var(--luzmo-droppable-slot-controls-to-edge, var(--droppable-slot-controls-to-edge));padding:0 var(--luzmo-droppable-slot-controls-horizontal-padding, var(--droppable-slot-controls-horizontal-padding))}.controls div{cursor:pointer;height:100%;display:flex;align-items:center;padding:0 var(--luzmo-droppable-slot-controls-control-horizontal-padding, var(--droppable-slot-controls-control-horizontal-padding))}.droppable-slot.rotate{position:absolute;top:0;left:50%;transform-origin:center;max-width:15rem;transform:translate(-50%) rotate(-90deg)}luzmo-slot-menu[placement=bottom],luzmo-slot-menu[placement=top],luzmo-slot-menu[placement=bottom-start],luzmo-slot-menu[placement=top-start],luzmo-slot-menu[placement=bottom-end],luzmo-slot-menu[placement=top-end]{margin:var(--luzmo-droppable-slot-overlay-vertical-gap, var(--droppable-slot-overlay-vertical-gap)) 0}luzmo-slot-menu[placement=left],luzmo-slot-menu[placement=right],luzmo-slot-menu[placement=left-start],luzmo-slot-menu[placement=right-start],luzmo-slot-menu[placement=left-end],luzmo-slot-menu[placement=right-end]{margin:0 var(--luzmo-droppable-slot-overlay-horizontal-gap, var(--droppable-slot-overlay-horizontal-gap))}:host{--droppable-slot-border-width: var(--luzmo-border-width);--droppable-slot-border-style: dashed;--droppable-slot-border-color: var(--luzmo-border-color);--droppable-slot-background-color: transparent;--droppable-slot-accept-drag-background-color: var(--luzmo-positive-color);--droppable-slot-accept-drag-color: white;--droppable-slot-accept-drag-border-color: var(--luzmo-positive-color-down);--droppable-slot-accept-drag-font-color: white;--droppable-slot-font-color: var(--luzmo-font-color);--droppable-slot-controls-background-color: var(--luzmo-primary-down);--droppable-slot-controls-color: var(--luzmo-primary-inverse-color);--droppable-slot-accept-drag-controls-background-color: var( --luzmo-positive-color-down );--droppable-slot-accept-drag-controls-color: white;--droppable-slot-text-to-controls: var(--luzmo-spacing-3);--droppable-slot-controls-to-edge: 0;--droppable-slot-controls-gap: var(--luzmo-spacing-2);--droppable-slot-controls-horizontal-padding: var(--luzmo-spacing-2);--droppable-slot-controls-control-horizontal-padding: var(--luzmo-spacing-3);--droppable-slot-filled-background-color: var(--luzmo-primary);--droppable-slot-filled-color: var(--luzmo-primary-inverse-color);--droppable-slot-filled-border-width: var(--luzmo-border-width);--droppable-slot-filled-border-style: solid;--droppable-slot-filled-border-color: var(--luzmo-primary-down);--droppable-slot-height: var(--luzmo-component-height);--droppable-slot-label-font-size: var(--luzmo-font-size);--droppable-slot-icon-type-font-size: var(--luzmo-font-size);--droppable-slot-edge-to-label: var(--luzmo-spacing-5);--droppable-slot-label-to-controls: var(--luzmo-spacing-5);--droppable-slot-color-disabled: var(--luzmo-color-disabled);--droppable-slot-background-color-disabled: var( --luzmo-background-color-disabled );--droppable-slot-pulse-color: var(--luzmo-secondary-outline);--droppable-slot-border-radius: var(--luzmo-border-radius)}:host{--droppable-slot-height: var(--luzmo-component-height);--droppable-slot-label-font-size: var(--luzmo-font-size);--droppable-slot-icon-type-font-size: var(--luzmo-font-size);--droppable-slot-horizontal-padding: var(--luzmo-spacing-4);--droppable-slot-overlay-horizontal-gap: var(--luzmo-spacing-4);--droppable-slot-overlay-vertical-gap: var(--luzmo-spacing-4)}:host([size=s]){--droppable-slot-height: var(--luzmo-component-height-s);--droppable-slot-label-font-size: var(--luzmo-font-size-s);--droppable-slot-icon-type-font-size: var(--luzmo-font-size-s);--droppable-slot-horizontal-padding: var(--luzmo-spacing-4);--droppable-slot-overlay-horizontal-gap: var(--luzmo-spacing-4);--droppable-slot-overlay-vertical-gap: var(--luzmo-spacing-4)}:host([size=l]){--droppable-slot-height: var(--luzmo-component-height-l);--droppable-slot-label-font-size: var(--luzmo-font-size-l);--droppable-slot-icon-type-font-size: var(--luzmo-font-size-l);--droppable-slot-horizontal-padding: var(--luzmo-spacing-5);--droppable-slot-overlay-horizontal-gap: var(--luzmo-spacing-5);--droppable-slot-overlay-vertical-gap: var(--luzmo-spacing-5)}:host([size=xl]){--droppable-slot-height: var(--luzmo-component-height-xl);--droppable-slot-label-font-size: var(--luzmo-font-size-xl);--droppable-slot-icon-type-font-size: var(--luzmo-font-size-xl);--droppable-slot-horizontal-padding: var(--luzmo-spacing-5);--droppable-slot-overlay-horizontal-gap: var(--luzmo-spacing-5);--droppable-slot-overlay-vertical-gap: var(--luzmo-spacing-5)}:host{box-sizing:border-box}", C = {
|
159
|
+
Category: () => g("Category", { desc: "Category label" }),
|
160
|
+
Measure: () => g("Measure", { desc: "Measure label" }),
|
161
|
+
Legend: () => g("Legend", { desc: "Legend label" }),
|
162
|
+
"Y-Axis": () => g("Y-Axis", { desc: "Y-Axis label" }),
|
163
|
+
"X-Axis": () => g("X-Axis", { desc: "X-Axis label" }),
|
164
|
+
"Group by": () => g("Group by", { desc: "Group by label" })
|
164
165
|
};
|
165
|
-
var
|
166
|
-
for (var r = l > 1 ? void 0 : l ?
|
167
|
-
(
|
168
|
-
return l && r &&
|
166
|
+
var V = Object.defineProperty, H = Object.getOwnPropertyDescriptor, c = (t, o, e, l) => {
|
167
|
+
for (var r = l > 1 ? void 0 : l ? H(o, e) : o, a = t.length - 1, i; a >= 0; a--)
|
168
|
+
(i = t[a]) && (r = (l ? i(o, e, r) : i(r)) || r);
|
169
|
+
return l && r && V(o, e, r), r;
|
169
170
|
};
|
170
|
-
let
|
171
|
+
let d = class extends F(B, {
|
171
172
|
validSizes: ["s", "m", "l", "xl"],
|
172
173
|
noDefaultSize: !0
|
173
174
|
}) {
|
@@ -229,7 +230,7 @@ let n = class extends B(j, {
|
|
229
230
|
}
|
230
231
|
},
|
231
232
|
args: () => [this.itemType, this.language]
|
232
|
-
}), this.slotConfiguration = {}, this.slotsContents = [], this.language = "en", this.apiUrl = "https://api.luzmo.com", this.authKey = "", this.authToken = "", this.menu = "default", this.placement = "bottom-end", this._slotContents = [], this._store = new
|
233
|
+
}), this.slotConfiguration = {}, this.slotsContents = [], this.language = "en", this.apiUrl = "https://api.luzmo.com", this.authKey = "", this.authToken = "", this.menu = "default", this.placement = "bottom-end", this._slotContents = [], this._store = new R(), this._currentSlotContents = [], this._lastFetchedDatasetId = null, this._linkedDatasetsIds = [], this.changedSlotContents = (t, o = []) => {
|
233
234
|
this._store.setContents(t, this.slotName), this.dispatchEvent(
|
234
235
|
new CustomEvent("slot-contents-changed", {
|
235
236
|
bubbles: !0,
|
@@ -241,7 +242,7 @@ let n = class extends B(j, {
|
|
241
242
|
}
|
242
243
|
})
|
243
244
|
);
|
244
|
-
}, new
|
245
|
+
}, new G(this, {
|
245
246
|
context: $,
|
246
247
|
initialValue: this._store
|
247
248
|
});
|
@@ -250,10 +251,10 @@ let n = class extends B(j, {
|
|
250
251
|
super.disconnectedCallback(), this._cleanupDroppable();
|
251
252
|
}
|
252
253
|
emptySlotContents(t) {
|
253
|
-
t.preventDefault(), t.stopPropagation(), this._slotContents = [], this.changedSlotContents([]
|
254
|
+
t.preventDefault(), t.stopPropagation(), this._slotContents = [], this.changedSlotContents([]);
|
254
255
|
}
|
255
256
|
willUpdate(t) {
|
256
|
-
t.has("slotsContents") && this._processSlotsContents(), t.has("language") && this.language !==
|
257
|
+
t.has("slotsContents") && this._processSlotsContents(), t.has("language") && this.language !== D() && ([...L].includes(this.language ?? "en") || this.language === "en") && O(this.language);
|
257
258
|
}
|
258
259
|
_processSlotsContents() {
|
259
260
|
var t, o;
|
@@ -262,17 +263,15 @@ let n = class extends B(j, {
|
|
262
263
|
)) == null ? void 0 : o.content) ?? [], this._currentSlotContents = [...this._slotContents], this.slotName === "measure" && this._store.setPeriodOverPeriodEnabled(this.itemType), this._store.setContents(this._slotContents);
|
263
264
|
}
|
264
265
|
firstUpdated() {
|
265
|
-
this._cleanupDroppable || (this._cleanupDroppable =
|
266
|
+
this._cleanupDroppable || (this._cleanupDroppable = k({
|
266
267
|
element: this,
|
267
|
-
onDrop: (t) => {
|
268
|
-
var
|
269
|
-
const o = { ...(
|
270
|
-
e && delete o.linkedDatasetsIds;
|
271
|
-
const l = {
|
268
|
+
onDrop: async (t) => {
|
269
|
+
var a, i, s, n;
|
270
|
+
const o = { ...(a = t.source) == null ? void 0 : a.data }, e = {
|
272
271
|
...(o == null ? void 0 : o.label) ?? { en: "Untitled" }
|
273
|
-
},
|
274
|
-
if (
|
275
|
-
const
|
272
|
+
}, l = o == null ? void 0 : o.type;
|
273
|
+
if (l === "datetime" && !o.level && (o.level = o.lowestLevel ?? (o.subtype === "date" ? 5 : 9)), l === "datetime" && ((s = (i = t == null ? void 0 : t.source) == null ? void 0 : i.element) != null && s.hasAttribute("sublevel"))) {
|
274
|
+
const p = [
|
276
275
|
"(Yr)",
|
277
276
|
"(Qtr)",
|
278
277
|
"(Mth)",
|
@@ -282,21 +281,22 @@ let n = class extends B(j, {
|
|
282
281
|
"(Min)",
|
283
282
|
"(Sec)",
|
284
283
|
"(Msec)"
|
285
|
-
],
|
286
|
-
for (const
|
287
|
-
|
288
|
-
o.label =
|
284
|
+
], h = (o == null ? void 0 : o.level) ?? 1, b = Object.keys(e);
|
285
|
+
for (const f of b)
|
286
|
+
e[f] = `${e[f]} ${p[h - 1]}`;
|
287
|
+
o.label = e;
|
289
288
|
}
|
290
|
-
|
289
|
+
const { securable_id: r } = o;
|
290
|
+
r && r !== this._lastFetchedDatasetId && (this._lastFetchedDatasetId = r, await y.fetchDatasetsRecursive([r]), this._linkedDatasetsIds = y.getLinkedDatasetsIds(r)), this._slotContents = (n = this.slotConfiguration) != null && n.canAcceptMultipleDataItems ? [...this._slotContents ?? [], o] : [o], this.removeAttribute("accept-drag"), this.changedSlotContents(this._slotContents, this._linkedDatasetsIds);
|
291
291
|
},
|
292
292
|
canDrop: ({ source: t }) => {
|
293
|
-
var e, l, r, i, s,
|
293
|
+
var e, l, r, a, i, s, n, p, h, b, f;
|
294
294
|
if (![
|
295
295
|
"LUZMO-DRAGGABLE-DATA-ITEM-LEVEL",
|
296
296
|
"LUZMO-DRAGGABLE-DATA-ITEM"
|
297
297
|
].includes((e = t.element) == null ? void 0 : e.tagName) || !((l = this.slotConfiguration) != null && l.canAcceptFormula) && ((r = t == null ? void 0 : t.data) != null && r.formulaId))
|
298
298
|
return !1;
|
299
|
-
const o = ((
|
299
|
+
const o = ((i = (a = this.slotConfiguration) == null ? void 0 : a.acceptableDataItemTypes) == null ? void 0 : i.length) > 0 ? this.slotConfiguration.acceptableDataItemTypes : [
|
300
300
|
"datetime",
|
301
301
|
"hierarchy",
|
302
302
|
"numeric",
|
@@ -304,7 +304,7 @@ let n = class extends B(j, {
|
|
304
304
|
"array[numeric]",
|
305
305
|
"array[hierarchy]"
|
306
306
|
];
|
307
|
-
return (
|
307
|
+
return (s = t == null ? void 0 : t.data) != null && s.type && !o.includes((n = t == null ? void 0 : t.data) == null ? void 0 : n.type) ? !1 : !((p = t == null ? void 0 : t.data) != null && p.subtype && ((b = (h = this.slotConfiguration) == null ? void 0 : h.acceptableColumnSubtypes) == null ? void 0 : b.length) > 0 && !this.slotConfiguration.acceptableColumnSubtypes.includes(
|
308
308
|
(f = t == null ? void 0 : t.data) == null ? void 0 : f.subtype
|
309
309
|
));
|
310
310
|
},
|
@@ -321,60 +321,76 @@ let n = class extends B(j, {
|
|
321
321
|
* Handle overlay open event - reset slot menu position
|
322
322
|
*/
|
323
323
|
_onOverlayClosed(t) {
|
324
|
-
|
324
|
+
const o = t.overlay;
|
325
|
+
this._slotMenuElement && o === this._overlayElement && (setTimeout(() => {
|
325
326
|
this._slotMenuElement.resetPosition();
|
326
327
|
}, 500), this.dispatchEvent(
|
327
|
-
new CustomEvent("slot-menu-
|
328
|
+
new CustomEvent("slot-menu-inactive", {
|
328
329
|
bubbles: !0,
|
329
330
|
composed: !0
|
330
331
|
})
|
331
332
|
));
|
332
333
|
}
|
333
334
|
_onOverlayOpened(t) {
|
334
|
-
var
|
335
|
-
|
336
|
-
|
335
|
+
var e, l, r, a;
|
336
|
+
const o = t.overlay;
|
337
|
+
if (this._slotMenuElement && o === this._overlayElement) {
|
338
|
+
const i = ((l = (e = this._store.activeIndex).get) == null ? void 0 : l.call(e)) ?? 0, s = ((r = this._slotContents) == null ? void 0 : r[i]) ?? ((a = this._slotContents) == null ? void 0 : a[0]);
|
337
339
|
if (!s) return;
|
338
|
-
const
|
339
|
-
if (!
|
340
|
+
const n = (s == null ? void 0 : s.column) ?? (s == null ? void 0 : s.columnId), p = (s == null ? void 0 : s.set) ?? (s == null ? void 0 : s.datasetId);
|
341
|
+
if (!n || !p) return;
|
340
342
|
this.dispatchEvent(
|
341
|
-
new CustomEvent("slot-menu-
|
343
|
+
new CustomEvent("slot-menu-active", {
|
342
344
|
bubbles: !0,
|
343
345
|
composed: !0,
|
344
346
|
detail: {
|
345
|
-
|
346
|
-
level: s.level
|
347
|
+
securableId: p
|
347
348
|
}
|
348
349
|
})
|
349
|
-
)
|
350
|
+
), setTimeout(() => {
|
351
|
+
this.dispatchEvent(
|
352
|
+
new CustomEvent("slot-menu-highlight", {
|
353
|
+
bubbles: !0,
|
354
|
+
composed: !0,
|
355
|
+
detail: {
|
356
|
+
columnId: n,
|
357
|
+
securableId: p,
|
358
|
+
level: (s == null ? void 0 : s.level) ?? 0
|
359
|
+
}
|
360
|
+
})
|
361
|
+
);
|
362
|
+
});
|
350
363
|
}
|
351
364
|
}
|
352
365
|
_onSlotMenuChanges(t) {
|
353
|
-
var
|
354
|
-
t.preventDefault(), t.stopPropagation()
|
366
|
+
var e;
|
367
|
+
t.preventDefault(), t.stopPropagation();
|
368
|
+
const o = t.detail.linkedDatasetsIds;
|
369
|
+
this._slotContents.length === ((e = t.detail.slotContents) == null ? void 0 : e.length) ? (this._currentSlotContents = t.detail.slotContents, this.changedSlotContents(this._currentSlotContents, o)) : (this._slotContents = t.detail.slotContents, this.changedSlotContents(this._slotContents, o));
|
355
370
|
}
|
356
371
|
get _fullLabel() {
|
357
|
-
var l, r, i, s,
|
372
|
+
var l, r, a, i, s, n, p, h, b;
|
358
373
|
let t = "";
|
359
|
-
const o = C[(l = this.slotConfiguration) == null ? void 0 : l.label] ? C[(r = this.slotConfiguration) == null ? void 0 : r.label]() : (
|
360
|
-
((
|
361
|
-
(
|
374
|
+
const o = C[(l = this.slotConfiguration) == null ? void 0 : l.label] ? C[(r = this.slotConfiguration) == null ? void 0 : r.label]() : (a = this.slotConfiguration) == null ? void 0 : a.label;
|
375
|
+
((i = this._currentSlotContents) == null ? void 0 : i.length) === 1 ? t = M(
|
376
|
+
(n = (s = this._currentSlotContents) == null ? void 0 : s[0]) == null ? void 0 : n.label,
|
362
377
|
this.language
|
363
|
-
) ?? "Untitled" : ((
|
378
|
+
) ?? "Untitled" : ((p = this._currentSlotContents) == null ? void 0 : p.length) > 1 && (t = `${this._currentSlotContents.length} items`);
|
364
379
|
let e = this.label || o || "Untitled";
|
365
|
-
return ((
|
380
|
+
return ((h = this._currentSlotContents) == null ? void 0 : h.length) > 0 && (e += ((b = this._currentSlotContents) == null ? void 0 : b.length) > 1 ? `: ${this._currentSlotContents.length} items` : `: ${t}`), e;
|
366
381
|
}
|
367
382
|
droppableSlotMarkup() {
|
368
|
-
var o, e, l, r, i, s,
|
369
|
-
const t =
|
383
|
+
var o, e, l, r, a, i, s, n, p;
|
384
|
+
const t = m`
|
370
385
|
<div
|
386
|
+
id="trigger"
|
371
387
|
class="droppable-slot ${(o = this.slotConfiguration) != null && o.rotate ? "rotate" : ""}"
|
372
388
|
?filled=${((e = this._slotContents) == null ? void 0 : e.length) > 0}
|
373
389
|
>
|
374
390
|
<div class="droppable-slot-label">${this._fullLabel}</div>
|
375
|
-
${((l = this._slotContents) == null ? void 0 : l.length) > 0 && !(this.hideConfiguration && this.hideDelete) ?
|
376
|
-
${this.hideConfiguration ? "" :
|
377
|
-
${
|
391
|
+
${((l = this._slotContents) == null ? void 0 : l.length) > 0 && !(this.hideConfiguration && this.hideDelete) ? m`<div class="controls">
|
392
|
+
${this.hideConfiguration ? "" : m`<div>
|
393
|
+
${v(A)}
|
378
394
|
<luzmo-tooltip
|
379
395
|
self-managed
|
380
396
|
placement=${(r = this.slotConfiguration) != null && r.rotate ? "right" : "top"}
|
@@ -383,20 +399,21 @@ let n = class extends B(j, {
|
|
383
399
|
edit
|
384
400
|
</luzmo-tooltip>
|
385
401
|
</div> `}
|
386
|
-
${this.hideDelete ? "" :
|
387
|
-
${
|
402
|
+
${this.hideDelete ? "" : m`<div @click=${this.emptySlotContents}>
|
403
|
+
${v(I)}
|
388
404
|
<luzmo-tooltip
|
389
405
|
self-managed
|
390
|
-
placement=${(
|
406
|
+
placement=${(a = this.slotConfiguration) != null && a.rotate ? "right" : "top"}
|
391
407
|
size=${this.size}
|
392
408
|
>
|
393
409
|
Delete
|
394
410
|
</luzmo-tooltip>
|
395
411
|
</div>`}
|
396
412
|
</div>` : ""}
|
397
|
-
${((
|
413
|
+
${((i = this._slotContents) == null ? void 0 : i.length) > 0 ? m`<luzmo-overlay
|
398
414
|
trigger="trigger@click"
|
399
415
|
.placement=${this.placement}
|
416
|
+
offset=${(s = this.slotConfiguration) != null && s.rotate ? "-100" : "-20"}
|
400
417
|
@luzmo-closed=${this._onOverlayClosed}
|
401
418
|
@luzmo-opened=${this._onOverlayOpened}
|
402
419
|
>
|
@@ -404,7 +421,7 @@ let n = class extends B(j, {
|
|
404
421
|
language=${this.language}
|
405
422
|
content-language=${this.language}
|
406
423
|
drag-boundary=${this.dragBoundary}
|
407
|
-
slot-type=${(
|
424
|
+
slot-type=${(n = this.slotConfiguration) == null ? void 0 : n.type}
|
408
425
|
slot-name=${this.slotName}
|
409
426
|
item-type=${this.itemType}
|
410
427
|
slot-contents=${this._slotContents}
|
@@ -418,11 +435,11 @@ let n = class extends B(j, {
|
|
418
435
|
</luzmo-overlay>` : ""}
|
419
436
|
</div>
|
420
437
|
`;
|
421
|
-
return (p = this.slotConfiguration) != null && p.rotate ?
|
438
|
+
return (p = this.slotConfiguration) != null && p.rotate ? m`<div class="droppable-slot-wrapper">${t}</div>` : t;
|
422
439
|
}
|
423
440
|
render() {
|
424
441
|
return this._loadSlotsConfig.render({
|
425
|
-
pending: () =>
|
442
|
+
pending: () => m`<p>Loading...</p>`,
|
426
443
|
complete: (t) => {
|
427
444
|
if (this.slotName && this.itemType && t) {
|
428
445
|
const o = t.find((e) => e.name === this.slotName);
|
@@ -430,7 +447,7 @@ let n = class extends B(j, {
|
|
430
447
|
}
|
431
448
|
return this.droppableSlotMarkup();
|
432
449
|
},
|
433
|
-
error: (t) =>
|
450
|
+
error: (t) => m`
|
434
451
|
<div>
|
435
452
|
Could not load droppable slot: '${this.slotName}' of chart
|
436
453
|
'${this.itemType}': ${t}.
|
@@ -439,59 +456,62 @@ let n = class extends B(j, {
|
|
439
456
|
});
|
440
457
|
}
|
441
458
|
};
|
442
|
-
|
459
|
+
d.styles = P(q);
|
443
460
|
c([
|
444
461
|
u({ type: String, reflect: !0, attribute: "item-type" })
|
445
|
-
],
|
462
|
+
], d.prototype, "itemType", 2);
|
446
463
|
c([
|
447
464
|
u({ type: String, reflect: !0, attribute: "slot-name" })
|
448
|
-
],
|
465
|
+
], d.prototype, "slotName", 2);
|
449
466
|
c([
|
450
467
|
u({ type: Object })
|
451
|
-
],
|
468
|
+
], d.prototype, "slotConfiguration", 2);
|
452
469
|
c([
|
453
470
|
u({ type: Object })
|
454
|
-
],
|
471
|
+
], d.prototype, "slotsContents", 2);
|
455
472
|
c([
|
456
473
|
u({ type: String, reflect: !0 })
|
457
|
-
],
|
474
|
+
], d.prototype, "label", 2);
|
458
475
|
c([
|
459
476
|
u({ type: String, reflect: !0 })
|
460
|
-
],
|
477
|
+
], d.prototype, "language", 2);
|
461
478
|
c([
|
462
479
|
u({ type: String, reflect: !0, attribute: "drag-boundary" })
|
463
|
-
],
|
480
|
+
], d.prototype, "dragBoundary", 2);
|
464
481
|
c([
|
465
482
|
u({ type: String, attribute: "api-url", reflect: !0 })
|
466
|
-
],
|
483
|
+
], d.prototype, "apiUrl", 2);
|
467
484
|
c([
|
468
485
|
u({ type: String, attribute: "auth-key", reflect: !0 })
|
469
|
-
],
|
486
|
+
], d.prototype, "authKey", 2);
|
470
487
|
c([
|
471
488
|
u({ type: String, attribute: "auth-token", reflect: !0 })
|
472
|
-
],
|
489
|
+
], d.prototype, "authToken", 2);
|
473
490
|
c([
|
474
491
|
u({ type: String, reflect: !0 })
|
475
|
-
],
|
492
|
+
], d.prototype, "menu", 2);
|
476
493
|
c([
|
477
494
|
u({ type: String, reflect: !0 })
|
478
|
-
],
|
495
|
+
], d.prototype, "placement", 2);
|
479
496
|
c([
|
480
497
|
u({ type: Boolean, reflect: !0, attribute: "hide-delete" })
|
481
|
-
],
|
498
|
+
], d.prototype, "hideDelete", 2);
|
482
499
|
c([
|
483
500
|
u({ type: Boolean, reflect: !0, attribute: "hide-configuration" })
|
484
|
-
],
|
501
|
+
], d.prototype, "hideConfiguration", 2);
|
502
|
+
c([
|
503
|
+
x("luzmo-slot-menu")
|
504
|
+
], d.prototype, "_slotMenuElement", 2);
|
485
505
|
c([
|
486
|
-
|
487
|
-
],
|
506
|
+
x("luzmo-overlay")
|
507
|
+
], d.prototype, "_overlayElement", 2);
|
488
508
|
c([
|
489
509
|
U()
|
490
|
-
],
|
491
|
-
|
510
|
+
], d.prototype, "_slotContents", 2);
|
511
|
+
d = c([
|
492
512
|
E()
|
493
|
-
],
|
494
|
-
customElements.get("luzmo-droppable-slot") || customElements.define("luzmo-droppable-slot",
|
513
|
+
], d);
|
514
|
+
customElements.get("luzmo-droppable-slot") || customElements.define("luzmo-droppable-slot", d);
|
495
515
|
export {
|
496
|
-
|
516
|
+
d as LuzmoDroppableSlot
|
497
517
|
};
|
@@ -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 u=require("../property-Cu4Q1hS4.cjs"),U=require("../localized-decorator-DIXYZ3RL.cjs"),k=require("../set-locale-DCPlazsZ.cjs"),v=require("../base-D76d76ww-tT6yr8eb.cjs");require("../focusable-BxtpnzWp-CkK9AeMt.cjs");const P=require("../index-
|
20
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../property-Cu4Q1hS4.cjs"),U=require("../localized-decorator-DIXYZ3RL.cjs"),k=require("../set-locale-DCPlazsZ.cjs"),v=require("../base-D76d76ww-tT6yr8eb.cjs");require("../focusable-BxtpnzWp-CkK9AeMt.cjs");const P=require("../index-DpHum3lw.cjs"),y=require("../state-fyl3IYMu.cjs"),K=require("../index-Df-_TbOD.cjs");require("../filter-data-item-picker/index.cjs");require("../filter-value-picker/index.cjs");const j=":host{display:flex;flex-direction:row;gap:var(--luzmo-filter-item-gap, var(--filter-item-gap))}:host{--filter-item-gap: var(--luzmo-spacing-3)}:host([size=s]){--filter-item-gap: var(--luzmo-spacing-2)}:host([size=m]){--filter-item-gap: var(--luzmo-spacing-3)}:host([size=l]){--filter-item-gap: calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1))}:host([size=xl]){--filter-item-gap: var(--luzmo-spacing-4)}";var V=Object.defineProperty,A=Object.getOwnPropertyDescriptor,l=(T,t,e,i)=>{for(var s=i>1?void 0:i?A(t,e):t,r=T.length-1,a;r>=0;r--)(a=T[r])&&(s=(i?a(t,e,s):a(s))||s);return i&&s&&V(t,e,s),s};exports.LuzmoFilterItem=class extends v.m(v.It,{validSizes:Object.values(v.d$1)}){constructor(){super(...arguments),this.apiUrl="https://api.luzmo.com",this.language="en",this.contentLanguage="en",this.filter={},this._loading=!1,this._datasetsDataItems=[]}static get styles(){return[u.r(j)]}connectedCallback(){super.connectedCallback();const t={};this.apiUrl&&(t.apiUrl=this.apiUrl),this.cacheTime&&(t.staleTime=this.cacheTime,t.gcTime=this.cacheTime*2),this.authKey&&this.authToken&&(t.authKey=this.authKey,t.authToken=this.authToken),P.dataBroker.configure(t)}async _fetchDatasetDataItems(){if(!this.datasetIds||this.datasetIds.length===0){this._error="Missing dataset ids to fetch columns & formulas";return}this._loading=!0,this._error=null;try{const t=await P.dataBroker.fetchDatasetsWithColumnsAndFormulas(this.datasetIds);for(const e of t)for(const i of[...e.columns,...e.formulas])i.datasetId=e.id;this._datasetsDataItems=t}catch(t){console.error("Error fetching dataset columns & formulas:",t),this._error=t instanceof Error?t.message:"Unknown error",this._datasetsDataItems=[]}finally{this._loading=!1}}willUpdate(t){var a,o,p,h,c,d,n,f,I,_,z,x,b,F,L;const e=t.has("filter"),i=t.has("language"),s=t.has("datasetIds"),r=t.has("_datasetsDataItems");if(i&&this.language!==k.getLocale()&&([...k.targetLocales].includes(this.language??"en")||this.language==="en")&&k.setLocale(this.language),e||s||r&&((p=(o=(a=this.filter)==null?void 0:a.parameters)==null?void 0:o[0])!=null&&p.columnId)&&((d=(c=(h=this.filter)==null?void 0:h.parameters)==null?void 0:c[0])!=null&&d.datasetId||(I=(f=(n=this.filter)==null?void 0:n.parameters)==null?void 0:f[0])!=null&&I.formulaId)){const g=this._datasetsDataItems.find(m=>{var $,D;return m.id===((D=($=this.filter.parameters)==null?void 0:$[0])==null?void 0:D.datasetId)});if(g){for(const m of[...g.columns||[],...(g==null?void 0:g.formulas)||[]])if(m.id===((z=(_=this.filter.parameters)==null?void 0:_[0])==null?void 0:z.columnId)||m.id===((b=(x=this.filter.parameters)==null?void 0:x[0])==null?void 0:b.formulaId)){this._type=m.type,this._subType=m.subtype,this._isFormula=m.id===((L=(F=this.filter.parameters)==null?void 0:F[0])==null?void 0:L.formulaId);break}}}s&&this._fetchDatasetDataItems()}_sendChangeEvent(){this.dispatchEvent(new CustomEvent("filter-changed",{bubbles:!0,composed:!0,cancelable:!0,detail:{filter:this.filter}}))}setFilterDataItem(t){var a,o,p,h,c,d,n,f,I,_,z,x,b,F,L,g,m,$,D,w,E,S,q,C,O;const e=this._type,i=((p=(o=(a=this.filter)==null?void 0:a.parameters)==null?void 0:o[0])==null?void 0:p.columnId)||((d=(c=(h=this.filter)==null?void 0:h.parameters)==null?void 0:c[0])==null?void 0:d.formulaId),s=(f=(n=t.detail)==null?void 0:n.dataItem)==null?void 0:f.id;this._type=(_=(I=t.detail)==null?void 0:I.dataItem)==null?void 0:_.type,this._subType=(x=(z=t.detail)==null?void 0:z.dataItem)==null?void 0:x.subtype,this._isFormula=(F=(b=t.detail)==null?void 0:b.dataItem)==null?void 0:F.isFormula;const r=K.getValidExpressions(this._type,this._subType,this._isFormula);this.filter=structuredClone(this.filter??{}),r!=null&&r.includes((L=this.filter)==null?void 0:L.expression)||(this.filter.expression=(g=r==null?void 0:r[0])==null?void 0:g.expression),this.filter.parameters=((m=this.filter)==null?void 0:m.parameters)??[],this.filter.parameters[0]={datasetId:(D=($=t.detail)==null?void 0:$.dataItem)==null?void 0:D.datasetId},this._isFormula?this.filter.parameters[0].formulaId=(E=(w=t.detail)==null?void 0:w.dataItem)==null?void 0:E.id:this.filter.parameters[0].columnId=(q=(S=t.detail)==null?void 0:S.dataItem)==null?void 0:q.id,(O=(C=t.detail)==null?void 0:C.dataItem)!=null&&O.lowestLevel,e!==this._type?this._type==="hierarchy"?(this.filter.expression="? like ?",this.filter.parameters[1]=""):this._type==="numeric"?(this.filter.expression="? > ?",this.filter.parameters[1]=0):this._type==="datetime"?(this.filter.expression="? < ?",this.filter.parameters[1]=new Date().toISOString()):(this.filter.expression="? is not null",this.filter.parameters=[this.filter.parameters[0]]):i!==s&&this._type==="hierarchy"&&(this.filter.parameters[1]=["? in ?","? not in ?"].includes(this.filter.expression)?[]:""),this._sendChangeEvent()}setFilterExpression(t){var s,r,a,o,p,h,c,d;const e=structuredClone(this.filter??{}),i=e.expression;if(e.expression=(s=t.detail)==null?void 0:s.expression,i!==e.expression){if(["? is null","? is not null"].includes(e.expression))e.parameters=[e.parameters[0]];else if(this._type==="datetime")if(["YTD","QTD","MTD","WTD"].includes(e.expression)){const n=(r=t==null?void 0:t.detail)==null?void 0:r.unit;n&&(e.parameters[1]={unit:typeof n=="number"?n:1})}else if(["last_completed","next_full","to_date"].includes(e.expression)){const n=(o=(a=e==null?void 0:e.parameters)==null?void 0:a[1])==null?void 0:o.unit;e.parameters[1]={unit:typeof n=="number"?n:1}}else if(["last_now","last_available","next_now"].includes(e.expression)){const n=(h=(p=e==null?void 0:e.parameters)==null?void 0:p[1])==null?void 0:h.unit,f=(d=(c=e==null?void 0:e.parameters)==null?void 0:c[1])==null?void 0:d.quantity;e.parameters[1]={unit:typeof n=="number"?n:1,quantity:typeof f=="number"?f:1}}else e.parameters[1]=new Date().toISOString();else this._type==="hierarchy"?["? in ?","? not in ?"].includes(e.expression)?["? = ?","? != ?"].includes(i)?e.parameters[1]=e.parameters[1]?[e.parameters[1]]:[]:e.parameters[1]=[]:["? = ?","? != ?"].includes(e.expression)?["? in ?","? not in ?"].includes(i)?e.parameters[1]=Array.isArray(e.parameters[1])&&e.parameters[1][0]?e.parameters[1][0]:"":e.parameters[1]="":e.parameters[1]=["? in ?","? not in ?"].includes(i)?"":e.parameters[1]??"":this._type==="numeric"&&(["? in ?","? not in ?"].includes(e.expression)&&["? in ?","? not in ?"].includes(i)?e.parameters[1]=e.parameters[1]??[]:["? in ?","? not in ?"].includes(e.expression)?e.parameters[1]=[]:e.parameters[1]=["? in ?","? not in ?"].includes(i)?0:e.parameters[1]??0);this.filter=e,this._sendChangeEvent()}}setFilterValue(t){var e;this.filter.parameters[1]=(e=t==null?void 0:t.detail)==null?void 0:e.value,this._sendChangeEvent()}renderDataItemPicker(){var t,e,i,s,r,a;return u.x`<luzmo-filter-data-item-picker
|
21
21
|
.language=${this.language}
|
22
22
|
.contentLanguage=${this.contentLanguage}
|
23
23
|
.size=${this.size}
|
@@ -22,7 +22,7 @@ import { l as K } from "../localized-decorator-Bl5gcI6n.js";
|
|
22
22
|
import { g as V, t as j, s as q } from "../set-locale-GI34z_M7.js";
|
23
23
|
import { m as M, b as Z, I as B } from "../base-D76d76ww-BGkuhs54.js";
|
24
24
|
import "../focusable-BxtpnzWp-DJQkL8Zv.js";
|
25
|
-
import { d as O } from "../index-
|
25
|
+
import { d as O } from "../index-Cyo2hwg7.js";
|
26
26
|
import { r as b } from "../state-nDsQPund.js";
|
27
27
|
import { g as H } from "../index-5Z9GD60H.js";
|
28
28
|
import "../filter-data-item-picker/index.js";
|
@@ -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"});require("../index-1oIrlkAr.cjs");require("../index-cHKqEi5-.cjs");const u=require("../property-Cu4Q1hS4.cjs"),_=require("../set-locale-DCPlazsZ.cjs"),$=require("../localized-decorator-DIXYZ3RL.cjs"),L=require("../base-D76d76ww-tT6yr8eb.cjs");require("../focusable-BxtpnzWp-CkK9AeMt.cjs");const z=require("../index-
|
20
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../index-1oIrlkAr.cjs");require("../index-cHKqEi5-.cjs");const u=require("../property-Cu4Q1hS4.cjs"),_=require("../set-locale-DCPlazsZ.cjs"),$=require("../localized-decorator-DIXYZ3RL.cjs"),L=require("../base-D76d76ww-tT6yr8eb.cjs");require("../focusable-BxtpnzWp-CkK9AeMt.cjs");const z=require("../index-DpHum3lw.cjs"),k=require("../localize-r7ALOUy_.cjs"),y=require("../state-fyl3IYMu.cjs"),T=".missing-value{opacity:.4}:host{--var: blue}";var x=Object.defineProperty,F=Object.getOwnPropertyDescriptor,h=(b,e,r,t)=>{for(var i=t>1?void 0:t?F(e,r):e,l=b.length-1,n;l>=0;l--)(n=b[l])&&(i=(t?n(e,r,i):n(i))||i);return t&&i&&x(e,r,i),i};const H=5e3;exports.LuzmoFilterValuePickerHierarchy=class extends L.m(L.It,{validSizes:Object.values(L.d$1)}){constructor(){super(...arguments),this.language="en",this.contentLanguage="en",this._hierarchyValues=[],this._retrieving=!0,this._search="",this._error=null,this._allValuesRetrieved=!1,this._runningQueries=[]}static get styles(){return[u.r(T)]}connectedCallback(){super.connectedCallback();const e={};this.apiUrl&&(e.apiUrl=this.apiUrl),this.cacheTime&&(e.staleTime=this.cacheTime,e.gcTime=this.cacheTime*2),this.authKey&&this.authToken&&(e.authKey=this.authKey,e.authToken=this.authToken),z.dataBroker.configure(e)}willUpdate(e){var t,i,l,n,m,d,o,f,g,p,s,a,c,V;if(e.has("language")&&this.language!==_.getLocale()&&([..._.targetLocales].includes(this.language??"en")||this.language==="en")&&_.setLocale(this.language),e.has("filter")&&this.filter){const v=(t=e.get("filter"))==null?void 0:t.expression,P=((n=(l=(i=e.get("filter"))==null?void 0:i.parameters)==null?void 0:l[0])==null?void 0:n.columnId)||((o=(d=(m=e.get("filter"))==null?void 0:m.parameters)==null?void 0:d[0])==null?void 0:o.formulaId),S=((p=(g=(f=this.filter)==null?void 0:f.parameters)==null?void 0:g[0])==null?void 0:p.columnId)||((c=(a=(s=this.filter)==null?void 0:s.parameters)==null?void 0:a[0])==null?void 0:c.formulaId);P!==S&&(["? in ?","? not in ?","? = ?","? != ?"].includes((V=this.filter)==null?void 0:V.expression)||!["? in ?","? not in ?","? = ?","? != ?"].includes(v))&&(this._hierarchyValues=[],this._allValuesRetrieved=!1,this._retrieving=!0)}}async _fetchHierarchyValues(e=0){var g,p;if(this._allValuesRetrieved){this._retrieving=!1;return}if(!((p=(g=this.filter)==null?void 0:g.parameters)!=null&&p[0])){this._retrieving=!1,this._error="Missing column parameters";return}const r=this.filter.parameters[0],t=r.columnId,i=r.formulaId,l=r.datasetId;if(!t&&!i){this._retrieving=!1,this._error="Missing column id or formula id";return}else if(!l){this._retrieving=!1,this._error="Missing dataset id";return}this._retrieving=!0,this._error=null;const n={expression:"? like ?",parameters:[{column_id:t,formula_id:i,dataset_id:l},this._search]},m={dimensions:[{column_id:t,formula_id:i,dataset_id:l}],where:[],order:[{column_id:t,formula_id:i,dataset_id:l,order:"asc"}],limit:{by:H,offset:e}};this._search&&this._allValuesRetrieved&&m.where.push(n);const d=new AbortController,o=new Promise((s,a)=>{z.dataBroker.fetchData(m).then(s).catch(a),d.signal.addEventListener("abort",()=>{console.warn("Request aborted"),a({status:"aborted"})})}),f={promise:o,abortController:d};this._runningQueries.push(f);try{const s=await o,a=s&&Array.isArray(s.data)?s.data.map(c=>c[0]):[];this._search||(this._allValuesRetrieved=a.length<H),this._hierarchyValues=e>0?[...this._hierarchyValues,...a]:a}catch(s){if((s==null?void 0:s.status)==="aborted")return;this._error=s instanceof Error?s.message:"Unknown error",this._hierarchyValues=[]}finally{this._runningQueries=this._runningQueries.filter(s=>s.promise!==o),this._retrieving=!1}}_sendChangeEvent(){this.dispatchEvent(new CustomEvent("filter-value-changed",{bubbles:!0,composed:!0,cancelable:!0,detail:{value:this._value}}))}setHierarchy(e){var t,i,l,n,m,d,o,f;let r;["? in ?","? not in ?"].includes((t=this.filter)==null?void 0:t.expression)?r=(i=e==null?void 0:e.detail)==null?void 0:i.value:["? = ?","? != ?"].includes((l=this.filter)==null?void 0:l.expression)?r=(m=(n=e==null?void 0:e.detail)==null?void 0:n.value)==null?void 0:m[0]:r=(d=e==null?void 0:e.target)==null?void 0:d.value,this._value!==r&&(this._value=r,this.filter={...this.filter,parameters:[{...(f=(o=this.filter)==null?void 0:o.parameters)==null?void 0:f[0]},this._value]},this._sendChangeEvent())}onScrolled(e){var r;!this._retrieving&&!this._allValuesRetrieved&&((r=e==null?void 0:e.detail)==null?void 0:r.last)===this._hierarchyValues.length-1&&this._fetchHierarchyValues(this._hierarchyValues.length)}renderTextField(){var e,r;return u.x`<luzmo-text-field
|
21
21
|
.size=${this.size}
|
22
22
|
@change=${this.setHierarchy}
|
23
23
|
@input=${this.setHierarchy}
|
@@ -24,7 +24,7 @@ import { g as C, t as I, s as E, m as b } from "../set-locale-GI34z_M7.js";
|
|
24
24
|
import { l as H } from "../localized-decorator-Bl5gcI6n.js";
|
25
25
|
import { m as R, b as O, I as D } from "../base-D76d76ww-BGkuhs54.js";
|
26
26
|
import "../focusable-BxtpnzWp-DJQkL8Zv.js";
|
27
|
-
import { d as v } from "../index-
|
27
|
+
import { d as v } from "../index-Cyo2hwg7.js";
|
28
28
|
import { l as w } from "../localize-BX7q0S0M.js";
|
29
29
|
import { r as _ } from "../state-nDsQPund.js";
|
30
30
|
const $ = () => {
|