@enonic/ui 1.0.2 → 1.0.4
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/dist/enonic-ui.cjs +1 -1
- package/dist/enonic-ui.es.js +192 -192
- package/dist/types/components/toolbar/toolbar.d.ts +1 -0
- package/dist/types/hooks/use-keyboard-navigation.d.ts +5 -0
- package/dist/types/providers/id-provider.d.ts +1 -1
- package/dist/types/utils/is.d.ts +5 -0
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ export type ToolbarContextValue = {
|
|
|
8
8
|
unregisterItem: (id: string) => void;
|
|
9
9
|
getItems: () => string[];
|
|
10
10
|
isItemDisabled: (id: string) => boolean;
|
|
11
|
+
getItemElement: (id: string) => HTMLElement | null;
|
|
11
12
|
orientation: 'horizontal' | 'vertical';
|
|
12
13
|
loop: boolean;
|
|
13
14
|
};
|
|
@@ -7,6 +7,11 @@ export type KeyboardNavigationConfig = {
|
|
|
7
7
|
* Check if an item is disabled
|
|
8
8
|
*/
|
|
9
9
|
isItemDisabled: (id: string) => boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Check if an item is visible/focusable. Failing items are skipped during
|
|
12
|
+
* navigation, like disabled items. Defaults to always visible.
|
|
13
|
+
*/
|
|
14
|
+
isItemVisible?: (id: string) => boolean;
|
|
10
15
|
/**
|
|
11
16
|
* Currently active item ID
|
|
12
17
|
*/
|
|
@@ -9,7 +9,7 @@ export declare const IdProvider: {
|
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* Prefix provided or generated id with a prefix from the context
|
|
12
|
-
* @param providedId - The id to prefix.
|
|
12
|
+
* @param providedId - The id to prefix. A unique id is generated when omitted.
|
|
13
13
|
* @param prefix - A custom prefix used in addition to the one from context.
|
|
14
14
|
* @returns The prefixed id
|
|
15
15
|
*/
|
package/dist/types/utils/is.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import { ComponentType, ReactElement, ReactNode } from 'react';
|
|
2
2
|
export declare function isFunction(value: unknown): value is (...args: unknown[]) => unknown;
|
|
3
|
+
/**
|
|
4
|
+
* Whether an element can receive keyboard focus — false when missing, not
|
|
5
|
+
* rendered (`display:none`, detached), or inside an `aria-hidden`/`hidden` subtree.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isElementVisible(element: HTMLElement | null): boolean;
|
|
3
8
|
export declare function isOfType<P>(node: ReactNode, Comp: ComponentType<P>): node is ReactElement<P>;
|