@nocobase/client 1.5.0-beta.13 → 1.5.0-beta.14
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/index.mjs +39 -41
- package/es/schema-component/common/utils/uitls.d.ts +0 -6
- package/lib/index.js +92 -92
- package/package.json +5 -5
package/es/index.mjs
CHANGED
|
@@ -19809,19 +19809,13 @@ const useDateVariable = ({ operator: e, schema: t, noDisabled: n }) => {
|
|
|
19809
19809
|
/** 变量的值 */
|
|
19810
19810
|
currentUserCtx: (c = a == null ? void 0 : a.data) == null ? void 0 : c.data
|
|
19811
19811
|
};
|
|
19812
|
-
}, useCurrentFormData = () => {
|
|
19813
|
-
var t, n;
|
|
19814
|
-
const e = useDataBlockRequestData();
|
|
19815
|
-
if (!(((t = e == null ? void 0 : e.data) == null ? void 0 : t.length) > 1))
|
|
19816
|
-
return ((n = e == null ? void 0 : e.data) == null ? void 0 : n[0]) || (e == null ? void 0 : e.data);
|
|
19817
19812
|
}, useCurrentFormContext = ({ form: e } = {}) => {
|
|
19818
|
-
|
|
19819
|
-
const { form: t } = useFormBlockContext(), n = useCurrentFormData(), { isVariableParsedInOtherContext: o } = useFlag(), r = e || t;
|
|
19813
|
+
const { form: t } = useFormBlockContext(), { isVariableParsedInOtherContext: n } = useFlag(), o = e || t;
|
|
19820
19814
|
return {
|
|
19821
19815
|
/** 变量值 */
|
|
19822
|
-
currentFormCtx:
|
|
19816
|
+
currentFormCtx: o == null ? void 0 : o.values,
|
|
19823
19817
|
/** 用来判断是否可以显示`当前表单`变量 */
|
|
19824
|
-
shouldDisplayCurrentForm:
|
|
19818
|
+
shouldDisplayCurrentForm: o && !o.readPretty && !n
|
|
19825
19819
|
};
|
|
19826
19820
|
}, useCurrentFormVariable = ({
|
|
19827
19821
|
collectionField: e,
|
|
@@ -34809,7 +34803,7 @@ function addAppVersion(e, t) {
|
|
|
34809
34803
|
addAppVersion((o = e.properties) == null ? void 0 : o[n], t);
|
|
34810
34804
|
}), e;
|
|
34811
34805
|
}
|
|
34812
|
-
const name = "@nocobase/client", version = "1.5.0-beta.
|
|
34806
|
+
const name = "@nocobase/client", version = "1.5.0-beta.14", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
|
|
34813
34807
|
"@ahooksjs/use-url-state": "3.5.1",
|
|
34814
34808
|
"@ant-design/cssinjs": "^1.11.1",
|
|
34815
34809
|
"@ant-design/icons": "^5.1.4",
|
|
@@ -34831,9 +34825,9 @@ const name = "@nocobase/client", version = "1.5.0-beta.13", license = "AGPL-3.0"
|
|
|
34831
34825
|
"@formily/reactive-react": "^2.2.27",
|
|
34832
34826
|
"@formily/shared": "^2.2.27",
|
|
34833
34827
|
"@formily/validator": "^2.2.27",
|
|
34834
|
-
"@nocobase/evaluators": "1.5.0-beta.
|
|
34835
|
-
"@nocobase/sdk": "1.5.0-beta.
|
|
34836
|
-
"@nocobase/utils": "1.5.0-beta.
|
|
34828
|
+
"@nocobase/evaluators": "1.5.0-beta.14",
|
|
34829
|
+
"@nocobase/sdk": "1.5.0-beta.14",
|
|
34830
|
+
"@nocobase/utils": "1.5.0-beta.14",
|
|
34837
34831
|
ahooks: "^3.7.2",
|
|
34838
34832
|
antd: "5.12.8",
|
|
34839
34833
|
"antd-style": "3.7.1",
|
|
@@ -36445,45 +36439,49 @@ const useFormBlockHeight = () => {
|
|
|
36445
36439
|
n["x-linkage-rules"] && (t = n["x-linkage-rules"]);
|
|
36446
36440
|
}), t;
|
|
36447
36441
|
}, WithForm = (e) => {
|
|
36448
|
-
var
|
|
36449
|
-
const { form: t } = e, n = useFieldSchema(), { setFormValueChanged: o } = useActionContext(), r = useVariables$1(), i = useLocalVariables$1({ currentForm: t }), { templateFinished: a } = useTemplateBlockContext(), l = ((
|
|
36442
|
+
var u, d;
|
|
36443
|
+
const { form: t } = e, n = useFieldSchema(), { setFormValueChanged: o } = useActionContext(), r = useVariables$1(), i = useLocalVariables$1({ currentForm: t }), { templateFinished: a } = useTemplateBlockContext(), { loading: l } = useDataBlockRequest() || {}, c = ((d = getLinkageRules(n) || ((u = n.parent) == null ? void 0 : u["x-linkage-rules"])) == null ? void 0 : d.filter((p) => !p.disabled)) || [];
|
|
36450
36444
|
return useEffect(() => {
|
|
36451
|
-
const
|
|
36452
|
-
return t.addEffects(
|
|
36445
|
+
const p = uid();
|
|
36446
|
+
return t.addEffects(p, () => {
|
|
36453
36447
|
onFormInputChange(() => {
|
|
36454
36448
|
o == null || o(!0);
|
|
36455
36449
|
});
|
|
36456
36450
|
}), e.disabled && (t.disabled = e.disabled), () => {
|
|
36457
|
-
t.removeEffects(
|
|
36451
|
+
t.removeEffects(p);
|
|
36458
36452
|
};
|
|
36459
36453
|
}, [t, e.disabled, o]), useEffect(() => {
|
|
36460
|
-
|
|
36461
|
-
|
|
36462
|
-
|
|
36463
|
-
|
|
36464
|
-
|
|
36465
|
-
|
|
36466
|
-
|
|
36467
|
-
|
|
36468
|
-
|
|
36469
|
-
|
|
36470
|
-
|
|
36471
|
-
|
|
36472
|
-
|
|
36473
|
-
|
|
36474
|
-
|
|
36475
|
-
|
|
36476
|
-
|
|
36477
|
-
|
|
36478
|
-
|
|
36479
|
-
|
|
36454
|
+
if (l)
|
|
36455
|
+
return;
|
|
36456
|
+
const p = uid(), m = [];
|
|
36457
|
+
return setTimeout(() => {
|
|
36458
|
+
t.addEffects(p, () => {
|
|
36459
|
+
forEachLinkageRule(c, (h, g) => {
|
|
36460
|
+
var f;
|
|
36461
|
+
if ((f = h.targetFields) != null && f.length) {
|
|
36462
|
+
const C = h.targetFields.join(",");
|
|
36463
|
+
onFieldInit(`*(${C})`, (b, S) => {
|
|
36464
|
+
m.push(
|
|
36465
|
+
bindLinkageRulesToFiled({
|
|
36466
|
+
field: b,
|
|
36467
|
+
linkageRules: c,
|
|
36468
|
+
formValues: S.values,
|
|
36469
|
+
localVariables: i,
|
|
36470
|
+
action: h,
|
|
36471
|
+
rule: g,
|
|
36472
|
+
variables: r
|
|
36473
|
+
})
|
|
36474
|
+
);
|
|
36475
|
+
});
|
|
36476
|
+
}
|
|
36477
|
+
});
|
|
36480
36478
|
});
|
|
36481
36479
|
}), () => {
|
|
36482
|
-
t.removeEffects(
|
|
36483
|
-
|
|
36480
|
+
t.removeEffects(p), m.forEach((h) => {
|
|
36481
|
+
h();
|
|
36484
36482
|
});
|
|
36485
36483
|
};
|
|
36486
|
-
}, [
|
|
36484
|
+
}, [c, a, l]), n["x-decorator"] === "FormV2" ? /* @__PURE__ */ jsx(FormDecorator, x({}, e)) : /* @__PURE__ */ jsx(FormComponent, x({}, e));
|
|
36487
36485
|
}, WithoutForm = (e) => {
|
|
36488
36486
|
const t = useFieldSchema(), { setFormValueChanged: n } = useActionContext(), o = useMemo(
|
|
36489
36487
|
() => createForm({
|
|
@@ -29,11 +29,5 @@ export declare const conditionAnalyses: ({ ruleGroup, variables, localVariables,
|
|
|
29
29
|
*/
|
|
30
30
|
variableNameOfLeftCondition?: string;
|
|
31
31
|
}) => Promise<boolean>;
|
|
32
|
-
/**
|
|
33
|
-
* 转化成变量字符串,方便解析出值
|
|
34
|
-
* @param targetField
|
|
35
|
-
* @returns
|
|
36
|
-
*/
|
|
37
|
-
export declare function targetFieldToVariableString(targetField: string[], variableName?: string): string;
|
|
38
32
|
export declare function getRenderContent(templateEngine: any, content: any, variables: any, localVariables: any, defaultParse: any): Promise<any>;
|
|
39
33
|
export {};
|