wargerm 0.5.8 → 0.5.11
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/components/TabelCard/example/demo1.d.ts +3 -0
- package/dist/index.esm.js +31 -9
- package/dist/index.js +31 -10
- package/dist/utils/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
@@ -45,7 +45,6 @@ import 'antd/es/tree-select/style';
|
|
45
45
|
import _TreeSelect from 'antd/es/tree-select';
|
46
46
|
import 'antd/es/cascader/style';
|
47
47
|
import _Cascader from 'antd/es/cascader';
|
48
|
-
import cloneDeep$1 from 'lodash/cloneDeep';
|
49
48
|
import CountUp from 'react-countup';
|
50
49
|
import { Swiper, SwiperSlide } from 'swiper/react';
|
51
50
|
import SwiperCore, { Pagination, Navigation, Autoplay, Virtual } from 'swiper';
|
@@ -585,7 +584,7 @@ var Index = WInput;
|
|
585
584
|
Index.TextArea = _Input.TextArea;
|
586
585
|
WInput.defaultProps = {};
|
587
586
|
|
588
|
-
var _excluded$1 = ["value", "onChange", "beforeUpload", "uploadButton", "maxCount", "
|
587
|
+
var _excluded$1 = ["value", "onChange", "beforeUpload", "uploadButton", "maxCount", "splitStr", "fetchMethod", "getFileList"];
|
589
588
|
|
590
589
|
function Index$1(_ref, ref) {
|
591
590
|
var value = _ref.value,
|
@@ -593,7 +592,9 @@ function Index$1(_ref, ref) {
|
|
593
592
|
beforeUpload = _ref.beforeUpload,
|
594
593
|
uploadButton = _ref.uploadButton,
|
595
594
|
maxCount = _ref.maxCount,
|
596
|
-
|
595
|
+
_ref$splitStr = _ref.splitStr,
|
596
|
+
splitStr = _ref$splitStr === void 0 ? ',' : _ref$splitStr,
|
597
|
+
fetchMethod = _ref.fetchMethod,
|
597
598
|
getFileList = _ref.getFileList,
|
598
599
|
props = _objectWithoutProperties(_ref, _excluded$1);
|
599
600
|
|
@@ -603,7 +604,7 @@ function Index$1(_ref, ref) {
|
|
603
604
|
setFileList = _useState2[1];
|
604
605
|
|
605
606
|
useEffect(function () {
|
606
|
-
setFileList(value ? value.split(
|
607
|
+
setFileList(value ? value.split(splitStr).map(function (url) {
|
607
608
|
return {
|
608
609
|
uid: Math.random().toString(36).slice(2, 36),
|
609
610
|
name: '',
|
@@ -683,7 +684,7 @@ function Index$1(_ref, ref) {
|
|
683
684
|
}
|
684
685
|
|
685
686
|
_context.next = 4;
|
686
|
-
return
|
687
|
+
return fetchMethod ? fetchMethod(file.originFileObj) : getBase64(file.originFileObj);
|
687
688
|
|
688
689
|
case 4:
|
689
690
|
url = _context.sent;
|
@@ -695,7 +696,7 @@ function Index$1(_ref, ref) {
|
|
695
696
|
case 6:
|
696
697
|
urls = newFileList.map(function (file) {
|
697
698
|
return file.url;
|
698
|
-
}).join(
|
699
|
+
}).join(splitStr);
|
699
700
|
onChange && onChange(urls);
|
700
701
|
setFileList(newFileList);
|
701
702
|
|
@@ -829,7 +830,7 @@ Index$4.Group = _Checkbox.Group;
|
|
829
830
|
/*
|
830
831
|
* @Author: lijin
|
831
832
|
* @Date: 2021-10-27 22:18:49
|
832
|
-
* @LastEditTime: 2022-
|
833
|
+
* @LastEditTime: 2022-08-09 09:35:23
|
833
834
|
* @LastEditors: lijin
|
834
835
|
* @Description:
|
835
836
|
* @FilePath: \wargerm-components\src\utils\index.ts
|
@@ -896,6 +897,27 @@ var calcWidth = function calcWidth(width) {
|
|
896
897
|
var calcHeight = function calcHeight(height) {
|
897
898
|
return document.body.clientHeight / 2160 * height;
|
898
899
|
};
|
900
|
+
/* eslint-disable no-param-reassign */
|
901
|
+
|
902
|
+
function deepCopy(target) {
|
903
|
+
if (Object.prototype.toString.call({}).slice(8, -1) == 'Object') {
|
904
|
+
var result = Array.isArray(target) ? [] : {}; // eslint-disable-next-line no-restricted-syntax
|
905
|
+
|
906
|
+
for (var key in target) {
|
907
|
+
var _target$key;
|
908
|
+
|
909
|
+
if (Object.prototype.toString.call(target).slice(8, -1) == 'Object' && !((_target$key = target[key]) === null || _target$key === void 0 ? void 0 : _target$key['$$typeof'])) {
|
910
|
+
result[key] = deepCopy(target[key]);
|
911
|
+
} else {
|
912
|
+
result[key] = target[key];
|
913
|
+
}
|
914
|
+
}
|
915
|
+
|
916
|
+
return result;
|
917
|
+
}
|
918
|
+
|
919
|
+
return target;
|
920
|
+
}
|
899
921
|
|
900
922
|
var _excluded$2 = ["className", "frameStyle", "style", "direction", "children"];
|
901
923
|
function FrameBox(_ref) {
|
@@ -7074,12 +7096,12 @@ var WForm = function WForm(props, ref) {
|
|
7074
7096
|
columnsFields = _useState4[0],
|
7075
7097
|
setColumnsFields = _useState4[1];
|
7076
7098
|
|
7077
|
-
var filterFormColumns =
|
7099
|
+
var filterFormColumns = deepCopy(columns).filter(function (c) {
|
7078
7100
|
return !c.hideInSearch || disabledHideInSearch;
|
7079
7101
|
}).sort(function (a, b) {
|
7080
7102
|
return (b.order || 0) - (a.order || 0);
|
7081
7103
|
});
|
7082
|
-
var filterExtraFormColumns =
|
7104
|
+
var filterExtraFormColumns = deepCopy(extraColumns || []).filter(function (c) {
|
7083
7105
|
return !c.hideInSearch || disabledHideInSearch;
|
7084
7106
|
}).sort(function (a, b) {
|
7085
7107
|
return (b.order || 0) - (a.order || 0);
|
package/dist/index.js
CHANGED
@@ -49,7 +49,6 @@ require('antd/es/tree-select/style');
|
|
49
49
|
var _TreeSelect = require('antd/es/tree-select');
|
50
50
|
require('antd/es/cascader/style');
|
51
51
|
var _Cascader = require('antd/es/cascader');
|
52
|
-
var cloneDeep = require('lodash/cloneDeep');
|
53
52
|
var CountUp = require('react-countup');
|
54
53
|
var react = require('swiper/react');
|
55
54
|
var SwiperCore = require('swiper');
|
@@ -112,7 +111,6 @@ var _Select__default = /*#__PURE__*/_interopDefaultLegacy(_Select);
|
|
112
111
|
var _Switch__default = /*#__PURE__*/_interopDefaultLegacy(_Switch);
|
113
112
|
var _TreeSelect__default = /*#__PURE__*/_interopDefaultLegacy(_TreeSelect);
|
114
113
|
var _Cascader__default = /*#__PURE__*/_interopDefaultLegacy(_Cascader);
|
115
|
-
var cloneDeep__default = /*#__PURE__*/_interopDefaultLegacy(cloneDeep);
|
116
114
|
var CountUp__default = /*#__PURE__*/_interopDefaultLegacy(CountUp);
|
117
115
|
var SwiperCore__default = /*#__PURE__*/_interopDefaultLegacy(SwiperCore);
|
118
116
|
var _Breadcrumb__default = /*#__PURE__*/_interopDefaultLegacy(_Breadcrumb);
|
@@ -646,7 +644,7 @@ var Index = WInput;
|
|
646
644
|
Index.TextArea = _Input__default['default'].TextArea;
|
647
645
|
WInput.defaultProps = {};
|
648
646
|
|
649
|
-
var _excluded$1 = ["value", "onChange", "beforeUpload", "uploadButton", "maxCount", "
|
647
|
+
var _excluded$1 = ["value", "onChange", "beforeUpload", "uploadButton", "maxCount", "splitStr", "fetchMethod", "getFileList"];
|
650
648
|
|
651
649
|
function Index$1(_ref, ref) {
|
652
650
|
var value = _ref.value,
|
@@ -654,7 +652,9 @@ function Index$1(_ref, ref) {
|
|
654
652
|
beforeUpload = _ref.beforeUpload,
|
655
653
|
uploadButton = _ref.uploadButton,
|
656
654
|
maxCount = _ref.maxCount,
|
657
|
-
|
655
|
+
_ref$splitStr = _ref.splitStr,
|
656
|
+
splitStr = _ref$splitStr === void 0 ? ',' : _ref$splitStr,
|
657
|
+
fetchMethod = _ref.fetchMethod,
|
658
658
|
getFileList = _ref.getFileList,
|
659
659
|
props = _objectWithoutProperties(_ref, _excluded$1);
|
660
660
|
|
@@ -664,7 +664,7 @@ function Index$1(_ref, ref) {
|
|
664
664
|
setFileList = _useState2[1];
|
665
665
|
|
666
666
|
React.useEffect(function () {
|
667
|
-
setFileList(value ? value.split(
|
667
|
+
setFileList(value ? value.split(splitStr).map(function (url) {
|
668
668
|
return {
|
669
669
|
uid: Math.random().toString(36).slice(2, 36),
|
670
670
|
name: '',
|
@@ -744,7 +744,7 @@ function Index$1(_ref, ref) {
|
|
744
744
|
}
|
745
745
|
|
746
746
|
_context.next = 4;
|
747
|
-
return
|
747
|
+
return fetchMethod ? fetchMethod(file.originFileObj) : getBase64(file.originFileObj);
|
748
748
|
|
749
749
|
case 4:
|
750
750
|
url = _context.sent;
|
@@ -756,7 +756,7 @@ function Index$1(_ref, ref) {
|
|
756
756
|
case 6:
|
757
757
|
urls = newFileList.map(function (file) {
|
758
758
|
return file.url;
|
759
|
-
}).join(
|
759
|
+
}).join(splitStr);
|
760
760
|
onChange && onChange(urls);
|
761
761
|
setFileList(newFileList);
|
762
762
|
|
@@ -890,7 +890,7 @@ Index$4.Group = _Checkbox__default['default'].Group;
|
|
890
890
|
/*
|
891
891
|
* @Author: lijin
|
892
892
|
* @Date: 2021-10-27 22:18:49
|
893
|
-
* @LastEditTime: 2022-
|
893
|
+
* @LastEditTime: 2022-08-09 09:35:23
|
894
894
|
* @LastEditors: lijin
|
895
895
|
* @Description:
|
896
896
|
* @FilePath: \wargerm-components\src\utils\index.ts
|
@@ -957,6 +957,27 @@ var calcWidth = function calcWidth(width) {
|
|
957
957
|
var calcHeight = function calcHeight(height) {
|
958
958
|
return document.body.clientHeight / 2160 * height;
|
959
959
|
};
|
960
|
+
/* eslint-disable no-param-reassign */
|
961
|
+
|
962
|
+
function deepCopy(target) {
|
963
|
+
if (Object.prototype.toString.call({}).slice(8, -1) == 'Object') {
|
964
|
+
var result = Array.isArray(target) ? [] : {}; // eslint-disable-next-line no-restricted-syntax
|
965
|
+
|
966
|
+
for (var key in target) {
|
967
|
+
var _target$key;
|
968
|
+
|
969
|
+
if (Object.prototype.toString.call(target).slice(8, -1) == 'Object' && !((_target$key = target[key]) === null || _target$key === void 0 ? void 0 : _target$key['$$typeof'])) {
|
970
|
+
result[key] = deepCopy(target[key]);
|
971
|
+
} else {
|
972
|
+
result[key] = target[key];
|
973
|
+
}
|
974
|
+
}
|
975
|
+
|
976
|
+
return result;
|
977
|
+
}
|
978
|
+
|
979
|
+
return target;
|
980
|
+
}
|
960
981
|
|
961
982
|
var _excluded$2 = ["className", "frameStyle", "style", "direction", "children"];
|
962
983
|
function FrameBox(_ref) {
|
@@ -7135,12 +7156,12 @@ var WForm = function WForm(props, ref) {
|
|
7135
7156
|
columnsFields = _useState4[0],
|
7136
7157
|
setColumnsFields = _useState4[1];
|
7137
7158
|
|
7138
|
-
var filterFormColumns =
|
7159
|
+
var filterFormColumns = deepCopy(columns).filter(function (c) {
|
7139
7160
|
return !c.hideInSearch || disabledHideInSearch;
|
7140
7161
|
}).sort(function (a, b) {
|
7141
7162
|
return (b.order || 0) - (a.order || 0);
|
7142
7163
|
});
|
7143
|
-
var filterExtraFormColumns =
|
7164
|
+
var filterExtraFormColumns = deepCopy(extraColumns || []).filter(function (c) {
|
7144
7165
|
return !c.hideInSearch || disabledHideInSearch;
|
7145
7166
|
}).sort(function (a, b) {
|
7146
7167
|
return (b.order || 0) - (a.order || 0);
|
package/dist/utils/index.d.ts
CHANGED
@@ -14,3 +14,4 @@ export declare function filterObj(obj: Record<string, any>): Record<string, any>
|
|
14
14
|
export declare function getArrayLayer(arr: any, attr: string | number, index?: number): number;
|
15
15
|
export declare const calcWidth: (width: number) => number;
|
16
16
|
export declare const calcHeight: (height: number) => number;
|
17
|
+
export declare function deepCopy(target: any): any;
|