@kirana-ui/vue 0.0.0 → 0.1.1
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/LICENSE +1 -1
- package/llms.txt +1838 -0
- package/package.json +230 -6
- package/src/accordion.d.ts +78 -0
- package/src/accordion.js +92 -0
- package/src/accordion.js.map +1 -0
- package/src/alert-dialog.d.ts +2 -0
- package/src/alert-dialog.js +1 -0
- package/src/autocomplete.d.ts +2 -0
- package/src/autocomplete.js +1 -0
- package/src/autosize.d.ts +12 -0
- package/src/autosize.js +24 -0
- package/src/autosize.js.map +1 -0
- package/src/avatar.d.ts +16 -0
- package/src/avatar.js +40 -0
- package/src/avatar.js.map +1 -0
- package/src/button.d.ts +23 -0
- package/src/button.js +22 -0
- package/src/button.js.map +1 -0
- package/src/calendar.d.ts +107 -0
- package/src/calendar.js +125 -0
- package/src/calendar.js.map +1 -0
- package/src/carousel.d.ts +61 -0
- package/src/carousel.js +75 -0
- package/src/carousel.js.map +1 -0
- package/src/checkbox.d.ts +53 -0
- package/src/checkbox.js +64 -0
- package/src/checkbox.js.map +1 -0
- package/src/collapsible.d.ts +39 -0
- package/src/collapsible.js +50 -0
- package/src/collapsible.js.map +1 -0
- package/src/combobox.d.ts +298 -0
- package/src/combobox.js +286 -0
- package/src/combobox.js.map +1 -0
- package/src/command.d.ts +89 -0
- package/src/command.js +129 -0
- package/src/command.js.map +1 -0
- package/src/context-menu.d.ts +2 -0
- package/src/context-menu.js +1 -0
- package/src/date-field.d.ts +70 -0
- package/src/date-field.js +77 -0
- package/src/date-field.js.map +1 -0
- package/src/date-picker.d.ts +145 -0
- package/src/date-picker.js +82 -0
- package/src/date-picker.js.map +1 -0
- package/src/dialog.d.ts +154 -0
- package/src/dialog.js +133 -0
- package/src/dialog.js.map +1 -0
- package/src/direction-context.d.ts +5 -0
- package/src/direction-context.js +9 -0
- package/src/direction-context.js.map +1 -0
- package/src/direction.d.ts +16 -0
- package/src/direction.js +25 -0
- package/src/direction.js.map +1 -0
- package/src/drawer.d.ts +2 -0
- package/src/drawer.js +1 -0
- package/src/field-context.d.ts +6 -0
- package/src/field-context.js +17 -0
- package/src/field-context.js.map +1 -0
- package/src/field.d.ts +49 -0
- package/src/field.js +79 -0
- package/src/field.js.map +1 -0
- package/src/fieldset.d.ts +18 -0
- package/src/fieldset.js +35 -0
- package/src/fieldset.js.map +1 -0
- package/src/form.d.ts +22 -0
- package/src/form.js +29 -0
- package/src/form.js.map +1 -0
- package/src/hover-card.d.ts +46 -0
- package/src/hover-card.js +7 -0
- package/src/hover-card.js.map +1 -0
- package/src/hover-popup.d.ts +49 -0
- package/src/hover-popup.js +62 -0
- package/src/hover-popup.js.map +1 -0
- package/src/index.d.ts +48 -0
- package/src/index.js +47 -0
- package/src/input.d.ts +19 -0
- package/src/input.js +36 -0
- package/src/input.js.map +1 -0
- package/src/label.d.ts +5 -0
- package/src/label.js +18 -0
- package/src/label.js.map +1 -0
- package/src/listbox.d.ts +92 -0
- package/src/listbox.js +104 -0
- package/src/listbox.js.map +1 -0
- package/src/menu.d.ts +542 -0
- package/src/menu.js +235 -0
- package/src/menu.js.map +1 -0
- package/src/menubar-context.d.ts +5 -0
- package/src/menubar-context.js +6 -0
- package/src/menubar-context.js.map +1 -0
- package/src/menubar.d.ts +26 -0
- package/src/menubar.js +34 -0
- package/src/menubar.js.map +1 -0
- package/src/message-scroller.d.ts +20 -0
- package/src/message-scroller.js +34 -0
- package/src/message-scroller.js.map +1 -0
- package/src/meter.d.ts +34 -0
- package/src/meter.js +7 -0
- package/src/meter.js.map +1 -0
- package/src/navigation-menu.d.ts +91 -0
- package/src/navigation-menu.js +117 -0
- package/src/navigation-menu.js.map +1 -0
- package/src/number-field.d.ts +71 -0
- package/src/number-field.js +81 -0
- package/src/number-field.js.map +1 -0
- package/src/otp.d.ts +58 -0
- package/src/otp.js +86 -0
- package/src/otp.js.map +1 -0
- package/src/pagination.d.ts +61 -0
- package/src/pagination.js +70 -0
- package/src/pagination.js.map +1 -0
- package/src/popover.d.ts +44 -0
- package/src/popover.js +60 -0
- package/src/popover.js.map +1 -0
- package/src/progress.d.ts +34 -0
- package/src/progress.js +7 -0
- package/src/progress.js.map +1 -0
- package/src/qr-code.d.ts +24 -0
- package/src/qr-code.js +34 -0
- package/src/qr-code.js.map +1 -0
- package/src/radio-group.d.ts +78 -0
- package/src/radio-group.js +97 -0
- package/src/radio-group.js.map +1 -0
- package/src/resizable.d.ts +48 -0
- package/src/resizable.js +62 -0
- package/src/resizable.js.map +1 -0
- package/src/runtime.d.ts +48 -0
- package/src/runtime.js +149 -0
- package/src/runtime.js.map +1 -0
- package/src/scroll-area.d.ts +32 -0
- package/src/scroll-area.js +63 -0
- package/src/scroll-area.js.map +1 -0
- package/src/select.d.ts +154 -0
- package/src/select.js +191 -0
- package/src/select.js.map +1 -0
- package/src/separator.d.ts +10 -0
- package/src/separator.js +17 -0
- package/src/separator.js.map +1 -0
- package/src/slider.d.ts +83 -0
- package/src/slider.js +94 -0
- package/src/slider.js.map +1 -0
- package/src/switch.d.ts +42 -0
- package/src/switch.js +51 -0
- package/src/switch.js.map +1 -0
- package/src/tabs.d.ts +101 -0
- package/src/tabs.js +106 -0
- package/src/tabs.js.map +1 -0
- package/src/toast.d.ts +48 -0
- package/src/toast.js +66 -0
- package/src/toast.js.map +1 -0
- package/src/toggle-group.d.ts +41 -0
- package/src/toggle-group.js +46 -0
- package/src/toggle-group.js.map +1 -0
- package/src/toggle.d.ts +39 -0
- package/src/toggle.js +46 -0
- package/src/toggle.js.map +1 -0
- package/src/toolbar-context.d.ts +8 -0
- package/src/toolbar-context.js +8 -0
- package/src/toolbar-context.js.map +1 -0
- package/src/toolbar.d.ts +72 -0
- package/src/toolbar.js +55 -0
- package/src/toolbar.js.map +1 -0
- package/src/tooltip.d.ts +46 -0
- package/src/tooltip.js +7 -0
- package/src/tooltip.js.map +1 -0
- package/src/value-bar.d.ts +38 -0
- package/src/value-bar.js +52 -0
- package/src/value-bar.js.map +1 -0
- package/README.md +0 -7
- package/index.js +0 -5
package/src/runtime.js
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { mergeProps, sameProps, signal } from "@kirana-ui/core";
|
|
2
|
+
import { Comment, Fragment, Teleport, cloneVNode, defineComponent, h, inject, onBeforeUnmount, onMounted, onScopeDispose, provide, queuePostFlushCb, shallowRef, watchEffect } from "vue";
|
|
3
|
+
// src/runtime.ts
|
|
4
|
+
/** A core signal as a Vue ref, read-only: tracked by whatever reads `.value`. */
|
|
5
|
+
function fromSignal(source) {
|
|
6
|
+
const ref = shallowRef(source.peek());
|
|
7
|
+
if (typeof window !== "undefined") onScopeDispose(source.subscribe(() => {
|
|
8
|
+
ref.value = source.peek();
|
|
9
|
+
}));
|
|
10
|
+
return ref;
|
|
11
|
+
}
|
|
12
|
+
/** A core signal that follows Vue state: the core hears a changed prop as it changes. */
|
|
13
|
+
function toSignal(read) {
|
|
14
|
+
const source = signal(read(), sameProps);
|
|
15
|
+
watchEffect(() => source.set(read()), { flush: "sync" });
|
|
16
|
+
return source;
|
|
17
|
+
}
|
|
18
|
+
/** A component's controller, made once, following its props. */
|
|
19
|
+
function controller(create, read) {
|
|
20
|
+
const made = create(toSignal(read));
|
|
21
|
+
let stop;
|
|
22
|
+
onMounted(() => {
|
|
23
|
+
stop = made.mount();
|
|
24
|
+
});
|
|
25
|
+
onBeforeUnmount(() => stop?.());
|
|
26
|
+
return made;
|
|
27
|
+
}
|
|
28
|
+
/** A controller its parts find: `provide` in the root, `use` in a part. */
|
|
29
|
+
function context(name) {
|
|
30
|
+
const key = Symbol(name);
|
|
31
|
+
return {
|
|
32
|
+
provide(made) {
|
|
33
|
+
provide(key, made);
|
|
34
|
+
return made;
|
|
35
|
+
},
|
|
36
|
+
use() {
|
|
37
|
+
const made = inject(key, void 0);
|
|
38
|
+
if (!made) throw new Error(`A ${name} part must be inside <${name}.Root>`);
|
|
39
|
+
return made;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function toVue(props) {
|
|
44
|
+
const out = {};
|
|
45
|
+
for (const key in props) {
|
|
46
|
+
const value = props[key];
|
|
47
|
+
if (typeof value === "function") {
|
|
48
|
+
const name = key.slice(2).toLowerCase();
|
|
49
|
+
const event = name === "focus" ? "focusin" : name === "blur" ? "focusout" : name;
|
|
50
|
+
out[`on${event[0].toUpperCase()}${event.slice(1)}`] = value;
|
|
51
|
+
} else out[key] = value;
|
|
52
|
+
}
|
|
53
|
+
return out;
|
|
54
|
+
}
|
|
55
|
+
function firstElement(nodes) {
|
|
56
|
+
for (const node of nodes ?? []) {
|
|
57
|
+
if (node.type === Comment) continue;
|
|
58
|
+
if (node.type === Fragment) return firstElement(node.children);
|
|
59
|
+
return node;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* A part as a component: its element (`as`, the part's own tag by default), or with `as-child`
|
|
64
|
+
* the caller's own element in its slot, which takes the part's props. Either way the caller's
|
|
65
|
+
* attributes are merged under the part's, and the part's DOM work is attached to the element.
|
|
66
|
+
*/
|
|
67
|
+
function partComponent(name, tag, resolve) {
|
|
68
|
+
return defineComponent({
|
|
69
|
+
name,
|
|
70
|
+
inheritAttrs: false,
|
|
71
|
+
props: {
|
|
72
|
+
as: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: tag
|
|
75
|
+
},
|
|
76
|
+
asChild: Boolean
|
|
77
|
+
},
|
|
78
|
+
setup(props, { attrs, slots }) {
|
|
79
|
+
const part = resolve();
|
|
80
|
+
const own = fromSignal(part.props);
|
|
81
|
+
let element = null;
|
|
82
|
+
let detach;
|
|
83
|
+
let wanted = null;
|
|
84
|
+
const sync = () => {
|
|
85
|
+
if (wanted === element) return;
|
|
86
|
+
detach?.();
|
|
87
|
+
element = wanted;
|
|
88
|
+
detach = wanted ? part.attach(wanted) : void 0;
|
|
89
|
+
};
|
|
90
|
+
const attach = (target) => {
|
|
91
|
+
let found = target instanceof HTMLElement ? target : target?.$el;
|
|
92
|
+
while (found instanceof Node && !(found instanceof HTMLElement)) found = found.nextSibling;
|
|
93
|
+
wanted = found instanceof HTMLElement ? found : null;
|
|
94
|
+
if (wanted) queuePostFlushCb(sync);
|
|
95
|
+
else sync();
|
|
96
|
+
};
|
|
97
|
+
return () => {
|
|
98
|
+
const merged = {
|
|
99
|
+
...mergeProps(attrs, toVue(own.value)),
|
|
100
|
+
ref: attach
|
|
101
|
+
};
|
|
102
|
+
if (props.asChild) {
|
|
103
|
+
const child = firstElement(slots.default?.());
|
|
104
|
+
return child ? cloneVNode(child, merged, true) : null;
|
|
105
|
+
}
|
|
106
|
+
return h(props.as, merged, slots.default?.());
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
const PORTAL_CONTAINER = Symbol("PortalContainer");
|
|
112
|
+
/**
|
|
113
|
+
* Says where every popup inside it is drawn, the popups those open included: an element of
|
|
114
|
+
* the page (a shadow root's host, a full-screen element) in place of `<body>`.
|
|
115
|
+
*/
|
|
116
|
+
const PortalProvider = defineComponent({
|
|
117
|
+
name: "PortalProvider",
|
|
118
|
+
props: { container: {
|
|
119
|
+
type: null,
|
|
120
|
+
default: void 0
|
|
121
|
+
} },
|
|
122
|
+
setup(props, { slots }) {
|
|
123
|
+
provide(PORTAL_CONTAINER, () => props.container);
|
|
124
|
+
return () => slots.default?.();
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
/** Its slot in a container at the end of the page, while `mounted`. */
|
|
128
|
+
function portalComponent(name, mounted) {
|
|
129
|
+
return defineComponent({
|
|
130
|
+
name,
|
|
131
|
+
setup(_props, { slots }) {
|
|
132
|
+
const shown = fromSignal(mounted());
|
|
133
|
+
const container = inject(PORTAL_CONTAINER, void 0);
|
|
134
|
+
const ready = shallowRef(false);
|
|
135
|
+
onMounted(() => {
|
|
136
|
+
ready.value = true;
|
|
137
|
+
});
|
|
138
|
+
return () => shown.value && ready.value ? h(Teleport, { to: container?.() ?? "body" }, h("div", { "data-kirana-portal": "" }, slots.default?.())) : null;
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
/** A prop that is "not given" when absent, where Vue would make a boolean `false`. */
|
|
143
|
+
const optional = (type) => ({
|
|
144
|
+
type,
|
|
145
|
+
default: void 0
|
|
146
|
+
});
|
|
147
|
+
export { PortalProvider, context, controller, fromSignal, optional, partComponent, portalComponent, toSignal };
|
|
148
|
+
|
|
149
|
+
//# sourceMappingURL=runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.js","names":[],"sources":["../../../../packages/vue/src/runtime.ts"],"sourcesContent":["import { mergeProps, sameProps, signal } from \"@kirana-ui/core\"\nimport type { Part, PartProps, ReadonlySignal } from \"@kirana-ui/core\"\nimport {\n Comment,\n Fragment,\n Teleport,\n cloneVNode,\n defineComponent,\n h,\n inject,\n onBeforeUnmount,\n onMounted,\n onScopeDispose,\n provide,\n queuePostFlushCb,\n shallowRef,\n watchEffect,\n} from \"vue\"\nimport type { Component, InjectionKey, PropType, ShallowRef, VNode } from \"vue\"\n\n/** A core signal as a Vue ref, read-only: tracked by whatever reads `.value`. */\nexport function fromSignal<T>(source: ReadonlySignal<T>): Readonly<ShallowRef<T>> {\n const ref = shallowRef(source.peek())\n // On a server nothing changes after the first read, and no scope is disposed to unsubscribe.\n if (typeof window !== \"undefined\") {\n onScopeDispose(\n source.subscribe(() => {\n ref.value = source.peek()\n })\n )\n }\n return ref\n}\n\n/** A core signal that follows Vue state: the core hears a changed prop as it changes. */\nexport function toSignal<T extends Record<string, unknown>>(read: () => T): ReadonlySignal<T> {\n const source = signal(read(), sameProps as (a: T, b: T) => boolean)\n watchEffect(() => source.set(read()), { flush: \"sync\" })\n return source\n}\n\n/** A component's controller, made once, following its props. */\nexport function controller<P extends Record<string, unknown>, C extends { mount(): () => void }>(\n create: (props: ReadonlySignal<P>) => C,\n read: () => P\n): C {\n const made = create(toSignal(read))\n let stop: (() => void) | undefined\n onMounted(() => {\n stop = made.mount()\n })\n onBeforeUnmount(() => stop?.())\n return made\n}\n\n/** A controller its parts find: `provide` in the root, `use` in a part. */\nexport function context<C>(name: string): { provide(controller: C): C; use(): C } {\n const key: InjectionKey<C> = Symbol(name)\n return {\n provide(made) {\n provide(key, made)\n return made\n },\n use() {\n const made = inject(key, undefined)\n if (!made) throw new Error(`A ${name} part must be inside <${name}.Root>`)\n return made\n },\n }\n}\n\nfunction toVue(props: PartProps): PartProps {\n const out: PartProps = {}\n for (const key in props) {\n const value = props[key]\n if (typeof value === \"function\") {\n // Vue names an event from the listener's key, so `onKeyDown` would listen for `key-down`:\n // it is `onKeydown`. Focus and blur are the bubbling ones, as in the core.\n const name = key.slice(2).toLowerCase()\n const event = name === \"focus\" ? \"focusin\" : name === \"blur\" ? \"focusout\" : name\n out[`on${event[0]!.toUpperCase()}${event.slice(1)}`] = value\n } else {\n out[key] = value\n }\n }\n return out\n}\n\nfunction firstElement(nodes: VNode[] | undefined): VNode | undefined {\n for (const node of nodes ?? []) {\n if (node.type === Comment) continue\n if (node.type === Fragment) return firstElement(node.children as VNode[])\n return node\n }\n return undefined\n}\n\n/**\n * A part as a component: its element (`as`, the part's own tag by default), or with `as-child`\n * the caller's own element in its slot, which takes the part's props. Either way the caller's\n * attributes are merged under the part's, and the part's DOM work is attached to the element.\n */\nexport function partComponent(name: string, tag: string, resolve: () => Part): Component {\n return defineComponent({\n name,\n inheritAttrs: false,\n props: { as: { type: String, default: tag }, asChild: Boolean },\n setup(props, { attrs, slots }) {\n const part = resolve()\n const own = fromSignal(part.props)\n let element: HTMLElement | null = null\n let detach: (() => void) | undefined\n\n // Vue calls a function ref as soon as the element exists, before the tree it is in reaches\n // the page: the part's DOM work (focus, measures, the starting style) waits for the flush\n // that follows the render, when it is there. An element that leaves detaches at once.\n let wanted: HTMLElement | null = null\n const sync = () => {\n if (wanted === element) return\n detach?.()\n element = wanted\n detach = wanted ? part.attach(wanted) : undefined\n }\n const attach = (target: unknown) => {\n // On a component (`as-child` over one), the ref is its instance: its root element, or\n // with several roots the first element after the fragment's own mark.\n let found: unknown =\n target instanceof HTMLElement ? target : (target as { $el?: unknown } | null)?.$el\n while (found instanceof Node && !(found instanceof HTMLElement)) found = found.nextSibling\n wanted = found instanceof HTMLElement ? found : null\n if (wanted) queuePostFlushCb(sync)\n else sync()\n }\n\n return () => {\n const merged = { ...mergeProps(attrs, toVue(own.value)), ref: attach }\n if (props.asChild) {\n const child = firstElement(slots.default?.())\n return child ? cloneVNode(child, merged, true) : null\n }\n return h(props.as, merged, slots.default?.())\n }\n },\n })\n}\n\nconst PORTAL_CONTAINER: InjectionKey<() => HTMLElement | null | undefined> =\n Symbol(\"PortalContainer\")\n\n/**\n * Says where every popup inside it is drawn, the popups those open included: an element of\n * the page (a shadow root's host, a full-screen element) in place of `<body>`.\n */\nexport const PortalProvider = defineComponent({\n name: \"PortalProvider\",\n props: {\n container: { type: null as unknown as PropType<HTMLElement | null>, default: undefined },\n },\n setup(props, { slots }) {\n provide(PORTAL_CONTAINER, () => props.container)\n return () => slots.default?.()\n },\n})\n\n/** Its slot in a container at the end of the page, while `mounted`. */\nexport function portalComponent(name: string, mounted: () => ReadonlySignal<boolean>): Component {\n return defineComponent({\n name,\n setup(_props, { slots }) {\n const shown = fromSignal(mounted())\n const container = inject(PORTAL_CONTAINER, undefined)\n // Only in a browser, once the page is in it: a server draws no portal, so hydration must\n // find none either. One that opens later is drawn at once.\n const ready = shallowRef(false)\n onMounted(() => {\n ready.value = true\n })\n return () =>\n shown.value && ready.value\n ? h(\n Teleport,\n { to: container?.() ?? \"body\" },\n h(\"div\", { \"data-kirana-portal\": \"\" }, slots.default?.())\n )\n : null\n },\n })\n}\n\n/** A prop that is \"not given\" when absent, where Vue would make a boolean `false`. */\nexport const optional = <T>(type: T) => ({ type, default: undefined })\n"],"mappings":";;;;AAqBA,SAAgB,WAAc,QAAoD;CAChF,MAAM,MAAM,WAAW,OAAO,KAAK,C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U;CAC/B;AACF,CAAC;;AAGD,SAAgB,gBAAgB,MAAc,SAAmD;CAC/F,OAAO,gBAAgB;EACrB;EACA,MAAM,QAAQ,EAAE,SAAS;GACvB,MAAM,QAAQ,WAAW,QAAQ,CAAC;GAClC,MAAM,YAAY,OAAO,kBAAkB,KAAA,CAAS;GAGpD,MAAM,QAAQ,WAAW,KAAK;GAC9B,gBAAgB;IACd,MAAM,QAAQ;GAChB,CAAC;GACD,aACE,MAAM,SAAS,MAAM,QACjB,EACE,UACA,EAAE,IAAI,YAAY,KAAK,OAAO,GAC9B,EAAE,OAAO,EAAE,sBAAsB,GAAG,GAAG,MAAM,UAAU,CAAC,CAC1D,IACA;EACR;CACF,CAAC;AACH;;AAGA,MAAa,YAAe,UAAa;CAAE;CAAM,SAAS,KAAA;AAAU"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Orientation } from "@kirana-ui/core";
|
|
2
|
+
import { PropType } from "vue";
|
|
3
|
+
export declare const ScrollArea: {
|
|
4
|
+
Root: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
7
|
+
Viewport: import("vue").Component;
|
|
8
|
+
Content: import("vue").Component;
|
|
9
|
+
Scrollbar: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
10
|
+
orientation: {
|
|
11
|
+
type: PropType<Orientation>;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
keepMounted: BooleanConstructor;
|
|
15
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
18
|
+
orientation: {
|
|
19
|
+
type: PropType<Orientation>;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
keepMounted: BooleanConstructor;
|
|
23
|
+
}>> & Readonly<{}>, {
|
|
24
|
+
orientation: Orientation;
|
|
25
|
+
keepMounted: boolean;
|
|
26
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
27
|
+
Thumb: import("vue").Component;
|
|
28
|
+
Corner: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=scroll-area.d.ts.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { useDirectionAround } from "./direction-context.js";
|
|
2
|
+
import { context, controller, fromSignal, partComponent } from "./runtime.js";
|
|
3
|
+
import { within } from "@kirana-ui/core";
|
|
4
|
+
import { defineComponent, h, inject, provide } from "vue";
|
|
5
|
+
import { createScrollArea } from "@kirana-ui/core/scroll-area";
|
|
6
|
+
// src/scroll-area.ts
|
|
7
|
+
const scope = context("ScrollArea");
|
|
8
|
+
const SCROLLBAR = Symbol("ScrollAreaScrollbar");
|
|
9
|
+
const Root = defineComponent({
|
|
10
|
+
name: "ScrollAreaRoot",
|
|
11
|
+
inheritAttrs: false,
|
|
12
|
+
setup(_props, { attrs, slots }) {
|
|
13
|
+
const direction = useDirectionAround();
|
|
14
|
+
const made = scope.provide(controller(within(createScrollArea, { direction }), () => ({})));
|
|
15
|
+
const Element = partComponent("ScrollAreaRootElement", "div", () => made.root);
|
|
16
|
+
return () => h(Element, attrs, slots);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
/** `orientation` is which way it scrolls (`vertical` by default). */
|
|
20
|
+
const Scrollbar = defineComponent({
|
|
21
|
+
name: "ScrollAreaScrollbar",
|
|
22
|
+
inheritAttrs: false,
|
|
23
|
+
props: {
|
|
24
|
+
orientation: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: "vertical"
|
|
27
|
+
},
|
|
28
|
+
keepMounted: Boolean
|
|
29
|
+
},
|
|
30
|
+
setup(props, { attrs, slots }) {
|
|
31
|
+
const bar = scope.use().scrollbar(props.orientation);
|
|
32
|
+
provide(SCROLLBAR, bar);
|
|
33
|
+
const shown = fromSignal(bar.shown);
|
|
34
|
+
const Element = partComponent("ScrollAreaScrollbarElement", "div", () => bar.part);
|
|
35
|
+
return () => shown.value || props.keepMounted ? h(Element, attrs, slots) : null;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
const Thumb = partComponent("ScrollAreaThumb", "div", () => {
|
|
39
|
+
const bar = inject(SCROLLBAR, void 0);
|
|
40
|
+
if (!bar) throw new Error("A ScrollArea.Thumb must be inside <ScrollArea.Scrollbar>");
|
|
41
|
+
return bar.thumb;
|
|
42
|
+
});
|
|
43
|
+
const Corner = defineComponent({
|
|
44
|
+
name: "ScrollAreaCorner",
|
|
45
|
+
inheritAttrs: false,
|
|
46
|
+
setup(_props, { attrs, slots }) {
|
|
47
|
+
const { corner } = scope.use();
|
|
48
|
+
const shown = fromSignal(corner.shown);
|
|
49
|
+
const Element = partComponent("ScrollAreaCornerElement", "div", () => corner.part);
|
|
50
|
+
return () => shown.value ? h(Element, attrs, slots) : null;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
const ScrollArea = {
|
|
54
|
+
Root,
|
|
55
|
+
Viewport: partComponent("ScrollAreaViewport", "div", () => scope.use().viewport),
|
|
56
|
+
Content: partComponent("ScrollAreaContent", "div", () => scope.use().content),
|
|
57
|
+
Scrollbar,
|
|
58
|
+
Thumb,
|
|
59
|
+
Corner
|
|
60
|
+
};
|
|
61
|
+
export { ScrollArea };
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=scroll-area.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-area.js","names":[],"sources":["../../../../packages/vue/src/scroll-area.ts"],"sourcesContent":["import { within } from \"@kirana-ui/core\"\nimport type { Orientation } from \"@kirana-ui/core\"\nimport { createScrollArea } from \"@kirana-ui/core/scroll-area\"\nimport type { ScrollArea as Controller, ScrollAreaScrollbar } from \"@kirana-ui/core/scroll-area\"\nimport { defineComponent, h, inject, provide } from \"vue\"\nimport type { InjectionKey, PropType } from \"vue\"\n\nimport { useDirectionAround } from \"./direction-context.ts\"\nimport { context, controller, fromSignal, partComponent } from \"./runtime.ts\"\n\nconst scope = context<Controller>(\"ScrollArea\")\nconst SCROLLBAR: InjectionKey<ScrollAreaScrollbar> = Symbol(\"ScrollAreaScrollbar\")\n\nconst Root = defineComponent({\n name: \"ScrollAreaRoot\",\n inheritAttrs: false,\n setup(_props, { attrs, slots }) {\n const direction = useDirectionAround()\n const made = scope.provide(controller(within(createScrollArea, { direction }), () => ({})))\n const Element = partComponent(\"ScrollAreaRootElement\", \"div\", () => made.root)\n return () => h(Element, attrs, slots)\n },\n})\n\n/** `orientation` is which way it scrolls (`vertical` by default). */\nconst Scrollbar = defineComponent({\n name: \"ScrollAreaScrollbar\",\n inheritAttrs: false,\n props: {\n orientation: { type: String as PropType<Orientation>, default: \"vertical\" },\n keepMounted: Boolean,\n },\n setup(props, { attrs, slots }) {\n const bar = scope.use().scrollbar(props.orientation)\n provide(SCROLLBAR, bar)\n const shown = fromSignal(bar.shown)\n const Element = partComponent(\"ScrollAreaScrollbarElement\", \"div\", () => bar.part)\n return () => (shown.value || props.keepMounted ? h(Element, attrs, slots) : null)\n },\n})\n\nconst Thumb = partComponent(\"ScrollAreaThumb\", \"div\", () => {\n const bar = inject(SCROLLBAR, undefined)\n if (!bar) throw new Error(\"A ScrollArea.Thumb must be inside <ScrollArea.Scrollbar>\")\n return bar.thumb\n})\n\nconst Corner = defineComponent({\n name: \"ScrollAreaCorner\",\n inheritAttrs: false,\n setup(_props, { attrs, slots }) {\n const { corner } = scope.use()\n const shown = fromSignal(corner.shown)\n const Element = partComponent(\"ScrollAreaCornerElement\", \"div\", () => corner.part)\n return () => (shown.value ? h(Element, attrs, slots) : null)\n },\n})\n\nexport const ScrollArea = {\n Root,\n Viewport: partComponent(\"ScrollAreaViewport\", \"div\", () => scope.use().viewport),\n Content: partComponent(\"ScrollAreaContent\", \"div\", () => scope.use().content),\n Scrollbar,\n Thumb,\n Corner,\n}\n"],"mappings":";;;;;;AAUA,MAAM,QAAQ,QAAoB,YAAY;AAC9C,MAAM,YAA+C,OAAO,qBAAqB;AAEjF,MAAM,OAAO,gBAAgB;CAC3B,MAAM;CACN,cAAc;CACd,MAAM,QAAQ,EAAE,OAAO,SAAS;EAC9B,MAAM,YAAY,mBAAmB;EACrC,MAAM,OAAO,MAAM,QAAQ,WAAW,OAAO,kBAAkB,EAAE,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;EAC1F,MAAM,UAAU,cAAc,yBAAyB,aAAa,KAAK,IAAI;EAC7E,aAAa,EAAE,SAAS,OAAO,KAAK;CACtC;AACF,CAAC;;AAGD,MAAM,YAAY,gBAAgB;CAChC,MAAM;CACN,cAAc;CACd,OAAO;EACL,aAAa;GAAE,MAAM;GAAiC,SAAS;EAAW;EAC1E,aAAa;CACf;CACA,MAAM,OAAO,EAAE,OAAO,SAAS;EAC7B,MAAM,MAAM,MAAM,IAAI,CAAC,CAAC,UAAU,MAAM,WAAW;EACnD,QAAQ,WAAW,GAAG;EACtB,MAAM,QAAQ,WAAW,IAAI,KAAK;EAClC,MAAM,UAAU,cAAc,8BAA8B,aAAa,IAAI,IAAI;EACjF,aAAc,MAAM,SAAS,MAAM,cAAc,EAAE,SAAS,OAAO,KAAK,IAAI;CAC9E;AACF,CAAC;AAED,MAAM,QAAQ,cAAc,mBAAmB,aAAa;CAC1D,MAAM,MAAM,OAAO,WAAW,KAAA,CAAS;CACvC,IAAI,CAAC,KAAK,MAAM,IAAI,MAAM,0DAA0D;CACpF,OAAO,IAAI;AACb,CAAC;AAED,MAAM,SAAS,gBAAgB;CAC7B,MAAM;CACN,cAAc;CACd,MAAM,QAAQ,EAAE,OAAO,SAAS;EAC9B,MAAM,EAAE,WAAW,MAAM,IAAI;EAC7B,MAAM,QAAQ,WAAW,OAAO,KAAK;EACrC,MAAM,UAAU,cAAc,2BAA2B,aAAa,OAAO,IAAI;EACjF,aAAc,MAAM,QAAQ,EAAE,SAAS,OAAO,KAAK,IAAI;CACzD;AACF,CAAC;AAED,MAAa,aAAa;CACxB;CACA,UAAU,cAAc,sBAAsB,aAAa,MAAM,IAAI,CAAC,CAAC,QAAQ;CAC/E,SAAS,cAAc,qBAAqB,aAAa,MAAM,IAAI,CAAC,CAAC,OAAO;CAC5E;CACA;CACA;AACF"}
|
package/src/select.d.ts
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { PropType } from "vue";
|
|
2
|
+
import { SelectProps } from "@kirana-ui/core/select";
|
|
3
|
+
export declare const Select: {
|
|
4
|
+
Root: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
|
+
value: {
|
|
6
|
+
type: PropType<unknown>;
|
|
7
|
+
default: unknown;
|
|
8
|
+
};
|
|
9
|
+
defaultValue: {
|
|
10
|
+
type: PropType<unknown>;
|
|
11
|
+
default: unknown;
|
|
12
|
+
};
|
|
13
|
+
open: {
|
|
14
|
+
type: BooleanConstructor;
|
|
15
|
+
default: undefined;
|
|
16
|
+
};
|
|
17
|
+
defaultOpen: BooleanConstructor;
|
|
18
|
+
disabled: BooleanConstructor;
|
|
19
|
+
required: BooleanConstructor;
|
|
20
|
+
name: StringConstructor;
|
|
21
|
+
form: StringConstructor;
|
|
22
|
+
items: PropType<readonly {
|
|
23
|
+
value: unknown;
|
|
24
|
+
label: string;
|
|
25
|
+
}[]>;
|
|
26
|
+
virtualized: PropType<SelectProps["virtualized"]>;
|
|
27
|
+
id: StringConstructor;
|
|
28
|
+
}>, () => (import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}>[] | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
31
|
+
[key: string]: any;
|
|
32
|
+
}> | null | undefined)[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("openChange" | "update:open" | "update:value" | "valueChange")[], "openChange" | "update:open" | "update:value" | "valueChange", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
33
|
+
value: {
|
|
34
|
+
type: PropType<unknown>;
|
|
35
|
+
default: unknown;
|
|
36
|
+
};
|
|
37
|
+
defaultValue: {
|
|
38
|
+
type: PropType<unknown>;
|
|
39
|
+
default: unknown;
|
|
40
|
+
};
|
|
41
|
+
open: {
|
|
42
|
+
type: BooleanConstructor;
|
|
43
|
+
default: undefined;
|
|
44
|
+
};
|
|
45
|
+
defaultOpen: BooleanConstructor;
|
|
46
|
+
disabled: BooleanConstructor;
|
|
47
|
+
required: BooleanConstructor;
|
|
48
|
+
name: StringConstructor;
|
|
49
|
+
form: StringConstructor;
|
|
50
|
+
items: PropType<readonly {
|
|
51
|
+
value: unknown;
|
|
52
|
+
label: string;
|
|
53
|
+
}[]>;
|
|
54
|
+
virtualized: PropType<SelectProps["virtualized"]>;
|
|
55
|
+
id: StringConstructor;
|
|
56
|
+
}>> & Readonly<{
|
|
57
|
+
onOpenChange?: ((...args: any[]) => any) | undefined;
|
|
58
|
+
"onUpdate:open"?: ((...args: any[]) => any) | undefined;
|
|
59
|
+
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
60
|
+
onValueChange?: ((...args: any[]) => any) | undefined;
|
|
61
|
+
}>, {
|
|
62
|
+
value: unknown;
|
|
63
|
+
defaultValue: unknown;
|
|
64
|
+
open: boolean;
|
|
65
|
+
defaultOpen: boolean;
|
|
66
|
+
disabled: boolean;
|
|
67
|
+
required: boolean;
|
|
68
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
69
|
+
Trigger: import("vue").Component;
|
|
70
|
+
Value: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
71
|
+
placeholder: {
|
|
72
|
+
type: StringConstructor;
|
|
73
|
+
default: string;
|
|
74
|
+
};
|
|
75
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
76
|
+
[key: string]: any;
|
|
77
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
78
|
+
placeholder: {
|
|
79
|
+
type: StringConstructor;
|
|
80
|
+
default: string;
|
|
81
|
+
};
|
|
82
|
+
}>> & Readonly<{}>, {
|
|
83
|
+
placeholder: string;
|
|
84
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
85
|
+
Portal: import("vue").Component;
|
|
86
|
+
Positioner: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
87
|
+
alignItemWithTrigger: BooleanConstructor;
|
|
88
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
89
|
+
[key: string]: any;
|
|
90
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
91
|
+
alignItemWithTrigger: BooleanConstructor;
|
|
92
|
+
}>> & Readonly<{}>, {
|
|
93
|
+
alignItemWithTrigger: boolean;
|
|
94
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
95
|
+
Popup: import("vue").Component;
|
|
96
|
+
/** The items' own box inside the popup, when the popup also holds scroll arrows. */
|
|
97
|
+
List: import("vue").Component;
|
|
98
|
+
/** In the page while there is more of the list above: it scrolls it under a moving pointer. */
|
|
99
|
+
ScrollUpArrow: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
100
|
+
[key: string]: any;
|
|
101
|
+
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
102
|
+
/** In the page while there is more of the list below. */
|
|
103
|
+
ScrollDownArrow: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
104
|
+
[key: string]: any;
|
|
105
|
+
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
106
|
+
Group: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
107
|
+
id: StringConstructor;
|
|
108
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
109
|
+
[key: string]: any;
|
|
110
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
111
|
+
id: StringConstructor;
|
|
112
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
113
|
+
GroupLabel: import("vue").Component;
|
|
114
|
+
/** A line between groups. */
|
|
115
|
+
Separator: import("vue").Component;
|
|
116
|
+
Item: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
117
|
+
value: {
|
|
118
|
+
type: PropType<unknown>;
|
|
119
|
+
required: true;
|
|
120
|
+
};
|
|
121
|
+
disabled: {
|
|
122
|
+
type: BooleanConstructor;
|
|
123
|
+
default: undefined;
|
|
124
|
+
};
|
|
125
|
+
label: StringConstructor;
|
|
126
|
+
index: NumberConstructor;
|
|
127
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
128
|
+
[key: string]: any;
|
|
129
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
130
|
+
value: {
|
|
131
|
+
type: PropType<unknown>;
|
|
132
|
+
required: true;
|
|
133
|
+
};
|
|
134
|
+
disabled: {
|
|
135
|
+
type: BooleanConstructor;
|
|
136
|
+
default: undefined;
|
|
137
|
+
};
|
|
138
|
+
label: StringConstructor;
|
|
139
|
+
index: NumberConstructor;
|
|
140
|
+
}>> & Readonly<{}>, {
|
|
141
|
+
disabled: boolean;
|
|
142
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
143
|
+
ItemText: import("vue").Component;
|
|
144
|
+
ItemIndicator: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
145
|
+
keepMounted: BooleanConstructor;
|
|
146
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
147
|
+
[key: string]: any;
|
|
148
|
+
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
149
|
+
keepMounted: BooleanConstructor;
|
|
150
|
+
}>> & Readonly<{}>, {
|
|
151
|
+
keepMounted: boolean;
|
|
152
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
153
|
+
};
|
|
154
|
+
//# sourceMappingURL=select.d.ts.map
|
package/src/select.js
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { positionerComponent } from "./popover.js";
|
|
2
|
+
import { useFieldAround } from "./field-context.js";
|
|
3
|
+
import { context, controller, fromSignal, optional, partComponent, portalComponent, toSignal } from "./runtime.js";
|
|
4
|
+
import { defined, within } from "@kirana-ui/core";
|
|
5
|
+
import { defineComponent, h, inject, onBeforeUnmount, onMounted, provide, useId, watchEffect } from "vue";
|
|
6
|
+
import { createSelect } from "@kirana-ui/core/select";
|
|
7
|
+
// src/select.ts
|
|
8
|
+
const scope = context("Select");
|
|
9
|
+
const ITEM = Symbol("SelectItem");
|
|
10
|
+
const HiddenInput = partComponent("SelectHiddenInput", "input", () => scope.use().input);
|
|
11
|
+
/** `v-model:value`, `v-model:open`; `@value-change` and `@open-change` carry the details. */
|
|
12
|
+
const Root = defineComponent({
|
|
13
|
+
name: "SelectRoot",
|
|
14
|
+
props: {
|
|
15
|
+
value: {
|
|
16
|
+
type: null,
|
|
17
|
+
default: void 0
|
|
18
|
+
},
|
|
19
|
+
defaultValue: {
|
|
20
|
+
type: null,
|
|
21
|
+
default: null
|
|
22
|
+
},
|
|
23
|
+
open: optional(Boolean),
|
|
24
|
+
defaultOpen: Boolean,
|
|
25
|
+
disabled: Boolean,
|
|
26
|
+
required: Boolean,
|
|
27
|
+
name: String,
|
|
28
|
+
form: String,
|
|
29
|
+
items: Array,
|
|
30
|
+
virtualized: Object,
|
|
31
|
+
id: String
|
|
32
|
+
},
|
|
33
|
+
emits: [
|
|
34
|
+
"update:value",
|
|
35
|
+
"valueChange",
|
|
36
|
+
"update:open",
|
|
37
|
+
"openChange"
|
|
38
|
+
],
|
|
39
|
+
setup(props, { slots, emit }) {
|
|
40
|
+
const generated = useId();
|
|
41
|
+
const field = useFieldAround();
|
|
42
|
+
const made = scope.provide(controller(within(createSelect, { field }), () => ({
|
|
43
|
+
id: props.id ?? generated,
|
|
44
|
+
value: props.value,
|
|
45
|
+
defaultValue: props.defaultValue,
|
|
46
|
+
open: props.open,
|
|
47
|
+
defaultOpen: props.defaultOpen,
|
|
48
|
+
disabled: props.disabled,
|
|
49
|
+
required: props.required,
|
|
50
|
+
name: props.name,
|
|
51
|
+
form: props.form,
|
|
52
|
+
items: props.items,
|
|
53
|
+
virtualized: props.virtualized,
|
|
54
|
+
onValueChange(value, details) {
|
|
55
|
+
emit("valueChange", value, details);
|
|
56
|
+
if (!details.canceled) emit("update:value", value);
|
|
57
|
+
},
|
|
58
|
+
onOpenChange(open, details) {
|
|
59
|
+
emit("openChange", open, details);
|
|
60
|
+
if (!details.canceled) emit("update:open", open);
|
|
61
|
+
}
|
|
62
|
+
})));
|
|
63
|
+
const named = fromSignal(made.named);
|
|
64
|
+
return () => [slots.default?.(), named.value ? h(HiddenInput) : null];
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
const ValueElement = partComponent("SelectValueElement", "span", () => scope.use().valuePart);
|
|
68
|
+
/** Shows the chosen value's label, or `placeholder` while nothing is chosen. */
|
|
69
|
+
const Value = defineComponent({
|
|
70
|
+
name: "SelectValue",
|
|
71
|
+
inheritAttrs: false,
|
|
72
|
+
props: { placeholder: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: ""
|
|
75
|
+
} },
|
|
76
|
+
setup(props, { attrs, slots }) {
|
|
77
|
+
const label = fromSignal(scope.use().label);
|
|
78
|
+
return () => h(ValueElement, attrs, slots.default ?? (() => label.value ?? props.placeholder));
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
/** `label` is what typeahead matches and the trigger shows; the item's text when left out. */
|
|
82
|
+
const Item = defineComponent({
|
|
83
|
+
name: "SelectItem",
|
|
84
|
+
inheritAttrs: false,
|
|
85
|
+
props: {
|
|
86
|
+
value: {
|
|
87
|
+
type: null,
|
|
88
|
+
required: true
|
|
89
|
+
},
|
|
90
|
+
disabled: optional(Boolean),
|
|
91
|
+
label: String,
|
|
92
|
+
index: Number
|
|
93
|
+
},
|
|
94
|
+
setup(props, { attrs, slots }) {
|
|
95
|
+
const value = props.value;
|
|
96
|
+
const options = toSignal(() => ({
|
|
97
|
+
disabled: props.disabled,
|
|
98
|
+
label: props.label,
|
|
99
|
+
index: props.index
|
|
100
|
+
}));
|
|
101
|
+
const part = scope.use().item(value, () => defined(options.get()));
|
|
102
|
+
provide(ITEM, value);
|
|
103
|
+
const Element = partComponent("SelectItemElement", "div", () => part);
|
|
104
|
+
return () => h(Element, attrs, slots);
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
const ItemText = partComponent("SelectItemText", "span", () => scope.use().itemText(inject(ITEM)));
|
|
108
|
+
const ItemIndicator = defineComponent({
|
|
109
|
+
name: "SelectItemIndicator",
|
|
110
|
+
inheritAttrs: false,
|
|
111
|
+
props: { keepMounted: Boolean },
|
|
112
|
+
setup(props, { attrs, slots }) {
|
|
113
|
+
const value = inject(ITEM);
|
|
114
|
+
const made = scope.use();
|
|
115
|
+
const selected = fromSignal(made.selected(value));
|
|
116
|
+
const Element = partComponent("SelectItemIndicatorElement", "span", () => made.itemIndicator(value));
|
|
117
|
+
return () => selected.value || props.keepMounted ? h(Element, attrs, slots) : null;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
const PlacedPositioner = positionerComponent("SelectPlacedPositioner", () => scope.use(), partComponent("SelectPositionerElement", "div", () => scope.use().positioner));
|
|
121
|
+
/**
|
|
122
|
+
* `align-item-with-trigger`: the list opens over its trigger, the chosen item's text on the
|
|
123
|
+
* trigger's own, where there is room and unless a finger opened it.
|
|
124
|
+
*/
|
|
125
|
+
const Positioner = defineComponent({
|
|
126
|
+
name: "SelectPositioner",
|
|
127
|
+
inheritAttrs: false,
|
|
128
|
+
props: { alignItemWithTrigger: Boolean },
|
|
129
|
+
setup(props, { attrs, slots }) {
|
|
130
|
+
const made = scope.use();
|
|
131
|
+
watchEffect(() => made.alignItemWithTrigger.set(props.alignItemWithTrigger), { flush: "sync" });
|
|
132
|
+
return () => h(PlacedPositioner, attrs, slots);
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
const GROUP = Symbol("SelectGroup");
|
|
136
|
+
/** Items that belong together, named by their `<Select.GroupLabel>`. */
|
|
137
|
+
const Group = defineComponent({
|
|
138
|
+
name: "SelectGroup",
|
|
139
|
+
inheritAttrs: false,
|
|
140
|
+
props: { id: String },
|
|
141
|
+
setup(props, { attrs, slots }) {
|
|
142
|
+
const generated = useId();
|
|
143
|
+
const group = scope.use().group(props.id ?? generated);
|
|
144
|
+
provide(GROUP, group);
|
|
145
|
+
const Element = partComponent("SelectGroupElement", "div", () => group.root);
|
|
146
|
+
return () => h(Element, attrs, slots);
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
/** Names the group it is in. With no group around it, it is plain text. */
|
|
150
|
+
const GroupLabel = partComponent("SelectGroupLabel", "div", () => inject(GROUP, null)?.label ?? scope.use().groupLabel);
|
|
151
|
+
function scrollArrow(name, direction) {
|
|
152
|
+
return defineComponent({
|
|
153
|
+
name,
|
|
154
|
+
inheritAttrs: false,
|
|
155
|
+
setup(_props, { attrs, slots }) {
|
|
156
|
+
const arrow = scope.use().scrollArrow(direction);
|
|
157
|
+
let stop;
|
|
158
|
+
onMounted(() => {
|
|
159
|
+
stop = arrow.mount();
|
|
160
|
+
});
|
|
161
|
+
onBeforeUnmount(() => stop?.());
|
|
162
|
+
const mounted = fromSignal(arrow.mounted);
|
|
163
|
+
const Element = partComponent(`${name}Element`, "div", () => arrow.part);
|
|
164
|
+
return () => mounted.value ? h(Element, attrs, slots) : null;
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
const Select = {
|
|
169
|
+
Root,
|
|
170
|
+
Trigger: partComponent("SelectTrigger", "button", () => scope.use().trigger),
|
|
171
|
+
Value,
|
|
172
|
+
Portal: portalComponent("SelectPortal", () => scope.use().mounted),
|
|
173
|
+
Positioner,
|
|
174
|
+
Popup: partComponent("SelectPopup", "div", () => scope.use().popup),
|
|
175
|
+
/** The items' own box inside the popup, when the popup also holds scroll arrows. */
|
|
176
|
+
List: partComponent("SelectList", "div", () => scope.use().list),
|
|
177
|
+
/** In the page while there is more of the list above: it scrolls it under a moving pointer. */
|
|
178
|
+
ScrollUpArrow: scrollArrow("SelectScrollUpArrow", "up"),
|
|
179
|
+
/** In the page while there is more of the list below. */
|
|
180
|
+
ScrollDownArrow: scrollArrow("SelectScrollDownArrow", "down"),
|
|
181
|
+
Group,
|
|
182
|
+
GroupLabel,
|
|
183
|
+
/** A line between groups. */
|
|
184
|
+
Separator: partComponent("SelectSeparator", "div", () => scope.use().separator),
|
|
185
|
+
Item,
|
|
186
|
+
ItemText,
|
|
187
|
+
ItemIndicator
|
|
188
|
+
};
|
|
189
|
+
export { Select };
|
|
190
|
+
|
|
191
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.js","names":[],"sources":["../../../../packages/vue/src/select.ts"],"sourcesContent":["import { defined, within } from \"@kirana-ui/core\"\nimport type { ChangeDetails } from \"@kirana-ui/core\"\nimport { createSelect } from \"@kirana-ui/core/select\"\nimport type { Select as Controller, SelectGroup, SelectProps } from \"@kirana-ui/core/select\"\nimport {\n defineComponent,\n h,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n useId,\n watchEffect,\n} from \"vue\"\nimport type { InjectionKey, PropType } from \"vue\"\n\nimport { positionerComponent } from \"./popover.ts\"\nimport { useFieldAround } from \"./field-context.ts\"\nimport {\n context,\n controller,\n fromSignal,\n optional,\n partComponent,\n portalComponent,\n toSignal,\n} from \"./runtime.ts\"\n\nconst scope = context<Controller>(\"Select\")\nconst ITEM: InjectionKey<unknown> = Symbol(\"SelectItem\")\n\nconst HiddenInput = partComponent(\"SelectHiddenInput\", \"input\", () => scope.use().input)\n\n/** `v-model:value`, `v-model:open`; `@value-change` and `@open-change` carry the details. */\nconst Root = defineComponent({\n name: \"SelectRoot\",\n props: {\n value: { type: null as unknown as PropType<unknown>, default: undefined as unknown },\n defaultValue: { type: null as unknown as PropType<unknown>, default: null as unknown },\n open: optional(Boolean),\n defaultOpen: Boolean,\n disabled: Boolean,\n required: Boolean,\n name: String,\n form: String,\n items: Array as PropType<readonly { value: unknown; label: string }[]>,\n virtualized: Object as PropType<SelectProps[\"virtualized\"]>,\n id: String,\n },\n emits: [\"update:value\", \"valueChange\", \"update:open\", \"openChange\"],\n setup(props, { slots, emit }) {\n const generated = useId()\n const field = useFieldAround()\n const made = scope.provide(\n controller(within(createSelect, { field }), () => ({\n id: props.id ?? generated,\n value: props.value,\n defaultValue: props.defaultValue,\n open: props.open,\n defaultOpen: props.defaultOpen,\n disabled: props.disabled,\n required: props.required,\n name: props.name,\n form: props.form,\n items: props.items,\n virtualized: props.virtualized,\n onValueChange(value: unknown, details: ChangeDetails) {\n emit(\"valueChange\", value, details)\n if (!details.canceled) emit(\"update:value\", value)\n },\n onOpenChange(open: boolean, details: ChangeDetails) {\n emit(\"openChange\", open, details)\n if (!details.canceled) emit(\"update:open\", open)\n },\n }))\n )\n const named = fromSignal(made.named)\n return () => [slots.default?.(), named.value ? h(HiddenInput) : null]\n },\n})\n\nconst ValueElement = partComponent(\"SelectValueElement\", \"span\", () => scope.use().valuePart)\n\n/** Shows the chosen value's label, or `placeholder` while nothing is chosen. */\nconst Value = defineComponent({\n name: \"SelectValue\",\n inheritAttrs: false,\n props: { placeholder: { type: String, default: \"\" } },\n setup(props, { attrs, slots }) {\n const label = fromSignal(scope.use().label)\n return () => h(ValueElement, attrs, slots.default ?? (() => label.value ?? props.placeholder))\n },\n})\n\n/** `label` is what typeahead matches and the trigger shows; the item's text when left out. */\nconst Item = defineComponent({\n name: \"SelectItem\",\n inheritAttrs: false,\n props: {\n value: { type: null as unknown as PropType<unknown>, required: true },\n disabled: optional(Boolean),\n label: String,\n index: Number,\n },\n setup(props, { attrs, slots }) {\n // An item is its value for as long as it is in the page.\n const value = props.value\n const options = toSignal(() => ({\n disabled: props.disabled,\n label: props.label,\n index: props.index,\n }))\n const part = scope.use().item(value, () => defined(options.get()))\n provide(ITEM, value)\n const Element = partComponent(\"SelectItemElement\", \"div\", () => part)\n return () => h(Element, attrs, slots)\n },\n})\n\nconst ItemText = partComponent(\"SelectItemText\", \"span\", () => scope.use().itemText(inject(ITEM)))\n\nconst ItemIndicator = defineComponent({\n name: \"SelectItemIndicator\",\n inheritAttrs: false,\n props: { keepMounted: Boolean },\n setup(props, { attrs, slots }) {\n const value = inject(ITEM)\n const made = scope.use()\n const selected = fromSignal(made.selected(value))\n const Element = partComponent(\"SelectItemIndicatorElement\", \"span\", () =>\n made.itemIndicator(value)\n )\n return () => (selected.value || props.keepMounted ? h(Element, attrs, slots) : null)\n },\n})\n\nconst PlacedPositioner = positionerComponent(\n \"SelectPlacedPositioner\",\n () => scope.use(),\n partComponent(\"SelectPositionerElement\", \"div\", () => scope.use().positioner)\n)\n\n/**\n * `align-item-with-trigger`: the list opens over its trigger, the chosen item's text on the\n * trigger's own, where there is room and unless a finger opened it.\n */\nconst Positioner = defineComponent({\n name: \"SelectPositioner\",\n inheritAttrs: false,\n props: { alignItemWithTrigger: Boolean },\n setup(props, { attrs, slots }) {\n const made = scope.use()\n watchEffect(() => made.alignItemWithTrigger.set(props.alignItemWithTrigger), {\n flush: \"sync\",\n })\n return () => h(PlacedPositioner, attrs, slots)\n },\n})\n\nconst GROUP: InjectionKey<SelectGroup | null> = Symbol(\"SelectGroup\")\n\n/** Items that belong together, named by their `<Select.GroupLabel>`. */\nconst Group = defineComponent({\n name: \"SelectGroup\",\n inheritAttrs: false,\n props: { id: String },\n setup(props, { attrs, slots }) {\n const generated = useId()\n const group = scope.use().group(props.id ?? generated)\n provide(GROUP, group)\n const Element = partComponent(\"SelectGroupElement\", \"div\", () => group.root)\n return () => h(Element, attrs, slots)\n },\n})\n\n/** Names the group it is in. With no group around it, it is plain text. */\nconst GroupLabel = partComponent(\n \"SelectGroupLabel\",\n \"div\",\n () => inject(GROUP, null)?.label ?? scope.use().groupLabel\n)\n\nfunction scrollArrow(name: string, direction: \"up\" | \"down\") {\n return defineComponent({\n name,\n inheritAttrs: false,\n setup(_props, { attrs, slots }) {\n const arrow = scope.use().scrollArrow(direction)\n let stop: (() => void) | undefined\n onMounted(() => {\n stop = arrow.mount()\n })\n onBeforeUnmount(() => stop?.())\n const mounted = fromSignal(arrow.mounted)\n const Element = partComponent(`${name}Element`, \"div\", () => arrow.part)\n return () => (mounted.value ? h(Element, attrs, slots) : null)\n },\n })\n}\n\nexport const Select = {\n Root,\n Trigger: partComponent(\"SelectTrigger\", \"button\", () => scope.use().trigger),\n Value,\n Portal: portalComponent(\"SelectPortal\", () => scope.use().mounted),\n Positioner,\n Popup: partComponent(\"SelectPopup\", \"div\", () => scope.use().popup),\n /** The items' own box inside the popup, when the popup also holds scroll arrows. */\n List: partComponent(\"SelectList\", \"div\", () => scope.use().list),\n /** In the page while there is more of the list above: it scrolls it under a moving pointer. */\n ScrollUpArrow: scrollArrow(\"SelectScrollUpArrow\", \"up\"),\n /** In the page while there is more of the list below. */\n ScrollDownArrow: scrollArrow(\"SelectScrollDownArrow\", \"down\"),\n Group,\n GroupLabel,\n /** A line between groups. */\n Separator: partComponent(\"SelectSeparator\", \"div\", () => scope.use().separator),\n Item,\n ItemText,\n ItemIndicator,\n}\n"],"mappings":";;;;;;;AA4BA,MAAM,QAAQ,QAAoB,QAAQ;AAC1C,MAAM,OAA8B,OAAO,YAAY;AAEvD,MAAM,cAAc,cAAc,qBAAqB,eAAe,MAAM,IAAI,CAAC,CAAC,KAAK;;AAGvF,MAAM,OAAO,gBAAgB;CAC3B,MAAM;CACN,OAAO;EACL,OAAO;GAAE,MAAM;GAAsC,SAAS,KAAA;EAAqB;EACnF,cAAc;GAAE,MAAM;GAAsC,SAAS;EAAgB;EACrF,MAAM,SAAS,OAAO;EACtB,aAAa;EACb,UAAU;EACV,UAAU;EACV,MAAM;EACN,MAAM;EACN,OAAO;EACP,aAAa;EACb,IAAI;CACN;CACA,OAAO;EAAC;EAAgB;EAAe;EAAe;CAAY;CAClE,MAAM,OAAO,EAAE,OAAO,QAAQ;EAC5B,MAAM,YAAY,MAAM;EACxB,MAAM,QAAQ,eAAe;EAC7B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AAC,CAAC,SAAS;CAC9E;CACA;CACA;AACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Orientation } from "@kirana-ui/core";
|
|
2
|
+
import { PropType } from "vue";
|
|
3
|
+
export declare const Separator: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
orientation: PropType<Orientation>;
|
|
5
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
8
|
+
orientation: PropType<Orientation>;
|
|
9
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
10
|
+
//# sourceMappingURL=separator.d.ts.map
|