@ucloud-fe/react-components 1.2.18 → 1.3.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.
Files changed (89) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/icon.min.js +1 -1
  3. package/dist/main.min.js +4 -4
  4. package/index.d.ts +46 -41
  5. package/lib/__index.js +4 -0
  6. package/lib/components/AutoComplete/AutoComplete.d.ts +1 -1
  7. package/lib/components/AutoComplete/AutoComplete.js +1 -1
  8. package/lib/components/Calendar/Calendar.d.ts +4 -2
  9. package/lib/components/Calendar/Calendar.js +21 -11
  10. package/lib/components/Calendar/Month.d.ts +3 -28
  11. package/lib/components/Calendar/Month.js +3 -11
  12. package/lib/components/Cascader/Cascade.d.ts +24 -0
  13. package/lib/components/Cascader/Cascade.js +280 -0
  14. package/lib/components/Cascader/CascadeContext.d.ts +7 -0
  15. package/lib/components/Cascader/CascadeContext.js +20 -0
  16. package/lib/components/Cascader/Cascader.d.ts +41 -0
  17. package/lib/components/Cascader/Cascader.js +359 -0
  18. package/lib/components/Cascader/Item.d.ts +14 -0
  19. package/lib/components/Cascader/Item.js +97 -0
  20. package/lib/components/Cascader/Items.d.ts +11 -0
  21. package/lib/components/Cascader/Items.js +175 -0
  22. package/lib/components/Cascader/index.d.ts +2 -0
  23. package/lib/components/Cascader/index.js +13 -0
  24. package/lib/components/Cascader/interface.d.ts +12 -0
  25. package/lib/components/Cascader/interface.js +5 -0
  26. package/lib/components/Cascader/locale/en_US.js +11 -0
  27. package/lib/components/Cascader/locale/zh_CN.d.ts +5 -0
  28. package/lib/components/Cascader/locale/zh_CN.js +11 -0
  29. package/lib/components/Cascader/style/cascade.d.ts +15 -0
  30. package/lib/components/Cascader/style/cascade.js +55 -0
  31. package/lib/components/Cascader/style/index.d.ts +11 -0
  32. package/lib/components/Cascader/style/index.js +49 -0
  33. package/lib/components/Compact/Compact.js +6 -18
  34. package/lib/components/DatePicker/DatePicker.js +9 -3
  35. package/lib/components/DatePicker/Footer.d.ts +1 -1
  36. package/lib/components/DatePicker/Footer.js +3 -27
  37. package/lib/components/DatePicker/Month.js +2 -1
  38. package/lib/components/DatePicker/RangePicker.js +18 -10
  39. package/lib/components/DatePicker/style/index.d.ts +10 -5
  40. package/lib/components/DatePicker/style/index.js +30 -21
  41. package/lib/components/Input/Input.js +21 -18
  42. package/lib/components/LocaleProvider/LocaleProvider.js +1 -1
  43. package/lib/components/LocaleProvider/locale/en_US.js +5 -2
  44. package/lib/components/LocaleProvider/locale/zh_CN.js +5 -2
  45. package/lib/components/LocaleProvider/localeConsumerDecorator.js +1 -1
  46. package/lib/components/LocaleProvider/{locale/runtime.d.ts → runtime.d.ts} +1 -1
  47. package/lib/components/LocaleProvider/{locale/runtime.js → runtime.js} +0 -0
  48. package/lib/components/LocaleProvider/useLocale.js +1 -1
  49. package/lib/components/Menu/Menu.js +2 -2
  50. package/lib/components/Message/Message.js +17 -24
  51. package/lib/components/Message/method.js +22 -4
  52. package/lib/components/Modal/method.js +131 -57
  53. package/lib/components/Notice/Notice.js +15 -20
  54. package/lib/components/Select/Select.js +7 -19
  55. package/lib/components/Table/Table.js +1 -6
  56. package/lib/components/TimePicker/TimePicker.js +2 -2
  57. package/lib/components/TimePicker/style/index.d.ts +3 -0
  58. package/lib/components/TimePicker/style/index.js +29 -7
  59. package/lib/components/Transfer/Transfer.js +4 -3
  60. package/lib/components/Transfer/locale/en_US.js +3 -1
  61. package/lib/components/Transfer/locale/zh_CN.js +3 -1
  62. package/lib/components/Upload/Upload.js +3 -2
  63. package/lib/hooks/group.js +2 -2
  64. package/lib/hooks/useSearch.d.ts +23 -0
  65. package/lib/hooks/useSearch.js +387 -0
  66. package/lib/index.js +5 -1
  67. package/lib/sharedComponents/Search/Highlight.d.ts +4 -2
  68. package/lib/sharedComponents/Search/Highlight.js +1 -24
  69. package/lib/sharedComponents/Search/Search.d.ts +3 -3
  70. package/lib/sharedComponents/Search/Search.js +6 -21
  71. package/lib/sharedComponents/Search/SearchInput.d.ts +4 -0
  72. package/lib/sharedComponents/Search/SearchInput.js +51 -0
  73. package/lib/sharedComponents/Search/index.d.ts +2 -1
  74. package/lib/sharedComponents/Search/index.js +8 -0
  75. package/lib/sharedComponents/Search/style.d.ts +3 -0
  76. package/lib/sharedComponents/Search/style.js +15 -4
  77. package/lib/sharedComponents/VirtualScrollList.d.ts +7 -0
  78. package/lib/sharedComponents/VirtualScrollList.js +68 -0
  79. package/lib/utils/attrs.d.ts +5 -0
  80. package/lib/utils/attrs.js +39 -0
  81. package/lib/utils/deprecatedLog.d.ts +1 -1
  82. package/lib/utils/deprecatedLog.js +8 -1
  83. package/lib/utils/wait.d.ts +2 -0
  84. package/lib/utils/wait.js +23 -0
  85. package/lib/utils/warning.d.ts +4 -2
  86. package/lib/utils/warning.js +19 -4
  87. package/package.json +1 -1
  88. package/lib/sharedComponents/Search/useSearch.d.ts +0 -10
  89. package/lib/sharedComponents/Search/useSearch.js +0 -122
@@ -58,7 +58,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
58
58
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
59
59
 
60
60
  var RangePickerWithoutMemo = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
61
- var _this2 = this;
61
+ var _this2 = this,
62
+ _timeProps$mode;
62
63
 
63
64
  (0, _newArrowCheck2.default)(this, _this);
64
65
  var prefix = _ref.prefix,
@@ -70,8 +71,9 @@ var RangePickerWithoutMemo = /*#__PURE__*/(0, _react.forwardRef)(function (_ref,
70
71
  error = _ref.error,
71
72
  footerTip = _ref.footerTip,
72
73
  pickProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
74
+ var isMonth = type === 'month';
73
75
 
74
- var _usePicker = (0, _usePicker3.default)(_objectSpread({}, pickProps), type === 'month' ? _Month.displayToFormatAndTimeMode : _DatePicker.displayToFormatAndTimeMode, type),
76
+ var _usePicker = (0, _usePicker3.default)(_objectSpread({}, pickProps), isMonth ? _Month.displayToFormatAndTimeMode : _DatePicker.displayToFormatAndTimeMode, type),
75
77
  _usePicker2 = (0, _slicedToArray2.default)(_usePicker, 8),
76
78
  inputProps = _usePicker2[0],
77
79
  popoverProps = _usePicker2[2],
@@ -102,12 +104,17 @@ var RangePickerWithoutMemo = /*#__PURE__*/(0, _react.forwardRef)(function (_ref,
102
104
  onActiveChange(active);
103
105
  }.bind(this), [active, onActiveChange]);
104
106
  var popoverConfigProps = (0, _usePopoverConfig.default)();
105
- var CalendarComp = type === 'month' ? _Calendar.default.Month : _Calendar.default;
107
+ var hasTime = !!((_timeProps$mode = timeProps.mode) !== null && _timeProps$mode !== void 0 && _timeProps$mode.length);
108
+ var CalendarComp = isMonth ? _Calendar.default.Month : _Calendar.default;
106
109
  return readonly ? /*#__PURE__*/_react.default.createElement("span", {
107
110
  className: _style.readonlyInputCls
108
- }, inputProps.value) : /*#__PURE__*/_react.default.createElement(_Popover.default, (0, _extends2.default)({
111
+ }, inputProps.value) : /*#__PURE__*/_react.default.createElement(_style.RangeInputWrap, {
112
+ isMonth: isMonth,
113
+ hasTime: hasTime,
114
+ hasPrefix: prefix
115
+ }, /*#__PURE__*/_react.default.createElement(_Popover.default, (0, _extends2.default)({
109
116
  popup: /*#__PURE__*/_react.default.createElement(_style.SPopup, popupProps, /*#__PURE__*/_react.default.createElement(CalendarComp, (0, _extends2.default)({}, calendarProps, {
110
- sidebar: type === 'month' ? null : timeProps.mode.length ? /*#__PURE__*/_react.default.createElement(_Time.default, timeProps) : null
117
+ sidebar: isMonth ? null : hasTime ? /*#__PURE__*/_react.default.createElement(_Time.default, timeProps) : null
111
118
  })), pickerError && /*#__PURE__*/_react.default.createElement(_Notice.default, {
112
119
  styleType: "error",
113
120
  closable: false
@@ -120,16 +127,17 @@ var RangePickerWithoutMemo = /*#__PURE__*/(0, _react.forwardRef)(function (_ref,
120
127
  tip: footerTip
121
128
  })))
122
129
  }, popoverConfigProps, popoverProps), /*#__PURE__*/_react.default.createElement(_Input.default, (0, _extends2.default)({}, inputProps, {
123
- prefix: prefix ? /*#__PURE__*/_react.default.createElement(_SvgIcon.default, {
124
- type: "calendar"
125
- }) : null,
126
130
  customStyle: {
127
131
  border: 'none',
128
132
  boxShadow: 'none',
129
133
  background: 'none'
130
134
  },
131
- ref: inputRef
132
- })));
135
+ ref: inputRef,
136
+ block: true,
137
+ prefix: prefix ? /*#__PURE__*/_react.default.createElement(_SvgIcon.default, {
138
+ type: "calendar"
139
+ }) : null
140
+ }))));
133
141
  }.bind(void 0));
134
142
 
135
143
  var _default = /*#__PURE__*/(0, _react.memo)(RangePickerWithoutMemo);
@@ -1,17 +1,15 @@
1
1
  /// <reference types="react" />
2
2
  import { Theme, Size } from '../../../style';
3
3
  export declare const prefixCls: string;
4
- export declare const pickerPrefixCls: string;
5
- export declare const monthPickerPrefixCls: string;
6
- export declare const dataWrapCls: string;
7
4
  export declare const dateSeparatorCls: string;
8
5
  export declare const shortcutCls: string;
9
6
  export declare const footerCls: string;
10
7
  export declare const tipCls: string;
11
8
  export declare const readonlyInputCls: string;
12
9
  export declare const PickerContainer: import("react").ForwardRefExoticComponent<{
13
- disabled: boolean;
14
- isMonth: boolean;
10
+ disabled?: boolean | undefined;
11
+ isMonth?: boolean | undefined;
12
+ hasTime?: boolean | undefined;
15
13
  } & import("react").HTMLAttributes<HTMLDivElement> & {
16
14
  theme?: Theme | undefined;
17
15
  } & import("react").RefAttributes<HTMLDivElement>>;
@@ -32,6 +30,13 @@ export declare const RangeContainer: import("react").ForwardRefExoticComponent<{
32
30
  } & import("react").HTMLAttributes<HTMLElement> & {
33
31
  theme?: Theme | undefined;
34
32
  } & import("react").RefAttributes<HTMLElement>>;
33
+ export declare const RangeInputWrap: import("react").ForwardRefExoticComponent<{
34
+ isMonth?: boolean | undefined;
35
+ hasTime?: boolean | undefined;
36
+ hasPrefix?: boolean | undefined;
37
+ } & import("react").HTMLAttributes<HTMLElement> & {
38
+ theme?: Theme | undefined;
39
+ } & import("react").RefAttributes<HTMLElement>>;
35
40
  export declare const RangeSelect: import("@emotion/styled-base").StyledComponent<import("../../Select/Select").SelectProps & Omit<import("react").HTMLAttributes<HTMLDivElement>, keyof import("../../Select/Select").SelectProps>, Pick<import("../../Select/Select").SelectProps & Omit<import("react").HTMLAttributes<HTMLDivElement>, keyof import("../../Select/Select").SelectProps>, "className" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "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" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "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("../../Select/Select").SelectProps>, object>;
36
41
  export declare const RangeDateSeparator: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLElement> & {
37
42
  theme?: Theme | undefined;