@nocobase/client 1.6.0-beta.10 → 1.6.0-beta.12
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/api-client/hooks/useRequest.d.ts +2 -0
- package/es/application/Application.d.ts +1 -1
- package/es/application/hooks/useAppSpin.d.ts +1 -1
- package/es/application/schema-initializer/hooks/useGetSchemaInitializerMenuItems.d.ts +1 -1
- package/es/collection-manager/hooks/useCollectionManager_deprecated.d.ts +4 -4
- package/es/data-source/collection-template/CollectionTemplate.d.ts +1 -1
- package/es/hooks/useMenuItem.d.ts +3 -1
- package/es/index.mjs +108 -101
- package/es/lazy-helper/index.d.ts +6 -5
- package/es/modules/blocks/data-blocks/details-multi/DetailsBlockInitializer.d.ts +3 -1
- package/es/modules/blocks/data-blocks/details-single/RecordReadPrettyFormBlockInitializer.d.ts +3 -1
- package/es/modules/blocks/data-blocks/form/FormBlockInitializer.d.ts +8 -2
- package/es/modules/blocks/data-blocks/form/RecordFormBlockInitializer.d.ts +6 -2
- package/es/modules/blocks/data-blocks/table/hooks/useTableBlockProps.d.ts +8 -2
- package/es/schema-component/antd/action/hooks.d.ts +1 -1
- package/es/schema-component/antd/form-item/FormItem.Settings.d.ts +57 -1
- package/es/schema-component/antd/menu/Menu.d.ts +3 -3
- package/es/schema-component/antd/pagination/index.d.ts +5 -1
- package/es/schema-component/antd/select/ReadPretty.d.ts +5 -1
- package/es/schema-initializer/items/RecordAssociationBlockInitializer.d.ts +3 -1
- package/es/schema-initializer/items/RecordAssociationDetailsBlockInitializer.d.ts +3 -1
- package/es/schema-initializer/items/RecordAssociationFormBlockInitializer.d.ts +6 -2
- package/es/schema-initializer/items/RecordAssociationGridCardBlockInitializer.d.ts +3 -1
- package/es/schema-initializer/items/RecordAssociationListBlockInitializer.d.ts +3 -1
- package/es/schema-initializer/items/RecordReadPrettyAssociationFormBlockInitializer.d.ts +6 -2
- package/es/schema-settings/DataTemplates/FormDataTemplates.d.ts +3 -1
- package/es/schema-settings/EnableChildCollections/index.d.ts +3 -1
- package/es/schema-settings/LinkageRules/index.d.ts +5 -1
- package/es/schema-settings/VariableInput/VariableInput.d.ts +3 -1
- package/es/user/CurrentUserProvider.d.ts +0 -4
- package/lib/index.js +117 -120
- package/lib/locale/zh-CN.js +1 -1
- package/package.json +6 -6
|
@@ -17,6 +17,8 @@ export type ResourceActionOptions<P = any> = {
|
|
|
17
17
|
action?: string;
|
|
18
18
|
params?: P;
|
|
19
19
|
url?: string;
|
|
20
|
+
skipNotify?: boolean | ((error: any) => boolean);
|
|
21
|
+
skipAuth?: boolean;
|
|
20
22
|
};
|
|
21
23
|
export type UseRequestService<P> = AxiosRequestConfig<P> | ResourceActionOptions<P> | FunctionService;
|
|
22
24
|
export type UseRequestOptions = Options<any, any> & {
|
|
@@ -123,7 +123,7 @@ export declare class Application {
|
|
|
123
123
|
getRootComponent(): React.FC<{
|
|
124
124
|
children?: React.ReactNode;
|
|
125
125
|
}>;
|
|
126
|
-
mount(containerOrSelector: Element | ShadowRoot | string):
|
|
126
|
+
mount(containerOrSelector: Element | ShadowRoot | string): import("react-dom/client").Root;
|
|
127
127
|
addFieldInterfaces(fieldInterfaceClasses?: CollectionFieldInterfaceFactory[]): void;
|
|
128
128
|
addFieldInterfaceComponentOption(fieldName: string, componentOption: CollectionFieldInterfaceComponentOption): void;
|
|
129
129
|
addGlobalVar(key: string, value: any): void;
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
10
|
export declare const useAppSpin: () => {
|
|
11
|
-
render: () => React.ReactElement<any, string | React.JSXElementConstructor<any
|
|
11
|
+
render: () => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
12
12
|
};
|
|
@@ -13,4 +13,4 @@ export declare function useSchemaInitializerMenuItems(items: any[], name?: strin
|
|
|
13
13
|
/**
|
|
14
14
|
* @internal
|
|
15
15
|
*/
|
|
16
|
-
export declare function useGetSchemaInitializerMenuItems(onClick?: (args: any) => void): any;
|
|
16
|
+
export declare function useGetSchemaInitializerMenuItems(onClick?: (args: any) => void): (items: any[], parentKey: string) => any;
|
|
@@ -15,12 +15,12 @@ export declare const useCollectionManager_deprecated: (dataSourceName?: string)
|
|
|
15
15
|
interfaces: {};
|
|
16
16
|
collections: import("../..").Collection[];
|
|
17
17
|
templates: import("../..").CollectionTemplate[];
|
|
18
|
-
getTemplate: (name?:
|
|
19
|
-
getInterface: (name: string) =>
|
|
18
|
+
getTemplate: (name?: string) => import("../..").CollectionTemplate;
|
|
19
|
+
getInterface: (name: string) => import("../..").CollectionFieldInterface;
|
|
20
20
|
getCollections: () => CollectionOptions[];
|
|
21
21
|
getParentCollectionFields: (parentCollection: any, currentCollection: any, customDataSource?: string) => import("../..").CollectionFieldOptions[];
|
|
22
22
|
getInheritCollections: (name: any, customDataSource?: string) => string[];
|
|
23
|
-
getChildrenCollections: (name: string, isSupportView?:
|
|
23
|
+
getChildrenCollections: (name: string, isSupportView?: boolean, customDataSource?: string) => import("../..").Collection[];
|
|
24
24
|
refreshCM: () => Promise<void>;
|
|
25
25
|
get: (name: any, customDataSource?: string) => CollectionOptions;
|
|
26
26
|
getInheritedFields: (name: string, customDataSource?: string) => import("../..").CollectionFieldOptions[];
|
|
@@ -58,5 +58,5 @@ export declare const useCollectionManager_deprecated: (dataSourceName?: string)
|
|
|
58
58
|
getCollectionJoinField: (name: string, customDataSource?: string) => any;
|
|
59
59
|
getAllCollectionsInheritChain: (collectionName: string, customDataSource?: string) => string[];
|
|
60
60
|
getInheritCollectionsChain: (collectionName: string, customDataSource?: string) => () => string[];
|
|
61
|
-
isTitleField: (field: any) =>
|
|
61
|
+
isTitleField: (field: any) => boolean;
|
|
62
62
|
};
|
|
@@ -54,7 +54,7 @@ export declare abstract class CollectionTemplate {
|
|
|
54
54
|
/** UI configurable CollectionOptions parameters (fields for adding or editing Collection forms) */
|
|
55
55
|
configurableProperties?: Record<string, ISchema>;
|
|
56
56
|
/** Available field types for the current template */
|
|
57
|
-
availableFieldInterfaces?: AvailableFieldInterfacesInclude
|
|
57
|
+
availableFieldInterfaces?: AvailableFieldInterfacesInclude & AvailableFieldInterfacesExclude;
|
|
58
58
|
/** Whether it is a divider */
|
|
59
59
|
divider?: boolean;
|
|
60
60
|
/** Template description */
|
|
@@ -37,7 +37,9 @@ export declare const useCollectMenuItems: () => {
|
|
|
37
37
|
* @returns
|
|
38
38
|
*/
|
|
39
39
|
export declare const useMenuItem: () => {
|
|
40
|
-
Component: ({ limitCount }:
|
|
40
|
+
Component: ({ limitCount }: {
|
|
41
|
+
limitCount?: number;
|
|
42
|
+
}) => React.JSX.Element;
|
|
41
43
|
getMenuItems: (Com: () => ReactNode) => Item[];
|
|
42
44
|
getMenuItem: (Com: () => JSX.Element) => Item;
|
|
43
45
|
clean: () => void;
|
package/es/index.mjs
CHANGED
|
@@ -1912,12 +1912,6 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1912
1912
|
get NanoidFieldInterface() {
|
|
1913
1913
|
return NanoidFieldInterface;
|
|
1914
1914
|
},
|
|
1915
|
-
get NavigateIfNotSignIn() {
|
|
1916
|
-
return NavigateIfNotSignIn;
|
|
1917
|
-
},
|
|
1918
|
-
get NavigateToSigninWithRedirect() {
|
|
1919
|
-
return NavigateToSigninWithRedirect;
|
|
1920
|
-
},
|
|
1921
1915
|
get NocoBaseBuildInPlugin() {
|
|
1922
1916
|
return NocoBaseBuildInPlugin;
|
|
1923
1917
|
},
|
|
@@ -8390,7 +8384,8 @@ const useNiceDropdownMaxHeight = (e = []) => {
|
|
|
8390
8384
|
}
|
|
8391
8385
|
},
|
|
8392
8386
|
[`${t}-item-content`]: {
|
|
8393
|
-
|
|
8387
|
+
// 相当于 Menu 的 iconMarginInlineEnd,参见:https://github.com/ant-design/ant-design/blob/6a62d9e7eaf3e683c673091e39fe65ba3204d94b/components/menu/style/index.ts#L942
|
|
8388
|
+
marginLeft: e.controlHeightSM - e.fontSize
|
|
8394
8389
|
}
|
|
8395
8390
|
};
|
|
8396
8391
|
}), SchemaInitializerContext = createContext({});
|
|
@@ -9073,10 +9068,10 @@ function addAppVersion(e, t) {
|
|
|
9073
9068
|
addAppVersion((o = e.properties) == null ? void 0 : o[n], t);
|
|
9074
9069
|
}), e;
|
|
9075
9070
|
}
|
|
9076
|
-
const name = "@nocobase/client", version = "1.6.0-beta.
|
|
9071
|
+
const name = "@nocobase/client", version = "1.6.0-beta.12", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
|
|
9077
9072
|
"@ahooksjs/use-url-state": "3.5.1",
|
|
9078
9073
|
"@ant-design/cssinjs": "^1.11.1",
|
|
9079
|
-
"@ant-design/icons": "^5.1
|
|
9074
|
+
"@ant-design/icons": "^5.6.1",
|
|
9080
9075
|
"@ant-design/pro-layout": "^7.16.11",
|
|
9081
9076
|
"@antv/g2plot": "^2.4.18",
|
|
9082
9077
|
"@budibase/handlebars-helpers": "^0.14.0",
|
|
@@ -9095,9 +9090,9 @@ const name = "@nocobase/client", version = "1.6.0-beta.10", license = "AGPL-3.0"
|
|
|
9095
9090
|
"@formily/reactive-react": "^2.2.27",
|
|
9096
9091
|
"@formily/shared": "^2.2.27",
|
|
9097
9092
|
"@formily/validator": "^2.2.27",
|
|
9098
|
-
"@nocobase/evaluators": "1.6.0-beta.
|
|
9099
|
-
"@nocobase/sdk": "1.6.0-beta.
|
|
9100
|
-
"@nocobase/utils": "1.6.0-beta.
|
|
9093
|
+
"@nocobase/evaluators": "1.6.0-beta.12",
|
|
9094
|
+
"@nocobase/sdk": "1.6.0-beta.12",
|
|
9095
|
+
"@nocobase/utils": "1.6.0-beta.12",
|
|
9101
9096
|
ahooks: "^3.7.2",
|
|
9102
9097
|
antd: "5.12.8",
|
|
9103
9098
|
"antd-style": "3.7.1",
|
|
@@ -24289,13 +24284,6 @@ const useCurrentUserContext = () => useContext(CurrentUserContext), useCurrentRo
|
|
|
24289
24284
|
}).then((r) => r == null ? void 0 : r.data)
|
|
24290
24285
|
), { render: o } = useAppSpin();
|
|
24291
24286
|
return n.loading ? o() : /* @__PURE__ */ jsx(CurrentUserContext.Provider, { value: n, children: e.children });
|
|
24292
|
-
}, NavigateToSigninWithRedirect = () => {
|
|
24293
|
-
const { pathname: e, search: t } = useLocationNoUpdate(), n = `?redirect=${e}${t}`;
|
|
24294
|
-
return /* @__PURE__ */ jsx(Navigate, { replace: !0, to: `/signin${n}` });
|
|
24295
|
-
}, NavigateIfNotSignIn = ({ children: e }) => {
|
|
24296
|
-
var n, o;
|
|
24297
|
-
const t = useCurrentUserContext();
|
|
24298
|
-
return t.loading === !1 && !((o = (n = t.data) == null ? void 0 : n.data) != null && o.id) ? /* @__PURE__ */ jsx(NavigateToSigninWithRedirect, {}) : /* @__PURE__ */ jsx(Fragment$1, { children: e });
|
|
24299
24287
|
}, CurrentUserSettingsMenuContext = createContext(null);
|
|
24300
24288
|
CurrentUserSettingsMenuContext.displayName = "CurrentUserSettingsMenuContext";
|
|
24301
24289
|
const useCurrentUserSettingsMenu = () => {
|
|
@@ -25084,9 +25072,24 @@ const BlockItemCardContext = createContext({}), BlockItemCard = React.forwardRef
|
|
|
25084
25072
|
}, 500);
|
|
25085
25073
|
return () => clearTimeout(f);
|
|
25086
25074
|
}, [a, l]);
|
|
25087
|
-
const g = (a || l) && /* @__PURE__ */ jsxs("div", { ref: m, children: [
|
|
25075
|
+
const g = (a || l) && /* @__PURE__ */ jsxs("div", { ref: m, style: { padding: "4px 0px 4px" }, children: [
|
|
25088
25076
|
/* @__PURE__ */ jsx("span", { children: a }),
|
|
25089
|
-
l && /* @__PURE__ */ jsx(
|
|
25077
|
+
l && /* @__PURE__ */ jsx(
|
|
25078
|
+
MarkdownReadPretty,
|
|
25079
|
+
{
|
|
25080
|
+
value: t.description,
|
|
25081
|
+
style: {
|
|
25082
|
+
overflowWrap: "break-word",
|
|
25083
|
+
whiteSpace: "normal",
|
|
25084
|
+
fontWeight: 400,
|
|
25085
|
+
color: "#777",
|
|
25086
|
+
lineHeight: "1.6",
|
|
25087
|
+
padding: "4px 12px",
|
|
25088
|
+
backgroundColor: i.colorFillTertiary,
|
|
25089
|
+
borderRadius: "4px"
|
|
25090
|
+
}
|
|
25091
|
+
}
|
|
25092
|
+
)
|
|
25090
25093
|
] });
|
|
25091
25094
|
return /* @__PURE__ */ jsx(BlockItemCardContext.Provider, { value: { titleHeight: d }, children: /* @__PURE__ */ jsx(Card, P(x({ ref: n, bordered: !1, style: u }, c), { title: g, children: e })) });
|
|
25092
25095
|
});
|
|
@@ -26227,10 +26230,10 @@ function SchemaSettingsBlockTitleItem() {
|
|
|
26227
26230
|
return /* @__PURE__ */ jsx(
|
|
26228
26231
|
SchemaSettingsModalItem,
|
|
26229
26232
|
{
|
|
26230
|
-
title: o("Edit block title"),
|
|
26233
|
+
title: o("Edit block title & description"),
|
|
26231
26234
|
schema: {
|
|
26232
26235
|
type: "object",
|
|
26233
|
-
title: o("Edit block title"),
|
|
26236
|
+
title: o("Edit block title & description"),
|
|
26234
26237
|
properties: {
|
|
26235
26238
|
title: {
|
|
26236
26239
|
title: o("title"),
|
|
@@ -37886,7 +37889,7 @@ const AdminSideBar = ({ sideMenuRef: e }) => {
|
|
|
37886
37889
|
/* @__PURE__ */ jsx(AdminSideBar, { sideMenuRef: t }),
|
|
37887
37890
|
/* @__PURE__ */ jsx(LayoutContent, {})
|
|
37888
37891
|
] });
|
|
37889
|
-
}, AdminProvider = (e) => /* @__PURE__ */ jsx(CurrentPageUidProvider, { children: /* @__PURE__ */ jsx(CurrentTabUidProvider, { children: /* @__PURE__ */ jsx(IsSubPageClosedByPageMenuProvider, { children: /* @__PURE__ */ jsx(
|
|
37892
|
+
}, AdminProvider = (e) => /* @__PURE__ */ jsx(CurrentPageUidProvider, { children: /* @__PURE__ */ jsx(CurrentTabUidProvider, { children: /* @__PURE__ */ jsx(IsSubPageClosedByPageMenuProvider, { children: /* @__PURE__ */ jsx(ACLRolesCheckProvider, { children: /* @__PURE__ */ jsx(MenuSchemaRequestProvider, { children: /* @__PURE__ */ jsx(RemoteCollectionManagerProvider, { children: /* @__PURE__ */ jsx(CurrentAppInfoProvider, { children: /* @__PURE__ */ jsx(RemoteSchemaTemplateManagerProvider, { children: e.children }) }) }) }) }) }) }) }), AdminLayout = (e) => /* @__PURE__ */ jsx(AdminProvider, { children: /* @__PURE__ */ jsx(InternalAdminLayout, x({}, e)) });
|
|
37890
37893
|
class AdminLayoutPlugin extends Plugin {
|
|
37891
37894
|
afterAdd() {
|
|
37892
37895
|
return q(this, null, function* () {
|
|
@@ -38253,8 +38256,8 @@ const insertPositionToMethod = {
|
|
|
38253
38256
|
}
|
|
38254
38257
|
}), [g, l]), { moveRoute: y } = useNocoBaseRoutes(), v = useCallback(
|
|
38255
38258
|
(M) => q(void 0, [M], function* ({ target: k, position: D }) {
|
|
38256
|
-
var
|
|
38257
|
-
const [N] = ((
|
|
38259
|
+
var $;
|
|
38260
|
+
const [N] = (($ = k == null ? void 0 : k.split) == null ? void 0 : $.call(k, "||")) || [];
|
|
38258
38261
|
if (!N)
|
|
38259
38262
|
return;
|
|
38260
38263
|
const O = findByUid(c, N), j = createDesignable({
|
|
@@ -38265,13 +38268,18 @@ const insertPositionToMethod = {
|
|
|
38265
38268
|
}), w = {
|
|
38266
38269
|
beforeBegin: "prepend",
|
|
38267
38270
|
afterEnd: "insertAfter"
|
|
38271
|
+
}, B = D === "beforeEnd" ? {
|
|
38272
|
+
targetScope: {
|
|
38273
|
+
parentId: O.__route__.id
|
|
38274
|
+
}
|
|
38275
|
+
} : {
|
|
38276
|
+
targetId: O.__route__.id
|
|
38268
38277
|
};
|
|
38269
|
-
yield y({
|
|
38278
|
+
yield y(x({
|
|
38270
38279
|
sourceId: o.__route__.id,
|
|
38271
|
-
targetId: O.__route__.id,
|
|
38272
38280
|
sortField: "sort",
|
|
38273
38281
|
method: w[D]
|
|
38274
|
-
}), j.loadAPIClientEvents(), j.insertAdjacent(D, o);
|
|
38282
|
+
}, B)), j.loadAPIClientEvents(), j.insertAdjacent(D, o);
|
|
38275
38283
|
}),
|
|
38276
38284
|
[c, l, r, a, y, o]
|
|
38277
38285
|
), F = useMemo(() => ({
|
|
@@ -40061,7 +40069,7 @@ attachmentFileTypes.add({
|
|
|
40061
40069
|
return matchMimetype(e, "image/*");
|
|
40062
40070
|
},
|
|
40063
40071
|
getThumbnailURL(e) {
|
|
40064
|
-
return e.url ? `${e.url}${e.thumbnailRule || ""}` : e.originFileObj ? URL.createObjectURL(e.originFileObj) : null;
|
|
40072
|
+
return e.preview ? e.preview : e.url ? `${e.url}${e.thumbnailRule || ""}` : e.originFileObj ? URL.createObjectURL(e.originFileObj) : null;
|
|
40065
40073
|
},
|
|
40066
40074
|
Previewer({ index: e, list: t, onSwitchIndex: n }) {
|
|
40067
40075
|
var r, i, a, l;
|
|
@@ -40329,7 +40337,7 @@ function Uploader(n) {
|
|
|
40329
40337
|
var $;
|
|
40330
40338
|
return c(($ = B.response) == null ? void 0 : $.data);
|
|
40331
40339
|
})];
|
|
40332
|
-
N.length ? d(w) : (l == null || l([...a, ...w]), d([]));
|
|
40340
|
+
N.length ? d(w) : (l == null || l([...a || [], ...w]), d([]));
|
|
40333
40341
|
}
|
|
40334
40342
|
} else {
|
|
40335
40343
|
const j = M.fileList.find((w) => w.uid === M.file.uid);
|
|
@@ -40971,38 +40979,40 @@ function transformNestedData(e) {
|
|
|
40971
40979
|
}
|
|
40972
40980
|
return e && n(e), t;
|
|
40973
40981
|
}
|
|
40974
|
-
const
|
|
40975
|
-
& .ant-formily-item-layout-vertical {
|
|
40976
|
-
margin-bottom: 10px;
|
|
40977
|
-
}
|
|
40978
|
-
.ant-card-body {
|
|
40979
|
-
padding: 15px 20px 5px;
|
|
40980
|
-
}
|
|
40981
|
-
.ant-divider-horizontal {
|
|
40982
|
-
margin: 10px 0;
|
|
40983
|
-
}
|
|
40984
|
-
`, InternalNesterCardCss = css`
|
|
40982
|
+
const InternalNesterCardCss = css`
|
|
40985
40983
|
.ant-card-bordered {
|
|
40986
40984
|
border: none;
|
|
40987
40985
|
}
|
|
40988
40986
|
.ant-card-body {
|
|
40989
|
-
padding: 0px 20px
|
|
40987
|
+
padding: 0px 20px 0px 0px;
|
|
40990
40988
|
}
|
|
40991
40989
|
`, InternalNester = observer$1(
|
|
40992
40990
|
() => {
|
|
40993
|
-
var
|
|
40994
|
-
const e = useField(), t = useFieldSchema(), n = useInsertSchema$1("Nester"), o = useInsertSchema$1("Selector"), { options: r } = useAssociationFieldContext(), i = (
|
|
40991
|
+
var g, h, f;
|
|
40992
|
+
const e = useField(), t = useFieldSchema(), n = useInsertSchema$1("Nester"), o = useInsertSchema$1("Selector"), { options: r } = useAssociationFieldContext(), i = (h = (g = t["x-decorator-props"]) == null ? void 0 : g.showTitle) != null ? h : !0, { actionName: a } = useACLActionParamsContext(), { token: l } = theme$1.useToken(), {
|
|
40995
40993
|
layout: c = "vertical",
|
|
40996
40994
|
labelAlign: u = "left",
|
|
40997
40995
|
labelWidth: d = 120,
|
|
40998
40996
|
labelWrap: p = !0
|
|
40999
|
-
} = (t == null ? void 0 : t["x-component-props"]) || {}
|
|
40997
|
+
} = (t == null ? void 0 : t["x-component-props"]) || {}, m = css`
|
|
40998
|
+
margin-top: 0.4em;
|
|
40999
|
+
|
|
41000
|
+
& .ant-formily-item-layout-vertical {
|
|
41001
|
+
margin-bottom: 10px;
|
|
41002
|
+
}
|
|
41003
|
+
.ant-card-body {
|
|
41004
|
+
padding: ${l.padding}px ${l.paddingLG}px;
|
|
41005
|
+
}
|
|
41006
|
+
.ant-divider-horizontal {
|
|
41007
|
+
margin: 10px 0;
|
|
41008
|
+
}
|
|
41009
|
+
`;
|
|
41000
41010
|
return useEffect(() => {
|
|
41001
41011
|
n(schema$1.Nester);
|
|
41002
41012
|
}, []), useEffect(() => {
|
|
41003
|
-
var
|
|
41004
|
-
(
|
|
41005
|
-
}, [(
|
|
41013
|
+
var C;
|
|
41014
|
+
(C = e.componentProps) != null && C.allowSelectExistingRecord && o(schema$1.Selector);
|
|
41015
|
+
}, [(f = e.componentProps) == null ? void 0 : f.allowSelectExistingRecord]), /* @__PURE__ */ jsx(CollectionProvider_deprecated, { name: r.target, children: /* @__PURE__ */ jsx(ACLCollectionProvider, { actionPath: `${r.target}:${a || "view"}`, children: /* @__PURE__ */ jsx(
|
|
41006
41016
|
FormLayout,
|
|
41007
41017
|
{
|
|
41008
41018
|
layout: c,
|
|
@@ -41013,7 +41023,7 @@ const InternalNesterCss = css`
|
|
|
41013
41023
|
"div",
|
|
41014
41024
|
{
|
|
41015
41025
|
className: cx(
|
|
41016
|
-
|
|
41026
|
+
m,
|
|
41017
41027
|
{
|
|
41018
41028
|
[InternalNesterCardCss]: i === !1
|
|
41019
41029
|
},
|
|
@@ -41035,7 +41045,7 @@ const InternalNesterCss = css`
|
|
|
41035
41045
|
onlyRenderProperties: !0,
|
|
41036
41046
|
basePath: e.address,
|
|
41037
41047
|
schema: t,
|
|
41038
|
-
filterProperties: (
|
|
41048
|
+
filterProperties: (C) => C["x-component"] === "AssociationField.Nester"
|
|
41039
41049
|
}
|
|
41040
41050
|
)
|
|
41041
41051
|
}
|
|
@@ -44474,6 +44484,14 @@ const Block = observer$1(
|
|
|
44474
44484
|
const { componentCls: t } = e;
|
|
44475
44485
|
return {
|
|
44476
44486
|
[t]: {
|
|
44487
|
+
".nb-action-bar": {
|
|
44488
|
+
borderRadius: e.borderRadiusBlock,
|
|
44489
|
+
marginBottom: `${e.marginBlock / 2}px !important`
|
|
44490
|
+
},
|
|
44491
|
+
".ant-list-pagination": {
|
|
44492
|
+
borderRadius: e.borderRadiusBlock,
|
|
44493
|
+
marginTop: `${e.marginBlock / 2}px !important`
|
|
44494
|
+
},
|
|
44477
44495
|
"& > .nb-block-item": {
|
|
44478
44496
|
marginBottom: e.marginLG,
|
|
44479
44497
|
"& > .nb-action-bar:has(:first-child:not(:empty))": {
|
|
@@ -44524,15 +44542,10 @@ const InternalGridCardBlockProvider = (e) => {
|
|
|
44524
44542
|
`, gridCardCss = css`
|
|
44525
44543
|
height: 100%;
|
|
44526
44544
|
> .ant-card-body {
|
|
44527
|
-
padding: 24px 24px 0px;
|
|
44528
44545
|
height: 100%;
|
|
44529
|
-
button {
|
|
44530
|
-
margin-bottom: 0px !important;
|
|
44531
|
-
margin-top: 5px;
|
|
44532
|
-
}
|
|
44533
44546
|
}
|
|
44534
44547
|
.nb-action-bar {
|
|
44535
|
-
padding: 5px
|
|
44548
|
+
padding-top: 5px;
|
|
44536
44549
|
}
|
|
44537
44550
|
`, GridCardItem = withDynamicSchemaProps(
|
|
44538
44551
|
(e) => {
|
|
@@ -44552,10 +44565,6 @@ const InternalGridCardBlockProvider = (e) => {
|
|
|
44552
44565
|
return;
|
|
44553
44566
|
const u = t || r ? e.controlHeight + 2 * e.paddingLG + e.marginLG : 0, d = c ? e.controlHeight + 2 * e.paddingLG + e.marginLG : 0;
|
|
44554
44567
|
return n - u - d;
|
|
44555
|
-
}, rowGutter = {
|
|
44556
|
-
md: 12,
|
|
44557
|
-
sm: 5,
|
|
44558
|
-
xs: 5
|
|
44559
44568
|
}, designerCss$1 = css`
|
|
44560
44569
|
width: 100%;
|
|
44561
44570
|
&:hover {
|
|
@@ -44620,31 +44629,31 @@ const InternalGridCardBlockProvider = (e) => {
|
|
|
44620
44629
|
};
|
|
44621
44630
|
}, InternalGridCard = withSkeletonComponent(
|
|
44622
44631
|
(e) => {
|
|
44623
|
-
var
|
|
44624
|
-
const { columnCount: t, pagination: n } = useProps(e), { service: o, columnCount: r = defaultColumnCount } = useGridCardBlockContext(), i = t || r, { run: a, params: l } = o, c = (
|
|
44625
|
-
(
|
|
44632
|
+
var A;
|
|
44633
|
+
const { columnCount: t, pagination: n } = useProps(e), { service: o, columnCount: r = defaultColumnCount } = useGridCardBlockContext(), i = t || r, { run: a, params: l } = o, c = (A = o == null ? void 0 : o.data) == null ? void 0 : A.meta, u = useFieldSchema(), d = useField(), p = useDesigner(), m = useGridCardBodyHeight(), g = useCallback(
|
|
44634
|
+
(R) => new Schema({
|
|
44626
44635
|
type: "object",
|
|
44627
44636
|
properties: {
|
|
44628
|
-
[
|
|
44637
|
+
[R]: x({}, u.properties.item)
|
|
44629
44638
|
}
|
|
44630
44639
|
}),
|
|
44631
44640
|
[u.properties]
|
|
44632
|
-
), h = useCallback(
|
|
44633
|
-
(
|
|
44641
|
+
), { token: h } = useToken(), f = useCallback(
|
|
44642
|
+
(R, k) => {
|
|
44634
44643
|
a(P(x({}, l == null ? void 0 : l[0]), {
|
|
44635
|
-
page:
|
|
44636
|
-
pageSize:
|
|
44644
|
+
page: R,
|
|
44645
|
+
pageSize: k
|
|
44637
44646
|
}));
|
|
44638
44647
|
},
|
|
44639
44648
|
[a, l]
|
|
44640
|
-
),
|
|
44641
|
-
onChange:
|
|
44642
|
-
}),
|
|
44643
|
-
layout:
|
|
44644
|
-
labelAlign:
|
|
44645
|
-
labelWidth:
|
|
44646
|
-
labelWrap:
|
|
44647
|
-
} = (
|
|
44649
|
+
), C = P(x(x({}, usePaginationProps$1()), n), {
|
|
44650
|
+
onChange: f
|
|
44651
|
+
}), b = getCardItemSchema == null ? void 0 : getCardItemSchema(u), {
|
|
44652
|
+
layout: S = "vertical",
|
|
44653
|
+
labelAlign: y = "left",
|
|
44654
|
+
labelWidth: v = 120,
|
|
44655
|
+
labelWrap: F = !0
|
|
44656
|
+
} = (b == null ? void 0 : b["x-component-props"]) || {};
|
|
44648
44657
|
return /* @__PURE__ */ jsx(
|
|
44649
44658
|
SchemaComponentOptions,
|
|
44650
44659
|
{
|
|
@@ -44673,29 +44682,29 @@ const InternalGridCardBlockProvider = (e) => {
|
|
|
44673
44682
|
/* @__PURE__ */ jsx(
|
|
44674
44683
|
FormLayout,
|
|
44675
44684
|
{
|
|
44676
|
-
layout:
|
|
44677
|
-
labelAlign:
|
|
44678
|
-
labelWidth:
|
|
44679
|
-
labelWrap:
|
|
44685
|
+
layout: S,
|
|
44686
|
+
labelAlign: y,
|
|
44687
|
+
labelWidth: S === "horizontal" ? v : null,
|
|
44688
|
+
labelWrap: F,
|
|
44680
44689
|
children: /* @__PURE__ */ jsx(
|
|
44681
44690
|
List$1,
|
|
44682
44691
|
{
|
|
44683
|
-
pagination: !c || c.count <= c.pageSize ? !1 : x({},
|
|
44692
|
+
pagination: !c || c.count <= c.pageSize ? !1 : x({}, C),
|
|
44684
44693
|
dataSource: d.value,
|
|
44685
44694
|
grid: P(x({}, i), {
|
|
44686
44695
|
sm: i.xs,
|
|
44687
44696
|
xl: i.lg,
|
|
44688
|
-
gutter: [
|
|
44697
|
+
gutter: [h.marginBlock / 2, h.marginBlock / 2]
|
|
44689
44698
|
}),
|
|
44690
|
-
renderItem: (
|
|
44699
|
+
renderItem: (R, k) => /* @__PURE__ */ jsx(Col, { style: { height: "100%" }, className: "nb-card-item-warper", children: /* @__PURE__ */ jsx(
|
|
44691
44700
|
NocoBaseRecursionField,
|
|
44692
44701
|
{
|
|
44693
44702
|
basePath: d.address,
|
|
44694
|
-
name:
|
|
44703
|
+
name: k,
|
|
44695
44704
|
onlyRenderProperties: !0,
|
|
44696
|
-
schema: g(
|
|
44705
|
+
schema: g(k)
|
|
44697
44706
|
},
|
|
44698
|
-
|
|
44707
|
+
k
|
|
44699
44708
|
) }),
|
|
44700
44709
|
loading: o == null ? void 0 : o.loading
|
|
44701
44710
|
}
|
|
@@ -46408,9 +46417,9 @@ const useStyles$2 = genStyleHook("nb-rich-text", (e) => {
|
|
|
46408
46417
|
};
|
|
46409
46418
|
}), ReactQuill = lazy(() => import("react-quill")), RichText = connect(
|
|
46410
46419
|
(e) => {
|
|
46411
|
-
const {
|
|
46420
|
+
const { wrapSSR: t, hashId: n, componentCls: o } = useStyles$2(), r = {
|
|
46412
46421
|
toolbar: [["bold", "italic", "underline", "link"], [{ list: "ordered" }, { list: "bullet" }], ["clean"]]
|
|
46413
|
-
},
|
|
46422
|
+
}, i = [
|
|
46414
46423
|
"header",
|
|
46415
46424
|
"bold",
|
|
46416
46425
|
"italic",
|
|
@@ -46422,19 +46431,19 @@ const useStyles$2 = genStyleHook("nb-rich-text", (e) => {
|
|
|
46422
46431
|
"indent",
|
|
46423
46432
|
"link",
|
|
46424
46433
|
"image"
|
|
46425
|
-
], { value:
|
|
46426
|
-
return t
|
|
46434
|
+
], { value: a, defaultValue: l, onChange: c, disabled: u } = e, d = isVariable$1(a || l) ? void 0 : a || "";
|
|
46435
|
+
return t(
|
|
46427
46436
|
/* @__PURE__ */ jsx(
|
|
46428
46437
|
ReactQuill,
|
|
46429
46438
|
{
|
|
46430
|
-
className: `${
|
|
46431
|
-
modules:
|
|
46432
|
-
formats:
|
|
46433
|
-
value:
|
|
46434
|
-
onChange: (
|
|
46435
|
-
|
|
46439
|
+
className: `${o} ${n}`,
|
|
46440
|
+
modules: r,
|
|
46441
|
+
formats: i,
|
|
46442
|
+
value: d,
|
|
46443
|
+
onChange: (p) => {
|
|
46444
|
+
c(p === "<p><br></p>" ? void 0 : p);
|
|
46436
46445
|
},
|
|
46437
|
-
readOnly:
|
|
46446
|
+
readOnly: u
|
|
46438
46447
|
}
|
|
46439
46448
|
)
|
|
46440
46449
|
);
|
|
@@ -55232,7 +55241,7 @@ const ACLProvider = (e) => /* @__PURE__ */ jsx(
|
|
|
55232
55241
|
}
|
|
55233
55242
|
}
|
|
55234
55243
|
);
|
|
55235
|
-
return i.loading ? n() :
|
|
55244
|
+
return i.loading ? n() : /* @__PURE__ */ jsx(ACLContext.Provider, { value: i, children: e.children });
|
|
55236
55245
|
}, useRoleRecheck = () => {
|
|
55237
55246
|
const e = useContext(ACLContext), { allowAll: t } = useACLRoleContext();
|
|
55238
55247
|
return () => {
|
|
@@ -63988,8 +63997,6 @@ export {
|
|
|
63988
63997
|
MultipleSelectFieldInterface,
|
|
63989
63998
|
NanoIDInput,
|
|
63990
63999
|
NanoidFieldInterface,
|
|
63991
|
-
NavigateIfNotSignIn,
|
|
63992
|
-
NavigateToSigninWithRedirect,
|
|
63993
64000
|
NocoBaseBuildInPlugin,
|
|
63994
64001
|
NocoBaseDesktopRouteType,
|
|
63995
64002
|
NocoBaseRecursionField,
|
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
-
import React, { ComponentType } from 'react';
|
|
10
9
|
import { useImported } from 'react-imported-component';
|
|
11
10
|
export declare const LAZY_COMPONENT_KEY: unique symbol;
|
|
11
|
+
type LazyComponentType<M extends Record<string, any>, K extends keyof M> = {
|
|
12
|
+
[P in K]: M[P];
|
|
13
|
+
};
|
|
12
14
|
/**
|
|
13
15
|
* Lazily loads a React component or multiple components.
|
|
14
16
|
*
|
|
@@ -26,10 +28,8 @@ export declare const LAZY_COMPONENT_KEY: unique symbol;
|
|
|
26
28
|
* @param {...K[]} componentNames - The names of the components to be lazy-loaded from the module.
|
|
27
29
|
* @returns {Record<K, React.LazyExoticComponent<M[K]>>} An object containing the lazy-loaded components.
|
|
28
30
|
*/
|
|
29
|
-
export declare function lazy<M extends
|
|
30
|
-
|
|
31
|
-
}>): React.LazyExoticComponent<M>;
|
|
32
|
-
export declare function lazy<M extends Record<string, any>, K extends keyof M & string>(factory: () => Promise<M>, ...componentNames: K[]): Record<K, React.LazyExoticComponent<M[K]>>;
|
|
31
|
+
export declare function lazy<M extends Record<'default', any>>(factory: () => Promise<M>): M['default'];
|
|
32
|
+
export declare function lazy<M extends Record<string, any>, K extends keyof M = keyof M>(factory: () => Promise<M>, ...componentNames: K[]): LazyComponentType<M, K>;
|
|
33
33
|
/**
|
|
34
34
|
* A hook to lazily load a module and return a specific export from it.
|
|
35
35
|
*
|
|
@@ -46,3 +46,4 @@ export declare function lazy<M extends Record<string, any>, K extends keyof M &
|
|
|
46
46
|
* @throws {Promise} Throws a promise while the module is being loaded.
|
|
47
47
|
*/
|
|
48
48
|
export declare function useLazy<T = () => any>(importor: Parameters<typeof useImported>[0], picker: string | ((module: any) => T)): T;
|
|
49
|
+
export {};
|
|
@@ -28,5 +28,7 @@ export declare const DetailsBlockInitializer: ({ filterCollections, onlyCurrentD
|
|
|
28
28
|
hideChildrenIfSingleCollection?: boolean;
|
|
29
29
|
}) => React.JSX.Element;
|
|
30
30
|
export declare const useCreateDetailsBlock: () => {
|
|
31
|
-
createDetailsBlock: ({ item }:
|
|
31
|
+
createDetailsBlock: ({ item }: {
|
|
32
|
+
item: any;
|
|
33
|
+
}) => void;
|
|
32
34
|
};
|
package/es/modules/blocks/data-blocks/details-single/RecordReadPrettyFormBlockInitializer.d.ts
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
export declare const RecordReadPrettyFormBlockInitializer: () => React.JSX.Element;
|
|
11
11
|
export declare function useCreateSingleDetailsSchema(): {
|
|
12
|
-
createSingleDetailsSchema: ({ item }:
|
|
12
|
+
createSingleDetailsSchema: ({ item }: {
|
|
13
|
+
item: any;
|
|
14
|
+
}) => Promise<void>;
|
|
13
15
|
templateWrap: (templateSchema: any, options: any) => any;
|
|
14
16
|
};
|
|
@@ -35,6 +35,12 @@ export declare const FormBlockInitializer: ({ filterCollections, onlyCurrentData
|
|
|
35
35
|
otherText?: string;
|
|
36
36
|
}) => React.JSX.Element;
|
|
37
37
|
export declare const useCreateFormBlock: () => {
|
|
38
|
-
createFormBlock: ({ item, fromOthersInPopup }:
|
|
39
|
-
|
|
38
|
+
createFormBlock: ({ item, fromOthersInPopup }: {
|
|
39
|
+
item: any;
|
|
40
|
+
fromOthersInPopup: any;
|
|
41
|
+
}) => void;
|
|
42
|
+
templateWrap: (templateSchema: any, { item, fromOthersInPopup }: {
|
|
43
|
+
item: any;
|
|
44
|
+
fromOthersInPopup: any;
|
|
45
|
+
}) => any;
|
|
40
46
|
};
|
|
@@ -12,6 +12,10 @@ import React from 'react';
|
|
|
12
12
|
*/
|
|
13
13
|
export declare const RecordFormBlockInitializer: () => React.JSX.Element;
|
|
14
14
|
export declare function useCreateEditFormBlock(): {
|
|
15
|
-
createEditFormBlock: ({ item }:
|
|
16
|
-
|
|
15
|
+
createEditFormBlock: ({ item }: {
|
|
16
|
+
item: any;
|
|
17
|
+
}) => void;
|
|
18
|
+
templateWrap: (templateSchema: any, { item }: {
|
|
19
|
+
item: any;
|
|
20
|
+
}) => any;
|
|
17
21
|
};
|
|
@@ -21,8 +21,14 @@ export declare const useTableBlockProps: () => {
|
|
|
21
21
|
onChange: () => void;
|
|
22
22
|
};
|
|
23
23
|
onRowSelectionChange: (selectedRowKeys: any, selectedRowData: any) => void;
|
|
24
|
-
onRowDragEnd: ({ from, to }:
|
|
25
|
-
|
|
24
|
+
onRowDragEnd: ({ from, to }: {
|
|
25
|
+
from: any;
|
|
26
|
+
to: any;
|
|
27
|
+
}) => Promise<void>;
|
|
28
|
+
onChange: ({ current, pageSize }: {
|
|
29
|
+
current: any;
|
|
30
|
+
pageSize: any;
|
|
31
|
+
}, filters: any, sorter: any) => void;
|
|
26
32
|
onClickRow: (record: any, setSelectedRow: any, selectedRow: any) => void;
|
|
27
33
|
onExpand: (expanded: any, record: any) => void;
|
|
28
34
|
};
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
/// <reference types="react" />
|
|
10
10
|
export declare const useActionContext: () => {
|
|
11
|
-
setVisible: (visible: boolean, confirm?:
|
|
11
|
+
setVisible: (visible: boolean, confirm?: boolean) => void;
|
|
12
12
|
button?: import("react").JSX.Element;
|
|
13
13
|
visible?: boolean;
|
|
14
14
|
openMode?: "page" | "modal" | "drawer";
|