@chaoswise/ui 3.0.15 → 3.0.16
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/lib/Ace/diff.js +1 -0
- package/lib/Antd5/_util/scrollTo.js +3 -3
- package/lib/Antd5/anchor/Anchor.js +3 -3
- package/lib/Antd5/table/hooks/useFilter/FilterDropdown.js +6 -6
- package/lib/Antd5/table/hooks/useFilter/index.js +3 -3
- package/lib/Antd5/table/hooks/useLazyKVMap.js +3 -3
- package/lib/Antd5/table/hooks/useSelection.js +3 -3
- package/lib/Antd5/theme/useToken.js +4 -3
- package/lib/Badge/index.js +1 -1
- package/lib/CWCascader/rc-cascader/utils/warningPropsUtil.js +3 -3
- package/lib/CWColorPicker/SketchPicker/components/common/ColorWrap.js +1 -1
- package/lib/CWColorPicker/SketchPicker/components/common/Hue.js +1 -1
- package/lib/CWColorPicker/SketchPicker/components/common/Raised.js +1 -1
- package/lib/CWColorPicker/SketchPicker/components/common/Saturation.js +1 -1
- package/lib/CWColorPicker/SketchPicker/components/sketch/index.js +1 -1
- package/lib/CWColorPicker/SketchPicker/helpers/color.js +1 -1
- package/lib/CWRangePicker/Refresh/index.style.js +10 -5
- package/lib/CWRangePicker/index.js +2 -2
- package/lib/CWRangePicker/index.style.js +0 -6
- package/lib/CWTree/index.js +3 -3
- package/lib/CWTree/utils/index.js +4 -3
- package/lib/Collapse/index.js +1 -1
- package/lib/ConfigProvider/ConfigProvider.js +7 -4
- package/lib/DateRangePicker/index.js +2 -0
- package/lib/Documentation/Tocify.js +1 -1
- package/lib/Drawer/index.js +1 -1
- package/lib/EchartsArea/index.js +2 -2
- package/lib/EchartsBar/index.js +2 -2
- package/lib/EchartsBarRow/index.js +0 -2
- package/lib/EchartsBase/index.js +14 -14
- package/lib/EchartsLine/index.js +2 -2
- package/lib/EchartsPie/index.js +2 -3
- package/lib/EchartsRing/index.js +2 -2
- package/lib/Empty/index.js +1 -1
- package/lib/FilterDropDown/DragList.js +2 -1
- package/lib/Flow/BasicLayout/Chain.js +3 -3
- package/lib/Flow/BasicLayout/util.js +3 -3
- package/lib/Form/FormItem.js +3 -1
- package/lib/Form/hook/useForm3.js +3 -3
- package/lib/Form/index.js +1 -1
- package/lib/Formily/FieldList/index.js +43 -0
- package/lib/Formily/Form/index.js +2 -0
- package/lib/Formily/FormButtonGroup/index.js +2 -0
- package/lib/Formily/FormItem/index.js +90 -0
- package/lib/Formily/FormItem/items/Checkbox.js +13 -0
- package/lib/Formily/FormItem/items/DatePicker.js +121 -0
- package/lib/Formily/FormItem/items/Input.js +13 -0
- package/lib/Formily/FormItem/items/NumberPicker.js +9 -0
- package/lib/Formily/FormItem/items/Password.js +70 -0
- package/lib/Formily/FormItem/items/Radio.js +13 -0
- package/lib/Formily/FormItem/items/Range.js +82 -0
- package/lib/Formily/FormItem/items/Rating.js +8 -0
- package/lib/Formily/FormItem/items/Select.js +8 -0
- package/lib/Formily/FormItem/items/Switch.js +9 -0
- package/lib/Formily/FormItem/items/Tansfer.js +9 -0
- package/lib/Formily/FormItem/items/TimePicker.js +44 -0
- package/lib/Formily/FormItem/items/Upload.js +260 -0
- package/lib/Formily/FormItem/items/formItemWrapper.js +17 -0
- package/lib/Formily/FormItem/items/shared.js +140 -0
- package/lib/Formily/FormPath/index.js +2 -0
- package/lib/Formily/MegaLayout/index.js +24 -0
- package/lib/Formily/Reset/index.js +2 -0
- package/lib/Formily/Submit/index.js +2 -0
- package/lib/Formily/context.js +3 -0
- package/lib/Formily/formily/index.js +22 -0
- package/lib/Formily/index.js +5 -0
- package/lib/Formily/subscribeFields/index.js +46 -0
- package/lib/Header/UserSetting/utils.js +5 -4
- package/lib/Joyride/List.js +3 -3
- package/lib/Joyride/index.js +3 -3
- package/lib/Modal/Modal.js +1 -1
- package/lib/Modal/index.js +1 -1
- package/lib/Pagination/index.js +1 -1
- package/lib/QuickTransfer/index.js +5 -5
- package/lib/QuickTransfer/utils.js +32 -23
- package/lib/RangePicker/components/ExtraQuickSelect.js +51 -0
- package/lib/RangePicker/components/ExtraTimeFooter.js +71 -0
- package/lib/RangePicker/index.js +469 -2
- package/lib/RangePicker/index.style.js +110 -0
- package/lib/RangePicker/utils/index.js +171 -0
- package/lib/ScrollLoad/index.js +7 -2
- package/lib/SiderMenu/index.js +14 -14
- package/lib/SingleSpa/system/systemjs-css.js +3 -3
- package/lib/ThemeProvider/main.js +1 -0
- package/lib/TimeRangeSlider/Refresh/index.js +163 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/assets/Limit.js +126 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/assets/Limit.svg +50 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/assets/LimitAreaSvg.js +110 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/components/BottomSlider/BottomPlaceholder.js +99 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/components/BottomSlider/BottomTimeDateProcess.js +36 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/components/BottomSlider/index.js +56 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/components/TopSlider/TopDateProcess.js +32 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/components/TopSlider/TopPlaceholder.js +54 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/components/TopSlider/index.js +47 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/hooks/useHover.js +31 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/hooks/useMouse.js +410 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/index.js +72 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/utils/index.js +255 -0
- package/lib/TimeRangeSlider/TimeSpan/index.js +93 -0
- package/lib/TimeRangeSlider/assets/Calendar.js +15 -0
- package/lib/TimeRangeSlider/assets/Calendar2.js +15 -0
- package/lib/TimeRangeSlider/assets/Recover.js +18 -0
- package/lib/TimeRangeSlider/assets/Refresh1.js +14 -0
- package/lib/TimeRangeSlider/assets/Refresh2.js +14 -0
- package/lib/TimeRangeSlider/assets/Refresh3.js +14 -0
- package/lib/TimeRangeSlider/assets/live.js +19 -0
- package/lib/TimeRangeSlider/assets/more.js +23 -0
- package/lib/TimeRangeSlider/index.js +562 -0
- package/lib/TimeRangeSlider/locale/en_US.js +31 -0
- package/lib/TimeRangeSlider/locale/index.js +11 -0
- package/lib/TimeRangeSlider/locale/zh_CN.js +31 -0
- package/lib/TimeRangeSlider/locale/zh_TW.js +31 -0
- package/lib/TimeRangeSlider/styles/index.style.js +64 -0
- package/lib/TimeRangeSlider/styles/refresh.style.js +38 -0
- package/lib/TimeRangeSlider/styles/timeRangeSliderBottom.style.js +125 -0
- package/lib/TimeRangeSlider/styles/timeRangeSliderTop.style.js +81 -0
- package/lib/TimeRangeSlider/styles/timeSpan.style.js +22 -0
- package/lib/TimeRangeSlider/utils/index.js +737 -0
- package/lib/UniversalLayout/index.js +4 -4
- package/lib/antd-style/factories/createThemeProvider/AntdProvider.js +5 -1
- package/lib/antd-style/functions/extractStaticStyle.js +1 -1
- package/lib/antd-style/hooks/useAntdToken.js +1 -1
- package/lib/antd-style/hooks/useResponsive.js +1 -1
- package/lib/antd-style/utils/css.js +3 -2
- package/lib/locales/en_US.json +1 -1
- package/lib/locales/zh_CN.json +1 -1
- package/lib/locales/zh_TW.json +1 -1
- package/lib/useLocale/index.js +20 -0
- package/package.json +5 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import _Radio from "@chaoswise/ui/lib/Radio";
|
|
2
|
+
import { connect } from '@formily/react-schema-renderer';
|
|
3
|
+
import { transformDataSourceKey, mapStyledProps, mapTextComponent } from './shared';
|
|
4
|
+
import formItemWrapper from './formItemWrapper';
|
|
5
|
+
export var Radio = connect({
|
|
6
|
+
valueName: 'checked',
|
|
7
|
+
getProps: mapStyledProps
|
|
8
|
+
})(formItemWrapper(_Radio));
|
|
9
|
+
Radio.Group = connect({
|
|
10
|
+
getProps: mapStyledProps,
|
|
11
|
+
getComponent: mapTextComponent
|
|
12
|
+
})(transformDataSourceKey(formItemWrapper(_Radio.Group), 'options'));
|
|
13
|
+
export default Radio;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import _Slider from "@chaoswise/ui/lib/Slider";
|
|
2
|
+
var __extends = this && this.__extends || function () {
|
|
3
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
4
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
5
|
+
__proto__: []
|
|
6
|
+
} instanceof Array && function (d, b) {
|
|
7
|
+
d.__proto__ = b;
|
|
8
|
+
} || function (d, b) {
|
|
9
|
+
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
10
|
+
};
|
|
11
|
+
return _extendStatics(d, b);
|
|
12
|
+
};
|
|
13
|
+
return function (d, b) {
|
|
14
|
+
_extendStatics(d, b);
|
|
15
|
+
function __() {
|
|
16
|
+
this.constructor = d;
|
|
17
|
+
}
|
|
18
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
19
|
+
};
|
|
20
|
+
}();
|
|
21
|
+
var __assign = this && this.__assign || function () {
|
|
22
|
+
__assign = Object.assign || function (t) {
|
|
23
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
24
|
+
s = arguments[i];
|
|
25
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
26
|
+
}
|
|
27
|
+
return t;
|
|
28
|
+
};
|
|
29
|
+
return __assign.apply(this, arguments);
|
|
30
|
+
};
|
|
31
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
32
|
+
var t = {};
|
|
33
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
34
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
35
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
36
|
+
}
|
|
37
|
+
return t;
|
|
38
|
+
};
|
|
39
|
+
import React from 'react';
|
|
40
|
+
import { connect } from '@formily/react-schema-renderer';
|
|
41
|
+
import { mapStyledProps } from './shared';
|
|
42
|
+
import formItemWrapper from './formItemWrapper';
|
|
43
|
+
var WrapperSlider = formItemWrapper(_Slider);
|
|
44
|
+
export var Range = connect({
|
|
45
|
+
defaultProps: {
|
|
46
|
+
style: {
|
|
47
|
+
width: 320
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
getProps: mapStyledProps
|
|
51
|
+
})(function (_super) {
|
|
52
|
+
__extends(Component, _super);
|
|
53
|
+
function Component() {
|
|
54
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
55
|
+
}
|
|
56
|
+
Component.prototype.render = function () {
|
|
57
|
+
var _a = this.props,
|
|
58
|
+
onChange = _a.onChange,
|
|
59
|
+
value = _a.value,
|
|
60
|
+
min = _a.min,
|
|
61
|
+
max = _a.max,
|
|
62
|
+
marks = _a.marks,
|
|
63
|
+
rest = __rest(_a, ["onChange", "value", "min", "max", "marks"]);
|
|
64
|
+
var newMarks = {};
|
|
65
|
+
if (Array.isArray(marks)) {
|
|
66
|
+
marks.forEach(function (mark) {
|
|
67
|
+
newMarks[mark] = mark;
|
|
68
|
+
});
|
|
69
|
+
} else {
|
|
70
|
+
newMarks = marks;
|
|
71
|
+
}
|
|
72
|
+
return /*#__PURE__*/React.createElement(WrapperSlider, __assign({}, rest, {
|
|
73
|
+
onChange: onChange,
|
|
74
|
+
value: value,
|
|
75
|
+
min: min,
|
|
76
|
+
max: max,
|
|
77
|
+
marks: newMarks
|
|
78
|
+
}));
|
|
79
|
+
};
|
|
80
|
+
return Component;
|
|
81
|
+
}(React.Component));
|
|
82
|
+
export default Range;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import _Rate from "@chaoswise/ui/lib/Rate";
|
|
2
|
+
import { connect } from '@formily/react-schema-renderer';
|
|
3
|
+
import { mapStyledProps } from './shared';
|
|
4
|
+
import formItemWrapper from './formItemWrapper';
|
|
5
|
+
export var Rating = connect({
|
|
6
|
+
getProps: mapStyledProps
|
|
7
|
+
})(formItemWrapper(_Rate));
|
|
8
|
+
export default Rating;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { connect } from '@formily/react-schema-renderer';
|
|
2
|
+
import { Select as AntdSelect, mapStyledProps, mapTextComponent } from './shared';
|
|
3
|
+
import formItemWrapper from './formItemWrapper';
|
|
4
|
+
export var Select = connect({
|
|
5
|
+
getProps: mapStyledProps,
|
|
6
|
+
getComponent: mapTextComponent
|
|
7
|
+
})(formItemWrapper(AntdSelect));
|
|
8
|
+
export default Select;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import _Switch from "@chaoswise/ui/lib/Switch";
|
|
2
|
+
import { connect } from '@formily/react-schema-renderer';
|
|
3
|
+
import { acceptEnum, mapStyledProps } from './shared';
|
|
4
|
+
import formItemWrapper from './formItemWrapper';
|
|
5
|
+
export var Switch = connect({
|
|
6
|
+
valueName: 'checked',
|
|
7
|
+
getProps: mapStyledProps
|
|
8
|
+
})(acceptEnum(formItemWrapper(_Switch)));
|
|
9
|
+
export default Switch;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import _Transfer from "@chaoswise/ui/lib/Transfer";
|
|
2
|
+
import { connect } from '@formily/react-schema-renderer';
|
|
3
|
+
import { mapStyledProps } from './shared';
|
|
4
|
+
import formItemWrapper from './formItemWrapper';
|
|
5
|
+
export var Transfer = connect({
|
|
6
|
+
getProps: mapStyledProps,
|
|
7
|
+
valueName: 'targetKeys'
|
|
8
|
+
})(formItemWrapper(_Transfer));
|
|
9
|
+
export default Transfer;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import _TimePicker from "@chaoswise/ui/lib/TimePicker";
|
|
2
|
+
import { connect } from '@formily/react-schema-renderer';
|
|
3
|
+
import moment from 'moment';
|
|
4
|
+
import { mapStyledProps, mapTextComponent, compose, isStr, isArr } from './shared';
|
|
5
|
+
import formItemWrapper from './formItemWrapper';
|
|
6
|
+
var transformMoment = function transformMoment(value) {
|
|
7
|
+
if (value === '') return undefined;
|
|
8
|
+
return value;
|
|
9
|
+
};
|
|
10
|
+
var mapMomentValue = function mapMomentValue(props, fieldProps) {
|
|
11
|
+
var value = props.value,
|
|
12
|
+
_a = props.format,
|
|
13
|
+
format = _a === void 0 ? 'HH:mm:ss' : _a;
|
|
14
|
+
if (!fieldProps.editable) return props;
|
|
15
|
+
try {
|
|
16
|
+
if (isStr(value) && value) {
|
|
17
|
+
props.value = moment(value, format);
|
|
18
|
+
} else if (isArr(value) && value.length) {
|
|
19
|
+
props.value = value.map(function (item) {
|
|
20
|
+
return item && moment(item, format) || '';
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
} catch (e) {
|
|
24
|
+
throw new Error(e);
|
|
25
|
+
}
|
|
26
|
+
return props;
|
|
27
|
+
};
|
|
28
|
+
export var TimePicker = connect({
|
|
29
|
+
getValueFromEvent: function getValueFromEvent(_, value) {
|
|
30
|
+
return transformMoment(value);
|
|
31
|
+
},
|
|
32
|
+
getProps: compose(mapStyledProps, mapMomentValue),
|
|
33
|
+
getComponent: mapTextComponent
|
|
34
|
+
})(formItemWrapper(_TimePicker));
|
|
35
|
+
TimePicker.RangePicker = connect({
|
|
36
|
+
getValueFromEvent: function getValueFromEvent(_, _a) {
|
|
37
|
+
var startDate = _a[0],
|
|
38
|
+
endDate = _a[1];
|
|
39
|
+
return [transformMoment(startDate), transformMoment(endDate)];
|
|
40
|
+
},
|
|
41
|
+
getProps: compose(mapStyledProps, mapMomentValue),
|
|
42
|
+
getComponent: mapTextComponent
|
|
43
|
+
})(formItemWrapper(_TimePicker.RangePicker));
|
|
44
|
+
export default TimePicker;
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import _Button from "@chaoswise/ui/lib/Button";
|
|
2
|
+
import _Upload from "@chaoswise/ui/lib/Upload";
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
var __makeTemplateObject = this && this.__makeTemplateObject || function (cooked, raw) {
|
|
5
|
+
if (Object.defineProperty) {
|
|
6
|
+
Object.defineProperty(cooked, "raw", {
|
|
7
|
+
value: raw
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
cooked.raw = raw;
|
|
11
|
+
}
|
|
12
|
+
return cooked;
|
|
13
|
+
};
|
|
14
|
+
var __extends = this && this.__extends || function () {
|
|
15
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
16
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
17
|
+
__proto__: []
|
|
18
|
+
} instanceof Array && function (d, b) {
|
|
19
|
+
d.__proto__ = b;
|
|
20
|
+
} || function (d, b) {
|
|
21
|
+
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
22
|
+
};
|
|
23
|
+
return _extendStatics(d, b);
|
|
24
|
+
};
|
|
25
|
+
return function (d, b) {
|
|
26
|
+
_extendStatics(d, b);
|
|
27
|
+
function __() {
|
|
28
|
+
this.constructor = d;
|
|
29
|
+
}
|
|
30
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
31
|
+
};
|
|
32
|
+
}();
|
|
33
|
+
var __assign = this && this.__assign || function () {
|
|
34
|
+
__assign = Object.assign || function (t) {
|
|
35
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
36
|
+
s = arguments[i];
|
|
37
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
38
|
+
}
|
|
39
|
+
return t;
|
|
40
|
+
};
|
|
41
|
+
return __assign.apply(this, arguments);
|
|
42
|
+
};
|
|
43
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
44
|
+
var t = {};
|
|
45
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
46
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
47
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
48
|
+
}
|
|
49
|
+
return t;
|
|
50
|
+
};
|
|
51
|
+
var __spreadArrays = this && this.__spreadArrays || function () {
|
|
52
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
53
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
|
|
54
|
+
return r;
|
|
55
|
+
};
|
|
56
|
+
var _a;
|
|
57
|
+
import React from 'react';
|
|
58
|
+
import { connect } from '@formily/react-schema-renderer';
|
|
59
|
+
import styled from 'styled-components';
|
|
60
|
+
import { toArr, isArr, isEqual, mapStyledProps } from './shared';
|
|
61
|
+
import { LoadingOutlined, PlusOutlined, UploadOutlined, InboxOutlined } from '@ant-design/icons';
|
|
62
|
+
import formItemWrapper from './formItemWrapper';
|
|
63
|
+
var UploadDragger = formItemWrapper(_Upload.Dragger);
|
|
64
|
+
var AntdUpload = formItemWrapper(_Upload);
|
|
65
|
+
var exts = [{
|
|
66
|
+
ext: /\.docx?$/i,
|
|
67
|
+
icon: '//img.alicdn.com/tfs/TB1n8jfr1uSBuNjy1XcXXcYjFXa-200-200.png'
|
|
68
|
+
}, {
|
|
69
|
+
ext: /\.pptx?$/i,
|
|
70
|
+
icon: '//img.alicdn.com/tfs/TB1ItgWr_tYBeNjy1XdXXXXyVXa-200-200.png'
|
|
71
|
+
}, {
|
|
72
|
+
ext: /\.jpe?g$/i,
|
|
73
|
+
icon: '//img.alicdn.com/tfs/TB1wrT5r9BYBeNjy0FeXXbnmFXa-200-200.png'
|
|
74
|
+
}, {
|
|
75
|
+
ext: /\.pdf$/i,
|
|
76
|
+
icon: '//img.alicdn.com/tfs/TB1GwD8r9BYBeNjy0FeXXbnmFXa-200-200.png'
|
|
77
|
+
}, {
|
|
78
|
+
ext: /\.png$/i,
|
|
79
|
+
icon: '//img.alicdn.com/tfs/TB1BHT5r9BYBeNjy0FeXXbnmFXa-200-200.png'
|
|
80
|
+
}, {
|
|
81
|
+
ext: /\.eps$/i,
|
|
82
|
+
icon: '//img.alicdn.com/tfs/TB1G_iGrVOWBuNjy0FiXXXFxVXa-200-200.png'
|
|
83
|
+
}, {
|
|
84
|
+
ext: /\.ai$/i,
|
|
85
|
+
icon: '//img.alicdn.com/tfs/TB1B2cVr_tYBeNjy1XdXXXXyVXa-200-200.png'
|
|
86
|
+
}, {
|
|
87
|
+
ext: /\.gif$/i,
|
|
88
|
+
icon: '//img.alicdn.com/tfs/TB1DTiGrVOWBuNjy0FiXXXFxVXa-200-200.png'
|
|
89
|
+
}, {
|
|
90
|
+
ext: /\.svg$/i,
|
|
91
|
+
icon: '//img.alicdn.com/tfs/TB1uUm9rY9YBuNjy0FgXXcxcXXa-200-200.png'
|
|
92
|
+
}, {
|
|
93
|
+
ext: /\.xlsx?$/i,
|
|
94
|
+
icon: '//img.alicdn.com/tfs/TB1any1r1OSBuNjy0FdXXbDnVXa-200-200.png'
|
|
95
|
+
}, {
|
|
96
|
+
ext: /\.psd?$/i,
|
|
97
|
+
icon: '//img.alicdn.com/tfs/TB1_nu1r1OSBuNjy0FdXXbDnVXa-200-200.png'
|
|
98
|
+
}, {
|
|
99
|
+
ext: /\.(wav|aif|aiff|au|mp1|mp2|mp3|ra|rm|ram|mid|rmi)$/i,
|
|
100
|
+
icon: '//img.alicdn.com/tfs/TB1jPvwr49YBuNjy0FfXXXIsVXa-200-200.png'
|
|
101
|
+
}, {
|
|
102
|
+
ext: /\.(avi|wmv|mpg|mpeg|vob|dat|3gp|mp4|mkv|rm|rmvb|mov|flv)$/i,
|
|
103
|
+
icon: '//img.alicdn.com/tfs/TB1FrT5r9BYBeNjy0FeXXbnmFXa-200-200.png'
|
|
104
|
+
}, {
|
|
105
|
+
ext: /\.(zip|rar|arj|z|gz|iso|jar|ace|tar|uue|dmg|pkg|lzh|cab)$/i,
|
|
106
|
+
icon: '//img.alicdn.com/tfs/TB10jmfr29TBuNjy0FcXXbeiFXa-200-200.png'
|
|
107
|
+
}, {
|
|
108
|
+
ext: /\.[^.]+$/i,
|
|
109
|
+
icon: '//img.alicdn.com/tfs/TB10.R4r3mTBuNjy1XbXXaMrVXa-200-200.png'
|
|
110
|
+
}];
|
|
111
|
+
var UploadPlaceholder = styled(function (props) {
|
|
112
|
+
return /*#__PURE__*/React.createElement("div", null, props.loading ? /*#__PURE__*/React.createElement(LoadingOutlined, null) : /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("div", {
|
|
113
|
+
className: 'ant-upload-text'
|
|
114
|
+
}, "\u4E0A\u4F20"));
|
|
115
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
|
|
116
|
+
var testOpts = function testOpts(ext, options) {
|
|
117
|
+
if (options && isArr(options.include)) {
|
|
118
|
+
return options.include.some(function (url) {
|
|
119
|
+
return ext.test(url);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
if (options && isArr(options.exclude)) {
|
|
123
|
+
return !options.exclude.some(function (url) {
|
|
124
|
+
return ext.test(url);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
return true;
|
|
128
|
+
};
|
|
129
|
+
var getImageByUrl = function getImageByUrl(url, options) {
|
|
130
|
+
for (var i = 0; i < exts.length; i++) {
|
|
131
|
+
if (exts[i].ext.test(url) && testOpts(exts[i].ext, options)) {
|
|
132
|
+
return exts[i].icon || url;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return url;
|
|
136
|
+
};
|
|
137
|
+
var normalizeFileList = function normalizeFileList(fileList) {
|
|
138
|
+
if (fileList && fileList.length) {
|
|
139
|
+
return fileList.map(function (file) {
|
|
140
|
+
return __assign(__assign({
|
|
141
|
+
uid: file.uid,
|
|
142
|
+
status: file.status,
|
|
143
|
+
name: file.name,
|
|
144
|
+
url: file.downloadURL || file.imgURL || file.url
|
|
145
|
+
}, file.response), {
|
|
146
|
+
thumbUrl: file.imgURL || getImageByUrl(file.downloadURL || file.url, {
|
|
147
|
+
exclude: ['.png', '.jpg', '.jpeg', '.gif']
|
|
148
|
+
})
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
return [];
|
|
153
|
+
};
|
|
154
|
+
var shallowClone = function shallowClone(val) {
|
|
155
|
+
var result = isArr(val) ? __spreadArrays(val) : _typeof(val) === 'object' ? __assign({}, val) : val;
|
|
156
|
+
if (isArr(result)) {
|
|
157
|
+
result = result.map(function (item) {
|
|
158
|
+
return __assign(__assign({}, item), {
|
|
159
|
+
uid: item.uid || Math.random().toFixed(16).slice(2, 10)
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
return result;
|
|
164
|
+
};
|
|
165
|
+
export var Upload = connect({
|
|
166
|
+
getProps: mapStyledProps
|
|
167
|
+
})((_a = function (_super) {
|
|
168
|
+
__extends(Uploader, _super);
|
|
169
|
+
function Uploader(props) {
|
|
170
|
+
var _this = _super.call(this, props) || this;
|
|
171
|
+
_this.onRemoveHandler = function (file) {
|
|
172
|
+
var value = _this.state.value;
|
|
173
|
+
var fileList = [];
|
|
174
|
+
value.forEach(function (item) {
|
|
175
|
+
if (item.uid !== file.uid) {
|
|
176
|
+
fileList.push(item);
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
_this.props.onChange(fileList);
|
|
180
|
+
};
|
|
181
|
+
_this.onChangeHandler = function (_a) {
|
|
182
|
+
var fileList = _a.fileList;
|
|
183
|
+
var onChange = _this.props.onChange;
|
|
184
|
+
fileList = toArr(fileList);
|
|
185
|
+
if (fileList.every(function (file) {
|
|
186
|
+
if (file.status === 'done' || file.imgURL || file.downloadURL || file.url || file.thumbUrl) return true;
|
|
187
|
+
if (file.response) {
|
|
188
|
+
if (file.response.imgURL || file.response.downloadURL || file.response.url || file.response.thumbUrl) return true;
|
|
189
|
+
}
|
|
190
|
+
return false;
|
|
191
|
+
}) && fileList.length) {
|
|
192
|
+
fileList = normalizeFileList(fileList);
|
|
193
|
+
_this.setState({
|
|
194
|
+
value: fileList
|
|
195
|
+
}, function () {
|
|
196
|
+
onChange(fileList.length > 0 ? fileList : undefined);
|
|
197
|
+
});
|
|
198
|
+
} else {
|
|
199
|
+
_this.setState({
|
|
200
|
+
value: fileList
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
_this.state = {
|
|
205
|
+
value: shallowClone(toArr(props.value))
|
|
206
|
+
};
|
|
207
|
+
return _this;
|
|
208
|
+
}
|
|
209
|
+
Uploader.prototype.componentDidUpdate = function (preProps) {
|
|
210
|
+
if (this.props.value && !isEqual(this.props.value, preProps.value)) {
|
|
211
|
+
this.setState({
|
|
212
|
+
value: shallowClone(this.props.value)
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
Uploader.prototype.render = function () {
|
|
217
|
+
var _a = this.props,
|
|
218
|
+
listType = _a.listType,
|
|
219
|
+
locale = _a.locale,
|
|
220
|
+
onChange = _a.onChange,
|
|
221
|
+
value = _a.value,
|
|
222
|
+
others = __rest(_a, ["listType", "locale", "onChange", "value"]);
|
|
223
|
+
if (listType.indexOf('card') > -1) {
|
|
224
|
+
return /*#__PURE__*/React.createElement(AntdUpload, __assign({}, others, {
|
|
225
|
+
fileList: this.state.value,
|
|
226
|
+
onChange: this.onChangeHandler,
|
|
227
|
+
onRemove: this.onRemoveHandler,
|
|
228
|
+
listType: 'picture-card'
|
|
229
|
+
}), /*#__PURE__*/React.createElement(UploadPlaceholder, null));
|
|
230
|
+
}
|
|
231
|
+
if (listType.indexOf('dragger') > -1) {
|
|
232
|
+
return /*#__PURE__*/React.createElement(UploadDragger, __assign({}, others, {
|
|
233
|
+
fileList: this.state.value,
|
|
234
|
+
onChange: this.onChangeHandler,
|
|
235
|
+
onRemove: this.onRemoveHandler,
|
|
236
|
+
listType: listType.indexOf('image') > -1 ? 'picture' : 'text'
|
|
237
|
+
}), /*#__PURE__*/React.createElement("p", {
|
|
238
|
+
className: 'ant-upload-drag-icon'
|
|
239
|
+
}, /*#__PURE__*/React.createElement(InboxOutlined, null)), /*#__PURE__*/React.createElement("p", {
|
|
240
|
+
className: 'ant-upload-text'
|
|
241
|
+
}, "\u62D6\u62FD\u4E0A\u4F20"));
|
|
242
|
+
}
|
|
243
|
+
return /*#__PURE__*/React.createElement(AntdUpload, __assign({}, others, {
|
|
244
|
+
fileList: this.state.value,
|
|
245
|
+
onChange: this.onChangeHandler,
|
|
246
|
+
onRemove: this.onRemoveHandler,
|
|
247
|
+
listType: listType
|
|
248
|
+
}), /*#__PURE__*/React.createElement(_Button, {
|
|
249
|
+
// style: { margin: '0 0 10px' }
|
|
250
|
+
}, /*#__PURE__*/React.createElement(UploadOutlined, null), locale && locale.uploadText || '上传文件'));
|
|
251
|
+
};
|
|
252
|
+
return Uploader;
|
|
253
|
+
}(React.Component), _a.defaultProps = {
|
|
254
|
+
action: 'https://www.easy-mock.com/mock/5b713974309d0d7d107a74a3/alifd/upload',
|
|
255
|
+
listType: 'text',
|
|
256
|
+
multiple: true,
|
|
257
|
+
className: 'antd-uploader'
|
|
258
|
+
}, _a));
|
|
259
|
+
export default Upload;
|
|
260
|
+
var templateObject_1;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import _FormItemWrapper from "@chaoswise/ui/lib/FormItemWrapper";
|
|
2
|
+
var _excluded = ["iconOption"];
|
|
3
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
5
|
+
import React from 'react';
|
|
6
|
+
var formItemWrapper = function formItemWrapper(Com) {
|
|
7
|
+
var Wrapper = function Wrapper(_ref) {
|
|
8
|
+
var _ref$iconOption = _ref.iconOption,
|
|
9
|
+
iconOption = _ref$iconOption === void 0 ? {} : _ref$iconOption,
|
|
10
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
11
|
+
return /*#__PURE__*/React.createElement(_FormItemWrapper, {
|
|
12
|
+
iconOption: iconOption
|
|
13
|
+
}, /*#__PURE__*/React.createElement(Com, props));
|
|
14
|
+
};
|
|
15
|
+
return Wrapper;
|
|
16
|
+
};
|
|
17
|
+
export default formItemWrapper;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import _CWSelect from "@chaoswise/ui/lib/CWSelect";
|
|
2
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
|
+
var __makeTemplateObject = this && this.__makeTemplateObject || function (cooked, raw) {
|
|
4
|
+
if (Object.defineProperty) {
|
|
5
|
+
Object.defineProperty(cooked, "raw", {
|
|
6
|
+
value: raw
|
|
7
|
+
});
|
|
8
|
+
} else {
|
|
9
|
+
cooked.raw = raw;
|
|
10
|
+
}
|
|
11
|
+
return cooked;
|
|
12
|
+
};
|
|
13
|
+
var __assign = this && this.__assign || function () {
|
|
14
|
+
__assign = Object.assign || function (t) {
|
|
15
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
16
|
+
s = arguments[i];
|
|
17
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
};
|
|
21
|
+
return __assign.apply(this, arguments);
|
|
22
|
+
};
|
|
23
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
24
|
+
var t = {};
|
|
25
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
26
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
27
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
28
|
+
}
|
|
29
|
+
return t;
|
|
30
|
+
};
|
|
31
|
+
var __spreadArrays = this && this.__spreadArrays || function () {
|
|
32
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
33
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
|
|
34
|
+
return r;
|
|
35
|
+
};
|
|
36
|
+
import React from 'react';
|
|
37
|
+
import { mapTextComponent, mapStyledProps, normalizeCol } from '@formily/antd';
|
|
38
|
+
import styled from 'styled-components';
|
|
39
|
+
import { isArr, FormPath } from '@formily/shared';
|
|
40
|
+
export * from '@formily/shared';
|
|
41
|
+
export var compose = function compose() {
|
|
42
|
+
var args = [];
|
|
43
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
44
|
+
args[_i] = arguments[_i];
|
|
45
|
+
}
|
|
46
|
+
return function (payload) {
|
|
47
|
+
var extra = [];
|
|
48
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
49
|
+
extra[_i - 1] = arguments[_i];
|
|
50
|
+
}
|
|
51
|
+
return args.reduce(function (buf, fn) {
|
|
52
|
+
return buf !== undefined ? fn.apply(void 0, __spreadArrays([buf], extra)) : fn.apply(void 0, __spreadArrays([payload], extra));
|
|
53
|
+
}, payload);
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
var createEnum = function createEnum(enums) {
|
|
57
|
+
if (isArr(enums)) {
|
|
58
|
+
return enums.map(function (item) {
|
|
59
|
+
if (_typeof(item) === 'object') {
|
|
60
|
+
return __assign({}, item);
|
|
61
|
+
} else {
|
|
62
|
+
return {
|
|
63
|
+
label: item,
|
|
64
|
+
value: item
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
return [];
|
|
70
|
+
};
|
|
71
|
+
export var Select = styled(function (props) {
|
|
72
|
+
var _a = props.dataSource,
|
|
73
|
+
dataSource = _a === void 0 ? [] : _a,
|
|
74
|
+
_onChange = props.onChange,
|
|
75
|
+
others = __rest(props, ["dataSource", "onChange"]);
|
|
76
|
+
var children = createEnum(dataSource).map(function (item) {
|
|
77
|
+
var label = item.label,
|
|
78
|
+
value = item.value,
|
|
79
|
+
others = __rest(item, ["label", "value"]);
|
|
80
|
+
return /*#__PURE__*/React.createElement(_CWSelect.Option, __assign({
|
|
81
|
+
key: value
|
|
82
|
+
}, others, {
|
|
83
|
+
title: label,
|
|
84
|
+
value: value
|
|
85
|
+
}), label);
|
|
86
|
+
});
|
|
87
|
+
return /*#__PURE__*/React.createElement(_CWSelect, __assign({
|
|
88
|
+
className: props.className
|
|
89
|
+
}, others, {
|
|
90
|
+
onChange: function onChange(value, options) {
|
|
91
|
+
_onChange(value, isArr(options) ? options.map(function (item) {
|
|
92
|
+
return __assign(__assign({}, item), {
|
|
93
|
+
props: undefined
|
|
94
|
+
});
|
|
95
|
+
}) : __assign(__assign({}, options), {
|
|
96
|
+
props: undefined
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
}), children);
|
|
100
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n min-width: 100px;\n width: 100%;\n"], ["\n min-width: 100px;\n width: 100%;\n"])));
|
|
101
|
+
export var acceptEnum = function acceptEnum(component) {
|
|
102
|
+
return function (_a) {
|
|
103
|
+
var dataSource = _a.dataSource,
|
|
104
|
+
others = __rest(_a, ["dataSource"]);
|
|
105
|
+
if (dataSource) {
|
|
106
|
+
return /*#__PURE__*/React.createElement(Select, __assign({
|
|
107
|
+
dataSource: dataSource
|
|
108
|
+
}, others));
|
|
109
|
+
} else {
|
|
110
|
+
return /*#__PURE__*/React.createElement(component, others);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
export var transformDataSourceKey = function transformDataSourceKey(component, dataSourceKey) {
|
|
115
|
+
return function (_a) {
|
|
116
|
+
var _b;
|
|
117
|
+
var dataSource = _a.dataSource,
|
|
118
|
+
others = __rest(_a, ["dataSource"]);
|
|
119
|
+
return /*#__PURE__*/React.createElement(component, __assign((_b = {}, _b[dataSourceKey] = dataSource, _b), others));
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
export var createMatchUpdate = function createMatchUpdate(name, path) {
|
|
123
|
+
return function (targetName, targetPath, callback) {
|
|
124
|
+
if (targetName || targetPath) {
|
|
125
|
+
if (targetName) {
|
|
126
|
+
if (FormPath.parse(targetName).matchAliasGroup(name, path)) {
|
|
127
|
+
callback();
|
|
128
|
+
}
|
|
129
|
+
} else if (targetPath) {
|
|
130
|
+
if (FormPath.parse(targetPath).matchAliasGroup(name, path)) {
|
|
131
|
+
callback();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
} else {
|
|
135
|
+
callback();
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
export { mapTextComponent, mapStyledProps, normalizeCol };
|
|
140
|
+
var templateObject_1;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { MegaLayout } from '@formily/antd-components';
|
|
10
|
+
import LayoutContext from '../context';
|
|
11
|
+
function CWMegaLayout(props) {
|
|
12
|
+
return /*#__PURE__*/React.createElement(LayoutContext.Provider, {
|
|
13
|
+
value: _objectSpread({
|
|
14
|
+
labelAlign: 'left'
|
|
15
|
+
}, props)
|
|
16
|
+
}, /*#__PURE__*/React.createElement(MegaLayout, _extends({
|
|
17
|
+
grid: true,
|
|
18
|
+
columns: 2,
|
|
19
|
+
autoRow: true,
|
|
20
|
+
labelWidth: 110,
|
|
21
|
+
labelAlign: "left"
|
|
22
|
+
}, props)));
|
|
23
|
+
}
|
|
24
|
+
export default CWMegaLayout;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
+
import * as allAntd from '@formily/antd';
|
|
8
|
+
import * as allAntdComponents from '@formily/antd-components';
|
|
9
|
+
var formily = {};
|
|
10
|
+
Object.entries(allAntd).forEach(function (_ref) {
|
|
11
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
12
|
+
key = _ref2[0],
|
|
13
|
+
value = _ref2[1];
|
|
14
|
+
formily[key] = value;
|
|
15
|
+
});
|
|
16
|
+
Object.entries(allAntdComponents).forEach(function (_ref3) {
|
|
17
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
18
|
+
key = _ref4[0],
|
|
19
|
+
value = _ref4[1];
|
|
20
|
+
formily[key] = value;
|
|
21
|
+
});
|
|
22
|
+
export default formily;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as FormItem } from './FormItem';
|
|
2
|
+
export { default as MegaLayout } from './MegaLayout';
|
|
3
|
+
export { default as FieldList } from './FieldList';
|
|
4
|
+
export { Form, FormButtonGroup, Submit, Reset, FormPath } from '@formily/antd';
|
|
5
|
+
export { default as subscribeFields } from './subscribeFields';
|