@abpjs/theme-shared 2.4.0 → 2.7.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/errors/ErrorComponent.d.ts +27 -1
- package/dist/contexts/index.d.ts +1 -0
- package/dist/contexts/modal.context.d.ts +139 -0
- package/dist/index.d.ts +10 -1
- package/dist/index.js +507 -271
- package/dist/index.mjs +419 -189
- package/dist/models/common.d.ts +10 -1
- package/dist/tokens/append-content.token.d.ts +7 -0
- package/dist/tokens/http-error.token.d.ts +70 -0
- package/dist/tokens/index.d.ts +8 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/validation-utils.d.ts +125 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ __export(index_exports, {
|
|
|
35
35
|
AbpModalHeader: () => AbpModalHeader,
|
|
36
36
|
Alert: () => Alert,
|
|
37
37
|
Button: () => Button3,
|
|
38
|
-
ChakraDialog: () =>
|
|
38
|
+
ChakraDialog: () => import_react14.Dialog,
|
|
39
39
|
ChangePassword: () => ChangePassword,
|
|
40
40
|
Checkbox: () => Checkbox,
|
|
41
41
|
Confirmation: () => Confirmation,
|
|
@@ -44,11 +44,16 @@ __export(index_exports, {
|
|
|
44
44
|
DEFAULT_STYLES: () => DEFAULT_STYLES,
|
|
45
45
|
ErrorComponent: () => ErrorComponent,
|
|
46
46
|
FormField: () => FormField,
|
|
47
|
+
HTTP_ERROR_CONFIG: () => HTTP_ERROR_CONFIG,
|
|
48
|
+
HttpErrorConfigContext: () => HttpErrorConfigContext,
|
|
47
49
|
LoaderBar: () => LoaderBar,
|
|
48
50
|
Modal: () => Modal,
|
|
49
51
|
ModalBody: () => AbpModalBody,
|
|
52
|
+
ModalContainer: () => ModalContainer,
|
|
50
53
|
ModalFooter: () => AbpModalFooter,
|
|
51
54
|
ModalHeader: () => AbpModalHeader,
|
|
55
|
+
ModalProvider: () => ModalProvider,
|
|
56
|
+
PASSWORD_SETTING_KEYS: () => PASSWORD_SETTING_KEYS,
|
|
52
57
|
Profile: () => Profile,
|
|
53
58
|
THEME_SHARED_APPEND_CONTENT: () => THEME_SHARED_APPEND_CONTENT,
|
|
54
59
|
THEME_SHARED_STYLES: () => THEME_SHARED_STYLES,
|
|
@@ -61,15 +66,23 @@ __export(index_exports, {
|
|
|
61
66
|
createAbpSystem: () => createAbpSystem,
|
|
62
67
|
createErrorInterceptor: () => createErrorInterceptor,
|
|
63
68
|
defaultAbpConfig: () => defaultAbpConfig,
|
|
64
|
-
defineConfig: () =>
|
|
69
|
+
defineConfig: () => import_react25.defineConfig,
|
|
70
|
+
getPasswordSettings: () => getPasswordSettings,
|
|
71
|
+
getPasswordValidationRules: () => getPasswordValidationRules,
|
|
72
|
+
getPasswordValidators: () => getPasswordValidators,
|
|
65
73
|
getSeverityBg: () => getSeverityBg,
|
|
66
74
|
getSeverityBorderColor: () => getSeverityBorderColor,
|
|
67
75
|
getSeverityColorScheme: () => getSeverityColorPalette,
|
|
76
|
+
httpErrorConfigFactory: () => httpErrorConfigFactory,
|
|
68
77
|
injectThemeSharedStyles: () => injectThemeSharedStyles,
|
|
69
78
|
useConfirmation: () => useConfirmation,
|
|
70
79
|
useConfirmationContext: () => useConfirmationContext,
|
|
71
80
|
useConfirmationState: () => useConfirmationState,
|
|
72
81
|
useErrorHandler: () => useErrorHandler,
|
|
82
|
+
useHttpErrorConfig: () => useHttpErrorConfig,
|
|
83
|
+
useModal: () => useModal,
|
|
84
|
+
useModalContext: () => useModalContext,
|
|
85
|
+
useModalState: () => useModalState,
|
|
73
86
|
useToaster: () => useToaster,
|
|
74
87
|
useToasterContext: () => useToasterContext,
|
|
75
88
|
useToasts: () => useToasts
|
|
@@ -280,10 +293,25 @@ var import_react = require("react");
|
|
|
280
293
|
var ThemeSharedAppendContentContext = (0, import_react.createContext)(void 0);
|
|
281
294
|
var THEME_SHARED_APPEND_CONTENT = "THEME_SHARED_APPEND_CONTENT";
|
|
282
295
|
|
|
283
|
-
// src/
|
|
296
|
+
// src/tokens/http-error.token.ts
|
|
284
297
|
var import_react2 = require("react");
|
|
298
|
+
var HTTP_ERROR_CONFIG = "HTTP_ERROR_CONFIG";
|
|
299
|
+
var HttpErrorConfigContext = (0, import_react2.createContext)(void 0);
|
|
300
|
+
function httpErrorConfigFactory() {
|
|
301
|
+
return {
|
|
302
|
+
skipHandledErrorCodes: [],
|
|
303
|
+
errorScreen: void 0
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
function useHttpErrorConfig() {
|
|
307
|
+
const context = (0, import_react2.useContext)(HttpErrorConfigContext);
|
|
308
|
+
return context ?? httpErrorConfigFactory();
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// src/contexts/toaster.context.tsx
|
|
312
|
+
var import_react3 = require("react");
|
|
285
313
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
286
|
-
var ToasterContext = (0,
|
|
314
|
+
var ToasterContext = (0, import_react3.createContext)(null);
|
|
287
315
|
var toastCounter = 0;
|
|
288
316
|
function generateId() {
|
|
289
317
|
toastCounter += 1;
|
|
@@ -291,17 +319,17 @@ function generateId() {
|
|
|
291
319
|
}
|
|
292
320
|
var DEFAULT_LIFE = 5e3;
|
|
293
321
|
function ToasterProvider({ children }) {
|
|
294
|
-
const [toasts, setToasts] = (0,
|
|
295
|
-
const subscribersRef = (0,
|
|
296
|
-
(0,
|
|
322
|
+
const [toasts, setToasts] = (0, import_react3.useState)([]);
|
|
323
|
+
const subscribersRef = (0, import_react3.useRef)(/* @__PURE__ */ new Set());
|
|
324
|
+
(0, import_react3.useEffect)(() => {
|
|
297
325
|
subscribersRef.current.forEach((subscriber) => {
|
|
298
326
|
subscriber(toasts);
|
|
299
327
|
});
|
|
300
328
|
}, [toasts]);
|
|
301
|
-
const remove = (0,
|
|
329
|
+
const remove = (0, import_react3.useCallback)((id) => {
|
|
302
330
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
303
331
|
}, []);
|
|
304
|
-
const show = (0,
|
|
332
|
+
const show = (0, import_react3.useCallback)(
|
|
305
333
|
(message, title, severity = "info", options) => {
|
|
306
334
|
const id = typeof options?.id === "number" ? options.id : generateId();
|
|
307
335
|
const life = options?.sticky ? void 0 : options?.life ?? DEFAULT_LIFE;
|
|
@@ -325,23 +353,23 @@ function ToasterProvider({ children }) {
|
|
|
325
353
|
},
|
|
326
354
|
[remove]
|
|
327
355
|
);
|
|
328
|
-
const info = (0,
|
|
356
|
+
const info = (0, import_react3.useCallback)(
|
|
329
357
|
(message, title, options) => show(message, title, "info", options),
|
|
330
358
|
[show]
|
|
331
359
|
);
|
|
332
|
-
const success = (0,
|
|
360
|
+
const success = (0, import_react3.useCallback)(
|
|
333
361
|
(message, title, options) => show(message, title, "success", options),
|
|
334
362
|
[show]
|
|
335
363
|
);
|
|
336
|
-
const warn = (0,
|
|
364
|
+
const warn = (0, import_react3.useCallback)(
|
|
337
365
|
(message, title, options) => show(message, title, "warning", options),
|
|
338
366
|
[show]
|
|
339
367
|
);
|
|
340
|
-
const error = (0,
|
|
368
|
+
const error = (0, import_react3.useCallback)(
|
|
341
369
|
(message, title, options) => show(message, title, "error", options),
|
|
342
370
|
[show]
|
|
343
371
|
);
|
|
344
|
-
const clear = (0,
|
|
372
|
+
const clear = (0, import_react3.useCallback)((key) => {
|
|
345
373
|
setToasts((prev) => {
|
|
346
374
|
if (key) {
|
|
347
375
|
return prev.filter((toast) => toast.options?.containerKey !== key);
|
|
@@ -349,14 +377,14 @@ function ToasterProvider({ children }) {
|
|
|
349
377
|
return [];
|
|
350
378
|
});
|
|
351
379
|
}, []);
|
|
352
|
-
const subscribe = (0,
|
|
380
|
+
const subscribe = (0, import_react3.useCallback)((subscriber) => {
|
|
353
381
|
subscribersRef.current.add(subscriber);
|
|
354
382
|
subscriber(toasts);
|
|
355
383
|
return () => {
|
|
356
384
|
subscribersRef.current.delete(subscriber);
|
|
357
385
|
};
|
|
358
386
|
}, [toasts]);
|
|
359
|
-
const service = (0,
|
|
387
|
+
const service = (0, import_react3.useMemo)(
|
|
360
388
|
() => ({
|
|
361
389
|
info,
|
|
362
390
|
success,
|
|
@@ -369,28 +397,28 @@ function ToasterProvider({ children }) {
|
|
|
369
397
|
}),
|
|
370
398
|
[info, success, warn, error, show, remove, clear, subscribe]
|
|
371
399
|
);
|
|
372
|
-
const value = (0,
|
|
400
|
+
const value = (0, import_react3.useMemo)(
|
|
373
401
|
() => ({ service, toasts }),
|
|
374
402
|
[service, toasts]
|
|
375
403
|
);
|
|
376
404
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToasterContext.Provider, { value, children });
|
|
377
405
|
}
|
|
378
406
|
function useToaster() {
|
|
379
|
-
const context = (0,
|
|
407
|
+
const context = (0, import_react3.useContext)(ToasterContext);
|
|
380
408
|
if (!context) {
|
|
381
409
|
throw new Error("useToaster must be used within a ToasterProvider");
|
|
382
410
|
}
|
|
383
411
|
return context.service;
|
|
384
412
|
}
|
|
385
413
|
function useToasts() {
|
|
386
|
-
const context = (0,
|
|
414
|
+
const context = (0, import_react3.useContext)(ToasterContext);
|
|
387
415
|
if (!context) {
|
|
388
416
|
throw new Error("useToasts must be used within a ToasterProvider");
|
|
389
417
|
}
|
|
390
418
|
return context.toasts;
|
|
391
419
|
}
|
|
392
420
|
function useToasterContext() {
|
|
393
|
-
const context = (0,
|
|
421
|
+
const context = (0, import_react3.useContext)(ToasterContext);
|
|
394
422
|
if (!context) {
|
|
395
423
|
throw new Error("useToasterContext must be used within a ToasterProvider");
|
|
396
424
|
}
|
|
@@ -398,30 +426,30 @@ function useToasterContext() {
|
|
|
398
426
|
}
|
|
399
427
|
|
|
400
428
|
// src/contexts/confirmation.context.tsx
|
|
401
|
-
var
|
|
429
|
+
var import_react4 = require("react");
|
|
402
430
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
403
|
-
var ConfirmationContext = (0,
|
|
431
|
+
var ConfirmationContext = (0, import_react4.createContext)(null);
|
|
404
432
|
function generateId2() {
|
|
405
433
|
return `confirmation-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
406
434
|
}
|
|
407
435
|
function ConfirmationProvider({ children }) {
|
|
408
|
-
const [confirmation, setConfirmation] = (0,
|
|
409
|
-
const resolverRef = (0,
|
|
410
|
-
const subscribersRef = (0,
|
|
411
|
-
const escapeListenerRef = (0,
|
|
412
|
-
(0,
|
|
436
|
+
const [confirmation, setConfirmation] = (0, import_react4.useState)(null);
|
|
437
|
+
const resolverRef = (0, import_react4.useRef)(null);
|
|
438
|
+
const subscribersRef = (0, import_react4.useRef)(/* @__PURE__ */ new Set());
|
|
439
|
+
const escapeListenerRef = (0, import_react4.useRef)(false);
|
|
440
|
+
(0, import_react4.useEffect)(() => {
|
|
413
441
|
subscribersRef.current.forEach((subscriber) => {
|
|
414
442
|
subscriber(confirmation);
|
|
415
443
|
});
|
|
416
444
|
}, [confirmation]);
|
|
417
|
-
const respond = (0,
|
|
445
|
+
const respond = (0, import_react4.useCallback)((status) => {
|
|
418
446
|
if (resolverRef.current) {
|
|
419
447
|
resolverRef.current(status);
|
|
420
448
|
resolverRef.current = null;
|
|
421
449
|
}
|
|
422
450
|
setConfirmation(null);
|
|
423
451
|
}, []);
|
|
424
|
-
(0,
|
|
452
|
+
(0, import_react4.useEffect)(() => {
|
|
425
453
|
if (!escapeListenerRef.current) return;
|
|
426
454
|
const handleEscape = (event) => {
|
|
427
455
|
if (event.key === "Escape" && confirmation && confirmation.options?.closable !== false) {
|
|
@@ -433,7 +461,7 @@ function ConfirmationProvider({ children }) {
|
|
|
433
461
|
document.removeEventListener("keydown", handleEscape);
|
|
434
462
|
};
|
|
435
463
|
}, [confirmation, respond]);
|
|
436
|
-
const show = (0,
|
|
464
|
+
const show = (0, import_react4.useCallback)(
|
|
437
465
|
(message, title, severity = "neutral", options = {}) => {
|
|
438
466
|
if (resolverRef.current) {
|
|
439
467
|
resolverRef.current(Confirmation.Status.dismiss);
|
|
@@ -455,39 +483,39 @@ function ConfirmationProvider({ children }) {
|
|
|
455
483
|
},
|
|
456
484
|
[]
|
|
457
485
|
);
|
|
458
|
-
const info = (0,
|
|
486
|
+
const info = (0, import_react4.useCallback)(
|
|
459
487
|
(message, title, options) => show(message, title, "info", options),
|
|
460
488
|
[show]
|
|
461
489
|
);
|
|
462
|
-
const success = (0,
|
|
490
|
+
const success = (0, import_react4.useCallback)(
|
|
463
491
|
(message, title, options) => show(message, title, "success", options),
|
|
464
492
|
[show]
|
|
465
493
|
);
|
|
466
|
-
const warn = (0,
|
|
494
|
+
const warn = (0, import_react4.useCallback)(
|
|
467
495
|
(message, title, options) => show(message, title, "warning", options),
|
|
468
496
|
[show]
|
|
469
497
|
);
|
|
470
|
-
const error = (0,
|
|
498
|
+
const error = (0, import_react4.useCallback)(
|
|
471
499
|
(message, title, options) => show(message, title, "error", options),
|
|
472
500
|
[show]
|
|
473
501
|
);
|
|
474
|
-
const clear = (0,
|
|
502
|
+
const clear = (0, import_react4.useCallback)(
|
|
475
503
|
(status) => {
|
|
476
504
|
respond(status ?? Confirmation.Status.dismiss);
|
|
477
505
|
},
|
|
478
506
|
[respond]
|
|
479
507
|
);
|
|
480
|
-
const listenToEscape = (0,
|
|
508
|
+
const listenToEscape = (0, import_react4.useCallback)(() => {
|
|
481
509
|
escapeListenerRef.current = true;
|
|
482
510
|
}, []);
|
|
483
|
-
const subscribe = (0,
|
|
511
|
+
const subscribe = (0, import_react4.useCallback)((subscriber) => {
|
|
484
512
|
subscribersRef.current.add(subscriber);
|
|
485
513
|
subscriber(confirmation);
|
|
486
514
|
return () => {
|
|
487
515
|
subscribersRef.current.delete(subscriber);
|
|
488
516
|
};
|
|
489
517
|
}, [confirmation]);
|
|
490
|
-
const service = (0,
|
|
518
|
+
const service = (0, import_react4.useMemo)(
|
|
491
519
|
() => ({
|
|
492
520
|
info,
|
|
493
521
|
success,
|
|
@@ -500,36 +528,103 @@ function ConfirmationProvider({ children }) {
|
|
|
500
528
|
}),
|
|
501
529
|
[info, success, warn, error, show, clear, listenToEscape, subscribe]
|
|
502
530
|
);
|
|
503
|
-
const value = (0,
|
|
531
|
+
const value = (0, import_react4.useMemo)(
|
|
504
532
|
() => ({ service, confirmation, respond }),
|
|
505
533
|
[service, confirmation, respond]
|
|
506
534
|
);
|
|
507
535
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ConfirmationContext.Provider, { value, children });
|
|
508
536
|
}
|
|
509
537
|
function useConfirmation() {
|
|
510
|
-
const context = (0,
|
|
538
|
+
const context = (0, import_react4.useContext)(ConfirmationContext);
|
|
511
539
|
if (!context) {
|
|
512
540
|
throw new Error("useConfirmation must be used within a ConfirmationProvider");
|
|
513
541
|
}
|
|
514
542
|
return context.service;
|
|
515
543
|
}
|
|
516
544
|
function useConfirmationState() {
|
|
517
|
-
const context = (0,
|
|
545
|
+
const context = (0, import_react4.useContext)(ConfirmationContext);
|
|
518
546
|
if (!context) {
|
|
519
547
|
throw new Error("useConfirmationState must be used within a ConfirmationProvider");
|
|
520
548
|
}
|
|
521
549
|
return { confirmation: context.confirmation, respond: context.respond };
|
|
522
550
|
}
|
|
523
551
|
function useConfirmationContext() {
|
|
524
|
-
const context = (0,
|
|
552
|
+
const context = (0, import_react4.useContext)(ConfirmationContext);
|
|
525
553
|
if (!context) {
|
|
526
554
|
throw new Error("useConfirmationContext must be used within a ConfirmationProvider");
|
|
527
555
|
}
|
|
528
556
|
return context;
|
|
529
557
|
}
|
|
530
558
|
|
|
559
|
+
// src/contexts/modal.context.tsx
|
|
560
|
+
var import_react5 = require("react");
|
|
561
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
562
|
+
var ModalContext = (0, import_react5.createContext)(null);
|
|
563
|
+
function ModalProvider({ children }) {
|
|
564
|
+
const [modalState, setModalState] = (0, import_react5.useState)(null);
|
|
565
|
+
const [, setUpdateCounter] = (0, import_react5.useState)(0);
|
|
566
|
+
const containerRef = (0, import_react5.useRef)(null);
|
|
567
|
+
const renderTemplate = (0, import_react5.useCallback)((render, context) => {
|
|
568
|
+
setModalState({ render, context });
|
|
569
|
+
}, []);
|
|
570
|
+
const clearModal = (0, import_react5.useCallback)(() => {
|
|
571
|
+
setModalState(null);
|
|
572
|
+
}, []);
|
|
573
|
+
const getContainer = (0, import_react5.useCallback)(() => {
|
|
574
|
+
return containerRef;
|
|
575
|
+
}, []);
|
|
576
|
+
const detectChanges = (0, import_react5.useCallback)(() => {
|
|
577
|
+
setUpdateCounter((prev) => prev + 1);
|
|
578
|
+
}, []);
|
|
579
|
+
const service = (0, import_react5.useMemo)(
|
|
580
|
+
() => ({
|
|
581
|
+
renderTemplate,
|
|
582
|
+
clearModal,
|
|
583
|
+
getContainer,
|
|
584
|
+
detectChanges
|
|
585
|
+
}),
|
|
586
|
+
[renderTemplate, clearModal, getContainer, detectChanges]
|
|
587
|
+
);
|
|
588
|
+
const value = (0, import_react5.useMemo)(
|
|
589
|
+
() => ({ service, modalState }),
|
|
590
|
+
[service, modalState]
|
|
591
|
+
);
|
|
592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(ModalContext.Provider, { value, children: [
|
|
593
|
+
children,
|
|
594
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { ref: containerRef, id: "modal-container" })
|
|
595
|
+
] });
|
|
596
|
+
}
|
|
597
|
+
function useModal() {
|
|
598
|
+
const context = (0, import_react5.useContext)(ModalContext);
|
|
599
|
+
if (!context) {
|
|
600
|
+
throw new Error("useModal must be used within a ModalProvider");
|
|
601
|
+
}
|
|
602
|
+
return context.service;
|
|
603
|
+
}
|
|
604
|
+
function useModalState() {
|
|
605
|
+
const context = (0, import_react5.useContext)(ModalContext);
|
|
606
|
+
if (!context) {
|
|
607
|
+
throw new Error("useModalState must be used within a ModalProvider");
|
|
608
|
+
}
|
|
609
|
+
return context.modalState;
|
|
610
|
+
}
|
|
611
|
+
function useModalContext() {
|
|
612
|
+
const context = (0, import_react5.useContext)(ModalContext);
|
|
613
|
+
if (!context) {
|
|
614
|
+
throw new Error("useModalContext must be used within a ModalProvider");
|
|
615
|
+
}
|
|
616
|
+
return context;
|
|
617
|
+
}
|
|
618
|
+
function ModalContainer() {
|
|
619
|
+
const modalState = useModalState();
|
|
620
|
+
if (!modalState) {
|
|
621
|
+
return null;
|
|
622
|
+
}
|
|
623
|
+
return modalState.render(modalState.context);
|
|
624
|
+
}
|
|
625
|
+
|
|
531
626
|
// src/handlers/error.handler.ts
|
|
532
|
-
var
|
|
627
|
+
var import_react6 = require("react");
|
|
533
628
|
var DEFAULT_ERROR_MESSAGES = {
|
|
534
629
|
400: "AbpUi::DefaultErrorMessage400",
|
|
535
630
|
401: "AbpUi::DefaultErrorMessage401",
|
|
@@ -541,22 +636,22 @@ var DEFAULT_ERROR_MESSAGES = {
|
|
|
541
636
|
function useErrorHandler(options = {}) {
|
|
542
637
|
const { navigate, loginPath = "/account/login" } = options;
|
|
543
638
|
const confirmation = useConfirmation();
|
|
544
|
-
const [errorComponentProps, setErrorComponentProps] = (0,
|
|
545
|
-
const navigateToLogin = (0,
|
|
639
|
+
const [errorComponentProps, setErrorComponentProps] = (0, import_react6.useState)(null);
|
|
640
|
+
const navigateToLogin = (0, import_react6.useCallback)(() => {
|
|
546
641
|
if (navigate) {
|
|
547
642
|
navigate(loginPath);
|
|
548
643
|
}
|
|
549
644
|
}, [navigate, loginPath]);
|
|
550
|
-
const showError = (0,
|
|
645
|
+
const showError = (0, import_react6.useCallback)(
|
|
551
646
|
async (message, title) => {
|
|
552
647
|
return confirmation.error(message, title || "AbpUi::Error");
|
|
553
648
|
},
|
|
554
649
|
[confirmation]
|
|
555
650
|
);
|
|
556
|
-
const clearErrorComponent = (0,
|
|
651
|
+
const clearErrorComponent = (0, import_react6.useCallback)(() => {
|
|
557
652
|
setErrorComponentProps(null);
|
|
558
653
|
}, []);
|
|
559
|
-
const createErrorComponent = (0,
|
|
654
|
+
const createErrorComponent = (0, import_react6.useCallback)(
|
|
560
655
|
(instance) => {
|
|
561
656
|
const props = {
|
|
562
657
|
title: instance.title || "Error",
|
|
@@ -569,7 +664,7 @@ function useErrorHandler(options = {}) {
|
|
|
569
664
|
},
|
|
570
665
|
[clearErrorComponent]
|
|
571
666
|
);
|
|
572
|
-
const handleError = (0,
|
|
667
|
+
const handleError = (0, import_react6.useCallback)(
|
|
573
668
|
async (error) => {
|
|
574
669
|
if (error.status === 401) {
|
|
575
670
|
navigateToLogin();
|
|
@@ -611,11 +706,11 @@ function isHttpErrorResponse(error) {
|
|
|
611
706
|
}
|
|
612
707
|
|
|
613
708
|
// src/components/toast/Toast.tsx
|
|
614
|
-
var
|
|
615
|
-
var
|
|
709
|
+
var import_react7 = require("react");
|
|
710
|
+
var import_react8 = require("@chakra-ui/react");
|
|
616
711
|
var import_core = require("@abpjs/core");
|
|
617
712
|
var import_lucide_react = require("lucide-react");
|
|
618
|
-
var
|
|
713
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
619
714
|
function resolveLocalizationParam(param) {
|
|
620
715
|
if (param === void 0) return void 0;
|
|
621
716
|
if (typeof param === "string") return param;
|
|
@@ -625,16 +720,16 @@ function SeverityIcon({ severity }) {
|
|
|
625
720
|
const iconProps = { size: 20 };
|
|
626
721
|
switch (severity) {
|
|
627
722
|
case "success":
|
|
628
|
-
return /* @__PURE__ */ (0,
|
|
723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.CheckCircle, { ...iconProps, color: "var(--chakra-colors-green-500)" });
|
|
629
724
|
case "info":
|
|
630
|
-
return /* @__PURE__ */ (0,
|
|
725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.Info, { ...iconProps, color: "var(--chakra-colors-blue-500)" });
|
|
631
726
|
case "warning":
|
|
632
|
-
return /* @__PURE__ */ (0,
|
|
727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.AlertTriangle, { ...iconProps, color: "var(--chakra-colors-yellow-500)" });
|
|
633
728
|
case "error":
|
|
634
|
-
return /* @__PURE__ */ (0,
|
|
729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.XCircle, { ...iconProps, color: "var(--chakra-colors-red-500)" });
|
|
635
730
|
case "neutral":
|
|
636
731
|
default:
|
|
637
|
-
return /* @__PURE__ */ (0,
|
|
732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.Circle, { ...iconProps, color: "var(--chakra-colors-gray-500)" });
|
|
638
733
|
}
|
|
639
734
|
}
|
|
640
735
|
function getSeverityColorPalette(severity) {
|
|
@@ -719,7 +814,7 @@ function getPlacement(position) {
|
|
|
719
814
|
var toasterCache = /* @__PURE__ */ new Map();
|
|
720
815
|
function getToaster(placement) {
|
|
721
816
|
if (!toasterCache.has(placement)) {
|
|
722
|
-
toasterCache.set(placement, (0,
|
|
817
|
+
toasterCache.set(placement, (0, import_react8.createToaster)({
|
|
723
818
|
placement,
|
|
724
819
|
pauseOnPageIdle: true
|
|
725
820
|
}));
|
|
@@ -729,14 +824,14 @@ function getToaster(placement) {
|
|
|
729
824
|
function ToastContainer({ position = "bottom-right", containerKey }) {
|
|
730
825
|
const { toasts, service } = useToasterContext();
|
|
731
826
|
const { t } = (0, import_core.useLocalization)();
|
|
732
|
-
const displayedToastsRef = (0,
|
|
733
|
-
const placement = (0,
|
|
734
|
-
const toaster = (0,
|
|
735
|
-
const filteredToasts = (0,
|
|
827
|
+
const displayedToastsRef = (0, import_react7.useRef)(/* @__PURE__ */ new Set());
|
|
828
|
+
const placement = (0, import_react7.useMemo)(() => getPlacement(position), [position]);
|
|
829
|
+
const toaster = (0, import_react7.useMemo)(() => getToaster(placement), [placement]);
|
|
830
|
+
const filteredToasts = (0, import_react7.useMemo)(() => {
|
|
736
831
|
if (!containerKey) return toasts;
|
|
737
832
|
return toasts.filter((toast) => toast.options?.containerKey === containerKey);
|
|
738
833
|
}, [toasts, containerKey]);
|
|
739
|
-
(0,
|
|
834
|
+
(0, import_react7.useEffect)(() => {
|
|
740
835
|
const newToasts = filteredToasts.filter((toast) => !displayedToastsRef.current.has(toast.id));
|
|
741
836
|
newToasts.forEach((toast) => {
|
|
742
837
|
displayedToastsRef.current.add(toast.id);
|
|
@@ -769,11 +864,11 @@ function ToastContainer({ position = "bottom-right", containerKey }) {
|
|
|
769
864
|
});
|
|
770
865
|
});
|
|
771
866
|
}, [filteredToasts, t, service, toaster]);
|
|
772
|
-
return /* @__PURE__ */ (0,
|
|
867
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react8.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react8.Toaster, { toaster, insetInline: { mdDown: "4" }, children: (toast) => {
|
|
773
868
|
const severity = toast.meta?.severity || "info";
|
|
774
869
|
const closable = toast.meta?.closable !== false;
|
|
775
|
-
return /* @__PURE__ */ (0,
|
|
776
|
-
|
|
870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
871
|
+
import_react8.Toast.Root,
|
|
777
872
|
{
|
|
778
873
|
bg: getSeverityBg(severity),
|
|
779
874
|
borderWidth: "1px",
|
|
@@ -781,13 +876,13 @@ function ToastContainer({ position = "bottom-right", containerKey }) {
|
|
|
781
876
|
borderRadius: "lg",
|
|
782
877
|
boxShadow: "lg",
|
|
783
878
|
width: { md: "sm" },
|
|
784
|
-
children: /* @__PURE__ */ (0,
|
|
785
|
-
/* @__PURE__ */ (0,
|
|
786
|
-
/* @__PURE__ */ (0,
|
|
787
|
-
toast.title && /* @__PURE__ */ (0,
|
|
788
|
-
toast.description && /* @__PURE__ */ (0,
|
|
879
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react8.Flex, { align: "flex-start", gap: 3, p: 4, children: [
|
|
880
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react8.Box, { flexShrink: 0, pt: "2px", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SeverityIcon, { severity }) }),
|
|
881
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react8.Stack, { gap: 1, flex: 1, children: [
|
|
882
|
+
toast.title && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react8.Toast.Title, { fontWeight: "bold", fontSize: "sm", color: "fg", children: toast.title }),
|
|
883
|
+
toast.description && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react8.Toast.Description, { fontSize: "sm", color: "gray.700", children: toast.description })
|
|
789
884
|
] }),
|
|
790
|
-
closable && /* @__PURE__ */ (0,
|
|
885
|
+
closable && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react8.Toast.CloseTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react8.CloseButton, { size: "sm" }) })
|
|
791
886
|
] })
|
|
792
887
|
}
|
|
793
888
|
);
|
|
@@ -795,11 +890,11 @@ function ToastContainer({ position = "bottom-right", containerKey }) {
|
|
|
795
890
|
}
|
|
796
891
|
|
|
797
892
|
// src/components/confirmation/Confirmation.tsx
|
|
798
|
-
var
|
|
799
|
-
var
|
|
893
|
+
var import_react9 = require("react");
|
|
894
|
+
var import_react10 = require("@chakra-ui/react");
|
|
800
895
|
var import_core2 = require("@abpjs/core");
|
|
801
896
|
var import_lucide_react2 = require("lucide-react");
|
|
802
|
-
var
|
|
897
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
803
898
|
function resolveLocalizationParam2(param) {
|
|
804
899
|
if (param === void 0) return void 0;
|
|
805
900
|
if (typeof param === "string") return param;
|
|
@@ -814,16 +909,16 @@ function SeverityIcon2({ severity }) {
|
|
|
814
909
|
const iconProps = { size: 24 };
|
|
815
910
|
switch (severity) {
|
|
816
911
|
case "success":
|
|
817
|
-
return /* @__PURE__ */ (0,
|
|
912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.CheckCircle, { ...iconProps, color: "var(--chakra-colors-green-500)" });
|
|
818
913
|
case "info":
|
|
819
|
-
return /* @__PURE__ */ (0,
|
|
914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.Info, { ...iconProps, color: "var(--chakra-colors-blue-500)" });
|
|
820
915
|
case "warning":
|
|
821
|
-
return /* @__PURE__ */ (0,
|
|
916
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.AlertTriangle, { ...iconProps, color: "var(--chakra-colors-yellow-500)" });
|
|
822
917
|
case "error":
|
|
823
|
-
return /* @__PURE__ */ (0,
|
|
918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.XCircle, { ...iconProps, color: "var(--chakra-colors-red-500)" });
|
|
824
919
|
case "neutral":
|
|
825
920
|
default:
|
|
826
|
-
return /* @__PURE__ */ (0,
|
|
921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.Circle, { ...iconProps, color: "var(--chakra-colors-gray-500)" });
|
|
827
922
|
}
|
|
828
923
|
}
|
|
829
924
|
function getSeverityColorPalette2(severity) {
|
|
@@ -844,7 +939,7 @@ function getSeverityColorPalette2(severity) {
|
|
|
844
939
|
function ConfirmationDialog({ className }) {
|
|
845
940
|
const { confirmation, respond } = useConfirmationState();
|
|
846
941
|
const { t } = (0, import_core2.useLocalization)();
|
|
847
|
-
const cancelRef = (0,
|
|
942
|
+
const cancelRef = (0, import_react9.useRef)(null);
|
|
848
943
|
if (!confirmation) {
|
|
849
944
|
return null;
|
|
850
945
|
}
|
|
@@ -874,25 +969,25 @@ function ConfirmationDialog({ className }) {
|
|
|
874
969
|
handleDismiss();
|
|
875
970
|
}
|
|
876
971
|
};
|
|
877
|
-
return /* @__PURE__ */ (0,
|
|
878
|
-
|
|
972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
973
|
+
import_react10.Dialog.Root,
|
|
879
974
|
{
|
|
880
975
|
open: true,
|
|
881
976
|
onOpenChange: handleOpenChange,
|
|
882
977
|
role: "alertdialog",
|
|
883
978
|
placement: "center",
|
|
884
979
|
initialFocusEl: () => cancelRef.current,
|
|
885
|
-
children: /* @__PURE__ */ (0,
|
|
886
|
-
/* @__PURE__ */ (0,
|
|
887
|
-
/* @__PURE__ */ (0,
|
|
888
|
-
/* @__PURE__ */ (0,
|
|
889
|
-
/* @__PURE__ */ (0,
|
|
890
|
-
localizedTitle && /* @__PURE__ */ (0,
|
|
980
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react10.Portal, { children: [
|
|
981
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react10.Dialog.Backdrop, {}),
|
|
982
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react10.Dialog.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react10.Dialog.Content, { className, maxWidth: "md", children: [
|
|
983
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react10.Dialog.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react10.Flex, { align: "center", gap: 3, children: [
|
|
984
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SeverityIcon2, { severity }),
|
|
985
|
+
localizedTitle && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react10.Dialog.Title, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react10.Text, { fontWeight: "bold", fontSize: "lg", children: localizedTitle }) })
|
|
891
986
|
] }) }),
|
|
892
|
-
/* @__PURE__ */ (0,
|
|
893
|
-
/* @__PURE__ */ (0,
|
|
894
|
-
!options?.hideCancelBtn && /* @__PURE__ */ (0,
|
|
895
|
-
|
|
987
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react10.Dialog.Body, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react10.Text, { color: "gray.600", children: localizedMessage }) }),
|
|
988
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react10.Dialog.Footer, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react10.Flex, { gap: 3, children: [
|
|
989
|
+
!options?.hideCancelBtn && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
990
|
+
import_react10.Button,
|
|
896
991
|
{
|
|
897
992
|
ref: cancelRef,
|
|
898
993
|
variant: "ghost",
|
|
@@ -900,8 +995,8 @@ function ConfirmationDialog({ className }) {
|
|
|
900
995
|
children: cancelCopy
|
|
901
996
|
}
|
|
902
997
|
),
|
|
903
|
-
!options?.hideYesBtn && /* @__PURE__ */ (0,
|
|
904
|
-
|
|
998
|
+
!options?.hideYesBtn && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
999
|
+
import_react10.Button,
|
|
905
1000
|
{
|
|
906
1001
|
colorPalette: getSeverityColorPalette2(severity),
|
|
907
1002
|
onClick: handleConfirm,
|
|
@@ -916,18 +1011,21 @@ function ConfirmationDialog({ className }) {
|
|
|
916
1011
|
}
|
|
917
1012
|
|
|
918
1013
|
// src/components/errors/ErrorComponent.tsx
|
|
919
|
-
var
|
|
920
|
-
var
|
|
1014
|
+
var import_react11 = require("@chakra-ui/react");
|
|
1015
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
921
1016
|
function ErrorComponent({
|
|
922
1017
|
title = "Error",
|
|
923
1018
|
details = "An error has occurred.",
|
|
924
1019
|
onDestroy,
|
|
925
1020
|
showCloseButton = true,
|
|
926
|
-
closeButtonText = "Go Back"
|
|
1021
|
+
closeButtonText = "Go Back",
|
|
1022
|
+
isHomeShow = false,
|
|
1023
|
+
onHomeClick,
|
|
1024
|
+
homeButtonText = "Go Home"
|
|
927
1025
|
}) {
|
|
928
|
-
return /* @__PURE__ */ (0,
|
|
929
|
-
/* @__PURE__ */ (0,
|
|
930
|
-
|
|
1026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react11.Container, { maxW: "container.md", py: 20, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react11.VStack, { gap: 6, textAlign: "center", children: [
|
|
1027
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1028
|
+
import_react11.Heading,
|
|
931
1029
|
{
|
|
932
1030
|
size: "4xl",
|
|
933
1031
|
color: "red.500",
|
|
@@ -935,23 +1033,34 @@ function ErrorComponent({
|
|
|
935
1033
|
children: title
|
|
936
1034
|
}
|
|
937
1035
|
),
|
|
938
|
-
/* @__PURE__ */ (0,
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
1036
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react11.Text, { fontSize: "lg", color: "gray.600", children: details }),
|
|
1037
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react11.Box, { display: "flex", gap: 3, children: [
|
|
1038
|
+
isHomeShow && onHomeClick && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1039
|
+
import_react11.Button,
|
|
1040
|
+
{
|
|
1041
|
+
colorPalette: "green",
|
|
1042
|
+
size: "lg",
|
|
1043
|
+
onClick: onHomeClick,
|
|
1044
|
+
children: homeButtonText
|
|
1045
|
+
}
|
|
1046
|
+
),
|
|
1047
|
+
showCloseButton && onDestroy && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1048
|
+
import_react11.Button,
|
|
1049
|
+
{
|
|
1050
|
+
colorPalette: "blue",
|
|
1051
|
+
size: "lg",
|
|
1052
|
+
onClick: onDestroy,
|
|
1053
|
+
children: closeButtonText
|
|
1054
|
+
}
|
|
1055
|
+
)
|
|
1056
|
+
] })
|
|
948
1057
|
] }) });
|
|
949
1058
|
}
|
|
950
1059
|
|
|
951
1060
|
// src/components/loader-bar/LoaderBar.tsx
|
|
952
|
-
var
|
|
1061
|
+
var import_react12 = require("react");
|
|
953
1062
|
var import_core3 = require("@abpjs/core");
|
|
954
|
-
var
|
|
1063
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
955
1064
|
function LoaderBar({
|
|
956
1065
|
containerClass = "abp-loader-bar",
|
|
957
1066
|
progressClass = "abp-progress",
|
|
@@ -960,17 +1069,17 @@ function LoaderBar({
|
|
|
960
1069
|
stopDelay = 400
|
|
961
1070
|
}) {
|
|
962
1071
|
const { loading } = (0, import_core3.useLoader)();
|
|
963
|
-
const [isLoading, setIsLoading] = (0,
|
|
964
|
-
const [progressLevel, setProgressLevel] = (0,
|
|
965
|
-
const intervalRef = (0,
|
|
966
|
-
(0,
|
|
1072
|
+
const [isLoading, setIsLoading] = (0, import_react12.useState)(false);
|
|
1073
|
+
const [progressLevel, setProgressLevel] = (0, import_react12.useState)(0);
|
|
1074
|
+
const intervalRef = (0, import_react12.useRef)(null);
|
|
1075
|
+
(0, import_react12.useEffect)(() => {
|
|
967
1076
|
if (loading) {
|
|
968
1077
|
startLoading();
|
|
969
1078
|
} else {
|
|
970
1079
|
stopLoading();
|
|
971
1080
|
}
|
|
972
1081
|
}, [loading]);
|
|
973
|
-
(0,
|
|
1082
|
+
(0, import_react12.useEffect)(() => {
|
|
974
1083
|
return () => {
|
|
975
1084
|
if (intervalRef.current) {
|
|
976
1085
|
clearInterval(intervalRef.current);
|
|
@@ -1010,7 +1119,7 @@ function LoaderBar({
|
|
|
1010
1119
|
if (!isLoading && progressLevel === 0) {
|
|
1011
1120
|
return null;
|
|
1012
1121
|
}
|
|
1013
|
-
return /* @__PURE__ */ (0,
|
|
1122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1014
1123
|
"div",
|
|
1015
1124
|
{
|
|
1016
1125
|
className: containerClass,
|
|
@@ -1024,7 +1133,7 @@ function LoaderBar({
|
|
|
1024
1133
|
backgroundColor: "rgba(0, 0, 0, 0.1)",
|
|
1025
1134
|
overflow: "hidden"
|
|
1026
1135
|
},
|
|
1027
|
-
children: /* @__PURE__ */ (0,
|
|
1136
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1028
1137
|
"div",
|
|
1029
1138
|
{
|
|
1030
1139
|
className: progressClass,
|
|
@@ -1041,9 +1150,9 @@ function LoaderBar({
|
|
|
1041
1150
|
}
|
|
1042
1151
|
|
|
1043
1152
|
// src/components/modal/Modal.tsx
|
|
1044
|
-
var
|
|
1045
|
-
var
|
|
1046
|
-
var
|
|
1153
|
+
var import_react13 = __toESM(require("react"));
|
|
1154
|
+
var import_react14 = require("@chakra-ui/react");
|
|
1155
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1047
1156
|
function getSizeWidth(size) {
|
|
1048
1157
|
switch (size) {
|
|
1049
1158
|
case "sm":
|
|
@@ -1081,12 +1190,12 @@ function Modal({
|
|
|
1081
1190
|
preventScroll = true,
|
|
1082
1191
|
onInit
|
|
1083
1192
|
}) {
|
|
1084
|
-
const prevVisibleRef =
|
|
1085
|
-
const onInitRef =
|
|
1086
|
-
|
|
1193
|
+
const prevVisibleRef = import_react13.default.useRef(false);
|
|
1194
|
+
const onInitRef = import_react13.default.useRef(onInit);
|
|
1195
|
+
import_react13.default.useEffect(() => {
|
|
1087
1196
|
onInitRef.current = onInit;
|
|
1088
1197
|
}, [onInit]);
|
|
1089
|
-
|
|
1198
|
+
import_react13.default.useEffect(() => {
|
|
1090
1199
|
if (visible && !prevVisibleRef.current && onInitRef.current) {
|
|
1091
1200
|
onInitRef.current();
|
|
1092
1201
|
}
|
|
@@ -1098,8 +1207,8 @@ function Modal({
|
|
|
1098
1207
|
}
|
|
1099
1208
|
onVisibleChange?.(details.open);
|
|
1100
1209
|
};
|
|
1101
|
-
return /* @__PURE__ */ (0,
|
|
1102
|
-
|
|
1210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1211
|
+
import_react14.Dialog.Root,
|
|
1103
1212
|
{
|
|
1104
1213
|
open: visible,
|
|
1105
1214
|
onOpenChange: handleOpenChange,
|
|
@@ -1110,10 +1219,10 @@ function Modal({
|
|
|
1110
1219
|
motionPreset,
|
|
1111
1220
|
trapFocus,
|
|
1112
1221
|
preventScroll,
|
|
1113
|
-
children: /* @__PURE__ */ (0,
|
|
1114
|
-
/* @__PURE__ */ (0,
|
|
1115
|
-
/* @__PURE__ */ (0,
|
|
1116
|
-
|
|
1222
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react14.Portal, { children: [
|
|
1223
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react14.Dialog.Backdrop, {}),
|
|
1224
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react14.Dialog.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1225
|
+
import_react14.Dialog.Content,
|
|
1117
1226
|
{
|
|
1118
1227
|
className: modalClass,
|
|
1119
1228
|
width: getSizeWidth(size),
|
|
@@ -1122,17 +1231,17 @@ function Modal({
|
|
|
1122
1231
|
height,
|
|
1123
1232
|
minHeight,
|
|
1124
1233
|
children: [
|
|
1125
|
-
(header || showCloseButton) && /* @__PURE__ */ (0,
|
|
1126
|
-
/* @__PURE__ */ (0,
|
|
1127
|
-
header && /* @__PURE__ */ (0,
|
|
1128
|
-
showCloseButton && /* @__PURE__ */ (0,
|
|
1234
|
+
(header || showCloseButton) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1235
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react14.Dialog.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react14.Flex, { justify: "space-between", align: "center", width: "100%", children: [
|
|
1236
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react14.Dialog.Title, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react14.Text, { fontWeight: "bold", fontSize: "lg", children: header }) }),
|
|
1237
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react14.Dialog.CloseTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react14.CloseButton, { size: "sm" }) })
|
|
1129
1238
|
] }) }),
|
|
1130
|
-
/* @__PURE__ */ (0,
|
|
1239
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react14.Separator, {})
|
|
1131
1240
|
] }),
|
|
1132
|
-
children && /* @__PURE__ */ (0,
|
|
1133
|
-
footer && /* @__PURE__ */ (0,
|
|
1134
|
-
/* @__PURE__ */ (0,
|
|
1135
|
-
/* @__PURE__ */ (0,
|
|
1241
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react14.Dialog.Body, { py: 4, children }),
|
|
1242
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1243
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react14.Separator, {}),
|
|
1244
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react14.Dialog.Footer, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react14.Flex, { gap: 3, justify: "flex-end", w: "100%", children: footer }) })
|
|
1136
1245
|
] })
|
|
1137
1246
|
]
|
|
1138
1247
|
}
|
|
@@ -1142,18 +1251,18 @@ function Modal({
|
|
|
1142
1251
|
);
|
|
1143
1252
|
}
|
|
1144
1253
|
function AbpModalHeader({ children, className }) {
|
|
1145
|
-
return /* @__PURE__ */ (0,
|
|
1254
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react14.Text, { fontWeight: "bold", fontSize: "lg", className, children });
|
|
1146
1255
|
}
|
|
1147
1256
|
function AbpModalBody({ children, className }) {
|
|
1148
|
-
return /* @__PURE__ */ (0,
|
|
1257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react14.Box, { color: "gray.600", className, children });
|
|
1149
1258
|
}
|
|
1150
1259
|
function AbpModalFooter({ children, className }) {
|
|
1151
|
-
return /* @__PURE__ */ (0,
|
|
1260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react14.Flex, { gap: 3, justify: "flex-end", className, children });
|
|
1152
1261
|
}
|
|
1153
1262
|
|
|
1154
1263
|
// src/components/ui/Alert.tsx
|
|
1155
|
-
var
|
|
1156
|
-
var
|
|
1264
|
+
var import_react15 = require("@chakra-ui/react");
|
|
1265
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1157
1266
|
function Alert({
|
|
1158
1267
|
status = "info",
|
|
1159
1268
|
children,
|
|
@@ -1164,29 +1273,29 @@ function Alert({
|
|
|
1164
1273
|
mb,
|
|
1165
1274
|
borderRadius = "md"
|
|
1166
1275
|
}) {
|
|
1167
|
-
return /* @__PURE__ */ (0,
|
|
1168
|
-
|
|
1276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1277
|
+
import_react15.Alert.Root,
|
|
1169
1278
|
{
|
|
1170
1279
|
status,
|
|
1171
1280
|
className,
|
|
1172
1281
|
mb,
|
|
1173
1282
|
borderRadius,
|
|
1174
1283
|
children: [
|
|
1175
|
-
showIcon && /* @__PURE__ */ (0,
|
|
1176
|
-
title ? /* @__PURE__ */ (0,
|
|
1177
|
-
/* @__PURE__ */ (0,
|
|
1178
|
-
(description || children) && /* @__PURE__ */ (0,
|
|
1179
|
-
] }) : /* @__PURE__ */ (0,
|
|
1284
|
+
showIcon && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react15.Alert.Indicator, {}),
|
|
1285
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
1286
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react15.Alert.Title, { children: title }),
|
|
1287
|
+
(description || children) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react15.Alert.Description, { children: description || children })
|
|
1288
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react15.Alert.Title, { children })
|
|
1180
1289
|
]
|
|
1181
1290
|
}
|
|
1182
1291
|
);
|
|
1183
1292
|
}
|
|
1184
1293
|
|
|
1185
1294
|
// src/components/ui/Button.tsx
|
|
1186
|
-
var
|
|
1187
|
-
var
|
|
1188
|
-
var
|
|
1189
|
-
var Button3 = (0,
|
|
1295
|
+
var import_react16 = require("react");
|
|
1296
|
+
var import_react17 = require("@chakra-ui/react");
|
|
1297
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1298
|
+
var Button3 = (0, import_react16.forwardRef)(
|
|
1190
1299
|
function Button4({
|
|
1191
1300
|
children,
|
|
1192
1301
|
type = "button",
|
|
@@ -1202,8 +1311,8 @@ var Button3 = (0, import_react14.forwardRef)(
|
|
|
1202
1311
|
mr,
|
|
1203
1312
|
ml
|
|
1204
1313
|
}, ref) {
|
|
1205
|
-
return /* @__PURE__ */ (0,
|
|
1206
|
-
|
|
1314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1315
|
+
import_react17.Button,
|
|
1207
1316
|
{
|
|
1208
1317
|
ref,
|
|
1209
1318
|
type,
|
|
@@ -1225,10 +1334,10 @@ var Button3 = (0, import_react14.forwardRef)(
|
|
|
1225
1334
|
);
|
|
1226
1335
|
|
|
1227
1336
|
// src/components/ui/Checkbox.tsx
|
|
1228
|
-
var
|
|
1229
|
-
var
|
|
1230
|
-
var
|
|
1231
|
-
var Checkbox = (0,
|
|
1337
|
+
var import_react18 = require("react");
|
|
1338
|
+
var import_react19 = require("@chakra-ui/react");
|
|
1339
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1340
|
+
var Checkbox = (0, import_react18.forwardRef)(
|
|
1232
1341
|
function Checkbox2({
|
|
1233
1342
|
children,
|
|
1234
1343
|
checked,
|
|
@@ -1245,8 +1354,8 @@ var Checkbox = (0, import_react16.forwardRef)(
|
|
|
1245
1354
|
onChange,
|
|
1246
1355
|
className
|
|
1247
1356
|
}, ref) {
|
|
1248
|
-
return /* @__PURE__ */ (0,
|
|
1249
|
-
|
|
1357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1358
|
+
import_react19.Checkbox.Root,
|
|
1250
1359
|
{
|
|
1251
1360
|
checked,
|
|
1252
1361
|
defaultChecked,
|
|
@@ -1258,8 +1367,8 @@ var Checkbox = (0, import_react16.forwardRef)(
|
|
|
1258
1367
|
size,
|
|
1259
1368
|
className,
|
|
1260
1369
|
children: [
|
|
1261
|
-
/* @__PURE__ */ (0,
|
|
1262
|
-
|
|
1370
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1371
|
+
import_react19.Checkbox.HiddenInput,
|
|
1263
1372
|
{
|
|
1264
1373
|
ref,
|
|
1265
1374
|
id,
|
|
@@ -1268,8 +1377,8 @@ var Checkbox = (0, import_react16.forwardRef)(
|
|
|
1268
1377
|
onChange
|
|
1269
1378
|
}
|
|
1270
1379
|
),
|
|
1271
|
-
/* @__PURE__ */ (0,
|
|
1272
|
-
children && /* @__PURE__ */ (0,
|
|
1380
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react19.Checkbox.Control, {}),
|
|
1381
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react19.Checkbox.Label, { children })
|
|
1273
1382
|
]
|
|
1274
1383
|
}
|
|
1275
1384
|
);
|
|
@@ -1277,8 +1386,8 @@ var Checkbox = (0, import_react16.forwardRef)(
|
|
|
1277
1386
|
);
|
|
1278
1387
|
|
|
1279
1388
|
// src/components/ui/FormField.tsx
|
|
1280
|
-
var
|
|
1281
|
-
var
|
|
1389
|
+
var import_react20 = require("@chakra-ui/react");
|
|
1390
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1282
1391
|
function FormField({
|
|
1283
1392
|
label,
|
|
1284
1393
|
invalid = false,
|
|
@@ -1290,24 +1399,24 @@ function FormField({
|
|
|
1290
1399
|
htmlFor,
|
|
1291
1400
|
className
|
|
1292
1401
|
}) {
|
|
1293
|
-
return /* @__PURE__ */ (0,
|
|
1294
|
-
label && /* @__PURE__ */ (0,
|
|
1402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react20.Field.Root, { invalid, disabled, className, children: [
|
|
1403
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react20.Field.Label, { htmlFor, children: [
|
|
1295
1404
|
label,
|
|
1296
|
-
required && /* @__PURE__ */ (0,
|
|
1405
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react20.Field.RequiredIndicator, {})
|
|
1297
1406
|
] }),
|
|
1298
1407
|
children,
|
|
1299
|
-
helperText && !invalid && /* @__PURE__ */ (0,
|
|
1300
|
-
invalid && errorText && /* @__PURE__ */ (0,
|
|
1408
|
+
helperText && !invalid && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react20.Field.HelperText, { children: helperText }),
|
|
1409
|
+
invalid && errorText && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react20.Field.ErrorText, { children: errorText })
|
|
1301
1410
|
] });
|
|
1302
1411
|
}
|
|
1303
1412
|
|
|
1304
1413
|
// src/components/change-password/ChangePassword.tsx
|
|
1305
|
-
var
|
|
1306
|
-
var
|
|
1414
|
+
var import_react21 = require("react");
|
|
1415
|
+
var import_react22 = require("@chakra-ui/react");
|
|
1307
1416
|
var import_react_hook_form = require("react-hook-form");
|
|
1308
1417
|
var import_core4 = require("@abpjs/core");
|
|
1309
1418
|
var import_lucide_react3 = require("lucide-react");
|
|
1310
|
-
var
|
|
1419
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1311
1420
|
function ChangePassword({
|
|
1312
1421
|
visible,
|
|
1313
1422
|
onVisibleChange
|
|
@@ -1329,7 +1438,7 @@ function ChangePassword({
|
|
|
1329
1438
|
}
|
|
1330
1439
|
});
|
|
1331
1440
|
const newPassword = watch("newPassword");
|
|
1332
|
-
(0,
|
|
1441
|
+
(0, import_react21.useEffect)(() => {
|
|
1333
1442
|
if (visible) {
|
|
1334
1443
|
reset();
|
|
1335
1444
|
}
|
|
@@ -1370,23 +1479,23 @@ function ChangePassword({
|
|
|
1370
1479
|
hasSpecial: (value) => /[!@#$%^&*(),.?":{}|<>]/.test(value) || t("AbpIdentity::PasswordRequiresNonAlphanumeric") || "Password must contain a special character"
|
|
1371
1480
|
}
|
|
1372
1481
|
};
|
|
1373
|
-
const modalFooter = /* @__PURE__ */ (0,
|
|
1374
|
-
/* @__PURE__ */ (0,
|
|
1375
|
-
/* @__PURE__ */ (0,
|
|
1376
|
-
|
|
1482
|
+
const modalFooter = /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1483
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react22.Button, { variant: "ghost", mr: 3, onClick: handleClose, disabled: isSubmitting, children: t("AbpIdentity::Cancel") || "Cancel" }),
|
|
1484
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1485
|
+
import_react22.Button,
|
|
1377
1486
|
{
|
|
1378
1487
|
colorPalette: "blue",
|
|
1379
1488
|
type: "submit",
|
|
1380
1489
|
loading: isSubmitting,
|
|
1381
1490
|
form: "change-password-form",
|
|
1382
1491
|
children: [
|
|
1383
|
-
/* @__PURE__ */ (0,
|
|
1492
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react3.Check, { size: 16 }),
|
|
1384
1493
|
t("AbpIdentity::Save") || "Save"
|
|
1385
1494
|
]
|
|
1386
1495
|
}
|
|
1387
1496
|
)
|
|
1388
1497
|
] });
|
|
1389
|
-
return /* @__PURE__ */ (0,
|
|
1498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1390
1499
|
Modal,
|
|
1391
1500
|
{
|
|
1392
1501
|
visible,
|
|
@@ -1395,14 +1504,14 @@ function ChangePassword({
|
|
|
1395
1504
|
header: t("AbpIdentity::ChangePassword") || "Change Password",
|
|
1396
1505
|
footer: modalFooter,
|
|
1397
1506
|
centered: true,
|
|
1398
|
-
children: /* @__PURE__ */ (0,
|
|
1399
|
-
/* @__PURE__ */ (0,
|
|
1400
|
-
/* @__PURE__ */ (0,
|
|
1507
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("form", { id: "change-password-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react22.VStack, { gap: 4, children: [
|
|
1508
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react22.Field.Root, { invalid: !!errors.password, children: [
|
|
1509
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react22.Field.Label, { children: [
|
|
1401
1510
|
t("AbpIdentity::DisplayName:CurrentPassword") || "Current Password",
|
|
1402
|
-
/* @__PURE__ */ (0,
|
|
1511
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react22.Field.RequiredIndicator, {})
|
|
1403
1512
|
] }),
|
|
1404
|
-
/* @__PURE__ */ (0,
|
|
1405
|
-
|
|
1513
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1514
|
+
import_react22.Input,
|
|
1406
1515
|
{
|
|
1407
1516
|
type: "password",
|
|
1408
1517
|
...register("password", {
|
|
@@ -1410,29 +1519,29 @@ function ChangePassword({
|
|
|
1410
1519
|
})
|
|
1411
1520
|
}
|
|
1412
1521
|
),
|
|
1413
|
-
/* @__PURE__ */ (0,
|
|
1522
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react22.Field.ErrorText, { children: errors.password?.message })
|
|
1414
1523
|
] }),
|
|
1415
|
-
/* @__PURE__ */ (0,
|
|
1416
|
-
/* @__PURE__ */ (0,
|
|
1524
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react22.Field.Root, { invalid: !!errors.newPassword, children: [
|
|
1525
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react22.Field.Label, { children: [
|
|
1417
1526
|
t("AbpIdentity::DisplayName:NewPassword") || "New Password",
|
|
1418
|
-
/* @__PURE__ */ (0,
|
|
1527
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react22.Field.RequiredIndicator, {})
|
|
1419
1528
|
] }),
|
|
1420
|
-
/* @__PURE__ */ (0,
|
|
1421
|
-
|
|
1529
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1530
|
+
import_react22.Input,
|
|
1422
1531
|
{
|
|
1423
1532
|
type: "password",
|
|
1424
1533
|
...register("newPassword", passwordValidation)
|
|
1425
1534
|
}
|
|
1426
1535
|
),
|
|
1427
|
-
/* @__PURE__ */ (0,
|
|
1536
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react22.Field.ErrorText, { children: errors.newPassword?.message })
|
|
1428
1537
|
] }),
|
|
1429
|
-
/* @__PURE__ */ (0,
|
|
1430
|
-
/* @__PURE__ */ (0,
|
|
1538
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react22.Field.Root, { invalid: !!errors.repeatNewPassword, children: [
|
|
1539
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react22.Field.Label, { children: [
|
|
1431
1540
|
t("AbpIdentity::DisplayName:NewPasswordConfirm") || "Confirm New Password",
|
|
1432
|
-
/* @__PURE__ */ (0,
|
|
1541
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react22.Field.RequiredIndicator, {})
|
|
1433
1542
|
] }),
|
|
1434
|
-
/* @__PURE__ */ (0,
|
|
1435
|
-
|
|
1543
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1544
|
+
import_react22.Input,
|
|
1436
1545
|
{
|
|
1437
1546
|
type: "password",
|
|
1438
1547
|
...register("repeatNewPassword", {
|
|
@@ -1441,7 +1550,7 @@ function ChangePassword({
|
|
|
1441
1550
|
})
|
|
1442
1551
|
}
|
|
1443
1552
|
),
|
|
1444
|
-
/* @__PURE__ */ (0,
|
|
1553
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react22.Field.ErrorText, { children: errors.repeatNewPassword?.message })
|
|
1445
1554
|
] })
|
|
1446
1555
|
] }) })
|
|
1447
1556
|
}
|
|
@@ -1449,12 +1558,12 @@ function ChangePassword({
|
|
|
1449
1558
|
}
|
|
1450
1559
|
|
|
1451
1560
|
// src/components/profile/Profile.tsx
|
|
1452
|
-
var
|
|
1453
|
-
var
|
|
1561
|
+
var import_react23 = require("react");
|
|
1562
|
+
var import_react24 = require("@chakra-ui/react");
|
|
1454
1563
|
var import_react_hook_form2 = require("react-hook-form");
|
|
1455
1564
|
var import_core5 = require("@abpjs/core");
|
|
1456
1565
|
var import_lucide_react4 = require("lucide-react");
|
|
1457
|
-
var
|
|
1566
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1458
1567
|
function Profile({
|
|
1459
1568
|
visible,
|
|
1460
1569
|
onVisibleChange
|
|
@@ -1477,13 +1586,13 @@ function Profile({
|
|
|
1477
1586
|
}
|
|
1478
1587
|
});
|
|
1479
1588
|
const modalBusy = isSubmitting || loading;
|
|
1480
|
-
(0,
|
|
1589
|
+
(0, import_react23.useEffect)(() => {
|
|
1481
1590
|
if (visible) {
|
|
1482
1591
|
fetchProfile().then(() => {
|
|
1483
1592
|
});
|
|
1484
1593
|
}
|
|
1485
1594
|
}, [visible, fetchProfile]);
|
|
1486
|
-
(0,
|
|
1595
|
+
(0, import_react23.useEffect)(() => {
|
|
1487
1596
|
if (profile) {
|
|
1488
1597
|
reset({
|
|
1489
1598
|
userName: profile.userName || "",
|
|
@@ -1514,23 +1623,23 @@ function Profile({
|
|
|
1514
1623
|
onVisibleChange(false);
|
|
1515
1624
|
}
|
|
1516
1625
|
};
|
|
1517
|
-
const modalFooter = /* @__PURE__ */ (0,
|
|
1518
|
-
/* @__PURE__ */ (0,
|
|
1519
|
-
/* @__PURE__ */ (0,
|
|
1520
|
-
|
|
1626
|
+
const modalFooter = /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1627
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react24.Button, { variant: "ghost", mr: 3, onClick: handleClose, disabled: modalBusy, children: t("AbpIdentity::Cancel") || "Cancel" }),
|
|
1628
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1629
|
+
import_react24.Button,
|
|
1521
1630
|
{
|
|
1522
1631
|
colorPalette: "blue",
|
|
1523
1632
|
type: "submit",
|
|
1524
1633
|
loading: modalBusy,
|
|
1525
1634
|
form: "profile-form",
|
|
1526
1635
|
children: [
|
|
1527
|
-
/* @__PURE__ */ (0,
|
|
1636
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react4.Check, { size: 16 }),
|
|
1528
1637
|
t("AbpIdentity::Save") || "Save"
|
|
1529
1638
|
]
|
|
1530
1639
|
}
|
|
1531
1640
|
)
|
|
1532
1641
|
] });
|
|
1533
|
-
return /* @__PURE__ */ (0,
|
|
1642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1534
1643
|
Modal,
|
|
1535
1644
|
{
|
|
1536
1645
|
visible,
|
|
@@ -1540,14 +1649,14 @@ function Profile({
|
|
|
1540
1649
|
footer: modalFooter,
|
|
1541
1650
|
size: "lg",
|
|
1542
1651
|
centered: true,
|
|
1543
|
-
children: /* @__PURE__ */ (0,
|
|
1544
|
-
/* @__PURE__ */ (0,
|
|
1545
|
-
/* @__PURE__ */ (0,
|
|
1652
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("form", { id: "profile-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react24.VStack, { gap: 4, children: [
|
|
1653
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react24.Field.Root, { invalid: !!errors.userName, children: [
|
|
1654
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react24.Field.Label, { children: [
|
|
1546
1655
|
t("AbpIdentity::DisplayName:UserName") || "Username",
|
|
1547
|
-
/* @__PURE__ */ (0,
|
|
1656
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react24.Field.RequiredIndicator, {})
|
|
1548
1657
|
] }),
|
|
1549
|
-
/* @__PURE__ */ (0,
|
|
1550
|
-
|
|
1658
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1659
|
+
import_react24.Input,
|
|
1551
1660
|
{
|
|
1552
1661
|
type: "text",
|
|
1553
1662
|
...register("userName", {
|
|
@@ -1559,13 +1668,13 @@ function Profile({
|
|
|
1559
1668
|
})
|
|
1560
1669
|
}
|
|
1561
1670
|
),
|
|
1562
|
-
/* @__PURE__ */ (0,
|
|
1671
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react24.Field.ErrorText, { children: errors.userName?.message })
|
|
1563
1672
|
] }),
|
|
1564
|
-
/* @__PURE__ */ (0,
|
|
1565
|
-
/* @__PURE__ */ (0,
|
|
1566
|
-
/* @__PURE__ */ (0,
|
|
1567
|
-
/* @__PURE__ */ (0,
|
|
1568
|
-
|
|
1673
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react24.HStack, { gap: 4, w: "full", children: [
|
|
1674
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react24.Field.Root, { invalid: !!errors.name, flex: 1, children: [
|
|
1675
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react24.Field.Label, { children: t("AbpIdentity::DisplayName:Name") || "Name" }),
|
|
1676
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1677
|
+
import_react24.Input,
|
|
1569
1678
|
{
|
|
1570
1679
|
type: "text",
|
|
1571
1680
|
...register("name", {
|
|
@@ -1576,12 +1685,12 @@ function Profile({
|
|
|
1576
1685
|
})
|
|
1577
1686
|
}
|
|
1578
1687
|
),
|
|
1579
|
-
/* @__PURE__ */ (0,
|
|
1688
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react24.Field.ErrorText, { children: errors.name?.message })
|
|
1580
1689
|
] }),
|
|
1581
|
-
/* @__PURE__ */ (0,
|
|
1582
|
-
/* @__PURE__ */ (0,
|
|
1583
|
-
/* @__PURE__ */ (0,
|
|
1584
|
-
|
|
1690
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react24.Field.Root, { invalid: !!errors.surname, flex: 1, children: [
|
|
1691
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react24.Field.Label, { children: t("AbpIdentity::DisplayName:Surname") || "Surname" }),
|
|
1692
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1693
|
+
import_react24.Input,
|
|
1585
1694
|
{
|
|
1586
1695
|
type: "text",
|
|
1587
1696
|
...register("surname", {
|
|
@@ -1592,16 +1701,16 @@ function Profile({
|
|
|
1592
1701
|
})
|
|
1593
1702
|
}
|
|
1594
1703
|
),
|
|
1595
|
-
/* @__PURE__ */ (0,
|
|
1704
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react24.Field.ErrorText, { children: errors.surname?.message })
|
|
1596
1705
|
] })
|
|
1597
1706
|
] }),
|
|
1598
|
-
/* @__PURE__ */ (0,
|
|
1599
|
-
/* @__PURE__ */ (0,
|
|
1707
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react24.Field.Root, { invalid: !!errors.email, children: [
|
|
1708
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react24.Field.Label, { children: [
|
|
1600
1709
|
t("AbpIdentity::DisplayName:EmailAddress") || "Email Address",
|
|
1601
|
-
/* @__PURE__ */ (0,
|
|
1710
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react24.Field.RequiredIndicator, {})
|
|
1602
1711
|
] }),
|
|
1603
|
-
/* @__PURE__ */ (0,
|
|
1604
|
-
|
|
1712
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1713
|
+
import_react24.Input,
|
|
1605
1714
|
{
|
|
1606
1715
|
type: "email",
|
|
1607
1716
|
...register("email", {
|
|
@@ -1617,12 +1726,12 @@ function Profile({
|
|
|
1617
1726
|
})
|
|
1618
1727
|
}
|
|
1619
1728
|
),
|
|
1620
|
-
/* @__PURE__ */ (0,
|
|
1729
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react24.Field.ErrorText, { children: errors.email?.message })
|
|
1621
1730
|
] }),
|
|
1622
|
-
/* @__PURE__ */ (0,
|
|
1623
|
-
/* @__PURE__ */ (0,
|
|
1624
|
-
/* @__PURE__ */ (0,
|
|
1625
|
-
|
|
1731
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react24.Field.Root, { invalid: !!errors.phoneNumber, children: [
|
|
1732
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react24.Field.Label, { children: t("AbpIdentity::DisplayName:PhoneNumber") || "Phone Number" }),
|
|
1733
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1734
|
+
import_react24.Input,
|
|
1626
1735
|
{
|
|
1627
1736
|
type: "tel",
|
|
1628
1737
|
...register("phoneNumber", {
|
|
@@ -1633,7 +1742,7 @@ function Profile({
|
|
|
1633
1742
|
})
|
|
1634
1743
|
}
|
|
1635
1744
|
),
|
|
1636
|
-
/* @__PURE__ */ (0,
|
|
1745
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react24.Field.ErrorText, { children: errors.phoneNumber?.message })
|
|
1637
1746
|
] })
|
|
1638
1747
|
] }) })
|
|
1639
1748
|
}
|
|
@@ -1641,10 +1750,10 @@ function Profile({
|
|
|
1641
1750
|
}
|
|
1642
1751
|
|
|
1643
1752
|
// src/providers/ThemeSharedProvider.tsx
|
|
1644
|
-
var
|
|
1753
|
+
var import_react27 = require("@chakra-ui/react");
|
|
1645
1754
|
|
|
1646
1755
|
// src/theme/index.ts
|
|
1647
|
-
var
|
|
1756
|
+
var import_react25 = require("@chakra-ui/react");
|
|
1648
1757
|
var colors = {
|
|
1649
1758
|
brand: {
|
|
1650
1759
|
50: { value: "#e3f2fd" },
|
|
@@ -1847,7 +1956,7 @@ var semanticTokens = {
|
|
|
1847
1956
|
// },
|
|
1848
1957
|
// },
|
|
1849
1958
|
};
|
|
1850
|
-
var defaultAbpConfig = (0,
|
|
1959
|
+
var defaultAbpConfig = (0, import_react25.defineConfig)({
|
|
1851
1960
|
theme: {
|
|
1852
1961
|
tokens: {
|
|
1853
1962
|
colors,
|
|
@@ -1869,20 +1978,20 @@ var defaultAbpConfig = (0, import_react23.defineConfig)({
|
|
|
1869
1978
|
});
|
|
1870
1979
|
function createAbpSystem(overrides) {
|
|
1871
1980
|
if (overrides) {
|
|
1872
|
-
return (0,
|
|
1981
|
+
return (0, import_react25.createSystem)(import_react25.defaultConfig, defaultAbpConfig, overrides);
|
|
1873
1982
|
}
|
|
1874
|
-
return (0,
|
|
1983
|
+
return (0, import_react25.createSystem)(import_react25.defaultConfig, defaultAbpConfig);
|
|
1875
1984
|
}
|
|
1876
1985
|
var abpSystem = createAbpSystem();
|
|
1877
1986
|
|
|
1878
1987
|
// src/components/ui/color-mode.tsx
|
|
1879
|
-
var
|
|
1988
|
+
var import_react26 = require("@chakra-ui/react");
|
|
1880
1989
|
var import_next_themes = require("next-themes");
|
|
1881
|
-
var
|
|
1990
|
+
var React12 = __toESM(require("react"));
|
|
1882
1991
|
var import_lucide_react5 = require("lucide-react");
|
|
1883
|
-
var
|
|
1992
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1884
1993
|
function ColorModeProvider(props) {
|
|
1885
|
-
return /* @__PURE__ */ (0,
|
|
1994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_next_themes.ThemeProvider, { attribute: "class", disableTransitionOnChange: true, ...props });
|
|
1886
1995
|
}
|
|
1887
1996
|
function useColorMode() {
|
|
1888
1997
|
const { resolvedTheme, setTheme, forcedTheme } = (0, import_next_themes.useTheme)();
|
|
@@ -1898,12 +2007,12 @@ function useColorMode() {
|
|
|
1898
2007
|
}
|
|
1899
2008
|
function ColorModeIcon() {
|
|
1900
2009
|
const { colorMode } = useColorMode();
|
|
1901
|
-
return colorMode === "dark" ? /* @__PURE__ */ (0,
|
|
2010
|
+
return colorMode === "dark" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react5.Moon, {}) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react5.Sun, {});
|
|
1902
2011
|
}
|
|
1903
|
-
var ColorModeButton =
|
|
2012
|
+
var ColorModeButton = React12.forwardRef(function ColorModeButton2(props, ref) {
|
|
1904
2013
|
const { toggleColorMode } = useColorMode();
|
|
1905
|
-
return /* @__PURE__ */ (0,
|
|
1906
|
-
|
|
2014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react26.ClientOnly, { fallback: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react26.Skeleton, { boxSize: "9" }), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2015
|
+
import_react26.IconButton,
|
|
1907
2016
|
{
|
|
1908
2017
|
onClick: toggleColorMode,
|
|
1909
2018
|
variant: "ghost",
|
|
@@ -1917,14 +2026,14 @@ var ColorModeButton = React11.forwardRef(function ColorModeButton2(props, ref) {
|
|
|
1917
2026
|
height: "5"
|
|
1918
2027
|
}
|
|
1919
2028
|
},
|
|
1920
|
-
children: /* @__PURE__ */ (0,
|
|
2029
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ColorModeIcon, {})
|
|
1921
2030
|
}
|
|
1922
2031
|
) });
|
|
1923
2032
|
});
|
|
1924
|
-
var LightMode =
|
|
2033
|
+
var LightMode = React12.forwardRef(
|
|
1925
2034
|
function LightMode2(props, ref) {
|
|
1926
|
-
return /* @__PURE__ */ (0,
|
|
1927
|
-
|
|
2035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2036
|
+
import_react26.Span,
|
|
1928
2037
|
{
|
|
1929
2038
|
color: "fg",
|
|
1930
2039
|
display: "contents",
|
|
@@ -1937,10 +2046,10 @@ var LightMode = React11.forwardRef(
|
|
|
1937
2046
|
);
|
|
1938
2047
|
}
|
|
1939
2048
|
);
|
|
1940
|
-
var DarkMode =
|
|
2049
|
+
var DarkMode = React12.forwardRef(
|
|
1941
2050
|
function DarkMode2(props, ref) {
|
|
1942
|
-
return /* @__PURE__ */ (0,
|
|
1943
|
-
|
|
2051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2052
|
+
import_react26.Span,
|
|
1944
2053
|
{
|
|
1945
2054
|
color: "fg",
|
|
1946
2055
|
display: "contents",
|
|
@@ -1956,7 +2065,7 @@ var DarkMode = React11.forwardRef(
|
|
|
1956
2065
|
|
|
1957
2066
|
// src/providers/ThemeSharedProvider.tsx
|
|
1958
2067
|
var import_core6 = require("@abpjs/core");
|
|
1959
|
-
var
|
|
2068
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1960
2069
|
function ThemeSharedProvider({
|
|
1961
2070
|
children,
|
|
1962
2071
|
renderToasts = true,
|
|
@@ -1970,13 +2079,13 @@ function ThemeSharedProvider({
|
|
|
1970
2079
|
const system = themeOverrides ? createAbpSystem(themeOverrides) : abpSystem;
|
|
1971
2080
|
const { endSide } = (0, import_core6.useDirection)();
|
|
1972
2081
|
toastPosition = `bottom-${endSide}`;
|
|
1973
|
-
const content = /* @__PURE__ */ (0,
|
|
2082
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ToasterProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(ConfirmationProvider, { children: [
|
|
1974
2083
|
children,
|
|
1975
|
-
renderToasts && /* @__PURE__ */ (0,
|
|
1976
|
-
renderConfirmation && /* @__PURE__ */ (0,
|
|
2084
|
+
renderToasts && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ToastContainer, { position: toastPosition }),
|
|
2085
|
+
renderConfirmation && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ConfirmationDialog, {})
|
|
1977
2086
|
] }) });
|
|
1978
2087
|
const colorModeProps = enableColorMode ? { defaultTheme: defaultColorMode } : { forcedTheme: "light" };
|
|
1979
|
-
return /* @__PURE__ */ (0,
|
|
2088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react27.ChakraProvider, { value: system, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react27.LocaleProvider, { locale, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ColorModeProvider, { ...colorModeProps, children: content }) }) });
|
|
1980
2089
|
}
|
|
1981
2090
|
|
|
1982
2091
|
// src/utils/styles.ts
|
|
@@ -2049,6 +2158,120 @@ function injectThemeSharedStyles() {
|
|
|
2049
2158
|
}
|
|
2050
2159
|
};
|
|
2051
2160
|
}
|
|
2161
|
+
|
|
2162
|
+
// src/utils/validation-utils.ts
|
|
2163
|
+
var PASSWORD_SETTING_KEYS = {
|
|
2164
|
+
requiredLength: "Abp.Identity.Password.RequiredLength",
|
|
2165
|
+
maxLength: "Abp.Identity.Password.MaxLength",
|
|
2166
|
+
requireDigit: "Abp.Identity.Password.RequireDigit",
|
|
2167
|
+
requireLowercase: "Abp.Identity.Password.RequireLowercase",
|
|
2168
|
+
requireUppercase: "Abp.Identity.Password.RequireUppercase",
|
|
2169
|
+
requireNonAlphanumeric: "Abp.Identity.Password.RequireNonAlphanumeric",
|
|
2170
|
+
requiredUniqueChars: "Abp.Identity.Password.RequiredUniqueChars"
|
|
2171
|
+
};
|
|
2172
|
+
function parseBooleanSetting(value) {
|
|
2173
|
+
if (value === void 0) return void 0;
|
|
2174
|
+
return value.toLowerCase() === "true";
|
|
2175
|
+
}
|
|
2176
|
+
function parseIntegerSetting(value) {
|
|
2177
|
+
if (value === void 0) return void 0;
|
|
2178
|
+
const num = parseInt(value, 10);
|
|
2179
|
+
return isNaN(num) ? void 0 : num;
|
|
2180
|
+
}
|
|
2181
|
+
function getPasswordSettings(store) {
|
|
2182
|
+
return {
|
|
2183
|
+
requiredLength: parseIntegerSetting(store.getSetting(PASSWORD_SETTING_KEYS.requiredLength)),
|
|
2184
|
+
maxLength: parseIntegerSetting(store.getSetting(PASSWORD_SETTING_KEYS.maxLength)),
|
|
2185
|
+
requireDigit: parseBooleanSetting(store.getSetting(PASSWORD_SETTING_KEYS.requireDigit)),
|
|
2186
|
+
requireLowercase: parseBooleanSetting(store.getSetting(PASSWORD_SETTING_KEYS.requireLowercase)),
|
|
2187
|
+
requireUppercase: parseBooleanSetting(store.getSetting(PASSWORD_SETTING_KEYS.requireUppercase)),
|
|
2188
|
+
requireNonAlphanumeric: parseBooleanSetting(store.getSetting(PASSWORD_SETTING_KEYS.requireNonAlphanumeric)),
|
|
2189
|
+
requiredUniqueChars: parseIntegerSetting(store.getSetting(PASSWORD_SETTING_KEYS.requiredUniqueChars))
|
|
2190
|
+
};
|
|
2191
|
+
}
|
|
2192
|
+
function getPasswordValidators(store) {
|
|
2193
|
+
const settings = getPasswordSettings(store);
|
|
2194
|
+
const validators = [];
|
|
2195
|
+
if (settings.requiredLength && settings.requiredLength > 0) {
|
|
2196
|
+
validators.push((value) => {
|
|
2197
|
+
if (!value || value.length < settings.requiredLength) {
|
|
2198
|
+
return `Password must be at least ${settings.requiredLength} characters`;
|
|
2199
|
+
}
|
|
2200
|
+
return true;
|
|
2201
|
+
});
|
|
2202
|
+
}
|
|
2203
|
+
if (settings.maxLength && settings.maxLength > 0) {
|
|
2204
|
+
validators.push((value) => {
|
|
2205
|
+
if (value && value.length > settings.maxLength) {
|
|
2206
|
+
return `Password must be at most ${settings.maxLength} characters`;
|
|
2207
|
+
}
|
|
2208
|
+
return true;
|
|
2209
|
+
});
|
|
2210
|
+
}
|
|
2211
|
+
if (settings.requireDigit) {
|
|
2212
|
+
validators.push((value) => {
|
|
2213
|
+
if (!value || !/\d/.test(value)) {
|
|
2214
|
+
return "Password must contain at least one digit";
|
|
2215
|
+
}
|
|
2216
|
+
return true;
|
|
2217
|
+
});
|
|
2218
|
+
}
|
|
2219
|
+
if (settings.requireLowercase) {
|
|
2220
|
+
validators.push((value) => {
|
|
2221
|
+
if (!value || !/[a-z]/.test(value)) {
|
|
2222
|
+
return "Password must contain at least one lowercase letter";
|
|
2223
|
+
}
|
|
2224
|
+
return true;
|
|
2225
|
+
});
|
|
2226
|
+
}
|
|
2227
|
+
if (settings.requireUppercase) {
|
|
2228
|
+
validators.push((value) => {
|
|
2229
|
+
if (!value || !/[A-Z]/.test(value)) {
|
|
2230
|
+
return "Password must contain at least one uppercase letter";
|
|
2231
|
+
}
|
|
2232
|
+
return true;
|
|
2233
|
+
});
|
|
2234
|
+
}
|
|
2235
|
+
if (settings.requireNonAlphanumeric) {
|
|
2236
|
+
validators.push((value) => {
|
|
2237
|
+
if (!value || !/[^a-zA-Z0-9]/.test(value)) {
|
|
2238
|
+
return "Password must contain at least one special character";
|
|
2239
|
+
}
|
|
2240
|
+
return true;
|
|
2241
|
+
});
|
|
2242
|
+
}
|
|
2243
|
+
if (settings.requiredUniqueChars && settings.requiredUniqueChars > 0) {
|
|
2244
|
+
validators.push((value) => {
|
|
2245
|
+
if (!value) return true;
|
|
2246
|
+
const uniqueChars = new Set(value).size;
|
|
2247
|
+
if (uniqueChars < settings.requiredUniqueChars) {
|
|
2248
|
+
return `Password must contain at least ${settings.requiredUniqueChars} unique characters`;
|
|
2249
|
+
}
|
|
2250
|
+
return true;
|
|
2251
|
+
});
|
|
2252
|
+
}
|
|
2253
|
+
return validators;
|
|
2254
|
+
}
|
|
2255
|
+
function getPasswordValidationRules(store) {
|
|
2256
|
+
const validators = getPasswordValidators(store);
|
|
2257
|
+
const settings = getPasswordSettings(store);
|
|
2258
|
+
const validate = {};
|
|
2259
|
+
validators.forEach((validator, index) => {
|
|
2260
|
+
validate[`passwordRule${index}`] = validator;
|
|
2261
|
+
});
|
|
2262
|
+
return {
|
|
2263
|
+
required: "Password is required",
|
|
2264
|
+
minLength: settings.requiredLength ? {
|
|
2265
|
+
value: settings.requiredLength,
|
|
2266
|
+
message: `Password must be at least ${settings.requiredLength} characters`
|
|
2267
|
+
} : void 0,
|
|
2268
|
+
maxLength: settings.maxLength ? {
|
|
2269
|
+
value: settings.maxLength,
|
|
2270
|
+
message: `Password must be at most ${settings.maxLength} characters`
|
|
2271
|
+
} : void 0,
|
|
2272
|
+
validate
|
|
2273
|
+
};
|
|
2274
|
+
}
|
|
2052
2275
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2053
2276
|
0 && (module.exports = {
|
|
2054
2277
|
AbpModalBody,
|
|
@@ -2065,11 +2288,16 @@ function injectThemeSharedStyles() {
|
|
|
2065
2288
|
DEFAULT_STYLES,
|
|
2066
2289
|
ErrorComponent,
|
|
2067
2290
|
FormField,
|
|
2291
|
+
HTTP_ERROR_CONFIG,
|
|
2292
|
+
HttpErrorConfigContext,
|
|
2068
2293
|
LoaderBar,
|
|
2069
2294
|
Modal,
|
|
2070
2295
|
ModalBody,
|
|
2296
|
+
ModalContainer,
|
|
2071
2297
|
ModalFooter,
|
|
2072
2298
|
ModalHeader,
|
|
2299
|
+
ModalProvider,
|
|
2300
|
+
PASSWORD_SETTING_KEYS,
|
|
2073
2301
|
Profile,
|
|
2074
2302
|
THEME_SHARED_APPEND_CONTENT,
|
|
2075
2303
|
THEME_SHARED_STYLES,
|
|
@@ -2083,14 +2311,22 @@ function injectThemeSharedStyles() {
|
|
|
2083
2311
|
createErrorInterceptor,
|
|
2084
2312
|
defaultAbpConfig,
|
|
2085
2313
|
defineConfig,
|
|
2314
|
+
getPasswordSettings,
|
|
2315
|
+
getPasswordValidationRules,
|
|
2316
|
+
getPasswordValidators,
|
|
2086
2317
|
getSeverityBg,
|
|
2087
2318
|
getSeverityBorderColor,
|
|
2088
2319
|
getSeverityColorScheme,
|
|
2320
|
+
httpErrorConfigFactory,
|
|
2089
2321
|
injectThemeSharedStyles,
|
|
2090
2322
|
useConfirmation,
|
|
2091
2323
|
useConfirmationContext,
|
|
2092
2324
|
useConfirmationState,
|
|
2093
2325
|
useErrorHandler,
|
|
2326
|
+
useHttpErrorConfig,
|
|
2327
|
+
useModal,
|
|
2328
|
+
useModalContext,
|
|
2329
|
+
useModalState,
|
|
2094
2330
|
useToaster,
|
|
2095
2331
|
useToasterContext,
|
|
2096
2332
|
useToasts
|