@farris/ui-vue 1.3.3 → 1.3.4

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.
Files changed (66) hide show
  1. package/components/binding-selector/index.esm.js +15 -15
  2. package/components/binding-selector/index.umd.cjs +1 -1
  3. package/components/condition/index.esm.js +107 -106
  4. package/components/condition/index.umd.cjs +1 -1
  5. package/components/data-grid/index.esm.js +1078 -1077
  6. package/components/data-grid/index.umd.cjs +1 -1
  7. package/components/data-view/index.esm.js +1272 -1272
  8. package/components/data-view/index.umd.cjs +1 -1
  9. package/components/designer-canvas/index.esm.js +4355 -3954
  10. package/components/designer-canvas/index.umd.cjs +1 -1
  11. package/components/dynamic-form/index.esm.js +601 -593
  12. package/components/dynamic-form/index.umd.cjs +1 -1
  13. package/components/event-parameter/index.esm.js +161 -117
  14. package/components/event-parameter/index.umd.cjs +1 -1
  15. package/components/events-editor/index.css +1 -1
  16. package/components/events-editor/index.esm.js +594 -575
  17. package/components/events-editor/index.umd.cjs +1 -1
  18. package/components/external-container/index.esm.js +771 -771
  19. package/components/external-container/index.umd.cjs +1 -1
  20. package/components/field-selector/index.esm.js +1268 -1268
  21. package/components/field-selector/index.umd.cjs +1 -1
  22. package/components/filter-bar/index.css +1 -1
  23. package/components/filter-bar/index.esm.js +3768 -3700
  24. package/components/filter-bar/index.umd.cjs +1 -1
  25. package/components/flow-canvas/index.esm.js +4274 -3873
  26. package/components/flow-canvas/index.umd.cjs +1 -1
  27. package/components/list-view/index.esm.js +935 -935
  28. package/components/list-view/index.umd.cjs +1 -1
  29. package/components/lookup/index.esm.js +1672 -1671
  30. package/components/lookup/index.umd.cjs +1 -1
  31. package/components/mapping-editor/index.esm.js +1107 -1106
  32. package/components/mapping-editor/index.umd.cjs +1 -1
  33. package/components/property-panel/index.css +1 -1
  34. package/components/query-solution/index.css +1 -1
  35. package/components/query-solution/index.esm.js +5721 -5490
  36. package/components/query-solution/index.umd.cjs +6 -6
  37. package/components/schema-selector/index.esm.js +974 -972
  38. package/components/schema-selector/index.umd.cjs +2 -2
  39. package/components/section/index.esm.js +2107 -417
  40. package/components/section/index.umd.cjs +1 -1
  41. package/components/tabs/index.esm.js +577 -575
  42. package/components/tabs/index.umd.cjs +1 -1
  43. package/components/textarea/index.esm.js +84 -79
  44. package/components/textarea/index.umd.cjs +1 -1
  45. package/components/tree-grid/index.esm.js +1554 -1554
  46. package/components/tree-grid/index.umd.cjs +1 -1
  47. package/components/tree-view/index.esm.js +1269 -1269
  48. package/components/tree-view/index.umd.cjs +1 -1
  49. package/farris.all.esm.js +17526 -17071
  50. package/farris.all.umd.cjs +13 -13
  51. package/index.css +1 -1
  52. package/package.json +1 -1
  53. package/types/dynamic-form/src/designer/form-group-use-designer-rules.d.ts +1 -2
  54. package/types/entity-binding-selector/composition/use-entity-tree.d.ts +14 -3
  55. package/types/entity-binding-selector/composition/use-field-tree.d.ts +28 -0
  56. package/types/event-parameter/src/composition/use-general-editor.d.ts +26 -0
  57. package/types/event-parameter/src/event-parameter.props.d.ts +4 -4
  58. package/types/events-editor/src/composition/types.d.ts +1 -1
  59. package/types/query-solution/src/composition/types.d.ts +55 -0
  60. package/types/query-solution/src/composition/use-condition.d.ts +19 -0
  61. package/types/query-solution/src/designer/query-solution-config/composition/types.d.ts +3 -2
  62. package/types/query-solution/src/designer/query-solution-config/converter/query-solution-config-property.converter.d.ts +4 -0
  63. package/types/section/index.d.ts +15 -0
  64. package/types/section/src/designer/section-header.design.component.d.ts +4 -0
  65. package/types/section/src/designer/section-toolbar-item.props.d.ts +19 -0
  66. package/types/section/src/designer/section-toolbar.design.component.d.ts +3 -0
@@ -1,104 +1,108 @@
1
- import { ref as C, computed as b, createVNode as v, defineComponent as z, watch as _, onMounted as V, inject as O } from "vue";
2
- import { isPlainObject as N, cloneDeep as U } from "lodash-es";
3
- import Q from "../response-toolbar/index.esm.js";
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 { withInstall as Z } from "../common/index.esm.js";
6
- const q = {}, R = {};
7
- function j(n) {
8
- const { properties: e, title: t, ignore: a } = n, i = a && Array.isArray(a), r = Object.keys(e).reduce((o, f) => ((!i || !a.find((p) => p === f)) && (o[f] = e[f].type === "object" && e[f].properties ? j(e[f]) : U(e[f].default)), o), {});
9
- if (t && (!i || !a.find((o) => o === "id"))) {
10
- const o = t.toLowerCase().replace(/-/g, "_");
11
- r.id = `${o}_${Math.random().toString().slice(2, 6)}`;
12
- }
13
- return r;
14
- }
15
- function $(n, e = {}, t) {
16
- const a = q[n];
17
- if (a) {
18
- let i = j(a);
19
- const r = R[n];
20
- return i = r ? r({ getSchemaByType: $ }, i, e, t) : i, i;
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 J(n, e) {
25
- const t = j(e);
26
- return Object.keys(t).reduce((a, i) => (a[i] && N(a[i]) && N(n[i] || !n[i]) ? Object.assign(a[i], n[i] || {}) : a[i] = n[i], a), t), t;
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 X(n, e) {
29
- return Object.keys(n).filter((a) => n[a] != null).reduce((a, i) => {
30
- if (e.has(i)) {
31
- const r = e.get(i);
32
- if (typeof r == "string")
33
- a[r] = n[i];
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 o = r(i, n[i], n);
36
- Object.assign(a, o);
39
+ const i = a(r, n[r], n);
40
+ Object.assign(s, i);
37
41
  }
38
42
  } else
39
- a[i] = n[i];
40
- return a;
43
+ s[r] = n[r];
44
+ return s;
41
45
  }, {});
42
46
  }
43
- function Y(n, e, t = /* @__PURE__ */ new Map()) {
44
- const a = J(n, e);
45
- return X(a, t);
46
- }
47
- function x(n = {}) {
48
- function e(s, c, l, u) {
49
- if (typeof l == "number")
50
- return u[s].length === l;
51
- if (typeof l == "object") {
52
- const m = Object.keys(l)[0], y = l[m];
53
- if (m === "not")
54
- return Number(u[s].length) !== Number(y);
55
- if (m === "moreThan")
56
- return Number(u[s].length) >= Number(y);
57
- if (m === "lessThan")
58
- return Number(u[s].length) <= Number(y);
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(s, c, l, u) {
63
- return u[s] && u[s].propertyValue && String(u[s].propertyValue.value) === String(l);
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 a = /* @__PURE__ */ new Map([
69
+ const s = /* @__PURE__ */ new Map([
66
70
  ["length", e],
67
71
  ["getProperty", t]
68
72
  ]);
69
- Object.keys(n).reduce((s, c) => (s.set(c, n[c]), s), a);
70
- function i(s, c) {
71
- const l = s;
72
- return typeof c == "number" ? [{ target: l, operator: "length", param: null, value: Number(c) }] : typeof c == "boolean" ? [{ target: l, operator: "getProperty", param: s, value: !!c }] : typeof c == "object" ? Object.keys(c).map((u) => {
73
- if (u === "length")
74
- return { target: l, operator: "length", param: null, value: c[u] };
75
- const m = u, y = c[u];
76
- return { target: l, operator: "getProperty", param: m, value: y };
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 r(s) {
80
- return Object.keys(s).reduce((l, u) => {
81
- const m = i(u, s[u]);
82
- return l.push(...m), l;
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 o(s, c) {
86
- if (a.has(s.operator)) {
87
- const l = a.get(s.operator);
88
- return l && l(s.target, s.param, s.value, c) || !1;
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 f(s, c) {
93
- return r(s).reduce((m, y) => m && o(y, c), !0);
96
+ function g(u, h) {
97
+ return a(u).reduce((y, M) => y && i(M, h), !0);
94
98
  }
95
- function p(s, c) {
96
- const l = Object.keys(s), u = l.includes("allOf"), m = l.includes("anyOf"), y = u || m, M = (y ? s[y ? u ? "allOf" : "anyOf" : "allOf"] : [s]).map((S) => f(S, c));
97
- return u ? !M.includes(!1) : M.includes(!0);
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: p };
103
+ return { parseValueSchema: f };
100
104
  }
101
- const P = {
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
- }, K = {}, I = {};
142
- x();
143
- function ee(n, e, t = /* @__PURE__ */ new Map(), a = (o, f, p, s) => f, i = {}, r = (o) => o) {
144
- return q[e.title] = e, R[e.title] = a, K[e.title] = i, I[e.title] = r, (o = {}) => {
145
- const f = Y(o, e, t), p = Object.keys(n).reduce((s, c) => (s[c] = n[c].default, s), {});
146
- return Object.assign(p, f);
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 te(n, e) {
153
+ function me(n, e) {
150
154
  return { customClass: e.class, customStyle: e.style };
151
155
  }
152
- function ne(n, e, t) {
156
+ function _e(n, e, t) {
153
157
  return e ? { enableAccordion: t.accordionMode } : { enableAccordion: "" };
154
158
  }
155
- function oe(n, e) {
159
+ function qe(n, e) {
156
160
  return {
157
161
  buttons: e.buttons,
158
162
  buttonPosition: e.position
159
163
  };
160
164
  }
161
- const ae = /* @__PURE__ */ new Map([
162
- ["appearance", te],
165
+ const ze = /* @__PURE__ */ new Map([
166
+ ["appearance", me],
163
167
  ["expanded", "expandStatus"],
164
- ["enableAccordion", ne],
165
- ["toolbar", oe]
168
+ ["enableAccordion", _e],
169
+ ["toolbar", qe]
166
170
  ]);
167
- function re(n, e, t) {
168
- const a = Math.random().toString().slice(2, 6), i = t.parentComponentInstance;
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-${a}`,
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 r = n.getSchemaByType("content-container");
178
- Object.assign(r, {
179
- id: `container-${a}`,
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 o = i.schema;
186
- switch (o && o.type) {
187
- case P["splitter-pane"].type: {
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
- return r;
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 ie(n, e, t) {
195
- return t.parentComponentInstance ? re(n, e, t) : e;
199
+ function He(n, e, t) {
200
+ return t.parentComponentInstance ? Ue(n, e, t) : e;
196
201
  }
197
- const se = "https://json-schema.org/draft/2020-12/schema", ce = "https://farris-design.gitee.io/section.schema.json", le = "section", ue = "A Farris Container Component", pe = "object", fe = {
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: "SectionToolbar"
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
- }, de = [
327
+ }, Ye = [
323
328
  "id",
324
329
  "type",
325
330
  "contents"
326
- ], me = {
327
- $schema: se,
328
- $id: ce,
329
- title: le,
330
- description: ue,
331
- type: pe,
332
- properties: fe,
333
- required: de
334
- }, B = {
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
- }, H = ee(B, me, ae, ie);
380
- function ye(n, e, t) {
381
- let a;
382
- function i(p = 1) {
383
- const s = [
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
- ], c = Array.from(document.body.querySelectorAll(s.join(","))).filter((u) => u).map((u) => {
394
- const { display: m, zIndex: y } = window.getComputedStyle(u);
395
- return m === "none" ? 0 : parseInt(y, 10);
396
- }).filter((u) => u);
397
- let l = Math.max(...c);
398
- return l < 1040 && (l = 1040), l + p;
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 r() {
401
- a = n.value.nextElementSibling;
402
- const p = document && document.querySelector("body");
403
- p && (p.appendChild(n.value), n.value.style.zIndex = i());
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 o() {
406
- a ? e.value.insertBefore(
410
+ function i() {
411
+ s ? e.value.insertBefore(
407
412
  n.value,
408
- a
413
+ s
409
414
  ) : e.value.appendChild(n.value), n.value.style.zIndex = null;
410
415
  }
411
- function f() {
412
- !n || !e.value || (t.value = !t.value, t.value ? r() : o());
416
+ function g() {
417
+ !n || !e.value || (t.value = !t.value, t.value ? a() : i());
413
418
  }
414
- return { onClickMaxMinIcon: f };
419
+ return { onClickMaxMinIcon: g };
415
420
  }
416
- function F(n, e) {
417
- const t = C(n.buttons), a = b(() => n.buttonPosition === "inHead" ? "right" : "left"), i = b(() => "f-section-toolbar" + (n.buttonPosition === "inHead" ? " f-section-header--toolbar" : " f-section-content--toolbar")), r = b(() => n.buttons && n.buttons.length > 0 && n.buttonPosition === "inHead");
418
- function o(f) {
419
- e.emit("Click", f);
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 () => r.value && v(Q, {
422
- customClass: i.value,
426
+ return () => a.value && m(Re, {
427
+ customClass: r.value,
423
428
  items: t.value,
424
- onClick: o,
425
- alignment: a.value
429
+ onClick: i,
430
+ alignment: s.value
426
431
  }, null);
427
432
  }
428
- function G(n, e, t, a, i, r) {
429
- C(n.subTitle);
430
- const o = b(() => n.buttonPosition), f = F(n, e), {
431
- onClickMaxMinIcon: p
432
- } = ye(a, i, r), s = b(() => !!n.subTitle), c = b(() => n.enableMaximize), l = b(() => n.enableAccordion !== ""), u = b(() => {
433
- const S = {
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((d, h) => (d[h] = !0, d), S), S;
441
+ return e.slots.header && n.headerClass.split(" ").reduce((v, S) => (v[S] = !0, v), x), x;
437
442
  });
438
- function m(S) {
439
- S.stopPropagation(), n.enableAccordion !== "" && (t.value = !t.value);
443
+ function y(x) {
444
+ x.stopPropagation(), n.enableAccordion !== "" && (t.value = !t.value);
440
445
  }
441
- function y() {
442
- const S = b(() => ({
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
- })), D = b(() => ({
452
+ })), B = A(() => ({
448
453
  "f-icon": !0,
449
- "f-icon-maximize": !r.value,
450
- "f-icon-minimize": r.value
454
+ "f-icon-maximize": !a.value,
455
+ "f-icon-minimize": a.value
451
456
  }));
452
- return v("div", {
457
+ return m("div", {
453
458
  class: "f-max-accordion"
454
- }, [c.value ? v("span", {
455
- class: D.value,
456
- onClick: p
457
- }, null) : "", l.value ? v("button", {
458
- class: S.value,
459
- onClick: m
460
- }, [v("span", null, [t.value ? n.collapseLabel : n.expandLabel])]) : ""]);
461
- }
462
- function w() {
463
- return e.slots.header ? v("div", {
464
- class: u.value
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 g() {
468
- return v("div", {
472
+ function I() {
473
+ return m("div", {
469
474
  class: "f-title",
470
- onClick: m
471
- }, [v("h4", {
475
+ onClick: y
476
+ }, [m("h4", {
472
477
  class: "f-title-text"
473
- }, [n.mainTitle]), s.value && v("span", null, [n.subTitle])]);
478
+ }, [n.mainTitle]), u.value && m("span", null, [n.subTitle])]);
474
479
  }
475
- function M() {
476
- const S = b(() => {
477
- const D = {
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((h, T) => (h[T] = !0, h), D), D;
485
+ return n.headerContentClass && n.headerContentClass.split(" ").reduce((S, D) => (S[D] = !0, S), B), B;
481
486
  });
482
- return e.slots.headerContent ? v("div", {
483
- class: S.value
487
+ return e.slots.headerContent ? m("div", {
488
+ class: x.value
484
489
  }, [e.slots.headerContent()]) : "";
485
490
  }
486
- function A() {
487
- return v("div", {
488
- class: u.value
489
- }, [e.slots.headerTitle ? e.slots.headerTitle() : g(), M(), o.value === "inHead" && f(), (c.value || l.value) && y()]);
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 ? w() : A());
496
+ return () => n.showHeader && (e.slots.header ? k() : L());
492
497
  }
493
- const be = ["moz", "ms", "webkit"];
494
- function he() {
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(), a = Math.max(0, 16 - (t - n)), i = setTimeout(() => {
498
- e(t + a);
499
- }, a);
500
- return n = t + a, i;
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 ve() {
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 = be.filter((e) => `${e}RequestAnimationFrame` in window)[0];
509
- return n ? window[`${n}RequestAnimationFrame`] : he();
513
+ const n = tt.filter((e) => `${e}RequestAnimationFrame` in window)[0];
514
+ return n ? window[`${n}RequestAnimationFrame`] : nt();
510
515
  }
511
- ve();
512
- function L(n, e) {
513
- return ((e == null ? void 0 : e.split(" ")) || []).reduce((a, i) => (i && (a[i] = !0), a), n), n;
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 E = /* @__PURE__ */ z({
520
+ const Y = /* @__PURE__ */ Z({
516
521
  name: "FSection",
517
- props: B,
522
+ props: se,
518
523
  emits: [],
519
524
  setup(n, e) {
520
- const t = C(), a = C(), i = C(n.customClass), r = b(() => n.enableAccordion), o = C(n.expandStatus), f = b(() => n.buttonPosition), p = C(!1), s = G(n, e, o, t, a, p), c = F(n, e), l = b(() => {
521
- const g = {
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": r.value === "default",
524
- "f-state-collapse": (r.value === "default" || r.value === "custom") && !o.value,
525
- "f-section-custom-accordion": r.value === "custom",
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": p.value
532
+ "f-section-maximize": f.value
528
533
  };
529
- return L(g, i.value);
530
- }), u = b(() => L({
534
+ return H(I, r.value);
535
+ }), b = A(() => H({
531
536
  "f-section-content": !0
532
- }, n.contentClass)), m = b(() => L({
537
+ }, n.contentClass)), y = A(() => H({
533
538
  "f-section-extend": !0
534
- }, m.value));
535
- function y() {
536
- return e.slots.extend && v("div", {
537
- class: m.value
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 w() {
541
- return v("div", {
542
- class: u.value
543
- }, [f.value === "inContent" && c(), e.slots.default && e.slots.default()]);
544
- }
545
- return _(() => n.expandStatus, (g, M) => {
546
- g !== M && (o.value = g);
547
- }), V(() => {
548
- t.value && t.value && (a.value = t.value.parentElement);
549
- }), () => v("div", {
550
- class: l.value,
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
- }, [s(), y(), w()]);
558
+ }, [u(), M(), k()]);
554
559
  }
555
560
  });
556
- function Ce() {
561
+ function st() {
557
562
  function n(e, t) {
558
- var o;
563
+ var i;
559
564
  if (!e)
560
565
  return !1;
561
- const a = ((o = e.targetContainer) == null ? void 0 : o.componentInstance) && e.targetContainer.componentInstance.value;
562
- if (!a)
566
+ const s = ((i = e.targetContainer) == null ? void 0 : i.componentInstance) && e.targetContainer.componentInstance.value;
567
+ if (!s)
563
568
  return !1;
564
- const i = a.schema.type, r = t == null ? void 0 : t.formSchemaUtils.getComponentById(a.belongedComponentId);
565
- return !((e.componentCategory === "input" || e.componentType === "form-group") && ![P["response-layout-item"].type, P["response-form"].type].includes(i) || (e.componentType === P.tabs.type || e.componentType === P.section.type) && ((r == null ? void 0 : r.componentType) !== "frame" || ![P["content-container"].type, P["splitter-pane"].type, P["response-layout-item"].type].includes(i)));
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 ge = {
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 Te {
679
+ class it {
675
680
  getTemplateRule(e, t) {
676
- const a = t == null ? void 0 : t.formSchemaUtils, i = a == null ? void 0 : a.getFormTemplateRule(), r = { canAccept: !0, canDelete: !0, canMove: !0 };
677
- if (!i)
678
- return r;
679
- const o = this.getComponentContext(e), { componentClassList: f } = o;
680
- return f.forEach((p) => {
681
- if (!p || !i[p])
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: s, canDelete: c, canAccept: l } = i[p];
684
- r.canMove = r.canMove && this.resolveRuleValue(s, o), r.canDelete = r.canDelete && this.resolveRuleValue(c, o), r.canAccept = r.canAccept && this.resolveRuleValue(l, o);
685
- }), r;
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 a = e.invalidContext || [];
692
- let i = !0;
693
- for (const r of a) {
694
- if (r.firstLevelChild) {
695
- if (r.firstLevelChild.class) {
696
- const { firstLevelChildClassList: o } = t;
697
- if (o && !o.includes(r.firstLevelChild.class)) {
698
- i = !1;
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 (r.firstLevelChild.type) {
703
- const { firstLevelChildSchema: o } = t;
704
- if (!o || o.type !== r.firstLevelChild.type) {
705
- i = !1;
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 (r.secondLevelChild) {
711
- if (r.secondLevelChild.class) {
712
- const { secondLevelChildClassList: o } = t;
713
- if (o && !o.includes(r.secondLevelChild.class)) {
714
- i = !1;
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 (r.secondLevelChild.type) {
719
- const { secondLevelChildSchema: o } = t;
720
- if (!o || o.type !== r.secondLevelChild.type) {
721
- i = !1;
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 (r.parent) {
727
- if (r.parent.class) {
728
- const { parentClassList: o } = t;
729
- if (o && !o.includes(r.parent.class)) {
730
- i = !1;
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 (r.parent.type) {
735
- const { parentSchema: o } = t;
736
- if (o && o.type !== r.parent.type) {
737
- i = !1;
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
- i = !0;
747
+ r = !0;
743
748
  break;
744
749
  }
745
- return !i;
750
+ return !r;
746
751
  }
747
752
  getComponentContext(e) {
748
- var w, g, M, A;
749
- const t = e.schema, a = t.appearance && t.appearance.class || "", i = a.split(" ") || [], r = t.contents || [], o = r.length ? r[0] : null, f = o && o.appearance ? o.appearance.class : "", p = f ? f.split(" ") : [], s = (w = o == null ? void 0 : o.contents) != null && w.length ? o == null ? void 0 : o.contents[0] : null, c = s && s.appearance ? s.appearance.class : "", l = c ? c.split(" ") : [], u = t.type === "component" ? (M = (g = e.parent) == null ? void 0 : g.parent) == null ? void 0 : M.schema : (A = e.parent) == null ? void 0 : A.schema, m = u && u.appearance && u.appearance.class || "", y = m ? m.split(" ") : [];
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: a,
752
- componentClassList: i,
753
- childContents: r,
754
- firstLevelChildSchema: o,
755
- firstLevelChildClass: f,
756
- firstLevelChildClassList: p,
757
- secondLevelChildSchema: s,
758
- secondLevelChildClass: c,
759
- secondLevelChildClassList: l,
760
- parentSchema: u,
761
- parentClass: m,
762
- parentClassList: y
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 Se(n, e) {
767
- const t = new Te();
768
- function a(p) {
769
- return ge;
771
+ function at(n, e) {
772
+ const t = new it();
773
+ function s(f) {
774
+ return rt;
770
775
  }
771
- function i(p) {
772
- if (!Ce().basalDragulaRuleForContainer(p, e))
776
+ function r(f) {
777
+ if (!st().basalDragulaRuleForContainer(f, e))
773
778
  return !1;
774
- const { canAccept: c } = t.getTemplateRule(n, e);
775
- return c;
779
+ const { canAccept: h } = t.getTemplateRule(n, e);
780
+ return h;
776
781
  }
777
- function r() {
778
- const { canDelete: p } = t.getTemplateRule(n, e);
779
- return p;
782
+ function a() {
783
+ const { canDelete: f } = t.getTemplateRule(n, e);
784
+ return f;
780
785
  }
781
- function o() {
782
- const { canMove: p } = t.getTemplateRule(n, e);
783
- return p;
786
+ function i() {
787
+ const { canMove: f } = t.getTemplateRule(n, e);
788
+ return f;
784
789
  }
785
- function f() {
786
- const { canMove: p, canDelete: s } = t.getTemplateRule(n, e);
787
- return !p && !s;
790
+ function g() {
791
+ const { canMove: f, canDelete: u } = t.getTemplateRule(n, e);
792
+ return !f && !u;
788
793
  }
789
794
  return {
790
- canAccepts: i,
791
- checkCanDeleteComponent: r,
792
- checkCanMoveComponent: o,
793
- hideNestedPaddingInDesginerView: f,
794
- getPropsConfig: a
795
+ canAccepts: r,
796
+ checkCanDeleteComponent: a,
797
+ checkCanMoveComponent: i,
798
+ hideNestedPaddingInDesginerView: g,
799
+ getPropsConfig: s
795
800
  };
796
801
  }
797
- function Me(n, e, t) {
798
- var D;
799
- const a = t && t.getStyles && t.getStyles() || "", i = t && t.getDesignerClass && t.getDesignerClass() || "", r = C();
800
- function o() {
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 f() {
808
+ function g() {
804
809
  return !1;
805
810
  }
806
- function p() {
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 s() {
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 c(d) {
813
- if (!d || !d.value)
817
+ function h(v) {
818
+ if (!v || !v.value)
814
819
  return null;
815
- if (d.value.schema && d.value.schema.type === "component")
816
- return d.value;
817
- const h = C(d == null ? void 0 : d.value.parent), T = c(h);
818
- return T || null;
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 l(d = e) {
821
- const { componentInstance: h, designerItemElementRef: T } = d;
822
- return !h || !h.value ? null : h.value.canMove ? T : l(d.parent);
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 u(d) {
825
- return !!t && t.canAccepts(d);
829
+ function b(v) {
830
+ return !!t && t.canAccepts(v);
826
831
  }
827
- function m() {
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 y() {
835
+ function M() {
831
836
  }
832
- function w(d, h) {
833
- h && t != null && t.onAcceptMovedChildElement && t.onAcceptMovedChildElement(h);
837
+ function k(v, S) {
838
+ S && t != null && t.onAcceptMovedChildElement && t.onAcceptMovedChildElement(S);
834
839
  }
835
- function g(d, h) {
836
- const { componentType: T } = d;
837
- let k = $(T, d, h);
838
- t && t.onResolveNewComponentSchema && (k = t.onResolveNewComponentSchema(d, k));
839
- const W = T.toLowerCase().replace(/-/g, "_");
840
- return k && !k.id && k.type === T && (k.id = `${W}_${Math.random().toString().slice(2, 6)}`), k;
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 M(d) {
847
+ function R(v) {
843
848
  }
844
- function A(...d) {
849
+ function L(...v) {
845
850
  if (t && t.getPropsConfig)
846
- return t.getPropsConfig(...d);
847
- }
848
- function S() {
849
- t && t.onRemoveComponent && t.onRemoveComponent(), e != null && e.schema.contents && e.schema.contents.map((d) => {
850
- var k;
851
- let h = d.id;
852
- d.type === "component-ref" && (h = d.component);
853
- const T = n.value.querySelector(`#${h}-design-item`);
854
- (k = T == null ? void 0 : T.componentInstance) != null && k.value.onRemoveComponent && T.componentInstance.value.onRemoveComponent();
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 r.value = {
858
- canMove: o(),
859
- canSelectParent: f(),
860
- canDelete: p(),
861
- canNested: !s(),
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: (D = e == null ? void 0 : e.parent) == null ? void 0 : D.componentInstance,
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: a,
867
- designerClass: i,
868
- canAccepts: u,
869
- getBelongedComponentInstance: c,
870
- getDraggableDesignItemElement: l,
871
- getDraggingDisplayText: m,
872
- getPropConfig: A,
873
- getDragScopeElement: y,
874
- onAcceptMovedChildElement: w,
875
- onChildElementMovedOut: M,
876
- addNewChildComponentSchema: g,
877
- triggerBelongedComponentToMoveWhenMoved: !!t && t.triggerBelongedComponentToMoveWhenMoved || C(!1),
878
- triggerBelongedComponentToDeleteWhenDeleted: !!t && t.triggerBelongedComponentToDeleteWhenDeleted || C(!1),
879
- onRemoveComponent: S
880
- }, r;
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 we = /* @__PURE__ */ z({
883
- name: "FSectionDesign",
884
- props: B,
885
- emits: [],
886
- setup(n, e) {
887
- const t = C(), a = C(), i = C(), r = O("designer-host-service"), o = O("design-item-context"), f = Se(o, r), p = Me(t, o, f);
888
- p.value.styles = "display: inherit;", V(() => {
889
- t.value.componentInstance = p;
890
- }), e.expose(p.value);
891
- const s = C(n.customClass), c = b(() => n.enableAccordion), l = C(n.expandStatus), u = b(() => n.buttonPosition), m = C(!1), y = G(n, e, l, a, i, m), w = F(n, e), g = b(() => {
892
- const d = {
893
- "f-section": !0,
894
- "f-section-accordion": c.value === "default",
895
- "f-state-collapse": (c.value === "default" || c.value === "custom") && !l.value,
896
- "f-section-custom-accordion": c.value === "custom",
897
- "f-section-fill": n.fill,
898
- "f-section-maximize": m.value,
899
- "f-utils-fill": !0,
900
- "p-0": !0
901
- };
902
- return L(d, s.value);
903
- }), M = b(() => L({
904
- "f-section-content": !0,
905
- "drag-container": !0
906
- }, n.contentClass)), A = b(() => L({
907
- "f-section-extend": !0
908
- }, A.value));
909
- function S() {
910
- return e.slots.extend && v("div", {
911
- class: A.value
912
- }, [e.slots.extend()]);
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
- function D() {
915
- return v("div", {
916
- class: M.value,
917
- ref: t,
918
- "data-dragref": `${o.schema.id}-container`
919
- }, [u.value === "inContent" && w(), e.slots.default && e.slots.default()]);
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
- return () => v("div", {
922
- class: g.value,
923
- ref: a,
924
- style: n.customStyle
925
- }, [y(), S(), D()]);
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
- E.register = (n, e, t, a) => {
929
- n.section = E, e.section = H;
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
- E.registerDesigner = (n, e, t) => {
932
- n.section = we, e.section = H;
2621
+ Y.registerDesigner = (n, e, t) => {
2622
+ n.section = Gt, e.section = he, e["section-toolbar-item"] = on;
933
2623
  };
934
- const Ee = Z(E);
2624
+ const pn = $e(Y);
935
2625
  export {
936
- E as Section,
937
- Ee as default,
938
- H as propsResolver,
939
- B as sectionProps
2626
+ Y as Section,
2627
+ pn as default,
2628
+ he as propsResolver,
2629
+ se as sectionProps
940
2630
  };