@volverjs/ui-vue 0.0.10-beta.24 → 0.0.10-beta.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auto-imports.d.ts +1 -0
- package/dist/components/VvAccordion/VvAccordion.es.js +14 -12
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +169 -89
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +31 -5
- package/dist/components/VvAccordionGroup/index.d.ts +7 -4
- package/dist/components/VvAction/VvAction.es.js +14 -12
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +2 -11
- package/dist/components/VvAction/index.d.ts +1 -5
- package/dist/components/VvAlert/VvAlert.es.js +14 -12
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +14 -12
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAvatar/VvAvatar.es.js +14 -12
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +14 -12
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.es.js +14 -12
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +14 -12
- 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 +14 -12
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +2 -19
- package/dist/components/VvButton/index.d.ts +1 -5
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +14 -12
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvCard/VvCard.es.js +14 -12
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +14 -12
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +14 -12
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +58 -34
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +2 -8
- package/dist/components/VvCombobox/index.d.ts +9 -2
- package/dist/components/VvDialog/VvDialog.es.js +14 -12
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +24 -16
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +2 -19
- package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +13 -1
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +9 -0
- package/dist/components/VvDropdown/index.d.ts +37 -0
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +64 -15
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +322 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +14 -12
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +131 -76
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.es.js +14 -12
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/VvInputFile/index.d.ts +5 -5
- package/dist/components/VvInputText/VvInputText.es.js +979 -107
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +44 -1
- package/dist/components/VvInputText/index.d.ts +28 -0
- package/dist/components/VvNav/VvNav.es.js +14 -12
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/VvNav.vue.d.ts +1 -1
- package/dist/components/VvNavItem/VvNavItem.es.js +14 -12
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.es.js +14 -12
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +14 -12
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +14 -12
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.es.js +14 -12
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvTab/VvTab.es.js +14 -12
- 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 +14 -12
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTooltip/VvTooltip.es.js +14 -12
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/index.es.js +435 -195
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/dropdown/useInjectDropdown.d.ts +3 -23
- package/dist/composables/dropdown/useProvideDropdown.d.ts +2 -3
- package/dist/composables/usePersistence.d.ts +3 -0
- package/dist/constants.d.ts +24 -21
- package/dist/directives/index.es.js +14 -12
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +14 -12
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/props/index.d.ts +11 -11
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +51 -9
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +327 -64
- package/dist/stories/Button/Button.settings.d.ts +0 -1
- package/dist/types/nav.d.ts +1 -2
- package/package.json +1 -1
- 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/VvAccordionGroup/VvAccordionGroup.vue +86 -69
- package/src/components/VvAccordionGroup/index.ts +3 -5
- package/src/components/VvCombobox/VvCombobox.vue +2 -0
- package/src/components/VvDropdown/VvDropdown.vue +11 -2
- package/src/components/VvDropdown/VvDropdownItem.vue +4 -1
- package/src/components/VvDropdown/VvDropdownOption.vue +3 -21
- package/src/components/VvDropdown/index.ts +35 -1
- package/src/components/VvInputText/VvInputText.vue +98 -3
- package/src/components/VvInputText/index.ts +24 -1
- package/src/composables/dropdown/useProvideDropdown.ts +4 -4
- package/src/composables/usePersistence.ts +76 -0
- package/src/constants.ts +23 -18
- package/src/props/index.ts +12 -7
- package/src/stories/AccordionGroup/AccordionGroup.settings.ts +2 -2
- package/src/stories/AccordionGroup/AccordionGroup.test.ts +5 -5
- package/src/stories/Button/Button.settings.ts +1 -4
- package/src/types/nav.ts +1 -3
package/auto-imports.d.ts
CHANGED
|
@@ -227,6 +227,7 @@ declare global {
|
|
|
227
227
|
const useParentElement: typeof import('@vueuse/core')['useParentElement']
|
|
228
228
|
const usePerformanceObserver: typeof import('@vueuse/core')['usePerformanceObserver']
|
|
229
229
|
const usePermission: typeof import('@vueuse/core')['usePermission']
|
|
230
|
+
const usePersistence: typeof import('./src/composables/usePersistence')['usePersistence']
|
|
230
231
|
const usePointer: typeof import('@vueuse/core')['usePointer']
|
|
231
232
|
const usePointerLock: typeof import('@vueuse/core')['usePointerLock']
|
|
232
233
|
const usePointerSwipe: typeof import('@vueuse/core')['usePointerSwipe']
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { inject, computed, toRef, unref, defineComponent, useAttrs, toRefs, ref, watch, onBeforeUnmount, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, renderSlot, normalizeProps, guardReactiveProps, createTextVNode, toDisplayString } from "vue";
|
|
2
2
|
import { uid } from "uid";
|
|
3
3
|
import { useVModel } from "@vueuse/core";
|
|
4
|
+
var StorageType = /* @__PURE__ */ ((StorageType2) => {
|
|
5
|
+
StorageType2["local"] = "local";
|
|
6
|
+
StorageType2["session"] = "session";
|
|
7
|
+
return StorageType2;
|
|
8
|
+
})(StorageType || {});
|
|
4
9
|
var Strategy = /* @__PURE__ */ ((Strategy2) => {
|
|
5
10
|
Strategy2["absolute"] = "absolute";
|
|
6
11
|
Strategy2["fixed"] = "fixed";
|
|
@@ -42,13 +47,6 @@ var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
|
|
|
42
47
|
ActionTag2["button"] = "button";
|
|
43
48
|
return ActionTag2;
|
|
44
49
|
})(ActionTag || {});
|
|
45
|
-
var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
|
|
46
|
-
AnchorTarget2["_blank"] = "_blank";
|
|
47
|
-
AnchorTarget2["_self"] = "_self";
|
|
48
|
-
AnchorTarget2["_parent"] = "_parent";
|
|
49
|
-
AnchorTarget2["_top"] = "_top";
|
|
50
|
-
return AnchorTarget2;
|
|
51
|
-
})(AnchorTarget || {});
|
|
52
50
|
const INJECTION_KEY_ACCORDION_GROUP = Symbol.for(
|
|
53
51
|
"accordionGroup"
|
|
54
52
|
);
|
|
@@ -67,11 +65,7 @@ const LinkProps = {
|
|
|
67
65
|
/**
|
|
68
66
|
* Anchor target
|
|
69
67
|
*/
|
|
70
|
-
target:
|
|
71
|
-
type: String,
|
|
72
|
-
default: void 0,
|
|
73
|
-
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
74
|
-
},
|
|
68
|
+
target: String,
|
|
75
69
|
/**
|
|
76
70
|
* Anchor rel
|
|
77
71
|
*/
|
|
@@ -276,6 +270,14 @@ const ModifiersProps = {
|
|
|
276
270
|
default: ActionTag.button
|
|
277
271
|
}
|
|
278
272
|
});
|
|
273
|
+
({
|
|
274
|
+
storageType: {
|
|
275
|
+
type: String,
|
|
276
|
+
default: StorageType.local,
|
|
277
|
+
validator: (value) => Object.values(StorageType).includes(value)
|
|
278
|
+
},
|
|
279
|
+
storageKey: String
|
|
280
|
+
});
|
|
279
281
|
function useInjectedGroupState(groupKey) {
|
|
280
282
|
const group = inject(groupKey, void 0);
|
|
281
283
|
const isInGroup = computed(() => group !== void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("uid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","uid","@vueuse/core"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAccordion=o(e.vue,e.uid,e.core)}(this,(function(e,o,n){"use strict";var t=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(
|
|
1
|
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("uid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","uid","@vueuse/core"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAccordion=o(e.vue,e.uid,e.core)}(this,(function(e,o,n){"use strict";var t=(e=>(e.local="local",e.session="session",e))(t||{}),a=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(a||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{}),l=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(l||{});const i=Symbol.for("accordionGroup"),d=(Boolean,Boolean,Boolean,Boolean,{modifiers:{type:[String,Array],default:void 0}});r.before,a.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,u.button,l.button,t.local;const s={...d,name:String,title:String,content:String,modelValue:{type:Boolean,default:void 0},disabled:Boolean,not:Boolean};function c(o){const{group:n,isInGroup:t}=function(o){const n=e.inject(o,void 0),t=e.computed((()=>void 0!==n));return{group:n,isInGroup:t,getGroupOrLocalRef:function(o,t,a){const r=null==n?void 0:n[o];if(r)return e.computed({get:()=>r.value,set(e){r.value=e}});const u=e.toRef(t,o);return e.computed({get:()=>u.value,set(e){a&&a(`update:${o}`,e)}})}}}(i),a=e.computed((()=>Boolean(o.disabled||(null==n?void 0:n.disabled.value)))),r=e.computed((()=>{let e=o.modifiers,t=null==n?void 0:n.modifiers.value;const a=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>a.add(e)))),t&&(Array.isArray(t)||(t=t.split(" ")),t.forEach((e=>a.add(e)))),Array.from(a)}));return{isInGroup:t,group:n,modifiers:r,disabled:a,bus:null==n?void 0:n.bus}}const p=["id","open"],m=["aria-controls","aria-expanded"],f=["aria-hidden"];return e.defineComponent({name:"VvAccordion",props:s,emits:["update:modelValue"],setup(t,{expose:a,emit:r}){const u=t,l=e.useAttrs(),i=r,d=n.useVModel(u,"modelValue",i),s=e.computed((()=>u.name||(null==l?void 0:l.id)||o.uid())),{title:v,content:g,not:b}=e.toRefs(u),{isInGroup:y,modifiers:x,disabled:B,bus:h}=c(u),A=e.ref(!1);e.watch(d,(e=>{"boolean"==typeof e&&(A.value=b.value?!e:e)}),{immediate:!0}),e.watch(A,(e=>{d.value=b.value?!e:e})),null==h||h.on("toggle",(({name:e,value:o})=>{e===s.value&&(A.value=o)}));const E=()=>{B.value||(y.value?null==h||h.emit("toggle",{name:s.value,value:!A.value}):A.value=!A.value)};e.watch(s,((e,o)=>{h&&(o&&o!==e&&h.emit("unregister",{name:o}),h.emit("register",{name:e}))}),{immediate:!0}),e.onBeforeUnmount((()=>{h&&h.emit("unregister",{name:s.value})}));const V=()=>{A.value||E()},S=()=>{A.value&&E()},$=e=>{h?h.emit("expand",{name:e}):console.warn(`[VvAccordion]: You are trying to expand accordion group of "${s.value}" but it is not in a group`)},k=e=>{h?null==h||h.emit("collapse",{name:e}):console.warn(`[VvAccordion]: You are trying to collapse accordion group of "${s.value}" but it is not in a group`)};a({isExpanded:A,expand:V,collapse:S,groupExpand:$,groupCollapse:k});const w=function(o,n,t){return e.computed((()=>{const a={[o]:!0},r="string"==typeof(null==n?void 0:n.value)?n.value.split(" "):null==n?void 0:n.value;return r&&Array.isArray(r)&&r.forEach((e=>{e&&(a[`${o}--${e}`]=!0)})),t&&Object.keys(t.value).forEach((n=>{a[`${o}--${n}`]=e.unref(t.value[n])})),a}))}("vv-accordion",x,e.computed((()=>({disabled:B.value}))));return(o,n)=>(e.openBlock(),e.createElementBlock("details",{id:e.unref(s),class:e.normalizeClass(e.unref(w)),open:e.unref(A)},[e.createElementVNode("summary",{"aria-controls":e.unref(s),"aria-expanded":e.unref(A),class:"vv-accordion__summary",onClick:n[0]||(n[0]=e.withModifiers((e=>E()),["prevent"]))},[e.renderSlot(o.$slots,"summary",e.normalizeProps(e.guardReactiveProps({isExpanded:e.unref(A),expand:V,collapse:S,groupExpand:$,groupCollapse:k})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(v)),1)]))],8,m),e.createElementVNode("div",{"aria-hidden":!e.unref(A),class:"vv-accordion__content"},[e.renderSlot(o.$slots,"default",e.normalizeProps(e.guardReactiveProps({isExpanded:e.unref(A),expand:V,collapse:S,groupExpand:$,groupCollapse:k})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)),1)]))],8,f)],10,p))}})}));
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { inject, computed, toRef, unref, defineComponent, useAttrs, toRefs, ref, watch, onBeforeUnmount, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, renderSlot, normalizeProps, guardReactiveProps, createTextVNode, toDisplayString, provide, watchEffect, reactive, Fragment, renderList, createBlock, mergeProps, withCtx } from "vue";
|
|
1
|
+
import { inject, computed, toRef, unref, defineComponent, useAttrs, toRefs, ref, watch, onBeforeUnmount, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, renderSlot, normalizeProps, guardReactiveProps, createTextVNode, toDisplayString, isRef, provide, watchEffect, reactive, onMounted, nextTick, Fragment, renderList, createBlock, mergeProps, createSlots, withCtx } from "vue";
|
|
2
2
|
import mitt from "mitt";
|
|
3
3
|
import { uid } from "uid";
|
|
4
|
-
import { useVModel,
|
|
4
|
+
import { useVModel, useStorage } from "@vueuse/core";
|
|
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";
|
|
@@ -43,13 +48,6 @@ var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
|
|
|
43
48
|
ActionTag2["button"] = "button";
|
|
44
49
|
return ActionTag2;
|
|
45
50
|
})(ActionTag || {});
|
|
46
|
-
var AnchorTarget = /* @__PURE__ */ ((AnchorTarget2) => {
|
|
47
|
-
AnchorTarget2["_blank"] = "_blank";
|
|
48
|
-
AnchorTarget2["_self"] = "_self";
|
|
49
|
-
AnchorTarget2["_parent"] = "_parent";
|
|
50
|
-
AnchorTarget2["_top"] = "_top";
|
|
51
|
-
return AnchorTarget2;
|
|
52
|
-
})(AnchorTarget || {});
|
|
53
51
|
const INJECTION_KEY_ACCORDION_GROUP = Symbol.for(
|
|
54
52
|
"accordionGroup"
|
|
55
53
|
);
|
|
@@ -68,11 +66,7 @@ const LinkProps = {
|
|
|
68
66
|
/**
|
|
69
67
|
* Anchor target
|
|
70
68
|
*/
|
|
71
|
-
target:
|
|
72
|
-
type: String,
|
|
73
|
-
default: void 0,
|
|
74
|
-
validator: (value) => Object.values(AnchorTarget).includes(value)
|
|
75
|
-
},
|
|
69
|
+
target: String,
|
|
76
70
|
/**
|
|
77
71
|
* Anchor rel
|
|
78
72
|
*/
|
|
@@ -277,6 +271,14 @@ const ModifiersProps = {
|
|
|
277
271
|
default: ActionTag.button
|
|
278
272
|
}
|
|
279
273
|
});
|
|
274
|
+
const StorageProps = {
|
|
275
|
+
storageType: {
|
|
276
|
+
type: String,
|
|
277
|
+
default: StorageType.local,
|
|
278
|
+
validator: (value) => Object.values(StorageType).includes(value)
|
|
279
|
+
},
|
|
280
|
+
storageKey: String
|
|
281
|
+
};
|
|
280
282
|
function useInjectedGroupState(groupKey) {
|
|
281
283
|
const group = inject(groupKey, void 0);
|
|
282
284
|
const isInGroup = computed(() => group !== void 0);
|
|
@@ -563,11 +565,13 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
563
565
|
});
|
|
564
566
|
const VvAccordionGroupProps = {
|
|
565
567
|
...ModifiersProps,
|
|
568
|
+
...StorageProps,
|
|
566
569
|
/**
|
|
567
570
|
* VModel
|
|
568
571
|
*/
|
|
569
572
|
modelValue: {
|
|
570
|
-
type: [String, Array]
|
|
573
|
+
type: [String, Array],
|
|
574
|
+
default: void 0
|
|
571
575
|
},
|
|
572
576
|
/**
|
|
573
577
|
* Accordion items
|
|
@@ -595,13 +599,69 @@ const VvAccordionGroupProps = {
|
|
|
595
599
|
/**
|
|
596
600
|
* If true, the accordion items will be opened by default
|
|
597
601
|
*/
|
|
598
|
-
not: Boolean
|
|
599
|
-
/**
|
|
600
|
-
* Enable local storage persistence
|
|
601
|
-
*/
|
|
602
|
-
storeKey: String
|
|
602
|
+
not: Boolean
|
|
603
603
|
};
|
|
604
604
|
const VvAccordionGroupEvents = ["update:modelValue"];
|
|
605
|
+
const usePersistence = (storageKey, storageType = StorageType.local, defaultValue) => {
|
|
606
|
+
const localValue = ref();
|
|
607
|
+
if (defaultValue) {
|
|
608
|
+
localValue.value = defaultValue;
|
|
609
|
+
}
|
|
610
|
+
let storageValue;
|
|
611
|
+
if (storageKey) {
|
|
612
|
+
watch(
|
|
613
|
+
storageKey,
|
|
614
|
+
(newKey, oldKey) => {
|
|
615
|
+
const storage = unref(storageType) === StorageType.session ? sessionStorage : localStorage;
|
|
616
|
+
if (oldKey && oldKey !== newKey) {
|
|
617
|
+
storage.removeItem(oldKey);
|
|
618
|
+
}
|
|
619
|
+
if (newKey) {
|
|
620
|
+
storageValue = useStorage(
|
|
621
|
+
newKey,
|
|
622
|
+
(storageValue == null ? void 0 : storageValue.value) ?? localValue.value,
|
|
623
|
+
storage
|
|
624
|
+
);
|
|
625
|
+
return;
|
|
626
|
+
}
|
|
627
|
+
storageValue = void 0;
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
immediate: true
|
|
631
|
+
}
|
|
632
|
+
);
|
|
633
|
+
}
|
|
634
|
+
if (isRef(storageType)) {
|
|
635
|
+
watch(storageType, (newType, oldType) => {
|
|
636
|
+
if (storageKey == null ? void 0 : storageKey.value) {
|
|
637
|
+
if (newType) {
|
|
638
|
+
const storage = newType === StorageType.session ? sessionStorage : localStorage;
|
|
639
|
+
storageValue = useStorage(
|
|
640
|
+
storageKey.value,
|
|
641
|
+
(storageValue == null ? void 0 : storageValue.value) ?? localValue.value,
|
|
642
|
+
storage
|
|
643
|
+
);
|
|
644
|
+
}
|
|
645
|
+
if (oldType && oldType !== newType) {
|
|
646
|
+
const oldStorage = oldType === StorageType.session ? sessionStorage : localStorage;
|
|
647
|
+
oldStorage.removeItem(storageKey.value);
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
return computed({
|
|
653
|
+
get: () => {
|
|
654
|
+
return (storageValue == null ? void 0 : storageValue.value) ?? localValue.value;
|
|
655
|
+
},
|
|
656
|
+
set: (value) => {
|
|
657
|
+
if (storageValue) {
|
|
658
|
+
storageValue.value = value;
|
|
659
|
+
return;
|
|
660
|
+
}
|
|
661
|
+
localValue.value = value;
|
|
662
|
+
}
|
|
663
|
+
});
|
|
664
|
+
};
|
|
605
665
|
function useProvideGroupState(key, groupState) {
|
|
606
666
|
provide(key, groupState);
|
|
607
667
|
}
|
|
@@ -615,7 +675,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
615
675
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
616
676
|
const props = __props;
|
|
617
677
|
const emit = __emit;
|
|
618
|
-
const {
|
|
678
|
+
const {
|
|
679
|
+
disabled,
|
|
680
|
+
modifiers,
|
|
681
|
+
itemModifiers,
|
|
682
|
+
items,
|
|
683
|
+
storageKey,
|
|
684
|
+
storageType
|
|
685
|
+
} = toRefs(props);
|
|
619
686
|
watchEffect(() => {
|
|
620
687
|
if (typeof props.modelValue === "string" && props.collapse) {
|
|
621
688
|
console.warn(
|
|
@@ -624,77 +691,78 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
624
691
|
}
|
|
625
692
|
});
|
|
626
693
|
const accordionNames = reactive(/* @__PURE__ */ new Set());
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
(newKey, oldKey) => {
|
|
631
|
-
if (oldKey && oldKey !== newKey) {
|
|
632
|
-
localStorage.removeItem(oldKey);
|
|
633
|
-
}
|
|
634
|
-
if (newKey) {
|
|
635
|
-
modelValue = useLocalStorage(newKey, modelValue.value);
|
|
636
|
-
return;
|
|
637
|
-
}
|
|
638
|
-
modelValue = ref(new Set(modelValue.value));
|
|
639
|
-
},
|
|
640
|
-
{ immediate: true }
|
|
694
|
+
const storageModelValue = usePersistence(
|
|
695
|
+
storageKey,
|
|
696
|
+
storageType
|
|
641
697
|
);
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
emit(
|
|
647
|
-
"update:modelValue",
|
|
648
|
-
[...accordionNames].filter(
|
|
649
|
-
(name) => !modelValue.value.has(name)
|
|
650
|
-
)
|
|
651
|
-
);
|
|
652
|
-
return;
|
|
698
|
+
const localModelValue = computed({
|
|
699
|
+
get: () => {
|
|
700
|
+
if (props.modelValue !== null && props.modelValue !== void 0) {
|
|
701
|
+
return props.modelValue;
|
|
653
702
|
}
|
|
654
|
-
|
|
655
|
-
emit("update:modelValue", [...modelValue.value]);
|
|
656
|
-
return;
|
|
657
|
-
}
|
|
658
|
-
emit("update:modelValue", modelValue.value.values().next().value);
|
|
703
|
+
return storageModelValue.value;
|
|
659
704
|
},
|
|
660
|
-
{
|
|
661
|
-
|
|
662
|
-
|
|
705
|
+
set: (newValue) => {
|
|
706
|
+
emit("update:modelValue", newValue);
|
|
707
|
+
storageModelValue.value = newValue;
|
|
663
708
|
}
|
|
664
|
-
);
|
|
665
|
-
|
|
666
|
-
() =>
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
return;
|
|
709
|
+
});
|
|
710
|
+
const expandedAccordions = computed({
|
|
711
|
+
get: () => {
|
|
712
|
+
if (localModelValue.value === void 0) {
|
|
713
|
+
return /* @__PURE__ */ new Set();
|
|
670
714
|
}
|
|
671
715
|
let toReturn = /* @__PURE__ */ new Set();
|
|
672
716
|
if (props.not) {
|
|
673
|
-
if (typeof
|
|
717
|
+
if (typeof localModelValue.value === "string") {
|
|
674
718
|
toReturn = new Set(
|
|
675
|
-
[...accordionNames].filter(
|
|
719
|
+
[...accordionNames].filter(
|
|
720
|
+
(name) => name !== localModelValue.value
|
|
721
|
+
)
|
|
676
722
|
);
|
|
677
|
-
} else if (Array.isArray(
|
|
723
|
+
} else if (Array.isArray(localModelValue.value)) {
|
|
678
724
|
toReturn = new Set(
|
|
679
725
|
[...accordionNames].filter(
|
|
680
|
-
(name) => !
|
|
726
|
+
(name) => !localModelValue.value.includes(
|
|
727
|
+
name
|
|
728
|
+
)
|
|
681
729
|
)
|
|
682
730
|
);
|
|
683
731
|
}
|
|
684
|
-
} else if (typeof
|
|
685
|
-
toReturn = /* @__PURE__ */ new Set([
|
|
686
|
-
} else if (Array.isArray(
|
|
687
|
-
toReturn = new Set(
|
|
732
|
+
} else if (typeof localModelValue.value === "string") {
|
|
733
|
+
toReturn = /* @__PURE__ */ new Set([localModelValue.value]);
|
|
734
|
+
} else if (Array.isArray(localModelValue.value)) {
|
|
735
|
+
toReturn = new Set(localModelValue.value);
|
|
688
736
|
}
|
|
689
|
-
|
|
690
|
-
bus.emit("toggle", { name, value: toReturn.has(name) });
|
|
691
|
-
}
|
|
692
|
-
modelValue.value = toReturn;
|
|
737
|
+
return toReturn;
|
|
693
738
|
},
|
|
694
|
-
{
|
|
695
|
-
|
|
739
|
+
set: (newValue) => {
|
|
740
|
+
if (props.not) {
|
|
741
|
+
localModelValue.value = [...accordionNames].filter(
|
|
742
|
+
(name) => !newValue.has(name)
|
|
743
|
+
);
|
|
744
|
+
return;
|
|
745
|
+
}
|
|
746
|
+
if (props.collapse) {
|
|
747
|
+
localModelValue.value = [...newValue];
|
|
748
|
+
return;
|
|
749
|
+
}
|
|
750
|
+
localModelValue.value = newValue.values().next().value;
|
|
696
751
|
}
|
|
697
|
-
);
|
|
752
|
+
});
|
|
753
|
+
onMounted(() => {
|
|
754
|
+
if (props.not && localModelValue.value === void 0) {
|
|
755
|
+
localModelValue.value = props.collapse ? [] : [...accordionNames.values()].splice(1, accordionNames.size);
|
|
756
|
+
}
|
|
757
|
+
nextTick(() => {
|
|
758
|
+
for (const name of accordionNames) {
|
|
759
|
+
bus.emit("toggle", {
|
|
760
|
+
name,
|
|
761
|
+
value: expandedAccordions.value.has(name)
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
});
|
|
765
|
+
});
|
|
698
766
|
const bus = mitt();
|
|
699
767
|
useProvideGroupState(INJECTION_KEY_ACCORDION_GROUP, {
|
|
700
768
|
disabled,
|
|
@@ -708,19 +776,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
708
776
|
accordionNames.delete(name);
|
|
709
777
|
});
|
|
710
778
|
bus.on("toggle", ({ name, value }) => {
|
|
779
|
+
const newValue = new Set(expandedAccordions.value);
|
|
711
780
|
if (value) {
|
|
712
781
|
if (!props.collapse) {
|
|
713
|
-
for (const item of
|
|
782
|
+
for (const item of newValue) {
|
|
714
783
|
if (item !== name) {
|
|
715
784
|
bus.emit("toggle", { name: item, value: false });
|
|
716
785
|
}
|
|
717
786
|
}
|
|
718
|
-
|
|
787
|
+
newValue.clear();
|
|
719
788
|
}
|
|
720
|
-
|
|
789
|
+
newValue.add(name);
|
|
790
|
+
expandedAccordions.value = newValue;
|
|
721
791
|
return;
|
|
722
792
|
}
|
|
723
|
-
|
|
793
|
+
newValue.delete(name);
|
|
794
|
+
expandedAccordions.value = newValue;
|
|
724
795
|
});
|
|
725
796
|
const expand = (name) => {
|
|
726
797
|
if (typeof name === "string") {
|
|
@@ -754,7 +825,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
754
825
|
}
|
|
755
826
|
};
|
|
756
827
|
bus.on("collapse", ({ name }) => collapse(name));
|
|
757
|
-
__expose({
|
|
828
|
+
__expose({ expandedAccordions, expand, collapse });
|
|
758
829
|
const bemCssClasses = useModifiers(
|
|
759
830
|
"vv-accordion-group",
|
|
760
831
|
modifiers,
|
|
@@ -770,7 +841,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
770
841
|
},
|
|
771
842
|
[
|
|
772
843
|
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
|
|
773
|
-
|
|
844
|
+
expandedAccordions: unref(expandedAccordions),
|
|
774
845
|
expand,
|
|
775
846
|
collapse
|
|
776
847
|
})), () => [
|
|
@@ -787,16 +858,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
787
858
|
title: item.title,
|
|
788
859
|
content: item.content
|
|
789
860
|
}),
|
|
790
|
-
{
|
|
791
|
-
header: withCtx((data) => [
|
|
792
|
-
renderSlot(_ctx.$slots, `header::${item.name}`, normalizeProps(guardReactiveProps(data)))
|
|
793
|
-
]),
|
|
794
|
-
details: withCtx((data) => [
|
|
795
|
-
renderSlot(_ctx.$slots, `details::${item.name}`, normalizeProps(guardReactiveProps(data)))
|
|
796
|
-
]),
|
|
861
|
+
createSlots({
|
|
797
862
|
_: 2
|
|
798
863
|
/* DYNAMIC */
|
|
799
|
-
},
|
|
864
|
+
}, [
|
|
865
|
+
_ctx.$slots[`summary::${item.name}`] ? {
|
|
866
|
+
name: "summary",
|
|
867
|
+
fn: withCtx((data) => [
|
|
868
|
+
renderSlot(_ctx.$slots, `summary::${item.name}`, normalizeProps(guardReactiveProps(data)))
|
|
869
|
+
]),
|
|
870
|
+
key: "0"
|
|
871
|
+
} : void 0,
|
|
872
|
+
_ctx.$slots[`content::${item.name}`] ? {
|
|
873
|
+
name: "default",
|
|
874
|
+
fn: withCtx((data) => [
|
|
875
|
+
renderSlot(_ctx.$slots, `content::${item.name}`, normalizeProps(guardReactiveProps(data)))
|
|
876
|
+
]),
|
|
877
|
+
key: "1"
|
|
878
|
+
} : void 0
|
|
879
|
+
]),
|
|
800
880
|
1040
|
|
801
881
|
/* FULL_PROPS, DYNAMIC_SLOTS */
|
|
802
882
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("mitt"),require("uid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","mitt","uid","@vueuse/core"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAccordionGroup=o(e.vue,e.mitt,e.uid,e.core)}(this,(function(e,o,t,a){"use strict";var n=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(
|
|
1
|
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("mitt"),require("uid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","mitt","uid","@vueuse/core"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAccordionGroup=o(e.vue,e.mitt,e.uid,e.core)}(this,(function(e,o,t,a){"use strict";var n=(e=>(e.local="local",e.session="session",e))(n||{}),l=(e=>(e.left="left",e.right="right",e.top="top",e.bottom="bottom",e))(l||{}),r=(e=>(e.before="before",e.after="after",e))(r||{}),u=(e=>(e.button="button",e.submit="submit",e.reset="reset",e))(u||{}),i=(e=>(e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e))(i||{});const s=Symbol.for("accordionGroup"),d=(Boolean,Boolean,Boolean,Boolean,{modifiers:{type:[String,Array],default:void 0}});r.before,l.bottom,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,u.button,i.button;const c={storageType:{type:String,default:n.local,validator:e=>Object.values(n).includes(e)},storageKey:String};const m={...d,name:String,title:String,content:String,modelValue:{type:Boolean,default:void 0},disabled:Boolean,not:Boolean};function v(o){const{group:t,isInGroup:a}=function(o){const t=e.inject(o,void 0),a=e.computed((()=>void 0!==t));return{group:t,isInGroup:a,getGroupOrLocalRef:function(o,a,n){const l=null==t?void 0:t[o];if(l)return e.computed({get:()=>l.value,set(e){l.value=e}});const r=e.toRef(a,o);return e.computed({get:()=>r.value,set(e){n&&n(`update:${o}`,e)}})}}}(s),n=e.computed((()=>Boolean(o.disabled||(null==t?void 0:t.disabled.value)))),l=e.computed((()=>{let e=o.modifiers,a=null==t?void 0:t.modifiers.value;const n=new Set;return e&&(Array.isArray(e)||(e=e.split(" ")),e.forEach((e=>n.add(e)))),a&&(Array.isArray(a)||(a=a.split(" ")),a.forEach((e=>n.add(e)))),Array.from(n)}));return{isInGroup:a,group:t,modifiers:l,disabled:n,bus:null==t?void 0:t.bus}}function p(o,t,a){return e.computed((()=>{const n={[o]:!0},l="string"==typeof(null==t?void 0:t.value)?t.value.split(" "):null==t?void 0:t.value;return l&&Array.isArray(l)&&l.forEach((e=>{e&&(n[`${o}--${e}`]=!0)})),a&&Object.keys(a.value).forEach((t=>{n[`${o}--${t}`]=e.unref(a.value[t])})),n}))}const f=["id","open"],g=["aria-controls","aria-expanded"],y=["aria-hidden"],b=e.defineComponent({name:"VvAccordion",props:m,emits:["update:modelValue"],setup(o,{expose:n,emit:l}){const r=o,u=e.useAttrs(),i=l,s=a.useVModel(r,"modelValue",i),d=e.computed((()=>r.name||(null==u?void 0:u.id)||t.uid())),{title:c,content:m,not:b}=e.toRefs(r),{isInGroup:S,modifiers:x,disabled:A,bus:B}=v(r),h=e.ref(!1);e.watch(s,(e=>{"boolean"==typeof e&&(h.value=b.value?!e:e)}),{immediate:!0}),e.watch(h,(e=>{s.value=b.value?!e:e})),null==B||B.on("toggle",(({name:e,value:o})=>{e===d.value&&(h.value=o)}));const V=()=>{A.value||(S.value?null==B||B.emit("toggle",{name:d.value,value:!h.value}):h.value=!h.value)};e.watch(d,((e,o)=>{B&&(o&&o!==e&&B.emit("unregister",{name:o}),B.emit("register",{name:e}))}),{immediate:!0}),e.onBeforeUnmount((()=>{B&&B.emit("unregister",{name:d.value})}));const w=()=>{h.value||V()},k=()=>{h.value&&V()},$=e=>{B?B.emit("expand",{name:e}):console.warn(`[VvAccordion]: You are trying to expand accordion group of "${d.value}" but it is not in a group`)},E=e=>{B?null==B||B.emit("collapse",{name:e}):console.warn(`[VvAccordion]: You are trying to collapse accordion group of "${d.value}" but it is not in a group`)};n({isExpanded:h,expand:w,collapse:k,groupExpand:$,groupCollapse:E});const P=p("vv-accordion",x,e.computed((()=>({disabled:A.value}))));return(o,t)=>(e.openBlock(),e.createElementBlock("details",{id:e.unref(d),class:e.normalizeClass(e.unref(P)),open:e.unref(h)},[e.createElementVNode("summary",{"aria-controls":e.unref(d),"aria-expanded":e.unref(h),class:"vv-accordion__summary",onClick:t[0]||(t[0]=e.withModifiers((e=>V()),["prevent"]))},[e.renderSlot(o.$slots,"summary",e.normalizeProps(e.guardReactiveProps({isExpanded:e.unref(h),expand:w,collapse:k,groupExpand:$,groupCollapse:E})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)),1)]))],8,g),e.createElementVNode("div",{"aria-hidden":!e.unref(h),class:"vv-accordion__content"},[e.renderSlot(o.$slots,"default",e.normalizeProps(e.guardReactiveProps({isExpanded:e.unref(h),expand:w,collapse:k,groupExpand:$,groupCollapse:E})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(m)),1)]))],8,y)],10,f))}}),S={...d,...c,modelValue:{type:[String,Array],default:void 0},items:{type:Array,default:()=>[]},collapse:Boolean,itemModifiers:{type:[String,Array],default:""},disabled:Boolean,not:Boolean};return e.defineComponent({name:"VvAccordionGroup",props:S,emits:["update:modelValue"],setup(t,{expose:l,emit:r}){const u=t,i=r,{disabled:d,modifiers:c,itemModifiers:m,items:v,storageKey:f,storageType:g}=e.toRefs(u);e.watchEffect((()=>{"string"==typeof u.modelValue&&u.collapse&&console.warn("[VvAccordionGroup]: modelValue is a string but collapse is true.")}));const y=e.reactive(new Set),S=((o,t=n.local,l)=>{const r=e.ref();let u;return l&&(r.value=l),o&&e.watch(o,((o,l)=>{const i=e.unref(t)===n.session?sessionStorage:localStorage;l&&l!==o&&i.removeItem(l),u=o?a.useStorage(o,(null==u?void 0:u.value)??r.value,i):void 0}),{immediate:!0}),e.isRef(t)&&e.watch(t,((e,t)=>{if(null==o?void 0:o.value){if(e){const t=e===n.session?sessionStorage:localStorage;u=a.useStorage(o.value,(null==u?void 0:u.value)??r.value,t)}t&&t!==e&&(t===n.session?sessionStorage:localStorage).removeItem(o.value)}})),e.computed({get:()=>(null==u?void 0:u.value)??r.value,set:e=>{u?u.value=e:r.value=e}})})(f,g),x=e.computed({get:()=>null!==u.modelValue&&void 0!==u.modelValue?u.modelValue:S.value,set:e=>{i("update:modelValue",e),S.value=e}}),A=e.computed({get:()=>{if(void 0===x.value)return new Set;let e=new Set;return u.not?"string"==typeof x.value?e=new Set([...y].filter((e=>e!==x.value))):Array.isArray(x.value)&&(e=new Set([...y].filter((e=>!x.value.includes(e))))):"string"==typeof x.value?e=new Set([x.value]):Array.isArray(x.value)&&(e=new Set(x.value)),e},set:e=>{u.not?x.value=[...y].filter((o=>!e.has(o))):u.collapse?x.value=[...e]:x.value=e.values().next().value}});e.onMounted((()=>{u.not&&void 0===x.value&&(x.value=u.collapse?[]:[...y.values()].splice(1,y.size)),e.nextTick((()=>{for(const e of y)B.emit("toggle",{name:e,value:A.value.has(e)})}))}));const B=o();var h,V;h=s,V={disabled:d,modifiers:m,bus:B},e.provide(h,V),B.on("register",(({name:e})=>{y.add(e)})),B.on("unregister",(({name:e})=>{y.delete(e)})),B.on("toggle",(({name:e,value:o})=>{const t=new Set(A.value);if(o){if(!u.collapse){for(const o of t)o!==e&&B.emit("toggle",{name:o,value:!1});t.clear()}return t.add(e),void(A.value=t)}t.delete(e),A.value=t}));const w=e=>{if("string"!=typeof e)if(Array.isArray(e))for(const o of e)B.emit("toggle",{name:o,value:!0});else for(const o of y)B.emit("toggle",{name:o,value:!0});else B.emit("toggle",{name:e,value:!0})};B.on("expand",(({name:e})=>w(e)));const k=e=>{if("string"!=typeof e)if(Array.isArray(e))for(const o of e)B.emit("toggle",{name:o,value:!1});else for(const o of y)B.emit("toggle",{name:o,value:!1});else B.emit("toggle",{name:e,value:!1})};B.on("collapse",(({name:e})=>k(e))),l({expandedAccordions:A,expand:w,collapse:k});const $=p("vv-accordion-group",c,e.computed((()=>({disabled:d.value}))));return(o,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref($))},[e.renderSlot(o.$slots,"default",e.normalizeProps(e.guardReactiveProps({expandedAccordions:e.unref(A),expand:w,collapse:k})),(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v),(t=>(e.openBlock(),e.createBlock(b,e.mergeProps({key:t.title},{name:t.name,title:t.title,content:t.content}),e.createSlots({_:2},[o.$slots[`summary::${t.name}`]?{name:"summary",fn:e.withCtx((a=>[e.renderSlot(o.$slots,`summary::${t.name}`,e.normalizeProps(e.guardReactiveProps(a)))])),key:"0"}:void 0,o.$slots[`content::${t.name}`]?{name:"default",fn:e.withCtx((a=>[e.renderSlot(o.$slots,`content::${t.name}`,e.normalizeProps(e.guardReactiveProps(a)))])),key:"1"}:void 0]),1040)))),128))]))],2))}})}));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
2
2
|
modelValue: {
|
|
3
3
|
type: globalThis.PropType<string | string[] | undefined>;
|
|
4
|
+
default: undefined;
|
|
4
5
|
};
|
|
5
6
|
items: {
|
|
6
7
|
type: globalThis.PropType<import(".").VvAccordionGroupItem[]>;
|
|
@@ -13,13 +14,18 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
13
14
|
};
|
|
14
15
|
disabled: BooleanConstructor;
|
|
15
16
|
not: BooleanConstructor;
|
|
16
|
-
|
|
17
|
+
storageType: {
|
|
18
|
+
type: globalThis.PropType<"local" | "session">;
|
|
19
|
+
default: import("../../constants").StorageType;
|
|
20
|
+
validator: (value: import("../../constants").StorageType) => boolean;
|
|
21
|
+
};
|
|
22
|
+
storageKey: StringConstructor;
|
|
17
23
|
modifiers: {
|
|
18
24
|
type: globalThis.PropType<string | string[]>;
|
|
19
25
|
default: undefined;
|
|
20
26
|
};
|
|
21
27
|
}, {
|
|
22
|
-
|
|
28
|
+
expandedAccordions: globalThis.WritableComputedRef<Set<string>>;
|
|
23
29
|
expand: (name?: string | string[]) => void;
|
|
24
30
|
collapse: (name?: string | string[]) => void;
|
|
25
31
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -27,6 +33,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
27
33
|
}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
28
34
|
modelValue: {
|
|
29
35
|
type: globalThis.PropType<string | string[] | undefined>;
|
|
36
|
+
default: undefined;
|
|
30
37
|
};
|
|
31
38
|
items: {
|
|
32
39
|
type: globalThis.PropType<import(".").VvAccordionGroupItem[]>;
|
|
@@ -39,7 +46,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
39
46
|
};
|
|
40
47
|
disabled: BooleanConstructor;
|
|
41
48
|
not: BooleanConstructor;
|
|
42
|
-
|
|
49
|
+
storageType: {
|
|
50
|
+
type: globalThis.PropType<"local" | "session">;
|
|
51
|
+
default: import("../../constants").StorageType;
|
|
52
|
+
validator: (value: import("../../constants").StorageType) => boolean;
|
|
53
|
+
};
|
|
54
|
+
storageKey: StringConstructor;
|
|
43
55
|
modifiers: {
|
|
44
56
|
type: globalThis.PropType<string | string[]>;
|
|
45
57
|
default: undefined;
|
|
@@ -47,13 +59,27 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
47
59
|
}>>, {
|
|
48
60
|
collapse: boolean;
|
|
49
61
|
disabled: boolean;
|
|
62
|
+
modelValue: string | string[] | undefined;
|
|
50
63
|
not: boolean;
|
|
51
64
|
modifiers: string | string[];
|
|
52
65
|
items: import(".").VvAccordionGroupItem[];
|
|
53
66
|
itemModifiers: string | string[];
|
|
54
|
-
|
|
67
|
+
storageType: "local" | "session";
|
|
68
|
+
}, {}>, Partial<Record<`summary::${string}`, (_: {
|
|
69
|
+
isExpanded: boolean;
|
|
70
|
+
expand: () => void;
|
|
71
|
+
collapse: () => void;
|
|
72
|
+
groupExpand: (name?: string | string[] | undefined) => void;
|
|
73
|
+
groupCollapse: (name?: string | string[] | undefined) => void;
|
|
74
|
+
}) => any>> & Partial<Record<`content::${string}`, (_: {
|
|
75
|
+
isExpanded: boolean;
|
|
76
|
+
expand: () => void;
|
|
77
|
+
collapse: () => void;
|
|
78
|
+
groupExpand: (name?: string | string[] | undefined) => void;
|
|
79
|
+
groupCollapse: (name?: string | string[] | undefined) => void;
|
|
80
|
+
}) => any>> & {
|
|
55
81
|
default?(_: {
|
|
56
|
-
|
|
82
|
+
expandedAccordions: Set<string>;
|
|
57
83
|
expand: (name?: string | string[]) => void;
|
|
58
84
|
collapse: (name?: string | string[]) => void;
|
|
59
85
|
}): any;
|
|
@@ -11,6 +11,7 @@ export declare const VvAccordionGroupProps: {
|
|
|
11
11
|
*/
|
|
12
12
|
modelValue: {
|
|
13
13
|
type: globalThis.PropType<string | string[] | undefined>;
|
|
14
|
+
default: undefined;
|
|
14
15
|
};
|
|
15
16
|
/**
|
|
16
17
|
* Accordion items
|
|
@@ -39,10 +40,12 @@ export declare const VvAccordionGroupProps: {
|
|
|
39
40
|
* If true, the accordion items will be opened by default
|
|
40
41
|
*/
|
|
41
42
|
not: BooleanConstructor;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
storageType: {
|
|
44
|
+
type: globalThis.PropType<"local" | "session">;
|
|
45
|
+
default: import("../../constants").StorageType;
|
|
46
|
+
validator: (value: import("../../constants").StorageType) => boolean;
|
|
47
|
+
};
|
|
48
|
+
storageKey: StringConstructor;
|
|
46
49
|
modifiers: {
|
|
47
50
|
type: globalThis.PropType<string | string[]>;
|
|
48
51
|
default: undefined;
|