@verikit/vue 0.23.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.md +9 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +1 -0
- package/dist/client/use-verikit-client.d.ts +42 -0
- package/dist/client/use-verikit-client.d.ts.map +1 -0
- package/dist/client/use-verikit-client.js +39 -0
- package/dist/components/button.d.ts +36 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +53 -0
- package/dist/components/checkbox.d.ts +45 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +44 -0
- package/dist/components/dialog.d.ts +86 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +157 -0
- package/dist/components/input.d.ts +5 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +17 -0
- package/dist/components/label.d.ts +5 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +17 -0
- package/dist/components/select.d.ts +164 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +219 -0
- package/dist/components/textarea.d.ts +5 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +17 -0
- package/dist/fields/field-shell.d.ts +64 -0
- package/dist/fields/field-shell.d.ts.map +1 -0
- package/dist/fields/field-shell.js +61 -0
- package/dist/fields/index.d.ts +7 -0
- package/dist/fields/index.d.ts.map +1 -0
- package/dist/fields/index.js +3 -0
- package/dist/fields/inputs.d.ts +372 -0
- package/dist/fields/inputs.d.ts.map +1 -0
- package/dist/fields/inputs.js +306 -0
- package/dist/fields/registry.d.ts +382 -0
- package/dist/fields/registry.d.ts.map +1 -0
- package/dist/fields/registry.js +31 -0
- package/dist/fields/types.d.ts +36 -0
- package/dist/fields/types.d.ts.map +1 -0
- package/dist/fields/types.js +1 -0
- package/dist/form/index.d.ts +11 -0
- package/dist/form/index.d.ts.map +1 -0
- package/dist/form/index.js +5 -0
- package/dist/form/use-verikit-form.d.ts +40 -0
- package/dist/form/use-verikit-form.d.ts.map +1 -0
- package/dist/form/use-verikit-form.js +72 -0
- package/dist/form/use-verikit-schema-tree-form.d.ts +47 -0
- package/dist/form/use-verikit-schema-tree-form.d.ts.map +1 -0
- package/dist/form/use-verikit-schema-tree-form.js +96 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/layout/index.d.ts +5 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/index.js +2 -0
- package/dist/layout/render-schema-node.d.ts +9 -0
- package/dist/layout/render-schema-node.d.ts.map +1 -0
- package/dist/layout/render-schema-node.js +265 -0
- package/dist/layout/types.d.ts +68 -0
- package/dist/layout/types.d.ts.map +1 -0
- package/dist/layout/types.js +1 -0
- package/dist/lib/utils.d.ts +4 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +6 -0
- package/dist/query/index.d.ts +13 -0
- package/dist/query/index.d.ts.map +1 -0
- package/dist/query/index.js +6 -0
- package/dist/query/use-resource-form.d.ts +39 -0
- package/dist/query/use-resource-form.d.ts.map +1 -0
- package/dist/query/use-resource-form.js +32 -0
- package/dist/query/use-resource-mutations.d.ts +40 -0
- package/dist/query/use-resource-mutations.d.ts.map +1 -0
- package/dist/query/use-resource-mutations.js +104 -0
- package/dist/query/use-resource-queries.d.ts +15 -0
- package/dist/query/use-resource-queries.d.ts.map +1 -0
- package/dist/query/use-resource-queries.js +35 -0
- package/dist/query/use-resource-schema-tree-form.d.ts +36 -0
- package/dist/query/use-resource-schema-tree-form.d.ts.map +1 -0
- package/dist/query/use-resource-schema-tree-form.js +42 -0
- package/dist/query/use-resource-table.d.ts +48 -0
- package/dist/query/use-resource-table.d.ts.map +1 -0
- package/dist/query/use-resource-table.js +104 -0
- package/dist/relationships/belongs-to-field.d.ts +91 -0
- package/dist/relationships/belongs-to-field.d.ts.map +1 -0
- package/dist/relationships/belongs-to-field.js +107 -0
- package/dist/relationships/index.d.ts +2 -0
- package/dist/relationships/index.d.ts.map +1 -0
- package/dist/relationships/index.js +1 -0
- package/dist/resource/index.d.ts +5 -0
- package/dist/resource/index.d.ts.map +1 -0
- package/dist/resource/index.js +2 -0
- package/dist/resource/resource-form.d.ts +122 -0
- package/dist/resource/resource-form.d.ts.map +1 -0
- package/dist/resource/resource-form.js +83 -0
- package/dist/resource/resource-table-filters.d.ts +54 -0
- package/dist/resource/resource-table-filters.d.ts.map +1 -0
- package/dist/resource/resource-table-filters.js +283 -0
- package/dist/resource/resource-table.d.ts +93 -0
- package/dist/resource/resource-table.d.ts.map +1 -0
- package/dist/resource/resource-table.js +562 -0
- package/package.json +86 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { type PropType } from "vue";
|
|
2
|
+
/** shadcn-compatible select root built on Reka UI. */
|
|
3
|
+
export declare const Select: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
value: {
|
|
5
|
+
type: PropType<string | undefined>;
|
|
6
|
+
default: undefined;
|
|
7
|
+
};
|
|
8
|
+
disabled: {
|
|
9
|
+
type: BooleanConstructor;
|
|
10
|
+
default: boolean;
|
|
11
|
+
};
|
|
12
|
+
name: {
|
|
13
|
+
type: PropType<string | undefined>;
|
|
14
|
+
default: undefined;
|
|
15
|
+
};
|
|
16
|
+
onValueChange: {
|
|
17
|
+
type: PropType<(value: string | null) => void>;
|
|
18
|
+
default: undefined;
|
|
19
|
+
};
|
|
20
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
|
+
value: {
|
|
24
|
+
type: PropType<string | undefined>;
|
|
25
|
+
default: undefined;
|
|
26
|
+
};
|
|
27
|
+
disabled: {
|
|
28
|
+
type: BooleanConstructor;
|
|
29
|
+
default: boolean;
|
|
30
|
+
};
|
|
31
|
+
name: {
|
|
32
|
+
type: PropType<string | undefined>;
|
|
33
|
+
default: undefined;
|
|
34
|
+
};
|
|
35
|
+
onValueChange: {
|
|
36
|
+
type: PropType<(value: string | null) => void>;
|
|
37
|
+
default: undefined;
|
|
38
|
+
};
|
|
39
|
+
}>> & Readonly<{}>, {
|
|
40
|
+
name: string | undefined;
|
|
41
|
+
value: string | undefined;
|
|
42
|
+
disabled: boolean;
|
|
43
|
+
onValueChange: (value: string | null) => void;
|
|
44
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
45
|
+
/** Groups related select items. */
|
|
46
|
+
export declare const SelectGroup: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
47
|
+
[key: string]: any;
|
|
48
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
49
|
+
/** Displays the current select value or placeholder. */
|
|
50
|
+
export declare const SelectValue: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
51
|
+
placeholder: {
|
|
52
|
+
type: PropType<string | undefined>;
|
|
53
|
+
default: undefined;
|
|
54
|
+
};
|
|
55
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
56
|
+
[key: string]: any;
|
|
57
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
58
|
+
placeholder: {
|
|
59
|
+
type: PropType<string | undefined>;
|
|
60
|
+
default: undefined;
|
|
61
|
+
};
|
|
62
|
+
}>> & Readonly<{}>, {
|
|
63
|
+
placeholder: string | undefined;
|
|
64
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
65
|
+
/** Opens the select popup and displays the current value. */
|
|
66
|
+
export declare const SelectTrigger: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
67
|
+
size: {
|
|
68
|
+
type: PropType<"sm" | "default">;
|
|
69
|
+
default: string;
|
|
70
|
+
};
|
|
71
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
72
|
+
[key: string]: any;
|
|
73
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
74
|
+
size: {
|
|
75
|
+
type: PropType<"sm" | "default">;
|
|
76
|
+
default: string;
|
|
77
|
+
};
|
|
78
|
+
}>> & Readonly<{}>, {
|
|
79
|
+
size: "default" | "sm";
|
|
80
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
81
|
+
/** Renders the select popup content. */
|
|
82
|
+
export declare const SelectContent: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
83
|
+
side: {
|
|
84
|
+
type: PropType<"top" | "bottom" | "left" | "right">;
|
|
85
|
+
default: string;
|
|
86
|
+
};
|
|
87
|
+
sideOffset: {
|
|
88
|
+
type: NumberConstructor;
|
|
89
|
+
default: number;
|
|
90
|
+
};
|
|
91
|
+
align: {
|
|
92
|
+
type: PropType<"start" | "center" | "end">;
|
|
93
|
+
default: string;
|
|
94
|
+
};
|
|
95
|
+
alignOffset: {
|
|
96
|
+
type: NumberConstructor;
|
|
97
|
+
default: number;
|
|
98
|
+
};
|
|
99
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
100
|
+
[key: string]: any;
|
|
101
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
102
|
+
side: {
|
|
103
|
+
type: PropType<"top" | "bottom" | "left" | "right">;
|
|
104
|
+
default: string;
|
|
105
|
+
};
|
|
106
|
+
sideOffset: {
|
|
107
|
+
type: NumberConstructor;
|
|
108
|
+
default: number;
|
|
109
|
+
};
|
|
110
|
+
align: {
|
|
111
|
+
type: PropType<"start" | "center" | "end">;
|
|
112
|
+
default: string;
|
|
113
|
+
};
|
|
114
|
+
alignOffset: {
|
|
115
|
+
type: NumberConstructor;
|
|
116
|
+
default: number;
|
|
117
|
+
};
|
|
118
|
+
}>> & Readonly<{}>, {
|
|
119
|
+
side: "top" | "bottom" | "left" | "right";
|
|
120
|
+
sideOffset: number;
|
|
121
|
+
align: "end" | "start" | "center";
|
|
122
|
+
alignOffset: number;
|
|
123
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
124
|
+
/** Renders a label inside a select group. */
|
|
125
|
+
export declare const SelectLabel: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
126
|
+
[key: string]: any;
|
|
127
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
128
|
+
/** Renders a selectable item. */
|
|
129
|
+
export declare const SelectItem: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
130
|
+
value: {
|
|
131
|
+
type: PropType<string>;
|
|
132
|
+
required: true;
|
|
133
|
+
};
|
|
134
|
+
disabled: {
|
|
135
|
+
type: BooleanConstructor;
|
|
136
|
+
default: boolean;
|
|
137
|
+
};
|
|
138
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
139
|
+
[key: string]: any;
|
|
140
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
141
|
+
value: {
|
|
142
|
+
type: PropType<string>;
|
|
143
|
+
required: true;
|
|
144
|
+
};
|
|
145
|
+
disabled: {
|
|
146
|
+
type: BooleanConstructor;
|
|
147
|
+
default: boolean;
|
|
148
|
+
};
|
|
149
|
+
}>> & Readonly<{}>, {
|
|
150
|
+
disabled: boolean;
|
|
151
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
152
|
+
/** Renders a visual separator between select items. */
|
|
153
|
+
export declare const SelectSeparator: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
154
|
+
[key: string]: any;
|
|
155
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
156
|
+
/** Renders the scroll-up affordance for overflowing select content. */
|
|
157
|
+
export declare const SelectScrollUpButton: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
158
|
+
[key: string]: any;
|
|
159
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
160
|
+
/** Renders the scroll-down affordance for overflowing select content. */
|
|
161
|
+
export declare const SelectScrollDownButton: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
162
|
+
[key: string]: any;
|
|
163
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
164
|
+
//# sourceMappingURL=select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/components/select.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAsB,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAC;AAGxD,sDAAsD;AACtD,eAAO,MAAM,MAAM;;cAIU,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC;;;;;;;;cAE7B,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC;;;;cAEhC,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;;;;;;;cAJnC,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC;;;;;;;;cAE7B,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC;;;;cAEhC,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;;;;;;;2BAAvB,MAAM,GAAG,IAAI,KAAK,IAAI;4EAmB7D,CAAC;AAEH,mCAAmC;AACnC,eAAO,MAAM,WAAW;;2OAiBtB,CAAC;AAEH,wDAAwD;AACxD,eAAO,MAAM,WAAW;;cAKF,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC;;;;;;;cAA5B,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC;;;;;4EAehD,CAAC;AAEH,6DAA6D;AAC7D,eAAO,MAAM,aAAa;;cAIE,QAAQ,CAAC,IAAI,GAAG,SAAS,CAAC;;;;;;;cAA1B,QAAQ,CAAC,IAAI,GAAG,SAAS,CAAC;;;;;4EAkCpD,CAAC;AAEH,wCAAwC;AACxC,eAAO,MAAM,aAAa;;cAKJ,QAAQ,CAAC,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;;;;;;;;cAK7C,QAAQ,CAAC,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;;;;;;;;;;;cALpC,QAAQ,CAAC,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;;;;;;;;cAK7C,QAAQ,CAAC,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;;;;;;;;;;;;4EAuCxD,CAAC;AAEH,6CAA6C;AAC7C,eAAO,MAAM,WAAW;;2OAoBtB,CAAC;AAEH,iCAAiC;AACjC,eAAO,MAAM,UAAU;;cAIM,QAAQ,CAAC,MAAM,CAAC;;;;;;;;;;;cAAhB,QAAQ,CAAC,MAAM,CAAC;;;;;;;;;4EAsC3C,CAAC;AAEH,uDAAuD;AACvD,eAAO,MAAM,eAAe;;2OAgB1B,CAAC;AAEH,uEAAuE;AACvE,eAAO,MAAM,oBAAoB;;2OAoB/B,CAAC;AAEH,yEAAyE;AACzE,eAAO,MAAM,sBAAsB;;2OAoBjC,CAAC"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-vue-next";
|
|
2
|
+
import { SelectContent as RekaSelectContent, SelectGroup as RekaSelectGroup, SelectIcon, SelectItem as RekaSelectItem, SelectItemIndicator, SelectItemText, SelectLabel as RekaSelectLabel, SelectPortal, SelectRoot, SelectScrollDownButton as RekaSelectScrollDownButton, SelectScrollUpButton as RekaSelectScrollUpButton, SelectSeparator as RekaSelectSeparator, SelectTrigger as RekaSelectTrigger, SelectValue as RekaSelectValue, SelectViewport, } from "reka-ui";
|
|
3
|
+
import { defineComponent, h } from "vue";
|
|
4
|
+
import { cn } from "#lib/utils";
|
|
5
|
+
/** shadcn-compatible select root built on Reka UI. */
|
|
6
|
+
export const Select = defineComponent({
|
|
7
|
+
name: "Select",
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
props: {
|
|
10
|
+
value: { type: String, default: undefined },
|
|
11
|
+
disabled: { type: Boolean, default: false },
|
|
12
|
+
name: { type: String, default: undefined },
|
|
13
|
+
onValueChange: {
|
|
14
|
+
type: Function,
|
|
15
|
+
default: undefined,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
setup(props, { slots, attrs }) {
|
|
19
|
+
return () => h(SelectRoot, {
|
|
20
|
+
modelValue: props.value,
|
|
21
|
+
disabled: props.disabled,
|
|
22
|
+
name: props.name,
|
|
23
|
+
"onUpdate:modelValue": (value) => props.onValueChange?.(value ?? null),
|
|
24
|
+
...attrs,
|
|
25
|
+
}, slots);
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
/** Groups related select items. */
|
|
29
|
+
export const SelectGroup = defineComponent({
|
|
30
|
+
name: "SelectGroup",
|
|
31
|
+
inheritAttrs: false,
|
|
32
|
+
setup(_props, { slots, attrs }) {
|
|
33
|
+
return () => {
|
|
34
|
+
const { class: className, ...rest } = attrs;
|
|
35
|
+
return h(RekaSelectGroup, {
|
|
36
|
+
"data-slot": "select-group",
|
|
37
|
+
class: cn("scroll-my-1 p-1", className),
|
|
38
|
+
...rest,
|
|
39
|
+
}, slots);
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
/** Displays the current select value or placeholder. */
|
|
44
|
+
export const SelectValue = defineComponent({
|
|
45
|
+
name: "SelectValue",
|
|
46
|
+
inheritAttrs: false,
|
|
47
|
+
props: {
|
|
48
|
+
placeholder: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: undefined,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
setup(props, { attrs }) {
|
|
54
|
+
return () => {
|
|
55
|
+
const { class: className, ...rest } = attrs;
|
|
56
|
+
return h(RekaSelectValue, {
|
|
57
|
+
"data-slot": "select-value",
|
|
58
|
+
placeholder: props.placeholder,
|
|
59
|
+
class: cn("flex flex-1 text-left", className),
|
|
60
|
+
...rest,
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
/** Opens the select popup and displays the current value. */
|
|
66
|
+
export const SelectTrigger = defineComponent({
|
|
67
|
+
name: "SelectTrigger",
|
|
68
|
+
inheritAttrs: false,
|
|
69
|
+
props: {
|
|
70
|
+
size: { type: String, default: "default" },
|
|
71
|
+
},
|
|
72
|
+
setup(props, { slots, attrs }) {
|
|
73
|
+
return () => {
|
|
74
|
+
const { class: className, ...rest } = attrs;
|
|
75
|
+
return h(RekaSelectTrigger, {
|
|
76
|
+
"data-slot": "select-trigger",
|
|
77
|
+
"data-size": props.size,
|
|
78
|
+
class: cn("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
79
|
+
...rest,
|
|
80
|
+
}, {
|
|
81
|
+
default: () => [
|
|
82
|
+
slots.default?.(),
|
|
83
|
+
h(SelectIcon, {}, {
|
|
84
|
+
default: () => h(ChevronDownIcon, {
|
|
85
|
+
class: "pointer-events-none size-4 text-muted-foreground",
|
|
86
|
+
}),
|
|
87
|
+
}),
|
|
88
|
+
],
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
/** Renders the select popup content. */
|
|
94
|
+
export const SelectContent = defineComponent({
|
|
95
|
+
name: "SelectContent",
|
|
96
|
+
inheritAttrs: false,
|
|
97
|
+
props: {
|
|
98
|
+
side: {
|
|
99
|
+
type: String,
|
|
100
|
+
default: "bottom",
|
|
101
|
+
},
|
|
102
|
+
sideOffset: { type: Number, default: 4 },
|
|
103
|
+
align: {
|
|
104
|
+
type: String,
|
|
105
|
+
default: "center",
|
|
106
|
+
},
|
|
107
|
+
alignOffset: { type: Number, default: 0 },
|
|
108
|
+
},
|
|
109
|
+
setup(props, { slots, attrs }) {
|
|
110
|
+
return () => {
|
|
111
|
+
const { class: className, ...rest } = attrs;
|
|
112
|
+
return h(SelectPortal, {}, {
|
|
113
|
+
default: () => h(RekaSelectContent, {
|
|
114
|
+
position: "popper",
|
|
115
|
+
side: props.side,
|
|
116
|
+
sideOffset: props.sideOffset,
|
|
117
|
+
align: props.align,
|
|
118
|
+
alignOffset: props.alignOffset,
|
|
119
|
+
class: cn("relative isolate z-50 max-h-(--reka-popper-available-height) w-(--reka-popper-anchor-width) min-w-36 origin-(--reka-popper-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", className),
|
|
120
|
+
...rest,
|
|
121
|
+
}, {
|
|
122
|
+
default: () => [
|
|
123
|
+
h(SelectScrollUpButton),
|
|
124
|
+
h(SelectViewport, {}, { default: () => slots.default?.() }),
|
|
125
|
+
h(SelectScrollDownButton),
|
|
126
|
+
],
|
|
127
|
+
}),
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
/** Renders a label inside a select group. */
|
|
133
|
+
export const SelectLabel = defineComponent({
|
|
134
|
+
name: "SelectLabel",
|
|
135
|
+
inheritAttrs: false,
|
|
136
|
+
setup(_props, { slots, attrs }) {
|
|
137
|
+
return () => {
|
|
138
|
+
const { class: className, ...rest } = attrs;
|
|
139
|
+
return h(RekaSelectLabel, {
|
|
140
|
+
"data-slot": "select-label",
|
|
141
|
+
class: cn("px-1.5 py-1 text-xs text-muted-foreground", className),
|
|
142
|
+
...rest,
|
|
143
|
+
}, slots);
|
|
144
|
+
};
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
/** Renders a selectable item. */
|
|
148
|
+
export const SelectItem = defineComponent({
|
|
149
|
+
name: "SelectItem",
|
|
150
|
+
inheritAttrs: false,
|
|
151
|
+
props: {
|
|
152
|
+
value: { type: String, required: true },
|
|
153
|
+
disabled: { type: Boolean, default: false },
|
|
154
|
+
},
|
|
155
|
+
setup(props, { slots, attrs }) {
|
|
156
|
+
return () => {
|
|
157
|
+
const { class: className, ...rest } = attrs;
|
|
158
|
+
return h(RekaSelectItem, {
|
|
159
|
+
"data-slot": "select-item",
|
|
160
|
+
value: props.value,
|
|
161
|
+
disabled: props.disabled,
|
|
162
|
+
class: cn("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
|
|
163
|
+
...rest,
|
|
164
|
+
}, {
|
|
165
|
+
default: () => [
|
|
166
|
+
h(SelectItemText, { class: "flex flex-1 shrink-0 gap-2 whitespace-nowrap" }, { default: () => slots.default?.() }),
|
|
167
|
+
h(SelectItemIndicator, {
|
|
168
|
+
class: "pointer-events-none absolute right-2 flex size-4 items-center justify-center",
|
|
169
|
+
}, { default: () => h(CheckIcon, { class: "pointer-events-none" }) }),
|
|
170
|
+
],
|
|
171
|
+
});
|
|
172
|
+
};
|
|
173
|
+
},
|
|
174
|
+
});
|
|
175
|
+
/** Renders a visual separator between select items. */
|
|
176
|
+
export const SelectSeparator = defineComponent({
|
|
177
|
+
name: "SelectSeparator",
|
|
178
|
+
inheritAttrs: false,
|
|
179
|
+
setup(_props, { attrs }) {
|
|
180
|
+
return () => {
|
|
181
|
+
const { class: className, ...rest } = attrs;
|
|
182
|
+
return h(RekaSelectSeparator, {
|
|
183
|
+
"data-slot": "select-separator",
|
|
184
|
+
class: cn("pointer-events-none -mx-1 my-1 h-px bg-border", className),
|
|
185
|
+
...rest,
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
},
|
|
189
|
+
});
|
|
190
|
+
/** Renders the scroll-up affordance for overflowing select content. */
|
|
191
|
+
export const SelectScrollUpButton = defineComponent({
|
|
192
|
+
name: "SelectScrollUpButton",
|
|
193
|
+
inheritAttrs: false,
|
|
194
|
+
setup(_props, { attrs }) {
|
|
195
|
+
return () => {
|
|
196
|
+
const { class: className, ...rest } = attrs;
|
|
197
|
+
return h(RekaSelectScrollUpButton, {
|
|
198
|
+
"data-slot": "select-scroll-up-button",
|
|
199
|
+
class: cn("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className),
|
|
200
|
+
...rest,
|
|
201
|
+
}, { default: () => h(ChevronUpIcon) });
|
|
202
|
+
};
|
|
203
|
+
},
|
|
204
|
+
});
|
|
205
|
+
/** Renders the scroll-down affordance for overflowing select content. */
|
|
206
|
+
export const SelectScrollDownButton = defineComponent({
|
|
207
|
+
name: "SelectScrollDownButton",
|
|
208
|
+
inheritAttrs: false,
|
|
209
|
+
setup(_props, { attrs }) {
|
|
210
|
+
return () => {
|
|
211
|
+
const { class: className, ...rest } = attrs;
|
|
212
|
+
return h(RekaSelectScrollDownButton, {
|
|
213
|
+
"data-slot": "select-scroll-down-button",
|
|
214
|
+
class: cn("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className),
|
|
215
|
+
...rest,
|
|
216
|
+
}, { default: () => h(ChevronDownIcon) });
|
|
217
|
+
};
|
|
218
|
+
},
|
|
219
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** shadcn-compatible textarea component. */
|
|
2
|
+
export declare const Textarea: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
5
|
+
//# sourceMappingURL=textarea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../src/components/textarea.ts"],"names":[],"mappings":"AAGA,4CAA4C;AAC5C,eAAO,MAAM,QAAQ;;2OAgBnB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineComponent, h } from "vue";
|
|
2
|
+
import { cn } from "#lib/utils";
|
|
3
|
+
/** shadcn-compatible textarea component. */
|
|
4
|
+
export const Textarea = defineComponent({
|
|
5
|
+
name: "Textarea",
|
|
6
|
+
inheritAttrs: false,
|
|
7
|
+
setup(_props, { attrs }) {
|
|
8
|
+
return () => {
|
|
9
|
+
const { class: className, ...rest } = attrs;
|
|
10
|
+
return h("textarea", {
|
|
11
|
+
"data-slot": "textarea",
|
|
12
|
+
class: cn("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className),
|
|
13
|
+
...rest,
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { FieldSchema } from "@verikit/core";
|
|
2
|
+
import { type PropType, type VNodeChild } from "vue";
|
|
3
|
+
/** Props for the shared field wrapper used by Verikit inputs. */
|
|
4
|
+
export interface FieldShellProps {
|
|
5
|
+
/** Schema metadata for the rendered field. */
|
|
6
|
+
field: FieldSchema;
|
|
7
|
+
/** Id assigned to the concrete input control. */
|
|
8
|
+
id: string;
|
|
9
|
+
/** Error content rendered below the input. */
|
|
10
|
+
error?: VNodeChild;
|
|
11
|
+
/** Class name applied to the shell container. */
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Renders a label, description, error message, and field control wrapper.
|
|
16
|
+
*/
|
|
17
|
+
export declare const FieldShell: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
18
|
+
field: {
|
|
19
|
+
type: PropType<FieldSchema>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
id: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
error: {
|
|
27
|
+
type: PropType<VNodeChild>;
|
|
28
|
+
required: false;
|
|
29
|
+
};
|
|
30
|
+
className: {
|
|
31
|
+
type: PropType<string | undefined>;
|
|
32
|
+
default: undefined;
|
|
33
|
+
};
|
|
34
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
37
|
+
field: {
|
|
38
|
+
type: PropType<FieldSchema>;
|
|
39
|
+
required: true;
|
|
40
|
+
};
|
|
41
|
+
id: {
|
|
42
|
+
type: StringConstructor;
|
|
43
|
+
required: true;
|
|
44
|
+
};
|
|
45
|
+
error: {
|
|
46
|
+
type: PropType<VNodeChild>;
|
|
47
|
+
required: false;
|
|
48
|
+
};
|
|
49
|
+
className: {
|
|
50
|
+
type: PropType<string | undefined>;
|
|
51
|
+
default: undefined;
|
|
52
|
+
};
|
|
53
|
+
}>> & Readonly<{}>, {
|
|
54
|
+
className: string | undefined;
|
|
55
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
56
|
+
/** Builds ARIA props that connect a field with its description and error. */
|
|
57
|
+
export declare function fieldAriaProps(field: FieldSchema, id: string, error?: VNodeChild): {
|
|
58
|
+
"aria-describedby"?: string;
|
|
59
|
+
"aria-invalid"?: true;
|
|
60
|
+
"aria-required"?: true;
|
|
61
|
+
};
|
|
62
|
+
/** Returns the explicit id or derives a stable id from the field name. */
|
|
63
|
+
export declare function fieldId(field: FieldSchema, id?: string): string;
|
|
64
|
+
//# sourceMappingURL=field-shell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-shell.d.ts","sourceRoot":"","sources":["../../src/fields/field-shell.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAsB,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAIzE,iEAAiE;AACjE,MAAM,WAAW,eAAe;IAC9B,8CAA8C;IAC9C,KAAK,EAAE,WAAW,CAAC;IACnB,iDAAiD;IACjD,EAAE,EAAE,MAAM,CAAC;IACX,8CAA8C;IAC9C,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,eAAO,MAAM,UAAU;;cAGM,QAAQ,CAAC,WAAW,CAAC;;;;;;;;cAEZ,QAAQ,CAAC,UAAU,CAAC;;;;cAEpC,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC;;;;;;;cAJrB,QAAQ,CAAC,WAAW,CAAC;;;;;;;;cAEZ,QAAQ,CAAC,UAAU,CAAC;;;;cAEpC,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC;;;;;4EA0ChD,CAAC;AAEH,6EAA6E;AAC7E,wBAAgB,cAAc,CAC5B,KAAK,EAAE,WAAW,EAClB,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,UAAU,GACjB;IACD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,IAAI,CAAC;CACxB,CAaA;AAED,0EAA0E;AAC1E,wBAAgB,OAAO,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE/D"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { defineComponent, h } from "vue";
|
|
2
|
+
import { Label } from "#components/label";
|
|
3
|
+
import { cn } from "#lib/utils";
|
|
4
|
+
/**
|
|
5
|
+
* Renders a label, description, error message, and field control wrapper.
|
|
6
|
+
*/
|
|
7
|
+
export const FieldShell = defineComponent({
|
|
8
|
+
name: "FieldShell",
|
|
9
|
+
props: {
|
|
10
|
+
field: { type: Object, required: true },
|
|
11
|
+
id: { type: String, required: true },
|
|
12
|
+
error: { type: null, required: false },
|
|
13
|
+
className: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: undefined,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
setup(props, { slots }) {
|
|
19
|
+
return () => {
|
|
20
|
+
const descriptionId = props.field.description
|
|
21
|
+
? `${props.id}-description`
|
|
22
|
+
: undefined;
|
|
23
|
+
const errorId = props.error ? `${props.id}-error` : undefined;
|
|
24
|
+
return h("div", { class: cn("grid gap-2", props.className) }, [
|
|
25
|
+
props.field.label
|
|
26
|
+
? h(Label, { for: props.id, class: "gap-1" }, () => [
|
|
27
|
+
props.field.label,
|
|
28
|
+
props.field.required
|
|
29
|
+
? h("span", { class: "text-destructive", "aria-hidden": "true" }, "*")
|
|
30
|
+
: null,
|
|
31
|
+
])
|
|
32
|
+
: null,
|
|
33
|
+
slots.default?.(),
|
|
34
|
+
props.field.description
|
|
35
|
+
? h("p", { id: descriptionId, class: "text-sm text-muted-foreground" }, props.field.description)
|
|
36
|
+
: null,
|
|
37
|
+
props.error
|
|
38
|
+
? h("p", { id: errorId, class: "text-sm text-destructive" }, props.error)
|
|
39
|
+
: null,
|
|
40
|
+
]);
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
/** Builds ARIA props that connect a field with its description and error. */
|
|
45
|
+
export function fieldAriaProps(field, id, error) {
|
|
46
|
+
const describedBy = [
|
|
47
|
+
field.description ? `${id}-description` : undefined,
|
|
48
|
+
error ? `${id}-error` : undefined,
|
|
49
|
+
]
|
|
50
|
+
.filter(Boolean)
|
|
51
|
+
.join(" ");
|
|
52
|
+
return {
|
|
53
|
+
"aria-describedby": describedBy || undefined,
|
|
54
|
+
"aria-invalid": error ? true : undefined,
|
|
55
|
+
"aria-required": field.required ? true : undefined,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/** Returns the explicit id or derives a stable id from the field name. */
|
|
59
|
+
export function fieldId(field, id) {
|
|
60
|
+
return id ?? `verikit-field-${field.name}`;
|
|
61
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { FieldShell, fieldAriaProps, fieldId } from "./field-shell.js";
|
|
2
|
+
export type { FieldShellProps } from "./field-shell.js";
|
|
3
|
+
export { BooleanField, DateField, DateTimeField, EmailField, FileField, ImageField, NumberField, SelectField, TextareaField, TextField, } from "./inputs.js";
|
|
4
|
+
export { defaultFieldRegistry, getFieldComponent, RenderField, } from "./registry.js";
|
|
5
|
+
export type { RenderFieldProps } from "./registry.js";
|
|
6
|
+
export type { VerikitFieldComponent, VerikitFieldComponentProps, VerikitFieldRegistry, } from "./types.js";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fields/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACvE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EACL,YAAY,EACZ,SAAS,EACT,aAAa,EACb,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACX,WAAW,EACX,aAAa,EACb,SAAS,GACV,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,YAAY,EACV,qBAAqB,EACrB,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { FieldShell, fieldAriaProps, fieldId } from "./field-shell.js";
|
|
2
|
+
export { BooleanField, DateField, DateTimeField, EmailField, FileField, ImageField, NumberField, SelectField, TextareaField, TextField, } from "./inputs.js";
|
|
3
|
+
export { defaultFieldRegistry, getFieldComponent, RenderField, } from "./registry.js";
|