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
+136
View File
@@ -0,0 +1,136 @@
import { type PropType, type ExtractPropTypes } from 'vue';
import type { AreaList } from './types';
export declare const areaProps: {
loading: BooleanConstructor;
readonly: BooleanConstructor;
allowHtml: BooleanConstructor;
optionHeight: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
showToolbar: {
type: BooleanConstructor;
default: true;
};
swipeDuration: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
visibleOptionNum: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
} & {
title: StringConstructor;
cancelButtonText: StringConstructor;
confirmButtonText: StringConstructor;
} & {
modelValue: StringConstructor;
columnsNum: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
columnsPlaceholder: {
type: PropType<string[]>;
default: () => never[];
};
areaList: {
type: PropType<AreaList>;
default: () => {};
};
};
export type AreaProps = ExtractPropTypes<typeof areaProps>;
declare const _default: import("vue").DefineComponent<{
loading: BooleanConstructor;
readonly: BooleanConstructor;
allowHtml: BooleanConstructor;
optionHeight: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
showToolbar: {
type: BooleanConstructor;
default: true;
};
swipeDuration: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
visibleOptionNum: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
} & {
title: StringConstructor;
cancelButtonText: StringConstructor;
confirmButtonText: StringConstructor;
} & {
modelValue: StringConstructor;
columnsNum: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
columnsPlaceholder: {
type: PropType<string[]>;
default: () => never[];
};
areaList: {
type: PropType<AreaList>;
default: () => {};
};
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "cancel" | "change" | "confirm")[], "update:modelValue" | "cancel" | "change" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
loading: BooleanConstructor;
readonly: BooleanConstructor;
allowHtml: BooleanConstructor;
optionHeight: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
showToolbar: {
type: BooleanConstructor;
default: true;
};
swipeDuration: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
visibleOptionNum: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
} & {
title: StringConstructor;
cancelButtonText: StringConstructor;
confirmButtonText: StringConstructor;
} & {
modelValue: StringConstructor;
columnsNum: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
columnsPlaceholder: {
type: PropType<string[]>;
default: () => never[];
};
areaList: {
type: PropType<AreaList>;
default: () => {};
};
}>> & {
onChange?: ((...args: any[]) => any) | undefined;
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
onCancel?: ((...args: any[]) => any) | undefined;
onConfirm?: ((...args: any[]) => any) | undefined;
}, {
readonly: boolean;
loading: boolean;
allowHtml: boolean;
optionHeight: string | number;
showToolbar: boolean;
swipeDuration: string | number;
visibleOptionNum: string | number;
columnsNum: string | number;
columnsPlaceholder: string[];
areaList: AreaList;
}>;
export default _default;
+77
View File
@@ -0,0 +1,77 @@
import { createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
import { ref, watch, computed, defineComponent } from "vue";
import { pick, extend, makeArrayProp, makeNumericProp, createNamespace } from "../utils/index.mjs";
import { pickerSharedProps } from "../picker/Picker.mjs";
import { INHERIT_PROPS, INHERIT_SLOTS, formatDataForCascade } from "./utils.mjs";
import { useExpose } from "../composables/use-expose.mjs";
import { Picker } from "../picker/index.mjs";
const [name, bem] = createNamespace("area");
const areaProps = extend({}, pickerSharedProps, {
modelValue: String,
columnsNum: makeNumericProp(3),
columnsPlaceholder: makeArrayProp(),
areaList: {
type: Object,
default: () => ({})
}
});
var stdin_default = defineComponent({
name,
props: areaProps,
emits: ["change", "confirm", "cancel", "update:modelValue"],
setup(props, {
emit,
slots
}) {
const codes = ref([]);
const picker = ref();
const columns = computed(() => formatDataForCascade(props));
const onChange = (...args) => emit("change", ...args);
const onCancel = (...args) => emit("cancel", ...args);
const onConfirm = (...args) => emit("confirm", ...args);
watch(codes, (newCodes) => {
const lastCode = newCodes.length ? newCodes[newCodes.length - 1] : "";
if (lastCode && lastCode !== props.modelValue) {
emit("update:modelValue", lastCode);
}
}, {
deep: true
});
watch(() => props.modelValue, (newCode) => {
if (newCode) {
const lastCode = codes.value.length ? codes.value[codes.value.length - 1] : "";
if (newCode !== lastCode) {
codes.value = [`${newCode.slice(0, 2)}0000`, `${newCode.slice(0, 4)}00`, newCode].slice(0, +props.columnsNum);
}
} else {
codes.value = [];
}
}, {
immediate: true
});
useExpose({
confirm: () => {
var _a;
return (_a = picker.value) == null ? void 0 : _a.confirm();
},
getSelectedOptions: () => {
var _a;
return ((_a = picker.value) == null ? void 0 : _a.getSelectedOptions()) || [];
}
});
return () => _createVNode(Picker, _mergeProps({
"ref": picker,
"modelValue": codes.value,
"onUpdate:modelValue": ($event) => codes.value = $event,
"class": bem(),
"columns": columns.value,
"onChange": onChange,
"onCancel": onCancel,
"onConfirm": onConfirm
}, pick(props, INHERIT_PROPS)), pick(slots, INHERIT_SLOTS));
}
});
export {
areaProps,
stdin_default as default
};
+102
View File
@@ -0,0 +1,102 @@
export declare const Area: import("../utils").WithInstall<import("vue").DefineComponent<{
loading: BooleanConstructor;
readonly: BooleanConstructor;
allowHtml: BooleanConstructor;
optionHeight: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
showToolbar: {
type: BooleanConstructor;
default: true;
};
swipeDuration: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
visibleOptionNum: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
} & {
title: StringConstructor;
cancelButtonText: StringConstructor;
confirmButtonText: StringConstructor;
} & {
modelValue: StringConstructor;
columnsNum: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
columnsPlaceholder: {
type: import("vue").PropType<string[]>;
default: () => never[];
};
areaList: {
type: import("vue").PropType<import("./types").AreaList>;
default: () => {};
};
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "cancel" | "change" | "confirm")[], "update:modelValue" | "cancel" | "change" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
loading: BooleanConstructor;
readonly: BooleanConstructor;
allowHtml: BooleanConstructor;
optionHeight: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
showToolbar: {
type: BooleanConstructor;
default: true;
};
swipeDuration: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
visibleOptionNum: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
} & {
title: StringConstructor;
cancelButtonText: StringConstructor;
confirmButtonText: StringConstructor;
} & {
modelValue: StringConstructor;
columnsNum: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
columnsPlaceholder: {
type: import("vue").PropType<string[]>;
default: () => never[];
};
areaList: {
type: import("vue").PropType<import("./types").AreaList>;
default: () => {};
};
}>> & {
onChange?: ((...args: any[]) => any) | undefined;
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
onCancel?: ((...args: any[]) => any) | undefined;
onConfirm?: ((...args: any[]) => any) | undefined;
}, {
readonly: boolean;
loading: boolean;
allowHtml: boolean;
optionHeight: string | number;
showToolbar: boolean;
swipeDuration: string | number;
visibleOptionNum: string | number;
columnsNum: string | number;
columnsPlaceholder: string[];
areaList: import("./types").AreaList;
}>>;
export default Area;
export { areaProps } from './Area';
export type { AreaProps } from './Area';
export type { AreaList, AreaInstance } from './types';
declare module 'vue' {
interface GlobalComponents {
VanArea: typeof Area;
}
}
+10
View File
@@ -0,0 +1,10 @@
import { withInstall } from "../utils/index.mjs";
import _Area from "./Area.mjs";
const Area = withInstall(_Area);
var stdin_default = Area;
import { areaProps } from "./Area.mjs";
export {
Area,
areaProps,
stdin_default as default
};
+1
View File
@@ -0,0 +1 @@
export {};
+10
View File
@@ -0,0 +1,10 @@
import "../../style/base.css";
import "../../badge/index.css";
import "../../loading/index.css";
import "../../sticky/index.css";
import "../../swipe/index.css";
import "../../swipe-item/index.css";
import "../../tabs/index.css";
import "../../tab/index.css";
import "../../picker/index.css";
import "../../picker-group/index.css";
+9
View File
@@ -0,0 +1,9 @@
import type { ComponentPublicInstance } from 'vue';
import { PickerExpose } from '../picker/types';
import type { AreaProps } from './Area';
export type AreaList = {
city_list: Record<string, string>;
county_list: Record<string, string>;
province_list: Record<string, string>;
};
export type AreaInstance = ComponentPublicInstance<AreaProps, PickerExpose>;
View File
+6
View File
@@ -0,0 +1,6 @@
import type { AreaProps } from '.';
import type { PickerOption } from '../picker';
export declare const AREA_EMPTY_CODE = "000000";
export declare const INHERIT_SLOTS: readonly ["title", "cancel", "confirm", "toolbar", "columns-top", "columns-bottom"];
export declare const INHERIT_PROPS: readonly ["title", "loading", "readonly", "optionHeight", "swipeDuration", "visibleOptionNum", "cancelButtonText", "confirmButtonText"];
export declare function formatDataForCascade({ areaList, columnsNum, columnsPlaceholder: placeholder, }: AreaProps): PickerOption[];
+92
View File
@@ -0,0 +1,92 @@
const AREA_EMPTY_CODE = "000000";
const INHERIT_SLOTS = [
"title",
"cancel",
"confirm",
"toolbar",
"columns-top",
"columns-bottom"
];
const INHERIT_PROPS = [
"title",
"loading",
"readonly",
"optionHeight",
"swipeDuration",
"visibleOptionNum",
"cancelButtonText",
"confirmButtonText"
];
const makeOption = (text = "", value = AREA_EMPTY_CODE, children = void 0) => ({
text,
value,
children
});
function formatDataForCascade({
areaList,
columnsNum,
columnsPlaceholder: placeholder
}) {
const {
city_list: city = {},
county_list: county = {},
province_list: province = {}
} = areaList;
const showCity = +columnsNum > 1;
const showCounty = +columnsNum > 2;
const getProvinceChildren = () => {
if (showCity) {
return placeholder.length ? [
makeOption(
placeholder[0],
AREA_EMPTY_CODE,
showCounty ? [] : void 0
)
] : [];
}
};
const provinceMap = /* @__PURE__ */ new Map();
Object.keys(province).forEach((code) => {
provinceMap.set(
code.slice(0, 2),
makeOption(province[code], code, getProvinceChildren())
);
});
const cityMap = /* @__PURE__ */ new Map();
if (showCity) {
const getCityChildren = () => {
if (showCounty) {
return placeholder.length ? [makeOption(placeholder[1])] : [];
}
};
Object.keys(city).forEach((code) => {
const option = makeOption(city[code], code, getCityChildren());
cityMap.set(code.slice(0, 4), option);
const province2 = provinceMap.get(code.slice(0, 2));
if (province2) {
province2.children.push(option);
}
});
}
if (showCounty) {
Object.keys(county).forEach((code) => {
const city2 = cityMap.get(code.slice(0, 4));
if (city2) {
city2.children.push(makeOption(county[code], code));
}
});
}
const options = Array.from(provinceMap.values());
if (placeholder.length) {
const county2 = showCounty ? [makeOption(placeholder[2])] : void 0;
const city2 = showCity ? [makeOption(placeholder[1], AREA_EMPTY_CODE, county2)] : void 0;
options.unshift(makeOption(placeholder[0], AREA_EMPTY_CODE, city2));
}
return options;
}
export {
AREA_EMPTY_CODE,
INHERIT_PROPS,
INHERIT_SLOTS,
formatDataForCascade
};