@pisell/materials 1.0.2 → 1.0.3
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/es/components/auto-complete/index.d.ts +3 -0
- package/es/components/auto-complete/index.js +4 -0
- package/es/components/button/index.d.ts +3 -0
- package/es/components/button/index.js +15 -0
- package/es/components/calendar/index.d.ts +3 -0
- package/es/components/calendar/index.js +4 -0
- package/es/components/cascader/index.d.ts +3 -0
- package/es/components/cascader/index.js +4 -0
- package/es/components/checkbox/index.d.ts +3 -0
- package/es/components/checkbox/index.js +5 -0
- package/es/components/config-provider/index.d.ts +4 -0
- package/es/components/config-provider/index.js +30 -0
- package/es/components/date-picker/index.d.ts +3 -0
- package/es/components/date-picker/index.js +7 -0
- package/es/components/drawer/index.d.ts +2 -0
- package/es/components/drawer/index.js +13 -0
- package/es/components/dropdown/index.d.ts +3 -0
- package/es/components/dropdown/index.js +13 -0
- package/es/components/form/index.d.ts +8 -0
- package/es/components/form/index.js +132 -0
- package/es/components/icon/index.d.ts +12 -0
- package/es/components/icon/index.js +40 -0
- package/es/components/input/index.d.ts +3 -0
- package/es/components/input/index.js +12 -0
- package/es/components/modal/index.d.ts +2 -0
- package/es/components/modal/index.js +18 -0
- package/es/components/radio/index.d.ts +3 -0
- package/es/components/radio/index.js +5 -0
- package/es/components/select/index.d.ts +3 -0
- package/es/components/select/index.js +4 -0
- package/es/components/skeleton/index.d.ts +3 -0
- package/es/components/skeleton/index.js +5 -0
- package/es/components/slider/index.d.ts +3 -0
- package/es/components/slider/index.js +16 -0
- package/es/components/table/index.d.ts +3 -0
- package/es/components/table/index.js +12 -0
- package/es/components/tabs/index.d.ts +11 -0
- package/es/components/tabs/index.js +93 -0
- package/es/components/time-picker/index.d.ts +3 -0
- package/es/components/time-picker/index.js +4 -0
- package/es/components/tree-select/index.d.ts +2 -0
- package/es/components/tree-select/index.js +6 -0
- package/es/components/upload/index.d.ts +3 -0
- package/es/components/upload/index.js +4 -0
- package/{src/index.tsx → es/index.d.ts} +2 -80
- package/es/index.js +85 -0
- package/es/utils/hoc.d.ts +17 -0
- package/es/utils/hoc.js +80 -0
- package/es/utils/warning.d.ts +1 -0
- package/es/utils/warning.js +6 -0
- package/lib/components/auto-complete/index.d.ts +3 -0
- package/lib/components/auto-complete/index.js +28 -0
- package/lib/components/button/index.d.ts +3 -0
- package/lib/components/button/index.js +45 -0
- package/lib/components/calendar/index.d.ts +3 -0
- package/lib/components/calendar/index.js +32 -0
- package/lib/components/cascader/index.d.ts +3 -0
- package/lib/components/cascader/index.js +28 -0
- package/lib/components/checkbox/index.d.ts +3 -0
- package/lib/components/checkbox/index.js +29 -0
- package/lib/components/config-provider/index.d.ts +4 -0
- package/lib/components/config-provider/index.js +54 -0
- package/lib/components/date-picker/index.d.ts +3 -0
- package/lib/components/date-picker/index.js +41 -0
- package/lib/components/drawer/index.d.ts +2 -0
- package/lib/components/drawer/index.js +45 -0
- package/lib/components/dropdown/index.d.ts +3 -0
- package/lib/components/dropdown/index.js +45 -0
- package/lib/components/form/index.d.ts +8 -0
- package/lib/components/form/index.js +114 -0
- package/lib/components/icon/index.d.ts +12 -0
- package/lib/components/icon/index.js +52 -0
- package/lib/components/input/index.d.ts +3 -0
- package/lib/components/input/index.js +38 -0
- package/lib/components/modal/index.d.ts +2 -0
- package/lib/components/modal/index.js +50 -0
- package/lib/components/radio/index.d.ts +3 -0
- package/lib/components/radio/index.js +29 -0
- package/lib/components/select/index.d.ts +3 -0
- package/lib/components/select/index.js +28 -0
- package/lib/components/skeleton/index.d.ts +3 -0
- package/lib/components/skeleton/index.js +29 -0
- package/lib/components/slider/index.d.ts +3 -0
- package/lib/components/slider/index.js +47 -0
- package/lib/components/table/index.d.ts +3 -0
- package/lib/components/table/index.js +41 -0
- package/lib/components/tabs/index.d.ts +11 -0
- package/lib/components/tabs/index.js +92 -0
- package/lib/components/time-picker/index.d.ts +3 -0
- package/lib/components/time-picker/index.js +31 -0
- package/lib/components/tree-select/index.d.ts +2 -0
- package/lib/components/tree-select/index.js +40 -0
- package/lib/components/upload/index.d.ts +3 -0
- package/lib/components/upload/index.js +28 -0
- package/lib/index.d.ts +63 -0
- package/lib/index.js +225 -0
- package/lib/utils/hoc.d.ts +17 -0
- package/lib/utils/hoc.js +101 -0
- package/lib/utils/warning.d.ts +1 -0
- package/lib/utils/warning.js +31 -0
- package/package.json +10 -2
- package/.fatherrc.ts +0 -7
- package/.tmp/assets-daily.json +0 -93
- package/.tmp/assets-dev.json +0 -93
- package/.tmp/assets-prod.json +0 -93
- package/.tmp/default.view.js +0 -24
- package/.tmp/index.jsx +0 -279
- package/.tmp/meta.js +0 -251
- package/.tmp/preview.jsx +0 -72
- package/.tmp/view.js +0 -25
- package/CHANGELOG.md +0 -13
- package/build.lowcode.js +0 -46
- package/src/components/auto-complete/index.tsx +0 -6
- package/src/components/button/index.tsx +0 -12
- package/src/components/calendar/index.tsx +0 -10
- package/src/components/cascader/index.tsx +0 -6
- package/src/components/checkbox/index.tsx +0 -7
- package/src/components/config-provider/index.tsx +0 -27
- package/src/components/date-picker/index.tsx +0 -22
- package/src/components/drawer/index.tsx +0 -13
- package/src/components/dropdown/index.tsx +0 -13
- package/src/components/form/index.tsx +0 -97
- package/src/components/icon/index.tsx +0 -34
- package/src/components/input/index.tsx +0 -18
- package/src/components/modal/index.tsx +0 -18
- package/src/components/radio/index.tsx +0 -7
- package/src/components/select/index.tsx +0 -6
- package/src/components/skeleton/index.tsx +0 -6
- package/src/components/slider/index.tsx +0 -18
- package/src/components/table/index.tsx +0 -10
- package/src/components/tabs/index.tsx +0 -67
- package/src/components/time-picker/index.tsx +0 -9
- package/src/components/tree-select/index.tsx +0 -8
- package/src/components/upload/index.tsx +0 -5
- package/src/utils/hoc.tsx +0 -92
- package/src/utils/warning.ts +0 -3
- package/tsconfig.json +0 -14
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
import { Button as OriginalButton } from 'antd';
|
|
4
|
+
var Button = function Button(props, ref) {
|
|
5
|
+
var _props$href;
|
|
6
|
+
var innerProps = {};
|
|
7
|
+
if (!((_props$href = props.href) !== null && _props$href !== void 0 && _props$href.trim()) || props.__designMode === 'design') {
|
|
8
|
+
// 解决低代码编辑器中按钮设置href属性造成按钮点击重定向问题
|
|
9
|
+
innerProps.href = undefined;
|
|
10
|
+
}
|
|
11
|
+
return /*#__PURE__*/React.createElement(OriginalButton, _extends({}, props, innerProps, {
|
|
12
|
+
ref: ref
|
|
13
|
+
}));
|
|
14
|
+
};
|
|
15
|
+
export default /*#__PURE__*/forwardRef(Button);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var _excluded = ["locale"];
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { ConfigProvider as OriginalConfigProvider } from 'antd';
|
|
7
|
+
|
|
8
|
+
// 由于 antd 组件的默认文案是英文,所以需要修改为中文
|
|
9
|
+
import dayjs from 'dayjs';
|
|
10
|
+
import 'dayjs/locale/zh-cn';
|
|
11
|
+
import zhCN from 'antd/locale/zh_CN';
|
|
12
|
+
var ConfigProvider = function ConfigProvider(props) {
|
|
13
|
+
var locale = props.locale,
|
|
14
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
15
|
+
var localeData = locale;
|
|
16
|
+
if (typeof locale === 'string') {
|
|
17
|
+
if (locale.toLowerCase() === 'zh-cn') {
|
|
18
|
+
dayjs.locale('zh-cn');
|
|
19
|
+
localeData = zhCN;
|
|
20
|
+
} else if (locale.toLowerCase() === 'en-us') {
|
|
21
|
+
dayjs.locale('en');
|
|
22
|
+
// 默认为英文
|
|
23
|
+
localeData = undefined;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return /*#__PURE__*/React.createElement(OriginalConfigProvider, _extends({
|
|
27
|
+
locale: localeData
|
|
28
|
+
}, rest));
|
|
29
|
+
};
|
|
30
|
+
export default ConfigProvider;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DatePicker as OriginalDatePicker } from 'antd';
|
|
2
|
+
import { withMomentProps } from "../../utils/hoc";
|
|
3
|
+
var OriginalRangePicker = OriginalDatePicker.RangePicker;
|
|
4
|
+
var DatePicker = withMomentProps(OriginalDatePicker, ['defaultPickerValue', 'defaultValue', 'showTime.defaultValue', 'value']);
|
|
5
|
+
var RangePicker = withMomentProps(OriginalRangePicker, ['defaultPickerValue', 'defaultValue', 'showTime.defaultValue', 'value']);
|
|
6
|
+
DatePicker.RangePicker = RangePicker;
|
|
7
|
+
export default DatePicker;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Drawer as OriginalDrawer } from 'antd';
|
|
4
|
+
var Drawer = function Drawer(props) {
|
|
5
|
+
var innerProps = {};
|
|
6
|
+
if (props.__designMode === 'design') {
|
|
7
|
+
// 低代码编辑态中强制显示,将控制权交给引擎侧
|
|
8
|
+
innerProps.open = true;
|
|
9
|
+
}
|
|
10
|
+
console.log(props, 'Drawer props', innerProps);
|
|
11
|
+
return /*#__PURE__*/React.createElement(OriginalDrawer, _extends({}, props, innerProps));
|
|
12
|
+
};
|
|
13
|
+
export default Drawer;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Dropdown as OriginalDropdown } from 'antd';
|
|
4
|
+
import { withSingleChild } from "../../utils/hoc";
|
|
5
|
+
var Dropdown = function Dropdown(props) {
|
|
6
|
+
var innerProps = {};
|
|
7
|
+
if (props.__designMode === 'design') {
|
|
8
|
+
// 低代码编辑态中强制显示,将控制权交给引擎侧
|
|
9
|
+
innerProps.open = true;
|
|
10
|
+
}
|
|
11
|
+
return /*#__PURE__*/React.createElement(OriginalDropdown, _extends({}, props, innerProps));
|
|
12
|
+
};
|
|
13
|
+
export default withSingleChild(Dropdown, ['children', 'overlay']);
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
var _excluded = ["values"],
|
|
2
|
+
_excluded2 = ["children"];
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
9
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
10
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
11
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
12
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
14
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
15
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
16
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
17
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
19
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
20
|
+
import React, { Component, createRef } from 'react';
|
|
21
|
+
import { Form as OriginalForm } from 'antd';
|
|
22
|
+
import { withSingleFunctionChild } from "../../utils/hoc";
|
|
23
|
+
var Form = /*#__PURE__*/function (_Component) {
|
|
24
|
+
_inherits(Form, _Component);
|
|
25
|
+
var _super = _createSuper(Form);
|
|
26
|
+
function Form() {
|
|
27
|
+
var _this;
|
|
28
|
+
_classCallCheck(this, Form);
|
|
29
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
30
|
+
args[_key] = arguments[_key];
|
|
31
|
+
}
|
|
32
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
33
|
+
_defineProperty(_assertThisInitialized(_this), "formRef", /*#__PURE__*/createRef());
|
|
34
|
+
return _this;
|
|
35
|
+
}
|
|
36
|
+
_createClass(Form, [{
|
|
37
|
+
key: "componentDidUpdate",
|
|
38
|
+
value: function componentDidUpdate(prevProps) {
|
|
39
|
+
var prevValues = prevProps.values;
|
|
40
|
+
var currentValues = this.props.values;
|
|
41
|
+
if (prevValues !== currentValues) {
|
|
42
|
+
if (currentValues && Object.keys(currentValues).length > 0) {
|
|
43
|
+
this.formRef.current.setFieldsValue(currentValues);
|
|
44
|
+
} else {
|
|
45
|
+
this.formRef.current.resetFields();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}, {
|
|
50
|
+
key: "componentDidMount",
|
|
51
|
+
value: function componentDidMount() {
|
|
52
|
+
var _this2 = this;
|
|
53
|
+
var values = this.props.values;
|
|
54
|
+
Object.defineProperties(this, Object.keys(this.formRef.current).reduce(function (out, key) {
|
|
55
|
+
var property = _this2.formRef.current[key];
|
|
56
|
+
var getter = function getter() {
|
|
57
|
+
return property;
|
|
58
|
+
};
|
|
59
|
+
if (typeof property === 'function') {
|
|
60
|
+
getter = function getter() {
|
|
61
|
+
return property.bind(_this2.formRef.current);
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
out[key] = {
|
|
65
|
+
get: getter
|
|
66
|
+
};
|
|
67
|
+
return out;
|
|
68
|
+
}, {}));
|
|
69
|
+
|
|
70
|
+
// 绑定表达式的时候,初次不生效,需要第一次调用一下 setFieldsValue
|
|
71
|
+
if (values) {
|
|
72
|
+
this.formRef.current.setFieldsValue(values);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}, {
|
|
76
|
+
key: "render",
|
|
77
|
+
value: function render() {
|
|
78
|
+
var _this$props = this.props,
|
|
79
|
+
values = _this$props.values,
|
|
80
|
+
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
81
|
+
return /*#__PURE__*/React.createElement(OriginalForm, _extends({
|
|
82
|
+
ref: this.formRef
|
|
83
|
+
}, rest));
|
|
84
|
+
}
|
|
85
|
+
}]);
|
|
86
|
+
return Form;
|
|
87
|
+
}(Component);
|
|
88
|
+
Form.Item = function (props) {
|
|
89
|
+
var name = props.name,
|
|
90
|
+
requiredobj = props.requiredobj,
|
|
91
|
+
typeobj = props.typeobj,
|
|
92
|
+
patternobj = props.patternobj,
|
|
93
|
+
lenobj = props.lenobj,
|
|
94
|
+
_validator = props.validator;
|
|
95
|
+
var rules = [];
|
|
96
|
+
if (requiredobj && requiredobj.required) {
|
|
97
|
+
rules.push(requiredobj);
|
|
98
|
+
}
|
|
99
|
+
if (typeobj && typeobj.type) {
|
|
100
|
+
rules.push(typeobj);
|
|
101
|
+
}
|
|
102
|
+
if (patternobj && patternobj.pattern) {
|
|
103
|
+
rules.push(patternobj);
|
|
104
|
+
}
|
|
105
|
+
if (lenobj && (lenobj.max || lenobj.min)) {
|
|
106
|
+
rules.push(lenobj);
|
|
107
|
+
}
|
|
108
|
+
if (_validator && typeof _validator === 'function') {
|
|
109
|
+
rules.push({
|
|
110
|
+
validator: function validator(_, value) {
|
|
111
|
+
return _validator(value);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
var namePath = typeof name === 'string' && name.indexOf('.') > 0 ? name.split('.') : name;
|
|
116
|
+
|
|
117
|
+
// https://ant.design/components/form-cn/#components-form-demo-complex-form-control
|
|
118
|
+
// <Form.Item name="field" /> 只会对它的直接子元素绑定表单功能
|
|
119
|
+
var children = props.children,
|
|
120
|
+
other = _objectWithoutProperties(props, _excluded2);
|
|
121
|
+
var node = children;
|
|
122
|
+
if (Array.isArray(children) && children.length === 1) {
|
|
123
|
+
// 如果 children.length > 1, 说明 Form.Item 只充当布局的作用
|
|
124
|
+
node = children[0];
|
|
125
|
+
}
|
|
126
|
+
return /*#__PURE__*/React.createElement(OriginalForm.Item, _extends({}, other, {
|
|
127
|
+
name: namePath,
|
|
128
|
+
rules: rules
|
|
129
|
+
}), node);
|
|
130
|
+
};
|
|
131
|
+
Form.List = withSingleFunctionChild(OriginalForm.List);
|
|
132
|
+
export default Form;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface IconProps {
|
|
3
|
+
type: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
size?: number;
|
|
6
|
+
color?: string;
|
|
7
|
+
rotate?: number;
|
|
8
|
+
spin?: boolean;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<any>>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["type", "size", "color"];
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
9
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
|
+
import React, { forwardRef } from 'react';
|
|
12
|
+
import * as icons from '@ant-design/icons';
|
|
13
|
+
var createFromIconfontCN = icons.createFromIconfontCN;
|
|
14
|
+
var Icon = function Icon(props, ref) {
|
|
15
|
+
var _props$type = props.type,
|
|
16
|
+
type = _props$type === void 0 ? '' : _props$type,
|
|
17
|
+
size = props.size,
|
|
18
|
+
color = props.color,
|
|
19
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
20
|
+
var IconComp = (icons || {})[type];
|
|
21
|
+
var style = _objectSpread(_objectSpread({}, rest.style), {}, {
|
|
22
|
+
fontSize: size,
|
|
23
|
+
color: color
|
|
24
|
+
});
|
|
25
|
+
if (!IconComp) {
|
|
26
|
+
var IconFont = createFromIconfontCN();
|
|
27
|
+
return /*#__PURE__*/React.createElement(IconFont, _extends({
|
|
28
|
+
type: type
|
|
29
|
+
}, rest, {
|
|
30
|
+
style: style,
|
|
31
|
+
ref: ref
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
return /*#__PURE__*/React.createElement(IconComp, _extends({}, rest, {
|
|
35
|
+
style: style,
|
|
36
|
+
twoToneColor: color,
|
|
37
|
+
ref: ref
|
|
38
|
+
}));
|
|
39
|
+
};
|
|
40
|
+
export default /*#__PURE__*/forwardRef(Icon);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Input as OriginalInput } from 'antd';
|
|
2
|
+
import { withWrap } from "../../utils/hoc";
|
|
3
|
+
var OriginalGroup = OriginalInput.Group,
|
|
4
|
+
OriginalTextArea = OriginalInput.TextArea,
|
|
5
|
+
OriginalPassword = OriginalInput.Password,
|
|
6
|
+
OriginalSearch = OriginalInput.Search;
|
|
7
|
+
var Input = withWrap(OriginalInput);
|
|
8
|
+
Input.Group = OriginalGroup;
|
|
9
|
+
Input.TextArea = withWrap(OriginalTextArea);
|
|
10
|
+
Input.Password = withWrap(OriginalPassword);
|
|
11
|
+
Input.Search = withWrap(OriginalSearch);
|
|
12
|
+
export default Input;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Modal as OriginalModal } from 'antd';
|
|
4
|
+
var Modal = function Modal(props) {
|
|
5
|
+
var innerProps = {};
|
|
6
|
+
if (props.__designMode === 'design') {
|
|
7
|
+
// 低代码编辑态中强制显示,将控制权交给引擎侧
|
|
8
|
+
innerProps.open = true;
|
|
9
|
+
}
|
|
10
|
+
return /*#__PURE__*/React.createElement(OriginalModal, _extends({}, props, innerProps));
|
|
11
|
+
};
|
|
12
|
+
Modal.info = OriginalModal.info;
|
|
13
|
+
Modal.success = OriginalModal.success;
|
|
14
|
+
Modal.error = OriginalModal.error;
|
|
15
|
+
Modal.warning = OriginalModal.warning;
|
|
16
|
+
Modal.warn = OriginalModal.warn;
|
|
17
|
+
Modal.confirm = OriginalModal.confirm;
|
|
18
|
+
export default Modal;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Slider } from 'antd';
|
|
4
|
+
var SliderOuter = function SliderOuter(props) {
|
|
5
|
+
var range = props.range;
|
|
6
|
+
var defaultValue = props.defaultValue;
|
|
7
|
+
if (range) {
|
|
8
|
+
defaultValue = Array.isArray(defaultValue) ? defaultValue : [0, defaultValue];
|
|
9
|
+
} else {
|
|
10
|
+
defaultValue = Array.isArray(defaultValue) ? defaultValue[1] || defaultValue[0] : defaultValue;
|
|
11
|
+
}
|
|
12
|
+
return /*#__PURE__*/React.createElement(Slider, _extends({}, props, {
|
|
13
|
+
defaultValue: defaultValue
|
|
14
|
+
}));
|
|
15
|
+
};
|
|
16
|
+
export default SliderOuter;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Table as OriginalTable } from 'antd';
|
|
4
|
+
var Table = function Table(props) {
|
|
5
|
+
var columns = (props.columns || []).filter(function (item) {
|
|
6
|
+
return !(item !== null && item !== void 0 && item.hidden);
|
|
7
|
+
});
|
|
8
|
+
return /*#__PURE__*/React.createElement(OriginalTable, _extends({}, props, {
|
|
9
|
+
columns: columns
|
|
10
|
+
}));
|
|
11
|
+
};
|
|
12
|
+
export default Table;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
declare class Tabs extends Component<any> {
|
|
3
|
+
state: {
|
|
4
|
+
activeKey: any;
|
|
5
|
+
};
|
|
6
|
+
private _handleChange;
|
|
7
|
+
setActiveKey: (key: string) => void;
|
|
8
|
+
getActiveKey: () => any;
|
|
9
|
+
render(): JSX.Element;
|
|
10
|
+
}
|
|
11
|
+
export default Tabs;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
var _excluded = ["tab"];
|
|
2
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
7
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
10
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
11
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
12
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
13
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
15
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
16
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
17
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
18
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
20
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
21
|
+
import React, { Component } from 'react';
|
|
22
|
+
import { Tabs as OriginalTabs } from 'antd';
|
|
23
|
+
import { warning } from "../../utils/warning";
|
|
24
|
+
var Tabs = /*#__PURE__*/function (_Component) {
|
|
25
|
+
_inherits(Tabs, _Component);
|
|
26
|
+
var _super = _createSuper(Tabs);
|
|
27
|
+
function Tabs() {
|
|
28
|
+
var _this$props$activeKey;
|
|
29
|
+
var _this;
|
|
30
|
+
_classCallCheck(this, Tabs);
|
|
31
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
32
|
+
args[_key] = arguments[_key];
|
|
33
|
+
}
|
|
34
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
35
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
36
|
+
activeKey: (_this$props$activeKey = _this.props.activeKey) !== null && _this$props$activeKey !== void 0 ? _this$props$activeKey : _this.props.defaultActiveKey
|
|
37
|
+
});
|
|
38
|
+
_defineProperty(_assertThisInitialized(_this), "_handleChange", function (key) {
|
|
39
|
+
_this.setActiveKey(key);
|
|
40
|
+
});
|
|
41
|
+
_defineProperty(_assertThisInitialized(_this), "setActiveKey", function (key) {
|
|
42
|
+
var _this$props$onChange = _this.props.onChange,
|
|
43
|
+
onChange = _this$props$onChange === void 0 ? function () {} : _this$props$onChange;
|
|
44
|
+
_this.setState({
|
|
45
|
+
activeKey: key
|
|
46
|
+
});
|
|
47
|
+
onChange(key);
|
|
48
|
+
});
|
|
49
|
+
_defineProperty(_assertThisInitialized(_this), "getActiveKey", function () {
|
|
50
|
+
return _this.state.activeKey;
|
|
51
|
+
});
|
|
52
|
+
return _this;
|
|
53
|
+
}
|
|
54
|
+
_createClass(Tabs, [{
|
|
55
|
+
key: "render",
|
|
56
|
+
value: function render() {
|
|
57
|
+
var props = this.props;
|
|
58
|
+
var activeKey = this.state.activeKey;
|
|
59
|
+
var children = props.children;
|
|
60
|
+
var items = props.items;
|
|
61
|
+
|
|
62
|
+
// props.items 存在,只认 props.items
|
|
63
|
+
// 兼容代码:props.childrens 反推 props.items
|
|
64
|
+
if (!props.items && Array.isArray(children) && children.length > 0) {
|
|
65
|
+
warning('Tabs.TabPane is deprecated. Please use `items` directly.');
|
|
66
|
+
items = children.map(function (node) {
|
|
67
|
+
if ( /*#__PURE__*/React.isValidElement(node)) {
|
|
68
|
+
var key = node.key,
|
|
69
|
+
_props = node.props;
|
|
70
|
+
var _ref = _props || {},
|
|
71
|
+
tab = _ref.tab,
|
|
72
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
73
|
+
var item = _objectSpread(_objectSpread({
|
|
74
|
+
key: String(key)
|
|
75
|
+
}, restProps), {}, {
|
|
76
|
+
label: tab
|
|
77
|
+
});
|
|
78
|
+
return item;
|
|
79
|
+
}
|
|
80
|
+
return null;
|
|
81
|
+
}).filter(Boolean);
|
|
82
|
+
}
|
|
83
|
+
return /*#__PURE__*/React.createElement(OriginalTabs, _extends({}, props, {
|
|
84
|
+
items: items,
|
|
85
|
+
activeKey: activeKey,
|
|
86
|
+
onChange: this._handleChange
|
|
87
|
+
}));
|
|
88
|
+
}
|
|
89
|
+
}]);
|
|
90
|
+
return Tabs;
|
|
91
|
+
}(Component);
|
|
92
|
+
Tabs.TabPane = OriginalTabs.TabPane;
|
|
93
|
+
export default Tabs;
|