@nocobase/client 1.9.0-beta.12 → 1.9.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/block-provider/hooks/index.d.ts +2 -1
- package/es/index.mjs +97 -67
- package/es/schema-component/antd/upload/shared.d.ts +1 -1
- package/lib/index.js +59 -56
- package/lib/locale/cron/zh-CN.json +33 -0
- package/lib/locale/cron/zh-TW.json +33 -0
- package/lib/locale/{de-DE.js → de-DE.json} +475 -475
- package/lib/locale/{en-US.js → en-US.json} +235 -235
- package/lib/locale/es-ES.json +824 -0
- package/lib/locale/fr-FR.json +844 -0
- package/lib/locale/{it-IT.js → it-IT.json} +357 -357
- package/lib/locale/ja-JP.json +1062 -0
- package/lib/locale/ko-KR.json +935 -0
- package/lib/locale/nl-NL.json +1072 -0
- package/lib/locale/pt-BR.json +804 -0
- package/lib/locale/ru-RU.json +633 -0
- package/lib/locale/tr-TR.json +631 -0
- package/lib/locale/uk-UA.json +847 -0
- package/lib/locale/zh-CN.json +1191 -0
- package/lib/locale/zh-TW.json +938 -0
- package/package.json +5 -5
- package/lib/locale/cron/zh-CN.js +0 -33
- package/lib/locale/cron/zh-TW.js +0 -33
- package/lib/locale/es-ES.js +0 -824
- package/lib/locale/fr-FR.js +0 -844
- package/lib/locale/ja-JP.js +0 -1062
- package/lib/locale/ko-KR.js +0 -935
- package/lib/locale/nl-NL.js +0 -1072
- package/lib/locale/pt-BR.js +0 -804
- package/lib/locale/ru-RU.js +0 -633
- package/lib/locale/tr-TR.js +0 -631
- package/lib/locale/uk-UA.js +0 -847
- package/lib/locale/zh-CN.js +0 -1229
- package/lib/locale/zh-TW.js +0 -938
|
@@ -6,6 +6,7 @@
|
|
|
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 { Form } from '@formily/core';
|
|
9
10
|
import { ChangeEvent } from 'react';
|
|
10
11
|
import { NavigateFunction } from 'react-router-dom';
|
|
11
12
|
import { CollectionOptions } from '../../collection-manager';
|
|
@@ -26,7 +27,7 @@ export declare function getFormValues({ filterByTk, field, form, fieldNames, get
|
|
|
26
27
|
resource: any;
|
|
27
28
|
actionFields: any[];
|
|
28
29
|
}): any;
|
|
29
|
-
export declare function useCollectValuesToSubmit(): () => Promise<any>;
|
|
30
|
+
export declare function useCollectValuesToSubmit(f?: Form): () => Promise<any>;
|
|
30
31
|
export declare const useCreateActionProps: () => {
|
|
31
32
|
onClick(): Promise<void>;
|
|
32
33
|
};
|
package/es/index.mjs
CHANGED
|
@@ -8850,7 +8850,7 @@ function addAppVersion(e, t) {
|
|
|
8850
8850
|
addAppVersion((o = e.properties) == null ? void 0 : o[n], t);
|
|
8851
8851
|
}), e;
|
|
8852
8852
|
}
|
|
8853
|
-
const name = "@nocobase/client", version = "1.9.0-beta.
|
|
8853
|
+
const name = "@nocobase/client", version = "1.9.0-beta.14", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
|
|
8854
8854
|
"@ahooksjs/use-url-state": "3.5.1",
|
|
8855
8855
|
"@ant-design/cssinjs": "^1.11.1",
|
|
8856
8856
|
"@ant-design/icons": "^5.6.1",
|
|
@@ -8871,9 +8871,9 @@ const name = "@nocobase/client", version = "1.9.0-beta.12", license = "AGPL-3.0"
|
|
|
8871
8871
|
"@formily/reactive-react": "^2.2.27",
|
|
8872
8872
|
"@formily/shared": "^2.2.27",
|
|
8873
8873
|
"@formily/validator": "^2.2.27",
|
|
8874
|
-
"@nocobase/evaluators": "1.9.0-beta.
|
|
8875
|
-
"@nocobase/sdk": "1.9.0-beta.
|
|
8876
|
-
"@nocobase/utils": "1.9.0-beta.
|
|
8874
|
+
"@nocobase/evaluators": "1.9.0-beta.14",
|
|
8875
|
+
"@nocobase/sdk": "1.9.0-beta.14",
|
|
8876
|
+
"@nocobase/utils": "1.9.0-beta.14",
|
|
8877
8877
|
ahooks: "^3.7.2",
|
|
8878
8878
|
antd: "5.24.2",
|
|
8879
8879
|
"antd-style": "3.7.1",
|
|
@@ -29456,46 +29456,46 @@ function getFormValues({
|
|
|
29456
29456
|
}
|
|
29457
29457
|
return getFilteredFormValues(n);
|
|
29458
29458
|
}
|
|
29459
|
-
function useCollectValuesToSubmit() {
|
|
29460
|
-
const
|
|
29459
|
+
function useCollectValuesToSubmit(e) {
|
|
29460
|
+
const t = useForm(), n = e != null ? e : t, o = useFilterByTk(), { field: r, resource: a } = useBlockRequestContext(), { fields: i, getField: l, getTreeParentField: c, name: u } = useCollection_deprecated(), d = i.map((b) => b.name), { fieldSchema: p } = useActionContext(), { getActiveFieldsName: m } = useFormActiveFields() || {}, h = useVariables$1(), g = useLocalVariables$1({ currentForm: n }), f = useFieldSchema(), C = useTreeParentRecord();
|
|
29461
29461
|
return useCallback(() => q(this, null, function* () {
|
|
29462
|
-
var
|
|
29463
|
-
const { assignedValues:
|
|
29464
|
-
filterByTk:
|
|
29465
|
-
field:
|
|
29466
|
-
form:
|
|
29467
|
-
fieldNames:
|
|
29468
|
-
getField:
|
|
29469
|
-
resource:
|
|
29470
|
-
actionFields: (
|
|
29471
|
-
}),
|
|
29472
|
-
const
|
|
29473
|
-
if (isVariable$1(
|
|
29474
|
-
const { value:
|
|
29475
|
-
|
|
29462
|
+
var R, T, D, B;
|
|
29463
|
+
const { assignedValues: b = {}, overwriteValues: S } = (R = f == null ? void 0 : f["x-action-settings"]) != null ? R : {}, y = getFormValues({
|
|
29464
|
+
filterByTk: o,
|
|
29465
|
+
field: r,
|
|
29466
|
+
form: n,
|
|
29467
|
+
fieldNames: d,
|
|
29468
|
+
getField: l,
|
|
29469
|
+
resource: a,
|
|
29470
|
+
actionFields: (m == null ? void 0 : m("form")) || []
|
|
29471
|
+
}), v = {}, I = Object.keys(b).map((N) => q(this, null, function* () {
|
|
29472
|
+
const M = b[N], j = l(N);
|
|
29473
|
+
if (isVariable$1(M)) {
|
|
29474
|
+
const { value: w } = (yield h == null ? void 0 : h.parseVariable(M, g)) || {};
|
|
29475
|
+
v[N] = transformVariableValue(w, { targetCollectionField: j });
|
|
29476
29476
|
} else
|
|
29477
|
-
|
|
29477
|
+
M !== "" && (v[N] = M);
|
|
29478
29478
|
}));
|
|
29479
|
-
if (yield Promise.all(
|
|
29480
|
-
const
|
|
29481
|
-
|
|
29479
|
+
if (yield Promise.all(I), (T = p == null ? void 0 : p["x-component-props"]) == null ? void 0 : T.addChild) {
|
|
29480
|
+
const N = c();
|
|
29481
|
+
y[(D = N == null ? void 0 : N.name) != null ? D : "parent"] = C, y[(B = N == null ? void 0 : N.foreignKey) != null ? B : "parentId"] = C == null ? void 0 : C.id;
|
|
29482
29482
|
}
|
|
29483
|
-
return x(x(x({},
|
|
29483
|
+
return x(x(x({}, y), S), v);
|
|
29484
29484
|
}), [
|
|
29485
|
-
|
|
29486
|
-
|
|
29487
|
-
c,
|
|
29488
|
-
u,
|
|
29489
|
-
t,
|
|
29490
|
-
e,
|
|
29485
|
+
f,
|
|
29486
|
+
r,
|
|
29491
29487
|
d,
|
|
29492
|
-
|
|
29493
|
-
|
|
29488
|
+
p,
|
|
29489
|
+
o,
|
|
29490
|
+
n,
|
|
29494
29491
|
m,
|
|
29495
29492
|
l,
|
|
29496
|
-
|
|
29493
|
+
c,
|
|
29497
29494
|
g,
|
|
29498
|
-
|
|
29495
|
+
u,
|
|
29496
|
+
a,
|
|
29497
|
+
C,
|
|
29498
|
+
h
|
|
29499
29499
|
]);
|
|
29500
29500
|
}
|
|
29501
29501
|
const useCreateActionProps = () => {
|
|
@@ -31089,7 +31089,7 @@ const DragHandler = (e) => {
|
|
|
31089
31089
|
open: i,
|
|
31090
31090
|
onDropdownVisibleChange: l
|
|
31091
31091
|
}, e), {
|
|
31092
|
-
allowClear: !
|
|
31092
|
+
allowClear: !1,
|
|
31093
31093
|
style: {
|
|
31094
31094
|
width: "100%",
|
|
31095
31095
|
minWidth: 100,
|
|
@@ -31909,7 +31909,7 @@ const useParseDefaultValue = () => {
|
|
|
31909
31909
|
const j = transformVariableValue(B, {
|
|
31910
31910
|
targetCollectionField: D
|
|
31911
31911
|
});
|
|
31912
|
-
j == null || j === "" ? e.mounted && (e.setInitialValue(void 0), e.setValue(void 0)) : p() ? h === 0 && m(j) : e.setInitialValue(j), e.loading = !1;
|
|
31912
|
+
j == null || j === "" ? e.mounted && (e.setInitialValue(void 0), e.setValue(void 0)) : p() ? h === 0 && m(j) : (e.setInitialValue(j), e.setValue(j)), e.loading = !1;
|
|
31913
31913
|
} else
|
|
31914
31914
|
!/\{\{.+\}\}/g.test(t.default) && e.setInitialValue && e.setInitialValue(t.default);
|
|
31915
31915
|
}), v = _.debounce(y, DEBOUNCE_WAIT);
|
|
@@ -31955,6 +31955,9 @@ const formItemWrapCss = css`
|
|
|
31955
31955
|
display: inline;
|
|
31956
31956
|
}
|
|
31957
31957
|
}
|
|
31958
|
+
.ant-formily-item-label label {
|
|
31959
|
+
word-break: normal;
|
|
31960
|
+
}
|
|
31958
31961
|
`, formItemLabelCss = css`
|
|
31959
31962
|
.ant-card-body {
|
|
31960
31963
|
padding: 0px !important;
|
|
@@ -43189,7 +43192,7 @@ const className1 = css`
|
|
|
43189
43192
|
onClick: () => q(void 0, null, function* () {
|
|
43190
43193
|
const I = yield FormDialog(
|
|
43191
43194
|
o("Add tab"),
|
|
43192
|
-
() => /* @__PURE__ */ jsx(SchemaComponentOptions, { scope: p.scope, components: x({}, p.components), children: /* @__PURE__ */ jsx(FormLayout, { layout: "vertical", children: /* @__PURE__ */ jsx(
|
|
43195
|
+
() => /* @__PURE__ */ jsx(SchemaComponentOptions, { scope: p.scope, components: x({}, p.components), children: /* @__PURE__ */ jsx(FormLayout, { layout: "vertical", children: /* @__PURE__ */ jsx(zIndexContext.Provider, { value: ICON_POPUP_Z_INDEX, children: /* @__PURE__ */ jsx(
|
|
43193
43196
|
SchemaComponent,
|
|
43194
43197
|
{
|
|
43195
43198
|
schema: {
|
|
@@ -43208,7 +43211,7 @@ const className1 = css`
|
|
|
43208
43211
|
}
|
|
43209
43212
|
}
|
|
43210
43213
|
}
|
|
43211
|
-
) }) }),
|
|
43214
|
+
) }) }) }),
|
|
43212
43215
|
m
|
|
43213
43216
|
).open({
|
|
43214
43217
|
initialValues: {}
|
|
@@ -44034,9 +44037,18 @@ function validate(e, t) {
|
|
|
44034
44037
|
function useBeforeUpload(e) {
|
|
44035
44038
|
const { t } = useTranslation();
|
|
44036
44039
|
return useCallback(
|
|
44037
|
-
(n) => {
|
|
44038
|
-
|
|
44039
|
-
|
|
44040
|
+
(n, o) => {
|
|
44041
|
+
var i, l;
|
|
44042
|
+
let r = n;
|
|
44043
|
+
if (!n.type) {
|
|
44044
|
+
const c = (l = (i = n.name) == null ? void 0 : i.match(/\.[^.]+$/)) == null ? void 0 : l[0];
|
|
44045
|
+
c && (r = new File([n], n.name, {
|
|
44046
|
+
type: mime.getType(c) || "application/octet-stream",
|
|
44047
|
+
lastModified: n.lastModified
|
|
44048
|
+
}));
|
|
44049
|
+
}
|
|
44050
|
+
const a = validate(r, e);
|
|
44051
|
+
return a ? (r.status = "error", r.response = t(a)) : r.status === "error" && (delete r.status, delete r.response), a ? !1 : r;
|
|
44040
44052
|
},
|
|
44041
44053
|
[e]
|
|
44042
44054
|
);
|
|
@@ -44151,38 +44163,56 @@ attachmentFileTypes.add({
|
|
|
44151
44163
|
return e.preview ? e.preview : e.url ? e.url : e.originFileObj ? URL.createObjectURL(e.originFileObj) : null;
|
|
44152
44164
|
},
|
|
44153
44165
|
Previewer({ index: e, list: t, onSwitchIndex: n }) {
|
|
44154
|
-
var
|
|
44155
|
-
const [o, r] = useState(0), a = useCallback(
|
|
44156
|
-
(
|
|
44157
|
-
|
|
44158
|
-
|
|
44159
|
-
|
|
44166
|
+
var p, m, h, g;
|
|
44167
|
+
const [o, r] = useState(0), a = useRef(!1), i = () => document.querySelector(".ril-image-current"), l = useCallback((f, C) => {
|
|
44168
|
+
if (!f)
|
|
44169
|
+
return;
|
|
44170
|
+
const b = f.style.transform || "", y = `${b.replace(/rotate\([^)]*\)/g, "").trim()} rotate(${(C % 360 + 360) % 360}deg)`.trim();
|
|
44171
|
+
b !== y && (a.current = !0, f.style.transform = y, f.style.transformOrigin = "center center", setTimeout(() => {
|
|
44172
|
+
a.current = !1;
|
|
44173
|
+
}, 0));
|
|
44174
|
+
}, []), c = useCallback(
|
|
44175
|
+
(f) => {
|
|
44176
|
+
f.preventDefault();
|
|
44177
|
+
const C = t[e];
|
|
44178
|
+
saveAs(C.url, `${C.title}${C.extname}`);
|
|
44160
44179
|
},
|
|
44161
44180
|
[e, t]
|
|
44162
|
-
),
|
|
44163
|
-
r((
|
|
44164
|
-
}, []),
|
|
44165
|
-
r((
|
|
44181
|
+
), u = useCallback(() => {
|
|
44182
|
+
r((f) => (f - 90) % 360);
|
|
44183
|
+
}, []), d = useCallback(() => {
|
|
44184
|
+
r((f) => (f + 90) % 360);
|
|
44166
44185
|
}, []);
|
|
44167
44186
|
return useEffect(() => {
|
|
44168
|
-
|
|
44169
|
-
|
|
44187
|
+
l(i(), o);
|
|
44188
|
+
}, [o, l]), useEffect(() => {
|
|
44189
|
+
const f = i();
|
|
44190
|
+
if (!f)
|
|
44170
44191
|
return;
|
|
44171
|
-
|
|
44172
|
-
const
|
|
44173
|
-
|
|
44174
|
-
|
|
44192
|
+
l(f, o);
|
|
44193
|
+
const C = new MutationObserver((b) => {
|
|
44194
|
+
a.current || b.some((S) => S.attributeName === "style") && l(f, o);
|
|
44195
|
+
});
|
|
44196
|
+
return C.observe(f, { attributes: !0, attributeFilter: ["style"] }), () => C.disconnect();
|
|
44197
|
+
}, [l, o, e]), /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
44175
44198
|
/* @__PURE__ */ jsx(LightBoxGlobalStyle, {}),
|
|
44176
44199
|
/* @__PURE__ */ jsx(
|
|
44177
44200
|
LightBox,
|
|
44178
44201
|
{
|
|
44179
|
-
mainSrc: (
|
|
44180
|
-
nextSrc: (
|
|
44181
|
-
prevSrc: (
|
|
44202
|
+
mainSrc: (p = t[e]) == null ? void 0 : p.url,
|
|
44203
|
+
nextSrc: (m = t[(e + 1) % t.length]) == null ? void 0 : m.url,
|
|
44204
|
+
prevSrc: (h = t[(e + t.length - 1) % t.length]) == null ? void 0 : h.url,
|
|
44182
44205
|
onCloseRequest: () => n(null),
|
|
44183
|
-
onMovePrevRequest: () =>
|
|
44184
|
-
|
|
44185
|
-
|
|
44206
|
+
onMovePrevRequest: () => {
|
|
44207
|
+
r(0), n((e + t.length - 1) % t.length);
|
|
44208
|
+
},
|
|
44209
|
+
onMoveNextRequest: () => {
|
|
44210
|
+
r(0), n((e + 1) % t.length);
|
|
44211
|
+
},
|
|
44212
|
+
onAfterOpen: () => {
|
|
44213
|
+
l(i(), o);
|
|
44214
|
+
},
|
|
44215
|
+
imageTitle: (g = t[e]) == null ? void 0 : g.title,
|
|
44186
44216
|
toolbarButtons: [
|
|
44187
44217
|
/* @__PURE__ */ jsx(
|
|
44188
44218
|
"button",
|
|
@@ -44192,7 +44222,7 @@ attachmentFileTypes.add({
|
|
|
44192
44222
|
title: "Download",
|
|
44193
44223
|
className: "ril-zoom-in ril__toolbarItemChild ril__builtinButton",
|
|
44194
44224
|
style: { fontSize: 22, background: "none", lineHeight: 1 },
|
|
44195
|
-
onClick:
|
|
44225
|
+
onClick: c,
|
|
44196
44226
|
children: /* @__PURE__ */ jsx(DownloadOutlined, {})
|
|
44197
44227
|
},
|
|
44198
44228
|
"preview-img"
|
|
@@ -44203,7 +44233,7 @@ attachmentFileTypes.add({
|
|
|
44203
44233
|
type: "button",
|
|
44204
44234
|
className: "ril-zoom-in ril__toolbarItemChild ril__builtinButton",
|
|
44205
44235
|
style: { fontSize: 22, background: "none", lineHeight: 1 },
|
|
44206
|
-
onClick:
|
|
44236
|
+
onClick: u,
|
|
44207
44237
|
children: /* @__PURE__ */ jsx(UndoOutlined, {})
|
|
44208
44238
|
},
|
|
44209
44239
|
"rotate-left"
|
|
@@ -44214,7 +44244,7 @@ attachmentFileTypes.add({
|
|
|
44214
44244
|
type: "button",
|
|
44215
44245
|
className: "ril-zoom-in ril__toolbarItemChild ril__builtinButton",
|
|
44216
44246
|
style: { fontSize: 22, background: "none", lineHeight: 1 },
|
|
44217
|
-
onClick:
|
|
44247
|
+
onClick: d,
|
|
44218
44248
|
children: /* @__PURE__ */ jsx(RedoOutlined, {})
|
|
44219
44249
|
},
|
|
44220
44250
|
"rotate-right"
|
|
@@ -87,4 +87,4 @@ export declare function toValueItem(data: any): any;
|
|
|
87
87
|
export declare const toItem: (file: any) => any;
|
|
88
88
|
export declare const toFileList: (fileList: any) => any[];
|
|
89
89
|
export declare function validate(file: any, rules: Record<string, any>): string;
|
|
90
|
-
export declare function useBeforeUpload(rules: any): (file: any) =>
|
|
90
|
+
export declare function useBeforeUpload(rules: any): (file: any, fileList: any) => any;
|