@luzmo/analytics-components-kit 1.1.1 → 1.3.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 +10 -2
- package/angular/components/interactive-viz-item.ts +41 -4
- package/angular/components/item-option-color-picker.ts +30 -3
- package/angular/components/item-option-color-range.ts +30 -3
- package/angular/components/item-option-guidelines.ts +31 -4
- package/angular/components/item-option-panel.ts +41 -4
- package/angular/components/item-option-slider.ts +41 -4
- package/angular/components/item-option.ts +41 -4
- package/angular/esm/components/interactive-viz-item.d.ts +14 -5
- package/angular/esm/components/interactive-viz-item.js +30 -4
- package/angular/esm/components/item-option-color-picker.d.ts +11 -4
- package/angular/esm/components/item-option-color-picker.js +23 -3
- package/angular/esm/components/item-option-color-range.d.ts +11 -4
- package/angular/esm/components/item-option-color-range.js +23 -3
- package/angular/esm/components/item-option-guidelines.d.ts +11 -4
- package/angular/esm/components/item-option-guidelines.js +24 -4
- package/angular/esm/components/item-option-panel.d.ts +13 -4
- package/angular/esm/components/item-option-panel.js +30 -4
- package/angular/esm/components/item-option-slider.d.ts +13 -4
- package/angular/esm/components/item-option-slider.js +30 -4
- package/angular/esm/components/item-option.d.ts +13 -4
- package/angular/esm/components/item-option.js +30 -4
- package/angular/package.json +2 -2
- package/angular/utils/option-interaction/index.d.ts +2 -0
- package/angular/utils/option-interaction/is-same-option-value.d.ts +10 -0
- package/angular/utils/option-interaction/option-interaction-controller.d.ts +54 -0
- package/angular/utils/option-interaction/tests/option-interaction-controller.test.d.ts +1 -0
- package/angular/utils/store/base-store.d.ts +9 -0
- package/angular/utils/store/tests/store-base-history.test.d.ts +1 -0
- 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-CzIuDtAq.cjs} +1 -1
- package/components/{add-to-dashboard-NcVHlqrc.js → add-to-dashboard-DGC0_hRB.js} +1 -1
- package/components/{base-store-SgJsjLap.cjs → base-store-D3whjduR.cjs} +1 -1
- package/components/{base-store-g0dt7ru7.js → base-store-DQYj8A1W.js} +3 -0
- package/components/{chart-helpers-Dng_LGfq.js → chart-helpers-Cbl3sRra.js} +3 -2
- package/components/chart-helpers-fMnqHRzC.cjs +20 -0
- package/components/{choropleth-map-options.config-D9-u-NwX.js → choropleth-map-options.config-Blu0Z2tR.js} +1 -1
- package/components/{choropleth-map-options.config-CXDGMiSJ.cjs → choropleth-map-options.config-DwFJ00CS.cjs} +1 -1
- package/components/{color-range-utils-CUCTsRXM.js → color-range-utils-CgwRGUkg.js} +18 -18
- package/components/{color-range-utils-BCFQAeY1.cjs → color-range-utils-D8uygiMe.cjs} +1 -1
- package/components/{heat-map-options.config-ChZeslEy.js → heat-map-options.config-BQkhkLPb.js} +16 -16
- package/components/{heat-map-options.config-DiNa8NnG.cjs → heat-map-options.config-DjQkB039.cjs} +1 -1
- package/components/{heat-table-options.config-BPCszrFn.js → heat-table-options.config-CMWWTeyo.js} +1 -1
- package/components/{heat-table-options.config-BvE6coaV.cjs → heat-table-options.config-D21xtaIk.cjs} +1 -1
- package/components/index.cjs +1 -1
- package/components/index.js +9 -9
- package/components/interactive-viz-item/index.cjs +1 -1
- package/components/interactive-viz-item/index.d.ts +2 -1
- package/components/interactive-viz-item/index.js +2 -2
- package/components/interactive-viz-item/interactive-viz-item.d.ts +34 -2
- package/components/interactive-viz-item/types.d.ts +17 -0
- package/components/{interactive-viz-item-CofUkpP6.js → interactive-viz-item-BKLOmawA.js} +166 -100
- package/components/interactive-viz-item-ojdH1uk0.cjs +268 -0
- package/components/is-same-option-value-B2oyvEqT.js +42 -0
- package/components/is-same-option-value-Cf6BQcs7.cjs +20 -0
- package/components/item-option/helpers/control-markup.d.ts +7 -0
- package/components/item-option/index.cjs +1 -1
- package/components/item-option/index.d.ts +1 -1
- package/components/item-option/index.js +1 -1
- package/components/item-option/item-option.d.ts +23 -2
- package/components/item-option/types.d.ts +19 -0
- package/components/{item-option-Cgx3c08E.js → item-option-DKLRnicU.js} +182 -136
- package/components/item-option-DpLdospV.cjs +285 -0
- package/components/item-option-color-picker/index.cjs +1 -1
- package/components/item-option-color-picker/index.d.ts +1 -1
- package/components/item-option-color-picker/index.js +1 -1
- package/components/item-option-color-picker/item-option-color-picker.d.ts +17 -1
- package/components/item-option-color-picker-CNW7GsCO.cjs +37 -0
- package/components/item-option-color-picker-DDvsY7hV.js +129 -0
- package/components/item-option-color-range/index.cjs +1 -1
- package/components/item-option-color-range/index.d.ts +1 -1
- package/components/item-option-color-range/index.js +1 -1
- package/components/item-option-color-range/item-option-color-range.d.ts +20 -1
- package/components/item-option-color-range-BqSbuSZh.cjs +101 -0
- package/components/item-option-color-range-FQduqtz3.js +265 -0
- package/components/item-option-guidelines/index.cjs +1 -1
- package/components/item-option-guidelines/index.d.ts +1 -1
- package/components/item-option-guidelines/index.js +1 -1
- package/components/item-option-guidelines/item-option-guidelines.d.ts +16 -1
- package/components/{item-option-guidelines-DNJevmVD.js → item-option-guidelines-k5DwMONo.js} +132 -104
- package/components/item-option-guidelines-z9BsGR-l.cjs +138 -0
- package/components/item-option-panel/index.cjs +1 -1
- package/components/item-option-panel/index.d.ts +1 -1
- package/components/item-option-panel/index.js +1 -1
- package/components/item-option-panel/item-option-panel.d.ts +12 -1
- package/components/{item-option-panel-DHdnisRb.js → item-option-panel-BLXWIbjX.js} +18 -6
- package/components/{item-option-panel-Dl3aYBNe.cjs → item-option-panel-CU51qvgV.cjs} +6 -4
- package/components/item-option-slider/index.cjs +1 -1
- package/components/item-option-slider/index.d.ts +1 -1
- package/components/item-option-slider/index.js +1 -1
- package/components/item-option-slider/item-option-slider.d.ts +15 -2
- package/components/item-option-slider-BKtJfL3D.js +119 -0
- package/components/item-option-slider-Kz2eFBql.cjs +36 -0
- package/components/item-options-configs.cjs +1 -1
- package/components/item-options-configs.js +5 -5
- package/components/option-interaction-controller-B8S1N_Oo.js +90 -0
- package/components/option-interaction-controller-D0U-CTpZ.cjs +20 -0
- package/components/{route-map-options.config-DdCaVtIF.cjs → route-map-options.config-DER6ENky.cjs} +1 -1
- package/components/{route-map-options.config-B7vT6KG_.js → route-map-options.config-DTcS47fW.js} +1 -1
- package/components/{spike-map-options.config-DkmRZ1JZ.js → spike-map-options.config-CPYfKWoF.js} +1 -1
- package/components/{spike-map-options.config-B3hDh2qU.cjs → spike-map-options.config-DeF1Whq5.cjs} +1 -1
- package/components/utils/store.cjs +1 -1
- package/components/utils/store.js +1 -1
- package/custom-elements.json +418 -104
- package/package.json +2 -2
- package/react/components/interactive-viz-item.component.ts +11 -2
- package/react/components/item-option-color-picker.component.ts +9 -3
- package/react/components/item-option-color-range.component.ts +9 -3
- package/react/components/item-option-guidelines.component.ts +9 -3
- package/react/components/item-option-panel.component.ts +12 -3
- package/react/components/item-option-slider.component.ts +12 -3
- package/react/components/item-option.component.ts +12 -3
- package/react/esm/components/interactive-viz-item.component.d.ts +8 -2
- package/react/esm/components/interactive-viz-item.component.js +7 -1
- package/react/esm/components/item-option-color-picker.component.d.ts +6 -2
- package/react/esm/components/item-option-color-picker.component.js +6 -2
- package/react/esm/components/item-option-color-range.component.d.ts +6 -2
- package/react/esm/components/item-option-color-range.component.js +6 -2
- package/react/esm/components/item-option-guidelines.component.d.ts +6 -2
- package/react/esm/components/item-option-guidelines.component.js +6 -2
- package/react/esm/components/item-option-panel.component.d.ts +8 -2
- package/react/esm/components/item-option-panel.component.js +8 -2
- package/react/esm/components/item-option-slider.component.d.ts +8 -2
- package/react/esm/components/item-option-slider.component.js +8 -2
- package/react/esm/components/item-option.component.d.ts +8 -2
- package/react/esm/components/item-option.component.js +8 -2
- package/react/luzmo-stub.d.ts +7 -0
- package/react/package.json +2 -2
- package/standalone/add-to-dashboard.js +40 -40
- package/standalone/chunks/{chart-helpers-DsIGsaDc.js → chart-helpers-CR-EUEPf.js} +2 -2
- package/standalone/chunks/{choropleth-map-options.config-Cs4Kvr9h.js → choropleth-map-options.config-CDMjKnJD.js} +1 -1
- package/standalone/chunks/{color-range-utils-CKDpd3gZ.js → color-range-utils-BVyHBRiq.js} +1 -1
- package/standalone/chunks/de-BkB0q1Eg.js +2 -0
- package/standalone/chunks/display-settings-binning-BeLLxd3i.js +38 -0
- package/standalone/chunks/display-settings-datetime-BkeiKIVV.js +199 -0
- package/standalone/chunks/display-settings-grand-totals-BuhpQKJ6.js +26 -0
- package/standalone/chunks/display-settings-numeric-m30IYI7I.js +172 -0
- package/standalone/chunks/display-settings-period-over-period-CqDlOSRn.js +209 -0
- package/standalone/chunks/embed-Bv1ps-EM.js +260 -0
- package/standalone/chunks/en-63f7j4v7.js +2 -0
- package/standalone/chunks/en-GB-QAmXQf8W.js +2 -0
- package/standalone/chunks/en-US-63f7j4v7.js +2 -0
- package/standalone/chunks/es-Bo0jStZn.js +2 -0
- package/standalone/chunks/{filters-DKgJcQGP.js → filters-CxgBXUF1.js} +61 -61
- package/standalone/chunks/{formula-codemirror-BbyvNEVD.js → formula-codemirror-Cq94j3-f.js} +17 -17
- package/standalone/chunks/fr-Co_qVhhV.js +2 -0
- package/standalone/chunks/{heat-map-options.config-DF5kjOOe.js → heat-map-options.config-DDQMD38W.js} +1 -1
- package/standalone/chunks/{heat-table-options.config-DaePzfHG.js → heat-table-options.config-B4K0Ygug.js} +1 -1
- package/standalone/chunks/is-same-option-value-7kXNF4st.js +2 -0
- package/standalone/chunks/item-option-action-button-group-BoyqF9vt.js +35 -0
- package/standalone/chunks/item-option-base-CBcDT8MX.js +38 -0
- package/standalone/chunks/item-option-color-palette-picker-C9PGAv4V.js +22 -0
- package/standalone/chunks/item-option-color-picker-D4fVJlqF.js +19 -0
- package/standalone/chunks/item-option-color-range-BlAdTguE.js +83 -0
- package/standalone/chunks/item-option-guidelines-DMsYsHDu.js +120 -0
- package/standalone/chunks/{item-option-multi-language-field-DPPpN2qg.js → item-option-multi-language-field-NUbm1drg.js} +1 -1
- package/standalone/chunks/{item-option-number-field-CkqJjInE.js → item-option-number-field-DRp7kbHL.js} +1 -1
- package/standalone/chunks/item-option-panel-cXrRclzM.js +316 -0
- package/standalone/chunks/{item-option-picker-BnwQPT9A.js → item-option-picker-Ba09L4Cs.js} +1 -1
- package/standalone/chunks/item-option-position-picker-GEGTnhjw.js +14 -0
- package/standalone/chunks/item-option-positions-number-field-n44s1k5v.js +31 -0
- package/standalone/chunks/{item-option-radio-button-group-BkymJq3E.js → item-option-radio-button-group-3s_b1NvR.js} +1 -1
- package/standalone/chunks/item-option-slider-DtY65Gxk.js +18 -0
- package/standalone/chunks/item-option-switch-4sJaI0mx.js +12 -0
- package/standalone/chunks/{item-option-text-field-D7bkuhsv.js → item-option-text-field-Bt6Lj6kh.js} +1 -1
- package/standalone/chunks/{item-slot-picker-panel-D4BMxGs9.js → item-slot-picker-panel-BOSVFBIy.js} +43 -43
- package/standalone/chunks/load-data-fields-for-datasets-CDlut-6S.js +25 -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-BuwRr21c.js +2 -0
- package/standalone/chunks/{route-map-options.config-D7FfzIiU.js → route-map-options.config-CGBkHnhM.js} +1 -1
- package/standalone/chunks/{spike-map-options.config-CZiFzDm9.js → spike-map-options.config-CSenlJ_F.js} +1 -1
- package/standalone/interactive-viz-item.js +62 -55
- package/standalone/item-grid.js +10 -10
- package/standalone/manifest.json +44 -43
- package/utils/option-interaction/index.d.ts +2 -0
- package/utils/option-interaction/is-same-option-value.d.ts +10 -0
- package/utils/option-interaction/option-interaction-controller.d.ts +54 -0
- package/utils/option-interaction/tests/option-interaction-controller.test.d.ts +1 -0
- package/utils/store/base-store.d.ts +9 -0
- package/utils/store/tests/store-base-history.test.d.ts +1 -0
- package/components/chart-helpers-ufZ6VbXs.cjs +0 -20
- package/components/interactive-viz-item-D537mo3l.cjs +0 -261
- package/components/item-option-CqGDFdPj.cjs +0 -269
- package/components/item-option-color-picker-BpPoOO2b.cjs +0 -34
- package/components/item-option-color-picker-cojuCvu5.js +0 -84
- package/components/item-option-color-range-CMBEx1fi.cjs +0 -98
- package/components/item-option-color-range-Dt7Bv06p.js +0 -217
- package/components/item-option-guidelines-Beh0DlG0.cjs +0 -135
- package/components/item-option-slider-Bo5vs6nr.js +0 -89
- package/components/item-option-slider-CyWKWr5D.cjs +0 -33
- package/standalone/chunks/color-7IgCGZKz.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-BfHBKhIe.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-Cr7ujQNO.js +0 -16
- package/standalone/chunks/item-option-color-range-CyJd1LZ_.js +0 -80
- package/standalone/chunks/item-option-guidelines-6NjpzS6b.js +0 -117
- package/standalone/chunks/item-option-panel-VxvWU56c.js +0 -298
- 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-l9wt7_0c.js +0 -15
- 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/localized-decorator-DJVBmJVH.js +0 -2
- package/standalone/chunks/nl-CViTevL3.js +0 -2
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
import type { ItemOptionInteraction } from '../../components/item-option/types';
|
|
3
|
+
/** The part of Lucero's `luzmo-interaction-*` event detail that ACK reads. */
|
|
4
|
+
export interface LuceroInteractionDetail {
|
|
5
|
+
id: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Maps Lucero gesture boundaries (`luzmo-interaction-*`) on a control's Lucero children to ACK
|
|
9
|
+
* `luzmo-option-interaction-*` events, and tags the live value updates in between with the gesture id.
|
|
10
|
+
* Each gesture on each source element gets its own id, so overlapping gestures never merge.
|
|
11
|
+
* A gesture stays silent until its first changed value: a press that never changes the value emits nothing.
|
|
12
|
+
*/
|
|
13
|
+
export declare class OptionInteractionController implements ReactiveController {
|
|
14
|
+
private readonly _host;
|
|
15
|
+
private readonly _isSame;
|
|
16
|
+
private _open;
|
|
17
|
+
private _hasDiscreteValue;
|
|
18
|
+
private _discreteValue;
|
|
19
|
+
/**
|
|
20
|
+
* @param _isSame Equality used for `changed` and for dropping repeated values, for example `isSameColorValue`
|
|
21
|
+
* in a color control. Defaults to structural equality without color normalization.
|
|
22
|
+
*/
|
|
23
|
+
constructor(_host: ReactiveControllerHost & HTMLElement, _isSame?: (a: unknown, b: unknown) => boolean);
|
|
24
|
+
/** Whether a Lucero gesture is open, whether or not it changed the value yet. */
|
|
25
|
+
get active(): boolean;
|
|
26
|
+
/** Ends gestures whose source element was removed by the last render, such as a deleted color stop. */
|
|
27
|
+
hostUpdated(): void;
|
|
28
|
+
/** Ends open gestures if the host was removed without `endInteraction()`; only listeners on the host still hear it. */
|
|
29
|
+
hostDisconnected(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Opens a gesture for a Lucero `luzmo-interaction-start` on `source`. `value` is the value `source` edits, before the
|
|
32
|
+
* gesture: the option value, or in a composite control (color range, guidelines) only that child's own value.
|
|
33
|
+
* `luzmo-option-interaction-start` waits for the gesture's first changed value in `update`.
|
|
34
|
+
*/
|
|
35
|
+
start(source: EventTarget, detail: LuceroInteractionDetail, value: unknown): void;
|
|
36
|
+
/**
|
|
37
|
+
* Emits a value update through `emit`. Inside a gesture on `source` the update carries the gesture id and is
|
|
38
|
+
* tracked by `ownValue` (the value `source` edits, as passed to `start`); outside one it is a discrete update
|
|
39
|
+
* tracked by the full `value`. An update whose tracked value equals the previous one is dropped. The first changed
|
|
40
|
+
* value of a gesture emits `luzmo-option-interaction-start` right before its update.
|
|
41
|
+
*/
|
|
42
|
+
update(source: EventTarget, value: unknown, emit: (interaction?: ItemOptionInteraction) => void, ownValue?: unknown): void;
|
|
43
|
+
/** Closes the gesture for a Lucero `luzmo-interaction-end`. Unknown, closed or never-changed gestures emit nothing. */
|
|
44
|
+
end(source: EventTarget, detail: LuceroInteractionDetail): void;
|
|
45
|
+
/** Closes the gesture for a Lucero `luzmo-interaction-cancel`, after the control emitted Lucero's revert. */
|
|
46
|
+
cancel(source: EventTarget, detail: LuceroInteractionDetail): void;
|
|
47
|
+
/** Ends every open gesture, keeping the values already emitted; only gestures that changed a value emit an end. Idempotent. */
|
|
48
|
+
endAll(): void;
|
|
49
|
+
/** Discrete updates are deduped against the last emitted full value, a gesture's included, so returning to an older value still emits. */
|
|
50
|
+
private _rememberEmitted;
|
|
51
|
+
private _find;
|
|
52
|
+
private _take;
|
|
53
|
+
private _dispatch;
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -155,4 +155,13 @@ export declare abstract class BaseStore<TState> {
|
|
|
155
155
|
* This ensures changes are tracked by the undo manager
|
|
156
156
|
*/
|
|
157
157
|
protected transact<T>(fn: () => T): T;
|
|
158
|
+
/**
|
|
159
|
+
* Execute a function within a local transaction recorded as its own undo step.
|
|
160
|
+
* Unlike `transact`, it never merges with neighbouring transactions within `mergeInterval`.
|
|
161
|
+
* Use it to commit the final value of a gesture whose live preview is kept outside the document.
|
|
162
|
+
*
|
|
163
|
+
* `fn` must be synchronous. Changes made before `fn` throws are kept, not rolled back.
|
|
164
|
+
* Called inside another transaction, the whole outer transaction becomes the separate step.
|
|
165
|
+
*/
|
|
166
|
+
protected transactHistoryStep<T>(fn: () => T): T;
|
|
158
167
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
-
var e=function(e){return e.Top=`top`,e.Bottom=`bottom`,e}({}),t=function(e){return e.Asc=`asc`,e.Desc=`desc`,e}({}),n=function(e){return e.Measure=`measure`,e.Category=`category`,e}({}),r=5,i=Array.isArray;function a(e){return typeof e==`string`}function o(e){let t={...e};return!t.datasetId&&t.set&&(t.datasetId=t.set),!t.set&&t.datasetId&&(t.set=t.datasetId),!t.columnId&&t.column&&(t.columnId=t.column),!t.column&&t.columnId&&(t.column=t.columnId),!t.formulaId&&t.formula&&(t.formulaId=t.formula),!t.formula&&t.formulaId&&(t.formula=t.formulaId),t}function s(e){return i(e)?e:Object.entries(e).map(([e,t])=>({name:e,content:i(t)?t:[]}))}function c(e){let t=new Set;for(let n of e)for(let e of n.content){let n=e.datasetId??e.set;a(n)&&t.add(n)}return[...t]}function l(e){let t=s(e.slots??[]),n=e.options??{},r=n.interactivity;return{type:e.type,options:{...n,interactivity:{...r,scheduledExport:!1}},slots:t.map(e=>({...e,content:i(e.content)?e.content.map(e=>o(e)):[]})),filters:e.filters}}function u(e,t){return{...e,options:{...e.options,theme:{...e.options.theme,...t}}}}function d(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 f(r){let i=[],a=r.options;switch(r.type){case`area-chart`:case`bar-chart`:case`column-chart`:if(i.push({type:`rankingPicker`,mutationType:`rankAndSort`,ranking:a.ranking??{active:!1,number:5,direction:e.Top},sort:a.sort??{direction:t.Desc,by:n.Measure},importance:100}),d(r.slots)){let e=r.type===`area-chart`,t=e?[{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%`}],n=e?`stacked`:`grouped`;i.push({type:`optionDropdown`,mutationType:`mode`,values:t,currentValue:a.mode??n,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 p(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 m(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 p(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 u}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return t}});
|
|
@@ -1,261 +0,0 @@
|
|
|
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
|
-
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("./chart-helpers-ufZ6VbXs.cjs"),i=require("./create-lazy-loader-DYPgQh0L.cjs");let a=require("@luzmo/icons");require("@luzmo/lucero/action-button"),require("@luzmo/lucero/icon"),require("@luzmo/lucero/overlay"),require("@luzmo/lucero/popover");let o=require("lit"),s=require("lit/decorators.js"),c=require("@lit/localize");require("@luzmo/embed"),require("@luzmo/lucero/action-group"),require("@luzmo/lucero/field-label"),require("@luzmo/lucero/number-field"),require("@luzmo/lucero/picker"),require("@luzmo/lucero/progress-circle"),require("@luzmo/lucero/tabs");var l=`:host{box-sizing:border-box;display:block;container-type:inline-size}.answer{width:100%;display:block}.chart-actions-bar{justify-content:space-between;align-items:flex-start;gap:var(--luzmo-interactive-viz-item-actions-gap,var(--interactive-viz-item-actions-gap));padding-block:var(--luzmo-interactive-viz-item-actions-padding-block,var(--interactive-viz-item-actions-padding-block));flex-wrap:nowrap;margin-block-start:var(--luzmo-interactive-viz-item-actions-margin-block-start,var(--interactive-viz-item-actions-margin-block-start));display:flex}.chart-actions-primary{gap:var(--luzmo-interactive-viz-item-actions-gap,var(--interactive-viz-item-actions-gap));flex-wrap:wrap;flex:1;align-items:center;min-width:0;display:flex}.ranking-content{gap:var(--luzmo-spacing-3);padding:var(--luzmo-spacing-3);flex-direction:column;display:flex}.ranking-row{gap:var(--luzmo-spacing-3);align-items:center;display:flex}.ranking-number{width:4rem}.icon-flipped{transform:scaleY(-1)}.chart-container{border-radius:var(--luzmo-interactive-viz-item-chart-border-radius,var(--interactive-viz-item-chart-border-radius));height:var(--luzmo-interactive-viz-item-chart-height,var(--interactive-viz-item-chart-height));overflow:hidden}.chart-container luzmo-embed-viz-item{width:100%;height:100%;display:block}.feedback-row{padding-block:var(--luzmo-interactive-viz-item-feedback-padding-block,var(--interactive-viz-item-feedback-padding-block));justify-content:space-between;align-items:center;display:flex}.rating-btn-positive{--luzmo-action-button-content-color-default-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-content-color-hover-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-content-color-down-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-content-color-focus-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-background-color-default-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-hover-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-down-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-focus-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background))}.rating-btn-negative{--luzmo-action-button-content-color-default-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-content-color-hover-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-content-color-down-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-content-color-focus-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-background-color-default-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-hover-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-down-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-focus-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background))}.config-toggle{--luzmo-action-button-border-radius:32px;margin-inline-start:auto}.sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.config-panel{border:1px solid var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color));border-radius:var(--luzmo-interactive-viz-item-config-panel-border-radius,var(--interactive-viz-item-config-panel-border-radius));padding:var(--luzmo-interactive-viz-item-config-panel-padding,var(--interactive-viz-item-config-panel-padding));background:var(--luzmo-interactive-viz-item-config-panel-background,var(--interactive-viz-item-config-panel-background));margin-block-start:var(--luzmo-spacing-2)}.config-panel luzmo-tab-panel[selected]{padding-block-start:var(--luzmo-spacing-4);display:block}.config-panel luzmo-item-option-panel,.config-panel luzmo-item-slot-picker-panel,.config-panel luzmo-filters{width:100%;max-height:15rem;scrollbar-width:thin;scrollbar-color:var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color)) transparent;padding-inline-end:var(--luzmo-spacing-3);overflow-y:auto}.edit-grid{min-height:12.5rem;display:flex}.edit-column{gap:var(--luzmo-spacing-3);flex-direction:column;display:flex}.edit-column:first-child{flex-shrink:0;max-width:15rem}.edit-column-filters{border-inline-start:1px solid var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color));flex:1;min-width:18.75rem;padding-inline-start:var(--luzmo-spacing-5)}@container (width<=520px){.edit-grid{flex-direction:column}.edit-column,.edit-column:first-child{width:100%;min-width:0;max-width:100%}.edit-column-filters{border-inline-start:none;border-block-start:1px solid var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color));min-width:0;margin-block-start:var(--luzmo-spacing-3);padding-block-start:var(--luzmo-spacing-4);padding-inline-start:0}}@container (width<=768px){.chart-container{height:calc(var(--luzmo-interactive-viz-item-chart-height,var(--interactive-viz-item-chart-height)) - var(--luzmo-interactive-viz-item-chart-narrow-offset,var(--interactive-viz-item-chart-narrow-offset)))}}:host{--interactive-viz-item-actions-gap:var(--luzmo-spacing-3);--interactive-viz-item-actions-padding-block:var(--luzmo-spacing-3);--interactive-viz-item-actions-margin-block-start:var(--luzmo-spacing-5);--interactive-viz-item-chart-height:20rem;--interactive-viz-item-chart-narrow-offset:2.5rem;--interactive-viz-item-chart-border-radius:var(--luzmo-border-radius);--interactive-viz-item-feedback-padding-block:var(--luzmo-spacing-4);--interactive-viz-item-config-panel-padding:var(--luzmo-spacing-5);--interactive-viz-item-config-panel-border-color:var(--luzmo-border-color);--interactive-viz-item-config-panel-border-radius:var(--luzmo-border-radius);--interactive-viz-item-config-panel-background:var(--luzmo-background-color);--interactive-viz-item-rating-positive-color:var(--luzmo-positive-color,#12855a);--interactive-viz-item-rating-negative-color:var(--luzmo-negative-color,#ca221c);--interactive-viz-item-rating-selected-background:var(--luzmo-background-color-focus,#0000000f)}:host([size=s]){--interactive-viz-item-chart-height:17.5rem}:host([size=l]){--interactive-viz-item-chart-height:22rem}:host([size=xl]){--interactive-viz-item-chart-height:24rem}`,u=i.t(()=>Promise.resolve().then(()=>require("./add-to-dashboard/index.cjs"))).load,d=[`luzmo-filters`,`luzmo-item-option-panel`,`luzmo-item-slot-picker-panel`],f=i.t(()=>Promise.all([Promise.resolve().then(()=>require("./filters/index.cjs")),Promise.resolve().then(()=>require("./item-option-panel/index.cjs")),Promise.resolve().then(()=>require("./item-slot-picker-panel/index.cjs"))])),p=f.load,m=()=>f.isLoaded()||d.every(e=>customElements.get(e)!==void 0),h=0,g=class extends n.t(e.n(e.i,{validSizes:Object.values(e.t)})){constructor(...e){super(...e),this.chart=null,this.feedback=null,this.messageId=``,this.authKey=``,this.authToken=``,this.apiUrl=`https://api.luzmo.com`,this.appServer=`https://app.luzmo.com`,this.contentLanguage=``,this.hideActions=!1,this.hideFeedback=!1,this.hideConfigPanel=!1,this.addToDashboard=!1,this.dashboardActions=null,this.controlled=!1,this._configPanelOpen=!1,this._configPanelPending=!1,this._configPanelLoadFailed=!1,this._rankingTriggerId=`interactive-viz-item-ranking-${++h}`,this._handleSlotsChanged=e=>{this.chart&&this._emitChart({...this.chart,slots:e.detail.slotsContents})},this._handleFiltersChanged=e=>{this.chart&&this._emitChart({...this.chart,filters:e.detail.filters})},this._handleOptionsChanged=e=>{if(!this.chart)return;let t=e.detail.options;if(!t)return;let n=this.chart.options.theme??{};this._emitChart({...this.chart,options:{...t,theme:{...n}}})}}static get styles(){return[(0,o.unsafeCSS)(l)]}get _effectiveContentLanguage(){return this.contentLanguage||this.language}_dispatch(e,t){let n=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});this.dispatchEvent(n)}get _chartActions(){return this.chart?r.n(r.o(this.chart)):[]}get _rating(){return this.feedback?.rating??0}get _canShowConfigPanel(){return!!this.chart&&!this.hideConfigPanel}async _toggleConfigPanel(){if(this._configPanelLoadFailed=!1,this._configPanelOpen)this._configPanelOpen=!1;else if(!this._configPanelPending){if(!m()){this._configPanelPending=!0;try{await p()}catch(e){console.warn(`Failed to load the chart configuration panel:`,e),this._configPanelLoadFailed=!0;return}finally{this._configPanelPending=!1}}this.isConnected&&this._canShowConfigPanel&&(this._configPanelOpen=!0)}}willUpdate(e){super.willUpdate(e),e.has(`addToDashboard`)&&this.addToDashboard&&u().catch(e=>console.warn(`Failed to load add to dashboard:`,e))}_emitOptions(e){!this.controlled&&this.chart&&(this.chart={...this.chart,options:e}),this._dispatch(`luzmo-chart-options-changed`,{options:e})}_emitChart(e){this.controlled||(this.chart=e),this._dispatch(`luzmo-chart-changed`,{chart:e})}_handleDropdownChange(e,t){if(!this.chart)return;t.stopPropagation();let n=t.detail,i=typeof n==`string`?n:n?.value??t.target?.value;if(!i)return;let a=r.t({...r.o(this.chart),options:this.chart.options},{type:`chartAction`,actionType:e.mutationType,key:i});this._emitOptions(a.options)}_currentRanking(e){return e.ranking??{active:!1,number:5,direction:r.c.Top}}_currentSort(e){return e.sort??{direction:r.u.Desc,by:r.l.Measure}}_emitRankAndSort(e,t){this.chart&&this._emitOptions({...this.chart.options,ranking:e,sort:t})}_renderOptionDropdown(e){let t=e.values??[],n=e.currentValue||t[0]?.key||``;return o.html`
|
|
21
|
-
<luzmo-picker
|
|
22
|
-
size=${this.size}
|
|
23
|
-
variant="highlight"
|
|
24
|
-
value=${n}
|
|
25
|
-
@change=${t=>this._handleDropdownChange(e,t)}
|
|
26
|
-
>
|
|
27
|
-
${t.map(e=>o.html`<luzmo-menu-item value=${e.key}>${e.label}</luzmo-menu-item>`)}
|
|
28
|
-
</luzmo-picker>
|
|
29
|
-
`}_renderRankingPicker(e){let t=this._currentRanking(e),n=this._currentSort(e);if(!t.active)return o.html`
|
|
30
|
-
<luzmo-action-button
|
|
31
|
-
size=${this.size}
|
|
32
|
-
@click=${()=>this._emitRankAndSort({active:!0,number:5,direction:r.c.Top},n)}
|
|
33
|
-
>
|
|
34
|
-
<luzmo-icon slot="icon" size="xs" .icon=${a.luzmoAlignLeft}></luzmo-icon>
|
|
35
|
-
${(0,c.msg)(`Show top 5`,{desc:`Label to activate top-N ranking on a chart`})}
|
|
36
|
-
</luzmo-action-button>
|
|
37
|
-
`;let i=t.direction===r.c.Bottom?(0,c.msg)(`Bottom`,{desc:`Ranking direction: keep the lowest values`}):(0,c.msg)(`Top`,{desc:`Ranking direction: keep the highest values`});return o.html`
|
|
38
|
-
<luzmo-action-button size=${this.size} id=${this._rankingTriggerId}>
|
|
39
|
-
<luzmo-icon slot="icon" size="xs" .icon=${a.luzmoAlignLeft}></luzmo-icon>
|
|
40
|
-
${i} ${t.number||5}
|
|
41
|
-
</luzmo-action-button>
|
|
42
|
-
|
|
43
|
-
<luzmo-overlay type="auto" placement="bottom-start" trigger=${`${this._rankingTriggerId}@click`}>
|
|
44
|
-
<luzmo-popover>
|
|
45
|
-
<div class="ranking-content">
|
|
46
|
-
<div class="ranking-row">
|
|
47
|
-
<luzmo-action-group
|
|
48
|
-
size=${this.size}
|
|
49
|
-
compact
|
|
50
|
-
selects="single"
|
|
51
|
-
.selected=${[t.direction]}
|
|
52
|
-
@change=${t=>this._handleDirectionChange(e,t)}
|
|
53
|
-
>
|
|
54
|
-
<luzmo-action-button value="top" emphasized
|
|
55
|
-
>${(0,c.msg)(`Top`,{desc:`Ranking direction: keep the highest values`})}</luzmo-action-button
|
|
56
|
-
>
|
|
57
|
-
<luzmo-action-button value="bottom" emphasized
|
|
58
|
-
>${(0,c.msg)(`Bottom`,{desc:`Ranking direction: keep the lowest values`})}</luzmo-action-button
|
|
59
|
-
>
|
|
60
|
-
</luzmo-action-group>
|
|
61
|
-
|
|
62
|
-
<luzmo-number-field
|
|
63
|
-
class="ranking-number"
|
|
64
|
-
size=${this.size}
|
|
65
|
-
hide-stepper
|
|
66
|
-
min="1"
|
|
67
|
-
max="100"
|
|
68
|
-
step="1"
|
|
69
|
-
.value=${t.number}
|
|
70
|
-
@change=${t=>this._handleNumberChange(e,t)}
|
|
71
|
-
@input=${t=>this._handleNumberChange(e,t)}
|
|
72
|
-
></luzmo-number-field>
|
|
73
|
-
</div>
|
|
74
|
-
|
|
75
|
-
<div class="ranking-row">
|
|
76
|
-
<luzmo-action-group
|
|
77
|
-
size=${this.size}
|
|
78
|
-
compact
|
|
79
|
-
selects="single"
|
|
80
|
-
.selected=${[n.by]}
|
|
81
|
-
@change=${t=>this._handleSortByChange(e,t)}
|
|
82
|
-
>
|
|
83
|
-
<luzmo-action-button value="measure" emphasized>123</luzmo-action-button>
|
|
84
|
-
<luzmo-action-button value="category" emphasized>ABC</luzmo-action-button>
|
|
85
|
-
</luzmo-action-group>
|
|
86
|
-
|
|
87
|
-
<luzmo-action-group
|
|
88
|
-
size=${this.size}
|
|
89
|
-
compact
|
|
90
|
-
selects="single"
|
|
91
|
-
.selected=${[n.direction]}
|
|
92
|
-
@change=${t=>this._handleSortDirectionChange(e,t)}
|
|
93
|
-
>
|
|
94
|
-
<luzmo-action-button
|
|
95
|
-
value="desc"
|
|
96
|
-
emphasized
|
|
97
|
-
label=${(0,c.msg)(`Sort descending`,{desc:`Sort chart values in descending order`})}
|
|
98
|
-
>
|
|
99
|
-
<luzmo-icon slot="icon" size="xs" .icon=${a.luzmoAlignLeft}></luzmo-icon>
|
|
100
|
-
</luzmo-action-button>
|
|
101
|
-
<luzmo-action-button
|
|
102
|
-
value="asc"
|
|
103
|
-
emphasized
|
|
104
|
-
label=${(0,c.msg)(`Sort ascending`,{desc:`Sort chart values in ascending order`})}
|
|
105
|
-
>
|
|
106
|
-
<luzmo-icon slot="icon" size="xs" class="icon-flipped" .icon=${a.luzmoAlignLeft}></luzmo-icon>
|
|
107
|
-
</luzmo-action-button>
|
|
108
|
-
</luzmo-action-group>
|
|
109
|
-
</div>
|
|
110
|
-
</div>
|
|
111
|
-
</luzmo-popover>
|
|
112
|
-
</luzmo-overlay>
|
|
113
|
-
`}_handleDirectionChange(e,t){t.stopPropagation();let n=t.target?.selected;n?.length&&this._emitRankAndSort({...this._currentRanking(e),direction:n[0]},this._currentSort(e))}_handleNumberChange(e,t){t.stopPropagation();let n=t.target?.value,r=typeof n==`number`?n:Number.parseInt(String(n),10);!Number.isNaN(r)&&r>=1&&this._emitRankAndSort({...this._currentRanking(e),number:r},this._currentSort(e))}_handleSortByChange(e,t){t.stopPropagation();let n=t.target?.selected;n?.length&&this._emitRankAndSort(this._currentRanking(e),{...this._currentSort(e),by:n[0]})}_handleSortDirectionChange(e,t){t.stopPropagation();let n=t.target?.selected;n?.length&&this._emitRankAndSort(this._currentRanking(e),{...this._currentSort(e),direction:n[0]})}_renderAddToDashboard(){return this.addToDashboard?o.html`
|
|
114
|
-
<luzmo-add-to-dashboard
|
|
115
|
-
size=${this.size}
|
|
116
|
-
language=${this.language}
|
|
117
|
-
.chart=${this.chart}
|
|
118
|
-
.dashboardActions=${this.dashboardActions}
|
|
119
|
-
.authKey=${this.authKey}
|
|
120
|
-
.authToken=${this.authToken}
|
|
121
|
-
.apiUrl=${this.apiUrl}
|
|
122
|
-
></luzmo-add-to-dashboard>
|
|
123
|
-
`:o.nothing}_renderActions(){return this.hideActions?o.html`
|
|
124
|
-
<div class="chart-actions-bar">
|
|
125
|
-
<div class="chart-actions-primary"></div>
|
|
126
|
-
<slot name="chart-actions-extra"></slot>
|
|
127
|
-
${this._renderAddToDashboard()}
|
|
128
|
-
</div>
|
|
129
|
-
`:o.html`
|
|
130
|
-
<div class="chart-actions-bar">
|
|
131
|
-
<div class="chart-actions-primary">
|
|
132
|
-
${this._chartActions.map(e=>e.type===`optionDropdown`?this._renderOptionDropdown(e):this._renderRankingPicker(e))}
|
|
133
|
-
</div>
|
|
134
|
-
<slot name="chart-actions-extra"></slot>
|
|
135
|
-
${this._renderAddToDashboard()}
|
|
136
|
-
</div>
|
|
137
|
-
`}_renderChart(){if(!this.chart)return o.nothing;let e=r.o(this.chart);return o.html`
|
|
138
|
-
<div class="chart-container" part="chart-container">
|
|
139
|
-
<luzmo-embed-viz-item
|
|
140
|
-
.type=${e.type}
|
|
141
|
-
.options=${e.options}
|
|
142
|
-
.slots=${e.slots}
|
|
143
|
-
.filters=${e.filters??[]}
|
|
144
|
-
.authKey=${this.authKey}
|
|
145
|
-
.authToken=${this.authToken}
|
|
146
|
-
.apiHost=${this.apiUrl}
|
|
147
|
-
.appServer=${this.appServer}
|
|
148
|
-
.language=${this._effectiveContentLanguage}
|
|
149
|
-
.canFilter=${this.canFilter??!1}
|
|
150
|
-
></luzmo-embed-viz-item>
|
|
151
|
-
</div>
|
|
152
|
-
`}_renderFeedback(){let e=!this.hideFeedback&&!!this.messageId,t=this._canShowConfigPanel,n=(0,c.msg)(`Loading`,{desc:`Loading spinner label`});return!e&&!t?o.nothing:o.html`
|
|
153
|
-
<div class="feedback-row">
|
|
154
|
-
${e?o.html`
|
|
155
|
-
<luzmo-action-group quiet size=${this.size}>
|
|
156
|
-
<luzmo-action-button
|
|
157
|
-
class="rating-btn-positive"
|
|
158
|
-
value="positive"
|
|
159
|
-
quiet
|
|
160
|
-
label=${(0,c.msg)(`Good response`,{desc:`Accessible label for the positive feedback button`})}
|
|
161
|
-
?selected=${this._rating===1}
|
|
162
|
-
@click=${()=>this._toggleRating(!0)}
|
|
163
|
-
>
|
|
164
|
-
<luzmo-icon slot="icon" size="s" .icon=${a.luzmoThumbsUp}></luzmo-icon>
|
|
165
|
-
</luzmo-action-button>
|
|
166
|
-
<luzmo-action-button
|
|
167
|
-
class="rating-btn-negative"
|
|
168
|
-
value="negative"
|
|
169
|
-
quiet
|
|
170
|
-
label=${(0,c.msg)(`Bad response`,{desc:`Accessible label for the negative feedback button`})}
|
|
171
|
-
?selected=${this._rating===-1}
|
|
172
|
-
@click=${()=>this._toggleRating(!1)}
|
|
173
|
-
>
|
|
174
|
-
<luzmo-icon slot="icon" size="s" .icon=${a.luzmoThumbsDown}></luzmo-icon>
|
|
175
|
-
</luzmo-action-button>
|
|
176
|
-
</luzmo-action-group>
|
|
177
|
-
`:o.nothing}
|
|
178
|
-
${t?o.html`
|
|
179
|
-
<luzmo-action-button
|
|
180
|
-
class="config-toggle"
|
|
181
|
-
size=${this.size}
|
|
182
|
-
quiet
|
|
183
|
-
?selected=${this._configPanelOpen}
|
|
184
|
-
aria-expanded=${this._configPanelOpen}
|
|
185
|
-
aria-label=${this._configPanelPending?n:(0,c.msg)(`Configure chart`,{desc:`Accessible label for the chart config toggle`})}
|
|
186
|
-
@click=${()=>this._toggleConfigPanel()}
|
|
187
|
-
>
|
|
188
|
-
${this._configPanelPending?o.html`<luzmo-progress-circle slot="icon" size="s" indeterminate .label=${n}></luzmo-progress-circle>`:o.html`<luzmo-icon slot="icon" size="s" .icon=${a.luzmoInfoCircle}></luzmo-icon>`}
|
|
189
|
-
</luzmo-action-button>
|
|
190
|
-
<span class="sr-only" role="status" aria-live="polite">${this._configPanelPending?n:``}</span>
|
|
191
|
-
<span class="sr-only" role="alert">${this._configPanelLoadFailed?(0,c.msg)(`Failed to load the chart configuration. Please try again.`,{desc:`Error message when the chart config panel fails to load`}):``}</span>
|
|
192
|
-
`:o.nothing}
|
|
193
|
-
</div>
|
|
194
|
-
`}_toggleRating(e){let t=e?1:-1,n=this._rating===t?0:t;this._dispatch(`luzmo-feedback-changed`,{rating:n,comment:this.feedback?.comment})}_renderConfigPanel(){if(!this.chart||this.hideConfigPanel||!this._configPanelOpen)return o.nothing;let e=this.chart,t=r.r(e.slots??[]),n=r.i(t),i=e.options.theme??{};return o.html`
|
|
195
|
-
<div class="config-panel" part="config-panel">
|
|
196
|
-
<luzmo-tabs selected="data" size=${this.size}>
|
|
197
|
-
<luzmo-tab value="data">${(0,c.msg)(`Data`,{desc:`Label for the data section`})}</luzmo-tab>
|
|
198
|
-
<luzmo-tab value="options">${(0,c.msg)(`Options`,{desc:`Label for the options section`})}</luzmo-tab>
|
|
199
|
-
|
|
200
|
-
<luzmo-tab-panel value="data">
|
|
201
|
-
<div class="edit-grid">
|
|
202
|
-
<div class="edit-column">
|
|
203
|
-
<luzmo-item-slot-picker-panel
|
|
204
|
-
size=${this.size}
|
|
205
|
-
slot-menu-placement="bottom-end"
|
|
206
|
-
.itemType=${e.type}
|
|
207
|
-
.slotsContents=${t}
|
|
208
|
-
.datasetIds=${n}
|
|
209
|
-
.authKey=${this.authKey}
|
|
210
|
-
.authToken=${this.authToken}
|
|
211
|
-
.apiUrl=${this.apiUrl}
|
|
212
|
-
.language=${this.language}
|
|
213
|
-
.contentLanguage=${this._effectiveContentLanguage}
|
|
214
|
-
@luzmo-slots-contents-changed=${this._handleSlotsChanged}
|
|
215
|
-
></luzmo-item-slot-picker-panel>
|
|
216
|
-
</div>
|
|
217
|
-
<div class="edit-column edit-column-filters">
|
|
218
|
-
<luzmo-field-label size=${this.size}
|
|
219
|
-
>${(0,c.msg)(`Filters`,{desc:`Label for the filters section`})}</luzmo-field-label
|
|
220
|
-
>
|
|
221
|
-
<luzmo-filters
|
|
222
|
-
size=${this.size}
|
|
223
|
-
.datasetIds=${n}
|
|
224
|
-
.filters=${e.filters??[]}
|
|
225
|
-
.authKey=${this.authKey}
|
|
226
|
-
.authToken=${this.authToken}
|
|
227
|
-
.apiUrl=${this.apiUrl}
|
|
228
|
-
.language=${this.language}
|
|
229
|
-
.contentLanguage=${this._effectiveContentLanguage}
|
|
230
|
-
@luzmo-filters-changed=${this._handleFiltersChanged}
|
|
231
|
-
></luzmo-filters>
|
|
232
|
-
</div>
|
|
233
|
-
</div>
|
|
234
|
-
</luzmo-tab-panel>
|
|
235
|
-
|
|
236
|
-
<luzmo-tab-panel value="options">
|
|
237
|
-
<luzmo-item-option-panel
|
|
238
|
-
size=${this.size}
|
|
239
|
-
.itemType=${e.type}
|
|
240
|
-
.options=${e.options||{}}
|
|
241
|
-
.slots=${t}
|
|
242
|
-
.theme=${i}
|
|
243
|
-
.authKey=${this.authKey}
|
|
244
|
-
.authToken=${this.authToken}
|
|
245
|
-
.apiUrl=${this.apiUrl}
|
|
246
|
-
.language=${this.language}
|
|
247
|
-
@luzmo-options-changed=${this._handleOptionsChanged}
|
|
248
|
-
></luzmo-item-option-panel>
|
|
249
|
-
</luzmo-tab-panel>
|
|
250
|
-
</luzmo-tabs>
|
|
251
|
-
</div>
|
|
252
|
-
`}render(){return this.chart?o.html`
|
|
253
|
-
<div class="answer" part="container">
|
|
254
|
-
${this._renderActions()} ${this._renderChart()} ${this._renderFeedback()} ${this._renderConfigPanel()}
|
|
255
|
-
</div>
|
|
256
|
-
`:o.html`
|
|
257
|
-
<div
|
|
258
|
-
class="answer"
|
|
259
|
-
part="container"
|
|
260
|
-
></div>
|
|
261
|
-
`}};t.t([(0,s.property)({type:Object})],g.prototype,`chart`,void 0),t.t([(0,s.property)({type:Object})],g.prototype,`feedback`,void 0),t.t([(0,s.property)({type:String,attribute:`message-id`})],g.prototype,`messageId`,void 0),t.t([(0,s.property)({type:String,attribute:`auth-key`})],g.prototype,`authKey`,void 0),t.t([(0,s.property)({type:String,attribute:`auth-token`})],g.prototype,`authToken`,void 0),t.t([(0,s.property)({type:String,attribute:`api-url`})],g.prototype,`apiUrl`,void 0),t.t([(0,s.property)({type:String,attribute:`app-server`})],g.prototype,`appServer`,void 0),t.t([(0,s.property)({type:String,attribute:`content-language`})],g.prototype,`contentLanguage`,void 0),t.t([(0,s.property)({type:Boolean,attribute:`hide-actions`,reflect:!0})],g.prototype,`hideActions`,void 0),t.t([(0,s.property)({type:Boolean,attribute:`hide-feedback`,reflect:!0})],g.prototype,`hideFeedback`,void 0),t.t([(0,s.property)({type:Boolean,attribute:`hide-config-panel`,reflect:!0})],g.prototype,`hideConfigPanel`,void 0),t.t([(0,s.property)({type:Boolean,attribute:`add-to-dashboard`,reflect:!0})],g.prototype,`addToDashboard`,void 0),t.t([(0,s.property)({attribute:!1})],g.prototype,`dashboardActions`,void 0),t.t([(0,s.property)({type:Boolean,reflect:!0})],g.prototype,`controlled`,void 0),t.t([(0,s.property)({attribute:`can-filter`,converter:{fromAttribute:e=>e===null?void 0:`all`}})],g.prototype,`canFilter`,void 0),t.t([(0,s.state)()],g.prototype,`_configPanelOpen`,void 0),t.t([(0,s.state)()],g.prototype,`_configPanelPending`,void 0),t.t([(0,s.state)()],g.prototype,`_configPanelLoadFailed`,void 0),customElements.get(`luzmo-interactive-viz-item`)||customElements.define(`luzmo-interactive-viz-item`,g),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return g}});
|