@volverjs/ui-vue 0.0.8 → 0.0.9-beta.10
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 +4 -4
- package/auto-imports.d.ts +2 -0
- package/dist/components/VvAccordion/VvAccordion.es.js +7 -0
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +7 -0
- package/dist/components/VvAction/VvAction.es.js +9 -1
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +9 -0
- package/dist/components/VvAction/index.d.ts +4 -0
- package/dist/components/VvAlert/VvAlert.es.js +14 -6
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +6 -6
- package/dist/components/VvAlert/index.d.ts +3 -3
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +54 -10
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAvatar/VvAvatar.es.js +7 -0
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +7 -0
- package/dist/components/VvBadge/VvBadge.es.js +7 -0
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +7 -0
- package/dist/components/VvButton/VvButton.es.js +11 -2
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +9 -0
- package/dist/components/VvButton/index.d.ts +4 -0
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +7 -0
- package/dist/components/VvCard/VvCard.es.js +7 -0
- package/dist/components/VvCheckbox/VvCheckbox.es.js +91 -14
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +4 -4
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +97 -15
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +4 -4
- package/dist/components/VvCombobox/VvCombobox.es.js +164 -94
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +35 -14
- package/dist/components/VvCombobox/index.d.ts +24 -7
- package/dist/components/VvDialog/VvDialog.es.js +67 -27
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +58 -20
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +13 -12
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +9 -0
- package/dist/components/VvDropdown/index.d.ts +1 -7
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +9 -1
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +7 -0
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +7 -0
- package/dist/components/VvInputText/VvInputText.es.js +87 -14
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +4 -4
- package/dist/components/VvNav/VvNav.es.js +10 -2
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/index.d.ts +1 -1
- package/dist/components/VvProgress/VvProgress.es.js +7 -0
- package/dist/components/VvRadio/VvRadio.es.js +91 -14
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +4 -4
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +97 -15
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +4 -4
- package/dist/components/VvSelect/VvSelect.es.js +87 -14
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +4 -4
- package/dist/components/VvTab/VvTab.es.js +10 -2
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +87 -14
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +4 -4
- package/dist/components/VvTooltip/VvTooltip.es.js +7 -0
- package/dist/components/common/HintSlot.d.ts +4 -3
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.es.js +958 -431
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +27 -0
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.es.js +81 -0
- package/dist/composables/index.umd.js +1 -0
- package/dist/constants.d.ts +10 -0
- package/dist/directives/index.es.js +7 -0
- package/dist/directives/v-tooltip.es.js +7 -0
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/props/index.d.ts +7 -0
- package/dist/resolvers/unplugin.es.js +3 -0
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +43 -258
- package/dist/stories/Alert/Alert.settings.d.ts +3 -7
- package/dist/stories/AlertGroup/AlertGroupSlots.stories.d.ts +2 -2
- package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +6 -0
- package/dist/stories/Button/Button.settings.d.ts +3 -13
- package/dist/stories/Combobox/Combobox.settings.d.ts +117 -19
- package/dist/stories/Nav/Nav.settings.d.ts +3 -21
- package/package.json +54 -46
- 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/VvAction/VvAction.vue +2 -1
- package/src/components/VvAlert/VvAlert.vue +5 -1
- package/src/components/VvAlert/index.ts +3 -3
- package/src/components/VvAlertGroup/VvAlertGroup.vue +30 -0
- package/src/components/VvAlertGroup/index.ts +11 -1
- package/src/components/VvButton/VvButton.vue +1 -0
- package/src/components/VvCheckbox/VvCheckbox.vue +8 -1
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +8 -1
- package/src/components/VvCombobox/VvCombobox.vue +9 -4
- package/src/components/VvCombobox/index.ts +24 -0
- package/src/components/VvDialog/VvDialog.vue +36 -17
- package/src/components/VvDialog/index.ts +13 -1
- package/src/components/VvDropdown/VvDropdown.vue +44 -15
- package/src/components/VvDropdown/index.ts +2 -8
- package/src/components/VvInputText/VvInputText.vue +8 -1
- package/src/components/VvNav/VvNav.vue +1 -1
- package/src/components/VvNav/index.ts +1 -1
- package/src/components/VvRadio/VvRadio.vue +8 -1
- package/src/components/VvRadioGroup/VvRadioGroup.vue +8 -1
- package/src/components/VvSelect/VvSelect.vue +8 -1
- package/src/components/VvTextarea/VvTextarea.vue +8 -1
- package/src/components/common/HintSlot.ts +26 -13
- package/src/components/index.ts +5 -0
- package/src/composables/alert/useAlert.ts +103 -0
- package/src/composables/index.ts +1 -0
- package/src/constants.ts +21 -0
- package/src/props/index.ts +7 -0
- package/src/resolvers/unplugin.ts +3 -0
- package/src/stories/Alert/Alert.settings.ts +3 -1
- package/src/stories/AlertGroup/AlertGroup.test.ts +13 -0
- package/src/stories/AlertGroup/AlertGroupSlots.stories.ts +3 -3
- package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +118 -0
- package/src/stories/Button/Button.settings.ts +5 -3
- package/src/stories/Combobox/Combobox.settings.ts +119 -2
- package/src/stories/Nav/Nav.settings.ts +3 -1
- package/src/stories/Tab/Tab.stories.ts +3 -3
- package/src/stories/Textarea/TextareaLength.stories.ts +1 -1
- package/src/types/alert.d.ts +20 -0
- /package/dist/components/{VvNavItemTitle → VvNav}/VvNavItemTitle.vue.d.ts +0 -0
- /package/dist/components/{VvNavSeparator → VvNav}/VvNavSeparator.d.ts +0 -0
- /package/src/components/{VvNavItemTitle → VvNav}/VvNavItemTitle.vue +0 -0
- /package/src/components/{VvNavSeparator → VvNav}/VvNavSeparator.ts +0 -0
|
@@ -97,25 +97,25 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
97
97
|
}, {}>, {
|
|
98
98
|
default?(_: {}): any;
|
|
99
99
|
hint?(_: {
|
|
100
|
-
modelValue:
|
|
100
|
+
modelValue: unknown;
|
|
101
101
|
valid: boolean;
|
|
102
102
|
invalid: boolean;
|
|
103
103
|
loading: boolean;
|
|
104
104
|
}): any;
|
|
105
105
|
loading?(_: {
|
|
106
|
-
modelValue:
|
|
106
|
+
modelValue: unknown;
|
|
107
107
|
valid: boolean;
|
|
108
108
|
invalid: boolean;
|
|
109
109
|
loading: boolean;
|
|
110
110
|
}): any;
|
|
111
111
|
valid?(_: {
|
|
112
|
-
modelValue:
|
|
112
|
+
modelValue: unknown;
|
|
113
113
|
valid: boolean;
|
|
114
114
|
invalid: boolean;
|
|
115
115
|
loading: boolean;
|
|
116
116
|
}): any;
|
|
117
117
|
invalid?(_: {
|
|
118
|
-
modelValue:
|
|
118
|
+
modelValue: unknown;
|
|
119
119
|
valid: boolean;
|
|
120
120
|
invalid: boolean;
|
|
121
121
|
loading: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { inject, computed, unref, defineComponent, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, provide, h, Fragment, useAttrs, onMounted, watch, nextTick, createElementBlock, createVNode, withCtx, renderSlot, normalizeProps, guardReactiveProps, Transition, toHandlers, withDirectives, createElementVNode, normalizeStyle, normalizeClass, vShow, createTextVNode, toDisplayString,
|
|
1
|
+
import { inject, computed, unref, defineComponent, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, provide, h, Fragment, useAttrs, onMounted, watch, nextTick, createElementBlock, createVNode, withCtx, renderSlot, normalizeProps, guardReactiveProps, Transition, toHandlers, withDirectives, createElementVNode, normalizeStyle, normalizeClass, vShow, createTextVNode, toDisplayString, isRef, useSlots, renderList, vModelSelect, createSlots, resolveDynamicComponent, toRef, withModifiers, vModelText } from "vue";
|
|
2
2
|
import { iconExists, Icon, addIcon } from "@iconify/vue";
|
|
3
3
|
import { autoPlacement, flip, shift, size, offset, arrow, useFloating, autoUpdate } from "@floating-ui/vue";
|
|
4
4
|
import { nanoid } from "nanoid";
|
|
@@ -374,6 +374,13 @@ const ActionProps = {
|
|
|
374
374
|
type: String,
|
|
375
375
|
default: ButtonType.button,
|
|
376
376
|
validator: (value) => Object.values(ButtonType).includes(value)
|
|
377
|
+
},
|
|
378
|
+
/**
|
|
379
|
+
* Button aria-label
|
|
380
|
+
*/
|
|
381
|
+
ariaLabel: {
|
|
382
|
+
type: String,
|
|
383
|
+
default: void 0
|
|
377
384
|
}
|
|
378
385
|
};
|
|
379
386
|
const VvComboboxEvents = [
|
|
@@ -398,6 +405,13 @@ const VvComboboxProps = {
|
|
|
398
405
|
...UnselectableProps,
|
|
399
406
|
...DropdownProps,
|
|
400
407
|
...LabelProps,
|
|
408
|
+
/**
|
|
409
|
+
* Dropdown show / hide transition name
|
|
410
|
+
*/
|
|
411
|
+
transitionName: {
|
|
412
|
+
type: String,
|
|
413
|
+
default: "vv-dropdown--mobile-fade-block"
|
|
414
|
+
},
|
|
401
415
|
/**
|
|
402
416
|
* modelValue can be a string, number, boolean, object or array of string, number, boolean, object
|
|
403
417
|
*/
|
|
@@ -429,6 +443,10 @@ const VvComboboxProps = {
|
|
|
429
443
|
* Label for deselected option hint
|
|
430
444
|
*/
|
|
431
445
|
deselectHintLabel: { type: String, default: "Press enter to remove" },
|
|
446
|
+
/**
|
|
447
|
+
* Label close button
|
|
448
|
+
*/
|
|
449
|
+
closeLabel: { type: String, default: "Close" },
|
|
432
450
|
/**
|
|
433
451
|
* Select input placeholder
|
|
434
452
|
*/
|
|
@@ -437,6 +455,13 @@ const VvComboboxProps = {
|
|
|
437
455
|
* Use input text to search on options
|
|
438
456
|
*/
|
|
439
457
|
searchable: Boolean,
|
|
458
|
+
/**
|
|
459
|
+
* Search function to filter options
|
|
460
|
+
*/
|
|
461
|
+
searchFunction: {
|
|
462
|
+
type: Function,
|
|
463
|
+
default: void 0
|
|
464
|
+
},
|
|
440
465
|
/**
|
|
441
466
|
* On searchable select is the input search placeholder
|
|
442
467
|
*/
|
|
@@ -726,13 +751,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
726
751
|
const VvDropdownProps = {
|
|
727
752
|
...IdProps,
|
|
728
753
|
...DropdownProps,
|
|
729
|
-
|
|
730
|
-
* Component BEM modifiers
|
|
731
|
-
*/
|
|
732
|
-
modifiers: {
|
|
733
|
-
type: [String, Array],
|
|
734
|
-
default: "mobile"
|
|
735
|
-
},
|
|
754
|
+
...ModifiersProps,
|
|
736
755
|
/**
|
|
737
756
|
* Show / hide dropdown programmatically
|
|
738
757
|
*/
|
|
@@ -819,7 +838,15 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
819
838
|
"beforeExpand",
|
|
820
839
|
"beforeCollapse",
|
|
821
840
|
"afterExpand",
|
|
822
|
-
"afterCollapse"
|
|
841
|
+
"afterCollapse",
|
|
842
|
+
"before-enter",
|
|
843
|
+
"after-leave",
|
|
844
|
+
"enter",
|
|
845
|
+
"after-enter",
|
|
846
|
+
"enter-cancelled",
|
|
847
|
+
"before-leave",
|
|
848
|
+
"leave",
|
|
849
|
+
"leave-cancelled"
|
|
823
850
|
],
|
|
824
851
|
setup(__props, { expose: __expose, emit }) {
|
|
825
852
|
const props = __props;
|
|
@@ -920,7 +947,11 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
920
947
|
referenceEl,
|
|
921
948
|
floatingEl,
|
|
922
949
|
{
|
|
923
|
-
whileElementsMounted:
|
|
950
|
+
whileElementsMounted: (...args) => {
|
|
951
|
+
return autoUpdate(...args, {
|
|
952
|
+
animationFrame: props.strategy === "fixed"
|
|
953
|
+
});
|
|
954
|
+
},
|
|
924
955
|
placement: computed(() => props.placement),
|
|
925
956
|
strategy: computed(() => props.strategy),
|
|
926
957
|
middleware
|
|
@@ -1007,7 +1038,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
1007
1038
|
onClickOutside(
|
|
1008
1039
|
floatingEl,
|
|
1009
1040
|
() => {
|
|
1010
|
-
if (!props.keepOpen) {
|
|
1041
|
+
if (!props.keepOpen && expanded.value) {
|
|
1011
1042
|
expanded.value = false;
|
|
1012
1043
|
}
|
|
1013
1044
|
},
|
|
@@ -1045,7 +1076,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
1045
1076
|
}
|
|
1046
1077
|
return [
|
|
1047
1078
|
...element.querySelectorAll(
|
|
1048
|
-
'a[href], button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])'
|
|
1079
|
+
'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
1049
1080
|
)
|
|
1050
1081
|
].filter(
|
|
1051
1082
|
(el) => !el.hasAttribute("disabled") && !el.getAttribute("aria-hidden")
|
|
@@ -1123,11 +1154,33 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
1123
1154
|
htmlEl == null ? void 0 : htmlEl.click();
|
|
1124
1155
|
}
|
|
1125
1156
|
});
|
|
1126
|
-
const
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1157
|
+
const dropdownTransitionHandlers = {
|
|
1158
|
+
"before-enter": () => {
|
|
1159
|
+
emit(expanded.value ? "beforeExpand" : "beforeCollapse");
|
|
1160
|
+
emit("before-enter");
|
|
1161
|
+
},
|
|
1162
|
+
"after-leave": () => {
|
|
1163
|
+
emit(expanded.value ? "afterExpand" : "afterCollapse");
|
|
1164
|
+
emit("after-leave");
|
|
1165
|
+
},
|
|
1166
|
+
enter: () => {
|
|
1167
|
+
emit("enter");
|
|
1168
|
+
},
|
|
1169
|
+
"after-enter": () => {
|
|
1170
|
+
emit("after-enter");
|
|
1171
|
+
},
|
|
1172
|
+
"enter-cancelled": () => {
|
|
1173
|
+
emit("enter-cancelled");
|
|
1174
|
+
},
|
|
1175
|
+
"before-leave": () => {
|
|
1176
|
+
emit("before-leave");
|
|
1177
|
+
},
|
|
1178
|
+
leave: () => {
|
|
1179
|
+
emit("leave");
|
|
1180
|
+
},
|
|
1181
|
+
"leave-cancelled": () => {
|
|
1182
|
+
emit("leave-cancelled");
|
|
1183
|
+
}
|
|
1131
1184
|
};
|
|
1132
1185
|
return (_ctx, _cache) => {
|
|
1133
1186
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
@@ -1137,10 +1190,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
1137
1190
|
]),
|
|
1138
1191
|
_: 3
|
|
1139
1192
|
}),
|
|
1140
|
-
createVNode(Transition, mergeProps({ name: _ctx.transitionName }, toHandlers({
|
|
1141
|
-
beforeEnter: onTransitionBeforeEnter,
|
|
1142
|
-
onAfterLeave: onTransitionAfterLeave
|
|
1143
|
-
})), {
|
|
1193
|
+
createVNode(Transition, mergeProps({ name: _ctx.transitionName }, toHandlers(dropdownTransitionHandlers)), {
|
|
1144
1194
|
default: withCtx(() => [
|
|
1145
1195
|
withDirectives(createElementVNode("div", {
|
|
1146
1196
|
ref_key: "floatingEl",
|
|
@@ -1412,19 +1462,27 @@ function joinLines(items) {
|
|
|
1412
1462
|
}
|
|
1413
1463
|
return items;
|
|
1414
1464
|
}
|
|
1415
|
-
function HintSlotFactory(
|
|
1416
|
-
const
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1465
|
+
function HintSlotFactory(propsOrRef, slots) {
|
|
1466
|
+
const props = computed(() => {
|
|
1467
|
+
if (isRef(propsOrRef)) {
|
|
1468
|
+
return propsOrRef.value;
|
|
1469
|
+
}
|
|
1470
|
+
return propsOrRef;
|
|
1471
|
+
});
|
|
1472
|
+
const invalidLabel = computed(() => joinLines(props.value.invalidLabel));
|
|
1473
|
+
const validLabel = computed(() => joinLines(props.value.validLabel));
|
|
1474
|
+
const loadingLabel = computed(() => props.value.loadingLabel);
|
|
1475
|
+
const hintLabel = computed(() => props.value.hintLabel);
|
|
1420
1476
|
const hasLoadingLabelOrSlot = computed(
|
|
1421
|
-
() => Boolean(props.loading && (slots.loading || loadingLabel.value))
|
|
1477
|
+
() => Boolean(props.value.loading && (slots.loading || loadingLabel.value))
|
|
1422
1478
|
);
|
|
1423
1479
|
const hasInvalidLabelOrSlot = computed(
|
|
1424
|
-
() => !hasLoadingLabelOrSlot.value && Boolean(
|
|
1480
|
+
() => !hasLoadingLabelOrSlot.value && Boolean(
|
|
1481
|
+
props.value.invalid && (slots.invalid || invalidLabel.value)
|
|
1482
|
+
)
|
|
1425
1483
|
);
|
|
1426
1484
|
const hasValidLabelOrSlot = computed(
|
|
1427
|
-
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.valid && (slots.valid || validLabel.value))
|
|
1485
|
+
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && Boolean(props.value.valid && (slots.valid || validLabel.value))
|
|
1428
1486
|
);
|
|
1429
1487
|
const hasHintLabelOrSlot = computed(
|
|
1430
1488
|
() => !hasLoadingLabelOrSlot.value && !hasInvalidLabelOrSlot.value && !hasValidLabelOrSlot.value && Boolean(slots.hint || hintLabel.value)
|
|
@@ -1433,10 +1491,10 @@ function HintSlotFactory(props, slots) {
|
|
|
1433
1491
|
() => hasInvalidLabelOrSlot.value || hasValidLabelOrSlot.value || hasLoadingLabelOrSlot.value || hasHintLabelOrSlot.value
|
|
1434
1492
|
);
|
|
1435
1493
|
const hintSlotScope = computed(() => ({
|
|
1436
|
-
modelValue: props.modelValue,
|
|
1437
|
-
valid: props.valid,
|
|
1438
|
-
invalid: props.invalid,
|
|
1439
|
-
loading: props.loading
|
|
1494
|
+
modelValue: props.value.modelValue,
|
|
1495
|
+
valid: props.value.valid,
|
|
1496
|
+
invalid: props.value.invalid,
|
|
1497
|
+
loading: props.value.loading
|
|
1440
1498
|
}));
|
|
1441
1499
|
const HintSlot = defineComponent({
|
|
1442
1500
|
name: "HintSlot",
|
|
@@ -1565,6 +1623,59 @@ const VvSelectProps = {
|
|
|
1565
1623
|
placeholder: String
|
|
1566
1624
|
};
|
|
1567
1625
|
const VvSelectEmits = ["update:modelValue", "focus", "blur"];
|
|
1626
|
+
function useDefaults(componentName, propsDefinition, props) {
|
|
1627
|
+
const volver = useVolver();
|
|
1628
|
+
const volverComponentDefaults = computed(() => {
|
|
1629
|
+
var _a;
|
|
1630
|
+
if (!volver || !((_a = volver.defaults.value) == null ? void 0 : _a[componentName])) {
|
|
1631
|
+
return void 0;
|
|
1632
|
+
}
|
|
1633
|
+
return volver.defaults.value[componentName];
|
|
1634
|
+
});
|
|
1635
|
+
return computed(() => {
|
|
1636
|
+
if (volverComponentDefaults.value === void 0) {
|
|
1637
|
+
return props;
|
|
1638
|
+
}
|
|
1639
|
+
const componentDefaults = volverComponentDefaults.value;
|
|
1640
|
+
const simplifiedPropsDefinition = propsDefinition;
|
|
1641
|
+
const simplifiedProps = props;
|
|
1642
|
+
return Object.keys(simplifiedPropsDefinition).reduce((acc, key) => {
|
|
1643
|
+
const propValue = simplifiedProps[key];
|
|
1644
|
+
acc[key] = propValue;
|
|
1645
|
+
if (key in componentDefaults) {
|
|
1646
|
+
if (Array.isArray(simplifiedPropsDefinition[key])) {
|
|
1647
|
+
const typeArray = simplifiedPropsDefinition[key];
|
|
1648
|
+
if (typeArray.length) {
|
|
1649
|
+
const typeFunction = typeArray[0];
|
|
1650
|
+
if (typeFunction === propValue) {
|
|
1651
|
+
acc[key] = componentDefaults[key];
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
if (typeof simplifiedPropsDefinition[key] === "function") {
|
|
1656
|
+
const typeFunction = simplifiedPropsDefinition[key];
|
|
1657
|
+
if (typeFunction() === propValue) {
|
|
1658
|
+
acc[key] = componentDefaults[key];
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
if (typeof simplifiedPropsDefinition[key] === "object") {
|
|
1662
|
+
let defaultValue = simplifiedPropsDefinition[key].default;
|
|
1663
|
+
if (typeof defaultValue === "function") {
|
|
1664
|
+
defaultValue = defaultValue();
|
|
1665
|
+
}
|
|
1666
|
+
if (typeof defaultValue === "object") {
|
|
1667
|
+
if (JSON.stringify(defaultValue) === JSON.stringify(propValue)) {
|
|
1668
|
+
acc[key] = componentDefaults[key];
|
|
1669
|
+
}
|
|
1670
|
+
} else if (defaultValue === propValue) {
|
|
1671
|
+
acc[key] = componentDefaults[key];
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
return acc;
|
|
1676
|
+
}, {});
|
|
1677
|
+
});
|
|
1678
|
+
}
|
|
1568
1679
|
function useComponentFocus(inputTemplateRef, emit) {
|
|
1569
1680
|
const { focused } = useFocus(inputTemplateRef);
|
|
1570
1681
|
watch(focused, (newValue) => {
|
|
@@ -1667,13 +1778,18 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1667
1778
|
setup(__props, { emit }) {
|
|
1668
1779
|
const props = __props;
|
|
1669
1780
|
const slots = useSlots();
|
|
1781
|
+
const propsDefaults = useDefaults(
|
|
1782
|
+
"VvSelect",
|
|
1783
|
+
VvSelectProps,
|
|
1784
|
+
props
|
|
1785
|
+
);
|
|
1670
1786
|
const select = ref();
|
|
1671
1787
|
const {
|
|
1672
1788
|
HintSlot,
|
|
1673
1789
|
hasHintLabelOrSlot,
|
|
1674
1790
|
hasInvalidLabelOrSlot,
|
|
1675
1791
|
hintSlotScope
|
|
1676
|
-
} = HintSlotFactory(
|
|
1792
|
+
} = HintSlotFactory(propsDefaults, slots);
|
|
1677
1793
|
const {
|
|
1678
1794
|
id,
|
|
1679
1795
|
modifiers,
|
|
@@ -1944,7 +2060,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1944
2060
|
const hasProps = computed(() => {
|
|
1945
2061
|
const toReturn = {
|
|
1946
2062
|
...dropdownAria == null ? void 0 : dropdownAria.value,
|
|
1947
|
-
|
|
2063
|
+
ariaPressed: pressed.value ? true : void 0,
|
|
2064
|
+
ariaLabel: props.ariaLabel,
|
|
1948
2065
|
role: role == null ? void 0 : role.value
|
|
1949
2066
|
};
|
|
1950
2067
|
switch (hasTag.value) {
|
|
@@ -2243,7 +2360,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2243
2360
|
to: _ctx.to,
|
|
2244
2361
|
href: _ctx.href,
|
|
2245
2362
|
target: _ctx.target,
|
|
2246
|
-
rel: _ctx.rel
|
|
2363
|
+
rel: _ctx.rel,
|
|
2364
|
+
ariaLabel: _ctx.ariaLabel
|
|
2247
2365
|
}, {
|
|
2248
2366
|
id: unref(hasId),
|
|
2249
2367
|
ref_key: "element",
|
|
@@ -2280,59 +2398,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2280
2398
|
};
|
|
2281
2399
|
}
|
|
2282
2400
|
});
|
|
2283
|
-
function useDefaults(componentName, propsDefinition, props) {
|
|
2284
|
-
const volver = useVolver();
|
|
2285
|
-
const volverComponentDefaults = computed(() => {
|
|
2286
|
-
var _a;
|
|
2287
|
-
if (!volver || !((_a = volver.defaults.value) == null ? void 0 : _a[componentName])) {
|
|
2288
|
-
return void 0;
|
|
2289
|
-
}
|
|
2290
|
-
return volver.defaults.value[componentName];
|
|
2291
|
-
});
|
|
2292
|
-
return computed(() => {
|
|
2293
|
-
if (volverComponentDefaults.value === void 0) {
|
|
2294
|
-
return props;
|
|
2295
|
-
}
|
|
2296
|
-
const componentDefaults = volverComponentDefaults.value;
|
|
2297
|
-
const simplifiedPropsDefinition = propsDefinition;
|
|
2298
|
-
const simplifiedProps = props;
|
|
2299
|
-
return Object.keys(simplifiedPropsDefinition).reduce((acc, key) => {
|
|
2300
|
-
const propValue = simplifiedProps[key];
|
|
2301
|
-
acc[key] = propValue;
|
|
2302
|
-
if (key in componentDefaults) {
|
|
2303
|
-
if (Array.isArray(simplifiedPropsDefinition[key])) {
|
|
2304
|
-
const typeArray = simplifiedPropsDefinition[key];
|
|
2305
|
-
if (typeArray.length) {
|
|
2306
|
-
const typeFunction = typeArray[0];
|
|
2307
|
-
if (typeFunction === propValue) {
|
|
2308
|
-
acc[key] = componentDefaults[key];
|
|
2309
|
-
}
|
|
2310
|
-
}
|
|
2311
|
-
}
|
|
2312
|
-
if (typeof simplifiedPropsDefinition[key] === "function") {
|
|
2313
|
-
const typeFunction = simplifiedPropsDefinition[key];
|
|
2314
|
-
if (typeFunction() === propValue) {
|
|
2315
|
-
acc[key] = componentDefaults[key];
|
|
2316
|
-
}
|
|
2317
|
-
}
|
|
2318
|
-
if (typeof simplifiedPropsDefinition[key] === "object") {
|
|
2319
|
-
let defaultValue = simplifiedPropsDefinition[key].default;
|
|
2320
|
-
if (typeof defaultValue === "function") {
|
|
2321
|
-
defaultValue = defaultValue();
|
|
2322
|
-
}
|
|
2323
|
-
if (typeof defaultValue === "object") {
|
|
2324
|
-
if (JSON.stringify(defaultValue) === JSON.stringify(propValue)) {
|
|
2325
|
-
acc[key] = componentDefaults[key];
|
|
2326
|
-
}
|
|
2327
|
-
} else if (defaultValue === propValue) {
|
|
2328
|
-
acc[key] = componentDefaults[key];
|
|
2329
|
-
}
|
|
2330
|
-
}
|
|
2331
|
-
}
|
|
2332
|
-
return acc;
|
|
2333
|
-
}, {});
|
|
2334
|
-
});
|
|
2335
|
-
}
|
|
2336
2401
|
const _hoisted_1 = ["id"];
|
|
2337
2402
|
const _hoisted_2 = ["id", "for"];
|
|
2338
2403
|
const _hoisted_3 = ["id", "aria-controls", "placeholder"];
|
|
@@ -2383,7 +2448,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2383
2448
|
hasHintLabelOrSlot,
|
|
2384
2449
|
hasInvalidLabelOrSlot,
|
|
2385
2450
|
hintSlotScope
|
|
2386
|
-
} = HintSlotFactory(
|
|
2451
|
+
} = HintSlotFactory(propsDefaults, slots);
|
|
2387
2452
|
const inputEl = ref(null);
|
|
2388
2453
|
const inputSearchEl = ref(null);
|
|
2389
2454
|
const wrapperEl = ref(null);
|
|
@@ -2497,6 +2562,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2497
2562
|
} = useOptions(props);
|
|
2498
2563
|
const filteredOptions = computed(() => {
|
|
2499
2564
|
var _a;
|
|
2565
|
+
if (propsDefaults.value.searchFunction) {
|
|
2566
|
+
return propsDefaults.value.searchFunction(
|
|
2567
|
+
debouncedSearchText.value,
|
|
2568
|
+
props.options
|
|
2569
|
+
);
|
|
2570
|
+
}
|
|
2500
2571
|
return (_a = props.options) == null ? void 0 : _a.filter((option) => {
|
|
2501
2572
|
return getOptionLabel(option).toLowerCase().includes(debouncedSearchText.value.toLowerCase().trim());
|
|
2502
2573
|
});
|
|
@@ -2601,7 +2672,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2601
2672
|
flip: propsDefaults.value.flip,
|
|
2602
2673
|
autoPlacement: propsDefaults.value.autoPlacement,
|
|
2603
2674
|
arrow: propsDefaults.value.arrow,
|
|
2604
|
-
autofocusFirst: searchable.value ?
|
|
2675
|
+
autofocusFirst: searchable.value ? true : propsDefaults.value.autofocusFirst,
|
|
2605
2676
|
triggerWidth: propsDefaults.value.triggerWidth,
|
|
2606
2677
|
modifiers: propsDefaults.value.dropdownModifiers
|
|
2607
2678
|
}));
|
|
@@ -2794,10 +2865,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2794
2865
|
return [
|
|
2795
2866
|
((_a = unref(dropdownEl)) == null ? void 0 : _a.customPosition) ? (openBlock(), createBlock(_sfc_main$1, {
|
|
2796
2867
|
key: 0,
|
|
2797
|
-
label:
|
|
2868
|
+
label: unref(propsDefaults).closeLabel,
|
|
2798
2869
|
modifiers: "secondary",
|
|
2799
2870
|
onClick: _cache[1] || (_cache[1] = ($event) => unref(dropdownEl).hide())
|
|
2800
|
-
})) : createCommentVNode("", true)
|
|
2871
|
+
}, null, 8, ["label"])) : createCommentVNode("", true)
|
|
2801
2872
|
];
|
|
2802
2873
|
})
|
|
2803
2874
|
]),
|
|
@@ -2821,7 +2892,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2821
2892
|
class: "vv-dropdown__search",
|
|
2822
2893
|
placeholder: unref(propsDefaults).searchPlaceholder
|
|
2823
2894
|
}, null, 8, _hoisted_3)), [
|
|
2824
|
-
[vShow, unref(expanded)],
|
|
2825
2895
|
[vModelText, unref(searchText)]
|
|
2826
2896
|
]) : createCommentVNode("", true)
|
|
2827
2897
|
]),
|