@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,34 @@
1
+ import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
2
+ import { Space, Card, Skeleton as Skeleton$1 } from 'antd';
3
+
4
+ const renderInputs = (count) => Array.from({ length: count }).map((_, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton$1.Input, { size: "small", block: true, active: true }, index));
5
+ const Skeleton = ({ type, skeletonButtonCount }) => {
6
+ if (type === "table") {
7
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
8
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
9
+ "div",
10
+ {
11
+ style: {
12
+ display: "flex",
13
+ alignItems: "center",
14
+ width: "100%",
15
+ marginBottom: 15
16
+ },
17
+ children: skeletonButtonCount && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { marginLeft: "auto" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Space, { children: renderInputs(skeletonButtonCount) }) })
18
+ }
19
+ ),
20
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Card, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Space, { direction: "vertical", size: "middle", style: { width: "100%" }, children: renderInputs(10) }) }),
21
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { ...styles.rightAlign, marginTop: 20 }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton$1.Input, { size: "small", active: true }) })
22
+ ] });
23
+ }
24
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Card, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { display: "grid", rowGap: 8 }, children: renderInputs(3) }) });
25
+ };
26
+ const styles = {
27
+ rightAlign: {
28
+ display: "flex",
29
+ justifyContent: "flex-end",
30
+ width: "100%"
31
+ }
32
+ };
33
+
34
+ export { Skeleton };
package/es/ui/Space.js ADDED
@@ -0,0 +1,11 @@
1
+ import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
2
+ import { Space as Space$1 } from 'antd';
3
+
4
+ const SpaceComponent = (props) => {
5
+ const { containerClassName, spaceClassName, ...restProps } = props;
6
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: containerClassName, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Space$1, { className: spaceClassName, ...restProps }) });
7
+ };
8
+ SpaceComponent.Compact = Space$1.Compact;
9
+ const Space = SpaceComponent;
10
+
11
+ export { Space };
package/es/ui/Spin.js ADDED
@@ -0,0 +1,8 @@
1
+ import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
2
+ import { Spin as Spin$1 } from 'antd';
3
+
4
+ const Spin = ({ children, ...rest }) => {
5
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Spin$1, { ...rest, children });
6
+ };
7
+
8
+ export { Spin };
@@ -0,0 +1,11 @@
1
+ import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
2
+ import { Splitter as Splitter$1 } from 'antd';
3
+
4
+ const SplitterComponent = (props) => {
5
+ const { containerClassName, spaceClassName, ...restProps } = props;
6
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: containerClassName, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Splitter$1, { className: spaceClassName, ...restProps }) });
7
+ };
8
+ SplitterComponent.Panel = Splitter$1.Panel;
9
+ const Splitter = SplitterComponent;
10
+
11
+ export { Splitter };
@@ -0,0 +1,8 @@
1
+ import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
2
+ import { Statistic as Statistic$1 } from 'antd';
3
+
4
+ const Statistic = (props) => {
5
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Statistic$1, { ...props });
6
+ };
7
+
8
+ export { Statistic };
package/es/ui/Steps.js ADDED
@@ -0,0 +1,11 @@
1
+ import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
2
+ import { Steps as Steps$1 } from 'antd';
3
+
4
+ const StepsComponent = (props) => {
5
+ const { containerClassName, stepsClassName, ...restProps } = props;
6
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: containerClassName, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Steps$1, { className: stepsClassName, ...restProps }) });
7
+ };
8
+ StepsComponent.Step = Steps$1.Step;
9
+ const Steps = StepsComponent;
10
+
11
+ export { Steps };
package/es/ui/Tabs.js ADDED
@@ -0,0 +1,78 @@
1
+ import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
2
+ import React__default, { useEffect } from 'react';
3
+ import { Tabs as Tabs$1 } from 'antd';
4
+
5
+ const createStoreImpl = (createState) => {
6
+ let state;
7
+ const listeners = /* @__PURE__ */ new Set();
8
+ const setState = (partial, replace) => {
9
+ const nextState = typeof partial === "function" ? partial(state) : partial;
10
+ if (!Object.is(nextState, state)) {
11
+ const previousState = state;
12
+ state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState);
13
+ listeners.forEach((listener) => listener(state, previousState));
14
+ }
15
+ };
16
+ const getState = () => state;
17
+ const getInitialState = () => initialState;
18
+ const subscribe = (listener) => {
19
+ listeners.add(listener);
20
+ return () => listeners.delete(listener);
21
+ };
22
+ const api = { setState, getState, getInitialState, subscribe };
23
+ const initialState = state = createState(setState, getState, api);
24
+ return api;
25
+ };
26
+ const createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
27
+
28
+ const identity = (arg) => arg;
29
+ function useStore(api, selector = identity) {
30
+ const slice = React__default.useSyncExternalStore(
31
+ api.subscribe,
32
+ () => selector(api.getState()),
33
+ () => selector(api.getInitialState())
34
+ );
35
+ React__default.useDebugValue(slice);
36
+ return slice;
37
+ }
38
+ const createImpl = (createState) => {
39
+ const api = createStore(createState);
40
+ const useBoundStore = (selector) => useStore(api, selector);
41
+ Object.assign(useBoundStore, api);
42
+ return useBoundStore;
43
+ };
44
+ const create = (createState) => createState ? createImpl(createState) : createImpl;
45
+
46
+ const useTabStore = create((set) => ({
47
+ activeTabKey: void 0,
48
+ // giá trị mặc định
49
+ setActiveTabKey: (key) => set({ activeTabKey: key })
50
+ }));
51
+
52
+ const Tabs = ({
53
+ items,
54
+ lazyRender = false,
55
+ defaultActiveKey,
56
+ ...rest
57
+ }) => {
58
+ const { activeTabKey, setActiveTabKey } = useTabStore();
59
+ const defaultKey = defaultActiveKey?.toString() || items[0]?.key;
60
+ useEffect(() => {
61
+ if (!activeTabKey && defaultKey) {
62
+ setActiveTabKey(defaultKey);
63
+ }
64
+ }, [activeTabKey, defaultKey, setActiveTabKey]);
65
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
66
+ Tabs$1,
67
+ {
68
+ items,
69
+ destroyInactiveTabPane: lazyRender,
70
+ activeKey: activeTabKey,
71
+ defaultActiveKey,
72
+ onChange: (key) => setActiveTabKey(key),
73
+ ...rest
74
+ }
75
+ );
76
+ };
77
+
78
+ export { Tabs };
package/es/ui/Tag.js ADDED
@@ -0,0 +1,12 @@
1
+ import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
2
+ import { Tag as Tag$1 } from 'antd';
3
+
4
+ const Tag = (props) => {
5
+ const { children, ...rest } = props;
6
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Tag$1, { ...rest, children: [
7
+ " ",
8
+ children
9
+ ] });
10
+ };
11
+
12
+ export { Tag };
@@ -0,0 +1,8 @@
1
+ import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
2
+ import { Timeline as Timeline$1 } from 'antd';
3
+
4
+ const Timeline = (props) => {
5
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Timeline$1, { ...props });
6
+ };
7
+
8
+ export { Timeline };
@@ -0,0 +1,8 @@
1
+ import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
2
+ import { Tooltip as Tooltip$1 } from 'antd';
3
+
4
+ const Tooltip = ({ children, ...props }) => {
5
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip$1, { ...props, children });
6
+ };
7
+
8
+ export { Tooltip };
package/es/ui/Tour.js ADDED
@@ -0,0 +1,8 @@
1
+ import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
2
+ import { Tour as Tour$1 } from 'antd';
3
+
4
+ const Tour = (props) => {
5
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Tour$1, { ...props });
6
+ };
7
+
8
+ export { Tour };
package/es/ui/Tree.js ADDED
@@ -0,0 +1,8 @@
1
+ import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
2
+ import { Tree as Tree$1 } from 'antd';
3
+
4
+ const Tree = (props) => {
5
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Tree$1, { ...props });
6
+ };
7
+
8
+ export { Tree };
@@ -0,0 +1,11 @@
1
+ import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
2
+ import { Typography as Typography$1 } from 'antd';
3
+
4
+ const { Title, Paragraph, Text } = Typography$1;
5
+ const Typography = {
6
+ Title: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(Title, { ...props }),
7
+ Paragraph: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(Paragraph, { ...props }),
8
+ Text: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { ...props })
9
+ };
10
+
11
+ export { Typography };
@@ -0,0 +1,116 @@
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, Tooltip, message } from 'antd';
5
+ import { Spin } from './Spin.js';
6
+ import { I as Icon, _ as _extends } from '../chunks/AntdIcon-B_SLhOJa.js';
7
+
8
+ // This icon file is generated automatically.
9
+ var CloseOutlined$1 = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z" } }] }, "name": "close", "theme": "outlined" };
10
+
11
+ var CloseOutlined = function CloseOutlined(props, ref) {
12
+ return /*#__PURE__*/React.createElement(Icon, _extends({}, props, {
13
+ ref: ref,
14
+ icon: CloseOutlined$1
15
+ }));
16
+ };
17
+
18
+ /**![close](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIGZpbGwtcnVsZT0iZXZlbm9kZCIgdmlld0JveD0iNjQgNjQgODk2IDg5NiIgZm9jdXNhYmxlPSJmYWxzZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNzk5Ljg2IDE2Ni4zMWMuMDIgMCAuMDQuMDIuMDguMDZsNTcuNjkgNTcuN2MuMDQuMDMuMDUuMDUuMDYuMDhhLjEyLjEyIDAgMDEwIC4wNmMwIC4wMy0uMDIuMDUtLjA2LjA5TDU2OS45MyA1MTJsMjg3LjcgMjg3LjdjLjA0LjA0LjA1LjA2LjA2LjA5YS4xMi4xMiAwIDAxMCAuMDdjMCAuMDItLjAyLjA0LS4wNi4wOGwtNTcuNyA1Ny42OWMtLjAzLjA0LS4wNS4wNS0uMDcuMDZhLjEyLjEyIDAgMDEtLjA3IDBjLS4wMyAwLS4wNS0uMDItLjA5LS4wNkw1MTIgNTY5LjkzbC0yODcuNyAyODcuN2MtLjA0LjA0LS4wNi4wNS0uMDkuMDZhLjEyLjEyIDAgMDEtLjA3IDBjLS4wMiAwLS4wNC0uMDItLjA4LS4wNmwtNTcuNjktNTcuN2MtLjA0LS4wMy0uMDUtLjA1LS4wNi0uMDdhLjEyLjEyIDAgMDEwLS4wN2MwLS4wMy4wMi0uMDUuMDYtLjA5TDQ1NC4wNyA1MTJsLTI4Ny43LTI4Ny43Yy0uMDQtLjA0LS4wNS0uMDYtLjA2LS4wOWEuMTIuMTIgMCAwMTAtLjA3YzAtLjAyLjAyLS4wNC4wNi0uMDhsNTcuNy01Ny42OWMuMDMtLjA0LjA1LS4wNS4wNy0uMDZhLjEyLjEyIDAgMDEuMDcgMGMuMDMgMCAuMDUuMDIuMDkuMDZMNTEyIDQ1NC4wN2wyODcuNy0yODcuN2MuMDQtLjA0LjA2LS4wNS4wOS0uMDZhLjEyLjEyIDAgMDEuMDcgMHoiIC8+PC9zdmc+) */
19
+ var RefIcon = /*#__PURE__*/React.forwardRef(CloseOutlined);
20
+ if (process.env.NODE_ENV !== 'production') {
21
+ RefIcon.displayName = 'CloseOutlined';
22
+ }
23
+
24
+ const logoUpload = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUgAAADwCAYAAABi+v2fAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAvgSURBVHgB7d1db1VV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kskqw+k0UGoS0TyzqNUhaoDKY5Qp5hqq2EDULWBjP+44gj1qmEDUHWjhkYHoR2lL7eoKpDdI1lNx0A7So5kNYE0HQPtikjuXilvuUUV70GKI7QvbtX7qbCVhMUH0uggzEdpG4CKDqTRQZiX0jYAFRtIo4MwTyVtACoykA+eGh2EOStluUVxgYwbR7//OQEzV0Ikiwqk0UHgpKk3ABUTSKODwFmm3AA0eSC76RiPZAVyptoANOkkjdFB4KK6g6h/f5lGM1kgTccAlxWRjJHEsea2JznFFkdgVXGtYqw1aaMfQcbpdKwrE0dgVWNtABr1CNJcNdCXiOTQyy1GO4KMfxHTMUCfuqYMtSZtlCNIo4PAUIbcADR4II0OAkPqNgANMZI4aCCNDgJjGCqSgwXS6CAwpiGWW/QeyO6pg0YHgbH1HcleA9mNDj4+SACT6HMDUG+BjBd16665amB63T3X6+olkEYHgdJEJG+veXvh2oE0HQOUKq6FrLMmba1AiiNQuvv7qy+3WHnUMEYH4w52Tx0ESrfqcouVAhmjg6ZjgJpEJLeOzplvfnbxX3PpU2yjg0Ct7vx8uQ1Alwqk0UGgdrE4Z//5xf7eCwfS6CDQiriR/CIbgM4NZFyEiTgaHQRacdHlFpvn/kM8khVo0EUimQ2k0UGgdectt9jM/iI3gAMz0EXyrHu6N8/8m8URmJGue+9H8lQg43T61j1xBOaneyT1SX8GMm6ePKugAHOx/+L0BqDjUUOjgwBLcdfO9tGh49f/PPp870lauAEc4J3YALS9lRb/B9liYwc2k2vmAAAAAElFTkSuQmCC";
25
+
26
+ const { Dragger } = Upload;
27
+ const UploadImage = ({
28
+ onUploadSuccess
29
+ }) => {
30
+ const [imageUrl, setImageUrl] = useState("");
31
+ const [loading, setLoading] = useState(false);
32
+ const handleUpload = async (options) => {
33
+ const { file } = options;
34
+ const formData = new FormData();
35
+ formData.append("file", file);
36
+ formData.append("upload_preset", "ml_default");
37
+ setLoading(true);
38
+ try {
39
+ const res = await fetch(
40
+ "https://api.cloudinary.com/v1_1/dhtrzmzd3/image/upload",
41
+ {
42
+ method: "POST",
43
+ body: formData
44
+ }
45
+ );
46
+ const response = await res.json();
47
+ const uploadedUrl = response?.secure_url;
48
+ setImageUrl(uploadedUrl);
49
+ if (onUploadSuccess) {
50
+ onUploadSuccess(uploadedUrl);
51
+ message.success("Tải ảnh lên thành công");
52
+ }
53
+ } catch (err) {
54
+ console.error(err);
55
+ message.error("Tải ảnh lên thất bại");
56
+ } finally {
57
+ setLoading(false);
58
+ }
59
+ };
60
+ const handleRemoveImage = () => {
61
+ setImageUrl("");
62
+ if (onUploadSuccess) {
63
+ onUploadSuccess("");
64
+ }
65
+ };
66
+ const props = {
67
+ name: "file",
68
+ multiple: false,
69
+ customRequest: handleUpload,
70
+ showUploadList: false
71
+ };
72
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Dragger, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: loading ? /* @__PURE__ */ jsxRuntimeExports.jsx(Spin, {}) : imageUrl ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
73
+ "div",
74
+ {
75
+ onClick: (e) => e.stopPropagation(),
76
+ className: "w-full rounded-md relative",
77
+ children: [
78
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
79
+ Image,
80
+ {
81
+ src: imageUrl,
82
+ alt: "Uploaded",
83
+ style: { width: "100%", height: "auto" },
84
+ className: "rounded-md"
85
+ }
86
+ ),
87
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title: "Xóa ảnh", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
88
+ "button",
89
+ {
90
+ onClick: (e) => {
91
+ e.stopPropagation();
92
+ handleRemoveImage();
93
+ },
94
+ className: "absolute top-1 right-1 w-6 h-6 flex items-center justify-center bg-white cursor-pointer bg-opacity-80 rounded-full hover:bg-opacity-100 transition",
95
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon, { className: "text-black text-[12px]" })
96
+ }
97
+ ) })
98
+ ]
99
+ }
100
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
101
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ant-upload-drag-icon flex items-center justify-center mb-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
102
+ "img",
103
+ {
104
+ src: logoUpload,
105
+ alt: "Upload",
106
+ width: 64,
107
+ height: 64,
108
+ className: "rounded-md w-full h-full"
109
+ }
110
+ ) }),
111
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "ant-upload-text text-[#116DFF] text-[14px] font-[400]", children: "Tải hình ảnh lên" }),
112
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "ant-upload-hint text-[14px] font-[400]", children: "Ảnh có kích thước 400x400 px và dung lượng dưới 1MB" })
113
+ ] }) }) });
114
+ };
115
+
116
+ export { UploadImage };
@@ -0,0 +1,28 @@
1
+ import { j as jsxRuntimeExports } from '../chunks/jsx-runtime-DFKOoQSG.js';
2
+ import { Flex, Watermark as Watermark$1, Typography } from 'antd';
3
+
4
+ const Watermark = ({ ...rest }) => {
5
+ const { Paragraph } = Typography;
6
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { gap: "middle", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Watermark$1, { ...rest, children: [
7
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Typography, { children: [
8
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Paragraph, { children: "The light-speed iteration of the digital world makes products more complex. However, human consciousness and attention resources are limited. Facing this design contradiction, the pursuit of natural interaction will be the consistent direction of Ant Design." }),
9
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Paragraph, { children: "Natural user cognition: According to cognitive psychology, about 80% of external information is obtained through visual channels. The most important visual elements in the interface design, including layout, colors, illustrations, icons, etc., should fully absorb the laws of nature, thereby reducing the user's cognitive cost and bringing authentic and smooth feelings. In some scenarios, opportunely adding other sensory channels such as hearing, touch can create a richer and more natural product experience." }),
10
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Paragraph, { children: "Natural user behavior: In the interaction with the system, the designer should fully understand the relationship between users, system roles, and task objectives, and also contextually organize system functions and services. At the same time, a series of methods such as behavior analysis, artificial intelligence and sensors could be applied to assist users to make effective decisions and reduce extra operations of users, to save users' mental and physical resources and make human-computer interaction more natural." })
11
+ ] }),
12
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
13
+ "img",
14
+ {
15
+ style: {
16
+ zIndex: 10,
17
+ width: "100%",
18
+ maxWidth: 800,
19
+ position: "relative"
20
+ },
21
+ src: "https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*zx7LTI_ECSAAAAAAAAAAAABkARQnAQ",
22
+ alt: "img"
23
+ }
24
+ )
25
+ ] }) });
26
+ };
27
+
28
+ export { Watermark };