@volverjs/ui-vue 0.0.10-beta.40 → 0.0.10-beta.42

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 (35) hide show
  1. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +12 -3
  2. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  3. package/dist/components/VvCombobox/VvCombobox.es.js +185 -124
  4. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  5. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +6 -0
  6. package/dist/components/VvCombobox/index.d.ts +54 -22
  7. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +12 -3
  8. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  9. package/dist/components/VvSelect/VvSelect.es.js +79 -46
  10. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  11. package/dist/components/VvSelect/VvSelect.vue.d.ts +3 -0
  12. package/dist/components/VvSelect/index.d.ts +14 -0
  13. package/dist/components/index.es.js +185 -121
  14. package/dist/components/index.umd.js +1 -1
  15. package/dist/icons.es.js +3 -3
  16. package/dist/icons.umd.js +1 -1
  17. package/dist/stories/Combobox/Combobox.stories.d.ts +1 -0
  18. package/dist/stories/Combobox/ComboboxMultiple.stories.d.ts +1 -0
  19. package/dist/stories/Select/Select.stories.d.ts +1 -0
  20. package/package.json +18 -18
  21. package/src/assets/icons/detailed.json +1 -1
  22. package/src/assets/icons/normal.json +1 -1
  23. package/src/assets/icons/simple.json +1 -1
  24. package/src/components/VvCombobox/VvCombobox.vue +107 -96
  25. package/src/components/VvCombobox/index.ts +19 -2
  26. package/src/components/VvSelect/VvSelect.vue +66 -46
  27. package/src/components/VvSelect/index.ts +8 -1
  28. package/src/composables/useOptions.ts +12 -11
  29. package/src/stories/Combobox/Combobox.settings.ts +18 -3
  30. package/src/stories/Combobox/Combobox.stories.ts +8 -0
  31. package/src/stories/Combobox/Combobox.test.ts +6 -4
  32. package/src/stories/Combobox/ComboboxMultiple.stories.ts +9 -0
  33. package/src/stories/Combobox/ComboboxOptions.stories.ts +9 -13
  34. package/src/stories/Select/Select.stories.ts +8 -0
  35. 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
- await expect(dropdownFirstItem).toBeClicked()
46
- await sleep()
47
-
48
- const { getOptionValue } = useOptions(args)
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.val',
85
+ valueKey: 'value.id',
86
86
  labelKey: 'label.en',
87
87
  options: [
88
- { value: { val: 'first' }, label: { it: 'Primo', en: 'First' } },
88
+ { value: { id: 'first' }, label: { it: 'Primo', en: 'First' } },
89
89
  {
90
- value: { val: 'second' },
90
+ value: { id: 'second' },
91
91
  label: { it: 'Secondo', en: 'Second' },
92
92
  },
93
- { value: { val: 'third' }, label: { it: 'Terzo', en: 'Third' } },
94
- { value: { val: 'fourth' }, label: { it: 'Quarto', en: 'Fourth' } },
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
- value: { name: 'John Doe', email: 'john.doe@test.com' },
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
  }
@@ -112,3 +112,11 @@ export const Floating: Story = {
112
112
  floating: true,
113
113
  },
114
114
  }
115
+
116
+ export const AutoselectFirst: Story = {
117
+ ...Default,
118
+ args: {
119
+ ...defaultArgs,
120
+ autoselectFirst: true,
121
+ },
122
+ }
@@ -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
- select.value = firstValue
26
- select.dispatchEvent(new Event('change'))
27
- await sleep()
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
  }