react-table-edit 0.3.1 → 0.3.2
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 +18 -1
- package/dist/index.d.ts +18 -1
- package/dist/index.js +51 -23
- package/dist/index.mjs +43 -22
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -152,4 +152,21 @@ declare const notificationError: (param: string) => string;
|
|
|
152
152
|
declare const notificationSuccess: (param: string) => string;
|
|
153
153
|
declare const messageBoxConfirm2: (t: TFunction<"translation", undefined>, data: any, data2: any, message: string) => Promise<boolean>;
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
declare const useOnClickOutside: (ref: any, handler: any) => void;
|
|
156
|
+
declare const isNullOrUndefined: (d: any) => boolean;
|
|
157
|
+
declare const generateUUID: () => string;
|
|
158
|
+
/**
|
|
159
|
+
* format chuỗi kí tự số
|
|
160
|
+
* @param str chuỗi số cần format
|
|
161
|
+
* @param decimalSeparator kí tự thập phân
|
|
162
|
+
* @param thousandSeparator kí tự phân cách hàng nghìn
|
|
163
|
+
* @param fraction số kí tự thập phân
|
|
164
|
+
* @param isDone đã nhập xong
|
|
165
|
+
* @returns
|
|
166
|
+
*/
|
|
167
|
+
declare const objSymbolDecimal: any;
|
|
168
|
+
declare const objSymbolThousand: any;
|
|
169
|
+
declare const formartNumberic: (str: string | number, decimalSeparator: string, thousandSeparator: string, fraction?: number, isDone?: boolean) => string;
|
|
170
|
+
declare const roundNumber: (num: number, fraction: number) => number;
|
|
171
|
+
|
|
172
|
+
export { type FromItemsField, type IColumnTable, type ICommandItem, type IFCurrentPage, type IFCurrentPageConfig, type IFPageSize, type IFTableEditProps, type IFToolbarOptions, type ISettingFormElement, type ISettingNumericElement, type ISettingSelectElement, TableEdit as default, formartNumberic, generateUUID, isNullOrUndefined, messageBoxConfirm, messageBoxConfirm2, messageBoxConfirmDelete, messageBoxError, messageHtmlBoxConfirm, messageHtmlBoxError, notificationError, notificationSuccess, objSymbolDecimal, objSymbolThousand, roundNumber, useOnClickOutside };
|
package/dist/index.d.ts
CHANGED
|
@@ -152,4 +152,21 @@ declare const notificationError: (param: string) => string;
|
|
|
152
152
|
declare const notificationSuccess: (param: string) => string;
|
|
153
153
|
declare const messageBoxConfirm2: (t: TFunction<"translation", undefined>, data: any, data2: any, message: string) => Promise<boolean>;
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
declare const useOnClickOutside: (ref: any, handler: any) => void;
|
|
156
|
+
declare const isNullOrUndefined: (d: any) => boolean;
|
|
157
|
+
declare const generateUUID: () => string;
|
|
158
|
+
/**
|
|
159
|
+
* format chuỗi kí tự số
|
|
160
|
+
* @param str chuỗi số cần format
|
|
161
|
+
* @param decimalSeparator kí tự thập phân
|
|
162
|
+
* @param thousandSeparator kí tự phân cách hàng nghìn
|
|
163
|
+
* @param fraction số kí tự thập phân
|
|
164
|
+
* @param isDone đã nhập xong
|
|
165
|
+
* @returns
|
|
166
|
+
*/
|
|
167
|
+
declare const objSymbolDecimal: any;
|
|
168
|
+
declare const objSymbolThousand: any;
|
|
169
|
+
declare const formartNumberic: (str: string | number, decimalSeparator: string, thousandSeparator: string, fraction?: number, isDone?: boolean) => string;
|
|
170
|
+
declare const roundNumber: (num: number, fraction: number) => number;
|
|
171
|
+
|
|
172
|
+
export { type FromItemsField, type IColumnTable, type ICommandItem, type IFCurrentPage, type IFCurrentPageConfig, type IFPageSize, type IFTableEditProps, type IFToolbarOptions, type ISettingFormElement, type ISettingNumericElement, type ISettingSelectElement, TableEdit as default, formartNumberic, generateUUID, isNullOrUndefined, messageBoxConfirm, messageBoxConfirm2, messageBoxConfirmDelete, messageBoxError, messageHtmlBoxConfirm, messageHtmlBoxError, notificationError, notificationSuccess, objSymbolDecimal, objSymbolThousand, roundNumber, useOnClickOutside };
|
package/dist/index.js
CHANGED
|
@@ -31,6 +31,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var Table_edit_exports = {};
|
|
32
32
|
__export(Table_edit_exports, {
|
|
33
33
|
default: () => Table_edit_default,
|
|
34
|
+
formartNumberic: () => formartNumberic,
|
|
35
|
+
generateUUID: () => generateUUID,
|
|
36
|
+
isNullOrUndefined: () => isNullOrUndefined,
|
|
34
37
|
messageBoxConfirm: () => messageBoxConfirm,
|
|
35
38
|
messageBoxConfirm2: () => messageBoxConfirm2,
|
|
36
39
|
messageBoxConfirmDelete: () => messageBoxConfirmDelete,
|
|
@@ -38,7 +41,11 @@ __export(Table_edit_exports, {
|
|
|
38
41
|
messageHtmlBoxConfirm: () => messageHtmlBoxConfirm,
|
|
39
42
|
messageHtmlBoxError: () => messageHtmlBoxError,
|
|
40
43
|
notificationError: () => notificationError,
|
|
41
|
-
notificationSuccess: () => notificationSuccess
|
|
44
|
+
notificationSuccess: () => notificationSuccess,
|
|
45
|
+
objSymbolDecimal: () => objSymbolDecimal,
|
|
46
|
+
objSymbolThousand: () => objSymbolThousand,
|
|
47
|
+
roundNumber: () => roundNumber,
|
|
48
|
+
useOnClickOutside: () => useOnClickOutside
|
|
42
49
|
});
|
|
43
50
|
module.exports = __toCommonJS(Table_edit_exports);
|
|
44
51
|
|
|
@@ -269,6 +276,8 @@ var generateUUID = () => {
|
|
|
269
276
|
return (c === "x" ? r : 3).toString(16);
|
|
270
277
|
});
|
|
271
278
|
};
|
|
279
|
+
var objSymbolDecimal = { 0: ",", 1: "." };
|
|
280
|
+
var objSymbolThousand = { 1: ",", 0: "." };
|
|
272
281
|
var formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 10, isDone) => {
|
|
273
282
|
if (isDone) {
|
|
274
283
|
str = roundNumber(Number(str), fraction);
|
|
@@ -281,6 +290,12 @@ var formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 10,
|
|
|
281
290
|
if (arr[0].length < 3) {
|
|
282
291
|
return flag ? `${arr[0]}${decimalSeparator}${arr[1]?.substring(0, fraction) ?? ""}` : arr[0];
|
|
283
292
|
} else {
|
|
293
|
+
let flagNegative = false;
|
|
294
|
+
if (arr[0][0] === "-") {
|
|
295
|
+
flagNegative = true;
|
|
296
|
+
arr[0] = arr[0].substring(1, arr[0].length);
|
|
297
|
+
console.log(arr[0].substring(1, arr[0].length));
|
|
298
|
+
}
|
|
284
299
|
let count = 0;
|
|
285
300
|
for (let i = arr[0].length - 2; i >= 0; i--) {
|
|
286
301
|
if ((arr[0].length - i - count) % 3 === 0 && i > 0) {
|
|
@@ -294,6 +309,9 @@ var formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 10,
|
|
|
294
309
|
if (isDone) {
|
|
295
310
|
flag = (arr[1]?.substring(0, fraction) ?? "") !== "";
|
|
296
311
|
}
|
|
312
|
+
if (flagNegative) {
|
|
313
|
+
arr[0] = "-".concat(arr[0]);
|
|
314
|
+
}
|
|
297
315
|
return flag ? `${arr[0]}${decimalSeparator}${arr[1]?.substring(0, fraction) ?? ""}` : arr[0];
|
|
298
316
|
}
|
|
299
317
|
} else {
|
|
@@ -1561,28 +1579,30 @@ var TableEdit = (0, import_react12.forwardRef)((props, ref) => {
|
|
|
1561
1579
|
(0, import_react12.useEffect)(() => {
|
|
1562
1580
|
const arrHeaderColumns = [];
|
|
1563
1581
|
const arrContentColumns = [];
|
|
1564
|
-
let
|
|
1582
|
+
let headerLevelRow = 0;
|
|
1565
1583
|
if (levelCol) {
|
|
1566
|
-
|
|
1584
|
+
headerLevelRow = levelCol;
|
|
1567
1585
|
} else {
|
|
1568
|
-
|
|
1569
|
-
setLevelCol(
|
|
1586
|
+
headerLevelRow = stretchColumn(columns, 0);
|
|
1587
|
+
setLevelCol(headerLevelRow);
|
|
1570
1588
|
}
|
|
1571
|
-
for (let i = 0; i <
|
|
1589
|
+
for (let i = 0; i < headerLevelRow; i++) {
|
|
1572
1590
|
arrHeaderColumns.push([]);
|
|
1573
1591
|
}
|
|
1574
|
-
|
|
1592
|
+
console.log(headerLevelRow);
|
|
1593
|
+
getNestedChildren(columns, arrHeaderColumns, arrContentColumns, 0, headerLevelRow);
|
|
1575
1594
|
setHeaderColumns(arrHeaderColumns);
|
|
1595
|
+
console.log(arrHeaderColumns);
|
|
1576
1596
|
setContentColumns(arrContentColumns);
|
|
1577
|
-
}, [
|
|
1578
|
-
const getNestedChildren = (array, arrHeaderColumns, arrContentColumns, level,
|
|
1579
|
-
array.forEach((item) => {
|
|
1580
|
-
const ele = { ...item, visible: item.invisibleDisable ? item.visible : contentColumns[
|
|
1597
|
+
}, []);
|
|
1598
|
+
const getNestedChildren = (array, arrHeaderColumns, arrContentColumns, level, maxLevelRow) => {
|
|
1599
|
+
array.forEach((item, index) => {
|
|
1600
|
+
const ele = { ...item, visible: item.invisibleDisable ? item.visible : contentColumns[index]?.visible ?? item.visible, rowspan: 1, index: 0 };
|
|
1581
1601
|
if (item.columns && item.columns?.length > 0) {
|
|
1582
|
-
const countLevel = getNestedChildren(item.columns, arrHeaderColumns, arrContentColumns, level + 1,
|
|
1583
|
-
arrHeaderColumns[
|
|
1602
|
+
const countLevel = getNestedChildren(item.columns, arrHeaderColumns, arrContentColumns, level + 1, maxLevelRow);
|
|
1603
|
+
arrHeaderColumns[maxLevelRow - 1 - countLevel].push(ele);
|
|
1584
1604
|
} else {
|
|
1585
|
-
ele.rowspan =
|
|
1605
|
+
ele.rowspan = maxLevelRow - level;
|
|
1586
1606
|
ele.index = arrContentColumns.length;
|
|
1587
1607
|
arrHeaderColumns[level].push(ele);
|
|
1588
1608
|
arrContentColumns.push(ele);
|
|
@@ -1590,11 +1610,11 @@ var TableEdit = (0, import_react12.forwardRef)((props, ref) => {
|
|
|
1590
1610
|
});
|
|
1591
1611
|
return level;
|
|
1592
1612
|
};
|
|
1593
|
-
const stretchColumn = (subColumns,
|
|
1594
|
-
let count =
|
|
1613
|
+
const stretchColumn = (subColumns, headerLevelRow) => {
|
|
1614
|
+
let count = headerLevelRow + 1;
|
|
1595
1615
|
subColumns.map((item) => {
|
|
1596
1616
|
if (item.columns && item.columns.length > 0) {
|
|
1597
|
-
const newCount = stretchColumn(item.columns,
|
|
1617
|
+
const newCount = stretchColumn(item.columns, headerLevelRow + 1);
|
|
1598
1618
|
if (newCount > count) {
|
|
1599
1619
|
count = newCount;
|
|
1600
1620
|
}
|
|
@@ -2592,7 +2612,8 @@ var TableEdit = (0, import_react12.forwardRef)((props, ref) => {
|
|
|
2592
2612
|
id: indexFocus === indexRow && typeDis !== 1 ? `${idTable}-col${indexCol + 1}-row${indexRow + 1}` : "",
|
|
2593
2613
|
className: (0, import_classnames10.default)("r-rowcell-content", { "r-is-invalid": errorMessage }),
|
|
2594
2614
|
style: {
|
|
2595
|
-
margin: typeDis === 1 ? 2 : !errorMessage ? "7px 9px" : 2
|
|
2615
|
+
margin: typeDis === 1 ? 2 : !errorMessage ? "7px 9px" : 2,
|
|
2616
|
+
color: col.editType === "numeric" && Number(row[col.field]) < 0 ? "red" : ""
|
|
2596
2617
|
},
|
|
2597
2618
|
children: [
|
|
2598
2619
|
typeDis === 1 && !refreshRow ? renderEdit(row, col, indexRow, indexCol) : !col.haveToolTip ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "r-cell-text", children: typeDis === 2 ? col.template(row, indexRow) : value }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
@@ -2634,7 +2655,7 @@ var TableEdit = (0, import_react12.forwardRef)((props, ref) => {
|
|
|
2634
2655
|
left: col.fixedType === "left" ? objWidthFix[col.index ?? 0] : void 0,
|
|
2635
2656
|
right: col.fixedType === "right" ? objWidthFix[col.index ?? 0] : void 0,
|
|
2636
2657
|
width: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : col.width,
|
|
2637
|
-
minWidth: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") :
|
|
2658
|
+
minWidth: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : "auto",
|
|
2638
2659
|
maxWidth: col.maxWidth
|
|
2639
2660
|
},
|
|
2640
2661
|
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
@@ -2723,7 +2744,7 @@ var TableEdit = (0, import_react12.forwardRef)((props, ref) => {
|
|
|
2723
2744
|
),
|
|
2724
2745
|
style: {
|
|
2725
2746
|
width: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : col.width,
|
|
2726
|
-
minWidth: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") :
|
|
2747
|
+
minWidth: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : "auto",
|
|
2727
2748
|
top: `${indexParent * 42}px`,
|
|
2728
2749
|
left: col.fixedType === "left" ? objWidthFix[col.index ?? 0] : void 0,
|
|
2729
2750
|
right: col.fixedType === "right" ? objWidthFix[col.index ?? 0] : void 0,
|
|
@@ -2760,8 +2781,8 @@ var TableEdit = (0, import_react12.forwardRef)((props, ref) => {
|
|
|
2760
2781
|
style: {
|
|
2761
2782
|
left: col.fixedType === "left" ? objWidthFix[indexCol] : void 0,
|
|
2762
2783
|
right: col.fixedType === "right" ? objWidthFix[indexCol] : void 0,
|
|
2763
|
-
width: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") :
|
|
2764
|
-
minWidth: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") :
|
|
2784
|
+
width: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : "auto",
|
|
2785
|
+
minWidth: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : "auto",
|
|
2765
2786
|
maxWidth: col.maxWidth,
|
|
2766
2787
|
textAlign: col.textAlign ? col.textAlign : "left"
|
|
2767
2788
|
},
|
|
@@ -2882,6 +2903,9 @@ var table_default = TableEdit;
|
|
|
2882
2903
|
var Table_edit_default = table_default;
|
|
2883
2904
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2884
2905
|
0 && (module.exports = {
|
|
2906
|
+
formartNumberic,
|
|
2907
|
+
generateUUID,
|
|
2908
|
+
isNullOrUndefined,
|
|
2885
2909
|
messageBoxConfirm,
|
|
2886
2910
|
messageBoxConfirm2,
|
|
2887
2911
|
messageBoxConfirmDelete,
|
|
@@ -2889,5 +2913,9 @@ var Table_edit_default = table_default;
|
|
|
2889
2913
|
messageHtmlBoxConfirm,
|
|
2890
2914
|
messageHtmlBoxError,
|
|
2891
2915
|
notificationError,
|
|
2892
|
-
notificationSuccess
|
|
2916
|
+
notificationSuccess,
|
|
2917
|
+
objSymbolDecimal,
|
|
2918
|
+
objSymbolThousand,
|
|
2919
|
+
roundNumber,
|
|
2920
|
+
useOnClickOutside
|
|
2893
2921
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -225,6 +225,8 @@ var generateUUID = () => {
|
|
|
225
225
|
return (c === "x" ? r : 3).toString(16);
|
|
226
226
|
});
|
|
227
227
|
};
|
|
228
|
+
var objSymbolDecimal = { 0: ",", 1: "." };
|
|
229
|
+
var objSymbolThousand = { 1: ",", 0: "." };
|
|
228
230
|
var formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 10, isDone) => {
|
|
229
231
|
if (isDone) {
|
|
230
232
|
str = roundNumber(Number(str), fraction);
|
|
@@ -237,6 +239,12 @@ var formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 10,
|
|
|
237
239
|
if (arr[0].length < 3) {
|
|
238
240
|
return flag ? `${arr[0]}${decimalSeparator}${arr[1]?.substring(0, fraction) ?? ""}` : arr[0];
|
|
239
241
|
} else {
|
|
242
|
+
let flagNegative = false;
|
|
243
|
+
if (arr[0][0] === "-") {
|
|
244
|
+
flagNegative = true;
|
|
245
|
+
arr[0] = arr[0].substring(1, arr[0].length);
|
|
246
|
+
console.log(arr[0].substring(1, arr[0].length));
|
|
247
|
+
}
|
|
240
248
|
let count = 0;
|
|
241
249
|
for (let i = arr[0].length - 2; i >= 0; i--) {
|
|
242
250
|
if ((arr[0].length - i - count) % 3 === 0 && i > 0) {
|
|
@@ -250,6 +258,9 @@ var formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 10,
|
|
|
250
258
|
if (isDone) {
|
|
251
259
|
flag = (arr[1]?.substring(0, fraction) ?? "") !== "";
|
|
252
260
|
}
|
|
261
|
+
if (flagNegative) {
|
|
262
|
+
arr[0] = "-".concat(arr[0]);
|
|
263
|
+
}
|
|
253
264
|
return flag ? `${arr[0]}${decimalSeparator}${arr[1]?.substring(0, fraction) ?? ""}` : arr[0];
|
|
254
265
|
}
|
|
255
266
|
} else {
|
|
@@ -1527,28 +1538,30 @@ var TableEdit = forwardRef2((props, ref) => {
|
|
|
1527
1538
|
useEffect5(() => {
|
|
1528
1539
|
const arrHeaderColumns = [];
|
|
1529
1540
|
const arrContentColumns = [];
|
|
1530
|
-
let
|
|
1541
|
+
let headerLevelRow = 0;
|
|
1531
1542
|
if (levelCol) {
|
|
1532
|
-
|
|
1543
|
+
headerLevelRow = levelCol;
|
|
1533
1544
|
} else {
|
|
1534
|
-
|
|
1535
|
-
setLevelCol(
|
|
1545
|
+
headerLevelRow = stretchColumn(columns, 0);
|
|
1546
|
+
setLevelCol(headerLevelRow);
|
|
1536
1547
|
}
|
|
1537
|
-
for (let i = 0; i <
|
|
1548
|
+
for (let i = 0; i < headerLevelRow; i++) {
|
|
1538
1549
|
arrHeaderColumns.push([]);
|
|
1539
1550
|
}
|
|
1540
|
-
|
|
1551
|
+
console.log(headerLevelRow);
|
|
1552
|
+
getNestedChildren(columns, arrHeaderColumns, arrContentColumns, 0, headerLevelRow);
|
|
1541
1553
|
setHeaderColumns(arrHeaderColumns);
|
|
1554
|
+
console.log(arrHeaderColumns);
|
|
1542
1555
|
setContentColumns(arrContentColumns);
|
|
1543
|
-
}, [
|
|
1544
|
-
const getNestedChildren = (array, arrHeaderColumns, arrContentColumns, level,
|
|
1545
|
-
array.forEach((item) => {
|
|
1546
|
-
const ele = { ...item, visible: item.invisibleDisable ? item.visible : contentColumns[
|
|
1556
|
+
}, []);
|
|
1557
|
+
const getNestedChildren = (array, arrHeaderColumns, arrContentColumns, level, maxLevelRow) => {
|
|
1558
|
+
array.forEach((item, index) => {
|
|
1559
|
+
const ele = { ...item, visible: item.invisibleDisable ? item.visible : contentColumns[index]?.visible ?? item.visible, rowspan: 1, index: 0 };
|
|
1547
1560
|
if (item.columns && item.columns?.length > 0) {
|
|
1548
|
-
const countLevel = getNestedChildren(item.columns, arrHeaderColumns, arrContentColumns, level + 1,
|
|
1549
|
-
arrHeaderColumns[
|
|
1561
|
+
const countLevel = getNestedChildren(item.columns, arrHeaderColumns, arrContentColumns, level + 1, maxLevelRow);
|
|
1562
|
+
arrHeaderColumns[maxLevelRow - 1 - countLevel].push(ele);
|
|
1550
1563
|
} else {
|
|
1551
|
-
ele.rowspan =
|
|
1564
|
+
ele.rowspan = maxLevelRow - level;
|
|
1552
1565
|
ele.index = arrContentColumns.length;
|
|
1553
1566
|
arrHeaderColumns[level].push(ele);
|
|
1554
1567
|
arrContentColumns.push(ele);
|
|
@@ -1556,11 +1569,11 @@ var TableEdit = forwardRef2((props, ref) => {
|
|
|
1556
1569
|
});
|
|
1557
1570
|
return level;
|
|
1558
1571
|
};
|
|
1559
|
-
const stretchColumn = (subColumns,
|
|
1560
|
-
let count =
|
|
1572
|
+
const stretchColumn = (subColumns, headerLevelRow) => {
|
|
1573
|
+
let count = headerLevelRow + 1;
|
|
1561
1574
|
subColumns.map((item) => {
|
|
1562
1575
|
if (item.columns && item.columns.length > 0) {
|
|
1563
|
-
const newCount = stretchColumn(item.columns,
|
|
1576
|
+
const newCount = stretchColumn(item.columns, headerLevelRow + 1);
|
|
1564
1577
|
if (newCount > count) {
|
|
1565
1578
|
count = newCount;
|
|
1566
1579
|
}
|
|
@@ -2558,7 +2571,8 @@ var TableEdit = forwardRef2((props, ref) => {
|
|
|
2558
2571
|
id: indexFocus === indexRow && typeDis !== 1 ? `${idTable}-col${indexCol + 1}-row${indexRow + 1}` : "",
|
|
2559
2572
|
className: classnames6("r-rowcell-content", { "r-is-invalid": errorMessage }),
|
|
2560
2573
|
style: {
|
|
2561
|
-
margin: typeDis === 1 ? 2 : !errorMessage ? "7px 9px" : 2
|
|
2574
|
+
margin: typeDis === 1 ? 2 : !errorMessage ? "7px 9px" : 2,
|
|
2575
|
+
color: col.editType === "numeric" && Number(row[col.field]) < 0 ? "red" : ""
|
|
2562
2576
|
},
|
|
2563
2577
|
children: [
|
|
2564
2578
|
typeDis === 1 && !refreshRow ? renderEdit(row, col, indexRow, indexCol) : !col.haveToolTip ? /* @__PURE__ */ jsx12("div", { className: "r-cell-text", children: typeDis === 2 ? col.template(row, indexRow) : value }) : /* @__PURE__ */ jsx12(
|
|
@@ -2600,7 +2614,7 @@ var TableEdit = forwardRef2((props, ref) => {
|
|
|
2600
2614
|
left: col.fixedType === "left" ? objWidthFix[col.index ?? 0] : void 0,
|
|
2601
2615
|
right: col.fixedType === "right" ? objWidthFix[col.index ?? 0] : void 0,
|
|
2602
2616
|
width: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : col.width,
|
|
2603
|
-
minWidth: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") :
|
|
2617
|
+
minWidth: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : "auto",
|
|
2604
2618
|
maxWidth: col.maxWidth
|
|
2605
2619
|
},
|
|
2606
2620
|
children: /* @__PURE__ */ jsx12(
|
|
@@ -2689,7 +2703,7 @@ var TableEdit = forwardRef2((props, ref) => {
|
|
|
2689
2703
|
),
|
|
2690
2704
|
style: {
|
|
2691
2705
|
width: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : col.width,
|
|
2692
|
-
minWidth: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") :
|
|
2706
|
+
minWidth: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : "auto",
|
|
2693
2707
|
top: `${indexParent * 42}px`,
|
|
2694
2708
|
left: col.fixedType === "left" ? objWidthFix[col.index ?? 0] : void 0,
|
|
2695
2709
|
right: col.fixedType === "right" ? objWidthFix[col.index ?? 0] : void 0,
|
|
@@ -2726,8 +2740,8 @@ var TableEdit = forwardRef2((props, ref) => {
|
|
|
2726
2740
|
style: {
|
|
2727
2741
|
left: col.fixedType === "left" ? objWidthFix[indexCol] : void 0,
|
|
2728
2742
|
right: col.fixedType === "right" ? objWidthFix[indexCol] : void 0,
|
|
2729
|
-
width: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") :
|
|
2730
|
-
minWidth: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") :
|
|
2743
|
+
width: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : "auto",
|
|
2744
|
+
minWidth: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : "auto",
|
|
2731
2745
|
maxWidth: col.maxWidth,
|
|
2732
2746
|
textAlign: col.textAlign ? col.textAlign : "left"
|
|
2733
2747
|
},
|
|
@@ -2848,6 +2862,9 @@ var table_default = TableEdit;
|
|
|
2848
2862
|
var Table_edit_default = table_default;
|
|
2849
2863
|
export {
|
|
2850
2864
|
Table_edit_default as default,
|
|
2865
|
+
formartNumberic,
|
|
2866
|
+
generateUUID,
|
|
2867
|
+
isNullOrUndefined,
|
|
2851
2868
|
messageBoxConfirm,
|
|
2852
2869
|
messageBoxConfirm2,
|
|
2853
2870
|
messageBoxConfirmDelete,
|
|
@@ -2855,5 +2872,9 @@ export {
|
|
|
2855
2872
|
messageHtmlBoxConfirm,
|
|
2856
2873
|
messageHtmlBoxError,
|
|
2857
2874
|
notificationError,
|
|
2858
|
-
notificationSuccess
|
|
2875
|
+
notificationSuccess,
|
|
2876
|
+
objSymbolDecimal,
|
|
2877
|
+
objSymbolThousand,
|
|
2878
|
+
roundNumber,
|
|
2879
|
+
useOnClickOutside
|
|
2859
2880
|
};
|