@snack-uikit/table 0.37.19 → 0.37.20

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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## <small>0.37.20 (2025-11-27)</small>
7
+
8
+ * fix(HCE-284): add data-test-id to export table ([2093390](https://github.com/cloud-ru-tech/snack-uikit/commit/2093390))
9
+
10
+
11
+
12
+
13
+
6
14
  ## <small>0.37.19 (2025-11-26)</small>
7
15
 
8
16
  * fix(PDS-3189): fix selection with shift key for single row selection mode ([2cdfb64](https://github.com/cloud-ru-tech/snack-uikit/commit/2cdfb64))
@@ -34,6 +34,9 @@ export declare const TEST_IDS: {
34
34
  statusIndicator: string;
35
35
  statusLabel: string;
36
36
  toolbar: string;
37
+ exportIcon: string;
38
+ exportCsvAction: string;
39
+ exportXlsxAction: string;
37
40
  };
38
41
  export declare const SORT_FN: {
39
42
  readonly DateTime: "datetime";
@@ -40,7 +40,10 @@ exports.TEST_IDS = {
40
40
  },
41
41
  statusIndicator: 'table__status-indicator',
42
42
  statusLabel: 'table__status-label',
43
- toolbar: 'table__toolbar'
43
+ toolbar: 'table__toolbar',
44
+ exportIcon: 'table__export-icon',
45
+ exportCsvAction: 'table__export-csv__action',
46
+ exportXlsxAction: 'table__export-xlsx__action'
44
47
  };
45
48
  exports.SORT_FN = {
46
49
  DateTime: 'datetime',
@@ -10,6 +10,7 @@ const button_1 = require("@snack-uikit/button");
10
10
  const icons_1 = require("@snack-uikit/icons");
11
11
  const list_1 = require("@snack-uikit/list");
12
12
  const locale_1 = require("@snack-uikit/locale");
13
+ const constants_1 = require("../../constants");
13
14
  function ExportButton(_ref) {
14
15
  let {
15
16
  settings,
@@ -52,7 +53,8 @@ function ExportButton(_ref) {
52
53
  });
53
54
  setIsOpen(false);
54
55
  },
55
- hidden: !settings.exportToCSV
56
+ hidden: !settings.exportToCSV,
57
+ 'data-test-id': constants_1.TEST_IDS.exportCsvAction
56
58
  }, {
57
59
  content: {
58
60
  option: t('export') + 'XLSX'
@@ -66,10 +68,12 @@ function ExportButton(_ref) {
66
68
  });
67
69
  setIsOpen(false);
68
70
  },
69
- hidden: !settings.exportToXLSX
71
+ hidden: !settings.exportToXLSX,
72
+ 'data-test-id': constants_1.TEST_IDS.exportXlsxAction
70
73
  }],
71
74
  children: (0, jsx_runtime_1.jsx)(button_1.ButtonFunction, {
72
75
  size: 'm',
76
+ "data-test-id": constants_1.TEST_IDS.exportIcon,
73
77
  icon: (0, jsx_runtime_1.jsx)(icons_1.DownloadSVG, {})
74
78
  })
75
79
  });
@@ -34,6 +34,9 @@ export declare const TEST_IDS: {
34
34
  statusIndicator: string;
35
35
  statusLabel: string;
36
36
  toolbar: string;
37
+ exportIcon: string;
38
+ exportCsvAction: string;
39
+ exportXlsxAction: string;
37
40
  };
38
41
  export declare const SORT_FN: {
39
42
  readonly DateTime: "datetime";
@@ -35,6 +35,9 @@ export const TEST_IDS = {
35
35
  statusIndicator: 'table__status-indicator',
36
36
  statusLabel: 'table__status-label',
37
37
  toolbar: 'table__toolbar',
38
+ exportIcon: 'table__export-icon',
39
+ exportCsvAction: 'table__export-csv__action',
40
+ exportXlsxAction: 'table__export-xlsx__action',
38
41
  };
39
42
  export const SORT_FN = {
40
43
  DateTime: 'datetime',
@@ -4,6 +4,7 @@ import { ButtonFunction } from '@snack-uikit/button';
4
4
  import { DownloadSVG } from '@snack-uikit/icons';
5
5
  import { Droplist } from '@snack-uikit/list';
6
6
  import { useLocale } from '@snack-uikit/locale';
7
+ import { TEST_IDS } from '../../constants';
7
8
  export function ExportButton({ settings, data, columnDefinitions, topRows, centerRows, }) {
8
9
  const [isOpen, setIsOpen] = useState(false);
9
10
  const { t } = useLocale('Table');
@@ -24,6 +25,7 @@ export function ExportButton({ settings, data, columnDefinitions, topRows, cente
24
25
  setIsOpen(false);
25
26
  },
26
27
  hidden: !settings.exportToCSV,
28
+ 'data-test-id': TEST_IDS.exportCsvAction,
27
29
  },
28
30
  {
29
31
  content: { option: t('export') + 'XLSX' },
@@ -33,6 +35,7 @@ export function ExportButton({ settings, data, columnDefinitions, topRows, cente
33
35
  setIsOpen(false);
34
36
  },
35
37
  hidden: !settings.exportToXLSX,
38
+ 'data-test-id': TEST_IDS.exportXlsxAction,
36
39
  },
37
- ], children: _jsx(ButtonFunction, { size: 'm', icon: _jsx(DownloadSVG, {}) }) }));
40
+ ], children: _jsx(ButtonFunction, { size: 'm', "data-test-id": TEST_IDS.exportIcon, icon: _jsx(DownloadSVG, {}) }) }));
38
41
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "title": "Table",
7
- "version": "0.37.19",
7
+ "version": "0.37.20",
8
8
  "sideEffects": [
9
9
  "*.css",
10
10
  "*.woff",
@@ -65,5 +65,5 @@
65
65
  "peerDependencies": {
66
66
  "@snack-uikit/locale": "*"
67
67
  },
68
- "gitHead": "20705cda6956b2cfe72239357c1e93b55bc3c437"
68
+ "gitHead": "b8c1f0b0f22c324815afb893a1272d62795d9091"
69
69
  }
package/src/constants.ts CHANGED
@@ -38,6 +38,9 @@ export const TEST_IDS = {
38
38
  statusIndicator: 'table__status-indicator',
39
39
  statusLabel: 'table__status-label',
40
40
  toolbar: 'table__toolbar',
41
+ exportIcon: 'table__export-icon',
42
+ exportCsvAction: 'table__export-csv__action',
43
+ exportXlsxAction: 'table__export-xlsx__action',
41
44
  };
42
45
 
43
46
  export const SORT_FN = {
@@ -6,6 +6,7 @@ import { DownloadSVG } from '@snack-uikit/icons';
6
6
  import { Droplist } from '@snack-uikit/list';
7
7
  import { useLocale } from '@snack-uikit/locale';
8
8
 
9
+ import { TEST_IDS } from '../../constants';
9
10
  import { ColumnDefinition } from '../../types';
10
11
 
11
12
  type ExportProps<TData> = { fileName: string; columnDefinitions: ColumnDefinition<TData>[]; data: TData[] };
@@ -70,6 +71,7 @@ export function ExportButton<TData extends object>({
70
71
  setIsOpen(false);
71
72
  },
72
73
  hidden: !settings.exportToCSV,
74
+ 'data-test-id': TEST_IDS.exportCsvAction,
73
75
  },
74
76
  {
75
77
  content: { option: t('export') + 'XLSX' },
@@ -78,10 +80,11 @@ export function ExportButton<TData extends object>({
78
80
  setIsOpen(false);
79
81
  },
80
82
  hidden: !settings.exportToXLSX,
83
+ 'data-test-id': TEST_IDS.exportXlsxAction,
81
84
  },
82
85
  ]}
83
86
  >
84
- <ButtonFunction size='m' icon={<DownloadSVG />} />
87
+ <ButtonFunction size='m' data-test-id={TEST_IDS.exportIcon} icon={<DownloadSVG />} />
85
88
  </Droplist>
86
89
  );
87
90
  }