Initial commit: GamePortrait 竖屏版 - 深色豪华主题

This commit is contained in:
li
2026-01-16 17:47:53 +08:00
commit 40976e4b45
26611 changed files with 2843638 additions and 0 deletions
+78
View File
@@ -0,0 +1,78 @@
import { 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;
errorText: StringConstructor;
direction: {
type: import("vue").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<{
error: BooleanConstructor;
offset: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
loading: BooleanConstructor;
disabled: BooleanConstructor;
finished: BooleanConstructor;
errorText: StringConstructor;
direction: {
type: import("vue").PropType<ListDirection>;
default: ListDirection;
};
loadingText: StringConstructor;
finishedText: StringConstructor;
immediateCheck: {
type: BooleanConstructor;
default: true;
};
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("load" | "update:error" | "update:loading")[], "load" | "update:error" | "update:loading", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
error: BooleanConstructor;
offset: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
loading: BooleanConstructor;
disabled: BooleanConstructor;
finished: BooleanConstructor;
errorText: StringConstructor;
direction: {
type: import("vue").PropType<ListDirection>;
default: ListDirection;
};
loadingText: StringConstructor;
finishedText: StringConstructor;
immediateCheck: {
type: BooleanConstructor;
default: true;
};
}>> & {
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;
}>;
export default _default;
+142
View File
@@ -0,0 +1,142 @@
import { createVNode as _createVNode } from "vue";
import { ref, watch, nextTick, onUpdated, onMounted, defineComponent } from "vue";
import { isHidden, truthProp, makeStringProp, makeNumericProp, createNamespace } from "../utils/index.mjs";
import { useRect, useScrollParent, useEventListener } from "@vant/use";
import { useExpose } from "../composables/use-expose.mjs";
import { useTabStatus } from "../composables/use-tab-status.mjs";
import { Loading } from "../loading/index.mjs";
const [name, bem, t] = createNamespace("list");
const listProps = {
error: Boolean,
offset: makeNumericProp(300),
loading: Boolean,
disabled: Boolean,
finished: Boolean,
errorText: String,
direction: makeStringProp("down"),
loadingText: String,
finishedText: String,
immediateCheck: truthProp
};
var stdin_default = defineComponent({
name,
props: listProps,
emits: ["load", "update:error", "update:loading"],
setup(props, {
emit,
slots
}) {
const loading = ref(props.loading);
const root = ref();
const placeholder = ref();
const tabStatus = useTabStatus();
const scrollParent = useScrollParent(root);
const check = () => {
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 = useRect(scrollParent);
if (!scrollParentRect.height || isHidden(root)) {
return;
}
let isReachEdge = false;
const placeholderRect = 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 _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 _createVNode("div", {
"role": "button",
"class": bem("error-text"),
"tabindex": 0,
"onClick": clickErrorText
}, [text]);
}
}
};
const renderLoading = () => {
if (loading.value && !props.finished && !props.disabled) {
return _createVNode("div", {
"class": bem("loading")
}, [slots.loading ? slots.loading() : _createVNode(Loading, {
"class": bem("loading-icon")
}, {
default: () => [props.loadingText || t("loading")]
})]);
}
};
watch(() => [props.loading, props.finished, props.error], check);
if (tabStatus) {
watch(tabStatus, (tabActive) => {
if (tabActive) {
check();
}
});
}
onUpdated(() => {
loading.value = props.loading;
});
onMounted(() => {
if (props.immediateCheck) {
check();
}
});
useExpose({
check
});
useEventListener("scroll", check, {
target: scrollParent,
passive: true
});
return () => {
var _a;
const Content = (_a = slots.default) == null ? void 0 : _a.call(slots);
const Placeholder = _createVNode("div", {
"ref": placeholder,
"class": bem("placeholder")
}, null);
return _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]);
};
}
});
export {
stdin_default as default,
listProps
};
+1
View File
@@ -0,0 +1 @@
:root{--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)}
+63
View File
@@ -0,0 +1,63 @@
import { ListProps } from './List';
export declare const List: import("../utils").WithInstall<import("vue").DefineComponent<{
error: BooleanConstructor;
offset: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
loading: BooleanConstructor;
disabled: BooleanConstructor;
finished: BooleanConstructor;
errorText: StringConstructor;
direction: {
type: import("vue").PropType<import("./types").ListDirection>;
default: import("./types").ListDirection;
};
loadingText: StringConstructor;
finishedText: StringConstructor;
immediateCheck: {
type: BooleanConstructor;
default: true;
};
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("load" | "update:error" | "update:loading")[], "load" | "update:error" | "update:loading", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
error: BooleanConstructor;
offset: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
loading: BooleanConstructor;
disabled: BooleanConstructor;
finished: BooleanConstructor;
errorText: StringConstructor;
direction: {
type: import("vue").PropType<import("./types").ListDirection>;
default: import("./types").ListDirection;
};
loadingText: StringConstructor;
finishedText: StringConstructor;
immediateCheck: {
type: BooleanConstructor;
default: true;
};
}>> & {
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;
}>>;
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;
}
}
+10
View File
@@ -0,0 +1,10 @@
import { withInstall } from "../utils/index.mjs";
import _List from "./List.mjs";
const List = withInstall(_List);
var stdin_default = List;
import { listProps } from "./List.mjs";
export {
List,
stdin_default as default,
listProps
};
+1
View File
@@ -0,0 +1 @@
export {};
+3
View File
@@ -0,0 +1,3 @@
import "../../style/base.css";
import "../../loading/index.css";
import "../index.css";
+13
View 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;
};
View File