@pnkx-lib/ui 1.9.39 → 1.9.41
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/style.css +1 -1
- package/es/chunks/{index-CRvByTPr.js → index-CqzBrT3-.js} +623 -621
- package/es/index.js +1 -1
- package/es/ui/index.js +1 -1
- package/package.json +1 -1
- package/types/index.d.ts +2 -1
- package/types/ui.d.ts +2 -1
@@ -10277,388 +10277,660 @@ const HeadingTable = (props) => {
|
|
10277
10277
|
);
|
10278
10278
|
};
|
10279
10279
|
|
10280
|
-
const
|
10281
|
-
|
10282
|
-
|
10283
|
-
|
10284
|
-
|
10285
|
-
|
10280
|
+
const ConfirmModal = ({
|
10281
|
+
title,
|
10282
|
+
content,
|
10283
|
+
typeIcon,
|
10284
|
+
titleCancelBtn = "Huỷ bỏ",
|
10285
|
+
titleSubmitBtn = "Xác nhận",
|
10286
|
+
handleCancel,
|
10287
|
+
handleSubmit,
|
10286
10288
|
...restProps
|
10287
10289
|
}) => {
|
10288
|
-
|
10289
|
-
|
10290
|
-
{
|
10291
|
-
|
10292
|
-
|
10293
|
-
|
10294
|
-
|
10290
|
+
//! State
|
10291
|
+
const IconType = () => {
|
10292
|
+
switch (typeIcon) {
|
10293
|
+
case "success":
|
10294
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
10295
|
+
"svg",
|
10296
|
+
{
|
10297
|
+
xmlns: "http://www.w3.org/2000/svg",
|
10298
|
+
width: "24",
|
10299
|
+
height: "24",
|
10300
|
+
viewBox: "0 0 24 24",
|
10301
|
+
fill: "none",
|
10302
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
10303
|
+
"path",
|
10304
|
+
{
|
10305
|
+
d: "M12 1.5C6.20156 1.5 1.5 6.20156 1.5 12C1.5 17.7984 6.20156 22.5 12 22.5C17.7984 22.5 22.5 17.7984 22.5 12C22.5 6.20156 17.7984 1.5 12 1.5ZM16.5352 8.57109L11.5992 15.4148C11.5302 15.5111 11.4393 15.5896 11.3339 15.6437C11.2286 15.6978 11.1118 15.7261 10.9934 15.7261C10.8749 15.7261 10.7582 15.6978 10.6528 15.6437C10.5474 15.5896 10.4565 15.5111 10.3875 15.4148L7.46484 11.3648C7.37578 11.2406 7.46484 11.0672 7.61719 11.0672H8.71641C8.95547 11.0672 9.18281 11.182 9.32344 11.3789L10.9922 13.6945L14.6766 8.58516C14.8172 8.39062 15.0422 8.27344 15.2836 8.27344H16.3828C16.5352 8.27344 16.6242 8.44688 16.5352 8.57109Z",
|
10306
|
+
fill: "#52C41A"
|
10307
|
+
}
|
10308
|
+
)
|
10309
|
+
}
|
10310
|
+
);
|
10311
|
+
case "error":
|
10312
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
10313
|
+
"svg",
|
10314
|
+
{
|
10315
|
+
xmlns: "http://www.w3.org/2000/svg",
|
10316
|
+
width: "24",
|
10317
|
+
height: "24",
|
10318
|
+
viewBox: "0 0 24 24",
|
10319
|
+
fill: "none",
|
10320
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
10321
|
+
"path",
|
10322
|
+
{
|
10323
|
+
d: "M12 1.5C6.20156 1.5 1.5 6.20156 1.5 12C1.5 17.7984 6.20156 22.5 12 22.5C17.7984 22.5 22.5 17.7984 22.5 12C22.5 6.20156 17.7984 1.5 12 1.5ZM15.8766 15.9891L14.3297 15.982L12 13.2047L9.67266 15.9797L8.12344 15.9867C8.02031 15.9867 7.93594 15.9047 7.93594 15.7992C7.93594 15.7547 7.95234 15.7125 7.98047 15.6773L11.0297 12.0445L7.98047 8.41406C7.95215 8.37971 7.93643 8.3367 7.93594 8.29219C7.93594 8.18906 8.02031 8.10469 8.12344 8.10469L9.67266 8.11172L12 10.8891L14.3273 8.11406L15.8742 8.10703C15.9773 8.10703 16.0617 8.18906 16.0617 8.29453C16.0617 8.33906 16.0453 8.38125 16.0172 8.41641L12.9727 12.0469L16.0195 15.6797C16.0477 15.7148 16.0641 15.757 16.0641 15.8016C16.0641 15.9047 15.9797 15.9891 15.8766 15.9891Z",
|
10324
|
+
fill: "#FF4D4F"
|
10325
|
+
}
|
10326
|
+
)
|
10327
|
+
}
|
10328
|
+
);
|
10329
|
+
case "info":
|
10330
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
10331
|
+
"svg",
|
10332
|
+
{
|
10333
|
+
xmlns: "http://www.w3.org/2000/svg",
|
10334
|
+
width: "24",
|
10335
|
+
height: "24",
|
10336
|
+
viewBox: "0 0 24 24",
|
10337
|
+
fill: "none",
|
10338
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
10339
|
+
"path",
|
10340
|
+
{
|
10341
|
+
d: "M12 1.5C6.20156 1.5 1.5 6.20156 1.5 12C1.5 17.7984 6.20156 22.5 12 22.5C17.7984 22.5 22.5 17.7984 22.5 12C22.5 6.20156 17.7984 1.5 12 1.5ZM12.75 17.0625C12.75 17.1656 12.6656 17.25 12.5625 17.25H11.4375C11.3344 17.25 11.25 17.1656 11.25 17.0625V10.6875C11.25 10.5844 11.3344 10.5 11.4375 10.5H12.5625C12.6656 10.5 12.75 10.5844 12.75 10.6875V17.0625ZM12 9C11.7056 8.99399 11.4253 8.87282 11.2192 8.6625C11.0132 8.45218 10.8977 8.16945 10.8977 7.875C10.8977 7.58055 11.0132 7.29782 11.2192 7.0875C11.4253 6.87718 11.7056 6.75601 12 6.75C12.2944 6.75601 12.5747 6.87718 12.7808 7.0875C12.9868 7.29782 13.1023 7.58055 13.1023 7.875C13.1023 8.16945 12.9868 8.45218 12.7808 8.6625C12.5747 8.87282 12.2944 8.99399 12 9Z",
|
10342
|
+
fill: "#1677FF"
|
10343
|
+
}
|
10344
|
+
)
|
10345
|
+
}
|
10346
|
+
);
|
10347
|
+
case "warning":
|
10348
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
10349
|
+
"svg",
|
10350
|
+
{
|
10351
|
+
xmlns: "http://www.w3.org/2000/svg",
|
10352
|
+
width: "24",
|
10353
|
+
height: "24",
|
10354
|
+
viewBox: "0 0 24 24",
|
10355
|
+
fill: "none",
|
10356
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
10357
|
+
"path",
|
10358
|
+
{
|
10359
|
+
d: "M12 1.5C6.20156 1.5 1.5 6.20156 1.5 12C1.5 17.7984 6.20156 22.5 12 22.5C17.7984 22.5 22.5 17.7984 22.5 12C22.5 6.20156 17.7984 1.5 12 1.5ZM11.25 6.9375C11.25 6.83437 11.3344 6.75 11.4375 6.75H12.5625C12.6656 6.75 12.75 6.83437 12.75 6.9375V13.3125C12.75 13.4156 12.6656 13.5 12.5625 13.5H11.4375C11.3344 13.5 11.25 13.4156 11.25 13.3125V6.9375ZM12 17.25C11.7056 17.244 11.4253 17.1228 11.2192 16.9125C11.0132 16.7022 10.8977 16.4195 10.8977 16.125C10.8977 15.8305 11.0132 15.5478 11.2192 15.3375C11.4253 15.1272 11.7056 15.006 12 15C12.2944 15.006 12.5747 15.1272 12.7808 15.3375C12.9868 15.5478 13.1023 15.8305 13.1023 16.125C13.1023 16.4195 12.9868 16.7022 12.7808 16.9125C12.5747 17.1228 12.2944 17.244 12 17.25Z",
|
10360
|
+
fill: "#FAAD14"
|
10361
|
+
}
|
10362
|
+
)
|
10363
|
+
}
|
10364
|
+
);
|
10295
10365
|
}
|
10296
|
-
|
10366
|
+
};
|
10367
|
+
//! Function
|
10368
|
+
//! Render
|
10369
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Modal, { ...restProps, footer: null, closeIcon: null, width: 400, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
10370
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-3", children: [
|
10371
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(IconType, {}),
|
10372
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
10373
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-base font-semibold", children: title }),
|
10374
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm", children: content })
|
10375
|
+
] })
|
10376
|
+
] }),
|
10377
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2 w-full justify-end items-end pt-3", children: [
|
10378
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { shape: "round", onClick: handleCancel, children: titleCancelBtn }),
|
10379
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { shape: "round", type: "primary", onClick: handleSubmit, children: titleSubmitBtn })
|
10380
|
+
] })
|
10381
|
+
] }) });
|
10297
10382
|
};
|
10298
|
-
const tableCss = css`
|
10299
|
-
.ant-table-cell::before {
|
10300
|
-
display: none !important;
|
10301
|
-
}
|
10302
|
-
.ant-table-thead .ant-table-cell {
|
10303
|
-
background-color: #d6e6fe;
|
10304
|
-
font-weight: 500;
|
10305
|
-
}
|
10306
|
-
|
10307
|
-
.ant-table-thead th.ant-table-column-has-sorters:hover {
|
10308
|
-
background-color: #d6e6fe;
|
10309
|
-
}
|
10310
10383
|
|
10311
|
-
|
10312
|
-
|
10313
|
-
|
10384
|
+
var CATEGORY_LIST_ENUM = /* @__PURE__ */ ((CATEGORY_LIST_ENUM2) => {
|
10385
|
+
CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["DRAFT"] = 0] = "DRAFT";
|
10386
|
+
CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["WATING_APPROVAL"] = 1] = "WATING_APPROVAL";
|
10387
|
+
CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["ACTIVE"] = 2] = "ACTIVE";
|
10388
|
+
CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["INACTIVE"] = 3] = "INACTIVE";
|
10389
|
+
CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["REJECT"] = 4] = "REJECT";
|
10390
|
+
CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["DELETE"] = 5] = "DELETE";
|
10391
|
+
return CATEGORY_LIST_ENUM2;
|
10392
|
+
})(CATEGORY_LIST_ENUM || {});
|
10314
10393
|
|
10315
|
-
|
10316
|
-
|
10317
|
-
|
10318
|
-
|
10319
|
-
|
10320
|
-
|
10321
|
-
|
10322
|
-
|
10323
|
-
|
10324
|
-
|
10325
|
-
|
10326
|
-
|
10327
|
-
filters,
|
10328
|
-
onChangePage,
|
10329
|
-
onChangePageSize,
|
10330
|
-
onSort,
|
10331
|
-
rowsSelected,
|
10332
|
-
onSelect,
|
10333
|
-
onRowClick,
|
10334
|
-
rowKey = "id",
|
10335
|
-
className,
|
10336
|
-
editable,
|
10337
|
-
onSave,
|
10338
|
-
titleSettingTableModal,
|
10339
|
-
showSetting,
|
10340
|
-
setColumns,
|
10341
|
-
resetToInitialFilters,
|
10342
|
-
handleSearch,
|
10343
|
-
groupHeadingButtonItems,
|
10344
|
-
tagSearchItems,
|
10345
|
-
setTagSearchItems,
|
10346
|
-
setKeyActive,
|
10347
|
-
keyActive,
|
10348
|
-
...rest
|
10394
|
+
const BulkAction = ({
|
10395
|
+
quantity,
|
10396
|
+
handleRestore,
|
10397
|
+
handleSendApproval,
|
10398
|
+
handleCancelSendApproval,
|
10399
|
+
handleRefuseApproval,
|
10400
|
+
handleApproval,
|
10401
|
+
handleCancelApproval,
|
10402
|
+
handleDelete,
|
10403
|
+
handleActivate,
|
10404
|
+
handleInActivate,
|
10405
|
+
status
|
10349
10406
|
}) => {
|
10350
10407
|
//! State
|
10351
|
-
const
|
10352
|
-
current: filters.PageIndex,
|
10353
|
-
pageSize: filters.PageSize,
|
10354
|
-
total: totalItems,
|
10355
|
-
showSizeChanger: true,
|
10356
|
-
showQuickJumper: true,
|
10357
|
-
showTotal: (total, range) => `${range[0]}-${range[1]} of ${total} items`,
|
10358
|
-
onChange: (page, pageSize) => {
|
10359
|
-
if (page !== filters.PageIndex) onChangePage(page);
|
10360
|
-
if (pageSize !== filters.PageSize) onChangePageSize(pageSize);
|
10361
|
-
}
|
10362
|
-
};
|
10363
|
-
const [openSetting, setOpenStting] = useState(false);
|
10364
|
-
const rowSelection = {
|
10365
|
-
selectedRowKeys: rowsSelected,
|
10366
|
-
onChange: onSelect
|
10367
|
-
// getCheckboxProps: (record: any) => ({
|
10368
|
-
// disabled: true, // Ví dụ: disable nếu tuổi > 40
|
10369
|
-
// }),
|
10370
|
-
};
|
10371
|
-
const { control, handleSubmit, reset } = useForm();
|
10372
|
-
const [data, setData] = useState([]);
|
10373
|
-
const [editingKey, setEditingKey] = useState("");
|
10374
|
-
const getRowKeyValue = (record) => typeof rowKey === "function" ? rowKey(record) : record[rowKey];
|
10375
|
-
const isEditing = (record) => getRowKeyValue(record) === editingKey;
|
10376
|
-
const edit = (record) => {
|
10377
|
-
reset(record);
|
10378
|
-
setEditingKey(getRowKeyValue(record));
|
10379
|
-
};
|
10380
|
-
const save = (formValues) => {
|
10381
|
-
const key = editingKey;
|
10382
|
-
const newData = [...data];
|
10383
|
-
const index = newData.findIndex((item) => getRowKeyValue(item) === key);
|
10384
|
-
if (onSave) {
|
10385
|
-
onSave(formValues);
|
10386
|
-
}
|
10387
|
-
if (index > -1) {
|
10388
|
-
newData[index] = { ...newData[index], ...formValues };
|
10389
|
-
setData(newData);
|
10390
|
-
setEditingKey("");
|
10391
|
-
}
|
10392
|
-
};
|
10393
|
-
const cancel = () => {
|
10394
|
-
setEditingKey("");
|
10395
|
-
};
|
10396
|
-
//! Function
|
10397
|
-
useEffect(() => {
|
10398
|
-
setData(Array.isArray(dataSource) ? dataSource : []);
|
10399
|
-
}, [JSON.stringify(dataSource)]);
|
10400
|
-
const columnsEditable = [
|
10401
|
-
...columns,
|
10408
|
+
const listIcon = [
|
10402
10409
|
{
|
10403
|
-
|
10404
|
-
|
10405
|
-
|
10406
|
-
|
10407
|
-
|
10408
|
-
|
10409
|
-
|
10410
|
-
|
10411
|
-
|
10412
|
-
|
10413
|
-
|
10414
|
-
|
10415
|
-
|
10416
|
-
|
10417
|
-
|
10418
|
-
|
10419
|
-
|
10420
|
-
|
10421
|
-
|
10422
|
-
|
10423
|
-
|
10424
|
-
|
10425
|
-
|
10426
|
-
|
10427
|
-
|
10428
|
-
|
10429
|
-
|
10430
|
-
|
10431
|
-
|
10432
|
-
|
10433
|
-
|
10434
|
-
|
10435
|
-
|
10436
|
-
|
10437
|
-
|
10438
|
-
|
10439
|
-
|
10410
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RestoreIcon, { stroke: "white" }),
|
10411
|
+
action: handleRestore,
|
10412
|
+
showConfirmModal: false,
|
10413
|
+
title: "Khôi phục",
|
10414
|
+
arrShow: [CATEGORY_LIST_ENUM?.DELETE, CATEGORY_LIST_ENUM?.REJECT]
|
10415
|
+
},
|
10416
|
+
{
|
10417
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(SendApprovalIcon, { stroke: "white" }),
|
10418
|
+
action: handleSendApproval,
|
10419
|
+
showConfirmModal: true,
|
10420
|
+
typeIcon: "info",
|
10421
|
+
title: "Xác nhận gửi duyệt",
|
10422
|
+
content: "Bạn có chắc chắn muốn gửi duyệt mục này không?",
|
10423
|
+
arrShow: [CATEGORY_LIST_ENUM?.DRAFT]
|
10424
|
+
},
|
10425
|
+
{
|
10426
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(CancelSendApprovalIcon, { stroke: "white" }),
|
10427
|
+
action: handleCancelSendApproval,
|
10428
|
+
showConfirmModal: true,
|
10429
|
+
typeIcon: "error",
|
10430
|
+
title: "Xác nhận hủy gửi duyệt",
|
10431
|
+
content: "Bạn có chắc chắn muốn hủy gửi duyệt mục này không?",
|
10432
|
+
arrShow: [CATEGORY_LIST_ENUM?.WATING_APPROVAL]
|
10433
|
+
},
|
10434
|
+
{
|
10435
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefuseApprovalIcon, { stroke: "white" }),
|
10436
|
+
action: handleRefuseApproval,
|
10437
|
+
showConfirmModal: true,
|
10438
|
+
typeIcon: "error",
|
10439
|
+
title: "Xác nhận từ chối duyệt",
|
10440
|
+
content: "Bạn có chắc chắn muốn từ chối duyệt mục này không? Hành động này không thể hoàn tác.",
|
10441
|
+
arrShow: [CATEGORY_LIST_ENUM?.WATING_APPROVAL]
|
10442
|
+
},
|
10443
|
+
{
|
10444
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(ApprovalIcon, { stroke: "white" }),
|
10445
|
+
action: handleApproval,
|
10446
|
+
showConfirmModal: true,
|
10447
|
+
typeIcon: "info",
|
10448
|
+
title: "Xác nhận duyệt",
|
10449
|
+
content: "Bạn có chắc chắn muốn duyệt mục này không?",
|
10450
|
+
arrShow: [CATEGORY_LIST_ENUM?.WATING_APPROVAL]
|
10451
|
+
},
|
10452
|
+
{
|
10453
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(CancelApprovalIcon, { stroke: "white" }),
|
10454
|
+
action: handleCancelApproval,
|
10455
|
+
showConfirmModal: true,
|
10456
|
+
typeIcon: "error",
|
10457
|
+
title: "Xác nhận hủy duyệt",
|
10458
|
+
content: "Bạn có chắc chắn muốn hủy duyệt mục này không?",
|
10459
|
+
arrShow: [CATEGORY_LIST_ENUM?.ACTIVE]
|
10460
|
+
},
|
10461
|
+
{
|
10462
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(DeleteIcon, { fill: "white" }),
|
10463
|
+
action: handleDelete,
|
10464
|
+
showConfirmModal: true,
|
10465
|
+
typeIcon: "error",
|
10466
|
+
title: "Xác nhận xóa",
|
10467
|
+
content: "Bạn có chắc chắn muốn xóa mục này không? Hành động này không thể hoàn tác.",
|
10468
|
+
arrShow: [
|
10469
|
+
CATEGORY_LIST_ENUM?.DRAFT,
|
10470
|
+
CATEGORY_LIST_ENUM?.ACTIVE,
|
10471
|
+
CATEGORY_LIST_ENUM?.INACTIVE
|
10472
|
+
]
|
10473
|
+
},
|
10474
|
+
{
|
10475
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(ActivateIcon, { stroke: "white" }),
|
10476
|
+
action: handleActivate,
|
10477
|
+
showConfirmModal: true,
|
10478
|
+
typeIcon: "info",
|
10479
|
+
title: "Xác nhận kích hoạt",
|
10480
|
+
content: "Bạn có chắc chắn muốn kích hoạt mục này không?",
|
10481
|
+
arrShow: [CATEGORY_LIST_ENUM?.INACTIVE]
|
10482
|
+
},
|
10483
|
+
{
|
10484
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(InActiveIcon, { stroke: "white" }),
|
10485
|
+
action: handleInActivate,
|
10486
|
+
showConfirmModal: true,
|
10487
|
+
typeIcon: "info",
|
10488
|
+
title: "Xác nhận vô hiệu hóa",
|
10489
|
+
content: "Bạn có chắc chắn muốn vô hiệu hóa mục này không?",
|
10490
|
+
arrShow: [CATEGORY_LIST_ENUM?.ACTIVE]
|
10440
10491
|
}
|
10441
10492
|
];
|
10442
|
-
const
|
10443
|
-
|
10444
|
-
|
10445
|
-
|
10446
|
-
|
10447
|
-
|
10448
|
-
|
10449
|
-
|
10450
|
-
dataIndex: "dataIndex" in col ? col.dataIndex : void 0,
|
10451
|
-
title: col.title,
|
10452
|
-
editing: isEditing(record),
|
10453
|
-
control
|
10454
|
-
})
|
10455
|
-
};
|
10456
|
-
}
|
10457
|
-
);
|
10458
|
-
const handleTableChange = (sorter) => {
|
10459
|
-
if (sorter && sorter.field && onSort) {
|
10460
|
-
onSort(sorter.field);
|
10461
|
-
}
|
10462
|
-
};
|
10463
|
-
const handleOnClickRow = (record, onRowClick2) => (e) => {
|
10464
|
-
const target = e.target;
|
10465
|
-
if (target.closest("input") || // ⛔ Checkbox
|
10466
|
-
target.closest("button") || // ⛔ Button trong row
|
10467
|
-
target.closest("svg") || // ⛔ Icon
|
10468
|
-
target.closest(".ant-checkbox") || // ⛔ AntD checkbox
|
10469
|
-
target.closest("a")) {
|
10470
|
-
return;
|
10493
|
+
const [open, setOpen] = useState(false);
|
10494
|
+
const [notifyContent, setNotifyContent] = useState({
|
10495
|
+
title: "",
|
10496
|
+
content: "",
|
10497
|
+
typeIcon: "info",
|
10498
|
+
handleCancel: () => {
|
10499
|
+
},
|
10500
|
+
handleSubmit: () => {
|
10471
10501
|
}
|
10472
|
-
|
10473
|
-
|
10474
|
-
|
10475
|
-
|
10476
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center text-center", children: [
|
10477
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: "https://i.ibb.co/39C3x4LZ/Component-1.png", alt: "no data" }),
|
10478
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-lg font-bold text-black", children: "Không có dữ liệu nào phù hợp" }),
|
10479
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500", children: "Kiểm tra lại bộ lọc hoặc thêm mới dữ liệu" })
|
10480
|
-
] });
|
10502
|
+
});
|
10503
|
+
//! Function
|
10504
|
+
const IsShow = (arrStatus) => {
|
10505
|
+
return arrStatus.includes(status);
|
10481
10506
|
};
|
10482
|
-
|
10483
|
-
|
10484
|
-
|
10485
|
-
|
10486
|
-
|
10487
|
-
|
10488
|
-
|
10489
|
-
|
10490
|
-
|
10491
|
-
|
10492
|
-
|
10493
|
-
|
10494
|
-
|
10495
|
-
|
10496
|
-
|
10497
|
-
|
10498
|
-
|
10499
|
-
|
10500
|
-
|
10501
|
-
|
10502
|
-
|
10503
|
-
|
10504
|
-
|
10505
|
-
|
10506
|
-
|
10507
|
-
onChange: handleTableChange,
|
10508
|
-
onRow: (record) => ({
|
10509
|
-
onClick: handleOnClickRow(record, onRowClick)
|
10510
|
-
}),
|
10511
|
-
locale: {
|
10512
|
-
emptyText: /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyTable, {})
|
10507
|
+
//! Render
|
10508
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full flex justify-center items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3 px-[10px] py-3 bg-[#2561ED] rounded-lg w-fit", children: [
|
10509
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-white px-3", children: [
|
10510
|
+
"Đã chọn: ",
|
10511
|
+
quantity
|
10512
|
+
] }),
|
10513
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-5 border-l border-white mx-1" }),
|
10514
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center space-x-3", children: listIcon.map(
|
10515
|
+
(item, index) => IsShow(item?.arrShow) && /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title: item?.title, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
10516
|
+
"button",
|
10517
|
+
{
|
10518
|
+
className: "p-1 rounded-sm transition duration-200 cursor-pointer hover:bg-[#1B4ACB] hover:rounded-sm",
|
10519
|
+
onClick: item?.showConfirmModal ? () => {
|
10520
|
+
setOpen(true);
|
10521
|
+
setNotifyContent({
|
10522
|
+
title: item?.title || "",
|
10523
|
+
content: item?.content || "",
|
10524
|
+
typeIcon: item?.typeIcon,
|
10525
|
+
handleCancel: () => {
|
10526
|
+
setOpen(false);
|
10527
|
+
},
|
10528
|
+
handleSubmit: item?.action
|
10529
|
+
});
|
10530
|
+
} : item?.action,
|
10531
|
+
children: item.icon
|
10513
10532
|
},
|
10514
|
-
|
10515
|
-
|
10516
|
-
|
10517
|
-
body: { cell: EditableCell }
|
10518
|
-
} : void 0,
|
10519
|
-
...rest
|
10520
|
-
}
|
10521
|
-
),
|
10533
|
+
index
|
10534
|
+
) })
|
10535
|
+
) }),
|
10522
10536
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
10523
|
-
|
10537
|
+
ConfirmModal,
|
10524
10538
|
{
|
10525
|
-
|
10526
|
-
|
10527
|
-
|
10528
|
-
|
10529
|
-
|
10530
|
-
|
10539
|
+
title: notifyContent?.title,
|
10540
|
+
content: notifyContent?.content,
|
10541
|
+
typeIcon: notifyContent?.typeIcon,
|
10542
|
+
open,
|
10543
|
+
handleCancel: notifyContent?.handleCancel,
|
10544
|
+
handleSubmit: notifyContent?.handleSubmit
|
10531
10545
|
}
|
10532
10546
|
)
|
10533
|
-
] });
|
10534
|
-
const renderTableContent = () => {
|
10535
|
-
if (editable) {
|
10536
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("form", { onSubmit: handleSubmit(save), children: tableContent });
|
10537
|
-
}
|
10538
|
-
return tableContent;
|
10539
|
-
};
|
10540
|
-
//! Render
|
10541
|
-
if (loading) return /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { type: "table" });
|
10542
|
-
return renderTableContent();
|
10547
|
+
] }) });
|
10543
10548
|
};
|
10544
10549
|
|
10545
|
-
const
|
10546
|
-
|
10547
|
-
|
10548
|
-
|
10549
|
-
|
10550
|
-
|
10551
|
-
|
10552
|
-
state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState);
|
10553
|
-
listeners.forEach((listener) => listener(state, previousState));
|
10554
|
-
}
|
10555
|
-
};
|
10556
|
-
const getState = () => state;
|
10557
|
-
const getInitialState = () => initialState;
|
10558
|
-
const subscribe = (listener) => {
|
10559
|
-
listeners.add(listener);
|
10560
|
-
return () => listeners.delete(listener);
|
10561
|
-
};
|
10562
|
-
const api = { setState, getState, getInitialState, subscribe };
|
10563
|
-
const initialState = state = createState(setState, getState, api);
|
10564
|
-
return api;
|
10565
|
-
};
|
10566
|
-
const createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
|
10567
|
-
|
10568
|
-
const identity = (arg) => arg;
|
10569
|
-
function useStore(api, selector = identity) {
|
10570
|
-
const slice = React__default.useSyncExternalStore(
|
10571
|
-
api.subscribe,
|
10572
|
-
() => selector(api.getState()),
|
10573
|
-
() => selector(api.getInitialState())
|
10574
|
-
);
|
10575
|
-
React__default.useDebugValue(slice);
|
10576
|
-
return slice;
|
10577
|
-
}
|
10578
|
-
const createImpl = (createState) => {
|
10579
|
-
const api = createStore(createState);
|
10580
|
-
const useBoundStore = (selector) => useStore(api, selector);
|
10581
|
-
Object.assign(useBoundStore, api);
|
10582
|
-
return useBoundStore;
|
10583
|
-
};
|
10584
|
-
const create = (createState) => createState ? createImpl(createState) : createImpl;
|
10585
|
-
|
10586
|
-
const useTabStore = create((set) => ({
|
10587
|
-
activeTabKey: void 0,
|
10588
|
-
// giá trị mặc định
|
10589
|
-
setActiveTabKey: (key) => set({ activeTabKey: key })
|
10590
|
-
}));
|
10591
|
-
|
10592
|
-
const Tabs = ({
|
10593
|
-
items,
|
10594
|
-
lazyRender = false,
|
10595
|
-
defaultActiveKey,
|
10596
|
-
...rest
|
10550
|
+
const EditableCell = ({
|
10551
|
+
editing,
|
10552
|
+
dataIndex,
|
10553
|
+
inputType,
|
10554
|
+
children,
|
10555
|
+
control,
|
10556
|
+
...restProps
|
10597
10557
|
}) => {
|
10598
|
-
|
10599
|
-
|
10600
|
-
useEffect(() => {
|
10601
|
-
if (!activeTabKey && defaultKey) {
|
10602
|
-
setActiveTabKey(defaultKey);
|
10603
|
-
}
|
10604
|
-
}, [activeTabKey, defaultKey, setActiveTabKey]);
|
10605
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
10606
|
-
Tabs$1,
|
10558
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("td", { ...restProps, children: editing ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
10559
|
+
PnkxField,
|
10607
10560
|
{
|
10608
|
-
|
10609
|
-
|
10610
|
-
|
10611
|
-
|
10612
|
-
onChange: (key) => setActiveTabKey(key),
|
10613
|
-
...rest
|
10561
|
+
name: dataIndex,
|
10562
|
+
control,
|
10563
|
+
component: Input,
|
10564
|
+
type: inputType
|
10614
10565
|
}
|
10615
|
-
);
|
10566
|
+
) : children });
|
10616
10567
|
};
|
10568
|
+
const tableCss = css`
|
10569
|
+
.ant-table-cell::before {
|
10570
|
+
display: none !important;
|
10571
|
+
}
|
10572
|
+
.ant-table-thead .ant-table-cell {
|
10573
|
+
background-color: #d6e6fe;
|
10574
|
+
font-weight: 500;
|
10575
|
+
}
|
10617
10576
|
|
10618
|
-
|
10619
|
-
|
10620
|
-
|
10621
|
-
};
|
10577
|
+
.ant-table-thead th.ant-table-column-has-sorters:hover {
|
10578
|
+
background-color: #d6e6fe;
|
10579
|
+
}
|
10622
10580
|
|
10623
|
-
|
10624
|
-
|
10581
|
+
.ant-table-row.table-row-even {
|
10582
|
+
background-color: #f7f7f8;
|
10583
|
+
}
|
10584
|
+
|
10585
|
+
.ant-table-row.table-row-odd {
|
10586
|
+
background-color: #ffffff;
|
10587
|
+
}
|
10588
|
+
.ant-table-row:hover {
|
10589
|
+
background-color: #e7f0ff;
|
10590
|
+
}
|
10591
|
+
`;
|
10592
|
+
const Table = ({
|
10593
|
+
dataSource,
|
10594
|
+
columns,
|
10595
|
+
loading = false,
|
10596
|
+
totalItems,
|
10597
|
+
filters,
|
10598
|
+
onChangePage,
|
10599
|
+
onChangePageSize,
|
10600
|
+
onSort,
|
10601
|
+
rowsSelected,
|
10602
|
+
onSelect,
|
10603
|
+
onRowClick,
|
10604
|
+
rowKey = "id",
|
10625
10605
|
className,
|
10626
|
-
|
10606
|
+
editable,
|
10607
|
+
onSave,
|
10608
|
+
titleSettingTableModal,
|
10609
|
+
showSetting,
|
10610
|
+
setColumns,
|
10611
|
+
resetToInitialFilters,
|
10612
|
+
handleSearch,
|
10613
|
+
groupHeadingButtonItems,
|
10614
|
+
tagSearchItems,
|
10615
|
+
setTagSearchItems,
|
10616
|
+
setKeyActive,
|
10617
|
+
keyActive,
|
10618
|
+
status,
|
10619
|
+
...rest
|
10627
10620
|
}) => {
|
10628
|
-
|
10629
|
-
|
10621
|
+
//! State
|
10622
|
+
const paginationConfig = {
|
10623
|
+
current: filters.PageIndex,
|
10624
|
+
pageSize: filters.PageSize,
|
10625
|
+
total: totalItems,
|
10626
|
+
showSizeChanger: true,
|
10627
|
+
showQuickJumper: true,
|
10628
|
+
showTotal: (total, range) => `${range[0]}-${range[1]} of ${total} items`,
|
10629
|
+
onChange: (page, pageSize) => {
|
10630
|
+
if (page !== filters.PageIndex) onChangePage(page);
|
10631
|
+
if (pageSize !== filters.PageSize) onChangePageSize(pageSize);
|
10632
|
+
}
|
10633
|
+
};
|
10634
|
+
const [openSetting, setOpenStting] = useState(false);
|
10635
|
+
const rowSelection = {
|
10636
|
+
selectedRowKeys: rowsSelected,
|
10637
|
+
onChange: onSelect
|
10638
|
+
// getCheckboxProps: (record: any) => ({
|
10639
|
+
// disabled: true, // Ví dụ: disable nếu tuổi > 40
|
10640
|
+
// }),
|
10641
|
+
};
|
10642
|
+
const { control, handleSubmit, reset } = useForm();
|
10643
|
+
const [data, setData] = useState([]);
|
10644
|
+
const [editingKey, setEditingKey] = useState("");
|
10645
|
+
const getRowKeyValue = (record) => typeof rowKey === "function" ? rowKey(record) : record[rowKey];
|
10646
|
+
const isEditing = (record) => getRowKeyValue(record) === editingKey;
|
10647
|
+
const edit = (record) => {
|
10648
|
+
reset(record);
|
10649
|
+
setEditingKey(getRowKeyValue(record));
|
10650
|
+
};
|
10651
|
+
const save = (formValues) => {
|
10652
|
+
const key = editingKey;
|
10653
|
+
const newData = [...data];
|
10654
|
+
const index = newData.findIndex((item) => getRowKeyValue(item) === key);
|
10655
|
+
if (onSave) {
|
10656
|
+
onSave(formValues);
|
10657
|
+
}
|
10658
|
+
if (index > -1) {
|
10659
|
+
newData[index] = { ...newData[index], ...formValues };
|
10660
|
+
setData(newData);
|
10661
|
+
setEditingKey("");
|
10662
|
+
}
|
10663
|
+
};
|
10664
|
+
const cancel = () => {
|
10665
|
+
setEditingKey("");
|
10666
|
+
};
|
10667
|
+
//! Function
|
10668
|
+
useEffect(() => {
|
10669
|
+
setData(Array.isArray(dataSource) ? dataSource : []);
|
10670
|
+
}, [JSON.stringify(dataSource)]);
|
10671
|
+
const columnsEditable = [
|
10672
|
+
...columns,
|
10630
10673
|
{
|
10631
|
-
|
10632
|
-
|
10674
|
+
title: "Operation",
|
10675
|
+
dataIndex: "operation",
|
10676
|
+
render: (_, record) => {
|
10677
|
+
const editable2 = isEditing(record);
|
10678
|
+
return editable2 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
10679
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
10680
|
+
Popconfirm$1,
|
10681
|
+
{
|
10682
|
+
title: "Bạn có chắc chắn muốn huỷ chỉnh sửa?",
|
10683
|
+
onConfirm: cancel,
|
10684
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography$1.Text, { type: "danger", children: " Huỷ bỏ" })
|
10685
|
+
}
|
10686
|
+
),
|
10687
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { htmlType: "submit", variant: "text", color: "blue", children: "Lưu" })
|
10688
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
10689
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
10690
|
+
Button,
|
10691
|
+
{
|
10692
|
+
disabled: editingKey !== "",
|
10693
|
+
onClick: () => edit(record),
|
10694
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$4, {}),
|
10695
|
+
variant: "text",
|
10696
|
+
color: "blue"
|
10697
|
+
}
|
10698
|
+
),
|
10699
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Popconfirm$1, { title: "Bạn có muốn xoá ?", onConfirm: () => {
|
10700
|
+
}, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
10701
|
+
Button,
|
10702
|
+
{
|
10703
|
+
disabled: editingKey !== "",
|
10704
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$5, {}),
|
10705
|
+
variant: "text",
|
10706
|
+
color: "red"
|
10707
|
+
}
|
10708
|
+
) })
|
10709
|
+
] });
|
10710
|
+
}
|
10711
|
+
}
|
10712
|
+
];
|
10713
|
+
const mergedColumns = columnsEditable.map(
|
10714
|
+
(col) => {
|
10715
|
+
if (!col.editable) return col;
|
10716
|
+
return {
|
10717
|
+
...col,
|
10718
|
+
onCell: (record) => ({
|
10719
|
+
record,
|
10720
|
+
inputType: "text",
|
10721
|
+
dataIndex: "dataIndex" in col ? col.dataIndex : void 0,
|
10722
|
+
title: col.title,
|
10723
|
+
editing: isEditing(record),
|
10724
|
+
control
|
10725
|
+
})
|
10726
|
+
};
|
10633
10727
|
}
|
10634
10728
|
);
|
10635
|
-
|
10636
|
-
|
10637
|
-
|
10638
|
-
|
10639
|
-
|
10640
|
-
|
10641
|
-
|
10642
|
-
|
10643
|
-
|
10644
|
-
|
10645
|
-
|
10646
|
-
|
10647
|
-
|
10648
|
-
|
10649
|
-
|
10650
|
-
};
|
10651
|
-
|
10652
|
-
const
|
10653
|
-
|
10654
|
-
|
10655
|
-
}
|
10656
|
-
|
10657
|
-
|
10658
|
-
|
10659
|
-
|
10660
|
-
|
10661
|
-
|
10729
|
+
const handleTableChange = (sorter) => {
|
10730
|
+
if (sorter && sorter.field && onSort) {
|
10731
|
+
onSort(sorter.field);
|
10732
|
+
}
|
10733
|
+
};
|
10734
|
+
const handleOnClickRow = (record, onRowClick2) => (e) => {
|
10735
|
+
const target = e.target;
|
10736
|
+
if (target.closest("input") || // ⛔ Checkbox
|
10737
|
+
target.closest("button") || // ⛔ Button trong row
|
10738
|
+
target.closest("svg") || // ⛔ Icon
|
10739
|
+
target.closest(".ant-checkbox") || // ⛔ AntD checkbox
|
10740
|
+
target.closest("a")) {
|
10741
|
+
return;
|
10742
|
+
}
|
10743
|
+
onRowClick2?.(record);
|
10744
|
+
};
|
10745
|
+
if (loading) return /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { type: "table" });
|
10746
|
+
const EmptyTable = () => {
|
10747
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center text-center", children: [
|
10748
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: "https://i.ibb.co/39C3x4LZ/Component-1.png", alt: "no data" }),
|
10749
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-lg font-bold text-black", children: "Không có dữ liệu nào phù hợp" }),
|
10750
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500", children: "Kiểm tra lại bộ lọc hoặc thêm mới dữ liệu" })
|
10751
|
+
] });
|
10752
|
+
};
|
10753
|
+
const tableContent = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: twMerge(showSetting ? "relative" : ""), children: [
|
10754
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
10755
|
+
HeadingTable,
|
10756
|
+
{
|
10757
|
+
filters,
|
10758
|
+
handleSearch,
|
10759
|
+
resetToInitialFilters,
|
10760
|
+
setOpenStting,
|
10761
|
+
showSetting,
|
10762
|
+
groupHeadingButtonItems,
|
10763
|
+
tagSearchItems,
|
10764
|
+
setTagSearchItems,
|
10765
|
+
keyActive,
|
10766
|
+
setKeyActive
|
10767
|
+
}
|
10768
|
+
),
|
10769
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
10770
|
+
Table$1,
|
10771
|
+
{
|
10772
|
+
rowKey,
|
10773
|
+
dataSource: data,
|
10774
|
+
columns: editable ? mergedColumns : columns,
|
10775
|
+
pagination: paginationConfig,
|
10776
|
+
loading,
|
10777
|
+
rowSelection,
|
10778
|
+
onChange: handleTableChange,
|
10779
|
+
onRow: (record) => ({
|
10780
|
+
onClick: handleOnClickRow(record, onRowClick)
|
10781
|
+
}),
|
10782
|
+
locale: {
|
10783
|
+
emptyText: /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyTable, {})
|
10784
|
+
},
|
10785
|
+
rowClassName: (_, index) => `table-row-${index % 2 === 0 ? "even" : "odd"}`,
|
10786
|
+
className: cx(tableCss, className),
|
10787
|
+
components: editable ? {
|
10788
|
+
body: { cell: EditableCell }
|
10789
|
+
} : void 0,
|
10790
|
+
...rest
|
10791
|
+
}
|
10792
|
+
),
|
10793
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
10794
|
+
SettingTable,
|
10795
|
+
{
|
10796
|
+
open: openSetting,
|
10797
|
+
setOpen: setOpenStting,
|
10798
|
+
title: titleSettingTableModal,
|
10799
|
+
showSetting,
|
10800
|
+
defaultSettingColumnItems: editable ? mergedColumns : columns,
|
10801
|
+
setDefaultSettingColumnItems: setColumns
|
10802
|
+
}
|
10803
|
+
),
|
10804
|
+
rowsSelected?.length && rowsSelected?.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed bottom-1/100 left-1/2 -translate-x-1/2 -translate-y-1/2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(BulkAction, { quantity: rowsSelected?.length || 0, status }) })
|
10805
|
+
] });
|
10806
|
+
const renderTableContent = () => {
|
10807
|
+
if (editable) {
|
10808
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("form", { onSubmit: handleSubmit(save), children: tableContent });
|
10809
|
+
}
|
10810
|
+
return tableContent;
|
10811
|
+
};
|
10812
|
+
//! Render
|
10813
|
+
if (loading) return /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { type: "table" });
|
10814
|
+
return renderTableContent();
|
10815
|
+
};
|
10816
|
+
|
10817
|
+
const createStoreImpl = (createState) => {
|
10818
|
+
let state;
|
10819
|
+
const listeners = /* @__PURE__ */ new Set();
|
10820
|
+
const setState = (partial, replace) => {
|
10821
|
+
const nextState = typeof partial === "function" ? partial(state) : partial;
|
10822
|
+
if (!Object.is(nextState, state)) {
|
10823
|
+
const previousState = state;
|
10824
|
+
state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState);
|
10825
|
+
listeners.forEach((listener) => listener(state, previousState));
|
10826
|
+
}
|
10827
|
+
};
|
10828
|
+
const getState = () => state;
|
10829
|
+
const getInitialState = () => initialState;
|
10830
|
+
const subscribe = (listener) => {
|
10831
|
+
listeners.add(listener);
|
10832
|
+
return () => listeners.delete(listener);
|
10833
|
+
};
|
10834
|
+
const api = { setState, getState, getInitialState, subscribe };
|
10835
|
+
const initialState = state = createState(setState, getState, api);
|
10836
|
+
return api;
|
10837
|
+
};
|
10838
|
+
const createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
|
10839
|
+
|
10840
|
+
const identity = (arg) => arg;
|
10841
|
+
function useStore(api, selector = identity) {
|
10842
|
+
const slice = React__default.useSyncExternalStore(
|
10843
|
+
api.subscribe,
|
10844
|
+
() => selector(api.getState()),
|
10845
|
+
() => selector(api.getInitialState())
|
10846
|
+
);
|
10847
|
+
React__default.useDebugValue(slice);
|
10848
|
+
return slice;
|
10849
|
+
}
|
10850
|
+
const createImpl = (createState) => {
|
10851
|
+
const api = createStore(createState);
|
10852
|
+
const useBoundStore = (selector) => useStore(api, selector);
|
10853
|
+
Object.assign(useBoundStore, api);
|
10854
|
+
return useBoundStore;
|
10855
|
+
};
|
10856
|
+
const create = (createState) => createState ? createImpl(createState) : createImpl;
|
10857
|
+
|
10858
|
+
const useTabStore = create((set) => ({
|
10859
|
+
activeTabKey: void 0,
|
10860
|
+
// giá trị mặc định
|
10861
|
+
setActiveTabKey: (key) => set({ activeTabKey: key })
|
10862
|
+
}));
|
10863
|
+
|
10864
|
+
const Tabs = ({
|
10865
|
+
items,
|
10866
|
+
lazyRender = false,
|
10867
|
+
defaultActiveKey,
|
10868
|
+
...rest
|
10869
|
+
}) => {
|
10870
|
+
const { activeTabKey, setActiveTabKey } = useTabStore();
|
10871
|
+
const defaultKey = defaultActiveKey?.toString() || items[0]?.key;
|
10872
|
+
useEffect(() => {
|
10873
|
+
if (!activeTabKey && defaultKey) {
|
10874
|
+
setActiveTabKey(defaultKey);
|
10875
|
+
}
|
10876
|
+
}, [activeTabKey, defaultKey, setActiveTabKey]);
|
10877
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
10878
|
+
Tabs$1,
|
10879
|
+
{
|
10880
|
+
items,
|
10881
|
+
destroyInactiveTabPane: lazyRender,
|
10882
|
+
activeKey: activeTabKey,
|
10883
|
+
defaultActiveKey,
|
10884
|
+
onChange: (key) => setActiveTabKey(key),
|
10885
|
+
...rest
|
10886
|
+
}
|
10887
|
+
);
|
10888
|
+
};
|
10889
|
+
|
10890
|
+
const Popover = (props) => {
|
10891
|
+
const { containerClassName, popoverClassName, ...restProps } = props;
|
10892
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: containerClassName, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Popover$1, { className: popoverClassName, ...restProps }) });
|
10893
|
+
};
|
10894
|
+
|
10895
|
+
const Container = ({
|
10896
|
+
children,
|
10897
|
+
className,
|
10898
|
+
size
|
10899
|
+
}) => {
|
10900
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
10901
|
+
"div",
|
10902
|
+
{
|
10903
|
+
className: classNames(size, "mx-auto px-4 sm:px-6 lg:px-8", className),
|
10904
|
+
children
|
10905
|
+
}
|
10906
|
+
);
|
10907
|
+
};
|
10908
|
+
|
10909
|
+
const Col = (props) => {
|
10910
|
+
const { colClassName, ...restProps } = props;
|
10911
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Col$1, { className: colClassName, ...restProps });
|
10912
|
+
};
|
10913
|
+
|
10914
|
+
const Row = (props) => {
|
10915
|
+
const { rowClassName, ...restProps } = props;
|
10916
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Row$1, { className: rowClassName, ...restProps });
|
10917
|
+
};
|
10918
|
+
|
10919
|
+
const Dropdown = (props) => {
|
10920
|
+
const { containerClassName, dropdownClassName, ...restProps } = props;
|
10921
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: containerClassName, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Dropdown$1, { className: dropdownClassName, ...restProps }) });
|
10922
|
+
};
|
10923
|
+
|
10924
|
+
const Flex = (props) => {
|
10925
|
+
const { containerClassName, flexClassName, ...restProps } = props;
|
10926
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: containerClassName, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Flex$1, { className: flexClassName, ...restProps }) });
|
10927
|
+
};
|
10928
|
+
|
10929
|
+
function _arrayWithoutHoles(r) {
|
10930
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
10931
|
+
}
|
10932
|
+
|
10933
|
+
function _iterableToArray(r) {
|
10662
10934
|
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
10663
10935
|
}
|
10664
10936
|
|
@@ -17314,276 +17586,6 @@ const Image = (props) => {
|
|
17314
17586
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Image$1, { ...props });
|
17315
17587
|
};
|
17316
17588
|
|
17317
|
-
const ConfirmModal = ({
|
17318
|
-
title,
|
17319
|
-
content,
|
17320
|
-
typeIcon,
|
17321
|
-
titleCancelBtn = "Huỷ bỏ",
|
17322
|
-
titleSubmitBtn = "Xác nhận",
|
17323
|
-
handleCancel,
|
17324
|
-
handleSubmit,
|
17325
|
-
...restProps
|
17326
|
-
}) => {
|
17327
|
-
//! State
|
17328
|
-
const IconType = () => {
|
17329
|
-
switch (typeIcon) {
|
17330
|
-
case "success":
|
17331
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
17332
|
-
"svg",
|
17333
|
-
{
|
17334
|
-
xmlns: "http://www.w3.org/2000/svg",
|
17335
|
-
width: "24",
|
17336
|
-
height: "24",
|
17337
|
-
viewBox: "0 0 24 24",
|
17338
|
-
fill: "none",
|
17339
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
17340
|
-
"path",
|
17341
|
-
{
|
17342
|
-
d: "M12 1.5C6.20156 1.5 1.5 6.20156 1.5 12C1.5 17.7984 6.20156 22.5 12 22.5C17.7984 22.5 22.5 17.7984 22.5 12C22.5 6.20156 17.7984 1.5 12 1.5ZM16.5352 8.57109L11.5992 15.4148C11.5302 15.5111 11.4393 15.5896 11.3339 15.6437C11.2286 15.6978 11.1118 15.7261 10.9934 15.7261C10.8749 15.7261 10.7582 15.6978 10.6528 15.6437C10.5474 15.5896 10.4565 15.5111 10.3875 15.4148L7.46484 11.3648C7.37578 11.2406 7.46484 11.0672 7.61719 11.0672H8.71641C8.95547 11.0672 9.18281 11.182 9.32344 11.3789L10.9922 13.6945L14.6766 8.58516C14.8172 8.39062 15.0422 8.27344 15.2836 8.27344H16.3828C16.5352 8.27344 16.6242 8.44688 16.5352 8.57109Z",
|
17343
|
-
fill: "#52C41A"
|
17344
|
-
}
|
17345
|
-
)
|
17346
|
-
}
|
17347
|
-
);
|
17348
|
-
case "error":
|
17349
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
17350
|
-
"svg",
|
17351
|
-
{
|
17352
|
-
xmlns: "http://www.w3.org/2000/svg",
|
17353
|
-
width: "24",
|
17354
|
-
height: "24",
|
17355
|
-
viewBox: "0 0 24 24",
|
17356
|
-
fill: "none",
|
17357
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
17358
|
-
"path",
|
17359
|
-
{
|
17360
|
-
d: "M12 1.5C6.20156 1.5 1.5 6.20156 1.5 12C1.5 17.7984 6.20156 22.5 12 22.5C17.7984 22.5 22.5 17.7984 22.5 12C22.5 6.20156 17.7984 1.5 12 1.5ZM15.8766 15.9891L14.3297 15.982L12 13.2047L9.67266 15.9797L8.12344 15.9867C8.02031 15.9867 7.93594 15.9047 7.93594 15.7992C7.93594 15.7547 7.95234 15.7125 7.98047 15.6773L11.0297 12.0445L7.98047 8.41406C7.95215 8.37971 7.93643 8.3367 7.93594 8.29219C7.93594 8.18906 8.02031 8.10469 8.12344 8.10469L9.67266 8.11172L12 10.8891L14.3273 8.11406L15.8742 8.10703C15.9773 8.10703 16.0617 8.18906 16.0617 8.29453C16.0617 8.33906 16.0453 8.38125 16.0172 8.41641L12.9727 12.0469L16.0195 15.6797C16.0477 15.7148 16.0641 15.757 16.0641 15.8016C16.0641 15.9047 15.9797 15.9891 15.8766 15.9891Z",
|
17361
|
-
fill: "#FF4D4F"
|
17362
|
-
}
|
17363
|
-
)
|
17364
|
-
}
|
17365
|
-
);
|
17366
|
-
case "info":
|
17367
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
17368
|
-
"svg",
|
17369
|
-
{
|
17370
|
-
xmlns: "http://www.w3.org/2000/svg",
|
17371
|
-
width: "24",
|
17372
|
-
height: "24",
|
17373
|
-
viewBox: "0 0 24 24",
|
17374
|
-
fill: "none",
|
17375
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
17376
|
-
"path",
|
17377
|
-
{
|
17378
|
-
d: "M12 1.5C6.20156 1.5 1.5 6.20156 1.5 12C1.5 17.7984 6.20156 22.5 12 22.5C17.7984 22.5 22.5 17.7984 22.5 12C22.5 6.20156 17.7984 1.5 12 1.5ZM12.75 17.0625C12.75 17.1656 12.6656 17.25 12.5625 17.25H11.4375C11.3344 17.25 11.25 17.1656 11.25 17.0625V10.6875C11.25 10.5844 11.3344 10.5 11.4375 10.5H12.5625C12.6656 10.5 12.75 10.5844 12.75 10.6875V17.0625ZM12 9C11.7056 8.99399 11.4253 8.87282 11.2192 8.6625C11.0132 8.45218 10.8977 8.16945 10.8977 7.875C10.8977 7.58055 11.0132 7.29782 11.2192 7.0875C11.4253 6.87718 11.7056 6.75601 12 6.75C12.2944 6.75601 12.5747 6.87718 12.7808 7.0875C12.9868 7.29782 13.1023 7.58055 13.1023 7.875C13.1023 8.16945 12.9868 8.45218 12.7808 8.6625C12.5747 8.87282 12.2944 8.99399 12 9Z",
|
17379
|
-
fill: "#1677FF"
|
17380
|
-
}
|
17381
|
-
)
|
17382
|
-
}
|
17383
|
-
);
|
17384
|
-
case "warning":
|
17385
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
17386
|
-
"svg",
|
17387
|
-
{
|
17388
|
-
xmlns: "http://www.w3.org/2000/svg",
|
17389
|
-
width: "24",
|
17390
|
-
height: "24",
|
17391
|
-
viewBox: "0 0 24 24",
|
17392
|
-
fill: "none",
|
17393
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
17394
|
-
"path",
|
17395
|
-
{
|
17396
|
-
d: "M12 1.5C6.20156 1.5 1.5 6.20156 1.5 12C1.5 17.7984 6.20156 22.5 12 22.5C17.7984 22.5 22.5 17.7984 22.5 12C22.5 6.20156 17.7984 1.5 12 1.5ZM11.25 6.9375C11.25 6.83437 11.3344 6.75 11.4375 6.75H12.5625C12.6656 6.75 12.75 6.83437 12.75 6.9375V13.3125C12.75 13.4156 12.6656 13.5 12.5625 13.5H11.4375C11.3344 13.5 11.25 13.4156 11.25 13.3125V6.9375ZM12 17.25C11.7056 17.244 11.4253 17.1228 11.2192 16.9125C11.0132 16.7022 10.8977 16.4195 10.8977 16.125C10.8977 15.8305 11.0132 15.5478 11.2192 15.3375C11.4253 15.1272 11.7056 15.006 12 15C12.2944 15.006 12.5747 15.1272 12.7808 15.3375C12.9868 15.5478 13.1023 15.8305 13.1023 16.125C13.1023 16.4195 12.9868 16.7022 12.7808 16.9125C12.5747 17.1228 12.2944 17.244 12 17.25Z",
|
17397
|
-
fill: "#FAAD14"
|
17398
|
-
}
|
17399
|
-
)
|
17400
|
-
}
|
17401
|
-
);
|
17402
|
-
}
|
17403
|
-
};
|
17404
|
-
//! Function
|
17405
|
-
//! Render
|
17406
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Modal, { ...restProps, footer: null, closeIcon: null, width: 400, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
17407
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-3", children: [
|
17408
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(IconType, {}),
|
17409
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
17410
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-base font-semibold", children: title }),
|
17411
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm", children: content })
|
17412
|
-
] })
|
17413
|
-
] }),
|
17414
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2 w-full justify-end items-end pt-3", children: [
|
17415
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { shape: "round", onClick: handleCancel, children: titleCancelBtn }),
|
17416
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { shape: "round", type: "primary", onClick: handleSubmit, children: titleSubmitBtn })
|
17417
|
-
] })
|
17418
|
-
] }) });
|
17419
|
-
};
|
17420
|
-
|
17421
|
-
var CATEGORY_LIST_ENUM = /* @__PURE__ */ ((CATEGORY_LIST_ENUM2) => {
|
17422
|
-
CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["DRAFT"] = 0] = "DRAFT";
|
17423
|
-
CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["WATING_APPROVAL"] = 1] = "WATING_APPROVAL";
|
17424
|
-
CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["ACTIVE"] = 2] = "ACTIVE";
|
17425
|
-
CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["INACTIVE"] = 3] = "INACTIVE";
|
17426
|
-
CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["REJECT"] = 4] = "REJECT";
|
17427
|
-
CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["DELETE"] = 5] = "DELETE";
|
17428
|
-
return CATEGORY_LIST_ENUM2;
|
17429
|
-
})(CATEGORY_LIST_ENUM || {});
|
17430
|
-
|
17431
|
-
const BulkAction = ({
|
17432
|
-
quantity,
|
17433
|
-
handleRestore,
|
17434
|
-
handleSendApproval,
|
17435
|
-
handleCancelSendApproval,
|
17436
|
-
handleRefuseApproval,
|
17437
|
-
handleApproval,
|
17438
|
-
handleCancelApproval,
|
17439
|
-
handleDelete,
|
17440
|
-
handleActivate,
|
17441
|
-
handleInActivate,
|
17442
|
-
status
|
17443
|
-
}) => {
|
17444
|
-
//! State
|
17445
|
-
const listIcon = [
|
17446
|
-
{
|
17447
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RestoreIcon, { stroke: "white" }),
|
17448
|
-
action: handleRestore,
|
17449
|
-
showConfirmModal: false,
|
17450
|
-
title: "Khôi phục",
|
17451
|
-
arrShow: [CATEGORY_LIST_ENUM?.DELETE, CATEGORY_LIST_ENUM?.REJECT]
|
17452
|
-
},
|
17453
|
-
{
|
17454
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(SendApprovalIcon, { stroke: "white" }),
|
17455
|
-
action: handleSendApproval,
|
17456
|
-
showConfirmModal: true,
|
17457
|
-
typeIcon: "info",
|
17458
|
-
title: "Xác nhận gửi duyệt",
|
17459
|
-
content: "Bạn có chắc chắn muốn gửi duyệt mục này không?",
|
17460
|
-
arrShow: [CATEGORY_LIST_ENUM?.DRAFT]
|
17461
|
-
},
|
17462
|
-
{
|
17463
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(CancelSendApprovalIcon, { stroke: "white" }),
|
17464
|
-
action: handleCancelSendApproval,
|
17465
|
-
showConfirmModal: true,
|
17466
|
-
typeIcon: "error",
|
17467
|
-
title: "Xác nhận hủy gửi duyệt",
|
17468
|
-
content: "Bạn có chắc chắn muốn hủy gửi duyệt mục này không?",
|
17469
|
-
arrShow: [CATEGORY_LIST_ENUM?.WATING_APPROVAL]
|
17470
|
-
},
|
17471
|
-
{
|
17472
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(RefuseApprovalIcon, { stroke: "white" }),
|
17473
|
-
action: handleRefuseApproval,
|
17474
|
-
showConfirmModal: true,
|
17475
|
-
typeIcon: "error",
|
17476
|
-
title: "Xác nhận từ chối duyệt",
|
17477
|
-
content: "Bạn có chắc chắn muốn từ chối duyệt mục này không? Hành động này không thể hoàn tác.",
|
17478
|
-
arrShow: [CATEGORY_LIST_ENUM?.WATING_APPROVAL]
|
17479
|
-
},
|
17480
|
-
{
|
17481
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(ApprovalIcon, { stroke: "white" }),
|
17482
|
-
action: handleApproval,
|
17483
|
-
showConfirmModal: true,
|
17484
|
-
typeIcon: "info",
|
17485
|
-
title: "Xác nhận duyệt",
|
17486
|
-
content: "Bạn có chắc chắn muốn duyệt mục này không?",
|
17487
|
-
arrShow: [CATEGORY_LIST_ENUM?.WATING_APPROVAL]
|
17488
|
-
},
|
17489
|
-
{
|
17490
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(CancelApprovalIcon, { stroke: "white" }),
|
17491
|
-
action: handleCancelApproval,
|
17492
|
-
showConfirmModal: true,
|
17493
|
-
typeIcon: "error",
|
17494
|
-
title: "Xác nhận hủy duyệt",
|
17495
|
-
content: "Bạn có chắc chắn muốn hủy duyệt mục này không?",
|
17496
|
-
arrShow: [CATEGORY_LIST_ENUM?.ACTIVE]
|
17497
|
-
},
|
17498
|
-
{
|
17499
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(DeleteIcon, { fill: "white" }),
|
17500
|
-
action: handleDelete,
|
17501
|
-
showConfirmModal: true,
|
17502
|
-
typeIcon: "error",
|
17503
|
-
title: "Xác nhận xóa",
|
17504
|
-
content: "Bạn có chắc chắn muốn xóa mục này không? Hành động này không thể hoàn tác.",
|
17505
|
-
arrShow: [
|
17506
|
-
CATEGORY_LIST_ENUM?.DRAFT,
|
17507
|
-
CATEGORY_LIST_ENUM?.ACTIVE,
|
17508
|
-
CATEGORY_LIST_ENUM?.INACTIVE
|
17509
|
-
]
|
17510
|
-
},
|
17511
|
-
{
|
17512
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(ActivateIcon, { stroke: "white" }),
|
17513
|
-
action: handleActivate,
|
17514
|
-
showConfirmModal: true,
|
17515
|
-
typeIcon: "info",
|
17516
|
-
title: "Xác nhận kích hoạt",
|
17517
|
-
content: "Bạn có chắc chắn muốn kích hoạt mục này không?",
|
17518
|
-
arrShow: [CATEGORY_LIST_ENUM?.INACTIVE]
|
17519
|
-
},
|
17520
|
-
{
|
17521
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(InActiveIcon, { stroke: "white" }),
|
17522
|
-
action: handleInActivate,
|
17523
|
-
showConfirmModal: true,
|
17524
|
-
typeIcon: "info",
|
17525
|
-
title: "Xác nhận vô hiệu hóa",
|
17526
|
-
content: "Bạn có chắc chắn muốn vô hiệu hóa mục này không?",
|
17527
|
-
arrShow: [CATEGORY_LIST_ENUM?.ACTIVE]
|
17528
|
-
}
|
17529
|
-
];
|
17530
|
-
const [open, setOpen] = useState(false);
|
17531
|
-
const [notifyContent, setNotifyContent] = useState({
|
17532
|
-
title: "",
|
17533
|
-
content: "",
|
17534
|
-
typeIcon: "info",
|
17535
|
-
handleCancel: () => {
|
17536
|
-
},
|
17537
|
-
handleSubmit: () => {
|
17538
|
-
}
|
17539
|
-
});
|
17540
|
-
//! Function
|
17541
|
-
const IsShow = (arrStatus) => {
|
17542
|
-
return arrStatus.includes(status);
|
17543
|
-
};
|
17544
|
-
//! Render
|
17545
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full flex justify-center items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3 px-[10px] py-3 bg-[#2561ED] rounded-lg w-fit", children: [
|
17546
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-white px-3", children: [
|
17547
|
-
"Đã chọn: ",
|
17548
|
-
quantity
|
17549
|
-
] }),
|
17550
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-5 border-l border-white mx-1" }),
|
17551
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center space-x-3", children: listIcon.map(
|
17552
|
-
(item, index) => IsShow(item?.arrShow) && /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title: item?.title, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
17553
|
-
"button",
|
17554
|
-
{
|
17555
|
-
className: "p-1 rounded-sm transition duration-200 cursor-pointer hover:bg-[#1B4ACB] hover:rounded-sm",
|
17556
|
-
onClick: item?.showConfirmModal ? () => {
|
17557
|
-
setOpen(true);
|
17558
|
-
setNotifyContent({
|
17559
|
-
title: item?.title || "",
|
17560
|
-
content: item?.content || "",
|
17561
|
-
typeIcon: item?.typeIcon,
|
17562
|
-
handleCancel: () => {
|
17563
|
-
setOpen(false);
|
17564
|
-
},
|
17565
|
-
handleSubmit: item?.action
|
17566
|
-
});
|
17567
|
-
} : item?.action,
|
17568
|
-
children: item.icon
|
17569
|
-
},
|
17570
|
-
index
|
17571
|
-
) })
|
17572
|
-
) }),
|
17573
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
17574
|
-
ConfirmModal,
|
17575
|
-
{
|
17576
|
-
title: notifyContent?.title,
|
17577
|
-
content: notifyContent?.content,
|
17578
|
-
typeIcon: notifyContent?.typeIcon,
|
17579
|
-
open,
|
17580
|
-
handleCancel: notifyContent?.handleCancel,
|
17581
|
-
handleSubmit: notifyContent?.handleSubmit
|
17582
|
-
}
|
17583
|
-
)
|
17584
|
-
] }) });
|
17585
|
-
};
|
17586
|
-
|
17587
17589
|
class ErrorBoundaryClass extends Component {
|
17588
17590
|
constructor(props) {
|
17589
17591
|
super(props);
|