first commit

This commit is contained in:
2025-12-29 14:59:44 +08:00
commit 10c3fbb0d7
5315 changed files with 795443 additions and 0 deletions

75
node_modules/vant/es/pull-refresh/PullRefresh.d.ts generated vendored Normal file
View File

@@ -0,0 +1,75 @@
import { type ExtractPropTypes } from 'vue';
export declare const pullRefreshProps: {
disabled: BooleanConstructor;
modelValue: BooleanConstructor;
headHeight: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
successText: StringConstructor;
pullingText: StringConstructor;
loosingText: StringConstructor;
loadingText: StringConstructor;
pullDistance: (NumberConstructor | StringConstructor)[];
successDuration: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
animationDuration: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
};
export type PullRefreshProps = ExtractPropTypes<typeof pullRefreshProps>;
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
disabled: BooleanConstructor;
modelValue: BooleanConstructor;
headHeight: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
successText: StringConstructor;
pullingText: StringConstructor;
loosingText: StringConstructor;
loadingText: StringConstructor;
pullDistance: (NumberConstructor | StringConstructor)[];
successDuration: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
animationDuration: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "refresh")[], "update:modelValue" | "change" | "refresh", import("vue").PublicProps, Readonly<ExtractPropTypes<{
disabled: BooleanConstructor;
modelValue: BooleanConstructor;
headHeight: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
successText: StringConstructor;
pullingText: StringConstructor;
loosingText: StringConstructor;
loadingText: StringConstructor;
pullDistance: (NumberConstructor | StringConstructor)[];
successDuration: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
animationDuration: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
}>> & Readonly<{
onChange?: ((...args: any[]) => any) | undefined;
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
onRefresh?: ((...args: any[]) => any) | undefined;
}>, {
disabled: boolean;
modelValue: boolean;
animationDuration: string | number;
headHeight: string | number;
successDuration: string | number;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
export default _default;

193
node_modules/vant/es/pull-refresh/PullRefresh.mjs generated vendored Normal file
View File

@@ -0,0 +1,193 @@
import { ref, watch, reactive, nextTick, defineComponent, createVNode as _createVNode } from "vue";
import { numericProp, getScrollTop, preventDefault, createNamespace, makeNumericProp } from "../utils/index.mjs";
import { useEventListener, useScrollParent } from "@vant/use";
import { useTouch } from "../composables/use-touch.mjs";
import { Loading } from "../loading/index.mjs";
const [name, bem, t] = createNamespace("pull-refresh");
const DEFAULT_HEAD_HEIGHT = 50;
const TEXT_STATUS = ["pulling", "loosing", "success"];
const pullRefreshProps = {
disabled: Boolean,
modelValue: Boolean,
headHeight: makeNumericProp(DEFAULT_HEAD_HEIGHT),
successText: String,
pullingText: String,
loosingText: String,
loadingText: String,
pullDistance: numericProp,
successDuration: makeNumericProp(500),
animationDuration: makeNumericProp(300)
};
var stdin_default = defineComponent({
name,
props: pullRefreshProps,
emits: ["change", "refresh", "update:modelValue"],
setup(props, {
emit,
slots
}) {
let reachTop;
const root = ref();
const track = ref();
const scrollParent = useScrollParent(root);
const state = reactive({
status: "normal",
distance: 0,
duration: 0
});
const touch = useTouch();
const getHeadStyle = () => {
if (props.headHeight !== DEFAULT_HEAD_HEIGHT) {
return {
height: `${props.headHeight}px`
};
}
};
const isTouchable = () => state.status !== "loading" && state.status !== "success" && !props.disabled;
const ease = (distance) => {
const pullDistance = +(props.pullDistance || props.headHeight);
if (distance > pullDistance) {
if (distance < pullDistance * 2) {
distance = pullDistance + (distance - pullDistance) / 2;
} else {
distance = pullDistance * 1.5 + (distance - pullDistance * 2) / 4;
}
}
return Math.round(distance);
};
const setStatus = (distance, isLoading) => {
const pullDistance = +(props.pullDistance || props.headHeight);
state.distance = distance;
if (isLoading) {
state.status = "loading";
} else if (distance === 0) {
state.status = "normal";
} else if (distance < pullDistance) {
state.status = "pulling";
} else {
state.status = "loosing";
}
emit("change", {
status: state.status,
distance
});
};
const getStatusText = () => {
const {
status
} = state;
if (status === "normal") {
return "";
}
return props[`${status}Text`] || t(status);
};
const renderStatus = () => {
const {
status,
distance
} = state;
if (slots[status]) {
return slots[status]({
distance
});
}
const nodes = [];
if (TEXT_STATUS.includes(status)) {
nodes.push(_createVNode("div", {
"class": bem("text")
}, [getStatusText()]));
}
if (status === "loading") {
nodes.push(_createVNode(Loading, {
"class": bem("loading")
}, {
default: getStatusText
}));
}
return nodes;
};
const showSuccessTip = () => {
state.status = "success";
setTimeout(() => {
setStatus(0);
}, +props.successDuration);
};
const checkPosition = (event) => {
reachTop = getScrollTop(scrollParent.value) === 0;
if (reachTop) {
state.duration = 0;
touch.start(event);
}
};
const onTouchStart = (event) => {
if (isTouchable()) {
checkPosition(event);
}
};
const onTouchMove = (event) => {
if (isTouchable()) {
if (!reachTop) {
checkPosition(event);
}
const {
deltaY
} = touch;
touch.move(event);
if (reachTop && deltaY.value >= 0 && touch.isVertical()) {
preventDefault(event);
setStatus(ease(deltaY.value));
}
}
};
const onTouchEnd = () => {
if (reachTop && touch.deltaY.value && isTouchable()) {
state.duration = +props.animationDuration;
if (state.status === "loosing") {
setStatus(+props.headHeight, true);
emit("update:modelValue", true);
nextTick(() => emit("refresh"));
} else {
setStatus(0);
}
}
};
watch(() => props.modelValue, (value) => {
state.duration = +props.animationDuration;
if (value) {
setStatus(+props.headHeight, true);
} else if (slots.success || props.successText) {
showSuccessTip();
} else {
setStatus(0, false);
}
});
useEventListener("touchmove", onTouchMove, {
target: track
});
return () => {
var _a;
const trackStyle = {
transitionDuration: `${state.duration}ms`,
transform: state.distance ? `translate3d(0,${state.distance}px, 0)` : ""
};
return _createVNode("div", {
"ref": root,
"class": bem()
}, [_createVNode("div", {
"ref": track,
"class": bem("track"),
"style": trackStyle,
"onTouchstartPassive": onTouchStart,
"onTouchend": onTouchEnd,
"onTouchcancel": onTouchEnd
}, [_createVNode("div", {
"class": bem("head"),
"style": getHeadStyle()
}, [renderStatus()]), (_a = slots.default) == null ? void 0 : _a.call(slots)])]);
};
}
});
export {
stdin_default as default,
pullRefreshProps
};

1
node_modules/vant/es/pull-refresh/index.css generated vendored Normal file
View File

@@ -0,0 +1 @@
:root,:host{--van-pull-refresh-head-height: 50px;--van-pull-refresh-head-font-size: var(--van-font-size-md);--van-pull-refresh-head-text-color: var(--van-text-color-2);--van-pull-refresh-loading-icon-size: 16px}.van-pull-refresh{overflow:hidden}.van-pull-refresh__track{position:relative;height:100%;transition-property:transform}.van-pull-refresh__head{position:absolute;left:0;width:100%;height:var(--van-pull-refresh-head-height);overflow:hidden;color:var(--van-pull-refresh-head-text-color);font-size:var(--van-pull-refresh-head-font-size);line-height:var(--van-pull-refresh-head-height);text-align:center;transform:translateY(-100%)}.van-pull-refresh__loading .van-loading__spinner{width:var(--van-pull-refresh-loading-icon-size);height:var(--van-pull-refresh-loading-icon-size)}

60
node_modules/vant/es/pull-refresh/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,60 @@
export declare const PullRefresh: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
disabled: BooleanConstructor;
modelValue: BooleanConstructor;
headHeight: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
successText: StringConstructor;
pullingText: StringConstructor;
loosingText: StringConstructor;
loadingText: StringConstructor;
pullDistance: (NumberConstructor | StringConstructor)[];
successDuration: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
animationDuration: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "refresh")[], "update:modelValue" | "change" | "refresh", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
disabled: BooleanConstructor;
modelValue: BooleanConstructor;
headHeight: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
successText: StringConstructor;
pullingText: StringConstructor;
loosingText: StringConstructor;
loadingText: StringConstructor;
pullDistance: (NumberConstructor | StringConstructor)[];
successDuration: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
animationDuration: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
}>> & Readonly<{
onChange?: ((...args: any[]) => any) | undefined;
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
onRefresh?: ((...args: any[]) => any) | undefined;
}>, {
disabled: boolean;
modelValue: boolean;
animationDuration: string | number;
headHeight: string | number;
successDuration: string | number;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
export default PullRefresh;
export { pullRefreshProps } from './PullRefresh';
export type { PullRefreshProps } from './PullRefresh';
export type { PullRefreshThemeVars } from './types';
declare module 'vue' {
interface GlobalComponents {
VanPullRefresh: typeof PullRefresh;
}
}

10
node_modules/vant/es/pull-refresh/index.mjs generated vendored Normal file
View File

@@ -0,0 +1,10 @@
import { withInstall } from "../utils/index.mjs";
import _PullRefresh from "./PullRefresh.mjs";
const PullRefresh = withInstall(_PullRefresh);
var stdin_default = PullRefresh;
import { pullRefreshProps } from "./PullRefresh.mjs";
export {
PullRefresh,
stdin_default as default,
pullRefreshProps
};

1
node_modules/vant/es/pull-refresh/style/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export {};

3
node_modules/vant/es/pull-refresh/style/index.mjs generated vendored Normal file
View File

@@ -0,0 +1,3 @@
import "../../style/base.css";
import "../../loading/index.css";
import "../index.css";

6
node_modules/vant/es/pull-refresh/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
export type PullRefreshThemeVars = {
pullRefreshHeadHeight?: string;
pullRefreshHeadFontSize?: string;
pullRefreshHeadTextColor?: string;
pullRefreshLoadingIconSize?: string;
};

0
node_modules/vant/es/pull-refresh/types.mjs generated vendored Normal file
View File