@luzmo/embed 9.1.0 → 10.0.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/CHANGELOG.md +20 -0
- package/MIGRATIONS.md +7 -0
- package/README.md +53 -4
- package/index.cjs +35 -9
- package/index.dashboard-next.cjs +6291 -0
- package/index.dashboard-next.js +6259 -0
- package/index.js +34 -9
- package/index.rn.cjs +19 -2
- package/index.rn.js +18 -2
- package/index.shared.cjs +19 -2
- package/index.shared.js +18 -2
- package/luzmo-dashboard-next.min.js +157860 -0
- package/luzmo-embed.min.js +160 -135
- package/package.json +15 -2
- package/src/index.common.d.ts +1 -0
- package/src/index.d.ts +3 -0
- package/src/index.dashboard-next.d.ts +1 -0
- package/src/index.internal.d.ts +3 -0
- package/src/lib/dashboard/dashboard-base.d.ts +1 -1
- package/src/lib/dashboard-next/dashboard-next-component.d.ts +76 -0
- package/src/lib/dashboard-next/data/dashboard-api.d.ts +9 -0
- package/src/lib/dashboard-next/data/dashboard-errors.d.ts +5 -0
- package/src/lib/dashboard-next/data/dashboard-loading-controller.d.ts +21 -0
- package/src/lib/dashboard-next/data/dashboard-metadata-controller.d.ts +25 -0
- package/src/lib/dashboard-next/data/dashboard-permissions-api.d.ts +4 -0
- package/src/lib/dashboard-next/data/dashboard-publishing-api.d.ts +5 -0
- package/src/lib/dashboard-next/data/dashboard-renderer-controller.d.ts +25 -0
- package/src/lib/dashboard-next/data/dashboard-variant-management-controller.d.ts +30 -0
- package/src/lib/dashboard-next/data/dashboard-variant-rename-controller.d.ts +18 -0
- package/src/lib/dashboard-next/data/dashboard-variants-api.d.ts +30 -0
- package/src/lib/dashboard-next/data/dashboard-variants-controller.d.ts +47 -0
- package/src/lib/dashboard-next/data/load-dashboard-definition.d.ts +20 -0
- package/src/lib/dashboard-next/data/load-dashboard-layout.d.ts +4 -0
- package/src/lib/dashboard-next/grid/dashboard-grid-layout-controller.d.ts +23 -0
- package/src/lib/dashboard-next/grid/dashboard-layout-skeleton.d.ts +3 -0
- package/src/lib/dashboard-next/grid/dashboard-next-grid.d.ts +56 -0
- package/src/lib/dashboard-next/grid/dashboard-next-viz-item.d.ts +26 -0
- package/src/lib/dashboard-next/grid/dashboard-skeleton-motion-controller.d.ts +15 -0
- package/src/lib/dashboard-next/grid/render-dashboard-chart.d.ts +21 -0
- package/src/lib/dashboard-next/localization/dashboard-next-translations.d.ts +89 -0
- package/src/lib/dashboard-next/localization/resolve-dashboard-next-translations.d.ts +6 -0
- package/src/lib/dashboard-next/settings/appearance/dashboard-appearance-config.d.ts +63 -0
- package/src/lib/dashboard-next/settings/appearance/dashboard-appearance-settings-controller.d.ts +34 -0
- package/src/lib/dashboard-next/settings/appearance/dashboard-appearance-settings.d.ts +12 -0
- package/src/lib/dashboard-next/settings/appearance/dashboard-chart-type-conversion.d.ts +6 -0
- package/src/lib/dashboard-next/settings/dashboard-chart-settings-context.d.ts +31 -0
- package/src/lib/dashboard-next/settings/dashboard-editor-controller.d.ts +32 -0
- package/src/lib/dashboard-next/settings/dashboard-settings-content.d.ts +6 -0
- package/src/lib/dashboard-next/settings/dashboard-settings-controller.d.ts +43 -0
- package/src/lib/dashboard-next/settings/dashboard-settings-popover.d.ts +13 -0
- package/src/lib/dashboard-next/settings/dashboard-settings-positioning.d.ts +1 -0
- package/src/lib/dashboard-next/settings/dashboard-settings.test-utils.d.ts +19 -0
- package/src/lib/dashboard-next/settings/data/dashboard-data-metadata.d.ts +11 -0
- package/src/lib/dashboard-next/settings/data/dashboard-data-settings-controller.d.ts +41 -0
- package/src/lib/dashboard-next/settings/data/dashboard-data-settings.d.ts +15 -0
- package/src/lib/dashboard-next/settings/data/dashboard-data-slots.d.ts +3 -0
- package/src/lib/dashboard-next/settings/filters/dashboard-filter-settings-controller.d.ts +19 -0
- package/src/lib/dashboard-next/settings/filters/dashboard-filter-settings.d.ts +9 -0
- package/src/lib/dashboard-next/state/config/dashboard-config-store.d.ts +28 -0
- package/src/lib/dashboard-next/state/content/dashboard-content-controller.d.ts +47 -0
- package/src/lib/dashboard-next/state/content/dashboard-content-selectors.d.ts +6 -0
- package/src/lib/dashboard-next/state/content/dashboard-content-state.d.ts +46 -0
- package/src/lib/dashboard-next/state/content/dashboard-content-store.d.ts +18 -0
- package/src/lib/dashboard-next/state/content/dashboard-option-changes.d.ts +9 -0
- package/src/lib/dashboard-next/state/dashboard-stores.d.ts +12 -0
- package/src/lib/dashboard-next/state/runtime/dashboard-editor-state.d.ts +34 -0
- package/src/lib/dashboard-next/state/runtime/dashboard-runtime-state.d.ts +47 -0
- package/src/lib/dashboard-next/state/runtime/dashboard-runtime-store.d.ts +22 -0
- package/src/lib/dashboard-next/state/runtime/dashboard-variants-state.d.ts +42 -0
- package/src/lib/dashboard-next/toolbar/dashboard-next-toolbar.d.ts +36 -0
- package/src/lib/dashboard-next/toolbar/dashboard-picker.d.ts +36 -0
- package/src/lib/dashboard-next/toolbar/dashboard-toolbar-theme.d.ts +13 -0
- package/src/lib/dashboard-next/toolbar/dashboard-variant-delete.d.ts +15 -0
- package/src/lib/dashboard-next/views/dashboard-view-controller.d.ts +13 -0
- package/src/lib/dashboard-next/views/dashboard-view-layout.d.ts +3 -0
- package/src/lib/dashboard-next/views/dashboard-views.d.ts +44 -0
- package/src/lib/iq-components/luzmo-iq-answer.d.ts +1 -1
- package/src/lib/iq-components/luzmo-iq-chat.d.ts +1 -1
- package/src/lib/shared/helpers/normalize-viz-item-slots.d.ts +2 -0
- package/src/lib/shared/models/dashboard-definition.model.d.ts +34 -0
- package/src/lib/shared/models/index.d.ts +2 -0
- package/src/lib/shared/models/viz-item-service-port.model.d.ts +24 -0
- package/src/lib/viz-item/viz-item.base.d.ts +4 -4
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type DashboardNextLabels, type DashboardNextTranslations } from './dashboard-next-translations';
|
|
2
|
+
export declare function resolveDashboardNextTranslation(editorLanguage: string, key: keyof DashboardNextLabels, overrides?: DashboardNextTranslations): {
|
|
3
|
+
text: string;
|
|
4
|
+
language: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function resolveDashboardNextTranslations(editorLanguage: string, overrides?: DashboardNextTranslations): DashboardNextLabels;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type OptionConfig, type VizItemOptions, type VizItemType } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
export type EditableAppearanceOptions = Readonly<Partial<Record<VizItemType, readonly string[]>>>;
|
|
3
|
+
export interface DashboardChartType {
|
|
4
|
+
value: VizItemType;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const defaultDashboardAppearanceOptions: {
|
|
8
|
+
'ai-summary': never[];
|
|
9
|
+
'area-chart': string[];
|
|
10
|
+
'bar-chart': string[];
|
|
11
|
+
'box-plot': string[];
|
|
12
|
+
'bubble-chart': string[];
|
|
13
|
+
'bullet-chart': string[];
|
|
14
|
+
'choropleth-map': string[];
|
|
15
|
+
'circle-pack-chart': string[];
|
|
16
|
+
'circular-gauge': string[];
|
|
17
|
+
'column-chart': string[];
|
|
18
|
+
'combination-chart': string[];
|
|
19
|
+
'conditional-number': string[];
|
|
20
|
+
'date-comparison-filter': string[];
|
|
21
|
+
'date-filter': string[];
|
|
22
|
+
'donut-chart': string[];
|
|
23
|
+
'dropdown-filter': string[];
|
|
24
|
+
'evolution-number': string[];
|
|
25
|
+
'funnel-chart': string[];
|
|
26
|
+
'heat-map': string[];
|
|
27
|
+
'heat-table': string[];
|
|
28
|
+
'hexbin-map': string[];
|
|
29
|
+
iframeobject: never[];
|
|
30
|
+
image: string[];
|
|
31
|
+
kpi: string[];
|
|
32
|
+
'line-chart': string[];
|
|
33
|
+
'marker-map': string[];
|
|
34
|
+
'ohlc-chart': string[];
|
|
35
|
+
'parallel-coordinates-plot': string[];
|
|
36
|
+
'pivot-table': string[];
|
|
37
|
+
'pyramid-chart': string[];
|
|
38
|
+
'radar-chart': string[];
|
|
39
|
+
'regular-table': string[];
|
|
40
|
+
'route-map': string[];
|
|
41
|
+
'sankey-diagram': string[];
|
|
42
|
+
'scatter-plot': string[];
|
|
43
|
+
'search-filter': string[];
|
|
44
|
+
'slicer-filter': string[];
|
|
45
|
+
'slider-filter': string[];
|
|
46
|
+
spacer: never[];
|
|
47
|
+
'speedometer-chart': string[];
|
|
48
|
+
'spike-map': string[];
|
|
49
|
+
'strip-plot': string[];
|
|
50
|
+
'sunburst-chart': string[];
|
|
51
|
+
'symbol-map': string[];
|
|
52
|
+
text: string[];
|
|
53
|
+
'treemap-chart': string[];
|
|
54
|
+
'venn-diagram': never[];
|
|
55
|
+
video: string[];
|
|
56
|
+
'wordcloud-chart': string[];
|
|
57
|
+
};
|
|
58
|
+
type AppearanceContext = Parameters<NonNullable<OptionConfig['visibleIf']>>[0];
|
|
59
|
+
export declare function appearanceControlConfigs(configs: OptionConfig[], context?: AppearanceContext): OptionConfig[];
|
|
60
|
+
export declare function resolveDashboardAppearanceKeys(type: VizItemType, configured?: EditableAppearanceOptions, context?: AppearanceContext): Promise<string[]>;
|
|
61
|
+
export declare function loadDashboardChartTypes(language: string): Promise<DashboardChartType[]>;
|
|
62
|
+
export declare function applyDashboardAppearanceOption(current: VizItemOptions, key: string, updated: Record<string, unknown>): VizItemOptions;
|
|
63
|
+
export {};
|
package/src/lib/dashboard-next/settings/appearance/dashboard-appearance-settings-controller.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ReactiveControllerHost } from 'lit';
|
|
2
|
+
import type { VizItemType } from '@luzmo/dashboard-contents-types';
|
|
3
|
+
import type { ItemOptionInteractionEventDetail, ItemOptionsChangedEventDetail } from '@luzmo/analytics-components-kit/item-option';
|
|
4
|
+
import { DashboardEditorController } from '../dashboard-editor-controller';
|
|
5
|
+
import type { DashboardChartSettingsContext } from '../dashboard-chart-settings-context';
|
|
6
|
+
import type { DashboardConfigState } from '../../state/config/dashboard-config-store';
|
|
7
|
+
import type { DashboardStores } from '../../state/dashboard-stores';
|
|
8
|
+
export declare class DashboardAppearanceSettingsController extends DashboardEditorController<'appearance'> {
|
|
9
|
+
private controlsGeneration;
|
|
10
|
+
private catalogGeneration;
|
|
11
|
+
private conversionGeneration;
|
|
12
|
+
private readonly interactions;
|
|
13
|
+
private readonly emittedOptions;
|
|
14
|
+
private catalogCheck?;
|
|
15
|
+
constructor(host: ReactiveControllerHost & HTMLElement & {
|
|
16
|
+
stores?: DashboardStores;
|
|
17
|
+
});
|
|
18
|
+
protected contextChanged(previous?: DashboardChartSettingsContext, previousConfig?: DashboardConfigState): void;
|
|
19
|
+
inputOptions(key: string, context: DashboardChartSettingsContext): Record<string, unknown>;
|
|
20
|
+
startInteraction(key: string, event: CustomEvent<ItemOptionInteractionEventDetail>, context: DashboardChartSettingsContext): void;
|
|
21
|
+
endInteraction(key: string, event: CustomEvent<ItemOptionInteractionEventDetail>, context: DashboardChartSettingsContext): void;
|
|
22
|
+
cancelInteraction(key: string, event: CustomEvent<ItemOptionInteractionEventDetail>): void;
|
|
23
|
+
endInteractions(): void;
|
|
24
|
+
changeOption(key: string, event: CustomEvent<ItemOptionsChangedEventDetail>, context: DashboardChartSettingsContext): void;
|
|
25
|
+
selectType(type: VizItemType, context: DashboardChartSettingsContext): Promise<void>;
|
|
26
|
+
changeType(type: VizItemType, context: DashboardChartSettingsContext): Promise<void>;
|
|
27
|
+
private clearInteractions;
|
|
28
|
+
private closeInteraction;
|
|
29
|
+
private emittedChanges;
|
|
30
|
+
private isCurrentControl;
|
|
31
|
+
private interactionOf;
|
|
32
|
+
private dispatchInteraction;
|
|
33
|
+
hostDisconnected(): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import '@luzmo/lucero/notice';
|
|
2
|
+
import { LitElement } from 'lit';
|
|
3
|
+
import type { DashboardStores } from '../../state/dashboard-stores';
|
|
4
|
+
import '@luzmo/lucero/field-label';
|
|
5
|
+
import '@luzmo/analytics-components-kit/item-option';
|
|
6
|
+
export declare class DashboardAppearanceSettings extends LitElement {
|
|
7
|
+
stores?: DashboardStores;
|
|
8
|
+
private readonly controller;
|
|
9
|
+
endInteractions(): void;
|
|
10
|
+
static styles: import("lit").CSSResult[];
|
|
11
|
+
protected render(): import("lit-html").TemplateResult<1> | null;
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type VizItemType } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import type { VizItemDefinition } from '../../../shared/models/dashboard-definition.model';
|
|
3
|
+
import type { DashboardChartChange } from '../../state/content/dashboard-content-state';
|
|
4
|
+
import { type DashboardChartType } from './dashboard-appearance-config';
|
|
5
|
+
export declare function convertDashboardChartType(definition: VizItemDefinition, type: VizItemType): Promise<DashboardChartChange>;
|
|
6
|
+
export declare function filterDashboardChartTypes(definition: VizItemDefinition, types: readonly DashboardChartType[]): Promise<DashboardChartType[]>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ScreenMode, ThemeConfig } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import type { VizItemDefinition } from '../../shared/models/dashboard-definition.model';
|
|
3
|
+
import type { DashboardOptionChange } from '../state/content/dashboard-option-changes';
|
|
4
|
+
export interface DashboardChartSettingsContext {
|
|
5
|
+
definition: VizItemDefinition;
|
|
6
|
+
revision: number;
|
|
7
|
+
itemId: string;
|
|
8
|
+
screenMode: ScreenMode;
|
|
9
|
+
documentGeneration: number;
|
|
10
|
+
theme?: ThemeConfig;
|
|
11
|
+
timezone?: string;
|
|
12
|
+
}
|
|
13
|
+
export type DashboardChartInteractionEvents = {
|
|
14
|
+
'chart-interaction-start': {
|
|
15
|
+
id: string;
|
|
16
|
+
revision: number;
|
|
17
|
+
};
|
|
18
|
+
'chart-interaction-preview': {
|
|
19
|
+
id: string;
|
|
20
|
+
changes: DashboardOptionChange[];
|
|
21
|
+
};
|
|
22
|
+
'chart-interaction-end': {
|
|
23
|
+
id: string;
|
|
24
|
+
changed: boolean;
|
|
25
|
+
};
|
|
26
|
+
'chart-interaction-cancel': {
|
|
27
|
+
id: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export declare function chartDatasetIds(definition: Pick<VizItemDefinition, 'slots'>): string[];
|
|
31
|
+
export declare const dashboardChartSettingsStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
import type { DashboardStores } from '../state/dashboard-stores';
|
|
3
|
+
import type { DashboardConfigState } from '../state/config/dashboard-config-store';
|
|
4
|
+
import type { DashboardEditorState } from '../state/runtime/dashboard-editor-state';
|
|
5
|
+
import type { DashboardChartChange } from '../state/content/dashboard-content-state';
|
|
6
|
+
import type { DashboardChartSettingsContext } from './dashboard-chart-settings-context';
|
|
7
|
+
export declare abstract class DashboardEditorController<K extends keyof DashboardEditorState> implements ReactiveController {
|
|
8
|
+
protected readonly host: ReactiveControllerHost & HTMLElement & {
|
|
9
|
+
stores?: DashboardStores;
|
|
10
|
+
};
|
|
11
|
+
private readonly section;
|
|
12
|
+
private subscribed?;
|
|
13
|
+
private subscriptions;
|
|
14
|
+
private previousContext?;
|
|
15
|
+
private previousConfig?;
|
|
16
|
+
constructor(host: ReactiveControllerHost & HTMLElement & {
|
|
17
|
+
stores?: DashboardStores;
|
|
18
|
+
}, section: K);
|
|
19
|
+
get stores(): DashboardStores | undefined;
|
|
20
|
+
get runtime(): import("../state/runtime/dashboard-runtime-store").DashboardRuntimeStore | undefined;
|
|
21
|
+
get context(): DashboardChartSettingsContext | undefined;
|
|
22
|
+
get config(): DashboardConfigState | undefined;
|
|
23
|
+
get labels(): import("../localization/dashboard-next-translations").DashboardNextLabels | undefined;
|
|
24
|
+
get state(): DashboardEditorState[K];
|
|
25
|
+
protected update(patch: Partial<DashboardEditorState[K]>): void;
|
|
26
|
+
protected isCurrent(context: DashboardChartSettingsContext): boolean;
|
|
27
|
+
protected dispatchChange(context: DashboardChartSettingsContext, patch: DashboardChartChange): void;
|
|
28
|
+
protected abstract contextChanged(previous?: DashboardChartSettingsContext, previousConfig?: DashboardConfigState): void;
|
|
29
|
+
hostUpdate(): void;
|
|
30
|
+
hostConnected(): void;
|
|
31
|
+
hostDisconnected(): void;
|
|
32
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DashboardStores } from '../state/dashboard-stores';
|
|
2
|
+
import type { DashboardMetadataController } from '../data/dashboard-metadata-controller';
|
|
3
|
+
import './data/dashboard-data-settings';
|
|
4
|
+
import './filters/dashboard-filter-settings';
|
|
5
|
+
import './appearance/dashboard-appearance-settings';
|
|
6
|
+
export declare function renderDashboardSettingsContent(stores: DashboardStores, metadata: DashboardMetadataController): import("lit-html").TemplateResult<1>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
import type { DashboardStores } from '../state/dashboard-stores';
|
|
3
|
+
import type { DashboardContentController } from '../state/content/dashboard-content-controller';
|
|
4
|
+
import type { DashboardChartChange, DashboardContentTarget } from '../state/content/dashboard-content-state';
|
|
5
|
+
import type { DashboardSettingsTab } from '../state/runtime/dashboard-runtime-state';
|
|
6
|
+
import type { DashboardSettingsPopover } from './dashboard-settings-popover';
|
|
7
|
+
export interface DashboardSettingsRequest {
|
|
8
|
+
itemId: string;
|
|
9
|
+
active: boolean;
|
|
10
|
+
revision: number;
|
|
11
|
+
anchor: HTMLElement;
|
|
12
|
+
trigger: HTMLElement;
|
|
13
|
+
}
|
|
14
|
+
export declare class DashboardSettingsController implements ReactiveController {
|
|
15
|
+
private readonly host;
|
|
16
|
+
private readonly stores;
|
|
17
|
+
private readonly content;
|
|
18
|
+
private anchor?;
|
|
19
|
+
private trigger?;
|
|
20
|
+
private panel?;
|
|
21
|
+
private cleanupPosition?;
|
|
22
|
+
private positionedAnchor?;
|
|
23
|
+
private positionedViewport?;
|
|
24
|
+
private positionedScreenMode?;
|
|
25
|
+
private keyboardDocument?;
|
|
26
|
+
constructor(host: ReactiveControllerHost & HTMLElement, stores: DashboardStores, content: DashboardContentController);
|
|
27
|
+
private get runtime();
|
|
28
|
+
open({ itemId, anchor, trigger, active, revision }: DashboardSettingsRequest): void;
|
|
29
|
+
applyChange(event: CustomEvent<{
|
|
30
|
+
patch: DashboardChartChange;
|
|
31
|
+
revision?: number;
|
|
32
|
+
}>, target: DashboardContentTarget, generation: number): void;
|
|
33
|
+
changeTab(event: CustomEvent<{
|
|
34
|
+
tab: DashboardSettingsTab;
|
|
35
|
+
}>, itemId: string, generation: number): void;
|
|
36
|
+
closeFromEvent(event: Event, itemId: string, generation: number): void;
|
|
37
|
+
private accepts;
|
|
38
|
+
update(panel: DashboardSettingsPopover | undefined, viewport: HTMLElement | null): void;
|
|
39
|
+
close(restoreFocus?: boolean): void;
|
|
40
|
+
hostDisconnected(): void;
|
|
41
|
+
private readonly onKeyDown;
|
|
42
|
+
private readonly onPointerDown;
|
|
43
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import '@luzmo/lucero/icon';
|
|
3
|
+
import '@luzmo/lucero/popover';
|
|
4
|
+
import type { DashboardNextLabels } from '../localization/dashboard-next-translations';
|
|
5
|
+
import type { DashboardSettingsTab } from '../state/runtime/dashboard-runtime-state';
|
|
6
|
+
export declare class DashboardSettingsPopover extends LitElement {
|
|
7
|
+
labels: DashboardNextLabels;
|
|
8
|
+
chartTitle: string;
|
|
9
|
+
activeTab: DashboardSettingsTab;
|
|
10
|
+
static styles: import("lit").CSSResult;
|
|
11
|
+
focusClose(): Promise<void>;
|
|
12
|
+
protected render(): import("lit-html").TemplateResult<1> | null;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function positionDashboardSettings(anchor: HTMLElement, panel: HTMLElement, viewport: HTMLElement): () => void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ThemeConfig } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import type { VizItemDefinition } from '../../shared/models/dashboard-definition.model';
|
|
3
|
+
import type { DashboardNextLabels } from '../localization/dashboard-next-translations';
|
|
4
|
+
import { DashboardStores } from '../state/dashboard-stores';
|
|
5
|
+
export interface DashboardSettingsTestContext {
|
|
6
|
+
definition: VizItemDefinition;
|
|
7
|
+
revision: number;
|
|
8
|
+
editorLanguage: string;
|
|
9
|
+
contentLanguage: string;
|
|
10
|
+
apiHost: string;
|
|
11
|
+
authKey: string;
|
|
12
|
+
authToken: string;
|
|
13
|
+
labels: DashboardNextLabels;
|
|
14
|
+
theme?: ThemeConfig;
|
|
15
|
+
timezone?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function updateSettingsContext(stores: DashboardStores, context: DashboardSettingsTestContext): void;
|
|
18
|
+
export declare function createSettingsStores(context: DashboardSettingsTestContext): DashboardStores;
|
|
19
|
+
export declare function getSettingsContext(stores: DashboardStores): DashboardSettingsTestContext;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LuzmoItemSlotPickerPanel } from '@luzmo/analytics-components-kit/item-slot-picker-panel';
|
|
2
|
+
import { type DashboardAccess } from '../../data/dashboard-api';
|
|
3
|
+
export type DashboardDataAccess = DashboardAccess;
|
|
4
|
+
export interface DashboardDatasetSummary {
|
|
5
|
+
id: string;
|
|
6
|
+
name: Record<string, string>;
|
|
7
|
+
description?: Record<string, string>;
|
|
8
|
+
}
|
|
9
|
+
export type DashboardDatasetFields = LuzmoItemSlotPickerPanel['datasetsDataFields'];
|
|
10
|
+
export declare function loadDashboardDatasets(access: DashboardDataAccess, signal: AbortSignal): Promise<DashboardDatasetSummary[]>;
|
|
11
|
+
export declare function loadDashboardDataFields(access: DashboardDataAccess, datasetIds: string[], signal: AbortSignal): Promise<DashboardDatasetFields>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ReactiveControllerHost } from 'lit';
|
|
2
|
+
import type { VizItemSlot } from '@luzmo/dashboard-contents-types';
|
|
3
|
+
import type { DashboardStores } from '../../state/dashboard-stores';
|
|
4
|
+
import type { DashboardConfigState } from '../../state/config/dashboard-config-store';
|
|
5
|
+
import type { DashboardMetadataController } from '../../data/dashboard-metadata-controller';
|
|
6
|
+
import { DashboardEditorController } from '../dashboard-editor-controller';
|
|
7
|
+
import { type DashboardChartSettingsContext } from '../dashboard-chart-settings-context';
|
|
8
|
+
type DataSettingsHost = ReactiveControllerHost & HTMLElement & {
|
|
9
|
+
stores?: DashboardStores;
|
|
10
|
+
metadata?: DashboardMetadataController;
|
|
11
|
+
};
|
|
12
|
+
export declare class DashboardDataSettingsController extends DashboardEditorController<'data'> {
|
|
13
|
+
private readonly dataHost;
|
|
14
|
+
private metadataAttempt?;
|
|
15
|
+
private subscribedMetadata?;
|
|
16
|
+
private subscribedRuntime?;
|
|
17
|
+
private unsubscribeTab?;
|
|
18
|
+
constructor(dataHost: DataSettingsHost);
|
|
19
|
+
get recovery(): boolean;
|
|
20
|
+
get blocked(): boolean;
|
|
21
|
+
hostUpdate(): void;
|
|
22
|
+
protected contextChanged(previous?: DashboardChartSettingsContext, previousConfig?: DashboardConfigState): void;
|
|
23
|
+
private refresh;
|
|
24
|
+
hostDisconnected(): void;
|
|
25
|
+
retryMetadata(): void;
|
|
26
|
+
recoveryDatasetChanged(context: DashboardChartSettingsContext, event: Event): void;
|
|
27
|
+
datasetConstraintTriggered(context: DashboardChartSettingsContext, event: CustomEvent<{
|
|
28
|
+
newDatasetId: string;
|
|
29
|
+
}>): void;
|
|
30
|
+
datasetChanged(context: DashboardChartSettingsContext, event: CustomEvent<{
|
|
31
|
+
datasetId: string;
|
|
32
|
+
}>): void;
|
|
33
|
+
slotConstraintTriggered(context: DashboardChartSettingsContext, event: Event): void;
|
|
34
|
+
slotsChanged(context: DashboardChartSettingsContext, event: CustomEvent<{
|
|
35
|
+
slotsContents: VizItemSlot[];
|
|
36
|
+
}>): void;
|
|
37
|
+
private current;
|
|
38
|
+
private loadMetadata;
|
|
39
|
+
private changeDataset;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import '@luzmo/lucero/notice';
|
|
2
|
+
import { LitElement } from 'lit';
|
|
3
|
+
import '@luzmo/analytics-components-kit/item-slot-picker-panel';
|
|
4
|
+
import '@luzmo/lucero/button';
|
|
5
|
+
import '@luzmo/lucero/field-label';
|
|
6
|
+
import '@luzmo/lucero/select';
|
|
7
|
+
import type { DashboardStores } from '../../state/dashboard-stores';
|
|
8
|
+
import type { DashboardMetadataController } from '../../data/dashboard-metadata-controller';
|
|
9
|
+
export declare class DashboardDataSettings extends LitElement {
|
|
10
|
+
stores?: DashboardStores;
|
|
11
|
+
metadata?: DashboardMetadataController;
|
|
12
|
+
private readonly editorController;
|
|
13
|
+
static styles: import("lit").CSSResult[];
|
|
14
|
+
protected render(): import("lit-html").TemplateResult<1> | null;
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactiveControllerHost } from 'lit';
|
|
2
|
+
import type { ItemFilterGroup } from '@luzmo/dashboard-contents-types';
|
|
3
|
+
import { DashboardEditorController } from '../dashboard-editor-controller';
|
|
4
|
+
import type { DashboardStores } from '../../state/dashboard-stores';
|
|
5
|
+
import type { DashboardConfigState } from '../../state/config/dashboard-config-store';
|
|
6
|
+
import { type DashboardChartSettingsContext } from '../dashboard-chart-settings-context';
|
|
7
|
+
export declare class DashboardFilterSettingsController extends DashboardEditorController<'filters'> {
|
|
8
|
+
constructor(host: ReactiveControllerHost & HTMLElement & {
|
|
9
|
+
stores?: DashboardStores;
|
|
10
|
+
});
|
|
11
|
+
get datasetIds(): string[];
|
|
12
|
+
get parameters(): string[];
|
|
13
|
+
get readOnly(): boolean;
|
|
14
|
+
change(event: CustomEvent<{
|
|
15
|
+
format: string;
|
|
16
|
+
filters: ItemFilterGroup[];
|
|
17
|
+
}>, context: DashboardChartSettingsContext): void;
|
|
18
|
+
protected contextChanged(previous?: DashboardChartSettingsContext, previousConfig?: DashboardConfigState): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import '@luzmo/lucero/notice';
|
|
2
|
+
import { LitElement } from 'lit';
|
|
3
|
+
import type { DashboardStores } from '../../state/dashboard-stores';
|
|
4
|
+
export declare class DashboardFilterSettings extends LitElement {
|
|
5
|
+
stores?: DashboardStores;
|
|
6
|
+
private readonly controller;
|
|
7
|
+
static styles: import("lit").CSSResult[];
|
|
8
|
+
protected render(): import("lit-html").TemplateResult<1> | null;
|
|
9
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ScreenMode } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import type { DashboardNextLabels, DashboardNextTranslations } from '../../localization/dashboard-next-translations';
|
|
3
|
+
import type { EditableAppearanceOptions } from '../../settings/appearance/dashboard-appearance-config';
|
|
4
|
+
export interface DashboardConfigState {
|
|
5
|
+
readonly dashboardId?: string;
|
|
6
|
+
readonly authKey?: string;
|
|
7
|
+
readonly authToken?: string;
|
|
8
|
+
readonly apiHost: string;
|
|
9
|
+
readonly appServer: string;
|
|
10
|
+
readonly screenMode: ScreenMode | 'auto';
|
|
11
|
+
readonly editorLanguage: string;
|
|
12
|
+
readonly language: string;
|
|
13
|
+
readonly customTranslations?: DashboardNextTranslations;
|
|
14
|
+
readonly editableAppearanceOptions?: EditableAppearanceOptions;
|
|
15
|
+
readonly allowModeSwitch: boolean;
|
|
16
|
+
readonly disableDashboardSwitching: boolean;
|
|
17
|
+
}
|
|
18
|
+
type ConfigSubscriber = (state: DashboardConfigState, previous: DashboardConfigState) => void;
|
|
19
|
+
export declare class DashboardConfigStore {
|
|
20
|
+
private state;
|
|
21
|
+
private readonly subscribers;
|
|
22
|
+
private labels?;
|
|
23
|
+
getLabels(): DashboardNextLabels;
|
|
24
|
+
getState(): DashboardConfigState;
|
|
25
|
+
update(patch: Partial<DashboardConfigState>): boolean;
|
|
26
|
+
subscribe(subscriber: ConfigSubscriber): () => void;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
import type { ThemeConfig } from '@luzmo/dashboard-contents-types';
|
|
3
|
+
import type { DashboardDefinition } from '../../../shared/models/dashboard-definition.model';
|
|
4
|
+
import type { DashboardGridAction } from '../../grid/dashboard-next-grid';
|
|
5
|
+
import type { DashboardStores } from '../dashboard-stores';
|
|
6
|
+
import type { LuzmoDashboardNextVizItem } from '../../grid/dashboard-next-viz-item';
|
|
7
|
+
import type { DashboardChartChange, DashboardContentItem, DashboardContentState, DashboardContentTarget, DashboardLayoutItem } from './dashboard-content-state';
|
|
8
|
+
import { type DashboardOptionChange } from './dashboard-option-changes';
|
|
9
|
+
export declare class DashboardContentController implements ReactiveController {
|
|
10
|
+
private readonly host;
|
|
11
|
+
readonly stores: DashboardStores;
|
|
12
|
+
private hydration?;
|
|
13
|
+
private readonly interactions;
|
|
14
|
+
constructor(host: ReactiveControllerHost & HTMLElement, stores: DashboardStores);
|
|
15
|
+
get layout(): import("../../views/dashboard-views").DashboardViews | undefined;
|
|
16
|
+
get ready(): boolean;
|
|
17
|
+
hydrateFromChart(chart: LuzmoDashboardNextVizItem, generation: number): void;
|
|
18
|
+
get version(): string | undefined;
|
|
19
|
+
get revision(): number;
|
|
20
|
+
reset(document?: DashboardContentState, themes?: {
|
|
21
|
+
id: string;
|
|
22
|
+
theme: ThemeConfig;
|
|
23
|
+
}[]): void;
|
|
24
|
+
hydrate(normalize: (document: DashboardDefinition) => DashboardDefinition | Promise<DashboardDefinition>): Promise<void>;
|
|
25
|
+
getState(): DashboardContentState | undefined;
|
|
26
|
+
applyChartChange(target: DashboardContentTarget, patch: DashboardChartChange): boolean;
|
|
27
|
+
getItem({ screenMode, itemId }: DashboardContentTarget): DashboardContentItem | undefined;
|
|
28
|
+
startInteraction(id: string, target: DashboardContentTarget): boolean;
|
|
29
|
+
previewInteraction(id: string, changes: DashboardOptionChange[]): boolean;
|
|
30
|
+
endInteraction(id: string, changed?: boolean): boolean;
|
|
31
|
+
cancelInteraction(id: string): boolean;
|
|
32
|
+
finalizeInteractions(): void;
|
|
33
|
+
private get canEdit();
|
|
34
|
+
applyGridAction(detail: DashboardGridAction, generation: number): boolean;
|
|
35
|
+
duplicateChart(target: DashboardContentTarget, duplicateId: string, items: DashboardLayoutItem[]): boolean;
|
|
36
|
+
removeChart(target: DashboardContentTarget): boolean;
|
|
37
|
+
applyGridLayout(target: DashboardContentTarget, items: DashboardLayoutItem[]): boolean;
|
|
38
|
+
get canUndo(): boolean;
|
|
39
|
+
get canRedo(): boolean;
|
|
40
|
+
undo(): boolean;
|
|
41
|
+
redo(): boolean;
|
|
42
|
+
hostDisconnected(): void;
|
|
43
|
+
private commit;
|
|
44
|
+
private refresh;
|
|
45
|
+
private project;
|
|
46
|
+
private preview;
|
|
47
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ItemFilterGroup } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import type { GridItemData } from '@luzmo/analytics-components-kit/grid-core';
|
|
3
|
+
import type { VizItemDefinition } from '../../../shared/models/dashboard-definition.model';
|
|
4
|
+
import type { DashboardContentState } from './dashboard-content-state';
|
|
5
|
+
export declare function selectChartTimezone(document: DashboardContentState, item: Pick<GridItemData, 'options'>): string;
|
|
6
|
+
export declare function selectChartDefinition(item: Omit<GridItemData, 'filters'>, version: string, filterGroups?: ItemFilterGroup[]): VizItemDefinition;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ItemFilter, ItemFilterGroup, ScreenMode } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import type { GridItemData } from '@luzmo/analytics-components-kit/grid-core';
|
|
3
|
+
export interface DashboardContentItem extends Omit<GridItemData, 'filters'> {
|
|
4
|
+
filters?: ItemFilter[];
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
export interface DashboardContentView {
|
|
8
|
+
screenModus?: ScreenMode;
|
|
9
|
+
items: DashboardContentItem[];
|
|
10
|
+
filterGroups?: ItemFilterGroup[];
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
}
|
|
13
|
+
export interface DashboardContentDocument {
|
|
14
|
+
version?: string;
|
|
15
|
+
syncScreenModes?: boolean;
|
|
16
|
+
views: DashboardContentView[];
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
export interface DashboardContentState {
|
|
20
|
+
id?: string;
|
|
21
|
+
owner_id?: string;
|
|
22
|
+
css?: string;
|
|
23
|
+
description?: unknown;
|
|
24
|
+
subtitle?: unknown;
|
|
25
|
+
name?: Record<string, string>;
|
|
26
|
+
contents: DashboardContentDocument;
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
}
|
|
29
|
+
export interface DashboardContentTarget {
|
|
30
|
+
screenMode: ScreenMode;
|
|
31
|
+
itemId: string;
|
|
32
|
+
}
|
|
33
|
+
export type DashboardChartChange = Partial<Pick<DashboardContentItem, 'type' | 'slots' | 'options'>> & {
|
|
34
|
+
filters?: ItemFilterGroup[];
|
|
35
|
+
};
|
|
36
|
+
export type DashboardLayoutItem = Pick<DashboardContentItem, 'id' | 'position'>;
|
|
37
|
+
export type DashboardGridChange = {
|
|
38
|
+
kind: 'layout';
|
|
39
|
+
items: DashboardLayoutItem[];
|
|
40
|
+
} | {
|
|
41
|
+
kind: 'remove';
|
|
42
|
+
} | {
|
|
43
|
+
kind: 'duplicate';
|
|
44
|
+
duplicateId: string;
|
|
45
|
+
layouts: Partial<Record<ScreenMode, DashboardLayoutItem[]>>;
|
|
46
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { StoreBase } from '@luzmo/analytics-components-kit/utils/store';
|
|
2
|
+
import type { DashboardChartChange, DashboardContentState, DashboardContentTarget, DashboardGridChange } from './dashboard-content-state';
|
|
3
|
+
export declare class DashboardContentStore extends StoreBase<DashboardContentState> {
|
|
4
|
+
private document;
|
|
5
|
+
private views;
|
|
6
|
+
private destroyed;
|
|
7
|
+
private hydrating;
|
|
8
|
+
constructor(document: DashboardContentState);
|
|
9
|
+
protected initializeContainers(document?: Partial<DashboardContentState>): void;
|
|
10
|
+
protected notifyStateSubscribers(): void;
|
|
11
|
+
getState(): DashboardContentState;
|
|
12
|
+
get version(): string | undefined;
|
|
13
|
+
reset(document?: Partial<DashboardContentState>): void;
|
|
14
|
+
applyName(name: Record<string, string>): boolean;
|
|
15
|
+
applyChartChange(target: DashboardContentTarget, patch: DashboardChartChange): boolean;
|
|
16
|
+
applyGridChange(target: DashboardContentTarget, change: DashboardGridChange): boolean;
|
|
17
|
+
destroy(): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface DashboardOptionChange {
|
|
2
|
+
path: string[];
|
|
3
|
+
value?: unknown;
|
|
4
|
+
deleted?: boolean;
|
|
5
|
+
ensureObject?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function diffDashboardOptions(baseline: Record<string, unknown> | undefined, next: Record<string, unknown>): DashboardOptionChange[];
|
|
8
|
+
export declare function mergeDashboardOptionChanges(previous: DashboardOptionChange[], next: DashboardOptionChange[]): DashboardOptionChange[];
|
|
9
|
+
export declare function applyDashboardOptionChanges<T extends object>(options: T | undefined, changes: DashboardOptionChange[]): T;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DashboardChartSettingsContext } from '../settings/dashboard-chart-settings-context';
|
|
2
|
+
import { DashboardConfigStore } from './config/dashboard-config-store';
|
|
3
|
+
import { DashboardRuntimeStore } from './runtime/dashboard-runtime-store';
|
|
4
|
+
import { DashboardContentStore } from './content/dashboard-content-store';
|
|
5
|
+
export declare class DashboardStores {
|
|
6
|
+
readonly config: DashboardConfigStore;
|
|
7
|
+
readonly runtime: DashboardRuntimeStore;
|
|
8
|
+
readonly content: DashboardContentStore;
|
|
9
|
+
private settings?;
|
|
10
|
+
constructor();
|
|
11
|
+
getChartSettings(): DashboardChartSettingsContext | undefined;
|
|
12
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ItemFilterGroup, VizItemSlot } from '@luzmo/dashboard-contents-types';
|
|
2
|
+
import type { DashboardChartType } from '../../settings/appearance/dashboard-appearance-config';
|
|
3
|
+
import type { DashboardDatasetFields } from '../../settings/data/dashboard-data-metadata';
|
|
4
|
+
import type { DashboardChartSettingsContext } from '../../settings/dashboard-chart-settings-context';
|
|
5
|
+
export interface DashboardEditorState {
|
|
6
|
+
data: {
|
|
7
|
+
selectedDatasetId?: string;
|
|
8
|
+
incompatible: boolean;
|
|
9
|
+
controlGeneration: number;
|
|
10
|
+
acceptedSlots?: VizItemSlot[];
|
|
11
|
+
inputSlots: VizItemSlot[];
|
|
12
|
+
datasets: DashboardDatasetFields;
|
|
13
|
+
loading: boolean;
|
|
14
|
+
metadataFailed: boolean;
|
|
15
|
+
};
|
|
16
|
+
appearance: {
|
|
17
|
+
optionKeys: string[];
|
|
18
|
+
types: DashboardChartType[];
|
|
19
|
+
checkingTypes: boolean;
|
|
20
|
+
pending: boolean;
|
|
21
|
+
failed: boolean;
|
|
22
|
+
optionGenerations: Readonly<Record<string, number>>;
|
|
23
|
+
optionInputs: Readonly<Record<string, Record<string, unknown>>>;
|
|
24
|
+
acceptedOptions?: DashboardChartSettingsContext['definition']['options'];
|
|
25
|
+
acceptedOptionKey?: string;
|
|
26
|
+
};
|
|
27
|
+
filters: {
|
|
28
|
+
invalid: boolean;
|
|
29
|
+
controlGeneration: number;
|
|
30
|
+
acceptedFilters?: ItemFilterGroup[];
|
|
31
|
+
inputFilters: ItemFilterGroup[];
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export declare function createDashboardEditorState(): DashboardEditorState;
|