vue3-carousel
Advanced tools
Comparing version 0.2.15 to 0.2.16
/** | ||
* Vue 3 Carousel 0.2.15 | ||
* Vue 3 Carousel 0.2.16 | ||
* (c) 2023 | ||
* @license MIT | ||
*/ | ||
import { defineComponent, inject, ref, h, reactive, provide, onMounted, nextTick, onUnmounted, computed, watch, cloneVNode } from 'vue'; | ||
import { Fragment, defineComponent, inject, ref, h, reactive, provide, onMounted, nextTick, onUnmounted, computed, watch, cloneVNode } from 'vue'; | ||
@@ -192,10 +192,14 @@ const defaultConfigs = { | ||
function getSlidesVNodes(vNode) { | ||
var _a, _b, _c, _d; | ||
// Return empty array if there's any node | ||
if (!vNode) | ||
return []; | ||
// Check if the Slides components are added directly without v-for (#72) | ||
if (((_a = vNode[0]) === null || _a === void 0 ? void 0 : _a.children) === "v-if" || ((_c = (_b = vNode[0]) === null || _b === void 0 ? void 0 : _b.type) === null || _c === void 0 ? void 0 : _c.name) === 'CarouselSlide') | ||
return vNode.filter((node) => { var _a; return ((_a = node.type) === null || _a === void 0 ? void 0 : _a.name) === "CarouselSlide"; }); | ||
return ((_d = vNode[0]) === null || _d === void 0 ? void 0 : _d.children) || []; | ||
return vNode.reduce((acc, node) => { | ||
var _a; | ||
if (node.type === Fragment) { | ||
return [...acc, ...getSlidesVNodes(node.children)]; | ||
} | ||
if (((_a = node.type) === null || _a === void 0 ? void 0 : _a.name) === 'CarouselSlide') { | ||
return [...acc, node]; | ||
} | ||
return acc; | ||
}, []); | ||
} | ||
@@ -202,0 +206,0 @@ |
/** | ||
* Vue 3 Carousel 0.2.15 | ||
* Vue 3 Carousel 0.2.16 | ||
* (c) 2023 | ||
@@ -196,10 +196,14 @@ * @license MIT | ||
function getSlidesVNodes(vNode) { | ||
var _a, _b, _c, _d; | ||
// Return empty array if there's any node | ||
if (!vNode) | ||
return []; | ||
// Check if the Slides components are added directly without v-for (#72) | ||
if (((_a = vNode[0]) === null || _a === void 0 ? void 0 : _a.children) === "v-if" || ((_c = (_b = vNode[0]) === null || _b === void 0 ? void 0 : _b.type) === null || _c === void 0 ? void 0 : _c.name) === 'CarouselSlide') | ||
return vNode.filter((node) => { var _a; return ((_a = node.type) === null || _a === void 0 ? void 0 : _a.name) === "CarouselSlide"; }); | ||
return ((_d = vNode[0]) === null || _d === void 0 ? void 0 : _d.children) || []; | ||
return vNode.reduce((acc, node) => { | ||
var _a; | ||
if (node.type === vue.Fragment) { | ||
return [...acc, ...getSlidesVNodes(node.children)]; | ||
} | ||
if (((_a = node.type) === null || _a === void 0 ? void 0 : _a.name) === 'CarouselSlide') { | ||
return [...acc, node]; | ||
} | ||
return acc; | ||
}, []); | ||
} | ||
@@ -206,0 +210,0 @@ |
{ | ||
"name": "vue3-carousel", | ||
"version": "0.2.15", | ||
"version": "0.2.16", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "build": "rollup -c", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13
1947
276360