@luzmo/analytics-components-kit 1.2.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -3
- package/angular/components/add-to-dashboard.ts +20 -6
- package/angular/components/data-fields-select.ts +5 -0
- package/angular/components/interactive-viz-item.ts +89 -24
- package/angular/components/item-grid-item-actions-menu.ts +5 -0
- package/angular/components/item-grid.ts +7 -0
- package/angular/components/item-option-color-picker.ts +28 -28
- package/angular/components/item-option-guidelines.ts +22 -1
- package/angular/components/item-option-multi-language-field.ts +7 -7
- package/angular/components/item-option-number-field.ts +14 -14
- package/angular/components/item-option-positions-number-field.ts +14 -14
- package/angular/components/item-option-radio-button-group.ts +7 -7
- package/angular/components/item-option-text-field.ts +7 -7
- package/angular/components/item-slot-picker-panel.ts +1 -1
- package/angular/components/item-slot-picker.ts +7 -7
- package/angular/esm/components/add-to-dashboard.d.ts +8 -4
- package/angular/esm/components/add-to-dashboard.js +23 -7
- package/angular/esm/components/data-fields-select.d.ts +2 -0
- package/angular/esm/components/data-fields-select.js +4 -0
- package/angular/esm/components/interactive-viz-item.d.ts +32 -11
- package/angular/esm/components/interactive-viz-item.js +99 -28
- package/angular/esm/components/item-grid-item-actions-menu.d.ts +2 -0
- package/angular/esm/components/item-grid-item-actions-menu.js +4 -0
- package/angular/esm/components/item-grid.d.ts +3 -1
- package/angular/esm/components/item-grid.js +9 -1
- package/angular/esm/components/item-option-color-picker.d.ts +10 -10
- package/angular/esm/components/item-option-color-picker.js +34 -34
- package/angular/esm/components/item-option-guidelines.d.ts +8 -2
- package/angular/esm/components/item-option-guidelines.js +26 -2
- package/angular/esm/components/item-option-multi-language-field.d.ts +3 -3
- package/angular/esm/components/item-option-multi-language-field.js +10 -10
- package/angular/esm/components/item-option-number-field.d.ts +5 -5
- package/angular/esm/components/item-option-number-field.js +18 -18
- package/angular/esm/components/item-option-positions-number-field.d.ts +5 -5
- package/angular/esm/components/item-option-positions-number-field.js +18 -18
- package/angular/esm/components/item-option-radio-button-group.d.ts +3 -3
- package/angular/esm/components/item-option-radio-button-group.js +10 -10
- package/angular/esm/components/item-option-text-field.d.ts +3 -3
- package/angular/esm/components/item-option-text-field.js +10 -10
- package/angular/esm/components/item-slot-picker-panel.d.ts +1 -1
- package/angular/esm/components/item-slot-picker-panel.js +1 -1
- package/angular/esm/components/item-slot-picker.d.ts +3 -3
- package/angular/esm/components/item-slot-picker.js +9 -9
- package/angular/package.json +2 -2
- package/components/add-to-dashboard/dashboard-actions.d.ts +2 -1
- package/components/add-to-dashboard/index.cjs +1 -1
- package/components/add-to-dashboard/index.js +1 -1
- package/components/{add-to-dashboard-NwsCPIlg.cjs → add-to-dashboard-BtzTZdjN.cjs} +1 -1
- package/components/{add-to-dashboard-NcVHlqrc.js → add-to-dashboard-Bu6S3qVz.js} +125 -120
- package/components/chart-helpers-BHxQbLBw.cjs +20 -0
- package/components/{chart-helpers-Dng_LGfq.js → chart-helpers-BKeMLhov.js} +53 -39
- package/components/filters/index.cjs +1 -1
- package/components/filters/index.js +1 -1
- package/components/{filters-CxIzuI5q.js → filters-DEpmh9Nj.js} +113 -102
- package/components/filters-LDXhe1Bp.cjs +187 -0
- package/components/index.cjs +1 -1
- package/components/index.js +6 -6
- package/components/interactive-viz-item/helpers/chart-helpers.d.ts +2 -1
- package/components/interactive-viz-item/index.cjs +1 -1
- package/components/interactive-viz-item/index.d.ts +1 -1
- package/components/interactive-viz-item/index.js +3 -3
- package/components/interactive-viz-item/interactive-viz-item.d.ts +47 -1
- package/components/interactive-viz-item/types.d.ts +4 -0
- package/components/interactive-viz-item-Cc3Ix95e.js +630 -0
- package/components/interactive-viz-item-SF12d97t.cjs +269 -0
- package/components/item-grid/item-grid.d.ts +1 -0
- package/components/item-slot-picker-panel/index.cjs +1 -1
- package/components/item-slot-picker-panel/index.js +1 -1
- package/components/item-slot-picker-panel/item-slot-picker-panel.d.ts +19 -1
- package/components/item-slot-picker-panel-Cw3UCK03.cjs +84 -0
- package/components/{item-slot-picker-panel-fJqEmxeD.js → item-slot-picker-panel-DprM9Rli.js} +64 -33
- package/custom-elements.json +3051 -2531
- package/grid-core/item-grid-base.d.ts +5 -4
- package/package.json +2 -2
- package/react/package.json +2 -2
- package/standalone/add-to-dashboard.js +40 -40
- package/standalone/chunks/{chart-helpers-DsIGsaDc.js → chart-helpers-DZsidiCl.js} +2 -2
- package/standalone/chunks/{choropleth-map-options.config-rUJsEJcm.js → choropleth-map-options.config-CDMjKnJD.js} +1 -1
- package/standalone/chunks/{color-range-utils-DxOtqAKB.js → color-range-utils-BVyHBRiq.js} +1 -1
- package/standalone/chunks/data-broker-DpSrH3IP.js +2 -0
- package/standalone/chunks/de-BkB0q1Eg.js +2 -0
- package/standalone/chunks/display-settings-binning-DhHlclWH.js +38 -0
- package/standalone/chunks/display-settings-datetime-C8xvOvi4.js +199 -0
- package/standalone/chunks/display-settings-grand-totals-CUpigDcs.js +26 -0
- package/standalone/chunks/display-settings-numeric-BLWF54Jx.js +172 -0
- package/standalone/chunks/display-settings-period-over-period-COd4tvUw.js +209 -0
- package/standalone/chunks/embed-Bv1ps-EM.js +260 -0
- package/standalone/chunks/en-DNsyAwgq.js +2 -0
- package/standalone/chunks/en-GB-Di3OzVdL.js +2 -0
- package/standalone/chunks/en-US-DNsyAwgq.js +2 -0
- package/standalone/chunks/es-Bo0jStZn.js +2 -0
- package/standalone/chunks/{filters-DKgJcQGP.js → filters-lhg_WVDK.js} +108 -108
- package/standalone/chunks/{formula-codemirror-BbyvNEVD.js → formula-codemirror-DZMzLE2I.js} +17 -17
- package/standalone/chunks/fr-Co_qVhhV.js +2 -0
- package/standalone/chunks/{heat-map-options.config-D93AeYFi.js → heat-map-options.config-DDQMD38W.js} +1 -1
- package/standalone/chunks/{heat-table-options.config-ZVML76FK.js → heat-table-options.config-B4K0Ygug.js} +1 -1
- package/standalone/chunks/{is-same-option-value-Di-A7Wmg.js → is-same-option-value-7kXNF4st.js} +1 -1
- package/standalone/chunks/item-option-action-button-group-Bl1HR1JK.js +35 -0
- package/standalone/chunks/item-option-base-DF24wTyv.js +38 -0
- package/standalone/chunks/item-option-color-palette-picker-MkIIn56p.js +22 -0
- package/standalone/chunks/item-option-color-picker-CxosMo_p.js +19 -0
- package/standalone/chunks/item-option-color-range-C7C70r4J.js +83 -0
- package/standalone/chunks/item-option-guidelines-iu8yWRzr.js +120 -0
- package/standalone/chunks/{item-option-multi-language-field-DPPpN2qg.js → item-option-multi-language-field-foanqCdr.js} +1 -1
- package/standalone/chunks/{item-option-number-field-CkqJjInE.js → item-option-number-field-ByVD4oq0.js} +1 -1
- package/standalone/chunks/item-option-panel-Bya-K7HH.js +316 -0
- package/standalone/chunks/{item-option-picker-BnwQPT9A.js → item-option-picker-CqNNVIML.js} +1 -1
- package/standalone/chunks/item-option-position-picker-BjCFVtDH.js +14 -0
- package/standalone/chunks/item-option-positions-number-field-BJJtXZL-.js +31 -0
- package/standalone/chunks/{item-option-radio-button-group-BkymJq3E.js → item-option-radio-button-group-C5bxsD85.js} +1 -1
- package/standalone/chunks/item-option-slider-DUXWz70B.js +18 -0
- package/standalone/chunks/item-option-switch-BHyJuOkP.js +12 -0
- package/standalone/chunks/{item-option-text-field-D7bkuhsv.js → item-option-text-field-rBZY9OX4.js} +1 -1
- package/standalone/chunks/{item-slot-picker-panel-D4BMxGs9.js → item-slot-picker-panel-BM82vSXi.js} +101 -99
- package/standalone/chunks/load-data-fields-for-datasets-DS9O1oyy.js +25 -0
- package/standalone/chunks/localize-DLl7tgQp.js +2 -0
- package/standalone/chunks/localized-decorator-DosMCCQo.js +2 -0
- package/standalone/chunks/{version-BW4Ixl63.js → localized-mixin-BWJj88bd.js} +1 -1
- package/standalone/chunks/nl-CQz2jrVx.js +2 -0
- package/standalone/chunks/{option-interaction-controller-BslAXAHF.js → option-interaction-controller-BuwRr21c.js} +1 -1
- package/standalone/chunks/{route-map-options.config-Dwy0JSVq.js → route-map-options.config-CGBkHnhM.js} +1 -1
- package/standalone/chunks/{spike-map-options.config-DFmuNxym.js → spike-map-options.config-CSenlJ_F.js} +1 -1
- package/standalone/interactive-viz-item.js +88 -84
- package/standalone/item-grid.js +10 -10
- package/standalone/manifest.json +46 -46
- package/types.d.ts +1 -1
- package/components/chart-helpers-ufZ6VbXs.cjs +0 -20
- package/components/filters-BPbPFOu5.cjs +0 -187
- package/components/interactive-viz-item-CwRRaCZB.js +0 -583
- package/components/interactive-viz-item-CxdrGRKc.cjs +0 -265
- package/components/item-slot-picker-panel-BhhN54IM.cjs +0 -82
- package/standalone/chunks/data-broker-DXDyIrj_.js +0 -2
- package/standalone/chunks/de-mdZT2W1G.js +0 -2
- package/standalone/chunks/display-settings-binning-Byffw2Kl.js +0 -38
- package/standalone/chunks/display-settings-datetime-CD52d6Sv.js +0 -199
- package/standalone/chunks/display-settings-grand-totals-Cky99LX9.js +0 -26
- package/standalone/chunks/display-settings-numeric-C9ea7Tgc.js +0 -172
- package/standalone/chunks/display-settings-period-over-period-BLSGumkD.js +0 -209
- package/standalone/chunks/embed-CBu7iQRx.js +0 -231
- package/standalone/chunks/en-CSboh17P.js +0 -2
- package/standalone/chunks/en-GB-HoXKQBOY.js +0 -2
- package/standalone/chunks/en-US-CSboh17P.js +0 -2
- package/standalone/chunks/es-Di5D8JFd.js +0 -2
- package/standalone/chunks/fr-DZku7iB9.js +0 -2
- package/standalone/chunks/item-option-action-button-group-BEAwPHVw.js +0 -35
- package/standalone/chunks/item-option-base-CRUxNhJQ.js +0 -38
- package/standalone/chunks/item-option-color-palette-picker-CBz61iZb.js +0 -22
- package/standalone/chunks/item-option-color-picker-lLvBPnKA.js +0 -19
- package/standalone/chunks/item-option-color-range-BqeatOei.js +0 -83
- package/standalone/chunks/item-option-guidelines-Cop8rM8y.js +0 -120
- package/standalone/chunks/item-option-panel-CzSKFCVl.js +0 -316
- package/standalone/chunks/item-option-position-picker-Bkc4JvJX.js +0 -14
- package/standalone/chunks/item-option-positions-number-field-Dr_315TE.js +0 -31
- package/standalone/chunks/item-option-slider-K_bsNci8.js +0 -18
- package/standalone/chunks/item-option-switch-DeihDHhM.js +0 -12
- package/standalone/chunks/load-data-fields-for-datasets-ClctSj6y.js +0 -25
- package/standalone/chunks/localize-DXRmGRe-.js +0 -2
- package/standalone/chunks/localized-decorator-DJVBmJVH.js +0 -2
- package/standalone/chunks/nl-CViTevL3.js +0 -2
|
@@ -23,17 +23,17 @@ import { t as r } from "./decorate-B2TzfnLZ.js";
|
|
|
23
23
|
import { t as i } from "./localized-mixin-FPDNaZhb.js";
|
|
24
24
|
import { t as a } from "./data-broker-C1Iz71TN.js";
|
|
25
25
|
import { t as o } from "./localize-BNystXyK.js";
|
|
26
|
-
import {
|
|
27
|
-
import { luzmoAlertOutline as c, luzmoAngleDown as l, luzmoAngleLeft as u, luzmoAngleRight as d, luzmoArrowLeft as f, luzmoArrowRight as p, luzmoArrowsHorizontal as m, luzmoCheckCircleOutline as h, luzmoDesktop as g, luzmoLaptop as _, luzmoLink as v, luzmoMobile as
|
|
26
|
+
import { s } from "./chart-helpers-BKeMLhov.js";
|
|
27
|
+
import { luzmoAlertOutline as c, luzmoAngleDown as l, luzmoAngleLeft as u, luzmoAngleRight as d, luzmoArrowLeft as f, luzmoArrowRight as p, luzmoArrowsHorizontal as m, luzmoCheckCircleOutline as h, luzmoDesktop as g, luzmoLaptop as _, luzmoLink as v, luzmoMobile as y, luzmoPlus as b, luzmoTablet as x } from "@luzmo/icons";
|
|
28
28
|
import "@luzmo/lucero/action-button";
|
|
29
29
|
import "@luzmo/lucero/button";
|
|
30
30
|
import "@luzmo/lucero/icon";
|
|
31
31
|
import "@luzmo/lucero/overlay";
|
|
32
32
|
import "@luzmo/lucero/popover";
|
|
33
33
|
import "@luzmo/lucero/tooltip";
|
|
34
|
-
import { html as
|
|
35
|
-
import { property as
|
|
36
|
-
import { localized as
|
|
34
|
+
import { html as S, nothing as C, unsafeCSS as ee } from "lit";
|
|
35
|
+
import { property as w, query as T, state as E } from "lit/decorators.js";
|
|
36
|
+
import { localized as D, msg as O, str as k } from "@lit/localize";
|
|
37
37
|
import "@luzmo/lucero/progress-circle";
|
|
38
38
|
import "@luzmo/lucero/checkbox";
|
|
39
39
|
import "@luzmo/lucero/divider";
|
|
@@ -41,16 +41,16 @@ import "@luzmo/lucero/field-group";
|
|
|
41
41
|
import "@luzmo/lucero/menu";
|
|
42
42
|
import "@luzmo/lucero/notice";
|
|
43
43
|
import "@luzmo/lucero/search";
|
|
44
|
-
import { ifDefined as
|
|
44
|
+
import { ifDefined as A } from "lit/directives/if-defined.js";
|
|
45
45
|
// src/components/add-to-dashboard/add-to-dashboard.module.scss?inline
|
|
46
|
-
var
|
|
46
|
+
var j = ":host{align-items:flex-end;gap:var(--luzmo-spacing-2);font-family:var(--luzmo-font-family);flex-direction:column;display:inline-flex}.trigger-spinner{--luzmo-progress-circle-size:var(--luzmo-icon-size-xs)}.trigger-chevron{margin-inline-start:var(--luzmo-spacing-1)}.picker{gap:var(--luzmo-spacing-3);width:var(--luzmo-add-to-dashboard-picker-width,var(--add-to-dashboard-picker-width));max-width:90vw;padding:var(--luzmo-spacing-2);color:var(--luzmo-font-color);font-size:var(--luzmo-font-size-s);flex-direction:column;display:flex}luzmo-search{width:100%}.list{max-height:var(--luzmo-add-to-dashboard-list-max-height,var(--add-to-dashboard-list-max-height));flex-direction:column;display:flex;overflow-y:auto}.menu{--luzmo-menu-max-height:none;flex:none;width:100%;overflow:visible}.create-row{--luzmo-menu-item-label-icon-color-default:var(--luzmo-primary)}.thumbnail{object-fit:cover;border:var(--luzmo-border-width) solid var(--luzmo-border-color);border-radius:var(--luzmo-border-radius);width:2.75rem;height:2rem}.drill-in{color:var(--luzmo-font-color-extra-dimmed)}.header{align-items:center;gap:var(--luzmo-spacing-2);display:flex}.header-title{font-weight:var(--luzmo-font-weight-bold);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.empty{align-items:center;gap:var(--luzmo-spacing-3);padding:var(--luzmo-spacing-4);text-align:center;flex-direction:column;display:flex}.loading{padding:var(--luzmo-spacing-3);justify-content:center;display:flex}.screen-modes{gap:var(--luzmo-spacing-2);flex-direction:column;display:flex}.screen-mode{align-items:center;gap:var(--luzmo-spacing-2);display:flex}.screen-mode-size{color:var(--luzmo-font-color-extra-dimmed)}.footer{justify-content:flex-end;display:flex}.status{justify-content:flex-end;width:0;min-width:100%;display:flex}.status:empty{display:none}.alert{flex:none;inline-size:max-content}.alert-body{align-items:center;gap:var(--luzmo-spacing-3);block-size:1lh;min-inline-size:0;display:flex}.alert-text{min-inline-size:0;font-weight:var(--luzmo-font-weight-semibold);white-space:pre;display:flex}.alert[variant=negative] .alert-text{white-space:normal}.alert-name{min-inline-size:0;font-weight:var(--luzmo-font-weight-bold);text-overflow:ellipsis;white-space:nowrap;unicode-bidi:plaintext;overflow:hidden}.alert-open{flex:none}:host{--add-to-dashboard-picker-width:18rem;--add-to-dashboard-list-max-height:16rem}", M = "0.1.107", N = "0.1.0", P = [
|
|
47
47
|
"id",
|
|
48
48
|
"name",
|
|
49
49
|
"contents",
|
|
50
50
|
"modified_at",
|
|
51
51
|
"is_variant",
|
|
52
52
|
"original_id"
|
|
53
|
-
],
|
|
53
|
+
], te = /* @__PURE__ */ new Set(["designer", "owner"]), ne = "flag_dashboard_variants", re = [
|
|
54
54
|
"desktop",
|
|
55
55
|
"tablet",
|
|
56
56
|
"mobile"
|
|
@@ -66,24 +66,29 @@ async function F(e, t, n) {
|
|
|
66
66
|
total: a
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
async function I(e) {
|
|
70
|
-
let
|
|
69
|
+
async function I(e, t) {
|
|
70
|
+
let n = (await e.fetchApi("/user", {
|
|
71
71
|
action: "get",
|
|
72
|
-
version:
|
|
72
|
+
version: N,
|
|
73
73
|
find: {
|
|
74
74
|
where: { id: "me" },
|
|
75
|
-
attributes: ["id", "flags"]
|
|
75
|
+
attributes: ["id", "flags"],
|
|
76
|
+
...t ? { include: [{
|
|
77
|
+
model: "Organization",
|
|
78
|
+
attributes: ["id"]
|
|
79
|
+
}] } : {}
|
|
76
80
|
}
|
|
77
|
-
});
|
|
81
|
+
})).rows?.[0];
|
|
78
82
|
return {
|
|
79
|
-
id:
|
|
80
|
-
flags:
|
|
83
|
+
id: n?.id ?? "",
|
|
84
|
+
flags: n?.flags ?? [],
|
|
85
|
+
organizations: n?.organizations
|
|
81
86
|
};
|
|
82
87
|
}
|
|
83
88
|
async function L(e, t) {
|
|
84
89
|
return (await e.fetchApi("/authorization", {
|
|
85
90
|
action: "get",
|
|
86
|
-
version:
|
|
91
|
+
version: N,
|
|
87
92
|
find: { where: { id: t } }
|
|
88
93
|
})).rows?.[0];
|
|
89
94
|
}
|
|
@@ -96,7 +101,7 @@ async function R(e, t, n) {
|
|
|
96
101
|
}
|
|
97
102
|
}, i = await e.fetchApi("/securable", {
|
|
98
103
|
action: "get",
|
|
99
|
-
version:
|
|
104
|
+
version: N,
|
|
100
105
|
find: r
|
|
101
106
|
}, { signal: n });
|
|
102
107
|
return {
|
|
@@ -114,9 +119,9 @@ function z(e) {
|
|
|
114
119
|
}
|
|
115
120
|
function B() {
|
|
116
121
|
return {
|
|
117
|
-
version:
|
|
122
|
+
version: M,
|
|
118
123
|
syncScreenModes: !0,
|
|
119
|
-
views:
|
|
124
|
+
views: re.map((e) => ({
|
|
120
125
|
screenModus: e,
|
|
121
126
|
options: { theme: { id: "default" } },
|
|
122
127
|
filterGroups: [],
|
|
@@ -153,7 +158,7 @@ async function U(e) {
|
|
|
153
158
|
authKey: e.authKey,
|
|
154
159
|
authToken: e.authToken,
|
|
155
160
|
skipNetworkListeners: !0
|
|
156
|
-
}),
|
|
161
|
+
}), n = await L(t, e.authKey), r = n?.type === "embed", i = await I(t, !r), s = z(n), c = r ? te.has(n.role ?? "") : i.organizations?.[0]?.organizationRole?.flagEditor !== !1, l = !!i.id && i.flags.includes(ne), u = [...s.modifyIds, ...l ? s.useOnlyIds : []], d = u.length > 0 ? { id: { notIn: u } } : {}, f = (t, n = !1) => {
|
|
157
162
|
let r = [...new Set((t.contents?.views ?? []).map((e) => e.screenModus))];
|
|
158
163
|
return {
|
|
159
164
|
id: t.id,
|
|
@@ -162,68 +167,68 @@ async function U(e) {
|
|
|
162
167
|
screenModes: r.length > 0 ? r : ["desktop"],
|
|
163
168
|
...n ? { requiresVariant: n } : {}
|
|
164
169
|
};
|
|
165
|
-
},
|
|
166
|
-
if (
|
|
170
|
+
}, p, m = (e, n) => async (r, i) => {
|
|
171
|
+
if (u.length === 0) return {
|
|
167
172
|
count: 0,
|
|
168
173
|
rows: []
|
|
169
174
|
};
|
|
170
|
-
let
|
|
171
|
-
return
|
|
175
|
+
let a = r > 0 && p?.search === e ? p.rows : void 0;
|
|
176
|
+
return a || (a = (await R(t, {
|
|
172
177
|
where: {
|
|
173
178
|
is_variant: !1,
|
|
174
179
|
archived_at: null,
|
|
175
|
-
id: { in:
|
|
180
|
+
id: { in: u }
|
|
176
181
|
},
|
|
177
|
-
attributes:
|
|
182
|
+
attributes: P,
|
|
178
183
|
...V(e)
|
|
179
|
-
}, n)).rows.map((e) =>
|
|
184
|
+
}, n)).rows.map((e) => f(e, !s.modifyIds.has(e.id))).sort((e, t) => e.name.localeCompare(t.name)), p = {
|
|
180
185
|
search: e,
|
|
181
|
-
rows:
|
|
186
|
+
rows: a
|
|
182
187
|
}), {
|
|
183
|
-
count:
|
|
184
|
-
rows:
|
|
188
|
+
count: a.length,
|
|
189
|
+
rows: a.slice(r, r + i)
|
|
185
190
|
};
|
|
186
|
-
},
|
|
191
|
+
}, h = (e, n, r, a) => async (o, s) => {
|
|
187
192
|
let c = await R(t, {
|
|
188
193
|
where: {
|
|
189
194
|
is_variant: !1,
|
|
190
195
|
archived_at: null,
|
|
191
|
-
...
|
|
196
|
+
...d
|
|
192
197
|
},
|
|
193
|
-
attributes:
|
|
194
|
-
...H(
|
|
198
|
+
attributes: P,
|
|
199
|
+
...H(i.id, r),
|
|
195
200
|
...V(e),
|
|
196
201
|
limit: s,
|
|
197
202
|
offset: o,
|
|
198
203
|
order: [["modified_at", "desc"]]
|
|
199
|
-
},
|
|
204
|
+
}, n);
|
|
200
205
|
return {
|
|
201
206
|
count: c.count,
|
|
202
|
-
rows: c.rows.map((e) =>
|
|
207
|
+
rows: c.rows.map((e) => f(e, a))
|
|
203
208
|
};
|
|
204
|
-
},
|
|
209
|
+
}, g = async (e, n, r, i) => {
|
|
205
210
|
await t.fetchApi("/securable", {
|
|
206
211
|
action: "update",
|
|
207
|
-
version:
|
|
212
|
+
version: N,
|
|
208
213
|
id: e,
|
|
209
214
|
properties: { append_item: {
|
|
210
215
|
item: n,
|
|
211
216
|
...r?.length ? { screenModes: r } : {}
|
|
212
217
|
} }
|
|
213
218
|
}, { signal: i });
|
|
214
|
-
},
|
|
219
|
+
}, _ = async (e, n, r) => {
|
|
215
220
|
try {
|
|
216
|
-
await
|
|
221
|
+
await g(e.id, n, r);
|
|
217
222
|
} catch (n) {
|
|
218
223
|
throw await t.fetchApi("/securable", {
|
|
219
224
|
action: "delete",
|
|
220
|
-
version:
|
|
225
|
+
version: N,
|
|
221
226
|
id: e.id
|
|
222
227
|
}).catch(() => void 0), n;
|
|
223
228
|
}
|
|
224
|
-
},
|
|
229
|
+
}, v = async (e, n) => await t.fetchApi("/securable", {
|
|
225
230
|
action: "create",
|
|
226
|
-
version:
|
|
231
|
+
version: N,
|
|
227
232
|
properties: {
|
|
228
233
|
...e,
|
|
229
234
|
type: "dashboard"
|
|
@@ -232,41 +237,41 @@ async function U(e) {
|
|
|
232
237
|
});
|
|
233
238
|
return {
|
|
234
239
|
async list(e, t) {
|
|
235
|
-
return
|
|
236
|
-
|
|
237
|
-
...
|
|
240
|
+
return i.id ? await F([
|
|
241
|
+
m(e.search, t.signal),
|
|
242
|
+
...l ? [h(e.search, t.signal, {
|
|
238
243
|
flagUse: !0,
|
|
239
244
|
flagModify: !1
|
|
240
245
|
}, !0)] : [],
|
|
241
|
-
|
|
246
|
+
h(e.search, t.signal, { flagModify: !0 }, !1)
|
|
242
247
|
], e.offset, e.limit) : {
|
|
243
248
|
rows: [],
|
|
244
249
|
total: 0
|
|
245
250
|
};
|
|
246
251
|
},
|
|
247
252
|
async add(e, t, n, r) {
|
|
248
|
-
await
|
|
253
|
+
await g(e.id, t, n.screenModes, r.signal);
|
|
249
254
|
},
|
|
250
|
-
...
|
|
251
|
-
let r = await
|
|
255
|
+
...c ? { async create(t, n) {
|
|
256
|
+
let r = await v({
|
|
252
257
|
name: n.name ? { [e.language]: n.name } : {},
|
|
253
258
|
contents: B()
|
|
254
259
|
});
|
|
255
|
-
return await
|
|
260
|
+
return await _(r, t, void 0), f(r);
|
|
256
261
|
} } : {},
|
|
257
|
-
...
|
|
262
|
+
...l ? { async listVariants(e, n) {
|
|
258
263
|
return (await R(t, {
|
|
259
264
|
where: {
|
|
260
265
|
is_variant: !0,
|
|
261
266
|
original_id: e.id,
|
|
262
267
|
archived_at: null
|
|
263
268
|
},
|
|
264
|
-
attributes:
|
|
265
|
-
...H(
|
|
269
|
+
attributes: P,
|
|
270
|
+
...H(i.id, { flagModify: !0 }),
|
|
266
271
|
order: [["modified_at", "desc"]]
|
|
267
|
-
},
|
|
272
|
+
}, n.signal)).rows.map((e) => f(e));
|
|
268
273
|
} } : {},
|
|
269
|
-
...
|
|
274
|
+
...l && c ? { async addToVariant(n, r, i) {
|
|
270
275
|
let a = (await R(t, {
|
|
271
276
|
where: { id: n.id },
|
|
272
277
|
attributes: [
|
|
@@ -275,8 +280,8 @@ async function U(e) {
|
|
|
275
280
|
"contents"
|
|
276
281
|
]
|
|
277
282
|
})).rows[0];
|
|
278
|
-
if (!a?.contents) throw Error(
|
|
279
|
-
let o = a.name ?? {}, s = await
|
|
283
|
+
if (!a?.contents) throw Error(O("The dashboard was not found.", { desc: "Adding the chart to a variant failed because the original dashboard could not be loaded" }));
|
|
284
|
+
let o = a.name ?? {}, s = await v({
|
|
280
285
|
name: i.name ? {
|
|
281
286
|
...o,
|
|
282
287
|
[e.language]: i.name
|
|
@@ -286,7 +291,7 @@ async function U(e) {
|
|
|
286
291
|
role: "original",
|
|
287
292
|
id: n.id
|
|
288
293
|
}]);
|
|
289
|
-
return await
|
|
294
|
+
return await _(s, r, i.screenModes), f({
|
|
290
295
|
...s,
|
|
291
296
|
contents: s.contents ?? a.contents
|
|
292
297
|
});
|
|
@@ -313,7 +318,7 @@ var K = 20, q = 300, J = 8, Y = 48, X = "__luzmo-new-dashboard", Z = "__luzmo-ne
|
|
|
313
318
|
}
|
|
314
319
|
static get styles() {
|
|
315
320
|
let e = super.styles ?? [];
|
|
316
|
-
return [...Array.isArray(e) ? e : [e],
|
|
321
|
+
return [...Array.isArray(e) ? e : [e], ee(j)];
|
|
317
322
|
}
|
|
318
323
|
get _hasSource() {
|
|
319
324
|
return !!this.dashboardActions || !!(this.authKey && this.authToken);
|
|
@@ -367,41 +372,41 @@ var K = 20, q = 300, J = 8, Y = 48, X = "__luzmo-new-dashboard", Z = "__luzmo-ne
|
|
|
367
372
|
this.dispatchEvent(n);
|
|
368
373
|
}
|
|
369
374
|
_displayName(e) {
|
|
370
|
-
return e.name.trim() ||
|
|
375
|
+
return e.name.trim() || O("Untitled dashboard", { desc: "Fallback name of a dashboard without a name" });
|
|
371
376
|
}
|
|
372
377
|
_variantName(e, t) {
|
|
373
378
|
let n = this._displayName(e);
|
|
374
|
-
return
|
|
379
|
+
return O(k`${n} (variant ${t})`, { desc: "Name of a new dashboard variant" });
|
|
375
380
|
}
|
|
376
381
|
_screenModeChoices() {
|
|
377
382
|
return [
|
|
378
383
|
{
|
|
379
384
|
name: "mobile",
|
|
380
|
-
label:
|
|
385
|
+
label: O("Smartphone", { desc: "Screen mode name" }),
|
|
381
386
|
size: "< 768px",
|
|
382
|
-
icon:
|
|
387
|
+
icon: y
|
|
383
388
|
},
|
|
384
389
|
{
|
|
385
390
|
name: "tablet",
|
|
386
|
-
label:
|
|
391
|
+
label: O("Tablet", { desc: "Screen mode name" }),
|
|
387
392
|
size: "≥ 768px",
|
|
388
|
-
icon:
|
|
393
|
+
icon: x
|
|
389
394
|
},
|
|
390
395
|
{
|
|
391
396
|
name: "desktop",
|
|
392
|
-
label:
|
|
397
|
+
label: O("Desktop", { desc: "Screen mode name" }),
|
|
393
398
|
size: "≥ 1200px",
|
|
394
399
|
icon: _
|
|
395
400
|
},
|
|
396
401
|
{
|
|
397
402
|
name: "largeScreen",
|
|
398
|
-
label:
|
|
403
|
+
label: O("Large screen", { desc: "Screen mode name" }),
|
|
399
404
|
size: "≥ 1600px",
|
|
400
405
|
icon: g
|
|
401
406
|
},
|
|
402
407
|
{
|
|
403
408
|
name: "fixed",
|
|
404
|
-
label:
|
|
409
|
+
label: O("Fixed width", { desc: "Screen mode name" }),
|
|
405
410
|
icon: m
|
|
406
411
|
}
|
|
407
412
|
];
|
|
@@ -567,50 +572,50 @@ var K = 20, q = 300, J = 8, Y = 48, X = "__luzmo-new-dashboard", Z = "__luzmo-ne
|
|
|
567
572
|
await e?.updateComplete, e?.focus();
|
|
568
573
|
}
|
|
569
574
|
_renderRow(e) {
|
|
570
|
-
return
|
|
575
|
+
return S`
|
|
571
576
|
<luzmo-menu-item value=${e.id} no-wrap ?disabled=${this._saving}>
|
|
572
|
-
${e.thumbnailUrl ?
|
|
577
|
+
${e.thumbnailUrl ? S`<img slot="icon" class="thumbnail" alt="" src=${e.thumbnailUrl} />` : C}
|
|
573
578
|
${this._displayName(e)}
|
|
574
|
-
${e.requiresVariant ?
|
|
579
|
+
${e.requiresVariant ? S`<luzmo-icon slot="value" class="drill-in" size="xs" block .icon=${this.isLTR ? d : u}></luzmo-icon>` : C}
|
|
575
580
|
</luzmo-menu-item>
|
|
576
581
|
`;
|
|
577
582
|
}
|
|
578
583
|
_renderCreateRow(e, t, n, r = !1) {
|
|
579
584
|
let i = `${this._triggerId}-${e}-reason`;
|
|
580
|
-
return
|
|
585
|
+
return S`
|
|
581
586
|
<luzmo-menu-item
|
|
582
587
|
class="create-row"
|
|
583
588
|
value=${e}
|
|
584
589
|
label=${t}
|
|
585
|
-
aria-describedby=${
|
|
590
|
+
aria-describedby=${A(n ? i : void 0)}
|
|
586
591
|
no-wrap
|
|
587
592
|
?disabled=${this._saving || r || !!n}
|
|
588
593
|
>
|
|
589
|
-
<luzmo-icon slot="icon" size="s" .icon=${
|
|
590
|
-
${t} ${n ?
|
|
594
|
+
<luzmo-icon slot="icon" size="s" .icon=${b}></luzmo-icon>
|
|
595
|
+
${t} ${n ? S`<span slot="description" id=${i}>${n}</span>` : C}
|
|
591
596
|
</luzmo-menu-item>
|
|
592
597
|
`;
|
|
593
598
|
}
|
|
594
599
|
_renderLoading() {
|
|
595
|
-
let e =
|
|
596
|
-
return
|
|
600
|
+
let e = O("Loading", { desc: "Loading spinner label" });
|
|
601
|
+
return S`<div class="loading"><luzmo-progress-circle size="s" indeterminate .label=${e}></luzmo-progress-circle></div>`;
|
|
597
602
|
}
|
|
598
603
|
async _handleRetry(e) {
|
|
599
604
|
let t = e();
|
|
600
605
|
await this.updateComplete, this._isFocusLost() && await this._focusStep(), await t;
|
|
601
606
|
}
|
|
602
607
|
_renderEmpty(e, t) {
|
|
603
|
-
return
|
|
608
|
+
return S`
|
|
604
609
|
<div class="empty">
|
|
605
610
|
<span>${e}</span>
|
|
606
|
-
${t ?
|
|
611
|
+
${t ? S`<luzmo-button size="s" treatment="outline" @click=${() => this._handleRetry(t)}>${O("Retry", { desc: "Retry a failed request" })}</luzmo-button>` : C}
|
|
607
612
|
</div>
|
|
608
613
|
`;
|
|
609
614
|
}
|
|
610
615
|
_renderHeader(e) {
|
|
611
|
-
return
|
|
616
|
+
return S`
|
|
612
617
|
<div class="header">
|
|
613
|
-
<luzmo-action-button size="s" quiet label=${
|
|
618
|
+
<luzmo-action-button size="s" quiet label=${O("Back", { desc: "Go back to the previous step" })} @click=${this._handleBack}>
|
|
614
619
|
<luzmo-icon slot="icon" size="xs" .icon=${this.isLTR ? f : p}></luzmo-icon>
|
|
615
620
|
</luzmo-action-button>
|
|
616
621
|
<span class="header-title" tabindex="-1"
|
|
@@ -620,16 +625,16 @@ var K = 20, q = 300, J = 8, Y = 48, X = "__luzmo-new-dashboard", Z = "__luzmo-ne
|
|
|
620
625
|
`;
|
|
621
626
|
}
|
|
622
627
|
_renderList() {
|
|
623
|
-
let e = this._actions && !this._actions.create ?
|
|
628
|
+
let e = this._actions && !this._actions.create ? O("These credentials cannot create dashboards", {
|
|
624
629
|
id: "add-to-dashboard-cannot-create",
|
|
625
630
|
desc: "Why a new dashboard cannot be created"
|
|
626
631
|
}) : void 0;
|
|
627
|
-
return
|
|
632
|
+
return S`
|
|
628
633
|
<luzmo-search
|
|
629
634
|
size="s"
|
|
630
635
|
border="none"
|
|
631
|
-
label=${
|
|
632
|
-
placeholder=${
|
|
636
|
+
label=${O("Search dashboards", { desc: "Label of the dashboard search field" })}
|
|
637
|
+
placeholder=${O("Search dashboards", { desc: "Label of the dashboard search field" })}
|
|
633
638
|
.value=${this._search}
|
|
634
639
|
@input=${this._handleSearchInput}
|
|
635
640
|
@submit=${(e) => e.preventDefault()}
|
|
@@ -637,42 +642,42 @@ var K = 20, q = 300, J = 8, Y = 48, X = "__luzmo-new-dashboard", Z = "__luzmo-ne
|
|
|
637
642
|
<luzmo-divider size="s"></luzmo-divider>
|
|
638
643
|
<div class="list" @scroll=${this._handleListScroll}>
|
|
639
644
|
<luzmo-menu class="menu" size="s" @change=${this._handleListChange} @close=${(e) => e.stopPropagation()}>
|
|
640
|
-
${this._renderCreateRow(X,
|
|
645
|
+
${this._renderCreateRow(X, O("New dashboard", { desc: "Create a new dashboard for the chart" }), e, !this._actions)}
|
|
641
646
|
${this._rows.map((e) => this._renderRow(e))}
|
|
642
647
|
</luzmo-menu>
|
|
643
648
|
<div class="list-state" role="status" aria-live="polite">
|
|
644
|
-
${this._listFailed ? this._renderEmpty(
|
|
645
|
-
${this._loading ? this._renderLoading() :
|
|
649
|
+
${this._listFailed ? this._renderEmpty(O("Failed to load dashboards", { desc: "Dashboard list failed to load" }), () => this._loadList()) : !this._loading && this._rows.length === 0 ? this._renderEmpty(O("No dashboards found", { desc: "Dashboard list is empty" })) : C}
|
|
650
|
+
${this._loading ? this._renderLoading() : C}
|
|
646
651
|
</div>
|
|
647
652
|
</div>
|
|
648
653
|
`;
|
|
649
654
|
}
|
|
650
655
|
_renderVariants(e) {
|
|
651
|
-
let t = this._actions?.addToVariant ? void 0 :
|
|
656
|
+
let t = this._actions?.addToVariant ? void 0 : O("These credentials cannot create variants", {
|
|
652
657
|
id: "add-to-dashboard-cannot-create-variant",
|
|
653
658
|
desc: "Why a new dashboard variant cannot be created"
|
|
654
659
|
}), n = !this._variantsLoading && !this._variantsFailed;
|
|
655
|
-
return
|
|
660
|
+
return S`
|
|
656
661
|
${this._renderHeader(this._displayName(e))}
|
|
657
662
|
<luzmo-divider size="s"></luzmo-divider>
|
|
658
663
|
<div class="list">
|
|
659
664
|
<luzmo-menu class="menu" size="s" @change=${this._handleVariantChange} @close=${(e) => e.stopPropagation()}>
|
|
660
|
-
${this._renderCreateRow(Z,
|
|
665
|
+
${this._renderCreateRow(Z, O("New variant", { desc: "Create a new variant of a dashboard" }), t, !n)}
|
|
661
666
|
${this._variants.map((e) => this._renderRow(e))}
|
|
662
667
|
</luzmo-menu>
|
|
663
668
|
<div class="list-state" role="status" aria-live="polite">
|
|
664
|
-
${this._variantsFailed ? this._renderEmpty(
|
|
665
|
-
${this._variantsLoading ? this._renderLoading() :
|
|
669
|
+
${this._variantsFailed ? this._renderEmpty(O("Failed to load variants", { desc: "Variant list failed to load" }), () => this._loadVariants()) : !this._variantsLoading && this._variants.length === 0 ? this._renderEmpty(O("No variants yet", { desc: "Variant list is empty" })) : C}
|
|
670
|
+
${this._variantsLoading ? this._renderLoading() : C}
|
|
666
671
|
</div>
|
|
667
672
|
</div>
|
|
668
673
|
`;
|
|
669
674
|
}
|
|
670
675
|
_renderScreenModes(e) {
|
|
671
676
|
let t = e.kind === "variant" ? e.original : e.dashboard, n = e.kind === "variant" ? e.name : this._displayName(t), r = t.screenModes ?? [];
|
|
672
|
-
return
|
|
677
|
+
return S`
|
|
673
678
|
${this._renderHeader(n)}
|
|
674
|
-
<luzmo-field-group class="screen-modes" vertical label=${
|
|
675
|
-
${this._screenModeChoices().filter((e) => r.includes(e.name)).map((e) =>
|
|
679
|
+
<luzmo-field-group class="screen-modes" vertical label=${O("Screen modes", { desc: "Label of the group of screen-mode checkboxes" })}>
|
|
680
|
+
${this._screenModeChoices().filter((e) => r.includes(e.name)).map((e) => S`
|
|
676
681
|
<luzmo-checkbox
|
|
677
682
|
size="s"
|
|
678
683
|
?checked=${this._screenModes.includes(e.name)}
|
|
@@ -681,14 +686,14 @@ var K = 20, q = 300, J = 8, Y = 48, X = "__luzmo-new-dashboard", Z = "__luzmo-ne
|
|
|
681
686
|
<span class="screen-mode">
|
|
682
687
|
<luzmo-icon size="xs" block .icon=${e.icon}></luzmo-icon>
|
|
683
688
|
${e.label}
|
|
684
|
-
${e.size ?
|
|
689
|
+
${e.size ? S`<span class="screen-mode-size" dir="ltr">${e.size}</span>` : C}
|
|
685
690
|
</span>
|
|
686
691
|
</luzmo-checkbox>
|
|
687
692
|
`)}
|
|
688
693
|
</luzmo-field-group>
|
|
689
694
|
<div class="footer">
|
|
690
695
|
<luzmo-button size="s" variant="primary" ?disabled=${this._screenModes.length === 0 || this._saving} @click=${this._handleConfirmScreenModes}>
|
|
691
|
-
${
|
|
696
|
+
${O("Confirm", { desc: "Confirm the selected screen modes" })}
|
|
692
697
|
</luzmo-button>
|
|
693
698
|
</div>
|
|
694
699
|
`;
|
|
@@ -697,15 +702,15 @@ var K = 20, q = 300, J = 8, Y = 48, X = "__luzmo-new-dashboard", Z = "__luzmo-ne
|
|
|
697
702
|
return this._step === "screenModes" && this._pending ? this._renderScreenModes(this._pending) : this._step === "variants" && this._original ? this._renderVariants(this._original) : this._renderList();
|
|
698
703
|
}
|
|
699
704
|
_noticeLabels() {
|
|
700
|
-
return { close:
|
|
705
|
+
return { close: O("Close", {
|
|
701
706
|
id: "add-to-dashboard-close",
|
|
702
707
|
desc: "Close the save result notice"
|
|
703
708
|
}) };
|
|
704
709
|
}
|
|
705
710
|
_renderStatus() {
|
|
706
711
|
let e = this._status;
|
|
707
|
-
if (!e) return
|
|
708
|
-
if (e.kind === "error") return
|
|
712
|
+
if (!e) return C;
|
|
713
|
+
if (e.kind === "error") return S`
|
|
709
714
|
<luzmo-notice
|
|
710
715
|
class="alert"
|
|
711
716
|
size="s"
|
|
@@ -715,11 +720,11 @@ var K = 20, q = 300, J = 8, Y = 48, X = "__luzmo-new-dashboard", Z = "__luzmo-ne
|
|
|
715
720
|
@luzmo-notice-close=${this._handleNoticeClose}
|
|
716
721
|
>
|
|
717
722
|
<luzmo-icon slot="icon" .icon=${c}></luzmo-icon>
|
|
718
|
-
<span class="alert-text" dir="auto">${e.message ??
|
|
723
|
+
<span class="alert-text" dir="auto">${e.message ?? O("Failed to copy item", { desc: "Saving the chart to a dashboard failed" })}</span>
|
|
719
724
|
</luzmo-notice>
|
|
720
725
|
`;
|
|
721
|
-
let t = this._displayName(e.dashboard), n =
|
|
722
|
-
return
|
|
726
|
+
let t = this._displayName(e.dashboard), n = S`<strong class="alert-name" tabindex="-1">${t}<luzmo-tooltip self-managed show-only-if-truncated placement="top" .size=${this.size}>${t}</luzmo-tooltip></strong>`, r = e.openDashboard;
|
|
727
|
+
return S`
|
|
723
728
|
<luzmo-notice
|
|
724
729
|
class="alert"
|
|
725
730
|
size="s"
|
|
@@ -730,24 +735,24 @@ var K = 20, q = 300, J = 8, Y = 48, X = "__luzmo-new-dashboard", Z = "__luzmo-ne
|
|
|
730
735
|
>
|
|
731
736
|
<luzmo-icon slot="icon" .icon=${h}></luzmo-icon>
|
|
732
737
|
<div class="alert-body">
|
|
733
|
-
<span class="alert-text" dir="auto">${
|
|
734
|
-
${r && !e.isVariant ?
|
|
738
|
+
<span class="alert-text" dir="auto">${O(S`Item copied to ${n}`, { desc: "The chart was saved to a dashboard" })}</span>
|
|
739
|
+
${r && !e.isVariant ? S`
|
|
735
740
|
<luzmo-action-button class="alert-open" size="s" quiet @click=${() => r(e.dashboard)}>
|
|
736
741
|
<luzmo-icon slot="icon" size="xs" .icon=${v}></luzmo-icon>
|
|
737
|
-
${
|
|
742
|
+
${O("Open", {
|
|
738
743
|
id: "add-to-dashboard-open",
|
|
739
744
|
desc: "Open the dashboard the chart was saved to"
|
|
740
745
|
})}
|
|
741
746
|
</luzmo-action-button>
|
|
742
|
-
` :
|
|
747
|
+
` : C}
|
|
743
748
|
</div>
|
|
744
749
|
</luzmo-notice>
|
|
745
750
|
`;
|
|
746
751
|
}
|
|
747
752
|
render() {
|
|
748
|
-
if (!this.chart || !this._hasSource) return
|
|
749
|
-
let e = this._saving ?
|
|
750
|
-
return
|
|
753
|
+
if (!this.chart || !this._hasSource) return C;
|
|
754
|
+
let e = this._saving ? O("Adding to dashboard", { desc: "The chart is being saved to a dashboard" }) : O("Add to dashboard", { desc: "Button that opens the add to dashboard picker" });
|
|
755
|
+
return S`
|
|
751
756
|
<luzmo-action-button
|
|
752
757
|
id=${this._triggerId}
|
|
753
758
|
class="trigger"
|
|
@@ -756,7 +761,7 @@ var K = 20, q = 300, J = 8, Y = 48, X = "__luzmo-new-dashboard", Z = "__luzmo-ne
|
|
|
756
761
|
aria-expanded=${this._open ? "true" : "false"}
|
|
757
762
|
?disabled=${this.disabled || this._saving}
|
|
758
763
|
>
|
|
759
|
-
${this._saving ?
|
|
764
|
+
${this._saving ? S`<luzmo-progress-circle class="trigger-spinner" slot="icon" indeterminate .label=${e}></luzmo-progress-circle>` : S`<luzmo-icon slot="icon" size="xs" .icon=${b}></luzmo-icon>`}
|
|
760
765
|
${e}
|
|
761
766
|
<luzmo-icon class="trigger-chevron" size="xs" .icon=${l}></luzmo-icon>
|
|
762
767
|
</luzmo-action-button>
|
|
@@ -769,7 +774,7 @@ var K = 20, q = 300, J = 8, Y = 48, X = "__luzmo-new-dashboard", Z = "__luzmo-ne
|
|
|
769
774
|
@luzmo-closed=${this._handleClosed}
|
|
770
775
|
>
|
|
771
776
|
<luzmo-popover>
|
|
772
|
-
<div class="picker">${this._open ? this._renderPicker() :
|
|
777
|
+
<div class="picker">${this._open ? this._renderPicker() : C}</div>
|
|
773
778
|
</luzmo-popover>
|
|
774
779
|
</luzmo-overlay>
|
|
775
780
|
<div class="status">${this._renderStatus()}</div>
|
|
@@ -777,20 +782,20 @@ var K = 20, q = 300, J = 8, Y = 48, X = "__luzmo-new-dashboard", Z = "__luzmo-ne
|
|
|
777
782
|
}
|
|
778
783
|
};
|
|
779
784
|
// src/components/add-to-dashboard/index.ts
|
|
780
|
-
r([
|
|
785
|
+
r([w({ attribute: !1 })], $.prototype, "chart", void 0), r([w({ attribute: !1 })], $.prototype, "dashboardActions", void 0), r([w({
|
|
781
786
|
type: String,
|
|
782
787
|
attribute: "auth-key"
|
|
783
|
-
})], $.prototype, "authKey", void 0), r([
|
|
788
|
+
})], $.prototype, "authKey", void 0), r([w({
|
|
784
789
|
type: String,
|
|
785
790
|
attribute: "auth-token"
|
|
786
|
-
})], $.prototype, "authToken", void 0), r([
|
|
791
|
+
})], $.prototype, "authToken", void 0), r([w({
|
|
787
792
|
type: String,
|
|
788
793
|
attribute: "api-url"
|
|
789
|
-
})], $.prototype, "apiUrl", void 0), r([
|
|
794
|
+
})], $.prototype, "apiUrl", void 0), r([w({
|
|
790
795
|
type: String,
|
|
791
796
|
reflect: !0
|
|
792
|
-
})], $.prototype, "placement", void 0), r([
|
|
797
|
+
})], $.prototype, "placement", void 0), r([w({
|
|
793
798
|
type: Boolean,
|
|
794
799
|
reflect: !0
|
|
795
|
-
})], $.prototype, "disabled", void 0), r([
|
|
800
|
+
})], $.prototype, "disabled", void 0), r([E()], $.prototype, "_open", void 0), r([E()], $.prototype, "_actions", void 0), r([E()], $.prototype, "_step", void 0), r([E()], $.prototype, "_rows", void 0), r([E()], $.prototype, "_hasMore", void 0), r([E()], $.prototype, "_loading", void 0), r([E()], $.prototype, "_listFailed", void 0), r([E()], $.prototype, "_original", void 0), r([E()], $.prototype, "_variants", void 0), r([E()], $.prototype, "_variantsLoading", void 0), r([E()], $.prototype, "_variantsFailed", void 0), r([E()], $.prototype, "_pending", void 0), r([E()], $.prototype, "_screenModes", void 0), r([E()], $.prototype, "_saving", void 0), r([E()], $.prototype, "_status", void 0), r([T(".trigger")], $.prototype, "_triggerElement", void 0), r([T("luzmo-search")], $.prototype, "_searchElement", void 0), r([T(".header luzmo-action-button")], $.prototype, "_backElement", void 0), r([T("luzmo-notice")], $.prototype, "_noticeElement", void 0), $ = r([D()], $), typeof customElements < "u" && !customElements.get("luzmo-add-to-dashboard") && customElements.define("luzmo-add-to-dashboard", $);
|
|
796
801
|
export { U as n, $ as t };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*! * A kit of modern Luzmo Web Components for analytics in your web application.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2026 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Luzmo web components (“Luzmo Web Components”)
|
|
6
|
+
* must be used according to the Luzmo Terms of Service.
|
|
7
|
+
* This license allows users with a current active Luzmo account
|
|
8
|
+
* to use the Luzmo Web Components. This license terminates
|
|
9
|
+
* automatically if a user no longer has an active Luzmo account.
|
|
10
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
11
|
+
*
|
|
12
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
13
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
14
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
15
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
16
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
17
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
|
+
* SOFTWARE.
|
|
19
|
+
* */
|
|
20
|
+
const e=require("./type-check-BehV9ZL1.cjs");var t=function(e){return e.Top=`top`,e.Bottom=`bottom`,e}({}),n=function(e){return e.Asc=`asc`,e.Desc=`desc`,e}({}),r=function(e){return e.Measure=`measure`,e.Category=`category`,e}({}),i=5,a=Array.isArray;function o(e){return typeof e==`string`}function s(t){let n={...t};return!n.datasetId&&n.set&&(n.datasetId=n.set),!n.set&&n.datasetId&&(n.set=n.datasetId),!n.columnId&&n.column&&(n.columnId=n.column),!n.column&&n.columnId&&(n.column=n.columnId),!n.formulaId&&n.formula&&e.s(n.formula)&&(n.formulaId=n.formula),!n.formula&&n.formulaId&&(n.formula=n.formulaId),n}function c(e){return a(e)?e:Object.entries(e).map(([e,t])=>({name:e,content:a(t)?t:[]}))}function l(e){let t=new Set;for(let n of e)for(let e of n.content){let n=e.datasetId??e.set;o(n)&&t.add(n)}return[...t]}function u(e){let t=c(e.slots??[]),n=e.options??{},r=n.interactivity;return{type:e.type,options:{...n,interactivity:{...r,scheduledExport:!1}},slots:t.map(e=>({...e,content:a(e.content)?e.content.map(e=>s(e)):[]})),filters:e.filters,inlineData:e.inlineData}}function d(t,n){if(!n)return t;let r={...t};for(let[t,i]of Object.entries(n)){let n=r[t];r[t]=e.a(n)&&e.a(i)?{...n,...i}:i}return r}function f(e,t){return{...e,options:{...e.options,theme:{...e.options.theme,...t}}}}function p(e){let t=e.find(e=>e.name===`measure`||e.name===`measures`);if(t&&t.content.length>1)return!0;let n=e.find(e=>e.name===`legend`);return n?n.content.length>0:!1}function m(e){let i=[],a=e.options;switch(e.type){case`area-chart`:case`bar-chart`:case`column-chart`:if(e.inlineData||i.push({type:`rankingPicker`,mutationType:`rankAndSort`,ranking:a.ranking??{active:!1,number:5,direction:t.Top},sort:a.sort??{direction:n.Desc,by:r.Measure},importance:100}),p(e.slots)){let t=e.type===`area-chart`,n=t?[{key:`stacked`,label:`Stacked`},{key:`unstacked`,label:`Unstacked`},{key:`100`,label:`100%`},{key:`stream`,label:`Stream`}]:[{key:`grouped`,label:`Grouped`},{key:`stacked`,label:`Stacked`},{key:`100`,label:`100%`}],r=t?`stacked`:`grouped`;i.push({type:`optionDropdown`,mutationType:`mode`,values:n,currentValue:a.mode??r,importance:90})}break;case`donut-chart`:{let e=a.display??{};i.push({type:`optionDropdown`,mutationType:`donutLabelDisplay`,values:[{key:`withLegend`,label:`With legend`},{key:`withLabels`,label:`With labels`}],currentValue:e.categoryLabels===!0?`withLabels`:`withLegend`,importance:90});break}case`bubble-chart`:{let e=a.display??{};i.push({type:`optionDropdown`,mutationType:`bubbleValues`,values:[{key:`none`,label:`No values`},{key:`absolute`,label:`Absolute`},{key:`percentage`,label:`Percentage`}],currentValue:e.bubbleValues??e.values??`none`,importance:100});break}}return i.sort((e,t)=>t.importance-e.importance)}function h(e,t,n){let r=e.options;switch(t){case`mode`:return{...e,options:{...r,mode:n}};case`donutLabelDisplay`:{let t={...r.display??{}};return n===`withLabels`?(t.legend=!1,t.categoryLabels=!0):(t.legend=!0,t.categoryLabels=!1),{...e,options:{...r,display:t}}}case`bubbleValues`:{let t={...r.display??{}};return t.bubbleLabels=t.bubbleLabels!==!1,t.bubbleValues=n,{...e,options:{...r,display:t}}}default:return e}}function g(e,t){switch(t.type){case`slots`:return{...e,slots:t.slotsContents};case`options`:return{...e,options:t.options};case`filters`:return{...e,filters:t.filters};case`chartAction`:return h(e,t.actionType,t.key);case`rankAndSort`:return{...e,options:{...e.options,ranking:t.ranking,sort:t.sort}};case`fullReplace`:return t.chart;default:return e}}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return r}});
|