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