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

71
node_modules/vant/lib/notice-bar/NoticeBar.d.ts generated vendored Normal file
View File

@@ -0,0 +1,71 @@
import { type PropType, type ExtractPropTypes } from 'vue';
import { NoticeBarMode } from './types';
export declare const noticeBarProps: {
text: StringConstructor;
mode: PropType<NoticeBarMode>;
color: StringConstructor;
delay: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
speed: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
leftIcon: StringConstructor;
wrapable: BooleanConstructor;
background: StringConstructor;
scrollable: {
type: PropType<boolean | null>;
default: null;
};
};
export type NoticeBarProps = ExtractPropTypes<typeof noticeBarProps>;
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
text: StringConstructor;
mode: PropType<NoticeBarMode>;
color: StringConstructor;
delay: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
speed: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
leftIcon: StringConstructor;
wrapable: BooleanConstructor;
background: StringConstructor;
scrollable: {
type: PropType<boolean | null>;
default: null;
};
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "replay")[], "close" | "replay", import("vue").PublicProps, Readonly<ExtractPropTypes<{
text: StringConstructor;
mode: PropType<NoticeBarMode>;
color: StringConstructor;
delay: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
speed: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
leftIcon: StringConstructor;
wrapable: BooleanConstructor;
background: StringConstructor;
scrollable: {
type: PropType<boolean | null>;
default: null;
};
}>> & Readonly<{
onClose?: ((...args: any[]) => any) | undefined;
onReplay?: ((...args: any[]) => any) | undefined;
}>, {
scrollable: boolean | null;
delay: string | number;
speed: string | number;
wrapable: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
export default _default;

184
node_modules/vant/lib/notice-bar/NoticeBar.js generated vendored Normal file
View File

@@ -0,0 +1,184 @@
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,
noticeBarProps: () => noticeBarProps
});
module.exports = __toCommonJS(stdin_exports);
var import_vue = require("vue");
var import_utils = require("../utils");
var import_use = require("@vant/use");
var import_use_expose = require("../composables/use-expose");
var import_on_popup_reopen = require("../composables/on-popup-reopen");
var import_icon = require("../icon");
const [name, bem] = (0, import_utils.createNamespace)("notice-bar");
const noticeBarProps = {
text: String,
mode: String,
color: String,
delay: (0, import_utils.makeNumericProp)(1),
speed: (0, import_utils.makeNumericProp)(60),
leftIcon: String,
wrapable: Boolean,
background: String,
scrollable: {
type: Boolean,
default: null
}
};
var stdin_default = (0, import_vue.defineComponent)({
name,
props: noticeBarProps,
emits: ["close", "replay"],
setup(props, {
emit,
slots
}) {
let wrapWidth = 0;
let contentWidth = 0;
let startTimer;
const wrapRef = (0, import_vue.ref)();
const contentRef = (0, import_vue.ref)();
const state = (0, import_vue.reactive)({
show: true,
offset: 0,
duration: 0
});
const renderLeftIcon = () => {
if (slots["left-icon"]) {
return slots["left-icon"]();
}
if (props.leftIcon) {
return (0, import_vue.createVNode)(import_icon.Icon, {
"class": bem("left-icon"),
"name": props.leftIcon
}, null);
}
};
const getRightIconName = () => {
if (props.mode === "closeable") {
return "cross";
}
if (props.mode === "link") {
return "arrow";
}
};
const onClickRightIcon = (event) => {
if (props.mode === "closeable") {
state.show = false;
emit("close", event);
}
};
const renderRightIcon = () => {
if (slots["right-icon"]) {
return slots["right-icon"]();
}
const name2 = getRightIconName();
if (name2) {
return (0, import_vue.createVNode)(import_icon.Icon, {
"name": name2,
"class": bem("right-icon"),
"onClick": onClickRightIcon
}, null);
}
};
const onTransitionEnd = () => {
state.offset = wrapWidth;
state.duration = 0;
(0, import_use.raf)(() => {
(0, import_use.doubleRaf)(() => {
state.offset = -contentWidth;
state.duration = (contentWidth + wrapWidth) / +props.speed;
emit("replay");
});
});
};
const renderMarquee = () => {
const ellipsis = props.scrollable === false && !props.wrapable;
const style = {
transform: state.offset ? `translateX(${state.offset}px)` : "",
transitionDuration: `${state.duration}s`
};
return (0, import_vue.createVNode)("div", {
"ref": wrapRef,
"role": "marquee",
"class": bem("wrap")
}, [(0, import_vue.createVNode)("div", {
"ref": contentRef,
"style": style,
"class": [bem("content"), {
"van-ellipsis": ellipsis
}],
"onTransitionend": onTransitionEnd
}, [slots.default ? slots.default() : props.text])]);
};
const reset = () => {
const {
delay,
speed,
scrollable
} = props;
const ms = (0, import_utils.isDef)(delay) ? +delay * 1e3 : 0;
wrapWidth = 0;
contentWidth = 0;
state.offset = 0;
state.duration = 0;
clearTimeout(startTimer);
startTimer = setTimeout(() => {
if (!wrapRef.value || !contentRef.value || scrollable === false) {
return;
}
const wrapRefWidth = (0, import_use.useRect)(wrapRef).width;
const contentRefWidth = (0, import_use.useRect)(contentRef).width;
if (scrollable || contentRefWidth > wrapRefWidth) {
(0, import_use.doubleRaf)(() => {
wrapWidth = wrapRefWidth;
contentWidth = contentRefWidth;
state.offset = -contentWidth;
state.duration = contentWidth / +speed;
});
}
}, ms);
};
(0, import_on_popup_reopen.onPopupReopen)(reset);
(0, import_use.onMountedOrActivated)(reset);
(0, import_use.useEventListener)("pageshow", reset);
(0, import_use_expose.useExpose)({
reset
});
(0, import_vue.watch)(() => [props.text, props.scrollable], reset);
return () => {
const {
color,
wrapable,
background
} = props;
return (0, import_vue.withDirectives)((0, import_vue.createVNode)("div", {
"role": "alert",
"class": bem({
wrapable
}),
"style": {
color,
background
}
}, [renderLeftIcon(), renderMarquee(), renderRightIcon()]), [[import_vue.vShow, state.show]]);
};
}
});

1
node_modules/vant/lib/notice-bar/index.css generated vendored Normal file
View File

@@ -0,0 +1 @@
:root,:host{--van-notice-bar-height: 40px;--van-notice-bar-padding: 0 var(--van-padding-md);--van-notice-bar-wrapable-padding: var(--van-padding-xs) var(--van-padding-md);--van-notice-bar-text-color: var(--van-orange-dark);--van-notice-bar-font-size: var(--van-font-size-md);--van-notice-bar-line-height: 24px;--van-notice-bar-background: var(--van-orange-light);--van-notice-bar-icon-size: 16px;--van-notice-bar-icon-min-width: 24px}.van-notice-bar{position:relative;display:flex;align-items:center;height:var(--van-notice-bar-height);padding:var(--van-notice-bar-padding);color:var(--van-notice-bar-text-color);font-size:var(--van-notice-bar-font-size);line-height:var(--van-notice-bar-line-height);background:var(--van-notice-bar-background)}.van-notice-bar__left-icon,.van-notice-bar__right-icon{min-width:var(--van-notice-bar-icon-min-width);font-size:var(--van-notice-bar-icon-size)}.van-notice-bar__right-icon{text-align:right;cursor:pointer}.van-notice-bar__wrap{position:relative;display:flex;flex:1;align-items:center;height:100%;overflow:hidden}.van-notice-bar__content{position:absolute;white-space:nowrap;transition-timing-function:linear}.van-notice-bar__content.van-ellipsis{max-width:100%}.van-notice-bar--wrapable{height:auto;padding:var(--van-notice-bar-wrapable-padding)}.van-notice-bar--wrapable .van-notice-bar__wrap{height:auto}.van-notice-bar--wrapable .van-notice-bar__content{position:relative;white-space:normal;word-wrap:break-word}

57
node_modules/vant/lib/notice-bar/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,57 @@
import { NoticeBarProps } from './NoticeBar';
export declare const NoticeBar: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
text: StringConstructor;
mode: import("vue").PropType<import("./types").NoticeBarMode>;
color: StringConstructor;
delay: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
speed: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
leftIcon: StringConstructor;
wrapable: BooleanConstructor;
background: StringConstructor;
scrollable: {
type: import("vue").PropType<boolean | null>;
default: null;
};
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "replay")[], "close" | "replay", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
text: StringConstructor;
mode: import("vue").PropType<import("./types").NoticeBarMode>;
color: StringConstructor;
delay: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
speed: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
leftIcon: StringConstructor;
wrapable: BooleanConstructor;
background: StringConstructor;
scrollable: {
type: import("vue").PropType<boolean | null>;
default: null;
};
}>> & Readonly<{
onClose?: ((...args: any[]) => any) | undefined;
onReplay?: ((...args: any[]) => any) | undefined;
}>, {
scrollable: boolean | null;
delay: string | number;
speed: string | number;
wrapable: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
export default NoticeBar;
export { noticeBarProps } from './NoticeBar';
export type { NoticeBarProps };
export type { NoticeBarMode, NoticeBarInstance, NoticeBarThemeVars, } from './types';
declare module 'vue' {
interface GlobalComponents {
VanNoticeBar: typeof NoticeBar;
}
}

39
node_modules/vant/lib/notice-bar/index.js generated vendored Normal file
View 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, {
NoticeBar: () => NoticeBar,
default: () => stdin_default,
noticeBarProps: () => import_NoticeBar2.noticeBarProps
});
module.exports = __toCommonJS(stdin_exports);
var import_utils = require("../utils");
var import_NoticeBar = __toESM(require("./NoticeBar"));
var import_NoticeBar2 = require("./NoticeBar");
const NoticeBar = (0, import_utils.withInstall)(import_NoticeBar.default);
var stdin_default = NoticeBar;

1
node_modules/vant/lib/notice-bar/style/index.d.ts generated vendored Normal file
View File

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

4
node_modules/vant/lib/notice-bar/style/index.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
require("../../style/base.css");
require("../../badge/index.css");
require("../../icon/index.css");
require("../index.css");

18
node_modules/vant/lib/notice-bar/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,18 @@
import type { ComponentPublicInstance } from 'vue';
import type { NoticeBarProps } from './NoticeBar';
export type NoticeBarMode = 'closeable' | 'link';
export type NoticeBarExpose = {
reset: () => void;
};
export type NoticeBarInstance = ComponentPublicInstance<NoticeBarProps, NoticeBarExpose>;
export type NoticeBarThemeVars = {
noticeBarHeight?: string;
noticeBarPadding?: string;
noticeBarWrapablePadding?: string;
noticeBarTextColor?: string;
noticeBarFontSize?: string;
noticeBarLineHeight?: number | string;
noticeBarBackground?: string;
noticeBarIconSize?: string;
noticeBarIconMinWidth?: string;
};

15
node_modules/vant/lib/notice-bar/types.js generated vendored Normal file
View 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);