sit-onyx 1.0.0-alpha.87 → 1.0.0-alpha.89

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.
@@ -1,51 +1,75 @@
1
- import { OnyxCheckboxProps } from './types';
1
+ import { SelectOptionValue } from '../../types';
2
2
 
3
- declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<OnyxCheckboxProps>, {
4
- modelValue: boolean;
5
- indeterminate: boolean;
6
- disabled: boolean;
7
- loading: boolean;
8
- required: boolean;
9
- truncation: string;
10
- skeleton: boolean;
11
- }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
12
- validityChange: (validity: ValidityState) => void;
13
- "update:modelValue": (value: boolean) => void;
14
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<OnyxCheckboxProps>, {
15
- modelValue: boolean;
16
- indeterminate: boolean;
17
- disabled: boolean;
18
- loading: boolean;
19
- required: boolean;
20
- truncation: string;
21
- skeleton: boolean;
22
- }>>> & {
3
+ declare const _default: <TValue extends SelectOptionValue = SelectOptionValue>(__VLS_props: {
4
+ required?: boolean | undefined;
5
+ label: string;
6
+ value: TValue;
7
+ density?: "default" | "compact" | "cozy" | undefined;
8
+ disabled?: boolean | undefined;
9
+ loading?: boolean | undefined;
10
+ skeleton?: boolean | undefined;
11
+ customError?: string | undefined;
12
+ indeterminate?: boolean | undefined;
13
+ hideLabel?: boolean | undefined;
14
+ truncation?: "ellipsis" | "multiline" | undefined;
15
+ requiredMarker?: "required" | "optional" | undefined;
16
+ modelValue?: boolean | undefined;
23
17
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
24
18
  onValidityChange?: ((validity: ValidityState) => any) | undefined;
25
- }, {
26
- required: boolean;
27
- disabled: boolean;
28
- loading: boolean;
29
- skeleton: boolean;
30
- indeterminate: boolean;
31
- modelValue: boolean;
32
- truncation: "ellipsis" | "multiline";
33
- }, {}>;
34
- export default _default;
35
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
36
- type __VLS_TypePropsToRuntimeProps<T> = {
37
- [K in keyof T]-?: {} extends Pick<T, K> ? {
38
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
39
- } : {
40
- type: import('vue').PropType<T[K]>;
41
- required: true;
42
- };
43
- };
44
- type __VLS_WithDefaults<P, D> = {
45
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
46
- default: D[K];
47
- }> : P[K];
19
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, __VLS_ctx?: {
20
+ attrs: any;
21
+ slots: {};
22
+ emit: ((evt: "validityChange", validity: ValidityState) => void) & ((evt: "update:modelValue", value: boolean) => void);
23
+ } | undefined, __VLS_expose?: ((exposed: import('vue').ShallowUnwrapRef<{}>) => void) | undefined, __VLS_setup?: Promise<{
24
+ props: {
25
+ required?: boolean | undefined;
26
+ label: string;
27
+ value: TValue;
28
+ density?: "default" | "compact" | "cozy" | undefined;
29
+ disabled?: boolean | undefined;
30
+ loading?: boolean | undefined;
31
+ skeleton?: boolean | undefined;
32
+ customError?: string | undefined;
33
+ indeterminate?: boolean | undefined;
34
+ hideLabel?: boolean | undefined;
35
+ truncation?: "ellipsis" | "multiline" | undefined;
36
+ requiredMarker?: "required" | "optional" | undefined;
37
+ modelValue?: boolean | undefined;
38
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
39
+ onValidityChange?: ((validity: ValidityState) => any) | undefined;
40
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
41
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
42
+ attrs: any;
43
+ slots: {};
44
+ emit: ((evt: "validityChange", validity: ValidityState) => void) & ((evt: "update:modelValue", value: boolean) => void);
45
+ }>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
46
+ [key: string]: any;
47
+ }> & {
48
+ __ctx?: {
49
+ props: {
50
+ required?: boolean | undefined;
51
+ label: string;
52
+ value: TValue;
53
+ density?: "default" | "compact" | "cozy" | undefined;
54
+ disabled?: boolean | undefined;
55
+ loading?: boolean | undefined;
56
+ skeleton?: boolean | undefined;
57
+ customError?: string | undefined;
58
+ indeterminate?: boolean | undefined;
59
+ hideLabel?: boolean | undefined;
60
+ truncation?: "ellipsis" | "multiline" | undefined;
61
+ requiredMarker?: "required" | "optional" | undefined;
62
+ modelValue?: boolean | undefined;
63
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
64
+ onValidityChange?: ((validity: ValidityState) => any) | undefined;
65
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
66
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
67
+ attrs: any;
68
+ slots: {};
69
+ emit: ((evt: "validityChange", validity: ValidityState) => void) & ((evt: "update:modelValue", value: boolean) => void);
70
+ } | undefined;
48
71
  };
72
+ export default _default;
49
73
  type __VLS_Prettify<T> = {
50
74
  [K in keyof T]: T[K];
51
75
  } & {};
@@ -1,41 +1,14 @@
1
- import { TruncationType } from '../../types/fonts';
1
+ import { SelectOption, SelectOptionValue } from '../../types';
2
2
  import { CustomValidityProp } from '../../composables/useCustomValidity';
3
3
  import { RequiredMarkerProp } from '../../composables/required';
4
- import { DensityProp } from '../../composables/density';
5
4
 
6
- export type OnyxCheckboxProps = DensityProp & RequiredMarkerProp & CustomValidityProp & {
5
+ export type OnyxCheckboxProps<TValue extends SelectOptionValue = SelectOptionValue> = SelectOption<TValue> & RequiredMarkerProp & CustomValidityProp & {
7
6
  /**
8
7
  * Whether the checkbox is checked.
9
8
  */
10
9
  modelValue?: boolean;
11
- /**
12
- * Label to show. Required due to accessibility / screen readers.
13
- * If you want to visually hide the label, use the `hideLabel` property.
14
- */
15
- label: string;
16
10
  /**
17
11
  * If `true`, an indeterminate indicator is shown.
18
12
  */
19
13
  indeterminate?: boolean;
20
- /**
21
- * Whether to disable the checkbox and prevent user interaction.
22
- */
23
- disabled?: boolean;
24
- /**
25
- * Shows a loading indicator.
26
- */
27
- loading?: boolean;
28
- /**
29
- * If `true`, the label will be visually hidden and the `title` attribute will be set.
30
- * For accessibility / screen readers, the aria-label will still be set.
31
- */
32
- hideLabel?: boolean;
33
- /**
34
- * How to truncate the label if it exceeds the max width.
35
- */
36
- truncation?: TruncationType;
37
- /**
38
- * Whether to show a skeleton checkbox.
39
- */
40
- skeleton?: boolean;
41
14
  };
@@ -1,4 +1,6 @@
1
- declare const _default: <TValue extends string | number | boolean>(__VLS_props: {
1
+ import { SelectOptionValue } from '../../types';
2
+
3
+ declare const _default: <TValue extends SelectOptionValue>(__VLS_props: {
2
4
  density?: "default" | "compact" | "cozy" | undefined;
3
5
  disabled?: boolean | undefined;
4
6
  skeleton?: number | undefined;
@@ -1,9 +1,8 @@
1
- import { SelectionOptionValue } from '../OnyxRadioButton/types';
2
- import { OnyxCheckboxProps } from '../OnyxCheckbox/types';
3
- import { Direction } from '../../types';
1
+ import { Direction, SelectOption, SelectOptionValue } from '../../types';
2
+ import { RequiredMarkerProp } from '../../composables/required';
4
3
  import { DensityProp } from '../../composables/density';
5
4
 
6
- export type OnyxCheckboxGroupProps<TValue extends SelectionOptionValue = SelectionOptionValue> = DensityProp & {
5
+ export type OnyxCheckboxGroupProps<TValue extends SelectOptionValue = SelectOptionValue> = DensityProp & {
7
6
  /**
8
7
  * Checkbox options.
9
8
  */
@@ -40,6 +39,4 @@ export type OnyxCheckboxGroupProps<TValue extends SelectionOptionValue = Selecti
40
39
  */
41
40
  skeleton?: number;
42
41
  };
43
- export type CheckboxGroupOption<T extends SelectionOptionValue> = Omit<OnyxCheckboxProps, "modelValue" | "indeterminate" | "hideLabel"> & {
44
- id: T;
45
- };
42
+ export type CheckboxGroupOption<TValue extends SelectOptionValue = SelectOptionValue> = SelectOption<TValue> & RequiredMarkerProp;
@@ -1,12 +1,12 @@
1
1
  import { ListboxOption } from './types';
2
- import { ListboxValue } from '@sit-onyx/headless';
2
+ import { SelectOptionValue } from '../../types';
3
3
 
4
- declare const _default: <TValue extends ListboxValue = ListboxValue, TMultiple extends boolean = false>(__VLS_props: {
4
+ declare const _default: <TValue extends SelectOptionValue = SelectOptionValue, TMultiple extends boolean = false>(__VLS_props: {
5
5
  label: string;
6
6
  loading?: boolean | undefined;
7
7
  multiple?: TMultiple | undefined;
8
- modelValue?: import('@sit-onyx/headless').ListboxModelValue<TValue, TMultiple> | undefined;
9
- "onUpdate:modelValue"?: ((value: import('@sit-onyx/headless').ListboxModelValue<TValue, TMultiple> | undefined) => any) | undefined;
8
+ modelValue?: import('./types').ListboxModelValue<TValue, TMultiple> | undefined;
9
+ "onUpdate:modelValue"?: ((value: import('./types').ListboxModelValue<TValue, TMultiple> | undefined) => any) | undefined;
10
10
  options: ListboxOption<TValue>[];
11
11
  withCheckAll?: (TMultiple extends true ? boolean | {
12
12
  label?: string | undefined;
@@ -47,14 +47,14 @@ declare const _default: <TValue extends ListboxValue = ListboxValue, TMultiple e
47
47
  */
48
48
  optionsEnd?(): unknown;
49
49
  };
50
- emit: ((evt: "update:modelValue", value: import('@sit-onyx/headless').ListboxModelValue<TValue, TMultiple> | undefined) => void) & ((evt: "lazyLoad") => void);
50
+ emit: ((evt: "update:modelValue", value: import('./types').ListboxModelValue<TValue, TMultiple> | undefined) => void) & ((evt: "lazyLoad") => void);
51
51
  } | undefined, __VLS_expose?: ((exposed: import('vue').ShallowUnwrapRef<{}>) => void) | undefined, __VLS_setup?: Promise<{
52
52
  props: {
53
53
  label: string;
54
54
  loading?: boolean | undefined;
55
55
  multiple?: TMultiple | undefined;
56
- modelValue?: import('@sit-onyx/headless').ListboxModelValue<TValue, TMultiple> | undefined;
57
- "onUpdate:modelValue"?: ((value: import('@sit-onyx/headless').ListboxModelValue<TValue, TMultiple> | undefined) => any) | undefined;
56
+ modelValue?: import('./types').ListboxModelValue<TValue, TMultiple> | undefined;
57
+ "onUpdate:modelValue"?: ((value: import('./types').ListboxModelValue<TValue, TMultiple> | undefined) => any) | undefined;
58
58
  options: ListboxOption<TValue>[];
59
59
  withCheckAll?: (TMultiple extends true ? boolean | {
60
60
  label?: string | undefined;
@@ -96,7 +96,7 @@ declare const _default: <TValue extends ListboxValue = ListboxValue, TMultiple e
96
96
  */
97
97
  optionsEnd?(): unknown;
98
98
  };
99
- emit: ((evt: "update:modelValue", value: import('@sit-onyx/headless').ListboxModelValue<TValue, TMultiple> | undefined) => void) & ((evt: "lazyLoad") => void);
99
+ emit: ((evt: "update:modelValue", value: import('./types').ListboxModelValue<TValue, TMultiple> | undefined) => void) & ((evt: "lazyLoad") => void);
100
100
  }>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
101
101
  [key: string]: any;
102
102
  }> & {
@@ -105,8 +105,8 @@ declare const _default: <TValue extends ListboxValue = ListboxValue, TMultiple e
105
105
  label: string;
106
106
  loading?: boolean | undefined;
107
107
  multiple?: TMultiple | undefined;
108
- modelValue?: import('@sit-onyx/headless').ListboxModelValue<TValue, TMultiple> | undefined;
109
- "onUpdate:modelValue"?: ((value: import('@sit-onyx/headless').ListboxModelValue<TValue, TMultiple> | undefined) => any) | undefined;
108
+ modelValue?: import('./types').ListboxModelValue<TValue, TMultiple> | undefined;
109
+ "onUpdate:modelValue"?: ((value: import('./types').ListboxModelValue<TValue, TMultiple> | undefined) => any) | undefined;
110
110
  options: ListboxOption<TValue>[];
111
111
  withCheckAll?: (TMultiple extends true ? boolean | {
112
112
  label?: string | undefined;
@@ -148,7 +148,7 @@ declare const _default: <TValue extends ListboxValue = ListboxValue, TMultiple e
148
148
  */
149
149
  optionsEnd?(): unknown;
150
150
  };
151
- emit: ((evt: "update:modelValue", value: import('@sit-onyx/headless').ListboxModelValue<TValue, TMultiple> | undefined) => void) & ((evt: "lazyLoad") => void);
151
+ emit: ((evt: "update:modelValue", value: import('./types').ListboxModelValue<TValue, TMultiple> | undefined) => void) & ((evt: "lazyLoad") => void);
152
152
  } | undefined;
153
153
  };
154
154
  export default _default;
@@ -1,6 +1,7 @@
1
- import { ListboxValue, ListboxModelValue } from '@sit-onyx/headless';
1
+ import { SelectOption, SelectOptionValue } from '../../types';
2
2
 
3
- export type OnyxListboxProps<TValue extends ListboxValue = ListboxValue, TMultiple extends boolean = false> = {
3
+ export type ListboxModelValue<TValue extends SelectOptionValue = SelectOptionValue, TMultiple extends boolean = false> = TMultiple extends true ? TValue[] : TValue;
4
+ export type OnyxListboxProps<TValue extends SelectOptionValue = SelectOptionValue, TMultiple extends boolean = false> = {
4
5
  /**
5
6
  * Aria label. Must be set for accessibility reasons.
6
7
  */
@@ -14,7 +15,7 @@ export type OnyxListboxProps<TValue extends ListboxValue = ListboxValue, TMultip
14
15
  */
15
16
  message?: string;
16
17
  /**
17
- * Current value / selected options.
18
+ * Current value / selected option(s).
18
19
  */
19
20
  modelValue?: ListboxModelValue<TValue, TMultiple>;
20
21
  /**
@@ -43,19 +44,7 @@ export type OnyxListboxProps<TValue extends ListboxValue = ListboxValue, TMultip
43
44
  */
44
45
  lazyLoading?: ListboxLazyLoading;
45
46
  };
46
- export type ListboxOption<T extends ListboxValue = ListboxValue> = {
47
- /**
48
- * Option ID / value to use when the option is selected.
49
- */
50
- id: T;
51
- /**
52
- * Label to show.
53
- */
54
- label: string;
55
- /**
56
- * Whether the option is disabled.
57
- */
58
- disabled?: boolean;
47
+ export type ListboxOption<TValue extends SelectOptionValue = SelectOptionValue> = Pick<SelectOption<TValue>, "value" | "label" | "disabled"> & {
59
48
  /**
60
49
  * Optional group name. If set, all options will be grouped under that group name.
61
50
  */
@@ -1,12 +1,11 @@
1
- import { SelectionOptionValue } from './types';
1
+ import { SelectOptionValue } from '../../types';
2
2
 
3
- declare const _default: <TValue extends SelectionOptionValue = SelectionOptionValue>(__VLS_props: {
3
+ declare const _default: <TValue extends SelectOptionValue = SelectOptionValue>(__VLS_props: {
4
4
  required?: boolean | undefined;
5
5
  label: string;
6
- onChange?: ((value: string) => any) | undefined;
6
+ onChange?: ((value: boolean) => any) | undefined;
7
7
  selected?: boolean | undefined;
8
- value?: unknown;
9
- id: TValue;
8
+ value: TValue;
10
9
  density?: "default" | "compact" | "cozy" | undefined;
11
10
  disabled?: boolean | undefined;
12
11
  loading?: boolean | undefined;
@@ -18,15 +17,14 @@ declare const _default: <TValue extends SelectionOptionValue = SelectionOptionVa
18
17
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, __VLS_ctx?: {
19
18
  attrs: any;
20
19
  slots: {};
21
- emit: ((evt: "validityChange", validity: ValidityState) => void) & ((evt: "change", value: string) => void);
20
+ emit: ((evt: "validityChange", validity: ValidityState) => void) & ((evt: "change", value: boolean) => void);
22
21
  } | undefined, __VLS_expose?: ((exposed: import('vue').ShallowUnwrapRef<{}>) => void) | undefined, __VLS_setup?: Promise<{
23
22
  props: {
24
23
  required?: boolean | undefined;
25
24
  label: string;
26
- onChange?: ((value: string) => any) | undefined;
25
+ onChange?: ((value: boolean) => any) | undefined;
27
26
  selected?: boolean | undefined;
28
- value?: unknown;
29
- id: TValue;
27
+ value: TValue;
30
28
  density?: "default" | "compact" | "cozy" | undefined;
31
29
  disabled?: boolean | undefined;
32
30
  loading?: boolean | undefined;
@@ -39,7 +37,7 @@ declare const _default: <TValue extends SelectionOptionValue = SelectionOptionVa
39
37
  expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
40
38
  attrs: any;
41
39
  slots: {};
42
- emit: ((evt: "validityChange", validity: ValidityState) => void) & ((evt: "change", value: string) => void);
40
+ emit: ((evt: "validityChange", validity: ValidityState) => void) & ((evt: "change", value: boolean) => void);
43
41
  }>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
44
42
  [key: string]: any;
45
43
  }> & {
@@ -47,10 +45,9 @@ declare const _default: <TValue extends SelectionOptionValue = SelectionOptionVa
47
45
  props: {
48
46
  required?: boolean | undefined;
49
47
  label: string;
50
- onChange?: ((value: string) => any) | undefined;
48
+ onChange?: ((value: boolean) => any) | undefined;
51
49
  selected?: boolean | undefined;
52
- value?: unknown;
53
- id: TValue;
50
+ value: TValue;
54
51
  density?: "default" | "compact" | "cozy" | undefined;
55
52
  disabled?: boolean | undefined;
56
53
  loading?: boolean | undefined;
@@ -63,7 +60,7 @@ declare const _default: <TValue extends SelectionOptionValue = SelectionOptionVa
63
60
  expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
64
61
  attrs: any;
65
62
  slots: {};
66
- emit: ((evt: "validityChange", validity: ValidityState) => void) & ((evt: "change", value: string) => void);
63
+ emit: ((evt: "validityChange", validity: ValidityState) => void) & ((evt: "change", value: boolean) => void);
67
64
  } | undefined;
68
65
  };
69
66
  export default _default;
@@ -1,37 +1,8 @@
1
- import { TruncationType } from '../../types/fonts';
1
+ import { SelectOption, SelectOptionValue } from '../../types';
2
2
  import { CustomValidityProp } from '../../composables/useCustomValidity';
3
3
  import { DensityProp } from '../../composables/density';
4
4
 
5
- export type SelectionOptionValue = string | number | boolean;
6
- /**
7
- * TODO: move to dedicated file
8
- */
9
- export type SelectionOption<T extends SelectionOptionValue = SelectionOptionValue, TValue = unknown> = {
10
- /**
11
- * id of the selection option, not of the radio button input
12
- */
13
- id: T;
14
- label: string;
15
- /**
16
- * An optional value.
17
- * It's not actually used by the selection controls, but can be used to associate data with this option.
18
- */
19
- value?: TValue;
20
- disabled?: boolean;
21
- /**
22
- * Shows a loading indicator.
23
- */
24
- loading?: boolean;
25
- /**
26
- * How to truncate the label if it exceeds the max width.
27
- */
28
- truncation?: TruncationType;
29
- /**
30
- * Whether to show a skeleton radio button.
31
- */
32
- skeleton?: boolean;
33
- };
34
- export type OnyxRadioButtonProps<TValue extends SelectionOptionValue = SelectionOptionValue> = SelectionOption<TValue> & DensityProp & CustomValidityProp & {
5
+ export type OnyxRadioButtonProps<TValue extends SelectOptionValue = SelectOptionValue> = Omit<SelectOption<TValue>, "hideLabel"> & DensityProp & CustomValidityProp & {
35
6
  /**
36
7
  * Identifier for the radio buttons in the group.
37
8
  * All radio buttons that should belong to the same radio group must have the same name.
@@ -1,6 +1,6 @@
1
- import { SelectionOption, SelectionOptionValue } from '../OnyxRadioButton/types';
1
+ import { SelectOptionValue } from '../../types';
2
2
 
3
- declare const _default: <TValue extends SelectionOptionValue>(__VLS_props: {
3
+ declare const _default: <TValue extends SelectOptionValue>(__VLS_props: {
4
4
  required?: boolean | undefined;
5
5
  density?: "default" | "compact" | "cozy" | undefined;
6
6
  disabled?: boolean | undefined;
@@ -8,16 +8,16 @@ declare const _default: <TValue extends SelectionOptionValue>(__VLS_props: {
8
8
  customError?: string | undefined;
9
9
  name?: string | undefined;
10
10
  requiredMarker?: "required" | "optional" | undefined;
11
- modelValue?: SelectionOption<TValue> | undefined;
12
- "onUpdate:modelValue"?: ((selected: SelectionOption<TValue>) => any) | undefined;
13
- options: SelectionOption<TValue>[];
11
+ modelValue?: TValue | undefined;
12
+ "onUpdate:modelValue"?: ((selected: TValue) => any) | undefined;
13
+ options: import('./types').RadioButtonOption<TValue>[];
14
14
  headline?: string | undefined;
15
15
  direction?: "horizontal" | "vertical" | undefined;
16
16
  onValidityChange?: ((validity: ValidityState) => any) | undefined;
17
17
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, __VLS_ctx?: {
18
18
  attrs: any;
19
19
  slots: {};
20
- emit: ((evt: "validityChange", validity: ValidityState) => void) & ((evt: "update:modelValue", selected: SelectionOption<TValue>) => void);
20
+ emit: ((evt: "validityChange", validity: ValidityState) => void) & ((evt: "update:modelValue", selected: TValue) => void);
21
21
  } | undefined, __VLS_expose?: ((exposed: import('vue').ShallowUnwrapRef<{}>) => void) | undefined, __VLS_setup?: Promise<{
22
22
  props: {
23
23
  required?: boolean | undefined;
@@ -27,9 +27,9 @@ declare const _default: <TValue extends SelectionOptionValue>(__VLS_props: {
27
27
  customError?: string | undefined;
28
28
  name?: string | undefined;
29
29
  requiredMarker?: "required" | "optional" | undefined;
30
- modelValue?: SelectionOption<TValue> | undefined;
31
- "onUpdate:modelValue"?: ((selected: SelectionOption<TValue>) => any) | undefined;
32
- options: SelectionOption<TValue>[];
30
+ modelValue?: TValue | undefined;
31
+ "onUpdate:modelValue"?: ((selected: TValue) => any) | undefined;
32
+ options: import('./types').RadioButtonOption<TValue>[];
33
33
  headline?: string | undefined;
34
34
  direction?: "horizontal" | "vertical" | undefined;
35
35
  onValidityChange?: ((validity: ValidityState) => any) | undefined;
@@ -37,7 +37,7 @@ declare const _default: <TValue extends SelectionOptionValue>(__VLS_props: {
37
37
  expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
38
38
  attrs: any;
39
39
  slots: {};
40
- emit: ((evt: "validityChange", validity: ValidityState) => void) & ((evt: "update:modelValue", selected: SelectionOption<TValue>) => void);
40
+ emit: ((evt: "validityChange", validity: ValidityState) => void) & ((evt: "update:modelValue", selected: TValue) => void);
41
41
  }>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
42
42
  [key: string]: any;
43
43
  }> & {
@@ -50,9 +50,9 @@ declare const _default: <TValue extends SelectionOptionValue>(__VLS_props: {
50
50
  customError?: string | undefined;
51
51
  name?: string | undefined;
52
52
  requiredMarker?: "required" | "optional" | undefined;
53
- modelValue?: SelectionOption<TValue> | undefined;
54
- "onUpdate:modelValue"?: ((selected: SelectionOption<TValue>) => any) | undefined;
55
- options: SelectionOption<TValue>[];
53
+ modelValue?: TValue | undefined;
54
+ "onUpdate:modelValue"?: ((selected: TValue) => any) | undefined;
55
+ options: import('./types').RadioButtonOption<TValue>[];
56
56
  headline?: string | undefined;
57
57
  direction?: "horizontal" | "vertical" | undefined;
58
58
  onValidityChange?: ((validity: ValidityState) => any) | undefined;
@@ -60,7 +60,7 @@ declare const _default: <TValue extends SelectionOptionValue>(__VLS_props: {
60
60
  expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
61
61
  attrs: any;
62
62
  slots: {};
63
- emit: ((evt: "validityChange", validity: ValidityState) => void) & ((evt: "update:modelValue", selected: SelectionOption<TValue>) => void);
63
+ emit: ((evt: "validityChange", validity: ValidityState) => void) & ((evt: "update:modelValue", selected: TValue) => void);
64
64
  } | undefined;
65
65
  };
66
66
  export default _default;
@@ -1,10 +1,13 @@
1
- import { SelectionOption, SelectionOptionValue } from '../OnyxRadioButton/types';
2
- import { Direction } from '../../types';
1
+ import { Direction, SelectOption, SelectOptionValue } from '../../types';
3
2
  import { CustomValidityProp } from '../../composables/useCustomValidity';
4
3
  import { RequiredMarkerProp } from '../../composables/required';
5
4
  import { DensityProp } from '../../composables/density';
6
5
 
7
- export type OnyxRadioButtonGroupProps<TValue extends SelectionOptionValue = SelectionOptionValue> = DensityProp & RequiredMarkerProp & CustomValidityProp & {
6
+ export type OnyxRadioButtonGroupProps<TValue extends SelectOptionValue = SelectOptionValue> = DensityProp & RequiredMarkerProp & CustomValidityProp & {
7
+ /**
8
+ * Options for the individual radio buttons of the group.
9
+ */
10
+ options: RadioButtonOption<TValue>[];
8
11
  /**
9
12
  * Unique name for the radio button group form element.
10
13
  * Will automatically filled, when it is not given.
@@ -14,7 +17,7 @@ export type OnyxRadioButtonGroupProps<TValue extends SelectionOptionValue = Sele
14
17
  /**
15
18
  * The selected radio button option.
16
19
  */
17
- modelValue?: SelectionOption<TValue>;
20
+ modelValue?: TValue;
18
21
  /**
19
22
  * Headline shown above the radio button group, which is also the fieldset legend.
20
23
  * It will also show the required indicator, if `require` is set to `true`
@@ -28,12 +31,9 @@ export type OnyxRadioButtonGroupProps<TValue extends SelectionOptionValue = Sele
28
31
  * Direction of the checkboxes. Can be vertical (default) or horizontal.
29
32
  */
30
33
  direction?: Direction;
31
- /**
32
- * Options for the individual radio buttons of the group.
33
- */
34
- options: SelectionOption<TValue>[];
35
34
  /**
36
35
  * If set, the specified number of skeleton radio buttons will be shown.
37
36
  */
38
37
  skeleton?: number;
39
38
  };
39
+ export type RadioButtonOption<TValue extends SelectOptionValue = SelectOptionValue> = Omit<SelectOption<TValue>, "hideLabel">;
@@ -1,6 +1,7 @@
1
- import { Multiple, SelectModelValue } from './types';
1
+ import { SelectMultiple } from './types';
2
+ import { SelectOptionValue } from '../..';
2
3
 
3
- declare const _default: <TValue extends SelectModelValue<TMultiple>, TMultiple extends Multiple>(__VLS_props: {
4
+ declare const _default: <TValue extends SelectOptionValue, TMultiple extends SelectMultiple>(__VLS_props: {
4
5
  required?: boolean | undefined;
5
6
  label: string;
6
7
  density?: "default" | "compact" | "cozy" | undefined;
@@ -9,16 +10,17 @@ declare const _default: <TValue extends SelectModelValue<TMultiple>, TMultiple e
9
10
  skeleton?: boolean | undefined;
10
11
  multiple?: TMultiple | undefined;
11
12
  placeholder?: string | undefined;
12
- requiredMarker?: "required" | "optional" | undefined;
13
- modelValue?: TValue | undefined;
14
13
  hideLabel?: boolean | undefined;
15
- "onUpdate:modelValue"?: ((value: TValue | undefined) => any) | undefined;
14
+ requiredMarker?: "required" | "optional" | undefined;
15
+ modelValue?: (TMultiple extends false | undefined ? import('./types').SelectModelValue<TValue> : import('./types').SelectModelValue<TValue>[]) | undefined;
16
+ "onUpdate:modelValue"?: ((value: (TMultiple extends false | undefined ? import('./types').SelectModelValue<TValue> : import('./types').SelectModelValue<TValue>[]) | undefined) => any) | undefined;
17
+ options: import('../..').SelectOption<TValue>[];
16
18
  readonly?: boolean | undefined;
17
19
  message?: string | undefined;
18
20
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, __VLS_ctx?: {
19
21
  attrs: any;
20
22
  slots: {};
21
- emit: (evt: "update:modelValue", value: TValue | undefined) => void;
23
+ emit: (evt: "update:modelValue", value: (TMultiple extends false | undefined ? import('./types').SelectModelValue<TValue> : import('./types').SelectModelValue<TValue>[]) | undefined) => void;
22
24
  } | undefined, __VLS_expose?: ((exposed: import('vue').ShallowUnwrapRef<{}>) => void) | undefined, __VLS_setup?: Promise<{
23
25
  props: {
24
26
  required?: boolean | undefined;
@@ -29,17 +31,18 @@ declare const _default: <TValue extends SelectModelValue<TMultiple>, TMultiple e
29
31
  skeleton?: boolean | undefined;
30
32
  multiple?: TMultiple | undefined;
31
33
  placeholder?: string | undefined;
32
- requiredMarker?: "required" | "optional" | undefined;
33
- modelValue?: TValue | undefined;
34
34
  hideLabel?: boolean | undefined;
35
- "onUpdate:modelValue"?: ((value: TValue | undefined) => any) | undefined;
35
+ requiredMarker?: "required" | "optional" | undefined;
36
+ modelValue?: (TMultiple extends false | undefined ? import('./types').SelectModelValue<TValue> : import('./types').SelectModelValue<TValue>[]) | undefined;
37
+ "onUpdate:modelValue"?: ((value: (TMultiple extends false | undefined ? import('./types').SelectModelValue<TValue> : import('./types').SelectModelValue<TValue>[]) | undefined) => any) | undefined;
38
+ options: import('../..').SelectOption<TValue>[];
36
39
  readonly?: boolean | undefined;
37
40
  message?: string | undefined;
38
41
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
39
42
  expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
40
43
  attrs: any;
41
44
  slots: {};
42
- emit: (evt: "update:modelValue", value: TValue | undefined) => void;
45
+ emit: (evt: "update:modelValue", value: (TMultiple extends false | undefined ? import('./types').SelectModelValue<TValue> : import('./types').SelectModelValue<TValue>[]) | undefined) => void;
43
46
  }>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
44
47
  [key: string]: any;
45
48
  }> & {
@@ -53,17 +56,18 @@ declare const _default: <TValue extends SelectModelValue<TMultiple>, TMultiple e
53
56
  skeleton?: boolean | undefined;
54
57
  multiple?: TMultiple | undefined;
55
58
  placeholder?: string | undefined;
56
- requiredMarker?: "required" | "optional" | undefined;
57
- modelValue?: TValue | undefined;
58
59
  hideLabel?: boolean | undefined;
59
- "onUpdate:modelValue"?: ((value: TValue | undefined) => any) | undefined;
60
+ requiredMarker?: "required" | "optional" | undefined;
61
+ modelValue?: (TMultiple extends false | undefined ? import('./types').SelectModelValue<TValue> : import('./types').SelectModelValue<TValue>[]) | undefined;
62
+ "onUpdate:modelValue"?: ((value: (TMultiple extends false | undefined ? import('./types').SelectModelValue<TValue> : import('./types').SelectModelValue<TValue>[]) | undefined) => any) | undefined;
63
+ options: import('../..').SelectOption<TValue>[];
60
64
  readonly?: boolean | undefined;
61
65
  message?: string | undefined;
62
66
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
63
67
  expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
64
68
  attrs: any;
65
69
  slots: {};
66
- emit: (evt: "update:modelValue", value: TValue | undefined) => void;
70
+ emit: (evt: "update:modelValue", value: (TMultiple extends false | undefined ? import('./types').SelectModelValue<TValue> : import('./types').SelectModelValue<TValue>[]) | undefined) => void;
67
71
  } | undefined;
68
72
  };
69
73
  export default _default;