@ringcentral/juno 1.12.5-beta.5905-2aa40faa → 1.12.6-beta.5932-320a3f8d
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/components/AppBar/AppBar.js +1 -2
- package/components/Forms/Picker/DatePicker/Day.d.ts +3 -1
- package/components/Forms/Picker/DatePicker/Day.js +5 -10
- package/components/Forms/Picker/DatePicker/styles/StyledDay.d.ts +3 -5
- package/components/Forms/Picker/DatePicker/styles/StyledDay.js +6 -12
- package/components/Forms/Picker/TimePicker/TimePicker.d.ts +4 -4
- package/components/Forms/Picker/TimePicker/TimePicker.js +21 -57
- package/components/Forms/Picker/TimePicker/styles/StyledPickerPopperWrap.d.ts +2 -25
- package/components/Forms/Picker/TimePicker/utils/TimeBoundary.js +8 -3
- package/components/Forms/Picker/TimePicker/utils/TimePickerHelper.d.ts +5 -9
- package/components/Forms/Picker/TimePicker/utils/TimePickerHelper.js +23 -11
- package/components/Forms/Select/index.d.ts +1 -0
- package/components/Forms/Select/index.js +1 -0
- package/es6/components/AppBar/AppBar.js +1 -2
- package/es6/components/Forms/Picker/DatePicker/Day.js +7 -12
- package/es6/components/Forms/Picker/DatePicker/styles/StyledDay.js +7 -13
- package/es6/components/Forms/Picker/TimePicker/TimePicker.js +21 -57
- package/es6/components/Forms/Picker/TimePicker/utils/TimeBoundary.js +9 -4
- package/es6/components/Forms/Picker/TimePicker/utils/TimePickerHelper.js +23 -11
- package/es6/components/Forms/Select/index.js +1 -0
- package/package.json +1 -1
|
@@ -4,8 +4,7 @@ var tslib_1 = require("tslib");
|
|
|
4
4
|
var AppBar_1 = tslib_1.__importDefault(require("@material-ui/core/AppBar"));
|
|
5
5
|
var foundation_1 = require("../../foundation");
|
|
6
6
|
var TOP_BAR_HEIGHT = '56px';
|
|
7
|
-
var
|
|
8
|
-
var RcAppBar = foundation_1.styled(AppBar_1.default)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n height: ", ";\n min-width: ", ";\n background-color: ", ";\n background: linear-gradient(\n to right,\n ", ",\n ", "\n );\n border-bottom: 1px solid ", ";\n z-index: ", ";\n"], ["\n height: ", ";\n min-width: ", ";\n background-color: ", ";\n background: linear-gradient(\n to right,\n ", ",\n ", "\n );\n border-bottom: 1px solid ", ";\n z-index: ", ";\n"])), TOP_BAR_HEIGHT, TOP_BAR_MIN_WIDTH, foundation_1.palette2('neutral', 'b01'), foundation_1.palette2('header', 'bgLeft'), foundation_1.palette2('header', 'bgRight'), foundation_1.palette2('header', 'divider'), function (_a) {
|
|
7
|
+
var RcAppBar = foundation_1.styled(AppBar_1.default)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n height: ", ";\n background-color: ", ";\n background: linear-gradient(\n to right,\n ", ",\n ", "\n );\n border-bottom: 1px solid ", ";\n z-index: ", ";\n"], ["\n height: ", ";\n background-color: ", ";\n background: linear-gradient(\n to right,\n ", ",\n ", "\n );\n border-bottom: 1px solid ", ";\n z-index: ", ";\n"])), TOP_BAR_HEIGHT, foundation_1.palette2('neutral', 'b01'), foundation_1.palette2('header', 'bgLeft'), foundation_1.palette2('header', 'bgRight'), foundation_1.palette2('header', 'divider'), function (_a) {
|
|
9
8
|
var theme = _a.theme;
|
|
10
9
|
return "" + (theme.zIndex.drawer + 10);
|
|
11
10
|
});
|
|
@@ -19,6 +19,8 @@ declare type DayProps = {
|
|
|
19
19
|
day: MaterialUiPickersDate;
|
|
20
20
|
tabIndex: number;
|
|
21
21
|
};
|
|
22
|
-
declare const Day: React.MemoExoticComponent<React.
|
|
22
|
+
declare const Day: React.MemoExoticComponent<import("styled-components").StyledComponentClass<DayProps & React.RefAttributes<HTMLButtonElement>, import("../../../../foundation").RcTheme, Pick<DayProps & React.RefAttributes<HTMLButtonElement>, "ref" | "key" | "tabIndex" | "children" | "hidden" | "size" | "disabled" | "focused" | "selected" | "day" | "current"> & {
|
|
23
|
+
theme?: import("../../../../foundation").RcTheme | undefined;
|
|
24
|
+
}>>;
|
|
23
25
|
export { Day };
|
|
24
26
|
export type { DayProps };
|
|
@@ -2,18 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
4
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
-
var clsx_1 = tslib_1.__importDefault(require("clsx"));
|
|
6
5
|
var styles_1 = require("./styles");
|
|
6
|
+
var styles_2 = require("../styles");
|
|
7
|
+
var foundation_1 = require("../../../../foundation");
|
|
7
8
|
var _Day = react_1.forwardRef(function (props, ref) {
|
|
8
9
|
var children = props.children, disabled = props.disabled, hidden = props.hidden, current = props.current, selected = props.selected, size = props.size, focused = props.focused, day = props.day, rest = tslib_1.__rest(props, ["children", "disabled", "hidden", "current", "selected", "size", "focused", "day"]);
|
|
9
|
-
return (react_1.default.createElement(
|
|
10
|
-
// TODO: remove those className
|
|
11
|
-
hidden: hidden, className: clsx_1.default({
|
|
12
|
-
'Day-hidden': hidden,
|
|
13
|
-
'Day-current': current,
|
|
14
|
-
'Day-selected': selected,
|
|
15
|
-
'Day-disabled': disabled,
|
|
16
|
-
}), "data-test-automation-class": hidden ? 'date-picker-hidden-day' : 'date-picker-day', "data-test-automation-value": children, disabled: disabled }, rest),
|
|
10
|
+
return (react_1.default.createElement(styles_2.PickerBaseIconButton, tslib_1.__assign({ "aria-pressed": focused, ref: ref, size: size, selected: selected, "data-picker-focused": focused ? '' : undefined, hidden: hidden, "data-test-automation-class": hidden ? 'date-picker-hidden-day' : 'date-picker-day', "data-test-automation-value": children, disabled: disabled }, rest),
|
|
17
11
|
react_1.default.createElement(react_1.default.Fragment, null,
|
|
18
12
|
// TODO: that <></> will fix when `RcIconButton` ready
|
|
19
13
|
children)));
|
|
@@ -25,5 +19,6 @@ _Day.defaultProps = {
|
|
|
25
19
|
current: false,
|
|
26
20
|
selected: false,
|
|
27
21
|
};
|
|
28
|
-
var Day = react_1.memo(_Day);
|
|
22
|
+
var Day = react_1.memo(foundation_1.styled(_Day)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), styles_1.DayStyle));
|
|
29
23
|
exports.Day = Day;
|
|
24
|
+
var templateObject_1;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const StyledDay: import("styled-components").StyledComponentClass<Pick<import("../../styles").PickerBaseIconButtonProps, "symbol" | "key" | "form" | "className" | "color" | "id" | "lang" | "name" | "style" | "type" | "role" | "tabIndex" | "elevation" | "href" | "radius" | "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" | "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" | "slot" | "title" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "size" | "value" | "variant" | "innerRef" | "theme" | "disabled" | "download" | "action" | "buttonRef" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "onFocusVisible" | "TouchRippleProps" | "loading" | "CircularProgressProps" | "iconColor" | "iconSize" | "invisible" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "useRcTooltip" | "TooltipProps" | "selected" | "shouldPersistBg" | "as" | "stretchIcon" | "useColorWhenDisabled" | "activeElevation" | "alwaysEnableTooltip" | "tooltipTitle" | "tooltipPlacement" | "disableToolTip" | "popperProps" | "tooltipForceHide" | "externalLink" | "ariaLabel" | "aRef"> & import("react").RefAttributes<any>, import("../../../../../foundation").RcTheme, Pick<Pick<import("../../styles").PickerBaseIconButtonProps, "symbol" | "key" | "form" | "className" | "color" | "id" | "lang" | "name" | "style" | "type" | "role" | "tabIndex" | "elevation" | "href" | "radius" | "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" | "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" | "slot" | "title" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "size" | "value" | "variant" | "innerRef" | "theme" | "disabled" | "download" | "action" | "buttonRef" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "onFocusVisible" | "TouchRippleProps" | "loading" | "CircularProgressProps" | "iconColor" | "iconSize" | "invisible" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "useRcTooltip" | "TooltipProps" | "selected" | "shouldPersistBg" | "as" | "stretchIcon" | "useColorWhenDisabled" | "activeElevation" | "alwaysEnableTooltip" | "tooltipTitle" | "tooltipPlacement" | "disableToolTip" | "popperProps" | "tooltipForceHide" | "externalLink" | "ariaLabel" | "aRef"> & import("react").RefAttributes<any>, "symbol" | "ref" | "key" | "form" | "className" | "color" | "id" | "lang" | "name" | "style" | "type" | "role" | "tabIndex" | "elevation" | "href" | "radius" | "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" | "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" | "slot" | "title" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "size" | "value" | "variant" | "innerRef" | "disabled" | "download" | "action" | "buttonRef" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "onFocusVisible" | "TouchRippleProps" | "loading" | "CircularProgressProps" | "iconColor" | "iconSize" | "invisible" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "useRcTooltip" | "TooltipProps" | "selected" | "shouldPersistBg" | "as" | "stretchIcon" | "useColorWhenDisabled" | "activeElevation" | "alwaysEnableTooltip" | "tooltipTitle" | "tooltipPlacement" | "disableToolTip" | "popperProps" | "tooltipForceHide" | "externalLink" | "ariaLabel" | "aRef"> & {
|
|
4
|
-
theme?: import("../../../../../foundation").RcTheme | undefined;
|
|
5
|
-
}>;
|
|
1
|
+
import { RcThemedStyled } from '../../../../../foundation';
|
|
2
|
+
import { DayProps } from '../Day';
|
|
3
|
+
export declare const DayStyle: RcThemedStyled<DayProps, any>;
|
|
@@ -3,16 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
4
|
var foundation_1 = require("../../../../../foundation");
|
|
5
5
|
var utils_1 = require("../../../../Buttons/IconButton/utils");
|
|
6
|
-
var styles_1 = require("../../styles");
|
|
7
6
|
var utils_2 = require("../utils");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}, function (_a) {
|
|
15
|
-
var hidden = _a.hidden;
|
|
16
|
-
return hidden && 'hidden';
|
|
17
|
-
}, foundation_1.typography('caption1'));
|
|
18
|
-
var templateObject_1;
|
|
7
|
+
var CurrentDayStyle = foundation_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n border: 1px solid ", ";\n"], ["\n border: 1px solid ", ";\n"])), foundation_1.palette2('neutral', 'b04'));
|
|
8
|
+
exports.DayStyle = function (_a) {
|
|
9
|
+
var current = _a.current, size = _a.size, hidden = _a.hidden, selected = _a.selected;
|
|
10
|
+
return foundation_1.css(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n &.", " {\n width: ", ";\n height: ", ";\n margin: 0 2px;\n visibility: ", ";\n ", ";\n ", ";\n }\n "], ["\n &.", " {\n width: ", ";\n height: ", ";\n margin: 0 2px;\n visibility: ", ";\n ", ";\n ", ";\n }\n "])), utils_1.RcIconButtonClasses.root, utils_2.RcDatePickerIconWidths[size], utils_2.RcDatePickerIconWidths[size], hidden && 'hidden', foundation_1.typography('caption1'), current && !selected && CurrentDayStyle);
|
|
11
|
+
};
|
|
12
|
+
var templateObject_1, templateObject_2;
|
|
@@ -18,8 +18,8 @@ declare type RcTimePickerProps<T = false> = {
|
|
|
18
18
|
size?: RcTimePickerSize;
|
|
19
19
|
/** Is 12 hours system */
|
|
20
20
|
isTwelveHourSystem?: boolean;
|
|
21
|
-
/** Date or timestamp */
|
|
22
|
-
value
|
|
21
|
+
/** Date or timestamp(only hour and minute) */
|
|
22
|
+
value: (T extends true ? Date : number) | null;
|
|
23
23
|
/** When all using date, this props will be remove, */
|
|
24
24
|
dateMode?: T;
|
|
25
25
|
/** when user change time */
|
|
@@ -34,8 +34,8 @@ declare type RcTimePickerProps<T = false> = {
|
|
|
34
34
|
MinutePickerProps?: PickNumberPickerProps;
|
|
35
35
|
/** props for periodToggle component */
|
|
36
36
|
PeriodToggleProps?: RcBaseProps<Partial<ToggleTextProps>, 'disabled' | 'isTwelveHourSystem' | 'size' | 'value' | 'onUpdateValue' | 'children'>;
|
|
37
|
-
/**
|
|
38
|
-
|
|
37
|
+
/** picker will show default value when textfield is empty */
|
|
38
|
+
defaultPickerValue?: T extends true ? Date : number;
|
|
39
39
|
} & RcBaseProps<PickerTextFieldProps, 'onClick' | 'value' | 'children'> & RcClassesProps<'popover' | 'popoverPaper'>;
|
|
40
40
|
/**
|
|
41
41
|
* when `dateMode={true}` that onChange will return `Date` object,
|
|
@@ -14,26 +14,22 @@ var styles_1 = require("./styles");
|
|
|
14
14
|
var ToggleText_1 = require("./ToggleText");
|
|
15
15
|
var utils_2 = require("./utils");
|
|
16
16
|
var _RcTimePicker = react_1.forwardRef(function (inProps, ref) {
|
|
17
|
-
var _a;
|
|
18
17
|
var props = foundation_1.useThemeProps({ props: inProps, name: 'RcTimePicker' });
|
|
19
|
-
var isTwelveHourSystem = props.isTwelveHourSystem, value = props.value,
|
|
20
|
-
// TODO: when props remove clear that code, not use forwardRef for Jupiter test issue
|
|
21
|
-
if (times) {
|
|
22
|
-
foundation_1.logInDev({
|
|
23
|
-
component: 'RcTimePicker',
|
|
24
|
-
target: 'times',
|
|
25
|
-
time: '2021-3',
|
|
26
|
-
comment: "this props will be removed, using value to replace that ",
|
|
27
|
-
});
|
|
28
|
-
}
|
|
18
|
+
var isTwelveHourSystem = props.isTwelveHourSystem, value = props.value, onChange = props.onChange, disabled = props.disabled, dateMode = props.dateMode, min = props.min, max = props.max, size = props.size, onKeyDown = props.onKeyDown, onClear = props.onClear, HourPickerProps = props.HourPickerProps, MinutePickerProps = props.MinutePickerProps, PeriodToggleProps = props.PeriodToggleProps, PopoverPropsProp = props.PopoverProps, InputPropsProp = props.InputProps, classes = props.classes, defaultPickerValue = props.defaultPickerValue, rest = tslib_1.__rest(props, ["isTwelveHourSystem", "value", "onChange", "disabled", "dateMode", "min", "max", "size", "onKeyDown", "onClear", "HourPickerProps", "MinutePickerProps", "PeriodToggleProps", "PopoverProps", "InputProps", "classes", "defaultPickerValue"]);
|
|
29
19
|
var actionRef = react_1.useRef(null);
|
|
30
20
|
var hourRef = react_1.useRef(null);
|
|
31
21
|
var minuteRef = react_1.useRef(null);
|
|
32
22
|
var periodRef = react_1.useRef(null);
|
|
33
23
|
var textFiledValueRef = react_1.useRef('');
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
|
|
24
|
+
var _a = tslib_1.__read(react_1.useState('none'), 2), selectionShowType = _a[0], setSelectionType = _a[1];
|
|
25
|
+
var _b = (function () {
|
|
26
|
+
if (value !== null)
|
|
27
|
+
return { nowTime: value, isShowTextfieldValue: true };
|
|
28
|
+
if (defaultPickerValue)
|
|
29
|
+
return { nowTime: defaultPickerValue, isShowTextfieldValue: false };
|
|
30
|
+
return { nowTime: null, isShowTextfieldValue: false };
|
|
31
|
+
})(), nowTime = _b.nowTime, isShowTextfieldValue = _b.isShowTextfieldValue;
|
|
32
|
+
var isHaveValue = nowTime !== null;
|
|
37
33
|
var isDateMode = nowTime instanceof Date || dateMode;
|
|
38
34
|
var currentTimestamp = utils_2.getTimestamp(nowTime);
|
|
39
35
|
var currentHourMinute = utils_2.getHourAndMinute(currentTimestamp);
|
|
@@ -46,18 +42,9 @@ var _RcTimePicker = react_1.forwardRef(function (inProps, ref) {
|
|
|
46
42
|
return utils_2.getRangeBoundary({ min: min, max: max });
|
|
47
43
|
}, [max, min]);
|
|
48
44
|
var getEmitInitDate = foundation_1.useEventCallback(function () {
|
|
49
|
-
var date =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
: utils_2.timestampToDate(nowTime)
|
|
53
|
-
: new Date();
|
|
54
|
-
if (nowTime) {
|
|
55
|
-
var hour = currentHourMinute.hour, minute = currentHourMinute.minute;
|
|
56
|
-
date.setHours(hour, minute, 0, 0);
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
date.setHours(0, 0, 0, 0);
|
|
60
|
-
}
|
|
45
|
+
var date = nowTime !== null ? new Date(nowTime) : new Date();
|
|
46
|
+
var hour = currentHourMinute.hour, minute = currentHourMinute.minute;
|
|
47
|
+
date.setHours(hour, minute, 0, 0);
|
|
61
48
|
return date;
|
|
62
49
|
});
|
|
63
50
|
var handleChange = react_1.useCallback(function (toValue) {
|
|
@@ -141,29 +128,10 @@ var _RcTimePicker = react_1.forwardRef(function (inProps, ref) {
|
|
|
141
128
|
Escape: closeMenu,
|
|
142
129
|
});
|
|
143
130
|
});
|
|
144
|
-
var getRecoupHour = function (currHour, period) {
|
|
145
|
-
switch (period) {
|
|
146
|
-
case constant_1.TIME_SYSTEM_TEXT.PM:
|
|
147
|
-
if (currHour < utils_2.HALF_DAY_HOURS) {
|
|
148
|
-
return utils_2.HALF_DAY_HOURS;
|
|
149
|
-
}
|
|
150
|
-
break;
|
|
151
|
-
case constant_1.TIME_SYSTEM_TEXT.AM:
|
|
152
|
-
if (currHour < utils_2.HALF_DAY_HOURS) {
|
|
153
|
-
if (currHour >= utils_2.HALF_DAY_HOURS) {
|
|
154
|
-
return -utils_2.HALF_DAY_HOURS;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
break;
|
|
158
|
-
default:
|
|
159
|
-
break;
|
|
160
|
-
}
|
|
161
|
-
return 0;
|
|
162
|
-
};
|
|
163
131
|
var handleHourInnerChange = foundation_1.useEventCallback(function (hour) {
|
|
164
132
|
var minuteInstance = minuteRef.current;
|
|
165
133
|
var periodInstance = periodRef.current;
|
|
166
|
-
var currRecoupHour = getRecoupHour(hour, periodInstance === null || periodInstance === void 0 ? void 0 : periodInstance.value);
|
|
134
|
+
var currRecoupHour = utils_2.getRecoupHour(hour, periodInstance === null || periodInstance === void 0 ? void 0 : periodInstance.value);
|
|
167
135
|
var newRange = utils_2.getNumberPickerBoundary(hour + currRecoupHour, {
|
|
168
136
|
range: range,
|
|
169
137
|
isTwelveHourSystem: isTwelveHourSystem,
|
|
@@ -174,7 +142,7 @@ var _RcTimePicker = react_1.forwardRef(function (inProps, ref) {
|
|
|
174
142
|
var minuteInstance = minuteRef.current;
|
|
175
143
|
var hourInstance = hourRef.current;
|
|
176
144
|
var currHour = hourInstance.value;
|
|
177
|
-
var currRecoupHour = getRecoupHour(currHour, period);
|
|
145
|
+
var currRecoupHour = utils_2.getRecoupHour(currHour, period);
|
|
178
146
|
var newRange = utils_2.getNumberPickerBoundary(currHour + currRecoupHour, {
|
|
179
147
|
range: range,
|
|
180
148
|
isTwelveHourSystem: isTwelveHourSystem,
|
|
@@ -202,6 +170,8 @@ var _RcTimePicker = react_1.forwardRef(function (inProps, ref) {
|
|
|
202
170
|
}, [PopoverPropsProp, classes, handlePopoverKeydown]);
|
|
203
171
|
// * make sure value inside range
|
|
204
172
|
react_1.useLayoutEffect(function () {
|
|
173
|
+
if (currentTimestamp === null)
|
|
174
|
+
return;
|
|
205
175
|
var time = getEmitInitDate();
|
|
206
176
|
if (range.max.date && currentTimestamp > range.max.timestamp) {
|
|
207
177
|
time.setHours(range.max.hour);
|
|
@@ -216,7 +186,7 @@ var _RcTimePicker = react_1.forwardRef(function (inProps, ref) {
|
|
|
216
186
|
}, [currentTimestamp, range, handleChange, getEmitInitDate]);
|
|
217
187
|
// * update input value
|
|
218
188
|
foundation_1.useDepsChange(function () {
|
|
219
|
-
if (
|
|
189
|
+
if (!isShowTextfieldValue) {
|
|
220
190
|
textFiledValueRef.current = '';
|
|
221
191
|
return;
|
|
222
192
|
}
|
|
@@ -234,7 +204,7 @@ var _RcTimePicker = react_1.forwardRef(function (inProps, ref) {
|
|
|
234
204
|
isTwelveHourSystem,
|
|
235
205
|
currentPeriod,
|
|
236
206
|
]);
|
|
237
|
-
// * when no
|
|
207
|
+
// * when no value, open menu use min as value
|
|
238
208
|
var originalHourValue = isHaveValue
|
|
239
209
|
? currentHourMinute.hour
|
|
240
210
|
: // * use original range to calculate period value
|
|
@@ -259,7 +229,7 @@ var _RcTimePicker = react_1.forwardRef(function (inProps, ref) {
|
|
|
259
229
|
var hourValue = isTwelveHourSystem
|
|
260
230
|
? originalHourValue % utils_2.HALF_DAY_HOURS
|
|
261
231
|
: originalHourValue;
|
|
262
|
-
// * when no
|
|
232
|
+
// * when no value, open menu use min as value
|
|
263
233
|
var minuteValue = isHaveValue
|
|
264
234
|
? currentHourMinute.minute
|
|
265
235
|
: boundary.minute.min;
|
|
@@ -281,13 +251,7 @@ var _RcTimePicker = react_1.forwardRef(function (inProps, ref) {
|
|
|
281
251
|
: utils_2.minuteSource, isTwelveHourSystem: isHourView && isTwelveHourSystem, value: isHourView ? hourValue : minuteValue, onClick: handleSelectionViewClick, automationId: "time-picker-" + selectionShowType }))))));
|
|
282
252
|
});
|
|
283
253
|
/** @release */
|
|
284
|
-
var RcTimePicker = foundation_1.styled(
|
|
285
|
-
{
|
|
286
|
-
prop: 'times',
|
|
287
|
-
time: '2021-4',
|
|
288
|
-
comment: "@deprecated this props will be removed, using value to replace that",
|
|
289
|
-
},
|
|
290
|
-
], 'RcTimePicker'))(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject([""], [""])));
|
|
254
|
+
var RcTimePicker = foundation_1.styled(_RcTimePicker)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject([""], [""])));
|
|
291
255
|
RcTimePicker.defaultProps = {
|
|
292
256
|
clearBtn: true,
|
|
293
257
|
dateMode: false,
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
/// <reference types="styled-jsx" />
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isTwelveHourSystem?: boolean | undefined;
|
|
6
|
-
value?: number | null | undefined;
|
|
7
|
-
dateMode?: false | undefined;
|
|
8
|
-
onChange?: ((time: number | null) => void) | undefined;
|
|
9
|
-
min?: number | Date | undefined;
|
|
10
|
-
max?: number | Date | undefined;
|
|
11
|
-
HourPickerProps?: Pick<Partial<import("../NumberPicker").NumberPickerProps>, "className" | "color" | "id" | "lang" | "style" | "role" | "tabIndex" | "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" | "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" | "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" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "disabled" | "onInnerChange" | "automationId" | "getScreenReaderLabel" | "renderValue"> | undefined;
|
|
12
|
-
MinutePickerProps?: Pick<Partial<import("../NumberPicker").NumberPickerProps>, "className" | "color" | "id" | "lang" | "style" | "role" | "tabIndex" | "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" | "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" | "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" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "disabled" | "onInnerChange" | "automationId" | "getScreenReaderLabel" | "renderValue"> | undefined;
|
|
13
|
-
PeriodToggleProps?: Pick<Partial<import("../ToggleText").ToggleTextProps>, "form" | "className" | "color" | "id" | "lang" | "name" | "style" | "type" | "role" | "tabIndex" | "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" | "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" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "onClose" | "onInnerChange" | "getScreenReaderLabel"> | undefined;
|
|
14
|
-
times?: number | null | undefined;
|
|
15
|
-
} & Pick<import("../../utils/PickerTextField/PickerTextField").PickerTextFieldProps, "className" | "id" | "radius" | "onFocus" | "onBlur" | "onKeyDown" | "label" | "placeholder" | "size" | "variant" | "disabled" | "action" | "autoFocus" | "fullWidth" | "error" | "inputProps" | "inputRef" | "required" | "InputProps" | "helperText" | "gutterBottom" | "onClear" | "clearBtn" | "clearButtonProps" | "validate" | "PopoverProps" | "ActionSymbol"> & import("../../../../../foundation").RcClassesProps<"popover" | "popoverPaper">, import("../../../../../foundation").RcTheme, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
16
|
-
size?: "small" | "medium" | undefined;
|
|
17
|
-
isTwelveHourSystem?: boolean | undefined;
|
|
18
|
-
value?: number | null | undefined;
|
|
19
|
-
dateMode?: false | undefined;
|
|
20
|
-
onChange?: ((time: number | null) => void) | undefined;
|
|
21
|
-
min?: number | Date | undefined;
|
|
22
|
-
max?: number | Date | undefined;
|
|
23
|
-
HourPickerProps?: Pick<Partial<import("../NumberPicker").NumberPickerProps>, "className" | "color" | "id" | "lang" | "style" | "role" | "tabIndex" | "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" | "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" | "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" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "disabled" | "onInnerChange" | "automationId" | "getScreenReaderLabel" | "renderValue"> | undefined;
|
|
24
|
-
MinutePickerProps?: Pick<Partial<import("../NumberPicker").NumberPickerProps>, "className" | "color" | "id" | "lang" | "style" | "role" | "tabIndex" | "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" | "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" | "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" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "disabled" | "onInnerChange" | "automationId" | "getScreenReaderLabel" | "renderValue"> | undefined;
|
|
25
|
-
PeriodToggleProps?: Pick<Partial<import("../ToggleText").ToggleTextProps>, "form" | "className" | "color" | "id" | "lang" | "name" | "style" | "type" | "role" | "tabIndex" | "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" | "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" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "onClose" | "onInnerChange" | "getScreenReaderLabel"> | undefined;
|
|
26
|
-
times?: number | null | undefined;
|
|
27
|
-
} & Pick<import("../../utils/PickerTextField/PickerTextField").PickerTextFieldProps, "className" | "id" | "radius" | "onFocus" | "onBlur" | "onKeyDown" | "label" | "placeholder" | "size" | "variant" | "disabled" | "action" | "autoFocus" | "fullWidth" | "error" | "inputProps" | "inputRef" | "required" | "InputProps" | "helperText" | "gutterBottom" | "onClear" | "clearBtn" | "clearButtonProps" | "validate" | "PopoverProps" | "ActionSymbol"> & import("../../../../../foundation").RcClassesProps<"popover" | "popoverPaper">>;
|
|
3
|
+
import { RcTimePickerProps } from '../TimePicker';
|
|
4
|
+
export declare const StyledPickerPopperWrap: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Pick<RcTimePickerProps<false>, "className" | "id" | "max" | "min" | "radius" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "label" | "classes" | "placeholder" | "size" | "variant" | "disabled" | "action" | "autoFocus" | "fullWidth" | "error" | "inputProps" | "inputRef" | "required" | "InputProps" | "helperText" | "gutterBottom" | "onClear" | "clearBtn" | "clearButtonProps" | "validate" | "PopoverProps" | "ActionSymbol" | "isTwelveHourSystem" | "dateMode" | "HourPickerProps" | "MinutePickerProps" | "PeriodToggleProps" | "defaultPickerValue">, import("../../../../../foundation").RcTheme, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Pick<RcTimePickerProps<false>, "className" | "id" | "max" | "min" | "radius" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "label" | "classes" | "placeholder" | "size" | "variant" | "disabled" | "action" | "autoFocus" | "fullWidth" | "error" | "inputProps" | "inputRef" | "required" | "InputProps" | "helperText" | "gutterBottom" | "onClear" | "clearBtn" | "clearButtonProps" | "validate" | "PopoverProps" | "ActionSymbol" | "isTwelveHourSystem" | "dateMode" | "HourPickerProps" | "MinutePickerProps" | "PeriodToggleProps" | "defaultPickerValue">>;
|
|
@@ -73,9 +73,14 @@ var TimeBoundary = /** @class */ (function () {
|
|
|
73
73
|
this._minute = Math.floor(time.getMinutes() / this.timeGap) * this.timeGap;
|
|
74
74
|
};
|
|
75
75
|
TimeBoundary.prototype.getDateTime = function () {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
var _a;
|
|
77
|
+
if (this.value instanceof Date) {
|
|
78
|
+
return this.value;
|
|
79
|
+
}
|
|
80
|
+
var _b = TimePickerHelper_1.getHourAndMinute((_a = this.value) !== null && _a !== void 0 ? _a : 0), hour = _b.hour, minute = _b.minute;
|
|
81
|
+
var date = new Date();
|
|
82
|
+
date.setHours(hour, minute, 0, 0);
|
|
83
|
+
return date;
|
|
79
84
|
};
|
|
80
85
|
return TimeBoundary;
|
|
81
86
|
}());
|
|
@@ -30,18 +30,13 @@ declare const getTimestampFromDate: (date: Date) => number;
|
|
|
30
30
|
/**
|
|
31
31
|
* hour and minute number
|
|
32
32
|
*/
|
|
33
|
-
declare const getHourAndMinute: (times
|
|
33
|
+
declare const getHourAndMinute: (times: number | null) => {
|
|
34
34
|
hour: number;
|
|
35
35
|
minute: number;
|
|
36
36
|
};
|
|
37
|
-
/**
|
|
38
|
-
* timestamp to date
|
|
39
|
-
*/
|
|
40
|
-
declare const timestampToDate: (times?: number | undefined) => Date;
|
|
41
|
-
/**
|
|
42
|
-
* get timestamp from date or timestamp
|
|
43
|
-
*/
|
|
44
37
|
declare function getTimestamp(nowTime: number | Date): number;
|
|
38
|
+
declare function getTimestamp(nowTime: null): null;
|
|
39
|
+
declare function getTimestamp(nowTime: number | Date | null): number | null;
|
|
45
40
|
/**
|
|
46
41
|
* hour and min object to timestamp
|
|
47
42
|
*/
|
|
@@ -53,4 +48,5 @@ declare const getTimestampFromHourAndMin: (option: {
|
|
|
53
48
|
* get period, `PM` or `AM`
|
|
54
49
|
*/
|
|
55
50
|
declare function getPeriod(currHour: number): TIME_SYSTEM_TEXT;
|
|
56
|
-
|
|
51
|
+
declare const getRecoupHour: (currHour: number, period?: TIME_SYSTEM_TEXT | undefined) => number;
|
|
52
|
+
export { getFormattedTime, getHourAndMinute, getPeriod, getTimestamp, getTimestampFromDate, getTimestampFromHourAndMin, HALF_DAY_HOURS, HOUR_MINUTES, lastMinute, minuteSource, ONE_HOUR, pad, parseNumber, parseNumberToString, TIME_GAP, twelveHourSystemSource, twentyFourHourSystemSource, getRecoupHour, };
|
|
@@ -76,7 +76,7 @@ exports.getTimestampFromDate = getTimestampFromDate;
|
|
|
76
76
|
* hour and minute number
|
|
77
77
|
*/
|
|
78
78
|
var getHourAndMinute = function (times) {
|
|
79
|
-
if (
|
|
79
|
+
if (times === null) {
|
|
80
80
|
return {
|
|
81
81
|
hour: 0,
|
|
82
82
|
minute: 0,
|
|
@@ -90,18 +90,10 @@ var getHourAndMinute = function (times) {
|
|
|
90
90
|
};
|
|
91
91
|
};
|
|
92
92
|
exports.getHourAndMinute = getHourAndMinute;
|
|
93
|
-
/**
|
|
94
|
-
* timestamp to date
|
|
95
|
-
*/
|
|
96
|
-
var timestampToDate = function (times) {
|
|
97
|
-
var _a = getHourAndMinute(times), hour = _a.hour, minute = _a.minute;
|
|
98
|
-
var date = new Date();
|
|
99
|
-
date.setHours(hour, minute, 0, 0);
|
|
100
|
-
return date;
|
|
101
|
-
};
|
|
102
|
-
exports.timestampToDate = timestampToDate;
|
|
103
93
|
/**
|
|
104
94
|
* get timestamp from date or timestamp
|
|
95
|
+
*
|
|
96
|
+
* if nowTime is number, it must be hour and minute timestamp
|
|
105
97
|
*/
|
|
106
98
|
function getTimestamp(nowTime) {
|
|
107
99
|
return nowTime instanceof Date ? getTimestampFromDate(nowTime) : nowTime;
|
|
@@ -121,3 +113,23 @@ function getPeriod(currHour) {
|
|
|
121
113
|
return currHour >= HALF_DAY_HOURS ? constant_1.TIME_SYSTEM_TEXT.PM : constant_1.TIME_SYSTEM_TEXT.AM;
|
|
122
114
|
}
|
|
123
115
|
exports.getPeriod = getPeriod;
|
|
116
|
+
var getRecoupHour = function (currHour, period) {
|
|
117
|
+
switch (period) {
|
|
118
|
+
case constant_1.TIME_SYSTEM_TEXT.PM:
|
|
119
|
+
if (currHour < HALF_DAY_HOURS) {
|
|
120
|
+
return HALF_DAY_HOURS;
|
|
121
|
+
}
|
|
122
|
+
break;
|
|
123
|
+
case constant_1.TIME_SYSTEM_TEXT.AM:
|
|
124
|
+
if (currHour < HALF_DAY_HOURS) {
|
|
125
|
+
if (currHour >= HALF_DAY_HOURS) {
|
|
126
|
+
return -HALF_DAY_HOURS;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
break;
|
|
130
|
+
default:
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
return 0;
|
|
134
|
+
};
|
|
135
|
+
exports.getRecoupHour = getRecoupHour;
|
|
@@ -2,8 +2,7 @@ import { __makeTemplateObject } from "tslib";
|
|
|
2
2
|
import MuiAppBar from '@material-ui/core/AppBar';
|
|
3
3
|
import { palette2, styled } from '../../foundation';
|
|
4
4
|
var TOP_BAR_HEIGHT = '56px';
|
|
5
|
-
var
|
|
6
|
-
var RcAppBar = styled(MuiAppBar)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: ", ";\n min-width: ", ";\n background-color: ", ";\n background: linear-gradient(\n to right,\n ", ",\n ", "\n );\n border-bottom: 1px solid ", ";\n z-index: ", ";\n"], ["\n height: ", ";\n min-width: ", ";\n background-color: ", ";\n background: linear-gradient(\n to right,\n ", ",\n ", "\n );\n border-bottom: 1px solid ", ";\n z-index: ", ";\n"])), TOP_BAR_HEIGHT, TOP_BAR_MIN_WIDTH, palette2('neutral', 'b01'), palette2('header', 'bgLeft'), palette2('header', 'bgRight'), palette2('header', 'divider'), function (_a) {
|
|
5
|
+
var RcAppBar = styled(MuiAppBar)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: ", ";\n background-color: ", ";\n background: linear-gradient(\n to right,\n ", ",\n ", "\n );\n border-bottom: 1px solid ", ";\n z-index: ", ";\n"], ["\n height: ", ";\n background-color: ", ";\n background: linear-gradient(\n to right,\n ", ",\n ", "\n );\n border-bottom: 1px solid ", ";\n z-index: ", ";\n"])), TOP_BAR_HEIGHT, palette2('neutral', 'b01'), palette2('header', 'bgLeft'), palette2('header', 'bgRight'), palette2('header', 'divider'), function (_a) {
|
|
7
6
|
var theme = _a.theme;
|
|
8
7
|
return "" + (theme.zIndex.drawer + 10);
|
|
9
8
|
});
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import { __assign, __rest } from "tslib";
|
|
1
|
+
import { __assign, __makeTemplateObject, __rest } from "tslib";
|
|
2
2
|
import React, { forwardRef, memo } from 'react';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
3
|
+
import { DayStyle } from './styles';
|
|
4
|
+
import { PickerBaseIconButton } from '../styles';
|
|
5
|
+
import { styled } from '../../../../foundation';
|
|
5
6
|
var _Day = forwardRef(function (props, ref) {
|
|
6
7
|
var children = props.children, disabled = props.disabled, hidden = props.hidden, current = props.current, selected = props.selected, size = props.size, focused = props.focused, day = props.day, rest = __rest(props, ["children", "disabled", "hidden", "current", "selected", "size", "focused", "day"]);
|
|
7
|
-
return (React.createElement(
|
|
8
|
-
// TODO: remove those className
|
|
9
|
-
hidden: hidden, className: clsx({
|
|
10
|
-
'Day-hidden': hidden,
|
|
11
|
-
'Day-current': current,
|
|
12
|
-
'Day-selected': selected,
|
|
13
|
-
'Day-disabled': disabled,
|
|
14
|
-
}), "data-test-automation-class": hidden ? 'date-picker-hidden-day' : 'date-picker-day', "data-test-automation-value": children, disabled: disabled }, rest),
|
|
8
|
+
return (React.createElement(PickerBaseIconButton, __assign({ "aria-pressed": focused, ref: ref, size: size, selected: selected, "data-picker-focused": focused ? '' : undefined, hidden: hidden, "data-test-automation-class": hidden ? 'date-picker-hidden-day' : 'date-picker-day', "data-test-automation-value": children, disabled: disabled }, rest),
|
|
15
9
|
React.createElement(React.Fragment, null,
|
|
16
10
|
// TODO: that <></> will fix when `RcIconButton` ready
|
|
17
11
|
children)));
|
|
@@ -23,5 +17,6 @@ _Day.defaultProps = {
|
|
|
23
17
|
current: false,
|
|
24
18
|
selected: false,
|
|
25
19
|
};
|
|
26
|
-
var Day = memo(_Day);
|
|
20
|
+
var Day = memo(styled(_Day)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), DayStyle));
|
|
27
21
|
export { Day };
|
|
22
|
+
var templateObject_1;
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import { __makeTemplateObject } from "tslib";
|
|
2
|
-
import {
|
|
2
|
+
import { css, palette2, typography, } from '../../../../../foundation';
|
|
3
3
|
import { RcIconButtonClasses } from '../../../../Buttons/IconButton/utils';
|
|
4
|
-
import { PickerBaseIconButton } from '../../styles';
|
|
5
4
|
import { RcDatePickerIconWidths } from '../utils';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}, function (_a) {
|
|
13
|
-
var hidden = _a.hidden;
|
|
14
|
-
return hidden && 'hidden';
|
|
15
|
-
}, typography('caption1'));
|
|
16
|
-
var templateObject_1;
|
|
5
|
+
var CurrentDayStyle = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border: 1px solid ", ";\n"], ["\n border: 1px solid ", ";\n"])), palette2('neutral', 'b04'));
|
|
6
|
+
export var DayStyle = function (_a) {
|
|
7
|
+
var current = _a.current, size = _a.size, hidden = _a.hidden, selected = _a.selected;
|
|
8
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n &.", " {\n width: ", ";\n height: ", ";\n margin: 0 2px;\n visibility: ", ";\n ", ";\n ", ";\n }\n "], ["\n &.", " {\n width: ", ";\n height: ", ";\n margin: 0 2px;\n visibility: ", ";\n ", ";\n ", ";\n }\n "])), RcIconButtonClasses.root, RcDatePickerIconWidths[size], RcDatePickerIconWidths[size], hidden && 'hidden', typography('caption1'), current && !selected && CurrentDayStyle);
|
|
9
|
+
};
|
|
10
|
+
var templateObject_1, templateObject_2;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __assign, __makeTemplateObject, __read, __rest } from "tslib";
|
|
2
2
|
import React, { forwardRef, useCallback, useLayoutEffect, useMemo, useRef, useState, } from 'react';
|
|
3
3
|
import { runKeyHandler } from '@material-ui/pickers/_shared/hooks/useKeyDown';
|
|
4
|
-
import { combineClasses, combineProps,
|
|
4
|
+
import { combineClasses, combineProps, styled, useDepsChange, useEventCallback, useThemeProps, } from '../../../../foundation';
|
|
5
5
|
import TimeBorderIcon from '../../../../icon/TimeBorder';
|
|
6
6
|
import { RcBox } from '../../../Box';
|
|
7
7
|
import { PickerTextField, } from '../utils';
|
|
@@ -10,28 +10,24 @@ import { NumberPicker, } from './NumberPicker';
|
|
|
10
10
|
import { SelectionView } from './SelectionView';
|
|
11
11
|
import { StyledPickerPopperWrap } from './styles';
|
|
12
12
|
import { ToggleText } from './ToggleText';
|
|
13
|
-
import { getFormattedTime, getHourAndMinute, getNumberPickerBoundary, getPeriod, getRangeBoundary, getTimestamp, getTimestampFromDate, HALF_DAY_HOURS, minuteSource, parseNumberToString, RcTimePickerClasses, TIME_GAP,
|
|
13
|
+
import { getFormattedTime, getHourAndMinute, getNumberPickerBoundary, getPeriod, getRangeBoundary, getTimestamp, getTimestampFromDate, HALF_DAY_HOURS, minuteSource, parseNumberToString, RcTimePickerClasses, TIME_GAP, twelveHourSystemSource, twentyFourHourSystemSource, getRecoupHour, } from './utils';
|
|
14
14
|
var _RcTimePicker = forwardRef(function (inProps, ref) {
|
|
15
|
-
var _a;
|
|
16
15
|
var props = useThemeProps({ props: inProps, name: 'RcTimePicker' });
|
|
17
|
-
var isTwelveHourSystem = props.isTwelveHourSystem, value = props.value,
|
|
18
|
-
// TODO: when props remove clear that code, not use forwardRef for Jupiter test issue
|
|
19
|
-
if (times) {
|
|
20
|
-
logInDev({
|
|
21
|
-
component: 'RcTimePicker',
|
|
22
|
-
target: 'times',
|
|
23
|
-
time: '2021-3',
|
|
24
|
-
comment: "this props will be removed, using value to replace that ",
|
|
25
|
-
});
|
|
26
|
-
}
|
|
16
|
+
var isTwelveHourSystem = props.isTwelveHourSystem, value = props.value, onChange = props.onChange, disabled = props.disabled, dateMode = props.dateMode, min = props.min, max = props.max, size = props.size, onKeyDown = props.onKeyDown, onClear = props.onClear, HourPickerProps = props.HourPickerProps, MinutePickerProps = props.MinutePickerProps, PeriodToggleProps = props.PeriodToggleProps, PopoverPropsProp = props.PopoverProps, InputPropsProp = props.InputProps, classes = props.classes, defaultPickerValue = props.defaultPickerValue, rest = __rest(props, ["isTwelveHourSystem", "value", "onChange", "disabled", "dateMode", "min", "max", "size", "onKeyDown", "onClear", "HourPickerProps", "MinutePickerProps", "PeriodToggleProps", "PopoverProps", "InputProps", "classes", "defaultPickerValue"]);
|
|
27
17
|
var actionRef = useRef(null);
|
|
28
18
|
var hourRef = useRef(null);
|
|
29
19
|
var minuteRef = useRef(null);
|
|
30
20
|
var periodRef = useRef(null);
|
|
31
21
|
var textFiledValueRef = useRef('');
|
|
32
|
-
var
|
|
33
|
-
var
|
|
34
|
-
|
|
22
|
+
var _a = __read(useState('none'), 2), selectionShowType = _a[0], setSelectionType = _a[1];
|
|
23
|
+
var _b = (function () {
|
|
24
|
+
if (value !== null)
|
|
25
|
+
return { nowTime: value, isShowTextfieldValue: true };
|
|
26
|
+
if (defaultPickerValue)
|
|
27
|
+
return { nowTime: defaultPickerValue, isShowTextfieldValue: false };
|
|
28
|
+
return { nowTime: null, isShowTextfieldValue: false };
|
|
29
|
+
})(), nowTime = _b.nowTime, isShowTextfieldValue = _b.isShowTextfieldValue;
|
|
30
|
+
var isHaveValue = nowTime !== null;
|
|
35
31
|
var isDateMode = nowTime instanceof Date || dateMode;
|
|
36
32
|
var currentTimestamp = getTimestamp(nowTime);
|
|
37
33
|
var currentHourMinute = getHourAndMinute(currentTimestamp);
|
|
@@ -44,18 +40,9 @@ var _RcTimePicker = forwardRef(function (inProps, ref) {
|
|
|
44
40
|
return getRangeBoundary({ min: min, max: max });
|
|
45
41
|
}, [max, min]);
|
|
46
42
|
var getEmitInitDate = useEventCallback(function () {
|
|
47
|
-
var date =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
: timestampToDate(nowTime)
|
|
51
|
-
: new Date();
|
|
52
|
-
if (nowTime) {
|
|
53
|
-
var hour = currentHourMinute.hour, minute = currentHourMinute.minute;
|
|
54
|
-
date.setHours(hour, minute, 0, 0);
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
date.setHours(0, 0, 0, 0);
|
|
58
|
-
}
|
|
43
|
+
var date = nowTime !== null ? new Date(nowTime) : new Date();
|
|
44
|
+
var hour = currentHourMinute.hour, minute = currentHourMinute.minute;
|
|
45
|
+
date.setHours(hour, minute, 0, 0);
|
|
59
46
|
return date;
|
|
60
47
|
});
|
|
61
48
|
var handleChange = useCallback(function (toValue) {
|
|
@@ -139,25 +126,6 @@ var _RcTimePicker = forwardRef(function (inProps, ref) {
|
|
|
139
126
|
Escape: closeMenu,
|
|
140
127
|
});
|
|
141
128
|
});
|
|
142
|
-
var getRecoupHour = function (currHour, period) {
|
|
143
|
-
switch (period) {
|
|
144
|
-
case TIME_SYSTEM_TEXT.PM:
|
|
145
|
-
if (currHour < HALF_DAY_HOURS) {
|
|
146
|
-
return HALF_DAY_HOURS;
|
|
147
|
-
}
|
|
148
|
-
break;
|
|
149
|
-
case TIME_SYSTEM_TEXT.AM:
|
|
150
|
-
if (currHour < HALF_DAY_HOURS) {
|
|
151
|
-
if (currHour >= HALF_DAY_HOURS) {
|
|
152
|
-
return -HALF_DAY_HOURS;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
break;
|
|
156
|
-
default:
|
|
157
|
-
break;
|
|
158
|
-
}
|
|
159
|
-
return 0;
|
|
160
|
-
};
|
|
161
129
|
var handleHourInnerChange = useEventCallback(function (hour) {
|
|
162
130
|
var minuteInstance = minuteRef.current;
|
|
163
131
|
var periodInstance = periodRef.current;
|
|
@@ -200,6 +168,8 @@ var _RcTimePicker = forwardRef(function (inProps, ref) {
|
|
|
200
168
|
}, [PopoverPropsProp, classes, handlePopoverKeydown]);
|
|
201
169
|
// * make sure value inside range
|
|
202
170
|
useLayoutEffect(function () {
|
|
171
|
+
if (currentTimestamp === null)
|
|
172
|
+
return;
|
|
203
173
|
var time = getEmitInitDate();
|
|
204
174
|
if (range.max.date && currentTimestamp > range.max.timestamp) {
|
|
205
175
|
time.setHours(range.max.hour);
|
|
@@ -214,7 +184,7 @@ var _RcTimePicker = forwardRef(function (inProps, ref) {
|
|
|
214
184
|
}, [currentTimestamp, range, handleChange, getEmitInitDate]);
|
|
215
185
|
// * update input value
|
|
216
186
|
useDepsChange(function () {
|
|
217
|
-
if (
|
|
187
|
+
if (!isShowTextfieldValue) {
|
|
218
188
|
textFiledValueRef.current = '';
|
|
219
189
|
return;
|
|
220
190
|
}
|
|
@@ -232,7 +202,7 @@ var _RcTimePicker = forwardRef(function (inProps, ref) {
|
|
|
232
202
|
isTwelveHourSystem,
|
|
233
203
|
currentPeriod,
|
|
234
204
|
]);
|
|
235
|
-
// * when no
|
|
205
|
+
// * when no value, open menu use min as value
|
|
236
206
|
var originalHourValue = isHaveValue
|
|
237
207
|
? currentHourMinute.hour
|
|
238
208
|
: // * use original range to calculate period value
|
|
@@ -257,7 +227,7 @@ var _RcTimePicker = forwardRef(function (inProps, ref) {
|
|
|
257
227
|
var hourValue = isTwelveHourSystem
|
|
258
228
|
? originalHourValue % HALF_DAY_HOURS
|
|
259
229
|
: originalHourValue;
|
|
260
|
-
// * when no
|
|
230
|
+
// * when no value, open menu use min as value
|
|
261
231
|
var minuteValue = isHaveValue
|
|
262
232
|
? currentHourMinute.minute
|
|
263
233
|
: boundary.minute.min;
|
|
@@ -279,13 +249,7 @@ var _RcTimePicker = forwardRef(function (inProps, ref) {
|
|
|
279
249
|
: minuteSource, isTwelveHourSystem: isHourView && isTwelveHourSystem, value: isHourView ? hourValue : minuteValue, onClick: handleSelectionViewClick, automationId: "time-picker-" + selectionShowType }))))));
|
|
280
250
|
});
|
|
281
251
|
/** @release */
|
|
282
|
-
var RcTimePicker = styled(
|
|
283
|
-
{
|
|
284
|
-
prop: 'times',
|
|
285
|
-
time: '2021-4',
|
|
286
|
-
comment: "@deprecated this props will be removed, using value to replace that",
|
|
287
|
-
},
|
|
288
|
-
], 'RcTimePicker'))(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
|
|
252
|
+
var RcTimePicker = styled(_RcTimePicker)(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
|
|
289
253
|
RcTimePicker.defaultProps = {
|
|
290
254
|
clearBtn: true,
|
|
291
255
|
dateMode: false,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getTimestamp, getTimestampFromDate, HOUR_MINUTES, TIME_GAP,
|
|
1
|
+
import { getTimestamp, getTimestampFromDate, HOUR_MINUTES, TIME_GAP, getHourAndMinute, } from './TimePickerHelper';
|
|
2
2
|
var getDateBeginning = function () {
|
|
3
3
|
var date = new Date();
|
|
4
4
|
date.setHours(0, 0, 0, 0);
|
|
@@ -71,9 +71,14 @@ var TimeBoundary = /** @class */ (function () {
|
|
|
71
71
|
this._minute = Math.floor(time.getMinutes() / this.timeGap) * this.timeGap;
|
|
72
72
|
};
|
|
73
73
|
TimeBoundary.prototype.getDateTime = function () {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
var _a;
|
|
75
|
+
if (this.value instanceof Date) {
|
|
76
|
+
return this.value;
|
|
77
|
+
}
|
|
78
|
+
var _b = getHourAndMinute((_a = this.value) !== null && _a !== void 0 ? _a : 0), hour = _b.hour, minute = _b.minute;
|
|
79
|
+
var date = new Date();
|
|
80
|
+
date.setHours(hour, minute, 0, 0);
|
|
81
|
+
return date;
|
|
77
82
|
};
|
|
78
83
|
return TimeBoundary;
|
|
79
84
|
}());
|
|
@@ -61,7 +61,7 @@ var getTimestampFromDate = function (date) {
|
|
|
61
61
|
* hour and minute number
|
|
62
62
|
*/
|
|
63
63
|
var getHourAndMinute = function (times) {
|
|
64
|
-
if (
|
|
64
|
+
if (times === null) {
|
|
65
65
|
return {
|
|
66
66
|
hour: 0,
|
|
67
67
|
minute: 0,
|
|
@@ -74,17 +74,10 @@ var getHourAndMinute = function (times) {
|
|
|
74
74
|
minute: Math.floor(minute / ONE_MINUTE),
|
|
75
75
|
};
|
|
76
76
|
};
|
|
77
|
-
/**
|
|
78
|
-
* timestamp to date
|
|
79
|
-
*/
|
|
80
|
-
var timestampToDate = function (times) {
|
|
81
|
-
var _a = getHourAndMinute(times), hour = _a.hour, minute = _a.minute;
|
|
82
|
-
var date = new Date();
|
|
83
|
-
date.setHours(hour, minute, 0, 0);
|
|
84
|
-
return date;
|
|
85
|
-
};
|
|
86
77
|
/**
|
|
87
78
|
* get timestamp from date or timestamp
|
|
79
|
+
*
|
|
80
|
+
* if nowTime is number, it must be hour and minute timestamp
|
|
88
81
|
*/
|
|
89
82
|
function getTimestamp(nowTime) {
|
|
90
83
|
return nowTime instanceof Date ? getTimestampFromDate(nowTime) : nowTime;
|
|
@@ -101,4 +94,23 @@ var getTimestampFromHourAndMin = function (option) {
|
|
|
101
94
|
function getPeriod(currHour) {
|
|
102
95
|
return currHour >= HALF_DAY_HOURS ? TIME_SYSTEM_TEXT.PM : TIME_SYSTEM_TEXT.AM;
|
|
103
96
|
}
|
|
104
|
-
|
|
97
|
+
var getRecoupHour = function (currHour, period) {
|
|
98
|
+
switch (period) {
|
|
99
|
+
case TIME_SYSTEM_TEXT.PM:
|
|
100
|
+
if (currHour < HALF_DAY_HOURS) {
|
|
101
|
+
return HALF_DAY_HOURS;
|
|
102
|
+
}
|
|
103
|
+
break;
|
|
104
|
+
case TIME_SYSTEM_TEXT.AM:
|
|
105
|
+
if (currHour < HALF_DAY_HOURS) {
|
|
106
|
+
if (currHour >= HALF_DAY_HOURS) {
|
|
107
|
+
return -HALF_DAY_HOURS;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
break;
|
|
111
|
+
default:
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
return 0;
|
|
115
|
+
};
|
|
116
|
+
export { getFormattedTime, getHourAndMinute, getPeriod, getTimestamp, getTimestampFromDate, getTimestampFromHourAndMin, HALF_DAY_HOURS, HOUR_MINUTES, lastMinute, minuteSource, ONE_HOUR, pad, parseNumber, parseNumberToString, TIME_GAP, twelveHourSystemSource, twentyFourHourSystemSource, getRecoupHour, };
|