@luzmo/analytics-components-kit 1.1.1 → 1.2.1
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 -2
- package/angular/components/interactive-viz-item.ts +40 -3
- 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 +13 -4
- package/angular/esm/components/interactive-viz-item.js +29 -3
- 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/{base-store-SgJsjLap.cjs → base-store-D3whjduR.cjs} +1 -1
- package/components/{base-store-g0dt7ru7.js → base-store-DQYj8A1W.js} +3 -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 +7 -7
- 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 +1 -1
- package/components/interactive-viz-item/interactive-viz-item.d.ts +31 -1
- package/components/interactive-viz-item/types.d.ts +13 -0
- package/components/{interactive-viz-item-CofUkpP6.js → interactive-viz-item-CwRRaCZB.js} +144 -84
- package/components/interactive-viz-item-CxdrGRKc.cjs +265 -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 +409 -103
- package/package.json +1 -1
- 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/chunks/{choropleth-map-options.config-Cs4Kvr9h.js → choropleth-map-options.config-rUJsEJcm.js} +1 -1
- package/standalone/chunks/{color-range-utils-CKDpd3gZ.js → color-range-utils-DxOtqAKB.js} +1 -1
- package/standalone/chunks/embed-CBu7iQRx.js +231 -0
- package/standalone/chunks/{heat-map-options.config-DF5kjOOe.js → heat-map-options.config-D93AeYFi.js} +1 -1
- package/standalone/chunks/{heat-table-options.config-DaePzfHG.js → heat-table-options.config-ZVML76FK.js} +1 -1
- package/standalone/chunks/is-same-option-value-Di-A7Wmg.js +2 -0
- package/standalone/chunks/item-option-color-picker-lLvBPnKA.js +19 -0
- package/standalone/chunks/{item-option-color-range-CyJd1LZ_.js → item-option-color-range-BqeatOei.js} +18 -15
- package/standalone/chunks/item-option-guidelines-Cop8rM8y.js +120 -0
- package/standalone/chunks/item-option-panel-CzSKFCVl.js +316 -0
- package/standalone/chunks/item-option-slider-K_bsNci8.js +18 -0
- package/standalone/chunks/option-interaction-controller-BslAXAHF.js +2 -0
- package/standalone/chunks/{route-map-options.config-D7FfzIiU.js → route-map-options.config-Dwy0JSVq.js} +1 -1
- package/standalone/chunks/{spike-map-options.config-CZiFzDm9.js → spike-map-options.config-DFmuNxym.js} +1 -1
- package/standalone/interactive-viz-item.js +24 -20
- package/standalone/item-grid.js +1 -1
- package/standalone/manifest.json +14 -13
- 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/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/embed-BfHBKhIe.js +0 -231
- package/standalone/chunks/item-option-color-picker-Cr7ujQNO.js +0 -16
- 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-slider-l9wt7_0c.js +0 -15
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, Input, output, Renderer2 } from '@angular/core';
|
|
1
|
+
import { booleanAttribute, ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, Input, output, Renderer2 } from '@angular/core';
|
|
2
2
|
import '@luzmo/analytics-components-kit/item-option-slider';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
const _c0 = ["*"];
|
|
@@ -27,12 +27,20 @@ export class LuzmoItemOptionSlider {
|
|
|
27
27
|
step;
|
|
28
28
|
/** Delay in milliseconds before the change event is emitted after the user stops interacting. */
|
|
29
29
|
debounce;
|
|
30
|
+
/** Emits value updates live, without `debounce`, plus interaction lifecycle events for drags and held keys. */
|
|
31
|
+
liveInteractions;
|
|
30
32
|
/** Optional transform applied to the stored value before it is displayed in the control. */
|
|
31
33
|
parseValue;
|
|
32
34
|
/** Optional transform applied to the control's value before it is emitted in the change event. */
|
|
33
35
|
toValue;
|
|
34
|
-
/** Emitted when the option value changes. */
|
|
36
|
+
/** Emitted when the option value changes. With `live-interactions`, emitted on every drag or key step and carries `interaction` inside a gesture. */
|
|
35
37
|
luzmoOptionChanged = output({ alias: 'luzmoOptionChanged' });
|
|
38
|
+
/** With `live-interactions`: a drag or held key first changed the value, right before that value update. A press that never changes the value emits no lifecycle. */
|
|
39
|
+
luzmoOptionInteractionStart = output({ alias: 'luzmoOptionInteractionStart' });
|
|
40
|
+
/** With `live-interactions`: the gesture ended, after its last value update. `changed` is false when the value is back at its start. */
|
|
41
|
+
luzmoOptionInteractionEnd = output({ alias: 'luzmoOptionInteractionEnd' });
|
|
42
|
+
/** With `live-interactions`: the pointer was cancelled and the slider reverted to its start value. */
|
|
43
|
+
luzmoOptionInteractionCancel = output({ alias: 'luzmoOptionInteractionCancel' });
|
|
36
44
|
constructor() {
|
|
37
45
|
this.bindEvents();
|
|
38
46
|
this.destroyRef.onDestroy(() => {
|
|
@@ -62,6 +70,9 @@ export class LuzmoItemOptionSlider {
|
|
|
62
70
|
case 'debounce':
|
|
63
71
|
this.setHostProperty('debounce', changes['debounce'].currentValue);
|
|
64
72
|
break;
|
|
73
|
+
case 'liveInteractions':
|
|
74
|
+
this.setHostProperty('liveInteractions', changes['liveInteractions'].currentValue);
|
|
75
|
+
break;
|
|
65
76
|
case 'parseValue':
|
|
66
77
|
this.setHostProperty('parseValue', changes['parseValue'].currentValue);
|
|
67
78
|
break;
|
|
@@ -87,9 +98,21 @@ export class LuzmoItemOptionSlider {
|
|
|
87
98
|
const typed = event;
|
|
88
99
|
this.luzmoOptionChanged.emit(typed);
|
|
89
100
|
}));
|
|
101
|
+
this.listenerCleanup.push(this.renderer.listen(this.host, 'luzmo-option-interaction-start', (event) => {
|
|
102
|
+
const typed = event;
|
|
103
|
+
this.luzmoOptionInteractionStart.emit(typed);
|
|
104
|
+
}));
|
|
105
|
+
this.listenerCleanup.push(this.renderer.listen(this.host, 'luzmo-option-interaction-end', (event) => {
|
|
106
|
+
const typed = event;
|
|
107
|
+
this.luzmoOptionInteractionEnd.emit(typed);
|
|
108
|
+
}));
|
|
109
|
+
this.listenerCleanup.push(this.renderer.listen(this.host, 'luzmo-option-interaction-cancel', (event) => {
|
|
110
|
+
const typed = event;
|
|
111
|
+
this.luzmoOptionInteractionCancel.emit(typed);
|
|
112
|
+
}));
|
|
90
113
|
}
|
|
91
114
|
static ɵfac = function LuzmoItemOptionSlider_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoItemOptionSlider)(); };
|
|
92
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoItemOptionSlider, selectors: [["luzmo-item-option-slider"]], inputs: { value: "value", default: "default", min: "min", max: "max", step: "step", debounce: "debounce", parseValue: "parseValue", toValue: "toValue" }, outputs: { luzmoOptionChanged: "luzmoOptionChanged" }, exportAs: ["luzmoItemOptionSlider"], features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoItemOptionSlider_Template(rf, ctx) { if (rf & 1) {
|
|
115
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoItemOptionSlider, selectors: [["luzmo-item-option-slider"]], inputs: { value: "value", default: "default", min: "min", max: "max", step: "step", debounce: "debounce", liveInteractions: [2, "liveInteractions", "liveInteractions", booleanAttribute], parseValue: "parseValue", toValue: "toValue" }, outputs: { luzmoOptionChanged: "luzmoOptionChanged", luzmoOptionInteractionStart: "luzmoOptionInteractionStart", luzmoOptionInteractionEnd: "luzmoOptionInteractionEnd", luzmoOptionInteractionCancel: "luzmoOptionInteractionCancel" }, exportAs: ["luzmoItemOptionSlider"], features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoItemOptionSlider_Template(rf, ctx) { if (rf & 1) {
|
|
93
116
|
i0.ɵɵprojectionDef();
|
|
94
117
|
i0.ɵɵprojection(0);
|
|
95
118
|
} }, encapsulation: 2 });
|
|
@@ -121,11 +144,14 @@ export class LuzmoItemOptionSlider {
|
|
|
121
144
|
}], debounce: [{
|
|
122
145
|
type: Input,
|
|
123
146
|
args: [{ alias: 'debounce' }]
|
|
147
|
+
}], liveInteractions: [{
|
|
148
|
+
type: Input,
|
|
149
|
+
args: [{ alias: 'liveInteractions', transform: booleanAttribute }]
|
|
124
150
|
}], parseValue: [{
|
|
125
151
|
type: Input,
|
|
126
152
|
args: [{ alias: 'parseValue' }]
|
|
127
153
|
}], toValue: [{
|
|
128
154
|
type: Input,
|
|
129
155
|
args: [{ alias: 'toValue' }]
|
|
130
|
-
}], luzmoOptionChanged: [{ type: i0.Output, args: ["luzmoOptionChanged"] }] }); })();
|
|
156
|
+
}], luzmoOptionChanged: [{ type: i0.Output, args: ["luzmoOptionChanged"] }], luzmoOptionInteractionStart: [{ type: i0.Output, args: ["luzmoOptionInteractionStart"] }], luzmoOptionInteractionEnd: [{ type: i0.Output, args: ["luzmoOptionInteractionEnd"] }], luzmoOptionInteractionCancel: [{ type: i0.Output, args: ["luzmoOptionInteractionCancel"] }] }); })();
|
|
131
157
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LuzmoItemOptionSlider, { className: "LuzmoItemOptionSlider", filePath: "components/item-option-slider.ts", lineNumber: 16 }); })();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { OnChanges, SimpleChanges } from '@angular/core';
|
|
2
2
|
import '@luzmo/analytics-components-kit/item-option';
|
|
3
|
-
import type { LuzmoItemOption as LuzmoItemOptionHostElement, ItemOptionsChangedEventDetail } from '@luzmo/analytics-components-kit/item-option';
|
|
3
|
+
import type { LuzmoItemOption as LuzmoItemOptionHostElement, ItemOptionInteractionEventDetail, ItemOptionsChangedEventDetail } from '@luzmo/analytics-components-kit/item-option';
|
|
4
4
|
import type { ElementSize } from '@luzmo/analytics-components-kit/types';
|
|
5
5
|
import type { OptionConfig, OptionTranslation, ThemeConfig, TranslationOverrides, VizItemType } from '@luzmo/dashboard-contents-types';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
|
-
export type { ItemOptionChangedEventDetail, ItemOptionsChangedEventDetail } from '@luzmo/analytics-components-kit/item-option';
|
|
7
|
+
export type { ItemOptionChangedEventDetail, ItemOptionInteraction, ItemOptionInteractionEventDetail, ItemOptionInteractionEventName, ItemOptionsChangedEventDetail } from '@luzmo/analytics-components-kit/item-option';
|
|
8
8
|
export declare class LuzmoItemOption implements OnChanges {
|
|
9
9
|
private readonly elementRef;
|
|
10
10
|
private readonly renderer;
|
|
@@ -37,10 +37,18 @@ export declare class LuzmoItemOption implements OnChanges {
|
|
|
37
37
|
authToken?: string;
|
|
38
38
|
/** The size variant of the option control (`s`, `m`, `l`, `xl`). */
|
|
39
39
|
size?: ElementSize;
|
|
40
|
+
/** Emits options updates live, without the control's debounce, plus `luzmo-option-interaction-*` events around drags and held keys. Off by default. */
|
|
41
|
+
liveInteractions?: boolean;
|
|
40
42
|
/** Callback that updates `options` and emits `luzmo-options-changed`; used internally by the rendered control. */
|
|
41
43
|
changedOptions?: unknown;
|
|
42
|
-
/** Announces that the `options` of the element have changed */
|
|
44
|
+
/** Announces that the `options` of the element have changed. With `live-interactions`, updates inside a gesture carry `interaction`. */
|
|
43
45
|
readonly luzmoOptionsChanged: import("@angular/core").OutputEmitterRef<CustomEvent<ItemOptionsChangedEventDetail>>;
|
|
46
|
+
/** With `live-interactions`: a drag or held key first changed the control's value, right before that options update. A press that never changes the value emits no lifecycle. `detail.optionKey` is set. */
|
|
47
|
+
readonly luzmoOptionInteractionStart: import("@angular/core").OutputEmitterRef<CustomEvent<ItemOptionInteractionEventDetail>>;
|
|
48
|
+
/** With `live-interactions`: the gesture ended, after its last options update. `detail.changed` is false when the value is back at its start. */
|
|
49
|
+
readonly luzmoOptionInteractionEnd: import("@angular/core").OutputEmitterRef<CustomEvent<ItemOptionInteractionEventDetail>>;
|
|
50
|
+
/** With `live-interactions`: the gesture was cancelled and the control reverted to its start value. */
|
|
51
|
+
readonly luzmoOptionInteractionCancel: import("@angular/core").OutputEmitterRef<CustomEvent<ItemOptionInteractionEventDetail>>;
|
|
44
52
|
constructor();
|
|
45
53
|
ngOnChanges(changes: SimpleChanges): void;
|
|
46
54
|
/**
|
|
@@ -52,7 +60,8 @@ export declare class LuzmoItemOption implements OnChanges {
|
|
|
52
60
|
private setHostProperty;
|
|
53
61
|
private bindEvents;
|
|
54
62
|
static ɵfac: i0.ɵɵFactoryDeclaration<LuzmoItemOption, never>;
|
|
55
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoItemOption, "luzmo-item-option", ["luzmoItemOption"], { "language": { "alias": "language"; "required": false; }; "itemType": { "alias": "itemType"; "required": false; }; "optionKey": { "alias": "optionKey"; "required": false; }; "customOptionConfiguration": { "alias": "customOptionConfiguration"; "required": false; }; "customTranslations": { "alias": "customTranslations"; "required": false; }; "options": { "alias": "options"; "required": false; }; "slots": { "alias": "slots"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "apiUrl": { "alias": "apiUrl"; "required": false; }; "authKey": { "alias": "authKey"; "required": false; }; "authToken": { "alias": "authToken"; "required": false; }; "size": { "alias": "size"; "required": false; }; "changedOptions": { "alias": "changedOptions"; "required": false; }; }, { "luzmoOptionsChanged": "luzmoOptionsChanged"; }, never, ["*"], true, never>;
|
|
63
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoItemOption, "luzmo-item-option", ["luzmoItemOption"], { "language": { "alias": "language"; "required": false; }; "itemType": { "alias": "itemType"; "required": false; }; "optionKey": { "alias": "optionKey"; "required": false; }; "customOptionConfiguration": { "alias": "customOptionConfiguration"; "required": false; }; "customTranslations": { "alias": "customTranslations"; "required": false; }; "options": { "alias": "options"; "required": false; }; "slots": { "alias": "slots"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "apiUrl": { "alias": "apiUrl"; "required": false; }; "authKey": { "alias": "authKey"; "required": false; }; "authToken": { "alias": "authToken"; "required": false; }; "size": { "alias": "size"; "required": false; }; "liveInteractions": { "alias": "liveInteractions"; "required": false; }; "changedOptions": { "alias": "changedOptions"; "required": false; }; }, { "luzmoOptionsChanged": "luzmoOptionsChanged"; "luzmoOptionInteractionStart": "luzmoOptionInteractionStart"; "luzmoOptionInteractionEnd": "luzmoOptionInteractionEnd"; "luzmoOptionInteractionCancel": "luzmoOptionInteractionCancel"; }, never, ["*"], true, never>;
|
|
64
|
+
static ngAcceptInputType_liveInteractions: unknown;
|
|
56
65
|
}
|
|
57
66
|
/** The underlying custom element type for LuzmoItemOption */
|
|
58
67
|
export type LuzmoItemOptionElement = LuzmoItemOptionHostElement;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, Input, output, Renderer2 } from '@angular/core';
|
|
1
|
+
import { booleanAttribute, ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, Input, output, Renderer2 } from '@angular/core';
|
|
2
2
|
import '@luzmo/analytics-components-kit/item-option';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
const _c0 = ["*"];
|
|
@@ -39,10 +39,18 @@ export class LuzmoItemOption {
|
|
|
39
39
|
authToken;
|
|
40
40
|
/** The size variant of the option control (`s`, `m`, `l`, `xl`). */
|
|
41
41
|
size;
|
|
42
|
+
/** Emits options updates live, without the control's debounce, plus `luzmo-option-interaction-*` events around drags and held keys. Off by default. */
|
|
43
|
+
liveInteractions;
|
|
42
44
|
/** Callback that updates `options` and emits `luzmo-options-changed`; used internally by the rendered control. */
|
|
43
45
|
changedOptions;
|
|
44
|
-
/** Announces that the `options` of the element have changed */
|
|
46
|
+
/** Announces that the `options` of the element have changed. With `live-interactions`, updates inside a gesture carry `interaction`. */
|
|
45
47
|
luzmoOptionsChanged = output({ alias: 'luzmoOptionsChanged' });
|
|
48
|
+
/** With `live-interactions`: a drag or held key first changed the control's value, right before that options update. A press that never changes the value emits no lifecycle. `detail.optionKey` is set. */
|
|
49
|
+
luzmoOptionInteractionStart = output({ alias: 'luzmoOptionInteractionStart' });
|
|
50
|
+
/** With `live-interactions`: the gesture ended, after its last options update. `detail.changed` is false when the value is back at its start. */
|
|
51
|
+
luzmoOptionInteractionEnd = output({ alias: 'luzmoOptionInteractionEnd' });
|
|
52
|
+
/** With `live-interactions`: the gesture was cancelled and the control reverted to its start value. */
|
|
53
|
+
luzmoOptionInteractionCancel = output({ alias: 'luzmoOptionInteractionCancel' });
|
|
46
54
|
constructor() {
|
|
47
55
|
this.bindEvents();
|
|
48
56
|
this.destroyRef.onDestroy(() => {
|
|
@@ -90,6 +98,9 @@ export class LuzmoItemOption {
|
|
|
90
98
|
case 'size':
|
|
91
99
|
this.setHostProperty('size', changes['size'].currentValue);
|
|
92
100
|
break;
|
|
101
|
+
case 'liveInteractions':
|
|
102
|
+
this.setHostProperty('liveInteractions', changes['liveInteractions'].currentValue);
|
|
103
|
+
break;
|
|
93
104
|
case 'changedOptions':
|
|
94
105
|
this.setHostProperty('changedOptions', changes['changedOptions'].currentValue);
|
|
95
106
|
break;
|
|
@@ -112,9 +123,21 @@ export class LuzmoItemOption {
|
|
|
112
123
|
const typed = event;
|
|
113
124
|
this.luzmoOptionsChanged.emit(typed);
|
|
114
125
|
}));
|
|
126
|
+
this.listenerCleanup.push(this.renderer.listen(this.host, 'luzmo-option-interaction-start', (event) => {
|
|
127
|
+
const typed = event;
|
|
128
|
+
this.luzmoOptionInteractionStart.emit(typed);
|
|
129
|
+
}));
|
|
130
|
+
this.listenerCleanup.push(this.renderer.listen(this.host, 'luzmo-option-interaction-end', (event) => {
|
|
131
|
+
const typed = event;
|
|
132
|
+
this.luzmoOptionInteractionEnd.emit(typed);
|
|
133
|
+
}));
|
|
134
|
+
this.listenerCleanup.push(this.renderer.listen(this.host, 'luzmo-option-interaction-cancel', (event) => {
|
|
135
|
+
const typed = event;
|
|
136
|
+
this.luzmoOptionInteractionCancel.emit(typed);
|
|
137
|
+
}));
|
|
115
138
|
}
|
|
116
139
|
static ɵfac = function LuzmoItemOption_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoItemOption)(); };
|
|
117
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoItemOption, selectors: [["luzmo-item-option"]], inputs: { language: "language", itemType: "itemType", optionKey: "optionKey", customOptionConfiguration: "customOptionConfiguration", customTranslations: "customTranslations", options: "options", slots: "slots", theme: "theme", apiUrl: "apiUrl", authKey: "authKey", authToken: "authToken", size: "size", changedOptions: "changedOptions" }, outputs: { luzmoOptionsChanged: "luzmoOptionsChanged" }, exportAs: ["luzmoItemOption"], features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoItemOption_Template(rf, ctx) { if (rf & 1) {
|
|
140
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoItemOption, selectors: [["luzmo-item-option"]], inputs: { language: "language", itemType: "itemType", optionKey: "optionKey", customOptionConfiguration: "customOptionConfiguration", customTranslations: "customTranslations", options: "options", slots: "slots", theme: "theme", apiUrl: "apiUrl", authKey: "authKey", authToken: "authToken", size: "size", liveInteractions: [2, "liveInteractions", "liveInteractions", booleanAttribute], changedOptions: "changedOptions" }, outputs: { luzmoOptionsChanged: "luzmoOptionsChanged", luzmoOptionInteractionStart: "luzmoOptionInteractionStart", luzmoOptionInteractionEnd: "luzmoOptionInteractionEnd", luzmoOptionInteractionCancel: "luzmoOptionInteractionCancel" }, exportAs: ["luzmoItemOption"], features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoItemOption_Template(rf, ctx) { if (rf & 1) {
|
|
118
141
|
i0.ɵɵprojectionDef();
|
|
119
142
|
i0.ɵɵprojection(0);
|
|
120
143
|
} }, encapsulation: 2 });
|
|
@@ -164,8 +187,11 @@ export class LuzmoItemOption {
|
|
|
164
187
|
}], size: [{
|
|
165
188
|
type: Input,
|
|
166
189
|
args: [{ alias: 'size' }]
|
|
190
|
+
}], liveInteractions: [{
|
|
191
|
+
type: Input,
|
|
192
|
+
args: [{ alias: 'liveInteractions', transform: booleanAttribute }]
|
|
167
193
|
}], changedOptions: [{
|
|
168
194
|
type: Input,
|
|
169
195
|
args: [{ alias: 'changedOptions' }]
|
|
170
|
-
}], luzmoOptionsChanged: [{ type: i0.Output, args: ["luzmoOptionsChanged"] }] }); })();
|
|
196
|
+
}], luzmoOptionsChanged: [{ type: i0.Output, args: ["luzmoOptionsChanged"] }], luzmoOptionInteractionStart: [{ type: i0.Output, args: ["luzmoOptionInteractionStart"] }], luzmoOptionInteractionEnd: [{ type: i0.Output, args: ["luzmoOptionInteractionEnd"] }], luzmoOptionInteractionCancel: [{ type: i0.Output, args: ["luzmoOptionInteractionCancel"] }] }); })();
|
|
171
197
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LuzmoItemOption, { className: "LuzmoItemOption", filePath: "components/item-option.ts", lineNumber: 18 }); })();
|
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.2.1"
|
|
33
33
|
},
|
|
34
|
-
"version": "1.
|
|
34
|
+
"version": "1.2.1",
|
|
35
35
|
"repository": {
|
|
36
36
|
"type": "git",
|
|
37
37
|
"url": "git+https://github.com/cumulio-internal/analytics-components-kit.git"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural equality for option values: arrays and plain objects compare by content (an absent key differs from an
|
|
3
|
+
* `undefined` one), everything else with `Object.is`. Strings are never normalized as colors here; use `isSameColorValue`.
|
|
4
|
+
*/
|
|
5
|
+
export declare const isSameOptionValue: (a: unknown, b: unknown) => boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Equality for a color value: two strings that parse as colors compare by their sRGB channels and alpha, so `#ff0000`,
|
|
8
|
+
* `#FF0000` and `rgb(255, 0, 0)` are the same color. Other values fall back to `isSameOptionValue`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const isSameColorValue: (a: unknown, b: unknown) => boolean;
|
|
@@ -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 {};
|
|
@@ -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
|
-
const e=require("./rolldown-runtime-DbbDpzbe.cjs"),t=require("./v4-Dyp-SQ1c.cjs");let n=require("yjs");n=e.r(n,1);var r;function i(){return t.t()}var a={mergeInterval:300,maxUndoSteps:100},o=class e{constructor(e={},t){if(this.stateSubscribers=new Set,this.changeSubscribers=new Set,this.localUpdatesSubscribers=new Set,this.isDestroyed=!1,this.id=t??i(),this.config={...a,...e},this.doc=new n.Doc,this.config.peerId){let e=(this.config.peerId,Number(this.config.peerId));this.doc.clientID=e}this.setupChangeSubscription()}setupUndoManager(t){this.undoManager&&this.undoManager.destroy(),this.undoManager=new n.UndoManager(t,{captureTimeout:this.config.mergeInterval,trackedOrigins:new Set([e.LOCAL_ORIGIN])})}setupChangeSubscription(){this.doc.on(`update`,(t,n)=>{for(let e of this.changeSubscribers)try{e({update:t,origin:n})}catch(e){console.error(`Error in change subscriber:`,e)}if(this.notifyStateSubscribers(),n===e.LOCAL_ORIGIN)for(let e of this.localUpdatesSubscribers)try{e(t)}catch(e){console.error(`Error in local updates subscriber:`,e)}})}notifyStateSubscribers(){if(this.isDestroyed)return;let e=this.getState();for(let t of this.stateSubscribers)try{t(e)}catch(e){console.error(`Error in state subscriber:`,e)}}undo(){return this.canUndo()?(this.undoManager.undo(),this.notifyStateSubscribers(),!0):!1}redo(){return this.canRedo()?(this.undoManager.redo(),this.notifyStateSubscribers(),!0):!1}canUndo(){return this.undoManager.undoStack.length>0}canRedo(){return this.undoManager.redoStack.length>0}clearHistory(){this.undoManager.clear()}subscribe(e,t){let{fireImmediately:n=!0}=t??{};return this.stateSubscribers.add(e),n&&queueMicrotask(()=>{if(!this.isDestroyed&&this.stateSubscribers.has(e))try{e(this.getState())}catch(e){console.error(`Error in initial state callback:`,e)}}),()=>{this.stateSubscribers.delete(e)}}subscribeToChanges(e){return this.changeSubscribers.add(e),()=>{this.changeSubscribers.delete(e)}}exportUpdates(e){return e?n.encodeStateAsUpdate(this.doc,e):n.encodeStateAsUpdate(this.doc)}importUpdates(e){n.applyUpdate(this.doc,e)}subscribeLocalUpdates(e){return this.localUpdatesSubscribers.add(e),()=>{this.localUpdatesSubscribers.delete(e)}}exportSnapshot(){return n.encodeStateAsUpdate(this.doc)}importSnapshot(e){n.applyUpdate(this.doc,e),this.notifyStateSubscribers()}getVersion(){return n.encodeStateVector(this.doc)}commit(e){}reset(e){if(this.doc.destroy(),this.doc=new n.Doc,this.config.peerId){let e=(this.config.peerId,Number(this.config.peerId));this.doc.clientID=e}this.setupChangeSubscription(),this.initializeContainers(e),this.undoManager.clear(),this.notifyStateSubscribers()}destroy(){this.isDestroyed=!0,this.stateSubscribers.clear(),this.changeSubscribers.clear(),this.localUpdatesSubscribers.clear(),this.undoManager&&this.undoManager.destroy(),this.doc.destroy()}getDoc(){return this.doc}getPeerId(){return this.doc.clientID.toString()}clone(e){return structuredClone(e)}transact(t){return this.doc.transact(t,e.LOCAL_ORIGIN)}};r=o,r.LOCAL_ORIGIN=`local`,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});
|
|
20
|
+
const e=require("./rolldown-runtime-DbbDpzbe.cjs"),t=require("./v4-Dyp-SQ1c.cjs");let n=require("yjs");n=e.r(n,1);var r;function i(){return t.t()}var a={mergeInterval:300,maxUndoSteps:100},o=class e{constructor(e={},t){if(this.stateSubscribers=new Set,this.changeSubscribers=new Set,this.localUpdatesSubscribers=new Set,this.isDestroyed=!1,this.id=t??i(),this.config={...a,...e},this.doc=new n.Doc,this.config.peerId){let e=(this.config.peerId,Number(this.config.peerId));this.doc.clientID=e}this.setupChangeSubscription()}setupUndoManager(t){this.undoManager&&this.undoManager.destroy(),this.undoManager=new n.UndoManager(t,{captureTimeout:this.config.mergeInterval,trackedOrigins:new Set([e.LOCAL_ORIGIN])})}setupChangeSubscription(){this.doc.on(`update`,(t,n)=>{for(let e of this.changeSubscribers)try{e({update:t,origin:n})}catch(e){console.error(`Error in change subscriber:`,e)}if(this.notifyStateSubscribers(),n===e.LOCAL_ORIGIN)for(let e of this.localUpdatesSubscribers)try{e(t)}catch(e){console.error(`Error in local updates subscriber:`,e)}})}notifyStateSubscribers(){if(this.isDestroyed)return;let e=this.getState();for(let t of this.stateSubscribers)try{t(e)}catch(e){console.error(`Error in state subscriber:`,e)}}undo(){return this.canUndo()?(this.undoManager.undo(),this.notifyStateSubscribers(),!0):!1}redo(){return this.canRedo()?(this.undoManager.redo(),this.notifyStateSubscribers(),!0):!1}canUndo(){return this.undoManager.undoStack.length>0}canRedo(){return this.undoManager.redoStack.length>0}clearHistory(){this.undoManager.clear()}subscribe(e,t){let{fireImmediately:n=!0}=t??{};return this.stateSubscribers.add(e),n&&queueMicrotask(()=>{if(!this.isDestroyed&&this.stateSubscribers.has(e))try{e(this.getState())}catch(e){console.error(`Error in initial state callback:`,e)}}),()=>{this.stateSubscribers.delete(e)}}subscribeToChanges(e){return this.changeSubscribers.add(e),()=>{this.changeSubscribers.delete(e)}}exportUpdates(e){return e?n.encodeStateAsUpdate(this.doc,e):n.encodeStateAsUpdate(this.doc)}importUpdates(e){n.applyUpdate(this.doc,e)}subscribeLocalUpdates(e){return this.localUpdatesSubscribers.add(e),()=>{this.localUpdatesSubscribers.delete(e)}}exportSnapshot(){return n.encodeStateAsUpdate(this.doc)}importSnapshot(e){n.applyUpdate(this.doc,e),this.notifyStateSubscribers()}getVersion(){return n.encodeStateVector(this.doc)}commit(e){}reset(e){if(this.doc.destroy(),this.doc=new n.Doc,this.config.peerId){let e=(this.config.peerId,Number(this.config.peerId));this.doc.clientID=e}this.setupChangeSubscription(),this.initializeContainers(e),this.undoManager.clear(),this.notifyStateSubscribers()}destroy(){this.isDestroyed=!0,this.stateSubscribers.clear(),this.changeSubscribers.clear(),this.localUpdatesSubscribers.clear(),this.undoManager&&this.undoManager.destroy(),this.doc.destroy()}getDoc(){return this.doc}getPeerId(){return this.doc.clientID.toString()}clone(e){return structuredClone(e)}transact(t){return this.doc.transact(t,e.LOCAL_ORIGIN)}transactHistoryStep(e){return this.undoManager.stopCapturing(),this.doc.once(`afterTransactionCleanup`,()=>this.undoManager.stopCapturing()),this.transact(e)}};r=o,r.LOCAL_ORIGIN=`local`,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});
|
|
@@ -145,6 +145,9 @@ var i = {
|
|
|
145
145
|
transact(t) {
|
|
146
146
|
return this.doc.transact(t, e.LOCAL_ORIGIN);
|
|
147
147
|
}
|
|
148
|
+
transactHistoryStep(e) {
|
|
149
|
+
return this.undoManager.stopCapturing(), this.doc.once("afterTransactionCleanup", () => this.undoManager.stopCapturing()), this.transact(e);
|
|
150
|
+
}
|
|
148
151
|
};
|
|
149
152
|
n = a, n.LOCAL_ORIGIN = "local";
|
|
150
153
|
export { a as t };
|
|
@@ -22,7 +22,7 @@ import { t } from "./info-tooltip-options.config-CyFz6pUU.js";
|
|
|
22
22
|
import { t as n } from "./interactivity-options.config-MuEP5vSt.js";
|
|
23
23
|
import { n as r, t as i } from "./color-palettes-B194TZ0a.js";
|
|
24
24
|
import { t as a } from "./map-tile-providers-cK8Xlerl.js";
|
|
25
|
-
import { n as o, r as s, t as c } from "./color-range-utils-
|
|
25
|
+
import { n as o, r as s, t as c } from "./color-range-utils-CgwRGUkg.js";
|
|
26
26
|
// node_modules/@luzmo/dashboard-contents-types/choropleth-map/choropleth-map-options.config.js
|
|
27
27
|
var l = /* @__PURE__ */ e({ default: () => d }), u = (e, t) => {
|
|
28
28
|
let n = `colors${t}`;
|
|
@@ -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
|
-
const e=require("./rolldown-runtime-DbbDpzbe.cjs"),t=require("./info-tooltip-options.config-B9T0cwSM.cjs"),n=require("./interactivity-options.config-Bzk2L-qh.cjs"),r=require("./color-palettes-BFpQSXfW.cjs"),i=require("./map-tile-providers-DzSBmFkY.cjs"),a=require("./color-range-utils-
|
|
20
|
+
const e=require("./rolldown-runtime-DbbDpzbe.cjs"),t=require("./info-tooltip-options.config-B9T0cwSM.cjs"),n=require("./interactivity-options.config-Bzk2L-qh.cjs"),r=require("./color-palettes-BFpQSXfW.cjs"),i=require("./map-tile-providers-DzSBmFkY.cjs"),a=require("./color-range-utils-D8uygiMe.cjs");var o=e.n({default:()=>c}),s=(e,t)=>{let n=`colors${t}`;return r.t()[e]?.[n]},c=[{key:`general`,type:`group`,open:!0,children:[{key:`display.title`,control:{type:`switch`,label:`Title`,default:!0}},{key:`display.legend`,control:{type:`switch`,label:`Legend`,default:!0}}]},{key:`map`,type:`group`,open:!0,children:[{key:`enabled.zoom`,control:{type:`switch`,label:`Zoom`,default:!0}},{key:`enabled.pan`,control:{type:`switch`,label:`Pan`,default:!0}},{key:`enabled.pitchBearing`,control:{type:`switch`,label:`Pitch & Rotate`,tooltip:`Use ctrl + drag`,default:!1}},{type:`divider`},{key:`vectorTileProvider`,control:{type:`picker`,label:`Map style`,default:`Basic`,enum:[`No Tiles`,`Basic`,`Bright`,`Dark`,`Fiord`,`Liberty`,`Pastel`,`Positron`,`Streets`,`Toner`,`Topographique`,`Voyager`,`3D buildings`],parseValue:e=>e?.name||`Basic`,toValue:e=>i.t[e]??{}}}]},{key:`colors`,type:`group`,open:!0,children:[{key:`opacity`,control:{type:`slider`,label:`Opacity`,default:.85,min:.2,max:1,step:.01}},{key:`colorsClassType`,control:{type:`picker`,label:`Colors type`,default:`sequential`,enum:[`sequential`,`divergent`,`manual`],calculateValue:({options:e})=>e?.colorsClass===`manual`?`manual`:r.t()?.[e?.colorsClass]?.type??`sequential`,toOptions:({options:e,value:t})=>{let n=e?.colorsClass??`PuBu`,i=e?.numberClasses??5,o=a.n(e?.manualValues?.ranges),s=n===`manual`?`manual`:n,c;t===`manual`?c=`manual`:t!==r.t()?.[e?.colorsClass]?.type&&(c=r.n(t??`sequential`)[0]);let l={...e,colorsClass:c};if(t===`manual`||e?.classification===`manual`){let e=a.t(i,t===`manual`?s:c,o);l.manualValues={...l.manualValues,ranges:a.r(e)}}else delete l?.manualValues?.ranges;return l}}},{key:`colorsClass`,control:{type:`color-palette-picker`,label:`Color palette`,hideLabel:!0,default:({options:e})=>{let t=r.t()?.[e?.colorsClass]?.type;return r.n(t??`sequential`)[0]},enum:({options:e})=>{let t=r.t()?.[e?.colorsClass]?.type;return r.n(t??`sequential`)},toOptions:({options:e,value:t})=>{let n={...e,colorsClass:t};if(e?.classification===`manual`){let r=s(t,e?.numberClasses??5);n.manualValues={...n.manualValues,ranges:e?.manualValues?.ranges?.map(e=>({...e,color:typeof e.val==`number`?r?.[e.val]:void 0}))}}return n}},visibleIf:({options:e})=>e?.colorsClass!==`manual`},{key:`manualValues.ranges`,control:{type:`color-range`,editRangeSize:!1,debounce:500,noValues:!0,noAlphaChannel:!0,label:`Manual range colors`,hideLabel:!0},calculateValue:({options:e})=>a.t(e?.numberClasses,e?.colorsClass,a.n(e?.manualValues?.ranges)),toOptions:({options:e,value:t})=>({...e,manualValues:{...e.manualValues,ranges:a.r(t)}}),visibleIf:({options:e})=>e?.colorsClass===`manual`}]},{key:`classification`,type:`group`,open:!0,children:[{key:`numberClasses`,control:{type:`picker`,label:`Number of classes`,default:`5`,enum:[`3`,`4`,`5`,`6`,`7`,`8`,`9`],parseValue:e=>e?.toString()??`5`,toOptions:({options:e,value:t})=>{let n=Number.parseInt(t,10)||5,r={...e,numberClasses:n};if(e?.classification===`manual`||e?.colorsClass===`manual`){let n=a.t(t,e?.colorsClass,a.n(e?.manualValues?.ranges));r.manualValues={...r.manualValues,ranges:a.r(n)}}return r}}},{key:`classification`,control:{type:`picker`,label:`Method`,default:`interval`,enum:[`interval`,`manual`,`quantile`,`continuous`],toOptions:({options:e,value:t})=>{let n={...e,classification:t};if(t===`manual`||e?.colorsClass===`manual`){let t=a.t(e?.numberClasses,e?.colorsClass,a.n(e?.manualValues?.ranges));n.manualValues={...n.manualValues,ranges:a.r(t)}}else delete n?.manualValues?.ranges;return n}}},{key:`manualValues.rangesValues`,control:{type:`color-range`,editRangeSize:!1,debounce:500,noValues:!1,readOnlyColorPicker:!0,label:`Manual range values`,hideLabel:!0,calculateValue:({options:e})=>a.t(e?.numberClasses,e?.colorsClass,a.n(e?.manualValues?.ranges)),toOptions:({options:e,value:t})=>({...e,manualValues:{...e.manualValues,ranges:a.r(t)}})},visibleIf:({options:e})=>e?.classification===`manual`}]},{key:`legend`,type:`group`,open:!1,children:[{key:`legend.type`,control:{type:`picker`,label:`Type`,default:`bar`,enum:[`bar`,`list`]}},{key:`legend.size`,control:{type:`radio-button-group`,label:`Size`,default:`M`,enum:[`S`,`M`,`L`]}},{key:`legend.position`,control:{type:`position-picker`,label:`Position`,default:`bottomLeft`,enum:[`topLeft`,`top`,`topRight`,`right`,`bottomRight`,`bottom`,`bottomLeft`,`left`]}}],visibleIf:({options:e})=>e?.display?.legend===!0},t.t(),n.t({select:{default:!0}})];Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
18
|
* SOFTWARE.
|
|
19
19
|
* */
|
|
20
|
-
import { t as e } from "./color-
|
|
21
|
-
import { t } from "./color-
|
|
20
|
+
import { t as e } from "./color-CQcCK-_O.js";
|
|
21
|
+
import { t } from "./color-palettes-B194TZ0a.js";
|
|
22
22
|
// node_modules/@luzmo/dashboard-contents-types/shared/utils/color/extrapolate-color.js
|
|
23
|
-
var n = (
|
|
24
|
-
if (
|
|
25
|
-
let r =
|
|
26
|
-
return new
|
|
23
|
+
var n = (t, n = .1) => {
|
|
24
|
+
if (t.length < 2) return "#AAAAAA";
|
|
25
|
+
let r = t.length, i = new e(t[r - 2]).to("oklab"), a = new e(t[r - 1]).to("oklab"), o = i.coords[0], s = a.coords[0], c = Math.min(1, Math.max(0, s + (s > o ? 1 : -1) * n));
|
|
26
|
+
return new e("oklab", [
|
|
27
27
|
c,
|
|
28
28
|
a.coords[1],
|
|
29
29
|
a.coords[2]
|
|
@@ -37,25 +37,25 @@ var n = (e, n = .1) => {
|
|
|
37
37
|
})) ?? [], i = (e) => e?.map((e) => ({
|
|
38
38
|
color: e.color,
|
|
39
39
|
val: e.value
|
|
40
|
-
})) ?? [], a = (
|
|
41
|
-
|
|
40
|
+
})) ?? [], a = (e, r, i) => {
|
|
41
|
+
e = typeof e == "string" ? Number.parseInt(e, 10) : e, e = typeof e == "number" ? Math.max(Math.min(e, 9), 3) : 5;
|
|
42
42
|
let a = Array.isArray(i) ? i : [], o = Math.min(...a.map((e) => e?.value ?? Infinity)), s = Math.max(...a.map((e) => e?.value ?? -Infinity)), c = !1, l = typeof o == "number" && typeof s == "number" && o !== Infinity && s !== -Infinity ? s - o : 0;
|
|
43
|
-
if (a.length >
|
|
44
|
-
else if (a.length <
|
|
45
|
-
let u = [], d =
|
|
46
|
-
if (Object.keys(d).includes(r ?? "")) u = d[r]?.[`colors${
|
|
43
|
+
if (a.length > e) c = o !== Infinity && s !== -Infinity, a = a.slice(0, e);
|
|
44
|
+
else if (a.length < e) for (; a.length < e;) a.push({});
|
|
45
|
+
let u = [], d = t();
|
|
46
|
+
if (Object.keys(d).includes(r ?? "")) u = d[r]?.[`colors${e}`] ?? [];
|
|
47
47
|
else if (r === "manual") {
|
|
48
|
-
if (u = a.map((e) => e.color).filter((e) => e !== void 0), u.length <
|
|
49
|
-
} else u = d.PuBu?.[`colors${
|
|
48
|
+
if (u = a.map((e) => e.color).filter((e) => e !== void 0), u.length < e) for (; u.length < e;) u.push(n(u));
|
|
49
|
+
} else u = d.PuBu?.[`colors${e}`] ?? [];
|
|
50
50
|
if (u?.forEach((e, t) => {
|
|
51
51
|
a[t].color = e;
|
|
52
52
|
}), a.filter((e) => e.value === void 0)?.length > 0) {
|
|
53
|
-
let
|
|
54
|
-
for (let r = 0; r <
|
|
53
|
+
let t = o === Infinity ? 0 : o, n = l / (e - 1) || 100;
|
|
54
|
+
for (let r = 0; r < e; r++) a[r].value = Number((t + r * n).toFixed(10));
|
|
55
55
|
}
|
|
56
56
|
if (c) {
|
|
57
|
-
let
|
|
58
|
-
for (let r = 0; r <
|
|
57
|
+
let t = o === Infinity ? 0 : o, n = l / (e - 1) || 100;
|
|
58
|
+
for (let r = 0; r < e; r++) a[r].value = Number((t + r * n).toFixed(10));
|
|
59
59
|
}
|
|
60
60
|
return a;
|
|
61
61
|
};
|
|
@@ -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
|
-
const e=require("./color-
|
|
20
|
+
const e=require("./color-DKdzPrQX.cjs"),t=require("./color-palettes-BFpQSXfW.cjs");var n=(t,n=.1)=>{if(t.length<2)return`#AAAAAA`;let r=t.length,i=new e.t(t[r-2]).to(`oklab`),a=new e.t(t[r-1]).to(`oklab`),o=i.coords[0],s=a.coords[0],c=Math.min(1,Math.max(0,s+(s>o?1:-1)*n));return new e.t(`oklab`,[c,a.coords[1],a.coords[2]],a.alpha).to(`srgb`).toString({format:`hex`,precision:0})},r=e=>e?.map(e=>({color:e.color,value:e.val}))??[],i=e=>e?.map(e=>({color:e.color,val:e.value}))??[],a=(e,r,i)=>{e=typeof e==`string`?Number.parseInt(e,10):e,e=typeof e==`number`?Math.max(Math.min(e,9),3):5;let a=Array.isArray(i)?i:[],o=Math.min(...a.map(e=>e?.value??1/0)),s=Math.max(...a.map(e=>e?.value??-1/0)),c=!1,l=typeof o==`number`&&typeof s==`number`&&o!==1/0&&s!==-1/0?s-o:0;if(a.length>e)c=o!==1/0&&s!==-1/0,a=a.slice(0,e);else if(a.length<e)for(;a.length<e;)a.push({});let u=[],d=t.t();if(Object.keys(d).includes(r??``))u=d[r]?.[`colors${e}`]??[];else if(r===`manual`){if(u=a.map(e=>e.color).filter(e=>e!==void 0),u.length<e)for(;u.length<e;)u.push(n(u))}else u=d.PuBu?.[`colors${e}`]??[];if(u?.forEach((e,t)=>{a[t].color=e}),a.filter(e=>e.value===void 0)?.length>0){let t=o===1/0?0:o,n=l/(e-1)||100;for(let r=0;r<e;r++)a[r].value=Number((t+r*n).toFixed(10))}if(c){let t=o===1/0?0:o,n=l/(e-1)||100;for(let r=0;r<e;r++)a[r].value=Number((t+r*n).toFixed(10))}return a};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
|
package/components/{heat-map-options.config-ChZeslEy.js → heat-map-options.config-BQkhkLPb.js}
RENAMED
|
@@ -18,25 +18,25 @@
|
|
|
18
18
|
* SOFTWARE.
|
|
19
19
|
* */
|
|
20
20
|
import { s as e } from "./pragmatic-element-adapter-CyTyN1YC.js";
|
|
21
|
-
import { t } from "./
|
|
22
|
-
import {
|
|
23
|
-
import { t as i } from "./
|
|
24
|
-
import { t as a } from "./
|
|
21
|
+
import { t } from "./color-CQcCK-_O.js";
|
|
22
|
+
import { t as n } from "./info-tooltip-options.config-CyFz6pUU.js";
|
|
23
|
+
import { n as r, t as i } from "./color-palettes-B194TZ0a.js";
|
|
24
|
+
import { t as a } from "./map-tile-providers-cK8Xlerl.js";
|
|
25
25
|
// node_modules/@luzmo/dashboard-contents-types/heat-map/heat-map-options.config.js
|
|
26
|
-
var o = /* @__PURE__ */ e({ default: () => u }), s = () => structuredClone(
|
|
26
|
+
var o = /* @__PURE__ */ e({ default: () => u }), s = () => structuredClone(i().Spectrum.colors5), c = (e) => {
|
|
27
27
|
if (!e || e.length === 0) return [];
|
|
28
|
-
let
|
|
29
|
-
return e.map((e) => new
|
|
28
|
+
let n = /^rgb(a)?\s*\(/i.test(e.at(-1)?.trim() ?? "");
|
|
29
|
+
return e.map((e) => new t(e).toString({ format: n ? "hex" : "rgb" }));
|
|
30
30
|
}, l = (e) => {
|
|
31
31
|
let t = e?.length || 0;
|
|
32
32
|
return t === 0 ? {
|
|
33
33
|
type: "heat",
|
|
34
34
|
colorClass: "Spectrum",
|
|
35
35
|
colors: s() ?? []
|
|
36
|
-
} :
|
|
37
|
-
type:
|
|
36
|
+
} : r().map((e) => ({
|
|
37
|
+
type: i()[e]?.type,
|
|
38
38
|
colorClass: e,
|
|
39
|
-
colors:
|
|
39
|
+
colors: i()[e]?.[`colors${t}`] ?? []
|
|
40
40
|
})).find((t) => Array.isArray(t.colors) && Array.isArray(e) && t.colors.length === e.length && t.colors.every((t, n) => t === e[n])) ?? {
|
|
41
41
|
type: "manual",
|
|
42
42
|
colorClass: "manual",
|
|
@@ -102,7 +102,7 @@ var o = /* @__PURE__ */ e({ default: () => u }), s = () => structuredClone(r().S
|
|
|
102
102
|
"No Tiles"
|
|
103
103
|
],
|
|
104
104
|
parseValue: (e) => e?.name || "Basic",
|
|
105
|
-
toValue: (e) =>
|
|
105
|
+
toValue: (e) => a[e] ?? {}
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
]
|
|
@@ -175,8 +175,8 @@ var o = /* @__PURE__ */ e({ default: () => u }), s = () => structuredClone(r().S
|
|
|
175
175
|
],
|
|
176
176
|
calculateValue: ({ options: e }) => l(e?.colors ?? []).type,
|
|
177
177
|
toOptions: ({ options: e, value: t }) => {
|
|
178
|
-
let
|
|
179
|
-
return
|
|
178
|
+
let n = l(e?.colors ?? []), a = { ...e };
|
|
179
|
+
return n.type !== t && (a.colors = t === "manual" ? c(n.colors ?? s()) : i()[r(t)?.[0]]?.colors5 ?? s()), a;
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
},
|
|
@@ -189,7 +189,7 @@ var o = /* @__PURE__ */ e({ default: () => u }), s = () => structuredClone(r().S
|
|
|
189
189
|
default: "Spectrum",
|
|
190
190
|
enum: ({ options: e }) => {
|
|
191
191
|
let t = l(e?.colors ?? []).type;
|
|
192
|
-
return
|
|
192
|
+
return r(["heat", "sequential"].includes(t) ? t : "heat");
|
|
193
193
|
},
|
|
194
194
|
calculateValue: ({ options: e }) => {
|
|
195
195
|
let t = l(e?.colors ?? []);
|
|
@@ -197,7 +197,7 @@ var o = /* @__PURE__ */ e({ default: () => u }), s = () => structuredClone(r().S
|
|
|
197
197
|
},
|
|
198
198
|
toOptions: ({ options: e, value: t }) => ({
|
|
199
199
|
...e,
|
|
200
|
-
colors:
|
|
200
|
+
colors: i()[t]?.colors5 ?? s()
|
|
201
201
|
})
|
|
202
202
|
},
|
|
203
203
|
visibleIf: ({ options: e }) => l(e?.colors ?? []).type !== "manual"
|
|
@@ -220,6 +220,6 @@ var o = /* @__PURE__ */ e({ default: () => u }), s = () => structuredClone(r().S
|
|
|
220
220
|
}
|
|
221
221
|
]
|
|
222
222
|
},
|
|
223
|
-
|
|
223
|
+
n()
|
|
224
224
|
];
|
|
225
225
|
export { o as n, u as t };
|
package/components/{heat-map-options.config-DiNa8NnG.cjs → heat-map-options.config-DjQkB039.cjs}
RENAMED
|
@@ -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
|
-
const e=require("./rolldown-runtime-DbbDpzbe.cjs"),t=require("./info-tooltip-options.config-B9T0cwSM.cjs"),
|
|
20
|
+
const e=require("./rolldown-runtime-DbbDpzbe.cjs"),t=require("./color-DKdzPrQX.cjs"),n=require("./info-tooltip-options.config-B9T0cwSM.cjs"),r=require("./color-palettes-BFpQSXfW.cjs"),i=require("./map-tile-providers-DzSBmFkY.cjs");var a=e.n({default:()=>l}),o=()=>structuredClone(r.t().Spectrum.colors5),s=e=>{if(!e||e.length===0)return[];let n=/^rgb(a)?\s*\(/i.test(e.at(-1)?.trim()??``);return e.map(e=>new t.t(e).toString({format:n?`hex`:`rgb`}))},c=e=>{let t=e?.length||0;return t===0?{type:`heat`,colorClass:`Spectrum`,colors:o()??[]}:r.n().map(e=>({type:r.t()[e]?.type,colorClass:e,colors:r.t()[e]?.[`colors${t}`]??[]})).find(t=>Array.isArray(t.colors)&&Array.isArray(e)&&t.colors.length===e.length&&t.colors.every((t,n)=>t===e[n]))??{type:`manual`,colorClass:`manual`,colors:e}},l=[{key:`general`,type:`group`,open:!0,children:[{key:`display.title`,control:{type:`switch`,label:`Title`,default:!0}},{key:`enabled.zoom`,control:{type:`switch`,label:`Zoom`,default:!0}},{key:`enabled.pan`,control:{type:`switch`,label:`Pan`,default:!0}},{key:`enabled.pitchBearing`,control:{type:`switch`,label:`Pitch & Rotate`,default:!1}},{type:`divider`},{key:`vectorTileProvider`,control:{type:`picker`,label:`Map style`,default:`Basic`,enum:[`Basic`,`Bright`,`Dark`,`Fiord`,`Liberty`,`Pastel`,`Positron`,`Streets`,`Toner`,`Topographique`,`Voyager`,`No Tiles`],parseValue:e=>e?.name||`Basic`,toValue:e=>i.t[e]??{}}}]},{key:`heat`,type:`group`,open:!0,children:[{key:`enabled.adaptOnZoom`,control:{type:`switch`,label:`Adapt on zoom`,tooltip:`If turned off, density is calculated based on map surface`,default:!0}},{key:`screenRadius`,control:{type:`slider`,label:`Radius`,default:20,min:1,max:50,step:1}},{key:`intensity`,control:{type:`slider`,label:`Intensity`,tooltip:`Multiplier for the density, multiplies by 1 on minimum (default)`,default:1,min:1,max:100,step:1}}]},{key:`heatColors`,type:`group`,open:!0,children:[{key:`transparency`,control:{type:`slider`,label:`Opacity`,default:.8,min:0,max:1,step:.01}},{key:`colorsClassType`,control:{type:`picker`,label:`Colors type`,default:`sequential`,enum:[`heat`,`sequential`,`manual`],calculateValue:({options:e})=>c(e?.colors??[]).type,toOptions:({options:e,value:t})=>{let n=c(e?.colors??[]),i={...e};return n.type!==t&&(i.colors=t===`manual`?s(n.colors??o()):r.t()[r.n(t)?.[0]]?.colors5??o()),i}}},{key:`colorsClass`,control:{type:`color-palette-picker`,label:`Color palette`,hideLabel:!0,default:`Spectrum`,enum:({options:e})=>{let t=c(e?.colors??[]).type;return r.n([`heat`,`sequential`].includes(t)?t:`heat`)},calculateValue:({options:e})=>{let t=c(e?.colors??[]);return t?.colorClass&&t.colorClass!==`manual`?t.colorClass:`Spectrum`},toOptions:({options:e,value:t})=>({...e,colors:r.t()[t]?.colors5??o()})},visibleIf:({options:e})=>c(e?.colors??[]).type!==`manual`},{key:`colors`,control:{type:`color-range`,editRangeSize:!1,noValues:!0,minimumRangeSize:4,noAlphaChannel:!0,hideLabel:!0,label:`Manual color ranges`,default:o(),parseValue:e=>e?.map(e=>({color:e})),toValue:e=>e?.map(e=>e?.color)??[]},visibleIf:({options:e})=>c(e?.colors??[]).type===`manual`}]},n.t()];Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
|
package/components/{heat-table-options.config-BPCszrFn.js → heat-table-options.config-CMWWTeyo.js}
RENAMED
|
@@ -23,7 +23,7 @@ import { t as n } from "./info-tooltip-options.config-CyFz6pUU.js";
|
|
|
23
23
|
import { t as r } from "./interactivity-options.config-MuEP5vSt.js";
|
|
24
24
|
import { t as i } from "./slot-content-DE6NXHcl.js";
|
|
25
25
|
import { n as a, t as o } from "./color-palettes-B194TZ0a.js";
|
|
26
|
-
import { n as s, r as c, t as l } from "./color-range-utils-
|
|
26
|
+
import { n as s, r as c, t as l } from "./color-range-utils-CgwRGUkg.js";
|
|
27
27
|
// node_modules/@luzmo/dashboard-contents-types/heat-table/heat-table-options.config.js
|
|
28
28
|
var u = /* @__PURE__ */ e({ default: () => f }), d = (e, { slots: t }) => {
|
|
29
29
|
let n = t?.find((t) => t?.name === e)?.content?.[0]?.type;
|
package/components/{heat-table-options.config-BvE6coaV.cjs → heat-table-options.config-D21xtaIk.cjs}
RENAMED
|
@@ -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
|
-
const e=require("./rolldown-runtime-DbbDpzbe.cjs"),t=require("./axis-options.config-Dg9pczlQ.cjs"),n=require("./info-tooltip-options.config-B9T0cwSM.cjs"),r=require("./interactivity-options.config-Bzk2L-qh.cjs"),i=require("./slot-content-DYiwtIBX.cjs"),a=require("./color-palettes-BFpQSXfW.cjs"),o=require("./color-range-utils-
|
|
20
|
+
const e=require("./rolldown-runtime-DbbDpzbe.cjs"),t=require("./axis-options.config-Dg9pczlQ.cjs"),n=require("./info-tooltip-options.config-B9T0cwSM.cjs"),r=require("./interactivity-options.config-Bzk2L-qh.cjs"),i=require("./slot-content-DYiwtIBX.cjs"),a=require("./color-palettes-BFpQSXfW.cjs"),o=require("./color-range-utils-D8uygiMe.cjs");var s=e.n({default:()=>l}),c=(e,{slots:t})=>{let n=t?.find(t=>t?.name===e)?.content?.[0]?.type;return i.t(n)?[`auto`,`asc`,`desc`]:[`asc`,`desc`]},l=[{key:`general`,type:`group`,open:!0,children:[{key:`display.title`,control:{type:`switch`,label:`Title`,default:!0}},{key:`display.values`,control:{type:`switch`,label:`Show values`,default:!1}}]},{key:`heatTable`,type:`group`,label:`Heat table`,open:!0,children:[{key:`heattable.opacity`,control:{type:`slider`,label:`Opacity`,default:.8,min:0,max:1,step:.01}},{key:`heattable.rounding`,control:{type:`slider`,label:`Rounding`,default:({theme:e})=>e?.itemSpecific?.rounding,min:0,max:20,step:1,extraLabel:({options:e,theme:t})=>typeof t?.itemSpecific?.rounding==`number`?typeof e?.heattable?.rounding==`number`?`reset`:`auto`:null,extraLabelHasClickAction:({options:e,theme:t})=>typeof t?.itemSpecific?.rounding==`number`&&typeof e?.heattable?.rounding==`number`,extraLabelClickAction:({options:e})=>{let t={...e,heattable:{...e.heattable,rounding:void 0}};return delete t.heattable.rounding,{value:null,options:t}}}},{key:`heattable.spacing`,control:{type:`slider`,label:`Spacing`,default:({theme:e})=>e?.itemSpecific?.padding,min:0,max:20,step:1,extraLabel:({options:e,theme:t})=>typeof t?.itemSpecific?.padding==`number`?typeof e?.heattable?.spacing==`number`?`reset`:`auto`:null,extraLabelHasClickAction:({options:e,theme:t})=>typeof t?.itemSpecific?.padding==`number`&&typeof e?.heattable?.spacing==`number`,extraLabelClickAction:({options:e})=>{let t={...e,heattable:{...e.heattable,spacing:void 0}};return delete t.heattable.spacing,{value:null,options:t}}}},{key:`colorsType`,control:{type:`picker`,label:`Colors type`,default:`sequential`,enum:[`sequential`,`divergent`,`manual`],toOptions:({options:e,value:t})=>{let n=a.t()?.[e?.colorsClass]?.type,r=e?.colorsType??n??`sequential`,i=e?.colorsClass??`PuBu`,s=e?.numberClasses??7,c=o.n(e?.manualValues?.ranges),l=r===`manual`?`manual`:i,u={...e,colorsType:t};if(t===`manual`){let e=o.t(s,l,c);u.manualValues={...u.manualValues,ranges:o.r(e)}}else t!==r&&(u.colorsClass=a.n(t??`sequential`)[0]),delete u.manualValues;return u}}},{key:`classification`,control:{type:`picker`,label:`Method`,default:`quantile`,enum:[`interval`,`quantile`,`continuous`]},visibleIf:({options:e})=>e?.colorsType!==`manual`},{key:`numberClasses`,control:{type:`picker`,label:`Number of classes`,default:`7`,enum:[`3`,`4`,`5`,`6`,`7`,`8`,`9`],parseValue:e=>e?.toString()??`7`,toOptions:({options:e,value:t})=>{let n=Number.parseInt(t,10)||7,r={...e,numberClasses:n};if(e?.colorsType===`manual`){let n=o.t(t,`manual`,o.n(e?.manualValues?.ranges));r.manualValues={...r.manualValues,ranges:o.r(n)}}return r}}},{key:`colorsClass`,control:{type:`color-palette-picker`,label:`Color palette`,hideLabel:!0,default:({options:e})=>{let t=a.t()?.[e?.colorsClass]?.type;return a.n(e?.colorsType??t??`sequential`)[0]},enum:({options:e})=>{let t=a.t()?.[e?.colorsClass]?.type;return a.n(e?.colorsType??t??`sequential`)},toOptions:({options:e,value:t})=>{let n=a.t()?.[e?.colorsClass]?.type,r={...e,colorsClass:t,colorsType:n??`sequential`};return delete r.manualValues,r}},visibleIf:({options:e})=>e?.colorsType!==`manual`},{key:`manualValues.ranges`,control:{type:`color-range`,editRangeSize:!1,debounce:500,label:`Manual range values`,hideLabel:!0,calculateValue:({options:e})=>o.t(e?.numberClasses??7,`manual`,o.n(e?.manualValues?.ranges)),toOptions:({options:e,value:t})=>({...e,manualValues:{...e.manualValues,ranges:o.r(t)}})},visibleIf:({options:e})=>e?.colorsType===`manual`}]},t.n([{axis:`x`,role:`axis`,color:!0,label:!0,tickMode:!0},{axis:`y`,role:`axis`,color:!0,label:!0,tickMode:!0}],[{key:`sort.x.order`,control:{type:`picker`,label:`X-axis order`,default:`asc`,enum:e=>c(`x-axis`,e)}},{key:`sort.y.order`,control:{type:`picker`,label:`Y-axis order`,default:`asc`,enum:e=>c(`y-axis`,e)}}]),n.t(),r.t({select:{default:!0}})];Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
|