@volverjs/ui-vue 0.0.10-beta.20 → 0.0.10-beta.21
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/VvAccordion/VvAccordion.es.js +3 -1
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +6 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +1 -1
- package/dist/components/VvAction/VvAction.es.js +2 -1
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +1 -1
- package/dist/components/VvAlert/VvAlert.es.js +7 -0
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +10 -0
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +1 -1
- package/dist/components/VvAvatar/VvAvatar.vue.d.ts +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +1 -1
- package/dist/components/VvBadge/VvBadge.es.js +2 -1
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.vue.d.ts +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +3 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +1 -1
- package/dist/components/VvButton/VvButton.es.js +33 -15
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +2 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +1 -1
- package/dist/components/VvCard/VvCard.es.js +5 -1
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCard/VvCard.vue.d.ts +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +2 -1
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +13 -2
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +48 -15
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +42 -42
- package/dist/components/VvDialog/VvDialog.es.js +3 -0
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +42 -42
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +1 -1
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +2 -1
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.vue.d.ts +1 -1
- package/dist/components/VvIcon/index.d.ts +12 -0
- package/dist/components/VvInputFile/VvInputFile.es.js +258 -82
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +152 -29
- package/dist/components/VvInputFile/index.d.ts +119 -14
- package/dist/components/VvInputText/VvInputClearAction.d.ts +6 -4
- package/dist/components/VvInputText/VvInputPasswordAction.d.ts +10 -8
- package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +79 -65
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +10 -10
- package/dist/components/VvInputText/index.d.ts +6 -15
- package/dist/components/VvNav/VvNav.es.js +2 -1
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/VvNav.vue.d.ts +1 -1
- package/dist/components/VvNav/VvNavItem.vue.d.ts +1 -1
- package/dist/components/VvNav/VvNavSeparator.vue.d.ts +1 -1
- package/dist/components/VvNavItem/VvNavItem.es.js +2 -1
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.vue.d.ts +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +13 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +1 -1
- package/dist/components/VvSelect/VvSelect.es.js +4 -0
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +1 -1
- package/dist/components/VvTab/VvTab.es.js +7 -2
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTab/VvTab.vue.d.ts +1 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +4 -0
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +1 -1
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +1 -1
- package/dist/components/common/HintSlot.d.ts +1 -1
- package/dist/components/index.es.js +354 -115
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +1 -1
- package/dist/composables/dropdown/useProvideDropdown.d.ts +1 -1
- package/dist/icons.es.js +210 -210
- package/dist/icons.umd.js +1 -1
- package/dist/stories/InputFile/InputFile.stories.d.ts +1 -2
- package/dist/stories/InputFile/{InputFileModifiers.stories.d.ts → InputFileDropArea.stories.d.ts} +4 -4
- package/dist/stories/InputFile/InputFileIconPosition.stories.d.ts +8 -0
- package/dist/stories/InputFile/InputFileSlots.stories.d.ts +1 -0
- package/dist/types/input-file.d.ts +2 -0
- package/package.json +45 -45
- 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/VvIcon/index.ts +13 -0
- package/src/components/VvInputFile/VvInputFile.vue +103 -40
- package/src/components/VvInputFile/index.ts +88 -10
- package/src/components/VvInputText/VvInputClearAction.ts +10 -6
- package/src/components/VvInputText/VvInputPasswordAction.ts +13 -9
- package/src/components/VvInputText/VvInputText.vue +6 -6
- package/src/components/VvInputText/index.ts +7 -15
- package/src/stories/InputFile/InputFile.settings.ts +1 -1
- package/src/stories/InputFile/InputFile.stories.ts +7 -16
- package/src/stories/InputFile/{InputFileModifiers.stories.ts → InputFileDropArea.stories.ts} +18 -13
- package/src/stories/InputFile/InputFileIconPosition.stories.ts +43 -0
- package/src/stories/InputFile/InputFileSlots.stories.ts +11 -3
- package/src/types/input-file.ts +4 -2
|
@@ -127,6 +127,18 @@ function HintSlotFactory(propsOrRef, slots) {
|
|
|
127
127
|
HintSlot
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
|
+
const ACTION_ICONS = {
|
|
131
|
+
showPassword: "eye-on",
|
|
132
|
+
hidePassword: "eye-off",
|
|
133
|
+
showDatePicker: "calendar",
|
|
134
|
+
showTimePicker: "time",
|
|
135
|
+
showColorPicker: "color",
|
|
136
|
+
clear: "close",
|
|
137
|
+
add: "add",
|
|
138
|
+
remove: "trash",
|
|
139
|
+
edit: "edit",
|
|
140
|
+
download: "download"
|
|
141
|
+
};
|
|
130
142
|
const VvIconPropsDefaults = {
|
|
131
143
|
prefix: "normal"
|
|
132
144
|
/* normal */
|
|
@@ -729,14 +741,6 @@ const INPUT_TYPES = {
|
|
|
729
741
|
MONTH: "month",
|
|
730
742
|
WEEK: "week"
|
|
731
743
|
};
|
|
732
|
-
const TYPES_ICON = {
|
|
733
|
-
PASSWORD_SHOW: "eye-on",
|
|
734
|
-
PASSWORD_HIDE: "eye-off",
|
|
735
|
-
DATE: "calendar",
|
|
736
|
-
TIME: "time",
|
|
737
|
-
COLOR: "color",
|
|
738
|
-
SEARCH: "close"
|
|
739
|
-
};
|
|
740
744
|
const VvInputTextEvents = [
|
|
741
745
|
"update:modelValue",
|
|
742
746
|
"update:masked",
|
|
@@ -805,24 +809,24 @@ const VvInputTextProps = {
|
|
|
805
809
|
* @see VVIcon
|
|
806
810
|
*/
|
|
807
811
|
iconShowPassword: {
|
|
808
|
-
type: String,
|
|
809
|
-
default:
|
|
812
|
+
type: [String, Object],
|
|
813
|
+
default: ACTION_ICONS.showPassword
|
|
810
814
|
},
|
|
811
815
|
/**
|
|
812
816
|
* VvIcon name for hide password button
|
|
813
817
|
* @see VVIcon
|
|
814
818
|
*/
|
|
815
819
|
iconHidePassword: {
|
|
816
|
-
type: String,
|
|
817
|
-
default:
|
|
820
|
+
type: [String, Object],
|
|
821
|
+
default: ACTION_ICONS.hidePassword
|
|
818
822
|
},
|
|
819
823
|
/**
|
|
820
824
|
* VvIcon name for clear button
|
|
821
825
|
* @see VVIcon
|
|
822
826
|
*/
|
|
823
827
|
iconClear: {
|
|
824
|
-
type: String,
|
|
825
|
-
default:
|
|
828
|
+
type: [String, Object],
|
|
829
|
+
default: ACTION_ICONS.clear
|
|
826
830
|
},
|
|
827
831
|
/**
|
|
828
832
|
* Label for step up button
|
|
@@ -902,6 +906,41 @@ const VvInputTextProps = {
|
|
|
902
906
|
default: false
|
|
903
907
|
}
|
|
904
908
|
};
|
|
909
|
+
function useComponentIcon(icon, iconPosition) {
|
|
910
|
+
const hasIcon = computed(() => {
|
|
911
|
+
if (typeof (icon == null ? void 0 : icon.value) === "string") {
|
|
912
|
+
return { name: icon == null ? void 0 : icon.value };
|
|
913
|
+
}
|
|
914
|
+
return icon == null ? void 0 : icon.value;
|
|
915
|
+
});
|
|
916
|
+
const hasIconBefore = computed(
|
|
917
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Position.before ? hasIcon.value : void 0
|
|
918
|
+
);
|
|
919
|
+
const hasIconAfter = computed(
|
|
920
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Position.after ? hasIcon.value : void 0
|
|
921
|
+
);
|
|
922
|
+
const hasIconLeft = computed(
|
|
923
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.left ? hasIcon.value : void 0
|
|
924
|
+
);
|
|
925
|
+
const hasIconRight = computed(
|
|
926
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.right ? hasIcon.value : void 0
|
|
927
|
+
);
|
|
928
|
+
const hasIconTop = computed(
|
|
929
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.top ? hasIcon.value : void 0
|
|
930
|
+
);
|
|
931
|
+
const hasIconBottom = computed(
|
|
932
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.bottom ? hasIcon.value : void 0
|
|
933
|
+
);
|
|
934
|
+
return {
|
|
935
|
+
hasIcon,
|
|
936
|
+
hasIconLeft,
|
|
937
|
+
hasIconRight,
|
|
938
|
+
hasIconTop,
|
|
939
|
+
hasIconBottom,
|
|
940
|
+
hasIconBefore,
|
|
941
|
+
hasIconAfter
|
|
942
|
+
};
|
|
943
|
+
}
|
|
905
944
|
const VvInputPasswordAction = defineComponent({
|
|
906
945
|
components: {
|
|
907
946
|
VvIcon: _sfc_main$1
|
|
@@ -920,12 +959,12 @@ const VvInputPasswordAction = defineComponent({
|
|
|
920
959
|
default: "Hide password"
|
|
921
960
|
},
|
|
922
961
|
iconShow: {
|
|
923
|
-
type: String,
|
|
924
|
-
default:
|
|
962
|
+
type: [String, Object],
|
|
963
|
+
default: ACTION_ICONS.showPassword
|
|
925
964
|
},
|
|
926
965
|
iconHide: {
|
|
927
|
-
type: String,
|
|
928
|
-
default:
|
|
966
|
+
type: [String, Object],
|
|
967
|
+
default: ACTION_ICONS.hidePassword
|
|
929
968
|
}
|
|
930
969
|
},
|
|
931
970
|
emits: ["toggle-password"],
|
|
@@ -934,6 +973,7 @@ const VvInputPasswordAction = defineComponent({
|
|
|
934
973
|
const activeIcon = computed(
|
|
935
974
|
() => active.value ? props.iconHide : props.iconShow
|
|
936
975
|
);
|
|
976
|
+
const { hasIcon } = useComponentIcon(activeIcon);
|
|
937
977
|
function onClick(e) {
|
|
938
978
|
e == null ? void 0 : e.stopPropagation();
|
|
939
979
|
if (!props.disabled) {
|
|
@@ -944,14 +984,15 @@ const VvInputPasswordAction = defineComponent({
|
|
|
944
984
|
return {
|
|
945
985
|
active,
|
|
946
986
|
activeIcon,
|
|
987
|
+
hasIcon,
|
|
947
988
|
onClick
|
|
948
989
|
};
|
|
949
990
|
},
|
|
950
991
|
render() {
|
|
951
|
-
const icon = h(_sfc_main$1, {
|
|
952
|
-
|
|
992
|
+
const icon = this.hasIcon ? h(_sfc_main$1, {
|
|
993
|
+
...this.hasIcon,
|
|
953
994
|
class: "vv-input-text__icon"
|
|
954
|
-
});
|
|
995
|
+
}) : void 0;
|
|
955
996
|
return h(
|
|
956
997
|
"button",
|
|
957
998
|
{
|
|
@@ -1024,12 +1065,13 @@ const VvInputClearAction = defineComponent({
|
|
|
1024
1065
|
default: "Clear"
|
|
1025
1066
|
},
|
|
1026
1067
|
icon: {
|
|
1027
|
-
type: String,
|
|
1068
|
+
type: [String, Object],
|
|
1028
1069
|
default: "close"
|
|
1029
1070
|
}
|
|
1030
1071
|
},
|
|
1031
1072
|
emits: ["clear"],
|
|
1032
1073
|
setup(props, { emit }) {
|
|
1074
|
+
const { hasIcon } = useComponentIcon(computed(() => props.icon));
|
|
1033
1075
|
function onClick(e) {
|
|
1034
1076
|
e == null ? void 0 : e.stopPropagation();
|
|
1035
1077
|
if (!props.disabled) {
|
|
@@ -1037,14 +1079,15 @@ const VvInputClearAction = defineComponent({
|
|
|
1037
1079
|
}
|
|
1038
1080
|
}
|
|
1039
1081
|
return {
|
|
1082
|
+
hasIcon,
|
|
1040
1083
|
onClick
|
|
1041
1084
|
};
|
|
1042
1085
|
},
|
|
1043
1086
|
render() {
|
|
1044
|
-
const icon = h(_sfc_main$1, {
|
|
1045
|
-
|
|
1087
|
+
const icon = this.hasIcon ? h(_sfc_main$1, {
|
|
1088
|
+
...this.hasIcon,
|
|
1046
1089
|
class: "vv-input-text__icon"
|
|
1047
|
-
});
|
|
1090
|
+
}) : void 0;
|
|
1048
1091
|
return h(
|
|
1049
1092
|
"button",
|
|
1050
1093
|
{
|
|
@@ -1218,41 +1261,6 @@ function useComponentFocus(inputTemplateRef, emit) {
|
|
|
1218
1261
|
focused
|
|
1219
1262
|
};
|
|
1220
1263
|
}
|
|
1221
|
-
function useComponentIcon(icon, iconPosition) {
|
|
1222
|
-
const hasIcon = computed(() => {
|
|
1223
|
-
if (typeof (icon == null ? void 0 : icon.value) === "string") {
|
|
1224
|
-
return { name: icon == null ? void 0 : icon.value };
|
|
1225
|
-
}
|
|
1226
|
-
return icon == null ? void 0 : icon.value;
|
|
1227
|
-
});
|
|
1228
|
-
const hasIconBefore = computed(
|
|
1229
|
-
() => (iconPosition == null ? void 0 : iconPosition.value) === Position.before ? hasIcon.value : void 0
|
|
1230
|
-
);
|
|
1231
|
-
const hasIconAfter = computed(
|
|
1232
|
-
() => (iconPosition == null ? void 0 : iconPosition.value) === Position.after ? hasIcon.value : void 0
|
|
1233
|
-
);
|
|
1234
|
-
const hasIconLeft = computed(
|
|
1235
|
-
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.left ? hasIcon.value : void 0
|
|
1236
|
-
);
|
|
1237
|
-
const hasIconRight = computed(
|
|
1238
|
-
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.right ? hasIcon.value : void 0
|
|
1239
|
-
);
|
|
1240
|
-
const hasIconTop = computed(
|
|
1241
|
-
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.top ? hasIcon.value : void 0
|
|
1242
|
-
);
|
|
1243
|
-
const hasIconBottom = computed(
|
|
1244
|
-
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.bottom ? hasIcon.value : void 0
|
|
1245
|
-
);
|
|
1246
|
-
return {
|
|
1247
|
-
hasIcon,
|
|
1248
|
-
hasIconLeft,
|
|
1249
|
-
hasIconRight,
|
|
1250
|
-
hasIconTop,
|
|
1251
|
-
hasIconBottom,
|
|
1252
|
-
hasIconBefore,
|
|
1253
|
-
hasIconAfter
|
|
1254
|
-
};
|
|
1255
|
-
}
|
|
1256
1264
|
function useTextCount(text, options) {
|
|
1257
1265
|
const length = computed(() => {
|
|
1258
1266
|
return (unref(text) ?? "").length;
|
|
@@ -1502,14 +1510,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1502
1510
|
}
|
|
1503
1511
|
switch (props.type) {
|
|
1504
1512
|
case INPUT_TYPES.COLOR:
|
|
1505
|
-
return { name:
|
|
1513
|
+
return { name: ACTION_ICONS.showColorPicker };
|
|
1506
1514
|
case INPUT_TYPES.DATE:
|
|
1507
1515
|
case INPUT_TYPES.DATETIME_LOCAL:
|
|
1508
1516
|
case INPUT_TYPES.WEEK:
|
|
1509
1517
|
case INPUT_TYPES.MONTH:
|
|
1510
|
-
return { name:
|
|
1518
|
+
return { name: ACTION_ICONS.showDatePicker };
|
|
1511
1519
|
case INPUT_TYPES.TIME:
|
|
1512
|
-
return { name:
|
|
1520
|
+
return { name: ACTION_ICONS.showTimePicker };
|
|
1513
1521
|
}
|
|
1514
1522
|
return void 0;
|
|
1515
1523
|
});
|
|
@@ -1542,8 +1550,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1542
1550
|
loading: loading.value,
|
|
1543
1551
|
disabled: props.disabled,
|
|
1544
1552
|
readonly: props.readonly,
|
|
1545
|
-
"icon-before": hasIconBefore.value
|
|
1546
|
-
"icon-after": iconAfter.value
|
|
1553
|
+
"icon-before": !!hasIconBefore.value,
|
|
1554
|
+
"icon-after": !!iconAfter.value,
|
|
1547
1555
|
floating: props.floating && !isEmpty(props.label),
|
|
1548
1556
|
dirty: isDirty.value,
|
|
1549
1557
|
focus: isFocused.value,
|
|
@@ -1664,6 +1672,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1664
1672
|
}, toDisplayString(unref(label)), 9, _hoisted_1)) : createCommentVNode("v-if", true),
|
|
1665
1673
|
createElementVNode("div", _hoisted_2, [
|
|
1666
1674
|
_ctx.$slots.before ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
1675
|
+
createCommentVNode(" @slot Slot before input icon "),
|
|
1667
1676
|
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
1668
1677
|
])) : createCommentVNode("v-if", true),
|
|
1669
1678
|
createElementVNode(
|
|
@@ -1693,6 +1702,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1693
1702
|
onKeypress: _cache[1] || (_cache[1] = ($event) => emit("keypress", $event))
|
|
1694
1703
|
}), null, 16, _hoisted_4),
|
|
1695
1704
|
(_ctx.unit || _ctx.$slots.unit) && unref(isDirty) ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
1705
|
+
createCommentVNode(" @slot Slot to replace unit"),
|
|
1696
1706
|
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotProps))), () => [
|
|
1697
1707
|
createTextVNode(
|
|
1698
1708
|
toDisplayString(_ctx.unit),
|
|
@@ -1705,6 +1715,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1705
1715
|
512
|
|
1706
1716
|
/* NEED_PATCH */
|
|
1707
1717
|
),
|
|
1718
|
+
createCommentVNode(" @slot Slot to replace right icon "),
|
|
1708
1719
|
unref(iconAfter) ? (openBlock(), createBlock(
|
|
1709
1720
|
_sfc_main$1,
|
|
1710
1721
|
mergeProps({ key: 1 }, unref(iconAfter), { class: "vv-input-text__icon vv-input-text__icon-after" }),
|
|
@@ -1722,10 +1733,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1722
1733
|
key: 4,
|
|
1723
1734
|
onClear
|
|
1724
1735
|
})) : createCommentVNode("v-if", true),
|
|
1736
|
+
createCommentVNode(" @slot Slot after input "),
|
|
1725
1737
|
_ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_6, [
|
|
1738
|
+
createCommentVNode(" @slot Slot before input icon "),
|
|
1726
1739
|
renderSlot(_ctx.$slots, "after", normalizeProps(guardReactiveProps(unref(slotProps))))
|
|
1727
1740
|
])) : createCommentVNode("v-if", true),
|
|
1728
1741
|
unref(count) ? (openBlock(), createElementBlock("span", _hoisted_7, [
|
|
1742
|
+
createCommentVNode(" @slot Slot to replace count "),
|
|
1729
1743
|
renderSlot(_ctx.$slots, "count", normalizeProps(guardReactiveProps(unref(slotProps))), () => [
|
|
1730
1744
|
createTextVNode(
|
|
1731
1745
|
toDisplayString(unref(countFormatted)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("vue-imask"),require("@iconify/vue"),require("uid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","vue-imask","@iconify/vue","uid","@vueuse/core"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvInputText=t(e.vue,e.vueImask,e.vue$1,e.uid,e.core)}(this,(function(e,t,l,o,a){"use strict";function n(t){return null==(l=e.unref(t))||""===l||Array.isArray(l)&&0===l.length||!(l instanceof Date)&&"object"==typeof l&&0===Object.keys(l).length;var l}function i(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}const u={prefix:"normal"};var r=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(r||{}),d=(e=>(e.before="before",e.after="after",e))(d||{}),s=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(s||{}),v=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(v||{});const c=Symbol.for("volver");function p(){return e.inject(c)}function f(t,l,o){return e.computed((()=>{const a={[t]:!0},n="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(a[`${t}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((l=>{a[`${t}--${l}`]=e.unref(o.value[l])})),a}))}const m=e.defineComponent({name:"VvIcon",props:e.mergeDefaults({name:{},color:{},width:{},height:{},provider:{},prefix:{},src:{},horizontalFlip:{type:Boolean},verticalFlip:{type:Boolean},flip:{},mode:{},inline:{type:Boolean},rotate:{},onLoad:{type:Function},svg:{},modifiers:{}},u),setup(t){const o=t,a=e.computed((()=>"string"==typeof o.rotate?parseFloat(o.rotate):o.rotate)),n=e.ref(!0),i=p(),{modifiers:u}=e.toRefs(o),r=f("vv-icon",u),d=e.computed((()=>o.provider||(null==i?void 0:i.iconsProvider))),s=e.computed((()=>{const e=o.name??"",t=`@${d.value}:${o.prefix}:${e}`;if(l.iconExists(t))return t;const a=null==i?void 0:i.iconsCollections.find((t=>{const o=`@${d.value}:${t.prefix}:${e}`;return l.iconExists(o)}));return a?`@${d.value}:${a.prefix}:${e}`:e}));function v(e){const t=function(e){let t;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");t=(new e).window}return(t?new t.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),a=(null==t?void 0:t.innerHTML.trim())||"";t&&a&&l.addIcon(`@${d.value}:${o.prefix}:${o.name}`,{body:a,height:t.viewBox.baseVal.height,width:t.viewBox.baseVal.width})}return i&&o.src&&!l.iconExists(`@${d.value}:${o.prefix}:${o.name}`)&&(n.value=!1,i.fetchIcon(o.src).then((e=>{e&&(v(e),n.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),o.svg&&v(o.svg),(t,o)=>e.unref(n)?(e.openBlock(),e.createBlock(e.unref(l.Icon),e.mergeProps({key:0,class:e.unref(r)},{inline:t.inline,width:t.width,height:t.height,horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip,flip:t.flip,rotate:e.unref(a),color:t.color,onLoad:t.onLoad,icon:e.unref(s)}),null,16,["class"])):e.createCommentVNode("v-if",!0)}}),h={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},b={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},y={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},g={disabled:{type:Boolean,default:!1}},S=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),w={readonly:{type:Boolean,default:!1}},k={modifiers:{type:[String,Array],default:void 0}},L={hintLabel:{type:String,default:""}},E={count:{type:[Boolean,String],default:!1,validator:e=>[!0,!1,"limit","countdown"].includes(e)}},B={debounce:{type:[Number,String],default:void 0}},x={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:d.before,validation:e=>Object.values(d).includes(e)}},$={tabindex:{type:[String,Number],default:0}},T={floating:{type:Boolean,default:!1}},A={id:[String,Number]};r.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const P={...{...A,name:{type:String,required:!0}},...{autofocus:{type:Boolean,default:!1}},...{autocomplete:{type:String,default:"off"}},...$,...g,...w,...h,...b,...L,...y,...k,...E,...B,...x,...T,...S,minlength:{type:[String,Number],default:void 0},maxlength:{type:[String,Number],default:void 0},placeholder:{type:String,default:void 0},required:{type:Boolean,default:!1}};s.button,v.button;const C={TEXT:"text",PASSWORD:"password",NUMBER:"number",EMAIL:"email",TEL:"tel",URL:"url",COLOR:"color",SEARCH:"search",DATE:"date",TIME:"time",DATETIME_LOCAL:"datetime-local",MONTH:"month",WEEK:"week"},D="eye-on",I="eye-off",O="calendar",V="time",_="color",N={...P,modelValue:[String,Number],type:{type:String,default:C.TEXT,validator:e=>Object.values(C).includes(e)},min:[Number,Date,String],max:[Number,Date,String],step:{type:[String,Number],default:1},pattern:String,multiple:Boolean,iconShowPassword:{type:String,default:D},iconHidePassword:{type:String,default:I},iconClear:{type:String,default:"close"},labelStepUp:{type:String,default:"Increase value"},labelStepDown:{type:String,default:"Decrease value"},labelShowPassword:{type:String,default:"Show password"},labelHidePassword:{type:String,default:"Hide password"},labelClear:{type:String,default:"Clear"},iMask:{type:Object,default:void 0},masked:{type:String,default:void 0},autoWidth:{type:Boolean,default:!1},hideActions:{type:Boolean,default:!1},unit:{type:String},selectOnFocus:{type:Boolean,default:!1}},M=e.defineComponent({components:{VvIcon:m},props:{disabled:{type:Boolean,default:!1},labelShow:{type:String,default:"Show password"},labelHide:{type:String,default:"Hide password"},iconShow:{type:String,default:D},iconHide:{type:String,default:I}},emits:["toggle-password"],setup(t,{emit:l}){const o=e.ref(!1),a=e.computed((()=>o.value?t.iconHide:t.iconShow));return{active:o,activeIcon:a,onClick:function(e){null==e||e.stopPropagation(),t.disabled||(o.value=!o.value,l("toggle-password",o.value))}}},render(){const t=e.h(m,{name:this.activeIcon,class:"vv-input-text__icon"});return e.h("button",{disabled:this.disabled,class:"vv-input-text__action",ariaLabel:this.active?this.labelHide:this.labelShow,type:"button",onClick:this.onClick},t)}}),R=e.defineComponent({components:{VvIcon:m},props:{disabled:{type:Boolean,default:!1},label:{type:String},mode:{type:String,validator:e=>["up","down"].includes(e),default:"up"}},emits:["step-up","step-down"],setup(t,{emit:l}){const o=e.computed((()=>"up"===t.mode));return{isUp:o,onClick:e=>{null==e||e.stopPropagation(),t.disabled||l(o.value?"step-up":"step-down")}}},render(){return e.h("button",{class:["vv-input-text__action vv-input-text__action-chevron",this.isUp&&"vv-input-text__action-chevron-up"],disabled:this.disabled,ariaLabel:this.label,type:"button",onClick:this.onClick})}}),H=e.defineComponent({components:{VvIcon:m},props:{disabled:{type:Boolean,default:!1},label:{type:String,default:"Clear"},icon:{type:String,default:"close"}},emits:["clear"],setup:(e,{emit:t})=>({onClick:function(l){null==l||l.stopPropagation(),e.disabled||t("clear")}}),render(){const t=e.h(m,{name:this.icon,class:"vv-input-text__icon"});return e.h("button",{disabled:this.disabled,class:"vv-input-text__action",ariaLabel:this.label,type:"button",onClick:this.onClick},t)}});function U(t,l){return{name:"VvInputTextActions",components:{VvIcon:m,VvInputPasswordAction:M,VvInputStepAction:R,VvInputClearAction:H},setup:()=>({isDisabled:e.computed((()=>l.disabled||l.readonly)),labelStepUp:l.labelStepUp,labelStepDown:l.labelStepDown,labelShowPassword:l.labelShowPassword,labelHidePassword:l.labelHidePassword,labelClear:l.labelClear,iconShowPassword:l.iconShowPassword,iconHidePassword:l.iconHidePassword}),render(){let o=null;switch(t){case C.SEARCH:{const{onClear:t}=this.$attrs;o=[e.h(H,{disabled:this.isDisabled,label:this.labelShowPassword,onClear:t})];break}case C.PASSWORD:{const{onTogglePassword:t}=this.$attrs;o=[e.h(M,{disabled:this.isDisabled,onTogglePassword:t,labelShow:this.labelShowPassword,labelHide:this.labelHidePassword,iconShow:this.iconShowPassword,iconHide:this.iconHidePassword})];break}case C.NUMBER:{const{onStepUp:t,onStepDown:a}=this.$attrs;o=[e.h(R,{mode:"up",disabled:this.isDisabled||void 0!==l.max&&l.modelValue===l.max,label:this.labelStepUp,onStepUp:t,onStepDown:a}),e.h(R,{mode:"down",disabled:this.isDisabled||void 0!==l.min&&l.modelValue===l.min,label:this.labelStepDown,onStepUp:t,onStepDown:a})];break}}return Array.isArray(o)?e.h("div",{class:"vv-input-text__actions-group"},o):o}}}const j=["for"],F={class:"vv-input-text__wrapper"},W={key:0,class:"vv-input-text__input-before"},z=["id"],q={key:1,class:"vv-input-text__unit"},K={key:5,class:"vv-input-text__input-after"},X={key:6,class:"vv-input-text__limit"};return e.defineComponent({name:"VvInputText",props:N,emits:["update:modelValue","update:masked","accept","accept:typed","accept:masked","accept:unmasked","complete","complete:typed","complete:masked","complete:unmasked","focus","blur","keyup","keydown","keypress"],setup(l,{expose:u,emit:s}){const v=l,c=s,h=e.useSlots(),b=function(t,l,o){const a=p(),n=e.computed((()=>{var e;if(a&&(null==(e=a.defaults.value)?void 0:e[t]))return a.defaults.value[t]}));return e.computed((()=>{if(void 0===n.value)return o;const e=n.value,t=l,a=o;return Object.keys(t).reduce(((l,o)=>{const n=a[o];if(l[o]=n,o in e){if(Array.isArray(t[o])){const a=t[o];a.length&&a[0]===n&&(l[o]=e[o])}if("function"==typeof t[o]&&(0,t[o])()===n&&(l[o]=e[o]),"object"==typeof t[o]){let a=t[o].default;"function"==typeof a&&(a=a()),"object"==typeof a?JSON.stringify(a)===JSON.stringify(n)&&(l[o]=e[o]):a===n&&(l[o]=e[o])}}return l}),{})}))}("VvInputText",N,v),{id:y,icon:g,iconPosition:S,label:w,modelValue:k,count:L,valid:E,invalid:B,loading:x,debounce:$,maxlength:T,minlength:A,type:P,iMask:D,step:I}=e.toRefs(v),M=(t=>e.computed((()=>String((null==t?void 0:t.value)||o.uid()))))(y),R=e.computed((()=>`${M.value}-hint`)),H=e.computed((()=>v.floating&&n(v.placeholder)?" ":v.placeholder)),J=e.ref(!1),{el:Y,mask:G,typed:Q,masked:Z,unmasked:ee}=t.useIMask(e.computed((()=>(null==D?void 0:D.value)??{mask:/./})),{emit:c,onAccept:()=>{if(J.value){if(c("update:masked",Z.value),P.value===C.NUMBER){if(""===Z.value){if(null===oe.value||void 0===oe.value)return;return void(oe.value=void 0)}return"number"!=typeof Q.value?void(oe.value=Number(Q.value)):void(oe.value=Q.value)}if(P.value===C.DATE){if(Y.value instanceof HTMLInputElement&&"date"===Y.value.type)return void(oe.value=Y.value.value);let e=Q.value;if(null===e||""===e){if(!oe.value)return;return void(oe.value="")}return e instanceof Date||(e=new Date(e)),void(oe.value=`${e.getFullYear()}-${("0"+(e.getMonth()+1)).slice(-2)}-${("0"+e.getDate()).slice(-2)}`)}if(P.value===C.DATETIME_LOCAL){if(Y.value instanceof HTMLInputElement&&"datetime-local"===Y.value.type)return void(oe.value=Y.value.value);let e=Q.value;if(null===e||""===e){if(!oe.value)return;return void(oe.value="")}return Q.value instanceof Date||(e=new Date(e)),void(oe.value=`${e.getFullYear()}-${("0"+(e.getMonth()+1)).slice(-2)}-${("0"+e.getDate()).slice(-2)}T${("0"+e.getHours()).slice(-2)}:${("0"+e.getMinutes()).slice(-2)}`)}(oe.value||ee.value)&&(oe.value=ee.value)}}});e.onMounted((()=>{G.value&&(J.value=!0,Q.value=oe.value??"")})),e.watch((()=>v.modelValue),(e=>{var t;G.value&&(Q.value=e&&(null==(t=null==D?void 0:D.value)?void 0:t.mask)===Date?new Date(e):e??"")})),e.watch((()=>v.masked),(e=>{Z.value=e??""}));const te=Y,le=e.ref();u({$inner:le});const oe=function(t,l,o=0,{getter:a=(e=>e),setter:n=(e=>e)}={}){let i;return"string"==typeof o&&(o=parseInt(o)),e.computed({get:()=>a(null==t?void 0:t.value),set:e=>{i&&clearTimeout(i),i=setTimeout((()=>{l("update:modelValue",n(e))}),o)}})}(k,c,(null==$?void 0:$.value)??0),{focused:ae}=function(t,l){const{focused:o}=a.useFocus(t);return e.watch(o,(o=>{l(o?"focus":"blur",e.unref(t))})),{focused:o}}(te,c),ne=e.computed((()=>ae.value&&!v.disabled&&!v.readonly));e.watch(ne,(e=>{e&&b.value.selectOnFocus&&te.value&&te.value.select()}));const ie=a.useElementVisibility(te);e.watch(ie,(e=>{e&&v.autofocus&&!v.disabled&&!v.readonly&&(ae.value=!0)}));const ue=e.ref(!1),re=e.computed((()=>v.type===C.PASSWORD)),de=()=>{ue.value=!ue.value},se=e.computed((()=>v.type===C.TIME||v.type===C.DATETIME_LOCAL||v.type===C.DATE||v.type===C.WEEK||v.type===C.MONTH)),ve=e.computed((()=>v.type===C.NUMBER)),ce=()=>{if(Se.value){if(null==D?void 0:D.value)return void(Q.value=Q.value+Number((null==I?void 0:I.value)??1));te.value.stepUp(),oe.value=Number(e.unref(te).value)}},pe=()=>{if(Se.value){if(null==D?void 0:D.value)return void(Q.value=Q.value-Number((null==I?void 0:I.value)??1));te.value.stepDown(),oe.value=Number(e.unref(te).value)}},fe=e.computed((()=>v.type===C.SEARCH)),me=()=>{oe.value=""},{hasIconBefore:he,hasIconAfter:be}=function(t,l){const o=e.computed((()=>"string"==typeof(null==t?void 0:t.value)?{name:null==t?void 0:t.value}:null==t?void 0:t.value)),a=e.computed((()=>(null==l?void 0:l.value)===d.before?o.value:void 0)),n=e.computed((()=>(null==l?void 0:l.value)===d.after?o.value:void 0)),i=e.computed((()=>(null==l?void 0:l.value)===r.left?o.value:void 0)),u=e.computed((()=>(null==l?void 0:l.value)===r.right?o.value:void 0)),s=e.computed((()=>(null==l?void 0:l.value)===r.top?o.value:void 0)),v=e.computed((()=>(null==l?void 0:l.value)===r.bottom?o.value:void 0));return{hasIcon:o,hasIconLeft:i,hasIconRight:u,hasIconTop:s,hasIconBottom:v,hasIconBefore:a,hasIconAfter:n}}(g,S),ye=e.computed((()=>{if(void 0!==be.value)return be.value;switch(v.type){case C.COLOR:return{name:_};case C.DATE:case C.DATETIME_LOCAL:case C.WEEK:case C.MONTH:return{name:O};case C.TIME:return{name:V}}})),{formatted:ge}=function(t,l){const o=e.computed((()=>(e.unref(t)??"").length)),a=e.computed((()=>void 0!==(null==l?void 0:l.lowerLimit)&&o.value<(null==l?void 0:l.lowerLimit)?o.value-l.lowerLimit:void 0!==(null==l?void 0:l.upperLimit)&&o.value<(null==l?void 0:l.upperLimit)?l.upperLimit-o.value:0)),n=e.computed((()=>{if(!1===(null==l?void 0:l.mode))return"";if("limit"===(null==l?void 0:l.mode)&&(null==l?void 0:l.upperLimit))return`${o.value} / ${l.lowerLimit?`${l.lowerLimit}-`:""}${l.upperLimit}`;if("countdown"===(null==l?void 0:l.mode)){if(0===a.value)return;return a}return o.value}));return{length:o,gap:a,formatted:n}}(oe,{mode:L.value,upperLimit:Number(null==T?void 0:T.value),lowerLimit:Number(null==A?void 0:A.value)}),Se=e.computed((()=>!v.disabled&&!v.readonly)),we=e.computed((()=>Se.value?v.tabindex:-1)),ke=e.computed((()=>!n(k))),Le=e.computed((()=>!0===B.value||!0!==E.value&&void 0)),{modifiers:Ee}=e.toRefs(v),Be=f("vv-input-text",Ee,e.computed((()=>({valid:E.value,invalid:B.value,loading:x.value,disabled:v.disabled,readonly:v.readonly,"icon-before":void 0!==he.value,"icon-after":void 0!==ye.value,floating:v.floating&&!n(v.label),dirty:ke.value,focus:ne.value,"auto-width":v.autoWidth})))),xe=e.computed((()=>{const e=re.value&&ue.value?C.TEXT:!se.value||ke.value||ae.value?(null==D?void 0:D.value)?C.TEXT:v.type:C.TEXT,t={type:e,name:v.name,tabindex:we.value,disabled:v.disabled,readonly:v.readonly,required:v.required,autocomplete:v.autocomplete,"aria-invalid":Le.value,"aria-describedby":Ae.value?R.value:void 0,"aria-errormessage":Pe.value?R.value:void 0};return e!==C.DATE&&e!==C.MONTH&&e!==C.WEEK&&e!==C.TIME&&e!==C.DATETIME_LOCAL&&e!==C.NUMBER||(t.step=v.step,t.max=void 0!==v.max?String(v.max):void 0,t.min=void 0!==v.min?String(v.min):void 0),e!==C.TEXT&&e!==C.SEARCH&&e!==C.URL&&e!==C.TEL&&e!==C.EMAIL&&e!==C.PASSWORD&&e!==C.NUMBER||(t.placeholder=H.value),e!==C.TEXT&&e!==C.SEARCH&&e!==C.URL&&e!==C.TEL&&e!==C.EMAIL&&e!==C.PASSWORD||(t.minlength=v.minlength,t.maxlength=v.maxlength,t.pattern=v.pattern),e===C.EMAIL&&(t.multiple=v.multiple),t})),$e=e.computed((()=>({valid:v.valid,invalid:v.invalid,modelValue:v.modelValue,togglePassword:de,stepUp:ce,stepDown:pe,clear:me}))),{HintSlot:Te,hasHintLabelOrSlot:Ae,hasInvalidLabelOrSlot:Pe,hintSlotScope:Ce}=function(t,l){const o=e.computed((()=>e.isRef(t)?t.value:t)),a=e.computed((()=>i(o.value.invalidLabel))),n=e.computed((()=>i(o.value.validLabel))),u=e.computed((()=>o.value.loadingLabel)),r=e.computed((()=>o.value.hintLabel)),d=e.computed((()=>Boolean(o.value.loading&&(l.loading||u.value)))),s=e.computed((()=>!d.value&&Boolean(o.value.invalid&&(l.invalid||a.value)))),v=e.computed((()=>!d.value&&!s.value&&Boolean(o.value.valid&&(l.valid||n.value)))),c=e.computed((()=>!d.value&&!s.value&&!v.value&&Boolean(l.hint||r.value))),p=e.computed((()=>s.value||v.value||d.value||c.value)),f=e.computed((()=>({modelValue:o.value.modelValue,valid:o.value.valid,invalid:o.value.invalid,loading:o.value.loading}))),m=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:p,invalidLabel:a,validLabel:n,loadingLabel:u,hintLabel:r,hasInvalidLabelOrSlot:s,hasValidLabelOrSlot:v,hasLoadingLabelOrSlot:d,hasHintLabelOrSlot:c}),render(){var t,l,o,a,n,i,u,r;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(a=(o=this.$slots).invalid)?void 0:a.call(o))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(n=this.$slots).valid)?void 0:i.call(n))??this.validLabel):e.h(this.tag,{role:d},(null==(r=(u=this.$slots).hint)?void 0:r.call(u))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:s,hasHintLabelOrSlot:c,hasValidLabelOrSlot:v,hasLoadingLabelOrSlot:d,hintSlotScope:f,HintSlot:m}}(b,h),De=U(C.PASSWORD,v),Ie=U(C.NUMBER,v),Oe=U(C.SEARCH,v),Ve=()=>{Se.value&&(ae.value=!0)},_e=e.computed((()=>{if(v.autoWidth)return{width:void 0!==oe.value?`${String(oe.value).length+1}ch`:void 0}})),Ne=e=>{switch(e.code){case"ArrowUp":ve.value&&(ce(),e.preventDefault());break;case"ArrowDown":ve.value&&(pe(),e.preventDefault())}c("keydown",e)};return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Be))},[e.unref(w)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(M),class:"vv-input-text__label"},e.toDisplayString(e.unref(w)),9,j)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",F,[t.$slots.before?(e.openBlock(),e.createElementBlock("div",W,[e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref($e))))])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{ref_key:"innerEl",ref:le,class:"vv-input-text__inner",onClick:e.withModifiers(Ve,["stop"])},[e.unref(he)?(e.openBlock(),e.createBlock(m,e.mergeProps({key:0},e.unref(he),{class:"vv-input-text__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.createElementVNode("input",e.mergeProps({id:e.unref(M),ref_key:"inputEl",ref:te},e.unref(xe),{style:e.unref(_e),onKeyup:l[0]||(l[0]=e=>c("keyup",e)),onKeydown:Ne,onKeypress:l[1]||(l[1]=e=>c("keypress",e))}),null,16,z),(t.unit||t.$slots.unit)&&e.unref(ke)?(e.openBlock(),e.createElementBlock("div",q,[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps(e.unref($e))),(()=>[e.createTextVNode(e.toDisplayString(t.unit),1)]))])):e.createCommentVNode("v-if",!0)],512),e.unref(ye)?(e.openBlock(),e.createBlock(m,e.mergeProps({key:1},e.unref(ye),{class:"vv-input-text__icon vv-input-text__icon-after"}),null,16)):e.unref(re)&&!t.hideActions&&e.unref(Se)?(e.openBlock(),e.createBlock(e.unref(De),{key:2,onTogglePassword:de})):e.unref(ve)&&!t.hideActions&&e.unref(Se)?(e.openBlock(),e.createBlock(e.unref(Ie),{key:3,onStepUp:ce,onStepDown:pe})):e.unref(fe)&&!t.hideActions&&e.unref(Se)?(e.openBlock(),e.createBlock(e.unref(Oe),{key:4,onClear:me})):e.createCommentVNode("v-if",!0),t.$slots.after?(e.openBlock(),e.createElementBlock("div",K,[e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref($e))))])):e.createCommentVNode("v-if",!0),e.unref(L)?(e.openBlock(),e.createElementBlock("span",X,[e.renderSlot(t.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref($e))),(()=>[e.createTextVNode(e.toDisplayString(e.unref(ge)),1)]))])):e.createCommentVNode("v-if",!0)]),e.createVNode(e.unref(Te),{id:e.unref(R),class:"vv-input-text__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(Ce))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(Ce))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(Ce))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(Ce))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("vue-imask"),require("@iconify/vue"),require("uid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","vue-imask","@iconify/vue","uid","@vueuse/core"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvInputText=t(e.vue,e.vueImask,e.vue$1,e.uid,e.core)}(this,(function(e,t,l,o,a){"use strict";function n(t){return null==(l=e.unref(t))||""===l||Array.isArray(l)&&0===l.length||!(l instanceof Date)&&"object"==typeof l&&0===Object.keys(l).length;var l}function i(e){return Array.isArray(e)?e.filter((e=>{return"string"==typeof(t=e)||t instanceof String;var t})).join(" "):e}const u="eye-on",r="eye-off",d="calendar",s="time",c="color",v="close",p={prefix:"normal"};var f=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(f||{}),m=(e=>(e.before="before",e.after="after",e))(m||{}),h=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(h||{}),b=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(b||{});const y=Symbol.for("volver");function g(){return e.inject(y)}function S(t,l,o){return e.computed((()=>{const a={[t]:!0},n="string"==typeof(null==l?void 0:l.value)?l.value.split(" "):null==l?void 0:l.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(a[`${t}--${e}`]=!0)})),o&&Object.keys(o.value).forEach((l=>{a[`${t}--${l}`]=e.unref(o.value[l])})),a}))}const w=e.defineComponent({name:"VvIcon",props:e.mergeDefaults({name:{},color:{},width:{},height:{},provider:{},prefix:{},src:{},horizontalFlip:{type:Boolean},verticalFlip:{type:Boolean},flip:{},mode:{},inline:{type:Boolean},rotate:{},onLoad:{type:Function},svg:{},modifiers:{}},p),setup(t){const o=t,a=e.computed((()=>"string"==typeof o.rotate?parseFloat(o.rotate):o.rotate)),n=e.ref(!0),i=g(),{modifiers:u}=e.toRefs(o),r=S("vv-icon",u),d=e.computed((()=>o.provider||(null==i?void 0:i.iconsProvider))),s=e.computed((()=>{const e=o.name??"",t=`@${d.value}:${o.prefix}:${e}`;if(l.iconExists(t))return t;const a=null==i?void 0:i.iconsCollections.find((t=>{const o=`@${d.value}:${t.prefix}:${e}`;return l.iconExists(o)}));return a?`@${d.value}:${a.prefix}:${e}`:e}));function c(e){const t=function(e){let t;if("undefined"==typeof window){const{JSDOM:e}=require("jsdom");t=(new e).window}return(t?new t.DOMParser:new window.DOMParser).parseFromString(e,"text/html").querySelector("svg")}(e),a=(null==t?void 0:t.innerHTML.trim())||"";t&&a&&l.addIcon(`@${d.value}:${o.prefix}:${o.name}`,{body:a,height:t.viewBox.baseVal.height,width:t.viewBox.baseVal.width})}return i&&o.src&&!l.iconExists(`@${d.value}:${o.prefix}:${o.name}`)&&(n.value=!1,i.fetchIcon(o.src).then((e=>{e&&(c(e),n.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),o.svg&&c(o.svg),(t,o)=>e.unref(n)?(e.openBlock(),e.createBlock(e.unref(l.Icon),e.mergeProps({key:0,class:e.unref(r)},{inline:t.inline,width:t.width,height:t.height,horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip,flip:t.flip,rotate:e.unref(a),color:t.color,onLoad:t.onLoad,icon:e.unref(s)}),null,16,["class"])):e.createCommentVNode("v-if",!0)}}),k={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},L={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},E={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},B={disabled:{type:Boolean,default:!1}},x=(Boolean,Boolean,Boolean,{label:{type:[String,Number],default:void 0}}),$={readonly:{type:Boolean,default:!1}},C={modifiers:{type:[String,Array],default:void 0}},T={hintLabel:{type:String,default:""}},A={count:{type:[Boolean,String],default:!1,validator:e=>[!0,!1,"limit","countdown"].includes(e)}},I={debounce:{type:[Number,String],default:void 0}},P={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:m.before,validation:e=>Object.values(m).includes(e)}},O={tabindex:{type:[String,Number],default:0}},D={floating:{type:Boolean,default:!1}},V={id:[String,Number]};f.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const N={...{...V,name:{type:String,required:!0}},...{autofocus:{type:Boolean,default:!1}},...{autocomplete:{type:String,default:"off"}},...O,...B,...$,...k,...L,...T,...E,...C,...A,...I,...P,...D,...x,minlength:{type:[String,Number],default:void 0},maxlength:{type:[String,Number],default:void 0},placeholder:{type:String,default:void 0},required:{type:Boolean,default:!1}};h.button,b.button;const _={TEXT:"text",PASSWORD:"password",NUMBER:"number",EMAIL:"email",TEL:"tel",URL:"url",COLOR:"color",SEARCH:"search",DATE:"date",TIME:"time",DATETIME_LOCAL:"datetime-local",MONTH:"month",WEEK:"week"},M={...N,modelValue:[String,Number],type:{type:String,default:_.TEXT,validator:e=>Object.values(_).includes(e)},min:[Number,Date,String],max:[Number,Date,String],step:{type:[String,Number],default:1},pattern:String,multiple:Boolean,iconShowPassword:{type:[String,Object],default:u},iconHidePassword:{type:[String,Object],default:r},iconClear:{type:[String,Object],default:v},labelStepUp:{type:String,default:"Increase value"},labelStepDown:{type:String,default:"Decrease value"},labelShowPassword:{type:String,default:"Show password"},labelHidePassword:{type:String,default:"Hide password"},labelClear:{type:String,default:"Clear"},iMask:{type:Object,default:void 0},masked:{type:String,default:void 0},autoWidth:{type:Boolean,default:!1},hideActions:{type:Boolean,default:!1},unit:{type:String},selectOnFocus:{type:Boolean,default:!1}};function R(t,l){const o=e.computed((()=>"string"==typeof(null==t?void 0:t.value)?{name:null==t?void 0:t.value}:null==t?void 0:t.value)),a=e.computed((()=>(null==l?void 0:l.value)===m.before?o.value:void 0)),n=e.computed((()=>(null==l?void 0:l.value)===m.after?o.value:void 0)),i=e.computed((()=>(null==l?void 0:l.value)===f.left?o.value:void 0)),u=e.computed((()=>(null==l?void 0:l.value)===f.right?o.value:void 0)),r=e.computed((()=>(null==l?void 0:l.value)===f.top?o.value:void 0)),d=e.computed((()=>(null==l?void 0:l.value)===f.bottom?o.value:void 0));return{hasIcon:o,hasIconLeft:i,hasIconRight:u,hasIconTop:r,hasIconBottom:d,hasIconBefore:a,hasIconAfter:n}}const H=e.defineComponent({components:{VvIcon:w},props:{disabled:{type:Boolean,default:!1},labelShow:{type:String,default:"Show password"},labelHide:{type:String,default:"Hide password"},iconShow:{type:[String,Object],default:u},iconHide:{type:[String,Object],default:r}},emits:["toggle-password"],setup(t,{emit:l}){const o=e.ref(!1),a=e.computed((()=>o.value?t.iconHide:t.iconShow)),{hasIcon:n}=R(a);return{active:o,activeIcon:a,hasIcon:n,onClick:function(e){null==e||e.stopPropagation(),t.disabled||(o.value=!o.value,l("toggle-password",o.value))}}},render(){const t=this.hasIcon?e.h(w,{...this.hasIcon,class:"vv-input-text__icon"}):void 0;return e.h("button",{disabled:this.disabled,class:"vv-input-text__action",ariaLabel:this.active?this.labelHide:this.labelShow,type:"button",onClick:this.onClick},t)}}),U=e.defineComponent({components:{VvIcon:w},props:{disabled:{type:Boolean,default:!1},label:{type:String},mode:{type:String,validator:e=>["up","down"].includes(e),default:"up"}},emits:["step-up","step-down"],setup(t,{emit:l}){const o=e.computed((()=>"up"===t.mode));return{isUp:o,onClick:e=>{null==e||e.stopPropagation(),t.disabled||l(o.value?"step-up":"step-down")}}},render(){return e.h("button",{class:["vv-input-text__action vv-input-text__action-chevron",this.isUp&&"vv-input-text__action-chevron-up"],disabled:this.disabled,ariaLabel:this.label,type:"button",onClick:this.onClick})}}),j=e.defineComponent({components:{VvIcon:w},props:{disabled:{type:Boolean,default:!1},label:{type:String,default:"Clear"},icon:{type:[String,Object],default:"close"}},emits:["clear"],setup(t,{emit:l}){const{hasIcon:o}=R(e.computed((()=>t.icon)));return{hasIcon:o,onClick:function(e){null==e||e.stopPropagation(),t.disabled||l("clear")}}},render(){const t=this.hasIcon?e.h(w,{...this.hasIcon,class:"vv-input-text__icon"}):void 0;return e.h("button",{disabled:this.disabled,class:"vv-input-text__action",ariaLabel:this.label,type:"button",onClick:this.onClick},t)}});function F(t,l){return{name:"VvInputTextActions",components:{VvIcon:w,VvInputPasswordAction:H,VvInputStepAction:U,VvInputClearAction:j},setup:()=>({isDisabled:e.computed((()=>l.disabled||l.readonly)),labelStepUp:l.labelStepUp,labelStepDown:l.labelStepDown,labelShowPassword:l.labelShowPassword,labelHidePassword:l.labelHidePassword,labelClear:l.labelClear,iconShowPassword:l.iconShowPassword,iconHidePassword:l.iconHidePassword}),render(){let o=null;switch(t){case _.SEARCH:{const{onClear:t}=this.$attrs;o=[e.h(j,{disabled:this.isDisabled,label:this.labelShowPassword,onClear:t})];break}case _.PASSWORD:{const{onTogglePassword:t}=this.$attrs;o=[e.h(H,{disabled:this.isDisabled,onTogglePassword:t,labelShow:this.labelShowPassword,labelHide:this.labelHidePassword,iconShow:this.iconShowPassword,iconHide:this.iconHidePassword})];break}case _.NUMBER:{const{onStepUp:t,onStepDown:a}=this.$attrs;o=[e.h(U,{mode:"up",disabled:this.isDisabled||void 0!==l.max&&l.modelValue===l.max,label:this.labelStepUp,onStepUp:t,onStepDown:a}),e.h(U,{mode:"down",disabled:this.isDisabled||void 0!==l.min&&l.modelValue===l.min,label:this.labelStepDown,onStepUp:t,onStepDown:a})];break}}return Array.isArray(o)?e.h("div",{class:"vv-input-text__actions-group"},o):o}}}const W=["for"],z={class:"vv-input-text__wrapper"},q={key:0,class:"vv-input-text__input-before"},K=["id"],X={key:1,class:"vv-input-text__unit"},J={key:5,class:"vv-input-text__input-after"},Y={key:6,class:"vv-input-text__limit"};return e.defineComponent({name:"VvInputText",props:M,emits:["update:modelValue","update:masked","accept","accept:typed","accept:masked","accept:unmasked","complete","complete:typed","complete:masked","complete:unmasked","focus","blur","keyup","keydown","keypress"],setup(l,{expose:u,emit:r}){const v=l,p=r,f=e.useSlots(),m=function(t,l,o){const a=g(),n=e.computed((()=>{var e;if(a&&(null==(e=a.defaults.value)?void 0:e[t]))return a.defaults.value[t]}));return e.computed((()=>{if(void 0===n.value)return o;const e=n.value,t=l,a=o;return Object.keys(t).reduce(((l,o)=>{const n=a[o];if(l[o]=n,o in e){if(Array.isArray(t[o])){const a=t[o];a.length&&a[0]===n&&(l[o]=e[o])}if("function"==typeof t[o]&&(0,t[o])()===n&&(l[o]=e[o]),"object"==typeof t[o]){let a=t[o].default;"function"==typeof a&&(a=a()),"object"==typeof a?JSON.stringify(a)===JSON.stringify(n)&&(l[o]=e[o]):a===n&&(l[o]=e[o])}}return l}),{})}))}("VvInputText",M,v),{id:h,icon:b,iconPosition:y,label:k,modelValue:L,count:E,valid:B,invalid:x,loading:$,debounce:C,maxlength:T,minlength:A,type:I,iMask:P,step:O}=e.toRefs(v),D=(t=>e.computed((()=>String((null==t?void 0:t.value)||o.uid()))))(h),V=e.computed((()=>`${D.value}-hint`)),N=e.computed((()=>v.floating&&n(v.placeholder)?" ":v.placeholder)),H=e.ref(!1),{el:U,mask:j,typed:G,masked:Q,unmasked:Z}=t.useIMask(e.computed((()=>(null==P?void 0:P.value)??{mask:/./})),{emit:p,onAccept:()=>{if(H.value){if(p("update:masked",Q.value),I.value===_.NUMBER){if(""===Q.value){if(null===le.value||void 0===le.value)return;return void(le.value=void 0)}return"number"!=typeof G.value?void(le.value=Number(G.value)):void(le.value=G.value)}if(I.value===_.DATE){if(U.value instanceof HTMLInputElement&&"date"===U.value.type)return void(le.value=U.value.value);let e=G.value;if(null===e||""===e){if(!le.value)return;return void(le.value="")}return e instanceof Date||(e=new Date(e)),void(le.value=`${e.getFullYear()}-${("0"+(e.getMonth()+1)).slice(-2)}-${("0"+e.getDate()).slice(-2)}`)}if(I.value===_.DATETIME_LOCAL){if(U.value instanceof HTMLInputElement&&"datetime-local"===U.value.type)return void(le.value=U.value.value);let e=G.value;if(null===e||""===e){if(!le.value)return;return void(le.value="")}return G.value instanceof Date||(e=new Date(e)),void(le.value=`${e.getFullYear()}-${("0"+(e.getMonth()+1)).slice(-2)}-${("0"+e.getDate()).slice(-2)}T${("0"+e.getHours()).slice(-2)}:${("0"+e.getMinutes()).slice(-2)}`)}(le.value||Z.value)&&(le.value=Z.value)}}});e.onMounted((()=>{j.value&&(H.value=!0,G.value=le.value??"")})),e.watch((()=>v.modelValue),(e=>{var t;j.value&&(G.value=e&&(null==(t=null==P?void 0:P.value)?void 0:t.mask)===Date?new Date(e):e??"")})),e.watch((()=>v.masked),(e=>{Q.value=e??""}));const ee=U,te=e.ref();u({$inner:te});const le=function(t,l,o=0,{getter:a=(e=>e),setter:n=(e=>e)}={}){let i;return"string"==typeof o&&(o=parseInt(o)),e.computed({get:()=>a(null==t?void 0:t.value),set:e=>{i&&clearTimeout(i),i=setTimeout((()=>{l("update:modelValue",n(e))}),o)}})}(L,p,(null==C?void 0:C.value)??0),{focused:oe}=function(t,l){const{focused:o}=a.useFocus(t);return e.watch(o,(o=>{l(o?"focus":"blur",e.unref(t))})),{focused:o}}(ee,p),ae=e.computed((()=>oe.value&&!v.disabled&&!v.readonly));e.watch(ae,(e=>{e&&m.value.selectOnFocus&&ee.value&&ee.value.select()}));const ne=a.useElementVisibility(ee);e.watch(ne,(e=>{e&&v.autofocus&&!v.disabled&&!v.readonly&&(oe.value=!0)}));const ie=e.ref(!1),ue=e.computed((()=>v.type===_.PASSWORD)),re=()=>{ie.value=!ie.value},de=e.computed((()=>v.type===_.TIME||v.type===_.DATETIME_LOCAL||v.type===_.DATE||v.type===_.WEEK||v.type===_.MONTH)),se=e.computed((()=>v.type===_.NUMBER)),ce=()=>{if(ge.value){if(null==P?void 0:P.value)return void(G.value=G.value+Number((null==O?void 0:O.value)??1));ee.value.stepUp(),le.value=Number(e.unref(ee).value)}},ve=()=>{if(ge.value){if(null==P?void 0:P.value)return void(G.value=G.value-Number((null==O?void 0:O.value)??1));ee.value.stepDown(),le.value=Number(e.unref(ee).value)}},pe=e.computed((()=>v.type===_.SEARCH)),fe=()=>{le.value=""},{hasIconBefore:me,hasIconAfter:he}=R(b,y),be=e.computed((()=>{if(void 0!==he.value)return he.value;switch(v.type){case _.COLOR:return{name:c};case _.DATE:case _.DATETIME_LOCAL:case _.WEEK:case _.MONTH:return{name:d};case _.TIME:return{name:s}}})),{formatted:ye}=function(t,l){const o=e.computed((()=>(e.unref(t)??"").length)),a=e.computed((()=>void 0!==(null==l?void 0:l.lowerLimit)&&o.value<(null==l?void 0:l.lowerLimit)?o.value-l.lowerLimit:void 0!==(null==l?void 0:l.upperLimit)&&o.value<(null==l?void 0:l.upperLimit)?l.upperLimit-o.value:0)),n=e.computed((()=>{if(!1===(null==l?void 0:l.mode))return"";if("limit"===(null==l?void 0:l.mode)&&(null==l?void 0:l.upperLimit))return`${o.value} / ${l.lowerLimit?`${l.lowerLimit}-`:""}${l.upperLimit}`;if("countdown"===(null==l?void 0:l.mode)){if(0===a.value)return;return a}return o.value}));return{length:o,gap:a,formatted:n}}(le,{mode:E.value,upperLimit:Number(null==T?void 0:T.value),lowerLimit:Number(null==A?void 0:A.value)}),ge=e.computed((()=>!v.disabled&&!v.readonly)),Se=e.computed((()=>ge.value?v.tabindex:-1)),we=e.computed((()=>!n(L))),ke=e.computed((()=>!0===x.value||!0!==B.value&&void 0)),{modifiers:Le}=e.toRefs(v),Ee=S("vv-input-text",Le,e.computed((()=>({valid:B.value,invalid:x.value,loading:$.value,disabled:v.disabled,readonly:v.readonly,"icon-before":!!me.value,"icon-after":!!be.value,floating:v.floating&&!n(v.label),dirty:we.value,focus:ae.value,"auto-width":v.autoWidth})))),Be=e.computed((()=>{const e=ue.value&&ie.value?_.TEXT:!de.value||we.value||oe.value?(null==P?void 0:P.value)?_.TEXT:v.type:_.TEXT,t={type:e,name:v.name,tabindex:Se.value,disabled:v.disabled,readonly:v.readonly,required:v.required,autocomplete:v.autocomplete,"aria-invalid":ke.value,"aria-describedby":Ce.value?V.value:void 0,"aria-errormessage":Te.value?V.value:void 0};return e!==_.DATE&&e!==_.MONTH&&e!==_.WEEK&&e!==_.TIME&&e!==_.DATETIME_LOCAL&&e!==_.NUMBER||(t.step=v.step,t.max=void 0!==v.max?String(v.max):void 0,t.min=void 0!==v.min?String(v.min):void 0),e!==_.TEXT&&e!==_.SEARCH&&e!==_.URL&&e!==_.TEL&&e!==_.EMAIL&&e!==_.PASSWORD&&e!==_.NUMBER||(t.placeholder=N.value),e!==_.TEXT&&e!==_.SEARCH&&e!==_.URL&&e!==_.TEL&&e!==_.EMAIL&&e!==_.PASSWORD||(t.minlength=v.minlength,t.maxlength=v.maxlength,t.pattern=v.pattern),e===_.EMAIL&&(t.multiple=v.multiple),t})),xe=e.computed((()=>({valid:v.valid,invalid:v.invalid,modelValue:v.modelValue,togglePassword:re,stepUp:ce,stepDown:ve,clear:fe}))),{HintSlot:$e,hasHintLabelOrSlot:Ce,hasInvalidLabelOrSlot:Te,hintSlotScope:Ae}=function(t,l){const o=e.computed((()=>e.isRef(t)?t.value:t)),a=e.computed((()=>i(o.value.invalidLabel))),n=e.computed((()=>i(o.value.validLabel))),u=e.computed((()=>o.value.loadingLabel)),r=e.computed((()=>o.value.hintLabel)),d=e.computed((()=>Boolean(o.value.loading&&(l.loading||u.value)))),s=e.computed((()=>!d.value&&Boolean(o.value.invalid&&(l.invalid||a.value)))),c=e.computed((()=>!d.value&&!s.value&&Boolean(o.value.valid&&(l.valid||n.value)))),v=e.computed((()=>!d.value&&!s.value&&!c.value&&Boolean(l.hint||r.value))),p=e.computed((()=>s.value||c.value||d.value||v.value)),f=e.computed((()=>({modelValue:o.value.modelValue,valid:o.value.valid,invalid:o.value.invalid,loading:o.value.loading}))),m=e.defineComponent({name:"HintSlot",props:{tag:{type:String,default:"small"}},setup:()=>({isVisible:p,invalidLabel:a,validLabel:n,loadingLabel:u,hintLabel:r,hasInvalidLabelOrSlot:s,hasValidLabelOrSlot:c,hasLoadingLabelOrSlot:d,hasHintLabelOrSlot:v}),render(){var t,l,o,a,n,i,u,r;if(this.isVisible){let d;return this.hasInvalidLabelOrSlot&&(d="alert"),this.hasValidLabelOrSlot&&(d="status"),this.hasLoadingLabelOrSlot?e.h(this.tag,{role:d},(null==(l=(t=this.$slots).loading)?void 0:l.call(t))??this.loadingLabel):this.hasInvalidLabelOrSlot?e.h(this.tag,{role:d},(null==(a=(o=this.$slots).invalid)?void 0:a.call(o))??this.$slots.invalid??this.invalidLabel):this.hasValidLabelOrSlot?e.h(this.tag,{role:d},(null==(i=(n=this.$slots).valid)?void 0:i.call(n))??this.validLabel):e.h(this.tag,{role:d},(null==(r=(u=this.$slots).hint)?void 0:r.call(u))??this.$slots.hint??this.hintLabel)}return null}});return{hasInvalidLabelOrSlot:s,hasHintLabelOrSlot:v,hasValidLabelOrSlot:c,hasLoadingLabelOrSlot:d,hintSlotScope:f,HintSlot:m}}(m,f),Ie=F(_.PASSWORD,v),Pe=F(_.NUMBER,v),Oe=F(_.SEARCH,v),De=()=>{ge.value&&(oe.value=!0)},Ve=e.computed((()=>{if(v.autoWidth)return{width:void 0!==le.value?`${String(le.value).length+1}ch`:void 0}})),Ne=e=>{switch(e.code){case"ArrowUp":se.value&&(ce(),e.preventDefault());break;case"ArrowDown":se.value&&(ve(),e.preventDefault())}p("keydown",e)};return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Ee))},[e.unref(k)?(e.openBlock(),e.createElementBlock("label",{key:0,for:e.unref(D),class:"vv-input-text__label"},e.toDisplayString(e.unref(k)),9,W)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",z,[t.$slots.before?(e.openBlock(),e.createElementBlock("div",q,[e.createCommentVNode(" @slot Slot before input icon "),e.renderSlot(t.$slots,"before",e.normalizeProps(e.guardReactiveProps(e.unref(xe))))])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{ref_key:"innerEl",ref:te,class:"vv-input-text__inner",onClick:e.withModifiers(De,["stop"])},[e.unref(me)?(e.openBlock(),e.createBlock(w,e.mergeProps({key:0},e.unref(me),{class:"vv-input-text__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.createElementVNode("input",e.mergeProps({id:e.unref(D),ref_key:"inputEl",ref:ee},e.unref(Be),{style:e.unref(Ve),onKeyup:l[0]||(l[0]=e=>p("keyup",e)),onKeydown:Ne,onKeypress:l[1]||(l[1]=e=>p("keypress",e))}),null,16,K),(t.unit||t.$slots.unit)&&e.unref(we)?(e.openBlock(),e.createElementBlock("div",X,[e.createCommentVNode(" @slot Slot to replace unit"),e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps(e.unref(xe))),(()=>[e.createTextVNode(e.toDisplayString(t.unit),1)]))])):e.createCommentVNode("v-if",!0)],512),e.createCommentVNode(" @slot Slot to replace right icon "),e.unref(be)?(e.openBlock(),e.createBlock(w,e.mergeProps({key:1},e.unref(be),{class:"vv-input-text__icon vv-input-text__icon-after"}),null,16)):e.unref(ue)&&!t.hideActions&&e.unref(ge)?(e.openBlock(),e.createBlock(e.unref(Ie),{key:2,onTogglePassword:re})):e.unref(se)&&!t.hideActions&&e.unref(ge)?(e.openBlock(),e.createBlock(e.unref(Pe),{key:3,onStepUp:ce,onStepDown:ve})):e.unref(pe)&&!t.hideActions&&e.unref(ge)?(e.openBlock(),e.createBlock(e.unref(Oe),{key:4,onClear:fe})):e.createCommentVNode("v-if",!0),e.createCommentVNode(" @slot Slot after input "),t.$slots.after?(e.openBlock(),e.createElementBlock("div",J,[e.createCommentVNode(" @slot Slot before input icon "),e.renderSlot(t.$slots,"after",e.normalizeProps(e.guardReactiveProps(e.unref(xe))))])):e.createCommentVNode("v-if",!0),e.unref(E)?(e.openBlock(),e.createElementBlock("span",Y,[e.createCommentVNode(" @slot Slot to replace count "),e.renderSlot(t.$slots,"count",e.normalizeProps(e.guardReactiveProps(e.unref(xe))),(()=>[e.createTextVNode(e.toDisplayString(e.unref(ye)),1)]))])):e.createCommentVNode("v-if",!0)]),e.createVNode(e.unref($e),{id:e.unref(V),class:"vv-input-text__hint"},e.createSlots({_:2},[t.$slots.hint?{name:"hint",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"hint",e.normalizeProps(e.guardReactiveProps(e.unref(Ae))))])),key:"0"}:void 0,t.$slots.loading?{name:"loading",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"loading",e.normalizeProps(e.guardReactiveProps(e.unref(Ae))))])),key:"1"}:void 0,t.$slots.valid?{name:"valid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"valid",e.normalizeProps(e.guardReactiveProps(e.unref(Ae))))])),key:"2"}:void 0,t.$slots.invalid?{name:"invalid",fn:e.withCtx((()=>[e.renderSlot(t.$slots,"invalid",e.normalizeProps(e.guardReactiveProps(e.unref(Ae))))])),key:"3"}:void 0]),1032,["id"])],2))}})}));
|
|
@@ -14,15 +14,15 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
14
14
|
pattern: StringConstructor;
|
|
15
15
|
multiple: BooleanConstructor;
|
|
16
16
|
iconShowPassword: {
|
|
17
|
-
type:
|
|
17
|
+
type: globalThis.PropType<string | import("../VvIcon").VvIconProps>;
|
|
18
18
|
default: "eye-on";
|
|
19
19
|
};
|
|
20
20
|
iconHidePassword: {
|
|
21
|
-
type:
|
|
21
|
+
type: globalThis.PropType<string | import("../VvIcon").VvIconProps>;
|
|
22
22
|
default: "eye-off";
|
|
23
23
|
};
|
|
24
24
|
iconClear: {
|
|
25
|
-
type:
|
|
25
|
+
type: globalThis.PropType<string | import("../VvIcon").VvIconProps>;
|
|
26
26
|
default: "close";
|
|
27
27
|
};
|
|
28
28
|
labelStepUp: {
|
|
@@ -171,7 +171,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
171
171
|
$inner: globalThis.Ref<any>;
|
|
172
172
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
173
173
|
[x: string]: (...args: any[]) => void;
|
|
174
|
-
}, string, import("vue").
|
|
174
|
+
}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
175
175
|
modelValue: (StringConstructor | NumberConstructor)[];
|
|
176
176
|
type: {
|
|
177
177
|
type: globalThis.PropType<import("../VvInputText").InputType>;
|
|
@@ -187,15 +187,15 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
187
187
|
pattern: StringConstructor;
|
|
188
188
|
multiple: BooleanConstructor;
|
|
189
189
|
iconShowPassword: {
|
|
190
|
-
type:
|
|
190
|
+
type: globalThis.PropType<string | import("../VvIcon").VvIconProps>;
|
|
191
191
|
default: "eye-on";
|
|
192
192
|
};
|
|
193
193
|
iconHidePassword: {
|
|
194
|
-
type:
|
|
194
|
+
type: globalThis.PropType<string | import("../VvIcon").VvIconProps>;
|
|
195
195
|
default: "eye-off";
|
|
196
196
|
};
|
|
197
197
|
iconClear: {
|
|
198
|
-
type:
|
|
198
|
+
type: globalThis.PropType<string | import("../VvIcon").VvIconProps>;
|
|
199
199
|
default: "close";
|
|
200
200
|
};
|
|
201
201
|
labelStepUp: {
|
|
@@ -363,9 +363,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
363
363
|
autocomplete: string;
|
|
364
364
|
autofocus: boolean;
|
|
365
365
|
step: string | number;
|
|
366
|
-
iconShowPassword: string;
|
|
367
|
-
iconHidePassword: string;
|
|
368
|
-
iconClear: string;
|
|
366
|
+
iconShowPassword: string | import("../VvIcon").VvIconProps;
|
|
367
|
+
iconHidePassword: string | import("../VvIcon").VvIconProps;
|
|
368
|
+
iconClear: string | import("../VvIcon").VvIconProps;
|
|
369
369
|
labelStepUp: string;
|
|
370
370
|
labelStepDown: string;
|
|
371
371
|
labelShowPassword: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import type { FactoryOpts } from 'imask';
|
|
3
|
+
import { type VvIconProps } from '../VvIcon';
|
|
3
4
|
export declare const INPUT_TYPES: {
|
|
4
5
|
readonly TEXT: "text";
|
|
5
6
|
readonly PASSWORD: "password";
|
|
@@ -16,14 +17,6 @@ export declare const INPUT_TYPES: {
|
|
|
16
17
|
readonly WEEK: "week";
|
|
17
18
|
};
|
|
18
19
|
export type InputType = ValueOf<typeof INPUT_TYPES>;
|
|
19
|
-
export declare const TYPES_ICON: {
|
|
20
|
-
readonly PASSWORD_SHOW: "eye-on";
|
|
21
|
-
readonly PASSWORD_HIDE: "eye-off";
|
|
22
|
-
readonly DATE: "calendar";
|
|
23
|
-
readonly TIME: "time";
|
|
24
|
-
readonly COLOR: "color";
|
|
25
|
-
readonly SEARCH: "close";
|
|
26
|
-
};
|
|
27
20
|
export declare const VvInputTextEvents: string[];
|
|
28
21
|
export declare const VvInputTextProps: {
|
|
29
22
|
/**
|
|
@@ -78,7 +71,7 @@ export declare const VvInputTextProps: {
|
|
|
78
71
|
* @see VVIcon
|
|
79
72
|
*/
|
|
80
73
|
iconShowPassword: {
|
|
81
|
-
type:
|
|
74
|
+
type: PropType<string | VvIconProps>;
|
|
82
75
|
default: "eye-on";
|
|
83
76
|
};
|
|
84
77
|
/**
|
|
@@ -86,7 +79,7 @@ export declare const VvInputTextProps: {
|
|
|
86
79
|
* @see VVIcon
|
|
87
80
|
*/
|
|
88
81
|
iconHidePassword: {
|
|
89
|
-
type:
|
|
82
|
+
type: PropType<string | VvIconProps>;
|
|
90
83
|
default: "eye-off";
|
|
91
84
|
};
|
|
92
85
|
/**
|
|
@@ -94,7 +87,7 @@ export declare const VvInputTextProps: {
|
|
|
94
87
|
* @see VVIcon
|
|
95
88
|
*/
|
|
96
89
|
iconClear: {
|
|
97
|
-
type:
|
|
90
|
+
type: PropType<string | VvIconProps>;
|
|
98
91
|
default: "close";
|
|
99
92
|
};
|
|
100
93
|
/**
|
|
@@ -199,7 +192,7 @@ export declare const VvInputTextProps: {
|
|
|
199
192
|
default: boolean;
|
|
200
193
|
};
|
|
201
194
|
icon: {
|
|
202
|
-
type: PropType<string |
|
|
195
|
+
type: PropType<string | VvIconProps>;
|
|
203
196
|
default: undefined;
|
|
204
197
|
};
|
|
205
198
|
iconPosition: {
|
|
@@ -210,9 +203,7 @@ export declare const VvInputTextProps: {
|
|
|
210
203
|
debounce: {
|
|
211
204
|
type: (StringConstructor | NumberConstructor)[];
|
|
212
205
|
default: undefined;
|
|
213
|
-
};
|
|
214
|
-
* Hide type number, password and search actions
|
|
215
|
-
*/
|
|
206
|
+
};
|
|
216
207
|
count: {
|
|
217
208
|
type: (BooleanConstructor | StringConstructor)[];
|
|
218
209
|
default: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { inject, defineComponent, ref, watch, computed, openBlock, createBlock, resolveDynamicComponent, unref, mergeProps, withCtx, renderSlot, createTextVNode, toDisplayString, createElementBlock, createVNode, toRefs, normalizeClass, createElementVNode, withModifiers, Fragment, renderList, toHandlers, normalizeProps, guardReactiveProps } from "vue";
|
|
1
|
+
import { inject, defineComponent, ref, watch, computed, openBlock, createBlock, resolveDynamicComponent, unref, mergeProps, withCtx, createCommentVNode, renderSlot, createTextVNode, toDisplayString, createElementBlock, createVNode, toRefs, normalizeClass, createElementVNode, withModifiers, Fragment, renderList, toHandlers, normalizeProps, guardReactiveProps } from "vue";
|
|
2
2
|
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
3
3
|
Strategy2["absolute"] = "absolute";
|
|
4
4
|
Strategy2["fixed"] = "fixed";
|
|
@@ -406,6 +406,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
406
406
|
onMouseleavePassive: onMouseleave
|
|
407
407
|
}), {
|
|
408
408
|
default: withCtx(() => [
|
|
409
|
+
createCommentVNode(" @slot Default slot "),
|
|
409
410
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
410
411
|
createTextVNode(
|
|
411
412
|
toDisplayString(_ctx.label),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvNav=t(e.vue)}(this,(function(e){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),n=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(n||{}),a=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(a||{});const l=Symbol.for("volver"),i=Symbol.for("dropdownTrigger"),u=Symbol.for("dropdownAction"),s={to:{type:[String,Object]},href:String,target:{type:String,default:void 0,validator:e=>Object.values(a).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:{type:Boolean,default:!1}},c={active:{type:Boolean,default:!1}},
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvNav=t(e.vue)}(this,(function(e){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),n=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(n||{}),a=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(a||{});const l=Symbol.for("volver"),i=Symbol.for("dropdownTrigger"),u=Symbol.for("dropdownAction"),s={to:{type:[String,Object]},href:String,target:{type:String,default:void 0,validator:e=>Object.values(a).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:{type:Boolean,default:!1}},c={active:{type:Boolean,default:!1}},f={current:{type:Boolean,default:!1}},v={pressed:{type:Boolean,default:!1}},p={label:{type:[String,Number],default:void 0}},m={modifiers:{type:[String,Array],default:void 0}};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...d,...p,...v,...c,...f,...s,type:{type:String,default:r.button,validator:e=>Object.values(r).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:n.button}},y={...m,...{items:{type:Array,default:()=>[]}}},g=b;const k=e.defineComponent({name:"VvAction",props:g,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){const a=t,s=r,d=e.inject(l),c=e.ref(null);o({$el:c});const{reference:f,bus:v,aria:p,expanded:m}=e.inject(i,{});e.watch((()=>c.value),(e=>{f&&(f.value=e)}));const b=e.computed((()=>a.pressed||(null==m?void 0:m.value))),{role:y}=e.inject(u,{}),g=e.computed((()=>{switch(!0){case a.disabled:return n.button;case void 0!==a.to:return(null==d?void 0:d.nuxt)?n.nuxtLink:n.routerLink;case void 0!==a.href:return n.a;default:return a.defaultTag}})),k=e.computed((()=>{const e={...null==p?void 0:p.value,ariaPressed:!!b.value||void 0,ariaLabel:a.ariaLabel,role:null==y?void 0:y.value};switch(g.value){case n.a:return{...e,href:a.href,target:a.target,rel:a.rel};case n.routerLink:case n.nuxtLink:return{...e,to:a.to,target:a.target};case n.button:return{...e,type:a.type,disabled:a.disabled};default:return e}})),B=e=>{a.disabled?e.preventDefault():(null==v||v.emit("click",e),s("click",e))},_=e=>{null==v||v.emit("mouseover",e),s("mouseover",e)},h=e=>{null==v||v.emit("mouseleave",e),s("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(g)),e.mergeProps(e.unref(k),{ref_key:"element",ref:c,class:{active:t.active,pressed:e.unref(b),disabled:t.disabled,current:t.current},onClickPassive:B,onMouseoverPassive:_,onMouseleavePassive:h}),{default:e.withCtx((()=>[e.createCommentVNode(" @slot Default slot "),e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}}),B={class:"vv-nav__item",role:"presentation"},_=e.defineComponent({name:"VvNavItem",inheritAttrs:!1,setup:t=>(t,o)=>(e.openBlock(),e.createElementBlock("li",B,[e.createVNode(k,e.mergeProps(t.$attrs,{class:"vv-nav__item-label"}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default")])),_:3},16)]))});return e.defineComponent({__name:"VvNav",props:y,emits:["click"],setup(t,{emit:o}){const r=t,{modifiers:n}=e.toRefs(r),a=o,l=e=>{var t;const o=e.target;if(null==o?void 0:o.dataset.index){const e=parseInt(o.dataset.index),n=null==(t=r.items)?void 0:t[e];if(!n||(null==n?void 0:n.disabled))return;a("click",n)}},i=function(t,o,r){return e.computed((()=>{const n={[t]:!0},a="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return a&&Array.isArray(a)&&a.forEach((e=>{e&&(n[`${t}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((o=>{n[`${t}--${o}`]=e.unref(r.value[o])})),n}))}("vv-nav",n);return(t,o)=>(e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(e.unref(i))},[e.createElementVNode("ul",{class:"vv-nav__menu",role:"menu","aria-busy":"true",onClick:e.withModifiers(l,["stop"])},[e.renderSlot(t.$slots,"default",{},(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(({on:o={},data:r,...n},a)=>(e.openBlock(),e.createBlock(_,e.mergeProps({key:a,"data-index":a},n,e.toHandlers(o)),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"item",e.normalizeProps(e.guardReactiveProps({item:n,data:r,index:a})))])),_:2},1040,["data-index"])))),128))]))])],2))}})}));
|
|
@@ -9,7 +9,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
9
9
|
};
|
|
10
10
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
11
|
[x: string]: (...args: any[]) => void;
|
|
12
|
-
}, string, import("vue").
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
13
13
|
items: {
|
|
14
14
|
type: globalThis.PropType<import("../..").NavItem[]>;
|
|
15
15
|
default: () => never[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{}>>, {}, {}>, {
|
|
2
2
|
default?(_: {}): any;
|
|
3
3
|
}>;
|
|
4
4
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{}>>, {}, {}>;
|
|
2
2
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { inject, defineComponent, ref, watch, computed, openBlock, createBlock, resolveDynamicComponent, unref, mergeProps, withCtx, renderSlot, createTextVNode, toDisplayString, createElementBlock, createVNode } from "vue";
|
|
1
|
+
import { inject, defineComponent, ref, watch, computed, openBlock, createBlock, resolveDynamicComponent, unref, mergeProps, withCtx, createCommentVNode, renderSlot, createTextVNode, toDisplayString, createElementBlock, createVNode } from "vue";
|
|
2
2
|
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
3
3
|
Strategy2["absolute"] = "absolute";
|
|
4
4
|
Strategy2["fixed"] = "fixed";
|
|
@@ -386,6 +386,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
386
386
|
onMouseleavePassive: onMouseleave
|
|
387
387
|
}), {
|
|
388
388
|
default: withCtx(() => [
|
|
389
|
+
createCommentVNode(" @slot Default slot "),
|
|
389
390
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
390
391
|
createTextVNode(
|
|
391
392
|
toDisplayString(_ctx.label),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvNavItem=t(e.vue)}(this,(function(e){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),n=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(n||{}),l=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(l||{});const a=Symbol.for("volver"),u=Symbol.for("dropdownTrigger"),i=Symbol.for("dropdownAction"),s={to:{type:[String,Object]},href:String,target:{type:String,default:void 0,validator:e=>Object.values(l).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:{type:Boolean,default:!1}},c={active:{type:Boolean,default:!1}},f={current:{type:Boolean,default:!1}},v={pressed:{type:Boolean,default:!1}},p={label:{type:[String,Number],default:void 0}};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...d,...p,...v,...c,...f,...s,type:{type:String,default:r.button,validator:e=>Object.values(r).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:n.button}};const m=e.defineComponent({name:"VvAction",props:b,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){const l=t,s=r,d=e.inject(a),c=e.ref(null);o({$el:c});const{reference:f,bus:v,aria:p,expanded:b}=e.inject(u,{});e.watch((()=>c.value),(e=>{f&&(f.value=e)}));const m=e.computed((()=>l.pressed||(null==b?void 0:b.value))),{role:g}=e.inject(i,{}),y=e.computed((()=>{switch(!0){case l.disabled:return n.button;case void 0!==l.to:return(null==d?void 0:d.nuxt)?n.nuxtLink:n.routerLink;case void 0!==l.href:return n.a;default:return l.defaultTag}})),k=e.computed((()=>{const e={...null==p?void 0:p.value,ariaPressed:!!m.value||void 0,ariaLabel:l.ariaLabel,role:null==g?void 0:g.value};switch(y.value){case n.a:return{...e,href:l.href,target:l.target,rel:l.rel};case n.routerLink:case n.nuxtLink:return{...e,to:l.to,target:l.target};case n.button:return{...e,type:l.type,disabled:l.disabled};default:return e}})),B=e=>{l.disabled?e.preventDefault():(null==v||v.emit("click",e),s("click",e))},h=e=>{null==v||v.emit("mouseover",e),s("mouseover",e)},_=e=>{null==v||v.emit("mouseleave",e),s("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(y)),e.mergeProps(e.unref(k),{ref_key:"element",ref:c,class:{active:t.active,pressed:e.unref(m),disabled:t.disabled,current:t.current},onClickPassive:B,onMouseoverPassive:h,onMouseleavePassive:_}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}}),g={class:"vv-nav__item",role:"presentation"};return e.defineComponent({name:"VvNavItem",inheritAttrs:!1,setup:t=>(t,o)=>(e.openBlock(),e.createElementBlock("li",g,[e.createVNode(m,e.mergeProps(t.$attrs,{class:"vv-nav__item-label"}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default")])),_:3},16)]))})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvNavItem=t(e.vue)}(this,(function(e){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(t||{}),o=(e=>(e.before="before",e.after="after",e))(o||{}),r=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(r||{}),n=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(n||{}),l=(e=>(e._blank="_blank",e._self="_self",e._parent="_parent",e._top="_top",e))(l||{});const a=Symbol.for("volver"),u=Symbol.for("dropdownTrigger"),i=Symbol.for("dropdownAction"),s={to:{type:[String,Object]},href:String,target:{type:String,default:void 0,validator:e=>Object.values(l).includes(e)},rel:{type:String,default:"noopener noreferrer"}},d={disabled:{type:Boolean,default:!1}},c={active:{type:Boolean,default:!1}},f={current:{type:Boolean,default:!1}},v={pressed:{type:Boolean,default:!1}},p={label:{type:[String,Number],default:void 0}};o.before,t.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const b={...d,...p,...v,...c,...f,...s,type:{type:String,default:r.button,validator:e=>Object.values(r).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:n.button}};const m=e.defineComponent({name:"VvAction",props:b,emits:["click","mouseover","mouseleave"],setup(t,{expose:o,emit:r}){const l=t,s=r,d=e.inject(a),c=e.ref(null);o({$el:c});const{reference:f,bus:v,aria:p,expanded:b}=e.inject(u,{});e.watch((()=>c.value),(e=>{f&&(f.value=e)}));const m=e.computed((()=>l.pressed||(null==b?void 0:b.value))),{role:g}=e.inject(i,{}),y=e.computed((()=>{switch(!0){case l.disabled:return n.button;case void 0!==l.to:return(null==d?void 0:d.nuxt)?n.nuxtLink:n.routerLink;case void 0!==l.href:return n.a;default:return l.defaultTag}})),k=e.computed((()=>{const e={...null==p?void 0:p.value,ariaPressed:!!m.value||void 0,ariaLabel:l.ariaLabel,role:null==g?void 0:g.value};switch(y.value){case n.a:return{...e,href:l.href,target:l.target,rel:l.rel};case n.routerLink:case n.nuxtLink:return{...e,to:l.to,target:l.target};case n.button:return{...e,type:l.type,disabled:l.disabled};default:return e}})),B=e=>{l.disabled?e.preventDefault():(null==v||v.emit("click",e),s("click",e))},h=e=>{null==v||v.emit("mouseover",e),s("mouseover",e)},_=e=>{null==v||v.emit("mouseleave",e),s("mouseleave",e)};return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(y)),e.mergeProps(e.unref(k),{ref_key:"element",ref:c,class:{active:t.active,pressed:e.unref(m),disabled:t.disabled,current:t.current},onClickPassive:B,onMouseoverPassive:h,onMouseleavePassive:_}),{default:e.withCtx((()=>[e.createCommentVNode(" @slot Default slot "),e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]))])),_:3},16,["class"]))}}),g={class:"vv-nav__item",role:"presentation"};return e.defineComponent({name:"VvNavItem",inheritAttrs:!1,setup:t=>(t,o)=>(e.openBlock(),e.createElementBlock("li",g,[e.createVNode(m,e.mergeProps(t.$attrs,{class:"vv-nav__item-label"}),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default")])),_:3},16)]))})}));
|
|
@@ -14,7 +14,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
14
14
|
type: globalThis.PropType<string | string[]>;
|
|
15
15
|
default: undefined;
|
|
16
16
|
};
|
|
17
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
17
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
18
18
|
value: {
|
|
19
19
|
type: (StringConstructor | NumberConstructor)[];
|
|
20
20
|
default: undefined;
|