first commit
This commit is contained in:
134
node_modules/vant/es/area/Area.d.ts
generated
vendored
Normal file
134
node_modules/vant/es/area/Area.d.ts
generated
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
import { type PropType, type ExtractPropTypes } from 'vue';
|
||||
import type { AreaList } from './types';
|
||||
export declare const areaProps: import("../utils").Writeable<Pick<{
|
||||
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;
|
||||
}, "title" | "readonly" | "loading" | "optionHeight" | "swipeDuration" | "visibleOptionNum" | "cancelButtonText" | "confirmButtonText">> & {
|
||||
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<ExtractPropTypes<import("../utils").Writeable<Pick<{
|
||||
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;
|
||||
}, "title" | "readonly" | "loading" | "optionHeight" | "swipeDuration" | "visibleOptionNum" | "cancelButtonText" | "confirmButtonText">> & {
|
||||
modelValue: StringConstructor;
|
||||
columnsNum: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
columnsPlaceholder: {
|
||||
type: PropType<string[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
areaList: {
|
||||
type: PropType<AreaList>;
|
||||
default: () => {};
|
||||
};
|
||||
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "cancel" | "change" | "confirm")[], "update:modelValue" | "cancel" | "change" | "confirm", import("vue").PublicProps, Readonly<ExtractPropTypes<import("../utils").Writeable<Pick<{
|
||||
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;
|
||||
}, "title" | "readonly" | "loading" | "optionHeight" | "swipeDuration" | "visibleOptionNum" | "cancelButtonText" | "confirmButtonText">> & {
|
||||
modelValue: StringConstructor;
|
||||
columnsNum: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
columnsPlaceholder: {
|
||||
type: PropType<string[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
areaList: {
|
||||
type: PropType<AreaList>;
|
||||
default: () => {};
|
||||
};
|
||||
}>> & Readonly<{
|
||||
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;
|
||||
optionHeight: string | number;
|
||||
swipeDuration: string | number;
|
||||
visibleOptionNum: string | number;
|
||||
columnsNum: string | number;
|
||||
columnsPlaceholder: string[];
|
||||
areaList: AreaList;
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
||||
export default _default;
|
||||
76
node_modules/vant/es/area/Area.mjs
generated
vendored
Normal file
76
node_modules/vant/es/area/Area.mjs
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
import { ref, watch, computed, defineComponent, mergeProps as _mergeProps, createVNode as _createVNode } 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({}, pick(pickerSharedProps, INHERIT_PROPS), {
|
||||
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
|
||||
};
|
||||
100
node_modules/vant/es/area/index.d.ts
generated
vendored
Normal file
100
node_modules/vant/es/area/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
export declare const Area: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<import("../utils").Writeable<Pick<{
|
||||
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;
|
||||
}, "title" | "readonly" | "loading" | "optionHeight" | "swipeDuration" | "visibleOptionNum" | "cancelButtonText" | "confirmButtonText">> & {
|
||||
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: () => {};
|
||||
};
|
||||
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "cancel" | "change" | "confirm")[], "update:modelValue" | "cancel" | "change" | "confirm", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<import("../utils").Writeable<Pick<{
|
||||
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;
|
||||
}, "title" | "readonly" | "loading" | "optionHeight" | "swipeDuration" | "visibleOptionNum" | "cancelButtonText" | "confirmButtonText">> & {
|
||||
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: () => {};
|
||||
};
|
||||
}>> & Readonly<{
|
||||
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;
|
||||
optionHeight: string | number;
|
||||
swipeDuration: string | number;
|
||||
visibleOptionNum: string | number;
|
||||
columnsNum: string | number;
|
||||
columnsPlaceholder: string[];
|
||||
areaList: import("./types").AreaList;
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
||||
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
node_modules/vant/es/area/index.mjs
generated
vendored
Normal file
10
node_modules/vant/es/area/index.mjs
generated
vendored
Normal 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
node_modules/vant/es/area/style/index.d.ts
generated
vendored
Normal file
1
node_modules/vant/es/area/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
10
node_modules/vant/es/area/style/index.mjs
generated
vendored
Normal file
10
node_modules/vant/es/area/style/index.mjs
generated
vendored
Normal 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
node_modules/vant/es/area/types.d.ts
generated
vendored
Normal file
9
node_modules/vant/es/area/types.d.ts
generated
vendored
Normal 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>;
|
||||
0
node_modules/vant/es/area/types.mjs
generated
vendored
Normal file
0
node_modules/vant/es/area/types.mjs
generated
vendored
Normal file
6
node_modules/vant/es/area/utils.d.ts
generated
vendored
Normal file
6
node_modules/vant/es/area/utils.d.ts
generated
vendored
Normal 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
node_modules/vant/es/area/utils.mjs
generated
vendored
Normal file
92
node_modules/vant/es/area/utils.mjs
generated
vendored
Normal 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 > 1 ? [
|
||||
makeOption(
|
||||
placeholder[1],
|
||||
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 > 2 ? [makeOption(placeholder[2])] : [];
|
||||
}
|
||||
};
|
||||
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
|
||||
};
|
||||
Reference in New Issue
Block a user