@abpjs/theme-shared 2.9.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/loader-bar/LoaderBar.d.ts +1 -1
- package/dist/enums/index.d.ts +5 -0
- package/dist/enums/route-names.d.ts +15 -0
- package/dist/handlers/error.handler.d.ts +3 -2
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-nav-items.d.ts +33 -0
- package/dist/index.d.ts +16 -1
- package/dist/index.js +369 -245
- package/dist/index.mjs +226 -102
- package/dist/models/confirmation.d.ts +3 -7
- package/dist/models/index.d.ts +7 -2
- package/dist/models/nav-item.d.ts +39 -0
- package/dist/models/toaster.d.ts +2 -44
- package/dist/providers/ThemeSharedProvider.d.ts +1 -1
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/route.provider.d.ts +53 -0
- package/dist/services/index.d.ts +5 -0
- package/dist/services/nav-items.service.d.ts +117 -0
- package/dist/utils/index.d.ts +4 -1
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ __export(index_exports, {
|
|
|
36
36
|
Alert: () => Alert,
|
|
37
37
|
BOOTSTRAP: () => BOOTSTRAP,
|
|
38
38
|
Button: () => Button3,
|
|
39
|
-
ChakraDialog: () =>
|
|
39
|
+
ChakraDialog: () => import_react16.Dialog,
|
|
40
40
|
ChangePassword: () => ChangePassword,
|
|
41
41
|
Checkbox: () => Checkbox,
|
|
42
42
|
Confirmation: () => Confirmation,
|
|
@@ -57,26 +57,26 @@ __export(index_exports, {
|
|
|
57
57
|
ModalFooter: () => AbpModalFooter,
|
|
58
58
|
ModalHeader: () => AbpModalHeader,
|
|
59
59
|
ModalProvider: () => ModalProvider,
|
|
60
|
+
NavItemsService: () => NavItemsService,
|
|
60
61
|
PASSWORD_SETTING_KEYS: () => PASSWORD_SETTING_KEYS,
|
|
61
62
|
Profile: () => Profile,
|
|
62
63
|
THEME_SHARED_APPEND_CONTENT: () => THEME_SHARED_APPEND_CONTENT,
|
|
64
|
+
THEME_SHARED_ROUTE_PROVIDERS: () => THEME_SHARED_ROUTE_PROVIDERS,
|
|
63
65
|
THEME_SHARED_STYLES: () => THEME_SHARED_STYLES,
|
|
64
66
|
ThemeSharedAppendContentContext: () => ThemeSharedAppendContentContext,
|
|
65
67
|
ThemeSharedProvider: () => ThemeSharedProvider,
|
|
66
68
|
ToastContainer: () => ToastContainer,
|
|
67
|
-
Toaster: () => Toaster,
|
|
68
69
|
ToasterProvider: () => ToasterProvider,
|
|
69
70
|
abpSystem: () => abpSystem,
|
|
70
|
-
|
|
71
|
-
clearNavItems: () => clearNavItems,
|
|
71
|
+
configureRoutes: () => configureRoutes,
|
|
72
72
|
createAbpSystem: () => createAbpSystem,
|
|
73
73
|
createErrorInterceptor: () => createErrorInterceptor,
|
|
74
74
|
createLazyStyleHref: () => createLazyStyleHref,
|
|
75
75
|
defaultAbpConfig: () => defaultAbpConfig,
|
|
76
|
-
defineConfig: () =>
|
|
76
|
+
defineConfig: () => import_react27.defineConfig,
|
|
77
|
+
eThemeSharedRouteNames: () => eThemeSharedRouteNames,
|
|
77
78
|
getLoadedBootstrapDirection: () => getLoadedBootstrapDirection,
|
|
78
|
-
|
|
79
|
-
getNavItemsSync: () => getNavItemsSync,
|
|
79
|
+
getNavItemsService: () => getNavItemsService,
|
|
80
80
|
getPasswordSettings: () => getPasswordSettings,
|
|
81
81
|
getPasswordValidationRules: () => getPasswordValidationRules,
|
|
82
82
|
getPasswordValidators: () => getPasswordValidators,
|
|
@@ -85,9 +85,8 @@ __export(index_exports, {
|
|
|
85
85
|
getSeverityColorScheme: () => getSeverityColorPalette,
|
|
86
86
|
httpErrorConfigFactory: () => httpErrorConfigFactory,
|
|
87
87
|
initLazyStyleHandler: () => initLazyStyleHandler,
|
|
88
|
+
initializeThemeSharedRoutes: () => initializeThemeSharedRoutes,
|
|
88
89
|
injectThemeSharedStyles: () => injectThemeSharedStyles,
|
|
89
|
-
removeNavItem: () => removeNavItem,
|
|
90
|
-
subscribeToNavItems: () => subscribeToNavItems,
|
|
91
90
|
useConfirmation: () => useConfirmation,
|
|
92
91
|
useConfirmationContext: () => useConfirmationContext,
|
|
93
92
|
useConfirmationState: () => useConfirmationState,
|
|
@@ -98,23 +97,13 @@ __export(index_exports, {
|
|
|
98
97
|
useModal: () => useModal,
|
|
99
98
|
useModalContext: () => useModalContext,
|
|
100
99
|
useModalState: () => useModalState,
|
|
100
|
+
useNavItems: () => useNavItems,
|
|
101
101
|
useToaster: () => useToaster,
|
|
102
102
|
useToasterContext: () => useToasterContext,
|
|
103
103
|
useToasts: () => useToasts
|
|
104
104
|
});
|
|
105
105
|
module.exports = __toCommonJS(index_exports);
|
|
106
106
|
|
|
107
|
-
// src/models/toaster.ts
|
|
108
|
-
var Toaster;
|
|
109
|
-
((Toaster2) => {
|
|
110
|
-
let Status;
|
|
111
|
-
((Status2) => {
|
|
112
|
-
Status2["confirm"] = "confirm";
|
|
113
|
-
Status2["reject"] = "reject";
|
|
114
|
-
Status2["dismiss"] = "dismiss";
|
|
115
|
-
})(Status = Toaster2.Status || (Toaster2.Status = {}));
|
|
116
|
-
})(Toaster || (Toaster = {}));
|
|
117
|
-
|
|
118
107
|
// src/models/confirmation.ts
|
|
119
108
|
var Confirmation;
|
|
120
109
|
((Confirmation2) => {
|
|
@@ -482,7 +471,7 @@ function ConfirmationProvider({ children }) {
|
|
|
482
471
|
(0, import_react5.useEffect)(() => {
|
|
483
472
|
if (!escapeListenerRef.current) return;
|
|
484
473
|
const handleEscape = (event) => {
|
|
485
|
-
if (event.key === "Escape" && confirmation && confirmation.options?.
|
|
474
|
+
if (event.key === "Escape" && confirmation && confirmation.options?.dismissible !== false) {
|
|
486
475
|
respond(Confirmation.Status.dismiss);
|
|
487
476
|
}
|
|
488
477
|
};
|
|
@@ -735,9 +724,152 @@ function isHttpErrorResponse(error) {
|
|
|
735
724
|
return typeof error === "object" && error !== null && "status" in error && typeof error.status === "number";
|
|
736
725
|
}
|
|
737
726
|
|
|
738
|
-
// src/
|
|
727
|
+
// src/hooks/use-nav-items.ts
|
|
739
728
|
var import_react8 = require("react");
|
|
740
|
-
|
|
729
|
+
|
|
730
|
+
// src/services/nav-items.service.ts
|
|
731
|
+
var _NavItemsService = class _NavItemsService {
|
|
732
|
+
constructor() {
|
|
733
|
+
this._items = [];
|
|
734
|
+
this._listeners = /* @__PURE__ */ new Set();
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* Get singleton instance
|
|
738
|
+
* @since 3.0.0
|
|
739
|
+
*/
|
|
740
|
+
static getInstance() {
|
|
741
|
+
if (!_NavItemsService._instance) {
|
|
742
|
+
_NavItemsService._instance = new _NavItemsService();
|
|
743
|
+
}
|
|
744
|
+
return _NavItemsService._instance;
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* Reset the singleton instance (useful for testing)
|
|
748
|
+
* @internal
|
|
749
|
+
*/
|
|
750
|
+
static resetInstance() {
|
|
751
|
+
_NavItemsService._instance = null;
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* Get current items (sorted by order)
|
|
755
|
+
* @since 3.0.0
|
|
756
|
+
*/
|
|
757
|
+
get items() {
|
|
758
|
+
return [...this._items].sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* Subscribe to item changes.
|
|
762
|
+
* Returns an unsubscribe function.
|
|
763
|
+
*
|
|
764
|
+
* @param listener - Callback function to receive item updates
|
|
765
|
+
* @returns Unsubscribe function
|
|
766
|
+
* @since 3.0.0
|
|
767
|
+
*/
|
|
768
|
+
subscribe(listener) {
|
|
769
|
+
this._listeners.add(listener);
|
|
770
|
+
listener(this.items);
|
|
771
|
+
return () => {
|
|
772
|
+
this._listeners.delete(listener);
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
/**
|
|
776
|
+
* Get items as an observable-like interface.
|
|
777
|
+
* Compatible with Angular's Observable pattern.
|
|
778
|
+
*
|
|
779
|
+
* @returns Object with subscribe method
|
|
780
|
+
* @since 3.0.0
|
|
781
|
+
*/
|
|
782
|
+
get items$() {
|
|
783
|
+
return {
|
|
784
|
+
subscribe: (callback) => {
|
|
785
|
+
const unsubscribe = this.subscribe(callback);
|
|
786
|
+
return { unsubscribe };
|
|
787
|
+
}
|
|
788
|
+
};
|
|
789
|
+
}
|
|
790
|
+
/**
|
|
791
|
+
* Add one or more items.
|
|
792
|
+
* Items are automatically sorted by order.
|
|
793
|
+
*
|
|
794
|
+
* @param items - Array of items to add
|
|
795
|
+
* @since 3.0.0
|
|
796
|
+
*/
|
|
797
|
+
addItems(items) {
|
|
798
|
+
const existingIds = new Set(this._items.map((item) => item.id));
|
|
799
|
+
const newItems = items.filter((item) => !existingIds.has(item.id));
|
|
800
|
+
this._items = [...this._items, ...newItems];
|
|
801
|
+
this.notify();
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* Remove an item by id.
|
|
805
|
+
*
|
|
806
|
+
* @param id - The id of the item to remove
|
|
807
|
+
* @since 3.0.0
|
|
808
|
+
*/
|
|
809
|
+
removeItem(id) {
|
|
810
|
+
const initialLength = this._items.length;
|
|
811
|
+
this._items = this._items.filter((item) => item.id !== id);
|
|
812
|
+
if (this._items.length !== initialLength) {
|
|
813
|
+
this.notify();
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
/**
|
|
817
|
+
* Patch an existing item by id.
|
|
818
|
+
* Updates only the specified properties.
|
|
819
|
+
*
|
|
820
|
+
* @param id - The id of the item to patch
|
|
821
|
+
* @param patch - Partial item data to merge
|
|
822
|
+
* @since 3.0.0
|
|
823
|
+
*/
|
|
824
|
+
patchItem(id, patch) {
|
|
825
|
+
const index = this._items.findIndex((item) => item.id === id);
|
|
826
|
+
if (index !== -1) {
|
|
827
|
+
this._items = [
|
|
828
|
+
...this._items.slice(0, index),
|
|
829
|
+
{ ...this._items[index], ...patch },
|
|
830
|
+
...this._items.slice(index + 1)
|
|
831
|
+
];
|
|
832
|
+
this.notify();
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
/**
|
|
836
|
+
* Clear all items.
|
|
837
|
+
* @since 3.0.0
|
|
838
|
+
*/
|
|
839
|
+
clear() {
|
|
840
|
+
if (this._items.length > 0) {
|
|
841
|
+
this._items = [];
|
|
842
|
+
this.notify();
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
/**
|
|
846
|
+
* Notify all listeners of changes.
|
|
847
|
+
*/
|
|
848
|
+
notify() {
|
|
849
|
+
const currentItems = this.items;
|
|
850
|
+
this._listeners.forEach((listener) => listener(currentItems));
|
|
851
|
+
}
|
|
852
|
+
};
|
|
853
|
+
_NavItemsService._instance = null;
|
|
854
|
+
var NavItemsService = _NavItemsService;
|
|
855
|
+
function getNavItemsService() {
|
|
856
|
+
return NavItemsService.getInstance();
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
// src/hooks/use-nav-items.ts
|
|
860
|
+
function useNavItems(service) {
|
|
861
|
+
const navItemsService = service || getNavItemsService();
|
|
862
|
+
const [items, setItems] = (0, import_react8.useState)(navItemsService.items);
|
|
863
|
+
(0, import_react8.useEffect)(() => {
|
|
864
|
+
const unsubscribe = navItemsService.subscribe(setItems);
|
|
865
|
+
return unsubscribe;
|
|
866
|
+
}, [navItemsService]);
|
|
867
|
+
return items;
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
// src/components/toast/Toast.tsx
|
|
871
|
+
var import_react9 = require("react");
|
|
872
|
+
var import_react10 = require("@chakra-ui/react");
|
|
741
873
|
var import_core = require("@abpjs/core");
|
|
742
874
|
var import_lucide_react = require("lucide-react");
|
|
743
875
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -844,7 +976,7 @@ function getPlacement(position) {
|
|
|
844
976
|
var toasterCache = /* @__PURE__ */ new Map();
|
|
845
977
|
function getToaster(placement) {
|
|
846
978
|
if (!toasterCache.has(placement)) {
|
|
847
|
-
toasterCache.set(placement, (0,
|
|
979
|
+
toasterCache.set(placement, (0, import_react10.createToaster)({
|
|
848
980
|
placement,
|
|
849
981
|
pauseOnPageIdle: true
|
|
850
982
|
}));
|
|
@@ -854,14 +986,14 @@ function getToaster(placement) {
|
|
|
854
986
|
function ToastContainer({ position = "bottom-right", containerKey }) {
|
|
855
987
|
const { toasts, service } = useToasterContext();
|
|
856
988
|
const { t } = (0, import_core.useLocalization)();
|
|
857
|
-
const displayedToastsRef = (0,
|
|
858
|
-
const placement = (0,
|
|
859
|
-
const toaster = (0,
|
|
860
|
-
const filteredToasts = (0,
|
|
989
|
+
const displayedToastsRef = (0, import_react9.useRef)(/* @__PURE__ */ new Set());
|
|
990
|
+
const placement = (0, import_react9.useMemo)(() => getPlacement(position), [position]);
|
|
991
|
+
const toaster = (0, import_react9.useMemo)(() => getToaster(placement), [placement]);
|
|
992
|
+
const filteredToasts = (0, import_react9.useMemo)(() => {
|
|
861
993
|
if (!containerKey) return toasts;
|
|
862
994
|
return toasts.filter((toast) => toast.options?.containerKey === containerKey);
|
|
863
995
|
}, [toasts, containerKey]);
|
|
864
|
-
(0,
|
|
996
|
+
(0, import_react9.useEffect)(() => {
|
|
865
997
|
const newToasts = filteredToasts.filter((toast) => !displayedToastsRef.current.has(toast.id));
|
|
866
998
|
newToasts.forEach((toast) => {
|
|
867
999
|
displayedToastsRef.current.add(toast.id);
|
|
@@ -894,11 +1026,11 @@ function ToastContainer({ position = "bottom-right", containerKey }) {
|
|
|
894
1026
|
});
|
|
895
1027
|
});
|
|
896
1028
|
}, [filteredToasts, t, service, toaster]);
|
|
897
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1029
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react10.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react10.Toaster, { toaster, insetInline: { mdDown: "4" }, children: (toast) => {
|
|
898
1030
|
const severity = toast.meta?.severity || "info";
|
|
899
1031
|
const closable = toast.meta?.closable !== false;
|
|
900
1032
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
901
|
-
|
|
1033
|
+
import_react10.Toast.Root,
|
|
902
1034
|
{
|
|
903
1035
|
bg: getSeverityBg(severity),
|
|
904
1036
|
borderWidth: "1px",
|
|
@@ -906,13 +1038,13 @@ function ToastContainer({ position = "bottom-right", containerKey }) {
|
|
|
906
1038
|
borderRadius: "lg",
|
|
907
1039
|
boxShadow: "lg",
|
|
908
1040
|
width: { md: "sm" },
|
|
909
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
910
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
911
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
912
|
-
toast.title && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
913
|
-
toast.description && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1041
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react10.Flex, { align: "flex-start", gap: 3, p: 4, children: [
|
|
1042
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react10.Box, { flexShrink: 0, pt: "2px", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SeverityIcon, { severity }) }),
|
|
1043
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react10.Stack, { gap: 1, flex: 1, children: [
|
|
1044
|
+
toast.title && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react10.Toast.Title, { fontWeight: "bold", fontSize: "sm", color: "fg", children: toast.title }),
|
|
1045
|
+
toast.description && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react10.Toast.Description, { fontSize: "sm", color: "gray.700", children: toast.description })
|
|
914
1046
|
] }),
|
|
915
|
-
closable && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1047
|
+
closable && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react10.Toast.CloseTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react10.CloseButton, { size: "sm" }) })
|
|
916
1048
|
] })
|
|
917
1049
|
}
|
|
918
1050
|
);
|
|
@@ -920,8 +1052,8 @@ function ToastContainer({ position = "bottom-right", containerKey }) {
|
|
|
920
1052
|
}
|
|
921
1053
|
|
|
922
1054
|
// src/components/confirmation/Confirmation.tsx
|
|
923
|
-
var
|
|
924
|
-
var
|
|
1055
|
+
var import_react11 = require("react");
|
|
1056
|
+
var import_react12 = require("@chakra-ui/react");
|
|
925
1057
|
var import_core2 = require("@abpjs/core");
|
|
926
1058
|
var import_lucide_react2 = require("lucide-react");
|
|
927
1059
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
@@ -969,7 +1101,7 @@ function getSeverityColorPalette2(severity) {
|
|
|
969
1101
|
function ConfirmationDialog({ className }) {
|
|
970
1102
|
const { confirmation, respond } = useConfirmationState();
|
|
971
1103
|
const { t } = (0, import_core2.useLocalization)();
|
|
972
|
-
const cancelRef = (0,
|
|
1104
|
+
const cancelRef = (0, import_react11.useRef)(null);
|
|
973
1105
|
if (!confirmation) {
|
|
974
1106
|
return null;
|
|
975
1107
|
}
|
|
@@ -995,29 +1127,29 @@ function ConfirmationDialog({ className }) {
|
|
|
995
1127
|
respond(Confirmation.Status.dismiss);
|
|
996
1128
|
};
|
|
997
1129
|
const handleOpenChange = (details) => {
|
|
998
|
-
if (!details.open && options?.
|
|
1130
|
+
if (!details.open && options?.dismissible !== false) {
|
|
999
1131
|
handleDismiss();
|
|
1000
1132
|
}
|
|
1001
1133
|
};
|
|
1002
1134
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1003
|
-
|
|
1135
|
+
import_react12.Dialog.Root,
|
|
1004
1136
|
{
|
|
1005
1137
|
open: true,
|
|
1006
1138
|
onOpenChange: handleOpenChange,
|
|
1007
1139
|
role: "alertdialog",
|
|
1008
1140
|
placement: "center",
|
|
1009
1141
|
initialFocusEl: () => cancelRef.current,
|
|
1010
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1011
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1012
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1013
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1142
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react12.Portal, { children: [
|
|
1143
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react12.Dialog.Backdrop, {}),
|
|
1144
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react12.Dialog.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react12.Dialog.Content, { className, maxWidth: "md", children: [
|
|
1145
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react12.Dialog.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react12.Flex, { align: "center", gap: 3, children: [
|
|
1014
1146
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SeverityIcon2, { severity }),
|
|
1015
|
-
localizedTitle && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1147
|
+
localizedTitle && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react12.Dialog.Title, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react12.Text, { fontWeight: "bold", fontSize: "lg", children: localizedTitle }) })
|
|
1016
1148
|
] }) }),
|
|
1017
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1018
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1149
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react12.Dialog.Body, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react12.Text, { color: "gray.600", children: localizedMessage }) }),
|
|
1150
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react12.Dialog.Footer, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react12.Flex, { gap: 3, children: [
|
|
1019
1151
|
!options?.hideCancelBtn && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1020
|
-
|
|
1152
|
+
import_react12.Button,
|
|
1021
1153
|
{
|
|
1022
1154
|
ref: cancelRef,
|
|
1023
1155
|
variant: "ghost",
|
|
@@ -1026,7 +1158,7 @@ function ConfirmationDialog({ className }) {
|
|
|
1026
1158
|
}
|
|
1027
1159
|
),
|
|
1028
1160
|
!options?.hideYesBtn && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1029
|
-
|
|
1161
|
+
import_react12.Button,
|
|
1030
1162
|
{
|
|
1031
1163
|
colorPalette: getSeverityColorPalette2(severity),
|
|
1032
1164
|
onClick: handleConfirm,
|
|
@@ -1041,7 +1173,7 @@ function ConfirmationDialog({ className }) {
|
|
|
1041
1173
|
}
|
|
1042
1174
|
|
|
1043
1175
|
// src/components/errors/ErrorComponent.tsx
|
|
1044
|
-
var
|
|
1176
|
+
var import_react13 = require("@chakra-ui/react");
|
|
1045
1177
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1046
1178
|
function ErrorComponent({
|
|
1047
1179
|
title = "Error",
|
|
@@ -1053,9 +1185,9 @@ function ErrorComponent({
|
|
|
1053
1185
|
onHomeClick,
|
|
1054
1186
|
homeButtonText = "Go Home"
|
|
1055
1187
|
}) {
|
|
1056
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react13.Container, { maxW: "container.md", py: 20, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react13.VStack, { gap: 6, textAlign: "center", children: [
|
|
1057
1189
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1058
|
-
|
|
1190
|
+
import_react13.Heading,
|
|
1059
1191
|
{
|
|
1060
1192
|
size: "4xl",
|
|
1061
1193
|
color: "red.500",
|
|
@@ -1063,10 +1195,10 @@ function ErrorComponent({
|
|
|
1063
1195
|
children: title
|
|
1064
1196
|
}
|
|
1065
1197
|
),
|
|
1066
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1067
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1198
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react13.Text, { fontSize: "lg", color: "gray.600", children: details }),
|
|
1199
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react13.Box, { display: "flex", gap: 3, children: [
|
|
1068
1200
|
isHomeShow && onHomeClick && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1069
|
-
|
|
1201
|
+
import_react13.Button,
|
|
1070
1202
|
{
|
|
1071
1203
|
colorPalette: "green",
|
|
1072
1204
|
size: "lg",
|
|
@@ -1075,7 +1207,7 @@ function ErrorComponent({
|
|
|
1075
1207
|
}
|
|
1076
1208
|
),
|
|
1077
1209
|
showCloseButton && onDestroy && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1078
|
-
|
|
1210
|
+
import_react13.Button,
|
|
1079
1211
|
{
|
|
1080
1212
|
colorPalette: "blue",
|
|
1081
1213
|
size: "lg",
|
|
@@ -1088,35 +1220,21 @@ function ErrorComponent({
|
|
|
1088
1220
|
}
|
|
1089
1221
|
|
|
1090
1222
|
// src/components/loader-bar/LoaderBar.tsx
|
|
1091
|
-
var
|
|
1223
|
+
var import_react14 = require("react");
|
|
1092
1224
|
var import_core3 = require("@abpjs/core");
|
|
1093
1225
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1094
1226
|
function LoaderBar({
|
|
1095
1227
|
containerClass = "abp-loader-bar",
|
|
1096
1228
|
progressClass = "abp-progress",
|
|
1097
|
-
filter,
|
|
1229
|
+
filter: _filter,
|
|
1098
1230
|
intervalPeriod = 300,
|
|
1099
1231
|
stopDelay = 400
|
|
1100
1232
|
}) {
|
|
1101
1233
|
const { loading } = (0, import_core3.useLoader)();
|
|
1102
|
-
const [isLoading, setIsLoading] = (0,
|
|
1103
|
-
const [progressLevel, setProgressLevel] = (0,
|
|
1104
|
-
const intervalRef = (0,
|
|
1105
|
-
(0,
|
|
1106
|
-
if (loading) {
|
|
1107
|
-
startLoading();
|
|
1108
|
-
} else {
|
|
1109
|
-
stopLoading();
|
|
1110
|
-
}
|
|
1111
|
-
}, [loading]);
|
|
1112
|
-
(0, import_react13.useEffect)(() => {
|
|
1113
|
-
return () => {
|
|
1114
|
-
if (intervalRef.current) {
|
|
1115
|
-
clearInterval(intervalRef.current);
|
|
1116
|
-
}
|
|
1117
|
-
};
|
|
1118
|
-
}, []);
|
|
1119
|
-
const startLoading = () => {
|
|
1234
|
+
const [isLoading, setIsLoading] = (0, import_react14.useState)(false);
|
|
1235
|
+
const [progressLevel, setProgressLevel] = (0, import_react14.useState)(0);
|
|
1236
|
+
const intervalRef = (0, import_react14.useRef)(null);
|
|
1237
|
+
const startLoading = (0, import_react14.useCallback)(() => {
|
|
1120
1238
|
setIsLoading(true);
|
|
1121
1239
|
setProgressLevel(0);
|
|
1122
1240
|
if (intervalRef.current) {
|
|
@@ -1134,8 +1252,8 @@ function LoaderBar({
|
|
|
1134
1252
|
return prev + 10;
|
|
1135
1253
|
});
|
|
1136
1254
|
}, intervalPeriod);
|
|
1137
|
-
};
|
|
1138
|
-
const stopLoading = () => {
|
|
1255
|
+
}, [intervalPeriod]);
|
|
1256
|
+
const stopLoading = (0, import_react14.useCallback)(() => {
|
|
1139
1257
|
setProgressLevel(100);
|
|
1140
1258
|
if (intervalRef.current) {
|
|
1141
1259
|
clearInterval(intervalRef.current);
|
|
@@ -1145,7 +1263,21 @@ function LoaderBar({
|
|
|
1145
1263
|
setIsLoading(false);
|
|
1146
1264
|
setProgressLevel(0);
|
|
1147
1265
|
}, stopDelay);
|
|
1148
|
-
};
|
|
1266
|
+
}, [stopDelay]);
|
|
1267
|
+
(0, import_react14.useEffect)(() => {
|
|
1268
|
+
if (loading) {
|
|
1269
|
+
startLoading();
|
|
1270
|
+
} else {
|
|
1271
|
+
stopLoading();
|
|
1272
|
+
}
|
|
1273
|
+
}, [loading, startLoading, stopLoading]);
|
|
1274
|
+
(0, import_react14.useEffect)(() => {
|
|
1275
|
+
return () => {
|
|
1276
|
+
if (intervalRef.current) {
|
|
1277
|
+
clearInterval(intervalRef.current);
|
|
1278
|
+
}
|
|
1279
|
+
};
|
|
1280
|
+
}, []);
|
|
1149
1281
|
if (!isLoading && progressLevel === 0) {
|
|
1150
1282
|
return null;
|
|
1151
1283
|
}
|
|
@@ -1180,8 +1312,8 @@ function LoaderBar({
|
|
|
1180
1312
|
}
|
|
1181
1313
|
|
|
1182
1314
|
// src/components/modal/Modal.tsx
|
|
1183
|
-
var
|
|
1184
|
-
var
|
|
1315
|
+
var import_react15 = __toESM(require("react"));
|
|
1316
|
+
var import_react16 = require("@chakra-ui/react");
|
|
1185
1317
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1186
1318
|
function getSizeWidth(size) {
|
|
1187
1319
|
switch (size) {
|
|
@@ -1220,12 +1352,12 @@ function Modal({
|
|
|
1220
1352
|
preventScroll = true,
|
|
1221
1353
|
onInit
|
|
1222
1354
|
}) {
|
|
1223
|
-
const prevVisibleRef =
|
|
1224
|
-
const onInitRef =
|
|
1225
|
-
|
|
1355
|
+
const prevVisibleRef = import_react15.default.useRef(false);
|
|
1356
|
+
const onInitRef = import_react15.default.useRef(onInit);
|
|
1357
|
+
import_react15.default.useEffect(() => {
|
|
1226
1358
|
onInitRef.current = onInit;
|
|
1227
1359
|
}, [onInit]);
|
|
1228
|
-
|
|
1360
|
+
import_react15.default.useEffect(() => {
|
|
1229
1361
|
if (visible && !prevVisibleRef.current && onInitRef.current) {
|
|
1230
1362
|
onInitRef.current();
|
|
1231
1363
|
}
|
|
@@ -1238,7 +1370,7 @@ function Modal({
|
|
|
1238
1370
|
onVisibleChange?.(details.open);
|
|
1239
1371
|
};
|
|
1240
1372
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1241
|
-
|
|
1373
|
+
import_react16.Dialog.Root,
|
|
1242
1374
|
{
|
|
1243
1375
|
open: visible,
|
|
1244
1376
|
onOpenChange: handleOpenChange,
|
|
@@ -1249,10 +1381,10 @@ function Modal({
|
|
|
1249
1381
|
motionPreset,
|
|
1250
1382
|
trapFocus,
|
|
1251
1383
|
preventScroll,
|
|
1252
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1253
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1254
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1255
|
-
|
|
1384
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react16.Portal, { children: [
|
|
1385
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Dialog.Backdrop, {}),
|
|
1386
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Dialog.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1387
|
+
import_react16.Dialog.Content,
|
|
1256
1388
|
{
|
|
1257
1389
|
className: modalClass,
|
|
1258
1390
|
width: getSizeWidth(size),
|
|
@@ -1262,16 +1394,16 @@ function Modal({
|
|
|
1262
1394
|
minHeight,
|
|
1263
1395
|
children: [
|
|
1264
1396
|
(header || showCloseButton) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1265
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1266
|
-
header && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1267
|
-
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1397
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Dialog.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react16.Flex, { justify: "space-between", align: "center", width: "100%", children: [
|
|
1398
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Dialog.Title, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Text, { fontWeight: "bold", fontSize: "lg", children: header }) }),
|
|
1399
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Dialog.CloseTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.CloseButton, { size: "sm" }) })
|
|
1268
1400
|
] }) }),
|
|
1269
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1401
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Separator, {})
|
|
1270
1402
|
] }),
|
|
1271
|
-
children && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1403
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Dialog.Body, { py: 4, children }),
|
|
1272
1404
|
footer && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1273
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1274
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1405
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Separator, {}),
|
|
1406
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Dialog.Footer, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Flex, { gap: 3, justify: "flex-end", w: "100%", children: footer }) })
|
|
1275
1407
|
] })
|
|
1276
1408
|
]
|
|
1277
1409
|
}
|
|
@@ -1281,17 +1413,17 @@ function Modal({
|
|
|
1281
1413
|
);
|
|
1282
1414
|
}
|
|
1283
1415
|
function AbpModalHeader({ children, className }) {
|
|
1284
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Text, { fontWeight: "bold", fontSize: "lg", className, children });
|
|
1285
1417
|
}
|
|
1286
1418
|
function AbpModalBody({ children, className }) {
|
|
1287
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Box, { color: "gray.600", className, children });
|
|
1288
1420
|
}
|
|
1289
1421
|
function AbpModalFooter({ children, className }) {
|
|
1290
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react16.Flex, { gap: 3, justify: "flex-end", className, children });
|
|
1291
1423
|
}
|
|
1292
1424
|
|
|
1293
1425
|
// src/components/ui/Alert.tsx
|
|
1294
|
-
var
|
|
1426
|
+
var import_react17 = require("@chakra-ui/react");
|
|
1295
1427
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1296
1428
|
function Alert({
|
|
1297
1429
|
status = "info",
|
|
@@ -1304,28 +1436,28 @@ function Alert({
|
|
|
1304
1436
|
borderRadius = "md"
|
|
1305
1437
|
}) {
|
|
1306
1438
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1307
|
-
|
|
1439
|
+
import_react17.Alert.Root,
|
|
1308
1440
|
{
|
|
1309
1441
|
status,
|
|
1310
1442
|
className,
|
|
1311
1443
|
mb,
|
|
1312
1444
|
borderRadius,
|
|
1313
1445
|
children: [
|
|
1314
|
-
showIcon && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1446
|
+
showIcon && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react17.Alert.Indicator, {}),
|
|
1315
1447
|
title ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
1316
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1317
|
-
(description || children) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1318
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1448
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react17.Alert.Title, { children: title }),
|
|
1449
|
+
(description || children) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react17.Alert.Description, { children: description || children })
|
|
1450
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react17.Alert.Title, { children })
|
|
1319
1451
|
]
|
|
1320
1452
|
}
|
|
1321
1453
|
);
|
|
1322
1454
|
}
|
|
1323
1455
|
|
|
1324
1456
|
// src/components/ui/Button.tsx
|
|
1325
|
-
var
|
|
1326
|
-
var
|
|
1457
|
+
var import_react18 = require("react");
|
|
1458
|
+
var import_react19 = require("@chakra-ui/react");
|
|
1327
1459
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1328
|
-
var Button3 = (0,
|
|
1460
|
+
var Button3 = (0, import_react18.forwardRef)(
|
|
1329
1461
|
function Button4({
|
|
1330
1462
|
children,
|
|
1331
1463
|
type = "button",
|
|
@@ -1342,7 +1474,7 @@ var Button3 = (0, import_react17.forwardRef)(
|
|
|
1342
1474
|
ml
|
|
1343
1475
|
}, ref) {
|
|
1344
1476
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1345
|
-
|
|
1477
|
+
import_react19.Button,
|
|
1346
1478
|
{
|
|
1347
1479
|
ref,
|
|
1348
1480
|
type,
|
|
@@ -1364,10 +1496,10 @@ var Button3 = (0, import_react17.forwardRef)(
|
|
|
1364
1496
|
);
|
|
1365
1497
|
|
|
1366
1498
|
// src/components/ui/Checkbox.tsx
|
|
1367
|
-
var
|
|
1368
|
-
var
|
|
1499
|
+
var import_react20 = require("react");
|
|
1500
|
+
var import_react21 = require("@chakra-ui/react");
|
|
1369
1501
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1370
|
-
var Checkbox = (0,
|
|
1502
|
+
var Checkbox = (0, import_react20.forwardRef)(
|
|
1371
1503
|
function Checkbox2({
|
|
1372
1504
|
children,
|
|
1373
1505
|
checked,
|
|
@@ -1385,7 +1517,7 @@ var Checkbox = (0, import_react19.forwardRef)(
|
|
|
1385
1517
|
className
|
|
1386
1518
|
}, ref) {
|
|
1387
1519
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1388
|
-
|
|
1520
|
+
import_react21.Checkbox.Root,
|
|
1389
1521
|
{
|
|
1390
1522
|
checked,
|
|
1391
1523
|
defaultChecked,
|
|
@@ -1398,7 +1530,7 @@ var Checkbox = (0, import_react19.forwardRef)(
|
|
|
1398
1530
|
className,
|
|
1399
1531
|
children: [
|
|
1400
1532
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1401
|
-
|
|
1533
|
+
import_react21.Checkbox.HiddenInput,
|
|
1402
1534
|
{
|
|
1403
1535
|
ref,
|
|
1404
1536
|
id,
|
|
@@ -1407,8 +1539,8 @@ var Checkbox = (0, import_react19.forwardRef)(
|
|
|
1407
1539
|
onChange
|
|
1408
1540
|
}
|
|
1409
1541
|
),
|
|
1410
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1411
|
-
children && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1542
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react21.Checkbox.Control, {}),
|
|
1543
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react21.Checkbox.Label, { children })
|
|
1412
1544
|
]
|
|
1413
1545
|
}
|
|
1414
1546
|
);
|
|
@@ -1416,7 +1548,7 @@ var Checkbox = (0, import_react19.forwardRef)(
|
|
|
1416
1548
|
);
|
|
1417
1549
|
|
|
1418
1550
|
// src/components/ui/FormField.tsx
|
|
1419
|
-
var
|
|
1551
|
+
var import_react22 = require("@chakra-ui/react");
|
|
1420
1552
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1421
1553
|
function FormField({
|
|
1422
1554
|
label,
|
|
@@ -1429,20 +1561,20 @@ function FormField({
|
|
|
1429
1561
|
htmlFor,
|
|
1430
1562
|
className
|
|
1431
1563
|
}) {
|
|
1432
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1433
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react22.Field.Root, { invalid, disabled, className, children: [
|
|
1565
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react22.Field.Label, { htmlFor, children: [
|
|
1434
1566
|
label,
|
|
1435
|
-
required && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1567
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react22.Field.RequiredIndicator, {})
|
|
1436
1568
|
] }),
|
|
1437
1569
|
children,
|
|
1438
|
-
helperText && !invalid && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1439
|
-
invalid && errorText && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1570
|
+
helperText && !invalid && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react22.Field.HelperText, { children: helperText }),
|
|
1571
|
+
invalid && errorText && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react22.Field.ErrorText, { children: errorText })
|
|
1440
1572
|
] });
|
|
1441
1573
|
}
|
|
1442
1574
|
|
|
1443
1575
|
// src/components/change-password/ChangePassword.tsx
|
|
1444
|
-
var
|
|
1445
|
-
var
|
|
1576
|
+
var import_react23 = require("react");
|
|
1577
|
+
var import_react24 = require("@chakra-ui/react");
|
|
1446
1578
|
var import_react_hook_form = require("react-hook-form");
|
|
1447
1579
|
var import_core4 = require("@abpjs/core");
|
|
1448
1580
|
var import_lucide_react3 = require("lucide-react");
|
|
@@ -1468,7 +1600,7 @@ function ChangePassword({
|
|
|
1468
1600
|
}
|
|
1469
1601
|
});
|
|
1470
1602
|
const newPassword = watch("newPassword");
|
|
1471
|
-
(0,
|
|
1603
|
+
(0, import_react23.useEffect)(() => {
|
|
1472
1604
|
if (visible) {
|
|
1473
1605
|
reset();
|
|
1474
1606
|
}
|
|
@@ -1510,9 +1642,9 @@ function ChangePassword({
|
|
|
1510
1642
|
}
|
|
1511
1643
|
};
|
|
1512
1644
|
const modalFooter = /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1513
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1645
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react24.Button, { variant: "ghost", mr: 3, onClick: handleClose, disabled: isSubmitting, children: t("AbpIdentity::Cancel") || "Cancel" }),
|
|
1514
1646
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1515
|
-
|
|
1647
|
+
import_react24.Button,
|
|
1516
1648
|
{
|
|
1517
1649
|
colorPalette: "blue",
|
|
1518
1650
|
type: "submit",
|
|
@@ -1534,14 +1666,14 @@ function ChangePassword({
|
|
|
1534
1666
|
header: t("AbpIdentity::ChangePassword") || "Change Password",
|
|
1535
1667
|
footer: modalFooter,
|
|
1536
1668
|
centered: true,
|
|
1537
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("form", { id: "change-password-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1538
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1539
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1669
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("form", { id: "change-password-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react24.VStack, { gap: 4, children: [
|
|
1670
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react24.Field.Root, { invalid: !!errors.password, children: [
|
|
1671
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react24.Field.Label, { children: [
|
|
1540
1672
|
t("AbpIdentity::DisplayName:CurrentPassword") || "Current Password",
|
|
1541
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1673
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react24.Field.RequiredIndicator, {})
|
|
1542
1674
|
] }),
|
|
1543
1675
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1544
|
-
|
|
1676
|
+
import_react24.Input,
|
|
1545
1677
|
{
|
|
1546
1678
|
type: "password",
|
|
1547
1679
|
...register("password", {
|
|
@@ -1549,29 +1681,29 @@ function ChangePassword({
|
|
|
1549
1681
|
})
|
|
1550
1682
|
}
|
|
1551
1683
|
),
|
|
1552
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1684
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react24.Field.ErrorText, { children: errors.password?.message })
|
|
1553
1685
|
] }),
|
|
1554
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1555
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1686
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react24.Field.Root, { invalid: !!errors.newPassword, children: [
|
|
1687
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react24.Field.Label, { children: [
|
|
1556
1688
|
t("AbpIdentity::DisplayName:NewPassword") || "New Password",
|
|
1557
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1689
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react24.Field.RequiredIndicator, {})
|
|
1558
1690
|
] }),
|
|
1559
1691
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1560
|
-
|
|
1692
|
+
import_react24.Input,
|
|
1561
1693
|
{
|
|
1562
1694
|
type: "password",
|
|
1563
1695
|
...register("newPassword", passwordValidation)
|
|
1564
1696
|
}
|
|
1565
1697
|
),
|
|
1566
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1698
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react24.Field.ErrorText, { children: errors.newPassword?.message })
|
|
1567
1699
|
] }),
|
|
1568
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1569
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1700
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react24.Field.Root, { invalid: !!errors.repeatNewPassword, children: [
|
|
1701
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react24.Field.Label, { children: [
|
|
1570
1702
|
t("AbpIdentity::DisplayName:NewPasswordConfirm") || "Confirm New Password",
|
|
1571
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1703
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react24.Field.RequiredIndicator, {})
|
|
1572
1704
|
] }),
|
|
1573
1705
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1574
|
-
|
|
1706
|
+
import_react24.Input,
|
|
1575
1707
|
{
|
|
1576
1708
|
type: "password",
|
|
1577
1709
|
...register("repeatNewPassword", {
|
|
@@ -1580,7 +1712,7 @@ function ChangePassword({
|
|
|
1580
1712
|
})
|
|
1581
1713
|
}
|
|
1582
1714
|
),
|
|
1583
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1715
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react24.Field.ErrorText, { children: errors.repeatNewPassword?.message })
|
|
1584
1716
|
] })
|
|
1585
1717
|
] }) })
|
|
1586
1718
|
}
|
|
@@ -1588,8 +1720,8 @@ function ChangePassword({
|
|
|
1588
1720
|
}
|
|
1589
1721
|
|
|
1590
1722
|
// src/components/profile/Profile.tsx
|
|
1591
|
-
var
|
|
1592
|
-
var
|
|
1723
|
+
var import_react25 = require("react");
|
|
1724
|
+
var import_react26 = require("@chakra-ui/react");
|
|
1593
1725
|
var import_react_hook_form2 = require("react-hook-form");
|
|
1594
1726
|
var import_core5 = require("@abpjs/core");
|
|
1595
1727
|
var import_lucide_react4 = require("lucide-react");
|
|
@@ -1616,13 +1748,13 @@ function Profile({
|
|
|
1616
1748
|
}
|
|
1617
1749
|
});
|
|
1618
1750
|
const modalBusy = isSubmitting || loading;
|
|
1619
|
-
(0,
|
|
1751
|
+
(0, import_react25.useEffect)(() => {
|
|
1620
1752
|
if (visible) {
|
|
1621
1753
|
fetchProfile().then(() => {
|
|
1622
1754
|
});
|
|
1623
1755
|
}
|
|
1624
1756
|
}, [visible, fetchProfile]);
|
|
1625
|
-
(0,
|
|
1757
|
+
(0, import_react25.useEffect)(() => {
|
|
1626
1758
|
if (profile) {
|
|
1627
1759
|
reset({
|
|
1628
1760
|
userName: profile.userName || "",
|
|
@@ -1654,9 +1786,9 @@ function Profile({
|
|
|
1654
1786
|
}
|
|
1655
1787
|
};
|
|
1656
1788
|
const modalFooter = /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1657
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1789
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react26.Button, { variant: "ghost", mr: 3, onClick: handleClose, disabled: modalBusy, children: t("AbpIdentity::Cancel") || "Cancel" }),
|
|
1658
1790
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1659
|
-
|
|
1791
|
+
import_react26.Button,
|
|
1660
1792
|
{
|
|
1661
1793
|
colorPalette: "blue",
|
|
1662
1794
|
type: "submit",
|
|
@@ -1679,14 +1811,14 @@ function Profile({
|
|
|
1679
1811
|
footer: modalFooter,
|
|
1680
1812
|
size: "lg",
|
|
1681
1813
|
centered: true,
|
|
1682
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("form", { id: "profile-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1683
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1684
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1814
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("form", { id: "profile-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react26.VStack, { gap: 4, children: [
|
|
1815
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react26.Field.Root, { invalid: !!errors.userName, children: [
|
|
1816
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react26.Field.Label, { children: [
|
|
1685
1817
|
t("AbpIdentity::DisplayName:UserName") || "Username",
|
|
1686
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1818
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react26.Field.RequiredIndicator, {})
|
|
1687
1819
|
] }),
|
|
1688
1820
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1689
|
-
|
|
1821
|
+
import_react26.Input,
|
|
1690
1822
|
{
|
|
1691
1823
|
type: "text",
|
|
1692
1824
|
...register("userName", {
|
|
@@ -1698,13 +1830,13 @@ function Profile({
|
|
|
1698
1830
|
})
|
|
1699
1831
|
}
|
|
1700
1832
|
),
|
|
1701
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1833
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react26.Field.ErrorText, { children: errors.userName?.message })
|
|
1702
1834
|
] }),
|
|
1703
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1704
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1705
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1835
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react26.HStack, { gap: 4, w: "full", children: [
|
|
1836
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react26.Field.Root, { invalid: !!errors.name, flex: 1, children: [
|
|
1837
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react26.Field.Label, { children: t("AbpIdentity::DisplayName:Name") || "Name" }),
|
|
1706
1838
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1707
|
-
|
|
1839
|
+
import_react26.Input,
|
|
1708
1840
|
{
|
|
1709
1841
|
type: "text",
|
|
1710
1842
|
...register("name", {
|
|
@@ -1715,12 +1847,12 @@ function Profile({
|
|
|
1715
1847
|
})
|
|
1716
1848
|
}
|
|
1717
1849
|
),
|
|
1718
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1850
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react26.Field.ErrorText, { children: errors.name?.message })
|
|
1719
1851
|
] }),
|
|
1720
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1721
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1852
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react26.Field.Root, { invalid: !!errors.surname, flex: 1, children: [
|
|
1853
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react26.Field.Label, { children: t("AbpIdentity::DisplayName:Surname") || "Surname" }),
|
|
1722
1854
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1723
|
-
|
|
1855
|
+
import_react26.Input,
|
|
1724
1856
|
{
|
|
1725
1857
|
type: "text",
|
|
1726
1858
|
...register("surname", {
|
|
@@ -1731,16 +1863,16 @@ function Profile({
|
|
|
1731
1863
|
})
|
|
1732
1864
|
}
|
|
1733
1865
|
),
|
|
1734
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1866
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react26.Field.ErrorText, { children: errors.surname?.message })
|
|
1735
1867
|
] })
|
|
1736
1868
|
] }),
|
|
1737
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1738
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1869
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react26.Field.Root, { invalid: !!errors.email, children: [
|
|
1870
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react26.Field.Label, { children: [
|
|
1739
1871
|
t("AbpIdentity::DisplayName:EmailAddress") || "Email Address",
|
|
1740
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1872
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react26.Field.RequiredIndicator, {})
|
|
1741
1873
|
] }),
|
|
1742
1874
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1743
|
-
|
|
1875
|
+
import_react26.Input,
|
|
1744
1876
|
{
|
|
1745
1877
|
type: "email",
|
|
1746
1878
|
...register("email", {
|
|
@@ -1756,12 +1888,12 @@ function Profile({
|
|
|
1756
1888
|
})
|
|
1757
1889
|
}
|
|
1758
1890
|
),
|
|
1759
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1891
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react26.Field.ErrorText, { children: errors.email?.message })
|
|
1760
1892
|
] }),
|
|
1761
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1762
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1893
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react26.Field.Root, { invalid: !!errors.phoneNumber, children: [
|
|
1894
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react26.Field.Label, { children: t("AbpIdentity::DisplayName:PhoneNumber") || "Phone Number" }),
|
|
1763
1895
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1764
|
-
|
|
1896
|
+
import_react26.Input,
|
|
1765
1897
|
{
|
|
1766
1898
|
type: "tel",
|
|
1767
1899
|
...register("phoneNumber", {
|
|
@@ -1772,7 +1904,7 @@ function Profile({
|
|
|
1772
1904
|
})
|
|
1773
1905
|
}
|
|
1774
1906
|
),
|
|
1775
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1907
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react26.Field.ErrorText, { children: errors.phoneNumber?.message })
|
|
1776
1908
|
] })
|
|
1777
1909
|
] }) })
|
|
1778
1910
|
}
|
|
@@ -1780,10 +1912,10 @@ function Profile({
|
|
|
1780
1912
|
}
|
|
1781
1913
|
|
|
1782
1914
|
// src/providers/ThemeSharedProvider.tsx
|
|
1783
|
-
var
|
|
1915
|
+
var import_react29 = require("@chakra-ui/react");
|
|
1784
1916
|
|
|
1785
1917
|
// src/theme/index.ts
|
|
1786
|
-
var
|
|
1918
|
+
var import_react27 = require("@chakra-ui/react");
|
|
1787
1919
|
var colors = {
|
|
1788
1920
|
brand: {
|
|
1789
1921
|
50: { value: "#e3f2fd" },
|
|
@@ -1986,7 +2118,7 @@ var semanticTokens = {
|
|
|
1986
2118
|
// },
|
|
1987
2119
|
// },
|
|
1988
2120
|
};
|
|
1989
|
-
var defaultAbpConfig = (0,
|
|
2121
|
+
var defaultAbpConfig = (0, import_react27.defineConfig)({
|
|
1990
2122
|
theme: {
|
|
1991
2123
|
tokens: {
|
|
1992
2124
|
colors,
|
|
@@ -2008,16 +2140,16 @@ var defaultAbpConfig = (0, import_react26.defineConfig)({
|
|
|
2008
2140
|
});
|
|
2009
2141
|
function createAbpSystem(overrides) {
|
|
2010
2142
|
if (overrides) {
|
|
2011
|
-
return (0,
|
|
2143
|
+
return (0, import_react27.createSystem)(import_react27.defaultConfig, defaultAbpConfig, overrides);
|
|
2012
2144
|
}
|
|
2013
|
-
return (0,
|
|
2145
|
+
return (0, import_react27.createSystem)(import_react27.defaultConfig, defaultAbpConfig);
|
|
2014
2146
|
}
|
|
2015
2147
|
var abpSystem = createAbpSystem();
|
|
2016
2148
|
|
|
2017
2149
|
// src/components/ui/color-mode.tsx
|
|
2018
|
-
var
|
|
2150
|
+
var import_react28 = require("@chakra-ui/react");
|
|
2019
2151
|
var import_next_themes = require("next-themes");
|
|
2020
|
-
var
|
|
2152
|
+
var React11 = __toESM(require("react"));
|
|
2021
2153
|
var import_lucide_react5 = require("lucide-react");
|
|
2022
2154
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2023
2155
|
function ColorModeProvider(props) {
|
|
@@ -2039,10 +2171,10 @@ function ColorModeIcon() {
|
|
|
2039
2171
|
const { colorMode } = useColorMode();
|
|
2040
2172
|
return colorMode === "dark" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react5.Moon, {}) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react5.Sun, {});
|
|
2041
2173
|
}
|
|
2042
|
-
var ColorModeButton =
|
|
2174
|
+
var ColorModeButton = React11.forwardRef(function ColorModeButton2(props, ref) {
|
|
2043
2175
|
const { toggleColorMode } = useColorMode();
|
|
2044
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2045
|
-
|
|
2176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react28.ClientOnly, { fallback: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react28.Skeleton, { boxSize: "9" }), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2177
|
+
import_react28.IconButton,
|
|
2046
2178
|
{
|
|
2047
2179
|
onClick: toggleColorMode,
|
|
2048
2180
|
variant: "ghost",
|
|
@@ -2060,10 +2192,10 @@ var ColorModeButton = React12.forwardRef(function ColorModeButton2(props, ref) {
|
|
|
2060
2192
|
}
|
|
2061
2193
|
) });
|
|
2062
2194
|
});
|
|
2063
|
-
var LightMode =
|
|
2195
|
+
var LightMode = React11.forwardRef(
|
|
2064
2196
|
function LightMode2(props, ref) {
|
|
2065
2197
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2066
|
-
|
|
2198
|
+
import_react28.Span,
|
|
2067
2199
|
{
|
|
2068
2200
|
color: "fg",
|
|
2069
2201
|
display: "contents",
|
|
@@ -2076,10 +2208,10 @@ var LightMode = React12.forwardRef(
|
|
|
2076
2208
|
);
|
|
2077
2209
|
}
|
|
2078
2210
|
);
|
|
2079
|
-
var DarkMode =
|
|
2211
|
+
var DarkMode = React11.forwardRef(
|
|
2080
2212
|
function DarkMode2(props, ref) {
|
|
2081
2213
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2082
|
-
|
|
2214
|
+
import_react28.Span,
|
|
2083
2215
|
{
|
|
2084
2216
|
color: "fg",
|
|
2085
2217
|
display: "contents",
|
|
@@ -2101,35 +2233,65 @@ function ThemeSharedProvider({
|
|
|
2101
2233
|
renderToasts = true,
|
|
2102
2234
|
renderConfirmation = true,
|
|
2103
2235
|
themeOverrides,
|
|
2104
|
-
toastPosition = "bottom-right",
|
|
2236
|
+
toastPosition: _toastPosition = "bottom-right",
|
|
2105
2237
|
enableColorMode = false,
|
|
2106
2238
|
defaultColorMode = "light",
|
|
2107
2239
|
locale = "en-US"
|
|
2108
2240
|
}) {
|
|
2109
2241
|
const system = themeOverrides ? createAbpSystem(themeOverrides) : abpSystem;
|
|
2110
2242
|
const { endSide } = (0, import_core6.useDirection)();
|
|
2111
|
-
|
|
2243
|
+
const resolvedToastPosition = endSide === "left" ? "bottom-left" : "bottom-right";
|
|
2112
2244
|
const content = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ToasterProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(ConfirmationProvider, { children: [
|
|
2113
2245
|
children,
|
|
2114
|
-
renderToasts && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ToastContainer, { position:
|
|
2246
|
+
renderToasts && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ToastContainer, { position: resolvedToastPosition }),
|
|
2115
2247
|
renderConfirmation && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ConfirmationDialog, {})
|
|
2116
2248
|
] }) });
|
|
2117
2249
|
const colorModeProps = enableColorMode ? { defaultTheme: defaultColorMode } : { forcedTheme: "light" };
|
|
2118
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react29.ChakraProvider, { value: system, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react29.LocaleProvider, { locale, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ColorModeProvider, { ...colorModeProps, children: content }) }) });
|
|
2119
2251
|
}
|
|
2120
2252
|
|
|
2121
|
-
// src/
|
|
2122
|
-
var import_react29 = require("react");
|
|
2253
|
+
// src/providers/route.provider.ts
|
|
2123
2254
|
var import_core7 = require("@abpjs/core");
|
|
2255
|
+
|
|
2256
|
+
// src/enums/route-names.ts
|
|
2257
|
+
var eThemeSharedRouteNames = /* @__PURE__ */ ((eThemeSharedRouteNames2) => {
|
|
2258
|
+
eThemeSharedRouteNames2["Administration"] = "AbpUiNavigation::Menu:Administration";
|
|
2259
|
+
return eThemeSharedRouteNames2;
|
|
2260
|
+
})(eThemeSharedRouteNames || {});
|
|
2261
|
+
|
|
2262
|
+
// src/providers/route.provider.ts
|
|
2263
|
+
function configureRoutes(routes) {
|
|
2264
|
+
return () => {
|
|
2265
|
+
routes.add([
|
|
2266
|
+
{
|
|
2267
|
+
name: "AbpUiNavigation::Menu:Administration" /* Administration */,
|
|
2268
|
+
path: "",
|
|
2269
|
+
order: 100,
|
|
2270
|
+
iconClass: "fa fa-wrench"
|
|
2271
|
+
}
|
|
2272
|
+
]);
|
|
2273
|
+
};
|
|
2274
|
+
}
|
|
2275
|
+
var THEME_SHARED_ROUTE_PROVIDERS = {
|
|
2276
|
+
configureRoutes
|
|
2277
|
+
};
|
|
2278
|
+
function initializeThemeSharedRoutes() {
|
|
2279
|
+
const routesService = (0, import_core7.getRoutesService)();
|
|
2280
|
+
configureRoutes(routesService)();
|
|
2281
|
+
}
|
|
2282
|
+
|
|
2283
|
+
// src/handlers/lazy-style.handler.ts
|
|
2284
|
+
var import_react30 = require("react");
|
|
2285
|
+
var import_core8 = require("@abpjs/core");
|
|
2124
2286
|
function createLazyStyleHref(style, dir) {
|
|
2125
2287
|
return style.replace("{{dir}}", dir);
|
|
2126
2288
|
}
|
|
2127
2289
|
function useLazyStyleHandler(options = {}) {
|
|
2128
2290
|
const { styles = [BOOTSTRAP], initialDirection = "ltr" } = options;
|
|
2129
|
-
const [direction, setDirection] = (0,
|
|
2130
|
-
const lazyLoadRef = (0,
|
|
2131
|
-
const loadedStylesRef = (0,
|
|
2132
|
-
(0,
|
|
2291
|
+
const [direction, setDirection] = (0, import_react30.useState)(initialDirection);
|
|
2292
|
+
const lazyLoadRef = (0, import_react30.useRef)(new import_core8.LazyLoadService());
|
|
2293
|
+
const loadedStylesRef = (0, import_react30.useRef)(/* @__PURE__ */ new Map());
|
|
2294
|
+
(0, import_react30.useEffect)(() => {
|
|
2133
2295
|
document.body.dir = direction;
|
|
2134
2296
|
const switchCSS = async () => {
|
|
2135
2297
|
const lazyLoad = lazyLoadRef.current;
|
|
@@ -2256,44 +2418,6 @@ function injectThemeSharedStyles() {
|
|
|
2256
2418
|
};
|
|
2257
2419
|
}
|
|
2258
2420
|
|
|
2259
|
-
// src/utils/nav-items.ts
|
|
2260
|
-
var navItems = [];
|
|
2261
|
-
var subscribers = /* @__PURE__ */ new Set();
|
|
2262
|
-
function addNavItem(item) {
|
|
2263
|
-
navItems = [...navItems, item].sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
|
2264
|
-
notifySubscribers();
|
|
2265
|
-
}
|
|
2266
|
-
function removeNavItem(item) {
|
|
2267
|
-
navItems = navItems.filter((i) => i !== item);
|
|
2268
|
-
notifySubscribers();
|
|
2269
|
-
}
|
|
2270
|
-
function clearNavItems() {
|
|
2271
|
-
navItems = [];
|
|
2272
|
-
notifySubscribers();
|
|
2273
|
-
}
|
|
2274
|
-
function getNavItemsSync() {
|
|
2275
|
-
return [...navItems];
|
|
2276
|
-
}
|
|
2277
|
-
function subscribeToNavItems(callback) {
|
|
2278
|
-
subscribers.add(callback);
|
|
2279
|
-
callback([...navItems]);
|
|
2280
|
-
return () => {
|
|
2281
|
-
subscribers.delete(callback);
|
|
2282
|
-
};
|
|
2283
|
-
}
|
|
2284
|
-
function notifySubscribers() {
|
|
2285
|
-
const currentItems = [...navItems];
|
|
2286
|
-
subscribers.forEach((callback) => callback(currentItems));
|
|
2287
|
-
}
|
|
2288
|
-
function getNavItems() {
|
|
2289
|
-
return {
|
|
2290
|
-
subscribe: (callback) => {
|
|
2291
|
-
const unsubscribe = subscribeToNavItems(callback);
|
|
2292
|
-
return { unsubscribe };
|
|
2293
|
-
}
|
|
2294
|
-
};
|
|
2295
|
-
}
|
|
2296
|
-
|
|
2297
2421
|
// src/utils/validation-utils.ts
|
|
2298
2422
|
var PASSWORD_SETTING_KEYS = {
|
|
2299
2423
|
requiredLength: "Abp.Identity.Password.RequiredLength",
|
|
@@ -2436,26 +2560,26 @@ function getPasswordValidationRules(store) {
|
|
|
2436
2560
|
ModalFooter,
|
|
2437
2561
|
ModalHeader,
|
|
2438
2562
|
ModalProvider,
|
|
2563
|
+
NavItemsService,
|
|
2439
2564
|
PASSWORD_SETTING_KEYS,
|
|
2440
2565
|
Profile,
|
|
2441
2566
|
THEME_SHARED_APPEND_CONTENT,
|
|
2567
|
+
THEME_SHARED_ROUTE_PROVIDERS,
|
|
2442
2568
|
THEME_SHARED_STYLES,
|
|
2443
2569
|
ThemeSharedAppendContentContext,
|
|
2444
2570
|
ThemeSharedProvider,
|
|
2445
2571
|
ToastContainer,
|
|
2446
|
-
Toaster,
|
|
2447
2572
|
ToasterProvider,
|
|
2448
2573
|
abpSystem,
|
|
2449
|
-
|
|
2450
|
-
clearNavItems,
|
|
2574
|
+
configureRoutes,
|
|
2451
2575
|
createAbpSystem,
|
|
2452
2576
|
createErrorInterceptor,
|
|
2453
2577
|
createLazyStyleHref,
|
|
2454
2578
|
defaultAbpConfig,
|
|
2455
2579
|
defineConfig,
|
|
2580
|
+
eThemeSharedRouteNames,
|
|
2456
2581
|
getLoadedBootstrapDirection,
|
|
2457
|
-
|
|
2458
|
-
getNavItemsSync,
|
|
2582
|
+
getNavItemsService,
|
|
2459
2583
|
getPasswordSettings,
|
|
2460
2584
|
getPasswordValidationRules,
|
|
2461
2585
|
getPasswordValidators,
|
|
@@ -2464,9 +2588,8 @@ function getPasswordValidationRules(store) {
|
|
|
2464
2588
|
getSeverityColorScheme,
|
|
2465
2589
|
httpErrorConfigFactory,
|
|
2466
2590
|
initLazyStyleHandler,
|
|
2591
|
+
initializeThemeSharedRoutes,
|
|
2467
2592
|
injectThemeSharedStyles,
|
|
2468
|
-
removeNavItem,
|
|
2469
|
-
subscribeToNavItems,
|
|
2470
2593
|
useConfirmation,
|
|
2471
2594
|
useConfirmationContext,
|
|
2472
2595
|
useConfirmationState,
|
|
@@ -2477,6 +2600,7 @@ function getPasswordValidationRules(store) {
|
|
|
2477
2600
|
useModal,
|
|
2478
2601
|
useModalContext,
|
|
2479
2602
|
useModalState,
|
|
2603
|
+
useNavItems,
|
|
2480
2604
|
useToaster,
|
|
2481
2605
|
useToasterContext,
|
|
2482
2606
|
useToasts
|