@nocobase/client 2.0.11 → 2.0.13
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/afterSuccess.d.ts +9 -0
- package/es/flow/actions/index.d.ts +1 -0
- package/es/flow/models/actions/AddChildActionModel.d.ts +1 -0
- package/es/flow/models/actions/BulkDeleteActionModel.d.ts +1 -0
- package/es/flow/models/base/ActionGroupModel.d.ts +8 -0
- package/es/flow/models/base/CollectionBlockModel.d.ts +7 -0
- package/es/flow/models/base/PageModel/RootPageModel.d.ts +8 -0
- package/es/flow/models/blocks/filter-form/FilterFormGridModel.d.ts +1 -0
- package/es/flow/models/blocks/form/CreateFormModel.d.ts +1 -0
- package/es/flow/models/blocks/form/EditFormModel.d.ts +1 -0
- package/es/flow/utils/actionCapability.d.ts +60 -0
- package/es/index.mjs +375 -147
- package/es/schema-settings/VariableInput/hooks/useParentIterationVariable.d.ts +3 -3
- package/lib/index.js +21 -25
- package/lib/locale/de-DE.json +1 -0
- package/lib/locale/en-US.json +1 -0
- package/lib/locale/es-ES.json +1 -0
- package/lib/locale/fr-FR.json +1 -0
- package/lib/locale/hu-HU.json +1 -0
- package/lib/locale/id-ID.json +1 -0
- package/lib/locale/it-IT.json +1 -0
- package/lib/locale/ja-JP.json +1 -0
- package/lib/locale/ko-KR.json +1 -0
- package/lib/locale/nl-NL.json +1 -0
- package/lib/locale/pt-BR.json +1 -0
- package/lib/locale/ru-RU.json +1 -0
- package/lib/locale/tr-TR.json +1 -0
- package/lib/locale/uk-UA.json +1 -0
- package/lib/locale/vi-VN.json +1 -0
- package/lib/locale/zh-CN.json +1 -0
- package/lib/locale/zh-TW.json +1 -0
- package/package.json +6 -6
package/es/index.mjs
CHANGED
|
@@ -3459,6 +3459,9 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3459
3459
|
get actionSettingsItems() {
|
|
3460
3460
|
return actionSettingsItems;
|
|
3461
3461
|
},
|
|
3462
|
+
get afterSuccess() {
|
|
3463
|
+
return afterSuccess;
|
|
3464
|
+
},
|
|
3462
3465
|
get allowAddNew() {
|
|
3463
3466
|
return allowAddNew;
|
|
3464
3467
|
},
|
|
@@ -9949,7 +9952,7 @@ function addAppVersion(e, t) {
|
|
|
9949
9952
|
addAppVersion((n = e.properties) == null ? void 0 : n[o], t);
|
|
9950
9953
|
}), e;
|
|
9951
9954
|
}
|
|
9952
|
-
const name = "@nocobase/client", version = "2.0.
|
|
9955
|
+
const name = "@nocobase/client", version = "2.0.13", license = "Apache-2.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
|
|
9953
9956
|
"@ahooksjs/use-url-state": "3.5.1",
|
|
9954
9957
|
"@ant-design/cssinjs": "^1.11.1",
|
|
9955
9958
|
"@ant-design/icons": "^5.6.1",
|
|
@@ -9972,10 +9975,10 @@ const name = "@nocobase/client", version = "2.0.11", license = "Apache-2.0", mai
|
|
|
9972
9975
|
"@formily/reactive-react": "^2.2.27",
|
|
9973
9976
|
"@formily/shared": "^2.2.27",
|
|
9974
9977
|
"@formily/validator": "^2.2.27",
|
|
9975
|
-
"@nocobase/evaluators": "2.0.
|
|
9976
|
-
"@nocobase/flow-engine": "2.0.
|
|
9977
|
-
"@nocobase/sdk": "2.0.
|
|
9978
|
-
"@nocobase/utils": "2.0.
|
|
9978
|
+
"@nocobase/evaluators": "2.0.13",
|
|
9979
|
+
"@nocobase/flow-engine": "2.0.13",
|
|
9980
|
+
"@nocobase/sdk": "2.0.13",
|
|
9981
|
+
"@nocobase/utils": "2.0.13",
|
|
9979
9982
|
"@tanstack/react-table": "^8.21.3",
|
|
9980
9983
|
"@types/tabulator-tables": "^6.2.6",
|
|
9981
9984
|
"acorn-jsx": "^5.3.2",
|
|
@@ -12612,22 +12615,22 @@ function FormDialog(e, t, o, n) {
|
|
|
12612
12615
|
), u = (p = !0, m, h) => {
|
|
12613
12616
|
const { form: g } = r;
|
|
12614
12617
|
return g ? /* @__PURE__ */ jsx(GlobalThemeProvider, { theme: n, children: /* @__PURE__ */ jsx(Observer, { children: () => {
|
|
12615
|
-
|
|
12618
|
+
var P;
|
|
12619
|
+
const { token: f } = useToken$1(), y = useMemo(() => document.body, []), b = Number(l == null ? void 0 : l.zIndex), S = f.zIndexPopupBase + 1e3, C = Number.isFinite(b) && b > 0 ? Math.max(S, b) : S;
|
|
12616
12620
|
return /* @__PURE__ */ jsx(
|
|
12617
12621
|
Modal,
|
|
12618
|
-
A(x({
|
|
12619
|
-
zIndex:
|
|
12620
|
-
getContainer: y
|
|
12621
|
-
}, l), {
|
|
12622
|
+
A(x({}, l), {
|
|
12623
|
+
zIndex: C,
|
|
12624
|
+
getContainer: (P = l == null ? void 0 : l.getContainer) != null ? P : y,
|
|
12622
12625
|
open: p,
|
|
12623
12626
|
confirmLoading: g.submitting,
|
|
12624
|
-
onCancel: (
|
|
12625
|
-
var
|
|
12626
|
-
((
|
|
12627
|
+
onCancel: (F) => {
|
|
12628
|
+
var v;
|
|
12629
|
+
((v = l == null ? void 0 : l.onCancel) == null ? void 0 : v.call(l, F)) !== !1 && (h == null || h());
|
|
12627
12630
|
},
|
|
12628
|
-
onOk: (
|
|
12629
|
-
var
|
|
12630
|
-
((
|
|
12631
|
+
onOk: (F) => L(this, null, function* () {
|
|
12632
|
+
var v;
|
|
12633
|
+
((v = l == null ? void 0 : l.onOk) == null ? void 0 : v.call(l, F)) !== !1 && (m == null || m());
|
|
12631
12634
|
}),
|
|
12632
12635
|
children: /* @__PURE__ */ jsx(FormProvider$1, { form: g, children: /* @__PURE__ */ jsx(c, {}) })
|
|
12633
12636
|
})
|
|
@@ -14974,15 +14977,31 @@ const useDateVariable = ({ operator: e, schema: t, noDisabled: o }) => {
|
|
|
14974
14977
|
/** 变量的配置项 */
|
|
14975
14978
|
currentObjectSettings: u
|
|
14976
14979
|
};
|
|
14980
|
+
}, ParentCollectionContext = createContext(null);
|
|
14981
|
+
ParentCollectionContext.displayName = "ParentCollectionContext";
|
|
14982
|
+
const ParentCollectionProvider = (e) => {
|
|
14983
|
+
const t = useCollection();
|
|
14984
|
+
return /* @__PURE__ */ jsx(ParentCollectionContext.Provider, { value: t, children: e.children });
|
|
14985
|
+
}, useParentCollection = () => useContext(ParentCollectionContext), AssociationProvider = (e) => {
|
|
14986
|
+
const { name: t, children: o } = e, r = useCollectionManager().getCollectionName(t);
|
|
14987
|
+
return r ? /* @__PURE__ */ jsx(CollectionProvider, { name: String(t).split(".")[0], children: /* @__PURE__ */ jsx(ParentCollectionProvider, { children: /* @__PURE__ */ jsx(CollectionFieldProvider, { name: t, children: /* @__PURE__ */ jsx(CollectionProvider, { name: r, children: o }) }) }) }) : /* @__PURE__ */ jsx(CollectionDeletedPlaceholder, { type: "Collection", name: t });
|
|
14988
|
+
}, useAssociationName = () => {
|
|
14989
|
+
const e = useCollectionField();
|
|
14990
|
+
return e != null && e.target ? `${e.collectionName}.${e.name}` : null;
|
|
14991
|
+
}, getResolvedParent = (e, t) => {
|
|
14992
|
+
let o = e;
|
|
14993
|
+
for (; o != null && o.parent && o.value === t; )
|
|
14994
|
+
o = o.parent;
|
|
14995
|
+
return o;
|
|
14977
14996
|
}, useParentObjectContext = () => {
|
|
14978
|
-
const { parent: e } = useSubFormValue(),
|
|
14997
|
+
const { parent: e, formValue: t } = useSubFormValue(), o = useCollectionParentRecordData(), n = useParentCollection(), r = getResolvedParent(e, t), i = r == null ? void 0 : r.value, a = _.isEmpty(i) && !_.isEmpty(o) ? o : i, l = (r == null ? void 0 : r.collection) || n, { isInSubForm: c, isInSubTable: u } = useFlag() || {};
|
|
14979
14998
|
return {
|
|
14980
14999
|
/** 是否显示变量 */
|
|
14981
|
-
shouldDisplayParentObject: (
|
|
15000
|
+
shouldDisplayParentObject: (c || u) && !!l,
|
|
14982
15001
|
/** 变量的值 */
|
|
14983
|
-
parentObjectCtx:
|
|
14984
|
-
collectionName:
|
|
14985
|
-
dataSource:
|
|
15002
|
+
parentObjectCtx: a,
|
|
15003
|
+
collectionName: l == null ? void 0 : l.name,
|
|
15004
|
+
dataSource: l == null ? void 0 : l.dataSource
|
|
14986
15005
|
};
|
|
14987
15006
|
}, useParentObjectVariable = ({
|
|
14988
15007
|
collectionField: e,
|
|
@@ -15045,17 +15064,6 @@ const useDateVariable = ({ operator: e, schema: t, noDisabled: o }) => {
|
|
|
15045
15064
|
dataSource: r,
|
|
15046
15065
|
defaultValue: i
|
|
15047
15066
|
};
|
|
15048
|
-
}, ParentCollectionContext = createContext(null);
|
|
15049
|
-
ParentCollectionContext.displayName = "ParentCollectionContext";
|
|
15050
|
-
const ParentCollectionProvider = (e) => {
|
|
15051
|
-
const t = useCollection();
|
|
15052
|
-
return /* @__PURE__ */ jsx(ParentCollectionContext.Provider, { value: t, children: e.children });
|
|
15053
|
-
}, useParentCollection = () => useContext(ParentCollectionContext), AssociationProvider = (e) => {
|
|
15054
|
-
const { name: t, children: o } = e, r = useCollectionManager().getCollectionName(t);
|
|
15055
|
-
return r ? /* @__PURE__ */ jsx(CollectionProvider, { name: String(t).split(".")[0], children: /* @__PURE__ */ jsx(ParentCollectionProvider, { children: /* @__PURE__ */ jsx(CollectionFieldProvider, { name: t, children: /* @__PURE__ */ jsx(CollectionProvider, { name: r, children: o }) }) }) }) : /* @__PURE__ */ jsx(CollectionDeletedPlaceholder, { type: "Collection", name: t });
|
|
15056
|
-
}, useAssociationName = () => {
|
|
15057
|
-
const e = useCollectionField();
|
|
15058
|
-
return e != null && e.target ? `${e.collectionName}.${e.name}` : null;
|
|
15059
15067
|
}, useCurrentParentRecordContext = () => {
|
|
15060
15068
|
var c, u;
|
|
15061
15069
|
const e = useCollectionRecord(), { name: t, dataSource: o } = useParentCollection() || {}, n = useCollection(), { isInSubForm: r, isInSubTable: i } = useFlag() || {}, a = t ? o : n == null ? void 0 : n.dataSource, l = useCollectionField();
|
|
@@ -23234,7 +23242,7 @@ const SchemaSettingsSwitchItem = (e) => {
|
|
|
23234
23242
|
"modalTip",
|
|
23235
23243
|
"components",
|
|
23236
23244
|
"scope"
|
|
23237
|
-
]), [m, h] = useState(!1), [g, f] = useState(e.uid), { t: y } = useTranslation(), b = useFieldSchema(), S = useContext(SchemaSettingsContext), { dn: C } = useSchemaSettings(), P = useCompile(), F = useAPIClient(), v = useFormActiveFields(), k = useZIndexContext(), I = getZIndex("modal", k + 10, 0), D = useMemo(
|
|
23245
|
+
]), [m, h] = useState(!1), [g, f] = useState(e.uid), { t: y } = useTranslation(), b = useFieldSchema(), S = useContext(SchemaSettingsContext), { dn: C } = useSchemaSettings(), P = useCompile(), F = useAPIClient(), v = useFormActiveFields(), k = useZIndexContext(), I = Math.max(getZIndex("modal", k + 10, 0), ICON_POPUP_Z_INDEX + 200), D = useMemo(
|
|
23238
23246
|
() => createForm({
|
|
23239
23247
|
initialValues: cloneDeep$1(r),
|
|
23240
23248
|
values: cloneDeep$1(r)
|
|
@@ -23332,7 +23340,12 @@ const SchemaSettingsModalItem = (e) => {
|
|
|
23332
23340
|
onClick: () => L(void 0, null, function* () {
|
|
23333
23341
|
const H = l ? yield l() : c, X = _.isFunction(e.schema) ? e.schema() : e.schema;
|
|
23334
23342
|
FormDialog(
|
|
23335
|
-
{
|
|
23343
|
+
{
|
|
23344
|
+
title: X.title || o,
|
|
23345
|
+
width: u,
|
|
23346
|
+
rootClassName: m,
|
|
23347
|
+
getContainer: () => document.body
|
|
23348
|
+
},
|
|
23336
23349
|
() => /* @__PURE__ */ jsx(VariableScopeContext$1.Provider, { value: O, children: /* @__PURE__ */ jsx(SchemaComponentContext.Provider, { value: j, children: /* @__PURE__ */ jsx(AllDataBlocksContext.Provider, { value: N, children: /* @__PURE__ */ jsx(p, { children: /* @__PURE__ */ jsx(CollectOperators, { defaultOperators: T(), children: /* @__PURE__ */ jsx(VariablesContext.Provider, { value: B, children: /* @__PURE__ */ jsx(BlockContext.Provider, { value: M, children: /* @__PURE__ */ jsx(
|
|
23337
23350
|
VariablePopupRecordProvider,
|
|
23338
23351
|
{
|
|
@@ -30524,7 +30537,7 @@ const useStyles$a = genStyleHook("nb-markdown", (e, { isDarkTheme: t }) => {
|
|
|
30524
30537
|
}, t ? i : r)
|
|
30525
30538
|
};
|
|
30526
30539
|
}), parseMarkdown$1 = _.memoize((e) => L(void 0, null, function* () {
|
|
30527
|
-
return e && (yield import("./md-
|
|
30540
|
+
return e && (yield import("./md-BbvRKckr.mjs")).default.render(e);
|
|
30528
30541
|
}));
|
|
30529
30542
|
function useParseMarkdown$1(e) {
|
|
30530
30543
|
const [t, o] = useState(""), [n, r] = useState(!0);
|
|
@@ -66408,7 +66421,98 @@ const BlockConfigsContext = createContext({
|
|
|
66408
66421
|
}
|
|
66409
66422
|
)
|
|
66410
66423
|
] });
|
|
66411
|
-
},
|
|
66424
|
+
}, afterSuccess = defineAction({
|
|
66425
|
+
name: "afterSuccess",
|
|
66426
|
+
title: tExpr("After successful submission"),
|
|
66427
|
+
uiSchema: {
|
|
66428
|
+
successMessage: {
|
|
66429
|
+
type: "string",
|
|
66430
|
+
title: tExpr("Popup message"),
|
|
66431
|
+
"x-decorator": "FormItem",
|
|
66432
|
+
"x-component": "Input.TextArea"
|
|
66433
|
+
},
|
|
66434
|
+
manualClose: {
|
|
66435
|
+
type: "boolean",
|
|
66436
|
+
title: tExpr("Message popup close method"),
|
|
66437
|
+
"x-decorator": "FormItem",
|
|
66438
|
+
"x-component": "Radio.Group",
|
|
66439
|
+
enum: [
|
|
66440
|
+
{ label: tExpr("Automatic close"), value: !1 },
|
|
66441
|
+
{ label: tExpr("Manually close"), value: !0 }
|
|
66442
|
+
]
|
|
66443
|
+
},
|
|
66444
|
+
actionAfterSuccess: {
|
|
66445
|
+
type: "string",
|
|
66446
|
+
title: tExpr("Action after successful submission"),
|
|
66447
|
+
"x-decorator": "FormItem",
|
|
66448
|
+
"x-component": "Radio.Group",
|
|
66449
|
+
enum: [
|
|
66450
|
+
{ label: tExpr("Stay on the current popup or page"), value: "stay" },
|
|
66451
|
+
{ label: tExpr("Return to the previous popup or page"), value: "previous" },
|
|
66452
|
+
{ label: tExpr("Close popup and redirect to"), value: "redirect" }
|
|
66453
|
+
]
|
|
66454
|
+
},
|
|
66455
|
+
redirectTo: {
|
|
66456
|
+
type: "string",
|
|
66457
|
+
title: tExpr("Link"),
|
|
66458
|
+
"x-decorator": "FormItem",
|
|
66459
|
+
"x-component": TextAreaWithContextSelector,
|
|
66460
|
+
"x-reactions": {
|
|
66461
|
+
dependencies: ["actionAfterSuccess"],
|
|
66462
|
+
fulfill: {
|
|
66463
|
+
state: {
|
|
66464
|
+
visible: "{{$deps[0]==='redirect'}}"
|
|
66465
|
+
}
|
|
66466
|
+
}
|
|
66467
|
+
}
|
|
66468
|
+
}
|
|
66469
|
+
},
|
|
66470
|
+
defaultParams: {
|
|
66471
|
+
successMessage: tExpr("Saved successfully"),
|
|
66472
|
+
manualClose: !1,
|
|
66473
|
+
actionAfterSuccess: "previous"
|
|
66474
|
+
},
|
|
66475
|
+
handler(e, t) {
|
|
66476
|
+
return L(this, null, function* () {
|
|
66477
|
+
const { successMessage: o, manualClose: n = !1, actionAfterSuccess: r = "previous", redirectTo: i } = t;
|
|
66478
|
+
r === "previous" && e.view && e.view.close();
|
|
66479
|
+
const a = (c) => {
|
|
66480
|
+
if (e.engine) {
|
|
66481
|
+
let u = e.engine;
|
|
66482
|
+
for (; u.nextEngine; )
|
|
66483
|
+
u = u.nextEngine;
|
|
66484
|
+
const d = [];
|
|
66485
|
+
let p = u;
|
|
66486
|
+
for (; p; )
|
|
66487
|
+
d.push(p), p = p.previousEngine;
|
|
66488
|
+
for (const m of d)
|
|
66489
|
+
m.destroyView();
|
|
66490
|
+
}
|
|
66491
|
+
e.router.navigate(c);
|
|
66492
|
+
}, l = (c) => {
|
|
66493
|
+
if (isURL(c)) {
|
|
66494
|
+
window.location.href = c;
|
|
66495
|
+
return;
|
|
66496
|
+
}
|
|
66497
|
+
a(c);
|
|
66498
|
+
};
|
|
66499
|
+
if (o) {
|
|
66500
|
+
const c = e.t(o);
|
|
66501
|
+
if (n) {
|
|
66502
|
+
yield e.modal.success({
|
|
66503
|
+
title: c,
|
|
66504
|
+
onOk: () => L(this, null, function* () {
|
|
66505
|
+
r === "redirect" && i && l(i);
|
|
66506
|
+
})
|
|
66507
|
+
});
|
|
66508
|
+
return;
|
|
66509
|
+
} else
|
|
66510
|
+
e.message.success(c);
|
|
66511
|
+
}
|
|
66512
|
+
r === "redirect" && i && l(i);
|
|
66513
|
+
});
|
|
66514
|
+
}
|
|
66515
|
+
}), confirm$1 = defineAction({
|
|
66412
66516
|
name: "confirm",
|
|
66413
66517
|
title: tExpr("Confirmation"),
|
|
66414
66518
|
uiSchema: {
|
|
@@ -70601,6 +70705,39 @@ ActionModel.registerEvents({
|
|
|
70601
70705
|
handler: commonConditionHandler
|
|
70602
70706
|
}
|
|
70603
70707
|
});
|
|
70708
|
+
const VIEW_ACTION_ALIASES = {
|
|
70709
|
+
view: "get"
|
|
70710
|
+
}, normalizeCapabilityActionName = (e) => e ? VIEW_ACTION_ALIASES[e] || e : null, getExplicitCapabilityNames = (e, t) => {
|
|
70711
|
+
for (const o of t) {
|
|
70712
|
+
if (!(o in e))
|
|
70713
|
+
continue;
|
|
70714
|
+
const n = e[o];
|
|
70715
|
+
return n == null ? null : (Array.isArray(n) ? n : [n]).map((r) => normalizeCapabilityActionName(r)).filter(Boolean);
|
|
70716
|
+
}
|
|
70717
|
+
}, isCapabilitySupported = (e, t) => {
|
|
70718
|
+
const o = normalizeCapabilityActionName(t);
|
|
70719
|
+
if (!o || !(e != null && e.options))
|
|
70720
|
+
return !0;
|
|
70721
|
+
const { availableActions: n, unavailableActions: r } = e.options;
|
|
70722
|
+
return Array.isArray(n) ? n.includes(o) : Array.isArray(r) ? !r.includes(o) : !0;
|
|
70723
|
+
}, areCapabilitiesSupported = (e, t) => t != null && t.length ? t.every((o) => isCapabilitySupported(e, o)) : !0, getActionCapabilityNamesFromModelClass = (e) => {
|
|
70724
|
+
var n;
|
|
70725
|
+
const t = getExplicitCapabilityNames(e, ["capabilityActionNames", "capabilityActionName"]);
|
|
70726
|
+
if (t !== void 0)
|
|
70727
|
+
return t;
|
|
70728
|
+
const o = (n = e == null ? void 0 : e.prototype) == null ? void 0 : n.getAclActionName;
|
|
70729
|
+
if (typeof o != "function")
|
|
70730
|
+
return null;
|
|
70731
|
+
try {
|
|
70732
|
+
const r = o.call({}), i = normalizeCapabilityActionName(r);
|
|
70733
|
+
return i ? [i] : null;
|
|
70734
|
+
} catch (r) {
|
|
70735
|
+
return null;
|
|
70736
|
+
}
|
|
70737
|
+
}, getBlockCapabilityNamesFromModelClass = (e) => {
|
|
70738
|
+
const t = getExplicitCapabilityNames(e, ["blockCapabilityActionNames", "blockCapabilityActionName"]);
|
|
70739
|
+
return t != null ? t : null;
|
|
70740
|
+
};
|
|
70604
70741
|
class ActionGroupModel extends FlowModel {
|
|
70605
70742
|
static getAllParentClasses() {
|
|
70606
70743
|
const t = [];
|
|
@@ -70625,11 +70762,26 @@ class ActionGroupModel extends FlowModel {
|
|
|
70625
70762
|
for (const [o, n] of Object.entries(t))
|
|
70626
70763
|
Object.defineProperty(n, "name", { value: o }), this.currentModels.set(o, n);
|
|
70627
70764
|
}
|
|
70765
|
+
/**
|
|
70766
|
+
* 判断动作模型在当前数据表上下文下是否应显示在 v2 的“添加动作”菜单中。
|
|
70767
|
+
*
|
|
70768
|
+
* @param ModelClass 动作模型类
|
|
70769
|
+
* @param ctx Flow 上下文
|
|
70770
|
+
* @returns 是否显示
|
|
70771
|
+
*/
|
|
70772
|
+
static isActionModelVisible(t, o) {
|
|
70773
|
+
var i;
|
|
70774
|
+
const n = o.collection || ((i = o.blockModel) == null ? void 0 : i.collection), r = getActionCapabilityNamesFromModelClass(t);
|
|
70775
|
+
return areCapabilitiesSupported(n, r);
|
|
70776
|
+
}
|
|
70628
70777
|
static defineChildren(t) {
|
|
70629
70778
|
return L(this, null, function* () {
|
|
70630
|
-
const o = this.baseClass ? yield buildSubModelItems(this.baseClass)(t) : [], n = [], r = o.filter((i) =>
|
|
70779
|
+
const o = this.baseClass ? yield buildSubModelItems(this.baseClass)(t) : [], n = [], r = o.filter((i) => {
|
|
70780
|
+
const a = t.engine.getModelClass(i.useModel);
|
|
70781
|
+
return this.isActionModelVisible(a, t) ? this.scene ? a._isScene(this.scene) : !0 : !1;
|
|
70782
|
+
});
|
|
70631
70783
|
for (const [i, a] of this.models) {
|
|
70632
|
-
if (r.find((u) => u.useModel === a.name))
|
|
70784
|
+
if (!this.isActionModelVisible(a, t) || r.find((u) => u.useModel === a.name))
|
|
70633
70785
|
continue;
|
|
70634
70786
|
const c = yield buildSubModelItem(a, t);
|
|
70635
70787
|
c && n.push(c);
|
|
@@ -71774,7 +71926,7 @@ BlockGridModel.registerFlow({
|
|
|
71774
71926
|
}
|
|
71775
71927
|
});
|
|
71776
71928
|
const parseMarkdown = _.memoize((e) => L(void 0, null, function* () {
|
|
71777
|
-
return e && (yield import("./md-
|
|
71929
|
+
return e && (yield import("./md-oH2RssNY.mjs")).default.render(e);
|
|
71778
71930
|
}));
|
|
71779
71931
|
function useParseMarkdown(e) {
|
|
71780
71932
|
const [t, o] = useState(""), [n, r] = useState(!0);
|
|
@@ -72484,6 +72636,18 @@ class CollectionBlockModel extends DataBlockModel {
|
|
|
72484
72636
|
static filterCollection(o) {
|
|
72485
72637
|
return !!o.filterTargetKey;
|
|
72486
72638
|
}
|
|
72639
|
+
/**
|
|
72640
|
+
* 判断当前区块模型在 collection 选择菜单中是否应该展示指定数据表。
|
|
72641
|
+
*
|
|
72642
|
+
* @param collection 数据表
|
|
72643
|
+
* @returns 是否显示
|
|
72644
|
+
*/
|
|
72645
|
+
static isCollectionAvailable(o) {
|
|
72646
|
+
if (!o)
|
|
72647
|
+
return !1;
|
|
72648
|
+
const n = getBlockCapabilityNamesFromModelClass(this);
|
|
72649
|
+
return areCapabilitiesSupported(o, n);
|
|
72650
|
+
}
|
|
72487
72651
|
/**
|
|
72488
72652
|
* 定义子菜单选项
|
|
72489
72653
|
*/
|
|
@@ -72504,7 +72668,7 @@ class CollectionBlockModel extends DataBlockModel {
|
|
|
72504
72668
|
searchable: !0,
|
|
72505
72669
|
searchPlaceholder: tExpr("Search"),
|
|
72506
72670
|
children: (h) => m.getCollections().map((g) => {
|
|
72507
|
-
if (!this.filterCollection(g))
|
|
72671
|
+
if (!this.filterCollection(g) || !this.isCollectionAvailable(g))
|
|
72508
72672
|
return null;
|
|
72509
72673
|
const f = {
|
|
72510
72674
|
dataSourceKey: g.dataSourceKey,
|
|
@@ -72532,25 +72696,24 @@ class CollectionBlockModel extends DataBlockModel {
|
|
|
72532
72696
|
collectionName: a
|
|
72533
72697
|
// filterByTk: '{{ctx.view.inputArgs.filterByTk}}',
|
|
72534
72698
|
};
|
|
72535
|
-
|
|
72536
|
-
|
|
72537
|
-
|
|
72538
|
-
|
|
72539
|
-
|
|
72540
|
-
|
|
72541
|
-
|
|
72542
|
-
|
|
72543
|
-
|
|
72544
|
-
|
|
72699
|
+
l && (m.associationName = l, m.sourceId = "{{ctx.view.inputArgs.sourceId}}");
|
|
72700
|
+
const h = o.dataSourceManager.getCollection(i, a), g = [];
|
|
72701
|
+
return this.isCollectionAvailable(h) && g.push({
|
|
72702
|
+
key: r("current-collection"),
|
|
72703
|
+
label: "Current collection",
|
|
72704
|
+
useModel: this.name,
|
|
72705
|
+
createModelOptions: n({
|
|
72706
|
+
stepParams: {
|
|
72707
|
+
resourceSettings: {
|
|
72708
|
+
init: m
|
|
72545
72709
|
}
|
|
72546
|
-
}
|
|
72547
|
-
}
|
|
72548
|
-
|
|
72549
|
-
|
|
72550
|
-
|
|
72551
|
-
|
|
72552
|
-
|
|
72553
|
-
];
|
|
72710
|
+
}
|
|
72711
|
+
})
|
|
72712
|
+
}), g.push({
|
|
72713
|
+
key: r("others-collections"),
|
|
72714
|
+
label: "Other collections",
|
|
72715
|
+
children: d(o)
|
|
72716
|
+
}), g;
|
|
72554
72717
|
}
|
|
72555
72718
|
if (this._isScene("new")) {
|
|
72556
72719
|
const m = {
|
|
@@ -72559,42 +72722,40 @@ class CollectionBlockModel extends DataBlockModel {
|
|
|
72559
72722
|
// filterByTk: '{{ctx.view.inputArgs.filterByTk}}',
|
|
72560
72723
|
};
|
|
72561
72724
|
l && (m.associationName = l, m.sourceId = "{{ctx.view.inputArgs.sourceId}}");
|
|
72562
|
-
const h = [
|
|
72563
|
-
|
|
72564
|
-
|
|
72565
|
-
|
|
72566
|
-
|
|
72567
|
-
|
|
72568
|
-
|
|
72569
|
-
|
|
72570
|
-
|
|
72571
|
-
}
|
|
72725
|
+
const h = [], g = o.dataSourceManager.getCollection(i, a);
|
|
72726
|
+
return this.isCollectionAvailable(g) && h.push({
|
|
72727
|
+
key: r("current-collection"),
|
|
72728
|
+
label: "Current collection",
|
|
72729
|
+
useModel: this.name,
|
|
72730
|
+
createModelOptions: n({
|
|
72731
|
+
stepParams: {
|
|
72732
|
+
resourceSettings: {
|
|
72733
|
+
init: m
|
|
72572
72734
|
}
|
|
72573
|
-
}
|
|
72574
|
-
}
|
|
72575
|
-
|
|
72576
|
-
return typeof c != "undefined" && c !== null && h.push({
|
|
72735
|
+
}
|
|
72736
|
+
})
|
|
72737
|
+
}), typeof c != "undefined" && c !== null && h.push({
|
|
72577
72738
|
key: r("associated"),
|
|
72578
72739
|
label: "Associated records",
|
|
72579
|
-
children: () => o.dataSourceManager.getCollection(i, a).getAssociationFields(this._getScene()).map((
|
|
72580
|
-
if (!
|
|
72740
|
+
children: () => o.dataSourceManager.getCollection(i, a).getAssociationFields(this._getScene()).map((y) => {
|
|
72741
|
+
if (!y.targetCollection || y.type === "belongsToArray" || !this.filterCollection(y.targetCollection) || !this.isCollectionAvailable(y.targetCollection))
|
|
72581
72742
|
return null;
|
|
72582
|
-
let
|
|
72583
|
-
|
|
72584
|
-
const
|
|
72743
|
+
let b = `{{ctx.popup.record.${y.sourceKey || y.collection.filterTargetKey}}}`;
|
|
72744
|
+
y.sourceKey === y.collection.filterTargetKey && (b = "{{ctx.view.inputArgs.filterByTk}}");
|
|
72745
|
+
const S = {
|
|
72585
72746
|
dataSourceKey: i,
|
|
72586
|
-
collectionName:
|
|
72587
|
-
associationName:
|
|
72588
|
-
sourceId:
|
|
72747
|
+
collectionName: y.target,
|
|
72748
|
+
associationName: y.resourceName,
|
|
72749
|
+
sourceId: b
|
|
72589
72750
|
};
|
|
72590
72751
|
return {
|
|
72591
|
-
key: r(`associated-${
|
|
72592
|
-
label:
|
|
72752
|
+
key: r(`associated-${y.name}`),
|
|
72753
|
+
label: y.title,
|
|
72593
72754
|
useModel: this.name,
|
|
72594
72755
|
createModelOptions: n({
|
|
72595
72756
|
stepParams: {
|
|
72596
72757
|
resourceSettings: {
|
|
72597
|
-
init:
|
|
72758
|
+
init: S
|
|
72598
72759
|
}
|
|
72599
72760
|
}
|
|
72600
72761
|
})
|
|
@@ -72611,7 +72772,7 @@ class CollectionBlockModel extends DataBlockModel {
|
|
|
72611
72772
|
key: r("associated"),
|
|
72612
72773
|
label: "Associated records",
|
|
72613
72774
|
children: () => o.dataSourceManager.getCollection(i, a).getAssociationFields(this._getScene()).map((h) => {
|
|
72614
|
-
if (!h.targetCollection || h.type === "belongsToArray" || !this.filterCollection(h.targetCollection))
|
|
72775
|
+
if (!h.targetCollection || h.type === "belongsToArray" || !this.filterCollection(h.targetCollection) || !this.isCollectionAvailable(h.targetCollection))
|
|
72615
72776
|
return null;
|
|
72616
72777
|
let g = `{{ctx.popup.record.${h.sourceKey || h.collection.filterTargetKey}}}`;
|
|
72617
72778
|
h.sourceKey === h.collection.filterTargetKey && (g = "{{ctx.view.inputArgs.filterByTk}}");
|
|
@@ -72643,7 +72804,7 @@ class CollectionBlockModel extends DataBlockModel {
|
|
|
72643
72804
|
];
|
|
72644
72805
|
if (this._isScene("one")) {
|
|
72645
72806
|
const m = o.dataSourceManager.getCollection(i, a);
|
|
72646
|
-
if (!m || !this.filterCollection(m))
|
|
72807
|
+
if (!m || !this.filterCollection(m) || !this.isCollectionAvailable(m))
|
|
72647
72808
|
return p;
|
|
72648
72809
|
const h = {
|
|
72649
72810
|
dataSourceKey: i,
|
|
@@ -72861,11 +73022,7 @@ class FieldModel extends FlowModel {
|
|
|
72861
73022
|
class FilterBlockModel extends BlockModel {
|
|
72862
73023
|
}
|
|
72863
73024
|
FilterBlockModel.define({ hide: !0, label: "Filter blocks" });
|
|
72864
|
-
const
|
|
72865
|
-
> .ant-tabs-nav .ant-tabs-nav-list {
|
|
72866
|
-
padding-inline-start: var(--nb-flow-page-tabs-nav-padding-inline-start, 16px);
|
|
72867
|
-
}
|
|
72868
|
-
`, TABS_DESIGN_MODE_ROOT_CLASS_NAME = css`
|
|
73025
|
+
const TABS_DESIGN_MODE_ROOT_CLASS_NAME = css`
|
|
72869
73026
|
> .ant-tabs-nav .ant-tabs-tab {
|
|
72870
73027
|
min-width: 54px;
|
|
72871
73028
|
}
|
|
@@ -73032,14 +73189,25 @@ class PageModel extends FlowModel {
|
|
|
73032
73189
|
}
|
|
73033
73190
|
renderTabs() {
|
|
73034
73191
|
var a, l, c, u, d;
|
|
73035
|
-
const o = (l = (a = this.context.themeToken) == null ? void 0 : a.paddingLG) != null ? l : 16, n =
|
|
73036
|
-
|
|
73037
|
-
|
|
73192
|
+
const o = (l = (a = this.context.themeToken) == null ? void 0 : a.paddingLG) != null ? l : 16, n = this.context.flowSettingsEnabled ? TABS_DESIGN_MODE_ROOT_CLASS_NAME : void 0, r = this.tabBarExtraContent.left !== void 0 ? this.tabBarExtraContent.left : /* @__PURE__ */ jsx("span", { "aria-hidden": "true", style: { display: "inline-block", width: o, height: 1 } }), i = this.tabBarExtraContent.right !== void 0 ? this.tabBarExtraContent.right : /* @__PURE__ */ jsx(
|
|
73193
|
+
AddSubModelButton,
|
|
73194
|
+
{
|
|
73195
|
+
model: this,
|
|
73196
|
+
subModelKey: "tabs",
|
|
73197
|
+
items: [
|
|
73198
|
+
{
|
|
73199
|
+
key: "blank",
|
|
73200
|
+
label: this.context.t("Blank tab"),
|
|
73201
|
+
createModelOptions: this.createPageTabModelOptions
|
|
73202
|
+
}
|
|
73203
|
+
],
|
|
73204
|
+
children: /* @__PURE__ */ jsx(FlowSettingsButton, { icon: /* @__PURE__ */ jsx(PlusOutlined, {}), children: this.context.t("Add tab") })
|
|
73205
|
+
}
|
|
73206
|
+
);
|
|
73038
73207
|
return /* @__PURE__ */ jsx(DndProvider, { onDragEnd: this.handleDragEnd.bind(this), children: /* @__PURE__ */ jsx(
|
|
73039
73208
|
Tabs$1,
|
|
73040
73209
|
{
|
|
73041
|
-
|
|
73042
|
-
rootClassName: r,
|
|
73210
|
+
className: n,
|
|
73043
73211
|
activeKey: (u = (c = this.context.view) == null ? void 0 : c.navigation) != null && u.viewParams ? this.context.view.navigation.viewParams.tabUid || ((d = this.getFirstTab()) == null ? void 0 : d.uid) : this.props.tabActiveKey,
|
|
73044
73212
|
tabBarStyle: this.props.tabBarStyle,
|
|
73045
73213
|
items: this.mapTabs(),
|
|
@@ -73049,23 +73217,10 @@ class PageModel extends FlowModel {
|
|
|
73049
73217
|
tabUid: p
|
|
73050
73218
|
}), this.invokeTabModelLifecycleMethod(p, "onActive"), this.invokeTabModelLifecycleMethod(this.props.tabActiveKey, "onInactive"), this.setProps("tabActiveKey", p);
|
|
73051
73219
|
},
|
|
73052
|
-
tabBarExtraContent:
|
|
73053
|
-
|
|
73054
|
-
|
|
73055
|
-
|
|
73056
|
-
model: this,
|
|
73057
|
-
subModelKey: "tabs",
|
|
73058
|
-
items: [
|
|
73059
|
-
{
|
|
73060
|
-
key: "blank",
|
|
73061
|
-
label: this.context.t("Blank tab"),
|
|
73062
|
-
createModelOptions: this.createPageTabModelOptions
|
|
73063
|
-
}
|
|
73064
|
-
],
|
|
73065
|
-
children: /* @__PURE__ */ jsx(FlowSettingsButton, { icon: /* @__PURE__ */ jsx(PlusOutlined, {}), children: this.context.t("Add tab") })
|
|
73066
|
-
}
|
|
73067
|
-
)
|
|
73068
|
-
}, this.tabBarExtraContent)
|
|
73220
|
+
tabBarExtraContent: {
|
|
73221
|
+
left: r,
|
|
73222
|
+
right: i
|
|
73223
|
+
}
|
|
73069
73224
|
}
|
|
73070
73225
|
) });
|
|
73071
73226
|
}
|
|
@@ -73181,20 +73336,22 @@ class ChildPageModel extends PageModel {
|
|
|
73181
73336
|
}
|
|
73182
73337
|
}
|
|
73183
73338
|
const BackButtonUsedInSubPage = () => {
|
|
73184
|
-
|
|
73339
|
+
var i;
|
|
73340
|
+
const e = useFlowContext(), t = e.themeToken, o = 32, n = (i = t == null ? void 0 : t.paddingLG) != null ? i : 16, r = useMemo(() => ({
|
|
73185
73341
|
width: "auto",
|
|
73186
73342
|
height: "auto",
|
|
73187
73343
|
lineHeight: 1,
|
|
73188
73344
|
padding: t.paddingXS,
|
|
73345
|
+
marginLeft: t.paddingLG,
|
|
73189
73346
|
marginRight: o - t.paddingXS
|
|
73190
|
-
}), [t.paddingXS]);
|
|
73191
|
-
return e.view.type !== "embed" ?
|
|
73347
|
+
}), [t.paddingLG, t.paddingXS]);
|
|
73348
|
+
return e.view.type !== "embed" ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", style: { display: "inline-block", width: n, height: 1 } }) : /* @__PURE__ */ jsx(
|
|
73192
73349
|
Button,
|
|
73193
73350
|
{
|
|
73194
73351
|
"aria-label": "back-button",
|
|
73195
73352
|
type: "text",
|
|
73196
73353
|
icon: /* @__PURE__ */ jsx(ArrowLeftOutlined, {}),
|
|
73197
|
-
style:
|
|
73354
|
+
style: r,
|
|
73198
73355
|
onClick: e.view.close
|
|
73199
73356
|
}
|
|
73200
73357
|
);
|
|
@@ -73606,7 +73763,7 @@ const FlowRoute = () => {
|
|
|
73606
73763
|
}
|
|
73607
73764
|
};
|
|
73608
73765
|
}
|
|
73609
|
-
const m = yield a.loadOrCreateModel(p);
|
|
73766
|
+
const m = yield a.loadOrCreateModel(p, { skipSave: !a.context.flowSettingsEnabled });
|
|
73610
73767
|
return m != null && m.uid && n && (m.context.addDelegate(l), m.removeParentDelegate(), n(m.uid, m)), m;
|
|
73611
73768
|
}),
|
|
73612
73769
|
{
|
|
@@ -73630,7 +73787,7 @@ const RemoteFlowModelRenderer = (e) => {
|
|
|
73630
73787
|
function PageTabChildrenRenderer({ ctx: e, options: t }) {
|
|
73631
73788
|
const { data: o, loading: n } = useRequest$1(
|
|
73632
73789
|
() => L(this, null, function* () {
|
|
73633
|
-
const i = yield e.engine.loadOrCreateModel(t);
|
|
73790
|
+
const i = yield e.engine.loadOrCreateModel(t, { skipSave: !e.flowSettingsEnabled });
|
|
73634
73791
|
return i.context.addDelegate(e), i;
|
|
73635
73792
|
}),
|
|
73636
73793
|
{
|
|
@@ -73639,6 +73796,12 @@ function PageTabChildrenRenderer({ ctx: e, options: t }) {
|
|
|
73639
73796
|
), r = e != null && e.isMobileLayout ? 8 : e == null ? void 0 : e.themeToken.marginBlock;
|
|
73640
73797
|
return n || !(o != null && o.uid) ? /* @__PURE__ */ jsx(SkeletonFallback, { style: { margin: r } }) : /* @__PURE__ */ jsx(FlowModelRenderer, { model: o, fallback: /* @__PURE__ */ jsx(SkeletonFallback, { style: { margin: r } }) });
|
|
73641
73798
|
}
|
|
73799
|
+
function normalizePersistedRoute(e) {
|
|
73800
|
+
if (Array.isArray(e))
|
|
73801
|
+
return e.find((t) => !!t && typeof t == "object");
|
|
73802
|
+
if (e && typeof e == "object")
|
|
73803
|
+
return e;
|
|
73804
|
+
}
|
|
73642
73805
|
class BasePageTabModel extends FlowModel {
|
|
73643
73806
|
onInit(t) {
|
|
73644
73807
|
super.onInit(t), this.context.defineProperty("tabActive", {
|
|
@@ -73743,9 +73906,8 @@ class RootPageTabModel extends BasePageTabModel {
|
|
|
73743
73906
|
}
|
|
73744
73907
|
save() {
|
|
73745
73908
|
return L(this, null, function* () {
|
|
73746
|
-
var
|
|
73747
|
-
const t = this.serialize(), o = (
|
|
73748
|
-
yield this.context.api.request({
|
|
73909
|
+
var i, a, l, c, u;
|
|
73910
|
+
const t = this.serialize(), o = (l = (a = (i = this.stepParams) == null ? void 0 : i.pageTabSettings) == null ? void 0 : a.tab) == null ? void 0 : l.documentTitle, n = yield this.context.api.request({
|
|
73749
73911
|
method: "post",
|
|
73750
73912
|
url: "desktopRoutes:updateOrCreate",
|
|
73751
73913
|
params: {
|
|
@@ -73759,7 +73921,10 @@ class RootPageTabModel extends BasePageTabModel {
|
|
|
73759
73921
|
documentTitle: o
|
|
73760
73922
|
}
|
|
73761
73923
|
})
|
|
73762
|
-
});
|
|
73924
|
+
}), r = normalizePersistedRoute((c = n == null ? void 0 : n.data) == null ? void 0 : c.data);
|
|
73925
|
+
r && this.setProps("route", A(x(x({}, this.props.route), r), {
|
|
73926
|
+
options: x(x({}, (u = this.props.route) == null ? void 0 : u.options), r.options)
|
|
73927
|
+
}));
|
|
73763
73928
|
});
|
|
73764
73929
|
}
|
|
73765
73930
|
destroy() {
|
|
@@ -73804,6 +73969,20 @@ class RootPageModel extends PageModel {
|
|
|
73804
73969
|
super(...arguments);
|
|
73805
73970
|
R(this, "mounted", !1);
|
|
73806
73971
|
}
|
|
73972
|
+
/**
|
|
73973
|
+
* 新建 tab 在首次保存完成前,前端 route 里可能还没有数据库 id。
|
|
73974
|
+
* 拖拽前兜底触发一次保存,确保 move 接口拿到真实主键。
|
|
73975
|
+
*
|
|
73976
|
+
* @param model - 当前参与拖拽的 tab model
|
|
73977
|
+
* @returns 可用于排序接口的 route id
|
|
73978
|
+
*/
|
|
73979
|
+
ensurePersistedRouteId(o) {
|
|
73980
|
+
return L(this, null, function* () {
|
|
73981
|
+
var r, i, a, l;
|
|
73982
|
+
const n = (i = (r = o == null ? void 0 : o.props) == null ? void 0 : r.route) == null ? void 0 : i.id;
|
|
73983
|
+
return n != null ? n : (typeof (o == null ? void 0 : o.save) == "function" && (yield o.save()), (l = (a = o == null ? void 0 : o.props) == null ? void 0 : a.route) == null ? void 0 : l.id);
|
|
73984
|
+
});
|
|
73985
|
+
}
|
|
73807
73986
|
onMount() {
|
|
73808
73987
|
super.onMount(), reaction$1(
|
|
73809
73988
|
() => this.context.pageActive.value,
|
|
@@ -73837,14 +74016,20 @@ class RootPageModel extends PageModel {
|
|
|
73837
74016
|
}
|
|
73838
74017
|
handleDragEnd(o) {
|
|
73839
74018
|
return L(this, null, function* () {
|
|
73840
|
-
var
|
|
73841
|
-
const n = this.flowEngine.getModel((
|
|
73842
|
-
!n || !r ||
|
|
74019
|
+
var l, c;
|
|
74020
|
+
const n = this.flowEngine.getModel((l = o.active) == null ? void 0 : l.id), r = this.flowEngine.getModel((c = o.over) == null ? void 0 : c.id);
|
|
74021
|
+
if (!n || !r || n.uid === r.uid)
|
|
74022
|
+
return;
|
|
74023
|
+
const [i, a] = yield Promise.all([
|
|
74024
|
+
this.ensurePersistedRouteId(n),
|
|
74025
|
+
this.ensurePersistedRouteId(r)
|
|
74026
|
+
]);
|
|
74027
|
+
i == null || a == null || (yield this.context.api.request({
|
|
73843
74028
|
url: "desktopRoutes:move",
|
|
73844
74029
|
method: "post",
|
|
73845
74030
|
params: {
|
|
73846
|
-
sourceId:
|
|
73847
|
-
targetId:
|
|
74031
|
+
sourceId: i,
|
|
74032
|
+
targetId: a,
|
|
73848
74033
|
sortField: "sort"
|
|
73849
74034
|
}
|
|
73850
74035
|
}), this.flowEngine.moveModel(n.uid, r.uid, { persist: !1 }));
|
|
@@ -75086,7 +75271,7 @@ class BulkDeleteActionModel extends ActionModel {
|
|
|
75086
75271
|
return "destroy";
|
|
75087
75272
|
}
|
|
75088
75273
|
}
|
|
75089
|
-
R(BulkDeleteActionModel, "scene", ActionSceneEnum.collection);
|
|
75274
|
+
R(BulkDeleteActionModel, "scene", ActionSceneEnum.collection), R(BulkDeleteActionModel, "capabilityActionName", "destroyMany");
|
|
75090
75275
|
BulkDeleteActionModel.define({
|
|
75091
75276
|
label: tExpr("Delete")
|
|
75092
75277
|
});
|
|
@@ -75685,11 +75870,14 @@ function AssignFieldsEditor() {
|
|
|
75685
75870
|
return useEffect(() => {
|
|
75686
75871
|
let l = !1;
|
|
75687
75872
|
return L(this, null, function* () {
|
|
75688
|
-
const c = yield n.loadOrCreateModel(
|
|
75689
|
-
|
|
75690
|
-
|
|
75691
|
-
|
|
75692
|
-
|
|
75873
|
+
const c = yield n.loadOrCreateModel(
|
|
75874
|
+
{
|
|
75875
|
+
parentId: o.uid,
|
|
75876
|
+
subKey: "assignForm",
|
|
75877
|
+
use: "AssignFormModel"
|
|
75878
|
+
},
|
|
75879
|
+
{ skipSave: !e.context.flowSettingsEnabled }
|
|
75880
|
+
);
|
|
75693
75881
|
l || (a(c), o.assignFormUid = (c == null ? void 0 : c.uid) || o.assignFormUid);
|
|
75694
75882
|
}), () => {
|
|
75695
75883
|
l = !0;
|
|
@@ -76164,6 +76352,7 @@ class AddChildActionModel extends PopupActionModel {
|
|
|
76164
76352
|
});
|
|
76165
76353
|
}
|
|
76166
76354
|
}
|
|
76355
|
+
R(AddChildActionModel, "capabilityActionName", null);
|
|
76167
76356
|
AddChildActionModel.registerFlow({
|
|
76168
76357
|
key: "addChildSettingsInit",
|
|
76169
76358
|
steps: {
|
|
@@ -79441,7 +79630,7 @@ class EditFormModel extends FormBlockModel {
|
|
|
79441
79630
|
);
|
|
79442
79631
|
}
|
|
79443
79632
|
}
|
|
79444
|
-
R(EditFormModel, "scene", BlockSceneEnum.oam);
|
|
79633
|
+
R(EditFormModel, "scene", BlockSceneEnum.oam), R(EditFormModel, "blockCapabilityActionName", "update");
|
|
79445
79634
|
EditFormModel.registerFlow({
|
|
79446
79635
|
key: "formSettings",
|
|
79447
79636
|
title: tExpr("Edit form settings"),
|
|
@@ -80498,6 +80687,19 @@ DetailsBlockModel.registerFlow({
|
|
|
80498
80687
|
}
|
|
80499
80688
|
}
|
|
80500
80689
|
});
|
|
80690
|
+
DetailsBlockModel.registerFlow({
|
|
80691
|
+
key: "initialPaginationChangeRefresh",
|
|
80692
|
+
sort: 10001,
|
|
80693
|
+
steps: {
|
|
80694
|
+
refreshPaginationRelatedStates: {
|
|
80695
|
+
handler(e) {
|
|
80696
|
+
return L(this, null, function* () {
|
|
80697
|
+
e.model.hidden || !e.model.isMultiRecordResource() || (yield dispatchEventDeep(e.model, "paginationChange"));
|
|
80698
|
+
});
|
|
80699
|
+
}
|
|
80700
|
+
}
|
|
80701
|
+
}
|
|
80702
|
+
});
|
|
80501
80703
|
DetailsBlockModel.define({
|
|
80502
80704
|
label: tExpr("Details"),
|
|
80503
80705
|
searchable: !0,
|
|
@@ -81063,7 +81265,11 @@ function markAssociationHydrationDone(e, t) {
|
|
|
81063
81265
|
function RemoteModelRenderer$2({ options: e }) {
|
|
81064
81266
|
const t = useFlowViewContext(), { data: o, loading: n } = useRequest$1(
|
|
81065
81267
|
() => L(this, null, function* () {
|
|
81066
|
-
return yield t.engine.loadOrCreateModel(e, {
|
|
81268
|
+
return yield t.engine.loadOrCreateModel(e, {
|
|
81269
|
+
delegateToParent: !1,
|
|
81270
|
+
delegate: t,
|
|
81271
|
+
skipSave: !t.flowSettingsEnabled
|
|
81272
|
+
});
|
|
81067
81273
|
}),
|
|
81068
81274
|
{
|
|
81069
81275
|
refreshDeps: [t, e]
|
|
@@ -81797,7 +82003,7 @@ class CreateFormModel extends FormBlockModel {
|
|
|
81797
82003
|
);
|
|
81798
82004
|
}
|
|
81799
82005
|
}
|
|
81800
|
-
R(CreateFormModel, "scene", BlockSceneEnum.new);
|
|
82006
|
+
R(CreateFormModel, "scene", BlockSceneEnum.new), R(CreateFormModel, "blockCapabilityActionName", "create");
|
|
81801
82007
|
CreateFormModel.registerFlow({
|
|
81802
82008
|
key: "formSettings",
|
|
81803
82009
|
title: tExpr("Form settings"),
|
|
@@ -82754,7 +82960,11 @@ function injectRecordPickerPopupContext(e, t, o) {
|
|
|
82754
82960
|
function RemoteModelRenderer$1({ options: e, fieldModel: t }) {
|
|
82755
82961
|
const o = useFlowViewContext(), { data: n, loading: r } = useRequest$1(
|
|
82756
82962
|
() => L(this, null, function* () {
|
|
82757
|
-
const i = yield o.engine.loadOrCreateModel(e, {
|
|
82963
|
+
const i = yield o.engine.loadOrCreateModel(e, {
|
|
82964
|
+
delegateToParent: !1,
|
|
82965
|
+
delegate: o,
|
|
82966
|
+
skipSave: !o.flowSettingsEnabled
|
|
82967
|
+
});
|
|
82758
82968
|
return injectRecordPickerPopupContext(i, o, t), i;
|
|
82759
82969
|
}),
|
|
82760
82970
|
{
|
|
@@ -85870,7 +86080,11 @@ function FieldWithoutPermissionPlaceholder({ targetModel: e, children: t }) {
|
|
|
85870
86080
|
function RemoteModelRenderer({ options: e, fieldModel: t }) {
|
|
85871
86081
|
const o = useFlowViewContext(), { data: n, loading: r } = useRequest$1(
|
|
85872
86082
|
() => L(this, null, function* () {
|
|
85873
|
-
const i = yield o.engine.loadOrCreateModel(e, {
|
|
86083
|
+
const i = yield o.engine.loadOrCreateModel(e, {
|
|
86084
|
+
delegateToParent: !1,
|
|
86085
|
+
delegate: o,
|
|
86086
|
+
skipSave: !o.flowSettingsEnabled
|
|
86087
|
+
});
|
|
85874
86088
|
return i.context.defineProperty("associationModel", {
|
|
85875
86089
|
value: t.context.associationModel
|
|
85876
86090
|
}), i.actionName = e.scene, i;
|
|
@@ -89799,6 +90013,11 @@ class FilterFormGridModel extends GridModel {
|
|
|
89799
90013
|
R(this, "hiddenRows", {});
|
|
89800
90014
|
R(this, "loading", observable$1.ref(!1));
|
|
89801
90015
|
}
|
|
90016
|
+
getAssociationFilterTargetKey(o) {
|
|
90017
|
+
var r;
|
|
90018
|
+
const n = (r = o == null ? void 0 : o.targetCollection) == null ? void 0 : r.filterTargetKey;
|
|
90019
|
+
return Array.isArray(n) ? n[0] || "id" : n || "id";
|
|
90020
|
+
}
|
|
89802
90021
|
toggleFormFieldsCollapse(o, n) {
|
|
89803
90022
|
const r = this.props.rows || {};
|
|
89804
90023
|
if (o) {
|
|
@@ -89839,7 +90058,7 @@ class FilterFormGridModel extends GridModel {
|
|
|
89839
90058
|
if (m || (m = (p = c.getField) == null ? void 0 : p.call(c, n)), m != null && m.target)
|
|
89840
90059
|
return {
|
|
89841
90060
|
targetId: l.uid,
|
|
89842
|
-
filterPaths: [`${n}.${m
|
|
90061
|
+
filterPaths: [`${n}.${this.getAssociationFilterTargetKey(m)}`]
|
|
89843
90062
|
};
|
|
89844
90063
|
}
|
|
89845
90064
|
return {
|
|
@@ -95251,7 +95470,11 @@ const models = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
|
|
|
95251
95470
|
const o = e.inputArgs || {}, n = (w = (T = o.defineProperties) != null ? T : (M = ($ = e.model.context) == null ? void 0 : $.inputArgs) == null ? void 0 : M.defineProperties) != null ? w : void 0, r = (O = (j = o.defineMethods) != null ? j : (N = (B = e.model.context) == null ? void 0 : B.inputArgs) == null ? void 0 : N.defineMethods) != null ? O : void 0, i = ((z = (q = e.model) == null ? void 0 : q.getInputArgs) == null ? void 0 : z.call(q)) || {}, a = (o == null ? void 0 : o.defaultInputKeys) || [], l = (re) => {
|
|
95252
95471
|
const ie = typeof (o == null ? void 0 : o[re]) != "undefined", ne = a.includes(re);
|
|
95253
95472
|
return ie && !ne ? o[re] : typeof (t == null ? void 0 : t[re]) != "undefined" ? t[re] : ie ? o[re] : i == null ? void 0 : i[re];
|
|
95254
|
-
}, c =
|
|
95473
|
+
}, c = (() => {
|
|
95474
|
+
var ie;
|
|
95475
|
+
const re = l("filterByTk");
|
|
95476
|
+
return Array.isArray((ie = e.collection) == null ? void 0 : ie.filterTargetKey) && e.collection.filterTargetKey.length === 1 && re != null && typeof re != "object" ? { [e.collection.filterTargetKey[0]]: re } : re;
|
|
95477
|
+
})(), u = l("sourceId"), d = typeof (o == null ? void 0 : o.dataSourceKey) != "undefined" ? o.dataSourceKey : t == null ? void 0 : t.dataSourceKey, p = typeof (o == null ? void 0 : o.collectionName) != "undefined" ? o.collectionName : t == null ? void 0 : t.collectionName, m = typeof (o == null ? void 0 : o.associationName) != "undefined" ? o.associationName : t == null ? void 0 : t.associationName, h = typeof o.tabUid != "undefined" ? o.tabUid : t.tabUid, g = (V = e.inputArgs) != null && V.isMobileLayout ? "embed" : ((U = e.inputArgs) == null ? void 0 : U.mode) || t.mode || "drawer";
|
|
95255
95478
|
let f = typeof o.navigation != "undefined" ? o.navigation : t.navigation;
|
|
95256
95479
|
if ((n || r) && (f = !1), f !== !1 && e.isNavigationEnabled !== !1 && !e.inputArgs.navigation && (K = e.view) != null && K.navigation) {
|
|
95257
95480
|
const re = g, ie = A(x({}, e.inputArgs), {
|
|
@@ -95307,13 +95530,16 @@ const models = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
|
|
|
95307
95530
|
}, b = e.inputArgs.pageModelClass || t.pageModelClass || "ChildPageModel", S = e.inputArgs.size || t.size || "medium";
|
|
95308
95531
|
let C = null, P = null, F = e.model.uid;
|
|
95309
95532
|
if (t.subModelKey) {
|
|
95310
|
-
const re = yield e.engine.loadOrCreateModel(
|
|
95311
|
-
|
|
95312
|
-
|
|
95313
|
-
|
|
95314
|
-
|
|
95315
|
-
|
|
95316
|
-
|
|
95533
|
+
const re = yield e.engine.loadOrCreateModel(
|
|
95534
|
+
{
|
|
95535
|
+
async: !0,
|
|
95536
|
+
parentId: e.model.uid,
|
|
95537
|
+
subKey: t.subModelKey,
|
|
95538
|
+
subType: "object",
|
|
95539
|
+
use: "FlowModel"
|
|
95540
|
+
},
|
|
95541
|
+
{ skipSave: !e.flowSettingsEnabled }
|
|
95542
|
+
);
|
|
95317
95543
|
re != null && re.uid && (F = re.uid);
|
|
95318
95544
|
}
|
|
95319
95545
|
const v = !!((Z = e.inputArgs) != null && Z.navigation), k = ((W = (ee = e.view) == null ? void 0 : ee.inputArgs) == null ? void 0 : W.openerUids) || o.openerUids || [], I = v ? o.openerUids || k : [...k, ((oe = (Y = e.model.context) == null ? void 0 : Y.inputArgs) == null ? void 0 : oe.viewUid) || e.model.uid], D = typeof o.preventClose != "undefined" ? !!o.preventClose : !!t.preventClose, E = A(x(x({
|
|
@@ -99970,6 +100196,7 @@ const overflowMode = defineAction({
|
|
|
99970
100196
|
aclCheck,
|
|
99971
100197
|
aclCheckRefresh,
|
|
99972
100198
|
actionLinkageRules,
|
|
100199
|
+
afterSuccess,
|
|
99973
100200
|
blockHeight,
|
|
99974
100201
|
blockLinkageRules,
|
|
99975
100202
|
confirm: confirm$1,
|
|
@@ -107844,6 +108071,7 @@ export {
|
|
|
107844
108071
|
actionLinkageRules,
|
|
107845
108072
|
actionSettings,
|
|
107846
108073
|
actionSettingsItems,
|
|
108074
|
+
afterSuccess,
|
|
107847
108075
|
allowAddNew,
|
|
107848
108076
|
appendQueryStringToUrl,
|
|
107849
108077
|
applyMobilePaginationProps,
|