@abpjs/theme-shared 2.2.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/constants/append-content.d.ts +34 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/contexts/index.d.ts +1 -0
- package/dist/contexts/modal.context.d.ts +139 -0
- package/dist/index.d.ts +16 -1
- package/dist/index.js +516 -271
- package/dist/index.mjs +426 -189
- package/dist/models/common.d.ts +10 -1
- package/dist/models/toaster.d.ts +1 -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,13 +44,20 @@ __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,
|
|
58
|
+
THEME_SHARED_APPEND_CONTENT: () => THEME_SHARED_APPEND_CONTENT,
|
|
53
59
|
THEME_SHARED_STYLES: () => THEME_SHARED_STYLES,
|
|
60
|
+
ThemeSharedAppendContentContext: () => ThemeSharedAppendContentContext,
|
|
54
61
|
ThemeSharedProvider: () => ThemeSharedProvider,
|
|
55
62
|
ToastContainer: () => ToastContainer,
|
|
56
63
|
Toaster: () => Toaster,
|
|
@@ -59,15 +66,23 @@ __export(index_exports, {
|
|
|
59
66
|
createAbpSystem: () => createAbpSystem,
|
|
60
67
|
createErrorInterceptor: () => createErrorInterceptor,
|
|
61
68
|
defaultAbpConfig: () => defaultAbpConfig,
|
|
62
|
-
defineConfig: () =>
|
|
69
|
+
defineConfig: () => import_react25.defineConfig,
|
|
70
|
+
getPasswordSettings: () => getPasswordSettings,
|
|
71
|
+
getPasswordValidationRules: () => getPasswordValidationRules,
|
|
72
|
+
getPasswordValidators: () => getPasswordValidators,
|
|
63
73
|
getSeverityBg: () => getSeverityBg,
|
|
64
74
|
getSeverityBorderColor: () => getSeverityBorderColor,
|
|
65
75
|
getSeverityColorScheme: () => getSeverityColorPalette,
|
|
76
|
+
httpErrorConfigFactory: () => httpErrorConfigFactory,
|
|
66
77
|
injectThemeSharedStyles: () => injectThemeSharedStyles,
|
|
67
78
|
useConfirmation: () => useConfirmation,
|
|
68
79
|
useConfirmationContext: () => useConfirmationContext,
|
|
69
80
|
useConfirmationState: () => useConfirmationState,
|
|
70
81
|
useErrorHandler: () => useErrorHandler,
|
|
82
|
+
useHttpErrorConfig: () => useHttpErrorConfig,
|
|
83
|
+
useModal: () => useModal,
|
|
84
|
+
useModalContext: () => useModalContext,
|
|
85
|
+
useModalState: () => useModalState,
|
|
71
86
|
useToaster: () => useToaster,
|
|
72
87
|
useToasterContext: () => useToasterContext,
|
|
73
88
|
useToasts: () => useToasts
|
|
@@ -273,10 +288,30 @@ var DEFAULT_STYLES = `
|
|
|
273
288
|
}
|
|
274
289
|
`;
|
|
275
290
|
|
|
276
|
-
// src/
|
|
291
|
+
// src/constants/append-content.ts
|
|
277
292
|
var import_react = require("react");
|
|
293
|
+
var ThemeSharedAppendContentContext = (0, import_react.createContext)(void 0);
|
|
294
|
+
var THEME_SHARED_APPEND_CONTENT = "THEME_SHARED_APPEND_CONTENT";
|
|
295
|
+
|
|
296
|
+
// src/tokens/http-error.token.ts
|
|
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");
|
|
278
313
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
279
|
-
var ToasterContext = (0,
|
|
314
|
+
var ToasterContext = (0, import_react3.createContext)(null);
|
|
280
315
|
var toastCounter = 0;
|
|
281
316
|
function generateId() {
|
|
282
317
|
toastCounter += 1;
|
|
@@ -284,17 +319,17 @@ function generateId() {
|
|
|
284
319
|
}
|
|
285
320
|
var DEFAULT_LIFE = 5e3;
|
|
286
321
|
function ToasterProvider({ children }) {
|
|
287
|
-
const [toasts, setToasts] = (0,
|
|
288
|
-
const subscribersRef = (0,
|
|
289
|
-
(0,
|
|
322
|
+
const [toasts, setToasts] = (0, import_react3.useState)([]);
|
|
323
|
+
const subscribersRef = (0, import_react3.useRef)(/* @__PURE__ */ new Set());
|
|
324
|
+
(0, import_react3.useEffect)(() => {
|
|
290
325
|
subscribersRef.current.forEach((subscriber) => {
|
|
291
326
|
subscriber(toasts);
|
|
292
327
|
});
|
|
293
328
|
}, [toasts]);
|
|
294
|
-
const remove = (0,
|
|
329
|
+
const remove = (0, import_react3.useCallback)((id) => {
|
|
295
330
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
296
331
|
}, []);
|
|
297
|
-
const show = (0,
|
|
332
|
+
const show = (0, import_react3.useCallback)(
|
|
298
333
|
(message, title, severity = "info", options) => {
|
|
299
334
|
const id = typeof options?.id === "number" ? options.id : generateId();
|
|
300
335
|
const life = options?.sticky ? void 0 : options?.life ?? DEFAULT_LIFE;
|
|
@@ -318,23 +353,23 @@ function ToasterProvider({ children }) {
|
|
|
318
353
|
},
|
|
319
354
|
[remove]
|
|
320
355
|
);
|
|
321
|
-
const info = (0,
|
|
356
|
+
const info = (0, import_react3.useCallback)(
|
|
322
357
|
(message, title, options) => show(message, title, "info", options),
|
|
323
358
|
[show]
|
|
324
359
|
);
|
|
325
|
-
const success = (0,
|
|
360
|
+
const success = (0, import_react3.useCallback)(
|
|
326
361
|
(message, title, options) => show(message, title, "success", options),
|
|
327
362
|
[show]
|
|
328
363
|
);
|
|
329
|
-
const warn = (0,
|
|
364
|
+
const warn = (0, import_react3.useCallback)(
|
|
330
365
|
(message, title, options) => show(message, title, "warning", options),
|
|
331
366
|
[show]
|
|
332
367
|
);
|
|
333
|
-
const error = (0,
|
|
368
|
+
const error = (0, import_react3.useCallback)(
|
|
334
369
|
(message, title, options) => show(message, title, "error", options),
|
|
335
370
|
[show]
|
|
336
371
|
);
|
|
337
|
-
const clear = (0,
|
|
372
|
+
const clear = (0, import_react3.useCallback)((key) => {
|
|
338
373
|
setToasts((prev) => {
|
|
339
374
|
if (key) {
|
|
340
375
|
return prev.filter((toast) => toast.options?.containerKey !== key);
|
|
@@ -342,14 +377,14 @@ function ToasterProvider({ children }) {
|
|
|
342
377
|
return [];
|
|
343
378
|
});
|
|
344
379
|
}, []);
|
|
345
|
-
const subscribe = (0,
|
|
380
|
+
const subscribe = (0, import_react3.useCallback)((subscriber) => {
|
|
346
381
|
subscribersRef.current.add(subscriber);
|
|
347
382
|
subscriber(toasts);
|
|
348
383
|
return () => {
|
|
349
384
|
subscribersRef.current.delete(subscriber);
|
|
350
385
|
};
|
|
351
386
|
}, [toasts]);
|
|
352
|
-
const service = (0,
|
|
387
|
+
const service = (0, import_react3.useMemo)(
|
|
353
388
|
() => ({
|
|
354
389
|
info,
|
|
355
390
|
success,
|
|
@@ -362,28 +397,28 @@ function ToasterProvider({ children }) {
|
|
|
362
397
|
}),
|
|
363
398
|
[info, success, warn, error, show, remove, clear, subscribe]
|
|
364
399
|
);
|
|
365
|
-
const value = (0,
|
|
400
|
+
const value = (0, import_react3.useMemo)(
|
|
366
401
|
() => ({ service, toasts }),
|
|
367
402
|
[service, toasts]
|
|
368
403
|
);
|
|
369
404
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToasterContext.Provider, { value, children });
|
|
370
405
|
}
|
|
371
406
|
function useToaster() {
|
|
372
|
-
const context = (0,
|
|
407
|
+
const context = (0, import_react3.useContext)(ToasterContext);
|
|
373
408
|
if (!context) {
|
|
374
409
|
throw new Error("useToaster must be used within a ToasterProvider");
|
|
375
410
|
}
|
|
376
411
|
return context.service;
|
|
377
412
|
}
|
|
378
413
|
function useToasts() {
|
|
379
|
-
const context = (0,
|
|
414
|
+
const context = (0, import_react3.useContext)(ToasterContext);
|
|
380
415
|
if (!context) {
|
|
381
416
|
throw new Error("useToasts must be used within a ToasterProvider");
|
|
382
417
|
}
|
|
383
418
|
return context.toasts;
|
|
384
419
|
}
|
|
385
420
|
function useToasterContext() {
|
|
386
|
-
const context = (0,
|
|
421
|
+
const context = (0, import_react3.useContext)(ToasterContext);
|
|
387
422
|
if (!context) {
|
|
388
423
|
throw new Error("useToasterContext must be used within a ToasterProvider");
|
|
389
424
|
}
|
|
@@ -391,30 +426,30 @@ function useToasterContext() {
|
|
|
391
426
|
}
|
|
392
427
|
|
|
393
428
|
// src/contexts/confirmation.context.tsx
|
|
394
|
-
var
|
|
429
|
+
var import_react4 = require("react");
|
|
395
430
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
396
|
-
var ConfirmationContext = (0,
|
|
431
|
+
var ConfirmationContext = (0, import_react4.createContext)(null);
|
|
397
432
|
function generateId2() {
|
|
398
433
|
return `confirmation-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
399
434
|
}
|
|
400
435
|
function ConfirmationProvider({ children }) {
|
|
401
|
-
const [confirmation, setConfirmation] = (0,
|
|
402
|
-
const resolverRef = (0,
|
|
403
|
-
const subscribersRef = (0,
|
|
404
|
-
const escapeListenerRef = (0,
|
|
405
|
-
(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)(() => {
|
|
406
441
|
subscribersRef.current.forEach((subscriber) => {
|
|
407
442
|
subscriber(confirmation);
|
|
408
443
|
});
|
|
409
444
|
}, [confirmation]);
|
|
410
|
-
const respond = (0,
|
|
445
|
+
const respond = (0, import_react4.useCallback)((status) => {
|
|
411
446
|
if (resolverRef.current) {
|
|
412
447
|
resolverRef.current(status);
|
|
413
448
|
resolverRef.current = null;
|
|
414
449
|
}
|
|
415
450
|
setConfirmation(null);
|
|
416
451
|
}, []);
|
|
417
|
-
(0,
|
|
452
|
+
(0, import_react4.useEffect)(() => {
|
|
418
453
|
if (!escapeListenerRef.current) return;
|
|
419
454
|
const handleEscape = (event) => {
|
|
420
455
|
if (event.key === "Escape" && confirmation && confirmation.options?.closable !== false) {
|
|
@@ -426,7 +461,7 @@ function ConfirmationProvider({ children }) {
|
|
|
426
461
|
document.removeEventListener("keydown", handleEscape);
|
|
427
462
|
};
|
|
428
463
|
}, [confirmation, respond]);
|
|
429
|
-
const show = (0,
|
|
464
|
+
const show = (0, import_react4.useCallback)(
|
|
430
465
|
(message, title, severity = "neutral", options = {}) => {
|
|
431
466
|
if (resolverRef.current) {
|
|
432
467
|
resolverRef.current(Confirmation.Status.dismiss);
|
|
@@ -448,39 +483,39 @@ function ConfirmationProvider({ children }) {
|
|
|
448
483
|
},
|
|
449
484
|
[]
|
|
450
485
|
);
|
|
451
|
-
const info = (0,
|
|
486
|
+
const info = (0, import_react4.useCallback)(
|
|
452
487
|
(message, title, options) => show(message, title, "info", options),
|
|
453
488
|
[show]
|
|
454
489
|
);
|
|
455
|
-
const success = (0,
|
|
490
|
+
const success = (0, import_react4.useCallback)(
|
|
456
491
|
(message, title, options) => show(message, title, "success", options),
|
|
457
492
|
[show]
|
|
458
493
|
);
|
|
459
|
-
const warn = (0,
|
|
494
|
+
const warn = (0, import_react4.useCallback)(
|
|
460
495
|
(message, title, options) => show(message, title, "warning", options),
|
|
461
496
|
[show]
|
|
462
497
|
);
|
|
463
|
-
const error = (0,
|
|
498
|
+
const error = (0, import_react4.useCallback)(
|
|
464
499
|
(message, title, options) => show(message, title, "error", options),
|
|
465
500
|
[show]
|
|
466
501
|
);
|
|
467
|
-
const clear = (0,
|
|
502
|
+
const clear = (0, import_react4.useCallback)(
|
|
468
503
|
(status) => {
|
|
469
504
|
respond(status ?? Confirmation.Status.dismiss);
|
|
470
505
|
},
|
|
471
506
|
[respond]
|
|
472
507
|
);
|
|
473
|
-
const listenToEscape = (0,
|
|
508
|
+
const listenToEscape = (0, import_react4.useCallback)(() => {
|
|
474
509
|
escapeListenerRef.current = true;
|
|
475
510
|
}, []);
|
|
476
|
-
const subscribe = (0,
|
|
511
|
+
const subscribe = (0, import_react4.useCallback)((subscriber) => {
|
|
477
512
|
subscribersRef.current.add(subscriber);
|
|
478
513
|
subscriber(confirmation);
|
|
479
514
|
return () => {
|
|
480
515
|
subscribersRef.current.delete(subscriber);
|
|
481
516
|
};
|
|
482
517
|
}, [confirmation]);
|
|
483
|
-
const service = (0,
|
|
518
|
+
const service = (0, import_react4.useMemo)(
|
|
484
519
|
() => ({
|
|
485
520
|
info,
|
|
486
521
|
success,
|
|
@@ -493,36 +528,103 @@ function ConfirmationProvider({ children }) {
|
|
|
493
528
|
}),
|
|
494
529
|
[info, success, warn, error, show, clear, listenToEscape, subscribe]
|
|
495
530
|
);
|
|
496
|
-
const value = (0,
|
|
531
|
+
const value = (0, import_react4.useMemo)(
|
|
497
532
|
() => ({ service, confirmation, respond }),
|
|
498
533
|
[service, confirmation, respond]
|
|
499
534
|
);
|
|
500
535
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ConfirmationContext.Provider, { value, children });
|
|
501
536
|
}
|
|
502
537
|
function useConfirmation() {
|
|
503
|
-
const context = (0,
|
|
538
|
+
const context = (0, import_react4.useContext)(ConfirmationContext);
|
|
504
539
|
if (!context) {
|
|
505
540
|
throw new Error("useConfirmation must be used within a ConfirmationProvider");
|
|
506
541
|
}
|
|
507
542
|
return context.service;
|
|
508
543
|
}
|
|
509
544
|
function useConfirmationState() {
|
|
510
|
-
const context = (0,
|
|
545
|
+
const context = (0, import_react4.useContext)(ConfirmationContext);
|
|
511
546
|
if (!context) {
|
|
512
547
|
throw new Error("useConfirmationState must be used within a ConfirmationProvider");
|
|
513
548
|
}
|
|
514
549
|
return { confirmation: context.confirmation, respond: context.respond };
|
|
515
550
|
}
|
|
516
551
|
function useConfirmationContext() {
|
|
517
|
-
const context = (0,
|
|
552
|
+
const context = (0, import_react4.useContext)(ConfirmationContext);
|
|
518
553
|
if (!context) {
|
|
519
554
|
throw new Error("useConfirmationContext must be used within a ConfirmationProvider");
|
|
520
555
|
}
|
|
521
556
|
return context;
|
|
522
557
|
}
|
|
523
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
|
+
|
|
524
626
|
// src/handlers/error.handler.ts
|
|
525
|
-
var
|
|
627
|
+
var import_react6 = require("react");
|
|
526
628
|
var DEFAULT_ERROR_MESSAGES = {
|
|
527
629
|
400: "AbpUi::DefaultErrorMessage400",
|
|
528
630
|
401: "AbpUi::DefaultErrorMessage401",
|
|
@@ -534,22 +636,22 @@ var DEFAULT_ERROR_MESSAGES = {
|
|
|
534
636
|
function useErrorHandler(options = {}) {
|
|
535
637
|
const { navigate, loginPath = "/account/login" } = options;
|
|
536
638
|
const confirmation = useConfirmation();
|
|
537
|
-
const [errorComponentProps, setErrorComponentProps] = (0,
|
|
538
|
-
const navigateToLogin = (0,
|
|
639
|
+
const [errorComponentProps, setErrorComponentProps] = (0, import_react6.useState)(null);
|
|
640
|
+
const navigateToLogin = (0, import_react6.useCallback)(() => {
|
|
539
641
|
if (navigate) {
|
|
540
642
|
navigate(loginPath);
|
|
541
643
|
}
|
|
542
644
|
}, [navigate, loginPath]);
|
|
543
|
-
const showError = (0,
|
|
645
|
+
const showError = (0, import_react6.useCallback)(
|
|
544
646
|
async (message, title) => {
|
|
545
647
|
return confirmation.error(message, title || "AbpUi::Error");
|
|
546
648
|
},
|
|
547
649
|
[confirmation]
|
|
548
650
|
);
|
|
549
|
-
const clearErrorComponent = (0,
|
|
651
|
+
const clearErrorComponent = (0, import_react6.useCallback)(() => {
|
|
550
652
|
setErrorComponentProps(null);
|
|
551
653
|
}, []);
|
|
552
|
-
const createErrorComponent = (0,
|
|
654
|
+
const createErrorComponent = (0, import_react6.useCallback)(
|
|
553
655
|
(instance) => {
|
|
554
656
|
const props = {
|
|
555
657
|
title: instance.title || "Error",
|
|
@@ -562,7 +664,7 @@ function useErrorHandler(options = {}) {
|
|
|
562
664
|
},
|
|
563
665
|
[clearErrorComponent]
|
|
564
666
|
);
|
|
565
|
-
const handleError = (0,
|
|
667
|
+
const handleError = (0, import_react6.useCallback)(
|
|
566
668
|
async (error) => {
|
|
567
669
|
if (error.status === 401) {
|
|
568
670
|
navigateToLogin();
|
|
@@ -604,11 +706,11 @@ function isHttpErrorResponse(error) {
|
|
|
604
706
|
}
|
|
605
707
|
|
|
606
708
|
// src/components/toast/Toast.tsx
|
|
607
|
-
var
|
|
608
|
-
var
|
|
709
|
+
var import_react7 = require("react");
|
|
710
|
+
var import_react8 = require("@chakra-ui/react");
|
|
609
711
|
var import_core = require("@abpjs/core");
|
|
610
712
|
var import_lucide_react = require("lucide-react");
|
|
611
|
-
var
|
|
713
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
612
714
|
function resolveLocalizationParam(param) {
|
|
613
715
|
if (param === void 0) return void 0;
|
|
614
716
|
if (typeof param === "string") return param;
|
|
@@ -618,16 +720,16 @@ function SeverityIcon({ severity }) {
|
|
|
618
720
|
const iconProps = { size: 20 };
|
|
619
721
|
switch (severity) {
|
|
620
722
|
case "success":
|
|
621
|
-
return /* @__PURE__ */ (0,
|
|
723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.CheckCircle, { ...iconProps, color: "var(--chakra-colors-green-500)" });
|
|
622
724
|
case "info":
|
|
623
|
-
return /* @__PURE__ */ (0,
|
|
725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.Info, { ...iconProps, color: "var(--chakra-colors-blue-500)" });
|
|
624
726
|
case "warning":
|
|
625
|
-
return /* @__PURE__ */ (0,
|
|
727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.AlertTriangle, { ...iconProps, color: "var(--chakra-colors-yellow-500)" });
|
|
626
728
|
case "error":
|
|
627
|
-
return /* @__PURE__ */ (0,
|
|
729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.XCircle, { ...iconProps, color: "var(--chakra-colors-red-500)" });
|
|
628
730
|
case "neutral":
|
|
629
731
|
default:
|
|
630
|
-
return /* @__PURE__ */ (0,
|
|
732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.Circle, { ...iconProps, color: "var(--chakra-colors-gray-500)" });
|
|
631
733
|
}
|
|
632
734
|
}
|
|
633
735
|
function getSeverityColorPalette(severity) {
|
|
@@ -712,7 +814,7 @@ function getPlacement(position) {
|
|
|
712
814
|
var toasterCache = /* @__PURE__ */ new Map();
|
|
713
815
|
function getToaster(placement) {
|
|
714
816
|
if (!toasterCache.has(placement)) {
|
|
715
|
-
toasterCache.set(placement, (0,
|
|
817
|
+
toasterCache.set(placement, (0, import_react8.createToaster)({
|
|
716
818
|
placement,
|
|
717
819
|
pauseOnPageIdle: true
|
|
718
820
|
}));
|
|
@@ -722,14 +824,14 @@ function getToaster(placement) {
|
|
|
722
824
|
function ToastContainer({ position = "bottom-right", containerKey }) {
|
|
723
825
|
const { toasts, service } = useToasterContext();
|
|
724
826
|
const { t } = (0, import_core.useLocalization)();
|
|
725
|
-
const displayedToastsRef = (0,
|
|
726
|
-
const placement = (0,
|
|
727
|
-
const toaster = (0,
|
|
728
|
-
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)(() => {
|
|
729
831
|
if (!containerKey) return toasts;
|
|
730
832
|
return toasts.filter((toast) => toast.options?.containerKey === containerKey);
|
|
731
833
|
}, [toasts, containerKey]);
|
|
732
|
-
(0,
|
|
834
|
+
(0, import_react7.useEffect)(() => {
|
|
733
835
|
const newToasts = filteredToasts.filter((toast) => !displayedToastsRef.current.has(toast.id));
|
|
734
836
|
newToasts.forEach((toast) => {
|
|
735
837
|
displayedToastsRef.current.add(toast.id);
|
|
@@ -762,11 +864,11 @@ function ToastContainer({ position = "bottom-right", containerKey }) {
|
|
|
762
864
|
});
|
|
763
865
|
});
|
|
764
866
|
}, [filteredToasts, t, service, toaster]);
|
|
765
|
-
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) => {
|
|
766
868
|
const severity = toast.meta?.severity || "info";
|
|
767
869
|
const closable = toast.meta?.closable !== false;
|
|
768
|
-
return /* @__PURE__ */ (0,
|
|
769
|
-
|
|
870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
871
|
+
import_react8.Toast.Root,
|
|
770
872
|
{
|
|
771
873
|
bg: getSeverityBg(severity),
|
|
772
874
|
borderWidth: "1px",
|
|
@@ -774,13 +876,13 @@ function ToastContainer({ position = "bottom-right", containerKey }) {
|
|
|
774
876
|
borderRadius: "lg",
|
|
775
877
|
boxShadow: "lg",
|
|
776
878
|
width: { md: "sm" },
|
|
777
|
-
children: /* @__PURE__ */ (0,
|
|
778
|
-
/* @__PURE__ */ (0,
|
|
779
|
-
/* @__PURE__ */ (0,
|
|
780
|
-
toast.title && /* @__PURE__ */ (0,
|
|
781
|
-
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 })
|
|
782
884
|
] }),
|
|
783
|
-
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" }) })
|
|
784
886
|
] })
|
|
785
887
|
}
|
|
786
888
|
);
|
|
@@ -788,11 +890,11 @@ function ToastContainer({ position = "bottom-right", containerKey }) {
|
|
|
788
890
|
}
|
|
789
891
|
|
|
790
892
|
// src/components/confirmation/Confirmation.tsx
|
|
791
|
-
var
|
|
792
|
-
var
|
|
893
|
+
var import_react9 = require("react");
|
|
894
|
+
var import_react10 = require("@chakra-ui/react");
|
|
793
895
|
var import_core2 = require("@abpjs/core");
|
|
794
896
|
var import_lucide_react2 = require("lucide-react");
|
|
795
|
-
var
|
|
897
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
796
898
|
function resolveLocalizationParam2(param) {
|
|
797
899
|
if (param === void 0) return void 0;
|
|
798
900
|
if (typeof param === "string") return param;
|
|
@@ -807,16 +909,16 @@ function SeverityIcon2({ severity }) {
|
|
|
807
909
|
const iconProps = { size: 24 };
|
|
808
910
|
switch (severity) {
|
|
809
911
|
case "success":
|
|
810
|
-
return /* @__PURE__ */ (0,
|
|
912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.CheckCircle, { ...iconProps, color: "var(--chakra-colors-green-500)" });
|
|
811
913
|
case "info":
|
|
812
|
-
return /* @__PURE__ */ (0,
|
|
914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.Info, { ...iconProps, color: "var(--chakra-colors-blue-500)" });
|
|
813
915
|
case "warning":
|
|
814
|
-
return /* @__PURE__ */ (0,
|
|
916
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.AlertTriangle, { ...iconProps, color: "var(--chakra-colors-yellow-500)" });
|
|
815
917
|
case "error":
|
|
816
|
-
return /* @__PURE__ */ (0,
|
|
918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.XCircle, { ...iconProps, color: "var(--chakra-colors-red-500)" });
|
|
817
919
|
case "neutral":
|
|
818
920
|
default:
|
|
819
|
-
return /* @__PURE__ */ (0,
|
|
921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.Circle, { ...iconProps, color: "var(--chakra-colors-gray-500)" });
|
|
820
922
|
}
|
|
821
923
|
}
|
|
822
924
|
function getSeverityColorPalette2(severity) {
|
|
@@ -837,7 +939,7 @@ function getSeverityColorPalette2(severity) {
|
|
|
837
939
|
function ConfirmationDialog({ className }) {
|
|
838
940
|
const { confirmation, respond } = useConfirmationState();
|
|
839
941
|
const { t } = (0, import_core2.useLocalization)();
|
|
840
|
-
const cancelRef = (0,
|
|
942
|
+
const cancelRef = (0, import_react9.useRef)(null);
|
|
841
943
|
if (!confirmation) {
|
|
842
944
|
return null;
|
|
843
945
|
}
|
|
@@ -867,25 +969,25 @@ function ConfirmationDialog({ className }) {
|
|
|
867
969
|
handleDismiss();
|
|
868
970
|
}
|
|
869
971
|
};
|
|
870
|
-
return /* @__PURE__ */ (0,
|
|
871
|
-
|
|
972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
973
|
+
import_react10.Dialog.Root,
|
|
872
974
|
{
|
|
873
975
|
open: true,
|
|
874
976
|
onOpenChange: handleOpenChange,
|
|
875
977
|
role: "alertdialog",
|
|
876
978
|
placement: "center",
|
|
877
979
|
initialFocusEl: () => cancelRef.current,
|
|
878
|
-
children: /* @__PURE__ */ (0,
|
|
879
|
-
/* @__PURE__ */ (0,
|
|
880
|
-
/* @__PURE__ */ (0,
|
|
881
|
-
/* @__PURE__ */ (0,
|
|
882
|
-
/* @__PURE__ */ (0,
|
|
883
|
-
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 }) })
|
|
884
986
|
] }) }),
|
|
885
|
-
/* @__PURE__ */ (0,
|
|
886
|
-
/* @__PURE__ */ (0,
|
|
887
|
-
!options?.hideCancelBtn && /* @__PURE__ */ (0,
|
|
888
|
-
|
|
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,
|
|
889
991
|
{
|
|
890
992
|
ref: cancelRef,
|
|
891
993
|
variant: "ghost",
|
|
@@ -893,8 +995,8 @@ function ConfirmationDialog({ className }) {
|
|
|
893
995
|
children: cancelCopy
|
|
894
996
|
}
|
|
895
997
|
),
|
|
896
|
-
!options?.hideYesBtn && /* @__PURE__ */ (0,
|
|
897
|
-
|
|
998
|
+
!options?.hideYesBtn && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
999
|
+
import_react10.Button,
|
|
898
1000
|
{
|
|
899
1001
|
colorPalette: getSeverityColorPalette2(severity),
|
|
900
1002
|
onClick: handleConfirm,
|
|
@@ -909,18 +1011,21 @@ function ConfirmationDialog({ className }) {
|
|
|
909
1011
|
}
|
|
910
1012
|
|
|
911
1013
|
// src/components/errors/ErrorComponent.tsx
|
|
912
|
-
var
|
|
913
|
-
var
|
|
1014
|
+
var import_react11 = require("@chakra-ui/react");
|
|
1015
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
914
1016
|
function ErrorComponent({
|
|
915
1017
|
title = "Error",
|
|
916
1018
|
details = "An error has occurred.",
|
|
917
1019
|
onDestroy,
|
|
918
1020
|
showCloseButton = true,
|
|
919
|
-
closeButtonText = "Go Back"
|
|
1021
|
+
closeButtonText = "Go Back",
|
|
1022
|
+
isHomeShow = false,
|
|
1023
|
+
onHomeClick,
|
|
1024
|
+
homeButtonText = "Go Home"
|
|
920
1025
|
}) {
|
|
921
|
-
return /* @__PURE__ */ (0,
|
|
922
|
-
/* @__PURE__ */ (0,
|
|
923
|
-
|
|
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,
|
|
924
1029
|
{
|
|
925
1030
|
size: "4xl",
|
|
926
1031
|
color: "red.500",
|
|
@@ -928,23 +1033,34 @@ function ErrorComponent({
|
|
|
928
1033
|
children: title
|
|
929
1034
|
}
|
|
930
1035
|
),
|
|
931
|
-
/* @__PURE__ */ (0,
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
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
|
+
] })
|
|
941
1057
|
] }) });
|
|
942
1058
|
}
|
|
943
1059
|
|
|
944
1060
|
// src/components/loader-bar/LoaderBar.tsx
|
|
945
|
-
var
|
|
1061
|
+
var import_react12 = require("react");
|
|
946
1062
|
var import_core3 = require("@abpjs/core");
|
|
947
|
-
var
|
|
1063
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
948
1064
|
function LoaderBar({
|
|
949
1065
|
containerClass = "abp-loader-bar",
|
|
950
1066
|
progressClass = "abp-progress",
|
|
@@ -953,17 +1069,17 @@ function LoaderBar({
|
|
|
953
1069
|
stopDelay = 400
|
|
954
1070
|
}) {
|
|
955
1071
|
const { loading } = (0, import_core3.useLoader)();
|
|
956
|
-
const [isLoading, setIsLoading] = (0,
|
|
957
|
-
const [progressLevel, setProgressLevel] = (0,
|
|
958
|
-
const intervalRef = (0,
|
|
959
|
-
(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)(() => {
|
|
960
1076
|
if (loading) {
|
|
961
1077
|
startLoading();
|
|
962
1078
|
} else {
|
|
963
1079
|
stopLoading();
|
|
964
1080
|
}
|
|
965
1081
|
}, [loading]);
|
|
966
|
-
(0,
|
|
1082
|
+
(0, import_react12.useEffect)(() => {
|
|
967
1083
|
return () => {
|
|
968
1084
|
if (intervalRef.current) {
|
|
969
1085
|
clearInterval(intervalRef.current);
|
|
@@ -1003,7 +1119,7 @@ function LoaderBar({
|
|
|
1003
1119
|
if (!isLoading && progressLevel === 0) {
|
|
1004
1120
|
return null;
|
|
1005
1121
|
}
|
|
1006
|
-
return /* @__PURE__ */ (0,
|
|
1122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1007
1123
|
"div",
|
|
1008
1124
|
{
|
|
1009
1125
|
className: containerClass,
|
|
@@ -1017,7 +1133,7 @@ function LoaderBar({
|
|
|
1017
1133
|
backgroundColor: "rgba(0, 0, 0, 0.1)",
|
|
1018
1134
|
overflow: "hidden"
|
|
1019
1135
|
},
|
|
1020
|
-
children: /* @__PURE__ */ (0,
|
|
1136
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1021
1137
|
"div",
|
|
1022
1138
|
{
|
|
1023
1139
|
className: progressClass,
|
|
@@ -1034,9 +1150,9 @@ function LoaderBar({
|
|
|
1034
1150
|
}
|
|
1035
1151
|
|
|
1036
1152
|
// src/components/modal/Modal.tsx
|
|
1037
|
-
var
|
|
1038
|
-
var
|
|
1039
|
-
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");
|
|
1040
1156
|
function getSizeWidth(size) {
|
|
1041
1157
|
switch (size) {
|
|
1042
1158
|
case "sm":
|
|
@@ -1074,12 +1190,12 @@ function Modal({
|
|
|
1074
1190
|
preventScroll = true,
|
|
1075
1191
|
onInit
|
|
1076
1192
|
}) {
|
|
1077
|
-
const prevVisibleRef =
|
|
1078
|
-
const onInitRef =
|
|
1079
|
-
|
|
1193
|
+
const prevVisibleRef = import_react13.default.useRef(false);
|
|
1194
|
+
const onInitRef = import_react13.default.useRef(onInit);
|
|
1195
|
+
import_react13.default.useEffect(() => {
|
|
1080
1196
|
onInitRef.current = onInit;
|
|
1081
1197
|
}, [onInit]);
|
|
1082
|
-
|
|
1198
|
+
import_react13.default.useEffect(() => {
|
|
1083
1199
|
if (visible && !prevVisibleRef.current && onInitRef.current) {
|
|
1084
1200
|
onInitRef.current();
|
|
1085
1201
|
}
|
|
@@ -1091,8 +1207,8 @@ function Modal({
|
|
|
1091
1207
|
}
|
|
1092
1208
|
onVisibleChange?.(details.open);
|
|
1093
1209
|
};
|
|
1094
|
-
return /* @__PURE__ */ (0,
|
|
1095
|
-
|
|
1210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1211
|
+
import_react14.Dialog.Root,
|
|
1096
1212
|
{
|
|
1097
1213
|
open: visible,
|
|
1098
1214
|
onOpenChange: handleOpenChange,
|
|
@@ -1103,10 +1219,10 @@ function Modal({
|
|
|
1103
1219
|
motionPreset,
|
|
1104
1220
|
trapFocus,
|
|
1105
1221
|
preventScroll,
|
|
1106
|
-
children: /* @__PURE__ */ (0,
|
|
1107
|
-
/* @__PURE__ */ (0,
|
|
1108
|
-
/* @__PURE__ */ (0,
|
|
1109
|
-
|
|
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,
|
|
1110
1226
|
{
|
|
1111
1227
|
className: modalClass,
|
|
1112
1228
|
width: getSizeWidth(size),
|
|
@@ -1115,17 +1231,17 @@ function Modal({
|
|
|
1115
1231
|
height,
|
|
1116
1232
|
minHeight,
|
|
1117
1233
|
children: [
|
|
1118
|
-
(header || showCloseButton) && /* @__PURE__ */ (0,
|
|
1119
|
-
/* @__PURE__ */ (0,
|
|
1120
|
-
header && /* @__PURE__ */ (0,
|
|
1121
|
-
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" }) })
|
|
1122
1238
|
] }) }),
|
|
1123
|
-
/* @__PURE__ */ (0,
|
|
1239
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react14.Separator, {})
|
|
1124
1240
|
] }),
|
|
1125
|
-
children && /* @__PURE__ */ (0,
|
|
1126
|
-
footer && /* @__PURE__ */ (0,
|
|
1127
|
-
/* @__PURE__ */ (0,
|
|
1128
|
-
/* @__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 }) })
|
|
1129
1245
|
] })
|
|
1130
1246
|
]
|
|
1131
1247
|
}
|
|
@@ -1135,18 +1251,18 @@ function Modal({
|
|
|
1135
1251
|
);
|
|
1136
1252
|
}
|
|
1137
1253
|
function AbpModalHeader({ children, className }) {
|
|
1138
|
-
return /* @__PURE__ */ (0,
|
|
1254
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react14.Text, { fontWeight: "bold", fontSize: "lg", className, children });
|
|
1139
1255
|
}
|
|
1140
1256
|
function AbpModalBody({ children, className }) {
|
|
1141
|
-
return /* @__PURE__ */ (0,
|
|
1257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react14.Box, { color: "gray.600", className, children });
|
|
1142
1258
|
}
|
|
1143
1259
|
function AbpModalFooter({ children, className }) {
|
|
1144
|
-
return /* @__PURE__ */ (0,
|
|
1260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react14.Flex, { gap: 3, justify: "flex-end", className, children });
|
|
1145
1261
|
}
|
|
1146
1262
|
|
|
1147
1263
|
// src/components/ui/Alert.tsx
|
|
1148
|
-
var
|
|
1149
|
-
var
|
|
1264
|
+
var import_react15 = require("@chakra-ui/react");
|
|
1265
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1150
1266
|
function Alert({
|
|
1151
1267
|
status = "info",
|
|
1152
1268
|
children,
|
|
@@ -1157,29 +1273,29 @@ function Alert({
|
|
|
1157
1273
|
mb,
|
|
1158
1274
|
borderRadius = "md"
|
|
1159
1275
|
}) {
|
|
1160
|
-
return /* @__PURE__ */ (0,
|
|
1161
|
-
|
|
1276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1277
|
+
import_react15.Alert.Root,
|
|
1162
1278
|
{
|
|
1163
1279
|
status,
|
|
1164
1280
|
className,
|
|
1165
1281
|
mb,
|
|
1166
1282
|
borderRadius,
|
|
1167
1283
|
children: [
|
|
1168
|
-
showIcon && /* @__PURE__ */ (0,
|
|
1169
|
-
title ? /* @__PURE__ */ (0,
|
|
1170
|
-
/* @__PURE__ */ (0,
|
|
1171
|
-
(description || children) && /* @__PURE__ */ (0,
|
|
1172
|
-
] }) : /* @__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 })
|
|
1173
1289
|
]
|
|
1174
1290
|
}
|
|
1175
1291
|
);
|
|
1176
1292
|
}
|
|
1177
1293
|
|
|
1178
1294
|
// src/components/ui/Button.tsx
|
|
1179
|
-
var
|
|
1180
|
-
var
|
|
1181
|
-
var
|
|
1182
|
-
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)(
|
|
1183
1299
|
function Button4({
|
|
1184
1300
|
children,
|
|
1185
1301
|
type = "button",
|
|
@@ -1195,8 +1311,8 @@ var Button3 = (0, import_react13.forwardRef)(
|
|
|
1195
1311
|
mr,
|
|
1196
1312
|
ml
|
|
1197
1313
|
}, ref) {
|
|
1198
|
-
return /* @__PURE__ */ (0,
|
|
1199
|
-
|
|
1314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1315
|
+
import_react17.Button,
|
|
1200
1316
|
{
|
|
1201
1317
|
ref,
|
|
1202
1318
|
type,
|
|
@@ -1218,10 +1334,10 @@ var Button3 = (0, import_react13.forwardRef)(
|
|
|
1218
1334
|
);
|
|
1219
1335
|
|
|
1220
1336
|
// src/components/ui/Checkbox.tsx
|
|
1221
|
-
var
|
|
1222
|
-
var
|
|
1223
|
-
var
|
|
1224
|
-
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)(
|
|
1225
1341
|
function Checkbox2({
|
|
1226
1342
|
children,
|
|
1227
1343
|
checked,
|
|
@@ -1238,8 +1354,8 @@ var Checkbox = (0, import_react15.forwardRef)(
|
|
|
1238
1354
|
onChange,
|
|
1239
1355
|
className
|
|
1240
1356
|
}, ref) {
|
|
1241
|
-
return /* @__PURE__ */ (0,
|
|
1242
|
-
|
|
1357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1358
|
+
import_react19.Checkbox.Root,
|
|
1243
1359
|
{
|
|
1244
1360
|
checked,
|
|
1245
1361
|
defaultChecked,
|
|
@@ -1251,8 +1367,8 @@ var Checkbox = (0, import_react15.forwardRef)(
|
|
|
1251
1367
|
size,
|
|
1252
1368
|
className,
|
|
1253
1369
|
children: [
|
|
1254
|
-
/* @__PURE__ */ (0,
|
|
1255
|
-
|
|
1370
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1371
|
+
import_react19.Checkbox.HiddenInput,
|
|
1256
1372
|
{
|
|
1257
1373
|
ref,
|
|
1258
1374
|
id,
|
|
@@ -1261,8 +1377,8 @@ var Checkbox = (0, import_react15.forwardRef)(
|
|
|
1261
1377
|
onChange
|
|
1262
1378
|
}
|
|
1263
1379
|
),
|
|
1264
|
-
/* @__PURE__ */ (0,
|
|
1265
|
-
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 })
|
|
1266
1382
|
]
|
|
1267
1383
|
}
|
|
1268
1384
|
);
|
|
@@ -1270,8 +1386,8 @@ var Checkbox = (0, import_react15.forwardRef)(
|
|
|
1270
1386
|
);
|
|
1271
1387
|
|
|
1272
1388
|
// src/components/ui/FormField.tsx
|
|
1273
|
-
var
|
|
1274
|
-
var
|
|
1389
|
+
var import_react20 = require("@chakra-ui/react");
|
|
1390
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1275
1391
|
function FormField({
|
|
1276
1392
|
label,
|
|
1277
1393
|
invalid = false,
|
|
@@ -1283,24 +1399,24 @@ function FormField({
|
|
|
1283
1399
|
htmlFor,
|
|
1284
1400
|
className
|
|
1285
1401
|
}) {
|
|
1286
|
-
return /* @__PURE__ */ (0,
|
|
1287
|
-
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: [
|
|
1288
1404
|
label,
|
|
1289
|
-
required && /* @__PURE__ */ (0,
|
|
1405
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react20.Field.RequiredIndicator, {})
|
|
1290
1406
|
] }),
|
|
1291
1407
|
children,
|
|
1292
|
-
helperText && !invalid && /* @__PURE__ */ (0,
|
|
1293
|
-
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 })
|
|
1294
1410
|
] });
|
|
1295
1411
|
}
|
|
1296
1412
|
|
|
1297
1413
|
// src/components/change-password/ChangePassword.tsx
|
|
1298
|
-
var
|
|
1299
|
-
var
|
|
1414
|
+
var import_react21 = require("react");
|
|
1415
|
+
var import_react22 = require("@chakra-ui/react");
|
|
1300
1416
|
var import_react_hook_form = require("react-hook-form");
|
|
1301
1417
|
var import_core4 = require("@abpjs/core");
|
|
1302
1418
|
var import_lucide_react3 = require("lucide-react");
|
|
1303
|
-
var
|
|
1419
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1304
1420
|
function ChangePassword({
|
|
1305
1421
|
visible,
|
|
1306
1422
|
onVisibleChange
|
|
@@ -1322,7 +1438,7 @@ function ChangePassword({
|
|
|
1322
1438
|
}
|
|
1323
1439
|
});
|
|
1324
1440
|
const newPassword = watch("newPassword");
|
|
1325
|
-
(0,
|
|
1441
|
+
(0, import_react21.useEffect)(() => {
|
|
1326
1442
|
if (visible) {
|
|
1327
1443
|
reset();
|
|
1328
1444
|
}
|
|
@@ -1363,23 +1479,23 @@ function ChangePassword({
|
|
|
1363
1479
|
hasSpecial: (value) => /[!@#$%^&*(),.?":{}|<>]/.test(value) || t("AbpIdentity::PasswordRequiresNonAlphanumeric") || "Password must contain a special character"
|
|
1364
1480
|
}
|
|
1365
1481
|
};
|
|
1366
|
-
const modalFooter = /* @__PURE__ */ (0,
|
|
1367
|
-
/* @__PURE__ */ (0,
|
|
1368
|
-
/* @__PURE__ */ (0,
|
|
1369
|
-
|
|
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,
|
|
1370
1486
|
{
|
|
1371
1487
|
colorPalette: "blue",
|
|
1372
1488
|
type: "submit",
|
|
1373
1489
|
loading: isSubmitting,
|
|
1374
1490
|
form: "change-password-form",
|
|
1375
1491
|
children: [
|
|
1376
|
-
/* @__PURE__ */ (0,
|
|
1492
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react3.Check, { size: 16 }),
|
|
1377
1493
|
t("AbpIdentity::Save") || "Save"
|
|
1378
1494
|
]
|
|
1379
1495
|
}
|
|
1380
1496
|
)
|
|
1381
1497
|
] });
|
|
1382
|
-
return /* @__PURE__ */ (0,
|
|
1498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1383
1499
|
Modal,
|
|
1384
1500
|
{
|
|
1385
1501
|
visible,
|
|
@@ -1388,14 +1504,14 @@ function ChangePassword({
|
|
|
1388
1504
|
header: t("AbpIdentity::ChangePassword") || "Change Password",
|
|
1389
1505
|
footer: modalFooter,
|
|
1390
1506
|
centered: true,
|
|
1391
|
-
children: /* @__PURE__ */ (0,
|
|
1392
|
-
/* @__PURE__ */ (0,
|
|
1393
|
-
/* @__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: [
|
|
1394
1510
|
t("AbpIdentity::DisplayName:CurrentPassword") || "Current Password",
|
|
1395
|
-
/* @__PURE__ */ (0,
|
|
1511
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react22.Field.RequiredIndicator, {})
|
|
1396
1512
|
] }),
|
|
1397
|
-
/* @__PURE__ */ (0,
|
|
1398
|
-
|
|
1513
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1514
|
+
import_react22.Input,
|
|
1399
1515
|
{
|
|
1400
1516
|
type: "password",
|
|
1401
1517
|
...register("password", {
|
|
@@ -1403,29 +1519,29 @@ function ChangePassword({
|
|
|
1403
1519
|
})
|
|
1404
1520
|
}
|
|
1405
1521
|
),
|
|
1406
|
-
/* @__PURE__ */ (0,
|
|
1522
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react22.Field.ErrorText, { children: errors.password?.message })
|
|
1407
1523
|
] }),
|
|
1408
|
-
/* @__PURE__ */ (0,
|
|
1409
|
-
/* @__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: [
|
|
1410
1526
|
t("AbpIdentity::DisplayName:NewPassword") || "New Password",
|
|
1411
|
-
/* @__PURE__ */ (0,
|
|
1527
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react22.Field.RequiredIndicator, {})
|
|
1412
1528
|
] }),
|
|
1413
|
-
/* @__PURE__ */ (0,
|
|
1414
|
-
|
|
1529
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1530
|
+
import_react22.Input,
|
|
1415
1531
|
{
|
|
1416
1532
|
type: "password",
|
|
1417
1533
|
...register("newPassword", passwordValidation)
|
|
1418
1534
|
}
|
|
1419
1535
|
),
|
|
1420
|
-
/* @__PURE__ */ (0,
|
|
1536
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react22.Field.ErrorText, { children: errors.newPassword?.message })
|
|
1421
1537
|
] }),
|
|
1422
|
-
/* @__PURE__ */ (0,
|
|
1423
|
-
/* @__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: [
|
|
1424
1540
|
t("AbpIdentity::DisplayName:NewPasswordConfirm") || "Confirm New Password",
|
|
1425
|
-
/* @__PURE__ */ (0,
|
|
1541
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react22.Field.RequiredIndicator, {})
|
|
1426
1542
|
] }),
|
|
1427
|
-
/* @__PURE__ */ (0,
|
|
1428
|
-
|
|
1543
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1544
|
+
import_react22.Input,
|
|
1429
1545
|
{
|
|
1430
1546
|
type: "password",
|
|
1431
1547
|
...register("repeatNewPassword", {
|
|
@@ -1434,7 +1550,7 @@ function ChangePassword({
|
|
|
1434
1550
|
})
|
|
1435
1551
|
}
|
|
1436
1552
|
),
|
|
1437
|
-
/* @__PURE__ */ (0,
|
|
1553
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react22.Field.ErrorText, { children: errors.repeatNewPassword?.message })
|
|
1438
1554
|
] })
|
|
1439
1555
|
] }) })
|
|
1440
1556
|
}
|
|
@@ -1442,12 +1558,12 @@ function ChangePassword({
|
|
|
1442
1558
|
}
|
|
1443
1559
|
|
|
1444
1560
|
// src/components/profile/Profile.tsx
|
|
1445
|
-
var
|
|
1446
|
-
var
|
|
1561
|
+
var import_react23 = require("react");
|
|
1562
|
+
var import_react24 = require("@chakra-ui/react");
|
|
1447
1563
|
var import_react_hook_form2 = require("react-hook-form");
|
|
1448
1564
|
var import_core5 = require("@abpjs/core");
|
|
1449
1565
|
var import_lucide_react4 = require("lucide-react");
|
|
1450
|
-
var
|
|
1566
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1451
1567
|
function Profile({
|
|
1452
1568
|
visible,
|
|
1453
1569
|
onVisibleChange
|
|
@@ -1470,13 +1586,13 @@ function Profile({
|
|
|
1470
1586
|
}
|
|
1471
1587
|
});
|
|
1472
1588
|
const modalBusy = isSubmitting || loading;
|
|
1473
|
-
(0,
|
|
1589
|
+
(0, import_react23.useEffect)(() => {
|
|
1474
1590
|
if (visible) {
|
|
1475
1591
|
fetchProfile().then(() => {
|
|
1476
1592
|
});
|
|
1477
1593
|
}
|
|
1478
1594
|
}, [visible, fetchProfile]);
|
|
1479
|
-
(0,
|
|
1595
|
+
(0, import_react23.useEffect)(() => {
|
|
1480
1596
|
if (profile) {
|
|
1481
1597
|
reset({
|
|
1482
1598
|
userName: profile.userName || "",
|
|
@@ -1507,23 +1623,23 @@ function Profile({
|
|
|
1507
1623
|
onVisibleChange(false);
|
|
1508
1624
|
}
|
|
1509
1625
|
};
|
|
1510
|
-
const modalFooter = /* @__PURE__ */ (0,
|
|
1511
|
-
/* @__PURE__ */ (0,
|
|
1512
|
-
/* @__PURE__ */ (0,
|
|
1513
|
-
|
|
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,
|
|
1514
1630
|
{
|
|
1515
1631
|
colorPalette: "blue",
|
|
1516
1632
|
type: "submit",
|
|
1517
1633
|
loading: modalBusy,
|
|
1518
1634
|
form: "profile-form",
|
|
1519
1635
|
children: [
|
|
1520
|
-
/* @__PURE__ */ (0,
|
|
1636
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react4.Check, { size: 16 }),
|
|
1521
1637
|
t("AbpIdentity::Save") || "Save"
|
|
1522
1638
|
]
|
|
1523
1639
|
}
|
|
1524
1640
|
)
|
|
1525
1641
|
] });
|
|
1526
|
-
return /* @__PURE__ */ (0,
|
|
1642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1527
1643
|
Modal,
|
|
1528
1644
|
{
|
|
1529
1645
|
visible,
|
|
@@ -1533,14 +1649,14 @@ function Profile({
|
|
|
1533
1649
|
footer: modalFooter,
|
|
1534
1650
|
size: "lg",
|
|
1535
1651
|
centered: true,
|
|
1536
|
-
children: /* @__PURE__ */ (0,
|
|
1537
|
-
/* @__PURE__ */ (0,
|
|
1538
|
-
/* @__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: [
|
|
1539
1655
|
t("AbpIdentity::DisplayName:UserName") || "Username",
|
|
1540
|
-
/* @__PURE__ */ (0,
|
|
1656
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react24.Field.RequiredIndicator, {})
|
|
1541
1657
|
] }),
|
|
1542
|
-
/* @__PURE__ */ (0,
|
|
1543
|
-
|
|
1658
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1659
|
+
import_react24.Input,
|
|
1544
1660
|
{
|
|
1545
1661
|
type: "text",
|
|
1546
1662
|
...register("userName", {
|
|
@@ -1552,13 +1668,13 @@ function Profile({
|
|
|
1552
1668
|
})
|
|
1553
1669
|
}
|
|
1554
1670
|
),
|
|
1555
|
-
/* @__PURE__ */ (0,
|
|
1671
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react24.Field.ErrorText, { children: errors.userName?.message })
|
|
1556
1672
|
] }),
|
|
1557
|
-
/* @__PURE__ */ (0,
|
|
1558
|
-
/* @__PURE__ */ (0,
|
|
1559
|
-
/* @__PURE__ */ (0,
|
|
1560
|
-
/* @__PURE__ */ (0,
|
|
1561
|
-
|
|
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,
|
|
1562
1678
|
{
|
|
1563
1679
|
type: "text",
|
|
1564
1680
|
...register("name", {
|
|
@@ -1569,12 +1685,12 @@ function Profile({
|
|
|
1569
1685
|
})
|
|
1570
1686
|
}
|
|
1571
1687
|
),
|
|
1572
|
-
/* @__PURE__ */ (0,
|
|
1688
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react24.Field.ErrorText, { children: errors.name?.message })
|
|
1573
1689
|
] }),
|
|
1574
|
-
/* @__PURE__ */ (0,
|
|
1575
|
-
/* @__PURE__ */ (0,
|
|
1576
|
-
/* @__PURE__ */ (0,
|
|
1577
|
-
|
|
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,
|
|
1578
1694
|
{
|
|
1579
1695
|
type: "text",
|
|
1580
1696
|
...register("surname", {
|
|
@@ -1585,16 +1701,16 @@ function Profile({
|
|
|
1585
1701
|
})
|
|
1586
1702
|
}
|
|
1587
1703
|
),
|
|
1588
|
-
/* @__PURE__ */ (0,
|
|
1704
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react24.Field.ErrorText, { children: errors.surname?.message })
|
|
1589
1705
|
] })
|
|
1590
1706
|
] }),
|
|
1591
|
-
/* @__PURE__ */ (0,
|
|
1592
|
-
/* @__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: [
|
|
1593
1709
|
t("AbpIdentity::DisplayName:EmailAddress") || "Email Address",
|
|
1594
|
-
/* @__PURE__ */ (0,
|
|
1710
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react24.Field.RequiredIndicator, {})
|
|
1595
1711
|
] }),
|
|
1596
|
-
/* @__PURE__ */ (0,
|
|
1597
|
-
|
|
1712
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1713
|
+
import_react24.Input,
|
|
1598
1714
|
{
|
|
1599
1715
|
type: "email",
|
|
1600
1716
|
...register("email", {
|
|
@@ -1610,12 +1726,12 @@ function Profile({
|
|
|
1610
1726
|
})
|
|
1611
1727
|
}
|
|
1612
1728
|
),
|
|
1613
|
-
/* @__PURE__ */ (0,
|
|
1729
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react24.Field.ErrorText, { children: errors.email?.message })
|
|
1614
1730
|
] }),
|
|
1615
|
-
/* @__PURE__ */ (0,
|
|
1616
|
-
/* @__PURE__ */ (0,
|
|
1617
|
-
/* @__PURE__ */ (0,
|
|
1618
|
-
|
|
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,
|
|
1619
1735
|
{
|
|
1620
1736
|
type: "tel",
|
|
1621
1737
|
...register("phoneNumber", {
|
|
@@ -1626,7 +1742,7 @@ function Profile({
|
|
|
1626
1742
|
})
|
|
1627
1743
|
}
|
|
1628
1744
|
),
|
|
1629
|
-
/* @__PURE__ */ (0,
|
|
1745
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react24.Field.ErrorText, { children: errors.phoneNumber?.message })
|
|
1630
1746
|
] })
|
|
1631
1747
|
] }) })
|
|
1632
1748
|
}
|
|
@@ -1634,10 +1750,10 @@ function Profile({
|
|
|
1634
1750
|
}
|
|
1635
1751
|
|
|
1636
1752
|
// src/providers/ThemeSharedProvider.tsx
|
|
1637
|
-
var
|
|
1753
|
+
var import_react27 = require("@chakra-ui/react");
|
|
1638
1754
|
|
|
1639
1755
|
// src/theme/index.ts
|
|
1640
|
-
var
|
|
1756
|
+
var import_react25 = require("@chakra-ui/react");
|
|
1641
1757
|
var colors = {
|
|
1642
1758
|
brand: {
|
|
1643
1759
|
50: { value: "#e3f2fd" },
|
|
@@ -1840,7 +1956,7 @@ var semanticTokens = {
|
|
|
1840
1956
|
// },
|
|
1841
1957
|
// },
|
|
1842
1958
|
};
|
|
1843
|
-
var defaultAbpConfig = (0,
|
|
1959
|
+
var defaultAbpConfig = (0, import_react25.defineConfig)({
|
|
1844
1960
|
theme: {
|
|
1845
1961
|
tokens: {
|
|
1846
1962
|
colors,
|
|
@@ -1862,20 +1978,20 @@ var defaultAbpConfig = (0, import_react22.defineConfig)({
|
|
|
1862
1978
|
});
|
|
1863
1979
|
function createAbpSystem(overrides) {
|
|
1864
1980
|
if (overrides) {
|
|
1865
|
-
return (0,
|
|
1981
|
+
return (0, import_react25.createSystem)(import_react25.defaultConfig, defaultAbpConfig, overrides);
|
|
1866
1982
|
}
|
|
1867
|
-
return (0,
|
|
1983
|
+
return (0, import_react25.createSystem)(import_react25.defaultConfig, defaultAbpConfig);
|
|
1868
1984
|
}
|
|
1869
1985
|
var abpSystem = createAbpSystem();
|
|
1870
1986
|
|
|
1871
1987
|
// src/components/ui/color-mode.tsx
|
|
1872
|
-
var
|
|
1988
|
+
var import_react26 = require("@chakra-ui/react");
|
|
1873
1989
|
var import_next_themes = require("next-themes");
|
|
1874
|
-
var
|
|
1990
|
+
var React12 = __toESM(require("react"));
|
|
1875
1991
|
var import_lucide_react5 = require("lucide-react");
|
|
1876
|
-
var
|
|
1992
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1877
1993
|
function ColorModeProvider(props) {
|
|
1878
|
-
return /* @__PURE__ */ (0,
|
|
1994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_next_themes.ThemeProvider, { attribute: "class", disableTransitionOnChange: true, ...props });
|
|
1879
1995
|
}
|
|
1880
1996
|
function useColorMode() {
|
|
1881
1997
|
const { resolvedTheme, setTheme, forcedTheme } = (0, import_next_themes.useTheme)();
|
|
@@ -1891,12 +2007,12 @@ function useColorMode() {
|
|
|
1891
2007
|
}
|
|
1892
2008
|
function ColorModeIcon() {
|
|
1893
2009
|
const { colorMode } = useColorMode();
|
|
1894
|
-
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, {});
|
|
1895
2011
|
}
|
|
1896
|
-
var ColorModeButton =
|
|
2012
|
+
var ColorModeButton = React12.forwardRef(function ColorModeButton2(props, ref) {
|
|
1897
2013
|
const { toggleColorMode } = useColorMode();
|
|
1898
|
-
return /* @__PURE__ */ (0,
|
|
1899
|
-
|
|
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,
|
|
1900
2016
|
{
|
|
1901
2017
|
onClick: toggleColorMode,
|
|
1902
2018
|
variant: "ghost",
|
|
@@ -1910,14 +2026,14 @@ var ColorModeButton = React11.forwardRef(function ColorModeButton2(props, ref) {
|
|
|
1910
2026
|
height: "5"
|
|
1911
2027
|
}
|
|
1912
2028
|
},
|
|
1913
|
-
children: /* @__PURE__ */ (0,
|
|
2029
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ColorModeIcon, {})
|
|
1914
2030
|
}
|
|
1915
2031
|
) });
|
|
1916
2032
|
});
|
|
1917
|
-
var LightMode =
|
|
2033
|
+
var LightMode = React12.forwardRef(
|
|
1918
2034
|
function LightMode2(props, ref) {
|
|
1919
|
-
return /* @__PURE__ */ (0,
|
|
1920
|
-
|
|
2035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2036
|
+
import_react26.Span,
|
|
1921
2037
|
{
|
|
1922
2038
|
color: "fg",
|
|
1923
2039
|
display: "contents",
|
|
@@ -1930,10 +2046,10 @@ var LightMode = React11.forwardRef(
|
|
|
1930
2046
|
);
|
|
1931
2047
|
}
|
|
1932
2048
|
);
|
|
1933
|
-
var DarkMode =
|
|
2049
|
+
var DarkMode = React12.forwardRef(
|
|
1934
2050
|
function DarkMode2(props, ref) {
|
|
1935
|
-
return /* @__PURE__ */ (0,
|
|
1936
|
-
|
|
2051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2052
|
+
import_react26.Span,
|
|
1937
2053
|
{
|
|
1938
2054
|
color: "fg",
|
|
1939
2055
|
display: "contents",
|
|
@@ -1949,7 +2065,7 @@ var DarkMode = React11.forwardRef(
|
|
|
1949
2065
|
|
|
1950
2066
|
// src/providers/ThemeSharedProvider.tsx
|
|
1951
2067
|
var import_core6 = require("@abpjs/core");
|
|
1952
|
-
var
|
|
2068
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1953
2069
|
function ThemeSharedProvider({
|
|
1954
2070
|
children,
|
|
1955
2071
|
renderToasts = true,
|
|
@@ -1963,13 +2079,13 @@ function ThemeSharedProvider({
|
|
|
1963
2079
|
const system = themeOverrides ? createAbpSystem(themeOverrides) : abpSystem;
|
|
1964
2080
|
const { endSide } = (0, import_core6.useDirection)();
|
|
1965
2081
|
toastPosition = `bottom-${endSide}`;
|
|
1966
|
-
const content = /* @__PURE__ */ (0,
|
|
2082
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ToasterProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(ConfirmationProvider, { children: [
|
|
1967
2083
|
children,
|
|
1968
|
-
renderToasts && /* @__PURE__ */ (0,
|
|
1969
|
-
renderConfirmation && /* @__PURE__ */ (0,
|
|
2084
|
+
renderToasts && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ToastContainer, { position: toastPosition }),
|
|
2085
|
+
renderConfirmation && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ConfirmationDialog, {})
|
|
1970
2086
|
] }) });
|
|
1971
2087
|
const colorModeProps = enableColorMode ? { defaultTheme: defaultColorMode } : { forcedTheme: "light" };
|
|
1972
|
-
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 }) }) });
|
|
1973
2089
|
}
|
|
1974
2090
|
|
|
1975
2091
|
// src/utils/styles.ts
|
|
@@ -2042,6 +2158,120 @@ function injectThemeSharedStyles() {
|
|
|
2042
2158
|
}
|
|
2043
2159
|
};
|
|
2044
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
|
+
}
|
|
2045
2275
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2046
2276
|
0 && (module.exports = {
|
|
2047
2277
|
AbpModalBody,
|
|
@@ -2058,13 +2288,20 @@ function injectThemeSharedStyles() {
|
|
|
2058
2288
|
DEFAULT_STYLES,
|
|
2059
2289
|
ErrorComponent,
|
|
2060
2290
|
FormField,
|
|
2291
|
+
HTTP_ERROR_CONFIG,
|
|
2292
|
+
HttpErrorConfigContext,
|
|
2061
2293
|
LoaderBar,
|
|
2062
2294
|
Modal,
|
|
2063
2295
|
ModalBody,
|
|
2296
|
+
ModalContainer,
|
|
2064
2297
|
ModalFooter,
|
|
2065
2298
|
ModalHeader,
|
|
2299
|
+
ModalProvider,
|
|
2300
|
+
PASSWORD_SETTING_KEYS,
|
|
2066
2301
|
Profile,
|
|
2302
|
+
THEME_SHARED_APPEND_CONTENT,
|
|
2067
2303
|
THEME_SHARED_STYLES,
|
|
2304
|
+
ThemeSharedAppendContentContext,
|
|
2068
2305
|
ThemeSharedProvider,
|
|
2069
2306
|
ToastContainer,
|
|
2070
2307
|
Toaster,
|
|
@@ -2074,14 +2311,22 @@ function injectThemeSharedStyles() {
|
|
|
2074
2311
|
createErrorInterceptor,
|
|
2075
2312
|
defaultAbpConfig,
|
|
2076
2313
|
defineConfig,
|
|
2314
|
+
getPasswordSettings,
|
|
2315
|
+
getPasswordValidationRules,
|
|
2316
|
+
getPasswordValidators,
|
|
2077
2317
|
getSeverityBg,
|
|
2078
2318
|
getSeverityBorderColor,
|
|
2079
2319
|
getSeverityColorScheme,
|
|
2320
|
+
httpErrorConfigFactory,
|
|
2080
2321
|
injectThemeSharedStyles,
|
|
2081
2322
|
useConfirmation,
|
|
2082
2323
|
useConfirmationContext,
|
|
2083
2324
|
useConfirmationState,
|
|
2084
2325
|
useErrorHandler,
|
|
2326
|
+
useHttpErrorConfig,
|
|
2327
|
+
useModal,
|
|
2328
|
+
useModalContext,
|
|
2329
|
+
useModalState,
|
|
2085
2330
|
useToaster,
|
|
2086
2331
|
useToasterContext,
|
|
2087
2332
|
useToasts
|