@masterteam/dashboard-builder 0.0.63 → 0.0.65

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-BoSluyWN.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-IEywWDbR.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.63",
3
+ "version": "0.0.65",
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/timeline": "^0.0.19",
26
+ "@masterteam/formula-builder": "^0.0.27",
28
27
  "@masterteam/icons": "^0.0.17",
29
- "@masterteam/formula-builder": "^0.0.27"
28
+ "@masterteam/components": "^0.0.231",
29
+ "@masterteam/timeline": "^0.0.19"
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;
@@ -4445,6 +4492,18 @@ declare class TableCardComponent implements OnInit, OnDestroy {
4445
4492
  readonly title: _angular_core.Signal<string>;
4446
4493
  /** Table style config */
4447
4494
  readonly tableStyleConfig: _angular_core.Signal<TableStyleConfig | null>;
4495
+ /** Last applied `column|direction` signature, to ignore unrelated edits. */
4496
+ private lastSortSig;
4497
+ /**
4498
+ * Re-apply the configured sort live whenever `tableFormat.sortConfig`
4499
+ * changes. buildTable() only sorts on data load, so edits to the sort
4500
+ * column/direction in the settings drawer would otherwise not reflect in the
4501
+ * preview until the next data refresh. Reads/writes of rows + columns run
4502
+ * untracked so this never loops, and a signature guard skips unrelated config
4503
+ * edits (colors, labels) plus manual header sorts, which don't touch the
4504
+ * persisted sort config.
4505
+ */
4506
+ private readonly _sortConfigSync;
4448
4507
  /**
4449
4508
  * Hide the table's column-header (subheader) row.
4450
4509
  * Reads `clientConfig.tableFormat.hideTableSubheader`. Gated: defaults to
@@ -8468,6 +8527,12 @@ declare class StyleField {
8468
8527
  readLegendColorOverrides(): Record<string, unknown>;
8469
8528
  readJson(): string;
8470
8529
  emitValue(value: unknown): void;
8530
+ /**
8531
+ * When the top border is switched on and no top-border color is stored yet,
8532
+ * emit one derived from the current "Border color" value (or the schema
8533
+ * default) so the border color matches what the picker displays.
8534
+ */
8535
+ private seedTopBorderColor;
8471
8536
  onLegendColorChange(change: LegendColorChange): void;
8472
8537
  onJsonInput(raw: string): void;
8473
8538
  private emitScalar;