@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.
- package/.eslintcache +1 -1
- package/es/Form/FormItem/BasicItem.js +1 -1
- package/es/Form/hooks/useAddFormat.d.ts +1 -1
- package/es/RichEditor/hooks.d.ts +1 -1
- package/es/RichEditor/modal.d.ts +3 -3
- package/es/Select/TagSelect/Content.d.ts +1 -1
- package/es/Select/TagSelect/hooks.d.ts +1 -1
- package/es/Select/hooks/norHooks.js +8 -3
- package/es/TDPicker/TimeRangePicker.d.ts +1 -1
- package/es/TDPicker/TimeRangePicker.js +1 -1
- package/es/TDPicker/index.js +4 -4
- package/es/TDPicker/modal.d.ts +2 -2
- package/es/Upload/modal.d.ts +1 -1
- package/lib/Form/FormItem/BasicItem.js +1 -1
- package/lib/Form/hooks/useAddFormat.d.ts +1 -1
- package/lib/RichEditor/hooks.d.ts +1 -1
- package/lib/RichEditor/modal.d.ts +3 -3
- package/lib/Select/TagSelect/Content.d.ts +1 -1
- package/lib/Select/TagSelect/hooks.d.ts +1 -1
- package/lib/Select/hooks/norHooks.js +7 -2
- package/lib/TDPicker/TimeRangePicker.d.ts +1 -1
- package/lib/TDPicker/TimeRangePicker.js +1 -1
- package/lib/TDPicker/index.js +4 -4
- package/lib/TDPicker/modal.d.ts +2 -2
- package/lib/Upload/modal.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/Form/Basic.tsx +4 -2
- package/src/components/Form/FormItem/BasicItem.tsx +5 -1
- package/src/components/Form/hooks/useAddFormat.tsx +1 -1
- package/src/components/Form/hooks/useDefaultRender.tsx +1 -1
- package/src/components/Form/hooks/useHForm.ts +3 -3
- package/src/components/Form/index.tsx +3 -3
- package/src/components/Form/modal.ts +2 -2
- package/src/components/InputGroup/index.less +12 -12
- package/src/components/InputGroup/index.tsx +13 -13
- package/src/components/RichEditor/hooks.ts +3 -2
- package/src/components/RichEditor/index.tsx +3 -2
- package/src/components/RichEditor/modal.ts +3 -3
- package/src/components/Select/TagSelect/Content.tsx +1 -1
- package/src/components/Select/TagSelect/hooks.ts +1 -1
- package/src/components/Select/TagSelect/index.tsx +2 -2
- package/src/components/Select/hooks/norHooks.ts +7 -2
- package/src/components/TDPicker/TimePicker.tsx +25 -21
- package/src/components/TDPicker/TimeRangePicker.tsx +60 -48
- package/src/components/TDPicker/hooks.ts +8 -8
- package/src/components/TDPicker/index.tsx +42 -32
- package/src/components/TDPicker/modal.ts +14 -13
- package/src/components/Text/index.tsx +6 -2
- package/src/components/Upload/modal.ts +1 -1
- package/src/pages/DatePicker/index.tsx +37 -32
- package/src/pages/Form/index.tsx +18 -19
- package/src/pages/Select/index.tsx +2 -0
- package/src/pages/Upload/index.tsx +6 -2
package/es/RichEditor/modal.d.ts
CHANGED
|
@@ -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;
|
|
@@ -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,
|
|
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 =
|
|
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:
|
|
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[];
|
package/es/TDPicker/index.js
CHANGED
|
@@ -51,9 +51,9 @@ var Index = function Index(_ref) {
|
|
|
51
51
|
}
|
|
52
52
|
if (showSecond) {
|
|
53
53
|
var sPropsShowTime = typeof showTime === "boolean" ? {
|
|
54
|
-
format:
|
|
54
|
+
format: "HH:mm:ss"
|
|
55
55
|
} : _objectSpread({
|
|
56
|
-
format:
|
|
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:
|
|
64
|
+
format: "HH:mm"
|
|
65
65
|
} : _objectSpread({
|
|
66
|
-
format:
|
|
66
|
+
format: "HH:mm"
|
|
67
67
|
}, showTime);
|
|
68
68
|
return {
|
|
69
69
|
format: "YYYY-MM-DD HH:mm",
|
package/es/TDPicker/modal.d.ts
CHANGED
|
@@ -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
|
}
|
package/es/Upload/modal.d.ts
CHANGED
|
@@ -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<{
|
|
@@ -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,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;
|
|
@@ -200,14 +200,19 @@ var useSelectReq = function useSelectReq(_ref3) {
|
|
|
200
200
|
run({}, "page");
|
|
201
201
|
}
|
|
202
202
|
};
|
|
203
|
-
var mathShowSearch =
|
|
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:
|
|
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[];
|
package/lib/TDPicker/index.js
CHANGED
|
@@ -54,9 +54,9 @@ var Index = function Index(_ref) {
|
|
|
54
54
|
}
|
|
55
55
|
if (showSecond) {
|
|
56
56
|
var sPropsShowTime = typeof showTime === "boolean" ? {
|
|
57
|
-
format:
|
|
57
|
+
format: "HH:mm:ss"
|
|
58
58
|
} : _objectSpread({
|
|
59
|
-
format:
|
|
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:
|
|
67
|
+
format: "HH:mm"
|
|
68
68
|
} : _objectSpread({
|
|
69
|
-
format:
|
|
69
|
+
format: "HH:mm"
|
|
70
70
|
}, showTime);
|
|
71
71
|
return {
|
|
72
72
|
format: "YYYY-MM-DD HH:mm",
|
package/lib/TDPicker/modal.d.ts
CHANGED
|
@@ -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
|
}
|
package/lib/Upload/modal.d.ts
CHANGED
|
@@ -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
|
@@ -34,7 +34,9 @@ export default ({
|
|
|
34
34
|
form.submit();
|
|
35
35
|
};
|
|
36
36
|
const globalItemSpan = itemSpan || formItemSpan;
|
|
37
|
-
const boxStyle= requiredMode
|
|
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
|
-
|
|
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
|
|
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>
|
|
@@ -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
|
-
|
|
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
|
-
|
|
33
|
-
|
|
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
|
|
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:(
|
|
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
|
|
31
|
-
border-bottom-right-radius
|
|
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
|
|
37
|
-
border-bottom-left-radius
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
|
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
|
|
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,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
|
|
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
|
|
175
|
+
mathShowSearch,
|
|
171
176
|
reload,
|
|
172
177
|
onPopupScroll: isList ? onPopupScroll : undefined,
|
|
173
178
|
};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { TimePicker
|
|
1
|
+
import { TimePicker, Input } from "antd";
|
|
2
2
|
import type { HTimePickerProps } from "./modal";
|
|
3
|
-
import {
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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);
|