@ucloud-fe/react-components 1.4.2 → 1.4.3
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/CHANGELOG.md +6 -0
- package/dist/main.min.js +2 -2
- package/lib/components/DatePicker/Range.js +24 -2
- package/lib/components/DatePicker/style/index.d.ts +6 -6
- package/lib/components/DatePicker/style/index.js +18 -33
- package/lib/components/DatePicker/usePicker.js +9 -14
- package/lib/components/Input/Input.d.ts +4 -1
- package/lib/components/Input/Input.js +11 -5
- package/lib/components/Input/style/index.js +7 -3
- package/package.json +1 -1
|
@@ -214,6 +214,13 @@ var Range = function Range(_ref2) {
|
|
|
214
214
|
shortcutsS = _ref6[0],
|
|
215
215
|
shortcutsE = _ref6[1];
|
|
216
216
|
|
|
217
|
+
var startRangeInputRef = (0, _react.useRef)(null);
|
|
218
|
+
|
|
219
|
+
var _useState7 = (0, _react.useState)(200),
|
|
220
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
221
|
+
startRangeInputWidth = _useState8[0],
|
|
222
|
+
setStartRangeInputWidth = _useState8[1];
|
|
223
|
+
|
|
217
224
|
(0, _useDidMount.default)(function () {
|
|
218
225
|
(0, _newArrowCheck2.default)(this, _this3);
|
|
219
226
|
|
|
@@ -401,6 +408,15 @@ var Range = function Range(_ref2) {
|
|
|
401
408
|
}.bind(this));
|
|
402
409
|
}
|
|
403
410
|
}.bind(this), [activeE, activeS]);
|
|
411
|
+
(0, _react.useEffect)(function () {
|
|
412
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
413
|
+
|
|
414
|
+
if (activeE) {
|
|
415
|
+
var _startRangeInputRef$c;
|
|
416
|
+
|
|
417
|
+
setStartRangeInputWidth(((_startRangeInputRef$c = startRangeInputRef.current) === null || _startRangeInputRef$c === void 0 ? void 0 : _startRangeInputRef$c.offsetWidth) || 200);
|
|
418
|
+
}
|
|
419
|
+
}.bind(this), [activeE]);
|
|
404
420
|
var CalendarComp = isMonth ? _Calendar.default.Month : hasTime ? _Calendar.default : _Calendar.TwoSide;
|
|
405
421
|
return /*#__PURE__*/_react.default.createElement(_style.RangeContainer, (0, _extends2.default)({}, rest, {
|
|
406
422
|
disabled: disabled
|
|
@@ -417,7 +433,11 @@ var Range = function Range(_ref2) {
|
|
|
417
433
|
visible: activeS || activeE,
|
|
418
434
|
popup: /*#__PURE__*/_react.default.createElement(_style.SPopup, (0, _extends2.default)({}, popupProps, {
|
|
419
435
|
endInputHighlight: activeE
|
|
420
|
-
}
|
|
436
|
+
}), /*#__PURE__*/_react.default.createElement(_style.Arrow, {
|
|
437
|
+
style: {
|
|
438
|
+
left: activeE ? startRangeInputWidth + 'px' : '20px'
|
|
439
|
+
}
|
|
440
|
+
}), /*#__PURE__*/_react.default.createElement(_style.RangeCalendarWrap, {
|
|
421
441
|
visible: activeS
|
|
422
442
|
}, /*#__PURE__*/_react.default.createElement(CalendarComp, (0, _extends2.default)({}, calendarPropsS, {
|
|
423
443
|
rangeValue: [calendarPropsS.value, cacheValue === null || cacheValue === void 0 ? void 0 : cacheValue[1]],
|
|
@@ -443,7 +463,9 @@ var Range = function Range(_ref2) {
|
|
|
443
463
|
status: status || contextStatus
|
|
444
464
|
}, readonly ? /*#__PURE__*/_react.default.createElement("span", {
|
|
445
465
|
className: _style.readonlyInputCls
|
|
446
|
-
}, inputPropsS.value) : /*#__PURE__*/_react.default.createElement(_style.RangeInputWrap,
|
|
466
|
+
}, inputPropsS.value) : /*#__PURE__*/_react.default.createElement(_style.RangeInputWrap, (0, _extends2.default)({}, inputWrapPropsS, {
|
|
467
|
+
ref: startRangeInputRef
|
|
468
|
+
}), /*#__PURE__*/_react.default.createElement(_Input.default, (0, _extends2.default)({}, inputPropsS, {
|
|
447
469
|
ref: inputRefS
|
|
448
470
|
}))), readonly ? /*#__PURE__*/_react.default.createElement("span", {
|
|
449
471
|
className: _style.readonlyInputCls
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { InputProps } from '../../../components/Input';
|
|
3
|
-
import {
|
|
3
|
+
import { Size } from '../../../style';
|
|
4
4
|
export declare const prefixCls: string;
|
|
5
5
|
export declare const dateSeparatorCls: string;
|
|
6
6
|
export declare const shortcutCls: string;
|
|
@@ -17,7 +17,7 @@ export declare const PickerContainer: import("react").ForwardRefExoticComponent<
|
|
|
17
17
|
hasTime?: boolean | undefined;
|
|
18
18
|
status?: InputProps['status'];
|
|
19
19
|
} & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
20
|
-
theme?: Theme | undefined;
|
|
20
|
+
theme?: import("../../../style").Theme | undefined;
|
|
21
21
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
22
22
|
export declare const SPopup: import("react").ForwardRefExoticComponent<{
|
|
23
23
|
endInputHighlight: boolean;
|
|
@@ -27,7 +27,7 @@ export declare const SPopup: import("react").ForwardRefExoticComponent<{
|
|
|
27
27
|
hasSuffix?: boolean | undefined;
|
|
28
28
|
clearable?: boolean | undefined;
|
|
29
29
|
} & import("react").HTMLAttributes<HTMLElement> & {
|
|
30
|
-
theme?: Theme | undefined;
|
|
30
|
+
theme?: import("../../../style").Theme | undefined;
|
|
31
31
|
} & import("react").RefAttributes<HTMLElement>>;
|
|
32
32
|
export declare const SRangeInputWrap: import("react").ForwardRefExoticComponent<{
|
|
33
33
|
size: Size;
|
|
@@ -36,12 +36,12 @@ export declare const SRangeInputWrap: import("react").ForwardRefExoticComponent<
|
|
|
36
36
|
readonly?: boolean | undefined;
|
|
37
37
|
status?: string | undefined;
|
|
38
38
|
} & import("react").HTMLAttributes<HTMLElement> & {
|
|
39
|
-
theme?: Theme | undefined;
|
|
39
|
+
theme?: import("../../../style").Theme | undefined;
|
|
40
40
|
} & import("react").RefAttributes<HTMLElement>>;
|
|
41
41
|
export declare const RangeContainer: import("react").ForwardRefExoticComponent<{
|
|
42
42
|
disabled?: boolean | undefined;
|
|
43
43
|
} & import("react").HTMLAttributes<HTMLElement> & {
|
|
44
|
-
theme?: Theme | undefined;
|
|
44
|
+
theme?: import("../../../style").Theme | undefined;
|
|
45
45
|
} & import("react").RefAttributes<HTMLElement>>;
|
|
46
46
|
export declare const RangeInputWrap: import("react").ForwardRefExoticComponent<{
|
|
47
47
|
isMonth?: boolean | undefined;
|
|
@@ -53,7 +53,7 @@ export declare const RangeInputWrap: import("react").ForwardRefExoticComponent<{
|
|
|
53
53
|
status?: InputProps['status'];
|
|
54
54
|
isEnd?: boolean | undefined;
|
|
55
55
|
} & import("react").HTMLAttributes<HTMLElement> & {
|
|
56
|
-
theme?: Theme | undefined;
|
|
56
|
+
theme?: import("../../../style").Theme | undefined;
|
|
57
57
|
} & import("react").RefAttributes<HTMLElement>>;
|
|
58
58
|
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>;
|
|
59
59
|
export declare const Arrow: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, Pick<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement>, keyof import("react").HTMLAttributes<HTMLSpanElement>>, object>;
|