first commit
This commit is contained in:
118
node_modules/vant/es/toast/Toast.d.ts
generated
vendored
Normal file
118
node_modules/vant/es/toast/Toast.d.ts
generated
vendored
Normal file
@@ -0,0 +1,118 @@
|
||||
import { type PropType, type TeleportProps, type CSSProperties, type ExtractPropTypes } from 'vue';
|
||||
import { LoadingType } from '../loading';
|
||||
import type { ToastType, ToastPosition, ToastWordBreak } from './types';
|
||||
export declare const toastProps: {
|
||||
icon: StringConstructor;
|
||||
show: BooleanConstructor;
|
||||
type: {
|
||||
type: PropType<ToastType>;
|
||||
default: ToastType;
|
||||
};
|
||||
overlay: BooleanConstructor;
|
||||
message: (NumberConstructor | StringConstructor)[];
|
||||
iconSize: (NumberConstructor | StringConstructor)[];
|
||||
duration: {
|
||||
type: NumberConstructor;
|
||||
default: number;
|
||||
};
|
||||
position: {
|
||||
type: PropType<ToastPosition>;
|
||||
default: ToastPosition;
|
||||
};
|
||||
teleport: PropType<TeleportProps["to"]>;
|
||||
wordBreak: PropType<ToastWordBreak>;
|
||||
className: PropType<unknown>;
|
||||
iconPrefix: StringConstructor;
|
||||
transition: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
loadingType: PropType<LoadingType>;
|
||||
forbidClick: BooleanConstructor;
|
||||
overlayClass: PropType<unknown>;
|
||||
overlayStyle: PropType<CSSProperties>;
|
||||
closeOnClick: BooleanConstructor;
|
||||
closeOnClickOverlay: BooleanConstructor;
|
||||
zIndex: (NumberConstructor | StringConstructor)[];
|
||||
};
|
||||
export type ToastProps = ExtractPropTypes<typeof toastProps>;
|
||||
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
||||
icon: StringConstructor;
|
||||
show: BooleanConstructor;
|
||||
type: {
|
||||
type: PropType<ToastType>;
|
||||
default: ToastType;
|
||||
};
|
||||
overlay: BooleanConstructor;
|
||||
message: (NumberConstructor | StringConstructor)[];
|
||||
iconSize: (NumberConstructor | StringConstructor)[];
|
||||
duration: {
|
||||
type: NumberConstructor;
|
||||
default: number;
|
||||
};
|
||||
position: {
|
||||
type: PropType<ToastPosition>;
|
||||
default: ToastPosition;
|
||||
};
|
||||
teleport: PropType<TeleportProps["to"]>;
|
||||
wordBreak: PropType<ToastWordBreak>;
|
||||
className: PropType<unknown>;
|
||||
iconPrefix: StringConstructor;
|
||||
transition: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
loadingType: PropType<LoadingType>;
|
||||
forbidClick: BooleanConstructor;
|
||||
overlayClass: PropType<unknown>;
|
||||
overlayStyle: PropType<CSSProperties>;
|
||||
closeOnClick: BooleanConstructor;
|
||||
closeOnClickOverlay: BooleanConstructor;
|
||||
zIndex: (NumberConstructor | StringConstructor)[];
|
||||
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
||||
icon: StringConstructor;
|
||||
show: BooleanConstructor;
|
||||
type: {
|
||||
type: PropType<ToastType>;
|
||||
default: ToastType;
|
||||
};
|
||||
overlay: BooleanConstructor;
|
||||
message: (NumberConstructor | StringConstructor)[];
|
||||
iconSize: (NumberConstructor | StringConstructor)[];
|
||||
duration: {
|
||||
type: NumberConstructor;
|
||||
default: number;
|
||||
};
|
||||
position: {
|
||||
type: PropType<ToastPosition>;
|
||||
default: ToastPosition;
|
||||
};
|
||||
teleport: PropType<TeleportProps["to"]>;
|
||||
wordBreak: PropType<ToastWordBreak>;
|
||||
className: PropType<unknown>;
|
||||
iconPrefix: StringConstructor;
|
||||
transition: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
loadingType: PropType<LoadingType>;
|
||||
forbidClick: BooleanConstructor;
|
||||
overlayClass: PropType<unknown>;
|
||||
overlayStyle: PropType<CSSProperties>;
|
||||
closeOnClick: BooleanConstructor;
|
||||
closeOnClickOverlay: BooleanConstructor;
|
||||
zIndex: (NumberConstructor | StringConstructor)[];
|
||||
}>> & Readonly<{
|
||||
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
||||
}>, {
|
||||
type: ToastType;
|
||||
position: ToastPosition;
|
||||
overlay: boolean;
|
||||
show: boolean;
|
||||
duration: number;
|
||||
closeOnClickOverlay: boolean;
|
||||
transition: string;
|
||||
forbidClick: boolean;
|
||||
closeOnClick: boolean;
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
||||
export default _default;
|
||||
127
node_modules/vant/es/toast/Toast.mjs
generated
vendored
Normal file
127
node_modules/vant/es/toast/Toast.mjs
generated
vendored
Normal file
@@ -0,0 +1,127 @@
|
||||
import { watch, onMounted, onUnmounted, defineComponent, createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
|
||||
import { pick, isDef, unknownProp, numericProp, makeStringProp, makeNumberProp, createNamespace } from "../utils/index.mjs";
|
||||
import { lockClick } from "./lock-click.mjs";
|
||||
import { Icon } from "../icon/index.mjs";
|
||||
import { Popup } from "../popup/index.mjs";
|
||||
import { Loading } from "../loading/index.mjs";
|
||||
const [name, bem] = createNamespace("toast");
|
||||
const popupInheritProps = ["show", "overlay", "teleport", "transition", "overlayClass", "overlayStyle", "closeOnClickOverlay", "zIndex"];
|
||||
const toastProps = {
|
||||
icon: String,
|
||||
show: Boolean,
|
||||
type: makeStringProp("text"),
|
||||
overlay: Boolean,
|
||||
message: numericProp,
|
||||
iconSize: numericProp,
|
||||
duration: makeNumberProp(2e3),
|
||||
position: makeStringProp("middle"),
|
||||
teleport: [String, Object],
|
||||
wordBreak: String,
|
||||
className: unknownProp,
|
||||
iconPrefix: String,
|
||||
transition: makeStringProp("van-fade"),
|
||||
loadingType: String,
|
||||
forbidClick: Boolean,
|
||||
overlayClass: unknownProp,
|
||||
overlayStyle: Object,
|
||||
closeOnClick: Boolean,
|
||||
closeOnClickOverlay: Boolean,
|
||||
zIndex: numericProp
|
||||
};
|
||||
var stdin_default = defineComponent({
|
||||
name,
|
||||
props: toastProps,
|
||||
emits: ["update:show"],
|
||||
setup(props, {
|
||||
emit,
|
||||
slots
|
||||
}) {
|
||||
let timer;
|
||||
let clickable = false;
|
||||
const toggleClickable = () => {
|
||||
const newValue = props.show && props.forbidClick;
|
||||
if (clickable !== newValue) {
|
||||
clickable = newValue;
|
||||
lockClick(clickable);
|
||||
}
|
||||
};
|
||||
const updateShow = (show) => emit("update:show", show);
|
||||
const onClick = () => {
|
||||
if (props.closeOnClick) {
|
||||
updateShow(false);
|
||||
}
|
||||
};
|
||||
const clearTimer = () => clearTimeout(timer);
|
||||
const renderIcon = () => {
|
||||
const {
|
||||
icon,
|
||||
type,
|
||||
iconSize,
|
||||
iconPrefix,
|
||||
loadingType
|
||||
} = props;
|
||||
const hasIcon = icon || type === "success" || type === "fail";
|
||||
if (hasIcon) {
|
||||
return _createVNode(Icon, {
|
||||
"name": icon || type,
|
||||
"size": iconSize,
|
||||
"class": bem("icon"),
|
||||
"classPrefix": iconPrefix
|
||||
}, null);
|
||||
}
|
||||
if (type === "loading") {
|
||||
return _createVNode(Loading, {
|
||||
"class": bem("loading"),
|
||||
"size": iconSize,
|
||||
"type": loadingType
|
||||
}, null);
|
||||
}
|
||||
};
|
||||
const renderMessage = () => {
|
||||
const {
|
||||
type,
|
||||
message
|
||||
} = props;
|
||||
if (slots.message) {
|
||||
return _createVNode("div", {
|
||||
"class": bem("text")
|
||||
}, [slots.message()]);
|
||||
}
|
||||
if (isDef(message) && message !== "") {
|
||||
return type === "html" ? _createVNode("div", {
|
||||
"key": 0,
|
||||
"class": bem("text"),
|
||||
"innerHTML": String(message)
|
||||
}, null) : _createVNode("div", {
|
||||
"class": bem("text")
|
||||
}, [message]);
|
||||
}
|
||||
};
|
||||
watch(() => [props.show, props.forbidClick], toggleClickable);
|
||||
watch(() => [props.show, props.type, props.message, props.duration], () => {
|
||||
clearTimer();
|
||||
if (props.show && props.duration > 0) {
|
||||
timer = setTimeout(() => {
|
||||
updateShow(false);
|
||||
}, props.duration);
|
||||
}
|
||||
});
|
||||
onMounted(toggleClickable);
|
||||
onUnmounted(toggleClickable);
|
||||
return () => _createVNode(Popup, _mergeProps({
|
||||
"class": [bem([props.position, props.wordBreak === "normal" ? "break-normal" : props.wordBreak, {
|
||||
[props.type]: !props.icon
|
||||
}]), props.className],
|
||||
"lockScroll": false,
|
||||
"onClick": onClick,
|
||||
"onClosed": clearTimer,
|
||||
"onUpdate:show": updateShow
|
||||
}, pick(props, popupInheritProps)), {
|
||||
default: () => [renderIcon(), renderMessage()]
|
||||
});
|
||||
}
|
||||
});
|
||||
export {
|
||||
stdin_default as default,
|
||||
toastProps
|
||||
};
|
||||
36
node_modules/vant/es/toast/function-call.d.ts
generated
vendored
Normal file
36
node_modules/vant/es/toast/function-call.d.ts
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
import type { ToastType, ToastOptions, ToastWrapperInstance } from './types';
|
||||
/**
|
||||
* Display a text toast
|
||||
*/
|
||||
export declare function showToast(options?: string | ToastOptions): ToastWrapperInstance;
|
||||
/**
|
||||
* Display a loading toast
|
||||
*/
|
||||
export declare const showLoadingToast: (options: string | ToastOptions) => ToastWrapperInstance;
|
||||
/**
|
||||
* Display a success toast
|
||||
*/
|
||||
export declare const showSuccessToast: (options: string | ToastOptions) => ToastWrapperInstance;
|
||||
/**
|
||||
* Display a fail toast
|
||||
*/
|
||||
export declare const showFailToast: (options: string | ToastOptions) => ToastWrapperInstance;
|
||||
/**
|
||||
* Close the currently displayed toast
|
||||
*/
|
||||
export declare const closeToast: (all?: boolean) => void;
|
||||
/**
|
||||
* Modify the default configuration that affects all `showToast` calls.
|
||||
* Specify the `type` parameter to modify the default configuration of a specific type of toast
|
||||
*/
|
||||
export declare function setToastDefaultOptions(options: ToastOptions): void;
|
||||
export declare function setToastDefaultOptions(type: ToastType, options: ToastOptions): void;
|
||||
/**
|
||||
* Reset the default configuration that affects all `showToast` calls.
|
||||
* Specify the `type` parameter to reset the default configuration of a specific type of toast
|
||||
*/
|
||||
export declare const resetToastDefaultOptions: (type?: ToastType) => void;
|
||||
/**
|
||||
* Allow multiple toasts to be displayed as the same time
|
||||
*/
|
||||
export declare const allowMultipleToast: (value?: boolean) => void;
|
||||
141
node_modules/vant/es/toast/function-call.mjs
generated
vendored
Normal file
141
node_modules/vant/es/toast/function-call.mjs
generated
vendored
Normal file
@@ -0,0 +1,141 @@
|
||||
import { ref, watch, getCurrentInstance, mergeProps as _mergeProps, createVNode as _createVNode } from "vue";
|
||||
import { extend, isObject, inBrowser } from "../utils/index.mjs";
|
||||
import { mountComponent, usePopupState } from "../utils/mount-component.mjs";
|
||||
import VanToast from "./Toast.mjs";
|
||||
const defaultOptions = {
|
||||
icon: "",
|
||||
type: "text",
|
||||
message: "",
|
||||
className: "",
|
||||
overlay: false,
|
||||
onClose: void 0,
|
||||
onOpened: void 0,
|
||||
duration: 2e3,
|
||||
teleport: "body",
|
||||
iconSize: void 0,
|
||||
iconPrefix: void 0,
|
||||
position: "middle",
|
||||
transition: "van-fade",
|
||||
forbidClick: false,
|
||||
loadingType: void 0,
|
||||
overlayClass: "",
|
||||
overlayStyle: void 0,
|
||||
closeOnClick: false,
|
||||
closeOnClickOverlay: false
|
||||
};
|
||||
let queue = [];
|
||||
let allowMultiple = false;
|
||||
let currentOptions = extend({}, defaultOptions);
|
||||
const defaultOptionsMap = /* @__PURE__ */ new Map();
|
||||
function parseOptions(message) {
|
||||
if (isObject(message)) {
|
||||
return message;
|
||||
}
|
||||
return {
|
||||
message
|
||||
};
|
||||
}
|
||||
function createInstance() {
|
||||
const {
|
||||
instance,
|
||||
unmount
|
||||
} = mountComponent({
|
||||
setup() {
|
||||
const message = ref("");
|
||||
const {
|
||||
open,
|
||||
state,
|
||||
close,
|
||||
toggle
|
||||
} = usePopupState();
|
||||
const onClosed = () => {
|
||||
if (allowMultiple) {
|
||||
queue = queue.filter((item) => item !== instance);
|
||||
unmount();
|
||||
}
|
||||
};
|
||||
const render = () => {
|
||||
const attrs = {
|
||||
onClosed,
|
||||
"onUpdate:show": toggle
|
||||
};
|
||||
return _createVNode(VanToast, _mergeProps(state, attrs), null);
|
||||
};
|
||||
watch(message, (val) => {
|
||||
state.message = val;
|
||||
});
|
||||
getCurrentInstance().render = render;
|
||||
return {
|
||||
open,
|
||||
close,
|
||||
message
|
||||
};
|
||||
}
|
||||
});
|
||||
return instance;
|
||||
}
|
||||
function getInstance() {
|
||||
if (!queue.length || allowMultiple) {
|
||||
const instance = createInstance();
|
||||
queue.push(instance);
|
||||
}
|
||||
return queue[queue.length - 1];
|
||||
}
|
||||
function showToast(options = {}) {
|
||||
if (!inBrowser) {
|
||||
return {};
|
||||
}
|
||||
const toast = getInstance();
|
||||
const parsedOptions = parseOptions(options);
|
||||
toast.open(extend({}, currentOptions, defaultOptionsMap.get(parsedOptions.type || currentOptions.type), parsedOptions));
|
||||
return toast;
|
||||
}
|
||||
const createMethod = (type) => (options) => showToast(extend({
|
||||
type
|
||||
}, parseOptions(options)));
|
||||
const showLoadingToast = createMethod("loading");
|
||||
const showSuccessToast = createMethod("success");
|
||||
const showFailToast = createMethod("fail");
|
||||
const closeToast = (all) => {
|
||||
var _a;
|
||||
if (queue.length) {
|
||||
if (all) {
|
||||
queue.forEach((toast) => {
|
||||
toast.close();
|
||||
});
|
||||
queue = [];
|
||||
} else if (!allowMultiple) {
|
||||
queue[0].close();
|
||||
} else {
|
||||
(_a = queue.shift()) == null ? void 0 : _a.close();
|
||||
}
|
||||
}
|
||||
};
|
||||
function setToastDefaultOptions(type, options) {
|
||||
if (typeof type === "string") {
|
||||
defaultOptionsMap.set(type, options);
|
||||
} else {
|
||||
extend(currentOptions, type);
|
||||
}
|
||||
}
|
||||
const resetToastDefaultOptions = (type) => {
|
||||
if (typeof type === "string") {
|
||||
defaultOptionsMap.delete(type);
|
||||
} else {
|
||||
currentOptions = extend({}, defaultOptions);
|
||||
defaultOptionsMap.clear();
|
||||
}
|
||||
};
|
||||
const allowMultipleToast = (value = true) => {
|
||||
allowMultiple = value;
|
||||
};
|
||||
export {
|
||||
allowMultipleToast,
|
||||
closeToast,
|
||||
resetToastDefaultOptions,
|
||||
setToastDefaultOptions,
|
||||
showFailToast,
|
||||
showLoadingToast,
|
||||
showSuccessToast,
|
||||
showToast
|
||||
};
|
||||
1
node_modules/vant/es/toast/index.css
generated
vendored
Normal file
1
node_modules/vant/es/toast/index.css
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
:root,:host{--van-toast-max-width: 70%;--van-toast-font-size: var(--van-font-size-md);--van-toast-text-color: var(--van-white);--van-toast-loading-icon-color: var(--van-white);--van-toast-line-height: var(--van-line-height-md);--van-toast-radius: var(--van-radius-lg);--van-toast-background: rgba(0, 0, 0, .7);--van-toast-icon-size: 36px;--van-toast-text-min-width: 96px;--van-toast-text-padding: var(--van-padding-xs) var(--van-padding-sm);--van-toast-default-padding: var(--van-padding-md);--van-toast-default-width: 88px;--van-toast-default-min-height: 88px;--van-toast-position-top-distance: 20%;--van-toast-position-bottom-distance: 20%}.van-toast{display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:content-box;transition:all var(--van-duration-fast);width:var(--van-toast-default-width);max-width:var(--van-toast-max-width);min-height:var(--van-toast-default-min-height);padding:var(--van-toast-default-padding);color:var(--van-toast-text-color);font-size:var(--van-toast-font-size);line-height:var(--van-toast-line-height);white-space:pre-wrap;word-break:break-all;text-align:center;background:var(--van-toast-background);border-radius:var(--van-toast-radius)}.van-toast--break-normal{word-break:normal;word-wrap:normal}.van-toast--break-word{word-break:normal;word-wrap:break-word}.van-toast--unclickable{overflow:hidden;cursor:not-allowed}.van-toast--unclickable *{pointer-events:none}.van-toast--text,.van-toast--html{width:-webkit-fit-content;width:fit-content;min-width:var(--van-toast-text-min-width);min-height:0;padding:var(--van-toast-text-padding)}.van-toast--text .van-toast__text,.van-toast--html .van-toast__text{margin-top:0}.van-toast--top{top:var(--van-toast-position-top-distance)}.van-toast--bottom{top:auto;bottom:var(--van-toast-position-bottom-distance)}.van-toast__icon{font-size:var(--van-toast-icon-size)}.van-toast__loading{padding:var(--van-padding-base);color:var(--van-toast-loading-icon-color)}.van-toast__text{margin-top:var(--van-padding-xs)}
|
||||
89
node_modules/vant/es/toast/index.d.ts
generated
vendored
Normal file
89
node_modules/vant/es/toast/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
export declare const Toast: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
||||
icon: StringConstructor;
|
||||
show: BooleanConstructor;
|
||||
type: {
|
||||
type: import("vue").PropType<import("./types").ToastType>;
|
||||
default: import("./types").ToastType;
|
||||
};
|
||||
overlay: BooleanConstructor;
|
||||
message: (NumberConstructor | StringConstructor)[];
|
||||
iconSize: (NumberConstructor | StringConstructor)[];
|
||||
duration: {
|
||||
type: NumberConstructor;
|
||||
default: number;
|
||||
};
|
||||
position: {
|
||||
type: import("vue").PropType<import("./types").ToastPosition>;
|
||||
default: import("./types").ToastPosition;
|
||||
};
|
||||
teleport: import("vue").PropType<import("vue").TeleportProps["to"]>;
|
||||
wordBreak: import("vue").PropType<import("./types").ToastWordBreak>;
|
||||
className: import("vue").PropType<unknown>;
|
||||
iconPrefix: StringConstructor;
|
||||
transition: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
loadingType: import("vue").PropType<import("..").LoadingType>;
|
||||
forbidClick: BooleanConstructor;
|
||||
overlayClass: import("vue").PropType<unknown>;
|
||||
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
||||
closeOnClick: BooleanConstructor;
|
||||
closeOnClickOverlay: BooleanConstructor;
|
||||
zIndex: (NumberConstructor | StringConstructor)[];
|
||||
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
||||
icon: StringConstructor;
|
||||
show: BooleanConstructor;
|
||||
type: {
|
||||
type: import("vue").PropType<import("./types").ToastType>;
|
||||
default: import("./types").ToastType;
|
||||
};
|
||||
overlay: BooleanConstructor;
|
||||
message: (NumberConstructor | StringConstructor)[];
|
||||
iconSize: (NumberConstructor | StringConstructor)[];
|
||||
duration: {
|
||||
type: NumberConstructor;
|
||||
default: number;
|
||||
};
|
||||
position: {
|
||||
type: import("vue").PropType<import("./types").ToastPosition>;
|
||||
default: import("./types").ToastPosition;
|
||||
};
|
||||
teleport: import("vue").PropType<import("vue").TeleportProps["to"]>;
|
||||
wordBreak: import("vue").PropType<import("./types").ToastWordBreak>;
|
||||
className: import("vue").PropType<unknown>;
|
||||
iconPrefix: StringConstructor;
|
||||
transition: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
loadingType: import("vue").PropType<import("..").LoadingType>;
|
||||
forbidClick: BooleanConstructor;
|
||||
overlayClass: import("vue").PropType<unknown>;
|
||||
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
||||
closeOnClick: BooleanConstructor;
|
||||
closeOnClickOverlay: BooleanConstructor;
|
||||
zIndex: (NumberConstructor | StringConstructor)[];
|
||||
}>> & Readonly<{
|
||||
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
||||
}>, {
|
||||
type: import("./types").ToastType;
|
||||
position: import("./types").ToastPosition;
|
||||
overlay: boolean;
|
||||
show: boolean;
|
||||
duration: number;
|
||||
closeOnClickOverlay: boolean;
|
||||
transition: string;
|
||||
forbidClick: boolean;
|
||||
closeOnClick: boolean;
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
||||
export default Toast;
|
||||
export { toastProps } from './Toast';
|
||||
export { showToast, closeToast, showFailToast, showLoadingToast, showSuccessToast, allowMultipleToast, setToastDefaultOptions, resetToastDefaultOptions, } from './function-call';
|
||||
export type { ToastProps } from './Toast';
|
||||
export type { ToastType, ToastOptions, ToastPosition, ToastThemeVars, ToastWordBreak, ToastWrapperInstance, } from './types';
|
||||
declare module 'vue' {
|
||||
interface GlobalComponents {
|
||||
VanToast: typeof Toast;
|
||||
}
|
||||
}
|
||||
28
node_modules/vant/es/toast/index.mjs
generated
vendored
Normal file
28
node_modules/vant/es/toast/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import { withInstall } from "../utils/index.mjs";
|
||||
import _Toast from "./Toast.mjs";
|
||||
const Toast = withInstall(_Toast);
|
||||
var stdin_default = Toast;
|
||||
import { toastProps } from "./Toast.mjs";
|
||||
import {
|
||||
showToast,
|
||||
closeToast,
|
||||
showFailToast,
|
||||
showLoadingToast,
|
||||
showSuccessToast,
|
||||
allowMultipleToast,
|
||||
setToastDefaultOptions,
|
||||
resetToastDefaultOptions
|
||||
} from "./function-call.mjs";
|
||||
export {
|
||||
Toast,
|
||||
allowMultipleToast,
|
||||
closeToast,
|
||||
stdin_default as default,
|
||||
resetToastDefaultOptions,
|
||||
setToastDefaultOptions,
|
||||
showFailToast,
|
||||
showLoadingToast,
|
||||
showSuccessToast,
|
||||
showToast,
|
||||
toastProps
|
||||
};
|
||||
1
node_modules/vant/es/toast/lock-click.d.ts
generated
vendored
Normal file
1
node_modules/vant/es/toast/lock-click.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function lockClick(lock: boolean): void;
|
||||
17
node_modules/vant/es/toast/lock-click.mjs
generated
vendored
Normal file
17
node_modules/vant/es/toast/lock-click.mjs
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
let lockCount = 0;
|
||||
function lockClick(lock) {
|
||||
if (lock) {
|
||||
if (!lockCount) {
|
||||
document.body.classList.add("van-toast--unclickable");
|
||||
}
|
||||
lockCount++;
|
||||
} else if (lockCount) {
|
||||
lockCount--;
|
||||
if (!lockCount) {
|
||||
document.body.classList.remove("van-toast--unclickable");
|
||||
}
|
||||
}
|
||||
}
|
||||
export {
|
||||
lockClick
|
||||
};
|
||||
1
node_modules/vant/es/toast/style/index.d.ts
generated
vendored
Normal file
1
node_modules/vant/es/toast/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
7
node_modules/vant/es/toast/style/index.mjs
generated
vendored
Normal file
7
node_modules/vant/es/toast/style/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import "../../style/base.css";
|
||||
import "../../badge/index.css";
|
||||
import "../../icon/index.css";
|
||||
import "../../loading/index.css";
|
||||
import "../../overlay/index.css";
|
||||
import "../../popup/index.css";
|
||||
import "../index.css";
|
||||
56
node_modules/vant/es/toast/types.d.ts
generated
vendored
Normal file
56
node_modules/vant/es/toast/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
import type { ComponentPublicInstance, TeleportProps } from 'vue';
|
||||
import type { LoadingType } from '../loading';
|
||||
import type { Numeric } from '../utils';
|
||||
export type ToastType = 'text' | 'loading' | 'success' | 'fail' | 'html';
|
||||
export type ToastPosition = 'top' | 'middle' | 'bottom';
|
||||
export type ToastWordBreak = 'break-all' | 'break-word' | 'normal';
|
||||
export type ToastOptions = {
|
||||
icon?: string;
|
||||
type?: ToastType;
|
||||
mask?: boolean;
|
||||
message?: Numeric;
|
||||
overlay?: boolean;
|
||||
duration?: number;
|
||||
teleport?: TeleportProps['to'];
|
||||
iconSize?: Numeric;
|
||||
position?: ToastPosition;
|
||||
className?: unknown;
|
||||
transition?: string;
|
||||
iconPrefix?: string;
|
||||
wordBreak?: ToastWordBreak;
|
||||
loadingType?: LoadingType;
|
||||
forbidClick?: boolean;
|
||||
closeOnClick?: boolean;
|
||||
overlayClass?: unknown;
|
||||
overlayStyle?: Record<string, any>;
|
||||
closeOnClickOverlay?: boolean;
|
||||
zIndex?: Numeric;
|
||||
onClose?: () => void;
|
||||
onOpened?: () => void;
|
||||
};
|
||||
export type ToastWrapperInstance = ComponentPublicInstance<{
|
||||
message: Numeric;
|
||||
}, {
|
||||
close: () => void;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
open: (props: Record<string, any>) => void;
|
||||
}>;
|
||||
export type ToastThemeVars = {
|
||||
toastMaxWidth?: string;
|
||||
toastFontSize?: string;
|
||||
toastTextColor?: string;
|
||||
toastLoadingIconColor?: string;
|
||||
toastLineHeight?: number | string;
|
||||
toastRadius?: string;
|
||||
toastBackground?: string;
|
||||
toastIconSize?: string;
|
||||
toastTextMinWidth?: string;
|
||||
toastTextPadding?: string;
|
||||
toastDefaultPadding?: string;
|
||||
toastDefaultWidth?: string;
|
||||
toastDefaultMinHeight?: string;
|
||||
toastPositionTopDistance?: string;
|
||||
toastPositionBottomDistance?: string;
|
||||
};
|
||||
0
node_modules/vant/es/toast/types.mjs
generated
vendored
Normal file
0
node_modules/vant/es/toast/types.mjs
generated
vendored
Normal file
Reference in New Issue
Block a user