@pnkx-lib/ui 1.9.178 → 1.9.180
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/AntdIcon-B_SLhOJa.js +1211 -0
- package/es/chunks/_commonjsHelpers-BFTU3MAI.js +7 -0
- package/es/chunks/bundle-mjs-BME7zF0Z.js +2956 -0
- package/es/chunks/common-CocKiHtC.js +3 -0
- package/es/chunks/defineProperty-D53odpB3.js +50 -0
- package/es/chunks/get-C880miVG.js +1726 -0
- package/es/chunks/index-mzHK7Za8.js +90 -0
- package/es/chunks/index.esm-DPdCEbIy.js +2276 -0
- package/es/chunks/jsx-runtime-DFKOoQSG.js +430 -0
- package/es/chunks/layout-B04d5Lfr.js +6094 -0
- package/es/constants/index.js +38 -0
- package/es/fields/CascaderField.js +59 -0
- package/es/fields/Checkbox.js +56 -0
- package/es/fields/DatePicker.js +13030 -0
- package/es/fields/DateRangePicker.js +58 -0
- package/es/fields/Input.js +1379 -0
- package/es/fields/PnkxField.js +19 -0
- package/es/fields/Radio.js +56 -0
- package/es/fields/Select.js +61 -0
- package/es/fields/SliderRanger.js +58 -0
- package/es/fields/SliderSingle.js +58 -0
- package/es/fields/Switch.js +58 -0
- package/es/fields/Textarea.js +66 -0
- package/es/fields/TinyMCE.js +1969 -0
- package/es/fields/Upload.js +113 -0
- package/es/fields/index.js +13 -2
- package/es/hooks/index.js +2 -1
- package/es/hooks/useMessage.js +15 -0
- package/es/{chunks/useMessage-CUPcOtIS.js → hooks/useToast.js} +2 -14
- package/es/index.js +74 -4
- package/es/ui/Alert.js +8 -0
- package/es/ui/Anchor.js +9 -0
- package/es/ui/Appfix.js +8 -0
- package/es/ui/AutoComplete.js +8 -0
- package/es/ui/Badge.js +15 -0
- package/es/ui/BottomPagination.js +57 -0
- package/es/ui/Breadcrumb.js +9 -0
- package/es/ui/BreadcrumbHeading.js +54 -0
- package/es/ui/Button.js +8 -0
- package/es/ui/Card.js +8 -0
- package/es/ui/Cascader.js +21 -0
- package/es/ui/CategoryStatus.js +50 -0
- package/es/ui/Col.js +9 -0
- package/es/ui/Collapse.js +8 -0
- package/es/ui/ColorPicker.js +8 -0
- package/es/ui/ConfigProvider.js +11 -0
- package/es/ui/ConfirmModal.js +119 -0
- package/es/ui/Container.js +12 -0
- package/es/ui/Divider.js +8 -0
- package/es/ui/Drawer.js +19 -0
- package/es/ui/Dropdown.js +9 -0
- package/es/ui/Empty.js +8 -0
- package/es/ui/ErrorBoundary.js +81 -0
- package/es/ui/ErrorMessage.js +14 -0
- package/es/ui/Flex.js +9 -0
- package/es/ui/Footer.js +13 -0
- package/es/ui/Heading.js +67 -0
- package/es/ui/Image.js +8 -0
- package/es/ui/Label.js +14 -0
- package/es/ui/Layout.js +25 -0
- package/es/ui/Menu.js +24 -0
- package/es/ui/Modal.js +8 -0
- package/es/{chunks/PageNotFound-D6b4M484.js → ui/PageNotFound.js} +7 -1865
- package/es/ui/Pagination.js +10 -0
- package/es/ui/Popconfirm.js +8 -0
- package/es/ui/Popover.js +9 -0
- package/es/ui/QRCode.js +8 -0
- package/es/ui/Rate.js +8 -0
- package/es/ui/Result.js +8 -0
- package/es/ui/Row.js +9 -0
- package/es/ui/SearchFilterForm.js +87 -0
- package/es/ui/Segmented.js +8 -0
- package/es/ui/Sidebar.js +342 -0
- package/es/ui/Skeleton.js +34 -0
- package/es/ui/Space.js +11 -0
- package/es/ui/Spin.js +8 -0
- package/es/ui/Splitter.js +11 -0
- package/es/ui/Statistic.js +8 -0
- package/es/ui/Steps.js +11 -0
- package/es/ui/Tabs.js +78 -0
- package/es/ui/Tag.js +12 -0
- package/es/ui/Timeline.js +8 -0
- package/es/ui/Tooltip.js +8 -0
- package/es/ui/Tour.js +8 -0
- package/es/ui/Tree.js +8 -0
- package/es/ui/Typography.js +11 -0
- package/es/ui/UploadImage.js +116 -0
- package/es/ui/Watermark.js +28 -0
- package/es/ui/index.js +5235 -2
- package/package.json +31 -1
- package/types/components/ui/BulkActions/BulkAction.d.ts +1 -1
- package/types/components/ui/BulkActions/index.d.ts +1 -1
- package/types/components/ui/Table/ActionRowTable/index.d.ts +1 -1
- package/types/components/ui/Table/HeadingTable/components/GroupHeadingButton.d.ts +1 -1
- package/types/components/ui/Table/index.d.ts +1 -1
- package/types/fields/CascaderField.d.ts +2 -0
- package/types/fields/Checkbox.d.ts +2 -0
- package/types/fields/DatePicker.d.ts +2 -0
- package/types/fields/DateRangePicker.d.ts +2 -0
- package/types/fields/Input.d.ts +2 -0
- package/types/fields/PnkxField.d.ts +2 -0
- package/types/fields/Radio.d.ts +2 -0
- package/types/fields/Select.d.ts +2 -0
- package/types/fields/SliderRanger.d.ts +2 -0
- package/types/fields/SliderSingle.d.ts +2 -0
- package/types/fields/Switch.d.ts +2 -0
- package/types/fields/Textarea.d.ts +2 -0
- package/types/fields/TinyMCE.d.ts +2 -0
- package/types/fields/Upload.d.ts +2 -0
- package/types/fields/index.d.ts +2 -0
- package/types/hooks/index.d.ts +2 -0
- package/types/hooks/useMessage.d.ts +2 -0
- package/types/hooks/useToast.d.ts +2 -0
- package/types/ui/Alert.d.ts +2 -0
- package/types/ui/Anchor.d.ts +2 -0
- package/types/ui/Appfix.d.ts +2 -0
- package/types/ui/AutoComplete.d.ts +2 -0
- package/types/ui/Badge.d.ts +2 -0
- package/types/ui/BottomPagination.d.ts +2 -0
- package/types/ui/Breadcrumb.d.ts +2 -0
- package/types/ui/BreadcrumbHeading.d.ts +2 -0
- package/types/ui/Button.d.ts +2 -0
- package/types/ui/Card.d.ts +2 -0
- package/types/ui/Cascader.d.ts +2 -0
- package/types/ui/CategoryStatus.d.ts +2 -0
- package/types/ui/Col.d.ts +2 -0
- package/types/ui/Collapse.d.ts +2 -0
- package/types/ui/ColorPicker.d.ts +2 -0
- package/types/ui/ConfigProvider.d.ts +2 -0
- package/types/ui/ConfirmModal.d.ts +2 -0
- package/types/ui/Container.d.ts +2 -0
- package/types/ui/Divider.d.ts +2 -0
- package/types/ui/Drawer.d.ts +2 -0
- package/types/ui/Dropdown.d.ts +2 -0
- package/types/ui/Empty.d.ts +2 -0
- package/types/ui/ErrorBoundary.d.ts +2 -0
- package/types/ui/ErrorMessage.d.ts +2 -0
- package/types/ui/Flex.d.ts +2 -0
- package/types/ui/Footer.d.ts +4 -0
- package/types/ui/Heading.d.ts +2 -0
- package/types/ui/Image.d.ts +2 -0
- package/types/ui/Label.d.ts +2 -0
- package/types/ui/Layout.d.ts +2 -0
- package/types/ui/Menu.d.ts +2 -0
- package/types/ui/Modal.d.ts +2 -0
- package/types/ui/PageNotFound.d.ts +2 -0
- package/types/ui/Pagination.d.ts +2 -0
- package/types/ui/Popconfirm.d.ts +2 -0
- package/types/ui/Popover.d.ts +2 -0
- package/types/ui/QRCode.d.ts +2 -0
- package/types/ui/Rate.d.ts +2 -0
- package/types/ui/Result.d.ts +2 -0
- package/types/ui/Row.d.ts +2 -0
- package/types/ui/SearchFilterForm.d.ts +2 -0
- package/types/ui/Segmented.d.ts +2 -0
- package/types/ui/Sidebar.d.ts +2 -0
- package/types/ui/Skeleton.d.ts +2 -0
- package/types/ui/Space.d.ts +2 -0
- package/types/ui/Spin.d.ts +2 -0
- package/types/ui/Splitter.d.ts +2 -0
- package/types/ui/Statistic.d.ts +2 -0
- package/types/ui/Steps.d.ts +2 -0
- package/types/ui/Tabs.d.ts +2 -0
- package/types/ui/Tag.d.ts +2 -0
- package/types/ui/Timeline.d.ts +2 -0
- package/types/ui/Tooltip.d.ts +2 -0
- package/types/ui/Tour.d.ts +2 -0
- package/types/ui/Tree.d.ts +2 -0
- package/types/ui/Typography.d.ts +2 -0
- package/types/ui/UploadImage.d.ts +2 -0
- package/types/ui/Watermark.d.ts +2 -0
- package/types/ui/index.d.ts +2 -0
- package/es/chunks/SliderRanger-BXe2Nxdo.js +0 -361
- package/es/chunks/UploadImage-x6lE6WbO.js +0 -61133
- package/types/App.d.ts +0 -6
- package/types/DemoInput/DemoInput.d.ts +0 -1
- package/types/DemoTable/FiltersCategoryDemo/components/RenderFilterFields.d.ts +0 -12
- package/types/DemoTable/FiltersCategoryDemo/components/TagsFilter.d.ts +0 -12
- package/types/DemoTable/FiltersCategoryDemo/index.d.ts +0 -8
- package/types/DemoTable/apiUser.d.ts +0 -30
- package/types/DemoTable/hooks/useConvertGroupButton.d.ts +0 -13
- package/types/DemoTable/index.d.ts +0 -2
- package/types/DemoTable/tabDemo.d.ts +0 -2
- package/types/assets/svg/404.d.ts +0 -2
- package/types/assets/svg/Flag.d.ts +0 -2
- package/types/assets/svg/Logout.d.ts +0 -2
- package/types/assets/svg/PageNotFoundIcon.d.ts +0 -3
- package/types/assets/svg/Search.d.ts +0 -2
- package/types/assets/svg/Setting.d.ts +0 -2
- package/types/component-test/category-city.d.ts +0 -2
- package/types/component-test/category-manager.d.ts +0 -2
- package/types/component-test/default-layout.d.ts +0 -6
- package/types/component-test/detail-user.d.ts +0 -2
- package/types/component-test/permistion-user.d.ts +0 -2
- package/types/component-test/user-list.d.ts +0 -2
- package/types/fields.d.ts +0 -2
- package/types/hooks.d.ts +0 -2
- package/types/interface/common.d.ts +0 -14
- package/types/interface/tab.d.ts +0 -5
- package/types/main.d.ts +0 -0
- package/types/stores/tabStore.d.ts +0 -6
- package/types/stories/Input.stories.d.ts +0 -6
- package/types/ui.d.ts +0 -2
- package/types/utils/router.d.ts +0 -35
- package/types/utils/timer.d.ts +0 -7
- package/types/vite-env.d.ts +0 -1
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import { Button } from './Button.js';
|
|
3
|
+
import { Modal } from './Modal.js';
|
|
4
|
+
|
|
5
|
+
const ErrorConfirmIcon = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6
|
+
"svg",
|
|
7
|
+
{
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9
|
+
width: 24,
|
|
10
|
+
height: 24,
|
|
11
|
+
fill: "none",
|
|
12
|
+
...props,
|
|
13
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14
|
+
"path",
|
|
15
|
+
{
|
|
16
|
+
fill: props?.fill || "#FF4D4F",
|
|
17
|
+
d: "M12 1.5C6.202 1.5 1.5 6.202 1.5 12S6.202 22.5 12 22.5 22.5 17.798 22.5 12 17.798 1.5 12 1.5Zm3.877 14.49-1.547-.008L12 13.205 9.673 15.98l-1.55.007a.187.187 0 0 1-.187-.188c0-.044.016-.086.044-.122l3.05-3.633-3.05-3.63a.188.188 0 0 1 .143-.31l1.55.008L12 10.889l2.327-2.775 1.547-.007c.103 0 .188.082.188.188a.195.195 0 0 1-.045.121l-3.044 3.63 3.046 3.634a.188.188 0 0 1-.143.31Z"
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
const InfoConfirmIcon = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24
|
+
"svg",
|
|
25
|
+
{
|
|
26
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
27
|
+
width: 24,
|
|
28
|
+
height: 24,
|
|
29
|
+
fill: "none",
|
|
30
|
+
...props,
|
|
31
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
32
|
+
"path",
|
|
33
|
+
{
|
|
34
|
+
fill: props?.fill || "#1677FF",
|
|
35
|
+
stroke: props?.stroke,
|
|
36
|
+
d: "M12 1.5C6.202 1.5 1.5 6.202 1.5 12S6.202 22.5 12 22.5 22.5 17.798 22.5 12 17.798 1.5 12 1.5Zm.75 15.563a.188.188 0 0 1-.188.187h-1.124a.188.188 0 0 1-.188-.188v-6.375c0-.103.084-.187.188-.187h1.124c.104 0 .188.084.188.188v6.374ZM12 9a1.125 1.125 0 0 1 0-2.25A1.125 1.125 0 0 1 12 9Z"
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const SuccessIcon = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43
|
+
"svg",
|
|
44
|
+
{
|
|
45
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
46
|
+
width: 24,
|
|
47
|
+
height: 24,
|
|
48
|
+
fill: "none",
|
|
49
|
+
...props,
|
|
50
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
51
|
+
"path",
|
|
52
|
+
{
|
|
53
|
+
fill: props?.fill || "#52C41A",
|
|
54
|
+
stroke: props?.stroke,
|
|
55
|
+
d: "M12 1.5C6.202 1.5 1.5 6.202 1.5 12S6.202 22.5 12 22.5 22.5 17.798 22.5 12 17.798 1.5 12 1.5Zm4.535 7.071L11.6 15.415a.745.745 0 0 1-1.212 0l-2.922-4.05a.188.188 0 0 1 .152-.298h1.1c.238 0 .466.115.606.312l1.67 2.316 3.684-5.11a.75.75 0 0 1 .607-.312h1.099c.152 0 .241.174.152.298Z"
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
const WarningConfrimIcon = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
62
|
+
"svg",
|
|
63
|
+
{
|
|
64
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
65
|
+
width: 24,
|
|
66
|
+
height: 24,
|
|
67
|
+
fill: "none",
|
|
68
|
+
...props,
|
|
69
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
70
|
+
"path",
|
|
71
|
+
{
|
|
72
|
+
fill: props?.fill || "#FAAD14",
|
|
73
|
+
d: "M12 1.5C6.202 1.5 1.5 6.202 1.5 12S6.202 22.5 12 22.5 22.5 17.798 22.5 12 17.798 1.5 12 1.5Zm-.75 5.438c0-.104.084-.188.188-.188h1.124c.104 0 .188.084.188.188v6.375a.188.188 0 0 1-.188.187h-1.124a.188.188 0 0 1-.188-.188V6.939ZM12 17.25A1.125 1.125 0 0 1 12 15a1.125 1.125 0 0 1 0 2.25Z"
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
const ConfirmModal = ({
|
|
80
|
+
title,
|
|
81
|
+
content,
|
|
82
|
+
typeIcon,
|
|
83
|
+
titleCancelBtn = "Huỷ bỏ",
|
|
84
|
+
titleSubmitBtn = "Xác nhận",
|
|
85
|
+
handleCancel,
|
|
86
|
+
handleSubmit,
|
|
87
|
+
...restProps
|
|
88
|
+
}) => {
|
|
89
|
+
//! State
|
|
90
|
+
const IconType = () => {
|
|
91
|
+
switch (typeIcon) {
|
|
92
|
+
case "success":
|
|
93
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(SuccessIcon, {});
|
|
94
|
+
case "error":
|
|
95
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorConfirmIcon, {});
|
|
96
|
+
case "info":
|
|
97
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(InfoConfirmIcon, {});
|
|
98
|
+
case "warning":
|
|
99
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(WarningConfrimIcon, {});
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
//! Function
|
|
103
|
+
//! Render
|
|
104
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Modal, { ...restProps, footer: null, closeIcon: null, width: 400, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
105
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-3", children: [
|
|
106
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max-w-fit", children: /* @__PURE__ */ jsxRuntimeExports.jsx(IconType, {}) }),
|
|
107
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
108
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-base font-semibold", children: title }),
|
|
109
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm", children: content })
|
|
110
|
+
] })
|
|
111
|
+
] }),
|
|
112
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2 w-full justify-end items-end pt-3", children: [
|
|
113
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { shape: "round", onClick: handleCancel, children: titleCancelBtn }),
|
|
114
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { shape: "round", type: "primary", onClick: handleSubmit, children: titleSubmitBtn })
|
|
115
|
+
] })
|
|
116
|
+
] }) });
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export { ConfirmModal };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
|
|
3
|
+
|
|
4
|
+
const Container = ({
|
|
5
|
+
children,
|
|
6
|
+
className,
|
|
7
|
+
size
|
|
8
|
+
}) => {
|
|
9
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: twMerge(size, "mx-auto px-4 sm:px-6 lg:px-8", className), children });
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { Container };
|
package/es/ui/Divider.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import { Divider as Divider$1 } from 'antd';
|
|
3
|
+
|
|
4
|
+
const Divider = ({ children, ...rest }) => {
|
|
5
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Divider$1, { ...rest, children });
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { Divider };
|
package/es/ui/Drawer.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import { Drawer as Drawer$1 } from 'antd';
|
|
3
|
+
|
|
4
|
+
const Drawer = ({ onSubmit, children, ...rest }) => {
|
|
5
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Drawer$1, { ...rest, children: onSubmit ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6
|
+
"form",
|
|
7
|
+
{
|
|
8
|
+
id: "pnkx-form",
|
|
9
|
+
onSubmit: (e) => {
|
|
10
|
+
e.preventDefault();
|
|
11
|
+
onSubmit?.(e);
|
|
12
|
+
},
|
|
13
|
+
method: "POST",
|
|
14
|
+
children
|
|
15
|
+
}
|
|
16
|
+
) : children });
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { Drawer };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import { Dropdown as Dropdown$1 } from 'antd';
|
|
3
|
+
|
|
4
|
+
const Dropdown = (props) => {
|
|
5
|
+
const { containerClassName, dropdownClassName, ...restProps } = props;
|
|
6
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: containerClassName, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Dropdown$1, { className: dropdownClassName, ...restProps }) });
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export { Dropdown };
|
package/es/ui/Empty.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import { Component } from 'react';
|
|
3
|
+
|
|
4
|
+
class ErrorBoundaryClass extends Component {
|
|
5
|
+
constructor(props) {
|
|
6
|
+
super(props);
|
|
7
|
+
this.state = {
|
|
8
|
+
hasError: false,
|
|
9
|
+
error: null,
|
|
10
|
+
errorInfo: null
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
static getDerivedStateFromError(error) {
|
|
14
|
+
return { hasError: true, error, errorInfo: null };
|
|
15
|
+
}
|
|
16
|
+
componentDidCatch(error, errorInfo) {
|
|
17
|
+
this.setState({
|
|
18
|
+
hasError: true,
|
|
19
|
+
error,
|
|
20
|
+
errorInfo
|
|
21
|
+
});
|
|
22
|
+
console.error("Caught by ErrorBoundary:", error, errorInfo);
|
|
23
|
+
}
|
|
24
|
+
handleReload = () => {
|
|
25
|
+
window.location.reload();
|
|
26
|
+
};
|
|
27
|
+
render() {
|
|
28
|
+
const { hasError, error, errorInfo } = this.state;
|
|
29
|
+
if (hasError) {
|
|
30
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: styles.container, children: [
|
|
31
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { style: styles.title, children: "🚨 An unexpected error has occurred." }),
|
|
32
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { style: styles.description, children: "Please refresh the page or contact support if the problem persists." }),
|
|
33
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { style: styles.button, onClick: this.handleReload, children: "Reload Page" }),
|
|
34
|
+
process.env.NODE_ENV === "development" && error && /* @__PURE__ */ jsxRuntimeExports.jsxs("details", { style: styles.details, children: [
|
|
35
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("summary", { children: "View Error Details" }),
|
|
36
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("pre", { children: error.toString() }),
|
|
37
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("pre", { children: errorInfo?.componentStack })
|
|
38
|
+
] })
|
|
39
|
+
] });
|
|
40
|
+
}
|
|
41
|
+
return this.props.children;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const ErrorBoundary = ErrorBoundaryClass;
|
|
45
|
+
const styles = {
|
|
46
|
+
container: {
|
|
47
|
+
padding: "40px",
|
|
48
|
+
textAlign: "center",
|
|
49
|
+
fontFamily: "Arial, sans-serif",
|
|
50
|
+
color: "#333"
|
|
51
|
+
},
|
|
52
|
+
title: {
|
|
53
|
+
fontSize: "24px",
|
|
54
|
+
color: "#e74c3c",
|
|
55
|
+
marginBottom: "20px"
|
|
56
|
+
},
|
|
57
|
+
description: {
|
|
58
|
+
fontSize: "16px",
|
|
59
|
+
color: "#555",
|
|
60
|
+
marginBottom: "20px"
|
|
61
|
+
},
|
|
62
|
+
button: {
|
|
63
|
+
padding: "10px 20px",
|
|
64
|
+
fontSize: "16px",
|
|
65
|
+
cursor: "pointer",
|
|
66
|
+
backgroundColor: "#3498db",
|
|
67
|
+
color: "#fff",
|
|
68
|
+
border: "none",
|
|
69
|
+
borderRadius: "5px"
|
|
70
|
+
},
|
|
71
|
+
details: {
|
|
72
|
+
marginTop: "20px",
|
|
73
|
+
textAlign: "left",
|
|
74
|
+
background: "#f4f4f4",
|
|
75
|
+
padding: "15px",
|
|
76
|
+
borderRadius: "5px",
|
|
77
|
+
color: "#000"
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export { ErrorBoundary };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
const ErrorMessage = React__default.memo(
|
|
5
|
+
({ errorMessage, isTouched, isSubmitted }) => {
|
|
6
|
+
if (!(isTouched || isSubmitted)) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
if (!errorMessage) return null;
|
|
10
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ml-2 text-red-600", children: errorMessage });
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
export { ErrorMessage };
|
package/es/ui/Flex.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import { Flex as Flex$1 } from 'antd';
|
|
3
|
+
|
|
4
|
+
const Flex = (props) => {
|
|
5
|
+
const { containerClassName, flexClassName, ...restProps } = props;
|
|
6
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: containerClassName, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Flex$1, { className: flexClassName, ...restProps }) });
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export { Flex };
|
package/es/ui/Footer.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import { Layout } from 'antd';
|
|
3
|
+
|
|
4
|
+
const { Footer: AntdFooter } = Layout;
|
|
5
|
+
const Footer = () => {
|
|
6
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(AntdFooter, { style: { textAlign: "center" }, children: [
|
|
7
|
+
"Footer ©",
|
|
8
|
+
(/* @__PURE__ */ new Date()).getFullYear(),
|
|
9
|
+
" Created by Điệp lại lập trình"
|
|
10
|
+
] });
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { Footer as default };
|
package/es/ui/Heading.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import { c as className } from '../chunks/index-mzHK7Za8.js';
|
|
3
|
+
import { Breadcrumb } from './Breadcrumb.js';
|
|
4
|
+
import { useLocation, Link } from 'react-router';
|
|
5
|
+
|
|
6
|
+
const Heading = (props) => {
|
|
7
|
+
const { rightContent, children, noBreadcum, classNameWrapHeading, menu } = props;
|
|
8
|
+
//! State
|
|
9
|
+
const location = useLocation();
|
|
10
|
+
const pathUrl = location.pathname;
|
|
11
|
+
const breadcrumbsItem = [
|
|
12
|
+
{ title: /* @__PURE__ */ jsxRuntimeExports.jsx(Link, { to: "/", children: "Trang chủ" }) }
|
|
13
|
+
];
|
|
14
|
+
function findBreadcrumbs(items, currentPath, trail = []) {
|
|
15
|
+
for (const item of items) {
|
|
16
|
+
if (!item || !item.path) continue;
|
|
17
|
+
if (currentPath === item.path) {
|
|
18
|
+
if (!Object.prototype.hasOwnProperty.call(item, "isShowLabel") || item.isShowLabel) {
|
|
19
|
+
return [...trail, { title: /* @__PURE__ */ jsxRuntimeExports.jsx(Link, { to: item.path, children: item.name }) }];
|
|
20
|
+
}
|
|
21
|
+
return trail;
|
|
22
|
+
}
|
|
23
|
+
if (currentPath.startsWith(item.path)) {
|
|
24
|
+
const newTrail = [...trail];
|
|
25
|
+
if (!Object.prototype.hasOwnProperty.call(item, "isShowLabel") || item.isShowLabel) {
|
|
26
|
+
newTrail.push({
|
|
27
|
+
title: /* @__PURE__ */ jsxRuntimeExports.jsx(Link, { to: item.path, children: item.name })
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
if (item.children && item.children.length > 0) {
|
|
31
|
+
const childTrail = findBreadcrumbs(
|
|
32
|
+
item.children,
|
|
33
|
+
currentPath,
|
|
34
|
+
newTrail
|
|
35
|
+
);
|
|
36
|
+
if (childTrail) return childTrail;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
const dynamicBreadcrumbs = findBreadcrumbs(menu, pathUrl);
|
|
43
|
+
if (dynamicBreadcrumbs) {
|
|
44
|
+
breadcrumbsItem.push(...dynamicBreadcrumbs);
|
|
45
|
+
}
|
|
46
|
+
console.log("breadcrumbsItem table", breadcrumbsItem);
|
|
47
|
+
//! Function
|
|
48
|
+
//! Render
|
|
49
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
50
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
className: className(
|
|
54
|
+
"flex justify-between items-end",
|
|
55
|
+
classNameWrapHeading
|
|
56
|
+
),
|
|
57
|
+
children: [
|
|
58
|
+
!noBreadcum && /* @__PURE__ */ jsxRuntimeExports.jsx(Breadcrumb, { items: breadcrumbsItem }),
|
|
59
|
+
rightContent
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
children
|
|
64
|
+
] });
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export { Heading };
|
package/es/ui/Image.js
ADDED
package/es/ui/Label.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import { Typography } from './Typography.js';
|
|
3
|
+
|
|
4
|
+
const Label = ({ label, required }) => {
|
|
5
|
+
//! State
|
|
6
|
+
//! Function
|
|
7
|
+
//! Render
|
|
8
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-1 mb-2 items-baseline", children: [
|
|
9
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { children: label }),
|
|
10
|
+
required && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-600 h-0", children: "*" })
|
|
11
|
+
] });
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { Label };
|
package/es/ui/Layout.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import { S as SiderContext, a as Sider, C as Content, F as Footer, H as Header, L as Layout$1 } from '../chunks/layout-B04d5Lfr.js';
|
|
3
|
+
|
|
4
|
+
const LayoutComponent = ({
|
|
5
|
+
layoutClassName,
|
|
6
|
+
className,
|
|
7
|
+
...rest
|
|
8
|
+
}) => {
|
|
9
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10
|
+
Layout$1,
|
|
11
|
+
{
|
|
12
|
+
className: [layoutClassName, className].filter(Boolean).join(" "),
|
|
13
|
+
...rest
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
const Layout = Object.assign(LayoutComponent, {
|
|
18
|
+
Header,
|
|
19
|
+
Footer,
|
|
20
|
+
Content,
|
|
21
|
+
Sider,
|
|
22
|
+
_InternalSiderContext: SiderContext
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export { Layout };
|
package/es/ui/Menu.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import { Menu as Menu$1 } from 'antd';
|
|
3
|
+
|
|
4
|
+
const MenuComponent = ({
|
|
5
|
+
containerClassName,
|
|
6
|
+
menuClassName,
|
|
7
|
+
...rest
|
|
8
|
+
}) => {
|
|
9
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: containerClassName, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Menu$1, { className: menuClassName, ...rest }) });
|
|
10
|
+
};
|
|
11
|
+
const MenuItem = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(Menu$1.Item, { ...props });
|
|
12
|
+
MenuItem.displayName = "Menu.Item";
|
|
13
|
+
const SubMenu = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(Menu$1.SubMenu, { ...props });
|
|
14
|
+
SubMenu.displayName = "Menu.SubMenu";
|
|
15
|
+
const Divider = Menu$1.Divider;
|
|
16
|
+
const ItemGroup = Menu$1.ItemGroup;
|
|
17
|
+
const MenuComp = MenuComponent;
|
|
18
|
+
MenuComp.Item = MenuItem;
|
|
19
|
+
MenuComp.SubMenu = SubMenu;
|
|
20
|
+
MenuComp.Divider = Divider;
|
|
21
|
+
MenuComp.ItemGroup = ItemGroup;
|
|
22
|
+
const Menu = MenuComp;
|
|
23
|
+
|
|
24
|
+
export { Menu };
|
package/es/ui/Modal.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import { Modal as Modal$1 } from 'antd';
|
|
3
|
+
|
|
4
|
+
const Modal = ({ children, ...rest }) => {
|
|
5
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Modal$1, { ...rest, children });
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { Modal };
|