@matechat/core
Version:
前端智能化场景解决方案UI库,轻松构建你的AI应用。
197 lines (196 loc) • 4.43 kB
JavaScript
import "./index.css";
var m = Object.defineProperty;
var y = (r, t, e) => t in r ? m(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
var l = (r, t, e) => y(r, typeof t != "symbol" ? t + "" : t, e);
import { defineComponent as S, openBlock as a, createElementBlock as i, normalizeClass as C, unref as u, createElementVNode as p, normalizeStyle as P, createCommentVNode as c, toDisplayString as d, Fragment as v, renderList as b, renderSlot as k } from "vue";
const n = () => {
};
class g {
constructor(t) {
l(this, "_adapter");
this._adapter = { ...g.defaultAdapter, ...t };
}
static get cssClasses() {
return {};
}
static get strings() {
return {};
}
static get numbers() {
return {};
}
static get defaultAdapter() {
return {
getProp: n,
getProps: n,
getState: n,
getStates: n,
setState: n,
getContext: n,
getContexts: n,
getCache: n,
setCache: n,
getCaches: n,
stopPropagation: n
};
}
getProp(t) {
return this._adapter.getProp(t);
}
getProps() {
return this._adapter.getProps();
}
getState(t) {
return this._adapter.getState(t);
}
getStates() {
return this._adapter.getStates();
}
setState(t, e) {
return this._adapter.setState({ ...t }, e);
}
/* istanbul ignore next */
getCaches() {
return this._adapter.getCaches();
}
getCache(t) {
return this._adapter.getCache(t);
}
setCache(t, e) {
return t && this._adapter.setCache(t, e);
}
nextTick(t) {
return this._adapter.nextTick(t);
}
_isInProps(t) {
const e = this.getProps();
return t in e;
}
init(t) {
}
destroy() {
}
}
class I extends g {
constructor(t) {
super({ ...t });
}
getIntroductionClasses() {
const t = this._adapter.getProp("align"), e = this._adapter.getProp(
"background"
);
return [t, e].filter(Boolean).join(" ");
}
getLogoStyle() {
const t = this._adapter.getProp("logoWidth"), e = this._adapter.getProp("logoHeight"), s = {};
return t && (s.width = typeof t == "number" ? `${t}px` : t), e && (s.height = typeof e == "number" ? `${e}px` : e), s;
}
}
const T = {
logoImg: {
type: String,
default: ""
},
logoWidth: {
type: [String, Number],
default: ""
},
logoHeight: {
type: [String, Number],
default: ""
},
title: {
type: String,
default: ""
},
subTitle: {
type: String,
default: ""
},
description: {
type: Array,
default: () => []
},
background: {
type: String,
default: "transparent"
},
align: {
type: String,
default: "center"
}
}, N = { class: "mc-introduction-logo-container" }, A = ["src", "alt"], B = { class: "mc-introduction-title" }, H = {
key: 0,
class: "mc-introduction-sub-title"
}, L = {
key: 1,
class: "mc-introduction-description"
}, V = /* @__PURE__ */ S({
__name: "Introduction",
props: T,
setup(r) {
const t = r, e = {
getProp: (o) => t[o],
getProps: () => t
}, s = new I(e);
return (o, $) => (a(), i(
"div",
{
class: C(["mc-introduction", u(s).getIntroductionClasses()])
},
[
p("div", N, [
o.logoImg ? (a(), i("img", {
key: 0,
src: o.logoImg,
alt: o.title,
style: P(u(s).getLogoStyle())
}, null, 12, A)) : c("v-if", !0),
p(
"div",
B,
d(o.title),
1
/* TEXT */
)
]),
o.subTitle ? (a(), i(
"div",
H,
d(o.subTitle),
1
/* TEXT */
)) : c("v-if", !0),
o.description.length ? (a(), i("div", L, [
(a(!0), i(
v,
null,
b(o.description, (_, f) => (a(), i(
"div",
{ key: f },
d(_),
1
/* TEXT */
))),
128
/* KEYED_FRAGMENT */
))
])) : c("v-if", !0),
k(o.$slots, "default", {}, void 0, !0)
],
2
/* CLASS */
));
}
}), W = (r, t) => {
const e = r.__vccOpts || r;
for (const [s, o] of t)
e[s] = o;
return e;
}, h = /* @__PURE__ */ W(V, [["__scopeId", "data-v-55ed77e8"]]);
h.install = (r) => {
r.component("McIntroduction", h);
};
export {
h as McIntroduction
};