first commit
This commit is contained in:
113
node_modules/vant/lib/image/Image.d.ts
generated
vendored
Normal file
113
node_modules/vant/lib/image/Image.d.ts
generated
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
import { type PropType, type ExtractPropTypes, type ImgHTMLAttributes } from 'vue';
|
||||
import type { ImageFit, ImagePosition } from './types';
|
||||
export declare const imageProps: {
|
||||
src: StringConstructor;
|
||||
alt: StringConstructor;
|
||||
fit: PropType<ImageFit>;
|
||||
position: PropType<ImagePosition>;
|
||||
round: BooleanConstructor;
|
||||
block: BooleanConstructor;
|
||||
width: (NumberConstructor | StringConstructor)[];
|
||||
height: (NumberConstructor | StringConstructor)[];
|
||||
radius: (NumberConstructor | StringConstructor)[];
|
||||
lazyLoad: BooleanConstructor;
|
||||
iconSize: (NumberConstructor | StringConstructor)[];
|
||||
showError: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
errorIcon: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
iconPrefix: StringConstructor;
|
||||
showLoading: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
loadingIcon: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
crossorigin: PropType<ImgHTMLAttributes["crossorigin"]>;
|
||||
referrerpolicy: PropType<ImgHTMLAttributes["referrerpolicy"]>;
|
||||
decoding: PropType<ImgHTMLAttributes["decoding"]>;
|
||||
};
|
||||
export type ImageProps = ExtractPropTypes<typeof imageProps>;
|
||||
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
||||
src: StringConstructor;
|
||||
alt: StringConstructor;
|
||||
fit: PropType<ImageFit>;
|
||||
position: PropType<ImagePosition>;
|
||||
round: BooleanConstructor;
|
||||
block: BooleanConstructor;
|
||||
width: (NumberConstructor | StringConstructor)[];
|
||||
height: (NumberConstructor | StringConstructor)[];
|
||||
radius: (NumberConstructor | StringConstructor)[];
|
||||
lazyLoad: BooleanConstructor;
|
||||
iconSize: (NumberConstructor | StringConstructor)[];
|
||||
showError: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
errorIcon: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
iconPrefix: StringConstructor;
|
||||
showLoading: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
loadingIcon: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
crossorigin: PropType<ImgHTMLAttributes["crossorigin"]>;
|
||||
referrerpolicy: PropType<ImgHTMLAttributes["referrerpolicy"]>;
|
||||
decoding: PropType<ImgHTMLAttributes["decoding"]>;
|
||||
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("error" | "load")[], "error" | "load", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
||||
src: StringConstructor;
|
||||
alt: StringConstructor;
|
||||
fit: PropType<ImageFit>;
|
||||
position: PropType<ImagePosition>;
|
||||
round: BooleanConstructor;
|
||||
block: BooleanConstructor;
|
||||
width: (NumberConstructor | StringConstructor)[];
|
||||
height: (NumberConstructor | StringConstructor)[];
|
||||
radius: (NumberConstructor | StringConstructor)[];
|
||||
lazyLoad: BooleanConstructor;
|
||||
iconSize: (NumberConstructor | StringConstructor)[];
|
||||
showError: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
errorIcon: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
iconPrefix: StringConstructor;
|
||||
showLoading: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
loadingIcon: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
crossorigin: PropType<ImgHTMLAttributes["crossorigin"]>;
|
||||
referrerpolicy: PropType<ImgHTMLAttributes["referrerpolicy"]>;
|
||||
decoding: PropType<ImgHTMLAttributes["decoding"]>;
|
||||
}>> & Readonly<{
|
||||
onLoad?: ((...args: any[]) => any) | undefined;
|
||||
onError?: ((...args: any[]) => any) | undefined;
|
||||
}>, {
|
||||
round: boolean;
|
||||
block: boolean;
|
||||
showError: boolean;
|
||||
lazyLoad: boolean;
|
||||
errorIcon: string;
|
||||
showLoading: boolean;
|
||||
loadingIcon: string;
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
||||
export default _default;
|
||||
195
node_modules/vant/lib/image/Image.js
generated
vendored
Normal file
195
node_modules/vant/lib/image/Image.js
generated
vendored
Normal file
@@ -0,0 +1,195 @@
|
||||
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,
|
||||
imageProps: () => imageProps
|
||||
});
|
||||
module.exports = __toCommonJS(stdin_exports);
|
||||
var import_vue = require("vue");
|
||||
var import_utils = require("../utils");
|
||||
var import_icon = require("../icon");
|
||||
const [name, bem] = (0, import_utils.createNamespace)("image");
|
||||
const imageProps = {
|
||||
src: String,
|
||||
alt: String,
|
||||
fit: String,
|
||||
position: String,
|
||||
round: Boolean,
|
||||
block: Boolean,
|
||||
width: import_utils.numericProp,
|
||||
height: import_utils.numericProp,
|
||||
radius: import_utils.numericProp,
|
||||
lazyLoad: Boolean,
|
||||
iconSize: import_utils.numericProp,
|
||||
showError: import_utils.truthProp,
|
||||
errorIcon: (0, import_utils.makeStringProp)("photo-fail"),
|
||||
iconPrefix: String,
|
||||
showLoading: import_utils.truthProp,
|
||||
loadingIcon: (0, import_utils.makeStringProp)("photo"),
|
||||
crossorigin: String,
|
||||
referrerpolicy: String,
|
||||
decoding: String
|
||||
};
|
||||
var stdin_default = (0, import_vue.defineComponent)({
|
||||
name,
|
||||
props: imageProps,
|
||||
emits: ["load", "error"],
|
||||
setup(props, {
|
||||
emit,
|
||||
slots
|
||||
}) {
|
||||
const error = (0, import_vue.ref)(false);
|
||||
const loading = (0, import_vue.ref)(true);
|
||||
const imageRef = (0, import_vue.ref)();
|
||||
const {
|
||||
$Lazyload
|
||||
} = (0, import_vue.getCurrentInstance)().proxy;
|
||||
const style = (0, import_vue.computed)(() => {
|
||||
const style2 = {
|
||||
width: (0, import_utils.addUnit)(props.width),
|
||||
height: (0, import_utils.addUnit)(props.height)
|
||||
};
|
||||
if ((0, import_utils.isDef)(props.radius)) {
|
||||
style2.overflow = "hidden";
|
||||
style2.borderRadius = (0, import_utils.addUnit)(props.radius);
|
||||
}
|
||||
return style2;
|
||||
});
|
||||
(0, import_vue.watch)(() => props.src, () => {
|
||||
error.value = false;
|
||||
loading.value = true;
|
||||
});
|
||||
const onLoad = (event) => {
|
||||
if (loading.value) {
|
||||
loading.value = false;
|
||||
emit("load", event);
|
||||
}
|
||||
};
|
||||
const triggerLoad = () => {
|
||||
const loadEvent = new Event("load");
|
||||
Object.defineProperty(loadEvent, "target", {
|
||||
value: imageRef.value,
|
||||
enumerable: true
|
||||
});
|
||||
onLoad(loadEvent);
|
||||
};
|
||||
const onError = (event) => {
|
||||
error.value = true;
|
||||
loading.value = false;
|
||||
emit("error", event);
|
||||
};
|
||||
const renderIcon = (name2, className, slot) => {
|
||||
if (slot) {
|
||||
return slot();
|
||||
}
|
||||
return (0, import_vue.createVNode)(import_icon.Icon, {
|
||||
"name": name2,
|
||||
"size": props.iconSize,
|
||||
"class": className,
|
||||
"classPrefix": props.iconPrefix
|
||||
}, null);
|
||||
};
|
||||
const renderPlaceholder = () => {
|
||||
if (loading.value && props.showLoading) {
|
||||
return (0, import_vue.createVNode)("div", {
|
||||
"class": bem("loading")
|
||||
}, [renderIcon(props.loadingIcon, bem("loading-icon"), slots.loading)]);
|
||||
}
|
||||
if (error.value && props.showError) {
|
||||
return (0, import_vue.createVNode)("div", {
|
||||
"class": bem("error")
|
||||
}, [renderIcon(props.errorIcon, bem("error-icon"), slots.error)]);
|
||||
}
|
||||
};
|
||||
const renderImage = () => {
|
||||
if (error.value || !props.src) {
|
||||
return;
|
||||
}
|
||||
const attrs = {
|
||||
alt: props.alt,
|
||||
class: bem("img"),
|
||||
decoding: props.decoding,
|
||||
style: {
|
||||
objectFit: props.fit,
|
||||
objectPosition: props.position
|
||||
},
|
||||
crossorigin: props.crossorigin,
|
||||
referrerpolicy: props.referrerpolicy
|
||||
};
|
||||
if (props.lazyLoad) {
|
||||
return (0, import_vue.withDirectives)((0, import_vue.createVNode)("img", (0, import_vue.mergeProps)({
|
||||
"ref": imageRef
|
||||
}, attrs), null), [[(0, import_vue.resolveDirective)("lazy"), props.src]]);
|
||||
}
|
||||
return (0, import_vue.createVNode)("img", (0, import_vue.mergeProps)({
|
||||
"ref": imageRef,
|
||||
"src": props.src,
|
||||
"onLoad": onLoad,
|
||||
"onError": onError
|
||||
}, attrs), null);
|
||||
};
|
||||
const onLazyLoaded = ({
|
||||
el
|
||||
}) => {
|
||||
const check = () => {
|
||||
if (el === imageRef.value && loading.value) {
|
||||
triggerLoad();
|
||||
}
|
||||
};
|
||||
if (imageRef.value) {
|
||||
check();
|
||||
} else {
|
||||
(0, import_vue.nextTick)(check);
|
||||
}
|
||||
};
|
||||
const onLazyLoadError = ({
|
||||
el
|
||||
}) => {
|
||||
if (el === imageRef.value && !error.value) {
|
||||
onError();
|
||||
}
|
||||
};
|
||||
if ($Lazyload && import_utils.inBrowser) {
|
||||
$Lazyload.$on("loaded", onLazyLoaded);
|
||||
$Lazyload.$on("error", onLazyLoadError);
|
||||
(0, import_vue.onBeforeUnmount)(() => {
|
||||
$Lazyload.$off("loaded", onLazyLoaded);
|
||||
$Lazyload.$off("error", onLazyLoadError);
|
||||
});
|
||||
}
|
||||
(0, import_vue.onMounted)(() => {
|
||||
(0, import_vue.nextTick)(() => {
|
||||
var _a;
|
||||
if (((_a = imageRef.value) == null ? void 0 : _a.complete) && !props.lazyLoad) {
|
||||
triggerLoad();
|
||||
}
|
||||
});
|
||||
});
|
||||
return () => {
|
||||
var _a;
|
||||
return (0, import_vue.createVNode)("div", {
|
||||
"class": bem({
|
||||
round: props.round,
|
||||
block: props.block
|
||||
}),
|
||||
"style": style.value
|
||||
}, [renderImage(), renderPlaceholder(), (_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
||||
};
|
||||
}
|
||||
});
|
||||
1
node_modules/vant/lib/image/index.css
generated
vendored
Normal file
1
node_modules/vant/lib/image/index.css
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
:root,:host{--van-image-placeholder-text-color: var(--van-text-color-2);--van-image-placeholder-font-size: var(--van-font-size-md);--van-image-placeholder-background: var(--van-background);--van-image-loading-icon-size: 32px;--van-image-loading-icon-color: var(--van-gray-4);--van-image-error-icon-size: 32px;--van-image-error-icon-color: var(--van-gray-4)}.van-image{position:relative;display:inline-block}.van-image--round{overflow:hidden;border-radius:var(--van-radius-max)}.van-image--round .van-image__img{border-radius:inherit}.van-image--block{display:block}.van-image__img,.van-image__error,.van-image__loading{display:block;width:100%;height:100%}.van-image__error,.van-image__loading{position:absolute;top:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--van-image-placeholder-text-color);font-size:var(--van-image-placeholder-font-size);background:var(--van-image-placeholder-background)}.van-image__loading-icon{color:var(--van-image-loading-icon-color);font-size:var(--van-image-loading-icon-size)}.van-image__error-icon{color:var(--van-image-error-icon-color);font-size:var(--van-image-error-icon-size)}
|
||||
85
node_modules/vant/lib/image/index.d.ts
generated
vendored
Normal file
85
node_modules/vant/lib/image/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
export declare const Image: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
||||
src: StringConstructor;
|
||||
alt: StringConstructor;
|
||||
fit: import("vue").PropType<import("./types").ImageFit>;
|
||||
position: import("vue").PropType<import("./types").ImagePosition>;
|
||||
round: BooleanConstructor;
|
||||
block: BooleanConstructor;
|
||||
width: (NumberConstructor | StringConstructor)[];
|
||||
height: (NumberConstructor | StringConstructor)[];
|
||||
radius: (NumberConstructor | StringConstructor)[];
|
||||
lazyLoad: BooleanConstructor;
|
||||
iconSize: (NumberConstructor | StringConstructor)[];
|
||||
showError: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
errorIcon: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
iconPrefix: StringConstructor;
|
||||
showLoading: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
loadingIcon: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
crossorigin: import("vue").PropType<import("vue").ImgHTMLAttributes["crossorigin"]>;
|
||||
referrerpolicy: import("vue").PropType<import("vue").ImgHTMLAttributes["referrerpolicy"]>;
|
||||
decoding: import("vue").PropType<import("vue").ImgHTMLAttributes["decoding"]>;
|
||||
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("error" | "load")[], "error" | "load", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
||||
src: StringConstructor;
|
||||
alt: StringConstructor;
|
||||
fit: import("vue").PropType<import("./types").ImageFit>;
|
||||
position: import("vue").PropType<import("./types").ImagePosition>;
|
||||
round: BooleanConstructor;
|
||||
block: BooleanConstructor;
|
||||
width: (NumberConstructor | StringConstructor)[];
|
||||
height: (NumberConstructor | StringConstructor)[];
|
||||
radius: (NumberConstructor | StringConstructor)[];
|
||||
lazyLoad: BooleanConstructor;
|
||||
iconSize: (NumberConstructor | StringConstructor)[];
|
||||
showError: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
errorIcon: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
iconPrefix: StringConstructor;
|
||||
showLoading: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
loadingIcon: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
crossorigin: import("vue").PropType<import("vue").ImgHTMLAttributes["crossorigin"]>;
|
||||
referrerpolicy: import("vue").PropType<import("vue").ImgHTMLAttributes["referrerpolicy"]>;
|
||||
decoding: import("vue").PropType<import("vue").ImgHTMLAttributes["decoding"]>;
|
||||
}>> & Readonly<{
|
||||
onLoad?: ((...args: any[]) => any) | undefined;
|
||||
onError?: ((...args: any[]) => any) | undefined;
|
||||
}>, {
|
||||
round: boolean;
|
||||
block: boolean;
|
||||
showError: boolean;
|
||||
lazyLoad: boolean;
|
||||
errorIcon: string;
|
||||
showLoading: boolean;
|
||||
loadingIcon: string;
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
||||
export default Image;
|
||||
export { imageProps } from './Image';
|
||||
export type { ImageProps } from './Image';
|
||||
export type { ImageFit, ImagePosition, ImageThemeVars } from './types';
|
||||
declare module 'vue' {
|
||||
interface GlobalComponents {
|
||||
VanImage: typeof Image;
|
||||
}
|
||||
}
|
||||
39
node_modules/vant/lib/image/index.js
generated
vendored
Normal file
39
node_modules/vant/lib/image/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, {
|
||||
Image: () => Image,
|
||||
default: () => stdin_default,
|
||||
imageProps: () => import_Image2.imageProps
|
||||
});
|
||||
module.exports = __toCommonJS(stdin_exports);
|
||||
var import_utils = require("../utils");
|
||||
var import_Image = __toESM(require("./Image"));
|
||||
var import_Image2 = require("./Image");
|
||||
const Image = (0, import_utils.withInstall)(import_Image.default);
|
||||
var stdin_default = Image;
|
||||
1
node_modules/vant/lib/image/style/index.d.ts
generated
vendored
Normal file
1
node_modules/vant/lib/image/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
4
node_modules/vant/lib/image/style/index.js
generated
vendored
Normal file
4
node_modules/vant/lib/image/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");
|
||||
12
node_modules/vant/lib/image/types.d.ts
generated
vendored
Normal file
12
node_modules/vant/lib/image/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { CSSProperties } from 'vue';
|
||||
export type ImageFit = CSSProperties['objectFit'];
|
||||
export type ImagePosition = CSSProperties['objectPosition'];
|
||||
export type ImageThemeVars = {
|
||||
imagePlaceholderTextColor?: string;
|
||||
imagePlaceholderFontSize?: string;
|
||||
imagePlaceholderBackground?: string;
|
||||
imageLoadingIconSize?: string;
|
||||
imageLoadingIconColor?: string;
|
||||
imageErrorIconSize?: string;
|
||||
imageErrorIconColor?: string;
|
||||
};
|
||||
15
node_modules/vant/lib/image/types.js
generated
vendored
Normal file
15
node_modules/vant/lib/image/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