@douyinfe/semi-ui 2.10.2 → 2.11.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/anchor/link.tsx +2 -2
- package/autoComplete/index.tsx +3 -3
- package/avatar/interface.ts +2 -2
- package/badge/index.tsx +1 -1
- package/banner/index.tsx +4 -4
- package/breadcrumb/bread-context.tsx +1 -1
- package/card/cardGroup.tsx +1 -1
- package/card/index.tsx +1 -1
- package/cascader/index.tsx +4 -4
- package/checkbox/checkbox.tsx +16 -6
- package/collapse/index.tsx +1 -1
- package/collapse/item.tsx +1 -1
- package/collapsible/index.tsx +1 -1
- package/datePicker/_story/datePicker.stories.js +48 -1
- package/datePicker/_story/v2/AutoFillTime.jsx +37 -0
- package/datePicker/_story/v2/InputFormat.jsx +29 -0
- package/datePicker/_story/v2/InputFormatConfirm.jsx +44 -0
- package/datePicker/_story/v2/InputFormatDisabled.jsx +27 -0
- package/datePicker/_story/v2/index.js +4 -0
- package/datePicker/dateInput.tsx +7 -0
- package/datePicker/datePicker.tsx +7 -11
- package/datePicker/monthsGrid.tsx +2 -1
- package/descriptions/item.tsx +1 -1
- package/dist/umd/semi-ui.js +521 -197
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/empty/index.tsx +1 -1
- package/form/errorMessage.tsx +1 -1
- package/form/interface.ts +1 -1
- package/form/label.tsx +1 -1
- package/form/section.tsx +2 -2
- package/form/slot.tsx +1 -1
- package/layout/Sider.tsx +1 -1
- package/lib/cjs/anchor/link.d.ts +2 -2
- package/lib/cjs/autoComplete/index.d.ts +1 -1
- package/lib/cjs/autoComplete/index.js +1 -1
- package/lib/cjs/avatar/interface.d.ts +2 -2
- package/lib/cjs/badge/index.d.ts +1 -1
- package/lib/cjs/banner/index.d.ts +4 -4
- package/lib/cjs/breadcrumb/bread-context.d.ts +1 -1
- package/lib/cjs/card/cardGroup.d.ts +1 -1
- package/lib/cjs/card/index.d.ts +1 -1
- package/lib/cjs/cascader/index.d.ts +1 -1
- package/lib/cjs/checkbox/checkbox.d.ts +4 -0
- package/lib/cjs/checkbox/checkbox.js +23 -11
- package/lib/cjs/collapse/index.d.ts +1 -1
- package/lib/cjs/collapse/item.d.ts +1 -1
- package/lib/cjs/collapsible/index.d.ts +1 -1
- package/lib/cjs/datePicker/dateInput.d.ts +1 -0
- package/lib/cjs/datePicker/dateInput.js +5 -3
- package/lib/cjs/datePicker/datePicker.js +9 -12
- package/lib/cjs/datePicker/monthsGrid.js +2 -1
- package/lib/cjs/descriptions/item.d.ts +1 -1
- package/lib/cjs/empty/index.d.ts +1 -1
- package/lib/cjs/form/errorMessage.d.ts +1 -1
- package/lib/cjs/form/interface.d.ts +1 -1
- package/lib/cjs/form/label.d.ts +1 -1
- package/lib/cjs/form/section.d.ts +2 -2
- package/lib/cjs/form/slot.d.ts +1 -1
- package/lib/cjs/layout/Sider.d.ts +1 -1
- package/lib/cjs/list/index.d.ts +1 -1
- package/lib/cjs/list/item.d.ts +1 -1
- package/lib/cjs/modal/Modal.d.ts +5 -5
- package/lib/cjs/modal/ModalContent.d.ts +1 -1
- package/lib/cjs/modal/confirm.d.ts +4 -2
- package/lib/cjs/modal/useModal/index.d.ts +16 -23
- package/lib/cjs/navigation/Footer.d.ts +1 -1
- package/lib/cjs/radio/radio.d.ts +4 -0
- package/lib/cjs/radio/radio.js +26 -12
- package/lib/cjs/radio/radioGroup.d.ts +1 -1
- package/lib/cjs/select/index.d.ts +1 -1
- package/lib/cjs/sideSheet/SideSheetContent.d.ts +1 -1
- package/lib/cjs/table/interface.d.ts +1 -1
- package/lib/cjs/tag/group.d.ts +3 -3
- package/lib/cjs/timeline/index.d.ts +1 -1
- package/lib/cjs/timeline/item.d.ts +1 -1
- package/lib/cjs/tooltip/index.d.ts +1 -0
- package/lib/cjs/tooltip/index.js +6 -1
- package/lib/es/anchor/link.d.ts +2 -2
- package/lib/es/autoComplete/index.d.ts +1 -1
- package/lib/es/autoComplete/index.js +1 -1
- package/lib/es/avatar/interface.d.ts +2 -2
- package/lib/es/badge/index.d.ts +1 -1
- package/lib/es/banner/index.d.ts +4 -4
- package/lib/es/breadcrumb/bread-context.d.ts +1 -1
- package/lib/es/card/cardGroup.d.ts +1 -1
- package/lib/es/card/index.d.ts +1 -1
- package/lib/es/cascader/index.d.ts +1 -1
- package/lib/es/checkbox/checkbox.d.ts +4 -0
- package/lib/es/checkbox/checkbox.js +23 -11
- package/lib/es/collapse/index.d.ts +1 -1
- package/lib/es/collapse/item.d.ts +1 -1
- package/lib/es/collapsible/index.d.ts +1 -1
- package/lib/es/datePicker/dateInput.d.ts +1 -0
- package/lib/es/datePicker/dateInput.js +5 -3
- package/lib/es/datePicker/datePicker.js +9 -12
- package/lib/es/datePicker/monthsGrid.js +2 -1
- package/lib/es/descriptions/item.d.ts +1 -1
- package/lib/es/empty/index.d.ts +1 -1
- package/lib/es/form/errorMessage.d.ts +1 -1
- package/lib/es/form/interface.d.ts +1 -1
- package/lib/es/form/label.d.ts +1 -1
- package/lib/es/form/section.d.ts +2 -2
- package/lib/es/form/slot.d.ts +1 -1
- package/lib/es/layout/Sider.d.ts +1 -1
- package/lib/es/list/index.d.ts +1 -1
- package/lib/es/list/item.d.ts +1 -1
- package/lib/es/modal/Modal.d.ts +5 -5
- package/lib/es/modal/ModalContent.d.ts +1 -1
- package/lib/es/modal/confirm.d.ts +4 -2
- package/lib/es/modal/confirm.js +1 -1
- package/lib/es/modal/useModal/index.d.ts +16 -23
- package/lib/es/navigation/Footer.d.ts +1 -1
- package/lib/es/radio/radio.d.ts +4 -0
- package/lib/es/radio/radio.js +26 -12
- package/lib/es/radio/radioGroup.d.ts +1 -1
- package/lib/es/select/index.d.ts +1 -1
- package/lib/es/sideSheet/SideSheetContent.d.ts +1 -1
- package/lib/es/table/interface.d.ts +1 -1
- package/lib/es/tag/group.d.ts +3 -3
- package/lib/es/timeline/index.d.ts +1 -1
- package/lib/es/timeline/item.d.ts +1 -1
- package/lib/es/tooltip/index.d.ts +1 -0
- package/lib/es/tooltip/index.js +6 -1
- package/list/index.tsx +1 -1
- package/list/item.tsx +1 -1
- package/modal/Modal.tsx +7 -7
- package/modal/ModalContent.tsx +1 -1
- package/modal/confirm.tsx +10 -11
- package/modal/useModal/index.tsx +9 -1
- package/navigation/Footer.tsx +2 -2
- package/package.json +9 -9
- package/radio/radio.tsx +17 -7
- package/radio/radioGroup.tsx +1 -1
- package/select/index.tsx +8 -8
- package/sideSheet/SideSheetContent.tsx +1 -1
- package/table/interface.ts +1 -1
- package/tag/group.tsx +4 -4
- package/timeline/index.tsx +1 -1
- package/timeline/item.tsx +1 -1
- package/tooltip/index.tsx +5 -1
- package/treeSelect/index.tsx +1 -1
package/empty/index.tsx
CHANGED
package/form/errorMessage.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import { IconAlertTriangle, IconAlertCircle } from '@douyinfe/semi-icons';
|
|
|
7
7
|
|
|
8
8
|
const prefix = cssClasses.PREFIX;
|
|
9
9
|
|
|
10
|
-
export type ReactFieldError =
|
|
10
|
+
export type ReactFieldError = Array<any> | React.ReactNode;
|
|
11
11
|
|
|
12
12
|
export interface ErrorMessageProps {
|
|
13
13
|
error?: ReactFieldError;
|
package/form/interface.ts
CHANGED
|
@@ -21,7 +21,7 @@ export type CommonFieldProps = {
|
|
|
21
21
|
/** Field is required (except Form. Checkbox within the Group, Form. Radio) */
|
|
22
22
|
field: string;
|
|
23
23
|
/** The label text of the form control is the same name as the field by default when it is not passed */
|
|
24
|
-
label?:
|
|
24
|
+
label?: LabelProps | React.ReactNode;
|
|
25
25
|
labelPosition?: 'top' | 'left' | 'inset';
|
|
26
26
|
labelAlign?: 'left' | 'right';
|
|
27
27
|
labelWidth?: number | string;
|
package/form/label.tsx
CHANGED
package/form/section.tsx
CHANGED
|
@@ -9,8 +9,8 @@ const prefix = cssClasses.PREFIX;
|
|
|
9
9
|
export interface SectionProps {
|
|
10
10
|
className?: string;
|
|
11
11
|
style?: React.CSSProperties;
|
|
12
|
-
text?: React.ReactNode
|
|
13
|
-
children?: React.ReactNode
|
|
12
|
+
text?: React.ReactNode;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export default class Section extends PureComponent<SectionProps> {
|
package/form/slot.tsx
CHANGED
|
@@ -13,7 +13,7 @@ const prefix = cssClasses.PREFIX;
|
|
|
13
13
|
export interface SlotProps {
|
|
14
14
|
className?: string;
|
|
15
15
|
style?: React.CSSProperties;
|
|
16
|
-
label?: LabelProps | React.ReactNode
|
|
16
|
+
label?: LabelProps | React.ReactNode;
|
|
17
17
|
noLabel?: boolean;
|
|
18
18
|
labelPosition?: 'top' | 'left';
|
|
19
19
|
error?: ErrorMessageProps;
|
package/layout/Sider.tsx
CHANGED
|
@@ -38,7 +38,7 @@ export interface SiderProps {
|
|
|
38
38
|
prefixCls?: string;
|
|
39
39
|
style?: CSSProperties;
|
|
40
40
|
className?: string;
|
|
41
|
-
children?: React.ReactNode
|
|
41
|
+
children?: React.ReactNode;
|
|
42
42
|
breakpoint?: Array<keyof ResponsiveMap>;
|
|
43
43
|
onBreakpoint?: (screen: keyof ResponsiveMap, match: boolean) => void;
|
|
44
44
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
package/lib/cjs/anchor/link.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ import LinkFoundation, { LinkAdapter } from '@douyinfe/semi-foundation/lib/cjs/a
|
|
|
5
5
|
import { AnchorContextType } from './anchor-context';
|
|
6
6
|
export interface LinkProps {
|
|
7
7
|
href?: string;
|
|
8
|
-
title?:
|
|
8
|
+
title?: ReactNode;
|
|
9
9
|
className?: string;
|
|
10
|
-
children?: ReactNode
|
|
10
|
+
children?: ReactNode;
|
|
11
11
|
style?: React.CSSProperties;
|
|
12
12
|
disabled?: boolean;
|
|
13
13
|
}
|
|
@@ -36,7 +36,7 @@ export interface AutoCompleteProps<T extends AutoCompleteItems> {
|
|
|
36
36
|
dropdownMatchSelectWidth?: boolean;
|
|
37
37
|
dropdownClassName?: string;
|
|
38
38
|
dropdownStyle?: React.CSSProperties;
|
|
39
|
-
emptyContent?: React.ReactNode
|
|
39
|
+
emptyContent?: React.ReactNode;
|
|
40
40
|
getPopupContainer?: () => HTMLElement;
|
|
41
41
|
insetLabel?: React.ReactNode;
|
|
42
42
|
insetLabelId?: string;
|
|
@@ -98,7 +98,7 @@ class AutoComplete extends _baseComponent.default {
|
|
|
98
98
|
this.triggerRef = /*#__PURE__*/_react.default.createRef();
|
|
99
99
|
this.optionsRef = /*#__PURE__*/_react.default.createRef();
|
|
100
100
|
this.clickOutsideHandler = null;
|
|
101
|
-
(0, _warning.default)('triggerRender' in this.props && typeof this.props.triggerRender === 'function', "[Semi AutoComplete]
|
|
101
|
+
(0, _warning.default)('triggerRender' in this.props && typeof this.props.triggerRender === 'function', "[Semi AutoComplete]\n - If you are using the following props: 'suffix', 'prefix', 'showClear', 'validateStatus', and 'size',\n please notice that they will be removed in the next major version.\n Please use 'componentProps' to retrieve these props instead.\n - If you are using 'onBlur', 'onFocus', please try to avoid using them and look for changes in the future.");
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
get adapter() {
|
|
@@ -4,7 +4,7 @@ export declare type AvatarShape = 'circle' | 'square';
|
|
|
4
4
|
export declare type AvatarSize = 'extra-extra-small' | 'extra-small' | 'small' | 'default' | 'medium' | 'large' | 'extra-large';
|
|
5
5
|
export declare type AvatarColor = 'amber' | 'blue' | 'cyan' | 'green' | 'grey' | 'indigo' | 'light-blue' | 'light-green' | 'lime' | 'orange' | 'pink' | 'purple' | 'red' | 'teal' | 'violet' | 'yellow';
|
|
6
6
|
export interface AvatarProps extends BaseProps {
|
|
7
|
-
children?: React.ReactNode
|
|
7
|
+
children?: React.ReactNode;
|
|
8
8
|
color?: AvatarColor;
|
|
9
9
|
shape?: AvatarShape;
|
|
10
10
|
size?: AvatarSize;
|
|
@@ -22,7 +22,7 @@ export declare type AvatarGroupShape = 'circle' | 'square';
|
|
|
22
22
|
export declare type AvatarGroupSize = 'extra-extra-small' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';
|
|
23
23
|
export declare type AvatarGroupOverlapFrom = 'start' | 'end';
|
|
24
24
|
export interface AvatarGroupProps {
|
|
25
|
-
children?: React.ReactNode
|
|
25
|
+
children?: React.ReactNode;
|
|
26
26
|
shape?: AvatarGroupShape;
|
|
27
27
|
size?: AvatarGroupSize;
|
|
28
28
|
overlapFrom?: AvatarGroupOverlapFrom;
|
package/lib/cjs/badge/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export interface BadgeProps {
|
|
|
17
17
|
onMouseEnter?: (e: React.MouseEvent) => any;
|
|
18
18
|
onMouseLeave?: (e: React.MouseEvent) => any;
|
|
19
19
|
onClick?: (e: React.MouseEvent) => any;
|
|
20
|
-
children?: React.ReactNode
|
|
20
|
+
children?: React.ReactNode;
|
|
21
21
|
}
|
|
22
22
|
export default class Badge extends PureComponent<BadgeProps> {
|
|
23
23
|
static contextType: React.Context<ContextValue>;
|
|
@@ -7,15 +7,15 @@ export declare type Type = 'info' | 'danger' | 'warning' | 'success';
|
|
|
7
7
|
export interface BannerProps {
|
|
8
8
|
type?: Type;
|
|
9
9
|
className?: string;
|
|
10
|
-
children?: React.ReactNode
|
|
10
|
+
children?: React.ReactNode;
|
|
11
11
|
fullMode?: boolean;
|
|
12
12
|
title?: React.ReactNode;
|
|
13
13
|
description?: React.ReactNode;
|
|
14
|
-
icon?:
|
|
15
|
-
closeIcon?:
|
|
14
|
+
icon?: React.ReactNode;
|
|
15
|
+
closeIcon?: React.ReactNode;
|
|
16
16
|
style?: React.CSSProperties;
|
|
17
17
|
bordered?: boolean;
|
|
18
|
-
onClose
|
|
18
|
+
onClose?(e: React.MouseEvent): void;
|
|
19
19
|
}
|
|
20
20
|
export interface BannerState {
|
|
21
21
|
visible: boolean;
|
|
@@ -5,7 +5,7 @@ export interface BreadContextType {
|
|
|
5
5
|
onClick?: (info: BreadcrumbItemInfo, event: React.MouseEvent) => void;
|
|
6
6
|
showTooltip?: boolean | showToolTipProps;
|
|
7
7
|
compact?: boolean;
|
|
8
|
-
separator?:
|
|
8
|
+
separator?: React.ReactNode;
|
|
9
9
|
}
|
|
10
10
|
declare const BreadContext: React.Context<BreadContextType>;
|
|
11
11
|
export default BreadContext;
|
|
@@ -4,7 +4,7 @@ export declare type CardGroupType = 'grid';
|
|
|
4
4
|
export interface CardGroupProps {
|
|
5
5
|
/** Card group style class name */
|
|
6
6
|
className?: string;
|
|
7
|
-
children?: React.ReactNode
|
|
7
|
+
children?: React.ReactNode;
|
|
8
8
|
/** Card Spacing */
|
|
9
9
|
spacing?: number | number[];
|
|
10
10
|
/** Card group inline style */
|
package/lib/cjs/card/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export interface CardProps {
|
|
|
14
14
|
bordered?: boolean;
|
|
15
15
|
/** Style class name */
|
|
16
16
|
className?: string;
|
|
17
|
-
children?: React.ReactNode
|
|
17
|
+
children?: React.ReactNode;
|
|
18
18
|
/** Cover */
|
|
19
19
|
cover?: ReactNode;
|
|
20
20
|
/** Additional additions to the right of the title */
|
|
@@ -33,7 +33,7 @@ export interface CascaderProps extends BasicCascaderProps {
|
|
|
33
33
|
motion?: Motion;
|
|
34
34
|
treeData?: Array<CascaderData>;
|
|
35
35
|
restTagsPopoverProps?: PopoverProps;
|
|
36
|
-
children?: React.ReactNode
|
|
36
|
+
children?: React.ReactNode;
|
|
37
37
|
value?: Value;
|
|
38
38
|
prefix?: ReactNode;
|
|
39
39
|
suffix?: ReactNode;
|
|
@@ -22,9 +22,13 @@ export interface CheckboxProps extends BaseCheckboxProps {
|
|
|
22
22
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
23
23
|
role?: React.HTMLAttributes<HTMLSpanElement>['role'];
|
|
24
24
|
tabIndex?: number;
|
|
25
|
+
addonId?: string;
|
|
26
|
+
extraId?: string;
|
|
25
27
|
}
|
|
26
28
|
interface CheckboxState {
|
|
27
29
|
checked: boolean;
|
|
30
|
+
addonId?: string;
|
|
31
|
+
extraId?: string;
|
|
28
32
|
}
|
|
29
33
|
declare class Checkbox extends BaseComponent<CheckboxProps, CheckboxState> {
|
|
30
34
|
static contextType: React.Context<CheckboxContextType>;
|
|
@@ -51,15 +51,11 @@ class Checkbox extends _baseComponent.default {
|
|
|
51
51
|
|
|
52
52
|
const checked = false;
|
|
53
53
|
this.state = {
|
|
54
|
-
checked: props.checked || props.defaultChecked || checked
|
|
54
|
+
checked: props.checked || props.defaultChecked || checked,
|
|
55
|
+
addonId: props.addonId,
|
|
56
|
+
extraId: props.extraId
|
|
55
57
|
};
|
|
56
58
|
this.checkboxEntity = null;
|
|
57
|
-
this.addonId = (0, _uuid.getUuidShort)({
|
|
58
|
-
prefix: 'addon'
|
|
59
|
-
});
|
|
60
|
-
this.extraId = (0, _uuid.getUuidShort)({
|
|
61
|
-
prefix: 'extra'
|
|
62
|
-
});
|
|
63
59
|
this.foundation = new _checkboxFoundation.default(this.adapter);
|
|
64
60
|
}
|
|
65
61
|
|
|
@@ -81,7 +77,21 @@ class Checkbox extends _baseComponent.default {
|
|
|
81
77
|
notifyGroupChange: cbContent => {
|
|
82
78
|
this.context.checkboxGroup.onChange(cbContent);
|
|
83
79
|
},
|
|
84
|
-
getGroupDisabled: () => this.context && this.context.checkboxGroup.disabled
|
|
80
|
+
getGroupDisabled: () => this.context && this.context.checkboxGroup.disabled,
|
|
81
|
+
setAddonId: () => {
|
|
82
|
+
this.setState({
|
|
83
|
+
addonId: (0, _uuid.getUuidShort)({
|
|
84
|
+
prefix: 'addon'
|
|
85
|
+
})
|
|
86
|
+
});
|
|
87
|
+
},
|
|
88
|
+
setExtraId: () => {
|
|
89
|
+
this.setState({
|
|
90
|
+
extraId: (0, _uuid.getUuidShort)({
|
|
91
|
+
prefix: 'extra'
|
|
92
|
+
})
|
|
93
|
+
});
|
|
94
|
+
}
|
|
85
95
|
});
|
|
86
96
|
}
|
|
87
97
|
|
|
@@ -124,7 +134,9 @@ class Checkbox extends _baseComponent.default {
|
|
|
124
134
|
id
|
|
125
135
|
} = this.props;
|
|
126
136
|
const {
|
|
127
|
-
checked
|
|
137
|
+
checked,
|
|
138
|
+
addonId,
|
|
139
|
+
extraId
|
|
128
140
|
} = this.state;
|
|
129
141
|
const props = {
|
|
130
142
|
checked,
|
|
@@ -171,10 +183,10 @@ class Checkbox extends _baseComponent.default {
|
|
|
171
183
|
});
|
|
172
184
|
|
|
173
185
|
const renderContent = () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children ? /*#__PURE__*/_react.default.createElement("span", {
|
|
174
|
-
id:
|
|
186
|
+
id: addonId,
|
|
175
187
|
className: "".concat(prefix, "-addon")
|
|
176
188
|
}, children) : null, extra ? /*#__PURE__*/_react.default.createElement("div", {
|
|
177
|
-
id:
|
|
189
|
+
id: extraId,
|
|
178
190
|
className: extraCls
|
|
179
191
|
}, extra) : null);
|
|
180
192
|
|
|
@@ -9,7 +9,7 @@ export { CollapsePanelProps } from './item';
|
|
|
9
9
|
export interface CollapseReactProps extends CollapseProps {
|
|
10
10
|
expandIcon?: React.ReactNode;
|
|
11
11
|
collapseIcon?: React.ReactNode;
|
|
12
|
-
children?: React.ReactNode
|
|
12
|
+
children?: React.ReactNode;
|
|
13
13
|
style?: CSSProperties;
|
|
14
14
|
onChange?: (activeKey: CollapseProps['activeKey'], e: React.MouseEvent) => void;
|
|
15
15
|
}
|
|
@@ -43,6 +43,7 @@ export default class DateInput extends BaseComponent<DateInputProps, {}> {
|
|
|
43
43
|
rangeSeparator: PropTypes.Requireable<string>;
|
|
44
44
|
insetInput: PropTypes.Requireable<boolean>;
|
|
45
45
|
insetInputValue: PropTypes.Requireable<object>;
|
|
46
|
+
defaultPickerValue: PropTypes.Requireable<string | number | object>;
|
|
46
47
|
};
|
|
47
48
|
static defaultProps: {
|
|
48
49
|
showClear: boolean;
|
|
@@ -396,9 +396,10 @@ class DateInput extends _baseComponent.default {
|
|
|
396
396
|
rangeInputFocus,
|
|
397
397
|
rangeSeparator,
|
|
398
398
|
insetInput,
|
|
399
|
-
insetInputValue
|
|
399
|
+
insetInputValue,
|
|
400
|
+
defaultPickerValue
|
|
400
401
|
} = _a,
|
|
401
|
-
rest = __rest(_a, ["placeholder", "type", "value", "inputValue", "inputStyle", "disabled", "showClear", "inputReadOnly", "insetLabel", "validateStatus", "block", "prefixCls", "multiple", "dateFnsLocale", "onBlur", "onClear", "onFocus", "prefix", "autofocus", "size", "rangeInputStartRef", "rangeInputEndRef", "onRangeClear", "onRangeBlur", "onRangeEndTabPress", "rangeInputFocus", "rangeSeparator", "insetInput", "insetInputValue"]);
|
|
402
|
+
rest = __rest(_a, ["placeholder", "type", "value", "inputValue", "inputStyle", "disabled", "showClear", "inputReadOnly", "insetLabel", "validateStatus", "block", "prefixCls", "multiple", "dateFnsLocale", "onBlur", "onClear", "onFocus", "prefix", "autofocus", "size", "rangeInputStartRef", "rangeInputEndRef", "onRangeClear", "onRangeBlur", "onRangeEndTabPress", "rangeInputFocus", "rangeSeparator", "insetInput", "insetInputValue", "defaultPickerValue"]);
|
|
402
403
|
|
|
403
404
|
const dateIcon = /*#__PURE__*/_react.default.createElement(_semiIcons.IconCalendar, {
|
|
404
405
|
"aria-hidden": true
|
|
@@ -484,7 +485,8 @@ DateInput.propTypes = {
|
|
|
484
485
|
rangeInputEndRef: _propTypes.default.object,
|
|
485
486
|
rangeSeparator: _propTypes.default.string,
|
|
486
487
|
insetInput: _propTypes.default.bool,
|
|
487
|
-
insetInputValue: _propTypes.default.object
|
|
488
|
+
insetInputValue: _propTypes.default.object,
|
|
489
|
+
defaultPickerValue: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.object, _propTypes.default.array])
|
|
488
490
|
};
|
|
489
491
|
DateInput.defaultProps = {
|
|
490
492
|
showClear: true,
|
|
@@ -189,7 +189,8 @@ class DatePicker extends _baseComponent.default {
|
|
|
189
189
|
insetInput,
|
|
190
190
|
type,
|
|
191
191
|
format,
|
|
192
|
-
rangeSeparator
|
|
192
|
+
rangeSeparator,
|
|
193
|
+
defaultPickerValue
|
|
193
194
|
} = this.props;
|
|
194
195
|
const {
|
|
195
196
|
insetInputValue,
|
|
@@ -211,7 +212,8 @@ class DatePicker extends _baseComponent.default {
|
|
|
211
212
|
onInsetInputChange: this.handleInsetInputChange,
|
|
212
213
|
rangeInputStartRef: this.rangeInputStartRef,
|
|
213
214
|
rangeInputEndRef: this.rangeInputEndRef,
|
|
214
|
-
density
|
|
215
|
+
density,
|
|
216
|
+
defaultPickerValue
|
|
215
217
|
};
|
|
216
218
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
217
219
|
ref: this.panelRef,
|
|
@@ -576,18 +578,11 @@ class DatePicker extends _baseComponent.default {
|
|
|
576
578
|
insetInput
|
|
577
579
|
} = this.props;
|
|
578
580
|
const {
|
|
579
|
-
value,
|
|
580
581
|
cachedSelectedValue,
|
|
581
582
|
motionEnd,
|
|
582
583
|
rangeInputFocus
|
|
583
|
-
} = this.state;
|
|
584
|
-
|
|
585
|
-
let defaultValue = value;
|
|
586
|
-
|
|
587
|
-
if (this.adapter.needConfirm()) {
|
|
588
|
-
defaultValue = cachedSelectedValue;
|
|
589
|
-
}
|
|
590
|
-
|
|
584
|
+
} = this.state;
|
|
585
|
+
const defaultValue = cachedSelectedValue;
|
|
591
586
|
return /*#__PURE__*/_react.default.createElement(_monthsGrid.default, {
|
|
592
587
|
ref: this.monthGrid,
|
|
593
588
|
locale: locale,
|
|
@@ -659,7 +654,8 @@ class DatePicker extends _baseComponent.default {
|
|
|
659
654
|
size,
|
|
660
655
|
inputReadOnly,
|
|
661
656
|
rangeSeparator,
|
|
662
|
-
insetInput
|
|
657
|
+
insetInput,
|
|
658
|
+
defaultPickerValue
|
|
663
659
|
} = this.props;
|
|
664
660
|
const {
|
|
665
661
|
value,
|
|
@@ -685,6 +681,7 @@ class DatePicker extends _baseComponent.default {
|
|
|
685
681
|
disabled: inputDisabled,
|
|
686
682
|
inputValue,
|
|
687
683
|
value: value,
|
|
684
|
+
defaultPickerValue,
|
|
688
685
|
onChange: this.handleInputChange,
|
|
689
686
|
onEnterPress: this.handleInputComplete,
|
|
690
687
|
// TODO: remove in next major version
|
|
@@ -263,7 +263,8 @@ class MonthsGrid extends _baseComponent.default {
|
|
|
263
263
|
} = this.props;
|
|
264
264
|
|
|
265
265
|
if (prevProps.defaultValue !== defaultValue) {
|
|
266
|
-
|
|
266
|
+
// we should always update panel state when value changes
|
|
267
|
+
this.foundation.updateSelectedFromProps(defaultValue);
|
|
267
268
|
}
|
|
268
269
|
|
|
269
270
|
if (prevProps.defaultPickerValue !== defaultPickerValue) {
|
|
@@ -5,7 +5,7 @@ import { DescriptionsContextValue } from './descriptions-context';
|
|
|
5
5
|
export interface DescriptionsItemProps {
|
|
6
6
|
hidden?: boolean;
|
|
7
7
|
className?: string;
|
|
8
|
-
children?: React.ReactNode |
|
|
8
|
+
children?: React.ReactNode | (() => React.ReactNode);
|
|
9
9
|
style?: React.CSSProperties;
|
|
10
10
|
itemKey?: React.ReactNode;
|
|
11
11
|
}
|
package/lib/cjs/empty/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
export declare type ReactFieldError =
|
|
3
|
+
export declare type ReactFieldError = Array<any> | React.ReactNode;
|
|
4
4
|
export interface ErrorMessageProps {
|
|
5
5
|
error?: ReactFieldError;
|
|
6
6
|
className?: string;
|
|
@@ -15,7 +15,7 @@ export declare type CommonFieldProps = {
|
|
|
15
15
|
/** Field is required (except Form. Checkbox within the Group, Form. Radio) */
|
|
16
16
|
field: string;
|
|
17
17
|
/** The label text of the form control is the same name as the field by default when it is not passed */
|
|
18
|
-
label?:
|
|
18
|
+
label?: LabelProps | React.ReactNode;
|
|
19
19
|
labelPosition?: 'top' | 'left' | 'inset';
|
|
20
20
|
labelAlign?: 'left' | 'right';
|
|
21
21
|
labelWidth?: number | string;
|
package/lib/cjs/form/label.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface LabelProps {
|
|
|
15
15
|
width?: number | string;
|
|
16
16
|
style?: React.CSSProperties;
|
|
17
17
|
className?: string;
|
|
18
|
-
children?: React.ReactNode
|
|
18
|
+
children?: React.ReactNode;
|
|
19
19
|
extra?: React.ReactNode;
|
|
20
20
|
}
|
|
21
21
|
export default class Label extends PureComponent<LabelProps> {
|
|
@@ -3,8 +3,8 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
export interface SectionProps {
|
|
4
4
|
className?: string;
|
|
5
5
|
style?: React.CSSProperties;
|
|
6
|
-
text?: React.ReactNode
|
|
7
|
-
children?: React.ReactNode
|
|
6
|
+
text?: React.ReactNode;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
8
|
}
|
|
9
9
|
export default class Section extends PureComponent<SectionProps> {
|
|
10
10
|
static propTypes: {
|
package/lib/cjs/form/slot.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { ErrorMessageProps } from './errorMessage';
|
|
|
4
4
|
export interface SlotProps {
|
|
5
5
|
className?: string;
|
|
6
6
|
style?: React.CSSProperties;
|
|
7
|
-
label?: LabelProps | React.ReactNode
|
|
7
|
+
label?: LabelProps | React.ReactNode;
|
|
8
8
|
noLabel?: boolean;
|
|
9
9
|
labelPosition?: 'top' | 'left';
|
|
10
10
|
error?: ErrorMessageProps;
|
|
@@ -13,7 +13,7 @@ export interface SiderProps {
|
|
|
13
13
|
prefixCls?: string;
|
|
14
14
|
style?: CSSProperties;
|
|
15
15
|
className?: string;
|
|
16
|
-
children?: React.ReactNode
|
|
16
|
+
children?: React.ReactNode;
|
|
17
17
|
breakpoint?: Array<keyof ResponsiveMap>;
|
|
18
18
|
onBreakpoint?: (screen: keyof ResponsiveMap, match: boolean) => void;
|
|
19
19
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
package/lib/cjs/list/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { ListItemProps } from './item';
|
|
|
8
8
|
export interface ListProps<T> {
|
|
9
9
|
style?: React.CSSProperties;
|
|
10
10
|
className?: string;
|
|
11
|
-
children?: React.ReactNode
|
|
11
|
+
children?: React.ReactNode;
|
|
12
12
|
bordered?: boolean;
|
|
13
13
|
footer?: React.ReactNode;
|
|
14
14
|
header?: React.ReactNode;
|
package/lib/cjs/list/item.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface ListItemProps {
|
|
|
7
7
|
main?: React.ReactNode;
|
|
8
8
|
align?: 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';
|
|
9
9
|
className?: string;
|
|
10
|
-
children?: React.ReactNode
|
|
10
|
+
children?: React.ReactNode;
|
|
11
11
|
style?: React.CSSProperties;
|
|
12
12
|
onClick?: React.MouseEventHandler<HTMLLIElement>;
|
|
13
13
|
onRightClick?: React.MouseEventHandler<HTMLLIElement>;
|
package/lib/cjs/modal/Modal.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare type ConfirmType = 'leftTop' | 'leftBottom' | 'rightTop' | 'right
|
|
|
10
10
|
export declare type Directions = 'ltr' | 'rtl';
|
|
11
11
|
export interface ModalReactProps extends ModalProps {
|
|
12
12
|
cancelButtonProps?: ButtonProps;
|
|
13
|
-
children?: React.ReactNode
|
|
13
|
+
children?: React.ReactNode;
|
|
14
14
|
okButtonProps?: ButtonProps;
|
|
15
15
|
bodyStyle?: CSSProperties;
|
|
16
16
|
maskStyle?: CSSProperties;
|
|
@@ -102,19 +102,19 @@ declare class Modal extends BaseComponent<ModalReactProps, ModalState> {
|
|
|
102
102
|
static getScrollbarWidth(): number;
|
|
103
103
|
static info: (props: ModalReactProps) => {
|
|
104
104
|
destroy: () => void;
|
|
105
|
-
update: (newConfig:
|
|
105
|
+
update: (newConfig: ModalReactProps) => void;
|
|
106
106
|
};
|
|
107
107
|
static success: (props: ModalReactProps) => {
|
|
108
108
|
destroy: () => void;
|
|
109
|
-
update: (newConfig:
|
|
109
|
+
update: (newConfig: ModalReactProps) => void;
|
|
110
110
|
};
|
|
111
111
|
static error: (props: ModalReactProps) => {
|
|
112
112
|
destroy: () => void;
|
|
113
|
-
update: (newConfig:
|
|
113
|
+
update: (newConfig: ModalReactProps) => void;
|
|
114
114
|
};
|
|
115
115
|
static warning: (props: ModalReactProps) => {
|
|
116
116
|
destroy: () => void;
|
|
117
|
-
update: (newConfig:
|
|
117
|
+
update: (newConfig: ModalReactProps) => void;
|
|
118
118
|
};
|
|
119
119
|
static confirm: (props: ModalReactProps) => {
|
|
120
120
|
destroy: () => void;
|
|
@@ -4,7 +4,7 @@ import { ContextValue } from '../configProvider/context';
|
|
|
4
4
|
import BaseComponent from '../_base/baseComponent';
|
|
5
5
|
import ModalContentFoundation, { ModalContentAdapter, ModalContentProps, ModalContentState } from '@douyinfe/semi-foundation/lib/cjs/modal/modalContentFoundation';
|
|
6
6
|
export interface ModalContentReactProps extends ModalContentProps {
|
|
7
|
-
children?: React.ReactNode
|
|
7
|
+
children?: React.ReactNode;
|
|
8
8
|
}
|
|
9
9
|
export default class ModalContent extends BaseComponent<ModalContentReactProps, ModalContentState> {
|
|
10
10
|
static contextType: React.Context<ContextValue>;
|
|
@@ -4,9 +4,11 @@ import '@douyinfe/semi-foundation/lib/cjs/modal/modal.css';
|
|
|
4
4
|
export interface ConfirmProps extends ModalReactProps {
|
|
5
5
|
type: 'success' | 'info' | 'warning' | 'error' | 'confirm';
|
|
6
6
|
}
|
|
7
|
-
export default function confirm(props: ConfirmProps): {
|
|
7
|
+
export default function confirm<T>(props: ConfirmProps): {
|
|
8
8
|
destroy: () => void;
|
|
9
|
-
update: (newConfig:
|
|
9
|
+
update: (newConfig: T extends {
|
|
10
|
+
type: Exclude<ConfirmProps['type'], 'confirm'>;
|
|
11
|
+
} ? ModalReactProps : ConfirmProps) => void;
|
|
10
12
|
};
|
|
11
13
|
export declare function withInfo(props: ModalReactProps): {
|
|
12
14
|
cancelButtonProps?: import("../button").BaseButtonProps;
|
|
@@ -1,25 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { ConfirmProps } from '../confirm';
|
|
3
3
|
import { ModalReactProps } from '../Modal';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
update: (newConfig: ConfirmProps) => void;
|
|
20
|
-
};
|
|
21
|
-
confirm: (config: ModalReactProps) => {
|
|
22
|
-
destroy: () => void;
|
|
23
|
-
update: (newConfig: ConfirmProps) => void;
|
|
24
|
-
};
|
|
25
|
-
})[];
|
|
4
|
+
declare type UseModalReturnHooksType = (config: ModalReactProps) => {
|
|
5
|
+
destroy: () => void;
|
|
6
|
+
update: (newConfig: ConfirmProps) => void;
|
|
7
|
+
};
|
|
8
|
+
export default function useModal(): [
|
|
9
|
+
{
|
|
10
|
+
info: UseModalReturnHooksType;
|
|
11
|
+
success: UseModalReturnHooksType;
|
|
12
|
+
error: UseModalReturnHooksType;
|
|
13
|
+
warning: UseModalReturnHooksType;
|
|
14
|
+
confirm: UseModalReturnHooksType;
|
|
15
|
+
},
|
|
16
|
+
ReactNode
|
|
17
|
+
];
|
|
18
|
+
export {};
|
|
@@ -4,7 +4,7 @@ import '@douyinfe/semi-foundation/lib/cjs/navigation/navigation.css';
|
|
|
4
4
|
import { NavContextType } from './nav-context';
|
|
5
5
|
import { BaseProps } from '../_base/baseComponent';
|
|
6
6
|
export interface NavFooterProps extends BaseProps {
|
|
7
|
-
collapseButton?: React.ReactNode
|
|
7
|
+
collapseButton?: React.ReactNode;
|
|
8
8
|
collapseText?: (collapsed?: boolean) => React.ReactNode;
|
|
9
9
|
}
|
|
10
10
|
export default class NavFooter extends PureComponent<NavFooterProps> {
|
package/lib/cjs/radio/radio.d.ts
CHANGED
|
@@ -29,9 +29,13 @@ export declare type RadioProps = {
|
|
|
29
29
|
addonClassName?: string;
|
|
30
30
|
type?: RadioType;
|
|
31
31
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
32
|
+
addonId?: string;
|
|
33
|
+
extraId?: string;
|
|
32
34
|
};
|
|
33
35
|
export interface RadioState {
|
|
34
36
|
hover?: boolean;
|
|
37
|
+
addonId?: string;
|
|
38
|
+
extraId?: string;
|
|
35
39
|
}
|
|
36
40
|
export { RadioChangeEvent };
|
|
37
41
|
declare class Radio extends BaseComponent<RadioProps, RadioState> {
|