@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/switch.js ADDED
@@ -0,0 +1,75 @@
1
+ // Auto-generated by scripts/generate-vue.mjs — DO NOT EDIT
2
+ // Vue 3 wrapper for <cx-switch>
3
+ import { defineComponent, ref, h, onMounted } from 'vue';
4
+ export const Switch = defineComponent({
5
+ name: 'Switch',
6
+ props: {
7
+ id: { type: String },
8
+ label: { type: String },
9
+ shape: { type: String },
10
+ size: { type: String },
11
+ /** Boolean checked state (unlike Checkbox, which uses a string). */
12
+ checked: { type: Boolean },
13
+ disabled: { type: Boolean },
14
+ required: { type: Boolean },
15
+ helperText: { type: String },
16
+ error: { type: String },
17
+ description: { type: String },
18
+ unlabeled: { type: Boolean },
19
+ },
20
+ emits: {
21
+ 'cx-input': (event) => true,
22
+ 'cx-change': (event) => true,
23
+ 'cx-focus': (event) => true,
24
+ 'cx-blur': (event) => true,
25
+ 'cx-keydown': (event) => true,
26
+ 'cx-keyup': (event) => true,
27
+ },
28
+ setup(props, { emit, slots, expose }) {
29
+ const el = ref(null);
30
+ const listeners = [];
31
+ onMounted(() => {
32
+ if (!el.value)
33
+ return;
34
+ // Event listeners
35
+ el.value.addEventListener('cx-input', (ev) => emit('cx-input', ev));
36
+ el.value.addEventListener('cx-change', (ev) => emit('cx-change', ev));
37
+ el.value.addEventListener('cx-focus', (ev) => emit('cx-focus', ev));
38
+ el.value.addEventListener('cx-blur', (ev) => emit('cx-blur', ev));
39
+ el.value.addEventListener('cx-keydown', (ev) => emit('cx-keydown', ev));
40
+ el.value.addEventListener('cx-keyup', (ev) => emit('cx-keyup', ev));
41
+ });
42
+ expose({
43
+ /** Focuses the switch input. */
44
+ focus() { el.value?.focus(); },
45
+ /** The underlying Custom Element. */
46
+ el,
47
+ });
48
+ return () => {
49
+ const attrs = {};
50
+ if (props.id != null)
51
+ attrs['id'] = typeof props.id === 'object' ? JSON.stringify(props.id) : String(props.id);
52
+ if (props.label != null)
53
+ attrs['label'] = typeof props.label === 'object' ? JSON.stringify(props.label) : String(props.label);
54
+ if (props.shape != null)
55
+ attrs['shape'] = typeof props.shape === 'object' ? JSON.stringify(props.shape) : String(props.shape);
56
+ if (props.size != null)
57
+ attrs['size'] = typeof props.size === 'object' ? JSON.stringify(props.size) : String(props.size);
58
+ if (props.checked)
59
+ attrs['checked'] = '';
60
+ if (props.disabled)
61
+ attrs['disabled'] = '';
62
+ if (props.required)
63
+ attrs['required'] = '';
64
+ if (props.helperText != null)
65
+ attrs['helper-text'] = typeof props.helperText === 'object' ? JSON.stringify(props.helperText) : String(props.helperText);
66
+ if (props.error != null)
67
+ attrs['error'] = typeof props.error === 'object' ? JSON.stringify(props.error) : String(props.error);
68
+ if (props.description != null)
69
+ attrs['description'] = typeof props.description === 'object' ? JSON.stringify(props.description) : String(props.description);
70
+ if (props.unlabeled)
71
+ attrs['unlabeled'] = '';
72
+ return h('cx-switch', { ref: el, ...attrs });
73
+ };
74
+ },
75
+ });
@@ -0,0 +1,135 @@
1
+ import { type PropType } from 'vue';
2
+ import type { EmptyStateConfig, FooterRow, KeyboardDetail, PageDetail, PaginationConfig, SortDetail, SortState, TableColumn, TableExpandDetail, TableRow, TableSelectDetail } from './types.js';
3
+ export declare const Table: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ id: {
5
+ type: StringConstructor;
6
+ };
7
+ caption: {
8
+ type: StringConstructor;
9
+ required: true;
10
+ };
11
+ columns: {
12
+ type: PropType<TableColumn[] | string>;
13
+ };
14
+ rows: {
15
+ type: PropType<TableRow[] | string>;
16
+ };
17
+ variant: {
18
+ type: PropType<"plain" | "striped" | "bordered">;
19
+ };
20
+ size: {
21
+ type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
22
+ };
23
+ selectable: {
24
+ type: StringConstructor;
25
+ };
26
+ selected: {
27
+ type: PropType<string[] | string>;
28
+ };
29
+ sorts: {
30
+ type: PropType<SortState[] | string>;
31
+ };
32
+ pagination: {
33
+ type: PropType<PaginationConfig | string>;
34
+ };
35
+ hoverable: {
36
+ type: BooleanConstructor;
37
+ };
38
+ stickyHeader: {
39
+ type: BooleanConstructor;
40
+ };
41
+ footer: {
42
+ type: PropType<FooterRow[] | string>;
43
+ };
44
+ emptyState: {
45
+ type: PropType<EmptyStateConfig | string>;
46
+ };
47
+ columnOrder: {
48
+ type: PropType<string[] | string>;
49
+ };
50
+ disabled: {
51
+ type: BooleanConstructor;
52
+ };
53
+ loading: {
54
+ type: NumberConstructor;
55
+ };
56
+ error: {
57
+ type: StringConstructor;
58
+ };
59
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
60
+ [key: string]: any;
61
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
62
+ 'cx-sort': (event: CustomEvent<SortDetail>) => true;
63
+ 'cx-select': (event: CustomEvent<TableSelectDetail>) => true;
64
+ 'cx-expand': (event: CustomEvent<TableExpandDetail>) => true;
65
+ 'cx-page': (event: CustomEvent<PageDetail>) => 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
+ caption: {
73
+ type: StringConstructor;
74
+ required: true;
75
+ };
76
+ columns: {
77
+ type: PropType<TableColumn[] | string>;
78
+ };
79
+ rows: {
80
+ type: PropType<TableRow[] | string>;
81
+ };
82
+ variant: {
83
+ type: PropType<"plain" | "striped" | "bordered">;
84
+ };
85
+ size: {
86
+ type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
87
+ };
88
+ selectable: {
89
+ type: StringConstructor;
90
+ };
91
+ selected: {
92
+ type: PropType<string[] | string>;
93
+ };
94
+ sorts: {
95
+ type: PropType<SortState[] | string>;
96
+ };
97
+ pagination: {
98
+ type: PropType<PaginationConfig | string>;
99
+ };
100
+ hoverable: {
101
+ type: BooleanConstructor;
102
+ };
103
+ stickyHeader: {
104
+ type: BooleanConstructor;
105
+ };
106
+ footer: {
107
+ type: PropType<FooterRow[] | string>;
108
+ };
109
+ emptyState: {
110
+ type: PropType<EmptyStateConfig | string>;
111
+ };
112
+ columnOrder: {
113
+ type: PropType<string[] | string>;
114
+ };
115
+ disabled: {
116
+ type: BooleanConstructor;
117
+ };
118
+ loading: {
119
+ type: NumberConstructor;
120
+ };
121
+ error: {
122
+ type: StringConstructor;
123
+ };
124
+ }>> & Readonly<{
125
+ "onCx-keydown"?: ((event: CustomEvent<KeyboardDetail>) => any) | undefined;
126
+ "onCx-keyup"?: ((event: CustomEvent<KeyboardDetail>) => any) | undefined;
127
+ "onCx-select"?: ((event: CustomEvent<TableSelectDetail>) => any) | undefined;
128
+ "onCx-sort"?: ((event: CustomEvent<SortDetail>) => any) | undefined;
129
+ "onCx-expand"?: ((event: CustomEvent<TableExpandDetail>) => any) | undefined;
130
+ "onCx-page"?: ((event: CustomEvent<PageDetail>) => any) | undefined;
131
+ }>, {
132
+ disabled: boolean;
133
+ hoverable: boolean;
134
+ stickyHeader: boolean;
135
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
package/dist/table.js ADDED
@@ -0,0 +1,147 @@
1
+ // Auto-generated by scripts/generate-vue.mjs — DO NOT EDIT
2
+ // Vue 3 wrapper for <cx-table>
3
+ import { defineComponent, ref, h, onMounted, watch } from 'vue';
4
+ export const Table = defineComponent({
5
+ name: 'Table',
6
+ props: {
7
+ id: { type: String },
8
+ caption: { type: String, required: true },
9
+ columns: { type: [Array, Object, String] },
10
+ rows: { type: [Array, Object, String] },
11
+ variant: { type: String },
12
+ size: { type: String },
13
+ selectable: { type: String },
14
+ selected: { type: [Array, Object, String] },
15
+ sorts: { type: [Array, Object, String] },
16
+ pagination: { type: [Array, Object, String] },
17
+ hoverable: { type: Boolean },
18
+ stickyHeader: { type: Boolean },
19
+ footer: { type: [Array, Object, String] },
20
+ emptyState: { type: [Array, Object, String] },
21
+ columnOrder: { type: [Array, Object, String] },
22
+ disabled: { type: Boolean },
23
+ loading: { type: Number },
24
+ error: { type: String },
25
+ },
26
+ emits: {
27
+ 'cx-sort': (event) => true,
28
+ 'cx-select': (event) => true,
29
+ 'cx-expand': (event) => true,
30
+ 'cx-page': (event) => true,
31
+ 'cx-keydown': (event) => true,
32
+ 'cx-keyup': (event) => true,
33
+ },
34
+ setup(props, { emit, slots, expose }) {
35
+ const el = ref(null);
36
+ const listeners = [];
37
+ onMounted(() => {
38
+ if (!el.value)
39
+ return;
40
+ watch(() => props.loading, (val) => {
41
+ if (!el.value)
42
+ return;
43
+ if (val != null)
44
+ el.value.setAttribute('loading', String(val));
45
+ else
46
+ el.value.removeAttribute('loading');
47
+ }, { immediate: true });
48
+ watch(() => props.columns, (val) => {
49
+ if (!el.value)
50
+ return;
51
+ if (val != null)
52
+ el.value.setAttribute('columns', typeof val === 'object' ? JSON.stringify(val) : String(val));
53
+ else
54
+ el.value.removeAttribute('columns');
55
+ }, { immediate: true });
56
+ watch(() => props.rows, (val) => {
57
+ if (!el.value)
58
+ return;
59
+ if (val != null)
60
+ el.value.setAttribute('rows', typeof val === 'object' ? JSON.stringify(val) : String(val));
61
+ else
62
+ el.value.removeAttribute('rows');
63
+ }, { immediate: true });
64
+ watch(() => props.selected, (val) => {
65
+ if (!el.value)
66
+ return;
67
+ if (val != null)
68
+ el.value.setAttribute('selected', typeof val === 'object' ? JSON.stringify(val) : String(val));
69
+ else
70
+ el.value.removeAttribute('selected');
71
+ }, { immediate: true });
72
+ watch(() => props.sorts, (val) => {
73
+ if (!el.value)
74
+ return;
75
+ if (val != null)
76
+ el.value.setAttribute('sorts', typeof val === 'object' ? JSON.stringify(val) : String(val));
77
+ else
78
+ el.value.removeAttribute('sorts');
79
+ }, { immediate: true });
80
+ watch(() => props.pagination, (val) => {
81
+ if (!el.value)
82
+ return;
83
+ if (val != null)
84
+ el.value.setAttribute('pagination', typeof val === 'object' ? JSON.stringify(val) : String(val));
85
+ else
86
+ el.value.removeAttribute('pagination');
87
+ }, { immediate: true });
88
+ watch(() => props.footer, (val) => {
89
+ if (!el.value)
90
+ return;
91
+ if (val != null)
92
+ el.value.setAttribute('footer', typeof val === 'object' ? JSON.stringify(val) : String(val));
93
+ else
94
+ el.value.removeAttribute('footer');
95
+ }, { immediate: true });
96
+ watch(() => props.emptyState, (val) => {
97
+ if (!el.value)
98
+ return;
99
+ if (val != null)
100
+ el.value.setAttribute('empty-state', typeof val === 'object' ? JSON.stringify(val) : String(val));
101
+ else
102
+ el.value.removeAttribute('empty-state');
103
+ }, { immediate: true });
104
+ watch(() => props.columnOrder, (val) => {
105
+ if (!el.value)
106
+ return;
107
+ if (val != null)
108
+ el.value.setAttribute('column-order', typeof val === 'object' ? JSON.stringify(val) : String(val));
109
+ else
110
+ el.value.removeAttribute('column-order');
111
+ }, { immediate: true });
112
+ // Event listeners
113
+ el.value.addEventListener('cx-sort', (ev) => emit('cx-sort', ev));
114
+ el.value.addEventListener('cx-select', (ev) => emit('cx-select', ev));
115
+ el.value.addEventListener('cx-expand', (ev) => emit('cx-expand', ev));
116
+ el.value.addEventListener('cx-page', (ev) => emit('cx-page', ev));
117
+ el.value.addEventListener('cx-keydown', (ev) => emit('cx-keydown', ev));
118
+ el.value.addEventListener('cx-keyup', (ev) => emit('cx-keyup', ev));
119
+ });
120
+ expose({
121
+ /** The underlying Custom Element. */
122
+ el,
123
+ });
124
+ return () => {
125
+ const attrs = {};
126
+ if (props.id != null)
127
+ attrs['id'] = typeof props.id === 'object' ? JSON.stringify(props.id) : String(props.id);
128
+ if (props.caption != null)
129
+ attrs['caption'] = typeof props.caption === 'object' ? JSON.stringify(props.caption) : String(props.caption);
130
+ if (props.variant != null)
131
+ attrs['variant'] = typeof props.variant === 'object' ? JSON.stringify(props.variant) : String(props.variant);
132
+ if (props.size != null)
133
+ attrs['size'] = typeof props.size === 'object' ? JSON.stringify(props.size) : String(props.size);
134
+ if (props.selectable != null)
135
+ attrs['selectable'] = typeof props.selectable === 'object' ? JSON.stringify(props.selectable) : String(props.selectable);
136
+ if (props.hoverable)
137
+ attrs['hoverable'] = '';
138
+ if (props.stickyHeader)
139
+ attrs['sticky-header'] = '';
140
+ if (props.disabled)
141
+ attrs['disabled'] = '';
142
+ if (props.error != null)
143
+ attrs['error'] = typeof props.error === 'object' ? JSON.stringify(props.error) : String(props.error);
144
+ return h('cx-table', { ref: el, ...attrs });
145
+ };
146
+ },
147
+ });
package/dist/tabs.d.ts ADDED
@@ -0,0 +1,65 @@
1
+ import { type PropType } from 'vue';
2
+ import type { SelectDetail, TabItem } from './types.js';
3
+ export interface TabsRef {
4
+ /** Focuses the active tab. */
5
+ focus(): void;
6
+ /** The underlying Custom Element. */
7
+ el: HTMLElement | null;
8
+ }
9
+ export declare const Tabs: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
10
+ id: {
11
+ type: StringConstructor;
12
+ };
13
+ label: {
14
+ type: StringConstructor;
15
+ };
16
+ items: {
17
+ type: PropType<TabItem[] | string>;
18
+ };
19
+ defaultTab: {
20
+ type: StringConstructor;
21
+ };
22
+ variant: {
23
+ type: PropType<"underline" | "enclosed" | "pill">;
24
+ };
25
+ orientation: {
26
+ type: PropType<"horizontal" | "vertical">;
27
+ };
28
+ width: {
29
+ type: PropType<"auto" | "full">;
30
+ };
31
+ size: {
32
+ type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
33
+ };
34
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
35
+ [key: string]: any;
36
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
37
+ 'cx-change': (event: CustomEvent<SelectDetail>) => true;
38
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
39
+ id: {
40
+ type: StringConstructor;
41
+ };
42
+ label: {
43
+ type: StringConstructor;
44
+ };
45
+ items: {
46
+ type: PropType<TabItem[] | string>;
47
+ };
48
+ defaultTab: {
49
+ type: StringConstructor;
50
+ };
51
+ variant: {
52
+ type: PropType<"underline" | "enclosed" | "pill">;
53
+ };
54
+ orientation: {
55
+ type: PropType<"horizontal" | "vertical">;
56
+ };
57
+ width: {
58
+ type: PropType<"auto" | "full">;
59
+ };
60
+ size: {
61
+ type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
62
+ };
63
+ }>> & Readonly<{
64
+ "onCx-change"?: ((event: CustomEvent<SelectDetail>) => any) | undefined;
65
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
package/dist/tabs.js ADDED
@@ -0,0 +1,67 @@
1
+ // Auto-generated by scripts/generate-vue.mjs — DO NOT EDIT
2
+ // Vue 3 wrapper for <cx-tabs>
3
+ import { defineComponent, ref, h, onMounted, watch } from 'vue';
4
+ export const Tabs = defineComponent({
5
+ name: 'Tabs',
6
+ props: {
7
+ id: { type: String },
8
+ label: { type: String },
9
+ items: { type: [Array, Object, String] },
10
+ defaultTab: { type: String },
11
+ variant: { type: String },
12
+ orientation: { type: String },
13
+ width: { type: String },
14
+ size: { type: String },
15
+ },
16
+ emits: {
17
+ 'cx-change': (event) => true,
18
+ },
19
+ setup(props, { emit, slots, expose }) {
20
+ const el = ref(null);
21
+ const listeners = [];
22
+ onMounted(() => {
23
+ if (!el.value)
24
+ return;
25
+ watch(() => props.width, (val) => {
26
+ if (!el.value)
27
+ return;
28
+ if (val != null)
29
+ el.value.setAttribute('width', String(val));
30
+ else
31
+ el.value.removeAttribute('width');
32
+ }, { immediate: true });
33
+ watch(() => props.items, (val) => {
34
+ if (!el.value)
35
+ return;
36
+ if (val != null)
37
+ el.value.setAttribute('items', typeof val === 'object' ? JSON.stringify(val) : String(val));
38
+ else
39
+ el.value.removeAttribute('items');
40
+ }, { immediate: true });
41
+ // Event listeners
42
+ el.value.addEventListener('cx-change', (ev) => emit('cx-change', ev));
43
+ });
44
+ expose({
45
+ /** Focuses the active tab. */
46
+ focus() { el.value?.focus(); },
47
+ /** The underlying Custom Element. */
48
+ el,
49
+ });
50
+ return () => {
51
+ const attrs = {};
52
+ if (props.id != null)
53
+ attrs['id'] = typeof props.id === 'object' ? JSON.stringify(props.id) : String(props.id);
54
+ if (props.label != null)
55
+ attrs['label'] = typeof props.label === 'object' ? JSON.stringify(props.label) : String(props.label);
56
+ if (props.defaultTab != null)
57
+ attrs['default-tab'] = typeof props.defaultTab === 'object' ? JSON.stringify(props.defaultTab) : String(props.defaultTab);
58
+ if (props.variant != null)
59
+ attrs['variant'] = typeof props.variant === 'object' ? JSON.stringify(props.variant) : String(props.variant);
60
+ if (props.orientation != null)
61
+ attrs['orientation'] = typeof props.orientation === 'object' ? JSON.stringify(props.orientation) : String(props.orientation);
62
+ if (props.size != null)
63
+ attrs['size'] = typeof props.size === 'object' ? JSON.stringify(props.size) : String(props.size);
64
+ return h('cx-tabs', { ref: el, ...attrs });
65
+ };
66
+ },
67
+ });
@@ -0,0 +1,193 @@
1
+ import { type PropType } from 'vue';
2
+ import type { FocusDetail, InputDetail, KeyboardDetail } from './types.js';
3
+ export interface TextInputRef {
4
+ /** Focuses the inner input or textarea. */
5
+ focus(): void;
6
+ /** Blurs the inner input or textarea. */
7
+ blur(): void;
8
+ /** Selects all text in the input. */
9
+ select(): void;
10
+ /** The underlying Custom Element. */
11
+ el: HTMLElement | null;
12
+ }
13
+ export declare const TextInput: 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
+ /** Input type. Use 'multiline' for textarea behavior with optional rows and autoGrow. */
30
+ kind: {
31
+ type: PropType<"text" | "email" | "password" | "search" | "multiline">;
32
+ };
33
+ placeholder: {
34
+ type: StringConstructor;
35
+ };
36
+ /** Controlled value. Set via onInput callback. */
37
+ value: {
38
+ type: StringConstructor;
39
+ };
40
+ helperText: {
41
+ type: StringConstructor;
42
+ };
43
+ error: {
44
+ type: StringConstructor;
45
+ };
46
+ disabled: {
47
+ type: BooleanConstructor;
48
+ };
49
+ readonly: {
50
+ type: BooleanConstructor;
51
+ };
52
+ required: {
53
+ type: BooleanConstructor;
54
+ };
55
+ clearable: {
56
+ type: BooleanConstructor;
57
+ };
58
+ prefixIcon: {
59
+ type: StringConstructor;
60
+ };
61
+ suffixIcon: {
62
+ type: StringConstructor;
63
+ };
64
+ passwordToggle: {
65
+ type: BooleanConstructor;
66
+ };
67
+ passwordVisible: {
68
+ type: BooleanConstructor;
69
+ };
70
+ name: {
71
+ type: StringConstructor;
72
+ };
73
+ minLength: {
74
+ type: NumberConstructor;
75
+ };
76
+ maxLength: {
77
+ type: NumberConstructor;
78
+ };
79
+ pattern: {
80
+ type: StringConstructor;
81
+ };
82
+ autocomplete: {
83
+ type: StringConstructor;
84
+ };
85
+ rows: {
86
+ type: NumberConstructor;
87
+ };
88
+ autoGrow: {
89
+ type: BooleanConstructor;
90
+ };
91
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
92
+ [key: string]: any;
93
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
94
+ 'cx-input': (event: CustomEvent<InputDetail>) => true;
95
+ 'cx-change': (event: CustomEvent<InputDetail>) => true;
96
+ 'cx-focus': (event: CustomEvent<FocusDetail>) => true;
97
+ 'cx-blur': (event: CustomEvent<FocusDetail>) => true;
98
+ 'cx-keydown': (event: CustomEvent<KeyboardDetail>) => true;
99
+ 'cx-keyup': (event: CustomEvent<KeyboardDetail>) => true;
100
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
101
+ id: {
102
+ type: StringConstructor;
103
+ };
104
+ label: {
105
+ type: StringConstructor;
106
+ };
107
+ variant: {
108
+ type: PropType<"outline" | "filled" | "ghost">;
109
+ };
110
+ shape: {
111
+ type: PropType<"sharp" | "rounded" | "pill">;
112
+ };
113
+ size: {
114
+ type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
115
+ };
116
+ /** Input type. Use 'multiline' for textarea behavior with optional rows and autoGrow. */
117
+ kind: {
118
+ type: PropType<"text" | "email" | "password" | "search" | "multiline">;
119
+ };
120
+ placeholder: {
121
+ type: StringConstructor;
122
+ };
123
+ /** Controlled value. Set via onInput callback. */
124
+ value: {
125
+ type: StringConstructor;
126
+ };
127
+ helperText: {
128
+ type: StringConstructor;
129
+ };
130
+ error: {
131
+ type: StringConstructor;
132
+ };
133
+ disabled: {
134
+ type: BooleanConstructor;
135
+ };
136
+ readonly: {
137
+ type: BooleanConstructor;
138
+ };
139
+ required: {
140
+ type: BooleanConstructor;
141
+ };
142
+ clearable: {
143
+ type: BooleanConstructor;
144
+ };
145
+ prefixIcon: {
146
+ type: StringConstructor;
147
+ };
148
+ suffixIcon: {
149
+ type: StringConstructor;
150
+ };
151
+ passwordToggle: {
152
+ type: BooleanConstructor;
153
+ };
154
+ passwordVisible: {
155
+ type: BooleanConstructor;
156
+ };
157
+ name: {
158
+ type: StringConstructor;
159
+ };
160
+ minLength: {
161
+ type: NumberConstructor;
162
+ };
163
+ maxLength: {
164
+ type: NumberConstructor;
165
+ };
166
+ pattern: {
167
+ type: StringConstructor;
168
+ };
169
+ autocomplete: {
170
+ type: StringConstructor;
171
+ };
172
+ rows: {
173
+ type: NumberConstructor;
174
+ };
175
+ autoGrow: {
176
+ type: BooleanConstructor;
177
+ };
178
+ }>> & Readonly<{
179
+ "onCx-change"?: ((event: CustomEvent<InputDetail>) => any) | undefined;
180
+ "onCx-input"?: ((event: CustomEvent<InputDetail>) => any) | undefined;
181
+ "onCx-focus"?: ((event: CustomEvent<FocusDetail>) => any) | undefined;
182
+ "onCx-blur"?: ((event: CustomEvent<FocusDetail>) => any) | undefined;
183
+ "onCx-keydown"?: ((event: CustomEvent<KeyboardDetail>) => any) | undefined;
184
+ "onCx-keyup"?: ((event: CustomEvent<KeyboardDetail>) => any) | undefined;
185
+ }>, {
186
+ disabled: boolean;
187
+ required: boolean;
188
+ readonly: boolean;
189
+ clearable: boolean;
190
+ passwordToggle: boolean;
191
+ passwordVisible: boolean;
192
+ autoGrow: boolean;
193
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;