@zat-design/sisyphus-react 4.6.1 → 4.6.2
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/README.md +1 -1
- package/dist/index.esm.css +1 -1
- package/dist/less.esm.css +1 -1
- package/es/ProEditTable/style/index.less +6 -0
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +10 -8
- package/es/ProForm/components/combination/FormList/components/TabsFields.d.ts +15 -0
- package/es/ProForm/components/combination/FormList/components/TabsFields.js +269 -0
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +12 -46
- package/es/ProForm/components/combination/FormList/index.js +19 -0
- package/es/ProForm/components/combination/FormList/propsType.d.ts +1 -1
- package/es/ProForm/components/combination/FormList/style/index.less +107 -10
- package/es/ProForm/components/combination/FormList/toolbarActions.d.ts +14 -0
- package/es/ProForm/components/combination/FormList/toolbarActions.js +47 -0
- package/es/locale/en_US.d.ts +1 -0
- package/es/locale/en_US.js +1 -0
- package/es/locale/zh_CN.d.ts +1 -0
- package/es/locale/zh_CN.js +1 -0
- package/es/style/theme/tokens.less +3 -3
- package/es/tokens.js +3 -3
- package/package.json +4 -2
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import isFunction from "lodash/isFunction";
|
|
2
|
+
const defaultToolbarActions = [{ type: "add" }];
|
|
3
|
+
const FORM_LIST_ACTION_ABORT = Symbol("FORM_LIST_ACTION_ABORT");
|
|
4
|
+
const normalizeToolbarActions = (toolbarProps) => {
|
|
5
|
+
const actions = toolbarProps == null ? void 0 : toolbarProps.map((item) => ({
|
|
6
|
+
...item,
|
|
7
|
+
type: item.actionType || item.type
|
|
8
|
+
}));
|
|
9
|
+
if (!(actions == null ? void 0 : actions.some((item) => item.type === "add"))) {
|
|
10
|
+
return actions ? [...actions, ...defaultToolbarActions] : defaultToolbarActions;
|
|
11
|
+
}
|
|
12
|
+
return actions;
|
|
13
|
+
};
|
|
14
|
+
const isToolbarActionVisible = (item, form, namePath) => {
|
|
15
|
+
if (item.show === false)
|
|
16
|
+
return false;
|
|
17
|
+
if (isFunction(item.show)) {
|
|
18
|
+
return item.show(form.getFieldValue(namePath), { namePath, form });
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
};
|
|
22
|
+
const executeToolbarAdd = async ({
|
|
23
|
+
action,
|
|
24
|
+
form,
|
|
25
|
+
namePath,
|
|
26
|
+
operation
|
|
27
|
+
}) => {
|
|
28
|
+
const value = form.getFieldValue(namePath);
|
|
29
|
+
const index = (value == null ? void 0 : value.length) || 0;
|
|
30
|
+
const callback = action.onClick || action.onHandle;
|
|
31
|
+
const data = await (callback == null ? void 0 : callback(value, { operation, form, namePath, index }));
|
|
32
|
+
if (callback && data !== true && !data)
|
|
33
|
+
return false;
|
|
34
|
+
const insertIndex = typeof action.addIndex === "function" ? action.addIndex(value, { namePath, form, operation, index }) : action.addIndex;
|
|
35
|
+
if (insertIndex !== void 0) {
|
|
36
|
+
operation.add(data, insertIndex);
|
|
37
|
+
} else {
|
|
38
|
+
operation.add(data);
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
FORM_LIST_ACTION_ABORT,
|
|
44
|
+
executeToolbarAdd,
|
|
45
|
+
isToolbarActionVisible,
|
|
46
|
+
normalizeToolbarActions
|
|
47
|
+
};
|
package/es/locale/en_US.d.ts
CHANGED
package/es/locale/en_US.js
CHANGED
package/es/locale/zh_CN.d.ts
CHANGED
package/es/locale/zh_CN.js
CHANGED
|
@@ -44,6 +44,7 @@ var zh_CN_default = {
|
|
|
44
44
|
completeText: "请完整输入",
|
|
45
45
|
halfRuleText: "请输入第({total})个表单的值",
|
|
46
46
|
formListActions: ["新增", "删除", "复制", "上移", "下移", "新增一行", "点击添加"],
|
|
47
|
+
formListTabsAdd: "新增一列",
|
|
47
48
|
formListConfirmMessage: "确认删除吗?",
|
|
48
49
|
noData: "暂无数据",
|
|
49
50
|
moreItems: "更多{count}项...",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
@zaui-table-header-bg: var(--zaui-table-header-bg; #f2f3f5);
|
|
48
48
|
@zaui-table-strip-bg: var(--zaui-table-strip-bg; #fafafa);
|
|
49
49
|
@zaui-table-hover-bg: var(--zaui-table-hover-bg; #fafafa);
|
|
50
|
-
@zaui-table-selected-bg: var(--zaui-table-hover-bg #fafafa);
|
|
51
|
-
@zaui-table-selected-hover-bg: var(--zaui-table-hover-bg #fafafa);
|
|
52
|
-
@zaui-table-nested-bg: var(--zaui-table-nested-bg #fafcfe);
|
|
50
|
+
@zaui-table-selected-bg: var(--zaui-table-hover-bg; #fafafa);
|
|
51
|
+
@zaui-table-selected-hover-bg: var(--zaui-table-hover-bg; #fafafa);
|
|
52
|
+
@zaui-table-nested-bg: var(--zaui-table-nested-bg; #fafcfe);
|
|
53
53
|
@zaui-contract-bg: var(--zaui-contract-bg; #fffaa1); // 对比背景色
|
|
54
54
|
@zaui-contract-bg-add: var(--zaui-contract-bg-add; #d2fff4); // 新增对比背景色
|
|
55
55
|
@zaui-form-required-after: var(--zaui-form-required-after; inline);
|
package/es/tokens.js
CHANGED
|
@@ -47,9 +47,9 @@ const tokens = {
|
|
|
47
47
|
"@zaui-table-header-bg": "var(--zaui-table-header-bg, #f2f3f5)",
|
|
48
48
|
"@zaui-table-strip-bg": "var(--zaui-table-strip-bg, #fafafa)",
|
|
49
49
|
"@zaui-table-hover-bg": "var(--zaui-table-hover-bg, #fafafa)",
|
|
50
|
-
"@zaui-table-selected-bg": "var(--zaui-table-hover-bg #fafafa)",
|
|
51
|
-
"@zaui-table-selected-hover-bg": "var(--zaui-table-hover-bg #fafafa)",
|
|
52
|
-
"@zaui-table-nested-bg": "var(--zaui-table-nested-bg #FAFCFE)",
|
|
50
|
+
"@zaui-table-selected-bg": "var(--zaui-table-hover-bg, #fafafa)",
|
|
51
|
+
"@zaui-table-selected-hover-bg": "var(--zaui-table-hover-bg, #fafafa)",
|
|
52
|
+
"@zaui-table-nested-bg": "var(--zaui-table-nested-bg, #FAFCFE)",
|
|
53
53
|
"@zaui-form-required-after": "var(--zaui-form-required-after, inline)",
|
|
54
54
|
"@zaui-form-required-before": "var(--zaui-form-required-before, none)",
|
|
55
55
|
"@zaui-form-label-width": "var(--zaui-form-label-width, 130px)",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zat-design/sisyphus-react",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -63,7 +63,8 @@
|
|
|
63
63
|
"scripts": {
|
|
64
64
|
"analyze": "ANALYZE=1 dumi build",
|
|
65
65
|
"build:demo": "father build && node ./scripts/build-esm.mjs",
|
|
66
|
-
"build": "npm run build:demo && npm run build:types && mv dist/index.min.css dist/index.esm.css && mv dist/less.min.css dist/less.esm.css
|
|
66
|
+
"build:package": "npm run build:demo && npm run build:types && mv dist/index.min.css dist/index.esm.css && mv dist/less.min.css dist/less.esm.css",
|
|
67
|
+
"build": "npm run build:package && npm run build:ai-meta",
|
|
67
68
|
"build:types": "tsc -p tsconfig.build.json",
|
|
68
69
|
"build:ai-meta": "node ./scripts/build-ai-meta.mjs",
|
|
69
70
|
"check:ai-meta": "npm run build:ai-meta && cd packages/sisyphus-react-mcp && npm run check",
|
|
@@ -90,6 +91,7 @@
|
|
|
90
91
|
"test": "umi-test",
|
|
91
92
|
"test:coverage": "umi-test --coverage",
|
|
92
93
|
"test:coverage:focused": "jest --config=jest.coverage.focused.js --coverage",
|
|
94
|
+
"test:coverage:focused:95": "COVERAGE_THRESHOLD=95 jest --config=jest.coverage.focused.js --coverage",
|
|
93
95
|
"coverage:report": "node ./scripts/coverage-gap-report.mjs --target=90 --scope=full",
|
|
94
96
|
"coverage:gate": "node ./scripts/coverage-directory-gate.mjs",
|
|
95
97
|
"tsc": "tsc --noEmit"
|