first commit
This commit is contained in:
81
node_modules/vant/lib/floating-panel/FloatingPanel.d.ts
generated
vendored
Normal file
81
node_modules/vant/lib/floating-panel/FloatingPanel.d.ts
generated
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
import { type ExtractPropTypes } from 'vue';
|
||||
export declare const floatingPanelProps: {
|
||||
height: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
anchors: {
|
||||
type: import("vue").PropType<number[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
duration: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
contentDraggable: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
lockScroll: BooleanConstructor;
|
||||
safeAreaInsetBottom: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
};
|
||||
export type FloatingPanelProps = ExtractPropTypes<typeof floatingPanelProps>;
|
||||
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
||||
height: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
anchors: {
|
||||
type: import("vue").PropType<number[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
duration: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
contentDraggable: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
lockScroll: BooleanConstructor;
|
||||
safeAreaInsetBottom: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("heightChange" | "update:height")[], "heightChange" | "update:height", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
||||
height: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
anchors: {
|
||||
type: import("vue").PropType<number[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
duration: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
contentDraggable: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
lockScroll: BooleanConstructor;
|
||||
safeAreaInsetBottom: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
}>> & Readonly<{
|
||||
onHeightChange?: ((...args: any[]) => any) | undefined;
|
||||
"onUpdate:height"?: ((...args: any[]) => any) | undefined;
|
||||
}>, {
|
||||
height: string | number;
|
||||
safeAreaInsetBottom: boolean;
|
||||
duration: string | number;
|
||||
lockScroll: boolean;
|
||||
anchors: number[];
|
||||
contentDraggable: boolean;
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
||||
export default _default;
|
||||
153
node_modules/vant/lib/floating-panel/FloatingPanel.js
generated
vendored
Normal file
153
node_modules/vant/lib/floating-panel/FloatingPanel.js
generated
vendored
Normal file
@@ -0,0 +1,153 @@
|
||||
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, {
|
||||
default: () => stdin_default,
|
||||
floatingPanelProps: () => floatingPanelProps
|
||||
});
|
||||
module.exports = __toCommonJS(stdin_exports);
|
||||
var import_vue = require("vue");
|
||||
var import_utils = require("../utils");
|
||||
var import_use = require("@vant/use");
|
||||
var import_use_lock_scroll = require("../composables/use-lock-scroll");
|
||||
var import_use_touch = require("../composables/use-touch");
|
||||
var import_use_sync_prop_ref = require("../composables/use-sync-prop-ref");
|
||||
const floatingPanelProps = {
|
||||
height: (0, import_utils.makeNumericProp)(0),
|
||||
anchors: (0, import_utils.makeArrayProp)(),
|
||||
duration: (0, import_utils.makeNumericProp)(0.3),
|
||||
contentDraggable: import_utils.truthProp,
|
||||
lockScroll: Boolean,
|
||||
safeAreaInsetBottom: import_utils.truthProp
|
||||
};
|
||||
const [name, bem] = (0, import_utils.createNamespace)("floating-panel");
|
||||
var stdin_default = (0, import_vue.defineComponent)({
|
||||
name,
|
||||
props: floatingPanelProps,
|
||||
emits: ["heightChange", "update:height"],
|
||||
setup(props, {
|
||||
emit,
|
||||
slots
|
||||
}) {
|
||||
const DAMP = 0.2;
|
||||
const rootRef = (0, import_vue.ref)();
|
||||
const contentRef = (0, import_vue.ref)();
|
||||
const height = (0, import_use_sync_prop_ref.useSyncPropRef)(() => +props.height, (value) => emit("update:height", value));
|
||||
const boundary = (0, import_vue.computed)(() => {
|
||||
var _a, _b;
|
||||
return {
|
||||
min: (_a = props.anchors[0]) != null ? _a : 100,
|
||||
max: (_b = props.anchors[props.anchors.length - 1]) != null ? _b : Math.round(import_utils.windowHeight.value * 0.6)
|
||||
};
|
||||
});
|
||||
const anchors = (0, import_vue.computed)(() => props.anchors.length >= 2 ? props.anchors : [boundary.value.min, boundary.value.max]);
|
||||
const dragging = (0, import_vue.ref)(false);
|
||||
const rootStyle = (0, import_vue.computed)(() => ({
|
||||
height: (0, import_utils.addUnit)(boundary.value.max),
|
||||
transform: `translateY(calc(100% + ${(0, import_utils.addUnit)(-height.value)}))`,
|
||||
transition: !dragging.value ? `transform ${props.duration}s cubic-bezier(0.18, 0.89, 0.32, 1.28)` : "none"
|
||||
}));
|
||||
const ease = (moveY) => {
|
||||
const absDistance = Math.abs(moveY);
|
||||
const {
|
||||
min,
|
||||
max
|
||||
} = boundary.value;
|
||||
if (absDistance > max) {
|
||||
return -(max + (absDistance - max) * DAMP);
|
||||
}
|
||||
if (absDistance < min) {
|
||||
return -(min - (min - absDistance) * DAMP);
|
||||
}
|
||||
return moveY;
|
||||
};
|
||||
let startY;
|
||||
let maxScroll = -1;
|
||||
const touch = (0, import_use_touch.useTouch)();
|
||||
const onTouchstart = (e) => {
|
||||
touch.start(e);
|
||||
dragging.value = true;
|
||||
startY = -height.value;
|
||||
maxScroll = -1;
|
||||
};
|
||||
const onTouchmove = (e) => {
|
||||
var _a;
|
||||
touch.move(e);
|
||||
const target = e.target;
|
||||
if (contentRef.value === target || ((_a = contentRef.value) == null ? void 0 : _a.contains(target))) {
|
||||
const {
|
||||
scrollTop
|
||||
} = contentRef.value;
|
||||
maxScroll = Math.max(maxScroll, scrollTop);
|
||||
if (!props.contentDraggable) return;
|
||||
if (-startY < boundary.value.max) {
|
||||
(0, import_utils.preventDefault)(e, true);
|
||||
} else if (!(scrollTop <= 0 && touch.deltaY.value > 0) || maxScroll > 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
const moveY = touch.deltaY.value + startY;
|
||||
height.value = -ease(moveY);
|
||||
};
|
||||
const onTouchend = () => {
|
||||
maxScroll = -1;
|
||||
dragging.value = false;
|
||||
height.value = (0, import_utils.closest)(anchors.value, height.value);
|
||||
if (height.value !== -startY) {
|
||||
emit("heightChange", {
|
||||
height: height.value
|
||||
});
|
||||
}
|
||||
};
|
||||
(0, import_vue.watch)(boundary, () => {
|
||||
height.value = (0, import_utils.closest)(anchors.value, height.value);
|
||||
}, {
|
||||
immediate: true
|
||||
});
|
||||
(0, import_use_lock_scroll.useLockScroll)(rootRef, () => props.lockScroll || dragging.value);
|
||||
(0, import_use.useEventListener)("touchmove", onTouchmove, {
|
||||
target: rootRef
|
||||
});
|
||||
const renderHeader = () => {
|
||||
if (slots.header) {
|
||||
return slots.header();
|
||||
}
|
||||
return (0, import_vue.createVNode)("div", {
|
||||
"class": bem("header")
|
||||
}, [(0, import_vue.createVNode)("div", {
|
||||
"class": bem("header-bar")
|
||||
}, null)]);
|
||||
};
|
||||
return () => {
|
||||
var _a;
|
||||
return (0, import_vue.createVNode)("div", {
|
||||
"class": [bem(), {
|
||||
"van-safe-area-bottom": props.safeAreaInsetBottom
|
||||
}],
|
||||
"ref": rootRef,
|
||||
"style": rootStyle.value,
|
||||
"onTouchstartPassive": onTouchstart,
|
||||
"onTouchend": onTouchend,
|
||||
"onTouchcancel": onTouchend
|
||||
}, [renderHeader(), (0, import_vue.createVNode)("div", {
|
||||
"class": bem("content"),
|
||||
"ref": contentRef
|
||||
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)])]);
|
||||
};
|
||||
}
|
||||
});
|
||||
1
node_modules/vant/lib/floating-panel/index.css
generated
vendored
Normal file
1
node_modules/vant/lib/floating-panel/index.css
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
:root,:host{--van-floating-panel-border-radius: 16px;--van-floating-panel-header-height: 30px;--van-floating-panel-z-index: 999;--van-floating-panel-background: var(--van-background-2);--van-floating-panel-bar-width: 20px;--van-floating-panel-bar-height: 3px;--van-floating-panel-bar-color: var(--van-gray-5)}.van-floating-panel{position:fixed;left:0;bottom:0;width:100vw;z-index:var(--van-floating-panel-z-index);display:flex;flex-direction:column;touch-action:none;border-top-left-radius:var(--van-floating-panel-border-radius);border-top-right-radius:var(--van-floating-panel-border-radius);background:var(--van-floating-panel-background);will-change:transform}.van-floating-panel:after{content:"";display:block;position:absolute;bottom:-100vh;height:100vh;width:100vw;background-color:inherit}.van-floating-panel__header{height:var(--van-floating-panel-header-height);display:flex;justify-content:center;align-items:center;cursor:-webkit-grab;cursor:grab;-webkit-user-select:none;user-select:none}.van-floating-panel__header-bar{height:var(--van-floating-panel-bar-height);width:var(--van-floating-panel-bar-width);border-radius:var(--van-radius-md);background:var(--van-floating-panel-bar-color)}.van-floating-panel__content{flex:1;overflow-y:auto;background-color:var(--van-floating-panel-background)}
|
||||
64
node_modules/vant/lib/floating-panel/index.d.ts
generated
vendored
Normal file
64
node_modules/vant/lib/floating-panel/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
export declare const FloatingPanel: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
||||
height: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
anchors: {
|
||||
type: import("vue").PropType<number[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
duration: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
contentDraggable: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
lockScroll: BooleanConstructor;
|
||||
safeAreaInsetBottom: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("heightChange" | "update:height")[], "heightChange" | "update:height", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
||||
height: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
anchors: {
|
||||
type: import("vue").PropType<number[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
duration: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
contentDraggable: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
lockScroll: BooleanConstructor;
|
||||
safeAreaInsetBottom: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
}>> & Readonly<{
|
||||
onHeightChange?: ((...args: any[]) => any) | undefined;
|
||||
"onUpdate:height"?: ((...args: any[]) => any) | undefined;
|
||||
}>, {
|
||||
height: string | number;
|
||||
safeAreaInsetBottom: boolean;
|
||||
duration: string | number;
|
||||
lockScroll: boolean;
|
||||
anchors: number[];
|
||||
contentDraggable: boolean;
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
||||
export default FloatingPanel;
|
||||
export { floatingPanelProps } from './FloatingPanel';
|
||||
export type { FloatingPanelProps } from './FloatingPanel';
|
||||
export type { FloatingPanelThemeVars } from './types';
|
||||
declare module 'vue' {
|
||||
interface GlobalComponents {
|
||||
VanFloatingPanel: typeof FloatingPanel;
|
||||
}
|
||||
}
|
||||
39
node_modules/vant/lib/floating-panel/index.js
generated
vendored
Normal file
39
node_modules/vant/lib/floating-panel/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, {
|
||||
FloatingPanel: () => FloatingPanel,
|
||||
default: () => stdin_default,
|
||||
floatingPanelProps: () => import_FloatingPanel2.floatingPanelProps
|
||||
});
|
||||
module.exports = __toCommonJS(stdin_exports);
|
||||
var import_utils = require("../utils");
|
||||
var import_FloatingPanel = __toESM(require("./FloatingPanel"));
|
||||
var import_FloatingPanel2 = require("./FloatingPanel");
|
||||
const FloatingPanel = (0, import_utils.withInstall)(import_FloatingPanel.default);
|
||||
var stdin_default = FloatingPanel;
|
||||
1
node_modules/vant/lib/floating-panel/style/index.d.ts
generated
vendored
Normal file
1
node_modules/vant/lib/floating-panel/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
2
node_modules/vant/lib/floating-panel/style/index.js
generated
vendored
Normal file
2
node_modules/vant/lib/floating-panel/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
require("../../style/base.css");
|
||||
require("../index.css");
|
||||
9
node_modules/vant/lib/floating-panel/types.d.ts
generated
vendored
Normal file
9
node_modules/vant/lib/floating-panel/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
export type FloatingPanelThemeVars = {
|
||||
floatingPanelBorderRadius?: string;
|
||||
floatingPanelHeaderHeight?: string;
|
||||
floatingPanelZIndex?: number | string;
|
||||
floatingPanelBackground?: string;
|
||||
floatingPanelBarWidth?: string;
|
||||
floatingPanelBarHeight?: string;
|
||||
floatingPanelBarColor?: string;
|
||||
};
|
||||
15
node_modules/vant/lib/floating-panel/types.js
generated
vendored
Normal file
15
node_modules/vant/lib/floating-panel/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