first commit
This commit is contained in:
57
node_modules/vant/es/checkbox-group/CheckboxGroup.d.ts
generated
vendored
Normal file
57
node_modules/vant/es/checkbox-group/CheckboxGroup.d.ts
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
import { type PropType, type InjectionKey, type ExtractPropTypes } from 'vue';
|
||||
import type { CheckerShape, CheckerDirection } from '../checkbox/Checker';
|
||||
import type { CheckboxGroupProvide } from './types';
|
||||
export declare const checkboxGroupProps: {
|
||||
max: (NumberConstructor | StringConstructor)[];
|
||||
shape: {
|
||||
type: PropType<CheckerShape>;
|
||||
default: CheckerShape;
|
||||
};
|
||||
disabled: BooleanConstructor;
|
||||
iconSize: (NumberConstructor | StringConstructor)[];
|
||||
direction: PropType<CheckerDirection>;
|
||||
modelValue: {
|
||||
type: PropType<unknown[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
checkedColor: StringConstructor;
|
||||
};
|
||||
export type CheckboxGroupProps = ExtractPropTypes<typeof checkboxGroupProps>;
|
||||
export declare const CHECKBOX_GROUP_KEY: InjectionKey<CheckboxGroupProvide>;
|
||||
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
||||
max: (NumberConstructor | StringConstructor)[];
|
||||
shape: {
|
||||
type: PropType<CheckerShape>;
|
||||
default: CheckerShape;
|
||||
};
|
||||
disabled: BooleanConstructor;
|
||||
iconSize: (NumberConstructor | StringConstructor)[];
|
||||
direction: PropType<CheckerDirection>;
|
||||
modelValue: {
|
||||
type: PropType<unknown[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
checkedColor: StringConstructor;
|
||||
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change")[], "update:modelValue" | "change", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
||||
max: (NumberConstructor | StringConstructor)[];
|
||||
shape: {
|
||||
type: PropType<CheckerShape>;
|
||||
default: CheckerShape;
|
||||
};
|
||||
disabled: BooleanConstructor;
|
||||
iconSize: (NumberConstructor | StringConstructor)[];
|
||||
direction: PropType<CheckerDirection>;
|
||||
modelValue: {
|
||||
type: PropType<unknown[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
checkedColor: StringConstructor;
|
||||
}>> & Readonly<{
|
||||
onChange?: ((...args: any[]) => any) | undefined;
|
||||
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
||||
}>, {
|
||||
disabled: boolean;
|
||||
shape: CheckerShape;
|
||||
modelValue: unknown[];
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
||||
export default _default;
|
||||
72
node_modules/vant/es/checkbox-group/CheckboxGroup.mjs
generated
vendored
Normal file
72
node_modules/vant/es/checkbox-group/CheckboxGroup.mjs
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
import { watch, defineComponent, createVNode as _createVNode } from "vue";
|
||||
import { numericProp, makeArrayProp, makeStringProp, createNamespace } from "../utils/index.mjs";
|
||||
import { useChildren, useCustomFieldValue } from "@vant/use";
|
||||
import { useExpose } from "../composables/use-expose.mjs";
|
||||
const [name, bem] = createNamespace("checkbox-group");
|
||||
const checkboxGroupProps = {
|
||||
max: numericProp,
|
||||
shape: makeStringProp("round"),
|
||||
disabled: Boolean,
|
||||
iconSize: numericProp,
|
||||
direction: String,
|
||||
modelValue: makeArrayProp(),
|
||||
checkedColor: String
|
||||
};
|
||||
const CHECKBOX_GROUP_KEY = Symbol(name);
|
||||
var stdin_default = defineComponent({
|
||||
name,
|
||||
props: checkboxGroupProps,
|
||||
emits: ["change", "update:modelValue"],
|
||||
setup(props, {
|
||||
emit,
|
||||
slots
|
||||
}) {
|
||||
const {
|
||||
children,
|
||||
linkChildren
|
||||
} = useChildren(CHECKBOX_GROUP_KEY);
|
||||
const updateValue = (value) => emit("update:modelValue", value);
|
||||
const toggleAll = (options = {}) => {
|
||||
if (typeof options === "boolean") {
|
||||
options = {
|
||||
checked: options
|
||||
};
|
||||
}
|
||||
const {
|
||||
checked,
|
||||
skipDisabled
|
||||
} = options;
|
||||
const checkedChildren = children.filter((item) => {
|
||||
if (!item.props.bindGroup) {
|
||||
return false;
|
||||
}
|
||||
if (item.props.disabled && skipDisabled) {
|
||||
return item.checked.value;
|
||||
}
|
||||
return checked != null ? checked : !item.checked.value;
|
||||
});
|
||||
const names = checkedChildren.map((item) => item.name);
|
||||
updateValue(names);
|
||||
};
|
||||
watch(() => props.modelValue, (value) => emit("change", value));
|
||||
useExpose({
|
||||
toggleAll
|
||||
});
|
||||
useCustomFieldValue(() => props.modelValue);
|
||||
linkChildren({
|
||||
props,
|
||||
updateValue
|
||||
});
|
||||
return () => {
|
||||
var _a;
|
||||
return _createVNode("div", {
|
||||
"class": bem([props.direction])
|
||||
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
||||
};
|
||||
}
|
||||
});
|
||||
export {
|
||||
CHECKBOX_GROUP_KEY,
|
||||
checkboxGroupProps,
|
||||
stdin_default as default
|
||||
};
|
||||
1
node_modules/vant/es/checkbox-group/index.css
generated
vendored
Normal file
1
node_modules/vant/es/checkbox-group/index.css
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.van-checkbox-group--horizontal{display:flex;flex-wrap:wrap}
|
||||
45
node_modules/vant/es/checkbox-group/index.d.ts
generated
vendored
Normal file
45
node_modules/vant/es/checkbox-group/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
export declare const CheckboxGroup: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
||||
max: (NumberConstructor | StringConstructor)[];
|
||||
shape: {
|
||||
type: import("vue").PropType<import("../checkbox/Checker").CheckerShape>;
|
||||
default: import("../checkbox/Checker").CheckerShape;
|
||||
};
|
||||
disabled: BooleanConstructor;
|
||||
iconSize: (NumberConstructor | StringConstructor)[];
|
||||
direction: import("vue").PropType<import("../checkbox/Checker").CheckerDirection>;
|
||||
modelValue: {
|
||||
type: import("vue").PropType<unknown[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
checkedColor: StringConstructor;
|
||||
}>, () => 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<{
|
||||
max: (NumberConstructor | StringConstructor)[];
|
||||
shape: {
|
||||
type: import("vue").PropType<import("../checkbox/Checker").CheckerShape>;
|
||||
default: import("../checkbox/Checker").CheckerShape;
|
||||
};
|
||||
disabled: BooleanConstructor;
|
||||
iconSize: (NumberConstructor | StringConstructor)[];
|
||||
direction: import("vue").PropType<import("../checkbox/Checker").CheckerDirection>;
|
||||
modelValue: {
|
||||
type: import("vue").PropType<unknown[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
checkedColor: StringConstructor;
|
||||
}>> & Readonly<{
|
||||
onChange?: ((...args: any[]) => any) | undefined;
|
||||
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
||||
}>, {
|
||||
disabled: boolean;
|
||||
shape: import("../checkbox/Checker").CheckerShape;
|
||||
modelValue: unknown[];
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
||||
export default CheckboxGroup;
|
||||
export { checkboxGroupProps } from './CheckboxGroup';
|
||||
export type { CheckboxGroupProps } from './CheckboxGroup';
|
||||
export type { CheckboxGroupInstance, CheckboxGroupDirection, CheckboxGroupToggleAllOptions, } from './types';
|
||||
declare module 'vue' {
|
||||
interface GlobalComponents {
|
||||
VanCheckboxGroup: typeof CheckboxGroup;
|
||||
}
|
||||
}
|
||||
10
node_modules/vant/es/checkbox-group/index.mjs
generated
vendored
Normal file
10
node_modules/vant/es/checkbox-group/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { withInstall } from "../utils/index.mjs";
|
||||
import _CheckboxGroup from "./CheckboxGroup.mjs";
|
||||
const CheckboxGroup = withInstall(_CheckboxGroup);
|
||||
var stdin_default = CheckboxGroup;
|
||||
import { checkboxGroupProps } from "./CheckboxGroup.mjs";
|
||||
export {
|
||||
CheckboxGroup,
|
||||
checkboxGroupProps,
|
||||
stdin_default as default
|
||||
};
|
||||
1
node_modules/vant/es/checkbox-group/style/index.d.ts
generated
vendored
Normal file
1
node_modules/vant/es/checkbox-group/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
2
node_modules/vant/es/checkbox-group/style/index.mjs
generated
vendored
Normal file
2
node_modules/vant/es/checkbox-group/style/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import "../../style/base.css";
|
||||
import "../index.css";
|
||||
16
node_modules/vant/es/checkbox-group/types.d.ts
generated
vendored
Normal file
16
node_modules/vant/es/checkbox-group/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import type { ComponentPublicInstance } from 'vue';
|
||||
import type { CheckboxGroupProps } from './CheckboxGroup';
|
||||
import type { CheckerParent, CheckerDirection } from '../checkbox/Checker';
|
||||
export type CheckboxGroupDirection = CheckerDirection;
|
||||
export type CheckboxGroupToggleAllOptions = boolean | {
|
||||
checked?: boolean;
|
||||
skipDisabled?: boolean;
|
||||
};
|
||||
export type CheckboxGroupExpose = {
|
||||
toggleAll: (options?: CheckboxGroupToggleAllOptions) => void;
|
||||
};
|
||||
export type CheckboxGroupInstance = ComponentPublicInstance<CheckboxGroupProps, CheckboxGroupExpose>;
|
||||
export type CheckboxGroupProvide = CheckerParent & {
|
||||
props: CheckboxGroupProps;
|
||||
updateValue: (value: unknown[]) => void;
|
||||
};
|
||||
0
node_modules/vant/es/checkbox-group/types.mjs
generated
vendored
Normal file
0
node_modules/vant/es/checkbox-group/types.mjs
generated
vendored
Normal file
Reference in New Issue
Block a user