@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
195 lines (194 loc) • 4.64 kB
JavaScript
import { defineComponent as a, createVNode as r, ref as d, inject as m, onMounted as l } from "vue";
import { resolveAppearance as u, createPropsResolver as f } from "../dynamic-resolver/index.esm.js";
import { useDesignerComponent as g } from "../designer-canvas/index.esm.js";
const v = /* @__PURE__ */ new Map([
["appearance", u]
]);
function y(e, t, o) {
return t;
}
const k = "https://json-schema.org/draft/2020-12/schema", b = "https://farris-design.gitee.io/smoke-detector.schema.json", D = "smoke-detector", P = "A Farris Component", h = "object", w = {
id: {
description: "The unique identifier for smoke-detector",
type: "string"
},
type: {
description: "The type string of smoke-detector",
type: "string",
default: "smoke-detector"
},
voltageA: {
description: "A相电压",
type: "number",
default: -1
},
voltageB: {
description: "B相电压",
type: "number",
default: -1
},
voltageC: {
description: "C相电压",
type: "number",
default: -1
},
forwardActiveTotalPower: {
description: "正向有功总电量",
type: "number",
default: -1
},
totalPositiveReactivePower: {
description: "正向无功总电量",
type: "number",
default: -1
},
reverseTotalActivePower: {
description: "反向有功总电量",
type: "number",
default: -1
},
reverseTotalReactivePower: {
description: "反向无功总电量",
type: "number",
default: -1
},
toDeliverData: {
description: "下发数据",
type: "string"
}
}, A = [
"id",
"type"
], C = {
$schema: k,
$id: b,
title: D,
description: P,
type: h,
properties: w,
required: A
}, R = "smoke-detector", T = "A Farris Component", $ = "object", x = {
basic: {
description: "Basic Infomation",
title: "基本信息",
properties: {
id: {
description: "组件标识",
title: "标识",
type: "string",
readonly: !0
},
type: {
description: "组件类型",
title: "控件类型",
type: "select",
editor: {
type: "waiting for modification",
enum: []
}
}
}
},
bussinessProperties: {
description: "",
title: "业务属性",
properties: {
voltageA: {
description: "A相电压",
type: "number",
title: "A相电压",
default: -1
},
voltageB: {
description: "B相电压",
type: "number",
title: "B相电压",
default: -1
},
voltageC: {
description: "C相电压",
type: "number",
title: "C相电压",
default: -1
},
forwardActiveTotalPower: {
description: "正向有功总电量",
type: "number",
title: "正向有功总电量",
default: -1
},
totalPositiveReactivePower: {
description: "正向无功总电量",
type: "number",
title: "正向无功总电量",
default: -1
},
reverseTotalActivePower: {
description: "反向有功总电量",
type: "number",
title: "反向有功总电量",
default: -1
},
reverseTotalReactivePower: {
description: "反向无功总电量",
type: "number",
title: "反向无功总电量",
default: -1
},
toDeliverData: {
description: "下发数据",
type: "string",
title: "下发数据"
}
}
}
}, B = {
title: R,
description: T,
type: $,
categories: x
}, s = {}, p = f(s, C, v, y, B), i = /* @__PURE__ */ a({
name: "FSmokeDetector",
props: s,
emits: [""],
setup(e) {
return () => r("div", {
class: "f-smoke-detector"
}, [r("img", {
title: "smoke-detector",
src: "./image/smoke-detector-2.png"
}, null)]);
}
}), M = /* @__PURE__ */ a({
name: "FSmokeDetectorDesign",
props: s,
emits: [""],
setup(e, t) {
const o = d(), n = m("design-item-context"), c = g(o, n);
return l(() => {
o.value.componentInstance = c;
}), t.expose(c.value), () => r("div", {
ref: o,
class: "f-smoke-detector"
}, [r("img", {
title: "smoke-detector",
src: "../image/smoke-detector-2.png"
}, null)]);
}
}), I = {
install(e) {
e.component(i.name, i);
},
register(e, t, o, n) {
e["smoke-detector"] = i, t["smoke-detector"] = p;
},
registerDesigner(e, t, o) {
e["smoke-detector"] = M, t["smoke-detector"] = p;
}
};
export {
i as SmokeDetector,
I as default,
p as propsResolver,
s as smokeDetectorProps
};