@hw-component/form 0.0.1-beta → 0.0.1-beta-v3
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 +16 -24
- package/es/CheckboxGroup/hooks.d.ts +3 -9
- package/es/CheckboxGroup/hooks.js +64 -115
- package/es/CheckboxGroup/index.d.ts +1 -6
- package/es/CheckboxGroup/index.js +58 -117
- package/es/CheckboxGroup/modal.d.ts +8 -9
- package/es/Form/Context/FormConfigProvider.js +19 -64
- package/es/Form/Context/index.d.ts +1 -4
- package/es/Form/Context/index.js +3 -3
- package/es/Form/FormItem/BasicItem.js +42 -80
- package/es/Form/FormItem/Helper.d.ts +1 -1
- package/es/Form/FormItem/Helper.js +9 -17
- package/es/Form/FormItem/RegularFormItem.js +8 -11
- package/es/Form/FormItem/UpFormItem.d.ts +1 -6
- package/es/Form/FormItem/UpFormItem.js +17 -27
- package/es/Form/FormItem/hooks.d.ts +4 -21
- package/es/Form/FormItem/hooks.js +9 -12
- package/es/Form/FormItem/index.js +5 -5
- package/es/Form/HFormConnect.d.ts +1 -9
- package/es/Form/HFormConnect.js +30 -90
- package/es/Form/InitSet.d.ts +1 -4
- package/es/Form/InitSet.js +6 -7
- package/es/Form/Label.d.ts +4 -4
- package/es/Form/Label.js +19 -36
- package/es/Form/config.d.ts +22 -100
- package/es/Form/config.js +19 -19
- package/es/Form/hooks/index.d.ts +1 -14
- package/es/Form/hooks/index.js +32 -80
- package/es/Form/hooks/useHForm.js +143 -224
- package/es/Form/hooks/useInitConfigData.d.ts +1 -4
- package/es/Form/hooks/useInitConfigData.js +61 -143
- package/es/Form/index.d.ts +1 -11
- package/es/Form/index.js +79 -79
- package/es/Form/modal.d.ts +54 -89
- package/es/Input/ButtonInput.js +51 -73
- package/es/Input/InputNumber.js +12 -21
- package/es/Input/SelectInput.d.ts +4 -16
- package/es/Input/SelectInput.js +62 -116
- package/es/Input/defaultConfig.d.ts +3 -3
- package/es/Input/defaultConfig.js +2 -2
- package/es/Input/index.js +7 -7
- package/es/Input/modal.d.ts +13 -15
- package/es/ModalForm/hooks.d.ts +12 -0
- package/es/ModalForm/hooks.js +78 -0
- package/es/ModalForm/index.d.ts +4 -0
- package/es/ModalForm/index.js +59 -0
- package/es/ModalForm/modal.d.ts +23 -0
- package/es/PageHandler/ErrorComponent.js +25 -47
- package/es/PageHandler/LoadingComponent.js +13 -17
- package/es/PageHandler/index.js +7 -7
- package/es/PageHandler/modal.d.ts +4 -4
- package/es/RadioGroup/index.d.ts +5 -12
- package/es/RadioGroup/index.js +33 -46
- package/es/Select/components/AllSelect.d.ts +1 -1
- package/es/Select/components/AllSelect.js +18 -40
- package/es/Select/components/CheckBoxOption.d.ts +3 -6
- package/es/Select/components/CheckBoxOption.js +7 -12
- package/es/Select/components/DropdownComponent.d.ts +4 -4
- package/es/Select/components/DropdownComponent.js +17 -30
- package/es/Select/components/NoFindItem.d.ts +1 -1
- package/es/Select/components/NoFindItem.js +7 -11
- package/es/Select/components/NotFoundContent.d.ts +2 -2
- package/es/Select/components/NotFoundContent.js +27 -49
- package/es/Select/defaultConfig.d.ts +1 -1
- package/es/Select/defaultConfig.js +16 -20
- package/es/Select/hooks/changeHooks.d.ts +2 -2
- package/es/Select/hooks/changeHooks.js +71 -147
- package/es/Select/hooks/norHooks.d.ts +9 -27
- package/es/Select/hooks/norHooks.js +39 -51
- package/es/Select/index.d.ts +1 -22
- package/es/Select/index.js +65 -124
- package/es/Select/modal.d.ts +15 -15
- package/es/Select/utils.js +15 -60
- package/es/Submit/index.d.ts +3 -9
- package/es/Submit/index.js +13 -18
- package/es/Switch/index.d.ts +4 -4
- package/es/Switch/index.js +20 -46
- package/es/TDPicker/RangePicker.d.ts +3 -8
- package/es/TDPicker/RangePicker.js +67 -138
- package/es/TDPicker/TimePicker.d.ts +1 -6
- package/es/TDPicker/TimePicker.js +13 -19
- package/es/TDPicker/hooks.d.ts +22 -42
- package/es/TDPicker/hooks.js +72 -106
- package/es/TDPicker/index.d.ts +1 -7
- package/es/TDPicker/index.js +14 -20
- package/es/TDPicker/modal.d.ts +16 -21
- package/es/TextArea/index.d.ts +1 -0
- package/es/Upload/Btn.d.ts +1 -5
- package/es/Upload/Btn.js +19 -35
- package/es/Upload/MediaTypeEle/TypeEle.d.ts +5 -10
- package/es/Upload/MediaTypeEle/TypeEle.js +23 -31
- package/es/Upload/MediaTypeEle/index.d.ts +1 -5
- package/es/Upload/MediaTypeEle/index.js +18 -21
- package/es/Upload/Preview/index.d.ts +1 -5
- package/es/Upload/Preview/index.js +13 -17
- package/es/Upload/UrlUpload/index.d.ts +1 -7
- package/es/Upload/UrlUpload/index.js +51 -72
- package/es/Upload/enums.d.ts +3 -3
- package/es/Upload/enums.js +3 -3
- package/es/Upload/hooks/change.d.ts +1 -8
- package/es/Upload/hooks/change.js +58 -115
- package/es/Upload/hooks/customRequest.d.ts +1 -5
- package/es/Upload/hooks/customRequest.js +46 -63
- package/es/Upload/hooks/propsMaker.d.ts +1 -5
- package/es/Upload/hooks/propsMaker.js +13 -52
- package/es/Upload/index.d.ts +1 -3
- package/es/Upload/index.js +61 -131
- package/es/Upload/modal.d.ts +15 -17
- package/es/Upload/util.d.ts +2 -8
- package/es/Upload/util.js +7 -15
- package/es/config.js +31 -34
- package/es/hooks/index.d.ts +7 -14
- package/es/hooks/index.js +49 -124
- package/es/index.d.ts +18 -98
- package/es/index.js +8 -22
- package/es/modal.d.ts +6 -6
- package/lib/CheckboxGroup/CheckBox/index.js +18 -26
- package/lib/CheckboxGroup/hooks.d.ts +3 -9
- package/lib/CheckboxGroup/hooks.js +65 -116
- package/lib/CheckboxGroup/index.d.ts +1 -6
- package/lib/CheckboxGroup/index.js +60 -119
- package/lib/CheckboxGroup/modal.d.ts +8 -9
- package/lib/Form/Context/FormConfigProvider.js +21 -66
- package/lib/Form/Context/index.d.ts +1 -4
- package/lib/Form/Context/index.js +4 -4
- package/lib/Form/FormItem/BasicItem.js +44 -82
- package/lib/Form/FormItem/Helper.d.ts +1 -1
- package/lib/Form/FormItem/Helper.js +11 -19
- package/lib/Form/FormItem/RegularFormItem.js +10 -13
- package/lib/Form/FormItem/UpFormItem.d.ts +1 -6
- package/lib/Form/FormItem/UpFormItem.js +19 -29
- package/lib/Form/FormItem/hooks.d.ts +4 -21
- package/lib/Form/FormItem/hooks.js +10 -13
- package/lib/Form/FormItem/index.js +7 -7
- package/lib/Form/HFormConnect.d.ts +1 -9
- package/lib/Form/HFormConnect.js +32 -92
- package/lib/Form/InitSet.d.ts +1 -4
- package/lib/Form/InitSet.js +8 -9
- package/lib/Form/Label.d.ts +4 -4
- package/lib/Form/Label.js +21 -41
- package/lib/Form/config.d.ts +22 -100
- package/lib/Form/config.js +21 -21
- package/lib/Form/hooks/index.d.ts +1 -14
- package/lib/Form/hooks/index.js +32 -81
- package/lib/Form/hooks/useHForm.js +145 -226
- package/lib/Form/hooks/useInitConfigData.d.ts +1 -4
- package/lib/Form/hooks/useInitConfigData.js +63 -144
- package/lib/Form/index.d.ts +1 -11
- package/lib/Form/index.js +83 -83
- package/lib/Form/modal.d.ts +54 -89
- package/lib/Input/ButtonInput.js +53 -75
- package/lib/Input/InputNumber.js +14 -23
- package/lib/Input/SelectInput.d.ts +4 -16
- package/lib/Input/SelectInput.js +66 -128
- package/lib/Input/defaultConfig.d.ts +3 -3
- package/lib/Input/defaultConfig.js +3 -3
- package/lib/Input/index.js +9 -9
- package/lib/Input/modal.d.ts +13 -15
- package/lib/ModalForm/hooks.d.ts +12 -0
- package/lib/ModalForm/hooks.js +81 -0
- package/lib/ModalForm/index.d.ts +4 -0
- package/lib/ModalForm/index.js +62 -0
- package/lib/ModalForm/modal.d.ts +23 -0
- package/lib/PageHandler/ErrorComponent.js +27 -49
- package/lib/PageHandler/LoadingComponent.js +15 -19
- package/lib/PageHandler/index.js +9 -9
- package/lib/PageHandler/modal.d.ts +4 -4
- package/lib/RadioGroup/index.d.ts +5 -12
- package/lib/RadioGroup/index.js +35 -48
- package/lib/Select/components/AllSelect.d.ts +1 -1
- package/lib/Select/components/AllSelect.js +20 -42
- package/lib/Select/components/CheckBoxOption.d.ts +3 -6
- package/lib/Select/components/CheckBoxOption.js +9 -14
- package/lib/Select/components/DropdownComponent.d.ts +4 -4
- package/lib/Select/components/DropdownComponent.js +19 -32
- package/lib/Select/components/NoFindItem.d.ts +1 -1
- package/lib/Select/components/NoFindItem.js +9 -13
- package/lib/Select/components/NotFoundContent.d.ts +2 -2
- package/lib/Select/components/NotFoundContent.js +29 -51
- package/lib/Select/defaultConfig.d.ts +1 -1
- package/lib/Select/defaultConfig.js +17 -21
- package/lib/Select/hooks/changeHooks.d.ts +2 -2
- package/lib/Select/hooks/changeHooks.js +72 -148
- package/lib/Select/hooks/norHooks.d.ts +9 -27
- package/lib/Select/hooks/norHooks.js +40 -52
- package/lib/Select/index.d.ts +1 -22
- package/lib/Select/index.js +67 -128
- package/lib/Select/modal.d.ts +15 -15
- package/lib/Select/utils.js +16 -61
- package/lib/Submit/index.d.ts +3 -9
- package/lib/Submit/index.js +15 -20
- package/lib/Switch/index.d.ts +4 -4
- package/lib/Switch/index.js +22 -48
- package/lib/TDPicker/RangePicker.d.ts +3 -8
- package/lib/TDPicker/RangePicker.js +69 -136
- package/lib/TDPicker/TimePicker.d.ts +1 -6
- package/lib/TDPicker/TimePicker.js +15 -21
- package/lib/TDPicker/hooks.d.ts +22 -42
- package/lib/TDPicker/hooks.js +72 -98
- package/lib/TDPicker/index.d.ts +1 -7
- package/lib/TDPicker/index.js +16 -22
- package/lib/TDPicker/modal.d.ts +16 -21
- package/lib/TextArea/index.d.ts +1 -0
- package/lib/Upload/Btn.d.ts +1 -5
- package/lib/Upload/Btn.js +21 -37
- package/lib/Upload/MediaTypeEle/TypeEle.d.ts +5 -10
- package/lib/Upload/MediaTypeEle/TypeEle.js +25 -33
- package/lib/Upload/MediaTypeEle/index.d.ts +1 -5
- package/lib/Upload/MediaTypeEle/index.js +20 -23
- package/lib/Upload/Preview/index.d.ts +1 -5
- package/lib/Upload/Preview/index.js +15 -19
- package/lib/Upload/UrlUpload/index.d.ts +1 -7
- package/lib/Upload/UrlUpload/index.js +53 -74
- package/lib/Upload/enums.d.ts +3 -3
- package/lib/Upload/enums.js +4 -4
- package/lib/Upload/hooks/change.d.ts +1 -8
- package/lib/Upload/hooks/change.js +59 -116
- package/lib/Upload/hooks/customRequest.d.ts +1 -5
- package/lib/Upload/hooks/customRequest.js +47 -64
- package/lib/Upload/hooks/propsMaker.d.ts +1 -5
- package/lib/Upload/hooks/propsMaker.js +15 -55
- package/lib/Upload/index.d.ts +1 -3
- package/lib/Upload/index.js +63 -133
- package/lib/Upload/modal.d.ts +15 -17
- package/lib/Upload/util.d.ts +2 -8
- package/lib/Upload/util.js +8 -16
- package/lib/config.js +32 -35
- package/lib/hooks/index.d.ts +7 -14
- package/lib/hooks/index.js +50 -125
- package/lib/index.d.ts +18 -98
- package/lib/index.js +10 -5
- package/lib/modal.d.ts +6 -6
- package/package.json +1 -1
- package/src/components/Form/InitSet.tsx +3 -5
- package/src/components/Form/hooks/index.ts +0 -20
- package/src/components/Form/hooks/useHForm.ts +8 -4
- package/src/components/Form/index.tsx +25 -7
- package/src/components/Form/modal.ts +4 -2
- package/src/components/Input/SelectInput.tsx +3 -2
- package/src/components/Input/modal.ts +2 -0
- package/src/components/ModalForm/hooks.ts +61 -0
- package/src/components/ModalForm/index.tsx +52 -0
- package/src/components/ModalForm/modal.ts +25 -0
- package/src/components/index.tsx +4 -0
- package/src/pages/ModalForm/index.tsx +127 -0
- package/src/routes.tsx +6 -1
package/es/RadioGroup/index.d.ts
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { SelectProps, RadioGroupProps } from "antd/es";
|
|
3
|
-
export interface HRadioGroupProps
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
options?: (Record<string, any> | string | number)[];
|
|
3
|
+
export interface HRadioGroupProps extends Omit<RadioGroupProps, "onChange" | "options"> {
|
|
4
|
+
onChange?: (value: any) => void;
|
|
5
|
+
fieldNames?: SelectProps["fieldNames"];
|
|
6
|
+
options?: (Record<string, any> | string | number)[];
|
|
8
7
|
}
|
|
9
|
-
declare const _default: ({
|
|
10
|
-
value,
|
|
11
|
-
options,
|
|
12
|
-
onChange,
|
|
13
|
-
fieldNames: propsFieldNames,
|
|
14
|
-
...props
|
|
15
|
-
}: HRadioGroupProps) => JSX.Element;
|
|
8
|
+
declare const _default: ({ value, options, onChange, fieldNames: propsFieldNames, ...props }: HRadioGroupProps) => JSX.Element;
|
|
16
9
|
export default _default;
|
package/es/RadioGroup/index.js
CHANGED
|
@@ -1,61 +1,48 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import React, { useMemo } from
|
|
3
|
-
import _extends from
|
|
4
|
-
import _typeof from
|
|
5
|
-
import _objectWithoutProperties from
|
|
6
|
-
import _mapInstanceProperty from
|
|
7
|
-
import { Radio } from
|
|
8
|
-
import { useMatchConfigProps } from
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
4
|
+
import _typeof from '@babel/runtime-corejs3/helpers/typeof';
|
|
5
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
6
|
+
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js/instance/map';
|
|
7
|
+
import { Radio } from 'antd';
|
|
8
|
+
import { useMatchConfigProps } from '../hooks/index.js';
|
|
9
9
|
|
|
10
10
|
var _excluded = ["value", "options", "onChange", "fieldNames"];
|
|
11
|
-
var HRadioGroup = function (_ref) {
|
|
11
|
+
var HRadioGroup = (function (_ref) {
|
|
12
12
|
var value = _ref.value,
|
|
13
13
|
options = _ref.options,
|
|
14
14
|
_onChange = _ref.onChange,
|
|
15
15
|
propsFieldNames = _ref.fieldNames,
|
|
16
16
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
17
17
|
var _useMatchConfigProps = useMatchConfigProps({
|
|
18
|
-
fieldNames: propsFieldNames
|
|
18
|
+
fieldNames: propsFieldNames
|
|
19
19
|
}),
|
|
20
20
|
_useMatchConfigProps$ = _useMatchConfigProps.fieldNames,
|
|
21
21
|
fieldNames = _useMatchConfigProps$ === void 0 ? {} : _useMatchConfigProps$;
|
|
22
|
-
var relOptions = useMemo(
|
|
23
|
-
function () {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
{
|
|
47
|
-
options: relOptions,
|
|
48
|
-
value: value,
|
|
49
|
-
onChange: function onChange(e) {
|
|
50
|
-
_onChange === null || _onChange === void 0
|
|
51
|
-
? void 0
|
|
52
|
-
: _onChange(e.target.value);
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
props
|
|
56
|
-
)
|
|
57
|
-
);
|
|
58
|
-
};
|
|
22
|
+
var relOptions = useMemo(function () {
|
|
23
|
+
return options === null || options === void 0 ? void 0 : _mapInstanceProperty(options).call(options, function (item) {
|
|
24
|
+
var type = _typeof(item);
|
|
25
|
+
if (type === "string" || type === "number") {
|
|
26
|
+
return item;
|
|
27
|
+
}
|
|
28
|
+
var _fieldNames$label = fieldNames.label,
|
|
29
|
+
labelKey = _fieldNames$label === void 0 ? "" : _fieldNames$label,
|
|
30
|
+
_fieldNames$value = fieldNames.value,
|
|
31
|
+
valueKey = _fieldNames$value === void 0 ? "" : _fieldNames$value;
|
|
32
|
+
return {
|
|
33
|
+
label: item[labelKey],
|
|
34
|
+
value: item[valueKey]
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
}, [options, fieldNames]);
|
|
38
|
+
return /*#__PURE__*/React.createElement(Radio.Group, _extends({
|
|
39
|
+
options: relOptions,
|
|
40
|
+
value: value,
|
|
41
|
+
onChange: function onChange(e) {
|
|
42
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(e.target.value);
|
|
43
|
+
}
|
|
44
|
+
}, props));
|
|
45
|
+
});
|
|
59
46
|
|
|
60
47
|
export { HRadioGroup as default };
|
|
61
48
|
// powered by hdj
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import _concatInstanceProperty from
|
|
3
|
-
import { Space, Checkbox } from
|
|
4
|
-
import { itemOpProvider } from
|
|
5
|
-
import { useClassName } from
|
|
6
|
-
import React from
|
|
2
|
+
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js/instance/concat';
|
|
3
|
+
import { Space, Checkbox } from 'antd';
|
|
4
|
+
import { itemOpProvider } from '../utils.js';
|
|
5
|
+
import { useClassName } from '../../hooks/index.js';
|
|
6
|
+
import React from 'react';
|
|
7
7
|
|
|
8
8
|
var useRootClassName = function useRootClassName(checked) {
|
|
9
9
|
var _context;
|
|
10
10
|
var norClassNames = ["select-item", "select-item-option"];
|
|
11
|
-
return checked
|
|
12
|
-
? _concatInstanceProperty((_context = [])).call(_context, norClassNames, [
|
|
13
|
-
"select-item-option-selected",
|
|
14
|
-
])
|
|
15
|
-
: norClassNames;
|
|
11
|
+
return checked ? _concatInstanceProperty(_context = []).call(_context, norClassNames, ["select-item-option-selected"]) : norClassNames;
|
|
16
12
|
};
|
|
17
13
|
var Index = function Index(_ref) {
|
|
18
14
|
var allSelect = _ref.allSelect,
|
|
@@ -24,48 +20,30 @@ var Index = function Index(_ref) {
|
|
|
24
20
|
_ref$fieldNames = _ref.fieldNames,
|
|
25
21
|
fieldNames = _ref$fieldNames === void 0 ? {} : _ref$fieldNames,
|
|
26
22
|
children = _ref.children;
|
|
27
|
-
var opLen =
|
|
28
|
-
|
|
29
|
-
var checked =
|
|
30
|
-
(value === null || value === void 0 ? void 0 : value.length) >= opLen;
|
|
23
|
+
var opLen = (options === null || options === void 0 ? void 0 : options.length) || 0;
|
|
24
|
+
var checked = (value === null || value === void 0 ? void 0 : value.length) >= opLen;
|
|
31
25
|
var classNames = useRootClassName(checked);
|
|
32
26
|
var optionsClassName = useClassName(classNames);
|
|
33
27
|
var allCheckBox = useClassName("hw-all-check-box");
|
|
34
28
|
var change = function change() {
|
|
35
29
|
if (!checked) {
|
|
36
30
|
var subItemOps = itemOpProvider(options, fieldNames);
|
|
37
|
-
onChange === null || onChange === void 0
|
|
38
|
-
? void 0
|
|
39
|
-
: onChange(options, subItemOps);
|
|
31
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(options, subItemOps);
|
|
40
32
|
return;
|
|
41
33
|
}
|
|
42
34
|
onChange === null || onChange === void 0 ? void 0 : onChange([], []);
|
|
43
35
|
};
|
|
44
36
|
if (!allSelect || mode !== "multiple" || serviceSearch) {
|
|
45
|
-
return /*#__PURE__*/
|
|
37
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
46
38
|
}
|
|
47
|
-
return /*#__PURE__*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
className: optionsClassName,
|
|
56
|
-
onClick: change,
|
|
57
|
-
},
|
|
58
|
-
/*#__PURE__*/ React.createElement(
|
|
59
|
-
Space,
|
|
60
|
-
null,
|
|
61
|
-
/*#__PURE__*/ React.createElement(Checkbox, {
|
|
62
|
-
checked: checked,
|
|
63
|
-
}),
|
|
64
|
-
"\u5168\u90E8"
|
|
65
|
-
)
|
|
66
|
-
),
|
|
67
|
-
children
|
|
68
|
-
);
|
|
39
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
40
|
+
className: allCheckBox
|
|
41
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
className: optionsClassName,
|
|
43
|
+
onClick: change
|
|
44
|
+
}, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Checkbox, {
|
|
45
|
+
checked: checked
|
|
46
|
+
}), "\u5168\u90E8")), children);
|
|
69
47
|
};
|
|
70
48
|
|
|
71
49
|
export { Index as default };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
interface ICheckBoxOptionProps {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
label?: React.ReactNode;
|
|
4
|
+
checked: boolean;
|
|
5
5
|
}
|
|
6
|
-
declare const _default: ({
|
|
7
|
-
label,
|
|
8
|
-
checked,
|
|
9
|
-
}: ICheckBoxOptionProps) => JSX.Element;
|
|
6
|
+
declare const _default: ({ label, checked }: ICheckBoxOptionProps) => JSX.Element;
|
|
10
7
|
export default _default;
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import { Space, Checkbox } from
|
|
3
|
-
import React from
|
|
2
|
+
import { Space, Checkbox } from 'antd';
|
|
3
|
+
import React from 'react';
|
|
4
4
|
|
|
5
|
-
var CheckBoxOption = function (_ref) {
|
|
5
|
+
var CheckBoxOption = (function (_ref) {
|
|
6
6
|
var label = _ref.label,
|
|
7
7
|
checked = _ref.checked;
|
|
8
|
-
return /*#__PURE__*/ React.createElement(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
checked: checked,
|
|
13
|
-
}),
|
|
14
|
-
label
|
|
15
|
-
);
|
|
16
|
-
};
|
|
8
|
+
return /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Checkbox, {
|
|
9
|
+
checked: checked
|
|
10
|
+
}), label);
|
|
11
|
+
});
|
|
17
12
|
|
|
18
13
|
export { CheckBoxOption as default };
|
|
19
14
|
// powered by hdj
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
interface IProps {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
loading?: boolean;
|
|
4
|
+
options?: any[];
|
|
5
|
+
error?: Error;
|
|
6
|
+
reload: VoidFunction;
|
|
7
7
|
}
|
|
8
8
|
declare const Index: React.FC<IProps>;
|
|
9
9
|
export default Index;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import React from
|
|
3
|
-
import { Typography, Row, Space, Spin } from
|
|
4
|
-
import NotFoundContent from
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Typography, Row, Space, Spin } from 'antd';
|
|
4
|
+
import NotFoundContent from './NotFoundContent.js';
|
|
5
5
|
|
|
6
6
|
var Text = Typography.Text;
|
|
7
7
|
var Index = function Index(_ref) {
|
|
@@ -13,39 +13,26 @@ var Index = function Index(_ref) {
|
|
|
13
13
|
children = _ref.children;
|
|
14
14
|
var len = options === null || options === void 0 ? void 0 : options.length;
|
|
15
15
|
if (loading && len === 0) {
|
|
16
|
-
return /*#__PURE__*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
style: {
|
|
20
|
-
height: 125,
|
|
21
|
-
},
|
|
22
|
-
justify: "center",
|
|
23
|
-
align: "middle",
|
|
16
|
+
return /*#__PURE__*/React.createElement(Row, {
|
|
17
|
+
style: {
|
|
18
|
+
height: 125
|
|
24
19
|
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
Text,
|
|
34
|
-
{
|
|
35
|
-
type: "secondary",
|
|
36
|
-
},
|
|
37
|
-
"\u62FC\u547D\u52A0\u8F7D\u4E2D..."
|
|
38
|
-
)
|
|
39
|
-
)
|
|
40
|
-
);
|
|
20
|
+
justify: "center",
|
|
21
|
+
align: "middle"
|
|
22
|
+
}, /*#__PURE__*/React.createElement(Space, {
|
|
23
|
+
direction: "vertical",
|
|
24
|
+
align: "center"
|
|
25
|
+
}, /*#__PURE__*/React.createElement(Spin, null), /*#__PURE__*/React.createElement(Text, {
|
|
26
|
+
type: "secondary"
|
|
27
|
+
}, "\u62FC\u547D\u52A0\u8F7D\u4E2D...")));
|
|
41
28
|
}
|
|
42
29
|
if (error && len === 0) {
|
|
43
|
-
return /*#__PURE__*/
|
|
30
|
+
return /*#__PURE__*/React.createElement(NotFoundContent, {
|
|
44
31
|
error: error,
|
|
45
|
-
reload: reload
|
|
32
|
+
reload: reload
|
|
46
33
|
});
|
|
47
34
|
}
|
|
48
|
-
return /*#__PURE__*/
|
|
35
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
49
36
|
};
|
|
50
37
|
|
|
51
38
|
export { Index as default };
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import React from
|
|
3
|
-
import { Typography } from
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Typography } from 'antd';
|
|
4
4
|
|
|
5
|
-
var NoFindItem = function (_ref) {
|
|
5
|
+
var NoFindItem = (function (_ref) {
|
|
6
6
|
var label = _ref.label;
|
|
7
|
-
return /*#__PURE__*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
label
|
|
13
|
-
);
|
|
14
|
-
};
|
|
7
|
+
return /*#__PURE__*/React.createElement(Typography.Text, {
|
|
8
|
+
type: "danger"
|
|
9
|
+
}, label);
|
|
10
|
+
});
|
|
15
11
|
|
|
16
12
|
export { NoFindItem as default };
|
|
17
13
|
// powered by hdj
|
|
@@ -1,60 +1,38 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import React from
|
|
3
|
-
import { Typography, Row, Space, Button, Empty } from
|
|
4
|
-
import { ExclamationCircleOutlined } from
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Typography, Row, Space, Button, Empty } from 'antd';
|
|
4
|
+
import { ExclamationCircleOutlined } from '@ant-design/icons';
|
|
5
5
|
|
|
6
6
|
var Text = Typography.Text;
|
|
7
|
-
var NotFoundContent = function (_ref) {
|
|
7
|
+
var NotFoundContent = (function (_ref) {
|
|
8
8
|
var error = _ref.error,
|
|
9
9
|
reload = _ref.reload;
|
|
10
10
|
if (error) {
|
|
11
|
-
return /*#__PURE__*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
/*#__PURE__*/ React.createElement(ExclamationCircleOutlined, {
|
|
32
|
-
size: 24,
|
|
33
|
-
})
|
|
34
|
-
),
|
|
35
|
-
/*#__PURE__*/ React.createElement(
|
|
36
|
-
Text,
|
|
37
|
-
{
|
|
38
|
-
type: "danger",
|
|
39
|
-
},
|
|
40
|
-
error.message
|
|
41
|
-
),
|
|
42
|
-
/*#__PURE__*/ React.createElement(
|
|
43
|
-
Button,
|
|
44
|
-
{
|
|
45
|
-
type: "primary",
|
|
46
|
-
size: "small",
|
|
47
|
-
onClick: reload,
|
|
48
|
-
},
|
|
49
|
-
"\u91CD\u65B0\u52A0\u8F7D"
|
|
50
|
-
)
|
|
51
|
-
)
|
|
52
|
-
);
|
|
11
|
+
return /*#__PURE__*/React.createElement(Row, {
|
|
12
|
+
justify: "center",
|
|
13
|
+
align: "middle",
|
|
14
|
+
style: {
|
|
15
|
+
height: 125
|
|
16
|
+
}
|
|
17
|
+
}, /*#__PURE__*/React.createElement(Space, {
|
|
18
|
+
align: "center",
|
|
19
|
+
direction: "vertical"
|
|
20
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
21
|
+
type: "danger"
|
|
22
|
+
}, /*#__PURE__*/React.createElement(ExclamationCircleOutlined, {
|
|
23
|
+
size: 24
|
|
24
|
+
})), /*#__PURE__*/React.createElement(Text, {
|
|
25
|
+
type: "danger"
|
|
26
|
+
}, error.message), /*#__PURE__*/React.createElement(Button, {
|
|
27
|
+
type: "primary",
|
|
28
|
+
size: "small",
|
|
29
|
+
onClick: reload
|
|
30
|
+
}, "\u91CD\u65B0\u52A0\u8F7D")));
|
|
53
31
|
}
|
|
54
|
-
return /*#__PURE__*/
|
|
55
|
-
image: Empty.PRESENTED_IMAGE_SIMPLE
|
|
32
|
+
return /*#__PURE__*/React.createElement(Empty, {
|
|
33
|
+
image: Empty.PRESENTED_IMAGE_SIMPLE
|
|
56
34
|
});
|
|
57
|
-
};
|
|
35
|
+
});
|
|
58
36
|
|
|
59
37
|
export { NotFoundContent as default };
|
|
60
38
|
// powered by hdj
|
|
@@ -1,36 +1,32 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import React from
|
|
3
|
-
import _mapInstanceProperty from
|
|
4
|
-
import _indexOfInstanceProperty from
|
|
5
|
-
import CheckBoxOption from
|
|
6
|
-
import NoFindItem from
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js/instance/map';
|
|
4
|
+
import _indexOfInstanceProperty from '@babel/runtime-corejs3/core-js/instance/index-of';
|
|
5
|
+
import CheckBoxOption from './components/CheckBoxOption.js';
|
|
6
|
+
import NoFindItem from './components/NoFindItem.js';
|
|
7
7
|
|
|
8
8
|
var defaultModeConfig = {
|
|
9
9
|
multiple: {
|
|
10
10
|
icon: null,
|
|
11
11
|
render: function render(item, value) {
|
|
12
|
-
var checkVal =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
: _mapInstanceProperty(value).call(value, function (itemVal) {
|
|
16
|
-
return itemVal.value;
|
|
17
|
-
});
|
|
12
|
+
var checkVal = value === null || value === void 0 ? void 0 : _mapInstanceProperty(value).call(value, function (itemVal) {
|
|
13
|
+
return itemVal.value;
|
|
14
|
+
});
|
|
18
15
|
var newVal = checkVal || [];
|
|
19
|
-
var checked =
|
|
20
|
-
|
|
21
|
-
return /*#__PURE__*/ React.createElement(CheckBoxOption, {
|
|
16
|
+
var checked = _indexOfInstanceProperty(newVal).call(newVal, item.value) !== -1;
|
|
17
|
+
return /*#__PURE__*/React.createElement(CheckBoxOption, {
|
|
22
18
|
label: item.label,
|
|
23
|
-
checked: checked
|
|
19
|
+
checked: checked
|
|
24
20
|
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
27
23
|
};
|
|
28
24
|
var defaultSelectConfig = {
|
|
29
25
|
noMatchItemRender: function noMatchItemRender() {
|
|
30
|
-
return /*#__PURE__*/
|
|
31
|
-
label: "选项被删除,请重新选择"
|
|
26
|
+
return /*#__PURE__*/React.createElement(NoFindItem, {
|
|
27
|
+
label: "选项被删除,请重新选择"
|
|
32
28
|
});
|
|
33
|
-
}
|
|
29
|
+
}
|
|
34
30
|
};
|
|
35
31
|
|
|
36
32
|
export { defaultModeConfig, defaultSelectConfig };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PartialHSelectProps } from "@/components/Select/modal";
|
|
2
2
|
export declare const useValueChange: (params: PartialHSelectProps) => {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
val: any;
|
|
4
|
+
change: (changeVal: any, itemOps: any) => void;
|
|
5
5
|
};
|