@abpjs/theme-shared 2.7.0 → 3.0.0
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/components/loader-bar/LoaderBar.d.ts +1 -1
- package/dist/constants/styles.d.ts +9 -1
- package/dist/enums/index.d.ts +5 -0
- package/dist/enums/route-names.d.ts +15 -0
- package/dist/handlers/error.handler.d.ts +3 -2
- package/dist/handlers/index.d.ts +1 -0
- package/dist/handlers/lazy-style.handler.d.ts +96 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-nav-items.d.ts +33 -0
- package/dist/index.d.ts +26 -1
- package/dist/index.js +524 -250
- package/dist/index.mjs +332 -73
- package/dist/models/common.d.ts +6 -0
- package/dist/models/confirmation.d.ts +9 -3
- package/dist/models/index.d.ts +7 -2
- package/dist/models/nav-item.d.ts +39 -0
- package/dist/models/toaster.d.ts +2 -44
- package/dist/providers/ThemeSharedProvider.d.ts +1 -1
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/route.provider.d.ts +53 -0
- package/dist/services/index.d.ts +5 -0
- package/dist/services/nav-items.service.d.ts +117 -0
- package/dist/tokens/index.d.ts +2 -0
- package/dist/tokens/lazy-styles.token.d.ts +38 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/nav-items.d.ts +110 -0
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -34,18 +34,22 @@ __export(index_exports, {
|
|
|
34
34
|
AbpModalFooter: () => AbpModalFooter,
|
|
35
35
|
AbpModalHeader: () => AbpModalHeader,
|
|
36
36
|
Alert: () => Alert,
|
|
37
|
+
BOOTSTRAP: () => BOOTSTRAP,
|
|
37
38
|
Button: () => Button3,
|
|
38
|
-
ChakraDialog: () =>
|
|
39
|
+
ChakraDialog: () => import_react16.Dialog,
|
|
39
40
|
ChangePassword: () => ChangePassword,
|
|
40
41
|
Checkbox: () => Checkbox,
|
|
41
42
|
Confirmation: () => Confirmation,
|
|
42
43
|
ConfirmationDialog: () => ConfirmationDialog,
|
|
43
44
|
ConfirmationProvider: () => ConfirmationProvider,
|
|
45
|
+
DEFAULT_LAZY_STYLES: () => DEFAULT_LAZY_STYLES,
|
|
44
46
|
DEFAULT_STYLES: () => DEFAULT_STYLES,
|
|
45
47
|
ErrorComponent: () => ErrorComponent,
|
|
46
48
|
FormField: () => FormField,
|
|
47
49
|
HTTP_ERROR_CONFIG: () => HTTP_ERROR_CONFIG,
|
|
48
50
|
HttpErrorConfigContext: () => HttpErrorConfigContext,
|
|
51
|
+
LAZY_STYLES: () => LAZY_STYLES,
|
|
52
|
+
LazyStylesContext: () => LazyStylesContext,
|
|
49
53
|
LoaderBar: () => LoaderBar,
|
|
50
54
|
Modal: () => Modal,
|
|
51
55
|
ModalBody: () => AbpModalBody,
|
|
@@ -53,20 +57,26 @@ __export(index_exports, {
|
|
|
53
57
|
ModalFooter: () => AbpModalFooter,
|
|
54
58
|
ModalHeader: () => AbpModalHeader,
|
|
55
59
|
ModalProvider: () => ModalProvider,
|
|
60
|
+
NavItemsService: () => NavItemsService,
|
|
56
61
|
PASSWORD_SETTING_KEYS: () => PASSWORD_SETTING_KEYS,
|
|
57
62
|
Profile: () => Profile,
|
|
58
63
|
THEME_SHARED_APPEND_CONTENT: () => THEME_SHARED_APPEND_CONTENT,
|
|
64
|
+
THEME_SHARED_ROUTE_PROVIDERS: () => THEME_SHARED_ROUTE_PROVIDERS,
|
|
59
65
|
THEME_SHARED_STYLES: () => THEME_SHARED_STYLES,
|
|
60
66
|
ThemeSharedAppendContentContext: () => ThemeSharedAppendContentContext,
|
|
61
67
|
ThemeSharedProvider: () => ThemeSharedProvider,
|
|
62
68
|
ToastContainer: () => ToastContainer,
|
|
63
|
-
Toaster: () => Toaster,
|
|
64
69
|
ToasterProvider: () => ToasterProvider,
|
|
65
70
|
abpSystem: () => abpSystem,
|
|
71
|
+
configureRoutes: () => configureRoutes,
|
|
66
72
|
createAbpSystem: () => createAbpSystem,
|
|
67
73
|
createErrorInterceptor: () => createErrorInterceptor,
|
|
74
|
+
createLazyStyleHref: () => createLazyStyleHref,
|
|
68
75
|
defaultAbpConfig: () => defaultAbpConfig,
|
|
69
|
-
defineConfig: () =>
|
|
76
|
+
defineConfig: () => import_react27.defineConfig,
|
|
77
|
+
eThemeSharedRouteNames: () => eThemeSharedRouteNames,
|
|
78
|
+
getLoadedBootstrapDirection: () => getLoadedBootstrapDirection,
|
|
79
|
+
getNavItemsService: () => getNavItemsService,
|
|
70
80
|
getPasswordSettings: () => getPasswordSettings,
|
|
71
81
|
getPasswordValidationRules: () => getPasswordValidationRules,
|
|
72
82
|
getPasswordValidators: () => getPasswordValidators,
|
|
@@ -74,32 +84,26 @@ __export(index_exports, {
|
|
|
74
84
|
getSeverityBorderColor: () => getSeverityBorderColor,
|
|
75
85
|
getSeverityColorScheme: () => getSeverityColorPalette,
|
|
76
86
|
httpErrorConfigFactory: () => httpErrorConfigFactory,
|
|
87
|
+
initLazyStyleHandler: () => initLazyStyleHandler,
|
|
88
|
+
initializeThemeSharedRoutes: () => initializeThemeSharedRoutes,
|
|
77
89
|
injectThemeSharedStyles: () => injectThemeSharedStyles,
|
|
78
90
|
useConfirmation: () => useConfirmation,
|
|
79
91
|
useConfirmationContext: () => useConfirmationContext,
|
|
80
92
|
useConfirmationState: () => useConfirmationState,
|
|
81
93
|
useErrorHandler: () => useErrorHandler,
|
|
82
94
|
useHttpErrorConfig: () => useHttpErrorConfig,
|
|
95
|
+
useLazyStyleHandler: () => useLazyStyleHandler,
|
|
96
|
+
useLazyStyles: () => useLazyStyles,
|
|
83
97
|
useModal: () => useModal,
|
|
84
98
|
useModalContext: () => useModalContext,
|
|
85
99
|
useModalState: () => useModalState,
|
|
100
|
+
useNavItems: () => useNavItems,
|
|
86
101
|
useToaster: () => useToaster,
|
|
87
102
|
useToasterContext: () => useToasterContext,
|
|
88
103
|
useToasts: () => useToasts
|
|
89
104
|
});
|
|
90
105
|
module.exports = __toCommonJS(index_exports);
|
|
91
106
|
|
|
92
|
-
// src/models/toaster.ts
|
|
93
|
-
var Toaster;
|
|
94
|
-
((Toaster2) => {
|
|
95
|
-
let Status;
|
|
96
|
-
((Status2) => {
|
|
97
|
-
Status2["confirm"] = "confirm";
|
|
98
|
-
Status2["reject"] = "reject";
|
|
99
|
-
Status2["dismiss"] = "dismiss";
|
|
100
|
-
})(Status = Toaster2.Status || (Toaster2.Status = {}));
|
|
101
|
-
})(Toaster || (Toaster = {}));
|
|
102
|
-
|
|
103
107
|
// src/models/confirmation.ts
|
|
104
108
|
var Confirmation;
|
|
105
109
|
((Confirmation2) => {
|
|
@@ -112,6 +116,7 @@ var Confirmation;
|
|
|
112
116
|
})(Confirmation || (Confirmation = {}));
|
|
113
117
|
|
|
114
118
|
// src/constants/styles.ts
|
|
119
|
+
var BOOTSTRAP = "bootstrap-{{dir}}.min.css";
|
|
115
120
|
var DEFAULT_STYLES = `
|
|
116
121
|
.is-invalid .form-control {
|
|
117
122
|
border-color: #dc3545;
|
|
@@ -127,6 +132,11 @@ var DEFAULT_STYLES = `
|
|
|
127
132
|
text-align: right;
|
|
128
133
|
}
|
|
129
134
|
|
|
135
|
+
/* RTL support - @since 2.9.0 */
|
|
136
|
+
[dir=rtl] .data-tables-filter {
|
|
137
|
+
text-align: left;
|
|
138
|
+
}
|
|
139
|
+
|
|
130
140
|
.pointer {
|
|
131
141
|
cursor: pointer;
|
|
132
142
|
}
|
|
@@ -308,10 +318,19 @@ function useHttpErrorConfig() {
|
|
|
308
318
|
return context ?? httpErrorConfigFactory();
|
|
309
319
|
}
|
|
310
320
|
|
|
311
|
-
// src/
|
|
321
|
+
// src/tokens/lazy-styles.token.ts
|
|
312
322
|
var import_react3 = require("react");
|
|
323
|
+
var DEFAULT_LAZY_STYLES = [BOOTSTRAP];
|
|
324
|
+
var LazyStylesContext = (0, import_react3.createContext)(DEFAULT_LAZY_STYLES);
|
|
325
|
+
function useLazyStyles() {
|
|
326
|
+
return (0, import_react3.useContext)(LazyStylesContext);
|
|
327
|
+
}
|
|
328
|
+
var LAZY_STYLES = DEFAULT_LAZY_STYLES;
|
|
329
|
+
|
|
330
|
+
// src/contexts/toaster.context.tsx
|
|
331
|
+
var import_react4 = require("react");
|
|
313
332
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
314
|
-
var ToasterContext = (0,
|
|
333
|
+
var ToasterContext = (0, import_react4.createContext)(null);
|
|
315
334
|
var toastCounter = 0;
|
|
316
335
|
function generateId() {
|
|
317
336
|
toastCounter += 1;
|
|
@@ -319,17 +338,17 @@ function generateId() {
|
|
|
319
338
|
}
|
|
320
339
|
var DEFAULT_LIFE = 5e3;
|
|
321
340
|
function ToasterProvider({ children }) {
|
|
322
|
-
const [toasts, setToasts] = (0,
|
|
323
|
-
const subscribersRef = (0,
|
|
324
|
-
(0,
|
|
341
|
+
const [toasts, setToasts] = (0, import_react4.useState)([]);
|
|
342
|
+
const subscribersRef = (0, import_react4.useRef)(/* @__PURE__ */ new Set());
|
|
343
|
+
(0, import_react4.useEffect)(() => {
|
|
325
344
|
subscribersRef.current.forEach((subscriber) => {
|
|
326
345
|
subscriber(toasts);
|
|
327
346
|
});
|
|
328
347
|
}, [toasts]);
|
|
329
|
-
const remove = (0,
|
|
348
|
+
const remove = (0, import_react4.useCallback)((id) => {
|
|
330
349
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
331
350
|
}, []);
|
|
332
|
-
const show = (0,
|
|
351
|
+
const show = (0, import_react4.useCallback)(
|
|
333
352
|
(message, title, severity = "info", options) => {
|
|
334
353
|
const id = typeof options?.id === "number" ? options.id : generateId();
|
|
335
354
|
const life = options?.sticky ? void 0 : options?.life ?? DEFAULT_LIFE;
|
|
@@ -353,23 +372,23 @@ function ToasterProvider({ children }) {
|
|
|
353
372
|
},
|
|
354
373
|
[remove]
|
|
355
374
|
);
|
|
356
|
-
const info = (0,
|
|
375
|
+
const info = (0, import_react4.useCallback)(
|
|
357
376
|
(message, title, options) => show(message, title, "info", options),
|
|
358
377
|
[show]
|
|
359
378
|
);
|
|
360
|
-
const success = (0,
|
|
379
|
+
const success = (0, import_react4.useCallback)(
|
|
361
380
|
(message, title, options) => show(message, title, "success", options),
|
|
362
381
|
[show]
|
|
363
382
|
);
|
|
364
|
-
const warn = (0,
|
|
383
|
+
const warn = (0, import_react4.useCallback)(
|
|
365
384
|
(message, title, options) => show(message, title, "warning", options),
|
|
366
385
|
[show]
|
|
367
386
|
);
|
|
368
|
-
const error = (0,
|
|
387
|
+
const error = (0, import_react4.useCallback)(
|
|
369
388
|
(message, title, options) => show(message, title, "error", options),
|
|
370
389
|
[show]
|
|
371
390
|
);
|
|
372
|
-
const clear = (0,
|
|
391
|
+
const clear = (0, import_react4.useCallback)((key) => {
|
|
373
392
|
setToasts((prev) => {
|
|
374
393
|
if (key) {
|
|
375
394
|
return prev.filter((toast) => toast.options?.containerKey !== key);
|
|
@@ -377,14 +396,14 @@ function ToasterProvider({ children }) {
|
|
|
377
396
|
return [];
|
|
378
397
|
});
|
|
379
398
|
}, []);
|
|
380
|
-
const subscribe = (0,
|
|
399
|
+
const subscribe = (0, import_react4.useCallback)((subscriber) => {
|
|
381
400
|
subscribersRef.current.add(subscriber);
|
|
382
401
|
subscriber(toasts);
|
|
383
402
|
return () => {
|
|
384
403
|
subscribersRef.current.delete(subscriber);
|
|
385
404
|
};
|
|
386
405
|
}, [toasts]);
|
|
387
|
-
const service = (0,
|
|
406
|
+
const service = (0, import_react4.useMemo)(
|
|
388
407
|
() => ({
|
|
389
408
|
info,
|
|
390
409
|
success,
|
|
@@ -397,28 +416,28 @@ function ToasterProvider({ children }) {
|
|
|
397
416
|
}),
|
|
398
417
|
[info, success, warn, error, show, remove, clear, subscribe]
|
|
399
418
|
);
|
|
400
|
-
const value = (0,
|
|
419
|
+
const value = (0, import_react4.useMemo)(
|
|
401
420
|
() => ({ service, toasts }),
|
|
402
421
|
[service, toasts]
|
|
403
422
|
);
|
|
404
423
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToasterContext.Provider, { value, children });
|
|
405
424
|
}
|
|
406
425
|
function useToaster() {
|
|
407
|
-
const context = (0,
|
|
426
|
+
const context = (0, import_react4.useContext)(ToasterContext);
|
|
408
427
|
if (!context) {
|
|
409
428
|
throw new Error("useToaster must be used within a ToasterProvider");
|
|
410
429
|
}
|
|
411
430
|
return context.service;
|
|
412
431
|
}
|
|
413
432
|
function useToasts() {
|
|
414
|
-
const context = (0,
|
|
433
|
+
const context = (0, import_react4.useContext)(ToasterContext);
|
|
415
434
|
if (!context) {
|
|
416
435
|
throw new Error("useToasts must be used within a ToasterProvider");
|
|
417
436
|
}
|
|
418
437
|
return context.toasts;
|
|
419
438
|
}
|
|
420
439
|
function useToasterContext() {
|
|
421
|
-
const context = (0,
|
|
440
|
+
const context = (0, import_react4.useContext)(ToasterContext);
|
|
422
441
|
if (!context) {
|
|
423
442
|
throw new Error("useToasterContext must be used within a ToasterProvider");
|
|
424
443
|
}
|
|
@@ -426,33 +445,33 @@ function useToasterContext() {
|
|
|
426
445
|
}
|
|
427
446
|
|
|
428
447
|
// src/contexts/confirmation.context.tsx
|
|
429
|
-
var
|
|
448
|
+
var import_react5 = require("react");
|
|
430
449
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
431
|
-
var ConfirmationContext = (0,
|
|
450
|
+
var ConfirmationContext = (0, import_react5.createContext)(null);
|
|
432
451
|
function generateId2() {
|
|
433
452
|
return `confirmation-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
434
453
|
}
|
|
435
454
|
function ConfirmationProvider({ children }) {
|
|
436
|
-
const [confirmation, setConfirmation] = (0,
|
|
437
|
-
const resolverRef = (0,
|
|
438
|
-
const subscribersRef = (0,
|
|
439
|
-
const escapeListenerRef = (0,
|
|
440
|
-
(0,
|
|
455
|
+
const [confirmation, setConfirmation] = (0, import_react5.useState)(null);
|
|
456
|
+
const resolverRef = (0, import_react5.useRef)(null);
|
|
457
|
+
const subscribersRef = (0, import_react5.useRef)(/* @__PURE__ */ new Set());
|
|
458
|
+
const escapeListenerRef = (0, import_react5.useRef)(false);
|
|
459
|
+
(0, import_react5.useEffect)(() => {
|
|
441
460
|
subscribersRef.current.forEach((subscriber) => {
|
|
442
461
|
subscriber(confirmation);
|
|
443
462
|
});
|
|
444
463
|
}, [confirmation]);
|
|
445
|
-
const respond = (0,
|
|
464
|
+
const respond = (0, import_react5.useCallback)((status) => {
|
|
446
465
|
if (resolverRef.current) {
|
|
447
466
|
resolverRef.current(status);
|
|
448
467
|
resolverRef.current = null;
|
|
449
468
|
}
|
|
450
469
|
setConfirmation(null);
|
|
451
470
|
}, []);
|
|
452
|
-
(0,
|
|
471
|
+
(0, import_react5.useEffect)(() => {
|
|
453
472
|
if (!escapeListenerRef.current) return;
|
|
454
473
|
const handleEscape = (event) => {
|
|
455
|
-
if (event.key === "Escape" && confirmation && confirmation.options?.
|
|
474
|
+
if (event.key === "Escape" && confirmation && confirmation.options?.dismissible !== false) {
|
|
456
475
|
respond(Confirmation.Status.dismiss);
|
|
457
476
|
}
|
|
458
477
|
};
|
|
@@ -461,7 +480,7 @@ function ConfirmationProvider({ children }) {
|
|
|
461
480
|
document.removeEventListener("keydown", handleEscape);
|
|
462
481
|
};
|
|
463
482
|
}, [confirmation, respond]);
|
|
464
|
-
const show = (0,
|
|
483
|
+
const show = (0, import_react5.useCallback)(
|
|
465
484
|
(message, title, severity = "neutral", options = {}) => {
|
|
466
485
|
if (resolverRef.current) {
|
|
467
486
|
resolverRef.current(Confirmation.Status.dismiss);
|
|
@@ -483,39 +502,39 @@ function ConfirmationProvider({ children }) {
|
|
|
483
502
|
},
|
|
484
503
|
[]
|
|
485
504
|
);
|
|
486
|
-
const info = (0,
|
|
505
|
+
const info = (0, import_react5.useCallback)(
|
|
487
506
|
(message, title, options) => show(message, title, "info", options),
|
|
488
507
|
[show]
|
|
489
508
|
);
|
|
490
|
-
const success = (0,
|
|
509
|
+
const success = (0, import_react5.useCallback)(
|
|
491
510
|
(message, title, options) => show(message, title, "success", options),
|
|
492
511
|
[show]
|
|
493
512
|
);
|
|
494
|
-
const warn = (0,
|
|
513
|
+
const warn = (0, import_react5.useCallback)(
|
|
495
514
|
(message, title, options) => show(message, title, "warning", options),
|
|
496
515
|
[show]
|
|
497
516
|
);
|
|
498
|
-
const error = (0,
|
|
517
|
+
const error = (0, import_react5.useCallback)(
|
|
499
518
|
(message, title, options) => show(message, title, "error", options),
|
|
500
519
|
[show]
|
|
501
520
|
);
|
|
502
|
-
const clear = (0,
|
|
521
|
+
const clear = (0, import_react5.useCallback)(
|
|
503
522
|
(status) => {
|
|
504
523
|
respond(status ?? Confirmation.Status.dismiss);
|
|
505
524
|
},
|
|
506
525
|
[respond]
|
|
507
526
|
);
|
|
508
|
-
const listenToEscape = (0,
|
|
527
|
+
const listenToEscape = (0, import_react5.useCallback)(() => {
|
|
509
528
|
escapeListenerRef.current = true;
|
|
510
529
|
}, []);
|
|
511
|
-
const subscribe = (0,
|
|
530
|
+
const subscribe = (0, import_react5.useCallback)((subscriber) => {
|
|
512
531
|
subscribersRef.current.add(subscriber);
|
|
513
532
|
subscriber(confirmation);
|
|
514
533
|
return () => {
|
|
515
534
|
subscribersRef.current.delete(subscriber);
|
|
516
535
|
};
|
|
517
536
|
}, [confirmation]);
|
|
518
|
-
const service = (0,
|
|
537
|
+
const service = (0, import_react5.useMemo)(
|
|
519
538
|
() => ({
|
|
520
539
|
info,
|
|
521
540
|
success,
|
|
@@ -528,28 +547,28 @@ function ConfirmationProvider({ children }) {
|
|
|
528
547
|
}),
|
|
529
548
|
[info, success, warn, error, show, clear, listenToEscape, subscribe]
|
|
530
549
|
);
|
|
531
|
-
const value = (0,
|
|
550
|
+
const value = (0, import_react5.useMemo)(
|
|
532
551
|
() => ({ service, confirmation, respond }),
|
|
533
552
|
[service, confirmation, respond]
|
|
534
553
|
);
|
|
535
554
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ConfirmationContext.Provider, { value, children });
|
|
536
555
|
}
|
|
537
556
|
function useConfirmation() {
|
|
538
|
-
const context = (0,
|
|
557
|
+
const context = (0, import_react5.useContext)(ConfirmationContext);
|
|
539
558
|
if (!context) {
|
|
540
559
|
throw new Error("useConfirmation must be used within a ConfirmationProvider");
|
|
541
560
|
}
|
|
542
561
|
return context.service;
|
|
543
562
|
}
|
|
544
563
|
function useConfirmationState() {
|
|
545
|
-
const context = (0,
|
|
564
|
+
const context = (0, import_react5.useContext)(ConfirmationContext);
|
|
546
565
|
if (!context) {
|
|
547
566
|
throw new Error("useConfirmationState must be used within a ConfirmationProvider");
|
|
548
567
|
}
|
|
549
568
|
return { confirmation: context.confirmation, respond: context.respond };
|
|
550
569
|
}
|
|
551
570
|
function useConfirmationContext() {
|
|
552
|
-
const context = (0,
|
|
571
|
+
const context = (0, import_react5.useContext)(ConfirmationContext);
|
|
553
572
|
if (!context) {
|
|
554
573
|
throw new Error("useConfirmationContext must be used within a ConfirmationProvider");
|
|
555
574
|
}
|
|
@@ -557,26 +576,26 @@ function useConfirmationContext() {
|
|
|
557
576
|
}
|
|
558
577
|
|
|
559
578
|
// src/contexts/modal.context.tsx
|
|
560
|
-
var
|
|
579
|
+
var import_react6 = require("react");
|
|
561
580
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
562
|
-
var ModalContext = (0,
|
|
581
|
+
var ModalContext = (0, import_react6.createContext)(null);
|
|
563
582
|
function ModalProvider({ children }) {
|
|
564
|
-
const [modalState, setModalState] = (0,
|
|
565
|
-
const [, setUpdateCounter] = (0,
|
|
566
|
-
const containerRef = (0,
|
|
567
|
-
const renderTemplate = (0,
|
|
583
|
+
const [modalState, setModalState] = (0, import_react6.useState)(null);
|
|
584
|
+
const [, setUpdateCounter] = (0, import_react6.useState)(0);
|
|
585
|
+
const containerRef = (0, import_react6.useRef)(null);
|
|
586
|
+
const renderTemplate = (0, import_react6.useCallback)((render, context) => {
|
|
568
587
|
setModalState({ render, context });
|
|
569
588
|
}, []);
|
|
570
|
-
const clearModal = (0,
|
|
589
|
+
const clearModal = (0, import_react6.useCallback)(() => {
|
|
571
590
|
setModalState(null);
|
|
572
591
|
}, []);
|
|
573
|
-
const getContainer = (0,
|
|
592
|
+
const getContainer = (0, import_react6.useCallback)(() => {
|
|
574
593
|
return containerRef;
|
|
575
594
|
}, []);
|
|
576
|
-
const detectChanges = (0,
|
|
595
|
+
const detectChanges = (0, import_react6.useCallback)(() => {
|
|
577
596
|
setUpdateCounter((prev) => prev + 1);
|
|
578
597
|
}, []);
|
|
579
|
-
const service = (0,
|
|
598
|
+
const service = (0, import_react6.useMemo)(
|
|
580
599
|
() => ({
|
|
581
600
|
renderTemplate,
|
|
582
601
|
clearModal,
|
|
@@ -585,7 +604,7 @@ function ModalProvider({ children }) {
|
|
|
585
604
|
}),
|
|
586
605
|
[renderTemplate, clearModal, getContainer, detectChanges]
|
|
587
606
|
);
|
|
588
|
-
const value = (0,
|
|
607
|
+
const value = (0, import_react6.useMemo)(
|
|
589
608
|
() => ({ service, modalState }),
|
|
590
609
|
[service, modalState]
|
|
591
610
|
);
|
|
@@ -595,21 +614,21 @@ function ModalProvider({ children }) {
|
|
|
595
614
|
] });
|
|
596
615
|
}
|
|
597
616
|
function useModal() {
|
|
598
|
-
const context = (0,
|
|
617
|
+
const context = (0, import_react6.useContext)(ModalContext);
|
|
599
618
|
if (!context) {
|
|
600
619
|
throw new Error("useModal must be used within a ModalProvider");
|
|
601
620
|
}
|
|
602
621
|
return context.service;
|
|
603
622
|
}
|
|
604
623
|
function useModalState() {
|
|
605
|
-
const context = (0,
|
|
624
|
+
const context = (0, import_react6.useContext)(ModalContext);
|
|
606
625
|
if (!context) {
|
|
607
626
|
throw new Error("useModalState must be used within a ModalProvider");
|
|
608
627
|
}
|
|
609
628
|
return context.modalState;
|
|
610
629
|
}
|
|
611
630
|
function useModalContext() {
|
|
612
|
-
const context = (0,
|
|
631
|
+
const context = (0, import_react6.useContext)(ModalContext);
|
|
613
632
|
if (!context) {
|
|
614
633
|
throw new Error("useModalContext must be used within a ModalProvider");
|
|
615
634
|
}
|
|
@@ -624,7 +643,7 @@ function ModalContainer() {
|
|
|
624
643
|
}
|
|
625
644
|
|
|
626
645
|
// src/handlers/error.handler.ts
|
|
627
|
-
var
|
|
646
|
+
var import_react7 = require("react");
|
|
628
647
|
var DEFAULT_ERROR_MESSAGES = {
|
|
629
648
|
400: "AbpUi::DefaultErrorMessage400",
|
|
630
649
|
401: "AbpUi::DefaultErrorMessage401",
|
|
@@ -636,22 +655,22 @@ var DEFAULT_ERROR_MESSAGES = {
|
|
|
636
655
|
function useErrorHandler(options = {}) {
|
|
637
656
|
const { navigate, loginPath = "/account/login" } = options;
|
|
638
657
|
const confirmation = useConfirmation();
|
|
639
|
-
const [errorComponentProps, setErrorComponentProps] = (0,
|
|
640
|
-
const navigateToLogin = (0,
|
|
658
|
+
const [errorComponentProps, setErrorComponentProps] = (0, import_react7.useState)(null);
|
|
659
|
+
const navigateToLogin = (0, import_react7.useCallback)(() => {
|
|
641
660
|
if (navigate) {
|
|
642
661
|
navigate(loginPath);
|
|
643
662
|
}
|
|
644
663
|
}, [navigate, loginPath]);
|
|
645
|
-
const showError = (0,
|
|
664
|
+
const showError = (0, import_react7.useCallback)(
|
|
646
665
|
async (message, title) => {
|
|
647
666
|
return confirmation.error(message, title || "AbpUi::Error");
|
|
648
667
|
},
|
|
649
668
|
[confirmation]
|
|
650
669
|
);
|
|
651
|
-
const clearErrorComponent = (0,
|
|
670
|
+
const clearErrorComponent = (0, import_react7.useCallback)(() => {
|
|
652
671
|
setErrorComponentProps(null);
|
|
653
672
|
}, []);
|
|
654
|
-
const createErrorComponent = (0,
|
|
673
|
+
const createErrorComponent = (0, import_react7.useCallback)(
|
|
655
674
|
(instance) => {
|
|
656
675
|
const props = {
|
|
657
676
|
title: instance.title || "Error",
|
|
@@ -664,7 +683,7 @@ function useErrorHandler(options = {}) {
|
|
|
664
683
|
},
|
|
665
684
|
[clearErrorComponent]
|
|
666
685
|
);
|
|
667
|
-
const handleError = (0,
|
|
686
|
+
const handleError = (0, import_react7.useCallback)(
|
|
668
687
|
async (error) => {
|
|
669
688
|
if (error.status === 401) {
|
|
670
689
|
navigateToLogin();
|
|
@@ -705,9 +724,152 @@ function isHttpErrorResponse(error) {
|
|
|
705
724
|
return typeof error === "object" && error !== null && "status" in error && typeof error.status === "number";
|
|
706
725
|
}
|
|
707
726
|
|
|
727
|
+
// src/hooks/use-nav-items.ts
|
|
728
|
+
var import_react8 = require("react");
|
|
729
|
+
|
|
730
|
+
// src/services/nav-items.service.ts
|
|
731
|
+
var _NavItemsService = class _NavItemsService {
|
|
732
|
+
constructor() {
|
|
733
|
+
this._items = [];
|
|
734
|
+
this._listeners = /* @__PURE__ */ new Set();
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* Get singleton instance
|
|
738
|
+
* @since 3.0.0
|
|
739
|
+
*/
|
|
740
|
+
static getInstance() {
|
|
741
|
+
if (!_NavItemsService._instance) {
|
|
742
|
+
_NavItemsService._instance = new _NavItemsService();
|
|
743
|
+
}
|
|
744
|
+
return _NavItemsService._instance;
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* Reset the singleton instance (useful for testing)
|
|
748
|
+
* @internal
|
|
749
|
+
*/
|
|
750
|
+
static resetInstance() {
|
|
751
|
+
_NavItemsService._instance = null;
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* Get current items (sorted by order)
|
|
755
|
+
* @since 3.0.0
|
|
756
|
+
*/
|
|
757
|
+
get items() {
|
|
758
|
+
return [...this._items].sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* Subscribe to item changes.
|
|
762
|
+
* Returns an unsubscribe function.
|
|
763
|
+
*
|
|
764
|
+
* @param listener - Callback function to receive item updates
|
|
765
|
+
* @returns Unsubscribe function
|
|
766
|
+
* @since 3.0.0
|
|
767
|
+
*/
|
|
768
|
+
subscribe(listener) {
|
|
769
|
+
this._listeners.add(listener);
|
|
770
|
+
listener(this.items);
|
|
771
|
+
return () => {
|
|
772
|
+
this._listeners.delete(listener);
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
/**
|
|
776
|
+
* Get items as an observable-like interface.
|
|
777
|
+
* Compatible with Angular's Observable pattern.
|
|
778
|
+
*
|
|
779
|
+
* @returns Object with subscribe method
|
|
780
|
+
* @since 3.0.0
|
|
781
|
+
*/
|
|
782
|
+
get items$() {
|
|
783
|
+
return {
|
|
784
|
+
subscribe: (callback) => {
|
|
785
|
+
const unsubscribe = this.subscribe(callback);
|
|
786
|
+
return { unsubscribe };
|
|
787
|
+
}
|
|
788
|
+
};
|
|
789
|
+
}
|
|
790
|
+
/**
|
|
791
|
+
* Add one or more items.
|
|
792
|
+
* Items are automatically sorted by order.
|
|
793
|
+
*
|
|
794
|
+
* @param items - Array of items to add
|
|
795
|
+
* @since 3.0.0
|
|
796
|
+
*/
|
|
797
|
+
addItems(items) {
|
|
798
|
+
const existingIds = new Set(this._items.map((item) => item.id));
|
|
799
|
+
const newItems = items.filter((item) => !existingIds.has(item.id));
|
|
800
|
+
this._items = [...this._items, ...newItems];
|
|
801
|
+
this.notify();
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* Remove an item by id.
|
|
805
|
+
*
|
|
806
|
+
* @param id - The id of the item to remove
|
|
807
|
+
* @since 3.0.0
|
|
808
|
+
*/
|
|
809
|
+
removeItem(id) {
|
|
810
|
+
const initialLength = this._items.length;
|
|
811
|
+
this._items = this._items.filter((item) => item.id !== id);
|
|
812
|
+
if (this._items.length !== initialLength) {
|
|
813
|
+
this.notify();
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
/**
|
|
817
|
+
* Patch an existing item by id.
|
|
818
|
+
* Updates only the specified properties.
|
|
819
|
+
*
|
|
820
|
+
* @param id - The id of the item to patch
|
|
821
|
+
* @param patch - Partial item data to merge
|
|
822
|
+
* @since 3.0.0
|
|
823
|
+
*/
|
|
824
|
+
patchItem(id, patch) {
|
|
825
|
+
const index = this._items.findIndex((item) => item.id === id);
|
|
826
|
+
if (index !== -1) {
|
|
827
|
+
this._items = [
|
|
828
|
+
...this._items.slice(0, index),
|
|
829
|
+
{ ...this._items[index], ...patch },
|
|
830
|
+
...this._items.slice(index + 1)
|
|
831
|
+
];
|
|
832
|
+
this.notify();
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
/**
|
|
836
|
+
* Clear all items.
|
|
837
|
+
* @since 3.0.0
|
|
838
|
+
*/
|
|
839
|
+
clear() {
|
|
840
|
+
if (this._items.length > 0) {
|
|
841
|
+
this._items = [];
|
|
842
|
+
this.notify();
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
/**
|
|
846
|
+
* Notify all listeners of changes.
|
|
847
|
+
*/
|
|
848
|
+
notify() {
|
|
849
|
+
const currentItems = this.items;
|
|
850
|
+
this._listeners.forEach((listener) => listener(currentItems));
|
|
851
|
+
}
|
|
852
|
+
};
|
|
853
|
+
_NavItemsService._instance = null;
|
|
854
|
+
var NavItemsService = _NavItemsService;
|
|
855
|
+
function getNavItemsService() {
|
|
856
|
+
return NavItemsService.getInstance();
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
// src/hooks/use-nav-items.ts
|
|
860
|
+
function useNavItems(service) {
|
|
861
|
+
const navItemsService = service || getNavItemsService();
|
|
862
|
+
const [items, setItems] = (0, import_react8.useState)(navItemsService.items);
|
|
863
|
+
(0, import_react8.useEffect)(() => {
|
|
864
|
+
const unsubscribe = navItemsService.subscribe(setItems);
|
|
865
|
+
return unsubscribe;
|
|
866
|
+
}, [navItemsService]);
|
|
867
|
+
return items;
|
|
868
|
+
}
|
|
869
|
+
|
|
708
870
|
// src/components/toast/Toast.tsx
|
|
709
|
-
var
|
|
710
|
-
var
|
|
871
|
+
var import_react9 = require("react");
|
|
872
|
+
var import_react10 = require("@chakra-ui/react");
|
|
711
873
|
var import_core = require("@abpjs/core");
|
|
712
874
|
var import_lucide_react = require("lucide-react");
|
|
713
875
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -814,7 +976,7 @@ function getPlacement(position) {
|
|
|
814
976
|
var toasterCache = /* @__PURE__ */ new Map();
|
|
815
977
|
function getToaster(placement) {
|
|
816
978
|
if (!toasterCache.has(placement)) {
|
|
817
|
-
toasterCache.set(placement, (0,
|
|
979
|
+
toasterCache.set(placement, (0, import_react10.createToaster)({
|
|
818
980
|
placement,
|
|
819
981
|
pauseOnPageIdle: true
|
|
820
982
|
}));
|
|
@@ -824,14 +986,14 @@ function getToaster(placement) {
|
|
|
824
986
|
function ToastContainer({ position = "bottom-right", containerKey }) {
|
|
825
987
|
const { toasts, service } = useToasterContext();
|
|
826
988
|
const { t } = (0, import_core.useLocalization)();
|
|
827
|
-
const displayedToastsRef = (0,
|
|
828
|
-
const placement = (0,
|
|
829
|
-
const toaster = (0,
|
|
830
|
-
const filteredToasts = (0,
|
|
989
|
+
const displayedToastsRef = (0, import_react9.useRef)(/* @__PURE__ */ new Set());
|
|
990
|
+
const placement = (0, import_react9.useMemo)(() => getPlacement(position), [position]);
|
|
991
|
+
const toaster = (0, import_react9.useMemo)(() => getToaster(placement), [placement]);
|
|
992
|
+
const filteredToasts = (0, import_react9.useMemo)(() => {
|
|
831
993
|
if (!containerKey) return toasts;
|
|
832
994
|
return toasts.filter((toast) => toast.options?.containerKey === containerKey);
|
|
833
995
|
}, [toasts, containerKey]);
|
|
834
|
-
(0,
|
|
996
|
+
(0, import_react9.useEffect)(() => {
|
|
835
997
|
const newToasts = filteredToasts.filter((toast) => !displayedToastsRef.current.has(toast.id));
|
|
836
998
|
newToasts.forEach((toast) => {
|
|
837
999
|
displayedToastsRef.current.add(toast.id);
|
|
@@ -864,11 +1026,11 @@ function ToastContainer({ position = "bottom-right", containerKey }) {
|
|
|
864
1026
|
});
|
|
865
1027
|
});
|
|
866
1028
|
}, [filteredToasts, t, service, toaster]);
|
|
867
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1029
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react10.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react10.Toaster, { toaster, insetInline: { mdDown: "4" }, children: (toast) => {
|
|
868
1030
|
const severity = toast.meta?.severity || "info";
|
|
869
1031
|
const closable = toast.meta?.closable !== false;
|
|
870
1032
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
871
|
-
|
|
1033
|
+
import_react10.Toast.Root,
|
|
872
1034
|
{
|
|
873
1035
|
bg: getSeverityBg(severity),
|
|
874
1036
|
borderWidth: "1px",
|
|
@@ -876,13 +1038,13 @@ function ToastContainer({ position = "bottom-right", containerKey }) {
|
|
|
876
1038
|
borderRadius: "lg",
|
|
877
1039
|
boxShadow: "lg",
|
|
878
1040
|
width: { md: "sm" },
|
|
879
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
880
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
881
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
882
|
-
toast.title && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
883
|
-
toast.description && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1041
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react10.Flex, { align: "flex-start", gap: 3, p: 4, children: [
|
|
1042
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react10.Box, { flexShrink: 0, pt: "2px", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SeverityIcon, { severity }) }),
|
|
1043
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react10.Stack, { gap: 1, flex: 1, children: [
|
|
1044
|
+
toast.title && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react10.Toast.Title, { fontWeight: "bold", fontSize: "sm", color: "fg", children: toast.title }),
|
|
1045
|
+
toast.description && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react10.Toast.Description, { fontSize: "sm", color: "gray.700", children: toast.description })
|
|
884
1046
|
] }),
|
|
885
|
-
closable && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1047
|
+
closable && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react10.Toast.CloseTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react10.CloseButton, { size: "sm" }) })
|
|
886
1048
|
] })
|
|
887
1049
|
}
|
|
888
1050
|
);
|
|
@@ -890,8 +1052,8 @@ function ToastContainer({ position = "bottom-right", containerKey }) {
|
|
|
890
1052
|
}
|
|
891
1053
|
|
|
892
1054
|
// src/components/confirmation/Confirmation.tsx
|
|
893
|
-
var
|
|
894
|
-
var
|
|
1055
|
+
var import_react11 = require("react");
|
|
1056
|
+
var import_react12 = require("@chakra-ui/react");
|
|
895
1057
|
var import_core2 = require("@abpjs/core");
|
|
896
1058
|
var import_lucide_react2 = require("lucide-react");
|
|
897
1059
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
@@ -939,7 +1101,7 @@ function getSeverityColorPalette2(severity) {
|
|
|
939
1101
|
function ConfirmationDialog({ className }) {
|
|
940
1102
|
const { confirmation, respond } = useConfirmationState();
|
|
941
1103
|
const { t } = (0, import_core2.useLocalization)();
|
|
942
|
-
const cancelRef = (0,
|
|
1104
|
+
const cancelRef = (0, import_react11.useRef)(null);
|
|
943
1105
|
if (!confirmation) {
|
|
944
1106
|
return null;
|
|
945
1107
|
}
|
|
@@ -965,29 +1127,29 @@ function ConfirmationDialog({ className }) {
|
|
|
965
1127
|
respond(Confirmation.Status.dismiss);
|
|
966
1128
|
};
|
|
967
1129
|
const handleOpenChange = (details) => {
|
|
968
|
-
if (!details.open && options?.
|
|
1130
|
+
if (!details.open && options?.dismissible !== false) {
|
|
969
1131
|
handleDismiss();
|
|
970
1132
|
}
|
|
971
1133
|
};
|
|
972
1134
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
973
|
-
|
|
1135
|
+
import_react12.Dialog.Root,
|
|
974
1136
|
{
|
|
975
1137
|
open: true,
|
|
976
1138
|
onOpenChange: handleOpenChange,
|
|
977
1139
|
role: "alertdialog",
|
|
978
1140
|
placement: "center",
|
|
979
1141
|
initialFocusEl: () => cancelRef.current,
|
|
980
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
981
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
982
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
983
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1142
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react12.Portal, { children: [
|
|
1143
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react12.Dialog.Backdrop, {}),
|
|
1144
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react12.Dialog.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react12.Dialog.Content, { className, maxWidth: "md", children: [
|
|
1145
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react12.Dialog.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react12.Flex, { align: "center", gap: 3, children: [
|
|
984
1146
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SeverityIcon2, { severity }),
|
|
985
|
-
localizedTitle && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1147
|
+
localizedTitle && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react12.Dialog.Title, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react12.Text, { fontWeight: "bold", fontSize: "lg", children: localizedTitle }) })
|
|
986
1148
|
] }) }),
|
|
987
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
988
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1149
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react12.Dialog.Body, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react12.Text, { color: "gray.600", children: localizedMessage }) }),
|
|
1150
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react12.Dialog.Footer, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react12.Flex, { gap: 3, children: [
|
|
989
1151
|
!options?.hideCancelBtn && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
990
|
-
|
|
1152
|
+
import_react12.Button,
|
|
991
1153
|
{
|
|
992
1154
|
ref: cancelRef,
|
|
993
1155
|
variant: "ghost",
|
|
@@ -996,7 +1158,7 @@ function ConfirmationDialog({ className }) {
|
|
|
996
1158
|
}
|
|
997
1159
|
),
|
|
998
1160
|
!options?.hideYesBtn && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
999
|
-
|
|
1161
|
+
import_react12.Button,
|
|
1000
1162
|
{
|
|
1001
1163
|
colorPalette: getSeverityColorPalette2(severity),
|
|
1002
1164
|
onClick: handleConfirm,
|
|
@@ -1011,7 +1173,7 @@ function ConfirmationDialog({ className }) {
|
|
|
1011
1173
|
}
|
|
1012
1174
|
|
|
1013
1175
|
// src/components/errors/ErrorComponent.tsx
|
|
1014
|
-
var
|
|
1176
|
+
var import_react13 = require("@chakra-ui/react");
|
|
1015
1177
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1016
1178
|
function ErrorComponent({
|
|
1017
1179
|
title = "Error",
|
|
@@ -1023,9 +1185,9 @@ function ErrorComponent({
|
|
|
1023
1185
|
onHomeClick,
|
|
1024
1186
|
homeButtonText = "Go Home"
|
|
1025
1187
|
}) {
|
|
1026
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react13.Container, { maxW: "container.md", py: 20, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react13.VStack, { gap: 6, textAlign: "center", children: [
|
|
1027
1189
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1028
|
-
|
|
1190
|
+
import_react13.Heading,
|
|
1029
1191
|
{
|
|
1030
1192
|
size: "4xl",
|
|
1031
1193
|
color: "red.500",
|
|
@@ -1033,10 +1195,10 @@ function ErrorComponent({
|
|
|
1033
1195
|
children: title
|
|
1034
1196
|
}
|
|
1035
1197
|
),
|
|
1036
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1037
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1198
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react13.Text, { fontSize: "lg", color: "gray.600", children: details }),
|
|
1199
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react13.Box, { display: "flex", gap: 3, children: [
|
|
1038
1200
|
isHomeShow && onHomeClick && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1039
|
-
|
|
1201
|
+
import_react13.Button,
|
|
1040
1202
|
{
|
|
1041
1203
|
colorPalette: "green",
|
|
1042
1204
|
size: "lg",
|
|
@@ -1045,7 +1207,7 @@ function ErrorComponent({
|
|
|
1045
1207
|
}
|
|
1046
1208
|
),
|
|
1047
1209
|
showCloseButton && onDestroy && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1048
|
-
|
|
1210
|
+
import_react13.Button,
|
|
1049
1211
|
{
|
|
1050
1212
|
colorPalette: "blue",
|
|
1051
1213
|
size: "lg",
|
|
@@ -1058,35 +1220,21 @@ function ErrorComponent({
|
|
|
1058
1220
|
}
|
|
1059
1221
|
|
|
1060
1222
|
// src/components/loader-bar/LoaderBar.tsx
|
|
1061
|
-
var
|
|
1223
|
+
var import_react14 = require("react");
|
|
1062
1224
|
var import_core3 = require("@abpjs/core");
|
|
1063
1225
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1064
1226
|
function LoaderBar({
|
|
1065
1227
|
containerClass = "abp-loader-bar",
|
|
1066
1228
|
progressClass = "abp-progress",
|
|
1067
|
-
filter,
|
|
1229
|
+
filter: _filter,
|
|
1068
1230
|
intervalPeriod = 300,
|
|
1069
1231
|
stopDelay = 400
|
|
1070
1232
|
}) {
|
|
1071
1233
|
const { loading } = (0, import_core3.useLoader)();
|
|
1072
|
-
const [isLoading, setIsLoading] = (0,
|
|
1073
|
-
const [progressLevel, setProgressLevel] = (0,
|
|
1074
|
-
const intervalRef = (0,
|
|
1075
|
-
(0,
|
|
1076
|
-
if (loading) {
|
|
1077
|
-
startLoading();
|
|
1078
|
-
} else {
|
|
1079
|
-
stopLoading();
|
|
1080
|
-
}
|
|
1081
|
-
}, [loading]);
|
|
1082
|
-
(0, import_react12.useEffect)(() => {
|
|
1083
|
-
return () => {
|
|
1084
|
-
if (intervalRef.current) {
|
|
1085
|
-
clearInterval(intervalRef.current);
|
|
1086
|
-
}
|
|
1087
|
-
};
|
|
1088
|
-
}, []);
|
|
1089
|
-
const startLoading = () => {
|
|
1234
|
+
const [isLoading, setIsLoading] = (0, import_react14.useState)(false);
|
|
1235
|
+
const [progressLevel, setProgressLevel] = (0, import_react14.useState)(0);
|
|
1236
|
+
const intervalRef = (0, import_react14.useRef)(null);
|
|
1237
|
+
const startLoading = (0, import_react14.useCallback)(() => {
|
|
1090
1238
|
setIsLoading(true);
|
|
1091
1239
|
setProgressLevel(0);
|
|
1092
1240
|
if (intervalRef.current) {
|
|
@@ -1104,8 +1252,8 @@ function LoaderBar({
|
|
|
1104
1252
|
return prev + 10;
|
|
1105
1253
|
});
|
|
1106
1254
|
}, intervalPeriod);
|
|
1107
|
-
};
|
|
1108
|
-
const stopLoading = () => {
|
|
1255
|
+
}, [intervalPeriod]);
|
|
1256
|
+
const stopLoading = (0, import_react14.useCallback)(() => {
|
|
1109
1257
|
setProgressLevel(100);
|
|
1110
1258
|
if (intervalRef.current) {
|
|
1111
1259
|
clearInterval(intervalRef.current);
|
|
@@ -1115,7 +1263,21 @@ function LoaderBar({
|
|
|
1115
1263
|
setIsLoading(false);
|
|
1116
1264
|
setProgressLevel(0);
|
|
1117
1265
|
}, stopDelay);
|
|
1118
|
-
};
|
|
1266
|
+
}, [stopDelay]);
|
|
1267
|
+
(0, import_react14.useEffect)(() => {
|
|
1268
|
+
if (loading) {
|
|
1269
|
+
startLoading();
|
|
1270
|
+
} else {
|
|
1271
|
+
stopLoading();
|
|
1272
|
+
}
|
|
1273
|
+
}, [loading, startLoading, stopLoading]);
|
|
1274
|
+
(0, import_react14.useEffect)(() => {
|
|
1275
|
+
return () => {
|
|
1276
|
+
if (intervalRef.current) {
|
|
1277
|
+
clearInterval(intervalRef.current);
|
|
1278
|
+
}
|
|
1279
|
+
};
|
|
1280
|
+
}, []);
|
|
1119
1281
|
if (!isLoading && progressLevel === 0) {
|
|
1120
1282
|
return null;
|
|
1121
1283
|
}
|
|
@@ -1150,8 +1312,8 @@ function LoaderBar({
|
|
|
1150
1312
|
}
|
|
1151
1313
|
|
|
1152
1314
|
// src/components/modal/Modal.tsx
|
|
1153
|
-
var
|
|
1154
|
-
var
|
|
1315
|
+
var import_react15 = __toESM(require("react"));
|
|
1316
|
+
var import_react16 = require("@chakra-ui/react");
|
|
1155
1317
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1156
1318
|
function getSizeWidth(size) {
|
|
1157
1319
|
switch (size) {
|
|
@@ -1190,12 +1352,12 @@ function Modal({
|
|
|
1190
1352
|
preventScroll = true,
|
|
1191
1353
|
onInit
|
|
1192
1354
|
}) {
|
|
1193
|
-
const prevVisibleRef =
|
|
1194
|
-
const onInitRef =
|
|
1195
|
-
|
|
1355
|
+
const prevVisibleRef = import_react15.default.useRef(false);
|
|
1356
|
+
const onInitRef = import_react15.default.useRef(onInit);
|
|
1357
|
+
import_react15.default.useEffect(() => {
|
|
1196
1358
|
onInitRef.current = onInit;
|
|
1197
1359
|
}, [onInit]);
|
|
1198
|
-
|
|
1360
|
+
import_react15.default.useEffect(() => {
|
|
1199
1361
|
if (visible && !prevVisibleRef.current && onInitRef.current) {
|
|
1200
1362
|
onInitRef.current();
|
|
1201
1363
|
}
|
|
@@ -1208,7 +1370,7 @@ function Modal({
|
|
|
1208
1370
|
onVisibleChange?.(details.open);
|
|
1209
1371
|
};
|
|
1210
1372
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1211
|
-
|
|
1373
|
+
import_react16.Dialog.Root,
|
|
1212
1374
|
{
|
|
1213
1375
|
open: visible,
|
|
1214
1376
|
onOpenChange: handleOpenChange,
|
|
@@ -1219,10 +1381,10 @@ function Modal({
|
|
|
1219
1381
|
motionPreset,
|
|
1220
1382
|
trapFocus,
|
|
1221
1383
|
preventScroll,
|
|
1222
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1223
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1224
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1225
|
-
|
|
1384
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react16.Portal, { children: [
|
|
1385
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Dialog.Backdrop, {}),
|
|
1386
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Dialog.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1387
|
+
import_react16.Dialog.Content,
|
|
1226
1388
|
{
|
|
1227
1389
|
className: modalClass,
|
|
1228
1390
|
width: getSizeWidth(size),
|
|
@@ -1232,16 +1394,16 @@ function Modal({
|
|
|
1232
1394
|
minHeight,
|
|
1233
1395
|
children: [
|
|
1234
1396
|
(header || showCloseButton) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1235
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1236
|
-
header && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1237
|
-
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1397
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Dialog.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react16.Flex, { justify: "space-between", align: "center", width: "100%", children: [
|
|
1398
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Dialog.Title, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Text, { fontWeight: "bold", fontSize: "lg", children: header }) }),
|
|
1399
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Dialog.CloseTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.CloseButton, { size: "sm" }) })
|
|
1238
1400
|
] }) }),
|
|
1239
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1401
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Separator, {})
|
|
1240
1402
|
] }),
|
|
1241
|
-
children && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1403
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Dialog.Body, { py: 4, children }),
|
|
1242
1404
|
footer && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1243
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1244
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1405
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Separator, {}),
|
|
1406
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Dialog.Footer, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Flex, { gap: 3, justify: "flex-end", w: "100%", children: footer }) })
|
|
1245
1407
|
] })
|
|
1246
1408
|
]
|
|
1247
1409
|
}
|
|
@@ -1251,17 +1413,17 @@ function Modal({
|
|
|
1251
1413
|
);
|
|
1252
1414
|
}
|
|
1253
1415
|
function AbpModalHeader({ children, className }) {
|
|
1254
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Text, { fontWeight: "bold", fontSize: "lg", className, children });
|
|
1255
1417
|
}
|
|
1256
1418
|
function AbpModalBody({ children, className }) {
|
|
1257
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Box, { color: "gray.600", className, children });
|
|
1258
1420
|
}
|
|
1259
1421
|
function AbpModalFooter({ children, className }) {
|
|
1260
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Flex, { gap: 3, justify: "flex-end", className, children });
|
|
1261
1423
|
}
|
|
1262
1424
|
|
|
1263
1425
|
// src/components/ui/Alert.tsx
|
|
1264
|
-
var
|
|
1426
|
+
var import_react17 = require("@chakra-ui/react");
|
|
1265
1427
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1266
1428
|
function Alert({
|
|
1267
1429
|
status = "info",
|
|
@@ -1274,28 +1436,28 @@ function Alert({
|
|
|
1274
1436
|
borderRadius = "md"
|
|
1275
1437
|
}) {
|
|
1276
1438
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1277
|
-
|
|
1439
|
+
import_react17.Alert.Root,
|
|
1278
1440
|
{
|
|
1279
1441
|
status,
|
|
1280
1442
|
className,
|
|
1281
1443
|
mb,
|
|
1282
1444
|
borderRadius,
|
|
1283
1445
|
children: [
|
|
1284
|
-
showIcon && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1446
|
+
showIcon && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react17.Alert.Indicator, {}),
|
|
1285
1447
|
title ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
1286
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1287
|
-
(description || children) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1288
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1448
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react17.Alert.Title, { children: title }),
|
|
1449
|
+
(description || children) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react17.Alert.Description, { children: description || children })
|
|
1450
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react17.Alert.Title, { children })
|
|
1289
1451
|
]
|
|
1290
1452
|
}
|
|
1291
1453
|
);
|
|
1292
1454
|
}
|
|
1293
1455
|
|
|
1294
1456
|
// src/components/ui/Button.tsx
|
|
1295
|
-
var
|
|
1296
|
-
var
|
|
1457
|
+
var import_react18 = require("react");
|
|
1458
|
+
var import_react19 = require("@chakra-ui/react");
|
|
1297
1459
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1298
|
-
var Button3 = (0,
|
|
1460
|
+
var Button3 = (0, import_react18.forwardRef)(
|
|
1299
1461
|
function Button4({
|
|
1300
1462
|
children,
|
|
1301
1463
|
type = "button",
|
|
@@ -1312,7 +1474,7 @@ var Button3 = (0, import_react16.forwardRef)(
|
|
|
1312
1474
|
ml
|
|
1313
1475
|
}, ref) {
|
|
1314
1476
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1315
|
-
|
|
1477
|
+
import_react19.Button,
|
|
1316
1478
|
{
|
|
1317
1479
|
ref,
|
|
1318
1480
|
type,
|
|
@@ -1334,10 +1496,10 @@ var Button3 = (0, import_react16.forwardRef)(
|
|
|
1334
1496
|
);
|
|
1335
1497
|
|
|
1336
1498
|
// src/components/ui/Checkbox.tsx
|
|
1337
|
-
var
|
|
1338
|
-
var
|
|
1499
|
+
var import_react20 = require("react");
|
|
1500
|
+
var import_react21 = require("@chakra-ui/react");
|
|
1339
1501
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1340
|
-
var Checkbox = (0,
|
|
1502
|
+
var Checkbox = (0, import_react20.forwardRef)(
|
|
1341
1503
|
function Checkbox2({
|
|
1342
1504
|
children,
|
|
1343
1505
|
checked,
|
|
@@ -1355,7 +1517,7 @@ var Checkbox = (0, import_react18.forwardRef)(
|
|
|
1355
1517
|
className
|
|
1356
1518
|
}, ref) {
|
|
1357
1519
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1358
|
-
|
|
1520
|
+
import_react21.Checkbox.Root,
|
|
1359
1521
|
{
|
|
1360
1522
|
checked,
|
|
1361
1523
|
defaultChecked,
|
|
@@ -1368,7 +1530,7 @@ var Checkbox = (0, import_react18.forwardRef)(
|
|
|
1368
1530
|
className,
|
|
1369
1531
|
children: [
|
|
1370
1532
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1371
|
-
|
|
1533
|
+
import_react21.Checkbox.HiddenInput,
|
|
1372
1534
|
{
|
|
1373
1535
|
ref,
|
|
1374
1536
|
id,
|
|
@@ -1377,8 +1539,8 @@ var Checkbox = (0, import_react18.forwardRef)(
|
|
|
1377
1539
|
onChange
|
|
1378
1540
|
}
|
|
1379
1541
|
),
|
|
1380
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1381
|
-
children && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1542
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react21.Checkbox.Control, {}),
|
|
1543
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react21.Checkbox.Label, { children })
|
|
1382
1544
|
]
|
|
1383
1545
|
}
|
|
1384
1546
|
);
|
|
@@ -1386,7 +1548,7 @@ var Checkbox = (0, import_react18.forwardRef)(
|
|
|
1386
1548
|
);
|
|
1387
1549
|
|
|
1388
1550
|
// src/components/ui/FormField.tsx
|
|
1389
|
-
var
|
|
1551
|
+
var import_react22 = require("@chakra-ui/react");
|
|
1390
1552
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1391
1553
|
function FormField({
|
|
1392
1554
|
label,
|
|
@@ -1399,20 +1561,20 @@ function FormField({
|
|
|
1399
1561
|
htmlFor,
|
|
1400
1562
|
className
|
|
1401
1563
|
}) {
|
|
1402
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1403
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react22.Field.Root, { invalid, disabled, className, children: [
|
|
1565
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react22.Field.Label, { htmlFor, children: [
|
|
1404
1566
|
label,
|
|
1405
|
-
required && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1567
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react22.Field.RequiredIndicator, {})
|
|
1406
1568
|
] }),
|
|
1407
1569
|
children,
|
|
1408
|
-
helperText && !invalid && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1409
|
-
invalid && errorText && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1570
|
+
helperText && !invalid && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react22.Field.HelperText, { children: helperText }),
|
|
1571
|
+
invalid && errorText && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react22.Field.ErrorText, { children: errorText })
|
|
1410
1572
|
] });
|
|
1411
1573
|
}
|
|
1412
1574
|
|
|
1413
1575
|
// src/components/change-password/ChangePassword.tsx
|
|
1414
|
-
var
|
|
1415
|
-
var
|
|
1576
|
+
var import_react23 = require("react");
|
|
1577
|
+
var import_react24 = require("@chakra-ui/react");
|
|
1416
1578
|
var import_react_hook_form = require("react-hook-form");
|
|
1417
1579
|
var import_core4 = require("@abpjs/core");
|
|
1418
1580
|
var import_lucide_react3 = require("lucide-react");
|
|
@@ -1438,7 +1600,7 @@ function ChangePassword({
|
|
|
1438
1600
|
}
|
|
1439
1601
|
});
|
|
1440
1602
|
const newPassword = watch("newPassword");
|
|
1441
|
-
(0,
|
|
1603
|
+
(0, import_react23.useEffect)(() => {
|
|
1442
1604
|
if (visible) {
|
|
1443
1605
|
reset();
|
|
1444
1606
|
}
|
|
@@ -1480,9 +1642,9 @@ function ChangePassword({
|
|
|
1480
1642
|
}
|
|
1481
1643
|
};
|
|
1482
1644
|
const modalFooter = /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1483
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1645
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react24.Button, { variant: "ghost", mr: 3, onClick: handleClose, disabled: isSubmitting, children: t("AbpIdentity::Cancel") || "Cancel" }),
|
|
1484
1646
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1485
|
-
|
|
1647
|
+
import_react24.Button,
|
|
1486
1648
|
{
|
|
1487
1649
|
colorPalette: "blue",
|
|
1488
1650
|
type: "submit",
|
|
@@ -1504,14 +1666,14 @@ function ChangePassword({
|
|
|
1504
1666
|
header: t("AbpIdentity::ChangePassword") || "Change Password",
|
|
1505
1667
|
footer: modalFooter,
|
|
1506
1668
|
centered: true,
|
|
1507
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("form", { id: "change-password-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1508
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1509
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1669
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("form", { id: "change-password-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react24.VStack, { gap: 4, children: [
|
|
1670
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react24.Field.Root, { invalid: !!errors.password, children: [
|
|
1671
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react24.Field.Label, { children: [
|
|
1510
1672
|
t("AbpIdentity::DisplayName:CurrentPassword") || "Current Password",
|
|
1511
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1673
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react24.Field.RequiredIndicator, {})
|
|
1512
1674
|
] }),
|
|
1513
1675
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1514
|
-
|
|
1676
|
+
import_react24.Input,
|
|
1515
1677
|
{
|
|
1516
1678
|
type: "password",
|
|
1517
1679
|
...register("password", {
|
|
@@ -1519,29 +1681,29 @@ function ChangePassword({
|
|
|
1519
1681
|
})
|
|
1520
1682
|
}
|
|
1521
1683
|
),
|
|
1522
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1684
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react24.Field.ErrorText, { children: errors.password?.message })
|
|
1523
1685
|
] }),
|
|
1524
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1525
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1686
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react24.Field.Root, { invalid: !!errors.newPassword, children: [
|
|
1687
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react24.Field.Label, { children: [
|
|
1526
1688
|
t("AbpIdentity::DisplayName:NewPassword") || "New Password",
|
|
1527
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1689
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react24.Field.RequiredIndicator, {})
|
|
1528
1690
|
] }),
|
|
1529
1691
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1530
|
-
|
|
1692
|
+
import_react24.Input,
|
|
1531
1693
|
{
|
|
1532
1694
|
type: "password",
|
|
1533
1695
|
...register("newPassword", passwordValidation)
|
|
1534
1696
|
}
|
|
1535
1697
|
),
|
|
1536
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1698
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react24.Field.ErrorText, { children: errors.newPassword?.message })
|
|
1537
1699
|
] }),
|
|
1538
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1539
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1700
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react24.Field.Root, { invalid: !!errors.repeatNewPassword, children: [
|
|
1701
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react24.Field.Label, { children: [
|
|
1540
1702
|
t("AbpIdentity::DisplayName:NewPasswordConfirm") || "Confirm New Password",
|
|
1541
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1703
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react24.Field.RequiredIndicator, {})
|
|
1542
1704
|
] }),
|
|
1543
1705
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1544
|
-
|
|
1706
|
+
import_react24.Input,
|
|
1545
1707
|
{
|
|
1546
1708
|
type: "password",
|
|
1547
1709
|
...register("repeatNewPassword", {
|
|
@@ -1550,7 +1712,7 @@ function ChangePassword({
|
|
|
1550
1712
|
})
|
|
1551
1713
|
}
|
|
1552
1714
|
),
|
|
1553
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1715
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react24.Field.ErrorText, { children: errors.repeatNewPassword?.message })
|
|
1554
1716
|
] })
|
|
1555
1717
|
] }) })
|
|
1556
1718
|
}
|
|
@@ -1558,8 +1720,8 @@ function ChangePassword({
|
|
|
1558
1720
|
}
|
|
1559
1721
|
|
|
1560
1722
|
// src/components/profile/Profile.tsx
|
|
1561
|
-
var
|
|
1562
|
-
var
|
|
1723
|
+
var import_react25 = require("react");
|
|
1724
|
+
var import_react26 = require("@chakra-ui/react");
|
|
1563
1725
|
var import_react_hook_form2 = require("react-hook-form");
|
|
1564
1726
|
var import_core5 = require("@abpjs/core");
|
|
1565
1727
|
var import_lucide_react4 = require("lucide-react");
|
|
@@ -1586,13 +1748,13 @@ function Profile({
|
|
|
1586
1748
|
}
|
|
1587
1749
|
});
|
|
1588
1750
|
const modalBusy = isSubmitting || loading;
|
|
1589
|
-
(0,
|
|
1751
|
+
(0, import_react25.useEffect)(() => {
|
|
1590
1752
|
if (visible) {
|
|
1591
1753
|
fetchProfile().then(() => {
|
|
1592
1754
|
});
|
|
1593
1755
|
}
|
|
1594
1756
|
}, [visible, fetchProfile]);
|
|
1595
|
-
(0,
|
|
1757
|
+
(0, import_react25.useEffect)(() => {
|
|
1596
1758
|
if (profile) {
|
|
1597
1759
|
reset({
|
|
1598
1760
|
userName: profile.userName || "",
|
|
@@ -1624,9 +1786,9 @@ function Profile({
|
|
|
1624
1786
|
}
|
|
1625
1787
|
};
|
|
1626
1788
|
const modalFooter = /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1627
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1789
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react26.Button, { variant: "ghost", mr: 3, onClick: handleClose, disabled: modalBusy, children: t("AbpIdentity::Cancel") || "Cancel" }),
|
|
1628
1790
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1629
|
-
|
|
1791
|
+
import_react26.Button,
|
|
1630
1792
|
{
|
|
1631
1793
|
colorPalette: "blue",
|
|
1632
1794
|
type: "submit",
|
|
@@ -1649,14 +1811,14 @@ function Profile({
|
|
|
1649
1811
|
footer: modalFooter,
|
|
1650
1812
|
size: "lg",
|
|
1651
1813
|
centered: true,
|
|
1652
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("form", { id: "profile-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1653
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1654
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1814
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("form", { id: "profile-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react26.VStack, { gap: 4, children: [
|
|
1815
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react26.Field.Root, { invalid: !!errors.userName, children: [
|
|
1816
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react26.Field.Label, { children: [
|
|
1655
1817
|
t("AbpIdentity::DisplayName:UserName") || "Username",
|
|
1656
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1818
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react26.Field.RequiredIndicator, {})
|
|
1657
1819
|
] }),
|
|
1658
1820
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1659
|
-
|
|
1821
|
+
import_react26.Input,
|
|
1660
1822
|
{
|
|
1661
1823
|
type: "text",
|
|
1662
1824
|
...register("userName", {
|
|
@@ -1668,13 +1830,13 @@ function Profile({
|
|
|
1668
1830
|
})
|
|
1669
1831
|
}
|
|
1670
1832
|
),
|
|
1671
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1833
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react26.Field.ErrorText, { children: errors.userName?.message })
|
|
1672
1834
|
] }),
|
|
1673
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1674
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1675
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1835
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react26.HStack, { gap: 4, w: "full", children: [
|
|
1836
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react26.Field.Root, { invalid: !!errors.name, flex: 1, children: [
|
|
1837
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react26.Field.Label, { children: t("AbpIdentity::DisplayName:Name") || "Name" }),
|
|
1676
1838
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1677
|
-
|
|
1839
|
+
import_react26.Input,
|
|
1678
1840
|
{
|
|
1679
1841
|
type: "text",
|
|
1680
1842
|
...register("name", {
|
|
@@ -1685,12 +1847,12 @@ function Profile({
|
|
|
1685
1847
|
})
|
|
1686
1848
|
}
|
|
1687
1849
|
),
|
|
1688
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1850
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react26.Field.ErrorText, { children: errors.name?.message })
|
|
1689
1851
|
] }),
|
|
1690
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1691
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1852
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react26.Field.Root, { invalid: !!errors.surname, flex: 1, children: [
|
|
1853
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react26.Field.Label, { children: t("AbpIdentity::DisplayName:Surname") || "Surname" }),
|
|
1692
1854
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1693
|
-
|
|
1855
|
+
import_react26.Input,
|
|
1694
1856
|
{
|
|
1695
1857
|
type: "text",
|
|
1696
1858
|
...register("surname", {
|
|
@@ -1701,16 +1863,16 @@ function Profile({
|
|
|
1701
1863
|
})
|
|
1702
1864
|
}
|
|
1703
1865
|
),
|
|
1704
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1866
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react26.Field.ErrorText, { children: errors.surname?.message })
|
|
1705
1867
|
] })
|
|
1706
1868
|
] }),
|
|
1707
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1708
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1869
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react26.Field.Root, { invalid: !!errors.email, children: [
|
|
1870
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react26.Field.Label, { children: [
|
|
1709
1871
|
t("AbpIdentity::DisplayName:EmailAddress") || "Email Address",
|
|
1710
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1872
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react26.Field.RequiredIndicator, {})
|
|
1711
1873
|
] }),
|
|
1712
1874
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1713
|
-
|
|
1875
|
+
import_react26.Input,
|
|
1714
1876
|
{
|
|
1715
1877
|
type: "email",
|
|
1716
1878
|
...register("email", {
|
|
@@ -1726,12 +1888,12 @@ function Profile({
|
|
|
1726
1888
|
})
|
|
1727
1889
|
}
|
|
1728
1890
|
),
|
|
1729
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1891
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react26.Field.ErrorText, { children: errors.email?.message })
|
|
1730
1892
|
] }),
|
|
1731
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1732
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1893
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react26.Field.Root, { invalid: !!errors.phoneNumber, children: [
|
|
1894
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react26.Field.Label, { children: t("AbpIdentity::DisplayName:PhoneNumber") || "Phone Number" }),
|
|
1733
1895
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1734
|
-
|
|
1896
|
+
import_react26.Input,
|
|
1735
1897
|
{
|
|
1736
1898
|
type: "tel",
|
|
1737
1899
|
...register("phoneNumber", {
|
|
@@ -1742,7 +1904,7 @@ function Profile({
|
|
|
1742
1904
|
})
|
|
1743
1905
|
}
|
|
1744
1906
|
),
|
|
1745
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1907
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react26.Field.ErrorText, { children: errors.phoneNumber?.message })
|
|
1746
1908
|
] })
|
|
1747
1909
|
] }) })
|
|
1748
1910
|
}
|
|
@@ -1750,10 +1912,10 @@ function Profile({
|
|
|
1750
1912
|
}
|
|
1751
1913
|
|
|
1752
1914
|
// src/providers/ThemeSharedProvider.tsx
|
|
1753
|
-
var
|
|
1915
|
+
var import_react29 = require("@chakra-ui/react");
|
|
1754
1916
|
|
|
1755
1917
|
// src/theme/index.ts
|
|
1756
|
-
var
|
|
1918
|
+
var import_react27 = require("@chakra-ui/react");
|
|
1757
1919
|
var colors = {
|
|
1758
1920
|
brand: {
|
|
1759
1921
|
50: { value: "#e3f2fd" },
|
|
@@ -1956,7 +2118,7 @@ var semanticTokens = {
|
|
|
1956
2118
|
// },
|
|
1957
2119
|
// },
|
|
1958
2120
|
};
|
|
1959
|
-
var defaultAbpConfig = (0,
|
|
2121
|
+
var defaultAbpConfig = (0, import_react27.defineConfig)({
|
|
1960
2122
|
theme: {
|
|
1961
2123
|
tokens: {
|
|
1962
2124
|
colors,
|
|
@@ -1978,16 +2140,16 @@ var defaultAbpConfig = (0, import_react25.defineConfig)({
|
|
|
1978
2140
|
});
|
|
1979
2141
|
function createAbpSystem(overrides) {
|
|
1980
2142
|
if (overrides) {
|
|
1981
|
-
return (0,
|
|
2143
|
+
return (0, import_react27.createSystem)(import_react27.defaultConfig, defaultAbpConfig, overrides);
|
|
1982
2144
|
}
|
|
1983
|
-
return (0,
|
|
2145
|
+
return (0, import_react27.createSystem)(import_react27.defaultConfig, defaultAbpConfig);
|
|
1984
2146
|
}
|
|
1985
2147
|
var abpSystem = createAbpSystem();
|
|
1986
2148
|
|
|
1987
2149
|
// src/components/ui/color-mode.tsx
|
|
1988
|
-
var
|
|
2150
|
+
var import_react28 = require("@chakra-ui/react");
|
|
1989
2151
|
var import_next_themes = require("next-themes");
|
|
1990
|
-
var
|
|
2152
|
+
var React11 = __toESM(require("react"));
|
|
1991
2153
|
var import_lucide_react5 = require("lucide-react");
|
|
1992
2154
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1993
2155
|
function ColorModeProvider(props) {
|
|
@@ -2009,10 +2171,10 @@ function ColorModeIcon() {
|
|
|
2009
2171
|
const { colorMode } = useColorMode();
|
|
2010
2172
|
return colorMode === "dark" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react5.Moon, {}) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react5.Sun, {});
|
|
2011
2173
|
}
|
|
2012
|
-
var ColorModeButton =
|
|
2174
|
+
var ColorModeButton = React11.forwardRef(function ColorModeButton2(props, ref) {
|
|
2013
2175
|
const { toggleColorMode } = useColorMode();
|
|
2014
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2015
|
-
|
|
2176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react28.ClientOnly, { fallback: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react28.Skeleton, { boxSize: "9" }), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2177
|
+
import_react28.IconButton,
|
|
2016
2178
|
{
|
|
2017
2179
|
onClick: toggleColorMode,
|
|
2018
2180
|
variant: "ghost",
|
|
@@ -2030,10 +2192,10 @@ var ColorModeButton = React12.forwardRef(function ColorModeButton2(props, ref) {
|
|
|
2030
2192
|
}
|
|
2031
2193
|
) });
|
|
2032
2194
|
});
|
|
2033
|
-
var LightMode =
|
|
2195
|
+
var LightMode = React11.forwardRef(
|
|
2034
2196
|
function LightMode2(props, ref) {
|
|
2035
2197
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2036
|
-
|
|
2198
|
+
import_react28.Span,
|
|
2037
2199
|
{
|
|
2038
2200
|
color: "fg",
|
|
2039
2201
|
display: "contents",
|
|
@@ -2046,10 +2208,10 @@ var LightMode = React12.forwardRef(
|
|
|
2046
2208
|
);
|
|
2047
2209
|
}
|
|
2048
2210
|
);
|
|
2049
|
-
var DarkMode =
|
|
2211
|
+
var DarkMode = React11.forwardRef(
|
|
2050
2212
|
function DarkMode2(props, ref) {
|
|
2051
2213
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2052
|
-
|
|
2214
|
+
import_react28.Span,
|
|
2053
2215
|
{
|
|
2054
2216
|
color: "fg",
|
|
2055
2217
|
display: "contents",
|
|
@@ -2071,21 +2233,118 @@ function ThemeSharedProvider({
|
|
|
2071
2233
|
renderToasts = true,
|
|
2072
2234
|
renderConfirmation = true,
|
|
2073
2235
|
themeOverrides,
|
|
2074
|
-
toastPosition = "bottom-right",
|
|
2236
|
+
toastPosition: _toastPosition = "bottom-right",
|
|
2075
2237
|
enableColorMode = false,
|
|
2076
2238
|
defaultColorMode = "light",
|
|
2077
2239
|
locale = "en-US"
|
|
2078
2240
|
}) {
|
|
2079
2241
|
const system = themeOverrides ? createAbpSystem(themeOverrides) : abpSystem;
|
|
2080
2242
|
const { endSide } = (0, import_core6.useDirection)();
|
|
2081
|
-
|
|
2243
|
+
const resolvedToastPosition = endSide === "left" ? "bottom-left" : "bottom-right";
|
|
2082
2244
|
const content = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ToasterProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(ConfirmationProvider, { children: [
|
|
2083
2245
|
children,
|
|
2084
|
-
renderToasts && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ToastContainer, { position:
|
|
2246
|
+
renderToasts && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ToastContainer, { position: resolvedToastPosition }),
|
|
2085
2247
|
renderConfirmation && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ConfirmationDialog, {})
|
|
2086
2248
|
] }) });
|
|
2087
2249
|
const colorModeProps = enableColorMode ? { defaultTheme: defaultColorMode } : { forcedTheme: "light" };
|
|
2088
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react29.ChakraProvider, { value: system, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react29.LocaleProvider, { locale, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ColorModeProvider, { ...colorModeProps, children: content }) }) });
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2253
|
+
// src/providers/route.provider.ts
|
|
2254
|
+
var import_core7 = require("@abpjs/core");
|
|
2255
|
+
|
|
2256
|
+
// src/enums/route-names.ts
|
|
2257
|
+
var eThemeSharedRouteNames = /* @__PURE__ */ ((eThemeSharedRouteNames2) => {
|
|
2258
|
+
eThemeSharedRouteNames2["Administration"] = "AbpUiNavigation::Menu:Administration";
|
|
2259
|
+
return eThemeSharedRouteNames2;
|
|
2260
|
+
})(eThemeSharedRouteNames || {});
|
|
2261
|
+
|
|
2262
|
+
// src/providers/route.provider.ts
|
|
2263
|
+
function configureRoutes(routes) {
|
|
2264
|
+
return () => {
|
|
2265
|
+
routes.add([
|
|
2266
|
+
{
|
|
2267
|
+
name: "AbpUiNavigation::Menu:Administration" /* Administration */,
|
|
2268
|
+
path: "",
|
|
2269
|
+
order: 100,
|
|
2270
|
+
iconClass: "fa fa-wrench"
|
|
2271
|
+
}
|
|
2272
|
+
]);
|
|
2273
|
+
};
|
|
2274
|
+
}
|
|
2275
|
+
var THEME_SHARED_ROUTE_PROVIDERS = {
|
|
2276
|
+
configureRoutes
|
|
2277
|
+
};
|
|
2278
|
+
function initializeThemeSharedRoutes() {
|
|
2279
|
+
const routesService = (0, import_core7.getRoutesService)();
|
|
2280
|
+
configureRoutes(routesService)();
|
|
2281
|
+
}
|
|
2282
|
+
|
|
2283
|
+
// src/handlers/lazy-style.handler.ts
|
|
2284
|
+
var import_react30 = require("react");
|
|
2285
|
+
var import_core8 = require("@abpjs/core");
|
|
2286
|
+
function createLazyStyleHref(style, dir) {
|
|
2287
|
+
return style.replace("{{dir}}", dir);
|
|
2288
|
+
}
|
|
2289
|
+
function useLazyStyleHandler(options = {}) {
|
|
2290
|
+
const { styles = [BOOTSTRAP], initialDirection = "ltr" } = options;
|
|
2291
|
+
const [direction, setDirection] = (0, import_react30.useState)(initialDirection);
|
|
2292
|
+
const lazyLoadRef = (0, import_react30.useRef)(new import_core8.LazyLoadService());
|
|
2293
|
+
const loadedStylesRef = (0, import_react30.useRef)(/* @__PURE__ */ new Map());
|
|
2294
|
+
(0, import_react30.useEffect)(() => {
|
|
2295
|
+
document.body.dir = direction;
|
|
2296
|
+
const switchCSS = async () => {
|
|
2297
|
+
const lazyLoad = lazyLoadRef.current;
|
|
2298
|
+
for (const style of styles) {
|
|
2299
|
+
const href = createLazyStyleHref(style, direction);
|
|
2300
|
+
if (lazyLoad.isLoaded(href)) {
|
|
2301
|
+
continue;
|
|
2302
|
+
}
|
|
2303
|
+
const oldDir = direction === "ltr" ? "rtl" : "ltr";
|
|
2304
|
+
const oldHref = createLazyStyleHref(style, oldDir);
|
|
2305
|
+
const oldLink = loadedStylesRef.current.get(oldHref);
|
|
2306
|
+
if (oldLink && oldLink.parentNode) {
|
|
2307
|
+
oldLink.parentNode.removeChild(oldLink);
|
|
2308
|
+
lazyLoad.remove(oldHref);
|
|
2309
|
+
loadedStylesRef.current.delete(oldHref);
|
|
2310
|
+
}
|
|
2311
|
+
try {
|
|
2312
|
+
const link = document.createElement("link");
|
|
2313
|
+
link.rel = "stylesheet";
|
|
2314
|
+
link.href = href;
|
|
2315
|
+
document.head.appendChild(link);
|
|
2316
|
+
loadedStylesRef.current.set(href, link);
|
|
2317
|
+
} catch (error) {
|
|
2318
|
+
console.warn(`Failed to load style: ${href}`, error);
|
|
2319
|
+
}
|
|
2320
|
+
}
|
|
2321
|
+
};
|
|
2322
|
+
switchCSS();
|
|
2323
|
+
}, [direction, styles]);
|
|
2324
|
+
return {
|
|
2325
|
+
direction,
|
|
2326
|
+
setDirection
|
|
2327
|
+
};
|
|
2328
|
+
}
|
|
2329
|
+
function getLoadedBootstrapDirection(styles = [BOOTSTRAP]) {
|
|
2330
|
+
for (const style of styles) {
|
|
2331
|
+
const ltrHref = createLazyStyleHref(style, "ltr");
|
|
2332
|
+
const rtlHref = createLazyStyleHref(style, "rtl");
|
|
2333
|
+
const links = document.querySelectorAll('link[rel="stylesheet"]');
|
|
2334
|
+
for (const link of links) {
|
|
2335
|
+
const href = link.href;
|
|
2336
|
+
if (href.includes(ltrHref)) return "ltr";
|
|
2337
|
+
if (href.includes(rtlHref)) return "rtl";
|
|
2338
|
+
}
|
|
2339
|
+
}
|
|
2340
|
+
return void 0;
|
|
2341
|
+
}
|
|
2342
|
+
function initLazyStyleHandler(options = {}) {
|
|
2343
|
+
return () => {
|
|
2344
|
+
const { initialDirection = "ltr" } = options;
|
|
2345
|
+
document.body.dir = initialDirection;
|
|
2346
|
+
return { direction: initialDirection };
|
|
2347
|
+
};
|
|
2089
2348
|
}
|
|
2090
2349
|
|
|
2091
2350
|
// src/utils/styles.ts
|
|
@@ -2278,6 +2537,7 @@ function getPasswordValidationRules(store) {
|
|
|
2278
2537
|
AbpModalFooter,
|
|
2279
2538
|
AbpModalHeader,
|
|
2280
2539
|
Alert,
|
|
2540
|
+
BOOTSTRAP,
|
|
2281
2541
|
Button,
|
|
2282
2542
|
ChakraDialog,
|
|
2283
2543
|
ChangePassword,
|
|
@@ -2285,11 +2545,14 @@ function getPasswordValidationRules(store) {
|
|
|
2285
2545
|
Confirmation,
|
|
2286
2546
|
ConfirmationDialog,
|
|
2287
2547
|
ConfirmationProvider,
|
|
2548
|
+
DEFAULT_LAZY_STYLES,
|
|
2288
2549
|
DEFAULT_STYLES,
|
|
2289
2550
|
ErrorComponent,
|
|
2290
2551
|
FormField,
|
|
2291
2552
|
HTTP_ERROR_CONFIG,
|
|
2292
2553
|
HttpErrorConfigContext,
|
|
2554
|
+
LAZY_STYLES,
|
|
2555
|
+
LazyStylesContext,
|
|
2293
2556
|
LoaderBar,
|
|
2294
2557
|
Modal,
|
|
2295
2558
|
ModalBody,
|
|
@@ -2297,20 +2560,26 @@ function getPasswordValidationRules(store) {
|
|
|
2297
2560
|
ModalFooter,
|
|
2298
2561
|
ModalHeader,
|
|
2299
2562
|
ModalProvider,
|
|
2563
|
+
NavItemsService,
|
|
2300
2564
|
PASSWORD_SETTING_KEYS,
|
|
2301
2565
|
Profile,
|
|
2302
2566
|
THEME_SHARED_APPEND_CONTENT,
|
|
2567
|
+
THEME_SHARED_ROUTE_PROVIDERS,
|
|
2303
2568
|
THEME_SHARED_STYLES,
|
|
2304
2569
|
ThemeSharedAppendContentContext,
|
|
2305
2570
|
ThemeSharedProvider,
|
|
2306
2571
|
ToastContainer,
|
|
2307
|
-
Toaster,
|
|
2308
2572
|
ToasterProvider,
|
|
2309
2573
|
abpSystem,
|
|
2574
|
+
configureRoutes,
|
|
2310
2575
|
createAbpSystem,
|
|
2311
2576
|
createErrorInterceptor,
|
|
2577
|
+
createLazyStyleHref,
|
|
2312
2578
|
defaultAbpConfig,
|
|
2313
2579
|
defineConfig,
|
|
2580
|
+
eThemeSharedRouteNames,
|
|
2581
|
+
getLoadedBootstrapDirection,
|
|
2582
|
+
getNavItemsService,
|
|
2314
2583
|
getPasswordSettings,
|
|
2315
2584
|
getPasswordValidationRules,
|
|
2316
2585
|
getPasswordValidators,
|
|
@@ -2318,15 +2587,20 @@ function getPasswordValidationRules(store) {
|
|
|
2318
2587
|
getSeverityBorderColor,
|
|
2319
2588
|
getSeverityColorScheme,
|
|
2320
2589
|
httpErrorConfigFactory,
|
|
2590
|
+
initLazyStyleHandler,
|
|
2591
|
+
initializeThemeSharedRoutes,
|
|
2321
2592
|
injectThemeSharedStyles,
|
|
2322
2593
|
useConfirmation,
|
|
2323
2594
|
useConfirmationContext,
|
|
2324
2595
|
useConfirmationState,
|
|
2325
2596
|
useErrorHandler,
|
|
2326
2597
|
useHttpErrorConfig,
|
|
2598
|
+
useLazyStyleHandler,
|
|
2599
|
+
useLazyStyles,
|
|
2327
2600
|
useModal,
|
|
2328
2601
|
useModalContext,
|
|
2329
2602
|
useModalState,
|
|
2603
|
+
useNavItems,
|
|
2330
2604
|
useToaster,
|
|
2331
2605
|
useToasterContext,
|
|
2332
2606
|
useToasts
|