@lumx/vue 4.10.0-next.2 → 4.11.0-alpha.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/_internal/{BqMObS2T.js → C6sf-SYQ.js} +31 -27
- package/_internal/C6sf-SYQ.js.map +1 -0
- package/components/chip/SelectionChipGroup.d.ts +30 -0
- package/components/chip/SelectionChipGroup.stories.d.ts +66 -0
- package/components/chip/Stories/CustomRender.vue.d.ts +2 -0
- package/components/chip/Stories/InTextField.vue.d.ts +2 -0
- package/components/chip/index.d.ts +1 -0
- package/components/combobox/Combobox.test.stories.d.ts +22 -0
- package/components/combobox/ComboboxInput.d.ts +30 -6
- package/components/combobox/index.d.ts +2 -1
- package/components/dialog/Dialog.d.ts +66 -0
- package/components/dialog/Dialog.stories.d.ts +106 -0
- package/components/dialog/index.d.ts +2 -0
- package/components/expansion-panel/ExpansionPanel.d.ts +1 -1
- package/components/flex-box/FlexBox.d.ts +0 -12
- package/composables/useAttrFallback.d.ts +28 -0
- package/composables/useClassName.d.ts +15 -0
- package/composables/useDisableBodyScroll.d.ts +8 -0
- package/composables/useRovingTabIndexContainer.d.ts +8 -1
- package/composables/useTransitionVisibility.d.ts +11 -0
- package/index.d.ts +1 -0
- package/index.js +4842 -4352
- package/index.js.map +1 -1
- package/package.json +4 -4
- package/utils/InfiniteScroll/InfiniteScroll.d.ts +7 -0
- package/utils/InfiniteScroll/InfiniteScroll.test.stories.d.ts +39 -0
- package/utils/InfiniteScroll/index.d.ts +1 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.js +55 -18
- package/utils/index.js.map +1 -1
- package/utils/isComponentType.d.ts +6 -0
- package/_internal/BqMObS2T.js.map +0 -1
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { inject as d, computed as p, unref as y, defineComponent as i, provide as
|
|
1
|
+
import { inject as d, computed as p, unref as y, defineComponent as i, provide as s, ref as P, watch as b, onBeforeUnmount as v, createVNode as C, Teleport as R, isVNode as x, onMounted as L } from "vue";
|
|
2
2
|
import { Theme as T } from "@lumx/core/js/constants";
|
|
3
|
-
function
|
|
3
|
+
function O(e = { defaultTheme: T.light }) {
|
|
4
4
|
const { defaultTheme: n } = e, o = d("theme", void 0);
|
|
5
5
|
return p(() => y(o) || n);
|
|
6
6
|
}
|
|
7
|
-
const
|
|
8
|
-
(
|
|
7
|
+
const S = () => (...e) => e.reduce(
|
|
8
|
+
(n, o) => (n[o] = { required: !1 }, n),
|
|
9
|
+
{}
|
|
10
|
+
), g = i(
|
|
11
|
+
(e, { slots: n }) => (s(
|
|
9
12
|
"theme",
|
|
10
13
|
p(() => e.value)
|
|
11
14
|
), () => n.default?.()),
|
|
@@ -17,7 +20,7 @@ const g = i(
|
|
|
17
20
|
container: "body"
|
|
18
21
|
}), N = /* @__PURE__ */ i((e, {
|
|
19
22
|
slots: n
|
|
20
|
-
}) => (
|
|
23
|
+
}) => (s(h, e.value), () => n.default?.()), {
|
|
21
24
|
name: "LumxPortalProvider",
|
|
22
25
|
props: {
|
|
23
26
|
value: {
|
|
@@ -29,13 +32,13 @@ const g = i(
|
|
|
29
32
|
function w(e) {
|
|
30
33
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !x(e);
|
|
31
34
|
}
|
|
32
|
-
const
|
|
35
|
+
const Y = /* @__PURE__ */ i((e, {
|
|
33
36
|
slots: n
|
|
34
37
|
}) => {
|
|
35
|
-
const o = d(h, A), t = P(null),
|
|
38
|
+
const o = d(h, A), t = P(null), u = () => {
|
|
36
39
|
e.enabled ? t.value = o() : t.value = null;
|
|
37
40
|
};
|
|
38
|
-
return
|
|
41
|
+
return u(), b(() => e.enabled, u), v(() => {
|
|
39
42
|
t.value?.teardown?.();
|
|
40
43
|
}), () => {
|
|
41
44
|
const a = n.default?.(), r = t.value?.container;
|
|
@@ -53,41 +56,41 @@ const O = /* @__PURE__ */ i((e, {
|
|
|
53
56
|
default: !0
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
|
-
}),
|
|
59
|
+
}), f = ["mousedown", "touchstart"];
|
|
57
60
|
function E(e, n) {
|
|
58
61
|
return !n.some((o) => o instanceof Node && e.some((t) => o.contains(t)));
|
|
59
62
|
}
|
|
60
|
-
function
|
|
63
|
+
function k(e, n) {
|
|
61
64
|
if (!n)
|
|
62
65
|
return;
|
|
63
66
|
const o = (t) => {
|
|
64
|
-
const
|
|
65
|
-
E(
|
|
67
|
+
const u = [t.composedPath?.()[0], t.target].filter((r) => r instanceof Node), a = e();
|
|
68
|
+
E(u, a) && n(t);
|
|
66
69
|
};
|
|
67
|
-
return
|
|
68
|
-
|
|
70
|
+
return f.forEach((t) => document.addEventListener(t, o)), () => {
|
|
71
|
+
f.forEach((t) => document.removeEventListener(t, o));
|
|
69
72
|
};
|
|
70
73
|
}
|
|
71
|
-
const m = /* @__PURE__ */ Symbol("LumxClickAway"),
|
|
74
|
+
const m = /* @__PURE__ */ Symbol("LumxClickAway"), I = /* @__PURE__ */ i((e, {
|
|
72
75
|
slots: n
|
|
73
76
|
}) => {
|
|
74
|
-
const o = d(m, null), t = [],
|
|
77
|
+
const o = d(m, null), t = [], u = {
|
|
75
78
|
childrenRefs: t,
|
|
76
79
|
addRefs(...r) {
|
|
77
80
|
for (const l of r) {
|
|
78
|
-
const
|
|
79
|
-
|
|
81
|
+
const c = l.value;
|
|
82
|
+
c && t.push(c);
|
|
80
83
|
}
|
|
81
84
|
o && (o.addRefs(...r), e.parentRef && o.addRefs(e.parentRef));
|
|
82
85
|
}
|
|
83
86
|
};
|
|
84
|
-
|
|
87
|
+
s(m, u);
|
|
85
88
|
let a;
|
|
86
89
|
return L(() => {
|
|
87
90
|
const r = e.childrenRefs.value;
|
|
88
|
-
r &&
|
|
89
|
-
const
|
|
90
|
-
typeof
|
|
91
|
+
r && u.addRefs(...r), a = k(() => t, (l) => {
|
|
92
|
+
const c = e.callback;
|
|
93
|
+
typeof c == "function" && c(l);
|
|
91
94
|
});
|
|
92
95
|
}), v(() => {
|
|
93
96
|
a?.();
|
|
@@ -110,11 +113,12 @@ const m = /* @__PURE__ */ Symbol("LumxClickAway"), Y = /* @__PURE__ */ i((e, {
|
|
|
110
113
|
}
|
|
111
114
|
});
|
|
112
115
|
export {
|
|
113
|
-
|
|
114
|
-
|
|
116
|
+
I as C,
|
|
117
|
+
Y as P,
|
|
115
118
|
g as T,
|
|
116
119
|
N as a,
|
|
117
|
-
|
|
118
|
-
|
|
120
|
+
S as k,
|
|
121
|
+
k as s,
|
|
122
|
+
O as u
|
|
119
123
|
};
|
|
120
|
-
//# sourceMappingURL=
|
|
124
|
+
//# sourceMappingURL=C6sf-SYQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"C6sf-SYQ.js","sources":["../../src/utils/theme/useTheme.ts","../../src/utils/VueToJSX.ts","../../src/utils/theme/ThemeProvider.ts","../../src/utils/Portal/PortalProvider.tsx","../../src/utils/Portal/Portal.tsx","../../../lumx-core/src/js/utils/ClickAway/index.ts","../../src/utils/ClickAway/ClickAwayProvider.tsx"],"sourcesContent":["import { type ComputedRef, type Ref, computed, inject, unref } from 'vue';\n\nimport { Theme } from '@lumx/core/js/constants';\n\nexport interface UseTheme {\n defaultTheme?: Theme;\n}\n/**\n * Retrieves the globally applied theme.\n * @returns computed theme value (auto-updates when the provided theme changes)\n */\nexport function useTheme(options: UseTheme = { defaultTheme: Theme.light }): ComputedRef<Theme | undefined> {\n const { defaultTheme } = options;\n const injected = inject<Theme | Ref<Theme | undefined> | undefined>('theme', undefined);\n return computed(() => unref(injected) || defaultTheme);\n}\n","import { PropsToOverride } from '@lumx/core/js/types';\n/**\n * Props interface for components wrapped with VueToJSX.\n * It omits JSX-specific props like `children` and `className` and adds Vue's `class`.\n *\n * @template Props - The base props type\n * @template OmitProps - Additional props to omit beyond the defaults (children, className, ref)\n */\nexport type VueToJSXProps<Props, OmitProps extends keyof Props = never> = Omit<\n Props,\n PropsToOverride | 'children' | 'className' | OmitProps\n> & {\n /** Class name forwarded to the root element of the component. */\n class?: string;\n};\n\n/**\n * Hyphenated aria-* prop keys that must NOT be declared as Vue component props.\n * When declared, Vue normalizes them to camelCase (e.g. aria-haspopup → ariaHaspopup),\n * which breaks hyphenated key destructuring in core component templates.\n * By excluding them from props, they flow through `attrs` with their original hyphenated keys.\n */\nexport type HyphenatedAriaProps = 'aria-expanded' | 'aria-haspopup' | 'aria-label' | 'aria-pressed';\n\nexport const keysOf = <T>() => {\n return <K extends readonly (keyof T)[]>(\n ...keys: [keyof T] extends [K[number]]\n ? K\n : [Error: '❌ Missing keys in your list:', Exclude<keyof T, K[number]>]\n ) => {\n // Return an object with all props marked as optional (not required)\n // This ensures Vue's type system correctly infers props as optional\n return keys.reduce(\n (acc, key) => {\n acc[key as K[number]] = { required: false };\n return acc;\n },\n {} as Record<K[number], { required: false }>,\n );\n };\n};\n","import { computed, defineComponent, provide, type PropType } from 'vue';\nimport type { Theme } from '@lumx/core/js/constants';\n\n/**\n * ThemeProvider for Vue: wraps children with `provide('theme', value)` for theme isolation.\n * Vue's `provide()` requires a component boundary, so this is a component.\n */\nexport const ThemeProvider = defineComponent(\n (props: { value: Theme | undefined }, { slots }) => {\n provide(\n 'theme',\n computed(() => props.value),\n );\n return () => slots.default?.();\n },\n {\n name: 'LumxThemeProvider',\n props: { value: { type: String as PropType<Theme | undefined>, default: undefined } },\n },\n);\n","import { defineComponent, provide, type PropType, type InjectionKey } from 'vue';\n\nexport type { PortalInit, PortalProviderProps } from '@lumx/core/js/utils/Portal';\nimport type { PortalInit, PortalProviderProps } from '@lumx/core/js/utils/Portal';\n\nexport const PORTAL_KEY: InjectionKey<PortalInit> = Symbol('LumxPortal');\n\nexport const defaultPortalInit: PortalInit = () => ({ container: 'body' });\n\n/**\n * Customize where <Portal> wrapped elements render (tooltip, popover, dialog, etc.)\n */\nexport const PortalProvider = defineComponent(\n (props: PortalProviderProps, { slots }) => {\n provide(PORTAL_KEY, props.value);\n return () => slots.default?.();\n },\n {\n name: 'LumxPortalProvider',\n props: {\n value: {\n type: Function as PropType<PortalInit>,\n required: true,\n },\n },\n },\n);\n","import { defineComponent, inject, onBeforeUnmount, Teleport, ref, watch } from 'vue';\nimport { PORTAL_KEY, defaultPortalInit } from './PortalProvider';\n\nexport type { PortalProps } from '@lumx/core/js/utils/Portal';\nimport type { PortalProps } from '@lumx/core/js/utils/Portal';\n\n/**\n * Render children in a portal outside the current DOM position\n * (defaults to `document.body` but can be customized with the PortalProvider)\n */\nexport const Portal = defineComponent(\n (props: PortalProps, { slots }) => {\n const portalInit = inject(PORTAL_KEY, defaultPortalInit);\n const context = ref<ReturnType<typeof portalInit> | null>(null);\n\n // Initialize portal context when enabled\n const initializePortal = () => {\n if (props.enabled) {\n context.value = portalInit();\n } else {\n context.value = null;\n }\n };\n\n // Initialize on mount and when enabled changes\n initializePortal();\n watch(() => props.enabled, initializePortal);\n\n // Register teardown on unmount\n onBeforeUnmount(() => {\n context.value?.teardown?.();\n });\n\n return () => {\n const content = slots.default?.();\n const container = context.value?.container;\n\n // If disabled or no container, render inline\n if (!props.enabled || !container) {\n return content;\n }\n\n // Render in portal using Teleport\n return <Teleport to={container}>{content}</Teleport>;\n };\n },\n {\n name: 'LumxPortal',\n props: {\n enabled: {\n type: Boolean,\n default: true,\n },\n },\n },\n);\n","/**\n * Shared types and logic for ClickAway detection.\n *\n * ClickAway detects clicks outside a set of elements and triggers a callback.\n * The core logic (event listening + target checking) is framework-agnostic.\n * Framework-specific wrappers (React hook, Vue composable) and context providers\n * (React context, Vue provide/inject) are implemented in each framework package.\n */\n\nimport type { Falsy } from '@lumx/core/js/types';\n\n/** Event types that trigger click away detection. */\nexport const CLICK_AWAY_EVENT_TYPES = ['mousedown', 'touchstart'] as const;\n\n/** Callback triggered when a click away is detected. */\nexport type ClickAwayCallback = EventListener | Falsy;\n\n/**\n * Check if the click event targets are outside all the given elements.\n *\n * @param targets - The event target elements (from `event.target` and `event.composedPath()`).\n * @param elements - The elements considered \"inside\" the click away context.\n * @returns `true` if the click is outside all elements (i.e. a click away).\n */\nexport function isClickAway(targets: HTMLElement[], elements: HTMLElement[]): boolean {\n return !elements.some((element) => element instanceof Node && targets.some((target) => element.contains(target)));\n}\n\n/**\n * Imperative setup for click away detection.\n * Adds mousedown/touchstart listeners on `document` and calls the callback when a click\n * occurs outside the elements returned by `getElements`.\n *\n * Note: when `getElements` returns an empty array, any click is considered a click away.\n * Callers should guard against calling `setupClickAway` when no refs are registered.\n *\n * @param getElements - Getter returning the current list of elements considered \"inside\".\n * @param callback - Callback to invoke on click away.\n * @returns A teardown function that removes the event listeners.\n */\nexport function setupClickAway(\n getElements: () => HTMLElement[],\n callback: ClickAwayCallback,\n): (() => void) | undefined {\n if (!callback) {\n return undefined;\n }\n\n const listener: EventListener = (evt) => {\n const targets = [evt.composedPath?.()[0], evt.target].filter((t): t is HTMLElement => t instanceof Node);\n const elements = getElements();\n if (isClickAway(targets, elements)) {\n callback(evt);\n }\n };\n\n CLICK_AWAY_EVENT_TYPES.forEach((evtType) => document.addEventListener(evtType, listener));\n return () => {\n CLICK_AWAY_EVENT_TYPES.forEach((evtType) => document.removeEventListener(evtType, listener));\n };\n}\n","import {\n defineComponent,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n type InjectionKey,\n type PropType,\n type Ref,\n} from 'vue';\nimport { setupClickAway, type ClickAwayCallback } from '@lumx/core/js/utils/ClickAway';\n\ninterface ContextValue {\n childrenRefs: HTMLElement[];\n addRefs(...newChildrenRefs: Array<Ref<HTMLElement | undefined>>): void;\n}\n\nexport const CLICK_AWAY_KEY: InjectionKey<ContextValue> = Symbol('LumxClickAway');\n\n/**\n * Component combining click away detection with Vue's provide/inject to hook into the component tree\n * and take into account both the DOM tree and the component tree to detect click away.\n */\nexport const ClickAwayProvider = defineComponent(\n (\n props: {\n callback: ClickAwayCallback;\n childrenRefs: Ref<Array<Ref<HTMLElement | undefined>>>;\n parentRef?: Ref<HTMLElement | undefined>;\n },\n { slots },\n ) => {\n const parentContext = inject(CLICK_AWAY_KEY, null);\n\n const contextChildrenRefs: HTMLElement[] = [];\n\n const currentContext: ContextValue = {\n childrenRefs: contextChildrenRefs,\n addRefs(...newChildrenRefs) {\n for (const newRef of newChildrenRefs) {\n const el = newRef.value;\n if (el) {\n contextChildrenRefs.push(el);\n }\n }\n if (parentContext) {\n parentContext.addRefs(...newChildrenRefs);\n if (props.parentRef) {\n parentContext.addRefs(props.parentRef);\n }\n }\n },\n };\n\n provide(CLICK_AWAY_KEY, currentContext);\n\n let teardown: (() => void) | undefined;\n\n onMounted(() => {\n const refs = props.childrenRefs.value;\n if (refs) {\n currentContext.addRefs(...refs);\n }\n\n // Setup click away using a closure that always reads the latest callback prop.\n // This handles transitions like closeMode=\"hide\" where the callback changes\n // between open (handleClose) and closed (undefined) without re-creating the listener.\n teardown = setupClickAway(\n () => contextChildrenRefs,\n (event) => {\n const cb = props.callback;\n if (typeof cb === 'function') cb(event);\n },\n );\n });\n\n onBeforeUnmount(() => {\n teardown?.();\n });\n\n return () => slots.default?.();\n },\n {\n name: 'LumxClickAwayProvider',\n props: {\n callback: {\n type: [Function, Boolean, undefined] as PropType<ClickAwayCallback>,\n default: undefined,\n },\n childrenRefs: {\n type: Object as PropType<Ref<Array<Ref<HTMLElement | undefined>>>>,\n required: true,\n },\n parentRef: {\n type: Object as PropType<Ref<HTMLElement | undefined>>,\n default: undefined,\n },\n },\n },\n);\n"],"names":["useTheme","options","Theme","defaultTheme","injected","inject","computed","unref","keysOf","keys","acc","key","ThemeProvider","defineComponent","props","slots","provide","PORTAL_KEY","Symbol","defaultPortalInit","container","PortalProvider","value","default","name","type","Function","required","_isSlot","s","Object","prototype","toString","call","_isVNode","Portal","portalInit","context","ref","initializePortal","enabled","watch","onBeforeUnmount","teardown","content","_createVNode","Teleport","Boolean","CLICK_AWAY_EVENT_TYPES","isClickAway","targets","elements","element","target","setupClickAway","getElements","callback","listener","evt","t","evtType","CLICK_AWAY_KEY","ClickAwayProvider","parentContext","contextChildrenRefs","currentContext","childrenRefs","addRefs","newChildrenRefs","newRef","el","push","parentRef","onMounted","refs","event","cb","undefined"],"mappings":"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"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SelectionChipGroupProps as UIProps } from '@lumx/core/js/components/Chip/SelectionChipGroup';
|
|
2
|
+
import { VueToJSXProps } from '../../utils/VueToJSX';
|
|
3
|
+
/**
|
|
4
|
+
* Props omit 'ref' (handled internally).
|
|
5
|
+
* inputRef is added here for Vue (ref to an associated input element for backspace focus handling).
|
|
6
|
+
*/
|
|
7
|
+
export type SelectionChipGroupProps = VueToJSXProps<UIProps<any>> & {
|
|
8
|
+
/** Ref to the associated input element (for focus restoration on backspace) */
|
|
9
|
+
inputRef?: HTMLInputElement | null;
|
|
10
|
+
};
|
|
11
|
+
export declare const emitSchema: {
|
|
12
|
+
change: (_newValue?: any[]) => boolean;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* SelectionChipGroup component.
|
|
16
|
+
*
|
|
17
|
+
* @param props Component props.
|
|
18
|
+
* @return Vue element.
|
|
19
|
+
*/
|
|
20
|
+
declare const SelectionChipGroup: import('vue').DefineSetupFnComponent<SelectionChipGroupProps, {
|
|
21
|
+
change: (_newValue?: any[]) => boolean;
|
|
22
|
+
}, {}, Omit<UIProps<any>, "className" | import('@lumx/core/js/types').PropsToOverride | "children"> & {
|
|
23
|
+
class?: string;
|
|
24
|
+
} & {
|
|
25
|
+
/** Ref to the associated input element (for focus restoration on backspace) */
|
|
26
|
+
inputRef?: HTMLInputElement | null;
|
|
27
|
+
} & {
|
|
28
|
+
onChange?: ((_newValue?: any[] | undefined) => any) | undefined;
|
|
29
|
+
}, import('vue').PublicProps>;
|
|
30
|
+
export default SelectionChipGroup;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
component: any;
|
|
3
|
+
args: {
|
|
4
|
+
value: {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
}[];
|
|
8
|
+
getOptionId: string;
|
|
9
|
+
getOptionName: string;
|
|
10
|
+
label: string;
|
|
11
|
+
chipRemoveLabel: string;
|
|
12
|
+
};
|
|
13
|
+
decorators: ((story: any, context: any) => any)[];
|
|
14
|
+
title: string;
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
17
|
+
export declare const Default: {};
|
|
18
|
+
export declare const Disabled: {
|
|
19
|
+
args: {
|
|
20
|
+
isDisabled: boolean;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export declare const IndividuallyDisabled: {
|
|
24
|
+
args: {
|
|
25
|
+
getChipProps: (option: {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
}) => {
|
|
29
|
+
isDisabled: boolean;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export declare const Empty: {
|
|
34
|
+
args: {
|
|
35
|
+
value: never[];
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export declare const ConstrainedSpace: {
|
|
39
|
+
decorators: ((story: any, context: any) => any)[];
|
|
40
|
+
args: {
|
|
41
|
+
value: ({
|
|
42
|
+
id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
} | {
|
|
45
|
+
name: string;
|
|
46
|
+
})[];
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
/** Selection chip group with custom chip render */
|
|
50
|
+
export declare const CustomRender: {
|
|
51
|
+
render: () => {
|
|
52
|
+
components: {
|
|
53
|
+
StoryCustomRender: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
54
|
+
};
|
|
55
|
+
template: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
/** Selection chip group inside a TextField chips slot with inputRef for keyboard navigation */
|
|
59
|
+
export declare const InTextField: {
|
|
60
|
+
render: () => {
|
|
61
|
+
components: {
|
|
62
|
+
StoryInTextField: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
63
|
+
};
|
|
64
|
+
template: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -9,6 +9,28 @@ declare const _default: {
|
|
|
9
9
|
title: string;
|
|
10
10
|
};
|
|
11
11
|
export default _default;
|
|
12
|
+
export declare const AutoFilterOptions: {
|
|
13
|
+
play: ({ canvasElement }: any) => Promise<void>;
|
|
14
|
+
args: {
|
|
15
|
+
value: string;
|
|
16
|
+
};
|
|
17
|
+
decorators: ((story: any, context: any) => any)[];
|
|
18
|
+
render: ({ value, onChange, onSelect, }: {
|
|
19
|
+
value: string;
|
|
20
|
+
onChange: (v: string) => void;
|
|
21
|
+
onSelect?: (option: {
|
|
22
|
+
value: string;
|
|
23
|
+
}) => void;
|
|
24
|
+
}) => import("vue/jsx-runtime").JSX.Element;
|
|
25
|
+
};
|
|
26
|
+
export declare const FilterOffOpenOnFocus: {
|
|
27
|
+
play: ({ canvasElement }: any) => Promise<void>;
|
|
28
|
+
args: {
|
|
29
|
+
value: string;
|
|
30
|
+
};
|
|
31
|
+
decorators: ((story: any, context: any) => any)[];
|
|
32
|
+
render: ({ value, onChange, onSelect }: any) => import("vue/jsx-runtime").JSX.Element;
|
|
33
|
+
};
|
|
12
34
|
export declare const SelectOptionUpdatesInput: {
|
|
13
35
|
play: ({ canvasElement }: any) => Promise<void>;
|
|
14
36
|
args: {
|
|
@@ -18,10 +18,22 @@ export type ComboboxInputProps = VueToJSXProps<TextFieldProps, 'inputRef' | 'tex
|
|
|
18
18
|
value: string;
|
|
19
19
|
}) => void;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* Controls how the combobox filters options as the user types.
|
|
22
|
+
*
|
|
23
|
+
* - `'auto'` (default) — Options are automatically filtered client-side.
|
|
24
|
+
* - `'manual'` — Filtering is the consumer's responsibility.
|
|
25
|
+
* - `'off'` — Like `'manual'`, but the input is rendered as `readOnly`
|
|
26
|
+
* and `openOnFocus` defaults to `true`.
|
|
23
27
|
*/
|
|
24
|
-
|
|
28
|
+
filter?: 'auto' | 'manual' | 'off';
|
|
29
|
+
/**
|
|
30
|
+
* When true, the combobox opens automatically when the input receives focus.
|
|
31
|
+
* When false (default, unless `filter` is `'off'`), the combobox only opens
|
|
32
|
+
* on click, typing, or keyboard navigation.
|
|
33
|
+
*
|
|
34
|
+
* @default false (true when filter is 'off')
|
|
35
|
+
*/
|
|
36
|
+
openOnFocus?: boolean;
|
|
25
37
|
};
|
|
26
38
|
/**
|
|
27
39
|
* Combobox.Input component - wraps TextField with combobox ARIA attributes.
|
|
@@ -51,10 +63,22 @@ declare const ComboboxInput: import('vue').DefineSetupFnComponent<ComboboxInputP
|
|
|
51
63
|
value: string;
|
|
52
64
|
}) => void;
|
|
53
65
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
66
|
+
* Controls how the combobox filters options as the user types.
|
|
67
|
+
*
|
|
68
|
+
* - `'auto'` (default) — Options are automatically filtered client-side.
|
|
69
|
+
* - `'manual'` — Filtering is the consumer's responsibility.
|
|
70
|
+
* - `'off'` — Like `'manual'`, but the input is rendered as `readOnly`
|
|
71
|
+
* and `openOnFocus` defaults to `true`.
|
|
72
|
+
*/
|
|
73
|
+
filter?: "auto" | "manual" | "off";
|
|
74
|
+
/**
|
|
75
|
+
* When true, the combobox opens automatically when the input receives focus.
|
|
76
|
+
* When false (default, unless `filter` is `'off'`), the combobox only opens
|
|
77
|
+
* on click, typing, or keyboard navigation.
|
|
78
|
+
*
|
|
79
|
+
* @default false (true when filter is 'off')
|
|
56
80
|
*/
|
|
57
|
-
|
|
81
|
+
openOnFocus?: boolean;
|
|
58
82
|
} & {
|
|
59
83
|
onSelect?: ((option: {
|
|
60
84
|
value: string;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { BaseDialogProps, DialogSizes } from '@lumx/core/js/components/Dialog';
|
|
3
|
+
import { GenericProps, HasCloseMode } from '@lumx/core/js/types';
|
|
4
|
+
export type DialogProps = Pick<BaseDialogProps, 'forceFooterDivider' | 'forceHeaderDivider' | 'isLoading'> & HasCloseMode & {
|
|
5
|
+
/** Additional class name. */
|
|
6
|
+
class?: string;
|
|
7
|
+
/** Whether the dialog is open. */
|
|
8
|
+
isOpen?: boolean;
|
|
9
|
+
/** Size variant. */
|
|
10
|
+
size?: DialogSizes;
|
|
11
|
+
/** Z-axis position. */
|
|
12
|
+
zIndex?: number;
|
|
13
|
+
/** Additional props for the dialog container element. */
|
|
14
|
+
dialogProps?: GenericProps;
|
|
15
|
+
/** Reference to the parent element that triggered modal opening (gets focus back on close). */
|
|
16
|
+
parentElement?: HTMLElement;
|
|
17
|
+
/** Element that should receive focus when the dialog opens. By default the first focusable child. */
|
|
18
|
+
focusElement?: HTMLElement;
|
|
19
|
+
/** Reference to the dialog content element. */
|
|
20
|
+
contentRef?: Ref<HTMLDivElement>;
|
|
21
|
+
/** Whether to keep the dialog open on clickaway or escape press. */
|
|
22
|
+
preventAutoClose?: boolean;
|
|
23
|
+
/** Whether to keep the dialog open on escape press. */
|
|
24
|
+
preventCloseOnEscape?: boolean;
|
|
25
|
+
/** Whether to keep the dialog open on clickaway. */
|
|
26
|
+
preventCloseOnClick?: boolean;
|
|
27
|
+
/** Whether to disable body scroll when the dialog is open. */
|
|
28
|
+
disableBodyScroll?: boolean;
|
|
29
|
+
};
|
|
30
|
+
export declare const emitSchema: {
|
|
31
|
+
close: () => boolean;
|
|
32
|
+
visibilityChange: (isVisible: boolean) => boolean;
|
|
33
|
+
};
|
|
34
|
+
declare const Dialog: import('vue').DefineSetupFnComponent<DialogProps, {
|
|
35
|
+
close: () => boolean;
|
|
36
|
+
visibilityChange: (isVisible: boolean) => boolean;
|
|
37
|
+
}, {}, Pick<BaseDialogProps, "isLoading" | "forceFooterDivider" | "forceHeaderDivider"> & HasCloseMode & {
|
|
38
|
+
/** Additional class name. */
|
|
39
|
+
class?: string;
|
|
40
|
+
/** Whether the dialog is open. */
|
|
41
|
+
isOpen?: boolean;
|
|
42
|
+
/** Size variant. */
|
|
43
|
+
size?: DialogSizes;
|
|
44
|
+
/** Z-axis position. */
|
|
45
|
+
zIndex?: number;
|
|
46
|
+
/** Additional props for the dialog container element. */
|
|
47
|
+
dialogProps?: GenericProps;
|
|
48
|
+
/** Reference to the parent element that triggered modal opening (gets focus back on close). */
|
|
49
|
+
parentElement?: HTMLElement;
|
|
50
|
+
/** Element that should receive focus when the dialog opens. By default the first focusable child. */
|
|
51
|
+
focusElement?: HTMLElement;
|
|
52
|
+
/** Reference to the dialog content element. */
|
|
53
|
+
contentRef?: Ref<HTMLDivElement>;
|
|
54
|
+
/** Whether to keep the dialog open on clickaway or escape press. */
|
|
55
|
+
preventAutoClose?: boolean;
|
|
56
|
+
/** Whether to keep the dialog open on escape press. */
|
|
57
|
+
preventCloseOnEscape?: boolean;
|
|
58
|
+
/** Whether to keep the dialog open on clickaway. */
|
|
59
|
+
preventCloseOnClick?: boolean;
|
|
60
|
+
/** Whether to disable body scroll when the dialog is open. */
|
|
61
|
+
disableBodyScroll?: boolean;
|
|
62
|
+
} & {
|
|
63
|
+
onClose?: (() => any) | undefined;
|
|
64
|
+
onVisibilityChange?: ((isVisible: boolean) => any) | undefined;
|
|
65
|
+
}, import('vue').PublicProps>;
|
|
66
|
+
export default Dialog;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
component: any;
|
|
3
|
+
render: any;
|
|
4
|
+
parameters: {
|
|
5
|
+
chromatic: {
|
|
6
|
+
pauseAnimationAtEnd: boolean;
|
|
7
|
+
delay: number;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
decorators: ((story: any, context: any) => any)[];
|
|
11
|
+
args: Partial<import('@lumx/core/js/components/Dialog').DialogProps>;
|
|
12
|
+
argTypes: {
|
|
13
|
+
size: {
|
|
14
|
+
control: {
|
|
15
|
+
type: "select" | "inline-radio";
|
|
16
|
+
};
|
|
17
|
+
options: ("big" | "tiny" | "regular" | "huge")[];
|
|
18
|
+
mapping: Record<string, "big" | "tiny" | "regular" | "huge"> | undefined;
|
|
19
|
+
};
|
|
20
|
+
onVisibilityChange: {
|
|
21
|
+
action: boolean;
|
|
22
|
+
};
|
|
23
|
+
children: {
|
|
24
|
+
control: boolean;
|
|
25
|
+
};
|
|
26
|
+
closeMode: {
|
|
27
|
+
control: {
|
|
28
|
+
type: "inline-radio";
|
|
29
|
+
};
|
|
30
|
+
options: string[];
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
title: string;
|
|
34
|
+
};
|
|
35
|
+
export default _default;
|
|
36
|
+
export declare const Default: {
|
|
37
|
+
args: {
|
|
38
|
+
children: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export declare const Loading: {
|
|
42
|
+
args: {
|
|
43
|
+
isLoading: boolean;
|
|
44
|
+
children: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export declare const WithHeaderFooter: {
|
|
48
|
+
args: {
|
|
49
|
+
header: string;
|
|
50
|
+
footer: string;
|
|
51
|
+
children: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export declare const ForceDivider: {
|
|
55
|
+
args: {
|
|
56
|
+
forceFooterDivider: boolean;
|
|
57
|
+
forceHeaderDivider: boolean;
|
|
58
|
+
header: string;
|
|
59
|
+
footer: string;
|
|
60
|
+
children: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export declare const LongContent: {
|
|
64
|
+
args: {
|
|
65
|
+
children: string;
|
|
66
|
+
header: string;
|
|
67
|
+
footer: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export declare const PreventAutoClose: {
|
|
71
|
+
args: {
|
|
72
|
+
preventAutoClose: boolean;
|
|
73
|
+
children: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
export declare const PreventCloseOnEscape: {
|
|
77
|
+
args: {
|
|
78
|
+
preventCloseOnEscape: boolean;
|
|
79
|
+
children: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
export declare const PreventCloseOnClick: {
|
|
83
|
+
args: {
|
|
84
|
+
preventCloseOnClick: boolean;
|
|
85
|
+
children: string;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* More complex header/footer using Vue named slots
|
|
90
|
+
*/
|
|
91
|
+
export declare const WithHeaderFooterChildren: {
|
|
92
|
+
render: () => import("vue/jsx-runtime").JSX.Element;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Dialog needing a confirmation before close using a nested Dialog
|
|
96
|
+
*/
|
|
97
|
+
export declare const WithConfirmClose: {
|
|
98
|
+
render: () => import("vue/jsx-runtime").JSX.Element;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Test dialog focus trap (focus is contained inside the dialog) with all kinds of focusable and non-focusable items
|
|
102
|
+
*/
|
|
103
|
+
export declare const FocusTrap: {
|
|
104
|
+
tags: string[];
|
|
105
|
+
render: () => import("vue/jsx-runtime").JSX.Element;
|
|
106
|
+
};
|
|
@@ -23,7 +23,7 @@ declare const ExpansionPanel: import('vue').DefineSetupFnComponent<ExpansionPane
|
|
|
23
23
|
open: (event: MouseEvent) => boolean;
|
|
24
24
|
close: (event: MouseEvent) => boolean;
|
|
25
25
|
toggleOpen: (shouldOpen: boolean, event: MouseEvent) => boolean;
|
|
26
|
-
}, {}, Omit<UIProps, "className" | "footer" | "ref" | "handleClick" | "handleChange" | "handleInput" | "handleKeyPress" | "handleClose" | "handleFocus" | "handleBeforeClick" | "handleAfterClick" | "handleMouseEnter" | "handleMouseLeave" | "handleKeyDown" | "children" | "content" | "IconButton" | "toggleButtonProps" | "
|
|
26
|
+
}, {}, Omit<UIProps, "className" | "footer" | "ref" | "handleClick" | "handleChange" | "handleInput" | "handleKeyPress" | "handleClose" | "handleFocus" | "handleBeforeClick" | "handleAfterClick" | "handleMouseEnter" | "handleMouseLeave" | "handleKeyDown" | "children" | "content" | "IconButton" | "toggleButtonProps" | "wrapperRef" | "handleOpen" | "handleToggleOpen" | "headerProps" | "headerContent" | "dragHandle" | "isChildrenVisible"> & {
|
|
27
27
|
class?: string;
|
|
28
28
|
} & {
|
|
29
29
|
/** Props to pass to the toggle button (minus those already set by the ExpansionPanel). */
|
|
@@ -3,12 +3,6 @@ import { VueToJSXProps } from '../../utils/VueToJSX';
|
|
|
3
3
|
export type FlexBoxProps = VueToJSXProps<UIProps, 'vAlign' | 'hAlign'> & {
|
|
4
4
|
/** Customize the root element. */
|
|
5
5
|
as?: string;
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated please use `class`
|
|
8
|
-
* custom class name, used for compatibility when using
|
|
9
|
-
* FlexBox as a nested component.
|
|
10
|
-
*/
|
|
11
|
-
className?: string;
|
|
12
6
|
/** FlexBox vertical alignment */
|
|
13
7
|
verticalAlign?: UIProps['vAlign'];
|
|
14
8
|
/** FlexBox horizontal alignment */
|
|
@@ -26,12 +20,6 @@ declare const FlexBox: import('vue').DefineSetupFnComponent<FlexBoxProps, {}, {}
|
|
|
26
20
|
} & {
|
|
27
21
|
/** Customize the root element. */
|
|
28
22
|
as?: string;
|
|
29
|
-
/**
|
|
30
|
-
* @deprecated please use `class`
|
|
31
|
-
* custom class name, used for compatibility when using
|
|
32
|
-
* FlexBox as a nested component.
|
|
33
|
-
*/
|
|
34
|
-
className?: string;
|
|
35
23
|
/** FlexBox vertical alignment */
|
|
36
24
|
verticalAlign?: UIProps["vAlign"];
|
|
37
25
|
/** FlexBox horizontal alignment */
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ComputedRef, MaybeRefOrGetter } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Composable that falls back to an `$attrs` value when the Vue prop is absent.
|
|
4
|
+
*
|
|
5
|
+
* When a core JSX component renders a Vue sub-component, it passes props using React naming
|
|
6
|
+
* conventions (e.g. `className`, `tabIndex`). Since these names are not declared Vue props,
|
|
7
|
+
* they land in `$attrs`. This composable reads the fallback attr and merges it with the
|
|
8
|
+
* corresponding Vue prop value using a caller-supplied merge function (or `??` by default).
|
|
9
|
+
*
|
|
10
|
+
* Usage inside `defineComponent` setup:
|
|
11
|
+
* ```tsx
|
|
12
|
+
* // With default merge (vueProp ?? attrFallback):
|
|
13
|
+
* const tabIndex = useAttrFallback(() => attrs.tabindex, 'tabIndex');
|
|
14
|
+
*
|
|
15
|
+
* // With custom merge function:
|
|
16
|
+
* const className = useAttrFallback(
|
|
17
|
+
* () => props.class,
|
|
18
|
+
* 'className',
|
|
19
|
+
* (vue, fallback) => classNames.join(vue, fallback as string | undefined) || undefined,
|
|
20
|
+
* );
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @param vueProp The Vue prop value (or a getter/ref returning it).
|
|
24
|
+
* @param attrFallback The attribute name to read from `$attrs` as the fallback.
|
|
25
|
+
* @param merge Optional merge function. Defaults to `vueProp ?? attrFallback`.
|
|
26
|
+
* @return Computed ref holding the merged value.
|
|
27
|
+
*/
|
|
28
|
+
export declare function useAttrFallback<T>(vueProp: MaybeRefOrGetter<T>, attrFallback: string, merge?: (vuePropValue: T, attrFallbackValue: unknown) => T): ComputedRef<T>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ComputedRef, MaybeRefOrGetter } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Composable that merges the Vue `class` prop with the `className` attribute (for React compat).
|
|
4
|
+
*
|
|
5
|
+
* Usage inside `defineComponent` setup:
|
|
6
|
+
* ```tsx
|
|
7
|
+
* const className = useClassName(() => props.class);
|
|
8
|
+
* // Then use className.value instead of props.class when forwarding to the core UI:
|
|
9
|
+
* return () => <SomeUI {...props} className={className.value} />;
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* @param classProp The Vue `class` prop value (or a getter/ref returning it).
|
|
13
|
+
* @return Computed ref holding the merged class string (or undefined when empty).
|
|
14
|
+
*/
|
|
15
|
+
export declare function useClassName(classProp: MaybeRefOrGetter<string | undefined>): ComputedRef<string | undefined>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Disables body scroll when the dialog is open.
|
|
4
|
+
* Uses @vueuse/core's useScrollLock which sets overflow:hidden on document.body.
|
|
5
|
+
*
|
|
6
|
+
* @param isActive Whether body scroll should be disabled.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useDisableBodyScroll(isActive: Ref<boolean>): void;
|
|
@@ -16,10 +16,17 @@ export interface UseRovingTabIndexContainerOptions {
|
|
|
16
16
|
* Disabled items are skipped during keyboard navigation.
|
|
17
17
|
*/
|
|
18
18
|
itemDisabledSelector?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Attribute name indicating the selected item (e.g. `'aria-selected'`, `'aria-checked'`).
|
|
21
|
+
* When set, the roving tabindex will keep `tabindex="0"` in sync with the item
|
|
22
|
+
* whose attribute value is `"true"`.
|
|
23
|
+
* Default: `'aria-selected'`.
|
|
24
|
+
*/
|
|
25
|
+
itemSelectedAttr?: string;
|
|
19
26
|
}
|
|
20
27
|
/**
|
|
21
28
|
* Vue composable equivalent of React's useRovingTabIndexContainer.
|
|
22
29
|
* Sets up roving tab index keyboard navigation on a container element.
|
|
23
30
|
* Automatically tears down when the container is removed or the composable is unmounted.
|
|
24
31
|
*/
|
|
25
|
-
export declare function useRovingTabIndexContainer({ containerRef, itemSelector, onItemFocused, direction, itemDisabledSelector, }: UseRovingTabIndexContainerOptions): void;
|
|
32
|
+
export declare function useRovingTabIndexContainer({ containerRef, itemSelector, onItemFocused, direction, itemDisabledSelector, itemSelectedAttr, }: UseRovingTabIndexContainerOptions): void;
|