react-table-edit 0.0.6 → 0.0.8

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/index.d.mts CHANGED
@@ -138,6 +138,7 @@ type FromItemsField = {
138
138
 
139
139
  declare const notificationSuccess: (param: string) => string;
140
140
  declare const messageBoxError: (t: TFunction<"translation", undefined>, message: string) => void;
141
+ declare const messageHtmlBoxConfirm: (t: TFunction<"translation", undefined>, message: any[], handle: any, data: any, title?: string) => void;
141
142
  declare const messageHtmlBoxError: (t: TFunction<"translation", undefined>, message: any[], title?: string) => void;
142
143
  declare const messageBoxConfirmDelete: (t: TFunction<"translation", undefined>, handle: any, data: any) => void;
143
144
  declare const messageBoxConfirmApprove: (t: TFunction<"translation", undefined>, handle: any, data: any) => void;
@@ -145,4 +146,4 @@ declare const messageBoxConfirm: (t: TFunction<"translation", undefined>, handle
145
146
  declare const notificationError: (param: string) => string;
146
147
  declare const messageBoxConfirm2: (t: TFunction<"translation", undefined>, data: any, data2: any, message: string) => Promise<boolean>;
147
148
 
148
- export { type FromItemsField, type IColumnTable, type ICommandItem, type IFCurrentPage, type IFCurrentPageConfig, type IFPageSize, type IFTableEditProps, type ISettingFormElement, type ISettingNumericElement, type ISettingSelectElement, TableEdit as default, messageBoxConfirm, messageBoxConfirm2, messageBoxConfirmApprove, messageBoxConfirmDelete, messageBoxError, messageHtmlBoxError, notificationError, notificationSuccess };
149
+ export { type FromItemsField, type IColumnTable, type ICommandItem, type IFCurrentPage, type IFCurrentPageConfig, type IFPageSize, type IFTableEditProps, type ISettingFormElement, type ISettingNumericElement, type ISettingSelectElement, TableEdit as default, messageBoxConfirm, messageBoxConfirm2, messageBoxConfirmApprove, messageBoxConfirmDelete, messageBoxError, messageHtmlBoxConfirm, messageHtmlBoxError, notificationError, notificationSuccess };
package/dist/index.d.ts CHANGED
@@ -138,6 +138,7 @@ type FromItemsField = {
138
138
 
139
139
  declare const notificationSuccess: (param: string) => string;
140
140
  declare const messageBoxError: (t: TFunction<"translation", undefined>, message: string) => void;
141
+ declare const messageHtmlBoxConfirm: (t: TFunction<"translation", undefined>, message: any[], handle: any, data: any, title?: string) => void;
141
142
  declare const messageHtmlBoxError: (t: TFunction<"translation", undefined>, message: any[], title?: string) => void;
142
143
  declare const messageBoxConfirmDelete: (t: TFunction<"translation", undefined>, handle: any, data: any) => void;
143
144
  declare const messageBoxConfirmApprove: (t: TFunction<"translation", undefined>, handle: any, data: any) => void;
@@ -145,4 +146,4 @@ declare const messageBoxConfirm: (t: TFunction<"translation", undefined>, handle
145
146
  declare const notificationError: (param: string) => string;
146
147
  declare const messageBoxConfirm2: (t: TFunction<"translation", undefined>, data: any, data2: any, message: string) => Promise<boolean>;
147
148
 
148
- export { type FromItemsField, type IColumnTable, type ICommandItem, type IFCurrentPage, type IFCurrentPageConfig, type IFPageSize, type IFTableEditProps, type ISettingFormElement, type ISettingNumericElement, type ISettingSelectElement, TableEdit as default, messageBoxConfirm, messageBoxConfirm2, messageBoxConfirmApprove, messageBoxConfirmDelete, messageBoxError, messageHtmlBoxError, notificationError, notificationSuccess };
149
+ export { type FromItemsField, type IColumnTable, type ICommandItem, type IFCurrentPage, type IFCurrentPageConfig, type IFPageSize, type IFTableEditProps, type ISettingFormElement, type ISettingNumericElement, type ISettingSelectElement, TableEdit as default, messageBoxConfirm, messageBoxConfirm2, messageBoxConfirmApprove, messageBoxConfirmDelete, messageBoxError, messageHtmlBoxConfirm, messageHtmlBoxError, notificationError, notificationSuccess };
package/dist/index.js CHANGED
@@ -36,6 +36,7 @@ __export(Table_edit_exports, {
36
36
  messageBoxConfirmApprove: () => messageBoxConfirmApprove,
37
37
  messageBoxConfirmDelete: () => messageBoxConfirmDelete,
38
38
  messageBoxError: () => messageBoxError,
39
+ messageHtmlBoxConfirm: () => messageHtmlBoxConfirm,
39
40
  messageHtmlBoxError: () => messageHtmlBoxError,
40
41
  notificationError: () => notificationError,
41
42
  notificationSuccess: () => notificationSuccess
@@ -113,6 +114,27 @@ var messageBoxError = (t, message) => {
113
114
  buttonsStyling: false
114
115
  });
115
116
  };
117
+ var messageHtmlBoxConfirm = (t, message, handle, data, title) => {
118
+ MySwal.fire({
119
+ title: title ? t(title) : t("Important"),
120
+ html: message.map((item, index) => {
121
+ return `<div style="min-width: 448px padding: 7px width:100% border: 1px solid #e0e0e0${index !== 0 ? " border-top-width: 0px" : ""}">${item}</div>`;
122
+ }).join(""),
123
+ allowOutsideClick: false,
124
+ showCancelButton: true,
125
+ confirmButtonText: t("Ok"),
126
+ cancelButtonText: t("Cancel"),
127
+ customClass: {
128
+ confirmButton: "btn btn-primary",
129
+ cancelButton: "btn btn-danger ms-1"
130
+ },
131
+ buttonsStyling: false
132
+ }).then(async (result) => {
133
+ if (result.value) {
134
+ handle(data);
135
+ }
136
+ });
137
+ };
116
138
  var messageHtmlBoxError = (t, message, title) => {
117
139
  MySwal.fire({
118
140
  title: title ? t(title) : t("Important"),
@@ -1466,9 +1488,6 @@ var TableEdit = (0, import_react12.forwardRef)((props, ref) => {
1466
1488
  }, 5);
1467
1489
  };
1468
1490
  const handleDataChange = (row, col, indexRow) => {
1469
- if (dataSourceChange) {
1470
- dataSourceChange(dataSource);
1471
- }
1472
1491
  if (rowChange) {
1473
1492
  const rs = rowChange(row, indexRow, col.field);
1474
1493
  if (rs && rs?.then) {
@@ -1487,6 +1506,9 @@ var TableEdit = (0, import_react12.forwardRef)((props, ref) => {
1487
1506
  }
1488
1507
  }
1489
1508
  }
1509
+ if (dataSourceChange) {
1510
+ dataSourceChange(dataSource);
1511
+ }
1490
1512
  });
1491
1513
  } else {
1492
1514
  for (let index = 0; index <= tableColumns.length; index++) {
@@ -1503,6 +1525,9 @@ var TableEdit = (0, import_react12.forwardRef)((props, ref) => {
1503
1525
  }
1504
1526
  }
1505
1527
  }
1528
+ if (dataSourceChange) {
1529
+ dataSourceChange(dataSource);
1530
+ }
1506
1531
  }
1507
1532
  }
1508
1533
  };
@@ -2710,6 +2735,7 @@ var Table_edit_default = table_default;
2710
2735
  messageBoxConfirmApprove,
2711
2736
  messageBoxConfirmDelete,
2712
2737
  messageBoxError,
2738
+ messageHtmlBoxConfirm,
2713
2739
  messageHtmlBoxError,
2714
2740
  notificationError,
2715
2741
  notificationSuccess
package/dist/index.mjs CHANGED
@@ -69,6 +69,27 @@ var messageBoxError = (t, message) => {
69
69
  buttonsStyling: false
70
70
  });
71
71
  };
72
+ var messageHtmlBoxConfirm = (t, message, handle, data, title) => {
73
+ MySwal.fire({
74
+ title: title ? t(title) : t("Important"),
75
+ html: message.map((item, index) => {
76
+ return `<div style="min-width: 448px padding: 7px width:100% border: 1px solid #e0e0e0${index !== 0 ? " border-top-width: 0px" : ""}">${item}</div>`;
77
+ }).join(""),
78
+ allowOutsideClick: false,
79
+ showCancelButton: true,
80
+ confirmButtonText: t("Ok"),
81
+ cancelButtonText: t("Cancel"),
82
+ customClass: {
83
+ confirmButton: "btn btn-primary",
84
+ cancelButton: "btn btn-danger ms-1"
85
+ },
86
+ buttonsStyling: false
87
+ }).then(async (result) => {
88
+ if (result.value) {
89
+ handle(data);
90
+ }
91
+ });
92
+ };
72
93
  var messageHtmlBoxError = (t, message, title) => {
73
94
  MySwal.fire({
74
95
  title: title ? t(title) : t("Important"),
@@ -1440,9 +1461,6 @@ var TableEdit = forwardRef2((props, ref) => {
1440
1461
  }, 5);
1441
1462
  };
1442
1463
  const handleDataChange = (row, col, indexRow) => {
1443
- if (dataSourceChange) {
1444
- dataSourceChange(dataSource);
1445
- }
1446
1464
  if (rowChange) {
1447
1465
  const rs = rowChange(row, indexRow, col.field);
1448
1466
  if (rs && rs?.then) {
@@ -1461,6 +1479,9 @@ var TableEdit = forwardRef2((props, ref) => {
1461
1479
  }
1462
1480
  }
1463
1481
  }
1482
+ if (dataSourceChange) {
1483
+ dataSourceChange(dataSource);
1484
+ }
1464
1485
  });
1465
1486
  } else {
1466
1487
  for (let index = 0; index <= tableColumns.length; index++) {
@@ -1477,6 +1498,9 @@ var TableEdit = forwardRef2((props, ref) => {
1477
1498
  }
1478
1499
  }
1479
1500
  }
1501
+ if (dataSourceChange) {
1502
+ dataSourceChange(dataSource);
1503
+ }
1480
1504
  }
1481
1505
  }
1482
1506
  };
@@ -2684,6 +2708,7 @@ export {
2684
2708
  messageBoxConfirmApprove,
2685
2709
  messageBoxConfirmDelete,
2686
2710
  messageBoxError,
2711
+ messageHtmlBoxConfirm,
2687
2712
  messageHtmlBoxError,
2688
2713
  notificationError,
2689
2714
  notificationSuccess
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-table-edit",
3
3
  "license": "MIT",
4
- "version": "0.0.6",
4
+ "version": "0.0.8",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",