@nocobase/client 2.0.0-alpha.5 → 2.0.0-alpha.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/es/flow/actions/columnFixed.d.ts +10 -0
- package/es/flow/actions/index.d.ts +1 -0
- package/es/flow/models/blocks/table/TableBlockModel.d.ts +1 -1
- package/es/flow/models/blocks/table/utils.d.ts +1 -0
- package/es/index.mjs +207 -113
- package/lib/{index-C3fHjsMw-BpCRZOKn.js → index-C3fHjsMw-B24GCpti.js} +199 -199
- package/lib/index.js +20 -20
- package/lib/locale/zh-CN.js +9 -1
- package/package.json +6 -6
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { FlowModel } from '@nocobase/flow-engine';
|
|
10
|
+
export declare const fixed: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, import("@nocobase/flow-engine").FlowContext>;
|
|
@@ -21,6 +21,7 @@ export * from './fieldComponent';
|
|
|
21
21
|
export * from './aclCheck';
|
|
22
22
|
export * from './pattern';
|
|
23
23
|
export * from './validation';
|
|
24
|
+
export * from './columnFixed';
|
|
24
25
|
export { fieldLinkageRules, detailsFieldLinkageRules, linkageSetDetailsFieldProps, actionLinkageRules, blockLinkageRules, linkageSetBlockProps, linkageSetActionProps, linkageSetFieldProps, linkageAssignField, linkageRunjs, } from './linkageRules';
|
|
25
26
|
export { displayFieldComponent } from './displayFieldComponent';
|
|
26
27
|
export * from './overflowMode';
|
|
@@ -36,7 +36,7 @@ export declare class TableBlockModel extends CollectionBlockModel<TableBlockMode
|
|
|
36
36
|
customModelClasses: CustomTableBlockModelClassesEnum;
|
|
37
37
|
get resource(): MultiRecordResource<any>;
|
|
38
38
|
createResource(ctx: any, params: any): MultiRecordResource<unknown>;
|
|
39
|
-
getColumns():
|
|
39
|
+
getColumns(): any[];
|
|
40
40
|
EditableRow: (props: any) => React.JSX.Element;
|
|
41
41
|
EditableCell: React.MemoExoticComponent<import("@formily/reactive-react").ReactFC<Omit<any, "ref">>>;
|
|
42
42
|
components: {
|
package/es/index.mjs
CHANGED
|
@@ -92,7 +92,7 @@ import { TinyColor } from "@ctrl/tinycolor";
|
|
|
92
92
|
import * as i18next from "i18next";
|
|
93
93
|
import i18next__default from "i18next";
|
|
94
94
|
import * as antIcons from "@ant-design/icons";
|
|
95
|
-
import antIcons__default, { LoadingOutlined, createFromIconfontCN, RightOutlined, QuestionCircleOutlined, MenuOutlined, CloseOutlined, CloseCircleOutlined, PlusOutlined, DragOutlined, CopyOutlined, LeftOutlined, FileImageOutlined, ScanOutlined, CloseCircleFilled, ExclamationCircleFilled, UserOutlined, HighlightOutlined, EllipsisOutlined, ArrowLeftOutlined, DownOutlined, DownloadOutlined, UndoOutlined, RedoOutlined, InboxOutlined, DeleteOutlined, CheckOutlined, EditOutlined, ZoomInOutlined, EyeInvisibleOutlined, EyeOutlined, VerticalAlignBottomOutlined, VerticalAlignTopOutlined, VerticalAlignMiddleOutlined, RightSquareOutlined, SyncOutlined, ApiOutlined, SettingOutlined, ReadOutlined, ReloadOutlined, ArrowUpOutlined, ArrowDownOutlined, LockOutlined, UploadOutlined, SwapOutlined, RotateLeftOutlined, RotateRightOutlined, ZoomOutOutlined, ThunderboltOutlined, SearchOutlined, TableOutlined, FormOutlined, ProfileOutlined, AppstoreOutlined, OrderedListOutlined, LineOutlined, DisconnectOutlined, TranslationOutlined } from "@ant-design/icons";
|
|
95
|
+
import antIcons__default, { LoadingOutlined, createFromIconfontCN, RightOutlined, QuestionCircleOutlined, MenuOutlined, CloseOutlined, CloseCircleOutlined, PlusOutlined, DragOutlined, CopyOutlined, LeftOutlined, FileImageOutlined, ScanOutlined, CloseCircleFilled, ExclamationCircleFilled, UserOutlined, HighlightOutlined, EllipsisOutlined, ArrowLeftOutlined, DownOutlined, DownloadOutlined, UndoOutlined, RedoOutlined, InboxOutlined, DeleteOutlined, CheckOutlined, EditOutlined, ZoomInOutlined, EyeInvisibleOutlined, EyeOutlined, VerticalAlignBottomOutlined, VerticalAlignTopOutlined, VerticalAlignMiddleOutlined, RightSquareOutlined, SyncOutlined, ApiOutlined, SettingOutlined, ReadOutlined, ReloadOutlined, ArrowUpOutlined, ArrowDownOutlined, LockOutlined, ExclamationCircleOutlined, UploadOutlined, SwapOutlined, RotateLeftOutlined, RotateRightOutlined, ZoomOutOutlined, ThunderboltOutlined, SearchOutlined, TableOutlined, FormOutlined, ProfileOutlined, AppstoreOutlined, OrderedListOutlined, LineOutlined, DisconnectOutlined, TranslationOutlined } from "@ant-design/icons";
|
|
96
96
|
import * as ReactRouter from "react-router";
|
|
97
97
|
import { matchRoutes } from "react-router";
|
|
98
98
|
import omit$1 from "lodash/omit";
|
|
@@ -148,6 +148,7 @@ import * as acorn from "acorn";
|
|
|
148
148
|
import { SiderContext } from "antd/es/layout/Sider";
|
|
149
149
|
import "@dnd-kit/utilities";
|
|
150
150
|
import { customAlphabet } from "nanoid";
|
|
151
|
+
import { isDesktop, deviceType } from "react-device-detect";
|
|
151
152
|
import BigNumber from "bignumber.js";
|
|
152
153
|
import * as math from "mathjs";
|
|
153
154
|
import { isFunction as isFunction$1 } from "mathjs";
|
|
@@ -161,7 +162,6 @@ import useAntdInputStyle from "antd/es/input/style";
|
|
|
161
162
|
import { Cron as Cron$1 } from "react-js-cron";
|
|
162
163
|
import "react-js-cron/dist/styles.css";
|
|
163
164
|
import { Line, Area, Column, Bar, Pie, Rose, WordCloud, Scatter, Radar, DualAxes, TinyLine, TinyColumn, TinyArea, Histogram, Progress as Progress$1, RingProgress, Heatmap, Box, Violin, Venn, Stock, Funnel, Liquid, Bullet, Sunburst, Gauge, Waterfall, RadialBar, BidirectionalBar, Treemap, Sankey, Chord, CirclePacking, Mix, Facet } from "@antv/g2plot";
|
|
164
|
-
import { isDesktop } from "react-device-detect";
|
|
165
165
|
import ReactDragListView from "react-drag-listview";
|
|
166
166
|
import useUploadStyle from "antd/es/upload/style";
|
|
167
167
|
import filesize from "filesize";
|
|
@@ -9556,7 +9556,7 @@ function addAppVersion(e, t) {
|
|
|
9556
9556
|
addAppVersion((n = e.properties) == null ? void 0 : n[o], t);
|
|
9557
9557
|
}), e;
|
|
9558
9558
|
}
|
|
9559
|
-
const name = "@nocobase/client", version = "2.0.0-alpha.
|
|
9559
|
+
const name = "@nocobase/client", version = "2.0.0-alpha.7", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
|
|
9560
9560
|
"@ahooksjs/use-url-state": "3.5.1",
|
|
9561
9561
|
"@ant-design/cssinjs": "^1.11.1",
|
|
9562
9562
|
"@ant-design/icons": "^5.6.1",
|
|
@@ -9579,10 +9579,10 @@ const name = "@nocobase/client", version = "2.0.0-alpha.5", license = "AGPL-3.0"
|
|
|
9579
9579
|
"@formily/reactive-react": "^2.2.27",
|
|
9580
9580
|
"@formily/shared": "^2.2.27",
|
|
9581
9581
|
"@formily/validator": "^2.2.27",
|
|
9582
|
-
"@nocobase/evaluators": "2.0.0-alpha.
|
|
9583
|
-
"@nocobase/flow-engine": "2.0.0-alpha.
|
|
9584
|
-
"@nocobase/sdk": "2.0.0-alpha.
|
|
9585
|
-
"@nocobase/utils": "2.0.0-alpha.
|
|
9582
|
+
"@nocobase/evaluators": "2.0.0-alpha.7",
|
|
9583
|
+
"@nocobase/flow-engine": "2.0.0-alpha.7",
|
|
9584
|
+
"@nocobase/sdk": "2.0.0-alpha.7",
|
|
9585
|
+
"@nocobase/utils": "2.0.0-alpha.7",
|
|
9586
9586
|
"@tanstack/react-table": "^8.21.3",
|
|
9587
9587
|
"@types/tabulator-tables": "^6.2.6",
|
|
9588
9588
|
ahooks: "^3.7.2",
|
|
@@ -10806,7 +10806,7 @@ const useArrayField$1 = (e) => {
|
|
|
10806
10806
|
const t = useField();
|
|
10807
10807
|
return e.field || t;
|
|
10808
10808
|
};
|
|
10809
|
-
function adjustColumnOrder$
|
|
10809
|
+
function adjustColumnOrder$2(e) {
|
|
10810
10810
|
const t = [], o = [], n = [];
|
|
10811
10811
|
return e.forEach((r) => {
|
|
10812
10812
|
r.fixed === "left" ? t.push(r) : r.fixed === "right" ? n.push(r) : o.push(r);
|
|
@@ -10957,7 +10957,7 @@ const TableCellRender = ({ record: e, columnSchema: t, uiSchema: o, filterProper
|
|
|
10957
10957
|
}
|
|
10958
10958
|
);
|
|
10959
10959
|
}
|
|
10960
|
-
}), adjustColumnOrder$
|
|
10960
|
+
}), adjustColumnOrder$2(w);
|
|
10961
10961
|
}, [T, c, r, u, e.showDel, l]);
|
|
10962
10962
|
}, SortableRow$1 = (e) => {
|
|
10963
10963
|
var m, g, x;
|
|
@@ -29976,7 +29976,7 @@ const useStyles$a = genStyleHook("nb-markdown", (e, { isDarkTheme: t }) => {
|
|
|
29976
29976
|
}, t ? i : r)
|
|
29977
29977
|
};
|
|
29978
29978
|
}), parseMarkdown$1 = _.memoize((e) => E(void 0, null, function* () {
|
|
29979
|
-
return e && (yield import("./md-
|
|
29979
|
+
return e && (yield import("./md-oH2RssNY.mjs")).default.render(e);
|
|
29980
29980
|
}));
|
|
29981
29981
|
function useParseMarkdown$1(e) {
|
|
29982
29982
|
const [t, o] = useState(""), [n, r] = useState(!0);
|
|
@@ -47285,7 +47285,7 @@ const CreateRecordAction$1 = forwardRef(InternalCreateRecordAction), initializer
|
|
|
47285
47285
|
function getSchemaArrJSON(e) {
|
|
47286
47286
|
return e.map((t) => t.name === "actions" ? omit(t.toJSON(), "properties") : t.toJSON());
|
|
47287
47287
|
}
|
|
47288
|
-
function adjustColumnOrder(e) {
|
|
47288
|
+
function adjustColumnOrder$1(e) {
|
|
47289
47289
|
const t = [], o = [], n = [];
|
|
47290
47290
|
return e.forEach((r) => {
|
|
47291
47291
|
r.fixed === "left" ? t.push(r) : r.fixed === "right" ? n.push(r) : o.push(r);
|
|
@@ -47379,7 +47379,7 @@ const useColumnsDeepMemoized = (e) => {
|
|
|
47379
47379
|
}
|
|
47380
47380
|
);
|
|
47381
47381
|
}
|
|
47382
|
-
}), adjustColumnOrder(C);
|
|
47382
|
+
}), adjustColumnOrder$1(C);
|
|
47383
47383
|
}, [y, c, r, u, e.showDel, l]);
|
|
47384
47384
|
}, INITIAL_ROWS_NUMBER = 20, SortableRow = (e) => {
|
|
47385
47385
|
var g, b, y, S, C, v;
|
|
@@ -65442,16 +65442,16 @@ const { DateFilterDynamicComponent: DateFilterDynamicComponentLazy$1 } = lazy(
|
|
|
65442
65442
|
"DateFilterDynamicComponent"
|
|
65443
65443
|
);
|
|
65444
65444
|
function createStaticInputRenderer$1(e, t, o) {
|
|
65445
|
-
var
|
|
65446
|
-
const n = e == null ? void 0 : e["x-component"], r = ((
|
|
65445
|
+
var u;
|
|
65446
|
+
const n = e == null ? void 0 : e["x-component"], r = ((u = t == null ? void 0 : t.uiSchema) == null ? void 0 : u["x-component-props"]) || {}, i = (e == null ? void 0 : e["x-component-props"]) || {}, a = merge$1({}, r, i), l = (e == null ? void 0 : e.enum) || [], c = f({
|
|
65447
65447
|
style: f({ width: 200 }, (a == null ? void 0 : a.style) || {}),
|
|
65448
65448
|
placeholder: (a == null ? void 0 : a.placeholder) || o("Enter value")
|
|
65449
65449
|
}, a);
|
|
65450
|
-
return (
|
|
65451
|
-
const
|
|
65452
|
-
return n === "InputNumber" ? /* @__PURE__ */ jsx(InputNumber$1, I(f(f({},
|
|
65453
|
-
var
|
|
65454
|
-
return
|
|
65450
|
+
return (d) => {
|
|
65451
|
+
const g = d || {}, { value: p, onChange: m } = g, h = W(g, ["value", "onChange"]);
|
|
65452
|
+
return n === "InputNumber" ? /* @__PURE__ */ jsx(InputNumber$1, I(f(f({}, c), h), { value: p, onChange: m })) : n === "NumberPicker" ? /* @__PURE__ */ jsx(NumberPicker, I(f(f({}, c), h), { value: p, onChange: m })) : n === "Switch" ? /* @__PURE__ */ jsx(Switch, I(f(f({}, c), h), { checked: !!p, onChange: m })) : n === "Select" ? /* @__PURE__ */ jsx(Select$1, I(f(f({ options: l }, c), h), { value: p, onChange: m })) : n === "DateFilterDynamicComponent" ? /* @__PURE__ */ jsx(DateFilterDynamicComponentLazy$1, I(f(f({}, c), h), { value: p, onChange: m })) : /* @__PURE__ */ jsx(Input$3, I(f(f({}, c), h), { value: p, onChange: (x) => {
|
|
65453
|
+
var b;
|
|
65454
|
+
return m == null ? void 0 : m((b = x == null ? void 0 : x.target) == null ? void 0 : b.value);
|
|
65455
65455
|
} }));
|
|
65456
65456
|
};
|
|
65457
65457
|
}
|
|
@@ -65924,6 +65924,26 @@ const getKey = (e) => `${e.params.viewUid}_${e.index}`, FlowRoute = () => {
|
|
|
65924
65924
|
return useEffect(() => {
|
|
65925
65925
|
t.context.defineProperty("isMobileLayout", {
|
|
65926
65926
|
get: () => r
|
|
65927
|
+
}), t.context.defineProperty("deviceType", {
|
|
65928
|
+
get: () => deviceType === "browser" ? "computer" : deviceType,
|
|
65929
|
+
cache: !1,
|
|
65930
|
+
meta: {
|
|
65931
|
+
type: "string",
|
|
65932
|
+
title: t.translate("Current device type"),
|
|
65933
|
+
interface: "select",
|
|
65934
|
+
uiSchema: {
|
|
65935
|
+
enum: [
|
|
65936
|
+
{ label: t.translate("Computer"), value: "computer" },
|
|
65937
|
+
{ label: t.translate("Mobile"), value: "mobile" },
|
|
65938
|
+
{ label: t.translate("Tablet"), value: "tablet" },
|
|
65939
|
+
{ label: t.translate("SmartTv"), value: "smarttv" },
|
|
65940
|
+
{ label: t.translate("Console"), value: "console" },
|
|
65941
|
+
{ label: t.translate("Wearable"), value: "wearable" },
|
|
65942
|
+
{ label: t.translate("Embedded"), value: "embedded" }
|
|
65943
|
+
],
|
|
65944
|
+
"x-component": "Select"
|
|
65945
|
+
}
|
|
65946
|
+
}
|
|
65927
65947
|
});
|
|
65928
65948
|
}, [r, t]), useEffect(() => {
|
|
65929
65949
|
r ? t.flowSettings.disable() : u && t.flowSettings.enable();
|
|
@@ -66538,7 +66558,7 @@ const getKey = (e) => `${e.params.viewUid}_${e.index}`, FlowRoute = () => {
|
|
|
66538
66558
|
large: "80%"
|
|
66539
66559
|
},
|
|
66540
66560
|
embed: {}
|
|
66541
|
-
}, a = e.inputArgs.pageModelClass || t.pageModelClass || "ChildPageModel", l = e.inputArgs.mode || t.mode || "drawer", c = e.inputArgs.size || t.size || "medium";
|
|
66561
|
+
}, a = e.inputArgs.pageModelClass || t.pageModelClass || "ChildPageModel", l = e.inputArgs.isMobileLayout ? "embed" : e.inputArgs.mode || t.mode || "drawer", c = e.inputArgs.size || t.size || "medium";
|
|
66542
66562
|
let u = null, d = null, p = e.model.uid;
|
|
66543
66563
|
if (t.subModelKey) {
|
|
66544
66564
|
const ae = yield e.engine.loadOrCreateModel({
|
|
@@ -66558,8 +66578,7 @@ const getKey = (e) => `${e.params.viewUid}_${e.index}`, FlowRoute = () => {
|
|
|
66558
66578
|
openerUids: g
|
|
66559
66579
|
});
|
|
66560
66580
|
x.filterByTk = (te = o.filterByTk) != null ? te : t.filterByTk, x.sourceId = (ne = o.sourceId) != null ? ne : t.sourceId, yield e.viewer.open({
|
|
66561
|
-
type:
|
|
66562
|
-
// 移动端中只需要显示子页面
|
|
66581
|
+
type: l,
|
|
66563
66582
|
inputArgs: x,
|
|
66564
66583
|
preventClose: !!t.preventClose,
|
|
66565
66584
|
destroyOnClose: !0,
|
|
@@ -67751,12 +67770,12 @@ const CodeEditor = (e) => {
|
|
|
67751
67770
|
}, titleField = defineAction({
|
|
67752
67771
|
name: "titleField",
|
|
67753
67772
|
title: tval$1("Label field"),
|
|
67754
|
-
uiSchema: (e) => e.collectionField.isAssociationField() ? {
|
|
67773
|
+
uiSchema: (e) => !e.collectionField || !e.collectionField.isAssociationField() ? null : {
|
|
67755
67774
|
label: {
|
|
67756
67775
|
"x-component": SelectOptions$1,
|
|
67757
67776
|
"x-decorator": "FormItem"
|
|
67758
67777
|
}
|
|
67759
|
-
}
|
|
67778
|
+
},
|
|
67760
67779
|
defaultParams: (e) => {
|
|
67761
67780
|
var o;
|
|
67762
67781
|
const t = e.model.context.collectionField.targetCollectionTitleFieldName;
|
|
@@ -67807,7 +67826,7 @@ const CodeEditor = (e) => {
|
|
|
67807
67826
|
});
|
|
67808
67827
|
}
|
|
67809
67828
|
}), parseMarkdown = _.memoize((e) => E(void 0, null, function* () {
|
|
67810
|
-
return e && (yield import("./md-
|
|
67829
|
+
return e && (yield import("./md-BbvRKckr.mjs")).default.render(e);
|
|
67811
67830
|
}));
|
|
67812
67831
|
function useParseMarkdown(e) {
|
|
67813
67832
|
const [t, o] = useState(""), [n, r] = useState(!0);
|
|
@@ -68614,9 +68633,12 @@ DetailsItemModel.registerFlow({
|
|
|
68614
68633
|
}
|
|
68615
68634
|
}
|
|
68616
68635
|
}),
|
|
68617
|
-
defaultParams: (e) =>
|
|
68618
|
-
|
|
68619
|
-
|
|
68636
|
+
defaultParams: (e) => {
|
|
68637
|
+
var t;
|
|
68638
|
+
return {
|
|
68639
|
+
title: (t = e.collectionField) == null ? void 0 : t.title
|
|
68640
|
+
};
|
|
68641
|
+
},
|
|
68620
68642
|
handler(e, t) {
|
|
68621
68643
|
e.model.setProps({ label: t.title });
|
|
68622
68644
|
}
|
|
@@ -68736,16 +68758,18 @@ const displayFieldComponent = defineAction({
|
|
|
68736
68758
|
title: escapeT("Field component"),
|
|
68737
68759
|
uiSchema: (e) => {
|
|
68738
68760
|
const { titleField: t } = e.model.props;
|
|
68739
|
-
return e.model.constructor.getBindingsByField(e, e.collectionField).length === 1 && !t ? null : {
|
|
68761
|
+
return e.collectionField ? e.model.constructor.getBindingsByField(e, e.collectionField).length === 1 && !t ? null : {
|
|
68740
68762
|
use: {
|
|
68741
68763
|
type: "string",
|
|
68742
68764
|
"x-component": "Select",
|
|
68743
68765
|
"x-decorator": "FormItem",
|
|
68744
68766
|
enum: buildAssociationOptions(e, e.model.constructor, t)
|
|
68745
68767
|
}
|
|
68746
|
-
};
|
|
68768
|
+
} : void 0;
|
|
68747
68769
|
},
|
|
68748
68770
|
beforeParamsSave: (e, t, o) => E(void 0, null, function* () {
|
|
68771
|
+
if (!e.collectionField)
|
|
68772
|
+
return;
|
|
68749
68773
|
const n = e.model.constructor.getBindingsByField(e, e.collectionField), { titleField: r } = e.model.props;
|
|
68750
68774
|
let i = [];
|
|
68751
68775
|
r && (i = e.model.constructor.getBindingsByField(
|
|
@@ -68783,8 +68807,8 @@ const displayFieldComponent = defineAction({
|
|
|
68783
68807
|
name: "fieldComponent",
|
|
68784
68808
|
uiSchema: (e) => {
|
|
68785
68809
|
if (e.model.getProps().pattern === "readPretty") {
|
|
68786
|
-
const { titleField: t } = e.model.props;
|
|
68787
|
-
return
|
|
68810
|
+
const { titleField: t } = e.model.props, o = e.model.constructor.getBindingsByField(e, e.collectionField);
|
|
68811
|
+
return !o || o.length === 1 && !t ? null : {
|
|
68788
68812
|
use: {
|
|
68789
68813
|
type: "string",
|
|
68790
68814
|
"x-component": "Select",
|
|
@@ -68794,7 +68818,7 @@ const displayFieldComponent = defineAction({
|
|
|
68794
68818
|
};
|
|
68795
68819
|
} else {
|
|
68796
68820
|
const t = e.model.constructor.getBindingsByField(e, e.collectionField);
|
|
68797
|
-
return t.length === 1 ? null : {
|
|
68821
|
+
return !t || t.length === 1 ? null : {
|
|
68798
68822
|
use: {
|
|
68799
68823
|
type: "string",
|
|
68800
68824
|
"x-component": "Select",
|
|
@@ -68848,38 +68872,42 @@ const displayFieldComponent = defineAction({
|
|
|
68848
68872
|
handler(e, t) {
|
|
68849
68873
|
return E(this, null, function* () {
|
|
68850
68874
|
var n, r;
|
|
68851
|
-
|
|
68875
|
+
const o = yield e.aclCheck({
|
|
68852
68876
|
dataSourceKey: (n = e.model.context.dataSource) == null ? void 0 : n.key,
|
|
68853
68877
|
resourceName: e.model.context.resourceName,
|
|
68854
68878
|
actionName: e.model.context.actionName,
|
|
68855
68879
|
fields: ((r = e.model.context) == null ? void 0 : r.collectionField) && [e.model.context.collectionField.name]
|
|
68856
|
-
})
|
|
68880
|
+
});
|
|
68881
|
+
e.fieldPath && !e.collectionField && (e.model.fieldDeleted = !0, e.model.hidden = !0, e.exitAll()), o || (e.model.hidden = !0, e.exitAll());
|
|
68857
68882
|
});
|
|
68858
68883
|
}
|
|
68859
68884
|
}), pattern = defineAction({
|
|
68860
68885
|
name: "pattern",
|
|
68861
68886
|
title: escapeT("Display mode"),
|
|
68862
|
-
uiSchema: (e) =>
|
|
68863
|
-
|
|
68864
|
-
|
|
68865
|
-
|
|
68866
|
-
|
|
68867
|
-
|
|
68868
|
-
|
|
68869
|
-
|
|
68870
|
-
|
|
68871
|
-
|
|
68872
|
-
|
|
68873
|
-
|
|
68874
|
-
|
|
68875
|
-
|
|
68876
|
-
|
|
68877
|
-
|
|
68887
|
+
uiSchema: (e) => {
|
|
68888
|
+
if (e.model.collectionField)
|
|
68889
|
+
return {
|
|
68890
|
+
pattern: {
|
|
68891
|
+
"x-component": "Select",
|
|
68892
|
+
"x-decorator": "FormItem",
|
|
68893
|
+
enum: [
|
|
68894
|
+
{
|
|
68895
|
+
value: "editable",
|
|
68896
|
+
label: escapeT("Editable")
|
|
68897
|
+
},
|
|
68898
|
+
{
|
|
68899
|
+
value: "disabled",
|
|
68900
|
+
label: escapeT("Disabled")
|
|
68901
|
+
},
|
|
68902
|
+
{
|
|
68903
|
+
value: "readPretty",
|
|
68904
|
+
label: escapeT("Display only")
|
|
68905
|
+
}
|
|
68906
|
+
],
|
|
68907
|
+
"x-disabled": e.model.collectionField.inputable === !1
|
|
68878
68908
|
}
|
|
68879
|
-
|
|
68880
|
-
|
|
68881
|
-
}
|
|
68882
|
-
}),
|
|
68909
|
+
};
|
|
68910
|
+
},
|
|
68883
68911
|
defaultParams: (e) => ({
|
|
68884
68912
|
pattern: e.model.collectionField.inputable === !1 || e.model.context.parentDisabled || e.model.props.disabled || e.model.collectionField.readonly ? "disabled" : "editable"
|
|
68885
68913
|
}),
|
|
@@ -68926,6 +68954,8 @@ const validation = defineAction({
|
|
|
68926
68954
|
title: escapeT("Validation"),
|
|
68927
68955
|
name: "validation",
|
|
68928
68956
|
uiSchema: (e) => {
|
|
68957
|
+
if (!e.model.collectionField)
|
|
68958
|
+
return;
|
|
68929
68959
|
const t = e.app.dataSourceManager.collectionFieldInterfaceManager.getFieldInterface(
|
|
68930
68960
|
e.model.collectionField.interface
|
|
68931
68961
|
);
|
|
@@ -68966,6 +68996,29 @@ const validation = defineAction({
|
|
|
68966
68996
|
});
|
|
68967
68997
|
}
|
|
68968
68998
|
}
|
|
68999
|
+
}), fixed = defineAction({
|
|
69000
|
+
title: tval$1("Fixed"),
|
|
69001
|
+
name: "fixed",
|
|
69002
|
+
uiSchema: (e) => {
|
|
69003
|
+
const t = e.t;
|
|
69004
|
+
return {
|
|
69005
|
+
fixed: {
|
|
69006
|
+
"x-component": "Select",
|
|
69007
|
+
"x-decorator": "FormItem",
|
|
69008
|
+
enum: [
|
|
69009
|
+
{ label: t("Not fixed"), value: "none" },
|
|
69010
|
+
{ label: t("Left fixed"), value: "left" },
|
|
69011
|
+
{ label: t("Right fixed"), value: "right" }
|
|
69012
|
+
]
|
|
69013
|
+
}
|
|
69014
|
+
};
|
|
69015
|
+
},
|
|
69016
|
+
defaultParams: {
|
|
69017
|
+
fixed: "none"
|
|
69018
|
+
},
|
|
69019
|
+
handler(e, t) {
|
|
69020
|
+
e.model.setProps("fixed", t.fixed);
|
|
69021
|
+
}
|
|
68969
69022
|
}), FieldAssignValueInput = ({ fieldUid: e, value: t, onChange: o }) => {
|
|
68970
69023
|
var x, b, y;
|
|
68971
69024
|
const n = useFlowContext(), r = React.useMemo(() => {
|
|
@@ -69917,6 +69970,7 @@ const overflowMode = defineAction({
|
|
|
69917
69970
|
displayFieldComponent,
|
|
69918
69971
|
fieldComponent,
|
|
69919
69972
|
fieldLinkageRules,
|
|
69973
|
+
fixed,
|
|
69920
69974
|
layout,
|
|
69921
69975
|
linkageAssignField,
|
|
69922
69976
|
linkageRunjs,
|
|
@@ -70172,7 +70226,7 @@ RecordSelectFieldModel.registerFlow({
|
|
|
70172
70226
|
allowMultiple: {
|
|
70173
70227
|
title: escapeT("Allow multiple"),
|
|
70174
70228
|
uiSchema(e) {
|
|
70175
|
-
return ["belongsToMany", "hasMany", "belongsToArray"].includes(e.
|
|
70229
|
+
return e.collectionField && ["belongsToMany", "hasMany", "belongsToArray"].includes(e.collectionField.type) ? {
|
|
70176
70230
|
allowMultiple: {
|
|
70177
70231
|
"x-component": "Switch",
|
|
70178
70232
|
type: "boolean",
|
|
@@ -70182,9 +70236,7 @@ RecordSelectFieldModel.registerFlow({
|
|
|
70182
70236
|
},
|
|
70183
70237
|
defaultParams(e) {
|
|
70184
70238
|
return {
|
|
70185
|
-
allowMultiple: ["belongsToMany", "hasMany", "belongsToArray"].includes(
|
|
70186
|
-
e.model.context.collectionField.type
|
|
70187
|
-
)
|
|
70239
|
+
allowMultiple: e.collectionField && ["belongsToMany", "hasMany", "belongsToArray"].includes(e.model.context.collectionField.type)
|
|
70188
70240
|
};
|
|
70189
70241
|
},
|
|
70190
70242
|
handler(e, t) {
|
|
@@ -72953,11 +73005,15 @@ FormItemModel.registerFlow({
|
|
|
72953
73005
|
}
|
|
72954
73006
|
}
|
|
72955
73007
|
}),
|
|
72956
|
-
defaultParams: (e) =>
|
|
72957
|
-
|
|
72958
|
-
|
|
73008
|
+
defaultParams: (e) => {
|
|
73009
|
+
var t;
|
|
73010
|
+
return {
|
|
73011
|
+
label: (t = e.collectionField) == null ? void 0 : t.title
|
|
73012
|
+
};
|
|
73013
|
+
},
|
|
72959
73014
|
handler(e, t) {
|
|
72960
|
-
|
|
73015
|
+
var o;
|
|
73016
|
+
e.model.setProps({ label: t.label || ((o = e.collectionField) == null ? void 0 : o.title) });
|
|
72961
73017
|
}
|
|
72962
73018
|
},
|
|
72963
73019
|
aclCheck: {
|
|
@@ -73071,12 +73127,12 @@ FormItemModel.registerFlow({
|
|
|
73071
73127
|
fieldNames: {
|
|
73072
73128
|
use: "titleField",
|
|
73073
73129
|
uiSchema: (e) => E(void 0, null, function* () {
|
|
73074
|
-
return e.collectionField.isAssociationField() && e.model.getProps().titleField ? {
|
|
73130
|
+
return e.collectionField ? e.collectionField.isAssociationField() && e.model.getProps().titleField ? {
|
|
73075
73131
|
label: {
|
|
73076
73132
|
"x-component": SelectOptions$1,
|
|
73077
73133
|
"x-decorator": "FormItem"
|
|
73078
73134
|
}
|
|
73079
|
-
} : null;
|
|
73135
|
+
} : null : void 0;
|
|
73080
73136
|
}),
|
|
73081
73137
|
beforeParamsSave: (e, t, o) => E(void 0, null, function* () {
|
|
73082
73138
|
if (!(e.collectionField.isAssociationField() && e.model.props.titleField))
|
|
@@ -75723,6 +75779,10 @@ TableCustomColumnModel.registerFlow({
|
|
|
75723
75779
|
handler(e, t) {
|
|
75724
75780
|
e.model.setProps("width", t.width);
|
|
75725
75781
|
}
|
|
75782
|
+
},
|
|
75783
|
+
fixed: {
|
|
75784
|
+
title: escapeT("Fixed"),
|
|
75785
|
+
use: "fixed"
|
|
75726
75786
|
}
|
|
75727
75787
|
}
|
|
75728
75788
|
});
|
|
@@ -75855,6 +75915,12 @@ function extractIndex(e) {
|
|
|
75855
75915
|
isNaN(o) || t.push(String(Number(o) + 1));
|
|
75856
75916
|
}), t.join(".");
|
|
75857
75917
|
}
|
|
75918
|
+
function adjustColumnOrder(e) {
|
|
75919
|
+
const t = [], o = [], n = [];
|
|
75920
|
+
return e.forEach((r) => {
|
|
75921
|
+
r.fixed === "left" ? t.push(r) : r.fixed === "right" ? n.push(r) : o.push(r);
|
|
75922
|
+
}), [...t, ...o, ...n];
|
|
75923
|
+
}
|
|
75858
75924
|
const TableIndex = (e) => {
|
|
75859
75925
|
const n = e, { index: t } = n, o = W(n, ["index"]);
|
|
75860
75926
|
return /* @__PURE__ */ jsx("div", I(f({ className: classNames("nb-table-index"), style: { padding: "0 8px 0 16px" } }, o), { children: t }));
|
|
@@ -76056,7 +76122,7 @@ class TableBlockModel extends CollectionBlockModel {
|
|
|
76056
76122
|
fixed: "right",
|
|
76057
76123
|
width: 100,
|
|
76058
76124
|
title: /* @__PURE__ */ jsx(AddFieldColumn$2, { model: this })
|
|
76059
|
-
}), n;
|
|
76125
|
+
}), adjustColumnOrder(n);
|
|
76060
76126
|
}
|
|
76061
76127
|
renderConfiguireActions() {
|
|
76062
76128
|
return /* @__PURE__ */ jsx(
|
|
@@ -76317,9 +76383,20 @@ TableBlockModel.define({
|
|
|
76317
76383
|
},
|
|
76318
76384
|
sort: 300
|
|
76319
76385
|
});
|
|
76386
|
+
function FieldDeletePlaceholder() {
|
|
76387
|
+
const { t: e } = useTranslation(), t = useFlowModel(), o = t.context.blockModel, n = o.collection.dataSource, r = o.collection, i = t.fieldPath, a = useMemo(() => {
|
|
76388
|
+
const c = `${e(n.displayName || n.key)} > `, u = r ? `${e(r.title) || r.name || r.tableName} > ` : "";
|
|
76389
|
+
return `${c}${u}${i}`;
|
|
76390
|
+
}, []), l = e('The {{type}} "{{name}}" may have been deleted. Please remove this {{blockType}}.', {
|
|
76391
|
+
type: e("Field"),
|
|
76392
|
+
name: a,
|
|
76393
|
+
blockType: e("Field")
|
|
76394
|
+
}).replaceAll(">", ">");
|
|
76395
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: l, children: /* @__PURE__ */ jsx(ExclamationCircleOutlined, { style: { opacity: "0.45" } }) });
|
|
76396
|
+
}
|
|
76320
76397
|
const Re = class Re extends DisplayItemModel {
|
|
76321
76398
|
renderHiddenInConfig() {
|
|
76322
|
-
return /* @__PURE__ */ jsx(Tooltip, { title: this.context.t("该字段已被隐藏,你无法查看(该内容仅在激活 UI Editor 时显示)。"), children: /* @__PURE__ */ jsx(LockOutlined, { style: { opacity: "0.45" } }) });
|
|
76399
|
+
return this.fieldDeleted ? /* @__PURE__ */ jsx(FieldDeletePlaceholder, {}) : /* @__PURE__ */ jsx(Tooltip, { title: this.context.t("该字段已被隐藏,你无法查看(该内容仅在激活 UI Editor 时显示)。"), children: /* @__PURE__ */ jsx(LockOutlined, { style: { opacity: "0.45" } }) });
|
|
76323
76400
|
}
|
|
76324
76401
|
afterAddAsSubModel() {
|
|
76325
76402
|
return E(this, null, function* () {
|
|
@@ -76528,6 +76605,8 @@ TableColumnModel.registerFlow({
|
|
|
76528
76605
|
quickEdit: {
|
|
76529
76606
|
title: escapeT("Enable quick edit"),
|
|
76530
76607
|
uiSchema: (e) => {
|
|
76608
|
+
if (!e.model.collectionField)
|
|
76609
|
+
return;
|
|
76531
76610
|
const t = e.model.context.blockModel.collection.name, o = e.model.collectionField.collectionName;
|
|
76532
76611
|
if (t === o)
|
|
76533
76612
|
return {
|
|
@@ -76590,6 +76669,10 @@ TableColumnModel.registerFlow({
|
|
|
76590
76669
|
titleField: t.label
|
|
76591
76670
|
}, (n = (o = e.collectionField.targetCollection) == null ? void 0 : o.getField(t.label)) == null ? void 0 : n.getComponentProps()));
|
|
76592
76671
|
}
|
|
76672
|
+
},
|
|
76673
|
+
fixed: {
|
|
76674
|
+
title: escapeT("Fixed"),
|
|
76675
|
+
use: "fixed"
|
|
76593
76676
|
}
|
|
76594
76677
|
}
|
|
76595
76678
|
});
|
|
@@ -77164,6 +77247,10 @@ SubTableColumnModel.registerFlow({
|
|
|
77164
77247
|
pattern: {
|
|
77165
77248
|
title: escapeT("Display mode"),
|
|
77166
77249
|
use: "pattern"
|
|
77250
|
+
},
|
|
77251
|
+
fixed: {
|
|
77252
|
+
title: escapeT("Fixed"),
|
|
77253
|
+
use: "fixed"
|
|
77167
77254
|
}
|
|
77168
77255
|
}
|
|
77169
77256
|
});
|
|
@@ -77289,24 +77376,26 @@ class SubTableFieldModel extends AssociationFieldModel {
|
|
|
77289
77376
|
const { enableIndexColumn: o } = this.props, n = !!((a = (i = this.flowEngine) == null ? void 0 : i.flowSettings) != null && a.enabled), r = this.mapSubModels("columns", (l) => l.getColumnProps()).filter(
|
|
77290
77377
|
Boolean
|
|
77291
77378
|
);
|
|
77292
|
-
return
|
|
77293
|
-
|
|
77294
|
-
|
|
77295
|
-
|
|
77296
|
-
|
|
77297
|
-
|
|
77298
|
-
|
|
77299
|
-
|
|
77300
|
-
|
|
77301
|
-
|
|
77302
|
-
|
|
77303
|
-
|
|
77304
|
-
|
|
77305
|
-
|
|
77306
|
-
|
|
77307
|
-
|
|
77308
|
-
|
|
77309
|
-
|
|
77379
|
+
return adjustColumnOrder(
|
|
77380
|
+
[
|
|
77381
|
+
o && {
|
|
77382
|
+
key: "__index__",
|
|
77383
|
+
width: 48,
|
|
77384
|
+
align: "center",
|
|
77385
|
+
fixed: "left",
|
|
77386
|
+
render: (l) => l.rowIdx + 1
|
|
77387
|
+
},
|
|
77388
|
+
...r.concat({
|
|
77389
|
+
key: "_empty"
|
|
77390
|
+
}),
|
|
77391
|
+
n && {
|
|
77392
|
+
key: "addColumn",
|
|
77393
|
+
fixed: "right",
|
|
77394
|
+
width: 100,
|
|
77395
|
+
title: /* @__PURE__ */ jsx(AddFieldColumn$1, { model: this })
|
|
77396
|
+
}
|
|
77397
|
+
].filter(Boolean)
|
|
77398
|
+
);
|
|
77310
77399
|
}
|
|
77311
77400
|
render() {
|
|
77312
77401
|
const o = this.getColumns(), n = {
|
|
@@ -78264,7 +78353,7 @@ FilterActionModel.registerFlow({
|
|
|
78264
78353
|
FilterGroup,
|
|
78265
78354
|
{
|
|
78266
78355
|
value: e.value || {},
|
|
78267
|
-
FilterItem: (o) => /* @__PURE__ */ jsx(
|
|
78356
|
+
FilterItem: (o) => /* @__PURE__ */ jsx(VariableFilterItem, I(f({}, o), { model: t }))
|
|
78268
78357
|
}
|
|
78269
78358
|
);
|
|
78270
78359
|
}
|
|
@@ -80688,15 +80777,18 @@ ClickableFieldModel.registerFlow({
|
|
|
80688
80777
|
steps: {
|
|
80689
80778
|
displayStyle: {
|
|
80690
80779
|
title: escapeT("Display style"),
|
|
80691
|
-
uiSchema: (e) =>
|
|
80692
|
-
|
|
80693
|
-
|
|
80694
|
-
|
|
80695
|
-
|
|
80696
|
-
|
|
80697
|
-
|
|
80698
|
-
|
|
80699
|
-
|
|
80780
|
+
uiSchema: (e) => {
|
|
80781
|
+
var t;
|
|
80782
|
+
return ["select", "multipleSelect", "radioGroup", "checkboxGroup"].includes((t = e.collectionField) == null ? void 0 : t.interface) ? null : {
|
|
80783
|
+
displayStyle: {
|
|
80784
|
+
"x-component": "Radio.Group",
|
|
80785
|
+
"x-decorator": "FormItem",
|
|
80786
|
+
enum: [
|
|
80787
|
+
{ label: escapeT("Tag"), value: "tag" },
|
|
80788
|
+
{ label: escapeT("Text"), value: "text" }
|
|
80789
|
+
]
|
|
80790
|
+
}
|
|
80791
|
+
};
|
|
80700
80792
|
},
|
|
80701
80793
|
defaultParams: {
|
|
80702
80794
|
displayStyle: "text"
|
|
@@ -80811,24 +80903,26 @@ class DisplaySubTableFieldModel extends FieldModel {
|
|
|
80811
80903
|
}
|
|
80812
80904
|
getColumns() {
|
|
80813
80905
|
const { enableIndexColumn: t = !0 } = this.props, o = this.mapSubModels("columns", (n) => n.getColumnProps()).filter((n) => !n.hidden);
|
|
80814
|
-
return
|
|
80815
|
-
|
|
80816
|
-
|
|
80817
|
-
|
|
80818
|
-
|
|
80819
|
-
|
|
80820
|
-
|
|
80821
|
-
|
|
80822
|
-
|
|
80823
|
-
|
|
80824
|
-
|
|
80825
|
-
|
|
80826
|
-
|
|
80827
|
-
|
|
80828
|
-
|
|
80829
|
-
|
|
80830
|
-
|
|
80831
|
-
|
|
80906
|
+
return adjustColumnOrder(
|
|
80907
|
+
[
|
|
80908
|
+
t && {
|
|
80909
|
+
key: "__index__",
|
|
80910
|
+
width: 48,
|
|
80911
|
+
align: "center",
|
|
80912
|
+
fixed: "left",
|
|
80913
|
+
render: (n, r, i) => i + 1
|
|
80914
|
+
},
|
|
80915
|
+
...o.concat({
|
|
80916
|
+
key: "empty"
|
|
80917
|
+
}),
|
|
80918
|
+
{
|
|
80919
|
+
key: "addColumn",
|
|
80920
|
+
fixed: "right",
|
|
80921
|
+
width: 100,
|
|
80922
|
+
title: /* @__PURE__ */ jsx(AddFieldColumn, { model: this })
|
|
80923
|
+
}
|
|
80924
|
+
].filter(Boolean)
|
|
80925
|
+
);
|
|
80832
80926
|
}
|
|
80833
80927
|
render() {
|
|
80834
80928
|
return /* @__PURE__ */ jsx(
|