@ringcentral/juno 1.12.4-beta.5835-b8c3da57 → 1.12.4-beta.5873-31100a7c
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/Buttons/SplitButton/SplitButton.js +2 -1
- package/components/Downshift/Downshift.d.ts +2 -0
- package/components/Downshift/SuggestionList/SuggestionList.js +3 -0
- package/components/Downshift/utils/useDownshiftGroup.js +3 -2
- package/components/Forms/Picker/TimePicker/TimePicker.d.ts +13 -58
- package/components/Forms/Picker/TimePicker/TimePicker.js +15 -21
- package/components/Forms/Picker/TimePicker/index.d.ts +1 -0
- package/components/Forms/Picker/TimePicker/index.js +1 -0
- package/components/Forms/Picker/TimePicker/styles/StyledPickerPopperWrap.d.ts +8 -8
- package/components/Forms/Picker/TimePicker/utils/TimePickerHelper.d.ts +24 -0
- package/components/Forms/Picker/TimePicker/utils/TimePickerHelper.js +24 -0
- package/components/PortalHost/PortalManager/types.d.ts +1 -1
- package/es6/components/Buttons/SplitButton/SplitButton.js +3 -2
- package/es6/components/Downshift/SuggestionList/SuggestionList.js +3 -0
- package/es6/components/Downshift/utils/useDownshiftGroup.js +3 -2
- package/es6/components/Forms/Picker/TimePicker/TimePicker.js +15 -21
- package/es6/components/Forms/Picker/TimePicker/index.js +1 -0
- package/es6/components/Forms/Picker/TimePicker/utils/TimePickerHelper.js +24 -0
- package/es6/foundation/hooks/index.js +1 -0
- package/es6/foundation/hooks/useEver/index.js +1 -0
- package/es6/foundation/hooks/useEver/useEver.js +30 -0
- package/es6/foundation/theme/ThemeProvider.js +17 -4
- package/foundation/hooks/index.d.ts +1 -0
- package/foundation/hooks/index.js +1 -0
- package/foundation/hooks/useEver/index.d.ts +1 -0
- package/foundation/hooks/useEver/index.js +4 -0
- package/foundation/hooks/useEver/useEver.d.ts +13 -0
- package/foundation/hooks/useEver/useEver.js +32 -0
- package/foundation/theme/ThemeProvider.d.ts +6 -2
- package/foundation/theme/ThemeProvider.js +15 -2
- package/package.json +1 -1
|
@@ -27,6 +27,7 @@ var _RcSplitButton = react_1.forwardRef(function (inProps, ref) {
|
|
|
27
27
|
var innerRef = react_1.useRef(null);
|
|
28
28
|
var splitRef = foundation_1.useForkRef(innerRef, ref);
|
|
29
29
|
var isMenuOpen = !!anchorEl;
|
|
30
|
+
var isMenuEverOpen = foundation_1.useEver(isMenuOpen);
|
|
30
31
|
var _h = react_1.useMemo(function () {
|
|
31
32
|
var result = foundation_1.combineClasses(utils_1.RcSplitButtonClasses, classesProp);
|
|
32
33
|
return {
|
|
@@ -158,7 +159,7 @@ var _RcSplitButton = react_1.forwardRef(function (inProps, ref) {
|
|
|
158
159
|
react_1.default.createElement(Button_1.RcButton, tslib_1.__assign({}, _ActionButtonProps)),
|
|
159
160
|
react_1.default.createElement(Button_1.RcButton, tslib_1.__assign({ "aria-haspopup": "listbox" }, _ControlButtonProps),
|
|
160
161
|
react_1.default.createElement(styles_1.StyledArrowIcon, tslib_1.__assign({ open: isMenuOpen, size: variantIs(['round', 'plainIcon']) ? size : toButtonSize }, ArrowIconProps)))),
|
|
161
|
-
react_1.default.createElement(Menu_1.RcMenu, tslib_1.__assign({}, MenuProps, { anchorEl: anchorEl, open: isMenuOpen, onClose: handleClose }), children)));
|
|
162
|
+
isMenuEverOpen && (react_1.default.createElement(Menu_1.RcMenu, tslib_1.__assign({}, MenuProps, { anchorEl: anchorEl, open: isMenuOpen, onClose: handleClose }), children))));
|
|
162
163
|
});
|
|
163
164
|
var RcSplitButton = foundation_1.styled(_RcSplitButton)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.splitButtonStyle);
|
|
164
165
|
exports.RcSplitButton = RcSplitButton;
|
|
@@ -14,6 +14,8 @@ export interface RcDownshiftRenderOptionState {
|
|
|
14
14
|
selected: boolean;
|
|
15
15
|
/** that item index */
|
|
16
16
|
index: number;
|
|
17
|
+
/** sort index in option own group */
|
|
18
|
+
indexInOwnGroup?: number;
|
|
17
19
|
/** if that item is group title, that have that `expanded` state */
|
|
18
20
|
expanded?: boolean;
|
|
19
21
|
/** if that item is group title, that will have that `expandIconProps` */
|
|
@@ -115,6 +115,8 @@ var SuggestionList = react_1.forwardRef(function (inProps, ref) {
|
|
|
115
115
|
});
|
|
116
116
|
var selected = highlightedIndex === index;
|
|
117
117
|
var resultProps = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, option), itemProps), { 'aria-setsize': itemCount - (isTitleGroup ? (optionsGroupList === null || optionsGroupList === void 0 ? void 0 : optionsGroupList.length) || 0 : 0), 'aria-posinset': index - (isTitleGroup ? groupIndex : 0), key: itemProps.id });
|
|
118
|
+
var indexInOwnGroup = resultProps.indexInOwnGroup;
|
|
119
|
+
delete resultProps.indexInOwnGroup;
|
|
118
120
|
// * when item is not disabled, that should check outside is that disabled
|
|
119
121
|
if (!resultProps.freeSolo && !resultProps.disabled && getOptionDisabled) {
|
|
120
122
|
resultProps.disabled = getOptionDisabled(option);
|
|
@@ -123,6 +125,7 @@ var SuggestionList = react_1.forwardRef(function (inProps, ref) {
|
|
|
123
125
|
inputValue: inputValue,
|
|
124
126
|
selected: selected,
|
|
125
127
|
index: index,
|
|
128
|
+
indexInOwnGroup: indexInOwnGroup,
|
|
126
129
|
};
|
|
127
130
|
if (renderGroup && isGroupTitle) {
|
|
128
131
|
return renderGroup(resultProps, tslib_1.__assign(tslib_1.__assign({}, state), { expanded: (_e = option.group) === null || _e === void 0 ? void 0 : _e.expanded, expandIconProps: expandIconProps }));
|
|
@@ -38,7 +38,8 @@ exports.useDownshiftGroup = function (_a) {
|
|
|
38
38
|
var result = filteredResult.reduce(function (acc, option, index) {
|
|
39
39
|
var group = groupBy(option);
|
|
40
40
|
if (acc.length > 0 && acc[acc.length - 1].group === group) {
|
|
41
|
-
|
|
41
|
+
var currGroup = acc[acc.length - 1];
|
|
42
|
+
acc[acc.length - 1].options.push(tslib_1.__assign(tslib_1.__assign({}, option), { group: currGroup, indexInOwnGroup: currGroup.options.length - 1 }));
|
|
42
43
|
}
|
|
43
44
|
else {
|
|
44
45
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -55,7 +56,7 @@ exports.useDownshiftGroup = function (_a) {
|
|
|
55
56
|
key: index,
|
|
56
57
|
index: index,
|
|
57
58
|
group: group,
|
|
58
|
-
options: [tslib_1.__assign({}, option)],
|
|
59
|
+
options: [tslib_1.__assign(tslib_1.__assign({}, option), { indexInOwnGroup: 0 })],
|
|
59
60
|
expanded: false,
|
|
60
61
|
getExpandIconProps: function (additionExpandIconProps) {
|
|
61
62
|
return newGroup_1.options.length > 1
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { RcBaseProps, RcBaseSize, RcClassesProps } from '../../../../foundation';
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CustomStyledComponentResult, RcBaseProps, RcBaseSize, RcClassesProps } from '../../../../foundation';
|
|
3
3
|
import { PickerTextFieldProps } from '../utils';
|
|
4
4
|
import { NumberPickerProps } from './NumberPicker';
|
|
5
5
|
import { ToggleTextProps } from './ToggleText';
|
|
@@ -13,17 +13,17 @@ declare type RcClickFiledStyleProps = {
|
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
};
|
|
15
15
|
declare type PickNumberPickerProps = RcBaseProps<Partial<NumberPickerProps>, 'size' | 'onUpdateValue' | 'onClose' | 'onClick' | 'onKeyDown' | 'value' | 'min' | 'max' | 'isTwelveHourSystem' | 'source' | 'step'>;
|
|
16
|
-
declare type RcTimePickerProps = {
|
|
16
|
+
declare type RcTimePickerProps<T = false> = {
|
|
17
17
|
/** with two size: 'small' | 'medium', default with medium. */
|
|
18
18
|
size?: RcTimePickerSize;
|
|
19
19
|
/** Is 12 hours system */
|
|
20
20
|
isTwelveHourSystem?: boolean;
|
|
21
21
|
/** Date or timestamp */
|
|
22
|
-
value?: number |
|
|
22
|
+
value?: (T extends true ? Date : number) | null;
|
|
23
23
|
/** When all using date, this props will be remove, */
|
|
24
|
-
dateMode?:
|
|
24
|
+
dateMode?: T;
|
|
25
25
|
/** when user change time */
|
|
26
|
-
onChange?: (time
|
|
26
|
+
onChange?: (time: NonNullable<RcTimePickerProps<T>['value']> | null) => void;
|
|
27
27
|
/** min time */
|
|
28
28
|
min?: number | Date;
|
|
29
29
|
/** max time */
|
|
@@ -35,57 +35,12 @@ declare type RcTimePickerProps = {
|
|
|
35
35
|
/** props for periodToggle component */
|
|
36
36
|
PeriodToggleProps?: RcBaseProps<Partial<ToggleTextProps>, 'disabled' | 'isTwelveHourSystem' | 'size' | 'value' | 'onUpdateValue' | 'children'>;
|
|
37
37
|
/** @deprecated this props will be removed, using value to replace that */
|
|
38
|
-
times?: RcTimePickerProps['value'];
|
|
38
|
+
times?: RcTimePickerProps<T>['value'];
|
|
39
39
|
} & RcBaseProps<PickerTextFieldProps, 'onClick' | 'value' | 'children'> & RcClassesProps<'popover' | 'popoverPaper'>;
|
|
40
|
-
/**
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
/** Date or timestamp */
|
|
47
|
-
value?: number | Date | undefined;
|
|
48
|
-
/** When all using date, this props will be remove, */
|
|
49
|
-
dateMode?: boolean | undefined;
|
|
50
|
-
/** when user change time */
|
|
51
|
-
onChange?: ((time?: number | Date | undefined) => void) | undefined;
|
|
52
|
-
/** min time */
|
|
53
|
-
min?: number | Date | undefined;
|
|
54
|
-
/** max time */
|
|
55
|
-
max?: number | Date | undefined;
|
|
56
|
-
/** props for hourPicker component */
|
|
57
|
-
HourPickerProps?: Pick<Partial<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;
|
|
58
|
-
/** props for minutePicker component */
|
|
59
|
-
MinutePickerProps?: Pick<Partial<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;
|
|
60
|
-
/** props for periodToggle component */
|
|
61
|
-
PeriodToggleProps?: Pick<Partial<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;
|
|
62
|
-
/** @deprecated this props will be removed, using value to replace that */
|
|
63
|
-
times?: number | Date | undefined;
|
|
64
|
-
} & Pick<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"> & RcClassesProps<"popover" | "popoverPaper"> & React.RefAttributes<any>, import("../../../../foundation").RcTheme, Pick<{
|
|
65
|
-
/** with two size: 'small' | 'medium', default with medium. */
|
|
66
|
-
size?: "small" | "medium" | undefined;
|
|
67
|
-
/** Is 12 hours system */
|
|
68
|
-
isTwelveHourSystem?: boolean | undefined;
|
|
69
|
-
/** Date or timestamp */
|
|
70
|
-
value?: number | Date | undefined;
|
|
71
|
-
/** When all using date, this props will be remove, */
|
|
72
|
-
dateMode?: boolean | undefined;
|
|
73
|
-
/** when user change time */
|
|
74
|
-
onChange?: ((time?: number | Date | undefined) => void) | undefined;
|
|
75
|
-
/** min time */
|
|
76
|
-
min?: number | Date | undefined;
|
|
77
|
-
/** max time */
|
|
78
|
-
max?: number | Date | undefined;
|
|
79
|
-
/** props for hourPicker component */
|
|
80
|
-
HourPickerProps?: Pick<Partial<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;
|
|
81
|
-
/** props for minutePicker component */
|
|
82
|
-
MinutePickerProps?: Pick<Partial<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;
|
|
83
|
-
/** props for periodToggle component */
|
|
84
|
-
PeriodToggleProps?: Pick<Partial<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;
|
|
85
|
-
/** @deprecated this props will be removed, using value to replace that */
|
|
86
|
-
times?: number | Date | undefined;
|
|
87
|
-
} & Pick<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"> & RcClassesProps<"popover" | "popoverPaper"> & React.RefAttributes<any>, "ref" | "key" | "className" | "id" | "max" | "min" | "radius" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "label" | "classes" | "placeholder" | "size" | "value" | "variant" | "disabled" | "action" | "autoFocus" | "fullWidth" | "error" | "inputProps" | "inputRef" | "required" | "InputProps" | "helperText" | "gutterBottom" | "onClear" | "clearBtn" | "clearButtonProps" | "validate" | "PopoverProps" | "ActionSymbol" | "isTwelveHourSystem" | "dateMode" | "HourPickerProps" | "MinutePickerProps" | "PeriodToggleProps" | "times"> & {
|
|
88
|
-
theme?: import("../../../../foundation").RcTheme | undefined;
|
|
89
|
-
}>;
|
|
90
|
-
export { RcTimePicker };
|
|
40
|
+
/**
|
|
41
|
+
* when `dateMode={true}` that onChange will return `Date` object,
|
|
42
|
+
* otherwise return timestamp `number`
|
|
43
|
+
*/
|
|
44
|
+
declare const ExportType: <T extends boolean = false>(props: RcTimePickerProps<T>) => JSX.Element & CustomStyledComponentResult<RcTimePickerProps<T>>;
|
|
45
|
+
export { ExportType as RcTimePicker };
|
|
91
46
|
export type { RcClickFiledStyleProps, RcTimePickerProps, RcTimePickerSize };
|
|
@@ -14,6 +14,7 @@ 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;
|
|
17
18
|
var props = foundation_1.useThemeProps({ props: inProps, name: 'RcTimePicker' });
|
|
18
19
|
var isTwelveHourSystem = props.isTwelveHourSystem, value = props.value, times = props.times, 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, rest = tslib_1.__rest(props, ["isTwelveHourSystem", "value", "times", "onChange", "disabled", "dateMode", "min", "max", "size", "onKeyDown", "onClear", "HourPickerProps", "MinutePickerProps", "PeriodToggleProps", "PopoverProps", "InputProps", "classes"]);
|
|
19
20
|
// TODO: when props remove clear that code, not use forwardRef for Jupiter test issue
|
|
@@ -30,8 +31,8 @@ var _RcTimePicker = react_1.forwardRef(function (inProps, ref) {
|
|
|
30
31
|
var minuteRef = react_1.useRef(null);
|
|
31
32
|
var periodRef = react_1.useRef(null);
|
|
32
33
|
var textFiledValueRef = react_1.useRef('');
|
|
33
|
-
var
|
|
34
|
-
var nowTime = value
|
|
34
|
+
var _b = tslib_1.__read(react_1.useState('none'), 2), selectionShowType = _b[0], setSelectionType = _b[1];
|
|
35
|
+
var nowTime = (_a = value) !== null && _a !== void 0 ? _a : times;
|
|
35
36
|
var isHaveValue = nowTime !== undefined;
|
|
36
37
|
var isDateMode = nowTime instanceof Date || dateMode;
|
|
37
38
|
var currentTimestamp = utils_2.getTimestamp(nowTime);
|
|
@@ -65,8 +66,8 @@ var _RcTimePicker = react_1.forwardRef(function (inProps, ref) {
|
|
|
65
66
|
onChange(toValue);
|
|
66
67
|
}
|
|
67
68
|
else {
|
|
68
|
-
// * when time is zero emit
|
|
69
|
-
onChange(toValue ? utils_2.getTimestampFromDate(toValue) :
|
|
69
|
+
// * when time is zero emit null
|
|
70
|
+
onChange(toValue ? utils_2.getTimestampFromDate(toValue) : null);
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
73
|
}, [isDateMode, onChange]);
|
|
@@ -112,22 +113,8 @@ var _RcTimePicker = react_1.forwardRef(function (inProps, ref) {
|
|
|
112
113
|
return updateTime({ period: period });
|
|
113
114
|
});
|
|
114
115
|
var handleClear = foundation_1.useEventCallback(function (e) {
|
|
115
|
-
var time;
|
|
116
|
-
// if that is date format, we couldn't reset to undefined, that will miss that date information.
|
|
117
|
-
if (isDateMode) {
|
|
118
|
-
if (range.min.date) {
|
|
119
|
-
time = getEmitInitDate();
|
|
120
|
-
time.setHours(range.min.hour);
|
|
121
|
-
time.setMinutes(range.min.minute);
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
time = new Date(nowTime);
|
|
125
|
-
time.setHours(0);
|
|
126
|
-
time.setMinutes(0);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
116
|
onClear === null || onClear === void 0 ? void 0 : onClear(e);
|
|
130
|
-
handleChange(
|
|
117
|
+
handleChange(null);
|
|
131
118
|
});
|
|
132
119
|
var handleSelectionViewClick = foundation_1.useEventCallback(function (toValue) {
|
|
133
120
|
updateTime(isHourView ? { hour: toValue } : { minute: toValue });
|
|
@@ -137,7 +124,9 @@ var _RcTimePicker = react_1.forwardRef(function (inProps, ref) {
|
|
|
137
124
|
var _a;
|
|
138
125
|
(_a = actionRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
139
126
|
});
|
|
140
|
-
var setHourSelectionShow = foundation_1.useEventCallback(function () {
|
|
127
|
+
var setHourSelectionShow = foundation_1.useEventCallback(function () {
|
|
128
|
+
return setSelectionType('hour');
|
|
129
|
+
});
|
|
141
130
|
var setMinuteSelectionShow = foundation_1.useEventCallback(function () {
|
|
142
131
|
return setSelectionType('minute');
|
|
143
132
|
});
|
|
@@ -299,7 +288,6 @@ var RcTimePicker = foundation_1.styled(foundation_1.withDeprecatedCheck(_RcTimeP
|
|
|
299
288
|
comment: "@deprecated this props will be removed, using value to replace that",
|
|
300
289
|
},
|
|
301
290
|
], 'RcTimePicker'))(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject([""], [""])));
|
|
302
|
-
exports.RcTimePicker = RcTimePicker;
|
|
303
291
|
RcTimePicker.defaultProps = {
|
|
304
292
|
clearBtn: true,
|
|
305
293
|
dateMode: false,
|
|
@@ -321,4 +309,10 @@ RcTimePicker.defaultProps = {
|
|
|
321
309
|
},
|
|
322
310
|
};
|
|
323
311
|
RcTimePicker.displayName = 'RcTimePicker';
|
|
312
|
+
/**
|
|
313
|
+
* when `dateMode={true}` that onChange will return `Date` object,
|
|
314
|
+
* otherwise return timestamp `number`
|
|
315
|
+
*/
|
|
316
|
+
var ExportType = RcTimePicker;
|
|
317
|
+
exports.RcTimePicker = ExportType;
|
|
324
318
|
var templateObject_1;
|
|
@@ -5,3 +5,4 @@ tslib_1.__exportStar(require("./NumberPicker"), exports);
|
|
|
5
5
|
tslib_1.__exportStar(require("./ToggleText"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./SelectionView"), exports);
|
|
7
7
|
tslib_1.__exportStar(require("./TimePicker"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./utils"), exports);
|
|
@@ -3,25 +3,25 @@
|
|
|
3
3
|
export declare const StyledPickerPopperWrap: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
4
4
|
size?: "small" | "medium" | undefined;
|
|
5
5
|
isTwelveHourSystem?: boolean | undefined;
|
|
6
|
-
value?: number |
|
|
7
|
-
dateMode?:
|
|
8
|
-
onChange?: ((time
|
|
6
|
+
value?: number | null | undefined;
|
|
7
|
+
dateMode?: false | undefined;
|
|
8
|
+
onChange?: ((time: number | null) => void) | undefined;
|
|
9
9
|
min?: number | Date | undefined;
|
|
10
10
|
max?: number | Date | undefined;
|
|
11
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
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
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 |
|
|
14
|
+
times?: number | null | undefined;
|
|
15
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
16
|
size?: "small" | "medium" | undefined;
|
|
17
17
|
isTwelveHourSystem?: boolean | undefined;
|
|
18
|
-
value?: number |
|
|
19
|
-
dateMode?:
|
|
20
|
-
onChange?: ((time
|
|
18
|
+
value?: number | null | undefined;
|
|
19
|
+
dateMode?: false | undefined;
|
|
20
|
+
onChange?: ((time: number | null) => void) | undefined;
|
|
21
21
|
min?: number | Date | undefined;
|
|
22
22
|
max?: number | Date | undefined;
|
|
23
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
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
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 |
|
|
26
|
+
times?: number | null | undefined;
|
|
27
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">>;
|
|
@@ -8,6 +8,12 @@ declare type GetFormattedTimeOption = {
|
|
|
8
8
|
minute: number;
|
|
9
9
|
period: TIME_SYSTEM_TEXT;
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* get formatted time hh:mm
|
|
13
|
+
* @param option `{hour, min, period}`
|
|
14
|
+
* @param isTwelveHourSystem boolean
|
|
15
|
+
* @returns `hh:mm AM` or `hh:mm PM` or `hh:mm`
|
|
16
|
+
*/
|
|
11
17
|
declare const getFormattedTime: ({ hour, minute, period }: GetFormattedTimeOption, isTwelveHourSystem?: boolean | undefined) => string;
|
|
12
18
|
declare const HALF_DAY_HOURS = 12;
|
|
13
19
|
declare const HOUR_MINUTES = 60;
|
|
@@ -17,16 +23,34 @@ declare const twelveHourSystemSource: number[];
|
|
|
17
23
|
declare const twentyFourHourSystemSource: number[];
|
|
18
24
|
declare const minuteSource: number[];
|
|
19
25
|
declare const lastMinute = 45;
|
|
26
|
+
/**
|
|
27
|
+
* hour and minute timestamp
|
|
28
|
+
*/
|
|
20
29
|
declare const getTimestampFromDate: (date: Date) => number;
|
|
30
|
+
/**
|
|
31
|
+
* hour and minute number
|
|
32
|
+
*/
|
|
21
33
|
declare const getHourAndMinute: (times?: number | undefined) => {
|
|
22
34
|
hour: number;
|
|
23
35
|
minute: number;
|
|
24
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* timestamp to date
|
|
39
|
+
*/
|
|
25
40
|
declare const timestampToDate: (times?: number | undefined) => Date;
|
|
41
|
+
/**
|
|
42
|
+
* get timestamp from date or timestamp
|
|
43
|
+
*/
|
|
26
44
|
declare function getTimestamp(nowTime: number | Date): number;
|
|
45
|
+
/**
|
|
46
|
+
* hour and min object to timestamp
|
|
47
|
+
*/
|
|
27
48
|
declare const getTimestampFromHourAndMin: (option: {
|
|
28
49
|
hour: number;
|
|
29
50
|
minute: number;
|
|
30
51
|
}) => number;
|
|
52
|
+
/**
|
|
53
|
+
* get period, `PM` or `AM`
|
|
54
|
+
*/
|
|
31
55
|
declare function getPeriod(currHour: number): TIME_SYSTEM_TEXT;
|
|
32
56
|
export { getFormattedTime, getHourAndMinute, getPeriod, getTimestamp, getTimestampFromDate, getTimestampFromHourAndMin, HALF_DAY_HOURS, HOUR_MINUTES, lastMinute, minuteSource, ONE_HOUR, pad, parseNumber, parseNumberToString, TIME_GAP, timestampToDate, twelveHourSystemSource, twentyFourHourSystemSource, };
|
|
@@ -23,6 +23,12 @@ var pad = function (num, size) {
|
|
|
23
23
|
return s;
|
|
24
24
|
};
|
|
25
25
|
exports.pad = pad;
|
|
26
|
+
/**
|
|
27
|
+
* get formatted time hh:mm
|
|
28
|
+
* @param option `{hour, min, period}`
|
|
29
|
+
* @param isTwelveHourSystem boolean
|
|
30
|
+
* @returns `hh:mm AM` or `hh:mm PM` or `hh:mm`
|
|
31
|
+
*/
|
|
26
32
|
var getFormattedTime = function (_a, isTwelveHourSystem) {
|
|
27
33
|
var hour = _a.hour, minute = _a.minute, period = _a.period;
|
|
28
34
|
var formattedHour = parseNumberToString(hour, isTwelveHourSystem);
|
|
@@ -59,10 +65,16 @@ var minuteSource = [0, 15, 30, 45];
|
|
|
59
65
|
exports.minuteSource = minuteSource;
|
|
60
66
|
var lastMinute = 45;
|
|
61
67
|
exports.lastMinute = lastMinute;
|
|
68
|
+
/**
|
|
69
|
+
* hour and minute timestamp
|
|
70
|
+
*/
|
|
62
71
|
var getTimestampFromDate = function (date) {
|
|
63
72
|
return date.getHours() * ONE_HOUR + date.getMinutes() * ONE_MINUTE;
|
|
64
73
|
};
|
|
65
74
|
exports.getTimestampFromDate = getTimestampFromDate;
|
|
75
|
+
/**
|
|
76
|
+
* hour and minute number
|
|
77
|
+
*/
|
|
66
78
|
var getHourAndMinute = function (times) {
|
|
67
79
|
if (!times) {
|
|
68
80
|
return {
|
|
@@ -78,6 +90,9 @@ var getHourAndMinute = function (times) {
|
|
|
78
90
|
};
|
|
79
91
|
};
|
|
80
92
|
exports.getHourAndMinute = getHourAndMinute;
|
|
93
|
+
/**
|
|
94
|
+
* timestamp to date
|
|
95
|
+
*/
|
|
81
96
|
var timestampToDate = function (times) {
|
|
82
97
|
var _a = getHourAndMinute(times), hour = _a.hour, minute = _a.minute;
|
|
83
98
|
var date = new Date();
|
|
@@ -85,14 +100,23 @@ var timestampToDate = function (times) {
|
|
|
85
100
|
return date;
|
|
86
101
|
};
|
|
87
102
|
exports.timestampToDate = timestampToDate;
|
|
103
|
+
/**
|
|
104
|
+
* get timestamp from date or timestamp
|
|
105
|
+
*/
|
|
88
106
|
function getTimestamp(nowTime) {
|
|
89
107
|
return nowTime instanceof Date ? getTimestampFromDate(nowTime) : nowTime;
|
|
90
108
|
}
|
|
91
109
|
exports.getTimestamp = getTimestamp;
|
|
110
|
+
/**
|
|
111
|
+
* hour and min object to timestamp
|
|
112
|
+
*/
|
|
92
113
|
var getTimestampFromHourAndMin = function (option) {
|
|
93
114
|
return option.hour * ONE_HOUR + option.minute * ONE_MINUTE;
|
|
94
115
|
};
|
|
95
116
|
exports.getTimestampFromHourAndMin = getTimestampFromHourAndMin;
|
|
117
|
+
/**
|
|
118
|
+
* get period, `PM` or `AM`
|
|
119
|
+
*/
|
|
96
120
|
function getPeriod(currHour) {
|
|
97
121
|
return currHour >= HALF_DAY_HOURS ? constant_1.TIME_SYSTEM_TEXT.PM : constant_1.TIME_SYSTEM_TEXT.AM;
|
|
98
122
|
}
|
|
@@ -63,7 +63,7 @@ export interface PortalController<P extends {} = {}, F = any, D extends {} = {}>
|
|
|
63
63
|
*/
|
|
64
64
|
readonly data?: D;
|
|
65
65
|
}
|
|
66
|
-
export declare type UpdatePropsHandler<P extends {} = {}> = (preProps?: UncontrolledProps<P>) => UncontrolledProps<P
|
|
66
|
+
export declare type UpdatePropsHandler<P extends {} = {}> = (preProps?: UncontrolledProps<P>) => Partial<UncontrolledProps<P>>;
|
|
67
67
|
export declare type ControlledProps<P extends {} = {}, F = undefined> = P & {
|
|
68
68
|
onClose: (feedback?: F) => void;
|
|
69
69
|
open: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __assign, __makeTemplateObject, __read, __rest } from "tslib";
|
|
2
2
|
import React, { forwardRef, useMemo, useRef, useState, } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
-
import { checkDefaultPrevented, combineClasses, combineProps, logInDev, omit, styled, useEventCallback, useForkRef, useTheme, useThemeProps, } from '../../../foundation';
|
|
4
|
+
import { checkDefaultPrevented, combineClasses, combineProps, logInDev, omit, styled, useEver, useEventCallback, useForkRef, useTheme, useThemeProps, } from '../../../foundation';
|
|
5
5
|
import { RcMenu } from '../../Menu/Menu';
|
|
6
6
|
import { RcButton } from '../Button';
|
|
7
7
|
import { RcButtonGroup } from '../ButtonGroup';
|
|
@@ -25,6 +25,7 @@ var _RcSplitButton = forwardRef(function (inProps, ref) {
|
|
|
25
25
|
var innerRef = useRef(null);
|
|
26
26
|
var splitRef = useForkRef(innerRef, ref);
|
|
27
27
|
var isMenuOpen = !!anchorEl;
|
|
28
|
+
var isMenuEverOpen = useEver(isMenuOpen);
|
|
28
29
|
var _h = useMemo(function () {
|
|
29
30
|
var result = combineClasses(RcSplitButtonClasses, classesProp);
|
|
30
31
|
return {
|
|
@@ -156,7 +157,7 @@ var _RcSplitButton = forwardRef(function (inProps, ref) {
|
|
|
156
157
|
React.createElement(RcButton, __assign({}, _ActionButtonProps)),
|
|
157
158
|
React.createElement(RcButton, __assign({ "aria-haspopup": "listbox" }, _ControlButtonProps),
|
|
158
159
|
React.createElement(StyledArrowIcon, __assign({ open: isMenuOpen, size: variantIs(['round', 'plainIcon']) ? size : toButtonSize }, ArrowIconProps)))),
|
|
159
|
-
React.createElement(RcMenu, __assign({}, MenuProps, { anchorEl: anchorEl, open: isMenuOpen, onClose: handleClose }), children)));
|
|
160
|
+
isMenuEverOpen && (React.createElement(RcMenu, __assign({}, MenuProps, { anchorEl: anchorEl, open: isMenuOpen, onClose: handleClose }), children))));
|
|
160
161
|
});
|
|
161
162
|
var RcSplitButton = styled(_RcSplitButton)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), splitButtonStyle);
|
|
162
163
|
RcSplitButton.displayName = 'RcSplitButton';
|
|
@@ -113,6 +113,8 @@ var SuggestionList = forwardRef(function (inProps, ref) {
|
|
|
113
113
|
});
|
|
114
114
|
var selected = highlightedIndex === index;
|
|
115
115
|
var resultProps = __assign(__assign(__assign({}, option), itemProps), { 'aria-setsize': itemCount - (isTitleGroup ? (optionsGroupList === null || optionsGroupList === void 0 ? void 0 : optionsGroupList.length) || 0 : 0), 'aria-posinset': index - (isTitleGroup ? groupIndex : 0), key: itemProps.id });
|
|
116
|
+
var indexInOwnGroup = resultProps.indexInOwnGroup;
|
|
117
|
+
delete resultProps.indexInOwnGroup;
|
|
116
118
|
// * when item is not disabled, that should check outside is that disabled
|
|
117
119
|
if (!resultProps.freeSolo && !resultProps.disabled && getOptionDisabled) {
|
|
118
120
|
resultProps.disabled = getOptionDisabled(option);
|
|
@@ -121,6 +123,7 @@ var SuggestionList = forwardRef(function (inProps, ref) {
|
|
|
121
123
|
inputValue: inputValue,
|
|
122
124
|
selected: selected,
|
|
123
125
|
index: index,
|
|
126
|
+
indexInOwnGroup: indexInOwnGroup,
|
|
124
127
|
};
|
|
125
128
|
if (renderGroup && isGroupTitle) {
|
|
126
129
|
return renderGroup(resultProps, __assign(__assign({}, state), { expanded: (_e = option.group) === null || _e === void 0 ? void 0 : _e.expanded, expandIconProps: expandIconProps }));
|
|
@@ -36,7 +36,8 @@ export var useDownshiftGroup = function (_a) {
|
|
|
36
36
|
var result = filteredResult.reduce(function (acc, option, index) {
|
|
37
37
|
var group = groupBy(option);
|
|
38
38
|
if (acc.length > 0 && acc[acc.length - 1].group === group) {
|
|
39
|
-
|
|
39
|
+
var currGroup = acc[acc.length - 1];
|
|
40
|
+
acc[acc.length - 1].options.push(__assign(__assign({}, option), { group: currGroup, indexInOwnGroup: currGroup.options.length - 1 }));
|
|
40
41
|
}
|
|
41
42
|
else {
|
|
42
43
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -53,7 +54,7 @@ export var useDownshiftGroup = function (_a) {
|
|
|
53
54
|
key: index,
|
|
54
55
|
index: index,
|
|
55
56
|
group: group,
|
|
56
|
-
options: [__assign({}, option)],
|
|
57
|
+
options: [__assign(__assign({}, option), { indexInOwnGroup: 0 })],
|
|
57
58
|
expanded: false,
|
|
58
59
|
getExpandIconProps: function (additionExpandIconProps) {
|
|
59
60
|
return newGroup_1.options.length > 1
|
|
@@ -12,6 +12,7 @@ import { StyledPickerPopperWrap } from './styles';
|
|
|
12
12
|
import { ToggleText } from './ToggleText';
|
|
13
13
|
import { getFormattedTime, getHourAndMinute, getNumberPickerBoundary, getPeriod, getRangeBoundary, getTimestamp, getTimestampFromDate, HALF_DAY_HOURS, minuteSource, parseNumberToString, RcTimePickerClasses, TIME_GAP, timestampToDate, twelveHourSystemSource, twentyFourHourSystemSource, } from './utils';
|
|
14
14
|
var _RcTimePicker = forwardRef(function (inProps, ref) {
|
|
15
|
+
var _a;
|
|
15
16
|
var props = useThemeProps({ props: inProps, name: 'RcTimePicker' });
|
|
16
17
|
var isTwelveHourSystem = props.isTwelveHourSystem, value = props.value, times = props.times, 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, rest = __rest(props, ["isTwelveHourSystem", "value", "times", "onChange", "disabled", "dateMode", "min", "max", "size", "onKeyDown", "onClear", "HourPickerProps", "MinutePickerProps", "PeriodToggleProps", "PopoverProps", "InputProps", "classes"]);
|
|
17
18
|
// TODO: when props remove clear that code, not use forwardRef for Jupiter test issue
|
|
@@ -28,8 +29,8 @@ var _RcTimePicker = forwardRef(function (inProps, ref) {
|
|
|
28
29
|
var minuteRef = useRef(null);
|
|
29
30
|
var periodRef = useRef(null);
|
|
30
31
|
var textFiledValueRef = useRef('');
|
|
31
|
-
var
|
|
32
|
-
var nowTime = value
|
|
32
|
+
var _b = __read(useState('none'), 2), selectionShowType = _b[0], setSelectionType = _b[1];
|
|
33
|
+
var nowTime = (_a = value) !== null && _a !== void 0 ? _a : times;
|
|
33
34
|
var isHaveValue = nowTime !== undefined;
|
|
34
35
|
var isDateMode = nowTime instanceof Date || dateMode;
|
|
35
36
|
var currentTimestamp = getTimestamp(nowTime);
|
|
@@ -63,8 +64,8 @@ var _RcTimePicker = forwardRef(function (inProps, ref) {
|
|
|
63
64
|
onChange(toValue);
|
|
64
65
|
}
|
|
65
66
|
else {
|
|
66
|
-
// * when time is zero emit
|
|
67
|
-
onChange(toValue ? getTimestampFromDate(toValue) :
|
|
67
|
+
// * when time is zero emit null
|
|
68
|
+
onChange(toValue ? getTimestampFromDate(toValue) : null);
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
}, [isDateMode, onChange]);
|
|
@@ -110,22 +111,8 @@ var _RcTimePicker = forwardRef(function (inProps, ref) {
|
|
|
110
111
|
return updateTime({ period: period });
|
|
111
112
|
});
|
|
112
113
|
var handleClear = useEventCallback(function (e) {
|
|
113
|
-
var time;
|
|
114
|
-
// if that is date format, we couldn't reset to undefined, that will miss that date information.
|
|
115
|
-
if (isDateMode) {
|
|
116
|
-
if (range.min.date) {
|
|
117
|
-
time = getEmitInitDate();
|
|
118
|
-
time.setHours(range.min.hour);
|
|
119
|
-
time.setMinutes(range.min.minute);
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
time = new Date(nowTime);
|
|
123
|
-
time.setHours(0);
|
|
124
|
-
time.setMinutes(0);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
114
|
onClear === null || onClear === void 0 ? void 0 : onClear(e);
|
|
128
|
-
handleChange(
|
|
115
|
+
handleChange(null);
|
|
129
116
|
});
|
|
130
117
|
var handleSelectionViewClick = useEventCallback(function (toValue) {
|
|
131
118
|
updateTime(isHourView ? { hour: toValue } : { minute: toValue });
|
|
@@ -135,7 +122,9 @@ var _RcTimePicker = forwardRef(function (inProps, ref) {
|
|
|
135
122
|
var _a;
|
|
136
123
|
(_a = actionRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
137
124
|
});
|
|
138
|
-
var setHourSelectionShow = useEventCallback(function () {
|
|
125
|
+
var setHourSelectionShow = useEventCallback(function () {
|
|
126
|
+
return setSelectionType('hour');
|
|
127
|
+
});
|
|
139
128
|
var setMinuteSelectionShow = useEventCallback(function () {
|
|
140
129
|
return setSelectionType('minute');
|
|
141
130
|
});
|
|
@@ -318,5 +307,10 @@ RcTimePicker.defaultProps = {
|
|
|
318
307
|
},
|
|
319
308
|
};
|
|
320
309
|
RcTimePicker.displayName = 'RcTimePicker';
|
|
321
|
-
|
|
310
|
+
/**
|
|
311
|
+
* when `dateMode={true}` that onChange will return `Date` object,
|
|
312
|
+
* otherwise return timestamp `number`
|
|
313
|
+
*/
|
|
314
|
+
var ExportType = RcTimePicker;
|
|
315
|
+
export { ExportType as RcTimePicker };
|
|
322
316
|
var templateObject_1;
|
|
@@ -18,6 +18,12 @@ var pad = function (num, size) {
|
|
|
18
18
|
}
|
|
19
19
|
return s;
|
|
20
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* get formatted time hh:mm
|
|
23
|
+
* @param option `{hour, min, period}`
|
|
24
|
+
* @param isTwelveHourSystem boolean
|
|
25
|
+
* @returns `hh:mm AM` or `hh:mm PM` or `hh:mm`
|
|
26
|
+
*/
|
|
21
27
|
var getFormattedTime = function (_a, isTwelveHourSystem) {
|
|
22
28
|
var hour = _a.hour, minute = _a.minute, period = _a.period;
|
|
23
29
|
var formattedHour = parseNumberToString(hour, isTwelveHourSystem);
|
|
@@ -45,9 +51,15 @@ var twelveHourSystemSource = buildConsecutiveNumberToArray(0, 11);
|
|
|
45
51
|
var twentyFourHourSystemSource = buildConsecutiveNumberToArray(0, 23);
|
|
46
52
|
var minuteSource = [0, 15, 30, 45];
|
|
47
53
|
var lastMinute = 45;
|
|
54
|
+
/**
|
|
55
|
+
* hour and minute timestamp
|
|
56
|
+
*/
|
|
48
57
|
var getTimestampFromDate = function (date) {
|
|
49
58
|
return date.getHours() * ONE_HOUR + date.getMinutes() * ONE_MINUTE;
|
|
50
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* hour and minute number
|
|
62
|
+
*/
|
|
51
63
|
var getHourAndMinute = function (times) {
|
|
52
64
|
if (!times) {
|
|
53
65
|
return {
|
|
@@ -62,18 +74,30 @@ var getHourAndMinute = function (times) {
|
|
|
62
74
|
minute: Math.floor(minute / ONE_MINUTE),
|
|
63
75
|
};
|
|
64
76
|
};
|
|
77
|
+
/**
|
|
78
|
+
* timestamp to date
|
|
79
|
+
*/
|
|
65
80
|
var timestampToDate = function (times) {
|
|
66
81
|
var _a = getHourAndMinute(times), hour = _a.hour, minute = _a.minute;
|
|
67
82
|
var date = new Date();
|
|
68
83
|
date.setHours(hour, minute, 0, 0);
|
|
69
84
|
return date;
|
|
70
85
|
};
|
|
86
|
+
/**
|
|
87
|
+
* get timestamp from date or timestamp
|
|
88
|
+
*/
|
|
71
89
|
function getTimestamp(nowTime) {
|
|
72
90
|
return nowTime instanceof Date ? getTimestampFromDate(nowTime) : nowTime;
|
|
73
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* hour and min object to timestamp
|
|
94
|
+
*/
|
|
74
95
|
var getTimestampFromHourAndMin = function (option) {
|
|
75
96
|
return option.hour * ONE_HOUR + option.minute * ONE_MINUTE;
|
|
76
97
|
};
|
|
98
|
+
/**
|
|
99
|
+
* get period, `PM` or `AM`
|
|
100
|
+
*/
|
|
77
101
|
function getPeriod(currHour) {
|
|
78
102
|
return currHour >= HALF_DAY_HOURS ? TIME_SYSTEM_TEXT.PM : TIME_SYSTEM_TEXT.AM;
|
|
79
103
|
}
|
|
@@ -5,6 +5,7 @@ export * from './useChange';
|
|
|
5
5
|
export * from './useDebounce';
|
|
6
6
|
export * from './useEventCallback';
|
|
7
7
|
export * from './useEventListener';
|
|
8
|
+
export * from './useEver';
|
|
8
9
|
export * from './useForceUpdate';
|
|
9
10
|
export * from './useForkRef';
|
|
10
11
|
export * from './useHiddenTabindex';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useEver';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useRef } from 'react';
|
|
2
|
+
var defaultEverTargetValue = function (value) { return !!value; };
|
|
3
|
+
/**
|
|
4
|
+
* that value ever to be `you want value`
|
|
5
|
+
* Return true when the value ever to be `you want value` once.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* // once that isOpen is true, that result will always be `true`
|
|
10
|
+
* const isEverOpen = useEver(isOpen);
|
|
11
|
+
*
|
|
12
|
+
* const isEverToBe2 = useEver(count, (val) => val === 2);
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export var useEver = function (
|
|
16
|
+
/** to be checked value */
|
|
17
|
+
value,
|
|
18
|
+
/**
|
|
19
|
+
* value ever to be callback, default when value to be exited.
|
|
20
|
+
*
|
|
21
|
+
* @default (value) => !!value
|
|
22
|
+
*/
|
|
23
|
+
targetValue) {
|
|
24
|
+
if (targetValue === void 0) { targetValue = defaultEverTargetValue; }
|
|
25
|
+
var result = useRef(false);
|
|
26
|
+
if (!result.current) {
|
|
27
|
+
result.current = targetValue(value);
|
|
28
|
+
}
|
|
29
|
+
return result.current;
|
|
30
|
+
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
1
|
+
import { __assign, __rest } from "tslib";
|
|
2
2
|
import 'focus-visible';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { MuiThemeProvider, StylesProvider } from '@material-ui/core/styles';
|
|
4
|
+
import { MuiThemeProvider, StylesProvider, createGenerateClassName, } from '@material-ui/core/styles';
|
|
5
5
|
import { ThemeProvider as StyledThemeProvider, useTheme, } from '../styled-components';
|
|
6
6
|
import createTheme from './createTheme';
|
|
7
|
+
import { useResultRef } from '../hooks';
|
|
7
8
|
/**
|
|
8
9
|
* sub theme provider,
|
|
9
10
|
* that will use when you want use multiple theme in one app
|
|
@@ -24,6 +25,18 @@ export var RcSubThemeProvider = function (_a) {
|
|
|
24
25
|
* each app should always have one `RcThemeProvider` at root,
|
|
25
26
|
* if you need multiple, use `RcSubThemeProvider` inside that `RcThemeProvider` */
|
|
26
27
|
export var RcThemeProvider = function (props) {
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
var prefixGlobalClass = props.prefixGlobalClass, rest = __rest(props, ["prefixGlobalClass"]);
|
|
29
|
+
// cannot pass `generateClassName: undefine`
|
|
30
|
+
// otherwise global class will be random
|
|
31
|
+
var stylesProviderProps = useResultRef(function () {
|
|
32
|
+
return prefixGlobalClass
|
|
33
|
+
? {
|
|
34
|
+
generateClassName: createGenerateClassName({
|
|
35
|
+
seed: prefixGlobalClass,
|
|
36
|
+
}),
|
|
37
|
+
}
|
|
38
|
+
: {};
|
|
39
|
+
});
|
|
40
|
+
return (React.createElement(StylesProvider, __assign({ injectFirst: true }, stylesProviderProps.current),
|
|
41
|
+
React.createElement(RcSubThemeProvider, __assign({}, rest))));
|
|
29
42
|
};
|
|
@@ -5,6 +5,7 @@ export * from './useChange';
|
|
|
5
5
|
export * from './useDebounce';
|
|
6
6
|
export * from './useEventCallback';
|
|
7
7
|
export * from './useEventListener';
|
|
8
|
+
export * from './useEver';
|
|
8
9
|
export * from './useForceUpdate';
|
|
9
10
|
export * from './useForkRef';
|
|
10
11
|
export * from './useHiddenTabindex';
|
|
@@ -8,6 +8,7 @@ tslib_1.__exportStar(require("./useChange"), exports);
|
|
|
8
8
|
tslib_1.__exportStar(require("./useDebounce"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./useEventCallback"), exports);
|
|
10
10
|
tslib_1.__exportStar(require("./useEventListener"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./useEver"), exports);
|
|
11
12
|
tslib_1.__exportStar(require("./useForceUpdate"), exports);
|
|
12
13
|
tslib_1.__exportStar(require("./useForkRef"), exports);
|
|
13
14
|
tslib_1.__exportStar(require("./useHiddenTabindex"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useEver';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* that value ever to be `you want value`
|
|
3
|
+
* Return true when the value ever to be `you want value` once.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* // once that isOpen is true, that result will always be `true`
|
|
8
|
+
* const isEverOpen = useEver(isOpen);
|
|
9
|
+
*
|
|
10
|
+
* const isEverToBe2 = useEver(count, (val) => val === 2);
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare const useEver: <T>(value: T, targetValue?: (value: T) => boolean) => boolean;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var react_1 = require("react");
|
|
4
|
+
var defaultEverTargetValue = function (value) { return !!value; };
|
|
5
|
+
/**
|
|
6
|
+
* that value ever to be `you want value`
|
|
7
|
+
* Return true when the value ever to be `you want value` once.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* // once that isOpen is true, that result will always be `true`
|
|
12
|
+
* const isEverOpen = useEver(isOpen);
|
|
13
|
+
*
|
|
14
|
+
* const isEverToBe2 = useEver(count, (val) => val === 2);
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
exports.useEver = function (
|
|
18
|
+
/** to be checked value */
|
|
19
|
+
value,
|
|
20
|
+
/**
|
|
21
|
+
* value ever to be callback, default when value to be exited.
|
|
22
|
+
*
|
|
23
|
+
* @default (value) => !!value
|
|
24
|
+
*/
|
|
25
|
+
targetValue) {
|
|
26
|
+
if (targetValue === void 0) { targetValue = defaultEverTargetValue; }
|
|
27
|
+
var result = react_1.useRef(false);
|
|
28
|
+
if (!result.current) {
|
|
29
|
+
result.current = targetValue(value);
|
|
30
|
+
}
|
|
31
|
+
return result.current;
|
|
32
|
+
};
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import 'focus-visible';
|
|
2
2
|
import { FunctionComponent, ReactNode } from 'react';
|
|
3
3
|
import { RcThemeInput } from './theme.type';
|
|
4
|
-
export declare type
|
|
4
|
+
export declare type RcSubThemeProviderProps = {
|
|
5
5
|
/** custom theme */
|
|
6
6
|
theme?: RcThemeInput;
|
|
7
7
|
children?: ReactNode;
|
|
8
8
|
};
|
|
9
|
+
export declare type RcThemeProviderProps = {
|
|
10
|
+
/** prefix the mui global class */
|
|
11
|
+
prefixGlobalClass?: string;
|
|
12
|
+
} & RcSubThemeProviderProps;
|
|
9
13
|
/**
|
|
10
14
|
* sub theme provider,
|
|
11
15
|
* that will use when you want use multiple theme in one app
|
|
12
16
|
* that will user parent's theme when not set theme
|
|
13
17
|
*/
|
|
14
|
-
export declare const RcSubThemeProvider: FunctionComponent<
|
|
18
|
+
export declare const RcSubThemeProvider: FunctionComponent<RcSubThemeProviderProps>;
|
|
15
19
|
/**
|
|
16
20
|
* theme wrapper, apply in root,
|
|
17
21
|
* each app should always have one `RcThemeProvider` at root,
|
|
@@ -6,6 +6,7 @@ var react_1 = tslib_1.__importDefault(require("react"));
|
|
|
6
6
|
var styles_1 = require("@material-ui/core/styles");
|
|
7
7
|
var styled_components_1 = require("../styled-components");
|
|
8
8
|
var createTheme_1 = tslib_1.__importDefault(require("./createTheme"));
|
|
9
|
+
var hooks_1 = require("../hooks");
|
|
9
10
|
/**
|
|
10
11
|
* sub theme provider,
|
|
11
12
|
* that will use when you want use multiple theme in one app
|
|
@@ -26,6 +27,18 @@ exports.RcSubThemeProvider = function (_a) {
|
|
|
26
27
|
* each app should always have one `RcThemeProvider` at root,
|
|
27
28
|
* if you need multiple, use `RcSubThemeProvider` inside that `RcThemeProvider` */
|
|
28
29
|
exports.RcThemeProvider = function (props) {
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
var prefixGlobalClass = props.prefixGlobalClass, rest = tslib_1.__rest(props, ["prefixGlobalClass"]);
|
|
31
|
+
// cannot pass `generateClassName: undefine`
|
|
32
|
+
// otherwise global class will be random
|
|
33
|
+
var stylesProviderProps = hooks_1.useResultRef(function () {
|
|
34
|
+
return prefixGlobalClass
|
|
35
|
+
? {
|
|
36
|
+
generateClassName: styles_1.createGenerateClassName({
|
|
37
|
+
seed: prefixGlobalClass,
|
|
38
|
+
}),
|
|
39
|
+
}
|
|
40
|
+
: {};
|
|
41
|
+
});
|
|
42
|
+
return (react_1.default.createElement(styles_1.StylesProvider, tslib_1.__assign({ injectFirst: true }, stylesProviderProps.current),
|
|
43
|
+
react_1.default.createElement(exports.RcSubThemeProvider, tslib_1.__assign({}, rest))));
|
|
31
44
|
};
|