@volverjs/ui-vue 0.0.3 → 0.0.5-beta.1
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 +54 -15
- package/auto-imports.d.ts +12 -3
- package/bin/icons.cjs +1 -73
- package/dist/Volver.d.ts +23 -11
- package/dist/components/VvAccordion/VvAccordion.es.js +180 -74
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +4 -1
- package/dist/components/VvAccordion/index.d.ts +8 -3
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +280 -122
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +15 -12
- package/dist/components/VvAccordionGroup/index.d.ts +8 -0
- package/dist/components/VvAction/VvAction.es.js +338 -0
- package/dist/components/VvAction/VvAction.umd.js +1 -0
- package/dist/components/VvAction/VvAction.vue.d.ts +63 -0
- package/dist/components/VvAction/index.d.ts +24 -0
- package/dist/components/VvBadge/VvBadge.es.js +251 -22
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.vue.d.ts +2 -2
- package/dist/components/VvBadge/index.d.ts +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +280 -62
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +11 -11
- package/dist/components/VvBreadcrumb/index.d.ts +1 -1
- package/dist/components/VvButton/VvButton.es.js +720 -261
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +54 -54
- package/dist/components/VvButton/index.d.ts +30 -75
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +296 -49
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +2 -2
- package/dist/components/VvButtonGroup/index.d.ts +1 -1
- package/dist/components/VvCard/VvCard.es.js +60 -28
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +630 -172
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +4 -4
- package/dist/components/VvCheckbox/index.d.ts +6 -6
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +736 -228
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +9 -9
- package/dist/components/VvCheckboxGroup/index.d.ts +4 -4
- package/dist/components/VvCombobox/VvCombobox.es.js +1673 -768
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +159 -61
- package/dist/components/VvCombobox/index.d.ts +54 -23
- package/dist/components/VvDialog/VvDialog.es.js +426 -115
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +12 -3
- package/dist/components/VvDialog/index.d.ts +4 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +504 -190
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +114 -42
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +61 -0
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +52 -0
- package/dist/components/VvDropdown/index.d.ts +35 -14
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +454 -0
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -0
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +48 -18
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +361 -0
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -0
- package/dist/components/VvIcon/VvIcon.es.js +116 -52
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.vue.d.ts +7 -7
- package/dist/components/VvIcon/index.d.ts +2 -2
- package/dist/components/VvInputText/VvInputPasswordAction.d.ts +2 -2
- package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +1054 -376
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +107 -20
- package/dist/components/VvInputText/VvInputTextActions.d.ts +1 -1
- package/dist/components/VvInputText/index.d.ts +67 -3
- package/dist/components/VvProgress/VvProgress.es.js +254 -23
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.vue.d.ts +2 -2
- package/dist/components/VvProgress/index.d.ts +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +568 -137
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +4 -4
- package/dist/components/VvRadio/index.d.ts +6 -6
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +674 -193
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +9 -9
- package/dist/components/VvRadioGroup/index.d.ts +4 -4
- package/dist/components/VvSelect/VvSelect.es.js +703 -251
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +24 -17
- package/dist/components/VvSelect/index.d.ts +8 -8
- package/dist/components/VvTextarea/VvTextarea.es.js +747 -272
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +21 -14
- package/dist/components/VvTextarea/index.d.ts +7 -7
- package/dist/components/VvTooltip/VvTooltip.es.js +252 -24
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +7 -7
- package/dist/components/VvTooltip/index.d.ts +2 -2
- package/dist/components/index.es.js +3676 -2007
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/dropdown/useInjectDropdown.d.ts +1 -1
- package/dist/composables/dropdown/useProvideDropdown.d.ts +3 -3
- package/dist/composables/group/useInjectedGroupState.d.ts +2 -2
- package/dist/composables/group/useProvideGroupState.d.ts +1 -1
- package/dist/composables/useComponentFocus.d.ts +1 -1
- package/dist/composables/useComponentIcon.d.ts +7 -7
- package/dist/composables/useDebouncedInput.d.ts +4 -1
- package/dist/composables/useDefaults.d.ts +2 -0
- package/dist/composables/useModifiers.d.ts +1 -1
- package/dist/composables/useOptions.d.ts +2 -2
- package/dist/composables/useTextCount.d.ts +3 -3
- package/dist/composables/useUniqueId.d.ts +1 -1
- package/dist/composables/useVolver.d.ts +1 -1
- package/dist/constants.d.ts +30 -0
- package/dist/directives/index.es.js +288 -0
- package/dist/directives/index.umd.js +1 -0
- package/dist/directives/v-tooltip.es.js +285 -0
- package/dist/directives/v-tooltip.umd.js +1 -0
- package/dist/icons.es.js +38 -23
- package/dist/icons.umd.js +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.es.js +115 -3269
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +215 -23
- package/dist/resolvers/unplugin.d.ts +14 -8
- package/dist/resolvers/unplugin.es.js +94 -33
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/Combobox/Combobox.settings.d.ts +44 -0
- package/dist/stories/Dropdown/Dropdown.settings.d.ts +3 -2
- package/dist/stories/InputText/InputText.settings.d.ts +53 -0
- package/dist/stories/argTypes.d.ts +1 -1
- package/package.json +167 -63
- package/src/Volver.ts +60 -26
- 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 +19 -22
- package/src/components/VvAccordion/index.ts +12 -4
- package/src/components/VvAccordionGroup/VvAccordionGroup.vue +19 -10
- package/src/components/VvAccordionGroup/index.ts +8 -0
- package/src/components/VvAction/VvAction.vue +144 -0
- package/src/components/VvAction/index.ts +5 -0
- package/src/components/VvBadge/VvBadge.vue +2 -2
- package/src/components/VvBadge/index.ts +1 -1
- package/src/components/VvBreadcrumb/VvBreadcrumb.vue +3 -3
- package/src/components/VvButton/VvButton.vue +41 -124
- package/src/components/VvButton/index.ts +16 -88
- package/src/components/VvButtonGroup/VvButtonGroup.vue +4 -7
- package/src/components/VvButtonGroup/index.ts +1 -1
- package/src/components/VvCard/VvCard.vue +2 -2
- package/src/components/VvCheckbox/VvCheckbox.vue +3 -7
- package/src/components/VvCheckbox/index.ts +11 -7
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +7 -10
- package/src/components/VvCheckboxGroup/index.ts +1 -1
- package/src/components/VvCombobox/VvCombobox.vue +85 -57
- package/src/components/VvCombobox/index.ts +12 -10
- package/src/components/VvDialog/VvDialog.vue +28 -11
- package/src/components/VvDialog/index.ts +5 -2
- package/src/components/VvDropdown/VvDropdown.vue +6 -5
- package/src/components/VvDropdown/VvDropdownAction.vue +46 -0
- package/src/components/VvDropdown/VvDropdownOption.vue +72 -0
- package/src/components/VvDropdown/index.ts +6 -11
- package/src/components/VvIcon/VvIcon.vue +3 -3
- package/src/components/VvIcon/index.ts +3 -3
- package/src/components/VvInputText/VvInputClearAction.ts +2 -2
- package/src/components/VvInputText/VvInputPasswordAction.ts +3 -4
- package/src/components/VvInputText/VvInputStepAction.ts +3 -2
- package/src/components/VvInputText/VvInputText.vue +128 -35
- package/src/components/VvInputText/VvInputTextActions.ts +5 -8
- package/src/components/VvInputText/index.ts +62 -1
- package/src/components/VvProgress/VvProgress.vue +2 -2
- package/src/components/VvProgress/index.ts +1 -1
- package/src/components/VvRadio/VvRadio.vue +3 -7
- package/src/components/VvRadio/index.ts +11 -7
- package/src/components/VvRadioGroup/VvRadioGroup.vue +7 -10
- package/src/components/VvRadioGroup/index.ts +1 -1
- package/src/components/VvSelect/VvSelect.vue +4 -4
- package/src/components/VvSelect/index.ts +3 -5
- package/src/components/VvTextarea/VvTextarea.vue +4 -4
- package/src/components/VvTextarea/index.ts +1 -1
- package/src/components/VvTooltip/VvTooltip.vue +2 -2
- package/src/components/VvTooltip/index.ts +3 -3
- package/src/composables/dropdown/useInjectDropdown.ts +2 -2
- package/src/composables/dropdown/useProvideDropdown.ts +9 -11
- package/src/composables/group/useInjectedGroupState.ts +1 -1
- package/src/composables/group/useProvideGroupState.ts +1 -1
- package/src/composables/useComponentIcon.ts +1 -1
- package/src/composables/useDebouncedInput.ts +10 -3
- package/src/composables/useDefaults.ts +89 -0
- package/src/composables/useModifiers.ts +8 -9
- package/src/composables/useOptions.ts +1 -1
- package/src/composables/useVolver.ts +2 -2
- package/src/constants.ts +36 -0
- package/src/directives/index.ts +1 -1
- package/src/directives/v-tooltip.ts +2 -2
- package/src/index.ts +0 -2
- package/src/props/index.ts +111 -19
- package/src/resolvers/unplugin.ts +96 -49
- package/src/stories/Accordion/Accordion.stories.mdx +8 -2
- package/src/stories/Accordion/Accordion.test.ts +21 -15
- package/src/stories/Accordion/AccordionSlots.stories.mdx +8 -8
- package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +17 -1
- package/src/stories/AccordionGroup/AccordionGroup.test.ts +18 -12
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +3 -2
- package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +2 -1
- package/src/stories/Button/Button.stories.mdx +4 -2
- package/src/stories/Button/Button.test.ts +3 -1
- package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
- package/src/stories/Button/ButtonSlots.stories.mdx +8 -7
- package/src/stories/Button/ButtonState.stories.mdx +2 -11
- package/src/stories/Card/Card.stories.mdx +2 -1
- package/src/stories/Checkbox/Checkbox.stories.mdx +2 -1
- package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +2 -1
- package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +2 -1
- package/src/stories/Combobox/Combobox.settings.ts +44 -0
- package/src/stories/Combobox/Combobox.stories.mdx +40 -1
- package/src/stories/Dialog/Dialog.stories.mdx +2 -1
- package/src/stories/Dropdown/Dropdown.settings.ts +3 -2
- package/src/stories/Dropdown/Dropdown.stories.mdx +14 -12
- package/src/stories/Dropdown/DropdownMultilevel.stories.mdx +56 -0
- package/src/stories/Dropdown/DropdownSlots.stories.mdx +14 -13
- package/src/stories/Icon/Icon.stories.mdx +2 -1
- package/src/stories/Icon/IconsCollection.stories.mdx +2 -1
- package/src/stories/InputText/InputText.settings.ts +53 -0
- package/src/stories/InputText/InputText.stories.mdx +42 -1
- package/src/stories/InputText/InputText.test.ts +5 -2
- package/src/stories/Progress/Progress.stories.mdx +2 -1
- package/src/stories/Radio/Radio.stories.mdx +2 -1
- package/src/stories/RadioGroup/RadioGroup.stories.mdx +2 -1
- package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +2 -1
- package/src/stories/Select/Select.stories.mdx +2 -1
- package/src/stories/Textarea/Textarea.stories.mdx +2 -1
- package/src/stories/Tooltip/Tooltip.stories.mdx +2 -1
- package/src/stories/Tooltip/TooltipDirective.stories.mdx +2 -1
- package/src/stories/argTypes.ts +2 -2
- package/src/types/group.d.ts +5 -0
|
@@ -1,77 +1,324 @@
|
|
|
1
|
-
import {
|
|
2
|
-
var
|
|
3
|
-
|
|
1
|
+
import { isRef, provide, computed, unref, defineComponent, toRefs, watchEffect, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
|
|
2
|
+
var Side = /* @__PURE__ */ ((Side2) => {
|
|
3
|
+
Side2["left"] = "left";
|
|
4
|
+
Side2["right"] = "right";
|
|
5
|
+
Side2["top"] = "top";
|
|
6
|
+
Side2["bottom"] = "bottom";
|
|
7
|
+
return Side2;
|
|
8
|
+
})(Side || {});
|
|
9
|
+
var Placement = /* @__PURE__ */ ((Placement2) => {
|
|
10
|
+
Placement2["topStart"] = "top-start";
|
|
11
|
+
Placement2["topEnd"] = "top-end";
|
|
12
|
+
Placement2["bottomStart"] = "bottom-start";
|
|
13
|
+
Placement2["bottomEnd"] = "bottom-end";
|
|
14
|
+
Placement2["leftStart"] = "left-start";
|
|
15
|
+
Placement2["leftEnd"] = "left-end";
|
|
16
|
+
Placement2["rightStart"] = "right-start";
|
|
17
|
+
Placement2["rightEnd"] = "right-end";
|
|
18
|
+
return Placement2;
|
|
19
|
+
})(Placement || {});
|
|
20
|
+
var Position = /* @__PURE__ */ ((Position2) => {
|
|
21
|
+
Position2["before"] = "before";
|
|
22
|
+
Position2["after"] = "after";
|
|
23
|
+
return Position2;
|
|
24
|
+
})(Position || {});
|
|
25
|
+
var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
|
|
26
|
+
ButtonType2["button"] = "button";
|
|
27
|
+
ButtonType2["submit"] = "submit";
|
|
28
|
+
ButtonType2["reset"] = "reset";
|
|
29
|
+
return ButtonType2;
|
|
30
|
+
})(ButtonType || {});
|
|
31
|
+
var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
|
|
32
|
+
AnchorTarget2["_blank"] = "_blank";
|
|
33
|
+
AnchorTarget2["_self"] = "_self";
|
|
34
|
+
AnchorTarget2["_parent"] = "_parent";
|
|
35
|
+
AnchorTarget2["_top"] = "_top";
|
|
36
|
+
return AnchorTarget2;
|
|
37
|
+
})(AnchorTarget || {});
|
|
38
|
+
const INJECTION_KEY_BUTTON_GROUP = Symbol.for("buttonGroup");
|
|
39
|
+
const LinkProps = {
|
|
40
|
+
/**
|
|
41
|
+
* The router-link/nuxt-link property, if it is defined the button is rendered as a ruouter-link or nuxt-link.
|
|
42
|
+
* @see Documentation of [router-link](https://router.vuejs.org/api/#router-link) and [nuxt-link](https://nuxtjs.org/api/components-nuxt-link/)
|
|
43
|
+
*/
|
|
44
|
+
to: {
|
|
45
|
+
type: [String, Object]
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* Anchor href
|
|
49
|
+
*/
|
|
50
|
+
href: String,
|
|
51
|
+
/**
|
|
52
|
+
* Anchor target
|
|
53
|
+
*/
|
|
54
|
+
target: {
|
|
55
|
+
type: String,
|
|
56
|
+
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
57
|
+
},
|
|
58
|
+
/**
|
|
59
|
+
* Anchor rel
|
|
60
|
+
*/
|
|
61
|
+
rel: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: "noopener noreferrer"
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const DisabledProps = {
|
|
4
67
|
/**
|
|
5
68
|
* Whether the form control is disabled
|
|
6
69
|
*/
|
|
7
70
|
disabled: Boolean
|
|
8
|
-
}
|
|
71
|
+
};
|
|
72
|
+
const ActiveProps = {
|
|
73
|
+
/**
|
|
74
|
+
* Whether the item is active
|
|
75
|
+
*/
|
|
76
|
+
active: Boolean
|
|
77
|
+
};
|
|
78
|
+
const PressedProps = {
|
|
79
|
+
/**
|
|
80
|
+
* Whether the item is pressed
|
|
81
|
+
*/
|
|
82
|
+
pressed: Boolean
|
|
83
|
+
};
|
|
84
|
+
const LabelProps = {
|
|
85
|
+
/**
|
|
86
|
+
* The item label
|
|
87
|
+
*/
|
|
88
|
+
label: [String, Number]
|
|
89
|
+
};
|
|
90
|
+
const ModifiersProps = {
|
|
9
91
|
/**
|
|
10
92
|
* Component BEM modifiers
|
|
11
93
|
*/
|
|
12
94
|
modifiers: [String, Array]
|
|
13
95
|
};
|
|
14
|
-
|
|
15
|
-
|
|
96
|
+
({
|
|
97
|
+
/**
|
|
98
|
+
* VvIcon name or props
|
|
99
|
+
* @see VVIcon
|
|
100
|
+
*/
|
|
101
|
+
icon: { type: [String, Object] },
|
|
102
|
+
/**
|
|
103
|
+
* VvIcon position
|
|
104
|
+
*/
|
|
105
|
+
iconPosition: {
|
|
106
|
+
type: String,
|
|
107
|
+
default: Position.before,
|
|
108
|
+
validation: (value) => Object.values(Position).includes(value)
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
const UnselectableProps = {
|
|
16
112
|
/**
|
|
17
113
|
* If true the input will be unselectable
|
|
18
114
|
*/
|
|
19
|
-
unselectable: { type: Boolean, default:
|
|
115
|
+
unselectable: { type: Boolean, default: true }
|
|
20
116
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
117
|
+
({
|
|
118
|
+
/**
|
|
119
|
+
* Dropdown placement
|
|
120
|
+
*/
|
|
121
|
+
placement: {
|
|
122
|
+
type: String,
|
|
123
|
+
default: Side.bottom,
|
|
124
|
+
validator: (value) => {
|
|
125
|
+
return Object.values(Side).includes(value) || Object.values(Placement).includes(value);
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
/**
|
|
129
|
+
* Dropdown show / hide transition name
|
|
130
|
+
*/
|
|
131
|
+
transitionName: {
|
|
132
|
+
type: String
|
|
133
|
+
},
|
|
134
|
+
/**
|
|
135
|
+
* Offset of the dropdown from the trigger
|
|
136
|
+
* @see https://floating-ui.com/docs/offset
|
|
137
|
+
*/
|
|
138
|
+
offset: {
|
|
139
|
+
type: [Number, String, Object],
|
|
140
|
+
default: 0
|
|
141
|
+
},
|
|
142
|
+
/**
|
|
143
|
+
* Move dropdown to the side if there is no space in the default position
|
|
144
|
+
* @see https://floating-ui.com/docs/shift
|
|
145
|
+
*/
|
|
146
|
+
shift: {
|
|
147
|
+
type: [Boolean, Object],
|
|
148
|
+
default: false
|
|
149
|
+
},
|
|
150
|
+
/**
|
|
151
|
+
* Flip dropdown position if there is no space in the default position
|
|
152
|
+
* @see https://floating-ui.com/docs/flip
|
|
153
|
+
*/
|
|
154
|
+
flip: {
|
|
155
|
+
type: [Boolean, Object],
|
|
156
|
+
default: true
|
|
157
|
+
},
|
|
158
|
+
/**
|
|
159
|
+
* Size of the dropdown
|
|
160
|
+
* @see https://floating-ui.com/docs/size
|
|
161
|
+
*/
|
|
162
|
+
size: {
|
|
163
|
+
type: [Boolean, Object],
|
|
164
|
+
default: () => ({ padding: 10 })
|
|
165
|
+
},
|
|
166
|
+
/**
|
|
167
|
+
* Automatically change the position of the dropdown
|
|
168
|
+
* @see https://floating-ui.com/docs/autoPlacement
|
|
169
|
+
*/
|
|
170
|
+
autoPlacement: {
|
|
171
|
+
type: [Boolean, Object],
|
|
172
|
+
default: false
|
|
173
|
+
},
|
|
174
|
+
/**
|
|
175
|
+
* Add arrow to the dropdown
|
|
176
|
+
* @see https://floating-ui.com/docs/arrow
|
|
177
|
+
*/
|
|
178
|
+
arrow: {
|
|
179
|
+
type: Boolean,
|
|
180
|
+
default: false
|
|
181
|
+
},
|
|
182
|
+
/**
|
|
183
|
+
* Close dropdown on click outside
|
|
184
|
+
*/
|
|
185
|
+
autoClose: {
|
|
186
|
+
type: Boolean,
|
|
187
|
+
default: true
|
|
188
|
+
},
|
|
189
|
+
/**
|
|
190
|
+
* Autofocus first item on dropdown open
|
|
191
|
+
*/
|
|
192
|
+
autofocusFirst: {
|
|
193
|
+
type: Boolean,
|
|
194
|
+
default: true
|
|
195
|
+
},
|
|
196
|
+
/**
|
|
197
|
+
* Set dropdown width to the same as the trigger
|
|
198
|
+
*/
|
|
199
|
+
triggerWidth: {
|
|
200
|
+
type: Boolean
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
({
|
|
204
|
+
...DisabledProps,
|
|
205
|
+
...LabelProps,
|
|
206
|
+
...PressedProps,
|
|
207
|
+
...ActiveProps,
|
|
208
|
+
...LinkProps,
|
|
209
|
+
/**
|
|
210
|
+
* Button type
|
|
211
|
+
*/
|
|
212
|
+
type: {
|
|
213
|
+
type: String,
|
|
214
|
+
default: ButtonType.button,
|
|
215
|
+
validator: (value) => Object.values(ButtonType).includes(value)
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
const VvButtonGroupProps = {
|
|
219
|
+
...ModifiersProps,
|
|
220
|
+
...DisabledProps,
|
|
221
|
+
...UnselectableProps,
|
|
26
222
|
/**
|
|
27
223
|
* String or String[] of css classes (modifiers) that will be provided to each button'
|
|
28
224
|
*/
|
|
29
225
|
itemModifiers: { type: [String, Array], default: void 0 },
|
|
30
|
-
toggle: { type: Boolean, default:
|
|
31
|
-
multiple: { type: Boolean, default:
|
|
226
|
+
toggle: { type: Boolean, default: false },
|
|
227
|
+
multiple: { type: Boolean, default: false },
|
|
32
228
|
modelValue: { type: [String, Array], default: void 0 }
|
|
33
|
-
}
|
|
229
|
+
};
|
|
230
|
+
const VvButtonGroupEvents = ["update:modelValue"];
|
|
231
|
+
function useProvideGroupState(groupState) {
|
|
232
|
+
if (Object.keys(groupState).some(
|
|
233
|
+
(k) => k !== "key" && !isRef(groupState[k])
|
|
234
|
+
))
|
|
235
|
+
throw Error("One or more groupState props aren't ref.");
|
|
236
|
+
provide(
|
|
237
|
+
groupState.key,
|
|
238
|
+
computed(() => groupState)
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
function useModifiers(prefix, modifiers, others) {
|
|
242
|
+
return computed(() => {
|
|
243
|
+
const toReturn = {
|
|
244
|
+
[prefix]: true
|
|
245
|
+
};
|
|
246
|
+
const modifiersArray = typeof (modifiers == null ? void 0 : modifiers.value) === "string" ? modifiers.value.split(" ") : modifiers == null ? void 0 : modifiers.value;
|
|
247
|
+
if (modifiersArray) {
|
|
248
|
+
if (Array.isArray(modifiersArray)) {
|
|
249
|
+
modifiersArray.forEach((modifier) => {
|
|
250
|
+
if (modifier) {
|
|
251
|
+
toReturn[`${prefix}--${modifier}`] = true;
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
if (others) {
|
|
257
|
+
Object.keys(others.value).forEach((key) => {
|
|
258
|
+
toReturn[`${prefix}--${key}`] = unref(others.value[key]);
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
return toReturn;
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
const __default__ = {
|
|
34
265
|
name: "VvButtonGroup"
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
266
|
+
};
|
|
267
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
268
|
+
...__default__,
|
|
269
|
+
props: VvButtonGroupProps,
|
|
270
|
+
emits: VvButtonGroupEvents,
|
|
271
|
+
setup(__props, { emit }) {
|
|
272
|
+
const props = __props;
|
|
273
|
+
const {
|
|
274
|
+
disabled,
|
|
275
|
+
toggle,
|
|
276
|
+
modifiers,
|
|
277
|
+
multiple,
|
|
278
|
+
unselectable,
|
|
279
|
+
itemModifiers
|
|
280
|
+
} = toRefs(props);
|
|
48
281
|
watchEffect(() => {
|
|
49
|
-
typeof
|
|
50
|
-
|
|
51
|
-
|
|
282
|
+
if (typeof props.modelValue === "string" && multiple.value) {
|
|
283
|
+
console.warn(
|
|
284
|
+
`[VvButtonGroup]: modelValue is a string but multiple is true.`
|
|
285
|
+
);
|
|
286
|
+
}
|
|
52
287
|
});
|
|
53
|
-
const
|
|
54
|
-
get: () =>
|
|
55
|
-
|
|
288
|
+
const modelValue = computed({
|
|
289
|
+
get: () => {
|
|
290
|
+
if (!multiple.value) {
|
|
291
|
+
return Array.isArray(props.modelValue) ? props.modelValue[0] : props.modelValue;
|
|
292
|
+
}
|
|
293
|
+
return props.modelValue;
|
|
294
|
+
},
|
|
295
|
+
set: (newValue) => {
|
|
296
|
+
if (newValue !== void 0 && (Array.isArray(props.modelValue) || multiple.value) && !Array.isArray(newValue)) {
|
|
297
|
+
newValue = [newValue];
|
|
298
|
+
}
|
|
299
|
+
return emit("update:modelValue", newValue);
|
|
300
|
+
}
|
|
56
301
|
});
|
|
57
302
|
useProvideGroupState({
|
|
58
|
-
key:
|
|
59
|
-
modelValue
|
|
60
|
-
disabled
|
|
61
|
-
toggle
|
|
62
|
-
multiple
|
|
63
|
-
unselectable
|
|
64
|
-
itemModifiers
|
|
303
|
+
key: INJECTION_KEY_BUTTON_GROUP,
|
|
304
|
+
modelValue,
|
|
305
|
+
disabled,
|
|
306
|
+
toggle,
|
|
307
|
+
multiple,
|
|
308
|
+
unselectable,
|
|
309
|
+
itemModifiers
|
|
65
310
|
});
|
|
66
|
-
const
|
|
67
|
-
return (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
311
|
+
const bemCssClasses = useModifiers("vv-button-group", modifiers);
|
|
312
|
+
return (_ctx, _cache) => {
|
|
313
|
+
return openBlock(), createElementBlock("div", {
|
|
314
|
+
class: normalizeClass(unref(bemCssClasses)),
|
|
315
|
+
role: "group"
|
|
316
|
+
}, [
|
|
317
|
+
renderSlot(_ctx.$slots, "default")
|
|
318
|
+
], 2);
|
|
319
|
+
};
|
|
73
320
|
}
|
|
74
321
|
});
|
|
75
322
|
export {
|
|
76
|
-
|
|
323
|
+
_sfc_main as default
|
|
77
324
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue")):"function"==typeof define&&define.amd?define(["vue"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvButtonGroup=o(e.vue)}(this,(function(e){"use strict";var o=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(o||{}),t=(e=>(e.before="before",e.after="after",e))(t||{}),l=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(l||{});const r=Symbol.for("buttonGroup"),u={disabled:Boolean},a=(Boolean,Boolean,{modifiers:[String,Array]});t.before;const n={unselectable:{type:Boolean,default:!0}};o.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,l.button;const i={...a,...u,...n,itemModifiers:{type:[String,Array],default:void 0},toggle:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},modelValue:{type:[String,Array],default:void 0}};return e.defineComponent({name:"VvButtonGroup",props:i,emits:["update:modelValue"],setup(o,{emit:t}){const l=o,{disabled:u,toggle:a,modifiers:n,multiple:i,unselectable:s,itemModifiers:d}=e.toRefs(l);e.watchEffect((()=>{"string"==typeof l.modelValue&&i.value&&console.warn("[VvButtonGroup]: modelValue is a string but multiple is true.")}));const f=e.computed({get:()=>i.value?l.modelValue:Array.isArray(l.modelValue)?l.modelValue[0]:l.modelValue,set:e=>(void 0===e||!Array.isArray(l.modelValue)&&!i.value||Array.isArray(e)||(e=[e]),t("update:modelValue",e))});!function(o){if(Object.keys(o).some((t=>"key"!==t&&!e.isRef(o[t]))))throw Error("One or more groupState props aren't ref.");e.provide(o.key,e.computed((()=>o)))}({key:r,modelValue:f,disabled:u,toggle:a,multiple:i,unselectable:s,itemModifiers:d});const m=function(o,t,l){return e.computed((()=>{const r={[o]:!0},u="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return u&&Array.isArray(u)&&u.forEach((e=>{e&&(r[`${o}--${e}`]=!0)})),l&&Object.keys(l.value).forEach((t=>{r[`${o}--${t}`]=e.unref(l.value[t])})),r}))}("vv-button-group",n);return(o,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(m)),role:"group"},[e.renderSlot(o.$slots,"default")],2))}})}));
|
|
@@ -46,7 +46,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
46
46
|
default: boolean;
|
|
47
47
|
};
|
|
48
48
|
disabled: BooleanConstructor;
|
|
49
|
-
modifiers:
|
|
49
|
+
modifiers: globalThis.PropType<string | string[]>;
|
|
50
50
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
51
51
|
itemModifiers: {
|
|
52
52
|
type: (StringConstructor | {
|
|
@@ -95,7 +95,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
95
95
|
default: boolean;
|
|
96
96
|
};
|
|
97
97
|
disabled: BooleanConstructor;
|
|
98
|
-
modifiers:
|
|
98
|
+
modifiers: globalThis.PropType<string | string[]>;
|
|
99
99
|
}>> & {
|
|
100
100
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
101
101
|
}, {
|
|
@@ -49,6 +49,6 @@ export declare const VvButtonGroupProps: {
|
|
|
49
49
|
default: boolean;
|
|
50
50
|
};
|
|
51
51
|
disabled: BooleanConstructor;
|
|
52
|
-
modifiers:
|
|
52
|
+
modifiers: globalThis.PropType<string | string[]>;
|
|
53
53
|
};
|
|
54
54
|
export declare const VvButtonGroupEvents: string[];
|
|
@@ -1,41 +1,73 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
1
|
+
import { computed, unref, defineComponent, toRefs, openBlock, createElementBlock, normalizeClass, renderSlot, createTextVNode, toDisplayString, createCommentVNode } from "vue";
|
|
2
|
+
const VvCardProps = {
|
|
3
3
|
title: String,
|
|
4
4
|
modifiers: [String, Array]
|
|
5
|
-
}
|
|
5
|
+
};
|
|
6
|
+
function useModifiers(prefix, modifiers, others) {
|
|
7
|
+
return computed(() => {
|
|
8
|
+
const toReturn = {
|
|
9
|
+
[prefix]: true
|
|
10
|
+
};
|
|
11
|
+
const modifiersArray = typeof (modifiers == null ? void 0 : modifiers.value) === "string" ? modifiers.value.split(" ") : modifiers == null ? void 0 : modifiers.value;
|
|
12
|
+
if (modifiersArray) {
|
|
13
|
+
if (Array.isArray(modifiersArray)) {
|
|
14
|
+
modifiersArray.forEach((modifier) => {
|
|
15
|
+
if (modifier) {
|
|
16
|
+
toReturn[`${prefix}--${modifier}`] = true;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
if (others) {
|
|
22
|
+
Object.keys(others.value).forEach((key) => {
|
|
23
|
+
toReturn[`${prefix}--${key}`] = unref(others.value[key]);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return toReturn;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
const _hoisted_1 = {
|
|
6
30
|
key: 0,
|
|
7
31
|
class: "vv-card__header"
|
|
8
|
-
}
|
|
32
|
+
};
|
|
33
|
+
const _hoisted_2 = {
|
|
9
34
|
key: 1,
|
|
10
35
|
class: "vv-card__content"
|
|
11
|
-
}
|
|
36
|
+
};
|
|
37
|
+
const _hoisted_3 = {
|
|
12
38
|
key: 2,
|
|
13
39
|
class: "vv-card__footer"
|
|
14
|
-
}
|
|
40
|
+
};
|
|
41
|
+
const __default__ = {
|
|
15
42
|
name: "VvCard"
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
43
|
+
};
|
|
44
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
45
|
+
...__default__,
|
|
46
|
+
props: VvCardProps,
|
|
47
|
+
setup(__props) {
|
|
48
|
+
const props = __props;
|
|
49
|
+
const { modifiers } = toRefs(props);
|
|
50
|
+
const bemCssClasses = useModifiers("vv-card", modifiers);
|
|
51
|
+
return (_ctx, _cache) => {
|
|
52
|
+
return openBlock(), createElementBlock("article", {
|
|
53
|
+
class: normalizeClass(unref(bemCssClasses))
|
|
54
|
+
}, [
|
|
55
|
+
_ctx.$slots.header || _ctx.title ? (openBlock(), createElementBlock("header", _hoisted_1, [
|
|
56
|
+
renderSlot(_ctx.$slots, "header", {}, () => [
|
|
57
|
+
createTextVNode(toDisplayString(_ctx.title), 1)
|
|
58
|
+
])
|
|
59
|
+
])) : createCommentVNode("", true),
|
|
60
|
+
renderSlot(_ctx.$slots, "default"),
|
|
61
|
+
_ctx.$slots.content ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
62
|
+
renderSlot(_ctx.$slots, "content")
|
|
63
|
+
])) : createCommentVNode("", true),
|
|
64
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("footer", _hoisted_3, [
|
|
65
|
+
renderSlot(_ctx.$slots, "footer")
|
|
66
|
+
])) : createCommentVNode("", true)
|
|
67
|
+
], 2);
|
|
68
|
+
};
|
|
37
69
|
}
|
|
38
70
|
});
|
|
39
71
|
export {
|
|
40
|
-
|
|
72
|
+
_sfc_main as default
|
|
41
73
|
};
|
|
@@ -1 +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).VvCard=t(e.vue)}(this,(function(e){"use strict";const t={title:String,modifiers:[String,Array]};const o={key:0,class:"vv-card__header"},r={key:1,class:"vv-card__content"},n={key:2,class:"vv-card__footer"};return e.defineComponent({name:"VvCard",props:t,setup(t){const l=t,{modifiers:s}=e.toRefs(l),c=function(t,o,r){return e.computed((()=>{const n={[t]:!0},l="string"==typeof(null==o?void 0:o.value)?o.value.split(" "):null==o?void 0:o.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(n[`${t}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((o=>{n[`${t}--${o}`]=e.unref(r.value[o])})),n}))}("vv-card",s);return(t,l)=>(e.openBlock(),e.createElementBlock("article",{class:e.normalizeClass(e.unref(c))},[t.$slots.header||t.title?(e.openBlock(),e.createElementBlock("header",o,[e.renderSlot(t.$slots,"header",{},(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]))])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"default"),t.$slots.content?(e.openBlock(),e.createElementBlock("div",r,[e.renderSlot(t.$slots,"content")])):e.createCommentVNode("",!0),t.$slots.footer?(e.openBlock(),e.createElementBlock("footer",n,[e.renderSlot(t.$slots,"footer")])):e.createCommentVNode("",!0)],2))}})}));
|