first commit
This commit is contained in:
81
node_modules/vant/lib/list/List.d.ts
generated
vendored
Normal file
81
node_modules/vant/lib/list/List.d.ts
generated
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
import { type PropType, type ExtractPropTypes } from 'vue';
|
||||
import type { ListDirection } from './types';
|
||||
export declare const listProps: {
|
||||
error: BooleanConstructor;
|
||||
offset: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
loading: BooleanConstructor;
|
||||
disabled: BooleanConstructor;
|
||||
finished: BooleanConstructor;
|
||||
scroller: PropType<Element>;
|
||||
errorText: StringConstructor;
|
||||
direction: {
|
||||
type: PropType<ListDirection>;
|
||||
default: ListDirection;
|
||||
};
|
||||
loadingText: StringConstructor;
|
||||
finishedText: StringConstructor;
|
||||
immediateCheck: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
};
|
||||
export type ListProps = ExtractPropTypes<typeof listProps>;
|
||||
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
||||
error: BooleanConstructor;
|
||||
offset: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
loading: BooleanConstructor;
|
||||
disabled: BooleanConstructor;
|
||||
finished: BooleanConstructor;
|
||||
scroller: PropType<Element>;
|
||||
errorText: StringConstructor;
|
||||
direction: {
|
||||
type: PropType<ListDirection>;
|
||||
default: ListDirection;
|
||||
};
|
||||
loadingText: StringConstructor;
|
||||
finishedText: StringConstructor;
|
||||
immediateCheck: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("load" | "update:error" | "update:loading")[], "load" | "update:error" | "update:loading", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
||||
error: BooleanConstructor;
|
||||
offset: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
loading: BooleanConstructor;
|
||||
disabled: BooleanConstructor;
|
||||
finished: BooleanConstructor;
|
||||
scroller: PropType<Element>;
|
||||
errorText: StringConstructor;
|
||||
direction: {
|
||||
type: PropType<ListDirection>;
|
||||
default: ListDirection;
|
||||
};
|
||||
loadingText: StringConstructor;
|
||||
finishedText: StringConstructor;
|
||||
immediateCheck: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
}>> & Readonly<{
|
||||
onLoad?: ((...args: any[]) => any) | undefined;
|
||||
"onUpdate:error"?: ((...args: any[]) => any) | undefined;
|
||||
"onUpdate:loading"?: ((...args: any[]) => any) | undefined;
|
||||
}>, {
|
||||
offset: string | number;
|
||||
disabled: boolean;
|
||||
error: boolean;
|
||||
loading: boolean;
|
||||
direction: ListDirection;
|
||||
finished: boolean;
|
||||
immediateCheck: boolean;
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
||||
export default _default;
|
||||
162
node_modules/vant/lib/list/List.js
generated
vendored
Normal file
162
node_modules/vant/lib/list/List.js
generated
vendored
Normal file
@@ -0,0 +1,162 @@
|
||||
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,
|
||||
listProps: () => listProps
|
||||
});
|
||||
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_use_tab_status = require("../composables/use-tab-status");
|
||||
var import_loading = require("../loading");
|
||||
const [name, bem, t] = (0, import_utils.createNamespace)("list");
|
||||
const listProps = {
|
||||
error: Boolean,
|
||||
offset: (0, import_utils.makeNumericProp)(300),
|
||||
loading: Boolean,
|
||||
disabled: Boolean,
|
||||
finished: Boolean,
|
||||
scroller: Object,
|
||||
errorText: String,
|
||||
direction: (0, import_utils.makeStringProp)("down"),
|
||||
loadingText: String,
|
||||
finishedText: String,
|
||||
immediateCheck: import_utils.truthProp
|
||||
};
|
||||
var stdin_default = (0, import_vue.defineComponent)({
|
||||
name,
|
||||
props: listProps,
|
||||
emits: ["load", "update:error", "update:loading"],
|
||||
setup(props, {
|
||||
emit,
|
||||
slots
|
||||
}) {
|
||||
const loading = (0, import_vue.ref)(props.loading);
|
||||
const root = (0, import_vue.ref)();
|
||||
const placeholder = (0, import_vue.ref)();
|
||||
const tabStatus = (0, import_use_tab_status.useAllTabStatus)();
|
||||
const scrollParent = (0, import_use.useScrollParent)(root);
|
||||
const scroller = (0, import_vue.computed)(() => props.scroller || scrollParent.value);
|
||||
const check = () => {
|
||||
(0, import_vue.nextTick)(() => {
|
||||
if (loading.value || props.finished || props.disabled || props.error || // skip check when inside an inactive tab
|
||||
(tabStatus == null ? void 0 : tabStatus.value) === false) {
|
||||
return;
|
||||
}
|
||||
const {
|
||||
direction
|
||||
} = props;
|
||||
const offset = +props.offset;
|
||||
const scrollParentRect = (0, import_use.useRect)(scroller);
|
||||
if (!scrollParentRect.height || (0, import_utils.isHidden)(root)) {
|
||||
return;
|
||||
}
|
||||
let isReachEdge = false;
|
||||
const placeholderRect = (0, import_use.useRect)(placeholder);
|
||||
if (direction === "up") {
|
||||
isReachEdge = scrollParentRect.top - placeholderRect.top <= offset;
|
||||
} else {
|
||||
isReachEdge = placeholderRect.bottom - scrollParentRect.bottom <= offset;
|
||||
}
|
||||
if (isReachEdge) {
|
||||
loading.value = true;
|
||||
emit("update:loading", true);
|
||||
emit("load");
|
||||
}
|
||||
});
|
||||
};
|
||||
const renderFinishedText = () => {
|
||||
if (props.finished) {
|
||||
const text = slots.finished ? slots.finished() : props.finishedText;
|
||||
if (text) {
|
||||
return (0, import_vue.createVNode)("div", {
|
||||
"class": bem("finished-text")
|
||||
}, [text]);
|
||||
}
|
||||
}
|
||||
};
|
||||
const clickErrorText = () => {
|
||||
emit("update:error", false);
|
||||
check();
|
||||
};
|
||||
const renderErrorText = () => {
|
||||
if (props.error) {
|
||||
const text = slots.error ? slots.error() : props.errorText;
|
||||
if (text) {
|
||||
return (0, import_vue.createVNode)("div", {
|
||||
"role": "button",
|
||||
"class": bem("error-text"),
|
||||
"tabindex": 0,
|
||||
"onClick": clickErrorText
|
||||
}, [text]);
|
||||
}
|
||||
}
|
||||
};
|
||||
const renderLoading = () => {
|
||||
if (loading.value && !props.finished && !props.disabled) {
|
||||
return (0, import_vue.createVNode)("div", {
|
||||
"class": bem("loading")
|
||||
}, [slots.loading ? slots.loading() : (0, import_vue.createVNode)(import_loading.Loading, {
|
||||
"class": bem("loading-icon")
|
||||
}, {
|
||||
default: () => [props.loadingText || t("loading")]
|
||||
})]);
|
||||
}
|
||||
};
|
||||
(0, import_vue.watch)(() => [props.loading, props.finished, props.error], check);
|
||||
if (tabStatus) {
|
||||
(0, import_vue.watch)(tabStatus, (tabActive) => {
|
||||
if (tabActive) {
|
||||
check();
|
||||
}
|
||||
});
|
||||
}
|
||||
(0, import_vue.onUpdated)(() => {
|
||||
loading.value = props.loading;
|
||||
});
|
||||
(0, import_vue.onMounted)(() => {
|
||||
if (props.immediateCheck) {
|
||||
check();
|
||||
}
|
||||
});
|
||||
(0, import_use_expose.useExpose)({
|
||||
check
|
||||
});
|
||||
(0, import_use.useEventListener)("scroll", check, {
|
||||
target: scroller,
|
||||
passive: true
|
||||
});
|
||||
return () => {
|
||||
var _a;
|
||||
const Content = (_a = slots.default) == null ? void 0 : _a.call(slots);
|
||||
const Placeholder = (0, import_vue.createVNode)("div", {
|
||||
"ref": placeholder,
|
||||
"class": bem("placeholder")
|
||||
}, null);
|
||||
return (0, import_vue.createVNode)("div", {
|
||||
"ref": root,
|
||||
"role": "feed",
|
||||
"class": bem(),
|
||||
"aria-busy": loading.value
|
||||
}, [props.direction === "down" ? Content : Placeholder, renderLoading(), renderFinishedText(), renderErrorText(), props.direction === "up" ? Content : Placeholder]);
|
||||
};
|
||||
}
|
||||
});
|
||||
1
node_modules/vant/lib/list/index.css
generated
vendored
Normal file
1
node_modules/vant/lib/list/index.css
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
:root,:host{--van-list-text-color: var(--van-text-color-2);--van-list-text-font-size: var(--van-font-size-md);--van-list-text-line-height: 50px;--van-list-loading-icon-size: 16px}.van-list__loading,.van-list__finished-text,.van-list__error-text{color:var(--van-list-text-color);font-size:var(--van-list-text-font-size);line-height:var(--van-list-text-line-height);text-align:center}.van-list__placeholder{height:0;pointer-events:none}.van-list__loading-icon .van-loading__spinner{width:var(--van-list-loading-icon-size);height:var(--van-list-loading-icon-size)}
|
||||
65
node_modules/vant/lib/list/index.d.ts
generated
vendored
Normal file
65
node_modules/vant/lib/list/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
import { ListProps } from './List';
|
||||
export declare const List: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
||||
error: BooleanConstructor;
|
||||
offset: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
loading: BooleanConstructor;
|
||||
disabled: BooleanConstructor;
|
||||
finished: BooleanConstructor;
|
||||
scroller: import("vue").PropType<Element>;
|
||||
errorText: StringConstructor;
|
||||
direction: {
|
||||
type: import("vue").PropType<import("./types").ListDirection>;
|
||||
default: import("./types").ListDirection;
|
||||
};
|
||||
loadingText: StringConstructor;
|
||||
finishedText: StringConstructor;
|
||||
immediateCheck: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("load" | "update:error" | "update:loading")[], "load" | "update:error" | "update:loading", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
||||
error: BooleanConstructor;
|
||||
offset: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
loading: BooleanConstructor;
|
||||
disabled: BooleanConstructor;
|
||||
finished: BooleanConstructor;
|
||||
scroller: import("vue").PropType<Element>;
|
||||
errorText: StringConstructor;
|
||||
direction: {
|
||||
type: import("vue").PropType<import("./types").ListDirection>;
|
||||
default: import("./types").ListDirection;
|
||||
};
|
||||
loadingText: StringConstructor;
|
||||
finishedText: StringConstructor;
|
||||
immediateCheck: {
|
||||
type: BooleanConstructor;
|
||||
default: true;
|
||||
};
|
||||
}>> & Readonly<{
|
||||
onLoad?: ((...args: any[]) => any) | undefined;
|
||||
"onUpdate:error"?: ((...args: any[]) => any) | undefined;
|
||||
"onUpdate:loading"?: ((...args: any[]) => any) | undefined;
|
||||
}>, {
|
||||
offset: string | number;
|
||||
disabled: boolean;
|
||||
error: boolean;
|
||||
loading: boolean;
|
||||
direction: import("./types").ListDirection;
|
||||
finished: boolean;
|
||||
immediateCheck: boolean;
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
||||
export default List;
|
||||
export { listProps } from './List';
|
||||
export type { ListProps };
|
||||
export type { ListInstance, ListDirection, ListThemeVars } from './types';
|
||||
declare module 'vue' {
|
||||
interface GlobalComponents {
|
||||
VanList: typeof List;
|
||||
}
|
||||
}
|
||||
39
node_modules/vant/lib/list/index.js
generated
vendored
Normal file
39
node_modules/vant/lib/list/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, {
|
||||
List: () => List,
|
||||
default: () => stdin_default,
|
||||
listProps: () => import_List2.listProps
|
||||
});
|
||||
module.exports = __toCommonJS(stdin_exports);
|
||||
var import_utils = require("../utils");
|
||||
var import_List = __toESM(require("./List"));
|
||||
var import_List2 = require("./List");
|
||||
const List = (0, import_utils.withInstall)(import_List.default);
|
||||
var stdin_default = List;
|
||||
1
node_modules/vant/lib/list/style/index.d.ts
generated
vendored
Normal file
1
node_modules/vant/lib/list/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
3
node_modules/vant/lib/list/style/index.js
generated
vendored
Normal file
3
node_modules/vant/lib/list/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
require("../../style/base.css");
|
||||
require("../../loading/index.css");
|
||||
require("../index.css");
|
||||
13
node_modules/vant/lib/list/types.d.ts
generated
vendored
Normal file
13
node_modules/vant/lib/list/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { ComponentPublicInstance } from 'vue';
|
||||
import type { ListProps } from './List';
|
||||
export type ListDirection = 'up' | 'down';
|
||||
export type ListExpose = {
|
||||
check: () => void;
|
||||
};
|
||||
export type ListInstance = ComponentPublicInstance<ListProps, ListExpose>;
|
||||
export type ListThemeVars = {
|
||||
listTextColor?: string;
|
||||
listTextFontSize?: string;
|
||||
listTextLineHeight?: number | string;
|
||||
listLoadingIconSize?: string;
|
||||
};
|
||||
15
node_modules/vant/lib/list/types.js
generated
vendored
Normal file
15
node_modules/vant/lib/list/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