first commit
This commit is contained in:
57
node_modules/vant/lib/checkbox-group/CheckboxGroup.d.ts
generated
vendored
Normal file
57
node_modules/vant/lib/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;
|
||||
91
node_modules/vant/lib/checkbox-group/CheckboxGroup.js
generated
vendored
Normal file
91
node_modules/vant/lib/checkbox-group/CheckboxGroup.js
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var stdin_exports = {};
|
||||
__export(stdin_exports, {
|
||||
CHECKBOX_GROUP_KEY: () => CHECKBOX_GROUP_KEY,
|
||||
checkboxGroupProps: () => checkboxGroupProps,
|
||||
default: () => stdin_default
|
||||
});
|
||||
module.exports = __toCommonJS(stdin_exports);
|
||||
var import_vue = require("vue");
|
||||
var import_utils = require("../utils");
|
||||
var import_use = require("@vant/use");
|
||||
var import_use_expose = require("../composables/use-expose");
|
||||
const [name, bem] = (0, import_utils.createNamespace)("checkbox-group");
|
||||
const checkboxGroupProps = {
|
||||
max: import_utils.numericProp,
|
||||
shape: (0, import_utils.makeStringProp)("round"),
|
||||
disabled: Boolean,
|
||||
iconSize: import_utils.numericProp,
|
||||
direction: String,
|
||||
modelValue: (0, import_utils.makeArrayProp)(),
|
||||
checkedColor: String
|
||||
};
|
||||
const CHECKBOX_GROUP_KEY = Symbol(name);
|
||||
var stdin_default = (0, import_vue.defineComponent)({
|
||||
name,
|
||||
props: checkboxGroupProps,
|
||||
emits: ["change", "update:modelValue"],
|
||||
setup(props, {
|
||||
emit,
|
||||
slots
|
||||
}) {
|
||||
const {
|
||||
children,
|
||||
linkChildren
|
||||
} = (0, import_use.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);
|
||||
};
|
||||
(0, import_vue.watch)(() => props.modelValue, (value) => emit("change", value));
|
||||
(0, import_use_expose.useExpose)({
|
||||
toggleAll
|
||||
});
|
||||
(0, import_use.useCustomFieldValue)(() => props.modelValue);
|
||||
linkChildren({
|
||||
props,
|
||||
updateValue
|
||||
});
|
||||
return () => {
|
||||
var _a;
|
||||
return (0, import_vue.createVNode)("div", {
|
||||
"class": bem([props.direction])
|
||||
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
||||
};
|
||||
}
|
||||
});
|
||||
1
node_modules/vant/lib/checkbox-group/index.css
generated
vendored
Normal file
1
node_modules/vant/lib/checkbox-group/index.css
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.van-checkbox-group--horizontal{display:flex;flex-wrap:wrap}
|
||||
45
node_modules/vant/lib/checkbox-group/index.d.ts
generated
vendored
Normal file
45
node_modules/vant/lib/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;
|
||||
}
|
||||
}
|
||||
39
node_modules/vant/lib/checkbox-group/index.js
generated
vendored
Normal file
39
node_modules/vant/lib/checkbox-group/index.js
generated
vendored
Normal 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, {
|
||||
CheckboxGroup: () => CheckboxGroup,
|
||||
checkboxGroupProps: () => import_CheckboxGroup2.checkboxGroupProps,
|
||||
default: () => stdin_default
|
||||
});
|
||||
module.exports = __toCommonJS(stdin_exports);
|
||||
var import_utils = require("../utils");
|
||||
var import_CheckboxGroup = __toESM(require("./CheckboxGroup"));
|
||||
var import_CheckboxGroup2 = require("./CheckboxGroup");
|
||||
const CheckboxGroup = (0, import_utils.withInstall)(import_CheckboxGroup.default);
|
||||
var stdin_default = CheckboxGroup;
|
||||
1
node_modules/vant/lib/checkbox-group/style/index.d.ts
generated
vendored
Normal file
1
node_modules/vant/lib/checkbox-group/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
2
node_modules/vant/lib/checkbox-group/style/index.js
generated
vendored
Normal file
2
node_modules/vant/lib/checkbox-group/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
require("../../style/base.css");
|
||||
require("../index.css");
|
||||
16
node_modules/vant/lib/checkbox-group/types.d.ts
generated
vendored
Normal file
16
node_modules/vant/lib/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;
|
||||
};
|
||||
15
node_modules/vant/lib/checkbox-group/types.js
generated
vendored
Normal file
15
node_modules/vant/lib/checkbox-group/types.js
generated
vendored
Normal 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);
|
||||
Reference in New Issue
Block a user