@douyinfe/semi-ui 2.23.4 → 2.23.6

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.
@@ -4,4 +4,4 @@ import Preview from "./preview";
4
4
  import '@douyinfe/semi-foundation/lib/cjs/image/image.css';
5
5
  export default Image;
6
6
  export { PreviewInner, Preview, };
7
- export { ImageProps, PreviewImageProps, PreviewProps, } from "./interface";
7
+ export type { ImageProps, PreviewImageProps, PreviewProps, } from "./interface";
@@ -4,6 +4,7 @@ import { ContextValue } from '../configProvider/context';
4
4
  import SelectFoundation, { SelectAdapter } from '@douyinfe/semi-foundation/lib/cjs/select/foundation';
5
5
  import BaseComponent, { ValidateStatus } from '../_base/baseComponent';
6
6
  import { PopoverProps } from '../popover/index';
7
+ import Event from '@douyinfe/semi-foundation/lib/cjs/utils/Event';
7
8
  import { InputProps } from '../input/index';
8
9
  import Option, { OptionProps } from './option';
9
10
  import OptionGroup from './optionGroup';
@@ -233,6 +234,7 @@ declare class Select extends BaseComponent<SelectProps, SelectState> {
233
234
  clickOutsideHandler: (e: MouseEvent) => void;
234
235
  foundation: SelectFoundation;
235
236
  context: ContextValue;
237
+ eventManager: Event;
236
238
  constructor(props: SelectProps);
237
239
  setOptionContainerEl: (node: HTMLDivElement) => {
238
240
  current: HTMLDivElement;
@@ -41,6 +41,8 @@ var _index2 = _interopRequireDefault(require("../popover/index"));
41
41
 
42
42
  var _constants2 = require("@douyinfe/semi-foundation/lib/cjs/popover/constants");
43
43
 
44
+ var _Event = _interopRequireDefault(require("@douyinfe/semi-foundation/lib/cjs/utils/Event"));
45
+
44
46
  var _reactWindow = require("react-window");
45
47
 
46
48
  var _utils = require("./utils");
@@ -171,6 +173,7 @@ class Select extends _baseComponent.default {
171
173
  this.onMouseLeave = this.onMouseLeave.bind(this);
172
174
  this.renderOption = this.renderOption.bind(this);
173
175
  this.onKeyPress = this.onKeyPress.bind(this);
176
+ this.eventManager = new _Event.default();
174
177
  this.foundation = new _foundation.default(this.adapter);
175
178
  (0, _warning.default)('optionLabelProp' in this.props, '[Semi Select] \'optionLabelProp\' has already been deprecated, please use \'renderSelectedItem\' instead.');
176
179
  (0, _warning.default)('labelInValue' in this.props, '[Semi Select] \'labelInValue\' has already been deprecated, please use \'onChangeWithObject\' instead.');
@@ -267,6 +270,10 @@ class Select extends _baseComponent.default {
267
270
  }
268
271
  };
269
272
  return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, super.adapter), keyboardAdapter), filterAdapter), multipleAdapter), {
273
+ on: (eventName, eventCallback) => this.eventManager.on(eventName, eventCallback),
274
+ off: eventName => this.eventManager.off(eventName),
275
+ once: (eventName, eventCallback) => this.eventManager.once(eventName, eventCallback),
276
+ emit: eventName => this.eventManager.emit(eventName),
270
277
  // Collect all subitems, each item is visible by default when collected, and is not selected
271
278
  getOptionsFromChildren: function () {
272
279
  let children = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.props.children;
@@ -1120,7 +1127,8 @@ class Select extends _baseComponent.default {
1120
1127
  spacing: spacing,
1121
1128
  stopPropagation: stopPropagation,
1122
1129
  disableArrowKeyDown: true,
1123
- onVisibleChange: status => this.handlePopoverVisibleChange(status)
1130
+ onVisibleChange: status => this.handlePopoverVisibleChange(status),
1131
+ afterClose: () => this.foundation.handlePopoverClose()
1124
1132
  }, selection);
1125
1133
  }
1126
1134
 
@@ -370,7 +370,6 @@ class TimePicker extends _baseComponent.default {
370
370
  outerProps.onClick = this.openPanel;
371
371
  }
372
372
 
373
- console.log("===>", disabled ? false : open, motion);
374
373
  return /*#__PURE__*/_react.default.createElement("div", Object.assign({
375
374
  ref: this.setTimePickerRef,
376
375
  className: (0, _classnames.default)({
@@ -3,12 +3,12 @@ import PropTypes from 'prop-types';
3
3
  import UploadFoundation from '@douyinfe/semi-foundation/lib/cjs/upload/foundation';
4
4
  import FileCard from './fileCard';
5
5
  import BaseComponent from '../_base/baseComponent';
6
- import { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError } from './interface';
6
+ import type { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError } from './interface';
7
7
  import { Locale } from '../locale/interface';
8
8
  import '@douyinfe/semi-foundation/lib/cjs/upload/upload.css';
9
9
  import type { CustomFile, UploadAdapter, BeforeUploadObjectResult, AfterUploadResult } from '@douyinfe/semi-foundation/lib/cjs/upload/foundation';
10
10
  import type { ValidateStatus } from '../_base/baseComponent';
11
- export { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError, BeforeUploadObjectResult, AfterUploadResult, };
11
+ export type { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError, BeforeUploadObjectResult, AfterUploadResult, };
12
12
  export interface UploadProps {
13
13
  accept?: string;
14
14
  action: string;
@@ -4,4 +4,4 @@ import Preview from "./preview";
4
4
  import '@douyinfe/semi-foundation/lib/es/image/image.css';
5
5
  export default Image;
6
6
  export { PreviewInner, Preview, };
7
- export { ImageProps, PreviewImageProps, PreviewProps, } from "./interface";
7
+ export type { ImageProps, PreviewImageProps, PreviewProps, } from "./interface";
@@ -4,6 +4,7 @@ import { ContextValue } from '../configProvider/context';
4
4
  import SelectFoundation, { SelectAdapter } from '@douyinfe/semi-foundation/lib/es/select/foundation';
5
5
  import BaseComponent, { ValidateStatus } from '../_base/baseComponent';
6
6
  import { PopoverProps } from '../popover/index';
7
+ import Event from '@douyinfe/semi-foundation/lib/es/utils/Event';
7
8
  import { InputProps } from '../input/index';
8
9
  import Option, { OptionProps } from './option';
9
10
  import OptionGroup from './optionGroup';
@@ -233,6 +234,7 @@ declare class Select extends BaseComponent<SelectProps, SelectState> {
233
234
  clickOutsideHandler: (e: MouseEvent) => void;
234
235
  foundation: SelectFoundation;
235
236
  context: ContextValue;
237
+ eventManager: Event;
236
238
  constructor(props: SelectProps);
237
239
  setOptionContainerEl: (node: HTMLDivElement) => {
238
240
  current: HTMLDivElement;
@@ -20,6 +20,7 @@ import TagGroup from '../tag/group';
20
20
  import LocaleConsumer from '../locale/localeConsumer';
21
21
  import Popover from '../popover/index';
22
22
  import { numbers as popoverNumbers } from '@douyinfe/semi-foundation/lib/es/popover/constants';
23
+ import Event from '@douyinfe/semi-foundation/lib/es/utils/Event';
23
24
  import { FixedSizeList as List } from 'react-window';
24
25
  import { getOptionsFromGroup } from './utils';
25
26
  import VirtualRow from './virtualRow';
@@ -128,6 +129,7 @@ class Select extends BaseComponent {
128
129
  this.onMouseLeave = this.onMouseLeave.bind(this);
129
130
  this.renderOption = this.renderOption.bind(this);
130
131
  this.onKeyPress = this.onKeyPress.bind(this);
132
+ this.eventManager = new Event();
131
133
  this.foundation = new SelectFoundation(this.adapter);
132
134
  warning('optionLabelProp' in this.props, '[Semi Select] \'optionLabelProp\' has already been deprecated, please use \'renderSelectedItem\' instead.');
133
135
  warning('labelInValue' in this.props, '[Semi Select] \'labelInValue\' has already been deprecated, please use \'onChangeWithObject\' instead.');
@@ -223,6 +225,10 @@ class Select extends BaseComponent {
223
225
  }
224
226
  };
225
227
  return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, super.adapter), keyboardAdapter), filterAdapter), multipleAdapter), {
228
+ on: (eventName, eventCallback) => this.eventManager.on(eventName, eventCallback),
229
+ off: eventName => this.eventManager.off(eventName),
230
+ once: (eventName, eventCallback) => this.eventManager.once(eventName, eventCallback),
231
+ emit: eventName => this.eventManager.emit(eventName),
226
232
  // Collect all subitems, each item is visible by default when collected, and is not selected
227
233
  getOptionsFromChildren: function () {
228
234
  let children = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.props.children;
@@ -1075,7 +1081,8 @@ class Select extends BaseComponent {
1075
1081
  spacing: spacing,
1076
1082
  stopPropagation: stopPropagation,
1077
1083
  disableArrowKeyDown: true,
1078
- onVisibleChange: status => this.handlePopoverVisibleChange(status)
1084
+ onVisibleChange: status => this.handlePopoverVisibleChange(status),
1085
+ afterClose: () => this.foundation.handlePopoverClose()
1079
1086
  }, selection);
1080
1087
  }
1081
1088
 
@@ -344,7 +344,6 @@ export default class TimePicker extends BaseComponent {
344
344
  outerProps.onClick = this.openPanel;
345
345
  }
346
346
 
347
- console.log("===>", disabled ? false : open, motion);
348
347
  return /*#__PURE__*/React.createElement("div", Object.assign({
349
348
  ref: this.setTimePickerRef,
350
349
  className: classNames({
@@ -3,12 +3,12 @@ import PropTypes from 'prop-types';
3
3
  import UploadFoundation from '@douyinfe/semi-foundation/lib/es/upload/foundation';
4
4
  import FileCard from './fileCard';
5
5
  import BaseComponent from '../_base/baseComponent';
6
- import { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError } from './interface';
6
+ import type { 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
9
  import type { CustomFile, UploadAdapter, BeforeUploadObjectResult, AfterUploadResult } from '@douyinfe/semi-foundation/lib/es/upload/foundation';
10
10
  import type { ValidateStatus } from '../_base/baseComponent';
11
- export { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError, BeforeUploadObjectResult, AfterUploadResult, };
11
+ export type { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError, BeforeUploadObjectResult, AfterUploadResult, };
12
12
  export interface UploadProps {
13
13
  accept?: string;
14
14
  action: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-ui",
3
- "version": "2.23.4",
3
+ "version": "2.23.6",
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.23.4",
21
- "@douyinfe/semi-animation-react": "2.23.4",
22
- "@douyinfe/semi-foundation": "2.23.4",
23
- "@douyinfe/semi-icons": "2.23.4",
24
- "@douyinfe/semi-illustrations": "2.23.4",
25
- "@douyinfe/semi-theme-default": "2.23.4",
20
+ "@douyinfe/semi-animation": "2.23.6",
21
+ "@douyinfe/semi-animation-react": "2.23.6",
22
+ "@douyinfe/semi-foundation": "2.23.6",
23
+ "@douyinfe/semi-icons": "2.23.6",
24
+ "@douyinfe/semi-illustrations": "2.23.6",
25
+ "@douyinfe/semi-theme-default": "2.23.6",
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": "39123342dc7146f2afb9d7c6e1a8f108b2c04a9c",
72
+ "gitHead": "d6064611e073d549b28c0ba5395bff3efd74e0ad",
73
73
  "devDependencies": {
74
74
  "@babel/plugin-proposal-decorators": "^7.15.8",
75
75
  "@babel/plugin-transform-runtime": "^7.15.8",