@nocobase/client 1.5.8 → 1.5.10
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/es/application/CustomRouterContextProvider.d.ts +4 -1
- package/es/index.mjs +28 -19
- package/lib/index.js +5 -5
- package/package.json +5 -5
|
@@ -47,5 +47,8 @@ export declare const useRouterBasename: () => string;
|
|
|
47
47
|
* Used to determine if the user closed the sub-page by clicking on the page menu
|
|
48
48
|
* @returns
|
|
49
49
|
*/
|
|
50
|
-
export declare const useIsSubPageClosedByPageMenu: (fieldSchema: Schema) =>
|
|
50
|
+
export declare const useIsSubPageClosedByPageMenu: (fieldSchema: Schema) => {
|
|
51
|
+
isSubPageClosedByPageMenu: () => boolean;
|
|
52
|
+
reset: () => void;
|
|
53
|
+
};
|
|
51
54
|
export declare const CustomRouterContextProvider: FC;
|
package/es/index.mjs
CHANGED
|
@@ -6020,18 +6020,22 @@ SearchParamsContext.displayName = "SearchParamsContext";
|
|
|
6020
6020
|
const RouterBasenameContext = React.createContext("");
|
|
6021
6021
|
RouterBasenameContext.displayName = "RouterBasenameContext";
|
|
6022
6022
|
const IsSubPageClosedByPageMenuContext = React.createContext({
|
|
6023
|
-
isSubPageClosedByPageMenu: !1,
|
|
6023
|
+
isSubPageClosedByPageMenu: () => !1,
|
|
6024
6024
|
setFieldSchema: () => {
|
|
6025
|
+
},
|
|
6026
|
+
reset: () => {
|
|
6025
6027
|
}
|
|
6026
6028
|
});
|
|
6027
6029
|
IsSubPageClosedByPageMenuContext.displayName = "IsSubPageClosedByPageMenuContext";
|
|
6028
6030
|
const IsSubPageClosedByPageMenuProvider = ({ children: e }) => {
|
|
6029
|
-
const t = useParams(), n = useRef({}), [o, r] = useState(null), i =
|
|
6030
|
-
var
|
|
6031
|
-
const
|
|
6032
|
-
return n.current = t,
|
|
6033
|
-
}, [o, t]), a =
|
|
6034
|
-
|
|
6031
|
+
const t = useParams(), n = useRef({}), [o, r] = useState(null), i = useCallback(() => {
|
|
6032
|
+
var u, d;
|
|
6033
|
+
const c = _.isEmpty(t["*"]) && ((u = o == null ? void 0 : o["x-component-props"]) == null ? void 0 : u.openMode) === "page" && !!((d = n.current["*"]) != null && d.includes(o["x-uid"]));
|
|
6034
|
+
return n.current = t, c;
|
|
6035
|
+
}, [o, t]), a = useCallback(() => {
|
|
6036
|
+
n.current = {};
|
|
6037
|
+
}, []), l = useMemo(() => ({ isSubPageClosedByPageMenu: i, setFieldSchema: r, reset: a }), [i, a]);
|
|
6038
|
+
return /* @__PURE__ */ jsx(IsSubPageClosedByPageMenuContext.Provider, { value: l, children: e });
|
|
6035
6039
|
}, RouterBasenameProvider = ({ children: e }) => {
|
|
6036
6040
|
const t = useHref("/");
|
|
6037
6041
|
return /* @__PURE__ */ jsx(RouterBasenameContext.Provider, { value: t, children: e });
|
|
@@ -6072,10 +6076,10 @@ const IsSubPageClosedByPageMenuProvider = ({ children: e }) => {
|
|
|
6072
6076
|
const t = useLocation();
|
|
6073
6077
|
return /* @__PURE__ */ jsx(LocationSearchContext.Provider, { value: t.search, children: e });
|
|
6074
6078
|
}, useNavigateNoUpdate = () => React.useContext(NavigateNoUpdateContext), useLocationNoUpdate = () => React.useContext(LocationNoUpdateContext), useLocationSearch = () => React.useContext(LocationSearchContext), useIsAdminPage = () => React.useContext(IsAdminPageContext), useCurrentPageUid = () => React.useContext(CurrentPageUidContext), useMatchAdmin = () => React.useContext(MatchAdminContext), useMatchAdminName = () => React.useContext(MatchAdminNameContext), useIsInSettingsPage = () => React.useContext(IsInSettingsPageContext), useCurrentTabUid = () => React.useContext(CurrentTabUidContext), useCurrentSearchParams = () => React.useContext(SearchParamsContext), useRouterBasename = () => React.useContext(RouterBasenameContext), useIsSubPageClosedByPageMenu = (e) => {
|
|
6075
|
-
const { isSubPageClosedByPageMenu: t, setFieldSchema: n } = React.useContext(IsSubPageClosedByPageMenuContext);
|
|
6079
|
+
const { isSubPageClosedByPageMenu: t, setFieldSchema: n, reset: o } = React.useContext(IsSubPageClosedByPageMenuContext);
|
|
6076
6080
|
return useEffect(() => {
|
|
6077
6081
|
n(e);
|
|
6078
|
-
}, [e, n]), t;
|
|
6082
|
+
}, [e, n]), { isSubPageClosedByPageMenu: t, reset: o };
|
|
6079
6083
|
}, CustomRouterContextProvider = ({ children: e }) => /* @__PURE__ */ jsx(NavigateNoUpdateProvider, { children: /* @__PURE__ */ jsx(LocationNoUpdateProvider, { children: /* @__PURE__ */ jsx(IsAdminPageProvider, { children: /* @__PURE__ */ jsx(LocationSearchProvider, { children: /* @__PURE__ */ jsx(MatchAdminProvider, { children: /* @__PURE__ */ jsx(MatchAdminNameProvider, { children: /* @__PURE__ */ jsx(SearchParamsProvider, { children: /* @__PURE__ */ jsx(RouterBasenameProvider, { children: /* @__PURE__ */ jsx(IsInSettingsPageProvider, { children: e }) }) }) }) }) }) }) }) }), useDefaultDynamicComponentProps = () => {
|
|
6080
6084
|
}, getHook = (e, t, n) => {
|
|
6081
6085
|
let o;
|
|
@@ -10782,14 +10786,14 @@ const InternalTableBlockProvider = (e) => {
|
|
|
10782
10786
|
ActionContext.displayName = "ActionContext";
|
|
10783
10787
|
const ActionContextProvider = React.memo(
|
|
10784
10788
|
(e) => {
|
|
10785
|
-
const [t, n] = useState(!1), { visible: o } = x(x({}, e), e.value), { setSubmitted: r } = x(x({}, e), e.value), i = useBlockServiceInActionButton(), a = useIsSubPageClosedByPageMenu(useFieldSchema());
|
|
10789
|
+
const [t, n] = useState(!1), { visible: o } = x(x({}, e), e.value), { setSubmitted: r } = x(x({}, e), e.value), i = useBlockServiceInActionButton(), { isSubPageClosedByPageMenu: a, reset: l } = useIsSubPageClosedByPageMenu(useFieldSchema());
|
|
10786
10790
|
useEffect(() => {
|
|
10787
10791
|
q(void 0, null, function* () {
|
|
10788
|
-
o === !1 && i && !i.loading && (t || a) && (i.loading = !0, yield i.refreshAsync(), i.loading = !1, n(!1), r == null || r(!0));
|
|
10792
|
+
o === !1 && i && !i.loading && (t || a()) && (l(), i.loading = !0, yield i.refreshAsync(), i.loading = !1, n(!1), r == null || r(!0));
|
|
10789
10793
|
});
|
|
10790
|
-
}, [o, i
|
|
10791
|
-
const
|
|
10792
|
-
return /* @__PURE__ */ jsx(ActionContext.Provider, { value:
|
|
10794
|
+
}, [o, i, r, a, t, l]);
|
|
10795
|
+
const c = useMemo(() => P(x(x({}, e), e == null ? void 0 : e.value), { submitted: t, setSubmitted: n }), [e, t]);
|
|
10796
|
+
return /* @__PURE__ */ jsx(ActionContext.Provider, { value: c, children: e.children });
|
|
10793
10797
|
}
|
|
10794
10798
|
);
|
|
10795
10799
|
ActionContextProvider.displayName = "ActionContextProvider";
|
|
@@ -13757,6 +13761,7 @@ function getGroupItemForTable({
|
|
|
13757
13761
|
};
|
|
13758
13762
|
return {
|
|
13759
13763
|
type: "item",
|
|
13764
|
+
key: `${t.target}_${g.name}_${C}`,
|
|
13760
13765
|
name: C,
|
|
13761
13766
|
title: ((S = g == null ? void 0 : g.uiSchema) == null ? void 0 : S.title) || g.name,
|
|
13762
13767
|
Component: "TableCollectionFieldInitializer",
|
|
@@ -13776,6 +13781,7 @@ function getGroupItemForTable({
|
|
|
13776
13781
|
};
|
|
13777
13782
|
}), p = [{
|
|
13778
13783
|
type: "itemGroup",
|
|
13784
|
+
key: `${t.target}_${r}_displayFields`,
|
|
13779
13785
|
name: `${r}-displayCollectionFields`,
|
|
13780
13786
|
title: l("Display fields"),
|
|
13781
13787
|
children: u
|
|
@@ -13794,6 +13800,7 @@ function getGroupItemForTable({
|
|
|
13794
13800
|
if (g.length) {
|
|
13795
13801
|
const f = {
|
|
13796
13802
|
type: "itemGroup",
|
|
13803
|
+
key: `${t.target}_${r}_associationFields`,
|
|
13797
13804
|
name: `${r}-associationFields`,
|
|
13798
13805
|
title: l("Display association fields"),
|
|
13799
13806
|
children: g
|
|
@@ -13803,7 +13810,8 @@ function getGroupItemForTable({
|
|
|
13803
13810
|
}
|
|
13804
13811
|
return {
|
|
13805
13812
|
type: "subMenu",
|
|
13806
|
-
|
|
13813
|
+
key: `${t.target}_${r}_submenu`,
|
|
13814
|
+
name: r,
|
|
13807
13815
|
title: (h = t.uiSchema) == null ? void 0 : h.title,
|
|
13808
13816
|
children: p
|
|
13809
13817
|
};
|
|
@@ -35192,7 +35200,7 @@ function addAppVersion(e, t) {
|
|
|
35192
35200
|
addAppVersion((o = e.properties) == null ? void 0 : o[n], t);
|
|
35193
35201
|
}), e;
|
|
35194
35202
|
}
|
|
35195
|
-
const name = "@nocobase/client", version = "1.5.
|
|
35203
|
+
const name = "@nocobase/client", version = "1.5.10", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
|
|
35196
35204
|
"@ahooksjs/use-url-state": "3.5.1",
|
|
35197
35205
|
"@ant-design/cssinjs": "^1.11.1",
|
|
35198
35206
|
"@ant-design/icons": "^5.1.4",
|
|
@@ -35214,9 +35222,9 @@ const name = "@nocobase/client", version = "1.5.8", license = "AGPL-3.0", main =
|
|
|
35214
35222
|
"@formily/reactive-react": "^2.2.27",
|
|
35215
35223
|
"@formily/shared": "^2.2.27",
|
|
35216
35224
|
"@formily/validator": "^2.2.27",
|
|
35217
|
-
"@nocobase/evaluators": "1.5.
|
|
35218
|
-
"@nocobase/sdk": "1.5.
|
|
35219
|
-
"@nocobase/utils": "1.5.
|
|
35225
|
+
"@nocobase/evaluators": "1.5.10",
|
|
35226
|
+
"@nocobase/sdk": "1.5.10",
|
|
35227
|
+
"@nocobase/utils": "1.5.10",
|
|
35220
35228
|
ahooks: "^3.7.2",
|
|
35221
35229
|
antd: "5.12.8",
|
|
35222
35230
|
"antd-style": "3.7.1",
|
|
@@ -37431,6 +37439,7 @@ const useStyles$9 = genStyleHook("nb-page", (e) => {
|
|
|
37431
37439
|
display: "flex",
|
|
37432
37440
|
flexDirection: "column",
|
|
37433
37441
|
overflowY: "auto",
|
|
37442
|
+
overflowX: "hidden",
|
|
37434
37443
|
"&:hover": { "> .general-schema-designer": { display: "block" } },
|
|
37435
37444
|
".ant-page-header": { zIndex: 1, position: "relative" },
|
|
37436
37445
|
"> .general-schema-designer": {
|