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