@economic/taco 1.22.2 → 1.22.4

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 (34) hide show
  1. package/dist/components/Table2/Table2.d.ts +2 -3
  2. package/dist/components/Table2/Table2.stories.d.ts +0 -1
  3. package/dist/components/Table2/hooks/useColumnDefinitions.d.ts +4 -5
  4. package/dist/components/Table2/hooks/useTable.d.ts +2 -2
  5. package/dist/components/Table2/types.d.ts +4 -3
  6. package/dist/esm/packages/taco/src/components/Provider/Localization.js +2 -2
  7. package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
  8. package/dist/esm/packages/taco/src/components/Select2/components/Option.js +1 -1
  9. package/dist/esm/packages/taco/src/components/Select2/components/Option.js.map +1 -1
  10. package/dist/esm/packages/taco/src/components/Table2/Table2.js +10 -23
  11. package/dist/esm/packages/taco/src/components/Table2/Table2.js.map +1 -1
  12. package/dist/esm/packages/taco/src/components/Table2/components/column/Cell.js +9 -12
  13. package/dist/esm/packages/taco/src/components/Table2/components/column/Cell.js.map +1 -1
  14. package/dist/esm/packages/taco/src/components/Table2/hooks/useColumnDefinitions.js +9 -7
  15. package/dist/esm/packages/taco/src/components/Table2/hooks/useColumnDefinitions.js.map +1 -1
  16. package/dist/esm/packages/taco/src/components/Table2/hooks/useTable.js.map +1 -1
  17. package/dist/esm/packages/taco/src/components/Table2/types.js.map +1 -1
  18. package/dist/esm/packages/taco/src/components/Table2/utilities/cell.js +2 -2
  19. package/dist/esm/packages/taco/src/components/Table2/utilities/cell.js.map +1 -1
  20. package/dist/esm/packages/taco/src/components/Table2/utilities/columns.js +25 -18
  21. package/dist/esm/packages/taco/src/components/Table2/utilities/columns.js.map +1 -1
  22. package/dist/esm/packages/taco/src/components/Tag/Tag.js +2 -1
  23. package/dist/esm/packages/taco/src/components/Tag/Tag.js.map +1 -1
  24. package/dist/taco.cjs.development.js +60 -165
  25. package/dist/taco.cjs.development.js.map +1 -1
  26. package/dist/taco.cjs.production.min.js +1 -1
  27. package/dist/taco.cjs.production.min.js.map +1 -1
  28. package/package.json +2 -2
  29. package/types.json +15 -15
  30. package/dist/components/Table2/hooks/useSeparatedChildren.d.ts +0 -1
  31. package/dist/esm/packages/taco/src/components/Table2/components/ShortcutsGuideButton.js +0 -92
  32. package/dist/esm/packages/taco/src/components/Table2/components/ShortcutsGuideButton.js.map +0 -1
  33. package/dist/esm/packages/taco/src/components/Table2/hooks/useSeparatedChildren.js +0 -21
  34. package/dist/esm/packages/taco/src/components/Table2/hooks/useSeparatedChildren.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@economic/taco",
3
- "version": "1.22.2",
3
+ "version": "1.22.4",
4
4
  "description": "> TODO: description",
5
5
  "author": "Matt Daly <matthew.daly@visma.com>",
6
6
  "homepage": "https://github.com/e-conomic/taco#readme",
@@ -131,5 +131,5 @@
131
131
  "not ie < 11"
132
132
  ]
133
133
  },
134
- "gitHead": "fcf2da6d34416a6b54986d93b220126087ccf9f3"
134
+ "gitHead": "8655cb8799aa31e36d3267de11ff13a68c86e0a7"
135
135
  }
package/types.json CHANGED
@@ -2986,7 +2986,7 @@
2986
2986
  {
2987
2987
  "type": "reflection",
2988
2988
  "declaration": {
2989
- "id": 2947,
2989
+ "id": 2945,
2990
2990
  "name": "__type",
2991
2991
  "kind": 65536,
2992
2992
  "kindString": "Type literal",
@@ -3949,11 +3949,6 @@
3949
3949
  ]
3950
3950
  }
3951
3951
  },
3952
- {
3953
- "name": "Toolbar",
3954
- "optional": false,
3955
- "type": "FunctionComponent<Table2ToolbarProps>"
3956
- },
3957
3952
  {
3958
3953
  "arguments": {
3959
3954
  "props": {
@@ -4528,6 +4523,7 @@
4528
4523
  }
4529
4524
  ]
4530
4525
  },
4526
+ "Table2Children": "undefined,null,false,true,ReactElement<Table2ColumnProps<[object Object]>, string | [object Object] | [object Object]>[]",
4531
4527
  "Table2ColumnControlProps": {
4532
4528
  "props": [
4533
4529
  {
@@ -4719,11 +4715,6 @@
4719
4715
  "optional": true,
4720
4716
  "type": "boolean"
4721
4717
  },
4722
- {
4723
- "name": "disableTruncation",
4724
- "optional": true,
4725
- "type": "boolean"
4726
- },
4727
4718
  {
4728
4719
  "name": "footer",
4729
4720
  "optional": true,
@@ -4817,7 +4808,7 @@
4817
4808
  {
4818
4809
  "name": "children",
4819
4810
  "optional": false,
4820
- "type": "null,false,true,ReactElement<Table2ColumnProps<[object Object]>, string | [object Object] | [object Object]>[]"
4811
+ "type": "Table2Children"
4821
4812
  },
4822
4813
  {
4823
4814
  "name": "className",
@@ -4957,6 +4948,16 @@
4957
4948
  "name": "settings",
4958
4949
  "optional": true,
4959
4950
  "type": "Table2Settings"
4951
+ },
4952
+ {
4953
+ "name": "toolbarLeft",
4954
+ "optional": true,
4955
+ "type": "JSX.Element"
4956
+ },
4957
+ {
4958
+ "name": "toolbarRight",
4959
+ "optional": true,
4960
+ "type": "JSX.Element"
4960
4961
  }
4961
4962
  ]
4962
4963
  },
@@ -5118,8 +5119,7 @@
5118
5119
  "type": "SortingState"
5119
5120
  }
5120
5121
  ]
5121
- },
5122
- "Table2ToolbarProps": "HTMLAttributes<HTMLDivElement>"
5122
+ }
5123
5123
  },
5124
5124
  "EditModeButton": {
5125
5125
  "EditModeButtonProps": {
@@ -5704,7 +5704,7 @@
5704
5704
  "type": "query",
5705
5705
  "queryType": {
5706
5706
  "type": "reference",
5707
- "id": 2799,
5707
+ "id": 2797,
5708
5708
  "name": "TAG_COLORS"
5709
5709
  }
5710
5710
  }
@@ -1 +0,0 @@
1
- export declare const useSeparatedChildren: (initialChildren: any) => any[];
@@ -1,92 +0,0 @@
1
- import React__default from 'react';
2
- import { IconButton } from '../../IconButton/IconButton.js';
3
- import { useLocalization } from '../../Provider/Localization.js';
4
- import { Popover } from '../../Popover/Popover.js';
5
- import { Shortcut } from '../../Shortcut/Shortcut.js';
6
-
7
- const ShortcutsGuideButton = ({
8
- table
9
- }) => {
10
- const meta = table.options.meta;
11
- const {
12
- texts
13
- } = useLocalization();
14
- const shortcuts = [];
15
- if (table.options.enableGlobalFilter) {
16
- shortcuts.push({
17
- feature: texts.table2.shortcuts.search,
18
- keys: ['Ctrl', 'F']
19
- });
20
- }
21
- if (table.options.enableColumnFilters) {
22
- shortcuts.push({
23
- feature: texts.table2.shortcuts.filter,
24
- keys: ['Ctrl', 'Shift', 'F']
25
- });
26
- }
27
- shortcuts.push({
28
- feature: texts.table2.shortcuts.previousRow,
29
- keys: ['Up']
30
- });
31
- shortcuts.push({
32
- feature: texts.table2.shortcuts.nextRow,
33
- keys: ['Down']
34
- });
35
- if (meta.editMode.enableEditMode) {
36
- shortcuts.push({
37
- feature: texts.table2.shortcuts.editCell,
38
- keys: ['Enter']
39
- });
40
- shortcuts.push({
41
- feature: texts.table2.shortcuts.previousColumn,
42
- keys: ['Arrow-Left']
43
- });
44
- shortcuts.push({
45
- feature: texts.table2.shortcuts.nextColumn,
46
- keys: ['Arrow-Right']
47
- });
48
- } else if (meta.onRowClick) {
49
- shortcuts.push({
50
- feature: texts.table2.shortcuts.rowClick,
51
- keys: ['Enter']
52
- });
53
- }
54
- if (table.options.enableRowSelection) {
55
- shortcuts.push({
56
- feature: texts.table2.shortcuts.selectRow,
57
- keys: ['Space']
58
- });
59
- shortcuts.push({
60
- feature: texts.table2.shortcuts.selectAllRows,
61
- keys: ['Ctrl', 'A']
62
- });
63
- }
64
- if (table.options.enableExpanding) {
65
- shortcuts.push({
66
- feature: texts.table2.shortcuts.expandRow,
67
- keys: ['Ctrl', 'Right']
68
- });
69
- shortcuts.push({
70
- feature: texts.table2.shortcuts.collapseRow,
71
- keys: ['Ctrl', 'Left']
72
- });
73
- }
74
- return /*#__PURE__*/React__default.createElement(IconButton, {
75
- "aria-label": texts.table2.shortcuts.tooltip,
76
- icon: "shortcuts",
77
- popover: popoverProps => /*#__PURE__*/React__default.createElement(Popover, Object.assign({}, popoverProps), /*#__PURE__*/React__default.createElement(Popover.Content, {
78
- align: "end"
79
- }, /*#__PURE__*/React__default.createElement("div", {
80
- className: "flex flex-col gap-y-1"
81
- }, shortcuts.map(shortcut => /*#__PURE__*/React__default.createElement("span", {
82
- className: "flex items-center justify-between gap-x-8",
83
- key: shortcut.feature
84
- }, /*#__PURE__*/React__default.createElement("span", null, shortcut.feature), /*#__PURE__*/React__default.createElement(Shortcut, {
85
- keys: shortcut.keys
86
- })))))),
87
- rounded: true
88
- });
89
- };
90
-
91
- export { ShortcutsGuideButton };
92
- //# sourceMappingURL=ShortcutsGuideButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ShortcutsGuideButton.js","sources":["../../../../../../../../src/components/Table2/components/ShortcutsGuideButton.tsx"],"sourcesContent":["import React from 'react';\nimport { Table as RTTable, TableMeta } from '@tanstack/react-table';\nimport { IconButton } from '../../IconButton/IconButton';\nimport { Popover } from '../../Popover/Popover';\nimport { Shortcut } from '../../Shortcut/Shortcut';\nimport { useLocalization } from '../../Provider/Localization';\n\ntype ShortcutGuideShortcut = {\n feature: string;\n keys: string[];\n};\n\ntype ShortcutsGuideButtonProps = {\n table: RTTable<any>;\n};\n\nexport const ShortcutsGuideButton = ({ table }: ShortcutsGuideButtonProps) => {\n const meta = table.options.meta as TableMeta<any>;\n const { texts } = useLocalization();\n\n const shortcuts: ShortcutGuideShortcut[] = [];\n\n if (table.options.enableGlobalFilter) {\n shortcuts.push({\n feature: texts.table2.shortcuts.search,\n keys: ['Ctrl', 'F'],\n });\n }\n\n if (table.options.enableColumnFilters) {\n shortcuts.push({\n feature: texts.table2.shortcuts.filter,\n keys: ['Ctrl', 'Shift', 'F'],\n });\n }\n\n shortcuts.push({\n feature: texts.table2.shortcuts.previousRow,\n keys: ['Up'],\n });\n shortcuts.push({\n feature: texts.table2.shortcuts.nextRow,\n keys: ['Down'],\n });\n\n if (meta.editMode.enableEditMode) {\n shortcuts.push({\n feature: texts.table2.shortcuts.editCell,\n keys: ['Enter'],\n });\n shortcuts.push({\n feature: texts.table2.shortcuts.previousColumn,\n keys: ['Arrow-Left'],\n });\n shortcuts.push({\n feature: texts.table2.shortcuts.nextColumn,\n keys: ['Arrow-Right'],\n });\n } else if (meta.onRowClick) {\n shortcuts.push({\n feature: texts.table2.shortcuts.rowClick,\n keys: ['Enter'],\n });\n }\n\n if (table.options.enableRowSelection) {\n shortcuts.push({\n feature: texts.table2.shortcuts.selectRow,\n keys: ['Space'],\n });\n shortcuts.push({\n feature: texts.table2.shortcuts.selectAllRows,\n keys: ['Ctrl', 'A'],\n });\n }\n\n if (table.options.enableExpanding) {\n shortcuts.push({\n feature: texts.table2.shortcuts.expandRow,\n keys: ['Ctrl', 'Right'],\n });\n shortcuts.push({\n feature: texts.table2.shortcuts.collapseRow,\n keys: ['Ctrl', 'Left'],\n });\n }\n\n return (\n <IconButton\n aria-label={texts.table2.shortcuts.tooltip}\n icon=\"shortcuts\"\n popover={popoverProps => (\n <Popover {...popoverProps}>\n <Popover.Content align=\"end\">\n <div className=\"flex flex-col gap-y-1\">\n {shortcuts.map(shortcut => (\n <span className=\"flex items-center justify-between gap-x-8\" key={shortcut.feature}>\n <span>{shortcut.feature}</span>\n <Shortcut keys={shortcut.keys} />\n </span>\n ))}\n </div>\n </Popover.Content>\n </Popover>\n )}\n rounded\n />\n );\n};\n"],"names":["ShortcutsGuideButton","table","meta","options","texts","useLocalization","shortcuts","enableGlobalFilter","push","feature","table2","search","keys","enableColumnFilters","filter","previousRow","nextRow","editMode","enableEditMode","editCell","previousColumn","nextColumn","onRowClick","rowClick","enableRowSelection","selectRow","selectAllRows","enableExpanding","expandRow","collapseRow","React","IconButton","tooltip","icon","popover","popoverProps","Popover","Content","align","className","map","shortcut","key","Shortcut","rounded"],"mappings":";;;;;;MAgBaA,oBAAoB,GAAG,CAAC;EAAEC;CAAkC;EACrE,MAAMC,IAAI,GAAGD,KAAK,CAACE,OAAO,CAACD,IAAsB;EACjD,MAAM;IAAEE;GAAO,GAAGC,eAAe,EAAE;EAEnC,MAAMC,S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Q,eAC/BqB,6BAACa,QAAQ;MAAC/B,IAAI,EAAE6B,QAAQ,CAAC7B;MAAQ,CAExC,CAAC,CACA,CACQ,CAEzB;IACDgC,OAAO;IACT;AAEV;;;;"}
@@ -1,21 +0,0 @@
1
- import React__default from 'react';
2
-
3
- const useSeparatedChildren = initialChildren => {
4
- return React__default.useMemo(() => {
5
- const columns = [];
6
- let toolbar;
7
- React__default.Children.toArray(initialChildren).filter(child => !!child) // skip falsey columns
8
- .forEach(child => {
9
- var _child$type, _child$type2;
10
- if (((_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) === 'Table2Column') {
11
- columns.push(child);
12
- } else if (((_child$type2 = child.type) === null || _child$type2 === void 0 ? void 0 : _child$type2.displayName) === 'Table2Toolbar') {
13
- toolbar = child;
14
- }
15
- });
16
- return [columns, toolbar];
17
- }, [initialChildren]);
18
- };
19
-
20
- export { useSeparatedChildren };
21
- //# sourceMappingURL=useSeparatedChildren.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useSeparatedChildren.js","sources":["../../../../../../../../src/components/Table2/hooks/useSeparatedChildren.ts"],"sourcesContent":["import React from 'react';\n\nexport const useSeparatedChildren = initialChildren => {\n return React.useMemo(() => {\n const columns: any[] = [];\n let toolbar;\n\n React.Children.toArray(initialChildren)\n .filter((child: any) => !!child) // skip falsey columns\n .forEach((child: any) => {\n if (child.type?.displayName === 'Table2Column') {\n columns.push(child);\n } else if (child.type?.displayName === 'Table2Toolbar') {\n toolbar = child;\n }\n });\n\n return [columns, toolbar];\n }, [initialChildren]);\n};\n"],"names":["useSeparatedChildren","initialChildren","React","useMemo","columns","toolbar","Children","toArray","filter","child","forEach","type","displayName","push"],"mappings":";;MAEaA,oBAAoB,GAAGC,eAAe;EAC/C,OAAOC,cAAK,CAACC,OAAO,CAAC;IACjB,MAAMC,OAAO,GAAU,EAAE;IACzB,IAAIC,OAAO;IAEXH,cAAK,CAACI,QAAQ,CAACC,OAAO,CAACN,eAAe,CAAC,CAClCO,MAAM,CAAEC,KAAU,IAAK,CAAC,CAACA,KAAK,CAAC;KAC/BC,OAAO,CAAED,KAAU;;MAChB,IAAI,gBAAAA,KAAK,CAACE,IAAI,gDAAV,YAAYC,WAAW,MAAK,cAAc,EAAE;QAC5CR,OAAO,CAACS,IAAI,CAACJ,KAAK,CAAC;OACtB,MAAM,IAAI,iBAAAA,KAAK,CAACE,IAAI,iDAAV,aAAYC,WAAW,MAAK,eAAe,EAAE;QACpDP,OAAO,GAAGI,KAAK;;KAEtB,CAAC;IAEN,OAAO,CAACL,OAAO,EAAEC,OAAO,CAAC;GAC5B,EAAE,CAACJ,eAAe,CAAC,CAAC;AACzB;;;;"}