1 | var __defProp = Object.defineProperty;
|
2 | var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3 | var __getOwnPropNames = Object.getOwnPropertyNames;
|
4 | var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5 | var __export = (target, all) => {
|
6 | for (var name2 in all)
|
7 | __defProp(target, name2, { get: all[name2], enumerable: true });
|
8 | };
|
9 | var __copyProps = (to, from, except, desc) => {
|
10 | if (from && typeof from === "object" || typeof from === "function") {
|
11 | for (let key of __getOwnPropNames(from))
|
12 | if (!__hasOwnProp.call(to, key) && key !== except)
|
13 | __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
14 | }
|
15 | return to;
|
16 | };
|
17 | var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
18 | var stdin_exports = {};
|
19 | __export(stdin_exports, {
|
20 | contactCardProps: () => contactCardProps,
|
21 | default: () => stdin_default
|
22 | });
|
23 | module.exports = __toCommonJS(stdin_exports);
|
24 | var import_vue = require("vue");
|
25 | var import_utils = require("../utils");
|
26 | var import_cell = require("../cell");
|
27 | const [name, bem, t] = (0, import_utils.createNamespace)("contact-card");
|
28 | const contactCardProps = {
|
29 | tel: String,
|
30 | name: String,
|
31 | type: (0, import_utils.makeStringProp)("add"),
|
32 | addText: String,
|
33 | editable: import_utils.truthProp
|
34 | };
|
35 | var stdin_default = (0, import_vue.defineComponent)({
|
36 | name,
|
37 | props: contactCardProps,
|
38 | emits: ["click"],
|
39 | setup(props, {
|
40 | emit
|
41 | }) {
|
42 | const onClick = (event) => {
|
43 | if (props.editable) {
|
44 | emit("click", event);
|
45 | }
|
46 | };
|
47 | const renderContent = () => {
|
48 | if (props.type === "add") {
|
49 | return props.addText || t("addContact");
|
50 | }
|
51 | return [(0, import_vue.createVNode)("div", null, [`${t("name")}\uFF1A${props.name}`]), (0, import_vue.createVNode)("div", null, [`${t("tel")}\uFF1A${props.tel}`])];
|
52 | };
|
53 | return () => (0, import_vue.createVNode)(import_cell.Cell, {
|
54 | "center": true,
|
55 | "icon": props.type === "edit" ? "contact" : "add-square",
|
56 | "class": bem([props.type]),
|
57 | "border": false,
|
58 | "isLink": props.editable,
|
59 | "titleClass": bem("title"),
|
60 | "onClick": onClick
|
61 | }, {
|
62 | title: renderContent
|
63 | });
|
64 | }
|
65 | });
|