@douyinfe/semi-ui 2.31.2 → 2.32.0-beta.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 +40 -11
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +490 -179
- 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/cascader/index.d.ts +1 -0
- package/lib/cjs/cascader/index.js +10 -1
- package/lib/cjs/datePicker/dateInput.d.ts +5 -1
- package/lib/cjs/datePicker/dateInput.js +16 -9
- package/lib/cjs/datePicker/datePicker.d.ts +32 -4
- package/lib/cjs/datePicker/datePicker.js +104 -23
- package/lib/cjs/datePicker/index.d.ts +1 -0
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
- package/lib/cjs/datePicker/monthsGrid.js +11 -3
- package/lib/cjs/datePicker/yearAndMonth.d.ts +10 -6
- package/lib/cjs/datePicker/yearAndMonth.js +84 -30
- package/lib/cjs/form/baseForm.d.ts +2 -2
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/locale/interface.d.ts +1 -0
- package/lib/cjs/locale/source/ar.js +2 -1
- package/lib/cjs/locale/source/de.js +2 -1
- package/lib/cjs/locale/source/en_GB.js +2 -1
- package/lib/cjs/locale/source/en_US.js +2 -1
- package/lib/cjs/locale/source/es.js +2 -1
- package/lib/cjs/locale/source/fr.js +2 -1
- package/lib/cjs/locale/source/id_ID.js +2 -1
- package/lib/cjs/locale/source/it.js +2 -1
- package/lib/cjs/locale/source/ja_JP.js +2 -1
- package/lib/cjs/locale/source/ko_KR.js +2 -1
- package/lib/cjs/locale/source/ms_MY.js +2 -1
- package/lib/cjs/locale/source/nl_NL.js +2 -1
- package/lib/cjs/locale/source/pl_PL.js +2 -1
- package/lib/cjs/locale/source/pt_BR.js +2 -1
- package/lib/cjs/locale/source/ro.d.ts +1 -0
- package/lib/cjs/locale/source/ro.js +2 -1
- package/lib/cjs/locale/source/ru_RU.js +2 -1
- package/lib/cjs/locale/source/sv_SE.js +2 -1
- package/lib/cjs/locale/source/th_TH.js +2 -1
- package/lib/cjs/locale/source/tr_TR.js +2 -1
- package/lib/cjs/locale/source/vi_VN.js +2 -1
- package/lib/cjs/locale/source/zh_CN.js +2 -1
- package/lib/cjs/locale/source/zh_TW.js +2 -1
- package/lib/cjs/select/index.d.ts +18 -1
- package/lib/cjs/select/index.js +4 -1
- package/lib/cjs/sideSheet/SideSheetContent.d.ts +3 -1
- package/lib/cjs/sideSheet/SideSheetContent.js +3 -2
- package/lib/cjs/sideSheet/index.js +6 -3
- package/lib/cjs/space/index.js +5 -2
- package/lib/cjs/switch/index.js +1 -1
- package/lib/cjs/treeSelect/index.d.ts +1 -0
- package/lib/cjs/treeSelect/index.js +7 -3
- package/lib/es/cascader/index.d.ts +1 -0
- package/lib/es/cascader/index.js +10 -1
- package/lib/es/datePicker/dateInput.d.ts +5 -1
- package/lib/es/datePicker/dateInput.js +16 -9
- package/lib/es/datePicker/datePicker.d.ts +32 -4
- package/lib/es/datePicker/datePicker.js +109 -23
- package/lib/es/datePicker/index.d.ts +1 -0
- package/lib/es/datePicker/monthsGrid.d.ts +1 -1
- package/lib/es/datePicker/monthsGrid.js +11 -3
- package/lib/es/datePicker/yearAndMonth.d.ts +10 -6
- package/lib/es/datePicker/yearAndMonth.js +83 -29
- package/lib/es/form/baseForm.d.ts +2 -2
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/locale/interface.d.ts +1 -0
- package/lib/es/locale/source/ar.js +2 -1
- package/lib/es/locale/source/de.js +2 -1
- package/lib/es/locale/source/en_GB.js +2 -1
- package/lib/es/locale/source/en_US.js +2 -1
- package/lib/es/locale/source/es.js +2 -1
- package/lib/es/locale/source/fr.js +2 -1
- package/lib/es/locale/source/id_ID.js +2 -1
- package/lib/es/locale/source/it.js +2 -1
- package/lib/es/locale/source/ja_JP.js +2 -1
- package/lib/es/locale/source/ko_KR.js +2 -1
- package/lib/es/locale/source/ms_MY.js +2 -1
- package/lib/es/locale/source/nl_NL.js +2 -1
- package/lib/es/locale/source/pl_PL.js +2 -1
- package/lib/es/locale/source/pt_BR.js +2 -1
- package/lib/es/locale/source/ro.d.ts +1 -0
- package/lib/es/locale/source/ro.js +2 -1
- package/lib/es/locale/source/ru_RU.js +2 -1
- package/lib/es/locale/source/sv_SE.js +2 -1
- package/lib/es/locale/source/th_TH.js +2 -1
- package/lib/es/locale/source/tr_TR.js +2 -1
- package/lib/es/locale/source/vi_VN.js +2 -1
- package/lib/es/locale/source/zh_CN.js +2 -1
- package/lib/es/locale/source/zh_TW.js +2 -1
- package/lib/es/select/index.d.ts +18 -1
- package/lib/es/select/index.js +4 -1
- package/lib/es/sideSheet/SideSheetContent.d.ts +3 -1
- package/lib/es/sideSheet/SideSheetContent.js +3 -2
- package/lib/es/sideSheet/index.js +6 -3
- package/lib/es/space/index.js +4 -2
- package/lib/es/switch/index.js +1 -1
- package/lib/es/treeSelect/index.d.ts +1 -0
- package/lib/es/treeSelect/index.js +7 -3
- package/package.json +8 -8
package/lib/es/select/index.js
CHANGED
|
@@ -1162,11 +1162,14 @@ class Select extends BaseComponent {
|
|
|
1162
1162
|
}, arrowIcon) : /*#__PURE__*/React.createElement("div", {
|
|
1163
1163
|
className: `${prefixcls}-arrow-empty`
|
|
1164
1164
|
});
|
|
1165
|
-
const clear = clearIcon ? clearIcon : /*#__PURE__*/React.createElement(IconClear, null);
|
|
1165
|
+
const clear = clearIcon ? clearIcon : /*#__PURE__*/React.createElement(IconClear, null); // semantics of onSearch are more in line with behavior, onChange is alias of onSearch, will be deprecate next major version
|
|
1166
|
+
|
|
1166
1167
|
const inner = useCustomTrigger ? /*#__PURE__*/React.createElement(Trigger, {
|
|
1167
1168
|
value: Array.from(selections.values()),
|
|
1168
1169
|
inputValue: inputValue,
|
|
1169
1170
|
onChange: this.handleInputChange,
|
|
1171
|
+
onSearch: this.handleInputChange,
|
|
1172
|
+
onRemove: item => this.foundation.removeTag(item),
|
|
1170
1173
|
onClear: this.onClear,
|
|
1171
1174
|
disabled: disabled,
|
|
1172
1175
|
triggerRender: triggerRender,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { SideSheetProps } from '@douyinfe/semi-foundation/lib/es/sideSheet/sideSheetFoundation';
|
|
3
4
|
export interface SideSheetContentProps {
|
|
4
5
|
onClose?: (e: React.MouseEvent) => void;
|
|
5
6
|
mask?: boolean;
|
|
@@ -9,9 +10,10 @@ export interface SideSheetContentProps {
|
|
|
9
10
|
title?: React.ReactNode;
|
|
10
11
|
closable?: boolean;
|
|
11
12
|
headerStyle?: CSSProperties;
|
|
12
|
-
width
|
|
13
|
+
width?: CSSProperties['width'];
|
|
13
14
|
height: CSSProperties['height'];
|
|
14
15
|
style: CSSProperties;
|
|
16
|
+
size: SideSheetProps['size'];
|
|
15
17
|
bodyStyle?: CSSProperties;
|
|
16
18
|
className: string;
|
|
17
19
|
dialogClassName?: string;
|
|
@@ -126,7 +126,7 @@ export default class SideSheetContent extends React.PureComponent {
|
|
|
126
126
|
key: "dialog-element",
|
|
127
127
|
role: "dialog",
|
|
128
128
|
tabIndex: -1,
|
|
129
|
-
className: cls(`${prefixCls}-inner`, `${prefixCls}-inner-wrap`, (_a = this.props.dialogClassName) !== null && _a !== void 0 ? _a : ""),
|
|
129
|
+
className: cls(`${prefixCls}-inner`, `${prefixCls}-inner-wrap`, (_a = this.props.dialogClassName) !== null && _a !== void 0 ? _a : "", `${prefixCls}-size-${props.size}`),
|
|
130
130
|
// onMouseDown={this.onDialogMouseDown}
|
|
131
131
|
style: Object.assign(Object.assign({}, props.style), style)
|
|
132
132
|
}, this.props.wrapperExtraProps), /*#__PURE__*/React.createElement("div", {
|
|
@@ -149,7 +149,8 @@ export default class SideSheetContent extends React.PureComponent {
|
|
|
149
149
|
width
|
|
150
150
|
} = this.props;
|
|
151
151
|
const wrapperCls = cls(className, {
|
|
152
|
-
[`${prefixCls}-fixed`]: !mask
|
|
152
|
+
[`${prefixCls}-fixed`]: !mask,
|
|
153
|
+
[`${prefixCls}-size-${this.props.size}`]: !mask
|
|
153
154
|
});
|
|
154
155
|
const wrapperStyle = {};
|
|
155
156
|
|
|
@@ -161,7 +161,6 @@ export default class SideSheet extends BaseComponent {
|
|
|
161
161
|
} = this.context;
|
|
162
162
|
const isVertical = placement === 'left' || placement === 'right';
|
|
163
163
|
const isHorizontal = placement === 'top' || placement === 'bottom';
|
|
164
|
-
const sheetWidth = isVertical ? width ? width : defaultWidthList[size] : '100%';
|
|
165
164
|
const sheetHeight = isHorizontal ? height ? height : defaultHeight : '100%';
|
|
166
165
|
const classList = cls(prefixCls, className, {
|
|
167
166
|
[`${prefixCls}-${placement}`]: placement,
|
|
@@ -170,11 +169,15 @@ export default class SideSheet extends BaseComponent {
|
|
|
170
169
|
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
171
170
|
[`${prefixCls}-hidden`]: keepDOM && this.state.displayNone
|
|
172
171
|
});
|
|
173
|
-
const contentProps = Object.assign(Object.assign({},
|
|
172
|
+
const contentProps = Object.assign(Object.assign(Object.assign({}, isVertical ? width ? {
|
|
173
|
+
width
|
|
174
|
+
} : {} : {
|
|
175
|
+
width: "100%"
|
|
176
|
+
}), props), {
|
|
174
177
|
visible,
|
|
175
178
|
motion: false,
|
|
179
|
+
size,
|
|
176
180
|
className: classList,
|
|
177
|
-
width: sheetWidth,
|
|
178
181
|
height: sheetHeight,
|
|
179
182
|
onClose: this.handleCancel
|
|
180
183
|
});
|
package/lib/es/space/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import PropTypes from 'prop-types';
|
|
|
7
7
|
import { strings, cssClasses } from '@douyinfe/semi-foundation/lib/es/space/constants';
|
|
8
8
|
import '@douyinfe/semi-foundation/lib/es/space/space.css';
|
|
9
9
|
import { flatten } from './utils';
|
|
10
|
+
import getDataAttr from '@douyinfe/semi-foundation/lib/es/utils/getDataAttr';
|
|
10
11
|
const prefixCls = cssClasses.PREFIX;
|
|
11
12
|
|
|
12
13
|
class Space extends PureComponent {
|
|
@@ -58,11 +59,12 @@ class Space extends PureComponent {
|
|
|
58
59
|
[`${prefixCls}-loose-vertical`]: spacingVerticalType === strings.SPACING_LOOSE
|
|
59
60
|
});
|
|
60
61
|
const childrenNodes = flatten(children);
|
|
61
|
-
|
|
62
|
+
const dataAttributes = getDataAttr(this.props);
|
|
63
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({}, dataAttributes, {
|
|
62
64
|
className: classNames,
|
|
63
65
|
style: realStyle,
|
|
64
66
|
"x-semi-prop": "children"
|
|
65
|
-
}, childrenNodes);
|
|
67
|
+
}), childrenNodes);
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
}
|
package/lib/es/switch/index.js
CHANGED
|
@@ -180,6 +180,7 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
|
|
|
180
180
|
showRestTagsPopover: PropTypes.Requireable<boolean>;
|
|
181
181
|
restTagsPopoverProps: PropTypes.Requireable<object>;
|
|
182
182
|
preventScroll: PropTypes.Requireable<boolean>;
|
|
183
|
+
clickTriggerToHide: PropTypes.Requireable<boolean>;
|
|
183
184
|
};
|
|
184
185
|
static defaultProps: Partial<TreeSelectProps>;
|
|
185
186
|
inputRef: React.RefObject<typeof Input>;
|
|
@@ -437,7 +437,9 @@ class TreeSelect extends BaseComponent {
|
|
|
437
437
|
onClear: this.handleClear,
|
|
438
438
|
componentName: 'TreeSelect',
|
|
439
439
|
triggerRender: triggerRender,
|
|
440
|
-
componentProps: Object.assign({}, this.props)
|
|
440
|
+
componentProps: Object.assign({}, this.props),
|
|
441
|
+
onSearch: this.search,
|
|
442
|
+
onRemove: this.removeTag
|
|
441
443
|
}) : [/*#__PURE__*/React.createElement(Fragment, {
|
|
442
444
|
key: 'prefix'
|
|
443
445
|
}, prefix || insetLabel ? this.renderPrefix() : null), /*#__PURE__*/React.createElement(Fragment, {
|
|
@@ -1371,7 +1373,8 @@ TreeSelect.propTypes = {
|
|
|
1371
1373
|
'aria-label': PropTypes.string,
|
|
1372
1374
|
showRestTagsPopover: PropTypes.bool,
|
|
1373
1375
|
restTagsPopoverProps: PropTypes.object,
|
|
1374
|
-
preventScroll: PropTypes.bool
|
|
1376
|
+
preventScroll: PropTypes.bool,
|
|
1377
|
+
clickTriggerToHide: PropTypes.bool
|
|
1375
1378
|
};
|
|
1376
1379
|
TreeSelect.defaultProps = {
|
|
1377
1380
|
searchPosition: strings.SEARCH_POSITION_DROPDOWN,
|
|
@@ -1401,6 +1404,7 @@ TreeSelect.defaultProps = {
|
|
|
1401
1404
|
checkRelation: 'related',
|
|
1402
1405
|
'aria-label': 'TreeSelect',
|
|
1403
1406
|
showRestTagsPopover: false,
|
|
1404
|
-
restTagsPopoverProps: {}
|
|
1407
|
+
restTagsPopoverProps: {},
|
|
1408
|
+
clickTriggerToHide: true
|
|
1405
1409
|
};
|
|
1406
1410
|
export default TreeSelect;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.32.0-beta.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
"lib/*"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@douyinfe/semi-animation": "2.
|
|
21
|
-
"@douyinfe/semi-animation-react": "2.
|
|
22
|
-
"@douyinfe/semi-foundation": "2.
|
|
23
|
-
"@douyinfe/semi-icons": "2.
|
|
24
|
-
"@douyinfe/semi-illustrations": "2.
|
|
25
|
-
"@douyinfe/semi-theme-default": "2.
|
|
20
|
+
"@douyinfe/semi-animation": "2.32.0-beta.0",
|
|
21
|
+
"@douyinfe/semi-animation-react": "2.32.0-beta.0",
|
|
22
|
+
"@douyinfe/semi-foundation": "2.32.0-beta.0",
|
|
23
|
+
"@douyinfe/semi-icons": "2.32.0-beta.0",
|
|
24
|
+
"@douyinfe/semi-illustrations": "2.32.0-beta.0",
|
|
25
|
+
"@douyinfe/semi-theme-default": "2.32.0-beta.0",
|
|
26
26
|
"async-validator": "^3.5.0",
|
|
27
27
|
"classnames": "^2.2.6",
|
|
28
28
|
"copy-text-to-clipboard": "^2.1.1",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
],
|
|
70
70
|
"author": "",
|
|
71
71
|
"license": "MIT",
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "335f8c47c40373ee1464c841581130e62b62b1d5",
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
75
75
|
"@babel/plugin-transform-runtime": "^7.15.8",
|