@hw-component/form 1.9.88 → 1.9.90

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.
Files changed (40) hide show
  1. package/.eslintcache +1 -1
  2. package/es/Form/config.d.ts +5 -0
  3. package/es/Form/config.js +3 -1
  4. package/es/Form/hooks/useHForm.js +3 -0
  5. package/es/Form/modal.d.ts +1 -0
  6. package/es/Select/TagSelect/Content.d.ts +1 -1
  7. package/es/Select/TagSelect/hooks.d.ts +2 -2
  8. package/es/TDPicker/TimeRangePicker.d.ts +8 -0
  9. package/es/TDPicker/TimeRangePicker.js +74 -0
  10. package/es/TDPicker/modal.d.ts +9 -0
  11. package/es/index.css +1 -4
  12. package/es/index.d.ts +5 -0
  13. package/es/index.js +2 -1
  14. package/lib/Form/config.d.ts +5 -0
  15. package/lib/Form/config.js +3 -1
  16. package/lib/Form/hooks/useHForm.js +3 -0
  17. package/lib/Form/modal.d.ts +1 -0
  18. package/lib/Select/TagSelect/Content.d.ts +1 -1
  19. package/lib/Select/TagSelect/hooks.d.ts +2 -2
  20. package/lib/TDPicker/TimeRangePicker.d.ts +8 -0
  21. package/lib/TDPicker/TimeRangePicker.js +77 -0
  22. package/lib/TDPicker/modal.d.ts +9 -0
  23. package/lib/index.css +1 -4
  24. package/lib/index.d.ts +5 -0
  25. package/lib/index.js +2 -0
  26. package/package.json +1 -1
  27. package/src/components/Form/config.ts +5 -2
  28. package/src/components/Form/hooks/useHForm.ts +3 -0
  29. package/src/components/Form/index.less +0 -6
  30. package/src/components/Form/modal.ts +1 -0
  31. package/src/components/Select/TagSelect/Content.tsx +71 -43
  32. package/src/components/Select/TagSelect/hooks.ts +102 -93
  33. package/src/components/Select/TagSelect/index.tsx +94 -68
  34. package/src/components/Select/index.less +3 -4
  35. package/src/components/Select/modal.ts +8 -8
  36. package/src/components/TDPicker/TimeRangePicker.tsx +51 -0
  37. package/src/components/TDPicker/modal.ts +10 -0
  38. package/src/components/index.tsx +2 -0
  39. package/src/pages/Form/index.tsx +21 -16
  40. package/src/pages/Select/index.tsx +34 -32
@@ -1,102 +1,111 @@
1
- import {useEffect, useMemo, useState} from "react";
2
- import {HTagSelectProps, OptionType} from "@/components/Select/modal";
1
+ import { useEffect, useMemo, useState } from "react";
2
+ import { HTagSelectProps, OptionType } from "@/components/Select/modal";
3
3
 
4
- export const useTagControl=({value,options,title}:HTagSelectProps)=>{
5
- const {checked,indeterminate}=useMemo(()=>{
6
- const len=value?.length;
7
- const opLen=options?.length;
8
- if (!opLen){
9
- return {
10
- checked:false
11
- }
12
- }
13
- if (len===opLen){
14
- return {
15
- checked:true
16
- }
17
- }
18
- return {
19
- indeterminate:!!len
20
- }
21
- },[value,options]);
22
- const labelNode=useMemo(()=>{
23
- if (title){
24
- return title;
25
- }
26
- if (checked){
27
- return "取消"
28
- }
29
- return "全选"
30
- },[title,checked,indeterminate]);
31
- return {
32
- labelNode,
33
- checked,
34
- indeterminate
35
- }
36
- }
37
-
38
- export const useChangeControl=({options,value,onChange,fieldNames}:HTagSelectProps)=>{
39
- const {value:valueKey="value"}=fieldNames||{};
40
- const optsNk=(newVal)=>{
41
- const newOpts:OptionType[]=[];
42
- newVal?.forEach((itemVal)=>{
43
- const index=options?.findIndex((item)=>{
44
- return itemVal===item[valueKey];
45
- });
46
- if (typeof index!=="undefined"){
47
- newOpts.push((options?.[index] as OptionType));
48
- }
49
- });
50
- return newOpts;
4
+ export const useTagControl = ({ value, options, title }: HTagSelectProps) => {
5
+ const { checked, indeterminate } = useMemo(() => {
6
+ const len = value?.length;
7
+ const opLen = options?.length;
8
+ if (!opLen) {
9
+ return {
10
+ checked: false,
11
+ };
51
12
  }
52
- const checkedVal=(val)=>{
53
- const newVal=[...value];
54
- newVal.push(val);
55
- onChange?.(newVal,optsNk(newVal));
13
+ if (len === opLen) {
14
+ return {
15
+ checked: true,
16
+ };
56
17
  }
57
- const removeVal=(index)=>{
58
- const newVal=[...value];
59
- newVal.splice(index,1);
60
- onChange?.(newVal,optsNk(newVal));
18
+ return {
19
+ indeterminate: !!len,
20
+ };
21
+ }, [value, options]);
22
+ const labelNode = useMemo(() => {
23
+ if (title) {
24
+ return title;
61
25
  }
62
- const change=(val)=>{
63
- const index=value?.indexOf(val);
64
- const checked=index===-1;
65
- if (checked){
66
- return checkedVal(val);
67
- }
68
- return removeVal(index);
26
+ if (checked) {
27
+ return "取消";
69
28
  }
70
- const allCheck=(e)=>{
71
- if (!e.target.checked){
72
- return onChange?.([],[]);
73
- }
74
- const newVal=options?.map((item)=>{
75
- return item[valueKey];
76
- });
77
- return onChange?.(newVal,options);
29
+ return "全选";
30
+ }, [title, checked, indeterminate]);
31
+ return {
32
+ labelNode,
33
+ checked,
34
+ indeterminate,
35
+ };
36
+ };
37
+
38
+ export const useChangeControl = ({
39
+ options,
40
+ value,
41
+ onChange,
42
+ fieldNames,
43
+ }: HTagSelectProps) => {
44
+ const { value: valueKey = "value" } = fieldNames || {};
45
+ const optsNk = (newVal) => {
46
+ const newOpts: OptionType[] = [];
47
+ newVal?.forEach((itemVal) => {
48
+ const index = options?.findIndex((item) => {
49
+ return itemVal === item[valueKey];
50
+ });
51
+ if (typeof index !== "undefined") {
52
+ newOpts.push(options?.[index] as OptionType);
53
+ }
54
+ });
55
+ return newOpts;
56
+ };
57
+ const checkedVal = (val) => {
58
+ const newVal = [...value];
59
+ newVal.push(val);
60
+ onChange?.(newVal, optsNk(newVal));
61
+ };
62
+ const removeVal = (index) => {
63
+ const newVal = [...value];
64
+ newVal.splice(index, 1);
65
+ onChange?.(newVal, optsNk(newVal));
66
+ };
67
+ const change = (val) => {
68
+ const index = value?.indexOf(val);
69
+ const checked = index === -1;
70
+ if (checked) {
71
+ return checkedVal(val);
78
72
  }
79
- return {
80
- change,
81
- allCheck
73
+ return removeVal(index);
74
+ };
75
+ const allCheck = (e) => {
76
+ if (!e.target.checked) {
77
+ return onChange?.([], []);
82
78
  }
83
- }
79
+ const newVal = options?.map((item) => {
80
+ return item[valueKey];
81
+ });
82
+ return onChange?.(newVal, options);
83
+ };
84
+ return {
85
+ change,
86
+ allCheck,
87
+ };
88
+ };
84
89
 
85
- export const useCollapseControl=({visible,defaultVisible,onVisibleChange}:HTagSelectProps)=>{
86
- const [activeKey,setActiveKey]=useState(defaultVisible?["1"]:[]);
87
- useEffect(() => {
88
- if (typeof visible==="undefined"){
89
- return;
90
- }
91
- setActiveKey(visible?["1"]:[]);
92
- }, [visible]);
93
- const onChange=(keys)=>{
94
- const len=keys?.length;
95
- onVisibleChange?.(!!len);
96
- setActiveKey(keys)
90
+ export const useCollapseControl = ({
91
+ visible,
92
+ defaultVisible,
93
+ onVisibleChange,
94
+ }: HTagSelectProps) => {
95
+ const [activeKey, setActiveKey] = useState(defaultVisible ? ["1"] : []);
96
+ useEffect(() => {
97
+ if (typeof visible === "undefined") {
98
+ return;
97
99
  }
98
- return {
99
- activeKey,
100
- onChange
101
- }
102
- }
100
+ setActiveKey(visible ? ["1"] : []);
101
+ }, [visible]);
102
+ const onChange = (keys) => {
103
+ const len = keys?.length;
104
+ onVisibleChange?.(!!len);
105
+ setActiveKey(keys);
106
+ };
107
+ return {
108
+ activeKey,
109
+ onChange,
110
+ };
111
+ };
@@ -1,79 +1,105 @@
1
- import {Collapse, Checkbox} from 'antd';
2
- import {useClassName, useMatchConfigProps} from "../../hooks";
1
+ import { Collapse, Checkbox } from "antd";
2
+ import { useClassName, useMatchConfigProps } from "../../hooks";
3
3
  import React from "react";
4
- import {useSelectReq} from "../hooks/norHooks";
5
- import {HTagSelectProps} from "../modal";
6
- import {CheckboxProps} from "antd/lib/checkbox/Checkbox";
7
- import Content from './Content';
8
- import {useChangeControl, useCollapseControl, useTagControl} from "@/components/Select/TagSelect/hooks";
4
+ import { useSelectReq } from "../hooks/norHooks";
5
+ import { HTagSelectProps } from "../modal";
6
+ import { CheckboxProps } from "antd/lib/checkbox/Checkbox";
7
+ import Content from "./Content";
8
+ import {
9
+ useChangeControl,
10
+ useCollapseControl,
11
+ useTagControl,
12
+ } from "@/components/Select/TagSelect/hooks";
9
13
  import HFormConnect from "@/components/Form/HFormConnect";
10
14
  const { Panel } = Collapse;
11
15
 
12
- const ItemTitle:React.FC<CheckboxProps>=({children,...props})=>{
13
- return <div onClick={(event)=>{
16
+ const ItemTitle: React.FC<CheckboxProps> = ({ children, ...props }) => {
17
+ return (
18
+ <div
19
+ onClick={(event) => {
14
20
  event.stopPropagation();
15
- }}>
16
- <Checkbox {...props}>
17
- {children}
18
- </Checkbox>
21
+ }}
22
+ >
23
+ <Checkbox {...props}>{children}</Checkbox>
19
24
  </div>
20
- }
21
- const Index:React.FC<HTagSelectProps>=({
22
- options,
23
- value=[],
24
- onChange,
25
- dispatch,
26
- fieldNames:propsFieldNames,
27
- request,
28
- title,
29
- manual,
30
- className="",
31
- visible,
25
+ );
26
+ };
27
+ const Index: React.FC<HTagSelectProps> = ({
28
+ options,
29
+ value = [],
30
+ onChange,
31
+ dispatch,
32
+ fieldNames: propsFieldNames,
33
+ request,
34
+ title,
35
+ manual,
36
+ className = "",
37
+ visible,
38
+ defaultVisible,
39
+ onVisibleChange,
40
+ addDispatchListener,
41
+ }) => {
42
+ const collapseClassName = useClassName("hw-tag-select");
43
+ const { fieldNames } = useMatchConfigProps({ fieldNames: propsFieldNames });
44
+ const { activeKey, onChange: colChange } = useCollapseControl({
32
45
  defaultVisible,
46
+ visible,
33
47
  onVisibleChange,
34
- addDispatchListener
35
- })=>{
36
- const collapseClassName = useClassName("hw-tag-select");
37
- const { fieldNames } = useMatchConfigProps({ fieldNames: propsFieldNames });
38
- const {activeKey,onChange:colChange}=useCollapseControl({defaultVisible,visible,onVisibleChange})
39
- const {
40
- loading,
41
- data: resultData,
42
- error,
43
- reload,
44
- } = useSelectReq({
45
- options,
46
- manual,
47
- request,
48
- dispatch,
49
- }); //options
50
- const {labelNode,checked,indeterminate}=useTagControl({value,options:resultData,title});
51
- const {allCheck}=useChangeControl({
52
- value,
53
- options:resultData,
54
- onChange,
55
- fieldNames
56
- });
57
- addDispatchListener?.("reload", reload);
58
- return <Collapse bordered={false}
59
- ghost
60
- activeKey={activeKey}
61
- onChange={colChange}
62
- className={`${collapseClassName} ${className}`}
48
+ });
49
+ const {
50
+ loading,
51
+ data: resultData,
52
+ error,
53
+ reload,
54
+ } = useSelectReq({
55
+ options,
56
+ manual,
57
+ request,
58
+ dispatch,
59
+ }); //options
60
+ const { labelNode, checked, indeterminate } = useTagControl({
61
+ value,
62
+ options: resultData,
63
+ title,
64
+ });
65
+ const { allCheck } = useChangeControl({
66
+ value,
67
+ options: resultData,
68
+ onChange,
69
+ fieldNames,
70
+ });
71
+ addDispatchListener?.("reload", reload);
72
+ return (
73
+ <Collapse
74
+ bordered={false}
75
+ ghost
76
+ activeKey={activeKey}
77
+ onChange={colChange}
78
+ className={`${collapseClassName} ${className}`}
63
79
  >
64
- <Panel key="1" header={<ItemTitle indeterminate={indeterminate}
65
- checked={checked}
66
- onChange={allCheck}
67
- >{labelNode}</ItemTitle>}>
68
- <Content loading={loading}
69
- options={resultData}
70
- value={value}
71
- error={error}
72
- onChange={onChange}
73
- reload={reload}
74
- fieldNames={fieldNames}
75
- />
76
- </Panel>
80
+ <Panel
81
+ key="1"
82
+ header={
83
+ <ItemTitle
84
+ indeterminate={indeterminate}
85
+ checked={checked}
86
+ onChange={allCheck}
87
+ >
88
+ {labelNode}
89
+ </ItemTitle>
90
+ }
91
+ >
92
+ <Content
93
+ loading={loading}
94
+ options={resultData}
95
+ value={value}
96
+ error={error}
97
+ onChange={onChange}
98
+ reload={reload}
99
+ fieldNames={fieldNames}
100
+ />
101
+ </Panel>
77
102
  </Collapse>
78
- }
103
+ );
104
+ };
79
105
  export default HFormConnect(Index);
@@ -58,13 +58,12 @@
58
58
  .@{ant-prefix}-hw-tag-select {
59
59
  width: 100%;
60
60
  .@{ant-prefix}-collapse-content-box {
61
- padding: 0px 40px !important;
61
+ padding: 0 40px !important;
62
62
  }
63
- .@{ant-prefix}-hw-tag-select{
63
+ .@{ant-prefix}-hw-tag-select {
64
64
  cursor: pointer;
65
65
  }
66
- .@{ant-prefix}-collapse-header{
66
+ .@{ant-prefix}-collapse-header {
67
67
  padding: 5px 16px !important;
68
68
  }
69
69
  }
70
-
@@ -2,7 +2,7 @@ import type { SelectProps } from "antd";
2
2
  import type React from "react";
3
3
  import type { PromiseFnResult } from "../modal";
4
4
  import type { addFormatItemModal, argsFn, DispatchModal } from "../Form/modal";
5
- import {CollapseProps} from "antd/lib/collapse/Collapse";
5
+ import { CollapseProps } from "antd/lib/collapse/Collapse";
6
6
 
7
7
  export type OptionType = Record<string, any>;
8
8
  export type RenderFn = (data: OptionType) => React.ReactNode;
@@ -25,7 +25,7 @@ export interface OptionsPageResultModal {
25
25
  }
26
26
  export type OptionsDataType = OptionsListType | OptionsPageResultModal;
27
27
  export interface HSelectProps
28
- extends Omit<SelectProps, "options" | "placeholder"|"onChange"> {
28
+ extends Omit<SelectProps, "options" | "placeholder" | "onChange"> {
29
29
  style?: React.CSSProperties;
30
30
  request?: PromiseFnResult<any, OptionsDataType>;
31
31
  manual?: boolean;
@@ -42,16 +42,16 @@ export interface HSelectProps
42
42
  isList?: boolean;
43
43
  addonBefore?: React.ReactNode;
44
44
  addonAfter?: React.ReactNode;
45
- onChange?:(value:any,opts?:OptionType[]|OptionType)=>void;
45
+ onChange?: (value: any, opts?: OptionType[] | OptionType) => void;
46
46
  }
47
47
  export interface FilterDataModal {
48
48
  value: any;
49
49
  index: number;
50
50
  }
51
- export interface HTagSelectProps extends HSelectProps{
52
- title?:React.ReactNode;
53
- defaultVisible?:boolean;
54
- visible?:boolean;
55
- onVisibleChange?:(visible:boolean)=>void;
51
+ export interface HTagSelectProps extends HSelectProps {
52
+ title?: React.ReactNode;
53
+ defaultVisible?: boolean;
54
+ visible?: boolean;
55
+ onVisibleChange?: (visible: boolean) => void;
56
56
  }
57
57
  export type PartialHSelectProps = Partial<HSelectProps>;
@@ -0,0 +1,51 @@
1
+ import { TimePicker } from 'antd';
2
+ import React from "react";
3
+ import HFormConnect from "@/components/Form/HFormConnect";
4
+ import {HTimeRangePickerProps} from "@/components/TDPicker/modal";
5
+ import {HItemProps} from "@/components/Form/modal";
6
+ import moment from "moment";
7
+ const HTimePicker:React.FC<HTimeRangePickerProps>=({value,format="HH:mm:ss",addFormat,valueMap={},onChange,order=false,...props})=>{
8
+ const {start="startTime",end="endTime"}=valueMap;
9
+ addFormat?.({
10
+ float: {
11
+ inputValue: (item, initValue) => {
12
+ const {[start]:initStart,[end]:initEnd}=initValue;
13
+ const {name}=item;
14
+ if (initStart&&initEnd){
15
+ return {
16
+ [(name as string)]:[
17
+ moment(initStart,format),
18
+ moment(initEnd,format)
19
+ ]
20
+ }
21
+ }
22
+ return {
23
+ [(name as string)]:[]
24
+ };
25
+ },
26
+ outputValue: (item, outputValue) => {
27
+ const { name: valueName = "" } = item;
28
+ const { [valueName as string]: itemVal } = outputValue;
29
+ const [startVal,endVal]=itemVal||[];
30
+ return {
31
+ [start]:startVal?.format(format),
32
+ [end]:endVal?.format(format)
33
+ };
34
+ },
35
+ },
36
+ });
37
+
38
+ return <TimePicker.RangePicker value={value} onChange={onChange} order={order} style={{ width: '100%' }} {...props}/>;
39
+ }
40
+
41
+ const Index=HFormConnect(HTimePicker);
42
+
43
+ export default {
44
+ Component: Index,
45
+ placeholder: ({ label }: HItemProps) => {
46
+ return [`请选择开始${label}`, `请选择结束${label}`];
47
+ },
48
+ requiredErrMsg: ({ label }: HItemProps) => {
49
+ return `请选择${label}`;
50
+ },
51
+ };
@@ -6,6 +6,7 @@ import type { TimePickerProps } from "antd";
6
6
  import type { DurationInputArg2 } from "moment";
7
7
  import type { DateRangePickerValueMapModal } from "../modal";
8
8
  import type { addFormatItemModal } from "../Form/modal";
9
+ import {TimeRangePickerProps} from "antd/lib/time-picker";
9
10
  interface DisabledDateFnModal<T = Moment | undefined> {
10
11
  (currentDate: Moment, value: T): boolean;
11
12
  }
@@ -47,3 +48,12 @@ export interface HTimePickerProps
47
48
  disabledDate?: DisabledDateFnModal;
48
49
  addFormat?: (config: Record<string, addFormatItemModal>) => void;
49
50
  }
51
+
52
+ export interface HTimeRangePickerProps extends Omit<TimeRangePickerProps, "format">{
53
+ valueMap?:{
54
+ start:string;
55
+ end:string;
56
+ }
57
+ format?:string;
58
+ addFormat?: (config: Record<string, addFormatItemModal>) => void;
59
+ }
@@ -42,3 +42,5 @@ export const HTrimTextArea = FormConfig.trimTextArea;
42
42
  export const HInputNumberGroup = FormConfig.inputNumberGroup.Component;
43
43
 
44
44
  export const HTagSelect = FormConfig.tagSelect;
45
+
46
+ export const HTimeRangePicker = FormConfig.timeRangePicker;
@@ -77,28 +77,31 @@ export default () => {
77
77
  configData={[
78
78
  {
79
79
  label: "tagSelect",
80
- type:"tagSelect",
80
+ type: "tagSelect",
81
81
  name: "wz",
82
- dispatch: {
83
- fnKey: 'reload',
84
- dependencies: ['wz1'],
82
+ dispatch: {
83
+ fnKey: "reload",
84
+ dependencies: ["wz1"],
85
+ },
86
+ itemProps: {
87
+ request: () => {
88
+ return new Promise((resolve, reject) => {
89
+ setTimeout(() => {
90
+ resolve([
91
+ {
92
+ value: "你好",
93
+ key: "1",
94
+ },
95
+ ]);
96
+ }, 3000);
97
+ });
85
98
  },
86
- itemProps:{
87
- request:()=>{
88
- return new Promise((resolve, reject)=>{
89
- setTimeout(()=>{
90
- resolve([{
91
- value:"你好",
92
- key:"1"
93
- }])
94
- },3000)
95
- })
96
- }
97
- }
99
+ },
98
100
  },
99
101
  {
100
102
  label: "文字1",
101
103
  name: "wz1",
104
+ type:"timeRangePicker"
102
105
  },
103
106
  // {
104
107
  // label: "inputSelect",
@@ -237,6 +240,8 @@ export default () => {
237
240
  form={form}
238
241
  initialValues={{
239
242
  richEditor: "1312312",
243
+ startTime:'07:00:00' ,
244
+ endTime:"14:00:00"
240
245
  }}
241
246
  labelAlign={"left"}
242
247
  onFinish={(value) => {
@@ -1,12 +1,12 @@
1
- import { HSelect ,HTagSelect} from "../../components";
1
+ import { HSelect, HTagSelect } from "../../components";
2
2
  import { Form, Space } from "antd";
3
3
  import { useEffect, useState } from "react";
4
4
  export default () => {
5
5
  const [selectVal, setSelectVal] = useState([{ name: "11", id: -100 }]);
6
6
  const [op, setOp] = useState([{ label: "1", value: 1 }]);
7
7
  const [val, setVal] = useState([2, 3]);
8
- const [tagVal, setTagVal] = useState([]);
9
- const [visible,setVisible]=useState(true);
8
+ const [tagVal, setTagVal] = useState([]);
9
+ const [visible, setVisible] = useState(true);
10
10
  return (
11
11
  <Space size={"large"} direction={"vertical"} style={{ width: "100%" }}>
12
12
  <HSelect
@@ -40,39 +40,41 @@ export default () => {
40
40
  />
41
41
  <HSelect
42
42
  value={val}
43
- onChange={(v,opts) => {
44
- console.log(v,opts)
43
+ onChange={(v, opts) => {
44
+ console.log(v, opts);
45
45
  setVal(v);
46
46
  }}
47
47
  mode="multiple"
48
48
  />
49
- <div onClick={()=>{
50
- setVisible(false)
51
- }}>
52
- 关闭
53
- </div>
54
- <HTagSelect
55
- value={tagVal}
56
- visible={visible}
57
- onVisibleChange={(v)=>{
58
- console.log(v)
59
- }}
60
- request={()=>{
61
- return new Promise((resolve, reject)=>{
62
- setTimeout(()=>{
63
- resolve([])
64
- },3000)
65
- })
66
- }}
67
- onChange={(value, opts)=>{
68
- setTagVal(value);
69
- console.log(value,opts)
70
- }}
71
- fieldNames={{
72
- label:"value",
73
- value:"key"
74
- }}
75
- />
49
+ <div
50
+ onClick={() => {
51
+ setVisible(false);
52
+ }}
53
+ >
54
+ 关闭
55
+ </div>
56
+ <HTagSelect
57
+ value={tagVal}
58
+ visible={visible}
59
+ onVisibleChange={(v) => {
60
+ console.log(v);
61
+ }}
62
+ request={() => {
63
+ return new Promise((resolve, reject) => {
64
+ setTimeout(() => {
65
+ resolve([]);
66
+ }, 3000);
67
+ });
68
+ }}
69
+ onChange={(value, opts) => {
70
+ setTagVal(value);
71
+ console.log(value, opts);
72
+ }}
73
+ fieldNames={{
74
+ label: "value",
75
+ value: "key",
76
+ }}
77
+ />
76
78
  <div
77
79
  onClick={() => {
78
80
  setOp([{ label: "2", value: 2 }]);