first commit
This commit is contained in:
53
node_modules/vant/lib/back-top/BackTop.d.ts
generated
vendored
Normal file
53
node_modules/vant/lib/back-top/BackTop.d.ts
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
import { type PropType, type TeleportProps, type ExtractPropTypes } from 'vue';
|
||||
export declare const backTopProps: {
|
||||
right: (NumberConstructor | StringConstructor)[];
|
||||
bottom: (NumberConstructor | StringConstructor)[];
|
||||
zIndex: (NumberConstructor | StringConstructor)[];
|
||||
target: PropType<TeleportProps["to"]>;
|
||||
offset: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
immediate: BooleanConstructor;
|
||||
teleport: {
|
||||
type: PropType<TeleportProps["to"]>;
|
||||
default: string;
|
||||
};
|
||||
};
|
||||
export type BackTopProps = ExtractPropTypes<typeof backTopProps>;
|
||||
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
||||
right: (NumberConstructor | StringConstructor)[];
|
||||
bottom: (NumberConstructor | StringConstructor)[];
|
||||
zIndex: (NumberConstructor | StringConstructor)[];
|
||||
target: PropType<TeleportProps["to"]>;
|
||||
offset: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
immediate: BooleanConstructor;
|
||||
teleport: {
|
||||
type: PropType<TeleportProps["to"]>;
|
||||
default: string;
|
||||
};
|
||||
}>, () => import("vue/jsx-runtime").JSX.Element | import("vue/jsx-runtime").JSX.Element[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
||||
right: (NumberConstructor | StringConstructor)[];
|
||||
bottom: (NumberConstructor | StringConstructor)[];
|
||||
zIndex: (NumberConstructor | StringConstructor)[];
|
||||
target: PropType<TeleportProps["to"]>;
|
||||
offset: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
immediate: BooleanConstructor;
|
||||
teleport: {
|
||||
type: PropType<TeleportProps["to"]>;
|
||||
default: string;
|
||||
};
|
||||
}>> & Readonly<{
|
||||
onClick?: ((...args: any[]) => any) | undefined;
|
||||
}>, {
|
||||
offset: string | number;
|
||||
immediate: boolean;
|
||||
teleport: string | import("vue").RendererElement | null | undefined;
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
||||
export default _default;
|
||||
137
node_modules/vant/lib/back-top/BackTop.js
generated
vendored
Normal file
137
node_modules/vant/lib/back-top/BackTop.js
generated
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name2 in all)
|
||||
__defProp(target, name2, { get: all[name2], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var stdin_exports = {};
|
||||
__export(stdin_exports, {
|
||||
backTopProps: () => backTopProps,
|
||||
default: () => stdin_default
|
||||
});
|
||||
module.exports = __toCommonJS(stdin_exports);
|
||||
var import_vue = require("vue");
|
||||
var import_utils = require("../utils");
|
||||
var import_util = require("../lazyload/vue-lazyload/util");
|
||||
var import_use = require("@vant/use");
|
||||
var import_icon = require("../icon");
|
||||
const [name, bem] = (0, import_utils.createNamespace)("back-top");
|
||||
const backTopProps = {
|
||||
right: import_utils.numericProp,
|
||||
bottom: import_utils.numericProp,
|
||||
zIndex: import_utils.numericProp,
|
||||
target: [String, Object],
|
||||
offset: (0, import_utils.makeNumericProp)(200),
|
||||
immediate: Boolean,
|
||||
teleport: {
|
||||
type: [String, Object],
|
||||
default: "body"
|
||||
}
|
||||
};
|
||||
var stdin_default = (0, import_vue.defineComponent)({
|
||||
name,
|
||||
inheritAttrs: false,
|
||||
props: backTopProps,
|
||||
emits: ["click"],
|
||||
setup(props, {
|
||||
emit,
|
||||
slots,
|
||||
attrs
|
||||
}) {
|
||||
let shouldReshow = false;
|
||||
const show = (0, import_vue.ref)(false);
|
||||
const root = (0, import_vue.ref)();
|
||||
const scrollParent = (0, import_vue.ref)();
|
||||
const style = (0, import_vue.computed)(() => (0, import_utils.extend)((0, import_utils.getZIndexStyle)(props.zIndex), {
|
||||
right: (0, import_utils.addUnit)(props.right),
|
||||
bottom: (0, import_utils.addUnit)(props.bottom)
|
||||
}));
|
||||
const onClick = (event) => {
|
||||
var _a;
|
||||
emit("click", event);
|
||||
(_a = scrollParent.value) == null ? void 0 : _a.scrollTo({
|
||||
top: 0,
|
||||
behavior: props.immediate ? "auto" : "smooth"
|
||||
});
|
||||
};
|
||||
const scroll = () => {
|
||||
show.value = scrollParent.value ? (0, import_utils.getScrollTop)(scrollParent.value) >= +props.offset : false;
|
||||
};
|
||||
const getTarget = () => {
|
||||
const {
|
||||
target
|
||||
} = props;
|
||||
if (typeof target === "string") {
|
||||
const el = document.querySelector(target);
|
||||
if (el) {
|
||||
return el;
|
||||
}
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
console.error(`[Vant] BackTop: target element "${target}" was not found, the BackTop component will not be rendered.`);
|
||||
}
|
||||
} else {
|
||||
return target;
|
||||
}
|
||||
};
|
||||
const updateTarget = () => {
|
||||
if (import_utils.inBrowser) {
|
||||
(0, import_vue.nextTick)(() => {
|
||||
scrollParent.value = props.target ? getTarget() : (0, import_use.getScrollParent)(root.value);
|
||||
scroll();
|
||||
});
|
||||
}
|
||||
};
|
||||
(0, import_use.useEventListener)("scroll", (0, import_util.throttle)(scroll, 100), {
|
||||
target: scrollParent
|
||||
});
|
||||
(0, import_vue.onMounted)(updateTarget);
|
||||
(0, import_vue.onActivated)(() => {
|
||||
if (shouldReshow) {
|
||||
show.value = true;
|
||||
shouldReshow = false;
|
||||
}
|
||||
});
|
||||
(0, import_vue.onDeactivated)(() => {
|
||||
if (show.value && props.teleport) {
|
||||
show.value = false;
|
||||
shouldReshow = true;
|
||||
}
|
||||
});
|
||||
(0, import_vue.watch)(() => props.target, updateTarget);
|
||||
return () => {
|
||||
const Content = (0, import_vue.createVNode)("div", (0, import_vue.mergeProps)({
|
||||
"ref": !props.teleport ? root : void 0,
|
||||
"class": bem({
|
||||
active: show.value
|
||||
}),
|
||||
"style": style.value,
|
||||
"onClick": onClick
|
||||
}, attrs), [slots.default ? slots.default() : (0, import_vue.createVNode)(import_icon.Icon, {
|
||||
"name": "back-top",
|
||||
"class": bem("icon")
|
||||
}, null)]);
|
||||
if (props.teleport) {
|
||||
return [(0, import_vue.createVNode)("div", {
|
||||
"ref": root,
|
||||
"class": bem("placeholder")
|
||||
}, null), (0, import_vue.createVNode)(import_vue.Teleport, {
|
||||
"to": props.teleport
|
||||
}, {
|
||||
default: () => [Content]
|
||||
})];
|
||||
}
|
||||
return Content;
|
||||
};
|
||||
}
|
||||
});
|
||||
1
node_modules/vant/lib/back-top/index.css
generated
vendored
Normal file
1
node_modules/vant/lib/back-top/index.css
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
:root,:host{--van-back-top-size: 40px;--van-back-top-right: 30px;--van-back-top-bottom: 40px;--van-back-top-z-index: 100;--van-back-top-icon-size: 20px;--van-back-top-text-color: #fff;--van-back-top-background: var(--van-blue)}.van-back-top{position:fixed;display:flex;align-items:center;justify-content:center;width:var(--van-back-top-size);height:var(--van-back-top-size);right:var(--van-back-top-right);bottom:var(--van-back-top-bottom);z-index:var(--van-back-top-z-index);cursor:pointer;color:var(--van-back-top-text-color);border-radius:var(--van-radius-max);box-shadow:0 2px 8px rgba(0,0,0,.12);transform:scale(0);transition:var(--van-duration-base) cubic-bezier(.25,.8,.5,1);background-color:var(--van-back-top-background)}.van-back-top:active{opacity:var(--van-active-opacity)}.van-back-top__placeholder{display:none}.van-back-top--active{transform:scale(1)}.van-back-top__icon{font-size:var(--van-back-top-icon-size);font-weight:var(--van-font-bold)}
|
||||
44
node_modules/vant/lib/back-top/index.d.ts
generated
vendored
Normal file
44
node_modules/vant/lib/back-top/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
export declare const BackTop: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
||||
right: (NumberConstructor | StringConstructor)[];
|
||||
bottom: (NumberConstructor | StringConstructor)[];
|
||||
zIndex: (NumberConstructor | StringConstructor)[];
|
||||
target: import("vue").PropType<import("vue").TeleportProps["to"]>;
|
||||
offset: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
immediate: BooleanConstructor;
|
||||
teleport: {
|
||||
type: import("vue").PropType<import("vue").TeleportProps["to"]>;
|
||||
default: string;
|
||||
};
|
||||
}>, () => import("vue/jsx-runtime").JSX.Element | import("vue/jsx-runtime").JSX.Element[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
||||
right: (NumberConstructor | StringConstructor)[];
|
||||
bottom: (NumberConstructor | StringConstructor)[];
|
||||
zIndex: (NumberConstructor | StringConstructor)[];
|
||||
target: import("vue").PropType<import("vue").TeleportProps["to"]>;
|
||||
offset: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
immediate: BooleanConstructor;
|
||||
teleport: {
|
||||
type: import("vue").PropType<import("vue").TeleportProps["to"]>;
|
||||
default: string;
|
||||
};
|
||||
}>> & Readonly<{
|
||||
onClick?: ((...args: any[]) => any) | undefined;
|
||||
}>, {
|
||||
offset: string | number;
|
||||
immediate: boolean;
|
||||
teleport: string | import("vue").RendererElement | null | undefined;
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
||||
export default BackTop;
|
||||
export { backTopProps } from './BackTop';
|
||||
export type { BackTopProps } from './BackTop';
|
||||
export type { BackTopThemeVars } from './types';
|
||||
declare module 'vue' {
|
||||
interface GlobalComponents {
|
||||
VanBackTop: typeof BackTop;
|
||||
}
|
||||
}
|
||||
39
node_modules/vant/lib/back-top/index.js
generated
vendored
Normal file
39
node_modules/vant/lib/back-top/index.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var stdin_exports = {};
|
||||
__export(stdin_exports, {
|
||||
BackTop: () => BackTop,
|
||||
backTopProps: () => import_BackTop2.backTopProps,
|
||||
default: () => stdin_default
|
||||
});
|
||||
module.exports = __toCommonJS(stdin_exports);
|
||||
var import_utils = require("../utils");
|
||||
var import_BackTop = __toESM(require("./BackTop"));
|
||||
var import_BackTop2 = require("./BackTop");
|
||||
const BackTop = (0, import_utils.withInstall)(import_BackTop.default);
|
||||
var stdin_default = BackTop;
|
||||
1
node_modules/vant/lib/back-top/style/index.d.ts
generated
vendored
Normal file
1
node_modules/vant/lib/back-top/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
4
node_modules/vant/lib/back-top/style/index.js
generated
vendored
Normal file
4
node_modules/vant/lib/back-top/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
require("../../style/base.css");
|
||||
require("../../badge/index.css");
|
||||
require("../../icon/index.css");
|
||||
require("../index.css");
|
||||
9
node_modules/vant/lib/back-top/types.d.ts
generated
vendored
Normal file
9
node_modules/vant/lib/back-top/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
export type BackTopThemeVars = {
|
||||
backTopSize?: string;
|
||||
backTopRight?: string;
|
||||
backTopBottom?: string;
|
||||
backTopZIndex?: number | string;
|
||||
backTopIconSize?: string;
|
||||
backTopTextColor?: string;
|
||||
backTopBackground?: string;
|
||||
};
|
||||
15
node_modules/vant/lib/back-top/types.js
generated
vendored
Normal file
15
node_modules/vant/lib/back-top/types.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var stdin_exports = {};
|
||||
module.exports = __toCommonJS(stdin_exports);
|
||||
Reference in New Issue
Block a user