react-table-edit 0.1.2 → 0.1.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.
- package/dist/index.d.mts +6 -7
- package/dist/index.d.ts +6 -7
- package/dist/index.js +38 -51
- package/dist/index.mjs +38 -50
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -136,14 +136,13 @@ type FromItemsField = {
|
|
|
136
136
|
options?: any[];
|
|
137
137
|
};
|
|
138
138
|
|
|
139
|
-
declare const
|
|
140
|
-
declare const
|
|
141
|
-
declare const messageHtmlBoxConfirm: (t: TFunction<"translation", undefined>, message: any[], handle: any, data: any, title?: string) => void;
|
|
142
|
-
declare const messageHtmlBoxError: (t: TFunction<"translation", undefined>, message: any[], title?: string) => void;
|
|
139
|
+
declare const messageHtmlBoxConfirm: (t: TFunction<"translation", undefined>, message: any[], handle: any, data: any, title?: string, btnOk?: string, btnCancel?: string) => void;
|
|
140
|
+
declare const messageHtmlBoxError: (t: TFunction<"translation", undefined>, message: any[], title?: string, btnCancel?: string) => void;
|
|
143
141
|
declare const messageBoxConfirmDelete: (t: TFunction<"translation", undefined>, handle: any, data: any) => void;
|
|
144
|
-
declare const
|
|
145
|
-
declare const
|
|
142
|
+
declare const messageBoxConfirm: (t: TFunction<"translation", undefined>, handle: any, data: any, message: string, title?: string, btnOk?: string, btnCancel?: string) => void;
|
|
143
|
+
declare const messageBoxError: (t: TFunction<"translation", undefined>, message: string, title?: string, btnCancel?: string) => void;
|
|
146
144
|
declare const notificationError: (param: string) => string;
|
|
145
|
+
declare const notificationSuccess: (param: string) => string;
|
|
147
146
|
declare const messageBoxConfirm2: (t: TFunction<"translation", undefined>, data: any, data2: any, message: string) => Promise<boolean>;
|
|
148
147
|
|
|
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,
|
|
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, messageBoxConfirmDelete, messageBoxError, messageHtmlBoxConfirm, messageHtmlBoxError, notificationError, notificationSuccess };
|
package/dist/index.d.ts
CHANGED
|
@@ -136,14 +136,13 @@ type FromItemsField = {
|
|
|
136
136
|
options?: any[];
|
|
137
137
|
};
|
|
138
138
|
|
|
139
|
-
declare const
|
|
140
|
-
declare const
|
|
141
|
-
declare const messageHtmlBoxConfirm: (t: TFunction<"translation", undefined>, message: any[], handle: any, data: any, title?: string) => void;
|
|
142
|
-
declare const messageHtmlBoxError: (t: TFunction<"translation", undefined>, message: any[], title?: string) => void;
|
|
139
|
+
declare const messageHtmlBoxConfirm: (t: TFunction<"translation", undefined>, message: any[], handle: any, data: any, title?: string, btnOk?: string, btnCancel?: string) => void;
|
|
140
|
+
declare const messageHtmlBoxError: (t: TFunction<"translation", undefined>, message: any[], title?: string, btnCancel?: string) => void;
|
|
143
141
|
declare const messageBoxConfirmDelete: (t: TFunction<"translation", undefined>, handle: any, data: any) => void;
|
|
144
|
-
declare const
|
|
145
|
-
declare const
|
|
142
|
+
declare const messageBoxConfirm: (t: TFunction<"translation", undefined>, handle: any, data: any, message: string, title?: string, btnOk?: string, btnCancel?: string) => void;
|
|
143
|
+
declare const messageBoxError: (t: TFunction<"translation", undefined>, message: string, title?: string, btnCancel?: string) => void;
|
|
146
144
|
declare const notificationError: (param: string) => string;
|
|
145
|
+
declare const notificationSuccess: (param: string) => string;
|
|
147
146
|
declare const messageBoxConfirm2: (t: TFunction<"translation", undefined>, data: any, data2: any, message: string) => Promise<boolean>;
|
|
148
147
|
|
|
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,
|
|
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, messageBoxConfirmDelete, messageBoxError, messageHtmlBoxConfirm, messageHtmlBoxError, notificationError, notificationSuccess };
|
package/dist/index.js
CHANGED
|
@@ -33,7 +33,6 @@ __export(Table_edit_exports, {
|
|
|
33
33
|
default: () => Table_edit_default,
|
|
34
34
|
messageBoxConfirm: () => messageBoxConfirm,
|
|
35
35
|
messageBoxConfirm2: () => messageBoxConfirm2,
|
|
36
|
-
messageBoxConfirmApprove: () => messageBoxConfirmApprove,
|
|
37
36
|
messageBoxConfirmDelete: () => messageBoxConfirmDelete,
|
|
38
37
|
messageBoxError: () => messageBoxError,
|
|
39
38
|
messageHtmlBoxConfirm: () => messageHtmlBoxConfirm,
|
|
@@ -92,38 +91,16 @@ var import_sweetalert2_react_content = __toESM(require("sweetalert2-react-conten
|
|
|
92
91
|
var import_react_hot_toast = __toESM(require("react-hot-toast"));
|
|
93
92
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
94
93
|
var MySwal = (0, import_sweetalert2_react_content.default)(import_sweetalert2.default);
|
|
95
|
-
var
|
|
96
|
-
return import_react_hot_toast.default.success(
|
|
97
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react2.Fragment, { children: [
|
|
98
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "toastify-header", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "title-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h6", { className: "toast-title", children: param }) }) }),
|
|
99
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "toastify-body", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", { className: "list-unstyled mb-0", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("li", {}) }) })
|
|
100
|
-
] })
|
|
101
|
-
);
|
|
102
|
-
};
|
|
103
|
-
var messageBoxError = (t, message) => {
|
|
94
|
+
var messageHtmlBoxConfirm = (t, message, handle, data, title = "Important", btnOk = "Ok", btnCancel = "Cancel") => {
|
|
104
95
|
MySwal.fire({
|
|
105
|
-
title: t(
|
|
106
|
-
text: t(message),
|
|
107
|
-
allowOutsideClick: false,
|
|
108
|
-
showCancelButton: true,
|
|
109
|
-
showConfirmButton: false,
|
|
110
|
-
cancelButtonText: t("Ok"),
|
|
111
|
-
customClass: {
|
|
112
|
-
cancelButton: "btn btn-danger ms-1"
|
|
113
|
-
},
|
|
114
|
-
buttonsStyling: false
|
|
115
|
-
});
|
|
116
|
-
};
|
|
117
|
-
var messageHtmlBoxConfirm = (t, message, handle, data, title) => {
|
|
118
|
-
MySwal.fire({
|
|
119
|
-
title: title ? t(title) : t("Important"),
|
|
96
|
+
title: t(title),
|
|
120
97
|
html: message.map((item, index) => {
|
|
121
98
|
return `<div style="min-width: 448px padding: 7px width:100% border: 1px solid #e0e0e0${index !== 0 ? " border-top-width: 0px" : ""}">${item}</div>`;
|
|
122
99
|
}).join(""),
|
|
123
100
|
allowOutsideClick: false,
|
|
124
101
|
showCancelButton: true,
|
|
125
|
-
confirmButtonText: t(
|
|
126
|
-
cancelButtonText: t(
|
|
102
|
+
confirmButtonText: t(btnOk),
|
|
103
|
+
cancelButtonText: t(btnCancel),
|
|
127
104
|
customClass: {
|
|
128
105
|
confirmButton: "btn btn-primary",
|
|
129
106
|
cancelButton: "btn btn-danger ms-1"
|
|
@@ -135,16 +112,16 @@ var messageHtmlBoxConfirm = (t, message, handle, data, title) => {
|
|
|
135
112
|
}
|
|
136
113
|
});
|
|
137
114
|
};
|
|
138
|
-
var messageHtmlBoxError = (t, message, title) => {
|
|
115
|
+
var messageHtmlBoxError = (t, message, title = "Important", btnCancel = "Ok") => {
|
|
139
116
|
MySwal.fire({
|
|
140
|
-
title:
|
|
117
|
+
title: t(title),
|
|
141
118
|
html: message.map((item, index) => {
|
|
142
119
|
return `<div style="min-width: 448px padding: 7px width:100% border: 1px solid #e0e0e0${index !== 0 ? " border-top-width: 0px" : ""}">${item}</div>`;
|
|
143
120
|
}).join(""),
|
|
144
121
|
allowOutsideClick: false,
|
|
145
122
|
showCancelButton: true,
|
|
146
123
|
showConfirmButton: false,
|
|
147
|
-
cancelButtonText: t(
|
|
124
|
+
cancelButtonText: t(btnCancel),
|
|
148
125
|
width: "auto",
|
|
149
126
|
customClass: {
|
|
150
127
|
cancelButton: "btn btn-danger ms-1"
|
|
@@ -171,14 +148,14 @@ var messageBoxConfirmDelete = (t, handle, data) => {
|
|
|
171
148
|
}
|
|
172
149
|
});
|
|
173
150
|
};
|
|
174
|
-
var
|
|
151
|
+
var messageBoxConfirm = (t, handle, data, message, title = "Important", btnOk = "Ok", btnCancel = "Cancel") => {
|
|
175
152
|
MySwal.fire({
|
|
176
|
-
title: t(
|
|
177
|
-
text: t(
|
|
153
|
+
title: t(title),
|
|
154
|
+
text: t(message),
|
|
178
155
|
allowOutsideClick: false,
|
|
179
156
|
showCancelButton: true,
|
|
180
|
-
confirmButtonText: t(
|
|
181
|
-
cancelButtonText: t(
|
|
157
|
+
confirmButtonText: t(btnOk),
|
|
158
|
+
cancelButtonText: t(btnCancel),
|
|
182
159
|
customClass: {
|
|
183
160
|
confirmButton: "btn btn-primary",
|
|
184
161
|
cancelButton: "btn btn-danger ms-1"
|
|
@@ -190,23 +167,18 @@ var messageBoxConfirmApprove = (t, handle, data) => {
|
|
|
190
167
|
}
|
|
191
168
|
});
|
|
192
169
|
};
|
|
193
|
-
var
|
|
170
|
+
var messageBoxError = (t, message, title = "Important", btnCancel = "Ok") => {
|
|
194
171
|
MySwal.fire({
|
|
195
|
-
title: t(
|
|
172
|
+
title: t(title),
|
|
196
173
|
text: t(message),
|
|
197
174
|
allowOutsideClick: false,
|
|
198
175
|
showCancelButton: true,
|
|
199
|
-
|
|
200
|
-
cancelButtonText: t(
|
|
176
|
+
showConfirmButton: false,
|
|
177
|
+
cancelButtonText: t(btnCancel),
|
|
201
178
|
customClass: {
|
|
202
|
-
confirmButton: "btn btn-primary",
|
|
203
179
|
cancelButton: "btn btn-danger ms-1"
|
|
204
180
|
},
|
|
205
181
|
buttonsStyling: false
|
|
206
|
-
}).then(async (result) => {
|
|
207
|
-
if (result.value) {
|
|
208
|
-
handle(data);
|
|
209
|
-
}
|
|
210
182
|
});
|
|
211
183
|
};
|
|
212
184
|
var notificationError = (param) => {
|
|
@@ -217,6 +189,14 @@ var notificationError = (param) => {
|
|
|
217
189
|
] })
|
|
218
190
|
);
|
|
219
191
|
};
|
|
192
|
+
var notificationSuccess = (param) => {
|
|
193
|
+
return import_react_hot_toast.default.success(
|
|
194
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react2.Fragment, { children: [
|
|
195
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "toastify-header", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "title-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h6", { className: "toast-title", children: param }) }) }),
|
|
196
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "toastify-body", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", { className: "list-unstyled mb-0", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("li", {}) }) })
|
|
197
|
+
] })
|
|
198
|
+
);
|
|
199
|
+
};
|
|
220
200
|
var messageBoxConfirm2 = async (t, data, data2, message) => {
|
|
221
201
|
return new Promise((resolve) => {
|
|
222
202
|
MySwal.fire({
|
|
@@ -290,23 +270,26 @@ var generateUUID = () => {
|
|
|
290
270
|
});
|
|
291
271
|
};
|
|
292
272
|
var formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 10, isDone) => {
|
|
273
|
+
if (isDone) {
|
|
274
|
+
str = roundNumber(Number(str), fraction);
|
|
275
|
+
}
|
|
293
276
|
if (str || str == "0") {
|
|
294
277
|
str = str.toString();
|
|
295
278
|
const value = decimalSeparator !== "." ? str.toString().replaceAll(".", decimalSeparator ?? "") : str;
|
|
296
279
|
const arr = value.toString().split(decimalSeparator ?? "", 2);
|
|
297
280
|
let flag = value.toString().includes(decimalSeparator ?? "");
|
|
298
|
-
if (
|
|
281
|
+
if (arr[0].length < 3) {
|
|
299
282
|
return flag ? `${arr[0]}${decimalSeparator}${arr[1]?.substring(0, fraction) ?? ""}` : arr[0];
|
|
300
283
|
} else {
|
|
301
284
|
let count = 0;
|
|
302
|
-
for (let i =
|
|
303
|
-
if ((
|
|
304
|
-
arr[0] = `${arr[0]
|
|
285
|
+
for (let i = arr[0].length - 2; i >= 0; i--) {
|
|
286
|
+
if ((arr[0].length - i - count) % 3 === 0 && i > 0) {
|
|
287
|
+
arr[0] = `${arr[0].substring(0, i)}${thousandSeparator}${arr[0].substring(i, arr[0].length)}`;
|
|
305
288
|
count++;
|
|
306
289
|
}
|
|
307
290
|
}
|
|
308
|
-
if (arr[0]
|
|
309
|
-
arr[0] = arr[0]
|
|
291
|
+
if (arr[0].lastIndexOf(thousandSeparator ?? "") === arr[0].length - 1) {
|
|
292
|
+
arr[0] = arr[0].slice(0, arr[0].length - 1);
|
|
310
293
|
}
|
|
311
294
|
if (isDone) {
|
|
312
295
|
flag = (arr[1]?.substring(0, fraction) ?? "") !== "";
|
|
@@ -317,6 +300,11 @@ var formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 10,
|
|
|
317
300
|
return "";
|
|
318
301
|
}
|
|
319
302
|
};
|
|
303
|
+
var roundNumber = (num, fraction) => {
|
|
304
|
+
const base = 10 ** fraction;
|
|
305
|
+
const result = Math.round(num * base) / base;
|
|
306
|
+
return result;
|
|
307
|
+
};
|
|
320
308
|
|
|
321
309
|
// test-app/src/component/icon/index.tsx
|
|
322
310
|
var Icon = __toESM(require("becoxy-icons"));
|
|
@@ -2727,7 +2715,6 @@ var Table_edit_default = table_default;
|
|
|
2727
2715
|
0 && (module.exports = {
|
|
2728
2716
|
messageBoxConfirm,
|
|
2729
2717
|
messageBoxConfirm2,
|
|
2730
|
-
messageBoxConfirmApprove,
|
|
2731
2718
|
messageBoxConfirmDelete,
|
|
2732
2719
|
messageBoxError,
|
|
2733
2720
|
messageHtmlBoxConfirm,
|
package/dist/index.mjs
CHANGED
|
@@ -47,38 +47,16 @@ import withReactContent from "sweetalert2-react-content";
|
|
|
47
47
|
import toast from "react-hot-toast";
|
|
48
48
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
49
49
|
var MySwal = withReactContent(Swal);
|
|
50
|
-
var
|
|
51
|
-
return toast.success(
|
|
52
|
-
/* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
53
|
-
/* @__PURE__ */ jsx2("div", { className: "toastify-header", children: /* @__PURE__ */ jsx2("div", { className: "title-wrapper", children: /* @__PURE__ */ jsx2("h6", { className: "toast-title", children: param }) }) }),
|
|
54
|
-
/* @__PURE__ */ jsx2("div", { className: "toastify-body", children: /* @__PURE__ */ jsx2("ul", { className: "list-unstyled mb-0", children: /* @__PURE__ */ jsx2("li", {}) }) })
|
|
55
|
-
] })
|
|
56
|
-
);
|
|
57
|
-
};
|
|
58
|
-
var messageBoxError = (t, message) => {
|
|
50
|
+
var messageHtmlBoxConfirm = (t, message, handle, data, title = "Important", btnOk = "Ok", btnCancel = "Cancel") => {
|
|
59
51
|
MySwal.fire({
|
|
60
|
-
title: t(
|
|
61
|
-
text: t(message),
|
|
62
|
-
allowOutsideClick: false,
|
|
63
|
-
showCancelButton: true,
|
|
64
|
-
showConfirmButton: false,
|
|
65
|
-
cancelButtonText: t("Ok"),
|
|
66
|
-
customClass: {
|
|
67
|
-
cancelButton: "btn btn-danger ms-1"
|
|
68
|
-
},
|
|
69
|
-
buttonsStyling: false
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
var messageHtmlBoxConfirm = (t, message, handle, data, title) => {
|
|
73
|
-
MySwal.fire({
|
|
74
|
-
title: title ? t(title) : t("Important"),
|
|
52
|
+
title: t(title),
|
|
75
53
|
html: message.map((item, index) => {
|
|
76
54
|
return `<div style="min-width: 448px padding: 7px width:100% border: 1px solid #e0e0e0${index !== 0 ? " border-top-width: 0px" : ""}">${item}</div>`;
|
|
77
55
|
}).join(""),
|
|
78
56
|
allowOutsideClick: false,
|
|
79
57
|
showCancelButton: true,
|
|
80
|
-
confirmButtonText: t(
|
|
81
|
-
cancelButtonText: t(
|
|
58
|
+
confirmButtonText: t(btnOk),
|
|
59
|
+
cancelButtonText: t(btnCancel),
|
|
82
60
|
customClass: {
|
|
83
61
|
confirmButton: "btn btn-primary",
|
|
84
62
|
cancelButton: "btn btn-danger ms-1"
|
|
@@ -90,16 +68,16 @@ var messageHtmlBoxConfirm = (t, message, handle, data, title) => {
|
|
|
90
68
|
}
|
|
91
69
|
});
|
|
92
70
|
};
|
|
93
|
-
var messageHtmlBoxError = (t, message, title) => {
|
|
71
|
+
var messageHtmlBoxError = (t, message, title = "Important", btnCancel = "Ok") => {
|
|
94
72
|
MySwal.fire({
|
|
95
|
-
title:
|
|
73
|
+
title: t(title),
|
|
96
74
|
html: message.map((item, index) => {
|
|
97
75
|
return `<div style="min-width: 448px padding: 7px width:100% border: 1px solid #e0e0e0${index !== 0 ? " border-top-width: 0px" : ""}">${item}</div>`;
|
|
98
76
|
}).join(""),
|
|
99
77
|
allowOutsideClick: false,
|
|
100
78
|
showCancelButton: true,
|
|
101
79
|
showConfirmButton: false,
|
|
102
|
-
cancelButtonText: t(
|
|
80
|
+
cancelButtonText: t(btnCancel),
|
|
103
81
|
width: "auto",
|
|
104
82
|
customClass: {
|
|
105
83
|
cancelButton: "btn btn-danger ms-1"
|
|
@@ -126,14 +104,14 @@ var messageBoxConfirmDelete = (t, handle, data) => {
|
|
|
126
104
|
}
|
|
127
105
|
});
|
|
128
106
|
};
|
|
129
|
-
var
|
|
107
|
+
var messageBoxConfirm = (t, handle, data, message, title = "Important", btnOk = "Ok", btnCancel = "Cancel") => {
|
|
130
108
|
MySwal.fire({
|
|
131
|
-
title: t(
|
|
132
|
-
text: t(
|
|
109
|
+
title: t(title),
|
|
110
|
+
text: t(message),
|
|
133
111
|
allowOutsideClick: false,
|
|
134
112
|
showCancelButton: true,
|
|
135
|
-
confirmButtonText: t(
|
|
136
|
-
cancelButtonText: t(
|
|
113
|
+
confirmButtonText: t(btnOk),
|
|
114
|
+
cancelButtonText: t(btnCancel),
|
|
137
115
|
customClass: {
|
|
138
116
|
confirmButton: "btn btn-primary",
|
|
139
117
|
cancelButton: "btn btn-danger ms-1"
|
|
@@ -145,23 +123,18 @@ var messageBoxConfirmApprove = (t, handle, data) => {
|
|
|
145
123
|
}
|
|
146
124
|
});
|
|
147
125
|
};
|
|
148
|
-
var
|
|
126
|
+
var messageBoxError = (t, message, title = "Important", btnCancel = "Ok") => {
|
|
149
127
|
MySwal.fire({
|
|
150
|
-
title: t(
|
|
128
|
+
title: t(title),
|
|
151
129
|
text: t(message),
|
|
152
130
|
allowOutsideClick: false,
|
|
153
131
|
showCancelButton: true,
|
|
154
|
-
|
|
155
|
-
cancelButtonText: t(
|
|
132
|
+
showConfirmButton: false,
|
|
133
|
+
cancelButtonText: t(btnCancel),
|
|
156
134
|
customClass: {
|
|
157
|
-
confirmButton: "btn btn-primary",
|
|
158
135
|
cancelButton: "btn btn-danger ms-1"
|
|
159
136
|
},
|
|
160
137
|
buttonsStyling: false
|
|
161
|
-
}).then(async (result) => {
|
|
162
|
-
if (result.value) {
|
|
163
|
-
handle(data);
|
|
164
|
-
}
|
|
165
138
|
});
|
|
166
139
|
};
|
|
167
140
|
var notificationError = (param) => {
|
|
@@ -172,6 +145,14 @@ var notificationError = (param) => {
|
|
|
172
145
|
] })
|
|
173
146
|
);
|
|
174
147
|
};
|
|
148
|
+
var notificationSuccess = (param) => {
|
|
149
|
+
return toast.success(
|
|
150
|
+
/* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
151
|
+
/* @__PURE__ */ jsx2("div", { className: "toastify-header", children: /* @__PURE__ */ jsx2("div", { className: "title-wrapper", children: /* @__PURE__ */ jsx2("h6", { className: "toast-title", children: param }) }) }),
|
|
152
|
+
/* @__PURE__ */ jsx2("div", { className: "toastify-body", children: /* @__PURE__ */ jsx2("ul", { className: "list-unstyled mb-0", children: /* @__PURE__ */ jsx2("li", {}) }) })
|
|
153
|
+
] })
|
|
154
|
+
);
|
|
155
|
+
};
|
|
175
156
|
var messageBoxConfirm2 = async (t, data, data2, message) => {
|
|
176
157
|
return new Promise((resolve) => {
|
|
177
158
|
MySwal.fire({
|
|
@@ -245,23 +226,26 @@ var generateUUID = () => {
|
|
|
245
226
|
});
|
|
246
227
|
};
|
|
247
228
|
var formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 10, isDone) => {
|
|
229
|
+
if (isDone) {
|
|
230
|
+
str = roundNumber(Number(str), fraction);
|
|
231
|
+
}
|
|
248
232
|
if (str || str == "0") {
|
|
249
233
|
str = str.toString();
|
|
250
234
|
const value = decimalSeparator !== "." ? str.toString().replaceAll(".", decimalSeparator ?? "") : str;
|
|
251
235
|
const arr = value.toString().split(decimalSeparator ?? "", 2);
|
|
252
236
|
let flag = value.toString().includes(decimalSeparator ?? "");
|
|
253
|
-
if (
|
|
237
|
+
if (arr[0].length < 3) {
|
|
254
238
|
return flag ? `${arr[0]}${decimalSeparator}${arr[1]?.substring(0, fraction) ?? ""}` : arr[0];
|
|
255
239
|
} else {
|
|
256
240
|
let count = 0;
|
|
257
|
-
for (let i =
|
|
258
|
-
if ((
|
|
259
|
-
arr[0] = `${arr[0]
|
|
241
|
+
for (let i = arr[0].length - 2; i >= 0; i--) {
|
|
242
|
+
if ((arr[0].length - i - count) % 3 === 0 && i > 0) {
|
|
243
|
+
arr[0] = `${arr[0].substring(0, i)}${thousandSeparator}${arr[0].substring(i, arr[0].length)}`;
|
|
260
244
|
count++;
|
|
261
245
|
}
|
|
262
246
|
}
|
|
263
|
-
if (arr[0]
|
|
264
|
-
arr[0] = arr[0]
|
|
247
|
+
if (arr[0].lastIndexOf(thousandSeparator ?? "") === arr[0].length - 1) {
|
|
248
|
+
arr[0] = arr[0].slice(0, arr[0].length - 1);
|
|
265
249
|
}
|
|
266
250
|
if (isDone) {
|
|
267
251
|
flag = (arr[1]?.substring(0, fraction) ?? "") !== "";
|
|
@@ -272,6 +256,11 @@ var formartNumberic = (str, decimalSeparator, thousandSeparator, fraction = 10,
|
|
|
272
256
|
return "";
|
|
273
257
|
}
|
|
274
258
|
};
|
|
259
|
+
var roundNumber = (num, fraction) => {
|
|
260
|
+
const base = 10 ** fraction;
|
|
261
|
+
const result = Math.round(num * base) / base;
|
|
262
|
+
return result;
|
|
263
|
+
};
|
|
275
264
|
|
|
276
265
|
// test-app/src/component/icon/index.tsx
|
|
277
266
|
import * as Icon from "becoxy-icons";
|
|
@@ -2700,7 +2689,6 @@ export {
|
|
|
2700
2689
|
Table_edit_default as default,
|
|
2701
2690
|
messageBoxConfirm,
|
|
2702
2691
|
messageBoxConfirm2,
|
|
2703
|
-
messageBoxConfirmApprove,
|
|
2704
2692
|
messageBoxConfirmDelete,
|
|
2705
2693
|
messageBoxError,
|
|
2706
2694
|
messageHtmlBoxConfirm,
|