@volverjs/ui-vue 0.0.6-beta.4 → 0.0.6-beta.6
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/dist/Volver.d.ts +1 -1
- package/dist/components/VvAccordion/VvAccordion.es.js +18 -1
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +2 -2
- package/dist/components/VvAccordion/index.d.ts +3 -3
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +22 -2
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +6 -58
- package/dist/components/VvAccordionGroup/index.d.ts +3 -29
- package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +2 -28
- package/dist/components/VvAvatarGroup/index.d.ts +1 -14
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +2 -28
- package/dist/components/VvBreadcrumb/index.d.ts +1 -14
- package/dist/components/VvButton/VvButton.es.js +51 -20
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +27 -2
- package/dist/components/VvButton/index.d.ts +25 -2
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +10 -4
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +7 -59
- package/dist/components/VvButtonGroup/index.d.ts +3 -29
- package/dist/components/VvCard/VvCard.vue.d.ts +2 -2
- package/dist/components/VvCard/index.d.ts +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +1 -1
- package/dist/components/VvCheckbox/index.d.ts +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +1 -1
- package/dist/components/VvDialog/VvDialog.es.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +3 -3
- package/dist/components/VvDropdown/index.d.ts +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +1 -1
- package/dist/components/VvIcon/index.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +1 -1
- package/dist/components/VvNav/VvNav.vue.d.ts +2 -28
- package/dist/components/VvNav/index.d.ts +1 -14
- package/dist/components/VvRadio/VvRadio.vue.d.ts +1 -1
- package/dist/components/VvRadio/index.d.ts +1 -1
- package/dist/components/VvSelect/VvSelect.es.js +1 -1
- package/dist/components/VvTab/VvTab.vue.d.ts +2 -28
- package/dist/components/VvTab/index.d.ts +1 -14
- package/dist/components/VvTextarea/VvTextarea.es.js +1 -1
- package/dist/components/index.es.js +83 -26
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/group/useInjectedGroupState.d.ts +1 -1
- package/dist/directives/index.d.ts +2 -2
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/stories/Button/Button.settings.d.ts +25 -0
- package/package.json +29 -29
- package/src/assets/icons/detailed.json +1 -1
- package/src/assets/icons/normal.json +1 -1
- package/src/assets/icons/simple.json +1 -1
- package/src/components/VvAccordion/index.ts +21 -4
- package/src/components/VvAccordionGroup/index.ts +6 -3
- package/src/components/VvAvatarGroup/index.ts +2 -2
- package/src/components/VvBreadcrumb/index.ts +1 -1
- package/src/components/VvButton/VvButton.vue +9 -6
- package/src/components/VvButton/index.ts +44 -21
- package/src/components/VvButtonGroup/VvButtonGroup.vue +2 -2
- package/src/components/VvButtonGroup/index.ts +14 -2
- package/src/components/VvCard/index.ts +1 -1
- package/src/components/VvCombobox/index.ts +2 -2
- package/src/components/VvIcon/index.ts +1 -1
- package/src/components/VvNav/index.ts +1 -1
- package/src/components/VvTab/index.ts +1 -1
- package/src/components/common/HintSlot.ts +3 -3
- package/src/props/index.ts +2 -2
- package/src/stories/Button/Button.settings.ts +21 -0
- package/src/stories/Button/Button.stories.mdx +3 -3
- package/src/stories/Button/ButtonToggle.stories.mdx +62 -0
- package/src/types/group.d.ts +5 -3
|
@@ -25,7 +25,7 @@ export const VvAccordionProps = {
|
|
|
25
25
|
/**
|
|
26
26
|
* String or String[] of css classes (modifiers) that will be concatenated to prefix 'vv-accordion--'
|
|
27
27
|
*/
|
|
28
|
-
modifiers: [String, Array]
|
|
28
|
+
modifiers: [String, Array] as PropType<string | string[]>,
|
|
29
29
|
/**
|
|
30
30
|
* If true, the accordion will be disabled
|
|
31
31
|
*/
|
|
@@ -58,12 +58,29 @@ export function useGroupProps(
|
|
|
58
58
|
const modelValue = getGroupOrLocalRef('modelValue', props, emit)
|
|
59
59
|
const not = getGroupOrLocalRef('not', props) as Ref<boolean>
|
|
60
60
|
const collapse = getGroupOrLocalRef('collapse', props) as Ref<boolean>
|
|
61
|
-
const modifiers = getGroupOrLocalRef('modifiers', props) as Ref<
|
|
62
|
-
Array<string> | string
|
|
63
|
-
>
|
|
64
61
|
const disabled = computed(() =>
|
|
65
62
|
Boolean(props.disabled || group?.value?.disabled.value),
|
|
66
63
|
)
|
|
64
|
+
// merge local and group modifiers
|
|
65
|
+
const modifiers = computed(() => {
|
|
66
|
+
let localModifiers = props.modifiers
|
|
67
|
+
let groupModifiers = group?.value.modifiers.value
|
|
68
|
+
|
|
69
|
+
const toReturn = new Set<string>()
|
|
70
|
+
if (localModifiers) {
|
|
71
|
+
if (!Array.isArray(localModifiers)) {
|
|
72
|
+
localModifiers = localModifiers.split(' ')
|
|
73
|
+
}
|
|
74
|
+
localModifiers.forEach((modifier) => toReturn.add(modifier))
|
|
75
|
+
}
|
|
76
|
+
if (groupModifiers) {
|
|
77
|
+
if (!Array.isArray(groupModifiers)) {
|
|
78
|
+
groupModifiers = groupModifiers.split(' ')
|
|
79
|
+
}
|
|
80
|
+
groupModifiers.forEach((modifier) => toReturn.add(modifier))
|
|
81
|
+
}
|
|
82
|
+
return Array.from(toReturn)
|
|
83
|
+
})
|
|
67
84
|
|
|
68
85
|
return {
|
|
69
86
|
// group props
|
|
@@ -15,7 +15,10 @@ export const VvAccordionGroupProps = {
|
|
|
15
15
|
* Accordion items
|
|
16
16
|
* @type VvAccordionGroupItem
|
|
17
17
|
*/
|
|
18
|
-
items: {
|
|
18
|
+
items: {
|
|
19
|
+
type: Array as PropType<VvAccordionGroupItem[]>,
|
|
20
|
+
default: () => [],
|
|
21
|
+
},
|
|
19
22
|
/**
|
|
20
23
|
* If true, accordion items stay open when another item is opened
|
|
21
24
|
*/
|
|
@@ -23,12 +26,12 @@ export const VvAccordionGroupProps = {
|
|
|
23
26
|
/**
|
|
24
27
|
* String or String[] of css classes (modifiers) that will be concatenated to prefix 'vv-accordion-group--'
|
|
25
28
|
*/
|
|
26
|
-
modifiers: [String, Array]
|
|
29
|
+
modifiers: [String, Array] as PropType<string | string[]>,
|
|
27
30
|
/**
|
|
28
31
|
* String or String[] of css classes (modifiers) that will be concatenated to prefix 'vv-accordion--'
|
|
29
32
|
*/
|
|
30
33
|
itemModifiers: {
|
|
31
|
-
type: [String, Array<string
|
|
34
|
+
type: [String, Array] as PropType<string | string[]>,
|
|
32
35
|
default: '',
|
|
33
36
|
},
|
|
34
37
|
/**
|
|
@@ -13,7 +13,7 @@ export const VvAvatarGroupProps = {
|
|
|
13
13
|
* avatar items
|
|
14
14
|
*/
|
|
15
15
|
items: {
|
|
16
|
-
type: Array<AvatarItem>,
|
|
16
|
+
type: Array as PropType<AvatarItem[]>,
|
|
17
17
|
default: () => [],
|
|
18
18
|
required: true,
|
|
19
19
|
},
|
|
@@ -24,5 +24,5 @@ export const VvAvatarGroupProps = {
|
|
|
24
24
|
totalItems: {
|
|
25
25
|
type: Number,
|
|
26
26
|
},
|
|
27
|
-
avatarModifiers: [String, Array] as PropType<string |
|
|
27
|
+
avatarModifiers: [String, Array] as PropType<string | string[]>,
|
|
28
28
|
}
|
|
@@ -81,25 +81,28 @@
|
|
|
81
81
|
/**
|
|
82
82
|
* @description Catch click event
|
|
83
83
|
*/
|
|
84
|
+
const toggleValue = computed(() => {
|
|
85
|
+
return props.value !== undefined ? props.value : name.value
|
|
86
|
+
})
|
|
84
87
|
const onClick = () => {
|
|
85
88
|
if (toggle.value) {
|
|
86
89
|
if (Array.isArray(modelValue.value)) {
|
|
87
|
-
if (contains(
|
|
90
|
+
if (contains(toggleValue.value, modelValue.value)) {
|
|
88
91
|
if (unselectable.value) {
|
|
89
92
|
modelValue.value = modelValue.value.filter(
|
|
90
|
-
(n) => n !==
|
|
93
|
+
(n) => n !== toggleValue.value,
|
|
91
94
|
)
|
|
92
95
|
}
|
|
93
96
|
return
|
|
94
97
|
}
|
|
95
|
-
modelValue.value.push(
|
|
98
|
+
modelValue.value.push(toggleValue.value)
|
|
96
99
|
return
|
|
97
100
|
}
|
|
98
|
-
if (
|
|
99
|
-
modelValue.value =
|
|
101
|
+
if (toggleValue.value === modelValue.value && unselectable.value) {
|
|
102
|
+
modelValue.value = props.uncheckedValue
|
|
100
103
|
return
|
|
101
104
|
}
|
|
102
|
-
modelValue.value =
|
|
105
|
+
modelValue.value = toggleValue.value
|
|
103
106
|
}
|
|
104
107
|
}
|
|
105
108
|
</script>
|
|
@@ -33,11 +33,34 @@ export const VvButtonProps = {
|
|
|
33
33
|
* Loading icon
|
|
34
34
|
*/
|
|
35
35
|
loadingIcon: { type: String, default: 'eos-icons:bubble-loading' },
|
|
36
|
+
/**
|
|
37
|
+
* Enable button toggle
|
|
38
|
+
*/
|
|
36
39
|
toggle: {
|
|
37
40
|
type: Boolean,
|
|
38
41
|
default: false,
|
|
39
42
|
},
|
|
40
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Button toggle value
|
|
45
|
+
*/
|
|
46
|
+
value: {
|
|
47
|
+
type: [String, Number, Boolean],
|
|
48
|
+
default: undefined,
|
|
49
|
+
},
|
|
50
|
+
/**
|
|
51
|
+
* Value associated with the unchecked state
|
|
52
|
+
*/
|
|
53
|
+
uncheckedValue: {
|
|
54
|
+
type: [String, Number, Boolean],
|
|
55
|
+
default: undefined,
|
|
56
|
+
},
|
|
57
|
+
/**
|
|
58
|
+
* Button toggle model value
|
|
59
|
+
*/
|
|
60
|
+
modelValue: {
|
|
61
|
+
type: [String, Number, Boolean],
|
|
62
|
+
default: undefined,
|
|
63
|
+
},
|
|
41
64
|
}
|
|
42
65
|
|
|
43
66
|
export type VvButtonPropsTypes = ExtractPropTypes<typeof VvButtonProps>
|
|
@@ -53,18 +76,11 @@ export function useGroupProps(
|
|
|
53
76
|
useInjectedGroupState<ButtonGroupState>(INJECTION_KEY_BUTTON_GROUP)
|
|
54
77
|
|
|
55
78
|
// local props
|
|
56
|
-
const {
|
|
57
|
-
id,
|
|
58
|
-
iconPosition,
|
|
59
|
-
icon,
|
|
60
|
-
label,
|
|
61
|
-
pressed,
|
|
62
|
-
modifiers: localModifiers,
|
|
63
|
-
} = toRefs(props)
|
|
79
|
+
const { id, iconPosition, icon, label, pressed } = toRefs(props)
|
|
64
80
|
|
|
65
81
|
// group props
|
|
66
82
|
const modelValue = getGroupOrLocalRef('modelValue', props, emit) as Ref<
|
|
67
|
-
string |
|
|
83
|
+
string | number | boolean | (string | number | boolean)[] | undefined
|
|
68
84
|
>
|
|
69
85
|
const toggle = getGroupOrLocalRef('toggle', props) as Ref<boolean>
|
|
70
86
|
const unselectable = getGroupOrLocalRef(
|
|
@@ -72,18 +88,25 @@ export function useGroupProps(
|
|
|
72
88
|
props,
|
|
73
89
|
) as Ref<boolean>
|
|
74
90
|
const multiple = computed(() => group?.value.multiple.value ?? false)
|
|
91
|
+
// merge local and group modifiers
|
|
75
92
|
const modifiers = computed(() => {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
93
|
+
let localModifiers = props.modifiers
|
|
94
|
+
let groupModifiers = group?.value.modifiers.value
|
|
95
|
+
|
|
96
|
+
const toReturn = new Set<string>()
|
|
97
|
+
if (localModifiers) {
|
|
98
|
+
if (!Array.isArray(localModifiers)) {
|
|
99
|
+
localModifiers = localModifiers.split(' ')
|
|
100
|
+
}
|
|
101
|
+
localModifiers.forEach((modifier) => toReturn.add(modifier))
|
|
102
|
+
}
|
|
103
|
+
if (groupModifiers) {
|
|
104
|
+
if (!Array.isArray(groupModifiers)) {
|
|
105
|
+
groupModifiers = groupModifiers.split(' ')
|
|
106
|
+
}
|
|
107
|
+
groupModifiers.forEach((modifier) => toReturn.add(modifier))
|
|
108
|
+
}
|
|
109
|
+
return Array.from(toReturn)
|
|
87
110
|
})
|
|
88
111
|
const disabled = computed(() =>
|
|
89
112
|
Boolean(props.disabled || group?.value?.disabled.value),
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
(Array.isArray(props.modelValue) || multiple.value) &&
|
|
46
46
|
!Array.isArray(newValue)
|
|
47
47
|
) {
|
|
48
|
-
|
|
48
|
+
return emit('update:modelValue', [newValue])
|
|
49
49
|
}
|
|
50
50
|
return emit('update:modelValue', newValue)
|
|
51
51
|
},
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
toggle,
|
|
60
60
|
multiple,
|
|
61
61
|
unselectable,
|
|
62
|
-
itemModifiers,
|
|
62
|
+
modifiers: itemModifiers,
|
|
63
63
|
})
|
|
64
64
|
|
|
65
65
|
// style
|
|
@@ -7,10 +7,22 @@ export const VvButtonGroupProps = {
|
|
|
7
7
|
/**
|
|
8
8
|
* String or String[] of css classes (modifiers) that will be provided to each button'
|
|
9
9
|
*/
|
|
10
|
-
itemModifiers: {
|
|
10
|
+
itemModifiers: {
|
|
11
|
+
type: [String, Array] as PropType<string | string[]>,
|
|
12
|
+
default: '',
|
|
13
|
+
},
|
|
11
14
|
toggle: { type: Boolean, default: false },
|
|
12
15
|
multiple: { type: Boolean, default: false },
|
|
13
|
-
modelValue: {
|
|
16
|
+
modelValue: {
|
|
17
|
+
type: [String, Number, Boolean, Array] as PropType<
|
|
18
|
+
| string
|
|
19
|
+
| number
|
|
20
|
+
| boolean
|
|
21
|
+
| (string | number | boolean)[]
|
|
22
|
+
| undefined
|
|
23
|
+
>,
|
|
24
|
+
default: undefined,
|
|
25
|
+
},
|
|
14
26
|
}
|
|
15
27
|
|
|
16
28
|
export const VvButtonGroupEvents = ['update:modelValue']
|
|
@@ -117,7 +117,7 @@ export const VvComboboxProps = {
|
|
|
117
117
|
* Badge modifiers
|
|
118
118
|
*/
|
|
119
119
|
badgeModifiers: {
|
|
120
|
-
type: [String, Array] as PropType<string |
|
|
120
|
+
type: [String, Array] as PropType<string | string[]>,
|
|
121
121
|
default: 'action sm',
|
|
122
122
|
},
|
|
123
123
|
/**
|
|
@@ -131,7 +131,7 @@ export const VvComboboxProps = {
|
|
|
131
131
|
* Dropdown modifiers
|
|
132
132
|
*/
|
|
133
133
|
dropdownModifiers: {
|
|
134
|
-
type: [String, Array] as PropType<string |
|
|
134
|
+
type: [String, Array] as PropType<string | string[]>,
|
|
135
135
|
},
|
|
136
136
|
/**
|
|
137
137
|
* Open dropdown on focus
|
|
@@ -95,7 +95,7 @@ export const VvIconProps = {
|
|
|
95
95
|
svg: String,
|
|
96
96
|
/**
|
|
97
97
|
* Icon modifiers: vv-icon css helper classes, value/s are concatened with prefix 'vv-icon--'
|
|
98
|
-
* @values string |
|
|
98
|
+
* @values string | string[]
|
|
99
99
|
*/
|
|
100
100
|
modifiers: {
|
|
101
101
|
type: [String, Array] as PropType<string | string[]>,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Component, ExtractPropTypes, Slots, Ref } from 'vue'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Merge errors from
|
|
5
|
-
* @param {
|
|
4
|
+
* Merge errors from string[] to string errors separated from new line (\n)
|
|
5
|
+
* @param {string[] | string} errors
|
|
6
6
|
* @returns {string}
|
|
7
7
|
*/
|
|
8
|
-
function joinLines(errors:
|
|
8
|
+
function joinLines(errors: string[] | string | unknown[] | undefined) {
|
|
9
9
|
if (Array.isArray(errors)) {
|
|
10
10
|
return errors.filter((e) => isString(e)).join(' ')
|
|
11
11
|
}
|
package/src/props/index.ts
CHANGED
|
@@ -126,7 +126,7 @@ export const ModifiersProps = {
|
|
|
126
126
|
/**
|
|
127
127
|
* Component BEM modifiers
|
|
128
128
|
*/
|
|
129
|
-
modifiers: [String, Array] as PropType<string |
|
|
129
|
+
modifiers: [String, Array] as PropType<string | string[]>,
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
export const HintProps = {
|
|
@@ -138,7 +138,7 @@ export const OptionsProps = {
|
|
|
138
138
|
* List of options, can be string[] or object[]
|
|
139
139
|
*/
|
|
140
140
|
options: {
|
|
141
|
-
type: Array as PropType<
|
|
141
|
+
type: Array as PropType<(Option | string)[]>,
|
|
142
142
|
default: () => [],
|
|
143
143
|
},
|
|
144
144
|
/**
|
|
@@ -69,6 +69,24 @@ export const argTypes = {
|
|
|
69
69
|
defaultValue: { summary: false },
|
|
70
70
|
},
|
|
71
71
|
},
|
|
72
|
+
value: {
|
|
73
|
+
description: 'The button value',
|
|
74
|
+
type: {
|
|
75
|
+
summary: ['string', 'boolean', 'number'],
|
|
76
|
+
},
|
|
77
|
+
table: {
|
|
78
|
+
defaultValue: { summary: 'undefined' },
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
uncheckedValue: {
|
|
82
|
+
description: 'The button unchecked value',
|
|
83
|
+
type: {
|
|
84
|
+
summary: ['string', 'boolean', 'number'],
|
|
85
|
+
},
|
|
86
|
+
table: {
|
|
87
|
+
defaultValue: { summary: 'undefined' },
|
|
88
|
+
},
|
|
89
|
+
},
|
|
72
90
|
...UnselectableArgTypes,
|
|
73
91
|
...LoadingArgTypes,
|
|
74
92
|
...DisabledArgTypes,
|
|
@@ -89,6 +107,9 @@ export const argTypes = {
|
|
|
89
107
|
rel: {
|
|
90
108
|
description: 'The rel attribute of the button',
|
|
91
109
|
control: { type: 'text' },
|
|
110
|
+
type: {
|
|
111
|
+
summary: 'boolean',
|
|
112
|
+
},
|
|
92
113
|
table: {
|
|
93
114
|
defaultValue: { summary: 'noopener noreferrer' },
|
|
94
115
|
},
|
|
@@ -13,19 +13,19 @@ import { argTypes, defaultArgs } from './Button.settings'
|
|
|
13
13
|
export const Template = (args, { argTypes }) => ({
|
|
14
14
|
props: Object.keys(argTypes),
|
|
15
15
|
data() {
|
|
16
|
-
return {
|
|
16
|
+
return { currentValue: undefined }
|
|
17
17
|
},
|
|
18
18
|
setup() {
|
|
19
19
|
return { args }
|
|
20
20
|
},
|
|
21
21
|
components: { VvButton },
|
|
22
22
|
template: /*html*/ `
|
|
23
|
-
<vv-button v-bind="args" v-model="
|
|
23
|
+
<vv-button v-bind="args" v-model="currentValue" name="my-button" data-testId="element">
|
|
24
24
|
<template #before v-if="args.before"><div v-html="args.before"></div></template>
|
|
25
25
|
<template #default v-if="args.default"><div v-html="args.default"></div></template>
|
|
26
26
|
<template #after v-if="args.after"><div v-html="args.after"></div></template>
|
|
27
27
|
</vv-button>
|
|
28
|
-
<div v-if="args.toggle" class="mt-md">Value: {{
|
|
28
|
+
<div v-if="args.toggle" class="mt-md">Value: {{ currentValue }}</div>`,
|
|
29
29
|
})
|
|
30
30
|
|
|
31
31
|
<Canvas>
|
|
@@ -24,6 +24,68 @@ import { argTypes, defaultArgs } from './Button.settings'
|
|
|
24
24
|
</Story>
|
|
25
25
|
</Canvas>
|
|
26
26
|
|
|
27
|
+
<Canvas>
|
|
28
|
+
<Story
|
|
29
|
+
name="True / False"
|
|
30
|
+
args={{
|
|
31
|
+
toggle: true,
|
|
32
|
+
value: true,
|
|
33
|
+
uncheckedValue: false,
|
|
34
|
+
}}
|
|
35
|
+
argTypes={{
|
|
36
|
+
toggle: {
|
|
37
|
+
control: {
|
|
38
|
+
disable: true,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
value: {
|
|
42
|
+
control: {
|
|
43
|
+
disable: true,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
uncheckedValue: {
|
|
47
|
+
control: {
|
|
48
|
+
disable: true,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
}}
|
|
52
|
+
play={defaultTest}
|
|
53
|
+
>
|
|
54
|
+
{Template.bind()}
|
|
55
|
+
</Story>
|
|
56
|
+
</Canvas>
|
|
57
|
+
|
|
58
|
+
<Canvas>
|
|
59
|
+
<Story
|
|
60
|
+
name="Yes / No"
|
|
61
|
+
args={{
|
|
62
|
+
toggle: true,
|
|
63
|
+
value: 'yes',
|
|
64
|
+
uncheckedValue: 'no',
|
|
65
|
+
}}
|
|
66
|
+
argTypes={{
|
|
67
|
+
toggle: {
|
|
68
|
+
control: {
|
|
69
|
+
disable: true,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
value: {
|
|
73
|
+
control: {
|
|
74
|
+
disable: true,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
uncheckedValue: {
|
|
78
|
+
control: {
|
|
79
|
+
disable: true,
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
}}
|
|
83
|
+
play={defaultTest}
|
|
84
|
+
>
|
|
85
|
+
{Template.bind()}
|
|
86
|
+
</Story>
|
|
87
|
+
</Canvas>
|
|
88
|
+
|
|
27
89
|
<Canvas>
|
|
28
90
|
<Story
|
|
29
91
|
name="Unselectable"
|
package/src/types/group.d.ts
CHANGED
|
@@ -23,12 +23,14 @@ export interface InputGroupState extends GroupState {
|
|
|
23
23
|
* State shared in a group of buttons
|
|
24
24
|
*/
|
|
25
25
|
export interface ButtonGroupState extends GroupState {
|
|
26
|
-
modelValue: Ref<
|
|
26
|
+
modelValue: Ref<
|
|
27
|
+
string | number | boolean | (string | number | boolean)[] | undefined
|
|
28
|
+
>
|
|
27
29
|
disabled: Ref<boolean>
|
|
28
30
|
toggle: Ref<boolean>
|
|
29
31
|
multiple: Ref<boolean>
|
|
30
32
|
unselectable: Ref<boolean>
|
|
31
|
-
|
|
33
|
+
modifiers: Ref<string | string[] | undefined>
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
/**
|
|
@@ -37,6 +39,6 @@ export interface ButtonGroupState extends GroupState {
|
|
|
37
39
|
export interface AccordionGroupState extends GroupState {
|
|
38
40
|
collapse: Ref<boolean>
|
|
39
41
|
disabled: Ref<boolean>
|
|
40
|
-
modifiers: Ref<
|
|
42
|
+
modifiers: Ref<string[] | string | undefined>
|
|
41
43
|
not: Ref<boolean>
|
|
42
44
|
}
|