@webx-ui/core 0.0.2 → 0.1.0

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 (69) hide show
  1. package/dist/components/Card/Card.d.ts +3 -1
  2. package/dist/components/Card/types.d.ts +2 -2
  3. package/dist/components/Checkbox/Checkbox.d.ts +41 -0
  4. package/dist/components/Checkbox/index.d.ts +2 -0
  5. package/dist/components/Checkbox/types.d.ts +18 -0
  6. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +37 -0
  7. package/dist/components/CheckboxGroup/index.d.ts +2 -0
  8. package/dist/components/CheckboxGroup/types.d.ts +23 -0
  9. package/dist/components/ColorPicker/ColorPicker.d.ts +25 -0
  10. package/dist/components/ColorPicker/index.d.ts +2 -0
  11. package/dist/components/ColorPicker/types.d.ts +21 -0
  12. package/dist/components/DatePicker/DatePicker.d.ts +54 -0
  13. package/dist/components/DatePicker/index.d.ts +2 -0
  14. package/dist/components/DatePicker/types.d.ts +47 -0
  15. package/dist/components/DateRangePicker/DateRangePicker.d.ts +51 -0
  16. package/dist/components/DateRangePicker/index.d.ts +2 -0
  17. package/dist/components/DateRangePicker/types.d.ts +37 -0
  18. package/dist/components/DateTimePicker/DateTimePicker.d.ts +52 -0
  19. package/dist/components/DateTimePicker/index.d.ts +1 -0
  20. package/dist/components/Form/Form.d.ts +32 -0
  21. package/dist/components/Form/index.d.ts +2 -0
  22. package/dist/components/Form/types.d.ts +22 -0
  23. package/dist/components/FormItem/FormItem.d.ts +33 -0
  24. package/dist/components/FormItem/index.d.ts +2 -0
  25. package/dist/components/FormItem/types.d.ts +24 -0
  26. package/dist/components/Input/Input.d.ts +11 -10
  27. package/dist/components/Input/types.d.ts +2 -0
  28. package/dist/components/InputNumber/InputNumber.d.ts +41 -0
  29. package/dist/components/InputNumber/index.d.ts +2 -0
  30. package/dist/components/InputNumber/types.d.ts +34 -0
  31. package/dist/components/Radio/Radio.d.ts +36 -0
  32. package/dist/components/Radio/index.d.ts +2 -0
  33. package/dist/components/Radio/types.d.ts +16 -0
  34. package/dist/components/RadioGroup/RadioGroup.d.ts +35 -0
  35. package/dist/components/RadioGroup/index.d.ts +2 -0
  36. package/dist/components/RadioGroup/types.d.ts +19 -0
  37. package/dist/components/Rate/Rate.d.ts +24 -0
  38. package/dist/components/Rate/index.d.ts +2 -0
  39. package/dist/components/Rate/types.d.ts +22 -0
  40. package/dist/components/RichText/RichText.d.ts +38 -0
  41. package/dist/components/RichText/ToolbarButton.d.ts +20 -0
  42. package/dist/components/RichText/icons.d.ts +6 -0
  43. package/dist/components/RichText/index.d.ts +2 -0
  44. package/dist/components/RichText/tools.d.ts +48 -0
  45. package/dist/components/RichText/types.d.ts +42 -0
  46. package/dist/components/Select/Select.d.ts +50 -0
  47. package/dist/components/Select/index.d.ts +2 -0
  48. package/dist/components/Select/types.d.ts +41 -0
  49. package/dist/components/Slider/Slider.d.ts +26 -0
  50. package/dist/components/Slider/index.d.ts +2 -0
  51. package/dist/components/Slider/types.d.ts +24 -0
  52. package/dist/components/Switch/Switch.d.ts +38 -0
  53. package/dist/components/Switch/index.d.ts +2 -0
  54. package/dist/components/Switch/types.d.ts +18 -0
  55. package/dist/components/TagsInput/TagsInput.d.ts +32 -0
  56. package/dist/components/TagsInput/index.d.ts +2 -0
  57. package/dist/components/TagsInput/types.d.ts +26 -0
  58. package/dist/components/Textarea/Textarea.d.ts +39 -0
  59. package/dist/components/Textarea/index.d.ts +2 -0
  60. package/dist/components/Textarea/types.d.ts +31 -0
  61. package/dist/components/TimePicker/TimePicker.d.ts +52 -0
  62. package/dist/components/TimePicker/index.d.ts +1 -0
  63. package/dist/components/index.d.ts +20 -1
  64. package/dist/composables/useFormField.d.ts +64 -0
  65. package/dist/index.d.ts +1 -0
  66. package/dist/index.js +2418 -164
  67. package/dist/index.js.map +1 -1
  68. package/dist/style.css +1 -1
  69. package/package.json +12 -2
@@ -0,0 +1,41 @@
1
+ import { InputNumberModelValue, InputNumberProps } from './types';
2
+ type __VLS_Props = InputNumberProps;
3
+ type __VLS_PublicProps = {
4
+ modelValue?: InputNumberModelValue;
5
+ } & __VLS_Props;
6
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
7
+ focus: () => void | undefined;
8
+ blur: () => void | undefined;
9
+ increase: () => void;
10
+ decrease: () => void;
11
+ input: import('vue').Ref<HTMLInputElement | null, HTMLInputElement | null>;
12
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
13
+ change: (value: number | null) => any;
14
+ "update:modelValue": (value: InputNumberModelValue) => any;
15
+ blur: (event: FocusEvent) => any;
16
+ focus: (event: FocusEvent) => any;
17
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
18
+ onChange?: ((value: number | null) => any) | undefined;
19
+ "onUpdate:modelValue"?: ((value: InputNumberModelValue) => any) | undefined;
20
+ onBlur?: ((event: FocusEvent) => any) | undefined;
21
+ onFocus?: ((event: FocusEvent) => any) | undefined;
22
+ }>, {
23
+ name: string;
24
+ size: import('../..').ControlSize;
25
+ disabled: boolean;
26
+ id: string;
27
+ ariaLabel: string;
28
+ min: number;
29
+ max: number;
30
+ placeholder: string;
31
+ readonly: boolean;
32
+ status: import('../..').ControlStatus;
33
+ step: number;
34
+ precision: number;
35
+ controls: boolean;
36
+ controlsPosition: "sides" | "right";
37
+ wheel: boolean;
38
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
39
+ inputRef: HTMLInputElement;
40
+ }, any>;
41
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export { default as WxInputNumber } from './InputNumber';
2
+ export type * from './types';
@@ -0,0 +1,34 @@
1
+ import { ControlSize, ControlStatus } from '../../composables/useFormField';
2
+ export interface InputNumberProps {
3
+ min?: number;
4
+ max?: number;
5
+ /** Amount added or removed by the buttons and the arrow keys. */
6
+ step?: number;
7
+ /** Decimal places kept when rounding. Defaults to the precision of `step`. */
8
+ precision?: number;
9
+ /** Show the increment and decrement buttons. */
10
+ controls?: boolean;
11
+ /** `sides` puts them left and right of the field; `right` stacks them at the end. */
12
+ controlsPosition?: 'sides' | 'right';
13
+ /**
14
+ * Let the mouse wheel change the value while the field is focused.
15
+ * Off by default: scrolling a long form past a focused field would otherwise
16
+ * edit it silently, which is how these fields lose data.
17
+ */
18
+ wheel?: boolean;
19
+ size?: ControlSize;
20
+ status?: ControlStatus;
21
+ id?: string;
22
+ name?: string;
23
+ placeholder?: string;
24
+ disabled?: boolean;
25
+ readonly?: boolean;
26
+ /** Accessible label used when the field has no visible `<label>`. */
27
+ ariaLabel?: string;
28
+ }
29
+ export type InputNumberModelValue = number | null | undefined;
30
+ export interface InputNumberEmits {
31
+ change: [value: number | null];
32
+ focus: [event: FocusEvent];
33
+ blur: [event: FocusEvent];
34
+ }
@@ -0,0 +1,36 @@
1
+ import { ChoiceValue } from '../../composables/useFormField';
2
+ import { RadioProps } from './types';
3
+ type __VLS_Props = RadioProps;
4
+ type __VLS_PublicProps = {
5
+ modelValue?: ChoiceValue;
6
+ } & __VLS_Props;
7
+ declare function __VLS_template(): {
8
+ attrs: Partial<{}>;
9
+ slots: {
10
+ default?(_: {}): any;
11
+ };
12
+ refs: {};
13
+ rootEl: any;
14
+ };
15
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
17
+ change: (value: ChoiceValue) => any;
18
+ "update:modelValue": (value: ChoiceValue) => any;
19
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
20
+ onChange?: ((value: ChoiceValue) => any) | undefined;
21
+ "onUpdate:modelValue"?: ((value: ChoiceValue) => any) | undefined;
22
+ }>, {
23
+ name: string;
24
+ size: import('../..').ControlSize;
25
+ disabled: boolean;
26
+ label: string;
27
+ id: string;
28
+ ariaLabel: string;
29
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
30
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
31
+ export default _default;
32
+ type __VLS_WithTemplateSlots<T, S> = T & {
33
+ new (): {
34
+ $slots: S;
35
+ };
36
+ };
@@ -0,0 +1,2 @@
1
+ export { default as WxRadio } from './Radio';
2
+ export type * from './types';
@@ -0,0 +1,16 @@
1
+ import { ChoiceValue, ControlSize } from '../../composables/useFormField';
2
+ export interface RadioProps {
3
+ /** Value this radio stands for. */
4
+ value: ChoiceValue;
5
+ /** Label text. Use the default slot for anything richer. */
6
+ label?: string;
7
+ disabled?: boolean;
8
+ size?: ControlSize;
9
+ id?: string;
10
+ name?: string;
11
+ /** Accessible label used when there is no visible one. */
12
+ ariaLabel?: string;
13
+ }
14
+ export interface RadioEmits {
15
+ change: [value: ChoiceValue];
16
+ }
@@ -0,0 +1,35 @@
1
+ import { ChoiceValue } from '../../composables/useFormField';
2
+ import { RadioGroupProps } from './types';
3
+ type __VLS_Props = RadioGroupProps;
4
+ type __VLS_PublicProps = {
5
+ modelValue?: ChoiceValue;
6
+ } & __VLS_Props;
7
+ declare function __VLS_template(): {
8
+ attrs: Partial<{}>;
9
+ slots: {
10
+ default?(_: {}): any;
11
+ };
12
+ refs: {};
13
+ rootEl: HTMLDivElement;
14
+ };
15
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
17
+ change: (value: ChoiceValue) => any;
18
+ "update:modelValue": (value: ChoiceValue) => any;
19
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
20
+ onChange?: ((value: ChoiceValue) => any) | undefined;
21
+ "onUpdate:modelValue"?: ((value: ChoiceValue) => any) | undefined;
22
+ }>, {
23
+ name: string;
24
+ size: import('../..').ControlSize;
25
+ disabled: boolean;
26
+ options: import('./types').RadioOption[];
27
+ inline: boolean;
28
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
29
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
30
+ export default _default;
31
+ type __VLS_WithTemplateSlots<T, S> = T & {
32
+ new (): {
33
+ $slots: S;
34
+ };
35
+ };
@@ -0,0 +1,2 @@
1
+ export { default as WxRadioGroup } from './RadioGroup';
2
+ export type * from './types';
@@ -0,0 +1,19 @@
1
+ import { ChoiceValue, ControlSize } from '../../composables/useFormField';
2
+ export interface RadioOption {
3
+ label: string;
4
+ value: ChoiceValue;
5
+ disabled?: boolean;
6
+ }
7
+ export interface RadioGroupProps {
8
+ /** Renders the children for you. Omit it and pass `WxRadio`s in the slot instead. */
9
+ options?: RadioOption[];
10
+ disabled?: boolean;
11
+ size?: ControlSize;
12
+ /** Shared `name` for the underlying inputs. Generated when omitted. */
13
+ name?: string;
14
+ /** Lay the radios out in a row instead of a column. */
15
+ inline?: boolean;
16
+ }
17
+ export interface RadioGroupEmits {
18
+ change: [value: ChoiceValue];
19
+ }
@@ -0,0 +1,24 @@
1
+ import { RateProps } from './types';
2
+ type __VLS_Props = RateProps;
3
+ type __VLS_PublicProps = {
4
+ modelValue?: number;
5
+ } & __VLS_Props;
6
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ change: (value: number) => any;
8
+ "update:modelValue": (value: number) => any;
9
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
10
+ onChange?: ((value: number) => any) | undefined;
11
+ "onUpdate:modelValue"?: ((value: number) => any) | undefined;
12
+ }>, {
13
+ name: string;
14
+ size: import('../..').ControlSize;
15
+ disabled: boolean;
16
+ id: string;
17
+ ariaLabel: string;
18
+ max: number;
19
+ clearable: boolean;
20
+ readonly: boolean;
21
+ allowHalf: boolean;
22
+ showValue: boolean;
23
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
24
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export { default as WxRate } from './Rate';
2
+ export type * from './types';
@@ -0,0 +1,22 @@
1
+ import { ControlSize } from '../../composables/useFormField';
2
+ export interface RateProps {
3
+ /** How many stars to draw. */
4
+ max?: number;
5
+ /** Allow halves, set by clicking the left side of a star. */
6
+ allowHalf?: boolean;
7
+ /** Clicking the current value sets the rating back to zero. */
8
+ clearable?: boolean;
9
+ /** Show the value next to the stars. */
10
+ showValue?: boolean;
11
+ /** Display only — no pointer or keyboard interaction. */
12
+ readonly?: boolean;
13
+ disabled?: boolean;
14
+ size?: ControlSize;
15
+ id?: string;
16
+ name?: string;
17
+ /** Accessible label used when there is no visible `<label>`. */
18
+ ariaLabel?: string;
19
+ }
20
+ export interface RateEmits {
21
+ change: [value: number];
22
+ }
@@ -0,0 +1,38 @@
1
+ import { RichTextProps, RichTextTool } from './types';
2
+ type __VLS_Props = RichTextProps;
3
+ type __VLS_PublicProps = {
4
+ modelValue?: string;
5
+ } & __VLS_Props;
6
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
7
+ editor: import('vue').ShallowRef<import('@tiptap/vue-3').Editor | undefined, import('@tiptap/vue-3').Editor | undefined>;
8
+ focus: () => boolean | undefined;
9
+ clear: () => boolean | undefined;
10
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
11
+ change: (html: string) => any;
12
+ "update:modelValue": (value: string) => any;
13
+ blur: () => any;
14
+ focus: () => any;
15
+ uploadError: (error: unknown, file: File) => any;
16
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
17
+ onChange?: ((html: string) => any) | undefined;
18
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
19
+ onBlur?: (() => any) | undefined;
20
+ onFocus?: (() => any) | undefined;
21
+ onUploadError?: ((error: unknown, file: File) => any) | undefined;
22
+ }>, {
23
+ size: import('../..').ControlSize;
24
+ disabled: boolean;
25
+ id: string;
26
+ ariaLabel: string;
27
+ placeholder: string;
28
+ readonly: boolean;
29
+ status: import('../..').ControlStatus;
30
+ minHeight: string;
31
+ tools: RichTextTool[];
32
+ upload: import('./types').RichTextUpload;
33
+ pickImage: import('./types').RichTextImagePicker;
34
+ accept: string[];
35
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
36
+ fileInput: HTMLInputElement;
37
+ }, any>;
38
+ export default _default;
@@ -0,0 +1,20 @@
1
+ type __VLS_Props = {
2
+ /** Key into the icon set. Omit it and the `text` shows instead. */
3
+ icon?: string;
4
+ /** Short label used for headings, where a glyph reads worse than "H2". */
5
+ text?: string;
6
+ label: string;
7
+ active?: boolean;
8
+ disabled?: boolean;
9
+ };
10
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
11
+ click: () => any;
12
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
13
+ onClick?: (() => any) | undefined;
14
+ }>, {
15
+ text: string;
16
+ disabled: boolean;
17
+ icon: string;
18
+ active: boolean;
19
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLButtonElement>;
20
+ export default _default;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Toolbar glyphs as raw path data, drawn on a 24×24 grid with a 1.7 stroke.
3
+ * Inline rather than an icon package: it is a dozen paths, and a dependency for
4
+ * that would be worse than the duplication.
5
+ */
6
+ export declare const richTextIcons: Record<string, string>;
@@ -0,0 +1,2 @@
1
+ export { default as WxRichText } from './RichText';
2
+ export type * from './types';
@@ -0,0 +1,48 @@
1
+ import { RichTextTool } from './types';
2
+ /**
3
+ * Kept out of the component because `withDefaults` cannot reference a binding
4
+ * declared inside `<script setup>` — it is hoisted out of `setup()`.
5
+ */
6
+ export declare const DEFAULT_TOOLS: RichTextTool[];
7
+ export declare const DEFAULT_ACCEPT: string[];
8
+ export interface ToolMeta {
9
+ label: string;
10
+ icon?: string;
11
+ text?: string;
12
+ }
13
+ export declare const TOOL_META: Record<Exclude<RichTextTool, 'divider'>, ToolMeta>;
14
+ /** Shown as a second row while the caret sits inside a table. */
15
+ export declare const TABLE_TOOLS: readonly [{
16
+ readonly key: "addRowAfter";
17
+ readonly label: "Row below";
18
+ readonly icon: "rowAfter";
19
+ }, {
20
+ readonly key: "addRowBefore";
21
+ readonly label: "Row above";
22
+ readonly icon: "rowBefore";
23
+ }, {
24
+ readonly key: "addColumnAfter";
25
+ readonly label: "Column after";
26
+ readonly icon: "columnAfter";
27
+ }, {
28
+ readonly key: "addColumnBefore";
29
+ readonly label: "Column before";
30
+ readonly icon: "columnBefore";
31
+ }, {
32
+ readonly key: "deleteRow";
33
+ readonly label: "Delete row";
34
+ readonly icon: "deleteRow";
35
+ }, {
36
+ readonly key: "deleteColumn";
37
+ readonly label: "Delete column";
38
+ readonly icon: "deleteColumn";
39
+ }, {
40
+ readonly key: "mergeOrSplit";
41
+ readonly label: "Merge or split cells";
42
+ readonly icon: "mergeCells";
43
+ }, {
44
+ readonly key: "deleteTable";
45
+ readonly label: "Delete table";
46
+ readonly icon: "deleteTable";
47
+ }];
48
+ export type TableToolKey = (typeof TABLE_TOOLS)[number]['key'];
@@ -0,0 +1,42 @@
1
+ import { ControlSize, ControlStatus } from '../../composables/useFormField';
2
+ export type RichTextTool = 'bold' | 'italic' | 'strike' | 'code' | 'h2' | 'h3' | 'h4' | 'bulletList' | 'orderedList' | 'blockquote' | 'hr' | 'link' | 'table' | 'image' | 'youtube' | 'undo' | 'redo'
3
+ /** A vertical rule between groups. */
4
+ | 'divider';
5
+ export interface RichTextUploadResult {
6
+ url: string;
7
+ alt?: string;
8
+ }
9
+ /** Uploads one file and resolves with the URL it ended up at. */
10
+ export type RichTextUpload = (file: File) => Promise<RichTextUploadResult>;
11
+ /** Opens a media library and resolves with the chosen URL, or `null` if cancelled. */
12
+ export type RichTextImagePicker = () => Promise<string | null>;
13
+ export interface RichTextProps {
14
+ placeholder?: string;
15
+ disabled?: boolean;
16
+ readonly?: boolean;
17
+ size?: ControlSize;
18
+ status?: ControlStatus;
19
+ id?: string;
20
+ /** Accessible label used when there is no visible `<label>`. */
21
+ ariaLabel?: string;
22
+ /** Height of the editing area before it starts growing. */
23
+ minHeight?: string;
24
+ /** Which buttons the toolbar shows, in order. */
25
+ tools?: RichTextTool[];
26
+ /**
27
+ * Called for pasted and dropped files. Without it the editor accepts no files
28
+ * at all, and the image button only offers the media library.
29
+ */
30
+ upload?: RichTextUpload;
31
+ /** Called by the image button — this is where a media library plugs in. */
32
+ pickImage?: RichTextImagePicker;
33
+ /** MIME types accepted for upload. */
34
+ accept?: string[];
35
+ }
36
+ export interface RichTextEmits {
37
+ change: [html: string];
38
+ focus: [];
39
+ blur: [];
40
+ /** An upload rejected. The editor stays untouched. */
41
+ uploadError: [error: unknown, file: File];
42
+ }
@@ -0,0 +1,50 @@
1
+ import { SelectModelValue, SelectProps } from './types';
2
+ type __VLS_Props = SelectProps;
3
+ type __VLS_PublicProps = {
4
+ modelValue?: SelectModelValue;
5
+ } & __VLS_Props;
6
+ declare function __VLS_template(): {
7
+ attrs: Partial<{}>;
8
+ slots: {
9
+ default?(_: {}): any;
10
+ };
11
+ refs: {};
12
+ rootEl: any;
13
+ };
14
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
15
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
16
+ search: (term: string) => any;
17
+ change: (value: SelectModelValue) => any;
18
+ "update:modelValue": (value: SelectModelValue) => any;
19
+ open: () => any;
20
+ clear: () => any;
21
+ close: () => any;
22
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
23
+ onSearch?: ((term: string) => any) | undefined;
24
+ onChange?: ((value: SelectModelValue) => any) | undefined;
25
+ "onUpdate:modelValue"?: ((value: SelectModelValue) => any) | undefined;
26
+ onOpen?: (() => any) | undefined;
27
+ onClear?: (() => any) | undefined;
28
+ onClose?: (() => any) | undefined;
29
+ }>, {
30
+ name: string;
31
+ size: import('../..').ControlSize;
32
+ disabled: boolean;
33
+ id: string;
34
+ ariaLabel: string;
35
+ options: import('./types').SelectOption[];
36
+ clearable: boolean;
37
+ placeholder: string;
38
+ teleport: boolean;
39
+ status: import('../..').ControlStatus;
40
+ multiple: boolean;
41
+ filterable: boolean;
42
+ emptyText: string;
43
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
44
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
45
+ export default _default;
46
+ type __VLS_WithTemplateSlots<T, S> = T & {
47
+ new (): {
48
+ $slots: S;
49
+ };
50
+ };
@@ -0,0 +1,2 @@
1
+ export { default as WxSelect } from './Select';
2
+ export type * from './types';
@@ -0,0 +1,41 @@
1
+ import { ControlSize, ControlStatus } from '../../composables/useFormField';
2
+ /**
3
+ * Narrower than `ChoiceValue`: the underlying combobox accepts strings, numbers and
4
+ * objects but not booleans, and a boolean has no place as a select value anyway.
5
+ */
6
+ export type SelectValue = string | number;
7
+ export interface SelectOption {
8
+ label: string;
9
+ value: SelectValue;
10
+ disabled?: boolean;
11
+ }
12
+ export type SelectModelValue = SelectValue | SelectValue[] | null;
13
+ export interface SelectProps {
14
+ options?: SelectOption[];
15
+ /** Allow more than one value. The model becomes an array. */
16
+ multiple?: boolean;
17
+ /** Show a search field that filters the options. */
18
+ filterable?: boolean;
19
+ /** Show a button that empties the selection. */
20
+ clearable?: boolean;
21
+ placeholder?: string;
22
+ /** Text shown when filtering matches nothing. */
23
+ emptyText?: string;
24
+ /** Render the list in a portal so it escapes `overflow: hidden`. */
25
+ teleport?: boolean;
26
+ disabled?: boolean;
27
+ size?: ControlSize;
28
+ status?: ControlStatus;
29
+ id?: string;
30
+ name?: string;
31
+ /** Accessible label used when there is no visible `<label>`. */
32
+ ariaLabel?: string;
33
+ }
34
+ export interface SelectEmits {
35
+ change: [value: SelectModelValue];
36
+ clear: [];
37
+ open: [];
38
+ close: [];
39
+ /** The search term, on every keystroke. Use it to load options from a backend. */
40
+ search: [term: string];
41
+ }
@@ -0,0 +1,26 @@
1
+ import { SliderModelValue, SliderProps } from './types';
2
+ type __VLS_Props = SliderProps;
3
+ type __VLS_PublicProps = {
4
+ modelValue?: SliderModelValue;
5
+ } & __VLS_Props;
6
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ change: (value: SliderModelValue) => any;
8
+ "update:modelValue": (value: SliderModelValue) => any;
9
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
10
+ onChange?: ((value: SliderModelValue) => any) | undefined;
11
+ "onUpdate:modelValue"?: ((value: SliderModelValue) => any) | undefined;
12
+ }>, {
13
+ name: string;
14
+ size: import('../..').ControlSize;
15
+ disabled: boolean;
16
+ id: string;
17
+ ariaLabel: string;
18
+ range: boolean;
19
+ min: number;
20
+ max: number;
21
+ step: number;
22
+ showValue: boolean;
23
+ marks: Record<number, string>;
24
+ minStepsBetweenThumbs: number;
25
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
26
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export { default as WxSlider } from './Slider';
2
+ export type * from './types';
@@ -0,0 +1,24 @@
1
+ import { ControlSize } from '../../composables/useFormField';
2
+ export type SliderModelValue = number | number[] | null;
3
+ export interface SliderProps {
4
+ min?: number;
5
+ max?: number;
6
+ step?: number;
7
+ /** Two thumbs and a range between them; the model becomes a pair. */
8
+ range?: boolean;
9
+ /** Smallest gap between the thumbs, in steps. */
10
+ minStepsBetweenThumbs?: number;
11
+ /** Show the current value (or both values) next to the track. */
12
+ showValue?: boolean;
13
+ /** Ticks under the track: `{ 0: 'Free', 100: 'Max' }`. */
14
+ marks?: Record<number, string>;
15
+ disabled?: boolean;
16
+ size?: ControlSize;
17
+ id?: string;
18
+ name?: string;
19
+ /** Accessible label used when there is no visible `<label>`. */
20
+ ariaLabel?: string;
21
+ }
22
+ export interface SliderEmits {
23
+ change: [value: SliderModelValue];
24
+ }
@@ -0,0 +1,38 @@
1
+ import { ChoiceValue } from '../../composables/useFormField';
2
+ import { SwitchProps } from './types';
3
+ type __VLS_Props = SwitchProps;
4
+ type __VLS_PublicProps = {
5
+ modelValue?: ChoiceValue;
6
+ } & __VLS_Props;
7
+ declare function __VLS_template(): {
8
+ attrs: Partial<{}>;
9
+ slots: {
10
+ default?(_: {}): any;
11
+ };
12
+ refs: {};
13
+ rootEl: any;
14
+ };
15
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
17
+ change: (value: ChoiceValue) => any;
18
+ "update:modelValue": (value: ChoiceValue) => any;
19
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
20
+ onChange?: ((value: ChoiceValue) => any) | undefined;
21
+ "onUpdate:modelValue"?: ((value: ChoiceValue) => any) | undefined;
22
+ }>, {
23
+ name: string;
24
+ size: import('../..').ControlSize;
25
+ disabled: boolean;
26
+ label: string;
27
+ id: string;
28
+ ariaLabel: string;
29
+ activeValue: ChoiceValue;
30
+ inactiveValue: ChoiceValue;
31
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
32
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
33
+ export default _default;
34
+ type __VLS_WithTemplateSlots<T, S> = T & {
35
+ new (): {
36
+ $slots: S;
37
+ };
38
+ };
@@ -0,0 +1,2 @@
1
+ export { default as WxSwitch } from './Switch';
2
+ export type * from './types';
@@ -0,0 +1,18 @@
1
+ import { ChoiceValue, ControlSize } from '../../composables/useFormField';
2
+ export interface SwitchProps {
3
+ /** Value written when the switch is on. */
4
+ activeValue?: ChoiceValue;
5
+ /** Value written when the switch is off. */
6
+ inactiveValue?: ChoiceValue;
7
+ /** Label text shown next to the track. */
8
+ label?: string;
9
+ disabled?: boolean;
10
+ size?: ControlSize;
11
+ id?: string;
12
+ name?: string;
13
+ /** Accessible label used when there is no visible one. */
14
+ ariaLabel?: string;
15
+ }
16
+ export interface SwitchEmits {
17
+ change: [value: ChoiceValue];
18
+ }