@famgia/omnify-react-sso 2.2.6 → 2.2.7
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/ant/index.cjs +644 -495
- package/dist/ant/index.cjs.map +1 -1
- package/dist/ant/index.d.cts +43 -1
- package/dist/ant/index.d.ts +43 -1
- package/dist/ant/index.js +502 -354
- package/dist/ant/index.js.map +1 -1
- package/dist/index.cjs +680 -505
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -1
- package/dist/index.d.ts +40 -1
- package/dist/index.js +526 -356
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/ant/index.cjs
CHANGED
|
@@ -34,6 +34,7 @@ __export(ant_exports, {
|
|
|
34
34
|
BranchGate: () => BranchGate,
|
|
35
35
|
LocaleSwitcher: () => LocaleSwitcher,
|
|
36
36
|
OrgBranchSelectorModal: () => OrgBranchSelectorModal,
|
|
37
|
+
OrgGate: () => OrgGate,
|
|
37
38
|
OrganizationSwitcher: () => OrganizationSwitcher,
|
|
38
39
|
PROTABLE_DEFAULT_TEXTS: () => DEFAULT_TEXTS,
|
|
39
40
|
PageContainer: () => PageContainer,
|
|
@@ -889,13 +890,160 @@ function OrgBranchSelectorModal({
|
|
|
889
890
|
);
|
|
890
891
|
}
|
|
891
892
|
|
|
892
|
-
// src/ant/components/
|
|
893
|
-
var import_react8 = __toESM(require("react"), 1);
|
|
893
|
+
// src/ant/components/OrgGate/OrgGate.tsx
|
|
894
894
|
var import_antd3 = require("antd");
|
|
895
|
+
var import_react9 = require("react");
|
|
896
|
+
|
|
897
|
+
// src/core/utils/orgSync.ts
|
|
898
|
+
var _currentOrgId = null;
|
|
899
|
+
var ORG_ID_STORAGE_KEY = "api_current_org_id";
|
|
900
|
+
function setOrgIdForApi(orgId) {
|
|
901
|
+
_currentOrgId = orgId;
|
|
902
|
+
if (typeof window === "undefined") return;
|
|
903
|
+
if (orgId) {
|
|
904
|
+
localStorage.setItem(ORG_ID_STORAGE_KEY, orgId);
|
|
905
|
+
} else {
|
|
906
|
+
localStorage.removeItem(ORG_ID_STORAGE_KEY);
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
// src/core/hooks/useSso.ts
|
|
911
|
+
var import_react8 = require("react");
|
|
912
|
+
function useSso() {
|
|
913
|
+
const context = useSsoContext();
|
|
914
|
+
return (0, import_react8.useMemo)(
|
|
915
|
+
() => ({
|
|
916
|
+
// Auth
|
|
917
|
+
user: context.user,
|
|
918
|
+
isLoading: context.isLoading,
|
|
919
|
+
isAuthenticated: context.isAuthenticated,
|
|
920
|
+
login: context.login,
|
|
921
|
+
logout: context.logout,
|
|
922
|
+
globalLogout: context.globalLogout,
|
|
923
|
+
refreshUser: context.refreshUser,
|
|
924
|
+
// Organization
|
|
925
|
+
organizations: context.organizations,
|
|
926
|
+
currentOrg: context.currentOrg,
|
|
927
|
+
hasMultipleOrgs: context.organizations.length > 1,
|
|
928
|
+
switchOrg: context.switchOrg,
|
|
929
|
+
// Utilities
|
|
930
|
+
getHeaders: context.getHeaders,
|
|
931
|
+
config: context.config
|
|
932
|
+
}),
|
|
933
|
+
[context]
|
|
934
|
+
);
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
// src/ant/components/OrgGate/OrgGate.tsx
|
|
938
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
939
|
+
var { Text: Text3 } = import_antd3.Typography;
|
|
940
|
+
var defaultTranslations = {
|
|
941
|
+
selectOrgTitle: "\u7D44\u7E54\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
942
|
+
confirmText: "\u9078\u629E",
|
|
943
|
+
selectPlaceholder: "\u7D44\u7E54\u3092\u9078\u629E",
|
|
944
|
+
noOrgsMessage: "\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u7D44\u7E54\u304C\u3042\u308A\u307E\u305B\u3093"
|
|
945
|
+
};
|
|
946
|
+
function OrgGate({
|
|
947
|
+
children,
|
|
948
|
+
translations: customTranslations,
|
|
949
|
+
loadingComponent,
|
|
950
|
+
onOrgChange
|
|
951
|
+
}) {
|
|
952
|
+
const t = { ...defaultTranslations, ...customTranslations };
|
|
953
|
+
const { isLoading: ssoLoading, isAuthenticated } = useSso();
|
|
954
|
+
const { organizations, currentOrg, switchOrg } = useOrganization();
|
|
955
|
+
const [selectedOrgSlug, setSelectedOrgSlug] = (0, import_react9.useState)(void 0);
|
|
956
|
+
(0, import_react9.useEffect)(() => {
|
|
957
|
+
if (!ssoLoading && isAuthenticated && organizations.length === 1 && !currentOrg) {
|
|
958
|
+
switchOrg(organizations[0].slug);
|
|
959
|
+
}
|
|
960
|
+
}, [ssoLoading, isAuthenticated, organizations, currentOrg, switchOrg]);
|
|
961
|
+
if (currentOrg?.slug) {
|
|
962
|
+
setOrgIdForApi(currentOrg.slug);
|
|
963
|
+
if (onOrgChange) {
|
|
964
|
+
onOrgChange(currentOrg.slug);
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
if (ssoLoading) {
|
|
968
|
+
if (loadingComponent) {
|
|
969
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: loadingComponent });
|
|
970
|
+
}
|
|
971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
972
|
+
"div",
|
|
973
|
+
{
|
|
974
|
+
style: {
|
|
975
|
+
display: "flex",
|
|
976
|
+
justifyContent: "center",
|
|
977
|
+
alignItems: "center",
|
|
978
|
+
minHeight: "100vh"
|
|
979
|
+
},
|
|
980
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_antd3.Spin, { size: "large" })
|
|
981
|
+
}
|
|
982
|
+
);
|
|
983
|
+
}
|
|
984
|
+
if (!isAuthenticated) {
|
|
985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children });
|
|
986
|
+
}
|
|
987
|
+
if (organizations.length === 0) {
|
|
988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
989
|
+
"div",
|
|
990
|
+
{
|
|
991
|
+
style: {
|
|
992
|
+
display: "flex",
|
|
993
|
+
justifyContent: "center",
|
|
994
|
+
alignItems: "center",
|
|
995
|
+
minHeight: "100vh",
|
|
996
|
+
flexDirection: "column",
|
|
997
|
+
gap: 16
|
|
998
|
+
},
|
|
999
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text3, { type: "secondary", children: t.noOrgsMessage })
|
|
1000
|
+
}
|
|
1001
|
+
);
|
|
1002
|
+
}
|
|
1003
|
+
if (currentOrg) {
|
|
1004
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children });
|
|
1005
|
+
}
|
|
1006
|
+
const handleConfirm = () => {
|
|
1007
|
+
if (selectedOrgSlug) {
|
|
1008
|
+
switchOrg(selectedOrgSlug);
|
|
1009
|
+
}
|
|
1010
|
+
};
|
|
1011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1012
|
+
import_antd3.Modal,
|
|
1013
|
+
{
|
|
1014
|
+
open: true,
|
|
1015
|
+
closable: false,
|
|
1016
|
+
maskClosable: false,
|
|
1017
|
+
title: t.selectOrgTitle,
|
|
1018
|
+
okText: t.confirmText,
|
|
1019
|
+
okButtonProps: { disabled: !selectedOrgSlug },
|
|
1020
|
+
onOk: handleConfirm,
|
|
1021
|
+
cancelButtonProps: { style: { display: "none" } },
|
|
1022
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { marginTop: 16 }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1023
|
+
import_antd3.Select,
|
|
1024
|
+
{
|
|
1025
|
+
placeholder: t.selectPlaceholder,
|
|
1026
|
+
style: { width: "100%" },
|
|
1027
|
+
value: selectedOrgSlug,
|
|
1028
|
+
onChange: setSelectedOrgSlug,
|
|
1029
|
+
options: organizations.map((org) => ({
|
|
1030
|
+
value: org.slug,
|
|
1031
|
+
label: org.name
|
|
1032
|
+
})),
|
|
1033
|
+
size: "large"
|
|
1034
|
+
}
|
|
1035
|
+
) })
|
|
1036
|
+
}
|
|
1037
|
+
);
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
// src/ant/components/BranchGate/BranchGate.tsx
|
|
1041
|
+
var import_react10 = __toESM(require("react"), 1);
|
|
1042
|
+
var import_antd4 = require("antd");
|
|
895
1043
|
var import_icons3 = require("@ant-design/icons");
|
|
896
1044
|
var import_react_query2 = require("@tanstack/react-query");
|
|
897
|
-
var
|
|
898
|
-
var { Text:
|
|
1045
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1046
|
+
var { Text: Text4, Title: Title2 } = import_antd4.Typography;
|
|
899
1047
|
var DEFAULT_STORAGE_KEY = "omnify_branch_gate_selection";
|
|
900
1048
|
function BranchGate({
|
|
901
1049
|
children,
|
|
@@ -907,15 +1055,15 @@ function BranchGate({
|
|
|
907
1055
|
}) {
|
|
908
1056
|
const { config, isAuthenticated } = useSsoContext();
|
|
909
1057
|
const { organizations, currentOrg, hasMultipleOrgs } = useOrganization();
|
|
910
|
-
const [storedSelection, setStoredSelection] = (0,
|
|
911
|
-
const [isInitialized, setIsInitialized] = (0,
|
|
912
|
-
const [tempOrgId, setTempOrgId] = (0,
|
|
913
|
-
const [tempBranchId, setTempBranchId] = (0,
|
|
914
|
-
const branchService =
|
|
1058
|
+
const [storedSelection, setStoredSelection] = (0, import_react10.useState)(null);
|
|
1059
|
+
const [isInitialized, setIsInitialized] = (0, import_react10.useState)(false);
|
|
1060
|
+
const [tempOrgId, setTempOrgId] = (0, import_react10.useState)(null);
|
|
1061
|
+
const [tempBranchId, setTempBranchId] = (0, import_react10.useState)(null);
|
|
1062
|
+
const branchService = import_react10.default.useMemo(
|
|
915
1063
|
() => createBranchService({ apiUrl: config.apiUrl }),
|
|
916
1064
|
[config.apiUrl]
|
|
917
1065
|
);
|
|
918
|
-
const activeOrgSlug =
|
|
1066
|
+
const activeOrgSlug = import_react10.default.useMemo(() => {
|
|
919
1067
|
if (tempOrgId) {
|
|
920
1068
|
return organizations.find((o) => String(o.id) === tempOrgId)?.slug;
|
|
921
1069
|
}
|
|
@@ -928,7 +1076,7 @@ function BranchGate({
|
|
|
928
1076
|
});
|
|
929
1077
|
const branches = branchesData?.branches ?? [];
|
|
930
1078
|
const hasMultipleBranches = branches.length > 1;
|
|
931
|
-
(0,
|
|
1079
|
+
(0, import_react10.useEffect)(() => {
|
|
932
1080
|
if (typeof window === "undefined") return;
|
|
933
1081
|
const saved = localStorage.getItem(storageKey);
|
|
934
1082
|
if (saved) {
|
|
@@ -942,13 +1090,13 @@ function BranchGate({
|
|
|
942
1090
|
}
|
|
943
1091
|
setIsInitialized(true);
|
|
944
1092
|
}, [storageKey, onSelectionChange]);
|
|
945
|
-
(0,
|
|
1093
|
+
(0, import_react10.useEffect)(() => {
|
|
946
1094
|
if (!isAuthenticated || !isInitialized || storedSelection) return;
|
|
947
1095
|
if (organizations.length === 1 && !tempOrgId) {
|
|
948
1096
|
setTempOrgId(String(organizations[0].id));
|
|
949
1097
|
}
|
|
950
1098
|
}, [isAuthenticated, isInitialized, organizations, storedSelection, tempOrgId]);
|
|
951
|
-
(0,
|
|
1099
|
+
(0, import_react10.useEffect)(() => {
|
|
952
1100
|
if (!tempOrgId || branchesLoading || storedSelection) return;
|
|
953
1101
|
if (branches.length === 1 && !tempBranchId) {
|
|
954
1102
|
setTempBranchId(String(branches[0].id));
|
|
@@ -964,14 +1112,14 @@ function BranchGate({
|
|
|
964
1112
|
}
|
|
965
1113
|
}
|
|
966
1114
|
}, [tempOrgId, branches, branchesLoading, branchesData, storedSelection, tempBranchId]);
|
|
967
|
-
(0,
|
|
1115
|
+
(0, import_react10.useEffect)(() => {
|
|
968
1116
|
if (storedSelection || !isInitialized) return;
|
|
969
1117
|
if (!tempOrgId || !tempBranchId || branchesLoading) return;
|
|
970
1118
|
if (!hasMultipleOrgs && !hasMultipleBranches) {
|
|
971
1119
|
confirmSelection();
|
|
972
1120
|
}
|
|
973
1121
|
}, [tempOrgId, tempBranchId, branchesLoading, hasMultipleOrgs, hasMultipleBranches, storedSelection, isInitialized]);
|
|
974
|
-
const confirmSelection =
|
|
1122
|
+
const confirmSelection = import_react10.default.useCallback(() => {
|
|
975
1123
|
if (!tempOrgId || !tempBranchId) return;
|
|
976
1124
|
const org = organizations.find((o) => String(o.id) === tempOrgId);
|
|
977
1125
|
const branch = branches.find((b) => String(b.id) === tempBranchId);
|
|
@@ -989,7 +1137,7 @@ function BranchGate({
|
|
|
989
1137
|
setTempOrgId(null);
|
|
990
1138
|
setTempBranchId(null);
|
|
991
1139
|
}, [tempOrgId, tempBranchId, organizations, branches, storageKey, onSelectionChange]);
|
|
992
|
-
const clearSelection =
|
|
1140
|
+
const clearSelection = import_react10.default.useCallback(() => {
|
|
993
1141
|
localStorage.removeItem(storageKey);
|
|
994
1142
|
setStoredSelection(null);
|
|
995
1143
|
onSelectionChange?.(null);
|
|
@@ -998,26 +1146,26 @@ function BranchGate({
|
|
|
998
1146
|
const isLoading = !isAuthenticated || !isInitialized || !!activeOrgSlug && branchesLoading && !storedSelection;
|
|
999
1147
|
if (isLoading && !needsSelection) {
|
|
1000
1148
|
if (loadingComponent) {
|
|
1001
|
-
return /* @__PURE__ */ (0,
|
|
1149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: loadingComponent });
|
|
1002
1150
|
}
|
|
1003
|
-
return /* @__PURE__ */ (0,
|
|
1151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: {
|
|
1004
1152
|
display: "flex",
|
|
1005
1153
|
justifyContent: "center",
|
|
1006
1154
|
alignItems: "center",
|
|
1007
1155
|
minHeight: "100vh",
|
|
1008
1156
|
background: "linear-gradient(135deg, #667eea 0%, #764ba2 100%)"
|
|
1009
|
-
}, children: /* @__PURE__ */ (0,
|
|
1157
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_antd4.Spin, { size: "large" }) });
|
|
1010
1158
|
}
|
|
1011
1159
|
if (needsSelection) {
|
|
1012
1160
|
const canConfirm = tempOrgId && tempBranchId;
|
|
1013
|
-
return /* @__PURE__ */ (0,
|
|
1161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: {
|
|
1014
1162
|
minHeight: "100vh",
|
|
1015
1163
|
background: "linear-gradient(135deg, #667eea 0%, #764ba2 100%)",
|
|
1016
1164
|
display: "flex",
|
|
1017
1165
|
alignItems: "center",
|
|
1018
1166
|
justifyContent: "center",
|
|
1019
1167
|
padding: 24
|
|
1020
|
-
}, children: /* @__PURE__ */ (0,
|
|
1168
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: {
|
|
1021
1169
|
background: "#fff",
|
|
1022
1170
|
borderRadius: 16,
|
|
1023
1171
|
padding: 32,
|
|
@@ -1025,8 +1173,8 @@ function BranchGate({
|
|
|
1025
1173
|
width: "100%",
|
|
1026
1174
|
boxShadow: "0 20px 60px rgba(0,0,0,0.3)"
|
|
1027
1175
|
}, children: [
|
|
1028
|
-
/* @__PURE__ */ (0,
|
|
1029
|
-
/* @__PURE__ */ (0,
|
|
1176
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { textAlign: "center", marginBottom: 24 }, children: [
|
|
1177
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: {
|
|
1030
1178
|
width: 64,
|
|
1031
1179
|
height: 64,
|
|
1032
1180
|
borderRadius: "50%",
|
|
@@ -1035,18 +1183,18 @@ function BranchGate({
|
|
|
1035
1183
|
alignItems: "center",
|
|
1036
1184
|
justifyContent: "center",
|
|
1037
1185
|
margin: "0 auto 16px"
|
|
1038
|
-
}, children: /* @__PURE__ */ (0,
|
|
1039
|
-
/* @__PURE__ */ (0,
|
|
1040
|
-
/* @__PURE__ */ (0,
|
|
1186
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons3.BankOutlined, { style: { fontSize: 28, color: "#fff" } }) }),
|
|
1187
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Title2, { level: 3, style: { margin: 0 }, children: title ?? "Select Organization" }),
|
|
1188
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text4, { type: "secondary", children: description ?? "Please select your organization and branch to continue" })
|
|
1041
1189
|
] }),
|
|
1042
|
-
/* @__PURE__ */ (0,
|
|
1043
|
-
/* @__PURE__ */ (0,
|
|
1044
|
-
/* @__PURE__ */ (0,
|
|
1045
|
-
/* @__PURE__ */ (0,
|
|
1046
|
-
!hasMultipleOrgs && /* @__PURE__ */ (0,
|
|
1190
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { marginBottom: 20 }, children: [
|
|
1191
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text4, { strong: true, style: { display: "block", marginBottom: 8 }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_antd4.Space, { children: [
|
|
1192
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons3.BankOutlined, {}),
|
|
1193
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "Organization" }),
|
|
1194
|
+
!hasMultipleOrgs && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_antd4.Badge, { status: "success", text: "Auto-selected" })
|
|
1047
1195
|
] }) }),
|
|
1048
|
-
hasMultipleOrgs ? /* @__PURE__ */ (0,
|
|
1049
|
-
|
|
1196
|
+
hasMultipleOrgs ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1197
|
+
import_antd4.Select,
|
|
1050
1198
|
{
|
|
1051
1199
|
value: tempOrgId,
|
|
1052
1200
|
onChange: (value) => {
|
|
@@ -1057,36 +1205,36 @@ function BranchGate({
|
|
|
1057
1205
|
size: "large",
|
|
1058
1206
|
style: { width: "100%" },
|
|
1059
1207
|
optionLabelProp: "label",
|
|
1060
|
-
children: organizations.map((org) => /* @__PURE__ */ (0,
|
|
1061
|
-
/* @__PURE__ */ (0,
|
|
1062
|
-
org.serviceRole && /* @__PURE__ */ (0,
|
|
1208
|
+
children: organizations.map((org) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_antd4.Select.Option, { value: String(org.id), label: org.name, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_antd4.Space, { style: { width: "100%", justifyContent: "space-between" }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
|
|
1209
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text4, { strong: true, children: org.name }),
|
|
1210
|
+
org.serviceRole && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text4, { type: "secondary", style: { marginLeft: 8, fontSize: 12 }, children: [
|
|
1063
1211
|
"(",
|
|
1064
1212
|
org.serviceRole,
|
|
1065
1213
|
")"
|
|
1066
1214
|
] })
|
|
1067
1215
|
] }) }) }, org.id))
|
|
1068
1216
|
}
|
|
1069
|
-
) : /* @__PURE__ */ (0,
|
|
1217
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: {
|
|
1070
1218
|
padding: "8px 12px",
|
|
1071
1219
|
background: "#f5f5f5",
|
|
1072
1220
|
borderRadius: 6,
|
|
1073
1221
|
border: "1px solid #d9d9d9"
|
|
1074
|
-
}, children: /* @__PURE__ */ (0,
|
|
1075
|
-
/* @__PURE__ */ (0,
|
|
1076
|
-
/* @__PURE__ */ (0,
|
|
1222
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_antd4.Space, { children: [
|
|
1223
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons3.BankOutlined, { style: { color: "#1677ff" } }),
|
|
1224
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text4, { strong: true, children: organizations[0]?.name })
|
|
1077
1225
|
] }) })
|
|
1078
1226
|
] }),
|
|
1079
|
-
tempOrgId && /* @__PURE__ */ (0,
|
|
1080
|
-
/* @__PURE__ */ (0,
|
|
1081
|
-
/* @__PURE__ */ (0,
|
|
1082
|
-
/* @__PURE__ */ (0,
|
|
1083
|
-
!hasMultipleBranches && branches.length === 1 && /* @__PURE__ */ (0,
|
|
1227
|
+
tempOrgId && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { marginBottom: 24 }, children: [
|
|
1228
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text4, { strong: true, style: { display: "block", marginBottom: 8 }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_antd4.Space, { children: [
|
|
1229
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons3.ApartmentOutlined, {}),
|
|
1230
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "Branch" }),
|
|
1231
|
+
!hasMultipleBranches && branches.length === 1 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_antd4.Badge, { status: "success", text: "Auto-selected" })
|
|
1084
1232
|
] }) }),
|
|
1085
|
-
branchesLoading ? /* @__PURE__ */ (0,
|
|
1086
|
-
/* @__PURE__ */ (0,
|
|
1087
|
-
/* @__PURE__ */ (0,
|
|
1088
|
-
] }) : hasMultipleBranches ? /* @__PURE__ */ (0,
|
|
1089
|
-
|
|
1233
|
+
branchesLoading ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { padding: "12px", textAlign: "center" }, children: [
|
|
1234
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_antd4.Spin, { size: "small" }),
|
|
1235
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text4, { type: "secondary", style: { marginLeft: 8 }, children: "Loading..." })
|
|
1236
|
+
] }) : hasMultipleBranches ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1237
|
+
import_antd4.Select,
|
|
1090
1238
|
{
|
|
1091
1239
|
value: tempBranchId,
|
|
1092
1240
|
onChange: (value) => setTempBranchId(String(value)),
|
|
@@ -1094,32 +1242,32 @@ function BranchGate({
|
|
|
1094
1242
|
size: "large",
|
|
1095
1243
|
style: { width: "100%" },
|
|
1096
1244
|
optionLabelProp: "label",
|
|
1097
|
-
children: branches.map((branch) => /* @__PURE__ */ (0,
|
|
1098
|
-
/* @__PURE__ */ (0,
|
|
1099
|
-
/* @__PURE__ */ (0,
|
|
1100
|
-
/* @__PURE__ */ (0,
|
|
1245
|
+
children: branches.map((branch) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_antd4.Select.Option, { value: String(branch.id), label: branch.name, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_antd4.Space, { style: { width: "100%", justifyContent: "space-between" }, children: [
|
|
1246
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
|
|
1247
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text4, { strong: true, children: branch.name }),
|
|
1248
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text4, { type: "secondary", style: { marginLeft: 8, fontSize: 12 }, children: branch.code })
|
|
1101
1249
|
] }),
|
|
1102
|
-
/* @__PURE__ */ (0,
|
|
1103
|
-
branch.is_headquarters && /* @__PURE__ */ (0,
|
|
1104
|
-
branch.is_primary && /* @__PURE__ */ (0,
|
|
1250
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_antd4.Space, { size: 4, children: [
|
|
1251
|
+
branch.is_headquarters && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_antd4.Badge, { color: "blue", text: "HQ" }),
|
|
1252
|
+
branch.is_primary && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_antd4.Badge, { color: "green", text: "Primary" })
|
|
1105
1253
|
] })
|
|
1106
1254
|
] }) }, branch.id))
|
|
1107
1255
|
}
|
|
1108
|
-
) : branches.length === 1 ? /* @__PURE__ */ (0,
|
|
1256
|
+
) : branches.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: {
|
|
1109
1257
|
padding: "8px 12px",
|
|
1110
1258
|
background: "#f5f5f5",
|
|
1111
1259
|
borderRadius: 6,
|
|
1112
1260
|
border: "1px solid #d9d9d9"
|
|
1113
|
-
}, children: /* @__PURE__ */ (0,
|
|
1114
|
-
/* @__PURE__ */ (0,
|
|
1115
|
-
/* @__PURE__ */ (0,
|
|
1116
|
-
/* @__PURE__ */ (0,
|
|
1261
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_antd4.Space, { children: [
|
|
1262
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons3.ApartmentOutlined, { style: { color: "#1677ff" } }),
|
|
1263
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text4, { strong: true, children: branches[0].name }),
|
|
1264
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text4, { type: "secondary", children: [
|
|
1117
1265
|
"(",
|
|
1118
1266
|
branches[0].code,
|
|
1119
1267
|
")"
|
|
1120
1268
|
] })
|
|
1121
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
1122
|
-
|
|
1269
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1270
|
+
import_antd4.Alert,
|
|
1123
1271
|
{
|
|
1124
1272
|
type: "warning",
|
|
1125
1273
|
message: "No branches available",
|
|
@@ -1127,15 +1275,15 @@ function BranchGate({
|
|
|
1127
1275
|
}
|
|
1128
1276
|
)
|
|
1129
1277
|
] }),
|
|
1130
|
-
/* @__PURE__ */ (0,
|
|
1131
|
-
|
|
1278
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1279
|
+
import_antd4.Button,
|
|
1132
1280
|
{
|
|
1133
1281
|
type: "primary",
|
|
1134
1282
|
size: "large",
|
|
1135
1283
|
block: true,
|
|
1136
1284
|
disabled: !canConfirm,
|
|
1137
1285
|
onClick: confirmSelection,
|
|
1138
|
-
icon: /* @__PURE__ */ (0,
|
|
1286
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons3.CheckCircleFilled, {}),
|
|
1139
1287
|
style: {
|
|
1140
1288
|
height: 48,
|
|
1141
1289
|
fontSize: 16,
|
|
@@ -1147,11 +1295,11 @@ function BranchGate({
|
|
|
1147
1295
|
)
|
|
1148
1296
|
] }) });
|
|
1149
1297
|
}
|
|
1150
|
-
return /* @__PURE__ */ (0,
|
|
1298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children });
|
|
1151
1299
|
}
|
|
1152
1300
|
function useBranchGate(storageKey = DEFAULT_STORAGE_KEY) {
|
|
1153
|
-
const [selection, setSelection] = (0,
|
|
1154
|
-
(0,
|
|
1301
|
+
const [selection, setSelection] = (0, import_react10.useState)(null);
|
|
1302
|
+
(0, import_react10.useEffect)(() => {
|
|
1155
1303
|
if (typeof window === "undefined") return;
|
|
1156
1304
|
const saved = localStorage.getItem(storageKey);
|
|
1157
1305
|
if (saved) {
|
|
@@ -1176,7 +1324,7 @@ function useBranchGate(storageKey = DEFAULT_STORAGE_KEY) {
|
|
|
1176
1324
|
window.addEventListener("storage", handleStorage);
|
|
1177
1325
|
return () => window.removeEventListener("storage", handleStorage);
|
|
1178
1326
|
}, [storageKey]);
|
|
1179
|
-
const clearSelection =
|
|
1327
|
+
const clearSelection = import_react10.default.useCallback(() => {
|
|
1180
1328
|
localStorage.removeItem(storageKey);
|
|
1181
1329
|
setSelection(null);
|
|
1182
1330
|
}, [storageKey]);
|
|
@@ -1191,11 +1339,11 @@ function useBranchGate(storageKey = DEFAULT_STORAGE_KEY) {
|
|
|
1191
1339
|
// src/ant/components/ProTable/ProTable.tsx
|
|
1192
1340
|
var import_icons4 = require("@ant-design/icons");
|
|
1193
1341
|
var import_react_query3 = require("@tanstack/react-query");
|
|
1194
|
-
var
|
|
1195
|
-
var
|
|
1196
|
-
var
|
|
1197
|
-
var { Link } =
|
|
1198
|
-
var { RangePicker } =
|
|
1342
|
+
var import_antd5 = require("antd");
|
|
1343
|
+
var import_react11 = require("react");
|
|
1344
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1345
|
+
var { Link } = import_antd5.Typography;
|
|
1346
|
+
var { RangePicker } = import_antd5.DatePicker;
|
|
1199
1347
|
var InertiaLink = null;
|
|
1200
1348
|
try {
|
|
1201
1349
|
InertiaLink = require("@inertiajs/react").Link;
|
|
@@ -1234,8 +1382,8 @@ var DEFAULT_STATUS_CONFIG = {
|
|
|
1234
1382
|
function renderSearchField(field, texts) {
|
|
1235
1383
|
switch (field.type) {
|
|
1236
1384
|
case "select":
|
|
1237
|
-
return /* @__PURE__ */ (0,
|
|
1238
|
-
|
|
1385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1386
|
+
import_antd5.Select,
|
|
1239
1387
|
{
|
|
1240
1388
|
allowClear: true,
|
|
1241
1389
|
placeholder: field.placeholder || texts.selectPlaceholder,
|
|
@@ -1244,15 +1392,15 @@ function renderSearchField(field, texts) {
|
|
|
1244
1392
|
}
|
|
1245
1393
|
);
|
|
1246
1394
|
case "date":
|
|
1247
|
-
return /* @__PURE__ */ (0,
|
|
1248
|
-
|
|
1395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1396
|
+
import_antd5.DatePicker,
|
|
1249
1397
|
{
|
|
1250
1398
|
placeholder: field.placeholder,
|
|
1251
1399
|
style: { width: "100%" }
|
|
1252
1400
|
}
|
|
1253
1401
|
);
|
|
1254
1402
|
case "dateRange":
|
|
1255
|
-
return /* @__PURE__ */ (0,
|
|
1403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1256
1404
|
RangePicker,
|
|
1257
1405
|
{
|
|
1258
1406
|
placeholder: [texts.startDate, texts.endDate],
|
|
@@ -1260,16 +1408,16 @@ function renderSearchField(field, texts) {
|
|
|
1260
1408
|
}
|
|
1261
1409
|
);
|
|
1262
1410
|
case "number":
|
|
1263
|
-
return /* @__PURE__ */ (0,
|
|
1264
|
-
|
|
1411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1412
|
+
import_antd5.InputNumber,
|
|
1265
1413
|
{
|
|
1266
1414
|
placeholder: field.placeholder,
|
|
1267
1415
|
style: { width: "100%" }
|
|
1268
1416
|
}
|
|
1269
1417
|
);
|
|
1270
1418
|
default:
|
|
1271
|
-
return /* @__PURE__ */ (0,
|
|
1272
|
-
|
|
1419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1420
|
+
import_antd5.Input,
|
|
1273
1421
|
{
|
|
1274
1422
|
allowClear: true,
|
|
1275
1423
|
placeholder: field.placeholder || texts.inputPlaceholder
|
|
@@ -1279,9 +1427,9 @@ function renderSearchField(field, texts) {
|
|
|
1279
1427
|
}
|
|
1280
1428
|
function SmartLink({ href, children }) {
|
|
1281
1429
|
if (InertiaLink) {
|
|
1282
|
-
return /* @__PURE__ */ (0,
|
|
1430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(InertiaLink, { href, children });
|
|
1283
1431
|
}
|
|
1284
|
-
return /* @__PURE__ */ (0,
|
|
1432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("a", { href, children });
|
|
1285
1433
|
}
|
|
1286
1434
|
function renderValue(value, valueType, statusConfig) {
|
|
1287
1435
|
if (value === null || value === void 0) {
|
|
@@ -1292,8 +1440,8 @@ function renderValue(value, valueType, statusConfig) {
|
|
|
1292
1440
|
const config = { ...DEFAULT_STATUS_CONFIG, ...statusConfig };
|
|
1293
1441
|
const statusValue = String(value);
|
|
1294
1442
|
const status = config[statusValue] || { color: "#d9d9d9", text: statusValue };
|
|
1295
|
-
return /* @__PURE__ */ (0,
|
|
1296
|
-
/* @__PURE__ */ (0,
|
|
1443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_antd5.Space, { children: [
|
|
1444
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1297
1445
|
"span",
|
|
1298
1446
|
{
|
|
1299
1447
|
style: {
|
|
@@ -1365,11 +1513,11 @@ function ProTable({
|
|
|
1365
1513
|
// i18n
|
|
1366
1514
|
texts: customTexts
|
|
1367
1515
|
}) {
|
|
1368
|
-
const { token } =
|
|
1516
|
+
const { token } = import_antd5.theme.useToken();
|
|
1369
1517
|
const texts = { ...DEFAULT_TEXTS, ...customTexts };
|
|
1370
|
-
const [searchForm] =
|
|
1371
|
-
const [expanded, setExpanded] = (0,
|
|
1372
|
-
const [queryParams, setQueryParams] = (0,
|
|
1518
|
+
const [searchForm] = import_antd5.Form.useForm();
|
|
1519
|
+
const [expanded, setExpanded] = (0, import_react11.useState)(false);
|
|
1520
|
+
const [queryParams, setQueryParams] = (0, import_react11.useState)({
|
|
1373
1521
|
page: 1,
|
|
1374
1522
|
per_page: defaultPageSize,
|
|
1375
1523
|
...defaultSearchValues
|
|
@@ -1386,7 +1534,7 @@ function ProTable({
|
|
|
1386
1534
|
const dataSource = externalDataSource || queryResult.data?.data || [];
|
|
1387
1535
|
const loading = externalLoading ?? queryResult.isLoading;
|
|
1388
1536
|
const meta = queryResult.data?.meta;
|
|
1389
|
-
const handleSearch = (0,
|
|
1537
|
+
const handleSearch = (0, import_react11.useCallback)((values) => {
|
|
1390
1538
|
const newParams = {
|
|
1391
1539
|
...queryParams,
|
|
1392
1540
|
...values,
|
|
@@ -1395,7 +1543,7 @@ function ProTable({
|
|
|
1395
1543
|
setQueryParams(newParams);
|
|
1396
1544
|
onSearch?.(values);
|
|
1397
1545
|
}, [queryParams, onSearch]);
|
|
1398
|
-
const handleReset = (0,
|
|
1546
|
+
const handleReset = (0, import_react11.useCallback)(() => {
|
|
1399
1547
|
searchForm.resetFields();
|
|
1400
1548
|
const newParams = {
|
|
1401
1549
|
page: 1,
|
|
@@ -1404,7 +1552,7 @@ function ProTable({
|
|
|
1404
1552
|
setQueryParams(newParams);
|
|
1405
1553
|
onReset?.();
|
|
1406
1554
|
}, [searchForm, defaultPageSize, onReset]);
|
|
1407
|
-
const handleTableChange = (0,
|
|
1555
|
+
const handleTableChange = (0, import_react11.useCallback)(
|
|
1408
1556
|
(pag, _filters, sorter, _extra) => {
|
|
1409
1557
|
const sortInfo = Array.isArray(sorter) ? sorter[0] : sorter;
|
|
1410
1558
|
const newParams = {
|
|
@@ -1424,7 +1572,7 @@ function ProTable({
|
|
|
1424
1572
|
},
|
|
1425
1573
|
[queryParams, defaultPageSize, onChange]
|
|
1426
1574
|
);
|
|
1427
|
-
const tableColumns = (0,
|
|
1575
|
+
const tableColumns = (0, import_react11.useMemo)(() => {
|
|
1428
1576
|
const cols = columns.filter((col) => !col.hidden).map((col) => ({
|
|
1429
1577
|
...col,
|
|
1430
1578
|
key: col.key || (Array.isArray(col.dataIndex) ? col.dataIndex.join(".") : col.dataIndex),
|
|
@@ -1440,13 +1588,13 @@ function ProTable({
|
|
|
1440
1588
|
const actions = rowActions(record).filter(
|
|
1441
1589
|
(a) => !a.hidden?.(record)
|
|
1442
1590
|
);
|
|
1443
|
-
return /* @__PURE__ */ (0,
|
|
1591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_antd5.Space, { size: 0, children: actions.map((action, idx) => {
|
|
1444
1592
|
const isLast = idx === actions.length - 1;
|
|
1445
1593
|
let actionElement;
|
|
1446
1594
|
if (action.href) {
|
|
1447
|
-
actionElement = /* @__PURE__ */ (0,
|
|
1595
|
+
actionElement = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SmartLink, { href: action.href, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Link, { style: action.danger ? { color: token.colorError } : void 0, children: action.label }) });
|
|
1448
1596
|
} else {
|
|
1449
|
-
const linkElement = /* @__PURE__ */ (0,
|
|
1597
|
+
const linkElement = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1450
1598
|
Link,
|
|
1451
1599
|
{
|
|
1452
1600
|
style: action.danger ? { color: token.colorError } : void 0,
|
|
@@ -1455,8 +1603,8 @@ function ProTable({
|
|
|
1455
1603
|
}
|
|
1456
1604
|
);
|
|
1457
1605
|
if (action.confirm) {
|
|
1458
|
-
actionElement = /* @__PURE__ */ (0,
|
|
1459
|
-
|
|
1606
|
+
actionElement = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1607
|
+
import_antd5.Popconfirm,
|
|
1460
1608
|
{
|
|
1461
1609
|
title: typeof action.confirm === "string" ? action.confirm : `${action.label}\u3057\u307E\u3059\u304B\uFF1F`,
|
|
1462
1610
|
onConfirm: () => action.onClick?.(record),
|
|
@@ -1470,9 +1618,9 @@ function ProTable({
|
|
|
1470
1618
|
actionElement = linkElement;
|
|
1471
1619
|
}
|
|
1472
1620
|
}
|
|
1473
|
-
return /* @__PURE__ */ (0,
|
|
1621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
|
|
1474
1622
|
actionElement,
|
|
1475
|
-
!isLast && /* @__PURE__ */ (0,
|
|
1623
|
+
!isLast && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_antd5.Divider, { type: "vertical" })
|
|
1476
1624
|
] }, idx);
|
|
1477
1625
|
}) });
|
|
1478
1626
|
}
|
|
@@ -1480,7 +1628,7 @@ function ProTable({
|
|
|
1480
1628
|
}
|
|
1481
1629
|
return cols;
|
|
1482
1630
|
}, [columns, rowActions, texts]);
|
|
1483
|
-
const paginationConfig = (0,
|
|
1631
|
+
const paginationConfig = (0, import_react11.useMemo)(() => {
|
|
1484
1632
|
if (pagination === false) return false;
|
|
1485
1633
|
return {
|
|
1486
1634
|
current: meta?.current_page || queryParams.page,
|
|
@@ -1491,9 +1639,9 @@ function ProTable({
|
|
|
1491
1639
|
...typeof pagination === "object" ? pagination : {}
|
|
1492
1640
|
};
|
|
1493
1641
|
}, [pagination, meta, queryParams, texts]);
|
|
1494
|
-
return /* @__PURE__ */ (0,
|
|
1495
|
-
searchFields.length > 0 && /* @__PURE__ */ (0,
|
|
1496
|
-
|
|
1642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className, style, children: [
|
|
1643
|
+
searchFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_antd5.Card, { style: { marginBottom: 24, ...cardStyle }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1644
|
+
import_antd5.Form,
|
|
1497
1645
|
{
|
|
1498
1646
|
form: searchForm,
|
|
1499
1647
|
layout: "horizontal",
|
|
@@ -1502,57 +1650,57 @@ function ProTable({
|
|
|
1502
1650
|
wrapperCol: { flex: 1 },
|
|
1503
1651
|
initialValues: defaultSearchValues,
|
|
1504
1652
|
children: [
|
|
1505
|
-
/* @__PURE__ */ (0,
|
|
1506
|
-
visibleFields.map((field) => /* @__PURE__ */ (0,
|
|
1507
|
-
/* @__PURE__ */ (0,
|
|
1508
|
-
/* @__PURE__ */ (0,
|
|
1509
|
-
/* @__PURE__ */ (0,
|
|
1510
|
-
hasHiddenFields && /* @__PURE__ */ (0,
|
|
1511
|
-
|
|
1653
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_antd5.Row, { gutter: 24, children: [
|
|
1654
|
+
visibleFields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_antd5.Col, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_antd5.Form.Item, { name: field.name, label: field.label, children: renderSearchField(field, texts) }) }, field.name)),
|
|
1655
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_antd5.Col, { span: visibleFields.length === 1 ? 16 : 8, style: { textAlign: "right" }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_antd5.Space, { children: [
|
|
1656
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_antd5.Button, { onClick: handleReset, children: texts.reset }),
|
|
1657
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_antd5.Button, { type: "primary", htmlType: "submit", children: texts.search }),
|
|
1658
|
+
hasHiddenFields && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1659
|
+
import_antd5.Button,
|
|
1512
1660
|
{
|
|
1513
1661
|
type: "link",
|
|
1514
1662
|
onClick: () => setExpanded(!expanded),
|
|
1515
1663
|
children: [
|
|
1516
1664
|
expanded ? texts.collapse : texts.expand,
|
|
1517
|
-
expanded ? /* @__PURE__ */ (0,
|
|
1665
|
+
expanded ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons4.UpOutlined, {}) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons4.DownOutlined, {})
|
|
1518
1666
|
]
|
|
1519
1667
|
}
|
|
1520
1668
|
)
|
|
1521
1669
|
] }) })
|
|
1522
1670
|
] }),
|
|
1523
|
-
expanded && hiddenFields.length > 0 && /* @__PURE__ */ (0,
|
|
1671
|
+
expanded && hiddenFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_antd5.Row, { gutter: 24, style: { marginTop: 16 }, children: hiddenFields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_antd5.Col, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_antd5.Form.Item, { name: field.name, label: field.label, children: renderSearchField(field, texts) }) }, field.name)) })
|
|
1524
1672
|
]
|
|
1525
1673
|
}
|
|
1526
1674
|
) }),
|
|
1527
|
-
/* @__PURE__ */ (0,
|
|
1528
|
-
|
|
1675
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1676
|
+
import_antd5.Card,
|
|
1529
1677
|
{
|
|
1530
|
-
title: /* @__PURE__ */ (0,
|
|
1678
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_antd5.Space, { children: [
|
|
1531
1679
|
icon,
|
|
1532
1680
|
title,
|
|
1533
|
-
subTitle && /* @__PURE__ */ (0,
|
|
1681
|
+
subTitle && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { style: {
|
|
1534
1682
|
fontWeight: "normal",
|
|
1535
1683
|
fontSize: 14,
|
|
1536
1684
|
color: token.colorTextSecondary
|
|
1537
1685
|
}, children: subTitle })
|
|
1538
1686
|
] }),
|
|
1539
|
-
extra: /* @__PURE__ */ (0,
|
|
1687
|
+
extra: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_antd5.Space, { size: "small", children: [
|
|
1540
1688
|
toolbarExtra,
|
|
1541
|
-
addButtonLink && /* @__PURE__ */ (0,
|
|
1542
|
-
onAdd && !addButtonLink && /* @__PURE__ */ (0,
|
|
1543
|
-
showRefresh && /* @__PURE__ */ (0,
|
|
1544
|
-
|
|
1689
|
+
addButtonLink && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SmartLink, { href: addButtonLink, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_antd5.Button, { type: "primary", icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons4.PlusOutlined, {}), children: addLabel || texts.add }) }),
|
|
1690
|
+
onAdd && !addButtonLink && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_antd5.Button, { type: "primary", icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons4.PlusOutlined, {}), onClick: onAdd, children: addLabel || texts.add }),
|
|
1691
|
+
showRefresh && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_antd5.Tooltip, { title: texts.refresh, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1692
|
+
import_antd5.Button,
|
|
1545
1693
|
{
|
|
1546
|
-
icon: /* @__PURE__ */ (0,
|
|
1694
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons4.ReloadOutlined, {}),
|
|
1547
1695
|
onClick: () => queryResult.refetch?.(),
|
|
1548
1696
|
loading: queryResult.isFetching
|
|
1549
1697
|
}
|
|
1550
1698
|
) }),
|
|
1551
|
-
showColumnSettings && /* @__PURE__ */ (0,
|
|
1699
|
+
showColumnSettings && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_antd5.Tooltip, { title: texts.columnSettings, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_antd5.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons4.SettingOutlined, {}) }) })
|
|
1552
1700
|
] }),
|
|
1553
1701
|
style: cardStyle,
|
|
1554
|
-
children: /* @__PURE__ */ (0,
|
|
1555
|
-
|
|
1702
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1703
|
+
import_antd5.Table,
|
|
1556
1704
|
{
|
|
1557
1705
|
...tableProps,
|
|
1558
1706
|
columns: tableColumns,
|
|
@@ -1569,8 +1717,8 @@ function ProTable({
|
|
|
1569
1717
|
}
|
|
1570
1718
|
|
|
1571
1719
|
// src/ant/components/PageContainer/PageContainer.tsx
|
|
1572
|
-
var
|
|
1573
|
-
var
|
|
1720
|
+
var import_antd6 = require("antd");
|
|
1721
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1574
1722
|
function PageContainer({
|
|
1575
1723
|
title,
|
|
1576
1724
|
subTitle,
|
|
@@ -1582,19 +1730,19 @@ function PageContainer({
|
|
|
1582
1730
|
className,
|
|
1583
1731
|
style
|
|
1584
1732
|
}) {
|
|
1585
|
-
const { token } =
|
|
1733
|
+
const { token } = import_antd6.theme.useToken();
|
|
1586
1734
|
const breadcrumbProps = breadcrumb ? Array.isArray(breadcrumb) ? { items: breadcrumb } : breadcrumb : void 0;
|
|
1587
1735
|
const hasHeader = showHeader && (title || subTitle || breadcrumb);
|
|
1588
|
-
return /* @__PURE__ */ (0,
|
|
1589
|
-
hasHeader && /* @__PURE__ */ (0,
|
|
1736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className, style, children: [
|
|
1737
|
+
hasHeader && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1590
1738
|
"div",
|
|
1591
1739
|
{
|
|
1592
1740
|
style: {
|
|
1593
1741
|
marginBottom: 24
|
|
1594
1742
|
},
|
|
1595
1743
|
children: [
|
|
1596
|
-
breadcrumbProps && /* @__PURE__ */ (0,
|
|
1597
|
-
|
|
1744
|
+
breadcrumbProps && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1745
|
+
import_antd6.Breadcrumb,
|
|
1598
1746
|
{
|
|
1599
1747
|
...breadcrumbProps,
|
|
1600
1748
|
style: {
|
|
@@ -1603,7 +1751,7 @@ function PageContainer({
|
|
|
1603
1751
|
}
|
|
1604
1752
|
}
|
|
1605
1753
|
),
|
|
1606
|
-
(title || extra) && /* @__PURE__ */ (0,
|
|
1754
|
+
(title || extra) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1607
1755
|
"div",
|
|
1608
1756
|
{
|
|
1609
1757
|
style: {
|
|
@@ -1612,8 +1760,8 @@ function PageContainer({
|
|
|
1612
1760
|
alignItems: "flex-start"
|
|
1613
1761
|
},
|
|
1614
1762
|
children: [
|
|
1615
|
-
/* @__PURE__ */ (0,
|
|
1616
|
-
title && /* @__PURE__ */ (0,
|
|
1763
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { children: [
|
|
1764
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1617
1765
|
"h1",
|
|
1618
1766
|
{
|
|
1619
1767
|
style: {
|
|
@@ -1627,12 +1775,12 @@ function PageContainer({
|
|
|
1627
1775
|
gap: 8
|
|
1628
1776
|
},
|
|
1629
1777
|
children: [
|
|
1630
|
-
icon && /* @__PURE__ */ (0,
|
|
1778
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: { fontSize: 20 }, children: icon }),
|
|
1631
1779
|
title
|
|
1632
1780
|
]
|
|
1633
1781
|
}
|
|
1634
1782
|
),
|
|
1635
|
-
subTitle && /* @__PURE__ */ (0,
|
|
1783
|
+
subTitle && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1636
1784
|
"div",
|
|
1637
1785
|
{
|
|
1638
1786
|
style: {
|
|
@@ -1644,7 +1792,7 @@ function PageContainer({
|
|
|
1644
1792
|
}
|
|
1645
1793
|
)
|
|
1646
1794
|
] }),
|
|
1647
|
-
extra && /* @__PURE__ */ (0,
|
|
1795
|
+
extra && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { flexShrink: 0 }, children: extra })
|
|
1648
1796
|
]
|
|
1649
1797
|
}
|
|
1650
1798
|
)
|
|
@@ -1657,14 +1805,14 @@ function PageContainer({
|
|
|
1657
1805
|
|
|
1658
1806
|
// src/ant/components/LocaleSwitcher/LocaleSwitcher.tsx
|
|
1659
1807
|
var import_icons5 = require("@ant-design/icons");
|
|
1660
|
-
var
|
|
1808
|
+
var import_antd7 = require("antd");
|
|
1661
1809
|
var import_react_i18next2 = require("react-i18next");
|
|
1662
1810
|
|
|
1663
1811
|
// src/core/i18n/index.tsx
|
|
1664
|
-
var
|
|
1812
|
+
var import_react12 = require("react");
|
|
1665
1813
|
var import_react_i18next = require("react-i18next");
|
|
1666
1814
|
var import_i18next = __toESM(require("i18next"), 1);
|
|
1667
|
-
var
|
|
1815
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1668
1816
|
var locales = ["ja", "en", "vi"];
|
|
1669
1817
|
var localeNames = {
|
|
1670
1818
|
ja: "\u65E5\u672C\u8A9E",
|
|
@@ -1672,9 +1820,9 @@ var localeNames = {
|
|
|
1672
1820
|
vi: "Ti\u1EBFng Vi\u1EC7t"
|
|
1673
1821
|
};
|
|
1674
1822
|
var defaultLocale = "ja";
|
|
1675
|
-
var I18nContext = (0,
|
|
1823
|
+
var I18nContext = (0, import_react12.createContext)(null);
|
|
1676
1824
|
function useLocale() {
|
|
1677
|
-
const context = (0,
|
|
1825
|
+
const context = (0, import_react12.useContext)(I18nContext);
|
|
1678
1826
|
const { i18n: i18nInstance } = (0, import_react_i18next.useTranslation)();
|
|
1679
1827
|
if (context) {
|
|
1680
1828
|
return context.locale;
|
|
@@ -1683,7 +1831,7 @@ function useLocale() {
|
|
|
1683
1831
|
}
|
|
1684
1832
|
|
|
1685
1833
|
// src/ant/components/LocaleSwitcher/LocaleSwitcher.tsx
|
|
1686
|
-
var
|
|
1834
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1687
1835
|
function LocaleSwitcher() {
|
|
1688
1836
|
const { i18n: i18n2 } = (0, import_react_i18next2.useTranslation)();
|
|
1689
1837
|
const locale = i18n2.language || "ja";
|
|
@@ -1691,14 +1839,14 @@ function LocaleSwitcher() {
|
|
|
1691
1839
|
i18n2.changeLanguage(newLocale);
|
|
1692
1840
|
document.cookie = `locale=${newLocale};path=/;max-age=31536000`;
|
|
1693
1841
|
};
|
|
1694
|
-
return /* @__PURE__ */ (0,
|
|
1695
|
-
|
|
1842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1843
|
+
import_antd7.Select,
|
|
1696
1844
|
{
|
|
1697
1845
|
value: locale,
|
|
1698
1846
|
onChange: handleChange,
|
|
1699
1847
|
style: { width: 100 },
|
|
1700
1848
|
size: "small",
|
|
1701
|
-
suffixIcon: /* @__PURE__ */ (0,
|
|
1849
|
+
suffixIcon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_icons5.GlobalOutlined, {}),
|
|
1702
1850
|
options: locales.map((l) => ({
|
|
1703
1851
|
value: l,
|
|
1704
1852
|
label: localeNames[l]
|
|
@@ -1709,21 +1857,21 @@ function LocaleSwitcher() {
|
|
|
1709
1857
|
|
|
1710
1858
|
// src/ant/components/UserRoleAssignModal/UserRoleAssignModal.tsx
|
|
1711
1859
|
var import_icons7 = require("@ant-design/icons");
|
|
1712
|
-
var
|
|
1713
|
-
var
|
|
1860
|
+
var import_antd9 = require("antd");
|
|
1861
|
+
var import_react13 = require("react");
|
|
1714
1862
|
|
|
1715
1863
|
// src/ant/components/ScopeUtils/ScopeUtils.tsx
|
|
1716
1864
|
var import_icons6 = require("@ant-design/icons");
|
|
1717
|
-
var
|
|
1718
|
-
var
|
|
1865
|
+
var import_antd8 = require("antd");
|
|
1866
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1719
1867
|
function getScopeIcon(scope) {
|
|
1720
1868
|
switch (scope) {
|
|
1721
1869
|
case "global":
|
|
1722
|
-
return /* @__PURE__ */ (0,
|
|
1870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons6.GlobalOutlined, {});
|
|
1723
1871
|
case "org-wide":
|
|
1724
|
-
return /* @__PURE__ */ (0,
|
|
1872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons6.BankOutlined, {});
|
|
1725
1873
|
case "branch":
|
|
1726
|
-
return /* @__PURE__ */ (0,
|
|
1874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons6.BranchesOutlined, {});
|
|
1727
1875
|
default:
|
|
1728
1876
|
return null;
|
|
1729
1877
|
}
|
|
@@ -1741,19 +1889,19 @@ function getScopeColor(scope) {
|
|
|
1741
1889
|
}
|
|
1742
1890
|
}
|
|
1743
1891
|
function ScopeTag({ scope, label, showIcon = true }) {
|
|
1744
|
-
return /* @__PURE__ */ (0,
|
|
1892
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_antd8.Tag, { color: getScopeColor(scope), icon: showIcon ? getScopeIcon(scope) : void 0, children: label || scope });
|
|
1745
1893
|
}
|
|
1746
1894
|
function ScopeLabel({ scope, label }) {
|
|
1747
|
-
return /* @__PURE__ */ (0,
|
|
1895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_antd8.Space, { children: [
|
|
1748
1896
|
getScopeIcon(scope),
|
|
1749
1897
|
label
|
|
1750
1898
|
] });
|
|
1751
1899
|
}
|
|
1752
1900
|
|
|
1753
1901
|
// src/ant/components/UserRoleAssignModal/UserRoleAssignModal.tsx
|
|
1754
|
-
var
|
|
1755
|
-
var { Text:
|
|
1756
|
-
var
|
|
1902
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1903
|
+
var { Text: Text5 } = import_antd9.Typography;
|
|
1904
|
+
var defaultTranslations2 = {
|
|
1757
1905
|
title: "\u30ED\u30FC\u30EB\u5272\u308A\u5F53\u3066",
|
|
1758
1906
|
selectRole: "\u30ED\u30FC\u30EB\u3092\u9078\u629E",
|
|
1759
1907
|
scope: "\u30B9\u30B3\u30FC\u30D7",
|
|
@@ -1779,9 +1927,9 @@ function UserRoleAssignModal({
|
|
|
1779
1927
|
onCancel,
|
|
1780
1928
|
translations: t = {}
|
|
1781
1929
|
}) {
|
|
1782
|
-
const [form] =
|
|
1783
|
-
const [isSubmitting, setIsSubmitting] = (0,
|
|
1784
|
-
const labels = { ...
|
|
1930
|
+
const [form] = import_antd9.Form.useForm();
|
|
1931
|
+
const [isSubmitting, setIsSubmitting] = (0, import_react13.useState)(false);
|
|
1932
|
+
const labels = { ...defaultTranslations2, ...t };
|
|
1785
1933
|
const handleFinish = async (values) => {
|
|
1786
1934
|
setIsSubmitting(true);
|
|
1787
1935
|
try {
|
|
@@ -1795,11 +1943,11 @@ function UserRoleAssignModal({
|
|
|
1795
1943
|
form.resetFields();
|
|
1796
1944
|
onCancel();
|
|
1797
1945
|
};
|
|
1798
|
-
return /* @__PURE__ */ (0,
|
|
1799
|
-
|
|
1946
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1947
|
+
import_antd9.Modal,
|
|
1800
1948
|
{
|
|
1801
|
-
title: /* @__PURE__ */ (0,
|
|
1802
|
-
/* @__PURE__ */ (0,
|
|
1949
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_antd9.Space, { children: [
|
|
1950
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_icons7.SafetyOutlined, {}),
|
|
1803
1951
|
labels.title,
|
|
1804
1952
|
" ",
|
|
1805
1953
|
userName ? `- ${userName}` : ""
|
|
@@ -1808,50 +1956,50 @@ function UserRoleAssignModal({
|
|
|
1808
1956
|
onCancel: handleCancel,
|
|
1809
1957
|
footer: null,
|
|
1810
1958
|
destroyOnHidden: true,
|
|
1811
|
-
children: /* @__PURE__ */ (0,
|
|
1812
|
-
|
|
1959
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1960
|
+
import_antd9.Form,
|
|
1813
1961
|
{
|
|
1814
1962
|
form,
|
|
1815
1963
|
layout: "vertical",
|
|
1816
1964
|
onFinish: handleFinish,
|
|
1817
1965
|
initialValues: { scope: "org-wide", org_id: currentOrgId },
|
|
1818
1966
|
children: [
|
|
1819
|
-
/* @__PURE__ */ (0,
|
|
1820
|
-
|
|
1967
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1968
|
+
import_antd9.Form.Item,
|
|
1821
1969
|
{
|
|
1822
1970
|
name: "role_id",
|
|
1823
1971
|
label: labels.selectRole,
|
|
1824
1972
|
rules: [{ required: true, message: labels.required }],
|
|
1825
|
-
children: /* @__PURE__ */ (0,
|
|
1973
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_antd9.Select, { placeholder: labels.selectRole, children: roles.map((role) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_antd9.Select.Option, { value: role.id, children: role.name }, role.id)) })
|
|
1826
1974
|
}
|
|
1827
1975
|
),
|
|
1828
|
-
/* @__PURE__ */ (0,
|
|
1829
|
-
/* @__PURE__ */ (0,
|
|
1830
|
-
/* @__PURE__ */ (0,
|
|
1831
|
-
/* @__PURE__ */ (0,
|
|
1976
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_antd9.Form.Item, { name: "scope", label: labels.scope, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_antd9.Radio.Group, { children: [
|
|
1977
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_antd9.Radio, { value: "global", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ScopeLabel, { scope: "global", label: labels.global }) }),
|
|
1978
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_antd9.Radio, { value: "org-wide", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ScopeLabel, { scope: "org-wide", label: labels.orgWide }) }),
|
|
1979
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_antd9.Radio, { value: "branch", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ScopeLabel, { scope: "branch", label: labels.branchSpecific }) })
|
|
1832
1980
|
] }) }),
|
|
1833
|
-
/* @__PURE__ */ (0,
|
|
1834
|
-
|
|
1981
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_antd9.Form.Item, { noStyle: true, shouldUpdate: (prev, curr) => prev.scope !== curr.scope, children: ({ getFieldValue }) => (getFieldValue("scope") === "org-wide" || getFieldValue("scope") === "branch") && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1982
|
+
import_antd9.Form.Item,
|
|
1835
1983
|
{
|
|
1836
1984
|
name: "org_id",
|
|
1837
1985
|
label: labels.organization,
|
|
1838
1986
|
rules: [{ required: true, message: labels.required }],
|
|
1839
|
-
children: /* @__PURE__ */ (0,
|
|
1840
|
-
/* @__PURE__ */ (0,
|
|
1987
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_antd9.Select, { placeholder: labels.organization, children: organizations.map((org) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_antd9.Select.Option, { value: String(org.id), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_antd9.Space, { children: [
|
|
1988
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_icons7.BankOutlined, {}),
|
|
1841
1989
|
org.name
|
|
1842
1990
|
] }) }, org.id)) })
|
|
1843
1991
|
}
|
|
1844
1992
|
) }),
|
|
1845
|
-
/* @__PURE__ */ (0,
|
|
1846
|
-
|
|
1993
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_antd9.Form.Item, { noStyle: true, shouldUpdate: (prev, curr) => prev.scope !== curr.scope, children: ({ getFieldValue }) => getFieldValue("scope") === "branch" && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1994
|
+
import_antd9.Form.Item,
|
|
1847
1995
|
{
|
|
1848
1996
|
name: "branch_ids",
|
|
1849
1997
|
label: labels.selectBranches,
|
|
1850
1998
|
rules: [{ required: true, message: labels.required }],
|
|
1851
|
-
children: /* @__PURE__ */ (0,
|
|
1999
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_antd9.Select, { mode: "multiple", placeholder: labels.selectBranches, children: branches?.map((branch) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_antd9.Select.Option, { value: String(branch.id), children: branch.name }, branch.id)) })
|
|
1852
2000
|
}
|
|
1853
2001
|
) }),
|
|
1854
|
-
/* @__PURE__ */ (0,
|
|
2002
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_antd9.Form.Item, { noStyle: true, shouldUpdate: true, children: ({ getFieldValue }) => {
|
|
1855
2003
|
const scope = getFieldValue("scope");
|
|
1856
2004
|
const selectedOrgId = getFieldValue("org_id");
|
|
1857
2005
|
const selectedBranchIds = getFieldValue("branch_ids") || [];
|
|
@@ -1867,7 +2015,7 @@ function UserRoleAssignModal({
|
|
|
1867
2015
|
} else if (scope === "branch" && selectedBranches.length > 0) {
|
|
1868
2016
|
scopeText = selectedBranches.map((b) => b.name).join(", ");
|
|
1869
2017
|
}
|
|
1870
|
-
return scopeText ? /* @__PURE__ */ (0,
|
|
2018
|
+
return scopeText ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1871
2019
|
"div",
|
|
1872
2020
|
{
|
|
1873
2021
|
style: {
|
|
@@ -1876,19 +2024,19 @@ function UserRoleAssignModal({
|
|
|
1876
2024
|
borderRadius: 4,
|
|
1877
2025
|
marginBottom: 16
|
|
1878
2026
|
},
|
|
1879
|
-
children: /* @__PURE__ */ (0,
|
|
2027
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Text5, { type: "secondary", children: [
|
|
1880
2028
|
labels.assignRole,
|
|
1881
2029
|
": ",
|
|
1882
|
-
/* @__PURE__ */ (0,
|
|
2030
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text5, { strong: true, children: selectedRole.name }),
|
|
1883
2031
|
" \u2192 ",
|
|
1884
|
-
/* @__PURE__ */ (0,
|
|
2032
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_antd9.Tag, { color: getScopeColor(scope), children: scopeText })
|
|
1885
2033
|
] })
|
|
1886
2034
|
}
|
|
1887
2035
|
) : null;
|
|
1888
2036
|
} }),
|
|
1889
|
-
/* @__PURE__ */ (0,
|
|
1890
|
-
/* @__PURE__ */ (0,
|
|
1891
|
-
/* @__PURE__ */ (0,
|
|
2037
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_antd9.Form.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_antd9.Space, { children: [
|
|
2038
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_antd9.Button, { type: "primary", htmlType: "submit", loading: loading || isSubmitting, children: labels.assign }),
|
|
2039
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_antd9.Button, { onClick: handleCancel, children: labels.cancel })
|
|
1892
2040
|
] }) })
|
|
1893
2041
|
]
|
|
1894
2042
|
}
|
|
@@ -1899,10 +2047,10 @@ function UserRoleAssignModal({
|
|
|
1899
2047
|
|
|
1900
2048
|
// src/ant/components/UserPermissionsModal/UserPermissionsModal.tsx
|
|
1901
2049
|
var import_icons8 = require("@ant-design/icons");
|
|
1902
|
-
var
|
|
1903
|
-
var
|
|
1904
|
-
var { Text:
|
|
1905
|
-
var
|
|
2050
|
+
var import_antd10 = require("antd");
|
|
2051
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2052
|
+
var { Text: Text6 } = import_antd10.Typography;
|
|
2053
|
+
var defaultTranslations3 = {
|
|
1906
2054
|
permissionBreakdown: "\u6A29\u9650\u30D6\u30EC\u30FC\u30AF\u30C0\u30A6\u30F3",
|
|
1907
2055
|
userInfo: "\u30E6\u30FC\u30B6\u30FC\u60C5\u5831",
|
|
1908
2056
|
email: "\u30E1\u30FC\u30EB",
|
|
@@ -1937,17 +2085,17 @@ function UserPermissionsModal({
|
|
|
1937
2085
|
onRemoveRole,
|
|
1938
2086
|
translations: t = {}
|
|
1939
2087
|
}) {
|
|
1940
|
-
const labels = { ...
|
|
2088
|
+
const labels = { ...defaultTranslations3, ...t };
|
|
1941
2089
|
const getBranchName = (branchId) => {
|
|
1942
2090
|
if (!branchId || !branches) return "";
|
|
1943
2091
|
const branch = branches.find((b) => String(b.id) === branchId);
|
|
1944
2092
|
return branch?.name || branchId;
|
|
1945
2093
|
};
|
|
1946
|
-
return /* @__PURE__ */ (0,
|
|
1947
|
-
|
|
2094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2095
|
+
import_antd10.Modal,
|
|
1948
2096
|
{
|
|
1949
|
-
title: /* @__PURE__ */ (0,
|
|
1950
|
-
/* @__PURE__ */ (0,
|
|
2097
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_antd10.Space, { children: [
|
|
2098
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons8.UserOutlined, {}),
|
|
1951
2099
|
userName,
|
|
1952
2100
|
" - ",
|
|
1953
2101
|
labels.permissionBreakdown
|
|
@@ -1957,54 +2105,54 @@ function UserPermissionsModal({
|
|
|
1957
2105
|
footer: null,
|
|
1958
2106
|
width: 800,
|
|
1959
2107
|
destroyOnHidden: true,
|
|
1960
|
-
children: loading ? /* @__PURE__ */ (0,
|
|
1961
|
-
/* @__PURE__ */ (0,
|
|
1962
|
-
/* @__PURE__ */ (0,
|
|
1963
|
-
/* @__PURE__ */ (0,
|
|
2108
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { textAlign: "center", padding: 40 }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd10.Spin, { size: "large" }) }) : permissions ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 16 }, children: [
|
|
2109
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd10.Card, { size: "small", title: labels.userInfo, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
2110
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
|
|
2111
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Text6, { type: "secondary", children: [
|
|
1964
2112
|
labels.email,
|
|
1965
2113
|
": "
|
|
1966
2114
|
] }),
|
|
1967
|
-
/* @__PURE__ */ (0,
|
|
2115
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text6, { children: permissions.user?.email })
|
|
1968
2116
|
] }),
|
|
1969
|
-
/* @__PURE__ */ (0,
|
|
1970
|
-
/* @__PURE__ */ (0,
|
|
2117
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
|
|
2118
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Text6, { type: "secondary", children: [
|
|
1971
2119
|
labels.primaryOrganization,
|
|
1972
2120
|
": "
|
|
1973
2121
|
] }),
|
|
1974
|
-
permissions.user?.organization ? /* @__PURE__ */ (0,
|
|
2122
|
+
permissions.user?.organization ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd10.Tag, { icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons8.BankOutlined, {}), color: "blue", children: permissions.user.organization.name }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd10.Tag, { icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons8.GlobalOutlined, {}), color: "purple", children: labels.global })
|
|
1975
2123
|
] })
|
|
1976
2124
|
] }) }),
|
|
1977
|
-
/* @__PURE__ */ (0,
|
|
1978
|
-
currentOrg && /* @__PURE__ */ (0,
|
|
1979
|
-
currentBranch && /* @__PURE__ */ (0,
|
|
2125
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd10.Card, { size: "small", title: labels.currentContext, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_antd10.Space, { wrap: true, children: [
|
|
2126
|
+
currentOrg && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd10.Tag, { icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons8.BankOutlined, {}), color: "blue", children: currentOrg.name }),
|
|
2127
|
+
currentBranch && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd10.Tag, { icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons8.BranchesOutlined, {}), color: "green", children: currentBranch.name })
|
|
1980
2128
|
] }) }),
|
|
1981
|
-
/* @__PURE__ */ (0,
|
|
1982
|
-
|
|
2129
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2130
|
+
import_antd10.Card,
|
|
1983
2131
|
{
|
|
1984
2132
|
size: "small",
|
|
1985
|
-
title: /* @__PURE__ */ (0,
|
|
1986
|
-
/* @__PURE__ */ (0,
|
|
2133
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_antd10.Space, { children: [
|
|
2134
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons8.SafetyOutlined, {}),
|
|
1987
2135
|
labels.roleAssignments,
|
|
1988
2136
|
" (",
|
|
1989
2137
|
permissions.role_assignments.length,
|
|
1990
2138
|
")"
|
|
1991
2139
|
] }),
|
|
1992
|
-
extra: onAddRole && /* @__PURE__ */ (0,
|
|
1993
|
-
children: permissions.role_assignments.length === 0 ? /* @__PURE__ */ (0,
|
|
1994
|
-
|
|
2140
|
+
extra: onAddRole && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd10.Button, { type: "primary", size: "small", icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons8.PlusOutlined, {}), onClick: onAddRole, children: labels.add }),
|
|
2141
|
+
children: permissions.role_assignments.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd10.Empty, { description: labels.noRolesAssigned }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd10.Collapse, { ghost: true, children: permissions.role_assignments.map((assignment, index) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2142
|
+
import_antd10.Collapse.Panel,
|
|
1995
2143
|
{
|
|
1996
|
-
header: /* @__PURE__ */ (0,
|
|
2144
|
+
header: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_antd10.Space, { wrap: true, children: [
|
|
1997
2145
|
getScopeIcon(assignment.scope),
|
|
1998
|
-
/* @__PURE__ */ (0,
|
|
1999
|
-
/* @__PURE__ */ (0,
|
|
2000
|
-
assignment.scope === "branch" && assignment.org_name && /* @__PURE__ */ (0,
|
|
2001
|
-
/* @__PURE__ */ (0,
|
|
2146
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text6, { strong: true, children: assignment.role.name }),
|
|
2147
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd10.Tag, { color: getScopeColor(assignment.scope), children: assignment.scope === "global" ? labels.global : assignment.scope === "org-wide" ? assignment.org_name || labels.orgWide : assignment.branch_name || getBranchName(assignment.console_branch_id) }),
|
|
2148
|
+
assignment.scope === "branch" && assignment.org_name && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd10.Tag, { color: "blue", icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons8.BankOutlined, {}), children: assignment.org_name }),
|
|
2149
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_antd10.Tag, { children: [
|
|
2002
2150
|
assignment.permissions.length,
|
|
2003
2151
|
" ",
|
|
2004
2152
|
labels.permissions
|
|
2005
2153
|
] }),
|
|
2006
|
-
onRemoveRole && /* @__PURE__ */ (0,
|
|
2007
|
-
|
|
2154
|
+
onRemoveRole && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2155
|
+
import_antd10.Popconfirm,
|
|
2008
2156
|
{
|
|
2009
2157
|
title: labels.confirmRemoveRole,
|
|
2010
2158
|
onConfirm: () => {
|
|
@@ -2014,12 +2162,12 @@ function UserPermissionsModal({
|
|
|
2014
2162
|
assignment.console_branch_id
|
|
2015
2163
|
);
|
|
2016
2164
|
},
|
|
2017
|
-
children: /* @__PURE__ */ (0,
|
|
2018
|
-
|
|
2165
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2166
|
+
import_antd10.Button,
|
|
2019
2167
|
{
|
|
2020
2168
|
size: "small",
|
|
2021
2169
|
danger: true,
|
|
2022
|
-
icon: /* @__PURE__ */ (0,
|
|
2170
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons8.DeleteOutlined, {}),
|
|
2023
2171
|
onClick: (e) => e.stopPropagation()
|
|
2024
2172
|
}
|
|
2025
2173
|
)
|
|
@@ -2036,35 +2184,35 @@ function UserPermissionsModal({
|
|
|
2036
2184
|
},
|
|
2037
2185
|
{}
|
|
2038
2186
|
)
|
|
2039
|
-
).map(([group, perms]) => /* @__PURE__ */ (0,
|
|
2040
|
-
/* @__PURE__ */ (0,
|
|
2041
|
-
/* @__PURE__ */ (0,
|
|
2187
|
+
).map(([group, perms]) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { marginBottom: 8 }, children: [
|
|
2188
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text6, { type: "secondary", style: { fontSize: 12 }, children: group }),
|
|
2189
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { display: "flex", flexWrap: "wrap", gap: 4, marginTop: 4 }, children: perms.map((perm) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd10.Tag, { color: "blue", children: perm.name }, perm.slug)) })
|
|
2042
2190
|
] }, group))
|
|
2043
2191
|
},
|
|
2044
2192
|
index
|
|
2045
2193
|
)) })
|
|
2046
2194
|
}
|
|
2047
2195
|
),
|
|
2048
|
-
/* @__PURE__ */ (0,
|
|
2049
|
-
|
|
2196
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2197
|
+
import_antd10.Card,
|
|
2050
2198
|
{
|
|
2051
2199
|
size: "small",
|
|
2052
|
-
title: /* @__PURE__ */ (0,
|
|
2053
|
-
/* @__PURE__ */ (0,
|
|
2200
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_antd10.Space, { children: [
|
|
2201
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons8.TeamOutlined, {}),
|
|
2054
2202
|
labels.teamMemberships,
|
|
2055
2203
|
" (",
|
|
2056
2204
|
permissions.team_memberships.length,
|
|
2057
2205
|
")"
|
|
2058
2206
|
] }),
|
|
2059
|
-
extra: onAddTeam && /* @__PURE__ */ (0,
|
|
2060
|
-
children: permissions.team_memberships.length === 0 ? /* @__PURE__ */ (0,
|
|
2061
|
-
|
|
2207
|
+
extra: onAddTeam && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd10.Button, { size: "small", icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons8.PlusOutlined, {}), onClick: onAddTeam, children: labels.add }),
|
|
2208
|
+
children: permissions.team_memberships.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd10.Empty, { description: labels.noTeamMemberships }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd10.Collapse, { ghost: true, children: permissions.team_memberships.map((membership, index) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2209
|
+
import_antd10.Collapse.Panel,
|
|
2062
2210
|
{
|
|
2063
|
-
header: /* @__PURE__ */ (0,
|
|
2064
|
-
/* @__PURE__ */ (0,
|
|
2065
|
-
/* @__PURE__ */ (0,
|
|
2066
|
-
membership.is_leader && /* @__PURE__ */ (0,
|
|
2067
|
-
/* @__PURE__ */ (0,
|
|
2211
|
+
header: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_antd10.Space, { children: [
|
|
2212
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons8.TeamOutlined, {}),
|
|
2213
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text6, { strong: true, children: membership.team.name }),
|
|
2214
|
+
membership.is_leader && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd10.Tag, { color: "gold", children: labels.teamLeader }),
|
|
2215
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_antd10.Tag, { children: [
|
|
2068
2216
|
membership.permissions.length,
|
|
2069
2217
|
" ",
|
|
2070
2218
|
labels.permissions
|
|
@@ -2080,27 +2228,27 @@ function UserPermissionsModal({
|
|
|
2080
2228
|
},
|
|
2081
2229
|
{}
|
|
2082
2230
|
)
|
|
2083
|
-
).map(([group, perms]) => /* @__PURE__ */ (0,
|
|
2084
|
-
/* @__PURE__ */ (0,
|
|
2085
|
-
/* @__PURE__ */ (0,
|
|
2231
|
+
).map(([group, perms]) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { marginBottom: 8 }, children: [
|
|
2232
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text6, { type: "secondary", style: { fontSize: 12 }, children: group }),
|
|
2233
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { display: "flex", flexWrap: "wrap", gap: 4, marginTop: 4 }, children: perms.map((perm) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd10.Tag, { color: "cyan", children: perm.name }, perm.slug)) })
|
|
2086
2234
|
] }, group))
|
|
2087
2235
|
},
|
|
2088
2236
|
index
|
|
2089
2237
|
)) })
|
|
2090
2238
|
}
|
|
2091
2239
|
),
|
|
2092
|
-
/* @__PURE__ */ (0,
|
|
2093
|
-
|
|
2240
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2241
|
+
import_antd10.Card,
|
|
2094
2242
|
{
|
|
2095
2243
|
size: "small",
|
|
2096
|
-
title: /* @__PURE__ */ (0,
|
|
2097
|
-
/* @__PURE__ */ (0,
|
|
2244
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_antd10.Space, { children: [
|
|
2245
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons8.SafetyOutlined, {}),
|
|
2098
2246
|
labels.aggregatedPermissions,
|
|
2099
2247
|
" (",
|
|
2100
2248
|
permissions.aggregated_permissions.length,
|
|
2101
2249
|
")"
|
|
2102
2250
|
] }),
|
|
2103
|
-
children: permissions.aggregated_permissions.length === 0 ? /* @__PURE__ */ (0,
|
|
2251
|
+
children: permissions.aggregated_permissions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd10.Empty, { description: labels.noData }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd10.Collapse, { ghost: true, children: Object.entries(
|
|
2104
2252
|
permissions.aggregated_permissions.reduce(
|
|
2105
2253
|
(groups, perm) => {
|
|
2106
2254
|
const parts = perm.split(".");
|
|
@@ -2111,15 +2259,15 @@ function UserPermissionsModal({
|
|
|
2111
2259
|
},
|
|
2112
2260
|
{}
|
|
2113
2261
|
)
|
|
2114
|
-
).map(([group, perms]) => /* @__PURE__ */ (0,
|
|
2115
|
-
|
|
2262
|
+
).map(([group, perms]) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2263
|
+
import_antd10.Collapse.Panel,
|
|
2116
2264
|
{
|
|
2117
|
-
header: /* @__PURE__ */ (0,
|
|
2118
|
-
/* @__PURE__ */ (0,
|
|
2119
|
-
/* @__PURE__ */ (0,
|
|
2120
|
-
/* @__PURE__ */ (0,
|
|
2265
|
+
header: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_antd10.Space, { children: [
|
|
2266
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons8.SafetyOutlined, {}),
|
|
2267
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text6, { strong: true, children: group }),
|
|
2268
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd10.Tag, { color: "green", children: perms.length })
|
|
2121
2269
|
] }),
|
|
2122
|
-
children: /* @__PURE__ */ (0,
|
|
2270
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { display: "flex", flexWrap: "wrap", gap: 4 }, children: perms.map((perm) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd10.Tag, { color: "green", children: perm.split(".").pop() }, perm)) })
|
|
2123
2271
|
},
|
|
2124
2272
|
group
|
|
2125
2273
|
)) })
|
|
@@ -2132,11 +2280,11 @@ function UserPermissionsModal({
|
|
|
2132
2280
|
|
|
2133
2281
|
// src/ant/components/UserDetailCard/UserDetailCard.tsx
|
|
2134
2282
|
var import_icons9 = require("@ant-design/icons");
|
|
2135
|
-
var
|
|
2136
|
-
var
|
|
2137
|
-
var
|
|
2138
|
-
var { Title: Title3, Text:
|
|
2139
|
-
var
|
|
2283
|
+
var import_antd11 = require("antd");
|
|
2284
|
+
var import_react14 = require("react");
|
|
2285
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2286
|
+
var { Title: Title3, Text: Text7, Link: AntLink } = import_antd11.Typography;
|
|
2287
|
+
var defaultTranslations4 = {
|
|
2140
2288
|
email: "\u30E1\u30FC\u30EB",
|
|
2141
2289
|
primaryOrganization: "\u6240\u5C5E\u7D44\u7E54",
|
|
2142
2290
|
currentContext: "\u73FE\u5728\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8",
|
|
@@ -2183,9 +2331,9 @@ function UserDetailCard({
|
|
|
2183
2331
|
removeLoading = false,
|
|
2184
2332
|
translations: t = {}
|
|
2185
2333
|
}) {
|
|
2186
|
-
const labels = { ...
|
|
2187
|
-
const [permissionSearch, setPermissionSearch] = (0,
|
|
2188
|
-
const [permissionTypeFilter, setPermissionTypeFilter] = (0,
|
|
2334
|
+
const labels = { ...defaultTranslations4, ...t };
|
|
2335
|
+
const [permissionSearch, setPermissionSearch] = (0, import_react14.useState)("");
|
|
2336
|
+
const [permissionTypeFilter, setPermissionTypeFilter] = (0, import_react14.useState)("all");
|
|
2189
2337
|
const getScopeLabel = (assignment) => {
|
|
2190
2338
|
if (assignment.scope === "global") return labels.global;
|
|
2191
2339
|
if (assignment.scope === "org-wide") return assignment.org_name || labels.global;
|
|
@@ -2222,7 +2370,7 @@ function UserDetailCard({
|
|
|
2222
2370
|
const matchesType = permissionTypeFilter === "all" || p.type === permissionTypeFilter;
|
|
2223
2371
|
return matchesSearch && matchesType;
|
|
2224
2372
|
});
|
|
2225
|
-
const groupedAggregatedPermissions = (0,
|
|
2373
|
+
const groupedAggregatedPermissions = (0, import_react14.useMemo)(
|
|
2226
2374
|
() => aggregatedPermissions.reduce((acc, perm) => {
|
|
2227
2375
|
const group = perm.split(".").slice(0, -1).join(".") || "other";
|
|
2228
2376
|
if (!acc[group]) acc[group] = [];
|
|
@@ -2234,13 +2382,13 @@ function UserDetailCard({
|
|
|
2234
2382
|
const tabItems = [
|
|
2235
2383
|
{
|
|
2236
2384
|
key: "permissions",
|
|
2237
|
-
label: /* @__PURE__ */ (0,
|
|
2238
|
-
/* @__PURE__ */ (0,
|
|
2385
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
|
|
2386
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons9.KeyOutlined, {}),
|
|
2239
2387
|
" ",
|
|
2240
2388
|
labels.permissions
|
|
2241
2389
|
] }),
|
|
2242
|
-
children: /* @__PURE__ */ (0,
|
|
2243
|
-
/* @__PURE__ */ (0,
|
|
2390
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
2391
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2244
2392
|
"div",
|
|
2245
2393
|
{
|
|
2246
2394
|
style: {
|
|
@@ -2250,36 +2398,36 @@ function UserDetailCard({
|
|
|
2250
2398
|
marginBottom: 16
|
|
2251
2399
|
},
|
|
2252
2400
|
children: [
|
|
2253
|
-
/* @__PURE__ */ (0,
|
|
2254
|
-
/* @__PURE__ */ (0,
|
|
2401
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
2402
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Title3, { level: 5, style: { margin: 0 }, children: [
|
|
2255
2403
|
labels.permissionPolicies,
|
|
2256
2404
|
" (",
|
|
2257
2405
|
allPermissionsData.length,
|
|
2258
2406
|
")"
|
|
2259
2407
|
] }),
|
|
2260
|
-
/* @__PURE__ */ (0,
|
|
2408
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text7, { type: "secondary", style: { fontSize: 12 }, children: labels.permissionsDescription })
|
|
2261
2409
|
] }),
|
|
2262
|
-
/* @__PURE__ */ (0,
|
|
2263
|
-
onRefresh && /* @__PURE__ */ (0,
|
|
2264
|
-
/* @__PURE__ */ (0,
|
|
2265
|
-
/* @__PURE__ */ (0,
|
|
2410
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_antd11.Space, { children: [
|
|
2411
|
+
onRefresh && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_antd11.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons9.ReloadOutlined, {}), onClick: onRefresh }),
|
|
2412
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_antd11.Button, { type: "default", children: labels.remove }),
|
|
2413
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_antd11.Button, { type: "primary", icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons9.PlusOutlined, {}), children: labels.addPermissions })
|
|
2266
2414
|
] })
|
|
2267
2415
|
]
|
|
2268
2416
|
}
|
|
2269
2417
|
),
|
|
2270
|
-
/* @__PURE__ */ (0,
|
|
2271
|
-
/* @__PURE__ */ (0,
|
|
2272
|
-
|
|
2418
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", gap: 16, marginBottom: 16 }, children: [
|
|
2419
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2420
|
+
import_antd11.Input,
|
|
2273
2421
|
{
|
|
2274
2422
|
placeholder: labels.searchPermissions,
|
|
2275
|
-
prefix: /* @__PURE__ */ (0,
|
|
2423
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons9.KeyOutlined, {}),
|
|
2276
2424
|
value: permissionSearch,
|
|
2277
2425
|
onChange: (e) => setPermissionSearch(e.target.value),
|
|
2278
2426
|
style: { width: 300 }
|
|
2279
2427
|
}
|
|
2280
2428
|
),
|
|
2281
|
-
/* @__PURE__ */ (0,
|
|
2282
|
-
|
|
2429
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2430
|
+
import_antd11.Select,
|
|
2283
2431
|
{
|
|
2284
2432
|
value: permissionTypeFilter,
|
|
2285
2433
|
onChange: setPermissionTypeFilter,
|
|
@@ -2292,8 +2440,8 @@ function UserDetailCard({
|
|
|
2292
2440
|
}
|
|
2293
2441
|
)
|
|
2294
2442
|
] }),
|
|
2295
|
-
/* @__PURE__ */ (0,
|
|
2296
|
-
|
|
2443
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2444
|
+
import_antd11.Table,
|
|
2297
2445
|
{
|
|
2298
2446
|
dataSource: filteredPermissions,
|
|
2299
2447
|
pagination: { pageSize: 10 },
|
|
@@ -2302,9 +2450,9 @@ function UserDetailCard({
|
|
|
2302
2450
|
title: labels.permissions,
|
|
2303
2451
|
dataIndex: "permission",
|
|
2304
2452
|
key: "permission",
|
|
2305
|
-
render: (perm) => /* @__PURE__ */ (0,
|
|
2306
|
-
/* @__PURE__ */ (0,
|
|
2307
|
-
/* @__PURE__ */ (0,
|
|
2453
|
+
render: (perm) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_antd11.Space, { children: [
|
|
2454
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons9.KeyOutlined, { style: { color: "#faad14" } }),
|
|
2455
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AntLink, { children: perm })
|
|
2308
2456
|
] })
|
|
2309
2457
|
},
|
|
2310
2458
|
{
|
|
@@ -2312,17 +2460,17 @@ function UserDetailCard({
|
|
|
2312
2460
|
dataIndex: "type",
|
|
2313
2461
|
key: "type",
|
|
2314
2462
|
width: 150,
|
|
2315
|
-
render: (type) => /* @__PURE__ */ (0,
|
|
2463
|
+
render: (type) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_antd11.Tag, { color: type === "role" ? "blue" : "green", children: type === "role" ? labels.viaRole : labels.viaTeam })
|
|
2316
2464
|
},
|
|
2317
2465
|
{
|
|
2318
2466
|
title: labels.attachedVia,
|
|
2319
2467
|
dataIndex: "attachedVia",
|
|
2320
2468
|
key: "attachedVia",
|
|
2321
2469
|
width: 200,
|
|
2322
|
-
render: (via, record) => /* @__PURE__ */ (0,
|
|
2323
|
-
record.type === "role" ? /* @__PURE__ */ (0,
|
|
2324
|
-
/* @__PURE__ */ (0,
|
|
2325
|
-
record.scope && record.scope !== "team" && /* @__PURE__ */ (0,
|
|
2470
|
+
render: (via, record) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_antd11.Space, { children: [
|
|
2471
|
+
record.type === "role" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons9.SafetyOutlined, {}) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons9.TeamOutlined, {}),
|
|
2472
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text7, { children: via }),
|
|
2473
|
+
record.scope && record.scope !== "team" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_antd11.Tag, { color: getScopeColor(record.scope), style: { fontSize: 12 }, children: record.scope })
|
|
2326
2474
|
] })
|
|
2327
2475
|
}
|
|
2328
2476
|
]
|
|
@@ -2332,16 +2480,16 @@ function UserDetailCard({
|
|
|
2332
2480
|
},
|
|
2333
2481
|
{
|
|
2334
2482
|
key: "roles",
|
|
2335
|
-
label: /* @__PURE__ */ (0,
|
|
2336
|
-
/* @__PURE__ */ (0,
|
|
2483
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
|
|
2484
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons9.SafetyOutlined, {}),
|
|
2337
2485
|
" ",
|
|
2338
2486
|
labels.roles,
|
|
2339
2487
|
" (",
|
|
2340
2488
|
roleAssignments.length,
|
|
2341
2489
|
")"
|
|
2342
2490
|
] }),
|
|
2343
|
-
children: /* @__PURE__ */ (0,
|
|
2344
|
-
/* @__PURE__ */ (0,
|
|
2491
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
2492
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2345
2493
|
"div",
|
|
2346
2494
|
{
|
|
2347
2495
|
style: {
|
|
@@ -2351,13 +2499,13 @@ function UserDetailCard({
|
|
|
2351
2499
|
marginBottom: 16
|
|
2352
2500
|
},
|
|
2353
2501
|
children: [
|
|
2354
|
-
/* @__PURE__ */ (0,
|
|
2355
|
-
onAssignRole && /* @__PURE__ */ (0,
|
|
2502
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Title3, { level: 5, style: { margin: 0 }, children: labels.roleAssignments }),
|
|
2503
|
+
onAssignRole && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_antd11.Button, { type: "primary", icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons9.PlusOutlined, {}), onClick: onAssignRole, children: labels.assignRole })
|
|
2356
2504
|
]
|
|
2357
2505
|
}
|
|
2358
2506
|
),
|
|
2359
|
-
roleAssignments.length === 0 ? /* @__PURE__ */ (0,
|
|
2360
|
-
|
|
2507
|
+
roleAssignments.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_antd11.Empty, { description: labels.noRolesAssigned }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2508
|
+
import_antd11.Table,
|
|
2361
2509
|
{
|
|
2362
2510
|
dataSource: roleAssignments,
|
|
2363
2511
|
rowKey: (r) => `${r.role.id}-${r.console_org_id}-${r.console_branch_id}`,
|
|
@@ -2365,10 +2513,10 @@ function UserDetailCard({
|
|
|
2365
2513
|
{
|
|
2366
2514
|
title: labels.roles,
|
|
2367
2515
|
key: "role",
|
|
2368
|
-
render: (_, record) => /* @__PURE__ */ (0,
|
|
2369
|
-
/* @__PURE__ */ (0,
|
|
2370
|
-
/* @__PURE__ */ (0,
|
|
2371
|
-
|
|
2516
|
+
render: (_, record) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_antd11.Space, { children: [
|
|
2517
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons9.SafetyOutlined, { style: { color: "#1890ff" } }),
|
|
2518
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2519
|
+
Text7,
|
|
2372
2520
|
{
|
|
2373
2521
|
strong: true,
|
|
2374
2522
|
style: { color: "#1890ff", cursor: onRoleClick ? "pointer" : "default" },
|
|
@@ -2376,14 +2524,14 @@ function UserDetailCard({
|
|
|
2376
2524
|
children: record.role.name
|
|
2377
2525
|
}
|
|
2378
2526
|
),
|
|
2379
|
-
/* @__PURE__ */ (0,
|
|
2527
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_antd11.Tag, { color: "default", children: record.role.slug })
|
|
2380
2528
|
] })
|
|
2381
2529
|
},
|
|
2382
2530
|
{
|
|
2383
2531
|
title: labels.global,
|
|
2384
2532
|
key: "scope",
|
|
2385
2533
|
width: 200,
|
|
2386
|
-
render: (_, record) => /* @__PURE__ */ (0,
|
|
2534
|
+
render: (_, record) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_antd11.Tag, { color: getScopeColor(record.scope), children: getScopeLabel(record) })
|
|
2387
2535
|
},
|
|
2388
2536
|
{
|
|
2389
2537
|
title: labels.level,
|
|
@@ -2395,7 +2543,7 @@ function UserDetailCard({
|
|
|
2395
2543
|
title: labels.permissions,
|
|
2396
2544
|
key: "permissions",
|
|
2397
2545
|
width: 150,
|
|
2398
|
-
render: (_, record) => /* @__PURE__ */ (0,
|
|
2546
|
+
render: (_, record) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Text7, { children: [
|
|
2399
2547
|
record.permissions.length,
|
|
2400
2548
|
" ",
|
|
2401
2549
|
labels.permissions.toLowerCase()
|
|
@@ -2405,8 +2553,8 @@ function UserDetailCard({
|
|
|
2405
2553
|
title: labels.actions,
|
|
2406
2554
|
key: "actions",
|
|
2407
2555
|
width: 100,
|
|
2408
|
-
render: (_, record) => onRemoveRole && /* @__PURE__ */ (0,
|
|
2409
|
-
|
|
2556
|
+
render: (_, record) => onRemoveRole && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2557
|
+
import_antd11.Popconfirm,
|
|
2410
2558
|
{
|
|
2411
2559
|
title: labels.confirmRemoveRole,
|
|
2412
2560
|
onConfirm: () => onRemoveRole(
|
|
@@ -2414,12 +2562,12 @@ function UserDetailCard({
|
|
|
2414
2562
|
record.console_org_id,
|
|
2415
2563
|
record.console_branch_id
|
|
2416
2564
|
),
|
|
2417
|
-
children: /* @__PURE__ */ (0,
|
|
2418
|
-
|
|
2565
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2566
|
+
import_antd11.Button,
|
|
2419
2567
|
{
|
|
2420
2568
|
type: "text",
|
|
2421
2569
|
danger: true,
|
|
2422
|
-
icon: /* @__PURE__ */ (0,
|
|
2570
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons9.DeleteOutlined, {}),
|
|
2423
2571
|
loading: removeLoading
|
|
2424
2572
|
}
|
|
2425
2573
|
)
|
|
@@ -2433,18 +2581,18 @@ function UserDetailCard({
|
|
|
2433
2581
|
},
|
|
2434
2582
|
{
|
|
2435
2583
|
key: "teams",
|
|
2436
|
-
label: /* @__PURE__ */ (0,
|
|
2437
|
-
/* @__PURE__ */ (0,
|
|
2584
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
|
|
2585
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons9.TeamOutlined, {}),
|
|
2438
2586
|
" ",
|
|
2439
2587
|
labels.teams,
|
|
2440
2588
|
" (",
|
|
2441
2589
|
teamMemberships.length,
|
|
2442
2590
|
")"
|
|
2443
2591
|
] }),
|
|
2444
|
-
children: /* @__PURE__ */ (0,
|
|
2445
|
-
/* @__PURE__ */ (0,
|
|
2446
|
-
teamMemberships.length === 0 ? /* @__PURE__ */ (0,
|
|
2447
|
-
|
|
2592
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
2593
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Title3, { level: 5, style: { marginBottom: 16 }, children: labels.teamMemberships }),
|
|
2594
|
+
teamMemberships.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_antd11.Empty, { description: labels.noTeamMemberships }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2595
|
+
import_antd11.Table,
|
|
2448
2596
|
{
|
|
2449
2597
|
dataSource: teamMemberships,
|
|
2450
2598
|
rowKey: (m) => m.team.id,
|
|
@@ -2452,10 +2600,10 @@ function UserDetailCard({
|
|
|
2452
2600
|
{
|
|
2453
2601
|
title: labels.teams,
|
|
2454
2602
|
key: "team",
|
|
2455
|
-
render: (_, record) => /* @__PURE__ */ (0,
|
|
2456
|
-
/* @__PURE__ */ (0,
|
|
2457
|
-
/* @__PURE__ */ (0,
|
|
2458
|
-
record.team.path && /* @__PURE__ */ (0,
|
|
2603
|
+
render: (_, record) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_antd11.Space, { children: [
|
|
2604
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons9.TeamOutlined, { style: { color: "#52c41a" } }),
|
|
2605
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text7, { strong: true, children: record.team.name }),
|
|
2606
|
+
record.team.path && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Text7, { type: "secondary", children: [
|
|
2459
2607
|
"(",
|
|
2460
2608
|
record.team.path,
|
|
2461
2609
|
")"
|
|
@@ -2466,13 +2614,13 @@ function UserDetailCard({
|
|
|
2466
2614
|
title: labels.teamLeader,
|
|
2467
2615
|
key: "leader",
|
|
2468
2616
|
width: 150,
|
|
2469
|
-
render: (_, record) => record.is_leader ? /* @__PURE__ */ (0,
|
|
2617
|
+
render: (_, record) => record.is_leader ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_antd11.Tag, { color: "gold", children: labels.teamLeader }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text7, { type: "secondary", children: "-" })
|
|
2470
2618
|
},
|
|
2471
2619
|
{
|
|
2472
2620
|
title: labels.permissions,
|
|
2473
2621
|
key: "permissions",
|
|
2474
2622
|
width: 150,
|
|
2475
|
-
render: (_, record) => /* @__PURE__ */ (0,
|
|
2623
|
+
render: (_, record) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Text7, { children: [
|
|
2476
2624
|
record.permissions.length,
|
|
2477
2625
|
" ",
|
|
2478
2626
|
labels.permissions.toLowerCase()
|
|
@@ -2485,19 +2633,19 @@ function UserDetailCard({
|
|
|
2485
2633
|
},
|
|
2486
2634
|
{
|
|
2487
2635
|
key: "aggregated",
|
|
2488
|
-
label: /* @__PURE__ */ (0,
|
|
2489
|
-
/* @__PURE__ */ (0,
|
|
2636
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
|
|
2637
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons9.SafetyOutlined, {}),
|
|
2490
2638
|
" ",
|
|
2491
2639
|
labels.aggregatedPermissions,
|
|
2492
2640
|
" (",
|
|
2493
2641
|
aggregatedPermissions.length,
|
|
2494
2642
|
")"
|
|
2495
2643
|
] }),
|
|
2496
|
-
children: /* @__PURE__ */ (0,
|
|
2497
|
-
/* @__PURE__ */ (0,
|
|
2498
|
-
/* @__PURE__ */ (0,
|
|
2499
|
-
aggregatedPermissions.length === 0 ? /* @__PURE__ */ (0,
|
|
2500
|
-
|
|
2644
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
2645
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Title3, { level: 5, style: { marginBottom: 16 }, children: labels.aggregatedPermissions }),
|
|
2646
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text7, { type: "secondary", style: { display: "block", marginBottom: 16 }, children: "\u3059\u3079\u3066\u306E\u30ED\u30FC\u30EB\u3068\u30C1\u30FC\u30E0\u304B\u3089\u96C6\u7D04\u3055\u308C\u305F\u6A29\u9650\u306E\u4E00\u89A7\u3067\u3059\u3002" }),
|
|
2647
|
+
aggregatedPermissions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_antd11.Empty, { description: labels.noPermissions }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2648
|
+
import_antd11.Table,
|
|
2501
2649
|
{
|
|
2502
2650
|
dataSource: aggregatedPermissions.map((perm) => ({
|
|
2503
2651
|
key: perm,
|
|
@@ -2518,15 +2666,15 @@ function UserDetailCard({
|
|
|
2518
2666
|
value: g
|
|
2519
2667
|
})),
|
|
2520
2668
|
onFilter: (value, record) => record.group === value,
|
|
2521
|
-
render: (group) => /* @__PURE__ */ (0,
|
|
2669
|
+
render: (group) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_antd11.Tag, { icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons9.SafetyOutlined, {}), color: "blue", children: group })
|
|
2522
2670
|
},
|
|
2523
2671
|
{
|
|
2524
2672
|
title: labels.permissions,
|
|
2525
2673
|
dataIndex: "permission",
|
|
2526
2674
|
key: "permission",
|
|
2527
|
-
render: (perm) => /* @__PURE__ */ (0,
|
|
2528
|
-
/* @__PURE__ */ (0,
|
|
2529
|
-
/* @__PURE__ */ (0,
|
|
2675
|
+
render: (perm) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_antd11.Space, { children: [
|
|
2676
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons9.KeyOutlined, { style: { color: "#faad14" } }),
|
|
2677
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text7, { children: perm })
|
|
2530
2678
|
] })
|
|
2531
2679
|
},
|
|
2532
2680
|
{
|
|
@@ -2534,7 +2682,7 @@ function UserDetailCard({
|
|
|
2534
2682
|
dataIndex: "action",
|
|
2535
2683
|
key: "action",
|
|
2536
2684
|
width: 150,
|
|
2537
|
-
render: (action) => /* @__PURE__ */ (0,
|
|
2685
|
+
render: (action) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_antd11.Tag, { color: "green", children: action })
|
|
2538
2686
|
}
|
|
2539
2687
|
]
|
|
2540
2688
|
}
|
|
@@ -2542,8 +2690,8 @@ function UserDetailCard({
|
|
|
2542
2690
|
] })
|
|
2543
2691
|
}
|
|
2544
2692
|
];
|
|
2545
|
-
return /* @__PURE__ */ (0,
|
|
2546
|
-
/* @__PURE__ */ (0,
|
|
2693
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
2694
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_antd11.Card, { size: "small", style: { marginBottom: 24 }, styles: { body: { padding: "16px 24px" } }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2547
2695
|
"div",
|
|
2548
2696
|
{
|
|
2549
2697
|
style: {
|
|
@@ -2552,45 +2700,45 @@ function UserDetailCard({
|
|
|
2552
2700
|
gap: "20px 48px"
|
|
2553
2701
|
},
|
|
2554
2702
|
children: [
|
|
2555
|
-
/* @__PURE__ */ (0,
|
|
2556
|
-
/* @__PURE__ */ (0,
|
|
2557
|
-
/* @__PURE__ */ (0,
|
|
2703
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
2704
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text7, { type: "secondary", style: { fontSize: 12, display: "block", marginBottom: 4 }, children: labels.email }),
|
|
2705
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text7, { copyable: true, style: { fontSize: 14 }, children: user?.email || "-" })
|
|
2558
2706
|
] }),
|
|
2559
|
-
/* @__PURE__ */ (0,
|
|
2560
|
-
/* @__PURE__ */ (0,
|
|
2561
|
-
user?.organization ? /* @__PURE__ */ (0,
|
|
2562
|
-
/* @__PURE__ */ (0,
|
|
2563
|
-
/* @__PURE__ */ (0,
|
|
2564
|
-
] }) : /* @__PURE__ */ (0,
|
|
2565
|
-
/* @__PURE__ */ (0,
|
|
2566
|
-
/* @__PURE__ */ (0,
|
|
2707
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
2708
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text7, { type: "secondary", style: { fontSize: 12, display: "block", marginBottom: 4 }, children: labels.primaryOrganization }),
|
|
2709
|
+
user?.organization ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_antd11.Space, { size: 4, children: [
|
|
2710
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons9.BankOutlined, { style: { color: "#1890ff" } }),
|
|
2711
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text7, { style: { fontSize: 14 }, children: user.organization.name })
|
|
2712
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_antd11.Space, { size: 4, children: [
|
|
2713
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons9.GlobalOutlined, { style: { color: "#722ed1" } }),
|
|
2714
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text7, { style: { fontSize: 14 }, children: labels.global })
|
|
2567
2715
|
] })
|
|
2568
2716
|
] }),
|
|
2569
|
-
/* @__PURE__ */ (0,
|
|
2570
|
-
/* @__PURE__ */ (0,
|
|
2571
|
-
/* @__PURE__ */ (0,
|
|
2572
|
-
currentOrg && /* @__PURE__ */ (0,
|
|
2573
|
-
/* @__PURE__ */ (0,
|
|
2574
|
-
/* @__PURE__ */ (0,
|
|
2717
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
2718
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text7, { type: "secondary", style: { fontSize: 12, display: "block", marginBottom: 4 }, children: labels.currentContext }),
|
|
2719
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_antd11.Space, { size: 16, wrap: true, children: [
|
|
2720
|
+
currentOrg && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_antd11.Space, { size: 4, children: [
|
|
2721
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons9.BankOutlined, { style: { color: "#1890ff" } }),
|
|
2722
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text7, { style: { fontSize: 14 }, children: currentOrg.name })
|
|
2575
2723
|
] }),
|
|
2576
|
-
currentBranch && /* @__PURE__ */ (0,
|
|
2577
|
-
/* @__PURE__ */ (0,
|
|
2578
|
-
/* @__PURE__ */ (0,
|
|
2724
|
+
currentBranch && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_antd11.Space, { size: 4, children: [
|
|
2725
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons9.BranchesOutlined, { style: { color: "#52c41a" } }),
|
|
2726
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text7, { style: { fontSize: 14 }, children: currentBranch.name })
|
|
2579
2727
|
] })
|
|
2580
2728
|
] })
|
|
2581
2729
|
] }),
|
|
2582
|
-
/* @__PURE__ */ (0,
|
|
2583
|
-
/* @__PURE__ */ (0,
|
|
2584
|
-
/* @__PURE__ */ (0,
|
|
2730
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
2731
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text7, { type: "secondary", style: { fontSize: 12, display: "block", marginBottom: 4 }, children: labels.created }),
|
|
2732
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text7, { style: { fontSize: 14 }, children: user?.created_at ? new Date(user.created_at).toLocaleDateString() : "-" })
|
|
2585
2733
|
] }),
|
|
2586
|
-
/* @__PURE__ */ (0,
|
|
2587
|
-
/* @__PURE__ */ (0,
|
|
2588
|
-
/* @__PURE__ */ (0,
|
|
2734
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
2735
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text7, { type: "secondary", style: { fontSize: 12, display: "block", marginBottom: 4 }, children: labels.lastSignIn }),
|
|
2736
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text7, { style: { fontSize: 14 }, children: "-" })
|
|
2589
2737
|
] }),
|
|
2590
|
-
/* @__PURE__ */ (0,
|
|
2591
|
-
/* @__PURE__ */ (0,
|
|
2592
|
-
/* @__PURE__ */ (0,
|
|
2593
|
-
/* @__PURE__ */ (0,
|
|
2738
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
2739
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text7, { type: "secondary", style: { fontSize: 12, display: "block", marginBottom: 4 }, children: labels.roleAssignments }),
|
|
2740
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Text7, { style: { fontSize: 14 }, children: [
|
|
2741
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text7, { strong: true, children: roleAssignments.length }),
|
|
2594
2742
|
" ",
|
|
2595
2743
|
labels.roles.toLowerCase()
|
|
2596
2744
|
] })
|
|
@@ -2598,15 +2746,15 @@ function UserDetailCard({
|
|
|
2598
2746
|
]
|
|
2599
2747
|
}
|
|
2600
2748
|
) }),
|
|
2601
|
-
/* @__PURE__ */ (0,
|
|
2749
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_antd11.Card, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_antd11.Tabs, { defaultActiveKey: "permissions", items: tabItems }) })
|
|
2602
2750
|
] });
|
|
2603
2751
|
}
|
|
2604
2752
|
|
|
2605
2753
|
// src/ant/components/RoleCreateModal/RoleCreateModal.tsx
|
|
2606
2754
|
var import_icons10 = require("@ant-design/icons");
|
|
2607
|
-
var
|
|
2608
|
-
var
|
|
2609
|
-
var
|
|
2755
|
+
var import_antd12 = require("antd");
|
|
2756
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2757
|
+
var defaultTranslations5 = {
|
|
2610
2758
|
title: "\u30ED\u30FC\u30EB\u4F5C\u6210",
|
|
2611
2759
|
name: "\u540D\u524D",
|
|
2612
2760
|
slug: "\u30B9\u30E9\u30C3\u30B0",
|
|
@@ -2629,8 +2777,8 @@ function RoleCreateModal({
|
|
|
2629
2777
|
onCancel,
|
|
2630
2778
|
translations: t = {}
|
|
2631
2779
|
}) {
|
|
2632
|
-
const [form] =
|
|
2633
|
-
const labels = { ...
|
|
2780
|
+
const [form] = import_antd12.Form.useForm();
|
|
2781
|
+
const labels = { ...defaultTranslations5, ...t };
|
|
2634
2782
|
const handleFinish = async (values) => {
|
|
2635
2783
|
await onSubmit(values);
|
|
2636
2784
|
form.resetFields();
|
|
@@ -2639,86 +2787,86 @@ function RoleCreateModal({
|
|
|
2639
2787
|
form.resetFields();
|
|
2640
2788
|
onCancel();
|
|
2641
2789
|
};
|
|
2642
|
-
return /* @__PURE__ */ (0,
|
|
2643
|
-
|
|
2790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2791
|
+
import_antd12.Modal,
|
|
2644
2792
|
{
|
|
2645
|
-
title: /* @__PURE__ */ (0,
|
|
2646
|
-
/* @__PURE__ */ (0,
|
|
2793
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_antd12.Space, { children: [
|
|
2794
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons10.PlusOutlined, {}),
|
|
2647
2795
|
labels.title
|
|
2648
2796
|
] }),
|
|
2649
2797
|
open,
|
|
2650
2798
|
onCancel: handleCancel,
|
|
2651
2799
|
footer: null,
|
|
2652
2800
|
destroyOnHidden: true,
|
|
2653
|
-
children: /* @__PURE__ */ (0,
|
|
2654
|
-
|
|
2801
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
2802
|
+
import_antd12.Form,
|
|
2655
2803
|
{
|
|
2656
2804
|
form,
|
|
2657
2805
|
layout: "vertical",
|
|
2658
2806
|
onFinish: handleFinish,
|
|
2659
2807
|
initialValues: { level: 50, scope: "org", org_id: currentOrgId },
|
|
2660
2808
|
children: [
|
|
2661
|
-
/* @__PURE__ */ (0,
|
|
2662
|
-
|
|
2809
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2810
|
+
import_antd12.Form.Item,
|
|
2663
2811
|
{
|
|
2664
2812
|
name: "scope",
|
|
2665
2813
|
label: labels.scope,
|
|
2666
2814
|
rules: [{ required: true, message: labels.required }],
|
|
2667
|
-
children: /* @__PURE__ */ (0,
|
|
2668
|
-
/* @__PURE__ */ (0,
|
|
2669
|
-
/* @__PURE__ */ (0,
|
|
2815
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_antd12.Radio.Group, { children: [
|
|
2816
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_antd12.Radio, { value: "global", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_antd12.Space, { children: [
|
|
2817
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons10.GlobalOutlined, {}),
|
|
2670
2818
|
labels.global
|
|
2671
2819
|
] }) }),
|
|
2672
|
-
/* @__PURE__ */ (0,
|
|
2673
|
-
/* @__PURE__ */ (0,
|
|
2820
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_antd12.Radio, { value: "org", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_antd12.Space, { children: [
|
|
2821
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons10.BankOutlined, {}),
|
|
2674
2822
|
labels.orgRole
|
|
2675
2823
|
] }) })
|
|
2676
2824
|
] })
|
|
2677
2825
|
}
|
|
2678
2826
|
),
|
|
2679
|
-
/* @__PURE__ */ (0,
|
|
2680
|
-
|
|
2827
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_antd12.Form.Item, { noStyle: true, shouldUpdate: (prev, curr) => prev.scope !== curr.scope, children: ({ getFieldValue }) => getFieldValue("scope") === "org" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2828
|
+
import_antd12.Form.Item,
|
|
2681
2829
|
{
|
|
2682
2830
|
name: "org_id",
|
|
2683
2831
|
label: labels.organization,
|
|
2684
2832
|
rules: [{ required: true, message: labels.required }],
|
|
2685
|
-
children: /* @__PURE__ */ (0,
|
|
2686
|
-
/* @__PURE__ */ (0,
|
|
2833
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_antd12.Select, { placeholder: labels.organization, children: organizations.map((org) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_antd12.Select.Option, { value: String(org.id), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_antd12.Space, { children: [
|
|
2834
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons10.BankOutlined, {}),
|
|
2687
2835
|
org.name
|
|
2688
2836
|
] }) }, org.id)) })
|
|
2689
2837
|
}
|
|
2690
2838
|
) }),
|
|
2691
|
-
/* @__PURE__ */ (0,
|
|
2692
|
-
|
|
2839
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2840
|
+
import_antd12.Form.Item,
|
|
2693
2841
|
{
|
|
2694
2842
|
name: "name",
|
|
2695
2843
|
label: labels.name,
|
|
2696
2844
|
rules: [{ required: true, message: labels.required }],
|
|
2697
|
-
children: /* @__PURE__ */ (0,
|
|
2845
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_antd12.Input, {})
|
|
2698
2846
|
}
|
|
2699
2847
|
),
|
|
2700
|
-
/* @__PURE__ */ (0,
|
|
2701
|
-
|
|
2848
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2849
|
+
import_antd12.Form.Item,
|
|
2702
2850
|
{
|
|
2703
2851
|
name: "slug",
|
|
2704
2852
|
label: labels.slug,
|
|
2705
2853
|
rules: [{ required: true, message: labels.required }],
|
|
2706
|
-
children: /* @__PURE__ */ (0,
|
|
2854
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_antd12.Input, {})
|
|
2707
2855
|
}
|
|
2708
2856
|
),
|
|
2709
|
-
/* @__PURE__ */ (0,
|
|
2710
|
-
/* @__PURE__ */ (0,
|
|
2711
|
-
|
|
2857
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_antd12.Form.Item, { name: "description", label: labels.description, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_antd12.Input.TextArea, { rows: 3 }) }),
|
|
2858
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2859
|
+
import_antd12.Form.Item,
|
|
2712
2860
|
{
|
|
2713
2861
|
name: "level",
|
|
2714
2862
|
label: labels.level,
|
|
2715
2863
|
rules: [{ required: true, message: labels.required }],
|
|
2716
|
-
children: /* @__PURE__ */ (0,
|
|
2864
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_antd12.InputNumber, { min: 1, max: 100, style: { width: "100%" } })
|
|
2717
2865
|
}
|
|
2718
2866
|
),
|
|
2719
|
-
/* @__PURE__ */ (0,
|
|
2720
|
-
/* @__PURE__ */ (0,
|
|
2721
|
-
/* @__PURE__ */ (0,
|
|
2867
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_antd12.Form.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_antd12.Space, { children: [
|
|
2868
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_antd12.Button, { type: "primary", htmlType: "submit", loading, children: labels.create }),
|
|
2869
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_antd12.Button, { onClick: handleCancel, children: labels.cancel })
|
|
2722
2870
|
] }) })
|
|
2723
2871
|
]
|
|
2724
2872
|
}
|
|
@@ -2729,10 +2877,10 @@ function RoleCreateModal({
|
|
|
2729
2877
|
|
|
2730
2878
|
// src/ant/components/RolesListCard/RolesListCard.tsx
|
|
2731
2879
|
var import_icons11 = require("@ant-design/icons");
|
|
2732
|
-
var
|
|
2733
|
-
var
|
|
2734
|
-
var { Text:
|
|
2735
|
-
var
|
|
2880
|
+
var import_antd13 = require("antd");
|
|
2881
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2882
|
+
var { Text: Text8 } = import_antd13.Typography;
|
|
2883
|
+
var defaultTranslations6 = {
|
|
2736
2884
|
name: "\u540D\u524D",
|
|
2737
2885
|
scope: "\u30B9\u30B3\u30FC\u30D7",
|
|
2738
2886
|
level: "\u30EC\u30D9\u30EB",
|
|
@@ -2754,16 +2902,16 @@ function RolesListCard({
|
|
|
2754
2902
|
onDeleteClick,
|
|
2755
2903
|
translations: t = {}
|
|
2756
2904
|
}) {
|
|
2757
|
-
const labels = { ...
|
|
2905
|
+
const labels = { ...defaultTranslations6, ...t };
|
|
2758
2906
|
const columns = [
|
|
2759
2907
|
{
|
|
2760
2908
|
title: labels.name,
|
|
2761
2909
|
dataIndex: "name",
|
|
2762
2910
|
key: "name",
|
|
2763
|
-
render: (name, record) => /* @__PURE__ */ (0,
|
|
2764
|
-
/* @__PURE__ */ (0,
|
|
2765
|
-
/* @__PURE__ */ (0,
|
|
2766
|
-
/* @__PURE__ */ (0,
|
|
2911
|
+
render: (name, record) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_antd13.Space, { children: [
|
|
2912
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_icons11.SafetyOutlined, { style: { color: "#1890ff" } }),
|
|
2913
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text8, { strong: true, children: name }),
|
|
2914
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_antd13.Tag, { children: record.slug })
|
|
2767
2915
|
] })
|
|
2768
2916
|
},
|
|
2769
2917
|
{
|
|
@@ -2771,14 +2919,14 @@ function RolesListCard({
|
|
|
2771
2919
|
dataIndex: "console_org_id",
|
|
2772
2920
|
key: "scope",
|
|
2773
2921
|
width: 180,
|
|
2774
|
-
render: (_, record) => record.console_org_id ? /* @__PURE__ */ (0,
|
|
2922
|
+
render: (_, record) => record.console_org_id ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_antd13.Tag, { icon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_icons11.BankOutlined, {}), color: "blue", children: record.organization?.name || record.console_org_id }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_antd13.Tag, { icon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_icons11.GlobalOutlined, {}), color: "purple", children: labels.global })
|
|
2775
2923
|
},
|
|
2776
2924
|
{
|
|
2777
2925
|
title: labels.level,
|
|
2778
2926
|
dataIndex: "level",
|
|
2779
2927
|
key: "level",
|
|
2780
2928
|
width: 100,
|
|
2781
|
-
render: (level) => /* @__PURE__ */ (0,
|
|
2929
|
+
render: (level) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_antd13.Tag, { color: "blue", children: level })
|
|
2782
2930
|
},
|
|
2783
2931
|
{
|
|
2784
2932
|
title: labels.description,
|
|
@@ -2790,45 +2938,45 @@ function RolesListCard({
|
|
|
2790
2938
|
title: labels.actions,
|
|
2791
2939
|
key: "actions",
|
|
2792
2940
|
width: 180,
|
|
2793
|
-
render: (_, record) => /* @__PURE__ */ (0,
|
|
2794
|
-
/* @__PURE__ */ (0,
|
|
2795
|
-
/* @__PURE__ */ (0,
|
|
2941
|
+
render: (_, record) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_antd13.Space, { children: [
|
|
2942
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_antd13.Button, { size: "small", icon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_icons11.EyeOutlined, {}), onClick: () => onViewClick(record), children: labels.detail }),
|
|
2943
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_antd13.Popconfirm, { title: labels.confirmDeleteRole, onConfirm: () => onDeleteClick(record), children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_antd13.Button, { size: "small", danger: true, icon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_icons11.DeleteOutlined, {}) }) })
|
|
2796
2944
|
] })
|
|
2797
2945
|
}
|
|
2798
2946
|
];
|
|
2799
|
-
return /* @__PURE__ */ (0,
|
|
2800
|
-
|
|
2947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2948
|
+
import_antd13.Card,
|
|
2801
2949
|
{
|
|
2802
|
-
title: /* @__PURE__ */ (0,
|
|
2803
|
-
/* @__PURE__ */ (0,
|
|
2950
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_antd13.Space, { children: [
|
|
2951
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_icons11.SafetyOutlined, {}),
|
|
2804
2952
|
"Roles"
|
|
2805
2953
|
] }),
|
|
2806
|
-
extra: /* @__PURE__ */ (0,
|
|
2954
|
+
extra: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_antd13.Button, { type: "primary", icon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_icons11.PlusOutlined, {}), onClick: onCreateClick, children: "Create" }),
|
|
2807
2955
|
children: [
|
|
2808
|
-
/* @__PURE__ */ (0,
|
|
2809
|
-
|
|
2956
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { marginBottom: 16, display: "flex", gap: 16 }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2957
|
+
import_antd13.Select,
|
|
2810
2958
|
{
|
|
2811
2959
|
value: scopeFilter,
|
|
2812
2960
|
onChange: onScopeFilterChange,
|
|
2813
2961
|
style: { minWidth: 200 },
|
|
2814
2962
|
children: [
|
|
2815
|
-
/* @__PURE__ */ (0,
|
|
2816
|
-
/* @__PURE__ */ (0,
|
|
2963
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_antd13.Select.Option, { value: "all", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_antd13.Space, { children: [
|
|
2964
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_icons11.SafetyOutlined, {}),
|
|
2817
2965
|
labels.all
|
|
2818
2966
|
] }) }),
|
|
2819
|
-
/* @__PURE__ */ (0,
|
|
2820
|
-
/* @__PURE__ */ (0,
|
|
2967
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_antd13.Select.Option, { value: "global", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_antd13.Space, { children: [
|
|
2968
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_icons11.GlobalOutlined, {}),
|
|
2821
2969
|
labels.global
|
|
2822
2970
|
] }) }),
|
|
2823
|
-
/* @__PURE__ */ (0,
|
|
2824
|
-
/* @__PURE__ */ (0,
|
|
2971
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_antd13.Select.Option, { value: "org", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_antd13.Space, { children: [
|
|
2972
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_icons11.BankOutlined, {}),
|
|
2825
2973
|
labels.orgRole
|
|
2826
2974
|
] }) })
|
|
2827
2975
|
]
|
|
2828
2976
|
}
|
|
2829
2977
|
) }),
|
|
2830
|
-
/* @__PURE__ */ (0,
|
|
2831
|
-
|
|
2978
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2979
|
+
import_antd13.Table,
|
|
2832
2980
|
{
|
|
2833
2981
|
columns,
|
|
2834
2982
|
dataSource: roles,
|
|
@@ -2844,11 +2992,11 @@ function RolesListCard({
|
|
|
2844
2992
|
|
|
2845
2993
|
// src/ant/components/PermissionsListCard/PermissionsListCard.tsx
|
|
2846
2994
|
var import_icons12 = require("@ant-design/icons");
|
|
2847
|
-
var
|
|
2848
|
-
var
|
|
2849
|
-
var
|
|
2850
|
-
var { Text:
|
|
2851
|
-
var
|
|
2995
|
+
var import_antd14 = require("antd");
|
|
2996
|
+
var import_react15 = require("react");
|
|
2997
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2998
|
+
var { Text: Text9 } = import_antd14.Typography;
|
|
2999
|
+
var defaultTranslations7 = {
|
|
2852
3000
|
searchPermissions: "\u6A29\u9650\u3092\u691C\u7D22",
|
|
2853
3001
|
name: "\u540D\u524D",
|
|
2854
3002
|
slug: "\u30B9\u30E9\u30C3\u30B0",
|
|
@@ -2862,16 +3010,16 @@ function PermissionsListCard({
|
|
|
2862
3010
|
translations: t = {},
|
|
2863
3011
|
onGroupLabelRender
|
|
2864
3012
|
}) {
|
|
2865
|
-
const [search, setSearch] = (0,
|
|
2866
|
-
const labels = { ...
|
|
2867
|
-
const filteredPermissions = (0,
|
|
3013
|
+
const [search, setSearch] = (0, import_react15.useState)("");
|
|
3014
|
+
const labels = { ...defaultTranslations7, ...t };
|
|
3015
|
+
const filteredPermissions = (0, import_react15.useMemo)(() => {
|
|
2868
3016
|
if (!search) return permissions;
|
|
2869
3017
|
const lowerSearch = search.toLowerCase();
|
|
2870
3018
|
return permissions.filter(
|
|
2871
3019
|
(p) => p.name.toLowerCase().includes(lowerSearch) || p.slug.toLowerCase().includes(lowerSearch) || (p.group || "").toLowerCase().includes(lowerSearch)
|
|
2872
3020
|
);
|
|
2873
3021
|
}, [permissions, search]);
|
|
2874
|
-
const groupedPermissions = (0,
|
|
3022
|
+
const groupedPermissions = (0, import_react15.useMemo)(() => {
|
|
2875
3023
|
const grouped = {};
|
|
2876
3024
|
filteredPermissions.forEach((perm) => {
|
|
2877
3025
|
const group = perm.group || "other";
|
|
@@ -2889,27 +3037,27 @@ function PermissionsListCard({
|
|
|
2889
3037
|
title: labels.name,
|
|
2890
3038
|
dataIndex: "name",
|
|
2891
3039
|
key: "name",
|
|
2892
|
-
render: (name) => /* @__PURE__ */ (0,
|
|
2893
|
-
/* @__PURE__ */ (0,
|
|
2894
|
-
/* @__PURE__ */ (0,
|
|
3040
|
+
render: (name) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_antd14.Space, { children: [
|
|
3041
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_icons12.KeyOutlined, { style: { color: "#52c41a" } }),
|
|
3042
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text9, { strong: true, children: name })
|
|
2895
3043
|
] })
|
|
2896
3044
|
},
|
|
2897
3045
|
{
|
|
2898
3046
|
title: labels.slug,
|
|
2899
3047
|
dataIndex: "slug",
|
|
2900
3048
|
key: "slug",
|
|
2901
|
-
render: (slug) => /* @__PURE__ */ (0,
|
|
3049
|
+
render: (slug) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_antd14.Tag, { color: "blue", children: slug })
|
|
2902
3050
|
},
|
|
2903
3051
|
{
|
|
2904
3052
|
title: labels.group,
|
|
2905
3053
|
dataIndex: "group",
|
|
2906
3054
|
key: "group",
|
|
2907
|
-
render: (group) => /* @__PURE__ */ (0,
|
|
3055
|
+
render: (group) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_antd14.Tag, { icon: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_icons12.AppstoreOutlined, {}), color: "purple", children: getGroupLabel(group || "other") })
|
|
2908
3056
|
}
|
|
2909
3057
|
];
|
|
2910
|
-
return /* @__PURE__ */ (0,
|
|
2911
|
-
/* @__PURE__ */ (0,
|
|
2912
|
-
|
|
3058
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_antd14.Card, { children: [
|
|
3059
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3060
|
+
import_antd14.Input.Search,
|
|
2913
3061
|
{
|
|
2914
3062
|
placeholder: labels.searchPermissions,
|
|
2915
3063
|
allowClear: true,
|
|
@@ -2918,16 +3066,16 @@ function PermissionsListCard({
|
|
|
2918
3066
|
style: { maxWidth: 300 }
|
|
2919
3067
|
}
|
|
2920
3068
|
) }),
|
|
2921
|
-
/* @__PURE__ */ (0,
|
|
2922
|
-
|
|
3069
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_antd14.Collapse, { defaultActiveKey: groups, ghost: true, children: Object.entries(groupedPermissions).map(([group, perms]) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3070
|
+
import_antd14.Collapse.Panel,
|
|
2923
3071
|
{
|
|
2924
|
-
header: /* @__PURE__ */ (0,
|
|
2925
|
-
/* @__PURE__ */ (0,
|
|
2926
|
-
/* @__PURE__ */ (0,
|
|
2927
|
-
/* @__PURE__ */ (0,
|
|
3072
|
+
header: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_antd14.Space, { children: [
|
|
3073
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_icons12.AppstoreOutlined, { style: { color: "#722ed1" } }),
|
|
3074
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text9, { strong: true, children: getGroupLabel(group) }),
|
|
3075
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_antd14.Tag, { children: perms.length })
|
|
2928
3076
|
] }),
|
|
2929
|
-
children: /* @__PURE__ */ (0,
|
|
2930
|
-
|
|
3077
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3078
|
+
import_antd14.Table,
|
|
2931
3079
|
{
|
|
2932
3080
|
columns,
|
|
2933
3081
|
dataSource: perms,
|
|
@@ -2940,16 +3088,16 @@ function PermissionsListCard({
|
|
|
2940
3088
|
},
|
|
2941
3089
|
group
|
|
2942
3090
|
)) }),
|
|
2943
|
-
filteredPermissions.length === 0 && !loading && /* @__PURE__ */ (0,
|
|
3091
|
+
filteredPermissions.length === 0 && !loading && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { textAlign: "center", padding: 40 }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text9, { type: "secondary", children: labels.noData }) })
|
|
2944
3092
|
] });
|
|
2945
3093
|
}
|
|
2946
3094
|
|
|
2947
3095
|
// src/ant/components/TeamsListCard/TeamsListCard.tsx
|
|
2948
3096
|
var import_icons13 = require("@ant-design/icons");
|
|
2949
|
-
var
|
|
2950
|
-
var
|
|
2951
|
-
var { Text:
|
|
2952
|
-
var
|
|
3097
|
+
var import_antd15 = require("antd");
|
|
3098
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3099
|
+
var { Text: Text10 } = import_antd15.Typography;
|
|
3100
|
+
var defaultTranslations8 = {
|
|
2953
3101
|
name: "\u540D\u524D",
|
|
2954
3102
|
memberCount: "\u30E1\u30F3\u30D0\u30FC\u6570",
|
|
2955
3103
|
permissions: "\u6A29\u9650",
|
|
@@ -2963,15 +3111,15 @@ function TeamsListCard({
|
|
|
2963
3111
|
loading = false,
|
|
2964
3112
|
translations: t = {}
|
|
2965
3113
|
}) {
|
|
2966
|
-
const labels = { ...
|
|
3114
|
+
const labels = { ...defaultTranslations8, ...t };
|
|
2967
3115
|
const columns = [
|
|
2968
3116
|
{
|
|
2969
3117
|
title: labels.name,
|
|
2970
3118
|
dataIndex: "name",
|
|
2971
3119
|
key: "name",
|
|
2972
|
-
render: (name) => /* @__PURE__ */ (0,
|
|
2973
|
-
/* @__PURE__ */ (0,
|
|
2974
|
-
/* @__PURE__ */ (0,
|
|
3120
|
+
render: (name) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { children: [
|
|
3121
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_icons13.TeamOutlined, { style: { marginRight: 8, color: "#1890ff" } }),
|
|
3122
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text10, { strong: true, children: name })
|
|
2975
3123
|
] })
|
|
2976
3124
|
},
|
|
2977
3125
|
{
|
|
@@ -2979,33 +3127,33 @@ function TeamsListCard({
|
|
|
2979
3127
|
dataIndex: "member_count",
|
|
2980
3128
|
key: "member_count",
|
|
2981
3129
|
width: 120,
|
|
2982
|
-
render: (count) => /* @__PURE__ */ (0,
|
|
3130
|
+
render: (count) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_antd15.Tag, { icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_icons13.UserOutlined, {}), children: count })
|
|
2983
3131
|
},
|
|
2984
3132
|
{
|
|
2985
3133
|
title: labels.permissions,
|
|
2986
3134
|
dataIndex: "permissions",
|
|
2987
3135
|
key: "permissions",
|
|
2988
|
-
render: (permissions) => /* @__PURE__ */ (0,
|
|
3136
|
+
render: (permissions) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: permissions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_antd15.Tag, { color: "blue", children: [
|
|
2989
3137
|
permissions.length,
|
|
2990
3138
|
" ",
|
|
2991
3139
|
labels.permissions
|
|
2992
|
-
] }) : /* @__PURE__ */ (0,
|
|
3140
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_antd15.Tag, { children: [
|
|
2993
3141
|
"0 ",
|
|
2994
3142
|
labels.permissions
|
|
2995
3143
|
] }) })
|
|
2996
3144
|
}
|
|
2997
3145
|
];
|
|
2998
|
-
return /* @__PURE__ */ (0,
|
|
2999
|
-
|
|
3146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_antd15.Card, { children: teams.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3147
|
+
import_antd15.Empty,
|
|
3000
3148
|
{
|
|
3001
|
-
description: /* @__PURE__ */ (0,
|
|
3149
|
+
description: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { children: [
|
|
3002
3150
|
labels.noTeams,
|
|
3003
|
-
/* @__PURE__ */ (0,
|
|
3004
|
-
/* @__PURE__ */ (0,
|
|
3151
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("br", {}),
|
|
3152
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text10, { type: "secondary", style: { fontSize: 12 }, children: labels.teamsFromConsole })
|
|
3005
3153
|
] })
|
|
3006
3154
|
}
|
|
3007
|
-
) : /* @__PURE__ */ (0,
|
|
3008
|
-
|
|
3155
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3156
|
+
import_antd15.Table,
|
|
3009
3157
|
{
|
|
3010
3158
|
columns,
|
|
3011
3159
|
dataSource: teams,
|
|
@@ -3013,13 +3161,13 @@ function TeamsListCard({
|
|
|
3013
3161
|
loading,
|
|
3014
3162
|
pagination: { pageSize: 10 },
|
|
3015
3163
|
expandable: {
|
|
3016
|
-
expandedRowRender: (record) => /* @__PURE__ */ (0,
|
|
3017
|
-
/* @__PURE__ */ (0,
|
|
3018
|
-
/* @__PURE__ */ (0,
|
|
3164
|
+
expandedRowRender: (record) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: { padding: "8px 0" }, children: [
|
|
3165
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Text10, { strong: true, style: { marginBottom: 8, display: "block" }, children: [
|
|
3166
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_icons13.KeyOutlined, { style: { marginRight: 4 } }),
|
|
3019
3167
|
labels.teamPermissions,
|
|
3020
3168
|
":"
|
|
3021
3169
|
] }),
|
|
3022
|
-
record.permissions.length === 0 ? /* @__PURE__ */ (0,
|
|
3170
|
+
record.permissions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text10, { type: "secondary", children: labels.noData }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { display: "flex", flexWrap: "wrap", gap: 4 }, children: record.permissions.map((perm) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_antd15.Tag, { color: "cyan", children: perm }, perm)) })
|
|
3023
3171
|
] })
|
|
3024
3172
|
}
|
|
3025
3173
|
}
|
|
@@ -3027,12 +3175,12 @@ function TeamsListCard({
|
|
|
3027
3175
|
}
|
|
3028
3176
|
|
|
3029
3177
|
// src/ant/theme/AntdThemeProvider.tsx
|
|
3030
|
-
var
|
|
3178
|
+
var import_antd16 = require("antd");
|
|
3031
3179
|
var import_en_US = __toESM(require("antd/locale/en_US"), 1);
|
|
3032
3180
|
var import_ja_JP = __toESM(require("antd/locale/ja_JP"), 1);
|
|
3033
3181
|
var import_vi_VN = __toESM(require("antd/locale/vi_VN"), 1);
|
|
3034
|
-
var
|
|
3035
|
-
var
|
|
3182
|
+
var import_react16 = require("react");
|
|
3183
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3036
3184
|
var antdLocales = {
|
|
3037
3185
|
ja: import_ja_JP.default,
|
|
3038
3186
|
en: import_en_US.default,
|
|
@@ -3071,15 +3219,15 @@ function AntdThemeProvider({ children, variant = "dashboard", setDayjsLocale })
|
|
|
3071
3219
|
const antdLocale = antdLocales[locale] ?? import_ja_JP.default;
|
|
3072
3220
|
const fontFamily = fontFamilies[locale] ?? fontFamilies.ja;
|
|
3073
3221
|
const colors = themeColors[variant];
|
|
3074
|
-
(0,
|
|
3222
|
+
(0, import_react16.useEffect)(() => {
|
|
3075
3223
|
setDayjsLocale?.(locale);
|
|
3076
3224
|
}, [locale, setDayjsLocale]);
|
|
3077
|
-
return /* @__PURE__ */ (0,
|
|
3078
|
-
|
|
3225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3226
|
+
import_antd16.ConfigProvider,
|
|
3079
3227
|
{
|
|
3080
3228
|
locale: antdLocale,
|
|
3081
3229
|
theme: {
|
|
3082
|
-
algorithm:
|
|
3230
|
+
algorithm: import_antd16.theme.defaultAlgorithm,
|
|
3083
3231
|
token: {
|
|
3084
3232
|
// ===========================================
|
|
3085
3233
|
// Tempofast Design System (HSL-based harmony)
|
|
@@ -3203,7 +3351,7 @@ function AntdThemeProvider({ children, variant = "dashboard", setDayjsLocale })
|
|
|
3203
3351
|
}
|
|
3204
3352
|
}
|
|
3205
3353
|
},
|
|
3206
|
-
children: /* @__PURE__ */ (0,
|
|
3354
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_antd16.App, { children })
|
|
3207
3355
|
}
|
|
3208
3356
|
);
|
|
3209
3357
|
}
|
|
@@ -3213,6 +3361,7 @@ function AntdThemeProvider({ children, variant = "dashboard", setDayjsLocale })
|
|
|
3213
3361
|
BranchGate,
|
|
3214
3362
|
LocaleSwitcher,
|
|
3215
3363
|
OrgBranchSelectorModal,
|
|
3364
|
+
OrgGate,
|
|
3216
3365
|
OrganizationSwitcher,
|
|
3217
3366
|
PROTABLE_DEFAULT_TEXTS,
|
|
3218
3367
|
PageContainer,
|