@volverjs/ui-vue 0.0.6-beta.5 → 0.0.6-beta.7
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/auto-imports.d.ts +9 -0
- package/dist/Volver.d.ts +1 -1
- package/dist/components/VvAccordion/index.d.ts +1 -1
- package/dist/components/VvButton/VvButton.es.js +25 -19
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +151 -98
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +37 -1
- package/dist/components/VvCheckbox/index.d.ts +6 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +187 -101
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +36 -0
- package/dist/components/VvCheckboxGroup/index.d.ts +5 -0
- package/dist/components/VvCombobox/VvCombobox.es.js +236 -140
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +25 -1
- package/dist/components/VvDialog/VvDialog.es.js +25 -19
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +19 -4
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +8 -4
- package/dist/components/VvDropdown/index.d.ts +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +25 -19
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.vue.d.ts +2 -2
- package/dist/components/VvIcon/index.d.ts +2 -2
- package/dist/components/VvInputText/VvInputText.es.js +160 -136
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +24 -0
- package/dist/components/VvRadio/VvRadio.es.js +151 -98
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +37 -1
- package/dist/components/VvRadio/index.d.ts +6 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +187 -101
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +36 -0
- package/dist/components/VvRadioGroup/index.d.ts +5 -0
- package/dist/components/VvSelect/VvSelect.es.js +163 -137
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +24 -0
- package/dist/components/VvTextarea/VvTextarea.es.js +160 -136
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +24 -0
- package/dist/components/common/HintSlot.d.ts +38 -12
- package/dist/components/index.es.js +466 -168
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/group/useInjectedGroupState.d.ts +1 -1
- package/dist/composables/useOptions.d.ts +2 -2
- package/dist/directives/index.d.ts +2 -2
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/props/index.d.ts +22 -0
- package/package.json +33 -33
- 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/VvCheckbox/VvCheckbox.vue +23 -2
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +15 -2
- package/src/components/VvCombobox/VvCombobox.vue +40 -16
- package/src/components/VvDropdown/VvDropdown.vue +20 -2
- package/src/components/VvIcon/VvIcon.vue +37 -34
- package/src/components/VvIcon/index.ts +2 -2
- package/src/components/VvInputText/VvInputText.vue +26 -9
- package/src/components/VvRadio/VvRadio.vue +23 -2
- package/src/components/VvRadioGroup/VvRadioGroup.vue +15 -2
- package/src/components/VvSelect/VvSelect.vue +26 -9
- package/src/components/VvTextarea/VvTextarea.vue +26 -9
- package/src/components/common/HintSlot.ts +129 -170
- package/src/composables/useOptions.ts +9 -7
- package/src/props/index.ts +2 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { unref, inject, computed, toRef, toRefs, defineComponent, useAttrs, ref, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, renderSlot, normalizeProps, guardReactiveProps, createTextVNode, toDisplayString, isRef, provide, watchEffect, watch, Fragment, renderList, createBlock, mergeProps, withCtx, resolveDynamicComponent, createCommentVNode, useSlots, h, onMounted, withDirectives, vModelCheckbox, createVNode, nextTick, Transition, normalizeStyle, vShow, vModelSelect,
|
|
1
|
+
import { unref, inject, computed, toRef, toRefs, defineComponent, useAttrs, ref, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, renderSlot, normalizeProps, guardReactiveProps, createTextVNode, toDisplayString, isRef, provide, watchEffect, watch, Fragment, renderList, createBlock, mergeProps, withCtx, resolveDynamicComponent, createCommentVNode, useSlots, h, onMounted, withDirectives, vModelCheckbox, createVNode, createSlots, nextTick, Transition, toHandlers, normalizeStyle, vShow, vModelSelect, vModelText, vModelDynamic, vModelRadio } from "vue";
|
|
2
2
|
import { nanoid } from "nanoid";
|
|
3
|
-
import { useToggle, useStorage,
|
|
3
|
+
import { useToggle, useStorage, useVModel, onClickOutside, useFocusWithin, onKeyStroke, useElementHover, useFocus, useElementVisibility, refDebounced } from "@vueuse/core";
|
|
4
4
|
import { iconExists, Icon, addIcon } from "@iconify/vue";
|
|
5
5
|
import { autoPlacement, flip, shift, size, offset, arrow, useFloating, autoUpdate } from "@floating-ui/vue";
|
|
6
6
|
import mitt from "mitt";
|
|
@@ -916,6 +916,7 @@ const CheckboxRadioProps = {
|
|
|
916
916
|
...ReadonlyProps,
|
|
917
917
|
...ModifiersProps,
|
|
918
918
|
...LabelProps,
|
|
919
|
+
...LoadingProps,
|
|
919
920
|
/**
|
|
920
921
|
* Input value
|
|
921
922
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value
|
|
@@ -935,6 +936,7 @@ const CheckboxRadioGroupProps = {
|
|
|
935
936
|
...ReadonlyProps,
|
|
936
937
|
...ModifiersProps,
|
|
937
938
|
...LabelProps,
|
|
939
|
+
...LoadingProps,
|
|
938
940
|
/**
|
|
939
941
|
* Input value
|
|
940
942
|
*/
|
|
@@ -1153,6 +1155,12 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
1153
1155
|
props: VvIconProps,
|
|
1154
1156
|
setup(__props) {
|
|
1155
1157
|
const props = __props;
|
|
1158
|
+
const hasRotate = computed(() => {
|
|
1159
|
+
if (typeof props.rotate === "string") {
|
|
1160
|
+
return parseFloat(props.rotate);
|
|
1161
|
+
}
|
|
1162
|
+
return props.rotate;
|
|
1163
|
+
});
|
|
1156
1164
|
const show = ref(true);
|
|
1157
1165
|
const volver = useVolver();
|
|
1158
1166
|
const { modifiers } = toRefs(props);
|
|
@@ -1161,25 +1169,24 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
1161
1169
|
return props.provider || (volver == null ? void 0 : volver.iconsProvider);
|
|
1162
1170
|
});
|
|
1163
1171
|
const icon = computed(() => {
|
|
1164
|
-
const
|
|
1165
|
-
const iconName = `@${provider.value}:${props.prefix}:${
|
|
1166
|
-
if (iconExists(
|
|
1167
|
-
return _name;
|
|
1168
|
-
} else if (iconExists(iconName)) {
|
|
1172
|
+
const name = props.name ?? "";
|
|
1173
|
+
const iconName = `@${provider.value}:${props.prefix}:${name}`;
|
|
1174
|
+
if (iconExists(iconName)) {
|
|
1169
1175
|
return iconName;
|
|
1170
|
-
} else {
|
|
1171
|
-
return (volver == null ? void 0 : volver.iconsCollections.find(
|
|
1172
|
-
(iconsCollection) => {
|
|
1173
|
-
const icon2 = `@${provider.value}:${iconsCollection.prefix}:${_name}`;
|
|
1174
|
-
if (iconExists(icon2)) {
|
|
1175
|
-
return icon2;
|
|
1176
|
-
}
|
|
1177
|
-
}
|
|
1178
|
-
)) || _name;
|
|
1179
1176
|
}
|
|
1177
|
+
const iconsCollection = volver == null ? void 0 : volver.iconsCollections.find(
|
|
1178
|
+
(iconsCollection2) => {
|
|
1179
|
+
const icon2 = `@${provider.value}:${iconsCollection2.prefix}:${name}`;
|
|
1180
|
+
return iconExists(icon2);
|
|
1181
|
+
}
|
|
1182
|
+
);
|
|
1183
|
+
if (iconsCollection) {
|
|
1184
|
+
return `@${provider.value}:${iconsCollection.prefix}:${name}`;
|
|
1185
|
+
}
|
|
1186
|
+
return name;
|
|
1180
1187
|
});
|
|
1181
1188
|
function getSvgContent(svg) {
|
|
1182
|
-
let dom
|
|
1189
|
+
let dom;
|
|
1183
1190
|
if (typeof window === "undefined") {
|
|
1184
1191
|
const { JSDOM } = require("jsdom");
|
|
1185
1192
|
dom = new JSDOM().window;
|
|
@@ -1210,12 +1217,13 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
1210
1217
|
show.value = true;
|
|
1211
1218
|
}
|
|
1212
1219
|
}).catch((e) => {
|
|
1213
|
-
throw new Error(`
|
|
1220
|
+
throw new Error(`Error during fetch icon: ${e == null ? void 0 : e.message}`);
|
|
1214
1221
|
});
|
|
1215
|
-
} else if (props.svg) {
|
|
1216
|
-
addIconFromSvg(props.svg);
|
|
1217
1222
|
}
|
|
1218
1223
|
}
|
|
1224
|
+
if (props.svg) {
|
|
1225
|
+
addIconFromSvg(props.svg);
|
|
1226
|
+
}
|
|
1219
1227
|
return (_ctx, _cache) => {
|
|
1220
1228
|
return unref(show) ? (openBlock(), createBlock(unref(Icon), mergeProps({
|
|
1221
1229
|
key: 0,
|
|
@@ -1227,7 +1235,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
1227
1235
|
horizontalFlip: _ctx.horizontalFlip,
|
|
1228
1236
|
verticalFlip: _ctx.verticalFlip,
|
|
1229
1237
|
flip: _ctx.flip,
|
|
1230
|
-
rotate:
|
|
1238
|
+
rotate: unref(hasRotate),
|
|
1231
1239
|
color: _ctx.color,
|
|
1232
1240
|
onLoad: _ctx.onLoad,
|
|
1233
1241
|
icon: unref(icon)
|
|
@@ -1769,115 +1777,118 @@ function useGroupProps$1(props, emit) {
|
|
|
1769
1777
|
disabled
|
|
1770
1778
|
};
|
|
1771
1779
|
}
|
|
1772
|
-
function joinLines(
|
|
1773
|
-
if (Array.isArray(
|
|
1774
|
-
return
|
|
1780
|
+
function joinLines(items) {
|
|
1781
|
+
if (Array.isArray(items)) {
|
|
1782
|
+
return items.filter((item) => isString(item)).join(" ");
|
|
1775
1783
|
}
|
|
1776
|
-
return
|
|
1784
|
+
return items;
|
|
1777
1785
|
}
|
|
1778
|
-
function HintSlotFactory(
|
|
1779
|
-
const
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
const {
|
|
1786
|
-
hintLabel,
|
|
1787
|
-
modelValue,
|
|
1788
|
-
valid,
|
|
1789
|
-
validLabel,
|
|
1790
|
-
invalid,
|
|
1791
|
-
invalidLabel,
|
|
1792
|
-
...otherProps
|
|
1793
|
-
} = toRefs(parentProps);
|
|
1794
|
-
const loading = resolveFieldData(otherProps, "loading");
|
|
1795
|
-
const loadingLabel = resolveFieldData(otherProps, "loadingLabel");
|
|
1796
|
-
const hasInvalid = computed(() => {
|
|
1797
|
-
if (!invalid.value) {
|
|
1798
|
-
return false;
|
|
1799
|
-
}
|
|
1800
|
-
if (invalid.value && invalidSlot) {
|
|
1801
|
-
return true;
|
|
1802
|
-
}
|
|
1803
|
-
if ((invalidLabel == null ? void 0 : invalidLabel.value) && Array.isArray(invalidLabel.value) && invalidLabel.value.length > 0) {
|
|
1804
|
-
return true;
|
|
1805
|
-
}
|
|
1806
|
-
if ((invalidLabel == null ? void 0 : invalidLabel.value) && !isEmpty(invalidLabel)) {
|
|
1807
|
-
return true;
|
|
1808
|
-
}
|
|
1809
|
-
return false;
|
|
1810
|
-
});
|
|
1811
|
-
const hasHint = computed(
|
|
1812
|
-
() => !!(hintLabel && hintLabel.value || hintSlot)
|
|
1786
|
+
function HintSlotFactory(props, slots) {
|
|
1787
|
+
const invalidLabel = computed(() => joinLines(props.invalidLabel));
|
|
1788
|
+
const validLabel = computed(() => joinLines(props.validLabel));
|
|
1789
|
+
const loadingLabel = computed(() => props.loadingLabel);
|
|
1790
|
+
const hintLabel = computed(() => props.hintLabel);
|
|
1791
|
+
const hasLoadingLabelOrSlot = computed(
|
|
1792
|
+
() => Boolean(props.loading && (slots.loading || loadingLabel.value))
|
|
1813
1793
|
);
|
|
1814
|
-
const
|
|
1815
|
-
() =>
|
|
1794
|
+
const hasInvalidLabelOrSlot = computed(
|
|
1795
|
+
() => !hasLoadingLabelOrSlot.value && Boolean(props.invalid && (slots.invalid || invalidLabel.value))
|
|
1816
1796
|
);
|
|
1817
|
-
const
|
|
1818
|
-
() =>
|
|
1797
|
+
const hasValidLabelOrSlot = computed(
|
|
1798
|
+
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.valid && (slots.valid || validLabel.value))
|
|
1799
|
+
);
|
|
1800
|
+
const hasHintLabelOrSlot = computed(
|
|
1801
|
+
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && !hasValidLabelOrSlot.value && Boolean(slots.hint || hintLabel.value)
|
|
1819
1802
|
);
|
|
1820
1803
|
const isVisible = computed(
|
|
1821
|
-
() =>
|
|
1804
|
+
() => hasInvalidLabelOrSlot.value || hasValidLabelOrSlot.value || hasLoadingLabelOrSlot.value || hasHintLabelOrSlot.value
|
|
1822
1805
|
);
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1806
|
+
const hintSlotScope = computed(() => ({
|
|
1807
|
+
modelValue: props.modelValue,
|
|
1808
|
+
valid: props.valid,
|
|
1809
|
+
invalid: props.invalid,
|
|
1810
|
+
loading: props.loading
|
|
1811
|
+
}));
|
|
1812
|
+
const HintSlot = defineComponent({
|
|
1813
|
+
name: "HintSlot",
|
|
1814
|
+
props: {
|
|
1815
|
+
tag: {
|
|
1816
|
+
type: String,
|
|
1817
|
+
default: "small"
|
|
1818
|
+
}
|
|
1819
|
+
},
|
|
1820
|
+
setup() {
|
|
1821
|
+
return {
|
|
1822
|
+
isVisible,
|
|
1823
|
+
invalidLabel,
|
|
1824
|
+
validLabel,
|
|
1825
|
+
loadingLabel,
|
|
1826
|
+
hintLabel,
|
|
1827
|
+
hasInvalidLabelOrSlot,
|
|
1828
|
+
hasValidLabelOrSlot,
|
|
1829
|
+
hasLoadingLabelOrSlot,
|
|
1830
|
+
hasHintLabelOrSlot
|
|
1831
|
+
};
|
|
1832
|
+
},
|
|
1833
|
+
render() {
|
|
1834
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1835
|
+
if (this.isVisible) {
|
|
1836
|
+
let role;
|
|
1837
|
+
if (this.hasInvalidLabelOrSlot) {
|
|
1838
|
+
role = "alert";
|
|
1834
1839
|
}
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
});
|
|
1849
|
-
if (invalid == null ? void 0 : invalid.value) {
|
|
1850
|
-
return (invalidSlot == null ? void 0 : invalidSlot(slotProps)) || joinLines(invalidLabel == null ? void 0 : invalidLabel.value) || (hintLabel == null ? void 0 : hintLabel.value);
|
|
1851
|
-
}
|
|
1852
|
-
if (valid == null ? void 0 : valid.value)
|
|
1853
|
-
return (validSlot == null ? void 0 : validSlot(slotProps)) || joinLines(validLabel == null ? void 0 : validLabel.value) || (hintLabel == null ? void 0 : hintLabel.value);
|
|
1854
|
-
if (loading == null ? void 0 : loading.value)
|
|
1855
|
-
return (loadingSlot == null ? void 0 : loadingSlot(slotProps)) || joinLines(loadingLabel == null ? void 0 : loadingLabel.value) || (hintLabel == null ? void 0 : hintLabel.value);
|
|
1856
|
-
return (hintSlot == null ? void 0 : hintSlot(slotProps)) || joinLines(hintLabel == null ? void 0 : hintLabel.value) || (hintLabel == null ? void 0 : hintLabel.value);
|
|
1857
|
-
});
|
|
1858
|
-
return {
|
|
1859
|
-
isVisible,
|
|
1860
|
-
hasInvalid,
|
|
1861
|
-
hasValid,
|
|
1862
|
-
hintContent
|
|
1863
|
-
};
|
|
1864
|
-
},
|
|
1865
|
-
render() {
|
|
1866
|
-
if (this.isVisible) {
|
|
1840
|
+
if (this.hasValidLabelOrSlot) {
|
|
1841
|
+
role = "status";
|
|
1842
|
+
}
|
|
1843
|
+
if (this.hasLoadingLabelOrSlot) {
|
|
1844
|
+
return h(
|
|
1845
|
+
this.tag,
|
|
1846
|
+
{
|
|
1847
|
+
role
|
|
1848
|
+
},
|
|
1849
|
+
((_b = (_a = this.$slots).loading) == null ? void 0 : _b.call(_a)) ?? this.loadingLabel
|
|
1850
|
+
);
|
|
1851
|
+
}
|
|
1852
|
+
if (this.hasInvalidLabelOrSlot) {
|
|
1867
1853
|
return h(
|
|
1868
|
-
|
|
1854
|
+
this.tag,
|
|
1869
1855
|
{
|
|
1870
|
-
role
|
|
1856
|
+
role
|
|
1871
1857
|
},
|
|
1872
|
-
this.
|
|
1858
|
+
((_d = (_c = this.$slots).invalid) == null ? void 0 : _d.call(_c)) ?? this.$slots.invalid ?? this.invalidLabel
|
|
1873
1859
|
);
|
|
1874
1860
|
}
|
|
1861
|
+
if (this.hasValidLabelOrSlot) {
|
|
1862
|
+
return h(
|
|
1863
|
+
this.tag,
|
|
1864
|
+
{
|
|
1865
|
+
role
|
|
1866
|
+
},
|
|
1867
|
+
((_f = (_e = this.$slots).valid) == null ? void 0 : _f.call(_e)) ?? this.validLabel
|
|
1868
|
+
);
|
|
1869
|
+
}
|
|
1870
|
+
return h(
|
|
1871
|
+
this.tag,
|
|
1872
|
+
{
|
|
1873
|
+
role
|
|
1874
|
+
},
|
|
1875
|
+
((_h = (_g = this.$slots).hint) == null ? void 0 : _h.call(_g)) ?? this.$slots.hint ?? this.hintLabel
|
|
1876
|
+
);
|
|
1875
1877
|
}
|
|
1878
|
+
return null;
|
|
1876
1879
|
}
|
|
1880
|
+
});
|
|
1881
|
+
return {
|
|
1882
|
+
hasInvalidLabelOrSlot,
|
|
1883
|
+
hasHintLabelOrSlot,
|
|
1884
|
+
hasValidLabelOrSlot,
|
|
1885
|
+
hasLoadingLabelOrSlot,
|
|
1886
|
+
hintSlotScope,
|
|
1887
|
+
HintSlot
|
|
1877
1888
|
};
|
|
1878
1889
|
}
|
|
1879
1890
|
const _hoisted_1$b = ["for"];
|
|
1880
|
-
const _hoisted_2$8 = ["id", "name", "disabled", "value", "tabindex", "aria-invalid"];
|
|
1891
|
+
const _hoisted_2$8 = ["id", "name", "disabled", "value", "tabindex", "aria-invalid", "aria-describedby", "aria-errormessage"];
|
|
1881
1892
|
const __default__$d = {
|
|
1882
1893
|
name: "VvCheckbox"
|
|
1883
1894
|
};
|
|
@@ -1900,6 +1911,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
1900
1911
|
isInGroup
|
|
1901
1912
|
} = useGroupProps$1(props, emit);
|
|
1902
1913
|
const hasId = useUniqueId(id);
|
|
1914
|
+
const hasHintId = computed(() => `${hasId.value}-hint`);
|
|
1903
1915
|
const tabindex = computed(() => isDisabled.value ? -1 : props.tabindex);
|
|
1904
1916
|
const input = ref();
|
|
1905
1917
|
const isBinary = computed(
|
|
@@ -1994,7 +2006,12 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
1994
2006
|
input.value.indeterminate = true;
|
|
1995
2007
|
}
|
|
1996
2008
|
});
|
|
1997
|
-
const {
|
|
2009
|
+
const {
|
|
2010
|
+
HintSlot,
|
|
2011
|
+
hasHintLabelOrSlot,
|
|
2012
|
+
hasInvalidLabelOrSlot,
|
|
2013
|
+
hintSlotScope
|
|
2014
|
+
} = HintSlotFactory(props, slots);
|
|
1998
2015
|
return (_ctx, _cache) => {
|
|
1999
2016
|
return openBlock(), createElementBlock("label", {
|
|
2000
2017
|
class: normalizeClass(unref(bemCssClasses)),
|
|
@@ -2011,7 +2028,9 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
2011
2028
|
disabled: unref(isDisabled),
|
|
2012
2029
|
value: unref(hasValue),
|
|
2013
2030
|
tabindex: unref(tabindex),
|
|
2014
|
-
"aria-invalid": unref(isInvalid)
|
|
2031
|
+
"aria-invalid": unref(isInvalid),
|
|
2032
|
+
"aria-describedby": unref(hasHintLabelOrSlot) ? unref(hasHintId) : void 0,
|
|
2033
|
+
"aria-errormessage": unref(hasInvalidLabelOrSlot) ? unref(hasHintId) : void 0
|
|
2015
2034
|
}, null, 8, _hoisted_2$8), [
|
|
2016
2035
|
[vModelCheckbox, unref(localModelValue)]
|
|
2017
2036
|
]),
|
|
@@ -2019,9 +2038,38 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
2019
2038
|
createTextVNode(toDisplayString(_ctx.label), 1)
|
|
2020
2039
|
]),
|
|
2021
2040
|
createVNode(unref(HintSlot), {
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
},
|
|
2041
|
+
id: unref(hasHintId),
|
|
2042
|
+
class: "vv-checkbox__hint"
|
|
2043
|
+
}, createSlots({ _: 2 }, [
|
|
2044
|
+
_ctx.$slots.hint ? {
|
|
2045
|
+
name: "hint",
|
|
2046
|
+
fn: withCtx(() => [
|
|
2047
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
2048
|
+
]),
|
|
2049
|
+
key: "0"
|
|
2050
|
+
} : void 0,
|
|
2051
|
+
_ctx.$slots.loading ? {
|
|
2052
|
+
name: "loading",
|
|
2053
|
+
fn: withCtx(() => [
|
|
2054
|
+
renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
2055
|
+
]),
|
|
2056
|
+
key: "1"
|
|
2057
|
+
} : void 0,
|
|
2058
|
+
_ctx.$slots.valid ? {
|
|
2059
|
+
name: "valid",
|
|
2060
|
+
fn: withCtx(() => [
|
|
2061
|
+
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
2062
|
+
]),
|
|
2063
|
+
key: "2"
|
|
2064
|
+
} : void 0,
|
|
2065
|
+
_ctx.$slots.invalid ? {
|
|
2066
|
+
name: "invalid",
|
|
2067
|
+
fn: withCtx(() => [
|
|
2068
|
+
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
2069
|
+
]),
|
|
2070
|
+
key: "3"
|
|
2071
|
+
} : void 0
|
|
2072
|
+
]), 1032, ["id"])
|
|
2025
2073
|
], 10, _hoisted_1$b);
|
|
2026
2074
|
};
|
|
2027
2075
|
}
|
|
@@ -2033,7 +2081,9 @@ function useOptions(props) {
|
|
|
2033
2081
|
const getOptionLabel = (option) => {
|
|
2034
2082
|
if (typeof option !== "object" && option !== null)
|
|
2035
2083
|
return option;
|
|
2036
|
-
return
|
|
2084
|
+
return String(
|
|
2085
|
+
typeof labelKey.value === "function" ? labelKey.value(option) : option[labelKey.value]
|
|
2086
|
+
);
|
|
2037
2087
|
};
|
|
2038
2088
|
const getOptionValue = (option) => {
|
|
2039
2089
|
if (typeof option !== "object" && option !== null)
|
|
@@ -2100,7 +2150,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
2100
2150
|
value: getOptionValue(option)
|
|
2101
2151
|
};
|
|
2102
2152
|
};
|
|
2103
|
-
const { HintSlot } = HintSlotFactory(props, slots);
|
|
2153
|
+
const { HintSlot, hintSlotScope } = HintSlotFactory(props, slots);
|
|
2104
2154
|
return (_ctx, _cache) => {
|
|
2105
2155
|
return openBlock(), createElementBlock("fieldset", {
|
|
2106
2156
|
class: normalizeClass(unref(bemCssClasses))
|
|
@@ -2114,7 +2164,36 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
2114
2164
|
return openBlock(), createBlock(_sfc_main$d, mergeProps({ key: index }, getOptionProps(option, index)), null, 16);
|
|
2115
2165
|
}), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 })
|
|
2116
2166
|
]),
|
|
2117
|
-
createVNode(unref(HintSlot), { class: "vv-checkbox-group__hint" }
|
|
2167
|
+
createVNode(unref(HintSlot), { class: "vv-checkbox-group__hint" }, createSlots({ _: 2 }, [
|
|
2168
|
+
_ctx.$slots.hint ? {
|
|
2169
|
+
name: "hint",
|
|
2170
|
+
fn: withCtx(() => [
|
|
2171
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
2172
|
+
]),
|
|
2173
|
+
key: "0"
|
|
2174
|
+
} : void 0,
|
|
2175
|
+
_ctx.$slots.loading ? {
|
|
2176
|
+
name: "loading",
|
|
2177
|
+
fn: withCtx(() => [
|
|
2178
|
+
renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
2179
|
+
]),
|
|
2180
|
+
key: "1"
|
|
2181
|
+
} : void 0,
|
|
2182
|
+
_ctx.$slots.valid ? {
|
|
2183
|
+
name: "valid",
|
|
2184
|
+
fn: withCtx(() => [
|
|
2185
|
+
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
2186
|
+
]),
|
|
2187
|
+
key: "2"
|
|
2188
|
+
} : void 0,
|
|
2189
|
+
_ctx.$slots.invalid ? {
|
|
2190
|
+
name: "invalid",
|
|
2191
|
+
fn: withCtx(() => [
|
|
2192
|
+
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
2193
|
+
]),
|
|
2194
|
+
key: "3"
|
|
2195
|
+
} : void 0
|
|
2196
|
+
]), 1024)
|
|
2118
2197
|
], 2);
|
|
2119
2198
|
};
|
|
2120
2199
|
}
|
|
@@ -2332,7 +2411,13 @@ const __default__$b = {
|
|
|
2332
2411
|
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
2333
2412
|
...__default__$b,
|
|
2334
2413
|
props: VvDropdownProps,
|
|
2335
|
-
emits: [
|
|
2414
|
+
emits: [
|
|
2415
|
+
"update:modelValue",
|
|
2416
|
+
"beforeExpand",
|
|
2417
|
+
"beforeCollapse",
|
|
2418
|
+
"afterExpand",
|
|
2419
|
+
"afterCollapse"
|
|
2420
|
+
],
|
|
2336
2421
|
setup(__props, { expose, emit }) {
|
|
2337
2422
|
const props = __props;
|
|
2338
2423
|
const { id } = toRefs(props);
|
|
@@ -2603,6 +2688,12 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2603
2688
|
activeElement.click();
|
|
2604
2689
|
}
|
|
2605
2690
|
});
|
|
2691
|
+
const onTransitionBeforeEnter = () => {
|
|
2692
|
+
emit(expanded.value ? "beforeExpand" : "beforeCollapse");
|
|
2693
|
+
};
|
|
2694
|
+
const onTransitionAfterLeave = () => {
|
|
2695
|
+
emit(expanded.value ? "afterExpand" : "afterCollapse");
|
|
2696
|
+
};
|
|
2606
2697
|
return (_ctx, _cache) => {
|
|
2607
2698
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
2608
2699
|
createVNode(unref(VvDropdownTriggerProvider), null, {
|
|
@@ -2611,7 +2702,10 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2611
2702
|
]),
|
|
2612
2703
|
_: 3
|
|
2613
2704
|
}),
|
|
2614
|
-
createVNode(Transition, { name: _ctx.transitionName }, {
|
|
2705
|
+
createVNode(Transition, mergeProps({ name: _ctx.transitionName }, toHandlers({
|
|
2706
|
+
beforeEnter: onTransitionBeforeEnter,
|
|
2707
|
+
onAfterLeave: onTransitionAfterLeave
|
|
2708
|
+
})), {
|
|
2615
2709
|
default: withCtx(() => [
|
|
2616
2710
|
withDirectives(createElementVNode("div", {
|
|
2617
2711
|
ref_key: "floatingEl",
|
|
@@ -2646,7 +2740,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2646
2740
|
])
|
|
2647
2741
|
]),
|
|
2648
2742
|
_: 3
|
|
2649
|
-
},
|
|
2743
|
+
}, 16, ["name"])
|
|
2650
2744
|
], 64);
|
|
2651
2745
|
};
|
|
2652
2746
|
}
|
|
@@ -2883,7 +2977,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
2883
2977
|
const props = __props;
|
|
2884
2978
|
const slots = useSlots();
|
|
2885
2979
|
const select = ref();
|
|
2886
|
-
const {
|
|
2980
|
+
const {
|
|
2981
|
+
HintSlot,
|
|
2982
|
+
hasHintLabelOrSlot,
|
|
2983
|
+
hasInvalidLabelOrSlot,
|
|
2984
|
+
hintSlotScope
|
|
2985
|
+
} = HintSlotFactory(props, slots);
|
|
2887
2986
|
const {
|
|
2888
2987
|
id,
|
|
2889
2988
|
modifiers,
|
|
@@ -2898,7 +2997,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
2898
2997
|
multiple
|
|
2899
2998
|
} = toRefs(props);
|
|
2900
2999
|
const hasId = useUniqueId(id);
|
|
2901
|
-
const
|
|
3000
|
+
const hasHintId = computed(() => `${hasId.value}-hint`);
|
|
2902
3001
|
const { focused } = useComponentFocus(select, emit);
|
|
2903
3002
|
const isVisible = useElementVisibility(select);
|
|
2904
3003
|
watch(isVisible, (newValue) => {
|
|
@@ -2951,8 +3050,8 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
2951
3050
|
autocomplete: props.autocomplete,
|
|
2952
3051
|
multiple: props.multiple,
|
|
2953
3052
|
"aria-invalid": isInvalid.value,
|
|
2954
|
-
"aria-describedby":
|
|
2955
|
-
"aria-errormessage":
|
|
3053
|
+
"aria-describedby": hasHintLabelOrSlot.value ? hasHintId.value : void 0,
|
|
3054
|
+
"aria-errormessage": hasInvalidLabelOrSlot.value ? hasHintId.value : void 0
|
|
2956
3055
|
};
|
|
2957
3056
|
});
|
|
2958
3057
|
const slotProps = computed(() => ({
|
|
@@ -3045,9 +3144,38 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
3045
3144
|
])) : createCommentVNode("", true)
|
|
3046
3145
|
]),
|
|
3047
3146
|
createVNode(unref(HintSlot), {
|
|
3048
|
-
id: unref(
|
|
3147
|
+
id: unref(hasHintId),
|
|
3049
3148
|
class: "vv-select__hint"
|
|
3050
|
-
},
|
|
3149
|
+
}, createSlots({ _: 2 }, [
|
|
3150
|
+
_ctx.$slots.hint ? {
|
|
3151
|
+
name: "hint",
|
|
3152
|
+
fn: withCtx(() => [
|
|
3153
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
3154
|
+
]),
|
|
3155
|
+
key: "0"
|
|
3156
|
+
} : void 0,
|
|
3157
|
+
_ctx.$slots.loading ? {
|
|
3158
|
+
name: "loading",
|
|
3159
|
+
fn: withCtx(() => [
|
|
3160
|
+
renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
3161
|
+
]),
|
|
3162
|
+
key: "1"
|
|
3163
|
+
} : void 0,
|
|
3164
|
+
_ctx.$slots.valid ? {
|
|
3165
|
+
name: "valid",
|
|
3166
|
+
fn: withCtx(() => [
|
|
3167
|
+
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
3168
|
+
]),
|
|
3169
|
+
key: "2"
|
|
3170
|
+
} : void 0,
|
|
3171
|
+
_ctx.$slots.invalid ? {
|
|
3172
|
+
name: "invalid",
|
|
3173
|
+
fn: withCtx(() => [
|
|
3174
|
+
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
3175
|
+
]),
|
|
3176
|
+
key: "3"
|
|
3177
|
+
} : void 0
|
|
3178
|
+
]), 1032, ["id"])
|
|
3051
3179
|
], 2);
|
|
3052
3180
|
};
|
|
3053
3181
|
}
|
|
@@ -3107,13 +3235,13 @@ function useDefaults(componentName, propsDefinition, props) {
|
|
|
3107
3235
|
}
|
|
3108
3236
|
const _hoisted_1$5 = ["id"];
|
|
3109
3237
|
const _hoisted_2$5 = ["id", "for"];
|
|
3110
|
-
const _hoisted_3$3 = ["id", "aria-controls", "
|
|
3238
|
+
const _hoisted_3$3 = ["id", "aria-controls", "placeholder"];
|
|
3111
3239
|
const _hoisted_4$2 = {
|
|
3112
3240
|
key: 0,
|
|
3113
3241
|
class: "vv-select__input-before"
|
|
3114
3242
|
};
|
|
3115
3243
|
const _hoisted_5$2 = { class: "vv-select__inner" };
|
|
3116
|
-
const _hoisted_6$2 = ["aria-labelledby", "tabindex"];
|
|
3244
|
+
const _hoisted_6$2 = ["aria-expanded", "aria-labelledby", "aria-describedby", "aria-errormessage", "tabindex"];
|
|
3117
3245
|
const _hoisted_7$2 = ["aria-label", "onClick"];
|
|
3118
3246
|
const _hoisted_8$1 = {
|
|
3119
3247
|
key: 1,
|
|
@@ -3141,7 +3269,12 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3141
3269
|
}
|
|
3142
3270
|
return option.options && option.options.length > 0;
|
|
3143
3271
|
};
|
|
3144
|
-
const {
|
|
3272
|
+
const {
|
|
3273
|
+
HintSlot,
|
|
3274
|
+
hasHintLabelOrSlot,
|
|
3275
|
+
hasInvalidLabelOrSlot,
|
|
3276
|
+
hintSlotScope
|
|
3277
|
+
} = HintSlotFactory(props, slots);
|
|
3145
3278
|
const inputEl = ref(null);
|
|
3146
3279
|
const inputSearchEl = ref(null);
|
|
3147
3280
|
const wrapperEl = ref(null);
|
|
@@ -3189,19 +3322,18 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3189
3322
|
return;
|
|
3190
3323
|
expanded.value = false;
|
|
3191
3324
|
};
|
|
3192
|
-
|
|
3325
|
+
const onAfterExpand = () => {
|
|
3193
3326
|
if (searchable.value) {
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
inputSearchEl.value.focus();
|
|
3198
|
-
}
|
|
3199
|
-
return;
|
|
3200
|
-
}
|
|
3201
|
-
searchText.value = "";
|
|
3202
|
-
});
|
|
3327
|
+
if (inputSearchEl.value) {
|
|
3328
|
+
inputSearchEl.value.focus();
|
|
3329
|
+
}
|
|
3203
3330
|
}
|
|
3204
|
-
}
|
|
3331
|
+
};
|
|
3332
|
+
const onAfterCollapse = () => {
|
|
3333
|
+
if (searchable.value) {
|
|
3334
|
+
searchText.value = "";
|
|
3335
|
+
}
|
|
3336
|
+
};
|
|
3205
3337
|
const {
|
|
3206
3338
|
id,
|
|
3207
3339
|
icon,
|
|
@@ -3404,7 +3536,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3404
3536
|
modelValue: unref(expanded),
|
|
3405
3537
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(expanded) ? expanded.value = $event : null)
|
|
3406
3538
|
}, unref(dropdownProps), {
|
|
3407
|
-
role: unref(DropdownRole).listbox
|
|
3539
|
+
role: unref(DropdownRole).listbox,
|
|
3540
|
+
onAfterExpand,
|
|
3541
|
+
onAfterCollapse
|
|
3408
3542
|
}), createSlots({
|
|
3409
3543
|
default: withCtx(({ aria }) => [
|
|
3410
3544
|
_ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_4$2, [
|
|
@@ -3419,9 +3553,12 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3419
3553
|
ref_key: "inputEl",
|
|
3420
3554
|
ref: inputEl
|
|
3421
3555
|
}, aria, {
|
|
3422
|
-
"aria-labelledby": unref(hasLabelId),
|
|
3423
3556
|
class: "vv-select__input",
|
|
3424
3557
|
role: "combobox",
|
|
3558
|
+
"aria-expanded": unref(expanded),
|
|
3559
|
+
"aria-labelledby": unref(hasLabelId),
|
|
3560
|
+
"aria-describedby": unref(hasHintLabelOrSlot) ? unref(hasHintId) : void 0,
|
|
3561
|
+
"aria-errormessage": unref(hasInvalidLabelOrSlot) ? unref(hasHintId) : void 0,
|
|
3425
3562
|
tabindex: unref(hasTabindex),
|
|
3426
3563
|
onClickPassive: onClickInput
|
|
3427
3564
|
}), [
|
|
@@ -3557,8 +3694,6 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3557
3694
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(searchText) ? searchText.value = $event : null),
|
|
3558
3695
|
"aria-autocomplete": "list",
|
|
3559
3696
|
"aria-controls": unref(hasDropdownId),
|
|
3560
|
-
"aria-labelledby": unref(hasLabelId),
|
|
3561
|
-
"aria-describedby": unref(hasHintId),
|
|
3562
3697
|
autocomplete: "off",
|
|
3563
3698
|
spellcheck: "false",
|
|
3564
3699
|
type: "search",
|
|
@@ -3583,7 +3718,36 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
3583
3718
|
createVNode(unref(HintSlot), {
|
|
3584
3719
|
id: unref(hasHintId),
|
|
3585
3720
|
class: "vv-select__hint"
|
|
3586
|
-
},
|
|
3721
|
+
}, createSlots({ _: 2 }, [
|
|
3722
|
+
_ctx.$slots.hint ? {
|
|
3723
|
+
name: "hint",
|
|
3724
|
+
fn: withCtx(() => [
|
|
3725
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
3726
|
+
]),
|
|
3727
|
+
key: "0"
|
|
3728
|
+
} : void 0,
|
|
3729
|
+
_ctx.$slots.loading ? {
|
|
3730
|
+
name: "loading",
|
|
3731
|
+
fn: withCtx(() => [
|
|
3732
|
+
renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
3733
|
+
]),
|
|
3734
|
+
key: "1"
|
|
3735
|
+
} : void 0,
|
|
3736
|
+
_ctx.$slots.valid ? {
|
|
3737
|
+
name: "valid",
|
|
3738
|
+
fn: withCtx(() => [
|
|
3739
|
+
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
3740
|
+
]),
|
|
3741
|
+
key: "2"
|
|
3742
|
+
} : void 0,
|
|
3743
|
+
_ctx.$slots.invalid ? {
|
|
3744
|
+
name: "invalid",
|
|
3745
|
+
fn: withCtx(() => [
|
|
3746
|
+
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
3747
|
+
]),
|
|
3748
|
+
key: "3"
|
|
3749
|
+
} : void 0
|
|
3750
|
+
]), 1032, ["id"])
|
|
3587
3751
|
], 10, _hoisted_1$5)) : (openBlock(), createBlock(_sfc_main$7, mergeProps({ key: 1 }, unref(selectProps), {
|
|
3588
3752
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => emit("update:modelValue", $event))
|
|
3589
3753
|
}), null, 16));
|
|
@@ -4251,7 +4415,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4251
4415
|
loading
|
|
4252
4416
|
} = toRefs(props);
|
|
4253
4417
|
const hasId = useUniqueId(id);
|
|
4254
|
-
const
|
|
4418
|
+
const hasHintId = computed(() => `${hasId.value}-hint`);
|
|
4255
4419
|
const inputTextPlaceholder = computed(
|
|
4256
4420
|
() => props.floating && isEmpty(props.placeholder) ? " " : props.placeholder
|
|
4257
4421
|
);
|
|
@@ -4387,8 +4551,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4387
4551
|
required: props.required,
|
|
4388
4552
|
autocomplete: props.autocomplete,
|
|
4389
4553
|
"aria-invalid": isInvalid.value,
|
|
4390
|
-
"aria-describedby":
|
|
4391
|
-
"aria-errormessage":
|
|
4554
|
+
"aria-describedby": hasHintLabelOrSlot.value ? hasHintId.value : void 0,
|
|
4555
|
+
"aria-errormessage": hasInvalidLabelOrSlot.value ? hasHintId.value : void 0
|
|
4392
4556
|
};
|
|
4393
4557
|
if (type === INPUT_TYPES.DATE || type === INPUT_TYPES.MONTH || type === INPUT_TYPES.WEEK || type === INPUT_TYPES.TIME || type === INPUT_TYPES.DATETIME_LOCAL || type === INPUT_TYPES.NUMBER) {
|
|
4394
4558
|
toReturn.step = props.step;
|
|
@@ -4417,7 +4581,12 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4417
4581
|
stepDown: onStepDown,
|
|
4418
4582
|
clear: onClear
|
|
4419
4583
|
}));
|
|
4420
|
-
const {
|
|
4584
|
+
const {
|
|
4585
|
+
HintSlot,
|
|
4586
|
+
hasHintLabelOrSlot,
|
|
4587
|
+
hasInvalidLabelOrSlot,
|
|
4588
|
+
hintSlotScope
|
|
4589
|
+
} = HintSlotFactory(props, slots);
|
|
4421
4590
|
const PasswordInputActions = VvInputTextActionsFactory(
|
|
4422
4591
|
INPUT_TYPES.PASSWORD,
|
|
4423
4592
|
props
|
|
@@ -4532,9 +4701,38 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
4532
4701
|
])) : createCommentVNode("", true)
|
|
4533
4702
|
]),
|
|
4534
4703
|
createVNode(unref(HintSlot), {
|
|
4535
|
-
id: unref(
|
|
4704
|
+
id: unref(hasHintId),
|
|
4536
4705
|
class: "vv-input-text__hint"
|
|
4537
|
-
},
|
|
4706
|
+
}, createSlots({ _: 2 }, [
|
|
4707
|
+
_ctx.$slots.hint ? {
|
|
4708
|
+
name: "hint",
|
|
4709
|
+
fn: withCtx(() => [
|
|
4710
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
4711
|
+
]),
|
|
4712
|
+
key: "0"
|
|
4713
|
+
} : void 0,
|
|
4714
|
+
_ctx.$slots.loading ? {
|
|
4715
|
+
name: "loading",
|
|
4716
|
+
fn: withCtx(() => [
|
|
4717
|
+
renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
4718
|
+
]),
|
|
4719
|
+
key: "1"
|
|
4720
|
+
} : void 0,
|
|
4721
|
+
_ctx.$slots.valid ? {
|
|
4722
|
+
name: "valid",
|
|
4723
|
+
fn: withCtx(() => [
|
|
4724
|
+
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
4725
|
+
]),
|
|
4726
|
+
key: "2"
|
|
4727
|
+
} : void 0,
|
|
4728
|
+
_ctx.$slots.invalid ? {
|
|
4729
|
+
name: "invalid",
|
|
4730
|
+
fn: withCtx(() => [
|
|
4731
|
+
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
4732
|
+
]),
|
|
4733
|
+
key: "3"
|
|
4734
|
+
} : void 0
|
|
4735
|
+
]), 1032, ["id"])
|
|
4538
4736
|
], 2);
|
|
4539
4737
|
};
|
|
4540
4738
|
}
|
|
@@ -4629,7 +4827,7 @@ function useGroupProps(props, emit) {
|
|
|
4629
4827
|
};
|
|
4630
4828
|
}
|
|
4631
4829
|
const _hoisted_1$2 = ["for"];
|
|
4632
|
-
const _hoisted_2$2 = ["id", "name", "disabled", "value", "tabindex", "aria-invalid"];
|
|
4830
|
+
const _hoisted_2$2 = ["id", "name", "disabled", "value", "tabindex", "aria-invalid", "aria-describedby", "aria-errormessage"];
|
|
4633
4831
|
const __default__$2 = {
|
|
4634
4832
|
name: "VvRadio"
|
|
4635
4833
|
};
|
|
@@ -4642,6 +4840,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
4642
4840
|
const slots = useSlots();
|
|
4643
4841
|
const { id, disabled, readonly, modelValue, valid, invalid } = useGroupProps(props, emit);
|
|
4644
4842
|
const hasId = useUniqueId(id);
|
|
4843
|
+
const hasHintId = computed(() => `${hasId.value}-hint`);
|
|
4645
4844
|
const tabindex = computed(() => isDisabled.value ? -1 : props.tabindex);
|
|
4646
4845
|
const input = ref();
|
|
4647
4846
|
const isDisabled = computed(() => disabled.value || readonly.value);
|
|
@@ -4684,7 +4883,12 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
4684
4883
|
readonly: readonly.value
|
|
4685
4884
|
}))
|
|
4686
4885
|
);
|
|
4687
|
-
const {
|
|
4886
|
+
const {
|
|
4887
|
+
HintSlot,
|
|
4888
|
+
hasHintLabelOrSlot,
|
|
4889
|
+
hasInvalidLabelOrSlot,
|
|
4890
|
+
hintSlotScope
|
|
4891
|
+
} = HintSlotFactory(props, slots);
|
|
4688
4892
|
return (_ctx, _cache) => {
|
|
4689
4893
|
return openBlock(), createElementBlock("label", {
|
|
4690
4894
|
class: normalizeClass(unref(bemCssClasses)),
|
|
@@ -4701,7 +4905,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
4701
4905
|
disabled: unref(isDisabled),
|
|
4702
4906
|
value: unref(hasValue),
|
|
4703
4907
|
tabindex: unref(tabindex),
|
|
4704
|
-
"aria-invalid": unref(isInvalid)
|
|
4908
|
+
"aria-invalid": unref(isInvalid),
|
|
4909
|
+
"aria-describedby": unref(hasHintLabelOrSlot) ? unref(hasHintId) : void 0,
|
|
4910
|
+
"aria-errormessage": unref(hasInvalidLabelOrSlot) ? unref(hasHintId) : void 0
|
|
4705
4911
|
}, null, 8, _hoisted_2$2), [
|
|
4706
4912
|
[vModelRadio, unref(localModelValue)]
|
|
4707
4913
|
]),
|
|
@@ -4709,9 +4915,38 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
4709
4915
|
createTextVNode(toDisplayString(_ctx.label), 1)
|
|
4710
4916
|
]),
|
|
4711
4917
|
createVNode(unref(HintSlot), {
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
},
|
|
4918
|
+
id: unref(hasHintId),
|
|
4919
|
+
class: "vv-radio__hint"
|
|
4920
|
+
}, createSlots({ _: 2 }, [
|
|
4921
|
+
_ctx.$slots.hint ? {
|
|
4922
|
+
name: "hint",
|
|
4923
|
+
fn: withCtx(() => [
|
|
4924
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
4925
|
+
]),
|
|
4926
|
+
key: "0"
|
|
4927
|
+
} : void 0,
|
|
4928
|
+
_ctx.$slots.loading ? {
|
|
4929
|
+
name: "loading",
|
|
4930
|
+
fn: withCtx(() => [
|
|
4931
|
+
renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
4932
|
+
]),
|
|
4933
|
+
key: "1"
|
|
4934
|
+
} : void 0,
|
|
4935
|
+
_ctx.$slots.valid ? {
|
|
4936
|
+
name: "valid",
|
|
4937
|
+
fn: withCtx(() => [
|
|
4938
|
+
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
4939
|
+
]),
|
|
4940
|
+
key: "2"
|
|
4941
|
+
} : void 0,
|
|
4942
|
+
_ctx.$slots.invalid ? {
|
|
4943
|
+
name: "invalid",
|
|
4944
|
+
fn: withCtx(() => [
|
|
4945
|
+
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
4946
|
+
]),
|
|
4947
|
+
key: "3"
|
|
4948
|
+
} : void 0
|
|
4949
|
+
]), 1032, ["id"])
|
|
4715
4950
|
], 10, _hoisted_1$2);
|
|
4716
4951
|
};
|
|
4717
4952
|
}
|
|
@@ -4760,7 +4995,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
4760
4995
|
value: getOptionValue(option)
|
|
4761
4996
|
};
|
|
4762
4997
|
};
|
|
4763
|
-
const { HintSlot } = HintSlotFactory(props, slots);
|
|
4998
|
+
const { HintSlot, hintSlotScope } = HintSlotFactory(props, slots);
|
|
4764
4999
|
return (_ctx, _cache) => {
|
|
4765
5000
|
return openBlock(), createElementBlock("fieldset", {
|
|
4766
5001
|
class: normalizeClass(unref(bemCssClasses))
|
|
@@ -4774,7 +5009,36 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
4774
5009
|
return openBlock(), createBlock(_sfc_main$2, mergeProps({ key: index }, getOptionProps(option, index)), null, 16);
|
|
4775
5010
|
}), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 })
|
|
4776
5011
|
]),
|
|
4777
|
-
createVNode(unref(HintSlot), { class: "vv-radio-group__hint" }
|
|
5012
|
+
createVNode(unref(HintSlot), { class: "vv-radio-group__hint" }, createSlots({ _: 2 }, [
|
|
5013
|
+
_ctx.$slots.hint ? {
|
|
5014
|
+
name: "hint",
|
|
5015
|
+
fn: withCtx(() => [
|
|
5016
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
5017
|
+
]),
|
|
5018
|
+
key: "0"
|
|
5019
|
+
} : void 0,
|
|
5020
|
+
_ctx.$slots.loading ? {
|
|
5021
|
+
name: "loading",
|
|
5022
|
+
fn: withCtx(() => [
|
|
5023
|
+
renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
5024
|
+
]),
|
|
5025
|
+
key: "1"
|
|
5026
|
+
} : void 0,
|
|
5027
|
+
_ctx.$slots.valid ? {
|
|
5028
|
+
name: "valid",
|
|
5029
|
+
fn: withCtx(() => [
|
|
5030
|
+
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
5031
|
+
]),
|
|
5032
|
+
key: "2"
|
|
5033
|
+
} : void 0,
|
|
5034
|
+
_ctx.$slots.invalid ? {
|
|
5035
|
+
name: "invalid",
|
|
5036
|
+
fn: withCtx(() => [
|
|
5037
|
+
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
5038
|
+
]),
|
|
5039
|
+
key: "3"
|
|
5040
|
+
} : void 0
|
|
5041
|
+
]), 1024)
|
|
4778
5042
|
], 2);
|
|
4779
5043
|
};
|
|
4780
5044
|
}
|
|
@@ -4861,7 +5125,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4861
5125
|
modifiers
|
|
4862
5126
|
} = toRefs(props);
|
|
4863
5127
|
const hasId = useUniqueId(id);
|
|
4864
|
-
const
|
|
5128
|
+
const hasHintId = computed(() => `${hasId.value}-hint`);
|
|
4865
5129
|
const hasPlaceholder = computed(
|
|
4866
5130
|
() => props.floating && isEmpty(props.placeholder) ? " " : props.placeholder
|
|
4867
5131
|
);
|
|
@@ -4896,7 +5160,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4896
5160
|
}
|
|
4897
5161
|
return void 0;
|
|
4898
5162
|
});
|
|
4899
|
-
const {
|
|
5163
|
+
const {
|
|
5164
|
+
HintSlot,
|
|
5165
|
+
hasHintLabelOrSlot,
|
|
5166
|
+
hasInvalidLabelOrSlot,
|
|
5167
|
+
hintSlotScope
|
|
5168
|
+
} = HintSlotFactory(props, slots);
|
|
4900
5169
|
const bemCssClasses = useModifiers(
|
|
4901
5170
|
"vv-textarea",
|
|
4902
5171
|
modifiers,
|
|
@@ -4930,8 +5199,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4930
5199
|
wrap: props.wrap,
|
|
4931
5200
|
spellcheck: props.spellcheck,
|
|
4932
5201
|
"aria-invalid": isInvalid.value,
|
|
4933
|
-
"aria-describedby":
|
|
4934
|
-
"aria-errormessage":
|
|
5202
|
+
"aria-describedby": hasHintLabelOrSlot.value ? hasHintId.value : void 0,
|
|
5203
|
+
"aria-errormessage": hasInvalidLabelOrSlot.value ? hasHintId.value : void 0
|
|
4935
5204
|
})
|
|
4936
5205
|
);
|
|
4937
5206
|
const slotProps = computed(() => ({
|
|
@@ -4989,9 +5258,38 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4989
5258
|
])) : createCommentVNode("", true)
|
|
4990
5259
|
]),
|
|
4991
5260
|
createVNode(unref(HintSlot), {
|
|
4992
|
-
id: unref(
|
|
5261
|
+
id: unref(hasHintId),
|
|
4993
5262
|
class: "vv-textarea__hint"
|
|
4994
|
-
},
|
|
5263
|
+
}, createSlots({ _: 2 }, [
|
|
5264
|
+
_ctx.$slots.hint ? {
|
|
5265
|
+
name: "hint",
|
|
5266
|
+
fn: withCtx(() => [
|
|
5267
|
+
renderSlot(_ctx.$slots, "hint", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
5268
|
+
]),
|
|
5269
|
+
key: "0"
|
|
5270
|
+
} : void 0,
|
|
5271
|
+
_ctx.$slots.loading ? {
|
|
5272
|
+
name: "loading",
|
|
5273
|
+
fn: withCtx(() => [
|
|
5274
|
+
renderSlot(_ctx.$slots, "loading", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
5275
|
+
]),
|
|
5276
|
+
key: "1"
|
|
5277
|
+
} : void 0,
|
|
5278
|
+
_ctx.$slots.valid ? {
|
|
5279
|
+
name: "valid",
|
|
5280
|
+
fn: withCtx(() => [
|
|
5281
|
+
renderSlot(_ctx.$slots, "valid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
5282
|
+
]),
|
|
5283
|
+
key: "2"
|
|
5284
|
+
} : void 0,
|
|
5285
|
+
_ctx.$slots.invalid ? {
|
|
5286
|
+
name: "invalid",
|
|
5287
|
+
fn: withCtx(() => [
|
|
5288
|
+
renderSlot(_ctx.$slots, "invalid", normalizeProps(guardReactiveProps(unref(hintSlotScope))))
|
|
5289
|
+
]),
|
|
5290
|
+
key: "3"
|
|
5291
|
+
} : void 0
|
|
5292
|
+
]), 1032, ["id"])
|
|
4995
5293
|
], 2);
|
|
4996
5294
|
};
|
|
4997
5295
|
}
|