@adaptabletools/adaptable 23.0.0-canary.1 → 23.0.0-canary.3

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 (84) hide show
  1. package/index.css +130 -137
  2. package/package.json +1 -1
  3. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +1 -3
  4. package/src/AdaptableState/Common/AdaptableFormat.d.ts +1 -1
  5. package/src/AdaptableState/LayoutState.d.ts +5 -4
  6. package/src/AdaptableState/StyledColumnState.d.ts +7 -16
  7. package/src/AdaptableState/StyledColumnState.js +9 -1
  8. package/src/Api/EventApi.d.ts +1 -1
  9. package/src/Api/Events/ReportScheduleRan.d.ts +4 -0
  10. package/src/Api/Internal/EventInternalApi.js +2 -1
  11. package/src/View/AdaptablePopover/index.js +1 -1
  12. package/src/View/Components/Buttons/ButtonInfo.d.ts +1 -1
  13. package/src/View/Components/Buttons/ButtonInfo.js +4 -3
  14. package/src/View/Components/ColumnFilter/AdaptableColumnFilter.js +1 -1
  15. package/src/View/Components/ColumnFilter/ColumnFilter.js +15 -5
  16. package/src/View/Components/ColumnFilter/FloatingFilter.js +58 -60
  17. package/src/View/Components/FilterForm/ListBoxFilterForm.js +1 -1
  18. package/src/View/Components/Forms/AdaptableFormControlTextClear.js +2 -1
  19. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +1 -1
  20. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +2 -2
  21. package/src/View/Components/ValueSelector/index.js +1 -1
  22. package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +3 -8
  23. package/src/View/GridFilter/GridFilterViewPanel.js +1 -1
  24. package/src/View/Layout/Wizard/sections/ColumnsSection.js +4 -4
  25. package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +1 -1
  26. package/src/View/Layout/Wizard/sections/RowGroupingSection.js +6 -2
  27. package/src/View/Layout/Wizard/sections/RowSelectionSection.js +1 -1
  28. package/src/View/Layout/Wizard/sections/SettingsSection.js +1 -1
  29. package/src/View/License/LicenseWatermark.js +1 -1
  30. package/src/View/StyledColumn/Wizard/StyledColumnWizardScopeSection.js +1 -1
  31. package/src/View/Wizard/OnePageWizards.js +1 -1
  32. package/src/View/renderWithAdaptableContext.js +1 -1
  33. package/src/agGrid/AdaptableAgGrid.js +2 -2
  34. package/src/components/Card/index.js +1 -1
  35. package/src/components/Combobox/index.js +11 -5
  36. package/src/components/Datepicker/index.js +6 -6
  37. package/src/components/Dialog/index.js +1 -1
  38. package/src/components/DragAndDropContext/TabList.js +1 -1
  39. package/src/components/Dropdown/Arrows.js +0 -1
  40. package/src/components/ExpressionEditor/BaseEditorInput.js +1 -1
  41. package/src/components/ExpressionEditor/index.js +1 -1
  42. package/src/components/Input/index.js +1 -1
  43. package/src/components/NewDropdownButton/index.d.ts +1 -0
  44. package/src/components/NewDropdownButton/index.js +3 -3
  45. package/src/components/NewSelect/index.d.ts +2 -0
  46. package/src/components/NewSelect/index.js +12 -9
  47. package/src/components/NewTooltip/index.js +1 -1
  48. package/src/components/Panel/index.js +1 -1
  49. package/src/components/SimpleButton/index.js +1 -1
  50. package/src/components/Tabs/index.js +1 -1
  51. package/src/components/Tree/TreeDropdown/index.js +4 -8
  52. package/src/components/ui/button.d.ts +5 -2
  53. package/src/components/ui/button.js +6 -5
  54. package/src/components/ui/calendar.d.ts +1 -1
  55. package/src/components/ui/calendar.js +2 -2
  56. package/src/components/ui/combobox.d.ts +16 -16
  57. package/src/components/ui/combobox.js +39 -39
  58. package/src/components/ui/dropdown-menu.js +1 -1
  59. package/src/components/ui/input-group.d.ts +10 -9
  60. package/src/components/ui/input-group.js +17 -16
  61. package/src/components/ui/input.d.ts +2 -2
  62. package/src/components/ui/input.js +6 -5
  63. package/src/components/ui/popover.d.ts +5 -5
  64. package/src/components/ui/popover.js +8 -8
  65. package/src/components/ui/select.d.ts +7 -6
  66. package/src/components/ui/select.js +14 -13
  67. package/src/components/ui/textarea.d.ts +2 -2
  68. package/src/components/ui/textarea.js +5 -4
  69. package/src/components/ui/tooltip.d.ts +6 -5
  70. package/src/components/ui/tooltip.js +9 -8
  71. package/src/env.js +2 -2
  72. package/src/layout-manager/src/LayoutManagerModel.d.ts +2 -2
  73. package/src/layout-manager/src/index.js +5 -4
  74. package/src/layout-manager/src/normalizeLayoutModel.js +5 -1
  75. package/src/layout-manager/src/rowGroupDisplayType.d.ts +6 -0
  76. package/src/layout-manager/src/rowGroupDisplayType.js +24 -0
  77. package/src/lib/utils.d.ts +20 -0
  78. package/src/lib/utils.js +45 -0
  79. package/src/metamodel/adaptable.metamodel.d.ts +7 -26
  80. package/src/metamodel/adaptable.metamodel.js +1 -1
  81. package/src/migration/VersionUpgrade23.d.ts +2 -3
  82. package/src/migration/VersionUpgrade23.js +4 -16
  83. package/themes/dark.css +7 -17
  84. package/tsconfig.esm.tsbuildinfo +1 -1
@@ -0,0 +1,24 @@
1
+ import { AUTO_GROUP_COLUMN_ID__MULTI_PREFIX, AUTO_GROUP_COLUMN_ID__SINGLE, } from './normalizeLayoutModel';
2
+ export function rowGroupDisplayTypeToGridOption(displayType) {
3
+ switch (displayType ?? 'single') {
4
+ case 'multi':
5
+ return 'multipleColumns';
6
+ case 'groupRows':
7
+ return 'groupRows';
8
+ case 'single':
9
+ default:
10
+ return 'singleColumn';
11
+ }
12
+ }
13
+ export function gridOptionToRowGroupDisplayType(groupDisplayType) {
14
+ if (groupDisplayType === 'multipleColumns') {
15
+ return 'multi';
16
+ }
17
+ if (groupDisplayType === 'groupRows') {
18
+ return 'groupRows';
19
+ }
20
+ return 'single';
21
+ }
22
+ export function isRowGroupAutoColumnId(colId) {
23
+ return colId === AUTO_GROUP_COLUMN_ID__SINGLE || colId.startsWith(AUTO_GROUP_COLUMN_ID__MULTI_PREFIX);
24
+ }
@@ -1,3 +1,23 @@
1
1
  import { type ClassValue } from 'clsx';
2
2
  export declare function cn(...inputs: ClassValue[]): string;
3
3
  export declare const POPUP_Z_INDEX = "twa:z-[9999999]";
4
+ export declare const getFocusableElements: (root: HTMLElement) => HTMLElement[];
5
+ type CaptureTabEvent = Pick<KeyboardEvent, 'key' | 'shiftKey' | 'preventDefault'>;
6
+ type CaptureTabTarget = HTMLElement | null | {
7
+ current: HTMLElement | null;
8
+ };
9
+ /**
10
+ * Traps Tab / Shift+Tab navigation within `node` so focus cycles between the
11
+ * first and last focusable elements instead of escaping the container.
12
+ *
13
+ * Only acts when the currently focused element is within `node` — popups that
14
+ * portal elsewhere (selects, datepickers) keep managing their own navigation.
15
+ *
16
+ * `node` may be an element directly or a React ref to one.
17
+ *
18
+ * Can be called directly (`captureTab(node, event)`) or curried by omitting the
19
+ * event (`captureTab(node)`) to get a handler that only expects the event.
20
+ */
21
+ export declare function captureTab(node: CaptureTabTarget): (event: CaptureTabEvent) => void;
22
+ export declare function captureTab(node: CaptureTabTarget, event: CaptureTabEvent): void;
23
+ export {};
package/src/lib/utils.js CHANGED
@@ -4,3 +4,48 @@ export function cn(...inputs) {
4
4
  return twMerge(clsx(inputs));
5
5
  }
6
6
  export const POPUP_Z_INDEX = 'twa:z-[9999999]';
7
+ const FOCUSABLE_SELECTOR = [
8
+ 'a[href]',
9
+ 'button:not([disabled])',
10
+ 'input:not([disabled])',
11
+ 'select:not([disabled])',
12
+ 'textarea:not([disabled])',
13
+ '[tabindex]:not([tabindex="-1"])',
14
+ ].join(',');
15
+ export const getFocusableElements = (root) => {
16
+ return Array.from(root.querySelectorAll(FOCUSABLE_SELECTOR)).filter((el) => {
17
+ if (el.hasAttribute('disabled') || el.getAttribute('aria-hidden') === 'true') {
18
+ return false;
19
+ }
20
+ // ignore elements that aren't actually rendered (e.g. display:none)
21
+ return !!(el.offsetWidth || el.offsetHeight || el.getClientRects().length);
22
+ });
23
+ };
24
+ export function captureTab(node, event) {
25
+ if (event === undefined) {
26
+ return (deferredEvent) => captureTab(node, deferredEvent);
27
+ }
28
+ if (event.key !== 'Tab')
29
+ return;
30
+ const root = node instanceof HTMLElement ? node : (node?.current ?? null);
31
+ if (!root)
32
+ return;
33
+ const active = document.activeElement;
34
+ if (!active || !root.contains(active))
35
+ return;
36
+ const focusable = getFocusableElements(root);
37
+ if (focusable.length === 0)
38
+ return;
39
+ const first = focusable[0];
40
+ const last = focusable[focusable.length - 1];
41
+ if (event.shiftKey) {
42
+ if (active === first) {
43
+ event.preventDefault();
44
+ last.focus();
45
+ }
46
+ }
47
+ else if (active === last) {
48
+ event.preventDefault();
49
+ first.focus();
50
+ }
51
+ }
@@ -1138,11 +1138,6 @@ export declare const ADAPTABLE_METAMODEL: {
1138
1138
  };
1139
1139
  BadgePillStyle: {
1140
1140
  k: string;
1141
- p: {
1142
- n: string;
1143
- k: string;
1144
- o: boolean;
1145
- }[];
1146
1141
  };
1147
1142
  BadgeShape: {
1148
1143
  k: string;
@@ -3552,25 +3547,6 @@ export declare const ADAPTABLE_METAMODEL: {
3552
3547
  LayoutArray: {
3553
3548
  k: string;
3554
3549
  };
3555
- LayoutBase: {
3556
- k: string;
3557
- p: ({
3558
- n: string;
3559
- k: string;
3560
- o: boolean;
3561
- r?: undefined;
3562
- } | {
3563
- n: string;
3564
- k: string;
3565
- o: boolean;
3566
- r: string;
3567
- } | {
3568
- n: string;
3569
- k: string;
3570
- o?: undefined;
3571
- r?: undefined;
3572
- })[];
3573
- };
3574
3550
  LayoutChangedAction: {
3575
3551
  k: string;
3576
3552
  };
@@ -4343,12 +4319,17 @@ export declare const ADAPTABLE_METAMODEL: {
4343
4319
  };
4344
4320
  ReportScheduleRanInfo: {
4345
4321
  k: string;
4346
- p: {
4322
+ p: ({
4323
+ n: string;
4324
+ k: string;
4325
+ o?: undefined;
4326
+ r?: undefined;
4327
+ } | {
4347
4328
  n: string;
4348
4329
  k: string;
4349
4330
  o: boolean;
4350
4331
  r: string;
4351
- }[];
4332
+ })[];
4352
4333
  };
4353
4334
  ResolveContextDataContext: {
4354
4335
  k: string;