@volverjs/ui-vue 0.0.10-beta.44 → 0.0.10-beta.46
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/VvAvatar/VvAvatar.es.js +1 -6
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +2 -7
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.es.js +1 -6
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +1 -6
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvButton/VvButton.es.js +0 -22
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +1 -6
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvCard/VvCard.es.js +1 -6
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +0 -22
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +0 -22
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +24 -32
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +18 -18
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +8 -8
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +0 -5
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +1 -6
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.es.js +0 -22
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +19 -4
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +3 -3
- package/dist/components/VvNav/VvNav.es.js +0 -5
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +0 -22
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +0 -22
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +2 -2
- package/dist/components/VvTab/VvTab.es.js +0 -5
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/index.es.js +43 -36
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +46 -46
- package/dist/composables/index.es.js +4 -4
- package/dist/composables/index.umd.js +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +217 -33
- package/dist/stories/CheckboxGroup/CheckboxGroup.settings.d.ts +1 -1
- package/dist/stories/Radio/Radio.settings.d.ts +1 -1
- package/dist/stories/RadioGroup/RadioGroup.settings.d.ts +1 -1
- package/package.json +39 -39
- 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 +25 -12
- package/src/components/VvIcon/VvIcon.vue +1 -1
- package/src/components/VvInputText/VvInputText.vue +21 -7
|
@@ -146,15 +146,15 @@ const hasTabindex = computed(() => {
|
|
|
146
146
|
const localModelValue = computed({
|
|
147
147
|
get: () => {
|
|
148
148
|
if (Array.isArray(props.modelValue)) {
|
|
149
|
-
return
|
|
149
|
+
return props.modelValue
|
|
150
150
|
}
|
|
151
|
-
return props.modelValue !== undefined && props.modelValue !== null ?
|
|
151
|
+
return props.modelValue !== undefined && props.modelValue !== null ? [props.modelValue] : []
|
|
152
152
|
},
|
|
153
|
-
set: (value:
|
|
154
|
-
emit('update:modelValue', props.multiple || Array.isArray(props.modelValue) ?
|
|
153
|
+
set: (value: unknown[]) => {
|
|
154
|
+
emit('update:modelValue', props.multiple || Array.isArray(props.modelValue) ? value : value.pop())
|
|
155
155
|
},
|
|
156
156
|
})
|
|
157
|
-
const sizeOfModelValue = computed(() => localModelValue.value.
|
|
157
|
+
const sizeOfModelValue = computed(() => localModelValue.value.length)
|
|
158
158
|
const isDirty = computed(() => sizeOfModelValue.value > 0)
|
|
159
159
|
const hasMaxValues = computed(() => {
|
|
160
160
|
if (!props.multiple) {
|
|
@@ -173,7 +173,7 @@ const isUnselectable = computed(() => {
|
|
|
173
173
|
if (!props.unselectable) {
|
|
174
174
|
return false
|
|
175
175
|
}
|
|
176
|
-
return sizeOfModelValue.value > Number(props.minValues)
|
|
176
|
+
return Number(props.minValues) === 0 || (sizeOfModelValue.value > Number(props.minValues))
|
|
177
177
|
})
|
|
178
178
|
const isSelectable = computed(() => {
|
|
179
179
|
if (isDisabledOrReadonly.value) {
|
|
@@ -247,7 +247,16 @@ const filteredOptions = computedAsync(async () => {
|
|
|
247
247
|
* @param {T} option
|
|
248
248
|
*/
|
|
249
249
|
function isOptionSelected(option: T) {
|
|
250
|
-
|
|
250
|
+
const optionValue = getOptionValue(option)
|
|
251
|
+
if (typeof optionValue === 'object') {
|
|
252
|
+
return localModelValue.value.some((item) => {
|
|
253
|
+
if (typeof item === 'object') {
|
|
254
|
+
return JSON.stringify(item) === JSON.stringify(optionValue)
|
|
255
|
+
}
|
|
256
|
+
return false
|
|
257
|
+
})
|
|
258
|
+
}
|
|
259
|
+
return localModelValue.value.includes(optionValue)
|
|
251
260
|
}
|
|
252
261
|
|
|
253
262
|
/**
|
|
@@ -288,17 +297,21 @@ function onClickInput() {
|
|
|
288
297
|
*/
|
|
289
298
|
function onInput(option: T) {
|
|
290
299
|
const isSelected = isOptionSelected(option)
|
|
300
|
+
const optionValue = getOptionValue(option)
|
|
291
301
|
if (isSelected && isUnselectable.value) {
|
|
292
|
-
localModelValue.value.
|
|
302
|
+
localModelValue.value = localModelValue.value.filter((item) => {
|
|
303
|
+
if (typeof optionValue === 'object' && typeof item === 'object') {
|
|
304
|
+
return JSON.stringify(item) !== JSON.stringify(optionValue)
|
|
305
|
+
}
|
|
306
|
+
return item !== optionValue
|
|
307
|
+
})
|
|
293
308
|
}
|
|
294
309
|
else if (!isSelected && isSelectable.value) {
|
|
295
310
|
if (!props.multiple) {
|
|
296
|
-
localModelValue.value
|
|
311
|
+
localModelValue.value = []
|
|
297
312
|
}
|
|
298
|
-
localModelValue.value.
|
|
313
|
+
localModelValue.value = [...localModelValue.value, optionValue]
|
|
299
314
|
}
|
|
300
|
-
// force reactivity
|
|
301
|
-
localModelValue.value = new Set(localModelValue.value)
|
|
302
315
|
if (!props.multiple && !props.keepOpen) {
|
|
303
316
|
collapse()
|
|
304
317
|
}
|
|
@@ -61,7 +61,7 @@ function getSvgContent(svg: string): SVGSVGElement | undefined {
|
|
|
61
61
|
let dom
|
|
62
62
|
if (typeof window === 'undefined') {
|
|
63
63
|
// SSR
|
|
64
|
-
// eslint-disable-next-line ts/no-
|
|
64
|
+
// eslint-disable-next-line ts/no-require-imports, ts/no-var-requires
|
|
65
65
|
const { JSDOM } = require('jsdom')
|
|
66
66
|
dom = new JSDOM().window
|
|
67
67
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { InputHTMLAttributes } from 'vue'
|
|
3
3
|
import { useIMask } from 'vue-imask'
|
|
4
|
+
import type { MaskedNumberOptions } from 'imask'
|
|
4
5
|
import HintSlotFactory from '../common/HintSlot'
|
|
5
6
|
import VvIcon from '../VvIcon/VvIcon.vue'
|
|
6
7
|
import { ACTION_ICONS } from '../VvIcon'
|
|
@@ -66,10 +67,24 @@ const NEGATIVE_ZERO_REGEX = /^-0?[.,]?[0*]?$/
|
|
|
66
67
|
const maskReady = ref(false)
|
|
67
68
|
const { el, mask, typed, masked, unmasked } = useIMask(
|
|
68
69
|
computed(
|
|
69
|
-
() =>
|
|
70
|
-
props.iMask
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
() => {
|
|
71
|
+
if (!props.iMask) {
|
|
72
|
+
return {
|
|
73
|
+
mask: /./,
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (props.iMask.mask === Number) {
|
|
77
|
+
const toReturn = { ...props.iMask } as MaskedNumberOptions
|
|
78
|
+
if (props.min) {
|
|
79
|
+
toReturn.min = Number(props.min)
|
|
80
|
+
}
|
|
81
|
+
if (props.max) {
|
|
82
|
+
toReturn.max = Number(props.max)
|
|
83
|
+
}
|
|
84
|
+
return toReturn
|
|
85
|
+
}
|
|
86
|
+
return props.iMask
|
|
87
|
+
},
|
|
73
88
|
),
|
|
74
89
|
{
|
|
75
90
|
emit,
|
|
@@ -269,7 +284,7 @@ const isNumber = computed(() => props.type === INPUT_TYPES.NUMBER)
|
|
|
269
284
|
function onStepUp() {
|
|
270
285
|
if (isClickable.value) {
|
|
271
286
|
if (props.iMask) {
|
|
272
|
-
typed.value = typed.value + Number(step?.value ?? 1)
|
|
287
|
+
typed.value = Number(typed.value) + Number(step?.value ?? 1)
|
|
273
288
|
return
|
|
274
289
|
}
|
|
275
290
|
inputEl.value.stepUp()
|
|
@@ -279,8 +294,7 @@ function onStepUp() {
|
|
|
279
294
|
function onStepDown() {
|
|
280
295
|
if (isClickable.value) {
|
|
281
296
|
if (props.iMask) {
|
|
282
|
-
typed.value = typed.value - Number(step?.value ?? 1)
|
|
283
|
-
|
|
297
|
+
typed.value = Number(typed.value) - Number(step?.value ?? 1)
|
|
284
298
|
return
|
|
285
299
|
}
|
|
286
300
|
inputEl.value.stepDown()
|