@unifiedsoftware/react-ui 1.0.6 → 1.0.8-beta
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/index.d.ts +194 -220
- package/dist/index.js +442 -981
- package/package.json +5 -14
- package/dist/index.d.mts +0 -359
- package/dist/index.mjs +0 -1581
package/dist/index.mjs
DELETED
|
@@ -1,1581 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
// src/components/Button/Button.tsx
|
|
34
|
-
import clsx from "clsx";
|
|
35
|
-
import { forwardRef } from "react";
|
|
36
|
-
import { RiLoader4Line } from "react-icons/ri";
|
|
37
|
-
|
|
38
|
-
// src/constants/index.ts
|
|
39
|
-
var PREFIX_CLS = "us-";
|
|
40
|
-
|
|
41
|
-
// src/components/Button/Button.tsx
|
|
42
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
43
|
-
var Button = forwardRef(
|
|
44
|
-
(_a, ref) => {
|
|
45
|
-
var _b = _a, {
|
|
46
|
-
as: Component = "button",
|
|
47
|
-
children,
|
|
48
|
-
className,
|
|
49
|
-
role = "presentation",
|
|
50
|
-
variant = "text",
|
|
51
|
-
color = "primary",
|
|
52
|
-
size = "md",
|
|
53
|
-
prefix,
|
|
54
|
-
suffix,
|
|
55
|
-
loading
|
|
56
|
-
} = _b, rest = __objRest(_b, [
|
|
57
|
-
"as",
|
|
58
|
-
"children",
|
|
59
|
-
"className",
|
|
60
|
-
"role",
|
|
61
|
-
"variant",
|
|
62
|
-
"color",
|
|
63
|
-
"size",
|
|
64
|
-
"prefix",
|
|
65
|
-
"suffix",
|
|
66
|
-
"loading"
|
|
67
|
-
]);
|
|
68
|
-
return /* @__PURE__ */ jsxs(
|
|
69
|
-
Component,
|
|
70
|
-
__spreadProps(__spreadValues({
|
|
71
|
-
ref,
|
|
72
|
-
className: clsx(
|
|
73
|
-
`${PREFIX_CLS}button`,
|
|
74
|
-
{
|
|
75
|
-
[`${PREFIX_CLS}button--${variant}`]: variant,
|
|
76
|
-
[`${PREFIX_CLS}button--${color}`]: color,
|
|
77
|
-
[`${PREFIX_CLS}button--${size}`]: size
|
|
78
|
-
},
|
|
79
|
-
className
|
|
80
|
-
),
|
|
81
|
-
role
|
|
82
|
-
}, rest), {
|
|
83
|
-
children: [
|
|
84
|
-
/* @__PURE__ */ jsx("div", { className: `${PREFIX_CLS}overlay` }),
|
|
85
|
-
loading ? /* @__PURE__ */ jsx(RiLoader4Line, { className: `${PREFIX_CLS}icon ${PREFIX_CLS}animation-spin` }) : prefix,
|
|
86
|
-
/* @__PURE__ */ jsx("div", { className: `${PREFIX_CLS}button__content`, children }),
|
|
87
|
-
suffix
|
|
88
|
-
]
|
|
89
|
-
})
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
);
|
|
93
|
-
|
|
94
|
-
// src/components/Collapse/Collapse.tsx
|
|
95
|
-
import { Children, useEffect, useRef, useState } from "react";
|
|
96
|
-
|
|
97
|
-
// src/components/Collapse/CollapseContext.tsx
|
|
98
|
-
import { createContext, useContext } from "react";
|
|
99
|
-
var CollapseContext = createContext(null);
|
|
100
|
-
var useCollapse = () => {
|
|
101
|
-
const context = useContext(CollapseContext);
|
|
102
|
-
if (!context) {
|
|
103
|
-
throw new Error("`useCollapse` must be used within a `<Collapse />`");
|
|
104
|
-
}
|
|
105
|
-
return context;
|
|
106
|
-
};
|
|
107
|
-
var CollapseContext_default = CollapseContext;
|
|
108
|
-
|
|
109
|
-
// src/components/Collapse/Collapse.tsx
|
|
110
|
-
import { jsxs as jsxs2 } from "react/jsx-runtime";
|
|
111
|
-
var Collapse = ({ children, isOpen, onOpen, onClose, onToggle }) => {
|
|
112
|
-
const collapseRef = useRef(null);
|
|
113
|
-
const [selfIsOpen, setSelfIsOpen] = useState(isOpen != null ? isOpen : false);
|
|
114
|
-
const [heightAuto, setHeightAuto] = useState(false);
|
|
115
|
-
const [trigger, content] = Children.toArray(children);
|
|
116
|
-
const handleOpen = () => {
|
|
117
|
-
setSelfIsOpen(true);
|
|
118
|
-
onOpen == null ? void 0 : onOpen();
|
|
119
|
-
};
|
|
120
|
-
const handleClose = () => {
|
|
121
|
-
setSelfIsOpen(false);
|
|
122
|
-
onClose == null ? void 0 : onClose();
|
|
123
|
-
};
|
|
124
|
-
const handleToggle = () => {
|
|
125
|
-
setSelfIsOpen((prevState) => !prevState);
|
|
126
|
-
onToggle == null ? void 0 : onToggle();
|
|
127
|
-
};
|
|
128
|
-
useEffect(() => {
|
|
129
|
-
if (isOpen !== void 0) {
|
|
130
|
-
setSelfIsOpen(isOpen);
|
|
131
|
-
}
|
|
132
|
-
setTimeout(() => {
|
|
133
|
-
if (isOpen) {
|
|
134
|
-
setHeightAuto(true);
|
|
135
|
-
} else {
|
|
136
|
-
setHeightAuto(false);
|
|
137
|
-
}
|
|
138
|
-
}, 100);
|
|
139
|
-
}, [isOpen]);
|
|
140
|
-
return /* @__PURE__ */ jsxs2(
|
|
141
|
-
CollapseContext_default.Provider,
|
|
142
|
-
{
|
|
143
|
-
value: {
|
|
144
|
-
collapseRef,
|
|
145
|
-
isOpen: selfIsOpen,
|
|
146
|
-
heightAuto,
|
|
147
|
-
onOpen: handleOpen,
|
|
148
|
-
onClose: handleClose,
|
|
149
|
-
onToggle: handleToggle
|
|
150
|
-
},
|
|
151
|
-
children: [
|
|
152
|
-
trigger,
|
|
153
|
-
content
|
|
154
|
-
]
|
|
155
|
-
}
|
|
156
|
-
);
|
|
157
|
-
};
|
|
158
|
-
var Collapse_default = Collapse;
|
|
159
|
-
|
|
160
|
-
// src/components/Collapse/CollapseContent.tsx
|
|
161
|
-
import clsx2 from "clsx";
|
|
162
|
-
import { Children as Children2, cloneElement, forwardRef as forwardRef2 } from "react";
|
|
163
|
-
var CollapseContent = forwardRef2(({ children }, ref) => {
|
|
164
|
-
var _a, _b;
|
|
165
|
-
const { collapseRef, isOpen, heightAuto } = useCollapse();
|
|
166
|
-
const child = Children2.only(children);
|
|
167
|
-
return cloneElement(child, __spreadProps(__spreadValues({}, child.props), {
|
|
168
|
-
ref: (node) => {
|
|
169
|
-
collapseRef.current = node;
|
|
170
|
-
if (ref !== null) {
|
|
171
|
-
ref.current = node;
|
|
172
|
-
}
|
|
173
|
-
},
|
|
174
|
-
style: __spreadProps(__spreadValues({}, child.props.style), {
|
|
175
|
-
height: isOpen && heightAuto ? "auto" : isOpen ? (_a = collapseRef.current) == null ? void 0 : _a.scrollHeight : !isOpen && heightAuto ? (_b = collapseRef.current) == null ? void 0 : _b.scrollHeight : 0
|
|
176
|
-
}),
|
|
177
|
-
className: clsx2(`${PREFIX_CLS}collapse`, child.props.className)
|
|
178
|
-
}));
|
|
179
|
-
});
|
|
180
|
-
var CollapseContent_default = CollapseContent;
|
|
181
|
-
|
|
182
|
-
// src/components/Collapse/CollapseTrigger.tsx
|
|
183
|
-
import { Children as Children3, cloneElement as cloneElement2, forwardRef as forwardRef3 } from "react";
|
|
184
|
-
var CollapseTrigger = forwardRef3(({ children }, ref) => {
|
|
185
|
-
const { collapseRef, onToggle } = useCollapse();
|
|
186
|
-
const child = Children3.only(children);
|
|
187
|
-
return cloneElement2(child, __spreadValues({
|
|
188
|
-
ref,
|
|
189
|
-
onClick: (event) => {
|
|
190
|
-
var _a, _b;
|
|
191
|
-
if (!collapseRef.current) {
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
onToggle();
|
|
195
|
-
(_b = (_a = child.props).onClick) == null ? void 0 : _b.call(_a, event);
|
|
196
|
-
}
|
|
197
|
-
}, child.props));
|
|
198
|
-
});
|
|
199
|
-
var CollapseTrigger_default = CollapseTrigger;
|
|
200
|
-
|
|
201
|
-
// src/components/Menu/Menu.tsx
|
|
202
|
-
import clsx6 from "clsx";
|
|
203
|
-
import { useEffect as useEffect3, useMemo as useMemo3, useState as useState2 } from "react";
|
|
204
|
-
|
|
205
|
-
// src/components/Menu/MenuContext.tsx
|
|
206
|
-
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
207
|
-
var MenuContext = createContext2(null);
|
|
208
|
-
var useMenu = () => {
|
|
209
|
-
const context = useContext2(MenuContext);
|
|
210
|
-
if (!context) {
|
|
211
|
-
throw new Error("`useMenu` must be used within a `<Menu />`");
|
|
212
|
-
}
|
|
213
|
-
return context;
|
|
214
|
-
};
|
|
215
|
-
var MenuContext_default = MenuContext;
|
|
216
|
-
|
|
217
|
-
// src/components/Menu/MenuGroup.tsx
|
|
218
|
-
import clsx5 from "clsx";
|
|
219
|
-
import { useMemo as useMemo2 } from "react";
|
|
220
|
-
|
|
221
|
-
// src/components/Menu/MenuItem.tsx
|
|
222
|
-
import clsx3 from "clsx";
|
|
223
|
-
import { forwardRef as forwardRef4, useContext as useContext4, useEffect as useEffect2 } from "react";
|
|
224
|
-
|
|
225
|
-
// src/components/Menu/MenuValueContext.tsx
|
|
226
|
-
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
227
|
-
var MenuValueContext = createContext3([]);
|
|
228
|
-
var useMenuItemValue = () => {
|
|
229
|
-
const context = useContext3(MenuValueContext);
|
|
230
|
-
if (!context) {
|
|
231
|
-
throw new Error("`useMenuValue` must be used within a `<MenuValueContext.Provider />`");
|
|
232
|
-
}
|
|
233
|
-
return context;
|
|
234
|
-
};
|
|
235
|
-
var MenuValueContext_default = MenuValueContext;
|
|
236
|
-
|
|
237
|
-
// src/components/Menu/MenuItem.tsx
|
|
238
|
-
import { jsx as jsx2, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
239
|
-
var MenuItem = forwardRef4((props, ref) => {
|
|
240
|
-
const _a = props, { as: Component = "div", className, style, value, title, icon, level = 1, disabled, onClick } = _a, rest = __objRest(_a, ["as", "className", "style", "value", "title", "icon", "level", "disabled", "onClick"]);
|
|
241
|
-
const { value: menuValue, originalValue, openMode, onChange, onOpen, onItemSelect } = useMenu();
|
|
242
|
-
const values = useContext4(MenuValueContext_default);
|
|
243
|
-
const mergedValues = [...values, value];
|
|
244
|
-
const handleClick = (event) => {
|
|
245
|
-
if (value !== void 0) {
|
|
246
|
-
onChange(mergedValues);
|
|
247
|
-
}
|
|
248
|
-
onClick == null ? void 0 : onClick(event);
|
|
249
|
-
onItemSelect == null ? void 0 : onItemSelect(props);
|
|
250
|
-
};
|
|
251
|
-
useEffect2(() => {
|
|
252
|
-
if (openMode === "automatic" && originalValue.length > 0 && originalValue[originalValue.length - 1] === value) {
|
|
253
|
-
onOpen(values);
|
|
254
|
-
onChange(mergedValues);
|
|
255
|
-
}
|
|
256
|
-
}, [value, originalValue, openMode]);
|
|
257
|
-
return /* @__PURE__ */ jsxs3(
|
|
258
|
-
Component,
|
|
259
|
-
__spreadProps(__spreadValues({
|
|
260
|
-
ref,
|
|
261
|
-
className: clsx3(
|
|
262
|
-
`${PREFIX_CLS}menu-item`,
|
|
263
|
-
{
|
|
264
|
-
[`${PREFIX_CLS}menu-item--selected`]: menuValue.includes(value),
|
|
265
|
-
[`${PREFIX_CLS}menu-item--disabled`]: disabled
|
|
266
|
-
},
|
|
267
|
-
className
|
|
268
|
-
),
|
|
269
|
-
style: __spreadValues({
|
|
270
|
-
paddingLeft: level <= 1 ? `var(--${PREFIX_CLS}menu-item-padding-x)` : `calc(${level} * var(--${PREFIX_CLS}menu-item-padding-level))`
|
|
271
|
-
}, style),
|
|
272
|
-
onClick: handleClick
|
|
273
|
-
}, rest), {
|
|
274
|
-
children: [
|
|
275
|
-
/* @__PURE__ */ jsx2("div", { className: `${PREFIX_CLS}overlay`, children: /* @__PURE__ */ jsx2("div", { className: `${PREFIX_CLS}overlay__surface` }) }),
|
|
276
|
-
icon && /* @__PURE__ */ jsx2("div", { className: `${PREFIX_CLS}menu-item__icon`, children: icon }),
|
|
277
|
-
/* @__PURE__ */ jsx2("div", { className: `${PREFIX_CLS}menu-item__content`, children: /* @__PURE__ */ jsx2("span", { className: `${PREFIX_CLS}menu-item__title`, children: title }) })
|
|
278
|
-
]
|
|
279
|
-
})
|
|
280
|
-
);
|
|
281
|
-
});
|
|
282
|
-
MenuItem.displayName = "MenuItem";
|
|
283
|
-
var MenuItem_default = MenuItem;
|
|
284
|
-
|
|
285
|
-
// src/components/Menu/MenuSubmenu.tsx
|
|
286
|
-
import clsx4 from "clsx";
|
|
287
|
-
import { useContext as useContext5, useMemo } from "react";
|
|
288
|
-
import { MdKeyboardArrowDown, MdKeyboardArrowUp } from "react-icons/md";
|
|
289
|
-
|
|
290
|
-
// src/components/Menu/utils.ts
|
|
291
|
-
var getOpenValuesByPathname = (pathname) => {
|
|
292
|
-
return pathname.split("/").reduce((previousValue, currentValue) => {
|
|
293
|
-
const previousPath = previousValue[previousValue.length - 1];
|
|
294
|
-
if (previousPath != void 0) {
|
|
295
|
-
previousValue.push(previousPath + "/" + currentValue);
|
|
296
|
-
} else {
|
|
297
|
-
previousValue.push("");
|
|
298
|
-
}
|
|
299
|
-
return previousValue;
|
|
300
|
-
}, []);
|
|
301
|
-
};
|
|
302
|
-
var addOrRemoveValueInArray = (array, value) => {
|
|
303
|
-
const index = array.indexOf(value);
|
|
304
|
-
const newArray = [...array];
|
|
305
|
-
if (index === -1) {
|
|
306
|
-
newArray.push(value);
|
|
307
|
-
} else {
|
|
308
|
-
newArray.splice(index, 1);
|
|
309
|
-
}
|
|
310
|
-
return newArray;
|
|
311
|
-
};
|
|
312
|
-
|
|
313
|
-
// src/components/Menu/MenuSubmenu.tsx
|
|
314
|
-
import { jsx as jsx3, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
315
|
-
var MenuSubmenu = (_a) => {
|
|
316
|
-
var _b = _a, {
|
|
317
|
-
children,
|
|
318
|
-
className,
|
|
319
|
-
style,
|
|
320
|
-
value,
|
|
321
|
-
title,
|
|
322
|
-
icon,
|
|
323
|
-
level = 1,
|
|
324
|
-
items,
|
|
325
|
-
onClick
|
|
326
|
-
} = _b, rest = __objRest(_b, [
|
|
327
|
-
"children",
|
|
328
|
-
"className",
|
|
329
|
-
"style",
|
|
330
|
-
"value",
|
|
331
|
-
"title",
|
|
332
|
-
"icon",
|
|
333
|
-
"level",
|
|
334
|
-
"items",
|
|
335
|
-
"onClick"
|
|
336
|
-
]);
|
|
337
|
-
const { value: menuValue, openValues, expandMode, onOpen } = useMenu();
|
|
338
|
-
const values = useContext5(MenuValueContext_default);
|
|
339
|
-
const isOpen = openValues.includes(value);
|
|
340
|
-
const mergedValues = [...values, value];
|
|
341
|
-
const content = useMemo(() => {
|
|
342
|
-
return items == null ? void 0 : items.map((_a2, index) => {
|
|
343
|
-
var _b2 = _a2, { type } = _b2, item = __objRest(_b2, ["type"]);
|
|
344
|
-
return type === "item" ? /* @__PURE__ */ jsx3(MenuItem_default, __spreadValues({ level: level !== void 0 ? level + 1 : void 0 }, item), index) : type === "submenu" ? /* @__PURE__ */ jsx3(MenuSubmenu, __spreadValues({ level: level !== void 0 ? level + 1 : void 0 }, item), index) : type === "group" ? /* @__PURE__ */ jsx3(MenuGroup_default, __spreadValues({ level: level !== void 0 ? level + 1 : void 0 }, item), index) : /* @__PURE__ */ jsx3(MenuItem_default, __spreadValues({ level: level !== void 0 ? level + 1 : void 0 }, item), index);
|
|
345
|
-
});
|
|
346
|
-
}, [items]);
|
|
347
|
-
const handleClick = (event) => {
|
|
348
|
-
if (expandMode === "multiple") {
|
|
349
|
-
const updatedOpenValues = addOrRemoveValueInArray(openValues, value);
|
|
350
|
-
onOpen(updatedOpenValues);
|
|
351
|
-
} else {
|
|
352
|
-
if (isOpen) {
|
|
353
|
-
const updatedOpenValues = addOrRemoveValueInArray(mergedValues, value);
|
|
354
|
-
onOpen(updatedOpenValues);
|
|
355
|
-
} else {
|
|
356
|
-
const updatedOpenValues = addOrRemoveValueInArray(values, value);
|
|
357
|
-
onOpen(updatedOpenValues);
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
onClick == null ? void 0 : onClick(event);
|
|
361
|
-
};
|
|
362
|
-
return /* @__PURE__ */ jsx3(MenuValueContext_default.Provider, { value: mergedValues, children: /* @__PURE__ */ jsx3("div", { className: clsx4(`${PREFIX_CLS}menu-submenu`), children: /* @__PURE__ */ jsxs4(Collapse_default, { isOpen, children: [
|
|
363
|
-
/* @__PURE__ */ jsx3(CollapseTrigger_default, { children: /* @__PURE__ */ jsxs4(
|
|
364
|
-
"div",
|
|
365
|
-
__spreadProps(__spreadValues({
|
|
366
|
-
className: clsx4(
|
|
367
|
-
`${PREFIX_CLS}menu-item`,
|
|
368
|
-
{
|
|
369
|
-
[`${PREFIX_CLS}menu-item--selected`]: menuValue.includes(value) || items && mergedValues.includes(menuValue)
|
|
370
|
-
},
|
|
371
|
-
className
|
|
372
|
-
),
|
|
373
|
-
style: __spreadValues({
|
|
374
|
-
paddingLeft: level <= 1 ? `var(--${PREFIX_CLS}menu-item-padding-x)` : `calc(${level} * var(--${PREFIX_CLS}menu-item-padding-level))`
|
|
375
|
-
}, style),
|
|
376
|
-
onClick: handleClick
|
|
377
|
-
}, rest), {
|
|
378
|
-
children: [
|
|
379
|
-
/* @__PURE__ */ jsx3("div", { className: `${PREFIX_CLS}overlay`, children: /* @__PURE__ */ jsx3("div", { className: `${PREFIX_CLS}overlay__surface` }) }),
|
|
380
|
-
icon && /* @__PURE__ */ jsx3("div", { className: `${PREFIX_CLS}menu-item__icon`, children: icon }),
|
|
381
|
-
/* @__PURE__ */ jsx3("div", { className: `${PREFIX_CLS}menu-item__content`, children: /* @__PURE__ */ jsx3("span", { className: `${PREFIX_CLS}menu-item__title`, children: title }) }),
|
|
382
|
-
/* @__PURE__ */ jsx3("div", { className: `${PREFIX_CLS}menu-item__icon`, children: isOpen ? /* @__PURE__ */ jsx3(MdKeyboardArrowUp, { className: `${PREFIX_CLS}icon` }) : /* @__PURE__ */ jsx3(MdKeyboardArrowDown, { className: `${PREFIX_CLS}icon` }) })
|
|
383
|
-
]
|
|
384
|
-
})
|
|
385
|
-
) }),
|
|
386
|
-
/* @__PURE__ */ jsx3(CollapseContent_default, { children: /* @__PURE__ */ jsx3(
|
|
387
|
-
"ul",
|
|
388
|
-
{
|
|
389
|
-
className: clsx4(`${PREFIX_CLS}menu`, {
|
|
390
|
-
[`${PREFIX_CLS}menu-open`]: !open
|
|
391
|
-
}),
|
|
392
|
-
children: content || children
|
|
393
|
-
}
|
|
394
|
-
) })
|
|
395
|
-
] }) }) });
|
|
396
|
-
};
|
|
397
|
-
var MenuSubmenu_default = MenuSubmenu;
|
|
398
|
-
|
|
399
|
-
// src/components/Menu/MenuGroup.tsx
|
|
400
|
-
import { Fragment, jsx as jsx4, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
401
|
-
var MenuGroup = (_a) => {
|
|
402
|
-
var _b = _a, {
|
|
403
|
-
children,
|
|
404
|
-
className,
|
|
405
|
-
style,
|
|
406
|
-
title,
|
|
407
|
-
icon,
|
|
408
|
-
level = 1,
|
|
409
|
-
items
|
|
410
|
-
} = _b, rest = __objRest(_b, [
|
|
411
|
-
"children",
|
|
412
|
-
"className",
|
|
413
|
-
"style",
|
|
414
|
-
"title",
|
|
415
|
-
"icon",
|
|
416
|
-
"level",
|
|
417
|
-
"items"
|
|
418
|
-
]);
|
|
419
|
-
const content = useMemo2(() => {
|
|
420
|
-
return items == null ? void 0 : items.map((_a2, index) => {
|
|
421
|
-
var _b2 = _a2, { type } = _b2, item = __objRest(_b2, ["type"]);
|
|
422
|
-
return type === "item" ? /* @__PURE__ */ jsx4(MenuItem_default, __spreadValues({}, item), index) : type === "submenu" ? /* @__PURE__ */ jsx4(MenuSubmenu_default, __spreadValues({}, item), index) : /* @__PURE__ */ jsx4(MenuItem_default, __spreadValues({}, item), index);
|
|
423
|
-
});
|
|
424
|
-
}, [items]);
|
|
425
|
-
return /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
426
|
-
/* @__PURE__ */ jsxs5(
|
|
427
|
-
"div",
|
|
428
|
-
__spreadProps(__spreadValues({
|
|
429
|
-
className: clsx5(`${PREFIX_CLS}menu-group`, className),
|
|
430
|
-
style: __spreadValues({
|
|
431
|
-
paddingLeft: level <= 1 ? `var(--${PREFIX_CLS}menu-group-padding-x)` : `calc(${level} * var(--${PREFIX_CLS}menu-group-padding-level))`
|
|
432
|
-
}, style)
|
|
433
|
-
}, rest), {
|
|
434
|
-
children: [
|
|
435
|
-
icon && /* @__PURE__ */ jsx4("div", { className: `${PREFIX_CLS}menu-group__icon`, children: icon }),
|
|
436
|
-
/* @__PURE__ */ jsx4("div", { className: `${PREFIX_CLS}menu-group__content`, children: /* @__PURE__ */ jsx4("span", { className: `${PREFIX_CLS}menu-group__title`, children: title }) })
|
|
437
|
-
]
|
|
438
|
-
})
|
|
439
|
-
),
|
|
440
|
-
content || children
|
|
441
|
-
] });
|
|
442
|
-
};
|
|
443
|
-
var MenuGroup_default = MenuGroup;
|
|
444
|
-
|
|
445
|
-
// src/components/Menu/Menu.tsx
|
|
446
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
447
|
-
var Menu = (_a) => {
|
|
448
|
-
var _b = _a, {
|
|
449
|
-
children,
|
|
450
|
-
value: valueProp = [],
|
|
451
|
-
defaultValue,
|
|
452
|
-
openValues: openValuesProp,
|
|
453
|
-
expandMode = "multiple",
|
|
454
|
-
openMode = "manual",
|
|
455
|
-
items,
|
|
456
|
-
onChange,
|
|
457
|
-
onOpen,
|
|
458
|
-
onItemSelect
|
|
459
|
-
} = _b, rest = __objRest(_b, [
|
|
460
|
-
"children",
|
|
461
|
-
"value",
|
|
462
|
-
"defaultValue",
|
|
463
|
-
"openValues",
|
|
464
|
-
"expandMode",
|
|
465
|
-
"openMode",
|
|
466
|
-
"items",
|
|
467
|
-
"onChange",
|
|
468
|
-
"onOpen",
|
|
469
|
-
"onItemSelect"
|
|
470
|
-
]);
|
|
471
|
-
var _a2;
|
|
472
|
-
const [selfValue, setSelfValue] = useState2((_a2 = valueProp != null ? valueProp : defaultValue) != null ? _a2 : []);
|
|
473
|
-
const [selfOpenValues, setSelfOpenValues] = useState2(openValuesProp != null ? openValuesProp : []);
|
|
474
|
-
const content = useMemo3(() => {
|
|
475
|
-
return items == null ? void 0 : items.map((_a3, index) => {
|
|
476
|
-
var _b2 = _a3, { type } = _b2, item = __objRest(_b2, ["type"]);
|
|
477
|
-
return type === "item" ? /* @__PURE__ */ jsx5(MenuItem_default, __spreadValues({}, item), index) : type === "submenu" ? /* @__PURE__ */ jsx5(MenuSubmenu_default, __spreadValues({}, item), index) : type === "group" ? /* @__PURE__ */ jsx5(MenuGroup_default, __spreadValues({}, item), index) : /* @__PURE__ */ jsx5(MenuItem_default, __spreadValues({}, item), index);
|
|
478
|
-
});
|
|
479
|
-
}, [items]);
|
|
480
|
-
const handleChange = (value) => {
|
|
481
|
-
if (valueProp !== void 0 && openMode !== "automatic") {
|
|
482
|
-
onChange == null ? void 0 : onChange(value);
|
|
483
|
-
} else {
|
|
484
|
-
setSelfValue(value);
|
|
485
|
-
}
|
|
486
|
-
};
|
|
487
|
-
const handleOpen = (values) => {
|
|
488
|
-
if (openValuesProp !== void 0) {
|
|
489
|
-
onOpen == null ? void 0 : onOpen(values);
|
|
490
|
-
} else {
|
|
491
|
-
setSelfOpenValues(values);
|
|
492
|
-
}
|
|
493
|
-
};
|
|
494
|
-
const handleItemSelect = (props) => {
|
|
495
|
-
onItemSelect == null ? void 0 : onItemSelect(props);
|
|
496
|
-
};
|
|
497
|
-
useEffect3(() => {
|
|
498
|
-
if (valueProp !== void 0 && openMode !== "automatic") {
|
|
499
|
-
setSelfValue(valueProp);
|
|
500
|
-
}
|
|
501
|
-
}, [valueProp]);
|
|
502
|
-
useEffect3(() => {
|
|
503
|
-
if (openValuesProp !== void 0) {
|
|
504
|
-
setSelfOpenValues(openValuesProp);
|
|
505
|
-
}
|
|
506
|
-
}, [openValuesProp]);
|
|
507
|
-
return /* @__PURE__ */ jsx5(
|
|
508
|
-
MenuContext_default.Provider,
|
|
509
|
-
{
|
|
510
|
-
value: {
|
|
511
|
-
value: selfValue,
|
|
512
|
-
originalValue: valueProp,
|
|
513
|
-
openValues: selfOpenValues,
|
|
514
|
-
expandMode,
|
|
515
|
-
openMode,
|
|
516
|
-
onOpen: handleOpen,
|
|
517
|
-
onChange: handleChange,
|
|
518
|
-
onItemSelect: handleItemSelect
|
|
519
|
-
},
|
|
520
|
-
children: /* @__PURE__ */ jsx5("div", __spreadProps(__spreadValues({ className: clsx6(`${PREFIX_CLS}menu`) }, rest), { children: content || children }))
|
|
521
|
-
}
|
|
522
|
-
);
|
|
523
|
-
};
|
|
524
|
-
Menu.displayName = "Menu";
|
|
525
|
-
var Menu_default = Menu;
|
|
526
|
-
|
|
527
|
-
// src/components/Tabs/Tab.tsx
|
|
528
|
-
import clsx7 from "clsx";
|
|
529
|
-
import mergeRefs from "merge-refs";
|
|
530
|
-
import { forwardRef as forwardRef5, useEffect as useEffect4, useRef as useRef2 } from "react";
|
|
531
|
-
|
|
532
|
-
// src/components/Tabs/TabsContext.ts
|
|
533
|
-
import { createContext as createContext4, useContext as useContext6 } from "react";
|
|
534
|
-
var TabsContext = createContext4(null);
|
|
535
|
-
var useTabs = () => {
|
|
536
|
-
const context = useContext6(TabsContext);
|
|
537
|
-
if (!context) {
|
|
538
|
-
throw new Error("`useTabs` must be used within a `<Tabs />`");
|
|
539
|
-
}
|
|
540
|
-
return context;
|
|
541
|
-
};
|
|
542
|
-
|
|
543
|
-
// src/components/Tabs/Tab.tsx
|
|
544
|
-
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
545
|
-
var Tab = forwardRef5(
|
|
546
|
-
(_a, ref) => {
|
|
547
|
-
var _b = _a, { as: Component = "div", children, className, role = "presentation", value, onClick } = _b, rest = __objRest(_b, ["as", "children", "className", "role", "value", "onClick"]);
|
|
548
|
-
const tabRef = useRef2(null);
|
|
549
|
-
const tabs = useTabs();
|
|
550
|
-
const handleClick = (event) => {
|
|
551
|
-
const previousTab = tabs.previousTabRef.current;
|
|
552
|
-
const currentTab = tabRef.current;
|
|
553
|
-
if (!currentTab)
|
|
554
|
-
return;
|
|
555
|
-
if (previousTab) {
|
|
556
|
-
const previousIndicator = previousTab.querySelector(`.${PREFIX_CLS}tab__indicator`);
|
|
557
|
-
const currentIndicator = currentTab.querySelector(`.${PREFIX_CLS}tab__indicator`);
|
|
558
|
-
if (!previousIndicator || !currentIndicator)
|
|
559
|
-
return;
|
|
560
|
-
const from = {};
|
|
561
|
-
const fromRect = previousIndicator.getBoundingClientRect();
|
|
562
|
-
const fromPos = fromRect.left;
|
|
563
|
-
const fromWidth = fromRect.width;
|
|
564
|
-
const toRect = currentIndicator.getBoundingClientRect();
|
|
565
|
-
const toPos = toRect.left;
|
|
566
|
-
const toWidth = toRect.width;
|
|
567
|
-
const scale = fromWidth / toWidth;
|
|
568
|
-
if (scale) {
|
|
569
|
-
from["transform"] = `translateX(${(fromPos - toPos).toFixed(4)}px) scaleX(${scale.toFixed(4)})`;
|
|
570
|
-
} else {
|
|
571
|
-
from["opacity"] = 0;
|
|
572
|
-
}
|
|
573
|
-
const keyframes = [from, { transform: "none" }];
|
|
574
|
-
currentIndicator.animate(keyframes, {
|
|
575
|
-
duration: 250,
|
|
576
|
-
easing: "cubic-bezier(.3,0,0,1)"
|
|
577
|
-
});
|
|
578
|
-
tabs.previousTabRef.current = tabRef.current;
|
|
579
|
-
}
|
|
580
|
-
tabs.previousTabRef.current = tabRef.current;
|
|
581
|
-
tabs.onChange(value);
|
|
582
|
-
onClick == null ? void 0 : onClick(event);
|
|
583
|
-
};
|
|
584
|
-
useEffect4(() => {
|
|
585
|
-
if (value === tabs.value) {
|
|
586
|
-
tabs.previousTabRef.current = tabRef.current;
|
|
587
|
-
}
|
|
588
|
-
}, []);
|
|
589
|
-
return /* @__PURE__ */ jsxs6(
|
|
590
|
-
Component,
|
|
591
|
-
__spreadProps(__spreadValues({
|
|
592
|
-
ref: mergeRefs(tabRef, ref),
|
|
593
|
-
className: clsx7(`${PREFIX_CLS}tab`, { [`${PREFIX_CLS}tab--selected`]: value === tabs.value }, className),
|
|
594
|
-
role,
|
|
595
|
-
onClick: handleClick
|
|
596
|
-
}, rest), {
|
|
597
|
-
children: [
|
|
598
|
-
/* @__PURE__ */ jsx6("div", { className: `${PREFIX_CLS}overlay` }),
|
|
599
|
-
/* @__PURE__ */ jsx6("div", { className: `${PREFIX_CLS}tab__content`, children }),
|
|
600
|
-
/* @__PURE__ */ jsx6("div", { className: `${PREFIX_CLS}tab__indicator` })
|
|
601
|
-
]
|
|
602
|
-
})
|
|
603
|
-
);
|
|
604
|
-
}
|
|
605
|
-
);
|
|
606
|
-
|
|
607
|
-
// src/components/Tabs/Tabs.tsx
|
|
608
|
-
import clsx8 from "clsx";
|
|
609
|
-
import { useEffect as useEffect5, useRef as useRef3, useState as useState3 } from "react";
|
|
610
|
-
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
611
|
-
var prefixCls = "us-";
|
|
612
|
-
var Tabs = (_a) => {
|
|
613
|
-
var _b = _a, { children, className, value, defaultValue, onChange } = _b, rest = __objRest(_b, ["children", "className", "value", "defaultValue", "onChange"]);
|
|
614
|
-
const previousTabRef = useRef3(null);
|
|
615
|
-
const [selfValue, setSelfValue] = useState3(value != null ? value : defaultValue);
|
|
616
|
-
const handleChange = (value2) => {
|
|
617
|
-
setSelfValue(value2);
|
|
618
|
-
onChange == null ? void 0 : onChange(value2);
|
|
619
|
-
};
|
|
620
|
-
useEffect5(() => {
|
|
621
|
-
if (value !== void 0) {
|
|
622
|
-
setSelfValue(value);
|
|
623
|
-
}
|
|
624
|
-
}, [value]);
|
|
625
|
-
return /* @__PURE__ */ jsxs7(TabsContext.Provider, { value: { previousTabRef, value: selfValue, onChange: handleChange }, children: [
|
|
626
|
-
/* @__PURE__ */ jsx7("div", __spreadProps(__spreadValues({ className: clsx8(`${prefixCls}tabs`, className) }, rest), { children })),
|
|
627
|
-
/* @__PURE__ */ jsx7("div", { className: `${prefixCls}divider` })
|
|
628
|
-
] });
|
|
629
|
-
};
|
|
630
|
-
|
|
631
|
-
// src/components/DropdownEnumList.tsx
|
|
632
|
-
import { DropDownList } from "@progress/kendo-react-dropdowns";
|
|
633
|
-
import { useEffect as useEffect6, useState as useState4 } from "react";
|
|
634
|
-
import { Fragment as Fragment2, jsx as jsx8 } from "react/jsx-runtime";
|
|
635
|
-
function parsearDataForComboBox(array, key, text, itemAll = false) {
|
|
636
|
-
const dataForComboBox = [];
|
|
637
|
-
if (itemAll)
|
|
638
|
-
dataForComboBox.push({ key: "", text: "ALL" });
|
|
639
|
-
if (array !== void 0) {
|
|
640
|
-
array.map((a) => {
|
|
641
|
-
dataForComboBox.push({ key: a[key], text: a[text] });
|
|
642
|
-
});
|
|
643
|
-
}
|
|
644
|
-
return dataForComboBox;
|
|
645
|
-
}
|
|
646
|
-
function GetEnumDescription(key, typeEnum, description) {
|
|
647
|
-
const listLabel = description.get(typeEnum);
|
|
648
|
-
let label = void 0;
|
|
649
|
-
if (listLabel != void 0)
|
|
650
|
-
label = listLabel.get(parseInt(key));
|
|
651
|
-
if (label == void 0) {
|
|
652
|
-
label = typeEnum[key];
|
|
653
|
-
return label.split("_").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
|
|
654
|
-
}
|
|
655
|
-
return label;
|
|
656
|
-
}
|
|
657
|
-
function EnumToArray(typeEnum, replaceGuionForSpace = true, description) {
|
|
658
|
-
const values = [];
|
|
659
|
-
for (const key in typeEnum) {
|
|
660
|
-
if (typeof typeEnum[key] === "string")
|
|
661
|
-
values.push({
|
|
662
|
-
value: Number(key),
|
|
663
|
-
label: replaceGuionForSpace ? GetEnumDescription(key, typeEnum, description) : typeEnum[key]
|
|
664
|
-
});
|
|
665
|
-
}
|
|
666
|
-
return values;
|
|
667
|
-
}
|
|
668
|
-
var DropEnumList = ({ dataEnum, description, onChange, width, defaultValue }) => {
|
|
669
|
-
const [value, setValue] = useState4("");
|
|
670
|
-
const [data, setData] = useState4([]);
|
|
671
|
-
useEffect6(() => {
|
|
672
|
-
setData(
|
|
673
|
-
parsearDataForComboBox(EnumToArray(dataEnum, true, description), "value", "label", false).sort(
|
|
674
|
-
(a, b) => Number(a.key) - Number(b.key)
|
|
675
|
-
)
|
|
676
|
-
);
|
|
677
|
-
}, []);
|
|
678
|
-
useEffect6(() => {
|
|
679
|
-
if (data.length > 0) {
|
|
680
|
-
setValue(data.filter((x) => x.key == defaultValue)[0]);
|
|
681
|
-
}
|
|
682
|
-
}, [data]);
|
|
683
|
-
const handleOptionClick = (e) => {
|
|
684
|
-
onChange(e);
|
|
685
|
-
setValue(e);
|
|
686
|
-
};
|
|
687
|
-
return /* @__PURE__ */ jsx8(Fragment2, { children: /* @__PURE__ */ jsx8(
|
|
688
|
-
DropDownList,
|
|
689
|
-
{
|
|
690
|
-
className: "d-inline-block align-middle mr-2",
|
|
691
|
-
data,
|
|
692
|
-
dataItemKey: "key",
|
|
693
|
-
id: "cmbDisplay",
|
|
694
|
-
name: "cmbDisplay",
|
|
695
|
-
onChange: (event) => {
|
|
696
|
-
handleOptionClick(event.value);
|
|
697
|
-
},
|
|
698
|
-
textField: "text",
|
|
699
|
-
style: {
|
|
700
|
-
width: `${width}px`
|
|
701
|
-
},
|
|
702
|
-
defaultValue: value
|
|
703
|
-
}
|
|
704
|
-
) });
|
|
705
|
-
};
|
|
706
|
-
|
|
707
|
-
// src/contexts/BreadCrumbContext.tsx
|
|
708
|
-
import { createContext as createContext5, useState as useState6 } from "react";
|
|
709
|
-
|
|
710
|
-
// src/hooks/useLocalStorage.tsx
|
|
711
|
-
import { useCallback, useEffect as useEffect8, useState as useState5 } from "react";
|
|
712
|
-
|
|
713
|
-
// src/hooks/useEventListener.tsx
|
|
714
|
-
import { useRef as useRef4 } from "react";
|
|
715
|
-
|
|
716
|
-
// src/hooks/useIsomorphicLayoutEffect.tsx
|
|
717
|
-
import { useEffect as useEffect7, useLayoutEffect } from "react";
|
|
718
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect7;
|
|
719
|
-
var useIsomorphicLayoutEffect_default = useIsomorphicLayoutEffect;
|
|
720
|
-
|
|
721
|
-
// src/hooks/useEventListener.tsx
|
|
722
|
-
function useEventListener(handler) {
|
|
723
|
-
const savedHandler = useRef4(handler);
|
|
724
|
-
useIsomorphicLayoutEffect_default(() => {
|
|
725
|
-
savedHandler.current = handler;
|
|
726
|
-
}, [handler]);
|
|
727
|
-
}
|
|
728
|
-
var useEventListener_default = useEventListener;
|
|
729
|
-
|
|
730
|
-
// src/hooks/useLocalStorage.tsx
|
|
731
|
-
function useLocalStorage(key, initialValue) {
|
|
732
|
-
const readValue = useCallback(() => {
|
|
733
|
-
if (typeof window === "undefined") {
|
|
734
|
-
return initialValue;
|
|
735
|
-
}
|
|
736
|
-
try {
|
|
737
|
-
const item = window.localStorage.getItem(key);
|
|
738
|
-
return item ? parseJSON(item) : initialValue;
|
|
739
|
-
} catch (error) {
|
|
740
|
-
console.warn(`Error reading localStorage key \u201C${key}\u201D:`, error);
|
|
741
|
-
return initialValue;
|
|
742
|
-
}
|
|
743
|
-
}, [initialValue, key]);
|
|
744
|
-
const [storedValue, setStoredValue] = useState5(readValue);
|
|
745
|
-
const setValue = useCallback(
|
|
746
|
-
(value) => {
|
|
747
|
-
if (typeof window == "undefined") {
|
|
748
|
-
console.warn(`Tried setting localStorage key \u201C${key}\u201D even though environment is not a client`);
|
|
749
|
-
}
|
|
750
|
-
try {
|
|
751
|
-
const newValue = value instanceof Function ? value(storedValue) : value;
|
|
752
|
-
window.localStorage.setItem(key, JSON.stringify(newValue));
|
|
753
|
-
setStoredValue(newValue);
|
|
754
|
-
window.dispatchEvent(new Event("local-storage"));
|
|
755
|
-
} catch (error) {
|
|
756
|
-
console.warn(`Error setting localStorage key \u201C${key}\u201D:`, error);
|
|
757
|
-
}
|
|
758
|
-
},
|
|
759
|
-
[key, storedValue]
|
|
760
|
-
);
|
|
761
|
-
useEffect8(() => {
|
|
762
|
-
setStoredValue(readValue());
|
|
763
|
-
}, []);
|
|
764
|
-
const handleStorageChange = useCallback(() => {
|
|
765
|
-
setStoredValue(readValue());
|
|
766
|
-
}, [readValue]);
|
|
767
|
-
useEventListener_default("storage", handleStorageChange);
|
|
768
|
-
useEventListener_default("local-storage", handleStorageChange);
|
|
769
|
-
return [storedValue, setValue];
|
|
770
|
-
}
|
|
771
|
-
function parseJSON(value) {
|
|
772
|
-
try {
|
|
773
|
-
return value === "undefined" ? void 0 : JSON.parse(value != null ? value : "");
|
|
774
|
-
} catch (e) {
|
|
775
|
-
console.log("parsing error on", { value });
|
|
776
|
-
return void 0;
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
// src/contexts/BreadCrumbContext.tsx
|
|
781
|
-
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
782
|
-
var BreadCrumbContext = createContext5({});
|
|
783
|
-
var BreadCrumbContextProvider = ({ children }) => {
|
|
784
|
-
const [active, setActive] = useLocalStorage("@active", "");
|
|
785
|
-
const [path, setPath] = useLocalStorage("@path", "/");
|
|
786
|
-
const [goBack, setGoBack] = useLocalStorage("@goBack", false);
|
|
787
|
-
const [pathChild, setPathChild] = useLocalStorage("@pathChild", "");
|
|
788
|
-
const [routes, setRoutes] = useState6([]);
|
|
789
|
-
return /* @__PURE__ */ jsx9(
|
|
790
|
-
BreadCrumbContext.Provider,
|
|
791
|
-
{
|
|
792
|
-
value: {
|
|
793
|
-
active,
|
|
794
|
-
setActive,
|
|
795
|
-
path,
|
|
796
|
-
setPath,
|
|
797
|
-
goBack,
|
|
798
|
-
setGoBack,
|
|
799
|
-
pathChild,
|
|
800
|
-
setPathChild,
|
|
801
|
-
routes,
|
|
802
|
-
setRoutes
|
|
803
|
-
},
|
|
804
|
-
children
|
|
805
|
-
}
|
|
806
|
-
);
|
|
807
|
-
};
|
|
808
|
-
|
|
809
|
-
// src/contexts/DrawerContext.tsx
|
|
810
|
-
import { createContext as createContext6, useState as useState7 } from "react";
|
|
811
|
-
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
812
|
-
var DrawerContext = createContext6({});
|
|
813
|
-
var DrawerContextProvider = ({ children }) => {
|
|
814
|
-
const [active, setActive] = useState7(false);
|
|
815
|
-
return /* @__PURE__ */ jsx10(DrawerContext.Provider, { value: { active, setActive }, children });
|
|
816
|
-
};
|
|
817
|
-
|
|
818
|
-
// src/contexts/HistoryContext.tsx
|
|
819
|
-
import { createContext as createContext7 } from "react";
|
|
820
|
-
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
821
|
-
var HistoryContext = createContext7({});
|
|
822
|
-
var HistoryContextProvider = ({ children }) => {
|
|
823
|
-
const [list, setList] = useLocalStorage("@list_paths", []);
|
|
824
|
-
const updateList = (value) => {
|
|
825
|
-
setList(
|
|
826
|
-
(prev) => prev.concat({
|
|
827
|
-
path: value.path,
|
|
828
|
-
name: value.name,
|
|
829
|
-
date: /* @__PURE__ */ new Date()
|
|
830
|
-
})
|
|
831
|
-
);
|
|
832
|
-
};
|
|
833
|
-
return /* @__PURE__ */ jsx11(HistoryContext.Provider, { value: { list, updateList }, children });
|
|
834
|
-
};
|
|
835
|
-
|
|
836
|
-
// src/contexts/SidebarMainContext.tsx
|
|
837
|
-
import { createContext as createContext8, useState as useState8 } from "react";
|
|
838
|
-
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
839
|
-
var SidebarMainContext = createContext8({});
|
|
840
|
-
var SidebarMainContextProvider = ({ children }) => {
|
|
841
|
-
const [open2, setOpen] = useState8(true);
|
|
842
|
-
return /* @__PURE__ */ jsx12(SidebarMainContext.Provider, { value: { open: open2, setOpen }, children });
|
|
843
|
-
};
|
|
844
|
-
|
|
845
|
-
// src/contexts/GlobalProvider.tsx
|
|
846
|
-
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
847
|
-
function GlobalProvider({ children }) {
|
|
848
|
-
return /* @__PURE__ */ jsx13(HistoryContextProvider, { children: /* @__PURE__ */ jsx13(BreadCrumbContextProvider, { children: /* @__PURE__ */ jsx13(SidebarMainContextProvider, { children: /* @__PURE__ */ jsx13(DrawerContextProvider, { children }) }) }) });
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
// src/hooks/usePrevious.tsx
|
|
852
|
-
import { useEffect as useEffect9, useRef as useRef5 } from "react";
|
|
853
|
-
var usePrevious = (value) => {
|
|
854
|
-
const ref = useRef5();
|
|
855
|
-
useEffect9(() => {
|
|
856
|
-
ref.current = value;
|
|
857
|
-
});
|
|
858
|
-
return ref.current;
|
|
859
|
-
};
|
|
860
|
-
|
|
861
|
-
// src/hooks/useStep.tsx
|
|
862
|
-
import { useCallback as useCallback2, useMemo as useMemo4, useState as useState9 } from "react";
|
|
863
|
-
var useStep = (maxStep) => {
|
|
864
|
-
const [currentStep, setCurrentStep] = useState9(1);
|
|
865
|
-
const canGoToNextStep = useMemo4(() => currentStep + 1 <= maxStep, [currentStep, maxStep]);
|
|
866
|
-
const canGoToPrevStep = useMemo4(() => currentStep - 1 >= 1, [currentStep]);
|
|
867
|
-
const setStep = useCallback2(
|
|
868
|
-
(step) => {
|
|
869
|
-
const newStep = step instanceof Function ? step(currentStep) : step;
|
|
870
|
-
if (newStep >= 1 && newStep <= maxStep) {
|
|
871
|
-
setCurrentStep(newStep);
|
|
872
|
-
return;
|
|
873
|
-
}
|
|
874
|
-
throw new Error("Step not valid");
|
|
875
|
-
},
|
|
876
|
-
[maxStep, currentStep]
|
|
877
|
-
);
|
|
878
|
-
const goToNextStep = useCallback2(() => {
|
|
879
|
-
if (canGoToNextStep) {
|
|
880
|
-
setCurrentStep((step) => step + 1);
|
|
881
|
-
}
|
|
882
|
-
}, [canGoToNextStep]);
|
|
883
|
-
const goToPrevStep = useCallback2(() => {
|
|
884
|
-
if (canGoToPrevStep) {
|
|
885
|
-
setCurrentStep((step) => step - 1);
|
|
886
|
-
}
|
|
887
|
-
}, [canGoToPrevStep]);
|
|
888
|
-
const reset = useCallback2(() => {
|
|
889
|
-
setCurrentStep(1);
|
|
890
|
-
}, []);
|
|
891
|
-
return [
|
|
892
|
-
currentStep,
|
|
893
|
-
{
|
|
894
|
-
goToNextStep,
|
|
895
|
-
goToPrevStep,
|
|
896
|
-
canGoToNextStep,
|
|
897
|
-
canGoToPrevStep,
|
|
898
|
-
setStep,
|
|
899
|
-
reset
|
|
900
|
-
}
|
|
901
|
-
];
|
|
902
|
-
};
|
|
903
|
-
|
|
904
|
-
// src/layout/AppBreadcrumb.tsx
|
|
905
|
-
import { useContext as useContext7, useEffect as useEffect10 } from "react";
|
|
906
|
-
import { MdClose } from "react-icons/md";
|
|
907
|
-
import { VscChevronRight } from "react-icons/vsc";
|
|
908
|
-
import { Link as Link3 } from "react-router-dom";
|
|
909
|
-
|
|
910
|
-
// src/styled-components/breadcrumb.ts
|
|
911
|
-
import styled from "styled-components";
|
|
912
|
-
var Breadcrumb = styled.div`
|
|
913
|
-
font-family: 'Inter', sans-serif;
|
|
914
|
-
padding: 10px 0px;
|
|
915
|
-
text-transform: uppercase;
|
|
916
|
-
font-weight: bold;
|
|
917
|
-
font-size: 0.9rem;
|
|
918
|
-
color: #92190e;
|
|
919
|
-
display: flex;
|
|
920
|
-
justify-content: space-between;
|
|
921
|
-
align-items: center;
|
|
922
|
-
background-color: white;
|
|
923
|
-
align-items: center;
|
|
924
|
-
|
|
925
|
-
.link {
|
|
926
|
-
color: #92190e;
|
|
927
|
-
&:hover {
|
|
928
|
-
color: #92190e;
|
|
929
|
-
cursor: pointer;
|
|
930
|
-
}
|
|
931
|
-
}
|
|
932
|
-
`;
|
|
933
|
-
var BreadCrumbTitle = styled.div`
|
|
934
|
-
font-family: 'Inter', sans-serif;
|
|
935
|
-
font-weight: bold;
|
|
936
|
-
font-size: 1.2rem !important;
|
|
937
|
-
color: #92190e;
|
|
938
|
-
margin-top: 15px;
|
|
939
|
-
`;
|
|
940
|
-
var TitlePage = styled.div`
|
|
941
|
-
font-family: 'Inter', sans-serif;
|
|
942
|
-
font-weight: bold;
|
|
943
|
-
font-size: 1.2rem !important;
|
|
944
|
-
color: #92190e;
|
|
945
|
-
margin-top: 15px;
|
|
946
|
-
`;
|
|
947
|
-
|
|
948
|
-
// src/styled-components/menu.ts
|
|
949
|
-
import { Link } from "react-router-dom";
|
|
950
|
-
import styled2 from "styled-components";
|
|
951
|
-
var MenuItem2 = styled2(Link)`
|
|
952
|
-
text-decoration: none;
|
|
953
|
-
color: black;
|
|
954
|
-
display: flex;
|
|
955
|
-
justify-content: ${(props) => props.type === "col" ? "center" : "flex-start"};
|
|
956
|
-
align-items: center;
|
|
957
|
-
flex-direction: ${(props) => props.type === "col" ? "column" : "row"};
|
|
958
|
-
border: 1px solid transparent;
|
|
959
|
-
width: ${(props) => props.width ? props.width : "100px"};
|
|
960
|
-
padding: 10px;
|
|
961
|
-
text-decoration: none !important;
|
|
962
|
-
&:hover {
|
|
963
|
-
box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
|
|
964
|
-
}
|
|
965
|
-
|
|
966
|
-
.icon {
|
|
967
|
-
width: 30px;
|
|
968
|
-
text-decoration: none;
|
|
969
|
-
}
|
|
970
|
-
.text {
|
|
971
|
-
text-align: center;
|
|
972
|
-
font-size: 12px;
|
|
973
|
-
text-decoration: none !important;
|
|
974
|
-
color: black;
|
|
975
|
-
margin-top: ${(props) => props.type === "col" ? "0px" : "15px"};
|
|
976
|
-
&:hover {
|
|
977
|
-
text-decoration: none !important;
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
|
-
`;
|
|
981
|
-
var MenuTitle = styled2.p`
|
|
982
|
-
font-size: 16px;
|
|
983
|
-
font-weight: bold !important;
|
|
984
|
-
`;
|
|
985
|
-
|
|
986
|
-
// src/styled-components/navbar.ts
|
|
987
|
-
import styled3 from "styled-components";
|
|
988
|
-
var Navbar = styled3.nav`
|
|
989
|
-
background: ${(props) => {
|
|
990
|
-
return !props.gradient ? ` linear-gradient( 90.03deg, #92190e 80.71%, #f0b92c 107.21% ) !important` : `#92190e`;
|
|
991
|
-
}};
|
|
992
|
-
z-index: 10;
|
|
993
|
-
width: 100%;
|
|
994
|
-
max-width: 100vw;
|
|
995
|
-
display: flex;
|
|
996
|
-
justify-content: space-between;
|
|
997
|
-
padding-top: 10px;
|
|
998
|
-
padding-bottom: 10px;
|
|
999
|
-
position: sticky;
|
|
1000
|
-
top: 0px;
|
|
1001
|
-
height: 40px;
|
|
1002
|
-
.input {
|
|
1003
|
-
border-radius: 2px !important;
|
|
1004
|
-
padding: 2px !important;
|
|
1005
|
-
font-size: 12px !important;
|
|
1006
|
-
height: 20px !important;
|
|
1007
|
-
border: none;
|
|
1008
|
-
&:focus {
|
|
1009
|
-
outline: none !important;
|
|
1010
|
-
}
|
|
1011
|
-
::placeholder {
|
|
1012
|
-
color: #92190e;
|
|
1013
|
-
}
|
|
1014
|
-
@media (max-width: 470px) {
|
|
1015
|
-
display: none;
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
.dialog {
|
|
1019
|
-
z-index: 20000 !important;
|
|
1020
|
-
position: absolute;
|
|
1021
|
-
width: 400px;
|
|
1022
|
-
height: 500px;
|
|
1023
|
-
min-height: 500px;
|
|
1024
|
-
overflow: scroll;
|
|
1025
|
-
overflow-x: hidden;
|
|
1026
|
-
min-width: 400px;
|
|
1027
|
-
max-width: 400px;
|
|
1028
|
-
background-color: white;
|
|
1029
|
-
border-radius: 20px;
|
|
1030
|
-
top: 50%;
|
|
1031
|
-
left: 50%;
|
|
1032
|
-
transform: translate(-50%, -50%);
|
|
1033
|
-
}
|
|
1034
|
-
`;
|
|
1035
|
-
|
|
1036
|
-
// src/styled-components/options.ts
|
|
1037
|
-
import styled4 from "styled-components";
|
|
1038
|
-
var MenuOptions = styled4.div`
|
|
1039
|
-
font-size: bold;
|
|
1040
|
-
display: flex;
|
|
1041
|
-
width: 100%;
|
|
1042
|
-
gap: 10px;
|
|
1043
|
-
justify-content: flex-start;
|
|
1044
|
-
border-bottom: 1px solid #e6e6e6;
|
|
1045
|
-
background-color: white;
|
|
1046
|
-
flex-wrap: wrap;
|
|
1047
|
-
.button-option {
|
|
1048
|
-
display: flex;
|
|
1049
|
-
flex-direction: row;
|
|
1050
|
-
justify-content: space-between;
|
|
1051
|
-
align-items: center;
|
|
1052
|
-
gap: 5px;
|
|
1053
|
-
padding: 10px 20px;
|
|
1054
|
-
font-weight: bold;
|
|
1055
|
-
background-color: white !important;
|
|
1056
|
-
border: none;
|
|
1057
|
-
.icon {
|
|
1058
|
-
color: #92190e;
|
|
1059
|
-
}
|
|
1060
|
-
.text {
|
|
1061
|
-
@media (max-width: 470px) {
|
|
1062
|
-
display: none;
|
|
1063
|
-
}
|
|
1064
|
-
}
|
|
1065
|
-
}
|
|
1066
|
-
`;
|
|
1067
|
-
|
|
1068
|
-
// src/styled-components/sidebar.ts
|
|
1069
|
-
import { Link as Link2 } from "react-router-dom";
|
|
1070
|
-
import styled5 from "styled-components";
|
|
1071
|
-
var ItemSidebar = styled5.div`
|
|
1072
|
-
padding: 10px 25px;
|
|
1073
|
-
display: flex;
|
|
1074
|
-
align-items: center;
|
|
1075
|
-
gap: 30px;
|
|
1076
|
-
font-family: 'Inter', sans-serif;
|
|
1077
|
-
&:hover {
|
|
1078
|
-
color: white !important;
|
|
1079
|
-
text-decoration: none;
|
|
1080
|
-
background: #92190e;
|
|
1081
|
-
.icon-sidebar {
|
|
1082
|
-
color: white !important;
|
|
1083
|
-
}
|
|
1084
|
-
}
|
|
1085
|
-
&:active {
|
|
1086
|
-
color: white !important;
|
|
1087
|
-
text-decoration: none;
|
|
1088
|
-
background: #92190e;
|
|
1089
|
-
.icon-sidebar {
|
|
1090
|
-
color: white !important;
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
`;
|
|
1094
|
-
var SidebarNavigation = styled5.nav`
|
|
1095
|
-
position: ${({ fixed = true }) => fixed ? "fixed" : "static"};
|
|
1096
|
-
top: 0;
|
|
1097
|
-
left: 0;
|
|
1098
|
-
min-height: 100vh;
|
|
1099
|
-
box-shadow: 7px 0px 14px 1px rgba(145, 141, 141, 0.51);
|
|
1100
|
-
-webkit-box-shadow: 7px 0px 14px 1px rgba(145, 141, 141, 0.51);
|
|
1101
|
-
-moz-box-shadow: 7px 0px 14px 1px rgba(145, 141, 141, 0.51);
|
|
1102
|
-
background: white;
|
|
1103
|
-
font-family: 'Inter', sans-serif;
|
|
1104
|
-
padding: 0;
|
|
1105
|
-
width: ${({ fixed = true, active = true }) => fixed ? active ? "270px" : "0px" : "auto"};
|
|
1106
|
-
z-index: 11;
|
|
1107
|
-
transition: width 0.2s ease-in-out;
|
|
1108
|
-
|
|
1109
|
-
overflow: hidden;
|
|
1110
|
-
height: 100vh;
|
|
1111
|
-
overflow-y: auto;
|
|
1112
|
-
box-shadow: ${({ shadow = true }) => shadow ? "rgba(99, 99, 99, 0.2) 0px 2px 8px 0px" : "none"};
|
|
1113
|
-
|
|
1114
|
-
&::-webkit-scrollbar {
|
|
1115
|
-
display: none !important;
|
|
1116
|
-
}
|
|
1117
|
-
.nav {
|
|
1118
|
-
flex-wrap: nowrap;
|
|
1119
|
-
flex-direction: column;
|
|
1120
|
-
font-size: 12px;
|
|
1121
|
-
|
|
1122
|
-
.nav-item {
|
|
1123
|
-
.collapse {
|
|
1124
|
-
z-index: 999;
|
|
1125
|
-
}
|
|
1126
|
-
|
|
1127
|
-
.collapse.show,
|
|
1128
|
-
.collapsing {
|
|
1129
|
-
background: rgba(0, 0, 0);
|
|
1130
|
-
}
|
|
1131
|
-
|
|
1132
|
-
.nav-link {
|
|
1133
|
-
align-items: center;
|
|
1134
|
-
display: flex;
|
|
1135
|
-
padding-left: 40px;
|
|
1136
|
-
white-space: nowrap;
|
|
1137
|
-
|
|
1138
|
-
color: #92190e;
|
|
1139
|
-
i {
|
|
1140
|
-
margin-right: 20px;
|
|
1141
|
-
}
|
|
1142
|
-
.menu-title {
|
|
1143
|
-
color: inherit;
|
|
1144
|
-
display: inline-block;
|
|
1145
|
-
line-height: 1;
|
|
1146
|
-
color: black;
|
|
1147
|
-
vertical-align: middle;
|
|
1148
|
-
cursor: pointer;
|
|
1149
|
-
}
|
|
1150
|
-
}
|
|
1151
|
-
|
|
1152
|
-
&.active {
|
|
1153
|
-
> .nav-link {
|
|
1154
|
-
color: white;
|
|
1155
|
-
}
|
|
1156
|
-
|
|
1157
|
-
&.not-navigation-link {
|
|
1158
|
-
position: relative;
|
|
1159
|
-
}
|
|
1160
|
-
}
|
|
1161
|
-
|
|
1162
|
-
&:not(.sub-menu) {
|
|
1163
|
-
> .nav-item {
|
|
1164
|
-
&:hover {
|
|
1165
|
-
&:not(.nav-profile) {
|
|
1166
|
-
> .nav-link {
|
|
1167
|
-
background: $sidebar-light-menu-hover-bg;
|
|
1168
|
-
color: $sidebar-light-menu-hover-color;
|
|
1169
|
-
}
|
|
1170
|
-
}
|
|
1171
|
-
}
|
|
1172
|
-
}
|
|
1173
|
-
}
|
|
1174
|
-
|
|
1175
|
-
&.sub-menu {
|
|
1176
|
-
margin-bottom: 0;
|
|
1177
|
-
padding: $sidebar-submenu-padding;
|
|
1178
|
-
|
|
1179
|
-
.rtl & {
|
|
1180
|
-
padding: 0 4rem 0 0;
|
|
1181
|
-
}
|
|
1182
|
-
|
|
1183
|
-
.nav-item {
|
|
1184
|
-
.nav-link {
|
|
1185
|
-
color: $sidebar-light-submenu-color;
|
|
1186
|
-
padding: $sidebar-submenu-item-padding;
|
|
1187
|
-
font-size: $sidebar-submenu-font-size;
|
|
1188
|
-
line-height: 1;
|
|
1189
|
-
height: auto;
|
|
1190
|
-
|
|
1191
|
-
&.active {
|
|
1192
|
-
color: $sidebar-light-menu-active-color;
|
|
1193
|
-
background: transparent;
|
|
1194
|
-
|
|
1195
|
-
&:before {
|
|
1196
|
-
background: $sidebar-light-menu-active-color;
|
|
1197
|
-
}
|
|
1198
|
-
}
|
|
1199
|
-
}
|
|
1200
|
-
|
|
1201
|
-
&:hover {
|
|
1202
|
-
> .nav-link {
|
|
1203
|
-
background: $sidebar-light-submenu-hover-bg;
|
|
1204
|
-
color: $sidebar-light-submenu-hover-color;
|
|
1205
|
-
|
|
1206
|
-
&:before {
|
|
1207
|
-
background: $sidebar-light-submenu-hover-color;
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1210
|
-
}
|
|
1211
|
-
}
|
|
1212
|
-
}
|
|
1213
|
-
|
|
1214
|
-
&.sub-menu2 {
|
|
1215
|
-
margin-bottom: 0;
|
|
1216
|
-
padding: $sidebar-submenu2-padding;
|
|
1217
|
-
|
|
1218
|
-
.rtl & {
|
|
1219
|
-
padding: 0 4rem 0 0;
|
|
1220
|
-
}
|
|
1221
|
-
|
|
1222
|
-
.nav-item {
|
|
1223
|
-
.nav-link {
|
|
1224
|
-
color: $sidebar-light-submenu-color;
|
|
1225
|
-
padding: $sidebar-submenu-item-padding;
|
|
1226
|
-
font-size: $sidebar-submenu-font-size;
|
|
1227
|
-
line-height: 1;
|
|
1228
|
-
height: auto;
|
|
1229
|
-
|
|
1230
|
-
&.active {
|
|
1231
|
-
color: $sidebar-light-menu-active-color;
|
|
1232
|
-
background: transparent;
|
|
1233
|
-
|
|
1234
|
-
&:before {
|
|
1235
|
-
background: $sidebar-light-menu-active-color;
|
|
1236
|
-
}
|
|
1237
|
-
}
|
|
1238
|
-
}
|
|
1239
|
-
|
|
1240
|
-
&:hover {
|
|
1241
|
-
> .nav-link {
|
|
1242
|
-
background: $sidebar-light-submenu-hover-bg;
|
|
1243
|
-
color: $sidebar-light-submenu-hover-color;
|
|
1244
|
-
|
|
1245
|
-
&:before {
|
|
1246
|
-
background: $sidebar-light-submenu-hover-color;
|
|
1247
|
-
}
|
|
1248
|
-
}
|
|
1249
|
-
}
|
|
1250
|
-
}
|
|
1251
|
-
}
|
|
1252
|
-
}
|
|
1253
|
-
}
|
|
1254
|
-
`;
|
|
1255
|
-
var ConfigurationOption = styled5.nav`
|
|
1256
|
-
position: fixed;
|
|
1257
|
-
top: 50px;
|
|
1258
|
-
right: 0;
|
|
1259
|
-
min-height: 100vh;
|
|
1260
|
-
box-shadow: 7px 0px 14px 1px rgba(201, 196, 196, 0.51);
|
|
1261
|
-
-webkit-box-shadow: 7px 0px 14px 1px rgba(201, 196, 196, 0.51);
|
|
1262
|
-
-moz-box-shadow: 7px 0px 14px 1px rgba(201, 196, 196, 0.51);
|
|
1263
|
-
min-height: calc(100vh);
|
|
1264
|
-
|
|
1265
|
-
font-family: 'Inter', sans-serif;
|
|
1266
|
-
padding: 0;
|
|
1267
|
-
width: ${(props) => props.active ? "300px" : "0px"};
|
|
1268
|
-
z-index: 11;
|
|
1269
|
-
transition: width 0.2s ease-in-out;
|
|
1270
|
-
overflow: hidden !important;
|
|
1271
|
-
`;
|
|
1272
|
-
var ItemLinkSidebar = styled5(Link2)`
|
|
1273
|
-
padding: 10px 25px;
|
|
1274
|
-
display: flex;
|
|
1275
|
-
align-items: center;
|
|
1276
|
-
gap: 30px;
|
|
1277
|
-
color: #343a40;
|
|
1278
|
-
text-decoration: none;
|
|
1279
|
-
font-family: 'Inter', sans-serif;
|
|
1280
|
-
&:hover {
|
|
1281
|
-
color: white !important;
|
|
1282
|
-
text-decoration: none;
|
|
1283
|
-
background: #92190e;
|
|
1284
|
-
.icon-sidebar {
|
|
1285
|
-
color: white !important;
|
|
1286
|
-
}
|
|
1287
|
-
}
|
|
1288
|
-
`;
|
|
1289
|
-
|
|
1290
|
-
// src/styled-components/template.ts
|
|
1291
|
-
import styled6 from "styled-components";
|
|
1292
|
-
var Main = styled6.main`
|
|
1293
|
-
width: 100%;
|
|
1294
|
-
min-height: 90vh;
|
|
1295
|
-
display: flex;
|
|
1296
|
-
flex-direction: column;
|
|
1297
|
-
justify-content: space-between;
|
|
1298
|
-
background-color: white;
|
|
1299
|
-
padding: 10px 60px;
|
|
1300
|
-
position: relative;
|
|
1301
|
-
padding-left: ${(props) => {
|
|
1302
|
-
return props.activeDrawer ? `300px` : `30px`;
|
|
1303
|
-
}};
|
|
1304
|
-
@media (max-width: 470px) {
|
|
1305
|
-
padding: 10px 10px;
|
|
1306
|
-
}
|
|
1307
|
-
`;
|
|
1308
|
-
var CloseIcon = styled6.button`
|
|
1309
|
-
color: black;
|
|
1310
|
-
text-decoration: none;
|
|
1311
|
-
border: none;
|
|
1312
|
-
padding: 10px 10px;
|
|
1313
|
-
background-color: white;
|
|
1314
|
-
border-radius: 50%;
|
|
1315
|
-
display: flex;
|
|
1316
|
-
align-items: center;
|
|
1317
|
-
justify-content: center;
|
|
1318
|
-
cursor: pointer;
|
|
1319
|
-
top: 10px;
|
|
1320
|
-
right: 10px;
|
|
1321
|
-
text-align: center;
|
|
1322
|
-
&:hover {
|
|
1323
|
-
color: black;
|
|
1324
|
-
text-decoration: none;
|
|
1325
|
-
background-color: #e8e8e8;
|
|
1326
|
-
}
|
|
1327
|
-
`;
|
|
1328
|
-
|
|
1329
|
-
// src/layout/AppBreadcrumb.tsx
|
|
1330
|
-
import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1331
|
-
var AppBreadCrumb = ({ title, paths }) => {
|
|
1332
|
-
const { setRoutes } = useContext7(BreadCrumbContext);
|
|
1333
|
-
useEffect10(() => {
|
|
1334
|
-
if (!(paths == null ? void 0 : paths.length))
|
|
1335
|
-
return;
|
|
1336
|
-
setRoutes(paths != null ? paths : []);
|
|
1337
|
-
}, []);
|
|
1338
|
-
return /* @__PURE__ */ jsx14(BreadCrumbTitle, { children: title != null ? title : "Home" });
|
|
1339
|
-
};
|
|
1340
|
-
var AppBreadCrumbNav = ({
|
|
1341
|
-
paths,
|
|
1342
|
-
onPush
|
|
1343
|
-
}) => {
|
|
1344
|
-
const { active, path, routes, setRoutes } = useContext7(BreadCrumbContext);
|
|
1345
|
-
const { updateList } = useContext7(HistoryContext);
|
|
1346
|
-
useEffect10(() => {
|
|
1347
|
-
updateList({ name: active, path });
|
|
1348
|
-
}, [path, active]);
|
|
1349
|
-
useEffect10(() => {
|
|
1350
|
-
setRoutes(paths != null ? paths : []);
|
|
1351
|
-
}, [paths]);
|
|
1352
|
-
return /* @__PURE__ */ jsxs8(Breadcrumb, { children: [
|
|
1353
|
-
/* @__PURE__ */ jsxs8("div", { className: "d-flex align-items-center", children: [
|
|
1354
|
-
/* @__PURE__ */ jsx14(Link3, { to: "/", className: "link", children: "HOME" }),
|
|
1355
|
-
routes.length > 0 && /* @__PURE__ */ jsx14(VscChevronRight, { color: "black" }),
|
|
1356
|
-
routes.length > 0 ? routes.map((i, idx, arr) => {
|
|
1357
|
-
if (i.route === -1) {
|
|
1358
|
-
return /* @__PURE__ */ jsxs8("span", { className: "link", onClick: () => onPush(-1), children: [
|
|
1359
|
-
i.title,
|
|
1360
|
-
" ",
|
|
1361
|
-
idx + 1 === arr.length ? "" : /* @__PURE__ */ jsx14(VscChevronRight, { color: "black" })
|
|
1362
|
-
] }, idx);
|
|
1363
|
-
}
|
|
1364
|
-
return /* @__PURE__ */ jsxs8(Link3, { to: i.route, className: "link", children: [
|
|
1365
|
-
i.title,
|
|
1366
|
-
" ",
|
|
1367
|
-
idx + 1 === arr.length ? "" : /* @__PURE__ */ jsx14(VscChevronRight, { color: "black" })
|
|
1368
|
-
] }, idx);
|
|
1369
|
-
}) : ""
|
|
1370
|
-
] }),
|
|
1371
|
-
/* @__PURE__ */ jsx14(
|
|
1372
|
-
CloseIcon,
|
|
1373
|
-
{
|
|
1374
|
-
onClick: () => {
|
|
1375
|
-
if ((routes == null ? void 0 : routes.length) === 1) {
|
|
1376
|
-
onPush("/");
|
|
1377
|
-
setRoutes([]);
|
|
1378
|
-
return;
|
|
1379
|
-
}
|
|
1380
|
-
onPush(`${routes && routes[(routes == null ? void 0 : routes.length) - 2].route}`);
|
|
1381
|
-
},
|
|
1382
|
-
children: /* @__PURE__ */ jsx14(MdClose, { fontSize: 20 })
|
|
1383
|
-
}
|
|
1384
|
-
)
|
|
1385
|
-
] });
|
|
1386
|
-
};
|
|
1387
|
-
|
|
1388
|
-
// src/layout/AppLoader.tsx
|
|
1389
|
-
import { useEffect as useEffect11 } from "react";
|
|
1390
|
-
import ReactDOM from "react-dom";
|
|
1391
|
-
import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1392
|
-
var LoaderGrid = () => {
|
|
1393
|
-
const Loader = /* @__PURE__ */ jsxs9("div", { className: "k-loading-mask", children: [
|
|
1394
|
-
/* @__PURE__ */ jsx15("span", { className: "k-loading-text", children: "Loading" }),
|
|
1395
|
-
/* @__PURE__ */ jsx15("div", { className: "k-loading-image" }),
|
|
1396
|
-
/* @__PURE__ */ jsx15("div", { className: "k-loading-color" })
|
|
1397
|
-
] });
|
|
1398
|
-
const gridContent = document && document.querySelector(".k-grid-content");
|
|
1399
|
-
const reportContent = document && document.querySelector(".loading-report");
|
|
1400
|
-
return gridContent ? ReactDOM.createPortal(Loader, gridContent) : reportContent ? ReactDOM.createPortal(Loader, reportContent) : Loader;
|
|
1401
|
-
};
|
|
1402
|
-
var AppLoader = (props) => {
|
|
1403
|
-
const { type = "grid", parent, minDuration } = props;
|
|
1404
|
-
const parentEl = type === "grid" ? document.querySelector(parent != null ? parent : ".k-grid-container") : parent ? document.querySelector(parent) : null;
|
|
1405
|
-
const Loading = /* @__PURE__ */ jsxs9("div", { className: `${type}-loading k-loading-mask`, children: [
|
|
1406
|
-
/* @__PURE__ */ jsx15("span", { className: "k-loading-text", children: "Loading" }),
|
|
1407
|
-
/* @__PURE__ */ jsx15("div", { className: "k-loading-image" }),
|
|
1408
|
-
/* @__PURE__ */ jsx15("div", { className: "k-loading-color" })
|
|
1409
|
-
] });
|
|
1410
|
-
useEffect11(() => {
|
|
1411
|
-
if (type === "button") {
|
|
1412
|
-
const loadingEl = document.createElement("div");
|
|
1413
|
-
loadingEl.className = "icon button-loading k-loading-mask";
|
|
1414
|
-
loadingEl.innerHTML = `
|
|
1415
|
-
<div class="k-loading-image"></div>
|
|
1416
|
-
`;
|
|
1417
|
-
if (parentEl) {
|
|
1418
|
-
const button = parentEl;
|
|
1419
|
-
button.classList.add("btn-loading");
|
|
1420
|
-
button.disabled = true;
|
|
1421
|
-
button.insertBefore(loadingEl, button.firstChild);
|
|
1422
|
-
}
|
|
1423
|
-
return () => {
|
|
1424
|
-
if (parentEl) {
|
|
1425
|
-
if (minDuration) {
|
|
1426
|
-
setTimeout(() => {
|
|
1427
|
-
const button = parentEl;
|
|
1428
|
-
button.classList.remove("btn-loading");
|
|
1429
|
-
button.removeChild(loadingEl);
|
|
1430
|
-
button.disabled = false;
|
|
1431
|
-
}, minDuration);
|
|
1432
|
-
} else {
|
|
1433
|
-
const button = parentEl;
|
|
1434
|
-
button.classList.remove("btn-loading");
|
|
1435
|
-
button.removeChild(loadingEl);
|
|
1436
|
-
button.disabled = false;
|
|
1437
|
-
}
|
|
1438
|
-
}
|
|
1439
|
-
};
|
|
1440
|
-
}
|
|
1441
|
-
}, []);
|
|
1442
|
-
return type === "button" ? null : parentEl ? ReactDOM.createPortal(Loading, parentEl) : Loading;
|
|
1443
|
-
};
|
|
1444
|
-
|
|
1445
|
-
// src/layout/NavOptions.tsx
|
|
1446
|
-
import { Dropdown } from "react-bootstrap";
|
|
1447
|
-
import { BsArrowsFullscreen } from "react-icons/bs";
|
|
1448
|
-
import { FiCheckCircle, FiFilter, FiPlusSquare, FiRefreshCcw, FiSave } from "react-icons/fi";
|
|
1449
|
-
import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1450
|
-
var NavOptions = ({
|
|
1451
|
-
exportExcel,
|
|
1452
|
-
customButtons,
|
|
1453
|
-
onCreate,
|
|
1454
|
-
onRefresh,
|
|
1455
|
-
onSelect,
|
|
1456
|
-
onClear,
|
|
1457
|
-
onExpandScreen
|
|
1458
|
-
}) => {
|
|
1459
|
-
return /* @__PURE__ */ jsxs10(MenuOptions, { children: [
|
|
1460
|
-
onCreate && /* @__PURE__ */ jsxs10("button", { className: "button-option", onClick: onCreate, children: [
|
|
1461
|
-
/* @__PURE__ */ jsx16(FiPlusSquare, { className: "icon" }),
|
|
1462
|
-
" ",
|
|
1463
|
-
/* @__PURE__ */ jsx16("span", { className: "text", children: "New" })
|
|
1464
|
-
] }),
|
|
1465
|
-
onRefresh && /* @__PURE__ */ jsxs10("button", { className: "button-option", onClick: onRefresh, children: [
|
|
1466
|
-
/* @__PURE__ */ jsx16(FiRefreshCcw, { className: "icon" }),
|
|
1467
|
-
" ",
|
|
1468
|
-
/* @__PURE__ */ jsx16("span", { className: "text", children: "Refresh" })
|
|
1469
|
-
] }),
|
|
1470
|
-
exportExcel && exportExcel.length > 0 && /* @__PURE__ */ jsxs10(Dropdown, { className: "button-option", children: [
|
|
1471
|
-
/* @__PURE__ */ jsxs10(
|
|
1472
|
-
Dropdown.Toggle,
|
|
1473
|
-
{
|
|
1474
|
-
id: "btnExport",
|
|
1475
|
-
className: "p-2 bg-light text-dark border-0 font-weight-bold",
|
|
1476
|
-
title: "Export to Excel",
|
|
1477
|
-
children: [
|
|
1478
|
-
/* @__PURE__ */ jsx16(FiSave, { className: "icon" }),
|
|
1479
|
-
/* @__PURE__ */ jsx16(
|
|
1480
|
-
"span",
|
|
1481
|
-
{
|
|
1482
|
-
style: {
|
|
1483
|
-
fontSize: "13px",
|
|
1484
|
-
fontFamily: '"Inter", sans-serif'
|
|
1485
|
-
},
|
|
1486
|
-
className: "text",
|
|
1487
|
-
children: "Export"
|
|
1488
|
-
}
|
|
1489
|
-
)
|
|
1490
|
-
]
|
|
1491
|
-
}
|
|
1492
|
-
),
|
|
1493
|
-
/* @__PURE__ */ jsx16(Dropdown.Menu, { children: exportExcel.map((item, index) => {
|
|
1494
|
-
return /* @__PURE__ */ jsxs10(Dropdown.Item, { onClick: item.onAction, children: [
|
|
1495
|
-
/* @__PURE__ */ jsx16("i", { className: `${item.classNameIcon} mr-2` }),
|
|
1496
|
-
" ",
|
|
1497
|
-
item.title
|
|
1498
|
-
] }, index);
|
|
1499
|
-
}) })
|
|
1500
|
-
] }),
|
|
1501
|
-
onSelect && /* @__PURE__ */ jsxs10("button", { className: "button-option", onClick: onSelect, children: [
|
|
1502
|
-
/* @__PURE__ */ jsx16(FiCheckCircle, { className: "icon" }),
|
|
1503
|
-
" ",
|
|
1504
|
-
/* @__PURE__ */ jsx16("span", { className: "text", children: "Select All" })
|
|
1505
|
-
] }),
|
|
1506
|
-
onClear && /* @__PURE__ */ jsxs10("button", { className: "button-option", onClick: onClear, children: [
|
|
1507
|
-
/* @__PURE__ */ jsx16(FiFilter, { className: "icon" }),
|
|
1508
|
-
" ",
|
|
1509
|
-
/* @__PURE__ */ jsx16("span", { className: "text", children: "Clear Filters" })
|
|
1510
|
-
] }),
|
|
1511
|
-
onExpandScreen && /* @__PURE__ */ jsxs10("button", { className: "button-option", onClick: onExpandScreen, children: [
|
|
1512
|
-
/* @__PURE__ */ jsx16(BsArrowsFullscreen, { className: "icon" }),
|
|
1513
|
-
" ",
|
|
1514
|
-
/* @__PURE__ */ jsx16("span", { className: "text", children: "Full Page" })
|
|
1515
|
-
] }),
|
|
1516
|
-
customButtons == null ? void 0 : customButtons.map((custom, index) => {
|
|
1517
|
-
if (custom.render) {
|
|
1518
|
-
return custom.render;
|
|
1519
|
-
}
|
|
1520
|
-
return /* @__PURE__ */ jsxs10("button", { className: "button-option", onClick: custom.onAction, children: [
|
|
1521
|
-
custom.Icon !== void 0 && /* @__PURE__ */ jsx16(custom.Icon, { className: "icon" }),
|
|
1522
|
-
/* @__PURE__ */ jsx16("span", { className: "text", children: custom.title })
|
|
1523
|
-
] }, index);
|
|
1524
|
-
})
|
|
1525
|
-
] });
|
|
1526
|
-
};
|
|
1527
|
-
|
|
1528
|
-
// src/layout/title.tsx
|
|
1529
|
-
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1530
|
-
var Title = ({ title }) => {
|
|
1531
|
-
return /* @__PURE__ */ jsx17(TitlePage, { children: title != null ? title : "Home" });
|
|
1532
|
-
};
|
|
1533
|
-
export {
|
|
1534
|
-
AppBreadCrumb,
|
|
1535
|
-
AppBreadCrumbNav,
|
|
1536
|
-
AppLoader,
|
|
1537
|
-
BreadCrumbContext,
|
|
1538
|
-
BreadCrumbContextProvider,
|
|
1539
|
-
BreadCrumbTitle,
|
|
1540
|
-
Breadcrumb,
|
|
1541
|
-
Button,
|
|
1542
|
-
CloseIcon,
|
|
1543
|
-
Collapse_default as Collapse,
|
|
1544
|
-
CollapseContent_default as CollapseContent,
|
|
1545
|
-
CollapseContext_default as CollapseContext,
|
|
1546
|
-
CollapseTrigger_default as CollapseTrigger,
|
|
1547
|
-
DrawerContext,
|
|
1548
|
-
DrawerContextProvider,
|
|
1549
|
-
DropEnumList,
|
|
1550
|
-
GlobalProvider,
|
|
1551
|
-
HistoryContext,
|
|
1552
|
-
HistoryContextProvider,
|
|
1553
|
-
ItemLinkSidebar,
|
|
1554
|
-
ItemSidebar,
|
|
1555
|
-
LoaderGrid,
|
|
1556
|
-
Main,
|
|
1557
|
-
Menu_default as Menu,
|
|
1558
|
-
MenuContext_default as MenuContext,
|
|
1559
|
-
MenuGroup_default as MenuGroup,
|
|
1560
|
-
MenuItem_default as MenuItem,
|
|
1561
|
-
MenuItem2 as MenuItems,
|
|
1562
|
-
MenuOptions,
|
|
1563
|
-
MenuSubmenu_default as MenuSubmenu,
|
|
1564
|
-
MenuTitle,
|
|
1565
|
-
MenuValueContext_default as MenuValueContext,
|
|
1566
|
-
NavOptions,
|
|
1567
|
-
Navbar,
|
|
1568
|
-
SidebarMainContext,
|
|
1569
|
-
SidebarMainContextProvider,
|
|
1570
|
-
SidebarNavigation,
|
|
1571
|
-
Tab,
|
|
1572
|
-
Tabs,
|
|
1573
|
-
Title,
|
|
1574
|
-
getOpenValuesByPathname,
|
|
1575
|
-
useCollapse,
|
|
1576
|
-
useLocalStorage,
|
|
1577
|
-
useMenu,
|
|
1578
|
-
useMenuItemValue,
|
|
1579
|
-
usePrevious,
|
|
1580
|
-
useStep
|
|
1581
|
-
};
|