@adaptabletools/adaptable 24.0.0-canary.8 → 24.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.
Files changed (235) hide show
  1. package/agGrid.d.ts +2 -3
  2. package/agGrid.js +2 -3
  3. package/aql.d.ts +29 -1
  4. package/aql.js +49 -1
  5. package/devtools.d.ts +55 -1
  6. package/index.css +0 -19
  7. package/index.d.ts +2 -3
  8. package/index.js +2 -3
  9. package/package.json +1 -1
  10. package/src/AdaptableOptions/ActionColumnOptions.d.ts +24 -0
  11. package/src/AdaptableOptions/AdaptableOptions.d.ts +97 -69
  12. package/src/AdaptableOptions/AdaptablePlugin.d.ts +113 -1
  13. package/src/AdaptableOptions/AlertOptions.d.ts +0 -2
  14. package/src/AdaptableOptions/ChartingOptions.d.ts +11 -5
  15. package/src/AdaptableOptions/ColumnMenuOptions.d.ts +30 -0
  16. package/src/AdaptableOptions/ColumnOptions.d.ts +0 -2
  17. package/src/AdaptableOptions/CommentOptions.d.ts +12 -4
  18. package/src/AdaptableOptions/ContextMenuOptions.d.ts +31 -1
  19. package/src/AdaptableOptions/DashboardOptions.d.ts +0 -3
  20. package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +3 -2
  21. package/src/AdaptableOptions/EditOptions.d.ts +18 -2
  22. package/src/AdaptableOptions/ExportOptions.d.ts +23 -0
  23. package/src/AdaptableOptions/ExpressionOptions.d.ts +0 -3
  24. package/src/AdaptableOptions/Fdc3Options.d.ts +77 -3
  25. package/src/AdaptableOptions/FilterOptions.d.ts +13 -8
  26. package/src/AdaptableOptions/LayoutOptions.d.ts +16 -3
  27. package/src/AdaptableOptions/NotificationsOptions.d.ts +0 -1
  28. package/src/AdaptableOptions/QuickSearchOptions.d.ts +0 -2
  29. package/src/AdaptableOptions/RowFormOptions.d.ts +9 -0
  30. package/src/AdaptableOptions/SettingsPanelOptions.d.ts +10 -1
  31. package/src/AdaptableOptions/ToolPanelOptions.d.ts +0 -1
  32. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +6 -2
  33. package/src/AdaptableState/AdaptableState.d.ts +98 -4
  34. package/src/AdaptableState/AlertState.d.ts +20 -21
  35. package/src/AdaptableState/ApplicationState.d.ts +5 -3
  36. package/src/AdaptableState/BaseState.d.ts +9 -2
  37. package/src/AdaptableState/CalculatedColumnState.d.ts +10 -8
  38. package/src/AdaptableState/ChartingState.d.ts +10 -5
  39. package/src/AdaptableState/CommentState.d.ts +10 -4
  40. package/src/AdaptableState/Common/AdaptableAlert.d.ts +6 -2
  41. package/src/AdaptableState/Common/AdaptableButton.d.ts +3 -1
  42. package/src/AdaptableState/Common/AdaptableColumn.d.ts +38 -1
  43. package/src/AdaptableState/Common/AdaptableFilterState.d.ts +3 -1
  44. package/src/AdaptableState/Common/AdaptableFlashingCell.d.ts +3 -1
  45. package/src/AdaptableState/Common/AdaptableForm.d.ts +9 -0
  46. package/src/AdaptableState/Common/AdaptableFormat.d.ts +27 -1
  47. package/src/AdaptableState/Common/AdaptableIcon.d.ts +4 -2
  48. package/src/AdaptableState/Common/AdaptableObject.d.ts +9 -1
  49. package/src/AdaptableState/Common/AdaptableQuery.d.ts +9 -0
  50. package/src/AdaptableState/Common/AdaptableStyle.d.ts +6 -8
  51. package/src/AdaptableState/Common/AggregationColumns.d.ts +15 -6
  52. package/src/AdaptableState/Common/ButtonStyle.d.ts +3 -1
  53. package/src/AdaptableState/Common/CellDataChangedInfo.d.ts +6 -2
  54. package/src/AdaptableState/Common/CellHighlightInfo.d.ts +4 -2
  55. package/src/AdaptableState/Common/CellSummary.d.ts +33 -0
  56. package/src/AdaptableState/Common/ColumnFilter.d.ts +3 -1
  57. package/src/AdaptableState/Common/ColumnHighlightInfo.d.ts +4 -2
  58. package/src/AdaptableState/Common/ColumnScope.d.ts +32 -1
  59. package/src/AdaptableState/Common/ColumnSetupInfo.d.ts +17 -0
  60. package/src/AdaptableState/Common/ColumnSort.d.ts +3 -1
  61. package/src/AdaptableState/Common/CompactCalculatedColumnEditorInfo.d.ts +3 -0
  62. package/src/AdaptableState/Common/DataChangedScope.d.ts +3 -1
  63. package/src/AdaptableState/Common/DataUpdateConfig.d.ts +3 -1
  64. package/src/AdaptableState/Common/Entitlement.d.ts +4 -2
  65. package/src/AdaptableState/Common/Enums.d.ts +21 -0
  66. package/src/AdaptableState/Common/ExtendedLayout.d.ts +3 -1
  67. package/src/AdaptableState/Common/Fdc3Context.d.ts +9 -0
  68. package/src/AdaptableState/Common/Fdc3Intent.d.ts +6 -0
  69. package/src/AdaptableState/Common/GridFilter.d.ts +3 -1
  70. package/src/AdaptableState/Common/MenuItem.d.ts +9 -0
  71. package/src/AdaptableState/Common/RowHighlightInfo.d.ts +4 -2
  72. package/src/AdaptableState/Common/RowScope.d.ts +3 -1
  73. package/src/AdaptableState/Common/RowSummary.d.ts +14 -4
  74. package/src/AdaptableState/Common/RowsHighlightInfo.d.ts +5 -3
  75. package/src/AdaptableState/Common/Schedule.d.ts +10 -2
  76. package/src/AdaptableState/Common/SpecialColumnSettings.d.ts +3 -1
  77. package/src/AdaptableState/Common/SystemStatusMessageInfo.d.ts +4 -2
  78. package/src/AdaptableState/Common/TransposeConfig.d.ts +1 -1
  79. package/src/AdaptableState/Common/Types.d.ts +9 -0
  80. package/src/AdaptableState/CustomSortState.d.ts +8 -5
  81. package/src/AdaptableState/DashboardState.d.ts +14 -10
  82. package/src/AdaptableState/ExportState.d.ts +12 -4
  83. package/src/AdaptableState/FlashingCellState.d.ts +8 -5
  84. package/src/AdaptableState/FormatColumnState.d.ts +28 -8
  85. package/src/AdaptableState/FreeTextColumnState.d.ts +14 -8
  86. package/src/AdaptableState/IPushPullState.d.ts +39 -3
  87. package/src/AdaptableState/InitialState.d.ts +9 -9
  88. package/src/AdaptableState/InternalState.d.ts +183 -3
  89. package/src/AdaptableState/LayoutState.d.ts +64 -21
  90. package/src/AdaptableState/NamedQueryState.d.ts +16 -4
  91. package/src/AdaptableState/NoteState.d.ts +7 -3
  92. package/src/AdaptableState/OpenFinState.d.ts +12 -2
  93. package/src/AdaptableState/PlusMinusState.d.ts +8 -4
  94. package/src/AdaptableState/PopupState.d.ts +29 -1
  95. package/src/AdaptableState/QuickSearchState.d.ts +5 -3
  96. package/src/AdaptableState/Selection/GridCell.d.ts +5 -3
  97. package/src/AdaptableState/Selection/GridCellRange.d.ts +8 -7
  98. package/src/AdaptableState/Selection/SelectedCellInfo.d.ts +1 -1
  99. package/src/AdaptableState/ShortcutState.d.ts +7 -3
  100. package/src/AdaptableState/StatusBarState.d.ts +7 -6
  101. package/src/AdaptableState/StyledColumnState.d.ts +46 -14
  102. package/src/AdaptableState/TeamSharingState.d.ts +46 -2
  103. package/src/AdaptableState/ThemeState.d.ts +24 -2
  104. package/src/AdaptableState/ToolPanelState.d.ts +10 -5
  105. package/src/AdaptableState/UserInterfaceState.d.ts +2 -2
  106. package/src/AdaptableState/Uuid.d.ts +6 -0
  107. package/src/Api/ActionColumnApi.d.ts +3 -1
  108. package/src/Api/AdaptableApi.d.ts +54 -50
  109. package/src/Api/AlertApi.d.ts +20 -12
  110. package/src/Api/ApplicationApi.d.ts +6 -2
  111. package/src/Api/BulkUpdateApi.d.ts +2 -1
  112. package/src/Api/CalculatedColumnApi.d.ts +4 -1
  113. package/src/Api/CalendarApi.d.ts +10 -0
  114. package/src/Api/CellSummaryApi.d.ts +9 -3
  115. package/src/Api/ChartingApi.d.ts +22 -7
  116. package/src/Api/ColumnApi.d.ts +71 -4
  117. package/src/Api/ColumnFilterApi.d.ts +13 -3
  118. package/src/Api/ColumnMenuApi.d.ts +13 -2
  119. package/src/Api/ColumnScopeApi.d.ts +27 -1
  120. package/src/Api/CommentApi.d.ts +10 -7
  121. package/src/Api/ContextMenuApi.d.ts +11 -1
  122. package/src/Api/CustomSortApi.d.ts +6 -2
  123. package/src/Api/DashboardApi.d.ts +30 -9
  124. package/src/Api/DataChangeHistoryApi.d.ts +9 -3
  125. package/src/Api/DataImportApi.d.ts +1 -1
  126. package/src/Api/EntitlementApi.d.ts +6 -1
  127. package/src/Api/EventApi.d.ts +67 -19
  128. package/src/Api/Events/AdaptableReady.d.ts +6 -2
  129. package/src/Api/Events/AdaptableStateChanged.d.ts +9 -5
  130. package/src/Api/Events/AdaptableStateReloaded.d.ts +7 -3
  131. package/src/Api/Events/AlertFired.d.ts +8 -2
  132. package/src/Api/Events/BeforeAdaptableStateChange.d.ts +6 -2
  133. package/src/Api/Events/CalculatedColumnChanged.d.ts +7 -3
  134. package/src/Api/Events/CellChanged.d.ts +6 -2
  135. package/src/Api/Events/CellSelectionChanged.d.ts +6 -2
  136. package/src/Api/Events/ChartChanged.d.ts +16 -8
  137. package/src/Api/Events/CommentChanged.d.ts +8 -2
  138. package/src/Api/Events/CustomToolbarConfigured.d.ts +6 -2
  139. package/src/Api/Events/DashboardChanged.d.ts +27 -6
  140. package/src/Api/Events/DataImported.d.ts +8 -4
  141. package/src/Api/Events/DataSetSelected.d.ts +6 -2
  142. package/src/Api/Events/Fdc3MessageInfo.d.ts +14 -4
  143. package/src/Api/Events/FlashingCellDisplayed.d.ts +6 -2
  144. package/src/Api/Events/GridFilterApplied.d.ts +11 -3
  145. package/src/Api/Events/GridSorted.d.ts +6 -2
  146. package/src/Api/Events/LayoutChanged.d.ts +36 -5
  147. package/src/Api/Events/LiveDataChanged.d.ts +21 -5
  148. package/src/Api/Events/NoteChanged.d.ts +5 -1
  149. package/src/Api/Events/ReportScheduleRan.d.ts +7 -3
  150. package/src/Api/Events/RowChanged.d.ts +6 -2
  151. package/src/Api/Events/RowFormSubmitted.d.ts +28 -12
  152. package/src/Api/Events/RowSelectionChanged.d.ts +6 -2
  153. package/src/Api/Events/SystemStatusMessageDisplayed.d.ts +6 -2
  154. package/src/Api/Events/TeamSharingEntityChanged.d.ts +6 -2
  155. package/src/Api/Events/ThemeSelected.d.ts +6 -2
  156. package/src/Api/ExportApi.d.ts +59 -32
  157. package/src/Api/ExpressionApi.d.ts +24 -1
  158. package/src/Api/Fdc3Api.d.ts +16 -3
  159. package/src/Api/FlashingCellApi.d.ts +6 -1
  160. package/src/Api/FormatColumnApi.d.ts +18 -11
  161. package/src/Api/FreeTextColumnApi.d.ts +4 -2
  162. package/src/Api/GridApi.d.ts +92 -19
  163. package/src/Api/IPushPullApi.d.ts +19 -2
  164. package/src/Api/Internal/EventInternalApi.d.ts +2 -1
  165. package/src/Api/Internal/EventInternalApi.js +7 -0
  166. package/src/Api/InteropioPluginApi.d.ts +2 -1
  167. package/src/Api/LayoutApi.d.ts +29 -15
  168. package/src/Api/NamedQueryApi.d.ts +10 -6
  169. package/src/Api/NoteApi.d.ts +15 -11
  170. package/src/Api/OpenFinApi.d.ts +8 -2
  171. package/src/Api/OptionsApi.d.ts +43 -1
  172. package/src/Api/PluginsApi.d.ts +6 -1
  173. package/src/Api/PlusMinusApi.d.ts +2 -1
  174. package/src/Api/QuickSearchApi.d.ts +6 -1
  175. package/src/Api/RowFormApi.d.ts +8 -7
  176. package/src/Api/ShortcutApi.d.ts +3 -1
  177. package/src/Api/SmartEditApi.d.ts +4 -1
  178. package/src/Api/StateApi.d.ts +30 -2
  179. package/src/Api/StatusBarApi.d.ts +2 -0
  180. package/src/Api/StyledColumnApi.d.ts +23 -12
  181. package/src/Api/SystemStatusApi.d.ts +18 -6
  182. package/src/Api/TeamSharingApi.d.ts +8 -1
  183. package/src/Api/ThemeApi.d.ts +18 -9
  184. package/src/Api/ToolPanelApi.d.ts +12 -7
  185. package/src/Api/UserInterfaceApi.d.ts +10 -1
  186. package/src/Redux/Store/AdaptableStore.js +1 -1
  187. package/src/agGrid/Adaptable.d.ts +0 -12
  188. package/src/agGrid/Adaptable.js +0 -52
  189. package/src/agGrid/AdaptableFrameworkComponent.d.ts +12 -0
  190. package/src/agGrid/AdaptableLogger.d.ts +74 -1
  191. package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +3 -0
  192. package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +3 -0
  193. package/src/agGrid/index.d.ts +1 -6
  194. package/src/agGrid/index.js +1 -3
  195. package/src/aql/ExpressionEvaluation.d.ts +27 -0
  196. package/src/aql/types.d.ts +22 -0
  197. package/src/env.js +2 -2
  198. package/src/migration/legacyAdaptableQuery.d.ts +29 -4
  199. package/src/setupDevTools.js +223 -0
  200. package/src/types.d.ts +0 -2
  201. package/tsconfig.esm.tsbuildinfo +1 -1
  202. package/src/AdaptableInterfaces/AdaptableNoCodeWizard.d.ts +0 -99
  203. package/src/AdaptableInterfaces/AdaptableNoCodeWizard.js +0 -1
  204. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableConfig.d.ts +0 -15
  205. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableConfig.js +0 -1
  206. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.d.ts +0 -19
  207. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +0 -337
  208. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/Components/FormBox.d.ts +0 -5
  209. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/Components/FormBox.js +0 -4
  210. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.d.ts +0 -30
  211. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +0 -162
  212. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.d.ts +0 -18
  213. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.js +0 -12
  214. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.d.ts +0 -8
  215. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.js +0 -131
  216. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/GridOptionsForm.d.ts +0 -8
  217. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/GridOptionsForm.js +0 -30
  218. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsSidebarForm.d.ts +0 -6
  219. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsSidebarForm.js +0 -80
  220. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.d.ts +0 -6
  221. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.js +0 -100
  222. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.d.ts +0 -11
  223. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.js +0 -8
  224. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/index.d.ts +0 -2
  225. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/index.js +0 -2
  226. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/useSelection.d.ts +0 -21
  227. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/useSelection.js +0 -63
  228. package/src/View/AdaptableWizardView/Utilities/Utils.d.ts +0 -1
  229. package/src/View/AdaptableWizardView/Utilities/Utils.js +0 -21
  230. package/src/View/AdaptableWizardView/Utilities/helper.d.ts +0 -19
  231. package/src/View/AdaptableWizardView/Utilities/helper.js +0 -81
  232. package/src/View/AdaptableWizardView/Wizard.d.ts +0 -57
  233. package/src/View/AdaptableWizardView/Wizard.js +0 -98
  234. package/src/View/AdaptableWizardView/index.d.ts +0 -4
  235. package/src/View/AdaptableWizardView/index.js +0 -4
@@ -1,99 +0,0 @@
1
- import * as React from 'react';
2
- import { GridOptions, Module } from 'ag-grid-enterprise';
3
- import { AdaptableOptions } from '../types';
4
- import { AdaptableApi } from '../Api/AdaptableApi';
5
- export type AdaptableNoCodeWizardInitFn = ({ gridOptions, adaptableOptions, agGridModules, }: {
6
- gridOptions: GridOptions;
7
- adaptableOptions: AdaptableOptions;
8
- agGridModules: Module[];
9
- }) => Promise<AdaptableApi>;
10
- /**
11
- * Adaptable Options used by the No Code Wizard
12
- */
13
- export interface AdaptableNoCodeWizardOptions {
14
- onInit?: AdaptableNoCodeWizardInitFn;
15
- fileAccept?: string;
16
- defaultActionMessage?: React.ReactNode;
17
- dragOverActionMessage?: React.ReactNode;
18
- fetchData?: () => Promise<any>;
19
- showFetchDataWizard?: boolean;
20
- helpText?: React.ReactNode;
21
- fileContentsToJSON?: (str: string) => Promise<any> | any;
22
- readFile?: (file: File) => Promise<any>;
23
- skipToWizard?: boolean;
24
- loadingMessage?: React.ReactNode;
25
- prepareData?: (data: any, file?: File) => {
26
- columns: string[];
27
- data: any[];
28
- primaryKey?: string;
29
- };
30
- }
31
- /**
32
- * When you want to configure an Adaptable via json file D&D, use this instead of the normal Adaptable constructor
33
- *
34
- * @example
35
- * ```
36
- * // So instead of doing
37
- *
38
- * const adaptable = new Adaptable(adaptableOptions);
39
- *
40
- * // you have to do
41
- *
42
- * const adaptableOptions: AdaptableOptions = {
43
- *
44
- * userName: 'Demo User',
45
- * initialState: demoConfig,
46
- *
47
- * // note we don't need any agGrid info, since that's set by the wizard, when
48
- * // the user configured the columns
49
- * };
50
- *
51
- * const AdaptableNoCodeWizard = new AdaptableNoCodeWizard(adaptableOptions);
52
- *
53
- * // in the most simple case.
54
- *```
55
- * After the user drops the file and configures all the columns and other options,
56
- * when the "FINISH" button is clicked, we call onInit (which is an optional config), to allow
57
- * the developer to override some configuration in case this is needed. This is how it looks like:
58
- *
59
- *```
60
- * const AdaptableNoCodeWizard = new AdaptableNoCodeWizard(adaptableOptions, {
61
- * onInit: ({ adaptableOptions, gridOptions }) => {
62
- * // here you can either change some of the ab options or the gridOptions
63
- * // and don't return anything
64
- *
65
- * // OR instantiate Adaptable yourself with
66
- *
67
- * const adaptable = new Adaptable(adaptableOptions);
68
- * // in case you need a reference to it for later use (api stuff...)
69
- * // and return Adaptableinstance
70
- *
71
- * return adaptable
72
- * }
73
- * });
74
- *```
75
- * you can also have a `prepareData` config
76
- *```
77
- * const AdaptableNoCodeWizard = new AdaptableNoCodeWizard(adaptableOptions, {
78
- * prepareData: (dataFromFile) => {
79
- * return {
80
- * columns: ['name','value']
81
- * data: dataFromFile.countries.people || [
82
- * { name: 'john', value: 5},
83
- * { name: 'marry', value: 15},
84
- * ],
85
- * primaryKey?: 'optional'
86
- * }
87
- * }
88
- * })
89
- *```
90
- * You can use the prepareData function when you know the json doesn't contain an array of objects, but rather another
91
- * structure - eg: a single object, a data array nested deeper down in the json file, etc
92
- *
93
- * So the function needs to return an array of columns (strings) and an array of data to be used in the grid
94
- *
95
- *
96
- *
97
- */
98
- export interface IAdaptableNoCodeWizard {
99
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,15 +0,0 @@
1
- import { AdaptableOptions } from '../../../AdaptableOptions/AdaptableOptions';
2
- import { GridOptions } from 'ag-grid-enterprise';
3
- /**
4
- * Config used by No Code Plugin to set up AdapTable
5
- */
6
- export interface AdaptableConfig {
7
- /**
8
- * Adaptable Options object
9
- */
10
- adaptableOptions: AdaptableOptions;
11
- /**
12
- * AG Grid Grid Options object
13
- */
14
- gridOptions: GridOptions;
15
- }
@@ -1,19 +0,0 @@
1
- import * as React from 'react';
2
- import { ColDef } from 'ag-grid-enterprise';
3
- export interface NocodeColumn extends Partial<ColDef> {
4
- field?: string;
5
- type?: string | string[];
6
- caption?: string;
7
- }
8
- declare const _default: React.MemoExoticComponent<({ columns: cols, handle, onValidityChange, onChange, onSelectionChange, selectedColumns, theme, }: {
9
- onValidityChange: (valid: boolean) => any;
10
- handle: React.MutableRefObject<any>;
11
- columns: NocodeColumn[];
12
- theme?: string;
13
- onChange?: (columns: NocodeColumn[]) => void;
14
- onSelectionChange?: (column: any, flag: boolean) => void;
15
- selectedColumns?: {
16
- [key: string]: boolean;
17
- };
18
- }) => React.JSX.Element>;
19
- export default _default;
@@ -1,337 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import * as React from 'react';
3
- import useSelection from './useSelection';
4
- import { CheckBox } from '../../../components/CheckBox';
5
- import Radio from '../../../components/Radio';
6
- import Dropdown from '../../../components/Dropdown';
7
- import Input from '../../../components/Input';
8
- import { useRef, useState } from 'react';
9
- import StringExtensions from '../../../Utilities/Extensions/StringExtensions';
10
- import { DataSource, InfiniteTableGrid, } from '../../../components/InfiniteTable';
11
- import { Box, Flex } from '../../../components/Flex';
12
- import { throttle } from '../../../Utilities/Helpers/TimingHelper';
13
- import { twMerge } from '../../../twMerge';
14
- const dataTypes = [
15
- {
16
- value: 'text',
17
- label: 'Text (string)',
18
- },
19
- { value: 'number', label: 'Number' },
20
- {
21
- value: 'date',
22
- label: 'Date',
23
- },
24
- {
25
- value: 'boolean',
26
- label: 'Boolean',
27
- },
28
- ];
29
- const inputStyle = {
30
- width: '100%',
31
- minWidth: 80,
32
- textAlign: 'start',
33
- };
34
- const useForceRender = () => {
35
- const [, setNow] = useState(Date.now());
36
- return () => {
37
- setNow(Date.now());
38
- };
39
- };
40
- const ThrottledInput = React.memo((props) => {
41
- const [stateValue, setStateValue] = useState(props.value);
42
- const throttleOnChange = React.useRef(throttle(props.onChange, 600, { leading: false }));
43
- const handleChange = React.useCallback((event) => {
44
- const newValue = event.target.value;
45
- setStateValue(newValue);
46
- throttleOnChange.current(newValue);
47
- }, []);
48
- React.useEffect(() => {
49
- setStateValue(props.value);
50
- }, [props.value]);
51
- return _jsx(Input, { style: props.style, value: stateValue, onChange: handleChange });
52
- });
53
- const tableDOMProps = {
54
- style: {
55
- height: '100%',
56
- minWidth: '10rem',
57
- minHeight: 600,
58
- },
59
- };
60
- const ColumnsList = ({ columns: cols, handle, onValidityChange, onChange, onSelectionChange, selectedColumns, theme, }) => {
61
- const rerender = useForceRender();
62
- const columnsRef = useRef(cols);
63
- const silentSetColumns = (columns) => {
64
- columnsRef.current = columns;
65
- onChange?.(columns);
66
- };
67
- const setColumns = (columns) => {
68
- silentSetColumns(columns);
69
- rerender();
70
- };
71
- const getColumns = () => columnsRef.current;
72
- const columns = columnsRef.current;
73
- const onColumnChange = (col, value, property) => {
74
- col = { ...col, [property]: value };
75
- const cols = getColumns().map((c) => {
76
- if (c.field === col.field) {
77
- return col;
78
- }
79
- return c;
80
- });
81
- setColumns(cols);
82
- };
83
- const onColumnBatchChange = (value, property) => {
84
- const cols = getColumns().map((c) => ({ ...c, [property]: value }));
85
- setColumns(cols);
86
- };
87
- const setColumnCaption = (caption, field) => {
88
- const cols = getColumns().map((c) => {
89
- if (c.field === field) {
90
- const newCol = { ...c, caption };
91
- return newCol;
92
- }
93
- return c;
94
- });
95
- setColumns(cols);
96
- };
97
- const onColumnTypeChange = (col, type) => {
98
- const cols = getColumns().map((c) => {
99
- if (c.field === col.field) {
100
- return { ...c, type };
101
- }
102
- return c;
103
- });
104
- setColumns(cols);
105
- };
106
- const [primaryKeyField, setPrimaryKeyField] = React.useState(columns[0].field);
107
- const { selected: includedColumnsMap, isSelected: isIncludedColumn, isAllSelected: isAllIncludedColumns, isNoneSelected: isNoneIncludedColumns, selectColumn: includeColumn, deselectColumn: excludeColumn, selectAll: includeAllColumns, deselectAll: excludeAllColumns, } = useSelection(columns, selectedColumns ?? true, null, { onChange: onSelectionChange });
108
- handle.current = {
109
- getColumns: () => getColumns().filter((col) => isIncludedColumn(col.field)),
110
- getPrimaryKey: () => primaryKeyField,
111
- };
112
- const { isSelected: isSortableColumn, isAllSelected: isAllSortableColumns, isNoneSelected: isNoneSortableColumns, selectColumn: setSortableColumn, deselectColumn: setUnsortableColumn, selectAll: setAllSortable, deselectAll: setAllUnsortable, } = useSelection(columns, true, 'sortable', {
113
- onBatchChange: (flag) => {
114
- onColumnBatchChange(flag, 'sortable');
115
- },
116
- onChange: (col, flag) => {
117
- onColumnChange(col, flag, 'sortable');
118
- },
119
- });
120
- const { isSelected: isGroupableColumn, isAllSelected: isAllGroupableColumns, isNoneSelected: isNoneGroupableColumns, selectColumn: setGroupableColumn, deselectColumn: setUngroupableColumn, selectAll: setAllGroupable, deselectAll: setAllUngroupable, } = useSelection(columns, true, 'enableRowGroup', {
121
- onBatchChange: (flag) => {
122
- onColumnBatchChange(flag, 'enableRowGroup');
123
- },
124
- onChange: (col, flag) => {
125
- onColumnChange(col, flag, 'enableRowGroup');
126
- },
127
- });
128
- const { isSelected: isResizableColumn, isAllSelected: isAllResizableColumns, isNoneSelected: isNoneResizableColumns, selectColumn: setResizableColumn, deselectColumn: setUnresizableColumn, selectAll: setAllResizable, deselectAll: setAllUnresizable, } = useSelection(columns, true, 'resizable', {
129
- onBatchChange: (flag) => {
130
- onColumnBatchChange(flag, 'resizable');
131
- },
132
- onChange: (col, flag) => {
133
- onColumnChange(col, flag, 'resizable');
134
- },
135
- });
136
- const { isSelected: isEditableColumn, isAllSelected: isAllEditableColumns, isNoneSelected: isNoneEditableColumns, selectColumn: setEditableColumn, deselectColumn: setUneditableColumn, selectAll: setAllEditable, deselectAll: setAllUneditable, } = useSelection(columns, true, 'editable', {
137
- onBatchChange: (flag) => {
138
- onColumnBatchChange(flag, 'editable');
139
- },
140
- onChange: (col, flag) => {
141
- onColumnChange(col, flag, 'editable');
142
- },
143
- });
144
- const { isSelected: isFilterableColumn, isAllSelected: isAllFilterableColumns, isNoneSelected: isNoneFilterableColumns, selectColumn: setFilterableColumn, deselectColumn: setUnFilterableColumn, selectAll: setAllFilterable, deselectAll: setAllUnfilterable, } = useSelection(columns, true, 'filter', {
145
- onBatchChange: (flag) => {
146
- onColumnBatchChange(flag, 'filter');
147
- },
148
- onChange: (col, flag) => {
149
- onColumnChange(col, flag, 'filter');
150
- },
151
- });
152
- const allIncluded = isAllIncludedColumns();
153
- const allExcluded = isNoneIncludedColumns();
154
- React.useEffect(() => {
155
- onValidityChange(isIncludedColumn(primaryKeyField));
156
- }, [includedColumnsMap, primaryKeyField]);
157
- const data = columns;
158
- const CellWrapper = (props) => {
159
- return (_jsx(Flex, { ...props, style: {
160
- ...props.style,
161
- position: 'absolute',
162
- textAlign: 'center',
163
- top: 0,
164
- left: 0,
165
- height: '100%',
166
- width: '100%',
167
- whiteSpace: 'normal',
168
- }, justifyContent: "center", alignItems: "center", children: props.children }));
169
- };
170
- const HeaderCellWrapper = (props) => (_jsx(CellWrapper, { ...props, className: twMerge('twa:text-3 twa:font-bold', props.className) }));
171
- const HeaderWithCheckbox = (props) => {
172
- const { label, onChange, checked, ...flexProps } = props;
173
- return (_jsxs(HeaderCellWrapper, { ...flexProps, flexDirection: "column", children: [_jsx(Box, { children: label }), _jsx(Box, { className: "twa:text-center twa:ml-1", children: _jsx(CheckBox, { checked: checked, onChange: onChange }) })] }));
174
- };
175
- const columnsMap = {
176
- pk: {
177
- header: () => _jsx(HeaderCellWrapper, { children: "Primary Key" }),
178
- maxWidth: 80,
179
- defaultSortable: false,
180
- renderMenuIcon: false,
181
- render: (params) => {
182
- const { data } = params;
183
- const column = data;
184
- const isPrimaryKey = column?.field === primaryKeyField;
185
- return (_jsx(Radio, { checked: isPrimaryKey, onChange: (checked) => {
186
- if (checked && isIncludedColumn(column.field)) {
187
- setPrimaryKeyField(column.field);
188
- }
189
- } }));
190
- },
191
- },
192
- included: {
193
- maxWidth: 80,
194
- resizable: true,
195
- renderMenuIcon: false,
196
- header: () => (_jsx(HeaderWithCheckbox, { label: "Included", checked: allIncluded ? true : allExcluded ? false : null, onChange: (allIncluded) => {
197
- if (allIncluded) {
198
- includeAllColumns();
199
- }
200
- else {
201
- excludeAllColumns();
202
- }
203
- } })),
204
- render: (params) => {
205
- const column = params.data;
206
- return (_jsx(CellWrapper, { children: _jsx(CheckBox, { checked: isIncludedColumn(column.field), onChange: (included) => {
207
- if (included) {
208
- includeColumn(column.field);
209
- }
210
- else {
211
- excludeColumn(column.field);
212
- }
213
- } }) }));
214
- },
215
- },
216
- field: {
217
- header: _jsx(HeaderCellWrapper, { children: "Field" }),
218
- field: 'field',
219
- minWidth: 150,
220
- renderMenuIcon: false,
221
- render: (params) => {
222
- const column = params.data;
223
- const humanized = StringExtensions.Humanize(column.field);
224
- return (_jsx(Box, { className: "twa:p-2", children: _jsx(ThrottledInput, { style: inputStyle, value: column.caption != undefined ? column.caption : humanized, placeholder: humanized, onChange: (value) => {
225
- setColumnCaption(value, column.field);
226
- } }, column.field) }));
227
- },
228
- },
229
- type: {
230
- header: _jsx(HeaderCellWrapper, { children: "Type" }),
231
- maxWidth: 140,
232
- renderMenuIcon: false,
233
- render: (params) => {
234
- const column = params.data;
235
- return (_jsx(CellWrapper, { className: "twa:px-1", children: _jsx(Dropdown, { style: inputStyle, showClearButton: false, options: dataTypes, value: column?.type ?? '', onChange: onColumnTypeChange.bind(null, column) }) }));
236
- },
237
- },
238
- sortable: {
239
- renderMenuIcon: false,
240
- header: (_jsx(HeaderWithCheckbox, { label: "Sortable", checked: isAllSortableColumns() ? true : isNoneSortableColumns() ? false : null, onChange: (allSortable) => {
241
- if (allSortable) {
242
- setAllSortable();
243
- }
244
- else {
245
- setAllUnsortable();
246
- }
247
- } })),
248
- render: (params) => {
249
- const column = params.data;
250
- return (_jsx(CheckBox, { checked: isSortableColumn(column.field), onChange: (sortable) => {
251
- sortable ? setSortableColumn(column.field) : setUnsortableColumn(column.field);
252
- } }));
253
- },
254
- },
255
- editable: {
256
- renderMenuIcon: false,
257
- header: (_jsx(HeaderWithCheckbox, { label: "Editable", checked: isAllEditableColumns() ? true : isNoneEditableColumns() ? false : null, onChange: (allEditable) => {
258
- if (allEditable) {
259
- setAllEditable();
260
- }
261
- else {
262
- setAllUneditable();
263
- }
264
- } })),
265
- render: (params) => {
266
- const col = params.data;
267
- return (_jsx(CellWrapper, { children: _jsx(CheckBox, { checked: isEditableColumn(col.field), onChange: (editable) => {
268
- editable ? setEditableColumn(col.field) : setUneditableColumn(col.field);
269
- } }) }));
270
- },
271
- },
272
- resizable: {
273
- renderMenuIcon: false,
274
- header: (_jsx(HeaderWithCheckbox, { label: "Resizable", checked: isAllResizableColumns() ? true : isNoneResizableColumns() ? false : null, onChange: (allResizable) => {
275
- if (allResizable) {
276
- setAllResizable();
277
- }
278
- else {
279
- setAllUnresizable();
280
- }
281
- } })),
282
- render: (params) => {
283
- const col = params.data;
284
- return (_jsx(CellWrapper, { children: _jsx(CheckBox, { checked: isResizableColumn(col.field), onChange: (resizable) => {
285
- resizable ? setResizableColumn(col.field) : setUnresizableColumn(col.field);
286
- } }) }));
287
- },
288
- },
289
- groupable: {
290
- renderMenuIcon: false,
291
- header: (_jsx(HeaderWithCheckbox, { label: "Groupable", checked: isAllGroupableColumns() ? true : isNoneGroupableColumns() ? false : null, onChange: (allGroupable) => {
292
- if (allGroupable) {
293
- setAllGroupable();
294
- }
295
- else {
296
- setAllUngroupable();
297
- }
298
- } })),
299
- render: (params) => {
300
- const col = params.data;
301
- return (_jsx(CellWrapper, { children: _jsx(CheckBox, { checked: isGroupableColumn(col.field), onChange: (groupable) => {
302
- groupable ? setGroupableColumn(col.field) : setUngroupableColumn(col.field);
303
- } }) }));
304
- },
305
- },
306
- filterable: {
307
- renderMenuIcon: false,
308
- header: (_jsx(HeaderWithCheckbox, { label: "Filterable", checked: isAllFilterableColumns() ? true : isNoneFilterableColumns() ? false : null, onChange: (allFilterable) => {
309
- if (allFilterable) {
310
- setAllFilterable();
311
- }
312
- else {
313
- setAllUnfilterable();
314
- }
315
- } })),
316
- render: (params) => {
317
- const col = params.data;
318
- return (_jsx(CellWrapper, { children: _jsx(CheckBox, { checked: isFilterableColumn(col.field), onChange: (filterable) => {
319
- filterable ? setFilterableColumn(col.field) : setUnFilterableColumn(col.field);
320
- } }) }));
321
- },
322
- },
323
- };
324
- return (_jsx(Box, { className: twMerge('twa:p-2 twa:h-full', theme), children: _jsx(DataSource, { data: data, primaryKey: "colId", children: _jsx(InfiniteTableGrid, { columnTypes: {
325
- default: {
326
- defaultFlex: 1,
327
- align: 'center',
328
- defaultSortable: false,
329
- },
330
- }, rowHeight: 40, columnHeaderHeight: 60, headerOptions: {
331
- alwaysReserveSpaceForSortIcon: false,
332
- }, domProps: tableDOMProps, columns: columnsMap }) }) }));
333
- };
334
- function areEqual() {
335
- return true;
336
- }
337
- export default React.memo(ColumnsList, areEqual);
@@ -1,5 +0,0 @@
1
- import * as React from 'react';
2
- import { BoxProps } from '../../../../components/Flex';
3
- export declare const NocodeWizardFormBox: React.FunctionComponent<React.PropsWithChildren<BoxProps & {
4
- className?: string;
5
- }>>;
@@ -1,4 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Box } from '../../../../components/Flex';
3
- import { twMerge } from '../../../../twMerge';
4
- export const NocodeWizardFormBox = (props) => (_jsx(Box, { ...props, className: twMerge('ab-NocodeWizardFormBox twa:p-2 twa:mb-2', props.className) }));
@@ -1,30 +0,0 @@
1
- import * as React from 'react';
2
- import { OnePageWizardSection } from '../../Wizard/OnePageWizards';
3
- import { AdaptableFrameworkComponent } from '../../../../types';
4
- import { AdaptableConfig } from './AdaptableConfig';
5
- export interface CustomSection<T> {
6
- title: OnePageWizardSection<T>['title'];
7
- details?: AdaptableFrameworkComponent;
8
- isValid?: OnePageWizardSection<T>['isValid'];
9
- isVisible?: OnePageWizardSection<T>['isVisible'];
10
- render: (
11
- /**
12
- * Internal state of adaptableOptions.
13
- */
14
- adaptableConfig: AdaptableConfig,
15
- /**
16
- * With this callback adaptableOptions can be changed.
17
- */
18
- onChange: (newAdaptableConfig: AdaptableConfig) => void,
19
- /**
20
- * Set the selected columns.
21
- */
22
- setSelectedColumns: (selectedColumn: Record<string, boolean>) => void) => React.ReactNode;
23
- }
24
- export interface ConfigurationWizardProps {
25
- adaptableConfig: AdaptableConfig;
26
- onFinish: (adaptableConfig: AdaptableConfig) => void;
27
- onCancel: () => void;
28
- startSections?: CustomSection<AdaptableConfig>[];
29
- }
30
- export declare const ConfigurationWizard: React.FunctionComponent<ConfigurationWizardProps>;