@douyinfe/semi-ui 2.53.3 → 2.54.0-alpha.1
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 +29 -20
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +201 -67
- 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/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/cascader/index.d.ts +3 -0
- package/lib/cjs/cascader/index.js +11 -4
- package/lib/cjs/collapsible/index.d.ts +1 -0
- package/lib/cjs/collapsible/index.js +4 -3
- package/lib/cjs/datePicker/datePicker.d.ts +2 -2
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
- package/lib/cjs/datePicker/quickControl.d.ts +1 -1
- package/lib/cjs/datePicker/yearAndMonth.d.ts +1 -1
- package/lib/cjs/descriptions/descriptions-context.d.ts +2 -0
- package/lib/cjs/descriptions/index.d.ts +17 -4
- package/lib/cjs/descriptions/index.js +52 -16
- package/lib/cjs/descriptions/item.d.ts +1 -0
- package/lib/cjs/descriptions/item.js +20 -13
- package/lib/cjs/dropdown/index.d.ts +1 -1
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/image/interface.d.ts +1 -0
- package/lib/cjs/image/previewInner.js +6 -0
- package/lib/cjs/modal/Modal.d.ts +4 -4
- package/lib/cjs/modal/Modal.js +12 -11
- package/lib/cjs/modal/confirm.d.ts +100 -100
- package/lib/cjs/overflowList/index.d.ts +1 -1
- 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/slider/index.js +4 -2
- 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/toast/index.js +3 -0
- package/lib/cjs/tooltip/index.d.ts +1 -1
- package/lib/cjs/typography/base.js +6 -4
- package/lib/cjs/upload/index.d.ts +3 -3
- 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/cascader/index.d.ts +3 -0
- package/lib/es/cascader/index.js +11 -4
- package/lib/es/collapsible/index.d.ts +1 -0
- package/lib/es/collapsible/index.js +4 -3
- package/lib/es/datePicker/datePicker.d.ts +2 -2
- package/lib/es/datePicker/monthsGrid.d.ts +1 -1
- package/lib/es/datePicker/quickControl.d.ts +1 -1
- package/lib/es/datePicker/yearAndMonth.d.ts +1 -1
- package/lib/es/descriptions/descriptions-context.d.ts +2 -0
- package/lib/es/descriptions/index.d.ts +17 -4
- package/lib/es/descriptions/index.js +52 -14
- package/lib/es/descriptions/item.d.ts +1 -0
- package/lib/es/descriptions/item.js +20 -13
- package/lib/es/dropdown/index.d.ts +1 -1
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/image/interface.d.ts +1 -0
- package/lib/es/image/previewInner.js +6 -0
- package/lib/es/modal/Modal.d.ts +4 -4
- package/lib/es/modal/Modal.js +12 -11
- package/lib/es/modal/confirm.d.ts +100 -100
- package/lib/es/overflowList/index.d.ts +1 -1
- 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/slider/index.js +4 -2
- 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/toast/index.js +3 -0
- package/lib/es/tooltip/index.d.ts +1 -1
- package/lib/es/typography/base.js +6 -4
- package/lib/es/upload/index.d.ts +3 -3
- package/package.json +8 -8
package/dist/umd/semi-ui.js
CHANGED
|
@@ -22975,7 +22975,9 @@ class Base extends external_root_React_commonjs2_react_commonjs_react_amd_react_
|
|
|
22975
22975
|
expandable,
|
|
22976
22976
|
expandText
|
|
22977
22977
|
} = this.getEllipsisOpt();
|
|
22978
|
-
const
|
|
22978
|
+
const canUseCSSEllipsis = this.canUseCSSEllipsis();
|
|
22979
|
+
// If the css is truncated, use isOverflowed to judge. If the css is truncated, use isTruncated to judge.
|
|
22980
|
+
const overflowed = !expanded && (canUseCSSEllipsis ? isOverflowed : isTruncated);
|
|
22979
22981
|
const noExpandText = !expandable && isUndefined_default()(expandText);
|
|
22980
22982
|
const show = noExpandText && overflowed && showTooltip;
|
|
22981
22983
|
if (!show) {
|
|
@@ -23257,11 +23259,11 @@ class Base extends external_root_React_commonjs2_react_commonjs_react_amd_react_
|
|
|
23257
23259
|
copied: false,
|
|
23258
23260
|
// ellipsis
|
|
23259
23261
|
// if text is overflow in container
|
|
23260
|
-
isOverflowed:
|
|
23262
|
+
isOverflowed: false,
|
|
23261
23263
|
ellipsisContent: props.children,
|
|
23262
23264
|
expanded: false,
|
|
23263
23265
|
// if text is truncated with js
|
|
23264
|
-
isTruncated:
|
|
23266
|
+
isTruncated: false,
|
|
23265
23267
|
prevChildren: null
|
|
23266
23268
|
};
|
|
23267
23269
|
this.wrapperRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();
|
|
@@ -23282,7 +23284,7 @@ class Base extends external_root_React_commonjs2_react_commonjs_react_amd_react_
|
|
|
23282
23284
|
newState.prevChildren = props.children;
|
|
23283
23285
|
if (props.ellipsis && prevChildren !== props.children) {
|
|
23284
23286
|
// reset ellipsis state if children update
|
|
23285
|
-
newState.isOverflowed =
|
|
23287
|
+
newState.isOverflowed = false;
|
|
23286
23288
|
newState.ellipsisContent = props.children;
|
|
23287
23289
|
newState.expanded = false;
|
|
23288
23290
|
newState.isTruncated = true;
|
|
@@ -36386,7 +36388,9 @@ const cascader_constants_strings = {
|
|
|
36386
36388
|
/* Merge Type */
|
|
36387
36389
|
LEAF_ONLY_MERGE_TYPE: 'leafOnly',
|
|
36388
36390
|
AUTO_MERGE_VALUE_MERGE_TYPE: 'autoMergeValue',
|
|
36389
|
-
NONE_MERGE_TYPE: 'none'
|
|
36391
|
+
NONE_MERGE_TYPE: 'none',
|
|
36392
|
+
SEARCH_POSITION_TRIGGER: 'trigger',
|
|
36393
|
+
SEARCH_POSITION_CUSTOM: 'custom'
|
|
36390
36394
|
};
|
|
36391
36395
|
const cascader_constants_numbers = {};
|
|
36392
36396
|
|
|
@@ -47047,6 +47051,10 @@ const resetkey = 0;
|
|
|
47047
47051
|
class Cascader extends BaseComponent {
|
|
47048
47052
|
constructor(props) {
|
|
47049
47053
|
super(props);
|
|
47054
|
+
// ref method
|
|
47055
|
+
this.search = value => {
|
|
47056
|
+
this.handleInputChange(value);
|
|
47057
|
+
};
|
|
47050
47058
|
this.handleInputChange = value => {
|
|
47051
47059
|
this.foundation.handleInputChange(value);
|
|
47052
47060
|
};
|
|
@@ -47233,12 +47241,13 @@ class Cascader extends BaseComponent {
|
|
|
47233
47241
|
const {
|
|
47234
47242
|
placeholder,
|
|
47235
47243
|
filterTreeNode,
|
|
47236
|
-
multiple
|
|
47244
|
+
multiple,
|
|
47245
|
+
searchPosition
|
|
47237
47246
|
} = this.props;
|
|
47238
47247
|
const {
|
|
47239
47248
|
checkedKeys
|
|
47240
47249
|
} = this.state;
|
|
47241
|
-
const searchable = Boolean(filterTreeNode);
|
|
47250
|
+
const searchable = Boolean(filterTreeNode) && searchPosition === cascader_constants_strings.SEARCH_POSITION_TRIGGER;
|
|
47242
47251
|
if (!searchable) {
|
|
47243
47252
|
if (multiple) {
|
|
47244
47253
|
if (checkedKeys.size === 0) {
|
|
@@ -47998,7 +48007,8 @@ Cascader.propTypes = {
|
|
|
47998
48007
|
leafOnly: (prop_types_default()).bool,
|
|
47999
48008
|
enableLeafClick: (prop_types_default()).bool,
|
|
48000
48009
|
preventScroll: (prop_types_default()).bool,
|
|
48001
|
-
position: (prop_types_default()).string
|
|
48010
|
+
position: (prop_types_default()).string,
|
|
48011
|
+
searchPosition: (prop_types_default()).string
|
|
48002
48012
|
};
|
|
48003
48013
|
Cascader.defaultProps = getDefaultPropsFromGlobalConfig(Cascader.__SemiComponentName__, {
|
|
48004
48014
|
borderless: false,
|
|
@@ -48029,7 +48039,8 @@ Cascader.defaultProps = getDefaultPropsFromGlobalConfig(Cascader.__SemiComponent
|
|
|
48029
48039
|
onDropdownVisibleChange: (noop_default()),
|
|
48030
48040
|
onListScroll: (noop_default()),
|
|
48031
48041
|
enableLeafClick: false,
|
|
48032
|
-
'aria-label': 'Cascader'
|
|
48042
|
+
'aria-label': 'Cascader',
|
|
48043
|
+
searchPosition: cascader_constants_strings.SEARCH_POSITION_TRIGGER
|
|
48033
48044
|
});
|
|
48034
48045
|
/* harmony default export */ const cascader_0 = (Cascader);
|
|
48035
48046
|
;// CONCATENATED MODULE: ../semi-foundation/collapse/constants.ts
|
|
@@ -48142,9 +48153,8 @@ class Collapsible extends BaseComponent {
|
|
|
48142
48153
|
this.isChildrenInRenderTree = () => {
|
|
48143
48154
|
if (this.domRef.current) {
|
|
48144
48155
|
return this.domRef.current.offsetHeight > 0;
|
|
48145
|
-
} else {
|
|
48146
|
-
return false;
|
|
48147
48156
|
}
|
|
48157
|
+
return false;
|
|
48148
48158
|
};
|
|
48149
48159
|
this.state = {
|
|
48150
48160
|
domInRenderTree: false,
|
|
@@ -48228,6 +48238,7 @@ class Collapsible extends BaseComponent {
|
|
|
48228
48238
|
const wrapperCls = classnames_default()(`${collapsible_constants_cssClasses.PREFIX}-wrapper`, {
|
|
48229
48239
|
[`${collapsible_constants_cssClasses.PREFIX}-transition`]: this.props.motion && this.state.isTransitioning
|
|
48230
48240
|
}, this.props.className);
|
|
48241
|
+
const shouldRender = this.props.keepDOM && !this.props.lazyRender || this.props.collapseHeight !== 0 || this.state.visible || this.props.isOpen;
|
|
48231
48242
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", Object.assign({
|
|
48232
48243
|
className: wrapperCls,
|
|
48233
48244
|
style: wrapperStyle,
|
|
@@ -48246,7 +48257,7 @@ class Collapsible extends BaseComponent {
|
|
|
48246
48257
|
overflow: 'hidden'
|
|
48247
48258
|
},
|
|
48248
48259
|
id: this.props.id
|
|
48249
|
-
},
|
|
48260
|
+
}, shouldRender && this.props.children));
|
|
48250
48261
|
}
|
|
48251
48262
|
}
|
|
48252
48263
|
Collapsible.__SemiComponentName__ = "Collapsible";
|
|
@@ -48255,6 +48266,7 @@ Collapsible.defaultProps = getDefaultPropsFromGlobalConfig(Collapsible.__SemiCom
|
|
|
48255
48266
|
duration: 250,
|
|
48256
48267
|
motion: true,
|
|
48257
48268
|
keepDOM: false,
|
|
48269
|
+
lazyRender: true,
|
|
48258
48270
|
collapseHeight: 0,
|
|
48259
48271
|
fade: false
|
|
48260
48272
|
});
|
|
@@ -60768,7 +60780,8 @@ const descriptions_constants_cssClasses = {
|
|
|
60768
60780
|
};
|
|
60769
60781
|
const descriptions_constants_strings = {
|
|
60770
60782
|
ALIGN_SET: ['left', 'justify', 'plain', 'center'],
|
|
60771
|
-
SIZE_SET: ['small', 'medium', 'large']
|
|
60783
|
+
SIZE_SET: ['small', 'medium', 'large'],
|
|
60784
|
+
LAYOUT_SET: ['horizontal', 'vertical']
|
|
60772
60785
|
};
|
|
60773
60786
|
const descriptions_constants_numbers = {};
|
|
60774
60787
|
|
|
@@ -60803,38 +60816,45 @@ class item_Item extends external_root_React_commonjs2_react_commonjs_react_amd_r
|
|
|
60803
60816
|
itemKey,
|
|
60804
60817
|
hidden,
|
|
60805
60818
|
className,
|
|
60819
|
+
span,
|
|
60806
60820
|
style,
|
|
60807
60821
|
children
|
|
60808
60822
|
} = _a,
|
|
60809
|
-
rest = descriptions_item_rest(_a, ["itemKey", "hidden", "className", "style", "children"]);
|
|
60823
|
+
rest = descriptions_item_rest(_a, ["itemKey", "hidden", "className", "span", "style", "children"]);
|
|
60810
60824
|
const {
|
|
60811
|
-
align
|
|
60825
|
+
align,
|
|
60826
|
+
layout
|
|
60812
60827
|
} = this.context;
|
|
60813
60828
|
if (hidden) {
|
|
60814
60829
|
return null;
|
|
60815
60830
|
}
|
|
60816
|
-
const
|
|
60817
|
-
className:
|
|
60818
|
-
|
|
60819
|
-
}, getDataAttr(rest)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("td", {
|
|
60820
|
-
className: `${item_prefixCls}-item`
|
|
60831
|
+
const plainItem = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("td", {
|
|
60832
|
+
className: `${item_prefixCls}-item`,
|
|
60833
|
+
colSpan: span || 1
|
|
60821
60834
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
60822
60835
|
className: keyCls
|
|
60823
60836
|
}, itemKey, ":"), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
60824
60837
|
className: valCls
|
|
60825
|
-
}, typeof children === 'function' ? children() : children))
|
|
60826
|
-
|
|
60827
|
-
style: style
|
|
60828
|
-
}, getDataAttr(rest)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("th", {
|
|
60838
|
+
}, typeof children === 'function' ? children() : children));
|
|
60839
|
+
const alignItem = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("th", {
|
|
60829
60840
|
className: `${item_prefixCls}-item ${item_prefixCls}-item-th`
|
|
60830
60841
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
60831
60842
|
className: keyCls
|
|
60832
60843
|
}, itemKey)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("td", {
|
|
60833
|
-
className: `${item_prefixCls}-item ${item_prefixCls}-item-td
|
|
60844
|
+
className: `${item_prefixCls}-item ${item_prefixCls}-item-td`,
|
|
60845
|
+
colSpan: span || 1
|
|
60834
60846
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
|
|
60835
60847
|
className: valCls
|
|
60836
60848
|
}, typeof children === 'function' ? children() : children)));
|
|
60837
|
-
|
|
60849
|
+
const item = align === 'plain' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("tr", Object.assign({
|
|
60850
|
+
className: className,
|
|
60851
|
+
style: style
|
|
60852
|
+
}, getDataAttr(rest)), plainItem) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("tr", Object.assign({
|
|
60853
|
+
className: className,
|
|
60854
|
+
style: style
|
|
60855
|
+
}, getDataAttr(rest)), alignItem);
|
|
60856
|
+
const horizontalItem = align === 'plain' ? plainItem : alignItem;
|
|
60857
|
+
return layout === 'horizontal' ? horizontalItem : item;
|
|
60838
60858
|
}
|
|
60839
60859
|
}
|
|
60840
60860
|
item_Item.propTypes = {
|
|
@@ -60844,6 +60864,44 @@ item_Item.propTypes = {
|
|
|
60844
60864
|
style: (prop_types_default()).object
|
|
60845
60865
|
};
|
|
60846
60866
|
item_Item.contextType = descriptions_context;
|
|
60867
|
+
;// CONCATENATED MODULE: ../semi-foundation/descriptions/foundation.ts
|
|
60868
|
+
|
|
60869
|
+
class DescriptionsFoundation extends foundation {
|
|
60870
|
+
constructor(adapter) {
|
|
60871
|
+
super(Object.assign({}, adapter));
|
|
60872
|
+
}
|
|
60873
|
+
getHorizontalList() {
|
|
60874
|
+
const {
|
|
60875
|
+
column,
|
|
60876
|
+
data,
|
|
60877
|
+
children
|
|
60878
|
+
} = this.getProps();
|
|
60879
|
+
let columns;
|
|
60880
|
+
if (data === null || data === void 0 ? void 0 : data.length) {
|
|
60881
|
+
columns = data || [];
|
|
60882
|
+
} else {
|
|
60883
|
+
columns = (children === null || children === void 0 ? void 0 : children.map(item => Object.assign({
|
|
60884
|
+
value: item.props.children
|
|
60885
|
+
}, item.props))) || [];
|
|
60886
|
+
}
|
|
60887
|
+
const horizontalList = [];
|
|
60888
|
+
const curSpan = {
|
|
60889
|
+
totalSpan: 0,
|
|
60890
|
+
itemList: []
|
|
60891
|
+
};
|
|
60892
|
+
for (const item of columns) {
|
|
60893
|
+
curSpan.totalSpan += item.span || 1;
|
|
60894
|
+
curSpan.itemList.push(item);
|
|
60895
|
+
if (curSpan.totalSpan >= column) {
|
|
60896
|
+
horizontalList.push(curSpan.itemList);
|
|
60897
|
+
curSpan.itemList = [];
|
|
60898
|
+
curSpan.totalSpan = 0;
|
|
60899
|
+
}
|
|
60900
|
+
}
|
|
60901
|
+
if (curSpan.itemList.length != 0) horizontalList.push(curSpan.itemList);
|
|
60902
|
+
return horizontalList;
|
|
60903
|
+
}
|
|
60904
|
+
}
|
|
60847
60905
|
;// CONCATENATED MODULE: ./descriptions/index.tsx
|
|
60848
60906
|
|
|
60849
60907
|
var descriptions_rest = undefined && undefined.__rest || function (s, e) {
|
|
@@ -60862,8 +60920,43 @@ var descriptions_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
60862
60920
|
|
|
60863
60921
|
|
|
60864
60922
|
|
|
60923
|
+
|
|
60924
|
+
|
|
60865
60925
|
const descriptions_prefixCls = descriptions_constants_cssClasses.PREFIX;
|
|
60866
|
-
class Descriptions extends
|
|
60926
|
+
class Descriptions extends BaseComponent {
|
|
60927
|
+
constructor(props) {
|
|
60928
|
+
super(props);
|
|
60929
|
+
this.renderChildrenList = () => {
|
|
60930
|
+
const props = this.props;
|
|
60931
|
+
const {
|
|
60932
|
+
layout,
|
|
60933
|
+
data,
|
|
60934
|
+
children
|
|
60935
|
+
} = props;
|
|
60936
|
+
if (layout === 'horizontal') {
|
|
60937
|
+
const horizontalList = this.foundation.getHorizontalList();
|
|
60938
|
+
return horizontalList.map((row, index) => {
|
|
60939
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("tr", {
|
|
60940
|
+
key: index
|
|
60941
|
+
}, row.map((item, itemIndex) => isPlainObject_default()(item) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(item_Item, Object.assign({
|
|
60942
|
+
itemKey: item.key
|
|
60943
|
+
}, item, {
|
|
60944
|
+
key: index + '-' + itemIndex
|
|
60945
|
+
}), item.value) : null));
|
|
60946
|
+
});
|
|
60947
|
+
} else {
|
|
60948
|
+
return data && data.length ? data.map((item, index) => isPlainObject_default()(item) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(item_Item, Object.assign({
|
|
60949
|
+
itemKey: item.key
|
|
60950
|
+
}, item, {
|
|
60951
|
+
key: index
|
|
60952
|
+
}), item.value) : null) : children;
|
|
60953
|
+
}
|
|
60954
|
+
};
|
|
60955
|
+
this.foundation = new DescriptionsFoundation(this.adapter);
|
|
60956
|
+
}
|
|
60957
|
+
get adapter() {
|
|
60958
|
+
return Object.assign({}, super.adapter);
|
|
60959
|
+
}
|
|
60867
60960
|
render() {
|
|
60868
60961
|
const _a = this.props,
|
|
60869
60962
|
{
|
|
@@ -60873,27 +60966,26 @@ class Descriptions extends external_root_React_commonjs2_react_commonjs_react_am
|
|
|
60873
60966
|
className,
|
|
60874
60967
|
style,
|
|
60875
60968
|
children,
|
|
60876
|
-
data
|
|
60969
|
+
data,
|
|
60970
|
+
layout
|
|
60877
60971
|
} = _a,
|
|
60878
|
-
rest = descriptions_rest(_a, ["align", "row", "size", "className", "style", "children", "data"]);
|
|
60972
|
+
rest = descriptions_rest(_a, ["align", "row", "size", "className", "style", "children", "data", "layout"]);
|
|
60879
60973
|
const classNames = classnames_default()(descriptions_prefixCls, className, {
|
|
60880
60974
|
[`${descriptions_prefixCls}-${align}`]: !row,
|
|
60881
60975
|
[`${descriptions_prefixCls}-double`]: row,
|
|
60882
|
-
[`${descriptions_prefixCls}-double-${size}`]: row
|
|
60976
|
+
[`${descriptions_prefixCls}-double-${size}`]: row,
|
|
60977
|
+
[`${descriptions_prefixCls}-horizontal`]: layout === 'horizontal',
|
|
60978
|
+
[`${descriptions_prefixCls}-vertical`]: layout === 'vertical'
|
|
60883
60979
|
});
|
|
60884
|
-
const childrenList = data && data.length ? data.map((item, index) => isPlainObject_default()(item) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(item_Item, Object.assign({
|
|
60885
|
-
itemKey: item.key
|
|
60886
|
-
}, item, {
|
|
60887
|
-
key: index
|
|
60888
|
-
}), item.value) : null) : children;
|
|
60889
60980
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", Object.assign({
|
|
60890
60981
|
className: classNames,
|
|
60891
60982
|
style: style
|
|
60892
60983
|
}, getDataAttr(rest)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("table", null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("tbody", null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(descriptions_context.Provider, {
|
|
60893
60984
|
value: {
|
|
60894
|
-
align
|
|
60985
|
+
align,
|
|
60986
|
+
layout
|
|
60895
60987
|
}
|
|
60896
|
-
},
|
|
60988
|
+
}, this.renderChildrenList()))));
|
|
60897
60989
|
}
|
|
60898
60990
|
}
|
|
60899
60991
|
Descriptions.Item = item_Item;
|
|
@@ -60910,13 +61002,17 @@ Descriptions.propTypes = {
|
|
|
60910
61002
|
hidden: (prop_types_default()).bool,
|
|
60911
61003
|
className: (prop_types_default()).string,
|
|
60912
61004
|
style: (prop_types_default()).object
|
|
60913
|
-
}))
|
|
61005
|
+
})),
|
|
61006
|
+
layout: prop_types_default().oneOf(descriptions_constants_strings.LAYOUT_SET),
|
|
61007
|
+
column: (prop_types_default()).number
|
|
60914
61008
|
};
|
|
60915
61009
|
Descriptions.defaultProps = {
|
|
60916
61010
|
align: 'center',
|
|
60917
61011
|
row: false,
|
|
60918
61012
|
size: 'medium',
|
|
60919
|
-
data: []
|
|
61013
|
+
data: [],
|
|
61014
|
+
layout: 'vertical',
|
|
61015
|
+
column: 3
|
|
60920
61016
|
};
|
|
60921
61017
|
/* harmony default export */ const descriptions_0 = (Descriptions);
|
|
60922
61018
|
;// CONCATENATED MODULE: ../semi-foundation/divider/constants.ts
|
|
@@ -62032,7 +62128,7 @@ var Modal_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
62032
62128
|
|
|
62033
62129
|
|
|
62034
62130
|
|
|
62035
|
-
|
|
62131
|
+
let destroyFns = [];
|
|
62036
62132
|
class Modal extends BaseComponent {
|
|
62037
62133
|
constructor(props) {
|
|
62038
62134
|
super(props);
|
|
@@ -62359,12 +62455,13 @@ Modal.confirm = function (props) {
|
|
|
62359
62455
|
return confirm_confirm(withConfirm(props));
|
|
62360
62456
|
};
|
|
62361
62457
|
Modal.destroyAll = function destroyAllFn() {
|
|
62362
|
-
|
|
62363
|
-
const close = destroyFns
|
|
62458
|
+
for (let i = 0, len = destroyFns.length; i < len; i++) {
|
|
62459
|
+
const close = destroyFns[i];
|
|
62364
62460
|
if (close) {
|
|
62365
62461
|
close();
|
|
62366
62462
|
}
|
|
62367
62463
|
}
|
|
62464
|
+
destroyFns = [];
|
|
62368
62465
|
};
|
|
62369
62466
|
/* harmony default export */ const modal_Modal = (Modal);
|
|
62370
62467
|
;// CONCATENATED MODULE: ./modal/index.tsx
|
|
@@ -75870,7 +75967,8 @@ class SliderFoundation extends foundation {
|
|
|
75870
75967
|
this.onHandleLeave = () => {
|
|
75871
75968
|
// this._adapter.setEventDefault(e);
|
|
75872
75969
|
const disabled = this._adapter.getState('disabled');
|
|
75873
|
-
|
|
75970
|
+
const isDrag = this._adapter.getState('isDrag');
|
|
75971
|
+
if (!disabled && !isDrag) {
|
|
75874
75972
|
this._adapter.onHandleLeave();
|
|
75875
75973
|
}
|
|
75876
75974
|
};
|
|
@@ -76555,11 +76653,13 @@ class Slider extends BaseComponent {
|
|
|
76555
76653
|
var _this = this;
|
|
76556
76654
|
return Object.assign(Object.assign({}, super.adapter), {
|
|
76557
76655
|
getSliderLengths: () => {
|
|
76656
|
+
var _a;
|
|
76558
76657
|
if (this.sliderEl && this.sliderEl.current) {
|
|
76559
76658
|
const rect = this.sliderEl.current.getBoundingClientRect();
|
|
76659
|
+
const offsetParentRect = (_a = this.sliderEl.current.offsetParent) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
76560
76660
|
const offset = {
|
|
76561
|
-
x: this.sliderEl.current.offsetLeft,
|
|
76562
|
-
y: this.sliderEl.current.offsetTop
|
|
76661
|
+
x: offsetParentRect ? rect.left - offsetParentRect.left : this.sliderEl.current.offsetLeft,
|
|
76662
|
+
y: offsetParentRect ? rect.top - offsetParentRect.top : this.sliderEl.current.offsetTop
|
|
76563
76663
|
};
|
|
76564
76664
|
return {
|
|
76565
76665
|
sliderX: offset.x,
|
|
@@ -87407,6 +87507,9 @@ const createBaseToast = () => {
|
|
|
87407
87507
|
ToastList.defaultOpts[pos] = opts[pos];
|
|
87408
87508
|
}
|
|
87409
87509
|
});
|
|
87510
|
+
if (typeof opts.theme === 'string' && toast_constants_strings.themes.includes(opts.theme)) {
|
|
87511
|
+
ToastList.defaultOpts.theme = opts.theme;
|
|
87512
|
+
}
|
|
87410
87513
|
if (typeof opts.zIndex === 'number') {
|
|
87411
87514
|
ToastList.defaultOpts.zIndex = opts.zIndex;
|
|
87412
87515
|
}
|
|
@@ -100119,6 +100222,33 @@ PreviewImage.defaultProps = {
|
|
|
100119
100222
|
zoom: undefined
|
|
100120
100223
|
};
|
|
100121
100224
|
;// CONCATENATED MODULE: ../semi-foundation/image/utils.ts
|
|
100225
|
+
var image_utils_awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
100226
|
+
function adopt(value) {
|
|
100227
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
100228
|
+
resolve(value);
|
|
100229
|
+
});
|
|
100230
|
+
}
|
|
100231
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
100232
|
+
function fulfilled(value) {
|
|
100233
|
+
try {
|
|
100234
|
+
step(generator.next(value));
|
|
100235
|
+
} catch (e) {
|
|
100236
|
+
reject(e);
|
|
100237
|
+
}
|
|
100238
|
+
}
|
|
100239
|
+
function rejected(value) {
|
|
100240
|
+
try {
|
|
100241
|
+
step(generator["throw"](value));
|
|
100242
|
+
} catch (e) {
|
|
100243
|
+
reject(e);
|
|
100244
|
+
}
|
|
100245
|
+
}
|
|
100246
|
+
function step(result) {
|
|
100247
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
100248
|
+
}
|
|
100249
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
100250
|
+
});
|
|
100251
|
+
};
|
|
100122
100252
|
const isTargetEmit = (event, targetClasses) => {
|
|
100123
100253
|
// event.path usage is discouraged, use event.composedPath() as it's standard and is more future-proof
|
|
100124
100254
|
// path is the event-triggered bubbling path, which stores each node through which bubbling passes.
|
|
@@ -100132,27 +100262,25 @@ const isTargetEmit = (event, targetClasses) => {
|
|
|
100132
100262
|
});
|
|
100133
100263
|
return isTarget;
|
|
100134
100264
|
};
|
|
100135
|
-
const downloadImage = (src, filename) => {
|
|
100136
|
-
|
|
100137
|
-
|
|
100138
|
-
|
|
100139
|
-
|
|
100140
|
-
|
|
100141
|
-
|
|
100142
|
-
|
|
100143
|
-
|
|
100144
|
-
|
|
100145
|
-
|
|
100146
|
-
|
|
100147
|
-
|
|
100148
|
-
|
|
100149
|
-
|
|
100150
|
-
|
|
100151
|
-
|
|
100152
|
-
|
|
100153
|
-
|
|
100154
|
-
};
|
|
100155
|
-
};
|
|
100265
|
+
const downloadImage = (src, filename, downloadErrorCb) => image_utils_awaiter(void 0, void 0, void 0, function* () {
|
|
100266
|
+
try {
|
|
100267
|
+
const response = yield fetch(src);
|
|
100268
|
+
if (response.ok) {
|
|
100269
|
+
const blob = yield response.blob();
|
|
100270
|
+
const url = URL.createObjectURL(blob);
|
|
100271
|
+
const link = document.createElement('a');
|
|
100272
|
+
link.href = url;
|
|
100273
|
+
link.download = filename;
|
|
100274
|
+
link.click();
|
|
100275
|
+
URL.revokeObjectURL(url);
|
|
100276
|
+
link.remove();
|
|
100277
|
+
} else {
|
|
100278
|
+
downloadErrorCb(src);
|
|
100279
|
+
}
|
|
100280
|
+
} catch (error) {
|
|
100281
|
+
downloadErrorCb(src);
|
|
100282
|
+
}
|
|
100283
|
+
});
|
|
100156
100284
|
const crossMerge = function () {
|
|
100157
100285
|
let leftArr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
100158
100286
|
let rightArr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
@@ -100375,7 +100503,7 @@ class PreviewInnerFoundation extends foundation {
|
|
|
100375
100503
|
const setDownloadName = this._adapter.getSetDownloadFunc();
|
|
100376
100504
|
const downloadSrc = imgSrc[currentIndex];
|
|
100377
100505
|
const downloadName = setDownloadName ? setDownloadName(downloadSrc) : downloadSrc.slice(downloadSrc.lastIndexOf("/") + 1).split('?')[0];
|
|
100378
|
-
downloadImage(downloadSrc, downloadName);
|
|
100506
|
+
downloadImage(downloadSrc, downloadName, this._adapter.notifyDownloadError);
|
|
100379
100507
|
this._adapter.notifyDownload(downloadSrc, currentIndex);
|
|
100380
100508
|
};
|
|
100381
100509
|
this.handlePreviewClose = e => {
|
|
@@ -100632,6 +100760,12 @@ class PreviewInner extends BaseComponent {
|
|
|
100632
100760
|
} = this.props;
|
|
100633
100761
|
isFunction_default()(onDownload) && onDownload(src, index);
|
|
100634
100762
|
},
|
|
100763
|
+
notifyDownloadError: src => {
|
|
100764
|
+
const {
|
|
100765
|
+
onDownloadError
|
|
100766
|
+
} = this.props;
|
|
100767
|
+
isFunction_default()(onDownloadError) && onDownloadError(src);
|
|
100768
|
+
},
|
|
100635
100769
|
registerKeyDownListener: () => {
|
|
100636
100770
|
window && window.addEventListener("keydown", this.handleKeyDown);
|
|
100637
100771
|
},
|