@volverjs/ui-vue 0.0.10-beta.3 → 0.0.10-beta.31
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/LICENSE +1 -1
- package/README.md +106 -10
- package/auto-imports.d.ts +7 -2
- package/bin/icons.cjs +1 -1
- package/bin/icons.js +22 -15
- package/dist/Volver.d.ts +1 -1
- package/dist/components/VvAccordion/VvAccordion.es.js +192 -103
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +160 -8
- package/dist/components/VvAccordion/index.d.ts +8 -9
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +451 -172
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +58 -13
- package/dist/components/VvAccordionGroup/index.d.ts +14 -6
- package/dist/components/VvAction/VvAction.es.js +78 -27
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +57 -22
- package/dist/components/VvAction/index.d.ts +25 -9
- package/dist/components/VvAlert/VvAlert.es.js +204 -171
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +24 -14
- package/dist/components/VvAlert/index.d.ts +17 -9
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +250 -188
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +16 -9
- package/dist/components/VvAlertGroup/index.d.ts +6 -14
- package/dist/components/VvAvatar/VvAvatar.es.js +61 -21
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
- package/dist/components/VvAvatar/VvAvatar.vue.d.ts +12 -4
- package/dist/components/VvAvatar/index.d.ts +4 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +118 -48
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +10 -3
- package/dist/components/VvAvatarGroup/index.d.ts +4 -1
- package/dist/components/VvBadge/VvBadge.es.js +78 -28
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.vue.d.ts +12 -4
- package/dist/components/VvBadge/index.d.ts +4 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +276 -60
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +27 -7
- package/dist/components/VvBreadcrumb/index.d.ts +6 -10
- package/dist/components/VvButton/VvButton.es.js +291 -252
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +94 -40
- package/dist/components/VvButton/index.d.ts +51 -29
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +81 -40
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +24 -11
- package/dist/components/VvButtonGroup/index.d.ts +8 -2
- package/dist/components/VvCard/VvCard.es.js +86 -36
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCard/VvCard.vue.d.ts +12 -4
- package/dist/components/VvCard/index.d.ts +4 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +177 -120
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +105 -33
- package/dist/components/VvCheckbox/index.d.ts +47 -14
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +190 -107
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +101 -30
- package/dist/components/VvCheckboxGroup/index.d.ts +45 -12
- package/dist/components/VvCombobox/VvCombobox.es.js +806 -581
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +171 -104
- package/dist/components/VvCombobox/index.d.ts +62 -26
- package/dist/components/VvDialog/VvDialog.es.js +140 -153
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +4 -4
- package/dist/components/VvDropdown/VvDropdown.es.js +138 -71
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +101 -75
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +66 -25
- package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +13 -1
- package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +12 -4
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +35 -7
- package/dist/components/VvDropdown/index.d.ts +52 -10
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +152 -39
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +335 -8
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +63 -20
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +188 -80
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +23 -96
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.vue.d.ts +23 -66
- package/dist/components/VvIcon/index.d.ts +33 -48
- package/dist/components/VvInputFile/VvInputFile.es.js +1777 -0
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -0
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +359 -0
- package/dist/components/VvInputFile/index.d.ts +200 -0
- package/dist/components/VvInputText/VvInputClearAction.d.ts +7 -5
- package/dist/components/VvInputText/VvInputPasswordAction.d.ts +10 -8
- package/dist/components/VvInputText/VvInputStepAction.d.ts +2 -2
- package/dist/components/VvInputText/VvInputText.es.js +1237 -324
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +207 -57
- package/dist/components/VvInputText/index.d.ts +99 -29
- package/dist/components/VvNav/VvNav.es.js +135 -56
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/VvNav.vue.d.ts +32 -9
- package/dist/components/VvNav/VvNavItem.vue.d.ts +1 -1
- package/dist/components/VvNav/VvNavSeparator.vue.d.ts +1 -1
- package/dist/components/VvNav/index.d.ts +5 -2
- package/dist/components/VvNavItem/VvNavItem.es.js +91 -33
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.es.js +72 -26
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.vue.d.ts +10 -3
- package/dist/components/VvProgress/index.d.ts +4 -1
- package/dist/components/VvRadio/VvRadio.es.js +160 -103
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +103 -31
- package/dist/components/VvRadio/index.d.ts +50 -17
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +190 -107
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +101 -30
- package/dist/components/VvRadioGroup/index.d.ts +45 -12
- package/dist/components/VvSelect/VvSelect.es.js +251 -238
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +117 -44
- package/dist/components/VvSelect/index.d.ts +48 -14
- package/dist/components/VvTab/VvTab.es.js +191 -75
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTab/VvTab.vue.d.ts +31 -7
- package/dist/components/VvTab/index.d.ts +4 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +232 -224
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +156 -49
- package/dist/components/VvTextarea/index.d.ts +68 -19
- package/dist/components/VvTooltip/VvTooltip.es.js +79 -29
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +13 -6
- package/dist/components/VvTooltip/index.d.ts +5 -2
- package/dist/components/common/HintSlot.d.ts +1 -1
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.es.js +3534 -1650
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +99 -4
- package/dist/composables/alert/useInjectAlert.d.ts +1 -6
- package/dist/composables/dropdown/useInjectDropdown.d.ts +3 -23
- package/dist/composables/dropdown/useProvideDropdown.d.ts +3 -4
- package/dist/composables/group/useInjectedGroupState.d.ts +4 -5
- package/dist/composables/group/useProvideGroupState.d.ts +3 -3
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.es.js +92 -3
- package/dist/composables/index.umd.js +1 -1
- package/dist/composables/useBlurhash.d.ts +7 -0
- package/dist/composables/useComponentIcon.d.ts +9 -8
- package/dist/composables/usePersistence.d.ts +2 -0
- package/dist/composables/useVolver.d.ts +1 -1
- package/dist/constants.d.ts +34 -32
- package/dist/directives/index.d.ts +3 -5
- package/dist/directives/index.es.js +99 -43
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +97 -38
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.es.js +267 -267
- package/dist/icons.umd.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.es.js +90 -16
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +272 -81
- package/dist/resolvers/unplugin.d.ts +6 -1
- package/dist/resolvers/unplugin.es.js +87 -10
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +143 -89
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +1075 -492
- package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +1 -1
- package/dist/stories/Blurhash/BlurhashComposable.stories.d.ts +4 -0
- package/dist/stories/Button/Button.settings.d.ts +0 -1
- package/dist/stories/Combobox/Combobox.settings.d.ts +8 -0
- package/dist/stories/Icon/Icon.settings.d.ts +1 -0
- package/dist/stories/InputFile/InputFile.settings.d.ts +56 -0
- package/dist/stories/InputFile/InputFile.stories.d.ts +12 -0
- package/dist/stories/InputFile/InputFileDropArea.stories.d.ts +9 -0
- package/dist/stories/InputFile/InputFileIconPosition.stories.d.ts +8 -0
- package/dist/stories/InputFile/InputFileSlots.stories.d.ts +7 -0
- package/dist/stories/Tab/Tab.settings.d.ts +2 -15
- package/dist/test/expect.d.ts +1 -1
- package/dist/types/alert.d.ts +9 -7
- package/dist/types/blurhash.d.ts +12 -0
- package/dist/types/generic.d.ts +1 -2
- package/dist/types/group.d.ts +37 -15
- package/dist/types/index.d.ts +7 -0
- package/dist/types/input-file.d.ts +16 -0
- package/dist/types/nav.d.ts +2 -2
- package/dist/utils/ObjectUtilities.d.ts +0 -1
- package/dist/workers/blurhash.d.ts +1 -0
- package/package.json +78 -78
- package/src/Volver.ts +31 -20
- 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/VvAccordion/VvAccordion.vue +121 -58
- package/src/components/VvAccordion/index.ts +8 -23
- package/src/components/VvAccordionGroup/VvAccordionGroup.vue +164 -47
- package/src/components/VvAccordionGroup/index.ts +6 -6
- package/src/components/VvAction/VvAction.vue +17 -5
- package/src/components/VvAlert/index.ts +14 -9
- package/src/components/VvAlertGroup/index.ts +3 -15
- package/src/components/VvBreadcrumb/VvBreadcrumb.vue +20 -19
- package/src/components/VvBreadcrumb/index.ts +2 -8
- package/src/components/VvButton/VvButton.vue +17 -7
- package/src/components/VvButton/index.ts +9 -16
- package/src/components/VvButtonGroup/VvButtonGroup.vue +1 -2
- package/src/components/VvCheckbox/index.ts +2 -2
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +1 -2
- package/src/components/VvCombobox/VvCombobox.vue +15 -12
- package/src/components/VvCombobox/index.ts +4 -0
- package/src/components/VvDropdown/VvDropdown.vue +11 -2
- package/src/components/VvDropdown/VvDropdownItem.vue +4 -1
- package/src/components/VvDropdown/VvDropdownOption.vue +4 -21
- package/src/components/VvDropdown/index.ts +35 -1
- package/src/components/VvIcon/VvIcon.vue +2 -2
- package/src/components/VvIcon/index.ts +35 -48
- package/src/components/VvInputFile/VvInputFile.vue +395 -0
- package/src/components/VvInputFile/index.ts +135 -0
- package/src/components/VvInputText/VvInputClearAction.ts +10 -6
- package/src/components/VvInputText/VvInputPasswordAction.ts +13 -9
- package/src/components/VvInputText/VvInputText.vue +141 -33
- package/src/components/VvInputText/index.ts +31 -16
- package/src/components/VvNav/VvNav.vue +4 -2
- package/src/components/VvRadio/index.ts +5 -5
- package/src/components/VvRadioGroup/VvRadioGroup.vue +1 -2
- package/src/components/VvSelect/VvSelect.vue +5 -8
- package/src/components/VvTab/VvTab.vue +5 -1
- package/src/components/VvTextarea/VvTextarea.vue +6 -9
- package/src/components/index.ts +10 -0
- package/src/composables/alert/useAlert.ts +12 -9
- package/src/composables/dropdown/useProvideDropdown.ts +4 -4
- package/src/composables/group/useInjectedGroupState.ts +20 -16
- package/src/composables/group/useProvideGroupState.ts +10 -15
- package/src/composables/index.ts +1 -0
- package/src/composables/useBlurhash.ts +76 -0
- package/src/composables/useComponentIcon.ts +15 -14
- package/src/composables/usePersistence.ts +76 -0
- package/src/composables/useUniqueId.ts +2 -2
- package/src/constants.ts +47 -32
- package/src/directives/index.ts +3 -6
- package/src/directives/v-tooltip.ts +19 -10
- package/src/index.ts +3 -1
- package/src/props/index.ts +108 -31
- package/src/resolvers/unplugin.ts +24 -14
- package/src/stories/Accordion/Accordion.test.ts +1 -1
- package/src/stories/AccordionGroup/AccordionGroup.settings.ts +2 -2
- package/src/stories/AccordionGroup/AccordionGroup.test.ts +17 -11
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.ts +1 -1
- package/src/stories/Alert/Alert.test.ts +1 -1
- package/src/stories/AlertGroup/AlertGroup.test.ts +1 -1
- package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +2 -2
- package/src/stories/Avatar/Avatar.test.ts +1 -1
- package/src/stories/AvatarGroup/AvatarGroup.test.ts +1 -1
- package/src/stories/Badge/Badge.test.ts +1 -1
- package/src/stories/Blurhash/BlurhashComposable.stories.ts +195 -0
- package/src/stories/Button/Button.settings.ts +1 -4
- package/src/stories/Button/Button.test.ts +1 -1
- package/src/stories/ButtonGroup/ButtonGroup.test.ts +1 -1
- package/src/stories/Card/Card.test.ts +1 -1
- package/src/stories/Checkbox/Checkbox.test.ts +1 -1
- package/src/stories/CheckboxGroup/CheckboxGroup.test.ts +1 -1
- package/src/stories/Combobox/Combobox.settings.ts +8 -0
- package/src/stories/Combobox/Combobox.test.ts +1 -1
- package/src/stories/Dialog/Dialog.test.ts +2 -2
- package/src/stories/Dropdown/Dropdown.test.ts +1 -1
- package/src/stories/Icon/Icon.settings.ts +3 -3
- package/src/stories/InputFile/InputFile.settings.ts +36 -0
- package/src/stories/InputFile/InputFile.stories.ts +89 -0
- package/src/stories/InputFile/InputFileDropArea.stories.ts +56 -0
- package/src/stories/InputFile/InputFileIconPosition.stories.ts +43 -0
- package/src/stories/InputFile/InputFileSlots.stories.ts +33 -0
- package/src/stories/InputText/InputText.test.ts +1 -1
- package/src/stories/Nav/Nav.test.ts +1 -1
- package/src/stories/Progress/Progress.test.ts +1 -1
- package/src/stories/Radio/Radio.test.ts +1 -1
- package/src/stories/RadioGroup/RadioGroup.test.ts +1 -1
- package/src/stories/Select/Select.test.ts +1 -1
- package/src/stories/Tab/Tab.settings.ts +2 -2
- package/src/stories/Tab/Tab.test.ts +1 -1
- package/src/stories/Textarea/Textarea.test.ts +1 -1
- package/src/stories/Tooltip/Tooltip.test.ts +1 -1
- package/src/stories/argTypes.ts +1 -1
- package/src/test/expect.ts +2 -4
- package/src/types/alert.ts +11 -7
- package/src/types/blurhash.ts +21 -0
- package/src/types/generic.ts +3 -3
- package/src/types/group.ts +22 -14
- package/src/types/index.ts +7 -0
- package/src/types/input-file.ts +18 -0
- package/src/types/nav.ts +2 -3
- package/src/utils/ObjectUtilities.ts +0 -11
- package/src/workers/blurhash.ts +9 -0
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { provide, computed, unref, inject, defineComponent, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, watch, withModifiers, createElementBlock, normalizeProps, guardReactiveProps, renderSlot, createTextVNode, toDisplayString, createElementVNode, createVNode, TransitionGroup, toHandlers, withCtx, Fragment, renderList } from "vue";
|
|
1
|
+
import { provide, computed, unref, inject, defineComponent, mergeDefaults, ref, toRefs, openBlock, createBlock, mergeProps, createCommentVNode, watch, withModifiers, createElementBlock, normalizeProps, guardReactiveProps, renderSlot, createTextVNode, toDisplayString, createElementVNode, createVNode, TransitionGroup, toHandlers, withCtx, Fragment, renderList } from "vue";
|
|
2
2
|
import mitt from "mitt";
|
|
3
3
|
import { iconExists, Icon, addIcon } from "@iconify/vue";
|
|
4
|
-
import {
|
|
4
|
+
import { uid } from "uid";
|
|
5
|
+
var StorageType = /* @__PURE__ */ ((StorageType2) => {
|
|
6
|
+
StorageType2["local"] = "local";
|
|
7
|
+
StorageType2["session"] = "session";
|
|
8
|
+
return StorageType2;
|
|
9
|
+
})(StorageType || {});
|
|
5
10
|
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
6
11
|
Strategy2["absolute"] = "absolute";
|
|
7
12
|
Strategy2["fixed"] = "fixed";
|
|
@@ -36,13 +41,18 @@ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
|
|
|
36
41
|
ButtonType2["reset"] = "reset";
|
|
37
42
|
return ButtonType2;
|
|
38
43
|
})(ButtonType || {});
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return
|
|
45
|
-
})(
|
|
44
|
+
var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
|
|
45
|
+
ActionTag2["nuxtLink"] = "nuxt-link";
|
|
46
|
+
ActionTag2["routerLink"] = "router-link";
|
|
47
|
+
ActionTag2["a"] = "a";
|
|
48
|
+
ActionTag2["button"] = "button";
|
|
49
|
+
return ActionTag2;
|
|
50
|
+
})(ActionTag || {});
|
|
51
|
+
var AlertRole = /* @__PURE__ */ ((AlertRole2) => {
|
|
52
|
+
AlertRole2["alert"] = "alert";
|
|
53
|
+
AlertRole2["alertdialog"] = "alertdialog";
|
|
54
|
+
return AlertRole2;
|
|
55
|
+
})(AlertRole || {});
|
|
46
56
|
const INJECTION_KEY_VOLVER = Symbol.for("volver");
|
|
47
57
|
const INJECTION_KEY_ALERT_GROUP = Symbol.for(
|
|
48
58
|
"alertGroup"
|
|
@@ -62,10 +72,7 @@ const LinkProps = {
|
|
|
62
72
|
/**
|
|
63
73
|
* Anchor target
|
|
64
74
|
*/
|
|
65
|
-
target:
|
|
66
|
-
type: String,
|
|
67
|
-
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
68
|
-
},
|
|
75
|
+
target: String,
|
|
69
76
|
/**
|
|
70
77
|
* Anchor rel
|
|
71
78
|
*/
|
|
@@ -78,44 +85,65 @@ const DisabledProps = {
|
|
|
78
85
|
/**
|
|
79
86
|
* Whether the form control is disabled
|
|
80
87
|
*/
|
|
81
|
-
disabled:
|
|
88
|
+
disabled: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: false
|
|
91
|
+
}
|
|
82
92
|
};
|
|
83
93
|
const ActiveProps = {
|
|
84
94
|
/**
|
|
85
95
|
* Whether the item is active
|
|
86
96
|
*/
|
|
87
|
-
active:
|
|
97
|
+
active: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
default: false
|
|
100
|
+
}
|
|
88
101
|
};
|
|
89
102
|
const CurrentProps = {
|
|
90
103
|
/**
|
|
91
104
|
* Whether the item is current
|
|
92
105
|
*/
|
|
93
|
-
current:
|
|
106
|
+
current: {
|
|
107
|
+
type: Boolean,
|
|
108
|
+
default: false
|
|
109
|
+
}
|
|
94
110
|
};
|
|
95
111
|
const PressedProps = {
|
|
96
112
|
/**
|
|
97
113
|
* Whether the item is pressed
|
|
98
114
|
*/
|
|
99
|
-
pressed:
|
|
115
|
+
pressed: {
|
|
116
|
+
type: Boolean,
|
|
117
|
+
default: false
|
|
118
|
+
}
|
|
100
119
|
};
|
|
101
120
|
const LabelProps = {
|
|
102
121
|
/**
|
|
103
122
|
* The item label
|
|
104
123
|
*/
|
|
105
|
-
label:
|
|
124
|
+
label: {
|
|
125
|
+
type: [String, Number],
|
|
126
|
+
default: void 0
|
|
127
|
+
}
|
|
106
128
|
};
|
|
107
129
|
const ModifiersProps = {
|
|
108
130
|
/**
|
|
109
131
|
* Component BEM modifiers
|
|
110
132
|
*/
|
|
111
|
-
modifiers:
|
|
133
|
+
modifiers: {
|
|
134
|
+
type: [String, Array],
|
|
135
|
+
default: void 0
|
|
136
|
+
}
|
|
112
137
|
};
|
|
113
138
|
const IconProps = {
|
|
114
139
|
/**
|
|
115
140
|
* VvIcon name or props
|
|
116
141
|
* @see VVIcon
|
|
117
142
|
*/
|
|
118
|
-
icon: {
|
|
143
|
+
icon: {
|
|
144
|
+
type: [String, Object],
|
|
145
|
+
default: void 0
|
|
146
|
+
},
|
|
119
147
|
/**
|
|
120
148
|
* VvIcon position
|
|
121
149
|
*/
|
|
@@ -153,7 +181,8 @@ const IdProps = {
|
|
|
153
181
|
* Dropdown show / hide transition name
|
|
154
182
|
*/
|
|
155
183
|
transitionName: {
|
|
156
|
-
type: String
|
|
184
|
+
type: String,
|
|
185
|
+
default: void 0
|
|
157
186
|
},
|
|
158
187
|
/**
|
|
159
188
|
* Offset of the dropdown from the trigger
|
|
@@ -221,7 +250,8 @@ const IdProps = {
|
|
|
221
250
|
* Set dropdown width to the same as the trigger
|
|
222
251
|
*/
|
|
223
252
|
triggerWidth: {
|
|
224
|
-
type: Boolean
|
|
253
|
+
type: Boolean,
|
|
254
|
+
default: false
|
|
225
255
|
}
|
|
226
256
|
});
|
|
227
257
|
({
|
|
@@ -245,8 +275,23 @@ const IdProps = {
|
|
|
245
275
|
ariaLabel: {
|
|
246
276
|
type: String,
|
|
247
277
|
default: void 0
|
|
278
|
+
},
|
|
279
|
+
/**
|
|
280
|
+
* Default tag for the action
|
|
281
|
+
*/
|
|
282
|
+
defaultTag: {
|
|
283
|
+
type: String,
|
|
284
|
+
default: ActionTag.button
|
|
248
285
|
}
|
|
249
286
|
});
|
|
287
|
+
({
|
|
288
|
+
storageType: {
|
|
289
|
+
type: String,
|
|
290
|
+
default: StorageType.local,
|
|
291
|
+
validator: (value) => Object.values(StorageType).includes(value)
|
|
292
|
+
},
|
|
293
|
+
storageKey: String
|
|
294
|
+
});
|
|
250
295
|
function useProvideAlertGroup({
|
|
251
296
|
name
|
|
252
297
|
}) {
|
|
@@ -382,99 +427,9 @@ const useVvAlertGroup = (props, emit) => {
|
|
|
382
427
|
}))
|
|
383
428
|
};
|
|
384
429
|
};
|
|
385
|
-
const
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
*/
|
|
389
|
-
color: String,
|
|
390
|
-
/**
|
|
391
|
-
* Width
|
|
392
|
-
*/
|
|
393
|
-
width: {
|
|
394
|
-
type: [String, Number]
|
|
395
|
-
},
|
|
396
|
-
/**
|
|
397
|
-
* Height
|
|
398
|
-
*/
|
|
399
|
-
height: {
|
|
400
|
-
type: [String, Number]
|
|
401
|
-
},
|
|
402
|
-
/**
|
|
403
|
-
* Icon name
|
|
404
|
-
* Can be the full composition of iconify name "@{provider}:{prefix}:{name}" or "{prefix}:{name}" or "{name}"
|
|
405
|
-
* https://docs.iconify.design/api/providers.html#provider-in-icon-name
|
|
406
|
-
*/
|
|
407
|
-
name: {
|
|
408
|
-
type: String,
|
|
409
|
-
required: true
|
|
410
|
-
},
|
|
411
|
-
/**
|
|
412
|
-
* By default 'vv'
|
|
413
|
-
* If custom collection is not added with "addCollection" DS class method, this prop could not be used
|
|
414
|
-
* Icon provider: https://docs.iconify.design/api/providers.html#provider-in-icon-name
|
|
415
|
-
*/
|
|
416
|
-
provider: {
|
|
417
|
-
type: String
|
|
418
|
-
},
|
|
419
|
-
/**
|
|
420
|
-
* The name of icon set.
|
|
421
|
-
* Icon default options prefix: simple | normal | detailed
|
|
422
|
-
*/
|
|
423
|
-
prefix: {
|
|
424
|
-
type: String,
|
|
425
|
-
default: "normal"
|
|
426
|
-
},
|
|
427
|
-
/**
|
|
428
|
-
* Url remote SVG icon
|
|
429
|
-
*/
|
|
430
|
-
src: String,
|
|
431
|
-
/**
|
|
432
|
-
* Horizontal flip
|
|
433
|
-
*/
|
|
434
|
-
horizontalFlip: Boolean,
|
|
435
|
-
/**
|
|
436
|
-
* Vertical flip
|
|
437
|
-
*/
|
|
438
|
-
verticalFlip: Boolean,
|
|
439
|
-
/**
|
|
440
|
-
* String alternative to "horizontalFlip" and "verticalFlip".
|
|
441
|
-
* Example: https://docs.iconify.design/icon-components/vue/transform.html
|
|
442
|
-
*/
|
|
443
|
-
flip: String,
|
|
444
|
-
/**
|
|
445
|
-
* Icon render mode
|
|
446
|
-
* 'style' = 'bg' or 'mask', depending on icon content
|
|
447
|
-
* 'bg' = span with style using `background`
|
|
448
|
-
* 'mask' = span with style using `mask`
|
|
449
|
-
* 'svg' = svg
|
|
450
|
-
* Iconify doc: https://docs.iconify.design/iconify-icon/modes.html
|
|
451
|
-
*/
|
|
452
|
-
mode: String,
|
|
453
|
-
/**
|
|
454
|
-
* Toggles inline or block mode
|
|
455
|
-
* Example https://docs.iconify.design/icon-components/vue/inline.html
|
|
456
|
-
*/
|
|
457
|
-
inline: Boolean,
|
|
458
|
-
/**
|
|
459
|
-
* rotates icon
|
|
460
|
-
* Example https://docs.iconify.design/icon-components/vue/transform.html
|
|
461
|
-
*/
|
|
462
|
-
rotate: [Number, String],
|
|
463
|
-
/**
|
|
464
|
-
* A callback that is called when icon data has been loaded
|
|
465
|
-
*/
|
|
466
|
-
onLoad: Function,
|
|
467
|
-
/**
|
|
468
|
-
* SVG icon string
|
|
469
|
-
*/
|
|
470
|
-
svg: String,
|
|
471
|
-
/**
|
|
472
|
-
* Icon modifiers: vv-icon css helper classes, value/s are concatened with prefix 'vv-icon--'
|
|
473
|
-
* @values string | string[]
|
|
474
|
-
*/
|
|
475
|
-
modifiers: {
|
|
476
|
-
type: [String, Array]
|
|
477
|
-
}
|
|
430
|
+
const VvIconPropsDefaults = {
|
|
431
|
+
prefix: "normal"
|
|
432
|
+
/* normal */
|
|
478
433
|
};
|
|
479
434
|
function useVolver() {
|
|
480
435
|
return inject(INJECTION_KEY_VOLVER);
|
|
@@ -484,7 +439,24 @@ const __default__$2 = {
|
|
|
484
439
|
};
|
|
485
440
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
486
441
|
...__default__$2,
|
|
487
|
-
props:
|
|
442
|
+
props: /* @__PURE__ */ mergeDefaults({
|
|
443
|
+
name: {},
|
|
444
|
+
color: {},
|
|
445
|
+
width: {},
|
|
446
|
+
height: {},
|
|
447
|
+
provider: {},
|
|
448
|
+
prefix: {},
|
|
449
|
+
src: {},
|
|
450
|
+
horizontalFlip: { type: Boolean },
|
|
451
|
+
verticalFlip: { type: Boolean },
|
|
452
|
+
flip: {},
|
|
453
|
+
mode: {},
|
|
454
|
+
inline: { type: Boolean },
|
|
455
|
+
rotate: {},
|
|
456
|
+
onLoad: { type: Function },
|
|
457
|
+
svg: {},
|
|
458
|
+
modifiers: {}
|
|
459
|
+
}, VvIconPropsDefaults),
|
|
488
460
|
setup(__props) {
|
|
489
461
|
const props = __props;
|
|
490
462
|
const hasRotate = computed(() => {
|
|
@@ -571,18 +543,59 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
571
543
|
color: _ctx.color,
|
|
572
544
|
onLoad: _ctx.onLoad,
|
|
573
545
|
icon: unref(icon)
|
|
574
|
-
}), null, 16, ["class"])) : createCommentVNode("", true);
|
|
546
|
+
}), null, 16, ["class"])) : createCommentVNode("v-if", true);
|
|
575
547
|
};
|
|
576
548
|
}
|
|
577
549
|
});
|
|
578
550
|
function useInjectedAlertGroup() {
|
|
579
551
|
return inject(INJECTION_KEY_ALERT_GROUP, {});
|
|
580
552
|
}
|
|
581
|
-
const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) ||
|
|
553
|
+
const useUniqueId = (id) => computed(() => String((id == null ? void 0 : id.value) || uid()));
|
|
554
|
+
function useComponentIcon(icon, iconPosition) {
|
|
555
|
+
const hasIcon = computed(() => {
|
|
556
|
+
if (typeof (icon == null ? void 0 : icon.value) === "string") {
|
|
557
|
+
return { name: icon == null ? void 0 : icon.value };
|
|
558
|
+
}
|
|
559
|
+
return icon == null ? void 0 : icon.value;
|
|
560
|
+
});
|
|
561
|
+
const hasIconBefore = computed(
|
|
562
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Position.before ? hasIcon.value : void 0
|
|
563
|
+
);
|
|
564
|
+
const hasIconAfter = computed(
|
|
565
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Position.after ? hasIcon.value : void 0
|
|
566
|
+
);
|
|
567
|
+
const hasIconLeft = computed(
|
|
568
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.left ? hasIcon.value : void 0
|
|
569
|
+
);
|
|
570
|
+
const hasIconRight = computed(
|
|
571
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.right ? hasIcon.value : void 0
|
|
572
|
+
);
|
|
573
|
+
const hasIconTop = computed(
|
|
574
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.top ? hasIcon.value : void 0
|
|
575
|
+
);
|
|
576
|
+
const hasIconBottom = computed(
|
|
577
|
+
() => (iconPosition == null ? void 0 : iconPosition.value) === Side.bottom ? hasIcon.value : void 0
|
|
578
|
+
);
|
|
579
|
+
return {
|
|
580
|
+
hasIcon,
|
|
581
|
+
hasIconLeft,
|
|
582
|
+
hasIconRight,
|
|
583
|
+
hasIconTop,
|
|
584
|
+
hasIconBottom,
|
|
585
|
+
hasIconBefore,
|
|
586
|
+
hasIconAfter
|
|
587
|
+
};
|
|
588
|
+
}
|
|
582
589
|
const VvAlertProps = {
|
|
583
590
|
...IdProps,
|
|
584
|
-
...ModifiersProps,
|
|
585
591
|
...IconProps,
|
|
592
|
+
/**
|
|
593
|
+
* Component BEM modifiers
|
|
594
|
+
*/
|
|
595
|
+
modifiers: {
|
|
596
|
+
type: [String, Array],
|
|
597
|
+
default: void 0
|
|
598
|
+
},
|
|
586
599
|
/**
|
|
587
600
|
* The alert is dismissable
|
|
588
601
|
* @default false
|
|
@@ -647,7 +660,7 @@ const VvAlertProps = {
|
|
|
647
660
|
*/
|
|
648
661
|
role: {
|
|
649
662
|
type: String,
|
|
650
|
-
default:
|
|
663
|
+
default: AlertRole.alert
|
|
651
664
|
}
|
|
652
665
|
};
|
|
653
666
|
const VvAlertEvents = ["close"];
|
|
@@ -655,9 +668,7 @@ const useVvAlert = (props, emit) => {
|
|
|
655
668
|
const { bus } = useInjectedAlertGroup();
|
|
656
669
|
const hasId = useUniqueId(computed(() => props.id));
|
|
657
670
|
const hasTitleId = computed(() => `${hasId.value}-title`);
|
|
658
|
-
const hasIcon = computed(
|
|
659
|
-
() => typeof props.icon === "string" ? { name: props.icon } : props.icon
|
|
660
|
-
);
|
|
671
|
+
const { hasIcon } = useComponentIcon(computed(() => props.icon));
|
|
661
672
|
const hasClass = useModifiers(
|
|
662
673
|
"vv-alert",
|
|
663
674
|
computed(() => props.modifiers),
|
|
@@ -726,7 +737,13 @@ const _hoisted_1 = {
|
|
|
726
737
|
};
|
|
727
738
|
const _hoisted_2 = ["id"];
|
|
728
739
|
const _hoisted_3 = ["aria-label"];
|
|
729
|
-
const _hoisted_4 = /* @__PURE__ */ createElementVNode(
|
|
740
|
+
const _hoisted_4 = /* @__PURE__ */ createElementVNode(
|
|
741
|
+
"div",
|
|
742
|
+
{ class: "vv-alert__close-mask" },
|
|
743
|
+
null,
|
|
744
|
+
-1
|
|
745
|
+
/* HOISTED */
|
|
746
|
+
);
|
|
730
747
|
const _hoisted_5 = [
|
|
731
748
|
_hoisted_4
|
|
732
749
|
];
|
|
@@ -745,52 +762,77 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
745
762
|
...__default__$1,
|
|
746
763
|
props: VvAlertProps,
|
|
747
764
|
emits: VvAlertEvents,
|
|
748
|
-
setup(__props, { expose: __expose, emit }) {
|
|
765
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
749
766
|
const props = __props;
|
|
767
|
+
const emit = __emit;
|
|
750
768
|
const { hasProps, hasTitleId, hasIcon, close } = useVvAlert(props, emit);
|
|
751
769
|
__expose({ close });
|
|
752
770
|
return (_ctx, _cache) => {
|
|
753
|
-
return openBlock(), createElementBlock(
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
))
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
771
|
+
return openBlock(), createElementBlock(
|
|
772
|
+
"div",
|
|
773
|
+
normalizeProps(guardReactiveProps(unref(hasProps))),
|
|
774
|
+
[
|
|
775
|
+
_ctx.$slots.header || _ctx.$slots.title || _ctx.$slots.close || _ctx.$slots["title::before"] || _ctx.$slots["title::after"] || _ctx.title || _ctx.dismissable || _ctx.autoClose ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
776
|
+
unref(hasIcon) ? (openBlock(), createBlock(
|
|
777
|
+
_sfc_main$2,
|
|
778
|
+
mergeProps({ key: 0 }, unref(hasIcon), { class: "vv-alert__icon" }),
|
|
779
|
+
null,
|
|
780
|
+
16
|
|
781
|
+
/* FULL_PROPS */
|
|
782
|
+
)) : createCommentVNode("v-if", true),
|
|
783
|
+
renderSlot(_ctx.$slots, "header", {}, () => [
|
|
784
|
+
renderSlot(_ctx.$slots, "title::before"),
|
|
785
|
+
_ctx.$slots.title || _ctx.title ? (openBlock(), createElementBlock("strong", {
|
|
786
|
+
key: 0,
|
|
787
|
+
id: unref(hasTitleId),
|
|
788
|
+
class: "vv-alert__title"
|
|
789
|
+
}, [
|
|
790
|
+
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
791
|
+
createTextVNode(
|
|
792
|
+
toDisplayString(_ctx.title),
|
|
793
|
+
1
|
|
794
|
+
/* TEXT */
|
|
795
|
+
)
|
|
796
|
+
])
|
|
797
|
+
], 8, _hoisted_2)) : createCommentVNode("v-if", true),
|
|
798
|
+
renderSlot(_ctx.$slots, "title::after")
|
|
799
|
+
]),
|
|
800
|
+
renderSlot(_ctx.$slots, "close", normalizeProps(guardReactiveProps({ close: unref(close) })), () => [
|
|
801
|
+
_ctx.dismissable || _ctx.autoClose ? (openBlock(), createElementBlock("button", {
|
|
802
|
+
key: 0,
|
|
803
|
+
class: "vv-alert__close",
|
|
804
|
+
type: "button",
|
|
805
|
+
"aria-label": _ctx.closeLabel,
|
|
806
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(
|
|
807
|
+
//@ts-ignore
|
|
808
|
+
(...args) => unref(close) && unref(close)(...args),
|
|
809
|
+
["stop"]
|
|
810
|
+
))
|
|
811
|
+
}, _hoisted_5, 8, _hoisted_3)) : createCommentVNode("v-if", true)
|
|
812
|
+
])
|
|
813
|
+
])) : createCommentVNode("v-if", true),
|
|
814
|
+
_ctx.$slots.default || _ctx.content ? (openBlock(), createElementBlock("div", _hoisted_6, [
|
|
815
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
816
|
+
createTextVNode(
|
|
817
|
+
toDisplayString(_ctx.content),
|
|
818
|
+
1
|
|
819
|
+
/* TEXT */
|
|
820
|
+
)
|
|
821
|
+
])
|
|
822
|
+
])) : createCommentVNode("v-if", true),
|
|
823
|
+
_ctx.$slots.footer || _ctx.footer ? (openBlock(), createElementBlock("div", _hoisted_7, [
|
|
824
|
+
renderSlot(_ctx.$slots, "footer", {}, () => [
|
|
825
|
+
createTextVNode(
|
|
826
|
+
toDisplayString(_ctx.footer),
|
|
827
|
+
1
|
|
828
|
+
/* TEXT */
|
|
829
|
+
)
|
|
830
|
+
])
|
|
831
|
+
])) : createCommentVNode("v-if", true)
|
|
832
|
+
],
|
|
833
|
+
16
|
|
834
|
+
/* FULL_PROPS */
|
|
835
|
+
);
|
|
794
836
|
};
|
|
795
837
|
}
|
|
796
838
|
});
|
|
@@ -801,8 +843,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
801
843
|
...__default__,
|
|
802
844
|
props: VvAlertGroupProps,
|
|
803
845
|
emits: VvAlertGroupEvents,
|
|
804
|
-
setup(__props, { emit }) {
|
|
846
|
+
setup(__props, { emit: __emit }) {
|
|
805
847
|
const props = __props;
|
|
848
|
+
const emit = __emit;
|
|
806
849
|
const { hasProps, hasTransition } = useVvAlertGroup(props, emit);
|
|
807
850
|
const alertGroupTransitionHandlers = {
|
|
808
851
|
"before-enter": () => {
|
|
@@ -831,27 +874,46 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
831
874
|
}
|
|
832
875
|
};
|
|
833
876
|
return (_ctx, _cache) => {
|
|
834
|
-
return openBlock(), createElementBlock(
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
877
|
+
return openBlock(), createElementBlock(
|
|
878
|
+
"div",
|
|
879
|
+
normalizeProps(guardReactiveProps(unref(hasProps))),
|
|
880
|
+
[
|
|
881
|
+
renderSlot(_ctx.$slots, "before"),
|
|
882
|
+
createVNode(TransitionGroup, mergeProps({
|
|
883
|
+
tag: "div",
|
|
884
|
+
role: "group",
|
|
885
|
+
name: unref(hasTransition),
|
|
886
|
+
class: "vv-alert-group__list"
|
|
887
|
+
}, toHandlers(alertGroupTransitionHandlers)), {
|
|
888
|
+
default: withCtx(() => [
|
|
889
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
890
|
+
(openBlock(true), createElementBlock(
|
|
891
|
+
Fragment,
|
|
892
|
+
null,
|
|
893
|
+
renderList(_ctx.items, (item) => {
|
|
894
|
+
return openBlock(), createBlock(
|
|
895
|
+
_sfc_main$1,
|
|
896
|
+
mergeProps(item, {
|
|
897
|
+
key: item.id
|
|
898
|
+
}),
|
|
899
|
+
null,
|
|
900
|
+
16
|
|
901
|
+
/* FULL_PROPS */
|
|
902
|
+
);
|
|
903
|
+
}),
|
|
904
|
+
128
|
|
905
|
+
/* KEYED_FRAGMENT */
|
|
906
|
+
))
|
|
907
|
+
])
|
|
908
|
+
]),
|
|
909
|
+
_: 3
|
|
910
|
+
/* FORWARDED */
|
|
911
|
+
}, 16, ["name"]),
|
|
912
|
+
renderSlot(_ctx.$slots, "after")
|
|
913
|
+
],
|
|
914
|
+
16
|
|
915
|
+
/* FULL_PROPS */
|
|
916
|
+
);
|
|
855
917
|
};
|
|
856
918
|
}
|
|
857
919
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("mitt"),require("@iconify/vue"),require("
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("mitt"),require("@iconify/vue"),require("uid")):"function"==typeof define&&define.amd?define(["vue","mitt","@iconify/vue","uid"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAlertGroup=t(e.vue,e.mitt,e.vue$1,e.uid)}(this,(function(e,t,o,l){"use strict";var r=(e=>(e.local="local",e.session="session",e))(r||{}),n=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(n||{}),a=(e=>(e.before="before",e.after="after",e))(a||{}),i=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(i||{}),s=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(s||{}),u=(e=>(e.alert="alert",e.alertdialog="alertdialog",e))(u||{});const c=Symbol.for("volver"),d=Symbol.for("alertGroup"),v=(Boolean,Boolean,Boolean,Boolean,{modifiers:{type:[String,Array],default:void 0}}),f={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:a.before,validation:e=>Object.values(a).includes(e)}},p={id:[String,Number]};function m(t,o,l){return e.computed((()=>{const r={[t]:!0},n="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return n&&Array.isArray(n)&&n.forEach((e=>{e&&(r[`${t}--${e}`]=!0)})),l&&Object.keys(l.value).forEach((o=>{r[`${t}--${o}`]=e.unref(l.value[o])})),r}))}n.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,i.button,s.button,r.local;const b={...v,name:{type:String,required:!0},items:{type:Array,default:()=>[]},stack:{type:Boolean,default:!1},reverse:{type:Boolean,default:!1},inline:{type:String,default:void 0},block:{type:String,default:void 0},position:{type:String,default:void 0},transition:{type:String,default:void 0}},h=(o,l)=>{const r=function({name:o}){const l=t();return e.provide(d,{name:o,bus:l}),l}({name:e.computed((()=>o.name))});(o.block&&!o.inline||!o.block&&o.inline)&&console.warn("[VvAlertGroup]: block and inline props must coexist at the same time.");const n=e.computed((()=>{const t=[m("vv-alert-group",e.computed((()=>o.modifiers)),e.computed((()=>({stack:o.stack,reverse:o.reverse,absolute:"absolute"===o.position,fixed:"fixed"===o.position})))).value];return o.inline&&o.block&&t.push(`vv-alert-group--${o.block}-${o.inline}`),t})),a=e.computed((()=>o.transition?o.transition:o.position?"start"===o.inline?"vv-alert--fade-inline-start":"end"===o.inline?"vv-alert--fade-inline-end":"top"===o.block?"vv-alert--fade-block-top":"bottom"===o.block?"vv-alert--fade-block-bottom":"vv-alert--fade":"vv-alert--fade"));return r.on("close",(e=>{l("close",e)})),{hasTransition:a,hasProps:e.computed((()=>({class:n.value})))}},g={prefix:"normal"};const y=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:{}},g),setup(t){const l=t,r=e.computed((()=>"string"==typeof l.rotate?parseFloat(l.rotate):l.rotate)),n=e.ref(!0),a=e.inject(c),{modifiers:i}=e.toRefs(l),s=m("vv-icon",i),u=e.computed((()=>l.provider||(null==a?void 0:a.iconsProvider))),d=e.computed((()=>{const e=l.name??"",t=`@${u.value}:${l.prefix}:${e}`;if(o.iconExists(t))return t;const r=null==a?void 0:a.iconsCollections.find((t=>{const l=`@${u.value}:${t.prefix}:${e}`;return o.iconExists(l)}));return r?`@${u.value}:${r.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),r=(null==t?void 0:t.innerHTML.trim())||"";t&&r&&o.addIcon(`@${u.value}:${l.prefix}:${l.name}`,{body:r,height:t.viewBox.baseVal.height,width:t.viewBox.baseVal.width})}return a&&l.src&&!o.iconExists(`@${u.value}:${l.prefix}:${l.name}`)&&(n.value=!1,a.fetchIcon(l.src).then((e=>{e&&(v(e),n.value=!0)})).catch((e=>{throw new Error(`Error during fetch icon: ${null==e?void 0:e.message}`)}))),l.svg&&v(l.svg),(t,l)=>e.unref(n)?(e.openBlock(),e.createBlock(e.unref(o.Icon),e.mergeProps({key:0,class:e.unref(s)},{inline:t.inline,width:t.width,height:t.height,horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip,flip:t.flip,rotate:e.unref(r),color:t.color,onLoad:t.onLoad,icon:e.unref(d)}),null,16,["class"])):e.createCommentVNode("v-if",!0)}});const k={...p,...f,modifiers:{type:[String,Array],default:void 0},dismissable:{type:Boolean,default:!1},autoClose:{type:Number,default:0},closeLabel:{type:String,default:"Close"},title:{type:String,default:void 0},content:{type:String,default:void 0},footer:{type:String,default:void 0},role:{type:String,default:u.alert}},B=(t,o)=>{const{bus:r}=e.inject(d,{}),i=(s=e.computed((()=>t.id)),e.computed((()=>String((null==s?void 0:s.value)||l.uid()))));var s;const u=e.computed((()=>`${i.value}-title`)),{hasIcon:c}=function(t,o){const l=e.computed((()=>"string"==typeof(null==t?void 0:t.value)?{name:null==t?void 0:t.value}:null==t?void 0:t.value)),r=e.computed((()=>(null==o?void 0:o.value)===a.before?l.value:void 0)),i=e.computed((()=>(null==o?void 0:o.value)===a.after?l.value:void 0)),s=e.computed((()=>(null==o?void 0:o.value)===n.left?l.value:void 0)),u=e.computed((()=>(null==o?void 0:o.value)===n.right?l.value:void 0)),c=e.computed((()=>(null==o?void 0:o.value)===n.top?l.value:void 0)),d=e.computed((()=>(null==o?void 0:o.value)===n.bottom?l.value:void 0));return{hasIcon:l,hasIconLeft:s,hasIconRight:u,hasIconTop:c,hasIconBottom:d,hasIconBefore:r,hasIconAfter:i}}(e.computed((()=>t.icon))),v=m("vv-alert",e.computed((()=>t.modifiers)),e.computed((()=>({dismissable:t.autoClose>0||t.dismissable,"auto-close":t.autoClose>0,hover:h.value})))),f=e.computed((()=>({"--alert-duration":`${t.autoClose}ms`}))),p=()=>{b&&clearTimeout(b),o("close",i.value),null==r||r.emit("close",i.value)};let b;e.watch((()=>t.autoClose),(e=>{e>0?b=setTimeout(p,e):b&&clearTimeout(b)}),{immediate:!0});const h=e.ref(!1),g=e.withModifiers((()=>{h.value=!0,b&&clearTimeout(b)}),["passive"]),y=e.withModifiers((()=>{h.value=!1,t.autoClose>0&&(b=setTimeout(p,t.autoClose))}),["passive"]);return{close:p,hasIcon:c,hasTitleId:u,hasProps:e.computed((()=>({onMouseover:g,onMouseleave:y,class:v.value,style:f.value,role:t.role,"aria-labelledby":u.value})))}},$={key:0,class:"vv-alert__header"},S=["id"],x=["aria-label"],w=[e.createElementVNode("div",{class:"vv-alert__close-mask"},null,-1)],C={key:1,class:"vv-alert__content"},V={key:2,class:"vv-alert__footer"},P=e.defineComponent({name:"VvAlert",props:k,emits:["close"],setup(t,{expose:o,emit:l}){const r=t,n=l,{hasProps:a,hasTitleId:i,hasIcon:s,close:u}=B(r,n);return o({close:u}),(t,o)=>(e.openBlock(),e.createElementBlock("div",e.normalizeProps(e.guardReactiveProps(e.unref(a))),[t.$slots.header||t.$slots.title||t.$slots.close||t.$slots["title::before"]||t.$slots["title::after"]||t.title||t.dismissable||t.autoClose?(e.openBlock(),e.createElementBlock("div",$,[e.unref(s)?(e.openBlock(),e.createBlock(y,e.mergeProps({key:0},e.unref(s),{class:"vv-alert__icon"}),null,16)):e.createCommentVNode("v-if",!0),e.renderSlot(t.$slots,"header",{},(()=>[e.renderSlot(t.$slots,"title::before"),t.$slots.title||t.title?(e.openBlock(),e.createElementBlock("strong",{key:0,id:e.unref(i),class:"vv-alert__title"},[e.renderSlot(t.$slots,"title",{},(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]))],8,S)):e.createCommentVNode("v-if",!0),e.renderSlot(t.$slots,"title::after")])),e.renderSlot(t.$slots,"close",e.normalizeProps(e.guardReactiveProps({close:e.unref(u)})),(()=>[t.dismissable||t.autoClose?(e.openBlock(),e.createElementBlock("button",{key:0,class:"vv-alert__close",type:"button","aria-label":t.closeLabel,onClick:o[0]||(o[0]=e.withModifiers(((...t)=>e.unref(u)&&e.unref(u)(...t)),["stop"]))},w,8,x)):e.createCommentVNode("v-if",!0)]))])):e.createCommentVNode("v-if",!0),t.$slots.default||t.content?(e.openBlock(),e.createElementBlock("div",C,[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(t.content),1)]))])):e.createCommentVNode("v-if",!0),t.$slots.footer||t.footer?(e.openBlock(),e.createElementBlock("div",V,[e.renderSlot(t.$slots,"footer",{},(()=>[e.createTextVNode(e.toDisplayString(t.footer),1)]))])):e.createCommentVNode("v-if",!0)],16))}});return e.defineComponent({name:"VvAlertGroup",props:b,emits:["close","before-enter","after-leave","enter","after-enter","enter-cancelled","before-leave","leave","leave-cancelled"],setup(t,{emit:o}){const l=t,r=o,{hasProps:n,hasTransition:a}=h(l,r),i={"before-enter":()=>{r("before-enter")},"after-leave":()=>{r("after-leave")},enter:()=>{r("enter")},"after-enter":()=>{r("after-enter")},"enter-cancelled":()=>{r("enter-cancelled")},"before-leave":()=>{r("before-leave")},leave:()=>{r("leave")},"leave-cancelled":()=>{r("leave-cancelled")}};return(t,o)=>(e.openBlock(),e.createElementBlock("div",e.normalizeProps(e.guardReactiveProps(e.unref(n))),[e.renderSlot(t.$slots,"before"),e.createVNode(e.TransitionGroup,e.mergeProps({tag:"div",role:"group",name:e.unref(a),class:"vv-alert-group__list"},e.toHandlers(i)),{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default",{},(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(t=>(e.openBlock(),e.createBlock(P,e.mergeProps(t,{key:t.id}),null,16)))),128))]))])),_:3},16,["name"]),e.renderSlot(t.$slots,"after")],16))}})}));
|