@pnkx-lib/ui 1.9.369 → 1.9.371
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/logo-header-DlnEN3-o.js +137 -0
- package/es/fields/DatePicker.js +46 -46
- package/es/fields/Input.js +50 -1
- package/es/fields/InputRangePicker.js +163 -0
- package/es/fields/index.js +1 -0
- package/es/index.js +1 -0
- package/es/ui/SelectTable.js +127 -0
- package/es/ui/Sidebar.js +4 -137
- package/es/ui/SidebarV2.js +420 -0
- package/package.json +2 -2
- package/types/components/fields/InputRangePicker.d.ts +17 -0
- package/types/components/fields/index.d.ts +1 -0
- package/types/components/ui/SelectTable.d.ts +21 -0
- package/types/components/ui/SidebarV2.d.ts +19 -0
- package/types/fields/InputRangePicker.d.ts +2 -0
- package/types/ui/SelectTable.d.ts +4 -0
- package/types/ui/SidebarV2.d.ts +4 -0
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useState, useMemo } from 'react';
|
|
4
|
+
import { u as useDebounce, l as logoHeaderText, S as SearchIcon, V as VietNamIcon, D as DownOutlinedIcon } from '../chunks/logo-header-DlnEN3-o.js';
|
|
5
|
+
import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
|
|
6
|
+
import { AutoComplete, Divider, Dropdown, Flex } from 'antd';
|
|
7
|
+
import { useNavigate } from 'react-router';
|
|
8
|
+
import { Layout } from './Layout.js';
|
|
9
|
+
import { Input } from '../fields/Input.js';
|
|
10
|
+
|
|
11
|
+
function BellIcon({
|
|
12
|
+
title,
|
|
13
|
+
titleId,
|
|
14
|
+
...props
|
|
15
|
+
}, svgRef) {
|
|
16
|
+
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
17
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
18
|
+
fill: "none",
|
|
19
|
+
viewBox: "0 0 24 24",
|
|
20
|
+
strokeWidth: 1.5,
|
|
21
|
+
stroke: "currentColor",
|
|
22
|
+
"aria-hidden": "true",
|
|
23
|
+
"data-slot": "icon",
|
|
24
|
+
ref: svgRef,
|
|
25
|
+
"aria-labelledby": titleId
|
|
26
|
+
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
27
|
+
id: titleId
|
|
28
|
+
}, title) : null, /*#__PURE__*/React.createElement("path", {
|
|
29
|
+
strokeLinecap: "round",
|
|
30
|
+
strokeLinejoin: "round",
|
|
31
|
+
d: "M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0"
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
const ForwardRef$6 = /*#__PURE__*/ React.forwardRef(BellIcon);
|
|
35
|
+
|
|
36
|
+
function CalendarIcon({
|
|
37
|
+
title,
|
|
38
|
+
titleId,
|
|
39
|
+
...props
|
|
40
|
+
}, svgRef) {
|
|
41
|
+
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
42
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
43
|
+
fill: "none",
|
|
44
|
+
viewBox: "0 0 24 24",
|
|
45
|
+
strokeWidth: 1.5,
|
|
46
|
+
stroke: "currentColor",
|
|
47
|
+
"aria-hidden": "true",
|
|
48
|
+
"data-slot": "icon",
|
|
49
|
+
ref: svgRef,
|
|
50
|
+
"aria-labelledby": titleId
|
|
51
|
+
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
52
|
+
id: titleId
|
|
53
|
+
}, title) : null, /*#__PURE__*/React.createElement("path", {
|
|
54
|
+
strokeLinecap: "round",
|
|
55
|
+
strokeLinejoin: "round",
|
|
56
|
+
d: "M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5"
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
const ForwardRef$5 = /*#__PURE__*/ React.forwardRef(CalendarIcon);
|
|
60
|
+
|
|
61
|
+
function ChartPieIcon({
|
|
62
|
+
title,
|
|
63
|
+
titleId,
|
|
64
|
+
...props
|
|
65
|
+
}, svgRef) {
|
|
66
|
+
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
67
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
68
|
+
fill: "none",
|
|
69
|
+
viewBox: "0 0 24 24",
|
|
70
|
+
strokeWidth: 1.5,
|
|
71
|
+
stroke: "currentColor",
|
|
72
|
+
"aria-hidden": "true",
|
|
73
|
+
"data-slot": "icon",
|
|
74
|
+
ref: svgRef,
|
|
75
|
+
"aria-labelledby": titleId
|
|
76
|
+
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
77
|
+
id: titleId
|
|
78
|
+
}, title) : null, /*#__PURE__*/React.createElement("path", {
|
|
79
|
+
strokeLinecap: "round",
|
|
80
|
+
strokeLinejoin: "round",
|
|
81
|
+
d: "M10.5 6a7.5 7.5 0 1 0 7.5 7.5h-7.5V6Z"
|
|
82
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
83
|
+
strokeLinecap: "round",
|
|
84
|
+
strokeLinejoin: "round",
|
|
85
|
+
d: "M13.5 10.5H21A7.5 7.5 0 0 0 13.5 3v7.5Z"
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
88
|
+
const ForwardRef$4 = /*#__PURE__*/ React.forwardRef(ChartPieIcon);
|
|
89
|
+
|
|
90
|
+
function DocumentDuplicateIcon({
|
|
91
|
+
title,
|
|
92
|
+
titleId,
|
|
93
|
+
...props
|
|
94
|
+
}, svgRef) {
|
|
95
|
+
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
96
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
97
|
+
fill: "none",
|
|
98
|
+
viewBox: "0 0 24 24",
|
|
99
|
+
strokeWidth: 1.5,
|
|
100
|
+
stroke: "currentColor",
|
|
101
|
+
"aria-hidden": "true",
|
|
102
|
+
"data-slot": "icon",
|
|
103
|
+
ref: svgRef,
|
|
104
|
+
"aria-labelledby": titleId
|
|
105
|
+
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
106
|
+
id: titleId
|
|
107
|
+
}, title) : null, /*#__PURE__*/React.createElement("path", {
|
|
108
|
+
strokeLinecap: "round",
|
|
109
|
+
strokeLinejoin: "round",
|
|
110
|
+
d: "M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75"
|
|
111
|
+
}));
|
|
112
|
+
}
|
|
113
|
+
const ForwardRef$3 = /*#__PURE__*/ React.forwardRef(DocumentDuplicateIcon);
|
|
114
|
+
|
|
115
|
+
function FolderIcon({
|
|
116
|
+
title,
|
|
117
|
+
titleId,
|
|
118
|
+
...props
|
|
119
|
+
}, svgRef) {
|
|
120
|
+
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
121
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
122
|
+
fill: "none",
|
|
123
|
+
viewBox: "0 0 24 24",
|
|
124
|
+
strokeWidth: 1.5,
|
|
125
|
+
stroke: "currentColor",
|
|
126
|
+
"aria-hidden": "true",
|
|
127
|
+
"data-slot": "icon",
|
|
128
|
+
ref: svgRef,
|
|
129
|
+
"aria-labelledby": titleId
|
|
130
|
+
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
131
|
+
id: titleId
|
|
132
|
+
}, title) : null, /*#__PURE__*/React.createElement("path", {
|
|
133
|
+
strokeLinecap: "round",
|
|
134
|
+
strokeLinejoin: "round",
|
|
135
|
+
d: "M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"
|
|
136
|
+
}));
|
|
137
|
+
}
|
|
138
|
+
const ForwardRef$2 = /*#__PURE__*/ React.forwardRef(FolderIcon);
|
|
139
|
+
|
|
140
|
+
function HomeIcon({
|
|
141
|
+
title,
|
|
142
|
+
titleId,
|
|
143
|
+
...props
|
|
144
|
+
}, svgRef) {
|
|
145
|
+
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
146
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
147
|
+
fill: "none",
|
|
148
|
+
viewBox: "0 0 24 24",
|
|
149
|
+
strokeWidth: 1.5,
|
|
150
|
+
stroke: "currentColor",
|
|
151
|
+
"aria-hidden": "true",
|
|
152
|
+
"data-slot": "icon",
|
|
153
|
+
ref: svgRef,
|
|
154
|
+
"aria-labelledby": titleId
|
|
155
|
+
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
156
|
+
id: titleId
|
|
157
|
+
}, title) : null, /*#__PURE__*/React.createElement("path", {
|
|
158
|
+
strokeLinecap: "round",
|
|
159
|
+
strokeLinejoin: "round",
|
|
160
|
+
d: "m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"
|
|
161
|
+
}));
|
|
162
|
+
}
|
|
163
|
+
const ForwardRef$1 = /*#__PURE__*/ React.forwardRef(HomeIcon);
|
|
164
|
+
|
|
165
|
+
function UsersIcon({
|
|
166
|
+
title,
|
|
167
|
+
titleId,
|
|
168
|
+
...props
|
|
169
|
+
}, svgRef) {
|
|
170
|
+
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
171
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
172
|
+
fill: "none",
|
|
173
|
+
viewBox: "0 0 24 24",
|
|
174
|
+
strokeWidth: 1.5,
|
|
175
|
+
stroke: "currentColor",
|
|
176
|
+
"aria-hidden": "true",
|
|
177
|
+
"data-slot": "icon",
|
|
178
|
+
ref: svgRef,
|
|
179
|
+
"aria-labelledby": titleId
|
|
180
|
+
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
181
|
+
id: titleId
|
|
182
|
+
}, title) : null, /*#__PURE__*/React.createElement("path", {
|
|
183
|
+
strokeLinecap: "round",
|
|
184
|
+
strokeLinejoin: "round",
|
|
185
|
+
d: "M15 19.128a9.38 9.38 0 0 0 2.625.372 9.337 9.337 0 0 0 4.121-.952 4.125 4.125 0 0 0-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 0 1 8.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0 1 11.964-3.07M12 6.375a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0Zm8.25 2.25a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z"
|
|
186
|
+
}));
|
|
187
|
+
}
|
|
188
|
+
const ForwardRef = /*#__PURE__*/ React.forwardRef(UsersIcon);
|
|
189
|
+
|
|
190
|
+
const navigation = [
|
|
191
|
+
{ name: "Dashboard", href: "/dashboard", icon: ForwardRef$1, current: true },
|
|
192
|
+
{ name: "Team", href: "/team", icon: ForwardRef, current: false },
|
|
193
|
+
{ name: "Projects", href: "/project", icon: ForwardRef$2, current: false },
|
|
194
|
+
{ name: "Calendar", href: "/calendar", icon: ForwardRef$5, current: false },
|
|
195
|
+
{
|
|
196
|
+
name: "Documents",
|
|
197
|
+
href: "/document",
|
|
198
|
+
icon: ForwardRef$3,
|
|
199
|
+
current: false
|
|
200
|
+
},
|
|
201
|
+
{ name: "Reports", href: "/reports", icon: ForwardRef$4, current: false }
|
|
202
|
+
];
|
|
203
|
+
const userInfo = {
|
|
204
|
+
name: "admin",
|
|
205
|
+
avatar: "https://png.pngtree.com/png-vector/20240730/ourlarge/pngtree-a-beautiful-egg-png-image_13299557.png"
|
|
206
|
+
};
|
|
207
|
+
const items = [
|
|
208
|
+
{ key: "1", label: "Hồ sơ" },
|
|
209
|
+
{ key: "4", label: "Cài đặt" },
|
|
210
|
+
{ key: "2", label: "Đăng xuất" }
|
|
211
|
+
];
|
|
212
|
+
const Title = (props) => /* @__PURE__ */ jsx(Flex, { align: "center", justify: "space-between", children: props.title });
|
|
213
|
+
const renderItem = (title, path) => ({
|
|
214
|
+
value: title,
|
|
215
|
+
label: /* @__PURE__ */ jsx(Flex, { align: "center", justify: "space-between", children: title }),
|
|
216
|
+
path
|
|
217
|
+
});
|
|
218
|
+
function getDataOption(menu, searchValue) {
|
|
219
|
+
return menu.reduce((acc, itemMenu) => {
|
|
220
|
+
const groupName = itemMenu.name;
|
|
221
|
+
(itemMenu.children ?? []).forEach((itemChildren) => {
|
|
222
|
+
(itemChildren.children ?? []).forEach(
|
|
223
|
+
(itemSub) => {
|
|
224
|
+
if (!searchValue || itemSub.name.toLowerCase().includes(searchValue.toLowerCase())) {
|
|
225
|
+
let group = acc.find((g) => g.label.props.title === groupName);
|
|
226
|
+
if (!group) {
|
|
227
|
+
group = {
|
|
228
|
+
label: /* @__PURE__ */ jsx(Title, { title: groupName }),
|
|
229
|
+
options: []
|
|
230
|
+
};
|
|
231
|
+
acc.push(group);
|
|
232
|
+
}
|
|
233
|
+
const path = `${itemChildren.path}/${itemSub.path}`;
|
|
234
|
+
group.options.push(renderItem(itemSub.name, path));
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
);
|
|
238
|
+
});
|
|
239
|
+
return acc;
|
|
240
|
+
}, []);
|
|
241
|
+
}
|
|
242
|
+
function classNames(...classes) {
|
|
243
|
+
return classes.filter(Boolean).join(" ");
|
|
244
|
+
}
|
|
245
|
+
function SidebarV2({ menu, children }) {
|
|
246
|
+
const [hoverOpenMenu, setHoverOpenMenu] = useState(false);
|
|
247
|
+
const [valueSearch, setValueSearch] = useState("");
|
|
248
|
+
const searchSidebar = useDebounce(valueSearch, 300);
|
|
249
|
+
const [showSubmenu, setShowSubmenu] = useState(false);
|
|
250
|
+
const [activeModule, setActiveModule] = useState("");
|
|
251
|
+
const newMenu = useMemo(
|
|
252
|
+
() => menu?.filter((route) => route?.isShow)?.flatMap((route) => route?.children)?.filter(Boolean),
|
|
253
|
+
[menu]
|
|
254
|
+
);
|
|
255
|
+
const dataOption = useMemo(
|
|
256
|
+
() => getDataOption(newMenu, searchSidebar),
|
|
257
|
+
[newMenu, searchSidebar]
|
|
258
|
+
);
|
|
259
|
+
const navigate = useNavigate();
|
|
260
|
+
const handleSelect = (_value, path) => {
|
|
261
|
+
navigate(path.path);
|
|
262
|
+
};
|
|
263
|
+
const getContentMargin = () => {
|
|
264
|
+
if (hoverOpenMenu) return "ml-[225px]";
|
|
265
|
+
if (showSubmenu) return "ml-[279px]";
|
|
266
|
+
return "ml-[62px]";
|
|
267
|
+
};
|
|
268
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
269
|
+
/* @__PURE__ */ jsx(
|
|
270
|
+
Layout.Header,
|
|
271
|
+
{
|
|
272
|
+
style: {
|
|
273
|
+
backgroundColor: "#FFFFFF",
|
|
274
|
+
display: "flex",
|
|
275
|
+
width: "100%",
|
|
276
|
+
borderBottom: "1px solid white",
|
|
277
|
+
boxShadow: "0 1px 1px rgba(0, 0, 0, 0.15)",
|
|
278
|
+
height: "56px",
|
|
279
|
+
position: "fixed",
|
|
280
|
+
zIndex: 2e3
|
|
281
|
+
},
|
|
282
|
+
children: /* @__PURE__ */ jsxs("div", { className: "w-full flex items-center justify-between", children: [
|
|
283
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center ml-[-2rem]", children: /* @__PURE__ */ jsx("img", { src: logoHeaderText, alt: "logo", width: 200 }) }),
|
|
284
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
|
|
285
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-end", children: /* @__PURE__ */ jsx(
|
|
286
|
+
AutoComplete,
|
|
287
|
+
{
|
|
288
|
+
classNames: {
|
|
289
|
+
popup: { root: "certain-category-search-dropdown" }
|
|
290
|
+
},
|
|
291
|
+
popupMatchSelectWidth: 500,
|
|
292
|
+
style: { width: 500 },
|
|
293
|
+
options: dataOption ?? [],
|
|
294
|
+
onSelect: handleSelect,
|
|
295
|
+
onChange: (value) => setValueSearch(value),
|
|
296
|
+
children: /* @__PURE__ */ jsx(
|
|
297
|
+
Input,
|
|
298
|
+
{
|
|
299
|
+
className: "!placeholder:bg-[#E7F0FF] !bg-[#E7F0FF] !border !border-[#BDE3FF]",
|
|
300
|
+
placeholder: "Tìm kiếm theo chức năng,module của hệ thống",
|
|
301
|
+
iconStartInput: /* @__PURE__ */ jsx("div", { className: "w-5 h-5", children: /* @__PURE__ */ jsx(SearchIcon, { className: "w-5 text-[#116DFF]" }) })
|
|
302
|
+
}
|
|
303
|
+
)
|
|
304
|
+
}
|
|
305
|
+
) }),
|
|
306
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsx("li", { className: "list-none cursor-pointer group flex items-center", children: /* @__PURE__ */ jsxs(
|
|
307
|
+
"div",
|
|
308
|
+
{
|
|
309
|
+
className: twMerge(
|
|
310
|
+
hoverOpenMenu ? "" : "justify-center",
|
|
311
|
+
"text-black flex items-center rounded-md gap-2"
|
|
312
|
+
),
|
|
313
|
+
children: [
|
|
314
|
+
/* @__PURE__ */ jsx(Divider, { type: "vertical" }),
|
|
315
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-center gap-4 items-center", children: [
|
|
316
|
+
/* @__PURE__ */ jsx(VietNamIcon, { className: "w-6 h-6" }),
|
|
317
|
+
/* @__PURE__ */ jsx(ForwardRef$6, { className: "w-6 h-6" })
|
|
318
|
+
] })
|
|
319
|
+
]
|
|
320
|
+
}
|
|
321
|
+
) }) }),
|
|
322
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsx("a", { onClick: (e) => e.preventDefault(), children: /* @__PURE__ */ jsx("li", { className: "list-none cursor-pointer group flex items-center", children: /* @__PURE__ */ jsxs(
|
|
323
|
+
"div",
|
|
324
|
+
{
|
|
325
|
+
className: twMerge(
|
|
326
|
+
hoverOpenMenu ? "" : "justify-center",
|
|
327
|
+
"text-black flex items-center rounded-md gap-2"
|
|
328
|
+
),
|
|
329
|
+
children: [
|
|
330
|
+
/* @__PURE__ */ jsx(Divider, { type: "vertical" }),
|
|
331
|
+
/* @__PURE__ */ jsx("div", { className: "flex justify-center w-10 h-10 rounded-full", children: /* @__PURE__ */ jsx("img", { src: userInfo?.avatar, alt: "default_avatar" }) }),
|
|
332
|
+
/* @__PURE__ */ jsx("p", { children: userInfo?.name }),
|
|
333
|
+
/* @__PURE__ */ jsx(Dropdown, { menu: { items }, children: /* @__PURE__ */ jsx(DownOutlinedIcon, { className: "w-6 h-6" }) })
|
|
334
|
+
]
|
|
335
|
+
}
|
|
336
|
+
) }) }) })
|
|
337
|
+
] })
|
|
338
|
+
] })
|
|
339
|
+
}
|
|
340
|
+
),
|
|
341
|
+
/* @__PURE__ */ jsx(
|
|
342
|
+
"div",
|
|
343
|
+
{
|
|
344
|
+
className: twMerge(
|
|
345
|
+
"fixed inset-y-0 flex h-screen flex-col transition-all duration-300 ease-in-out z-[999]",
|
|
346
|
+
hoverOpenMenu ? "w-[225px]" : "w-[62px]"
|
|
347
|
+
),
|
|
348
|
+
onMouseLeave: () => setHoverOpenMenu(false),
|
|
349
|
+
onMouseEnter: () => setHoverOpenMenu(true),
|
|
350
|
+
children: /* @__PURE__ */ jsx("div", { className: "flex grow flex-col mt-14 gap-y-5 bg-[#001523] px-6 pb-4 relative", children: /* @__PURE__ */ jsx("nav", { className: "flex flex-1 flex-col mt-4", children: /* @__PURE__ */ jsx("ul", { role: "list", className: "-mx-3 space-y-1", children: navigation.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
351
|
+
"a",
|
|
352
|
+
{
|
|
353
|
+
onClick: () => {
|
|
354
|
+
setShowSubmenu(true);
|
|
355
|
+
setHoverOpenMenu(false);
|
|
356
|
+
setActiveModule(item.href);
|
|
357
|
+
},
|
|
358
|
+
href: "#",
|
|
359
|
+
className: classNames(
|
|
360
|
+
item.href === activeModule ? "bg-[#007BE5] text-white" : "text-gray-400 hover:text-white hover:bg-[#007BE5]",
|
|
361
|
+
"group flex gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold"
|
|
362
|
+
),
|
|
363
|
+
children: [
|
|
364
|
+
/* @__PURE__ */ jsx(
|
|
365
|
+
item.icon,
|
|
366
|
+
{
|
|
367
|
+
className: "h-6 w-6 shrink-0",
|
|
368
|
+
"aria-hidden": "true"
|
|
369
|
+
}
|
|
370
|
+
),
|
|
371
|
+
/* @__PURE__ */ jsx(
|
|
372
|
+
"span",
|
|
373
|
+
{
|
|
374
|
+
className: twMerge(
|
|
375
|
+
"whitespace-nowrap overflow-hidden transition-opacity duration-200",
|
|
376
|
+
hoverOpenMenu && "opacity-100 "
|
|
377
|
+
),
|
|
378
|
+
children: item.name
|
|
379
|
+
}
|
|
380
|
+
)
|
|
381
|
+
]
|
|
382
|
+
}
|
|
383
|
+
) }, item.name)) }) }) })
|
|
384
|
+
}
|
|
385
|
+
),
|
|
386
|
+
showSubmenu && /* @__PURE__ */ jsxs(
|
|
387
|
+
"div",
|
|
388
|
+
{
|
|
389
|
+
className: twMerge(
|
|
390
|
+
"fixed w-[217px] pt-15 left-[62px] h-full bg-[#FFFFFF] z-[50]",
|
|
391
|
+
hoverOpenMenu && "opacity-0"
|
|
392
|
+
),
|
|
393
|
+
onMouseLeave: () => setShowSubmenu(true),
|
|
394
|
+
children: [
|
|
395
|
+
/* @__PURE__ */ jsx("span", { className: "block px-4 h-[42px] shadow-[0px_4px_6px_0px_#0006241f] py-2 border-[#FFFFFF] text-[16px] font-semibold text-[#1F1F1F]", children: "Quản lý danh mục" }),
|
|
396
|
+
/* @__PURE__ */ jsx("ul", { className: "mt-4", children: /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
397
|
+
"a",
|
|
398
|
+
{
|
|
399
|
+
href: "#",
|
|
400
|
+
className: "block px-4 py-2 text-sm text-[#1F1F1F] hover:bg-[#FFFFFF] hover:text-[#007BE5]",
|
|
401
|
+
children: "Danh mục bệnh viện"
|
|
402
|
+
}
|
|
403
|
+
) }) })
|
|
404
|
+
]
|
|
405
|
+
}
|
|
406
|
+
),
|
|
407
|
+
/* @__PURE__ */ jsx(
|
|
408
|
+
"div",
|
|
409
|
+
{
|
|
410
|
+
className: twMerge(
|
|
411
|
+
"transition-all duration-300 ease-in-out pt-14 min-h-screen",
|
|
412
|
+
getContentMargin()
|
|
413
|
+
),
|
|
414
|
+
children
|
|
415
|
+
}
|
|
416
|
+
)
|
|
417
|
+
] });
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
export { SidebarV2 as default };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnkx-lib/ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.9.
|
|
4
|
+
"version": "1.9.371",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./es/index.js",
|
|
7
7
|
"module": "./es/index.js",
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"@headlessui/react": "^2.2.2",
|
|
137
137
|
"@heroicons/react": "^2.2.0",
|
|
138
138
|
"@hookform/resolvers": "^5.1.1",
|
|
139
|
-
"@pnkx-lib/icon": "^0.0.
|
|
139
|
+
"@pnkx-lib/icon": "^0.0.61",
|
|
140
140
|
"@react-pdf-viewer/core": "^3.12.0",
|
|
141
141
|
"@react-pdf-viewer/default-layout": "^3.12.0",
|
|
142
142
|
"@tailwindcss/cli": "^4.1.6",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { InputNumberProps } from 'antd';
|
|
2
|
+
import { ControllerRenderProps, UseFormStateReturn } from 'react-hook-form';
|
|
3
|
+
export interface InputRangePickerProps extends Omit<InputNumberProps, "value" | "onChange"> {
|
|
4
|
+
field?: ControllerRenderProps<any, any>;
|
|
5
|
+
formState?: UseFormStateReturn<any>;
|
|
6
|
+
label?: string;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
afterOnChange?: (value: [number | null, number | null] | null) => void;
|
|
9
|
+
classNameContainer?: string;
|
|
10
|
+
classNameInput?: string;
|
|
11
|
+
classNameInputWrapper?: string;
|
|
12
|
+
classNameLabel?: string;
|
|
13
|
+
thousandSeparator?: boolean;
|
|
14
|
+
placeholderFrom?: string;
|
|
15
|
+
placeholderTo?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const InputRangePicker: (props: InputRangePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SelectProps } from 'antd/lib/select';
|
|
2
|
+
import { ColumnsType } from 'antd/es/table';
|
|
3
|
+
export interface SelectTableProps<T = Record<string, unknown>> extends Omit<SelectProps, "children" | "dropdownRender" | "mode" | "value"> {
|
|
4
|
+
columns: ColumnsType<T>;
|
|
5
|
+
dataSource?: T[];
|
|
6
|
+
selectedKeys?: React.Key[];
|
|
7
|
+
onSelectionChange?: (selectedKeys: React.Key[], selectedRows: T[]) => void;
|
|
8
|
+
onLoadMore?: () => void | Promise<void>;
|
|
9
|
+
onSearch?: (searchText: string) => void;
|
|
10
|
+
hasMore?: boolean;
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
rowKey?: string | ((record: T) => React.Key);
|
|
13
|
+
tableProps?: {
|
|
14
|
+
size?: "small" | "middle" | "large";
|
|
15
|
+
pagination?: false;
|
|
16
|
+
};
|
|
17
|
+
infiniteScroll?: boolean;
|
|
18
|
+
loadMoreThreshold?: number;
|
|
19
|
+
searchPlaceholder?: string;
|
|
20
|
+
}
|
|
21
|
+
export default function SelectTable<T = Record<string, unknown>>({ columns, dataSource, selectedKeys, onSelectionChange, onLoadMore, onSearch, hasMore, loading, rowKey, tableProps, infiniteScroll, loadMoreThreshold, searchPlaceholder, ...selectProps }: SelectTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
export type MenuTypeV2 = {
|
|
3
|
+
name: string;
|
|
4
|
+
path: string;
|
|
5
|
+
isShow?: boolean;
|
|
6
|
+
isPrivateRoute?: boolean;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
code?: string;
|
|
9
|
+
isShowLabel?: boolean;
|
|
10
|
+
component?: React.LazyExoticComponent<React.MemoExoticComponent<any>> | React.ExoticComponent<any> | ReactNode | React.FC;
|
|
11
|
+
componentProps?: Record<string, any>;
|
|
12
|
+
children?: MenuTypeV2[];
|
|
13
|
+
};
|
|
14
|
+
interface SidebarV2Props {
|
|
15
|
+
menu: MenuTypeV2[];
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export default function SidebarV2({ menu, children }: SidebarV2Props): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|