@lumx/vue 4.11.0 → 4.12.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/CO3BhTbu.js +161 -0
- package/_internal/CO3BhTbu.js.map +1 -0
- package/components/chip/SelectionChipGroup.d.ts +33 -3
- package/components/combobox/Combobox.stories.d.ts +1 -0
- package/components/combobox/ComboboxOption.d.ts +9 -6
- package/components/combobox/ComboboxOption.test.d.ts +1 -0
- package/components/combobox/ComboboxProvider.d.ts +5 -1
- package/components/combobox/index.d.ts +11 -4
- package/components/lightbox/Lightbox.d.ts +28 -0
- package/components/lightbox/Lightbox.stories.d.ts +27 -0
- package/components/lightbox/index.d.ts +1 -0
- package/components/select-text-field/SelectTextField.d.ts +127 -0
- package/components/select-text-field/SelectTextField.stories.d.ts +203 -0
- package/components/select-text-field/SelectTextField.test.d.ts +1 -0
- package/components/select-text-field/SelectTextField.test.stories.d.ts +37 -0
- package/components/select-text-field/Stories/CustomRender.vue.d.ts +2 -0
- package/components/select-text-field/Stories/MultipleWithSearch.vue.d.ts +2 -0
- package/components/select-text-field/Stories/WithCreatableOptions.vue.d.ts +2 -0
- package/components/select-text-field/Stories/WithInfiniteScroll.vue.d.ts +2 -0
- package/components/select-text-field/Stories/WithSearch.vue.d.ts +2 -0
- package/components/select-text-field/index.d.ts +58 -0
- package/index.d.ts +2 -0
- package/index.js +4052 -3538
- package/index.js.map +1 -1
- package/package.json +6 -5
- package/utils/index.js +19 -55
- package/utils/index.js.map +1 -1
- package/_internal/BiLpoFMC.js +0 -124
- package/_internal/BiLpoFMC.js.map +0 -1
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { defineComponent as s, provide as u, inject as f, ref as p, watch as P, onBeforeUnmount as v, createVNode as h, Teleport as I, isVNode as C, onMounted as L, computed as b, unref as x, watchEffect as R } from "vue";
|
|
2
|
+
import { Theme as A } from "@lumx/core/js/constants";
|
|
3
|
+
const S = () => (...e) => e.reduce(
|
|
4
|
+
(n, o) => (n[o] = { required: !1 }, n),
|
|
5
|
+
{}
|
|
6
|
+
), y = /* @__PURE__ */ Symbol("LumxPortal"), E = () => ({
|
|
7
|
+
container: "body"
|
|
8
|
+
}), Y = /* @__PURE__ */ s((e, {
|
|
9
|
+
slots: n
|
|
10
|
+
}) => (u(y, e.value), () => n.default?.()), {
|
|
11
|
+
name: "LumxPortalProvider",
|
|
12
|
+
props: {
|
|
13
|
+
value: {
|
|
14
|
+
type: Function,
|
|
15
|
+
required: !0
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
function T(e) {
|
|
20
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !C(e);
|
|
21
|
+
}
|
|
22
|
+
const K = /* @__PURE__ */ s((e, {
|
|
23
|
+
slots: n
|
|
24
|
+
}) => {
|
|
25
|
+
const o = f(y, E), t = p(null), a = () => {
|
|
26
|
+
e.enabled ? t.value = o() : t.value = null;
|
|
27
|
+
};
|
|
28
|
+
return a(), P(() => e.enabled, a), v(() => {
|
|
29
|
+
t.value?.teardown?.();
|
|
30
|
+
}), () => {
|
|
31
|
+
const c = n.default?.(), r = t.value?.container;
|
|
32
|
+
return !e.enabled || !r ? c : h(I, {
|
|
33
|
+
to: r
|
|
34
|
+
}, T(c) ? c : {
|
|
35
|
+
default: () => [c]
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
}, {
|
|
39
|
+
name: "LumxPortal",
|
|
40
|
+
props: {
|
|
41
|
+
enabled: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: !0
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}), d = ["mousedown", "touchstart"];
|
|
47
|
+
function w(e, n) {
|
|
48
|
+
return !n.some((o) => o instanceof Node && e.some((t) => o.contains(t)));
|
|
49
|
+
}
|
|
50
|
+
function k(e, n) {
|
|
51
|
+
if (!n)
|
|
52
|
+
return;
|
|
53
|
+
const o = (t) => {
|
|
54
|
+
const a = [t.composedPath?.()[0], t.target].filter((r) => r instanceof Node), c = e();
|
|
55
|
+
w(a, c) && n(t);
|
|
56
|
+
};
|
|
57
|
+
return d.forEach((t) => document.addEventListener(t, o)), () => {
|
|
58
|
+
d.forEach((t) => document.removeEventListener(t, o));
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
const m = /* @__PURE__ */ Symbol("LumxClickAway"), q = /* @__PURE__ */ s((e, {
|
|
62
|
+
slots: n
|
|
63
|
+
}) => {
|
|
64
|
+
const o = f(m, null), t = [], a = {
|
|
65
|
+
childrenRefs: t,
|
|
66
|
+
addRefs(...r) {
|
|
67
|
+
for (const l of r) {
|
|
68
|
+
const i = l.value;
|
|
69
|
+
i && t.push(i);
|
|
70
|
+
}
|
|
71
|
+
o && (o.addRefs(...r), e.parentRef && o.addRefs(e.parentRef));
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
u(m, a);
|
|
75
|
+
let c;
|
|
76
|
+
return L(() => {
|
|
77
|
+
const r = e.childrenRefs.value;
|
|
78
|
+
r && a.addRefs(...r), c = k(() => t, (l) => {
|
|
79
|
+
const i = e.callback;
|
|
80
|
+
typeof i == "function" && i(l);
|
|
81
|
+
});
|
|
82
|
+
}), v(() => {
|
|
83
|
+
c?.();
|
|
84
|
+
}), () => n.default?.();
|
|
85
|
+
}, {
|
|
86
|
+
name: "LumxClickAwayProvider",
|
|
87
|
+
props: {
|
|
88
|
+
callback: {
|
|
89
|
+
type: [Function, Boolean, void 0],
|
|
90
|
+
default: void 0
|
|
91
|
+
},
|
|
92
|
+
childrenRefs: {
|
|
93
|
+
type: Object,
|
|
94
|
+
required: !0
|
|
95
|
+
},
|
|
96
|
+
parentRef: {
|
|
97
|
+
type: Object,
|
|
98
|
+
default: void 0
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}), B = s(
|
|
102
|
+
(e, { slots: n }) => (u(
|
|
103
|
+
"theme",
|
|
104
|
+
b(() => e.value)
|
|
105
|
+
), () => n.default?.()),
|
|
106
|
+
{
|
|
107
|
+
name: "LumxThemeProvider",
|
|
108
|
+
props: { value: { type: String, default: void 0 } }
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
function F(e = { defaultTheme: A.light }) {
|
|
112
|
+
const { defaultTheme: n } = e, o = f("theme", void 0);
|
|
113
|
+
return b(() => x(o) || n);
|
|
114
|
+
}
|
|
115
|
+
function N(e, n, o) {
|
|
116
|
+
const t = new IntersectionObserver((a = []) => {
|
|
117
|
+
a.some((r) => r.isIntersecting) && n();
|
|
118
|
+
}, o);
|
|
119
|
+
return t.observe(e), () => {
|
|
120
|
+
t.unobserve(e);
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
const O = "lumx-infinite-scroll-anchor", _ = ({
|
|
124
|
+
ref: e
|
|
125
|
+
}) => (
|
|
126
|
+
// In order to avoid issues when a zoom is added to the browser, we add a small height to the div so that
|
|
127
|
+
// the intersection has a higher chance of working correctly.
|
|
128
|
+
h("div", {
|
|
129
|
+
ref: e,
|
|
130
|
+
"aria-hidden": "true",
|
|
131
|
+
className: O,
|
|
132
|
+
style: {
|
|
133
|
+
height: "4px"
|
|
134
|
+
}
|
|
135
|
+
}, null)
|
|
136
|
+
), V = /* @__PURE__ */ s((e) => {
|
|
137
|
+
const n = p(null);
|
|
138
|
+
return R((o) => {
|
|
139
|
+
const t = n.value;
|
|
140
|
+
if (!t) return;
|
|
141
|
+
const a = N(t, e.callback, e.options);
|
|
142
|
+
o(a);
|
|
143
|
+
}), () => _({
|
|
144
|
+
ref: n
|
|
145
|
+
});
|
|
146
|
+
}, {
|
|
147
|
+
name: "LumxInfiniteScroll",
|
|
148
|
+
inheritAttrs: !1,
|
|
149
|
+
props: S()("callback", "options")
|
|
150
|
+
});
|
|
151
|
+
export {
|
|
152
|
+
q as C,
|
|
153
|
+
V as I,
|
|
154
|
+
K as P,
|
|
155
|
+
B as T,
|
|
156
|
+
Y as a,
|
|
157
|
+
S as k,
|
|
158
|
+
k as s,
|
|
159
|
+
F as u
|
|
160
|
+
};
|
|
161
|
+
//# sourceMappingURL=CO3BhTbu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CO3BhTbu.js","sources":["../../src/utils/VueToJSX.ts","../../src/utils/Portal/PortalProvider.tsx","../../src/utils/Portal/Portal.tsx","../../../lumx-core/src/js/utils/ClickAway/index.ts","../../src/utils/ClickAway/ClickAwayProvider.tsx","../../src/utils/theme/ThemeProvider.ts","../../src/utils/theme/useTheme.ts","../../../lumx-core/src/js/utils/InfiniteScroll/setupInfiniteScrollObserver.ts","../../../lumx-core/src/js/utils/InfiniteScroll/index.tsx","../../src/utils/InfiniteScroll/InfiniteScroll.tsx"],"sourcesContent":["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 { 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","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 { 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","type EventCallback = (evt?: Event) => void;\n\n/**\n * Sets up an IntersectionObserver on the given element.\n * Calls `callback` when at least one observed entry is intersecting.\n * Returns a cleanup function that unobserves the element.\n */\nexport function setupInfiniteScrollObserver(\n element: Element,\n callback: EventCallback,\n options?: IntersectionObserverInit,\n): () => void {\n const observer = new IntersectionObserver((entries = []) => {\n const hasIntersection = entries.some((entry) => entry.isIntersecting);\n\n if (!hasIntersection) {\n return;\n }\n\n callback();\n }, options);\n\n observer.observe(element);\n\n return () => {\n observer.unobserve(element);\n };\n}\n","import type { CommonRef } from '../../types';\n\nexport { setupInfiniteScrollObserver } from './setupInfiniteScrollObserver';\n\nexport const INFINITE_SCROLL_CLASSNAME = 'lumx-infinite-scroll-anchor';\n\nexport interface InfiniteScrollProps {\n /** Callback when infinite scroll component is in view */\n // eslint-disable-next-line react/no-unused-prop-types\n callback: (evt?: Event) => void;\n /** Customize intersection observer option */\n // eslint-disable-next-line react/no-unused-prop-types\n options?: IntersectionObserverInit;\n}\n\n/**\n * Framework-agnostic InfiniteScroll sentinel component.\n *\n * Renders a tiny invisible div that triggers a callback when it enters the viewport\n * (or intersects its root element) via IntersectionObserver.\n *\n * The div has a small height (4px) to avoid issues when a browser zoom is applied,\n * where a zero-height element might not trigger IntersectionObserver reliably.\n */\nexport const InfiniteScroll = ({ ref }: { ref?: CommonRef }) => (\n // In order to avoid issues when a zoom is added to the browser, we add a small height to the div so that\n // the intersection has a higher chance of working correctly.\n <div ref={ref} aria-hidden=\"true\" className={INFINITE_SCROLL_CLASSNAME} style={{ height: '4px' }} />\n);\n","import { defineComponent, ref, watchEffect } from 'vue';\nimport {\n InfiniteScroll as UI,\n type InfiniteScrollProps,\n setupInfiniteScrollObserver,\n} from '@lumx/core/js/utils/InfiniteScroll';\nimport { keysOf } from '../VueToJSX';\n\nexport type { InfiniteScrollProps };\n\n/**\n * Handles basic callback pattern by using intersection observers.\n */\nexport const InfiniteScroll = defineComponent(\n (props: InfiniteScrollProps) => {\n const elementRef = ref<HTMLDivElement | null>(null);\n\n watchEffect((onCleanup) => {\n const element = elementRef.value;\n if (!element) return;\n\n const cleanup = setupInfiniteScrollObserver(element, props.callback, props.options);\n onCleanup(cleanup);\n });\n\n return () => UI({ ref: elementRef });\n },\n {\n name: 'LumxInfiniteScroll',\n inheritAttrs: false,\n props: keysOf<InfiniteScrollProps>()('callback', 'options'),\n },\n);\n\nexport default InfiniteScroll;\n"],"names":["keysOf","keys","acc","key","PORTAL_KEY","Symbol","defaultPortalInit","container","PortalProvider","props","slots","provide","value","default","name","type","Function","required","_isSlot","s","Object","prototype","toString","call","_isVNode","Portal","portalInit","inject","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","ThemeProvider","defineComponent","computed","useTheme","options","Theme","defaultTheme","injected","unref","setupInfiniteScrollObserver","observer","entries","entry","INFINITE_SCROLL_CLASSNAME","InfiniteScroll","height","elementRef","watchEffect","onCleanup","cleanup","UI","inheritAttrs"],"mappings":";;AAwBO,MAAMA,IAAS,MACX,IACAC,MAMIA,EAAK;AAAA,EACR,CAACC,GAAKC,OACFD,EAAIC,CAAgB,IAAI,EAAE,UAAU,GAAA,GAC7BD;AAAA,EAEX,CAAA;AAAC,GChCAE,IAAuCC,uBAAO,YAAY,GAE1DC,IAAgCA,OAAO;AAAA,EAAEC,WAAW;AAAO,IAK3DC,sBACT,CAACC,GAA4B;AAAA,EAAEC,OAAAA;AAAM,OACjCC,EAAQP,GAAYK,EAAMG,KAAK,GACxB,MAAMF,EAAMG,UAAO,IAE9B;AAAA,EACIC,MAAM;AAAA,EACNL,OAAO;AAAA,IACHG,OAAO;AAAA,MACHG,MAAMC;AAAAA,MACNC,UAAU;AAAA,IACd;AAAA,EACJ;AACJ,CACJ;ACzBiE,SAAAC,EAAAC,GAAA;AAAA,SAAA,OAAAA,KAAA,cAAAC,OAAAC,UAAAC,SAAAC,KAAAJ,CAAA,MAAA,qBAAA,CAAAK,EAAAL,CAAA;AAAA;MASpDM,sBACT,CAAChB,GAAoB;AAAA,EAAEC,OAAAA;AAAM,MAAM;AAC/B,QAAMgB,IAAaC,EAAOvB,GAAYE,CAAiB,GACjDsB,IAAUC,EAA0C,IAAI,GAGxDC,IAAmBA,MAAM;AAC3B,IAAIrB,EAAMsB,UACNH,EAAQhB,QAAQc,EAAU,IAE1BE,EAAQhB,QAAQ;AAAA,EAExB;AAGAkB,SAAAA,EAAgB,GAChBE,EAAM,MAAMvB,EAAMsB,SAASD,CAAgB,GAG3CG,EAAgB,MAAM;AAClBL,IAAAA,EAAQhB,OAAOsB,WAAQ;AAAA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IAA8B,YAAY,SAAS;AAC9D,CACJ;"}
|
|
@@ -1,23 +1,38 @@
|
|
|
1
|
+
import { AllowedComponentProps, ComponentCustomProps, EmitFn, EmitsToProps, VNodeProps } from 'vue';
|
|
1
2
|
import { SelectionChipGroupProps as UIProps } from '@lumx/core/js/components/Chip/SelectionChipGroup';
|
|
2
3
|
import { VueToJSXProps } from '../../utils/VueToJSX';
|
|
3
4
|
/**
|
|
4
5
|
* Props omit 'ref' (handled internally).
|
|
5
6
|
* inputRef is added here for Vue (ref to an associated input element for backspace focus handling).
|
|
6
7
|
*/
|
|
7
|
-
export type SelectionChipGroupProps = VueToJSXProps<UIProps<
|
|
8
|
+
export type SelectionChipGroupProps<O = any> = VueToJSXProps<UIProps<O>> & {
|
|
8
9
|
/** Ref to the associated input element (for focus restoration on backspace) */
|
|
9
10
|
inputRef?: HTMLInputElement | null;
|
|
10
11
|
};
|
|
11
12
|
export declare const emitSchema: {
|
|
12
13
|
change: (_newValue?: any[]) => boolean;
|
|
13
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* Typed emit options generic over `<O>`. Mirrors `emitSchema` (the runtime validators) but
|
|
17
|
+
* carries the actual payload type — the runtime schema can't, since it's fixed at
|
|
18
|
+
* `defineComponent` time and has no access to the generic.
|
|
19
|
+
*
|
|
20
|
+
* `change` carries `O[] | undefined` (matches `setupSelectionChipGroupEvents`'s contract:
|
|
21
|
+
* undefined when the entire selection is cleared by removing the last chip).
|
|
22
|
+
*
|
|
23
|
+
* Vue derives both the public props (`onChange?: …`) via `EmitsToProps` and the `$emit`
|
|
24
|
+
* overloads via `EmitFn`, so this single declaration drives both ends.
|
|
25
|
+
*/
|
|
26
|
+
export type SelectionChipGroupEmits<O> = {
|
|
27
|
+
change: (newValue: O[] | undefined) => void;
|
|
28
|
+
};
|
|
14
29
|
/**
|
|
15
30
|
* SelectionChipGroup component.
|
|
16
31
|
*
|
|
17
32
|
* @param props Component props.
|
|
18
33
|
* @return Vue element.
|
|
19
34
|
*/
|
|
20
|
-
declare const SelectionChipGroup: import('vue').DefineSetupFnComponent<SelectionChipGroupProps
|
|
35
|
+
declare const SelectionChipGroup: import('vue').DefineSetupFnComponent<SelectionChipGroupProps<any>, {
|
|
21
36
|
change: (_newValue?: any[]) => boolean;
|
|
22
37
|
}, {}, Omit<UIProps<any>, "className" | import('@lumx/core/js/types').PropsToOverride | "children"> & {
|
|
23
38
|
class?: string;
|
|
@@ -27,4 +42,19 @@ declare const SelectionChipGroup: import('vue').DefineSetupFnComponent<Selection
|
|
|
27
42
|
} & {
|
|
28
43
|
onChange?: ((_newValue?: any[] | undefined) => any) | undefined;
|
|
29
44
|
}, import('vue').PublicProps>;
|
|
30
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Generic constructor type — exposes `<O>` to TSX consumers
|
|
47
|
+
* (`<SelectionChipGroup<MyOption> value={…} onChange={…} />`) and gives Vue templates
|
|
48
|
+
* correctly typed event payloads for `@change`.
|
|
49
|
+
*
|
|
50
|
+
* Vue's `defineComponent` setup-fn overload cannot carry an unbound generic from the setup
|
|
51
|
+
* signature to the resulting component constructor, so the generic is layered on via cast.
|
|
52
|
+
*/
|
|
53
|
+
export interface SelectionChipGroupConstructor {
|
|
54
|
+
new <O = any>(props: SelectionChipGroupProps<O> & EmitsToProps<SelectionChipGroupEmits<O>> & VNodeProps & AllowedComponentProps & ComponentCustomProps): {
|
|
55
|
+
$props: SelectionChipGroupProps<O> & EmitsToProps<SelectionChipGroupEmits<O>>;
|
|
56
|
+
$emit: EmitFn<SelectionChipGroupEmits<O>>;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
declare const _default: SelectionChipGroupConstructor & typeof SelectionChipGroup;
|
|
60
|
+
export default _default;
|
|
@@ -109,6 +109,7 @@ export declare const ComboboxWithEmptyState: {
|
|
|
109
109
|
value: string;
|
|
110
110
|
};
|
|
111
111
|
decorators: ((story: any, context: any) => any)[];
|
|
112
|
+
play({ canvas }: any): Promise<void>;
|
|
112
113
|
render: ({ value, onChange }: {
|
|
113
114
|
value: string;
|
|
114
115
|
onChange: (v: string) => void;
|
|
@@ -4,26 +4,29 @@ import { TooltipProps } from '../tooltip/Tooltip';
|
|
|
4
4
|
export type ComboboxOptionProps = VueToJSXProps<UIProps, ComboboxOptionPropsToOverride | 'descriptionId' | 'hidden' | 'isGrid' | 'id'> & {
|
|
5
5
|
/** Props forwarded to a Tooltip wrapping the option trigger element. */
|
|
6
6
|
tooltipProps?: Partial<TooltipProps>;
|
|
7
|
-
/** On option clicked (or activated with keyboard). */
|
|
8
|
-
onClick?: () => void;
|
|
9
7
|
/** Props forwarded to the inner action element (e.g. `{ as: 'a', href: '/foo' }`). */
|
|
10
8
|
actionProps?: Record<string, any>;
|
|
11
9
|
};
|
|
10
|
+
export declare const emitSchema: {
|
|
11
|
+
click: () => boolean;
|
|
12
|
+
};
|
|
12
13
|
/**
|
|
13
14
|
* Combobox.Option component - wraps ListItem with option role and data-value.
|
|
14
15
|
*
|
|
15
16
|
* @param props Component props.
|
|
16
17
|
* @return Vue element.
|
|
17
18
|
*/
|
|
18
|
-
declare const ComboboxOption: import('vue').DefineSetupFnComponent<ComboboxOptionProps, {
|
|
19
|
+
declare const ComboboxOption: import('vue').DefineSetupFnComponent<ComboboxOptionProps, {
|
|
20
|
+
click: () => boolean;
|
|
21
|
+
}, {}, Omit<UIProps, "className" | import('@lumx/core/js/types').PropsToOverride | "id" | "hidden" | "descriptionId" | "isGrid" | ComboboxOptionPropsToOverride> & {
|
|
19
22
|
class?: string;
|
|
20
23
|
} & {
|
|
21
24
|
/** Props forwarded to a Tooltip wrapping the option trigger element. */
|
|
22
25
|
tooltipProps?: Partial<TooltipProps>;
|
|
23
|
-
/** On option clicked (or activated with keyboard). */
|
|
24
|
-
onClick?: () => void;
|
|
25
26
|
/** Props forwarded to the inner action element (e.g. `{ as: 'a', href: '/foo' }`). */
|
|
26
27
|
actionProps?: Record<string, any>;
|
|
27
|
-
} & {
|
|
28
|
+
} & {
|
|
29
|
+
onClick?: (() => any) | undefined;
|
|
30
|
+
}, import('vue').PublicProps>;
|
|
28
31
|
export { COMPONENT_NAME, CLASSNAME };
|
|
29
32
|
export default ComboboxOption;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -12,5 +12,9 @@ export interface ComboboxProviderProps {
|
|
|
12
12
|
* @param props Component props.
|
|
13
13
|
* @return Vue element.
|
|
14
14
|
*/
|
|
15
|
-
declare const ComboboxProvider: import('vue').DefineSetupFnComponent<ComboboxProviderProps, {
|
|
15
|
+
declare const ComboboxProvider: import('vue').DefineSetupFnComponent<ComboboxProviderProps, {
|
|
16
|
+
open: (isOpen: boolean) => true;
|
|
17
|
+
}, {}, ComboboxProviderProps & {
|
|
18
|
+
onOpen?: ((isOpen: boolean) => any) | undefined;
|
|
19
|
+
}, import('vue').PublicProps>;
|
|
16
20
|
export default ComboboxProvider;
|
|
@@ -17,7 +17,11 @@ export type { ComboboxHandle, ComboboxCallbacks } from '@lumx/core/js/components
|
|
|
17
17
|
*/
|
|
18
18
|
export declare const Combobox: {
|
|
19
19
|
/** Provides shared combobox context (handle, listbox ID, anchor ref) to all sub-components. */
|
|
20
|
-
Provider: import('vue').DefineSetupFnComponent<import('./ComboboxProvider').ComboboxProviderProps, {
|
|
20
|
+
Provider: import('vue').DefineSetupFnComponent<import('./ComboboxProvider').ComboboxProviderProps, {
|
|
21
|
+
open: (isOpen: boolean) => true;
|
|
22
|
+
}, {}, import('./ComboboxProvider').ComboboxProviderProps & {
|
|
23
|
+
onOpen?: ((isOpen: boolean) => any) | undefined;
|
|
24
|
+
}, import('vue').PublicProps>;
|
|
21
25
|
/** Button trigger for select-only combobox mode with keyboard navigation and typeahead. */
|
|
22
26
|
Button: import('vue').DefineSetupFnComponent<import('./ComboboxButton').ComboboxButtonProps, {
|
|
23
27
|
select: (option: {
|
|
@@ -69,13 +73,16 @@ export declare const Combobox: {
|
|
|
69
73
|
class?: string;
|
|
70
74
|
} & {}, import('vue').PublicProps>;
|
|
71
75
|
/** Selectable option item with filtering and keyboard navigation support. */
|
|
72
|
-
Option: import('vue').DefineSetupFnComponent<import('./ComboboxOption').ComboboxOptionProps, {
|
|
76
|
+
Option: import('vue').DefineSetupFnComponent<import('./ComboboxOption').ComboboxOptionProps, {
|
|
77
|
+
click: () => boolean;
|
|
78
|
+
}, {}, Omit<import('@lumx/core/js/components/Combobox/ComboboxOption').ComboboxOptionProps, "className" | import('@lumx/core/js/types').PropsToOverride | "id" | "hidden" | "descriptionId" | "isGrid" | import('@lumx/core/js/components/Combobox/ComboboxOption').ComboboxOptionPropsToOverride> & {
|
|
73
79
|
class?: string;
|
|
74
80
|
} & {
|
|
75
81
|
tooltipProps?: Partial<import('../tooltip').TooltipProps>;
|
|
76
|
-
onClick?: () => void;
|
|
77
82
|
actionProps?: Record<string, any>;
|
|
78
|
-
} & {
|
|
83
|
+
} & {
|
|
84
|
+
onClick?: (() => any) | undefined;
|
|
85
|
+
}, import('vue').PublicProps>;
|
|
79
86
|
/** Secondary action button within a grid-mode option row, rendered as an independent gridcell. */
|
|
80
87
|
OptionAction: import('vue').DefineSetupFnComponent<import('./ComboboxOptionAction').ComboboxOptionActionProps, {}, {}, Pick<import('../../utils/VueToJSX').VueToJSXProps<import('@lumx/core/js/components/Combobox/ComboboxOptionAction').ComboboxOptionActionProps>, "class" | "isDisabled"> & {
|
|
81
88
|
onClick?: (evt: MouseEvent) => void;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BaseLightboxProps } from '@lumx/core/js/components/Lightbox';
|
|
2
|
+
import { VueToJSXProps } from '../../utils/VueToJSX';
|
|
3
|
+
export type LightboxProps = VueToJSXProps<BaseLightboxProps, 'theme' | 'aria-label' | 'aria-labelledby'> & {
|
|
4
|
+
/** Reference to the element that triggered lightbox opening (gets focus back on close). */
|
|
5
|
+
parentElement?: HTMLElement;
|
|
6
|
+
/** Element that should receive focus when the lightbox opens. By default the first focusable child. */
|
|
7
|
+
focusElement?: HTMLElement;
|
|
8
|
+
/** Props to pass to the close button. */
|
|
9
|
+
closeButtonProps?: any;
|
|
10
|
+
};
|
|
11
|
+
export declare const emitSchema: {
|
|
12
|
+
close: () => boolean;
|
|
13
|
+
};
|
|
14
|
+
declare const Lightbox: import('vue').DefineSetupFnComponent<LightboxProps, {
|
|
15
|
+
close: () => boolean;
|
|
16
|
+
}, {}, Omit<BaseLightboxProps, "className" | import('@lumx/core/js/types').PropsToOverride | "children" | "aria-label" | "theme" | "aria-labelledby"> & {
|
|
17
|
+
class?: string;
|
|
18
|
+
} & {
|
|
19
|
+
/** Reference to the element that triggered lightbox opening (gets focus back on close). */
|
|
20
|
+
parentElement?: HTMLElement;
|
|
21
|
+
/** Element that should receive focus when the lightbox opens. By default the first focusable child. */
|
|
22
|
+
focusElement?: HTMLElement;
|
|
23
|
+
/** Props to pass to the close button. */
|
|
24
|
+
closeButtonProps?: any;
|
|
25
|
+
} & {
|
|
26
|
+
onClose?: (() => any) | undefined;
|
|
27
|
+
}, import('vue').PublicProps>;
|
|
28
|
+
export default Lightbox;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
component: any;
|
|
3
|
+
render: any;
|
|
4
|
+
play: ({ canvas }: any) => Promise<void>;
|
|
5
|
+
argTypes: {
|
|
6
|
+
children: {
|
|
7
|
+
control: boolean;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
title: string;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
13
|
+
export declare const Image: {
|
|
14
|
+
render: ({ children, ...args }: any) => any;
|
|
15
|
+
args: {
|
|
16
|
+
'aria-label': string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const WithCloseButton: {
|
|
20
|
+
render: ({ children, ...args }: any) => any;
|
|
21
|
+
args: {
|
|
22
|
+
closeButtonProps: {
|
|
23
|
+
label: string;
|
|
24
|
+
};
|
|
25
|
+
'aria-label': string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Lightbox, type LightboxProps } from './Lightbox';
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { AllowedComponentProps, ComponentCustomProps, EmitFn, EmitsToProps, VNodeProps } from 'vue';
|
|
2
|
+
import { BaseSelectTextFieldWrapperProps } from '@lumx/core/js/utils/select/types';
|
|
3
|
+
import { JSXElement } from '@lumx/core/js/types';
|
|
4
|
+
/** Props shared across single and multiple selection modes. */
|
|
5
|
+
interface BaseSelectTextFieldProps<O = any> extends BaseSelectTextFieldWrapperProps<O> {
|
|
6
|
+
/** Content to render before the options list. */
|
|
7
|
+
beforeOptions?: JSXElement;
|
|
8
|
+
/** CSS class. */
|
|
9
|
+
class?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Props specific to single selection mode. */
|
|
12
|
+
export interface SingleSelectTextFieldProps<O = any> extends BaseSelectTextFieldProps<O> {
|
|
13
|
+
/** Selection type. */
|
|
14
|
+
selectionType: 'single';
|
|
15
|
+
/** Selected option object. */
|
|
16
|
+
value?: O;
|
|
17
|
+
}
|
|
18
|
+
/** Props specific to multiple selection mode. */
|
|
19
|
+
export interface MultipleSelectTextFieldProps<O = any> extends BaseSelectTextFieldProps<O> {
|
|
20
|
+
/** Selection type. */
|
|
21
|
+
selectionType: 'multiple';
|
|
22
|
+
/** Selected option objects. */
|
|
23
|
+
value?: O[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* SelectTextField props — supports both single and multiple selection.
|
|
27
|
+
* Discriminated on `selectionType`: when `'multiple'`, `value` is `O[]`.
|
|
28
|
+
*/
|
|
29
|
+
export type SelectTextFieldProps<O = any> = SingleSelectTextFieldProps<O> | MultipleSelectTextFieldProps<O>;
|
|
30
|
+
export declare const emitSchema: {
|
|
31
|
+
change: (_newValue?: unknown) => boolean;
|
|
32
|
+
search: (_searchText: string) => boolean;
|
|
33
|
+
'load-more': () => boolean;
|
|
34
|
+
blur: (_event?: FocusEvent) => boolean;
|
|
35
|
+
focus: (_event?: FocusEvent) => boolean;
|
|
36
|
+
keydown: (_event?: KeyboardEvent) => boolean;
|
|
37
|
+
clear: (_event?: MouseEvent) => boolean;
|
|
38
|
+
open: (_isOpen: boolean) => boolean;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* A text field with a select dropdown to choose between a list of options.
|
|
42
|
+
* Supports search/filter, single selection, and multiple selection with chips.
|
|
43
|
+
*
|
|
44
|
+
* Scoped slots:
|
|
45
|
+
* - `option({ option, index })` — custom option rendering inside a `<Combobox.Option>`.
|
|
46
|
+
* - `sectionTitle({ sectionId, options })` — custom section header rendering.
|
|
47
|
+
* - `chip({ option, index })` — custom chip rendering (multiple selection only).
|
|
48
|
+
*/
|
|
49
|
+
declare const SelectTextField: import('vue').DefineSetupFnComponent<SelectTextFieldProps<any>, {
|
|
50
|
+
change: (_newValue?: unknown) => boolean;
|
|
51
|
+
search: (_searchText: string) => boolean;
|
|
52
|
+
'load-more': () => boolean;
|
|
53
|
+
blur: (_event?: FocusEvent) => boolean;
|
|
54
|
+
focus: (_event?: FocusEvent) => boolean;
|
|
55
|
+
keydown: (_event?: KeyboardEvent) => boolean;
|
|
56
|
+
clear: (_event?: MouseEvent) => boolean;
|
|
57
|
+
open: (_isOpen: boolean) => boolean;
|
|
58
|
+
}, {}, SelectTextFieldProps<any> & {
|
|
59
|
+
onSearch?: ((_searchText: string) => any) | undefined;
|
|
60
|
+
onBlur?: ((_event?: FocusEvent | undefined) => any) | undefined;
|
|
61
|
+
onChange?: ((_newValue?: unknown) => any) | undefined;
|
|
62
|
+
onFocus?: ((_event?: FocusEvent | undefined) => any) | undefined;
|
|
63
|
+
onKeydown?: ((_event?: KeyboardEvent | undefined) => any) | undefined;
|
|
64
|
+
onClear?: ((_event?: MouseEvent | undefined) => any) | undefined;
|
|
65
|
+
onOpen?: ((_isOpen: boolean) => any) | undefined;
|
|
66
|
+
"onLoad-more"?: (() => any) | undefined;
|
|
67
|
+
}, import('vue').PublicProps>;
|
|
68
|
+
/**
|
|
69
|
+
* Emit options shared by both selection modes. Mirrors `emitSchema` (the runtime validators)
|
|
70
|
+
* but carries the actual payload types — the runtime schema can't, since it's fixed at
|
|
71
|
+
* `defineComponent` time and has no access to the generic.
|
|
72
|
+
*
|
|
73
|
+
* `change` is intentionally absent here: its payload type depends on `selectionType` and is
|
|
74
|
+
* declared per-branch in `SelectTextFieldEmits<O, S>` below.
|
|
75
|
+
*/
|
|
76
|
+
interface SelectTextFieldCommonEmits {
|
|
77
|
+
search: (searchText: string) => void;
|
|
78
|
+
'load-more': () => void;
|
|
79
|
+
blur: (event?: FocusEvent) => void;
|
|
80
|
+
focus: (event?: FocusEvent) => void;
|
|
81
|
+
keydown: (event?: KeyboardEvent) => void;
|
|
82
|
+
clear: (event?: MouseEvent) => void;
|
|
83
|
+
open: (isOpen: boolean) => void;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Typed emit options generic over `<O>` and the discriminant `S` (selection type).
|
|
87
|
+
*
|
|
88
|
+
* - `S = 'single'` → `change: (O | undefined) => void` (undefined on clear, option on select).
|
|
89
|
+
* - `S = 'multiple'` → `change: (O[] | undefined) => void` (undefined when fully cleared).
|
|
90
|
+
*
|
|
91
|
+
* Vue derives both the public props (`onChange?: …`) via `EmitsToProps` and the `$emit`
|
|
92
|
+
* overloads via `EmitFn`, so this single declaration drives both ends per branch.
|
|
93
|
+
*/
|
|
94
|
+
export type SelectTextFieldEmits<O, S extends 'single' | 'multiple'> = SelectTextFieldCommonEmits & {
|
|
95
|
+
change: (newValue: (S extends 'multiple' ? O[] : O) | undefined) => void;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Public props per selection mode. Combines the discriminated prop shape with the matching
|
|
99
|
+
* `EmitsToProps` so `@change="handler"` (template) and `onChange={handler}` (JSX) get
|
|
100
|
+
* narrowed payload types based on `selectionType`.
|
|
101
|
+
*/
|
|
102
|
+
type SingleSelectTextFieldPublicProps<O> = SingleSelectTextFieldProps<O> & EmitsToProps<SelectTextFieldEmits<O, 'single'>>;
|
|
103
|
+
type MultipleSelectTextFieldPublicProps<O> = MultipleSelectTextFieldProps<O> & EmitsToProps<SelectTextFieldEmits<O, 'multiple'>>;
|
|
104
|
+
/**
|
|
105
|
+
* Generic constructor type — exposes `<O>` to TSX consumers (`<SelectTextField<MyOption> … />`)
|
|
106
|
+
* and gives Vue templates correctly typed event payloads for `@change`, `@search`, etc.,
|
|
107
|
+
* narrowed on `selectionType`.
|
|
108
|
+
*
|
|
109
|
+
* The constructor is overloaded on the discriminant: passing `selection-type="single"` resolves
|
|
110
|
+
* to the single-mode props (and `onChange` accepts `O | undefined`); `'multiple'` resolves to
|
|
111
|
+
* the multiple-mode props (and `onChange` accepts `O[] | undefined`).
|
|
112
|
+
*
|
|
113
|
+
* The instance's `$props` keeps the discriminated union so consumers reading
|
|
114
|
+
* `instance.$props` still see the full prop shape.
|
|
115
|
+
*/
|
|
116
|
+
export interface SelectTextFieldConstructor {
|
|
117
|
+
new <O = any>(props: SingleSelectTextFieldPublicProps<O> & VNodeProps & AllowedComponentProps & ComponentCustomProps): {
|
|
118
|
+
$props: SingleSelectTextFieldPublicProps<O>;
|
|
119
|
+
$emit: EmitFn<SelectTextFieldEmits<O, 'single'>>;
|
|
120
|
+
};
|
|
121
|
+
new <O = any>(props: MultipleSelectTextFieldPublicProps<O> & VNodeProps & AllowedComponentProps & ComponentCustomProps): {
|
|
122
|
+
$props: MultipleSelectTextFieldPublicProps<O>;
|
|
123
|
+
$emit: EmitFn<SelectTextFieldEmits<O, 'multiple'>>;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
declare const _default: SelectTextFieldConstructor & typeof SelectTextField;
|
|
127
|
+
export default _default;
|