@douyinfe/semi-ui 2.20.0-beta.1 → 2.20.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/css/semi.css +11 -0
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +88 -127
- 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/lib/cjs/anchor/index.d.ts +1 -1
- package/lib/cjs/backtop/index.js +4 -1
- package/lib/cjs/breadcrumb/index.d.ts +1 -1
- package/lib/cjs/breadcrumb/item.d.ts +1 -1
- package/lib/cjs/button/buttonGroup.js +3 -1
- package/lib/cjs/button/index.d.ts +4 -4
- package/lib/cjs/calendar/index.d.ts +1 -1
- package/lib/cjs/calendar/interface.d.ts +3 -3
- package/lib/cjs/card/index.d.ts +2 -2
- package/lib/cjs/cascader/index.d.ts +2 -2
- package/lib/cjs/checkbox/index.d.ts +3 -2
- package/lib/cjs/collapse/index.d.ts +2 -2
- package/lib/cjs/datePicker/index.d.ts +7 -7
- package/lib/cjs/descriptions/index.d.ts +1 -1
- package/lib/cjs/dropdown/dropdownItem.d.ts +3 -2
- package/lib/cjs/dropdown/index.d.ts +4 -4
- package/lib/cjs/form/arrayField.d.ts +1 -1
- package/lib/cjs/form/group.js +47 -6
- package/lib/cjs/form/index.d.ts +6 -6
- package/lib/cjs/grid/index.d.ts +2 -2
- package/lib/cjs/icons/index.d.ts +1 -1
- package/lib/cjs/input/index.d.ts +2 -2
- package/lib/cjs/layout/index.d.ts +1 -1
- package/lib/cjs/list/index.d.ts +1 -1
- package/lib/cjs/modal/Modal.d.ts +1 -1
- package/lib/cjs/modal/index.d.ts +2 -2
- package/lib/cjs/navigation/index.d.ts +7 -7
- package/lib/cjs/notification/index.d.ts +2 -2
- package/lib/cjs/overflowList/index.d.ts +1 -1
- package/lib/cjs/pagination/index.d.ts +1 -1
- package/lib/cjs/popover/index.d.ts +2 -1
- package/lib/cjs/radio/index.d.ts +3 -3
- package/lib/cjs/radio/radio.d.ts +1 -1
- package/lib/cjs/rating/index.d.ts +1 -1
- package/lib/cjs/scrollList/index.d.ts +1 -1
- package/lib/cjs/select/index.d.ts +3 -3
- package/lib/cjs/sideSheet/index.d.ts +3 -3
- package/lib/cjs/skeleton/index.d.ts +1 -1
- package/lib/cjs/slider/index.d.ts +1 -1
- package/lib/cjs/steps/index.d.ts +7 -7
- package/lib/cjs/table/Table.js +1 -1
- package/lib/cjs/timePicker/index.d.ts +5 -5
- package/lib/cjs/timeline/index.d.ts +1 -1
- package/lib/cjs/toast/index.d.ts +2 -2
- package/lib/cjs/tooltip/index.d.ts +2 -2
- package/lib/cjs/tree/index.d.ts +1 -1
- package/lib/cjs/tree/index.js +13 -1
- package/lib/cjs/typography/index.d.ts +5 -5
- package/lib/cjs/upload/index.d.ts +4 -2
- package/lib/es/anchor/index.d.ts +1 -1
- package/lib/es/backtop/index.js +4 -1
- package/lib/es/breadcrumb/index.d.ts +1 -1
- package/lib/es/breadcrumb/item.d.ts +1 -1
- package/lib/es/button/buttonGroup.js +3 -1
- package/lib/es/button/index.d.ts +4 -4
- package/lib/es/calendar/index.d.ts +1 -1
- package/lib/es/calendar/interface.d.ts +3 -3
- package/lib/es/card/index.d.ts +2 -2
- package/lib/es/cascader/index.d.ts +2 -2
- package/lib/es/checkbox/index.d.ts +3 -2
- package/lib/es/collapse/index.d.ts +2 -2
- package/lib/es/datePicker/index.d.ts +7 -7
- package/lib/es/descriptions/index.d.ts +1 -1
- package/lib/es/dropdown/dropdownItem.d.ts +3 -2
- package/lib/es/dropdown/index.d.ts +4 -4
- package/lib/es/form/arrayField.d.ts +1 -1
- package/lib/es/form/group.js +43 -6
- package/lib/es/form/index.d.ts +6 -6
- package/lib/es/grid/index.d.ts +2 -2
- package/lib/es/icons/index.d.ts +1 -1
- package/lib/es/input/index.d.ts +2 -2
- package/lib/es/layout/index.d.ts +1 -1
- package/lib/es/list/index.d.ts +1 -1
- package/lib/es/modal/Modal.d.ts +1 -1
- package/lib/es/modal/index.d.ts +2 -2
- package/lib/es/navigation/index.d.ts +7 -7
- package/lib/es/notification/index.d.ts +2 -2
- package/lib/es/overflowList/index.d.ts +1 -1
- package/lib/es/pagination/index.d.ts +1 -1
- package/lib/es/popover/index.d.ts +2 -1
- package/lib/es/radio/index.d.ts +3 -3
- package/lib/es/radio/radio.d.ts +1 -1
- package/lib/es/rating/index.d.ts +1 -1
- package/lib/es/scrollList/index.d.ts +1 -1
- package/lib/es/select/index.d.ts +3 -3
- package/lib/es/sideSheet/index.d.ts +3 -3
- package/lib/es/skeleton/index.d.ts +1 -1
- package/lib/es/slider/index.d.ts +1 -1
- package/lib/es/steps/index.d.ts +7 -7
- package/lib/es/table/Table.js +1 -1
- package/lib/es/timePicker/index.d.ts +5 -5
- package/lib/es/timeline/index.d.ts +1 -1
- package/lib/es/toast/index.d.ts +2 -2
- package/lib/es/tooltip/index.d.ts +2 -2
- package/lib/es/tree/index.d.ts +1 -1
- package/lib/es/tree/index.js +13 -1
- package/lib/es/typography/index.d.ts +5 -5
- package/lib/es/upload/index.d.ts +4 -2
- package/package.json +7 -7
|
@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import '@douyinfe/semi-foundation/lib/cjs/timeline/timeline.css';
|
|
4
4
|
import Item, { TimelineItemProps } from './item';
|
|
5
|
-
export { TimelineItemProps } from './item';
|
|
5
|
+
export type { TimelineItemProps } from './item';
|
|
6
6
|
export interface Data extends TimelineItemProps {
|
|
7
7
|
content: React.ReactNode;
|
|
8
8
|
}
|
package/lib/cjs/toast/index.d.ts
CHANGED
|
@@ -5,14 +5,14 @@ import '@douyinfe/semi-foundation/lib/cjs/toast/toast.css';
|
|
|
5
5
|
import useToast from './useToast';
|
|
6
6
|
import { ConfigProps, ToastInstance, ToastProps, ToastState } from '@douyinfe/semi-foundation/lib/cjs/toast/toastFoundation';
|
|
7
7
|
import { Motion } from '../_base/base';
|
|
8
|
-
export { ToastTransitionProps } from './ToastTransition';
|
|
8
|
+
export type { ToastTransitionProps } from './ToastTransition';
|
|
9
9
|
export interface ToastReactProps extends ToastProps {
|
|
10
10
|
id?: string;
|
|
11
11
|
style?: CSSProperties;
|
|
12
12
|
icon?: React.ReactNode;
|
|
13
13
|
content: React.ReactNode;
|
|
14
14
|
}
|
|
15
|
-
export { ConfigProps, ToastListProps, ToastListState, ToastState };
|
|
15
|
+
export type { ConfigProps, ToastListProps, ToastListState, ToastState };
|
|
16
16
|
declare const createBaseToast: () => {
|
|
17
17
|
new (props: ToastListProps): {
|
|
18
18
|
readonly adapter: ToastListAdapter;
|
|
@@ -8,8 +8,9 @@ import '@douyinfe/semi-foundation/lib/cjs/tooltip/tooltip.css';
|
|
|
8
8
|
import BaseComponent, { BaseProps } from '../_base/baseComponent';
|
|
9
9
|
import { ContextValue } from '../configProvider/context';
|
|
10
10
|
import { Motion } from '../_base/base';
|
|
11
|
-
export { TooltipTransitionProps } from './TooltipStyledTransition';
|
|
11
|
+
export type { TooltipTransitionProps } from './TooltipStyledTransition';
|
|
12
12
|
export declare type Trigger = ArrayElement<typeof strings.TRIGGER_SET>;
|
|
13
|
+
export type { Position };
|
|
13
14
|
export interface ArrowBounding {
|
|
14
15
|
offsetX?: number;
|
|
15
16
|
offsetY?: number;
|
|
@@ -179,4 +180,3 @@ export default class Tooltip extends BaseComponent<TooltipProps, TooltipState> {
|
|
|
179
180
|
mergeEvents: (rawEvents: Record<string, any>, events: Record<string, any>) => {};
|
|
180
181
|
render(): JSX.Element;
|
|
181
182
|
}
|
|
182
|
-
export { Position };
|
package/lib/cjs/tree/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import TreeNode from './treeNode';
|
|
|
8
8
|
import '@douyinfe/semi-foundation/lib/cjs/tree/tree.css';
|
|
9
9
|
import { TreeProps, TreeState, TreeNodeProps, TreeNodeData, FlattenNode, KeyEntity, ScrollData } from './interface';
|
|
10
10
|
export * from './interface';
|
|
11
|
-
export { AutoSizerProps } from './autoSizer';
|
|
11
|
+
export type { AutoSizerProps } from './autoSizer';
|
|
12
12
|
declare class Tree extends BaseComponent<TreeProps, TreeState> {
|
|
13
13
|
static contextType: React.Context<ContextValue>;
|
|
14
14
|
static propTypes: {
|
package/lib/cjs/tree/index.js
CHANGED
|
@@ -268,6 +268,8 @@ class Tree extends _baseComponent.default {
|
|
|
268
268
|
|
|
269
269
|
|
|
270
270
|
static getDerivedStateFromProps(props, prevState) {
|
|
271
|
+
var _a;
|
|
272
|
+
|
|
271
273
|
const {
|
|
272
274
|
prevProps
|
|
273
275
|
} = prevState;
|
|
@@ -349,8 +351,18 @@ class Tree extends _baseComponent.default {
|
|
|
349
351
|
newState.expandedKeys = (0, _treeUtil.calcExpandedKeys)(props.defaultExpandedKeys, keyEntities);
|
|
350
352
|
} else if (!prevProps && props.defaultValue) {
|
|
351
353
|
newState.expandedKeys = (0, _treeUtil.calcExpandedKeysForValues)(props.defaultValue, keyEntities, props.multiple, valueEntities);
|
|
352
|
-
} else if (
|
|
354
|
+
} else if (!prevProps && props.value) {
|
|
353
355
|
newState.expandedKeys = (0, _treeUtil.calcExpandedKeysForValues)(props.value, keyEntities, props.multiple, valueEntities);
|
|
356
|
+
} else if (!isExpandControlled && dataUpdated && props.value) {
|
|
357
|
+
// 当 treeData 已经设置具体的值,并且设置了 props.loadData ,则认为 treeData 的更新是因为 loadData 导致的
|
|
358
|
+
// 如果是因为 loadData 导致 treeData改变, 此时在这里重新计算 key 会导致为未选中的展开项目被收起
|
|
359
|
+
// 所以此时不需要重新计算 expandedKeys,因为在点击展开按钮时候已经把被展开的项添加到 expandedKeys 中
|
|
360
|
+
// When treeData has a specific value and props.loadData is set, it is considered that the update of treeData is caused by loadData
|
|
361
|
+
// If the treeData is changed because of loadData, recalculating the key here will cause the unselected expanded items to be collapsed
|
|
362
|
+
// So there is no need to recalculate expandedKeys at this time, because the expanded item has been added to expandedKeys when the expand button is clicked
|
|
363
|
+
if (!(prevState.treeData && ((_a = prevState.treeData) === null || _a === void 0 ? void 0 : _a.length) > 0 && props.loadData)) {
|
|
364
|
+
newState.expandedKeys = (0, _treeUtil.calcExpandedKeysForValues)(props.value, keyEntities, props.multiple, valueEntities);
|
|
365
|
+
}
|
|
354
366
|
}
|
|
355
367
|
|
|
356
368
|
if (!newState.expandedKeys) {
|
|
@@ -8,10 +8,10 @@ export declare type TypographyType = typeof BaseTypography & {
|
|
|
8
8
|
Paragraph: typeof Paragraph;
|
|
9
9
|
};
|
|
10
10
|
declare const Typography: TypographyType;
|
|
11
|
-
export { BaseTypographyProps } from './base';
|
|
12
|
-
export { CopyableProps } from './copyable';
|
|
13
|
-
export { TitleProps } from './title';
|
|
14
|
-
export { TextProps } from './text';
|
|
15
|
-
export { ParagraphProps } from './paragraph';
|
|
11
|
+
export type { BaseTypographyProps } from './base';
|
|
12
|
+
export type { CopyableProps } from './copyable';
|
|
13
|
+
export type { TitleProps } from './title';
|
|
14
|
+
export type { TextProps } from './text';
|
|
15
|
+
export type { ParagraphProps } from './paragraph';
|
|
16
16
|
export * from './interface';
|
|
17
17
|
export default Typography;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React, { ReactNode, CSSProperties, RefObject, ChangeEvent, DragEvent } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import UploadFoundation
|
|
3
|
+
import UploadFoundation from '@douyinfe/semi-foundation/lib/cjs/upload/foundation';
|
|
4
4
|
import FileCard from './fileCard';
|
|
5
|
-
import BaseComponent
|
|
5
|
+
import BaseComponent from '../_base/baseComponent';
|
|
6
6
|
import { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError } from './interface';
|
|
7
7
|
import { Locale } from '../locale/interface';
|
|
8
8
|
import '@douyinfe/semi-foundation/lib/cjs/upload/upload.css';
|
|
9
|
+
import type { CustomFile, UploadAdapter, BeforeUploadObjectResult, AfterUploadResult } from '@douyinfe/semi-foundation/lib/cjs/upload/foundation';
|
|
10
|
+
import type { ValidateStatus } from '../_base/baseComponent';
|
|
9
11
|
export { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError, BeforeUploadObjectResult, AfterUploadResult, };
|
|
10
12
|
export interface UploadProps {
|
|
11
13
|
accept?: string;
|
package/lib/es/anchor/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import Link from './link';
|
|
|
7
7
|
import '@douyinfe/semi-foundation/lib/es/anchor/anchor.css';
|
|
8
8
|
import { ArrayElement } from '../_base/base';
|
|
9
9
|
import { ContextValue } from '../configProvider/context';
|
|
10
|
-
export { LinkProps } from './link';
|
|
10
|
+
export type { LinkProps } from './link';
|
|
11
11
|
export interface AnchorProps {
|
|
12
12
|
autoCollapse?: boolean;
|
|
13
13
|
className?: string;
|
package/lib/es/backtop/index.js
CHANGED
|
@@ -91,7 +91,10 @@ export default class BackTop extends BaseComponent {
|
|
|
91
91
|
} = this.state;
|
|
92
92
|
const preCls = cls(prefixCls, className);
|
|
93
93
|
const backtopBtn = children ? children : this.renderDefault();
|
|
94
|
-
const content = visible ?
|
|
94
|
+
const content = visible ?
|
|
95
|
+
/*#__PURE__*/
|
|
96
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
97
|
+
React.createElement("div", Object.assign({}, others, {
|
|
95
98
|
className: preCls,
|
|
96
99
|
style: style,
|
|
97
100
|
onClick: e => this.handleClick(e),
|
|
@@ -7,7 +7,7 @@ import BaseComponent, { BaseProps } from '../_base/baseComponent';
|
|
|
7
7
|
import BreadcrumbItem, { RouteProps, BreadcrumbItemInfo } from './item';
|
|
8
8
|
import { BreadContextType } from './bread-context';
|
|
9
9
|
import { TooltipProps } from '../tooltip';
|
|
10
|
-
export { RouteProps, BreadcrumbItemProps, BreadcrumbItemInfo } from './item';
|
|
10
|
+
export type { RouteProps, BreadcrumbItemProps, BreadcrumbItemInfo } from './item';
|
|
11
11
|
export interface showToolTipProps {
|
|
12
12
|
width?: string | number;
|
|
13
13
|
ellipsisPos?: 'end' | 'middle';
|
|
@@ -4,7 +4,7 @@ import { BreadcrumbItemAdapter, BreadcrumbItemInfo, Route } from '@douyinfe/semi
|
|
|
4
4
|
import BaseComponent, { BaseProps } from '../_base/baseComponent';
|
|
5
5
|
import { noop } from '@douyinfe/semi-foundation/lib/es/utils/function';
|
|
6
6
|
import { BreadContextType } from './bread-context';
|
|
7
|
-
export { BreadcrumbItemInfo };
|
|
7
|
+
export type { BreadcrumbItemInfo };
|
|
8
8
|
export interface RouteProps extends Route {
|
|
9
9
|
icon?: React.ReactNode;
|
|
10
10
|
}
|
|
@@ -64,9 +64,10 @@ export default class ButtonGroup extends BaseComponent {
|
|
|
64
64
|
size,
|
|
65
65
|
type,
|
|
66
66
|
className,
|
|
67
|
+
style,
|
|
67
68
|
'aria-label': ariaLabel
|
|
68
69
|
} = _a,
|
|
69
|
-
rest = __rest(_a, ["children", "disabled", "size", "type", "className", 'aria-label']);
|
|
70
|
+
rest = __rest(_a, ["children", "disabled", "size", "type", "className", "style", 'aria-label']);
|
|
70
71
|
|
|
71
72
|
let inner;
|
|
72
73
|
let innerWithLine = [];
|
|
@@ -85,6 +86,7 @@ export default class ButtonGroup extends BaseComponent {
|
|
|
85
86
|
|
|
86
87
|
return /*#__PURE__*/React.createElement("div", {
|
|
87
88
|
className: cls,
|
|
89
|
+
style: style,
|
|
88
90
|
role: "group",
|
|
89
91
|
"aria-label": ariaLabel
|
|
90
92
|
}, innerWithLine);
|
package/lib/es/button/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IconButtonProps } from '../iconButton';
|
|
3
|
-
export { ButtonProps as BaseButtonProps, HtmlType, Size, Theme, Type } from './Button';
|
|
4
|
-
export { HorizontalPaddingType } from '../iconButton';
|
|
5
|
-
export { ButtonGroupProps } from './buttonGroup';
|
|
6
|
-
export { SplitButtonGroupProps } from './splitButtonGroup';
|
|
3
|
+
export type { ButtonProps as BaseButtonProps, HtmlType, Size, Theme, Type } from './Button';
|
|
4
|
+
export type { HorizontalPaddingType } from '../iconButton';
|
|
5
|
+
export type { ButtonGroupProps } from './buttonGroup';
|
|
6
|
+
export type { SplitButtonGroupProps } from './splitButtonGroup';
|
|
7
7
|
export interface ButtonProps extends IconButtonProps {
|
|
8
8
|
}
|
|
9
9
|
declare class Button extends React.PureComponent<ButtonProps> {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { EventObject, weeekStartsOnEnum } from '@douyinfe/semi-foundation/lib/es/calendar/foundation';
|
|
3
2
|
import { strings } from '@douyinfe/semi-foundation/lib/es/calendar/constants';
|
|
4
|
-
import { ArrayElement } from '../_base/base';
|
|
5
|
-
import { BaseProps } from '../_base/baseComponent';
|
|
3
|
+
import type { ArrayElement } from '../_base/base';
|
|
4
|
+
import type { BaseProps } from '../_base/baseComponent';
|
|
5
|
+
import type { EventObject, weeekStartsOnEnum } from '@douyinfe/semi-foundation/lib/es/calendar/foundation';
|
|
6
6
|
export interface CalendarProps extends BaseProps {
|
|
7
7
|
displayValue?: Date;
|
|
8
8
|
range?: Date[];
|
package/lib/es/card/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import '@douyinfe/semi-foundation/lib/es/card/card.css';
|
|
4
4
|
import Meta from './meta';
|
|
5
5
|
export declare type Shadows = 'hover' | 'always';
|
|
6
|
-
export { MetaProps } from './meta';
|
|
7
|
-
export { CardGroupProps } from './cardGroup';
|
|
6
|
+
export type { MetaProps } from './meta';
|
|
7
|
+
export type { CardGroupProps } from './cardGroup';
|
|
8
8
|
export interface CardProps {
|
|
9
9
|
/** Operation group at the bottom of the card content area */
|
|
10
10
|
actions?: ReactNode[];
|
|
@@ -9,8 +9,8 @@ import { PopoverProps } from '../popover/index';
|
|
|
9
9
|
import { CascaderData, Entities, Entity, Data } from './item';
|
|
10
10
|
import { Motion } from '../_base/base';
|
|
11
11
|
import { Position } from '../tooltip/index';
|
|
12
|
-
export { CascaderType, ShowNextType } from '@douyinfe/semi-foundation/lib/es/cascader/foundation';
|
|
13
|
-
export { CascaderData, Entity, Data, CascaderItemProps } from './item';
|
|
12
|
+
export type { CascaderType, ShowNextType } from '@douyinfe/semi-foundation/lib/es/cascader/foundation';
|
|
13
|
+
export type { CascaderData, Entity, Data, CascaderItemProps } from './item';
|
|
14
14
|
export interface ScrollPanelProps extends BasicScrollPanelProps {
|
|
15
15
|
activeNode: CascaderData;
|
|
16
16
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import Checkbox, { CheckboxProps, CheckboxEvent } from './checkbox';
|
|
2
2
|
import Group, { CheckboxGroupProps, CheckboxType, CheckboxDirection } from './checkboxGroup';
|
|
3
|
-
export { CheckboxInnerProps } from './checkboxInner';
|
|
3
|
+
export type { CheckboxInnerProps } from './checkboxInner';
|
|
4
4
|
declare class CheckboxWithGroup extends Checkbox {
|
|
5
5
|
static Group: typeof Group;
|
|
6
6
|
}
|
|
7
|
-
export { CheckboxWithGroup, Checkbox,
|
|
7
|
+
export { CheckboxWithGroup, Checkbox, };
|
|
8
|
+
export type { CheckboxProps, CheckboxGroupProps, CheckboxEvent, CheckboxType, CheckboxDirection };
|
|
8
9
|
export default CheckboxWithGroup;
|
|
@@ -5,7 +5,7 @@ import BaseComponent from '../_base/baseComponent';
|
|
|
5
5
|
import CollapsePanel from './item';
|
|
6
6
|
import '@douyinfe/semi-foundation/lib/es/collapse/collapse.css';
|
|
7
7
|
import { noop } from '@douyinfe/semi-foundation/lib/es/utils/function';
|
|
8
|
-
export { CollapsePanelProps } from './item';
|
|
8
|
+
export type { CollapsePanelProps } from './item';
|
|
9
9
|
export interface CollapseReactProps extends CollapseProps {
|
|
10
10
|
expandIcon?: React.ReactNode;
|
|
11
11
|
collapseIcon?: React.ReactNode;
|
|
@@ -13,7 +13,7 @@ export interface CollapseReactProps extends CollapseProps {
|
|
|
13
13
|
style?: CSSProperties;
|
|
14
14
|
onChange?: (activeKey: CollapseProps['activeKey'], e: React.MouseEvent) => void;
|
|
15
15
|
}
|
|
16
|
-
export { CollapseState };
|
|
16
|
+
export type { CollapseState };
|
|
17
17
|
declare class Collapse extends BaseComponent<CollapseReactProps, CollapseState> {
|
|
18
18
|
static Panel: typeof CollapsePanel;
|
|
19
19
|
static propTypes: {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import DatePicker, { DatePickerProps } from './datePicker';
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
3
|
+
export type { BaseValueType, DayStatusType, DisabledDateOptions, DisabledDateType, DisabledTimeType, InputSize, Position, PresetType, PresetsType, TriggerRenderProps, ValidateStatus, ValueType, } from '@douyinfe/semi-foundation/lib/es/datePicker/foundation';
|
|
4
|
+
export type { DateInputProps } from './dateInput';
|
|
5
|
+
export type { DatePickerProps } from './datePicker';
|
|
6
|
+
export type { MonthProps } from './month';
|
|
7
|
+
export type { MonthsGridProps } from './monthsGrid';
|
|
8
|
+
export type { QuickControlProps } from './quickControl';
|
|
9
|
+
export type { YearAndMonthProps } from './yearAndMonth';
|
|
9
10
|
declare const _default: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<DatePicker>>;
|
|
10
11
|
export default _default;
|
|
11
|
-
export { BaseValueType, DayStatusType, DisabledDateOptions, DisabledDateType, DisabledTimeType, InputSize, Position, PresetType, PresetsType, TriggerRenderProps, ValidateStatus, ValueType, } from '@douyinfe/semi-foundation/lib/es/datePicker/foundation';
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import '@douyinfe/semi-foundation/lib/es/descriptions/descriptions.css';
|
|
4
4
|
import { DescriptionsAlign, DescriptionsContextValue } from './descriptions-context';
|
|
5
5
|
import Item from './item';
|
|
6
|
-
export { DescriptionsItemProps } from './item';
|
|
6
|
+
export type { DescriptionsItemProps } from './item';
|
|
7
7
|
export declare type DescriptionsSize = 'small' | 'medium' | 'large';
|
|
8
8
|
export interface Data {
|
|
9
9
|
key?: React.ReactNode;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import BaseComponent from '../_base/baseComponent';
|
|
4
|
+
import type { BaseProps } from '../_base/baseComponent';
|
|
5
|
+
import type { DropdownContextType } from './context';
|
|
5
6
|
export declare type Type = 'primary' | 'secondary' | 'tertiary' | 'warning' | 'danger';
|
|
6
7
|
export interface DropdownItemProps extends BaseProps {
|
|
7
8
|
disabled?: boolean;
|
|
@@ -9,10 +9,10 @@ import DropdownTitle, { DropdownTitleProps } from './dropdownTitle';
|
|
|
9
9
|
import { DropdownContextType } from './context';
|
|
10
10
|
import '@douyinfe/semi-foundation/lib/es/dropdown/dropdown.css';
|
|
11
11
|
import { Motion } from '../_base/base';
|
|
12
|
-
export { DropdownDividerProps } from './dropdownDivider';
|
|
13
|
-
export { DropdownItemProps, Type } from './dropdownItem';
|
|
14
|
-
export { DropdownMenuProps } from './dropdownMenu';
|
|
15
|
-
export { DropdownTitleProps } from './dropdownTitle';
|
|
12
|
+
export type { DropdownDividerProps } from './dropdownDivider';
|
|
13
|
+
export type { DropdownItemProps, Type } from './dropdownItem';
|
|
14
|
+
export type { DropdownMenuProps } from './dropdownMenu';
|
|
15
|
+
export type { DropdownTitleProps } from './dropdownTitle';
|
|
16
16
|
export interface DropDownMenuItemItem extends DropdownItemProps {
|
|
17
17
|
node: 'item';
|
|
18
18
|
name?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
import { FormUpdaterContextType } from '@douyinfe/semi-foundation/lib/es/form/interface';
|
|
2
|
+
import type { FormUpdaterContextType } from '@douyinfe/semi-foundation/lib/es/form/interface';
|
|
3
3
|
export interface ArrayFieldProps {
|
|
4
4
|
initValue?: any[];
|
|
5
5
|
field?: string;
|
package/lib/es/form/group.js
CHANGED
|
@@ -23,6 +23,7 @@ import Label from './label';
|
|
|
23
23
|
import { FormUpdaterContext } from './context';
|
|
24
24
|
import { useFormState } from './hooks/index';
|
|
25
25
|
import InputGroup from '../input/inputGroup';
|
|
26
|
+
import { Col } from '../grid/index';
|
|
26
27
|
const prefix = cssClasses.PREFIX; // Group component to remove Labels and ErrorMessages from its child fields
|
|
27
28
|
// Unified insertion of Labels and ErrorMessages from the group level
|
|
28
29
|
// Get Errors of all field in this group
|
|
@@ -72,7 +73,7 @@ class FormInputGroup extends Component {
|
|
|
72
73
|
rest = __rest(_a, ["children", "label"]);
|
|
73
74
|
|
|
74
75
|
const updater = this.context;
|
|
75
|
-
const formProps = updater.getFormProps(['labelPosition', 'labelWidth', 'labelAlign', 'showValidateIcon']);
|
|
76
|
+
const formProps = updater.getFormProps(['labelPosition', 'labelWidth', 'labelAlign', 'showValidateIcon', 'wrapperCol', 'labelCol']);
|
|
76
77
|
const labelPosition = this.props.labelPosition || formProps.labelPosition;
|
|
77
78
|
const groupFieldSet = [];
|
|
78
79
|
const inner = React.Children.map(children, child => {
|
|
@@ -90,14 +91,50 @@ class FormInputGroup extends Component {
|
|
|
90
91
|
const groupCls = classNames({
|
|
91
92
|
["".concat(prefix, "-field-group")]: true
|
|
92
93
|
});
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
const labelCol = formProps.labelCol;
|
|
95
|
+
const wrapperCol = formProps.wrapperCol;
|
|
96
|
+
const labelAlign = formProps.labelAlign;
|
|
97
|
+
const appendCol = labelCol && wrapperCol;
|
|
98
|
+
const labelColCls = labelCol ? "".concat(prefix, "-col-").concat(labelAlign) : '';
|
|
99
|
+
const labelContent = this.renderLabel(label, formProps);
|
|
100
|
+
const inputGroupContent = /*#__PURE__*/React.createElement(InputGroup, Object.assign({}, rest), inner);
|
|
101
|
+
const groupErrorContent = /*#__PURE__*/React.createElement(GroupError, {
|
|
97
102
|
fieldSet: groupFieldSet,
|
|
98
103
|
showValidateIcon: formProps.showValidateIcon,
|
|
99
104
|
isInInputGroup: true
|
|
100
|
-
})
|
|
105
|
+
});
|
|
106
|
+
let content;
|
|
107
|
+
|
|
108
|
+
switch (true) {
|
|
109
|
+
case !appendCol:
|
|
110
|
+
content = /*#__PURE__*/React.createElement(React.Fragment, null, labelContent, /*#__PURE__*/React.createElement("div", null, inputGroupContent, groupErrorContent));
|
|
111
|
+
break;
|
|
112
|
+
|
|
113
|
+
case appendCol && labelPosition === 'top':
|
|
114
|
+
// When labelPosition is top, you need to add an overflow hidden div to the label, otherwise it will be arranged horizontally
|
|
115
|
+
content = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
116
|
+
style: {
|
|
117
|
+
overflow: 'hidden'
|
|
118
|
+
}
|
|
119
|
+
}, /*#__PURE__*/React.createElement(Col, Object.assign({}, labelCol, {
|
|
120
|
+
className: labelColCls
|
|
121
|
+
}), labelContent)), /*#__PURE__*/React.createElement(Col, Object.assign({}, wrapperCol), inputGroupContent, groupErrorContent));
|
|
122
|
+
break;
|
|
123
|
+
|
|
124
|
+
case appendCol && labelPosition !== 'top':
|
|
125
|
+
content = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Col, Object.assign({}, labelCol, {
|
|
126
|
+
className: labelColCls
|
|
127
|
+
}), labelContent), /*#__PURE__*/React.createElement(Col, Object.assign({}, wrapperCol), inputGroupContent, groupErrorContent));
|
|
128
|
+
break;
|
|
129
|
+
|
|
130
|
+
default:
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
135
|
+
"x-label-pos": labelPosition,
|
|
136
|
+
className: groupCls
|
|
137
|
+
}, content);
|
|
101
138
|
}
|
|
102
139
|
|
|
103
140
|
}
|
package/lib/es/form/index.d.ts
CHANGED
|
@@ -13,9 +13,9 @@ import withFormState from './hoc/withFormState';
|
|
|
13
13
|
import withFormApi from './hoc/withFormApi';
|
|
14
14
|
export { Form, ArrayField, withField, useFormApi, useFormState, useFieldApi, useFieldState, withFormState, withFormApi };
|
|
15
15
|
export * from './interface';
|
|
16
|
-
export { ArrayFieldProps } from './arrayField';
|
|
17
|
-
export { ReactFieldError, ErrorMessageProps } from './errorMessage';
|
|
18
|
-
export { InputGroupProps } from './group';
|
|
19
|
-
export { LabelProps } from './label';
|
|
20
|
-
export { SectionProps } from './section';
|
|
21
|
-
export { SlotProps } from './slot';
|
|
16
|
+
export type { ArrayFieldProps } from './arrayField';
|
|
17
|
+
export type { ReactFieldError, ErrorMessageProps } from './errorMessage';
|
|
18
|
+
export type { InputGroupProps } from './group';
|
|
19
|
+
export type { LabelProps } from './label';
|
|
20
|
+
export type { SectionProps } from './section';
|
|
21
|
+
export type { SlotProps } from './slot';
|
package/lib/es/grid/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Row from './row';
|
|
2
2
|
import Col from './col';
|
|
3
3
|
export { Row, Col };
|
|
4
|
-
export { ColSize, ColProps } from './col';
|
|
5
|
-
export { Breakpoint, Gutter, RowProps } from './row';
|
|
4
|
+
export type { ColSize, ColProps } from './col';
|
|
5
|
+
export type { Breakpoint, Gutter, RowProps } from './row';
|
package/lib/es/icons/index.d.ts
CHANGED
package/lib/es/input/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import InputFoundation from '@douyinfe/semi-foundation/lib/es/input/foundation';
|
|
4
4
|
import BaseComponent from '../_base/baseComponent';
|
|
5
5
|
import '@douyinfe/semi-foundation/lib/es/input/input.css';
|
|
6
|
-
export { InputGroupProps } from './inputGroup';
|
|
7
|
-
export { TextAreaProps } from './textarea';
|
|
6
|
+
export type { InputGroupProps } from './inputGroup';
|
|
7
|
+
export type { TextAreaProps } from './textarea';
|
|
8
8
|
export declare type InputSize = 'small' | 'large' | 'default';
|
|
9
9
|
export declare type InputMode = 'password';
|
|
10
10
|
export declare type ValidateStatus = "default" | "error" | "warning" | "success";
|
package/lib/es/layout/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import '@douyinfe/semi-foundation/lib/es/layout/layout.css';
|
|
4
4
|
import { ContextType } from './layout-context';
|
|
5
5
|
import Sider from './Sider';
|
|
6
|
-
export { ResponsiveMap, SiderProps } from './Sider';
|
|
6
|
+
export type { ResponsiveMap, SiderProps } from './Sider';
|
|
7
7
|
export interface BasicProps {
|
|
8
8
|
prefixCls?: string;
|
|
9
9
|
style?: CSSProperties;
|
package/lib/es/list/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import '@douyinfe/semi-foundation/lib/es/list/list.css';
|
|
|
4
4
|
import ListItem from './item';
|
|
5
5
|
import { Grid } from './list-context';
|
|
6
6
|
import BaseComponent from '../_base/baseComponent';
|
|
7
|
-
export { ListItemProps } from './item';
|
|
7
|
+
export type { ListItemProps } from './item';
|
|
8
8
|
export interface ListProps<T> {
|
|
9
9
|
style?: React.CSSProperties;
|
|
10
10
|
className?: string;
|
package/lib/es/modal/Modal.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { ButtonProps } from '../button/Button';
|
|
|
8
8
|
export declare const destroyFns: any[];
|
|
9
9
|
export declare type ConfirmType = 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
|
|
10
10
|
export declare type Directions = 'ltr' | 'rtl';
|
|
11
|
+
export type { ModalState };
|
|
11
12
|
export interface ModalReactProps extends ModalProps {
|
|
12
13
|
cancelButtonProps?: ButtonProps;
|
|
13
14
|
children?: React.ReactNode;
|
|
@@ -24,7 +25,6 @@ export interface ModalReactProps extends ModalProps {
|
|
|
24
25
|
onCancel?: (e: React.MouseEvent) => void | Promise<any>;
|
|
25
26
|
onOk?: (e: React.MouseEvent) => void | Promise<any>;
|
|
26
27
|
}
|
|
27
|
-
export { ModalState };
|
|
28
28
|
declare class Modal extends BaseComponent<ModalReactProps, ModalState> {
|
|
29
29
|
static propTypes: {
|
|
30
30
|
mask: PropTypes.Requireable<boolean>;
|
package/lib/es/modal/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import '@douyinfe/semi-foundation/lib/es/modal/modal.css';
|
|
|
2
2
|
import { ModalState } from '@douyinfe/semi-foundation/lib/es/modal/modalFoundation';
|
|
3
3
|
import Modal from './Modal';
|
|
4
4
|
import { ModalReactProps } from './Modal';
|
|
5
|
-
export { ConfirmProps } from './confirm';
|
|
5
|
+
export type { ConfirmProps } from './confirm';
|
|
6
6
|
export declare type Directions = 'ltr' | 'rtl';
|
|
7
|
-
export { ModalReactProps, ModalState };
|
|
7
|
+
export type { ModalReactProps, ModalState };
|
|
8
8
|
export default Modal;
|
|
@@ -8,13 +8,13 @@ import Footer, { NavFooterProps } from './Footer';
|
|
|
8
8
|
import Header, { NavHeaderProps } from './Header';
|
|
9
9
|
import '@douyinfe/semi-foundation/lib/es/navigation/navigation.css';
|
|
10
10
|
import { Motion } from '../_base/base';
|
|
11
|
-
export { CollapseButtonProps } from './CollapseButton';
|
|
12
|
-
export { NavFooterProps } from './Footer';
|
|
13
|
-
export { NavHeaderProps } from './Header';
|
|
14
|
-
export { NavItemProps } from './Item';
|
|
15
|
-
export { OpenIconTransitionProps } from './OpenIconTransition';
|
|
16
|
-
export { ToggleIcon, SubNavProps } from './SubNav';
|
|
17
|
-
export { SubNavTransitionProps } from './SubNavTransition';
|
|
11
|
+
export type { CollapseButtonProps } from './CollapseButton';
|
|
12
|
+
export type { NavFooterProps } from './Footer';
|
|
13
|
+
export type { NavHeaderProps } from './Header';
|
|
14
|
+
export type { NavItemProps } from './Item';
|
|
15
|
+
export type { OpenIconTransitionProps } from './OpenIconTransition';
|
|
16
|
+
export type { ToggleIcon, SubNavProps } from './SubNav';
|
|
17
|
+
export type { SubNavTransitionProps } from './SubNavTransition';
|
|
18
18
|
export declare type Mode = 'vertical' | 'horizontal';
|
|
19
19
|
export interface OnSelectedData {
|
|
20
20
|
itemKey: React.ReactText;
|
|
@@ -6,11 +6,11 @@ import BaseComponent from '../_base/baseComponent';
|
|
|
6
6
|
import '@douyinfe/semi-foundation/lib/es/notification/notification.css';
|
|
7
7
|
import useNotification from './useNotification';
|
|
8
8
|
import { NoticeInstance, NoticePosition, NoticeProps, NoticeState } from '@douyinfe/semi-foundation/lib/es/notification/notificationFoundation';
|
|
9
|
-
export { NoticeTransitionProps } from './NoticeTransition';
|
|
9
|
+
export type { NoticeTransitionProps } from './NoticeTransition';
|
|
10
10
|
export interface NoticeReactProps extends NoticeProps {
|
|
11
11
|
style?: CSSProperties;
|
|
12
12
|
}
|
|
13
|
-
export { NoticeState, NotificationListProps, NotificationListState, ConfigProps };
|
|
13
|
+
export type { NoticeState, NotificationListProps, NotificationListState, ConfigProps };
|
|
14
14
|
export declare type NoticesInPosition = {
|
|
15
15
|
top: NoticeInstance[];
|
|
16
16
|
topLeft: NoticeInstance[];
|
|
@@ -9,7 +9,7 @@ declare const OverflowDirection: {
|
|
|
9
9
|
GROW: number;
|
|
10
10
|
SHRINK: number;
|
|
11
11
|
};
|
|
12
|
-
export { ReactIntersectionObserverProps } from './intersectionObserver';
|
|
12
|
+
export type { ReactIntersectionObserverProps } from './intersectionObserver';
|
|
13
13
|
export declare type OverflowItem = Record<string, any>;
|
|
14
14
|
export interface OverflowListProps {
|
|
15
15
|
className?: string;
|
|
@@ -42,7 +42,7 @@ export interface PaginationState {
|
|
|
42
42
|
}
|
|
43
43
|
export declare type PaginationLocale = Locale['Pagination'];
|
|
44
44
|
export declare type PopoverPosition = Position;
|
|
45
|
-
export { PageList };
|
|
45
|
+
export type { PageList };
|
|
46
46
|
export default class Pagination extends BaseComponent<PaginationProps, PaginationState> {
|
|
47
47
|
static contextType: React.Context<ContextValue>;
|
|
48
48
|
static propTypes: {
|
|
@@ -5,7 +5,8 @@ import { ArrowBounding, Position, TooltipProps, Trigger, RenderContentProps } fr
|
|
|
5
5
|
import '@douyinfe/semi-foundation/lib/es/popover/popover.css';
|
|
6
6
|
import { BaseProps } from '../_base/baseComponent';
|
|
7
7
|
import { Motion } from '../_base/base';
|
|
8
|
-
|
|
8
|
+
import type { ArrowProps } from './Arrow';
|
|
9
|
+
export type { ArrowProps };
|
|
9
10
|
declare interface ArrowStyle {
|
|
10
11
|
borderColor?: string;
|
|
11
12
|
backgroundColor?: string;
|
package/lib/es/radio/index.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ declare class RadioWithGroup extends Radio {
|
|
|
5
5
|
}
|
|
6
6
|
export default RadioWithGroup;
|
|
7
7
|
export { RadioWithGroup, Radio };
|
|
8
|
-
export { RadioInnerMode, RadioInnerProps } from './radioInner';
|
|
9
|
-
export { RadioGroupProps, OptionItem } from './radioGroup';
|
|
10
|
-
export { RadioDisplayMode, RadioType, RadioProps, RadioChangeEvent } from './radio';
|
|
8
|
+
export type { RadioInnerMode, RadioInnerProps } from './radioInner';
|
|
9
|
+
export type { RadioGroupProps, OptionItem } from './radioGroup';
|
|
10
|
+
export type { RadioDisplayMode, RadioType, RadioProps, RadioChangeEvent } from './radio';
|
package/lib/es/radio/radio.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export interface RadioState {
|
|
|
41
41
|
focusVisible?: boolean;
|
|
42
42
|
checked?: boolean;
|
|
43
43
|
}
|
|
44
|
-
export { RadioChangeEvent };
|
|
44
|
+
export type { RadioChangeEvent };
|
|
45
45
|
declare class Radio extends BaseComponent<RadioProps, RadioState> {
|
|
46
46
|
static contextType: React.Context<RadioContextValue>;
|
|
47
47
|
static propTypes: {
|
package/lib/es/rating/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { noop } from '@douyinfe/semi-foundation/lib/es/utils/function';
|
|
|
5
5
|
import Item from './item';
|
|
6
6
|
import RatingFoundation, { RatingAdapter } from '@douyinfe/semi-foundation/lib/es/rating/foundation';
|
|
7
7
|
import '@douyinfe/semi-foundation/lib/es/rating/rating.css';
|
|
8
|
-
export { RatingItemProps } from './item';
|
|
8
|
+
export type { RatingItemProps } from './item';
|
|
9
9
|
export interface RatingProps {
|
|
10
10
|
'aria-describedby'?: string;
|
|
11
11
|
'aria-errormessage'?: string;
|