@hw-component/form 1.4.9 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/Form/index.js CHANGED
@@ -85,6 +85,9 @@ var HForm = (function (_ref) {
85
85
  hForm.removeDispatchListener();
86
86
  };
87
87
  }, []);
88
+ var defaultOnPressEnter = function defaultOnPressEnter() {
89
+ hForm.submit();
90
+ };
88
91
  return jsxRuntime.jsx(index$1.default, {
89
92
  loading: infoLoading,
90
93
  error: infoErr,
@@ -115,7 +118,9 @@ var HForm = (function (_ref) {
115
118
  _itemData$itemProps = itemData.itemProps,
116
119
  itemProps = _itemData$itemProps === void 0 ? {} : _itemData$itemProps,
117
120
  itemColon = itemData.colon;
118
- var defaultItemProps = _objectSpread(_objectSpread({}, formItemProps), itemProps);
121
+ var defaultItemProps = _objectSpread(_objectSpread({
122
+ onPressEnter: defaultOnPressEnter
123
+ }, formItemProps), itemProps);
119
124
  return /*#__PURE__*/React.createElement(index$3.default, _objectSpread(_objectSpread({}, itemData), {}, {
120
125
  labelAlign: labelAlign,
121
126
  key: name || index,
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { HItemProps } from "@/components/Form/modal";
1
+ import React from "react";
2
+ import type { HItemProps } from "@/components/Form/modal";
3
3
  declare const _default: {
4
4
  Component: React.ForwardRefExoticComponent<import("@/components/Form/modal").HFormItemProps & React.RefAttributes<any>>;
5
5
  placeholder: ({ label }: HItemProps) => string[];
@@ -44,12 +44,12 @@ var InputNumberGroup = function InputNumberGroup(_ref) {
44
44
  value = _ref$value === void 0 ? {} : _ref$value,
45
45
  _ref$valueMap = _ref.valueMap,
46
46
  valueMap = _ref$valueMap === void 0 ? {
47
- min: 'min',
48
- max: 'max'
47
+ min: "min",
48
+ max: "max"
49
49
  } : _ref$valueMap,
50
50
  onChange = _ref.onChange,
51
51
  _ref$placeholder = _ref.placeholder,
52
- placeholder = _ref$placeholder === void 0 ? ['请输入', '请输入'] : _ref$placeholder,
52
+ placeholder = _ref$placeholder === void 0 ? ["请输入", "请输入"] : _ref$placeholder,
53
53
  _ref$inputNumberProps = _ref.inputNumberProps,
54
54
  inputNumberProps = _ref$inputNumberProps === void 0 ? {} : _ref$inputNumberProps,
55
55
  addonAfter = _ref.addonAfter,
@@ -119,7 +119,7 @@ var InputNumberGroup = function InputNumberGroup(_ref) {
119
119
  value: value,
120
120
  onChange: onChange
121
121
  }) : addonAfter, jsxRuntime.jsxs("div", {
122
- className: "".concat(bodyClassname, " ").concat(focus ? activeClassname : '', " ").concat(noHandlerWrap ? noHandlerWrapClassname : ""),
122
+ className: "".concat(bodyClassname, " ").concat(focus ? activeClassname : "", " ").concat(noHandlerWrap ? noHandlerWrapClassname : ""),
123
123
  children: [jsxRuntime.jsx("span", {
124
124
  className: borderClassname
125
125
  }), jsxRuntime.jsx(antd.InputNumber, _objectSpread({
@@ -18,7 +18,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
18
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 subReq = /*#__PURE__*/function () {
20
20
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
21
- var request, file, _yield$request, url;
21
+ var request, file, _yield$request, url, thumbUrl;
22
22
  return _regeneratorRuntime.wrap(function _callee$(_context) {
23
23
  while (1) switch (_context.prev = _context.next) {
24
24
  case 0:
@@ -38,23 +38,25 @@ var subReq = /*#__PURE__*/function () {
38
38
  case 6:
39
39
  _yield$request = _context.sent;
40
40
  url = _yield$request.url;
41
+ thumbUrl = _yield$request.thumbUrl;
41
42
  return _context.abrupt("return", {
42
43
  url: url,
44
+ thumbUrl: thumbUrl,
43
45
  status: "done"
44
46
  });
45
- case 11:
46
- _context.prev = 11;
47
+ case 12:
48
+ _context.prev = 12;
47
49
  _context.t0 = _context["catch"](3);
48
50
  antd.message.error(_context.t0.message);
49
51
  return _context.abrupt("return", {
50
52
  url: "",
51
53
  status: "error"
52
54
  });
53
- case 15:
55
+ case 16:
54
56
  case "end":
55
57
  return _context.stop();
56
58
  }
57
- }, _callee, null, [[3, 11]]);
59
+ }, _callee, null, [[3, 12]]);
58
60
  }));
59
61
  return function subReq(_x) {
60
62
  return _ref2.apply(this, arguments);
@@ -63,19 +65,22 @@ var subReq = /*#__PURE__*/function () {
63
65
  var fileListProvider = function fileListProvider(changeFile, files) {
64
66
  var status = changeFile.status,
65
67
  url = changeFile.url,
66
- uid = changeFile.uid;
68
+ uid = changeFile.uid,
69
+ thumbUrl = changeFile.thumbUrl;
67
70
  if (status === "error") {
68
71
  return files === null || files === void 0 ? void 0 : files.filter(function (item) {
69
72
  return item.uid !== uid;
70
73
  });
71
74
  }
72
75
  return files === null || files === void 0 ? void 0 : files.map(function (item) {
76
+ var fileDefaultThumbUrl = item.thumbUrl || thumbUrl;
73
77
  var resultUrl = url || item.thumbUrl;
74
78
  if (item.uid === uid) {
75
79
  item.status = status;
76
80
  item.response = {
77
81
  url: resultUrl
78
82
  };
83
+ item.thumbUrl = fileDefaultThumbUrl;
79
84
  return item;
80
85
  }
81
86
  return item;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/form",
3
- "version": "1.4.9",
3
+ "version": "1.5.2",
4
4
  "description": "基于antd二次开发",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,26 +43,25 @@ export default (
43
43
  props: HFormItemProps,
44
44
  ref
45
45
  ) => {
46
-
47
46
  const { form, valueType = "float" } = useFormContext();
48
47
 
49
48
  useEffect(() => {
50
- const {name}=props;
51
- if (!name){
49
+ const { name } = props;
50
+ if (!name) {
52
51
  return;
53
52
  }
54
53
  form?.addFormat(name, formatMaker(props, format[valueType]));
55
54
  }, [valueType, props]);
56
55
  const addFormat = (aFormat: Record<string, addFormatItemModal>) => {
57
- const {name}=props;
58
- if (!name){
56
+ const { name } = props;
57
+ if (!name) {
59
58
  return;
60
59
  }
61
60
  form?.addFormat(name, formatMaker(props, aFormat[valueType]));
62
61
  };
63
62
  const addDispatchListener = (key: string, fn: argsFn) => {
64
- const { name , dispatch } = props;
65
- if (!name){
63
+ const { name, dispatch } = props;
64
+ if (!name) {
66
65
  return;
67
66
  }
68
67
  form?.addDispatchListener({ key, name, dispatch }, fn);
@@ -19,7 +19,7 @@ import Cascader from "../Cascader";
19
19
  import VerificationCodeInput from "../Input/VerificationCodeInput";
20
20
  import TrimInput from "../Input/TrimInput";
21
21
  import TrimTextArea from "../TextArea/TrimTextArea";
22
- import HInputNumberGroup from '../Input/InputNumberGroup'
22
+ import HInputNumberGroup from "../Input/InputNumberGroup";
23
23
  export const placeholderConfig = {
24
24
  inputType: [
25
25
  "input",
@@ -29,7 +29,7 @@ export const placeholderConfig = {
29
29
  "verificationCodeInput",
30
30
  "trimInput",
31
31
  "urlUpload",
32
- "textArea"
32
+ "textArea",
33
33
  ],
34
34
  selectType: ["select", "datePicker", "timePicker", "colorInput"],
35
35
  };
@@ -56,7 +56,6 @@ const componentConfig = {
56
56
  trimInput: TrimInput,
57
57
  trimTextArea: TrimTextArea,
58
58
  inputNumberGroup: HInputNumberGroup,
59
-
60
59
  };
61
60
 
62
61
  export default componentConfig;
@@ -30,7 +30,7 @@ export const useDefaultRender = (
30
30
  Component = (dom as ConfigComponentModal).Component;
31
31
  }
32
32
  const node = Component && (
33
- <Component {...componentProps} {...itemProps} form={form} />
33
+ <Component {...componentProps} {...itemProps} form={form}/>
34
34
  );
35
35
  if (render) {
36
36
  const resultNode = render(props, node, form);
@@ -157,13 +157,16 @@ export default () => {
157
157
  form.setFieldsValue(newValue);
158
158
  },
159
159
  validateFields(nameList) {
160
- return new Promise((resolve,reject) => {
161
- form.validateFields(nameList).then((value) => {
162
- const result = this.formatValues(value, "outputValue");
163
- return resolve(result);
164
- }).catch((e)=>{
165
- reject(e);
166
- });
160
+ return new Promise((resolve, reject) => {
161
+ form
162
+ .validateFields(nameList)
163
+ .then((value) => {
164
+ const result = this.formatValues(value, "outputValue");
165
+ return resolve(result);
166
+ })
167
+ .catch((e) => {
168
+ reject(e);
169
+ });
167
170
  });
168
171
  },
169
172
  resetFieldsInitValue: () => {
@@ -1,4 +1,4 @@
1
- import { Form, Row } from "antd";
1
+ import {Form, Input, Row} from "antd";
2
2
  import type { HFormProps, HItemProps } from "./modal";
3
3
  import Item from "./FormItem";
4
4
  import { useCurrentForm, useInfoReq, useValuesChange } from "./hooks";
@@ -62,6 +62,9 @@ export default ({
62
62
  hForm.removeDispatchListener();
63
63
  };
64
64
  }, []);
65
+ const defaultOnPressEnter=()=>{
66
+ hForm.submit();
67
+ }
65
68
  return (
66
69
  <PageHandler
67
70
  loading={infoLoading}
@@ -90,6 +93,7 @@ export default ({
90
93
  colon: itemColon,
91
94
  } = itemData;
92
95
  const defaultItemProps = {
96
+ onPressEnter:defaultOnPressEnter,
93
97
  ...formItemProps,
94
98
  ...itemProps,
95
99
  };
@@ -1,137 +1,149 @@
1
- import { InputNumber, Input } from 'antd';
2
- import { SwapRightOutlined } from '@ant-design/icons';
3
- import React, { useMemo, useState } from 'react';
4
- import type { InputNumberProps } from 'antd/lib/input-number';
1
+ import { InputNumber, Input } from "antd";
2
+ import { SwapRightOutlined } from "@ant-design/icons";
3
+ import React, { useMemo, useState } from "react";
4
+ import type { InputNumberProps } from "antd/lib/input-number";
5
5
  import { useClassName } from "../hooks";
6
- import {addFormatItemModal, HItemProps} from "@/components/Form/modal";
6
+ import type { addFormatItemModal, HItemProps } from "@/components/Form/modal";
7
7
  import HFormConnect from "../Form/HFormConnect";
8
8
 
9
- interface IProps<T=any> {
10
- placeholder?: [string, string] | string;
11
- addonAfter?: React.ReactNode;
12
- valueMap?: {
13
- min: string;
14
- max: string;
15
- };
16
- inputNumberProps?: [InputNumberProps, InputNumberProps] | InputNumberProps;
17
- value?:T;
18
- onChange:(value:T)=>void;
19
- addFormat?: (config: Record<string, addFormatItemModal>) => void;
20
- noHandlerWrap?:boolean;
9
+ interface IProps<T = any> {
10
+ placeholder?: [string, string] | string;
11
+ addonAfter?: React.ReactNode;
12
+ valueMap?: {
13
+ min: string;
14
+ max: string;
15
+ };
16
+ inputNumberProps?: [InputNumberProps, InputNumberProps] | InputNumberProps;
17
+ value?: T;
18
+ onChange: (value: T) => void;
19
+ addFormat?: (config: Record<string, addFormatItemModal>) => void;
20
+ noHandlerWrap?: boolean;
21
21
  }
22
22
  const useArrayProps = (props: any) => {
23
- return useMemo(() => {
24
- if (Array.isArray(props)) {
25
- return props;
26
- }
27
- return [props, props];
28
- }, [props]);
23
+ return useMemo(() => {
24
+ if (Array.isArray(props)) {
25
+ return props;
26
+ }
27
+ return [props, props];
28
+ }, [props]);
29
29
  };
30
- const InputNumberGroup=({
31
- value = {},
32
- valueMap = { min: 'min', max: 'max' },
33
- onChange,
34
- placeholder = ['请输入', '请输入'],
35
- inputNumberProps = {},
36
- addonAfter,
37
- noHandlerWrap=true,
38
- addFormat
39
- }: IProps) => {
40
- const { min, max } = valueMap;
41
- const { [min]: minVal, [max]: maxVal } = value;
42
- const [fsPlaceholder, edPlaceholder] = useArrayProps(placeholder);
43
- const [fsProps, edProps] = useArrayProps(inputNumberProps);
44
- const [focus, setFocus] = useState(false);
45
- const contentClassname = useClassName(["hw-input-group"]);
46
- const bodyClassname = useClassName(["hw-input-group-body"]);
47
- const activeClassname = useClassName(["hw-input-group-active"]);
48
- const borderClassname = useClassName(["hw-input-group-border"]);
49
- const oneClassname = useClassName(["hw-input-group-one"]);
50
- const iconClassname = useClassName(["hw-input-group-icon"]);
51
- const noHandlerWrapClassname = useClassName(["hw-input-group-no-handler-wrap"]);
52
- addFormat?.({
53
- float: {
54
- inputValue: (item, initValue) => {
55
- const { name: valueName = "" } = item;
56
- const {min:minKey,max:maxKey}=valueMap;
57
- const cuValue=initValue[valueName];
58
- const minInitVal=initValue[minKey];
59
- const maxInitVal=initValue[maxKey];
60
- return {
61
- [valueName]:{
62
- [min]:minInitVal,
63
- [max]:maxInitVal,
64
- ...cuValue
65
- }
66
- };
67
- },
68
- outputValue: (item, outputValue) => {
69
- const { name: valueName = "" } = item;
70
- const { [valueName]: itemVal = {} } = outputValue;
71
- const {min:minKey,max:maxKey}=valueMap;
72
- const {[minKey]:minSubVal,[maxKey]:maxSubVal,...oItemVal}=itemVal;
73
- return {
74
- [maxKey]:maxSubVal,
75
- [minKey]:minSubVal,
76
- [valueName]:oItemVal
77
- };
78
- },
79
- },
80
- });
81
- const change = (key: string, val: number | null) => {
82
- const newVal = { ...value };
83
- newVal[key] = val;
84
- onChange?.(newVal);
85
- };
86
- return (
87
- <Input.Group compact className={contentClassname}>
88
- {addonAfter ? React.cloneElement(addonAfter as any, { value, onChange }) : addonAfter}
89
- <div className={`${bodyClassname} ${focus ? activeClassname : ''} ${noHandlerWrap?noHandlerWrapClassname:""}`}>
90
- <span className={borderClassname} />
91
- <InputNumber<number>
92
- bordered={false}
93
- value={minVal}
94
- max={maxVal}
95
- min={0}
96
- className={oneClassname}
97
- onFocus={() => {
98
- setFocus(true);
99
- }}
100
- onBlur={() => {
101
- setFocus(false);
102
- }}
103
- onChange={(val) => {
104
- change(min, val);
105
- }}
106
- placeholder={fsPlaceholder}
107
- {...fsProps}
108
- />
109
- <SwapRightOutlined className={iconClassname} />
110
- <InputNumber<number>
111
- bordered={false}
112
- value={maxVal}
113
- className={oneClassname}
114
- placeholder={edPlaceholder}
115
- min={minVal}
116
- onFocus={() => {
117
- setFocus(true);
118
- }}
119
- onBlur={() => {
120
- setFocus(false);
121
- }}
122
- onChange={(val) => {
123
- change(max, val);
124
- }}
125
- {...edProps}
126
- />
127
- </div>
128
- </Input.Group>
129
- );
30
+ const InputNumberGroup = ({
31
+ value = {},
32
+ valueMap = { min: "min", max: "max" },
33
+ onChange,
34
+ placeholder = ["请输入", "请输入"],
35
+ inputNumberProps = {},
36
+ addonAfter,
37
+ noHandlerWrap = true,
38
+ addFormat,
39
+ }: IProps) => {
40
+ const { min, max } = valueMap;
41
+ const { [min]: minVal, [max]: maxVal } = value;
42
+ const [fsPlaceholder, edPlaceholder] = useArrayProps(placeholder);
43
+ const [fsProps, edProps] = useArrayProps(inputNumberProps);
44
+ const [focus, setFocus] = useState(false);
45
+ const contentClassname = useClassName(["hw-input-group"]);
46
+ const bodyClassname = useClassName(["hw-input-group-body"]);
47
+ const activeClassname = useClassName(["hw-input-group-active"]);
48
+ const borderClassname = useClassName(["hw-input-group-border"]);
49
+ const oneClassname = useClassName(["hw-input-group-one"]);
50
+ const iconClassname = useClassName(["hw-input-group-icon"]);
51
+ const noHandlerWrapClassname = useClassName([
52
+ "hw-input-group-no-handler-wrap",
53
+ ]);
54
+ addFormat?.({
55
+ float: {
56
+ inputValue: (item, initValue) => {
57
+ const { name: valueName = "" } = item;
58
+ const { min: minKey, max: maxKey } = valueMap;
59
+ const cuValue = initValue[valueName];
60
+ const minInitVal = initValue[minKey];
61
+ const maxInitVal = initValue[maxKey];
62
+ return {
63
+ [valueName]: {
64
+ [min]: minInitVal,
65
+ [max]: maxInitVal,
66
+ ...cuValue,
67
+ },
68
+ };
69
+ },
70
+ outputValue: (item, outputValue) => {
71
+ const { name: valueName = "" } = item;
72
+ const { [valueName]: itemVal = {} } = outputValue;
73
+ const { min: minKey, max: maxKey } = valueMap;
74
+ const {
75
+ [minKey]: minSubVal,
76
+ [maxKey]: maxSubVal,
77
+ ...oItemVal
78
+ } = itemVal;
79
+ return {
80
+ [maxKey]: maxSubVal,
81
+ [minKey]: minSubVal,
82
+ [valueName]: oItemVal,
83
+ };
84
+ },
85
+ },
86
+ });
87
+ const change = (key: string, val: number | null) => {
88
+ const newVal = { ...value };
89
+ newVal[key] = val;
90
+ onChange?.(newVal);
91
+ };
92
+ return (
93
+ <Input.Group compact className={contentClassname}>
94
+ {addonAfter
95
+ ? React.cloneElement(addonAfter as any, { value, onChange })
96
+ : addonAfter}
97
+ <div
98
+ className={`${bodyClassname} ${focus ? activeClassname : ""} ${
99
+ noHandlerWrap ? noHandlerWrapClassname : ""
100
+ }`}
101
+ >
102
+ <span className={borderClassname} />
103
+ <InputNumber<number>
104
+ bordered={false}
105
+ value={minVal}
106
+ max={maxVal}
107
+ min={0}
108
+ className={oneClassname}
109
+ onFocus={() => {
110
+ setFocus(true);
111
+ }}
112
+ onBlur={() => {
113
+ setFocus(false);
114
+ }}
115
+ onChange={(val) => {
116
+ change(min, val);
117
+ }}
118
+ placeholder={fsPlaceholder}
119
+ {...fsProps}
120
+ />
121
+ <SwapRightOutlined className={iconClassname} />
122
+ <InputNumber<number>
123
+ bordered={false}
124
+ value={maxVal}
125
+ className={oneClassname}
126
+ placeholder={edPlaceholder}
127
+ min={minVal}
128
+ onFocus={() => {
129
+ setFocus(true);
130
+ }}
131
+ onBlur={() => {
132
+ setFocus(false);
133
+ }}
134
+ onChange={(val) => {
135
+ change(max, val);
136
+ }}
137
+ {...edProps}
138
+ />
139
+ </div>
140
+ </Input.Group>
141
+ );
130
142
  };
131
- const Index=HFormConnect(InputNumberGroup)
143
+ const Index = HFormConnect(InputNumberGroup);
132
144
  export default {
133
- Component: Index,
134
- placeholder: ({ label }: HItemProps) => {
135
- return [`请输入${label}最小值`, `请输入${label}最大值`];
136
- }
137
- };
145
+ Component: Index,
146
+ placeholder: ({ label }: HItemProps) => {
147
+ return [`请输入${label}最小值`, `请输入${label}最大值`];
148
+ },
149
+ };
@@ -5,7 +5,7 @@
5
5
  align-items: center;
6
6
  width: 100%;
7
7
  color: rgba(0, 0, 0, 0.25);
8
- .@{all-input-group}-body{
8
+ .@{all-input-group}-body {
9
9
  position: relative;
10
10
  display: flex !important;
11
11
  flex: 1;
@@ -26,7 +26,7 @@
26
26
  display: none;
27
27
  }
28
28
  }
29
- .@{all-input-group}-border{
29
+ .@{all-input-group}-border {
30
30
  position: absolute;
31
31
  left: -1px;
32
32
  display: none;
@@ -34,13 +34,13 @@
34
34
  height: 100%;
35
35
  background-color: #40a9ff;
36
36
  }
37
- .@{all-input-group}-icon{
37
+ .@{all-input-group}-icon {
38
38
  padding: 0 4px;
39
39
  }
40
- .@{all-input-group}-one{
40
+ .@{all-input-group}-one {
41
41
  flex: 1;
42
42
  }
43
- .@{all-input-group}-active{
43
+ .@{all-input-group}-active {
44
44
  border-color: #40a9ff;
45
45
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
46
46
  }
@@ -2,7 +2,7 @@ import type { HSelectProps } from "@/components/Select/modal";
2
2
  import { Checkbox, Space } from "antd";
3
3
  import { itemOpProvider } from "../utils";
4
4
  import { useClassName } from "../../hooks";
5
- import React, {useMemo} from "react";
5
+ import React, { useMemo } from "react";
6
6
 
7
7
  interface IProps extends HSelectProps {
8
8
  checked?: boolean;
@@ -23,23 +23,23 @@ const Index: React.FC<IProps> = ({
23
23
  fieldNames = {},
24
24
  children,
25
25
  }) => {
26
- const notDisOption=useMemo(()=>{
27
- return options?.filter((item)=>{
28
- return !item.disabled;
29
- })
30
- },[options]);
26
+ const notDisOption = useMemo(() => {
27
+ return options?.filter((item) => {
28
+ return !item.disabled;
29
+ });
30
+ }, [options]);
31
31
  const opLen = notDisOption?.length || 0;
32
32
  const checked = (value as any[])?.length >= opLen;
33
33
  const classNames = useRootClassName(checked);
34
34
  const optionsClassName = useClassName(classNames);
35
35
  const allCheckBox = useClassName("hw-all-check-box");
36
- const allCheck=()=>{
37
- const allCheckOption=options?.filter((item)=>{
38
- return !item.disabled;
39
- });
40
- const subItemOps=itemOpProvider(allCheckOption,fieldNames);
36
+ const allCheck = () => {
37
+ const allCheckOption = options?.filter((item) => {
38
+ return !item.disabled;
39
+ });
40
+ const subItemOps = itemOpProvider(allCheckOption, fieldNames);
41
41
  onChange?.(allCheckOption, subItemOps);
42
- }
42
+ };
43
43
  const change = () => {
44
44
  if (!checked) {
45
45
  allCheck();
@@ -47,7 +47,7 @@ const Index: React.FC<IProps> = ({
47
47
  }
48
48
  onChange?.([], []);
49
49
  };
50
- if (!allSelect || mode !== "multiple" || serviceSearch||opLen===0) {
50
+ if (!allSelect || mode !== "multiple" || serviceSearch || opLen === 0) {
51
51
  return <>{children}</>;
52
52
  }
53
53
  return (
@@ -3,12 +3,12 @@ import React from "react";
3
3
  interface ICheckBoxOptionProps {
4
4
  label?: React.ReactNode;
5
5
  checked: boolean;
6
- disabled?:boolean;
6
+ disabled?: boolean;
7
7
  }
8
- export default ({ label, checked ,disabled}: ICheckBoxOptionProps) => {
8
+ export default ({ label, checked, disabled }: ICheckBoxOptionProps) => {
9
9
  return (
10
10
  <Space>
11
- <Checkbox checked={checked} disabled={disabled}/>
11
+ <Checkbox checked={checked} disabled={disabled} />
12
12
  {label}
13
13
  </Space>
14
14
  );
@@ -9,10 +9,12 @@ export const defaultModeConfig: HSelectProps["modeConfig"] = {
9
9
  const checkVal = value?.map((itemVal) => {
10
10
  return itemVal.value;
11
11
  });
12
- const {label,disabled,value:itemVal}=item;
12
+ const { label, disabled, value: itemVal } = item;
13
13
  const newVal = checkVal || [];
14
14
  const checked = newVal.indexOf(itemVal) !== -1;
15
- return <CheckBoxOption disabled={disabled} label={label} checked={checked} />;
15
+ return (
16
+ <CheckBoxOption disabled={disabled} label={label} checked={checked} />
17
+ );
16
18
  },
17
19
  },
18
20
  };