@douyinfe/semi-ui 2.23.5 → 2.23.7

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.
@@ -128,7 +128,7 @@ declare class Form<Values extends Record<string, any> = any> extends BaseCompone
128
128
  preventScroll?: boolean;
129
129
  showRestTagsPopover?: boolean;
130
130
  restTagsPopoverProps?: import("../popover").PopoverProps;
131
- } & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "motion" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
131
+ } & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "getPopupContainer" | "motion" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
132
132
  static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
133
133
  static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & React.RefAttributes<any>>;
134
134
  static Radio: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../radio").RadioProps & import("./interface").RCIncludeType>;
@@ -76,7 +76,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
76
76
  preventScroll?: boolean;
77
77
  showRestTagsPopover?: boolean;
78
78
  restTagsPopoverProps?: import("../popover").PopoverProps;
79
- } & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "motion" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
79
+ } & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "getPopupContainer" | "motion" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
80
80
  declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
81
81
  declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
82
82
  declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
@@ -178,7 +178,7 @@ class Preview extends _baseComponent.default {
178
178
  const finalSrcList = [...srcArr, ...srcListInChildren];
179
179
  return /*#__PURE__*/_react.default.createElement(_previewContext.PreviewContext.Provider, {
180
180
  value: {
181
- isGroup: finalSrcList.length > 1,
181
+ isGroup: true,
182
182
  previewSrc: finalSrcList,
183
183
  titles: titles,
184
184
  currentIndex,
@@ -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)({
@@ -128,7 +128,7 @@ declare class Form<Values extends Record<string, any> = any> extends BaseCompone
128
128
  preventScroll?: boolean;
129
129
  showRestTagsPopover?: boolean;
130
130
  restTagsPopoverProps?: import("../popover").PopoverProps;
131
- } & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "motion" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
131
+ } & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "getPopupContainer" | "motion" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
132
132
  static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
133
133
  static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & React.RefAttributes<any>>;
134
134
  static Radio: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../radio").RadioProps & import("./interface").RCIncludeType>;
@@ -76,7 +76,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
76
76
  preventScroll?: boolean;
77
77
  showRestTagsPopover?: boolean;
78
78
  restTagsPopoverProps?: import("../popover").PopoverProps;
79
- } & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "motion" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
79
+ } & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "getPopupContainer" | "motion" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
80
80
  declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
81
81
  declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
82
82
  declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
@@ -159,7 +159,7 @@ export default class Preview extends BaseComponent {
159
159
  const finalSrcList = [...srcArr, ...srcListInChildren];
160
160
  return /*#__PURE__*/React.createElement(PreviewContext.Provider, {
161
161
  value: {
162
- isGroup: finalSrcList.length > 1,
162
+ isGroup: true,
163
163
  previewSrc: finalSrcList,
164
164
  titles: titles,
165
165
  currentIndex,
@@ -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({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-ui",
3
- "version": "2.23.5",
3
+ "version": "2.23.7",
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.5",
21
- "@douyinfe/semi-animation-react": "2.23.5",
22
- "@douyinfe/semi-foundation": "2.23.5",
23
- "@douyinfe/semi-icons": "2.23.5",
24
- "@douyinfe/semi-illustrations": "2.23.5",
25
- "@douyinfe/semi-theme-default": "2.23.5",
20
+ "@douyinfe/semi-animation": "2.23.7",
21
+ "@douyinfe/semi-animation-react": "2.23.7",
22
+ "@douyinfe/semi-foundation": "2.23.7",
23
+ "@douyinfe/semi-icons": "2.23.7",
24
+ "@douyinfe/semi-illustrations": "2.23.7",
25
+ "@douyinfe/semi-theme-default": "2.23.7",
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": "c3cd98419912c96831a20c5a9f8ce33295b19d5d",
72
+ "gitHead": "996162500406cee116c1d6eabd3f0fcb316e69ea",
73
73
  "devDependencies": {
74
74
  "@babel/plugin-proposal-decorators": "^7.15.8",
75
75
  "@babel/plugin-transform-runtime": "^7.15.8",