first commit

This commit is contained in:
2025-12-29 14:59:44 +08:00
commit 10c3fbb0d7
5315 changed files with 795443 additions and 0 deletions

68
node_modules/vant/es/checkbox/Checkbox.d.ts generated vendored Normal file
View File

@@ -0,0 +1,68 @@
import { type PropType, type ExtractPropTypes } from 'vue';
import { type CheckerShape } from './Checker';
export declare const checkboxProps: {
name: PropType<unknown>;
disabled: BooleanConstructor;
iconSize: (NumberConstructor | StringConstructor)[];
modelValue: PropType<unknown>;
checkedColor: StringConstructor;
labelPosition: PropType<import("./Checker").CheckerLabelPosition>;
labelDisabled: BooleanConstructor;
} & {
shape: PropType<CheckerShape>;
bindGroup: {
type: BooleanConstructor;
default: true;
};
indeterminate: {
type: PropType<boolean | null>;
default: null;
};
};
export type CheckboxProps = ExtractPropTypes<typeof checkboxProps>;
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
name: PropType<unknown>;
disabled: BooleanConstructor;
iconSize: (NumberConstructor | StringConstructor)[];
modelValue: PropType<unknown>;
checkedColor: StringConstructor;
labelPosition: PropType<import("./Checker").CheckerLabelPosition>;
labelDisabled: BooleanConstructor;
} & {
shape: PropType<CheckerShape>;
bindGroup: {
type: BooleanConstructor;
default: true;
};
indeterminate: {
type: PropType<boolean | null>;
default: null;
};
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change")[], "update:modelValue" | "change", import("vue").PublicProps, Readonly<ExtractPropTypes<{
name: PropType<unknown>;
disabled: BooleanConstructor;
iconSize: (NumberConstructor | StringConstructor)[];
modelValue: PropType<unknown>;
checkedColor: StringConstructor;
labelPosition: PropType<import("./Checker").CheckerLabelPosition>;
labelDisabled: BooleanConstructor;
} & {
shape: PropType<CheckerShape>;
bindGroup: {
type: BooleanConstructor;
default: true;
};
indeterminate: {
type: PropType<boolean | null>;
default: null;
};
}>> & Readonly<{
onChange?: ((...args: any[]) => any) | undefined;
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
}>, {
disabled: boolean;
labelDisabled: boolean;
bindGroup: boolean;
indeterminate: boolean | null;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
export default _default;

89
node_modules/vant/es/checkbox/Checkbox.mjs generated vendored Normal file
View File

@@ -0,0 +1,89 @@
import { watch, computed, defineComponent, mergeProps as _mergeProps, createVNode as _createVNode } from "vue";
import { pick, extend, truthProp, createNamespace } from "../utils/index.mjs";
import { CHECKBOX_GROUP_KEY } from "../checkbox-group/CheckboxGroup.mjs";
import { useParent, useCustomFieldValue } from "@vant/use";
import { useExpose } from "../composables/use-expose.mjs";
import Checker, { checkerProps } from "./Checker.mjs";
const [name, bem] = createNamespace("checkbox");
const checkboxProps = extend({}, checkerProps, {
shape: String,
bindGroup: truthProp,
indeterminate: {
type: Boolean,
default: null
}
});
var stdin_default = defineComponent({
name,
props: checkboxProps,
emits: ["change", "update:modelValue"],
setup(props, {
emit,
slots
}) {
const {
parent
} = useParent(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 = 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);
}
if (props.indeterminate !== null) emit("change", newValue);
};
watch(() => props.modelValue, (value) => {
if (props.indeterminate === null) emit("change", value);
});
useExpose({
toggle,
props,
checked
});
useCustomFieldValue(() => props.modelValue);
return () => _createVNode(Checker, _mergeProps({
"bem": bem,
"role": "checkbox",
"parent": parent,
"checked": checked.value,
"onToggle": toggle
}, props), pick(slots, ["default", "icon"]));
}
});
export {
checkboxProps,
stdin_default as default
};

87
node_modules/vant/es/checkbox/Checker.d.ts generated vendored Normal file
View File

@@ -0,0 +1,87 @@
import { type PropType } from 'vue';
import { type Numeric } from '../utils';
import type { RadioShape } from '../radio';
export type CheckerShape = 'square' | 'round';
export type CheckerDirection = 'horizontal' | 'vertical';
export type CheckerLabelPosition = 'left' | 'right';
export type CheckerParent = {
props: {
max?: Numeric;
shape?: CheckerShape | RadioShape;
disabled?: boolean;
iconSize?: Numeric;
direction?: CheckerDirection;
modelValue?: unknown | unknown[];
checkedColor?: string;
};
};
export declare const checkerProps: {
name: PropType<unknown>;
disabled: BooleanConstructor;
iconSize: (NumberConstructor | StringConstructor)[];
modelValue: PropType<unknown>;
checkedColor: StringConstructor;
labelPosition: PropType<CheckerLabelPosition>;
labelDisabled: BooleanConstructor;
};
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
name: PropType<unknown>;
disabled: BooleanConstructor;
iconSize: (NumberConstructor | StringConstructor)[];
modelValue: PropType<unknown>;
checkedColor: StringConstructor;
labelPosition: PropType<CheckerLabelPosition>;
labelDisabled: BooleanConstructor;
} & {
bem: {
type: FunctionConstructor;
required: true;
};
role: StringConstructor;
shape: PropType<CheckerShape | RadioShape>;
parent: PropType<CheckerParent | null>;
checked: BooleanConstructor;
bindGroup: {
type: BooleanConstructor;
default: true;
};
indeterminate: {
type: PropType<boolean | null>;
default: null;
};
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "toggle")[], "click" | "toggle", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
name: PropType<unknown>;
disabled: BooleanConstructor;
iconSize: (NumberConstructor | StringConstructor)[];
modelValue: PropType<unknown>;
checkedColor: StringConstructor;
labelPosition: PropType<CheckerLabelPosition>;
labelDisabled: BooleanConstructor;
} & {
bem: {
type: FunctionConstructor;
required: true;
};
role: StringConstructor;
shape: PropType<CheckerShape | RadioShape>;
parent: PropType<CheckerParent | null>;
checked: BooleanConstructor;
bindGroup: {
type: BooleanConstructor;
default: true;
};
indeterminate: {
type: PropType<boolean | null>;
default: null;
};
}>> & Readonly<{
onClick?: ((...args: any[]) => any) | undefined;
onToggle?: ((...args: any[]) => any) | undefined;
}>, {
checked: boolean;
disabled: boolean;
labelDisabled: boolean;
bindGroup: boolean;
indeterminate: boolean | null;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
export default _default;

142
node_modules/vant/es/checkbox/Checker.mjs generated vendored Normal file
View File

@@ -0,0 +1,142 @@
import { ref, computed, defineComponent, createVNode as _createVNode } from "vue";
import { extend, addUnit, truthProp, numericProp, unknownProp, makeRequiredProp } from "../utils/index.mjs";
import { Icon } from "../icon/index.mjs";
const checkerProps = {
name: unknownProp,
disabled: Boolean,
iconSize: numericProp,
modelValue: unknownProp,
checkedColor: String,
labelPosition: String,
labelDisabled: Boolean
};
var stdin_default = defineComponent({
props: extend({}, checkerProps, {
bem: makeRequiredProp(Function),
role: String,
shape: String,
parent: Object,
checked: Boolean,
bindGroup: truthProp,
indeterminate: {
type: Boolean,
default: null
}
}),
emits: ["click", "toggle"],
setup(props, {
emit,
slots
}) {
const iconRef = ref();
const getParentProp = (name) => {
if (props.parent && props.bindGroup) {
return props.parent.props[name];
}
};
const disabled = computed(() => {
if (props.parent && props.bindGroup) {
const disabled2 = getParentProp("disabled") || props.disabled;
if (props.role === "checkbox") {
const checkedCount = getParentProp("modelValue").length;
const max = getParentProp("max");
const overlimit = max && checkedCount >= +max;
return disabled2 || overlimit && !props.checked;
}
return disabled2;
}
return props.disabled;
});
const direction = computed(() => getParentProp("direction"));
const iconStyle = computed(() => {
const checkedColor = props.checkedColor || getParentProp("checkedColor");
if (checkedColor && (props.checked || props.indeterminate) && !disabled.value) {
return {
borderColor: checkedColor,
backgroundColor: checkedColor
};
}
});
const shape = computed(() => {
return props.shape || getParentProp("shape") || "round";
});
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 = () => {
var _a, _b;
const {
bem,
checked,
indeterminate
} = props;
const iconSize = props.iconSize || getParentProp("iconSize");
return _createVNode("div", {
"ref": iconRef,
"class": bem("icon", [shape.value, {
disabled: disabled.value,
checked,
indeterminate
}]),
"style": shape.value !== "dot" ? {
fontSize: addUnit(iconSize)
} : {
width: addUnit(iconSize),
height: addUnit(iconSize),
borderColor: (_a = iconStyle.value) == null ? void 0 : _a.borderColor
}
}, [slots.icon ? slots.icon({
checked,
disabled: disabled.value
}) : shape.value !== "dot" ? _createVNode(Icon, {
"name": indeterminate ? "minus" : "success",
"style": iconStyle.value
}, null) : _createVNode("div", {
"class": bem("icon--dot__icon"),
"style": {
backgroundColor: (_b = iconStyle.value) == null ? void 0 : _b.backgroundColor
}
}, null)]);
};
const renderLabel = () => {
const {
checked
} = props;
if (slots.default) {
return _createVNode("span", {
"class": props.bem("label", [props.labelPosition, {
disabled: disabled.value
}])
}, [slots.default({
checked,
disabled: disabled.value
})]);
}
};
return () => {
const nodes = props.labelPosition === "left" ? [renderLabel(), renderIcon()] : [renderIcon(), renderLabel()];
return _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]);
};
}
});
export {
checkerProps,
stdin_default as default
};

1
node_modules/vant/es/checkbox/index.css generated vendored Normal file
View File

@@ -0,0 +1 @@
:root,:host{--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--indeterminate .van-icon{display:flex;align-items:center;justify-content:center;color:var(--van-white);border-color:var(--van-checkbox-checked-icon-color);background-color:var(--van-checkbox-checked-icon-color)}.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)}

54
node_modules/vant/es/checkbox/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,54 @@
export declare const Checkbox: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
name: import("vue").PropType<unknown>;
disabled: BooleanConstructor;
iconSize: (NumberConstructor | StringConstructor)[];
modelValue: import("vue").PropType<unknown>;
checkedColor: StringConstructor;
labelPosition: import("vue").PropType<import("./Checker").CheckerLabelPosition>;
labelDisabled: BooleanConstructor;
} & {
shape: import("vue").PropType<import("./Checker").CheckerShape>;
bindGroup: {
type: BooleanConstructor;
default: true;
};
indeterminate: {
type: import("vue").PropType<boolean | null>;
default: null;
};
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change")[], "update:modelValue" | "change", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
name: import("vue").PropType<unknown>;
disabled: BooleanConstructor;
iconSize: (NumberConstructor | StringConstructor)[];
modelValue: import("vue").PropType<unknown>;
checkedColor: StringConstructor;
labelPosition: import("vue").PropType<import("./Checker").CheckerLabelPosition>;
labelDisabled: BooleanConstructor;
} & {
shape: import("vue").PropType<import("./Checker").CheckerShape>;
bindGroup: {
type: BooleanConstructor;
default: true;
};
indeterminate: {
type: import("vue").PropType<boolean | null>;
default: null;
};
}>> & Readonly<{
onChange?: ((...args: any[]) => any) | undefined;
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
}>, {
disabled: boolean;
labelDisabled: boolean;
bindGroup: boolean;
indeterminate: boolean | null;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
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;
}
}

10
node_modules/vant/es/checkbox/index.mjs generated vendored Normal file
View File

@@ -0,0 +1,10 @@
import { withInstall } from "../utils/index.mjs";
import _Checkbox from "./Checkbox.mjs";
const Checkbox = withInstall(_Checkbox);
var stdin_default = Checkbox;
import { checkboxProps } from "./Checkbox.mjs";
export {
Checkbox,
checkboxProps,
stdin_default as default
};

1
node_modules/vant/es/checkbox/style/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export {};

5
node_modules/vant/es/checkbox/style/index.mjs generated vendored Normal file
View File

@@ -0,0 +1,5 @@
import "../../style/base.css";
import "../../badge/index.css";
import "../../icon/index.css";
import "../../checkbox-group/index.css";
import "../index.css";

24
node_modules/vant/es/checkbox/types.d.ts generated vendored Normal file
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;
};

0
node_modules/vant/es/checkbox/types.mjs generated vendored Normal file
View File