@volverjs/ui-vue 0.0.9-beta.2 → 0.0.9-beta.21

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 (146) hide show
  1. package/README.md +3 -3
  2. package/auto-imports.d.ts +2 -0
  3. package/dist/components/VvAccordion/VvAccordion.es.js +15 -7
  4. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +15 -7
  5. package/dist/components/VvAction/VvAction.es.js +17 -8
  6. package/dist/components/VvAction/VvAction.umd.js +1 -1
  7. package/dist/components/VvAction/VvAction.vue.d.ts +9 -0
  8. package/dist/components/VvAction/index.d.ts +4 -0
  9. package/dist/components/VvAlert/VvAlert.es.js +22 -13
  10. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  11. package/dist/components/VvAlert/VvAlert.vue.d.ts +6 -6
  12. package/dist/components/VvAlert/index.d.ts +3 -3
  13. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +22 -13
  14. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  15. package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +6 -6
  16. package/dist/components/VvAlertGroup/index.d.ts +2 -2
  17. package/dist/components/VvAvatar/VvAvatar.es.js +15 -7
  18. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +15 -7
  19. package/dist/components/VvBadge/VvBadge.es.js +15 -7
  20. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +15 -7
  21. package/dist/components/VvButton/VvButton.es.js +19 -9
  22. package/dist/components/VvButton/VvButton.umd.js +1 -1
  23. package/dist/components/VvButton/VvButton.vue.d.ts +9 -0
  24. package/dist/components/VvButton/index.d.ts +4 -0
  25. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +15 -7
  26. package/dist/components/VvCard/VvCard.es.js +15 -7
  27. package/dist/components/VvCheckbox/VvCheckbox.es.js +99 -21
  28. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  29. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +4 -4
  30. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +105 -22
  31. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  32. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +4 -4
  33. package/dist/components/VvCombobox/VvCombobox.es.js +256 -191
  34. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  35. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +329 -101
  36. package/dist/components/VvCombobox/index.d.ts +123 -37
  37. package/dist/components/VvDialog/VvDialog.es.js +50 -37
  38. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  39. package/dist/components/VvDropdown/VvDropdown.es.js +32 -18
  40. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  41. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +300 -92
  42. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +9 -0
  43. package/dist/components/VvDropdown/index.d.ts +99 -30
  44. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +17 -8
  45. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  46. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +15 -7
  47. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +15 -7
  48. package/dist/components/VvInputText/VvInputText.es.js +279 -116
  49. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  50. package/dist/components/VvInputText/VvInputText.vue.d.ts +23 -41
  51. package/dist/components/VvInputText/index.d.ts +15 -33
  52. package/dist/components/VvNav/VvNav.es.js +18 -9
  53. package/dist/components/VvNav/VvNav.umd.js +1 -1
  54. package/dist/components/VvNav/index.d.ts +1 -1
  55. package/dist/components/VvProgress/VvProgress.es.js +15 -7
  56. package/dist/components/VvRadio/VvRadio.es.js +99 -21
  57. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  58. package/dist/components/VvRadio/VvRadio.vue.d.ts +4 -4
  59. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +105 -22
  60. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  61. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +4 -4
  62. package/dist/components/VvSelect/VvSelect.es.js +95 -21
  63. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  64. package/dist/components/VvSelect/VvSelect.vue.d.ts +5 -5
  65. package/dist/components/VvTab/VvTab.es.js +18 -9
  66. package/dist/components/VvTab/VvTab.umd.js +1 -1
  67. package/dist/components/VvTextarea/VvTextarea.es.js +103 -26
  68. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  69. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +4 -4
  70. package/dist/components/VvTooltip/VvTooltip.es.js +15 -7
  71. package/dist/components/common/HintSlot.d.ts +4 -3
  72. package/dist/components/index.d.ts +5 -0
  73. package/dist/components/index.es.js +1212 -626
  74. package/dist/components/index.umd.js +1 -1
  75. package/dist/composables/alert/useAlert.d.ts +27 -0
  76. package/dist/composables/index.d.ts +1 -0
  77. package/dist/composables/index.es.js +81 -0
  78. package/dist/composables/index.umd.js +1 -0
  79. package/dist/constants.d.ts +14 -0
  80. package/dist/directives/index.es.js +15 -7
  81. package/dist/directives/v-tooltip.es.js +15 -7
  82. package/dist/icons.es.js +3 -3
  83. package/dist/icons.umd.js +1 -1
  84. package/dist/props/index.d.ts +107 -31
  85. package/dist/resolvers/unplugin.es.js +3 -0
  86. package/dist/resolvers/unplugin.umd.js +1 -1
  87. package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +2 -2
  88. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +54 -269
  89. package/dist/stories/Alert/Alert.settings.d.ts +3 -7
  90. package/dist/stories/AlertGroup/AlertGroupSlots.stories.d.ts +2 -2
  91. package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +6 -0
  92. package/dist/stories/Button/Button.settings.d.ts +3 -13
  93. package/dist/stories/Combobox/Combobox.settings.d.ts +117 -19
  94. package/dist/stories/InputText/InputText.settings.d.ts +31 -9
  95. package/dist/stories/InputText/InputText.stories.d.ts +0 -1
  96. package/dist/stories/InputText/InputTextMask.stories.d.ts +12 -0
  97. package/dist/stories/Nav/Nav.settings.d.ts +3 -21
  98. package/package.json +75 -66
  99. package/src/assets/icons/detailed.json +1 -1
  100. package/src/assets/icons/normal.json +1 -1
  101. package/src/assets/icons/simple.json +1 -1
  102. package/src/components/VvAction/VvAction.vue +2 -1
  103. package/src/components/VvAlert/VvAlert.vue +5 -1
  104. package/src/components/VvAlert/index.ts +3 -3
  105. package/src/components/VvAlertGroup/VvAlertGroup.vue +2 -0
  106. package/src/components/VvButton/VvButton.vue +1 -0
  107. package/src/components/VvCheckbox/VvCheckbox.vue +8 -1
  108. package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +8 -1
  109. package/src/components/VvCombobox/VvCombobox.vue +43 -23
  110. package/src/components/VvCombobox/index.ts +24 -0
  111. package/src/components/VvDialog/VvDialog.vue +22 -19
  112. package/src/components/VvDropdown/VvDropdown.vue +24 -18
  113. package/src/components/VvInputText/VvInputText.vue +177 -55
  114. package/src/components/VvInputText/index.ts +32 -34
  115. package/src/components/VvNav/VvNav.vue +1 -1
  116. package/src/components/VvNav/index.ts +1 -1
  117. package/src/components/VvRadio/VvRadio.vue +8 -1
  118. package/src/components/VvRadioGroup/VvRadioGroup.vue +8 -1
  119. package/src/components/VvSelect/VvSelect.vue +8 -1
  120. package/src/components/VvTextarea/VvTextarea.vue +16 -6
  121. package/src/components/common/HintSlot.ts +26 -13
  122. package/src/components/index.ts +5 -0
  123. package/src/composables/alert/useAlert.ts +103 -0
  124. package/src/composables/index.ts +1 -0
  125. package/src/constants.ts +26 -0
  126. package/src/props/index.ts +14 -11
  127. package/src/resolvers/unplugin.ts +3 -0
  128. package/src/stories/Alert/Alert.settings.ts +3 -1
  129. package/src/stories/AlertGroup/AlertGroup.test.ts +13 -0
  130. package/src/stories/AlertGroup/AlertGroupSlots.stories.ts +3 -3
  131. package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +118 -0
  132. package/src/stories/Button/Button.settings.ts +5 -3
  133. package/src/stories/Combobox/Combobox.settings.ts +119 -2
  134. package/src/stories/Combobox/Combobox.test.ts +1 -1
  135. package/src/stories/InputText/InputText.settings.ts +36 -15
  136. package/src/stories/InputText/InputText.stories.ts +4 -12
  137. package/src/stories/InputText/InputText.test.ts +31 -15
  138. package/src/stories/InputText/InputTextMask.stories.ts +122 -0
  139. package/src/stories/Nav/Nav.settings.ts +3 -1
  140. package/src/stories/Tab/Tab.stories.ts +3 -3
  141. package/src/stories/Textarea/TextareaLength.stories.ts +1 -1
  142. package/src/types/alert.d.ts +20 -0
  143. /package/dist/components/{VvNavItemTitle → VvNav}/VvNavItemTitle.vue.d.ts +0 -0
  144. /package/dist/components/{VvNavSeparator → VvNav}/VvNavSeparator.d.ts +0 -0
  145. /package/src/components/{VvNavItemTitle → VvNav}/VvNavItemTitle.vue +0 -0
  146. /package/src/components/{VvNavSeparator → VvNav}/VvNavSeparator.ts +0 -0
@@ -25,14 +25,15 @@ export const Default: Story = {
25
25
  setup() {
26
26
  return { args }
27
27
  },
28
- data: () => ({ inputValue: undefined }),
28
+ data: () => ({ inputValue: undefined, maskedInputValue: undefined }),
29
29
  template: /* html */ `
30
- <vv-input-text v-bind="args" v-model="inputValue" :data-testData="inputValue" data-testId="element">
30
+ <vv-input-text v-bind="args" v-model="inputValue" v-model:masked="maskedInputValue" :data-testData="inputValue" data-testId="element">
31
31
  <template #before v-if="args.before"><div class="flex" v-html="args.before"></div></template>
32
32
  <template #after v-if="args.after"><div class="flex" v-html="args.after"></div></template>
33
33
  <template #hint v-if="args.hint"><span v-html="args.hint"></span></template>
34
34
  </vv-input-text>
35
- <div>Value: <span data-testId="value">{{inputValue}}</span></div>
35
+ <div>Value: <span data-testId="value">{{ inputValue }}</span></div>
36
+ <div v-if="args.iMask" class="mt-sm">Masked Value: <span data-testId="masked-value">{{ maskedInputValue }}</span></div>
36
37
  `,
37
38
  }),
38
39
  play: defaultTest,
@@ -82,7 +83,6 @@ export const Hint: Story = {
82
83
  ...defaultArgs,
83
84
  hintLabel: 'Please enter your name.',
84
85
  },
85
-
86
86
  }
87
87
 
88
88
  export const Loading: Story = {
@@ -102,14 +102,6 @@ export const Floating: Story = {
102
102
  },
103
103
  }
104
104
 
105
- export const Mask: Story = {
106
- ...Default,
107
- args: {
108
- ...defaultArgs,
109
- mask: '##-###-##',
110
- },
111
- }
112
-
113
105
  export const Unit: Story = {
114
106
  ...Default,
115
107
  args: {
@@ -4,32 +4,48 @@ import { sleep } from '@/test/sleep'
4
4
  import { within, userEvent } from '@storybook/testing-library'
5
5
  import { INPUT_TYPES, type InputType } from '@/components/VvInputText'
6
6
 
7
- const valueByType = (type: InputType, mask?: string) => {
7
+ const valueByType = (type: InputType, mask?: string, id?: string) => {
8
8
  if (mask) {
9
- return '1234567'
9
+ switch (id) {
10
+ case 'phone-number':
11
+ return { toType: '393923847556' }
12
+ case 'date-placeholder':
13
+ return { toType: '01011970', toCheck: '1970-01-01' }
14
+ case 'phone-or-email':
15
+ return {
16
+ toType:
17
+ Math.random() < 0.5 ? '393923847556' : 'test@test.com',
18
+ }
19
+ case 'intl-number':
20
+ return { toType: '1234567890.22' }
21
+ case 'currency':
22
+ return { toType: '1234567890.22' }
23
+ default:
24
+ return { toType: '1234567890' }
25
+ }
10
26
  }
11
27
  switch (type) {
12
28
  case INPUT_TYPES.TEXT:
13
29
  case INPUT_TYPES.PASSWORD:
14
30
  case INPUT_TYPES.SEARCH:
15
- return 'Lorem ipsum'
31
+ return { toType: 'Lorem ipsum' }
16
32
  case INPUT_TYPES.NUMBER:
17
- return '1'
33
+ return { toType: '1' }
18
34
  case INPUT_TYPES.EMAIL:
19
- return 'test@test.com'
35
+ return { toType: 'test@test.com' }
20
36
  case INPUT_TYPES.TEL:
21
- return '+1234567890'
37
+ return { toType: '+1234567890' }
22
38
  case INPUT_TYPES.URL:
23
- return 'https://www.test.com'
39
+ return { toType: 'https://www.test.com' }
24
40
  case INPUT_TYPES.DATE:
25
- return new Date().toISOString().split('T')[0]
41
+ return { toType: new Date().toISOString().split('T')[0] }
26
42
  case INPUT_TYPES.TIME:
27
- return '12:00'
43
+ return { toType: '12:00' }
28
44
  case INPUT_TYPES.COLOR:
29
45
  case INPUT_TYPES.DATETIME_LOCAL:
30
46
  case INPUT_TYPES.MONTH:
31
47
  case INPUT_TYPES.WEEK:
32
- return undefined
48
+ return { toType: undefined }
33
49
  }
34
50
  }
35
51
 
@@ -45,17 +61,17 @@ export async function defaultTest({ canvasElement, args }: PlayAttributes) {
45
61
 
46
62
  // value
47
63
  if (!args.invalid && !args.disabled && !args.readonly) {
48
- const inputValue = valueByType(args.type, args.mask)
49
- if (inputValue) {
64
+ const { toType, toCheck } = valueByType(args.type, args.iMask, args.id)
65
+ if (toType) {
50
66
  await expect(input).toBeClicked()
51
- await userEvent.keyboard(inputValue)
67
+ await userEvent.keyboard(toType)
52
68
  await sleep()
53
69
  if (args.maxlength) {
54
70
  await expect(value.innerHTML).toEqual(
55
- inputValue.slice(0, args.maxlength),
71
+ toType.slice(0, args.maxlength),
56
72
  )
57
73
  } else {
58
- await expect(value.innerHTML).toEqual(inputValue)
74
+ await expect(value.innerHTML).toEqual(toCheck ?? toType)
59
75
  }
60
76
  }
61
77
  }
@@ -0,0 +1,122 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3'
2
+ import VvInputText from '@/components/VvInputText/VvInputText.vue'
3
+ import { Default } from './InputText.stories'
4
+ import { defaultArgs, argTypes } from './InputText.settings'
5
+
6
+ const meta: Meta<typeof VvInputText> = {
7
+ title: 'Components/InputText/Mask',
8
+ component: VvInputText,
9
+ args: defaultArgs,
10
+ argTypes,
11
+ }
12
+
13
+ export default meta
14
+
15
+ type Story = StoryObj<typeof VvInputText>
16
+
17
+ export const RegExp: Story = {
18
+ ...Default,
19
+ args: {
20
+ ...defaultArgs,
21
+ id: 'regexp',
22
+ iMask: {
23
+ mask: /^\d+$/,
24
+ },
25
+ },
26
+ }
27
+
28
+ export const PhoneNumber: Story = {
29
+ ...Default,
30
+ args: {
31
+ ...defaultArgs,
32
+ id: 'phone-number',
33
+ iMask: {
34
+ mask: '+{39}(000)000-00-00',
35
+ },
36
+ },
37
+ }
38
+
39
+ export const Pattern: Story = {
40
+ ...Default,
41
+ args: {
42
+ ...defaultArgs,
43
+ id: 'pattern',
44
+ iMask: {
45
+ mask: 'XXX-XX-00000',
46
+ definitions: {
47
+ X: {
48
+ mask: '0',
49
+ displayChar: 'X',
50
+ placeholderChar: '#',
51
+ },
52
+ },
53
+ lazy: false,
54
+ overwrite: 'shift',
55
+ },
56
+ },
57
+ }
58
+
59
+ export const IntlNumber: Story = {
60
+ ...Default,
61
+ args: {
62
+ ...defaultArgs,
63
+ id: 'intl-number',
64
+ type: 'number',
65
+ iMask: {
66
+ mask: Number,
67
+ thousandsSeparator: '.',
68
+ radix: ',',
69
+ },
70
+ },
71
+ }
72
+
73
+ export const DatePlaceholder: Story = {
74
+ ...Default,
75
+ args: {
76
+ ...defaultArgs,
77
+ id: 'date-placeholder',
78
+ type: 'date',
79
+ iMask: {
80
+ mask: Date,
81
+ pattern: 'd.m.Y',
82
+ lazy: false,
83
+ },
84
+ },
85
+ }
86
+
87
+ export const PhoneOrEmail: Story = {
88
+ ...Default,
89
+ args: {
90
+ ...defaultArgs,
91
+ id: 'phone-or-email',
92
+ iMask: {
93
+ mask: [
94
+ {
95
+ mask: '+{39}(000)000-00-00',
96
+ },
97
+ {
98
+ mask: /^\S*@?\S*$/,
99
+ },
100
+ ],
101
+ },
102
+ },
103
+ }
104
+
105
+ export const Currency: Story = {
106
+ ...Default,
107
+ args: {
108
+ ...defaultArgs,
109
+ id: 'currency',
110
+ type: 'number',
111
+ iMask: {
112
+ mask: '€ num',
113
+ blocks: {
114
+ num: {
115
+ mask: Number,
116
+ thousandsSeparator: '.',
117
+ radix: ',',
118
+ },
119
+ },
120
+ },
121
+ },
122
+ }
@@ -1,7 +1,9 @@
1
+ import type { Meta } from '@storybook/vue3'
2
+ import type { VvNav } from '@/components'
1
3
  import { VvNavProps } from '@/components/VvNav'
2
4
  import { ModifiersArgTypes } from '@/stories/argTypes'
3
5
 
4
- export const defaultArgs = {
6
+ export const defaultArgs: Meta<typeof VvNav>['args'] = {
5
7
  ...propsToObject(VvNavProps),
6
8
  items: [
7
9
  {
@@ -20,9 +20,9 @@ export const Default: Story = {
20
20
  ...defaultArgs,
21
21
  },
22
22
  render: (args) => ({
23
- components: {VvTab},
23
+ components: { VvTab },
24
24
  setup() {
25
- return {args}
25
+ return { args }
26
26
  },
27
27
  template: /* html */ `
28
28
  <div class="m-md w-1/2">
@@ -64,7 +64,7 @@ export const Default: Story = {
64
64
  </p>
65
65
  </template>
66
66
  </vv-tab>
67
- </div>`
67
+ </div>`,
68
68
  }),
69
69
  play: defaultTest,
70
70
  }
@@ -35,7 +35,7 @@ export const Count: Story = {
35
35
  args: {
36
36
  ...Default.args,
37
37
  count: true,
38
- minLength: 100,
38
+ minlength: 100,
39
39
  },
40
40
  }
41
41
 
@@ -0,0 +1,20 @@
1
+ export type AlertModifiers =
2
+ | 'success'
3
+ | 'info'
4
+ | 'warning'
5
+ | 'danger'
6
+ | 'brand'
7
+ | 'accent'
8
+
9
+ export type Alert = {
10
+ id: string | number
11
+ group: string
12
+ title?: string
13
+ icon: string | Record<string, unknown>
14
+ content?: string
15
+ footer?: string
16
+ modifiers: AlertModifiers
17
+ dismissable: boolean
18
+ autoClose: number
19
+ timestamp: number
20
+ }