@economic/taco 2.25.1-alpha.13 → 2.26.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.
- package/dist/esm/index.css +8 -0
- package/dist/esm/packages/taco/src/components/Menu/components/Trigger.js +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Provider/Localization.js +15 -29
- package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/Select2.js +1 -1
- package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/hooks/useChildren.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Editing/Alert.js +4 -4
- package/dist/esm/packages/taco/src/components/Table3/components/Editing/Alert.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/Body.js +0 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/Body.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Drag.js +3 -3
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Drag.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Summary.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Summary.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/Toolbar.js +5 -4
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Search/Search.js +19 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Search/Search.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/types.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActive.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActive.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js +47 -19
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js.map +1 -1
- package/dist/index.css +8 -0
- package/dist/packages/taco/src/components/Provider/Localization.d.ts +14 -28
- package/dist/packages/taco/src/components/Select2/hooks/useChildren.d.ts +2 -1
- package/dist/packages/taco/src/components/Table3/__stories__/util.d.ts +12 -0
- package/dist/packages/taco/src/components/Table3/types.d.ts +14 -12
- package/dist/packages/taco/src/primitives/Table/Core/components/Toolbar/Toolbar.d.ts +1 -1
- package/dist/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Search/Search.d.ts +3 -1
- package/dist/packages/taco/src/primitives/Table/types.d.ts +2 -2
- package/dist/taco.cjs.development.js +97 -65
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/package.json +2 -2
- package/types.json +5344 -5494
package/dist/index.css
CHANGED
@@ -832,6 +832,10 @@ table[data-taco^='table'][data-table-font-size='small'] td [data-taco='switch-co
|
|
832
832
|
}
|
833
833
|
|
834
834
|
/* medium font size */
|
835
|
+
table[data-taco^='table'][data-table-font-size='medium'] td > [data-taco='spinner'] {
|
836
|
+
@apply !h-5 !w-5;
|
837
|
+
}
|
838
|
+
|
835
839
|
table[data-taco^='table'][data-table-font-size='medium'] td > [data-taco='button'],
|
836
840
|
table[data-taco^='table'][data-table-font-size='medium'] td > [data-taco='icon-button'] {
|
837
841
|
@apply !-my-1.5;
|
@@ -877,6 +881,10 @@ table[data-taco^='table'][data-table-font-size='medium'] td [data-taco='input-co
|
|
877
881
|
}
|
878
882
|
|
879
883
|
/* large font size */
|
884
|
+
table[data-taco^='table'][data-table-font-size='large'] td > [data-taco='spinner'] {
|
885
|
+
@apply !h-6 !w-6;
|
886
|
+
}
|
887
|
+
|
880
888
|
table[data-taco^='table'][data-table-font-size='large'] td > [data-taco='button'],
|
881
889
|
table[data-taco^='table'][data-table-font-size='large'] td > [data-taco='icon-button'] {
|
882
890
|
@apply !-my-1;
|
@@ -157,7 +157,6 @@ export declare const defaultLocalisationTexts: {
|
|
157
157
|
filter: string;
|
158
158
|
freezeFirstColumn: string;
|
159
159
|
freezeUptoColumn: string;
|
160
|
-
freezeColumns: (count?: number) => string;
|
161
160
|
gotoRow: string;
|
162
161
|
hideColumn: string;
|
163
162
|
unfreezeColumns: string;
|
@@ -283,21 +282,6 @@ export declare const defaultLocalisationTexts: {
|
|
283
282
|
excludeUnmatchedResults: string;
|
284
283
|
placeholder: string;
|
285
284
|
};
|
286
|
-
shortcuts: {
|
287
|
-
tooltip: string;
|
288
|
-
search: string;
|
289
|
-
filter: string;
|
290
|
-
previousRow: string;
|
291
|
-
nextRow: string;
|
292
|
-
editCell: string;
|
293
|
-
previousColumn: string;
|
294
|
-
nextColumn: string;
|
295
|
-
rowClick: string;
|
296
|
-
selectRow: string;
|
297
|
-
selectAllRows: string;
|
298
|
-
expandRow: string;
|
299
|
-
collapseRow: string;
|
300
|
-
};
|
301
285
|
otherOptions: {
|
302
286
|
tooltip: string;
|
303
287
|
};
|
@@ -315,6 +299,12 @@ export declare const defaultLocalisationTexts: {
|
|
315
299
|
tooltip: string;
|
316
300
|
};
|
317
301
|
};
|
302
|
+
clearChangesConfirmationDialog: {
|
303
|
+
title: string;
|
304
|
+
description: string;
|
305
|
+
cancel: string;
|
306
|
+
confirm: string;
|
307
|
+
};
|
318
308
|
rowIndicator: {
|
319
309
|
rowWillMove: string;
|
320
310
|
rowWillBeHidden: string;
|
@@ -326,25 +316,21 @@ export declare const defaultLocalisationTexts: {
|
|
326
316
|
progress: string;
|
327
317
|
complete: string;
|
328
318
|
};
|
329
|
-
clearChangesConfirmationDialog: {
|
330
|
-
title: string;
|
331
|
-
description: string;
|
332
|
-
cancel: string;
|
333
|
-
confirm: string;
|
334
|
-
};
|
335
319
|
validation: {
|
320
|
+
alert: {
|
321
|
+
titleOne: string;
|
322
|
+
titlePlural: string;
|
323
|
+
messageOne: string;
|
324
|
+
messagePlural: string;
|
325
|
+
messageRow: string;
|
326
|
+
messageAnd: string;
|
327
|
+
};
|
336
328
|
resetFiltersDialog: {
|
337
329
|
title: string;
|
338
330
|
description: string;
|
339
331
|
cancel: string;
|
340
332
|
confirm: string;
|
341
333
|
};
|
342
|
-
alertTitleOne: string;
|
343
|
-
alertTitlePlural: string;
|
344
|
-
alertMessageOne: string;
|
345
|
-
alertMessagePlural: string;
|
346
|
-
alertMessageRow: string;
|
347
|
-
alertMessageAnd: string;
|
348
334
|
};
|
349
335
|
};
|
350
336
|
};
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { Select2OptionProps } from '../components/Option';
|
3
|
+
import { Select2GroupProps } from '../Select2';
|
3
4
|
import { Select2Children, Select2OptionValue, Select2Value } from '../types';
|
4
|
-
export declare const isGroup: (child: React.ReactElement) =>
|
5
|
+
export declare const isGroup: (child: React.ReactElement<Select2OptionProps> | React.ReactElement<Select2GroupProps>) => child is React.ReactElement<Select2GroupProps, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
|
5
6
|
export declare type useChildrenArgs = {
|
6
7
|
children: Select2Children;
|
7
8
|
emptyValue?: Select2OptionValue;
|
@@ -21,3 +21,15 @@ export declare type Account = {
|
|
21
21
|
balance: number;
|
22
22
|
};
|
23
23
|
export declare const accountsData: Account[];
|
24
|
+
export declare type InboxDocument = {
|
25
|
+
date: Date;
|
26
|
+
name: string;
|
27
|
+
sender: string;
|
28
|
+
note: string;
|
29
|
+
amount: number;
|
30
|
+
approved: number;
|
31
|
+
analysed: number;
|
32
|
+
read: boolean;
|
33
|
+
ready: boolean;
|
34
|
+
};
|
35
|
+
export declare function createFakeInboxData(length: number): InboxDocument[];
|
@@ -19,6 +19,12 @@ export declare type Table3Texts = {
|
|
19
19
|
tooltip: string;
|
20
20
|
};
|
21
21
|
};
|
22
|
+
clearChangesConfirmationDialog: {
|
23
|
+
title: string;
|
24
|
+
description: string;
|
25
|
+
cancel: string;
|
26
|
+
confirm: string;
|
27
|
+
};
|
22
28
|
rowIndicator: {
|
23
29
|
rowWillMove: string;
|
24
30
|
rowWillBeHidden: string;
|
@@ -30,25 +36,21 @@ export declare type Table3Texts = {
|
|
30
36
|
progress: string;
|
31
37
|
complete: string;
|
32
38
|
};
|
33
|
-
clearChangesConfirmationDialog: {
|
34
|
-
title: string;
|
35
|
-
description: string;
|
36
|
-
cancel: string;
|
37
|
-
confirm: string;
|
38
|
-
};
|
39
39
|
validation: {
|
40
|
+
alert: {
|
41
|
+
titleOne: string;
|
42
|
+
titlePlural: string;
|
43
|
+
messageOne: string;
|
44
|
+
messagePlural: string;
|
45
|
+
messageRow: string;
|
46
|
+
messageAnd: string;
|
47
|
+
};
|
40
48
|
resetFiltersDialog: {
|
41
49
|
title: string;
|
42
50
|
description: string;
|
43
51
|
cancel: string;
|
44
52
|
confirm: string;
|
45
53
|
};
|
46
|
-
alertTitleOne: string;
|
47
|
-
alertTitlePlural: string;
|
48
|
-
alertMessageOne: string;
|
49
|
-
alertMessagePlural: string;
|
50
|
-
alertMessageRow: string;
|
51
|
-
alertMessageAnd: string;
|
52
54
|
};
|
53
55
|
};
|
54
56
|
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { useTable } from '../../useTable';
|
3
|
-
export declare type TableToolbarProps = React.
|
3
|
+
export declare type TableToolbarProps = React.HTMLAttributes<HTMLDivElement> & {
|
4
4
|
children?: JSX.Element | null;
|
5
5
|
table: ReturnType<typeof useTable>;
|
6
6
|
};
|
@@ -1,8 +1,10 @@
|
|
1
|
-
|
1
|
+
import React from 'react';
|
2
2
|
import { Table as ReactTable } from '@tanstack/react-table';
|
3
|
+
import { TableRef } from '../../../../../types';
|
3
4
|
declare type SearchProps<TType = unknown> = {
|
4
5
|
scrollToIndex: any;
|
5
6
|
table: ReactTable<TType>;
|
7
|
+
tableRef: React.RefObject<TableRef>;
|
6
8
|
};
|
7
9
|
export declare function Search<TType = unknown>(props: SearchProps<TType>): JSX.Element;
|
8
10
|
export {};
|
@@ -83,7 +83,7 @@ export declare type TableShortcutHandlerObject<TType = unknown> = {
|
|
83
83
|
};
|
84
84
|
export declare type TableFilterHandler = (filters: TableColumnFilter[]) => void;
|
85
85
|
export declare type TableFontSize = keyof typeof FontSizes;
|
86
|
-
export declare type TablePreset = '
|
86
|
+
export declare type TablePreset = 'complex' | 'list' | 'simple';
|
87
87
|
export declare type TableRowExpansionRenderer<TType = unknown> = (row: TType) => (() => JSX.Element) | null;
|
88
88
|
export declare type TableScrollToIndexHandler = (index: number, options?: {
|
89
89
|
align: 'start' | 'center' | 'end' | 'auto';
|
@@ -147,7 +147,7 @@ export declare type TableFeatureProps = {
|
|
147
147
|
enableRowHeight?: boolean;
|
148
148
|
enableSaveSettings?: boolean | Partial<EnableSettingsOptions>;
|
149
149
|
};
|
150
|
-
declare type TableCommonProps<TType = unknown> = TableFeatureProps & {
|
150
|
+
export declare type TableCommonProps<TType = unknown> = TableFeatureProps & {
|
151
151
|
children: (JSX.Element | boolean | null | undefined)[];
|
152
152
|
data: TType[];
|
153
153
|
id: string;
|
@@ -4411,7 +4411,6 @@ const defaultLocalisationTexts = {
|
|
4411
4411
|
filter: 'Filter',
|
4412
4412
|
freezeFirstColumn: 'Freeze the first column',
|
4413
4413
|
freezeUptoColumn: `Freeze first [TOTAL] columns`,
|
4414
|
-
freezeColumns: (count = 1) => count === 1 ? 'Freeze the first column' : `Freeze first ${count} columns`,
|
4415
4414
|
gotoRow: 'Go to',
|
4416
4415
|
hideColumn: 'Hide column',
|
4417
4416
|
unfreezeColumns: 'Unfreeze all columns',
|
@@ -4537,21 +4536,6 @@ const defaultLocalisationTexts = {
|
|
4537
4536
|
excludeUnmatchedResults: 'Show only search results',
|
4538
4537
|
placeholder: 'Search...'
|
4539
4538
|
},
|
4540
|
-
shortcuts: {
|
4541
|
-
tooltip: 'View keyboard shortcuts',
|
4542
|
-
search: 'Search',
|
4543
|
-
filter: 'Filter',
|
4544
|
-
previousRow: 'Previous row',
|
4545
|
-
nextRow: 'Next row',
|
4546
|
-
editCell: 'Edit cell',
|
4547
|
-
previousColumn: 'Previous column',
|
4548
|
-
nextColumn: 'Next column',
|
4549
|
-
rowClick: 'Activate current row',
|
4550
|
-
selectRow: 'Select current row',
|
4551
|
-
selectAllRows: 'Select all rows',
|
4552
|
-
expandRow: 'Expand current row',
|
4553
|
-
collapseRow: 'Collapse current row'
|
4554
|
-
},
|
4555
4539
|
otherOptions: {
|
4556
4540
|
tooltip: 'Table settings'
|
4557
4541
|
}
|
@@ -4569,6 +4553,12 @@ const defaultLocalisationTexts = {
|
|
4569
4553
|
tooltip: 'Edit table'
|
4570
4554
|
}
|
4571
4555
|
},
|
4556
|
+
clearChangesConfirmationDialog: {
|
4557
|
+
title: 'Discard changes',
|
4558
|
+
description: 'Are you sure you want to discard changes? Your changes will be lost.',
|
4559
|
+
cancel: 'Continue editing',
|
4560
|
+
confirm: 'Discard'
|
4561
|
+
},
|
4572
4562
|
rowIndicator: {
|
4573
4563
|
rowWillMove: 'Row will move due to sorting',
|
4574
4564
|
rowWillBeHidden: 'Row will hide due to filtering',
|
@@ -4580,25 +4570,21 @@ const defaultLocalisationTexts = {
|
|
4580
4570
|
progress: 'Saving...',
|
4581
4571
|
complete: 'Saved'
|
4582
4572
|
},
|
4583
|
-
clearChangesConfirmationDialog: {
|
4584
|
-
title: 'Discard changes',
|
4585
|
-
description: 'Are you sure you want to discard changes? Your changes will be lost.',
|
4586
|
-
cancel: 'Continue editing',
|
4587
|
-
confirm: 'Discard'
|
4588
|
-
},
|
4589
4573
|
validation: {
|
4574
|
+
alert: {
|
4575
|
+
titleOne: '[COUNT] unsaved entry: ',
|
4576
|
+
titlePlural: '[COUNT] unsaved entries: ',
|
4577
|
+
messageOne: "[COLUMN] [ROW] is incomplete and hasn't been saved.",
|
4578
|
+
messagePlural: "[COLUMN] [ROW] are incomplete and haven't been saved.",
|
4579
|
+
messageRow: 'Row',
|
4580
|
+
messageAnd: ' and '
|
4581
|
+
},
|
4590
4582
|
resetFiltersDialog: {
|
4591
4583
|
title: 'Row is hidden',
|
4592
4584
|
description: 'The row is hidden due to filtering.',
|
4593
4585
|
cancel: 'Cancel',
|
4594
4586
|
confirm: 'Remove filters'
|
4595
|
-
}
|
4596
|
-
alertTitleOne: '[COUNT] unsaved entry: ',
|
4597
|
-
alertTitlePlural: '[COUNT] unsaved entries: ',
|
4598
|
-
alertMessageOne: "[COLUMN] [ROW] is incomplete and hasn't been saved.",
|
4599
|
-
alertMessagePlural: "[COLUMN] [ROW] are incomplete and haven't been saved.",
|
4600
|
-
alertMessageRow: 'Row',
|
4601
|
-
alertMessageAnd: ' and '
|
4587
|
+
}
|
4602
4588
|
}
|
4603
4589
|
}
|
4604
4590
|
},
|
@@ -7905,7 +7891,7 @@ const Trigger$6 = /*#__PURE__*/React.forwardRef(function MenuTrigger(props, ref)
|
|
7905
7891
|
const internalRef = useMergedRef(ref);
|
7906
7892
|
const preventArrowDownShortcut = event => {
|
7907
7893
|
var _internalRef$current;
|
7908
|
-
const isRenderedInTable = !!((_internalRef$current = internalRef.current) !== null && _internalRef$current !== void 0 && _internalRef$current.closest('
|
7894
|
+
const isRenderedInTable = !!((_internalRef$current = internalRef.current) !== null && _internalRef$current !== void 0 && _internalRef$current.closest('tbody'));
|
7909
7895
|
if (isRenderedInTable && event.key === 'ArrowDown') {
|
7910
7896
|
var _internalRef$current2, _internalRef$current3;
|
7911
7897
|
internalRef === null || internalRef === void 0 ? void 0 : (_internalRef$current2 = internalRef.current) === null || _internalRef$current2 === void 0 ? void 0 : (_internalRef$current3 = _internalRef$current2.parentNode) === null || _internalRef$current3 === void 0 ? void 0 : _internalRef$current3.dispatchEvent(createCustomKeyboardEvent(event));
|
@@ -9823,54 +9809,82 @@ const DEFAULT_PRESET = {
|
|
9823
9809
|
enableSaveSettings: false
|
9824
9810
|
};
|
9825
9811
|
const presets = {
|
9826
|
-
|
9812
|
+
// View/edit/create on page
|
9813
|
+
complex: {
|
9827
9814
|
// react-table built-in
|
9828
9815
|
enableFiltering: true,
|
9829
9816
|
enableSearch: true,
|
9830
9817
|
enableSorting: true,
|
9831
9818
|
enableColumnFreezing: true,
|
9832
|
-
enableColumnHiding:
|
9819
|
+
enableColumnHiding: true,
|
9833
9820
|
enableColumnResizing: true,
|
9834
9821
|
enableRowExpansion: true,
|
9835
9822
|
enableRowSelection: true,
|
9836
9823
|
enableRowSelectionSingle: false,
|
9837
9824
|
// custom -- common between all table types
|
9838
|
-
enableColumnOrdering:
|
9839
|
-
enableFontSize:
|
9825
|
+
enableColumnOrdering: true,
|
9826
|
+
enableFontSize: true,
|
9840
9827
|
enableFooter: true,
|
9841
|
-
enablePrinting:
|
9828
|
+
enablePrinting: true,
|
9842
9829
|
enableRowActive: true,
|
9843
9830
|
enableRowActions: true,
|
9844
9831
|
enableRowClick: true,
|
9845
9832
|
enableRowDrag: true,
|
9846
9833
|
enableRowDrop: true,
|
9847
9834
|
enableRowGoto: true,
|
9848
|
-
enableRowHeight:
|
9835
|
+
enableRowHeight: true,
|
9849
9836
|
enableSaveSettings: true
|
9850
9837
|
},
|
9851
|
-
|
9838
|
+
// View/create in dialog
|
9839
|
+
list: {
|
9852
9840
|
// react-table built-in
|
9853
|
-
enableFiltering:
|
9841
|
+
enableFiltering: false,
|
9854
9842
|
enableSearch: true,
|
9855
9843
|
enableSorting: true,
|
9856
|
-
enableColumnFreezing:
|
9857
|
-
enableColumnHiding:
|
9858
|
-
enableColumnResizing:
|
9844
|
+
enableColumnFreezing: false,
|
9845
|
+
enableColumnHiding: false,
|
9846
|
+
enableColumnResizing: false,
|
9859
9847
|
enableRowExpansion: true,
|
9860
9848
|
enableRowSelection: true,
|
9861
9849
|
enableRowSelectionSingle: false,
|
9862
9850
|
// custom -- common between all table types
|
9863
|
-
enableColumnOrdering:
|
9864
|
-
enableFontSize:
|
9865
|
-
enableFooter:
|
9866
|
-
enablePrinting:
|
9851
|
+
enableColumnOrdering: false,
|
9852
|
+
enableFontSize: false,
|
9853
|
+
enableFooter: false,
|
9854
|
+
enablePrinting: false,
|
9867
9855
|
enableRowActive: true,
|
9868
9856
|
enableRowActions: true,
|
9869
9857
|
enableRowClick: true,
|
9870
|
-
enableRowDrag:
|
9871
|
-
enableRowDrop:
|
9872
|
-
enableRowGoto:
|
9873
|
-
enableRowHeight:
|
9858
|
+
enableRowDrag: false,
|
9859
|
+
enableRowDrop: false,
|
9860
|
+
enableRowGoto: false,
|
9861
|
+
enableRowHeight: false,
|
9862
|
+
enableSaveSettings: true
|
9863
|
+
},
|
9864
|
+
// View in card or dialog
|
9865
|
+
simple: {
|
9866
|
+
// react-table built-in
|
9867
|
+
enableFiltering: false,
|
9868
|
+
enableSearch: false,
|
9869
|
+
enableSorting: true,
|
9870
|
+
enableColumnFreezing: false,
|
9871
|
+
enableColumnHiding: false,
|
9872
|
+
enableColumnResizing: false,
|
9873
|
+
enableRowExpansion: true,
|
9874
|
+
enableRowSelection: false,
|
9875
|
+
enableRowSelectionSingle: false,
|
9876
|
+
// custom -- common between all table types
|
9877
|
+
enableColumnOrdering: false,
|
9878
|
+
enableFontSize: false,
|
9879
|
+
enableFooter: false,
|
9880
|
+
enablePrinting: false,
|
9881
|
+
enableRowActive: true,
|
9882
|
+
enableRowActions: false,
|
9883
|
+
enableRowClick: true,
|
9884
|
+
enableRowDrag: false,
|
9885
|
+
enableRowDrop: false,
|
9886
|
+
enableRowGoto: false,
|
9887
|
+
enableRowHeight: false,
|
9874
9888
|
enableSaveSettings: true
|
9875
9889
|
}
|
9876
9890
|
};
|
@@ -10108,7 +10122,7 @@ function useTableRowActive(isEnabled = false, initialRowActiveIndex) {
|
|
10108
10122
|
if (!isEnabled || event.isDefaultPrevented()) {
|
10109
10123
|
return;
|
10110
10124
|
}
|
10111
|
-
if (event.target.closest('tbody') ||
|
10125
|
+
if (event.target.closest('tbody') || isElementInsideOrTriggeredFromContainer(event.target, event.currentTarget)) {
|
10112
10126
|
return;
|
10113
10127
|
}
|
10114
10128
|
if (rowActiveIndex === undefined && length > 0) {
|
@@ -11512,16 +11526,16 @@ function Cell$1(context) {
|
|
11512
11526
|
}, /*#__PURE__*/React__default.createElement(Icon, {
|
11513
11527
|
"aria-label": texts.table.columns.drag.tooltip,
|
11514
11528
|
name: "drag",
|
11515
|
-
className: "text-grey-darkest invisible -mt-1 ml-[
|
11529
|
+
className: "text-grey-darkest invisible -mt-1 ml-[2px] cursor-grab active:cursor-grabbing group-hover/row:visible group-[[aria-grabbed='true']]/row:text-white"
|
11516
11530
|
}));
|
11517
11531
|
}
|
11518
11532
|
const renderer$1 = {
|
11519
11533
|
header: Header$2,
|
11520
11534
|
renderer: Cell$1,
|
11521
|
-
size:
|
11535
|
+
size: 20,
|
11522
11536
|
meta: {
|
11523
11537
|
align: 'center',
|
11524
|
-
className: '!px-0 justify-end',
|
11538
|
+
className: '!px-0 !pb-0 justify-end',
|
11525
11539
|
// TODO: remove when table3 is migrated, this satisfies the legacy table3 type
|
11526
11540
|
enableSearch: false,
|
11527
11541
|
header: '',
|
@@ -12683,7 +12697,6 @@ function Body(props) {
|
|
12683
12697
|
// this is a browser level bug and there's not much to be done about it
|
12684
12698
|
const handleMouseLeave = React__default.useCallback(() => tableMeta.rowActive.setRowHoverIndex(undefined), []);
|
12685
12699
|
return /*#__PURE__*/React__default.createElement("tbody", Object.assign({}, attributes, {
|
12686
|
-
"data-taco": "table-body",
|
12687
12700
|
onKeyDown: handleKeyDown,
|
12688
12701
|
onMouseLeave: handleMouseLeave,
|
12689
12702
|
onMouseMove: handleMouseMove,
|
@@ -12721,7 +12734,7 @@ function Summary(props) {
|
|
12721
12734
|
}
|
12722
12735
|
return /*#__PURE__*/React__default.createElement("div", {
|
12723
12736
|
className: "sticky left-0 z-20 flex h-full w-fit items-center whitespace-nowrap bg-white pr-1 shadow-[12px_0px_6px_white]",
|
12724
|
-
"data-taco": "
|
12737
|
+
"data-taco": "table-footer-summary"
|
12725
12738
|
}, label, "\u00A0", count);
|
12726
12739
|
}
|
12727
12740
|
|
@@ -13007,7 +13020,8 @@ function Search$1(props) {
|
|
13007
13020
|
var _tableMeta$search$hig, _tableMeta$search$hig2;
|
13008
13021
|
const {
|
13009
13022
|
scrollToIndex,
|
13010
|
-
table
|
13023
|
+
table,
|
13024
|
+
tableRef
|
13011
13025
|
} = props;
|
13012
13026
|
const {
|
13013
13027
|
texts
|
@@ -13070,6 +13084,22 @@ function Search$1(props) {
|
|
13070
13084
|
checked: !!table.options.enableGlobalFilter,
|
13071
13085
|
onChange: handleToggleExcludeUnmatchedResults
|
13072
13086
|
});
|
13087
|
+
const handleKeyDown = event => {
|
13088
|
+
if (event.key === 'Escape' && tableMeta.search.currentHighlightColumnIndex !== undefined) {
|
13089
|
+
const [rowIndex, cellIndex] = tableMeta.search.highlightedColumnIndexes[tableMeta.search.currentHighlightColumnIndex];
|
13090
|
+
if (rowIndex !== undefined && cellIndex !== undefined) {
|
13091
|
+
tableMeta.rowActive.setRowActiveIndex(rowIndex);
|
13092
|
+
requestAnimationFrame(() => {
|
13093
|
+
var _tableRef$current;
|
13094
|
+
const cell = (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.querySelector(`tbody > tr[data-row-index="${rowIndex}"] > td[data-cell-index="${cellIndex}"]`);
|
13095
|
+
if (cell) {
|
13096
|
+
var _cell$focus;
|
13097
|
+
(_cell$focus = cell.focus) === null || _cell$focus === void 0 ? void 0 : _cell$focus.call(cell);
|
13098
|
+
}
|
13099
|
+
});
|
13100
|
+
}
|
13101
|
+
}
|
13102
|
+
};
|
13073
13103
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(SearchInput2, {
|
13074
13104
|
findCurrent: tableMeta.search.currentHighlightColumnIndex !== undefined ? tableMeta.search.currentHighlightColumnIndex + 1 : null,
|
13075
13105
|
findTotal: (_tableMeta$search$hig = (_tableMeta$search$hig2 = tableMeta.search.highlightedColumnIndexes) === null || _tableMeta$search$hig2 === void 0 ? void 0 : _tableMeta$search$hig2.length) !== null && _tableMeta$search$hig !== void 0 ? _tableMeta$search$hig : null,
|
@@ -13079,6 +13109,7 @@ function Search$1(props) {
|
|
13079
13109
|
onClickFindNext: handleNextResult,
|
13080
13110
|
onChange: handleChange,
|
13081
13111
|
onFocus: handleFocus,
|
13112
|
+
onKeyDown: handleKeyDown,
|
13082
13113
|
placeholder: texts.table.search.placeholder,
|
13083
13114
|
settingsContent: settings,
|
13084
13115
|
ref: ref,
|
@@ -14759,7 +14790,7 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
14759
14790
|
(_internalRef$current = internalRef.current) === null || _internalRef$current === void 0 ? void 0 : _internalRef$current.focus();
|
14760
14791
|
}
|
14761
14792
|
};
|
14762
|
-
const selectOptions = searchQuery === '' ? flattenedChildren.map(child => child.
|
14793
|
+
const selectOptions = searchQuery === '' ? flattenedChildren.map(child => child.props.value) : filteredChildren.map(child => isGroup(child) ? Array.isArray(child.props.children) && child.props.children.map(subChild => subChild.props.value) : child.props.value).flatMap(c => c) || [];
|
14763
14794
|
const areAllSelected = Array.isArray(value) && selectOptions.every(option => value.includes(option));
|
14764
14795
|
const selectAllText = React__default.useMemo(() => {
|
14765
14796
|
if (searchQuery === '') {
|
@@ -15653,7 +15684,7 @@ function TableToolbar(props) {
|
|
15653
15684
|
className: "mb-4 flex flex-shrink flex-grow-0 flex-wrap gap-2 print:hidden",
|
15654
15685
|
"data-taco": "table-toolbar"
|
15655
15686
|
}), table.props.toolbarLeft, /*#__PURE__*/React__default.createElement(Group, {
|
15656
|
-
className: "ml-auto flex-shrink-0 print:hidden"
|
15687
|
+
className: "ml-auto flex-shrink-0 items-center print:hidden"
|
15657
15688
|
}, customTools, canFilter ? /*#__PURE__*/React__default.createElement(Filters, {
|
15658
15689
|
length: table.meta.length,
|
15659
15690
|
table: table.instance
|
@@ -15664,10 +15695,11 @@ function TableToolbar(props) {
|
|
15664
15695
|
}) : null, canSettings ? /*#__PURE__*/React__default.createElement(Settings$1, {
|
15665
15696
|
customSettings: table.props.customSettings,
|
15666
15697
|
table: table.instance
|
15667
|
-
}) : null, canSearch ? /*#__PURE__*/React__default.createElement(Search$1, {
|
15698
|
+
}) : null, canSearch ? ( /*#__PURE__*/React__default.createElement(Search$1, {
|
15668
15699
|
scrollToIndex: table.renderer.scrollToIndex,
|
15669
|
-
table: table.instance
|
15670
|
-
|
15700
|
+
table: table.instance,
|
15701
|
+
tableRef: table.ref
|
15702
|
+
})) : null)), table.props.toolbarPanel ? /*#__PURE__*/React__default.createElement("div", {
|
15671
15703
|
className: "mb-4"
|
15672
15704
|
}, table.props.toolbarPanel) : undefined);
|
15673
15705
|
}
|
@@ -18308,14 +18340,14 @@ function Alert$1(props) {
|
|
18308
18340
|
});
|
18309
18341
|
}
|
18310
18342
|
// generate the "N unsaved entries" title
|
18311
|
-
const title = (pendingChangesWithErrors.length === 1 ? validationTexts.
|
18343
|
+
const title = (pendingChangesWithErrors.length === 1 ? validationTexts.alert.titleOne : validationTexts.alert.titlePlural).replace('[COUNT]', String(pendingChangesWithErrors.length));
|
18312
18344
|
// generate links to each invalid row, to go into the error message
|
18313
18345
|
const links = [];
|
18314
18346
|
const rowIdentityColumn = tableMeta.rowIdentityColumnId ? table.getColumn(tableMeta.rowIdentityColumnId) : undefined;
|
18315
18347
|
pendingChangesWithErrors.forEach((error, index) => {
|
18316
18348
|
// if appropriate, concatenate the item with the text "and"
|
18317
18349
|
if (pendingChangesWithErrors.length > 1 && index === pendingChangesWithErrors.length - 1) {
|
18318
|
-
links.push(validationTexts.
|
18350
|
+
links.push(validationTexts.alert.messageAnd);
|
18319
18351
|
}
|
18320
18352
|
const handleClick = () => {
|
18321
18353
|
const rowIndex = table.getRowModel().rows.findIndex(row => row.id === error.rowId);
|
@@ -18348,10 +18380,10 @@ function Alert$1(props) {
|
|
18348
18380
|
}
|
18349
18381
|
});
|
18350
18382
|
// generate the "Row N is incomplete and hasn't been saved" error message
|
18351
|
-
const message = (links.length === 1 ? validationTexts.
|
18383
|
+
const message = (links.length === 1 ? validationTexts.alert.messageOne : validationTexts.alert.messagePlural).split(/(\[\w+\])/).map(part => {
|
18352
18384
|
if (part === '[COLUMN]') {
|
18353
18385
|
var _rowIdentityColumn$co, _rowIdentityColumn$co2;
|
18354
|
-
return (_rowIdentityColumn$co = rowIdentityColumn === null || rowIdentityColumn === void 0 ? void 0 : (_rowIdentityColumn$co2 = rowIdentityColumn.columnDef.meta) === null || _rowIdentityColumn$co2 === void 0 ? void 0 : _rowIdentityColumn$co2.header) !== null && _rowIdentityColumn$co !== void 0 ? _rowIdentityColumn$co : validationTexts.
|
18386
|
+
return (_rowIdentityColumn$co = rowIdentityColumn === null || rowIdentityColumn === void 0 ? void 0 : (_rowIdentityColumn$co2 = rowIdentityColumn.columnDef.meta) === null || _rowIdentityColumn$co2 === void 0 ? void 0 : _rowIdentityColumn$co2.header) !== null && _rowIdentityColumn$co !== void 0 ? _rowIdentityColumn$co : validationTexts.alert.messageRow;
|
18355
18387
|
}
|
18356
18388
|
if (part === '[ROW]') {
|
18357
18389
|
return links;
|