@lumx/vue 4.9.0-alpha.2 → 4.9.0-alpha.3
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/_internal/{BrPeaE_u.js → BqMObS2T.js} +26 -23
- package/_internal/{BrPeaE_u.js.map → BqMObS2T.js.map} +1 -1
- package/components/button/Button.d.ts +3 -5
- package/components/button/IconButton.d.ts +3 -5
- package/components/combobox/Combobox.stories.d.ts +152 -0
- package/components/combobox/Combobox.test.stories.d.ts +112 -0
- package/components/combobox/ComboboxButton.d.ts +44 -0
- package/components/combobox/ComboboxInput.d.ts +68 -0
- package/components/combobox/ComboboxList.d.ts +15 -0
- package/components/combobox/ComboboxOption.d.ts +29 -0
- package/components/combobox/ComboboxOptionAction.d.ts +20 -0
- package/components/combobox/ComboboxOptionMoreInfo.d.ts +29 -0
- package/components/combobox/ComboboxOptionSkeleton.d.ts +14 -0
- package/components/combobox/ComboboxPopover.d.ts +20 -0
- package/components/combobox/ComboboxProvider.d.ts +16 -0
- package/components/combobox/ComboboxSection.d.ts +14 -0
- package/components/combobox/ComboboxState.d.ts +14 -0
- package/components/combobox/context/ComboboxContext.d.ts +23 -0
- package/components/combobox/context/ComboboxListContext.d.ts +14 -0
- package/components/combobox/context/ComboboxOptionContext.d.ts +16 -0
- package/components/combobox/context/useComboboxEvent.d.ts +7 -0
- package/components/combobox/context/useComboboxOpen.d.ts +7 -0
- package/components/combobox/index.d.ts +112 -0
- package/components/expansion-panel/ExpansionPanel.d.ts +39 -0
- package/components/expansion-panel/ExpansionPanel.stories.d.ts +54 -0
- package/components/expansion-panel/index.d.ts +1 -0
- package/components/list/ListSection.stories.d.ts +21 -23
- package/components/mosaic/Mosaic.d.ts +30 -0
- package/components/mosaic/Mosaic.stories.d.ts +93 -0
- package/components/mosaic/index.d.ts +1 -0
- package/components/tabs/Tab.d.ts +16 -0
- package/components/tabs/TabList.d.ts +21 -0
- package/components/tabs/TabPanel.d.ts +16 -0
- package/components/tabs/TabProvider.d.ts +26 -0
- package/components/tabs/TabProvider.stories.d.ts +53 -0
- package/components/tabs/TabProvider.test.d.ts +1 -0
- package/components/tabs/index.d.ts +4 -0
- package/components/tabs/state.d.ts +19 -0
- package/components/text-field/TextField.d.ts +8 -0
- package/composables/useRovingTabIndexContainer.d.ts +25 -0
- package/composables/useWatchDisposable.d.ts +19 -0
- package/index.d.ts +4 -0
- package/index.js +6686 -4405
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/stories/decorators/withValueOnChange.d.ts +4 -4
- package/utils/VueToJSX.d.ts +7 -0
- package/utils/index.js +2 -2
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface TabProviderProps {
|
|
2
|
+
/** Active tab index (controlled mode). */
|
|
3
|
+
activeTabIndex?: number;
|
|
4
|
+
/** Tab panel children should not render if the tab panel is hidden. */
|
|
5
|
+
isLazy?: boolean;
|
|
6
|
+
/** Activate tabs on focus. */
|
|
7
|
+
shouldActivateOnFocus?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const emitSchema: {
|
|
10
|
+
change: (index: number) => boolean;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* This component provides a context in which tabs can be defined and linked to their tab panel.
|
|
14
|
+
*
|
|
15
|
+
* It does not produce any markup so you can wrap it around any Vue elements and then split
|
|
16
|
+
* the TabList and TabPanel components in the component tree.
|
|
17
|
+
*
|
|
18
|
+
* @param props Component props.
|
|
19
|
+
* @return Vue element.
|
|
20
|
+
*/
|
|
21
|
+
declare const TabProvider: import('vue').DefineSetupFnComponent<TabProviderProps, {
|
|
22
|
+
change: (index: number) => boolean;
|
|
23
|
+
}, {}, TabProviderProps & {
|
|
24
|
+
onChange?: ((index: number) => any) | undefined;
|
|
25
|
+
}, import('vue').PublicProps>;
|
|
26
|
+
export default TabProvider;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { TabListLayout } from '../..';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
parameters: {
|
|
5
|
+
controls: {
|
|
6
|
+
sort: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
11
|
+
/** Default tab behavior */
|
|
12
|
+
export declare const Default: {
|
|
13
|
+
render: ({ layout, position }: any) => import("vue/jsx-runtime").JSX.Element;
|
|
14
|
+
argTypes: {
|
|
15
|
+
layout: {
|
|
16
|
+
control: {
|
|
17
|
+
type: "select" | "inline-radio";
|
|
18
|
+
};
|
|
19
|
+
options: TabListLayout[];
|
|
20
|
+
mapping: Record<string, TabListLayout> | undefined;
|
|
21
|
+
};
|
|
22
|
+
position: {
|
|
23
|
+
control: {
|
|
24
|
+
type: "select" | "inline-radio";
|
|
25
|
+
};
|
|
26
|
+
options: ("center" | "right" | "left")[];
|
|
27
|
+
mapping: Record<string, "center" | "right" | "left"> | undefined;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
/** Control active tab externally. */
|
|
32
|
+
export declare const Controlled: {
|
|
33
|
+
render(): () => import("vue/jsx-runtime").JSX.Element;
|
|
34
|
+
parameters: {
|
|
35
|
+
chromatic: {
|
|
36
|
+
disable: boolean;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
tags: string[];
|
|
40
|
+
};
|
|
41
|
+
/** Dynamically generate tabs. */
|
|
42
|
+
export declare const DynamicTabs: {
|
|
43
|
+
render({ tabCount }: any): () => import("vue/jsx-runtime").JSX.Element;
|
|
44
|
+
args: {
|
|
45
|
+
tabCount: number;
|
|
46
|
+
};
|
|
47
|
+
parameters: {
|
|
48
|
+
chromatic: {
|
|
49
|
+
disable: boolean;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
tags: string[];
|
|
53
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as Tab, type TabProps } from './Tab';
|
|
2
|
+
export { default as TabList, type TabListProps, TabListLayout } from './TabList';
|
|
3
|
+
export { default as TabPanel, type TabPanelProps } from './TabPanel';
|
|
4
|
+
export { default as TabProvider, type TabProviderProps } from './TabProvider';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ComputedRef, InjectionKey, Ref } from 'vue';
|
|
2
|
+
import { Action, State, TabState, TabType } from '@lumx/core/js/components/Tabs/state';
|
|
3
|
+
export { type TabType, type State, INIT_STATE, type Action, reducer, type TabState, } from '@lumx/core/js/components/Tabs/state';
|
|
4
|
+
export type TabProviderContextValue = {
|
|
5
|
+
state: Ref<State>;
|
|
6
|
+
dispatch: (action: Action) => void;
|
|
7
|
+
};
|
|
8
|
+
/** Injection key used by TabProvider (provide) and Tab/TabPanel (inject). */
|
|
9
|
+
export declare const TAB_PROVIDER_INJECT_KEY: InjectionKey<TabProviderContextValue>;
|
|
10
|
+
/**
|
|
11
|
+
* Composable equivalent of React's useTabProviderContext.
|
|
12
|
+
* Registers the tab/tabPanel with the provider on mount and unregisters on unmount.
|
|
13
|
+
* Returns a computed ref with the derived tab state, or undefined if no provider is present.
|
|
14
|
+
*/
|
|
15
|
+
export declare const useTabProviderContext: (type: TabType, originalId?: string) => ComputedRef<TabState | undefined>;
|
|
16
|
+
/**
|
|
17
|
+
* Returns the raw tab provider state ref, or undefined if no provider is present.
|
|
18
|
+
*/
|
|
19
|
+
export declare const useTabProviderContextState: () => Ref<State> | undefined;
|
|
@@ -18,6 +18,10 @@ export type TextFieldProps = VueToJSXProps<UIProps, TextFieldPropsToOverride | '
|
|
|
18
18
|
minimumRows?: number;
|
|
19
19
|
/** Additional label props. */
|
|
20
20
|
labelProps?: InputLabelProps;
|
|
21
|
+
/** Ref callback for the native input element. */
|
|
22
|
+
inputRef?: (el: HTMLInputElement | HTMLTextAreaElement | null) => void;
|
|
23
|
+
/** Ref callback for the text field wrapper element. */
|
|
24
|
+
textFieldRef?: (el: HTMLElement | null) => void;
|
|
21
25
|
};
|
|
22
26
|
export declare const emitSchema: {
|
|
23
27
|
change: (value: string, _name?: string, _event?: Event) => boolean;
|
|
@@ -55,6 +59,10 @@ declare const TextField: import('vue').DefineSetupFnComponent<TextFieldProps, {
|
|
|
55
59
|
minimumRows?: number;
|
|
56
60
|
/** Additional label props. */
|
|
57
61
|
labelProps?: InputLabelProps;
|
|
62
|
+
/** Ref callback for the native input element. */
|
|
63
|
+
inputRef?: (el: HTMLInputElement | HTMLTextAreaElement | null) => void;
|
|
64
|
+
/** Ref callback for the text field wrapper element. */
|
|
65
|
+
textFieldRef?: (el: HTMLElement | null) => void;
|
|
58
66
|
} & {
|
|
59
67
|
onBlur?: ((_event?: FocusEvent | undefined) => any) | undefined;
|
|
60
68
|
onChange?: ((value: string, _name?: string | undefined, _event?: Event | undefined) => any) | undefined;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export interface UseRovingTabIndexContainerOptions {
|
|
3
|
+
/** Ref to the container element holding the focusable items. */
|
|
4
|
+
containerRef: Ref<HTMLElement | null | undefined>;
|
|
5
|
+
/** CSS selector to identify focusable items within the container. */
|
|
6
|
+
itemSelector: string;
|
|
7
|
+
/** Callback invoked when an item receives focus via keyboard navigation. */
|
|
8
|
+
onItemFocused?: (item: HTMLElement) => void;
|
|
9
|
+
/**
|
|
10
|
+
* Primary navigation axis — determines which arrow keys navigate.
|
|
11
|
+
* Default: 'horizontal' (ArrowLeft/ArrowRight).
|
|
12
|
+
*/
|
|
13
|
+
direction?: 'horizontal' | 'vertical';
|
|
14
|
+
/**
|
|
15
|
+
* CSS selector matching disabled items within the container.
|
|
16
|
+
* Disabled items are skipped during keyboard navigation.
|
|
17
|
+
*/
|
|
18
|
+
itemDisabledSelector?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Vue composable equivalent of React's useRovingTabIndexContainer.
|
|
22
|
+
* Sets up roving tab index keyboard navigation on a container element.
|
|
23
|
+
* Automatically tears down when the container is removed or the composable is unmounted.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useRovingTabIndexContainer({ containerRef, itemSelector, onItemFocused, direction, itemDisabledSelector, }: UseRovingTabIndexContainerOptions): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { WatchOptions, WatchSource } from 'vue';
|
|
2
|
+
type Cleanup = void | (() => void);
|
|
3
|
+
type MapSources<T> = {
|
|
4
|
+
[K in keyof T]: T[K] extends WatchSource<infer V> ? V : never;
|
|
5
|
+
};
|
|
6
|
+
type MultiWatchSources = (WatchSource<unknown> | object)[];
|
|
7
|
+
/**
|
|
8
|
+
* Watch a reactive source and run an effect that can return a cleanup function.
|
|
9
|
+
* On each re-run the previous cleanup is called automatically.
|
|
10
|
+
* Stops and cleans up on unmount.
|
|
11
|
+
*
|
|
12
|
+
* @param source One or more reactive sources to watch.
|
|
13
|
+
* @param effect Effect callback receiving the new (and old) value; may return a cleanup function.
|
|
14
|
+
* @param options Watch options (defaults to `{ immediate: true }`).
|
|
15
|
+
* @returns A stop function that also runs the latest cleanup.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useWatchDisposable<T extends MultiWatchSources>(source: [...T], effect: (value: MapSources<T>, oldValue: MapSources<T> | undefined) => Cleanup, options?: WatchOptions): () => void;
|
|
18
|
+
export declare function useWatchDisposable<T>(source: WatchSource<T>, effect: (value: T, oldValue: T | undefined) => Cleanup, options?: WatchOptions): () => void;
|
|
19
|
+
export {};
|
package/index.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
export * from '@lumx/core/js/constants';
|
|
2
2
|
export * from '@lumx/core/js/types';
|
|
3
3
|
export * from './components/avatar';
|
|
4
|
+
export * from './components/combobox';
|
|
4
5
|
export * from './components/badge';
|
|
5
6
|
export * from './components/button';
|
|
6
7
|
export * from './components/checkbox';
|
|
7
8
|
export * from './components/chip';
|
|
8
9
|
export * from './components/divider';
|
|
9
10
|
export * from './components/drag-handle';
|
|
11
|
+
export * from './components/expansion-panel';
|
|
10
12
|
export * from './components/flag';
|
|
11
13
|
export * from './components/flex-box';
|
|
12
14
|
export * from './components/grid-column';
|
|
@@ -17,6 +19,7 @@ export * from './components/input-label';
|
|
|
17
19
|
export * from './components/link';
|
|
18
20
|
export * from './components/list';
|
|
19
21
|
export * from './components/message';
|
|
22
|
+
export * from './components/mosaic';
|
|
20
23
|
export * from './components/popover';
|
|
21
24
|
export * from './components/popover-dialog';
|
|
22
25
|
export * from './components/progress';
|
|
@@ -28,6 +31,7 @@ export * from './components/uploader';
|
|
|
28
31
|
export * from './components/generic-block';
|
|
29
32
|
export * from './components/inline-list';
|
|
30
33
|
export * from './components/table';
|
|
34
|
+
export * from './components/tabs';
|
|
31
35
|
export * from './components/text';
|
|
32
36
|
export * from './components/thumbnail';
|
|
33
37
|
export * from './components/toolbar';
|