@hw-component/form 0.0.5-beta-v1 → 0.0.5-beta-v2
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/es/CheckboxGroup/CheckBox/index.js +1 -1
- package/es/CheckboxGroup/hooks.js +19 -20
- package/es/CheckboxGroup/index.js +17 -16
- package/es/DialogForm/DrawerForm/index.js +14 -14
- package/es/DialogForm/ModalForm.js +15 -15
- package/es/DialogForm/hooks.js +16 -17
- package/es/Form/Context/FormConfigProvider.js +15 -15
- package/es/Form/FormItem/BasicItem.js +12 -12
- package/es/Form/FormItem/RegularFormItem.js +11 -11
- package/es/Form/FormItem/UpFormItem.js +12 -12
- package/es/Form/FormItem/index.js +11 -11
- package/es/Form/HFormConnect.js +15 -14
- package/es/Form/hooks/index.js +19 -19
- package/es/Form/hooks/useDefaultRender.js +12 -12
- package/es/Form/hooks/useHForm.js +32 -32
- package/es/Form/hooks/useInitConfigData.js +21 -21
- package/es/Form/index.js +14 -14
- package/es/Input/ButtonInput.js +16 -16
- package/es/Input/ColorInput/index.js +34 -28
- package/es/Input/InputNumber.js +12 -12
- package/es/Input/SelectInput.js +17 -17
- package/es/Input/index.js +14 -14
- package/es/RadioGroup/index.js +16 -16
- package/es/Select/components/AllSelect.js +3 -5
- package/es/Select/defaultConfig.js +4 -4
- package/es/Select/hooks/changeHooks.js +24 -24
- package/es/Select/hooks/norHooks.js +10 -8
- package/es/Select/index.js +15 -15
- package/es/Select/utils.js +16 -16
- package/es/Submit/index.js +12 -12
- package/es/Switch/index.js +13 -13
- package/es/TDPicker/RangePicker.js +21 -21
- package/es/TDPicker/TimePicker.js +12 -12
- package/es/TDPicker/hooks.js +11 -10
- package/es/TDPicker/index.js +12 -12
- package/es/TextArea/index.js +12 -12
- package/es/Upload/MediaTypeEle/index.js +3 -3
- package/es/Upload/UrlUpload/index.js +29 -23
- package/es/Upload/hooks/change.js +17 -17
- package/es/Upload/hooks/customRequest.js +18 -18
- package/es/Upload/hooks/propsMaker.js +13 -13
- package/es/Upload/index.js +19 -17
- package/es/Upload/util.js +8 -6
- package/es/config.js +2 -2
- package/es/hooks/index.js +25 -29
- package/lib/CheckboxGroup/CheckBox/index.js +1 -1
- package/lib/CheckboxGroup/hooks.js +19 -20
- package/lib/CheckboxGroup/index.js +17 -16
- package/lib/DialogForm/DrawerForm/index.js +14 -14
- package/lib/DialogForm/ModalForm.js +15 -15
- package/lib/DialogForm/hooks.js +16 -17
- package/lib/Form/Context/FormConfigProvider.js +15 -15
- package/lib/Form/FormItem/BasicItem.js +12 -12
- package/lib/Form/FormItem/RegularFormItem.js +11 -11
- package/lib/Form/FormItem/UpFormItem.js +12 -12
- package/lib/Form/FormItem/index.js +11 -11
- package/lib/Form/HFormConnect.js +15 -14
- package/lib/Form/hooks/index.js +19 -19
- package/lib/Form/hooks/useDefaultRender.js +12 -12
- package/lib/Form/hooks/useHForm.js +32 -32
- package/lib/Form/hooks/useInitConfigData.js +21 -21
- package/lib/Form/index.js +14 -14
- package/lib/Input/ButtonInput.js +16 -16
- package/lib/Input/ColorInput/index.js +34 -28
- package/lib/Input/InputNumber.js +12 -12
- package/lib/Input/SelectInput.js +17 -17
- package/lib/Input/index.js +14 -14
- package/lib/RadioGroup/index.js +16 -16
- package/lib/Select/components/AllSelect.js +3 -5
- package/lib/Select/defaultConfig.js +4 -4
- package/lib/Select/hooks/changeHooks.js +24 -24
- package/lib/Select/hooks/norHooks.js +10 -8
- package/lib/Select/index.js +15 -15
- package/lib/Select/utils.js +16 -16
- package/lib/Submit/index.js +12 -12
- package/lib/Switch/index.js +13 -13
- package/lib/TDPicker/RangePicker.js +21 -21
- package/lib/TDPicker/TimePicker.js +12 -12
- package/lib/TDPicker/hooks.js +11 -10
- package/lib/TDPicker/index.js +12 -12
- package/lib/TextArea/index.js +12 -12
- package/lib/Upload/MediaTypeEle/index.js +3 -3
- package/lib/Upload/UrlUpload/index.js +29 -23
- package/lib/Upload/hooks/change.js +17 -17
- package/lib/Upload/hooks/customRequest.js +18 -18
- package/lib/Upload/hooks/propsMaker.js +13 -13
- package/lib/Upload/index.js +19 -17
- package/lib/Upload/util.js +8 -6
- package/lib/config.js +2 -2
- package/lib/hooks/index.js +25 -29
- package/package.json +4 -3
- package/scripts/rollup.config.js +13 -0
- package/src/components/Form/hooks/index.ts +16 -12
package/es/Input/SelectInput.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import _defineProperty from '@babel/runtime
|
|
10
|
-
import _objectWithoutProperties from '@babel/runtime
|
|
11
|
-
import
|
|
12
|
-
import
|
|
2
|
+
import 'core-js/modules/es6.object.keys.js';
|
|
3
|
+
import 'core-js/modules/es6.symbol.js';
|
|
4
|
+
import 'core-js/modules/es6.array.filter.js';
|
|
5
|
+
import 'core-js/modules/es6.object.get-own-property-descriptor.js';
|
|
6
|
+
import 'core-js/modules/es7.object.get-own-property-descriptors.js';
|
|
7
|
+
import 'core-js/modules/es6.object.define-properties.js';
|
|
8
|
+
import 'core-js/modules/es6.object.define-property.js';
|
|
9
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
10
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
11
|
+
import 'core-js/modules/es6.function.name.js';
|
|
12
|
+
import 'core-js/modules/es6.array.for-each.js';
|
|
13
|
+
import 'core-js/modules/es7.object.values.js';
|
|
13
14
|
import { jsx } from 'react/jsx-runtime';
|
|
14
15
|
import { Input } from 'antd';
|
|
15
16
|
import HSelect from '../Select/index.js';
|
|
@@ -18,8 +19,8 @@ import HFormConnect from '../Form/HFormConnect.js';
|
|
|
18
19
|
|
|
19
20
|
var _excluded = ["selectProps", "value", "onChange", "valueName", "addFormat", "addDispatchListener"],
|
|
20
21
|
_excluded2 = ["style", "placeholder"];
|
|
21
|
-
function ownKeys(object, enumerableOnly) { var keys =
|
|
22
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var
|
|
22
|
+
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; }
|
|
23
|
+
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; }
|
|
23
24
|
var SelectInputType;
|
|
24
25
|
(function (SelectInputType) {
|
|
25
26
|
SelectInputType[SelectInputType["input"] = 0] = "input";
|
|
@@ -51,16 +52,15 @@ var Index = function Index(_ref) {
|
|
|
51
52
|
var newVal = _objectSpread({}, value);
|
|
52
53
|
newVal[key] = val;
|
|
53
54
|
var type = key === input ? SelectInputType.input : SelectInputType.select;
|
|
54
|
-
onChange === null || onChange === void 0
|
|
55
|
+
onChange === null || onChange === void 0 || onChange(newVal, type);
|
|
55
56
|
};
|
|
56
|
-
addFormat === null || addFormat === void 0
|
|
57
|
+
addFormat === null || addFormat === void 0 || addFormat({
|
|
57
58
|
"float": {
|
|
58
59
|
inputValue: function inputValue(item, initValue) {
|
|
59
|
-
var _context;
|
|
60
60
|
var _item$name = item.name,
|
|
61
61
|
name = _item$name === void 0 ? "" : _item$name;
|
|
62
62
|
var resultObj = {};
|
|
63
|
-
|
|
63
|
+
Object.values(valueName).forEach(function (key) {
|
|
64
64
|
resultObj[key] = initValue[key];
|
|
65
65
|
});
|
|
66
66
|
return _defineProperty({}, name, resultObj);
|
package/es/Input/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
2
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
|
+
import _objectDestructuringEmpty from '@babel/runtime/helpers/objectDestructuringEmpty';
|
|
4
|
+
import 'core-js/modules/es6.object.assign.js';
|
|
5
|
+
import 'core-js/modules/es6.object.keys.js';
|
|
6
|
+
import 'core-js/modules/es6.symbol.js';
|
|
7
|
+
import 'core-js/modules/es6.array.filter.js';
|
|
8
|
+
import 'core-js/modules/es6.object.get-own-property-descriptor.js';
|
|
9
|
+
import 'core-js/modules/es6.array.for-each.js';
|
|
10
|
+
import 'core-js/modules/es7.object.get-own-property-descriptors.js';
|
|
11
|
+
import 'core-js/modules/es6.object.define-properties.js';
|
|
12
|
+
import 'core-js/modules/es6.object.define-property.js';
|
|
13
13
|
import { jsx } from 'react/jsx-runtime';
|
|
14
14
|
import { Input } from 'antd';
|
|
15
15
|
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys =
|
|
17
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var
|
|
16
|
+
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; }
|
|
17
|
+
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; }
|
|
18
18
|
var HInput = (function (_ref) {
|
|
19
|
-
var props =
|
|
19
|
+
var props = Object.assign({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
20
20
|
return jsx(Input, _objectSpread({}, props));
|
|
21
21
|
});
|
|
22
22
|
|
package/es/RadioGroup/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import _defineProperty from '@babel/runtime
|
|
3
|
-
import _typeof from '@babel/runtime
|
|
4
|
-
import _objectWithoutProperties from '@babel/runtime
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
2
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
|
+
import _typeof from '@babel/runtime/helpers/typeof';
|
|
4
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
|
+
import 'core-js/modules/es6.array.map.js';
|
|
6
|
+
import 'core-js/modules/es6.object.keys.js';
|
|
7
|
+
import 'core-js/modules/es6.symbol.js';
|
|
8
|
+
import 'core-js/modules/es6.array.filter.js';
|
|
9
|
+
import 'core-js/modules/es6.object.get-own-property-descriptor.js';
|
|
10
|
+
import 'core-js/modules/es6.array.for-each.js';
|
|
11
|
+
import 'core-js/modules/es7.object.get-own-property-descriptors.js';
|
|
12
|
+
import 'core-js/modules/es6.object.define-properties.js';
|
|
13
|
+
import 'core-js/modules/es6.object.define-property.js';
|
|
14
14
|
import { jsx } from 'react/jsx-runtime';
|
|
15
15
|
import { Radio } from 'antd';
|
|
16
16
|
import { useMemo } from 'react';
|
|
17
17
|
import { useMatchConfigProps } from '../hooks/index.js';
|
|
18
18
|
|
|
19
19
|
var _excluded = ["value", "options", "onChange", "fieldNames"];
|
|
20
|
-
function ownKeys(object, enumerableOnly) { var keys =
|
|
21
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var
|
|
20
|
+
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; }
|
|
21
|
+
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; }
|
|
22
22
|
var HRadioGroup = (function (_ref) {
|
|
23
23
|
var value = _ref.value,
|
|
24
24
|
options = _ref.options,
|
|
@@ -31,7 +31,7 @@ var HRadioGroup = (function (_ref) {
|
|
|
31
31
|
_useMatchConfigProps$ = _useMatchConfigProps.fieldNames,
|
|
32
32
|
fieldNames = _useMatchConfigProps$ === void 0 ? {} : _useMatchConfigProps$;
|
|
33
33
|
var relOptions = useMemo(function () {
|
|
34
|
-
return options === null || options === void 0 ? void 0 :
|
|
34
|
+
return options === null || options === void 0 ? void 0 : options.map(function (item) {
|
|
35
35
|
var type = _typeof(item);
|
|
36
36
|
if (type === "string" || type === "number") {
|
|
37
37
|
return item;
|
|
@@ -50,7 +50,7 @@ var HRadioGroup = (function (_ref) {
|
|
|
50
50
|
options: relOptions,
|
|
51
51
|
value: value,
|
|
52
52
|
onChange: function onChange(e) {
|
|
53
|
-
_onChange === null || _onChange === void 0
|
|
53
|
+
_onChange === null || _onChange === void 0 || _onChange(e.target.value);
|
|
54
54
|
}
|
|
55
55
|
}, props));
|
|
56
56
|
});
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js/instance/concat';
|
|
3
2
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
4
3
|
import { Space, Checkbox } from 'antd';
|
|
5
4
|
import { itemOpProvider } from '../utils.js';
|
|
6
5
|
import { useClassName } from '../../hooks/index.js';
|
|
7
6
|
|
|
8
7
|
var useRootClassName = function useRootClassName(checked) {
|
|
9
|
-
var _context;
|
|
10
8
|
var norClassNames = ["select-item", "select-item-option"];
|
|
11
|
-
return checked ?
|
|
9
|
+
return checked ? [].concat(norClassNames, ["select-item-option-selected"]) : norClassNames;
|
|
12
10
|
};
|
|
13
11
|
var Index = function Index(_ref) {
|
|
14
12
|
var allSelect = _ref.allSelect,
|
|
@@ -28,10 +26,10 @@ var Index = function Index(_ref) {
|
|
|
28
26
|
var change = function change() {
|
|
29
27
|
if (!checked) {
|
|
30
28
|
var subItemOps = itemOpProvider(options, fieldNames);
|
|
31
|
-
onChange === null || onChange === void 0
|
|
29
|
+
onChange === null || onChange === void 0 || onChange(options, subItemOps);
|
|
32
30
|
return;
|
|
33
31
|
}
|
|
34
|
-
onChange === null || onChange === void 0
|
|
32
|
+
onChange === null || onChange === void 0 || onChange([], []);
|
|
35
33
|
};
|
|
36
34
|
if (!allSelect || mode !== "multiple" || serviceSearch) {
|
|
37
35
|
return jsx(Fragment, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import 'core-js/modules/es6.array.map.js';
|
|
3
|
+
import 'core-js/modules/es6.array.index-of.js';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
import CheckBoxOption from './components/CheckBoxOption.js';
|
|
6
6
|
import NoFindItem from './components/NoFindItem.js';
|
|
@@ -9,11 +9,11 @@ var defaultModeConfig = {
|
|
|
9
9
|
multiple: {
|
|
10
10
|
icon: null,
|
|
11
11
|
render: function render(item, value) {
|
|
12
|
-
var checkVal = value === null || value === void 0 ? void 0 :
|
|
12
|
+
var checkVal = value === null || value === void 0 ? void 0 : value.map(function (itemVal) {
|
|
13
13
|
return itemVal.value;
|
|
14
14
|
});
|
|
15
15
|
var newVal = checkVal || [];
|
|
16
|
-
var checked =
|
|
16
|
+
var checked = newVal.indexOf(item.value) !== -1;
|
|
17
17
|
return jsx(CheckBoxOption, {
|
|
18
18
|
label: item.label,
|
|
19
19
|
checked: checked
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import _slicedToArray from '@babel/runtime
|
|
10
|
-
import _objectWithoutProperties from '@babel/runtime
|
|
11
|
-
import _defineProperty from '@babel/runtime
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
2
|
+
import 'core-js/modules/es6.object.keys.js';
|
|
3
|
+
import 'core-js/modules/es6.symbol.js';
|
|
4
|
+
import 'core-js/modules/es6.array.filter.js';
|
|
5
|
+
import 'core-js/modules/es6.object.get-own-property-descriptor.js';
|
|
6
|
+
import 'core-js/modules/es7.object.get-own-property-descriptors.js';
|
|
7
|
+
import 'core-js/modules/es6.object.define-properties.js';
|
|
8
|
+
import 'core-js/modules/es6.object.define-property.js';
|
|
9
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
10
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
11
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
12
|
+
import 'core-js/modules/es6.array.find-index.js';
|
|
13
|
+
import 'core-js/modules/es6.array.for-each.js';
|
|
14
|
+
import 'core-js/modules/es6.array.map.js';
|
|
15
|
+
import 'core-js/modules/es6.array.is-array.js';
|
|
16
16
|
import { useState, useEffect } from 'react';
|
|
17
17
|
import { itemOpProvider } from '../utils.js';
|
|
18
18
|
|
|
19
19
|
var _excluded = ["index"],
|
|
20
20
|
_excluded2 = ["index"];
|
|
21
|
-
function ownKeys(object, enumerableOnly) { var keys =
|
|
22
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var
|
|
21
|
+
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; }
|
|
22
|
+
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; }
|
|
23
23
|
var single = function single(_ref) {
|
|
24
24
|
var options = _ref.options,
|
|
25
25
|
value = _ref.value,
|
|
26
26
|
noMatchItemRender = _ref.noMatchItemRender;
|
|
27
27
|
var newOptions = options || [];
|
|
28
|
-
var index =
|
|
28
|
+
var index = newOptions.findIndex(function (item) {
|
|
29
29
|
return item.value === value;
|
|
30
30
|
});
|
|
31
31
|
if (index !== -1) {
|
|
@@ -46,7 +46,7 @@ var findNewValInOldVal = function findNewValInOldVal(val, oldVal) {
|
|
|
46
46
|
if (!oldVal) {
|
|
47
47
|
return -1;
|
|
48
48
|
}
|
|
49
|
-
return
|
|
49
|
+
return oldVal.findIndex(function (item) {
|
|
50
50
|
return item.value === val;
|
|
51
51
|
});
|
|
52
52
|
};
|
|
@@ -55,7 +55,7 @@ var sourceDataProvider = function sourceDataProvider(_ref2, oldVal) {
|
|
|
55
55
|
var value = _ref2.value;
|
|
56
56
|
var oldData = [];
|
|
57
57
|
var newData = [];
|
|
58
|
-
|
|
58
|
+
value.forEach(function (item, i) {
|
|
59
59
|
var index = findNewValInOldVal(item, oldVal);
|
|
60
60
|
if (index === -1) {
|
|
61
61
|
newData.push({
|
|
@@ -76,12 +76,12 @@ var sourceDataProvider = function sourceDataProvider(_ref2, oldVal) {
|
|
|
76
76
|
};
|
|
77
77
|
var resultProvider = function resultProvider(newData, oldData, value) {
|
|
78
78
|
var newResult = new Array(value.length);
|
|
79
|
-
|
|
79
|
+
oldData.forEach(function (item) {
|
|
80
80
|
var index = item.index,
|
|
81
81
|
val = _objectWithoutProperties(item, _excluded);
|
|
82
82
|
newResult[index] = _objectSpread({}, val);
|
|
83
83
|
});
|
|
84
|
-
|
|
84
|
+
newData.forEach(function (item) {
|
|
85
85
|
var index = item.index,
|
|
86
86
|
val = _objectWithoutProperties(item, _excluded2);
|
|
87
87
|
newResult[index] = _objectSpread({}, val);
|
|
@@ -98,7 +98,7 @@ var multiple = function multiple(_ref3, oldVal) {
|
|
|
98
98
|
}, oldVal),
|
|
99
99
|
newData = _sourceDataProvider.newData,
|
|
100
100
|
oldData = _sourceDataProvider.oldData;
|
|
101
|
-
var newMatchVal =
|
|
101
|
+
var newMatchVal = newData.map(function (item) {
|
|
102
102
|
var itemVal = item.value,
|
|
103
103
|
index = item.index;
|
|
104
104
|
var newItem = single({
|
|
@@ -169,8 +169,8 @@ var useValueChange = function useValueChange(params) {
|
|
|
169
169
|
if (labelInValue) {
|
|
170
170
|
newChangeVal = changeVal;
|
|
171
171
|
}
|
|
172
|
-
if (
|
|
173
|
-
newChangeVal =
|
|
172
|
+
if (Array.isArray(changeVal)) {
|
|
173
|
+
newChangeVal = changeVal.map(function (item) {
|
|
174
174
|
return item.value;
|
|
175
175
|
});
|
|
176
176
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import _asyncToGenerator from '@babel/runtime
|
|
3
|
-
import _slicedToArray from '@babel/runtime
|
|
4
|
-
import _regeneratorRuntime from '@babel/runtime
|
|
5
|
-
import
|
|
6
|
-
import
|
|
2
|
+
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
3
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
|
+
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
5
|
+
import 'core-js/modules/es6.object.to-string.js';
|
|
6
|
+
import 'core-js/modules/es6.array.iterator.js';
|
|
7
|
+
import 'core-js/modules/web.dom.iterable.js';
|
|
8
|
+
import 'core-js/modules/es6.promise.js';
|
|
7
9
|
import { useState, useEffect } from 'react';
|
|
8
10
|
import { useRequest } from 'ahooks';
|
|
9
11
|
import { useFormContext } from '../../Form/Context/index.js';
|
|
@@ -37,7 +39,7 @@ var useOptionReq = function useOptionReq(_ref) {
|
|
|
37
39
|
while (1) switch (_context.prev = _context.next) {
|
|
38
40
|
case 0:
|
|
39
41
|
requestParams = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
40
|
-
_requestParams$params = requestParams.params, params = _requestParams$params === void 0 ? {} : _requestParams$params, values =
|
|
42
|
+
_requestParams$params = requestParams.params, params = _requestParams$params === void 0 ? {} : _requestParams$params, values = requestParams.values, _requestParams$type = requestParams.type, type = _requestParams$type === void 0 ? "init" : _requestParams$type;
|
|
41
43
|
formData = values || (form === null || form === void 0 ? void 0 : form.getFieldsValue());
|
|
42
44
|
if (type === "init") {
|
|
43
45
|
setData(undefined);
|
|
@@ -48,7 +50,7 @@ var useOptionReq = function useOptionReq(_ref) {
|
|
|
48
50
|
}
|
|
49
51
|
return _context.abrupt("return", request(params, formData));
|
|
50
52
|
case 6:
|
|
51
|
-
return _context.abrupt("return",
|
|
53
|
+
return _context.abrupt("return", Promise.resolve(options));
|
|
52
54
|
case 7:
|
|
53
55
|
case "end":
|
|
54
56
|
return _context.stop();
|
|
@@ -76,7 +78,7 @@ var useOptionReq = function useOptionReq(_ref) {
|
|
|
76
78
|
};
|
|
77
79
|
var onSearch = function onSearch(inputValue) {
|
|
78
80
|
if (!serviceSearch) {
|
|
79
|
-
propsOnSearch === null || propsOnSearch === void 0
|
|
81
|
+
propsOnSearch === null || propsOnSearch === void 0 || propsOnSearch(inputValue);
|
|
80
82
|
return;
|
|
81
83
|
}
|
|
82
84
|
run({
|
package/es/Select/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import _defineProperty from '@babel/runtime
|
|
11
|
-
import _objectWithoutProperties from '@babel/runtime
|
|
12
|
-
import
|
|
2
|
+
import 'core-js/modules/es6.object.keys.js';
|
|
3
|
+
import 'core-js/modules/es6.symbol.js';
|
|
4
|
+
import 'core-js/modules/es6.array.filter.js';
|
|
5
|
+
import 'core-js/modules/es6.object.get-own-property-descriptor.js';
|
|
6
|
+
import 'core-js/modules/es6.array.for-each.js';
|
|
7
|
+
import 'core-js/modules/es7.object.get-own-property-descriptors.js';
|
|
8
|
+
import 'core-js/modules/es6.object.define-properties.js';
|
|
9
|
+
import 'core-js/modules/es6.object.define-property.js';
|
|
10
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
11
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
12
|
+
import 'core-js/modules/es6.array.map.js';
|
|
13
13
|
import { jsx } from 'react/jsx-runtime';
|
|
14
14
|
import { Select } from 'antd';
|
|
15
15
|
import { useFilterOption, useOptionReq } from './hooks/norHooks.js';
|
|
@@ -21,8 +21,8 @@ import { useMatchConfigProps, useChangeOptions } from '../hooks/index.js';
|
|
|
21
21
|
import HFormConnect from '../Form/HFormConnect.js';
|
|
22
22
|
|
|
23
23
|
var _excluded = ["style", "mode", "options", "modeConfig", "value", "onChange", "fieldNames", "request", "manual", "optionLabelProp", "filterProvider", "optionFilterProp", "serviceSearch", "onSearch", "filterOption", "showSearch", "labelInValue", "noMatchItemRender", "allSelect", "addDispatchListener", "addFormat", "dispatch"];
|
|
24
|
-
function ownKeys(object, enumerableOnly) { var keys =
|
|
25
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var
|
|
24
|
+
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; }
|
|
25
|
+
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; }
|
|
26
26
|
var Option = Select.Option;
|
|
27
27
|
var Index = function Index(_ref) {
|
|
28
28
|
var _ref$style = _ref.style,
|
|
@@ -98,7 +98,7 @@ var Index = function Index(_ref) {
|
|
|
98
98
|
}),
|
|
99
99
|
val = _useValueChange.val,
|
|
100
100
|
change = _useValueChange.change;
|
|
101
|
-
addDispatchListener === null || addDispatchListener === void 0
|
|
101
|
+
addDispatchListener === null || addDispatchListener === void 0 || addDispatchListener("reload", reload);
|
|
102
102
|
return jsx(Select, _objectSpread(_objectSpread({
|
|
103
103
|
style: style,
|
|
104
104
|
mode: mode,
|
|
@@ -129,7 +129,7 @@ var Index = function Index(_ref) {
|
|
|
129
129
|
showSearch: mathShowSearch,
|
|
130
130
|
labelInValue: true
|
|
131
131
|
}, props), {}, {
|
|
132
|
-
children: data === null || data === void 0 ? void 0 :
|
|
132
|
+
children: data === null || data === void 0 ? void 0 : data.map(function (item) {
|
|
133
133
|
var optionValue = item.value,
|
|
134
134
|
label = item.label;
|
|
135
135
|
var result = (filterProvider === null || filterProvider === void 0 ? void 0 : filterProvider(item)) || label;
|
package/es/Select/utils.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import _defineProperty from '@babel/runtime
|
|
11
|
-
import _objectWithoutProperties from '@babel/runtime
|
|
12
|
-
import
|
|
13
|
-
import
|
|
2
|
+
import 'core-js/modules/es6.object.keys.js';
|
|
3
|
+
import 'core-js/modules/es6.symbol.js';
|
|
4
|
+
import 'core-js/modules/es6.array.filter.js';
|
|
5
|
+
import 'core-js/modules/es6.object.get-own-property-descriptor.js';
|
|
6
|
+
import 'core-js/modules/es6.array.for-each.js';
|
|
7
|
+
import 'core-js/modules/es7.object.get-own-property-descriptors.js';
|
|
8
|
+
import 'core-js/modules/es6.object.define-properties.js';
|
|
9
|
+
import 'core-js/modules/es6.object.define-property.js';
|
|
10
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
11
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
12
|
+
import 'core-js/modules/es6.array.is-array.js';
|
|
13
|
+
import 'core-js/modules/es6.array.map.js';
|
|
14
14
|
|
|
15
15
|
var _excluded = ["label", "value"];
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys =
|
|
17
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var
|
|
16
|
+
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; }
|
|
17
|
+
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; }
|
|
18
18
|
var itemOpMaker = function itemOpMaker(itemOp, fieldNames) {
|
|
19
19
|
var _objectSpread2;
|
|
20
20
|
var label = itemOp.label,
|
|
@@ -27,8 +27,8 @@ var itemOpMaker = function itemOpMaker(itemOp, fieldNames) {
|
|
|
27
27
|
return _objectSpread((_objectSpread2 = {}, _defineProperty(_objectSpread2, labelKey, label), _defineProperty(_objectSpread2, valKey, itemVal), _objectSpread2), oItemOp);
|
|
28
28
|
};
|
|
29
29
|
var itemOpProvider = function itemOpProvider(itemOps, fieldNames) {
|
|
30
|
-
if (
|
|
31
|
-
return
|
|
30
|
+
if (Array.isArray(itemOps)) {
|
|
31
|
+
return itemOps.map(function (item) {
|
|
32
32
|
return itemOpMaker(item, fieldNames);
|
|
33
33
|
});
|
|
34
34
|
}
|
package/es/Submit/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import _defineProperty from '@babel/runtime
|
|
11
|
-
import _objectWithoutProperties from '@babel/runtime
|
|
2
|
+
import 'core-js/modules/es6.object.keys.js';
|
|
3
|
+
import 'core-js/modules/es6.symbol.js';
|
|
4
|
+
import 'core-js/modules/es6.array.filter.js';
|
|
5
|
+
import 'core-js/modules/es6.object.get-own-property-descriptor.js';
|
|
6
|
+
import 'core-js/modules/es6.array.for-each.js';
|
|
7
|
+
import 'core-js/modules/es7.object.get-own-property-descriptors.js';
|
|
8
|
+
import 'core-js/modules/es6.object.define-properties.js';
|
|
9
|
+
import 'core-js/modules/es6.object.define-property.js';
|
|
10
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
11
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
12
12
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
13
13
|
import { Row, Space, Button } from 'antd';
|
|
14
14
|
import { useFormContext } from '../Form/Context/index.js';
|
|
15
15
|
|
|
16
16
|
var _excluded = ["text", "type", "form", "loading", "position", "reset"];
|
|
17
|
-
function ownKeys(object, enumerableOnly) { var keys =
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var
|
|
17
|
+
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; }
|
|
18
|
+
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; }
|
|
19
19
|
var HSubmit = (function (_ref) {
|
|
20
20
|
var _ref$text = _ref.text,
|
|
21
21
|
text = _ref$text === void 0 ? "提交" : _ref$text,
|
package/es/Switch/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import _defineProperty from '@babel/runtime
|
|
11
|
-
import _objectWithoutProperties from '@babel/runtime
|
|
2
|
+
import 'core-js/modules/es6.object.keys.js';
|
|
3
|
+
import 'core-js/modules/es6.symbol.js';
|
|
4
|
+
import 'core-js/modules/es6.array.filter.js';
|
|
5
|
+
import 'core-js/modules/es6.object.get-own-property-descriptor.js';
|
|
6
|
+
import 'core-js/modules/es6.array.for-each.js';
|
|
7
|
+
import 'core-js/modules/es7.object.get-own-property-descriptors.js';
|
|
8
|
+
import 'core-js/modules/es6.object.define-properties.js';
|
|
9
|
+
import 'core-js/modules/es6.object.define-property.js';
|
|
10
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
11
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
12
12
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
13
13
|
import { Space, Switch } from 'antd';
|
|
14
14
|
import { useMemo } from 'react';
|
|
15
15
|
import { useMatchConfigProps } from '../hooks/index.js';
|
|
16
16
|
|
|
17
17
|
var _excluded = ["value", "onChange", "valueMap", "children", "unCheckedChildren", "checkedChildren", "beforeText"];
|
|
18
|
-
function ownKeys(object, enumerableOnly) { var keys =
|
|
19
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
20
|
var Index = function Index(_ref) {
|
|
21
21
|
var value = _ref.value,
|
|
22
22
|
onChange = _ref.onChange,
|
|
@@ -42,7 +42,7 @@ var Index = function Index(_ref) {
|
|
|
42
42
|
if (checked) {
|
|
43
43
|
subVal = valueSwitchMap.open;
|
|
44
44
|
}
|
|
45
|
-
onChange === null || onChange === void 0
|
|
45
|
+
onChange === null || onChange === void 0 || onChange(subVal);
|
|
46
46
|
};
|
|
47
47
|
return jsxs(Space, {
|
|
48
48
|
children: [beforeText, jsx(Switch, _objectSpread({
|