@adaptabletools/adaptable 24.0.0-canary.5 → 24.0.0-canary.7

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.
Files changed (138) hide show
  1. package/devtools.d.ts +182 -1
  2. package/index.css +300 -275
  3. package/package.json +2 -1
  4. package/src/AdaptableInterfaces/IAdaptable.d.ts +4 -4
  5. package/src/AdaptableOptions/DefaultAdaptableOptions.js +5 -5
  6. package/src/AdaptableOptions/FlashingCellOptions.d.ts +3 -3
  7. package/src/AdaptableOptions/SettingsPanelOptions.d.ts +6 -4
  8. package/src/AdaptableOptions/StateOptions.d.ts +37 -13
  9. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +4 -6
  10. package/src/AdaptableState/AdaptableState.d.ts +2 -0
  11. package/src/AdaptableState/QuickSearchState.d.ts +4 -0
  12. package/src/AdaptableState/StyledColumns/GradientStyle.d.ts +4 -0
  13. package/src/Api/Implementation/ColumnScopeApiImpl.js +3 -3
  14. package/src/Api/Implementation/QuickSearchApiImpl.js +2 -2
  15. package/src/Api/Implementation/StateApiImpl.d.ts +1 -1
  16. package/src/Api/Implementation/StateApiImpl.js +4 -3
  17. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +0 -1
  18. package/src/Api/Implementation/UserInterfaceApiImpl.js +9 -15
  19. package/src/Api/Internal/AdaptableInternalApi.js +5 -3
  20. package/src/Api/Internal/CalculatedColumnInternalApi.js +1 -1
  21. package/src/Api/Internal/StateInternalApi.d.ts +1 -1
  22. package/src/Api/Internal/StateInternalApi.js +6 -5
  23. package/src/Api/StateApi.d.ts +2 -2
  24. package/src/Api/UserInterfaceApi.d.ts +0 -4
  25. package/src/Redux/ActionsReducers/QuickSearchRedux.d.ts +9 -4
  26. package/src/Redux/ActionsReducers/QuickSearchRedux.js +12 -7
  27. package/src/Redux/Store/AdaptableReduxLocalStorageEngine.d.ts +8 -0
  28. package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +12 -12
  29. package/src/Redux/Store/AdaptableStore.d.ts +8 -5
  30. package/src/Redux/Store/AdaptableStore.js +51 -21
  31. package/src/Redux/Store/Interface/IAdaptableStore.d.ts +5 -5
  32. package/src/Redux/Store/Interface/IStorageEngine.d.ts +4 -4
  33. package/src/Redux/Store/StateOptionsGuards.d.ts +58 -0
  34. package/src/Redux/Store/StateOptionsGuards.js +112 -0
  35. package/src/Redux/Store/isTransientReduxAction.d.ts +5 -0
  36. package/src/Redux/Store/isTransientReduxAction.js +19 -0
  37. package/src/Utilities/Constants/DocumentationLinkConstants.d.ts +1 -0
  38. package/src/Utilities/Constants/DocumentationLinkConstants.js +1 -0
  39. package/src/Utilities/Constants/ReduxConstants.d.ts +2 -2
  40. package/src/Utilities/Constants/ReduxConstants.js +5 -5
  41. package/src/Utilities/Helpers/AlertTypeHelper.d.ts +1 -1
  42. package/src/Utilities/Helpers/SettingsPanelHelper.d.ts +14 -0
  43. package/src/Utilities/Helpers/SettingsPanelHelper.js +37 -1
  44. package/src/Utilities/Helpers/UIHelper.d.ts +12 -14
  45. package/src/Utilities/Helpers/UIHelper.js +12 -35
  46. package/src/Utilities/ObjectFactory.js +3 -3
  47. package/src/View/Components/Popups/AdaptablePopup/Navigation.js +9 -11
  48. package/src/View/Components/StyleComponent.js +2 -2
  49. package/src/View/Dashboard/Dashboard.d.ts +1 -1
  50. package/src/View/Dashboard/Dashboard.js +1 -1
  51. package/src/View/Dashboard/DashboardPopupSections.js +1 -1
  52. package/src/View/GridInfo/GridInfoPopup.js +62 -25
  53. package/src/View/QuickSearch/QuickSearchInput.js +1 -1
  54. package/src/View/QuickSearch/QuickSearchPopup.d.ts +1 -1
  55. package/src/View/QuickSearch/QuickSearchPopup.js +1 -1
  56. package/src/View/QuickSearch/Utilities/useQuickSearchDebounced.d.ts +2 -2
  57. package/src/View/StyledColumn/RangesComponent.js +13 -16
  58. package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +0 -2
  59. package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +2 -2
  60. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +2 -3
  61. package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.d.ts +0 -3
  62. package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +3 -3
  63. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +7 -11
  64. package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +6 -6
  65. package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +2 -2
  66. package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +2 -2
  67. package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +8 -8
  68. package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +4 -4
  69. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardRangesSection.js +2 -2
  70. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +4 -4
  71. package/src/View/Wizard/CollapsibleWizardCard.d.ts +3 -1
  72. package/src/View/Wizard/CollapsibleWizardCard.js +17 -9
  73. package/src/agGrid/AdaptableAgGrid.d.ts +4 -4
  74. package/src/agGrid/AdaptableAgGrid.js +2 -0
  75. package/src/agGrid/AgGridColumnAdapter.d.ts +1 -1
  76. package/src/agGrid/AgGridColumnAdapter.js +4 -4
  77. package/src/components/ColorField/index.d.ts +14 -0
  78. package/src/components/ColorField/index.js +6 -0
  79. package/src/components/aql/QueryBuilder/QueryBuilderInputs.js +1 -1
  80. package/src/env.js +2 -2
  81. package/src/layout-manager/src/normalizeLayoutModel.d.ts +1 -1
  82. package/src/layout-manager/src/simplifyLayoutModel.d.ts +1 -1
  83. package/src/migration/AdaptableUpgradeHelper.d.ts +7 -2
  84. package/src/migration/VersionUpgrade17.js +13 -8
  85. package/src/migration/VersionUpgrade24.d.ts +9 -0
  86. package/src/migration/VersionUpgrade24.js +27 -0
  87. package/src/setupDevTools.js +605 -112
  88. package/src/types.d.ts +1 -1
  89. package/tsconfig.esm.tsbuildinfo +1 -1
  90. package/vendor/components/Button/index.d.ts +1 -1
  91. package/vendor/components/Button/index.d.ts.map +1 -1
  92. package/vendor/components/Button/index.js.map +1 -1
  93. package/vendor/components/CheckBox/index.d.ts +1 -1
  94. package/vendor/components/CheckBox/index.d.ts.map +1 -1
  95. package/vendor/components/CheckBox/index.js.map +1 -1
  96. package/vendor/components/ColorField/index.d.ts +43 -0
  97. package/vendor/components/ColorField/index.d.ts.map +1 -0
  98. package/vendor/components/ColorField/index.js +81 -0
  99. package/vendor/components/ColorField/index.js.map +1 -0
  100. package/vendor/components/ColorPicker/colorPickerTab.d.ts +4 -0
  101. package/vendor/components/ColorPicker/colorPickerTab.d.ts.map +1 -0
  102. package/vendor/components/ColorPicker/colorPickerTab.js +28 -0
  103. package/vendor/components/ColorPicker/colorPickerTab.js.map +1 -0
  104. package/vendor/components/ColorPicker/index.d.ts +59 -0
  105. package/vendor/components/ColorPicker/index.d.ts.map +1 -0
  106. package/vendor/components/ColorPicker/index.js +204 -0
  107. package/vendor/components/ColorPicker/index.js.map +1 -0
  108. package/vendor/components/ColorPicker/themeColors.d.ts +53 -0
  109. package/vendor/components/ColorPicker/themeColors.d.ts.map +1 -0
  110. package/vendor/components/ColorPicker/themeColors.js +110 -0
  111. package/vendor/components/ColorPicker/themeColors.js.map +1 -0
  112. package/vendor/components/Combobox/VirtualizedList.d.ts +1 -1
  113. package/vendor/components/Combobox/VirtualizedList.d.ts.map +1 -1
  114. package/vendor/components/Combobox/VirtualizedList.js.map +1 -1
  115. package/vendor/components/Combobox/index.d.ts +1 -1
  116. package/vendor/components/Combobox/index.d.ts.map +1 -1
  117. package/vendor/components/Combobox/index.js.map +1 -1
  118. package/vendor/components/NumberInput/index.d.ts +51 -0
  119. package/vendor/components/NumberInput/index.d.ts.map +1 -0
  120. package/vendor/components/NumberInput/index.js +82 -0
  121. package/vendor/components/NumberInput/index.js.map +1 -0
  122. package/vendor/components/index.css +280 -24
  123. package/vendor/components/index.d.ts +6 -0
  124. package/vendor/components/index.d.ts.map +1 -1
  125. package/vendor/components/index.js +3 -0
  126. package/vendor/components/index.js.map +1 -1
  127. package/vendor/components/ui/combobox.d.ts.map +1 -1
  128. package/vendor/components/ui/combobox.js +1 -1
  129. package/vendor/components/ui/combobox.js.map +1 -1
  130. package/vendor/components/ui/input-group.d.ts.map +1 -1
  131. package/vendor/components/ui/input-group.js +5 -4
  132. package/vendor/components/ui/input-group.js.map +1 -1
  133. package/src/components/ColorPicker/ColorPicker.d.ts +0 -12
  134. package/src/components/ColorPicker/ColorPicker.js +0 -48
  135. package/src/components/ColorPicker/OptionalColorPicker.d.ts +0 -12
  136. package/src/components/ColorPicker/OptionalColorPicker.js +0 -13
  137. package/src/components/ColorPicker/index.d.ts +0 -2
  138. package/src/components/ColorPicker/index.js +0 -2
@@ -21,28 +21,36 @@ export function renderCompactAccentTags(ids, getLabel, options) {
21
21
  return (_jsxs(Flex, { alignItems: "center", className: "twa:gap-1 twa:min-w-0 twa:overflow-hidden", children: [visibleIds.map((id) => (_jsx(AccentTag, { className: "twa:shrink-0", children: getLabel(id) }, id))), remainder > 0 ? (_jsxs("span", { className: "twa:text-xs twa:opacity-70 twa:shrink-0", children: ["+", remainder] })) : null] }));
22
22
  }
23
23
  export const CollapsibleWizardCard = (props) => {
24
- const { title, help, collapsedHelp, summary, compactSummary, compactSummaryInteractive = false, headerVisual, headerActions, children, defaultExpanded = false, compact = false, fillAvailable = false, className, bodyClassName, surface = 'popup', 'data-name': dataName, } = props;
24
+ const { title, help, collapsedHelp, summary, compactSummary, compactSummaryInteractive = false, headerVisual, headerActions, children, collapsible = true, defaultExpanded = false, compact = false, fillAvailable = false, className, bodyClassName, surface = 'popup', 'data-name': dataName, } = props;
25
25
  const [expanded, setExpanded] = useProperty(props, 'expanded', defaultExpanded, {
26
26
  onChange: props.onExpandedChange,
27
27
  });
28
- const showSummary = !expanded && !compact;
28
+ const canToggle = collapsible;
29
+ const isExpanded = canToggle && expanded;
30
+ const isCompact = canToggle && compact;
31
+ const showSummary = !isExpanded && !isCompact;
29
32
  const collapsedHeaderInline = collapsedHelp === false ? undefined : collapsedHelp ?? help;
30
- const headerInline = expanded ? help : compact ? compactSummary : collapsedHeaderInline;
31
- const isInteractiveCompactSummary = compact && compactSummaryInteractive;
32
- const toggleExpanded = () => setExpanded(!expanded);
33
+ const headerInline = isExpanded ? help : isCompact ? compactSummary : collapsedHeaderInline;
34
+ const isInteractiveCompactSummary = isCompact && compactSummaryInteractive;
35
+ const toggleExpanded = () => {
36
+ if (!canToggle) {
37
+ return;
38
+ }
39
+ setExpanded(!expanded);
40
+ };
33
41
  const handleTitleKeyDown = (event) => {
34
42
  if (event.key === 'Enter' || event.key === ' ') {
35
43
  event.preventDefault();
36
44
  toggleExpanded();
37
45
  }
38
46
  };
39
- return (_jsxs(Card, { shadow: false, className: cn('ab-CollapsibleWizardCard twa:border twa:transition-[border-color,background-color]', expanded
47
+ return (_jsxs(Card, { shadow: false, className: cn('ab-CollapsibleWizardCard twa:border twa:transition-[border-color,background-color]', isExpanded
40
48
  ? getCollapsibleWizardCardExpandedClasses(surface)
41
- : getCollapsibleWizardCardCollapsedClasses(surface), compact && 'ab-CollapsibleWizardCard--compact twa:p-0!', fillAvailable
49
+ : getCollapsibleWizardCardCollapsedClasses(surface), isCompact && 'ab-CollapsibleWizardCard--compact twa:p-0!', fillAvailable
42
50
  ? 'twa:flex-1 twa:min-h-0 twa:flex twa:flex-col twa:overflow-hidden'
43
- : 'twa:shrink-0', className), children: [_jsx(Card.Title, { className: "twa:p-0", border: !compact, children: _jsxs(Box, { className: cn('twa:flex twa:flex-row twa:items-center twa:gap-2 twa:w-full twa:px-2 twa:cursor-pointer twa:rounded-standard twa:hover:bg-primary', { 'twa:py-2': true, 'twa:mb-0.5': !compact && !expanded }, targetOwn.focusOutline, 'twa:focus-visible:ring-inset'), "data-name": dataName, onClick: toggleExpanded, onKeyDown: handleTitleKeyDown, tabIndex: 0, "aria-expanded": expanded, role: "button", children: [_jsxs(Box, { className: "twa:flex twa:flex-row twa:items-center twa:gap-2 twa:shrink-0 twa:cursor-pointer twa:select-none", children: [_jsx(IconComponent, { icon: { name: expanded ? 'collapse' : 'expand' } }), _jsx(Box, { className: "twa:font-medium", children: title })] }), headerVisual ? (_jsx(Box, { className: "twa:flex-1 twa:min-w-0 twa:flex twa:justify-end twa:items-center twa:overflow-hidden twa:pointer-events-none", children: headerVisual })) : headerInline ? (_jsx(Box, { className: cn('twa:flex-1 twa:min-w-0 twa:font-normal', isInteractiveCompactSummary
51
+ : 'twa:shrink-0', className), children: [_jsx(Card.Title, { className: "twa:p-0", border: !isCompact, children: _jsxs(Box, { className: cn('twa:flex twa:flex-row twa:items-center twa:gap-2 twa:w-full twa:px-2 twa:rounded-standard', canToggle && 'twa:cursor-pointer twa:hover:bg-primary', { 'twa:py-2': true, 'twa:mb-0.5': !isCompact && !isExpanded }, canToggle && targetOwn.focusOutline, canToggle && 'twa:focus-visible:ring-inset'), "data-name": dataName, onClick: canToggle ? toggleExpanded : undefined, onKeyDown: canToggle ? handleTitleKeyDown : undefined, tabIndex: canToggle ? 0 : undefined, "aria-expanded": canToggle ? isExpanded : undefined, role: canToggle ? 'button' : undefined, children: [_jsxs(Box, { className: cn('twa:flex twa:flex-row twa:items-center twa:gap-2 twa:shrink-0 twa:select-none', canToggle && 'twa:cursor-pointer'), children: [canToggle ? (_jsx(IconComponent, { icon: { name: isExpanded ? 'collapse' : 'expand' } })) : null, _jsx(Box, { className: "twa:font-medium", children: title })] }), headerVisual ? (_jsx(Box, { className: "twa:flex-1 twa:min-w-0 twa:flex twa:justify-end twa:items-center twa:overflow-hidden twa:pointer-events-none", children: headerVisual })) : headerInline ? (_jsx(Box, { className: cn('twa:flex-1 twa:min-w-0 twa:font-normal', isInteractiveCompactSummary
44
52
  ? 'twa:flex twa:justify-end twa:items-center twa:overflow-visible'
45
- : cn('twa:text-xs twa:opacity-70 twa:pointer-events-none twa:cursor-default', compact ? 'twa:overflow-hidden' : 'twa:truncate')), children: headerInline })) : (_jsx(Box, { className: "twa:flex-1 twa:min-w-0" })), headerActions ? (_jsx(Box, { className: "twa:shrink-0 twa:gap-2 twa:flex", onClick: (event) => event.stopPropagation(), children: headerActions })) : null] }) }), expanded ? (_jsx(Card.Body, { className: cn('twa:p-1', bodyClassName, fillAvailable && 'twa:max-h-none! twa:flex-1 twa:min-h-0'), children: children })) : showSummary ? (_jsx(Card.Body, { className: "twa:p-1", gap: 1, children: summary })) : null] }));
53
+ : cn('twa:text-xs twa:opacity-70 twa:pointer-events-none twa:cursor-default', isCompact ? 'twa:overflow-hidden' : 'twa:truncate')), children: headerInline })) : (_jsx(Box, { className: "twa:flex-1 twa:min-w-0" })), headerActions ? (_jsx(Box, { className: "twa:shrink-0 twa:gap-2 twa:flex", onClick: (event) => event.stopPropagation(), children: headerActions })) : null] }) }), isExpanded ? (_jsx(Card.Body, { className: cn('twa:p-1', bodyClassName, fillAvailable && 'twa:max-h-none! twa:flex-1 twa:min-h-0'), children: children })) : showSummary ? (_jsx(Card.Body, { className: "twa:p-1", gap: 1, children: summary })) : null] }));
46
54
  };
47
55
  export function useWizardCardAccordion(initialExpandedId, options) {
48
56
  const fillExpandedCard = options?.fillExpandedCard ?? false;
@@ -7,7 +7,7 @@ import { EmitterCallback } from '../Utilities/Emitter';
7
7
  import { AdaptablePlugin } from '../AdaptableOptions/AdaptablePlugin';
8
8
  import { AgGridAdapter, RowNodeEvent } from './AgGridAdapter';
9
9
  import { IDataService } from '../Utilities/Services/Interface/IDataService';
10
- import { AdaptableState } from '../AdaptableState/AdaptableState';
10
+ import { AdaptablePersistentState } from '../AdaptableState/AdaptableState';
11
11
  import { IAdaptableStore } from '../Redux/Store/Interface/IAdaptableStore';
12
12
  import { ICalculatedColumnExpressionService } from '../Utilities/Services/Interface/ICalculatedColumnExpressionService';
13
13
  import { IModuleService } from '../Utilities/Services/Interface/IModuleService';
@@ -157,9 +157,9 @@ export declare class AdaptableAgGrid implements IAdaptable {
157
157
  static _initInternal(config: AdaptableInitInternalConfig): Promise<AdaptableApi>;
158
158
  private _initAdaptableAgGrid;
159
159
  midwayDestroy(): void;
160
- migrateLoadedAdaptableState(state: AdaptableState): AdaptableState;
161
- buildPostLoadHook(gridOptions: NormalizeAdaptableStateOptions): (state: AdaptableState) => AdaptableState;
162
- normalizeAdaptableState(state: AdaptableState, agGridOptions: NormalizeAdaptableStateOptions): AdaptableState;
160
+ migrateLoadedAdaptableState<T extends Partial<AdaptablePersistentState>>(state: T): T;
161
+ buildPostLoadHook(gridOptions: NormalizeAdaptableStateOptions): (state: Partial<AdaptablePersistentState>) => Partial<AdaptablePersistentState>;
162
+ normalizeAdaptableState(state: Partial<AdaptablePersistentState>, agGridOptions: NormalizeAdaptableStateOptions): Partial<AdaptablePersistentState>;
163
163
  private normaliseLayoutState;
164
164
  private normaliseToolPanelState;
165
165
  private getCurrentLayoutModel;
@@ -15,6 +15,7 @@ import { AG_GRID_GRAND_TOTAL_ROW_ID, AG_GRID_GROUPED_COLUMN, AG_GRID_SELECTION_C
15
15
  import { generateSelectionColumn } from '../Api/Implementation/ColumnApiImpl';
16
16
  import { DataService } from '../Utilities/Services/DataService';
17
17
  import { AdaptableStore } from '../Redux/Store/AdaptableStore';
18
+ import { validateStateOptions } from '../Redux/Store/StateOptionsGuards';
18
19
  import { AdaptableApiImpl } from '../Api/Implementation/AdaptableApiImpl';
19
20
  import { Fdc3Service } from '../Utilities/Services/Fdc3Service';
20
21
  import { CommentsService } from '../Utilities/Services/CommentsService';
@@ -739,6 +740,7 @@ export class AdaptableAgGrid {
739
740
  }
740
741
  }
741
742
  normalizeAdaptableOptions(adaptableOptions) {
743
+ validateStateOptions(adaptableOptions.stateOptions, this.logger);
742
744
  if (this.hasAutogeneratedPrimaryKey) {
743
745
  this.logger.warn(`Autogenerated primary key is enabled (adaptableOptions.autogeneratedPrimaryKey = true). This should be a last resort as it limits some Adaptable features. See: ${PrimaryKeyDocsLink}`);
744
746
  this.adaptableOptions.primaryKey = AUTOGENERATED_PK_COLUMN;
@@ -88,7 +88,7 @@ export declare class AgGridColumnAdapter {
88
88
  private setupColumnHeaderStyle;
89
89
  private setupColumnCellEditor;
90
90
  private setupColumnCellRenderer;
91
- private setupColumnTooltipValueGetter;
91
+ private setupColumnTooltip;
92
92
  /**
93
93
  * Resolves a Range Bar bound (number / column id / Col-Min / Col-Max /
94
94
  * Col-Avg / Col-Median) into a concrete numeric value for the supplied row.
@@ -67,7 +67,7 @@ const STABLE_CALLBACK_COL_DEF_PROPERTIES = new Set([
67
67
  'pivotComparator',
68
68
  'getFindText',
69
69
  'getQuickFilterText',
70
- 'tooltipValueGetter',
70
+ 'tooltip',
71
71
  'cellEditorParams',
72
72
  'suppressNoteActions',
73
73
  ]);
@@ -333,7 +333,7 @@ export class AgGridColumnAdapter {
333
333
  this.setupColumnHeaderStyle(colSetupInfo);
334
334
  this.setupColumnHeaderClass(colSetupInfo);
335
335
  this.setupColumnValueGetter(colSetupInfo);
336
- this.setupColumnTooltipValueGetter(colSetupInfo);
336
+ this.setupColumnTooltip(colSetupInfo);
337
337
  if (!isAutoRowGroupColumn) {
338
338
  this.setupColumnFilter(colSetupInfo);
339
339
  this.setupColumnFloatingFilter(colSetupInfo);
@@ -676,9 +676,9 @@ export class AgGridColumnAdapter {
676
676
  }
677
677
  });
678
678
  }
679
- setupColumnTooltipValueGetter({ col, colId, abColumn }) {
679
+ setupColumnTooltip({ col, colId, abColumn }) {
680
680
  let hasTooptip = false;
681
- this.setColDefProperty(col, 'tooltipValueGetter', () => {
681
+ this.setColDefProperty(col, 'tooltip', () => {
682
682
  const styledColumn = this.adaptableApi.styledColumnApi.getStyledColumnForColumnId(colId);
683
683
  if (!styledColumn || styledColumn.IsSuspended) {
684
684
  return undefined;
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import { type ColorFieldProps as SharedColorFieldProps } from "../../../vendor/components/ColorField";
3
+ export type ColorFieldProps = Omit<SharedColorFieldProps, 'onChange' | 'clearable' | 'data-name'> & {
4
+ 'data-name'?: string;
5
+ } & ({
6
+ clearable?: true;
7
+ onChange: (color: string | undefined) => void;
8
+ } | {
9
+ /** The colour is required, so there is no clear button and `onChange` always gets one. */
10
+ clearable: false;
11
+ onChange: (color: string) => void;
12
+ });
13
+ /** The shared colour field with AdapTable's defaults. */
14
+ export declare const ColorField: (props: ColorFieldProps) => React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { ColorField as SharedColorField, } from "../../../vendor/components/ColorField";
3
+ export const ColorField = (props) => {
4
+ const { onChange, 'data-name': dataName = 'color-field', ...rest } = props;
5
+ return (_jsx(SharedColorField, { ...rest, "data-name": dataName, onChange: onChange }));
6
+ };
@@ -97,7 +97,7 @@ export const PrimitiveColumnOrFieldSelector = (props) => {
97
97
  input = (_jsx(Box, { "data-id": "query-input-row-display", "data-name": "qb2-whole-row", "data-slot": "select-trigger", className: subjectPillClassName, children: "Whole Row" }));
98
98
  }
99
99
  else {
100
- input = (_jsx(Box, { "data-id": "query-input-scope-display", "data-slot": "select-trigger", className: subjectPillClassName, children: scopeMeta?.description ?? '$SCOPE' }));
100
+ input = (_jsx(Box, { "data-id": "query-input-scope-display", "data-slot": "select-trigger", className: subjectPillClassName, children: "Scoped Columns" }));
101
101
  }
102
102
  const typeOptions = [
103
103
  {
package/src/env.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export default {
2
2
  NEXT_PUBLIC_INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
3
- PUBLISH_TIMESTAMP: 1791809119255 || Date.now(),
4
- VERSION: "24.0.0-canary.5" || '--current-version--',
3
+ PUBLISH_TIMESTAMP: 1792496906928 || Date.now(),
4
+ VERSION: "24.0.0-canary.7" || '--current-version--',
5
5
  };
@@ -7,4 +7,4 @@ export declare function normalizeTableLayoutModel(layout: TableLayoutModel, opti
7
7
  export declare function normalizePivotLayoutModel(layout: PivotLayoutModel): PivotLayoutModel;
8
8
  export declare function normalizeLayoutModel(layout: TableLayoutModel | PivotLayoutModel, options?: {
9
9
  isTree: boolean;
10
- }): PivotLayoutModel | TableLayoutModel;
10
+ }): TableLayoutModel | PivotLayoutModel;
@@ -1,4 +1,4 @@
1
1
  import { PivotLayoutModel, TableLayoutModel } from './LayoutManagerModel';
2
2
  export declare function simplifyTableLayoutModel(layout: TableLayoutModel): TableLayoutModel;
3
3
  export declare function simplifyPivotLayoutModel(layout: PivotLayoutModel): PivotLayoutModel;
4
- export declare function simplifyLayoutModel(layout: TableLayoutModel | PivotLayoutModel): PivotLayoutModel | TableLayoutModel;
4
+ export declare function simplifyLayoutModel(layout: TableLayoutModel | PivotLayoutModel): TableLayoutModel | PivotLayoutModel;
@@ -1,5 +1,5 @@
1
1
  import { VersionUpgrade } from './VersionUpgrade';
2
- import { AdaptableState } from '../AdaptableState/AdaptableState';
2
+ import { AdaptablePersistentState } from '../AdaptableState/AdaptableState';
3
3
  import { LayoutTagOptions } from '../AdaptableOptions/LayoutOptions';
4
4
  /**
5
5
  * Config object used by State Auto-migration Wizard
@@ -38,7 +38,12 @@ export declare class AdaptableUpgradeHelper {
38
38
  protected versionUpgrades: Map<number, VersionUpgrade>;
39
39
  protected logger: MigrationLogger;
40
40
  private constructor();
41
- static migrateAdaptableState(state: AdaptableState, config: UpgradeConfig): AdaptableState;
41
+ /**
42
+ * Migrates the given Adaptable State from `config.fromVersion` to `config.toVersion`.
43
+ *
44
+ * Accepts both a full `AdaptableState` and a (partial) `AdaptablePersistentState` - e.g. as received in `StateOptions.applyState()` - and returns the same shape.
45
+ */
46
+ static migrateAdaptableState<T extends Partial<AdaptablePersistentState>>(state: T, config: UpgradeConfig): T;
42
47
  /**
43
48
  * Published major version. When `VERSION` is not a parseable semver (local
44
49
  * builds and tests) this is 24, matching the previous helper fallback.
@@ -91,7 +91,7 @@ export class VersionUpgrade17 extends VersionUpgrade {
91
91
  if (dashboardState?.VisibleButtons) {
92
92
  this.logger.warn(`Migrating deprecated DashboardState.VisibleButtons: [${dashboardState.VisibleButtons}].`);
93
93
  state.Dashboard.ModuleButtons = [
94
- ...state.Dashboard.ModuleButtons,
94
+ ...(state.Dashboard.ModuleButtons ?? []),
95
95
  ...dashboardState.VisibleButtons,
96
96
  ];
97
97
  delete state.Dashboard.VisibleButtons;
@@ -175,22 +175,24 @@ export class VersionUpgrade17 extends VersionUpgrade {
175
175
  return state;
176
176
  }
177
177
  const expression = oldQueryState.CurrentQuery;
178
- const currentLayout = state.Layout.Layouts?.find((l) => l.Name === state.Layout.CurrentLayout);
178
+ const currentLayout = state.Layout?.Layouts?.find((l) => l.Name === state.Layout?.CurrentLayout);
179
179
  const currentGridFilter = currentLayout?.GridFilter;
180
180
  const currentGridFilterExpression = currentGridFilter && !currentGridFilter.IsSuspended ? currentGridFilter.Expression || '' : '';
181
- if (expression && StringExtensions.IsNullOrEmpty(currentGridFilterExpression)) {
181
+ if (expression &&
182
+ currentLayout &&
183
+ StringExtensions.IsNullOrEmpty(currentGridFilterExpression)) {
182
184
  currentLayout.GridFilter = {
183
185
  ...currentGridFilter,
184
186
  Expression: expression,
185
187
  };
186
188
  }
187
- state.Dashboard.Tabs?.forEach((tab) => {
189
+ state.Dashboard?.Tabs?.forEach((tab) => {
188
190
  if (tab.Toolbars.includes('Query')) {
189
191
  tab.Toolbars = tab.Toolbars.map((t) => (t == 'Query' ? 'GridFilter' : t));
190
192
  }
191
193
  });
192
194
  let updatePinnedToolbars = false;
193
- if (state.Dashboard.PinnedToolbars) {
195
+ if (state.Dashboard?.PinnedToolbars) {
194
196
  state.Dashboard.PinnedToolbars = state.Dashboard.PinnedToolbars.map((pinnedToolbar) => {
195
197
  if (pinnedToolbar == 'Query') {
196
198
  return 'GridFilter';
@@ -204,11 +206,12 @@ export class VersionUpgrade17 extends VersionUpgrade {
204
206
  const oldQueryState = state.Query;
205
207
  const oldNamedQueries = oldQueryState?.NamedQueries;
206
208
  if (ArrayExtensions.IsNotNullOrEmpty(oldNamedQueries)) {
207
- const currentNamedQueries = state.NamedQuery.NamedQueries;
209
+ state.NamedQuery ??= {};
210
+ const currentNamedQueries = (state.NamedQuery.NamedQueries ??= []);
208
211
  oldNamedQueries.forEach((oldNamedQuery) => {
209
212
  const currentQuery = currentNamedQueries.find((q) => q.Name === oldNamedQuery.Name);
210
213
  if (!currentQuery) {
211
- state.NamedQuery?.NamedQueries?.push(oldNamedQuery);
214
+ currentNamedQueries.push(oldNamedQuery);
212
215
  }
213
216
  });
214
217
  }
@@ -236,6 +239,7 @@ export class VersionUpgrade17 extends VersionUpgrade {
236
239
  };
237
240
  })
238
241
  .filter(Boolean);
242
+ state.StyledColumn ??= {};
239
243
  state.StyledColumn.StyledColumns ??= [];
240
244
  styledColumns.forEach((styledColumn) => {
241
245
  state.StyledColumn.StyledColumns.push(styledColumn);
@@ -263,8 +267,9 @@ export class VersionUpgrade17 extends VersionUpgrade {
263
267
  }
264
268
  });
265
269
  const alertState = state.Alert;
266
- if (ArrayExtensions.IsEmpty(state.FlashingCell?.FlashingCellDefinitions) &&
270
+ if (ArrayExtensions.IsNullOrEmpty(state.FlashingCell?.FlashingCellDefinitions) &&
267
271
  ArrayExtensions.IsNotNullOrEmpty(alertState?.FlashingAlertDefinitions)) {
272
+ state.FlashingCell ??= {};
268
273
  state.FlashingCell.FlashingCellDefinitions = alertState.FlashingAlertDefinitions;
269
274
  delete state.Alert.FlashingAlertDefinitions;
270
275
  }
@@ -33,6 +33,8 @@ import type { MigrationLogger } from './AdaptableUpgradeHelper';
33
33
  * `Type: 'Change'` when missing
34
34
  * 16. {@link migrateLayoutTagsToRegistry} — Layout extensions held in object Tags
35
35
  * (`layoutTagOptions.autoCheckTagsForLayouts`) → `Layout.LayoutExtensions`
36
+ * 17. {@link VersionUpgrade24.migrateSwatchColorVars} — `--ab-color-swatch-N`
37
+ * colours → `--ab-color-palette-{N+12}`
36
38
  */
37
39
  export declare class VersionUpgrade24 extends VersionUpgrade {
38
40
  private options;
@@ -40,6 +42,13 @@ export declare class VersionUpgrade24 extends VersionUpgrade {
40
42
  layoutTagOptions?: LayoutTagOptions;
41
43
  });
42
44
  migrateState(state: AdaptableState): AdaptableState;
45
+ /**
46
+ * Step 17. The 20 swatch colours were merged into the palette after its 12
47
+ * light / dark pairs, so `var(--ab-color-swatch-N)` in any saved style
48
+ * (Format Columns, Styled Columns, Alerts, Flashing Cells, shared entities…)
49
+ * becomes `var(--ab-color-palette-{N+12})` with the same colour.
50
+ */
51
+ private migrateSwatchColorVars;
43
52
  /**
44
53
  * Migrates Notes from a single `Timestamp` to explicit `CreatedAt` / `UpdatedAt`.
45
54
  *
@@ -34,8 +34,35 @@ export class VersionUpgrade24 extends VersionUpgrade {
34
34
  this.retypeObservableCalculatedColumns(state);
35
35
  this.stampFlashingCellTypes(state);
36
36
  migrateLayoutTagsToRegistry(state, this.logger, this.options.layoutTagOptions);
37
+ this.migrateSwatchColorVars(state);
37
38
  return state;
38
39
  }
40
+ migrateSwatchColorVars(state) {
41
+ const swatchVar = /--ab-color-swatch-(\d+)\b/g;
42
+ let rewritten = 0;
43
+ const visit = (node) => {
44
+ if (!node || typeof node !== 'object') {
45
+ return;
46
+ }
47
+ const container = node;
48
+ for (const key of Object.keys(container)) {
49
+ const value = container[key];
50
+ if (typeof value !== 'string') {
51
+ visit(value);
52
+ continue;
53
+ }
54
+ const next = value.replace(swatchVar, (_, n) => `--ab-color-palette-${Number(n) + 12}`);
55
+ if (next !== value) {
56
+ container[key] = next;
57
+ rewritten++;
58
+ }
59
+ }
60
+ };
61
+ visit(state);
62
+ if (rewritten > 0) {
63
+ this.logger.info(`Rewrote ${rewritten} colour value(s) from --ab-color-swatch-N to --ab-color-palette-{N+12} (v24).`);
64
+ }
65
+ }
39
66
  migrateNoteTimestamps(state) {
40
67
  const notes = state.Note?.Notes;
41
68
  if (!notes?.length) {