@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.
Files changed (207) hide show
  1. package/dist/style.css +1 -1
  2. package/es/chunks/AntdIcon-B_SLhOJa.js +1211 -0
  3. package/es/chunks/_commonjsHelpers-BFTU3MAI.js +7 -0
  4. package/es/chunks/bundle-mjs-BME7zF0Z.js +2956 -0
  5. package/es/chunks/common-CocKiHtC.js +3 -0
  6. package/es/chunks/defineProperty-D53odpB3.js +50 -0
  7. package/es/chunks/get-C880miVG.js +1726 -0
  8. package/es/chunks/index-mzHK7Za8.js +90 -0
  9. package/es/chunks/index.esm-DPdCEbIy.js +2276 -0
  10. package/es/chunks/jsx-runtime-DFKOoQSG.js +430 -0
  11. package/es/chunks/layout-B04d5Lfr.js +6094 -0
  12. package/es/constants/index.js +38 -0
  13. package/es/fields/CascaderField.js +59 -0
  14. package/es/fields/Checkbox.js +56 -0
  15. package/es/fields/DatePicker.js +13030 -0
  16. package/es/fields/DateRangePicker.js +58 -0
  17. package/es/fields/Input.js +1379 -0
  18. package/es/fields/PnkxField.js +19 -0
  19. package/es/fields/Radio.js +56 -0
  20. package/es/fields/Select.js +61 -0
  21. package/es/fields/SliderRanger.js +58 -0
  22. package/es/fields/SliderSingle.js +58 -0
  23. package/es/fields/Switch.js +58 -0
  24. package/es/fields/Textarea.js +66 -0
  25. package/es/fields/TinyMCE.js +1969 -0
  26. package/es/fields/Upload.js +113 -0
  27. package/es/fields/index.js +13 -2
  28. package/es/hooks/index.js +2 -1
  29. package/es/hooks/useMessage.js +15 -0
  30. package/es/{chunks/useMessage-CUPcOtIS.js → hooks/useToast.js} +2 -14
  31. package/es/index.js +74 -4
  32. package/es/ui/Alert.js +8 -0
  33. package/es/ui/Anchor.js +9 -0
  34. package/es/ui/Appfix.js +8 -0
  35. package/es/ui/AutoComplete.js +8 -0
  36. package/es/ui/Badge.js +15 -0
  37. package/es/ui/BottomPagination.js +57 -0
  38. package/es/ui/Breadcrumb.js +9 -0
  39. package/es/ui/BreadcrumbHeading.js +54 -0
  40. package/es/ui/Button.js +8 -0
  41. package/es/ui/Card.js +8 -0
  42. package/es/ui/Cascader.js +21 -0
  43. package/es/ui/CategoryStatus.js +50 -0
  44. package/es/ui/Col.js +9 -0
  45. package/es/ui/Collapse.js +8 -0
  46. package/es/ui/ColorPicker.js +8 -0
  47. package/es/ui/ConfigProvider.js +11 -0
  48. package/es/ui/ConfirmModal.js +119 -0
  49. package/es/ui/Container.js +12 -0
  50. package/es/ui/Divider.js +8 -0
  51. package/es/ui/Drawer.js +19 -0
  52. package/es/ui/Dropdown.js +9 -0
  53. package/es/ui/Empty.js +8 -0
  54. package/es/ui/ErrorBoundary.js +81 -0
  55. package/es/ui/ErrorMessage.js +14 -0
  56. package/es/ui/Flex.js +9 -0
  57. package/es/ui/Footer.js +13 -0
  58. package/es/ui/Heading.js +67 -0
  59. package/es/ui/Image.js +8 -0
  60. package/es/ui/Label.js +14 -0
  61. package/es/ui/Layout.js +25 -0
  62. package/es/ui/Menu.js +24 -0
  63. package/es/ui/Modal.js +8 -0
  64. package/es/{chunks/PageNotFound-D6b4M484.js → ui/PageNotFound.js} +7 -1865
  65. package/es/ui/Pagination.js +10 -0
  66. package/es/ui/Popconfirm.js +8 -0
  67. package/es/ui/Popover.js +9 -0
  68. package/es/ui/QRCode.js +8 -0
  69. package/es/ui/Rate.js +8 -0
  70. package/es/ui/Result.js +8 -0
  71. package/es/ui/Row.js +9 -0
  72. package/es/ui/SearchFilterForm.js +87 -0
  73. package/es/ui/Segmented.js +8 -0
  74. package/es/ui/Sidebar.js +342 -0
  75. package/es/ui/Skeleton.js +34 -0
  76. package/es/ui/Space.js +11 -0
  77. package/es/ui/Spin.js +8 -0
  78. package/es/ui/Splitter.js +11 -0
  79. package/es/ui/Statistic.js +8 -0
  80. package/es/ui/Steps.js +11 -0
  81. package/es/ui/Tabs.js +78 -0
  82. package/es/ui/Tag.js +12 -0
  83. package/es/ui/Timeline.js +8 -0
  84. package/es/ui/Tooltip.js +8 -0
  85. package/es/ui/Tour.js +8 -0
  86. package/es/ui/Tree.js +8 -0
  87. package/es/ui/Typography.js +11 -0
  88. package/es/ui/UploadImage.js +116 -0
  89. package/es/ui/Watermark.js +28 -0
  90. package/es/ui/index.js +5235 -2
  91. package/package.json +31 -1
  92. package/types/components/ui/BulkActions/BulkAction.d.ts +1 -1
  93. package/types/components/ui/BulkActions/index.d.ts +1 -1
  94. package/types/components/ui/Table/ActionRowTable/index.d.ts +1 -1
  95. package/types/components/ui/Table/HeadingTable/components/GroupHeadingButton.d.ts +1 -1
  96. package/types/components/ui/Table/index.d.ts +1 -1
  97. package/types/fields/CascaderField.d.ts +2 -0
  98. package/types/fields/Checkbox.d.ts +2 -0
  99. package/types/fields/DatePicker.d.ts +2 -0
  100. package/types/fields/DateRangePicker.d.ts +2 -0
  101. package/types/fields/Input.d.ts +2 -0
  102. package/types/fields/PnkxField.d.ts +2 -0
  103. package/types/fields/Radio.d.ts +2 -0
  104. package/types/fields/Select.d.ts +2 -0
  105. package/types/fields/SliderRanger.d.ts +2 -0
  106. package/types/fields/SliderSingle.d.ts +2 -0
  107. package/types/fields/Switch.d.ts +2 -0
  108. package/types/fields/Textarea.d.ts +2 -0
  109. package/types/fields/TinyMCE.d.ts +2 -0
  110. package/types/fields/Upload.d.ts +2 -0
  111. package/types/fields/index.d.ts +2 -0
  112. package/types/hooks/index.d.ts +2 -0
  113. package/types/hooks/useMessage.d.ts +2 -0
  114. package/types/hooks/useToast.d.ts +2 -0
  115. package/types/ui/Alert.d.ts +2 -0
  116. package/types/ui/Anchor.d.ts +2 -0
  117. package/types/ui/Appfix.d.ts +2 -0
  118. package/types/ui/AutoComplete.d.ts +2 -0
  119. package/types/ui/Badge.d.ts +2 -0
  120. package/types/ui/BottomPagination.d.ts +2 -0
  121. package/types/ui/Breadcrumb.d.ts +2 -0
  122. package/types/ui/BreadcrumbHeading.d.ts +2 -0
  123. package/types/ui/Button.d.ts +2 -0
  124. package/types/ui/Card.d.ts +2 -0
  125. package/types/ui/Cascader.d.ts +2 -0
  126. package/types/ui/CategoryStatus.d.ts +2 -0
  127. package/types/ui/Col.d.ts +2 -0
  128. package/types/ui/Collapse.d.ts +2 -0
  129. package/types/ui/ColorPicker.d.ts +2 -0
  130. package/types/ui/ConfigProvider.d.ts +2 -0
  131. package/types/ui/ConfirmModal.d.ts +2 -0
  132. package/types/ui/Container.d.ts +2 -0
  133. package/types/ui/Divider.d.ts +2 -0
  134. package/types/ui/Drawer.d.ts +2 -0
  135. package/types/ui/Dropdown.d.ts +2 -0
  136. package/types/ui/Empty.d.ts +2 -0
  137. package/types/ui/ErrorBoundary.d.ts +2 -0
  138. package/types/ui/ErrorMessage.d.ts +2 -0
  139. package/types/ui/Flex.d.ts +2 -0
  140. package/types/ui/Footer.d.ts +4 -0
  141. package/types/ui/Heading.d.ts +2 -0
  142. package/types/ui/Image.d.ts +2 -0
  143. package/types/ui/Label.d.ts +2 -0
  144. package/types/ui/Layout.d.ts +2 -0
  145. package/types/ui/Menu.d.ts +2 -0
  146. package/types/ui/Modal.d.ts +2 -0
  147. package/types/ui/PageNotFound.d.ts +2 -0
  148. package/types/ui/Pagination.d.ts +2 -0
  149. package/types/ui/Popconfirm.d.ts +2 -0
  150. package/types/ui/Popover.d.ts +2 -0
  151. package/types/ui/QRCode.d.ts +2 -0
  152. package/types/ui/Rate.d.ts +2 -0
  153. package/types/ui/Result.d.ts +2 -0
  154. package/types/ui/Row.d.ts +2 -0
  155. package/types/ui/SearchFilterForm.d.ts +2 -0
  156. package/types/ui/Segmented.d.ts +2 -0
  157. package/types/ui/Sidebar.d.ts +2 -0
  158. package/types/ui/Skeleton.d.ts +2 -0
  159. package/types/ui/Space.d.ts +2 -0
  160. package/types/ui/Spin.d.ts +2 -0
  161. package/types/ui/Splitter.d.ts +2 -0
  162. package/types/ui/Statistic.d.ts +2 -0
  163. package/types/ui/Steps.d.ts +2 -0
  164. package/types/ui/Tabs.d.ts +2 -0
  165. package/types/ui/Tag.d.ts +2 -0
  166. package/types/ui/Timeline.d.ts +2 -0
  167. package/types/ui/Tooltip.d.ts +2 -0
  168. package/types/ui/Tour.d.ts +2 -0
  169. package/types/ui/Tree.d.ts +2 -0
  170. package/types/ui/Typography.d.ts +2 -0
  171. package/types/ui/UploadImage.d.ts +2 -0
  172. package/types/ui/Watermark.d.ts +2 -0
  173. package/types/ui/index.d.ts +2 -0
  174. package/es/chunks/SliderRanger-BXe2Nxdo.js +0 -361
  175. package/es/chunks/UploadImage-x6lE6WbO.js +0 -61133
  176. package/types/App.d.ts +0 -6
  177. package/types/DemoInput/DemoInput.d.ts +0 -1
  178. package/types/DemoTable/FiltersCategoryDemo/components/RenderFilterFields.d.ts +0 -12
  179. package/types/DemoTable/FiltersCategoryDemo/components/TagsFilter.d.ts +0 -12
  180. package/types/DemoTable/FiltersCategoryDemo/index.d.ts +0 -8
  181. package/types/DemoTable/apiUser.d.ts +0 -30
  182. package/types/DemoTable/hooks/useConvertGroupButton.d.ts +0 -13
  183. package/types/DemoTable/index.d.ts +0 -2
  184. package/types/DemoTable/tabDemo.d.ts +0 -2
  185. package/types/assets/svg/404.d.ts +0 -2
  186. package/types/assets/svg/Flag.d.ts +0 -2
  187. package/types/assets/svg/Logout.d.ts +0 -2
  188. package/types/assets/svg/PageNotFoundIcon.d.ts +0 -3
  189. package/types/assets/svg/Search.d.ts +0 -2
  190. package/types/assets/svg/Setting.d.ts +0 -2
  191. package/types/component-test/category-city.d.ts +0 -2
  192. package/types/component-test/category-manager.d.ts +0 -2
  193. package/types/component-test/default-layout.d.ts +0 -6
  194. package/types/component-test/detail-user.d.ts +0 -2
  195. package/types/component-test/permistion-user.d.ts +0 -2
  196. package/types/component-test/user-list.d.ts +0 -2
  197. package/types/fields.d.ts +0 -2
  198. package/types/hooks.d.ts +0 -2
  199. package/types/interface/common.d.ts +0 -14
  200. package/types/interface/tab.d.ts +0 -5
  201. package/types/main.d.ts +0 -0
  202. package/types/stores/tabStore.d.ts +0 -6
  203. package/types/stories/Input.stories.d.ts +0 -6
  204. package/types/ui.d.ts +0 -2
  205. package/types/utils/router.d.ts +0 -35
  206. package/types/utils/timer.d.ts +0 -7
  207. 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
+ /**![plus](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQ4MiAxNTJoNjBxOCAwIDggOHY3MDRxMCA4LTggOGgtNjBxLTggMC04LThWMTYwcTAtOCA4LTh6IiAvPjxwYXRoIGQ9Ik0xOTIgNDc0aDY3MnE4IDAgOCA4djYwcTAgOC04IDhIMTYwcS04IDAtOC04di02MHEwLTggOC04eiIgLz48L3N2Zz4=) */
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 };
@@ -1,2 +1,13 @@
1
- export { C as Checkbox, D as DatePicker, I as Input, P as PnkxField, R as RangePicker, h as Textarea, g as TinyMCE } from '../chunks/UploadImage-x6lE6WbO.js';
2
- export { R as RadioGroup, S as Select, c as SliderRange, b as SliderSingle, a as Switch, U as UploadField } from '../chunks/SliderRanger-BXe2Nxdo.js';
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 { a as useMessage, u as useToast } from '../chunks/useMessage-CUPcOtIS.js';
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, message } from 'antd';
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
- const useMessage = (defaultProps) => {
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 { N as ActionRowTable, A as Alert, u as Anchor, v as Appfix, w as AutoComplete, d as Badge, f as Breadcrumb, a1 as BreadcrumbHeading, a0 as BulkActions, B as Button, J as CATEGORY_LIST_ENUM, a2 as Card, C as CascaderField, L as CategoryStatus, e as Col, x as Collapse, y as ColorPicker, a3 as ConfigProvider, z as ConfirmModal, c as Container, j as Divider, k as Drawer, D as Dropdown, E as Empty, G as ErrorBoundary, F as Flex, H as Heading, I as Image, M as Modal, V as PAGE_NUMBER, X as PAGE_SIZE, a4 as PageNotFound, g as Pagination, l as Popconfirm, P as Popover, Q as QRCode, n as Rate, m as Result, R as Row, Y as SORT, O as START_PAGE, U as START_PAGE_SIZE, b as SearchFiltersForm, o as Segmented, h as Sidebar, S as Skeleton, p as Statistic, T as Table, a as Tabs, i as Tag, q as Timeline, r as Tour, s as Tree, Z as TypeActionRowTable, _ as TypeBulkActions, $ as TypeStatusTable, W as Watermark, K as badgeStatusCategoryConfig, t as typeColorMap } from './chunks/PageNotFound-D6b4M484.js';
2
- export { C as Checkbox, D as DatePicker, E as ErrorMessage, I as Input, L as Label, b as Layout, M as Menu, P as PnkxField, R as RangePicker, S as Space, e as Spin, c as Splitter, d as Steps, f as TINY_API, h as Textarea, g as TinyMCE, a as Tooltip, T as Typography, U as UploadImage } from './chunks/UploadImage-x6lE6WbO.js';
3
- export { R as RadioGroup, S as Select, c as SliderRange, b as SliderSingle, a as Switch, U as UploadField } from './chunks/SliderRanger-BXe2Nxdo.js';
4
- export { a as useMessage, u as useToast } from './chunks/useMessage-CUPcOtIS.js';
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
@@ -0,0 +1,8 @@
1
+ import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
2
+ import { Alert as Alert$1 } from 'antd';
3
+
4
+ const Alert = (props) => {
5
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Alert$1, { ...props });
6
+ };
7
+
8
+ export { Alert };
@@ -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 };
@@ -0,0 +1,8 @@
1
+ import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
2
+ import { Affix } from 'antd';
3
+
4
+ const Appfix = ({ children, ...rest }) => {
5
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Affix, { ...rest, children });
6
+ };
7
+
8
+ export { Appfix };
@@ -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 };
@@ -0,0 +1,8 @@
1
+ import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
2
+ import { Button as Button$1 } from 'antd';
3
+
4
+ const Button = (props) => {
5
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { ...props });
6
+ };
7
+
8
+ export { Button };
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 { Collapse as Collapse$1 } from 'antd';
3
+
4
+ const Collapse = (props) => {
5
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Collapse$1, { ...props });
6
+ };
7
+
8
+ export { Collapse };
@@ -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 };