nillud-data-table 1.4.4 → 1.4.6

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.
@@ -1,40 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
- var __hasOwnProp = Object.prototype.hasOwnProperty;
4
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __spreadValues = (a, b) => {
7
- for (var prop in b || (b = {}))
8
- if (__hasOwnProp.call(b, prop))
9
- __defNormalProp(a, prop, b[prop]);
10
- if (__getOwnPropSymbols)
11
- for (var prop of __getOwnPropSymbols(b)) {
12
- if (__propIsEnum.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- }
15
- return a;
16
- };
17
- var __async = (__this, __arguments, generator) => {
18
- return new Promise((resolve, reject) => {
19
- var fulfilled = (value) => {
20
- try {
21
- step(generator.next(value));
22
- } catch (e) {
23
- reject(e);
24
- }
25
- };
26
- var rejected = (value) => {
27
- try {
28
- step(generator.throw(value));
29
- } catch (e) {
30
- reject(e);
31
- }
32
- };
33
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
34
- step((generator = generator.apply(__this, __arguments)).next());
35
- });
36
- };
37
-
38
1
  // components/export/export-excel/exportUtils.ts
39
2
  var generateExcelColumns = (columns, exportCustomColumns) => {
40
3
  let excelColumns = columns.filter((column) => column.title !== "").map((column) => ({
@@ -45,7 +8,7 @@ var generateExcelColumns = (columns, exportCustomColumns) => {
45
8
  if (exportCustomColumns) {
46
9
  exportCustomColumns.forEach((custom) => {
47
10
  excelColumns = excelColumns.map(
48
- (col) => col.key === custom.key ? __spreadValues(__spreadValues({}, col), custom) : col
11
+ (col) => col.key === custom.key ? { ...col, ...custom } : col
49
12
  );
50
13
  });
51
14
  }
@@ -120,7 +83,7 @@ var setColumnAutoWidths = (sheet) => {
120
83
  import ExcelJS from "exceljs";
121
84
  import { jsx } from "react/jsx-runtime";
122
85
  var ExportExcel = ({ columns, excelData, tableRef, titleFile, title, text, exportCustomColumns, customHeight }) => {
123
- const exportExcel = () => __async(null, null, function* () {
86
+ const exportExcel = async () => {
124
87
  const tableData = excelData || tableRef.current.getData();
125
88
  const workbook = new ExcelJS.Workbook();
126
89
  const sheet = workbook.addWorksheet(titleFile, {
@@ -184,7 +147,7 @@ var ExportExcel = ({ columns, excelData, tableRef, titleFile, title, text, expor
184
147
  anchor.click();
185
148
  window.URL.revokeObjectURL(url);
186
149
  });
187
- });
150
+ };
188
151
  return /* @__PURE__ */ jsx("button", { className: `ndt-buttonExport ndt-Excel`, onClick: exportExcel, children: "\u0421\u043A\u0430\u0447\u0430\u0442\u044C Excel" });
189
152
  };
190
153
  var ExportExcel_default = ExportExcel;
@@ -29,6 +29,6 @@ type ExportWordTypes = {
29
29
  options?: ExportOptions;
30
30
  };
31
31
 
32
- declare const WordExport: ({ wordData, columns, title, options }: ExportWordTypes) => react_jsx_runtime.JSX.Element;
32
+ declare const ExportWord: ({ wordData, columns, title, options }: ExportWordTypes) => react_jsx_runtime.JSX.Element;
33
33
 
34
- export { type ExportWordTypes, WordExport };
34
+ export { type ExportWordTypes, ExportWord as WordExport };
@@ -1,24 +1,3 @@
1
- var __async = (__this, __arguments, generator) => {
2
- return new Promise((resolve, reject) => {
3
- var fulfilled = (value) => {
4
- try {
5
- step(generator.next(value));
6
- } catch (e) {
7
- reject(e);
8
- }
9
- };
10
- var rejected = (value) => {
11
- try {
12
- step(generator.throw(value));
13
- } catch (e) {
14
- reject(e);
15
- }
16
- };
17
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18
- step((generator = generator.apply(__this, __arguments)).next());
19
- });
20
- };
21
-
22
1
  // components/export/export-word/ExportHelpers.ts
23
2
  function prepareExportRows(columns, data) {
24
3
  return data.map(
@@ -32,7 +11,7 @@ function prepareExportHeaders(columns) {
32
11
  return columns.map((col) => col.title);
33
12
  }
34
13
 
35
- // components/export/export-word/ExportWord.tsx
14
+ // components/export/export-word/WordExport.tsx
36
15
  import {
37
16
  AlignmentType,
38
17
  Document,
@@ -48,7 +27,7 @@ import {
48
27
  } from "docx";
49
28
  import { saveAs } from "file-saver";
50
29
  import { jsx } from "react/jsx-runtime";
51
- var WordExport = ({
30
+ var ExportWord = ({
52
31
  wordData,
53
32
  columns,
54
33
  title,
@@ -59,7 +38,7 @@ var WordExport = ({
59
38
  maxColumnsBeforeLandscape: 5
60
39
  }
61
40
  }) => {
62
- const createNewWord = () => __async(null, null, function* () {
41
+ const createNewWord = async () => {
63
42
  const {
64
43
  fontSize = 0,
65
44
  boldHeaders = true,
@@ -108,10 +87,10 @@ var WordExport = ({
108
87
  Packer.toBlob(doc).then((blob) => {
109
88
  saveAs(blob, `${title}.docx`);
110
89
  });
111
- });
90
+ };
112
91
  return /* @__PURE__ */ jsx("button", { className: `ndt-buttonExport ndt-Word}`, onClick: createNewWord, children: "\u0421\u043A\u0430\u0447\u0430\u0442\u044C Word" });
113
92
  };
114
- var ExportWord_default = WordExport;
93
+ var WordExport_default = ExportWord;
115
94
  export {
116
- ExportWord_default as WordExport
95
+ WordExport_default as WordExport
117
96
  };
package/package.json CHANGED
@@ -1,52 +1,52 @@
1
- {
2
- "name": "nillud-data-table",
3
- "version": "1.4.4",
4
- "type": "module",
5
- "main": "./dist/index.js",
6
- "module": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
- "style": "./dist/styles.css",
9
- "files": [
10
- "dist",
11
- "dist/export/export-excel",
12
- "dist/export/export-word"
13
- ],
14
- "exports": {
15
- ".": {
16
- "import": "./dist/index.js",
17
- "types": "./dist/index.d.ts"
18
- },
19
- "./types": "./dist/index.d.ts",
20
- "./styles.css": "./dist/styles.css",
21
- "./export-excel": {
22
- "import": "./dist/export/export-excel/index.js",
23
- "require": "./dist/export/export-excel/index.js",
24
- "types": "./dist/export/export-excel/index.d.ts"
25
- },
26
- "./export-word": {
27
- "import": "./dist/export/export-word/index.js",
28
- "require": "./dist/export/export-word/index.js",
29
- "types": "./dist/export/export-word/index.d.ts"
30
- }
31
- },
32
- "peerDependencies": {
33
- "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
34
- "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
35
- "docx": "^8.1.2",
36
- "exceljs": "^4.3.0",
37
- "file-saver": "^2.0.5"
38
- },
39
- "devDependencies": {
40
- "@types/file-saver": "^2.0.7",
41
- "@types/react": "^19.1.3",
42
- "@types/react-dom": "^19.1.3",
43
- "sass": "^1.87.0",
44
- "tsup": "^8.4.0",
45
- "typescript": "^5.8.3"
46
- },
47
- "optionalDependencies": {},
48
- "scripts": {
49
- "build": "tsup && npm run build:styles",
50
- "build:styles": "node build-styles.js"
51
- }
1
+ {
2
+ "name": "nillud-data-table",
3
+ "version": "1.4.6",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "style": "./dist/styles.css",
9
+ "files": [
10
+ "dist",
11
+ "dist/export/export-excel",
12
+ "dist/export/export-word"
13
+ ],
14
+ "exports": {
15
+ ".": {
16
+ "import": "./dist/index.js",
17
+ "types": "./dist/index.d.ts"
18
+ },
19
+ "./types": "./dist/index.d.ts",
20
+ "./styles.css": "./dist/styles.css",
21
+ "./export-excel": {
22
+ "import": "./dist/export/export-excel/index.js",
23
+ "types": "./dist/export/export-excel/index.d.ts"
24
+ },
25
+ "./export-word": {
26
+ "import": "./dist/export/export-word/index.js",
27
+ "types": "./dist/export/export-word/index.d.ts"
28
+ }
29
+ },
30
+ "peerDependencies": {
31
+ "docx": "^8.1.2",
32
+ "exceljs": "^4.3.0",
33
+ "file-saver": "^2.0.5",
34
+ "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
35
+ "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
36
+ },
37
+ "devDependencies": {
38
+ "@types/file-saver": "^2.0.7",
39
+ "@types/exceljs": "^4.3.1",
40
+ "@types/docx": "^8.1.2",
41
+ "@types/node": "^20.11.0",
42
+ "@types/react": "^19.1.3",
43
+ "@types/react-dom": "^19.1.3",
44
+ "sass": "^1.87.0",
45
+ "tsup": "^8.4.0",
46
+ "typescript": "^5.8.3"
47
+ },
48
+ "scripts": {
49
+ "build": "tsup && npm run build:styles",
50
+ "build:styles": "node build-styles.js"
51
+ }
52
52
  }