swiper-next
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -5,2 +5,3 @@ import { Component, Plugin } from 'vue'; | ||
export declare const registerInstall: <T extends Component>(component: T) => SFCWithInstall<T>; | ||
export declare function withInstall(comp: any): any; | ||
export {}; |
@@ -1,3 +0,4 @@ | ||
import { default as SwiperItem } from './swiper-item'; | ||
import { default as _SwiperItem } from './swiper-item'; | ||
declare const SwiperItem: any; | ||
declare const _default: { | ||
@@ -43,3 +44,3 @@ new (...args: any[]): import('vue').CreateComponentPublicInstance<Readonly<import('vue').ExtractPropTypes<{ | ||
export default _default; | ||
export type SWiperItemInstance = InstanceType<typeof SwiperItem>; | ||
export type SWiperItemInstance = InstanceType<typeof _SwiperItem>; | ||
export { SwiperItem, }; |
@@ -1,3 +0,4 @@ | ||
import { default as Swiper } from './swiper'; | ||
import { default as _Swiper } from './swiper'; | ||
declare const Swiper: any; | ||
declare const _default: { | ||
@@ -390,3 +391,3 @@ new (...args: any[]): import('vue').CreateComponentPublicInstance<Readonly<import('vue').ExtractPropTypes<{ | ||
export default _default; | ||
export type SWiperInstance = InstanceType<typeof Swiper>; | ||
export { Swiper, }; | ||
export type SWiperInstance = InstanceType<typeof _Swiper>; | ||
export { Swiper }; |
@@ -1,2 +0,2 @@ | ||
import { ComponentInternalInstance, ComponentPublicInstance, RendererNode } from 'vue'; | ||
import { ComponentInternalInstance, RendererNode } from 'vue'; | ||
@@ -42,3 +42,4 @@ interface HTMLElementWithDataset extends HTMLElement { | ||
export declare function isBuiltInComponent(tag: string): boolean; | ||
export declare function resolveOwnerVm(vm: ComponentInternalInstance): ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import('vue').ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | undefined; | ||
export declare function resolveOwnerVm(vm: ComponentInternalInstance): import('vue').ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import('vue').ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | undefined; | ||
export declare function upx2px(num: number): number; | ||
export {}; |
@@ -6,15 +6,5 @@ import { ComponentInternalInstance } from 'vue'; | ||
timeStamp: number; | ||
target: { | ||
id: string; | ||
dataset: DOMStringMap & Record<string, any>; | ||
offsetTop: number; | ||
offsetLeft: number; | ||
}; | ||
target: any; | ||
detail: {}; | ||
currentTarget: { | ||
id: string; | ||
dataset: DOMStringMap & Record<string, any>; | ||
offsetTop: number; | ||
offsetLeft: number; | ||
}; | ||
currentTarget: any; | ||
}[]; | ||
@@ -24,15 +14,5 @@ export declare function createNativeEvent(evt: Event | TouchEvent, htmlElement?: boolean): { | ||
timeStamp: number; | ||
target: { | ||
id: string; | ||
dataset: DOMStringMap & Record<string, any>; | ||
offsetTop: number; | ||
offsetLeft: number; | ||
}; | ||
target: any; | ||
detail: {}; | ||
currentTarget: { | ||
id: string; | ||
dataset: DOMStringMap & Record<string, any>; | ||
offsetTop: number; | ||
offsetLeft: number; | ||
}; | ||
currentTarget: any; | ||
}; |
@@ -42,3 +42,3 @@ import { ComponentInternalInstance, ComponentPublicInstance } from 'vue'; | ||
triggerEvent(eventName: string, detail?: {}): this; | ||
getComputedStyle(names?: string[]): CSSStyleDeclaration | Record<string, any>; | ||
getComputedStyle(names?: string[]): Record<string, any> | CSSStyleDeclaration; | ||
setTimeout(handler: TimerHandler, timeout?: number): number; | ||
@@ -45,0 +45,0 @@ clearTimeout(handle?: number): void; |
"use strict"; | ||
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); | ||
const installer = require("./src/components/installer.js"); | ||
const swiper = require("./src/components/swiper/swiper.js"); | ||
const swiperItem = require("./src/components/swiper-item/swiper-item.js"); | ||
const index$1 = require("./src/components/swiper/index.js"); | ||
const index$2 = require("./src/components/swiper-item/index.js"); | ||
function index(Vue) { | ||
installer(Vue); | ||
} | ||
exports.Swiper = swiper; | ||
exports.SwiperItem = swiperItem; | ||
exports.Swiper = index$1.Swiper; | ||
exports.SwiperItem = index$2.SwiperItem; | ||
exports.default = index; |
"use strict"; | ||
require("./swiper/index.js"); | ||
require("./swiper-item/index.js"); | ||
const swiper = require("./swiper/swiper.js"); | ||
const swiperItem = require("./swiper-item/swiper-item.js"); | ||
const index = require("./swiper/index.js"); | ||
const index$1 = require("./swiper-item/index.js"); | ||
function installer(Vue) { | ||
Vue.use(swiper); | ||
Vue.use(swiperItem); | ||
Vue.use(index.Swiper); | ||
Vue.use(index$1.SwiperItem); | ||
} | ||
module.exports = installer; |
@@ -5,2 +5,3 @@ import { Component, Plugin } from 'vue'; | ||
export declare const registerInstall: <T extends Component>(component: T) => SFCWithInstall<T>; | ||
export declare function withInstall(comp: any): any; | ||
export {}; |
@@ -11,2 +11,9 @@ "use strict"; | ||
}; | ||
function withInstall(comp) { | ||
comp.install = function(Vue) { | ||
Vue.component(comp.name, comp); | ||
}; | ||
return comp; | ||
} | ||
exports.registerInstall = registerInstall; | ||
exports.withInstall = withInstall; |
@@ -1,3 +0,4 @@ | ||
import { default as SwiperItem } from './swiper-item'; | ||
import { default as _SwiperItem } from './swiper-item'; | ||
declare const SwiperItem: any; | ||
declare const _default: { | ||
@@ -43,3 +44,3 @@ new (...args: any[]): import('vue').CreateComponentPublicInstance<Readonly<import('vue').ExtractPropTypes<{ | ||
export default _default; | ||
export type SWiperItemInstance = InstanceType<typeof SwiperItem>; | ||
export type SWiperItemInstance = InstanceType<typeof _SwiperItem>; | ||
export { SwiperItem, }; |
@@ -6,6 +6,4 @@ "use strict"; | ||
;/* empty css */ | ||
swiperItem.install = function(Vue) { | ||
Vue.component(swiperItem.name, swiperItem); | ||
}; | ||
const SwiperItem = registerInstall.withInstall(swiperItem); | ||
registerInstall.registerInstall(swiperItem); | ||
exports.SwiperItem = swiperItem; | ||
exports.SwiperItem = SwiperItem; |
@@ -10,3 +10,3 @@ "use strict"; | ||
}; | ||
const SwiperItem = /* @__PURE__ */ component.defineBuiltInComponent({ | ||
const _SwiperItem = /* @__PURE__ */ component.defineBuiltInComponent({ | ||
name: "SwiperItem", | ||
@@ -67,2 +67,2 @@ props, | ||
}); | ||
module.exports = SwiperItem; | ||
module.exports = _SwiperItem; |
@@ -1,3 +0,4 @@ | ||
import { default as Swiper } from './swiper'; | ||
import { default as _Swiper } from './swiper'; | ||
declare const Swiper: any; | ||
declare const _default: { | ||
@@ -390,3 +391,3 @@ new (...args: any[]): import('vue').CreateComponentPublicInstance<Readonly<import('vue').ExtractPropTypes<{ | ||
export default _default; | ||
export type SWiperInstance = InstanceType<typeof Swiper>; | ||
export { Swiper, }; | ||
export type SWiperInstance = InstanceType<typeof _Swiper>; | ||
export { Swiper }; |
@@ -6,6 +6,4 @@ "use strict"; | ||
;/* empty css */ | ||
swiper.install = function(Vue) { | ||
Vue.component(swiper.name, swiper); | ||
}; | ||
const Swiper = registerInstall.withInstall(swiper); | ||
registerInstall.registerInstall(swiper); | ||
exports.Swiper = swiper; | ||
exports.Swiper = Swiper; |
@@ -207,15 +207,15 @@ "use strict"; | ||
} | ||
const _animating = animating; | ||
const innerAnimating = animating; | ||
const { | ||
toPos | ||
} = _animating; | ||
} = innerAnimating; | ||
const { | ||
acc | ||
} = _animating; | ||
} = innerAnimating; | ||
const { | ||
endTime | ||
} = _animating; | ||
} = innerAnimating; | ||
const { | ||
source | ||
} = _animating; | ||
} = innerAnimating; | ||
const time = endTime - Date.now(); | ||
@@ -533,3 +533,3 @@ if (time <= 0) { | ||
} | ||
const Swiper = /* @__PURE__ */ component.defineBuiltInComponent({ | ||
const _Swiper = /* @__PURE__ */ component.defineBuiltInComponent({ | ||
name: "Swiper", | ||
@@ -681,22 +681,22 @@ props, | ||
const swiperItemLength = swiperContext.value.length; | ||
let _current = state.current; | ||
let innerCurrent = state.current; | ||
switch (type) { | ||
case "prev": | ||
_current--; | ||
if (_current < 0 && circularEnabled.value) { | ||
_current = swiperItemLength - 1; | ||
innerCurrent--; | ||
if (innerCurrent < 0 && circularEnabled.value) { | ||
innerCurrent = swiperItemLength - 1; | ||
} | ||
break; | ||
case "next": | ||
_current++; | ||
if (_current >= swiperItemLength && circularEnabled.value) { | ||
_current = 0; | ||
innerCurrent++; | ||
if (innerCurrent >= swiperItemLength && circularEnabled.value) { | ||
innerCurrent = 0; | ||
} | ||
break; | ||
} | ||
onSwiperDotClick(_current); | ||
onSwiperDotClick(innerCurrent); | ||
} | ||
const createNavigationSVG = () => icon.createSvgIconVNode(icon.ICON_PATH_BACK, props2.navigationColor, 26); | ||
let setHideNavigationTimer; | ||
const _mousemove = (e) => { | ||
const innerMousemove = (e) => { | ||
clearTimeout(setHideNavigationTimer); | ||
@@ -728,3 +728,3 @@ const { | ||
}; | ||
const _mouseleave = () => { | ||
const innerMouseleave = () => { | ||
hideNavigation.value = true; | ||
@@ -734,7 +734,7 @@ }; | ||
if (rootRef.value) { | ||
rootRef.value.removeEventListener("mousemove", _mousemove); | ||
rootRef.value.removeEventListener("mouseleave", _mouseleave); | ||
rootRef.value.removeEventListener("mousemove", innerMousemove); | ||
rootRef.value.removeEventListener("mouseleave", innerMouseleave); | ||
if (isNavigationAuto) { | ||
rootRef.value.addEventListener("mousemove", _mousemove); | ||
rootRef.value.addEventListener("mouseleave", _mouseleave); | ||
rootRef.value.addEventListener("mousemove", innerMousemove); | ||
rootRef.value.addEventListener("mouseleave", innerMouseleave); | ||
} | ||
@@ -766,2 +766,2 @@ } | ||
}; | ||
module.exports = Swiper; | ||
module.exports = _Swiper; |
"use strict"; | ||
const index = require("../shared/index.js"); | ||
function converPx(value) { | ||
if (/^-?\d+[ur]px$/i.test(value)) { | ||
return value.replace(/(^-?\d+)[ur]px$/i, (text, num) => { | ||
return `${uni.upx2px(parseFloat(num))}px`; | ||
return `${index.upx2px(parseFloat(num))}px`; | ||
}); | ||
@@ -80,7 +81,7 @@ } else if (/^-?[\d\.]+$/.test(value)) { | ||
} | ||
let index = 0; | ||
let index2 = 0; | ||
const actions = animation2.actions; | ||
const length = animation2.actions.length; | ||
function animate() { | ||
const action = actions[index]; | ||
const action = actions[index2]; | ||
const transition = action.option.transition; | ||
@@ -91,4 +92,4 @@ const style = getStyle(action); | ||
}); | ||
index += 1; | ||
if (index < length) { | ||
index2 += 1; | ||
if (index2 < length) { | ||
setTimeout(animate, transition.duration + transition.delay); | ||
@@ -95,0 +96,0 @@ } |
@@ -23,8 +23,8 @@ "use strict"; | ||
}; | ||
let __mouseMoveEventListener; | ||
let __mouseUpEventListener; | ||
let innerMouseMoveEventListener; | ||
let innerMouseUpEventListener; | ||
function useTouchtrack(element, method, useCancel) { | ||
vue.onBeforeUnmount(() => { | ||
document.removeEventListener("mousemove", __mouseMoveEventListener); | ||
document.removeEventListener("mouseup", __mouseUpEventListener); | ||
document.removeEventListener("mousemove", innerMouseMoveEventListener); | ||
document.removeEventListener("mouseup", innerMouseUpEventListener); | ||
}); | ||
@@ -93,3 +93,3 @@ let x0 = 0; | ||
}); | ||
const mouseMoveEventListener = __mouseMoveEventListener = function($event) { | ||
const mouseMoveEventListener = innerMouseMoveEventListener = function($event) { | ||
if (!hasTouchStart && hasMouseDown && $eventOld) { | ||
@@ -115,3 +115,3 @@ const res = fn($event, "move", $event.pageX, $event.pageY); | ||
}); | ||
const mouseUpEventListener = __mouseUpEventListener = function($event) { | ||
const mouseUpEventListener = innerMouseUpEventListener = function($event) { | ||
hasMouseDown = false; | ||
@@ -118,0 +118,0 @@ if (!hasTouchStart && $eventOld) { |
@@ -1,2 +0,2 @@ | ||
import { ComponentInternalInstance, ComponentPublicInstance, RendererNode } from 'vue'; | ||
import { ComponentInternalInstance, RendererNode } from 'vue'; | ||
@@ -42,3 +42,4 @@ interface HTMLElementWithDataset extends HTMLElement { | ||
export declare function isBuiltInComponent(tag: string): boolean; | ||
export declare function resolveOwnerVm(vm: ComponentInternalInstance): ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import('vue').ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | undefined; | ||
export declare function resolveOwnerVm(vm: ComponentInternalInstance): import('vue').ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import('vue').ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | undefined; | ||
export declare function upx2px(num: number): number; | ||
export {}; |
@@ -16,3 +16,7 @@ "use strict"; | ||
} | ||
function upx2px(num) { | ||
return num; | ||
} | ||
exports.getCustomDataset = getCustomDataset; | ||
exports.normalizeTarget = normalizeTarget; | ||
exports.upx2px = upx2px; |
"use strict"; | ||
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); | ||
const shared = require("@vue/shared"); | ||
const index = require("../../shared/index.js"); | ||
function hasRpx(str) { | ||
@@ -15,3 +16,3 @@ str = str + ""; | ||
if (hasRpx(str)) { | ||
return uni.upx2px(res); | ||
return index.upx2px(res); | ||
} | ||
@@ -27,5 +28,5 @@ return res; | ||
return str.replace(/(\d+(\.\d+)?)[ru]px/g, (_a, b) => { | ||
return uni.upx2px(parseFloat(b)) + "px"; | ||
return index.upx2px(parseFloat(b)) + "px"; | ||
}); | ||
} | ||
exports.rpx2px = rpx2px; |
@@ -6,15 +6,5 @@ import { ComponentInternalInstance } from 'vue'; | ||
timeStamp: number; | ||
target: { | ||
id: string; | ||
dataset: DOMStringMap & Record<string, any>; | ||
offsetTop: number; | ||
offsetLeft: number; | ||
}; | ||
target: any; | ||
detail: {}; | ||
currentTarget: { | ||
id: string; | ||
dataset: DOMStringMap & Record<string, any>; | ||
offsetTop: number; | ||
offsetLeft: number; | ||
}; | ||
currentTarget: any; | ||
}[]; | ||
@@ -24,15 +14,5 @@ export declare function createNativeEvent(evt: Event | TouchEvent, htmlElement?: boolean): { | ||
timeStamp: number; | ||
target: { | ||
id: string; | ||
dataset: DOMStringMap & Record<string, any>; | ||
offsetTop: number; | ||
offsetLeft: number; | ||
}; | ||
target: any; | ||
detail: {}; | ||
currentTarget: { | ||
id: string; | ||
dataset: DOMStringMap & Record<string, any>; | ||
offsetTop: number; | ||
offsetLeft: number; | ||
}; | ||
currentTarget: any; | ||
}; |
@@ -42,3 +42,3 @@ import { ComponentInternalInstance, ComponentPublicInstance } from 'vue'; | ||
triggerEvent(eventName: string, detail?: {}): this; | ||
getComputedStyle(names?: string[]): CSSStyleDeclaration | Record<string, any>; | ||
getComputedStyle(names?: string[]): Record<string, any> | CSSStyleDeclaration; | ||
setTimeout(handler: TimerHandler, timeout?: number): number; | ||
@@ -45,0 +45,0 @@ clearTimeout(handle?: number): void; |
{ | ||
"name": "swiper-next", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Vue3 的 Swiper 组件", | ||
@@ -49,2 +49,3 @@ "main": "lib/index.js", | ||
"rollup-plugin-postcss": "^4.0.2", | ||
"standard-version": "^9.5.0", | ||
"vite": "^5.3.5", | ||
@@ -57,2 +58,2 @@ "vite-plugin-dts": "4.0.0-beta.1", | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
164575
14
81
4433