wargerm 0.2.25 → 0.2.26

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.
@@ -11,8 +11,9 @@ export interface ColumnProps {
11
11
  hideInSearch?: boolean;
12
12
  search?: {
13
13
  transform?: (value: any) => Record<string, any>;
14
+ transformSetForm?: (value: any) => Record<string, any>;
14
15
  };
15
- valueType?: 'text' | 'textarea' | 'inputNumber' | 'select' | 'treeSelect' | 'date' | 'dateTime' | 'dateMonth' | 'dateYear' | 'dateRange' | 'dateTimeRange' | 'checkbox' | 'radio' | 'radioButton' | 'switch' | 'digit' | 'cascader' | 'image';
16
+ valueType?: 'text' | 'textarea' | 'inputNumber' | 'select' | 'treeSelect' | 'date' | 'dateTime' | 'dateMonth' | 'dateYear' | 'dateRange' | 'dateTimeRange' | 'checkbox' | 'radio' | 'radioButton' | 'switch' | 'digit' | 'cascader';
16
17
  valueEnum?: Record<string, any>;
17
18
  options?: Record<string, any>[];
18
19
  fieldProps?: Record<string, any>;
package/dist/index.esm.js CHANGED
@@ -8767,7 +8767,21 @@ var WForm = function WForm(props, ref) {
8767
8767
  };
8768
8768
 
8769
8769
  var setFieldsValue = function setFieldsValue(record) {
8770
- form.setFieldsValue(record);
8770
+ var setFieldsValues = _objectSpread2({}, record);
8771
+
8772
+ filterFormColumns.forEach(function (c) {
8773
+ if (c.search && c.search.transformSetForm) {
8774
+ var transformObj = c.search.transformSetForm(setFieldsValues[c.dataIndex]);
8775
+ setFieldsValues = _objectSpread2(_objectSpread2({}, setFieldsValues), transformObj);
8776
+
8777
+ if (!transformObj[c.dataIndex]) {
8778
+ delete setFieldsValues[c.dataIndex];
8779
+ }
8780
+
8781
+ return false;
8782
+ }
8783
+ });
8784
+ form.setFieldsValue(setFieldsValues);
8771
8785
  };
8772
8786
 
8773
8787
  useImperativeHandle(ref, function () {
package/dist/index.js CHANGED
@@ -8801,7 +8801,21 @@ var WForm = function WForm(props, ref) {
8801
8801
  };
8802
8802
 
8803
8803
  var setFieldsValue = function setFieldsValue(record) {
8804
- form.setFieldsValue(record);
8804
+ var setFieldsValues = _objectSpread2({}, record);
8805
+
8806
+ filterFormColumns.forEach(function (c) {
8807
+ if (c.search && c.search.transformSetForm) {
8808
+ var transformObj = c.search.transformSetForm(setFieldsValues[c.dataIndex]);
8809
+ setFieldsValues = _objectSpread2(_objectSpread2({}, setFieldsValues), transformObj);
8810
+
8811
+ if (!transformObj[c.dataIndex]) {
8812
+ delete setFieldsValues[c.dataIndex];
8813
+ }
8814
+
8815
+ return false;
8816
+ }
8817
+ });
8818
+ form.setFieldsValue(setFieldsValues);
8805
8819
  };
8806
8820
 
8807
8821
  React.useImperativeHandle(ref, function () {
package/package.json CHANGED
@@ -1,79 +1,79 @@
1
- {
2
- "private": false,
3
- "name": "wargerm",
4
- "version": "0.2.25",
5
- "scripts": {
6
- "dev": "dumi dev",
7
- "docs:build": "dumi build",
8
- "docs:deploy": "gh-pages -d docs-dist",
9
- "build": "father-build",
10
- "deploy": "npm run docs:build && npm run docs:deploy",
11
- "release": "npm run build && npm publish",
12
- "prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
13
- "test": "umi-test",
14
- "test:coverage": "umi-test --coverage"
15
- },
16
- "main": "dist/index.js",
17
- "module": "dist/index.esm.js",
18
- "unpkg": "dist/index.umd.min.js",
19
- "typings": "dist/index.d.ts",
20
- "author": "jinly2",
21
- "license": "MIT",
22
- "keywords": [
23
- "React",
24
- "Component"
25
- ],
26
- "gitHooks": {
27
- "pre-commit": "lint-staged"
28
- },
29
- "repository": {
30
- "type": "git",
31
- "url": "http://code.eblssmart.com/platform/web/wargerm-components.git",
32
- "branch": "main"
33
- },
34
- "files": [
35
- "dist",
36
- "es",
37
- "lib",
38
- "index.css"
39
- ],
40
- "lint-staged": {
41
- "*.{js,jsx,less,md,json}": [
42
- "prettier --write"
43
- ],
44
- "*.ts?(x)": [
45
- "prettier --parser=typescript --write"
46
- ]
47
- },
48
- "dependencies": {
49
- "@ant-design/pro-form": "^1.49.3",
50
- "@ant-design/pro-table": "^2.58.1",
51
- "animate.css": "^4.1.1",
52
- "react-countup": "^6.0.0",
53
- "react-dom": "^17.0.2",
54
- "swiper": "^6.7.0"
55
- },
56
- "peerDependencies": {
57
- "@ant-design/icons": ">=4.2.0",
58
- "antd": ">=4.7.0",
59
- "classnames": ">=2.2.0",
60
- "lodash": ">=4.0.0",
61
- "react": ">=17.0.0"
62
- },
63
- "devDependencies": {
64
- "@ant-design/icons": "^4.6.4",
65
- "@types/lodash": "^4.14.173",
66
- "@types/react-dom": "^17.0.11",
67
- "@umijs/test": "^3.0.5",
68
- "antd": "^4.16.13",
69
- "babel-plugin-import": "^1.13.3",
70
- "classnames": "^2.3.1",
71
- "dumi": "^1.1.31",
72
- "father-build": "^1.19.1",
73
- "gh-pages": "^3.0.0",
74
- "lint-staged": "^10.0.7",
75
- "prettier": "^1.19.1",
76
- "react": "^16.12.0",
77
- "yorkie": "^2.0.0"
78
- }
79
- }
1
+ {
2
+ "private": false,
3
+ "name": "wargerm",
4
+ "version": "0.2.26",
5
+ "scripts": {
6
+ "dev": "dumi dev",
7
+ "docs:build": "dumi build",
8
+ "docs:deploy": "gh-pages -d docs-dist",
9
+ "build": "father-build",
10
+ "deploy": "npm run docs:build && npm run docs:deploy",
11
+ "release": "npm run build && npm publish",
12
+ "prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
13
+ "test": "umi-test",
14
+ "test:coverage": "umi-test --coverage"
15
+ },
16
+ "main": "dist/index.js",
17
+ "module": "dist/index.esm.js",
18
+ "unpkg": "dist/index.umd.min.js",
19
+ "typings": "dist/index.d.ts",
20
+ "author": "jinly2",
21
+ "license": "MIT",
22
+ "keywords": [
23
+ "React",
24
+ "Component"
25
+ ],
26
+ "gitHooks": {
27
+ "pre-commit": "lint-staged"
28
+ },
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "http://code.eblssmart.com/platform/web/wargerm-components.git",
32
+ "branch": "main"
33
+ },
34
+ "files": [
35
+ "dist",
36
+ "es",
37
+ "lib",
38
+ "index.css"
39
+ ],
40
+ "lint-staged": {
41
+ "*.{js,jsx,less,md,json}": [
42
+ "prettier --write"
43
+ ],
44
+ "*.ts?(x)": [
45
+ "prettier --parser=typescript --write"
46
+ ]
47
+ },
48
+ "dependencies": {
49
+ "@ant-design/pro-form": "^1.49.3",
50
+ "@ant-design/pro-table": "^2.58.1",
51
+ "animate.css": "^4.1.1",
52
+ "react-countup": "^6.0.0",
53
+ "react-dom": "^17.0.2",
54
+ "swiper": "^6.7.0"
55
+ },
56
+ "peerDependencies": {
57
+ "@ant-design/icons": ">=4.2.0",
58
+ "antd": ">=4.7.0",
59
+ "classnames": ">=2.2.0",
60
+ "lodash": ">=4.0.0",
61
+ "react": ">=17.0.0"
62
+ },
63
+ "devDependencies": {
64
+ "@ant-design/icons": "^4.6.4",
65
+ "@types/lodash": "^4.14.173",
66
+ "@types/react-dom": "^17.0.11",
67
+ "@umijs/test": "^3.0.5",
68
+ "antd": "^4.16.13",
69
+ "babel-plugin-import": "^1.13.3",
70
+ "classnames": "^2.3.1",
71
+ "dumi": "^1.1.31",
72
+ "father-build": "^1.19.1",
73
+ "gh-pages": "^3.0.0",
74
+ "lint-staged": "^10.0.7",
75
+ "prettier": "^1.19.1",
76
+ "react": "^16.12.0",
77
+ "yorkie": "^2.0.0"
78
+ }
79
+ }