@unifiedsoftware/react-ui 1.0.7 → 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 +162 -220
- package/dist/index.js +221 -939
- package/package.json +5 -14
- package/dist/index.d.mts +0 -391
- package/dist/index.mjs +0 -1758
package/dist/index.js
CHANGED
|
@@ -59,48 +59,22 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
59
59
|
// src/index.ts
|
|
60
60
|
var src_exports = {};
|
|
61
61
|
__export(src_exports, {
|
|
62
|
-
AppBreadCrumb: () => AppBreadCrumb,
|
|
63
|
-
AppBreadCrumbNav: () => AppBreadCrumbNav,
|
|
64
|
-
AppLoader: () => AppLoader,
|
|
65
62
|
Badge: () => Badge_default,
|
|
66
|
-
BreadCrumbContext: () => BreadCrumbContext,
|
|
67
|
-
BreadCrumbContextProvider: () => BreadCrumbContextProvider,
|
|
68
|
-
BreadCrumbTitle: () => BreadCrumbTitle,
|
|
69
|
-
Breadcrumb: () => Breadcrumb,
|
|
70
63
|
Button: () => Button,
|
|
71
64
|
Chip: () => Chip_default,
|
|
72
|
-
CloseIcon: () => CloseIcon,
|
|
73
65
|
Collapse: () => Collapse_default,
|
|
74
66
|
CollapseContent: () => CollapseContent_default,
|
|
75
67
|
CollapseContext: () => CollapseContext_default,
|
|
76
68
|
CollapseTrigger: () => CollapseTrigger_default,
|
|
77
|
-
|
|
78
|
-
DrawerContextProvider: () => DrawerContextProvider,
|
|
79
|
-
DropEnumList: () => DropEnumList,
|
|
80
|
-
GlobalProvider: () => GlobalProvider,
|
|
81
|
-
HistoryContext: () => HistoryContext,
|
|
82
|
-
HistoryContextProvider: () => HistoryContextProvider,
|
|
83
|
-
ItemLinkSidebar: () => ItemLinkSidebar,
|
|
84
|
-
ItemSidebar: () => ItemSidebar,
|
|
85
|
-
LoaderGrid: () => LoaderGrid,
|
|
86
|
-
Main: () => Main,
|
|
69
|
+
Icon: () => Icon_default,
|
|
87
70
|
Menu: () => Menu_default,
|
|
88
71
|
MenuContext: () => MenuContext_default,
|
|
89
72
|
MenuGroup: () => MenuGroup_default,
|
|
90
73
|
MenuItem: () => MenuItem_default,
|
|
91
|
-
MenuItems: () => MenuItem2,
|
|
92
|
-
MenuOptions: () => MenuOptions,
|
|
93
74
|
MenuSubmenu: () => MenuSubmenu_default,
|
|
94
|
-
MenuTitle: () => MenuTitle,
|
|
95
75
|
MenuValueContext: () => MenuValueContext_default,
|
|
96
|
-
NavOptions: () => NavOptions,
|
|
97
|
-
Navbar: () => Navbar,
|
|
98
|
-
SidebarMainContext: () => SidebarMainContext,
|
|
99
|
-
SidebarMainContextProvider: () => SidebarMainContextProvider,
|
|
100
|
-
SidebarNavigation: () => SidebarNavigation,
|
|
101
76
|
Tab: () => Tab,
|
|
102
77
|
Tabs: () => Tabs,
|
|
103
|
-
Title: () => Title,
|
|
104
78
|
getOpenValuesByPathname: () => getOpenValuesByPathname,
|
|
105
79
|
useCollapse: () => useCollapse,
|
|
106
80
|
useLocalStorage: () => useLocalStorage,
|
|
@@ -137,15 +111,103 @@ var Badge_default = Badge;
|
|
|
137
111
|
|
|
138
112
|
// src/components/Button/Button.tsx
|
|
139
113
|
var import_clsx3 = __toESM(require("clsx"));
|
|
140
|
-
var
|
|
141
|
-
|
|
114
|
+
var import_react4 = require("react");
|
|
115
|
+
|
|
116
|
+
// ../../../node_modules/react-icons/lib/esm/iconBase.js
|
|
117
|
+
var import_react2 = __toESM(require("react"));
|
|
118
|
+
|
|
119
|
+
// ../../../node_modules/react-icons/lib/esm/iconContext.js
|
|
120
|
+
var import_react = __toESM(require("react"));
|
|
121
|
+
var DefaultContext = {
|
|
122
|
+
color: void 0,
|
|
123
|
+
size: void 0,
|
|
124
|
+
className: void 0,
|
|
125
|
+
style: void 0,
|
|
126
|
+
attr: void 0
|
|
127
|
+
};
|
|
128
|
+
var IconContext = import_react.default.createContext && import_react.default.createContext(DefaultContext);
|
|
129
|
+
|
|
130
|
+
// ../../../node_modules/react-icons/lib/esm/iconBase.js
|
|
131
|
+
var __assign = function() {
|
|
132
|
+
__assign = Object.assign || function(t) {
|
|
133
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
134
|
+
s = arguments[i];
|
|
135
|
+
for (var p in s)
|
|
136
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
137
|
+
t[p] = s[p];
|
|
138
|
+
}
|
|
139
|
+
return t;
|
|
140
|
+
};
|
|
141
|
+
return __assign.apply(this, arguments);
|
|
142
|
+
};
|
|
143
|
+
var __rest = function(s, e) {
|
|
144
|
+
var t = {};
|
|
145
|
+
for (var p in s)
|
|
146
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
147
|
+
t[p] = s[p];
|
|
148
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
149
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
150
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
151
|
+
t[p[i]] = s[p[i]];
|
|
152
|
+
}
|
|
153
|
+
return t;
|
|
154
|
+
};
|
|
155
|
+
function Tree2Element(tree) {
|
|
156
|
+
return tree && tree.map(function(node, i) {
|
|
157
|
+
return import_react2.default.createElement(node.tag, __assign({
|
|
158
|
+
key: i
|
|
159
|
+
}, node.attr), Tree2Element(node.child));
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
function GenIcon(data) {
|
|
163
|
+
return function(props) {
|
|
164
|
+
return import_react2.default.createElement(IconBase, __assign({
|
|
165
|
+
attr: __assign({}, data.attr)
|
|
166
|
+
}, props), Tree2Element(data.child));
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
function IconBase(props) {
|
|
170
|
+
var elem = function(conf) {
|
|
171
|
+
var attr = props.attr, size = props.size, title = props.title, svgProps = __rest(props, ["attr", "size", "title"]);
|
|
172
|
+
var computedSize = size || conf.size || "1em";
|
|
173
|
+
var className;
|
|
174
|
+
if (conf.className)
|
|
175
|
+
className = conf.className;
|
|
176
|
+
if (props.className)
|
|
177
|
+
className = (className ? className + " " : "") + props.className;
|
|
178
|
+
return import_react2.default.createElement("svg", __assign({
|
|
179
|
+
stroke: "currentColor",
|
|
180
|
+
fill: "currentColor",
|
|
181
|
+
strokeWidth: "0"
|
|
182
|
+
}, conf.attr, attr, svgProps, {
|
|
183
|
+
className,
|
|
184
|
+
style: __assign(__assign({
|
|
185
|
+
color: props.color || conf.color
|
|
186
|
+
}, conf.style), props.style),
|
|
187
|
+
height: computedSize,
|
|
188
|
+
width: computedSize,
|
|
189
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
190
|
+
}), title && import_react2.default.createElement("title", null, title), props.children);
|
|
191
|
+
};
|
|
192
|
+
return IconContext !== void 0 ? import_react2.default.createElement(IconContext.Consumer, null, function(conf) {
|
|
193
|
+
return elem(conf);
|
|
194
|
+
}) : elem(DefaultContext);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// ../../../node_modules/react-icons/tb/index.esm.js
|
|
198
|
+
function TbLoader2(props) {
|
|
199
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "strokeWidth": "2", "stroke": "currentColor", "fill": "none", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "path", "attr": { "stroke": "none", "d": "M0 0h24v24H0z", "fill": "none" } }, { "tag": "path", "attr": { "d": "M12 3a9 9 0 1 0 9 9" } }] })(props);
|
|
200
|
+
}
|
|
201
|
+
function TbX(props) {
|
|
202
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "strokeWidth": "2", "stroke": "currentColor", "fill": "none", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "path", "attr": { "stroke": "none", "d": "M0 0h24v24H0z", "fill": "none" } }, { "tag": "path", "attr": { "d": "M18 6l-12 12" } }, { "tag": "path", "attr": { "d": "M6 6l12 12" } }] })(props);
|
|
203
|
+
}
|
|
142
204
|
|
|
143
205
|
// src/components/Icon/Icon.tsx
|
|
144
206
|
var import_clsx2 = __toESM(require("clsx"));
|
|
145
|
-
var
|
|
146
|
-
var Icon = (0,
|
|
147
|
-
const child =
|
|
148
|
-
return (0,
|
|
207
|
+
var import_react3 = require("react");
|
|
208
|
+
var Icon = (0, import_react3.forwardRef)(({ children, size }, ref) => {
|
|
209
|
+
const child = import_react3.Children.only(children);
|
|
210
|
+
return (0, import_react3.cloneElement)(child, __spreadProps(__spreadValues({
|
|
149
211
|
ref
|
|
150
212
|
}, child.props), {
|
|
151
213
|
className: (0, import_clsx2.default)(`${PREFIX_CLS}icon`, { [`${PREFIX_CLS}font-size-${size}`]: size }, child.props.className)
|
|
@@ -155,7 +217,7 @@ var Icon_default = Icon;
|
|
|
155
217
|
|
|
156
218
|
// src/components/Button/Button.tsx
|
|
157
219
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
158
|
-
var Button = (0,
|
|
220
|
+
var Button = (0, import_react4.forwardRef)(
|
|
159
221
|
(_a, ref) => {
|
|
160
222
|
var _b = _a, {
|
|
161
223
|
as: Component = "button",
|
|
@@ -168,7 +230,8 @@ var Button = (0, import_react2.forwardRef)(
|
|
|
168
230
|
iconOnly,
|
|
169
231
|
startContent,
|
|
170
232
|
endContent,
|
|
171
|
-
loading
|
|
233
|
+
loading,
|
|
234
|
+
disabled
|
|
172
235
|
} = _b, rest = __objRest(_b, [
|
|
173
236
|
"as",
|
|
174
237
|
"children",
|
|
@@ -180,7 +243,8 @@ var Button = (0, import_react2.forwardRef)(
|
|
|
180
243
|
"iconOnly",
|
|
181
244
|
"startContent",
|
|
182
245
|
"endContent",
|
|
183
|
-
"loading"
|
|
246
|
+
"loading",
|
|
247
|
+
"disabled"
|
|
184
248
|
]);
|
|
185
249
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
186
250
|
Component,
|
|
@@ -192,16 +256,18 @@ var Button = (0, import_react2.forwardRef)(
|
|
|
192
256
|
[`${PREFIX_CLS}button--${variant}`]: variant,
|
|
193
257
|
[`${PREFIX_CLS}button--${color}`]: color,
|
|
194
258
|
[`${PREFIX_CLS}button--${size}`]: size,
|
|
195
|
-
[`${PREFIX_CLS}button--icon-only`]: iconOnly
|
|
259
|
+
[`${PREFIX_CLS}button--icon-only`]: iconOnly,
|
|
260
|
+
[`${PREFIX_CLS}button--disabled`]: disabled
|
|
196
261
|
},
|
|
197
262
|
className
|
|
198
263
|
),
|
|
199
|
-
role
|
|
264
|
+
role,
|
|
265
|
+
disabled
|
|
200
266
|
}, rest), {
|
|
201
267
|
children: [
|
|
202
268
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: `${PREFIX_CLS}overlay` }),
|
|
203
269
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: `${PREFIX_CLS}outline` }),
|
|
204
|
-
loading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Icon_default, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
270
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Icon_default, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TbLoader2, { className: `${PREFIX_CLS}animation-spin` }) }) : startContent,
|
|
205
271
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: `${PREFIX_CLS}button__content`, children }),
|
|
206
272
|
endContent
|
|
207
273
|
]
|
|
@@ -212,9 +278,9 @@ var Button = (0, import_react2.forwardRef)(
|
|
|
212
278
|
|
|
213
279
|
// src/components/Chip/Chip.tsx
|
|
214
280
|
var import_clsx4 = __toESM(require("clsx"));
|
|
215
|
-
var
|
|
281
|
+
var import_react5 = require("react");
|
|
216
282
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
217
|
-
var Chip = (0,
|
|
283
|
+
var Chip = (0, import_react5.forwardRef)(
|
|
218
284
|
(_a, ref) => {
|
|
219
285
|
var _b = _a, { as: Component = "div", children, className, variant, color, size } = _b, rest = __objRest(_b, ["as", "children", "className", "variant", "color", "size"]);
|
|
220
286
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
@@ -243,13 +309,13 @@ var Chip = (0, import_react3.forwardRef)(
|
|
|
243
309
|
var Chip_default = Chip;
|
|
244
310
|
|
|
245
311
|
// src/components/Collapse/Collapse.tsx
|
|
246
|
-
var
|
|
312
|
+
var import_react7 = require("react");
|
|
247
313
|
|
|
248
314
|
// src/components/Collapse/CollapseContext.tsx
|
|
249
|
-
var
|
|
250
|
-
var CollapseContext = (0,
|
|
315
|
+
var import_react6 = require("react");
|
|
316
|
+
var CollapseContext = (0, import_react6.createContext)(null);
|
|
251
317
|
var useCollapse = () => {
|
|
252
|
-
const context = (0,
|
|
318
|
+
const context = (0, import_react6.useContext)(CollapseContext);
|
|
253
319
|
if (!context) {
|
|
254
320
|
throw new Error("`useCollapse` must be used within a `<Collapse />`");
|
|
255
321
|
}
|
|
@@ -260,10 +326,10 @@ var CollapseContext_default = CollapseContext;
|
|
|
260
326
|
// src/components/Collapse/Collapse.tsx
|
|
261
327
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
262
328
|
var Collapse = ({ children, isOpen, onOpen, onClose, onToggle }) => {
|
|
263
|
-
const collapseRef = (0,
|
|
264
|
-
const [selfIsOpen, setSelfIsOpen] = (0,
|
|
265
|
-
const [heightAuto, setHeightAuto] = (0,
|
|
266
|
-
const [trigger, content] =
|
|
329
|
+
const collapseRef = (0, import_react7.useRef)(null);
|
|
330
|
+
const [selfIsOpen, setSelfIsOpen] = (0, import_react7.useState)(isOpen != null ? isOpen : false);
|
|
331
|
+
const [heightAuto, setHeightAuto] = (0, import_react7.useState)(false);
|
|
332
|
+
const [trigger, content] = import_react7.Children.toArray(children);
|
|
267
333
|
const handleOpen = () => {
|
|
268
334
|
setSelfIsOpen(true);
|
|
269
335
|
onOpen == null ? void 0 : onOpen();
|
|
@@ -276,7 +342,7 @@ var Collapse = ({ children, isOpen, onOpen, onClose, onToggle }) => {
|
|
|
276
342
|
setSelfIsOpen((prevState) => !prevState);
|
|
277
343
|
onToggle == null ? void 0 : onToggle();
|
|
278
344
|
};
|
|
279
|
-
(0,
|
|
345
|
+
(0, import_react7.useEffect)(() => {
|
|
280
346
|
if (isOpen !== void 0) {
|
|
281
347
|
setSelfIsOpen(isOpen);
|
|
282
348
|
}
|
|
@@ -310,12 +376,12 @@ var Collapse_default = Collapse;
|
|
|
310
376
|
|
|
311
377
|
// src/components/Collapse/CollapseContent.tsx
|
|
312
378
|
var import_clsx5 = __toESM(require("clsx"));
|
|
313
|
-
var
|
|
314
|
-
var CollapseContent = (0,
|
|
379
|
+
var import_react8 = require("react");
|
|
380
|
+
var CollapseContent = (0, import_react8.forwardRef)(({ children }, ref) => {
|
|
315
381
|
var _a, _b;
|
|
316
382
|
const { collapseRef, isOpen, heightAuto } = useCollapse();
|
|
317
|
-
const child =
|
|
318
|
-
return (0,
|
|
383
|
+
const child = import_react8.Children.only(children);
|
|
384
|
+
return (0, import_react8.cloneElement)(child, __spreadProps(__spreadValues({}, child.props), {
|
|
319
385
|
ref: (node) => {
|
|
320
386
|
collapseRef.current = node;
|
|
321
387
|
if (ref !== null) {
|
|
@@ -331,11 +397,11 @@ var CollapseContent = (0, import_react6.forwardRef)(({ children }, ref) => {
|
|
|
331
397
|
var CollapseContent_default = CollapseContent;
|
|
332
398
|
|
|
333
399
|
// src/components/Collapse/CollapseTrigger.tsx
|
|
334
|
-
var
|
|
335
|
-
var CollapseTrigger = (0,
|
|
400
|
+
var import_react9 = require("react");
|
|
401
|
+
var CollapseTrigger = (0, import_react9.forwardRef)(({ children }, ref) => {
|
|
336
402
|
const { collapseRef, onToggle } = useCollapse();
|
|
337
|
-
const child =
|
|
338
|
-
return (0,
|
|
403
|
+
const child = import_react9.Children.only(children);
|
|
404
|
+
return (0, import_react9.cloneElement)(child, __spreadValues({
|
|
339
405
|
ref,
|
|
340
406
|
onClick: (event) => {
|
|
341
407
|
var _a, _b;
|
|
@@ -351,13 +417,13 @@ var CollapseTrigger_default = CollapseTrigger;
|
|
|
351
417
|
|
|
352
418
|
// src/components/Menu/Menu.tsx
|
|
353
419
|
var import_clsx9 = __toESM(require("clsx"));
|
|
354
|
-
var
|
|
420
|
+
var import_react15 = require("react");
|
|
355
421
|
|
|
356
422
|
// src/components/Menu/MenuContext.tsx
|
|
357
|
-
var
|
|
358
|
-
var MenuContext = (0,
|
|
423
|
+
var import_react10 = require("react");
|
|
424
|
+
var MenuContext = (0, import_react10.createContext)(null);
|
|
359
425
|
var useMenu = () => {
|
|
360
|
-
const context = (0,
|
|
426
|
+
const context = (0, import_react10.useContext)(MenuContext);
|
|
361
427
|
if (!context) {
|
|
362
428
|
throw new Error("`useMenu` must be used within a `<Menu />`");
|
|
363
429
|
}
|
|
@@ -367,17 +433,17 @@ var MenuContext_default = MenuContext;
|
|
|
367
433
|
|
|
368
434
|
// src/components/Menu/MenuGroup.tsx
|
|
369
435
|
var import_clsx8 = __toESM(require("clsx"));
|
|
370
|
-
var
|
|
436
|
+
var import_react14 = require("react");
|
|
371
437
|
|
|
372
438
|
// src/components/Menu/MenuItem.tsx
|
|
373
439
|
var import_clsx6 = __toESM(require("clsx"));
|
|
374
|
-
var
|
|
440
|
+
var import_react12 = require("react");
|
|
375
441
|
|
|
376
442
|
// src/components/Menu/MenuValueContext.tsx
|
|
377
|
-
var
|
|
378
|
-
var MenuValueContext = (0,
|
|
443
|
+
var import_react11 = require("react");
|
|
444
|
+
var MenuValueContext = (0, import_react11.createContext)([]);
|
|
379
445
|
var useMenuItemValue = () => {
|
|
380
|
-
const context = (0,
|
|
446
|
+
const context = (0, import_react11.useContext)(MenuValueContext);
|
|
381
447
|
if (!context) {
|
|
382
448
|
throw new Error("`useMenuValue` must be used within a `<MenuValueContext.Provider />`");
|
|
383
449
|
}
|
|
@@ -387,10 +453,10 @@ var MenuValueContext_default = MenuValueContext;
|
|
|
387
453
|
|
|
388
454
|
// src/components/Menu/MenuItem.tsx
|
|
389
455
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
390
|
-
var MenuItem = (0,
|
|
456
|
+
var MenuItem = (0, import_react12.forwardRef)((props, ref) => {
|
|
391
457
|
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"]);
|
|
392
458
|
const { value: menuValue, originalValue, openMode, onChange, onOpen, onItemSelect } = useMenu();
|
|
393
|
-
const values = (0,
|
|
459
|
+
const values = (0, import_react12.useContext)(MenuValueContext_default);
|
|
394
460
|
const mergedValues = [...values, value];
|
|
395
461
|
const handleClick = (event) => {
|
|
396
462
|
if (value !== void 0) {
|
|
@@ -399,7 +465,7 @@ var MenuItem = (0, import_react10.forwardRef)((props, ref) => {
|
|
|
399
465
|
onClick == null ? void 0 : onClick(event);
|
|
400
466
|
onItemSelect == null ? void 0 : onItemSelect(props);
|
|
401
467
|
};
|
|
402
|
-
(0,
|
|
468
|
+
(0, import_react12.useEffect)(() => {
|
|
403
469
|
if (openMode === "automatic" && originalValue.length > 0 && originalValue[originalValue.length - 1] === value) {
|
|
404
470
|
onOpen(values);
|
|
405
471
|
onChange(mergedValues);
|
|
@@ -435,8 +501,15 @@ var MenuItem_default = MenuItem;
|
|
|
435
501
|
|
|
436
502
|
// src/components/Menu/MenuSubmenu.tsx
|
|
437
503
|
var import_clsx7 = __toESM(require("clsx"));
|
|
438
|
-
var
|
|
439
|
-
|
|
504
|
+
var import_react13 = require("react");
|
|
505
|
+
|
|
506
|
+
// ../../../node_modules/react-icons/md/index.esm.js
|
|
507
|
+
function MdKeyboardArrowDown(props) {
|
|
508
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" } }, { "tag": "path", "attr": { "d": "M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z" } }] })(props);
|
|
509
|
+
}
|
|
510
|
+
function MdKeyboardArrowUp(props) {
|
|
511
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0z" } }, { "tag": "path", "attr": { "d": "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z" } }] })(props);
|
|
512
|
+
}
|
|
440
513
|
|
|
441
514
|
// src/components/Menu/utils.ts
|
|
442
515
|
var getOpenValuesByPathname = (pathname) => {
|
|
@@ -485,18 +558,18 @@ var MenuSubmenu = (_a) => {
|
|
|
485
558
|
"items",
|
|
486
559
|
"onClick"
|
|
487
560
|
]);
|
|
488
|
-
const { value: menuValue, openValues,
|
|
489
|
-
const values = (0,
|
|
561
|
+
const { value: menuValue, openValues, navMode, onOpen } = useMenu();
|
|
562
|
+
const values = (0, import_react13.useContext)(MenuValueContext_default);
|
|
490
563
|
const isOpen = openValues.includes(value);
|
|
491
564
|
const mergedValues = [...values, value];
|
|
492
|
-
const content = (0,
|
|
565
|
+
const content = (0, import_react13.useMemo)(() => {
|
|
493
566
|
return items == null ? void 0 : items.map((_a2, index) => {
|
|
494
567
|
var _b2 = _a2, { type } = _b2, item = __objRest(_b2, ["type"]);
|
|
495
568
|
return type === "item" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MenuItem_default, __spreadValues({ level: level !== void 0 ? level + 1 : void 0 }, item), index) : type === "submenu" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MenuSubmenu, __spreadValues({ level: level !== void 0 ? level + 1 : void 0 }, item), index) : type === "group" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MenuGroup_default, __spreadValues({ level: level !== void 0 ? level + 1 : void 0 }, item), index) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MenuItem_default, __spreadValues({ level: level !== void 0 ? level + 1 : void 0 }, item), index);
|
|
496
569
|
});
|
|
497
570
|
}, [items]);
|
|
498
571
|
const handleClick = (event) => {
|
|
499
|
-
if (
|
|
572
|
+
if (navMode === "multiple") {
|
|
500
573
|
const updatedOpenValues = addOrRemoveValueInArray(openValues, value);
|
|
501
574
|
onOpen(updatedOpenValues);
|
|
502
575
|
} else {
|
|
@@ -530,7 +603,7 @@ var MenuSubmenu = (_a) => {
|
|
|
530
603
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: `${PREFIX_CLS}overlay`, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: `${PREFIX_CLS}overlay__surface` }) }),
|
|
531
604
|
icon && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: `${PREFIX_CLS}menu-item__icon`, children: icon }),
|
|
532
605
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: `${PREFIX_CLS}menu-item__content`, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: `${PREFIX_CLS}menu-item__title`, children: title }) }),
|
|
533
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: `${PREFIX_CLS}menu-item__icon`, children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
606
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: `${PREFIX_CLS}menu-item__icon`, children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MdKeyboardArrowUp, { className: `${PREFIX_CLS}icon` }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MdKeyboardArrowDown, { className: `${PREFIX_CLS}icon` }) })
|
|
534
607
|
]
|
|
535
608
|
})
|
|
536
609
|
) }),
|
|
@@ -567,7 +640,7 @@ var MenuGroup = (_a) => {
|
|
|
567
640
|
"level",
|
|
568
641
|
"items"
|
|
569
642
|
]);
|
|
570
|
-
const content = (0,
|
|
643
|
+
const content = (0, import_react14.useMemo)(() => {
|
|
571
644
|
return items == null ? void 0 : items.map((_a2, index) => {
|
|
572
645
|
var _b2 = _a2, { type } = _b2, item = __objRest(_b2, ["type"]);
|
|
573
646
|
return type === "item" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MenuItem_default, __spreadValues({}, item), index) : type === "submenu" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MenuSubmenu_default, __spreadValues({}, item), index) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MenuItem_default, __spreadValues({}, item), index);
|
|
@@ -601,7 +674,7 @@ var Menu = (_a) => {
|
|
|
601
674
|
value: valueProp = [],
|
|
602
675
|
defaultValue,
|
|
603
676
|
openValues: openValuesProp,
|
|
604
|
-
|
|
677
|
+
navMode = "multiple",
|
|
605
678
|
openMode = "manual",
|
|
606
679
|
items,
|
|
607
680
|
onChange,
|
|
@@ -612,7 +685,7 @@ var Menu = (_a) => {
|
|
|
612
685
|
"value",
|
|
613
686
|
"defaultValue",
|
|
614
687
|
"openValues",
|
|
615
|
-
"
|
|
688
|
+
"navMode",
|
|
616
689
|
"openMode",
|
|
617
690
|
"items",
|
|
618
691
|
"onChange",
|
|
@@ -620,9 +693,9 @@ var Menu = (_a) => {
|
|
|
620
693
|
"onItemSelect"
|
|
621
694
|
]);
|
|
622
695
|
var _a2;
|
|
623
|
-
const [selfValue, setSelfValue] = (0,
|
|
624
|
-
const [selfOpenValues, setSelfOpenValues] = (0,
|
|
625
|
-
const content = (0,
|
|
696
|
+
const [selfValue, setSelfValue] = (0, import_react15.useState)((_a2 = valueProp != null ? valueProp : defaultValue) != null ? _a2 : []);
|
|
697
|
+
const [selfOpenValues, setSelfOpenValues] = (0, import_react15.useState)(openValuesProp != null ? openValuesProp : []);
|
|
698
|
+
const content = (0, import_react15.useMemo)(() => {
|
|
626
699
|
return items == null ? void 0 : items.map((_a3, index) => {
|
|
627
700
|
var _b2 = _a3, { type } = _b2, item = __objRest(_b2, ["type"]);
|
|
628
701
|
return type === "item" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(MenuItem_default, __spreadValues({}, item), index) : type === "submenu" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(MenuSubmenu_default, __spreadValues({}, item), index) : type === "group" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(MenuGroup_default, __spreadValues({}, item), index) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(MenuItem_default, __spreadValues({}, item), index);
|
|
@@ -645,12 +718,12 @@ var Menu = (_a) => {
|
|
|
645
718
|
const handleItemSelect = (props) => {
|
|
646
719
|
onItemSelect == null ? void 0 : onItemSelect(props);
|
|
647
720
|
};
|
|
648
|
-
(0,
|
|
721
|
+
(0, import_react15.useEffect)(() => {
|
|
649
722
|
if (valueProp !== void 0 && openMode !== "automatic") {
|
|
650
723
|
setSelfValue(valueProp);
|
|
651
724
|
}
|
|
652
725
|
}, [valueProp]);
|
|
653
|
-
(0,
|
|
726
|
+
(0, import_react15.useEffect)(() => {
|
|
654
727
|
if (openValuesProp !== void 0) {
|
|
655
728
|
setSelfOpenValues(openValuesProp);
|
|
656
729
|
}
|
|
@@ -662,7 +735,7 @@ var Menu = (_a) => {
|
|
|
662
735
|
value: selfValue,
|
|
663
736
|
originalValue: valueProp,
|
|
664
737
|
openValues: selfOpenValues,
|
|
665
|
-
|
|
738
|
+
navMode,
|
|
666
739
|
openMode,
|
|
667
740
|
onOpen: handleOpen,
|
|
668
741
|
onChange: handleChange,
|
|
@@ -678,14 +751,13 @@ var Menu_default = Menu;
|
|
|
678
751
|
// src/components/Tabs/Tab.tsx
|
|
679
752
|
var import_clsx10 = __toESM(require("clsx"));
|
|
680
753
|
var import_merge_refs = __toESM(require("merge-refs"));
|
|
681
|
-
var
|
|
682
|
-
var import_tb2 = require("react-icons/tb");
|
|
754
|
+
var import_react17 = require("react");
|
|
683
755
|
|
|
684
756
|
// src/components/Tabs/TabsContext.ts
|
|
685
|
-
var
|
|
686
|
-
var TabsContext = (0,
|
|
757
|
+
var import_react16 = require("react");
|
|
758
|
+
var TabsContext = (0, import_react16.createContext)(null);
|
|
687
759
|
var useTabs = () => {
|
|
688
|
-
const context = (0,
|
|
760
|
+
const context = (0, import_react16.useContext)(TabsContext);
|
|
689
761
|
if (!context) {
|
|
690
762
|
throw new Error("`useTabs` must be used within a `<Tabs />`");
|
|
691
763
|
}
|
|
@@ -694,10 +766,30 @@ var useTabs = () => {
|
|
|
694
766
|
|
|
695
767
|
// src/components/Tabs/Tab.tsx
|
|
696
768
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
697
|
-
var Tab = (0,
|
|
769
|
+
var Tab = (0, import_react17.forwardRef)(
|
|
698
770
|
(_a, ref) => {
|
|
699
|
-
var _b = _a, {
|
|
700
|
-
|
|
771
|
+
var _b = _a, {
|
|
772
|
+
as: Component = "div",
|
|
773
|
+
children,
|
|
774
|
+
className,
|
|
775
|
+
role = "presentation",
|
|
776
|
+
value: valueProp,
|
|
777
|
+
closable,
|
|
778
|
+
disabled,
|
|
779
|
+
onClick
|
|
780
|
+
} = _b, rest = __objRest(_b, [
|
|
781
|
+
"as",
|
|
782
|
+
"children",
|
|
783
|
+
"className",
|
|
784
|
+
"role",
|
|
785
|
+
"value",
|
|
786
|
+
"closable",
|
|
787
|
+
"disabled",
|
|
788
|
+
"onClick"
|
|
789
|
+
]);
|
|
790
|
+
const tabRef = (0, import_react17.useRef)(null);
|
|
791
|
+
const id = (0, import_react17.useId)();
|
|
792
|
+
const value = valueProp != null ? valueProp : id;
|
|
701
793
|
const _a2 = useTabs(), { onClose, registerItem } = _a2, tabs = __objRest(_a2, ["onClose", "registerItem"]);
|
|
702
794
|
const handleClick = (event) => {
|
|
703
795
|
const previousTab = tabs.previousTabRef.current;
|
|
@@ -737,7 +829,7 @@ var Tab = (0, import_react15.forwardRef)(
|
|
|
737
829
|
event.stopPropagation();
|
|
738
830
|
onClose(value);
|
|
739
831
|
};
|
|
740
|
-
(0,
|
|
832
|
+
(0, import_react17.useEffect)(() => {
|
|
741
833
|
registerItem({ value, disabled });
|
|
742
834
|
if (value === tabs.value) {
|
|
743
835
|
tabs.previousTabRef.current = tabRef.current;
|
|
@@ -759,7 +851,7 @@ var Tab = (0, import_react15.forwardRef)(
|
|
|
759
851
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `${PREFIX_CLS}overlay`, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `${PREFIX_CLS}overlay__surface` }) }),
|
|
760
852
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: `${PREFIX_CLS}tab__content`, children: [
|
|
761
853
|
children,
|
|
762
|
-
closable && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Button, { variant: "text", color: "secondary", iconOnly: true, size: "xs", onClick: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon_default, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
854
|
+
closable && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Button, { variant: "text", color: "secondary", iconOnly: true, size: "xs", onClick: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon_default, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TbX, {}) }) })
|
|
763
855
|
] }),
|
|
764
856
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `${PREFIX_CLS}tab__indicator` })
|
|
765
857
|
]
|
|
@@ -770,7 +862,7 @@ var Tab = (0, import_react15.forwardRef)(
|
|
|
770
862
|
|
|
771
863
|
// src/components/Tabs/Tabs.tsx
|
|
772
864
|
var import_clsx11 = __toESM(require("clsx"));
|
|
773
|
-
var
|
|
865
|
+
var import_react18 = require("react");
|
|
774
866
|
|
|
775
867
|
// src/utils/scroll.ts
|
|
776
868
|
var scrollToItem = (parentElement, currentElement) => {
|
|
@@ -799,7 +891,6 @@ var scrollToItem = (parentElement, currentElement) => {
|
|
|
799
891
|
|
|
800
892
|
// src/components/Tabs/Tabs.tsx
|
|
801
893
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
802
|
-
var prefixCls = "us-";
|
|
803
894
|
var Tabs = (_a) => {
|
|
804
895
|
var _b = _a, {
|
|
805
896
|
children,
|
|
@@ -818,11 +909,11 @@ var Tabs = (_a) => {
|
|
|
818
909
|
"onChange",
|
|
819
910
|
"onClose"
|
|
820
911
|
]);
|
|
821
|
-
const tabsRef = (0,
|
|
822
|
-
const tabRefs = (0,
|
|
823
|
-
const previousTabRef = (0,
|
|
824
|
-
const [selfValue, setSelfValue] = (0,
|
|
825
|
-
const [items, setItems] = (0,
|
|
912
|
+
const tabsRef = (0, import_react18.useRef)(null);
|
|
913
|
+
const tabRefs = (0, import_react18.useRef)({});
|
|
914
|
+
const previousTabRef = (0, import_react18.useRef)(null);
|
|
915
|
+
const [selfValue, setSelfValue] = (0, import_react18.useState)(value != null ? value : defaultValue);
|
|
916
|
+
const [items, setItems] = (0, import_react18.useState)([]);
|
|
826
917
|
const registerItem = (item) => {
|
|
827
918
|
setItems((prevItems) => {
|
|
828
919
|
const index = prevItems.findIndex((item2) => item2.value);
|
|
@@ -849,13 +940,13 @@ var Tabs = (_a) => {
|
|
|
849
940
|
const handleClose = (value2) => {
|
|
850
941
|
onClose == null ? void 0 : onClose(value2);
|
|
851
942
|
};
|
|
852
|
-
(0,
|
|
943
|
+
(0, import_react18.useEffect)(() => {
|
|
853
944
|
if (value !== void 0) {
|
|
854
945
|
setSelfValue(value);
|
|
855
946
|
scrollToTab(value);
|
|
856
947
|
}
|
|
857
948
|
}, [value]);
|
|
858
|
-
(0,
|
|
949
|
+
(0, import_react18.useEffect)(() => {
|
|
859
950
|
if (value === void 0) {
|
|
860
951
|
const item = items.find((tab) => !tab.disabled);
|
|
861
952
|
setSelfValue(item == null ? void 0 : item.value);
|
|
@@ -870,113 +961,31 @@ var Tabs = (_a) => {
|
|
|
870
961
|
"div",
|
|
871
962
|
__spreadProps(__spreadValues({
|
|
872
963
|
ref: tabsRef,
|
|
873
|
-
className: (0, import_clsx11.default)(`${
|
|
964
|
+
className: (0, import_clsx11.default)(`${PREFIX_CLS}tabs`, { [`${PREFIX_CLS}tabs--${alignment}`]: alignment }, className)
|
|
874
965
|
}, rest), {
|
|
875
|
-
children
|
|
876
|
-
var _a2;
|
|
877
|
-
return !(0, import_react16.isValidElement)(child) ? null : (0, import_react16.cloneElement)(child, __spreadProps(__spreadValues({}, child.props), { value: (_a2 = child.props.value) != null ? _a2 : index }));
|
|
878
|
-
})
|
|
966
|
+
children
|
|
879
967
|
})
|
|
880
968
|
),
|
|
881
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `${
|
|
969
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `${PREFIX_CLS}divider` })
|
|
882
970
|
]
|
|
883
971
|
}
|
|
884
972
|
);
|
|
885
973
|
};
|
|
886
974
|
|
|
887
|
-
// src/components/DropdownEnumList.tsx
|
|
888
|
-
var import_kendo_react_dropdowns = require("@progress/kendo-react-dropdowns");
|
|
889
|
-
var import_react17 = require("react");
|
|
890
|
-
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
891
|
-
function parsearDataForComboBox(array, key, text, itemAll = false) {
|
|
892
|
-
const dataForComboBox = [];
|
|
893
|
-
if (itemAll)
|
|
894
|
-
dataForComboBox.push({ key: "", text: "ALL" });
|
|
895
|
-
if (array !== void 0) {
|
|
896
|
-
array.map((a) => {
|
|
897
|
-
dataForComboBox.push({ key: a[key], text: a[text] });
|
|
898
|
-
});
|
|
899
|
-
}
|
|
900
|
-
return dataForComboBox;
|
|
901
|
-
}
|
|
902
|
-
function GetEnumDescription(key, typeEnum, description) {
|
|
903
|
-
const listLabel = description.get(typeEnum);
|
|
904
|
-
let label = void 0;
|
|
905
|
-
if (listLabel != void 0)
|
|
906
|
-
label = listLabel.get(parseInt(key));
|
|
907
|
-
if (label == void 0) {
|
|
908
|
-
label = typeEnum[key];
|
|
909
|
-
return label.split("_").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
|
|
910
|
-
}
|
|
911
|
-
return label;
|
|
912
|
-
}
|
|
913
|
-
function EnumToArray(typeEnum, replaceGuionForSpace = true, description) {
|
|
914
|
-
const values = [];
|
|
915
|
-
for (const key in typeEnum) {
|
|
916
|
-
if (typeof typeEnum[key] === "string")
|
|
917
|
-
values.push({
|
|
918
|
-
value: Number(key),
|
|
919
|
-
label: replaceGuionForSpace ? GetEnumDescription(key, typeEnum, description) : typeEnum[key]
|
|
920
|
-
});
|
|
921
|
-
}
|
|
922
|
-
return values;
|
|
923
|
-
}
|
|
924
|
-
var DropEnumList = ({ dataEnum, description, onChange, width, defaultValue }) => {
|
|
925
|
-
const [value, setValue] = (0, import_react17.useState)("");
|
|
926
|
-
const [data, setData] = (0, import_react17.useState)([]);
|
|
927
|
-
(0, import_react17.useEffect)(() => {
|
|
928
|
-
setData(
|
|
929
|
-
parsearDataForComboBox(EnumToArray(dataEnum, true, description), "value", "label", false).sort(
|
|
930
|
-
(a, b) => Number(a.key) - Number(b.key)
|
|
931
|
-
)
|
|
932
|
-
);
|
|
933
|
-
}, []);
|
|
934
|
-
(0, import_react17.useEffect)(() => {
|
|
935
|
-
if (data.length > 0) {
|
|
936
|
-
setValue(data.filter((x) => x.key == defaultValue)[0]);
|
|
937
|
-
}
|
|
938
|
-
}, [data]);
|
|
939
|
-
const handleOptionClick = (e) => {
|
|
940
|
-
onChange(e);
|
|
941
|
-
setValue(e);
|
|
942
|
-
};
|
|
943
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_jsx_runtime11.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
944
|
-
import_kendo_react_dropdowns.DropDownList,
|
|
945
|
-
{
|
|
946
|
-
className: "d-inline-block align-middle mr-2",
|
|
947
|
-
data,
|
|
948
|
-
dataItemKey: "key",
|
|
949
|
-
id: "cmbDisplay",
|
|
950
|
-
name: "cmbDisplay",
|
|
951
|
-
onChange: (event) => {
|
|
952
|
-
handleOptionClick(event.value);
|
|
953
|
-
},
|
|
954
|
-
textField: "text",
|
|
955
|
-
style: {
|
|
956
|
-
width: `${width}px`
|
|
957
|
-
},
|
|
958
|
-
defaultValue: value
|
|
959
|
-
}
|
|
960
|
-
) });
|
|
961
|
-
};
|
|
962
|
-
|
|
963
|
-
// src/contexts/BreadCrumbContext.tsx
|
|
964
|
-
var import_react21 = require("react");
|
|
965
|
-
|
|
966
975
|
// src/hooks/useLocalStorage.tsx
|
|
967
|
-
var
|
|
976
|
+
var import_react21 = require("react");
|
|
968
977
|
|
|
969
978
|
// src/hooks/useEventListener.tsx
|
|
970
|
-
var
|
|
979
|
+
var import_react20 = require("react");
|
|
971
980
|
|
|
972
981
|
// src/hooks/useIsomorphicLayoutEffect.tsx
|
|
973
|
-
var
|
|
974
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
982
|
+
var import_react19 = require("react");
|
|
983
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? import_react19.useLayoutEffect : import_react19.useEffect;
|
|
975
984
|
var useIsomorphicLayoutEffect_default = useIsomorphicLayoutEffect;
|
|
976
985
|
|
|
977
986
|
// src/hooks/useEventListener.tsx
|
|
978
987
|
function useEventListener(handler) {
|
|
979
|
-
const savedHandler = (0,
|
|
988
|
+
const savedHandler = (0, import_react20.useRef)(handler);
|
|
980
989
|
useIsomorphicLayoutEffect_default(() => {
|
|
981
990
|
savedHandler.current = handler;
|
|
982
991
|
}, [handler]);
|
|
@@ -985,7 +994,7 @@ var useEventListener_default = useEventListener;
|
|
|
985
994
|
|
|
986
995
|
// src/hooks/useLocalStorage.tsx
|
|
987
996
|
function useLocalStorage(key, initialValue) {
|
|
988
|
-
const readValue = (0,
|
|
997
|
+
const readValue = (0, import_react21.useCallback)(() => {
|
|
989
998
|
if (typeof window === "undefined") {
|
|
990
999
|
return initialValue;
|
|
991
1000
|
}
|
|
@@ -997,8 +1006,8 @@ function useLocalStorage(key, initialValue) {
|
|
|
997
1006
|
return initialValue;
|
|
998
1007
|
}
|
|
999
1008
|
}, [initialValue, key]);
|
|
1000
|
-
const [storedValue, setStoredValue] = (0,
|
|
1001
|
-
const setValue = (0,
|
|
1009
|
+
const [storedValue, setStoredValue] = (0, import_react21.useState)(readValue);
|
|
1010
|
+
const setValue = (0, import_react21.useCallback)(
|
|
1002
1011
|
(value) => {
|
|
1003
1012
|
if (typeof window == "undefined") {
|
|
1004
1013
|
console.warn(`Tried setting localStorage key \u201C${key}\u201D even though environment is not a client`);
|
|
@@ -1014,10 +1023,10 @@ function useLocalStorage(key, initialValue) {
|
|
|
1014
1023
|
},
|
|
1015
1024
|
[key, storedValue]
|
|
1016
1025
|
);
|
|
1017
|
-
(0,
|
|
1026
|
+
(0, import_react21.useEffect)(() => {
|
|
1018
1027
|
setStoredValue(readValue());
|
|
1019
1028
|
}, []);
|
|
1020
|
-
const handleStorageChange = (0,
|
|
1029
|
+
const handleStorageChange = (0, import_react21.useCallback)(() => {
|
|
1021
1030
|
setStoredValue(readValue());
|
|
1022
1031
|
}, [readValue]);
|
|
1023
1032
|
useEventListener_default("storage", handleStorageChange);
|
|
@@ -1033,94 +1042,23 @@ function parseJSON(value) {
|
|
|
1033
1042
|
}
|
|
1034
1043
|
}
|
|
1035
1044
|
|
|
1036
|
-
// src/contexts/BreadCrumbContext.tsx
|
|
1037
|
-
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1038
|
-
var BreadCrumbContext = (0, import_react21.createContext)({});
|
|
1039
|
-
var BreadCrumbContextProvider = ({ children }) => {
|
|
1040
|
-
const [active, setActive] = useLocalStorage("@active", "");
|
|
1041
|
-
const [path, setPath] = useLocalStorage("@path", "/");
|
|
1042
|
-
const [goBack, setGoBack] = useLocalStorage("@goBack", false);
|
|
1043
|
-
const [pathChild, setPathChild] = useLocalStorage("@pathChild", "");
|
|
1044
|
-
const [routes, setRoutes] = (0, import_react21.useState)([]);
|
|
1045
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1046
|
-
BreadCrumbContext.Provider,
|
|
1047
|
-
{
|
|
1048
|
-
value: {
|
|
1049
|
-
active,
|
|
1050
|
-
setActive,
|
|
1051
|
-
path,
|
|
1052
|
-
setPath,
|
|
1053
|
-
goBack,
|
|
1054
|
-
setGoBack,
|
|
1055
|
-
pathChild,
|
|
1056
|
-
setPathChild,
|
|
1057
|
-
routes,
|
|
1058
|
-
setRoutes
|
|
1059
|
-
},
|
|
1060
|
-
children
|
|
1061
|
-
}
|
|
1062
|
-
);
|
|
1063
|
-
};
|
|
1064
|
-
|
|
1065
|
-
// src/contexts/DrawerContext.tsx
|
|
1066
|
-
var import_react22 = require("react");
|
|
1067
|
-
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1068
|
-
var DrawerContext = (0, import_react22.createContext)({});
|
|
1069
|
-
var DrawerContextProvider = ({ children }) => {
|
|
1070
|
-
const [active, setActive] = (0, import_react22.useState)(false);
|
|
1071
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DrawerContext.Provider, { value: { active, setActive }, children });
|
|
1072
|
-
};
|
|
1073
|
-
|
|
1074
|
-
// src/contexts/HistoryContext.tsx
|
|
1075
|
-
var import_react23 = require("react");
|
|
1076
|
-
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1077
|
-
var HistoryContext = (0, import_react23.createContext)({});
|
|
1078
|
-
var HistoryContextProvider = ({ children }) => {
|
|
1079
|
-
const [list, setList] = useLocalStorage("@list_paths", []);
|
|
1080
|
-
const updateList = (value) => {
|
|
1081
|
-
setList(
|
|
1082
|
-
(prev) => prev.concat({
|
|
1083
|
-
path: value.path,
|
|
1084
|
-
name: value.name,
|
|
1085
|
-
date: /* @__PURE__ */ new Date()
|
|
1086
|
-
})
|
|
1087
|
-
);
|
|
1088
|
-
};
|
|
1089
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(HistoryContext.Provider, { value: { list, updateList }, children });
|
|
1090
|
-
};
|
|
1091
|
-
|
|
1092
|
-
// src/contexts/SidebarMainContext.tsx
|
|
1093
|
-
var import_react24 = require("react");
|
|
1094
|
-
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1095
|
-
var SidebarMainContext = (0, import_react24.createContext)({});
|
|
1096
|
-
var SidebarMainContextProvider = ({ children }) => {
|
|
1097
|
-
const [open2, setOpen] = (0, import_react24.useState)(true);
|
|
1098
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SidebarMainContext.Provider, { value: { open: open2, setOpen }, children });
|
|
1099
|
-
};
|
|
1100
|
-
|
|
1101
|
-
// src/contexts/GlobalProvider.tsx
|
|
1102
|
-
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1103
|
-
function GlobalProvider({ children }) {
|
|
1104
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(HistoryContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(BreadCrumbContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SidebarMainContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DrawerContextProvider, { children }) }) }) });
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1107
1045
|
// src/hooks/usePrevious.tsx
|
|
1108
|
-
var
|
|
1046
|
+
var import_react22 = require("react");
|
|
1109
1047
|
var usePrevious = (value) => {
|
|
1110
|
-
const ref = (0,
|
|
1111
|
-
(0,
|
|
1048
|
+
const ref = (0, import_react22.useRef)();
|
|
1049
|
+
(0, import_react22.useEffect)(() => {
|
|
1112
1050
|
ref.current = value;
|
|
1113
1051
|
});
|
|
1114
1052
|
return ref.current;
|
|
1115
1053
|
};
|
|
1116
1054
|
|
|
1117
1055
|
// src/hooks/useStep.tsx
|
|
1118
|
-
var
|
|
1056
|
+
var import_react23 = require("react");
|
|
1119
1057
|
var useStep = (maxStep) => {
|
|
1120
|
-
const [currentStep, setCurrentStep] = (0,
|
|
1121
|
-
const canGoToNextStep = (0,
|
|
1122
|
-
const canGoToPrevStep = (0,
|
|
1123
|
-
const setStep = (0,
|
|
1058
|
+
const [currentStep, setCurrentStep] = (0, import_react23.useState)(1);
|
|
1059
|
+
const canGoToNextStep = (0, import_react23.useMemo)(() => currentStep + 1 <= maxStep, [currentStep, maxStep]);
|
|
1060
|
+
const canGoToPrevStep = (0, import_react23.useMemo)(() => currentStep - 1 >= 1, [currentStep]);
|
|
1061
|
+
const setStep = (0, import_react23.useCallback)(
|
|
1124
1062
|
(step) => {
|
|
1125
1063
|
const newStep = step instanceof Function ? step(currentStep) : step;
|
|
1126
1064
|
if (newStep >= 1 && newStep <= maxStep) {
|
|
@@ -1131,17 +1069,17 @@ var useStep = (maxStep) => {
|
|
|
1131
1069
|
},
|
|
1132
1070
|
[maxStep, currentStep]
|
|
1133
1071
|
);
|
|
1134
|
-
const goToNextStep = (0,
|
|
1072
|
+
const goToNextStep = (0, import_react23.useCallback)(() => {
|
|
1135
1073
|
if (canGoToNextStep) {
|
|
1136
1074
|
setCurrentStep((step) => step + 1);
|
|
1137
1075
|
}
|
|
1138
1076
|
}, [canGoToNextStep]);
|
|
1139
|
-
const goToPrevStep = (0,
|
|
1077
|
+
const goToPrevStep = (0, import_react23.useCallback)(() => {
|
|
1140
1078
|
if (canGoToPrevStep) {
|
|
1141
1079
|
setCurrentStep((step) => step - 1);
|
|
1142
1080
|
}
|
|
1143
1081
|
}, [canGoToPrevStep]);
|
|
1144
|
-
const reset = (0,
|
|
1082
|
+
const reset = (0, import_react23.useCallback)(() => {
|
|
1145
1083
|
setCurrentStep(1);
|
|
1146
1084
|
}, []);
|
|
1147
1085
|
return [
|
|
@@ -1156,680 +1094,24 @@ var useStep = (maxStep) => {
|
|
|
1156
1094
|
}
|
|
1157
1095
|
];
|
|
1158
1096
|
};
|
|
1159
|
-
|
|
1160
|
-
// src/layout/AppBreadcrumb.tsx
|
|
1161
|
-
var import_react27 = require("react");
|
|
1162
|
-
var import_md2 = require("react-icons/md");
|
|
1163
|
-
var import_vsc = require("react-icons/vsc");
|
|
1164
|
-
var import_react_router_dom3 = require("react-router-dom");
|
|
1165
|
-
|
|
1166
|
-
// src/styled-components/breadcrumb.ts
|
|
1167
|
-
var import_styled_components = __toESM(require("styled-components"));
|
|
1168
|
-
var Breadcrumb = import_styled_components.default.div`
|
|
1169
|
-
font-family: 'Inter', sans-serif;
|
|
1170
|
-
padding: 10px 0px;
|
|
1171
|
-
text-transform: uppercase;
|
|
1172
|
-
font-weight: bold;
|
|
1173
|
-
font-size: 0.9rem;
|
|
1174
|
-
color: #92190e;
|
|
1175
|
-
display: flex;
|
|
1176
|
-
justify-content: space-between;
|
|
1177
|
-
align-items: center;
|
|
1178
|
-
background-color: white;
|
|
1179
|
-
align-items: center;
|
|
1180
|
-
|
|
1181
|
-
.link {
|
|
1182
|
-
color: #92190e;
|
|
1183
|
-
&:hover {
|
|
1184
|
-
color: #92190e;
|
|
1185
|
-
cursor: pointer;
|
|
1186
|
-
}
|
|
1187
|
-
}
|
|
1188
|
-
`;
|
|
1189
|
-
var BreadCrumbTitle = import_styled_components.default.div`
|
|
1190
|
-
font-family: 'Inter', sans-serif;
|
|
1191
|
-
font-weight: bold;
|
|
1192
|
-
font-size: 1.2rem !important;
|
|
1193
|
-
color: #92190e;
|
|
1194
|
-
margin-top: 15px;
|
|
1195
|
-
`;
|
|
1196
|
-
var TitlePage = import_styled_components.default.div`
|
|
1197
|
-
font-family: 'Inter', sans-serif;
|
|
1198
|
-
font-weight: bold;
|
|
1199
|
-
font-size: 1.2rem !important;
|
|
1200
|
-
color: #92190e;
|
|
1201
|
-
margin-top: 15px;
|
|
1202
|
-
`;
|
|
1203
|
-
|
|
1204
|
-
// src/styled-components/menu.ts
|
|
1205
|
-
var import_react_router_dom = require("react-router-dom");
|
|
1206
|
-
var import_styled_components2 = __toESM(require("styled-components"));
|
|
1207
|
-
var MenuItem2 = (0, import_styled_components2.default)(import_react_router_dom.Link)`
|
|
1208
|
-
text-decoration: none;
|
|
1209
|
-
color: black;
|
|
1210
|
-
display: flex;
|
|
1211
|
-
justify-content: ${(props) => props.type === "col" ? "center" : "flex-start"};
|
|
1212
|
-
align-items: center;
|
|
1213
|
-
flex-direction: ${(props) => props.type === "col" ? "column" : "row"};
|
|
1214
|
-
border: 1px solid transparent;
|
|
1215
|
-
width: ${(props) => props.width ? props.width : "100px"};
|
|
1216
|
-
padding: 10px;
|
|
1217
|
-
text-decoration: none !important;
|
|
1218
|
-
&:hover {
|
|
1219
|
-
box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
|
|
1220
|
-
}
|
|
1221
|
-
|
|
1222
|
-
.icon {
|
|
1223
|
-
width: 30px;
|
|
1224
|
-
text-decoration: none;
|
|
1225
|
-
}
|
|
1226
|
-
.text {
|
|
1227
|
-
text-align: center;
|
|
1228
|
-
font-size: 12px;
|
|
1229
|
-
text-decoration: none !important;
|
|
1230
|
-
color: black;
|
|
1231
|
-
margin-top: ${(props) => props.type === "col" ? "0px" : "15px"};
|
|
1232
|
-
&:hover {
|
|
1233
|
-
text-decoration: none !important;
|
|
1234
|
-
}
|
|
1235
|
-
}
|
|
1236
|
-
`;
|
|
1237
|
-
var MenuTitle = import_styled_components2.default.p`
|
|
1238
|
-
font-size: 16px;
|
|
1239
|
-
font-weight: bold !important;
|
|
1240
|
-
`;
|
|
1241
|
-
|
|
1242
|
-
// src/styled-components/navbar.ts
|
|
1243
|
-
var import_styled_components3 = __toESM(require("styled-components"));
|
|
1244
|
-
var Navbar = import_styled_components3.default.nav`
|
|
1245
|
-
background: ${(props) => {
|
|
1246
|
-
return !props.gradient ? ` linear-gradient( 90.03deg, #92190e 80.71%, #f0b92c 107.21% ) !important` : `#92190e`;
|
|
1247
|
-
}};
|
|
1248
|
-
z-index: 10;
|
|
1249
|
-
width: 100%;
|
|
1250
|
-
max-width: 100vw;
|
|
1251
|
-
display: flex;
|
|
1252
|
-
justify-content: space-between;
|
|
1253
|
-
padding-top: 10px;
|
|
1254
|
-
padding-bottom: 10px;
|
|
1255
|
-
position: sticky;
|
|
1256
|
-
top: 0px;
|
|
1257
|
-
height: 40px;
|
|
1258
|
-
.input {
|
|
1259
|
-
border-radius: 2px !important;
|
|
1260
|
-
padding: 2px !important;
|
|
1261
|
-
font-size: 12px !important;
|
|
1262
|
-
height: 20px !important;
|
|
1263
|
-
border: none;
|
|
1264
|
-
&:focus {
|
|
1265
|
-
outline: none !important;
|
|
1266
|
-
}
|
|
1267
|
-
::placeholder {
|
|
1268
|
-
color: #92190e;
|
|
1269
|
-
}
|
|
1270
|
-
@media (max-width: 470px) {
|
|
1271
|
-
display: none;
|
|
1272
|
-
}
|
|
1273
|
-
}
|
|
1274
|
-
.dialog {
|
|
1275
|
-
z-index: 20000 !important;
|
|
1276
|
-
position: absolute;
|
|
1277
|
-
width: 400px;
|
|
1278
|
-
height: 500px;
|
|
1279
|
-
min-height: 500px;
|
|
1280
|
-
overflow: scroll;
|
|
1281
|
-
overflow-x: hidden;
|
|
1282
|
-
min-width: 400px;
|
|
1283
|
-
max-width: 400px;
|
|
1284
|
-
background-color: white;
|
|
1285
|
-
border-radius: 20px;
|
|
1286
|
-
top: 50%;
|
|
1287
|
-
left: 50%;
|
|
1288
|
-
transform: translate(-50%, -50%);
|
|
1289
|
-
}
|
|
1290
|
-
`;
|
|
1291
|
-
|
|
1292
|
-
// src/styled-components/options.ts
|
|
1293
|
-
var import_styled_components4 = __toESM(require("styled-components"));
|
|
1294
|
-
var MenuOptions = import_styled_components4.default.div`
|
|
1295
|
-
font-size: bold;
|
|
1296
|
-
display: flex;
|
|
1297
|
-
width: 100%;
|
|
1298
|
-
gap: 10px;
|
|
1299
|
-
justify-content: flex-start;
|
|
1300
|
-
border-bottom: 1px solid #e6e6e6;
|
|
1301
|
-
background-color: white;
|
|
1302
|
-
flex-wrap: wrap;
|
|
1303
|
-
.button-option {
|
|
1304
|
-
display: flex;
|
|
1305
|
-
flex-direction: row;
|
|
1306
|
-
justify-content: space-between;
|
|
1307
|
-
align-items: center;
|
|
1308
|
-
gap: 5px;
|
|
1309
|
-
padding: 10px 20px;
|
|
1310
|
-
font-weight: bold;
|
|
1311
|
-
background-color: white !important;
|
|
1312
|
-
border: none;
|
|
1313
|
-
.icon {
|
|
1314
|
-
color: #92190e;
|
|
1315
|
-
}
|
|
1316
|
-
.text {
|
|
1317
|
-
@media (max-width: 470px) {
|
|
1318
|
-
display: none;
|
|
1319
|
-
}
|
|
1320
|
-
}
|
|
1321
|
-
}
|
|
1322
|
-
`;
|
|
1323
|
-
|
|
1324
|
-
// src/styled-components/sidebar.ts
|
|
1325
|
-
var import_react_router_dom2 = require("react-router-dom");
|
|
1326
|
-
var import_styled_components5 = __toESM(require("styled-components"));
|
|
1327
|
-
var ItemSidebar = import_styled_components5.default.div`
|
|
1328
|
-
padding: 10px 25px;
|
|
1329
|
-
display: flex;
|
|
1330
|
-
align-items: center;
|
|
1331
|
-
gap: 30px;
|
|
1332
|
-
font-family: 'Inter', sans-serif;
|
|
1333
|
-
&:hover {
|
|
1334
|
-
color: white !important;
|
|
1335
|
-
text-decoration: none;
|
|
1336
|
-
background: #92190e;
|
|
1337
|
-
.icon-sidebar {
|
|
1338
|
-
color: white !important;
|
|
1339
|
-
}
|
|
1340
|
-
}
|
|
1341
|
-
&:active {
|
|
1342
|
-
color: white !important;
|
|
1343
|
-
text-decoration: none;
|
|
1344
|
-
background: #92190e;
|
|
1345
|
-
.icon-sidebar {
|
|
1346
|
-
color: white !important;
|
|
1347
|
-
}
|
|
1348
|
-
}
|
|
1349
|
-
`;
|
|
1350
|
-
var SidebarNavigation = import_styled_components5.default.nav`
|
|
1351
|
-
position: ${({ fixed = true }) => fixed ? "fixed" : "static"};
|
|
1352
|
-
top: 0;
|
|
1353
|
-
left: 0;
|
|
1354
|
-
min-height: 100vh;
|
|
1355
|
-
box-shadow: 7px 0px 14px 1px rgba(145, 141, 141, 0.51);
|
|
1356
|
-
-webkit-box-shadow: 7px 0px 14px 1px rgba(145, 141, 141, 0.51);
|
|
1357
|
-
-moz-box-shadow: 7px 0px 14px 1px rgba(145, 141, 141, 0.51);
|
|
1358
|
-
background: white;
|
|
1359
|
-
font-family: 'Inter', sans-serif;
|
|
1360
|
-
padding: 0;
|
|
1361
|
-
width: ${({ fixed = true, active = true }) => fixed ? active ? "270px" : "0px" : "auto"};
|
|
1362
|
-
z-index: 11;
|
|
1363
|
-
transition: width 0.2s ease-in-out;
|
|
1364
|
-
|
|
1365
|
-
overflow: hidden;
|
|
1366
|
-
height: 100vh;
|
|
1367
|
-
overflow-y: auto;
|
|
1368
|
-
box-shadow: ${({ shadow = true }) => shadow ? "rgba(99, 99, 99, 0.2) 0px 2px 8px 0px" : "none"};
|
|
1369
|
-
|
|
1370
|
-
&::-webkit-scrollbar {
|
|
1371
|
-
display: none !important;
|
|
1372
|
-
}
|
|
1373
|
-
.nav {
|
|
1374
|
-
flex-wrap: nowrap;
|
|
1375
|
-
flex-direction: column;
|
|
1376
|
-
font-size: 12px;
|
|
1377
|
-
|
|
1378
|
-
.nav-item {
|
|
1379
|
-
.collapse {
|
|
1380
|
-
z-index: 999;
|
|
1381
|
-
}
|
|
1382
|
-
|
|
1383
|
-
.collapse.show,
|
|
1384
|
-
.collapsing {
|
|
1385
|
-
background: rgba(0, 0, 0);
|
|
1386
|
-
}
|
|
1387
|
-
|
|
1388
|
-
.nav-link {
|
|
1389
|
-
align-items: center;
|
|
1390
|
-
display: flex;
|
|
1391
|
-
padding-left: 40px;
|
|
1392
|
-
white-space: nowrap;
|
|
1393
|
-
|
|
1394
|
-
color: #92190e;
|
|
1395
|
-
i {
|
|
1396
|
-
margin-right: 20px;
|
|
1397
|
-
}
|
|
1398
|
-
.menu-title {
|
|
1399
|
-
color: inherit;
|
|
1400
|
-
display: inline-block;
|
|
1401
|
-
line-height: 1;
|
|
1402
|
-
color: black;
|
|
1403
|
-
vertical-align: middle;
|
|
1404
|
-
cursor: pointer;
|
|
1405
|
-
}
|
|
1406
|
-
}
|
|
1407
|
-
|
|
1408
|
-
&.active {
|
|
1409
|
-
> .nav-link {
|
|
1410
|
-
color: white;
|
|
1411
|
-
}
|
|
1412
|
-
|
|
1413
|
-
&.not-navigation-link {
|
|
1414
|
-
position: relative;
|
|
1415
|
-
}
|
|
1416
|
-
}
|
|
1417
|
-
|
|
1418
|
-
&:not(.sub-menu) {
|
|
1419
|
-
> .nav-item {
|
|
1420
|
-
&:hover {
|
|
1421
|
-
&:not(.nav-profile) {
|
|
1422
|
-
> .nav-link {
|
|
1423
|
-
background: $sidebar-light-menu-hover-bg;
|
|
1424
|
-
color: $sidebar-light-menu-hover-color;
|
|
1425
|
-
}
|
|
1426
|
-
}
|
|
1427
|
-
}
|
|
1428
|
-
}
|
|
1429
|
-
}
|
|
1430
|
-
|
|
1431
|
-
&.sub-menu {
|
|
1432
|
-
margin-bottom: 0;
|
|
1433
|
-
padding: $sidebar-submenu-padding;
|
|
1434
|
-
|
|
1435
|
-
.rtl & {
|
|
1436
|
-
padding: 0 4rem 0 0;
|
|
1437
|
-
}
|
|
1438
|
-
|
|
1439
|
-
.nav-item {
|
|
1440
|
-
.nav-link {
|
|
1441
|
-
color: $sidebar-light-submenu-color;
|
|
1442
|
-
padding: $sidebar-submenu-item-padding;
|
|
1443
|
-
font-size: $sidebar-submenu-font-size;
|
|
1444
|
-
line-height: 1;
|
|
1445
|
-
height: auto;
|
|
1446
|
-
|
|
1447
|
-
&.active {
|
|
1448
|
-
color: $sidebar-light-menu-active-color;
|
|
1449
|
-
background: transparent;
|
|
1450
|
-
|
|
1451
|
-
&:before {
|
|
1452
|
-
background: $sidebar-light-menu-active-color;
|
|
1453
|
-
}
|
|
1454
|
-
}
|
|
1455
|
-
}
|
|
1456
|
-
|
|
1457
|
-
&:hover {
|
|
1458
|
-
> .nav-link {
|
|
1459
|
-
background: $sidebar-light-submenu-hover-bg;
|
|
1460
|
-
color: $sidebar-light-submenu-hover-color;
|
|
1461
|
-
|
|
1462
|
-
&:before {
|
|
1463
|
-
background: $sidebar-light-submenu-hover-color;
|
|
1464
|
-
}
|
|
1465
|
-
}
|
|
1466
|
-
}
|
|
1467
|
-
}
|
|
1468
|
-
}
|
|
1469
|
-
|
|
1470
|
-
&.sub-menu2 {
|
|
1471
|
-
margin-bottom: 0;
|
|
1472
|
-
padding: $sidebar-submenu2-padding;
|
|
1473
|
-
|
|
1474
|
-
.rtl & {
|
|
1475
|
-
padding: 0 4rem 0 0;
|
|
1476
|
-
}
|
|
1477
|
-
|
|
1478
|
-
.nav-item {
|
|
1479
|
-
.nav-link {
|
|
1480
|
-
color: $sidebar-light-submenu-color;
|
|
1481
|
-
padding: $sidebar-submenu-item-padding;
|
|
1482
|
-
font-size: $sidebar-submenu-font-size;
|
|
1483
|
-
line-height: 1;
|
|
1484
|
-
height: auto;
|
|
1485
|
-
|
|
1486
|
-
&.active {
|
|
1487
|
-
color: $sidebar-light-menu-active-color;
|
|
1488
|
-
background: transparent;
|
|
1489
|
-
|
|
1490
|
-
&:before {
|
|
1491
|
-
background: $sidebar-light-menu-active-color;
|
|
1492
|
-
}
|
|
1493
|
-
}
|
|
1494
|
-
}
|
|
1495
|
-
|
|
1496
|
-
&:hover {
|
|
1497
|
-
> .nav-link {
|
|
1498
|
-
background: $sidebar-light-submenu-hover-bg;
|
|
1499
|
-
color: $sidebar-light-submenu-hover-color;
|
|
1500
|
-
|
|
1501
|
-
&:before {
|
|
1502
|
-
background: $sidebar-light-submenu-hover-color;
|
|
1503
|
-
}
|
|
1504
|
-
}
|
|
1505
|
-
}
|
|
1506
|
-
}
|
|
1507
|
-
}
|
|
1508
|
-
}
|
|
1509
|
-
}
|
|
1510
|
-
`;
|
|
1511
|
-
var ConfigurationOption = import_styled_components5.default.nav`
|
|
1512
|
-
position: fixed;
|
|
1513
|
-
top: 50px;
|
|
1514
|
-
right: 0;
|
|
1515
|
-
min-height: 100vh;
|
|
1516
|
-
box-shadow: 7px 0px 14px 1px rgba(201, 196, 196, 0.51);
|
|
1517
|
-
-webkit-box-shadow: 7px 0px 14px 1px rgba(201, 196, 196, 0.51);
|
|
1518
|
-
-moz-box-shadow: 7px 0px 14px 1px rgba(201, 196, 196, 0.51);
|
|
1519
|
-
min-height: calc(100vh);
|
|
1520
|
-
|
|
1521
|
-
font-family: 'Inter', sans-serif;
|
|
1522
|
-
padding: 0;
|
|
1523
|
-
width: ${(props) => props.active ? "300px" : "0px"};
|
|
1524
|
-
z-index: 11;
|
|
1525
|
-
transition: width 0.2s ease-in-out;
|
|
1526
|
-
overflow: hidden !important;
|
|
1527
|
-
`;
|
|
1528
|
-
var ItemLinkSidebar = (0, import_styled_components5.default)(import_react_router_dom2.Link)`
|
|
1529
|
-
padding: 10px 25px;
|
|
1530
|
-
display: flex;
|
|
1531
|
-
align-items: center;
|
|
1532
|
-
gap: 30px;
|
|
1533
|
-
color: #343a40;
|
|
1534
|
-
text-decoration: none;
|
|
1535
|
-
font-family: 'Inter', sans-serif;
|
|
1536
|
-
&:hover {
|
|
1537
|
-
color: white !important;
|
|
1538
|
-
text-decoration: none;
|
|
1539
|
-
background: #92190e;
|
|
1540
|
-
.icon-sidebar {
|
|
1541
|
-
color: white !important;
|
|
1542
|
-
}
|
|
1543
|
-
}
|
|
1544
|
-
`;
|
|
1545
|
-
|
|
1546
|
-
// src/styled-components/template.ts
|
|
1547
|
-
var import_styled_components6 = __toESM(require("styled-components"));
|
|
1548
|
-
var Main = import_styled_components6.default.main`
|
|
1549
|
-
width: 100%;
|
|
1550
|
-
min-height: 90vh;
|
|
1551
|
-
display: flex;
|
|
1552
|
-
flex-direction: column;
|
|
1553
|
-
justify-content: space-between;
|
|
1554
|
-
background-color: white;
|
|
1555
|
-
padding: 10px 60px;
|
|
1556
|
-
position: relative;
|
|
1557
|
-
padding-left: ${(props) => {
|
|
1558
|
-
return props.activeDrawer ? `300px` : `30px`;
|
|
1559
|
-
}};
|
|
1560
|
-
@media (max-width: 470px) {
|
|
1561
|
-
padding: 10px 10px;
|
|
1562
|
-
}
|
|
1563
|
-
`;
|
|
1564
|
-
var CloseIcon = import_styled_components6.default.button`
|
|
1565
|
-
color: black;
|
|
1566
|
-
text-decoration: none;
|
|
1567
|
-
border: none;
|
|
1568
|
-
padding: 10px 10px;
|
|
1569
|
-
background-color: white;
|
|
1570
|
-
border-radius: 50%;
|
|
1571
|
-
display: flex;
|
|
1572
|
-
align-items: center;
|
|
1573
|
-
justify-content: center;
|
|
1574
|
-
cursor: pointer;
|
|
1575
|
-
top: 10px;
|
|
1576
|
-
right: 10px;
|
|
1577
|
-
text-align: center;
|
|
1578
|
-
&:hover {
|
|
1579
|
-
color: black;
|
|
1580
|
-
text-decoration: none;
|
|
1581
|
-
background-color: #e8e8e8;
|
|
1582
|
-
}
|
|
1583
|
-
`;
|
|
1584
|
-
|
|
1585
|
-
// src/layout/AppBreadcrumb.tsx
|
|
1586
|
-
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1587
|
-
var AppBreadCrumb = ({ title, paths }) => {
|
|
1588
|
-
const { setRoutes } = (0, import_react27.useContext)(BreadCrumbContext);
|
|
1589
|
-
(0, import_react27.useEffect)(() => {
|
|
1590
|
-
if (!(paths == null ? void 0 : paths.length))
|
|
1591
|
-
return;
|
|
1592
|
-
setRoutes(paths != null ? paths : []);
|
|
1593
|
-
}, []);
|
|
1594
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BreadCrumbTitle, { children: title != null ? title : "Home" });
|
|
1595
|
-
};
|
|
1596
|
-
var AppBreadCrumbNav = ({
|
|
1597
|
-
paths,
|
|
1598
|
-
onPush
|
|
1599
|
-
}) => {
|
|
1600
|
-
const { active, path, routes, setRoutes } = (0, import_react27.useContext)(BreadCrumbContext);
|
|
1601
|
-
const { updateList } = (0, import_react27.useContext)(HistoryContext);
|
|
1602
|
-
(0, import_react27.useEffect)(() => {
|
|
1603
|
-
updateList({ name: active, path });
|
|
1604
|
-
}, [path, active]);
|
|
1605
|
-
(0, import_react27.useEffect)(() => {
|
|
1606
|
-
setRoutes(paths != null ? paths : []);
|
|
1607
|
-
}, [paths]);
|
|
1608
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Breadcrumb, { children: [
|
|
1609
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "d-flex align-items-center", children: [
|
|
1610
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_router_dom3.Link, { to: "/", className: "link", children: "HOME" }),
|
|
1611
|
-
routes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_vsc.VscChevronRight, { color: "black" }),
|
|
1612
|
-
routes.length > 0 ? routes.map((i, idx, arr) => {
|
|
1613
|
-
if (i.route === -1) {
|
|
1614
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "link", onClick: () => onPush(-1), children: [
|
|
1615
|
-
i.title,
|
|
1616
|
-
" ",
|
|
1617
|
-
idx + 1 === arr.length ? "" : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_vsc.VscChevronRight, { color: "black" })
|
|
1618
|
-
] }, idx);
|
|
1619
|
-
}
|
|
1620
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_router_dom3.Link, { to: i.route, className: "link", children: [
|
|
1621
|
-
i.title,
|
|
1622
|
-
" ",
|
|
1623
|
-
idx + 1 === arr.length ? "" : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_vsc.VscChevronRight, { color: "black" })
|
|
1624
|
-
] }, idx);
|
|
1625
|
-
}) : ""
|
|
1626
|
-
] }),
|
|
1627
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1628
|
-
CloseIcon,
|
|
1629
|
-
{
|
|
1630
|
-
onClick: () => {
|
|
1631
|
-
if ((routes == null ? void 0 : routes.length) === 1) {
|
|
1632
|
-
onPush("/");
|
|
1633
|
-
setRoutes([]);
|
|
1634
|
-
return;
|
|
1635
|
-
}
|
|
1636
|
-
onPush(`${routes && routes[(routes == null ? void 0 : routes.length) - 2].route}`);
|
|
1637
|
-
},
|
|
1638
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_md2.MdClose, { fontSize: 20 })
|
|
1639
|
-
}
|
|
1640
|
-
)
|
|
1641
|
-
] });
|
|
1642
|
-
};
|
|
1643
|
-
|
|
1644
|
-
// src/layout/AppLoader.tsx
|
|
1645
|
-
var import_react28 = require("react");
|
|
1646
|
-
var import_react_dom = __toESM(require("react-dom"));
|
|
1647
|
-
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1648
|
-
var LoaderGrid = () => {
|
|
1649
|
-
const Loader = /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "k-loading-mask", children: [
|
|
1650
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "k-loading-text", children: "Loading" }),
|
|
1651
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "k-loading-image" }),
|
|
1652
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "k-loading-color" })
|
|
1653
|
-
] });
|
|
1654
|
-
const gridContent = document && document.querySelector(".k-grid-content");
|
|
1655
|
-
const reportContent = document && document.querySelector(".loading-report");
|
|
1656
|
-
return gridContent ? import_react_dom.default.createPortal(Loader, gridContent) : reportContent ? import_react_dom.default.createPortal(Loader, reportContent) : Loader;
|
|
1657
|
-
};
|
|
1658
|
-
var AppLoader = (props) => {
|
|
1659
|
-
const { type = "grid", parent, minDuration } = props;
|
|
1660
|
-
const parentEl = type === "grid" ? document.querySelector(parent != null ? parent : ".k-grid-container") : parent ? document.querySelector(parent) : null;
|
|
1661
|
-
const Loading = /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: `${type}-loading k-loading-mask`, children: [
|
|
1662
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "k-loading-text", children: "Loading" }),
|
|
1663
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "k-loading-image" }),
|
|
1664
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "k-loading-color" })
|
|
1665
|
-
] });
|
|
1666
|
-
(0, import_react28.useEffect)(() => {
|
|
1667
|
-
if (type === "button") {
|
|
1668
|
-
const loadingEl = document.createElement("div");
|
|
1669
|
-
loadingEl.className = "icon button-loading k-loading-mask";
|
|
1670
|
-
loadingEl.innerHTML = `
|
|
1671
|
-
<div class="k-loading-image"></div>
|
|
1672
|
-
`;
|
|
1673
|
-
if (parentEl) {
|
|
1674
|
-
const button = parentEl;
|
|
1675
|
-
button.classList.add("btn-loading");
|
|
1676
|
-
button.disabled = true;
|
|
1677
|
-
button.insertBefore(loadingEl, button.firstChild);
|
|
1678
|
-
}
|
|
1679
|
-
return () => {
|
|
1680
|
-
if (parentEl) {
|
|
1681
|
-
if (minDuration) {
|
|
1682
|
-
setTimeout(() => {
|
|
1683
|
-
const button = parentEl;
|
|
1684
|
-
button.classList.remove("btn-loading");
|
|
1685
|
-
button.removeChild(loadingEl);
|
|
1686
|
-
button.disabled = false;
|
|
1687
|
-
}, minDuration);
|
|
1688
|
-
} else {
|
|
1689
|
-
const button = parentEl;
|
|
1690
|
-
button.classList.remove("btn-loading");
|
|
1691
|
-
button.removeChild(loadingEl);
|
|
1692
|
-
button.disabled = false;
|
|
1693
|
-
}
|
|
1694
|
-
}
|
|
1695
|
-
};
|
|
1696
|
-
}
|
|
1697
|
-
}, []);
|
|
1698
|
-
return type === "button" ? null : parentEl ? import_react_dom.default.createPortal(Loading, parentEl) : Loading;
|
|
1699
|
-
};
|
|
1700
|
-
|
|
1701
|
-
// src/layout/NavOptions.tsx
|
|
1702
|
-
var import_react_bootstrap = require("react-bootstrap");
|
|
1703
|
-
var import_bs = require("react-icons/bs");
|
|
1704
|
-
var import_fi = require("react-icons/fi");
|
|
1705
|
-
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1706
|
-
var NavOptions = ({
|
|
1707
|
-
exportExcel,
|
|
1708
|
-
customButtons,
|
|
1709
|
-
onCreate,
|
|
1710
|
-
onRefresh,
|
|
1711
|
-
onSelect,
|
|
1712
|
-
onClear,
|
|
1713
|
-
onExpandScreen
|
|
1714
|
-
}) => {
|
|
1715
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(MenuOptions, { children: [
|
|
1716
|
-
onCreate && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { className: "button-option", onClick: onCreate, children: [
|
|
1717
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_fi.FiPlusSquare, { className: "icon" }),
|
|
1718
|
-
" ",
|
|
1719
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text", children: "New" })
|
|
1720
|
-
] }),
|
|
1721
|
-
onRefresh && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { className: "button-option", onClick: onRefresh, children: [
|
|
1722
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_fi.FiRefreshCcw, { className: "icon" }),
|
|
1723
|
-
" ",
|
|
1724
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text", children: "Refresh" })
|
|
1725
|
-
] }),
|
|
1726
|
-
exportExcel && exportExcel.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_bootstrap.Dropdown, { className: "button-option", children: [
|
|
1727
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1728
|
-
import_react_bootstrap.Dropdown.Toggle,
|
|
1729
|
-
{
|
|
1730
|
-
id: "btnExport",
|
|
1731
|
-
className: "p-2 bg-light text-dark border-0 font-weight-bold",
|
|
1732
|
-
title: "Export to Excel",
|
|
1733
|
-
children: [
|
|
1734
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_fi.FiSave, { className: "icon" }),
|
|
1735
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1736
|
-
"span",
|
|
1737
|
-
{
|
|
1738
|
-
style: {
|
|
1739
|
-
fontSize: "13px",
|
|
1740
|
-
fontFamily: '"Inter", sans-serif'
|
|
1741
|
-
},
|
|
1742
|
-
className: "text",
|
|
1743
|
-
children: "Export"
|
|
1744
|
-
}
|
|
1745
|
-
)
|
|
1746
|
-
]
|
|
1747
|
-
}
|
|
1748
|
-
),
|
|
1749
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_bootstrap.Dropdown.Menu, { children: exportExcel.map((item, index) => {
|
|
1750
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_bootstrap.Dropdown.Item, { onClick: item.onAction, children: [
|
|
1751
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", { className: `${item.classNameIcon} mr-2` }),
|
|
1752
|
-
" ",
|
|
1753
|
-
item.title
|
|
1754
|
-
] }, index);
|
|
1755
|
-
}) })
|
|
1756
|
-
] }),
|
|
1757
|
-
onSelect && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { className: "button-option", onClick: onSelect, children: [
|
|
1758
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_fi.FiCheckCircle, { className: "icon" }),
|
|
1759
|
-
" ",
|
|
1760
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text", children: "Select All" })
|
|
1761
|
-
] }),
|
|
1762
|
-
onClear && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { className: "button-option", onClick: onClear, children: [
|
|
1763
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_fi.FiFilter, { className: "icon" }),
|
|
1764
|
-
" ",
|
|
1765
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text", children: "Clear Filters" })
|
|
1766
|
-
] }),
|
|
1767
|
-
onExpandScreen && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { className: "button-option", onClick: onExpandScreen, children: [
|
|
1768
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_bs.BsArrowsFullscreen, { className: "icon" }),
|
|
1769
|
-
" ",
|
|
1770
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text", children: "Full Page" })
|
|
1771
|
-
] }),
|
|
1772
|
-
customButtons == null ? void 0 : customButtons.map((custom, index) => {
|
|
1773
|
-
if (custom.render) {
|
|
1774
|
-
return custom.render;
|
|
1775
|
-
}
|
|
1776
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { className: "button-option", onClick: custom.onAction, children: [
|
|
1777
|
-
custom.Icon !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(custom.Icon, { className: "icon" }),
|
|
1778
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text", children: custom.title })
|
|
1779
|
-
] }, index);
|
|
1780
|
-
})
|
|
1781
|
-
] });
|
|
1782
|
-
};
|
|
1783
|
-
|
|
1784
|
-
// src/layout/title.tsx
|
|
1785
|
-
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1786
|
-
var Title = ({ title }) => {
|
|
1787
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TitlePage, { children: title != null ? title : "Home" });
|
|
1788
|
-
};
|
|
1789
1097
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1790
1098
|
0 && (module.exports = {
|
|
1791
|
-
AppBreadCrumb,
|
|
1792
|
-
AppBreadCrumbNav,
|
|
1793
|
-
AppLoader,
|
|
1794
1099
|
Badge,
|
|
1795
|
-
BreadCrumbContext,
|
|
1796
|
-
BreadCrumbContextProvider,
|
|
1797
|
-
BreadCrumbTitle,
|
|
1798
|
-
Breadcrumb,
|
|
1799
1100
|
Button,
|
|
1800
1101
|
Chip,
|
|
1801
|
-
CloseIcon,
|
|
1802
1102
|
Collapse,
|
|
1803
1103
|
CollapseContent,
|
|
1804
1104
|
CollapseContext,
|
|
1805
1105
|
CollapseTrigger,
|
|
1806
|
-
|
|
1807
|
-
DrawerContextProvider,
|
|
1808
|
-
DropEnumList,
|
|
1809
|
-
GlobalProvider,
|
|
1810
|
-
HistoryContext,
|
|
1811
|
-
HistoryContextProvider,
|
|
1812
|
-
ItemLinkSidebar,
|
|
1813
|
-
ItemSidebar,
|
|
1814
|
-
LoaderGrid,
|
|
1815
|
-
Main,
|
|
1106
|
+
Icon,
|
|
1816
1107
|
Menu,
|
|
1817
1108
|
MenuContext,
|
|
1818
1109
|
MenuGroup,
|
|
1819
1110
|
MenuItem,
|
|
1820
|
-
MenuItems,
|
|
1821
|
-
MenuOptions,
|
|
1822
1111
|
MenuSubmenu,
|
|
1823
|
-
MenuTitle,
|
|
1824
1112
|
MenuValueContext,
|
|
1825
|
-
NavOptions,
|
|
1826
|
-
Navbar,
|
|
1827
|
-
SidebarMainContext,
|
|
1828
|
-
SidebarMainContextProvider,
|
|
1829
|
-
SidebarNavigation,
|
|
1830
1113
|
Tab,
|
|
1831
1114
|
Tabs,
|
|
1832
|
-
Title,
|
|
1833
1115
|
getOpenValuesByPathname,
|
|
1834
1116
|
useCollapse,
|
|
1835
1117
|
useLocalStorage,
|