@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
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# @collet/vue
|
|
2
|
+
|
|
3
|
+
Vue 3.3+ wrappers (Composition API) for the Collet component library. Typed props, emits, and template refs over 48 Rust/WASM Custom Elements.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @collet/vue @collet/core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```vue
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
import { init, Button, TextInput } from '@collet/vue';
|
|
16
|
+
|
|
17
|
+
await init(); // once, at app startup
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<Button variant="filled" label="Save" intent="primary" @cx-click="save" />
|
|
22
|
+
<TextInput label="Email" kind="email" @cx-input="onInput" />
|
|
23
|
+
</template>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Features
|
|
27
|
+
|
|
28
|
+
- **Typed props** -- union-literal types for all component enums
|
|
29
|
+
- **Typed emits** -- `@cx-click`, `@cx-change`, `@cx-input`, etc. with typed `detail`
|
|
30
|
+
- **Template refs** -- `expose()`-based refs for imperative methods (`.open()`, `.close()`)
|
|
31
|
+
- **Structured data** -- `SelectOption[]`, `TableColumn[]`, `AccordionItem[]` fully typed
|
|
32
|
+
- **Ships compiled** -- `dist/` contains ready-to-use `.js` and `.d.ts` files
|
|
33
|
+
|
|
34
|
+
## Volar Support
|
|
35
|
+
|
|
36
|
+
For global type checking of `<cx-*>` tags in templates, add to your `tsconfig.json`:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"compilerOptions": {
|
|
41
|
+
"types": ["@collet/vue/global"]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
This enables autocomplete and type checking on raw Custom Element tags alongside the Vue wrapper components.
|
|
47
|
+
|
|
48
|
+
## Event Pattern
|
|
49
|
+
|
|
50
|
+
Custom events use the `cx-` prefix. Vue's `@` shorthand works as expected:
|
|
51
|
+
|
|
52
|
+
```vue
|
|
53
|
+
<template>
|
|
54
|
+
<Select label="Country" :options="countries" @cx-change="setCountry" />
|
|
55
|
+
</template>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## API Reference
|
|
59
|
+
|
|
60
|
+
See [@collet/docs](https://www.npmjs.com/package/@collet/docs) for the full props/events reference and framework guides.
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
MIT -- [github.com/Danrozen87/collet](https://github.com/Danrozen87/collet)
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import type { AccordionDetail, AccordionItem } from './types.js';
|
|
3
|
+
export declare const Accordion: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
id: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
};
|
|
7
|
+
label: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
};
|
|
10
|
+
items: {
|
|
11
|
+
type: PropType<AccordionItem[] | string>;
|
|
12
|
+
};
|
|
13
|
+
mode: {
|
|
14
|
+
type: PropType<"single" | "multiple">;
|
|
15
|
+
};
|
|
16
|
+
collapsible: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
};
|
|
19
|
+
headingLevel: {
|
|
20
|
+
type: PropType<"h2" | "h3" | "h4" | "h5" | "h6">;
|
|
21
|
+
};
|
|
22
|
+
defaultExpanded: {
|
|
23
|
+
type: PropType<string[] | string>;
|
|
24
|
+
};
|
|
25
|
+
size: {
|
|
26
|
+
type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
|
|
27
|
+
};
|
|
28
|
+
disabled: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
};
|
|
31
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
34
|
+
'cx-change': (event: CustomEvent<AccordionDetail>) => true;
|
|
35
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
36
|
+
id: {
|
|
37
|
+
type: StringConstructor;
|
|
38
|
+
};
|
|
39
|
+
label: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
};
|
|
42
|
+
items: {
|
|
43
|
+
type: PropType<AccordionItem[] | string>;
|
|
44
|
+
};
|
|
45
|
+
mode: {
|
|
46
|
+
type: PropType<"single" | "multiple">;
|
|
47
|
+
};
|
|
48
|
+
collapsible: {
|
|
49
|
+
type: BooleanConstructor;
|
|
50
|
+
};
|
|
51
|
+
headingLevel: {
|
|
52
|
+
type: PropType<"h2" | "h3" | "h4" | "h5" | "h6">;
|
|
53
|
+
};
|
|
54
|
+
defaultExpanded: {
|
|
55
|
+
type: PropType<string[] | string>;
|
|
56
|
+
};
|
|
57
|
+
size: {
|
|
58
|
+
type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
|
|
59
|
+
};
|
|
60
|
+
disabled: {
|
|
61
|
+
type: BooleanConstructor;
|
|
62
|
+
};
|
|
63
|
+
}>> & Readonly<{
|
|
64
|
+
"onCx-change"?: ((event: CustomEvent<AccordionDetail>) => any) | undefined;
|
|
65
|
+
}>, {
|
|
66
|
+
collapsible: boolean;
|
|
67
|
+
disabled: boolean;
|
|
68
|
+
}, {}, {}, {}, 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-accordion>
|
|
3
|
+
import { defineComponent, ref, h, onMounted, watch } from 'vue';
|
|
4
|
+
export const Accordion = defineComponent({
|
|
5
|
+
name: 'Accordion',
|
|
6
|
+
props: {
|
|
7
|
+
id: { type: String },
|
|
8
|
+
label: { type: String },
|
|
9
|
+
items: { type: [Array, Object, String] },
|
|
10
|
+
mode: { type: String },
|
|
11
|
+
collapsible: { type: Boolean },
|
|
12
|
+
headingLevel: { type: String },
|
|
13
|
+
defaultExpanded: { type: [Array, Object, String] },
|
|
14
|
+
size: { type: String },
|
|
15
|
+
disabled: { type: Boolean },
|
|
16
|
+
},
|
|
17
|
+
emits: {
|
|
18
|
+
'cx-change': (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.items, (val) => {
|
|
27
|
+
if (!el.value)
|
|
28
|
+
return;
|
|
29
|
+
if (val != null)
|
|
30
|
+
el.value.setAttribute('items', typeof val === 'object' ? JSON.stringify(val) : String(val));
|
|
31
|
+
else
|
|
32
|
+
el.value.removeAttribute('items');
|
|
33
|
+
}, { immediate: true });
|
|
34
|
+
watch(() => props.defaultExpanded, (val) => {
|
|
35
|
+
if (!el.value)
|
|
36
|
+
return;
|
|
37
|
+
if (val != null)
|
|
38
|
+
el.value.setAttribute('default-expanded', typeof val === 'object' ? JSON.stringify(val) : String(val));
|
|
39
|
+
else
|
|
40
|
+
el.value.removeAttribute('default-expanded');
|
|
41
|
+
}, { immediate: true });
|
|
42
|
+
// Event listeners
|
|
43
|
+
el.value.addEventListener('cx-change', (ev) => emit('cx-change', ev));
|
|
44
|
+
});
|
|
45
|
+
expose({
|
|
46
|
+
/** The underlying Custom Element. */
|
|
47
|
+
el,
|
|
48
|
+
});
|
|
49
|
+
return () => {
|
|
50
|
+
const attrs = {};
|
|
51
|
+
if (props.id != null)
|
|
52
|
+
attrs['id'] = typeof props.id === 'object' ? JSON.stringify(props.id) : String(props.id);
|
|
53
|
+
if (props.label != null)
|
|
54
|
+
attrs['label'] = typeof props.label === 'object' ? JSON.stringify(props.label) : String(props.label);
|
|
55
|
+
if (props.mode != null)
|
|
56
|
+
attrs['mode'] = typeof props.mode === 'object' ? JSON.stringify(props.mode) : String(props.mode);
|
|
57
|
+
if (props.collapsible)
|
|
58
|
+
attrs['collapsible'] = '';
|
|
59
|
+
if (props.headingLevel != null)
|
|
60
|
+
attrs['heading-level'] = typeof props.headingLevel === 'object' ? JSON.stringify(props.headingLevel) : String(props.headingLevel);
|
|
61
|
+
if (props.size != null)
|
|
62
|
+
attrs['size'] = typeof props.size === 'object' ? JSON.stringify(props.size) : String(props.size);
|
|
63
|
+
if (props.disabled)
|
|
64
|
+
attrs['disabled'] = '';
|
|
65
|
+
return h('cx-accordion', { ref: el, ...attrs });
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
export declare const ActivityGroup: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
id: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
};
|
|
6
|
+
status: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
};
|
|
9
|
+
size: {
|
|
10
|
+
type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
|
|
11
|
+
};
|
|
12
|
+
border: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
};
|
|
15
|
+
summary: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
};
|
|
18
|
+
action: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
};
|
|
21
|
+
expanded: {
|
|
22
|
+
type: BooleanConstructor;
|
|
23
|
+
};
|
|
24
|
+
parts: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
};
|
|
27
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
30
|
+
id: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
};
|
|
33
|
+
status: {
|
|
34
|
+
type: StringConstructor;
|
|
35
|
+
};
|
|
36
|
+
size: {
|
|
37
|
+
type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
|
|
38
|
+
};
|
|
39
|
+
border: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
};
|
|
42
|
+
summary: {
|
|
43
|
+
type: StringConstructor;
|
|
44
|
+
};
|
|
45
|
+
action: {
|
|
46
|
+
type: StringConstructor;
|
|
47
|
+
};
|
|
48
|
+
expanded: {
|
|
49
|
+
type: BooleanConstructor;
|
|
50
|
+
};
|
|
51
|
+
parts: {
|
|
52
|
+
type: StringConstructor;
|
|
53
|
+
};
|
|
54
|
+
}>> & Readonly<{}>, {
|
|
55
|
+
expanded: boolean;
|
|
56
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Auto-generated by scripts/generate-vue.mjs — DO NOT EDIT
|
|
2
|
+
// Vue 3 wrapper for <cx-activity-group>
|
|
3
|
+
import { defineComponent, ref, h, onMounted } from 'vue';
|
|
4
|
+
export const ActivityGroup = defineComponent({
|
|
5
|
+
name: 'ActivityGroup',
|
|
6
|
+
props: {
|
|
7
|
+
id: { type: String },
|
|
8
|
+
status: { type: String },
|
|
9
|
+
size: { type: String },
|
|
10
|
+
border: { type: String },
|
|
11
|
+
summary: { type: String },
|
|
12
|
+
action: { type: String },
|
|
13
|
+
expanded: { type: Boolean },
|
|
14
|
+
parts: { type: String },
|
|
15
|
+
},
|
|
16
|
+
emits: {},
|
|
17
|
+
setup(props, { emit, slots, expose }) {
|
|
18
|
+
const el = ref(null);
|
|
19
|
+
const listeners = [];
|
|
20
|
+
onMounted(() => {
|
|
21
|
+
if (!el.value)
|
|
22
|
+
return;
|
|
23
|
+
// Event listeners
|
|
24
|
+
});
|
|
25
|
+
expose({
|
|
26
|
+
/** The underlying Custom Element. */
|
|
27
|
+
el,
|
|
28
|
+
});
|
|
29
|
+
return () => {
|
|
30
|
+
const attrs = {};
|
|
31
|
+
if (props.id != null)
|
|
32
|
+
attrs['id'] = typeof props.id === 'object' ? JSON.stringify(props.id) : String(props.id);
|
|
33
|
+
if (props.status != null)
|
|
34
|
+
attrs['status'] = typeof props.status === 'object' ? JSON.stringify(props.status) : String(props.status);
|
|
35
|
+
if (props.size != null)
|
|
36
|
+
attrs['size'] = typeof props.size === 'object' ? JSON.stringify(props.size) : String(props.size);
|
|
37
|
+
if (props.border != null)
|
|
38
|
+
attrs['border'] = typeof props.border === 'object' ? JSON.stringify(props.border) : String(props.border);
|
|
39
|
+
if (props.summary != null)
|
|
40
|
+
attrs['summary'] = typeof props.summary === 'object' ? JSON.stringify(props.summary) : String(props.summary);
|
|
41
|
+
if (props.action != null)
|
|
42
|
+
attrs['action'] = typeof props.action === 'object' ? JSON.stringify(props.action) : String(props.action);
|
|
43
|
+
if (props.expanded)
|
|
44
|
+
attrs['expanded'] = '';
|
|
45
|
+
if (props.parts != null)
|
|
46
|
+
attrs['parts'] = typeof props.parts === 'object' ? JSON.stringify(props.parts) : String(props.parts);
|
|
47
|
+
return h('cx-activity-group', { ref: el, ...attrs });
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
});
|
package/dist/alert.d.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import type { DismissDetail } from './types.js';
|
|
3
|
+
export declare const Alert: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
id: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
};
|
|
7
|
+
title: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
};
|
|
10
|
+
description: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
};
|
|
13
|
+
variant: {
|
|
14
|
+
type: PropType<"subtle" | "filled" | "outline">;
|
|
15
|
+
};
|
|
16
|
+
intent: {
|
|
17
|
+
type: PropType<"neutral" | "primary" | "info" | "success" | "warning" | "danger">;
|
|
18
|
+
};
|
|
19
|
+
size: {
|
|
20
|
+
type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
|
|
21
|
+
};
|
|
22
|
+
showIcon: {
|
|
23
|
+
type: BooleanConstructor;
|
|
24
|
+
};
|
|
25
|
+
icon: {
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
};
|
|
28
|
+
dismissible: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
};
|
|
31
|
+
dismissLabel: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
};
|
|
34
|
+
compact: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
};
|
|
37
|
+
dynamic: {
|
|
38
|
+
type: BooleanConstructor;
|
|
39
|
+
};
|
|
40
|
+
actionsHtml: {
|
|
41
|
+
type: StringConstructor;
|
|
42
|
+
};
|
|
43
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
44
|
+
[key: string]: any;
|
|
45
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
46
|
+
'cx-dismiss': (event: CustomEvent<DismissDetail>) => true;
|
|
47
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
48
|
+
id: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
};
|
|
51
|
+
title: {
|
|
52
|
+
type: StringConstructor;
|
|
53
|
+
};
|
|
54
|
+
description: {
|
|
55
|
+
type: StringConstructor;
|
|
56
|
+
};
|
|
57
|
+
variant: {
|
|
58
|
+
type: PropType<"subtle" | "filled" | "outline">;
|
|
59
|
+
};
|
|
60
|
+
intent: {
|
|
61
|
+
type: PropType<"neutral" | "primary" | "info" | "success" | "warning" | "danger">;
|
|
62
|
+
};
|
|
63
|
+
size: {
|
|
64
|
+
type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
|
|
65
|
+
};
|
|
66
|
+
showIcon: {
|
|
67
|
+
type: BooleanConstructor;
|
|
68
|
+
};
|
|
69
|
+
icon: {
|
|
70
|
+
type: StringConstructor;
|
|
71
|
+
};
|
|
72
|
+
dismissible: {
|
|
73
|
+
type: BooleanConstructor;
|
|
74
|
+
};
|
|
75
|
+
dismissLabel: {
|
|
76
|
+
type: StringConstructor;
|
|
77
|
+
};
|
|
78
|
+
compact: {
|
|
79
|
+
type: BooleanConstructor;
|
|
80
|
+
};
|
|
81
|
+
dynamic: {
|
|
82
|
+
type: BooleanConstructor;
|
|
83
|
+
};
|
|
84
|
+
actionsHtml: {
|
|
85
|
+
type: StringConstructor;
|
|
86
|
+
};
|
|
87
|
+
}>> & Readonly<{
|
|
88
|
+
"onCx-dismiss"?: ((event: CustomEvent<DismissDetail>) => any) | undefined;
|
|
89
|
+
}>, {
|
|
90
|
+
showIcon: boolean;
|
|
91
|
+
dismissible: boolean;
|
|
92
|
+
compact: boolean;
|
|
93
|
+
dynamic: boolean;
|
|
94
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
package/dist/alert.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Auto-generated by scripts/generate-vue.mjs — DO NOT EDIT
|
|
2
|
+
// Vue 3 wrapper for <cx-alert>
|
|
3
|
+
import { defineComponent, ref, h, onMounted, watch } from 'vue';
|
|
4
|
+
export const Alert = defineComponent({
|
|
5
|
+
name: 'Alert',
|
|
6
|
+
props: {
|
|
7
|
+
id: { type: String },
|
|
8
|
+
title: { type: String },
|
|
9
|
+
description: { type: String },
|
|
10
|
+
variant: { type: String },
|
|
11
|
+
intent: { type: String },
|
|
12
|
+
size: { type: String },
|
|
13
|
+
showIcon: { type: Boolean },
|
|
14
|
+
icon: { type: String },
|
|
15
|
+
dismissible: { type: Boolean },
|
|
16
|
+
dismissLabel: { type: String },
|
|
17
|
+
compact: { type: Boolean },
|
|
18
|
+
dynamic: { type: Boolean },
|
|
19
|
+
actionsHtml: { type: String },
|
|
20
|
+
},
|
|
21
|
+
emits: {
|
|
22
|
+
'cx-dismiss': (event) => true,
|
|
23
|
+
},
|
|
24
|
+
setup(props, { emit, slots, expose }) {
|
|
25
|
+
const el = ref(null);
|
|
26
|
+
const listeners = [];
|
|
27
|
+
onMounted(() => {
|
|
28
|
+
if (!el.value)
|
|
29
|
+
return;
|
|
30
|
+
watch(() => props.title, (val) => {
|
|
31
|
+
if (!el.value)
|
|
32
|
+
return;
|
|
33
|
+
if (val != null)
|
|
34
|
+
el.value.setAttribute('title', String(val));
|
|
35
|
+
else
|
|
36
|
+
el.value.removeAttribute('title');
|
|
37
|
+
}, { immediate: true });
|
|
38
|
+
// Event listeners
|
|
39
|
+
el.value.addEventListener('cx-dismiss', (ev) => emit('cx-dismiss', ev));
|
|
40
|
+
});
|
|
41
|
+
expose({
|
|
42
|
+
/** The underlying Custom Element. */
|
|
43
|
+
el,
|
|
44
|
+
});
|
|
45
|
+
return () => {
|
|
46
|
+
const attrs = {};
|
|
47
|
+
if (props.id != null)
|
|
48
|
+
attrs['id'] = typeof props.id === 'object' ? JSON.stringify(props.id) : String(props.id);
|
|
49
|
+
if (props.description != null)
|
|
50
|
+
attrs['description'] = typeof props.description === 'object' ? JSON.stringify(props.description) : String(props.description);
|
|
51
|
+
if (props.variant != null)
|
|
52
|
+
attrs['variant'] = typeof props.variant === 'object' ? JSON.stringify(props.variant) : String(props.variant);
|
|
53
|
+
if (props.intent != null)
|
|
54
|
+
attrs['intent'] = typeof props.intent === 'object' ? JSON.stringify(props.intent) : String(props.intent);
|
|
55
|
+
if (props.size != null)
|
|
56
|
+
attrs['size'] = typeof props.size === 'object' ? JSON.stringify(props.size) : String(props.size);
|
|
57
|
+
if (props.showIcon)
|
|
58
|
+
attrs['show-icon'] = '';
|
|
59
|
+
if (props.icon != null)
|
|
60
|
+
attrs['icon'] = typeof props.icon === 'object' ? JSON.stringify(props.icon) : String(props.icon);
|
|
61
|
+
if (props.dismissible)
|
|
62
|
+
attrs['dismissible'] = '';
|
|
63
|
+
if (props.dismissLabel != null)
|
|
64
|
+
attrs['dismiss-label'] = typeof props.dismissLabel === 'object' ? JSON.stringify(props.dismissLabel) : String(props.dismissLabel);
|
|
65
|
+
if (props.compact)
|
|
66
|
+
attrs['compact'] = '';
|
|
67
|
+
if (props.dynamic)
|
|
68
|
+
attrs['dynamic'] = '';
|
|
69
|
+
if (props.actionsHtml != null)
|
|
70
|
+
attrs['actions-html'] = typeof props.actionsHtml === 'object' ? JSON.stringify(props.actionsHtml) : String(props.actionsHtml);
|
|
71
|
+
return h('cx-alert', { ref: el, ...attrs }, [
|
|
72
|
+
slots.actions ? h('div', { slot: 'actions', style: 'display:contents' }, slots.actions()) : undefined
|
|
73
|
+
]);
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
});
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import type { FocusDetail, InputDetail, KeyboardDetail, OptionGroup, SelectDetail, SelectOption } from './types.js';
|
|
3
|
+
export interface AutocompleteRef {
|
|
4
|
+
/** Opens the suggestion dropdown. */
|
|
5
|
+
open(): void;
|
|
6
|
+
/** Closes the suggestion dropdown. */
|
|
7
|
+
close(): void;
|
|
8
|
+
/** Clears all selections (multi-mode) or the input (single-mode). */
|
|
9
|
+
clear(): void;
|
|
10
|
+
/** Focuses the search input. */
|
|
11
|
+
focus(): void;
|
|
12
|
+
/** The underlying Custom Element. */
|
|
13
|
+
el: HTMLElement | null;
|
|
14
|
+
}
|
|
15
|
+
export declare const Autocomplete: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
16
|
+
id: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
};
|
|
19
|
+
label: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
};
|
|
22
|
+
variant: {
|
|
23
|
+
type: PropType<"outline" | "filled" | "ghost">;
|
|
24
|
+
};
|
|
25
|
+
shape: {
|
|
26
|
+
type: PropType<"sharp" | "rounded" | "pill">;
|
|
27
|
+
};
|
|
28
|
+
size: {
|
|
29
|
+
type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
|
|
30
|
+
};
|
|
31
|
+
/** 'single' for single select, 'multiple' for multi-select with chips. */
|
|
32
|
+
mode: {
|
|
33
|
+
type: PropType<"single" | "multiple">;
|
|
34
|
+
};
|
|
35
|
+
selected: {
|
|
36
|
+
type: PropType<string[] | string>;
|
|
37
|
+
};
|
|
38
|
+
/** Current search query text. Controlled by onInput events. */
|
|
39
|
+
query: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
};
|
|
42
|
+
placeholder: {
|
|
43
|
+
type: StringConstructor;
|
|
44
|
+
};
|
|
45
|
+
helperText: {
|
|
46
|
+
type: StringConstructor;
|
|
47
|
+
};
|
|
48
|
+
error: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
};
|
|
51
|
+
disabled: {
|
|
52
|
+
type: BooleanConstructor;
|
|
53
|
+
};
|
|
54
|
+
required: {
|
|
55
|
+
type: BooleanConstructor;
|
|
56
|
+
};
|
|
57
|
+
readonly: {
|
|
58
|
+
type: BooleanConstructor;
|
|
59
|
+
};
|
|
60
|
+
name: {
|
|
61
|
+
type: StringConstructor;
|
|
62
|
+
};
|
|
63
|
+
/** When true, user can submit values not in the items list. */
|
|
64
|
+
allowCustom: {
|
|
65
|
+
type: BooleanConstructor;
|
|
66
|
+
};
|
|
67
|
+
clearable: {
|
|
68
|
+
type: BooleanConstructor;
|
|
69
|
+
};
|
|
70
|
+
/** Options to filter from. Filtering is client-side (fuzzy substring match). For server-side search, update this array in your onInput handler. */
|
|
71
|
+
items: {
|
|
72
|
+
type: PropType<SelectOption[] | string>;
|
|
73
|
+
};
|
|
74
|
+
groups: {
|
|
75
|
+
type: PropType<OptionGroup[] | string>;
|
|
76
|
+
};
|
|
77
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
78
|
+
[key: string]: any;
|
|
79
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
80
|
+
'cx-input': (event: CustomEvent<InputDetail>) => true;
|
|
81
|
+
'cx-change': (event: CustomEvent<SelectDetail>) => true;
|
|
82
|
+
'cx-focus': (event: CustomEvent<FocusDetail>) => true;
|
|
83
|
+
'cx-blur': (event: CustomEvent<FocusDetail>) => true;
|
|
84
|
+
'cx-keydown': (event: CustomEvent<KeyboardDetail>) => true;
|
|
85
|
+
'cx-keyup': (event: CustomEvent<KeyboardDetail>) => true;
|
|
86
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
87
|
+
id: {
|
|
88
|
+
type: StringConstructor;
|
|
89
|
+
};
|
|
90
|
+
label: {
|
|
91
|
+
type: StringConstructor;
|
|
92
|
+
};
|
|
93
|
+
variant: {
|
|
94
|
+
type: PropType<"outline" | "filled" | "ghost">;
|
|
95
|
+
};
|
|
96
|
+
shape: {
|
|
97
|
+
type: PropType<"sharp" | "rounded" | "pill">;
|
|
98
|
+
};
|
|
99
|
+
size: {
|
|
100
|
+
type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
|
|
101
|
+
};
|
|
102
|
+
/** 'single' for single select, 'multiple' for multi-select with chips. */
|
|
103
|
+
mode: {
|
|
104
|
+
type: PropType<"single" | "multiple">;
|
|
105
|
+
};
|
|
106
|
+
selected: {
|
|
107
|
+
type: PropType<string[] | string>;
|
|
108
|
+
};
|
|
109
|
+
/** Current search query text. Controlled by onInput events. */
|
|
110
|
+
query: {
|
|
111
|
+
type: StringConstructor;
|
|
112
|
+
};
|
|
113
|
+
placeholder: {
|
|
114
|
+
type: StringConstructor;
|
|
115
|
+
};
|
|
116
|
+
helperText: {
|
|
117
|
+
type: StringConstructor;
|
|
118
|
+
};
|
|
119
|
+
error: {
|
|
120
|
+
type: StringConstructor;
|
|
121
|
+
};
|
|
122
|
+
disabled: {
|
|
123
|
+
type: BooleanConstructor;
|
|
124
|
+
};
|
|
125
|
+
required: {
|
|
126
|
+
type: BooleanConstructor;
|
|
127
|
+
};
|
|
128
|
+
readonly: {
|
|
129
|
+
type: BooleanConstructor;
|
|
130
|
+
};
|
|
131
|
+
name: {
|
|
132
|
+
type: StringConstructor;
|
|
133
|
+
};
|
|
134
|
+
/** When true, user can submit values not in the items list. */
|
|
135
|
+
allowCustom: {
|
|
136
|
+
type: BooleanConstructor;
|
|
137
|
+
};
|
|
138
|
+
clearable: {
|
|
139
|
+
type: BooleanConstructor;
|
|
140
|
+
};
|
|
141
|
+
/** Options to filter from. Filtering is client-side (fuzzy substring match). For server-side search, update this array in your onInput handler. */
|
|
142
|
+
items: {
|
|
143
|
+
type: PropType<SelectOption[] | string>;
|
|
144
|
+
};
|
|
145
|
+
groups: {
|
|
146
|
+
type: PropType<OptionGroup[] | string>;
|
|
147
|
+
};
|
|
148
|
+
}>> & Readonly<{
|
|
149
|
+
"onCx-change"?: ((event: CustomEvent<SelectDetail>) => any) | undefined;
|
|
150
|
+
"onCx-input"?: ((event: CustomEvent<InputDetail>) => any) | undefined;
|
|
151
|
+
"onCx-focus"?: ((event: CustomEvent<FocusDetail>) => any) | undefined;
|
|
152
|
+
"onCx-blur"?: ((event: CustomEvent<FocusDetail>) => any) | undefined;
|
|
153
|
+
"onCx-keydown"?: ((event: CustomEvent<KeyboardDetail>) => any) | undefined;
|
|
154
|
+
"onCx-keyup"?: ((event: CustomEvent<KeyboardDetail>) => any) | undefined;
|
|
155
|
+
}>, {
|
|
156
|
+
disabled: boolean;
|
|
157
|
+
required: boolean;
|
|
158
|
+
readonly: boolean;
|
|
159
|
+
allowCustom: boolean;
|
|
160
|
+
clearable: boolean;
|
|
161
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|