@douyinfe/semi-ui 2.40.0 → 2.41.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 +23 -0
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +5235 -1752
- 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/_portal/index.js +10 -10
- package/lib/cjs/_sortable/index.d.ts +41 -0
- package/lib/cjs/_sortable/index.js +177 -0
- package/lib/cjs/anchor/index.d.ts +1 -1
- package/lib/cjs/autoComplete/index.d.ts +1 -1
- package/lib/cjs/button/Button.d.ts +1 -1
- package/lib/cjs/button/index.d.ts +1 -1
- package/lib/cjs/carousel/CarouselIndicator.d.ts +1 -1
- package/lib/cjs/carousel/index.d.ts +1 -1
- package/lib/cjs/datePicker/dateInput.d.ts +1 -1
- package/lib/cjs/datePicker/datePicker.d.ts +3 -3
- package/lib/cjs/datePicker/monthsGrid.d.ts +2 -2
- package/lib/cjs/datePicker/quickControl.d.ts +1 -1
- package/lib/cjs/datePicker/yearAndMonth.d.ts +2 -2
- package/lib/cjs/dropdown/index.d.ts +1 -1
- package/lib/cjs/form/baseForm.d.ts +3 -3
- package/lib/cjs/form/field.d.ts +3 -3
- package/lib/cjs/image/interface.d.ts +1 -1
- package/lib/cjs/image/preview.d.ts +1 -1
- package/lib/cjs/image/preview.js +1 -1
- package/lib/cjs/image/previewInner.d.ts +1 -1
- package/lib/cjs/image/previewInner.js +1 -1
- package/lib/cjs/modal/confirm.d.ts +104 -104
- package/lib/cjs/popover/index.d.ts +1 -1
- package/lib/cjs/radio/radio.d.ts +1 -1
- package/lib/cjs/radio/radioGroup.d.ts +1 -1
- package/lib/cjs/select/index.d.ts +1 -1
- package/lib/cjs/table/Column.d.ts +1 -1
- package/lib/cjs/table/ColumnShape.d.ts +1 -1
- package/lib/cjs/table/Table.d.ts +2 -2
- package/lib/cjs/table/index.d.ts +1 -1
- package/lib/cjs/tagInput/index.d.ts +4 -1
- package/lib/cjs/tagInput/index.js +58 -55
- package/lib/cjs/tooltip/index.d.ts +1 -1
- package/lib/cjs/transfer/index.d.ts +4 -3
- package/lib/cjs/transfer/index.js +65 -77
- package/lib/es/_portal/index.js +10 -10
- package/lib/es/_sortable/index.d.ts +41 -0
- package/lib/es/_sortable/index.js +167 -0
- package/lib/es/anchor/index.d.ts +1 -1
- package/lib/es/autoComplete/index.d.ts +1 -1
- package/lib/es/button/Button.d.ts +1 -1
- package/lib/es/button/index.d.ts +1 -1
- package/lib/es/carousel/CarouselIndicator.d.ts +1 -1
- package/lib/es/carousel/index.d.ts +1 -1
- package/lib/es/datePicker/dateInput.d.ts +1 -1
- package/lib/es/datePicker/datePicker.d.ts +3 -3
- package/lib/es/datePicker/monthsGrid.d.ts +2 -2
- package/lib/es/datePicker/quickControl.d.ts +1 -1
- package/lib/es/datePicker/yearAndMonth.d.ts +2 -2
- package/lib/es/dropdown/index.d.ts +1 -1
- package/lib/es/form/baseForm.d.ts +3 -3
- package/lib/es/form/field.d.ts +3 -3
- package/lib/es/image/interface.d.ts +1 -1
- package/lib/es/image/preview.d.ts +1 -1
- package/lib/es/image/preview.js +1 -1
- package/lib/es/image/previewInner.d.ts +1 -1
- package/lib/es/image/previewInner.js +1 -1
- package/lib/es/modal/confirm.d.ts +104 -104
- package/lib/es/popover/index.d.ts +1 -1
- package/lib/es/radio/radio.d.ts +1 -1
- package/lib/es/radio/radioGroup.d.ts +1 -1
- package/lib/es/select/index.d.ts +1 -1
- package/lib/es/table/Column.d.ts +1 -1
- package/lib/es/table/ColumnShape.d.ts +1 -1
- package/lib/es/table/Table.d.ts +2 -2
- package/lib/es/table/index.d.ts +1 -1
- package/lib/es/tagInput/index.d.ts +4 -1
- package/lib/es/tagInput/index.js +58 -55
- package/lib/es/tooltip/index.d.ts +1 -1
- package/lib/es/transfer/index.d.ts +4 -3
- package/lib/es/transfer/index.js +65 -77
- package/package.json +11 -9
package/lib/cjs/_portal/index.js
CHANGED
|
@@ -21,12 +21,12 @@ class Portal extends _react.PureComponent {
|
|
|
21
21
|
this.initContainer = function (context) {
|
|
22
22
|
let catchError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
23
23
|
var _a, _b;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
_this.el
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
try {
|
|
25
|
+
let container = undefined;
|
|
26
|
+
if (!_this.el) {
|
|
27
|
+
_this.el = document.createElement('div');
|
|
28
|
+
}
|
|
29
|
+
if (!((_a = _this.state) === null || _a === void 0 ? void 0 : _a.container)) {
|
|
30
30
|
_this.el = document.createElement('div');
|
|
31
31
|
const getContainer = _this.props.getPopupContainer || context.getPopupContainer || defaultGetContainer;
|
|
32
32
|
const portalContainer = getContainer();
|
|
@@ -35,10 +35,10 @@ class Portal extends _react.PureComponent {
|
|
|
35
35
|
_this.addClass(_this.props.prefixCls, context, _this.props.className);
|
|
36
36
|
container = portalContainer;
|
|
37
37
|
return container;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
}
|
|
39
|
+
} catch (e) {
|
|
40
|
+
if (!catchError) {
|
|
41
|
+
throw e;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
return (_b = _this.state) === null || _b === void 0 ? void 0 : _b.container;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import type { UniqueIdentifier, PointerActivationConstraint, CollisionDetection } from '@dnd-kit/core';
|
|
3
|
+
import type { SortingStrategy, AnimateLayoutChanges, NewIndexGetter } from '@dnd-kit/sortable';
|
|
4
|
+
import type { SortableTransition } from '@dnd-kit/sortable/dist/hooks/types';
|
|
5
|
+
interface OnSortEndProps {
|
|
6
|
+
oldIndex: number;
|
|
7
|
+
newIndex: number;
|
|
8
|
+
}
|
|
9
|
+
export type OnSortEnd = (props: OnSortEndProps) => void;
|
|
10
|
+
export interface RenderItemProps {
|
|
11
|
+
id?: string | number;
|
|
12
|
+
sortableHandle?: any;
|
|
13
|
+
[x: string]: any;
|
|
14
|
+
}
|
|
15
|
+
export interface SortableProps {
|
|
16
|
+
onSortEnd?: OnSortEnd;
|
|
17
|
+
activationConstraint?: PointerActivationConstraint;
|
|
18
|
+
collisionDetection?: CollisionDetection;
|
|
19
|
+
items?: any[];
|
|
20
|
+
renderItem?: (props: RenderItemProps) => React.ReactNode;
|
|
21
|
+
strategy?: SortingStrategy;
|
|
22
|
+
useDragOverlay?: boolean;
|
|
23
|
+
container?: any;
|
|
24
|
+
adjustScale?: boolean;
|
|
25
|
+
transition?: SortableTransition | null;
|
|
26
|
+
prefix?: string;
|
|
27
|
+
dragOverlayCls?: string;
|
|
28
|
+
}
|
|
29
|
+
interface SortableItemProps {
|
|
30
|
+
animateLayoutChanges?: AnimateLayoutChanges;
|
|
31
|
+
getNewIndex?: NewIndexGetter;
|
|
32
|
+
id: UniqueIdentifier;
|
|
33
|
+
index: number;
|
|
34
|
+
useDragOverlay?: boolean;
|
|
35
|
+
renderItem?: (props: RenderItemProps) => ReactNode;
|
|
36
|
+
prefix?: string;
|
|
37
|
+
transition?: SortableTransition | null;
|
|
38
|
+
}
|
|
39
|
+
export declare function Sortable({ items, onSortEnd, adjustScale, renderItem, transition, activationConstraint, collisionDetection, strategy, useDragOverlay, dragOverlayCls, container: Container, prefix, }: SortableProps): JSX.Element;
|
|
40
|
+
export declare function SortableItem({ animateLayoutChanges, id, renderItem, prefix, transition: animation, }: SortableItemProps): JSX.Element;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Sortable = Sortable;
|
|
7
|
+
exports.SortableItem = SortableItem;
|
|
8
|
+
var _isNull2 = _interopRequireDefault(require("lodash/isNull"));
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _reactDom = require("react-dom");
|
|
11
|
+
var _utilities = require("@dnd-kit/utilities");
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
var _core = require("@dnd-kit/core");
|
|
14
|
+
var _sortable = require("@dnd-kit/sortable");
|
|
15
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
+
const defaultPrefix = 'semi-sortable';
|
|
19
|
+
const defaultConstraint = {
|
|
20
|
+
delay: 150,
|
|
21
|
+
tolerance: 5
|
|
22
|
+
};
|
|
23
|
+
function DefaultContainer(props) {
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement("div", Object.assign({
|
|
25
|
+
style: {
|
|
26
|
+
overflow: 'auto'
|
|
27
|
+
}
|
|
28
|
+
}, props));
|
|
29
|
+
}
|
|
30
|
+
function Sortable(_ref) {
|
|
31
|
+
let {
|
|
32
|
+
items,
|
|
33
|
+
onSortEnd,
|
|
34
|
+
adjustScale,
|
|
35
|
+
renderItem,
|
|
36
|
+
transition,
|
|
37
|
+
activationConstraint = defaultConstraint,
|
|
38
|
+
collisionDetection = _core.closestCenter,
|
|
39
|
+
strategy = _sortable.rectSortingStrategy,
|
|
40
|
+
useDragOverlay = true,
|
|
41
|
+
dragOverlayCls,
|
|
42
|
+
container: Container = DefaultContainer,
|
|
43
|
+
prefix = defaultPrefix
|
|
44
|
+
} = _ref;
|
|
45
|
+
const [activeId, setActiveId] = (0, _react.useState)(null);
|
|
46
|
+
const sensors = (0, _core.useSensors)((0, _core.useSensor)(_core.MouseSensor, {
|
|
47
|
+
activationConstraint
|
|
48
|
+
}), (0, _core.useSensor)(_core.TouchSensor, {
|
|
49
|
+
activationConstraint
|
|
50
|
+
}), (0, _core.useSensor)(_core.KeyboardSensor, {
|
|
51
|
+
coordinateGetter: _sortable.sortableKeyboardCoordinates
|
|
52
|
+
}));
|
|
53
|
+
const getIndex = (0, _react.useCallback)(id => items.indexOf(id), [items]);
|
|
54
|
+
const activeIndex = (0, _react.useMemo)(() => activeId ? getIndex(activeId) : -1, [getIndex, activeId]);
|
|
55
|
+
const onDragStart = (0, _react.useCallback)(_ref2 => {
|
|
56
|
+
let {
|
|
57
|
+
active
|
|
58
|
+
} = _ref2;
|
|
59
|
+
if (!active) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
setActiveId(active.id);
|
|
63
|
+
}, []);
|
|
64
|
+
const onDragEnd = (0, _react.useCallback)(_ref3 => {
|
|
65
|
+
let {
|
|
66
|
+
over
|
|
67
|
+
} = _ref3;
|
|
68
|
+
setActiveId(null);
|
|
69
|
+
if (over) {
|
|
70
|
+
const overIndex = getIndex(over.id);
|
|
71
|
+
if (activeIndex !== overIndex) {
|
|
72
|
+
onSortEnd({
|
|
73
|
+
oldIndex: activeIndex,
|
|
74
|
+
newIndex: overIndex
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}, [activeIndex, getIndex, onSortEnd]);
|
|
79
|
+
const onDragCancel = (0, _react.useCallback)(() => {
|
|
80
|
+
setActiveId(null);
|
|
81
|
+
}, []);
|
|
82
|
+
return /*#__PURE__*/_react.default.createElement(_core.DndContext, {
|
|
83
|
+
sensors: sensors,
|
|
84
|
+
collisionDetection: collisionDetection,
|
|
85
|
+
onDragStart: onDragStart,
|
|
86
|
+
onDragEnd: onDragEnd,
|
|
87
|
+
onDragCancel: onDragCancel,
|
|
88
|
+
autoScroll: {
|
|
89
|
+
order: _core.TraversalOrder.ReversedTreeOrder
|
|
90
|
+
}
|
|
91
|
+
}, /*#__PURE__*/_react.default.createElement(_sortable.SortableContext, {
|
|
92
|
+
items: items,
|
|
93
|
+
strategy: strategy
|
|
94
|
+
}, /*#__PURE__*/_react.default.createElement(Container, null, items.map((value, index) => /*#__PURE__*/_react.default.createElement(SortableItem, {
|
|
95
|
+
key: value,
|
|
96
|
+
id: value,
|
|
97
|
+
index: index,
|
|
98
|
+
renderItem: renderItem,
|
|
99
|
+
useDragOverlay: useDragOverlay,
|
|
100
|
+
prefix: prefix,
|
|
101
|
+
transition: transition
|
|
102
|
+
})))), useDragOverlay ? /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/_react.default.createElement(_core.DragOverlay, {
|
|
103
|
+
adjustScale: adjustScale,
|
|
104
|
+
// Set zIndex in style to undefined to override the default zIndex in DragOverlay,
|
|
105
|
+
// So that the zIndex of DragOverlay can be set by className
|
|
106
|
+
style: {
|
|
107
|
+
zIndex: undefined
|
|
108
|
+
},
|
|
109
|
+
className: dragOverlayCls
|
|
110
|
+
}, activeId ? renderItem({
|
|
111
|
+
id: activeId,
|
|
112
|
+
sortableHandle: WrapperComponent => WrapperComponent
|
|
113
|
+
}) : null), document.body) : null);
|
|
114
|
+
}
|
|
115
|
+
function SortableItem(_ref4) {
|
|
116
|
+
let {
|
|
117
|
+
animateLayoutChanges,
|
|
118
|
+
id,
|
|
119
|
+
renderItem,
|
|
120
|
+
prefix,
|
|
121
|
+
transition: animation
|
|
122
|
+
} = _ref4;
|
|
123
|
+
const {
|
|
124
|
+
listeners,
|
|
125
|
+
setNodeRef,
|
|
126
|
+
transform,
|
|
127
|
+
transition,
|
|
128
|
+
active,
|
|
129
|
+
isOver,
|
|
130
|
+
attributes
|
|
131
|
+
} = (0, _sortable.useSortable)({
|
|
132
|
+
id,
|
|
133
|
+
animateLayoutChanges,
|
|
134
|
+
transition: animation
|
|
135
|
+
});
|
|
136
|
+
const sortableHandle = (0, _react.useCallback)(WrapperComponent => {
|
|
137
|
+
// console.log('listeners', listeners);
|
|
138
|
+
// 保证给出的接口的一致性,使用 span 包一层,保证用户能够通过同样的方式使用 handler
|
|
139
|
+
// To ensure the consistency of the given interface
|
|
140
|
+
// use a span package layer to ensure that users can use the handler in the same way
|
|
141
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
142
|
+
return () => /*#__PURE__*/_react.default.createElement("span", Object.assign({}, listeners, {
|
|
143
|
+
style: {
|
|
144
|
+
lineHeight: 0
|
|
145
|
+
},
|
|
146
|
+
onMouseDown: e => {
|
|
147
|
+
listeners.onMouseDown(e);
|
|
148
|
+
// 阻止onMousedown的事件传递,
|
|
149
|
+
// 防止元素在点击后被卸载导致tooltip/popover的弹出层意外关闭
|
|
150
|
+
// Prevent the onMousedown event from being delivered,
|
|
151
|
+
// preventing the element from being unloaded after being clicked,
|
|
152
|
+
// causing the tooltip/popover pop-up layer to close unexpectedly
|
|
153
|
+
e.preventDefault();
|
|
154
|
+
e.stopPropagation();
|
|
155
|
+
}
|
|
156
|
+
}), /*#__PURE__*/_react.default.createElement(WrapperComponent, null));
|
|
157
|
+
}, [listeners]);
|
|
158
|
+
const itemCls = (0, _classnames.default)(`${prefix}-sortable-item`, {
|
|
159
|
+
[`${prefix}-sortable-item-over`]: isOver,
|
|
160
|
+
[`${prefix}-sortable-item-active`]: (active === null || active === void 0 ? void 0 : active.id) === id
|
|
161
|
+
});
|
|
162
|
+
const wrapperStyle = !(0, _isNull2.default)(animation) ? {
|
|
163
|
+
transform: _utilities.CSS.Transform.toString(Object.assign(Object.assign({}, transform), {
|
|
164
|
+
scaleX: 1,
|
|
165
|
+
scaleY: 1
|
|
166
|
+
})),
|
|
167
|
+
transition: transition
|
|
168
|
+
} : undefined;
|
|
169
|
+
return /*#__PURE__*/_react.default.createElement("div", Object.assign({
|
|
170
|
+
ref: setNodeRef,
|
|
171
|
+
style: wrapperStyle,
|
|
172
|
+
className: itemCls
|
|
173
|
+
}, attributes), renderItem({
|
|
174
|
+
id,
|
|
175
|
+
sortableHandle
|
|
176
|
+
}));
|
|
177
|
+
}
|
|
@@ -49,7 +49,7 @@ declare class Anchor extends BaseComponent<AnchorProps, AnchorState> {
|
|
|
49
49
|
offsetTop: PropTypes.Requireable<number>;
|
|
50
50
|
targetOffset: PropTypes.Requireable<number>;
|
|
51
51
|
showTooltip: PropTypes.Requireable<boolean>;
|
|
52
|
-
position: PropTypes.Requireable<"left" | "
|
|
52
|
+
position: PropTypes.Requireable<"left" | "right" | "top" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver">;
|
|
53
53
|
maxWidth: PropTypes.Requireable<NonNullable<string | number>>;
|
|
54
54
|
maxHeight: PropTypes.Requireable<NonNullable<string | number>>;
|
|
55
55
|
getContainer: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -116,7 +116,7 @@ declare class AutoComplete<T extends AutoCompleteItems> extends BaseComponent<Au
|
|
|
116
116
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
117
117
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
118
118
|
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
119
|
-
position: PropTypes.Requireable<"left" | "
|
|
119
|
+
position: PropTypes.Requireable<"left" | "right" | "top" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
|
|
120
120
|
placeholder: PropTypes.Requireable<string>;
|
|
121
121
|
prefix: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
122
122
|
onChangeWithObject: PropTypes.Requireable<boolean>;
|
|
@@ -54,7 +54,7 @@ export default class Button extends PureComponent<ButtonProps> {
|
|
|
54
54
|
onMouseDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
55
55
|
circle: PropTypes.Requireable<boolean>;
|
|
56
56
|
loading: PropTypes.Requireable<boolean>;
|
|
57
|
-
htmlType: PropTypes.Requireable<"button" | "
|
|
57
|
+
htmlType: PropTypes.Requireable<"button" | "submit" | "reset">;
|
|
58
58
|
theme: PropTypes.Requireable<"solid" | "light" | "borderless">;
|
|
59
59
|
className: PropTypes.Requireable<string>;
|
|
60
60
|
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -28,7 +28,7 @@ declare class Button extends React.PureComponent<ButtonProps> {
|
|
|
28
28
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
29
29
|
onMouseDown: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
30
30
|
circle: import("prop-types").Requireable<boolean>;
|
|
31
|
-
htmlType: import("prop-types").Requireable<"button" | "
|
|
31
|
+
htmlType: import("prop-types").Requireable<"button" | "submit" | "reset">;
|
|
32
32
|
'aria-label': import("prop-types").Requireable<string>;
|
|
33
33
|
};
|
|
34
34
|
static elementType: string;
|
|
@@ -5,7 +5,7 @@ declare class CarouselIndicator extends React.PureComponent<CarouselIndicatorPro
|
|
|
5
5
|
static propTypes: {
|
|
6
6
|
activeKey: PropTypes.Requireable<number>;
|
|
7
7
|
className: PropTypes.Requireable<string>;
|
|
8
|
-
position: PropTypes.Requireable<"
|
|
8
|
+
position: PropTypes.Requireable<"center" | "left" | "right">;
|
|
9
9
|
size: PropTypes.Requireable<"small" | "medium">;
|
|
10
10
|
style: PropTypes.Requireable<object>;
|
|
11
11
|
theme: PropTypes.Requireable<"dark" | "light" | "primary">;
|
|
@@ -19,7 +19,7 @@ declare class Carousel extends BaseComponent<CarouselProps, CarouselState> {
|
|
|
19
19
|
autoPlay: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
20
20
|
className: PropTypes.Requireable<string>;
|
|
21
21
|
defaultActiveIndex: PropTypes.Requireable<number>;
|
|
22
|
-
indicatorPosition: PropTypes.Requireable<"
|
|
22
|
+
indicatorPosition: PropTypes.Requireable<"center" | "left" | "right">;
|
|
23
23
|
indicatorSize: PropTypes.Requireable<"small" | "medium">;
|
|
24
24
|
indicatorType: PropTypes.Requireable<"line" | "dot" | "columnar">;
|
|
25
25
|
theme: PropTypes.Requireable<"dark" | "light" | "primary">;
|
|
@@ -31,7 +31,7 @@ export default class DateInput extends BaseComponent<DateInputProps, {}> {
|
|
|
31
31
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
32
32
|
value: PropTypes.Requireable<any[]>;
|
|
33
33
|
disabled: PropTypes.Requireable<boolean>;
|
|
34
|
-
type: PropTypes.Requireable<"
|
|
34
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "monthRange" | "dateTimeRange">;
|
|
35
35
|
showClear: PropTypes.Requireable<boolean>;
|
|
36
36
|
format: PropTypes.Requireable<string>;
|
|
37
37
|
inputStyle: PropTypes.Requireable<object>;
|
|
@@ -58,7 +58,7 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
|
|
|
58
58
|
'aria-labelledby': PropTypes.Requireable<string>;
|
|
59
59
|
'aria-required': PropTypes.Requireable<boolean>;
|
|
60
60
|
borderless: PropTypes.Requireable<boolean>;
|
|
61
|
-
type: PropTypes.Requireable<"
|
|
61
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "monthRange" | "dateTimeRange">;
|
|
62
62
|
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
63
63
|
clearIcon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
64
64
|
density: PropTypes.Requireable<"default" | "compact">;
|
|
@@ -74,7 +74,7 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
|
|
|
74
74
|
max: PropTypes.Requireable<number>;
|
|
75
75
|
placeholder: PropTypes.Requireable<NonNullable<string | any[]>>;
|
|
76
76
|
presets: PropTypes.Requireable<any[]>;
|
|
77
|
-
presetPosition: PropTypes.Requireable<"left" | "
|
|
77
|
+
presetPosition: PropTypes.Requireable<"left" | "right" | "top" | "bottom">;
|
|
78
78
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
79
79
|
onChangeWithDateFirst: PropTypes.Requireable<boolean>;
|
|
80
80
|
weekStartsOn: PropTypes.Requireable<number>;
|
|
@@ -91,7 +91,7 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
|
|
|
91
91
|
insetLabel: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
92
92
|
insetLabelId: PropTypes.Requireable<string>;
|
|
93
93
|
zIndex: PropTypes.Requireable<number>;
|
|
94
|
-
position: PropTypes.Requireable<"left" | "
|
|
94
|
+
position: PropTypes.Requireable<"left" | "right" | "top" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver">;
|
|
95
95
|
getPopupContainer: PropTypes.Requireable<(...args: any[]) => any>;
|
|
96
96
|
onCancel: PropTypes.Requireable<(...args: any[]) => any>;
|
|
97
97
|
onConfirm: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -19,7 +19,7 @@ export interface MonthsGridProps extends MonthsGridFoundationProps, BaseProps {
|
|
|
19
19
|
export type MonthsGridState = MonthsGridFoundationState;
|
|
20
20
|
export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGridState> {
|
|
21
21
|
static propTypes: {
|
|
22
|
-
type: PropTypes.Requireable<"
|
|
22
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "monthRange" | "dateTimeRange">;
|
|
23
23
|
defaultValue: PropTypes.Requireable<any[]>;
|
|
24
24
|
defaultPickerValue: PropTypes.Requireable<NonNullable<string | number | object>>;
|
|
25
25
|
multiple: PropTypes.Requireable<boolean>;
|
|
@@ -51,7 +51,7 @@ export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGri
|
|
|
51
51
|
onPanelChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
52
52
|
focusRecordsRef: PropTypes.Requireable<object>;
|
|
53
53
|
triggerRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
54
|
-
presetPosition: PropTypes.Requireable<"left" | "
|
|
54
|
+
presetPosition: PropTypes.Requireable<"left" | "right" | "top" | "bottom">;
|
|
55
55
|
renderQuickControls: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
56
56
|
renderDateInput: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
57
57
|
};
|
|
@@ -15,7 +15,7 @@ export interface QuickControlProps {
|
|
|
15
15
|
declare class QuickControl extends PureComponent<QuickControlProps> {
|
|
16
16
|
static propTypes: {
|
|
17
17
|
presets: PropTypes.Requireable<any[]>;
|
|
18
|
-
presetPosition: PropTypes.Requireable<"left" | "
|
|
18
|
+
presetPosition: PropTypes.Requireable<"left" | "right" | "top" | "bottom">;
|
|
19
19
|
onPresetClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
20
20
|
type: PropTypes.Requireable<string>;
|
|
21
21
|
insetInput: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
@@ -21,10 +21,10 @@ declare class YearAndMonth extends BaseComponent<YearAndMonthProps, YearAndMonth
|
|
|
21
21
|
noBackBtn: PropTypes.Requireable<boolean>;
|
|
22
22
|
disabledDate: PropTypes.Requireable<(...args: any[]) => any>;
|
|
23
23
|
density: PropTypes.Requireable<string>;
|
|
24
|
-
presetPosition: PropTypes.Requireable<"left" | "
|
|
24
|
+
presetPosition: PropTypes.Requireable<"left" | "right" | "top" | "bottom">;
|
|
25
25
|
renderQuickControls: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
26
26
|
renderDateInput: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
27
|
-
type: PropTypes.Requireable<"
|
|
27
|
+
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "monthRange" | "dateTimeRange">;
|
|
28
28
|
startYear: PropTypes.Requireable<number>;
|
|
29
29
|
endYear: PropTypes.Requireable<number>;
|
|
30
30
|
};
|
|
@@ -66,7 +66,7 @@ declare class Dropdown extends BaseComponent<DropdownProps, DropdownState> {
|
|
|
66
66
|
motion: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
67
67
|
onVisibleChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
68
68
|
prefixCls: PropTypes.Requireable<string>;
|
|
69
|
-
position: PropTypes.Requireable<"left" | "
|
|
69
|
+
position: PropTypes.Requireable<"left" | "right" | "top" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
|
|
70
70
|
rePosKey: PropTypes.Requireable<NonNullable<string | number>>;
|
|
71
71
|
render: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
72
72
|
spacing: PropTypes.Requireable<number>;
|
|
@@ -57,9 +57,9 @@ declare class Form<Values extends Record<string, any> = any> extends BaseCompone
|
|
|
57
57
|
static Select: React.ComponentType<import("utility-types").Subtract<{
|
|
58
58
|
'aria-describedby'?: string;
|
|
59
59
|
'aria-errormessage'?: string;
|
|
60
|
-
'aria-invalid'?: boolean | "
|
|
60
|
+
'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling";
|
|
61
61
|
'aria-labelledby'?: string;
|
|
62
|
-
'aria-required'?: boolean | "
|
|
62
|
+
'aria-required'?: boolean | "true" | "false";
|
|
63
63
|
id?: string;
|
|
64
64
|
autoFocus?: boolean;
|
|
65
65
|
autoClearSearchValue?: boolean;
|
|
@@ -83,7 +83,7 @@ declare class Form<Values extends Record<string, any> = any> extends BaseCompone
|
|
|
83
83
|
expandRestTagsOnClick?: boolean;
|
|
84
84
|
onDropdownVisibleChange?: (visible: boolean) => void;
|
|
85
85
|
zIndex?: number;
|
|
86
|
-
position?: "left" | "
|
|
86
|
+
position?: "left" | "right" | "top" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
|
|
87
87
|
onSearch?: (value: string, event: React.KeyboardEvent<Element> | React.MouseEvent<Element, MouseEvent>) => void;
|
|
88
88
|
dropdownClassName?: string;
|
|
89
89
|
dropdownStyle?: React.CSSProperties;
|
package/lib/cjs/form/field.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ declare const FormTextArea: import("react").ComponentType<import("utility-types"
|
|
|
5
5
|
declare const FormSelect: import("react").ComponentType<import("utility-types").Subtract<{
|
|
6
6
|
'aria-describedby'?: string;
|
|
7
7
|
'aria-errormessage'?: string;
|
|
8
|
-
'aria-invalid'?: boolean | "
|
|
8
|
+
'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling";
|
|
9
9
|
'aria-labelledby'?: string;
|
|
10
|
-
'aria-required'?: boolean | "
|
|
10
|
+
'aria-required'?: boolean | "true" | "false";
|
|
11
11
|
id?: string;
|
|
12
12
|
autoFocus?: boolean;
|
|
13
13
|
autoClearSearchValue?: boolean;
|
|
@@ -31,7 +31,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
31
31
|
expandRestTagsOnClick?: boolean;
|
|
32
32
|
onDropdownVisibleChange?: (visible: boolean) => void;
|
|
33
33
|
zIndex?: number;
|
|
34
|
-
position?: "left" | "
|
|
34
|
+
position?: "left" | "right" | "top" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
|
|
35
35
|
onSearch?: (value: string, event: import("react").KeyboardEvent<Element> | import("react").MouseEvent<Element, MouseEvent>) => void;
|
|
36
36
|
dropdownClassName?: string;
|
|
37
37
|
dropdownStyle?: import("react").CSSProperties;
|
|
@@ -28,7 +28,7 @@ export interface PreviewProps extends BaseProps {
|
|
|
28
28
|
src?: string | string[];
|
|
29
29
|
previewTitle?: ReactNode;
|
|
30
30
|
currentIndex?: number;
|
|
31
|
-
|
|
31
|
+
defaultCurrentIndex?: number;
|
|
32
32
|
defaultVisible?: boolean;
|
|
33
33
|
maskClosable?: boolean;
|
|
34
34
|
closable?: boolean;
|
|
@@ -12,7 +12,7 @@ export default class Preview extends BaseComponent<PreviewProps, PreviewState> {
|
|
|
12
12
|
visible: PropTypes.Requireable<boolean>;
|
|
13
13
|
src: PropTypes.Requireable<NonNullable<string | any[]>>;
|
|
14
14
|
currentIndex: PropTypes.Requireable<number>;
|
|
15
|
-
|
|
15
|
+
defaultCurrentIndex: PropTypes.Requireable<number>;
|
|
16
16
|
defaultVisible: PropTypes.Requireable<boolean>;
|
|
17
17
|
maskClosable: PropTypes.Requireable<boolean>;
|
|
18
18
|
closable: PropTypes.Requireable<boolean>;
|
package/lib/cjs/image/preview.js
CHANGED
|
@@ -198,7 +198,7 @@ Preview.propTypes = {
|
|
|
198
198
|
visible: _propTypes.default.bool,
|
|
199
199
|
src: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.array]),
|
|
200
200
|
currentIndex: _propTypes.default.number,
|
|
201
|
-
|
|
201
|
+
defaultCurrentIndex: _propTypes.default.number,
|
|
202
202
|
defaultVisible: _propTypes.default.bool,
|
|
203
203
|
maskClosable: _propTypes.default.bool,
|
|
204
204
|
closable: _propTypes.default.bool,
|
|
@@ -12,7 +12,7 @@ export default class PreviewInner extends BaseComponent<PreviewInnerProps, Previ
|
|
|
12
12
|
visible: PropTypes.Requireable<boolean>;
|
|
13
13
|
src: PropTypes.Requireable<NonNullable<string | any[]>>;
|
|
14
14
|
currentIndex: PropTypes.Requireable<number>;
|
|
15
|
-
|
|
15
|
+
defaultCurrentIndex: PropTypes.Requireable<number>;
|
|
16
16
|
defaultVisible: PropTypes.Requireable<boolean>;
|
|
17
17
|
maskClosable: PropTypes.Requireable<boolean>;
|
|
18
18
|
closable: PropTypes.Requireable<boolean>;
|
|
@@ -390,7 +390,7 @@ PreviewInner.propTypes = {
|
|
|
390
390
|
visible: _propTypes.default.bool,
|
|
391
391
|
src: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.array]),
|
|
392
392
|
currentIndex: _propTypes.default.number,
|
|
393
|
-
|
|
393
|
+
defaultCurrentIndex: _propTypes.default.number,
|
|
394
394
|
defaultVisible: _propTypes.default.bool,
|
|
395
395
|
maskClosable: _propTypes.default.bool,
|
|
396
396
|
closable: _propTypes.default.bool,
|