@maas/vue-equipment 1.0.0-beta.3 → 1.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/composables/index.js +9 -5
- package/dist/composables/index.js.map +1 -1
- package/dist/nuxt/module.json +1 -1
- package/dist/nuxt/module.mjs +1 -1
- package/dist/plugins/.turbo/turbo-lint.log +2 -10
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +33 -22
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +2 -2
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +12 -21
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +172 -22
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +15 -22
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue.d.ts +0 -21
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +12 -21
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +35 -25
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +12 -21
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +93 -20
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue.d.ts +4 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +1 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +179 -25
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +2 -2
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +15 -22
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +13 -22
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue.d.ts +9 -21
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +22 -13
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +8 -12
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +114 -22
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +13 -3
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +0 -47
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +0 -36
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue +4 -5
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +0 -30
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +0 -39
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +0 -38
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +2 -2
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +37 -25
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +14 -3
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +93 -20
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +27 -37
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +19 -23
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +26 -15
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +181 -25
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +2 -2
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +15 -22
- package/dist/plugins/MagicMenu/src/composables/private/useMenuChannel.mjs +15 -5
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +18 -6
- package/dist/plugins/MagicMenu/src/utils/modeDelayDefaults.d.ts +2 -2
- package/dist/plugins/MagicMenu/src/utils/modeDelayDefaults.mjs +2 -2
- package/dist/plugins/MagicModal/src/components/MagicModal.vue +3 -3
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +0 -38
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +1 -1
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +5 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue.d.ts +4 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +3 -9
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +0 -33
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +1 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +4 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +2 -2
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +0 -20
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +14 -12
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +27 -22
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue.d.ts +4 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +1 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue.d.ts +0 -45
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenEnter.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenExit.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Pause.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Play.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOff.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOn.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Waiting.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.d.ts +1 -1
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +14 -22
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +14 -22
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +45 -20
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +18 -24
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +2 -2
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue.d.ts +59 -10
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue +2 -2
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +28 -22
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.d.ts +2 -2
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +5 -5
- package/dist/plugins/MagicToast/src/composables/useMagicToast.d.ts +1 -0
- package/dist/plugins/MagicToast/src/composables/useMagicToast.mjs +10 -2
- package/package.json +8 -6
package/README.md
CHANGED
|
@@ -9,11 +9,11 @@ Over the years, we have found ourselves facing a common problem: driven by the l
|
|
|
9
9
|
|
|
10
10
|
## 🚧 Disclaimer
|
|
11
11
|
|
|
12
|
-
This project is
|
|
12
|
+
This project is currently in beta. Expect breaking changes before the initial stable release. With this being said, we aim to keep the amount to an absolute minimum and will communicate any breaking changes with each [release](https://github.com/magicasaservice/vue-equipment/releases).
|
|
13
13
|
|
|
14
14
|
## 📖 Docs
|
|
15
15
|
|
|
16
|
-
For the full documentation visit [vue
|
|
16
|
+
For the full documentation visit [vue.equipment](https://vue.equipment). We are actively working on updating the docs before our initial stable release.
|
|
17
17
|
|
|
18
18
|
## 🐛 Found a Bug?
|
|
19
19
|
|
|
@@ -10,14 +10,14 @@ function useCountdown(options, callback) {
|
|
|
10
10
|
options = { ...defaultOptions, ...options };
|
|
11
11
|
if (unref(options.endDateTime).length < 3) {
|
|
12
12
|
console.error(
|
|
13
|
-
|
|
13
|
+
"useCountdownClock: \u201CendDateTime\u201D needs to be an array [YYYY, MM, DD, HH?, MM?, SS?]"
|
|
14
14
|
);
|
|
15
15
|
}
|
|
16
16
|
const timezone = unref(options.timezone);
|
|
17
17
|
if (timezone) {
|
|
18
18
|
if (!DateTime.now().setZone(timezone).isValid) {
|
|
19
19
|
console.error(
|
|
20
|
-
`useCountdownClock:
|
|
20
|
+
`useCountdownClock: \u201C${timezone}\u201D is not a valid timezone. Did you mean ${DateTime.local().zoneName}? For more information see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones`
|
|
21
21
|
);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -62,7 +62,9 @@ function useCountdown(options, callback) {
|
|
|
62
62
|
if (end <= now) {
|
|
63
63
|
timer.stop();
|
|
64
64
|
reset();
|
|
65
|
-
if (callback)
|
|
65
|
+
if (callback) {
|
|
66
|
+
callback();
|
|
67
|
+
}
|
|
66
68
|
return;
|
|
67
69
|
}
|
|
68
70
|
const diff = end.diff(now, [
|
|
@@ -85,7 +87,6 @@ function useCountdown(options, callback) {
|
|
|
85
87
|
function onTick(callback2) {
|
|
86
88
|
timer.on("tick", callback2);
|
|
87
89
|
}
|
|
88
|
-
timer.on("tick", tick);
|
|
89
90
|
function reset() {
|
|
90
91
|
years.value = 0;
|
|
91
92
|
days.value = 0;
|
|
@@ -97,12 +98,15 @@ function useCountdown(options, callback) {
|
|
|
97
98
|
timer.reset();
|
|
98
99
|
timer.start();
|
|
99
100
|
}
|
|
101
|
+
timer.on("tick", tick);
|
|
100
102
|
onMounted(() => {
|
|
101
103
|
tick();
|
|
102
104
|
timer.start();
|
|
103
105
|
});
|
|
104
106
|
watch(endDateTime, () => {
|
|
105
|
-
if (timer.state === "running")
|
|
107
|
+
if (timer.state === "running") {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
106
110
|
restart();
|
|
107
111
|
});
|
|
108
112
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../packages/composables/useCountdown/index.ts","../../packages/composables/useEasings/index.ts","../../packages/composables/useMetaViewport/index.ts","../../packages/composables/useScrollTo/index.ts"],"sourcesContent":["import { computed, onMounted, ref, unref, watch, type MaybeRef } from 'vue'\nimport { MagicTimer } from '@maas/magic-timer'\nimport { DateTime } from 'luxon'\n\n// Type for [YYYY, MM, DD, HH, MM, SS]\nexport type DateTimeArray = [number, number, number, number?, number?, number?]\n\n// Interface for the options\nexport interface CountdownOptions {\n endDateTime: MaybeRef<DateTimeArray>\n timezone?: MaybeRef<string>\n zeroIndexedMonths?: boolean\n}\n\n// Define the default options\nconst defaultOptions: CountdownOptions = {\n endDateTime: [1970, 1, 1, 0, 0, 0],\n zeroIndexedMonths: false,\n}\n\nexport function useCountdown(options: CountdownOptions, callback?: () => void) {\n // Merge the options with the default options\n options = { ...defaultOptions, ...options } as CountdownOptions\n\n // Check if the endDateTime is valid\n if (unref(options.endDateTime).length < 3) {\n console.error(\n 'useCountdownClock: The \"endDateTime\" option needs to be an array with the format [YYYY, MM, DD, HH?, MM?, SS?]'\n )\n }\n\n // Check if the timezone is valid\n const timezone = unref(options.timezone)\n if (timezone) {\n if (!DateTime.now().setZone(timezone).isValid) {\n console.error(\n `useCountdownClock: The \"timezone\" option \"${timezone}\" is not a valid timezone. Do you mean ${\n DateTime.local().zoneName\n }? For more information see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones`\n )\n }\n }\n\n // Create a new timer instance\n const timer = new MagicTimer()\n\n // Create the countdown values\n const years = ref(0)\n const days = ref(0)\n const hours = ref(0)\n const minutes = ref(0)\n const seconds = ref(0)\n\n // Parse the end dateTime array into an date and time object\n // if the hour, minute and second are not set, set them to 0\n // if the month is not zero indexed, add 1 to the month (defined in the options)\n const parseDateTimeArray = (dateTimeArr: DateTimeArray) => {\n const [year, month, day, hour, minute, second] = dateTimeArr\n return {\n year,\n month: options.zeroIndexedMonths ? month + 1 : month,\n day,\n hour: hour ?? 0,\n minute: minute ?? 0,\n second: second ?? 0,\n }\n }\n\n // Get the computed endDateTime value from the options\n const endDateTime = computed(() => {\n const { year, month, day, hour, minute, second } = parseDateTimeArray(\n unref(options.endDateTime)\n )\n\n return DateTime.fromObject(\n {\n year,\n month,\n day,\n hour,\n minute,\n second,\n },\n {\n zone: unref(options.timezone),\n }\n )\n })\n\n // Update the countdown values on each tick\n // if the timer reached the endDateTime stop the timer, reset the values and call the callback\n function tick() {\n const now = DateTime.now().setZone(unref(options.timezone))\n const end = endDateTime.value\n\n if (end <= now) {\n timer.stop()\n reset()\n if (callback) callback()\n return\n }\n\n const diff = end\n .diff(now, [\n 'years',\n 'days',\n 'hours',\n 'minutes',\n 'seconds',\n 'milliseconds',\n ])\n .toObject()\n\n years.value = diff.years ?? 0\n days.value = diff.days ?? 0\n hours.value = diff.hours ?? 0\n minutes.value = diff.minutes ?? 0\n seconds.value = diff.seconds ?? 0\n }\n\n // Function to pad the values with a leading zero\n function pad(value: number): string {\n return ('0' + value).slice(-2)\n }\n\n // Listen to the tick event\n function onTick(callback: () => void) {\n timer.on('tick', callback)\n }\n\n // Listen to the tick event\n timer.on('tick', tick)\n\n // Reset the countdown values\n function reset() {\n years.value = 0\n days.value = 0\n hours.value = 0\n minutes.value = 0\n seconds.value = 0\n }\n\n // Restart the timer\n function restart() {\n timer.reset()\n timer.start()\n }\n\n // Start the timer on mount\n onMounted(() => {\n tick()\n timer.start()\n })\n\n // Watch for changes in the endDateTime\n // and restart the timer\n watch(endDateTime, () => {\n // check timer is running to prevent restart on initial load\n if (timer.state === 'running') return\n restart()\n })\n\n // Return the values and functions\n return {\n years,\n days,\n hours,\n minutes,\n seconds,\n endDateTime,\n pad,\n restart,\n onTick,\n }\n}\n","import {\n linear,\n easeInQuad,\n easeOutQuad,\n easeInOutQuad,\n easeOutBack,\n easeInCubic,\n easeOutCubic,\n easeInOutCubic,\n easeInQuart,\n easeOutQuart,\n easeInOutQuart,\n easeInQuint,\n easeOutQuint,\n easeInOutQuint,\n} from '@maas/vue-equipment/utils'\n\nexport type EasingKey =\n | 'linear'\n | 'easeInQuad'\n | 'easeOutQuad'\n | 'easeInOutQuad'\n | 'easeOutBack'\n | 'easeInCubic'\n | 'easeOutCubic'\n | 'easeInOutCubic'\n | 'easeInQuart'\n | 'easeOutQuart'\n | 'easeInOutQuart'\n | 'easeInQuint'\n | 'easeOutQuint'\n | 'easeInOutQuint'\n\nexport function useEasings() {\n const easings = {\n linear,\n easeInQuad,\n easeOutQuad,\n easeInOutQuad,\n easeOutBack,\n easeInCubic,\n easeOutCubic,\n easeInOutCubic,\n easeInQuart,\n easeOutQuart,\n easeInOutQuart,\n easeInQuint,\n easeOutQuint,\n easeInOutQuint,\n }\n\n return easings\n}\n","import { ref } from 'vue'\n\nexport type UseMetaViewportArgs = {\n content: string\n}\n\nexport function useMetaViewport(args?: UseMetaViewportArgs) {\n const content =\n args?.content ||\n 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0'\n\n const metaViewport = ref<string | undefined>(undefined)\n\n function setMetaViewport() {\n const metaElement = document.querySelector(\n 'meta[name=\"viewport\"]'\n ) as HTMLMetaElement\n\n metaViewport.value = metaElement.content\n metaElement.setAttribute('content', content)\n }\n\n function resetMetaViewport() {\n const metaElement = document.querySelector(\n 'meta[name=\"viewport\"]'\n ) as HTMLMetaElement\n\n if (metaViewport.value) {\n metaElement.setAttribute('content', metaViewport.value)\n }\n }\n\n return {\n setMetaViewport,\n resetMetaViewport,\n }\n}\n","import {\n unrefElement,\n type MaybeComputedElementRef,\n type MaybeElement,\n} from '@vueuse/core'\nimport { easeOutQuad } from '@maas/vue-equipment/utils'\n\nexport type ScrollToTarget =\n | string\n | Element\n | MaybeElement\n | MaybeComputedElementRef\n\nexport type ScrollToParent = ScrollToTarget | Window\n\nexport type ScrollToParams = {\n parent?: Element | Window\n left: number\n top: number\n duration?: { x?: number; y?: number }\n easing?: (t: number) => number\n callback?: () => void\n}\n\nexport type getScrollDurationParams = {\n parent: Element | Window\n left: number\n top: number\n speed: number\n}\n\nexport type scrollToTargetParams = {\n target: ScrollToTarget\n parent?: ScrollToParent\n offset?: {\n x?: number\n y?: number\n }\n speed?: number\n easing?: (t: number) => number\n}\n\n// Private functions\nfunction min(a: number, b: number) {\n return a < b ? a : b\n}\n\nfunction unwrapParent(parent: ScrollToParent) {\n if (parent === window) {\n return parent\n } else if (typeof parent === 'string') {\n return document.querySelector(parent) || document.documentElement\n } else {\n return (\n unrefElement(parent as MaybeComputedElementRef<MaybeElement>) ||\n document.documentElement\n )\n }\n}\n\nfunction unwrapTarget(target: ScrollToTarget, parentEl: Element | Window) {\n if (typeof target === 'string') {\n const queryTarget = parentEl === window ? document : (parentEl as Element)\n return queryTarget.querySelector(target)\n } else {\n return unrefElement(target as MaybeComputedElementRef<MaybeElement>)\n }\n}\n\nfunction isHtmlElement(\n parentEl: Window | SVGElement | Element\n): parentEl is HTMLElement {\n return parentEl instanceof HTMLElement\n}\n\nfunction disableScrollSnap(parentEl: Window | SVGElement | Element) {\n if (isHtmlElement(parentEl)) {\n parentEl.style.scrollSnapType = 'none'\n }\n}\n\nfunction reenableScrollSnap(parentEl: Window | SVGElement | Element) {\n if (isHtmlElement(parentEl)) {\n parentEl.style.scrollSnapType = ''\n }\n}\n\n// Public composable\nexport function useScrollTo() {\n function getScrollPosition(element: Element | Window): {\n x: number\n y: number\n } {\n if (element === window) {\n return { x: window.scrollX, y: window.scrollY }\n } else if (element instanceof Element) {\n return { x: element.scrollLeft, y: element.scrollTop }\n } else {\n return { x: 0, y: 0 }\n }\n }\n\n function getDistance(\n target: Element,\n parent?: Element | Window\n ): { top: number; left: number } {\n const rect = target.getBoundingClientRect()\n const scrollEl =\n parent || document.scrollingElement || document.documentElement\n\n const scrollTop = scrollEl instanceof Window ? 0 : scrollEl.scrollTop\n const scrollLeft = scrollEl instanceof Window ? 0 : scrollEl.scrollLeft\n\n return {\n top: rect.top + scrollTop,\n left: rect.left + scrollLeft,\n }\n }\n\n function getScrollDuration({\n parent = document.documentElement || document.body,\n left = 0,\n top = 0,\n speed = 500,\n }: getScrollDurationParams) {\n const currentPos = getScrollPosition(parent)\n const distanceX = currentPos.x - left\n const distanceY = currentPos.y - top\n const durationX = Math.abs((distanceX / speed) * 100)\n const durationY = Math.abs((distanceY / speed) * 100)\n\n return { x: durationX, y: durationY }\n }\n\n function scrollTo({\n parent = document.documentElement || document.body,\n top,\n left,\n duration = {},\n easing = easeOutQuad,\n callback,\n }: ScrollToParams) {\n const startTime = Date.now()\n const { x: fromX, y: fromY } = getScrollPosition(parent)\n\n if (fromX === top && fromY === left) {\n if (callback) callback()\n return\n }\n\n const mappedDuration = { x: 500, y: 500, ...duration }\n\n const scroll = () => {\n const currentTime = Date.now()\n\n const timeX = min(1, (currentTime - startTime) / mappedDuration.x)\n const timeY = min(1, (currentTime - startTime) / mappedDuration.y)\n const easedTimeX = easing(timeX)\n const easedTimeY = easing(timeY)\n\n // We use the min of the two times to make sure we scroll at the same speed\n const minTime = Math.min(easedTimeX, easedTimeY)\n\n parent.scroll({\n left: minTime * (left - fromX) + fromX,\n top: minTime * (top - fromY) + fromY,\n })\n\n if (easedTimeX < 1 || easedTimeY < 1) {\n requestAnimationFrame(scroll)\n } else if (callback) {\n callback()\n }\n }\n\n requestAnimationFrame(scroll)\n }\n\n function scrollToTarget({\n target,\n parent = document.documentElement || document.body,\n offset = {},\n speed = 500,\n easing = easeOutQuad,\n }: scrollToTargetParams) {\n const parentEl = unwrapParent(parent)\n if (!parentEl) return\n const targetEl = unwrapTarget(target, parentEl)\n if (!targetEl) return\n\n disableScrollSnap(parentEl)\n\n const mappedOffset = { x: 0, y: 0, ...offset }\n const distance = getDistance(targetEl, parentEl)\n const leftDistance = distance.left - mappedOffset.x\n const topDistance = distance.top - mappedOffset.y\n\n const scrollDuration = getScrollDuration({\n parent: parentEl,\n left: leftDistance,\n top: topDistance,\n speed: speed,\n })\n\n scrollTo({\n parent: parentEl,\n left: leftDistance,\n top: topDistance,\n duration: scrollDuration,\n easing: easing,\n callback: () => reenableScrollSnap(parentEl),\n })\n }\n\n return {\n getScrollPosition,\n getDistance,\n getScrollD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SAAS;AAAA,IAC9C,SAAS,CAAC;AAAA,IACV,QAAQ;AAAA,IACR,SAASA;AAAA,EACX,GAAyB;AACvB,UAAM,WAAW,aAAa,MAAM;AACpC,QAAI,CAAC,SAAU;AACf,UAAM,WAAW,aAAa,QAAQ,QAAQ;AAC9C,QAAI,CAAC,SAAU;AAEf,sBAAkB,QAAQ;AAE1B,UAAM,eAAe,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,OAAO;AAC7C,UAAM,WAAW,YAAY,UAAU,QAAQ;AAC/C,UAAM,eAAe,SAAS,OAAO,aAAa;AAClD,UAAM,cAAc,SAAS,MAAM,aAAa;AAEhD,UAAM,iBAAiB,kBAAkB;AAAA,MACvC,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,KAAK;AAAA,MACL;AAAA,IACF,CAAC;AAED,aAAS;AAAA,MACP,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,KAAK;AAAA,MACL,UAAU;AAAA,MACV;AAAA,MACA,UAAU,MAAM,mBAAmB,QAAQ;AAAA,IAC7C,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["callback","ref","easeOutQuad"]}
|
|
1
|
+
{"version":3,"sources":["../../packages/composables/useCountdown/index.ts","../../packages/composables/useEasings/index.ts","../../packages/composables/useMetaViewport/index.ts","../../packages/composables/useScrollTo/index.ts"],"sourcesContent":["import { computed, onMounted, ref, unref, watch, type MaybeRef } from 'vue'\nimport { MagicTimer } from '@maas/magic-timer'\nimport { DateTime } from 'luxon'\n\nexport type DateTimeArray = [number, number, number, number?, number?, number?]\n\nexport interface CountdownOptions {\n endDateTime: MaybeRef<DateTimeArray>\n timezone?: MaybeRef<string>\n zeroIndexedMonths?: boolean\n}\n\nconst defaultOptions: CountdownOptions = {\n endDateTime: [1970, 1, 1, 0, 0, 0],\n zeroIndexedMonths: false,\n}\n\nexport function useCountdown(options: CountdownOptions, callback?: () => void) {\n options = { ...defaultOptions, ...options }\n\n if (unref(options.endDateTime).length < 3) {\n console.error(\n 'useCountdownClock: “endDateTime” needs to be an array [YYYY, MM, DD, HH?, MM?, SS?]'\n )\n }\n\n const timezone = unref(options.timezone)\n if (timezone) {\n if (!DateTime.now().setZone(timezone).isValid) {\n console.error(\n `useCountdownClock: “${timezone}” is not a valid timezone. Did you mean ${\n DateTime.local().zoneName\n }? For more information see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones`\n )\n }\n }\n\n const timer = new MagicTimer()\n\n const years = ref(0)\n const days = ref(0)\n const hours = ref(0)\n const minutes = ref(0)\n const seconds = ref(0)\n\n // Parse the end dateTime array into an date and time object\n // If hour, minute or second are not set, set them to 0\n // Optionally add +1 if month is not zero indexed\n const parseDateTimeArray = (dateTimeArr: DateTimeArray) => {\n const [year, month, day, hour, minute, second] = dateTimeArr\n return {\n year,\n month: options.zeroIndexedMonths ? month + 1 : month,\n day,\n hour: hour ?? 0,\n minute: minute ?? 0,\n second: second ?? 0,\n }\n }\n\n const endDateTime = computed(() => {\n const { year, month, day, hour, minute, second } = parseDateTimeArray(\n unref(options.endDateTime)\n )\n\n return DateTime.fromObject(\n {\n year,\n month,\n day,\n hour,\n minute,\n second,\n },\n {\n zone: unref(options.timezone),\n }\n )\n })\n\n // Update the countdown values on each tick\n // If endDateTime is reached, stop the timer, reset the values and run the callback\n function tick() {\n const now = DateTime.now().setZone(unref(options.timezone))\n const end = endDateTime.value\n\n if (end <= now) {\n timer.stop()\n reset()\n\n if (callback) {\n callback()\n }\n\n return\n }\n\n const diff = end\n .diff(now, [\n 'years',\n 'days',\n 'hours',\n 'minutes',\n 'seconds',\n 'milliseconds',\n ])\n .toObject()\n\n years.value = diff.years ?? 0\n days.value = diff.days ?? 0\n hours.value = diff.hours ?? 0\n minutes.value = diff.minutes ?? 0\n seconds.value = diff.seconds ?? 0\n }\n\n function pad(value: number): string {\n return ('0' + value).slice(-2)\n }\n\n function onTick(callback: () => void) {\n timer.on('tick', callback)\n }\n\n function reset() {\n years.value = 0\n days.value = 0\n hours.value = 0\n minutes.value = 0\n seconds.value = 0\n }\n\n function restart() {\n timer.reset()\n timer.start()\n }\n\n timer.on('tick', tick)\n\n onMounted(() => {\n tick()\n timer.start()\n })\n\n // Watch for changes in the endDateTime\n // and restart the timer\n watch(endDateTime, () => {\n if (timer.state === 'running') {\n return\n }\n\n restart()\n })\n\n return {\n years,\n days,\n hours,\n minutes,\n seconds,\n endDateTime,\n pad,\n restart,\n onTick,\n }\n}\n","import {\n linear,\n easeInQuad,\n easeOutQuad,\n easeInOutQuad,\n easeOutBack,\n easeInCubic,\n easeOutCubic,\n easeInOutCubic,\n easeInQuart,\n easeOutQuart,\n easeInOutQuart,\n easeInQuint,\n easeOutQuint,\n easeInOutQuint,\n} from '@maas/vue-equipment/utils'\n\nexport type EasingKey =\n | 'linear'\n | 'easeInQuad'\n | 'easeOutQuad'\n | 'easeInOutQuad'\n | 'easeOutBack'\n | 'easeInCubic'\n | 'easeOutCubic'\n | 'easeInOutCubic'\n | 'easeInQuart'\n | 'easeOutQuart'\n | 'easeInOutQuart'\n | 'easeInQuint'\n | 'easeOutQuint'\n | 'easeInOutQuint'\n\nexport function useEasings() {\n const easings = {\n linear,\n easeInQuad,\n easeOutQuad,\n easeInOutQuad,\n easeOutBack,\n easeInCubic,\n easeOutCubic,\n easeInOutCubic,\n easeInQuart,\n easeOutQuart,\n easeInOutQuart,\n easeInQuint,\n easeOutQuint,\n easeInOutQuint,\n }\n\n return easings\n}\n","import { ref } from 'vue'\n\nexport type UseMetaViewportArgs = {\n content: string\n}\n\nexport function useMetaViewport(args?: UseMetaViewportArgs) {\n const content =\n args?.content ||\n 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0'\n\n const metaViewport = ref<string | undefined>(undefined)\n\n function setMetaViewport() {\n const metaElement = document.querySelector(\n 'meta[name=\"viewport\"]'\n ) as HTMLMetaElement\n\n metaViewport.value = metaElement.content\n metaElement.setAttribute('content', content)\n }\n\n function resetMetaViewport() {\n const metaElement = document.querySelector(\n 'meta[name=\"viewport\"]'\n ) as HTMLMetaElement\n\n if (metaViewport.value) {\n metaElement.setAttribute('content', metaViewport.value)\n }\n }\n\n return {\n setMetaViewport,\n resetMetaViewport,\n }\n}\n","import {\n unrefElement,\n type MaybeComputedElementRef,\n type MaybeElement,\n} from '@vueuse/core'\nimport { easeOutQuad } from '@maas/vue-equipment/utils'\n\nexport type ScrollToTarget =\n | string\n | Element\n | MaybeElement\n | MaybeComputedElementRef\n\nexport type ScrollToParent = ScrollToTarget | Window\n\nexport type ScrollToParams = {\n parent?: Element | Window\n left: number\n top: number\n duration?: { x?: number; y?: number }\n easing?: (t: number) => number\n callback?: () => void\n}\n\nexport type getScrollDurationParams = {\n parent: Element | Window\n left: number\n top: number\n speed: number\n}\n\nexport type scrollToTargetParams = {\n target: ScrollToTarget\n parent?: ScrollToParent\n offset?: {\n x?: number\n y?: number\n }\n speed?: number\n easing?: (t: number) => number\n}\n\n// Private functions\nfunction min(a: number, b: number) {\n return a < b ? a : b\n}\n\nfunction unwrapParent(parent: ScrollToParent) {\n if (parent === window) {\n return parent\n } else if (typeof parent === 'string') {\n return document.querySelector(parent) || document.documentElement\n } else {\n return (\n unrefElement(parent as MaybeComputedElementRef<MaybeElement>) ||\n document.documentElement\n )\n }\n}\n\nfunction unwrapTarget(target: ScrollToTarget, parentEl: Element | Window) {\n if (typeof target === 'string') {\n const queryTarget = parentEl === window ? document : (parentEl as Element)\n return queryTarget.querySelector(target)\n } else {\n return unrefElement(target as MaybeComputedElementRef<MaybeElement>)\n }\n}\n\nfunction isHtmlElement(\n parentEl: Window | SVGElement | Element\n): parentEl is HTMLElement {\n return parentEl instanceof HTMLElement\n}\n\nfunction disableScrollSnap(parentEl: Window | SVGElement | Element) {\n if (isHtmlElement(parentEl)) {\n parentEl.style.scrollSnapType = 'none'\n }\n}\n\nfunction reenableScrollSnap(parentEl: Window | SVGElement | Element) {\n if (isHtmlElement(parentEl)) {\n parentEl.style.scrollSnapType = ''\n }\n}\n\n// Public composable\nexport function useScrollTo() {\n function getScrollPosition(element: Element | Window): {\n x: number\n y: number\n } {\n if (element === window) {\n return { x: window.scrollX, y: window.scrollY }\n } else if (element instanceof Element) {\n return { x: element.scrollLeft, y: element.scrollTop }\n } else {\n return { x: 0, y: 0 }\n }\n }\n\n function getDistance(\n target: Element,\n parent?: Element | Window\n ): { top: number; left: number } {\n const rect = target.getBoundingClientRect()\n const scrollEl =\n parent || document.scrollingElement || document.documentElement\n\n const scrollTop = scrollEl instanceof Window ? 0 : scrollEl.scrollTop\n const scrollLeft = scrollEl instanceof Window ? 0 : scrollEl.scrollLeft\n\n return {\n top: rect.top + scrollTop,\n left: rect.left + scrollLeft,\n }\n }\n\n function getScrollDuration({\n parent = document.documentElement || document.body,\n left = 0,\n top = 0,\n speed = 500,\n }: getScrollDurationParams) {\n const currentPos = getScrollPosition(parent)\n const distanceX = currentPos.x - left\n const distanceY = currentPos.y - top\n const durationX = Math.abs((distanceX / speed) * 100)\n const durationY = Math.abs((distanceY / speed) * 100)\n\n return { x: durationX, y: durationY }\n }\n\n function scrollTo({\n parent = document.documentElement || document.body,\n top,\n left,\n duration = {},\n easing = easeOutQuad,\n callback,\n }: ScrollToParams) {\n const startTime = Date.now()\n const { x: fromX, y: fromY } = getScrollPosition(parent)\n\n if (fromX === top && fromY === left) {\n if (callback) callback()\n return\n }\n\n const mappedDuration = { x: 500, y: 500, ...duration }\n\n const scroll = () => {\n const currentTime = Date.now()\n\n const timeX = min(1, (currentTime - startTime) / mappedDuration.x)\n const timeY = min(1, (currentTime - startTime) / mappedDuration.y)\n const easedTimeX = easing(timeX)\n const easedTimeY = easing(timeY)\n\n // We use the min of the two times to make sure we scroll at the same speed\n const minTime = Math.min(easedTimeX, easedTimeY)\n\n parent.scroll({\n left: minTime * (left - fromX) + fromX,\n top: minTime * (top - fromY) + fromY,\n })\n\n if (easedTimeX < 1 || easedTimeY < 1) {\n requestAnimationFrame(scroll)\n } else if (callback) {\n callback()\n }\n }\n\n requestAnimationFrame(scroll)\n }\n\n function scrollToTarget({\n target,\n parent = document.documentElement || document.body,\n offset = {},\n speed = 500,\n easing = easeOutQuad,\n }: scrollToTargetParams) {\n const parentEl = unwrapParent(parent)\n if (!parentEl) return\n const targetEl = unwrapTarget(target, parentEl)\n if (!targetEl) return\n\n disableScrollSnap(parentEl)\n\n const mappedOffset = { x: 0, y: 0, ...offset }\n const distance = getDistance(targetEl, parentEl)\n const leftDistance = distance.left - mappedOffset.x\n const topDistance = distance.top - mappedOffset.y\n\n const scrollDuration = getScrollDuration({\n parent: parentEl,\n left: leftDistance,\n top: topDistance,\n speed: speed,\n })\n\n scrollTo({\n parent: parentEl,\n left: leftDistance,\n top: topDistance,\n duration: scrollDuration,\n easing: easing,\n callback: () => reenableScrollSnap(parentEl),\n })\n }\n\n return {\n getScrollPosition,\n getDistance,\n getScrollDuration,\n scrollTo,\n scrollToTarget,\n }\n}\n"],"mappings":";AAAA,SAAS,UAAU,WAAW,KAAK,OAAO,aAA4B;AACtE,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AAUzB,IAAM,iBAAmC;AAAA,EACvC,aAAa,CAAC,MAAM,GAAG,GAAG,GAAG,GAAG,CAAC;AAAA,EACjC,mBAAmB;AACrB;AAEO,SAAS,aAAa,SAA2B,UAAuB;AAC7E,YAAU,EAAE,GAAG,gBAAgB,GAAG,QAAQ;AAE1C,MAAI,MAAM,QAAQ,WAAW,EAAE,SAAS,GAAG;AACzC,YAAQ;AAAA,MACN;AAAA,IACF;AAAA,EACF;AAEA,QAAM,WAAW,MAAM,QAAQ,QAAQ;AACvC,MAAI,UAAU;AACZ,QAAI,CAAC,SAAS,IAAI,EAAE,QAAQ,QAAQ,EAAE,SAAS;AAC7C,cAAQ;AAAA,QACN,4BAAuB,QAAQ,gDAC7B,SAAS,MAAM,EAAE,QACnB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,QAAM,QAAQ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BAAmB,QAAQ;AAAA,IAC7C,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["callback","ref","easeOutQuad"]}
|
package/dist/nuxt/module.json
CHANGED
package/dist/nuxt/module.mjs
CHANGED
|
@@ -95,7 +95,7 @@ const functions$1 = [
|
|
|
95
95
|
{
|
|
96
96
|
name: "useCountdown",
|
|
97
97
|
"package": "composables",
|
|
98
|
-
lastUpdated:
|
|
98
|
+
lastUpdated: 1739474856000,
|
|
99
99
|
docs: "https://maas.egineering/vue-equipment/composables/useCountdown/",
|
|
100
100
|
description: "calculate the remaining time until a given moment"
|
|
101
101
|
},
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> plugins@0.
|
|
4
|
-
> eslint .
|
|
3
|
+
> plugins@1.0.0-beta.4 lint /Users/robinscholz/Repositories/@maas/vue-equipment/packages/plugins
|
|
4
|
+
> eslint . --fix
|
|
5
5
|
|
|
6
|
-
[0m[0m
|
|
7
|
-
[0m[4m/Users/robinscholz/Repositories/@maas/vue-equipment/packages/plugins/MagicCommand/src/components/MagicCommandItem.vue[24m[0m
|
|
8
|
-
[0m [2m31:13[22m [31merror[39m The `Function` type accepts any function-like value.[0m
|
|
9
|
-
[0mPrefer explicitly defining any function parameters and return type [2m@typescript-eslint/no-unsafe-function-type[22m[0m
|
|
10
|
-
[0m[0m
|
|
11
|
-
[0m[31m[1m✖ 1 problem (1 error, 0 warnings)[22m[39m[0m
|
|
12
|
-
[0m[31m[1m[22m[39m[0m
|
|
13
|
-
[41m[30m ELIFECYCLE [39m[49m [31mCommand failed with exit code 1.[39m
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { AutoSize } from '@maas/vue-autosize';
|
|
2
|
+
import { Primitive } from '@maas/vue-primitive';
|
|
1
3
|
import '@maas/vue-equipment/utils/css/animations/fade-in.css';
|
|
2
4
|
import '@maas/vue-equipment/utils/css/animations/auto-size-out.css';
|
|
3
5
|
import '@maas/vue-equipment/utils/css/easings.css';
|
|
@@ -9,30 +11,39 @@ interface MagicAccordionContentProps {
|
|
|
9
11
|
easing: (t: number) => number;
|
|
10
12
|
};
|
|
11
13
|
}
|
|
12
|
-
declare
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
declare const state: import("../types").AccordionState;
|
|
15
|
+
declare const view: import("../types").AccordionView | undefined;
|
|
16
|
+
declare const mappedTransition: import("vue").ComputedRef<string | undefined>;
|
|
17
|
+
declare const mappedAnimation: import("vue").ComputedRef<{
|
|
18
|
+
duration: number;
|
|
19
|
+
easing: (t: number) => number;
|
|
20
|
+
}>;
|
|
21
|
+
declare const onBeforeEnter: () => void, onEnter: () => void, onAfterEnter: () => Promise<void>, onBeforeLeave: () => void, onLeave: () => void, onAfterLeave: () => void;
|
|
22
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
23
|
+
declare var __VLS_18: {
|
|
24
|
+
viewActive: boolean | undefined;
|
|
21
25
|
};
|
|
22
|
-
type
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
27
|
+
default?: (props: typeof __VLS_18) => any;
|
|
28
|
+
}>;
|
|
29
|
+
declare const __VLS_self: import("vue").DefineComponent<MagicAccordionContentProps, {
|
|
30
|
+
AutoSize: typeof AutoSize;
|
|
31
|
+
Primitive: typeof Primitive;
|
|
32
|
+
state: typeof state;
|
|
33
|
+
view: typeof view;
|
|
34
|
+
mappedTransition: typeof mappedTransition;
|
|
35
|
+
mappedAnimation: typeof mappedAnimation;
|
|
36
|
+
onBeforeEnter: typeof onBeforeEnter;
|
|
37
|
+
onEnter: typeof onEnter;
|
|
38
|
+
onAfterEnter: typeof onAfterEnter;
|
|
39
|
+
onBeforeLeave: typeof onBeforeLeave;
|
|
40
|
+
onLeave: typeof onLeave;
|
|
41
|
+
onAfterLeave: typeof onAfterLeave;
|
|
42
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicAccordionContentProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
43
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicAccordionContentProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicAccordionContentProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
44
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
25
45
|
export default _default;
|
|
26
|
-
type
|
|
27
|
-
type __VLS_TypePropsToOption<T> = {
|
|
28
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
29
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
30
|
-
} : {
|
|
31
|
-
type: import('vue').PropType<T[K]>;
|
|
32
|
-
required: true;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
46
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
36
47
|
new (): {
|
|
37
48
|
$slots: S;
|
|
38
49
|
};
|
|
@@ -21,7 +21,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
21
21
|
provide(MagicAccordionInstanceId, __props.id);
|
|
22
22
|
return (_ctx, _cache) => {
|
|
23
23
|
return _openBlock(), _createBlock(_unref(Primitive), {
|
|
24
|
-
id: _ctx.id,
|
|
24
|
+
"data-id": _ctx.id,
|
|
25
25
|
"as-child": _ctx.asChild,
|
|
26
26
|
class: "magic-accordion-provider"
|
|
27
27
|
}, {
|
|
@@ -30,7 +30,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
30
30
|
]),
|
|
31
31
|
_: 3
|
|
32
32
|
/* FORWARDED */
|
|
33
|
-
}, 8, ["id", "as-child"]);
|
|
33
|
+
}, 8, ["data-id", "as-child"]);
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
});
|
|
@@ -1,32 +1,23 @@
|
|
|
1
1
|
import { type MaybeRef } from 'vue';
|
|
2
|
+
import { Primitive } from '@maas/vue-primitive';
|
|
2
3
|
import type { MagicAccordionOptions } from '../types/index.js';
|
|
3
4
|
interface MagicAccordionProviderProps {
|
|
4
5
|
id: MaybeRef<string>;
|
|
5
6
|
asChild?: boolean;
|
|
6
7
|
options?: MagicAccordionOptions;
|
|
7
8
|
}
|
|
8
|
-
declare
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
declare const
|
|
18
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
9
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
10
|
+
declare var __VLS_7: {};
|
|
11
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
12
|
+
default?: (props: typeof __VLS_7) => any;
|
|
13
|
+
}>;
|
|
14
|
+
declare const __VLS_self: import("vue").DefineComponent<MagicAccordionProviderProps, {
|
|
15
|
+
Primitive: typeof Primitive;
|
|
16
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicAccordionProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicAccordionProviderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicAccordionProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
19
19
|
export default _default;
|
|
20
|
-
type
|
|
21
|
-
type __VLS_TypePropsToOption<T> = {
|
|
22
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
23
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
24
|
-
} : {
|
|
25
|
-
type: import('vue').PropType<T[K]>;
|
|
26
|
-
required: true;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
20
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
21
|
new (): {
|
|
31
22
|
$slots: S;
|
|
32
23
|
};
|
|
@@ -1,36 +1,186 @@
|
|
|
1
1
|
import { type MaybeRef } from 'vue';
|
|
2
|
+
import { Primitive } from '@maas/vue-primitive';
|
|
2
3
|
import type { Interaction } from '../types/index.js';
|
|
3
4
|
interface MagicAccordionTriggerProps {
|
|
4
5
|
disabled?: MaybeRef<boolean>;
|
|
5
6
|
trigger?: Interaction;
|
|
6
7
|
asChild?: boolean;
|
|
7
8
|
}
|
|
8
|
-
declare
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
default
|
|
12
|
-
viewActive: any;
|
|
13
|
-
}): any;
|
|
9
|
+
declare const elRef: import("vue").Ref<import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
10
|
+
asChild: {
|
|
11
|
+
type: BooleanConstructor;
|
|
12
|
+
default: boolean;
|
|
14
13
|
};
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
as: {
|
|
15
|
+
type: import("vue").PropType<import("@maas/vue-primitive").ElementOrComponent>;
|
|
16
|
+
default: string;
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
}>>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
|
|
21
|
+
asChild: boolean;
|
|
22
|
+
as: import("@maas/vue-primitive").ElementOrComponent;
|
|
23
|
+
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
24
|
+
P: {};
|
|
25
|
+
B: {};
|
|
26
|
+
D: {};
|
|
27
|
+
C: {};
|
|
28
|
+
M: {};
|
|
29
|
+
Defaults: {};
|
|
30
|
+
}, Readonly<import("vue").ExtractPropTypes<{
|
|
31
|
+
asChild: {
|
|
32
|
+
type: BooleanConstructor;
|
|
33
|
+
default: boolean;
|
|
34
|
+
};
|
|
35
|
+
as: {
|
|
36
|
+
type: import("vue").PropType<import("@maas/vue-primitive").ElementOrComponent>;
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
39
|
+
}>>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
40
|
+
[key: string]: any;
|
|
41
|
+
}>, {}, {}, {}, {
|
|
42
|
+
asChild: boolean;
|
|
43
|
+
as: import("@maas/vue-primitive").ElementOrComponent;
|
|
44
|
+
}> | undefined, import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
45
|
+
asChild: {
|
|
46
|
+
type: BooleanConstructor;
|
|
47
|
+
default: boolean;
|
|
48
|
+
};
|
|
49
|
+
as: {
|
|
50
|
+
type: import("vue").PropType<import("@maas/vue-primitive").ElementOrComponent>;
|
|
51
|
+
default: string;
|
|
52
|
+
};
|
|
53
|
+
}>>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
54
|
+
[key: string]: any;
|
|
55
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
|
|
56
|
+
asChild: boolean;
|
|
57
|
+
as: import("@maas/vue-primitive").ElementOrComponent;
|
|
58
|
+
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
59
|
+
P: {};
|
|
60
|
+
B: {};
|
|
61
|
+
D: {};
|
|
62
|
+
C: {};
|
|
63
|
+
M: {};
|
|
64
|
+
Defaults: {};
|
|
65
|
+
}, Readonly<import("vue").ExtractPropTypes<{
|
|
66
|
+
asChild: {
|
|
67
|
+
type: BooleanConstructor;
|
|
68
|
+
default: boolean;
|
|
69
|
+
};
|
|
70
|
+
as: {
|
|
71
|
+
type: import("vue").PropType<import("@maas/vue-primitive").ElementOrComponent>;
|
|
72
|
+
default: string;
|
|
31
73
|
};
|
|
74
|
+
}>>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
75
|
+
[key: string]: any;
|
|
76
|
+
}>, {}, {}, {}, {
|
|
77
|
+
asChild: boolean;
|
|
78
|
+
as: import("@maas/vue-primitive").ElementOrComponent;
|
|
79
|
+
}> | undefined>;
|
|
80
|
+
declare const view: import("../types").AccordionView | undefined;
|
|
81
|
+
declare const mappedDisabled: import("vue").ComputedRef<boolean | undefined>;
|
|
82
|
+
declare const onMouseenter: () => void, onClick: () => void;
|
|
83
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
84
|
+
declare const __VLS_0: import("vue").DefineComponent<{
|
|
85
|
+
asChild: {
|
|
86
|
+
type: BooleanConstructor;
|
|
87
|
+
default: boolean;
|
|
88
|
+
};
|
|
89
|
+
as: {
|
|
90
|
+
type: import("vue").PropType<import("@maas/vue-primitive").ElementOrComponent>;
|
|
91
|
+
default: string;
|
|
92
|
+
};
|
|
93
|
+
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
94
|
+
[key: string]: any;
|
|
95
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
96
|
+
asChild: {
|
|
97
|
+
type: BooleanConstructor;
|
|
98
|
+
default: boolean;
|
|
99
|
+
};
|
|
100
|
+
as: {
|
|
101
|
+
type: import("vue").PropType<import("@maas/vue-primitive").ElementOrComponent>;
|
|
102
|
+
default: string;
|
|
103
|
+
};
|
|
104
|
+
}>>, {
|
|
105
|
+
asChild: boolean;
|
|
106
|
+
as: import("@maas/vue-primitive").ElementOrComponent;
|
|
107
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
108
|
+
declare const __VLS_2: import("vue/jsx-runtime").JSX.Element & {
|
|
109
|
+
__ctx?: ({
|
|
110
|
+
attrs?: any;
|
|
111
|
+
slots?: Readonly<{
|
|
112
|
+
[name: string]: import("vue").Slot<any> | undefined;
|
|
113
|
+
}> | undefined;
|
|
114
|
+
emit?: ((event: string, ...args: any[]) => void) | undefined;
|
|
115
|
+
} & {
|
|
116
|
+
props?: (Partial<{
|
|
117
|
+
asChild: boolean;
|
|
118
|
+
as: import("@maas/vue-primitive").ElementOrComponent;
|
|
119
|
+
}> & Omit<{
|
|
120
|
+
readonly asChild: boolean;
|
|
121
|
+
readonly as: import("@maas/vue-primitive").ElementOrComponent;
|
|
122
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "asChild" | "as"> & Record<string, unknown>) | undefined;
|
|
123
|
+
expose?(exposed: import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
124
|
+
asChild: {
|
|
125
|
+
type: BooleanConstructor;
|
|
126
|
+
default: boolean;
|
|
127
|
+
};
|
|
128
|
+
as: {
|
|
129
|
+
type: import("vue").PropType<import("@maas/vue-primitive").ElementOrComponent>;
|
|
130
|
+
default: string;
|
|
131
|
+
};
|
|
132
|
+
}>>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
133
|
+
[key: string]: any;
|
|
134
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
|
|
135
|
+
asChild: boolean;
|
|
136
|
+
as: import("@maas/vue-primitive").ElementOrComponent;
|
|
137
|
+
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
138
|
+
P: {};
|
|
139
|
+
B: {};
|
|
140
|
+
D: {};
|
|
141
|
+
C: {};
|
|
142
|
+
M: {};
|
|
143
|
+
Defaults: {};
|
|
144
|
+
}, Readonly<import("vue").ExtractPropTypes<{
|
|
145
|
+
asChild: {
|
|
146
|
+
type: BooleanConstructor;
|
|
147
|
+
default: boolean;
|
|
148
|
+
};
|
|
149
|
+
as: {
|
|
150
|
+
type: import("vue").PropType<import("@maas/vue-primitive").ElementOrComponent>;
|
|
151
|
+
default: string;
|
|
152
|
+
};
|
|
153
|
+
}>>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
154
|
+
[key: string]: any;
|
|
155
|
+
}>, {}, {}, {}, {
|
|
156
|
+
asChild: boolean;
|
|
157
|
+
as: import("@maas/vue-primitive").ElementOrComponent;
|
|
158
|
+
}>): void;
|
|
159
|
+
}) | undefined;
|
|
32
160
|
};
|
|
33
|
-
|
|
161
|
+
declare var __VLS_6: (Parameters<NonNullable<(typeof __VLS_5)["expose"]>>[0] | null);
|
|
162
|
+
declare var __VLS_10: {
|
|
163
|
+
viewActive: boolean | undefined;
|
|
164
|
+
};
|
|
165
|
+
declare var __VLS_5: __VLS_PickFunctionalComponentCtx<typeof __VLS_0, typeof __VLS_2>;
|
|
166
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
167
|
+
default?: (props: typeof __VLS_10) => any;
|
|
168
|
+
}>;
|
|
169
|
+
type __VLS_TemplateRefs = {
|
|
170
|
+
elRef: typeof __VLS_6;
|
|
171
|
+
};
|
|
172
|
+
declare const __VLS_self: import("vue").DefineComponent<MagicAccordionTriggerProps, {
|
|
173
|
+
Primitive: typeof Primitive;
|
|
174
|
+
elRef: typeof elRef;
|
|
175
|
+
view: typeof view;
|
|
176
|
+
mappedDisabled: typeof mappedDisabled;
|
|
177
|
+
onMouseenter: typeof onMouseenter;
|
|
178
|
+
onClick: typeof onClick;
|
|
179
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicAccordionTriggerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
180
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicAccordionTriggerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicAccordionTriggerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, __VLS_TemplateRefs, any>;
|
|
181
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
182
|
+
export default _default;
|
|
183
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
34
184
|
new (): {
|
|
35
185
|
$slots: S;
|
|
36
186
|
};
|
|
@@ -1,32 +1,25 @@
|
|
|
1
|
+
import { Primitive } from '@maas/vue-primitive';
|
|
1
2
|
interface MagicAccordionViewProps {
|
|
2
3
|
id?: string;
|
|
3
4
|
asChild?: boolean;
|
|
4
5
|
active?: boolean;
|
|
5
6
|
}
|
|
6
|
-
declare
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
viewActive: any;
|
|
11
|
-
}): any;
|
|
12
|
-
};
|
|
13
|
-
refs: {};
|
|
14
|
-
rootEl: any;
|
|
7
|
+
declare const view: import("../types").AccordionView;
|
|
8
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
9
|
+
declare var __VLS_7: {
|
|
10
|
+
viewActive: boolean;
|
|
15
11
|
};
|
|
16
|
-
type
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
13
|
+
default?: (props: typeof __VLS_7) => any;
|
|
14
|
+
}>;
|
|
15
|
+
declare const __VLS_self: import("vue").DefineComponent<MagicAccordionViewProps, {
|
|
16
|
+
Primitive: typeof Primitive;
|
|
17
|
+
view: typeof view;
|
|
18
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicAccordionViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicAccordionViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicAccordionViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
19
21
|
export default _default;
|
|
20
|
-
type
|
|
21
|
-
type __VLS_TypePropsToOption<T> = {
|
|
22
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
23
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
24
|
-
} : {
|
|
25
|
-
type: import('vue').PropType<T[K]>;
|
|
26
|
-
required: true;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
23
|
new (): {
|
|
31
24
|
$slots: S;
|
|
32
25
|
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import '@maas/vue-equipment/utils/css/animations/fade-in.css';
|
|
2
|
-
import '@maas/vue-equipment/utils/css/animations/fade-out.css';
|
|
3
|
-
declare function __VLS_template(): {
|
|
4
|
-
attrs: Partial<{}>;
|
|
5
|
-
slots: {
|
|
6
|
-
default?(_: {}): any;
|
|
7
|
-
};
|
|
8
|
-
refs: {
|
|
9
|
-
elRef: any;
|
|
10
|
-
};
|
|
11
|
-
rootEl: any;
|
|
12
|
-
};
|
|
13
|
-
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
14
|
-
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
15
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
16
|
-
export default _default;
|
|
17
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
18
|
-
new (): {
|
|
19
|
-
$slots: S;
|
|
20
|
-
};
|
|
21
|
-
};
|