@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.
Files changed (108) hide show
  1. package/README.md +64 -0
  2. package/dist/accordion.d.ts +68 -0
  3. package/dist/accordion.js +68 -0
  4. package/dist/activity-group.d.ts +56 -0
  5. package/dist/activity-group.js +50 -0
  6. package/dist/alert.d.ts +94 -0
  7. package/dist/alert.js +76 -0
  8. package/dist/autocomplete.d.ts +161 -0
  9. package/dist/autocomplete.js +132 -0
  10. package/dist/avatar.d.ts +50 -0
  11. package/dist/avatar.js +47 -0
  12. package/dist/backdrop.d.ts +25 -0
  13. package/dist/backdrop.js +35 -0
  14. package/dist/badge.d.ts +74 -0
  15. package/dist/badge.js +59 -0
  16. package/dist/breadcrumb.d.ts +49 -0
  17. package/dist/breadcrumb.js +53 -0
  18. package/dist/button.d.ts +92 -0
  19. package/dist/button.js +68 -0
  20. package/dist/card.d.ts +60 -0
  21. package/dist/card.js +58 -0
  22. package/dist/carousel.d.ts +97 -0
  23. package/dist/carousel.js +77 -0
  24. package/dist/chat-input.d.ts +99 -0
  25. package/dist/chat-input.js +79 -0
  26. package/dist/checkbox.d.ts +93 -0
  27. package/dist/checkbox.js +75 -0
  28. package/dist/code-block.d.ts +77 -0
  29. package/dist/code-block.js +59 -0
  30. package/dist/collapsible.d.ts +73 -0
  31. package/dist/collapsible.js +62 -0
  32. package/dist/date-picker.d.ts +145 -0
  33. package/dist/date-picker.js +111 -0
  34. package/dist/dialog.d.ts +61 -0
  35. package/dist/dialog.js +63 -0
  36. package/dist/drawer.d.ts +61 -0
  37. package/dist/drawer.js +63 -0
  38. package/dist/fab.d.ts +81 -0
  39. package/dist/fab.js +62 -0
  40. package/dist/file-upload.d.ts +104 -0
  41. package/dist/file-upload.js +74 -0
  42. package/dist/index.d.ts +54 -0
  43. package/dist/index.js +54 -0
  44. package/dist/label.d.ts +66 -0
  45. package/dist/label.js +48 -0
  46. package/dist/listbox.d.ts +65 -0
  47. package/dist/listbox.js +77 -0
  48. package/dist/menu.d.ts +83 -0
  49. package/dist/menu.js +78 -0
  50. package/dist/message-bubble.d.ts +74 -0
  51. package/dist/message-bubble.js +67 -0
  52. package/dist/message-group.d.ts +51 -0
  53. package/dist/message-group.js +59 -0
  54. package/dist/message-part.d.ts +3 -0
  55. package/dist/message-part.js +25 -0
  56. package/dist/pagination.d.ts +81 -0
  57. package/dist/pagination.js +59 -0
  58. package/dist/popover.d.ts +104 -0
  59. package/dist/popover.js +92 -0
  60. package/dist/profile-menu.d.ts +77 -0
  61. package/dist/profile-menu.js +72 -0
  62. package/dist/progress.d.ts +50 -0
  63. package/dist/progress.js +48 -0
  64. package/dist/radio-group.d.ts +92 -0
  65. package/dist/radio-group.js +84 -0
  66. package/dist/scrollbar.d.ts +48 -0
  67. package/dist/scrollbar.js +55 -0
  68. package/dist/search-bar.d.ts +127 -0
  69. package/dist/search-bar.js +105 -0
  70. package/dist/select.d.ts +124 -0
  71. package/dist/select.js +114 -0
  72. package/dist/separator.d.ts +51 -0
  73. package/dist/separator.js +42 -0
  74. package/dist/sidebar.d.ts +69 -0
  75. package/dist/sidebar.js +68 -0
  76. package/dist/skeleton.d.ts +42 -0
  77. package/dist/skeleton.js +44 -0
  78. package/dist/slider.d.ts +133 -0
  79. package/dist/slider.js +98 -0
  80. package/dist/speed-dial.d.ts +103 -0
  81. package/dist/speed-dial.js +79 -0
  82. package/dist/spinner.d.ts +30 -0
  83. package/dist/spinner.js +38 -0
  84. package/dist/split-button.d.ts +101 -0
  85. package/dist/split-button.js +77 -0
  86. package/dist/stepper.d.ts +67 -0
  87. package/dist/stepper.js +62 -0
  88. package/dist/switch.d.ts +100 -0
  89. package/dist/switch.js +75 -0
  90. package/dist/table.d.ts +135 -0
  91. package/dist/table.js +147 -0
  92. package/dist/tabs.d.ts +65 -0
  93. package/dist/tabs.js +67 -0
  94. package/dist/text-input.d.ts +193 -0
  95. package/dist/text-input.js +134 -0
  96. package/dist/text.d.ts +99 -0
  97. package/dist/text.js +88 -0
  98. package/dist/thinking.d.ts +42 -0
  99. package/dist/thinking.js +44 -0
  100. package/dist/toast.d.ts +86 -0
  101. package/dist/toast.js +72 -0
  102. package/dist/toggle-group.d.ts +83 -0
  103. package/dist/toggle-group.js +77 -0
  104. package/dist/tooltip.d.ts +52 -0
  105. package/dist/tooltip.js +50 -0
  106. package/dist/types.d.ts +256 -0
  107. package/dist/types.js +4 -0
  108. package/package.json +44 -0
package/dist/select.js ADDED
@@ -0,0 +1,114 @@
1
+ // Auto-generated by scripts/generate-vue.mjs — DO NOT EDIT
2
+ // Vue 3 wrapper for <cx-select>
3
+ import { defineComponent, ref, h, onMounted, watch } from 'vue';
4
+ export const Select = defineComponent({
5
+ name: 'Select',
6
+ props: {
7
+ id: { type: String },
8
+ label: { type: String },
9
+ variant: { type: String },
10
+ shape: { type: String },
11
+ size: { type: String },
12
+ mode: { type: String },
13
+ selected: { type: [Array, Object, String] },
14
+ placeholder: { type: String },
15
+ helperText: { type: String },
16
+ error: { type: String },
17
+ disabled: { type: Boolean },
18
+ required: { type: Boolean },
19
+ name: { type: String },
20
+ items: { type: [Array, Object, String] },
21
+ groups: { type: [Array, Object, String] },
22
+ },
23
+ emits: {
24
+ 'cx-input': (event) => true,
25
+ 'cx-change': (event) => true,
26
+ 'cx-focus': (event) => true,
27
+ 'cx-blur': (event) => true,
28
+ 'cx-keydown': (event) => true,
29
+ 'cx-keyup': (event) => true,
30
+ },
31
+ setup(props, { emit, slots, expose }) {
32
+ const el = ref(null);
33
+ const listeners = [];
34
+ onMounted(() => {
35
+ if (!el.value)
36
+ return;
37
+ watch(() => props.name, (val) => {
38
+ if (!el.value)
39
+ return;
40
+ if (val != null)
41
+ el.value.setAttribute('name', String(val));
42
+ else
43
+ el.value.removeAttribute('name');
44
+ }, { immediate: true });
45
+ watch(() => props.selected, (val) => {
46
+ if (!el.value)
47
+ return;
48
+ if (val != null)
49
+ el.value.setAttribute('selected', typeof val === 'object' ? JSON.stringify(val) : String(val));
50
+ else
51
+ el.value.removeAttribute('selected');
52
+ }, { immediate: true });
53
+ watch(() => props.items, (val) => {
54
+ if (!el.value)
55
+ return;
56
+ if (val != null)
57
+ el.value.setAttribute('items', typeof val === 'object' ? JSON.stringify(val) : String(val));
58
+ else
59
+ el.value.removeAttribute('items');
60
+ }, { immediate: true });
61
+ watch(() => props.groups, (val) => {
62
+ if (!el.value)
63
+ return;
64
+ if (val != null)
65
+ el.value.setAttribute('groups', typeof val === 'object' ? JSON.stringify(val) : String(val));
66
+ else
67
+ el.value.removeAttribute('groups');
68
+ }, { immediate: true });
69
+ // Event listeners
70
+ el.value.addEventListener('cx-input', (ev) => emit('cx-input', ev));
71
+ el.value.addEventListener('cx-change', (ev) => emit('cx-change', ev));
72
+ el.value.addEventListener('cx-focus', (ev) => emit('cx-focus', ev));
73
+ el.value.addEventListener('cx-blur', (ev) => emit('cx-blur', ev));
74
+ el.value.addEventListener('cx-keydown', (ev) => emit('cx-keydown', ev));
75
+ el.value.addEventListener('cx-keyup', (ev) => emit('cx-keyup', ev));
76
+ });
77
+ expose({
78
+ /** Opens the dropdown. */
79
+ open() { el.value?.open(); },
80
+ /** Closes the dropdown. */
81
+ close() { el.value?.close(); },
82
+ /** Focuses the trigger button. */
83
+ focus() { el.value?.focus(); },
84
+ /** The underlying Custom Element. */
85
+ el,
86
+ });
87
+ return () => {
88
+ const attrs = {};
89
+ if (props.id != null)
90
+ attrs['id'] = typeof props.id === 'object' ? JSON.stringify(props.id) : String(props.id);
91
+ if (props.label != null)
92
+ attrs['label'] = typeof props.label === 'object' ? JSON.stringify(props.label) : String(props.label);
93
+ if (props.variant != null)
94
+ attrs['variant'] = typeof props.variant === 'object' ? JSON.stringify(props.variant) : String(props.variant);
95
+ if (props.shape != null)
96
+ attrs['shape'] = typeof props.shape === 'object' ? JSON.stringify(props.shape) : String(props.shape);
97
+ if (props.size != null)
98
+ attrs['size'] = typeof props.size === 'object' ? JSON.stringify(props.size) : String(props.size);
99
+ if (props.mode != null)
100
+ attrs['mode'] = typeof props.mode === 'object' ? JSON.stringify(props.mode) : String(props.mode);
101
+ if (props.placeholder != null)
102
+ attrs['placeholder'] = typeof props.placeholder === 'object' ? JSON.stringify(props.placeholder) : String(props.placeholder);
103
+ if (props.helperText != null)
104
+ attrs['helper-text'] = typeof props.helperText === 'object' ? JSON.stringify(props.helperText) : String(props.helperText);
105
+ if (props.error != null)
106
+ attrs['error'] = typeof props.error === 'object' ? JSON.stringify(props.error) : String(props.error);
107
+ if (props.disabled)
108
+ attrs['disabled'] = '';
109
+ if (props.required)
110
+ attrs['required'] = '';
111
+ return h('cx-select', { ref: el, ...attrs });
112
+ };
113
+ },
114
+ });
@@ -0,0 +1,51 @@
1
+ export declare const Separator: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ id: {
3
+ type: StringConstructor;
4
+ required: true;
5
+ };
6
+ variant: {
7
+ type: StringConstructor;
8
+ };
9
+ orientation: {
10
+ type: StringConstructor;
11
+ };
12
+ size: {
13
+ type: StringConstructor;
14
+ };
15
+ label: {
16
+ type: StringConstructor;
17
+ };
18
+ semantic: {
19
+ type: BooleanConstructor;
20
+ };
21
+ color: {
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, never[], never, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
27
+ id: {
28
+ type: StringConstructor;
29
+ required: true;
30
+ };
31
+ variant: {
32
+ type: StringConstructor;
33
+ };
34
+ orientation: {
35
+ type: StringConstructor;
36
+ };
37
+ size: {
38
+ type: StringConstructor;
39
+ };
40
+ label: {
41
+ type: StringConstructor;
42
+ };
43
+ semantic: {
44
+ type: BooleanConstructor;
45
+ };
46
+ color: {
47
+ type: StringConstructor;
48
+ };
49
+ }>> & Readonly<{}>, {
50
+ semantic: boolean;
51
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,42 @@
1
+ // Auto-generated by scripts/generate-vue.mjs — DO NOT EDIT
2
+ // Vue 3 wrapper for <cx-separator>
3
+ import { defineComponent, ref, onMounted, h } from 'vue';
4
+ export const Separator = defineComponent({
5
+ name: 'Separator',
6
+ props: {
7
+ id: { type: String, required: true },
8
+ variant: { type: String },
9
+ orientation: { type: String },
10
+ size: { type: String },
11
+ label: { type: String },
12
+ semantic: { type: Boolean },
13
+ color: { type: String },
14
+ },
15
+ emits: [],
16
+ setup(props, { emit, slots, expose }) {
17
+ const el = ref(null);
18
+ expose({ el });
19
+ onMounted(() => {
20
+ if (!el.value)
21
+ return;
22
+ });
23
+ return () => {
24
+ const attrs = {};
25
+ if (props.id != null)
26
+ attrs['id'] = props.id;
27
+ if (props.variant != null)
28
+ attrs['variant'] = props.variant;
29
+ if (props.orientation != null)
30
+ attrs['orientation'] = props.orientation;
31
+ if (props.size != null)
32
+ attrs['size'] = props.size;
33
+ if (props.label != null)
34
+ attrs['label'] = props.label;
35
+ if (props.semantic)
36
+ attrs['semantic'] = '';
37
+ if (props.color != null)
38
+ attrs['color'] = props.color;
39
+ return h('cx-separator', { ref: el, ...attrs }, slots.default?.());
40
+ };
41
+ },
42
+ });
@@ -0,0 +1,69 @@
1
+ import { type PropType } from 'vue';
2
+ import type { CloseDetail, NavigateDetail, SidebarGroup } from './types.js';
3
+ export interface SidebarRef {
4
+ /** Opens the mobile sidebar drawer. */
5
+ open(): void;
6
+ /** Closes the mobile sidebar drawer. */
7
+ close(): void;
8
+ /** The underlying Custom Element. */
9
+ el: HTMLElement | null;
10
+ }
11
+ export declare const Sidebar: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
12
+ id: {
13
+ type: StringConstructor;
14
+ };
15
+ label: {
16
+ type: StringConstructor;
17
+ };
18
+ groups: {
19
+ type: PropType<SidebarGroup[] | string>;
20
+ };
21
+ separatorsAfter: {
22
+ type: StringConstructor;
23
+ };
24
+ side: {
25
+ type: PropType<"left" | "right">;
26
+ };
27
+ state: {
28
+ type: PropType<"expanded" | "narrow" | "hidden">;
29
+ };
30
+ shape: {
31
+ type: PropType<"sharp" | "rounded" | "pill">;
32
+ };
33
+ size: {
34
+ type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
35
+ };
36
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
37
+ [key: string]: any;
38
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
39
+ 'cx-close': (event: CustomEvent<CloseDetail>) => true;
40
+ 'cx-navigate': (event: CustomEvent<NavigateDetail>) => true;
41
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
42
+ id: {
43
+ type: StringConstructor;
44
+ };
45
+ label: {
46
+ type: StringConstructor;
47
+ };
48
+ groups: {
49
+ type: PropType<SidebarGroup[] | string>;
50
+ };
51
+ separatorsAfter: {
52
+ type: StringConstructor;
53
+ };
54
+ side: {
55
+ type: PropType<"left" | "right">;
56
+ };
57
+ state: {
58
+ type: PropType<"expanded" | "narrow" | "hidden">;
59
+ };
60
+ shape: {
61
+ type: PropType<"sharp" | "rounded" | "pill">;
62
+ };
63
+ size: {
64
+ type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
65
+ };
66
+ }>> & Readonly<{
67
+ "onCx-navigate"?: ((event: CustomEvent<NavigateDetail>) => any) | undefined;
68
+ "onCx-close"?: ((event: CustomEvent<CloseDetail>) => any) | undefined;
69
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,68 @@
1
+ // Auto-generated by scripts/generate-vue.mjs — DO NOT EDIT
2
+ // Vue 3 wrapper for <cx-sidebar>
3
+ import { defineComponent, ref, h, onMounted, watch } from 'vue';
4
+ export const Sidebar = defineComponent({
5
+ name: 'Sidebar',
6
+ props: {
7
+ id: { type: String },
8
+ label: { type: String },
9
+ groups: { type: [Array, Object, String] },
10
+ separatorsAfter: { type: String },
11
+ side: { type: String },
12
+ state: { type: String },
13
+ shape: { type: String },
14
+ size: { type: String },
15
+ },
16
+ emits: {
17
+ 'cx-close': (event) => true,
18
+ 'cx-navigate': (event) => true,
19
+ },
20
+ setup(props, { emit, slots, expose }) {
21
+ const el = ref(null);
22
+ const listeners = [];
23
+ onMounted(() => {
24
+ if (!el.value)
25
+ return;
26
+ watch(() => props.groups, (val) => {
27
+ if (!el.value)
28
+ return;
29
+ if (val != null)
30
+ el.value.setAttribute('groups', typeof val === 'object' ? JSON.stringify(val) : String(val));
31
+ else
32
+ el.value.removeAttribute('groups');
33
+ }, { immediate: true });
34
+ // Event listeners
35
+ el.value.addEventListener('cx-close', (ev) => emit('cx-close', ev));
36
+ el.value.addEventListener('cx-navigate', (ev) => emit('cx-navigate', ev));
37
+ });
38
+ expose({
39
+ /** Opens the mobile sidebar drawer. */
40
+ open() { el.value?.open(); },
41
+ /** Closes the mobile sidebar drawer. */
42
+ close() { el.value?.close(); },
43
+ /** The underlying Custom Element. */
44
+ el,
45
+ });
46
+ return () => {
47
+ const attrs = {};
48
+ if (props.id != null)
49
+ attrs['id'] = typeof props.id === 'object' ? JSON.stringify(props.id) : String(props.id);
50
+ if (props.label != null)
51
+ attrs['label'] = typeof props.label === 'object' ? JSON.stringify(props.label) : String(props.label);
52
+ if (props.separatorsAfter != null)
53
+ attrs['separators-after'] = typeof props.separatorsAfter === 'object' ? JSON.stringify(props.separatorsAfter) : String(props.separatorsAfter);
54
+ if (props.side != null)
55
+ attrs['side'] = typeof props.side === 'object' ? JSON.stringify(props.side) : String(props.side);
56
+ if (props.state != null)
57
+ attrs['state'] = typeof props.state === 'object' ? JSON.stringify(props.state) : String(props.state);
58
+ if (props.shape != null)
59
+ attrs['shape'] = typeof props.shape === 'object' ? JSON.stringify(props.shape) : String(props.shape);
60
+ if (props.size != null)
61
+ attrs['size'] = typeof props.size === 'object' ? JSON.stringify(props.size) : String(props.size);
62
+ return h('cx-sidebar', { ref: el, ...attrs }, [
63
+ slots.header ? h('div', { slot: 'header', style: 'display:contents' }, slots.header()) : undefined,
64
+ slots.footer ? h('div', { slot: 'footer', style: 'display:contents' }, slots.footer()) : undefined
65
+ ]);
66
+ };
67
+ },
68
+ });
@@ -0,0 +1,42 @@
1
+ import { type PropType } from 'vue';
2
+ export declare const Skeleton: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
+ id: {
4
+ type: StringConstructor;
5
+ };
6
+ variant: {
7
+ type: PropType<"text" | "circle" | "rectangular">;
8
+ };
9
+ animation: {
10
+ type: PropType<"pulse" | "wave">;
11
+ };
12
+ label: {
13
+ type: StringConstructor;
14
+ };
15
+ size: {
16
+ type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
17
+ };
18
+ lines: {
19
+ type: NumberConstructor;
20
+ };
21
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
22
+ [key: string]: any;
23
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
24
+ id: {
25
+ type: StringConstructor;
26
+ };
27
+ variant: {
28
+ type: PropType<"text" | "circle" | "rectangular">;
29
+ };
30
+ animation: {
31
+ type: PropType<"pulse" | "wave">;
32
+ };
33
+ label: {
34
+ type: StringConstructor;
35
+ };
36
+ size: {
37
+ type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
38
+ };
39
+ lines: {
40
+ type: NumberConstructor;
41
+ };
42
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,44 @@
1
+ // Auto-generated by scripts/generate-vue.mjs — DO NOT EDIT
2
+ // Vue 3 wrapper for <cx-skeleton>
3
+ import { defineComponent, ref, h, onMounted } from 'vue';
4
+ export const Skeleton = defineComponent({
5
+ name: 'Skeleton',
6
+ props: {
7
+ id: { type: String },
8
+ variant: { type: String },
9
+ animation: { type: String },
10
+ label: { type: String },
11
+ size: { type: String },
12
+ lines: { type: Number },
13
+ },
14
+ emits: {},
15
+ setup(props, { emit, slots, expose }) {
16
+ const el = ref(null);
17
+ const listeners = [];
18
+ onMounted(() => {
19
+ if (!el.value)
20
+ return;
21
+ // Event listeners
22
+ });
23
+ expose({
24
+ /** The underlying Custom Element. */
25
+ el,
26
+ });
27
+ return () => {
28
+ const attrs = {};
29
+ if (props.id != null)
30
+ attrs['id'] = typeof props.id === 'object' ? JSON.stringify(props.id) : String(props.id);
31
+ if (props.variant != null)
32
+ attrs['variant'] = typeof props.variant === 'object' ? JSON.stringify(props.variant) : String(props.variant);
33
+ if (props.animation != null)
34
+ attrs['animation'] = typeof props.animation === 'object' ? JSON.stringify(props.animation) : String(props.animation);
35
+ if (props.label != null)
36
+ attrs['label'] = typeof props.label === 'object' ? JSON.stringify(props.label) : String(props.label);
37
+ if (props.size != null)
38
+ attrs['size'] = typeof props.size === 'object' ? JSON.stringify(props.size) : String(props.size);
39
+ if (props.lines != null)
40
+ attrs['lines'] = typeof props.lines === 'object' ? JSON.stringify(props.lines) : String(props.lines);
41
+ return h('cx-skeleton', { ref: el, ...attrs });
42
+ };
43
+ },
44
+ });
@@ -0,0 +1,133 @@
1
+ import { type PropType } from 'vue';
2
+ import type { FocusDetail, KeyboardDetail, SliderDetail } from './types.js';
3
+ export interface SliderRef {
4
+ /** Focuses the range input. */
5
+ focus(): void;
6
+ /** The underlying Custom Element. */
7
+ el: HTMLElement | null;
8
+ }
9
+ export declare const Slider: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
10
+ id: {
11
+ type: StringConstructor;
12
+ };
13
+ label: {
14
+ type: StringConstructor;
15
+ };
16
+ ariaLabel: {
17
+ type: StringConstructor;
18
+ };
19
+ value: {
20
+ type: NumberConstructor;
21
+ };
22
+ min: {
23
+ type: NumberConstructor;
24
+ };
25
+ max: {
26
+ type: NumberConstructor;
27
+ };
28
+ step: {
29
+ type: NumberConstructor;
30
+ };
31
+ orientation: {
32
+ type: PropType<"horizontal" | "vertical">;
33
+ };
34
+ shape: {
35
+ type: PropType<"sharp" | "rounded" | "pill">;
36
+ };
37
+ intent: {
38
+ type: PropType<"neutral" | "primary" | "info" | "success" | "warning" | "danger">;
39
+ };
40
+ size: {
41
+ type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
42
+ };
43
+ showValue: {
44
+ type: BooleanConstructor;
45
+ };
46
+ valueText: {
47
+ type: StringConstructor;
48
+ };
49
+ helperText: {
50
+ type: StringConstructor;
51
+ };
52
+ errorText: {
53
+ type: StringConstructor;
54
+ };
55
+ disabled: {
56
+ type: BooleanConstructor;
57
+ };
58
+ unlabeled: {
59
+ type: BooleanConstructor;
60
+ };
61
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
62
+ [key: string]: any;
63
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
64
+ 'cx-input': (event: CustomEvent<SliderDetail>) => true;
65
+ 'cx-change': (event: CustomEvent) => true;
66
+ 'cx-focus': (event: CustomEvent<FocusDetail>) => true;
67
+ 'cx-blur': (event: CustomEvent<FocusDetail>) => true;
68
+ 'cx-keydown': (event: CustomEvent<KeyboardDetail>) => true;
69
+ 'cx-keyup': (event: CustomEvent<KeyboardDetail>) => true;
70
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
71
+ id: {
72
+ type: StringConstructor;
73
+ };
74
+ label: {
75
+ type: StringConstructor;
76
+ };
77
+ ariaLabel: {
78
+ type: StringConstructor;
79
+ };
80
+ value: {
81
+ type: NumberConstructor;
82
+ };
83
+ min: {
84
+ type: NumberConstructor;
85
+ };
86
+ max: {
87
+ type: NumberConstructor;
88
+ };
89
+ step: {
90
+ type: NumberConstructor;
91
+ };
92
+ orientation: {
93
+ type: PropType<"horizontal" | "vertical">;
94
+ };
95
+ shape: {
96
+ type: PropType<"sharp" | "rounded" | "pill">;
97
+ };
98
+ intent: {
99
+ type: PropType<"neutral" | "primary" | "info" | "success" | "warning" | "danger">;
100
+ };
101
+ size: {
102
+ type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
103
+ };
104
+ showValue: {
105
+ type: BooleanConstructor;
106
+ };
107
+ valueText: {
108
+ type: StringConstructor;
109
+ };
110
+ helperText: {
111
+ type: StringConstructor;
112
+ };
113
+ errorText: {
114
+ type: StringConstructor;
115
+ };
116
+ disabled: {
117
+ type: BooleanConstructor;
118
+ };
119
+ unlabeled: {
120
+ type: BooleanConstructor;
121
+ };
122
+ }>> & Readonly<{
123
+ "onCx-change"?: ((event: CustomEvent<any>) => any) | undefined;
124
+ "onCx-input"?: ((event: CustomEvent<SliderDetail>) => any) | undefined;
125
+ "onCx-focus"?: ((event: CustomEvent<FocusDetail>) => any) | undefined;
126
+ "onCx-blur"?: ((event: CustomEvent<FocusDetail>) => any) | undefined;
127
+ "onCx-keydown"?: ((event: CustomEvent<KeyboardDetail>) => any) | undefined;
128
+ "onCx-keyup"?: ((event: CustomEvent<KeyboardDetail>) => any) | undefined;
129
+ }>, {
130
+ disabled: boolean;
131
+ unlabeled: boolean;
132
+ showValue: boolean;
133
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
package/dist/slider.js ADDED
@@ -0,0 +1,98 @@
1
+ // Auto-generated by scripts/generate-vue.mjs — DO NOT EDIT
2
+ // Vue 3 wrapper for <cx-slider>
3
+ import { defineComponent, ref, h, onMounted, watch } from 'vue';
4
+ export const Slider = defineComponent({
5
+ name: 'Slider',
6
+ props: {
7
+ id: { type: String },
8
+ label: { type: String },
9
+ ariaLabel: { type: String },
10
+ value: { type: Number },
11
+ min: { type: Number },
12
+ max: { type: Number },
13
+ step: { type: Number },
14
+ orientation: { type: String },
15
+ shape: { type: String },
16
+ intent: { type: String },
17
+ size: { type: String },
18
+ showValue: { type: Boolean },
19
+ valueText: { type: String },
20
+ helperText: { type: String },
21
+ errorText: { type: String },
22
+ disabled: { type: Boolean },
23
+ unlabeled: { type: Boolean },
24
+ },
25
+ emits: {
26
+ 'cx-input': (event) => true,
27
+ 'cx-change': (event) => true,
28
+ 'cx-focus': (event) => true,
29
+ 'cx-blur': (event) => true,
30
+ 'cx-keydown': (event) => true,
31
+ 'cx-keyup': (event) => true,
32
+ },
33
+ setup(props, { emit, slots, expose }) {
34
+ const el = ref(null);
35
+ const listeners = [];
36
+ onMounted(() => {
37
+ if (!el.value)
38
+ return;
39
+ watch(() => props.value, (val) => {
40
+ if (!el.value)
41
+ return;
42
+ if (val != null)
43
+ el.value.setAttribute('value', String(val));
44
+ else
45
+ el.value.removeAttribute('value');
46
+ }, { immediate: true });
47
+ // Event listeners
48
+ el.value.addEventListener('cx-input', (ev) => emit('cx-input', ev));
49
+ el.value.addEventListener('cx-change', (ev) => emit('cx-change', ev));
50
+ el.value.addEventListener('cx-focus', (ev) => emit('cx-focus', ev));
51
+ el.value.addEventListener('cx-blur', (ev) => emit('cx-blur', ev));
52
+ el.value.addEventListener('cx-keydown', (ev) => emit('cx-keydown', ev));
53
+ el.value.addEventListener('cx-keyup', (ev) => emit('cx-keyup', ev));
54
+ });
55
+ expose({
56
+ /** Focuses the range input. */
57
+ focus() { el.value?.focus(); },
58
+ /** The underlying Custom Element. */
59
+ el,
60
+ });
61
+ return () => {
62
+ const attrs = {};
63
+ if (props.id != null)
64
+ attrs['id'] = typeof props.id === 'object' ? JSON.stringify(props.id) : String(props.id);
65
+ if (props.label != null)
66
+ attrs['label'] = typeof props.label === 'object' ? JSON.stringify(props.label) : String(props.label);
67
+ if (props.ariaLabel != null)
68
+ attrs['aria-label'] = typeof props.ariaLabel === 'object' ? JSON.stringify(props.ariaLabel) : String(props.ariaLabel);
69
+ if (props.min != null)
70
+ attrs['min'] = typeof props.min === 'object' ? JSON.stringify(props.min) : String(props.min);
71
+ if (props.max != null)
72
+ attrs['max'] = typeof props.max === 'object' ? JSON.stringify(props.max) : String(props.max);
73
+ if (props.step != null)
74
+ attrs['step'] = typeof props.step === 'object' ? JSON.stringify(props.step) : String(props.step);
75
+ if (props.orientation != null)
76
+ attrs['orientation'] = typeof props.orientation === 'object' ? JSON.stringify(props.orientation) : String(props.orientation);
77
+ if (props.shape != null)
78
+ attrs['shape'] = typeof props.shape === 'object' ? JSON.stringify(props.shape) : String(props.shape);
79
+ if (props.intent != null)
80
+ attrs['intent'] = typeof props.intent === 'object' ? JSON.stringify(props.intent) : String(props.intent);
81
+ if (props.size != null)
82
+ attrs['size'] = typeof props.size === 'object' ? JSON.stringify(props.size) : String(props.size);
83
+ if (props.showValue)
84
+ attrs['show-value'] = '';
85
+ if (props.valueText != null)
86
+ attrs['value-text'] = typeof props.valueText === 'object' ? JSON.stringify(props.valueText) : String(props.valueText);
87
+ if (props.helperText != null)
88
+ attrs['helper-text'] = typeof props.helperText === 'object' ? JSON.stringify(props.helperText) : String(props.helperText);
89
+ if (props.errorText != null)
90
+ attrs['error-text'] = typeof props.errorText === 'object' ? JSON.stringify(props.errorText) : String(props.errorText);
91
+ if (props.disabled)
92
+ attrs['disabled'] = '';
93
+ if (props.unlabeled)
94
+ attrs['unlabeled'] = '';
95
+ return h('cx-slider', { ref: el, ...attrs });
96
+ };
97
+ },
98
+ });