@farris/ui-vue 1.3.3 → 1.3.5
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/binding-selector/index.esm.js +15 -15
- package/components/binding-selector/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +108 -107
- package/components/condition/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +4532 -4268
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +2709 -2690
- package/components/data-view/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +4795 -4375
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/dynamic-form/index.esm.js +601 -593
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/event-parameter/index.css +1 -0
- package/components/event-parameter/index.esm.js +2685 -165
- package/components/event-parameter/index.umd.cjs +1 -1
- package/components/events-editor/index.css +1 -1
- package/components/events-editor/index.esm.js +594 -575
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/external-container/index.esm.js +772 -772
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +2921 -2902
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +4137 -4050
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.esm.js +4569 -4149
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +936 -936
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +5226 -4962
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +4648 -4384
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/property-panel/index.css +1 -1
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +6128 -5879
- package/components/query-solution/index.umd.cjs +6 -6
- package/components/radio-group/index.esm.js +6 -6
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +975 -973
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/section/index.esm.js +2107 -417
- package/components/section/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +577 -575
- package/components/tabs/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +84 -79
- package/components/textarea/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +3307 -3288
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +1537 -1533
- package/components/tree-view/index.umd.cjs +1 -1
- package/farris.all.esm.js +24890 -24173
- 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/data-grid/src/components/data/data-grid-area.component.d.ts +8 -0
- package/types/data-grid/src/components/data/data-grid-area.props.d.ts +3 -0
- package/types/data-view/composition/types.d.ts +1 -0
- package/types/dynamic-form/src/designer/form-group-use-designer-rules.d.ts +1 -2
- package/types/entity-binding-selector/composition/use-entity-tree.d.ts +14 -3
- package/types/entity-binding-selector/composition/use-field-tree.d.ts +28 -0
- package/types/event-parameter/src/composition/use-general-editor.d.ts +26 -0
- package/types/event-parameter/src/event-parameter.props.d.ts +4 -4
- package/types/events-editor/src/composition/types.d.ts +1 -1
- package/types/query-solution/src/composition/types.d.ts +55 -0
- package/types/query-solution/src/composition/use-condition.d.ts +19 -0
- package/types/query-solution/src/designer/query-solution-config/composition/types.d.ts +3 -2
- package/types/query-solution/src/designer/query-solution-config/converter/query-solution-config-property.converter.d.ts +4 -0
- package/types/section/index.d.ts +15 -0
- package/types/section/src/designer/section-header.design.component.d.ts +4 -0
- package/types/section/src/designer/section-toolbar-item.props.d.ts +19 -0
- package/types/section/src/designer/section-toolbar.design.component.d.ts +3 -0
|
@@ -1,104 +1,108 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var De = Object.defineProperty;
|
|
2
|
+
var Pe = (n, e, t) => e in n ? De(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var E = (n, e, t) => Pe(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { ref as w, computed as A, createVNode as m, defineComponent as Z, watch as X, onMounted as W, inject as N, getCurrentInstance as Ae, createTextVNode as le, provide as ke, onBeforeUnmount as Ee, withModifiers as xe, onUnmounted as Be, Fragment as Ie } from "vue";
|
|
5
|
+
import { isPlainObject as ae, cloneDeep as ue } from "lodash-es";
|
|
6
|
+
import Re from "../response-toolbar/index.esm.js";
|
|
4
7
|
import "bignumber.js";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
import { useDesignerInnerComponent as de } from "../designer-canvas/index.esm.js";
|
|
9
|
+
import { getCustomClass as ne, withInstall as $e } from "../common/index.esm.js";
|
|
10
|
+
const pe = {}, fe = {};
|
|
11
|
+
function oe(n) {
|
|
12
|
+
const { properties: e, title: t, ignore: s } = n, r = s && Array.isArray(s), a = Object.keys(e).reduce((i, g) => ((!r || !s.find((f) => f === g)) && (i[g] = e[g].type === "object" && e[g].properties ? oe(e[g]) : ue(e[g].default)), i), {});
|
|
13
|
+
if (t && (!r || !s.find((i) => i === "id"))) {
|
|
14
|
+
const i = t.toLowerCase().replace(/-/g, "_");
|
|
15
|
+
a.id = `${i}_${Math.random().toString().slice(2, 6)}`;
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
}
|
|
19
|
+
function J(n, e = {}, t) {
|
|
20
|
+
const s = pe[n];
|
|
21
|
+
if (s) {
|
|
22
|
+
let r = oe(s);
|
|
23
|
+
const a = fe[n];
|
|
24
|
+
return r = a ? a({ getSchemaByType: J }, r, e, t) : r, r;
|
|
21
25
|
}
|
|
22
26
|
return null;
|
|
23
27
|
}
|
|
24
|
-
function
|
|
25
|
-
const t =
|
|
26
|
-
return Object.keys(t).reduce((
|
|
28
|
+
function je(n, e) {
|
|
29
|
+
const t = oe(e);
|
|
30
|
+
return Object.keys(t).reduce((s, r) => (s[r] && ae(s[r]) && ae(n[r] || !n[r]) ? Object.assign(s[r], n[r] || {}) : s[r] = n[r], s), t), t;
|
|
27
31
|
}
|
|
28
|
-
function
|
|
29
|
-
return Object.keys(n).filter((
|
|
30
|
-
if (e.has(
|
|
31
|
-
const
|
|
32
|
-
if (typeof
|
|
33
|
-
a
|
|
32
|
+
function Le(n, e) {
|
|
33
|
+
return Object.keys(n).filter((s) => n[s] != null).reduce((s, r) => {
|
|
34
|
+
if (e.has(r)) {
|
|
35
|
+
const a = e.get(r);
|
|
36
|
+
if (typeof a == "string")
|
|
37
|
+
s[a] = n[r];
|
|
34
38
|
else {
|
|
35
|
-
const
|
|
36
|
-
Object.assign(
|
|
39
|
+
const i = a(r, n[r], n);
|
|
40
|
+
Object.assign(s, i);
|
|
37
41
|
}
|
|
38
42
|
} else
|
|
39
|
-
|
|
40
|
-
return
|
|
43
|
+
s[r] = n[r];
|
|
44
|
+
return s;
|
|
41
45
|
}, {});
|
|
42
46
|
}
|
|
43
|
-
function
|
|
44
|
-
const
|
|
45
|
-
return
|
|
46
|
-
}
|
|
47
|
-
function
|
|
48
|
-
function e(
|
|
49
|
-
if (typeof
|
|
50
|
-
return u
|
|
51
|
-
if (typeof
|
|
52
|
-
const
|
|
53
|
-
if (
|
|
54
|
-
return Number(u
|
|
55
|
-
if (
|
|
56
|
-
return Number(u
|
|
57
|
-
if (
|
|
58
|
-
return Number(u
|
|
47
|
+
function Fe(n, e, t = /* @__PURE__ */ new Map()) {
|
|
48
|
+
const s = je(n, e);
|
|
49
|
+
return Le(s, t);
|
|
50
|
+
}
|
|
51
|
+
function Oe(n = {}) {
|
|
52
|
+
function e(u, h, p, b) {
|
|
53
|
+
if (typeof p == "number")
|
|
54
|
+
return b[u].length === p;
|
|
55
|
+
if (typeof p == "object") {
|
|
56
|
+
const y = Object.keys(p)[0], M = p[y];
|
|
57
|
+
if (y === "not")
|
|
58
|
+
return Number(b[u].length) !== Number(M);
|
|
59
|
+
if (y === "moreThan")
|
|
60
|
+
return Number(b[u].length) >= Number(M);
|
|
61
|
+
if (y === "lessThan")
|
|
62
|
+
return Number(b[u].length) <= Number(M);
|
|
59
63
|
}
|
|
60
64
|
return !1;
|
|
61
65
|
}
|
|
62
|
-
function t(
|
|
63
|
-
return u
|
|
66
|
+
function t(u, h, p, b) {
|
|
67
|
+
return b[u] && b[u].propertyValue && String(b[u].propertyValue.value) === String(p);
|
|
64
68
|
}
|
|
65
|
-
const
|
|
69
|
+
const s = /* @__PURE__ */ new Map([
|
|
66
70
|
["length", e],
|
|
67
71
|
["getProperty", t]
|
|
68
72
|
]);
|
|
69
|
-
Object.keys(n).reduce((
|
|
70
|
-
function
|
|
71
|
-
const
|
|
72
|
-
return typeof
|
|
73
|
-
if (
|
|
74
|
-
return { target:
|
|
75
|
-
const
|
|
76
|
-
return { target:
|
|
73
|
+
Object.keys(n).reduce((u, h) => (u.set(h, n[h]), u), s);
|
|
74
|
+
function r(u, h) {
|
|
75
|
+
const p = u;
|
|
76
|
+
return typeof h == "number" ? [{ target: p, operator: "length", param: null, value: Number(h) }] : typeof h == "boolean" ? [{ target: p, operator: "getProperty", param: u, value: !!h }] : typeof h == "object" ? Object.keys(h).map((b) => {
|
|
77
|
+
if (b === "length")
|
|
78
|
+
return { target: p, operator: "length", param: null, value: h[b] };
|
|
79
|
+
const y = b, M = h[b];
|
|
80
|
+
return { target: p, operator: "getProperty", param: y, value: M };
|
|
77
81
|
}) : [];
|
|
78
82
|
}
|
|
79
|
-
function
|
|
80
|
-
return Object.keys(
|
|
81
|
-
const
|
|
82
|
-
return
|
|
83
|
+
function a(u) {
|
|
84
|
+
return Object.keys(u).reduce((p, b) => {
|
|
85
|
+
const y = r(b, u[b]);
|
|
86
|
+
return p.push(...y), p;
|
|
83
87
|
}, []);
|
|
84
88
|
}
|
|
85
|
-
function
|
|
86
|
-
if (
|
|
87
|
-
const
|
|
88
|
-
return
|
|
89
|
+
function i(u, h) {
|
|
90
|
+
if (s.has(u.operator)) {
|
|
91
|
+
const p = s.get(u.operator);
|
|
92
|
+
return p && p(u.target, u.param, u.value, h) || !1;
|
|
89
93
|
}
|
|
90
94
|
return !1;
|
|
91
95
|
}
|
|
92
|
-
function
|
|
93
|
-
return
|
|
96
|
+
function g(u, h) {
|
|
97
|
+
return a(u).reduce((y, M) => y && i(M, h), !0);
|
|
94
98
|
}
|
|
95
|
-
function
|
|
96
|
-
const
|
|
97
|
-
return
|
|
99
|
+
function f(u, h) {
|
|
100
|
+
const p = Object.keys(u), b = p.includes("allOf"), y = p.includes("anyOf"), M = b || y, R = (M ? u[M ? b ? "allOf" : "anyOf" : "allOf"] : [u]).map((x) => g(x, h));
|
|
101
|
+
return b ? !R.includes(!1) : R.includes(!0);
|
|
98
102
|
}
|
|
99
|
-
return { parseValueSchema:
|
|
103
|
+
return { parseValueSchema: f };
|
|
100
104
|
}
|
|
101
|
-
const
|
|
105
|
+
const q = {
|
|
102
106
|
button: { type: "button", name: "按钮", icon: "Button" },
|
|
103
107
|
"response-toolbar": { type: "response-toolbar", name: "工具栏", icon: "ButtonGroup" },
|
|
104
108
|
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮", icon: "Button" },
|
|
@@ -138,63 +142,64 @@ const P = {
|
|
|
138
142
|
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏", icon: "TabToolbar" },
|
|
139
143
|
fieldset: { type: "fieldset", name: "分组", icon: "fieldset" },
|
|
140
144
|
"query-solution": { type: "query-solution", name: "筛选方案", icon: "QueryScheme" }
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
function ee(n, e, t = /* @__PURE__ */ new Map(),
|
|
144
|
-
return
|
|
145
|
-
const
|
|
146
|
-
return Object.assign(
|
|
145
|
+
}, Ne = {}, Ve = {};
|
|
146
|
+
Oe();
|
|
147
|
+
function ee(n, e, t = /* @__PURE__ */ new Map(), s = (i, g, f, u) => g, r = {}, a = (i) => i) {
|
|
148
|
+
return pe[e.title] = e, fe[e.title] = s, Ne[e.title] = r, Ve[e.title] = a, (i = {}) => {
|
|
149
|
+
const g = Fe(i, e, t), f = Object.keys(n).reduce((u, h) => (u[h] = n[h].default, u), {});
|
|
150
|
+
return Object.assign(f, g);
|
|
147
151
|
};
|
|
148
152
|
}
|
|
149
|
-
function
|
|
153
|
+
function me(n, e) {
|
|
150
154
|
return { customClass: e.class, customStyle: e.style };
|
|
151
155
|
}
|
|
152
|
-
function
|
|
156
|
+
function _e(n, e, t) {
|
|
153
157
|
return e ? { enableAccordion: t.accordionMode } : { enableAccordion: "" };
|
|
154
158
|
}
|
|
155
|
-
function
|
|
159
|
+
function qe(n, e) {
|
|
156
160
|
return {
|
|
157
161
|
buttons: e.buttons,
|
|
158
162
|
buttonPosition: e.position
|
|
159
163
|
};
|
|
160
164
|
}
|
|
161
|
-
const
|
|
162
|
-
["appearance",
|
|
165
|
+
const ze = /* @__PURE__ */ new Map([
|
|
166
|
+
["appearance", me],
|
|
163
167
|
["expanded", "expandStatus"],
|
|
164
|
-
["enableAccordion",
|
|
165
|
-
["toolbar",
|
|
168
|
+
["enableAccordion", _e],
|
|
169
|
+
["toolbar", qe]
|
|
166
170
|
]);
|
|
167
|
-
function
|
|
168
|
-
const
|
|
171
|
+
function Ue(n, e, t) {
|
|
172
|
+
const s = Math.random().toString().slice(2, 6), r = t.parentComponentInstance;
|
|
169
173
|
Object.assign(e, {
|
|
170
|
-
id: `section-${
|
|
174
|
+
id: `section-${s}`,
|
|
171
175
|
appearance: {
|
|
172
176
|
class: "f-section-in-mainsubcard"
|
|
173
177
|
},
|
|
174
178
|
enableAccordion: !1,
|
|
175
179
|
mainTitle: t.mainTitle || e.mainTitle || "标题"
|
|
176
180
|
});
|
|
177
|
-
const
|
|
178
|
-
Object.assign(
|
|
179
|
-
id: `container-${
|
|
181
|
+
const a = n.getSchemaByType("content-container");
|
|
182
|
+
Object.assign(a, {
|
|
183
|
+
id: `container-${s}`,
|
|
180
184
|
appearance: {
|
|
181
185
|
class: "f-struct-wrapper"
|
|
182
186
|
},
|
|
183
187
|
contents: [e]
|
|
184
188
|
});
|
|
185
|
-
const
|
|
186
|
-
switch (
|
|
187
|
-
case
|
|
189
|
+
const i = r.schema;
|
|
190
|
+
switch (i && i.type) {
|
|
191
|
+
case q["splitter-pane"].type: {
|
|
188
192
|
e.appearance.class = "f-section-in-main";
|
|
189
193
|
break;
|
|
190
194
|
}
|
|
191
195
|
}
|
|
192
|
-
|
|
196
|
+
const g = r.elementRef, f = window.getComputedStyle(g);
|
|
197
|
+
return f && f.display === "flex" && (a.appearance.class += " d-block"), a;
|
|
193
198
|
}
|
|
194
|
-
function
|
|
195
|
-
return t.parentComponentInstance ?
|
|
199
|
+
function He(n, e, t) {
|
|
200
|
+
return t.parentComponentInstance ? Ue(n, e, t) : e;
|
|
196
201
|
}
|
|
197
|
-
const
|
|
202
|
+
const We = "https://json-schema.org/draft/2020-12/schema", Ge = "https://farris-design.gitee.io/section.schema.json", Qe = "section", Ze = "A Farris Container Component", Je = "object", Xe = {
|
|
198
203
|
id: {
|
|
199
204
|
description: "The unique identifier for a Section",
|
|
200
205
|
type: "string"
|
|
@@ -306,7 +311,7 @@ const se = "https://json-schema.org/draft/2020-12/schema", ce = "https://farris-
|
|
|
306
311
|
properties: {
|
|
307
312
|
type: {
|
|
308
313
|
type: "string",
|
|
309
|
-
default: "
|
|
314
|
+
default: "section-toolbar"
|
|
310
315
|
},
|
|
311
316
|
position: {
|
|
312
317
|
type: "string",
|
|
@@ -319,19 +324,19 @@ const se = "https://json-schema.org/draft/2020-12/schema", ce = "https://farris-
|
|
|
319
324
|
},
|
|
320
325
|
default: null
|
|
321
326
|
}
|
|
322
|
-
},
|
|
327
|
+
}, Ye = [
|
|
323
328
|
"id",
|
|
324
329
|
"type",
|
|
325
330
|
"contents"
|
|
326
|
-
],
|
|
327
|
-
$schema:
|
|
328
|
-
$id:
|
|
329
|
-
title:
|
|
330
|
-
description:
|
|
331
|
-
type:
|
|
332
|
-
properties:
|
|
333
|
-
required:
|
|
334
|
-
},
|
|
331
|
+
], Ke = {
|
|
332
|
+
$schema: We,
|
|
333
|
+
$id: Ge,
|
|
334
|
+
title: Qe,
|
|
335
|
+
description: Ze,
|
|
336
|
+
type: Je,
|
|
337
|
+
properties: Xe,
|
|
338
|
+
required: Ye
|
|
339
|
+
}, se = {
|
|
335
340
|
/** 设置内容区域样式 */
|
|
336
341
|
contentClass: { type: String, default: "" },
|
|
337
342
|
/** 自定义样式 */
|
|
@@ -376,11 +381,11 @@ const se = "https://json-schema.org/draft/2020-12/schema", ce = "https://farris-
|
|
|
376
381
|
// toolbarPosition: { type: String, default: '' },
|
|
377
382
|
// toolbarButtons: { type: Array<object>, default: [] },
|
|
378
383
|
// toolbar: { type: Object as PropType<ToolbarConfig>, default: {} }
|
|
379
|
-
},
|
|
380
|
-
function
|
|
381
|
-
let
|
|
382
|
-
function
|
|
383
|
-
const
|
|
384
|
+
}, he = ee(se, Ke, ze, He);
|
|
385
|
+
function ge(n, e, t) {
|
|
386
|
+
let s;
|
|
387
|
+
function r(f = 1) {
|
|
388
|
+
const u = [
|
|
384
389
|
"body>.f-datagrid-settings-simple-host",
|
|
385
390
|
"body>div",
|
|
386
391
|
"body>farris-dialog>.farris-modal.show",
|
|
@@ -390,185 +395,185 @@ function ye(n, e, t) {
|
|
|
390
395
|
"body>.popover.show",
|
|
391
396
|
"body>filter-row-panel>.f-datagrid-filter-panel",
|
|
392
397
|
"body>.f-section-maximize"
|
|
393
|
-
],
|
|
394
|
-
const { display:
|
|
395
|
-
return
|
|
396
|
-
}).filter((
|
|
397
|
-
let
|
|
398
|
-
return
|
|
398
|
+
], h = Array.from(document.body.querySelectorAll(u.join(","))).filter((b) => b).map((b) => {
|
|
399
|
+
const { display: y, zIndex: M } = window.getComputedStyle(b);
|
|
400
|
+
return y === "none" ? 0 : parseInt(M, 10);
|
|
401
|
+
}).filter((b) => b);
|
|
402
|
+
let p = Math.max(...h);
|
|
403
|
+
return p < 1040 && (p = 1040), p + f;
|
|
399
404
|
}
|
|
400
|
-
function
|
|
401
|
-
|
|
402
|
-
const
|
|
403
|
-
|
|
405
|
+
function a() {
|
|
406
|
+
s = n.value.nextElementSibling;
|
|
407
|
+
const f = document && document.querySelector("body");
|
|
408
|
+
f && (f.appendChild(n.value), n.value.style.zIndex = r());
|
|
404
409
|
}
|
|
405
|
-
function
|
|
406
|
-
|
|
410
|
+
function i() {
|
|
411
|
+
s ? e.value.insertBefore(
|
|
407
412
|
n.value,
|
|
408
|
-
|
|
413
|
+
s
|
|
409
414
|
) : e.value.appendChild(n.value), n.value.style.zIndex = null;
|
|
410
415
|
}
|
|
411
|
-
function
|
|
412
|
-
!n || !e.value || (t.value = !t.value, t.value ?
|
|
416
|
+
function g() {
|
|
417
|
+
!n || !e.value || (t.value = !t.value, t.value ? a() : i());
|
|
413
418
|
}
|
|
414
|
-
return { onClickMaxMinIcon:
|
|
419
|
+
return { onClickMaxMinIcon: g };
|
|
415
420
|
}
|
|
416
|
-
function
|
|
417
|
-
const t =
|
|
418
|
-
function
|
|
419
|
-
e.emit("Click",
|
|
421
|
+
function ye(n, e) {
|
|
422
|
+
const t = w(n.buttons), s = A(() => n.buttonPosition === "inHead" ? "right" : "left"), r = A(() => "f-section-toolbar" + (n.buttonPosition === "inHead" ? " f-section-header--toolbar" : " f-section-content--toolbar")), a = A(() => n.buttons && n.buttons.length > 0 && n.buttonPosition === "inHead");
|
|
423
|
+
function i(g) {
|
|
424
|
+
e.emit("Click", g);
|
|
420
425
|
}
|
|
421
|
-
return () =>
|
|
422
|
-
customClass:
|
|
426
|
+
return () => a.value && m(Re, {
|
|
427
|
+
customClass: r.value,
|
|
423
428
|
items: t.value,
|
|
424
|
-
onClick:
|
|
425
|
-
alignment:
|
|
429
|
+
onClick: i,
|
|
430
|
+
alignment: s.value
|
|
426
431
|
}, null);
|
|
427
432
|
}
|
|
428
|
-
function
|
|
429
|
-
|
|
430
|
-
const
|
|
431
|
-
onClickMaxMinIcon:
|
|
432
|
-
} =
|
|
433
|
-
const
|
|
433
|
+
function et(n, e, t, s, r, a) {
|
|
434
|
+
w(n.subTitle);
|
|
435
|
+
const i = A(() => n.buttonPosition), g = ye(n, e), {
|
|
436
|
+
onClickMaxMinIcon: f
|
|
437
|
+
} = ge(s, r, a), u = A(() => !!n.subTitle), h = A(() => n.enableMaximize), p = A(() => n.enableAccordion !== ""), b = A(() => {
|
|
438
|
+
const x = {
|
|
434
439
|
"f-section-header": !0
|
|
435
440
|
};
|
|
436
|
-
return e.slots.header && n.headerClass.split(" ").reduce((
|
|
441
|
+
return e.slots.header && n.headerClass.split(" ").reduce((v, S) => (v[S] = !0, v), x), x;
|
|
437
442
|
});
|
|
438
|
-
function
|
|
439
|
-
|
|
443
|
+
function y(x) {
|
|
444
|
+
x.stopPropagation(), n.enableAccordion !== "" && (t.value = !t.value);
|
|
440
445
|
}
|
|
441
|
-
function
|
|
442
|
-
const
|
|
446
|
+
function M() {
|
|
447
|
+
const x = A(() => ({
|
|
443
448
|
btn: !0,
|
|
444
449
|
"f-btn-collapse-expand": !0,
|
|
445
450
|
"f-btn-mx": !0,
|
|
446
451
|
"f-state-expand": t.value
|
|
447
|
-
})),
|
|
452
|
+
})), B = A(() => ({
|
|
448
453
|
"f-icon": !0,
|
|
449
|
-
"f-icon-maximize": !
|
|
450
|
-
"f-icon-minimize":
|
|
454
|
+
"f-icon-maximize": !a.value,
|
|
455
|
+
"f-icon-minimize": a.value
|
|
451
456
|
}));
|
|
452
|
-
return
|
|
457
|
+
return m("div", {
|
|
453
458
|
class: "f-max-accordion"
|
|
454
|
-
}, [
|
|
455
|
-
class:
|
|
456
|
-
onClick:
|
|
457
|
-
}, null) : "",
|
|
458
|
-
class:
|
|
459
|
-
onClick:
|
|
460
|
-
}, [
|
|
461
|
-
}
|
|
462
|
-
function
|
|
463
|
-
return e.slots.header ?
|
|
464
|
-
class:
|
|
459
|
+
}, [h.value ? m("span", {
|
|
460
|
+
class: B.value,
|
|
461
|
+
onClick: f
|
|
462
|
+
}, null) : "", p.value ? m("button", {
|
|
463
|
+
class: x.value,
|
|
464
|
+
onClick: y
|
|
465
|
+
}, [m("span", null, [t.value ? n.collapseLabel : n.expandLabel])]) : ""]);
|
|
466
|
+
}
|
|
467
|
+
function k() {
|
|
468
|
+
return e.slots.header ? m("div", {
|
|
469
|
+
class: b.value
|
|
465
470
|
}, [e.slots.header()]) : "";
|
|
466
471
|
}
|
|
467
|
-
function
|
|
468
|
-
return
|
|
472
|
+
function I() {
|
|
473
|
+
return m("div", {
|
|
469
474
|
class: "f-title",
|
|
470
|
-
onClick:
|
|
471
|
-
}, [
|
|
475
|
+
onClick: y
|
|
476
|
+
}, [m("h4", {
|
|
472
477
|
class: "f-title-text"
|
|
473
|
-
}, [n.mainTitle]),
|
|
478
|
+
}, [n.mainTitle]), u.value && m("span", null, [n.subTitle])]);
|
|
474
479
|
}
|
|
475
|
-
function
|
|
476
|
-
const
|
|
477
|
-
const
|
|
480
|
+
function R() {
|
|
481
|
+
const x = A(() => {
|
|
482
|
+
const B = {
|
|
478
483
|
"f-content": !0
|
|
479
484
|
};
|
|
480
|
-
return n.headerContentClass && n.headerContentClass.split(" ").reduce((
|
|
485
|
+
return n.headerContentClass && n.headerContentClass.split(" ").reduce((S, D) => (S[D] = !0, S), B), B;
|
|
481
486
|
});
|
|
482
|
-
return e.slots.headerContent ?
|
|
483
|
-
class:
|
|
487
|
+
return e.slots.headerContent ? m("div", {
|
|
488
|
+
class: x.value
|
|
484
489
|
}, [e.slots.headerContent()]) : "";
|
|
485
490
|
}
|
|
486
|
-
function
|
|
487
|
-
return
|
|
488
|
-
class:
|
|
489
|
-
}, [e.slots.headerTitle ? e.slots.headerTitle() :
|
|
491
|
+
function L() {
|
|
492
|
+
return m("div", {
|
|
493
|
+
class: b.value
|
|
494
|
+
}, [e.slots.headerTitle ? e.slots.headerTitle() : I(), R(), i.value === "inHead" && g(), (h.value || p.value) && M()]);
|
|
490
495
|
}
|
|
491
|
-
return () => n.showHeader && (e.slots.header ?
|
|
496
|
+
return () => n.showHeader && (e.slots.header ? k() : L());
|
|
492
497
|
}
|
|
493
|
-
const
|
|
494
|
-
function
|
|
498
|
+
const tt = ["moz", "ms", "webkit"];
|
|
499
|
+
function nt() {
|
|
495
500
|
let n = 0;
|
|
496
501
|
return (e) => {
|
|
497
|
-
const t = (/* @__PURE__ */ new Date()).getTime(),
|
|
498
|
-
e(t +
|
|
499
|
-
},
|
|
500
|
-
return n = t +
|
|
502
|
+
const t = (/* @__PURE__ */ new Date()).getTime(), s = Math.max(0, 16 - (t - n)), r = setTimeout(() => {
|
|
503
|
+
e(t + s);
|
|
504
|
+
}, s);
|
|
505
|
+
return n = t + s, r;
|
|
501
506
|
};
|
|
502
507
|
}
|
|
503
|
-
function
|
|
508
|
+
function ot() {
|
|
504
509
|
if (typeof window > "u")
|
|
505
510
|
return () => 0;
|
|
506
511
|
if (window.requestAnimationFrame)
|
|
507
512
|
return window.requestAnimationFrame.bind(window);
|
|
508
|
-
const n =
|
|
509
|
-
return n ? window[`${n}RequestAnimationFrame`] :
|
|
513
|
+
const n = tt.filter((e) => `${e}RequestAnimationFrame` in window)[0];
|
|
514
|
+
return n ? window[`${n}RequestAnimationFrame`] : nt();
|
|
510
515
|
}
|
|
511
|
-
|
|
512
|
-
function
|
|
513
|
-
return ((e == null ? void 0 : e.split(" ")) || []).reduce((
|
|
516
|
+
ot();
|
|
517
|
+
function H(n, e) {
|
|
518
|
+
return ((e == null ? void 0 : e.split(" ")) || []).reduce((s, r) => (r && (s[r] = !0), s), n), n;
|
|
514
519
|
}
|
|
515
|
-
const
|
|
520
|
+
const Y = /* @__PURE__ */ Z({
|
|
516
521
|
name: "FSection",
|
|
517
|
-
props:
|
|
522
|
+
props: se,
|
|
518
523
|
emits: [],
|
|
519
524
|
setup(n, e) {
|
|
520
|
-
const t =
|
|
521
|
-
const
|
|
525
|
+
const t = w(), s = w(), r = w(n.customClass), a = A(() => n.enableAccordion), i = w(n.expandStatus), g = A(() => n.buttonPosition), f = w(!1), u = et(n, e, i, t, s, f), h = ye(n, e), p = A(() => {
|
|
526
|
+
const I = {
|
|
522
527
|
"f-section": !0,
|
|
523
|
-
"f-section-accordion":
|
|
524
|
-
"f-state-collapse": (
|
|
525
|
-
"f-section-custom-accordion":
|
|
528
|
+
"f-section-accordion": a.value === "default",
|
|
529
|
+
"f-state-collapse": (a.value === "default" || a.value === "custom") && !i.value,
|
|
530
|
+
"f-section-custom-accordion": a.value === "custom",
|
|
526
531
|
"f-section-fill": n.fill,
|
|
527
|
-
"f-section-maximize":
|
|
532
|
+
"f-section-maximize": f.value
|
|
528
533
|
};
|
|
529
|
-
return
|
|
530
|
-
}),
|
|
534
|
+
return H(I, r.value);
|
|
535
|
+
}), b = A(() => H({
|
|
531
536
|
"f-section-content": !0
|
|
532
|
-
}, n.contentClass)),
|
|
537
|
+
}, n.contentClass)), y = A(() => H({
|
|
533
538
|
"f-section-extend": !0
|
|
534
|
-
},
|
|
535
|
-
function
|
|
536
|
-
return e.slots.extend &&
|
|
537
|
-
class:
|
|
539
|
+
}, y.value));
|
|
540
|
+
function M() {
|
|
541
|
+
return e.slots.extend && m("div", {
|
|
542
|
+
class: y.value
|
|
538
543
|
}, [e.slots.extend()]);
|
|
539
544
|
}
|
|
540
|
-
function
|
|
541
|
-
return
|
|
542
|
-
class:
|
|
543
|
-
}, [
|
|
544
|
-
}
|
|
545
|
-
return
|
|
546
|
-
|
|
547
|
-
}),
|
|
548
|
-
t.value && t.value && (
|
|
549
|
-
}), () =>
|
|
550
|
-
class:
|
|
545
|
+
function k() {
|
|
546
|
+
return m("div", {
|
|
547
|
+
class: b.value
|
|
548
|
+
}, [g.value === "inContent" && h(), e.slots.default && e.slots.default()]);
|
|
549
|
+
}
|
|
550
|
+
return X(() => n.expandStatus, (I, R) => {
|
|
551
|
+
I !== R && (i.value = I);
|
|
552
|
+
}), W(() => {
|
|
553
|
+
t.value && t.value && (s.value = t.value.parentElement);
|
|
554
|
+
}), () => m("div", {
|
|
555
|
+
class: p.value,
|
|
551
556
|
ref: t,
|
|
552
557
|
style: n.customStyle
|
|
553
|
-
}, [
|
|
558
|
+
}, [u(), M(), k()]);
|
|
554
559
|
}
|
|
555
560
|
});
|
|
556
|
-
function
|
|
561
|
+
function st() {
|
|
557
562
|
function n(e, t) {
|
|
558
|
-
var
|
|
563
|
+
var i;
|
|
559
564
|
if (!e)
|
|
560
565
|
return !1;
|
|
561
|
-
const
|
|
562
|
-
if (!
|
|
566
|
+
const s = ((i = e.targetContainer) == null ? void 0 : i.componentInstance) && e.targetContainer.componentInstance.value;
|
|
567
|
+
if (!s)
|
|
563
568
|
return !1;
|
|
564
|
-
const
|
|
565
|
-
return !((e.componentCategory === "input" || e.componentType === "form-group") && ![
|
|
569
|
+
const r = s.schema.type, a = t == null ? void 0 : t.formSchemaUtils.getComponentById(s.belongedComponentId);
|
|
570
|
+
return !((e.componentCategory === "input" || e.componentType === "form-group") && ![q["response-layout-item"].type, q["response-form"].type].includes(r) || (e.componentType === q.tabs.type || e.componentType === q.section.type) && ((a == null ? void 0 : a.componentType) !== "frame" || ![q["content-container"].type, q["splitter-pane"].type, q["response-layout-item"].type].includes(r)));
|
|
566
571
|
}
|
|
567
572
|
return {
|
|
568
573
|
basalDragulaRuleForContainer: n
|
|
569
574
|
};
|
|
570
575
|
}
|
|
571
|
-
const
|
|
576
|
+
const rt = {
|
|
572
577
|
title: "section",
|
|
573
578
|
description: "A Farris Container Component",
|
|
574
579
|
type: "object",
|
|
@@ -671,270 +676,1955 @@ const ge = {
|
|
|
671
676
|
}
|
|
672
677
|
}
|
|
673
678
|
};
|
|
674
|
-
class
|
|
679
|
+
class it {
|
|
675
680
|
getTemplateRule(e, t) {
|
|
676
|
-
const
|
|
677
|
-
if (!
|
|
678
|
-
return
|
|
679
|
-
const
|
|
680
|
-
return
|
|
681
|
-
if (!
|
|
681
|
+
const s = t == null ? void 0 : t.formSchemaUtils, r = s == null ? void 0 : s.getFormTemplateRule(), a = { canAccept: !0, canDelete: !0, canMove: !0 };
|
|
682
|
+
if (!r)
|
|
683
|
+
return a;
|
|
684
|
+
const i = this.getComponentContext(e), { componentClassList: g } = i;
|
|
685
|
+
return g.forEach((f) => {
|
|
686
|
+
if (!f || !r[f])
|
|
682
687
|
return;
|
|
683
|
-
const { canMove:
|
|
684
|
-
|
|
685
|
-
}),
|
|
688
|
+
const { canMove: u, canDelete: h, canAccept: p } = r[f];
|
|
689
|
+
a.canMove = a.canMove && this.resolveRuleValue(u, i), a.canDelete = a.canDelete && this.resolveRuleValue(h, i), a.canAccept = a.canAccept && this.resolveRuleValue(p, i);
|
|
690
|
+
}), a;
|
|
686
691
|
}
|
|
687
692
|
resolveRuleValue(e, t) {
|
|
688
693
|
return typeof e == "boolean" ? e : this.parseRuleValueSchema(e, t);
|
|
689
694
|
}
|
|
690
695
|
parseRuleValueSchema(e, t) {
|
|
691
|
-
const
|
|
692
|
-
let
|
|
693
|
-
for (const
|
|
694
|
-
if (
|
|
695
|
-
if (
|
|
696
|
-
const { firstLevelChildClassList:
|
|
697
|
-
if (
|
|
698
|
-
|
|
696
|
+
const s = e.invalidContext || [];
|
|
697
|
+
let r = !0;
|
|
698
|
+
for (const a of s) {
|
|
699
|
+
if (a.firstLevelChild) {
|
|
700
|
+
if (a.firstLevelChild.class) {
|
|
701
|
+
const { firstLevelChildClassList: i } = t;
|
|
702
|
+
if (i && !i.includes(a.firstLevelChild.class)) {
|
|
703
|
+
r = !1;
|
|
699
704
|
continue;
|
|
700
705
|
}
|
|
701
706
|
}
|
|
702
|
-
if (
|
|
703
|
-
const { firstLevelChildSchema:
|
|
704
|
-
if (!
|
|
705
|
-
|
|
707
|
+
if (a.firstLevelChild.type) {
|
|
708
|
+
const { firstLevelChildSchema: i } = t;
|
|
709
|
+
if (!i || i.type !== a.firstLevelChild.type) {
|
|
710
|
+
r = !1;
|
|
706
711
|
continue;
|
|
707
712
|
}
|
|
708
713
|
}
|
|
709
714
|
}
|
|
710
|
-
if (
|
|
711
|
-
if (
|
|
712
|
-
const { secondLevelChildClassList:
|
|
713
|
-
if (
|
|
714
|
-
|
|
715
|
+
if (a.secondLevelChild) {
|
|
716
|
+
if (a.secondLevelChild.class) {
|
|
717
|
+
const { secondLevelChildClassList: i } = t;
|
|
718
|
+
if (i && !i.includes(a.secondLevelChild.class)) {
|
|
719
|
+
r = !1;
|
|
715
720
|
continue;
|
|
716
721
|
}
|
|
717
722
|
}
|
|
718
|
-
if (
|
|
719
|
-
const { secondLevelChildSchema:
|
|
720
|
-
if (!
|
|
721
|
-
|
|
723
|
+
if (a.secondLevelChild.type) {
|
|
724
|
+
const { secondLevelChildSchema: i } = t;
|
|
725
|
+
if (!i || i.type !== a.secondLevelChild.type) {
|
|
726
|
+
r = !1;
|
|
722
727
|
continue;
|
|
723
728
|
}
|
|
724
729
|
}
|
|
725
730
|
}
|
|
726
|
-
if (
|
|
727
|
-
if (
|
|
728
|
-
const { parentClassList:
|
|
729
|
-
if (
|
|
730
|
-
|
|
731
|
+
if (a.parent) {
|
|
732
|
+
if (a.parent.class) {
|
|
733
|
+
const { parentClassList: i } = t;
|
|
734
|
+
if (i && !i.includes(a.parent.class)) {
|
|
735
|
+
r = !1;
|
|
731
736
|
continue;
|
|
732
737
|
}
|
|
733
738
|
}
|
|
734
|
-
if (
|
|
735
|
-
const { parentSchema:
|
|
736
|
-
if (
|
|
737
|
-
|
|
739
|
+
if (a.parent.type) {
|
|
740
|
+
const { parentSchema: i } = t;
|
|
741
|
+
if (i && i.type !== a.parent.type) {
|
|
742
|
+
r = !1;
|
|
738
743
|
continue;
|
|
739
744
|
}
|
|
740
745
|
}
|
|
741
746
|
}
|
|
742
|
-
|
|
747
|
+
r = !0;
|
|
743
748
|
break;
|
|
744
749
|
}
|
|
745
|
-
return !
|
|
750
|
+
return !r;
|
|
746
751
|
}
|
|
747
752
|
getComponentContext(e) {
|
|
748
|
-
var
|
|
749
|
-
const t = e.schema,
|
|
753
|
+
var k, I, R, L;
|
|
754
|
+
const t = e.schema, s = t.appearance && t.appearance.class || "", r = s.split(" ") || [], a = t.contents || [], i = a.length ? a[0] : null, g = i && i.appearance ? i.appearance.class : "", f = g ? g.split(" ") : [], u = (k = i == null ? void 0 : i.contents) != null && k.length ? i == null ? void 0 : i.contents[0] : null, h = u && u.appearance ? u.appearance.class : "", p = h ? h.split(" ") : [], b = t.type === "component" ? (R = (I = e.parent) == null ? void 0 : I.parent) == null ? void 0 : R.schema : (L = e.parent) == null ? void 0 : L.schema, y = b && b.appearance && b.appearance.class || "", M = y ? y.split(" ") : [];
|
|
750
755
|
return {
|
|
751
|
-
componentClass:
|
|
752
|
-
componentClassList:
|
|
753
|
-
childContents:
|
|
754
|
-
firstLevelChildSchema:
|
|
755
|
-
firstLevelChildClass:
|
|
756
|
-
firstLevelChildClassList:
|
|
757
|
-
secondLevelChildSchema:
|
|
758
|
-
secondLevelChildClass:
|
|
759
|
-
secondLevelChildClassList:
|
|
760
|
-
parentSchema:
|
|
761
|
-
parentClass:
|
|
762
|
-
parentClassList:
|
|
756
|
+
componentClass: s,
|
|
757
|
+
componentClassList: r,
|
|
758
|
+
childContents: a,
|
|
759
|
+
firstLevelChildSchema: i,
|
|
760
|
+
firstLevelChildClass: g,
|
|
761
|
+
firstLevelChildClassList: f,
|
|
762
|
+
secondLevelChildSchema: u,
|
|
763
|
+
secondLevelChildClass: h,
|
|
764
|
+
secondLevelChildClassList: p,
|
|
765
|
+
parentSchema: b,
|
|
766
|
+
parentClass: y,
|
|
767
|
+
parentClassList: M
|
|
763
768
|
};
|
|
764
769
|
}
|
|
765
770
|
}
|
|
766
|
-
function
|
|
767
|
-
const t = new
|
|
768
|
-
function
|
|
769
|
-
return
|
|
771
|
+
function at(n, e) {
|
|
772
|
+
const t = new it();
|
|
773
|
+
function s(f) {
|
|
774
|
+
return rt;
|
|
770
775
|
}
|
|
771
|
-
function
|
|
772
|
-
if (!
|
|
776
|
+
function r(f) {
|
|
777
|
+
if (!st().basalDragulaRuleForContainer(f, e))
|
|
773
778
|
return !1;
|
|
774
|
-
const { canAccept:
|
|
775
|
-
return
|
|
779
|
+
const { canAccept: h } = t.getTemplateRule(n, e);
|
|
780
|
+
return h;
|
|
776
781
|
}
|
|
777
|
-
function
|
|
778
|
-
const { canDelete:
|
|
779
|
-
return
|
|
782
|
+
function a() {
|
|
783
|
+
const { canDelete: f } = t.getTemplateRule(n, e);
|
|
784
|
+
return f;
|
|
780
785
|
}
|
|
781
|
-
function
|
|
782
|
-
const { canMove:
|
|
783
|
-
return
|
|
786
|
+
function i() {
|
|
787
|
+
const { canMove: f } = t.getTemplateRule(n, e);
|
|
788
|
+
return f;
|
|
784
789
|
}
|
|
785
|
-
function
|
|
786
|
-
const { canMove:
|
|
787
|
-
return !
|
|
790
|
+
function g() {
|
|
791
|
+
const { canMove: f, canDelete: u } = t.getTemplateRule(n, e);
|
|
792
|
+
return !f && !u;
|
|
788
793
|
}
|
|
789
794
|
return {
|
|
790
|
-
canAccepts:
|
|
791
|
-
checkCanDeleteComponent:
|
|
792
|
-
checkCanMoveComponent:
|
|
793
|
-
hideNestedPaddingInDesginerView:
|
|
794
|
-
getPropsConfig:
|
|
795
|
+
canAccepts: r,
|
|
796
|
+
checkCanDeleteComponent: a,
|
|
797
|
+
checkCanMoveComponent: i,
|
|
798
|
+
hideNestedPaddingInDesginerView: g,
|
|
799
|
+
getPropsConfig: s
|
|
795
800
|
};
|
|
796
801
|
}
|
|
797
|
-
function
|
|
798
|
-
var
|
|
799
|
-
const
|
|
800
|
-
function
|
|
802
|
+
function ct(n, e, t) {
|
|
803
|
+
var B;
|
|
804
|
+
const s = t && t.getStyles && t.getStyles() || "", r = t && t.getDesignerClass && t.getDesignerClass() || "", a = w();
|
|
805
|
+
function i() {
|
|
801
806
|
return (e == null ? void 0 : e.schema.componentType) === "frame" ? !1 : t && t.checkCanMoveComponent ? t.checkCanMoveComponent() : !0;
|
|
802
807
|
}
|
|
803
|
-
function
|
|
808
|
+
function g() {
|
|
804
809
|
return !1;
|
|
805
810
|
}
|
|
806
|
-
function
|
|
811
|
+
function f() {
|
|
807
812
|
return (e == null ? void 0 : e.schema.componentType) === "frame" ? !1 : t && t.checkCanDeleteComponent ? t.checkCanDeleteComponent() : !0;
|
|
808
813
|
}
|
|
809
|
-
function
|
|
814
|
+
function u() {
|
|
810
815
|
return (e == null ? void 0 : e.schema.componentType) === "frame" ? !0 : t && t.hideNestedPaddingInDesginerView ? t.hideNestedPaddingInDesginerView() : !1;
|
|
811
816
|
}
|
|
812
|
-
function
|
|
813
|
-
if (!
|
|
817
|
+
function h(v) {
|
|
818
|
+
if (!v || !v.value)
|
|
814
819
|
return null;
|
|
815
|
-
if (
|
|
816
|
-
return
|
|
817
|
-
const
|
|
818
|
-
return
|
|
820
|
+
if (v.value.schema && v.value.schema.type === "component")
|
|
821
|
+
return v.value;
|
|
822
|
+
const S = w(v == null ? void 0 : v.value.parent), D = h(S);
|
|
823
|
+
return D || null;
|
|
819
824
|
}
|
|
820
|
-
function
|
|
821
|
-
const { componentInstance:
|
|
822
|
-
return !
|
|
825
|
+
function p(v = e) {
|
|
826
|
+
const { componentInstance: S, designerItemElementRef: D } = v;
|
|
827
|
+
return !S || !S.value ? null : S.value.canMove ? D : p(v.parent);
|
|
823
828
|
}
|
|
824
|
-
function
|
|
825
|
-
return !!t && t.canAccepts(
|
|
829
|
+
function b(v) {
|
|
830
|
+
return !!t && t.canAccepts(v);
|
|
826
831
|
}
|
|
827
|
-
function
|
|
832
|
+
function y() {
|
|
828
833
|
return (e == null ? void 0 : e.schema.label) || (e == null ? void 0 : e.schema.title) || (e == null ? void 0 : e.schema.name);
|
|
829
834
|
}
|
|
830
|
-
function
|
|
835
|
+
function M() {
|
|
831
836
|
}
|
|
832
|
-
function
|
|
833
|
-
|
|
837
|
+
function k(v, S) {
|
|
838
|
+
S && t != null && t.onAcceptMovedChildElement && t.onAcceptMovedChildElement(S);
|
|
834
839
|
}
|
|
835
|
-
function
|
|
836
|
-
const { componentType:
|
|
837
|
-
let
|
|
838
|
-
t && t.onResolveNewComponentSchema && (
|
|
839
|
-
const
|
|
840
|
-
return
|
|
840
|
+
function I(v, S) {
|
|
841
|
+
const { componentType: D } = v;
|
|
842
|
+
let $ = J(D, v, S);
|
|
843
|
+
t && t.onResolveNewComponentSchema && ($ = t.onResolveNewComponentSchema(v, $));
|
|
844
|
+
const V = D.toLowerCase().replace(/-/g, "_");
|
|
845
|
+
return $ && !$.id && $.type === D && ($.id = `${V}_${Math.random().toString().slice(2, 6)}`), $;
|
|
841
846
|
}
|
|
842
|
-
function
|
|
847
|
+
function R(v) {
|
|
843
848
|
}
|
|
844
|
-
function
|
|
849
|
+
function L(...v) {
|
|
845
850
|
if (t && t.getPropsConfig)
|
|
846
|
-
return t.getPropsConfig(...
|
|
847
|
-
}
|
|
848
|
-
function
|
|
849
|
-
t && t.onRemoveComponent && t.onRemoveComponent(), e != null && e.schema.contents && e.schema.contents.map((
|
|
850
|
-
var
|
|
851
|
-
let
|
|
852
|
-
|
|
853
|
-
const
|
|
854
|
-
(
|
|
851
|
+
return t.getPropsConfig(...v);
|
|
852
|
+
}
|
|
853
|
+
function x() {
|
|
854
|
+
t && t.onRemoveComponent && t.onRemoveComponent(), e != null && e.schema.contents && e.schema.contents.map((v) => {
|
|
855
|
+
var $;
|
|
856
|
+
let S = v.id;
|
|
857
|
+
v.type === "component-ref" && (S = v.component);
|
|
858
|
+
const D = n.value.querySelector(`#${S}-design-item`);
|
|
859
|
+
($ = D == null ? void 0 : D.componentInstance) != null && $.value.onRemoveComponent && D.componentInstance.value.onRemoveComponent();
|
|
855
860
|
});
|
|
856
861
|
}
|
|
857
|
-
return
|
|
858
|
-
canMove:
|
|
859
|
-
canSelectParent:
|
|
860
|
-
canDelete:
|
|
861
|
-
canNested: !
|
|
862
|
+
return a.value = {
|
|
863
|
+
canMove: i(),
|
|
864
|
+
canSelectParent: g(),
|
|
865
|
+
canDelete: f(),
|
|
866
|
+
canNested: !u(),
|
|
862
867
|
contents: e == null ? void 0 : e.schema.contents,
|
|
863
868
|
elementRef: n,
|
|
864
|
-
parent: (
|
|
869
|
+
parent: (B = e == null ? void 0 : e.parent) == null ? void 0 : B.componentInstance,
|
|
865
870
|
schema: e == null ? void 0 : e.schema,
|
|
866
|
-
styles:
|
|
867
|
-
designerClass:
|
|
868
|
-
canAccepts:
|
|
869
|
-
getBelongedComponentInstance:
|
|
870
|
-
getDraggableDesignItemElement:
|
|
871
|
-
getDraggingDisplayText:
|
|
872
|
-
getPropConfig:
|
|
873
|
-
getDragScopeElement:
|
|
874
|
-
onAcceptMovedChildElement:
|
|
875
|
-
onChildElementMovedOut:
|
|
876
|
-
addNewChildComponentSchema:
|
|
877
|
-
triggerBelongedComponentToMoveWhenMoved: !!t && t.triggerBelongedComponentToMoveWhenMoved ||
|
|
878
|
-
triggerBelongedComponentToDeleteWhenDeleted: !!t && t.triggerBelongedComponentToDeleteWhenDeleted ||
|
|
879
|
-
onRemoveComponent:
|
|
880
|
-
},
|
|
871
|
+
styles: s,
|
|
872
|
+
designerClass: r,
|
|
873
|
+
canAccepts: b,
|
|
874
|
+
getBelongedComponentInstance: h,
|
|
875
|
+
getDraggableDesignItemElement: p,
|
|
876
|
+
getDraggingDisplayText: y,
|
|
877
|
+
getPropConfig: L,
|
|
878
|
+
getDragScopeElement: M,
|
|
879
|
+
onAcceptMovedChildElement: k,
|
|
880
|
+
onChildElementMovedOut: R,
|
|
881
|
+
addNewChildComponentSchema: I,
|
|
882
|
+
triggerBelongedComponentToMoveWhenMoved: !!t && t.triggerBelongedComponentToMoveWhenMoved || w(!1),
|
|
883
|
+
triggerBelongedComponentToDeleteWhenDeleted: !!t && t.triggerBelongedComponentToDeleteWhenDeleted || w(!1),
|
|
884
|
+
onRemoveComponent: x
|
|
885
|
+
}, a;
|
|
881
886
|
}
|
|
882
|
-
const
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
}
|
|
887
|
+
const lt = /* @__PURE__ */ new Map([
|
|
888
|
+
["buttons", "items"],
|
|
889
|
+
["appearance", me]
|
|
890
|
+
]);
|
|
891
|
+
function ut(n, e) {
|
|
892
|
+
return { class: e.class, style: e.style };
|
|
893
|
+
}
|
|
894
|
+
const dt = /* @__PURE__ */ new Map([
|
|
895
|
+
["appearance", ut]
|
|
896
|
+
]);
|
|
897
|
+
function be(n, e, t) {
|
|
898
|
+
return e;
|
|
899
|
+
}
|
|
900
|
+
const pt = "https://json-schema.org/draft/2020-12/schema", ft = "https://farris-design.gitee.io/response-toolbar.schema.json", mt = "response-toolbar", ht = "A Farris Toolbar Component", gt = "object", yt = {
|
|
901
|
+
id: {
|
|
902
|
+
description: "The unique identifier for a Response Toolbar",
|
|
903
|
+
type: "string"
|
|
904
|
+
},
|
|
905
|
+
type: {
|
|
906
|
+
description: "The type string of Response Toolbar",
|
|
907
|
+
type: "string",
|
|
908
|
+
default: "response-toolbar"
|
|
909
|
+
},
|
|
910
|
+
appearance: {
|
|
911
|
+
description: "",
|
|
912
|
+
type: "object",
|
|
913
|
+
properties: {
|
|
914
|
+
class: {
|
|
915
|
+
type: "string",
|
|
916
|
+
default: ""
|
|
917
|
+
}
|
|
913
918
|
}
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
919
|
+
},
|
|
920
|
+
alignment: {
|
|
921
|
+
description: "The alignment of Response Toolbar Button.",
|
|
922
|
+
type: "string",
|
|
923
|
+
default: "right"
|
|
924
|
+
},
|
|
925
|
+
buttons: {
|
|
926
|
+
description: "The items of Response Toolbar.",
|
|
927
|
+
type: "array",
|
|
928
|
+
default: []
|
|
929
|
+
}
|
|
930
|
+
}, bt = [
|
|
931
|
+
"id",
|
|
932
|
+
"type",
|
|
933
|
+
"buttons"
|
|
934
|
+
], vt = {
|
|
935
|
+
$schema: pt,
|
|
936
|
+
$id: ft,
|
|
937
|
+
title: mt,
|
|
938
|
+
description: ht,
|
|
939
|
+
type: gt,
|
|
940
|
+
properties: yt,
|
|
941
|
+
required: bt
|
|
942
|
+
}, Ct = "https://json-schema.org/draft/2020-12/schema", Tt = "https://farris-design.gitee.io/response-toolbar-item.schema.json", wt = "response-toolbar-item", St = "A Farris Toolbar Item Component", Mt = "object", Dt = {
|
|
943
|
+
id: {
|
|
944
|
+
description: "The unique identifier for a Response Toolbar",
|
|
945
|
+
type: "string"
|
|
946
|
+
},
|
|
947
|
+
type: {
|
|
948
|
+
description: "The type string of Response Toolbar",
|
|
949
|
+
type: "string",
|
|
950
|
+
default: "response-toolbar-item"
|
|
951
|
+
},
|
|
952
|
+
appearance: {
|
|
953
|
+
description: "",
|
|
954
|
+
type: "object",
|
|
955
|
+
properties: {
|
|
956
|
+
class: {
|
|
957
|
+
type: "string",
|
|
958
|
+
default: "btn-secondary"
|
|
959
|
+
}
|
|
920
960
|
}
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
961
|
+
},
|
|
962
|
+
alignment: {
|
|
963
|
+
description: "对齐",
|
|
964
|
+
type: "string",
|
|
965
|
+
default: "right"
|
|
966
|
+
},
|
|
967
|
+
text: {
|
|
968
|
+
description: "文本",
|
|
969
|
+
type: "string",
|
|
970
|
+
default: "按钮"
|
|
971
|
+
},
|
|
972
|
+
icon: {
|
|
973
|
+
description: "图标",
|
|
974
|
+
type: "string",
|
|
975
|
+
default: ""
|
|
976
|
+
},
|
|
977
|
+
disabled: {
|
|
978
|
+
description: "禁用",
|
|
979
|
+
type: "boolean",
|
|
980
|
+
default: !1
|
|
981
|
+
},
|
|
982
|
+
onClick: {
|
|
983
|
+
description: "点击事件",
|
|
984
|
+
type: "string",
|
|
985
|
+
default: ""
|
|
926
986
|
}
|
|
987
|
+
}, Pt = [
|
|
988
|
+
"id",
|
|
989
|
+
"type",
|
|
990
|
+
"text"
|
|
991
|
+
], At = {
|
|
992
|
+
$schema: Ct,
|
|
993
|
+
$id: Tt,
|
|
994
|
+
title: wt,
|
|
995
|
+
description: St,
|
|
996
|
+
type: Mt,
|
|
997
|
+
properties: Dt,
|
|
998
|
+
required: Pt
|
|
999
|
+
}, ve = {
|
|
1000
|
+
/** 组件自定义样式 */
|
|
1001
|
+
customClass: { type: String, default: "" },
|
|
1002
|
+
alignment: { Type: String, default: "right" },
|
|
1003
|
+
items: {
|
|
1004
|
+
Type: Array,
|
|
1005
|
+
default: []
|
|
1006
|
+
}
|
|
1007
|
+
}, kt = Object.assign({}, ve, {
|
|
1008
|
+
componentId: { type: String, default: "" }
|
|
927
1009
|
});
|
|
928
|
-
|
|
929
|
-
|
|
1010
|
+
ee(
|
|
1011
|
+
ve,
|
|
1012
|
+
vt,
|
|
1013
|
+
lt,
|
|
1014
|
+
be
|
|
1015
|
+
);
|
|
1016
|
+
const Ce = {
|
|
1017
|
+
id: { type: String, default: "" },
|
|
1018
|
+
items: { type: Object, default: {} },
|
|
1019
|
+
class: { type: String, default: "" },
|
|
1020
|
+
text: { type: String, default: "" },
|
|
1021
|
+
disabled: { type: Boolean, default: !1 },
|
|
1022
|
+
icon: { type: String, default: "" },
|
|
1023
|
+
componentId: { type: String, default: "" },
|
|
1024
|
+
alignment: { Type: String, default: "right" }
|
|
1025
|
+
};
|
|
1026
|
+
ee(
|
|
1027
|
+
Ce,
|
|
1028
|
+
At,
|
|
1029
|
+
dt,
|
|
1030
|
+
be
|
|
1031
|
+
);
|
|
1032
|
+
class Te {
|
|
1033
|
+
constructor(e) {
|
|
1034
|
+
/** 工具栏项标识 */
|
|
1035
|
+
E(this, "id", "");
|
|
1036
|
+
/** 工具栏项自定义样式 */
|
|
1037
|
+
E(this, "class", "btn-secondary");
|
|
1038
|
+
/** 图标 */
|
|
1039
|
+
E(this, "icon", "");
|
|
1040
|
+
/** 所属分组 */
|
|
1041
|
+
E(this, "groupId", "");
|
|
1042
|
+
/** 收藏顺序 */
|
|
1043
|
+
E(this, "order", -1);
|
|
1044
|
+
/** 是否作为下拉菜单的顶层按钮 */
|
|
1045
|
+
E(this, "asDropDownTop", !1);
|
|
1046
|
+
/** 文本 */
|
|
1047
|
+
E(this, "text", "");
|
|
1048
|
+
/** 是否可见 */
|
|
1049
|
+
E(this, "visible", !0);
|
|
1050
|
+
E(this, "responsed", !1);
|
|
1051
|
+
/** 是否启用提示消息 */
|
|
1052
|
+
E(this, "tipsEnable", !1);
|
|
1053
|
+
/** 提示消息内容 */
|
|
1054
|
+
E(this, "tipsText", "");
|
|
1055
|
+
/** 记录宽度 */
|
|
1056
|
+
E(this, "width", 0);
|
|
1057
|
+
E(this, "onClick", () => {
|
|
1058
|
+
});
|
|
1059
|
+
E(this, "options");
|
|
1060
|
+
this.options = e;
|
|
1061
|
+
const t = [
|
|
1062
|
+
"id",
|
|
1063
|
+
"class",
|
|
1064
|
+
"icon",
|
|
1065
|
+
"groupId",
|
|
1066
|
+
"order",
|
|
1067
|
+
"asDropDownTop",
|
|
1068
|
+
"text",
|
|
1069
|
+
"isDP",
|
|
1070
|
+
"visible",
|
|
1071
|
+
"responsed",
|
|
1072
|
+
"width",
|
|
1073
|
+
"tipsEnable",
|
|
1074
|
+
"tipsText",
|
|
1075
|
+
"onClick"
|
|
1076
|
+
];
|
|
1077
|
+
Object.keys(e).filter((s) => t.indexOf(s) > -1).forEach((s) => {
|
|
1078
|
+
this[s] = e[s];
|
|
1079
|
+
});
|
|
1080
|
+
}
|
|
1081
|
+
/** 是否可用 */
|
|
1082
|
+
get enable() {
|
|
1083
|
+
return Object.keys(this.options).indexOf("disabled") > -1 ? !this.options.disabled : A(() => !0);
|
|
1084
|
+
}
|
|
1085
|
+
/** 设置宽度 */
|
|
1086
|
+
setWidth(e) {
|
|
1087
|
+
this.width = parseInt(e, 10);
|
|
1088
|
+
}
|
|
1089
|
+
/** 获取宽度 */
|
|
1090
|
+
getWidth() {
|
|
1091
|
+
return this.visible ? this.width : !1;
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
class Et extends Te {
|
|
1095
|
+
constructor(e) {
|
|
1096
|
+
super(e);
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
function xt() {
|
|
1100
|
+
function n(e) {
|
|
1101
|
+
const t = [];
|
|
1102
|
+
return e.reduce((s, r) => (r.children && r.children.length > 0 ? s.push(new K(r)) : s.push(new Et(r)), s), t), t;
|
|
1103
|
+
}
|
|
1104
|
+
return { buildResponseToolbarItems: n };
|
|
1105
|
+
}
|
|
1106
|
+
const { buildResponseToolbarItems: Bt } = xt();
|
|
1107
|
+
class K extends Te {
|
|
1108
|
+
constructor(t) {
|
|
1109
|
+
super(t);
|
|
1110
|
+
E(this, "placement", "");
|
|
1111
|
+
// 下拉位置
|
|
1112
|
+
/** 下拉class */
|
|
1113
|
+
E(this, "dropdownClass", "");
|
|
1114
|
+
/** 下拉菜单class */
|
|
1115
|
+
E(this, "menuClass", "");
|
|
1116
|
+
/** 是否用分开的下拉按钮 */
|
|
1117
|
+
E(this, "split", !1);
|
|
1118
|
+
E(this, "children", []);
|
|
1119
|
+
E(this, "expanded", !1);
|
|
1120
|
+
const s = ["isDP", "class", "dropdownClass", "menuClass", "placement", "split", "expanded"];
|
|
1121
|
+
Object.keys(t).filter((r) => s.indexOf(r) > -1).forEach((r) => {
|
|
1122
|
+
this[r] = t[r];
|
|
1123
|
+
}), t.children && t.children.length && (this.children = Bt(t.children));
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
function It() {
|
|
1127
|
+
function n(t) {
|
|
1128
|
+
const s = {
|
|
1129
|
+
"f-icon": !0
|
|
1130
|
+
};
|
|
1131
|
+
if (t.icon) {
|
|
1132
|
+
const r = t.icon.trim().split(" ");
|
|
1133
|
+
r && r.length && r.reduce((a, i) => (a[i] = !0, a), s);
|
|
1134
|
+
}
|
|
1135
|
+
return s;
|
|
1136
|
+
}
|
|
1137
|
+
function e(t) {
|
|
1138
|
+
return !!(t.icon && t.icon.trim());
|
|
1139
|
+
}
|
|
1140
|
+
return { iconClass: n, shouldShowIcon: e };
|
|
1141
|
+
}
|
|
1142
|
+
function Rt(n, e) {
|
|
1143
|
+
const t = N("design-item-context"), s = N("toolbar-item-handler", () => {
|
|
1144
|
+
});
|
|
1145
|
+
function r() {
|
|
1146
|
+
s && s();
|
|
1147
|
+
}
|
|
1148
|
+
function a(l) {
|
|
1149
|
+
const o = {
|
|
1150
|
+
"dropdown-menu": !0
|
|
1151
|
+
};
|
|
1152
|
+
if (l.class) {
|
|
1153
|
+
const c = l.menuClass.split(" ");
|
|
1154
|
+
c && c.length && c.reduce((d, T) => (d[T] = !0, d), o);
|
|
1155
|
+
}
|
|
1156
|
+
return o;
|
|
1157
|
+
}
|
|
1158
|
+
function i(l) {
|
|
1159
|
+
const o = {
|
|
1160
|
+
disabled: !l.enable,
|
|
1161
|
+
"dropdown-submenu": !0,
|
|
1162
|
+
"f-rt-dropdown": !0
|
|
1163
|
+
}, c = l.dropdownClass.split(" ");
|
|
1164
|
+
return c && c.length && c.reduce((d, T) => (d[T] = !0, d), o), o;
|
|
1165
|
+
}
|
|
1166
|
+
function g(l) {
|
|
1167
|
+
const o = {
|
|
1168
|
+
disabled: !l.enable,
|
|
1169
|
+
"dropdown-item": !0,
|
|
1170
|
+
"f-rt-btn": !0,
|
|
1171
|
+
"position-relative": !0,
|
|
1172
|
+
"farris-component": !0
|
|
1173
|
+
}, c = l.class.split(" ");
|
|
1174
|
+
return c && c.length && c.reduce((d, T) => (d[T] = !0, d), o), o;
|
|
1175
|
+
}
|
|
1176
|
+
let f;
|
|
1177
|
+
const u = /* @__PURE__ */ new Map();
|
|
1178
|
+
function h(l, o, c) {
|
|
1179
|
+
var T;
|
|
1180
|
+
((T = l.target) == null ? void 0 : T.id) === o.id && l.stopPropagation();
|
|
1181
|
+
const d = c ? c.id : "__top_item__";
|
|
1182
|
+
if (o.children && o.children.length && (o.expanded = !o.expanded, o.expanded ? u.set(d, o) : u.delete(d)), u.has(d) && u.get(d) !== o) {
|
|
1183
|
+
const P = u.get(d);
|
|
1184
|
+
P && (P.expanded = !1);
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
function p(l) {
|
|
1188
|
+
l && (l.stopPropagation(), l.preventDefault());
|
|
1189
|
+
}
|
|
1190
|
+
function b() {
|
|
1191
|
+
Array.from(document.getElementsByClassName("dgComponentFocused")).forEach((o) => o.classList.remove("dgComponentFocused"));
|
|
1192
|
+
const l = document.getElementsByClassName("dgComponentSelected");
|
|
1193
|
+
Array.from(l).forEach((o) => o.classList.remove("dgComponentSelected"));
|
|
1194
|
+
}
|
|
1195
|
+
function y(l) {
|
|
1196
|
+
l.currentTarget.classList.add("dgComponentFocused", "dgComponentSelected");
|
|
1197
|
+
}
|
|
1198
|
+
function M(l) {
|
|
1199
|
+
const {
|
|
1200
|
+
buttons: o = []
|
|
1201
|
+
} = t.schema;
|
|
1202
|
+
let c = [];
|
|
1203
|
+
o.forEach((P) => {
|
|
1204
|
+
c = c.concat(P.children || []);
|
|
1205
|
+
});
|
|
1206
|
+
const d = c.findIndex((P) => P.id === l), T = d === -1 ? null : c[d];
|
|
1207
|
+
return {
|
|
1208
|
+
index: d,
|
|
1209
|
+
item: T
|
|
1210
|
+
};
|
|
1211
|
+
}
|
|
1212
|
+
function k(l) {
|
|
1213
|
+
const {
|
|
1214
|
+
buttons: o = []
|
|
1215
|
+
} = t.schema, c = o.findIndex((T) => T.id === l), d = c === -1 ? null : o[c];
|
|
1216
|
+
return {
|
|
1217
|
+
index: c,
|
|
1218
|
+
item: d
|
|
1219
|
+
};
|
|
1220
|
+
}
|
|
1221
|
+
function I(l) {
|
|
1222
|
+
var d;
|
|
1223
|
+
t.schema;
|
|
1224
|
+
const {
|
|
1225
|
+
index: o,
|
|
1226
|
+
item: c
|
|
1227
|
+
} = M(l);
|
|
1228
|
+
(d = t == null ? void 0 : t.setupContext) == null || d.emit("selectionChange", c == null ? void 0 : c.type, c);
|
|
1229
|
+
}
|
|
1230
|
+
const R = function(l) {
|
|
1231
|
+
const {
|
|
1232
|
+
componentType: o
|
|
1233
|
+
} = l, c = J(o, l), d = o.toLowerCase().replace("-", "_");
|
|
1234
|
+
return c && !c.id && c.type === o && (c.id = `${d}_${Math.random().toString().slice(2, 6)}`), c;
|
|
1235
|
+
}, L = function() {
|
|
1236
|
+
const l = {
|
|
1237
|
+
componentType: "response-toolbar-item",
|
|
1238
|
+
parentComponentInstance: e.value,
|
|
1239
|
+
targetPosition: -1
|
|
1240
|
+
};
|
|
1241
|
+
return R(l);
|
|
1242
|
+
};
|
|
1243
|
+
function x(l, o) {
|
|
1244
|
+
p(l), b(), y(l), I(o.id);
|
|
1245
|
+
}
|
|
1246
|
+
function B(l, o, c) {
|
|
1247
|
+
p(l);
|
|
1248
|
+
const d = o.id, T = c && c.id, {
|
|
1249
|
+
buttons: P = []
|
|
1250
|
+
} = t.schema;
|
|
1251
|
+
if (!T)
|
|
1252
|
+
return;
|
|
1253
|
+
const {
|
|
1254
|
+
index: j
|
|
1255
|
+
} = k(T);
|
|
1256
|
+
if (j === -1)
|
|
1257
|
+
return;
|
|
1258
|
+
const {
|
|
1259
|
+
index: _
|
|
1260
|
+
} = M(d);
|
|
1261
|
+
_ !== -1 && (P[j].children.splice(_, 1), r());
|
|
1262
|
+
}
|
|
1263
|
+
function v(l, o, c) {
|
|
1264
|
+
p(l);
|
|
1265
|
+
const d = c && c.id, {
|
|
1266
|
+
buttons: T = []
|
|
1267
|
+
} = t.schema;
|
|
1268
|
+
if (!d)
|
|
1269
|
+
return;
|
|
1270
|
+
const {
|
|
1271
|
+
index: P
|
|
1272
|
+
} = k(d);
|
|
1273
|
+
if (P === -1)
|
|
1274
|
+
return;
|
|
1275
|
+
const j = L(), _ = Object.assign({}, j, {
|
|
1276
|
+
text: o.text
|
|
1277
|
+
});
|
|
1278
|
+
T[P].children.push(_), r();
|
|
1279
|
+
}
|
|
1280
|
+
function S(l, o, c) {
|
|
1281
|
+
p(l);
|
|
1282
|
+
const d = c && c.id, {
|
|
1283
|
+
buttons: T = []
|
|
1284
|
+
} = t.schema;
|
|
1285
|
+
if (!d)
|
|
1286
|
+
return;
|
|
1287
|
+
const {
|
|
1288
|
+
index: P
|
|
1289
|
+
} = k(d);
|
|
1290
|
+
if (P === -1)
|
|
1291
|
+
return;
|
|
1292
|
+
const j = L(), _ = Object.assign({}, j, {
|
|
1293
|
+
text: "按钮"
|
|
1294
|
+
});
|
|
1295
|
+
T[P].children.push(_), r();
|
|
1296
|
+
}
|
|
1297
|
+
function D(l, o) {
|
|
1298
|
+
return m("div", {
|
|
1299
|
+
class: "component-btn-group"
|
|
1300
|
+
}, [m("div", null, [m("div", {
|
|
1301
|
+
role: "button",
|
|
1302
|
+
class: "btn component-settings-button",
|
|
1303
|
+
title: "删除",
|
|
1304
|
+
ref: "removeButton",
|
|
1305
|
+
style: "position:static;",
|
|
1306
|
+
onClick: (c) => B(c, l, o)
|
|
1307
|
+
}, [m("i", {
|
|
1308
|
+
class: "f-icon f-icon-yxs_delete"
|
|
1309
|
+
}, null)]), m("div", {
|
|
1310
|
+
role: "button",
|
|
1311
|
+
class: "btn component-settings-button",
|
|
1312
|
+
title: "复制",
|
|
1313
|
+
ref: "copyButton",
|
|
1314
|
+
style: "position:static;",
|
|
1315
|
+
onClick: (c) => v(c, l, o)
|
|
1316
|
+
}, [m("i", {
|
|
1317
|
+
class: "f-icon f-icon-yxs_copy"
|
|
1318
|
+
}, null)]), m("div", {
|
|
1319
|
+
role: "button",
|
|
1320
|
+
class: "btn component-settings-button",
|
|
1321
|
+
title: "新增同级",
|
|
1322
|
+
ref: "appendSame",
|
|
1323
|
+
style: "width:85px!important;padding:0 5px;position:static;",
|
|
1324
|
+
onClick: (c) => S(c, l, o)
|
|
1325
|
+
}, [m("i", {
|
|
1326
|
+
class: "f-icon f-icon-plus-circle text-white mr-1"
|
|
1327
|
+
}, null), m("span", {
|
|
1328
|
+
style: "font-size:13px;margin:auto"
|
|
1329
|
+
}, [le("新增同级")])])])]);
|
|
1330
|
+
}
|
|
1331
|
+
function $(l) {
|
|
1332
|
+
return l.children.map((o) => o.children && o.children.length ? m("li", {
|
|
1333
|
+
class: i(o),
|
|
1334
|
+
id: o.id,
|
|
1335
|
+
onClick: (c) => o.enable && h(c, o, l)
|
|
1336
|
+
}, [m("span", {
|
|
1337
|
+
id: o.id,
|
|
1338
|
+
class: g(o),
|
|
1339
|
+
onMouseover: (c) => o.enable && h(c, o, l)
|
|
1340
|
+
}, [o.text, m("i", {
|
|
1341
|
+
class: "f-icon f-icon-arrow-chevron-right",
|
|
1342
|
+
style: "display: inline-block;float: right;line-height: 1.25rem;"
|
|
1343
|
+
}, null)]), f(o, o)]) : m("li", {
|
|
1344
|
+
class: g(o),
|
|
1345
|
+
id: o.id,
|
|
1346
|
+
onClick: (c) => x(c, o)
|
|
1347
|
+
}, [D(o, l), n.shouldShowIcon(o) && m("i", {
|
|
1348
|
+
class: n.iconClass(o)
|
|
1349
|
+
}, null), o.text]));
|
|
1350
|
+
}
|
|
1351
|
+
function V(l, o, c) {
|
|
1352
|
+
const d = {
|
|
1353
|
+
display: l.expanded ? "block" : "none",
|
|
1354
|
+
position: "fixed",
|
|
1355
|
+
maxWidth: "300px",
|
|
1356
|
+
width: "auto",
|
|
1357
|
+
minWidth: "120px"
|
|
1358
|
+
}, T = document.getElementsByTagName("body")[0].getClientRects()[0].width, P = o, j = P == null ? void 0 : P.getClientRects();
|
|
1359
|
+
if (P && j && j.length) {
|
|
1360
|
+
const {
|
|
1361
|
+
top: _,
|
|
1362
|
+
width: G,
|
|
1363
|
+
left: z,
|
|
1364
|
+
right: F,
|
|
1365
|
+
height: O
|
|
1366
|
+
} = j[0], U = Math.ceil(O + _);
|
|
1367
|
+
d.top = `${U}px`, d.left = `${z}px`;
|
|
1368
|
+
const Q = l.id + "_menu", te = o ? o.querySelector("#" + Q) : null;
|
|
1369
|
+
if (te) {
|
|
1370
|
+
d.display === "block" && (te.style.display = "block");
|
|
1371
|
+
const ie = te.getBoundingClientRect();
|
|
1372
|
+
if (c) {
|
|
1373
|
+
d.top = `${_ - 6}px`;
|
|
1374
|
+
const Me = Math.ceil(G + z);
|
|
1375
|
+
d.left = `${Me}px`;
|
|
1376
|
+
}
|
|
1377
|
+
T - z - G < ie.width && (d.left = `${(c ? z : F) - ie.width}px`);
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
return d;
|
|
1381
|
+
}
|
|
1382
|
+
f = function(l, o) {
|
|
1383
|
+
var P, j;
|
|
1384
|
+
const c = Ae(), d = o ? o.id : l.id, T = (j = (P = c == null ? void 0 : c.exposed) == null ? void 0 : P.elementRef.value) == null ? void 0 : j.querySelector("#" + d);
|
|
1385
|
+
return m("ul", {
|
|
1386
|
+
class: a(l),
|
|
1387
|
+
style: V(l, T, o),
|
|
1388
|
+
id: l.id + "_menu"
|
|
1389
|
+
}, [$(l)]);
|
|
1390
|
+
};
|
|
1391
|
+
function C() {
|
|
1392
|
+
u.forEach((l) => {
|
|
1393
|
+
l.expanded = !1;
|
|
1394
|
+
}), u.clear();
|
|
1395
|
+
}
|
|
1396
|
+
return {
|
|
1397
|
+
renderDropdownMenu: f,
|
|
1398
|
+
clearAllDropDownMenu: C
|
|
1399
|
+
};
|
|
1400
|
+
}
|
|
1401
|
+
function $t(n, e, t) {
|
|
1402
|
+
const s = w(n.alignment), {
|
|
1403
|
+
renderDropdownMenu: r,
|
|
1404
|
+
clearAllDropDownMenu: a
|
|
1405
|
+
} = Rt(e, t), i = N("design-item-context"), g = N("toolbar-item-handler", () => {
|
|
1406
|
+
});
|
|
1407
|
+
function f() {
|
|
1408
|
+
g && g();
|
|
1409
|
+
}
|
|
1410
|
+
function u(C) {
|
|
1411
|
+
const l = {
|
|
1412
|
+
"btn-group": !0,
|
|
1413
|
+
"f-rt-dropdown": !0,
|
|
1414
|
+
"f-btn-ml": s.value === "right",
|
|
1415
|
+
"f-btn-mr": s.value === "left"
|
|
1416
|
+
}, o = C.dropdownClass.split(" ");
|
|
1417
|
+
return o && o.length && o.reduce((c, d) => (c[d] = !0, c), l), l;
|
|
1418
|
+
}
|
|
1419
|
+
function h(C) {
|
|
1420
|
+
const l = {
|
|
1421
|
+
btn: !0,
|
|
1422
|
+
disabled: !C.enable,
|
|
1423
|
+
"position-relative": !0,
|
|
1424
|
+
"farris-component": !0,
|
|
1425
|
+
"f-rt-btn": !0,
|
|
1426
|
+
"btn-icontext": !!(C.icon && C.icon.trim())
|
|
1427
|
+
};
|
|
1428
|
+
if (C.class) {
|
|
1429
|
+
const o = C.class.split(" ");
|
|
1430
|
+
o && o.length && o.reduce((c, d) => (c[d] = !0, c), l);
|
|
1431
|
+
}
|
|
1432
|
+
return l;
|
|
1433
|
+
}
|
|
1434
|
+
function p(C) {
|
|
1435
|
+
C && (C.stopPropagation(), C.preventDefault());
|
|
1436
|
+
}
|
|
1437
|
+
function b(C, l) {
|
|
1438
|
+
p(C);
|
|
1439
|
+
const o = l.expanded;
|
|
1440
|
+
document.body.click(), l.expanded = !o;
|
|
1441
|
+
}
|
|
1442
|
+
const y = function(C) {
|
|
1443
|
+
const {
|
|
1444
|
+
componentType: l
|
|
1445
|
+
} = C, o = J(l, C), c = l.toLowerCase().replace("-", "_");
|
|
1446
|
+
return o && !o.id && o.type === l && (o.id = `${c}_${Math.random().toString().slice(2, 6)}`), o;
|
|
1447
|
+
}, M = function() {
|
|
1448
|
+
const C = {
|
|
1449
|
+
componentType: "response-toolbar-item",
|
|
1450
|
+
parentComponentInstance: t.value,
|
|
1451
|
+
targetPosition: -1
|
|
1452
|
+
};
|
|
1453
|
+
return y(C);
|
|
1454
|
+
};
|
|
1455
|
+
function k(C) {
|
|
1456
|
+
const l = i.schema.buttons || i.schema.contents, o = l == null ? void 0 : l.findIndex((d) => d.id === C), c = o === -1 ? null : l[o];
|
|
1457
|
+
return {
|
|
1458
|
+
index: o,
|
|
1459
|
+
toolbarItem: c
|
|
1460
|
+
};
|
|
1461
|
+
}
|
|
1462
|
+
function I(C, l) {
|
|
1463
|
+
var j;
|
|
1464
|
+
const {
|
|
1465
|
+
index: o,
|
|
1466
|
+
toolbarItem: c
|
|
1467
|
+
} = k(l);
|
|
1468
|
+
if (o === -1)
|
|
1469
|
+
return;
|
|
1470
|
+
const d = c.text || "按钮", T = M(), P = Object.assign({}, T, {
|
|
1471
|
+
text: d
|
|
1472
|
+
});
|
|
1473
|
+
(j = i.schema.buttons) == null || j.push(P), f();
|
|
1474
|
+
}
|
|
1475
|
+
function R(C, l) {
|
|
1476
|
+
const {
|
|
1477
|
+
index: o,
|
|
1478
|
+
toolbarItem: c
|
|
1479
|
+
} = k(l);
|
|
1480
|
+
if (o === -1)
|
|
1481
|
+
return;
|
|
1482
|
+
const d = c.text || "按钮", T = M(), P = Object.assign({}, T, {
|
|
1483
|
+
text: d
|
|
1484
|
+
}), j = i.schema.buttons[o].children || [];
|
|
1485
|
+
j.push(P), i.schema.buttons[o].children = j, f();
|
|
1486
|
+
}
|
|
1487
|
+
function L(C, l) {
|
|
1488
|
+
const o = i.schema.buttons || i.schema.contents, c = o == null ? void 0 : o.findIndex((d) => d.id === l);
|
|
1489
|
+
c !== -1 && (o.splice(c, 1), f());
|
|
1490
|
+
}
|
|
1491
|
+
function x(C) {
|
|
1492
|
+
return m("div", {
|
|
1493
|
+
class: "component-btn-group"
|
|
1494
|
+
}, [m("div", null, [m("div", {
|
|
1495
|
+
role: "button",
|
|
1496
|
+
class: "btn component-settings-button",
|
|
1497
|
+
title: "删除",
|
|
1498
|
+
ref: "removeButton",
|
|
1499
|
+
style: "position:static;",
|
|
1500
|
+
onClick: (l) => L(l, C)
|
|
1501
|
+
}, [m("i", {
|
|
1502
|
+
class: "f-icon f-icon-yxs_delete"
|
|
1503
|
+
}, null)]), m("div", {
|
|
1504
|
+
role: "button",
|
|
1505
|
+
class: "btn component-settings-button",
|
|
1506
|
+
title: "复制",
|
|
1507
|
+
ref: "copyButton",
|
|
1508
|
+
style: "position:static;",
|
|
1509
|
+
onClick: (l) => I(l, C)
|
|
1510
|
+
}, [m("i", {
|
|
1511
|
+
class: "f-icon f-icon-yxs_copy"
|
|
1512
|
+
}, null)]), m("div", {
|
|
1513
|
+
role: "button",
|
|
1514
|
+
class: "btn component-settings-button",
|
|
1515
|
+
title: "新增子级",
|
|
1516
|
+
ref: "appendChildButton",
|
|
1517
|
+
style: "width:85px!important;padding:0 5px;position:static;",
|
|
1518
|
+
onClick: (l) => R(l, C)
|
|
1519
|
+
}, [m("i", {
|
|
1520
|
+
class: "f-icon f-icon-plus-circle text-white mr-1"
|
|
1521
|
+
}, null), m("span", {
|
|
1522
|
+
style: "font-size:13px;margin:auto"
|
|
1523
|
+
}, [le("新增子级")])])])]);
|
|
1524
|
+
}
|
|
1525
|
+
function B() {
|
|
1526
|
+
Array.from(document.getElementsByClassName("dgComponentFocused")).forEach((l) => l.classList.remove("dgComponentFocused"));
|
|
1527
|
+
const C = document.getElementsByClassName("dgComponentSelected");
|
|
1528
|
+
Array.from(C).forEach((l) => l.classList.remove("dgComponentSelected"));
|
|
1529
|
+
}
|
|
1530
|
+
function v(C) {
|
|
1531
|
+
C.currentTarget.classList.add("dgComponentFocused", "dgComponentSelected");
|
|
1532
|
+
}
|
|
1533
|
+
function S(C) {
|
|
1534
|
+
var d;
|
|
1535
|
+
const l = i.schema.buttons || i.schema.contents, o = l == null ? void 0 : l.findIndex((T) => T.id === C);
|
|
1536
|
+
if (o === -1)
|
|
1537
|
+
return;
|
|
1538
|
+
const c = l[o];
|
|
1539
|
+
(d = i == null ? void 0 : i.setupContext) == null || d.emit("selectionChange", "response-toolbar-item", c);
|
|
1540
|
+
}
|
|
1541
|
+
function D(C, l) {
|
|
1542
|
+
p(C), B(), v(C), p(C), b(C, l), S(l.id);
|
|
1543
|
+
}
|
|
1544
|
+
function $(C) {
|
|
1545
|
+
return m("div", {
|
|
1546
|
+
id: C.id,
|
|
1547
|
+
class: u(C)
|
|
1548
|
+
}, [m("div", {
|
|
1549
|
+
class: h(C),
|
|
1550
|
+
style: "display: flex;padding-right: 0.1rem;",
|
|
1551
|
+
onClick: (l) => C.enable && D(l, C)
|
|
1552
|
+
}, [x(C.id), e.shouldShowIcon(C) && m("i", {
|
|
1553
|
+
class: e.iconClass(C)
|
|
1554
|
+
}, null), m("span", null, [C.text]), m("i", {
|
|
1555
|
+
class: "f-icon f-icon-arrow-chevron-down",
|
|
1556
|
+
style: "display: inline-block;float: right;line-height: 1.25rem;margin-left: .25rem;margin-right: .25rem;"
|
|
1557
|
+
}, null)]), r(C)]);
|
|
1558
|
+
}
|
|
1559
|
+
function V() {
|
|
1560
|
+
a();
|
|
1561
|
+
}
|
|
1562
|
+
return {
|
|
1563
|
+
renderToolbarDropdown: $,
|
|
1564
|
+
clearAllDropDown: V
|
|
1565
|
+
};
|
|
1566
|
+
}
|
|
1567
|
+
class re {
|
|
1568
|
+
constructor(e, t) {
|
|
1569
|
+
E(this, "componentId");
|
|
1570
|
+
E(this, "viewModelId");
|
|
1571
|
+
E(this, "eventsEditorUtils");
|
|
1572
|
+
E(this, "formSchemaUtils");
|
|
1573
|
+
E(this, "formMetadataConverter");
|
|
1574
|
+
E(this, "designViewModelUtils");
|
|
1575
|
+
E(this, "designViewModelField");
|
|
1576
|
+
E(this, "controlCreatorUtils");
|
|
1577
|
+
E(this, "designerHostService");
|
|
1578
|
+
E(this, "schemaService", null);
|
|
1579
|
+
E(this, "metadataService", null);
|
|
1580
|
+
E(this, "propertyConfig", {
|
|
1581
|
+
type: "object",
|
|
1582
|
+
categories: {}
|
|
1583
|
+
});
|
|
1584
|
+
var s;
|
|
1585
|
+
this.componentId = e, this.designerHostService = t, this.eventsEditorUtils = t.eventsEditorUtils, this.formSchemaUtils = t.formSchemaUtils, this.formMetadataConverter = t.formMetadataConverter, this.viewModelId = ((s = this.formSchemaUtils) == null ? void 0 : s.getViewModelIdByComponentId(e)) || "", this.designViewModelUtils = t.designViewModelUtils, this.controlCreatorUtils = t.controlCreatorUtils, this.metadataService = t.metadataService, this.schemaService = t.schemaService;
|
|
1586
|
+
}
|
|
1587
|
+
getTableInfo() {
|
|
1588
|
+
var e;
|
|
1589
|
+
return (e = this.schemaService) == null ? void 0 : e.getTableInfoByViewModelId(this.viewModelId);
|
|
1590
|
+
}
|
|
1591
|
+
setDesignViewModelField(e) {
|
|
1592
|
+
var s;
|
|
1593
|
+
const t = e.binding && e.binding.type === "Form" && e.binding.field;
|
|
1594
|
+
if (t) {
|
|
1595
|
+
if (!this.designViewModelField) {
|
|
1596
|
+
const r = this.designViewModelUtils.getDgViewModel(this.viewModelId);
|
|
1597
|
+
this.designViewModelField = r.fields.find((a) => a.id === t);
|
|
1598
|
+
}
|
|
1599
|
+
e.updateOn = (s = this.designViewModelField) == null ? void 0 : s.updateOn;
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
changeFieldEditorType(e, t) {
|
|
1603
|
+
}
|
|
1604
|
+
getBasicPropConfig(e) {
|
|
1605
|
+
return {
|
|
1606
|
+
description: "Basic Information",
|
|
1607
|
+
title: "基本信息",
|
|
1608
|
+
properties: {
|
|
1609
|
+
id: {
|
|
1610
|
+
description: "组件标识",
|
|
1611
|
+
title: "标识",
|
|
1612
|
+
type: "string",
|
|
1613
|
+
readonly: !0
|
|
1614
|
+
},
|
|
1615
|
+
type: {
|
|
1616
|
+
description: "组件类型",
|
|
1617
|
+
title: "控件类型",
|
|
1618
|
+
type: "select",
|
|
1619
|
+
editor: {
|
|
1620
|
+
type: "combo-list",
|
|
1621
|
+
textField: "name",
|
|
1622
|
+
valueField: "value",
|
|
1623
|
+
data: [{ value: e.type, name: q[e.type].name }]
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
}
|
|
1627
|
+
};
|
|
1628
|
+
}
|
|
1629
|
+
getAppearanceConfig(e = null) {
|
|
1630
|
+
return {
|
|
1631
|
+
title: "样式",
|
|
1632
|
+
description: "Appearance",
|
|
1633
|
+
properties: {
|
|
1634
|
+
class: {
|
|
1635
|
+
title: "class样式",
|
|
1636
|
+
type: "string",
|
|
1637
|
+
description: "组件的CSS样式",
|
|
1638
|
+
$converter: "/converter/appearance.converter"
|
|
1639
|
+
},
|
|
1640
|
+
style: {
|
|
1641
|
+
title: "style样式",
|
|
1642
|
+
type: "string",
|
|
1643
|
+
description: "组件的样式",
|
|
1644
|
+
$converter: "/converter/appearance.converter"
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
};
|
|
1648
|
+
}
|
|
1649
|
+
/**
|
|
1650
|
+
*
|
|
1651
|
+
* @param propertyId
|
|
1652
|
+
* @param componentInstance
|
|
1653
|
+
* @returns
|
|
1654
|
+
*/
|
|
1655
|
+
updateElementByParentContainer(e, t) {
|
|
1656
|
+
const s = t && t.parent && t.parent.schema;
|
|
1657
|
+
if (!s)
|
|
1658
|
+
return;
|
|
1659
|
+
const r = s.contents.findIndex((i) => i.id === e), a = ue(s.contents[r]);
|
|
1660
|
+
s.contents.splice(r, 1), s.contents.splice(r, 0, a);
|
|
1661
|
+
}
|
|
1662
|
+
}
|
|
1663
|
+
class jt extends re {
|
|
1664
|
+
constructor(e, t) {
|
|
1665
|
+
super(e, t);
|
|
1666
|
+
}
|
|
1667
|
+
getPropertyConfig(e) {
|
|
1668
|
+
return this.getBasicPropConfig(e), this.getAppearancePropConfig(e), this.getBehaviorProperties(e), this.propertyConfig;
|
|
1669
|
+
}
|
|
1670
|
+
getAppearancePropConfig(e) {
|
|
1671
|
+
this.propertyConfig.categories.appearance = {
|
|
1672
|
+
title: "样式",
|
|
1673
|
+
description: "Appearance",
|
|
1674
|
+
properties: {
|
|
1675
|
+
class: {
|
|
1676
|
+
title: "class样式",
|
|
1677
|
+
type: "string",
|
|
1678
|
+
description: "组件的CSS样式",
|
|
1679
|
+
$converter: "/converter/appearance.converter"
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
};
|
|
1683
|
+
}
|
|
1684
|
+
getBasicPropConfig(e) {
|
|
1685
|
+
this.propertyConfig.categories.basic = {
|
|
1686
|
+
description: "Basic Infomation",
|
|
1687
|
+
title: "基本信息",
|
|
1688
|
+
properties: {
|
|
1689
|
+
id: {
|
|
1690
|
+
description: "组件标识",
|
|
1691
|
+
title: "标识",
|
|
1692
|
+
type: "string",
|
|
1693
|
+
readonly: !0
|
|
1694
|
+
},
|
|
1695
|
+
type: {
|
|
1696
|
+
title: "类型",
|
|
1697
|
+
type: "enum",
|
|
1698
|
+
description: "The type of a component.",
|
|
1699
|
+
editor: {
|
|
1700
|
+
type: "combo-list",
|
|
1701
|
+
textField: "value",
|
|
1702
|
+
valueField: "key",
|
|
1703
|
+
data: [{ key: "response-toolbar", value: q["response-toolbar"].name }]
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
};
|
|
1708
|
+
}
|
|
1709
|
+
getBehaviorProperties(e) {
|
|
1710
|
+
this.propertyConfig.categories.behavior = {
|
|
1711
|
+
title: "行为",
|
|
1712
|
+
description: "",
|
|
1713
|
+
properties: {
|
|
1714
|
+
alignment: {
|
|
1715
|
+
title: "对齐方式",
|
|
1716
|
+
description: "The alignment of Response Toolbar Button.",
|
|
1717
|
+
type: "enum",
|
|
1718
|
+
editor: {
|
|
1719
|
+
type: "combo-list",
|
|
1720
|
+
textField: "name",
|
|
1721
|
+
valueField: "value",
|
|
1722
|
+
data: [
|
|
1723
|
+
{
|
|
1724
|
+
value: "right",
|
|
1725
|
+
name: "右对齐"
|
|
1726
|
+
},
|
|
1727
|
+
{
|
|
1728
|
+
value: "left",
|
|
1729
|
+
name: "左对齐"
|
|
1730
|
+
}
|
|
1731
|
+
]
|
|
1732
|
+
}
|
|
1733
|
+
},
|
|
1734
|
+
items: {
|
|
1735
|
+
title: "按钮",
|
|
1736
|
+
description: "The items of Response Toolbar.",
|
|
1737
|
+
type: "array",
|
|
1738
|
+
default: [],
|
|
1739
|
+
$converter: "/converter/buttons.converter",
|
|
1740
|
+
refreshPanelAfterChanged: !0
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
};
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
function Lt(n, e) {
|
|
1747
|
+
const t = n.schema;
|
|
1748
|
+
function s(h) {
|
|
1749
|
+
return !1;
|
|
1750
|
+
}
|
|
1751
|
+
function r(h, p) {
|
|
1752
|
+
return p.text = h.label, p;
|
|
1753
|
+
}
|
|
1754
|
+
function a() {
|
|
1755
|
+
return !1;
|
|
1756
|
+
}
|
|
1757
|
+
function i() {
|
|
1758
|
+
return !1;
|
|
1759
|
+
}
|
|
1760
|
+
function g() {
|
|
1761
|
+
return !0;
|
|
1762
|
+
}
|
|
1763
|
+
function f() {
|
|
1764
|
+
return !0;
|
|
1765
|
+
}
|
|
1766
|
+
function u(h) {
|
|
1767
|
+
return new jt(h, e).getPropertyConfig(t);
|
|
1768
|
+
}
|
|
1769
|
+
return {
|
|
1770
|
+
canAccepts: s,
|
|
1771
|
+
checkCanAddComponent: g,
|
|
1772
|
+
checkCanDeleteComponent: i,
|
|
1773
|
+
checkCanMoveComponent: a,
|
|
1774
|
+
hideNestedPaddingInDesginerView: f,
|
|
1775
|
+
onResolveNewComponentSchema: r,
|
|
1776
|
+
getPropsConfig: u
|
|
1777
|
+
};
|
|
1778
|
+
}
|
|
1779
|
+
const Ft = {
|
|
1780
|
+
id: { type: String, default: "" },
|
|
1781
|
+
componentId: { type: String, default: "" },
|
|
1782
|
+
canAdd: { type: Boolean, default: !1 },
|
|
1783
|
+
canDelete: { type: Boolean, default: !1 },
|
|
1784
|
+
canMove: { type: Boolean, default: !1 },
|
|
1785
|
+
contentKey: { type: String, default: "contents" },
|
|
1786
|
+
childLabel: { type: String, default: "" },
|
|
1787
|
+
childType: { type: String, default: "" },
|
|
1788
|
+
/**
|
|
1789
|
+
* 组件值
|
|
1790
|
+
*/
|
|
1791
|
+
modelValue: { type: Object }
|
|
1792
|
+
}, ce = w(0);
|
|
1793
|
+
function Ot(n, e) {
|
|
1794
|
+
const t = e.getBoundingClientRect(), s = n.getBoundingClientRect(), r = s.top >= t.top, a = s.top <= t.bottom;
|
|
1795
|
+
return r && a;
|
|
1796
|
+
}
|
|
1797
|
+
function Nt(n) {
|
|
1798
|
+
if (!n)
|
|
1799
|
+
return;
|
|
1800
|
+
let e;
|
|
1801
|
+
if (n.className.includes("dgComponentSelected") ? e = n : e = n.querySelector(".dgComponentSelected"), !e)
|
|
1802
|
+
return;
|
|
1803
|
+
const t = e.getBoundingClientRect();
|
|
1804
|
+
if (t.width === 0 && t.height === 0)
|
|
1805
|
+
return;
|
|
1806
|
+
const s = e.querySelector(".component-btn-group");
|
|
1807
|
+
if (s) {
|
|
1808
|
+
if (!Ot(e, n)) {
|
|
1809
|
+
s.style.display = "none";
|
|
1810
|
+
return;
|
|
1811
|
+
}
|
|
1812
|
+
s.style.display = "";
|
|
1813
|
+
const a = s.getBoundingClientRect(), i = s.querySelector("div");
|
|
1814
|
+
if (i) {
|
|
1815
|
+
const g = i.getBoundingClientRect();
|
|
1816
|
+
i.style.top = a.top + "px", i.style.left = a.left - g.width + "px";
|
|
1817
|
+
}
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
function Vt(n, e, t) {
|
|
1821
|
+
var B;
|
|
1822
|
+
const s = "", r = w();
|
|
1823
|
+
function a() {
|
|
1824
|
+
return !0;
|
|
1825
|
+
}
|
|
1826
|
+
function i() {
|
|
1827
|
+
return !1;
|
|
1828
|
+
}
|
|
1829
|
+
function g() {
|
|
1830
|
+
return !0;
|
|
1831
|
+
}
|
|
1832
|
+
function f() {
|
|
1833
|
+
return !0;
|
|
1834
|
+
}
|
|
1835
|
+
function u() {
|
|
1836
|
+
return !0;
|
|
1837
|
+
}
|
|
1838
|
+
function h(v) {
|
|
1839
|
+
if (!v || !v.value)
|
|
1840
|
+
return null;
|
|
1841
|
+
const S = w(v == null ? void 0 : v.value.parent), D = h(S);
|
|
1842
|
+
return D || null;
|
|
1843
|
+
}
|
|
1844
|
+
function p(v = e) {
|
|
1845
|
+
const { componentInstance: S, designerItemElementRef: D } = v;
|
|
1846
|
+
return !S || !S.value ? null : S.value.canMove || S.value.canAdd || S.value.canDelete ? D : p(v.parent);
|
|
1847
|
+
}
|
|
1848
|
+
function b(v) {
|
|
1849
|
+
return !!t;
|
|
1850
|
+
}
|
|
1851
|
+
function y() {
|
|
1852
|
+
return (e == null ? void 0 : e.schema.label) || (e == null ? void 0 : e.schema.title) || (e == null ? void 0 : e.schema.name);
|
|
1853
|
+
}
|
|
1854
|
+
function M() {
|
|
1855
|
+
}
|
|
1856
|
+
function k(v, S) {
|
|
1857
|
+
}
|
|
1858
|
+
function I(v) {
|
|
1859
|
+
const { componentType: S } = v, D = N("designer-host-service");
|
|
1860
|
+
let $ = J(S, v, D);
|
|
1861
|
+
const V = S.toLowerCase().replace(/-/g, "_");
|
|
1862
|
+
return $ && !$.id && $.type === S && ($.id = `${V}_${Math.random().toString().slice(2, 6)}`), $;
|
|
1863
|
+
}
|
|
1864
|
+
function R(v) {
|
|
1865
|
+
}
|
|
1866
|
+
function L(...v) {
|
|
1867
|
+
return [];
|
|
1868
|
+
}
|
|
1869
|
+
function x() {
|
|
1870
|
+
}
|
|
1871
|
+
return r.value = {
|
|
1872
|
+
canMove: a(),
|
|
1873
|
+
canSelectParent: i(),
|
|
1874
|
+
canAdd: f(),
|
|
1875
|
+
canDelete: g(),
|
|
1876
|
+
canNested: !u(),
|
|
1877
|
+
contents: [],
|
|
1878
|
+
elementRef: n,
|
|
1879
|
+
parent: (B = e.parent) == null ? void 0 : B.componentInstance,
|
|
1880
|
+
schema: e.schema,
|
|
1881
|
+
styles: s,
|
|
1882
|
+
canAccepts: b,
|
|
1883
|
+
getBelongedComponentInstance: h,
|
|
1884
|
+
getDraggableDesignItemElement: p,
|
|
1885
|
+
getDraggingDisplayText: y,
|
|
1886
|
+
getPropConfig: L,
|
|
1887
|
+
getDragScopeElement: M,
|
|
1888
|
+
onAcceptMovedChildElement: k,
|
|
1889
|
+
onChildElementMovedOut: R,
|
|
1890
|
+
addNewChildComponentSchema: I,
|
|
1891
|
+
onRemoveComponent: x,
|
|
1892
|
+
triggerBelongedComponentToMoveWhenMoved: w(!1),
|
|
1893
|
+
triggerBelongedComponentToDeleteWhenDeleted: w(!1)
|
|
1894
|
+
}, r;
|
|
1895
|
+
}
|
|
1896
|
+
const we = /* @__PURE__ */ Z({
|
|
1897
|
+
name: "FDesignerInnerItem",
|
|
1898
|
+
props: Ft,
|
|
1899
|
+
emits: ["selectionChange", "addComponent", "removeComponent"],
|
|
1900
|
+
setup(n, e) {
|
|
1901
|
+
const t = w(n.canMove), s = w(n.canAdd), r = w(n.canDelete), a = w(!1), i = w(n.contentKey), g = w(n.childType), f = w(n.childLabel), u = w(n.modelValue), h = w(""), p = w(), b = N("canvas-dragula"), y = w(), M = N("design-item-context"), k = {
|
|
1902
|
+
designerItemElementRef: p,
|
|
1903
|
+
componentInstance: y,
|
|
1904
|
+
schema: u.value,
|
|
1905
|
+
parent: M,
|
|
1906
|
+
setupContext: e
|
|
1907
|
+
};
|
|
1908
|
+
ke("design-item-context", k);
|
|
1909
|
+
const I = A(() => ({
|
|
1910
|
+
"farris-component": !0,
|
|
1911
|
+
// 受position-relative影响,整个容器的高度不能被撑起
|
|
1912
|
+
"flex-fill": n.id === "root-component",
|
|
1913
|
+
"position-relative": t.value || r.value,
|
|
1914
|
+
"farris-nested": a.value,
|
|
1915
|
+
"can-move": t.value,
|
|
1916
|
+
"d-none": p.value && p.value.classList.contains("d-none")
|
|
1917
|
+
})), R = A(() => {
|
|
1918
|
+
const o = {};
|
|
1919
|
+
return h.value && h.value.split(";").reduce((c, d) => {
|
|
1920
|
+
const [T, P] = d.split(":");
|
|
1921
|
+
return T && (c[T] = P), c;
|
|
1922
|
+
}, o), o;
|
|
1923
|
+
});
|
|
1924
|
+
function L(o, c) {
|
|
1925
|
+
if (M && M.schema[i.value]) {
|
|
1926
|
+
const d = M.schema[i.value].findIndex((T) => T.id === c.id);
|
|
1927
|
+
if (d > -1) {
|
|
1928
|
+
const T = M.schema[i.value].length, P = M.schema[i.value][d % T];
|
|
1929
|
+
M.designerItemElementRef.value.querySelector(`#${P.id}-design-item`), M.schema[i.value].splice(d, 1), ce.value++, e.emit("removeComponent");
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
function x(o) {
|
|
1934
|
+
if (y.value.addNewChildComponentSchema) {
|
|
1935
|
+
const c = {
|
|
1936
|
+
componentType: g.value,
|
|
1937
|
+
label: f.value,
|
|
1938
|
+
parentComponentInstance: y.value,
|
|
1939
|
+
targetPosition: -1
|
|
1940
|
+
}, d = y.value.addNewChildComponentSchema(c);
|
|
1941
|
+
u.value[i.value].push(d), e.emit("addComponent");
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
function B() {
|
|
1945
|
+
return s.value && m("div", {
|
|
1946
|
+
role: "button",
|
|
1947
|
+
class: "btn component-settings-button",
|
|
1948
|
+
title: "新增",
|
|
1949
|
+
ref: "removeComponent",
|
|
1950
|
+
onClick: (o) => {
|
|
1951
|
+
x();
|
|
1952
|
+
}
|
|
1953
|
+
}, [m("i", {
|
|
1954
|
+
class: "f-icon f-icon-plus-circle"
|
|
1955
|
+
}, null)]);
|
|
1956
|
+
}
|
|
1957
|
+
function v(o) {
|
|
1958
|
+
return r.value && m("div", {
|
|
1959
|
+
role: "button",
|
|
1960
|
+
class: "btn component-settings-button",
|
|
1961
|
+
title: "删除",
|
|
1962
|
+
ref: "removeComponent",
|
|
1963
|
+
onClick: xe((c) => L(c, o), ["stop"])
|
|
1964
|
+
}, [m("i", {
|
|
1965
|
+
class: "f-icon f-icon-yxs_delete"
|
|
1966
|
+
}, null)]);
|
|
1967
|
+
}
|
|
1968
|
+
function S() {
|
|
1969
|
+
return t.value && m("div", {
|
|
1970
|
+
role: "button",
|
|
1971
|
+
class: "btn component-settings-button",
|
|
1972
|
+
title: "移动",
|
|
1973
|
+
ref: "moveComponent"
|
|
1974
|
+
}, [m("i", {
|
|
1975
|
+
"data-dragging-icon": "true",
|
|
1976
|
+
class: "cmp_move f-icon f-icon-yxs_move"
|
|
1977
|
+
}, null)]);
|
|
1978
|
+
}
|
|
1979
|
+
function D(o) {
|
|
1980
|
+
return m("div", {
|
|
1981
|
+
class: "component-btn-group",
|
|
1982
|
+
"data-noattach": "true"
|
|
1983
|
+
}, [m("div", null, [B(), S(), v(o)])]);
|
|
1984
|
+
}
|
|
1985
|
+
X(() => n.modelValue, (o) => {
|
|
1986
|
+
u.value = o, k.schema = o;
|
|
1987
|
+
});
|
|
1988
|
+
function $(o) {
|
|
1989
|
+
const c = o.target;
|
|
1990
|
+
Nt(c);
|
|
1991
|
+
}
|
|
1992
|
+
function V() {
|
|
1993
|
+
var o, c;
|
|
1994
|
+
(c = (o = u.value) == null ? void 0 : o.contents) != null && c.length && p.value && p.value.addEventListener("scroll", $);
|
|
1995
|
+
}
|
|
1996
|
+
function C() {
|
|
1997
|
+
const o = p.value, c = w(o.children[1]);
|
|
1998
|
+
return Vt(c, k).value;
|
|
1999
|
+
}
|
|
2000
|
+
W(() => {
|
|
2001
|
+
if (p.value) {
|
|
2002
|
+
const o = p.value.querySelector(`[data-dragref='${u.value.id}-container']`);
|
|
2003
|
+
y.value = o && o.componentInstance ? o.componentInstance.value : C(), b && o && b.attachComponents(o, u.value), a.value = y.value.canNested !== void 0 ? y.value.canNested : a.value, s.value = y.value.canAdd !== void 0 ? y.value.canAdd : s.value, r.value = y.value.canDelete !== void 0 ? y.value.canDelete : r.value, t.value = y.value.canMove !== void 0 ? y.value.canMove : t.value, h.value = y.value.styles || "", p.value && (p.value.componentInstance = y, p.value.designItemContext = k);
|
|
2004
|
+
}
|
|
2005
|
+
V(), ce.value++;
|
|
2006
|
+
}), Ee(() => {
|
|
2007
|
+
p.value && p.value.removeEventListener("scroll", $);
|
|
2008
|
+
});
|
|
2009
|
+
function l(o) {
|
|
2010
|
+
Array.from(document.getElementsByClassName("dgComponentFocused")).forEach((T) => T.classList.remove("dgComponentFocused")), o && (o.preventDefault(), o.stopPropagation());
|
|
2011
|
+
let c = k.designerItemElementRef;
|
|
2012
|
+
const d = p.value;
|
|
2013
|
+
if (d) {
|
|
2014
|
+
const T = document.getElementsByClassName("dgComponentSelected");
|
|
2015
|
+
T && T.length === 1 && T[0] === p.value || (Array.from(T).forEach((j) => j.classList.remove("dgComponentSelected")), d.classList.add("dgComponentFocused"), e.emit("selectionChange", u.value.type, u.value, n.componentId, y.value), c = y.value.getDraggableDesignItemElement(k), c && c.value && c.value.classList.add("dgComponentSelected"));
|
|
2016
|
+
}
|
|
2017
|
+
$({
|
|
2018
|
+
target: c == null ? void 0 : c.value
|
|
2019
|
+
});
|
|
2020
|
+
}
|
|
2021
|
+
return () => m("div", {
|
|
2022
|
+
id: `${n.id}-design-item`,
|
|
2023
|
+
ref: p,
|
|
2024
|
+
class: I.value,
|
|
2025
|
+
style: R.value,
|
|
2026
|
+
onClick: l
|
|
2027
|
+
}, [D(u.value), e.slots.default && e.slots.default()]);
|
|
2028
|
+
}
|
|
2029
|
+
});
|
|
2030
|
+
class _t extends re {
|
|
2031
|
+
constructor(e, t) {
|
|
2032
|
+
super(e, t);
|
|
2033
|
+
}
|
|
2034
|
+
getPropertyConfig(e) {
|
|
2035
|
+
return this.getBasicPropConfig(e), this.getAppearanceProperties(e), this.getEventPropConfig(e), this.propertyConfig;
|
|
2036
|
+
}
|
|
2037
|
+
getBasicPropConfig(e) {
|
|
2038
|
+
this.propertyConfig.categories.basic = {
|
|
2039
|
+
description: "Basic Information",
|
|
2040
|
+
title: "基本信息",
|
|
2041
|
+
properties: {
|
|
2042
|
+
id: {
|
|
2043
|
+
description: "组件标识00",
|
|
2044
|
+
title: "标识",
|
|
2045
|
+
type: "string",
|
|
2046
|
+
readonly: !0
|
|
2047
|
+
},
|
|
2048
|
+
type: {
|
|
2049
|
+
description: "类型",
|
|
2050
|
+
title: "类型",
|
|
2051
|
+
type: "string",
|
|
2052
|
+
readonly: !0,
|
|
2053
|
+
$converter: "/converter/type.converter"
|
|
2054
|
+
},
|
|
2055
|
+
text: {
|
|
2056
|
+
title: "文本",
|
|
2057
|
+
type: "string",
|
|
2058
|
+
description: ""
|
|
2059
|
+
},
|
|
2060
|
+
icon: {
|
|
2061
|
+
title: "图标",
|
|
2062
|
+
type: "string",
|
|
2063
|
+
description: ""
|
|
2064
|
+
}
|
|
2065
|
+
}
|
|
2066
|
+
};
|
|
2067
|
+
}
|
|
2068
|
+
getAppearanceProperties(e) {
|
|
2069
|
+
this.propertyConfig.categories.appearance = {
|
|
2070
|
+
title: "外观",
|
|
2071
|
+
properties: {
|
|
2072
|
+
class: {
|
|
2073
|
+
description: "组件的CSS样式",
|
|
2074
|
+
title: "class样式"
|
|
2075
|
+
},
|
|
2076
|
+
style: {
|
|
2077
|
+
description: "组件的内容样式",
|
|
2078
|
+
title: "style样式"
|
|
2079
|
+
}
|
|
2080
|
+
},
|
|
2081
|
+
setPropertyRelates(t, s) {
|
|
2082
|
+
}
|
|
2083
|
+
};
|
|
2084
|
+
}
|
|
2085
|
+
getEventPropConfig(e) {
|
|
2086
|
+
const t = [
|
|
2087
|
+
{
|
|
2088
|
+
label: "onClick",
|
|
2089
|
+
name: "点击事件"
|
|
2090
|
+
}
|
|
2091
|
+
], s = this, r = s.eventsEditorUtils.formProperties(e, s.viewModelId, t), a = {};
|
|
2092
|
+
a[s.viewModelId] = {
|
|
2093
|
+
type: "events-editor",
|
|
2094
|
+
editor: {
|
|
2095
|
+
initialData: r
|
|
2096
|
+
}
|
|
2097
|
+
}, this.propertyConfig.categories.eventsEditor = {
|
|
2098
|
+
title: "事件",
|
|
2099
|
+
hideTitle: !0,
|
|
2100
|
+
properties: a,
|
|
2101
|
+
// 这个属性,标记当属性变更得时候触发重新更新属性
|
|
2102
|
+
refreshPanelAfterChanged: !0,
|
|
2103
|
+
tabId: "commands",
|
|
2104
|
+
tabName: "交互",
|
|
2105
|
+
setPropertyRelates(i, g) {
|
|
2106
|
+
const f = i.propertyValue;
|
|
2107
|
+
delete e[s.viewModelId], f && (f.setPropertyRelates = this.setPropertyRelates, s.eventsEditorUtils.saveRelatedParameters(e, s.viewModelId, f.events, f));
|
|
2108
|
+
}
|
|
2109
|
+
};
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
class qt extends re {
|
|
2113
|
+
constructor(e, t) {
|
|
2114
|
+
super(e, t);
|
|
2115
|
+
}
|
|
2116
|
+
getPropertyConfig(e) {
|
|
2117
|
+
return this.getBasicPropConfig(), this.getAppearanceProperties(e), this.getbBehaviorConfig(), this.getEventPropConfig(e), this.propertyConfig;
|
|
2118
|
+
}
|
|
2119
|
+
getBasicPropConfig() {
|
|
2120
|
+
this.propertyConfig.categories.basic = {
|
|
2121
|
+
title: "基本信息",
|
|
2122
|
+
description: "Basic Infomation",
|
|
2123
|
+
properties: {
|
|
2124
|
+
id: {
|
|
2125
|
+
title: "标识",
|
|
2126
|
+
type: "string",
|
|
2127
|
+
description: "The identifier of a component.",
|
|
2128
|
+
readonly: !0
|
|
2129
|
+
},
|
|
2130
|
+
type: {
|
|
2131
|
+
title: "类型",
|
|
2132
|
+
type: "enum",
|
|
2133
|
+
description: "The type of a component.",
|
|
2134
|
+
editor: {
|
|
2135
|
+
type: "combo-list",
|
|
2136
|
+
textField: "value",
|
|
2137
|
+
valueField: "key",
|
|
2138
|
+
data: [{ key: "response-toolbar-item", value: q["response-toolbar-item"].name }]
|
|
2139
|
+
}
|
|
2140
|
+
},
|
|
2141
|
+
text: {
|
|
2142
|
+
title: "文本",
|
|
2143
|
+
type: "string",
|
|
2144
|
+
description: "",
|
|
2145
|
+
refreshPanelAfterChanged: !0
|
|
2146
|
+
},
|
|
2147
|
+
icon: {
|
|
2148
|
+
title: "图标",
|
|
2149
|
+
type: "string",
|
|
2150
|
+
description: ""
|
|
2151
|
+
}
|
|
2152
|
+
}
|
|
2153
|
+
};
|
|
2154
|
+
}
|
|
2155
|
+
getbBehaviorConfig() {
|
|
2156
|
+
this.propertyConfig.categories.behavior = {
|
|
2157
|
+
title: "行为",
|
|
2158
|
+
description: "Behavior",
|
|
2159
|
+
properties: {
|
|
2160
|
+
disabled: {
|
|
2161
|
+
title: "禁用",
|
|
2162
|
+
type: "boolean",
|
|
2163
|
+
description: "按钮禁用状态",
|
|
2164
|
+
refreshPanelAfterChanged: !0
|
|
2165
|
+
}
|
|
2166
|
+
}
|
|
2167
|
+
};
|
|
2168
|
+
}
|
|
2169
|
+
getAppearanceProperties(e) {
|
|
2170
|
+
this.propertyConfig.categories.appearance = {
|
|
2171
|
+
title: "样式",
|
|
2172
|
+
description: "Appearance",
|
|
2173
|
+
properties: {
|
|
2174
|
+
class: {
|
|
2175
|
+
title: "class样式",
|
|
2176
|
+
type: "string",
|
|
2177
|
+
description: "",
|
|
2178
|
+
$converter: "/converter/appearance.converter"
|
|
2179
|
+
}
|
|
2180
|
+
}
|
|
2181
|
+
};
|
|
2182
|
+
}
|
|
2183
|
+
getEventPropConfig(e) {
|
|
2184
|
+
const t = [
|
|
2185
|
+
{
|
|
2186
|
+
label: "onClick",
|
|
2187
|
+
name: "点击事件"
|
|
2188
|
+
}
|
|
2189
|
+
], s = this, r = s.eventsEditorUtils.formProperties(e, s.viewModelId, t), a = {};
|
|
2190
|
+
a[s.viewModelId] = {
|
|
2191
|
+
type: "events-editor",
|
|
2192
|
+
editor: {
|
|
2193
|
+
initialData: r
|
|
2194
|
+
}
|
|
2195
|
+
}, this.propertyConfig.categories.eventsEditor = {
|
|
2196
|
+
title: "事件",
|
|
2197
|
+
hideTitle: !0,
|
|
2198
|
+
properties: a,
|
|
2199
|
+
// 这个属性,标记当属性变更得时候触发重新更新属性
|
|
2200
|
+
refreshPanelAfterChanged: !0,
|
|
2201
|
+
tabId: "commands",
|
|
2202
|
+
tabName: "交互",
|
|
2203
|
+
setPropertyRelates(i, g) {
|
|
2204
|
+
const f = i.propertyValue;
|
|
2205
|
+
delete e[s.viewModelId], f && (f.setPropertyRelates = this.setPropertyRelates, s.eventsEditorUtils.saveRelatedParameters(e, s.viewModelId, f.events, f));
|
|
2206
|
+
}
|
|
2207
|
+
};
|
|
2208
|
+
}
|
|
2209
|
+
}
|
|
2210
|
+
function zt(n, e) {
|
|
2211
|
+
function t(g) {
|
|
2212
|
+
return !1;
|
|
2213
|
+
}
|
|
2214
|
+
function s() {
|
|
2215
|
+
return !1;
|
|
2216
|
+
}
|
|
2217
|
+
function r() {
|
|
2218
|
+
return !0;
|
|
2219
|
+
}
|
|
2220
|
+
function a() {
|
|
2221
|
+
return !1;
|
|
2222
|
+
}
|
|
2223
|
+
function i(g) {
|
|
2224
|
+
let f;
|
|
2225
|
+
switch (n.schema.type) {
|
|
2226
|
+
case "tab-toolbar-item":
|
|
2227
|
+
f = new _t(g, e);
|
|
2228
|
+
break;
|
|
2229
|
+
default:
|
|
2230
|
+
f = new qt(g, e);
|
|
2231
|
+
}
|
|
2232
|
+
return f.getPropertyConfig(n.schema);
|
|
2233
|
+
}
|
|
2234
|
+
return {
|
|
2235
|
+
canAccepts: t,
|
|
2236
|
+
checkCanMoveComponent: s,
|
|
2237
|
+
checkCanDeleteComponent: r,
|
|
2238
|
+
checkCanAddComponent: a,
|
|
2239
|
+
getPropsConfig: i
|
|
2240
|
+
};
|
|
2241
|
+
}
|
|
2242
|
+
const Ut = /* @__PURE__ */ Z({
|
|
2243
|
+
name: "FResponseToolbarItemDesign",
|
|
2244
|
+
props: Ce,
|
|
2245
|
+
emits: ["Click"],
|
|
2246
|
+
setup(n, e) {
|
|
2247
|
+
w(), w();
|
|
2248
|
+
const t = w(n.alignment), s = {
|
|
2249
|
+
id: "__more_buttons__",
|
|
2250
|
+
text: "More"
|
|
2251
|
+
}, r = w(new K(s));
|
|
2252
|
+
A(() => r.value.children.length > 0);
|
|
2253
|
+
const a = w(), i = N("designer-host-service"), g = N("design-item-context"), f = zt(g, i), u = de(a, g, f);
|
|
2254
|
+
N("toolbar-item-handler", () => {
|
|
2255
|
+
}), W(() => {
|
|
2256
|
+
a.value.componentInstance = u;
|
|
2257
|
+
}), e.expose(u.value);
|
|
2258
|
+
function h() {
|
|
2259
|
+
const y = {
|
|
2260
|
+
"f-icon": !0
|
|
2261
|
+
}, M = n.icon ? n.icon.trim() : "";
|
|
2262
|
+
return ne(y, M);
|
|
2263
|
+
}
|
|
2264
|
+
function p() {
|
|
2265
|
+
return !!(n.icon && n.icon.trim());
|
|
2266
|
+
}
|
|
2267
|
+
function b() {
|
|
2268
|
+
const y = {
|
|
2269
|
+
btn: !0,
|
|
2270
|
+
"f-rt-btn": !0,
|
|
2271
|
+
"f-btn-ml": t.value === "right",
|
|
2272
|
+
"f-btn-mr": t.value === "left",
|
|
2273
|
+
"btn-icontext": !!(n.icon && n.icon.trim()),
|
|
2274
|
+
disabled: n.disabled === !0
|
|
2275
|
+
};
|
|
2276
|
+
return ne(y, n.class);
|
|
2277
|
+
}
|
|
2278
|
+
return () => m("div", {
|
|
2279
|
+
ref: a,
|
|
2280
|
+
"data-dragref": `${g.schema.id}-container`,
|
|
2281
|
+
class: "farris-component position-relative",
|
|
2282
|
+
style: "display:inline-block!important;"
|
|
2283
|
+
}, [m("button", {
|
|
2284
|
+
type: "button",
|
|
2285
|
+
class: b(),
|
|
2286
|
+
id: n.id
|
|
2287
|
+
}, [p() && m("i", {
|
|
2288
|
+
class: h()
|
|
2289
|
+
}, null), n.text])]);
|
|
2290
|
+
}
|
|
2291
|
+
}), Ht = /* @__PURE__ */ Z({
|
|
2292
|
+
name: "FResponseToolbarDesign",
|
|
2293
|
+
props: kt,
|
|
2294
|
+
emits: ["Click"],
|
|
2295
|
+
setup(n, e) {
|
|
2296
|
+
const t = w(n.items);
|
|
2297
|
+
let s = new Array(t.value.length).fill(w());
|
|
2298
|
+
const r = w(), a = w(), i = w(n.alignment), g = {
|
|
2299
|
+
id: "__more_buttons__",
|
|
2300
|
+
text: "More"
|
|
2301
|
+
}, f = w(new K(g)), u = It();
|
|
2302
|
+
A(() => f.value.children.length > 0);
|
|
2303
|
+
const h = w(), p = N("designer-host-service"), b = N("design-item-context"), y = Lt(b, p), M = de(h, b, y), k = N("toolbar-item-handler", () => {
|
|
2304
|
+
});
|
|
2305
|
+
W(() => {
|
|
2306
|
+
h.value.componentInstance = M;
|
|
2307
|
+
}), e.expose(M.value);
|
|
2308
|
+
function I() {
|
|
2309
|
+
k && k();
|
|
2310
|
+
}
|
|
2311
|
+
const R = A(() => ne({
|
|
2312
|
+
"f-toolbar": !0,
|
|
2313
|
+
"f-response-toolbar": !0,
|
|
2314
|
+
"position-relative": !0
|
|
2315
|
+
}, n.customClass)), L = A(() => ({
|
|
2316
|
+
"d-flex": !0,
|
|
2317
|
+
"flex-nowrap": !0,
|
|
2318
|
+
"justify-content-end": i.value === "right",
|
|
2319
|
+
"justify-content-start": i.value === "left"
|
|
2320
|
+
})), {
|
|
2321
|
+
renderToolbarDropdown: x,
|
|
2322
|
+
clearAllDropDown: B
|
|
2323
|
+
} = $t(n, u, M);
|
|
2324
|
+
function v() {
|
|
2325
|
+
t.value.filter((o) => o.children && o.children.length > 0).forEach((o) => {
|
|
2326
|
+
o.expanded = !1;
|
|
2327
|
+
}), f.value.expanded = !1, B();
|
|
2328
|
+
}
|
|
2329
|
+
const S = /* @__PURE__ */ new Map(), D = [];
|
|
2330
|
+
function $(o) {
|
|
2331
|
+
const c = a.value;
|
|
2332
|
+
let d = o;
|
|
2333
|
+
const T = Array.from(c.children), P = T[T.length - 1].id === "__more_buttons__" ? T[T.length - 1] : null;
|
|
2334
|
+
if (P) {
|
|
2335
|
+
const F = P.computedStyleMap().get("margin-left"), O = P.computedStyleMap().get("margin-right"), U = (F ? F.value : 0) + P.getBoundingClientRect().width + (O ? O.value : 0);
|
|
2336
|
+
d -= U;
|
|
2337
|
+
}
|
|
2338
|
+
const j = T.filter((F) => F.id !== "__more_buttons__");
|
|
2339
|
+
for (const F of j) {
|
|
2340
|
+
const O = F.computedStyleMap().get("margin-left"), U = F.computedStyleMap().get("margin-right"), Q = (O ? O.value : 0) + F.getBoundingClientRect().width + (U ? U.value : 0);
|
|
2341
|
+
d < Q ? (S.set(F.id, !0), D.push({
|
|
2342
|
+
id: F.id,
|
|
2343
|
+
width: Q
|
|
2344
|
+
})) : d -= Q;
|
|
2345
|
+
}
|
|
2346
|
+
if (D.length)
|
|
2347
|
+
for (let F = D.length - 1; F >= 0; F--) {
|
|
2348
|
+
const O = D[F].width;
|
|
2349
|
+
if (d >= O)
|
|
2350
|
+
d -= O, S.delete(D[F].id), D.pop();
|
|
2351
|
+
else
|
|
2352
|
+
break;
|
|
2353
|
+
}
|
|
2354
|
+
const _ = Object.assign({}, f.value);
|
|
2355
|
+
_.children = [];
|
|
2356
|
+
const G = new K(_), z = t.value.reduce((F, O) => (S.has(O.id) && G.children.push(O), O.visible = !S.has(O.id), F.push(O), F), []);
|
|
2357
|
+
f.value = G, t.value = z;
|
|
2358
|
+
}
|
|
2359
|
+
const V = new ResizeObserver((o) => {
|
|
2360
|
+
if (o.length) {
|
|
2361
|
+
const d = o[0].contentRect.width, P = a.value.getBoundingClientRect().width;
|
|
2362
|
+
(d < P || D.length) && $(d);
|
|
2363
|
+
}
|
|
2364
|
+
});
|
|
2365
|
+
W(() => {
|
|
2366
|
+
const o = r.value;
|
|
2367
|
+
V.observe(o), document.body.addEventListener("click", v);
|
|
2368
|
+
}), Be(() => {
|
|
2369
|
+
V.disconnect(), document.body.removeEventListener("click", v);
|
|
2370
|
+
}), X(() => n.items, () => {
|
|
2371
|
+
t.value = n.items;
|
|
2372
|
+
}, {
|
|
2373
|
+
deep: !0
|
|
2374
|
+
}), X(t, (o) => {
|
|
2375
|
+
s = new Array(t.value.length).fill(w());
|
|
2376
|
+
});
|
|
2377
|
+
function C(o, c, d, T) {
|
|
2378
|
+
b && b.setupContext && b.setupContext.emit("selectionChange", o, c, d, T);
|
|
2379
|
+
}
|
|
2380
|
+
function l() {
|
|
2381
|
+
const o = a.value.querySelector(".dgComponentFocused.dgComponentSelected");
|
|
2382
|
+
o == null || o.classList.remove("dgComponentSelected"), o == null || o.classList.remove("dgComponentFocused"), I();
|
|
2383
|
+
}
|
|
2384
|
+
return () => m("div", {
|
|
2385
|
+
ref: h,
|
|
2386
|
+
"data-dragref": `${b.schema.id}-container`,
|
|
2387
|
+
class: R.value
|
|
2388
|
+
}, [m("div", {
|
|
2389
|
+
ref: r,
|
|
2390
|
+
class: L.value
|
|
2391
|
+
}, [m("div", {
|
|
2392
|
+
ref: a,
|
|
2393
|
+
class: "d-inline-block f-response-content",
|
|
2394
|
+
style: "white-space: nowrap;"
|
|
2395
|
+
}, [t.value.map((o, c) => m(we, {
|
|
2396
|
+
ref: s[c],
|
|
2397
|
+
class: "p-0 display-inline-block",
|
|
2398
|
+
modelValue: o,
|
|
2399
|
+
"onUpdate:modelValue": (d) => o = d,
|
|
2400
|
+
canMove: !0,
|
|
2401
|
+
childType: "response-toolbar-item",
|
|
2402
|
+
childLabel: "按钮",
|
|
2403
|
+
contentKey: "buttons",
|
|
2404
|
+
componentId: n.componentId,
|
|
2405
|
+
id: o.id,
|
|
2406
|
+
style: "padding:0 !important;display:inline-block",
|
|
2407
|
+
onSelectionChange: C,
|
|
2408
|
+
onRemoveComponent: l
|
|
2409
|
+
}, {
|
|
2410
|
+
default: () => {
|
|
2411
|
+
var d;
|
|
2412
|
+
return [m(Ut, {
|
|
2413
|
+
id: o.id,
|
|
2414
|
+
disabled: o.disabled,
|
|
2415
|
+
text: o.text,
|
|
2416
|
+
icon: o.icon,
|
|
2417
|
+
class: ((d = o.appearance) == null ? void 0 : d.class) || "btn-secondary",
|
|
2418
|
+
alignment: n.alignment || "right",
|
|
2419
|
+
componentId: n.componentId
|
|
2420
|
+
}, null)];
|
|
2421
|
+
}
|
|
2422
|
+
}))])])]);
|
|
2423
|
+
}
|
|
2424
|
+
});
|
|
2425
|
+
function Se(n, e) {
|
|
2426
|
+
const t = A(() => "f-section-toolbar" + (n.buttonPosition === "inHead" ? " f-section-header--toolbar" : " f-section-content--toolbar")), s = w(n.buttons), r = w(e.schema.toolbar), a = e.schema.id, i = `${a}-toolbar`, g = A(() => n.buttonPosition === "inHead" ? "right" : "left");
|
|
2427
|
+
function f(u, h, p, b) {
|
|
2428
|
+
var y;
|
|
2429
|
+
(y = e.setupContext) == null || y.emit("selectionChange", u, h, p, b);
|
|
2430
|
+
}
|
|
2431
|
+
return m(Ie, null, [r.value ? m("div", {
|
|
2432
|
+
class: t.value
|
|
2433
|
+
}, [m("div", {
|
|
2434
|
+
class: "w-100",
|
|
2435
|
+
style: "flex:1"
|
|
2436
|
+
}, [m(we, {
|
|
2437
|
+
modelValue: r.value,
|
|
2438
|
+
"onUpdate:modelValue": (u) => r.value = u,
|
|
2439
|
+
class: "w-100 position-relative",
|
|
2440
|
+
canAdd: !0,
|
|
2441
|
+
childType: "section-toolbar-item",
|
|
2442
|
+
childLabel: "按钮",
|
|
2443
|
+
contentKey: "buttons",
|
|
2444
|
+
id: i,
|
|
2445
|
+
onSelectionChange: f,
|
|
2446
|
+
componentId: a
|
|
2447
|
+
}, {
|
|
2448
|
+
default: () => [m(Ht, {
|
|
2449
|
+
customClass: "d-block",
|
|
2450
|
+
items: s.value,
|
|
2451
|
+
alignment: g.value
|
|
2452
|
+
}, null)]
|
|
2453
|
+
})])]) : ""]);
|
|
2454
|
+
}
|
|
2455
|
+
function Wt(n, e, t, s, r, a, i) {
|
|
2456
|
+
const g = A(() => n.buttonPosition), {
|
|
2457
|
+
onClickMaxMinIcon: f
|
|
2458
|
+
} = ge(s, r, a), u = A(() => !!n.subTitle), h = A(() => n.enableMaximize), p = A(() => n.enableAccordion !== ""), b = A(() => {
|
|
2459
|
+
const x = {
|
|
2460
|
+
"f-section-header": !0
|
|
2461
|
+
};
|
|
2462
|
+
return e.slots.header && n.headerClass.split(" ").reduce((v, S) => (v[S] = !0, v), x), x;
|
|
2463
|
+
});
|
|
2464
|
+
function y(x) {
|
|
2465
|
+
x.stopPropagation(), n.enableAccordion !== "" && (t.value = !t.value);
|
|
2466
|
+
}
|
|
2467
|
+
function M() {
|
|
2468
|
+
const x = A(() => ({
|
|
2469
|
+
btn: !0,
|
|
2470
|
+
"f-btn-collapse-expand": !0,
|
|
2471
|
+
"f-btn-mx": !0,
|
|
2472
|
+
"f-state-expand": t.value
|
|
2473
|
+
})), B = A(() => ({
|
|
2474
|
+
"f-icon": !0,
|
|
2475
|
+
"f-icon-maximize": !a.value,
|
|
2476
|
+
"f-icon-minimize": a.value
|
|
2477
|
+
}));
|
|
2478
|
+
return m("div", {
|
|
2479
|
+
class: "f-max-accordion"
|
|
2480
|
+
}, [h.value ? m("span", {
|
|
2481
|
+
class: B.value,
|
|
2482
|
+
onClick: f
|
|
2483
|
+
}, null) : "", p.value ? m("button", {
|
|
2484
|
+
class: x.value,
|
|
2485
|
+
onClick: y
|
|
2486
|
+
}, [m("span", null, [t.value ? n.collapseLabel : n.expandLabel])]) : ""]);
|
|
2487
|
+
}
|
|
2488
|
+
function k() {
|
|
2489
|
+
return e.slots.header ? m("div", {
|
|
2490
|
+
class: b.value
|
|
2491
|
+
}, [e.slots.header()]) : "";
|
|
2492
|
+
}
|
|
2493
|
+
function I() {
|
|
2494
|
+
return m("div", {
|
|
2495
|
+
class: "f-title",
|
|
2496
|
+
onClick: y
|
|
2497
|
+
}, [m("h4", {
|
|
2498
|
+
class: "f-title-text"
|
|
2499
|
+
}, [n.mainTitle]), u.value && m("span", null, [n.subTitle])]);
|
|
2500
|
+
}
|
|
2501
|
+
function R() {
|
|
2502
|
+
const x = A(() => {
|
|
2503
|
+
const B = {
|
|
2504
|
+
"f-content": !0
|
|
2505
|
+
};
|
|
2506
|
+
return n.headerContentClass && n.headerContentClass.split(" ").reduce((S, D) => (S[D] = !0, S), B), B;
|
|
2507
|
+
});
|
|
2508
|
+
return e.slots.headerContent ? m("div", {
|
|
2509
|
+
class: x.value
|
|
2510
|
+
}, [e.slots.headerContent()]) : "";
|
|
2511
|
+
}
|
|
2512
|
+
function L() {
|
|
2513
|
+
return m("div", {
|
|
2514
|
+
class: b.value
|
|
2515
|
+
}, [e.slots.headerTitle ? e.slots.headerTitle() : I(), R(), g.value === "inHead" && Se(n, i), (h.value || p.value) && M()]);
|
|
2516
|
+
}
|
|
2517
|
+
return () => n.showHeader && (e.slots.header ? k() : L());
|
|
2518
|
+
}
|
|
2519
|
+
const Gt = /* @__PURE__ */ Z({
|
|
2520
|
+
name: "FSectionDesign",
|
|
2521
|
+
props: se,
|
|
2522
|
+
emits: [],
|
|
2523
|
+
setup(n, e) {
|
|
2524
|
+
const t = w(), s = w(), r = w(), a = N("designer-host-service"), i = N("design-item-context"), g = at(i, a), f = ct(t, i, g);
|
|
2525
|
+
f.value.styles = "display: inherit;", W(() => {
|
|
2526
|
+
t.value.componentInstance = f;
|
|
2527
|
+
}), e.expose(f.value);
|
|
2528
|
+
const u = w(n.customClass), h = A(() => n.enableAccordion), p = w(n.expandStatus), b = A(() => n.buttonPosition), y = w(!1), M = Wt(n, e, p, s, r, y, i), k = A(() => {
|
|
2529
|
+
const B = {
|
|
2530
|
+
"f-section": !0,
|
|
2531
|
+
"f-section-accordion": h.value === "default",
|
|
2532
|
+
"f-state-collapse": (h.value === "default" || h.value === "custom") && !p.value,
|
|
2533
|
+
"f-section-custom-accordion": h.value === "custom",
|
|
2534
|
+
"f-section-fill": n.fill,
|
|
2535
|
+
"f-section-maximize": y.value,
|
|
2536
|
+
"f-utils-fill": !0,
|
|
2537
|
+
"p-0": !0
|
|
2538
|
+
};
|
|
2539
|
+
return H(B, u.value);
|
|
2540
|
+
}), I = A(() => H({
|
|
2541
|
+
"f-section-content": !0,
|
|
2542
|
+
"drag-container": !0
|
|
2543
|
+
}, n.contentClass)), R = A(() => H({
|
|
2544
|
+
"f-section-extend": !0
|
|
2545
|
+
}, R.value));
|
|
2546
|
+
function L() {
|
|
2547
|
+
return e.slots.extend && m("div", {
|
|
2548
|
+
class: R.value
|
|
2549
|
+
}, [e.slots.extend()]);
|
|
2550
|
+
}
|
|
2551
|
+
function x() {
|
|
2552
|
+
return m("div", {
|
|
2553
|
+
class: I.value,
|
|
2554
|
+
ref: t,
|
|
2555
|
+
"data-dragref": `${i.schema.id}-container`
|
|
2556
|
+
}, [b.value === "inContent" && Se(n, i), e.slots.default && e.slots.default()]);
|
|
2557
|
+
}
|
|
2558
|
+
return () => m("div", {
|
|
2559
|
+
class: k.value,
|
|
2560
|
+
ref: s,
|
|
2561
|
+
style: n.customStyle
|
|
2562
|
+
}, [M(), L(), x()]);
|
|
2563
|
+
}
|
|
2564
|
+
}), Qt = "https://json-schema.org/draft/2020-12/schema", Zt = "https://farris-design.gitee.io/section-toolbar-item.schema.json", Jt = "section-toolbar-item", Xt = "A Farris Toolbar Item Component", Yt = "object", Kt = {
|
|
2565
|
+
id: {
|
|
2566
|
+
description: "The unique identifier for a Response Toolbar",
|
|
2567
|
+
type: "string"
|
|
2568
|
+
},
|
|
2569
|
+
type: {
|
|
2570
|
+
description: "The type string of Response Toolbar",
|
|
2571
|
+
type: "string",
|
|
2572
|
+
default: "section-toolbar-item"
|
|
2573
|
+
},
|
|
2574
|
+
appearance: {
|
|
2575
|
+
description: "",
|
|
2576
|
+
type: "object",
|
|
2577
|
+
properties: {
|
|
2578
|
+
class: {
|
|
2579
|
+
type: "string"
|
|
2580
|
+
},
|
|
2581
|
+
style: {
|
|
2582
|
+
type: "string"
|
|
2583
|
+
}
|
|
2584
|
+
},
|
|
2585
|
+
default: {}
|
|
2586
|
+
},
|
|
2587
|
+
text: {
|
|
2588
|
+
description: "按钮",
|
|
2589
|
+
type: "string",
|
|
2590
|
+
default: "按钮"
|
|
2591
|
+
},
|
|
2592
|
+
icon: {
|
|
2593
|
+
description: "图标",
|
|
2594
|
+
type: "string",
|
|
2595
|
+
default: ""
|
|
2596
|
+
},
|
|
2597
|
+
onClick: {
|
|
2598
|
+
description: "点击事件",
|
|
2599
|
+
type: "string",
|
|
2600
|
+
default: ""
|
|
2601
|
+
}
|
|
2602
|
+
}, en = [
|
|
2603
|
+
"id",
|
|
2604
|
+
"type",
|
|
2605
|
+
"text"
|
|
2606
|
+
], tn = {
|
|
2607
|
+
$schema: Qt,
|
|
2608
|
+
$id: Zt,
|
|
2609
|
+
title: Jt,
|
|
2610
|
+
description: Xt,
|
|
2611
|
+
type: Yt,
|
|
2612
|
+
properties: Kt,
|
|
2613
|
+
required: en
|
|
2614
|
+
}, nn = {
|
|
2615
|
+
text: { type: String, default: "" },
|
|
2616
|
+
icon: { type: String, default: "" }
|
|
2617
|
+
}, on = ee(nn, tn);
|
|
2618
|
+
Y.register = (n, e, t, s) => {
|
|
2619
|
+
n.section = Y, e.section = he;
|
|
930
2620
|
};
|
|
931
|
-
|
|
932
|
-
n.section =
|
|
2621
|
+
Y.registerDesigner = (n, e, t) => {
|
|
2622
|
+
n.section = Gt, e.section = he, e["section-toolbar-item"] = on;
|
|
933
2623
|
};
|
|
934
|
-
const
|
|
2624
|
+
const pn = $e(Y);
|
|
935
2625
|
export {
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
2626
|
+
Y as Section,
|
|
2627
|
+
pn as default,
|
|
2628
|
+
he as propsResolver,
|
|
2629
|
+
se as sectionProps
|
|
940
2630
|
};
|