@masterteam/dashboard-builder 0.0.122 → 0.0.123

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.
@@ -1,3 +1,3 @@
1
- export { b1 as ActionsSettings, b9 as ArrayBuilderField, a6 as BarChartHandler, aW as BarControlUi, bn as CHART_CAPABILITIES, aZ as CHART_TYPES, bC as CONFIG_DOMAINS, c4 as CUSTOM_COLOR_OPTION, c as CardContentComponent, B as CardFilterComponent, H as CardInfoComponent, I as ChartCardComponent, a2 as ChartDataService, bd as ChartFilterDrawer, aS as ChartSettingsDrawer, b2 as ChartViewer, b8 as ColorListField, aj as ComparisonChartHandler, co as DASHBOARD_BUILDER_ASSIST, a5 as DASHBOARD_ITEM_VISIBILITY, W as DEFAULT_MAP_REGION_KEY, l as DashboardBuilder, aK as DashboardBuilderService, e as DashboardItem, D as DashboardItemStoreService, aE as DashboardList, aL as DashboardStoreService, m as DashboardViewer, b0 as DataSourceSettings, bj as DatasourcePanelComponent, aU as DefaultControlUi, aT as DisplaySettings, G as DynamicFiltersComponent, aR as DynamicFiltersConfig, J as EChartComponent, P as EntitiesPreviewCardComponent, E as EntityInfoComponent, Q as EntityPreviewCardComponent, bi as FilterBuilderComponent, bl as FilterByGroupPipe, bh as FilterChipsBarComponent, ad as GaugeChartHandler, a$ as GeneralSettings, bm as GetChartActionsPipe, bg as GuidedConfigDialogComponent, aI as HTTPMethod, R as HeaderCardComponent, cl as ITEM_GUIDANCE_REGISTRY, bc as ItemCardMenuComponent, bf as ItemConfigPopoverComponent, be as ItemContextToolbarComponent, cn as ItemGuidanceService, ba as KeyValueMapField, T as LastHistoryLevelCardComponent, bb as LegendOrderField, al as LevelCardHandler, ah as LineChartHandler, U as ListStatisticCardComponent, V as MAP_REGIONS, aF as MODULE_CLASSIFICATION_LOG, aG as MODULE_CLASSIFICATION_LOG_NAME, aP as ManageBreadcrumb, aQ as ManageFilterOnPage, aY as ManageItem, a_ as ManageItemService, aO as ManagePages, am as MapChartHandler, Y as MapViewComponent, af as OverviewCardHandler, bF as POPOVER_TABS, bG as POPOVER_TAB_SPECS, ap as PhaseGateStepperHandler, a9 as PieChartHandler, aV as PieControlUi, P as PropertiesCardComponent, an as RingGaugeChartHandler, ao as SPlusChartHandler, bX as STYLE_PRESETS, bk as SchemaControlRendererComponent, b7 as SegmentedField, Z as SkeletonCardComponent, ai as SnapshotHandler, ak as SplitterChartHandler, aa as StackBarChartHandler, aX as StackBarControlUi, S as StaticFiltersComponent, $ as StatisticCardComponent, b6 as StyleField, b4 as StyleSettingsRenderer, b3 as StyleStudioDrawer, ae as TableViewHandler, ag as TimelineHandler, a1 as TopbarCardComponent, cp as WIDGET_PALETTE_TILE_HOST, x as addCommasToNumber, bT as applyBehaviorToPersisted, aD as applyBuiltInConditions, c7 as applyControlPatchToPersisted, c8 as applyControlPatchesToPersisted, bU as applyFilterChipsToPersisted, bR as applyLabelLegendFormatToPersisted, bP as applyLayoutToPersisted, bN as applyStyleToPersisted, bI as applyTitleToPersisted, ab as axisFormatters, bS as behaviorToUi, cg as bindingKey, bW as buildAssembly, cf as buildDisplayFieldPredicate, k as cloneDeep, aJ as copyName, av as createAxisFormatter, aw as createTooltipFormatter, cq as dashboardLevelOptions, bJ as datasourceToUi, M as dateDisplayRawValue, c2 as deepMerge, cm as describeGuidance, bD as domainsForCapability, d as dynamicReorder, t as dynamicTextReplace, b5 as expandResetPatches, bK as fieldsToUi, bL as filtersToUi, bE as findDomain, bZ as findPreset, cr as firstFreePosition, cd as flattenSchema, ax as formatAxisLabel, aq as formatCurrency, au as formatDate, c3 as formatForEditor, at as formatNumber, as as formatPercentage, f as formatValue, ay as formatWordsUnderBar, az as formatXAxis, u as generalConfiguration, ch as getBinding, bo as getCapabilityById, A as getColorFromConditions, c9 as getControlSchema, ar as getCurrencySuffix, cc as getFallbackControlSchema, v as getLocalizedTitle, q as getNestedData, ac as groupDatesByYearAndMonth, c0 as groupIssuesByDomain, aB as handleFilterForCard, aC as handleFilterForSnapshot, aA as handleFiltersForCustom, b$ as hasBlockingIssues, aH as isLogClassification, aM as isManagePagesDeleteResult, aN as isManagePagesDuplicateResult, z as isMobilePlatform, bQ as labelLegendFormatToUi, bO as layoutToUi, ci as listBindings, cj as listBindingsForChart, ca as listControlSchemaIds, cb as listControlSchemas, a4 as loadImmediately, a0 as loadTableCard, O as mergePropertyAppearance, bw as moduleIdFromSelector, bt as normalizeAggregateFunction, bB as normalizeBeforeRequest, bA as normalizeBeforeSave, br as normalizeChartTypeForRequest, N as normalizeDashboardCardEntityValue, bs as normalizeFilterOperation, bu as normalizeFilters, bz as normalizeOnLoad, a3 as observeNearViewport, c1 as parseAdvancedJson, bV as persistedToUi, bY as presetsForCapability, ck as readBoundValue, c5 as readByPath, bp as resolveCapability, ce as resolveDisplayFields, L as resolveEntityCheckbox, K as resolveEntityUserPhoto, X as resolveMapRegion, a8 as resolvePieInnerRadius, a7 as resolvePieShape, _ as resolveStatisticIconPlacement, bv as selectorFromLegacy, c6 as setByPath, w as sortChartData, y as sortDataTableView, bM as styleToUi, p as switchAllKeysSmall, s as switchAllKeysToLower, bH as titleToUi, bq as toBackendChartType, bx as toBackendSourceLink, by as toFormSourceLink, b_ as validate } from './masterteam-dashboard-builder-masterteam-dashboard-builder-r4HI2aa1.mjs';
1
+ export { b1 as ActionsSettings, b9 as ArrayBuilderField, a6 as BarChartHandler, aW as BarControlUi, bn as CHART_CAPABILITIES, aZ as CHART_TYPES, bC as CONFIG_DOMAINS, c4 as CUSTOM_COLOR_OPTION, c as CardContentComponent, B as CardFilterComponent, H as CardInfoComponent, I as ChartCardComponent, a2 as ChartDataService, bd as ChartFilterDrawer, aS as ChartSettingsDrawer, b2 as ChartViewer, b8 as ColorListField, aj as ComparisonChartHandler, co as DASHBOARD_BUILDER_ASSIST, a5 as DASHBOARD_ITEM_VISIBILITY, W as DEFAULT_MAP_REGION_KEY, l as DashboardBuilder, aK as DashboardBuilderService, e as DashboardItem, D as DashboardItemStoreService, aE as DashboardList, aL as DashboardStoreService, m as DashboardViewer, b0 as DataSourceSettings, bj as DatasourcePanelComponent, aU as DefaultControlUi, aT as DisplaySettings, G as DynamicFiltersComponent, aR as DynamicFiltersConfig, J as EChartComponent, P as EntitiesPreviewCardComponent, E as EntityInfoComponent, Q as EntityPreviewCardComponent, bi as FilterBuilderComponent, bl as FilterByGroupPipe, bh as FilterChipsBarComponent, ad as GaugeChartHandler, a$ as GeneralSettings, bm as GetChartActionsPipe, bg as GuidedConfigDialogComponent, aI as HTTPMethod, R as HeaderCardComponent, cl as ITEM_GUIDANCE_REGISTRY, bc as ItemCardMenuComponent, bf as ItemConfigPopoverComponent, be as ItemContextToolbarComponent, cn as ItemGuidanceService, ba as KeyValueMapField, T as LastHistoryLevelCardComponent, bb as LegendOrderField, al as LevelCardHandler, ah as LineChartHandler, U as ListStatisticCardComponent, V as MAP_REGIONS, aF as MODULE_CLASSIFICATION_LOG, aG as MODULE_CLASSIFICATION_LOG_NAME, aP as ManageBreadcrumb, aQ as ManageFilterOnPage, aY as ManageItem, a_ as ManageItemService, aO as ManagePages, am as MapChartHandler, Y as MapViewComponent, af as OverviewCardHandler, bF as POPOVER_TABS, bG as POPOVER_TAB_SPECS, ap as PhaseGateStepperHandler, a9 as PieChartHandler, aV as PieControlUi, P as PropertiesCardComponent, an as RingGaugeChartHandler, ao as SPlusChartHandler, bX as STYLE_PRESETS, bk as SchemaControlRendererComponent, b7 as SegmentedField, Z as SkeletonCardComponent, ai as SnapshotHandler, ak as SplitterChartHandler, aa as StackBarChartHandler, aX as StackBarControlUi, S as StaticFiltersComponent, $ as StatisticCardComponent, b6 as StyleField, b4 as StyleSettingsRenderer, b3 as StyleStudioDrawer, ae as TableViewHandler, ag as TimelineHandler, a1 as TopbarCardComponent, cp as WIDGET_PALETTE_TILE_HOST, x as addCommasToNumber, bT as applyBehaviorToPersisted, aD as applyBuiltInConditions, c7 as applyControlPatchToPersisted, c8 as applyControlPatchesToPersisted, bU as applyFilterChipsToPersisted, bR as applyLabelLegendFormatToPersisted, bP as applyLayoutToPersisted, bN as applyStyleToPersisted, bI as applyTitleToPersisted, ab as axisFormatters, bS as behaviorToUi, cg as bindingKey, bW as buildAssembly, cf as buildDisplayFieldPredicate, k as cloneDeep, aJ as copyName, av as createAxisFormatter, aw as createTooltipFormatter, cq as dashboardLevelOptions, bJ as datasourceToUi, M as dateDisplayRawValue, c2 as deepMerge, cm as describeGuidance, bD as domainsForCapability, d as dynamicReorder, t as dynamicTextReplace, b5 as expandResetPatches, bK as fieldsToUi, bL as filtersToUi, bE as findDomain, bZ as findPreset, cr as firstFreePosition, cd as flattenSchema, ax as formatAxisLabel, aq as formatCurrency, au as formatDate, c3 as formatForEditor, at as formatNumber, as as formatPercentage, f as formatValue, ay as formatWordsUnderBar, az as formatXAxis, u as generalConfiguration, ch as getBinding, bo as getCapabilityById, A as getColorFromConditions, c9 as getControlSchema, ar as getCurrencySuffix, cc as getFallbackControlSchema, v as getLocalizedTitle, q as getNestedData, ac as groupDatesByYearAndMonth, c0 as groupIssuesByDomain, aB as handleFilterForCard, aC as handleFilterForSnapshot, aA as handleFiltersForCustom, b$ as hasBlockingIssues, aH as isLogClassification, aM as isManagePagesDeleteResult, aN as isManagePagesDuplicateResult, z as isMobilePlatform, bQ as labelLegendFormatToUi, bO as layoutToUi, ci as listBindings, cj as listBindingsForChart, ca as listControlSchemaIds, cb as listControlSchemas, a4 as loadImmediately, a0 as loadTableCard, O as mergePropertyAppearance, bw as moduleIdFromSelector, bt as normalizeAggregateFunction, bB as normalizeBeforeRequest, bA as normalizeBeforeSave, br as normalizeChartTypeForRequest, N as normalizeDashboardCardEntityValue, bs as normalizeFilterOperation, bu as normalizeFilters, bz as normalizeOnLoad, a3 as observeNearViewport, c1 as parseAdvancedJson, bV as persistedToUi, bY as presetsForCapability, ck as readBoundValue, c5 as readByPath, bp as resolveCapability, ce as resolveDisplayFields, L as resolveEntityCheckbox, K as resolveEntityUserPhoto, X as resolveMapRegion, a8 as resolvePieInnerRadius, a7 as resolvePieShape, _ as resolveStatisticIconPlacement, bv as selectorFromLegacy, c6 as setByPath, w as sortChartData, y as sortDataTableView, bM as styleToUi, p as switchAllKeysSmall, s as switchAllKeysToLower, bH as titleToUi, bq as toBackendChartType, bx as toBackendSourceLink, by as toFormSourceLink, b_ as validate } from './masterteam-dashboard-builder-masterteam-dashboard-builder-DK1hsUEt.mjs';
2
2
  export * from '@masterteam/dashboard-builder/access';
3
3
  //# sourceMappingURL=masterteam-dashboard-builder.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@masterteam/dashboard-builder",
3
- "version": "0.0.122",
3
+ "version": "0.0.123",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/dashboard-builder",
6
6
  "linkDirectory": true,
@@ -25,10 +25,10 @@
25
25
  "tailwindcss": "^4.2.2",
26
26
  "@masterteam/components": "^0.0.346",
27
27
  "@masterteam/data-table": "^0.0.10",
28
+ "@masterteam/data-grid": "^0.0.6",
28
29
  "@masterteam/timeline": "^0.0.24",
29
30
  "@masterteam/icons": "^0.0.17",
30
- "@masterteam/faris": "^0.2.0",
31
- "@masterteam/data-grid": "^0.0.6"
31
+ "@masterteam/faris": "^0.2.0"
32
32
  },
33
33
  "dependencies": {
34
34
  "tslib": "^2.8.1",
@@ -2668,8 +2668,17 @@ declare class DashboardBuilder implements OnInit, OnDestroy {
2668
2668
  readonly previewDocument: _angular_core.WritableSignal<DashboardBuilderData | null>;
2669
2669
  readonly isReadonly: _angular_core.Signal<boolean>;
2670
2670
  readonly pendingWidgetType: _angular_core.WritableSignal<ChartTypeConfig | null>;
2671
- /** Whether the most recent action can be reverted (drives the Undo button). */
2671
+ /** Whether an unsaved action can be reverted (drives the Undo button). */
2672
2672
  readonly canUndo: _angular_core.WritableSignal<boolean>;
2673
+ /** Whether an undone action can be re-applied (drives the Redo button). */
2674
+ readonly canRedo: _angular_core.WritableSignal<boolean>;
2675
+ /**
2676
+ * The document differs from the last load or explicit Save. Drives every
2677
+ * "leave with unsaved changes" guard. Not `canUndo`: after undoing some of
2678
+ * several edits there is still unsaved work, and after undoing all of them
2679
+ * there is none.
2680
+ */
2681
+ readonly hasUnsavedChanges: _angular_core.WritableSignal<boolean>;
2673
2682
  /** Reference to widget palette drawer */
2674
2683
  private widgetPaletteRef;
2675
2684
  /** Reference to chart settings drawer */
@@ -2702,7 +2711,10 @@ declare class DashboardBuilder implements OnInit, OnDestroy {
2702
2711
  */
2703
2712
  private readonly lastItemGeometry;
2704
2713
  private readonly undoStack;
2714
+ private readonly redoStack;
2705
2715
  private readonly HISTORY_LIMIT;
2716
+ /** Signature of the document as last loaded or explicitly saved. */
2717
+ private savedSignature;
2706
2718
  /** Set by "Save and leave": leave once that explicit save commits. */
2707
2719
  private leaveAfterSave;
2708
2720
  private committedSnapshot;
@@ -2801,10 +2813,13 @@ declare class DashboardBuilder implements OnInit, OnDestroy {
2801
2813
  onDrop(event: DragEvent, item: GridsterItem): void;
2802
2814
  /**
2803
2815
  * Edits — a Style Apply included — live in the document until the top Save
2804
- * writes them. `canUndo` is true exactly while there are such edits (an
2805
- * explicit save clears it), so leaving then asks first (#1883).
2816
+ * writes them, so leaving with any of them asks first (#1883). The check is
2817
+ * "differs from the last save" (`hasUnsavedChanges`), never `canUndo`: an
2818
+ * undo of one of several edits leaves unsaved work behind.
2806
2819
  */
2807
2820
  onBeforeUnload(event: BeforeUnloadEvent): void;
2821
+ /** Unsaved changes, counting an edit still inside the history debounce. */
2822
+ private unsavedChangesNow;
2808
2823
  onBackClick(): void;
2809
2824
  /**
2810
2825
  * "Save and leave": run the normal explicit save and leave only once it has
@@ -3008,12 +3023,16 @@ declare class DashboardBuilder implements OnInit, OnDestroy {
3008
3023
  */
3009
3024
  private scheduleHistoryCapture;
3010
3025
  private captureHistory;
3026
+ private pushUndo;
3027
+ /** Mirror the stacks and the saved baseline into the toolbar signals. */
3028
+ private syncHistoryState;
3011
3029
  /** Commit a still-pending capture immediately (used right before an undo). */
3012
3030
  private flushPendingHistory;
3013
3031
  /** Drop all recorded history — called whenever a whole new document loads. */
3014
3032
  private resetHistory;
3015
3033
  /**
3016
- * Revert the most recent UNSAVED action (issue #1192).
3034
+ * Revert the most recent UNSAVED action (issue #1192), one step per call, up
3035
+ * to HISTORY_LIMIT steps back.
3017
3036
  *
3018
3037
  * Undo is a pre-save operation: it restores the previous local state and
3019
3038
  * never writes to the backend. Pressing Save is the commit point — a
@@ -3026,6 +3045,14 @@ declare class DashboardBuilder implements OnInit, OnDestroy {
3026
3045
  * which is a bug in its own right rather than part of the undone state.
3027
3046
  */
3028
3047
  undo(): void;
3048
+ /**
3049
+ * Re-apply the most recently undone action. A new edit after an undo clears
3050
+ * what can be redone (captureHistory). Same ghost-link rule as undo: an item
3051
+ * the redo drops is unlinked; an item it brings back is linked again by the
3052
+ * next save.
3053
+ */
3054
+ redo(): void;
3055
+ private restoreHistoryStep;
3029
3056
  private applyHistorySnapshot;
3030
3057
  /**
3031
3058
  * Remove backend links for items the revert dropped.
@@ -3040,7 +3067,12 @@ declare class DashboardBuilder implements OnInit, OnDestroy {
3040
3067
  * writing back `id` / `chartComponentId` is not seen as a user change.
3041
3068
  */
3042
3069
  private historySignature;
3043
- /** Shallow copy of an item without the `id` / `chartComponentId` link keys. */
3070
+ /**
3071
+ * Shallow copy of an item without the `id` / `chartComponentId` link keys and
3072
+ * the runtime-only flags (`loading`, `quickManage`), which are never saved.
3073
+ * `reRenderItem` sets `loading` on every restored chart, so leaving it in
3074
+ * made a fully undone document look different from the saved one.
3075
+ */
3044
3076
  private stripLinkIds;
3045
3077
  constructor();
3046
3078
  private applyDashboardData;
@@ -3890,7 +3922,7 @@ declare class CardFilterComponent implements OnInit {
3890
3922
  /** Language code */
3891
3923
  readonly langCode: _angular_core.Signal<string>;
3892
3924
  /** Filter type */
3893
- readonly filterType: _angular_core.Signal<"date" | "text" | "select" | "multiselect" | "multiSelect" | "daterange">;
3925
+ readonly filterType: _angular_core.Signal<"select" | "text" | "date" | "multiselect" | "multiSelect" | "daterange">;
3894
3926
  /** Filter options */
3895
3927
  readonly options: _angular_core.Signal<_masterteam_dashboard_builder.FilterOption[]>;
3896
3928
  /** Placeholder text */
@@ -4862,7 +4894,7 @@ declare class HeaderCardComponent implements OnInit, OnDestroy {
4862
4894
  /** Icon name */
4863
4895
  readonly icon: _angular_core.Signal<string>;
4864
4896
  /** Position of the layout icon relative to the header title. */
4865
- readonly iconPlacement: _angular_core.Signal<"start" | "end" | "top">;
4897
+ readonly iconPlacement: _angular_core.Signal<"end" | "start" | "top">;
4866
4898
  /** Logo configuration */
4867
4899
  readonly logo: _angular_core.Signal<any>;
4868
4900
  /** Logo URL */
@@ -5396,7 +5428,7 @@ declare class TopbarCardComponent implements OnInit, OnDestroy {
5396
5428
  readonly showSubtitle: _angular_core.Signal<boolean>;
5397
5429
  readonly icon: _angular_core.Signal<any>;
5398
5430
  /** Position of the layout icon relative to the topbar title. */
5399
- readonly iconPlacement: _angular_core.Signal<"start" | "end" | "top">;
5431
+ readonly iconPlacement: _angular_core.Signal<"end" | "start" | "top">;
5400
5432
  /**
5401
5433
  * Center the icon/title block within the topbar row
5402
5434
  * (configAsType.headerCardConfig.isHeaderCentered === true) — same source
@@ -8828,7 +8860,7 @@ declare class DataSourceSettings {
8828
8860
  * Active tab within the selection cycle: Selection (pick modules) · Source
8829
8861
  * Links (joins, only with >1 selection) · Query (fields).
8830
8862
  */
8831
- readonly activeSection: _angular_core.WritableSignal<"query" | "selection" | "sourceLinks">;
8863
+ readonly activeSection: _angular_core.WritableSignal<"selection" | "query" | "sourceLinks">;
8832
8864
  /** Selection mode inside the selection tab (informative authoring). */
8833
8865
  readonly selectionMode: _angular_core.WritableSignal<"advanced" | "context">;
8834
8866
  readonly contextTargetSelector: _angular_core.WritableSignal<string | null>;
@@ -9829,7 +9861,7 @@ interface MapRow {
9829
9861
  * boolean). Controlled: `value` in, `valueChange` out.
9830
9862
  */
9831
9863
  declare class KeyValueMapField {
9832
- readonly value: _angular_core.InputSignal<Record<string, unknown> | unknown[] | null>;
9864
+ readonly value: _angular_core.InputSignal<unknown[] | Record<string, unknown> | null>;
9833
9865
  readonly keys: _angular_core.InputSignal<ControlOption[]>;
9834
9866
  readonly valueFields: _angular_core.InputSignal<ControlField[]>;
9835
9867
  /** When true, store/read a positional array aligned to `keys` order. */
@@ -9838,7 +9870,7 @@ declare class KeyValueMapField {
9838
9870
  /** Properties Card: edit localized labels in the same positional row. */
9839
9871
  readonly integratedLabels: _angular_core.InputSignal<boolean>;
9840
9872
  readonly labelOverrides: _angular_core.InputSignal<Record<string, unknown>>;
9841
- readonly valueChange: _angular_core.OutputEmitterRef<Record<string, unknown> | unknown[]>;
9873
+ readonly valueChange: _angular_core.OutputEmitterRef<unknown[] | Record<string, unknown>>;
9842
9874
  readonly labelOverridesChange: _angular_core.OutputEmitterRef<Record<string, unknown>>;
9843
9875
  readonly rows: WritableSignal<MapRow[]>;
9844
9876
  readonly expandedRows: WritableSignal<ReadonlySet<string>>;