@hw-component/form 1.10.21 → 1.10.22

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 (53) hide show
  1. package/.eslintcache +1 -1
  2. package/es/Form/FormItem/BasicItem.js +1 -1
  3. package/es/Form/hooks/useAddFormat.d.ts +1 -1
  4. package/es/RichEditor/hooks.d.ts +1 -1
  5. package/es/RichEditor/modal.d.ts +3 -3
  6. package/es/Select/TagSelect/Content.d.ts +1 -1
  7. package/es/Select/TagSelect/hooks.d.ts +1 -1
  8. package/es/Select/hooks/norHooks.js +8 -3
  9. package/es/TDPicker/TimeRangePicker.d.ts +1 -1
  10. package/es/TDPicker/TimeRangePicker.js +1 -1
  11. package/es/TDPicker/index.js +4 -4
  12. package/es/TDPicker/modal.d.ts +2 -2
  13. package/es/Upload/modal.d.ts +1 -1
  14. package/lib/Form/FormItem/BasicItem.js +1 -1
  15. package/lib/Form/hooks/useAddFormat.d.ts +1 -1
  16. package/lib/RichEditor/hooks.d.ts +1 -1
  17. package/lib/RichEditor/modal.d.ts +3 -3
  18. package/lib/Select/TagSelect/Content.d.ts +1 -1
  19. package/lib/Select/TagSelect/hooks.d.ts +1 -1
  20. package/lib/Select/hooks/norHooks.js +7 -2
  21. package/lib/TDPicker/TimeRangePicker.d.ts +1 -1
  22. package/lib/TDPicker/TimeRangePicker.js +1 -1
  23. package/lib/TDPicker/index.js +4 -4
  24. package/lib/TDPicker/modal.d.ts +2 -2
  25. package/lib/Upload/modal.d.ts +1 -1
  26. package/package.json +1 -1
  27. package/src/components/Form/Basic.tsx +4 -2
  28. package/src/components/Form/FormItem/BasicItem.tsx +5 -1
  29. package/src/components/Form/hooks/useAddFormat.tsx +1 -1
  30. package/src/components/Form/hooks/useDefaultRender.tsx +1 -1
  31. package/src/components/Form/hooks/useHForm.ts +3 -3
  32. package/src/components/Form/index.tsx +3 -3
  33. package/src/components/Form/modal.ts +2 -2
  34. package/src/components/InputGroup/index.less +12 -12
  35. package/src/components/InputGroup/index.tsx +13 -13
  36. package/src/components/RichEditor/hooks.ts +3 -2
  37. package/src/components/RichEditor/index.tsx +3 -2
  38. package/src/components/RichEditor/modal.ts +3 -3
  39. package/src/components/Select/TagSelect/Content.tsx +1 -1
  40. package/src/components/Select/TagSelect/hooks.ts +1 -1
  41. package/src/components/Select/TagSelect/index.tsx +2 -2
  42. package/src/components/Select/hooks/norHooks.ts +7 -2
  43. package/src/components/TDPicker/TimePicker.tsx +25 -21
  44. package/src/components/TDPicker/TimeRangePicker.tsx +60 -48
  45. package/src/components/TDPicker/hooks.ts +8 -8
  46. package/src/components/TDPicker/index.tsx +42 -32
  47. package/src/components/TDPicker/modal.ts +14 -13
  48. package/src/components/Text/index.tsx +6 -2
  49. package/src/components/Upload/modal.ts +1 -1
  50. package/src/pages/DatePicker/index.tsx +37 -32
  51. package/src/pages/Form/index.tsx +18 -19
  52. package/src/pages/Select/index.tsx +2 -0
  53. package/src/pages/Upload/index.tsx +6 -2
@@ -1,6 +1,6 @@
1
- import { BraftEditorProps, EditorState } from "braft-editor";
2
- import { PromiseFnResult } from "../modal";
3
- import { addFormatItemModal } from "../Form/modal";
1
+ import type { BraftEditorProps, EditorState } from "braft-editor";
2
+ import type { PromiseFnResult } from "../modal";
3
+ import type { addFormatItemModal } from "../Form/modal";
4
4
  export interface IHRichEditorProps extends Omit<BraftEditorProps, "value" | "onChange"> {
5
5
  value?: string | EditorState;
6
6
  onChange?: (value: string | EditorState) => void;
@@ -1,4 +1,4 @@
1
- import { HTagSelectProps } from "../modal";
1
+ import type { HTagSelectProps } from "../modal";
2
2
  interface IContentProps extends HTagSelectProps {
3
3
  error?: Error;
4
4
  reload: VoidFunction;
@@ -1,4 +1,4 @@
1
- import { HTagSelectProps } from "@/components/Select/modal";
1
+ import type { HTagSelectProps } from "@/components/Select/modal";
2
2
  export declare const useTagControl: ({ value, options, title }: HTagSelectProps) => {
3
3
  labelNode: {};
4
4
  checked: boolean | undefined;
@@ -4,7 +4,7 @@ import _asyncToGenerator from '@babel/runtime-corejs3/helpers/asyncToGenerator';
4
4
  import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
5
5
  import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
6
6
  import _regeneratorRuntime from '@babel/runtime-corejs3/regenerator';
7
- import { useEffect, useState, useMemo } from 'react';
7
+ import { useEffect, useMemo, useState } from 'react';
8
8
  import { useRequest } from 'ahooks';
9
9
  import { useFormContext } from '../../Form/Context/index.js';
10
10
 
@@ -199,14 +199,19 @@ var useSelectReq = function useSelectReq(_ref3) {
199
199
  run({}, "page");
200
200
  }
201
201
  };
202
- var mathShowSearch = showSearch || serviceSearch;
202
+ var mathShowSearch = useMemo(function () {
203
+ if (typeof showSearch == "undefined") {
204
+ return serviceSearch;
205
+ }
206
+ return showSearch;
207
+ }, [showSearch, serviceSearch]);
203
208
  return {
204
209
  run: run,
205
210
  loading: loading,
206
211
  error: error,
207
212
  data: data,
208
213
  onSearch: mathShowSearch ? onSearch : propsOnSearch,
209
- mathShowSearch: showSearch || serviceSearch,
214
+ mathShowSearch: mathShowSearch,
210
215
  reload: reload,
211
216
  onPopupScroll: isList ? onPopupScroll : undefined
212
217
  };
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { HItemProps } from "@/components/Form/modal";
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[];
@@ -54,7 +54,7 @@ var HTimePicker = function HTimePicker(_ref) {
54
54
  order: order,
55
55
  format: format,
56
56
  style: {
57
- width: '100%'
57
+ width: "100%"
58
58
  }
59
59
  }, props));
60
60
  };
@@ -51,9 +51,9 @@ var Index = function Index(_ref) {
51
51
  }
52
52
  if (showSecond) {
53
53
  var sPropsShowTime = typeof showTime === "boolean" ? {
54
- format: 'HH:mm:ss'
54
+ format: "HH:mm:ss"
55
55
  } : _objectSpread({
56
- format: 'HH:mm:ss'
56
+ format: "HH:mm:ss"
57
57
  }, showTime);
58
58
  return {
59
59
  format: "YYYY-MM-DD HH:mm:ss",
@@ -61,9 +61,9 @@ var Index = function Index(_ref) {
61
61
  };
62
62
  }
63
63
  var mPropsShowTime = typeof showTime === "boolean" ? {
64
- format: 'HH:mm'
64
+ format: "HH:mm"
65
65
  } : _objectSpread({
66
- format: 'HH:mm'
66
+ format: "HH:mm"
67
67
  }, showTime);
68
68
  return {
69
69
  format: "YYYY-MM-DD HH:mm",
@@ -6,8 +6,8 @@ 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";
10
- import React from "react";
9
+ import type { TimeRangePickerProps } from "antd/lib/time-picker";
10
+ import type React from "react";
11
11
  interface DisabledDateFnModal<T = Moment | undefined> {
12
12
  (currentDate: Moment, value: T): boolean;
13
13
  }
@@ -5,7 +5,7 @@ import type { UploadChangeParam } from "antd/lib/upload/interface";
5
5
  import type { MediaTypeEnum } from "@/components/Upload/enums";
6
6
  import type { addFormatItemModal } from "@/components/Form/modal";
7
7
  import type React from "react";
8
- import { UploadListType } from "antd/lib/upload/interface";
8
+ import type { UploadListType } from "antd/lib/upload/interface";
9
9
  export interface IUpLoadProps extends Omit<UploadProps, "onChange" | "listType" | "onPreview"> {
10
10
  exFiles?: string[] | null;
11
11
  request?: (file: Exclude<BeforeUploadFileType, File | boolean> | RcFile) => Promise<{
@@ -36,7 +36,7 @@ var Content = function Content(_ref) {
36
36
  size: 4,
37
37
  style: {
38
38
  width: "100%",
39
- display: 'flex'
39
+ display: "flex"
40
40
  },
41
41
  children: [jsxRuntime.jsx("div", {
42
42
  className: className,
@@ -1,4 +1,4 @@
1
- import { addFormatItemModal, HFormItemProps } from "../modal";
1
+ import type { addFormatItemModal, HFormItemProps } from "../modal";
2
2
  interface ResultModal {
3
3
  inputValue?: (value: Record<string, any>) => Record<string, any>;
4
4
  outputValue?: (value: Record<string, any>) => Record<string, any>;
@@ -1,4 +1,4 @@
1
- import { IHRichEditorProps } from "src/components/RichEditor/modal";
1
+ import type { IHRichEditorProps } from "src/components/RichEditor/modal";
2
2
  export declare const useProps: ({ fileRequest, valueType }: IHRichEditorProps) => {
3
3
  fileRequest: any;
4
4
  valueType: any;
@@ -1,6 +1,6 @@
1
- import { BraftEditorProps, EditorState } from "braft-editor";
2
- import { PromiseFnResult } from "../modal";
3
- import { addFormatItemModal } from "../Form/modal";
1
+ import type { BraftEditorProps, EditorState } from "braft-editor";
2
+ import type { PromiseFnResult } from "../modal";
3
+ import type { addFormatItemModal } from "../Form/modal";
4
4
  export interface IHRichEditorProps extends Omit<BraftEditorProps, "value" | "onChange"> {
5
5
  value?: string | EditorState;
6
6
  onChange?: (value: string | EditorState) => void;
@@ -1,4 +1,4 @@
1
- import { HTagSelectProps } from "../modal";
1
+ import type { HTagSelectProps } from "../modal";
2
2
  interface IContentProps extends HTagSelectProps {
3
3
  error?: Error;
4
4
  reload: VoidFunction;
@@ -1,4 +1,4 @@
1
- import { HTagSelectProps } from "@/components/Select/modal";
1
+ import type { HTagSelectProps } from "@/components/Select/modal";
2
2
  export declare const useTagControl: ({ value, options, title }: HTagSelectProps) => {
3
3
  labelNode: {};
4
4
  checked: boolean | undefined;
@@ -200,14 +200,19 @@ var useSelectReq = function useSelectReq(_ref3) {
200
200
  run({}, "page");
201
201
  }
202
202
  };
203
- var mathShowSearch = showSearch || serviceSearch;
203
+ var mathShowSearch = React.useMemo(function () {
204
+ if (typeof showSearch == "undefined") {
205
+ return serviceSearch;
206
+ }
207
+ return showSearch;
208
+ }, [showSearch, serviceSearch]);
204
209
  return {
205
210
  run: run,
206
211
  loading: loading,
207
212
  error: error,
208
213
  data: data,
209
214
  onSearch: mathShowSearch ? onSearch : propsOnSearch,
210
- mathShowSearch: showSearch || serviceSearch,
215
+ mathShowSearch: mathShowSearch,
211
216
  reload: reload,
212
217
  onPopupScroll: isList ? onPopupScroll : undefined
213
218
  };
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { HItemProps } from "@/components/Form/modal";
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[];
@@ -57,7 +57,7 @@ var HTimePicker = function HTimePicker(_ref) {
57
57
  order: order,
58
58
  format: format,
59
59
  style: {
60
- width: '100%'
60
+ width: "100%"
61
61
  }
62
62
  }, props));
63
63
  };
@@ -54,9 +54,9 @@ var Index = function Index(_ref) {
54
54
  }
55
55
  if (showSecond) {
56
56
  var sPropsShowTime = typeof showTime === "boolean" ? {
57
- format: 'HH:mm:ss'
57
+ format: "HH:mm:ss"
58
58
  } : _objectSpread({
59
- format: 'HH:mm:ss'
59
+ format: "HH:mm:ss"
60
60
  }, showTime);
61
61
  return {
62
62
  format: "YYYY-MM-DD HH:mm:ss",
@@ -64,9 +64,9 @@ var Index = function Index(_ref) {
64
64
  };
65
65
  }
66
66
  var mPropsShowTime = typeof showTime === "boolean" ? {
67
- format: 'HH:mm'
67
+ format: "HH:mm"
68
68
  } : _objectSpread({
69
- format: 'HH:mm'
69
+ format: "HH:mm"
70
70
  }, showTime);
71
71
  return {
72
72
  format: "YYYY-MM-DD HH:mm",
@@ -6,8 +6,8 @@ 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";
10
- import React from "react";
9
+ import type { TimeRangePickerProps } from "antd/lib/time-picker";
10
+ import type React from "react";
11
11
  interface DisabledDateFnModal<T = Moment | undefined> {
12
12
  (currentDate: Moment, value: T): boolean;
13
13
  }
@@ -5,7 +5,7 @@ import type { UploadChangeParam } from "antd/lib/upload/interface";
5
5
  import type { MediaTypeEnum } from "@/components/Upload/enums";
6
6
  import type { addFormatItemModal } from "@/components/Form/modal";
7
7
  import type React from "react";
8
- import { UploadListType } from "antd/lib/upload/interface";
8
+ import type { UploadListType } from "antd/lib/upload/interface";
9
9
  export interface IUpLoadProps extends Omit<UploadProps, "onChange" | "listType" | "onPreview"> {
10
10
  exFiles?: string[] | null;
11
11
  request?: (file: Exclude<BeforeUploadFileType, File | boolean> | RcFile) => Promise<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/form",
3
- "version": "1.10.21",
3
+ "version": "1.10.22",
4
4
  "description": "基于antd二次开发",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,7 +34,9 @@ export default ({
34
34
  form.submit();
35
35
  };
36
36
  const globalItemSpan = itemSpan || formItemSpan;
37
- const boxStyle= requiredMode?{paddingLeft:10,width: "100%"}:{width: "100%"};
37
+ const boxStyle = requiredMode
38
+ ? { paddingLeft: 10, width: "100%" }
39
+ : { width: "100%" };
38
40
  return (
39
41
  <Row gutter={gutter} style={boxStyle}>
40
42
  {newConfigData.map((itemData: HItemProps, index) => {
@@ -60,7 +62,7 @@ export default ({
60
62
  const itemStyle = style || formItemStyle;
61
63
  return (
62
64
  <Item
63
- wrapperCol={wrapperCol}
65
+ wrapperCol={wrapperCol}
64
66
  {...itemData}
65
67
  labelAlign={labelAlign}
66
68
  key={key || index}
@@ -30,7 +30,11 @@ const Content: React.FC<ContentProps> = ({
30
30
  const relChild =
31
31
  children && React.cloneElement(children as any, { value, onChange });
32
32
  return (
33
- <Space direction={"vertical"} size={4} style={{ width: "100%" ,display:'flex'}}>
33
+ <Space
34
+ direction={"vertical"}
35
+ size={4}
36
+ style={{ width: "100%", display: "flex" }}
37
+ >
34
38
  <div className={className}>{relChild}</div>
35
39
  <Helper helper={helper} />
36
40
  </Space>
@@ -1,4 +1,4 @@
1
- import { addFormatItemModal, HFormItemProps } from "../modal";
1
+ import type { addFormatItemModal, HFormItemProps } from "../modal";
2
2
  import { useFormContext } from "@/components/Form/Context";
3
3
  import { useEffect } from "react";
4
4
 
@@ -34,7 +34,7 @@ export const useDefaultRender = (
34
34
  );
35
35
  if (render) {
36
36
  const resultNode = render(props, node, form);
37
- const nodeProps=(resultNode as any).props;
37
+ const nodeProps = (resultNode as any).props;
38
38
  return React.cloneElement<any>(resultNode as any, {
39
39
  ...componentProps,
40
40
  ...itemProps,
@@ -160,9 +160,9 @@ export default () => {
160
160
  const newValue = formatValuesFn(values);
161
161
  form.setFieldsValue(newValue);
162
162
  },
163
- setSourceFieldsValue(values){
164
- form.setFieldsValue(values);
165
- },
163
+ setSourceFieldsValue(values) {
164
+ form.setFieldsValue(values);
165
+ },
166
166
  validateFields(nameList) {
167
167
  return new Promise((resolve, reject) => {
168
168
  form
@@ -29,8 +29,8 @@ export default ({
29
29
  dismissOnPressEnter,
30
30
  preserve,
31
31
  rowWrapper,
32
- requiredMode,
33
- style,
32
+ requiredMode,
33
+ style,
34
34
  ...props
35
35
  }: HFormProps) => {
36
36
  const hForm = useCurrentForm(form);
@@ -100,7 +100,7 @@ export default ({
100
100
  onFinish={run}
101
101
  onValuesChange={valuesChange}
102
102
  preserve={preserve}
103
- style={requiredMode?{paddingLeft:10,...style}:style}
103
+ style={requiredMode ? { paddingLeft: 10, ...style } : style}
104
104
  {...props}
105
105
  >
106
106
  <Basic
@@ -127,7 +127,7 @@ export interface HFormProps<T = any, R = any>
127
127
  dismissOnPressEnter?: boolean;
128
128
  rowWrapper?: boolean;
129
129
  flexBox?: boolean;
130
- requiredMode?:boolean;
130
+ requiredMode?: boolean;
131
131
  }
132
132
  export interface HFormItemProps extends HItemProps {
133
133
  required?: boolean;
@@ -213,7 +213,7 @@ export interface HFormInstance extends FormInstance {
213
213
  clearFormat: (name: string) => void;
214
214
  inited: boolean;
215
215
  resetFormStatus: VoidFunction;
216
- setSourceFieldsValue:( values: Record<string, any>)=>void;
216
+ setSourceFieldsValue: (values: Record<string, any>) => void;
217
217
  }
218
218
 
219
219
  export interface ConnectConfigModal {
@@ -25,26 +25,26 @@
25
25
  border-color: #ff4d4f !important;
26
26
  }
27
27
  }
28
- .@{all-input-group}-before-body{
29
- .@{all-input-group}-number-body{
30
- border-top-right-radius:@border-radius-base;
31
- border-bottom-right-radius:@border-radius-base;
28
+ .@{all-input-group}-before-body {
29
+ .@{all-input-group}-number-body {
30
+ border-top-right-radius: @border-radius-base;
31
+ border-bottom-right-radius: @border-radius-base;
32
32
  }
33
33
  }
34
- .@{all-input-group}-after-body{
35
- .@{all-input-group}-number-body{
36
- border-top-left-radius:@border-radius-base;
37
- border-bottom-left-radius:@border-radius-base;
34
+ .@{all-input-group}-after-body {
35
+ .@{all-input-group}-number-body {
36
+ border-top-left-radius: @border-radius-base;
37
+ border-bottom-left-radius: @border-radius-base;
38
38
  }
39
39
  }
40
40
 
41
- .@{all-input-group}-no-addon{
42
- .@{all-input-group}-number-body{
41
+ .@{all-input-group}-no-addon {
42
+ .@{all-input-group}-number-body {
43
43
  border-radius: @border-radius-base;
44
44
  }
45
45
  }
46
- .@{ant-prefix}-form-item-has-error{
47
- .@{ant-prefix}-hw-addon{
46
+ .@{ant-prefix}-form-item-has-error {
47
+ .@{ant-prefix}-hw-addon {
48
48
  color: #ff4d4f;
49
49
  border-color: #ff4d4f;
50
50
  }
@@ -1,4 +1,4 @@
1
- import React, {useMemo} from "react";
1
+ import React, { useMemo } from "react";
2
2
  import { useClassName } from "../hooks";
3
3
  import { Input } from "antd";
4
4
  interface HInputGroupProps<T = any> {
@@ -38,18 +38,18 @@ const Index: React.FC<HInputGroupProps> = ({
38
38
  const beforeAfterClassname = useClassName(["hw-input-group-after-body"]);
39
39
  const noAddonClassname = useClassName(["hw-input-group-no-addon"]);
40
40
 
41
- const cuBodyClassName=useMemo(()=>{
42
- if (addonBefore&&!addonAfter){
43
- return beforeBodyClassname;
44
- }
45
- if (addonAfter&&!addonBefore){
46
- return beforeAfterClassname;
47
- }
48
- if (!addonBefore&&!addonAfter){
49
- return noAddonClassname;
50
- }
51
- return ""
52
- },[addonAfter,addonBefore]);
41
+ const cuBodyClassName = useMemo(() => {
42
+ if (addonBefore && !addonAfter) {
43
+ return beforeBodyClassname;
44
+ }
45
+ if (addonAfter && !addonBefore) {
46
+ return beforeAfterClassname;
47
+ }
48
+ if (!addonBefore && !addonAfter) {
49
+ return noAddonClassname;
50
+ }
51
+ return "";
52
+ }, [addonAfter, addonBefore]);
53
53
  return (
54
54
  <Input.Group compact className={`${contentClassname} ${className}`}>
55
55
  <Addon value={value} onChange={onChange}>
@@ -1,9 +1,10 @@
1
1
  import { useFormConfigContext } from "../Form/Context/FormConfigProvider";
2
2
  import { baseConfig } from "../config";
3
- import { IHRichEditorProps } from "src/components/RichEditor/modal";
3
+ import type { IHRichEditorProps } from "src/components/RichEditor/modal";
4
4
  import { useClassName } from "../hooks";
5
5
  import { useEffect, useMemo, useRef, useState } from "react";
6
- import BraftEditor, { EditorState } from "braft-editor";
6
+ import type { EditorState } from "braft-editor";
7
+ import BraftEditor from "braft-editor";
7
8
 
8
9
  export const useProps = ({ fileRequest, valueType }: IHRichEditorProps) => {
9
10
  const {
@@ -1,6 +1,7 @@
1
- import BraftEditor, { EditorState } from "braft-editor";
1
+ import type { EditorState } from "braft-editor";
2
+ import BraftEditor from "braft-editor";
2
3
  import "braft-editor/dist/index.css";
3
- import { IHRichEditorProps } from "./modal";
4
+ import type { IHRichEditorProps } from "./modal";
4
5
  import { useFocusClassname, useProps, useUploadFn, useVC } from "./hooks";
5
6
  import { useClassName } from "../hooks";
6
7
  import React from "react";
@@ -1,6 +1,6 @@
1
- import { BraftEditorProps, EditorState } from "braft-editor";
2
- import { PromiseFnResult } from "../modal";
3
- import { addFormatItemModal } from "../Form/modal";
1
+ import type { BraftEditorProps, EditorState } from "braft-editor";
2
+ import type { PromiseFnResult } from "../modal";
3
+ import type { addFormatItemModal } from "../Form/modal";
4
4
 
5
5
  export interface IHRichEditorProps
6
6
  extends Omit<BraftEditorProps, "value" | "onChange"> {
@@ -1,4 +1,4 @@
1
- import { HTagSelectProps } from "../modal";
1
+ import type { HTagSelectProps } from "../modal";
2
2
  import { useClassName } from "@/components/hooks";
3
3
  import { Row, Skeleton, Space, Tag, Empty } from "antd";
4
4
  import React from "react";
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useMemo, useState } from "react";
2
- import { HTagSelectProps, OptionType } from "@/components/Select/modal";
2
+ import type { HTagSelectProps, OptionType } from "@/components/Select/modal";
3
3
 
4
4
  export const useTagControl = ({ value, options, title }: HTagSelectProps) => {
5
5
  const { checked, indeterminate } = useMemo(() => {
@@ -2,8 +2,8 @@ import { Collapse, Checkbox } from "antd";
2
2
  import { useClassName, useMatchConfigProps } from "../../hooks";
3
3
  import React from "react";
4
4
  import { useSelectReq } from "../hooks/norHooks";
5
- import { HTagSelectProps } from "../modal";
6
- import { CheckboxProps } from "antd/lib/checkbox/Checkbox";
5
+ import type { HTagSelectProps } from "../modal";
6
+ import type { CheckboxProps } from "antd/lib/checkbox/Checkbox";
7
7
  import Content from "./Content";
8
8
  import {
9
9
  useChangeControl,
@@ -160,14 +160,19 @@ export const useSelectReq = ({
160
160
  run({}, "page");
161
161
  }
162
162
  };
163
- const mathShowSearch = showSearch || serviceSearch;
163
+ const mathShowSearch=useMemo(()=>{
164
+ if (typeof showSearch=="undefined"){
165
+ return serviceSearch;
166
+ }
167
+ return showSearch;
168
+ },[showSearch,serviceSearch])
164
169
  return {
165
170
  run,
166
171
  loading,
167
172
  error,
168
173
  data,
169
174
  onSearch: mathShowSearch ? onSearch : propsOnSearch,
170
- mathShowSearch: showSearch || serviceSearch,
175
+ mathShowSearch,
171
176
  reload,
172
177
  onPopupScroll: isList ? onPopupScroll : undefined,
173
178
  };
@@ -1,9 +1,13 @@
1
- import { TimePicker ,Input} from "antd";
1
+ import { TimePicker, Input } from "antd";
2
2
  import type { HTimePickerProps } from "./modal";
3
- import {usePropsFormat, useTimePickerChange, useTimePickerValue} from "./hooks";
3
+ import {
4
+ usePropsFormat,
5
+ useTimePickerChange,
6
+ useTimePickerValue,
7
+ } from "./hooks";
4
8
  import HFormConnect from "../Form/HFormConnect";
5
9
  import React from "react";
6
- import {useClassName} from "@/components/hooks";
10
+ import { useClassName } from "@/components/hooks";
7
11
 
8
12
  const Index = ({
9
13
  value,
@@ -18,26 +22,26 @@ const Index = ({
18
22
  }: HTimePickerProps) => {
19
23
  addFormat?.({});
20
24
  const timeVal = useTimePickerValue({ value, format });
21
- const propsFormat=usePropsFormat({format})
25
+ const propsFormat = usePropsFormat({ format });
22
26
  const change = useTimePickerChange({ value, format, onChange });
23
- const addonClassName=useClassName("hw-addon")
27
+ const addonClassName = useClassName("hw-addon");
24
28
  return (
25
- <Input.Group compact style={{display:"flex",...style}}>
26
- {addonBefore? <div className={addonClassName}>{addonBefore}</div>:null}
27
- <TimePicker
28
- value={timeVal}
29
- onChange={change}
30
- disabledDate={(currentDate) => {
31
- return !!disabledDate?.(currentDate, timeVal);
32
- }}
33
- style={{
34
- flex:1
35
- }}
36
- format={propsFormat}
37
- {...props}
38
- />
39
- {addonAfter? <div className={addonClassName}>{addonAfter}</div>:null}
40
- </Input.Group>
29
+ <Input.Group compact style={{ display: "flex", ...style }}>
30
+ {addonBefore ? <div className={addonClassName}>{addonBefore}</div> : null}
31
+ <TimePicker
32
+ value={timeVal}
33
+ onChange={change}
34
+ disabledDate={(currentDate) => {
35
+ return !!disabledDate?.(currentDate, timeVal);
36
+ }}
37
+ style={{
38
+ flex: 1,
39
+ }}
40
+ format={propsFormat}
41
+ {...props}
42
+ />
43
+ {addonAfter ? <div className={addonClassName}>{addonAfter}</div> : null}
44
+ </Input.Group>
41
45
  );
42
46
  };
43
47
  export default HFormConnect(Index);