@ringcentral/juno 2.26.2 → 2.28.0
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/Menu/MenuItem/MenuItem.d.ts +2 -2
- package/components/TablePagination/styles/TablePaginationStyle.d.ts +2 -2
- package/components/Tabs/TabList/TabList.d.ts +1 -1
- package/components/Tabs/Tabs/MoreMenuTabs/MoreMenuTabs.d.ts +2 -4
- package/components/Tabs/Tabs/MoreMenuTabs/MoreMenuTabs.js +4 -4
- package/components/Tabs/Tabs/Tabs.d.ts +6 -1
- package/components/Tabs/Tabs/Tabs.js +2 -2
- package/components/Text/Text.d.ts +1 -1
- package/components/VirtualizedMenu/VirtualizedMenuList.d.ts +1 -1
- package/components/VirtualizedMenu/VirtualizedMenuList.js +27 -22
- package/components/Virtuoso/react-virtuoso/Grid.d.ts +1 -1
- package/components/Virtuoso/react-virtuoso/List.d.ts +1 -1
- package/components/Virtuoso/react-virtuoso/Table.d.ts +1 -1
- package/components/Virtuoso/react-virtuoso/interfaces.d.ts +3 -3
- package/es6/components/Tabs/Tabs/MoreMenuTabs/MoreMenuTabs.js +4 -4
- package/es6/components/Tabs/Tabs/Tabs.js +2 -2
- package/es6/components/VirtualizedMenu/VirtualizedMenuList.js +28 -23
- package/es6/foundation/hooks/useKeyboardMoveFocus/useOnlyOneFocusable.js +5 -10
- package/foundation/hooks/useKeyboardMoveFocus/useOnlyOneFocusable.d.ts +2 -5
- package/foundation/hooks/useKeyboardMoveFocus/useOnlyOneFocusable.js +5 -10
- package/package.json +1 -1
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { combineProps } from '../../utils';
|
|
2
2
|
import { useId } from '../useId';
|
|
3
|
-
import { useRetry } from '../useRetry';
|
|
4
3
|
var MOVE_ATTR_KEY = 'data-move-focused';
|
|
5
4
|
/**
|
|
6
5
|
* when focus in container below element with binding `getItemProps`,
|
|
7
6
|
* that will only have one element can be focusable.
|
|
8
7
|
*/
|
|
9
8
|
export var useOnlyOneFocusable = function (_a) {
|
|
10
|
-
var focusedIndexRef = _a.focusedIndexRef, containerRef = _a.containerRef
|
|
9
|
+
var focusedIndexRef = _a.focusedIndexRef, containerRef = _a.containerRef;
|
|
11
10
|
var moveFocusedId = useId(MOVE_ATTR_KEY, true);
|
|
12
11
|
var getIndexElm = function (toIndex) { var _a; return (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.querySelector("[" + moveFocusedId + "=\"" + toIndex + "\"]"); };
|
|
13
12
|
var setIndexTabIndex = function (toIndex) {
|
|
@@ -20,17 +19,13 @@ export var useOnlyOneFocusable = function (_a) {
|
|
|
20
19
|
}
|
|
21
20
|
};
|
|
22
21
|
// * retry when not get target element
|
|
23
|
-
var
|
|
22
|
+
var focusIndex = function (toIndex) {
|
|
24
23
|
var toElm = getIndexElm(toIndex);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
return false;
|
|
30
|
-
}, retryOptions).retry;
|
|
24
|
+
toElm === null || toElm === void 0 ? void 0 : toElm.focus();
|
|
25
|
+
};
|
|
31
26
|
return {
|
|
32
27
|
moveFocusedId: moveFocusedId,
|
|
33
|
-
focusIndex:
|
|
28
|
+
focusIndex: focusIndex,
|
|
34
29
|
setIndexTabIndex: setIndexTabIndex,
|
|
35
30
|
getItemProps: function (index, options) {
|
|
36
31
|
var _a;
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
/// <reference types="styled-jsx" />
|
|
3
|
-
import { UseRetryOptions } from '../useRetry';
|
|
4
3
|
export declare type UseOnlyOneFocusableParams = {
|
|
5
4
|
/** current focused index `ref` */
|
|
6
5
|
focusedIndexRef: React.MutableRefObject<number>;
|
|
7
6
|
/** wrap container for below all only have one focusable */
|
|
8
7
|
containerRef: React.RefObject<HTMLElement>;
|
|
9
|
-
/** when focus fail that retry times option */
|
|
10
|
-
retryOptions?: UseRetryOptions;
|
|
11
8
|
};
|
|
12
9
|
/**
|
|
13
10
|
* when focus in container below element with binding `getItemProps`,
|
|
14
11
|
* that will only have one element can be focusable.
|
|
15
12
|
*/
|
|
16
|
-
export declare const useOnlyOneFocusable: ({ focusedIndexRef, containerRef,
|
|
13
|
+
export declare const useOnlyOneFocusable: ({ focusedIndexRef, containerRef, }: UseOnlyOneFocusableParams) => {
|
|
17
14
|
moveFocusedId: string;
|
|
18
|
-
focusIndex: (toIndex: number) =>
|
|
15
|
+
focusIndex: (toIndex: number) => void;
|
|
19
16
|
setIndexTabIndex: (toIndex: number) => void;
|
|
20
17
|
getItemProps: (index: number, options?: Pick<import("react").HTMLAttributes<HTMLElement>, "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" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "slot" | "title" | "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"> | undefined) => Pick<import("react").HTMLAttributes<HTMLElement>, "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" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "slot" | "title" | "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">;
|
|
21
18
|
};
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var utils_1 = require("../../utils");
|
|
4
4
|
var useId_1 = require("../useId");
|
|
5
|
-
var useRetry_1 = require("../useRetry");
|
|
6
5
|
var MOVE_ATTR_KEY = 'data-move-focused';
|
|
7
6
|
/**
|
|
8
7
|
* when focus in container below element with binding `getItemProps`,
|
|
9
8
|
* that will only have one element can be focusable.
|
|
10
9
|
*/
|
|
11
10
|
exports.useOnlyOneFocusable = function (_a) {
|
|
12
|
-
var focusedIndexRef = _a.focusedIndexRef, containerRef = _a.containerRef
|
|
11
|
+
var focusedIndexRef = _a.focusedIndexRef, containerRef = _a.containerRef;
|
|
13
12
|
var moveFocusedId = useId_1.useId(MOVE_ATTR_KEY, true);
|
|
14
13
|
var getIndexElm = function (toIndex) { var _a; return (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.querySelector("[" + moveFocusedId + "=\"" + toIndex + "\"]"); };
|
|
15
14
|
var setIndexTabIndex = function (toIndex) {
|
|
@@ -22,17 +21,13 @@ exports.useOnlyOneFocusable = function (_a) {
|
|
|
22
21
|
}
|
|
23
22
|
};
|
|
24
23
|
// * retry when not get target element
|
|
25
|
-
var
|
|
24
|
+
var focusIndex = function (toIndex) {
|
|
26
25
|
var toElm = getIndexElm(toIndex);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
return false;
|
|
32
|
-
}, retryOptions).retry;
|
|
26
|
+
toElm === null || toElm === void 0 ? void 0 : toElm.focus();
|
|
27
|
+
};
|
|
33
28
|
return {
|
|
34
29
|
moveFocusedId: moveFocusedId,
|
|
35
|
-
focusIndex:
|
|
30
|
+
focusIndex: focusIndex,
|
|
36
31
|
setIndexTabIndex: setIndexTabIndex,
|
|
37
32
|
getItemProps: function (index, options) {
|
|
38
33
|
var _a;
|