@farris/ui-vue 1.3.4 → 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/index.esm.js +16 -16
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +65 -65
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +13 -13
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +504 -490
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +247 -233
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +356 -344
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +159 -145
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +127 -128
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +15 -15
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/component/index.esm.js +101 -87
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +9 -7
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +181 -167
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +746 -730
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +9 -7
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +789 -777
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +3096 -3069
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +257 -243
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +322 -306
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +177 -163
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/event-parameter/index.esm.js +78 -82
- package/components/event-parameter/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +501 -487
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +37 -37
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.esm.js +487 -472
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +440 -433
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.esm.js +594 -587
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.esm.js +2766 -2739
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +402 -388
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +201 -202
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +264 -245
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +157 -143
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +314 -298
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +862 -843
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +1031 -1015
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +169 -155
- package/components/nav/index.umd.cjs +2 -2
- package/components/number-range/index.esm.js +150 -137
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +207 -194
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +427 -414
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +22 -22
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +510 -492
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +192 -178
- package/components/pagination/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +234 -220
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.esm.js +288 -277
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-panel/index.esm.js +62 -61
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.esm.js +776 -770
- package/components/query-solution/index.umd.cjs +6 -6
- package/components/radio-button/index.esm.js +64 -64
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.esm.js +296 -283
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +222 -208
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +187 -173
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +554 -542
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +483 -469
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +634 -619
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +228 -214
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +419 -406
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +162 -148
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +308 -284
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +279 -265
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +183 -170
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +307 -294
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +320 -306
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +245 -231
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +260 -247
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.esm.js +409 -396
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +424 -410
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +383 -376
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +595 -575
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +325 -311
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +304 -290
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +99 -85
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +947 -933
- package/components/weather/index.umd.cjs +4 -4
- package/farris.all.esm.js +5492 -5470
- package/farris.all.umd.cjs +13 -13
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/condition/src/composition/condition-value/input-group-value.d.ts +1 -1
- package/types/entity-binding-selector/composition/use-entity-tree.d.ts +3 -0
- package/types/entity-binding-selector/composition/use-field-tree.d.ts +1 -0
|
@@ -1,118 +1,132 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isPlainObject as j, cloneDeep as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const { properties: e, title:
|
|
6
|
-
if (
|
|
7
|
-
const
|
|
8
|
-
|
|
1
|
+
import { defineComponent as $, createVNode as P, ref as b, inject as _, onMounted as L } from "vue";
|
|
2
|
+
import { isPlainObject as j, cloneDeep as B } from "lodash-es";
|
|
3
|
+
const N = {}, q = {};
|
|
4
|
+
function T(t) {
|
|
5
|
+
const { properties: e, title: c, ignore: r } = t, n = r && Array.isArray(r), a = Object.keys(e).reduce((l, f) => ((!n || !r.find((h) => h === f)) && (l[f] = e[f].type === "object" && e[f].properties ? T(e[f]) : B(e[f].default)), l), {});
|
|
6
|
+
if (c && (!n || !r.find((l) => l === "id"))) {
|
|
7
|
+
const l = c.toLowerCase().replace(/-/g, "_");
|
|
8
|
+
a.id = `${l}_${Math.random().toString().slice(2, 6)}`;
|
|
9
9
|
}
|
|
10
|
-
return
|
|
10
|
+
return a;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
function W(t) {
|
|
13
|
+
const { properties: e, title: c, required: r } = t;
|
|
14
|
+
if (r && Array.isArray(r)) {
|
|
15
|
+
const n = r.reduce((a, l) => (a[l] = e[l].type === "object" && e[l].properties ? T(e[l]) : B(e[l].default), a), {});
|
|
16
|
+
if (c && r.find((a) => a === "id")) {
|
|
17
|
+
const a = c.toLowerCase().replace(/-/g, "_");
|
|
18
|
+
n.id = `${a}_${Math.random().toString().slice(2, 6)}`;
|
|
19
|
+
}
|
|
20
|
+
return n;
|
|
18
21
|
}
|
|
19
|
-
return
|
|
22
|
+
return {
|
|
23
|
+
type: c
|
|
24
|
+
};
|
|
20
25
|
}
|
|
21
|
-
function
|
|
22
|
-
const
|
|
23
|
-
|
|
26
|
+
function V(t, e = {}, c) {
|
|
27
|
+
const r = N[t];
|
|
28
|
+
if (r) {
|
|
29
|
+
let n = W(r);
|
|
30
|
+
const a = q[t];
|
|
31
|
+
return n = a ? a({ getSchemaByType: V }, n, e, c) : n, n;
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
24
34
|
}
|
|
25
35
|
function H(t, e) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
const c = T(e);
|
|
37
|
+
return Object.keys(c).reduce((r, n) => (Object.prototype.hasOwnProperty.call(t, n) && (r[n] && j(r[n]) && j(t[n] || !t[n]) ? Object.assign(r[n], t[n] || {}) : r[n] = t[n]), r), c), c;
|
|
38
|
+
}
|
|
39
|
+
function z(t, e) {
|
|
40
|
+
return Object.keys(t).filter((r) => t[r] != null).reduce((r, n) => {
|
|
41
|
+
if (e.has(n)) {
|
|
42
|
+
const a = e.get(n);
|
|
43
|
+
if (typeof a == "string")
|
|
44
|
+
r[a] = t[n];
|
|
31
45
|
else {
|
|
32
|
-
const
|
|
33
|
-
Object.assign(
|
|
46
|
+
const l = a(n, t[n], t);
|
|
47
|
+
Object.assign(r, l);
|
|
34
48
|
}
|
|
35
49
|
} else
|
|
36
|
-
n
|
|
37
|
-
return
|
|
50
|
+
r[n] = t[n];
|
|
51
|
+
return r;
|
|
38
52
|
}, {});
|
|
39
53
|
}
|
|
40
|
-
function
|
|
41
|
-
const
|
|
42
|
-
return
|
|
54
|
+
function G(t, e, c = /* @__PURE__ */ new Map()) {
|
|
55
|
+
const r = H(t, e);
|
|
56
|
+
return z(r, c);
|
|
43
57
|
}
|
|
44
|
-
function
|
|
45
|
-
function e(
|
|
46
|
-
if (typeof
|
|
47
|
-
return
|
|
48
|
-
if (typeof
|
|
49
|
-
const m = Object.keys(
|
|
58
|
+
function J(t = {}) {
|
|
59
|
+
function e(o, s, i, u) {
|
|
60
|
+
if (typeof i == "number")
|
|
61
|
+
return u[o].length === i;
|
|
62
|
+
if (typeof i == "object") {
|
|
63
|
+
const m = Object.keys(i)[0], y = i[m];
|
|
50
64
|
if (m === "not")
|
|
51
|
-
return Number(
|
|
65
|
+
return Number(u[o].length) !== Number(y);
|
|
52
66
|
if (m === "moreThan")
|
|
53
|
-
return Number(
|
|
67
|
+
return Number(u[o].length) >= Number(y);
|
|
54
68
|
if (m === "lessThan")
|
|
55
|
-
return Number(
|
|
69
|
+
return Number(u[o].length) <= Number(y);
|
|
56
70
|
}
|
|
57
71
|
return !1;
|
|
58
72
|
}
|
|
59
|
-
function
|
|
60
|
-
return
|
|
73
|
+
function c(o, s, i, u) {
|
|
74
|
+
return u[o] && u[o].propertyValue && String(u[o].propertyValue.value) === String(i);
|
|
61
75
|
}
|
|
62
|
-
const
|
|
76
|
+
const r = /* @__PURE__ */ new Map([
|
|
63
77
|
["length", e],
|
|
64
|
-
["getProperty",
|
|
78
|
+
["getProperty", c]
|
|
65
79
|
]);
|
|
66
|
-
Object.keys(t).reduce((
|
|
67
|
-
function o
|
|
68
|
-
const
|
|
69
|
-
return typeof
|
|
70
|
-
if (
|
|
71
|
-
return { target:
|
|
72
|
-
const m =
|
|
73
|
-
return { target:
|
|
80
|
+
Object.keys(t).reduce((o, s) => (o.set(s, t[s]), o), r);
|
|
81
|
+
function n(o, s) {
|
|
82
|
+
const i = o;
|
|
83
|
+
return typeof s == "number" ? [{ target: i, operator: "length", param: null, value: Number(s) }] : typeof s == "boolean" ? [{ target: i, operator: "getProperty", param: o, value: !!s }] : typeof s == "object" ? Object.keys(s).map((u) => {
|
|
84
|
+
if (u === "length")
|
|
85
|
+
return { target: i, operator: "length", param: null, value: s[u] };
|
|
86
|
+
const m = u, y = s[u];
|
|
87
|
+
return { target: i, operator: "getProperty", param: m, value: y };
|
|
74
88
|
}) : [];
|
|
75
89
|
}
|
|
76
|
-
function
|
|
77
|
-
return Object.keys(
|
|
78
|
-
const m =
|
|
79
|
-
return
|
|
90
|
+
function a(o) {
|
|
91
|
+
return Object.keys(o).reduce((i, u) => {
|
|
92
|
+
const m = n(u, o[u]);
|
|
93
|
+
return i.push(...m), i;
|
|
80
94
|
}, []);
|
|
81
95
|
}
|
|
82
|
-
function
|
|
83
|
-
if (
|
|
84
|
-
const
|
|
85
|
-
return
|
|
96
|
+
function l(o, s) {
|
|
97
|
+
if (r.has(o.operator)) {
|
|
98
|
+
const i = r.get(o.operator);
|
|
99
|
+
return i && i(o.target, o.param, o.value, s) || !1;
|
|
86
100
|
}
|
|
87
101
|
return !1;
|
|
88
102
|
}
|
|
89
|
-
function f(
|
|
90
|
-
return
|
|
103
|
+
function f(o, s) {
|
|
104
|
+
return a(o).reduce((m, y) => m && l(y, s), !0);
|
|
91
105
|
}
|
|
92
|
-
function h(
|
|
93
|
-
const
|
|
94
|
-
return
|
|
106
|
+
function h(o, s) {
|
|
107
|
+
const i = Object.keys(o), u = i.includes("allOf"), m = i.includes("anyOf"), y = u || m, k = (y ? o[y ? u ? "allOf" : "anyOf" : "allOf"] : [o]).map((w) => f(w, s));
|
|
108
|
+
return u ? !k.includes(!1) : k.includes(!0);
|
|
95
109
|
}
|
|
96
110
|
return { parseValueSchema: h };
|
|
97
111
|
}
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
function
|
|
101
|
-
return
|
|
102
|
-
const f =
|
|
112
|
+
const Q = {}, U = {};
|
|
113
|
+
J();
|
|
114
|
+
function X(t, e, c = /* @__PURE__ */ new Map(), r = (l, f, h, o) => f, n = {}, a = (l) => l) {
|
|
115
|
+
return N[e.title] = e, q[e.title] = r, Q[e.title] = n, U[e.title] = a, (l = {}) => {
|
|
116
|
+
const f = G(l, e, c), h = Object.keys(t).reduce((o, s) => (o[s] = t[s].default, o), {});
|
|
103
117
|
return Object.assign(h, f);
|
|
104
118
|
};
|
|
105
119
|
}
|
|
106
|
-
function
|
|
120
|
+
function Y(t, e) {
|
|
107
121
|
return { customClass: e.class, customStyle: e.style };
|
|
108
122
|
}
|
|
109
|
-
const
|
|
110
|
-
["appearance",
|
|
123
|
+
const Z = /* @__PURE__ */ new Map([
|
|
124
|
+
["appearance", Y]
|
|
111
125
|
]);
|
|
112
|
-
function
|
|
126
|
+
function K(t, e, c) {
|
|
113
127
|
return e;
|
|
114
128
|
}
|
|
115
|
-
const
|
|
129
|
+
const C = "https://json-schema.org/draft/2020-12/schema", x = "https://farris-design.gitee.io/smoke-detector.schema.json", I = "smoke-detector", ee = "A Farris Component", te = "object", re = {
|
|
116
130
|
id: {
|
|
117
131
|
description: "The unique identifier for smoke-detector",
|
|
118
132
|
type: "string"
|
|
@@ -161,18 +175,18 @@ const K = "https://json-schema.org/draft/2020-12/schema", C = "https://farris-de
|
|
|
161
175
|
description: "下发数据",
|
|
162
176
|
type: "string"
|
|
163
177
|
}
|
|
164
|
-
},
|
|
178
|
+
}, ne = [
|
|
165
179
|
"id",
|
|
166
180
|
"type"
|
|
167
181
|
], oe = {
|
|
168
|
-
$schema:
|
|
169
|
-
$id:
|
|
170
|
-
title:
|
|
171
|
-
description:
|
|
172
|
-
type:
|
|
173
|
-
properties:
|
|
174
|
-
required:
|
|
175
|
-
},
|
|
182
|
+
$schema: C,
|
|
183
|
+
$id: x,
|
|
184
|
+
title: I,
|
|
185
|
+
description: ee,
|
|
186
|
+
type: te,
|
|
187
|
+
properties: re,
|
|
188
|
+
required: ne
|
|
189
|
+
}, ce = "smoke-detector", se = "A Farris Component", ie = "object", ae = {
|
|
176
190
|
basic: {
|
|
177
191
|
description: "Basic Infomation",
|
|
178
192
|
title: "基本信息",
|
|
@@ -247,28 +261,28 @@ const K = "https://json-schema.org/draft/2020-12/schema", C = "https://farris-de
|
|
|
247
261
|
}
|
|
248
262
|
}
|
|
249
263
|
}
|
|
250
|
-
},
|
|
251
|
-
title:
|
|
252
|
-
description:
|
|
253
|
-
type:
|
|
254
|
-
categories:
|
|
255
|
-
},
|
|
264
|
+
}, le = {
|
|
265
|
+
title: ce,
|
|
266
|
+
description: se,
|
|
267
|
+
type: ie,
|
|
268
|
+
categories: ae
|
|
269
|
+
}, A = {}, E = X(A, oe, Z, K, le), M = /* @__PURE__ */ $({
|
|
256
270
|
name: "FSmokeDetector",
|
|
257
|
-
props:
|
|
271
|
+
props: A,
|
|
258
272
|
emits: [""],
|
|
259
273
|
setup(t) {
|
|
260
|
-
return () =>
|
|
274
|
+
return () => P("div", {
|
|
261
275
|
class: "f-smoke-detector"
|
|
262
|
-
}, [
|
|
276
|
+
}, [P("img", {
|
|
263
277
|
title: "smoke-detector",
|
|
264
278
|
src: "./image/smoke-detector-2.png"
|
|
265
279
|
}, null)]);
|
|
266
280
|
}
|
|
267
281
|
});
|
|
268
|
-
function
|
|
269
|
-
var
|
|
270
|
-
const
|
|
271
|
-
function
|
|
282
|
+
function ue(t, e, c) {
|
|
283
|
+
var O;
|
|
284
|
+
const r = "", n = "", a = b();
|
|
285
|
+
function l() {
|
|
272
286
|
return (e == null ? void 0 : e.schema.componentType) !== "frame";
|
|
273
287
|
}
|
|
274
288
|
function f() {
|
|
@@ -277,105 +291,105 @@ function le(t, e, i) {
|
|
|
277
291
|
function h() {
|
|
278
292
|
return (e == null ? void 0 : e.schema.componentType) !== "frame";
|
|
279
293
|
}
|
|
280
|
-
function
|
|
294
|
+
function o() {
|
|
281
295
|
return (e == null ? void 0 : e.schema.componentType) === "frame";
|
|
282
296
|
}
|
|
283
|
-
function
|
|
284
|
-
if (!
|
|
297
|
+
function s(p) {
|
|
298
|
+
if (!p || !p.value)
|
|
285
299
|
return null;
|
|
286
|
-
if (
|
|
287
|
-
return
|
|
288
|
-
const g = b(
|
|
300
|
+
if (p.value.schema && p.value.schema.type === "component")
|
|
301
|
+
return p.value;
|
|
302
|
+
const g = b(p == null ? void 0 : p.value.parent), d = s(g);
|
|
289
303
|
return d || null;
|
|
290
304
|
}
|
|
291
|
-
function
|
|
292
|
-
const { componentInstance: g, designerItemElementRef: d } =
|
|
293
|
-
return !g || !g.value ? null : g.value.canMove ? d :
|
|
305
|
+
function i(p = e) {
|
|
306
|
+
const { componentInstance: g, designerItemElementRef: d } = p;
|
|
307
|
+
return !g || !g.value ? null : g.value.canMove ? d : i(p.parent);
|
|
294
308
|
}
|
|
295
|
-
function
|
|
296
|
-
return !!
|
|
309
|
+
function u(p) {
|
|
310
|
+
return !!c;
|
|
297
311
|
}
|
|
298
312
|
function m() {
|
|
299
313
|
return (e == null ? void 0 : e.schema.label) || (e == null ? void 0 : e.schema.title) || (e == null ? void 0 : e.schema.name);
|
|
300
314
|
}
|
|
301
315
|
function y() {
|
|
302
316
|
}
|
|
303
|
-
function
|
|
317
|
+
function D(p, g) {
|
|
304
318
|
}
|
|
305
|
-
function
|
|
306
|
-
const { componentType: d } =
|
|
307
|
-
let v = V(d,
|
|
319
|
+
function R(p, g) {
|
|
320
|
+
const { componentType: d } = p;
|
|
321
|
+
let v = V(d, p, g);
|
|
308
322
|
const F = d.toLowerCase().replace(/-/g, "_");
|
|
309
323
|
return v && !v.id && v.type === d && (v.id = `${F}_${Math.random().toString().slice(2, 6)}`), v;
|
|
310
324
|
}
|
|
311
|
-
function k(
|
|
325
|
+
function k(p) {
|
|
312
326
|
}
|
|
313
|
-
function
|
|
327
|
+
function S(...p) {
|
|
314
328
|
}
|
|
315
|
-
function
|
|
316
|
-
e != null && e.schema.contents && e.schema.contents.map((
|
|
329
|
+
function w() {
|
|
330
|
+
e != null && e.schema.contents && e.schema.contents.map((p) => {
|
|
317
331
|
var v;
|
|
318
|
-
let g =
|
|
319
|
-
|
|
332
|
+
let g = p.id;
|
|
333
|
+
p.type === "component-ref" && (g = p.component);
|
|
320
334
|
const d = t.value.querySelector(`#${g}-design-item`);
|
|
321
335
|
(v = d == null ? void 0 : d.componentInstance) != null && v.value.onRemoveComponent && d.componentInstance.value.onRemoveComponent();
|
|
322
336
|
});
|
|
323
337
|
}
|
|
324
|
-
return
|
|
325
|
-
canMove:
|
|
338
|
+
return a.value = {
|
|
339
|
+
canMove: l(),
|
|
326
340
|
canSelectParent: f(),
|
|
327
341
|
canDelete: h(),
|
|
328
|
-
canNested: !
|
|
342
|
+
canNested: !o(),
|
|
329
343
|
contents: e == null ? void 0 : e.schema.contents,
|
|
330
344
|
elementRef: t,
|
|
331
|
-
parent: (
|
|
345
|
+
parent: (O = e == null ? void 0 : e.parent) == null ? void 0 : O.componentInstance,
|
|
332
346
|
schema: e == null ? void 0 : e.schema,
|
|
333
|
-
styles:
|
|
334
|
-
designerClass:
|
|
335
|
-
canAccepts:
|
|
336
|
-
getBelongedComponentInstance:
|
|
337
|
-
getDraggableDesignItemElement:
|
|
347
|
+
styles: r,
|
|
348
|
+
designerClass: n,
|
|
349
|
+
canAccepts: u,
|
|
350
|
+
getBelongedComponentInstance: s,
|
|
351
|
+
getDraggableDesignItemElement: i,
|
|
338
352
|
getDraggingDisplayText: m,
|
|
339
|
-
getPropConfig:
|
|
353
|
+
getPropConfig: S,
|
|
340
354
|
getDragScopeElement: y,
|
|
341
|
-
onAcceptMovedChildElement:
|
|
355
|
+
onAcceptMovedChildElement: D,
|
|
342
356
|
onChildElementMovedOut: k,
|
|
343
|
-
addNewChildComponentSchema:
|
|
357
|
+
addNewChildComponentSchema: R,
|
|
344
358
|
triggerBelongedComponentToMoveWhenMoved: b(!1),
|
|
345
359
|
triggerBelongedComponentToDeleteWhenDeleted: b(!1),
|
|
346
|
-
onRemoveComponent:
|
|
347
|
-
},
|
|
360
|
+
onRemoveComponent: w
|
|
361
|
+
}, a;
|
|
348
362
|
}
|
|
349
|
-
const
|
|
363
|
+
const pe = /* @__PURE__ */ $({
|
|
350
364
|
name: "FSmokeDetectorDesign",
|
|
351
|
-
props:
|
|
365
|
+
props: A,
|
|
352
366
|
emits: [""],
|
|
353
367
|
setup(t, e) {
|
|
354
|
-
const
|
|
368
|
+
const c = b(), r = _("design-item-context"), n = ue(c, r);
|
|
355
369
|
return L(() => {
|
|
356
|
-
|
|
357
|
-
}), e.expose(
|
|
358
|
-
ref:
|
|
370
|
+
c.value.componentInstance = n;
|
|
371
|
+
}), e.expose(n.value), () => P("div", {
|
|
372
|
+
ref: c,
|
|
359
373
|
class: "f-smoke-detector"
|
|
360
|
-
}, [
|
|
374
|
+
}, [P("img", {
|
|
361
375
|
title: "smoke-detector",
|
|
362
376
|
src: "../image/smoke-detector-2.png"
|
|
363
377
|
}, null)]);
|
|
364
378
|
}
|
|
365
|
-
}),
|
|
379
|
+
}), de = {
|
|
366
380
|
install(t) {
|
|
367
|
-
t.component(
|
|
381
|
+
t.component(M.name, M);
|
|
368
382
|
},
|
|
369
|
-
register(t, e,
|
|
370
|
-
t["smoke-detector"] =
|
|
383
|
+
register(t, e, c, r) {
|
|
384
|
+
t["smoke-detector"] = M, e["smoke-detector"] = E;
|
|
371
385
|
},
|
|
372
|
-
registerDesigner(t, e,
|
|
373
|
-
t["smoke-detector"] =
|
|
386
|
+
registerDesigner(t, e, c) {
|
|
387
|
+
t["smoke-detector"] = pe, e["smoke-detector"] = E;
|
|
374
388
|
}
|
|
375
389
|
};
|
|
376
390
|
export {
|
|
377
|
-
|
|
378
|
-
|
|
391
|
+
M as SmokeDetector,
|
|
392
|
+
de as default,
|
|
379
393
|
E as propsResolver,
|
|
380
|
-
|
|
394
|
+
A as smokeDetectorProps
|
|
381
395
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(v,
|
|
1
|
+
(function(v,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es"],f):(v=typeof globalThis<"u"?globalThis:v||self,f(v["smoke-detector"]={},v.Vue,v.LodashES))})(this,function(v,f,P){"use strict";const $={},j={};function S(t){const{properties:e,title:c,ignore:r}=t,n=r&&Array.isArray(r),a=Object.keys(e).reduce((l,d)=>((!n||!r.find(b=>b===d))&&(l[d]=e[d].type==="object"&&e[d].properties?S(e[d]):P.cloneDeep(e[d].default)),l),{});if(c&&(!n||!r.find(l=>l==="id"))){const l=c.toLowerCase().replace(/-/g,"_");a.id=`${l}_${Math.random().toString().slice(2,6)}`}return a}function V(t){const{properties:e,title:c,required:r}=t;if(r&&Array.isArray(r)){const n=r.reduce((a,l)=>(a[l]=e[l].type==="object"&&e[l].properties?S(e[l]):P.cloneDeep(e[l].default),a),{});if(c&&r.find(a=>a==="id")){const a=c.toLowerCase().replace(/-/g,"_");n.id=`${a}_${Math.random().toString().slice(2,6)}`}return n}return{type:c}}function A(t,e={},c){const r=$[t];if(r){let n=V(r);const a=j[t];return n=a?a({getSchemaByType:A},n,e,c):n,n}return null}function q(t,e){const c=S(e);return Object.keys(c).reduce((r,n)=>(Object.prototype.hasOwnProperty.call(t,n)&&(r[n]&&P.isPlainObject(r[n])&&P.isPlainObject(t[n]||!t[n])?Object.assign(r[n],t[n]||{}):r[n]=t[n]),r),c),c}function _(t,e){return Object.keys(t).filter(r=>t[r]!=null).reduce((r,n)=>{if(e.has(n)){const a=e.get(n);if(typeof a=="string")r[a]=t[n];else{const l=a(n,t[n],t);Object.assign(r,l)}}else r[n]=t[n];return r},{})}function F(t,e,c=new Map){const r=q(t,e);return _(r,c)}function L(t={}){function e(o,s,i,u){if(typeof i=="number")return u[o].length===i;if(typeof i=="object"){const m=Object.keys(i)[0],h=i[m];if(m==="not")return Number(u[o].length)!==Number(h);if(m==="moreThan")return Number(u[o].length)>=Number(h);if(m==="lessThan")return Number(u[o].length)<=Number(h)}return!1}function c(o,s,i,u){return u[o]&&u[o].propertyValue&&String(u[o].propertyValue.value)===String(i)}const r=new Map([["length",e],["getProperty",c]]);Object.keys(t).reduce((o,s)=>(o.set(s,t[s]),o),r);function n(o,s){const i=o;return typeof s=="number"?[{target:i,operator:"length",param:null,value:Number(s)}]:typeof s=="boolean"?[{target:i,operator:"getProperty",param:o,value:!!s}]:typeof s=="object"?Object.keys(s).map(u=>{if(u==="length")return{target:i,operator:"length",param:null,value:s[u]};const m=u,h=s[u];return{target:i,operator:"getProperty",param:m,value:h}}):[]}function a(o){return Object.keys(o).reduce((i,u)=>{const m=n(u,o[u]);return i.push(...m),i},[])}function l(o,s){if(r.has(o.operator)){const i=r.get(o.operator);return i&&i(o.target,o.param,o.value,s)||!1}return!1}function d(o,s){return a(o).reduce((m,h)=>m&&l(h,s),!0)}function b(o,s){const i=Object.keys(o),u=i.includes("allOf"),m=i.includes("anyOf"),h=u||m,T=(h?o[h?u?"allOf":"anyOf":"allOf"]:[o]).map(R=>d(R,s));return u?!T.includes(!1):T.includes(!0)}return{parseValueSchema:b}}const W={},H={};L();function z(t,e,c=new Map,r=(l,d,b,o)=>d,n={},a=l=>l){return $[e.title]=e,j[e.title]=r,W[e.title]=n,H[e.title]=a,(l={})=>{const d=F(l,e,c),b=Object.keys(t).reduce((o,s)=>(o[s]=t[s].default,o),{});return Object.assign(b,d)}}function G(t,e){return{customClass:e.class,customStyle:e.style}}const J=new Map([["appearance",G]]);function Q(t,e,c){return e}const U={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/smoke-detector.schema.json",title:"smoke-detector",description:"A Farris Component",type:"object",properties:{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"}},required:["id","type"]},X={title:"smoke-detector",description:"A Farris Component",type:"object",categories:{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:"下发数据"}}}}},D={},w=z(D,U,J,Q,X),M=f.defineComponent({name:"FSmokeDetector",props:D,emits:[""],setup(t){return()=>f.createVNode("div",{class:"f-smoke-detector"},[f.createVNode("img",{title:"smoke-detector",src:"./image/smoke-detector-2.png"},null)])}});function Y(t,e,c){var E;const r="",n="",a=f.ref();function l(){return(e==null?void 0:e.schema.componentType)!=="frame"}function d(){return!1}function b(){return(e==null?void 0:e.schema.componentType)!=="frame"}function o(){return(e==null?void 0:e.schema.componentType)==="frame"}function s(p){if(!p||!p.value)return null;if(p.value.schema&&p.value.schema.type==="component")return p.value;const g=f.ref(p==null?void 0:p.value.parent),y=s(g);return y||null}function i(p=e){const{componentInstance:g,designerItemElementRef:y}=p;return!g||!g.value?null:g.value.canMove?y:i(p.parent)}function u(p){return!!c}function m(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function h(){}function O(p,g){}function N(p,g){const{componentType:y}=p;let k=A(y,p,g);const K=y.toLowerCase().replace(/-/g,"_");return k&&!k.id&&k.type===y&&(k.id=`${K}_${Math.random().toString().slice(2,6)}`),k}function T(p){}function B(...p){}function R(){e!=null&&e.schema.contents&&e.schema.contents.map(p=>{var k;let g=p.id;p.type==="component-ref"&&(g=p.component);const y=t.value.querySelector(`#${g}-design-item`);(k=y==null?void 0:y.componentInstance)!=null&&k.value.onRemoveComponent&&y.componentInstance.value.onRemoveComponent()})}return a.value={canMove:l(),canSelectParent:d(),canDelete:b(),canNested:!o(),contents:e==null?void 0:e.schema.contents,elementRef:t,parent:(E=e==null?void 0:e.parent)==null?void 0:E.componentInstance,schema:e==null?void 0:e.schema,styles:r,designerClass:n,canAccepts:u,getBelongedComponentInstance:s,getDraggableDesignItemElement:i,getDraggingDisplayText:m,getPropConfig:B,getDragScopeElement:h,onAcceptMovedChildElement:O,onChildElementMovedOut:T,addNewChildComponentSchema:N,triggerBelongedComponentToMoveWhenMoved:f.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:f.ref(!1),onRemoveComponent:R},a}const Z=f.defineComponent({name:"FSmokeDetectorDesign",props:D,emits:[""],setup(t,e){const c=f.ref(),r=f.inject("design-item-context"),n=Y(c,r);return f.onMounted(()=>{c.value.componentInstance=n}),e.expose(n.value),()=>f.createVNode("div",{ref:c,class:"f-smoke-detector"},[f.createVNode("img",{title:"smoke-detector",src:"../image/smoke-detector-2.png"},null)])}}),C={install(t){t.component(M.name,M)},register(t,e,c,r){t["smoke-detector"]=M,e["smoke-detector"]=w},registerDesigner(t,e,c){t["smoke-detector"]=Z,e["smoke-detector"]=w}};v.SmokeDetector=M,v.default=C,v.propsResolver=w,v.smokeDetectorProps=D,Object.defineProperties(v,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|