@abpjs/theme-shared 2.2.0 → 2.4.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/constants/append-content.d.ts +34 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.js +204 -195
- package/dist/index.mjs +11 -4
- package/dist/models/toaster.d.ts +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context for theme shared append content functionality.
|
|
3
|
+
* Used to append scripts or stylesheets to the document.
|
|
4
|
+
*
|
|
5
|
+
* This is the React equivalent of Angular's THEME_SHARED_APPEND_CONTENT InjectionToken.
|
|
6
|
+
*
|
|
7
|
+
* @since 2.4.0
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* // Provide a custom append content function
|
|
12
|
+
* import { ThemeSharedAppendContentContext } from '@abpjs/theme-shared';
|
|
13
|
+
*
|
|
14
|
+
* function App() {
|
|
15
|
+
* const appendContent = async () => {
|
|
16
|
+
* // Custom logic to append scripts/styles
|
|
17
|
+
* };
|
|
18
|
+
*
|
|
19
|
+
* return (
|
|
20
|
+
* <ThemeSharedAppendContentContext.Provider value={appendContent}>
|
|
21
|
+
* <YourApp />
|
|
22
|
+
* </ThemeSharedAppendContentContext.Provider>
|
|
23
|
+
* );
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare const ThemeSharedAppendContentContext: import("react").Context<(() => Promise<void>) | undefined>;
|
|
28
|
+
/**
|
|
29
|
+
* Token name constant for THEME_SHARED_APPEND_CONTENT.
|
|
30
|
+
* Matches the Angular InjectionToken name.
|
|
31
|
+
*
|
|
32
|
+
* @since 2.4.0
|
|
33
|
+
*/
|
|
34
|
+
export declare const THEME_SHARED_APPEND_CONTENT = "THEME_SHARED_APPEND_CONTENT";
|
package/dist/index.d.ts
CHANGED
|
@@ -2,11 +2,17 @@
|
|
|
2
2
|
* @abpjs/theme-shared
|
|
3
3
|
*
|
|
4
4
|
* ABP Framework Theme Shared components for React.
|
|
5
|
-
* Translated from @abp/ng.theme.shared v2.
|
|
5
|
+
* Translated from @abp/ng.theme.shared v2.4.0
|
|
6
6
|
*
|
|
7
7
|
* This package provides shared UI components, services, and utilities
|
|
8
8
|
* for theme/modal management in ABP Framework React applications.
|
|
9
9
|
*
|
|
10
|
+
* Changes in v2.4.0:
|
|
11
|
+
* - Added THEME_SHARED_APPEND_CONTENT token for content appending
|
|
12
|
+
* - Updated Toaster.Status deprecation notice (removal now in v3.0 instead of v2.2)
|
|
13
|
+
* - Dependency updates to @abp/ng.core v2.4.0
|
|
14
|
+
* - appendScript function deprecated (to be deleted in v2.6)
|
|
15
|
+
*
|
|
10
16
|
* Changes in v2.2.0:
|
|
11
17
|
* - Dependency updates to @abp/ng.core v2.2.0
|
|
12
18
|
* - Dependency updates to @fortawesome/fontawesome-free v5.12.1
|
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_react12.Dialog,
|
|
39
39
|
ChangePassword: () => ChangePassword,
|
|
40
40
|
Checkbox: () => Checkbox,
|
|
41
41
|
Confirmation: () => Confirmation,
|
|
@@ -50,7 +50,9 @@ __export(index_exports, {
|
|
|
50
50
|
ModalFooter: () => AbpModalFooter,
|
|
51
51
|
ModalHeader: () => AbpModalHeader,
|
|
52
52
|
Profile: () => Profile,
|
|
53
|
+
THEME_SHARED_APPEND_CONTENT: () => THEME_SHARED_APPEND_CONTENT,
|
|
53
54
|
THEME_SHARED_STYLES: () => THEME_SHARED_STYLES,
|
|
55
|
+
ThemeSharedAppendContentContext: () => ThemeSharedAppendContentContext,
|
|
54
56
|
ThemeSharedProvider: () => ThemeSharedProvider,
|
|
55
57
|
ToastContainer: () => ToastContainer,
|
|
56
58
|
Toaster: () => Toaster,
|
|
@@ -59,7 +61,7 @@ __export(index_exports, {
|
|
|
59
61
|
createAbpSystem: () => createAbpSystem,
|
|
60
62
|
createErrorInterceptor: () => createErrorInterceptor,
|
|
61
63
|
defaultAbpConfig: () => defaultAbpConfig,
|
|
62
|
-
defineConfig: () =>
|
|
64
|
+
defineConfig: () => import_react23.defineConfig,
|
|
63
65
|
getSeverityBg: () => getSeverityBg,
|
|
64
66
|
getSeverityBorderColor: () => getSeverityBorderColor,
|
|
65
67
|
getSeverityColorScheme: () => getSeverityColorPalette,
|
|
@@ -273,10 +275,15 @@ var DEFAULT_STYLES = `
|
|
|
273
275
|
}
|
|
274
276
|
`;
|
|
275
277
|
|
|
276
|
-
// src/
|
|
278
|
+
// src/constants/append-content.ts
|
|
277
279
|
var import_react = require("react");
|
|
280
|
+
var ThemeSharedAppendContentContext = (0, import_react.createContext)(void 0);
|
|
281
|
+
var THEME_SHARED_APPEND_CONTENT = "THEME_SHARED_APPEND_CONTENT";
|
|
282
|
+
|
|
283
|
+
// src/contexts/toaster.context.tsx
|
|
284
|
+
var import_react2 = require("react");
|
|
278
285
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
279
|
-
var ToasterContext = (0,
|
|
286
|
+
var ToasterContext = (0, import_react2.createContext)(null);
|
|
280
287
|
var toastCounter = 0;
|
|
281
288
|
function generateId() {
|
|
282
289
|
toastCounter += 1;
|
|
@@ -284,17 +291,17 @@ function generateId() {
|
|
|
284
291
|
}
|
|
285
292
|
var DEFAULT_LIFE = 5e3;
|
|
286
293
|
function ToasterProvider({ children }) {
|
|
287
|
-
const [toasts, setToasts] = (0,
|
|
288
|
-
const subscribersRef = (0,
|
|
289
|
-
(0,
|
|
294
|
+
const [toasts, setToasts] = (0, import_react2.useState)([]);
|
|
295
|
+
const subscribersRef = (0, import_react2.useRef)(/* @__PURE__ */ new Set());
|
|
296
|
+
(0, import_react2.useEffect)(() => {
|
|
290
297
|
subscribersRef.current.forEach((subscriber) => {
|
|
291
298
|
subscriber(toasts);
|
|
292
299
|
});
|
|
293
300
|
}, [toasts]);
|
|
294
|
-
const remove = (0,
|
|
301
|
+
const remove = (0, import_react2.useCallback)((id) => {
|
|
295
302
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
296
303
|
}, []);
|
|
297
|
-
const show = (0,
|
|
304
|
+
const show = (0, import_react2.useCallback)(
|
|
298
305
|
(message, title, severity = "info", options) => {
|
|
299
306
|
const id = typeof options?.id === "number" ? options.id : generateId();
|
|
300
307
|
const life = options?.sticky ? void 0 : options?.life ?? DEFAULT_LIFE;
|
|
@@ -318,23 +325,23 @@ function ToasterProvider({ children }) {
|
|
|
318
325
|
},
|
|
319
326
|
[remove]
|
|
320
327
|
);
|
|
321
|
-
const info = (0,
|
|
328
|
+
const info = (0, import_react2.useCallback)(
|
|
322
329
|
(message, title, options) => show(message, title, "info", options),
|
|
323
330
|
[show]
|
|
324
331
|
);
|
|
325
|
-
const success = (0,
|
|
332
|
+
const success = (0, import_react2.useCallback)(
|
|
326
333
|
(message, title, options) => show(message, title, "success", options),
|
|
327
334
|
[show]
|
|
328
335
|
);
|
|
329
|
-
const warn = (0,
|
|
336
|
+
const warn = (0, import_react2.useCallback)(
|
|
330
337
|
(message, title, options) => show(message, title, "warning", options),
|
|
331
338
|
[show]
|
|
332
339
|
);
|
|
333
|
-
const error = (0,
|
|
340
|
+
const error = (0, import_react2.useCallback)(
|
|
334
341
|
(message, title, options) => show(message, title, "error", options),
|
|
335
342
|
[show]
|
|
336
343
|
);
|
|
337
|
-
const clear = (0,
|
|
344
|
+
const clear = (0, import_react2.useCallback)((key) => {
|
|
338
345
|
setToasts((prev) => {
|
|
339
346
|
if (key) {
|
|
340
347
|
return prev.filter((toast) => toast.options?.containerKey !== key);
|
|
@@ -342,14 +349,14 @@ function ToasterProvider({ children }) {
|
|
|
342
349
|
return [];
|
|
343
350
|
});
|
|
344
351
|
}, []);
|
|
345
|
-
const subscribe = (0,
|
|
352
|
+
const subscribe = (0, import_react2.useCallback)((subscriber) => {
|
|
346
353
|
subscribersRef.current.add(subscriber);
|
|
347
354
|
subscriber(toasts);
|
|
348
355
|
return () => {
|
|
349
356
|
subscribersRef.current.delete(subscriber);
|
|
350
357
|
};
|
|
351
358
|
}, [toasts]);
|
|
352
|
-
const service = (0,
|
|
359
|
+
const service = (0, import_react2.useMemo)(
|
|
353
360
|
() => ({
|
|
354
361
|
info,
|
|
355
362
|
success,
|
|
@@ -362,28 +369,28 @@ function ToasterProvider({ children }) {
|
|
|
362
369
|
}),
|
|
363
370
|
[info, success, warn, error, show, remove, clear, subscribe]
|
|
364
371
|
);
|
|
365
|
-
const value = (0,
|
|
372
|
+
const value = (0, import_react2.useMemo)(
|
|
366
373
|
() => ({ service, toasts }),
|
|
367
374
|
[service, toasts]
|
|
368
375
|
);
|
|
369
376
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToasterContext.Provider, { value, children });
|
|
370
377
|
}
|
|
371
378
|
function useToaster() {
|
|
372
|
-
const context = (0,
|
|
379
|
+
const context = (0, import_react2.useContext)(ToasterContext);
|
|
373
380
|
if (!context) {
|
|
374
381
|
throw new Error("useToaster must be used within a ToasterProvider");
|
|
375
382
|
}
|
|
376
383
|
return context.service;
|
|
377
384
|
}
|
|
378
385
|
function useToasts() {
|
|
379
|
-
const context = (0,
|
|
386
|
+
const context = (0, import_react2.useContext)(ToasterContext);
|
|
380
387
|
if (!context) {
|
|
381
388
|
throw new Error("useToasts must be used within a ToasterProvider");
|
|
382
389
|
}
|
|
383
390
|
return context.toasts;
|
|
384
391
|
}
|
|
385
392
|
function useToasterContext() {
|
|
386
|
-
const context = (0,
|
|
393
|
+
const context = (0, import_react2.useContext)(ToasterContext);
|
|
387
394
|
if (!context) {
|
|
388
395
|
throw new Error("useToasterContext must be used within a ToasterProvider");
|
|
389
396
|
}
|
|
@@ -391,30 +398,30 @@ function useToasterContext() {
|
|
|
391
398
|
}
|
|
392
399
|
|
|
393
400
|
// src/contexts/confirmation.context.tsx
|
|
394
|
-
var
|
|
401
|
+
var import_react3 = require("react");
|
|
395
402
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
396
|
-
var ConfirmationContext = (0,
|
|
403
|
+
var ConfirmationContext = (0, import_react3.createContext)(null);
|
|
397
404
|
function generateId2() {
|
|
398
405
|
return `confirmation-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
399
406
|
}
|
|
400
407
|
function ConfirmationProvider({ children }) {
|
|
401
|
-
const [confirmation, setConfirmation] = (0,
|
|
402
|
-
const resolverRef = (0,
|
|
403
|
-
const subscribersRef = (0,
|
|
404
|
-
const escapeListenerRef = (0,
|
|
405
|
-
(0,
|
|
408
|
+
const [confirmation, setConfirmation] = (0, import_react3.useState)(null);
|
|
409
|
+
const resolverRef = (0, import_react3.useRef)(null);
|
|
410
|
+
const subscribersRef = (0, import_react3.useRef)(/* @__PURE__ */ new Set());
|
|
411
|
+
const escapeListenerRef = (0, import_react3.useRef)(false);
|
|
412
|
+
(0, import_react3.useEffect)(() => {
|
|
406
413
|
subscribersRef.current.forEach((subscriber) => {
|
|
407
414
|
subscriber(confirmation);
|
|
408
415
|
});
|
|
409
416
|
}, [confirmation]);
|
|
410
|
-
const respond = (0,
|
|
417
|
+
const respond = (0, import_react3.useCallback)((status) => {
|
|
411
418
|
if (resolverRef.current) {
|
|
412
419
|
resolverRef.current(status);
|
|
413
420
|
resolverRef.current = null;
|
|
414
421
|
}
|
|
415
422
|
setConfirmation(null);
|
|
416
423
|
}, []);
|
|
417
|
-
(0,
|
|
424
|
+
(0, import_react3.useEffect)(() => {
|
|
418
425
|
if (!escapeListenerRef.current) return;
|
|
419
426
|
const handleEscape = (event) => {
|
|
420
427
|
if (event.key === "Escape" && confirmation && confirmation.options?.closable !== false) {
|
|
@@ -426,7 +433,7 @@ function ConfirmationProvider({ children }) {
|
|
|
426
433
|
document.removeEventListener("keydown", handleEscape);
|
|
427
434
|
};
|
|
428
435
|
}, [confirmation, respond]);
|
|
429
|
-
const show = (0,
|
|
436
|
+
const show = (0, import_react3.useCallback)(
|
|
430
437
|
(message, title, severity = "neutral", options = {}) => {
|
|
431
438
|
if (resolverRef.current) {
|
|
432
439
|
resolverRef.current(Confirmation.Status.dismiss);
|
|
@@ -448,39 +455,39 @@ function ConfirmationProvider({ children }) {
|
|
|
448
455
|
},
|
|
449
456
|
[]
|
|
450
457
|
);
|
|
451
|
-
const info = (0,
|
|
458
|
+
const info = (0, import_react3.useCallback)(
|
|
452
459
|
(message, title, options) => show(message, title, "info", options),
|
|
453
460
|
[show]
|
|
454
461
|
);
|
|
455
|
-
const success = (0,
|
|
462
|
+
const success = (0, import_react3.useCallback)(
|
|
456
463
|
(message, title, options) => show(message, title, "success", options),
|
|
457
464
|
[show]
|
|
458
465
|
);
|
|
459
|
-
const warn = (0,
|
|
466
|
+
const warn = (0, import_react3.useCallback)(
|
|
460
467
|
(message, title, options) => show(message, title, "warning", options),
|
|
461
468
|
[show]
|
|
462
469
|
);
|
|
463
|
-
const error = (0,
|
|
470
|
+
const error = (0, import_react3.useCallback)(
|
|
464
471
|
(message, title, options) => show(message, title, "error", options),
|
|
465
472
|
[show]
|
|
466
473
|
);
|
|
467
|
-
const clear = (0,
|
|
474
|
+
const clear = (0, import_react3.useCallback)(
|
|
468
475
|
(status) => {
|
|
469
476
|
respond(status ?? Confirmation.Status.dismiss);
|
|
470
477
|
},
|
|
471
478
|
[respond]
|
|
472
479
|
);
|
|
473
|
-
const listenToEscape = (0,
|
|
480
|
+
const listenToEscape = (0, import_react3.useCallback)(() => {
|
|
474
481
|
escapeListenerRef.current = true;
|
|
475
482
|
}, []);
|
|
476
|
-
const subscribe = (0,
|
|
483
|
+
const subscribe = (0, import_react3.useCallback)((subscriber) => {
|
|
477
484
|
subscribersRef.current.add(subscriber);
|
|
478
485
|
subscriber(confirmation);
|
|
479
486
|
return () => {
|
|
480
487
|
subscribersRef.current.delete(subscriber);
|
|
481
488
|
};
|
|
482
489
|
}, [confirmation]);
|
|
483
|
-
const service = (0,
|
|
490
|
+
const service = (0, import_react3.useMemo)(
|
|
484
491
|
() => ({
|
|
485
492
|
info,
|
|
486
493
|
success,
|
|
@@ -493,28 +500,28 @@ function ConfirmationProvider({ children }) {
|
|
|
493
500
|
}),
|
|
494
501
|
[info, success, warn, error, show, clear, listenToEscape, subscribe]
|
|
495
502
|
);
|
|
496
|
-
const value = (0,
|
|
503
|
+
const value = (0, import_react3.useMemo)(
|
|
497
504
|
() => ({ service, confirmation, respond }),
|
|
498
505
|
[service, confirmation, respond]
|
|
499
506
|
);
|
|
500
507
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ConfirmationContext.Provider, { value, children });
|
|
501
508
|
}
|
|
502
509
|
function useConfirmation() {
|
|
503
|
-
const context = (0,
|
|
510
|
+
const context = (0, import_react3.useContext)(ConfirmationContext);
|
|
504
511
|
if (!context) {
|
|
505
512
|
throw new Error("useConfirmation must be used within a ConfirmationProvider");
|
|
506
513
|
}
|
|
507
514
|
return context.service;
|
|
508
515
|
}
|
|
509
516
|
function useConfirmationState() {
|
|
510
|
-
const context = (0,
|
|
517
|
+
const context = (0, import_react3.useContext)(ConfirmationContext);
|
|
511
518
|
if (!context) {
|
|
512
519
|
throw new Error("useConfirmationState must be used within a ConfirmationProvider");
|
|
513
520
|
}
|
|
514
521
|
return { confirmation: context.confirmation, respond: context.respond };
|
|
515
522
|
}
|
|
516
523
|
function useConfirmationContext() {
|
|
517
|
-
const context = (0,
|
|
524
|
+
const context = (0, import_react3.useContext)(ConfirmationContext);
|
|
518
525
|
if (!context) {
|
|
519
526
|
throw new Error("useConfirmationContext must be used within a ConfirmationProvider");
|
|
520
527
|
}
|
|
@@ -522,7 +529,7 @@ function useConfirmationContext() {
|
|
|
522
529
|
}
|
|
523
530
|
|
|
524
531
|
// src/handlers/error.handler.ts
|
|
525
|
-
var
|
|
532
|
+
var import_react4 = require("react");
|
|
526
533
|
var DEFAULT_ERROR_MESSAGES = {
|
|
527
534
|
400: "AbpUi::DefaultErrorMessage400",
|
|
528
535
|
401: "AbpUi::DefaultErrorMessage401",
|
|
@@ -534,22 +541,22 @@ var DEFAULT_ERROR_MESSAGES = {
|
|
|
534
541
|
function useErrorHandler(options = {}) {
|
|
535
542
|
const { navigate, loginPath = "/account/login" } = options;
|
|
536
543
|
const confirmation = useConfirmation();
|
|
537
|
-
const [errorComponentProps, setErrorComponentProps] = (0,
|
|
538
|
-
const navigateToLogin = (0,
|
|
544
|
+
const [errorComponentProps, setErrorComponentProps] = (0, import_react4.useState)(null);
|
|
545
|
+
const navigateToLogin = (0, import_react4.useCallback)(() => {
|
|
539
546
|
if (navigate) {
|
|
540
547
|
navigate(loginPath);
|
|
541
548
|
}
|
|
542
549
|
}, [navigate, loginPath]);
|
|
543
|
-
const showError = (0,
|
|
550
|
+
const showError = (0, import_react4.useCallback)(
|
|
544
551
|
async (message, title) => {
|
|
545
552
|
return confirmation.error(message, title || "AbpUi::Error");
|
|
546
553
|
},
|
|
547
554
|
[confirmation]
|
|
548
555
|
);
|
|
549
|
-
const clearErrorComponent = (0,
|
|
556
|
+
const clearErrorComponent = (0, import_react4.useCallback)(() => {
|
|
550
557
|
setErrorComponentProps(null);
|
|
551
558
|
}, []);
|
|
552
|
-
const createErrorComponent = (0,
|
|
559
|
+
const createErrorComponent = (0, import_react4.useCallback)(
|
|
553
560
|
(instance) => {
|
|
554
561
|
const props = {
|
|
555
562
|
title: instance.title || "Error",
|
|
@@ -562,7 +569,7 @@ function useErrorHandler(options = {}) {
|
|
|
562
569
|
},
|
|
563
570
|
[clearErrorComponent]
|
|
564
571
|
);
|
|
565
|
-
const handleError = (0,
|
|
572
|
+
const handleError = (0, import_react4.useCallback)(
|
|
566
573
|
async (error) => {
|
|
567
574
|
if (error.status === 401) {
|
|
568
575
|
navigateToLogin();
|
|
@@ -604,8 +611,8 @@ function isHttpErrorResponse(error) {
|
|
|
604
611
|
}
|
|
605
612
|
|
|
606
613
|
// src/components/toast/Toast.tsx
|
|
607
|
-
var
|
|
608
|
-
var
|
|
614
|
+
var import_react5 = require("react");
|
|
615
|
+
var import_react6 = require("@chakra-ui/react");
|
|
609
616
|
var import_core = require("@abpjs/core");
|
|
610
617
|
var import_lucide_react = require("lucide-react");
|
|
611
618
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
@@ -712,7 +719,7 @@ function getPlacement(position) {
|
|
|
712
719
|
var toasterCache = /* @__PURE__ */ new Map();
|
|
713
720
|
function getToaster(placement) {
|
|
714
721
|
if (!toasterCache.has(placement)) {
|
|
715
|
-
toasterCache.set(placement, (0,
|
|
722
|
+
toasterCache.set(placement, (0, import_react6.createToaster)({
|
|
716
723
|
placement,
|
|
717
724
|
pauseOnPageIdle: true
|
|
718
725
|
}));
|
|
@@ -722,14 +729,14 @@ function getToaster(placement) {
|
|
|
722
729
|
function ToastContainer({ position = "bottom-right", containerKey }) {
|
|
723
730
|
const { toasts, service } = useToasterContext();
|
|
724
731
|
const { t } = (0, import_core.useLocalization)();
|
|
725
|
-
const displayedToastsRef = (0,
|
|
726
|
-
const placement = (0,
|
|
727
|
-
const toaster = (0,
|
|
728
|
-
const filteredToasts = (0,
|
|
732
|
+
const displayedToastsRef = (0, import_react5.useRef)(/* @__PURE__ */ new Set());
|
|
733
|
+
const placement = (0, import_react5.useMemo)(() => getPlacement(position), [position]);
|
|
734
|
+
const toaster = (0, import_react5.useMemo)(() => getToaster(placement), [placement]);
|
|
735
|
+
const filteredToasts = (0, import_react5.useMemo)(() => {
|
|
729
736
|
if (!containerKey) return toasts;
|
|
730
737
|
return toasts.filter((toast) => toast.options?.containerKey === containerKey);
|
|
731
738
|
}, [toasts, containerKey]);
|
|
732
|
-
(0,
|
|
739
|
+
(0, import_react5.useEffect)(() => {
|
|
733
740
|
const newToasts = filteredToasts.filter((toast) => !displayedToastsRef.current.has(toast.id));
|
|
734
741
|
newToasts.forEach((toast) => {
|
|
735
742
|
displayedToastsRef.current.add(toast.id);
|
|
@@ -762,11 +769,11 @@ function ToastContainer({ position = "bottom-right", containerKey }) {
|
|
|
762
769
|
});
|
|
763
770
|
});
|
|
764
771
|
}, [filteredToasts, t, service, toaster]);
|
|
765
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react6.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react6.Toaster, { toaster, insetInline: { mdDown: "4" }, children: (toast) => {
|
|
766
773
|
const severity = toast.meta?.severity || "info";
|
|
767
774
|
const closable = toast.meta?.closable !== false;
|
|
768
775
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
769
|
-
|
|
776
|
+
import_react6.Toast.Root,
|
|
770
777
|
{
|
|
771
778
|
bg: getSeverityBg(severity),
|
|
772
779
|
borderWidth: "1px",
|
|
@@ -774,13 +781,13 @@ function ToastContainer({ position = "bottom-right", containerKey }) {
|
|
|
774
781
|
borderRadius: "lg",
|
|
775
782
|
boxShadow: "lg",
|
|
776
783
|
width: { md: "sm" },
|
|
777
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
778
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
779
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
780
|
-
toast.title && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
781
|
-
toast.description && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
784
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react6.Flex, { align: "flex-start", gap: 3, p: 4, children: [
|
|
785
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react6.Box, { flexShrink: 0, pt: "2px", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SeverityIcon, { severity }) }),
|
|
786
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react6.Stack, { gap: 1, flex: 1, children: [
|
|
787
|
+
toast.title && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react6.Toast.Title, { fontWeight: "bold", fontSize: "sm", color: "fg", children: toast.title }),
|
|
788
|
+
toast.description && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react6.Toast.Description, { fontSize: "sm", color: "gray.700", children: toast.description })
|
|
782
789
|
] }),
|
|
783
|
-
closable && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
790
|
+
closable && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react6.Toast.CloseTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react6.CloseButton, { size: "sm" }) })
|
|
784
791
|
] })
|
|
785
792
|
}
|
|
786
793
|
);
|
|
@@ -788,8 +795,8 @@ function ToastContainer({ position = "bottom-right", containerKey }) {
|
|
|
788
795
|
}
|
|
789
796
|
|
|
790
797
|
// src/components/confirmation/Confirmation.tsx
|
|
791
|
-
var
|
|
792
|
-
var
|
|
798
|
+
var import_react7 = require("react");
|
|
799
|
+
var import_react8 = require("@chakra-ui/react");
|
|
793
800
|
var import_core2 = require("@abpjs/core");
|
|
794
801
|
var import_lucide_react2 = require("lucide-react");
|
|
795
802
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -837,7 +844,7 @@ function getSeverityColorPalette2(severity) {
|
|
|
837
844
|
function ConfirmationDialog({ className }) {
|
|
838
845
|
const { confirmation, respond } = useConfirmationState();
|
|
839
846
|
const { t } = (0, import_core2.useLocalization)();
|
|
840
|
-
const cancelRef = (0,
|
|
847
|
+
const cancelRef = (0, import_react7.useRef)(null);
|
|
841
848
|
if (!confirmation) {
|
|
842
849
|
return null;
|
|
843
850
|
}
|
|
@@ -868,24 +875,24 @@ function ConfirmationDialog({ className }) {
|
|
|
868
875
|
}
|
|
869
876
|
};
|
|
870
877
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
871
|
-
|
|
878
|
+
import_react8.Dialog.Root,
|
|
872
879
|
{
|
|
873
880
|
open: true,
|
|
874
881
|
onOpenChange: handleOpenChange,
|
|
875
882
|
role: "alertdialog",
|
|
876
883
|
placement: "center",
|
|
877
884
|
initialFocusEl: () => cancelRef.current,
|
|
878
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
879
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
880
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
881
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
885
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react8.Portal, { children: [
|
|
886
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react8.Dialog.Backdrop, {}),
|
|
887
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react8.Dialog.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react8.Dialog.Content, { className, maxWidth: "md", children: [
|
|
888
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react8.Dialog.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react8.Flex, { align: "center", gap: 3, children: [
|
|
882
889
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SeverityIcon2, { severity }),
|
|
883
|
-
localizedTitle && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
890
|
+
localizedTitle && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react8.Dialog.Title, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react8.Text, { fontWeight: "bold", fontSize: "lg", children: localizedTitle }) })
|
|
884
891
|
] }) }),
|
|
885
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
886
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
892
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react8.Dialog.Body, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react8.Text, { color: "gray.600", children: localizedMessage }) }),
|
|
893
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react8.Dialog.Footer, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react8.Flex, { gap: 3, children: [
|
|
887
894
|
!options?.hideCancelBtn && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
888
|
-
|
|
895
|
+
import_react8.Button,
|
|
889
896
|
{
|
|
890
897
|
ref: cancelRef,
|
|
891
898
|
variant: "ghost",
|
|
@@ -894,7 +901,7 @@ function ConfirmationDialog({ className }) {
|
|
|
894
901
|
}
|
|
895
902
|
),
|
|
896
903
|
!options?.hideYesBtn && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
897
|
-
|
|
904
|
+
import_react8.Button,
|
|
898
905
|
{
|
|
899
906
|
colorPalette: getSeverityColorPalette2(severity),
|
|
900
907
|
onClick: handleConfirm,
|
|
@@ -909,7 +916,7 @@ function ConfirmationDialog({ className }) {
|
|
|
909
916
|
}
|
|
910
917
|
|
|
911
918
|
// src/components/errors/ErrorComponent.tsx
|
|
912
|
-
var
|
|
919
|
+
var import_react9 = require("@chakra-ui/react");
|
|
913
920
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
914
921
|
function ErrorComponent({
|
|
915
922
|
title = "Error",
|
|
@@ -918,9 +925,9 @@ function ErrorComponent({
|
|
|
918
925
|
showCloseButton = true,
|
|
919
926
|
closeButtonText = "Go Back"
|
|
920
927
|
}) {
|
|
921
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react9.Container, { maxW: "container.md", py: 20, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react9.VStack, { gap: 6, textAlign: "center", children: [
|
|
922
929
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
923
|
-
|
|
930
|
+
import_react9.Heading,
|
|
924
931
|
{
|
|
925
932
|
size: "4xl",
|
|
926
933
|
color: "red.500",
|
|
@@ -928,9 +935,9 @@ function ErrorComponent({
|
|
|
928
935
|
children: title
|
|
929
936
|
}
|
|
930
937
|
),
|
|
931
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
938
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react9.Text, { fontSize: "lg", color: "gray.600", children: details }),
|
|
932
939
|
showCloseButton && onDestroy && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
933
|
-
|
|
940
|
+
import_react9.Button,
|
|
934
941
|
{
|
|
935
942
|
colorPalette: "blue",
|
|
936
943
|
size: "lg",
|
|
@@ -942,7 +949,7 @@ function ErrorComponent({
|
|
|
942
949
|
}
|
|
943
950
|
|
|
944
951
|
// src/components/loader-bar/LoaderBar.tsx
|
|
945
|
-
var
|
|
952
|
+
var import_react10 = require("react");
|
|
946
953
|
var import_core3 = require("@abpjs/core");
|
|
947
954
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
948
955
|
function LoaderBar({
|
|
@@ -953,17 +960,17 @@ function LoaderBar({
|
|
|
953
960
|
stopDelay = 400
|
|
954
961
|
}) {
|
|
955
962
|
const { loading } = (0, import_core3.useLoader)();
|
|
956
|
-
const [isLoading, setIsLoading] = (0,
|
|
957
|
-
const [progressLevel, setProgressLevel] = (0,
|
|
958
|
-
const intervalRef = (0,
|
|
959
|
-
(0,
|
|
963
|
+
const [isLoading, setIsLoading] = (0, import_react10.useState)(false);
|
|
964
|
+
const [progressLevel, setProgressLevel] = (0, import_react10.useState)(0);
|
|
965
|
+
const intervalRef = (0, import_react10.useRef)(null);
|
|
966
|
+
(0, import_react10.useEffect)(() => {
|
|
960
967
|
if (loading) {
|
|
961
968
|
startLoading();
|
|
962
969
|
} else {
|
|
963
970
|
stopLoading();
|
|
964
971
|
}
|
|
965
972
|
}, [loading]);
|
|
966
|
-
(0,
|
|
973
|
+
(0, import_react10.useEffect)(() => {
|
|
967
974
|
return () => {
|
|
968
975
|
if (intervalRef.current) {
|
|
969
976
|
clearInterval(intervalRef.current);
|
|
@@ -1034,8 +1041,8 @@ function LoaderBar({
|
|
|
1034
1041
|
}
|
|
1035
1042
|
|
|
1036
1043
|
// src/components/modal/Modal.tsx
|
|
1037
|
-
var
|
|
1038
|
-
var
|
|
1044
|
+
var import_react11 = __toESM(require("react"));
|
|
1045
|
+
var import_react12 = require("@chakra-ui/react");
|
|
1039
1046
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1040
1047
|
function getSizeWidth(size) {
|
|
1041
1048
|
switch (size) {
|
|
@@ -1074,12 +1081,12 @@ function Modal({
|
|
|
1074
1081
|
preventScroll = true,
|
|
1075
1082
|
onInit
|
|
1076
1083
|
}) {
|
|
1077
|
-
const prevVisibleRef =
|
|
1078
|
-
const onInitRef =
|
|
1079
|
-
|
|
1084
|
+
const prevVisibleRef = import_react11.default.useRef(false);
|
|
1085
|
+
const onInitRef = import_react11.default.useRef(onInit);
|
|
1086
|
+
import_react11.default.useEffect(() => {
|
|
1080
1087
|
onInitRef.current = onInit;
|
|
1081
1088
|
}, [onInit]);
|
|
1082
|
-
|
|
1089
|
+
import_react11.default.useEffect(() => {
|
|
1083
1090
|
if (visible && !prevVisibleRef.current && onInitRef.current) {
|
|
1084
1091
|
onInitRef.current();
|
|
1085
1092
|
}
|
|
@@ -1092,7 +1099,7 @@ function Modal({
|
|
|
1092
1099
|
onVisibleChange?.(details.open);
|
|
1093
1100
|
};
|
|
1094
1101
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1095
|
-
|
|
1102
|
+
import_react12.Dialog.Root,
|
|
1096
1103
|
{
|
|
1097
1104
|
open: visible,
|
|
1098
1105
|
onOpenChange: handleOpenChange,
|
|
@@ -1103,10 +1110,10 @@ function Modal({
|
|
|
1103
1110
|
motionPreset,
|
|
1104
1111
|
trapFocus,
|
|
1105
1112
|
preventScroll,
|
|
1106
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1107
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1108
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1109
|
-
|
|
1113
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_react12.Portal, { children: [
|
|
1114
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react12.Dialog.Backdrop, {}),
|
|
1115
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react12.Dialog.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1116
|
+
import_react12.Dialog.Content,
|
|
1110
1117
|
{
|
|
1111
1118
|
className: modalClass,
|
|
1112
1119
|
width: getSizeWidth(size),
|
|
@@ -1116,16 +1123,16 @@ function Modal({
|
|
|
1116
1123
|
minHeight,
|
|
1117
1124
|
children: [
|
|
1118
1125
|
(header || showCloseButton) && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
1119
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1120
|
-
header && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1121
|
-
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1126
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react12.Dialog.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_react12.Flex, { justify: "space-between", align: "center", width: "100%", children: [
|
|
1127
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react12.Dialog.Title, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react12.Text, { fontWeight: "bold", fontSize: "lg", children: header }) }),
|
|
1128
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react12.Dialog.CloseTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react12.CloseButton, { size: "sm" }) })
|
|
1122
1129
|
] }) }),
|
|
1123
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1130
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react12.Separator, {})
|
|
1124
1131
|
] }),
|
|
1125
|
-
children && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1132
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react12.Dialog.Body, { py: 4, children }),
|
|
1126
1133
|
footer && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
1127
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1128
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1134
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react12.Separator, {}),
|
|
1135
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react12.Dialog.Footer, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react12.Flex, { gap: 3, justify: "flex-end", w: "100%", children: footer }) })
|
|
1129
1136
|
] })
|
|
1130
1137
|
]
|
|
1131
1138
|
}
|
|
@@ -1135,17 +1142,17 @@ function Modal({
|
|
|
1135
1142
|
);
|
|
1136
1143
|
}
|
|
1137
1144
|
function AbpModalHeader({ children, className }) {
|
|
1138
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react12.Text, { fontWeight: "bold", fontSize: "lg", className, children });
|
|
1139
1146
|
}
|
|
1140
1147
|
function AbpModalBody({ children, className }) {
|
|
1141
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react12.Box, { color: "gray.600", className, children });
|
|
1142
1149
|
}
|
|
1143
1150
|
function AbpModalFooter({ children, className }) {
|
|
1144
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react12.Flex, { gap: 3, justify: "flex-end", className, children });
|
|
1145
1152
|
}
|
|
1146
1153
|
|
|
1147
1154
|
// src/components/ui/Alert.tsx
|
|
1148
|
-
var
|
|
1155
|
+
var import_react13 = require("@chakra-ui/react");
|
|
1149
1156
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1150
1157
|
function Alert({
|
|
1151
1158
|
status = "info",
|
|
@@ -1158,28 +1165,28 @@ function Alert({
|
|
|
1158
1165
|
borderRadius = "md"
|
|
1159
1166
|
}) {
|
|
1160
1167
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1161
|
-
|
|
1168
|
+
import_react13.Alert.Root,
|
|
1162
1169
|
{
|
|
1163
1170
|
status,
|
|
1164
1171
|
className,
|
|
1165
1172
|
mb,
|
|
1166
1173
|
borderRadius,
|
|
1167
1174
|
children: [
|
|
1168
|
-
showIcon && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1175
|
+
showIcon && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react13.Alert.Indicator, {}),
|
|
1169
1176
|
title ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1170
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1171
|
-
(description || children) && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1172
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1177
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react13.Alert.Title, { children: title }),
|
|
1178
|
+
(description || children) && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react13.Alert.Description, { children: description || children })
|
|
1179
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react13.Alert.Title, { children })
|
|
1173
1180
|
]
|
|
1174
1181
|
}
|
|
1175
1182
|
);
|
|
1176
1183
|
}
|
|
1177
1184
|
|
|
1178
1185
|
// src/components/ui/Button.tsx
|
|
1179
|
-
var
|
|
1180
|
-
var
|
|
1186
|
+
var import_react14 = require("react");
|
|
1187
|
+
var import_react15 = require("@chakra-ui/react");
|
|
1181
1188
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1182
|
-
var Button3 = (0,
|
|
1189
|
+
var Button3 = (0, import_react14.forwardRef)(
|
|
1183
1190
|
function Button4({
|
|
1184
1191
|
children,
|
|
1185
1192
|
type = "button",
|
|
@@ -1196,7 +1203,7 @@ var Button3 = (0, import_react13.forwardRef)(
|
|
|
1196
1203
|
ml
|
|
1197
1204
|
}, ref) {
|
|
1198
1205
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1199
|
-
|
|
1206
|
+
import_react15.Button,
|
|
1200
1207
|
{
|
|
1201
1208
|
ref,
|
|
1202
1209
|
type,
|
|
@@ -1218,10 +1225,10 @@ var Button3 = (0, import_react13.forwardRef)(
|
|
|
1218
1225
|
);
|
|
1219
1226
|
|
|
1220
1227
|
// src/components/ui/Checkbox.tsx
|
|
1221
|
-
var
|
|
1222
|
-
var
|
|
1228
|
+
var import_react16 = require("react");
|
|
1229
|
+
var import_react17 = require("@chakra-ui/react");
|
|
1223
1230
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1224
|
-
var Checkbox = (0,
|
|
1231
|
+
var Checkbox = (0, import_react16.forwardRef)(
|
|
1225
1232
|
function Checkbox2({
|
|
1226
1233
|
children,
|
|
1227
1234
|
checked,
|
|
@@ -1239,7 +1246,7 @@ var Checkbox = (0, import_react15.forwardRef)(
|
|
|
1239
1246
|
className
|
|
1240
1247
|
}, ref) {
|
|
1241
1248
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1242
|
-
|
|
1249
|
+
import_react17.Checkbox.Root,
|
|
1243
1250
|
{
|
|
1244
1251
|
checked,
|
|
1245
1252
|
defaultChecked,
|
|
@@ -1252,7 +1259,7 @@ var Checkbox = (0, import_react15.forwardRef)(
|
|
|
1252
1259
|
className,
|
|
1253
1260
|
children: [
|
|
1254
1261
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1255
|
-
|
|
1262
|
+
import_react17.Checkbox.HiddenInput,
|
|
1256
1263
|
{
|
|
1257
1264
|
ref,
|
|
1258
1265
|
id,
|
|
@@ -1261,8 +1268,8 @@ var Checkbox = (0, import_react15.forwardRef)(
|
|
|
1261
1268
|
onChange
|
|
1262
1269
|
}
|
|
1263
1270
|
),
|
|
1264
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1265
|
-
children && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1271
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react17.Checkbox.Control, {}),
|
|
1272
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react17.Checkbox.Label, { children })
|
|
1266
1273
|
]
|
|
1267
1274
|
}
|
|
1268
1275
|
);
|
|
@@ -1270,7 +1277,7 @@ var Checkbox = (0, import_react15.forwardRef)(
|
|
|
1270
1277
|
);
|
|
1271
1278
|
|
|
1272
1279
|
// src/components/ui/FormField.tsx
|
|
1273
|
-
var
|
|
1280
|
+
var import_react18 = require("@chakra-ui/react");
|
|
1274
1281
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1275
1282
|
function FormField({
|
|
1276
1283
|
label,
|
|
@@ -1283,20 +1290,20 @@ function FormField({
|
|
|
1283
1290
|
htmlFor,
|
|
1284
1291
|
className
|
|
1285
1292
|
}) {
|
|
1286
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1287
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react18.Field.Root, { invalid, disabled, className, children: [
|
|
1294
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react18.Field.Label, { htmlFor, children: [
|
|
1288
1295
|
label,
|
|
1289
|
-
required && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1296
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react18.Field.RequiredIndicator, {})
|
|
1290
1297
|
] }),
|
|
1291
1298
|
children,
|
|
1292
|
-
helperText && !invalid && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1293
|
-
invalid && errorText && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1299
|
+
helperText && !invalid && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react18.Field.HelperText, { children: helperText }),
|
|
1300
|
+
invalid && errorText && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react18.Field.ErrorText, { children: errorText })
|
|
1294
1301
|
] });
|
|
1295
1302
|
}
|
|
1296
1303
|
|
|
1297
1304
|
// src/components/change-password/ChangePassword.tsx
|
|
1298
|
-
var
|
|
1299
|
-
var
|
|
1305
|
+
var import_react19 = require("react");
|
|
1306
|
+
var import_react20 = require("@chakra-ui/react");
|
|
1300
1307
|
var import_react_hook_form = require("react-hook-form");
|
|
1301
1308
|
var import_core4 = require("@abpjs/core");
|
|
1302
1309
|
var import_lucide_react3 = require("lucide-react");
|
|
@@ -1322,7 +1329,7 @@ function ChangePassword({
|
|
|
1322
1329
|
}
|
|
1323
1330
|
});
|
|
1324
1331
|
const newPassword = watch("newPassword");
|
|
1325
|
-
(0,
|
|
1332
|
+
(0, import_react19.useEffect)(() => {
|
|
1326
1333
|
if (visible) {
|
|
1327
1334
|
reset();
|
|
1328
1335
|
}
|
|
@@ -1364,9 +1371,9 @@ function ChangePassword({
|
|
|
1364
1371
|
}
|
|
1365
1372
|
};
|
|
1366
1373
|
const modalFooter = /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1367
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1374
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react20.Button, { variant: "ghost", mr: 3, onClick: handleClose, disabled: isSubmitting, children: t("AbpIdentity::Cancel") || "Cancel" }),
|
|
1368
1375
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1369
|
-
|
|
1376
|
+
import_react20.Button,
|
|
1370
1377
|
{
|
|
1371
1378
|
colorPalette: "blue",
|
|
1372
1379
|
type: "submit",
|
|
@@ -1388,14 +1395,14 @@ function ChangePassword({
|
|
|
1388
1395
|
header: t("AbpIdentity::ChangePassword") || "Change Password",
|
|
1389
1396
|
footer: modalFooter,
|
|
1390
1397
|
centered: true,
|
|
1391
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("form", { id: "change-password-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1392
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1393
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1398
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("form", { id: "change-password-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react20.VStack, { gap: 4, children: [
|
|
1399
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react20.Field.Root, { invalid: !!errors.password, children: [
|
|
1400
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react20.Field.Label, { children: [
|
|
1394
1401
|
t("AbpIdentity::DisplayName:CurrentPassword") || "Current Password",
|
|
1395
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1402
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react20.Field.RequiredIndicator, {})
|
|
1396
1403
|
] }),
|
|
1397
1404
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1398
|
-
|
|
1405
|
+
import_react20.Input,
|
|
1399
1406
|
{
|
|
1400
1407
|
type: "password",
|
|
1401
1408
|
...register("password", {
|
|
@@ -1403,29 +1410,29 @@ function ChangePassword({
|
|
|
1403
1410
|
})
|
|
1404
1411
|
}
|
|
1405
1412
|
),
|
|
1406
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1413
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react20.Field.ErrorText, { children: errors.password?.message })
|
|
1407
1414
|
] }),
|
|
1408
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1409
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1415
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react20.Field.Root, { invalid: !!errors.newPassword, children: [
|
|
1416
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react20.Field.Label, { children: [
|
|
1410
1417
|
t("AbpIdentity::DisplayName:NewPassword") || "New Password",
|
|
1411
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1418
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react20.Field.RequiredIndicator, {})
|
|
1412
1419
|
] }),
|
|
1413
1420
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1414
|
-
|
|
1421
|
+
import_react20.Input,
|
|
1415
1422
|
{
|
|
1416
1423
|
type: "password",
|
|
1417
1424
|
...register("newPassword", passwordValidation)
|
|
1418
1425
|
}
|
|
1419
1426
|
),
|
|
1420
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1427
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react20.Field.ErrorText, { children: errors.newPassword?.message })
|
|
1421
1428
|
] }),
|
|
1422
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1423
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1429
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react20.Field.Root, { invalid: !!errors.repeatNewPassword, children: [
|
|
1430
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react20.Field.Label, { children: [
|
|
1424
1431
|
t("AbpIdentity::DisplayName:NewPasswordConfirm") || "Confirm New Password",
|
|
1425
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1432
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react20.Field.RequiredIndicator, {})
|
|
1426
1433
|
] }),
|
|
1427
1434
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1428
|
-
|
|
1435
|
+
import_react20.Input,
|
|
1429
1436
|
{
|
|
1430
1437
|
type: "password",
|
|
1431
1438
|
...register("repeatNewPassword", {
|
|
@@ -1434,7 +1441,7 @@ function ChangePassword({
|
|
|
1434
1441
|
})
|
|
1435
1442
|
}
|
|
1436
1443
|
),
|
|
1437
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1444
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react20.Field.ErrorText, { children: errors.repeatNewPassword?.message })
|
|
1438
1445
|
] })
|
|
1439
1446
|
] }) })
|
|
1440
1447
|
}
|
|
@@ -1442,8 +1449,8 @@ function ChangePassword({
|
|
|
1442
1449
|
}
|
|
1443
1450
|
|
|
1444
1451
|
// src/components/profile/Profile.tsx
|
|
1445
|
-
var
|
|
1446
|
-
var
|
|
1452
|
+
var import_react21 = require("react");
|
|
1453
|
+
var import_react22 = require("@chakra-ui/react");
|
|
1447
1454
|
var import_react_hook_form2 = require("react-hook-form");
|
|
1448
1455
|
var import_core5 = require("@abpjs/core");
|
|
1449
1456
|
var import_lucide_react4 = require("lucide-react");
|
|
@@ -1470,13 +1477,13 @@ function Profile({
|
|
|
1470
1477
|
}
|
|
1471
1478
|
});
|
|
1472
1479
|
const modalBusy = isSubmitting || loading;
|
|
1473
|
-
(0,
|
|
1480
|
+
(0, import_react21.useEffect)(() => {
|
|
1474
1481
|
if (visible) {
|
|
1475
1482
|
fetchProfile().then(() => {
|
|
1476
1483
|
});
|
|
1477
1484
|
}
|
|
1478
1485
|
}, [visible, fetchProfile]);
|
|
1479
|
-
(0,
|
|
1486
|
+
(0, import_react21.useEffect)(() => {
|
|
1480
1487
|
if (profile) {
|
|
1481
1488
|
reset({
|
|
1482
1489
|
userName: profile.userName || "",
|
|
@@ -1508,9 +1515,9 @@ function Profile({
|
|
|
1508
1515
|
}
|
|
1509
1516
|
};
|
|
1510
1517
|
const modalFooter = /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1511
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1518
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react22.Button, { variant: "ghost", mr: 3, onClick: handleClose, disabled: modalBusy, children: t("AbpIdentity::Cancel") || "Cancel" }),
|
|
1512
1519
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1513
|
-
|
|
1520
|
+
import_react22.Button,
|
|
1514
1521
|
{
|
|
1515
1522
|
colorPalette: "blue",
|
|
1516
1523
|
type: "submit",
|
|
@@ -1533,14 +1540,14 @@ function Profile({
|
|
|
1533
1540
|
footer: modalFooter,
|
|
1534
1541
|
size: "lg",
|
|
1535
1542
|
centered: true,
|
|
1536
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("form", { id: "profile-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1537
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1538
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1543
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("form", { id: "profile-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react22.VStack, { gap: 4, children: [
|
|
1544
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react22.Field.Root, { invalid: !!errors.userName, children: [
|
|
1545
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react22.Field.Label, { children: [
|
|
1539
1546
|
t("AbpIdentity::DisplayName:UserName") || "Username",
|
|
1540
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1547
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react22.Field.RequiredIndicator, {})
|
|
1541
1548
|
] }),
|
|
1542
1549
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1543
|
-
|
|
1550
|
+
import_react22.Input,
|
|
1544
1551
|
{
|
|
1545
1552
|
type: "text",
|
|
1546
1553
|
...register("userName", {
|
|
@@ -1552,13 +1559,13 @@ function Profile({
|
|
|
1552
1559
|
})
|
|
1553
1560
|
}
|
|
1554
1561
|
),
|
|
1555
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1562
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react22.Field.ErrorText, { children: errors.userName?.message })
|
|
1556
1563
|
] }),
|
|
1557
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1558
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1559
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1564
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react22.HStack, { gap: 4, w: "full", children: [
|
|
1565
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react22.Field.Root, { invalid: !!errors.name, flex: 1, children: [
|
|
1566
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react22.Field.Label, { children: t("AbpIdentity::DisplayName:Name") || "Name" }),
|
|
1560
1567
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1561
|
-
|
|
1568
|
+
import_react22.Input,
|
|
1562
1569
|
{
|
|
1563
1570
|
type: "text",
|
|
1564
1571
|
...register("name", {
|
|
@@ -1569,12 +1576,12 @@ function Profile({
|
|
|
1569
1576
|
})
|
|
1570
1577
|
}
|
|
1571
1578
|
),
|
|
1572
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1579
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react22.Field.ErrorText, { children: errors.name?.message })
|
|
1573
1580
|
] }),
|
|
1574
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1575
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1581
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react22.Field.Root, { invalid: !!errors.surname, flex: 1, children: [
|
|
1582
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react22.Field.Label, { children: t("AbpIdentity::DisplayName:Surname") || "Surname" }),
|
|
1576
1583
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1577
|
-
|
|
1584
|
+
import_react22.Input,
|
|
1578
1585
|
{
|
|
1579
1586
|
type: "text",
|
|
1580
1587
|
...register("surname", {
|
|
@@ -1585,16 +1592,16 @@ function Profile({
|
|
|
1585
1592
|
})
|
|
1586
1593
|
}
|
|
1587
1594
|
),
|
|
1588
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1595
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react22.Field.ErrorText, { children: errors.surname?.message })
|
|
1589
1596
|
] })
|
|
1590
1597
|
] }),
|
|
1591
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1592
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1598
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react22.Field.Root, { invalid: !!errors.email, children: [
|
|
1599
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react22.Field.Label, { children: [
|
|
1593
1600
|
t("AbpIdentity::DisplayName:EmailAddress") || "Email Address",
|
|
1594
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1601
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react22.Field.RequiredIndicator, {})
|
|
1595
1602
|
] }),
|
|
1596
1603
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1597
|
-
|
|
1604
|
+
import_react22.Input,
|
|
1598
1605
|
{
|
|
1599
1606
|
type: "email",
|
|
1600
1607
|
...register("email", {
|
|
@@ -1610,12 +1617,12 @@ function Profile({
|
|
|
1610
1617
|
})
|
|
1611
1618
|
}
|
|
1612
1619
|
),
|
|
1613
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1620
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react22.Field.ErrorText, { children: errors.email?.message })
|
|
1614
1621
|
] }),
|
|
1615
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1616
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1622
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react22.Field.Root, { invalid: !!errors.phoneNumber, children: [
|
|
1623
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react22.Field.Label, { children: t("AbpIdentity::DisplayName:PhoneNumber") || "Phone Number" }),
|
|
1617
1624
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1618
|
-
|
|
1625
|
+
import_react22.Input,
|
|
1619
1626
|
{
|
|
1620
1627
|
type: "tel",
|
|
1621
1628
|
...register("phoneNumber", {
|
|
@@ -1626,7 +1633,7 @@ function Profile({
|
|
|
1626
1633
|
})
|
|
1627
1634
|
}
|
|
1628
1635
|
),
|
|
1629
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1636
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react22.Field.ErrorText, { children: errors.phoneNumber?.message })
|
|
1630
1637
|
] })
|
|
1631
1638
|
] }) })
|
|
1632
1639
|
}
|
|
@@ -1634,10 +1641,10 @@ function Profile({
|
|
|
1634
1641
|
}
|
|
1635
1642
|
|
|
1636
1643
|
// src/providers/ThemeSharedProvider.tsx
|
|
1637
|
-
var
|
|
1644
|
+
var import_react25 = require("@chakra-ui/react");
|
|
1638
1645
|
|
|
1639
1646
|
// src/theme/index.ts
|
|
1640
|
-
var
|
|
1647
|
+
var import_react23 = require("@chakra-ui/react");
|
|
1641
1648
|
var colors = {
|
|
1642
1649
|
brand: {
|
|
1643
1650
|
50: { value: "#e3f2fd" },
|
|
@@ -1840,7 +1847,7 @@ var semanticTokens = {
|
|
|
1840
1847
|
// },
|
|
1841
1848
|
// },
|
|
1842
1849
|
};
|
|
1843
|
-
var defaultAbpConfig = (0,
|
|
1850
|
+
var defaultAbpConfig = (0, import_react23.defineConfig)({
|
|
1844
1851
|
theme: {
|
|
1845
1852
|
tokens: {
|
|
1846
1853
|
colors,
|
|
@@ -1862,14 +1869,14 @@ var defaultAbpConfig = (0, import_react22.defineConfig)({
|
|
|
1862
1869
|
});
|
|
1863
1870
|
function createAbpSystem(overrides) {
|
|
1864
1871
|
if (overrides) {
|
|
1865
|
-
return (0,
|
|
1872
|
+
return (0, import_react23.createSystem)(import_react23.defaultConfig, defaultAbpConfig, overrides);
|
|
1866
1873
|
}
|
|
1867
|
-
return (0,
|
|
1874
|
+
return (0, import_react23.createSystem)(import_react23.defaultConfig, defaultAbpConfig);
|
|
1868
1875
|
}
|
|
1869
1876
|
var abpSystem = createAbpSystem();
|
|
1870
1877
|
|
|
1871
1878
|
// src/components/ui/color-mode.tsx
|
|
1872
|
-
var
|
|
1879
|
+
var import_react24 = require("@chakra-ui/react");
|
|
1873
1880
|
var import_next_themes = require("next-themes");
|
|
1874
1881
|
var React11 = __toESM(require("react"));
|
|
1875
1882
|
var import_lucide_react5 = require("lucide-react");
|
|
@@ -1895,8 +1902,8 @@ function ColorModeIcon() {
|
|
|
1895
1902
|
}
|
|
1896
1903
|
var ColorModeButton = React11.forwardRef(function ColorModeButton2(props, ref) {
|
|
1897
1904
|
const { toggleColorMode } = useColorMode();
|
|
1898
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1899
|
-
|
|
1905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react24.ClientOnly, { fallback: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react24.Skeleton, { boxSize: "9" }), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1906
|
+
import_react24.IconButton,
|
|
1900
1907
|
{
|
|
1901
1908
|
onClick: toggleColorMode,
|
|
1902
1909
|
variant: "ghost",
|
|
@@ -1917,7 +1924,7 @@ var ColorModeButton = React11.forwardRef(function ColorModeButton2(props, ref) {
|
|
|
1917
1924
|
var LightMode = React11.forwardRef(
|
|
1918
1925
|
function LightMode2(props, ref) {
|
|
1919
1926
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1920
|
-
|
|
1927
|
+
import_react24.Span,
|
|
1921
1928
|
{
|
|
1922
1929
|
color: "fg",
|
|
1923
1930
|
display: "contents",
|
|
@@ -1933,7 +1940,7 @@ var LightMode = React11.forwardRef(
|
|
|
1933
1940
|
var DarkMode = React11.forwardRef(
|
|
1934
1941
|
function DarkMode2(props, ref) {
|
|
1935
1942
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1936
|
-
|
|
1943
|
+
import_react24.Span,
|
|
1937
1944
|
{
|
|
1938
1945
|
color: "fg",
|
|
1939
1946
|
display: "contents",
|
|
@@ -1969,7 +1976,7 @@ function ThemeSharedProvider({
|
|
|
1969
1976
|
renderConfirmation && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ConfirmationDialog, {})
|
|
1970
1977
|
] }) });
|
|
1971
1978
|
const colorModeProps = enableColorMode ? { defaultTheme: defaultColorMode } : { forcedTheme: "light" };
|
|
1972
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react25.ChakraProvider, { value: system, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react25.LocaleProvider, { locale, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ColorModeProvider, { ...colorModeProps, children: content }) }) });
|
|
1973
1980
|
}
|
|
1974
1981
|
|
|
1975
1982
|
// src/utils/styles.ts
|
|
@@ -2064,7 +2071,9 @@ function injectThemeSharedStyles() {
|
|
|
2064
2071
|
ModalFooter,
|
|
2065
2072
|
ModalHeader,
|
|
2066
2073
|
Profile,
|
|
2074
|
+
THEME_SHARED_APPEND_CONTENT,
|
|
2067
2075
|
THEME_SHARED_STYLES,
|
|
2076
|
+
ThemeSharedAppendContentContext,
|
|
2068
2077
|
ThemeSharedProvider,
|
|
2069
2078
|
ToastContainer,
|
|
2070
2079
|
Toaster,
|
package/dist/index.mjs
CHANGED
|
@@ -197,9 +197,14 @@ var DEFAULT_STYLES = `
|
|
|
197
197
|
}
|
|
198
198
|
`;
|
|
199
199
|
|
|
200
|
+
// src/constants/append-content.ts
|
|
201
|
+
import { createContext } from "react";
|
|
202
|
+
var ThemeSharedAppendContentContext = createContext(void 0);
|
|
203
|
+
var THEME_SHARED_APPEND_CONTENT = "THEME_SHARED_APPEND_CONTENT";
|
|
204
|
+
|
|
200
205
|
// src/contexts/toaster.context.tsx
|
|
201
206
|
import {
|
|
202
|
-
createContext,
|
|
207
|
+
createContext as createContext2,
|
|
203
208
|
useContext,
|
|
204
209
|
useCallback,
|
|
205
210
|
useState,
|
|
@@ -208,7 +213,7 @@ import {
|
|
|
208
213
|
useEffect
|
|
209
214
|
} from "react";
|
|
210
215
|
import { jsx } from "react/jsx-runtime";
|
|
211
|
-
var ToasterContext =
|
|
216
|
+
var ToasterContext = createContext2(null);
|
|
212
217
|
var toastCounter = 0;
|
|
213
218
|
function generateId() {
|
|
214
219
|
toastCounter += 1;
|
|
@@ -324,7 +329,7 @@ function useToasterContext() {
|
|
|
324
329
|
|
|
325
330
|
// src/contexts/confirmation.context.tsx
|
|
326
331
|
import {
|
|
327
|
-
createContext as
|
|
332
|
+
createContext as createContext3,
|
|
328
333
|
useContext as useContext2,
|
|
329
334
|
useCallback as useCallback2,
|
|
330
335
|
useState as useState2,
|
|
@@ -333,7 +338,7 @@ import {
|
|
|
333
338
|
useEffect as useEffect2
|
|
334
339
|
} from "react";
|
|
335
340
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
336
|
-
var ConfirmationContext =
|
|
341
|
+
var ConfirmationContext = createContext3(null);
|
|
337
342
|
function generateId2() {
|
|
338
343
|
return `confirmation-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
339
344
|
}
|
|
@@ -2049,7 +2054,9 @@ export {
|
|
|
2049
2054
|
AbpModalFooter as ModalFooter,
|
|
2050
2055
|
AbpModalHeader as ModalHeader,
|
|
2051
2056
|
Profile,
|
|
2057
|
+
THEME_SHARED_APPEND_CONTENT,
|
|
2052
2058
|
THEME_SHARED_STYLES,
|
|
2059
|
+
ThemeSharedAppendContentContext,
|
|
2053
2060
|
ThemeSharedProvider,
|
|
2054
2061
|
ToastContainer,
|
|
2055
2062
|
Toaster,
|
package/dist/models/toaster.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ export declare namespace Toaster {
|
|
|
55
55
|
type Severity = 'neutral' | 'success' | 'info' | 'warning' | 'error';
|
|
56
56
|
/**
|
|
57
57
|
* Status values for toast/confirmation interactions.
|
|
58
|
-
* @deprecated Status will be removed from toaster model in
|
|
58
|
+
* @deprecated Status will be removed from toaster model in v3.0. Use Confirmation.Status instead.
|
|
59
59
|
* @since 2.1.0 - Deprecated in favor of Confirmation.Status
|
|
60
60
|
*/
|
|
61
61
|
enum Status {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abpjs/theme-shared",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "ABP Framework Theme Shared components for React - translated from @abp/ng.theme.shared",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"next-themes": "^0.4.6",
|
|
28
28
|
"react-hook-form": "^7.48.0",
|
|
29
29
|
"react-icons": "^5.5.0",
|
|
30
|
-
"@abpjs/core": "2.
|
|
30
|
+
"@abpjs/core": "2.4.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@abp/ng.theme.shared": "2.
|
|
33
|
+
"@abp/ng.theme.shared": "2.4.0",
|
|
34
34
|
"@vitest/coverage-v8": "^3.2.0"
|
|
35
35
|
},
|
|
36
36
|
"author": "tekthar.com",
|