UNPKG

@matechat/core

Version:

前端智能化场景解决方案UI库,轻松构建你的AI应用。

520 lines (519 loc) 27.1 kB
import "./index.css"; import { defineComponent as v, ref as _, createElementBlock as L, openBlock as c, createStaticVNode as R, createElementVNode as s, watch as I, normalizeClass as b, useSlots as z, reactive as K, normalizeStyle as P, createCommentVNode as N, Fragment as F, renderList as T, renderSlot as x, createBlock as H, unref as O, resolveDynamicComponent as V } from "vue"; var w = /* @__PURE__ */ ((e) => (e.COPY = "copy", e.LIKE = "like", e.DISLIKE = "dislike", e.REFRESH = "refresh", e.SHARE = "share", e.DELETE = "delete", e))(w || {}); const Y = { // 操作项列表 items: { type: Array, default: () => [] }, iconSize: { type: Number, default: 16 }, // 操作项之间的间隔 gap: { type: Number, default: 0 } }, w1 = { size: { type: Number, default: 16 }, configData: { type: Object, required: !0 } }, g = { width: { type: Number, default: 16 }, height: { type: Number, default: 16 }, // 点赞/点踩 是否默认激活 isActive: { type: Boolean, default: !1 }, // 需要复制的文本 仅对复制Icon组件生效 text: { type: String, default: "" } }, j = { class: "mc-action-item" }, q = ["width", "height"], G = ["width", "height"], J = /* @__PURE__ */ v({ __name: "CopyIcon", props: g, setup(e) { const C = e, n = _(!1), h = async () => { n.value = !0, setTimeout(() => { n.value = !1; }, 1500); try { await l(C.text); } catch { } }; function l(t) { return typeof t != "string" ? Promise.reject() : navigator.clipboard && window.isSecureContext ? navigator.clipboard.writeText(t).then(() => { }).catch((r) => p(t)) : p(t); } function p(t) { return new Promise((r, m) => { const d = document.createElement("textarea"); d.value = t, d.style.position = "fixed", d.style.top = "-9999px", d.style.left = "-9999px", d.style.opacity = "0", d.style.zIndex = "-1000", d.setAttribute("readonly", ""), document.body.appendChild(d); try { d.select(), d.setSelectionRange(0, d.value.length), document.execCommand("copy") ? r(null) : m(); } catch { m(); } finally { document.body.removeChild(d); } }); } return (t, r) => (c(), L("div", j, [ n.value ? (c(), L("svg", { key: 0, width: t.width, height: t.height, viewBox: "0 0 16 16", version: "1.1", xmlns: "http://www.w3.org/2000/svg", "xmlns:xlink": "http://www.w3.org/1999/xlink" }, r[0] || (r[0] = [ R('<desc data-v-ba532642>Created with Sketch.</desc><defs data-v-ba532642><polygon id="path-1" points="6.53553391 9.77817459 12.1923882 4.12132034 13.6066017 5.53553391 6.53553391 12.6066017 3 9.07106781 4.41421356 7.65685425 6.53553391 9.77817459" data-v-ba532642></polygon></defs><g id="status/whiteBG/correct" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" data-v-ba532642><mask id="mask-2" fill="white" data-v-ba532642><use xlink:href="#path-1" data-v-ba532642></use></mask><use id="Mask" fill="currentColor" xlink:href="#path-1" data-v-ba532642></use></g>', 3) ]), 8, q)) : (c(), L("svg", { key: 1, width: t.width, height: t.height, viewBox: "0 0 16 16", version: "1.1", xmlns: "http://www.w3.org/2000/svg", "xmlns:xlink": "http://www.w3.org/1999/xlink", onClick: h }, r[1] || (r[1] = [ s( "g", { id: "页面-1", stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd" }, [ s("g", { id: "API-starter-图标入库", transform: "translate(-592.000000, -204.000000)" }, [ s("g", { id: "方格备份-16", transform: "translate(560.000000, 180.000000)" }, [ s("text", { id: "图标", "font-family": "PingFangSC-Regular, PingFang SC", "font-size": "12", "font-weight": "normal", "line-spacing": "16", fill: "#71757F" }, [ s("tspan", { x: "27.136", y: "61" }, "复制") ]) ]), s("path", { d: "M604.5,206 C605.279696,206 605.920449,206.594888 605.993133,207.35554 L606,207.5 L606,214.5 C606,215.279696 605.405112,215.920449 604.64446,215.993133 L604.5,216 L604,216 L604,216.5 C604,217.279696 603.405112,217.920449 602.64446,217.993133 L602.5,218 L595.5,218 C594.671573,218 594,217.328427 594,216.5 L594,216.5 L594,209.5 C594,208.671573 594.671573,208 595.5,208 L595.5,208 L596,208 L596,207.5 C596,206.720304 596.594888,206.079551 597.35554,206.006867 L597.5,206 L604.5,206 Z M602.5,209 L595.5,209 C595.223858,209 595,209.223858 595,209.5 L595,209.5 L595,216.5 C595,216.776142 595.223858,217 595.5,217 L595.5,217 L602.5,217 C602.776142,217 603,216.776142 603,216.5 L603,216.5 L603,209.5 C603,209.223858 602.776142,209 602.5,209 L602.5,209 Z M604.5,207 L597.5,207 C597.25454,207 597.050392,207.176875 597.008056,207.410124 L597,207.5 L597,208 L602.5,208 C603.279696,208 603.920449,208.594888 603.993133,209.35554 L604,209.5 L604,215 L604.5,215 C604.74546,215 604.949608,214.823125 604.991944,214.589876 L605,214.5 L605,207.5 C605,207.25454 604.823125,207.050392 604.589876,207.008056 L604.5,207 Z", id: "形状结合", fill: "currentColor", "fill-rule": "nonzero" }) ]) ], -1 /* HOISTED */ ) ]), 8, G)) ])); } }), u = (e, C) => { const n = e.__vccOpts || e; for (const [h, l] of C) n[h] = l; return n; }, S = /* @__PURE__ */ u(J, [["__scopeId", "data-v-ba532642"]]), Q = { class: "mc-action-item" }, U = ["width", "height"], W = /* @__PURE__ */ v({ __name: "DeleteIcon", props: g, setup(e) { return (C, n) => (c(), L("div", Q, [ (c(), L("svg", { width: C.width, height: C.height, viewBox: "0 0 16 16", version: "1.1", xmlns: "http://www.w3.org/2000/svg", "xmlns:xlink": "http://www.w3.org/1999/xlink" }, n[0] || (n[0] = [ s( "g", { id: "codehub-delete-op", stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd" }, [ s("path", { d: "M12.5,5 C12.7761424,5 13,5.22385763 13,5.5 L13,13 C13,14.0543618 12.1841222,14.9181651 11.1492623,14.9945143 L11,15 L5,15 C3.9456382,15 3.08183488,14.1841222 3.00548574,13.1492623 L3,13 L3,5.5 C3,5.22385763 3.22385763,5 3.5,5 C3.77614237,5 4,5.22385763 4,5.5 L4,13 C4,13.5128358 4.38604019,13.9355072 4.88337887,13.9932723 L5,14 L11,14 C11.5128358,14 11.9355072,13.6139598 11.9932723,13.1166211 L12,13 L12,5.5 C12,5.22385763 12.2238576,5 12.5,5 Z M6.53333333,6 C6.79515721,6 7.0129156,6.17687516 7.05807395,6.41012437 L7.06666667,6.5 L7.06666667,11.5 C7.06666667,11.7761424 6.8278852,12 6.53333333,12 C6.27150945,12 6.05375107,11.8231248 6.00859271,11.5898756 L6,11.5 L6,6.5 C6,6.22385763 6.23878147,6 6.53333333,6 Z M9.53333333,6 C9.79515721,6 10.0129156,6.17687516 10.058074,6.41012437 L10.0666667,6.5 L10.0666667,11.5 C10.0666667,11.7761424 9.8278852,12 9.53333333,12 C9.27150945,12 9.05375107,11.8231248 9.00859271,11.5898756 L9,11.5 L9,6.5 C9,6.22385763 9.23878147,6 9.53333333,6 Z M10,1 C10.5128358,1 10.9355072,1.38604019 10.9932723,1.88337887 L11,2 L11,3 L14.5,3 C14.7761424,3 15,3.22385763 15,3.5 C15,3.77614237 14.7761424,4 14.5,4 L1.5,4 C1.22385763,4 1,3.77614237 1,3.5 C1,3.22385763 1.22385763,3 1.5,3 L5,3 L5,2 C5,1.48716416 5.38604019,1.06449284 5.88337887,1.00672773 L6,1 L10,1 Z M10,2 L6,2 L6,3 L10,3 L10,2 Z", fill: "currentColor" }) ], -1 /* HOISTED */ ) ]), 8, U)) ])); } }), E = /* @__PURE__ */ u(W, [["__scopeId", "data-v-bbbbce5a"]]), X = ["width", "height"], e1 = ["width", "height"], t1 = /* @__PURE__ */ v({ __name: "DislikeIcon", props: g, emits: ["activeChange"], setup(e, { emit: C }) { const n = C, h = e, l = _(h.isActive); I( () => h.isActive, () => { l.value = h.isActive; } ); const p = () => { l.value = !l.value, n("activeChange", l.value); }; return (t, r) => (c(), L( "div", { class: b(["mc-action-item", { "mc-action-item-active": l.value }]), onClick: p }, [ l.value ? (c(), L("svg", { key: 0, width: t.width, height: t.height, viewBox: "0 0 16 16", version: "1.1", xmlns: "http://www.w3.org/2000/svg", "xmlns:xlink": "http://www.w3.org/1999/xlink" }, r[0] || (r[0] = [ s( "path", { id: "矢量 1", d: "M2.60156 1C1.76611 1 1.08008 1.63953 1.00659 2.45581L1 2.60156L1 8.06506C1 8.90039 1.63965 9.58643 2.45581 9.66003L2.60156 9.66663L3.16675 9.66644C3.44287 9.66644 3.6665 9.4425 3.6665 9.16644L3.6665 1.5C3.6665 1.22388 3.44263 1 3.1665 1L2.60156 1ZM5.6665 1L11.552 1L11.7861 1.00342C13.2422 1.04712 14.1792 1.50781 14.4907 2.44861C14.8108 3.41553 15.1758 5.00916 15.2917 6.29297L15.3098 6.51453L15.3308 6.92529L15.3345 7.12988C15.3438 8.74133 14.8638 9.74072 13.6501 9.74072L9.55591 9.74194L9.60107 9.88098C10.02 11.2178 10.1855 12.2474 10.0869 12.9923C9.89819 14.4197 8.75317 15.6334 7.67651 15.2727L7.55713 15.2261C7.11279 14.9865 6.85327 14.5331 6.70117 13.6534L6.54492 12.7217L6.4978 12.5065L6.43872 12.2728C6.37622 12.0485 6.30347 11.8517 6.21558 11.6747C5.91675 11.0725 5.51904 10.535 5.021 10.0604C4.8042 9.85382 4.6665 9.57355 4.6665 9.27405L4.6665 2C4.6665 1.44769 5.11426 1 5.6665 1Z", "fill-rule": "evenodd", fill: "currentColor" }, null, -1 /* HOISTED */ ) ]), 8, X)) : (c(), L("svg", { key: 1, width: t.width, height: t.height, viewBox: "0 0 16 16", version: "1.1", xmlns: "http://www.w3.org/2000/svg", "xmlns:xlink": "http://www.w3.org/1999/xlink" }, r[1] || (r[1] = [ s( "g", { id: "Dislike", stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd" }, [ s("path", { d: "M11.55205,1 C13.14165,1 14.16285,1.458308 14.49075,2.448728 C14.81075,3.415528 15.17575,5.009158 15.29175,6.292968 L15.29175,6.292968 L15.30985,6.514648 L15.33085,6.925358 C15.38255,8.656368 14.91455,9.740718 13.65015,9.740718 L13.65015,9.740718 L9.55591,9.741028 L9.60108,9.881038 C10.02005,11.217788 10.18555,12.247488 10.08695,12.992388 C9.89815,14.419688 8.75318,15.633388 7.67652,15.272788 L7.67652,15.272788 L7.55713,15.226188 C7.03589,14.992888 6.86426,14.595988 6.70117,13.653488 L6.70117,13.653488 L6.54492,12.721688 L6.4978,12.506488 C6.4231,12.182088 6.33277,11.910688 6.21558,11.674688 C5.8313,10.900988 5.28443,10.233788 4.57056,9.670048 L4.57056,9.670048 L2.60156,9.670288 C1.71704,9.670288 1,8.953248 1,8.068728 L1,8.068728 L1,2.605228 C1,1.720708 1.71704,1.003601 2.60156,1.003601 L2.60156,1.003601 L4.83325,1 Z M11.55205,1.999998 L5.33301,1.999998 L5.33301,9.002988 L5.41699,9.071468 C6.13672,9.686458 6.70239,10.406788 7.11109,11.230088 C7.23584,11.480988 7.33399,11.750888 7.4148,12.050988 L7.50098,12.409088 L7.56079,12.715988 L7.69336,13.519388 C7.69946,13.553388 7.70557,13.586088 7.71167,13.617588 L7.76441,13.867488 C7.83374,14.157988 7.8982,14.283188 7.96558,14.313488 C8.30152,14.463788 8.97461,13.775988 9.09571,12.861188 C9.17749,12.243388 9.00025,11.240388 8.55029,9.880678 C8.51196,9.764348 8.49854,9.641728 8.51099,9.520328 C8.55908,9.045288 8.98218,8.699098 9.45679,8.742858 L13.65015,8.740718 C14.18895,8.740718 14.43655,7.941288 14.29595,6.382938 C14.18755,5.183288 13.83915,3.662168 13.54155,2.762938 L13.50585,2.674618 C13.30125,2.245118 12.68435,1.999998 11.55205,1.999998 Z M4.33277,2.003598 L2.60156,2.003598 C2.26929,2.003598 2,2.272948 2,2.605228 L2,2.605228 L2,8.068668 L2.00781,8.166258 C2.05445,8.452148 2.30249,8.670288 2.60156,8.670288 L2.60156,8.670288 L4.33277,8.670598 L4.33277,2.003598 Z", id: "形状结合", fill: "currentColor" }) ], -1 /* HOISTED */ ) ]), 8, e1)) ], 2 /* CLASS */ )); } }), Z = /* @__PURE__ */ u(t1, [["__scopeId", "data-v-08c9b641"]]), i1 = ["width", "height"], n1 = ["width", "height"], o1 = /* @__PURE__ */ v({ __name: "LikeIcon", props: g, emits: ["activeChange"], setup(e, { emit: C }) { const n = C, h = e, l = _(h.isActive); I( () => h.isActive, () => { l.value = h.isActive; } ); const p = () => { l.value = !l.value, n("activeChange", l.value); }; return (t, r) => (c(), L( "div", { class: b(["mc-action-item", { "mc-action-item-active": l.value }]), onClick: p }, [ l.value ? (c(), L("svg", { key: 0, width: t.width, height: t.height, viewBox: "0 0 16 16", version: "1.1", xmlns: "http://www.w3.org/2000/svg", "xmlns:xlink": "http://www.w3.org/1999/xlink" }, r[0] || (r[0] = [ s( "desc", null, "Created with Sketch.", -1 /* HOISTED */ ), s( "path", { id: "矢量 1", d: "M2.60156 15.3369C1.76611 15.3369 1.08008 14.6974 1.00659 13.8811L1 13.7354L1 8.27185C1 7.43652 1.63965 6.75049 2.45581 6.67688L2.60156 6.67029L3.16675 6.67047C3.44287 6.67047 3.6665 6.89441 3.6665 7.17047L3.6665 14.8369C3.6665 15.113 3.44263 15.3369 3.1665 15.3369L2.60156 15.3369ZM5.6665 15.3369L11.552 15.3369L11.7861 15.3335C13.2422 15.2898 14.1792 14.8291 14.4907 13.8883C14.8108 12.9214 15.1758 11.3278 15.2917 10.0439L15.3098 9.82239L15.3308 9.41162L15.3345 9.20703C15.3438 7.59558 14.8638 6.59619 13.6501 6.59619L9.55591 6.59497L9.60107 6.45593C10.02 5.11914 10.1855 4.08948 10.0869 3.3446C9.89819 1.91724 8.75317 0.703491 7.67651 1.06421L7.55713 1.11084C7.11279 1.35046 6.85327 1.80383 6.70117 2.68347L6.54492 3.61523L6.4978 3.83044L6.43872 4.06409C6.37622 4.28845 6.30347 4.48523 6.21558 4.66223C5.91675 5.2644 5.51904 5.80194 5.021 6.27649C4.8042 6.48309 4.6665 6.76337 4.6665 7.06287L4.6665 14.3369C4.6665 14.8892 5.11426 15.3369 5.6665 15.3369Z", "fill-rule": "evenodd", fill: "currentColor" }, null, -1 /* HOISTED */ ) ]), 8, i1)) : (c(), L("svg", { key: 1, width: t.width, height: t.height, viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", "xmlns:xlink": "http://www.w3.org/1999/xlink" }, r[1] || (r[1] = [ s( "g", { id: "页面-1", stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd" }, [ s("path", { d: "M11.55205,1 C13.14165,1 14.16285,1.458308 14.49075,2.448728 C14.81075,3.415528 15.17575,5.009158 15.29175,6.292968 L15.29175,6.292968 L15.30985,6.514648 L15.33085,6.925358 C15.38255,8.656368 14.91455,9.740718 13.65015,9.740718 L13.65015,9.740718 L9.55591,9.741028 L9.60108,9.881038 C10.02005,11.217788 10.18555,12.247488 10.08695,12.992388 C9.89815,14.419688 8.75318,15.633388 7.67652,15.272788 L7.67652,15.272788 L7.55713,15.226188 C7.03589,14.992888 6.86426,14.595988 6.70117,13.653488 L6.70117,13.653488 L6.54492,12.721688 L6.4978,12.506488 C6.4231,12.182088 6.33277,11.910688 6.21558,11.674688 C5.8313,10.900988 5.28443,10.233788 4.57056,9.670048 L4.57056,9.670048 L2.60156,9.670288 C1.71704,9.670288 1,8.953248 1,8.068728 L1,8.068728 L1,2.605228 C1,1.720708 1.71704,1.003601 2.60156,1.003601 L2.60156,1.003601 L4.83325,1 Z M11.55205,1.999998 L5.33301,1.999998 L5.33301,9.002988 L5.41699,9.071468 L5.6796615,9.30702243 C6.27568484,9.86814941 6.7534775,10.5097005 7.11109,11.230088 C7.23584,11.480988 7.33399,11.750888 7.4148,12.050988 L7.4148,12.050988 L7.50098,12.409088 L7.56079,12.715988 L7.69336,13.519388 L7.702515,13.5694255 L7.702515,13.5694255 L7.71167,13.617588 L7.76441,13.867488 L7.79384741,13.9820728 C7.85221673,14.1918227 7.90782571,14.2875166 7.96558,14.313488 C8.30152,14.463788 8.97461,13.775988 9.09571,12.861188 C9.17749,12.243388 9.00025,11.240388 8.55029,9.880678 C8.51196,9.764348 8.49854,9.641728 8.51099,9.520328 C8.55908,9.045288 8.98218,8.699098 9.45679,8.742858 L9.45679,8.742858 L13.65015,8.740718 L13.7287739,8.73472734 C14.2127395,8.6588777 14.42952,7.8633705 14.29595,6.382938 C14.18755,5.183288 13.83915,3.662168 13.54155,2.762938 L13.54155,2.762938 L13.50585,2.674618 L13.4594021,2.5911944 C13.216706,2.21352476 12.6088633,1.999998 11.55205,1.999998 L11.55205,1.999998 Z M4.33277,2.003598 L2.60156,2.003598 C2.26929,2.003598 2,2.272948 2,2.605228 L2,2.605228 L2,8.068668 L2.00781,8.166258 C2.05445,8.452148 2.30249,8.670288 2.60156,8.670288 L2.60156,8.670288 L4.33277,8.670598 L4.33277,2.003598 Z", id: "dislike", fill: "currentColor", transform: "translate(8.167337, 8.168474) scale(-1, 1) rotate(-180.000000) translate(-8.167337, -8.168474) " }) ], -1 /* HOISTED */ ) ]), 8, n1)) ], 2 /* CLASS */ )); } }), $ = /* @__PURE__ */ u(o1, [["__scopeId", "data-v-5bfb7d70"]]), s1 = { class: "mc-action-item" }, l1 = ["width", "height"], r1 = /* @__PURE__ */ v({ __name: "RefreshIcon", props: g, setup(e) { return (C, n) => (c(), L("div", s1, [ (c(), L("svg", { xmlns: "http://www.w3.org/2000/svg", "xmlns:xlink": "http://www.w3.org/1999/xlink", width: C.width, height: C.height, viewBox: "0 0 16 16", version: "1.1" }, n[0] || (n[0] = [ s( "g", { id: "Re-generate", stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd" }, [ s("path", { d: "M12.7143179,3.28587475 C13.981136,4.55339434 14.6666667,6.24406622 14.6666667,7.99999694 L14.6661599,8.02257215 C14.6655102,8.03703705 14.6642357,8.05147912 14.6623363,8.06585443 L14.6666667,7.99999694 C14.6666667,8.0371769 14.6626086,8.07340903 14.6549111,8.10827457 C14.6517992,8.1222052 14.6480389,8.13632563 14.6436512,8.15029154 C14.6390061,8.1651613 14.6336213,8.17980434 14.6275902,8.19410809 C14.6231995,8.20453649 14.6185439,8.21463293 14.613534,8.22459678 C14.6049463,8.24162018 14.5952425,8.2583947 14.5846307,8.27451859 C14.5792264,8.282804 14.5735765,8.29085725 14.5676615,8.2987751 C14.5571418,8.31280391 14.5460319,8.32617172 14.5342667,8.33892584 C14.5300122,8.343554 14.5251791,8.34859129 14.5202201,8.35355033 L14.5076464,8.36569453 C14.4940828,8.37834683 14.4798146,8.39025348 14.4649071,8.4013492 L14.5202201,8.35355033 C14.4937641,8.38000631 14.465081,8.40287777 14.4347743,8.42216473 C14.4224394,8.42996083 14.4098046,8.43724836 14.3968374,8.44398448 C14.3832773,8.45105337 14.3694473,8.45743098 14.3554103,8.46314429 C14.3412925,8.46891455 14.3266036,8.47413114 14.3116174,8.47866321 C14.2992824,8.48234275 14.2871467,8.4855024 14.2749295,8.48819956 C14.2606866,8.49139588 14.2459756,8.4939711 14.2310588,8.49588898 C14.2147923,8.49795142 14.1986607,8.49923861 14.1825093,8.49974745 L14.1666667,8.49999694 L14.1666667,8.49999694 L14.1394006,8.49925755 C14.1253117,8.49849283 14.1112491,8.49713493 14.0972533,8.49518384 L14.1666667,8.49999694 C14.1273209,8.49999694 14.0890366,8.49545228 14.05231,8.48685924 C14.0384692,8.48357481 14.0248075,8.47976105 14.0112962,8.4753569 C13.9958192,8.47034085 13.9804276,8.46445184 13.9654221,8.45784679 C13.9544183,8.45302561 13.9434536,8.44772707 13.9326545,8.4420051 C13.9165024,8.43339464 13.9009385,8.4240044 13.8859565,8.41382189 C13.8807017,8.41031248 13.8749119,8.40620635 13.8691922,8.40196243 L13.8550466,8.39103641 C13.8474863,8.38500359 13.8401047,8.3787561 13.8329113,8.37230316 L13.8131133,8.35355033 L12.6151133,7.15555033 C12.4198511,6.96028819 12.4198511,6.6437057 12.6151133,6.44844355 C12.7926243,6.27093251 13.0704001,6.25479514 13.2661411,6.40003145 L13.3222201,6.44844355 L13.498767,6.62598997 C13.2544588,5.64420827 12.7478288,4.73400934 12.0071133,3.99288367 C9.79437542,1.78014581 6.20562458,1.78014581 3.99288672,3.99288367 C1.78014071,6.20562968 1.78014071,9.79375159 3.99288672,12.0071102 C6.20562458,14.2198481 9.79437542,14.2198481 12.0071133,12.0071102 C12.2023754,11.8118481 12.5189579,11.8118481 12.7142201,12.0071102 C12.9094822,12.2023724 12.9094822,12.5189549 12.7142201,12.714217 C10.1109579,15.3174791 5.88904209,15.3174791 3.28573101,12.7141681 C0.682525952,10.1102423 0.682525952,5.88903088 3.28577994,3.28577688 C5.88904209,0.682514739 10.1109579,0.682514739 12.7143179,3.28587475 Z", id: "形状结合", fill: "currentColor" }) ], -1 /* HOISTED */ ) ]), 8, l1)) ])); } }), A = /* @__PURE__ */ u(r1, [["__scopeId", "data-v-9870e7a6"]]), c1 = { class: "mc-action-item" }, C1 = ["width", "height"], L1 = /* @__PURE__ */ v({ __name: "ShareIcon", props: g, setup(e) { return (C, n) => (c(), L("div", c1, [ (c(), L("svg", { xmlns: "http://www.w3.org/2000/svg", "xmlns:xlink": "http://www.w3.org/1999/xlink", width: C.width, height: C.height, viewBox: "0 0 16 16", version: "1.1" }, n[0] || (n[0] = [ s( "desc", null, "Created with Sketch.", -1 /* HOISTED */ ), s( "g", { id: "释义图标/分享", stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd" }, [ s("g", { id: "分享", fill: "currentColor", "fill-rule": "nonzero" }, [ s("path", { d: "M6.3804718,9.82599637 C5.83206631,10.5398588 4.96976903,11 4,11 C2.34314575,11 1,9.65685425 1,8 C1,6.34314575 2.34314575,5 4,5 C4.96976903,5 5.83206631,5.46014123 6.3804718,6.17400363 L10.1006387,4.20450353 C10.0351367,3.98105658 10,3.7446316 10,3.5 C10,2.11928813 11.1192881,1 12.5,1 C13.8807119,1 15,2.11928813 15,3.5 C15,4.88071187 13.8807119,6 12.5,6 C11.7223166,6 11.0275695,5.64490757 10.5690501,5.08801416 L6.84895235,7.0574777 C6.94695785,7.35387727 7,7.67074431 7,8 C7,8.32925569 6.94695785,8.64612273 6.84895235,8.9425223 L10.5690501,10.9119858 C11.0275695,10.3550924 11.7223166,10 12.5,10 C13.8807119,10 15,11.1192881 15,12.5 C15,13.8807119 13.8807119,15 12.5,15 C11.1192881,15 10,13.8807119 10,12.5 C10,12.2553684 10.0351367,12.0189434 10.1006387,11.7954965 L6.3804718,9.82599637 L6.3804718,9.82599637 Z M4,10 C5.1045695,10 6,9.1045695 6,8 C6,6.8954305 5.1045695,6 4,6 C2.8954305,6 2,6.8954305 2,8 C2,9.1045695 2.8954305,10 4,10 Z M12.5,14 C13.3284271,14 14,13.3284271 14,12.5 C14,11.6715729 13.3284271,11 12.5,11 C11.6715729,11 11,11.6715729 11,12.5 C11,13.3284271 11.6715729,14 12.5,14 Z M12.5,5 C13.3284271,5 14,4.32842712 14,3.5 C14,2.67157288 13.3284271,2 12.5,2 C11.6715729,2 11,2.67157288 11,3.5 C11,4.32842712 11.6715729,5 12.5,5 Z", id: "形状" }) ]) ], -1 /* HOISTED */ ) ]), 8, C1)) ])); } }), D = /* @__PURE__ */ u(L1, [["__scopeId", "data-v-2a9dee06"]]), a1 = ["title", "onClick"], d1 = /* @__PURE__ */ v({ __name: "Toolbar", props: Y, emits: ["onClick"], setup(e, { emit: C }) { var y; const n = C, h = e, l = z(), p = K((y = h.items) == null ? void 0 : y.map((i) => ({ ...i }))), t = { [w.COPY]: S, [w.LIKE]: $, [w.DISLIKE]: Z, [w.REFRESH]: A, [w.SHARE]: D, [w.DELETE]: E }, r = () => { const i = p.find( (o) => o.icon === w.LIKE ), a = p.find( (o) => o.icon === w.DISLIKE ); i != null && i.isActive && a && (a.isActive = !1); }, m = () => { const i = p.find( (a) => a.icon === w.DISLIKE ); i && (i.isActive = !1); }, d = () => { const i = p.find( (a) => a.icon === w.LIKE ); i && (i.isActive = !1); }, k = (i, a) => { var o; a.icon === w.LIKE ? m() : a.icon === w.DISLIKE && d(), (o = a.onClick) == null || o.call(a, a, i), n("onClick", a, i); }, B = (i, a) => { a.isActive = i; }; return r(), (i, a) => (c(), L( "div", { class: "mc-actions", style: P({ gap: `${i.gap}px` }) }, [ N(" 显示的操作项 "), (c(!0), L( F, null, T(p, (o) => x(i.$slots, o.key, { key: o.key, actionData: o }, () => [ O(l)[`${o.key}-icon`] ? (c(), L("div", { key: 0, class: "mc-action-item", title: o.label, onClick: (f) => k(f, o) }, [ x(i.$slots, `${o.key}-icon`, { actionData: o }, void 0, !0) ], 8, a1)) : (c(), H(V(t[o.icon]), { key: 1, "is-active": o.isActive, width: i.iconSize ?? 16, height: i.iconSize ?? 16, text: o.text, title: o.label, class: "mc-action-item", onActiveChange: (f) => B(f, o), onClick: (f) => k(f, o) }, null, 40, ["is-active", "width", "height", "text", "title", "onActiveChange", "onClick"])) ], !0)), 128 /* KEYED_FRAGMENT */ )) ], 4 /* STYLE */ )); } }), M = /* @__PURE__ */ u(d1, [["__scopeId", "data-v-b407530e"]]); M.install = (e) => { e.component("McToolbar", M), e.component("McCopyIcon", S), e.component("McDeleteIcon", E), e.component("McLikeIcon", $), e.component("McDislikeIcon", Z), e.component("McRefreshIcon", A), e.component("McShareIcon", D); }; export { w1 as ActionItemProps, g as IconComponentProps, S as McCopyIcon, E as McDeleteIcon, $ as McLikeIcon, A as McRefreshIcon, D as McShareIcon, M as McToolbar, w as ToolbarAction, Y as ToolbarProps };