@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
|
@@ -15,10 +15,6 @@ export class LuzmoItemOptionPositionsNumberField {
|
|
|
15
15
|
get nativeElement() {
|
|
16
16
|
return this.host;
|
|
17
17
|
}
|
|
18
|
-
/** The value applied to all positions when sync is enabled. */
|
|
19
|
-
syncedValue;
|
|
20
|
-
/** Internal timer handle used to debounce change events. */
|
|
21
|
-
debounceTimeout;
|
|
22
18
|
/** Which positions to render input fields for (e.g. top/right/bottom/left, or corners and center). */
|
|
23
19
|
positions;
|
|
24
20
|
/** The current numeric value for each position. */
|
|
@@ -35,6 +31,10 @@ export class LuzmoItemOptionPositionsNumberField {
|
|
|
35
31
|
debounce;
|
|
36
32
|
/** Whether all positions are currently synced to a single value. */
|
|
37
33
|
sync;
|
|
34
|
+
/** The value applied to all positions when sync is enabled. */
|
|
35
|
+
syncedValue;
|
|
36
|
+
/** Internal timer handle used to debounce change events. */
|
|
37
|
+
debounceTimeout;
|
|
38
38
|
/** Emitted when the option value changes. */
|
|
39
39
|
luzmoOptionChanged = output({ alias: 'luzmoOptionChanged' });
|
|
40
40
|
constructor() {
|
|
@@ -48,12 +48,6 @@ export class LuzmoItemOptionPositionsNumberField {
|
|
|
48
48
|
ngOnChanges(changes) {
|
|
49
49
|
for (const key of Object.keys(changes)) {
|
|
50
50
|
switch (key) {
|
|
51
|
-
case 'syncedValue':
|
|
52
|
-
this.setHostProperty('syncedValue', changes['syncedValue'].currentValue);
|
|
53
|
-
break;
|
|
54
|
-
case 'debounceTimeout':
|
|
55
|
-
this.setHostProperty('debounceTimeout', changes['debounceTimeout'].currentValue);
|
|
56
|
-
break;
|
|
57
51
|
case 'positions':
|
|
58
52
|
this.setHostProperty('positions', changes['positions'].currentValue);
|
|
59
53
|
break;
|
|
@@ -78,6 +72,12 @@ export class LuzmoItemOptionPositionsNumberField {
|
|
|
78
72
|
case 'sync':
|
|
79
73
|
this.setHostProperty('sync', changes['sync'].currentValue);
|
|
80
74
|
break;
|
|
75
|
+
case 'syncedValue':
|
|
76
|
+
this.setHostProperty('syncedValue', changes['syncedValue'].currentValue);
|
|
77
|
+
break;
|
|
78
|
+
case 'debounceTimeout':
|
|
79
|
+
this.setHostProperty('debounceTimeout', changes['debounceTimeout'].currentValue);
|
|
80
|
+
break;
|
|
81
81
|
default:
|
|
82
82
|
break;
|
|
83
83
|
}
|
|
@@ -99,7 +99,7 @@ export class LuzmoItemOptionPositionsNumberField {
|
|
|
99
99
|
}));
|
|
100
100
|
}
|
|
101
101
|
static ɵfac = function LuzmoItemOptionPositionsNumberField_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoItemOptionPositionsNumberField)(); };
|
|
102
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoItemOptionPositionsNumberField, selectors: [["luzmo-item-option-positions-number-field"]], inputs: {
|
|
102
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoItemOptionPositionsNumberField, selectors: [["luzmo-item-option-positions-number-field"]], inputs: { positions: "positions", values: "values", canSync: [2, "canSync", "canSync", booleanAttribute], positionConfiguration: "positionConfiguration", invalid: [2, "invalid", "invalid", booleanAttribute], readonly: [2, "readonly", "readonly", booleanAttribute], debounce: "debounce", sync: [2, "sync", "sync", booleanAttribute], syncedValue: "syncedValue", debounceTimeout: "debounceTimeout" }, outputs: { luzmoOptionChanged: "luzmoOptionChanged" }, exportAs: ["luzmoItemOptionPositionsNumberField"], features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoItemOptionPositionsNumberField_Template(rf, ctx) { if (rf & 1) {
|
|
103
103
|
i0.ɵɵprojectionDef();
|
|
104
104
|
i0.ɵɵprojection(0);
|
|
105
105
|
} }, encapsulation: 2 });
|
|
@@ -113,13 +113,7 @@ export class LuzmoItemOptionPositionsNumberField {
|
|
|
113
113
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
114
114
|
template: '<ng-content />'
|
|
115
115
|
}]
|
|
116
|
-
}], () => [], {
|
|
117
|
-
type: Input,
|
|
118
|
-
args: [{ alias: 'syncedValue' }]
|
|
119
|
-
}], debounceTimeout: [{
|
|
120
|
-
type: Input,
|
|
121
|
-
args: [{ alias: 'debounceTimeout' }]
|
|
122
|
-
}], positions: [{
|
|
116
|
+
}], () => [], { positions: [{
|
|
123
117
|
type: Input,
|
|
124
118
|
args: [{ alias: 'positions' }]
|
|
125
119
|
}], values: [{
|
|
@@ -143,5 +137,11 @@ export class LuzmoItemOptionPositionsNumberField {
|
|
|
143
137
|
}], sync: [{
|
|
144
138
|
type: Input,
|
|
145
139
|
args: [{ alias: 'sync', transform: booleanAttribute }]
|
|
140
|
+
}], syncedValue: [{
|
|
141
|
+
type: Input,
|
|
142
|
+
args: [{ alias: 'syncedValue' }]
|
|
143
|
+
}], debounceTimeout: [{
|
|
144
|
+
type: Input,
|
|
145
|
+
args: [{ alias: 'debounceTimeout' }]
|
|
146
146
|
}], luzmoOptionChanged: [{ type: i0.Output, args: ["luzmoOptionChanged"] }] }); })();
|
|
147
147
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LuzmoItemOptionPositionsNumberField, { className: "LuzmoItemOptionPositionsNumberField", filePath: "components/item-option-positions-number-field.ts", lineNumber: 16 }); })();
|
|
@@ -11,8 +11,6 @@ export declare class LuzmoItemOptionRadioButtonGroup implements OnChanges {
|
|
|
11
11
|
private readonly listenerCleanup;
|
|
12
12
|
/** The underlying custom element instance. Use to call imperative methods. */
|
|
13
13
|
get nativeElement(): LuzmoItemOptionRadioButtonGroupHostElement;
|
|
14
|
-
/** Internal timer handle used to debounce change events. */
|
|
15
|
-
debounceTimeout?: any;
|
|
16
14
|
/** The available options to choose from (key → label). */
|
|
17
15
|
values?: Record<string, string>;
|
|
18
16
|
/** Whether the control is disabled (non-interactive). */
|
|
@@ -25,6 +23,8 @@ export declare class LuzmoItemOptionRadioButtonGroup implements OnChanges {
|
|
|
25
23
|
parseValue?: unknown;
|
|
26
24
|
/** Optional transform applied to the control's value before it is emitted in the change event. */
|
|
27
25
|
toValue?: unknown;
|
|
26
|
+
/** Internal timer handle used to debounce change events. */
|
|
27
|
+
debounceTimeout?: any;
|
|
28
28
|
/** Emitted when the option value changes. */
|
|
29
29
|
readonly luzmoOptionChanged: import("@angular/core").OutputEmitterRef<CustomEvent<ItemOptionChangedEventDetail>>;
|
|
30
30
|
constructor();
|
|
@@ -38,7 +38,7 @@ export declare class LuzmoItemOptionRadioButtonGroup implements OnChanges {
|
|
|
38
38
|
private setHostProperty;
|
|
39
39
|
private bindEvents;
|
|
40
40
|
static ɵfac: i0.ɵɵFactoryDeclaration<LuzmoItemOptionRadioButtonGroup, never>;
|
|
41
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoItemOptionRadioButtonGroup, "luzmo-item-option-radio-button-group", ["luzmoItemOptionRadioButtonGroup"], { "
|
|
41
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoItemOptionRadioButtonGroup, "luzmo-item-option-radio-button-group", ["luzmoItemOptionRadioButtonGroup"], { "values": { "alias": "values"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "value": { "alias": "value"; "required": false; }; "default": { "alias": "default"; "required": false; }; "parseValue": { "alias": "parseValue"; "required": false; }; "toValue": { "alias": "toValue"; "required": false; }; "debounceTimeout": { "alias": "debounceTimeout"; "required": false; }; }, { "luzmoOptionChanged": "luzmoOptionChanged"; }, never, ["*"], true, never>;
|
|
42
42
|
static ngAcceptInputType_disabled: unknown;
|
|
43
43
|
}
|
|
44
44
|
/** The underlying custom element type for LuzmoItemOptionRadioButtonGroup */
|
|
@@ -15,8 +15,6 @@ export class LuzmoItemOptionRadioButtonGroup {
|
|
|
15
15
|
get nativeElement() {
|
|
16
16
|
return this.host;
|
|
17
17
|
}
|
|
18
|
-
/** Internal timer handle used to debounce change events. */
|
|
19
|
-
debounceTimeout;
|
|
20
18
|
/** The available options to choose from (key → label). */
|
|
21
19
|
values;
|
|
22
20
|
/** Whether the control is disabled (non-interactive). */
|
|
@@ -29,6 +27,8 @@ export class LuzmoItemOptionRadioButtonGroup {
|
|
|
29
27
|
parseValue;
|
|
30
28
|
/** Optional transform applied to the control's value before it is emitted in the change event. */
|
|
31
29
|
toValue;
|
|
30
|
+
/** Internal timer handle used to debounce change events. */
|
|
31
|
+
debounceTimeout;
|
|
32
32
|
/** Emitted when the option value changes. */
|
|
33
33
|
luzmoOptionChanged = output({ alias: 'luzmoOptionChanged' });
|
|
34
34
|
constructor() {
|
|
@@ -42,9 +42,6 @@ export class LuzmoItemOptionRadioButtonGroup {
|
|
|
42
42
|
ngOnChanges(changes) {
|
|
43
43
|
for (const key of Object.keys(changes)) {
|
|
44
44
|
switch (key) {
|
|
45
|
-
case 'debounceTimeout':
|
|
46
|
-
this.setHostProperty('debounceTimeout', changes['debounceTimeout'].currentValue);
|
|
47
|
-
break;
|
|
48
45
|
case 'values':
|
|
49
46
|
this.setHostProperty('values', changes['values'].currentValue);
|
|
50
47
|
break;
|
|
@@ -63,6 +60,9 @@ export class LuzmoItemOptionRadioButtonGroup {
|
|
|
63
60
|
case 'toValue':
|
|
64
61
|
this.setHostProperty('toValue', changes['toValue'].currentValue);
|
|
65
62
|
break;
|
|
63
|
+
case 'debounceTimeout':
|
|
64
|
+
this.setHostProperty('debounceTimeout', changes['debounceTimeout'].currentValue);
|
|
65
|
+
break;
|
|
66
66
|
default:
|
|
67
67
|
break;
|
|
68
68
|
}
|
|
@@ -84,7 +84,7 @@ export class LuzmoItemOptionRadioButtonGroup {
|
|
|
84
84
|
}));
|
|
85
85
|
}
|
|
86
86
|
static ɵfac = function LuzmoItemOptionRadioButtonGroup_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoItemOptionRadioButtonGroup)(); };
|
|
87
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoItemOptionRadioButtonGroup, selectors: [["luzmo-item-option-radio-button-group"]], inputs: {
|
|
87
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoItemOptionRadioButtonGroup, selectors: [["luzmo-item-option-radio-button-group"]], inputs: { values: "values", disabled: [2, "disabled", "disabled", booleanAttribute], value: "value", default: "default", parseValue: "parseValue", toValue: "toValue", debounceTimeout: "debounceTimeout" }, outputs: { luzmoOptionChanged: "luzmoOptionChanged" }, exportAs: ["luzmoItemOptionRadioButtonGroup"], features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoItemOptionRadioButtonGroup_Template(rf, ctx) { if (rf & 1) {
|
|
88
88
|
i0.ɵɵprojectionDef();
|
|
89
89
|
i0.ɵɵprojection(0);
|
|
90
90
|
} }, encapsulation: 2 });
|
|
@@ -98,10 +98,7 @@ export class LuzmoItemOptionRadioButtonGroup {
|
|
|
98
98
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
99
99
|
template: '<ng-content />'
|
|
100
100
|
}]
|
|
101
|
-
}], () => [], {
|
|
102
|
-
type: Input,
|
|
103
|
-
args: [{ alias: 'debounceTimeout' }]
|
|
104
|
-
}], values: [{
|
|
101
|
+
}], () => [], { values: [{
|
|
105
102
|
type: Input,
|
|
106
103
|
args: [{ alias: 'values' }]
|
|
107
104
|
}], disabled: [{
|
|
@@ -119,5 +116,8 @@ export class LuzmoItemOptionRadioButtonGroup {
|
|
|
119
116
|
}], toValue: [{
|
|
120
117
|
type: Input,
|
|
121
118
|
args: [{ alias: 'toValue' }]
|
|
119
|
+
}], debounceTimeout: [{
|
|
120
|
+
type: Input,
|
|
121
|
+
args: [{ alias: 'debounceTimeout' }]
|
|
122
122
|
}], luzmoOptionChanged: [{ type: i0.Output, args: ["luzmoOptionChanged"] }] }); })();
|
|
123
123
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LuzmoItemOptionRadioButtonGroup, { className: "LuzmoItemOptionRadioButtonGroup", filePath: "components/item-option-radio-button-group.ts", lineNumber: 16 }); })();
|
|
@@ -11,8 +11,6 @@ export declare class LuzmoItemOptionTextField implements OnChanges {
|
|
|
11
11
|
private readonly listenerCleanup;
|
|
12
12
|
/** The underlying custom element instance. Use to call imperative methods. */
|
|
13
13
|
get nativeElement(): LuzmoItemOptionTextFieldHostElement;
|
|
14
|
-
/** Internal timer handle used to debounce change events. */
|
|
15
|
-
debounceTimeout?: any;
|
|
16
14
|
/** The current text value. */
|
|
17
15
|
value?: string;
|
|
18
16
|
/** Whether the control is shown in an invalid state. */
|
|
@@ -23,6 +21,8 @@ export declare class LuzmoItemOptionTextField implements OnChanges {
|
|
|
23
21
|
placeholder?: string;
|
|
24
22
|
/** Delay in milliseconds before the change event is emitted after the user stops interacting. */
|
|
25
23
|
debounce?: number;
|
|
24
|
+
/** Internal timer handle used to debounce change events. */
|
|
25
|
+
debounceTimeout?: any;
|
|
26
26
|
/** Emitted when the option value changes. */
|
|
27
27
|
readonly luzmoOptionChanged: import("@angular/core").OutputEmitterRef<CustomEvent<ItemOptionChangedEventDetail>>;
|
|
28
28
|
constructor();
|
|
@@ -36,7 +36,7 @@ export declare class LuzmoItemOptionTextField implements OnChanges {
|
|
|
36
36
|
private setHostProperty;
|
|
37
37
|
private bindEvents;
|
|
38
38
|
static ɵfac: i0.ɵɵFactoryDeclaration<LuzmoItemOptionTextField, never>;
|
|
39
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoItemOptionTextField, "luzmo-item-option-text-field", ["luzmoItemOptionTextField"], { "
|
|
39
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoItemOptionTextField, "luzmo-item-option-text-field", ["luzmoItemOptionTextField"], { "value": { "alias": "value"; "required": false; }; "invalid": { "alias": "invalid"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "debounce": { "alias": "debounce"; "required": false; }; "debounceTimeout": { "alias": "debounceTimeout"; "required": false; }; }, { "luzmoOptionChanged": "luzmoOptionChanged"; }, never, ["*"], true, never>;
|
|
40
40
|
static ngAcceptInputType_invalid: unknown;
|
|
41
41
|
static ngAcceptInputType_readonly: unknown;
|
|
42
42
|
}
|
|
@@ -15,8 +15,6 @@ export class LuzmoItemOptionTextField {
|
|
|
15
15
|
get nativeElement() {
|
|
16
16
|
return this.host;
|
|
17
17
|
}
|
|
18
|
-
/** Internal timer handle used to debounce change events. */
|
|
19
|
-
debounceTimeout;
|
|
20
18
|
/** The current text value. */
|
|
21
19
|
value;
|
|
22
20
|
/** Whether the control is shown in an invalid state. */
|
|
@@ -27,6 +25,8 @@ export class LuzmoItemOptionTextField {
|
|
|
27
25
|
placeholder;
|
|
28
26
|
/** Delay in milliseconds before the change event is emitted after the user stops interacting. */
|
|
29
27
|
debounce;
|
|
28
|
+
/** Internal timer handle used to debounce change events. */
|
|
29
|
+
debounceTimeout;
|
|
30
30
|
/** Emitted when the option value changes. */
|
|
31
31
|
luzmoOptionChanged = output({ alias: 'luzmoOptionChanged' });
|
|
32
32
|
constructor() {
|
|
@@ -40,9 +40,6 @@ export class LuzmoItemOptionTextField {
|
|
|
40
40
|
ngOnChanges(changes) {
|
|
41
41
|
for (const key of Object.keys(changes)) {
|
|
42
42
|
switch (key) {
|
|
43
|
-
case 'debounceTimeout':
|
|
44
|
-
this.setHostProperty('debounceTimeout', changes['debounceTimeout'].currentValue);
|
|
45
|
-
break;
|
|
46
43
|
case 'value':
|
|
47
44
|
this.setHostProperty('value', changes['value'].currentValue);
|
|
48
45
|
break;
|
|
@@ -58,6 +55,9 @@ export class LuzmoItemOptionTextField {
|
|
|
58
55
|
case 'debounce':
|
|
59
56
|
this.setHostProperty('debounce', changes['debounce'].currentValue);
|
|
60
57
|
break;
|
|
58
|
+
case 'debounceTimeout':
|
|
59
|
+
this.setHostProperty('debounceTimeout', changes['debounceTimeout'].currentValue);
|
|
60
|
+
break;
|
|
61
61
|
default:
|
|
62
62
|
break;
|
|
63
63
|
}
|
|
@@ -79,7 +79,7 @@ export class LuzmoItemOptionTextField {
|
|
|
79
79
|
}));
|
|
80
80
|
}
|
|
81
81
|
static ɵfac = function LuzmoItemOptionTextField_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoItemOptionTextField)(); };
|
|
82
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoItemOptionTextField, selectors: [["luzmo-item-option-text-field"]], inputs: {
|
|
82
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoItemOptionTextField, selectors: [["luzmo-item-option-text-field"]], inputs: { value: "value", invalid: [2, "invalid", "invalid", booleanAttribute], readonly: [2, "readonly", "readonly", booleanAttribute], placeholder: "placeholder", debounce: "debounce", debounceTimeout: "debounceTimeout" }, outputs: { luzmoOptionChanged: "luzmoOptionChanged" }, exportAs: ["luzmoItemOptionTextField"], features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoItemOptionTextField_Template(rf, ctx) { if (rf & 1) {
|
|
83
83
|
i0.ɵɵprojectionDef();
|
|
84
84
|
i0.ɵɵprojection(0);
|
|
85
85
|
} }, encapsulation: 2 });
|
|
@@ -93,10 +93,7 @@ export class LuzmoItemOptionTextField {
|
|
|
93
93
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
94
94
|
template: '<ng-content />'
|
|
95
95
|
}]
|
|
96
|
-
}], () => [], {
|
|
97
|
-
type: Input,
|
|
98
|
-
args: [{ alias: 'debounceTimeout' }]
|
|
99
|
-
}], value: [{
|
|
96
|
+
}], () => [], { value: [{
|
|
100
97
|
type: Input,
|
|
101
98
|
args: [{ alias: 'value' }]
|
|
102
99
|
}], invalid: [{
|
|
@@ -111,5 +108,8 @@ export class LuzmoItemOptionTextField {
|
|
|
111
108
|
}], debounce: [{
|
|
112
109
|
type: Input,
|
|
113
110
|
args: [{ alias: 'debounce' }]
|
|
111
|
+
}], debounceTimeout: [{
|
|
112
|
+
type: Input,
|
|
113
|
+
args: [{ alias: 'debounceTimeout' }]
|
|
114
114
|
}], luzmoOptionChanged: [{ type: i0.Output, args: ["luzmoOptionChanged"] }] }); })();
|
|
115
115
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LuzmoItemOptionTextField, { className: "LuzmoItemOptionTextField", filePath: "components/item-option-text-field.ts", lineNumber: 16 }); })();
|
|
@@ -34,7 +34,7 @@ export declare class LuzmoItemSlotPickerPanel implements OnChanges {
|
|
|
34
34
|
datasetsDataFields?: Array<DatasetsDataFields & Pick<DatasetMetadata, 'description'>>;
|
|
35
35
|
/** Array of dataset IDs to fetch and display. Used as an alternative to datasetsDataFields - when provided (and datasetsDataFields is empty), the component will fetch the dataset metadata automatically. Requires apiUrl, authKey, and authToken to be set. */
|
|
36
36
|
datasetIds?: string[];
|
|
37
|
-
/** The currently selected dataset ID. If not provided, defaults to the first available dataset. */
|
|
37
|
+
/** The currently selected dataset ID. If not provided, defaults to the first available dataset, except when the panel fetches the dataset list itself. */
|
|
38
38
|
selectedDatasetId?: string;
|
|
39
39
|
/** Whether to show the dataset picker dropdown. */
|
|
40
40
|
datasetPicker?: boolean;
|
|
@@ -35,7 +35,7 @@ export class LuzmoItemSlotPickerPanel {
|
|
|
35
35
|
datasetsDataFields;
|
|
36
36
|
/** Array of dataset IDs to fetch and display. Used as an alternative to datasetsDataFields - when provided (and datasetsDataFields is empty), the component will fetch the dataset metadata automatically. Requires apiUrl, authKey, and authToken to be set. */
|
|
37
37
|
datasetIds;
|
|
38
|
-
/** The currently selected dataset ID. If not provided, defaults to the first available dataset. */
|
|
38
|
+
/** The currently selected dataset ID. If not provided, defaults to the first available dataset, except when the panel fetches the dataset list itself. */
|
|
39
39
|
selectedDatasetId;
|
|
40
40
|
/** Whether to show the dataset picker dropdown. */
|
|
41
41
|
datasetPicker;
|
|
@@ -42,6 +42,8 @@ export declare class LuzmoItemSlotPicker implements OnChanges {
|
|
|
42
42
|
label?: string;
|
|
43
43
|
/** Whether the picker allows single or multiple selections. Only relevant if the slot configuration allows multiple data fields. */
|
|
44
44
|
selects?: 'single' | 'multiple';
|
|
45
|
+
/** Whether the search input is visible: `on`, `off`, or `auto`. */
|
|
46
|
+
search?: 'on' | 'off' | 'auto';
|
|
45
47
|
/** Where to show icons */
|
|
46
48
|
icons?: 'none' | 'menu-only' | 'all';
|
|
47
49
|
/** The placeholder text for the picker is no value selected. */
|
|
@@ -60,8 +62,6 @@ export declare class LuzmoItemSlotPicker implements OnChanges {
|
|
|
60
62
|
hideClear?: boolean;
|
|
61
63
|
/** The language for UI labels. Supported values: 'en', 'nl', 'fr', 'de', 'es' */
|
|
62
64
|
language?: string;
|
|
63
|
-
/** Whether the search input is visible: `on`, `off`, or `auto`. */
|
|
64
|
-
search?: 'on' | 'off' | 'auto';
|
|
65
65
|
/** The size of the element */
|
|
66
66
|
size?: 's' | 'm' | 'l' | 'xl';
|
|
67
67
|
/** Announces that the slot contents has changed */
|
|
@@ -77,7 +77,7 @@ export declare class LuzmoItemSlotPicker implements OnChanges {
|
|
|
77
77
|
private setHostProperty;
|
|
78
78
|
private bindEvents;
|
|
79
79
|
static ɵfac: i0.ɵɵFactoryDeclaration<LuzmoItemSlotPicker, never>;
|
|
80
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoItemSlotPicker, "luzmo-item-slot-picker", ["luzmoItemSlotPicker"], { "apiUrl": { "alias": "apiUrl"; "required": false; }; "authKey": { "alias": "authKey"; "required": false; }; "authToken": { "alias": "authToken"; "required": false; }; "itemType": { "alias": "itemType"; "required": false; }; "slotName": { "alias": "slotName"; "required": false; }; "slotConfiguration": { "alias": "slotConfiguration"; "required": false; }; "slotContents": { "alias": "slotContents"; "required": false; }; "contentLanguage": { "alias": "contentLanguage"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "grows": { "alias": "grows"; "required": false; }; "menu": { "alias": "menu"; "required": false; }; "hasLabel": { "alias": "hasLabel"; "required": false; }; "label": { "alias": "label"; "required": false; }; "selects": { "alias": "selects"; "required": false; }; "
|
|
80
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoItemSlotPicker, "luzmo-item-slot-picker", ["luzmoItemSlotPicker"], { "apiUrl": { "alias": "apiUrl"; "required": false; }; "authKey": { "alias": "authKey"; "required": false; }; "authToken": { "alias": "authToken"; "required": false; }; "itemType": { "alias": "itemType"; "required": false; }; "slotName": { "alias": "slotName"; "required": false; }; "slotConfiguration": { "alias": "slotConfiguration"; "required": false; }; "slotContents": { "alias": "slotContents"; "required": false; }; "contentLanguage": { "alias": "contentLanguage"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "grows": { "alias": "grows"; "required": false; }; "menu": { "alias": "menu"; "required": false; }; "hasLabel": { "alias": "hasLabel"; "required": false; }; "label": { "alias": "label"; "required": false; }; "selects": { "alias": "selects"; "required": false; }; "search": { "alias": "search"; "required": false; }; "icons": { "alias": "icons"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "datasetsDataFields": { "alias": "datasetsDataFields"; "required": false; }; "placement": { "alias": "placement"; "required": false; }; "slotMenuPlacement": { "alias": "slotMenuPlacement"; "required": false; }; "slotMenuMode": { "alias": "slotMenuMode"; "required": false; }; "hideConfiguration": { "alias": "hideConfiguration"; "required": false; }; "hideClear": { "alias": "hideClear"; "required": false; }; "language": { "alias": "language"; "required": false; }; "size": { "alias": "size"; "required": false; }; }, { "luzmoSlotContentsChanged": "luzmoSlotContentsChanged"; }, never, ["*"], true, never>;
|
|
81
81
|
static ngAcceptInputType_disabled: unknown;
|
|
82
82
|
static ngAcceptInputType_grows: unknown;
|
|
83
83
|
static ngAcceptInputType_hasLabel: unknown;
|
|
@@ -43,6 +43,8 @@ export class LuzmoItemSlotPicker {
|
|
|
43
43
|
label;
|
|
44
44
|
/** Whether the picker allows single or multiple selections. Only relevant if the slot configuration allows multiple data fields. */
|
|
45
45
|
selects;
|
|
46
|
+
/** Whether the search input is visible: `on`, `off`, or `auto`. */
|
|
47
|
+
search;
|
|
46
48
|
/** Where to show icons */
|
|
47
49
|
icons;
|
|
48
50
|
/** The placeholder text for the picker is no value selected. */
|
|
@@ -61,8 +63,6 @@ export class LuzmoItemSlotPicker {
|
|
|
61
63
|
hideClear;
|
|
62
64
|
/** The language for UI labels. Supported values: 'en', 'nl', 'fr', 'de', 'es' */
|
|
63
65
|
language;
|
|
64
|
-
/** Whether the search input is visible: `on`, `off`, or `auto`. */
|
|
65
|
-
search;
|
|
66
66
|
/** The size of the element */
|
|
67
67
|
size;
|
|
68
68
|
/** Announces that the slot contents has changed */
|
|
@@ -120,6 +120,9 @@ export class LuzmoItemSlotPicker {
|
|
|
120
120
|
case 'selects':
|
|
121
121
|
this.setHostProperty('selects', changes['selects'].currentValue);
|
|
122
122
|
break;
|
|
123
|
+
case 'search':
|
|
124
|
+
this.setHostProperty('search', changes['search'].currentValue);
|
|
125
|
+
break;
|
|
123
126
|
case 'icons':
|
|
124
127
|
this.setHostProperty('icons', changes['icons'].currentValue);
|
|
125
128
|
break;
|
|
@@ -147,9 +150,6 @@ export class LuzmoItemSlotPicker {
|
|
|
147
150
|
case 'language':
|
|
148
151
|
this.setHostProperty('language', changes['language'].currentValue);
|
|
149
152
|
break;
|
|
150
|
-
case 'search':
|
|
151
|
-
this.setHostProperty('search', changes['search'].currentValue);
|
|
152
|
-
break;
|
|
153
153
|
case 'size':
|
|
154
154
|
this.setHostProperty('size', changes['size'].currentValue);
|
|
155
155
|
break;
|
|
@@ -174,7 +174,7 @@ export class LuzmoItemSlotPicker {
|
|
|
174
174
|
}));
|
|
175
175
|
}
|
|
176
176
|
static ɵfac = function LuzmoItemSlotPicker_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoItemSlotPicker)(); };
|
|
177
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoItemSlotPicker, selectors: [["luzmo-item-slot-picker"]], inputs: { apiUrl: "apiUrl", authKey: "authKey", authToken: "authToken", itemType: "itemType", slotName: "slotName", slotConfiguration: "slotConfiguration", slotContents: "slotContents", contentLanguage: "contentLanguage", disabled: [2, "disabled", "disabled", booleanAttribute], grows: [2, "grows", "grows", booleanAttribute], menu: "menu", hasLabel: [2, "hasLabel", "hasLabel", booleanAttribute], label: "label", selects: "selects", icons: "icons", placeholder: "placeholder", datasetsDataFields: "datasetsDataFields", placement: "placement", slotMenuPlacement: "slotMenuPlacement", slotMenuMode: "slotMenuMode", hideConfiguration: [2, "hideConfiguration", "hideConfiguration", booleanAttribute], hideClear: [2, "hideClear", "hideClear", booleanAttribute], language: "language",
|
|
177
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoItemSlotPicker, selectors: [["luzmo-item-slot-picker"]], inputs: { apiUrl: "apiUrl", authKey: "authKey", authToken: "authToken", itemType: "itemType", slotName: "slotName", slotConfiguration: "slotConfiguration", slotContents: "slotContents", contentLanguage: "contentLanguage", disabled: [2, "disabled", "disabled", booleanAttribute], grows: [2, "grows", "grows", booleanAttribute], menu: "menu", hasLabel: [2, "hasLabel", "hasLabel", booleanAttribute], label: "label", selects: "selects", search: "search", icons: "icons", placeholder: "placeholder", datasetsDataFields: "datasetsDataFields", placement: "placement", slotMenuPlacement: "slotMenuPlacement", slotMenuMode: "slotMenuMode", hideConfiguration: [2, "hideConfiguration", "hideConfiguration", booleanAttribute], hideClear: [2, "hideClear", "hideClear", booleanAttribute], language: "language", size: "size" }, outputs: { luzmoSlotContentsChanged: "luzmoSlotContentsChanged" }, exportAs: ["luzmoItemSlotPicker"], features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoItemSlotPicker_Template(rf, ctx) { if (rf & 1) {
|
|
178
178
|
i0.ɵɵprojectionDef();
|
|
179
179
|
i0.ɵɵprojection(0);
|
|
180
180
|
} }, encapsulation: 2 });
|
|
@@ -230,6 +230,9 @@ export class LuzmoItemSlotPicker {
|
|
|
230
230
|
}], selects: [{
|
|
231
231
|
type: Input,
|
|
232
232
|
args: [{ alias: 'selects' }]
|
|
233
|
+
}], search: [{
|
|
234
|
+
type: Input,
|
|
235
|
+
args: [{ alias: 'search' }]
|
|
233
236
|
}], icons: [{
|
|
234
237
|
type: Input,
|
|
235
238
|
args: [{ alias: 'icons' }]
|
|
@@ -257,9 +260,6 @@ export class LuzmoItemSlotPicker {
|
|
|
257
260
|
}], language: [{
|
|
258
261
|
type: Input,
|
|
259
262
|
args: [{ alias: 'language' }]
|
|
260
|
-
}], search: [{
|
|
261
|
-
type: Input,
|
|
262
|
-
args: [{ alias: 'search' }]
|
|
263
263
|
}], size: [{
|
|
264
264
|
type: Input,
|
|
265
265
|
args: [{ alias: 'size' }]
|
package/angular/package.json
CHANGED
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@angular/core": "^17.3.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0 || ^22.0.0",
|
|
31
31
|
"@angular/forms": "^17.3.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0 || ^22.0.0",
|
|
32
|
-
"@luzmo/analytics-components-kit": "1.
|
|
32
|
+
"@luzmo/analytics-components-kit": "1.4.0"
|
|
33
33
|
},
|
|
34
|
-
"version": "1.
|
|
34
|
+
"version": "1.4.0",
|
|
35
35
|
"repository": {
|
|
36
36
|
"type": "git",
|
|
37
37
|
"url": "git+https://github.com/cumulio-internal/analytics-components-kit.git"
|
|
@@ -7,7 +7,8 @@ export declare function pageAcrossSources(sources: DashboardSource[], offset: nu
|
|
|
7
7
|
/**
|
|
8
8
|
* Built-in `DashboardActions` on the public API with the given credentials. Rights come from the token: an
|
|
9
9
|
* embed token's `access.dashboards` grants plus the user's own access rights. `create` is only present for
|
|
10
|
-
* an embed token with a designer or owner role or for any other token type
|
|
10
|
+
* an embed token with a designer or owner role, or for any other token type unless the user is an
|
|
11
|
+
* organization viewer (a user with no organization role keeps it). With the `flag_dashboard_variants`
|
|
11
12
|
* user flag, use-only dashboards and their variants are listed, and `addToVariant` follows the `create` rule.
|
|
12
13
|
*/
|
|
13
14
|
export declare function createDashboardActions(config: BuiltInDashboardActionsConfig): Promise<DashboardActions>;
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
18
|
* SOFTWARE.
|
|
19
19
|
* */
|
|
20
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../add-to-dashboard-
|
|
20
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../add-to-dashboard-BtzTZdjN.cjs");Object.defineProperty(exports,"LuzmoAddToDashboard",{enumerable:!0,get:function(){return e.t}}),exports.createDashboardActions=e.n;
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
18
|
* SOFTWARE.
|
|
19
19
|
* */
|
|
20
|
-
export { t as LuzmoAddToDashboard, n as createDashboardActions } from "../add-to-dashboard-
|
|
20
|
+
export { t as LuzmoAddToDashboard, n as createDashboardActions } from "../add-to-dashboard-Bu6S3qVz.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
|
-
require("./tokens-BWMfo_w4.cjs");const e=require("./base-CGDNY_7v.cjs"),t=require("./decorate-DCJt-2rt.cjs"),n=require("./localized-mixin-EoNvtTBG.cjs"),r=require("./data-broker-DCghLjhq.cjs"),i=require("./localize-D3i4Epy_.cjs"),a=require("./chart-helpers-ufZ6VbXs.cjs");let o=require("@luzmo/icons");require("@luzmo/lucero/action-button"),require("@luzmo/lucero/button"),require("@luzmo/lucero/icon"),require("@luzmo/lucero/overlay"),require("@luzmo/lucero/popover"),require("@luzmo/lucero/tooltip");let s=require("lit"),c=require("lit/decorators.js"),l=require("@lit/localize");require("@luzmo/lucero/progress-circle"),require("@luzmo/lucero/checkbox"),require("@luzmo/lucero/divider"),require("@luzmo/lucero/field-group"),require("@luzmo/lucero/menu"),require("@luzmo/lucero/notice"),require("@luzmo/lucero/search");let u=require("lit/directives/if-defined.js");var d=`: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}`,f=`0.1.107`,p=`0.1.0`,m=[`id`,`name`,`contents`,`modified_at`,`is_variant`,`original_id`],h=new Set([`designer`,`owner`]),g=`flag_dashboard_variants`,_=[`desktop`,`tablet`,`mobile`];async function v(e,t,n){let r=[],i=t,a=0;for(let t of e){let e=n-r.length,o=await t(i,Math.max(e,1));e>0&&r.push(...o.rows.slice(0,e)),i=Math.max(0,i-o.count),a+=o.count}return{rows:r,total:a}}async function y(e){let t=await e.fetchApi(`/user`,{action:`get`,version:p,find:{where:{id:`me`},attributes:[`id`,`flags`]}});return{id:t.rows?.[0]?.id??``,flags:t.rows?.[0]?.flags??[]}}async function b(e,t){return(await e.fetchApi(`/authorization`,{action:`get`,version:p,find:{where:{id:t}}})).rows?.[0]}async function x(e,t,n){let r={...t,where:{...t.where,type:`dashboard`}},i=await e.fetchApi(`/securable`,{action:`get`,version:p,find:r},{signal:n});return{rows:i.rows??[],count:i.count??i.rows?.length??0}}function S(e){let t={modifyIds:new Set,useOnlyIds:new Set};for(let n of e?.access?.dashboards??[])n.rights?.Modify?t.modifyIds.add(n.id):n.rights?.Use&&t.useOnlyIds.add(n.id);return t}function C(){return{version:f,syncScreenModes:!0,views:_.map(e=>({screenModus:e,options:{theme:{id:`default`}},filterGroups:[],items:[]})),timezone:{type:`fixed`,id:`UTC`}}}function w(e){return e?{search:{match_types:[`name`,`description`],keyphrase:e,securable_types:[`dashboard`]}}:{}}function T(e,t){return{include:[{model:`User`,as:`allUsers`,attributes:[],required:!0,where:{id:e,...Object.fromEntries(Object.entries(t).map(([e,t])=>[`securableAccessRight.${e}`,t]))}}]}}async function E(e){let t=new r.t({apiUrl:e.apiUrl,authKey:e.authKey,authToken:e.authToken,skipNetworkListeners:!0}),[n,a]=await Promise.all([y(t),b(t,e.authKey)]),o=S(a),s=a?.type!==`embed`||h.has(a.role??``),c=!!n.id&&n.flags.includes(g),u=[...o.modifyIds,...c?o.useOnlyIds:[]],d=u.length>0?{id:{notIn:u}}:{},f=(t,n=!1)=>{let r=[...new Set((t.contents?.views??[]).map(e=>e.screenModus))];return{id:t.id,name:i.t(t.name??{},e.language),syncScreenModes:t.contents?.syncScreenModes!==!1,screenModes:r.length>0?r:[`desktop`],...n?{requiresVariant:n}:{}}},_,E=(e,n)=>async(r,i)=>{if(u.length===0)return{count:0,rows:[]};let a=r>0&&_?.search===e?_.rows:void 0;return a||(a=(await x(t,{where:{is_variant:!1,archived_at:null,id:{in:u}},attributes:m,...w(e)},n)).rows.map(e=>f(e,!o.modifyIds.has(e.id))).sort((e,t)=>e.name.localeCompare(t.name)),_={search:e,rows:a}),{count:a.length,rows:a.slice(r,r+i)}},D=(e,r,i,a)=>async(o,s)=>{let c=await x(t,{where:{is_variant:!1,archived_at:null,...d},attributes:m,...T(n.id,i),...w(e),limit:s,offset:o,order:[[`modified_at`,`desc`]]},r);return{count:c.count,rows:c.rows.map(e=>f(e,a))}},O=async(e,n,r,i)=>{await t.fetchApi(`/securable`,{action:`update`,version:p,id:e,properties:{append_item:{item:n,...r?.length?{screenModes:r}:{}}}},{signal:i})},k=async(e,n,r)=>{try{await O(e.id,n,r)}catch(n){throw await t.fetchApi(`/securable`,{action:`delete`,version:p,id:e.id}).catch(()=>void 0),n}},A=async(e,n)=>await t.fetchApi(`/securable`,{action:`create`,version:p,properties:{...e,type:`dashboard`},associations:n});return{async list(e,t){return n.id?await v([E(e.search,t.signal),...c?[D(e.search,t.signal,{flagUse:!0,flagModify:!1},!0)]:[],D(e.search,t.signal,{flagModify:!0},!1)],e.offset,e.limit):{rows:[],total:0}},async add(e,t,n,r){await O(e.id,t,n.screenModes,r.signal)},...s?{async create(t,n){let r=await A({name:n.name?{[e.language]:n.name}:{},contents:C()});return await k(r,t,void 0),f(r)}}:{},...c?{async listVariants(e,r){return(await x(t,{where:{is_variant:!0,original_id:e.id,archived_at:null},attributes:m,...T(n.id,{flagModify:!0}),order:[[`modified_at`,`desc`]]},r.signal)).rows.map(e=>f(e))}}:{},...c&&s?{async addToVariant(n,r,i){let a=(await x(t,{where:{id:n.id},attributes:[`id`,`name`,`contents`]})).rows[0];if(!a?.contents)throw Error((0,l.msg)(`The dashboard was not found.`,{desc:`Adding the chart to a variant failed because the original dashboard could not be loaded`}));let o=a.name??{},s=await A({name:i.name?{...o,[e.language]:i.name}:o,contents:a.contents},[{role:`original`,id:n.id}]);return await k(s,r,i.screenModes),f({...s,contents:s.contents??a.contents})}}:{}}}function D(e){let{theme:t,...n}=e.options??{};return{...a.o(e),options:n}}function O(e,t){let n=new Set(e),r=e.length+1;for(;n.has(t(r));)r+=1;return r}var k=20,A=300,j=8,M=48,N=`__luzmo-new-dashboard`,P=`__luzmo-new-variant`,F=new Map,I=0,L=class extends n.t(e.n(e.i,{validSizes:Object.values(e.t)})){constructor(...e){super(...e),this.chart=null,this.dashboardActions=null,this.authKey=``,this.authToken=``,this.apiUrl=`https://api.luzmo.com`,this.placement=`bottom-end`,this.disabled=!1,this._open=!1,this._actions=null,this._step=`list`,this._rows=[],this._hasMore=!1,this._loading=!1,this._listFailed=!1,this._original=null,this._variants=[],this._variantsLoading=!1,this._variantsFailed=!1,this._pending=null,this._screenModes=[],this._saving=!1,this._status=null,this._triggerId=`add-to-dashboard-trigger-${++I}`,this._search=``,this._actionsGeneration=0,this._reloadOnUpdate=!1}static get styles(){let e=super.styles??[];return[...Array.isArray(e)?e:[e],(0,s.unsafeCSS)(d)]}get _hasSource(){return!!this.dashboardActions||!!(this.authKey&&this.authToken)}connectedCallback(){super.connectedCallback(),this._status&&this._startFittingAlert()}disconnectedCallback(){super.disconnectedCallback(),this._handleClosed(),this._actionsGeneration+=1,this._saveAbort?.abort(),this._stopFittingAlert()}willUpdate(e){super.willUpdate(e),(e.has(`dashboardActions`)||e.has(`authKey`)||e.has(`authToken`)||e.has(`apiUrl`)||e.has(`language`))&&(this._actions=null,this._actionsGeneration+=1,this._open&&(this._listAbort?.abort(),this._variantsAbort?.abort(),this._step=`list`,this._original=null,this._pending=null,this._rows=[],this._open=this._hasSource,this._reloadOnUpdate=this._hasSource)),e.has(`disabled`)&&this.disabled&&(this._open=!1),e.has(`chart`)&&!this.chart&&this._handleClosed()}updated(e){super.updated(e),this._reloadOnUpdate&&(this._reloadOnUpdate=!1,this._loadList()),e.has(`_step`)&&this._open&&this._focusStep(),e.has(`_status`)&&(this._status?this._startFittingAlert():this._stopFittingAlert())}get _alertContainer(){let e=this.getRootNode();return this.parentElement??(e instanceof ShadowRoot?e.host:null)}_startFittingAlert(){this._fitAlert();let e=this._alertContainer;!this._alertResizeObserver&&e&&(this._alertResizeObserver=new ResizeObserver(()=>this._fitAlert()),this._alertResizeObserver.observe(this),this._alertResizeObserver.observe(e))}_stopFittingAlert(){this._alertResizeObserver?.disconnect(),this._alertResizeObserver=void 0}_fitAlert(){let e=this._noticeElement,t=this._alertContainer;if(!e||!t)return;let n=this.getBoundingClientRect(),r=t.getBoundingClientRect(),i=Number.parseFloat(getComputedStyle(t).paddingInlineStart)||0,a=(this.isLTR?n.right-r.left:r.right-n.left)-i;e.style.setProperty(`--luzmo-notice-max-inline-size`,`${Math.max(0,a)}px`)}async _resolveActions(){if(this.dashboardActions)return this.dashboardActions;let e={apiUrl:this.apiUrl,authKey:this.authKey,authToken:this.authToken,language:this.language},t=JSON.stringify(e),n=F.get(t);return n||(F.clear(),n=E(e),F.set(t,n),n.catch(()=>F.delete(t))),await n}_dispatch(e,t){let n=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});this.dispatchEvent(n)}_displayName(e){return e.name.trim()||(0,l.msg)(`Untitled dashboard`,{desc:`Fallback name of a dashboard without a name`})}_variantName(e,t){let n=this._displayName(e);return(0,l.msg)(l.str`${n} (variant ${t})`,{desc:`Name of a new dashboard variant`})}_screenModeChoices(){return[{name:`mobile`,label:(0,l.msg)(`Smartphone`,{desc:`Screen mode name`}),size:`< 768px`,icon:o.luzmoMobile},{name:`tablet`,label:(0,l.msg)(`Tablet`,{desc:`Screen mode name`}),size:`≥ 768px`,icon:o.luzmoTablet},{name:`desktop`,label:(0,l.msg)(`Desktop`,{desc:`Screen mode name`}),size:`≥ 1200px`,icon:o.luzmoLaptop},{name:`largeScreen`,label:(0,l.msg)(`Large screen`,{desc:`Screen mode name`}),size:`≥ 1600px`,icon:o.luzmoDesktop},{name:`fixed`,label:(0,l.msg)(`Fixed width`,{desc:`Screen mode name`}),icon:o.luzmoArrowsHorizontal}]}async _handleOpened(e){e.target===e.currentTarget&&(this._open=!0,this._step=`list`,this._search=``,this._original=null,this._pending=null,this._rows=[],await this.updateComplete,this._searchElement?.focus(),await this._loadList())}async _loadList(){let e=this._actionsGeneration;this._loading=!0,this._listFailed=!1;try{let t=this._actions??await this._resolveActions();if(e!==this._actionsGeneration)return;this._actions=t}catch(t){if(!this.isConnected||e!==this._actionsGeneration)return;console.error(`Failed to resolve the add to dashboard actions:`,t),this._loading=!1,this._listFailed=!0;return}this.isConnected&&this._open&&await this._loadPage(!1)}_handleClosed(e){e&&e.target!==e.currentTarget||(this._open=!1,clearTimeout(this._searchTimer),this._listAbort?.abort(),this._variantsAbort?.abort())}async _loadPage(e){let t=this._actions;if(!t)return;this._listAbort?.abort();let n=new AbortController;this._listAbort=n,this._loading=!0,this._listFailed=!1,e||(this._rows=[]);try{let e=await t.list({search:this._search,offset:this._rows.length,limit:k},{signal:n.signal});if(n.signal.aborted)return;this._rows=[...this._rows,...e.rows],this._hasMore=e.total===void 0?e.rows.length===k:this._rows.length<e.total}catch(e){if(n.signal.aborted)return;console.error(`Failed to load dashboards:`,e),this._listFailed=!0}finally{n.signal.aborted||(this._loading=!1)}}_handleSearchInput(e){this._search=String(e.target?.value??``),clearTimeout(this._searchTimer),this._searchTimer=setTimeout(()=>void this._loadPage(!1),A)}_handleListScroll(e){let t=e.target;this._hasMore&&!this._loading&&t.scrollHeight-t.scrollTop-t.clientHeight<=M&&this._loadPage(!0)}_menuValue(e){return e.stopPropagation(),e.target.value??``}_handleListChange(e){let t=this._menuValue(e);if(t===N){this._actions?.create&&this._save({kind:`create`});return}let n=this._rows.find(e=>e.id===t);n&&(n.requiresVariant?(this._original=n,this._step=`variants`,this._loadVariants()):this._selectTarget({kind:`add`,dashboard:n,isVariant:!1},n))}_handleVariantChange(e){let t=this._menuValue(e),n=this._original;if(!n)return;if(t===P){if(!this._actions?.addToVariant)return;let e=this._variants.map(e=>this._displayName(e)),t=this._variantName(n,O(e,e=>this._variantName(n,e)));this._selectTarget({kind:`variant`,original:n,name:t},n);return}let r=this._variants.find(e=>e.id===t);r&&this._selectTarget({kind:`add`,dashboard:r,isVariant:!0},r)}_selectTarget(e,t){t.syncScreenModes!==!1||!t.screenModes?.length?this._save(e):(this._pending=e,this._screenModes=[...t.screenModes??[]],this._step=`screenModes`)}async _loadVariants(){let e=this._actions,t=this._original;if(this._variantsAbort?.abort(),this._variants=[],this._variantsLoading=!1,this._variantsFailed=!1,!e?.listVariants||!t)return;let n=new AbortController;this._variantsAbort=n,this._variantsLoading=!0;try{let r=await e.listVariants(t,{signal:n.signal});n.signal.aborted||(this._variants=r)}catch(e){n.signal.aborted||(console.error(`Failed to load dashboard variants:`,e),this._variantsFailed=!0)}finally{n.signal.aborted||(this._variantsLoading=!1)}}_handleBack(){this._step===`screenModes`&&this._original?this._step=`variants`:(this._step=`list`,this._original=null),this._pending=null}_toggleScreenMode(e){this._screenModes=this._screenModes.includes(e)?this._screenModes.filter(t=>t!==e):[...this._screenModes,e]}_handleConfirmScreenModes(){this._pending&&this._screenModes.length>0&&this._save(this._pending,{screenModes:[...this._screenModes]})}async _save(e,t={}){let n=this._actions;if(!n||!this.chart||this._saving)return;this._open=!1,this._saving=!0,this._setStatus(null),this._saveAbort=new AbortController;let r=D(this.chart),i={signal:this._saveAbort.signal};try{let a;if(e.kind===`create`&&n.create)a=await n.create(r,t,i);else if(e.kind===`variant`&&n.addToVariant)a=await n.addToVariant(e.original,r,{...t,name:e.name},i);else if(e.kind===`add`)a=await n.add(e.dashboard,r,t,i)||e.dashboard;else return;if(i.signal.aborted)return;this._setStatus({kind:`success`,dashboard:a,isVariant:e.kind===`variant`||e.kind===`add`&&e.isVariant,openDashboard:n.openDashboard?.bind(n)}),this._dispatch(`luzmo-chart-added`,{dashboard:a})}catch(e){if(i.signal.aborted)return;console.error(`Failed to add the chart to a dashboard:`,e),this._setStatus({kind:`error`,message:e instanceof Error&&e.message?e.message:void 0}),this._dispatch(`luzmo-chart-add-failed`,{error:e})}finally{this._saving=!1}await this.updateComplete,this.isConnected&&this._isFocusLost()&&this._focusTrigger()}_setStatus(e){this._status=e}_focusTrigger(){this._triggerElement?.focus()}_isFocusLost(){return!document.activeElement||document.activeElement===document.body}async _handleNoticeClose(e){e.stopPropagation();let t=e.currentTarget.matches(`:focus-within`);this._setStatus(null),await this.updateComplete,t&&this._isFocusLost()&&this._focusTrigger()}async _focusStep(){let e=this._step===`list`?this._searchElement:this._backElement;await e?.updateComplete,e?.focus()}_renderRow(e){return s.html`
|
|
20
|
+
require("./tokens-BWMfo_w4.cjs");const e=require("./base-CGDNY_7v.cjs"),t=require("./decorate-DCJt-2rt.cjs"),n=require("./localized-mixin-EoNvtTBG.cjs"),r=require("./data-broker-DCghLjhq.cjs"),i=require("./localize-D3i4Epy_.cjs"),a=require("./chart-helpers-BHxQbLBw.cjs");let o=require("@luzmo/icons");require("@luzmo/lucero/action-button"),require("@luzmo/lucero/button"),require("@luzmo/lucero/icon"),require("@luzmo/lucero/overlay"),require("@luzmo/lucero/popover"),require("@luzmo/lucero/tooltip");let s=require("lit"),c=require("lit/decorators.js"),l=require("@lit/localize");require("@luzmo/lucero/progress-circle"),require("@luzmo/lucero/checkbox"),require("@luzmo/lucero/divider"),require("@luzmo/lucero/field-group"),require("@luzmo/lucero/menu"),require("@luzmo/lucero/notice"),require("@luzmo/lucero/search");let u=require("lit/directives/if-defined.js");var d=`: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}`,f=`0.1.107`,p=`0.1.0`,m=[`id`,`name`,`contents`,`modified_at`,`is_variant`,`original_id`],h=new Set([`designer`,`owner`]),g=`flag_dashboard_variants`,_=[`desktop`,`tablet`,`mobile`];async function v(e,t,n){let r=[],i=t,a=0;for(let t of e){let e=n-r.length,o=await t(i,Math.max(e,1));e>0&&r.push(...o.rows.slice(0,e)),i=Math.max(0,i-o.count),a+=o.count}return{rows:r,total:a}}async function y(e,t){let n=(await e.fetchApi(`/user`,{action:`get`,version:p,find:{where:{id:`me`},attributes:[`id`,`flags`],...t?{include:[{model:`Organization`,attributes:[`id`]}]}:{}}})).rows?.[0];return{id:n?.id??``,flags:n?.flags??[],organizations:n?.organizations}}async function b(e,t){return(await e.fetchApi(`/authorization`,{action:`get`,version:p,find:{where:{id:t}}})).rows?.[0]}async function x(e,t,n){let r={...t,where:{...t.where,type:`dashboard`}},i=await e.fetchApi(`/securable`,{action:`get`,version:p,find:r},{signal:n});return{rows:i.rows??[],count:i.count??i.rows?.length??0}}function S(e){let t={modifyIds:new Set,useOnlyIds:new Set};for(let n of e?.access?.dashboards??[])n.rights?.Modify?t.modifyIds.add(n.id):n.rights?.Use&&t.useOnlyIds.add(n.id);return t}function C(){return{version:f,syncScreenModes:!0,views:_.map(e=>({screenModus:e,options:{theme:{id:`default`}},filterGroups:[],items:[]})),timezone:{type:`fixed`,id:`UTC`}}}function w(e){return e?{search:{match_types:[`name`,`description`],keyphrase:e,securable_types:[`dashboard`]}}:{}}function T(e,t){return{include:[{model:`User`,as:`allUsers`,attributes:[],required:!0,where:{id:e,...Object.fromEntries(Object.entries(t).map(([e,t])=>[`securableAccessRight.${e}`,t]))}}]}}async function E(e){let t=new r.t({apiUrl:e.apiUrl,authKey:e.authKey,authToken:e.authToken,skipNetworkListeners:!0}),n=await b(t,e.authKey),a=n?.type===`embed`,o=await y(t,!a),s=S(n),c=a?h.has(n.role??``):o.organizations?.[0]?.organizationRole?.flagEditor!==!1,u=!!o.id&&o.flags.includes(g),d=[...s.modifyIds,...u?s.useOnlyIds:[]],f=d.length>0?{id:{notIn:d}}:{},_=(t,n=!1)=>{let r=[...new Set((t.contents?.views??[]).map(e=>e.screenModus))];return{id:t.id,name:i.t(t.name??{},e.language),syncScreenModes:t.contents?.syncScreenModes!==!1,screenModes:r.length>0?r:[`desktop`],...n?{requiresVariant:n}:{}}},E,D=(e,n)=>async(r,i)=>{if(d.length===0)return{count:0,rows:[]};let a=r>0&&E?.search===e?E.rows:void 0;return a||(a=(await x(t,{where:{is_variant:!1,archived_at:null,id:{in:d}},attributes:m,...w(e)},n)).rows.map(e=>_(e,!s.modifyIds.has(e.id))).sort((e,t)=>e.name.localeCompare(t.name)),E={search:e,rows:a}),{count:a.length,rows:a.slice(r,r+i)}},O=(e,n,r,i)=>async(a,s)=>{let c=await x(t,{where:{is_variant:!1,archived_at:null,...f},attributes:m,...T(o.id,r),...w(e),limit:s,offset:a,order:[[`modified_at`,`desc`]]},n);return{count:c.count,rows:c.rows.map(e=>_(e,i))}},k=async(e,n,r,i)=>{await t.fetchApi(`/securable`,{action:`update`,version:p,id:e,properties:{append_item:{item:n,...r?.length?{screenModes:r}:{}}}},{signal:i})},A=async(e,n,r)=>{try{await k(e.id,n,r)}catch(n){throw await t.fetchApi(`/securable`,{action:`delete`,version:p,id:e.id}).catch(()=>void 0),n}},j=async(e,n)=>await t.fetchApi(`/securable`,{action:`create`,version:p,properties:{...e,type:`dashboard`},associations:n});return{async list(e,t){return o.id?await v([D(e.search,t.signal),...u?[O(e.search,t.signal,{flagUse:!0,flagModify:!1},!0)]:[],O(e.search,t.signal,{flagModify:!0},!1)],e.offset,e.limit):{rows:[],total:0}},async add(e,t,n,r){await k(e.id,t,n.screenModes,r.signal)},...c?{async create(t,n){let r=await j({name:n.name?{[e.language]:n.name}:{},contents:C()});return await A(r,t,void 0),_(r)}}:{},...u?{async listVariants(e,n){return(await x(t,{where:{is_variant:!0,original_id:e.id,archived_at:null},attributes:m,...T(o.id,{flagModify:!0}),order:[[`modified_at`,`desc`]]},n.signal)).rows.map(e=>_(e))}}:{},...u&&c?{async addToVariant(n,r,i){let a=(await x(t,{where:{id:n.id},attributes:[`id`,`name`,`contents`]})).rows[0];if(!a?.contents)throw Error((0,l.msg)(`The dashboard was not found.`,{desc:`Adding the chart to a variant failed because the original dashboard could not be loaded`}));let o=a.name??{},s=await j({name:i.name?{...o,[e.language]:i.name}:o,contents:a.contents},[{role:`original`,id:n.id}]);return await A(s,r,i.screenModes),_({...s,contents:s.contents??a.contents})}}:{}}}function D(e){let{theme:t,...n}=e.options??{};return{...a.s(e),options:n}}function O(e,t){let n=new Set(e),r=e.length+1;for(;n.has(t(r));)r+=1;return r}var k=20,A=300,j=8,M=48,N=`__luzmo-new-dashboard`,P=`__luzmo-new-variant`,F=new Map,I=0,L=class extends n.t(e.n(e.i,{validSizes:Object.values(e.t)})){constructor(...e){super(...e),this.chart=null,this.dashboardActions=null,this.authKey=``,this.authToken=``,this.apiUrl=`https://api.luzmo.com`,this.placement=`bottom-end`,this.disabled=!1,this._open=!1,this._actions=null,this._step=`list`,this._rows=[],this._hasMore=!1,this._loading=!1,this._listFailed=!1,this._original=null,this._variants=[],this._variantsLoading=!1,this._variantsFailed=!1,this._pending=null,this._screenModes=[],this._saving=!1,this._status=null,this._triggerId=`add-to-dashboard-trigger-${++I}`,this._search=``,this._actionsGeneration=0,this._reloadOnUpdate=!1}static get styles(){let e=super.styles??[];return[...Array.isArray(e)?e:[e],(0,s.unsafeCSS)(d)]}get _hasSource(){return!!this.dashboardActions||!!(this.authKey&&this.authToken)}connectedCallback(){super.connectedCallback(),this._status&&this._startFittingAlert()}disconnectedCallback(){super.disconnectedCallback(),this._handleClosed(),this._actionsGeneration+=1,this._saveAbort?.abort(),this._stopFittingAlert()}willUpdate(e){super.willUpdate(e),(e.has(`dashboardActions`)||e.has(`authKey`)||e.has(`authToken`)||e.has(`apiUrl`)||e.has(`language`))&&(this._actions=null,this._actionsGeneration+=1,this._open&&(this._listAbort?.abort(),this._variantsAbort?.abort(),this._step=`list`,this._original=null,this._pending=null,this._rows=[],this._open=this._hasSource,this._reloadOnUpdate=this._hasSource)),e.has(`disabled`)&&this.disabled&&(this._open=!1),e.has(`chart`)&&!this.chart&&this._handleClosed()}updated(e){super.updated(e),this._reloadOnUpdate&&(this._reloadOnUpdate=!1,this._loadList()),e.has(`_step`)&&this._open&&this._focusStep(),e.has(`_status`)&&(this._status?this._startFittingAlert():this._stopFittingAlert())}get _alertContainer(){let e=this.getRootNode();return this.parentElement??(e instanceof ShadowRoot?e.host:null)}_startFittingAlert(){this._fitAlert();let e=this._alertContainer;!this._alertResizeObserver&&e&&(this._alertResizeObserver=new ResizeObserver(()=>this._fitAlert()),this._alertResizeObserver.observe(this),this._alertResizeObserver.observe(e))}_stopFittingAlert(){this._alertResizeObserver?.disconnect(),this._alertResizeObserver=void 0}_fitAlert(){let e=this._noticeElement,t=this._alertContainer;if(!e||!t)return;let n=this.getBoundingClientRect(),r=t.getBoundingClientRect(),i=Number.parseFloat(getComputedStyle(t).paddingInlineStart)||0,a=(this.isLTR?n.right-r.left:r.right-n.left)-i;e.style.setProperty(`--luzmo-notice-max-inline-size`,`${Math.max(0,a)}px`)}async _resolveActions(){if(this.dashboardActions)return this.dashboardActions;let e={apiUrl:this.apiUrl,authKey:this.authKey,authToken:this.authToken,language:this.language},t=JSON.stringify(e),n=F.get(t);return n||(F.clear(),n=E(e),F.set(t,n),n.catch(()=>F.delete(t))),await n}_dispatch(e,t){let n=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});this.dispatchEvent(n)}_displayName(e){return e.name.trim()||(0,l.msg)(`Untitled dashboard`,{desc:`Fallback name of a dashboard without a name`})}_variantName(e,t){let n=this._displayName(e);return(0,l.msg)(l.str`${n} (variant ${t})`,{desc:`Name of a new dashboard variant`})}_screenModeChoices(){return[{name:`mobile`,label:(0,l.msg)(`Smartphone`,{desc:`Screen mode name`}),size:`< 768px`,icon:o.luzmoMobile},{name:`tablet`,label:(0,l.msg)(`Tablet`,{desc:`Screen mode name`}),size:`≥ 768px`,icon:o.luzmoTablet},{name:`desktop`,label:(0,l.msg)(`Desktop`,{desc:`Screen mode name`}),size:`≥ 1200px`,icon:o.luzmoLaptop},{name:`largeScreen`,label:(0,l.msg)(`Large screen`,{desc:`Screen mode name`}),size:`≥ 1600px`,icon:o.luzmoDesktop},{name:`fixed`,label:(0,l.msg)(`Fixed width`,{desc:`Screen mode name`}),icon:o.luzmoArrowsHorizontal}]}async _handleOpened(e){e.target===e.currentTarget&&(this._open=!0,this._step=`list`,this._search=``,this._original=null,this._pending=null,this._rows=[],await this.updateComplete,this._searchElement?.focus(),await this._loadList())}async _loadList(){let e=this._actionsGeneration;this._loading=!0,this._listFailed=!1;try{let t=this._actions??await this._resolveActions();if(e!==this._actionsGeneration)return;this._actions=t}catch(t){if(!this.isConnected||e!==this._actionsGeneration)return;console.error(`Failed to resolve the add to dashboard actions:`,t),this._loading=!1,this._listFailed=!0;return}this.isConnected&&this._open&&await this._loadPage(!1)}_handleClosed(e){e&&e.target!==e.currentTarget||(this._open=!1,clearTimeout(this._searchTimer),this._listAbort?.abort(),this._variantsAbort?.abort())}async _loadPage(e){let t=this._actions;if(!t)return;this._listAbort?.abort();let n=new AbortController;this._listAbort=n,this._loading=!0,this._listFailed=!1,e||(this._rows=[]);try{let e=await t.list({search:this._search,offset:this._rows.length,limit:k},{signal:n.signal});if(n.signal.aborted)return;this._rows=[...this._rows,...e.rows],this._hasMore=e.total===void 0?e.rows.length===k:this._rows.length<e.total}catch(e){if(n.signal.aborted)return;console.error(`Failed to load dashboards:`,e),this._listFailed=!0}finally{n.signal.aborted||(this._loading=!1)}}_handleSearchInput(e){this._search=String(e.target?.value??``),clearTimeout(this._searchTimer),this._searchTimer=setTimeout(()=>void this._loadPage(!1),A)}_handleListScroll(e){let t=e.target;this._hasMore&&!this._loading&&t.scrollHeight-t.scrollTop-t.clientHeight<=M&&this._loadPage(!0)}_menuValue(e){return e.stopPropagation(),e.target.value??``}_handleListChange(e){let t=this._menuValue(e);if(t===N){this._actions?.create&&this._save({kind:`create`});return}let n=this._rows.find(e=>e.id===t);n&&(n.requiresVariant?(this._original=n,this._step=`variants`,this._loadVariants()):this._selectTarget({kind:`add`,dashboard:n,isVariant:!1},n))}_handleVariantChange(e){let t=this._menuValue(e),n=this._original;if(!n)return;if(t===P){if(!this._actions?.addToVariant)return;let e=this._variants.map(e=>this._displayName(e)),t=this._variantName(n,O(e,e=>this._variantName(n,e)));this._selectTarget({kind:`variant`,original:n,name:t},n);return}let r=this._variants.find(e=>e.id===t);r&&this._selectTarget({kind:`add`,dashboard:r,isVariant:!0},r)}_selectTarget(e,t){t.syncScreenModes!==!1||!t.screenModes?.length?this._save(e):(this._pending=e,this._screenModes=[...t.screenModes??[]],this._step=`screenModes`)}async _loadVariants(){let e=this._actions,t=this._original;if(this._variantsAbort?.abort(),this._variants=[],this._variantsLoading=!1,this._variantsFailed=!1,!e?.listVariants||!t)return;let n=new AbortController;this._variantsAbort=n,this._variantsLoading=!0;try{let r=await e.listVariants(t,{signal:n.signal});n.signal.aborted||(this._variants=r)}catch(e){n.signal.aborted||(console.error(`Failed to load dashboard variants:`,e),this._variantsFailed=!0)}finally{n.signal.aborted||(this._variantsLoading=!1)}}_handleBack(){this._step===`screenModes`&&this._original?this._step=`variants`:(this._step=`list`,this._original=null),this._pending=null}_toggleScreenMode(e){this._screenModes=this._screenModes.includes(e)?this._screenModes.filter(t=>t!==e):[...this._screenModes,e]}_handleConfirmScreenModes(){this._pending&&this._screenModes.length>0&&this._save(this._pending,{screenModes:[...this._screenModes]})}async _save(e,t={}){let n=this._actions;if(!n||!this.chart||this._saving)return;this._open=!1,this._saving=!0,this._setStatus(null),this._saveAbort=new AbortController;let r=D(this.chart),i={signal:this._saveAbort.signal};try{let a;if(e.kind===`create`&&n.create)a=await n.create(r,t,i);else if(e.kind===`variant`&&n.addToVariant)a=await n.addToVariant(e.original,r,{...t,name:e.name},i);else if(e.kind===`add`)a=await n.add(e.dashboard,r,t,i)||e.dashboard;else return;if(i.signal.aborted)return;this._setStatus({kind:`success`,dashboard:a,isVariant:e.kind===`variant`||e.kind===`add`&&e.isVariant,openDashboard:n.openDashboard?.bind(n)}),this._dispatch(`luzmo-chart-added`,{dashboard:a})}catch(e){if(i.signal.aborted)return;console.error(`Failed to add the chart to a dashboard:`,e),this._setStatus({kind:`error`,message:e instanceof Error&&e.message?e.message:void 0}),this._dispatch(`luzmo-chart-add-failed`,{error:e})}finally{this._saving=!1}await this.updateComplete,this.isConnected&&this._isFocusLost()&&this._focusTrigger()}_setStatus(e){this._status=e}_focusTrigger(){this._triggerElement?.focus()}_isFocusLost(){return!document.activeElement||document.activeElement===document.body}async _handleNoticeClose(e){e.stopPropagation();let t=e.currentTarget.matches(`:focus-within`);this._setStatus(null),await this.updateComplete,t&&this._isFocusLost()&&this._focusTrigger()}async _focusStep(){let e=this._step===`list`?this._searchElement:this._backElement;await e?.updateComplete,e?.focus()}_renderRow(e){return s.html`
|
|
21
21
|
<luzmo-menu-item value=${e.id} no-wrap ?disabled=${this._saving}>
|
|
22
22
|
${e.thumbnailUrl?s.html`<img slot="icon" class="thumbnail" alt="" src=${e.thumbnailUrl} />`:s.nothing}
|
|
23
23
|
${this._displayName(e)}
|