@volverjs/ui-vue 0.0.9-beta.8 → 0.0.9-beta.9
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/VvAlertGroup/VvAlertGroup.vue.d.ts +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +20 -13
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +20 -13
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +20 -13
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.es.js +21 -20
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +2 -2
- package/dist/components/VvInputText/VvInputText.es.js +20 -13
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +20 -13
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +20 -13
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.es.js +20 -13
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +20 -13
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/index.es.js +44 -36
- package/dist/components/index.umd.js +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/resolvers/unplugin.es.js +3 -0
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +1 -1
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +7 -7
- package/package.json +34 -34
- 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/VvAlertGroup/VvAlertGroup.vue +2 -0
- package/src/components/VvDialog/VvDialog.vue +10 -11
- package/src/components/common/HintSlot.ts +20 -12
- package/src/resolvers/unplugin.ts +3 -0
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
import { useVvAlertGroup, VvAlertGroupEvents, VvAlertGroupProps } from '.'
|
|
9
9
|
import VvAlert from '../VvAlert/VvAlert.vue'
|
|
10
10
|
|
|
11
|
+
// props and emit
|
|
11
12
|
const props = defineProps(VvAlertGroupProps)
|
|
12
13
|
const emit = defineEmits(VvAlertGroupEvents)
|
|
14
|
+
|
|
13
15
|
const { hasProps, hasTransition } = useVvAlertGroup(props, emit)
|
|
14
16
|
|
|
15
17
|
const alertGroupTransitionHandlers = {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
// data
|
|
18
18
|
const modelValue = useVModel(props, 'modelValue', emit)
|
|
19
19
|
const localModelValue = ref(false)
|
|
20
|
-
const
|
|
20
|
+
const isOpened = computed({
|
|
21
21
|
get: () => modelValue.value ?? localModelValue.value,
|
|
22
22
|
set: (newValue) => {
|
|
23
23
|
if (modelValue.value === undefined) {
|
|
@@ -80,37 +80,36 @@
|
|
|
80
80
|
|
|
81
81
|
// methods
|
|
82
82
|
onClickOutside(modalWrapper, () => {
|
|
83
|
-
if (!props.keepOpen
|
|
84
|
-
|
|
83
|
+
if (!props.keepOpen) {
|
|
84
|
+
close()
|
|
85
85
|
}
|
|
86
86
|
})
|
|
87
87
|
|
|
88
88
|
function close() {
|
|
89
|
-
|
|
89
|
+
isOpened.value = false
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
function open() {
|
|
93
|
-
|
|
93
|
+
isOpened.value = true
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
defineExpose({ close, open })
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (opened.value) {
|
|
101
|
-
e.preventDefault()
|
|
98
|
+
const onCancel = () => {
|
|
99
|
+
if (!props.keepOpen) {
|
|
102
100
|
close()
|
|
103
101
|
}
|
|
104
|
-
}
|
|
102
|
+
}
|
|
105
103
|
</script>
|
|
106
104
|
|
|
107
105
|
<template>
|
|
108
106
|
<Transition :name="transitioName" v-on="dialogTransitionHandlers">
|
|
109
107
|
<dialog
|
|
110
|
-
v-show="
|
|
108
|
+
v-show="isOpened"
|
|
111
109
|
v-bind="dialogAttrs"
|
|
112
110
|
ref="dialogEl"
|
|
113
111
|
:class="dialogClass"
|
|
112
|
+
@cancel.stop.prevent="onCancel"
|
|
114
113
|
>
|
|
115
114
|
<article ref="modalWrapper" class="vv-dialog__wrapper">
|
|
116
115
|
<header v-if="$slots.header || title" class="vv-dialog__header">
|
|
@@ -40,27 +40,35 @@ export function HintSlotFactory(
|
|
|
40
40
|
propsOrRef: HintSlotProps | Ref<HintSlotProps>,
|
|
41
41
|
slots: Slots,
|
|
42
42
|
) {
|
|
43
|
-
const props =
|
|
43
|
+
const props = computed(() => {
|
|
44
|
+
if (isRef(propsOrRef)) {
|
|
45
|
+
return propsOrRef.value
|
|
46
|
+
}
|
|
47
|
+
return propsOrRef
|
|
48
|
+
})
|
|
49
|
+
|
|
44
50
|
// label
|
|
45
|
-
const invalidLabel = computed(() => joinLines(props.invalidLabel))
|
|
46
|
-
const validLabel = computed(() => joinLines(props.validLabel))
|
|
47
|
-
const loadingLabel = computed(() => props.loadingLabel)
|
|
48
|
-
const hintLabel = computed(() => props.hintLabel)
|
|
51
|
+
const invalidLabel = computed(() => joinLines(props.value.invalidLabel))
|
|
52
|
+
const validLabel = computed(() => joinLines(props.value.validLabel))
|
|
53
|
+
const loadingLabel = computed(() => props.value.loadingLabel)
|
|
54
|
+
const hintLabel = computed(() => props.value.hintLabel)
|
|
49
55
|
|
|
50
56
|
// type
|
|
51
57
|
const hasLoadingLabelOrSlot = computed(() =>
|
|
52
|
-
Boolean(props.loading && (slots.loading || loadingLabel.value)),
|
|
58
|
+
Boolean(props.value.loading && (slots.loading || loadingLabel.value)),
|
|
53
59
|
)
|
|
54
60
|
const hasInvalidLabelOrSlot = computed(
|
|
55
61
|
() =>
|
|
56
62
|
!hasLoadingLabelOrSlot.value &&
|
|
57
|
-
Boolean(
|
|
63
|
+
Boolean(
|
|
64
|
+
props.value.invalid && (slots.invalid || invalidLabel.value),
|
|
65
|
+
),
|
|
58
66
|
)
|
|
59
67
|
const hasValidLabelOrSlot = computed(
|
|
60
68
|
() =>
|
|
61
69
|
!hasLoadingLabelOrSlot.value &&
|
|
62
70
|
!hasInvalidLabelOrSlot.value &&
|
|
63
|
-
Boolean(props.valid && (slots.valid || validLabel.value)),
|
|
71
|
+
Boolean(props.value.valid && (slots.valid || validLabel.value)),
|
|
64
72
|
)
|
|
65
73
|
const hasHintLabelOrSlot = computed(
|
|
66
74
|
() =>
|
|
@@ -77,10 +85,10 @@ export function HintSlotFactory(
|
|
|
77
85
|
hasHintLabelOrSlot.value,
|
|
78
86
|
)
|
|
79
87
|
const hintSlotScope = computed(() => ({
|
|
80
|
-
modelValue: props.modelValue,
|
|
81
|
-
valid: props.valid,
|
|
82
|
-
invalid: props.invalid,
|
|
83
|
-
loading: props.loading,
|
|
88
|
+
modelValue: props.value.modelValue,
|
|
89
|
+
valid: props.value.valid,
|
|
90
|
+
invalid: props.value.invalid,
|
|
91
|
+
loading: props.value.loading,
|
|
84
92
|
}))
|
|
85
93
|
// component
|
|
86
94
|
const HintSlot = defineComponent({
|
|
@@ -60,6 +60,9 @@ export const getStyleNames = function (kebabName: string) {
|
|
|
60
60
|
'vv-dropdown-action',
|
|
61
61
|
]
|
|
62
62
|
}
|
|
63
|
+
if (kebabName === 'vv-button-group') {
|
|
64
|
+
return ['vv-button', 'vv-button-group']
|
|
65
|
+
}
|
|
63
66
|
if (kebabName === 'vv-accordion-group') {
|
|
64
67
|
return ['vv-accordion', 'vv-accordion-group']
|
|
65
68
|
}
|