wargerm 0.5.5 → 0.5.6
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/dist/index.esm.js +61 -1
- package/dist/index.js +61 -1
- package/package.json +88 -88
package/dist/index.esm.js
CHANGED
@@ -7892,6 +7892,65 @@ var WForm = function WForm(props, ref) {
|
|
7892
7892
|
return filterObj(searchForm);
|
7893
7893
|
};
|
7894
7894
|
|
7895
|
+
var getFormValues = function getFormValues() {
|
7896
|
+
var searchForm = form.getFieldsValue();
|
7897
|
+
filterFormColumns.forEach(function (c) {
|
7898
|
+
if (c.search && c.search.transform) {
|
7899
|
+
var transformObj = c.search.transform(searchForm[c.dataIndex]);
|
7900
|
+
searchForm = _objectSpread2(_objectSpread2({}, searchForm), transformObj);
|
7901
|
+
|
7902
|
+
if (!transformObj[c.dataIndex]) {
|
7903
|
+
delete searchForm[c.dataIndex];
|
7904
|
+
}
|
7905
|
+
|
7906
|
+
return false;
|
7907
|
+
}
|
7908
|
+
|
7909
|
+
if (c.valueType && ['date', 'dateTime', 'dateMonth', 'dateYear', 'dateRange', 'dateTimeRange'].includes(c.valueType)) {
|
7910
|
+
if (c.valueType === 'date' && searchForm[c.dataIndex]) {
|
7911
|
+
var _c$fieldProps7;
|
7912
|
+
|
7913
|
+
searchForm[c.dataIndex] = searchForm[c.dataIndex] && hooks(searchForm[c.dataIndex]).format((c === null || c === void 0 ? void 0 : (_c$fieldProps7 = c.fieldProps) === null || _c$fieldProps7 === void 0 ? void 0 : _c$fieldProps7.format) || 'YYYY-MM-DD');
|
7914
|
+
}
|
7915
|
+
|
7916
|
+
if (c.valueType === 'dateTime' && searchForm[c.dataIndex]) {
|
7917
|
+
var _c$fieldProps8;
|
7918
|
+
|
7919
|
+
searchForm[c.dataIndex] = searchForm[c.dataIndex] && hooks(searchForm[c.dataIndex]).format((c === null || c === void 0 ? void 0 : (_c$fieldProps8 = c.fieldProps) === null || _c$fieldProps8 === void 0 ? void 0 : _c$fieldProps8.format) || 'YYYY-MM-DD HH:mm:ss');
|
7920
|
+
}
|
7921
|
+
|
7922
|
+
if (c.valueType === 'dateMonth' && searchForm[c.dataIndex]) {
|
7923
|
+
var _c$fieldProps9;
|
7924
|
+
|
7925
|
+
searchForm[c.dataIndex] = searchForm[c.dataIndex] && hooks(searchForm[c.dataIndex]).format((c === null || c === void 0 ? void 0 : (_c$fieldProps9 = c.fieldProps) === null || _c$fieldProps9 === void 0 ? void 0 : _c$fieldProps9.format) || 'YYYY-MM');
|
7926
|
+
}
|
7927
|
+
|
7928
|
+
if (c.valueType === 'dateYear' && searchForm[c.dataIndex]) {
|
7929
|
+
var _c$fieldProps10;
|
7930
|
+
|
7931
|
+
searchForm[c.dataIndex] = searchForm[c.dataIndex] && hooks(searchForm[c.dataIndex]).format((c === null || c === void 0 ? void 0 : (_c$fieldProps10 = c.fieldProps) === null || _c$fieldProps10 === void 0 ? void 0 : _c$fieldProps10.format) || 'YYYY');
|
7932
|
+
}
|
7933
|
+
|
7934
|
+
if (c.valueType === 'dateRange' && searchForm[c.dataIndex]) {
|
7935
|
+
searchForm[c.dataIndex] = searchForm[c.dataIndex].map(function (item) {
|
7936
|
+
var _c$fieldProps11;
|
7937
|
+
|
7938
|
+
return item && searchForm[c.dataIndex] && hooks(item).format((c === null || c === void 0 ? void 0 : (_c$fieldProps11 = c.fieldProps) === null || _c$fieldProps11 === void 0 ? void 0 : _c$fieldProps11.format) || 'YYYY-MM-DD');
|
7939
|
+
});
|
7940
|
+
}
|
7941
|
+
|
7942
|
+
if (c.valueType === 'dateTimeRange' && searchForm[c.dataIndex]) {
|
7943
|
+
searchForm[c.dataIndex] = searchForm[c.dataIndex].map(function (item) {
|
7944
|
+
var _c$fieldProps12;
|
7945
|
+
|
7946
|
+
return item && hooks(item).format((c === null || c === void 0 ? void 0 : (_c$fieldProps12 = c.fieldProps) === null || _c$fieldProps12 === void 0 ? void 0 : _c$fieldProps12.format) || 'YYYY-MM-DD HH:mm:ss');
|
7947
|
+
});
|
7948
|
+
}
|
7949
|
+
}
|
7950
|
+
});
|
7951
|
+
return filterObj(searchForm);
|
7952
|
+
};
|
7953
|
+
|
7895
7954
|
var handleRest = function handleRest() {
|
7896
7955
|
var _form$resetFields;
|
7897
7956
|
|
@@ -7926,7 +7985,8 @@ var WForm = function WForm(props, ref) {
|
|
7926
7985
|
handleSubmit: form.submit,
|
7927
7986
|
handleRest: handleRest,
|
7928
7987
|
resetFields: handleRest,
|
7929
|
-
setFieldsValue: setFieldsValue
|
7988
|
+
setFieldsValue: setFieldsValue,
|
7989
|
+
getFormValues: getFormValues
|
7930
7990
|
};
|
7931
7991
|
});
|
7932
7992
|
useEffect(function () {
|
package/dist/index.js
CHANGED
@@ -7951,6 +7951,65 @@ var WForm = function WForm(props, ref) {
|
|
7951
7951
|
return filterObj(searchForm);
|
7952
7952
|
};
|
7953
7953
|
|
7954
|
+
var getFormValues = function getFormValues() {
|
7955
|
+
var searchForm = form.getFieldsValue();
|
7956
|
+
filterFormColumns.forEach(function (c) {
|
7957
|
+
if (c.search && c.search.transform) {
|
7958
|
+
var transformObj = c.search.transform(searchForm[c.dataIndex]);
|
7959
|
+
searchForm = _objectSpread2(_objectSpread2({}, searchForm), transformObj);
|
7960
|
+
|
7961
|
+
if (!transformObj[c.dataIndex]) {
|
7962
|
+
delete searchForm[c.dataIndex];
|
7963
|
+
}
|
7964
|
+
|
7965
|
+
return false;
|
7966
|
+
}
|
7967
|
+
|
7968
|
+
if (c.valueType && ['date', 'dateTime', 'dateMonth', 'dateYear', 'dateRange', 'dateTimeRange'].includes(c.valueType)) {
|
7969
|
+
if (c.valueType === 'date' && searchForm[c.dataIndex]) {
|
7970
|
+
var _c$fieldProps7;
|
7971
|
+
|
7972
|
+
searchForm[c.dataIndex] = searchForm[c.dataIndex] && hooks(searchForm[c.dataIndex]).format((c === null || c === void 0 ? void 0 : (_c$fieldProps7 = c.fieldProps) === null || _c$fieldProps7 === void 0 ? void 0 : _c$fieldProps7.format) || 'YYYY-MM-DD');
|
7973
|
+
}
|
7974
|
+
|
7975
|
+
if (c.valueType === 'dateTime' && searchForm[c.dataIndex]) {
|
7976
|
+
var _c$fieldProps8;
|
7977
|
+
|
7978
|
+
searchForm[c.dataIndex] = searchForm[c.dataIndex] && hooks(searchForm[c.dataIndex]).format((c === null || c === void 0 ? void 0 : (_c$fieldProps8 = c.fieldProps) === null || _c$fieldProps8 === void 0 ? void 0 : _c$fieldProps8.format) || 'YYYY-MM-DD HH:mm:ss');
|
7979
|
+
}
|
7980
|
+
|
7981
|
+
if (c.valueType === 'dateMonth' && searchForm[c.dataIndex]) {
|
7982
|
+
var _c$fieldProps9;
|
7983
|
+
|
7984
|
+
searchForm[c.dataIndex] = searchForm[c.dataIndex] && hooks(searchForm[c.dataIndex]).format((c === null || c === void 0 ? void 0 : (_c$fieldProps9 = c.fieldProps) === null || _c$fieldProps9 === void 0 ? void 0 : _c$fieldProps9.format) || 'YYYY-MM');
|
7985
|
+
}
|
7986
|
+
|
7987
|
+
if (c.valueType === 'dateYear' && searchForm[c.dataIndex]) {
|
7988
|
+
var _c$fieldProps10;
|
7989
|
+
|
7990
|
+
searchForm[c.dataIndex] = searchForm[c.dataIndex] && hooks(searchForm[c.dataIndex]).format((c === null || c === void 0 ? void 0 : (_c$fieldProps10 = c.fieldProps) === null || _c$fieldProps10 === void 0 ? void 0 : _c$fieldProps10.format) || 'YYYY');
|
7991
|
+
}
|
7992
|
+
|
7993
|
+
if (c.valueType === 'dateRange' && searchForm[c.dataIndex]) {
|
7994
|
+
searchForm[c.dataIndex] = searchForm[c.dataIndex].map(function (item) {
|
7995
|
+
var _c$fieldProps11;
|
7996
|
+
|
7997
|
+
return item && searchForm[c.dataIndex] && hooks(item).format((c === null || c === void 0 ? void 0 : (_c$fieldProps11 = c.fieldProps) === null || _c$fieldProps11 === void 0 ? void 0 : _c$fieldProps11.format) || 'YYYY-MM-DD');
|
7998
|
+
});
|
7999
|
+
}
|
8000
|
+
|
8001
|
+
if (c.valueType === 'dateTimeRange' && searchForm[c.dataIndex]) {
|
8002
|
+
searchForm[c.dataIndex] = searchForm[c.dataIndex].map(function (item) {
|
8003
|
+
var _c$fieldProps12;
|
8004
|
+
|
8005
|
+
return item && hooks(item).format((c === null || c === void 0 ? void 0 : (_c$fieldProps12 = c.fieldProps) === null || _c$fieldProps12 === void 0 ? void 0 : _c$fieldProps12.format) || 'YYYY-MM-DD HH:mm:ss');
|
8006
|
+
});
|
8007
|
+
}
|
8008
|
+
}
|
8009
|
+
});
|
8010
|
+
return filterObj(searchForm);
|
8011
|
+
};
|
8012
|
+
|
7954
8013
|
var handleRest = function handleRest() {
|
7955
8014
|
var _form$resetFields;
|
7956
8015
|
|
@@ -7985,7 +8044,8 @@ var WForm = function WForm(props, ref) {
|
|
7985
8044
|
handleSubmit: form.submit,
|
7986
8045
|
handleRest: handleRest,
|
7987
8046
|
resetFields: handleRest,
|
7988
|
-
setFieldsValue: setFieldsValue
|
8047
|
+
setFieldsValue: setFieldsValue,
|
8048
|
+
getFormValues: getFormValues
|
7989
8049
|
};
|
7990
8050
|
});
|
7991
8051
|
React.useEffect(function () {
|
package/package.json
CHANGED
@@ -1,88 +1,88 @@
|
|
1
|
-
{
|
2
|
-
"private": false,
|
3
|
-
"name": "wargerm",
|
4
|
-
"version": "0.5.
|
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
|
-
"echarts": "^5.2.2",
|
55
|
-
"echarts-for-react": "^3.0.2",
|
56
|
-
"swiper": "^6.7.0",
|
57
|
-
"xgplayer": "^2.31.6",
|
58
|
-
"xgplayer-flv": "^2.5.1",
|
59
|
-
"xgplayer-flv.js": "^2.3.0",
|
60
|
-
"xgplayer-hls": "^2.5.2",
|
61
|
-
"xgplayer-hls.js": "^2.6.1"
|
62
|
-
},
|
63
|
-
"peerDependencies": {
|
64
|
-
"@ant-design/icons": ">=4.2.0",
|
65
|
-
"antd": ">=4.7.0",
|
66
|
-
"classnames": ">=2.2.0",
|
67
|
-
"echarts": "^5.2.2",
|
68
|
-
"echarts-for-react": "^3.0.2",
|
69
|
-
"lodash": ">=4.0.0",
|
70
|
-
"react": ">=17.0.0"
|
71
|
-
},
|
72
|
-
"devDependencies": {
|
73
|
-
"@ant-design/icons": "^4.6.4",
|
74
|
-
"@types/lodash": "^4.14.173",
|
75
|
-
"@types/react-dom": "^17.0.11",
|
76
|
-
"@umijs/test": "^3.0.5",
|
77
|
-
"antd": "^4.16.13",
|
78
|
-
"babel-plugin-import": "^1.13.3",
|
79
|
-
"classnames": "^2.3.1",
|
80
|
-
"dumi": "^1.1.31",
|
81
|
-
"father-build": "^1.19.1",
|
82
|
-
"gh-pages": "^3.0.0",
|
83
|
-
"lint-staged": "^10.0.7",
|
84
|
-
"prettier": "^1.19.1",
|
85
|
-
"react": "^16.12.0",
|
86
|
-
"yorkie": "^2.0.0"
|
87
|
-
}
|
88
|
-
}
|
1
|
+
{
|
2
|
+
"private": false,
|
3
|
+
"name": "wargerm",
|
4
|
+
"version": "0.5.6",
|
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
|
+
"echarts": "^5.2.2",
|
55
|
+
"echarts-for-react": "^3.0.2",
|
56
|
+
"swiper": "^6.7.0",
|
57
|
+
"xgplayer": "^2.31.6",
|
58
|
+
"xgplayer-flv": "^2.5.1",
|
59
|
+
"xgplayer-flv.js": "^2.3.0",
|
60
|
+
"xgplayer-hls": "^2.5.2",
|
61
|
+
"xgplayer-hls.js": "^2.6.1"
|
62
|
+
},
|
63
|
+
"peerDependencies": {
|
64
|
+
"@ant-design/icons": ">=4.2.0",
|
65
|
+
"antd": ">=4.7.0",
|
66
|
+
"classnames": ">=2.2.0",
|
67
|
+
"echarts": "^5.2.2",
|
68
|
+
"echarts-for-react": "^3.0.2",
|
69
|
+
"lodash": ">=4.0.0",
|
70
|
+
"react": ">=17.0.0"
|
71
|
+
},
|
72
|
+
"devDependencies": {
|
73
|
+
"@ant-design/icons": "^4.6.4",
|
74
|
+
"@types/lodash": "^4.14.173",
|
75
|
+
"@types/react-dom": "^17.0.11",
|
76
|
+
"@umijs/test": "^3.0.5",
|
77
|
+
"antd": "^4.16.13",
|
78
|
+
"babel-plugin-import": "^1.13.3",
|
79
|
+
"classnames": "^2.3.1",
|
80
|
+
"dumi": "^1.1.31",
|
81
|
+
"father-build": "^1.19.1",
|
82
|
+
"gh-pages": "^3.0.0",
|
83
|
+
"lint-staged": "^10.0.7",
|
84
|
+
"prettier": "^1.19.1",
|
85
|
+
"react": "^16.12.0",
|
86
|
+
"yorkie": "^2.0.0"
|
87
|
+
}
|
88
|
+
}
|