@ucloud-fe/react-components 1.4.6 → 1.5.2

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.
Files changed (65) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/icon.min.js +1 -1
  3. package/dist/main.min.js +4 -4
  4. package/lib/components/ActionList/ActionList.d.ts +3 -1
  5. package/lib/components/ActionList/ActionList.js +79 -5
  6. package/lib/components/ActionList/index.d.ts +1 -1
  7. package/lib/components/ActionList/style/index.d.ts +2 -0
  8. package/lib/components/ActionList/style/index.js +33 -2
  9. package/lib/components/ConfigProvider/ConfigContext.d.ts +1 -1
  10. package/lib/components/ConfigProvider/ConfigProvider.d.ts +2 -0
  11. package/lib/components/ConfigProvider/ConfigProvider.js +2 -1
  12. package/lib/components/ConfigProvider/index.d.ts +4 -2
  13. package/lib/components/ConfigProvider/index.js +8 -1
  14. package/lib/components/DatePicker/DatePicker.d.ts +5 -1
  15. package/lib/components/Form/ControllerContext.d.ts +1 -1
  16. package/lib/components/Input/.recodo/interaction.js +2 -2
  17. package/lib/components/Input/Input.js +12 -60
  18. package/lib/components/Input/Search.js +1 -0
  19. package/lib/components/Input/style/index.d.ts +23 -8
  20. package/lib/components/Input/style/index.js +97 -17
  21. package/lib/components/Menu/Item.js +9 -2
  22. package/lib/components/Menu/Menu.d.ts +11 -3
  23. package/lib/components/Menu/Menu.js +23 -9
  24. package/lib/components/Menu/MenuContext.d.ts +1 -0
  25. package/lib/components/Menu/index.d.ts +2 -2
  26. package/lib/components/Menu/style/index.d.ts +3 -0
  27. package/lib/components/Menu/style/index.js +14 -8
  28. package/lib/components/Notice/index.d.ts +1 -1
  29. package/lib/components/Select/Group.d.ts +3 -0
  30. package/lib/components/Select/Group.js +4 -0
  31. package/lib/components/Select/Option.js +2 -28
  32. package/lib/components/Select/Overflow.d.ts +19 -0
  33. package/lib/components/Select/Overflow.js +155 -0
  34. package/lib/components/Select/Select.d.ts +15 -9
  35. package/lib/components/Select/Select.js +1150 -322
  36. package/lib/components/Select/SelectContext.d.ts +1 -1
  37. package/lib/components/Select/index.d.ts +3 -1
  38. package/lib/components/Select/locale/en_US.js +2 -1
  39. package/lib/components/Select/locale/zh_CN.d.ts +1 -0
  40. package/lib/components/Select/locale/zh_CN.js +2 -1
  41. package/lib/components/Select/style/index.d.ts +45 -8
  42. package/lib/components/Select/style/index.js +132 -46
  43. package/lib/components/SvgIcon/icons/ArrowDown.js +2 -2
  44. package/lib/components/SvgIcon/icons/ArrowLeft.js +3 -2
  45. package/lib/components/SvgIcon/icons/ArrowRight.js +2 -2
  46. package/lib/components/SvgIcon/icons/ArrowUp.js +2 -2
  47. package/lib/components/SvgIcon/icons/DoubleArrowLeft.js +4 -7
  48. package/lib/components/SvgIcon/icons/DoubleArrowRight.js +4 -6
  49. package/lib/components/SvgIcon/style/index.js +2 -2
  50. package/lib/components/Tabs/style/index.d.ts +1 -1
  51. package/lib/config.d.ts +4 -2
  52. package/lib/config.js +22 -4
  53. package/lib/hooks/group.d.ts +1 -1
  54. package/lib/hooks/group.js +5 -9
  55. package/lib/hooks/useConfig.d.ts +2 -0
  56. package/lib/hooks/useConfig.js +30 -0
  57. package/lib/hooks/useOverflow.d.ts +24 -0
  58. package/lib/hooks/useOverflow.js +140 -0
  59. package/lib/hooks/useUncontrolled.d.ts +1 -1
  60. package/lib/hooks/useUncontrolled.js +1 -1
  61. package/lib/libs/rc-table/Table.js +2 -3
  62. package/lib/sharedComponents/InputWrap.d.ts +16 -0
  63. package/lib/sharedComponents/InputWrap.js +66 -0
  64. package/lib/utils/pick.d.ts +1 -1
  65. package/package.json +3 -3
@@ -22,6 +22,8 @@ export interface DefinedActionListProps {
22
22
  actionList: ActionInfo[];
23
23
  /** 暴露的操作数量 */
24
24
  exposeCount?: number;
25
+ /** 是否自动按照宽度调整展示数量 */
26
+ autoAdjustment?: boolean;
25
27
  /** 控件尺寸 */
26
28
  size?: Size;
27
29
  /** 操作数量等于 exposeCount+1 时是否直接显示按钮而不是显示下拉菜单 */
@@ -34,5 +36,5 @@ export interface DefinedActionListProps {
34
36
  popoverProps?: any;
35
37
  }
36
38
  export declare type ActionListProps = DefinedActionListProps & Override<HTMLAttributes<HTMLDivElement>, DefinedActionListProps>;
37
- declare const _default: React.MemoExoticComponent<({ actionList, exposeCount, size, smart, buttonStyleType, popoverProps, dropdownButton, className, ...rest }: ActionListProps) => JSX.Element>;
39
+ declare const _default: React.MemoExoticComponent<({ autoAdjustment: _autoAdjustment, ...rest }: ActionListProps) => JSX.Element>;
38
40
  export default _default;
@@ -33,18 +33,24 @@ var _Popover = _interopRequireDefault(require("../../components/Popover"));
33
33
 
34
34
  var _Tooltip = _interopRequireDefault(require("../../components/Tooltip"));
35
35
 
36
- var _Combine = _interopRequireDefault(require("../../components/Combine"));
37
-
38
36
  var _SvgIcon = _interopRequireDefault(require("../../components/SvgIcon"));
39
37
 
40
38
  var _usePopoverConfig = _interopRequireDefault(require("../../hooks/usePopoverConfig"));
41
39
 
40
+ var _useOverflow3 = _interopRequireDefault(require("../../hooks/useOverflow"));
41
+
42
42
  var _style = require("./style");
43
43
 
44
+ var _useConfig2 = _interopRequireDefault(require("../../hooks/useConfig"));
45
+
46
+ var _config = _interopRequireDefault(require("../../config"));
47
+
44
48
  var _excluded = ["onClick", "disabled", "handleHide"],
45
49
  _excluded2 = ["label", "tooltip"],
46
50
  _excluded3 = ["label", "disabled", "onClick"],
47
- _excluded4 = ["actionList", "exposeCount", "size", "smart", "buttonStyleType", "popoverProps", "dropdownButton", "className"];
51
+ _excluded4 = ["actionList", "exposeCount", "size", "smart", "buttonStyleType", "popoverProps", "dropdownButton", "className"],
52
+ _excluded5 = ["actionList", "exposeCount", "smart"],
53
+ _excluded6 = ["autoAdjustment"];
48
54
 
49
55
  var _this = void 0;
50
56
 
@@ -190,7 +196,10 @@ var ActionMenu = function ActionMenu(_ref3) {
190
196
  }));
191
197
  }.bind(void 0);
192
198
 
193
- var ActionList = function ActionList(_ref4) {
199
+ var _uid = 0;
200
+ var ID_KEY = 'data-urc-action_list-id';
201
+
202
+ var PureActionList = function PureActionList(_ref4) {
194
203
  (0, _newArrowCheck2.default)(this, _this);
195
204
  var _ref4$actionList = _ref4.actionList,
196
205
  actionList = _ref4$actionList === void 0 ? [] : _ref4$actionList,
@@ -229,7 +238,7 @@ var ActionList = function ActionList(_ref4) {
229
238
  size: size,
230
239
  buttonStyleType: buttonStyleType
231
240
  };
232
- return /*#__PURE__*/_react.default.createElement(_Combine.default, (0, _extends2.default)({}, rest, {
241
+ return /*#__PURE__*/_react.default.createElement(_style.SWrap, (0, _extends2.default)({}, rest, {
233
242
  className: (0, _classnames.default)(_style.prefixCls, className),
234
243
  sharedProps: {
235
244
  size: size
@@ -245,6 +254,70 @@ var ActionList = function ActionList(_ref4) {
245
254
  })) : null);
246
255
  }.bind(void 0);
247
256
 
257
+ var AutoAdjustmentActionList = function AutoAdjustmentActionList(_ref5) {
258
+ var _this6 = this;
259
+
260
+ (0, _newArrowCheck2.default)(this, _this);
261
+
262
+ var _ref5$actionList = _ref5.actionList,
263
+ actionList = _ref5$actionList === void 0 ? [] : _ref5$actionList,
264
+ _ref5$exposeCount = _ref5.exposeCount,
265
+ _exposeCount = _ref5$exposeCount === void 0 ? 3 : _ref5$exposeCount,
266
+ smart = _ref5.smart,
267
+ rest = (0, _objectWithoutProperties2.default)(_ref5, _excluded5);
268
+
269
+ var _useState3 = (0, _react.useState)(function () {
270
+ (0, _newArrowCheck2.default)(this, _this6);
271
+ return _uid++;
272
+ }.bind(this)),
273
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 1),
274
+ uid = _useState4[0];
275
+
276
+ var l = actionList.length;
277
+ var containerRef = (0, _react.useRef)(null);
278
+ (0, _react.useLayoutEffect)(function () {
279
+ (0, _newArrowCheck2.default)(this, _this6);
280
+ containerRef.current = document.querySelector("[".concat(ID_KEY, "=\"").concat(uid, "\"]"));
281
+ }.bind(this), [uid]);
282
+ var maxCount = (0, _react.useMemo)(function () {
283
+ (0, _newArrowCheck2.default)(this, _this6);
284
+ var maxCount = Math.min(l, Math.max(_exposeCount, 0));
285
+ if (maxCount === l - 1 && smart) maxCount = l;
286
+ return maxCount;
287
+ }.bind(this), [_exposeCount, l, smart]);
288
+
289
+ var _useOverflow = (0, _useOverflow3.default)({
290
+ containerRef: containerRef,
291
+ defaultCount: maxCount,
292
+ maxCount: maxCount
293
+ }),
294
+ _useOverflow2 = (0, _slicedToArray2.default)(_useOverflow, 1),
295
+ exposeCount = _useOverflow2[0];
296
+
297
+ return /*#__PURE__*/_react.default.createElement(PureActionList, (0, _extends2.default)({}, rest, {
298
+ actionList: actionList,
299
+ exposeCount: exposeCount,
300
+ smart: false
301
+ }, (0, _defineProperty2.default)({}, ID_KEY, uid)));
302
+ }.bind(void 0);
303
+
304
+ var ActionList = function ActionList(_ref7) {
305
+ (0, _newArrowCheck2.default)(this, _this);
306
+ var _autoAdjustment = _ref7.autoAdjustment,
307
+ rest = (0, _objectWithoutProperties2.default)(_ref7, _excluded6);
308
+
309
+ var _useConfig = (0, _useConfig2.default)(),
310
+ actionListAutoAdjustment = _useConfig.actionListAutoAdjustment;
311
+
312
+ var autoAdjustment = _autoAdjustment === undefined ? actionListAutoAdjustment === undefined ? _config.default.actionListAutoAdjustment : actionListAutoAdjustment : _autoAdjustment;
313
+
314
+ if (autoAdjustment) {
315
+ return /*#__PURE__*/_react.default.createElement(AutoAdjustmentActionList, rest);
316
+ } else {
317
+ return /*#__PURE__*/_react.default.createElement(PureActionList, rest);
318
+ }
319
+ }.bind(void 0);
320
+
248
321
  ActionList.propTypes = {
249
322
  actionList: _propTypes.default.arrayOf(_propTypes.default.shape({
250
323
  label: _propTypes.default.node,
@@ -266,6 +339,7 @@ ActionList.propTypes = {
266
339
  disabled: _propTypes.default.bool
267
340
  })).isRequired,
268
341
  exposeCount: _propTypes.default.number,
342
+ autoAdjustment: _propTypes.default.bool,
269
343
  smart: _propTypes.default.bool,
270
344
  popoverProps: _propTypes.default.any
271
345
  };
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { ActionListProps } from './ActionList';
3
3
  declare const ExportActionList: import("react").NamedExoticComponent<import("./ActionList").DefinedActionListProps & Omit<import("react").HTMLAttributes<HTMLDivElement>, keyof import("./ActionList").DefinedActionListProps>> & {
4
- readonly type: ({ actionList, exposeCount, size, smart, buttonStyleType, popoverProps, dropdownButton, className, ...rest }: ActionListProps) => JSX.Element;
4
+ readonly type: ({ autoAdjustment: _autoAdjustment, ...rest }: ActionListProps) => JSX.Element;
5
5
  } & {
6
6
  Sizes: ["sm", "md", "lg"];
7
7
  ButtonStyleTypes: ["primary", "border", "border-gray"];
@@ -1 +1,3 @@
1
+ /// <reference types="react" />
1
2
  export declare const prefixCls: string;
3
+ export declare const SWrap: import("@emotion/styled-base").StyledComponent<import("../../Combine/Combine").DefinedCombineProps & Omit<import("react").HTMLAttributes<HTMLDivElement>, keyof import("../../Combine/Combine").DefinedCombineProps>, Pick<import("../../Combine/Combine").DefinedCombineProps & Omit<import("react").HTMLAttributes<HTMLDivElement>, keyof import("../../Combine/Combine").DefinedCombineProps>, "className" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css" | keyof import("../../Combine/Combine").DefinedCombineProps>, object>;
@@ -5,10 +5,41 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.prefixCls = void 0;
8
+ exports.SWrap = exports.prefixCls = void 0;
9
+
10
+ var _newArrowCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/newArrowCheck"));
11
+
12
+ var _styledBase = _interopRequireDefault(require("@emotion/styled-base"));
13
+
14
+ var _core = require("@emotion/core");
15
+
16
+ var _Combine = _interopRequireDefault(require("../../../components/Combine"));
9
17
 
10
18
  var _config = _interopRequireDefault(require("../../../config"));
11
19
 
20
+ var _this = void 0;
21
+
22
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
23
+
12
24
  var _prefixCls = _config.default.prefixCls;
13
25
  var prefixCls = _prefixCls + '-actionlist';
14
- exports.prefixCls = prefixCls;
26
+ exports.prefixCls = prefixCls;
27
+
28
+ var _ref = process.env.NODE_ENV === "production" ? {
29
+ name: "1rn6kt6-SWrap",
30
+ styles: "white-space:nowrap;;label:SWrap;"
31
+ } : {
32
+ name: "1rn6kt6-SWrap",
33
+ styles: "white-space:nowrap;;label:SWrap;",
34
+ map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0FjdGlvbkxpc3Qvc3R5bGUvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBVWMiLCJmaWxlIjoiLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvQWN0aW9uTGlzdC9zdHlsZS9pbmRleC50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL2NvcmUnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuXG5pbXBvcnQgQ29tYmluZSBmcm9tICdzcmMvY29tcG9uZW50cy9Db21iaW5lJztcbmltcG9ydCBjb25maWcgZnJvbSAnc3JjL2NvbmZpZyc7XG5cbmNvbnN0IHsgcHJlZml4Q2xzOiBfcHJlZml4Q2xzIH0gPSBjb25maWc7XG5leHBvcnQgY29uc3QgcHJlZml4Q2xzID0gX3ByZWZpeENscyArICctYWN0aW9ubGlzdCc7XG5cbmV4cG9ydCBjb25zdCBTV3JhcCA9IHN0eWxlZChDb21iaW5lKSgoKSA9PiB7XG4gICAgcmV0dXJuIGNzc2BcbiAgICAgICAgd2hpdGUtc3BhY2U6IG5vd3JhcDtcbiAgICBgO1xufSk7XG4iXX0= */",
35
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
36
+ };
37
+
38
+ var SWrap = ( /*#__PURE__*/0, _styledBase.default)(_Combine.default, {
39
+ target: "e17ez9160",
40
+ label: "SWrap"
41
+ })(function () {
42
+ (0, _newArrowCheck2.default)(this, _this);
43
+ return _ref;
44
+ }.bind(void 0), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0FjdGlvbkxpc3Qvc3R5bGUvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBU3FCIiwiZmlsZSI6Ii4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0FjdGlvbkxpc3Qvc3R5bGUvaW5kZXgudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9jb3JlJztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcblxuaW1wb3J0IENvbWJpbmUgZnJvbSAnc3JjL2NvbXBvbmVudHMvQ29tYmluZSc7XG5pbXBvcnQgY29uZmlnIGZyb20gJ3NyYy9jb25maWcnO1xuXG5jb25zdCB7IHByZWZpeENsczogX3ByZWZpeENscyB9ID0gY29uZmlnO1xuZXhwb3J0IGNvbnN0IHByZWZpeENscyA9IF9wcmVmaXhDbHMgKyAnLWFjdGlvbmxpc3QnO1xuXG5leHBvcnQgY29uc3QgU1dyYXAgPSBzdHlsZWQoQ29tYmluZSkoKCkgPT4ge1xuICAgIHJldHVybiBjc3NgXG4gICAgICAgIHdoaXRlLXNwYWNlOiBub3dyYXA7XG4gICAgYDtcbn0pO1xuIl19 */");
45
+ exports.SWrap = SWrap;
@@ -4,6 +4,6 @@ export declare const defaultConfig: {
4
4
  forwardPopupContainer: boolean;
5
5
  preventFormDefaultAction: boolean;
6
6
  };
7
- export declare type ConfigContextType = Pick<ConfigProviderProps, 'forwardPopupContainer' | 'popover' | 'preventFormDefaultAction' | 'iconDefaultPrefix'>;
7
+ export declare type ConfigContextType = Pick<ConfigProviderProps, 'forwardPopupContainer' | 'popover' | 'preventFormDefaultAction' | 'iconDefaultPrefix' | 'actionListAutoAdjustment'>;
8
8
  declare const _default: import("react").Context<ConfigContextType>;
9
9
  export default _default;
@@ -33,6 +33,8 @@ export interface ConfigProviderProps {
33
33
  theme?: any;
34
34
  /** 提供时会使用 LocaleProvider 包裹 */
35
35
  locale?: AllLocaleMap;
36
+ /** 是否默认启用 ActionList 的 autoAdJustment 参数 */
37
+ actionListAutoAdjustment?: boolean;
36
38
  }
37
39
  declare const ConfigProvider: ({ children, theme, locale, ...rest }: ConfigProviderProps) => JSX.Element;
38
40
  export default ConfigProvider;
@@ -68,7 +68,8 @@ ConfigProvider.propTypes = {
68
68
  }),
69
69
  preventFormDefaultAction: _propTypes.default.bool,
70
70
  iconDefaultPrefix: _propTypes.default.string,
71
- theme: _propTypes.default.any
71
+ theme: _propTypes.default.any,
72
+ actionListAutoAdjustment: _propTypes.default.bool
72
73
  };
73
74
  var _default = ConfigProvider;
74
75
  exports.default = _default;
@@ -1,2 +1,4 @@
1
- import ConfigProvider from './ConfigProvider';
2
- export default ConfigProvider;
1
+ declare const ExportConfigProvider: (({ children, theme, locale, ...rest }: import("./ConfigProvider").ConfigProviderProps) => JSX.Element) & {
2
+ setConfig: (_config: any) => void;
3
+ };
4
+ export default ExportConfigProvider;
@@ -7,7 +7,14 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
 
10
+ var _config = require("../../config");
11
+
12
+ var _type = require("../../type");
13
+
10
14
  var _ConfigProvider = _interopRequireDefault(require("./ConfigProvider"));
11
15
 
12
- var _default = _ConfigProvider.default;
16
+ var ExportConfigProvider = (0, _type.ExportComponent)(_ConfigProvider.default, {
17
+ setConfig: _config.setConfig
18
+ });
19
+ var _default = ExportConfigProvider;
13
20
  exports.default = _default;
@@ -44,7 +44,11 @@ export declare type DatePickerProps = {
44
44
  status?: 'default' | 'error';
45
45
  /** placeholder */
46
46
  placeholder?: string;
47
- /** 面板快捷内容 */
47
+ /**
48
+ * @deprecated 新版交互已移除相关展示
49
+ * @ignore
50
+ * 面板快捷内容
51
+ */
48
52
  shortcuts?: TShortcut[] | null;
49
53
  /** 自定义 popover,参考 popover */
50
54
  popoverProps?: any;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  declare const ControllerContext: React.Context<{
3
- status?: "loading" | "default" | "success" | "warning" | "error" | undefined;
3
+ status?: "loading" | "default" | "error" | "success" | "warning" | undefined;
4
4
  }>;
5
5
  export default ControllerContext;
@@ -24,8 +24,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
24
24
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
25
 
26
26
  var config = {
27
- size: _interactionDemo.USE_DEFINE,
28
- clearable: _interactionDemo.USE_DEFINE,
27
+ size: ['sm', 'md', 'lg'],
28
+ clearable: 'boolean',
29
29
  disabled: 'boolean',
30
30
  block: _interactionDemo.USE_DEFINE,
31
31
  status: _interactionDemo.USE_DEFINE,
@@ -19,16 +19,8 @@ var _newArrowCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/new
19
19
 
20
20
  var _react = _interopRequireWildcard(require("react"));
21
21
 
22
- var _classnames = _interopRequireDefault(require("classnames"));
23
-
24
- var _Icon = _interopRequireDefault(require("../../components/Icon"));
25
-
26
- var _SvgIcon = _interopRequireDefault(require("../../components/SvgIcon"));
27
-
28
22
  var _ControllerContext = _interopRequireDefault(require("../../components/Form/ControllerContext"));
29
23
 
30
- var _deprecatedLog = _interopRequireDefault(require("../../utils/deprecatedLog"));
31
-
32
24
  var _noop = _interopRequireDefault(require("../../utils/noop"));
33
25
 
34
26
  var _useUncontrolled3 = _interopRequireDefault(require("../../hooks/useUncontrolled"));
@@ -43,7 +35,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
43
35
 
44
36
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
45
37
 
46
- var deprecatedLogForIcon = (0, _deprecatedLog.default)('Input icon', 'suffix');
47
38
  var Input = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
48
39
  var _this2 = this;
49
40
 
@@ -76,7 +67,7 @@ var Input = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
76
67
  }.bind(this), []);
77
68
 
78
69
  var _useUncontrolled = (0, _useUncontrolled3.default)(_value, defaultValue || '', _onChange, {
79
- setter: valueGetter
70
+ getter: valueGetter
80
71
  }),
81
72
  _useUncontrolled2 = (0, _slicedToArray2.default)(_useUncontrolled, 2),
82
73
  value = _useUncontrolled2[0],
@@ -144,67 +135,22 @@ var Input = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
144
135
  e.preventDefault();
145
136
  (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
146
137
  }.bind(this), []);
147
- var renderClear = (0, _react.useMemo)(function () {
148
- (0, _newArrowCheck2.default)(this, _this2);
149
-
150
- if (clearable) {
151
- return /*#__PURE__*/_react.default.createElement("span", {
152
- className: _style.clearCls,
153
- onClick: handleClear,
154
- onMouseDown: handleClearMouseDown
155
- }, /*#__PURE__*/_react.default.createElement(_SvgIcon.default, {
156
- type: "cross-circle-filled"
157
- }));
158
- }
159
- }.bind(this), [clearable, handleClear, handleClearMouseDown]);
160
- var renderPrefix = (0, _react.useMemo)(function () {
161
- (0, _newArrowCheck2.default)(this, _this2);
162
- return prefix && /*#__PURE__*/_react.default.createElement("span", {
163
- className: _style.inputPrefixCls
164
- }, prefix);
165
- }.bind(this), [prefix]);
166
- var renderSuffix = (0, _react.useMemo)(function () {
167
- (0, _newArrowCheck2.default)(this, _this2);
168
-
169
- if (icon) {
170
- deprecatedLogForIcon();
171
- }
172
-
173
- var renderSuffix = null;
174
-
175
- if (suffix) {
176
- renderSuffix = suffix;
177
- } else if (typeof icon === 'string') {
178
- renderSuffix = /*#__PURE__*/_react.default.createElement(_Icon.default, {
179
- type: icon
180
- });
181
- } else if ( /*#__PURE__*/_react.default.isValidElement(icon)) {
182
- renderSuffix = icon;
183
- }
184
-
185
- if (renderSuffix) {
186
- return /*#__PURE__*/_react.default.createElement("span", {
187
- className: _style.inputSuffixCls
188
- }, renderSuffix);
189
- }
190
- }.bind(this), [icon, suffix]);
191
138
 
192
139
  var _useContext = (0, _react.useContext)(_ControllerContext.default),
193
140
  status = _useContext.status;
194
141
 
195
- return /*#__PURE__*/_react.default.createElement(_style.SWrap, {
196
- className: (0, _classnames.default)(block && _style.blockCls, className),
142
+ return /*#__PURE__*/_react.default.createElement(_style.InputWrap, {
197
143
  size: size,
198
144
  focused: focused,
199
145
  style: style,
200
146
  disabled: disabled,
201
147
  status: _status || status,
202
148
  customStyle: customStyle,
149
+ block: block,
150
+ className: className,
203
151
  empty: !value,
204
152
  onMouseDown: handleWrapMouseDown
205
- }, /*#__PURE__*/_react.default.createElement("span", {
206
- className: _style.inputWrapCls
207
- }, renderPrefix, /*#__PURE__*/_react.default.createElement("span", {
153
+ }, /*#__PURE__*/_react.default.createElement(_style.Prefix, null, prefix), /*#__PURE__*/_react.default.createElement("span", {
208
154
  className: _style.inputBlockWrapCls
209
155
  }, /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({}, rest, {
210
156
  value: value,
@@ -213,7 +159,13 @@ var Input = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
213
159
  onFocus: handleFocus,
214
160
  onBlur: handleBlur,
215
161
  disabled: disabled
216
- })), renderClear), renderSuffix));
162
+ })), /*#__PURE__*/_react.default.createElement(_style.Clear, {
163
+ clearable: clearable,
164
+ onMouseDown: handleClearMouseDown,
165
+ onClick: handleClear
166
+ })), /*#__PURE__*/_react.default.createElement(_style.Suffix, {
167
+ icon: icon
168
+ }, suffix));
217
169
  }.bind(void 0));
218
170
 
219
171
  var _default = /*#__PURE__*/_react.default.memo(Input);
@@ -71,6 +71,7 @@ var Search = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
71
71
  ref: inputRef,
72
72
  suffix: /*#__PURE__*/_react.default.createElement(_style.SearchIcon, {
73
73
  type: "search",
74
+ disabled: disabled,
74
75
  onClick: onSearch
75
76
  })
76
77
  }));
@@ -1,19 +1,34 @@
1
- /// <reference types="react" />
1
+ import React, { CSSProperties, ReactNode } from 'react';
2
2
  import SvgIcon from '../../../components/SvgIcon';
3
3
  import { InputProps } from '../Input';
4
4
  export declare const prefixCls: string;
5
5
  export declare const focusedCls: string;
6
6
  export declare const disabledCls: string;
7
7
  export declare const blockCls: string;
8
- export declare const inputWrapCls: string;
9
8
  export declare const inputPrefixCls: string;
10
9
  export declare const inputSuffixCls: string;
11
10
  export declare const clearCls: string;
12
11
  export declare const inputBlockWrapCls: string;
13
- export declare const SearchIcon: import("@emotion/styled-base").StyledComponent<Pick<any, string | number | symbol> & import("react").RefAttributes<SvgIcon>, Pick<Pick<any, string | number | symbol> & import("react").RefAttributes<SvgIcon>, string | number | symbol>, object>;
14
- export declare const SWrap: import("react").ForwardRefExoticComponent<Pick<InputProps, "customStyle" | "disabled" | "status"> & Required<Pick<InputProps, "size">> & {
15
- focused: boolean;
16
- empty: boolean;
17
- } & import("react").HTMLAttributes<HTMLSpanElement> & {
12
+ export declare const SearchIcon: import("@emotion/styled-base").StyledComponent<Pick<any, string | number | symbol> & React.RefAttributes<SvgIcon>, Pick<Pick<any, string | number | symbol> & React.RefAttributes<SvgIcon>, string | number | symbol>, object>;
13
+ export declare const Prefix: React.NamedExoticComponent<object>;
14
+ export declare const Suffix: React.NamedExoticComponent<{
15
+ icon?: string | ReactNode;
16
+ children?: ReactNode;
17
+ }>;
18
+ export declare const Clear: React.NamedExoticComponent<Pick<InputProps, "clearable"> & React.HTMLAttributes<HTMLSpanElement>>;
19
+ export declare const InputPart: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
20
+ stretch?: boolean | undefined;
21
+ visible?: boolean | undefined;
22
+ }, object>;
23
+ export declare type InputWrapProps = Pick<InputProps, 'block' | 'disabled' | 'status' | 'customStyle'> & Required<Pick<InputProps, 'size'>> & {
24
+ focused?: boolean;
25
+ empty?: boolean;
26
+ cursor?: CSSProperties['cursor'];
27
+ };
28
+ export declare const InputWrap: React.ForwardRefExoticComponent<Pick<InputProps, "block" | "customStyle" | "disabled" | "status"> & Required<Pick<InputProps, "size">> & {
29
+ focused?: boolean | undefined;
30
+ empty?: boolean | undefined;
31
+ cursor?: CSSProperties['cursor'];
32
+ } & React.HTMLAttributes<HTMLSpanElement> & {
18
33
  theme?: import("../../../style").Theme | undefined;
19
- } & import("react").RefAttributes<HTMLSpanElement>>;
34
+ } & React.RefAttributes<HTMLSpanElement>>;