@nocobase/client 1.6.32 → 1.6.34
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.
|
@@ -18,6 +18,11 @@ export declare const CurrentPageUidContext: React.Context<string>;
|
|
|
18
18
|
* @internal
|
|
19
19
|
*/
|
|
20
20
|
export declare const CurrentTabUidContext: React.Context<string>;
|
|
21
|
+
export declare const IsSubPageClosedByPageMenuContext: React.Context<{
|
|
22
|
+
isSubPageClosedByPageMenu: () => boolean;
|
|
23
|
+
setFieldSchema: React.Dispatch<React.SetStateAction<Schema>>;
|
|
24
|
+
reset: () => void;
|
|
25
|
+
}>;
|
|
21
26
|
export declare const IsSubPageClosedByPageMenuProvider: FC;
|
|
22
27
|
export declare const CurrentPageUidProvider: FC;
|
|
23
28
|
export declare const CurrentTabUidProvider: FC;
|
|
@@ -34,8 +39,6 @@ export declare const useLocationNoUpdate: () => Location<any>;
|
|
|
34
39
|
export declare const useLocationSearch: () => string;
|
|
35
40
|
export declare const useIsAdminPage: () => boolean;
|
|
36
41
|
export declare const useCurrentPageUid: () => string;
|
|
37
|
-
export declare const useMatchAdmin: () => boolean;
|
|
38
|
-
export declare const useMatchAdminName: () => boolean;
|
|
39
42
|
export declare const useIsInSettingsPage: () => boolean;
|
|
40
43
|
/**
|
|
41
44
|
* @internal
|
package/es/index.mjs
CHANGED
|
@@ -62,7 +62,7 @@ import _, { filter, capitalize, cloneDeep as cloneDeep$1, isArray, every, some,
|
|
|
62
62
|
import template from "lodash/template";
|
|
63
63
|
import React, { createContext, useContext, useMemo, Fragment, useCallback, useEffect, memo, useState, useRef, Suspense, useDeferredValue, createElement, isValidElement, lazy as lazy$1, startTransition, useLayoutEffect, forwardRef, useImperativeHandle, createRef } from "react";
|
|
64
64
|
import * as ReactRouterDom from "react-router-dom";
|
|
65
|
-
import { useParams, useHref, useSearchParams, useLocation,
|
|
65
|
+
import { useParams, useHref, useSearchParams, useLocation, useNavigate, UNSAFE_LocationContext, UNSAFE_RouteContext, UNSAFE_DataRouterContext, UNSAFE_DataRouterStateContext, Outlet, createHashRouter, createBrowserRouter, createMemoryRouter, useRouteError, RouterProvider, Link as Link$1, Navigate, NavLink, Router, useOutletContext } from "react-router-dom";
|
|
66
66
|
import * as formilyShared from "@formily/shared";
|
|
67
67
|
import { merge, uid, isArr, isFn, applyMiddleware, isNum as isNum$1, isStr, isBool, toArr as toArr$3, isReactElement, isValid, FormPath, each, isEmpty as isEmpty$2 } from "@formily/shared";
|
|
68
68
|
import * as formilyJsonReactive from "@formily/reactive";
|
|
@@ -107,16 +107,13 @@ import { observer } from "@formily/reactive-react";
|
|
|
107
107
|
import cronstrue from "cronstrue";
|
|
108
108
|
import * as antdStyle from "antd-style";
|
|
109
109
|
import { createGlobalStyle, useAntdToken, createStyles } from "antd-style";
|
|
110
|
-
import { createStyles as
|
|
110
|
+
import { createStyles as vn } from "antd-style";
|
|
111
111
|
import JSON5 from "json5";
|
|
112
112
|
import { usePrefixCls as usePrefixCls$1, dayjsable, formatDayjsValue } from "@formily/antd-v5/esm/__builtins__";
|
|
113
|
-
import * as dndKitAccessibility from "@dnd-kit/accessibility";
|
|
114
113
|
import * as dndKitCore from "@dnd-kit/core";
|
|
115
114
|
import { DndContext as DndContext$1, rectIntersection, DragOverlay, useDroppable, useDndContext, useDndMonitor, useDraggable } from "@dnd-kit/core";
|
|
116
|
-
import * as dndKitModifiers from "@dnd-kit/modifiers";
|
|
117
115
|
import * as dndKitSortable from "@dnd-kit/sortable";
|
|
118
116
|
import { SortableContext as SortableContext$1, useSortable } from "@dnd-kit/sortable";
|
|
119
|
-
import * as dndKitUtilities from "@dnd-kit/utilities";
|
|
120
117
|
import * as formilyJsonSchema from "@formily/json-schema";
|
|
121
118
|
import * as formilyPath from "@formily/path";
|
|
122
119
|
import * as formilyValidator from "@formily/validator";
|
|
@@ -129,7 +126,8 @@ import { useHotkeys } from "react-hotkeys-hook";
|
|
|
129
126
|
import { loadableResource } from "react-imported-component";
|
|
130
127
|
import LRUCache from "lru-cache";
|
|
131
128
|
import ignore from "ignore";
|
|
132
|
-
import ProLayout, {
|
|
129
|
+
import ProLayout, { RouteContext, PageHeader } from "@ant-design/pro-layout";
|
|
130
|
+
import { Context } from "rc-motion/es/context";
|
|
133
131
|
import { spliceArrayState, exchangeArrayState } from "@formily/core/esm/shared/internals";
|
|
134
132
|
import relativeTime from "dayjs/plugin/relativeTime";
|
|
135
133
|
import { useSchemaInitializer as useSchemaInitializer$1, SchemaInitializerItem as SchemaInitializerItem$1, ActionContextProvider as ActionContextProvider$1, SchemaComponent as SchemaComponent$1, Action as Action$2 } from "@nocobase/client";
|
|
@@ -1866,6 +1864,9 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1866
1864
|
get IsInNocoBaseRecursionFieldContext() {
|
|
1867
1865
|
return IsInNocoBaseRecursionFieldContext;
|
|
1868
1866
|
},
|
|
1867
|
+
get IsSubPageClosedByPageMenuContext() {
|
|
1868
|
+
return IsSubPageClosedByPageMenuContext;
|
|
1869
|
+
},
|
|
1869
1870
|
get IsSubPageClosedByPageMenuProvider() {
|
|
1870
1871
|
return IsSubPageClosedByPageMenuProvider;
|
|
1871
1872
|
},
|
|
@@ -3789,6 +3790,9 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3789
3790
|
get useIsSubPageClosedByPageMenu() {
|
|
3790
3791
|
return useIsSubPageClosedByPageMenu;
|
|
3791
3792
|
},
|
|
3793
|
+
get useKeepAlive() {
|
|
3794
|
+
return useKeepAlive;
|
|
3795
|
+
},
|
|
3792
3796
|
get useLabelUiSchema() {
|
|
3793
3797
|
return useLabelUiSchema;
|
|
3794
3798
|
},
|
|
@@ -3813,12 +3817,6 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3813
3817
|
get useLocationSearch() {
|
|
3814
3818
|
return useLocationSearch;
|
|
3815
3819
|
},
|
|
3816
|
-
get useMatchAdmin() {
|
|
3817
|
-
return useMatchAdmin;
|
|
3818
|
-
},
|
|
3819
|
-
get useMatchAdminName() {
|
|
3820
|
-
return useMatchAdminName;
|
|
3821
|
-
},
|
|
3822
3820
|
get useMenuDragEnd() {
|
|
3823
3821
|
return useMenuDragEnd;
|
|
3824
3822
|
},
|
|
@@ -6203,10 +6201,6 @@ const IsAdminPageContext = React.createContext(!1);
|
|
|
6203
6201
|
IsAdminPageContext.displayName = "IsAdminPageContext";
|
|
6204
6202
|
const CurrentPageUidContext = React.createContext("");
|
|
6205
6203
|
CurrentPageUidContext.displayName = "CurrentPageUidContext";
|
|
6206
|
-
const MatchAdminContext = React.createContext(!1);
|
|
6207
|
-
MatchAdminContext.displayName = "MatchAdminContext";
|
|
6208
|
-
const MatchAdminNameContext = React.createContext(!1);
|
|
6209
|
-
MatchAdminNameContext.displayName = "MatchAdminNameContext";
|
|
6210
6204
|
const IsInSettingsPageContext = React.createContext(!1);
|
|
6211
6205
|
IsInSettingsPageContext.displayName = "IsInSettingsPageContext";
|
|
6212
6206
|
const CurrentTabUidContext = React.createContext("");
|
|
@@ -6244,12 +6238,6 @@ const IsSubPageClosedByPageMenuProvider = ({ children: e }) => {
|
|
|
6244
6238
|
}, IsInSettingsPageProvider = ({ children: e }) => {
|
|
6245
6239
|
const t = useLocation().pathname.includes("/settings");
|
|
6246
6240
|
return /* @__PURE__ */ jsx(IsInSettingsPageContext.Provider, { value: t, children: e });
|
|
6247
|
-
}, MatchAdminProvider = ({ children: e }) => {
|
|
6248
|
-
const t = !!useMatch("/admin");
|
|
6249
|
-
return /* @__PURE__ */ jsx(MatchAdminContext.Provider, { value: t, children: e });
|
|
6250
|
-
}, MatchAdminNameProvider = ({ children: e }) => {
|
|
6251
|
-
const t = !!useMatch("/admin/:name");
|
|
6252
|
-
return /* @__PURE__ */ jsx(MatchAdminNameContext.Provider, { value: t, children: e });
|
|
6253
6241
|
}, IsAdminPageProvider = ({ children: e }) => {
|
|
6254
6242
|
const n = useLocation().pathname.startsWith("/admin");
|
|
6255
6243
|
return /* @__PURE__ */ jsx(IsAdminPageContext.Provider, { value: n, children: e });
|
|
@@ -6274,12 +6262,12 @@ const IsSubPageClosedByPageMenuProvider = ({ children: e }) => {
|
|
|
6274
6262
|
}, LocationSearchProvider = ({ children: e }) => {
|
|
6275
6263
|
const t = useLocation();
|
|
6276
6264
|
return /* @__PURE__ */ jsx(LocationSearchContext.Provider, { value: t.search, children: e });
|
|
6277
|
-
}, useNavigateNoUpdate = () => React.useContext(NavigateNoUpdateContext), useLocationNoUpdate = () => React.useContext(LocationNoUpdateContext), useLocationSearch = () => React.useContext(LocationSearchContext), useIsAdminPage = () => React.useContext(IsAdminPageContext), useCurrentPageUid = () => React.useContext(CurrentPageUidContext),
|
|
6265
|
+
}, useNavigateNoUpdate = () => React.useContext(NavigateNoUpdateContext), useLocationNoUpdate = () => React.useContext(LocationNoUpdateContext), useLocationSearch = () => React.useContext(LocationSearchContext), useIsAdminPage = () => React.useContext(IsAdminPageContext), useCurrentPageUid = () => React.useContext(CurrentPageUidContext), useIsInSettingsPage = () => React.useContext(IsInSettingsPageContext), useCurrentTabUid = () => React.useContext(CurrentTabUidContext), useCurrentSearchParams = () => React.useContext(SearchParamsContext), useRouterBasename = () => React.useContext(RouterBasenameContext), useIsSubPageClosedByPageMenu = (e) => {
|
|
6278
6266
|
const { isSubPageClosedByPageMenu: t, setFieldSchema: n, reset: o } = React.useContext(IsSubPageClosedByPageMenuContext);
|
|
6279
6267
|
return useEffect(() => {
|
|
6280
6268
|
n(e);
|
|
6281
6269
|
}, [e, n]), { isSubPageClosedByPageMenu: t, reset: o };
|
|
6282
|
-
}, CustomRouterContextProvider = ({ children: e }) => /* @__PURE__ */ jsx(NavigateNoUpdateProvider, { children: /* @__PURE__ */ jsx(LocationNoUpdateProvider, { children: /* @__PURE__ */ jsx(IsAdminPageProvider, { children: /* @__PURE__ */ jsx(LocationSearchProvider, { children: /* @__PURE__ */ jsx(
|
|
6270
|
+
}, CustomRouterContextProvider = ({ children: e }) => /* @__PURE__ */ jsx(NavigateNoUpdateProvider, { children: /* @__PURE__ */ jsx(LocationNoUpdateProvider, { children: /* @__PURE__ */ jsx(IsAdminPageProvider, { children: /* @__PURE__ */ jsx(LocationSearchProvider, { children: /* @__PURE__ */ jsx(SearchParamsProvider, { children: /* @__PURE__ */ jsx(RouterBasenameProvider, { children: /* @__PURE__ */ jsx(IsInSettingsPageProvider, { children: e }) }) }) }) }) }) }), useDefaultDynamicComponentProps = () => {
|
|
6283
6271
|
}, getHook = (e, t, n) => {
|
|
6284
6272
|
let o;
|
|
6285
6273
|
return _.isFunction(e) ? o = e : (o = t[e], o || console.error(`${n} is not registered`)), o || useDefaultDynamicComponentProps;
|
|
@@ -6471,11 +6459,15 @@ function SetDataLoadingMode() {
|
|
|
6471
6459
|
const useSourceKey = (e) => useCollectionManager().getSourceKeyByAssociation(e), KeepAliveContext = createContext(!0), DesignableInterceptor = ({ children: e, active: t }) => {
|
|
6472
6460
|
const n = useContext(SchemaComponentContext), o = useContext(SchemaOptionsContext), r = useContext(SchemaComponentsContext), i = useContext(SchemaExpressionScopeContext), a = useContext(ACLContext), l = useRef(n), c = useRef(o), u = useRef(r), d = useRef(i), p = useRef(a);
|
|
6473
6461
|
return t && (l.current = n, c.current = o, u.current = r, d.current = i, p.current = a), /* @__PURE__ */ jsx(SchemaComponentContext.Provider, { value: l.current, children: /* @__PURE__ */ jsx(SchemaOptionsContext.Provider, { value: c.current, children: /* @__PURE__ */ jsx(SchemaComponentsContext.Provider, { value: u.current, children: /* @__PURE__ */ jsx(SchemaExpressionScopeContext.Provider, { value: d.current, children: /* @__PURE__ */ jsx(ACLContext.Provider, { value: p.current, children: e }) }) }) }) });
|
|
6474
|
-
},
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6462
|
+
}, hidden = { display: "none" }, KeepAliveProvider = memo(
|
|
6463
|
+
({ children: e, active: t, parentActive: n }) => {
|
|
6464
|
+
const o = useContext(UNSAFE_LocationContext), r = useContext(UNSAFE_RouteContext), i = useContext(UNSAFE_DataRouterContext), a = useContext(UNSAFE_DataRouterStateContext), l = useContext(IsSubPageClosedByPageMenuContext), c = useContext(Context), u = useContext(RouteContext), d = useRef(o), p = useRef(r), m = useRef(i), h = useRef(a), g = useRef(l), f = useRef(c), C = useRef(u);
|
|
6465
|
+
t && (m.current = i, h.current = a, g.current = l, f.current = c, C.current = u), t && // Skip comparing location key to improve LocationContext rendering performance
|
|
6466
|
+
!_.isEqual(_.omit(d.current.location, "key"), _.omit(o.location, "key")) && (d.current = o), t && !_.isEqual(p.current, r) && (p.current = r);
|
|
6467
|
+
const b = /* @__PURE__ */ jsx(RouteContext.Provider, { value: C.current, children: /* @__PURE__ */ jsx(Context.Provider, { value: f.current, children: /* @__PURE__ */ jsx(UNSAFE_DataRouterContext.Provider, { value: m.current, children: /* @__PURE__ */ jsx(UNSAFE_DataRouterStateContext.Provider, { value: h.current, children: /* @__PURE__ */ jsx(UNSAFE_LocationContext.Provider, { value: d.current, children: /* @__PURE__ */ jsx(UNSAFE_RouteContext.Provider, { value: p.current, children: /* @__PURE__ */ jsx(KeepAliveContext.Provider, { value: n === !1 ? !1 : t, children: /* @__PURE__ */ jsx(DesignableInterceptor, { active: t, children: /* @__PURE__ */ jsx(IsSubPageClosedByPageMenuContext.Provider, { value: g.current, children: e }) }) }) }) }) }) }) }) });
|
|
6468
|
+
return /* @__PURE__ */ jsx("div", { style: t ? null : hidden, children: b });
|
|
6469
|
+
}
|
|
6470
|
+
), useKeepAlive = () => ({ active: useContext(KeepAliveContext) }), getMaxPageCount = () => {
|
|
6479
6471
|
let t = 5;
|
|
6480
6472
|
try {
|
|
6481
6473
|
const n = navigator.deviceMemory;
|
|
@@ -6495,8 +6487,8 @@ const useSourceKey = (e) => useCollectionManager().getSourceKeyByAssociation(e),
|
|
|
6495
6487
|
return 5;
|
|
6496
6488
|
}
|
|
6497
6489
|
}, MAX_RENDERED_PAGE_COUNT = getMaxPageCount(), KeepAlive = React.memo(({ children: e, uid: t }) => {
|
|
6498
|
-
const n = useRef([]);
|
|
6499
|
-
return
|
|
6490
|
+
const { active: n } = useKeepAlive(), o = useRef([]);
|
|
6491
|
+
return o.current.includes(t) || (o.current.push(t), o.current.length > MAX_RENDERED_PAGE_COUNT && (o.current = o.current.slice(-MAX_RENDERED_PAGE_COUNT))), /* @__PURE__ */ jsx(Fragment$1, { children: o.current.map((r) => /* @__PURE__ */ jsx(KeepAliveProvider, { active: r === t, parentActive: n, children: e(r) }, r)) });
|
|
6500
6492
|
});
|
|
6501
6493
|
KeepAlive.displayName = "KeepAlive";
|
|
6502
6494
|
const DEBOUNCE_WAIT = 100, LOADING_DELAY = void 0, EMPTY_OBJECT = Object.freeze({});
|
|
@@ -9218,7 +9210,7 @@ function addAppVersion(e, t) {
|
|
|
9218
9210
|
addAppVersion((o = e.properties) == null ? void 0 : o[n], t);
|
|
9219
9211
|
}), e;
|
|
9220
9212
|
}
|
|
9221
|
-
const name = "@nocobase/client", version = "1.6.
|
|
9213
|
+
const name = "@nocobase/client", version = "1.6.34", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
|
|
9222
9214
|
"@ahooksjs/use-url-state": "3.5.1",
|
|
9223
9215
|
"@ant-design/cssinjs": "^1.11.1",
|
|
9224
9216
|
"@ant-design/icons": "^5.6.1",
|
|
@@ -9226,9 +9218,8 @@ const name = "@nocobase/client", version = "1.6.32", license = "AGPL-3.0", main
|
|
|
9226
9218
|
"@antv/g2plot": "^2.4.18",
|
|
9227
9219
|
"@budibase/handlebars-helpers": "0.14.0",
|
|
9228
9220
|
"@ctrl/tinycolor": "^3.6.0",
|
|
9229
|
-
"@dnd-kit/core": "^
|
|
9230
|
-
"@dnd-kit/
|
|
9231
|
-
"@dnd-kit/sortable": "^6.0.0",
|
|
9221
|
+
"@dnd-kit/core": "^6.0.0",
|
|
9222
|
+
"@dnd-kit/sortable": "^7.0.0",
|
|
9232
9223
|
"@emotion/css": "^11.7.1",
|
|
9233
9224
|
"@formily/antd-v5": "1.1.9",
|
|
9234
9225
|
"@formily/core": "^2.2.27",
|
|
@@ -9240,9 +9231,9 @@ const name = "@nocobase/client", version = "1.6.32", license = "AGPL-3.0", main
|
|
|
9240
9231
|
"@formily/reactive-react": "^2.2.27",
|
|
9241
9232
|
"@formily/shared": "^2.2.27",
|
|
9242
9233
|
"@formily/validator": "^2.2.27",
|
|
9243
|
-
"@nocobase/evaluators": "1.6.
|
|
9244
|
-
"@nocobase/sdk": "1.6.
|
|
9245
|
-
"@nocobase/utils": "1.6.
|
|
9234
|
+
"@nocobase/evaluators": "1.6.34",
|
|
9235
|
+
"@nocobase/sdk": "1.6.34",
|
|
9236
|
+
"@nocobase/utils": "1.6.34",
|
|
9246
9237
|
ahooks: "^3.7.2",
|
|
9247
9238
|
antd: "5.12.8",
|
|
9248
9239
|
"antd-style": "3.7.1",
|
|
@@ -10035,10 +10026,10 @@ const opacityStyle = {
|
|
|
10035
10026
|
height: "100%",
|
|
10036
10027
|
maxHeight: 400,
|
|
10037
10028
|
zIndex: 1e3
|
|
10038
|
-
}, displayNone$
|
|
10029
|
+
}, displayNone$3 = {
|
|
10039
10030
|
display: "none"
|
|
10040
10031
|
}, HighPerformanceSpin = React.memo((e) => /* @__PURE__ */ jsxs("div", { style: containerStyle, children: [
|
|
10041
|
-
/* @__PURE__ */ jsx(Spin, P(x({}, _.omit(e, "children")), { style: e.spinning ? spinStyle : displayNone$
|
|
10032
|
+
/* @__PURE__ */ jsx(Spin, P(x({}, _.omit(e, "children")), { style: e.spinning ? spinStyle : displayNone$3 })),
|
|
10042
10033
|
/* @__PURE__ */ jsx("div", { style: e.spinning ? opacityStyle : null, children: e.children })
|
|
10043
10034
|
] })), AssociationFieldContext = createContext({});
|
|
10044
10035
|
AssociationFieldContext.displayName = "AssociationFieldContext";
|
|
@@ -10526,9 +10517,9 @@ const InternalBodyCellComponent$1 = React.memo((e) => {
|
|
|
10526
10517
|
] });
|
|
10527
10518
|
});
|
|
10528
10519
|
InternalBodyCellComponent$1.displayName = "InternalBodyCellComponent";
|
|
10529
|
-
const displayNone$
|
|
10520
|
+
const displayNone$2 = { display: "none" }, BodyCellComponent$1 = React.memo((e) => {
|
|
10530
10521
|
const { designable: t } = useDesignable();
|
|
10531
|
-
return e.columnHidden ? /* @__PURE__ */ jsx("td", { style: t ? columnOpacityStyle$1 : columnHiddenStyle$1, children: t ? e.children : /* @__PURE__ */ jsx("span", { style: displayNone$
|
|
10522
|
+
return e.columnHidden ? /* @__PURE__ */ jsx("td", { style: t ? columnOpacityStyle$1 : columnHiddenStyle$1, children: t ? e.children : /* @__PURE__ */ jsx("span", { style: displayNone$2, children: e.children }) }) : /* @__PURE__ */ jsx(InternalBodyCellComponent$1, x({}, _.omit(e, "columnHidden")));
|
|
10532
10523
|
});
|
|
10533
10524
|
BodyCellComponent$1.displayName = "BodyCellComponent";
|
|
10534
10525
|
const TableElementRefContext = createContext(null), useTableElementRef = () => useContext(TableElementRefContext), InternalNocoBaseTable$1 = React.memo(
|
|
@@ -11631,7 +11622,7 @@ const VisibleProvider = React.memo(({ children: e, popupuid: t }) => {
|
|
|
11631
11622
|
[n]
|
|
11632
11623
|
), { isPopupVisibleControlledByURL: r } = usePopupSettings();
|
|
11633
11624
|
return r() ? /* @__PURE__ */ jsx(TabsContextProvider, { activeKey: t == null ? void 0 : t.tab, onChange: o, children: e }) : /* @__PURE__ */ jsx(Fragment$1, { children: e });
|
|
11634
|
-
}, displayNone$
|
|
11625
|
+
}, displayNone$1 = { display: "none" }, PagePopupsItemProvider = ({ params: e, context: t, currentLevel: n, children: o }) => {
|
|
11635
11626
|
const r = x({}, getStoredPopupContext(e.popupuid));
|
|
11636
11627
|
return useEffect(() => (setPopupLayerState(n, !0), () => {
|
|
11637
11628
|
removePopupLayerState(n);
|
|
@@ -11642,7 +11633,7 @@ const VisibleProvider = React.memo(({ children: e, popupuid: t }) => {
|
|
|
11642
11633
|
association: r.association
|
|
11643
11634
|
},
|
|
11644
11635
|
_.isNil
|
|
11645
|
-
)), _.isEmpty(t) ? /* @__PURE__ */ jsx(PopupParamsProvider, { params: e, context: t, currentLevel: n, children: /* @__PURE__ */ jsx(VisibleProvider, { popupuid: e.popupuid, children: /* @__PURE__ */ jsx("div", { style: displayNone$
|
|
11636
|
+
)), _.isEmpty(t) ? /* @__PURE__ */ jsx(PopupParamsProvider, { params: e, context: t, currentLevel: n, children: /* @__PURE__ */ jsx(VisibleProvider, { popupuid: e.popupuid, children: /* @__PURE__ */ jsx("div", { style: displayNone$1, children: o }) }) }) : /* @__PURE__ */ jsx(PopupParamsProvider, { params: e, context: t, currentLevel: n, children: /* @__PURE__ */ jsx(
|
|
11646
11637
|
DataBlockProvider,
|
|
11647
11638
|
{
|
|
11648
11639
|
dataSource: t.dataSource,
|
|
@@ -11653,7 +11644,7 @@ const VisibleProvider = React.memo(({ children: e, popupuid: t }) => {
|
|
|
11653
11644
|
record: r.record,
|
|
11654
11645
|
parentRecord: r.parentRecord,
|
|
11655
11646
|
action: "get",
|
|
11656
|
-
children: /* @__PURE__ */ jsx(BlockRequestContextProvider, { recordRequest: r.service, children: /* @__PURE__ */ jsx(PopupTabsPropsProvider, { children: /* @__PURE__ */ jsx(VisibleProvider, { popupuid: e.popupuid, children: /* @__PURE__ */ jsx("div", { style: displayNone$
|
|
11647
|
+
children: /* @__PURE__ */ jsx(BlockRequestContextProvider, { recordRequest: r.service, children: /* @__PURE__ */ jsx(PopupTabsPropsProvider, { children: /* @__PURE__ */ jsx(VisibleProvider, { popupuid: e.popupuid, children: /* @__PURE__ */ jsx("div", { style: displayNone$1, children: o }) }) }) })
|
|
11657
11648
|
}
|
|
11658
11649
|
) });
|
|
11659
11650
|
}, insertChildToParentSchema = ({
|
|
@@ -12952,7 +12943,7 @@ const compose = (...e) => {
|
|
|
12952
12943
|
return (n) => (o) => /* @__PURE__ */ jsx(t, { children: n && /* @__PURE__ */ jsx(n, x({}, o)) });
|
|
12953
12944
|
};
|
|
12954
12945
|
function defineGlobalDeps(e) {
|
|
12955
|
-
e.define("react", () => React), e.define("react-dom", () => ReactDOM__default), e.define("react/jsx-runtime", () => jsxRuntime), e.define("react-router", () => ReactRouter), e.define("react-router-dom", () => ReactRouterDom), e.define("antd", () => antd), e.define("antd-style", () => antdStyle), e.define("@ant-design/icons", () => antIcons), e.define("@ant-design/cssinjs", () => antdCssinjs), e.define("i18next", () => i18next), e.define("react-i18next", () => reactI18next), e.define("@formily/antd-v5", () => formilyAntdV5), e.define("@formily/core", () => formilyCore), e.define("@formily/react", () => formilyReact), e.define("@formily/shared", () => formilyShared), e.define("@formily/json-schema", () => formilyJsonSchema), e.define("@formily/reactive", () => formilyJsonReactive), e.define("@formily/path", () => formilyPath), e.define("@formily/validator", () => formilyValidator), e.define("@formily/reactive-react", () => formilyReactiveReact), e.define("@nocobase/utils", () => nocobaseClientUtils), e.define("@nocobase/utils/client", () => nocobaseClientUtils), e.define("@nocobase/client", () => nocobaseClient), e.define("@nocobase/client/client", () => nocobaseClient), e.define("@nocobase/evaluators", () => nocobaseEvaluators), e.define("@nocobase/evaluators/client", () => nocobaseEvaluators), e.define("@nocobase/sdk", () => nocobaseSDK), e.define("@dnd-kit/
|
|
12946
|
+
e.define("react", () => React), e.define("react-dom", () => ReactDOM__default), e.define("react/jsx-runtime", () => jsxRuntime), e.define("react-router", () => ReactRouter), e.define("react-router-dom", () => ReactRouterDom), e.define("antd", () => antd), e.define("antd-style", () => antdStyle), e.define("@ant-design/icons", () => antIcons), e.define("@ant-design/cssinjs", () => antdCssinjs), e.define("i18next", () => i18next), e.define("react-i18next", () => reactI18next), e.define("@formily/antd-v5", () => formilyAntdV5), e.define("@formily/core", () => formilyCore), e.define("@formily/react", () => formilyReact), e.define("@formily/shared", () => formilyShared), e.define("@formily/json-schema", () => formilyJsonSchema), e.define("@formily/reactive", () => formilyJsonReactive), e.define("@formily/path", () => formilyPath), e.define("@formily/validator", () => formilyValidator), e.define("@formily/reactive-react", () => formilyReactiveReact), e.define("@nocobase/utils", () => nocobaseClientUtils), e.define("@nocobase/utils/client", () => nocobaseClientUtils), e.define("@nocobase/client", () => nocobaseClient), e.define("@nocobase/client/client", () => nocobaseClient), e.define("@nocobase/evaluators", () => nocobaseEvaluators), e.define("@nocobase/evaluators/client", () => nocobaseEvaluators), e.define("@nocobase/sdk", () => nocobaseSDK), e.define("@dnd-kit/core", () => dndKitCore), e.define("@dnd-kit/sortable", () => dndKitSortable), e.define("axios", () => axios), e.define("dayjs", () => dayjs$1), e.define("lodash", () => _), e.define("ahooks", () => ahooks), e.define("@emotion/css", () => emotionCss), e.define("file-saver", () => FileSaver);
|
|
12956
12947
|
}
|
|
12957
12948
|
/* istanbul ignore file -- @preserve */
|
|
12958
12949
|
function getRequireJs() {
|
|
@@ -13807,7 +13798,7 @@ function getOperators() {
|
|
|
13807
13798
|
return n.truthy(r);
|
|
13808
13799
|
},
|
|
13809
13800
|
$empty: function(r) {
|
|
13810
|
-
return Array.isArray(r) ? r.
|
|
13801
|
+
return Array.isArray(r) ? r.length === 0 : !n.truthy(r);
|
|
13811
13802
|
},
|
|
13812
13803
|
$notExists: function(r) {
|
|
13813
13804
|
return !n.truthy(r);
|
|
@@ -13834,7 +13825,7 @@ function getOperators() {
|
|
|
13834
13825
|
return r == null || r.length === 0 ? !1 : Array.isArray(r) && Array.isArray(i) && r.some((a) => Array.isArray(a)) ? r.some((a) => a.some((l) => i.includes(l))) : r.some((a) => i.includes(a));
|
|
13835
13826
|
},
|
|
13836
13827
|
$noneOf: function(r, i) {
|
|
13837
|
-
return !r ||
|
|
13828
|
+
return !r || r.length === 0 || !i || i.length === 0 ? !0 : (Array.isArray(r) || (r = [r]), Array.isArray(i) || (i = [i]), !i.some((a) => r.includes(a)));
|
|
13838
13829
|
},
|
|
13839
13830
|
$notMatch: function(r, i) {
|
|
13840
13831
|
if (r.length !== i.length)
|
|
@@ -25285,7 +25276,7 @@ const Markdown = connect(
|
|
|
25285
25276
|
Markdown.Void = MarkdownVoid;
|
|
25286
25277
|
const BlockItemCardContext = createContext({}), BlockItemCard = React.forwardRef((o, n) => {
|
|
25287
25278
|
var r = o, { children: e } = r, t = Y(r, ["children"]);
|
|
25288
|
-
const { token: i } = useToken(), g = t, { title: a, description: l } = g, c = Y(g, ["title", "description"]), u = useMemo(() => ({ marginBottom: i.marginBlock, height:
|
|
25279
|
+
const { token: i } = useToken(), g = t, { title: a, description: l } = g, c = Y(g, ["title", "description"]), u = useMemo(() => ({ marginBottom: i.marginBlock, height: "100%" }), [i.marginBlock]), [d, p] = useState(0), m = useRef(null);
|
|
25289
25280
|
useEffect(() => {
|
|
25290
25281
|
const f = setTimeout(() => {
|
|
25291
25282
|
if (m.current) {
|
|
@@ -27019,10 +27010,10 @@ const LanguageSettings = () => {
|
|
|
27019
27010
|
]
|
|
27020
27011
|
}), NocoBaseRouteContext = createContext(null);
|
|
27021
27012
|
NocoBaseRouteContext.displayName = "NocoBaseRouteContext";
|
|
27022
|
-
const CurrentRouteProvider = ({ children: e, uid: t }) => {
|
|
27013
|
+
const CurrentRouteProvider = memo(({ children: e, uid: t }) => {
|
|
27023
27014
|
const { allAccessRoutes: n } = useAllAccessDesktopRoutes(), o = useMemo(() => findRouteBySchemaUid(t, n), [t, n]);
|
|
27024
27015
|
return /* @__PURE__ */ jsx(NocoBaseRouteContext.Provider, { value: o, children: e });
|
|
27025
|
-
}, useCurrentRoute = () => useContext(NocoBaseRouteContext) || {}, emptyArray = [], AllAccessDesktopRoutesContext = createContext({
|
|
27016
|
+
}), useCurrentRoute = () => useContext(NocoBaseRouteContext) || {}, emptyArray = [], AllAccessDesktopRoutesContext = createContext({
|
|
27026
27017
|
allAccessRoutes: emptyArray,
|
|
27027
27018
|
refresh: () => {
|
|
27028
27019
|
}
|
|
@@ -27039,7 +27030,7 @@ const useAllAccessDesktopRoutes = () => useContext(AllAccessDesktopRoutesContext
|
|
|
27039
27030
|
return r && !t.current ? null : (t.current = !0, /* @__PURE__ */ jsx(AllAccessDesktopRoutesContext.Provider, { value: i, children: e }));
|
|
27040
27031
|
}, noAccessPermission = (e, t) => e ? !findRouteBySchemaUid(e, t) : !1, AdminDynamicPage = () => {
|
|
27041
27032
|
const e = useCurrentPageUid(), { allAccessRoutes: t } = useAllAccessDesktopRoutes();
|
|
27042
|
-
return isGroup(e, t) ? null : noAccessPermission(e, t) ? /* @__PURE__ */ jsx(AppNotFound$1, {}) : /* @__PURE__ */ jsx(KeepAlive, { uid: e, children: (n) => /* @__PURE__ */ jsx(CurrentRouteProvider, { uid: n, children: /* @__PURE__ */ jsx(RemoteSchemaComponent, { uid: n }) }) });
|
|
27033
|
+
return isGroup(e, t) ? null : noAccessPermission(e, t) ? /* @__PURE__ */ jsx(AppNotFound$1, {}) : /* @__PURE__ */ jsx(KeepAlive, { uid: e, children: (n) => /* @__PURE__ */ jsx(CurrentPageUidContext.Provider, { value: n, children: /* @__PURE__ */ jsx(CurrentRouteProvider, { uid: n, children: /* @__PURE__ */ jsx(RemoteSchemaComponent, { uid: n }) }) }) });
|
|
27043
27034
|
}, layoutContentClass = css`
|
|
27044
27035
|
display: flex;
|
|
27045
27036
|
flex-direction: column;
|
|
@@ -38105,7 +38096,7 @@ const getValues = (e, t) => castArray(e).filter((n) => n != null).map((n) => typ
|
|
|
38105
38096
|
return (j == null ? void 0 : j.type) === "date" && (X = dayjs(X).format("YYYY-MM-DD")), c ? c({
|
|
38106
38097
|
[t.label]: X || EMPTY$1,
|
|
38107
38098
|
[t.value]: W[t.value]
|
|
38108
|
-
}) : P(x({}, W), {
|
|
38099
|
+
}) : P(x({}, omit(W, "style")), {
|
|
38109
38100
|
[t.label]: X || EMPTY$1,
|
|
38110
38101
|
[t.value]: W[t.value]
|
|
38111
38102
|
});
|
|
@@ -38121,7 +38112,7 @@ const getValues = (e, t) => castArray(e).filter((n) => n != null).map((n) => typ
|
|
|
38121
38112
|
}, n), {
|
|
38122
38113
|
headers: b,
|
|
38123
38114
|
params: P(x({
|
|
38124
|
-
|
|
38115
|
+
paginate: !1
|
|
38125
38116
|
}, n == null ? void 0 : n.params), {
|
|
38126
38117
|
filter: (J = n == null ? void 0 : n.params) == null ? void 0 : J.filter
|
|
38127
38118
|
})
|
|
@@ -40123,14 +40114,9 @@ const useRouteTranslation = () => useTranslation("lm-desktop-routes"), InternalP
|
|
|
40123
40114
|
/* @__PURE__ */ jsx(Outlet, {})
|
|
40124
40115
|
] }) }) })
|
|
40125
40116
|
] });
|
|
40126
|
-
}),
|
|
40127
|
-
// Visually hide the element while keeping it in document flow to prevent reflow/repaint
|
|
40128
|
-
transform: "scale(0)",
|
|
40129
|
-
// Prevent element from receiving any pointer events (clicks, hovers etc) to avoid interfering with other elements
|
|
40130
|
-
pointerEvents: "none"
|
|
40131
|
-
}, Page = React.memo((e) => {
|
|
40117
|
+
}), Page = React.memo((e) => {
|
|
40132
40118
|
const { hashId: t, componentCls: n } = useStyles$7(), { active: o } = useKeepAlive(), r = useCurrentTabUid(), i = useRef(r);
|
|
40133
|
-
return o && (i.current = r), /* @__PURE__ */ jsx("div", { className: `${n} ${t} ${antTableCell}`,
|
|
40119
|
+
return o && (i.current = r), /* @__PURE__ */ jsx("div", { className: `${n} ${t} ${antTableCell}`, children: /* @__PURE__ */ jsx(CurrentTabUidContext.Provider, { value: "", children: /* @__PURE__ */ jsx(InternalPage, { currentTabUid: i.current, className: e.className }) }) });
|
|
40134
40120
|
});
|
|
40135
40121
|
Page.displayName = "NocoBasePage";
|
|
40136
40122
|
const PageTabs = () => {
|
|
@@ -40155,26 +40141,22 @@ const className1 = css`
|
|
|
40155
40141
|
display: none;
|
|
40156
40142
|
}
|
|
40157
40143
|
}
|
|
40158
|
-
`,
|
|
40159
|
-
|
|
40160
|
-
},
|
|
40161
|
-
display: "none"
|
|
40162
|
-
}, TabPane = React.memo(({ active: e, uid: t }) => {
|
|
40163
|
-
const n = useRef(!1), { active: o } = useKeepAlive();
|
|
40164
|
-
return e && !n.current && (n.current = !0), n.current ? /* @__PURE__ */ jsx("div", { style: e ? displayBlock : displayNone$1, children: /* @__PURE__ */ jsx(KeepAliveProvider, { active: o && e, children: /* @__PURE__ */ jsx(RemoteSchemaComponent, { uid: t }) }) }) : null;
|
|
40165
|
-
}), InternalPageContent = (e) => {
|
|
40166
|
-
var p, m, h, g;
|
|
40167
|
-
const { loading: t, disablePageHeader: n, enablePageTabs: o, activeKey: r } = e, i = useCurrentRoute(), a = useNavigateNoUpdate(), l = useLocationNoUpdate(), u = ((i == null ? void 0 : i.children) || []).every((f) => f.schemaUid !== r && f.tabSchemaName !== r);
|
|
40144
|
+
`, InternalPageContent = (e) => {
|
|
40145
|
+
var p, m, h;
|
|
40146
|
+
const { loading: t, disablePageHeader: n, enablePageTabs: o, activeKey: r } = e, i = useCurrentRoute(), a = useNavigateNoUpdate(), l = useLocationNoUpdate(), u = ((i == null ? void 0 : i.children) || []).every((g) => g.schemaUid !== r && g.tabSchemaName !== r);
|
|
40168
40147
|
if (r && u)
|
|
40169
40148
|
return /* @__PURE__ */ jsx(AppNotFound$1, {});
|
|
40170
|
-
const d = (p = i == null ? void 0 : i.children) == null ? void 0 : p.find((
|
|
40149
|
+
const d = (p = i == null ? void 0 : i.children) == null ? void 0 : p.find((g) => g.tabSchemaName === r);
|
|
40171
40150
|
if (d) {
|
|
40172
|
-
const
|
|
40173
|
-
|
|
40174
|
-
const
|
|
40175
|
-
return a(
|
|
40151
|
+
const g = new URLSearchParams(l.search);
|
|
40152
|
+
g.has("tab") && g.get("tab") === r && g.delete("tab");
|
|
40153
|
+
const f = g.toString() ? `?${g.toString()}` : "", C = l.pathname + (l.pathname.endsWith("/") ? `tabs/${d.schemaUid}` : `/tabs/${d.schemaUid}`);
|
|
40154
|
+
return a(C + f), null;
|
|
40176
40155
|
}
|
|
40177
|
-
return !n && o ? /* @__PURE__ */ jsx(
|
|
40156
|
+
return !n && o ? /* @__PURE__ */ jsx(KeepAlive, { uid: r, children: (g) => {
|
|
40157
|
+
var f;
|
|
40158
|
+
return /* @__PURE__ */ jsx(NocoBaseRouteContext.Provider, { value: (f = i.children) == null ? void 0 : f.find((C) => C.schemaUid === g), children: /* @__PURE__ */ jsx(RemoteSchemaComponent, { uid: g }) });
|
|
40159
|
+
} }) : /* @__PURE__ */ jsx("div", { className: className1, children: /* @__PURE__ */ jsx(NocoBaseRouteContext.Provider, { value: (m = i == null ? void 0 : i.children) == null ? void 0 : m[0], children: /* @__PURE__ */ jsx(RemoteSchemaComponent, { uid: (h = i == null ? void 0 : i.children) == null ? void 0 : h[0].schemaUid }) }) });
|
|
40178
40160
|
}, PageContent = memo((e) => /* @__PURE__ */ jsx(PopupRouteContextResetter, { children: /* @__PURE__ */ jsx(InternalPageContent, x({}, e)) })), NocoBasePageHeaderTabs = ({ className: e, activeKey: t }) => {
|
|
40179
40161
|
const n = useFieldSchema(), { t: o } = useTranslation(), { t: r } = useRouteTranslation(), { token: i } = useToken$1(), a = useRouterBasename(), l = useNavigateNoUpdate(), c = useCallback(
|
|
40180
40162
|
(F) => {
|
|
@@ -65072,6 +65054,7 @@ export {
|
|
|
65072
65054
|
IntegerFieldInterface,
|
|
65073
65055
|
InternalAdminLayout,
|
|
65074
65056
|
IsInNocoBaseRecursionFieldContext,
|
|
65057
|
+
IsSubPageClosedByPageMenuContext,
|
|
65075
65058
|
IsSubPageClosedByPageMenuProvider,
|
|
65076
65059
|
Json,
|
|
65077
65060
|
JsonFieldInterface,
|
|
@@ -65372,7 +65355,7 @@ export {
|
|
|
65372
65355
|
createReadPrettyFormBlockSchema,
|
|
65373
65356
|
createRouterManager,
|
|
65374
65357
|
createSelectSchemaSettingsItem,
|
|
65375
|
-
|
|
65358
|
+
vn as createStyles,
|
|
65376
65359
|
createSwitchSettingsItem,
|
|
65377
65360
|
createTableBlockSchema,
|
|
65378
65361
|
createTableBlockUISchema,
|
|
@@ -65713,6 +65696,7 @@ export {
|
|
|
65713
65696
|
useIsLoggedIn,
|
|
65714
65697
|
useIsSelectFieldMode,
|
|
65715
65698
|
useIsSubPageClosedByPageMenu,
|
|
65699
|
+
useKeepAlive,
|
|
65716
65700
|
useLabelUiSchema,
|
|
65717
65701
|
useLazy,
|
|
65718
65702
|
useLinkActionProps,
|
|
@@ -65721,8 +65705,6 @@ export {
|
|
|
65721
65705
|
useLocalVariables$1 as useLocalVariables,
|
|
65722
65706
|
useLocationNoUpdate,
|
|
65723
65707
|
useLocationSearch,
|
|
65724
|
-
useMatchAdmin,
|
|
65725
|
-
useMatchAdminName,
|
|
65726
65708
|
useMenuDragEnd,
|
|
65727
65709
|
useMenuSearch,
|
|
65728
65710
|
useMenuTranslation,
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import React, { FC } from 'react';
|
|
10
10
|
import { Plugin } from '../../../application/Plugin';
|
|
11
|
-
import { KeepAlive } from './KeepAlive';
|
|
11
|
+
import { KeepAlive, useKeepAlive } from './KeepAlive';
|
|
12
12
|
import { NocoBaseDesktopRoute, NocoBaseDesktopRouteType } from './convertRoutesToSchema';
|
|
13
|
-
export { KeepAlive, NocoBaseDesktopRouteType };
|
|
13
|
+
export { KeepAlive, NocoBaseDesktopRouteType, useKeepAlive };
|
|
14
14
|
export declare const NocoBaseRouteContext: React.Context<NocoBaseDesktopRoute>;
|
|
15
15
|
export declare const CurrentRouteProvider: FC<{
|
|
16
16
|
uid: string;
|