@kirana-ui/vue 0.1.1 → 0.3.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/llms.txt +1867 -268
- package/package.json +18 -2
- package/skills/kirana-ui-primitives/SKILL.md +163 -0
- package/src/accordion.d.ts +42 -75
- package/src/accordion.js +4 -2
- package/src/accordion.js.map +1 -1
- package/src/agent.d.ts +1 -0
- package/src/agent.js +1 -0
- package/src/alert-dialog.d.ts +3 -2
- package/src/autocomplete.d.ts +4 -2
- package/src/autosize.d.ts +9 -9
- package/src/autosize.js.map +1 -1
- package/src/avatar.d.ts +37 -13
- package/src/avatar.js +39 -15
- package/src/avatar.js.map +1 -1
- package/src/button.d.ts +4 -21
- package/src/button.js.map +1 -1
- package/src/calendar.d.ts +71 -99
- package/src/calendar.js +81 -11
- package/src/calendar.js.map +1 -1
- package/src/carousel.d.ts +36 -58
- package/src/carousel.js.map +1 -1
- package/src/checkbox-group-context.d.ts +5 -0
- package/src/checkbox-group-context.js +6 -0
- package/src/checkbox-group-context.js.map +1 -0
- package/src/checkbox-group.d.ts +12 -0
- package/src/checkbox-group.js +44 -0
- package/src/checkbox-group.js.map +1 -0
- package/src/checkbox.d.ts +29 -50
- package/src/checkbox.js +11 -4
- package/src/checkbox.js.map +1 -1
- package/src/collapsible.d.ts +26 -36
- package/src/collapsible.js.map +1 -1
- package/src/combobox.d.ts +161 -290
- package/src/combobox.js +62 -4
- package/src/combobox.js.map +1 -1
- package/src/command.d.ts +43 -86
- package/src/command.js +2 -0
- package/src/command.js.map +1 -1
- package/src/context-menu.d.ts +4 -2
- package/src/date-field.d.ts +31 -61
- package/src/date-field.js +7 -3
- package/src/date-field.js.map +1 -1
- package/src/date-picker.d.ts +86 -139
- package/src/date-picker.js +12 -1
- package/src/date-picker.js.map +1 -1
- package/src/dialog.d.ts +93 -145
- package/src/dialog.js +7 -2
- package/src/dialog.js.map +1 -1
- package/src/direction.d.ts +5 -8
- package/src/direction.js.map +1 -1
- package/src/drawer.d.ts +3 -2
- package/src/element.d.ts +23 -0
- package/src/element.js +90 -0
- package/src/element.js.map +1 -0
- package/src/field.d.ts +63 -45
- package/src/field.js +3 -2
- package/src/field.js.map +1 -1
- package/src/fieldset.d.ts +12 -13
- package/src/fieldset.js.map +1 -1
- package/src/form.d.ts +5 -15
- package/src/form.js.map +1 -1
- package/src/hover-card.d.ts +29 -43
- package/src/hover-card.js.map +1 -1
- package/src/hover-popup.d.ts +27 -46
- package/src/hover-popup.js +4 -1
- package/src/hover-popup.js.map +1 -1
- package/src/index.d.ts +16 -3
- package/src/index.js +2 -1
- package/src/input.d.ts +12 -14
- package/src/input.js.map +1 -1
- package/src/label.d.ts +3 -3
- package/src/label.js.map +1 -1
- package/src/listbox.d.ts +34 -89
- package/src/listbox.js.map +1 -1
- package/src/menu.d.ts +170 -533
- package/src/menu.js.map +1 -1
- package/src/menubar.d.ts +6 -24
- package/src/menubar.js.map +1 -1
- package/src/message-scroller.d.ts +23 -17
- package/src/message-scroller.js.map +1 -1
- package/src/meter.d.ts +10 -31
- package/src/meter.js.map +1 -1
- package/src/navigation-menu.d.ts +77 -88
- package/src/navigation-menu.js +13 -12
- package/src/navigation-menu.js.map +1 -1
- package/src/number-field.d.ts +104 -68
- package/src/number-field.js +98 -68
- package/src/number-field.js.map +1 -1
- package/src/otp.d.ts +33 -54
- package/src/otp.js +4 -2
- package/src/otp.js.map +1 -1
- package/src/pagination.d.ts +31 -58
- package/src/pagination.js.map +1 -1
- package/src/popover.d.ts +83 -36
- package/src/popover.js +68 -8
- package/src/popover.js.map +1 -1
- package/src/primitive.d.ts +21 -0
- package/src/primitive.js +27 -0
- package/src/primitive.js.map +1 -0
- package/src/progress.d.ts +28 -31
- package/src/progress.js.map +1 -1
- package/src/qr-code.d.ts +12 -21
- package/src/qr-code.js.map +1 -1
- package/src/radio-group.d.ts +37 -75
- package/src/radio-group.js +8 -4
- package/src/radio-group.js.map +1 -1
- package/src/resizable.d.ts +26 -45
- package/src/resizable.js.map +1 -1
- package/src/runtime.d.ts +93 -21
- package/src/runtime.js +24 -25
- package/src/runtime.js.map +1 -1
- package/src/scroll-area.d.ts +33 -28
- package/src/scroll-area.js.map +1 -1
- package/src/select.d.ts +88 -147
- package/src/select.js +33 -6
- package/src/select.js.map +1 -1
- package/src/separator.d.ts +4 -9
- package/src/separator.js.map +1 -1
- package/src/slider.d.ts +66 -80
- package/src/slider.js +11 -10
- package/src/slider.js.map +1 -1
- package/src/switch.d.ts +21 -39
- package/src/switch.js +2 -2
- package/src/switch.js.map +1 -1
- package/src/tabs.d.ts +44 -98
- package/src/tabs.js.map +1 -1
- package/src/testing.d.ts +1 -0
- package/src/testing.js +1 -0
- package/src/toast.d.ts +58 -45
- package/src/toast.js +46 -17
- package/src/toast.js.map +1 -1
- package/src/toggle-group.d.ts +8 -39
- package/src/toggle-group.js.map +1 -1
- package/src/toggle.d.ts +5 -34
- package/src/toggle.js.map +1 -1
- package/src/toolbar.d.ts +31 -69
- package/src/toolbar.js.map +1 -1
- package/src/tooltip.d.ts +29 -43
- package/src/tooltip.js.map +1 -1
- package/src/value-bar.d.ts +26 -35
- package/src/value-bar.js +10 -3
- package/src/value-bar.js.map +1 -1
package/src/select.d.ts
CHANGED
|
@@ -1,154 +1,95 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Changes, Listeners, PartComponent, PartComponentProps, PartGiven, PartInstance, PlainComponent, PlainInstance, PortalProps, StatesOf } from "./runtime.js";
|
|
2
|
+
import { PositionerProps as PositionerProps$1 } from "./popover.js";
|
|
3
|
+
import { PublicProps } from "vue";
|
|
4
|
+
import { SelectItemOptions, SelectProps, SelectShown } from "@kirana-ui/core/select";
|
|
5
|
+
type State = StatesOf<"select">;
|
|
6
|
+
export type RootProps<Value = unknown> = Omit<SelectProps<Value>, "id" | "onValueChange" | "onValuesChange" | "onOpenChange"> & {
|
|
7
|
+
id?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
/** The value is `null` when the select is put back to none chosen. */
|
|
10
|
+
export type RootEmits<Value = unknown> = Changes<"value", Value | null> & Changes<"values", Value[]> & Changes<"open", boolean>;
|
|
11
|
+
export interface ValueProps extends PartComponentProps {
|
|
12
|
+
/** What it shows while nothing is chosen. */
|
|
13
|
+
placeholder?: string | undefined;
|
|
14
|
+
}
|
|
15
|
+
export interface ItemProps extends SelectItemOptions, PartComponentProps {
|
|
16
|
+
/** What the select's value is while this item is the chosen one. */
|
|
17
|
+
value: unknown;
|
|
18
|
+
}
|
|
19
|
+
export interface ItemIndicatorProps extends PartComponentProps {
|
|
20
|
+
/** Keeps the mark in the page while its item is not chosen. */
|
|
21
|
+
keepMounted?: boolean | undefined;
|
|
22
|
+
}
|
|
23
|
+
export interface PositionerProps extends PositionerProps$1 {
|
|
24
|
+
/** Opens the list over its trigger, the chosen item's text on the trigger's own. */
|
|
25
|
+
alignItemWithTrigger?: boolean | undefined;
|
|
26
|
+
}
|
|
27
|
+
export interface GroupProps extends PartComponentProps {
|
|
28
|
+
id?: string | undefined;
|
|
29
|
+
}
|
|
30
|
+
export type TriggerProps = PartComponentProps;
|
|
31
|
+
export type PopupProps = PartComponentProps;
|
|
32
|
+
export type ListProps = PartComponentProps;
|
|
33
|
+
export type ScrollUpArrowProps = PartComponentProps;
|
|
34
|
+
export type ScrollDownArrowProps = PartComponentProps;
|
|
35
|
+
export type GroupLabelProps = PartComponentProps;
|
|
36
|
+
export type SeparatorProps = PartComponentProps;
|
|
37
|
+
export type ItemTextProps = PartComponentProps;
|
|
3
38
|
export declare const Select: {
|
|
4
|
-
Root:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
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;
|
|
39
|
+
Root: new <Value = unknown>(props: RootProps<Value> & Listeners<RootEmits<Value>> & PublicProps) => PlainInstance<RootProps<Value>, RootEmits<Value>, {}>;
|
|
40
|
+
Trigger: PartComponent<"button", {
|
|
41
|
+
readonly popupOpen?: true | undefined;
|
|
42
|
+
readonly placeholder?: true | undefined;
|
|
43
|
+
readonly disabled?: true | undefined;
|
|
44
|
+
readonly readonly?: true | undefined;
|
|
45
|
+
}, PartComponentProps, {}, unknown>;
|
|
46
|
+
Value: new <As extends string = "span">(props: PartGiven<As, ValueProps> & PublicProps) => PartInstance<As, ValueProps, {}, {
|
|
47
|
+
state: State["value"];
|
|
48
|
+
} & SelectShown>;
|
|
49
|
+
Portal: PlainComponent<PortalProps, {}, {}>;
|
|
50
|
+
Positioner: PartComponent<"div", {
|
|
51
|
+
readonly open?: true | undefined;
|
|
52
|
+
readonly closed?: true | undefined;
|
|
53
|
+
readonly align?: "center" | "end" | "start" | undefined;
|
|
54
|
+
readonly side?: "bottom" | "inline-end" | "inline-start" | "left" | "none" | "right" | "top" | undefined;
|
|
55
|
+
}, PositionerProps>;
|
|
56
|
+
Popup: PartComponent<"div", {
|
|
57
|
+
readonly open?: true | undefined;
|
|
58
|
+
readonly closed?: true | undefined;
|
|
59
|
+
readonly startingStyle?: true | undefined;
|
|
60
|
+
readonly endingStyle?: true | undefined;
|
|
61
|
+
readonly side?: "bottom" | "inline-end" | "inline-start" | "left" | "right" | "top" | undefined;
|
|
62
|
+
readonly align?: "center" | "end" | "start" | undefined;
|
|
63
|
+
}, PartComponentProps, {}, unknown>;
|
|
96
64
|
/** The items' own box inside the popup, when the popup also holds scroll arrows. */
|
|
97
|
-
List:
|
|
65
|
+
List: PartComponent<"div", Record<never, never>, PartComponentProps, {}, unknown>;
|
|
98
66
|
/** In the page while there is more of the list above: it scrolls it under a moving pointer. */
|
|
99
|
-
ScrollUpArrow:
|
|
100
|
-
|
|
101
|
-
|
|
67
|
+
ScrollUpArrow: PartComponent<"div", {
|
|
68
|
+
readonly direction?: "down" | "up" | undefined;
|
|
69
|
+
readonly visible?: true | undefined;
|
|
70
|
+
readonly side?: "bottom" | "inline-end" | "inline-start" | "left" | "none" | "right" | "top" | undefined;
|
|
71
|
+
readonly startingStyle?: true | undefined;
|
|
72
|
+
readonly endingStyle?: true | undefined;
|
|
73
|
+
}>;
|
|
102
74
|
/** In the page while there is more of the list below. */
|
|
103
|
-
ScrollDownArrow:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
113
|
-
GroupLabel: import("vue").Component;
|
|
75
|
+
ScrollDownArrow: PartComponent<"div", {
|
|
76
|
+
readonly direction?: "down" | "up" | undefined;
|
|
77
|
+
readonly visible?: true | undefined;
|
|
78
|
+
readonly side?: "bottom" | "inline-end" | "inline-start" | "left" | "none" | "right" | "top" | undefined;
|
|
79
|
+
readonly startingStyle?: true | undefined;
|
|
80
|
+
readonly endingStyle?: true | undefined;
|
|
81
|
+
}>;
|
|
82
|
+
Group: PartComponent<"div", Record<never, never>, GroupProps>;
|
|
83
|
+
GroupLabel: PartComponent<"div", Record<never, never>, PartComponentProps, {}, unknown>;
|
|
114
84
|
/** A line between groups. */
|
|
115
|
-
Separator:
|
|
116
|
-
Item:
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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>;
|
|
85
|
+
Separator: PartComponent<"div", Record<never, never>, PartComponentProps, {}, unknown>;
|
|
86
|
+
Item: PartComponent<"div", {
|
|
87
|
+
readonly selected?: true | undefined;
|
|
88
|
+
readonly highlighted?: true | undefined;
|
|
89
|
+
readonly disabled?: true | undefined;
|
|
90
|
+
}, ItemProps>;
|
|
91
|
+
ItemText: PartComponent<"span", Record<never, never>, PartComponentProps, {}, unknown>;
|
|
92
|
+
ItemIndicator: PartComponent<"span", Record<never, never>, ItemIndicatorProps>;
|
|
153
93
|
};
|
|
94
|
+
export type { PortalProps };
|
|
154
95
|
//# sourceMappingURL=select.d.ts.map
|
package/src/select.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { positionerComponent } from "./popover.js";
|
|
2
2
|
import { useFieldAround } from "./field-context.js";
|
|
3
|
+
import { written } from "./element.js";
|
|
3
4
|
import { context, controller, fromSignal, optional, partComponent, portalComponent, toSignal } from "./runtime.js";
|
|
4
5
|
import { defined, within } from "@kirana-ui/core";
|
|
5
6
|
import { defineComponent, h, inject, onBeforeUnmount, onMounted, provide, useId, watchEffect } from "vue";
|
|
@@ -8,7 +9,10 @@ import { createSelect } from "@kirana-ui/core/select";
|
|
|
8
9
|
const scope = context("Select");
|
|
9
10
|
const ITEM = Symbol("SelectItem");
|
|
10
11
|
const HiddenInput = partComponent("SelectHiddenInput", "input", () => scope.use().input);
|
|
11
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* `v-model:value`, `v-model:open`; `@value-change` and `@open-change` carry the details. With
|
|
14
|
+
* `multiple`: `v-model:values` and `@values-change`.
|
|
15
|
+
*/
|
|
12
16
|
const Root = defineComponent({
|
|
13
17
|
name: "SelectRoot",
|
|
14
18
|
props: {
|
|
@@ -23,16 +27,22 @@ const Root = defineComponent({
|
|
|
23
27
|
open: optional(Boolean),
|
|
24
28
|
defaultOpen: Boolean,
|
|
25
29
|
disabled: Boolean,
|
|
30
|
+
readOnly: Boolean,
|
|
26
31
|
required: Boolean,
|
|
27
32
|
name: String,
|
|
28
33
|
form: String,
|
|
29
|
-
items: Array,
|
|
34
|
+
items: [Array, Object],
|
|
35
|
+
multiple: Boolean,
|
|
36
|
+
values: optional(Array),
|
|
37
|
+
defaultValues: Array,
|
|
30
38
|
virtualized: Object,
|
|
31
39
|
id: String
|
|
32
40
|
},
|
|
33
41
|
emits: [
|
|
34
42
|
"update:value",
|
|
35
43
|
"valueChange",
|
|
44
|
+
"update:values",
|
|
45
|
+
"valuesChange",
|
|
36
46
|
"update:open",
|
|
37
47
|
"openChange"
|
|
38
48
|
],
|
|
@@ -46,15 +56,23 @@ const Root = defineComponent({
|
|
|
46
56
|
open: props.open,
|
|
47
57
|
defaultOpen: props.defaultOpen,
|
|
48
58
|
disabled: props.disabled,
|
|
59
|
+
readOnly: props.readOnly,
|
|
49
60
|
required: props.required,
|
|
50
61
|
name: props.name,
|
|
51
62
|
form: props.form,
|
|
52
63
|
items: props.items,
|
|
64
|
+
multiple: props.multiple,
|
|
65
|
+
values: props.values,
|
|
66
|
+
defaultValues: props.defaultValues,
|
|
53
67
|
virtualized: props.virtualized,
|
|
54
68
|
onValueChange(value, details) {
|
|
55
69
|
emit("valueChange", value, details);
|
|
56
70
|
if (!details.canceled) emit("update:value", value);
|
|
57
71
|
},
|
|
72
|
+
onValuesChange(values, details) {
|
|
73
|
+
emit("valuesChange", values, details);
|
|
74
|
+
if (!details.canceled) emit("update:values", values);
|
|
75
|
+
},
|
|
58
76
|
onOpenChange(open, details) {
|
|
59
77
|
emit("openChange", open, details);
|
|
60
78
|
if (!details.canceled) emit("update:open", open);
|
|
@@ -64,8 +82,12 @@ const Root = defineComponent({
|
|
|
64
82
|
return () => [slots.default?.(), named.value ? h(HiddenInput) : null];
|
|
65
83
|
}
|
|
66
84
|
});
|
|
67
|
-
|
|
68
|
-
|
|
85
|
+
/**
|
|
86
|
+
* Shows the chosen value's label, or `placeholder` while nothing is chosen; with `multiple`,
|
|
87
|
+
* the chosen labels with commas between. Or what its slot makes of them
|
|
88
|
+
* (`v-slot="{ value, label }"`, with `multiple` `v-slot="{ values, labels }"`, in the items'
|
|
89
|
+
* order), which is given the part's `state` too.
|
|
90
|
+
*/
|
|
69
91
|
const Value = defineComponent({
|
|
70
92
|
name: "SelectValue",
|
|
71
93
|
inheritAttrs: false,
|
|
@@ -74,8 +96,13 @@ const Value = defineComponent({
|
|
|
74
96
|
default: ""
|
|
75
97
|
} },
|
|
76
98
|
setup(props, { attrs, slots }) {
|
|
77
|
-
const
|
|
78
|
-
|
|
99
|
+
const shown = fromSignal(scope.use().shown);
|
|
100
|
+
const label = () => shown.value.label ?? props.placeholder;
|
|
101
|
+
const ValueElement = partComponent("SelectValueElement", "span", () => scope.use().valuePart, written(label));
|
|
102
|
+
return () => h(ValueElement, attrs, { default: (given) => slots.default ? slots.default({
|
|
103
|
+
...given,
|
|
104
|
+
...shown.value
|
|
105
|
+
}) : label() });
|
|
79
106
|
}
|
|
80
107
|
});
|
|
81
108
|
/** `label` is what typeahead matches and the trigger shows; the item's text when left out. */
|
package/src/select.js.map
CHANGED
|
@@ -1 +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,MAAM,OAAO,MAAM,QACjB,WAAW,OAAO,cAAc,EAAE,MAAM,CAAC,UAAU;GACjD,IAAI,MAAM,MAAM;GAChB,OAAO,MAAM;GACb,cAAc,MAAM;GACpB,MAAM,MAAM;GACZ,aAAa,MAAM;GACnB,UAAU,MAAM;GAChB,UAAU,MAAM;GAChB,MAAM,MAAM;GACZ,MAAM,MAAM;GACZ,OAAO,MAAM;GACb,aAAa,MAAM;GACnB,cAAc,OAAgB,SAAwB;IACpD,KAAK,eAAe,OAAO,OAAO;IAClC,I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OAAO,IAAI,CAAC,EAAE,SAAS,MAAM,IAAI,CAAC,CAAC,UAClD;AAEA,SAAS,YAAY,MAAc,WAA0B;CAC3D,OAAO,gBAAgB;EACrB;EACA,cAAc;EACd,MAAM,QAAQ,EAAE,OAAO,SAAS;GAC9B,MAAM,QAAQ,MAAM,IAAI,CAAC,CAAC,YAAY,SAAS;GAC/C,IAAI;GACJ,gBAAgB;IACd,OAAO,MAAM,MAAM;GACrB,CAAC;GACD,sBAAsB,OAAO,CAAC;GAC9B,MAAM,UAAU,WAAW,MAAM,OAAO;GACxC,MAAM,UAAU,cAAc,GAAG,KAAK,UAAU,aAAa,MAAM,IAAI;GACvE,aAAc,QAAQ,QAAQ,EAAE,SAAS,OAAO,KAAK,IAAI;EAC3D;CACF,CAAC;AACH;AAEA,MAAa,SAAS;CACpB;CACA,SAAS,cAAc,iBAAiB,gBAAgB,MAAM,IAAI,CAAC,CAAC,OAAO;CAC3E;CACA,QAAQ,gBAAgB,sBAAsB,MAAM,IAAI,CAAC,CAAC,OAAO;CACjE;CACA,OAAO,cAAc,eAAe,aAAa,MAAM,IAAI,CAAC,CAAC,KAAK;;CAElE,MAAM,cAAc,cAAc,aAAa,MAAM,IAAI,CAAC,CAAC,IAAI;;CAE/D,eAAe,YAAY,uBAAuB,IAAI;;CAEtD,iBAAiB,YAAY,yBAAyB,MAAM;CAC5D;CACA;;CAEA,WAAW,cAAc,mBAAmB,aAAa,MAAM,IAAI,CAAC,CAAC,SAAS;CAC9E;CACA;CACA;AACF"}
|
|
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 {\n Select as Controller,\n SelectGroup,\n SelectItemOptions,\n SelectProps,\n SelectShown,\n} 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, PublicProps } from \"vue\"\n\nimport { positionerComponent } from \"./popover.ts\"\nimport type { PositionerProps as PlacedProps } from \"./popover.ts\"\nimport { useFieldAround } from \"./field-context.ts\"\nimport { written } from \"./element.ts\"\nimport {\n context,\n controller,\n fromSignal,\n optional,\n partComponent,\n portalComponent,\n toSignal,\n} from \"./runtime.ts\"\nimport type {\n Changes,\n Listeners,\n PartComponent,\n PartComponentProps,\n PartGiven,\n PartInstance,\n PlainInstance,\n StatesOf,\n} from \"./runtime.ts\"\n\nexport type { PortalProps } from \"./runtime.ts\"\n\ntype State = StatesOf<\"select\">\n\nconst scope = context<Controller>(\"Select\")\nconst ITEM: InjectionKey<unknown> = Symbol(\"SelectItem\")\n\nconst HiddenInput = partComponent(\"SelectHiddenInput\", \"input\", () => scope.use().input)\n\nexport type RootProps<Value = unknown> = Omit<\n SelectProps<Value>,\n \"id\" | \"onValueChange\" | \"onValuesChange\" | \"onOpenChange\"\n> & { id?: string | undefined }\n\n/** The value is `null` when the select is put back to none chosen. */\nexport type RootEmits<Value = unknown> = Changes<\"value\", Value | null> &\n Changes<\"values\", Value[]> &\n Changes<\"open\", boolean>\n\n/**\n * `v-model:value`, `v-model:open`; `@value-change` and `@open-change` carry the details. With\n * `multiple`: `v-model:values` and `@values-change`.\n */\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 readOnly: Boolean,\n required: Boolean,\n name: String,\n form: String,\n items: [Array, Object] as PropType<SelectProps[\"items\"]>,\n multiple: Boolean,\n values: optional(Array as PropType<readonly unknown[]>),\n defaultValues: Array as PropType<readonly unknown[]>,\n virtualized: Object as PropType<SelectProps[\"virtualized\"]>,\n id: String,\n },\n emits: [\n \"update:value\",\n \"valueChange\",\n \"update:values\",\n \"valuesChange\",\n \"update:open\",\n \"openChange\",\n ],\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 readOnly: props.readOnly,\n required: props.required,\n name: props.name,\n form: props.form,\n items: props.items,\n multiple: props.multiple,\n values: props.values,\n defaultValues: props.defaultValues,\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 onValuesChange(values: unknown[], details: ChangeDetails) {\n emit(\"valuesChange\", values, details)\n if (!details.canceled) emit(\"update:values\", values)\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}) as unknown as new <Value = unknown>(\n props: RootProps<Value> & Listeners<RootEmits<Value>> & PublicProps\n) => PlainInstance<RootProps<Value>, RootEmits<Value>, {}>\n\nexport interface ValueProps extends PartComponentProps {\n /** What it shows while nothing is chosen. */\n placeholder?: string | undefined\n}\n\n/**\n * Shows the chosen value's label, or `placeholder` while nothing is chosen; with `multiple`,\n * the chosen labels with commas between. Or what its slot makes of them\n * (`v-slot=\"{ value, label }\"`, with `multiple` `v-slot=\"{ values, labels }\"`, in the items'\n * order), which is given the part's `state` too.\n */\nconst Value = defineComponent({\n name: \"SelectValue\",\n inheritAttrs: false,\n props: { placeholder: { type: String, default: \"\" } },\n setup(props, { attrs, slots }) {\n const shown = fromSignal(scope.use().shown)\n const label = () => shown.value.label ?? props.placeholder\n // With `as-child` the caller's element holds the label, unless it writes its own.\n const ValueElement = partComponent(\n \"SelectValueElement\",\n \"span\",\n () => scope.use().valuePart,\n written(label)\n )\n return () =>\n h(ValueElement, attrs, {\n default: (given: object) =>\n slots.default ? slots.default({ ...given, ...shown.value }) : label(),\n })\n },\n}) as unknown as new <As extends string = \"span\">(\n props: PartGiven<As, ValueProps> & PublicProps\n) => PartInstance<As, ValueProps, {}, { state: State[\"value\"] } & SelectShown>\n\nexport interface ItemProps extends SelectItemOptions, PartComponentProps {\n /** What the select's value is while this item is the chosen one. */\n value: unknown\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}) as unknown as PartComponent<\"div\", State[\"item\"], ItemProps>\n\nconst ItemText = partComponent<\"span\", State[\"itemText\"]>(\"SelectItemText\", \"span\", () =>\n scope.use().itemText(inject(ITEM))\n)\n\nexport interface ItemIndicatorProps extends PartComponentProps {\n /** Keeps the mark in the page while its item is not chosen. */\n keepMounted?: boolean | undefined\n}\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}) as unknown as PartComponent<\"span\", State[\"itemIndicator\"], ItemIndicatorProps>\n\nconst PlacedPositioner = positionerComponent<State[\"positioner\"]>(\n \"SelectPlacedPositioner\",\n () => scope.use(),\n partComponent(\"SelectPositionerElement\", \"div\", () => scope.use().positioner)\n)\n\nexport interface PositionerProps extends PlacedProps {\n /** Opens the list over its trigger, the chosen item's text on the trigger's own. */\n alignItemWithTrigger?: boolean | undefined\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}) as unknown as PartComponent<\"div\", State[\"positioner\"], PositionerProps>\n\nconst GROUP: InjectionKey<SelectGroup | null> = Symbol(\"SelectGroup\")\n\nexport interface GroupProps extends PartComponentProps {\n id?: string | undefined\n}\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}) as unknown as PartComponent<\"div\", State[\"group\"], GroupProps>\n\n/** Names the group it is in. With no group around it, it is plain text. */\nconst GroupLabel = partComponent<\"div\", State[\"groupLabel\"]>(\n \"SelectGroupLabel\",\n \"div\",\n () => inject(GROUP, null)?.label ?? scope.use().groupLabel\n)\n\nfunction scrollArrow<Arrow extends \"scrollUpArrow\" | \"scrollDownArrow\">(\n name: string,\n direction: \"up\" | \"down\"\n) {\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 }) as unknown as PartComponent<\"div\", State[Arrow]>\n}\n\nexport type TriggerProps = PartComponentProps\nexport type PopupProps = PartComponentProps\nexport type ListProps = PartComponentProps\nexport type ScrollUpArrowProps = PartComponentProps\nexport type ScrollDownArrowProps = PartComponentProps\nexport type GroupLabelProps = PartComponentProps\nexport type SeparatorProps = PartComponentProps\nexport type ItemTextProps = PartComponentProps\nexport const Select = {\n Root,\n Trigger: partComponent<\"button\", State[\"trigger\"]>(\n \"SelectTrigger\",\n \"button\",\n () => scope.use().trigger\n ),\n Value,\n Portal: portalComponent(\"SelectPortal\", () => scope.use().mounted),\n Positioner,\n Popup: partComponent<\"div\", State[\"popup\"]>(\"SelectPopup\", \"div\", () => scope.use().popup),\n /** The items' own box inside the popup, when the popup also holds scroll arrows. */\n List: partComponent<\"div\", State[\"list\"]>(\"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<\"scrollUpArrow\">(\"SelectScrollUpArrow\", \"up\"),\n /** In the page while there is more of the list below. */\n ScrollDownArrow: scrollArrow<\"scrollDownArrow\">(\"SelectScrollDownArrow\", \"down\"),\n Group,\n GroupLabel,\n /** A line between groups. */\n Separator: partComponent<\"div\", State[\"separator\"]>(\n \"SelectSeparator\",\n \"div\",\n () => scope.use().separator\n ),\n Item,\n ItemText,\n ItemIndicator,\n}\n"],"mappings":";;;;;;;;AAkDA,MAAM,QAAQ,QAAoB,QAAQ;AAC1C,MAAM,OAA8B,OAAO,YAAY;AAEvD,MAAM,cAAc,cAAc,qBAAqB,eAAe,MAAM,IAAI,CAAC,CAAC,KAAK;;;;;AAgBvF,MAAM,OAAO,gBAAgB;CAC3B,MAAM;CACN,OAAO;EACL,OAAO;GAAE,MAAM;GAAsC,SAAS,KAAA;EAAqB;EACnF,cAAc;GAAE,MA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AAI;GACJ,gBAAgB;IACd,OAAO,MAAM,MAAM;GACrB,CAAC;GACD,sBAAsB,OAAO,CAAC;GAC9B,MAAM,UAAU,WAAW,MAAM,OAAO;GACxC,MAAM,UAAU,cAAc,GAAG,KAAK,UAAU,aAAa,MAAM,IAAI;GACvE,aAAc,QAAQ,QAAQ,EAAE,SAAS,OAAO,KAAK,IAAI;EAC3D;CACF,CAAC;AACH;AAUA,MAAa,SAAS;CACpB;CACA,SAAS,cACP,iBACA,gBACM,MAAM,IAAI,CAAC,CAAC,OACpB;CACA;CACA,QAAQ,gBAAgB,sBAAsB,MAAM,IAAI,CAAC,CAAC,OAAO;CACjE;CACA,OAAO,cAAqC,eAAe,aAAa,MAAM,IAAI,CAAC,CAAC,KAAK;;CAEzF,MAAM,cAAoC,cAAc,aAAa,MAAM,IAAI,CAAC,CAAC,IAAI;;CAErF,eAAe,YAA6B,uBAAuB,IAAI;;CAEvE,iBAAiB,YAA+B,yBAAyB,MAAM;CAC/E;CACA;;CAEA,WAAW,cACT,mBACA,aACM,MAAM,IAAI,CAAC,CAAC,SACpB;CACA;CACA;CACA;AACF"}
|
package/src/separator.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
|
|
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>;
|
|
1
|
+
import { PartComponent, PartComponentProps, StatesOf } from "./runtime.js";
|
|
2
|
+
import { SeparatorProps as SeparatorProps$1 } from "@kirana-ui/core/separator";
|
|
3
|
+
export interface SeparatorProps extends SeparatorProps$1, PartComponentProps {}
|
|
4
|
+
export declare const Separator: PartComponent<"div", StatesOf<"separator">["root"], SeparatorProps>;
|
|
10
5
|
//# sourceMappingURL=separator.d.ts.map
|
package/src/separator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"separator.js","names":[],"sources":["../../../../packages/vue/src/separator.ts"],"sourcesContent":["import type { Orientation } from \"@kirana-ui/core\"\nimport { createSeparator } from \"@kirana-ui/core/separator\"\nimport { defineComponent, h } from \"vue\"\nimport type { PropType } from \"vue\"\n\nimport { controller, partComponent } from \"./runtime.ts\"\n\nexport const Separator = defineComponent({\n name: \"Separator\",\n inheritAttrs: false,\n props: { orientation: String as PropType<Orientation> },\n setup(props, { attrs, slots }) {\n const made = controller(createSeparator, () => ({ orientation: props.orientation }))\n const Element = partComponent(\"SeparatorElement\", \"div\", () => made.root)\n return () => h(Element, attrs, slots)\n },\n})\n"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"separator.js","names":[],"sources":["../../../../packages/vue/src/separator.ts"],"sourcesContent":["import type { Orientation } from \"@kirana-ui/core\"\nimport { createSeparator } from \"@kirana-ui/core/separator\"\nimport type { SeparatorProps as CoreProps } from \"@kirana-ui/core/separator\"\nimport { defineComponent, h } from \"vue\"\nimport type { PropType } from \"vue\"\n\nimport { controller, partComponent } from \"./runtime.ts\"\nimport type { PartComponent, PartComponentProps, StatesOf } from \"./runtime.ts\"\n\nexport interface SeparatorProps extends CoreProps, PartComponentProps {}\n\nexport const Separator = defineComponent({\n name: \"Separator\",\n inheritAttrs: false,\n props: { orientation: String as PropType<Orientation> },\n setup(props, { attrs, slots }) {\n const made = controller(createSeparator, () => ({ orientation: props.orientation }))\n const Element = partComponent(\"SeparatorElement\", \"div\", () => made.root)\n return () => h(Element, attrs, slots)\n },\n}) as unknown as PartComponent<\"div\", StatesOf<\"separator\">[\"root\"], SeparatorProps>\n"],"mappings":";;;;AAWA,MAAa,YAAY,gBAAgB;CACvC,MAAM;CACN,cAAc;CACd,OAAO,EAAE,aAAa,OAAgC;CACtD,MAAM,OAAO,EAAE,OAAO,SAAS;EAC7B,MAAM,OAAO,WAAW,wBAAwB,EAAE,aAAa,MAAM,YAAY,EAAE;EACnF,MAAM,UAAU,cAAc,oBAAoB,aAAa,KAAK,IAAI;EACxE,aAAa,EAAE,SAAS,OAAO,KAAK;CACtC;AACF,CAAC"}
|
package/src/slider.d.ts
CHANGED
|
@@ -1,83 +1,69 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Changes, PartComponent, PartComponentProps, PartGiven, PartInstance, StatesOf } from "./runtime.js";
|
|
2
|
+
import { PublicProps } from "vue";
|
|
3
|
+
import { SliderChangeDetails, SliderProps, SliderTold, SliderValue } from "@kirana-ui/core/slider";
|
|
4
|
+
type State = StatesOf<"slider">;
|
|
5
|
+
export type RootProps<Value extends SliderValue = SliderValue> = Omit<SliderProps, "id" | "value" | "defaultValue" | "onValueChange" | "onValueCommitted"> & {
|
|
6
|
+
/** One number for a slider with one thumb, a list for a range. */
|
|
7
|
+
value?: Value | undefined;
|
|
8
|
+
defaultValue?: Value | undefined;
|
|
9
|
+
id?: string | undefined;
|
|
10
|
+
} & PartComponentProps;
|
|
11
|
+
/** What comes back is what was given: a number for one thumb, a list for a range. */
|
|
12
|
+
export type RootValue<Value extends SliderValue = SliderValue> = SliderTold<Value>;
|
|
13
|
+
export type RootEmits<Value extends SliderValue = SliderValue> = Changes<"value", RootValue<Value>, SliderChangeDetails> & {
|
|
14
|
+
/** The change is done: the pointer was let go, or a key moved a thumb. */
|
|
15
|
+
valueCommitted: (value: RootValue<Value>, details: SliderChangeDetails) => void;
|
|
16
|
+
};
|
|
17
|
+
export interface ThumbProps extends PartComponentProps {
|
|
18
|
+
/** Which value of a range the thumb is, from 0; its place among the thumbs when left out. */
|
|
19
|
+
index?: number | undefined;
|
|
20
|
+
}
|
|
21
|
+
export type ValueProps = PartComponentProps;
|
|
22
|
+
/** What `Slider.Value` hands its slot beside its state. */
|
|
23
|
+
export interface ValueGiven {
|
|
24
|
+
/** The value as it is written: formatted, a range's two with a dash between. */
|
|
25
|
+
text: string;
|
|
26
|
+
/** The values, one for each thumb. */
|
|
27
|
+
values: readonly number[];
|
|
28
|
+
}
|
|
29
|
+
export type ControlProps = PartComponentProps;
|
|
30
|
+
export type TrackProps = PartComponentProps;
|
|
31
|
+
export type IndicatorProps = PartComponentProps;
|
|
3
32
|
export declare const Slider: {
|
|
4
|
-
Root:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
min: NumberConstructor;
|
|
39
|
-
max: NumberConstructor;
|
|
40
|
-
step: NumberConstructor;
|
|
41
|
-
largeStep: NumberConstructor;
|
|
42
|
-
minStepsBetweenValues: NumberConstructor;
|
|
43
|
-
thumbAlignment: PropType<SliderProps["thumbAlignment"]>;
|
|
44
|
-
orientation: PropType<"horizontal" | "vertical">;
|
|
45
|
-
disabled: BooleanConstructor;
|
|
46
|
-
name: StringConstructor;
|
|
47
|
-
form: StringConstructor;
|
|
48
|
-
format: PropType<Intl.NumberFormatOptions>;
|
|
49
|
-
locale: StringConstructor;
|
|
50
|
-
getAriaValueText: PropType<SliderProps["getAriaValueText"]>;
|
|
51
|
-
id: StringConstructor;
|
|
52
|
-
}>> & Readonly<{
|
|
53
|
-
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
54
|
-
onValueChange?: ((...args: any[]) => any) | undefined;
|
|
55
|
-
onValueCommitted?: ((...args: any[]) => any) | undefined;
|
|
56
|
-
}>, {
|
|
57
|
-
value: SliderValue;
|
|
58
|
-
defaultValue: SliderValue;
|
|
59
|
-
disabled: boolean;
|
|
60
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
61
|
-
Value: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
62
|
-
[key: string]: any;
|
|
63
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
64
|
-
Control: import("vue").Component;
|
|
65
|
-
Track: import("vue").Component;
|
|
66
|
-
Indicator: import("vue").Component;
|
|
67
|
-
Thumb: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
68
|
-
index: {
|
|
69
|
-
type: NumberConstructor;
|
|
70
|
-
default: number;
|
|
71
|
-
};
|
|
72
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
73
|
-
[key: string]: any;
|
|
74
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
75
|
-
index: {
|
|
76
|
-
type: NumberConstructor;
|
|
77
|
-
default: number;
|
|
78
|
-
};
|
|
79
|
-
}>> & Readonly<{}>, {
|
|
80
|
-
index: number;
|
|
81
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
33
|
+
Root: new <Value extends SliderValue = SliderValue, As extends string = "div">(props: PartGiven<As, RootProps<Value>, RootEmits<Value>> & PublicProps) => PartInstance<As, RootProps<Value>, RootEmits<Value>, {
|
|
34
|
+
state: State["root"];
|
|
35
|
+
}>;
|
|
36
|
+
Value: PartComponent<"output", {
|
|
37
|
+
readonly orientation?: "horizontal" | "vertical" | undefined;
|
|
38
|
+
readonly disabled?: true | undefined;
|
|
39
|
+
readonly readonly?: true | undefined;
|
|
40
|
+
readonly dragging?: true | undefined;
|
|
41
|
+
}, PartComponentProps, {}, ValueGiven>;
|
|
42
|
+
Control: PartComponent<"div", {
|
|
43
|
+
readonly orientation?: "horizontal" | "vertical" | undefined;
|
|
44
|
+
readonly disabled?: true | undefined;
|
|
45
|
+
readonly readonly?: true | undefined;
|
|
46
|
+
readonly dragging?: true | undefined;
|
|
47
|
+
}, PartComponentProps, {}, unknown>;
|
|
48
|
+
Track: PartComponent<"div", {
|
|
49
|
+
readonly orientation?: "horizontal" | "vertical" | undefined;
|
|
50
|
+
readonly disabled?: true | undefined;
|
|
51
|
+
readonly readonly?: true | undefined;
|
|
52
|
+
readonly dragging?: true | undefined;
|
|
53
|
+
}, PartComponentProps, {}, unknown>;
|
|
54
|
+
Indicator: PartComponent<"div", {
|
|
55
|
+
readonly orientation?: "horizontal" | "vertical" | undefined;
|
|
56
|
+
readonly disabled?: true | undefined;
|
|
57
|
+
readonly readonly?: true | undefined;
|
|
58
|
+
readonly dragging?: true | undefined;
|
|
59
|
+
}, PartComponentProps, {}, unknown>;
|
|
60
|
+
Thumb: PartComponent<"div", {
|
|
61
|
+
readonly orientation?: "horizontal" | "vertical" | undefined;
|
|
62
|
+
readonly disabled?: true | undefined;
|
|
63
|
+
readonly readonly?: true | undefined;
|
|
64
|
+
readonly dragging?: true | undefined;
|
|
65
|
+
readonly index?: true | undefined;
|
|
66
|
+
}, ThumbProps>;
|
|
82
67
|
};
|
|
68
|
+
export {};
|
|
83
69
|
//# sourceMappingURL=slider.d.ts.map
|