@douyinfe/semi-ui 2.0.9-alpha.4 → 2.1.0-alpha.3
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 +14 -1
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +1625 -2525
- 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/es/_base/baseComponent.js +1 -5
- package/lib/es/_portal/index.js +7 -17
- package/lib/es/_utils/index.js +13 -16
- package/lib/es/breadcrumb/index.js +2 -4
- package/lib/es/breadcrumb/item.js +4 -6
- package/lib/es/button/index.d.ts +0 -1
- package/lib/es/button/index.js +2 -4
- package/lib/es/calendar/monthCalendar.js +9 -11
- package/lib/es/cascader/index.d.ts +1 -0
- package/lib/es/cascader/index.js +23 -14
- package/lib/es/cascader/item.js +1 -2
- package/lib/es/collapse/item.js +1 -2
- package/lib/es/collapsible/index.js +9 -9
- package/lib/es/datePicker/dateInput.js +9 -29
- package/lib/es/datePicker/datePicker.js +12 -49
- package/lib/es/datePicker/footer.js +1 -2
- package/lib/es/datePicker/index.js +12 -15
- package/lib/es/datePicker/yearAndMonth.js +17 -23
- package/lib/es/dropdown/dropdownDivider.js +1 -2
- package/lib/es/form/baseForm.d.ts +4 -10
- package/lib/es/form/field.d.ts +4 -22
- package/lib/es/form/field.js +2 -18
- package/lib/es/form/hoc/withField.d.ts +1 -1
- package/lib/es/form/hoc/withField.js +3 -14
- package/lib/es/iconButton/index.d.ts +0 -1
- package/lib/es/iconButton/index.js +0 -1
- package/lib/es/inputNumber/index.js +4 -12
- package/lib/es/locale/localeConsumer.js +3 -6
- package/lib/es/modal/ConfirmModal.js +2 -2
- package/lib/es/modal/confirm.js +2 -2
- package/lib/es/modal/useModal/HookModal.js +2 -2
- package/lib/es/motions/Rotate.js +4 -6
- package/lib/es/navigation/CollapseButton.js +7 -9
- package/lib/es/navigation/Item.js +7 -33
- package/lib/es/navigation/OpenIconTransition.js +4 -6
- package/lib/es/navigation/SubNav.js +6 -33
- package/lib/es/navigation/SubNavTransition.js +5 -7
- package/lib/es/navigation/index.js +6 -24
- package/lib/es/notification/NoticeTransition.js +5 -7
- package/lib/es/notification/index.js +8 -16
- package/lib/es/notification/useNotification/index.js +7 -11
- package/lib/es/overflowList/index.js +4 -9
- package/lib/es/overflowList/intersectionObserver.js +1 -2
- package/lib/es/popconfirm/index.d.ts +5 -1
- package/lib/es/popconfirm/index.js +10 -4
- package/lib/es/popover/Arrow.js +1 -3
- package/lib/es/popover/index.d.ts +3 -1
- package/lib/es/popover/index.js +4 -8
- package/lib/es/radio/context.d.ts +1 -1
- package/lib/es/radio/radio.d.ts +2 -2
- package/lib/es/radio/radioGroup.d.ts +4 -4
- package/lib/es/resizeObserver/index.js +1 -2
- package/lib/es/scrollList/scrollItem.js +24 -40
- package/lib/es/select/index.js +19 -16
- package/lib/es/select/option.js +8 -10
- package/lib/es/select/utils.d.ts +1 -1
- package/lib/es/select/utils.js +10 -4
- package/lib/es/select/virtualRow.js +5 -6
- package/lib/es/sideSheet/SideSheetTransition.js +1 -3
- package/lib/es/slider/index.js +11 -23
- package/lib/es/spin/icon.js +1 -3
- package/lib/es/table/Body/BaseRow.js +8 -16
- package/lib/es/table/Body/SectionRow.js +3 -6
- package/lib/es/table/Body/index.js +32 -49
- package/lib/es/table/Column.js +1 -2
- package/lib/es/table/ColumnFilter.js +2 -6
- package/lib/es/table/ColumnSelection.js +1 -5
- package/lib/es/table/HeadTable.js +3 -4
- package/lib/es/table/ResizableTable.js +20 -31
- package/lib/es/table/Table.js +63 -160
- package/lib/es/table/TableCell.js +3 -5
- package/lib/es/table/TableContextProvider.js +15 -16
- package/lib/es/table/TableHeader.js +1 -4
- package/lib/es/table/utils.js +1 -3
- package/lib/es/tabs/TabBar.d.ts +4 -2
- package/lib/es/tabs/TabBar.js +12 -4
- package/lib/es/tabs/TabPane.d.ts +2 -1
- package/lib/es/tabs/TabPane.js +3 -2
- package/lib/es/tabs/TabPaneTransition.js +9 -12
- package/lib/es/tabs/index.d.ts +3 -1
- package/lib/es/tabs/index.js +83 -14
- package/lib/es/tabs/interface.d.ts +6 -1
- package/lib/es/tagInput/index.d.ts +3 -0
- package/lib/es/tagInput/index.js +6 -1
- package/lib/es/timePicker/Combobox.js +5 -6
- package/lib/es/timePicker/TimeInput.js +3 -11
- package/lib/es/timePicker/TimePicker.js +7 -21
- package/lib/es/timePicker/index.js +12 -15
- package/lib/es/toast/ToastTransition.js +8 -12
- package/lib/es/toast/useToast/index.js +3 -6
- package/lib/es/tooltip/TooltipStyledTransition.js +10 -14
- package/lib/es/tooltip/index.d.ts +3 -0
- package/lib/es/tooltip/index.js +22 -28
- package/lib/es/transfer/index.js +15 -18
- package/lib/es/tree/index.js +28 -38
- package/lib/es/tree/interface.d.ts +2 -2
- package/lib/es/treeSelect/index.d.ts +2 -11
- package/lib/es/treeSelect/index.js +32 -44
- package/lib/es/typography/title.d.ts +1 -1
- package/lib/es/typography/util.js +3 -12
- package/lib/es/upload/fileCard.js +53 -62
- package/lib/es/upload/index.d.ts +1 -1
- package/lib/es/upload/index.js +23 -32
- package/package.json +8 -8
package/lib/es/tooltip/index.js
CHANGED
|
@@ -168,23 +168,20 @@ export default class Tooltip extends BaseComponent {
|
|
|
168
168
|
willEnter: this.willEnter,
|
|
169
169
|
didLeave: this.didLeave,
|
|
170
170
|
motion: motion
|
|
171
|
-
}, transitionState === 'enter' ?
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
"x-placement": placement
|
|
186
|
-
}), content, icon);
|
|
187
|
-
} : null) : /*#__PURE__*/React.createElement("div", _Object$assign({
|
|
171
|
+
}, transitionState === 'enter' ? ({
|
|
172
|
+
animateCls,
|
|
173
|
+
animateStyle,
|
|
174
|
+
animateEvents
|
|
175
|
+
}) => /*#__PURE__*/React.createElement("div", _Object$assign({
|
|
176
|
+
className: classNames(className, animateCls),
|
|
177
|
+
style: _Object$assign(_Object$assign(_Object$assign({
|
|
178
|
+
visibility: 'visible'
|
|
179
|
+
}, animateStyle), {
|
|
180
|
+
transformOrigin
|
|
181
|
+
}), style)
|
|
182
|
+
}, portalEventSet, animateEvents, {
|
|
183
|
+
"x-placement": placement
|
|
184
|
+
}), content, icon) : null) : /*#__PURE__*/React.createElement("div", _Object$assign({
|
|
188
185
|
className: className
|
|
189
186
|
}, portalEventSet, {
|
|
190
187
|
"x-placement": placement,
|
|
@@ -227,11 +224,11 @@ export default class Tooltip extends BaseComponent {
|
|
|
227
224
|
const mergedEvents = {};
|
|
228
225
|
each(events, (handler, key) => {
|
|
229
226
|
if (typeof handler === 'function') {
|
|
230
|
-
mergedEvents[key] =
|
|
231
|
-
handler(...
|
|
227
|
+
mergedEvents[key] = (...args) => {
|
|
228
|
+
handler(...args);
|
|
232
229
|
|
|
233
230
|
if (rawEvents && typeof rawEvents[key] === 'function') {
|
|
234
|
-
rawEvents[key](...
|
|
231
|
+
rawEvents[key](...args);
|
|
235
232
|
}
|
|
236
233
|
};
|
|
237
234
|
}
|
|
@@ -267,19 +264,13 @@ export default class Tooltip extends BaseComponent {
|
|
|
267
264
|
}
|
|
268
265
|
|
|
269
266
|
get adapter() {
|
|
270
|
-
var _this = this;
|
|
271
|
-
|
|
272
267
|
return _Object$assign(_Object$assign({}, super.adapter), {
|
|
273
268
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
274
269
|
// @ts-ignore
|
|
275
|
-
on:
|
|
276
|
-
return _this.eventManager.on(...arguments);
|
|
277
|
-
},
|
|
270
|
+
on: (...args) => this.eventManager.on(...args),
|
|
278
271
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
279
272
|
// @ts-ignore
|
|
280
|
-
off:
|
|
281
|
-
return _this.eventManager.off(...arguments);
|
|
282
|
-
},
|
|
273
|
+
off: (...args) => this.eventManager.off(...args),
|
|
283
274
|
insertPortal: (content, _a) => {
|
|
284
275
|
var {
|
|
285
276
|
position
|
|
@@ -423,6 +414,7 @@ export default class Tooltip extends BaseComponent {
|
|
|
423
414
|
popupEl = ReactDOM.findDOMNode(popupEl);
|
|
424
415
|
|
|
425
416
|
if (el && !el.contains(e.target) && popupEl && !popupEl.contains(e.target) || this.props.clickTriggerToHide) {
|
|
417
|
+
this.props.onClickOutSide(e);
|
|
426
418
|
cb();
|
|
427
419
|
}
|
|
428
420
|
};
|
|
@@ -621,6 +613,7 @@ Tooltip.propTypes = {
|
|
|
621
613
|
content: PropTypes.node,
|
|
622
614
|
prefixCls: PropTypes.string,
|
|
623
615
|
onVisibleChange: PropTypes.func,
|
|
616
|
+
onClickOutSide: PropTypes.func,
|
|
624
617
|
spacing: PropTypes.number,
|
|
625
618
|
showArrow: PropTypes.oneOfType([PropTypes.bool, PropTypes.node]),
|
|
626
619
|
zIndex: PropTypes.number,
|
|
@@ -646,6 +639,7 @@ Tooltip.defaultProps = {
|
|
|
646
639
|
mouseEnterDelay: numbers.MOUSE_ENTER_DELAY,
|
|
647
640
|
mouseLeaveDelay: numbers.MOUSE_LEAVE_DELAY,
|
|
648
641
|
onVisibleChange: noop,
|
|
642
|
+
onClickOutSide: noop,
|
|
649
643
|
spacing: numbers.SPACING,
|
|
650
644
|
showArrow: true,
|
|
651
645
|
arrowBounding: numbers.ARROW_BOUNDING
|
package/lib/es/transfer/index.js
CHANGED
|
@@ -462,24 +462,21 @@ class Transfer extends BaseComponent {
|
|
|
462
462
|
renderRightSortableList(selectedData) {
|
|
463
463
|
// when choose some items && draggable is true
|
|
464
464
|
const SortableItem = SortableElement(item => this.renderRightItem(item));
|
|
465
|
-
const SortableList = SortableContainer(
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
// @ts-ignore see reasons: https://github.com/clauderic/react-sortable-hoc/issues/206
|
|
481
|
-
;
|
|
482
|
-
}, {
|
|
465
|
+
const SortableList = SortableContainer(({
|
|
466
|
+
items
|
|
467
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
468
|
+
className: "".concat(prefixcls, "-right-list")
|
|
469
|
+
}, _mapInstanceProperty(items).call(items, (item, index) =>
|
|
470
|
+
/*#__PURE__*/
|
|
471
|
+
// sortableElement will take over the property 'key', so use another '_optionKey' to pass
|
|
472
|
+
React.createElement(SortableItem, _Object$assign({
|
|
473
|
+
key: item.label,
|
|
474
|
+
index: index
|
|
475
|
+
}, item, {
|
|
476
|
+
_optionKey: item.key
|
|
477
|
+
})))) // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
478
|
+
// @ts-ignore see reasons: https://github.com/clauderic/react-sortable-hoc/issues/206
|
|
479
|
+
, {
|
|
483
480
|
distance: 10
|
|
484
481
|
});
|
|
485
482
|
const sortList = /*#__PURE__*/React.createElement(SortableList, {
|
package/lib/es/tree/index.js
CHANGED
|
@@ -61,13 +61,10 @@ class Tree extends BaseComponent {
|
|
|
61
61
|
|
|
62
62
|
this.onNodeLoad = data => new _Promise(resolve => {
|
|
63
63
|
// We need to get the latest state of loading/loaded keys
|
|
64
|
-
this.setState(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
} = _ref;
|
|
69
|
-
return this.foundation.handleNodeLoad(loadedKeys, loadingKeys, data, resolve);
|
|
70
|
-
});
|
|
64
|
+
this.setState(({
|
|
65
|
+
loadedKeys = new _Set([]),
|
|
66
|
+
loadingKeys = new _Set([])
|
|
67
|
+
}) => this.foundation.handleNodeLoad(loadedKeys, loadingKeys, data, resolve));
|
|
71
68
|
});
|
|
72
69
|
|
|
73
70
|
this.onNodeCheck = (e, treeNode) => {
|
|
@@ -423,11 +420,10 @@ class Tree extends BaseComponent {
|
|
|
423
420
|
updateState: states => {
|
|
424
421
|
this.setState(_Object$assign({}, states));
|
|
425
422
|
},
|
|
426
|
-
notifyExpand: (expandedKeys,
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
} = _ref2;
|
|
423
|
+
notifyExpand: (expandedKeys, {
|
|
424
|
+
expanded: bool,
|
|
425
|
+
node
|
|
426
|
+
}) => {
|
|
431
427
|
this.props.onExpand && this.props.onExpand([...expandedKeys], {
|
|
432
428
|
expanded: bool,
|
|
433
429
|
node
|
|
@@ -536,36 +532,30 @@ class Tree extends BaseComponent {
|
|
|
536
532
|
});
|
|
537
533
|
}
|
|
538
534
|
|
|
539
|
-
const option =
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
} = _ref3;
|
|
545
|
-
return this.renderTreeNode(data[index], index, style);
|
|
546
|
-
};
|
|
535
|
+
const option = ({
|
|
536
|
+
index,
|
|
537
|
+
style,
|
|
538
|
+
data
|
|
539
|
+
}) => this.renderTreeNode(data[index], index, style);
|
|
547
540
|
|
|
548
541
|
return /*#__PURE__*/React.createElement(AutoSizer, {
|
|
549
542
|
defaultHeight: virtualize.height,
|
|
550
543
|
defaultWidth: virtualize.width
|
|
551
|
-
},
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
}
|
|
567
|
-
}, option);
|
|
568
|
-
});
|
|
544
|
+
}, ({
|
|
545
|
+
height,
|
|
546
|
+
width
|
|
547
|
+
}) => /*#__PURE__*/React.createElement(VirtualList, {
|
|
548
|
+
itemCount: flattenNodes.length,
|
|
549
|
+
itemSize: virtualize.itemSize,
|
|
550
|
+
height: height,
|
|
551
|
+
width: width,
|
|
552
|
+
itemKey: this.itemKey,
|
|
553
|
+
itemData: flattenNodes,
|
|
554
|
+
className: "".concat(prefixcls, "-virtual-list"),
|
|
555
|
+
style: {
|
|
556
|
+
direction
|
|
557
|
+
}
|
|
558
|
+
}, option));
|
|
569
559
|
}
|
|
570
560
|
|
|
571
561
|
render() {
|
|
@@ -22,7 +22,7 @@ export interface OnDragProps extends BasicOnDragProps {
|
|
|
22
22
|
export interface DragEnterProps extends DragProps {
|
|
23
23
|
expandedKeys?: string[];
|
|
24
24
|
}
|
|
25
|
-
export interface
|
|
25
|
+
export interface ExpandedOtherProps extends BasicExpandedOtherProps {
|
|
26
26
|
node: TreeNodeData;
|
|
27
27
|
}
|
|
28
28
|
export interface RenderFullLabelProps extends BasicRenderFullLabelProps {
|
|
@@ -57,7 +57,7 @@ export interface TreeProps extends BasicTreeProps {
|
|
|
57
57
|
onDragStart?: (dragProps: DragProps) => void;
|
|
58
58
|
onDragEnter?: (dragEnterProps: DragEnterProps) => void;
|
|
59
59
|
onDrop?: (onDragProps: OnDragProps) => void;
|
|
60
|
-
onExpand?: (expandedKeys: string[],
|
|
60
|
+
onExpand?: (expandedKeys: string[], expandedOtherProps: ExpandedOtherProps) => void;
|
|
61
61
|
onLoad?: (loadedKeys?: Set<string>, treeNode?: TreeNodeData) => void;
|
|
62
62
|
onContextMenu?: (e: MouseEvent, node: TreeNodeData) => void;
|
|
63
63
|
onSelect?: (selectedKeys: string, selected: boolean, selectedNode: TreeNodeData) => void;
|
|
@@ -27,16 +27,7 @@ export declare type RenderSelectedItemInMultiple = (treeNode: TreeNodeData, othe
|
|
|
27
27
|
isRenderInTag: boolean;
|
|
28
28
|
content: React.ReactNode;
|
|
29
29
|
};
|
|
30
|
-
export
|
|
31
|
-
(treeNode: TreeNodeData): React.ReactNode;
|
|
32
|
-
(treeNode: TreeNodeData, otherProps: {
|
|
33
|
-
index: number | string;
|
|
34
|
-
onClose: (tagContent: any, e: React.MouseEvent) => void;
|
|
35
|
-
}): {
|
|
36
|
-
isRenderInTag: boolean;
|
|
37
|
-
content: React.ReactNode;
|
|
38
|
-
};
|
|
39
|
-
}
|
|
30
|
+
export declare type RenderSelectedItem = RenderSelectedItemInSingle | RenderSelectedItemInMultiple;
|
|
40
31
|
export declare type OverrideCommonProps = 'renderFullLabel' | 'renderLabel' | 'defaultValue' | 'emptyContent' | 'filterTreeNode' | 'style' | 'treeData' | 'value' | 'onExpand';
|
|
41
32
|
/**
|
|
42
33
|
* Type definition description:
|
|
@@ -205,7 +196,7 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
|
|
|
205
196
|
renderArrow: () => JSX.Element;
|
|
206
197
|
renderClearBtn: () => JSX.Element;
|
|
207
198
|
renderSelection: () => JSX.Element;
|
|
208
|
-
renderTagItem: (key: string, idx: number) =>
|
|
199
|
+
renderTagItem: (key: string, idx: number) => React.ReactNode;
|
|
209
200
|
renderTagInput: () => JSX.Element;
|
|
210
201
|
renderInput: () => JSX.Element;
|
|
211
202
|
renderEmpty: () => JSX.Element;
|
|
@@ -687,36 +687,30 @@ class TreeSelect extends BaseComponent {
|
|
|
687
687
|
});
|
|
688
688
|
}
|
|
689
689
|
|
|
690
|
-
const option =
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
} = _ref;
|
|
696
|
-
return this.renderTreeNode(data[index], index, style);
|
|
697
|
-
};
|
|
690
|
+
const option = ({
|
|
691
|
+
index,
|
|
692
|
+
style,
|
|
693
|
+
data
|
|
694
|
+
}) => this.renderTreeNode(data[index], index, style);
|
|
698
695
|
|
|
699
696
|
return /*#__PURE__*/React.createElement(AutoSizer, {
|
|
700
697
|
defaultHeight: virtualize.height,
|
|
701
698
|
defaultWidth: virtualize.width
|
|
702
|
-
},
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
}
|
|
718
|
-
}, option);
|
|
719
|
-
});
|
|
699
|
+
}, ({
|
|
700
|
+
height,
|
|
701
|
+
width
|
|
702
|
+
}) => /*#__PURE__*/React.createElement(VirtualList, {
|
|
703
|
+
itemCount: flattenNodes.length,
|
|
704
|
+
itemSize: virtualize.itemSize,
|
|
705
|
+
height: height,
|
|
706
|
+
width: width,
|
|
707
|
+
itemKey: this.itemKey,
|
|
708
|
+
itemData: flattenNodes,
|
|
709
|
+
className: "".concat(prefixTree, "-virtual-list"),
|
|
710
|
+
style: {
|
|
711
|
+
direction
|
|
712
|
+
}
|
|
713
|
+
}, option));
|
|
720
714
|
};
|
|
721
715
|
|
|
722
716
|
this.renderTree = () => {
|
|
@@ -939,8 +933,6 @@ class TreeSelect extends BaseComponent {
|
|
|
939
933
|
}
|
|
940
934
|
|
|
941
935
|
get adapter() {
|
|
942
|
-
var _this = this;
|
|
943
|
-
|
|
944
936
|
const filterAdapter = {
|
|
945
937
|
updateInputValue: value => {
|
|
946
938
|
this.setState({
|
|
@@ -1001,13 +993,10 @@ class TreeSelect extends BaseComponent {
|
|
|
1001
993
|
};
|
|
1002
994
|
return _Object$assign(_Object$assign(_Object$assign(_Object$assign(_Object$assign({}, super.adapter), filterAdapter), treeSelectAdapter), treeAdapter), {
|
|
1003
995
|
updateLoadKeys: (data, resolve) => {
|
|
1004
|
-
this.setState(
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
} = _ref3;
|
|
1009
|
-
return this.foundation.handleNodeLoad(loadedKeys, loadingKeys, data, resolve);
|
|
1010
|
-
});
|
|
996
|
+
this.setState(({
|
|
997
|
+
loadedKeys,
|
|
998
|
+
loadingKeys
|
|
999
|
+
}) => this.foundation.handleNodeLoad(loadedKeys, loadingKeys, data, resolve));
|
|
1011
1000
|
},
|
|
1012
1001
|
updateState: states => {
|
|
1013
1002
|
this.setState(_Object$assign({}, states));
|
|
@@ -1042,11 +1031,10 @@ class TreeSelect extends BaseComponent {
|
|
|
1042
1031
|
notifyChangeWithObject: (node, e) => {
|
|
1043
1032
|
this.props.onChange && this.props.onChange(node, e);
|
|
1044
1033
|
},
|
|
1045
|
-
notifyExpand: (expandedKeys,
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
} = _ref4;
|
|
1034
|
+
notifyExpand: (expandedKeys, {
|
|
1035
|
+
expanded: bool,
|
|
1036
|
+
node
|
|
1037
|
+
}) => {
|
|
1050
1038
|
this.props.onExpand && this.props.onExpand([...expandedKeys], {
|
|
1051
1039
|
expanded: bool,
|
|
1052
1040
|
node
|
|
@@ -1056,11 +1044,11 @@ class TreeSelect extends BaseComponent {
|
|
|
1056
1044
|
this.onNodeLoad(node);
|
|
1057
1045
|
}
|
|
1058
1046
|
},
|
|
1059
|
-
notifyFocus:
|
|
1060
|
-
|
|
1047
|
+
notifyFocus: (...v) => {
|
|
1048
|
+
this.props.onFocus && this.props.onFocus(...v);
|
|
1061
1049
|
},
|
|
1062
|
-
notifyBlur:
|
|
1063
|
-
|
|
1050
|
+
notifyBlur: (...v) => {
|
|
1051
|
+
this.props.onBlur && this.props.onBlur(...v);
|
|
1064
1052
|
},
|
|
1065
1053
|
toggleHovering: bool => {
|
|
1066
1054
|
this.setState({
|
|
@@ -37,7 +37,7 @@ export default class Title extends PureComponent<TitleProps> {
|
|
|
37
37
|
underline: PropTypes.Requireable<boolean>;
|
|
38
38
|
strong: PropTypes.Requireable<boolean>;
|
|
39
39
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
40
|
-
heading: PropTypes.Requireable<
|
|
40
|
+
heading: PropTypes.Requireable<4 | 2 | 1 | 3 | 5 | 6>;
|
|
41
41
|
style: PropTypes.Requireable<object>;
|
|
42
42
|
className: PropTypes.Requireable<string>;
|
|
43
43
|
component: PropTypes.Requireable<string>;
|
|
@@ -34,14 +34,8 @@ function styleToString(style) {
|
|
|
34
34
|
}).join('');
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
const getRenderText =
|
|
38
|
-
|
|
39
|
-
let fixedContent = arguments.length > 3 ? arguments[3] : undefined;
|
|
40
|
-
let ellipsisStr = arguments.length > 4 ? arguments[4] : undefined;
|
|
41
|
-
let suffix = arguments.length > 5 ? arguments[5] : undefined;
|
|
42
|
-
let ellipsisPos // eslint-disable-next-line max-params
|
|
43
|
-
= arguments.length > 6 ? arguments[6] : undefined;
|
|
44
|
-
|
|
37
|
+
const getRenderText = (originEle, rows, content = '', fixedContent, ellipsisStr, suffix, ellipsisPos // eslint-disable-next-line max-params
|
|
38
|
+
) => {
|
|
45
39
|
if (!ellipsisContainer) {
|
|
46
40
|
ellipsisContainer = document.createElement('div');
|
|
47
41
|
ellipsisContainer.setAttribute('aria-hidden', 'true');
|
|
@@ -101,10 +95,7 @@ const getRenderText = function (originEle, rows) {
|
|
|
101
95
|
} // Get maximum text
|
|
102
96
|
|
|
103
97
|
|
|
104
|
-
function measureText(textNode, fullText) {
|
|
105
|
-
let startLoc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
106
|
-
let endLoc = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : fullText.length;
|
|
107
|
-
let lastSuccessLoc = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
98
|
+
function measureText(textNode, fullText, startLoc = 0, endLoc = fullText.length, lastSuccessLoc = 0) {
|
|
108
99
|
const midLoc = Math.floor((startLoc + endLoc) / 2);
|
|
109
100
|
const currentText = getCurrentText(fullText, midLoc);
|
|
110
101
|
textNode.textContent = currentText; // console.log('calculating....', currentText);
|
|
@@ -13,70 +13,61 @@ import { isElement } from '../_base/reactUtils';
|
|
|
13
13
|
import { IconAlertCircle, IconClose, IconFile, IconRefresh } from '@douyinfe/semi-icons';
|
|
14
14
|
const prefixCls = cssClasses.PREFIX;
|
|
15
15
|
|
|
16
|
-
const ErrorSvg =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
fill: "#F93920"
|
|
34
|
-
}));
|
|
35
|
-
};
|
|
16
|
+
const ErrorSvg = (props = {}) => /*#__PURE__*/React.createElement("svg", _Object$assign({
|
|
17
|
+
width: "16",
|
|
18
|
+
height: "16",
|
|
19
|
+
viewBox: "0 0 16 16",
|
|
20
|
+
fill: "none",
|
|
21
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
22
|
+
}, props), /*#__PURE__*/React.createElement("circle", {
|
|
23
|
+
cx: "7.99992",
|
|
24
|
+
cy: "7.99992",
|
|
25
|
+
r: "6.66667",
|
|
26
|
+
fill: "white"
|
|
27
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
28
|
+
fillRule: "evenodd",
|
|
29
|
+
clipRule: "evenodd",
|
|
30
|
+
d: "M15.3332 8.00008C15.3332 12.0502 12.0499 15.3334 7.99984 15.3334C3.94975 15.3334 0.666504 12.0502 0.666504 8.00008C0.666504 3.94999 3.94975 0.666748 7.99984 0.666748C12.0499 0.666748 15.3332 3.94999 15.3332 8.00008ZM8.99984 11.6667C8.99984 11.1145 8.55212 10.6667 7.99984 10.6667C7.44755 10.6667 6.99984 11.1145 6.99984 11.6667C6.99984 12.219 7.44755 12.6667 7.99984 12.6667C8.55212 12.6667 8.99984 12.219 8.99984 11.6667ZM7.99984 3.33341C7.27573 3.33341 6.7003 3.94171 6.74046 4.66469L6.94437 8.33495C6.97549 8.89513 7.4388 9.33341 7.99984 9.33341C8.56087 9.33341 9.02419 8.89513 9.05531 8.33495L9.25921 4.66469C9.29938 3.94171 8.72394 3.33341 7.99984 3.33341Z",
|
|
31
|
+
fill: "#F93920"
|
|
32
|
+
}));
|
|
36
33
|
|
|
37
|
-
const ReplaceSvg =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
strokeLinejoin: "round"
|
|
61
|
-
}));
|
|
62
|
-
};
|
|
34
|
+
const ReplaceSvg = (props = {}) => /*#__PURE__*/React.createElement("svg", _Object$assign({
|
|
35
|
+
width: "28",
|
|
36
|
+
height: "28",
|
|
37
|
+
viewBox: "0 0 28 28",
|
|
38
|
+
fill: "none",
|
|
39
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
40
|
+
}, props), /*#__PURE__*/React.createElement("circle", {
|
|
41
|
+
cx: "14",
|
|
42
|
+
cy: "14",
|
|
43
|
+
r: "14",
|
|
44
|
+
fill: "#16161A",
|
|
45
|
+
fillOpacity: "0.6"
|
|
46
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
47
|
+
d: "M9 10.25V18.25L10.25 13.25H17.875V11.75C17.875 11.4739 17.6511 11.25 17.375 11.25H14L12.75 9.75H9.5C9.22386 9.75 9 9.97386 9 10.25Z",
|
|
48
|
+
stroke: "currentColor",
|
|
49
|
+
strokeLinecap: "round",
|
|
50
|
+
strokeLinejoin: "round"
|
|
51
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
52
|
+
d: "M18 18.25L19 13.25H10.2031L9 18.25H18Z",
|
|
53
|
+
stroke: "currentColor",
|
|
54
|
+
strokeLinecap: "round",
|
|
55
|
+
strokeLinejoin: "round"
|
|
56
|
+
}));
|
|
63
57
|
|
|
64
|
-
const DirectorySvg =
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
strokeLinejoin: "round"
|
|
78
|
-
}));
|
|
79
|
-
};
|
|
58
|
+
const DirectorySvg = (props = {}) => /*#__PURE__*/React.createElement("svg", _Object$assign({
|
|
59
|
+
width: "24",
|
|
60
|
+
height: "24",
|
|
61
|
+
viewBox: "0 0 24 24",
|
|
62
|
+
fill: "none",
|
|
63
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
64
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
65
|
+
d: "M6 17V7.58824C6 7.26336 6.26863 7 6.6 7H10.5L12 8.76471H16.05C16.3814 8.76471 16.65 9.02806 16.65 9.35294V11.1176H7.5L6 17ZM6 17L7.44375 11.1176H18L16.8 17L6 17Z",
|
|
66
|
+
stroke: "currentColor",
|
|
67
|
+
strokeWidth: "1.5",
|
|
68
|
+
strokeLinecap: "round",
|
|
69
|
+
strokeLinejoin: "round"
|
|
70
|
+
}));
|
|
80
71
|
|
|
81
72
|
class FileCard extends PureComponent {
|
|
82
73
|
transSize(size) {
|
package/lib/es/upload/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import BaseComponent, { ValidateStatus } 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/es/upload/upload.css';
|
|
9
|
-
export { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError };
|
|
9
|
+
export { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError, BeforeUploadObjectResult, AfterUploadResult };
|
|
10
10
|
export interface UploadProps {
|
|
11
11
|
accept?: string;
|
|
12
12
|
action: string;
|
package/lib/es/upload/index.js
CHANGED
|
@@ -302,28 +302,22 @@ class Upload extends BaseComponent {
|
|
|
302
302
|
});
|
|
303
303
|
}
|
|
304
304
|
},
|
|
305
|
-
notifyBeforeUpload:
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
return this.props.afterUpload({
|
|
322
|
-
response,
|
|
323
|
-
file,
|
|
324
|
-
fileList
|
|
325
|
-
});
|
|
326
|
-
},
|
|
305
|
+
notifyBeforeUpload: ({
|
|
306
|
+
file,
|
|
307
|
+
fileList
|
|
308
|
+
}) => this.props.beforeUpload({
|
|
309
|
+
file,
|
|
310
|
+
fileList
|
|
311
|
+
}),
|
|
312
|
+
notifyAfterUpload: ({
|
|
313
|
+
response,
|
|
314
|
+
file,
|
|
315
|
+
fileList
|
|
316
|
+
}) => this.props.afterUpload({
|
|
317
|
+
response,
|
|
318
|
+
file,
|
|
319
|
+
fileList
|
|
320
|
+
}),
|
|
327
321
|
resetInput: () => {
|
|
328
322
|
this.setState(prevState => ({
|
|
329
323
|
inputKey: Math.random()
|
|
@@ -337,16 +331,13 @@ class Upload extends BaseComponent {
|
|
|
337
331
|
updateDragAreaStatus: dragAreaStatus => this.setState({
|
|
338
332
|
dragAreaStatus
|
|
339
333
|
}),
|
|
340
|
-
notifyChange:
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
fileList
|
|
348
|
-
});
|
|
349
|
-
},
|
|
334
|
+
notifyChange: ({
|
|
335
|
+
currentFile,
|
|
336
|
+
fileList
|
|
337
|
+
}) => this.props.onChange({
|
|
338
|
+
currentFile,
|
|
339
|
+
fileList
|
|
340
|
+
}),
|
|
350
341
|
updateLocalUrls: urls => this.setState({
|
|
351
342
|
localUrls: urls
|
|
352
343
|
}),
|