@volverjs/ui-vue 0.0.4 → 0.0.5-beta.1
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/README.md +2 -2
- package/auto-imports.d.ts +12 -3
- package/bin/icons.cjs +1 -73
- package/dist/Volver.d.ts +19 -11
- package/dist/components/VvAccordion/VvAccordion.es.js +165 -106
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +4 -1
- package/dist/components/VvAccordion/index.d.ts +8 -3
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +264 -164
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +15 -12
- package/dist/components/VvAccordionGroup/index.d.ts +8 -0
- package/dist/components/VvAction/VvAction.es.js +266 -98
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +12 -12
- package/dist/components/VvAction/index.d.ts +2 -2
- package/dist/components/VvBadge/VvBadge.es.js +203 -44
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.vue.d.ts +2 -2
- package/dist/components/VvBadge/index.d.ts +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +237 -75
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +11 -11
- package/dist/components/VvBreadcrumb/index.d.ts +1 -1
- package/dist/components/VvButton/VvButton.es.js +636 -360
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +18 -18
- package/dist/components/VvButton/index.d.ts +13 -13
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +251 -79
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +2 -2
- package/dist/components/VvButtonGroup/index.d.ts +1 -1
- package/dist/components/VvCard/VvCard.es.js +57 -38
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +552 -274
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +2 -2
- package/dist/components/VvCheckbox/index.d.ts +5 -5
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +651 -340
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +7 -7
- package/dist/components/VvCheckboxGroup/index.d.ts +3 -3
- package/dist/components/VvCombobox/VvCombobox.es.js +1532 -983
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +125 -51
- package/dist/components/VvCombobox/index.d.ts +36 -10
- package/dist/components/VvDialog/VvDialog.es.js +377 -141
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +12 -3
- package/dist/components/VvDialog/index.d.ts +4 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +440 -244
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +113 -41
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +13 -13
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +2 -2
- package/dist/components/VvDropdown/index.d.ts +35 -11
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +363 -160
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +43 -28
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +275 -90
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +113 -65
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.vue.d.ts +7 -7
- package/dist/components/VvIcon/index.d.ts +2 -2
- package/dist/components/VvInputText/VvInputPasswordAction.d.ts +2 -2
- package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +974 -460
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +96 -16
- package/dist/components/VvInputText/VvInputTextActions.d.ts +1 -1
- package/dist/components/VvInputText/index.d.ts +64 -11
- package/dist/components/VvProgress/VvProgress.es.js +206 -45
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.vue.d.ts +2 -2
- package/dist/components/VvProgress/index.d.ts +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +489 -238
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
- package/dist/components/VvRadio/index.d.ts +5 -5
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +588 -304
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +7 -7
- package/dist/components/VvRadioGroup/index.d.ts +3 -3
- package/dist/components/VvSelect/VvSelect.es.js +621 -324
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +13 -13
- package/dist/components/VvSelect/index.d.ts +3 -3
- package/dist/components/VvTextarea/VvTextarea.es.js +664 -353
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +10 -10
- package/dist/components/VvTextarea/index.d.ts +2 -2
- package/dist/components/VvTooltip/VvTooltip.es.js +205 -47
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +7 -7
- package/dist/components/VvTooltip/index.d.ts +2 -2
- package/dist/components/index.es.js +3508 -2231
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/dropdown/useInjectDropdown.d.ts +1 -1
- package/dist/composables/dropdown/useProvideDropdown.d.ts +3 -3
- package/dist/composables/group/useInjectedGroupState.d.ts +2 -2
- package/dist/composables/group/useProvideGroupState.d.ts +1 -1
- package/dist/composables/useComponentFocus.d.ts +1 -1
- package/dist/composables/useComponentIcon.d.ts +7 -7
- package/dist/composables/useDebouncedInput.d.ts +4 -1
- package/dist/composables/useDefaults.d.ts +2 -0
- package/dist/composables/useModifiers.d.ts +1 -1
- package/dist/composables/useOptions.d.ts +2 -2
- package/dist/composables/useTextCount.d.ts +3 -3
- package/dist/composables/useUniqueId.d.ts +1 -1
- package/dist/composables/useVolver.d.ts +1 -1
- package/dist/directives/index.es.js +215 -55
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +212 -53
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.es.js +38 -23
- package/dist/icons.umd.js +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.es.js +112 -3607
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +40 -16
- package/dist/resolvers/unplugin.d.ts +7 -1
- package/dist/resolvers/unplugin.es.js +77 -37
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/InputText/InputText.settings.d.ts +53 -0
- package/dist/stories/argTypes.d.ts +1 -1
- package/package.json +114 -36
- package/src/Volver.ts +49 -22
- 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/VvAccordion.vue +19 -22
- package/src/components/VvAccordion/index.ts +12 -4
- package/src/components/VvAccordionGroup/VvAccordionGroup.vue +19 -10
- package/src/components/VvAccordionGroup/index.ts +8 -0
- package/src/components/VvAction/VvAction.vue +7 -7
- package/src/components/VvAction/index.ts +1 -1
- package/src/components/VvBadge/VvBadge.vue +2 -2
- package/src/components/VvBadge/index.ts +1 -1
- package/src/components/VvBreadcrumb/VvBreadcrumb.vue +3 -3
- package/src/components/VvButton/VvButton.vue +11 -11
- package/src/components/VvButton/index.ts +10 -9
- package/src/components/VvButtonGroup/VvButtonGroup.vue +4 -7
- package/src/components/VvButtonGroup/index.ts +1 -1
- package/src/components/VvCard/VvCard.vue +2 -2
- package/src/components/VvCheckbox/VvCheckbox.vue +3 -7
- package/src/components/VvCheckbox/index.ts +11 -7
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +7 -10
- package/src/components/VvCheckboxGroup/index.ts +1 -1
- package/src/components/VvCombobox/VvCombobox.vue +39 -23
- package/src/components/VvCombobox/index.ts +1 -1
- package/src/components/VvDialog/VvDialog.vue +28 -11
- package/src/components/VvDialog/index.ts +5 -2
- package/src/components/VvDropdown/VvDropdown.vue +6 -5
- package/src/components/VvDropdown/VvDropdownAction.vue +7 -5
- package/src/components/VvDropdown/VvDropdownOption.vue +17 -10
- package/src/components/VvDropdown/index.ts +3 -3
- package/src/components/VvIcon/VvIcon.vue +3 -3
- package/src/components/VvIcon/index.ts +3 -3
- package/src/components/VvInputText/VvInputClearAction.ts +2 -2
- package/src/components/VvInputText/VvInputPasswordAction.ts +3 -4
- package/src/components/VvInputText/VvInputStepAction.ts +3 -2
- package/src/components/VvInputText/VvInputText.vue +128 -35
- package/src/components/VvInputText/VvInputTextActions.ts +5 -8
- package/src/components/VvInputText/index.ts +62 -1
- package/src/components/VvProgress/VvProgress.vue +2 -2
- package/src/components/VvProgress/index.ts +1 -1
- package/src/components/VvRadio/VvRadio.vue +3 -7
- package/src/components/VvRadio/index.ts +11 -7
- package/src/components/VvRadioGroup/VvRadioGroup.vue +7 -10
- package/src/components/VvRadioGroup/index.ts +1 -1
- package/src/components/VvSelect/VvSelect.vue +4 -4
- package/src/components/VvSelect/index.ts +1 -1
- package/src/components/VvTextarea/VvTextarea.vue +4 -4
- package/src/components/VvTextarea/index.ts +1 -1
- package/src/components/VvTooltip/VvTooltip.vue +2 -2
- package/src/components/VvTooltip/index.ts +3 -3
- package/src/composables/dropdown/useInjectDropdown.ts +2 -2
- package/src/composables/dropdown/useProvideDropdown.ts +2 -2
- package/src/composables/group/useInjectedGroupState.ts +1 -1
- package/src/composables/group/useProvideGroupState.ts +1 -1
- package/src/composables/useComponentIcon.ts +1 -1
- package/src/composables/useDebouncedInput.ts +10 -3
- package/src/composables/useDefaults.ts +89 -0
- package/src/composables/useModifiers.ts +4 -2
- package/src/composables/useOptions.ts +1 -1
- package/src/composables/useVolver.ts +2 -2
- package/src/directives/index.ts +1 -1
- package/src/directives/v-tooltip.ts +2 -2
- package/src/index.ts +0 -2
- package/src/props/index.ts +8 -8
- package/src/resolvers/unplugin.ts +15 -1
- package/src/stories/Accordion/Accordion.stories.mdx +8 -2
- package/src/stories/Accordion/Accordion.test.ts +21 -15
- package/src/stories/Accordion/AccordionSlots.stories.mdx +8 -8
- package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +17 -1
- package/src/stories/AccordionGroup/AccordionGroup.test.ts +18 -12
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +1 -1
- package/src/stories/InputText/InputText.settings.ts +53 -0
- package/src/stories/InputText/InputText.stories.mdx +40 -0
- package/src/stories/InputText/InputText.test.ts +5 -2
- package/src/stories/argTypes.ts +2 -2
- package/src/types/group.d.ts +5 -0
|
@@ -7,21 +7,28 @@
|
|
|
7
7
|
|
|
8
8
|
<script setup lang="ts">
|
|
9
9
|
import type { Ref } from 'vue'
|
|
10
|
-
import { VvComboboxProps, VvComboboxEvents } from '
|
|
11
|
-
import VvIcon from '
|
|
12
|
-
import VvDropdown from '
|
|
13
|
-
import VvDropdownOption from '
|
|
14
|
-
import VvSelect from '
|
|
15
|
-
import VvBadge from '
|
|
16
|
-
import HintSlotFactory from '
|
|
17
|
-
import type { Option } from '
|
|
18
|
-
import { DropdownRole } from '
|
|
10
|
+
import { VvComboboxProps, VvComboboxEvents } from '.'
|
|
11
|
+
import VvIcon from '../VvIcon/VvIcon.vue'
|
|
12
|
+
import VvDropdown from '../VvDropdown/VvDropdown.vue'
|
|
13
|
+
import VvDropdownOption from '../VvDropdown/VvDropdownOption.vue'
|
|
14
|
+
import VvSelect from '../VvSelect/VvSelect.vue'
|
|
15
|
+
import VvBadge from '../VvBadge/VvBadge.vue'
|
|
16
|
+
import HintSlotFactory from '../common/HintSlot'
|
|
17
|
+
import type { Option } from '../../types/generic'
|
|
18
|
+
import { DropdownRole } from '../../constants'
|
|
19
19
|
|
|
20
20
|
// props, emit and slots
|
|
21
21
|
const props = defineProps(VvComboboxProps)
|
|
22
22
|
const emit = defineEmits(VvComboboxEvents)
|
|
23
23
|
const slots = useSlots()
|
|
24
24
|
|
|
25
|
+
// props merged with volver defaults (now only for labels)
|
|
26
|
+
const propsDefaults = useDefaults<typeof VvComboboxProps>(
|
|
27
|
+
'VvCombobox',
|
|
28
|
+
VvComboboxProps,
|
|
29
|
+
props,
|
|
30
|
+
)
|
|
31
|
+
|
|
25
32
|
// hint slot
|
|
26
33
|
const { HintSlot } = HintSlotFactory(props, slots)
|
|
27
34
|
|
|
@@ -126,7 +133,7 @@
|
|
|
126
133
|
})
|
|
127
134
|
|
|
128
135
|
// styles
|
|
129
|
-
const bemCssClasses =
|
|
136
|
+
const bemCssClasses = useModifiers(
|
|
130
137
|
'vv-select',
|
|
131
138
|
modifiers,
|
|
132
139
|
computed(() => ({
|
|
@@ -246,8 +253,13 @@
|
|
|
246
253
|
} else {
|
|
247
254
|
toReturn = [value as Option]
|
|
248
255
|
}
|
|
249
|
-
} else
|
|
250
|
-
|
|
256
|
+
} else {
|
|
257
|
+
if (props.autoClose) {
|
|
258
|
+
collapse()
|
|
259
|
+
}
|
|
260
|
+
if (props.unselectable && value === props.modelValue) {
|
|
261
|
+
toReturn = undefined
|
|
262
|
+
}
|
|
251
263
|
}
|
|
252
264
|
emit('update:modelValue', toReturn)
|
|
253
265
|
}
|
|
@@ -257,12 +269,12 @@
|
|
|
257
269
|
name: props.name,
|
|
258
270
|
tabindex: hasTabindex.value,
|
|
259
271
|
valid: valid.value,
|
|
260
|
-
validLabel:
|
|
272
|
+
validLabel: propsDefaults.value.validLabel,
|
|
261
273
|
invalid: invalid.value,
|
|
262
|
-
invalidLabel:
|
|
263
|
-
hintLabel:
|
|
274
|
+
invalidLabel: propsDefaults.value.invalidLabel,
|
|
275
|
+
hintLabel: propsDefaults.value.hintLabel,
|
|
264
276
|
loading: loading.value,
|
|
265
|
-
loadingLabel:
|
|
277
|
+
loadingLabel: propsDefaults.value.loadingLabel,
|
|
266
278
|
disabled: disabled.value,
|
|
267
279
|
readonly: readonly.value,
|
|
268
280
|
modifiers: props.modifiers,
|
|
@@ -350,7 +362,7 @@
|
|
|
350
362
|
spellcheck="false"
|
|
351
363
|
type="search"
|
|
352
364
|
class="vv-dropdown__search"
|
|
353
|
-
:placeholder="searchPlaceholder"
|
|
365
|
+
:placeholder="propsDefaults.searchPlaceholder"
|
|
354
366
|
/>
|
|
355
367
|
</template>
|
|
356
368
|
<template #default="{ aria }">
|
|
@@ -398,7 +410,9 @@
|
|
|
398
410
|
!readonly &&
|
|
399
411
|
!disabled
|
|
400
412
|
"
|
|
401
|
-
:aria-label="
|
|
413
|
+
:aria-label="
|
|
414
|
+
propsDefaults.deselectActionLabel
|
|
415
|
+
"
|
|
402
416
|
@click.stop="onInput(option)"
|
|
403
417
|
>
|
|
404
418
|
<VvIcon name="close" />
|
|
@@ -429,9 +443,11 @@
|
|
|
429
443
|
disabled: getOptionDisabled(option),
|
|
430
444
|
selected: getOptionSelected(option),
|
|
431
445
|
unselectable,
|
|
432
|
-
deselectHintLabel
|
|
433
|
-
|
|
434
|
-
|
|
446
|
+
deselectHintLabel:
|
|
447
|
+
propsDefaults.deselectHintLabel,
|
|
448
|
+
selectHintLabel: propsDefaults.selectHintLabel,
|
|
449
|
+
selectedHintLabel:
|
|
450
|
+
propsDefaults.selectedHintLabel,
|
|
435
451
|
}"
|
|
436
452
|
:key="index"
|
|
437
453
|
class="vv-dropdown-option"
|
|
@@ -457,13 +473,13 @@
|
|
|
457
473
|
>
|
|
458
474
|
<!-- @slot Slot for no options available -->
|
|
459
475
|
<slot name="no-options">
|
|
460
|
-
{{ noOptionsLabel }}
|
|
476
|
+
{{ propsDefaults.noOptionsLabel }}
|
|
461
477
|
</slot>
|
|
462
478
|
</VvDropdownOption>
|
|
463
479
|
<VvDropdownOption v-else modifiers="inert">
|
|
464
480
|
<!-- @slot Slot for no results available -->
|
|
465
481
|
<slot name="no-results">
|
|
466
|
-
{{ noResultsLabel }}
|
|
482
|
+
{{ propsDefaults.noResultsLabel }}
|
|
467
483
|
</slot>
|
|
468
484
|
</VvDropdownOption>
|
|
469
485
|
</template>
|
|
@@ -6,15 +6,26 @@
|
|
|
6
6
|
|
|
7
7
|
<script setup lang="ts">
|
|
8
8
|
import type { DialogHTMLAttributes } from 'vue'
|
|
9
|
-
import VvIcon from '
|
|
10
|
-
import { VvDialogEvents, VvDialogProps } from '
|
|
9
|
+
import VvIcon from '../VvIcon/VvIcon.vue'
|
|
10
|
+
import { VvDialogEvents, VvDialogProps } from '.'
|
|
11
11
|
|
|
12
|
-
// props
|
|
12
|
+
// props and emit
|
|
13
13
|
const props = defineProps(VvDialogProps)
|
|
14
14
|
const emit = defineEmits(VvDialogEvents)
|
|
15
15
|
|
|
16
16
|
// data
|
|
17
|
-
const
|
|
17
|
+
const localModelValue = ref(false)
|
|
18
|
+
const modelValue = computed({
|
|
19
|
+
get() {
|
|
20
|
+
return props.modelValue ?? localModelValue.value
|
|
21
|
+
},
|
|
22
|
+
set(value) {
|
|
23
|
+
if (props.modelValue === undefined) {
|
|
24
|
+
localModelValue.value = value
|
|
25
|
+
}
|
|
26
|
+
emit('update:modelValue', value)
|
|
27
|
+
},
|
|
28
|
+
})
|
|
18
29
|
const htmlAttrIsOpen = ref(true)
|
|
19
30
|
|
|
20
31
|
// template ref
|
|
@@ -51,26 +62,32 @@
|
|
|
51
62
|
// methods
|
|
52
63
|
onClickOutside(modalWrapper, () => {
|
|
53
64
|
if (props.autoClose) {
|
|
54
|
-
|
|
65
|
+
modelValue.value = false
|
|
55
66
|
}
|
|
56
67
|
})
|
|
57
68
|
|
|
58
|
-
function
|
|
59
|
-
|
|
69
|
+
function close() {
|
|
70
|
+
modelValue.value = false
|
|
60
71
|
}
|
|
61
72
|
|
|
73
|
+
function open() {
|
|
74
|
+
modelValue.value = true
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
defineExpose({ close, open })
|
|
78
|
+
|
|
62
79
|
// keyboard
|
|
63
80
|
onKeyStroke('Escape', (e) => {
|
|
64
|
-
if (
|
|
81
|
+
if (modelValue.value) {
|
|
65
82
|
e.preventDefault()
|
|
66
|
-
|
|
83
|
+
close()
|
|
67
84
|
}
|
|
68
85
|
})
|
|
69
86
|
</script>
|
|
70
87
|
|
|
71
88
|
<template>
|
|
72
89
|
<Transition :name="transitioName" v-on="dialogTransitionHandlers">
|
|
73
|
-
<dialog v-show="
|
|
90
|
+
<dialog v-show="modelValue" v-bind="dialogAttrs" :class="dialogClass">
|
|
74
91
|
<article ref="modalWrapper" class="vv-dialog__wrapper">
|
|
75
92
|
<header v-if="$slots.header || title" class="vv-dialog__header">
|
|
76
93
|
<!-- @slot Header slot -->
|
|
@@ -80,7 +97,7 @@
|
|
|
80
97
|
type="button"
|
|
81
98
|
aria-label="Close"
|
|
82
99
|
class="vv-dialog__close"
|
|
83
|
-
@click.passive="
|
|
100
|
+
@click.passive="close"
|
|
84
101
|
>
|
|
85
102
|
<VvIcon name="close" />
|
|
86
103
|
</button>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IdProps } from '
|
|
1
|
+
import { IdProps } from '../../props'
|
|
2
2
|
|
|
3
3
|
export const VvDialogEvents = ['open', 'close', 'update:modelValue']
|
|
4
4
|
|
|
@@ -11,7 +11,10 @@ export const VvDialogProps = {
|
|
|
11
11
|
/**
|
|
12
12
|
* Show / hide dialog programmatically
|
|
13
13
|
*/
|
|
14
|
-
modelValue:
|
|
14
|
+
modelValue: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: undefined,
|
|
17
|
+
},
|
|
15
18
|
/**
|
|
16
19
|
* Dialog transition
|
|
17
20
|
*/
|
|
@@ -17,14 +17,15 @@
|
|
|
17
17
|
arrow,
|
|
18
18
|
size,
|
|
19
19
|
} from '@floating-ui/vue'
|
|
20
|
-
import { VvDropdownProps } from '
|
|
20
|
+
import { VvDropdownProps } from '.'
|
|
21
21
|
import type {
|
|
22
22
|
AutoPlacementOptions,
|
|
23
23
|
FlipOptions,
|
|
24
24
|
OffsetOptions,
|
|
25
25
|
ShiftOptions,
|
|
26
26
|
SizeOptions,
|
|
27
|
-
} from '
|
|
27
|
+
} from '../../types/floating-ui'
|
|
28
|
+
import type { Placement } from '@/constants'
|
|
28
29
|
|
|
29
30
|
// props, emit and attrs
|
|
30
31
|
const props = defineProps(VvDropdownProps)
|
|
@@ -127,7 +128,7 @@
|
|
|
127
128
|
floatingEl,
|
|
128
129
|
{
|
|
129
130
|
whileElementsMounted: autoUpdate,
|
|
130
|
-
placement: props.placement,
|
|
131
|
+
placement: props.placement as Placement,
|
|
131
132
|
middleware,
|
|
132
133
|
},
|
|
133
134
|
)
|
|
@@ -219,7 +220,7 @@
|
|
|
219
220
|
|
|
220
221
|
// aria
|
|
221
222
|
const hasAriaLabelledby = computed(() => {
|
|
222
|
-
return referenceEl.value?.getAttribute('id') ?? undefined
|
|
223
|
+
return referenceEl.value?.getAttribute?.('id') ?? undefined
|
|
223
224
|
})
|
|
224
225
|
const referenceAria = computed(() => ({
|
|
225
226
|
'aria-controls': hasId.value,
|
|
@@ -242,7 +243,7 @@
|
|
|
242
243
|
const { itemRole } = useProvideDropdownItem({ role, expanded })
|
|
243
244
|
|
|
244
245
|
// styles
|
|
245
|
-
const bemCssClasses =
|
|
246
|
+
const bemCssClasses = useModifiers(
|
|
246
247
|
'vv-dropdown',
|
|
247
248
|
modifiers,
|
|
248
249
|
computed(() => ({
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<script setup lang="ts">
|
|
8
|
-
import VvAction from '
|
|
9
|
-
import VvDropdownItem from '
|
|
10
|
-
import { ActionProps, ModifiersProps } from '
|
|
8
|
+
import VvAction from '../VvAction/VvAction.vue'
|
|
9
|
+
import VvDropdownItem from '../VvDropdown/VvDropdownItem.vue'
|
|
10
|
+
import { ActionProps, ModifiersProps } from '../../props'
|
|
11
11
|
|
|
12
12
|
// props
|
|
13
13
|
const props = defineProps({
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* @returns {Array} The component classes.
|
|
21
21
|
*/
|
|
22
22
|
const { modifiers } = toRefs(props)
|
|
23
|
-
const bemCssClasses =
|
|
23
|
+
const bemCssClasses = useModifiers('vv-dropdown-action', modifiers)
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
26
|
<template>
|
|
@@ -38,7 +38,9 @@
|
|
|
38
38
|
}"
|
|
39
39
|
:class="bemCssClasses"
|
|
40
40
|
>
|
|
41
|
-
<slot
|
|
41
|
+
<slot>
|
|
42
|
+
{{ label }}
|
|
43
|
+
</slot>
|
|
42
44
|
</VvAction>
|
|
43
45
|
</VvDropdownItem>
|
|
44
46
|
</template>
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<script setup lang="ts">
|
|
8
|
-
import VvDropdownItem from '
|
|
8
|
+
import VvDropdownItem from './VvDropdownItem.vue'
|
|
9
9
|
import {
|
|
10
10
|
DisabledProps,
|
|
11
11
|
ModifiersProps,
|
|
12
12
|
SelectedProps,
|
|
13
13
|
UnselectableProps,
|
|
14
|
-
} from '
|
|
14
|
+
} from '../../props'
|
|
15
15
|
|
|
16
16
|
// props
|
|
17
17
|
const props = defineProps({
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
// style
|
|
34
34
|
const { modifiers } = toRefs(props)
|
|
35
|
-
const bemCssClasses =
|
|
35
|
+
const bemCssClasses = useModifiers(
|
|
36
36
|
'vv-dropdown-option',
|
|
37
37
|
modifiers,
|
|
38
38
|
computed(() => ({
|
|
@@ -41,6 +41,18 @@
|
|
|
41
41
|
unselectable: props.unselectable && props.selected,
|
|
42
42
|
})),
|
|
43
43
|
)
|
|
44
|
+
|
|
45
|
+
// hint
|
|
46
|
+
const hintLabel = computed(() => {
|
|
47
|
+
if (props.selected) {
|
|
48
|
+
return props.unselectable
|
|
49
|
+
? props.deselectHintLabel
|
|
50
|
+
: props.selectedHintLabel
|
|
51
|
+
}
|
|
52
|
+
if (!props.disabled) {
|
|
53
|
+
return props.selectHintLabel
|
|
54
|
+
}
|
|
55
|
+
})
|
|
44
56
|
</script>
|
|
45
57
|
|
|
46
58
|
<template>
|
|
@@ -51,14 +63,9 @@
|
|
|
51
63
|
:aria-disabled="disabled"
|
|
52
64
|
>
|
|
53
65
|
<slot />
|
|
54
|
-
<span class="vv-dropdown-option__hint">
|
|
66
|
+
<span class="vv-dropdown-option__hint" :title="hintLabel">
|
|
55
67
|
<slot name="hint" v-bind="{ disabled, selected, unselectable }">
|
|
56
|
-
|
|
57
|
-
{{ unselectable ? deselectHintLabel : selectedHintLabel }}
|
|
58
|
-
</template>
|
|
59
|
-
<template v-else-if="!disabled">
|
|
60
|
-
{{ selectHintLabel }}
|
|
61
|
-
</template>
|
|
68
|
+
{{ hintLabel }}
|
|
62
69
|
</slot>
|
|
63
70
|
</span>
|
|
64
71
|
</VvDropdownItem>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DropdownProps, IdProps, ModifiersProps } from '@/props'
|
|
2
1
|
import type { PropType } from 'vue'
|
|
3
|
-
import {
|
|
2
|
+
import { DropdownProps, IdProps, ModifiersProps } from '../../props'
|
|
3
|
+
import { DropdownRole } from '../../constants'
|
|
4
4
|
|
|
5
5
|
export const VvDropdownProps = {
|
|
6
6
|
...IdProps,
|
|
@@ -24,7 +24,7 @@ export const VvDropdownProps = {
|
|
|
24
24
|
* Dropdown role
|
|
25
25
|
*/
|
|
26
26
|
role: {
|
|
27
|
-
type: String as PropType
|
|
27
|
+
type: String as PropType<`${DropdownRole}`>,
|
|
28
28
|
default: DropdownRole.menu,
|
|
29
29
|
validator: (value: DropdownRole) =>
|
|
30
30
|
Object.values(DropdownRole).includes(value),
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<script setup lang="ts">
|
|
8
8
|
import { Icon, addIcon, iconExists, type IconifyJSON } from '@iconify/vue'
|
|
9
|
-
import { VvIconProps } from '
|
|
9
|
+
import { VvIconProps } from '.'
|
|
10
10
|
|
|
11
11
|
// props
|
|
12
12
|
const props = defineProps(VvIconProps)
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
|
|
20
20
|
// classes
|
|
21
21
|
const { modifiers } = toRefs(props)
|
|
22
|
-
const bemCssClasses =
|
|
22
|
+
const bemCssClasses = useModifiers('vv-icon', modifiers)
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Provider name
|
|
26
26
|
*/
|
|
27
27
|
const provider = computed(() => {
|
|
28
|
-
return props.provider || volver?.
|
|
28
|
+
return props.provider || volver?.iconsProvider
|
|
29
29
|
})
|
|
30
30
|
|
|
31
31
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PropType } from 'vue'
|
|
2
2
|
import type { IconifyRenderMode } from '@iconify/vue'
|
|
3
3
|
|
|
4
|
-
export enum
|
|
4
|
+
export enum IconPrefix {
|
|
5
5
|
simple = 'simple',
|
|
6
6
|
normal = 'normal',
|
|
7
7
|
detailed = 'detailed',
|
|
@@ -46,7 +46,7 @@ export const VvIconProps = {
|
|
|
46
46
|
* Icon default options prefix: simple | normal | detailed
|
|
47
47
|
*/
|
|
48
48
|
prefix: {
|
|
49
|
-
type: String as PropType
|
|
49
|
+
type: String as PropType<`${IconPrefix}` | string>,
|
|
50
50
|
default: 'normal',
|
|
51
51
|
},
|
|
52
52
|
/**
|
|
@@ -74,7 +74,7 @@ export const VvIconProps = {
|
|
|
74
74
|
* 'svg' = svg
|
|
75
75
|
* Iconify doc: https://docs.iconify.design/iconify-icon/modes.html
|
|
76
76
|
*/
|
|
77
|
-
mode: String as PropType
|
|
77
|
+
mode: String as PropType<`${IconifyRenderMode}`>,
|
|
78
78
|
/**
|
|
79
79
|
* Toggles inline or block mode
|
|
80
80
|
* Example https://docs.iconify.design/icon-components/vue/inline.html
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import VvIcon from '
|
|
1
|
+
import VvIcon from '../VvIcon/VvIcon.vue'
|
|
2
2
|
|
|
3
3
|
export default defineComponent({
|
|
4
4
|
components: {
|
|
@@ -34,7 +34,7 @@ export default defineComponent({
|
|
|
34
34
|
render() {
|
|
35
35
|
const icon = h(VvIcon, {
|
|
36
36
|
name: this.icon,
|
|
37
|
-
class: 'vv-input-
|
|
37
|
+
class: 'vv-input-text__icon',
|
|
38
38
|
})
|
|
39
39
|
|
|
40
40
|
return h(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TYPES_ICON } from '
|
|
2
|
-
import VvIcon from '
|
|
1
|
+
import { TYPES_ICON } from '../VvInputText'
|
|
2
|
+
import VvIcon from '../VvIcon/VvIcon.vue'
|
|
3
3
|
|
|
4
4
|
export default defineComponent({
|
|
5
5
|
components: {
|
|
@@ -51,9 +51,8 @@ export default defineComponent({
|
|
|
51
51
|
render() {
|
|
52
52
|
const icon = h(VvIcon, {
|
|
53
53
|
name: this.activeIcon,
|
|
54
|
-
class: 'vv-input-
|
|
54
|
+
class: 'vv-input-text__icon',
|
|
55
55
|
})
|
|
56
|
-
|
|
57
56
|
return h(
|
|
58
57
|
'button',
|
|
59
58
|
{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import VvIcon from '
|
|
1
|
+
import VvIcon from '../VvIcon/VvIcon.vue'
|
|
2
2
|
|
|
3
3
|
export default defineComponent({
|
|
4
4
|
components: {
|
|
@@ -37,11 +37,12 @@ export default defineComponent({
|
|
|
37
37
|
render() {
|
|
38
38
|
return h('button', {
|
|
39
39
|
class: [
|
|
40
|
-
'vv-input-text__action-chevron',
|
|
40
|
+
'vv-input-text__action vv-input-text__action-chevron',
|
|
41
41
|
this.isUp && 'vv-input-text__action-chevron-up',
|
|
42
42
|
],
|
|
43
43
|
disabled: this.disabled,
|
|
44
44
|
ariaLabel: this.label,
|
|
45
|
+
type: 'button',
|
|
45
46
|
onClick: this.onClick,
|
|
46
47
|
})
|
|
47
48
|
},
|