@enonic/ui 0.32.0 → 0.34.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/dist/enonic-ui.cjs +1 -1
- package/dist/enonic-ui.es.js +146 -105
- package/dist/styles/style.css +1 -1
- package/dist/types/components/button/button.d.ts +1 -1
- package/dist/types/components/date-picker/date-picker.d.ts +122 -0
- package/dist/types/components/date-picker/index.d.ts +2 -0
- package/dist/types/components/dialog/dialog.d.ts +38 -2
- package/dist/types/components/dialog/index.d.ts +1 -1
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/radio-group/index.d.ts +1 -0
- package/dist/types/components/radio-group/radio-group.d.ts +33 -0
- package/dist/types/components/stepper/stepper.d.ts +2 -0
- package/dist/types/components/tree-list/tree-list.d.ts +8 -0
- package/dist/types/components/virtualized-tree-list/virtualized-tree-list.d.ts +18 -0
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/use-radio-navigation.d.ts +15 -0
- package/dist/types/providers/date-picker-provider.d.ts +32 -0
- package/dist/types/providers/index.d.ts +2 -0
- package/dist/types/providers/radio-provider.d.ts +21 -0
- package/package.json +4 -4
|
@@ -168,6 +168,24 @@ export type VirtualizedTreeListRootProps<TData = unknown> = {
|
|
|
168
168
|
* an item by clicking it again when nothing is selected.
|
|
169
169
|
*/
|
|
170
170
|
clearActiveOnReclick?: boolean;
|
|
171
|
+
/**
|
|
172
|
+
* When true, selection is preserved even when items are filtered.
|
|
173
|
+
* Use this when `items` represents a filtered view of a larger dataset.
|
|
174
|
+
*
|
|
175
|
+
* When false (default), selection is cleaned up when items change -
|
|
176
|
+
* selected IDs not present in `items` are removed from selection.
|
|
177
|
+
*
|
|
178
|
+
* @default false
|
|
179
|
+
*/
|
|
180
|
+
preserveFilteredSelection?: boolean;
|
|
181
|
+
/**
|
|
182
|
+
* When true (default), pressing Escape clears the selection.
|
|
183
|
+
* Set to false when using inside a Combobox where Escape should
|
|
184
|
+
* only close the dropdown without clearing selection.
|
|
185
|
+
*
|
|
186
|
+
* @default true
|
|
187
|
+
*/
|
|
188
|
+
clearSelectionOnEscape?: boolean;
|
|
171
189
|
/** Accessible label for the tree */
|
|
172
190
|
'aria-label'?: string;
|
|
173
191
|
/** Render function that receives items and helper props */
|
|
@@ -7,6 +7,7 @@ export { type ItemMetadata, type UseItemRegistryReturn, useItemRegistry } from '
|
|
|
7
7
|
export { type UseItemTextRegistryReturn, useItemTextRegistry } from './use-item-text-registry';
|
|
8
8
|
export { type KeyboardNavigationConfig, type UseKeyboardNavigationReturn, useKeyboardNavigation, } from './use-keyboard-navigation';
|
|
9
9
|
export { type PointerPosition, type UsePointerPositionConfig, usePointerPosition } from './use-pointer-position';
|
|
10
|
+
export { type RadioNavigationConfig, type UseRadioNavigationReturn, useRadioNavigation } from './use-radio-navigation';
|
|
10
11
|
export { type UseRovingTabIndexConfig, type UseRovingTabIndexReturn, useRovingTabIndex } from './use-roving-tabindex';
|
|
11
12
|
export { type UseScrollActiveIntoViewConfig, useScrollActiveIntoView } from './use-scroll-active-into-view';
|
|
12
13
|
export { useScrollLock } from './use-scroll-lock';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type RadioNavigationConfig = {
|
|
2
|
+
baseId: string;
|
|
3
|
+
getItems: () => string[];
|
|
4
|
+
getItemId?: (baseId: string, itemId: string) => string;
|
|
5
|
+
value: string | undefined;
|
|
6
|
+
onValueChange: (value: string) => void;
|
|
7
|
+
isItemDisabled: (id: string) => boolean;
|
|
8
|
+
loop?: boolean;
|
|
9
|
+
orientation?: 'horizontal' | 'vertical';
|
|
10
|
+
registryVersion: number;
|
|
11
|
+
};
|
|
12
|
+
export type UseRadioNavigationReturn = {
|
|
13
|
+
handleKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;
|
|
14
|
+
};
|
|
15
|
+
export declare function useRadioNavigation(config: RadioNavigationConfig): UseRadioNavigationReturn;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ReactElement, ReactNode, RefObject } from 'react';
|
|
2
|
+
export type DatePickerContextValue = {
|
|
3
|
+
baseId: string;
|
|
4
|
+
open: boolean;
|
|
5
|
+
setOpen: (open: boolean) => void;
|
|
6
|
+
triggerRef: RefObject<HTMLButtonElement>;
|
|
7
|
+
focusOnCloseRef?: RefObject<HTMLElement>;
|
|
8
|
+
name?: string;
|
|
9
|
+
form?: string;
|
|
10
|
+
value: Date | null;
|
|
11
|
+
setValue: (value: Date | null) => void;
|
|
12
|
+
month: Date;
|
|
13
|
+
setMonth: (month: Date) => void;
|
|
14
|
+
selectDate: (date: Date) => void;
|
|
15
|
+
locale?: Intl.LocalesArgument;
|
|
16
|
+
weekStartsOn: number;
|
|
17
|
+
minYear: number;
|
|
18
|
+
maxYear: number;
|
|
19
|
+
showOutsideDays: boolean;
|
|
20
|
+
showNavigation: boolean;
|
|
21
|
+
monthFormat: 'short' | 'long';
|
|
22
|
+
isDateDisabled: (date: Date) => boolean;
|
|
23
|
+
};
|
|
24
|
+
export type DatePickerProviderProps = {
|
|
25
|
+
value: DatePickerContextValue;
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
};
|
|
28
|
+
export declare const DatePickerProvider: {
|
|
29
|
+
({ value, children }: DatePickerProviderProps): ReactElement;
|
|
30
|
+
displayName: string;
|
|
31
|
+
};
|
|
32
|
+
export declare const useDatePicker: () => DatePickerContextValue;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
export * from './avatar-provider';
|
|
2
2
|
export * from './combobox-provider';
|
|
3
3
|
export * from './context-menu-provider';
|
|
4
|
+
export * from './date-picker-provider';
|
|
4
5
|
export * from './dialog-provider';
|
|
5
6
|
export * from './id-provider';
|
|
6
7
|
export * from './listbox-provider';
|
|
7
8
|
export * from './menu-provider';
|
|
8
9
|
export * from './menubar-menu-provider';
|
|
9
10
|
export * from './menubar-provider';
|
|
11
|
+
export * from './radio-provider';
|
|
10
12
|
export * from './search-field-provider';
|
|
11
13
|
export * from './selector-provider';
|
|
12
14
|
export * from './stepper-provider';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
export type RadioGroupContextValue = {
|
|
3
|
+
baseId: string;
|
|
4
|
+
name: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
onValueChange: (value: string) => void;
|
|
7
|
+
registerItem: (id: string, disabled?: boolean) => void;
|
|
8
|
+
unregisterItem: (id: string) => void;
|
|
9
|
+
getItems: () => string[];
|
|
10
|
+
isItemDisabled: (id: string) => boolean;
|
|
11
|
+
registryVersion: number;
|
|
12
|
+
};
|
|
13
|
+
export type RadioGroupProviderProps = {
|
|
14
|
+
value: RadioGroupContextValue;
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
};
|
|
17
|
+
export declare const RadioGroupProvider: {
|
|
18
|
+
({ value, children }: RadioGroupProviderProps): ReactElement;
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
21
|
+
export declare const useRadioGroup: () => RadioGroupContextValue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enonic/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"description": "Enonic UI Component Library",
|
|
5
5
|
"author": "Enonic",
|
|
6
6
|
"license": "MIT",
|
|
@@ -143,15 +143,15 @@
|
|
|
143
143
|
"size-limit": [
|
|
144
144
|
{
|
|
145
145
|
"path": "dist/enonic-ui.es.js",
|
|
146
|
-
"limit": "
|
|
146
|
+
"limit": "50 KB"
|
|
147
147
|
},
|
|
148
148
|
{
|
|
149
149
|
"path": "dist/enonic-ui.cjs",
|
|
150
|
-
"limit": "
|
|
150
|
+
"limit": "50 KB"
|
|
151
151
|
},
|
|
152
152
|
{
|
|
153
153
|
"path": "dist/styles/style.css",
|
|
154
|
-
"limit": "
|
|
154
|
+
"limit": "15 KB"
|
|
155
155
|
},
|
|
156
156
|
{
|
|
157
157
|
"path": "dist/styles/preset.css",
|