first commit
This commit is contained in:
64
node_modules/vant/es/contact-edit/ContactEdit.d.ts
generated
vendored
Normal file
64
node_modules/vant/es/contact-edit/ContactEdit.d.ts
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
import { type PropType, type ExtractPropTypes } from 'vue';
|
||||
import { isMobile } from '../utils';
|
||||
export type ContactEditInfo = {
|
||||
tel: string;
|
||||
name: string;
|
||||
isDefault?: boolean;
|
||||
};
|
||||
export declare const contactEditProps: {
|
||||
isEdit: BooleanConstructor;
|
||||
isSaving: BooleanConstructor;
|
||||
isDeleting: BooleanConstructor;
|
||||
showSetDefault: BooleanConstructor;
|
||||
setDefaultLabel: StringConstructor;
|
||||
contactInfo: {
|
||||
type: PropType<ContactEditInfo>;
|
||||
default: () => ContactEditInfo;
|
||||
};
|
||||
telValidator: {
|
||||
type: PropType<(val: string) => boolean>;
|
||||
default: typeof isMobile;
|
||||
};
|
||||
};
|
||||
export type ContactEditProps = ExtractPropTypes<typeof contactEditProps>;
|
||||
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
||||
isEdit: BooleanConstructor;
|
||||
isSaving: BooleanConstructor;
|
||||
isDeleting: BooleanConstructor;
|
||||
showSetDefault: BooleanConstructor;
|
||||
setDefaultLabel: StringConstructor;
|
||||
contactInfo: {
|
||||
type: PropType<ContactEditInfo>;
|
||||
default: () => ContactEditInfo;
|
||||
};
|
||||
telValidator: {
|
||||
type: PropType<(val: string) => boolean>;
|
||||
default: typeof isMobile;
|
||||
};
|
||||
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("delete" | "save" | "changeDefault")[], "delete" | "save" | "changeDefault", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
||||
isEdit: BooleanConstructor;
|
||||
isSaving: BooleanConstructor;
|
||||
isDeleting: BooleanConstructor;
|
||||
showSetDefault: BooleanConstructor;
|
||||
setDefaultLabel: StringConstructor;
|
||||
contactInfo: {
|
||||
type: PropType<ContactEditInfo>;
|
||||
default: () => ContactEditInfo;
|
||||
};
|
||||
telValidator: {
|
||||
type: PropType<(val: string) => boolean>;
|
||||
default: typeof isMobile;
|
||||
};
|
||||
}>> & Readonly<{
|
||||
onDelete?: ((...args: any[]) => any) | undefined;
|
||||
onSave?: ((...args: any[]) => any) | undefined;
|
||||
onChangeDefault?: ((...args: any[]) => any) | undefined;
|
||||
}>, {
|
||||
isSaving: boolean;
|
||||
isDeleting: boolean;
|
||||
showSetDefault: boolean;
|
||||
telValidator: (val: string) => boolean;
|
||||
isEdit: boolean;
|
||||
contactInfo: ContactEditInfo;
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
||||
export default _default;
|
||||
112
node_modules/vant/es/contact-edit/ContactEdit.mjs
generated
vendored
Normal file
112
node_modules/vant/es/contact-edit/ContactEdit.mjs
generated
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
import { watch, reactive, defineComponent, createVNode as _createVNode } from "vue";
|
||||
import { isMobile, createNamespace, extend } from "../utils/index.mjs";
|
||||
import { Cell } from "../cell/index.mjs";
|
||||
import { Form } from "../form/index.mjs";
|
||||
import { Field } from "../field/index.mjs";
|
||||
import { Button } from "../button/index.mjs";
|
||||
import { Switch } from "../switch/index.mjs";
|
||||
const [name, bem, t] = createNamespace("contact-edit");
|
||||
const DEFAULT_CONTACT = {
|
||||
tel: "",
|
||||
name: ""
|
||||
};
|
||||
const contactEditProps = {
|
||||
isEdit: Boolean,
|
||||
isSaving: Boolean,
|
||||
isDeleting: Boolean,
|
||||
showSetDefault: Boolean,
|
||||
setDefaultLabel: String,
|
||||
contactInfo: {
|
||||
type: Object,
|
||||
default: () => extend({}, DEFAULT_CONTACT)
|
||||
},
|
||||
telValidator: {
|
||||
type: Function,
|
||||
default: isMobile
|
||||
}
|
||||
};
|
||||
var stdin_default = defineComponent({
|
||||
name,
|
||||
props: contactEditProps,
|
||||
emits: ["save", "delete", "changeDefault"],
|
||||
setup(props, {
|
||||
emit
|
||||
}) {
|
||||
const contact = reactive(extend({}, DEFAULT_CONTACT, props.contactInfo));
|
||||
const onSave = () => {
|
||||
if (!props.isSaving) {
|
||||
emit("save", contact);
|
||||
}
|
||||
};
|
||||
const onDelete = () => emit("delete", contact);
|
||||
const renderButtons = () => _createVNode("div", {
|
||||
"class": bem("buttons")
|
||||
}, [_createVNode(Button, {
|
||||
"block": true,
|
||||
"round": true,
|
||||
"type": "primary",
|
||||
"text": t("save"),
|
||||
"class": bem("button"),
|
||||
"loading": props.isSaving,
|
||||
"nativeType": "submit"
|
||||
}, null), props.isEdit && _createVNode(Button, {
|
||||
"block": true,
|
||||
"round": true,
|
||||
"text": t("delete"),
|
||||
"class": bem("button"),
|
||||
"loading": props.isDeleting,
|
||||
"onClick": onDelete
|
||||
}, null)]);
|
||||
const renderSwitch = () => _createVNode(Switch, {
|
||||
"modelValue": contact.isDefault,
|
||||
"onUpdate:modelValue": ($event) => contact.isDefault = $event,
|
||||
"onChange": (checked) => emit("changeDefault", checked)
|
||||
}, null);
|
||||
const renderSetDefault = () => {
|
||||
if (props.showSetDefault) {
|
||||
return _createVNode(Cell, {
|
||||
"title": props.setDefaultLabel,
|
||||
"class": bem("switch-cell"),
|
||||
"border": false
|
||||
}, {
|
||||
"right-icon": renderSwitch
|
||||
});
|
||||
}
|
||||
};
|
||||
watch(() => props.contactInfo, (value) => extend(contact, DEFAULT_CONTACT, value));
|
||||
return () => _createVNode(Form, {
|
||||
"class": bem(),
|
||||
"onSubmit": onSave
|
||||
}, {
|
||||
default: () => [_createVNode("div", {
|
||||
"class": bem("fields")
|
||||
}, [_createVNode(Field, {
|
||||
"modelValue": contact.name,
|
||||
"onUpdate:modelValue": ($event) => contact.name = $event,
|
||||
"clearable": true,
|
||||
"label": t("name"),
|
||||
"rules": [{
|
||||
required: true,
|
||||
message: t("nameEmpty")
|
||||
}],
|
||||
"maxlength": "30",
|
||||
"placeholder": t("name")
|
||||
}, null), _createVNode(Field, {
|
||||
"modelValue": contact.tel,
|
||||
"onUpdate:modelValue": ($event) => contact.tel = $event,
|
||||
"clearable": true,
|
||||
"type": "tel",
|
||||
"label": t("tel"),
|
||||
"rules": [{
|
||||
validator: props.telValidator,
|
||||
message: t("telInvalid")
|
||||
}],
|
||||
"placeholder": t("tel")
|
||||
}, null)]), renderSetDefault(), renderButtons()]
|
||||
});
|
||||
}
|
||||
});
|
||||
export {
|
||||
contactEditProps,
|
||||
stdin_default as default
|
||||
};
|
||||
1
node_modules/vant/es/contact-edit/index.css
generated
vendored
Normal file
1
node_modules/vant/es/contact-edit/index.css
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
:root,:host{--van-contact-edit-padding: var(--van-padding-md);--van-contact-edit-fields-radius: var(--van-radius-md);--van-contact-edit-buttons-padding: var(--van-padding-xl) 0;--van-contact-edit-button-margin-bottom: var(--van-padding-sm);--van-contact-edit-button-font-size: var(--van-font-size-lg);--van-contact-edit-field-label-width: 4.1em}.van-contact-edit{padding:var(--van-contact-edit-padding)}.van-contact-edit__fields{overflow:hidden;border-radius:var(--van-contact-edit-fields-radius)}.van-contact-edit__fields .van-field__label{width:var(--van-contact-edit-field-label-width)}.van-contact-edit__switch-cell{margin-top:10px;padding-top:9px;padding-bottom:9px;border-radius:var(--van-contact-edit-fields-radius)}.van-contact-edit__buttons{padding:var(--van-contact-edit-buttons-padding)}.van-contact-edit__button{margin-bottom:var(--van-contact-edit-button-margin-bottom);font-size:var(--van-contact-edit-button-font-size)}
|
||||
49
node_modules/vant/es/contact-edit/index.d.ts
generated
vendored
Normal file
49
node_modules/vant/es/contact-edit/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
export declare const ContactEdit: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
||||
isEdit: BooleanConstructor;
|
||||
isSaving: BooleanConstructor;
|
||||
isDeleting: BooleanConstructor;
|
||||
showSetDefault: BooleanConstructor;
|
||||
setDefaultLabel: StringConstructor;
|
||||
contactInfo: {
|
||||
type: import("vue").PropType<import("./ContactEdit").ContactEditInfo>;
|
||||
default: () => import("./ContactEdit").ContactEditInfo;
|
||||
};
|
||||
telValidator: {
|
||||
type: import("vue").PropType<(val: string) => boolean>;
|
||||
default: typeof import("../utils").isMobile;
|
||||
};
|
||||
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("delete" | "save" | "changeDefault")[], "delete" | "save" | "changeDefault", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
||||
isEdit: BooleanConstructor;
|
||||
isSaving: BooleanConstructor;
|
||||
isDeleting: BooleanConstructor;
|
||||
showSetDefault: BooleanConstructor;
|
||||
setDefaultLabel: StringConstructor;
|
||||
contactInfo: {
|
||||
type: import("vue").PropType<import("./ContactEdit").ContactEditInfo>;
|
||||
default: () => import("./ContactEdit").ContactEditInfo;
|
||||
};
|
||||
telValidator: {
|
||||
type: import("vue").PropType<(val: string) => boolean>;
|
||||
default: typeof import("../utils").isMobile;
|
||||
};
|
||||
}>> & Readonly<{
|
||||
onDelete?: ((...args: any[]) => any) | undefined;
|
||||
onSave?: ((...args: any[]) => any) | undefined;
|
||||
onChangeDefault?: ((...args: any[]) => any) | undefined;
|
||||
}>, {
|
||||
isSaving: boolean;
|
||||
isDeleting: boolean;
|
||||
showSetDefault: boolean;
|
||||
telValidator: (val: string) => boolean;
|
||||
isEdit: boolean;
|
||||
contactInfo: import("./ContactEdit").ContactEditInfo;
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
||||
export default ContactEdit;
|
||||
export { contactEditProps } from './ContactEdit';
|
||||
export type { ContactEditInfo, ContactEditProps } from './ContactEdit';
|
||||
export type { ContactEditThemeVars } from './types';
|
||||
declare module 'vue' {
|
||||
interface GlobalComponents {
|
||||
VanContactEdit: typeof ContactEdit;
|
||||
}
|
||||
}
|
||||
10
node_modules/vant/es/contact-edit/index.mjs
generated
vendored
Normal file
10
node_modules/vant/es/contact-edit/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { withInstall } from "../utils/index.mjs";
|
||||
import _ContactEdit from "./ContactEdit.mjs";
|
||||
const ContactEdit = withInstall(_ContactEdit);
|
||||
var stdin_default = ContactEdit;
|
||||
import { contactEditProps } from "./ContactEdit.mjs";
|
||||
export {
|
||||
ContactEdit,
|
||||
contactEditProps,
|
||||
stdin_default as default
|
||||
};
|
||||
1
node_modules/vant/es/contact-edit/style/index.d.ts
generated
vendored
Normal file
1
node_modules/vant/es/contact-edit/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
9
node_modules/vant/es/contact-edit/style/index.mjs
generated
vendored
Normal file
9
node_modules/vant/es/contact-edit/style/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import "../../style/base.css";
|
||||
import "../../badge/index.css";
|
||||
import "../../icon/index.css";
|
||||
import "../../cell/index.css";
|
||||
import "../../field/index.css";
|
||||
import "../../loading/index.css";
|
||||
import "../../switch/index.css";
|
||||
import "../../button/index.css";
|
||||
import "../index.css";
|
||||
8
node_modules/vant/es/contact-edit/types.d.ts
generated
vendored
Normal file
8
node_modules/vant/es/contact-edit/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
export type ContactEditThemeVars = {
|
||||
contactEditPadding?: string;
|
||||
contactEditFieldsRadius?: string;
|
||||
contactEditButtonsPadding?: string;
|
||||
contactEditButtonMarginBottom?: string;
|
||||
contactEditButtonFontSize?: string;
|
||||
contactEditFieldLabelWidth?: string;
|
||||
};
|
||||
0
node_modules/vant/es/contact-edit/types.mjs
generated
vendored
Normal file
0
node_modules/vant/es/contact-edit/types.mjs
generated
vendored
Normal file
Reference in New Issue
Block a user