fis-component 0.1.35 → 0.2.0
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/cjs/index.js +63547 -63399
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/src/components/CheckboxGroup/index.d.ts +2 -8
- package/dist/cjs/types/src/components/Input/InputDate/styles.d.ts +1 -1
- package/dist/cjs/types/src/components/Input/InputStepper/InputStepper.stories.d.ts +61 -61
- package/dist/cjs/types/src/components/Provider/ConfigContext.d.ts +34 -0
- package/dist/cjs/types/src/components/Provider/Provider.stories.d.ts +1 -0
- package/dist/cjs/types/src/components/Provider/componentDefaults.d.ts +107 -0
- package/dist/cjs/types/src/components/Provider/index.d.ts +3 -0
- package/dist/cjs/types/src/components/Select/Select.stories.d.ts +1 -0
- package/dist/cjs/types/src/components/Select/styles.d.ts +1 -0
- package/dist/cjs/types/src/components/Select/types.d.ts +33 -2
- package/dist/cjs/types/src/index.d.ts +97 -46
- package/dist/esm/index.js +63544 -63400
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/CheckboxGroup/index.d.ts +2 -8
- package/dist/esm/types/src/components/Input/InputDate/styles.d.ts +1 -1
- package/dist/esm/types/src/components/Input/InputStepper/InputStepper.stories.d.ts +61 -61
- package/dist/esm/types/src/components/Provider/ConfigContext.d.ts +34 -0
- package/dist/esm/types/src/components/Provider/Provider.stories.d.ts +1 -0
- package/dist/esm/types/src/components/Provider/componentDefaults.d.ts +107 -0
- package/dist/esm/types/src/components/Provider/index.d.ts +3 -0
- package/dist/esm/types/src/components/Select/Select.stories.d.ts +1 -0
- package/dist/esm/types/src/components/Select/styles.d.ts +1 -0
- package/dist/esm/types/src/components/Select/types.d.ts +33 -2
- package/dist/esm/types/src/index.d.ts +97 -46
- package/dist/index.d.ts +4104 -3933
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ForwardedRef
|
|
1
|
+
import { ForwardedRef } from "react";
|
|
2
2
|
import { CheckboxSize } from "../Checkbox";
|
|
3
3
|
type Value = string | number;
|
|
4
4
|
type Option<T> = {
|
|
@@ -19,16 +19,10 @@ type CheckboxGroupProps<T extends Value> = {
|
|
|
19
19
|
onFocus?: () => void;
|
|
20
20
|
onBlur?: () => void;
|
|
21
21
|
};
|
|
22
|
-
declare function CheckboxGroupComponent<T extends Value>({ className, groupLabel, options, value, direction, disabled, classContent, size, getOptionDisabled, onChange, onFocus, onBlur, }: CheckboxGroupProps<T>, ref?: Ref<{
|
|
23
|
-
focus: () => void;
|
|
24
|
-
}>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
declare namespace CheckboxGroupComponent {
|
|
26
|
-
var displayName: string;
|
|
27
|
-
}
|
|
28
22
|
declare const FISCheckboxGroup: <T extends Value>(props: CheckboxGroupProps<T> & {
|
|
29
23
|
ref?: ForwardedRef<{
|
|
30
24
|
focus: () => void;
|
|
31
25
|
}>;
|
|
32
|
-
}) =>
|
|
26
|
+
}) => JSX.Element;
|
|
33
27
|
export default FISCheckboxGroup;
|
|
34
28
|
export type { CheckboxGroupProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const DivWrapperSC: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
2
|
export declare const DivInputWrapperSC: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
|
-
export declare const HiddenDatePickerSC: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<import("antd/es/date-picker/generatePicker").PickerProps<import("dayjs").Dayjs>, "
|
|
3
|
+
export declare const HiddenDatePickerSC: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<import("antd/es/date-picker/generatePicker").PickerProps<import("dayjs").Dayjs>, "onChange" | "defaultValue" | "value" | "onOk"> & import("react").RefAttributes<import("rc-picker").PickerRef> & {
|
|
4
4
|
defaultValue?: unknown;
|
|
5
5
|
value?: unknown;
|
|
6
6
|
onChange?: ((date: unknown, dateString: string | string[]) => void) | undefined;
|
|
@@ -28,62 +28,25 @@ declare const meta: {
|
|
|
28
28
|
dir?: string | undefined | undefined;
|
|
29
29
|
form?: string | undefined | undefined;
|
|
30
30
|
slot?: string | undefined | undefined;
|
|
31
|
+
style?: import("react").CSSProperties | undefined;
|
|
32
|
+
title?: string | undefined | undefined;
|
|
31
33
|
pattern?: string | undefined | undefined;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
34
|
+
width?: number | string | undefined | undefined;
|
|
35
|
+
height?: number | string | undefined | undefined;
|
|
35
36
|
suppressHydrationWarning?: boolean | undefined | undefined;
|
|
36
|
-
accessKey?: string | undefined | undefined;
|
|
37
|
-
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
|
|
38
|
-
autoFocus?: boolean | undefined | undefined;
|
|
39
37
|
className?: string | undefined | undefined;
|
|
40
|
-
|
|
41
|
-
contextMenu?: string | undefined | undefined;
|
|
42
|
-
draggable?: (boolean | "false" | "true") | undefined;
|
|
43
|
-
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
44
|
-
hidden?: boolean | undefined | undefined;
|
|
38
|
+
color?: string | undefined | undefined;
|
|
45
39
|
id?: string | undefined | undefined;
|
|
46
40
|
lang?: string | undefined | undefined;
|
|
47
|
-
|
|
48
|
-
spellCheck?: (boolean | "false" | "true") | undefined;
|
|
49
|
-
style?: import("react").CSSProperties | undefined;
|
|
50
|
-
tabIndex?: number | undefined | undefined;
|
|
51
|
-
title?: string | undefined | undefined;
|
|
52
|
-
translate?: "yes" | "no" | undefined | undefined;
|
|
53
|
-
radioGroup?: string | undefined | undefined;
|
|
41
|
+
type?: import("react").HTMLInputTypeAttribute | undefined;
|
|
54
42
|
role?: import("react").AriaRole | undefined;
|
|
55
|
-
|
|
56
|
-
content?: string | undefined | undefined;
|
|
57
|
-
datatype?: string | undefined | undefined;
|
|
58
|
-
inlist?: any;
|
|
59
|
-
prefix?: string | undefined | undefined;
|
|
60
|
-
property?: string | undefined | undefined;
|
|
61
|
-
rel?: string | undefined | undefined;
|
|
62
|
-
resource?: string | undefined | undefined;
|
|
63
|
-
rev?: string | undefined | undefined;
|
|
64
|
-
typeof?: string | undefined | undefined;
|
|
65
|
-
vocab?: string | undefined | undefined;
|
|
66
|
-
autoCorrect?: string | undefined | undefined;
|
|
67
|
-
autoSave?: string | undefined | undefined;
|
|
68
|
-
color?: string | undefined | undefined;
|
|
69
|
-
itemProp?: string | undefined | undefined;
|
|
70
|
-
itemScope?: boolean | undefined | undefined;
|
|
71
|
-
itemType?: string | undefined | undefined;
|
|
72
|
-
itemID?: string | undefined | undefined;
|
|
73
|
-
itemRef?: string | undefined | undefined;
|
|
74
|
-
results?: number | undefined | undefined;
|
|
75
|
-
security?: string | undefined | undefined;
|
|
76
|
-
unselectable?: "on" | "off" | undefined | undefined;
|
|
77
|
-
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
78
|
-
is?: string | undefined | undefined;
|
|
79
|
-
exportparts?: string | undefined | undefined;
|
|
80
|
-
part?: string | undefined | undefined;
|
|
43
|
+
tabIndex?: number | undefined | undefined;
|
|
81
44
|
"aria-activedescendant"?: string | undefined | undefined;
|
|
82
|
-
"aria-atomic"?: (boolean | "
|
|
45
|
+
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
83
46
|
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined | undefined;
|
|
84
47
|
"aria-braillelabel"?: string | undefined | undefined;
|
|
85
48
|
"aria-brailleroledescription"?: string | undefined | undefined;
|
|
86
|
-
"aria-busy"?: (boolean | "
|
|
49
|
+
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
87
50
|
"aria-checked"?: boolean | "false" | "mixed" | "true" | undefined | undefined;
|
|
88
51
|
"aria-colcount"?: number | undefined | undefined;
|
|
89
52
|
"aria-colindex"?: number | undefined | undefined;
|
|
@@ -94,37 +57,37 @@ declare const meta: {
|
|
|
94
57
|
"aria-describedby"?: string | undefined | undefined;
|
|
95
58
|
"aria-description"?: string | undefined | undefined;
|
|
96
59
|
"aria-details"?: string | undefined | undefined;
|
|
97
|
-
"aria-disabled"?: (boolean | "
|
|
60
|
+
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
98
61
|
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined | undefined;
|
|
99
62
|
"aria-errormessage"?: string | undefined | undefined;
|
|
100
|
-
"aria-expanded"?: (boolean | "
|
|
63
|
+
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
101
64
|
"aria-flowto"?: string | undefined | undefined;
|
|
102
|
-
"aria-grabbed"?: (boolean | "
|
|
65
|
+
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
103
66
|
"aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined | undefined;
|
|
104
|
-
"aria-hidden"?: (boolean | "
|
|
67
|
+
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
105
68
|
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined | undefined;
|
|
106
69
|
"aria-keyshortcuts"?: string | undefined | undefined;
|
|
107
70
|
"aria-label"?: string | undefined | undefined;
|
|
108
71
|
"aria-labelledby"?: string | undefined | undefined;
|
|
109
72
|
"aria-level"?: number | undefined | undefined;
|
|
110
73
|
"aria-live"?: "off" | "assertive" | "polite" | undefined | undefined;
|
|
111
|
-
"aria-modal"?: (boolean | "
|
|
112
|
-
"aria-multiline"?: (boolean | "
|
|
113
|
-
"aria-multiselectable"?: (boolean | "
|
|
74
|
+
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
75
|
+
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
76
|
+
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
114
77
|
"aria-orientation"?: "horizontal" | "vertical" | undefined | undefined;
|
|
115
78
|
"aria-owns"?: string | undefined | undefined;
|
|
116
79
|
"aria-placeholder"?: string | undefined | undefined;
|
|
117
80
|
"aria-posinset"?: number | undefined | undefined;
|
|
118
81
|
"aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined | undefined;
|
|
119
|
-
"aria-readonly"?: (boolean | "
|
|
82
|
+
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
120
83
|
"aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined | undefined;
|
|
121
|
-
"aria-required"?: (boolean | "
|
|
84
|
+
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
122
85
|
"aria-roledescription"?: string | undefined | undefined;
|
|
123
86
|
"aria-rowcount"?: number | undefined | undefined;
|
|
124
87
|
"aria-rowindex"?: number | undefined | undefined;
|
|
125
88
|
"aria-rowindextext"?: string | undefined | undefined;
|
|
126
89
|
"aria-rowspan"?: number | undefined | undefined;
|
|
127
|
-
"aria-selected"?: (boolean | "
|
|
90
|
+
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
128
91
|
"aria-setsize"?: number | undefined | undefined;
|
|
129
92
|
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined | undefined;
|
|
130
93
|
"aria-valuemax"?: number | undefined | undefined;
|
|
@@ -292,18 +255,55 @@ declare const meta: {
|
|
|
292
255
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLInputElement> | undefined;
|
|
293
256
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLInputElement> | undefined;
|
|
294
257
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLInputElement> | undefined;
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
width?: number | string | undefined | undefined;
|
|
258
|
+
key?: import("react").Key | null | undefined;
|
|
259
|
+
hidden?: boolean | undefined | undefined;
|
|
260
|
+
content?: string | undefined | undefined;
|
|
299
261
|
size?: number | undefined | undefined;
|
|
300
262
|
multiple?: boolean | undefined | undefined;
|
|
263
|
+
defaultChecked?: boolean | undefined | undefined;
|
|
264
|
+
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
265
|
+
accessKey?: string | undefined | undefined;
|
|
266
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
|
|
267
|
+
autoFocus?: boolean | undefined | undefined;
|
|
268
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
|
|
269
|
+
contextMenu?: string | undefined | undefined;
|
|
270
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
271
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
272
|
+
nonce?: string | undefined | undefined;
|
|
273
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
274
|
+
translate?: "yes" | "no" | undefined | undefined;
|
|
275
|
+
radioGroup?: string | undefined | undefined;
|
|
276
|
+
about?: string | undefined | undefined;
|
|
277
|
+
datatype?: string | undefined | undefined;
|
|
278
|
+
inlist?: any;
|
|
279
|
+
prefix?: string | undefined | undefined;
|
|
280
|
+
property?: string | undefined | undefined;
|
|
281
|
+
rel?: string | undefined | undefined;
|
|
282
|
+
resource?: string | undefined | undefined;
|
|
283
|
+
rev?: string | undefined | undefined;
|
|
284
|
+
typeof?: string | undefined | undefined;
|
|
285
|
+
vocab?: string | undefined | undefined;
|
|
286
|
+
autoCorrect?: string | undefined | undefined;
|
|
287
|
+
autoSave?: string | undefined | undefined;
|
|
288
|
+
itemProp?: string | undefined | undefined;
|
|
289
|
+
itemScope?: boolean | undefined | undefined;
|
|
290
|
+
itemType?: string | undefined | undefined;
|
|
291
|
+
itemID?: string | undefined | undefined;
|
|
292
|
+
itemRef?: string | undefined | undefined;
|
|
293
|
+
results?: number | undefined | undefined;
|
|
294
|
+
security?: string | undefined | undefined;
|
|
295
|
+
unselectable?: "on" | "off" | undefined | undefined;
|
|
296
|
+
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
297
|
+
is?: string | undefined | undefined;
|
|
298
|
+
exportparts?: string | undefined | undefined;
|
|
299
|
+
part?: string | undefined | undefined;
|
|
300
|
+
alt?: string | undefined | undefined;
|
|
301
|
+
src?: string | undefined | undefined;
|
|
301
302
|
formAction?: string | undefined;
|
|
302
303
|
formEncType?: string | undefined | undefined;
|
|
303
304
|
formMethod?: string | undefined | undefined;
|
|
304
305
|
formNoValidate?: boolean | undefined | undefined;
|
|
305
306
|
formTarget?: string | undefined | undefined;
|
|
306
|
-
type?: import("react").HTMLInputTypeAttribute | undefined;
|
|
307
307
|
value?: string | number | readonly string[] | undefined;
|
|
308
308
|
autoComplete?: import("react").HTMLInputAutoCompleteAttribute | undefined;
|
|
309
309
|
accept?: string | undefined | undefined;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { FISComponentDefaults, FISComponentName } from "./componentDefaults";
|
|
3
|
+
/** Cấu hình dùng chung cho cả dự án, truyền qua FISThemeProvider hoặc FISConfigProvider */
|
|
4
|
+
export interface FISComponentConfig {
|
|
5
|
+
/**
|
|
6
|
+
* Prop mặc định theo từng component. Prop truyền trực tiếp luôn thắng.
|
|
7
|
+
* @example { components: { Select: { allowClear: true }, Button: { size: "sm" } } }
|
|
8
|
+
*/
|
|
9
|
+
components?: FISComponentDefaults;
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Dùng `components.Select.allowClear`.
|
|
12
|
+
* Vẫn được đọc, nhưng `components.Select` thắng nếu đặt cả hai.
|
|
13
|
+
*/
|
|
14
|
+
select?: {
|
|
15
|
+
allowClear?: boolean;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface FISConfigProviderProps {
|
|
19
|
+
config?: FISComponentConfig;
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
/** Có thể lồng nhau, config bên trong ghi đè config bên ngoài theo từng component */
|
|
23
|
+
export declare const FISConfigProvider: React.FC<FISConfigProviderProps>;
|
|
24
|
+
export declare const useFISConfig: () => FISComponentConfig;
|
|
25
|
+
/**
|
|
26
|
+
* Gộp prop mặc định từ config vào props.
|
|
27
|
+
* Prop truyền trực tiếp thắng; prop truyền `undefined` coi như không truyền.
|
|
28
|
+
*/
|
|
29
|
+
export declare const useFISComponentDefaults: <P extends object>(name: FISComponentName, props: P) => P;
|
|
30
|
+
/**
|
|
31
|
+
* Bọc component để nhận prop mặc định từ `config.components[name]`.
|
|
32
|
+
* Giữ nguyên type (kể cả generic) của component gốc.
|
|
33
|
+
*/
|
|
34
|
+
export declare const withFISDefaults: <C extends React.ElementType>(name: FISComponentName, Component: C) => C;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { ComponentProps, JSXElementConstructor } from "react";
|
|
2
|
+
import type FISAlertBanner from "../AlertBanner";
|
|
3
|
+
import type FISApiSelect from "../ApiSelect";
|
|
4
|
+
import type FISAvatar from "../Avatar";
|
|
5
|
+
import type FISBadge from "../Badge";
|
|
6
|
+
import type FISBreadcrumb from "../Breadcrumb";
|
|
7
|
+
import type FISButton from "../Button";
|
|
8
|
+
import type FISButtonGroup from "../ButtonGroup";
|
|
9
|
+
import type FISCheckbox from "../Checkbox";
|
|
10
|
+
import type FISCheckboxGroup from "../CheckboxGroup";
|
|
11
|
+
import type FISChipButton from "../ChipButton";
|
|
12
|
+
import type FISCollapse from "../Collapse";
|
|
13
|
+
import type FISCombobox from "../Combobox";
|
|
14
|
+
import type FISDivider from "../Divider";
|
|
15
|
+
import type FISIconButton from "../IconButton";
|
|
16
|
+
import type FISDateRange from "../Input/DateRange";
|
|
17
|
+
import type FISInputArea from "../Input/InputArea";
|
|
18
|
+
import type FISInputDate from "../Input/InputDate";
|
|
19
|
+
import type FISInputField from "../Input/InputField";
|
|
20
|
+
import type FISInputLabel from "../Input/InputLabel";
|
|
21
|
+
import type FISInputStepper from "../Input/InputStepper";
|
|
22
|
+
import type FISInputText from "../Input/InputText";
|
|
23
|
+
import type FISInputTime from "../Input/InputTime";
|
|
24
|
+
import type FISLinkButton from "../LinkButton";
|
|
25
|
+
import type FISMenuItem from "../MenuItem";
|
|
26
|
+
import type FISMenuSection from "../MenuSection";
|
|
27
|
+
import type FISMenuSelect from "../MenuSelect";
|
|
28
|
+
import type FISMenuSelectDropdown from "../MenuSelect/MenuSelectDropdown";
|
|
29
|
+
import type FISPagination from "../Pagination";
|
|
30
|
+
import type FISProgressCircular from "../ProgressCircular";
|
|
31
|
+
import type FISProgressLinear from "../ProgressLinear";
|
|
32
|
+
import type FISRadio from "../Radio";
|
|
33
|
+
import type FISRadioGroup from "../RadioGroup";
|
|
34
|
+
import type FISSegmented from "../Segmented";
|
|
35
|
+
import type FISSelect from "../Select";
|
|
36
|
+
import type FISSelectItem from "../SelectItem";
|
|
37
|
+
import type FISSplitButton from "../SplitButton";
|
|
38
|
+
import type FISSwitch from "../Switch";
|
|
39
|
+
import type FISTableCell from "../Table/ColumnCell";
|
|
40
|
+
import type FISTableHeaderCell from "../Table/HeaderCell";
|
|
41
|
+
import type FISSorter from "../Table/Sorter/FISSorter";
|
|
42
|
+
import type FISTable from "../Table/Table";
|
|
43
|
+
import type FISTab from "../Tabs";
|
|
44
|
+
import type FISText from "../Text";
|
|
45
|
+
import type FISToast from "../Toast";
|
|
46
|
+
import type FISTooltip from "../Tooltip";
|
|
47
|
+
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
48
|
+
/**
|
|
49
|
+
* Prop mang dữ liệu riêng của từng chỗ dùng, không cho đặt mặc định qua config.
|
|
50
|
+
*/
|
|
51
|
+
export type FISNonConfigurableProp = "value" | "defaultValue" | "onChange" | "checked" | "defaultChecked" | "children" | "options" | "multi" | "dataSource" | "columns" | "ref" | "key";
|
|
52
|
+
/** Prop mặc định của một component: mọi prop trừ FISNonConfigurableProp, đều tuỳ chọn */
|
|
53
|
+
export type FISDefaultProps<C> = Partial<DistributiveOmit<ComponentProps<C extends JSXElementConstructor<any> ? C : never>, FISNonConfigurableProp>>;
|
|
54
|
+
/**
|
|
55
|
+
* Prop mặc định theo từng component, key là tên component bỏ tiền tố "FIS".
|
|
56
|
+
* Prop truyền trực tiếp vào component luôn thắng giá trị ở đây.
|
|
57
|
+
*/
|
|
58
|
+
export interface FISComponentDefaults {
|
|
59
|
+
AlertBanner?: FISDefaultProps<typeof FISAlertBanner>;
|
|
60
|
+
/** Kế thừa thêm `Select` (giá trị ở `ApiSelect` thắng `Select`) */
|
|
61
|
+
ApiSelect?: FISDefaultProps<typeof FISApiSelect>;
|
|
62
|
+
Avatar?: FISDefaultProps<typeof FISAvatar>;
|
|
63
|
+
Badge?: FISDefaultProps<typeof FISBadge>;
|
|
64
|
+
Breadcrumb?: FISDefaultProps<typeof FISBreadcrumb>;
|
|
65
|
+
Button?: FISDefaultProps<typeof FISButton>;
|
|
66
|
+
ButtonGroup?: FISDefaultProps<typeof FISButtonGroup>;
|
|
67
|
+
Checkbox?: FISDefaultProps<typeof FISCheckbox>;
|
|
68
|
+
CheckboxGroup?: FISDefaultProps<typeof FISCheckboxGroup>;
|
|
69
|
+
ChipButton?: FISDefaultProps<typeof FISChipButton>;
|
|
70
|
+
Collapse?: FISDefaultProps<typeof FISCollapse>;
|
|
71
|
+
Combobox?: FISDefaultProps<typeof FISCombobox>;
|
|
72
|
+
DateRange?: FISDefaultProps<typeof FISDateRange>;
|
|
73
|
+
Divider?: FISDefaultProps<typeof FISDivider>;
|
|
74
|
+
IconButton?: FISDefaultProps<typeof FISIconButton>;
|
|
75
|
+
InputArea?: FISDefaultProps<typeof FISInputArea>;
|
|
76
|
+
InputDate?: FISDefaultProps<typeof FISInputDate>;
|
|
77
|
+
InputField?: FISDefaultProps<typeof FISInputField>;
|
|
78
|
+
InputLabel?: FISDefaultProps<typeof FISInputLabel>;
|
|
79
|
+
InputStepper?: FISDefaultProps<typeof FISInputStepper>;
|
|
80
|
+
InputText?: FISDefaultProps<typeof FISInputText>;
|
|
81
|
+
InputTime?: FISDefaultProps<typeof FISInputTime>;
|
|
82
|
+
LinkButton?: FISDefaultProps<typeof FISLinkButton>;
|
|
83
|
+
MenuItem?: FISDefaultProps<typeof FISMenuItem>;
|
|
84
|
+
MenuSection?: FISDefaultProps<typeof FISMenuSection>;
|
|
85
|
+
MenuSelect?: FISDefaultProps<typeof FISMenuSelect>;
|
|
86
|
+
MenuSelectDropdown?: FISDefaultProps<typeof FISMenuSelectDropdown>;
|
|
87
|
+
Pagination?: FISDefaultProps<typeof FISPagination>;
|
|
88
|
+
ProgressCircular?: FISDefaultProps<typeof FISProgressCircular>;
|
|
89
|
+
ProgressLinear?: FISDefaultProps<typeof FISProgressLinear>;
|
|
90
|
+
Radio?: FISDefaultProps<typeof FISRadio>;
|
|
91
|
+
RadioGroup?: FISDefaultProps<typeof FISRadioGroup>;
|
|
92
|
+
Segmented?: FISDefaultProps<typeof FISSegmented>;
|
|
93
|
+
Select?: FISDefaultProps<typeof FISSelect>;
|
|
94
|
+
SelectItem?: FISDefaultProps<typeof FISSelectItem>;
|
|
95
|
+
Sorter?: FISDefaultProps<typeof FISSorter>;
|
|
96
|
+
SplitButton?: FISDefaultProps<typeof FISSplitButton>;
|
|
97
|
+
Switch?: FISDefaultProps<typeof FISSwitch>;
|
|
98
|
+
Tab?: FISDefaultProps<typeof FISTab>;
|
|
99
|
+
Table?: FISDefaultProps<typeof FISTable>;
|
|
100
|
+
TableCell?: FISDefaultProps<typeof FISTableCell>;
|
|
101
|
+
TableHeaderCell?: FISDefaultProps<typeof FISTableHeaderCell>;
|
|
102
|
+
Text?: FISDefaultProps<typeof FISText>;
|
|
103
|
+
Toast?: FISDefaultProps<typeof FISToast>;
|
|
104
|
+
Tooltip?: FISDefaultProps<typeof FISTooltip>;
|
|
105
|
+
}
|
|
106
|
+
export type FISComponentName = keyof FISComponentDefaults;
|
|
107
|
+
export {};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { DefaultTheme } from "styled-components";
|
|
3
|
+
import { FISComponentConfig } from "./ConfigContext";
|
|
3
4
|
export interface ThemeProviderProps {
|
|
4
5
|
theme?: DefaultTheme;
|
|
6
|
+
/** Cấu hình mặc định cho component theo từng dự án */
|
|
7
|
+
config?: FISComponentConfig;
|
|
5
8
|
children: React.ReactNode;
|
|
6
9
|
}
|
|
7
10
|
declare const FISThemeProvider: React.FC<ThemeProviderProps>;
|
|
@@ -145,3 +145,4 @@ export declare const Virtualized: import("@storybook/core/csf").AnnotatedStoryFn
|
|
|
145
145
|
export declare const LoadMore: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, SingleSelectStoryProps>;
|
|
146
146
|
export declare const NoPortal: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, SingleSelectStoryProps>;
|
|
147
147
|
export declare const WithRef: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, SingleSelectStoryProps>;
|
|
148
|
+
export declare const AllowClear: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, SingleSelectStoryProps>;
|
|
@@ -4,3 +4,4 @@ export declare const DivInputWrapperSC: import("styled-components/dist/types").I
|
|
|
4
4
|
}>> & string;
|
|
5
5
|
export declare const DivDropdownMenuSC: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
6
6
|
export declare const SelectedTagsWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
7
|
+
export declare const SpanClearIconSC: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
@@ -29,16 +29,47 @@ type BaseSelectProps<T extends string | number> = Partial<InputLabelProps> & Omi
|
|
|
29
29
|
tooltipTitle?: TooltipTitleCustom | React.ReactNode;
|
|
30
30
|
/** Tooltip variant color */
|
|
31
31
|
tooltipVariant?: "primary" | "secondary";
|
|
32
|
+
/**
|
|
33
|
+
* Hiện nút "×" khi hover vào ô đã có giá trị (giống antd).
|
|
34
|
+
*
|
|
35
|
+
* Bấm "×":
|
|
36
|
+
* - Select đơn: gọi `onChange(undefined)`, sau đó gọi `onClear()`.
|
|
37
|
+
* - Multi select: gọi `onChange([])`, sau đó gọi `onClear()`.
|
|
38
|
+
*
|
|
39
|
+
* Thứ tự ưu tiên: prop `allowClear` truyền trực tiếp
|
|
40
|
+
* > `config.components.Select.allowClear` của `FISThemeProvider`
|
|
41
|
+
* > mặc định `false`.
|
|
42
|
+
*
|
|
43
|
+
* Không hiện nút khi `disabled` hoặc chưa có giá trị.
|
|
44
|
+
*/
|
|
45
|
+
allowClear?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Gọi sau `onChange` khi người dùng bấm nút "×" (chỉ khi `allowClear` bật).
|
|
48
|
+
* Select đơn: sau `onChange(undefined)`. Multi select: sau `onChange([])`.
|
|
49
|
+
*/
|
|
50
|
+
onClear?: () => void;
|
|
32
51
|
};
|
|
33
52
|
export type SingleSelectProps<T extends string | number> = BaseSelectProps<T> & {
|
|
34
53
|
multi?: false;
|
|
35
|
-
|
|
36
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Giá trị đang chọn. `undefined`, `null` hoặc `""` được coi là chưa chọn
|
|
56
|
+
* (ô hiển thị placeholder).
|
|
57
|
+
*/
|
|
58
|
+
value?: T | null;
|
|
59
|
+
/**
|
|
60
|
+
* Gọi khi giá trị thay đổi.
|
|
61
|
+
*
|
|
62
|
+
* Nhận `undefined` khi người dùng bấm nút "×" (`allowClear`), sau đó
|
|
63
|
+
* `onClear()` được gọi. Luôn xử lý trường hợp `undefined`, ví dụ:
|
|
64
|
+
* `onChange={(value) => field.onChange(value == null ? "" : String(value))}`.
|
|
65
|
+
*/
|
|
66
|
+
onChange: (value: T | undefined) => void;
|
|
37
67
|
displayValue?: (item: SelectOptionItem<T>) => string;
|
|
38
68
|
};
|
|
39
69
|
export type MultiSelectProps<T extends string | number> = BaseSelectProps<T> & {
|
|
40
70
|
multi: true;
|
|
41
71
|
value: T[];
|
|
72
|
+
/** Gọi khi giá trị thay đổi. Nhận `[]` khi người dùng bấm nút "×" (`allowClear`). */
|
|
42
73
|
onChange: (value: T[]) => void;
|
|
43
74
|
displayValue?: (items: SelectOptionItem<T>[]) => string;
|
|
44
75
|
};
|
|
@@ -1,53 +1,104 @@
|
|
|
1
|
+
import RawButton from "./components/Button";
|
|
2
|
+
import RawLinkButton from "./components/LinkButton";
|
|
3
|
+
import RawIconButton from "./components/IconButton";
|
|
4
|
+
import RawSwitch from "./components/Switch";
|
|
5
|
+
import RawTab from "./components/Tabs";
|
|
6
|
+
import RawSegmented from "./components/Segmented";
|
|
7
|
+
import RawButtonGroup from "./components/ButtonGroup";
|
|
8
|
+
import RawBreadcrumb from "./components/Breadcrumb";
|
|
9
|
+
import RawRadio from "./components/Radio";
|
|
10
|
+
import RawRadioGroup from "./components/RadioGroup";
|
|
11
|
+
import RawCheckbox from "./components/Checkbox";
|
|
12
|
+
import RawInputField from "./components/Input/InputField";
|
|
13
|
+
import RawInputText from "./components/Input/InputText";
|
|
14
|
+
import RawInputLabel from "./components/Input/InputLabel";
|
|
15
|
+
import RawAvatar from "./components/Avatar";
|
|
16
|
+
import RawInputArea from "./components/Input/InputArea";
|
|
17
|
+
import RawInputStepper from "./components/Input/InputStepper";
|
|
18
|
+
import RawTooltip from "./components/Tooltip";
|
|
19
|
+
import RawMenuSelect from "./components/MenuSelect";
|
|
20
|
+
import RawMenuItem from "./components/MenuItem";
|
|
21
|
+
import RawMenuSection from "./components/MenuSection";
|
|
22
|
+
import RawDivider from "./components/Divider";
|
|
23
|
+
import RawBadge from "./components/Badge";
|
|
24
|
+
import RawCollapse from "./components/Collapse";
|
|
25
|
+
import RawToast from "./components/Toast";
|
|
26
|
+
import RawCombobox from "./components/Combobox";
|
|
27
|
+
import RawChipButton from "./components/ChipButton";
|
|
28
|
+
import RawInputTime from "./components/Input/InputTime";
|
|
29
|
+
import RawInputDate from "./components/Input/InputDate";
|
|
30
|
+
import RawTable from "./components/Table/Table";
|
|
31
|
+
import RawTableCell from "./components/Table/ColumnCell";
|
|
32
|
+
import RawSorter from "./components/Table/Sorter/FISSorter";
|
|
33
|
+
import RawDateRange from "./components/Input/DateRange";
|
|
34
|
+
import RawAlertBanner from "./components/AlertBanner";
|
|
35
|
+
import RawProgressCircular from "./components/ProgressCircular";
|
|
36
|
+
import RawProgressLinear from "./components/ProgressLinear";
|
|
37
|
+
import RawSplitButton from "./components/SplitButton";
|
|
38
|
+
import RawSelect from "./components/Select";
|
|
39
|
+
import RawApiSelect from "./components/ApiSelect";
|
|
40
|
+
import RawSelectItem from "./components/SelectItem";
|
|
41
|
+
import RawPagination from "./components/Pagination";
|
|
42
|
+
import RawText from "./components/Text";
|
|
1
43
|
export { default as FISThemeProvider } from "./components/Provider";
|
|
44
|
+
export { FISConfigProvider, useFISConfig, useFISComponentDefaults, withFISDefaults, } from "./components/Provider/ConfigContext";
|
|
45
|
+
export type { FISComponentConfig, FISConfigProviderProps, } from "./components/Provider/ConfigContext";
|
|
46
|
+
export type { FISComponentDefaults, FISComponentName, FISDefaultProps, FISNonConfigurableProp, } from "./components/Provider/componentDefaults";
|
|
2
47
|
export type { ThemeType } from "./styles/design-system";
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export { default as FISIconButton } from "./components/IconButton";
|
|
6
|
-
export { default as FISSwitch } from "./components/Switch";
|
|
7
|
-
export { default as FISTab, TabPanelItem } from "./components/Tabs";
|
|
8
|
-
export { default as FISSegmented, SegmentedPanelItem, } from "./components/Segmented";
|
|
9
|
-
export { default as FISButtonGroup } from "./components/ButtonGroup";
|
|
10
|
-
export { default as FISBreadcrumb } from "./components/Breadcrumb";
|
|
11
|
-
export { default as FISRadio } from "./components/Radio";
|
|
12
|
-
export { default as FISRadioGroup } from "./components/RadioGroup";
|
|
13
|
-
export { default as FISCheckbox } from "./components/Checkbox";
|
|
14
|
-
export { default as FISCheckboxGroup } from "./components/CheckboxGroup";
|
|
15
|
-
export { default as FISInputField } from "./components/Input/InputField";
|
|
16
|
-
export { default as FISInputText } from "./components/Input/InputText";
|
|
17
|
-
export { default as FISInputLabel } from "./components/Input/InputLabel";
|
|
18
|
-
export { default as FISAvatar } from "./components/Avatar";
|
|
19
|
-
export { default as FISInputArea } from "./components/Input/InputArea";
|
|
20
|
-
export { default as FISInputStepper } from "./components/Input/InputStepper";
|
|
21
|
-
export { default as FISTooltip } from "./components/Tooltip";
|
|
22
|
-
export { default as FISMenuSelect } from "./components/MenuSelect";
|
|
23
|
-
export { default as FISMenuSelectDropdown } from "./components/MenuSelect/MenuSelectDropdown";
|
|
48
|
+
export { TabPanelItem } from "./components/Tabs";
|
|
49
|
+
export { SegmentedPanelItem } from "./components/Segmented";
|
|
24
50
|
export type { FISMenuData, FISMenuSelectDropdownProps, } from "./components/MenuSelect/MenuSelectDropdown";
|
|
25
|
-
export { default as FISMenuItem } from "./components/MenuItem";
|
|
26
|
-
export { default as FISMenuSection } from "./components/MenuSection";
|
|
27
|
-
export { default as FISDivider } from "./components/Divider";
|
|
28
|
-
export { default as FISBadge } from "./components/Badge";
|
|
29
|
-
export { default as FISCollapse } from "./components/Collapse";
|
|
30
|
-
export { default as FISToast } from "./components/Toast";
|
|
31
|
-
export { default as FISCombobox } from "./components/Combobox";
|
|
32
|
-
export { default as FISChipButton } from "./components/ChipButton";
|
|
33
|
-
export { default as FISInputTime } from "./components/Input/InputTime";
|
|
34
|
-
export { default as FISInputDate } from "./components/Input/InputDate";
|
|
35
|
-
export { default as FISTable } from "./components/Table/Table";
|
|
36
51
|
export type { FISTableRef, TableProps as FISTableProps, } from "./components/Table/Table";
|
|
37
|
-
export { default as FISTableHeaderCell } from "./components/Table/HeaderCell";
|
|
38
|
-
export { default as FISTableCell } from "./components/Table/ColumnCell";
|
|
39
|
-
export { default as FISSorter } from "./components/Table/Sorter/FISSorter";
|
|
40
|
-
export { default as FISDateRange } from "./components/Input/DateRange";
|
|
41
|
-
export { default as FISAlertBanner } from "./components/AlertBanner";
|
|
42
|
-
export { default as FISProgressCircular } from "./components/ProgressCircular";
|
|
43
|
-
export { default as FISProgressLinear } from "./components/ProgressLinear";
|
|
44
|
-
export { default as FISSplitButton } from "./components/SplitButton";
|
|
45
|
-
export { default as FISSelect } from "./components/Select";
|
|
46
|
-
export { default as FISApiSelect } from "./components/ApiSelect";
|
|
47
52
|
export type { ApiSelectProps, ApiSelectRef, FetchAll, FetchPage, FetchPageParams, FetchPageResult, FetchAllParams, } from "./components/ApiSelect/types";
|
|
48
|
-
export { default as FISSelectItem } from "./components/SelectItem";
|
|
49
53
|
export { default as useNotification } from "./components/Notification/useNotification";
|
|
50
54
|
export { default as useToast } from "./components/Toast/useToast";
|
|
51
|
-
export {
|
|
52
|
-
export
|
|
53
|
-
export
|
|
55
|
+
export type { PaginationProps as FISPaginationProps } from "./components/Pagination";
|
|
56
|
+
export declare const FISButton: typeof RawButton;
|
|
57
|
+
export declare const FISLinkButton: typeof RawLinkButton;
|
|
58
|
+
export declare const FISIconButton: typeof RawIconButton;
|
|
59
|
+
export declare const FISSwitch: typeof RawSwitch;
|
|
60
|
+
export declare const FISTab: typeof RawTab;
|
|
61
|
+
export declare const FISSegmented: typeof RawSegmented;
|
|
62
|
+
export declare const FISButtonGroup: typeof RawButtonGroup;
|
|
63
|
+
export declare const FISBreadcrumb: typeof RawBreadcrumb;
|
|
64
|
+
export declare const FISRadio: typeof RawRadio;
|
|
65
|
+
export declare const FISRadioGroup: typeof RawRadioGroup;
|
|
66
|
+
export declare const FISCheckbox: typeof RawCheckbox;
|
|
67
|
+
export declare const FISCheckboxGroup: <T extends string | number>(props: import("./components/CheckboxGroup").CheckboxGroupProps<T> & {
|
|
68
|
+
ref?: import("react").ForwardedRef<{
|
|
69
|
+
focus: () => void;
|
|
70
|
+
}>;
|
|
71
|
+
}) => JSX.Element;
|
|
72
|
+
export declare const FISInputField: typeof RawInputField;
|
|
73
|
+
export declare const FISInputText: typeof RawInputText;
|
|
74
|
+
export declare const FISInputLabel: typeof RawInputLabel;
|
|
75
|
+
export declare const FISAvatar: typeof RawAvatar;
|
|
76
|
+
export declare const FISInputArea: typeof RawInputArea;
|
|
77
|
+
export declare const FISInputStepper: typeof RawInputStepper;
|
|
78
|
+
export declare const FISTooltip: typeof RawTooltip;
|
|
79
|
+
export declare const FISMenuSelect: typeof RawMenuSelect;
|
|
80
|
+
export declare const FISMenuSelectDropdown: import("react").FC<import("./components/MenuSelect/MenuSelectDropdown").FISMenuSelectDropdownProps>;
|
|
81
|
+
export declare const FISMenuItem: typeof RawMenuItem;
|
|
82
|
+
export declare const FISMenuSection: typeof RawMenuSection;
|
|
83
|
+
export declare const FISDivider: typeof RawDivider;
|
|
84
|
+
export declare const FISBadge: typeof RawBadge;
|
|
85
|
+
export declare const FISCollapse: typeof RawCollapse;
|
|
86
|
+
export declare const FISToast: typeof RawToast;
|
|
87
|
+
export declare const FISCombobox: typeof RawCombobox;
|
|
88
|
+
export declare const FISChipButton: typeof RawChipButton;
|
|
89
|
+
export declare const FISInputTime: typeof RawInputTime;
|
|
90
|
+
export declare const FISInputDate: typeof RawInputDate;
|
|
91
|
+
export declare const FISTable: typeof RawTable;
|
|
92
|
+
export declare const FISTableHeaderCell: import("react").ForwardRefExoticComponent<import("./components/Table/HeaderCell").HeaderCellProps & import("react").RefAttributes<HTMLLabelElement>>;
|
|
93
|
+
export declare const FISTableCell: typeof RawTableCell;
|
|
94
|
+
export declare const FISSorter: typeof RawSorter;
|
|
95
|
+
export declare const FISDateRange: typeof RawDateRange;
|
|
96
|
+
export declare const FISAlertBanner: typeof RawAlertBanner;
|
|
97
|
+
export declare const FISProgressCircular: typeof RawProgressCircular;
|
|
98
|
+
export declare const FISProgressLinear: typeof RawProgressLinear;
|
|
99
|
+
export declare const FISSplitButton: typeof RawSplitButton;
|
|
100
|
+
export declare const FISSelect: typeof RawSelect;
|
|
101
|
+
export declare const FISApiSelect: typeof RawApiSelect;
|
|
102
|
+
export declare const FISSelectItem: typeof RawSelectItem;
|
|
103
|
+
export declare const FISPagination: typeof RawPagination;
|
|
104
|
+
export declare const FISText: typeof RawText;
|