@colletdev/vue 0.1.3
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/README.md +64 -0
- package/dist/accordion.d.ts +68 -0
- package/dist/accordion.js +68 -0
- package/dist/activity-group.d.ts +56 -0
- package/dist/activity-group.js +50 -0
- package/dist/alert.d.ts +94 -0
- package/dist/alert.js +76 -0
- package/dist/autocomplete.d.ts +161 -0
- package/dist/autocomplete.js +132 -0
- package/dist/avatar.d.ts +50 -0
- package/dist/avatar.js +47 -0
- package/dist/backdrop.d.ts +25 -0
- package/dist/backdrop.js +35 -0
- package/dist/badge.d.ts +74 -0
- package/dist/badge.js +59 -0
- package/dist/breadcrumb.d.ts +49 -0
- package/dist/breadcrumb.js +53 -0
- package/dist/button.d.ts +92 -0
- package/dist/button.js +68 -0
- package/dist/card.d.ts +60 -0
- package/dist/card.js +58 -0
- package/dist/carousel.d.ts +97 -0
- package/dist/carousel.js +77 -0
- package/dist/chat-input.d.ts +99 -0
- package/dist/chat-input.js +79 -0
- package/dist/checkbox.d.ts +93 -0
- package/dist/checkbox.js +75 -0
- package/dist/code-block.d.ts +77 -0
- package/dist/code-block.js +59 -0
- package/dist/collapsible.d.ts +73 -0
- package/dist/collapsible.js +62 -0
- package/dist/date-picker.d.ts +145 -0
- package/dist/date-picker.js +111 -0
- package/dist/dialog.d.ts +61 -0
- package/dist/dialog.js +63 -0
- package/dist/drawer.d.ts +61 -0
- package/dist/drawer.js +63 -0
- package/dist/fab.d.ts +81 -0
- package/dist/fab.js +62 -0
- package/dist/file-upload.d.ts +104 -0
- package/dist/file-upload.js +74 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.js +54 -0
- package/dist/label.d.ts +66 -0
- package/dist/label.js +48 -0
- package/dist/listbox.d.ts +65 -0
- package/dist/listbox.js +77 -0
- package/dist/menu.d.ts +83 -0
- package/dist/menu.js +78 -0
- package/dist/message-bubble.d.ts +74 -0
- package/dist/message-bubble.js +67 -0
- package/dist/message-group.d.ts +51 -0
- package/dist/message-group.js +59 -0
- package/dist/message-part.d.ts +3 -0
- package/dist/message-part.js +25 -0
- package/dist/pagination.d.ts +81 -0
- package/dist/pagination.js +59 -0
- package/dist/popover.d.ts +104 -0
- package/dist/popover.js +92 -0
- package/dist/profile-menu.d.ts +77 -0
- package/dist/profile-menu.js +72 -0
- package/dist/progress.d.ts +50 -0
- package/dist/progress.js +48 -0
- package/dist/radio-group.d.ts +92 -0
- package/dist/radio-group.js +84 -0
- package/dist/scrollbar.d.ts +48 -0
- package/dist/scrollbar.js +55 -0
- package/dist/search-bar.d.ts +127 -0
- package/dist/search-bar.js +105 -0
- package/dist/select.d.ts +124 -0
- package/dist/select.js +114 -0
- package/dist/separator.d.ts +51 -0
- package/dist/separator.js +42 -0
- package/dist/sidebar.d.ts +69 -0
- package/dist/sidebar.js +68 -0
- package/dist/skeleton.d.ts +42 -0
- package/dist/skeleton.js +44 -0
- package/dist/slider.d.ts +133 -0
- package/dist/slider.js +98 -0
- package/dist/speed-dial.d.ts +103 -0
- package/dist/speed-dial.js +79 -0
- package/dist/spinner.d.ts +30 -0
- package/dist/spinner.js +38 -0
- package/dist/split-button.d.ts +101 -0
- package/dist/split-button.js +77 -0
- package/dist/stepper.d.ts +67 -0
- package/dist/stepper.js +62 -0
- package/dist/switch.d.ts +100 -0
- package/dist/switch.js +75 -0
- package/dist/table.d.ts +135 -0
- package/dist/table.js +147 -0
- package/dist/tabs.d.ts +65 -0
- package/dist/tabs.js +67 -0
- package/dist/text-input.d.ts +193 -0
- package/dist/text-input.js +134 -0
- package/dist/text.d.ts +99 -0
- package/dist/text.js +88 -0
- package/dist/thinking.d.ts +42 -0
- package/dist/thinking.js +44 -0
- package/dist/toast.d.ts +86 -0
- package/dist/toast.js +72 -0
- package/dist/toggle-group.d.ts +83 -0
- package/dist/toggle-group.js +77 -0
- package/dist/tooltip.d.ts +52 -0
- package/dist/tooltip.js +50 -0
- package/dist/types.d.ts +256 -0
- package/dist/types.js +4 -0
- package/package.json +44 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import type { FocusDetail, KeyboardDetail, RadioOption, SelectDetail } from './types.js';
|
|
3
|
+
export declare const RadioGroup: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
name: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
};
|
|
7
|
+
legend: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
options: {
|
|
12
|
+
type: PropType<RadioOption[] | string>;
|
|
13
|
+
};
|
|
14
|
+
shape: {
|
|
15
|
+
type: PropType<"round" | "rounded">;
|
|
16
|
+
};
|
|
17
|
+
orientation: {
|
|
18
|
+
type: PropType<"vertical" | "horizontal">;
|
|
19
|
+
};
|
|
20
|
+
size: {
|
|
21
|
+
type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
|
|
22
|
+
};
|
|
23
|
+
selected: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
};
|
|
26
|
+
disabled: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
};
|
|
29
|
+
required: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
};
|
|
32
|
+
helperText: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
};
|
|
35
|
+
error: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
};
|
|
38
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
39
|
+
[key: string]: any;
|
|
40
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
41
|
+
'cx-input': (event: CustomEvent) => true;
|
|
42
|
+
'cx-change': (event: CustomEvent<SelectDetail>) => true;
|
|
43
|
+
'cx-focus': (event: CustomEvent<FocusDetail>) => true;
|
|
44
|
+
'cx-blur': (event: CustomEvent<FocusDetail>) => true;
|
|
45
|
+
'cx-keydown': (event: CustomEvent<KeyboardDetail>) => true;
|
|
46
|
+
'cx-keyup': (event: CustomEvent<KeyboardDetail>) => true;
|
|
47
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
48
|
+
name: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
};
|
|
51
|
+
legend: {
|
|
52
|
+
type: StringConstructor;
|
|
53
|
+
required: true;
|
|
54
|
+
};
|
|
55
|
+
options: {
|
|
56
|
+
type: PropType<RadioOption[] | string>;
|
|
57
|
+
};
|
|
58
|
+
shape: {
|
|
59
|
+
type: PropType<"round" | "rounded">;
|
|
60
|
+
};
|
|
61
|
+
orientation: {
|
|
62
|
+
type: PropType<"vertical" | "horizontal">;
|
|
63
|
+
};
|
|
64
|
+
size: {
|
|
65
|
+
type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
|
|
66
|
+
};
|
|
67
|
+
selected: {
|
|
68
|
+
type: StringConstructor;
|
|
69
|
+
};
|
|
70
|
+
disabled: {
|
|
71
|
+
type: BooleanConstructor;
|
|
72
|
+
};
|
|
73
|
+
required: {
|
|
74
|
+
type: BooleanConstructor;
|
|
75
|
+
};
|
|
76
|
+
helperText: {
|
|
77
|
+
type: StringConstructor;
|
|
78
|
+
};
|
|
79
|
+
error: {
|
|
80
|
+
type: StringConstructor;
|
|
81
|
+
};
|
|
82
|
+
}>> & Readonly<{
|
|
83
|
+
"onCx-change"?: ((event: CustomEvent<SelectDetail>) => any) | undefined;
|
|
84
|
+
"onCx-input"?: ((event: CustomEvent<any>) => any) | undefined;
|
|
85
|
+
"onCx-focus"?: ((event: CustomEvent<FocusDetail>) => any) | undefined;
|
|
86
|
+
"onCx-blur"?: ((event: CustomEvent<FocusDetail>) => any) | undefined;
|
|
87
|
+
"onCx-keydown"?: ((event: CustomEvent<KeyboardDetail>) => any) | undefined;
|
|
88
|
+
"onCx-keyup"?: ((event: CustomEvent<KeyboardDetail>) => any) | undefined;
|
|
89
|
+
}>, {
|
|
90
|
+
disabled: boolean;
|
|
91
|
+
required: boolean;
|
|
92
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// Auto-generated by scripts/generate-vue.mjs — DO NOT EDIT
|
|
2
|
+
// Vue 3 wrapper for <cx-radio-group>
|
|
3
|
+
import { defineComponent, ref, h, onMounted, watch } from 'vue';
|
|
4
|
+
export const RadioGroup = defineComponent({
|
|
5
|
+
name: 'RadioGroup',
|
|
6
|
+
props: {
|
|
7
|
+
name: { type: String },
|
|
8
|
+
legend: { type: String, required: true },
|
|
9
|
+
options: { type: [Array, Object, String] },
|
|
10
|
+
shape: { type: String },
|
|
11
|
+
orientation: { type: String },
|
|
12
|
+
size: { type: String },
|
|
13
|
+
selected: { type: String },
|
|
14
|
+
disabled: { type: Boolean },
|
|
15
|
+
required: { type: Boolean },
|
|
16
|
+
helperText: { type: String },
|
|
17
|
+
error: { type: String },
|
|
18
|
+
},
|
|
19
|
+
emits: {
|
|
20
|
+
'cx-input': (event) => true,
|
|
21
|
+
'cx-change': (event) => true,
|
|
22
|
+
'cx-focus': (event) => true,
|
|
23
|
+
'cx-blur': (event) => true,
|
|
24
|
+
'cx-keydown': (event) => true,
|
|
25
|
+
'cx-keyup': (event) => true,
|
|
26
|
+
},
|
|
27
|
+
setup(props, { emit, slots, expose }) {
|
|
28
|
+
const el = ref(null);
|
|
29
|
+
const listeners = [];
|
|
30
|
+
onMounted(() => {
|
|
31
|
+
if (!el.value)
|
|
32
|
+
return;
|
|
33
|
+
watch(() => props.name, (val) => {
|
|
34
|
+
if (!el.value)
|
|
35
|
+
return;
|
|
36
|
+
if (val != null)
|
|
37
|
+
el.value.setAttribute('name', String(val));
|
|
38
|
+
else
|
|
39
|
+
el.value.removeAttribute('name');
|
|
40
|
+
}, { immediate: true });
|
|
41
|
+
watch(() => props.options, (val) => {
|
|
42
|
+
if (!el.value)
|
|
43
|
+
return;
|
|
44
|
+
if (val != null)
|
|
45
|
+
el.value.setAttribute('options', typeof val === 'object' ? JSON.stringify(val) : String(val));
|
|
46
|
+
else
|
|
47
|
+
el.value.removeAttribute('options');
|
|
48
|
+
}, { immediate: true });
|
|
49
|
+
// Event listeners
|
|
50
|
+
el.value.addEventListener('cx-input', (ev) => emit('cx-input', ev));
|
|
51
|
+
el.value.addEventListener('cx-change', (ev) => emit('cx-change', ev));
|
|
52
|
+
el.value.addEventListener('cx-focus', (ev) => emit('cx-focus', ev));
|
|
53
|
+
el.value.addEventListener('cx-blur', (ev) => emit('cx-blur', ev));
|
|
54
|
+
el.value.addEventListener('cx-keydown', (ev) => emit('cx-keydown', ev));
|
|
55
|
+
el.value.addEventListener('cx-keyup', (ev) => emit('cx-keyup', ev));
|
|
56
|
+
});
|
|
57
|
+
expose({
|
|
58
|
+
/** The underlying Custom Element. */
|
|
59
|
+
el,
|
|
60
|
+
});
|
|
61
|
+
return () => {
|
|
62
|
+
const attrs = {};
|
|
63
|
+
if (props.legend != null)
|
|
64
|
+
attrs['legend'] = typeof props.legend === 'object' ? JSON.stringify(props.legend) : String(props.legend);
|
|
65
|
+
if (props.shape != null)
|
|
66
|
+
attrs['shape'] = typeof props.shape === 'object' ? JSON.stringify(props.shape) : String(props.shape);
|
|
67
|
+
if (props.orientation != null)
|
|
68
|
+
attrs['orientation'] = typeof props.orientation === 'object' ? JSON.stringify(props.orientation) : String(props.orientation);
|
|
69
|
+
if (props.size != null)
|
|
70
|
+
attrs['size'] = typeof props.size === 'object' ? JSON.stringify(props.size) : String(props.size);
|
|
71
|
+
if (props.selected != null)
|
|
72
|
+
attrs['selected'] = typeof props.selected === 'object' ? JSON.stringify(props.selected) : String(props.selected);
|
|
73
|
+
if (props.disabled)
|
|
74
|
+
attrs['disabled'] = '';
|
|
75
|
+
if (props.required)
|
|
76
|
+
attrs['required'] = '';
|
|
77
|
+
if (props.helperText != null)
|
|
78
|
+
attrs['helper-text'] = typeof props.helperText === 'object' ? JSON.stringify(props.helperText) : String(props.helperText);
|
|
79
|
+
if (props.error != null)
|
|
80
|
+
attrs['error'] = typeof props.error === 'object' ? JSON.stringify(props.error) : String(props.error);
|
|
81
|
+
return h('cx-radio-group', { ref: el, ...attrs });
|
|
82
|
+
};
|
|
83
|
+
},
|
|
84
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
export declare const Scrollbar: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
id: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
};
|
|
6
|
+
shape: {
|
|
7
|
+
type: PropType<"sharp" | "rounded" | "pill">;
|
|
8
|
+
};
|
|
9
|
+
track: {
|
|
10
|
+
type: PropType<"with-track" | "floating">;
|
|
11
|
+
};
|
|
12
|
+
axis: {
|
|
13
|
+
type: PropType<"vertical" | "horizontal" | "both">;
|
|
14
|
+
};
|
|
15
|
+
size: {
|
|
16
|
+
type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
|
|
17
|
+
};
|
|
18
|
+
height: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
};
|
|
21
|
+
label: {
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
};
|
|
24
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
27
|
+
id: {
|
|
28
|
+
type: StringConstructor;
|
|
29
|
+
};
|
|
30
|
+
shape: {
|
|
31
|
+
type: PropType<"sharp" | "rounded" | "pill">;
|
|
32
|
+
};
|
|
33
|
+
track: {
|
|
34
|
+
type: PropType<"with-track" | "floating">;
|
|
35
|
+
};
|
|
36
|
+
axis: {
|
|
37
|
+
type: PropType<"vertical" | "horizontal" | "both">;
|
|
38
|
+
};
|
|
39
|
+
size: {
|
|
40
|
+
type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
|
|
41
|
+
};
|
|
42
|
+
height: {
|
|
43
|
+
type: StringConstructor;
|
|
44
|
+
};
|
|
45
|
+
label: {
|
|
46
|
+
type: StringConstructor;
|
|
47
|
+
};
|
|
48
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Auto-generated by scripts/generate-vue.mjs — DO NOT EDIT
|
|
2
|
+
// Vue 3 wrapper for <cx-scrollbar>
|
|
3
|
+
import { defineComponent, ref, h, onMounted, watch } from 'vue';
|
|
4
|
+
export const Scrollbar = defineComponent({
|
|
5
|
+
name: 'Scrollbar',
|
|
6
|
+
props: {
|
|
7
|
+
id: { type: String },
|
|
8
|
+
shape: { type: String },
|
|
9
|
+
track: { type: String },
|
|
10
|
+
axis: { type: String },
|
|
11
|
+
size: { type: String },
|
|
12
|
+
height: { type: String },
|
|
13
|
+
label: { type: String },
|
|
14
|
+
},
|
|
15
|
+
emits: {},
|
|
16
|
+
setup(props, { emit, slots, expose }) {
|
|
17
|
+
const el = ref(null);
|
|
18
|
+
const listeners = [];
|
|
19
|
+
onMounted(() => {
|
|
20
|
+
if (!el.value)
|
|
21
|
+
return;
|
|
22
|
+
watch(() => props.height, (val) => {
|
|
23
|
+
if (!el.value)
|
|
24
|
+
return;
|
|
25
|
+
if (val != null)
|
|
26
|
+
el.value.setAttribute('height', String(val));
|
|
27
|
+
else
|
|
28
|
+
el.value.removeAttribute('height');
|
|
29
|
+
}, { immediate: true });
|
|
30
|
+
// Event listeners
|
|
31
|
+
});
|
|
32
|
+
expose({
|
|
33
|
+
/** The underlying Custom Element. */
|
|
34
|
+
el,
|
|
35
|
+
});
|
|
36
|
+
return () => {
|
|
37
|
+
const attrs = {};
|
|
38
|
+
if (props.id != null)
|
|
39
|
+
attrs['id'] = typeof props.id === 'object' ? JSON.stringify(props.id) : String(props.id);
|
|
40
|
+
if (props.shape != null)
|
|
41
|
+
attrs['shape'] = typeof props.shape === 'object' ? JSON.stringify(props.shape) : String(props.shape);
|
|
42
|
+
if (props.track != null)
|
|
43
|
+
attrs['track'] = typeof props.track === 'object' ? JSON.stringify(props.track) : String(props.track);
|
|
44
|
+
if (props.axis != null)
|
|
45
|
+
attrs['axis'] = typeof props.axis === 'object' ? JSON.stringify(props.axis) : String(props.axis);
|
|
46
|
+
if (props.size != null)
|
|
47
|
+
attrs['size'] = typeof props.size === 'object' ? JSON.stringify(props.size) : String(props.size);
|
|
48
|
+
if (props.label != null)
|
|
49
|
+
attrs['label'] = typeof props.label === 'object' ? JSON.stringify(props.label) : String(props.label);
|
|
50
|
+
return h('cx-scrollbar', { ref: el, ...attrs }, [
|
|
51
|
+
slots.default?.()
|
|
52
|
+
]);
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
});
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import type { FocusDetail, KeyboardDetail } from './types.js';
|
|
3
|
+
export interface SearchBarRef {
|
|
4
|
+
/** Focuses the search input. */
|
|
5
|
+
focus(): void;
|
|
6
|
+
/** Clears the search input value. */
|
|
7
|
+
clear(): void;
|
|
8
|
+
/** The underlying Custom Element. */
|
|
9
|
+
el: HTMLElement | null;
|
|
10
|
+
}
|
|
11
|
+
export declare const SearchBar: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
12
|
+
id: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
};
|
|
15
|
+
placeholder: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
};
|
|
18
|
+
label: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
};
|
|
21
|
+
variant: {
|
|
22
|
+
type: PropType<"outline" | "filled" | "ghost">;
|
|
23
|
+
};
|
|
24
|
+
shape: {
|
|
25
|
+
type: PropType<"sharp" | "rounded" | "pill">;
|
|
26
|
+
};
|
|
27
|
+
size: {
|
|
28
|
+
type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
|
|
29
|
+
};
|
|
30
|
+
name: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
};
|
|
33
|
+
value: {
|
|
34
|
+
type: StringConstructor;
|
|
35
|
+
};
|
|
36
|
+
debounceMs: {
|
|
37
|
+
type: NumberConstructor;
|
|
38
|
+
};
|
|
39
|
+
loading: {
|
|
40
|
+
type: BooleanConstructor;
|
|
41
|
+
};
|
|
42
|
+
shortcut: {
|
|
43
|
+
type: StringConstructor;
|
|
44
|
+
};
|
|
45
|
+
expandable: {
|
|
46
|
+
type: BooleanConstructor;
|
|
47
|
+
};
|
|
48
|
+
disabled: {
|
|
49
|
+
type: BooleanConstructor;
|
|
50
|
+
};
|
|
51
|
+
readonly: {
|
|
52
|
+
type: BooleanConstructor;
|
|
53
|
+
};
|
|
54
|
+
controls: {
|
|
55
|
+
type: StringConstructor;
|
|
56
|
+
};
|
|
57
|
+
shimmer: {
|
|
58
|
+
type: BooleanConstructor;
|
|
59
|
+
};
|
|
60
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
61
|
+
[key: string]: any;
|
|
62
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
63
|
+
'cx-focus': (event: CustomEvent<FocusDetail>) => true;
|
|
64
|
+
'cx-blur': (event: CustomEvent<FocusDetail>) => true;
|
|
65
|
+
'cx-keydown': (event: CustomEvent<KeyboardDetail>) => true;
|
|
66
|
+
'cx-keyup': (event: CustomEvent<KeyboardDetail>) => true;
|
|
67
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
68
|
+
id: {
|
|
69
|
+
type: StringConstructor;
|
|
70
|
+
};
|
|
71
|
+
placeholder: {
|
|
72
|
+
type: StringConstructor;
|
|
73
|
+
};
|
|
74
|
+
label: {
|
|
75
|
+
type: StringConstructor;
|
|
76
|
+
};
|
|
77
|
+
variant: {
|
|
78
|
+
type: PropType<"outline" | "filled" | "ghost">;
|
|
79
|
+
};
|
|
80
|
+
shape: {
|
|
81
|
+
type: PropType<"sharp" | "rounded" | "pill">;
|
|
82
|
+
};
|
|
83
|
+
size: {
|
|
84
|
+
type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
|
|
85
|
+
};
|
|
86
|
+
name: {
|
|
87
|
+
type: StringConstructor;
|
|
88
|
+
};
|
|
89
|
+
value: {
|
|
90
|
+
type: StringConstructor;
|
|
91
|
+
};
|
|
92
|
+
debounceMs: {
|
|
93
|
+
type: NumberConstructor;
|
|
94
|
+
};
|
|
95
|
+
loading: {
|
|
96
|
+
type: BooleanConstructor;
|
|
97
|
+
};
|
|
98
|
+
shortcut: {
|
|
99
|
+
type: StringConstructor;
|
|
100
|
+
};
|
|
101
|
+
expandable: {
|
|
102
|
+
type: BooleanConstructor;
|
|
103
|
+
};
|
|
104
|
+
disabled: {
|
|
105
|
+
type: BooleanConstructor;
|
|
106
|
+
};
|
|
107
|
+
readonly: {
|
|
108
|
+
type: BooleanConstructor;
|
|
109
|
+
};
|
|
110
|
+
controls: {
|
|
111
|
+
type: StringConstructor;
|
|
112
|
+
};
|
|
113
|
+
shimmer: {
|
|
114
|
+
type: BooleanConstructor;
|
|
115
|
+
};
|
|
116
|
+
}>> & Readonly<{
|
|
117
|
+
"onCx-focus"?: ((event: CustomEvent<FocusDetail>) => any) | undefined;
|
|
118
|
+
"onCx-blur"?: ((event: CustomEvent<FocusDetail>) => any) | undefined;
|
|
119
|
+
"onCx-keydown"?: ((event: CustomEvent<KeyboardDetail>) => any) | undefined;
|
|
120
|
+
"onCx-keyup"?: ((event: CustomEvent<KeyboardDetail>) => any) | undefined;
|
|
121
|
+
}>, {
|
|
122
|
+
loading: boolean;
|
|
123
|
+
disabled: boolean;
|
|
124
|
+
readonly: boolean;
|
|
125
|
+
expandable: boolean;
|
|
126
|
+
shimmer: boolean;
|
|
127
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// Auto-generated by scripts/generate-vue.mjs — DO NOT EDIT
|
|
2
|
+
// Vue 3 wrapper for <cx-search-bar>
|
|
3
|
+
import { defineComponent, ref, h, onMounted, watch } from 'vue';
|
|
4
|
+
export const SearchBar = defineComponent({
|
|
5
|
+
name: 'SearchBar',
|
|
6
|
+
props: {
|
|
7
|
+
id: { type: String },
|
|
8
|
+
placeholder: { type: String },
|
|
9
|
+
label: { type: String },
|
|
10
|
+
variant: { type: String },
|
|
11
|
+
shape: { type: String },
|
|
12
|
+
size: { type: String },
|
|
13
|
+
name: { type: String },
|
|
14
|
+
value: { type: String },
|
|
15
|
+
debounceMs: { type: Number },
|
|
16
|
+
loading: { type: Boolean },
|
|
17
|
+
shortcut: { type: String },
|
|
18
|
+
expandable: { type: Boolean },
|
|
19
|
+
disabled: { type: Boolean },
|
|
20
|
+
readonly: { type: Boolean },
|
|
21
|
+
controls: { type: String },
|
|
22
|
+
shimmer: { type: Boolean },
|
|
23
|
+
},
|
|
24
|
+
emits: {
|
|
25
|
+
'cx-focus': (event) => true,
|
|
26
|
+
'cx-blur': (event) => true,
|
|
27
|
+
'cx-keydown': (event) => true,
|
|
28
|
+
'cx-keyup': (event) => true,
|
|
29
|
+
},
|
|
30
|
+
setup(props, { emit, slots, expose }) {
|
|
31
|
+
const el = ref(null);
|
|
32
|
+
const listeners = [];
|
|
33
|
+
onMounted(() => {
|
|
34
|
+
if (!el.value)
|
|
35
|
+
return;
|
|
36
|
+
watch(() => props.name, (val) => {
|
|
37
|
+
if (!el.value)
|
|
38
|
+
return;
|
|
39
|
+
if (val != null)
|
|
40
|
+
el.value.setAttribute('name', String(val));
|
|
41
|
+
else
|
|
42
|
+
el.value.removeAttribute('name');
|
|
43
|
+
}, { immediate: true });
|
|
44
|
+
watch(() => props.value, (val) => {
|
|
45
|
+
if (!el.value)
|
|
46
|
+
return;
|
|
47
|
+
if (val != null)
|
|
48
|
+
el.value.setAttribute('value', String(val));
|
|
49
|
+
else
|
|
50
|
+
el.value.removeAttribute('value');
|
|
51
|
+
}, { immediate: true });
|
|
52
|
+
watch(() => props.loading, (val) => {
|
|
53
|
+
if (!el.value)
|
|
54
|
+
return;
|
|
55
|
+
if (val != null)
|
|
56
|
+
el.value.setAttribute('loading', String(val));
|
|
57
|
+
else
|
|
58
|
+
el.value.removeAttribute('loading');
|
|
59
|
+
}, { immediate: true });
|
|
60
|
+
// Event listeners
|
|
61
|
+
el.value.addEventListener('cx-focus', (ev) => emit('cx-focus', ev));
|
|
62
|
+
el.value.addEventListener('cx-blur', (ev) => emit('cx-blur', ev));
|
|
63
|
+
el.value.addEventListener('cx-keydown', (ev) => emit('cx-keydown', ev));
|
|
64
|
+
el.value.addEventListener('cx-keyup', (ev) => emit('cx-keyup', ev));
|
|
65
|
+
});
|
|
66
|
+
expose({
|
|
67
|
+
/** Focuses the search input. */
|
|
68
|
+
focus() { el.value?.focus(); },
|
|
69
|
+
/** Clears the search input value. */
|
|
70
|
+
clear() { el.value?.clear(); },
|
|
71
|
+
/** The underlying Custom Element. */
|
|
72
|
+
el,
|
|
73
|
+
});
|
|
74
|
+
return () => {
|
|
75
|
+
const attrs = {};
|
|
76
|
+
if (props.id != null)
|
|
77
|
+
attrs['id'] = typeof props.id === 'object' ? JSON.stringify(props.id) : String(props.id);
|
|
78
|
+
if (props.placeholder != null)
|
|
79
|
+
attrs['placeholder'] = typeof props.placeholder === 'object' ? JSON.stringify(props.placeholder) : String(props.placeholder);
|
|
80
|
+
if (props.label != null)
|
|
81
|
+
attrs['label'] = typeof props.label === 'object' ? JSON.stringify(props.label) : String(props.label);
|
|
82
|
+
if (props.variant != null)
|
|
83
|
+
attrs['variant'] = typeof props.variant === 'object' ? JSON.stringify(props.variant) : String(props.variant);
|
|
84
|
+
if (props.shape != null)
|
|
85
|
+
attrs['shape'] = typeof props.shape === 'object' ? JSON.stringify(props.shape) : String(props.shape);
|
|
86
|
+
if (props.size != null)
|
|
87
|
+
attrs['size'] = typeof props.size === 'object' ? JSON.stringify(props.size) : String(props.size);
|
|
88
|
+
if (props.debounceMs != null)
|
|
89
|
+
attrs['debounce-ms'] = typeof props.debounceMs === 'object' ? JSON.stringify(props.debounceMs) : String(props.debounceMs);
|
|
90
|
+
if (props.shortcut != null)
|
|
91
|
+
attrs['shortcut'] = typeof props.shortcut === 'object' ? JSON.stringify(props.shortcut) : String(props.shortcut);
|
|
92
|
+
if (props.expandable)
|
|
93
|
+
attrs['expandable'] = '';
|
|
94
|
+
if (props.disabled)
|
|
95
|
+
attrs['disabled'] = '';
|
|
96
|
+
if (props.readonly)
|
|
97
|
+
attrs['readonly'] = '';
|
|
98
|
+
if (props.controls != null)
|
|
99
|
+
attrs['controls'] = typeof props.controls === 'object' ? JSON.stringify(props.controls) : String(props.controls);
|
|
100
|
+
if (props.shimmer)
|
|
101
|
+
attrs['shimmer'] = '';
|
|
102
|
+
return h('cx-search-bar', { ref: el, ...attrs });
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
});
|
package/dist/select.d.ts
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import type { FocusDetail, InputDetail, KeyboardDetail, OptionGroup, SelectDetail, SelectOption } from './types.js';
|
|
3
|
+
export interface SelectRef {
|
|
4
|
+
/** Opens the dropdown. */
|
|
5
|
+
open(): void;
|
|
6
|
+
/** Closes the dropdown. */
|
|
7
|
+
close(): void;
|
|
8
|
+
/** Focuses the trigger button. */
|
|
9
|
+
focus(): void;
|
|
10
|
+
/** The underlying Custom Element. */
|
|
11
|
+
el: HTMLElement | null;
|
|
12
|
+
}
|
|
13
|
+
export declare const Select: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
14
|
+
id: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
};
|
|
17
|
+
label: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
};
|
|
20
|
+
variant: {
|
|
21
|
+
type: PropType<"outline" | "filled" | "ghost">;
|
|
22
|
+
};
|
|
23
|
+
shape: {
|
|
24
|
+
type: PropType<"sharp" | "rounded" | "pill">;
|
|
25
|
+
};
|
|
26
|
+
size: {
|
|
27
|
+
type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
|
|
28
|
+
};
|
|
29
|
+
mode: {
|
|
30
|
+
type: PropType<"single" | "multiple">;
|
|
31
|
+
};
|
|
32
|
+
selected: {
|
|
33
|
+
type: PropType<string[] | string>;
|
|
34
|
+
};
|
|
35
|
+
placeholder: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
};
|
|
38
|
+
helperText: {
|
|
39
|
+
type: StringConstructor;
|
|
40
|
+
};
|
|
41
|
+
error: {
|
|
42
|
+
type: StringConstructor;
|
|
43
|
+
};
|
|
44
|
+
disabled: {
|
|
45
|
+
type: BooleanConstructor;
|
|
46
|
+
};
|
|
47
|
+
required: {
|
|
48
|
+
type: BooleanConstructor;
|
|
49
|
+
};
|
|
50
|
+
name: {
|
|
51
|
+
type: StringConstructor;
|
|
52
|
+
};
|
|
53
|
+
items: {
|
|
54
|
+
type: PropType<SelectOption[] | string>;
|
|
55
|
+
};
|
|
56
|
+
groups: {
|
|
57
|
+
type: PropType<OptionGroup[] | string>;
|
|
58
|
+
};
|
|
59
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
60
|
+
[key: string]: any;
|
|
61
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
62
|
+
'cx-input': (event: CustomEvent<InputDetail>) => true;
|
|
63
|
+
'cx-change': (event: CustomEvent<SelectDetail>) => true;
|
|
64
|
+
'cx-focus': (event: CustomEvent<FocusDetail>) => true;
|
|
65
|
+
'cx-blur': (event: CustomEvent<FocusDetail>) => true;
|
|
66
|
+
'cx-keydown': (event: CustomEvent<KeyboardDetail>) => true;
|
|
67
|
+
'cx-keyup': (event: CustomEvent<KeyboardDetail>) => true;
|
|
68
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
69
|
+
id: {
|
|
70
|
+
type: StringConstructor;
|
|
71
|
+
};
|
|
72
|
+
label: {
|
|
73
|
+
type: StringConstructor;
|
|
74
|
+
};
|
|
75
|
+
variant: {
|
|
76
|
+
type: PropType<"outline" | "filled" | "ghost">;
|
|
77
|
+
};
|
|
78
|
+
shape: {
|
|
79
|
+
type: PropType<"sharp" | "rounded" | "pill">;
|
|
80
|
+
};
|
|
81
|
+
size: {
|
|
82
|
+
type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
|
|
83
|
+
};
|
|
84
|
+
mode: {
|
|
85
|
+
type: PropType<"single" | "multiple">;
|
|
86
|
+
};
|
|
87
|
+
selected: {
|
|
88
|
+
type: PropType<string[] | string>;
|
|
89
|
+
};
|
|
90
|
+
placeholder: {
|
|
91
|
+
type: StringConstructor;
|
|
92
|
+
};
|
|
93
|
+
helperText: {
|
|
94
|
+
type: StringConstructor;
|
|
95
|
+
};
|
|
96
|
+
error: {
|
|
97
|
+
type: StringConstructor;
|
|
98
|
+
};
|
|
99
|
+
disabled: {
|
|
100
|
+
type: BooleanConstructor;
|
|
101
|
+
};
|
|
102
|
+
required: {
|
|
103
|
+
type: BooleanConstructor;
|
|
104
|
+
};
|
|
105
|
+
name: {
|
|
106
|
+
type: StringConstructor;
|
|
107
|
+
};
|
|
108
|
+
items: {
|
|
109
|
+
type: PropType<SelectOption[] | string>;
|
|
110
|
+
};
|
|
111
|
+
groups: {
|
|
112
|
+
type: PropType<OptionGroup[] | string>;
|
|
113
|
+
};
|
|
114
|
+
}>> & Readonly<{
|
|
115
|
+
"onCx-change"?: ((event: CustomEvent<SelectDetail>) => any) | undefined;
|
|
116
|
+
"onCx-input"?: ((event: CustomEvent<InputDetail>) => any) | undefined;
|
|
117
|
+
"onCx-focus"?: ((event: CustomEvent<FocusDetail>) => any) | undefined;
|
|
118
|
+
"onCx-blur"?: ((event: CustomEvent<FocusDetail>) => any) | undefined;
|
|
119
|
+
"onCx-keydown"?: ((event: CustomEvent<KeyboardDetail>) => any) | undefined;
|
|
120
|
+
"onCx-keyup"?: ((event: CustomEvent<KeyboardDetail>) => any) | undefined;
|
|
121
|
+
}>, {
|
|
122
|
+
disabled: boolean;
|
|
123
|
+
required: boolean;
|
|
124
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|