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
+64
View File
@@ -0,0 +1,64 @@
import { type ExtractPropTypes } from 'vue';
export declare const checkboxProps: {
name: import("vue").PropType<unknown>;
shape: {
type: import("vue").PropType<import("./Checker").CheckerShape>;
default: import("./Checker").CheckerShape;
};
disabled: BooleanConstructor;
iconSize: (NumberConstructor | StringConstructor)[];
modelValue: import("vue").PropType<unknown>;
checkedColor: StringConstructor;
labelPosition: import("vue").PropType<import("./Checker").CheckerLabelPosition>;
labelDisabled: BooleanConstructor;
} & {
bindGroup: {
type: BooleanConstructor;
default: true;
};
};
export type CheckboxProps = ExtractPropTypes<typeof checkboxProps>;
declare const _default: import("vue").DefineComponent<{
name: import("vue").PropType<unknown>;
shape: {
type: import("vue").PropType<import("./Checker").CheckerShape>;
default: import("./Checker").CheckerShape;
};
disabled: BooleanConstructor;
iconSize: (NumberConstructor | StringConstructor)[];
modelValue: import("vue").PropType<unknown>;
checkedColor: StringConstructor;
labelPosition: import("vue").PropType<import("./Checker").CheckerLabelPosition>;
labelDisabled: BooleanConstructor;
} & {
bindGroup: {
type: BooleanConstructor;
default: true;
};
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change")[], "update:modelValue" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
name: import("vue").PropType<unknown>;
shape: {
type: import("vue").PropType<import("./Checker").CheckerShape>;
default: import("./Checker").CheckerShape;
};
disabled: BooleanConstructor;
iconSize: (NumberConstructor | StringConstructor)[];
modelValue: import("vue").PropType<unknown>;
checkedColor: StringConstructor;
labelPosition: import("vue").PropType<import("./Checker").CheckerLabelPosition>;
labelDisabled: BooleanConstructor;
} & {
bindGroup: {
type: BooleanConstructor;
default: true;
};
}>> & {
onChange?: ((...args: any[]) => any) | undefined;
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
}, {
disabled: boolean;
shape: import("./Checker").CheckerShape;
labelDisabled: boolean;
bindGroup: boolean;
}>;
export default _default;
+111
View File
@@ -0,0 +1,111 @@
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 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 __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, {
checkboxProps: () => checkboxProps,
default: () => stdin_default
});
module.exports = __toCommonJS(stdin_exports);
var import_vue = require("vue");
var import_vue2 = require("vue");
var import_utils = require("../utils");
var import_CheckboxGroup = require("../checkbox-group/CheckboxGroup");
var import_use = require("@vant/use");
var import_use_expose = require("../composables/use-expose");
var import_Checker = __toESM(require("./Checker"));
const [name, bem] = (0, import_utils.createNamespace)("checkbox");
const checkboxProps = (0, import_utils.extend)({}, import_Checker.checkerProps, {
bindGroup: import_utils.truthProp
});
var stdin_default = (0, import_vue2.defineComponent)({
name,
props: checkboxProps,
emits: ["change", "update:modelValue"],
setup(props, {
emit,
slots
}) {
const {
parent
} = (0, import_use.useParent)(import_CheckboxGroup.CHECKBOX_GROUP_KEY);
const setParentValue = (checked2) => {
const {
name: name2
} = props;
const {
max,
modelValue
} = parent.props;
const value = modelValue.slice();
if (checked2) {
const overlimit = max && value.length >= +max;
if (!overlimit && !value.includes(name2)) {
value.push(name2);
if (props.bindGroup) {
parent.updateValue(value);
}
}
} else {
const index = value.indexOf(name2);
if (index !== -1) {
value.splice(index, 1);
if (props.bindGroup) {
parent.updateValue(value);
}
}
}
};
const checked = (0, import_vue2.computed)(() => {
if (parent && props.bindGroup) {
return parent.props.modelValue.indexOf(props.name) !== -1;
}
return !!props.modelValue;
});
const toggle = (newValue = !checked.value) => {
if (parent && props.bindGroup) {
setParentValue(newValue);
} else {
emit("update:modelValue", newValue);
}
};
(0, import_vue2.watch)(() => props.modelValue, (value) => emit("change", value));
(0, import_use_expose.useExpose)({
toggle,
props,
checked
});
(0, import_use.useCustomFieldValue)(() => props.modelValue);
return () => (0, import_vue.createVNode)(import_Checker.default, (0, import_vue.mergeProps)({
"bem": bem,
"role": "checkbox",
"parent": parent,
"checked": checked.value,
"onToggle": toggle
}, props), (0, import_utils.pick)(slots, ["default", "icon"]));
}
});
+85
View File
@@ -0,0 +1,85 @@
import { type PropType } from 'vue';
import { type Numeric } from '../utils';
export type CheckerShape = 'square' | 'round';
export type CheckerDirection = 'horizontal' | 'vertical';
export type CheckerLabelPosition = 'left' | 'right';
export type CheckerParent = {
props: {
disabled?: boolean;
iconSize?: Numeric;
direction?: CheckerDirection;
checkedColor?: string;
};
};
export declare const checkerProps: {
name: PropType<unknown>;
shape: {
type: PropType<CheckerShape>;
default: CheckerShape;
};
disabled: BooleanConstructor;
iconSize: (NumberConstructor | StringConstructor)[];
modelValue: PropType<unknown>;
checkedColor: StringConstructor;
labelPosition: PropType<CheckerLabelPosition>;
labelDisabled: BooleanConstructor;
};
declare const _default: import("vue").DefineComponent<{
name: PropType<unknown>;
shape: {
type: PropType<CheckerShape>;
default: CheckerShape;
};
disabled: BooleanConstructor;
iconSize: (NumberConstructor | StringConstructor)[];
modelValue: PropType<unknown>;
checkedColor: StringConstructor;
labelPosition: PropType<CheckerLabelPosition>;
labelDisabled: BooleanConstructor;
} & {
bem: {
type: FunctionConstructor;
required: true;
};
role: StringConstructor;
parent: PropType<CheckerParent | null>;
checked: BooleanConstructor;
bindGroup: {
type: BooleanConstructor;
default: true;
};
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "toggle")[], "click" | "toggle", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
name: PropType<unknown>;
shape: {
type: PropType<CheckerShape>;
default: CheckerShape;
};
disabled: BooleanConstructor;
iconSize: (NumberConstructor | StringConstructor)[];
modelValue: PropType<unknown>;
checkedColor: StringConstructor;
labelPosition: PropType<CheckerLabelPosition>;
labelDisabled: BooleanConstructor;
} & {
bem: {
type: FunctionConstructor;
required: true;
};
role: StringConstructor;
parent: PropType<CheckerParent | null>;
checked: BooleanConstructor;
bindGroup: {
type: BooleanConstructor;
default: true;
};
}>> & {
onClick?: ((...args: any[]) => any) | undefined;
onToggle?: ((...args: any[]) => any) | undefined;
}, {
checked: boolean;
disabled: boolean;
shape: CheckerShape;
labelDisabled: boolean;
bindGroup: boolean;
}>;
export default _default;
+126
View File
@@ -0,0 +1,126 @@
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var stdin_exports = {};
__export(stdin_exports, {
checkerProps: () => checkerProps,
default: () => stdin_default
});
module.exports = __toCommonJS(stdin_exports);
var import_vue = require("vue");
var import_vue2 = require("vue");
var import_utils = require("../utils");
var import_icon = require("../icon");
const checkerProps = {
name: import_utils.unknownProp,
shape: (0, import_utils.makeStringProp)("round"),
disabled: Boolean,
iconSize: import_utils.numericProp,
modelValue: import_utils.unknownProp,
checkedColor: String,
labelPosition: String,
labelDisabled: Boolean
};
var stdin_default = (0, import_vue2.defineComponent)({
props: (0, import_utils.extend)({}, checkerProps, {
bem: (0, import_utils.makeRequiredProp)(Function),
role: String,
parent: Object,
checked: Boolean,
bindGroup: import_utils.truthProp
}),
emits: ["click", "toggle"],
setup(props, {
emit,
slots
}) {
const iconRef = (0, import_vue2.ref)();
const getParentProp = (name) => {
if (props.parent && props.bindGroup) {
return props.parent.props[name];
}
};
const disabled = (0, import_vue2.computed)(() => getParentProp("disabled") || props.disabled);
const direction = (0, import_vue2.computed)(() => getParentProp("direction"));
const iconStyle = (0, import_vue2.computed)(() => {
const checkedColor = props.checkedColor || getParentProp("checkedColor");
if (checkedColor && props.checked && !disabled.value) {
return {
borderColor: checkedColor,
backgroundColor: checkedColor
};
}
});
const onClick = (event) => {
const {
target
} = event;
const icon = iconRef.value;
const iconClicked = icon === target || (icon == null ? void 0 : icon.contains(target));
if (!disabled.value && (iconClicked || !props.labelDisabled)) {
emit("toggle");
}
emit("click", event);
};
const renderIcon = () => {
const {
bem,
shape,
checked
} = props;
const iconSize = props.iconSize || getParentProp("iconSize");
return (0, import_vue.createVNode)("div", {
"ref": iconRef,
"class": bem("icon", [shape, {
disabled: disabled.value,
checked
}]),
"style": {
fontSize: (0, import_utils.addUnit)(iconSize)
}
}, [slots.icon ? slots.icon({
checked,
disabled: disabled.value
}) : (0, import_vue.createVNode)(import_icon.Icon, {
"name": "success",
"style": iconStyle.value
}, null)]);
};
const renderLabel = () => {
if (slots.default) {
return (0, import_vue.createVNode)("span", {
"class": props.bem("label", [props.labelPosition, {
disabled: disabled.value
}])
}, [slots.default()]);
}
};
return () => {
const nodes = props.labelPosition === "left" ? [renderLabel(), renderIcon()] : [renderIcon(), renderLabel()];
return (0, import_vue.createVNode)("div", {
"role": props.role,
"class": props.bem([{
disabled: disabled.value,
"label-disabled": props.labelDisabled
}, direction.value]),
"tabindex": disabled.value ? void 0 : 0,
"aria-checked": props.checked,
"onClick": onClick
}, [nodes]);
};
}
});
+1
View File
@@ -0,0 +1 @@
:root{--van-checkbox-size: 20px;--van-checkbox-border-color: var(--van-gray-5);--van-checkbox-duration: var(--van-duration-fast);--van-checkbox-label-margin: var(--van-padding-xs);--van-checkbox-label-color: var(--van-text-color);--van-checkbox-checked-icon-color: var(--van-primary-color);--van-checkbox-disabled-icon-color: var(--van-gray-5);--van-checkbox-disabled-label-color: var(--van-text-color-3);--van-checkbox-disabled-background: var(--van-border-color)}.van-checkbox{display:flex;align-items:center;overflow:hidden;cursor:pointer;-webkit-user-select:none;user-select:none}.van-checkbox--disabled{cursor:not-allowed}.van-checkbox--label-disabled{cursor:default}.van-checkbox--horizontal{margin-right:var(--van-padding-sm)}.van-checkbox__icon{flex:none;height:1em;font-size:var(--van-checkbox-size);line-height:1em;cursor:pointer}.van-checkbox__icon .van-icon{display:block;box-sizing:border-box;width:1.25em;height:1.25em;color:transparent;font-size:.8em;line-height:1.25;text-align:center;border:1px solid var(--van-checkbox-border-color);transition-duration:var(--van-checkbox-duration);transition-property:color,border-color,background-color}.van-checkbox__icon--round .van-icon{border-radius:100%}.van-checkbox__icon--checked .van-icon{color:var(--van-white);background-color:var(--van-checkbox-checked-icon-color);border-color:var(--van-checkbox-checked-icon-color)}.van-checkbox__icon--disabled{cursor:not-allowed}.van-checkbox__icon--disabled .van-icon{background-color:var(--van-checkbox-disabled-background);border-color:var(--van-checkbox-disabled-icon-color)}.van-checkbox__icon--disabled.van-checkbox__icon--checked .van-icon{color:var(--van-checkbox-disabled-icon-color)}.van-checkbox__label{margin-left:var(--van-checkbox-label-margin);color:var(--van-checkbox-label-color);line-height:var(--van-checkbox-size)}.van-checkbox__label--left{margin:0 var(--van-checkbox-label-margin) 0 0}.van-checkbox__label--disabled{color:var(--van-checkbox-disabled-label-color)}
+52
View File
@@ -0,0 +1,52 @@
export declare const Checkbox: import("../utils").WithInstall<import("vue").DefineComponent<{
name: import("vue").PropType<unknown>;
shape: {
type: import("vue").PropType<import("./Checker").CheckerShape>;
default: import("./Checker").CheckerShape;
};
disabled: BooleanConstructor;
iconSize: (NumberConstructor | StringConstructor)[];
modelValue: import("vue").PropType<unknown>;
checkedColor: StringConstructor;
labelPosition: import("vue").PropType<import("./Checker").CheckerLabelPosition>;
labelDisabled: BooleanConstructor;
} & {
bindGroup: {
type: BooleanConstructor;
default: true;
};
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change")[], "update:modelValue" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
name: import("vue").PropType<unknown>;
shape: {
type: import("vue").PropType<import("./Checker").CheckerShape>;
default: import("./Checker").CheckerShape;
};
disabled: BooleanConstructor;
iconSize: (NumberConstructor | StringConstructor)[];
modelValue: import("vue").PropType<unknown>;
checkedColor: StringConstructor;
labelPosition: import("vue").PropType<import("./Checker").CheckerLabelPosition>;
labelDisabled: BooleanConstructor;
} & {
bindGroup: {
type: BooleanConstructor;
default: true;
};
}>> & {
onChange?: ((...args: any[]) => any) | undefined;
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
}, {
disabled: boolean;
shape: import("./Checker").CheckerShape;
labelDisabled: boolean;
bindGroup: boolean;
}>>;
export default Checkbox;
export { checkboxProps } from './Checkbox';
export type { CheckboxProps } from './Checkbox';
export type { CheckboxShape, CheckboxInstance, CheckboxThemeVars, CheckboxLabelPosition, } from './types';
declare module 'vue' {
interface GlobalComponents {
VanCheckbox: typeof Checkbox;
}
}
+39
View 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, {
Checkbox: () => Checkbox,
checkboxProps: () => import_Checkbox2.checkboxProps,
default: () => stdin_default
});
module.exports = __toCommonJS(stdin_exports);
var import_utils = require("../utils");
var import_Checkbox = __toESM(require("./Checkbox"));
var import_Checkbox2 = require("./Checkbox");
const Checkbox = (0, import_utils.withInstall)(import_Checkbox.default);
var stdin_default = Checkbox;
+1
View File
@@ -0,0 +1 @@
export {};
+5
View File
@@ -0,0 +1,5 @@
require("../../style/base.css");
require("../../badge/index.css");
require("../../icon/index.css");
require("../../checkbox-group/index.css");
require("../index.css");
+24
View File
@@ -0,0 +1,24 @@
import type { ComponentPublicInstance, ComputedRef } from 'vue';
import type { CheckboxProps } from './Checkbox';
import type { CheckerShape, CheckerLabelPosition } from './Checker';
export type CheckboxShape = CheckerShape;
export type CheckboxLabelPosition = CheckerLabelPosition;
export type CheckboxExpose = {
toggle: (newValue?: boolean) => void;
/** @private */
props: CheckboxProps;
/** @private */
checked: ComputedRef<boolean>;
};
export type CheckboxInstance = ComponentPublicInstance<CheckboxProps, CheckboxExpose>;
export type CheckboxThemeVars = {
checkboxSize?: string;
checkboxBorderColor?: string;
checkboxDuration?: string;
checkboxLabelMargin?: string;
checkboxLabelColor?: string;
checkboxCheckedIconColor?: string;
checkboxDisabledIconColor?: string;
checkboxDisabledLabelColor?: string;
checkboxDisabledBackground?: string;
};
+15
View 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);