@sunggang/ui-lib 0.2.96 → 0.2.97
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/BaseCkeditor.esm.js +5 -0
- package/index.esm.css +12 -12
- package/index.esm.js +5 -0
- package/index.esm2.js +509 -1989
- package/index.esm3.js +5 -0
- package/package.json +3 -1
- package/src/lib/Form/demo.d.ts +5 -25
- package/src/lib/Form/index.d.ts +2 -2
- package/src/lib/Form/types.d.ts +35 -5
package/index.esm3.js
CHANGED
|
@@ -17,6 +17,11 @@ import 'react-date-range';
|
|
|
17
17
|
import 'react-date-range/dist/locale/index.js';
|
|
18
18
|
import 'date-fns/addDays/index.js';
|
|
19
19
|
import 'date-fns/format/index.js';
|
|
20
|
+
import '@emotion/react';
|
|
21
|
+
import '@mui/material/Checkbox';
|
|
22
|
+
import '@mui/material/Radio';
|
|
23
|
+
import '@mui/material/RadioGroup';
|
|
24
|
+
import '@mui/material/FormControlLabel';
|
|
20
25
|
import '@tanstack/react-table';
|
|
21
26
|
import '@radix-ui/react-dropdown-menu';
|
|
22
27
|
import '@radix-ui/react-icons';
|
package/package.json
CHANGED
package/src/lib/Form/demo.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { FormItem } from './types';
|
|
1
2
|
export declare const Regex: {
|
|
2
3
|
phone: RegExp;
|
|
3
4
|
};
|
|
4
|
-
export declare const
|
|
5
|
+
export declare const checkboxConfig: FormItem;
|
|
6
|
+
export declare const checkboxGroupConfig: FormItem;
|
|
7
|
+
export declare const radioConfig: FormItem;
|
|
8
|
+
export declare const config: (getValues: any) => (FormItem[] | ({
|
|
5
9
|
type: string;
|
|
6
10
|
name: string;
|
|
7
11
|
label: string;
|
|
@@ -110,28 +114,4 @@ export declare const config: (getValues: any) => (({
|
|
|
110
114
|
validateOption?: undefined;
|
|
111
115
|
cityName?: undefined;
|
|
112
116
|
districtName?: undefined;
|
|
113
|
-
})[] | ({
|
|
114
|
-
type: string;
|
|
115
|
-
name: string;
|
|
116
|
-
label: string;
|
|
117
|
-
id: string;
|
|
118
|
-
placeholder: string;
|
|
119
|
-
errorText: string;
|
|
120
|
-
validateOption: {
|
|
121
|
-
required: boolean;
|
|
122
|
-
validate?: undefined;
|
|
123
|
-
};
|
|
124
|
-
} | {
|
|
125
|
-
type: string;
|
|
126
|
-
name: string;
|
|
127
|
-
label: string;
|
|
128
|
-
id: string;
|
|
129
|
-
placeholder: string;
|
|
130
|
-
errorText: string;
|
|
131
|
-
validateOption: {
|
|
132
|
-
required: boolean;
|
|
133
|
-
validate: {
|
|
134
|
-
afterStart: (value: string) => true | "結束時間需大於起始時間" | undefined;
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
117
|
})[])[];
|
package/src/lib/Form/index.d.ts
CHANGED
|
@@ -26,8 +26,7 @@ export declare const Form: {
|
|
|
26
26
|
FieldLabel: ({ item }: {
|
|
27
27
|
item: any;
|
|
28
28
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
RadioField: ({
|
|
30
|
-
direction?: string | undefined;
|
|
29
|
+
RadioField: ({ item }: {
|
|
31
30
|
item: any;
|
|
32
31
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
33
32
|
Time: import("react").FC<FormType>;
|
|
@@ -36,4 +35,5 @@ export declare const Form: {
|
|
|
36
35
|
CityDistrict: ({ item }: {
|
|
37
36
|
item: any;
|
|
38
37
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
CheckboxField: import("react").FC<FormType>;
|
|
39
39
|
};
|
package/src/lib/Form/types.d.ts
CHANGED
|
@@ -6,32 +6,62 @@ interface OptionGroup {
|
|
|
6
6
|
label: string;
|
|
7
7
|
options: Option[];
|
|
8
8
|
}
|
|
9
|
+
interface RadioOption {
|
|
10
|
+
label?: string;
|
|
11
|
+
value?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}
|
|
9
14
|
type Options = (Option | OptionGroup)[];
|
|
15
|
+
interface Checkbox {
|
|
16
|
+
name: string;
|
|
17
|
+
checkboxLabel?: string;
|
|
18
|
+
checkboxLabelClass?: string;
|
|
19
|
+
errorText?: string;
|
|
20
|
+
validateOption?: {
|
|
21
|
+
required?: boolean;
|
|
22
|
+
};
|
|
23
|
+
muiProps?: {
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
size?: 'small' | 'medium' | 'large';
|
|
26
|
+
color?: 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning' | 'default';
|
|
27
|
+
};
|
|
28
|
+
}
|
|
10
29
|
export interface FormItem {
|
|
11
30
|
type: string;
|
|
12
31
|
name: string;
|
|
13
32
|
disable?: boolean;
|
|
14
|
-
icon?: string;
|
|
15
33
|
style?: any;
|
|
16
|
-
cityName?: string;
|
|
17
|
-
districtName?: string;
|
|
18
34
|
label?: string;
|
|
19
35
|
id?: string;
|
|
20
36
|
placeholder?: string;
|
|
21
37
|
className?: string;
|
|
22
38
|
labelClass?: string;
|
|
23
39
|
errorText?: string;
|
|
24
|
-
color?: 'blue' | 'red' | 'green' | 'yellow';
|
|
25
|
-
size?: 'small' | 'medium' | 'large';
|
|
26
40
|
validateOption?: {
|
|
27
41
|
pattern?: RegExp;
|
|
28
42
|
validateMsg?: string;
|
|
29
43
|
required?: boolean;
|
|
30
44
|
validate?: any;
|
|
31
45
|
};
|
|
46
|
+
defaultValue?: string;
|
|
47
|
+
icon?: string;
|
|
32
48
|
option?: Options;
|
|
49
|
+
radioOptions?: RadioOption[];
|
|
50
|
+
direction?: 'horizontal' | 'vertical';
|
|
33
51
|
step?: string;
|
|
52
|
+
cityName?: string;
|
|
53
|
+
districtName?: string;
|
|
34
54
|
onlyHour?: boolean;
|
|
55
|
+
color?: 'blue' | 'red' | 'green' | 'yellow';
|
|
56
|
+
size?: 'small' | 'medium' | 'large';
|
|
57
|
+
checkboxLabel?: string;
|
|
58
|
+
checkboxLabelClass?: string;
|
|
59
|
+
muiProps?: {
|
|
60
|
+
disabled?: boolean;
|
|
61
|
+
size?: 'small' | 'medium' | 'large';
|
|
62
|
+
color?: 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning' | 'default';
|
|
63
|
+
};
|
|
64
|
+
checkboxes?: Checkbox[];
|
|
35
65
|
}
|
|
36
66
|
export interface FormType {
|
|
37
67
|
item: FormItem;
|