@volverjs/ui-vue 0.0.10-beta.40 → 0.0.10-beta.41
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/components/VvCheckboxGroup/VvCheckboxGroup.es.js +12 -3
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +183 -125
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +6 -0
- package/dist/components/VvCombobox/index.d.ts +54 -22
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +12 -3
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.es.js +79 -46
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +3 -0
- package/dist/components/VvSelect/index.d.ts +14 -0
- package/dist/components/index.es.js +183 -122
- package/dist/components/index.umd.js +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/stories/Combobox/Combobox.stories.d.ts +1 -0
- package/dist/stories/Combobox/ComboboxMultiple.stories.d.ts +1 -0
- package/dist/stories/Select/Select.stories.d.ts +1 -0
- package/package.json +18 -18
- 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/VvCombobox/VvCombobox.vue +105 -97
- package/src/components/VvCombobox/index.ts +19 -2
- package/src/components/VvSelect/VvSelect.vue +66 -46
- package/src/components/VvSelect/index.ts +8 -1
- package/src/composables/useOptions.ts +12 -11
- package/src/stories/Combobox/Combobox.settings.ts +18 -3
- package/src/stories/Combobox/Combobox.stories.ts +8 -0
- package/src/stories/Combobox/Combobox.test.ts +6 -4
- package/src/stories/Combobox/ComboboxMultiple.stories.ts +9 -0
- package/src/stories/Combobox/ComboboxOptions.stories.ts +9 -13
- package/src/stories/Select/Select.stories.ts +8 -0
- package/src/stories/Select/Select.test.ts +5 -3
|
@@ -11,6 +11,8 @@ export async function defaultTest({ canvasElement, args }: PlayAttributes) {
|
|
|
11
11
|
return
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
const { getOptionValue } = useOptions(args)
|
|
15
|
+
|
|
14
16
|
const element = await within(canvasElement).findByTestId('element')
|
|
15
17
|
const value = await within(canvasElement).findByTestId('value')
|
|
16
18
|
const dropdown = element.getElementsByClassName(
|
|
@@ -42,10 +44,10 @@ export async function defaultTest({ canvasElement, args }: PlayAttributes) {
|
|
|
42
44
|
&& args.options.length > 0
|
|
43
45
|
) {
|
|
44
46
|
// select first value
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
if (!args.autoselectFirst) {
|
|
48
|
+
await expect(dropdownFirstItem).toBeClicked()
|
|
49
|
+
await sleep()
|
|
50
|
+
}
|
|
49
51
|
|
|
50
52
|
const firstValue = getOptionValue(
|
|
51
53
|
args.options[0].options?.[0] ?? args.options[0],
|
|
@@ -23,6 +23,15 @@ export const DefaultMultiple: Story = {
|
|
|
23
23
|
},
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
export const MinValues: Story = {
|
|
27
|
+
...Default,
|
|
28
|
+
args: {
|
|
29
|
+
...Default.args,
|
|
30
|
+
multiple: true,
|
|
31
|
+
minValues: 2,
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
|
|
26
35
|
export const MaxValues: Story = {
|
|
27
36
|
...Default,
|
|
28
37
|
args: {
|
|
@@ -82,16 +82,16 @@ export const DotPathOptions: Story = {
|
|
|
82
82
|
...Default,
|
|
83
83
|
args: {
|
|
84
84
|
...Default.args,
|
|
85
|
-
valueKey: 'value.
|
|
85
|
+
valueKey: 'value.id',
|
|
86
86
|
labelKey: 'label.en',
|
|
87
87
|
options: [
|
|
88
|
-
{ value: {
|
|
88
|
+
{ value: { id: 'first' }, label: { it: 'Primo', en: 'First' } },
|
|
89
89
|
{
|
|
90
|
-
value: {
|
|
90
|
+
value: { id: 'second' },
|
|
91
91
|
label: { it: 'Secondo', en: 'Second' },
|
|
92
92
|
},
|
|
93
|
-
{ value: {
|
|
94
|
-
{ value: {
|
|
93
|
+
{ value: { id: 'third' }, label: { it: 'Terzo', en: 'Third' } },
|
|
94
|
+
{ value: { id: 'fourth' }, label: { it: 'Quarto', en: 'Fourth' } },
|
|
95
95
|
],
|
|
96
96
|
},
|
|
97
97
|
}
|
|
@@ -101,15 +101,11 @@ export const ObjectValue: Story = {
|
|
|
101
101
|
args: {
|
|
102
102
|
...Default.args,
|
|
103
103
|
multiple: true,
|
|
104
|
+
labelKey: 'name',
|
|
105
|
+
valueKey: '',
|
|
104
106
|
options: [
|
|
105
|
-
{
|
|
106
|
-
|
|
107
|
-
label: 'John Doe',
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
value: { name: 'Jane Doe', email: 'jane.doe@test.com' },
|
|
111
|
-
label: 'Jane Doe',
|
|
112
|
-
},
|
|
107
|
+
{ name: 'John Doe', email: 'john.doe@test.com' },
|
|
108
|
+
{ name: 'Jane Doe', email: 'jane.doe@test.com' },
|
|
113
109
|
],
|
|
114
110
|
},
|
|
115
111
|
}
|
|
@@ -22,9 +22,11 @@ export async function defaultTest({ canvasElement, args }: PlayAttributes) {
|
|
|
22
22
|
const firstValue = getOptionValue(
|
|
23
23
|
args.options[0].options?.[0] ?? args.options[0],
|
|
24
24
|
)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
if (!args.autoselectFirst) {
|
|
26
|
+
select.value = firstValue
|
|
27
|
+
select.dispatchEvent(new Event('change'))
|
|
28
|
+
await sleep()
|
|
29
|
+
}
|
|
28
30
|
if (args.multiple) {
|
|
29
31
|
await expect(JSON.parse(value.innerHTML)).toEqual([firstValue])
|
|
30
32
|
}
|