sti-antd-package 0.0.8 → 0.0.10
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/dist/components/Checkbox/types.d.ts +2 -1
- package/dist/components/DatePicker/types.d.ts +2 -1
- package/dist/components/DateRangePicker/types.d.ts +2 -1
- package/dist/components/{FormItem → Form/Item}/types.d.ts +3 -2
- package/dist/components/Form/index.d.ts +1 -0
- package/dist/components/Input/types.d.ts +2 -1
- package/dist/components/NumberFormat/types.d.ts +6 -5
- package/dist/components/Select/types.d.ts +3 -1
- package/dist/components/Switch/types.d.ts +2 -1
- package/dist/components/TextArea/types.d.ts +2 -1
- package/dist/components/index.d.ts +3 -2
- package/dist/hooks/useRemoveError/hook.d.ts +1 -1
- package/dist/index.d.ts +23 -13
- package/dist/index.esm.js +103 -99
- package/dist/index.js +105 -98
- package/package.json +1 -1
- /package/dist/components/{FormItem → Form/Item}/Component.d.ts +0 -0
- /package/dist/components/{FormItem → Form/Item}/index.d.ts +0 -0
|
@@ -14,7 +14,8 @@ export interface CheckboxComponentProps {
|
|
|
14
14
|
disabled?: boolean;
|
|
15
15
|
checked?: boolean;
|
|
16
16
|
defaultChecked?: boolean;
|
|
17
|
-
|
|
17
|
+
removeError?: (name?: NamePath) => void;
|
|
18
|
+
onChange?: (event: CheckboxChangeEvent) => void;
|
|
18
19
|
formColLayout?: typeof formColLayout;
|
|
19
20
|
name?: NamePath;
|
|
20
21
|
label?: React.ReactNode;
|
|
@@ -24,7 +24,8 @@ export interface DatePickerComponentProps {
|
|
|
24
24
|
disabledTime?: DatePickerProps['disabledTime'];
|
|
25
25
|
value?: DatePickerProps['value'];
|
|
26
26
|
defaultValue?: DatePickerProps['value'];
|
|
27
|
-
|
|
27
|
+
removeError?: (name?: NamePath) => void;
|
|
28
|
+
onChange?: (date: Dayjs, dateStrings: string | string[]) => void;
|
|
28
29
|
style?: React.CSSProperties;
|
|
29
30
|
formColLayout?: typeof formColLayout;
|
|
30
31
|
name?: NamePath;
|
|
@@ -25,7 +25,8 @@ export interface DateRangePickerComponentProps {
|
|
|
25
25
|
disabledTime?: RangePickerProps['disabledTime'];
|
|
26
26
|
value?: RangePickerProps['value'];
|
|
27
27
|
defaultValue?: RangePickerProps['value'];
|
|
28
|
-
|
|
28
|
+
removeError?: (name?: NamePath) => void;
|
|
29
|
+
onChange?: (date: Parameters<NonNullable<React.ComponentProps<typeof DatePicker.RangePicker>['onChange']>>[0], dateStrings: Parameters<NonNullable<React.ComponentProps<typeof DatePicker.RangePicker>['onChange']>>[1]) => void;
|
|
29
30
|
style?: React.CSSProperties;
|
|
30
31
|
formColLayout?: typeof formColLayout;
|
|
31
32
|
name?: NamePath;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { formColLayout } from "
|
|
1
|
+
import { formColLayout } from "../../../constants";
|
|
2
2
|
import { ValidateStatus } from "antd/es/form/FormItem";
|
|
3
3
|
import { ShouldUpdate } from "rc-field-form/lib/Field";
|
|
4
4
|
import { NamePath, Rule, RuleObject, Store, StoreValue } from "rc-field-form/lib/interface";
|
|
@@ -8,11 +8,12 @@ export interface FormItemComponentProps {
|
|
|
8
8
|
formColLayout?: typeof formColLayout;
|
|
9
9
|
name?: NamePath;
|
|
10
10
|
label?: React.ReactNode;
|
|
11
|
-
normalize?: (
|
|
11
|
+
normalize?: (value: StoreValue, prevValue: StoreValue, allValues: Store) => StoreValue;
|
|
12
12
|
required?: boolean;
|
|
13
13
|
rules?: Rule[];
|
|
14
14
|
ruleType?: RuleObject['type'];
|
|
15
15
|
ruleMessage?: string;
|
|
16
|
+
ruleTransform?: (value: StoreValue) => StoreValue;
|
|
16
17
|
ruleMin?: number;
|
|
17
18
|
ruleMax?: number;
|
|
18
19
|
valuePropName?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Form } from "antd";
|
|
@@ -31,7 +31,8 @@ export interface InputComponentProps {
|
|
|
31
31
|
placeholder?: string;
|
|
32
32
|
value?: valueType;
|
|
33
33
|
defaultValue?: valueType;
|
|
34
|
-
|
|
34
|
+
removeError?: (name?: NamePath) => void;
|
|
35
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
35
36
|
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
36
37
|
onPressEnter?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
37
38
|
onMouseEnter?: React.MouseEventHandler<HTMLInputElement>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { formColLayout } from "../../constants";
|
|
2
2
|
import { valueType } from "antd/es/statistic/utils";
|
|
3
3
|
import { ShouldUpdate } from "rc-field-form/lib/Field";
|
|
4
|
-
import { NamePath, Rule
|
|
4
|
+
import { NamePath, Rule } from "rc-field-form/lib/interface";
|
|
5
5
|
import { Ref } from "react";
|
|
6
|
-
import {
|
|
6
|
+
import { OnValueChange } from "react-number-format";
|
|
7
7
|
export interface NumberFormatComponentRef {
|
|
8
8
|
value: () => valueType;
|
|
9
9
|
setValue: React.Dispatch<React.SetStateAction<valueType>>;
|
|
@@ -13,7 +13,7 @@ export interface NumberFormatComponentProps {
|
|
|
13
13
|
text?: boolean;
|
|
14
14
|
size?: 'small';
|
|
15
15
|
align?: 'right';
|
|
16
|
-
|
|
16
|
+
classNames?: string[];
|
|
17
17
|
variant?: 'borderless' | 'underlined';
|
|
18
18
|
trailing?: number;
|
|
19
19
|
prefix?: string;
|
|
@@ -24,7 +24,9 @@ export interface NumberFormatComponentProps {
|
|
|
24
24
|
allowNegative?: boolean;
|
|
25
25
|
value?: valueType;
|
|
26
26
|
defaultValue?: valueType;
|
|
27
|
-
|
|
27
|
+
removeError?: (name?: NamePath) => void;
|
|
28
|
+
onValueChange?: OnValueChange;
|
|
29
|
+
onChange?: (value?: number) => void;
|
|
28
30
|
style?: React.CSSProperties;
|
|
29
31
|
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
30
32
|
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
@@ -37,7 +39,6 @@ export interface NumberFormatComponentProps {
|
|
|
37
39
|
label?: React.ReactNode;
|
|
38
40
|
required?: boolean;
|
|
39
41
|
rules?: Rule[];
|
|
40
|
-
ruleType?: RuleObject['type'];
|
|
41
42
|
ruleMessage?: string;
|
|
42
43
|
ruleMin?: number;
|
|
43
44
|
ruleMax?: number;
|
|
@@ -5,6 +5,7 @@ import { SizeType } from "antd/es/config-provider/SizeContext";
|
|
|
5
5
|
import { Rule, RuleObject } from "antd/es/form";
|
|
6
6
|
import { ValidateStatus } from "antd/es/form/FormItem";
|
|
7
7
|
import { DefaultOptionType } from "antd/es/select";
|
|
8
|
+
import { NamePath } from "rc-field-form/lib/interface";
|
|
8
9
|
export type SelectOption = (DefaultOptionType & {
|
|
9
10
|
text?: React.ReactNode;
|
|
10
11
|
encryption_id?: string;
|
|
@@ -24,7 +25,8 @@ export interface SelectComponentProps {
|
|
|
24
25
|
placeholder?: React.ReactNode;
|
|
25
26
|
value?: any;
|
|
26
27
|
defaultValue?: any;
|
|
27
|
-
|
|
28
|
+
removeError?: (name?: NamePath) => void;
|
|
29
|
+
onChange?: (value: any, option?: SelectOption | SelectOption[]) => void;
|
|
28
30
|
onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
|
|
29
31
|
onSearch?: (value: string) => void;
|
|
30
32
|
onFocus?: React.FocusEventHandler<HTMLElement>;
|
|
@@ -12,7 +12,8 @@ export interface SwitchComponentProps {
|
|
|
12
12
|
disabled?: boolean;
|
|
13
13
|
checked?: boolean;
|
|
14
14
|
defaultChecked?: boolean;
|
|
15
|
-
|
|
15
|
+
removeError?: (name?: NamePath) => void;
|
|
16
|
+
onChange?: (checked: boolean, event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
16
17
|
formColLayout?: typeof formColLayout;
|
|
17
18
|
name?: NamePath;
|
|
18
19
|
label?: React.ReactNode;
|
|
@@ -23,7 +23,8 @@ export interface TextAreaComponentProps {
|
|
|
23
23
|
placeholder?: string;
|
|
24
24
|
value?: valueType;
|
|
25
25
|
defaultValue?: valueType;
|
|
26
|
-
|
|
26
|
+
removeError?: (name?: NamePath) => void;
|
|
27
|
+
onChange?: React.ChangeEventHandler<HTMLTextAreaElement>;
|
|
27
28
|
formColLayout?: typeof formColLayout;
|
|
28
29
|
name?: NamePath;
|
|
29
30
|
label?: React.ReactNode;
|
|
@@ -16,8 +16,9 @@ export { default as DateRangePickerComponent } from "./DateRangePicker";
|
|
|
16
16
|
export type { DateRangePickerComponentProps, DateRangePickerComponentRef } from "./DateRangePicker";
|
|
17
17
|
export { default as DropdownButtonComponent } from "./DropdownButton";
|
|
18
18
|
export type { DropdownButtonComponentProps, DropdownButtonMenuItem } from "./DropdownButton";
|
|
19
|
-
export {
|
|
20
|
-
export
|
|
19
|
+
export { Form } from "./Form";
|
|
20
|
+
export { default as FormItemComponent } from "./Form/Item";
|
|
21
|
+
export type { FormItemComponentProps } from "./Form/Item";
|
|
21
22
|
export { default as IconCheckOrClose } from "./Icon/CheckOrClose";
|
|
22
23
|
export type { IconCheckOrCloseProps } from "./Icon/CheckOrClose";
|
|
23
24
|
export { default as InputComponent } from "./Input";
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { SizeType } from 'antd/es/config-provider/SizeContext';
|
|
|
3
3
|
import { TooltipPlacement } from 'antd/es/tooltip';
|
|
4
4
|
import React$1, { Ref, JSXElementConstructor } from 'react';
|
|
5
5
|
import { CardProps, CheckboxChangeEvent, DatePickerProps as DatePickerProps$1, DatePicker, DropDownProps, SelectProps, ThemeConfig, TablePaginationConfig as TablePaginationConfig$1, FormInstance, TagProps } from 'antd';
|
|
6
|
+
export { Form } from 'antd';
|
|
6
7
|
import { CardSize } from 'antd/es/card/Card';
|
|
7
8
|
import { Variant } from 'antd/es/config-provider';
|
|
8
9
|
import { ValidateStatus } from 'antd/es/form/FormItem';
|
|
@@ -16,7 +17,7 @@ import dayjs, { Dayjs } from 'dayjs';
|
|
|
16
17
|
import { SemanticStructure } from 'rc-picker/lib/interface';
|
|
17
18
|
import { RangeValueType } from 'rc-picker/lib/PickerInput/RangePicker';
|
|
18
19
|
import { valueType } from 'antd/es/statistic/utils';
|
|
19
|
-
import {
|
|
20
|
+
import { OnValueChange } from 'react-number-format';
|
|
20
21
|
import { DefaultOptionType as DefaultOptionType$1 } from 'antd/es/select';
|
|
21
22
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
22
23
|
import { ClassTransformOptions } from 'class-transformer';
|
|
@@ -182,7 +183,8 @@ interface CheckboxComponentProps {
|
|
|
182
183
|
disabled?: boolean;
|
|
183
184
|
checked?: boolean;
|
|
184
185
|
defaultChecked?: boolean;
|
|
185
|
-
|
|
186
|
+
removeError?: (name?: NamePath) => void;
|
|
187
|
+
onChange?: (event: CheckboxChangeEvent) => void;
|
|
186
188
|
formColLayout?: typeof _default;
|
|
187
189
|
name?: NamePath;
|
|
188
190
|
label?: React.ReactNode;
|
|
@@ -214,7 +216,8 @@ interface DatePickerComponentProps {
|
|
|
214
216
|
disabledTime?: DatePickerProps['disabledTime'];
|
|
215
217
|
value?: DatePickerProps['value'];
|
|
216
218
|
defaultValue?: DatePickerProps['value'];
|
|
217
|
-
|
|
219
|
+
removeError?: (name?: NamePath) => void;
|
|
220
|
+
onChange?: (date: Dayjs, dateStrings: string | string[]) => void;
|
|
218
221
|
style?: React.CSSProperties;
|
|
219
222
|
formColLayout?: typeof _default;
|
|
220
223
|
name?: NamePath;
|
|
@@ -248,7 +251,8 @@ interface DateRangePickerComponentProps {
|
|
|
248
251
|
disabledTime?: RangePickerProps['disabledTime'];
|
|
249
252
|
value?: RangePickerProps['value'];
|
|
250
253
|
defaultValue?: RangePickerProps['value'];
|
|
251
|
-
|
|
254
|
+
removeError?: (name?: NamePath) => void;
|
|
255
|
+
onChange?: (date: Parameters<NonNullable<React.ComponentProps<typeof DatePicker.RangePicker>['onChange']>>[0], dateStrings: Parameters<NonNullable<React.ComponentProps<typeof DatePicker.RangePicker>['onChange']>>[1]) => void;
|
|
252
256
|
style?: React.CSSProperties;
|
|
253
257
|
formColLayout?: typeof _default;
|
|
254
258
|
name?: NamePath;
|
|
@@ -290,11 +294,12 @@ interface FormItemComponentProps {
|
|
|
290
294
|
formColLayout?: typeof _default;
|
|
291
295
|
name?: NamePath;
|
|
292
296
|
label?: React$1.ReactNode;
|
|
293
|
-
normalize?: (
|
|
297
|
+
normalize?: (value: StoreValue, prevValue: StoreValue, allValues: Store) => StoreValue;
|
|
294
298
|
required?: boolean;
|
|
295
299
|
rules?: Rule$1[];
|
|
296
300
|
ruleType?: RuleObject$1['type'];
|
|
297
301
|
ruleMessage?: string;
|
|
302
|
+
ruleTransform?: (value: StoreValue) => StoreValue;
|
|
298
303
|
ruleMin?: number;
|
|
299
304
|
ruleMax?: number;
|
|
300
305
|
valuePropName?: string;
|
|
@@ -339,7 +344,8 @@ interface InputComponentProps {
|
|
|
339
344
|
placeholder?: string;
|
|
340
345
|
value?: valueType;
|
|
341
346
|
defaultValue?: valueType;
|
|
342
|
-
|
|
347
|
+
removeError?: (name?: NamePath) => void;
|
|
348
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
343
349
|
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
344
350
|
onPressEnter?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
345
351
|
onMouseEnter?: React.MouseEventHandler<HTMLInputElement>;
|
|
@@ -382,7 +388,7 @@ interface NumberFormatComponentProps {
|
|
|
382
388
|
text?: boolean;
|
|
383
389
|
size?: 'small';
|
|
384
390
|
align?: 'right';
|
|
385
|
-
|
|
391
|
+
classNames?: string[];
|
|
386
392
|
variant?: 'borderless' | 'underlined';
|
|
387
393
|
trailing?: number;
|
|
388
394
|
prefix?: string;
|
|
@@ -393,7 +399,9 @@ interface NumberFormatComponentProps {
|
|
|
393
399
|
allowNegative?: boolean;
|
|
394
400
|
value?: valueType;
|
|
395
401
|
defaultValue?: valueType;
|
|
396
|
-
|
|
402
|
+
removeError?: (name?: NamePath) => void;
|
|
403
|
+
onValueChange?: OnValueChange;
|
|
404
|
+
onChange?: (value?: number) => void;
|
|
397
405
|
style?: React.CSSProperties;
|
|
398
406
|
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
399
407
|
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
@@ -406,7 +414,6 @@ interface NumberFormatComponentProps {
|
|
|
406
414
|
label?: React.ReactNode;
|
|
407
415
|
required?: boolean;
|
|
408
416
|
rules?: Rule$1[];
|
|
409
|
-
ruleType?: RuleObject$1['type'];
|
|
410
417
|
ruleMessage?: string;
|
|
411
418
|
ruleMin?: number;
|
|
412
419
|
ruleMax?: number;
|
|
@@ -437,7 +444,8 @@ interface SelectComponentProps {
|
|
|
437
444
|
placeholder?: React.ReactNode;
|
|
438
445
|
value?: any;
|
|
439
446
|
defaultValue?: any;
|
|
440
|
-
|
|
447
|
+
removeError?: (name?: NamePath) => void;
|
|
448
|
+
onChange?: (value: any, option?: SelectOption | SelectOption[]) => void;
|
|
441
449
|
onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
|
|
442
450
|
onSearch?: (value: string) => void;
|
|
443
451
|
onFocus?: React.FocusEventHandler<HTMLElement>;
|
|
@@ -521,7 +529,8 @@ interface SwitchComponentProps {
|
|
|
521
529
|
disabled?: boolean;
|
|
522
530
|
checked?: boolean;
|
|
523
531
|
defaultChecked?: boolean;
|
|
524
|
-
|
|
532
|
+
removeError?: (name?: NamePath) => void;
|
|
533
|
+
onChange?: (checked: boolean, event: React$1.MouseEvent<HTMLButtonElement> | React$1.KeyboardEvent<HTMLButtonElement>) => void;
|
|
525
534
|
formColLayout?: typeof _default;
|
|
526
535
|
name?: NamePath;
|
|
527
536
|
label?: React$1.ReactNode;
|
|
@@ -872,7 +881,8 @@ interface TextAreaComponentProps {
|
|
|
872
881
|
placeholder?: string;
|
|
873
882
|
value?: valueType;
|
|
874
883
|
defaultValue?: valueType;
|
|
875
|
-
|
|
884
|
+
removeError?: (name?: NamePath) => void;
|
|
885
|
+
onChange?: React.ChangeEventHandler<HTMLTextAreaElement>;
|
|
876
886
|
formColLayout?: typeof _default;
|
|
877
887
|
name?: NamePath;
|
|
878
888
|
label?: React.ReactNode;
|
|
@@ -897,7 +907,7 @@ declare enum DateFormat {
|
|
|
897
907
|
|
|
898
908
|
declare const useRemoveError: (setInputErrors: React.Dispatch<React.SetStateAction<{
|
|
899
909
|
[key: string]: any;
|
|
900
|
-
}>>) => (name?: string
|
|
910
|
+
}>>) => (name?: string) => void;
|
|
901
911
|
|
|
902
912
|
export { BaseModel, ButtonComponent, ButtonGroupAddComponent, ButtonGroupEditComponent, CardComponent, CascaderComponent, CheckboxComponent, ConfigProvider, DateFormat, DatePickerComponent, DateRangePickerComponent, DropdownButtonComponent, FeedbackProvider, FormItemComponent, IconCheckOrClose, InputComponent, LinkComponent, NumberFormatComponent, SelectAsyncComponent, SelectComponent, SwitchComponent, TableAsyncComponent, TableAsyncSearchComponent, TableCellEditableComponent, TableComponent, TableRowProvider, TabsComponent, TagComponent, TextAreaComponent, TransformBoolean, TransformDayjs, TransformNumber, colLayout, datePickerFormat, _default as formColLayout, getTableAsyncName, getTableFilterStorage, selectAsync, styleCSS, toCamel, useConfig, useFeedback, useRemoveError, useTableAsyncSearch, useTableRow };
|
|
903
913
|
export type { ButtonComponentProps, ButtonComponentRef, ButtonGroupAddComponentProps, ButtonGroupEditComponentProps, CardComponentProps, CascaderComponentProps, CascaderComponentRef, CheckboxComponentProps, CheckboxComponentRef, ConfigContextType, ConfigProviderProps, DatePickerComponentProps, DatePickerComponentRef, DateRangePickerComponentProps, DateRangePickerComponentRef, DefaultColumn, DefaultParams, DropdownButtonComponentProps, DropdownButtonMenuItem, FeedbackContextType, FormColLayout, FormColSizeSpan, FormItemComponentProps, IconCheckOrCloseProps, InputComponentProps, InputComponentRef, LinkComponentProps, LinkType, NumberFormatComponentProps, NumberFormatComponentRef, SelectAsyncComponentProps, SelectAsyncComponentRef, SelectAsyncFormat, SelectAsyncProps, SelectComponentProps, SelectOption, SwitchComponentProps, TableAsyncComponentProps, TableAsyncComponentRef, TableAsyncSearchCheckbox, TableAsyncSearchComponentProps, TableAsyncSearchContextType, TableAsyncSearchDate, TableAsyncSearchDateRange, TableAsyncSearchFetchSelectMultiple, TableAsyncSearchItem, TableAsyncSearchItemType, TableAsyncSearchLocalSelectMultiple, TableAsyncSearchProviderProps, TableAsyncSearchSelect, TableAsyncSearchSelectMultiple, TableAsyncSearchSwitch, TableAsyncSearchText, TableAsyncType, TableButtonMiddle, TableCellEditableProps, TableComponentProps, TableParams, TableParamsFormatter, TableRowContextType, TableRowProviderProps, TabsComponentProps, TagComponentProps, TextAreaComponentProps, TextAreaComponentRef, YajraColumn, YajraColumnParams, YajraOrderParams, YajraParams, YajraSearchParams };
|