@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,113 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { Upload, Image } from 'antd';
|
|
5
|
+
import { g as get } from '../chunks/get-C880miVG.js';
|
|
6
|
+
import { ErrorMessage } from '../ui/ErrorMessage.js';
|
|
7
|
+
import { Label } from '../ui/Label.js';
|
|
8
|
+
import { I as Icon, _ as _extends } from '../chunks/AntdIcon-B_SLhOJa.js';
|
|
9
|
+
|
|
10
|
+
// This icon file is generated automatically.
|
|
11
|
+
var PlusOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z" } }, { "tag": "path", "attrs": { "d": "M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z" } }] }, "name": "plus", "theme": "outlined" };
|
|
12
|
+
|
|
13
|
+
var PlusOutlined = function PlusOutlined(props, ref) {
|
|
14
|
+
return /*#__PURE__*/React.createElement(Icon, _extends({}, props, {
|
|
15
|
+
ref: ref,
|
|
16
|
+
icon: PlusOutlined$1
|
|
17
|
+
}));
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** */
|
|
21
|
+
var RefIcon = /*#__PURE__*/React.forwardRef(PlusOutlined);
|
|
22
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
23
|
+
RefIcon.displayName = 'PlusOutlined';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const getBase64 = (file) => new Promise((resolve, reject) => {
|
|
27
|
+
const reader = new FileReader();
|
|
28
|
+
reader.readAsDataURL(file);
|
|
29
|
+
reader.onload = () => resolve(reader.result);
|
|
30
|
+
reader.onerror = (error) => reject(error);
|
|
31
|
+
});
|
|
32
|
+
const UploadField = (props) => {
|
|
33
|
+
//! State
|
|
34
|
+
const {
|
|
35
|
+
field,
|
|
36
|
+
formState,
|
|
37
|
+
label,
|
|
38
|
+
required,
|
|
39
|
+
maxFiles = 8,
|
|
40
|
+
uploadButtonText = "Upload",
|
|
41
|
+
// typeLabel = "text12Regular",
|
|
42
|
+
customStyleContainer,
|
|
43
|
+
customStyleUpload,
|
|
44
|
+
afterOnChange,
|
|
45
|
+
disabled,
|
|
46
|
+
...restProps
|
|
47
|
+
} = props;
|
|
48
|
+
const { name, value = [], onChange } = field || {};
|
|
49
|
+
const { touchedFields, errors, isSubmitted } = formState || {};
|
|
50
|
+
const isTouched = get(touchedFields, name);
|
|
51
|
+
const errorMessage = get(errors, name)?.message;
|
|
52
|
+
const [previewOpen, setPreviewOpen] = useState(false);
|
|
53
|
+
const [previewImage, setPreviewImage] = useState("");
|
|
54
|
+
//! Function
|
|
55
|
+
const handlePreview = async (file) => {
|
|
56
|
+
if (!file.url && !file.preview) {
|
|
57
|
+
file.preview = await getBase64(file.originFileObj);
|
|
58
|
+
}
|
|
59
|
+
setPreviewImage(file.url || file.preview);
|
|
60
|
+
setPreviewOpen(true);
|
|
61
|
+
};
|
|
62
|
+
const handleChange = ({ fileList }) => {
|
|
63
|
+
onChange?.(fileList);
|
|
64
|
+
afterOnChange?.(fileList);
|
|
65
|
+
};
|
|
66
|
+
const uploadButton = /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { style: { border: 0, background: "none" }, type: "button", children: [
|
|
67
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon, {}),
|
|
68
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { marginTop: 8 }, children: uploadButtonText })
|
|
69
|
+
] });
|
|
70
|
+
const renderErrorMessage = () => {
|
|
71
|
+
if (!errorMessage) return null;
|
|
72
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
73
|
+
ErrorMessage,
|
|
74
|
+
{
|
|
75
|
+
errorMessage,
|
|
76
|
+
isTouched,
|
|
77
|
+
isSubmitted
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
//! Render
|
|
82
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: customStyleContainer, children: [
|
|
83
|
+
label && /* @__PURE__ */ jsxRuntimeExports.jsx(Label, { label, required }),
|
|
84
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
85
|
+
Upload,
|
|
86
|
+
{
|
|
87
|
+
listType: "picture-card",
|
|
88
|
+
fileList: value,
|
|
89
|
+
onPreview: handlePreview,
|
|
90
|
+
onChange: handleChange,
|
|
91
|
+
disabled,
|
|
92
|
+
className: customStyleUpload,
|
|
93
|
+
...restProps,
|
|
94
|
+
children: value.length >= maxFiles ? null : uploadButton
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
renderErrorMessage(),
|
|
98
|
+
previewImage && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
99
|
+
Image,
|
|
100
|
+
{
|
|
101
|
+
wrapperStyle: { display: "none" },
|
|
102
|
+
preview: {
|
|
103
|
+
visible: previewOpen,
|
|
104
|
+
onVisibleChange: (visible) => setPreviewOpen(visible),
|
|
105
|
+
afterOpenChange: (visible) => !visible && setPreviewImage("")
|
|
106
|
+
},
|
|
107
|
+
src: previewImage
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
] });
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export { UploadField };
|
package/es/fields/index.js
CHANGED
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { Input } from './Input.js';
|
|
2
|
+
export { PnkxField } from './PnkxField.js';
|
|
3
|
+
export { Select } from './Select.js';
|
|
4
|
+
export { TinyMCE } from './TinyMCE.js';
|
|
5
|
+
export { Textarea } from './Textarea.js';
|
|
6
|
+
export { RadioGroup } from './Radio.js';
|
|
7
|
+
export { Checkbox } from './Checkbox.js';
|
|
8
|
+
export { DatePicker } from './DatePicker.js';
|
|
9
|
+
export { RangePicker } from './DateRangePicker.js';
|
|
10
|
+
export { UploadField } from './Upload.js';
|
|
11
|
+
export { Switch } from './Switch.js';
|
|
12
|
+
export { SliderSingle } from './SliderSingle.js';
|
|
13
|
+
export { SliderRange } from './SliderRanger.js';
|
package/es/hooks/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { useToast } from './useToast.js';
|
|
2
|
+
export { useMessage } from './useMessage.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { message } from 'antd';
|
|
2
|
+
|
|
3
|
+
const useMessage = (defaultProps) => {
|
|
4
|
+
return (overrideProps) => {
|
|
5
|
+
const mergedProps = {
|
|
6
|
+
type: defaultProps?.type,
|
|
7
|
+
content: defaultProps?.content,
|
|
8
|
+
...defaultProps,
|
|
9
|
+
...overrideProps
|
|
10
|
+
};
|
|
11
|
+
message.open(mergedProps);
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { useMessage };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { notification
|
|
1
|
+
import { notification } from 'antd';
|
|
2
2
|
|
|
3
3
|
const useToast = (defaultProps) => {
|
|
4
4
|
const toast = (overrideProps) => {
|
|
@@ -19,16 +19,4 @@ const useToast = (defaultProps) => {
|
|
|
19
19
|
return toast;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
return (overrideProps) => {
|
|
24
|
-
const mergedProps = {
|
|
25
|
-
type: defaultProps?.type,
|
|
26
|
-
content: defaultProps?.content,
|
|
27
|
-
...defaultProps,
|
|
28
|
-
...overrideProps
|
|
29
|
-
};
|
|
30
|
-
message.open(mergedProps);
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export { useMessage as a, useToast as u };
|
|
22
|
+
export { useToast };
|
package/es/index.js
CHANGED
|
@@ -1,4 +1,74 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
1
|
+
export { Button } from './ui/Button.js';
|
|
2
|
+
export { CascaderField } from './ui/Cascader.js';
|
|
3
|
+
export { ErrorMessage } from './ui/ErrorMessage.js';
|
|
4
|
+
export { Typography } from './ui/Typography.js';
|
|
5
|
+
export { ActionRowTable, BulkActions, Table } from './ui/index.js';
|
|
6
|
+
export { Modal } from './ui/Modal.js';
|
|
7
|
+
export { Tooltip } from './ui/Tooltip.js';
|
|
8
|
+
export { Tabs } from './ui/Tabs.js';
|
|
9
|
+
export { Label } from './ui/Label.js';
|
|
10
|
+
export { Skeleton } from './ui/Skeleton.js';
|
|
11
|
+
export { Popover } from './ui/Popover.js';
|
|
12
|
+
export { SearchFiltersForm } from './ui/SearchFilterForm.js';
|
|
13
|
+
export { Container } from './ui/Container.js';
|
|
14
|
+
export { Badge, typeColorMap } from './ui/Badge.js';
|
|
15
|
+
export { Col } from './ui/Col.js';
|
|
16
|
+
export { Row } from './ui/Row.js';
|
|
17
|
+
export { Dropdown } from './ui/Dropdown.js';
|
|
18
|
+
export { Breadcrumb } from './ui/Breadcrumb.js';
|
|
19
|
+
export { Flex } from './ui/Flex.js';
|
|
20
|
+
export { Layout } from './ui/Layout.js';
|
|
21
|
+
export { Space } from './ui/Space.js';
|
|
22
|
+
export { Splitter } from './ui/Splitter.js';
|
|
23
|
+
export { Menu } from './ui/Menu.js';
|
|
24
|
+
export { Pagination } from './ui/Pagination.js';
|
|
25
|
+
export { Steps } from './ui/Steps.js';
|
|
26
|
+
export { Sidebar } from './ui/Sidebar.js';
|
|
27
|
+
export { Heading } from './ui/Heading.js';
|
|
28
|
+
export { Tag } from './ui/Tag.js';
|
|
29
|
+
export { Divider } from './ui/Divider.js';
|
|
30
|
+
export { Alert } from './ui/Alert.js';
|
|
31
|
+
export { Spin } from './ui/Spin.js';
|
|
32
|
+
export { Drawer } from './ui/Drawer.js';
|
|
33
|
+
export { Popconfirm } from './ui/Popconfirm.js';
|
|
34
|
+
export { QRCode } from './ui/QRCode.js';
|
|
35
|
+
export { Result } from './ui/Result.js';
|
|
36
|
+
export { Rate } from './ui/Rate.js';
|
|
37
|
+
export { Segmented } from './ui/Segmented.js';
|
|
38
|
+
export { Statistic } from './ui/Statistic.js';
|
|
39
|
+
export { Timeline } from './ui/Timeline.js';
|
|
40
|
+
export { Tour } from './ui/Tour.js';
|
|
41
|
+
export { Tree } from './ui/Tree.js';
|
|
42
|
+
export { Watermark } from './ui/Watermark.js';
|
|
43
|
+
export { Anchor } from './ui/Anchor.js';
|
|
44
|
+
export { Appfix } from './ui/Appfix.js';
|
|
45
|
+
export { AutoComplete } from './ui/AutoComplete.js';
|
|
46
|
+
export { Collapse } from './ui/Collapse.js';
|
|
47
|
+
export { ColorPicker } from './ui/ColorPicker.js';
|
|
48
|
+
export { Empty } from './ui/Empty.js';
|
|
49
|
+
export { Image } from './ui/Image.js';
|
|
50
|
+
export { ConfirmModal } from './ui/ConfirmModal.js';
|
|
51
|
+
export { ErrorBoundary } from './ui/ErrorBoundary.js';
|
|
52
|
+
export { CATEGORY_LIST_ENUM, CategoryStatus, badgeStatusCategoryConfig } from './ui/CategoryStatus.js';
|
|
53
|
+
export { T as TINY_API } from './chunks/common-CocKiHtC.js';
|
|
54
|
+
export { PAGE_NUMBER, PAGE_SIZE, SORT, START_PAGE, START_PAGE_SIZE, TypeActionRowTable, TypeBulkActions, TypeStatusTable } from './constants/index.js';
|
|
55
|
+
export { BreadcrumbHeading } from './ui/BreadcrumbHeading.js';
|
|
56
|
+
export { Card } from './ui/Card.js';
|
|
57
|
+
export { ConfigProvider } from './ui/ConfigProvider.js';
|
|
58
|
+
export { PageNotFound } from './ui/PageNotFound.js';
|
|
59
|
+
export { UploadImage } from './ui/UploadImage.js';
|
|
60
|
+
export { Input } from './fields/Input.js';
|
|
61
|
+
export { PnkxField } from './fields/PnkxField.js';
|
|
62
|
+
export { Select } from './fields/Select.js';
|
|
63
|
+
export { TinyMCE } from './fields/TinyMCE.js';
|
|
64
|
+
export { Textarea } from './fields/Textarea.js';
|
|
65
|
+
export { RadioGroup } from './fields/Radio.js';
|
|
66
|
+
export { Checkbox } from './fields/Checkbox.js';
|
|
67
|
+
export { DatePicker } from './fields/DatePicker.js';
|
|
68
|
+
export { RangePicker } from './fields/DateRangePicker.js';
|
|
69
|
+
export { UploadField } from './fields/Upload.js';
|
|
70
|
+
export { Switch } from './fields/Switch.js';
|
|
71
|
+
export { SliderSingle } from './fields/SliderSingle.js';
|
|
72
|
+
export { SliderRange } from './fields/SliderRanger.js';
|
|
73
|
+
export { useToast } from './hooks/useToast.js';
|
|
74
|
+
export { useMessage } from './hooks/useMessage.js';
|
package/es/ui/Alert.js
ADDED
package/es/ui/Anchor.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import { Anchor as Anchor$1 } from 'antd';
|
|
3
|
+
|
|
4
|
+
const Anchor = (props) => {
|
|
5
|
+
const { containerClassName, anchorClassName, ...restProps } = props;
|
|
6
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: containerClassName, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Anchor$1, { className: anchorClassName, ...restProps }) });
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export { Anchor };
|
package/es/ui/Appfix.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import { AutoComplete as AutoComplete$1, Input } from 'antd';
|
|
3
|
+
|
|
4
|
+
const AutoComplete = (props) => {
|
|
5
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(AutoComplete$1, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Input, {}) });
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { AutoComplete };
|
package/es/ui/Badge.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import { Badge as Badge$1 } from 'antd';
|
|
3
|
+
|
|
4
|
+
const typeColorMap = {
|
|
5
|
+
error: "red",
|
|
6
|
+
info: "blue",
|
|
7
|
+
success: "green",
|
|
8
|
+
warning: "yellow"
|
|
9
|
+
};
|
|
10
|
+
const Badge = ({ type, children, customColor, ...rest }) => {
|
|
11
|
+
const color = type ? typeColorMap[type] : customColor;
|
|
12
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Badge$1, { color, ...rest, children });
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { Badge, typeColorMap };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import { Select } from '../fields/Select.js';
|
|
3
|
+
import { Pagination } from './Pagination.js';
|
|
4
|
+
|
|
5
|
+
const BottomPagination = (props) => {
|
|
6
|
+
const { total, pageSize, current, onChange } = props;
|
|
7
|
+
const totalPages = Math.ceil(total / (pageSize || 10));
|
|
8
|
+
const pageOptions = Array.from({ length: totalPages }, (_, i) => ({
|
|
9
|
+
value: i + 1,
|
|
10
|
+
label: `${i + 1}`
|
|
11
|
+
}));
|
|
12
|
+
const defaultPageSizeOptions = [10, 20, 50, 100].map((size) => ({
|
|
13
|
+
value: size,
|
|
14
|
+
label: `${size}`
|
|
15
|
+
}));
|
|
16
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full flex align-center justify-between pl-2.5 pr-2.5", children: [
|
|
17
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2.5", children: [
|
|
18
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
19
|
+
Select,
|
|
20
|
+
{
|
|
21
|
+
onChange: (value) => onChange?.(current, Number(value) || 10),
|
|
22
|
+
value: pageSize,
|
|
23
|
+
options: defaultPageSizeOptions
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm", children: `${(current - 1) * pageSize + 1} - ${current * pageSize > total ? total : current * pageSize} trên tổng ${total}` })
|
|
27
|
+
] }),
|
|
28
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2.5", children: [
|
|
29
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2.5", children: [
|
|
30
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm", children: "xem trang" }),
|
|
31
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
32
|
+
Select,
|
|
33
|
+
{
|
|
34
|
+
onChange: (value) => onChange?.(Number(value), pageSize || 10),
|
|
35
|
+
value: current,
|
|
36
|
+
className: "w-[60px]",
|
|
37
|
+
options: pageOptions
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
] }),
|
|
41
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
42
|
+
Pagination,
|
|
43
|
+
{
|
|
44
|
+
className: "show-total-range",
|
|
45
|
+
total,
|
|
46
|
+
current,
|
|
47
|
+
pageSize: pageSize || 10,
|
|
48
|
+
showSizeChanger: false,
|
|
49
|
+
showQuickJumper: false,
|
|
50
|
+
onChange
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
] })
|
|
54
|
+
] });
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export { BottomPagination };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import { Breadcrumb as Breadcrumb$1 } from 'antd';
|
|
3
|
+
|
|
4
|
+
const Breadcrumb = (props) => {
|
|
5
|
+
const { containerClassName, breadcrumbClassName, ...restProps } = props;
|
|
6
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: containerClassName, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Breadcrumb$1, { className: breadcrumbClassName, ...restProps }) });
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export { Breadcrumb };
|
|
@@ -0,0 +1,54 @@
|
|
|
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 BreadcrumbHeading = (props) => {
|
|
7
|
+
const { menu, customBreadcum } = props;
|
|
8
|
+
const location = useLocation();
|
|
9
|
+
const pathUrl = location.pathname;
|
|
10
|
+
const breadcrumbsItem = [
|
|
11
|
+
{ title: /* @__PURE__ */ jsxRuntimeExports.jsx(Link, { to: "/", children: "Trang chủ" }) }
|
|
12
|
+
];
|
|
13
|
+
function findBreadcrumbs(items, currentPath, trail = []) {
|
|
14
|
+
for (const item of items) {
|
|
15
|
+
if (!item || !item.path) continue;
|
|
16
|
+
if (currentPath === item.path) {
|
|
17
|
+
if (!Object.prototype.hasOwnProperty.call(item, "isShowLabel") || item.isShowLabel) {
|
|
18
|
+
return [...trail, { title: /* @__PURE__ */ jsxRuntimeExports.jsx(Link, { to: item.path, children: item.name }) }];
|
|
19
|
+
}
|
|
20
|
+
return trail;
|
|
21
|
+
}
|
|
22
|
+
if (currentPath.startsWith(item.path)) {
|
|
23
|
+
const newTrail = [...trail];
|
|
24
|
+
if (!Object.prototype.hasOwnProperty.call(item, "isShowLabel") || item.isShowLabel) {
|
|
25
|
+
newTrail.push({
|
|
26
|
+
title: /* @__PURE__ */ jsxRuntimeExports.jsx(Link, { to: item.path, children: item.name })
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
if (item.children && item.children.length > 0) {
|
|
30
|
+
const childTrail = findBreadcrumbs(
|
|
31
|
+
item.children,
|
|
32
|
+
currentPath,
|
|
33
|
+
newTrail
|
|
34
|
+
);
|
|
35
|
+
if (childTrail) return childTrail;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
const dynamicBreadcrumbs = findBreadcrumbs(menu, pathUrl);
|
|
42
|
+
if (dynamicBreadcrumbs) {
|
|
43
|
+
breadcrumbsItem.push(...dynamicBreadcrumbs);
|
|
44
|
+
}
|
|
45
|
+
const dataBreadcum = [
|
|
46
|
+
...breadcrumbsItem,
|
|
47
|
+
...customBreadcum ?? []
|
|
48
|
+
];
|
|
49
|
+
console.log("dataBreadcum", dataBreadcum);
|
|
50
|
+
//! Render
|
|
51
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: className("flex justify-between items-end"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Breadcrumb, { items: dataBreadcum }) });
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export { BreadcrumbHeading };
|
package/es/ui/Button.js
ADDED
package/es/ui/Card.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import { Card as Card$1 } from 'antd';
|
|
3
|
+
|
|
4
|
+
const Card = ({ children, ...rest }) => {
|
|
5
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Card$1, { ...rest, children });
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { Card };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import { Cascader } from 'antd';
|
|
3
|
+
|
|
4
|
+
const CascaderField = (props) => {
|
|
5
|
+
const {
|
|
6
|
+
customStyleContainer,
|
|
7
|
+
customStyleCascader,
|
|
8
|
+
options = [],
|
|
9
|
+
...restProps
|
|
10
|
+
} = props;
|
|
11
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: customStyleContainer, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12
|
+
Cascader,
|
|
13
|
+
{
|
|
14
|
+
options,
|
|
15
|
+
className: customStyleCascader,
|
|
16
|
+
...restProps
|
|
17
|
+
}
|
|
18
|
+
) });
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { CascaderField };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
|
|
3
|
+
|
|
4
|
+
var CATEGORY_LIST_ENUM = /* @__PURE__ */ ((CATEGORY_LIST_ENUM2) => {
|
|
5
|
+
CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["DRAFT"] = 0] = "DRAFT";
|
|
6
|
+
CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["WATING_APPROVAL"] = 1] = "WATING_APPROVAL";
|
|
7
|
+
CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["ACTIVE"] = 2] = "ACTIVE";
|
|
8
|
+
CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["INACTIVE"] = 3] = "INACTIVE";
|
|
9
|
+
CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["REJECT"] = 4] = "REJECT";
|
|
10
|
+
CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["DELETE"] = 5] = "DELETE";
|
|
11
|
+
return CATEGORY_LIST_ENUM2;
|
|
12
|
+
})(CATEGORY_LIST_ENUM || {});
|
|
13
|
+
const badgeStatusCategoryConfig = {
|
|
14
|
+
[0 /* DRAFT */]: { color: "bg-[#007BE5]", text: "Tạo mới" },
|
|
15
|
+
[1 /* WATING_APPROVAL */]: {
|
|
16
|
+
color: "bg-[#DA9438]",
|
|
17
|
+
text: "Chờ duyệt"
|
|
18
|
+
},
|
|
19
|
+
[2 /* ACTIVE */]: { color: "bg-[#27CD7F]", text: "Hoạt động" },
|
|
20
|
+
[3 /* INACTIVE */]: {
|
|
21
|
+
color: "bg-[#DD4338]",
|
|
22
|
+
text: "Ngừng hoạt động"
|
|
23
|
+
},
|
|
24
|
+
[4 /* REJECT */]: {
|
|
25
|
+
color: "bg-[#722ED1]",
|
|
26
|
+
text: "Từ chối duyệt"
|
|
27
|
+
},
|
|
28
|
+
[5 /* DELETE */]: {
|
|
29
|
+
color: "bg-[#B2B7C2]",
|
|
30
|
+
text: "Đã xóa"
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const CategoryStatus = ({ status }) => {
|
|
34
|
+
//! State
|
|
35
|
+
const bagde = badgeStatusCategoryConfig[status];
|
|
36
|
+
//! Function
|
|
37
|
+
const ItemStatus = ({
|
|
38
|
+
color,
|
|
39
|
+
statusName
|
|
40
|
+
}) => {
|
|
41
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
42
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: twMerge("w-3 h-3 rounded-sm", color || "") }),
|
|
43
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm font-normal", children: statusName || "" })
|
|
44
|
+
] }) });
|
|
45
|
+
};
|
|
46
|
+
//! Render
|
|
47
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ItemStatus, { color: bagde?.color, statusName: bagde?.text });
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export { CATEGORY_LIST_ENUM, CategoryStatus, badgeStatusCategoryConfig };
|
package/es/ui/Col.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import { Col as Col$1 } from 'antd';
|
|
3
|
+
|
|
4
|
+
const Col = (props) => {
|
|
5
|
+
const { colClassName, ...restProps } = props;
|
|
6
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Col$1, { className: colClassName, ...restProps });
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export { Col };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import { ColorPicker as ColorPicker$1 } from 'antd';
|
|
3
|
+
|
|
4
|
+
const ColorPicker = (props) => {
|
|
5
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ColorPicker$1, { ...props });
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { ColorPicker };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
|
|
2
|
+
import { ConfigProvider as ConfigProvider$1 } from 'antd';
|
|
3
|
+
|
|
4
|
+
const ConfigProvider = ({
|
|
5
|
+
children,
|
|
6
|
+
...rest
|
|
7
|
+
}) => {
|
|
8
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ConfigProvider$1, { ...rest, children });
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { ConfigProvider };
|