@masterteam/dashboard-builder 0.0.64 → 0.0.66

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,2 +1,2 @@
1
- export { az as ActionsSettings, aH as ArrayBuilderField, I as BarChartHandler, as as BarControlUi, aV as CHART_CAPABILITIES, av as CHART_TYPES, b8 as CONFIG_DOMAINS, C as CardContentComponent, q as CardFilterComponent, t as CardInfoComponent, u as ChartCardComponent, G as ChartDataService, aL as ChartFilterDrawer, ao as ChartSettingsDrawer, aA as ChartViewer, aG as ColorListField, X as ComparisonChartHandler, b as DashboardBuilder, ah as DashboardBuilderService, a as DashboardItem, D as DashboardItemStoreService, af as DashboardList, ai as DashboardStoreService, d as DashboardViewer, ay as DataSourceSettings, aR as DatasourcePanelComponent, aq as DefaultControlUi, ap as DisplaySettings, r as DynamicFiltersComponent, an as DynamicFiltersConfig, E as EChartComponent, P as EntitiesPreviewCardComponent, v as EntityInfoComponent, x as EntityPreviewCardComponent, aQ as FilterBuilderComponent, aT as FilterByGroupPipe, aP as FilterChipsBarComponent, O as GaugeChartHandler, ax as GeneralSettings, aU as GetChartActionsPipe, aO as GuidedConfigDialogComponent, ag as HTTPMethod, H as HeaderCardComponent, bS as ITEM_GUIDANCE_REGISTRY, aK as ItemCardMenuComponent, aN as ItemConfigPopoverComponent, aM as ItemContextToolbarComponent, bU as ItemGuidanceService, aI as KeyValueMapField, L as LastHistoryLevelCardComponent, aJ as LegendOrderField, Z as LevelCardHandler, V as LineChartHandler, y as ListStatisticCardComponent, al as ManageBreadcrumb, am as ManageFilterOnPage, au as ManageItem, aw as ManageItemService, ak as ManagePages, _ as MapChartHandler, R as OverviewCardHandler, bb as POPOVER_TABS, bc as POPOVER_TAB_SPECS, a1 as PhaseGateStepperHandler, J as PieChartHandler, ar as PieControlUi, P as PropertiesCardComponent, $ as RingGaugeChartHandler, a0 as SPlusChartHandler, bt as STYLE_PRESETS, aS as SchemaControlRendererComponent, aF as SegmentedField, z as SkeletonCardComponent, W as SnapshotHandler, Y as SplitterChartHandler, K as StackBarChartHandler, at as StackBarControlUi, S as StaticFiltersComponent, A as StatisticCardComponent, aE as StyleField, aC as StyleSettingsRenderer, aB as StyleStudioDrawer, T as TableCardComponent, Q as TableViewHandler, U as TimelineHandler, B as TopbarCardComponent, m as addCommasToNumber, bp as applyBehaviorToPersisted, bE as applyControlPatchToPersisted, bF as applyControlPatchesToPersisted, bq as applyFilterChipsToPersisted, bn as applyLabelLegendFormatToPersisted, bl as applyLayoutToPersisted, bj as applyStyleToPersisted, be as applyTitleToPersisted, M as axisFormatters, bo as behaviorToUi, bN as bindingKey, bs as buildAssembly, bM as buildDisplayFieldPredicate, c as cloneDeep, a7 as createAxisFormatter, a8 as createTooltipFormatter, bf as datasourceToUi, bA as deepMerge, bT as describeGuidance, b9 as domainsForCapability, h as dynamicReorder, f as dynamicTextReplace, aD as expandResetPatches, bg as fieldsToUi, bh as filtersToUi, ba as findDomain, bv as findPreset, bK as flattenSchema, a9 as formatAxisLabel, a2 as formatCurrency, a6 as formatDate, bB as formatForEditor, a5 as formatNumber, a4 as formatPercentage, j as formatValue, aa as formatWordsUnderBar, ab as formatXAxis, i as generalConfiguration, bO as getBinding, aW as getCapabilityById, p as getColorFromConditions, bG as getControlSchema, a3 as getCurrencySuffix, bJ as getFallbackControlSchema, k as getLocalizedTitle, g as getNestedData, N as groupDatesByYearAndMonth, by as groupIssuesByDomain, ad as handleFilterForCard, ae as handleFilterForSnapshot, ac as handleFiltersForCustom, bx as hasBlockingIssues, aj as isManagePagesDeleteResult, o as isMobilePlatform, bm as labelLegendFormatToUi, bk as layoutToUi, bP as listBindings, bQ as listBindingsForChart, bH as listControlSchemaIds, bI as listControlSchemas, b2 as moduleIdFromSelector, a$ as normalizeAggregateFunction, b7 as normalizeBeforeRequest, b6 as normalizeBeforeSave, aZ as normalizeChartTypeForRequest, w as normalizeDashboardCardEntityValue, a_ as normalizeFilterOperation, b0 as normalizeFilters, b5 as normalizeOnLoad, bz as parseAdvancedJson, br as persistedToUi, bu as presetsForCapability, bR as readBoundValue, bC as readByPath, aX as resolveCapability, bL as resolveDisplayFields, b1 as selectorFromLegacy, bD as setByPath, l as sortChartData, n as sortDataTableView, bi as styleToUi, e as switchAllKeysSmall, s as switchAllKeysToLower, bd as titleToUi, aY as toBackendChartType, b3 as toBackendSourceLink, b4 as toFormSourceLink, bw as validate } from './masterteam-dashboard-builder-masterteam-dashboard-builder-DX6oucEs.mjs';
1
+ export { az as ActionsSettings, aH as ArrayBuilderField, I as BarChartHandler, as as BarControlUi, aV as CHART_CAPABILITIES, av as CHART_TYPES, b8 as CONFIG_DOMAINS, C as CardContentComponent, q as CardFilterComponent, t as CardInfoComponent, u as ChartCardComponent, G as ChartDataService, aL as ChartFilterDrawer, ao as ChartSettingsDrawer, aA as ChartViewer, aG as ColorListField, X as ComparisonChartHandler, b as DashboardBuilder, ah as DashboardBuilderService, a as DashboardItem, D as DashboardItemStoreService, af as DashboardList, ai as DashboardStoreService, d as DashboardViewer, ay as DataSourceSettings, aR as DatasourcePanelComponent, aq as DefaultControlUi, ap as DisplaySettings, r as DynamicFiltersComponent, an as DynamicFiltersConfig, E as EChartComponent, P as EntitiesPreviewCardComponent, v as EntityInfoComponent, x as EntityPreviewCardComponent, aQ as FilterBuilderComponent, aT as FilterByGroupPipe, aP as FilterChipsBarComponent, O as GaugeChartHandler, ax as GeneralSettings, aU as GetChartActionsPipe, aO as GuidedConfigDialogComponent, ag as HTTPMethod, H as HeaderCardComponent, bS as ITEM_GUIDANCE_REGISTRY, aK as ItemCardMenuComponent, aN as ItemConfigPopoverComponent, aM as ItemContextToolbarComponent, bU as ItemGuidanceService, aI as KeyValueMapField, L as LastHistoryLevelCardComponent, aJ as LegendOrderField, Z as LevelCardHandler, V as LineChartHandler, y as ListStatisticCardComponent, al as ManageBreadcrumb, am as ManageFilterOnPage, au as ManageItem, aw as ManageItemService, ak as ManagePages, _ as MapChartHandler, R as OverviewCardHandler, bb as POPOVER_TABS, bc as POPOVER_TAB_SPECS, a1 as PhaseGateStepperHandler, J as PieChartHandler, ar as PieControlUi, P as PropertiesCardComponent, $ as RingGaugeChartHandler, a0 as SPlusChartHandler, bt as STYLE_PRESETS, aS as SchemaControlRendererComponent, aF as SegmentedField, z as SkeletonCardComponent, W as SnapshotHandler, Y as SplitterChartHandler, K as StackBarChartHandler, at as StackBarControlUi, S as StaticFiltersComponent, A as StatisticCardComponent, aE as StyleField, aC as StyleSettingsRenderer, aB as StyleStudioDrawer, T as TableCardComponent, Q as TableViewHandler, U as TimelineHandler, B as TopbarCardComponent, m as addCommasToNumber, bp as applyBehaviorToPersisted, bE as applyControlPatchToPersisted, bF as applyControlPatchesToPersisted, bq as applyFilterChipsToPersisted, bn as applyLabelLegendFormatToPersisted, bl as applyLayoutToPersisted, bj as applyStyleToPersisted, be as applyTitleToPersisted, M as axisFormatters, bo as behaviorToUi, bN as bindingKey, bs as buildAssembly, bM as buildDisplayFieldPredicate, c as cloneDeep, a7 as createAxisFormatter, a8 as createTooltipFormatter, bf as datasourceToUi, bA as deepMerge, bT as describeGuidance, b9 as domainsForCapability, h as dynamicReorder, f as dynamicTextReplace, aD as expandResetPatches, bg as fieldsToUi, bh as filtersToUi, ba as findDomain, bv as findPreset, bK as flattenSchema, a9 as formatAxisLabel, a2 as formatCurrency, a6 as formatDate, bB as formatForEditor, a5 as formatNumber, a4 as formatPercentage, j as formatValue, aa as formatWordsUnderBar, ab as formatXAxis, i as generalConfiguration, bO as getBinding, aW as getCapabilityById, p as getColorFromConditions, bG as getControlSchema, a3 as getCurrencySuffix, bJ as getFallbackControlSchema, k as getLocalizedTitle, g as getNestedData, N as groupDatesByYearAndMonth, by as groupIssuesByDomain, ad as handleFilterForCard, ae as handleFilterForSnapshot, ac as handleFiltersForCustom, bx as hasBlockingIssues, aj as isManagePagesDeleteResult, o as isMobilePlatform, bm as labelLegendFormatToUi, bk as layoutToUi, bP as listBindings, bQ as listBindingsForChart, bH as listControlSchemaIds, bI as listControlSchemas, b2 as moduleIdFromSelector, a$ as normalizeAggregateFunction, b7 as normalizeBeforeRequest, b6 as normalizeBeforeSave, aZ as normalizeChartTypeForRequest, w as normalizeDashboardCardEntityValue, a_ as normalizeFilterOperation, b0 as normalizeFilters, b5 as normalizeOnLoad, bz as parseAdvancedJson, br as persistedToUi, bu as presetsForCapability, bR as readBoundValue, bC as readByPath, aX as resolveCapability, bL as resolveDisplayFields, b1 as selectorFromLegacy, bD as setByPath, l as sortChartData, n as sortDataTableView, bi as styleToUi, e as switchAllKeysSmall, s as switchAllKeysToLower, bd as titleToUi, aY as toBackendChartType, b3 as toBackendSourceLink, b4 as toFormSourceLink, bw as validate } from './masterteam-dashboard-builder-masterteam-dashboard-builder-m0O-Y4lO.mjs';
2
2
  //# 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.64",
3
+ "version": "0.0.66",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/dashboard-builder",
6
6
  "linkDirectory": true,
@@ -23,10 +23,10 @@
23
23
  "quill": "^2.0.3",
24
24
  "rxjs": "^7.8.2",
25
25
  "tailwindcss": "^4.2.2",
26
- "@masterteam/components": "^0.0.230",
27
- "@masterteam/icons": "^0.0.17",
26
+ "@masterteam/components": "^0.0.232",
27
+ "@masterteam/timeline": "^0.0.19",
28
28
  "@masterteam/formula-builder": "^0.0.27",
29
- "@masterteam/timeline": "^0.0.19"
29
+ "@masterteam/icons": "^0.0.17"
30
30
  },
31
31
  "dependencies": {
32
32
  "tslib": "^2.8.1",
@@ -2409,6 +2409,8 @@ declare class DashboardBuilder implements OnInit, OnDestroy {
2409
2409
  }>;
2410
2410
  readonly stopActionsOnCards: _angular_core.WritableSignal<boolean>;
2411
2411
  readonly pendingWidgetType: _angular_core.WritableSignal<ChartTypeConfig | null>;
2412
+ /** Whether the most recent action can be reverted (drives the Undo button). */
2413
+ readonly canUndo: _angular_core.WritableSignal<boolean>;
2412
2414
  /** Reference to widget palette drawer */
2413
2415
  private widgetPaletteRef;
2414
2416
  /** Reference to chart settings drawer */
@@ -2427,6 +2429,11 @@ declare class DashboardBuilder implements OnInit, OnDestroy {
2427
2429
  private lastExtraFiltersSignature;
2428
2430
  private lastLoadedPageKey;
2429
2431
  private lastStandaloneDashboardSignature;
2432
+ private readonly undoStack;
2433
+ private readonly HISTORY_LIMIT;
2434
+ private committedSnapshot;
2435
+ private committedSignature;
2436
+ private historyDebounce;
2430
2437
  private readonly boundHandleDragOver;
2431
2438
  private readonly boundHandleDrop;
2432
2439
  private readonly boundHandleDragEnd;
@@ -2619,6 +2626,46 @@ declare class DashboardBuilder implements OnInit, OnDestroy {
2619
2626
  private startAutoScroll;
2620
2627
  private stopAutoScroll;
2621
2628
  private refreshAllItems;
2629
+ /**
2630
+ * Debounced recorder for the edit-history stack. Every editable-document
2631
+ * change (add/delete a chart, move/resize, style/property edits, filters,
2632
+ * data source / layout) flows through the four document signals, so a single
2633
+ * effect watching them captures them all. Rapid bursts — a drag, a slider
2634
+ * sweep — coalesce into one undo step via the debounce.
2635
+ */
2636
+ private scheduleHistoryCapture;
2637
+ private captureHistory;
2638
+ /** Commit a still-pending capture immediately (used right before an undo). */
2639
+ private flushPendingHistory;
2640
+ /** Drop all recorded history — called whenever a whole new document loads. */
2641
+ private resetHistory;
2642
+ /**
2643
+ * Revert the most recent action, restoring the dashboard to its previous
2644
+ * state, re-pushing the reverted config into every mounted widget, and
2645
+ * persisting the reverted document. Persistence matters because most actions
2646
+ * auto-save (`saveDash({ silent: true })`), so a local-only revert would be
2647
+ * overwritten on the next reload — the undo has to roll the SAVED state back
2648
+ * too (issue #1192).
2649
+ */
2650
+ undo(): void;
2651
+ /**
2652
+ * Roll the reverted document back to the server: unlink chart/dialog links
2653
+ * the undo removed, re-save the restored charts/dialogs, and — only when they
2654
+ * actually changed — rewrite the page filters. Each write is gated on a real
2655
+ * diff so a layout/style undo doesn't rewrite filters and vice-versa.
2656
+ */
2657
+ private persistUndo;
2658
+ /** Serialize page filters for change detection (normalized, order-stable). */
2659
+ private serializeFilters;
2660
+ /** Serialize items ignoring link ids so persistence metadata isn't compared. */
2661
+ private serializeItems;
2662
+ /**
2663
+ * Content signature of the whole document with link ids stripped, so a save
2664
+ * writing back `id` / `chartComponentId` is not seen as a user change.
2665
+ */
2666
+ private historySignature;
2667
+ /** Shallow copy of an item without the `id` / `chartComponentId` link keys. */
2668
+ private stripLinkIds;
2622
2669
  constructor();
2623
2670
  private applyDashboardData;
2624
2671
  private emitDashboardDataChange;
@@ -3415,7 +3462,7 @@ declare class CardFilterComponent implements OnInit {
3415
3462
  /** Language code */
3416
3463
  readonly langCode: _angular_core.Signal<string>;
3417
3464
  /** Filter type */
3418
- readonly filterType: _angular_core.Signal<"text" | "select" | "multiselect" | "date" | "multiSelect" | "daterange">;
3465
+ readonly filterType: _angular_core.Signal<"date" | "text" | "select" | "multiselect" | "multiSelect" | "daterange">;
3419
3466
  /** Filter options */
3420
3467
  readonly options: _angular_core.Signal<_masterteam_dashboard_builder.FilterOption[]>;
3421
3468
  /** Placeholder text */
@@ -3644,7 +3691,7 @@ declare class ChartCardComponent implements OnInit, OnDestroy {
3644
3691
  /** Whether the user can act on the Configure CTA (builder mode). */
3645
3692
  readonly canConfigure: _angular_core.Signal<boolean>;
3646
3693
  readonly hasSplitterData: _angular_core.Signal<boolean>;
3647
- readonly splitterOrientation: _angular_core.Signal<"vertical" | "horizontal">;
3694
+ readonly splitterOrientation: _angular_core.Signal<"horizontal" | "vertical">;
3648
3695
  readonly splitterGap: _angular_core.Signal<number>;
3649
3696
  readonly hasTimelineData: _angular_core.Signal<boolean>;
3650
3697
  readonly timelineEvents: _angular_core.Signal<any[]>;
@@ -3778,7 +3825,7 @@ declare class EChartComponent implements OnInit, AfterViewInit, OnChanges, OnDes
3778
3825
  readonly showCustomLegend: _angular_core.Signal<boolean>;
3779
3826
  readonly customLegendIconIsRect: _angular_core.Signal<boolean>;
3780
3827
  /** Custom HTML legend placement from the configured legend position. */
3781
- readonly customLegendPosition: _angular_core.Signal<"top" | "right" | "bottom" | "left">;
3828
+ readonly customLegendPosition: _angular_core.Signal<"right" | "left" | "top" | "bottom">;
3782
3829
  constructor();
3783
3830
  ngOnInit(): Promise<void>;
3784
3831
  ngAfterViewInit(): void;
@@ -4550,6 +4597,7 @@ declare class TableCardComponent implements OnInit, OnDestroy {
4550
4597
  private resolveLegacyPhaseGateAlias;
4551
4598
  private resolveLegacyFieldByViewType;
4552
4599
  private getPhaseGateFieldValue;
4600
+ private getPhaseGateIdentityText;
4553
4601
  private isConfiguredPhaseMetadataField;
4554
4602
  private isLegacyPhaseGateMetaField;
4555
4603
  private toPhaseColumnKey;
@@ -7770,7 +7818,7 @@ declare class DataSourceSettings {
7770
7818
  * tabs: build a selection-based query OR fetch from a custom API endpoint.
7771
7819
  * Picking one hides the other.
7772
7820
  */
7773
- readonly dataSourceMode: _angular_core.WritableSignal<"customApi" | "selection">;
7821
+ readonly dataSourceMode: _angular_core.WritableSignal<"selection" | "customApi">;
7774
7822
  /**
7775
7823
  * Active tab within the selection cycle: Selection (pick modules) · Source
7776
7824
  * Links (joins, only with >1 selection) · Query (fields).
@@ -8599,12 +8647,12 @@ interface MapRow {
8599
8647
  * boolean). Controlled: `value` in, `valueChange` out.
8600
8648
  */
8601
8649
  declare class KeyValueMapField {
8602
- readonly value: _angular_core.InputSignal<Record<string, unknown> | unknown[] | null>;
8650
+ readonly value: _angular_core.InputSignal<unknown[] | Record<string, unknown> | null>;
8603
8651
  readonly keys: _angular_core.InputSignal<ControlOption[]>;
8604
8652
  readonly valueFields: _angular_core.InputSignal<ControlField[]>;
8605
8653
  /** When true, store/read a positional array aligned to `keys` order. */
8606
8654
  readonly asArray: _angular_core.InputSignal<boolean>;
8607
- readonly valueChange: _angular_core.OutputEmitterRef<Record<string, unknown> | unknown[]>;
8655
+ readonly valueChange: _angular_core.OutputEmitterRef<unknown[] | Record<string, unknown>>;
8608
8656
  readonly rows: _angular_core.WritableSignal<MapRow[]>;
8609
8657
  private readonly destroyRef;
8610
8658
  /** Subscriptions for the current row set; torn down on every rebuild. */