@farris/ui-vue 1.5.7 → 1.5.9

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 (128) hide show
  1. package/components/avatar/index.esm.js +5 -5
  2. package/components/avatar/index.umd.cjs +1 -1
  3. package/components/component/index.esm.js +5 -5
  4. package/components/component/index.umd.cjs +1 -1
  5. package/components/condition/index.esm.js +5 -5
  6. package/components/condition/index.umd.cjs +1 -1
  7. package/components/content-container/index.esm.js +5 -5
  8. package/components/content-container/index.umd.cjs +1 -1
  9. package/components/date-picker/index.esm.js +1082 -1421
  10. package/components/date-picker/index.umd.cjs +1 -1
  11. package/components/designer-canvas/index.esm.js +908 -897
  12. package/components/designer-canvas/index.umd.cjs +1 -1
  13. package/components/dynamic-form/index.esm.js +5 -5
  14. package/components/dynamic-form/index.umd.cjs +1 -1
  15. package/components/dynamic-view/index.esm.js +5 -5
  16. package/components/dynamic-view/index.umd.cjs +1 -1
  17. package/components/events-editor/index.esm.js +5 -5
  18. package/components/events-editor/index.umd.cjs +1 -1
  19. package/components/filter-bar/index.esm.js +13 -12
  20. package/components/filter-bar/index.umd.cjs +1 -1
  21. package/components/flow-canvas/index.esm.js +5 -5
  22. package/components/flow-canvas/index.umd.cjs +1 -1
  23. package/components/number-range/index.esm.js +5 -5
  24. package/components/number-range/index.umd.cjs +1 -1
  25. package/components/number-spinner/index.esm.js +5 -5
  26. package/components/number-spinner/index.umd.cjs +1 -1
  27. package/components/page-header/index.esm.js +862 -3625
  28. package/components/page-header/index.umd.cjs +1 -1
  29. package/components/property-panel/index.esm.js +5 -5
  30. package/components/property-panel/index.umd.cjs +1 -1
  31. package/components/query-solution/index.esm.js +77 -76
  32. package/components/query-solution/index.umd.cjs +6 -6
  33. package/components/response-layout/index.esm.js +5 -5
  34. package/components/response-layout/index.umd.cjs +1 -1
  35. package/components/response-toolbar/index.esm.js +500 -3662
  36. package/components/response-toolbar/index.umd.cjs +1 -1
  37. package/components/schema-selector/index.esm.js +3008 -7347
  38. package/components/schema-selector/index.umd.cjs +6 -6
  39. package/components/section/index.esm.js +117 -7544
  40. package/components/section/index.umd.cjs +1 -1
  41. package/components/tabs/index.esm.js +545 -4943
  42. package/components/tabs/index.umd.cjs +1 -1
  43. package/components/textarea/index.esm.js +100 -5841
  44. package/components/textarea/index.umd.cjs +2 -2
  45. package/components/time-picker/index.esm.js +5 -5
  46. package/components/time-picker/index.umd.cjs +1 -1
  47. package/components/video/index.esm.js +5 -5
  48. package/components/video/index.umd.cjs +1 -1
  49. package/designer/button-edit/index.css +1 -0
  50. package/designer/button-edit/index.esm.js +1556 -0
  51. package/designer/button-edit/index.umd.cjs +1 -0
  52. package/designer/checkbox/index.esm.js +207 -0
  53. package/designer/checkbox/index.umd.cjs +1 -0
  54. package/designer/checkbox-group/index.esm.js +377 -0
  55. package/designer/checkbox-group/index.umd.cjs +1 -0
  56. package/designer/data-grid/index.css +1 -0
  57. package/designer/data-grid/index.esm.js +14332 -0
  58. package/designer/data-grid/index.umd.cjs +20 -0
  59. package/designer/data-view/index.esm.js +271 -0
  60. package/designer/data-view/index.umd.cjs +1 -0
  61. package/designer/date-picker/index.esm.js +1879 -0
  62. package/designer/date-picker/index.umd.cjs +1 -0
  63. package/designer/drawer/index.css +1 -0
  64. package/designer/drawer/index.esm.js +463 -0
  65. package/designer/drawer/index.umd.cjs +1 -0
  66. package/designer/farris-designer.all.esm.js +16827 -0
  67. package/designer/farris-designer.all.umd.cjs +32 -0
  68. package/designer/index.css +1 -0
  69. package/designer/input-group/index.esm.js +647 -0
  70. package/designer/input-group/index.umd.cjs +1 -0
  71. package/designer/radio-group/index.esm.js +6959 -0
  72. package/designer/radio-group/index.umd.cjs +1 -0
  73. package/designer/response-toolbar/index.esm.js +3015 -0
  74. package/designer/response-toolbar/index.umd.cjs +1 -0
  75. package/designer/section/index.esm.js +744 -0
  76. package/designer/section/index.umd.cjs +1 -0
  77. package/designer/tabs/index.esm.js +2200 -0
  78. package/designer/tabs/index.umd.cjs +1 -0
  79. package/designer/textarea/index.esm.js +249 -0
  80. package/designer/textarea/index.umd.cjs +1 -0
  81. package/designer/tree-grid/index.css +1 -0
  82. package/designer/tree-grid/index.esm.js +1673 -0
  83. package/designer/tree-grid/index.umd.cjs +1 -0
  84. package/farris.all.esm.js +30447 -30444
  85. package/farris.all.umd.cjs +16 -16
  86. package/package.json +1 -1
  87. package/types/date-picker/designer.d.ts +29 -0
  88. package/types/date-picker/index.d.ts +2 -1
  89. package/types/date-picker/src/date-picker.props.d.ts +0 -5
  90. package/types/date-picker/src/designer/date-picker.design.props.d.ts +22 -0
  91. package/types/designer-canvas/index.d.ts +2 -2
  92. package/types/response-toolbar/designer.d.ts +37 -0
  93. package/types/response-toolbar/index.d.ts +6 -5
  94. package/types/response-toolbar/src/composition/toolbar-item-dragula.d.ts +1 -2
  95. package/types/response-toolbar/src/composition/types.d.ts +1 -1
  96. package/types/response-toolbar/src/designer/response-toolbar.design.props.d.ts +13 -0
  97. package/types/response-toolbar/src/designer/use-designer-item-rules.d.ts +1 -2
  98. package/types/response-toolbar/src/designer/use-designer-rules.d.ts +1 -2
  99. package/types/response-toolbar/src/property-config/response-toolbar-item.property-config.d.ts +1 -1
  100. package/types/response-toolbar/src/property-config/response-toolbar.property-config.d.ts +1 -1
  101. package/types/response-toolbar/src/response-toolbar.props.d.ts +0 -12
  102. package/types/response-toolbar/src/schema/schema-resolver.d.ts +1 -1
  103. package/types/section/designer.d.ts +26 -0
  104. package/types/section/index.d.ts +1 -0
  105. package/types/section/src/designer/section-header.design.component.d.ts +2 -2
  106. package/types/section/src/designer/section-toolbar-item.design.props.d.ts +16 -0
  107. package/types/section/src/designer/section-toolbar-item.props.d.ts +0 -1
  108. package/types/section/src/designer/section-toolbar.design.component.d.ts +2 -2
  109. package/types/section/src/designer/section.design.props.d.ts +11 -0
  110. package/types/section/src/designer/use-designer-rules.d.ts +1 -2
  111. package/types/section/src/property-config/section.property-config.d.ts +1 -1
  112. package/types/section/src/schema/schema-resolver.d.ts +1 -1
  113. package/types/section/src/section.props.d.ts +0 -10
  114. package/types/tabs/designer.d.ts +28 -0
  115. package/types/tabs/index.d.ts +1 -0
  116. package/types/tabs/src/components/tab-page.props.d.ts +0 -1
  117. package/types/tabs/src/designer/tab-page.design.props.d.ts +1 -0
  118. package/types/tabs/src/designer/tabs.design.props.d.ts +12 -0
  119. package/types/tabs/src/tabs.props.d.ts +0 -11
  120. package/types/textarea/designer.d.ts +28 -0
  121. package/types/textarea/index.d.ts +0 -15
  122. package/types/textarea/src/designer/textarea.design.props.d.ts +6 -0
  123. package/types/textarea/src/designer/use-design-rules.d.ts +1 -2
  124. package/types/textarea/src/property-config/textarea.property-config.d.ts +1 -1
  125. package/types/textarea/src/schema/schema-resolver.d.ts +1 -1
  126. package/types/textarea/src/textarea.props.d.ts +0 -5
  127. package/components/textarea/index.css +0 -1
  128. /package/{components/section → designer/radio-group}/index.css +0 -0
@@ -1,47 +1,55 @@
1
- var Lt = Object.defineProperty;
2
- var qt = (o, t, e) => t in o ? Lt(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
3
- var U = (o, t, e) => qt(o, typeof t != "symbol" ? t + "" : t, e);
4
- import { computed as re, getCurrentInstance as Wt, createVNode as O, reactive as we, withDirectives as xe, resolveDirective as Te, ref as X, defineComponent as Ie, onMounted as Pe, onUnmounted as lt, watch as Se, nextTick as me, inject as ce, provide as at, onBeforeUnmount as Ut, withModifiers as Ht, createTextVNode as zt } from "vue";
5
- import { isPlainObject as nt, cloneDeep as he } from "lodash-es";
6
- import "bignumber.js";
7
- import { getCustomClass as pe, withInstall as Gt } from "../common/index.esm.js";
8
- import { useDesignerInnerComponent as Yt, useDesignerComponent as Xt } from "../designer-canvas/index.esm.js";
9
- import { BaseControlProperty as Qt } from "../property-panel/index.esm.js";
10
- class ct {
11
- constructor(t) {
1
+ var ln = Object.defineProperty;
2
+ var rn = (d, s, i) => s in d ? ln(d, s, { enumerable: !0, configurable: !0, writable: !0, value: i }) : d[s] = i;
3
+ var f = (d, s, i) => rn(d, typeof s != "symbol" ? s + "" : s, i);
4
+ import { getCustomClass as P, withInstall as dn } from "../common/index.esm.js";
5
+ import { computed as J, getCurrentInstance as cn, createVNode as u, reactive as X, withDirectives as Z, resolveDirective as I, ref as z, defineComponent as an, onMounted as un, onUnmounted as pn, watch as nn, nextTick as tn } from "vue";
6
+ const fn = {
7
+ id: { type: String, default: "" },
8
+ /** 组件自定义样式 */
9
+ customClass: { type: String, default: "" },
10
+ alignment: { Type: String, default: "right" },
11
+ items: {
12
+ Type: Array,
13
+ default: []
14
+ },
15
+ /** 控制是否可见 */
16
+ visible: { type: Boolean, default: !0 }
17
+ };
18
+ class sn {
19
+ constructor(s) {
12
20
  /** 工具栏项标识 */
13
- U(this, "id", "");
21
+ f(this, "id", "");
14
22
  /** 工具栏项自定义样式 */
15
- U(this, "class", "btn-secondary");
23
+ f(this, "class", "btn-secondary");
16
24
  /** 图标 */
17
- U(this, "icon", "");
25
+ f(this, "icon", "");
18
26
  /** 所属分组 */
19
- U(this, "groupId", "");
27
+ f(this, "groupId", "");
20
28
  /** 收藏顺序 */
21
- U(this, "order", -1);
29
+ f(this, "order", -1);
22
30
  /** 是否作为下拉菜单的顶层按钮 */
23
- U(this, "asDropDownTop", !1);
31
+ f(this, "asDropDownTop", !1);
24
32
  /** 文本 */
25
- U(this, "text", "");
33
+ f(this, "text", "");
26
34
  /** 是否可见原值 */
27
- U(this, "visible", !0);
35
+ f(this, "visible", !0);
28
36
  /** 控制界面是否显示 */
29
- U(this, "shown", !0);
30
- U(this, "responsed", !1);
37
+ f(this, "shown", !0);
38
+ f(this, "responsed", !1);
31
39
  /** 是否启用提示消息 */
32
- U(this, "tipsEnable", !1);
40
+ f(this, "tipsEnable", !1);
33
41
  /** 提示消息内容 */
34
- U(this, "tipsText", "");
42
+ f(this, "tipsText", "");
35
43
  /** 记录宽度 */
36
- U(this, "width", 0);
44
+ f(this, "width", 0);
37
45
  /** 下拉时的样式名 */
38
- U(this, "dropdownClass", "");
39
- U(this, "onClick", () => {
46
+ f(this, "dropdownClass", "");
47
+ f(this, "onClick", () => {
40
48
  });
41
- U(this, "options");
42
- var n, r;
43
- this.options = t;
44
- const e = [
49
+ f(this, "options");
50
+ var b, p;
51
+ this.options = s;
52
+ const i = [
45
53
  "id",
46
54
  "class",
47
55
  "icon",
@@ -58,3807 +66,637 @@ class ct {
58
66
  "dropdownClass",
59
67
  "onClick"
60
68
  ];
61
- Object.keys(t).filter((i) => e.indexOf(i) > -1).forEach((i) => {
62
- i === "visible" ? this[i] = t[i] === void 0 ? !0 : t[i] : this[i] = t[i];
63
- }), this.shown = this.visible, (n = t.appearance) != null && n.class && (this.class = (r = t.appearance) == null ? void 0 : r.class);
69
+ Object.keys(s).filter((g) => i.indexOf(g) > -1).forEach((g) => {
70
+ g === "visible" ? this[g] = s[g] === void 0 ? !0 : s[g] : this[g] = s[g];
71
+ }), this.shown = this.visible, (b = s.appearance) != null && b.class && (this.class = (p = s.appearance) == null ? void 0 : p.class);
64
72
  }
65
73
  /** 是否可用 */
66
74
  get enable() {
67
- return Object.keys(this.options).indexOf("disabled") > -1 ? !this.options.disabled : re(() => !0);
75
+ return Object.keys(this.options).indexOf("disabled") > -1 ? !this.options.disabled : J(() => !0);
68
76
  }
69
77
  /** 设置宽度 */
70
- setWidth(t) {
71
- this.width = parseInt(t, 10);
78
+ setWidth(s) {
79
+ this.width = parseInt(s, 10);
72
80
  }
73
81
  /** 获取宽度 */
74
82
  getWidth() {
75
83
  return this.visible ? this.width : !1;
76
84
  }
77
85
  }
78
- class Jt extends ct {
79
- constructor(t) {
80
- super(t);
86
+ class hn extends sn {
87
+ constructor(s) {
88
+ super(s);
81
89
  }
82
90
  }
83
- function ut() {
84
- function o(t) {
85
- const e = [];
86
- return t.reduce((n, r) => (r.children && r.children.length > 0 ? n.push(new Ce(r)) : n.push(new Jt(r)), n), e), e;
91
+ function on() {
92
+ function d(s) {
93
+ const i = [];
94
+ return s.reduce((b, p) => (p.children && p.children.length > 0 ? b.push(new Q(p)) : b.push(new hn(p)), b), i), i;
87
95
  }
88
- return { buildResponseToolbarItems: o };
96
+ return { buildResponseToolbarItems: d };
89
97
  }
90
- const { buildResponseToolbarItems: Zt } = ut();
91
- class Ce extends ct {
92
- constructor(e) {
93
- super(e);
94
- U(this, "placement", "");
98
+ const { buildResponseToolbarItems: bn } = on();
99
+ class Q extends sn {
100
+ constructor(i) {
101
+ super(i);
102
+ f(this, "placement", "");
95
103
  // 下拉位置
96
104
  /** 是否可见 */
97
- U(this, "visible", !0);
105
+ f(this, "visible", !0);
98
106
  /** 下拉class */
99
- U(this, "dropdownClass", "");
107
+ f(this, "dropdownClass", "");
100
108
  /** 下拉菜单class */
101
- U(this, "menuClass", "");
109
+ f(this, "menuClass", "");
102
110
  /** 是否用分开的下拉按钮 */
103
- U(this, "split", !1);
104
- U(this, "children", []);
105
- U(this, "expanded", !1);
106
- U(this, "shown", !0);
107
- const n = ["visible", "icon", "isDP", "class", "dropdownClass", "menuClass", "placement", "split", "expanded"];
108
- Object.keys(e).filter((r) => n.indexOf(r) > -1).forEach((r) => {
109
- r === "visible" ? this[r] = e[r] === void 0 ? !0 : e[r] : this[r] = e[r];
110
- }), this.shown = this.visible, e.children && e.children.length && (this.children = Zt(e.children));
111
- }
112
- }
113
- class fo {
114
- constructor(t, e) {
115
- U(this, "id");
116
- U(this, "name");
117
- /** 记录元素的Id */
118
- U(this, "presetId", []);
119
- /** 记录转变为下拉时元素的位置 */
120
- U(this, "responsedIndex", []);
121
- /** 记录宽度 */
122
- U(this, "width");
123
- this.id = t, this.name = e, this.width = 0;
124
- }
125
- // 设置宽度
126
- setWidth(t) {
127
- this.width = parseInt(t + "", 10);
128
- }
129
- // 获取宽度
130
- getWidth() {
131
- return this.width;
132
- }
133
- // 更新presetIndex
134
- setPreset(t) {
135
- Array.isArray(t) ? this.presetId = this.presetId.concat(t) : this.presetId.push(t);
136
- }
137
- // 清除preset
138
- delPreset() {
139
- this.presetId = [];
140
- }
141
- // 删除
142
- removeResponsed(t) {
143
- this.responsedIndex.splice(t, 1);
144
- }
145
- // 更新responsedIndex
146
- setResponsed(t) {
147
- Array.isArray(t) ? this.responsedIndex = this.responsedIndex.concat(t) : this.responsedIndex.push(t);
148
- }
149
- // 是否已经开始处理响应式
150
- isResponsing() {
151
- return this.responsedIndex.length > 0;
152
- }
153
- // 是否已经处理完响应式
154
- isResponsed() {
155
- return this.presetId.length === this.responsedIndex.length;
156
- }
157
- }
158
- const dt = {}, ft = {};
159
- function $e(o) {
160
- const { properties: t, title: e, ignore: n } = o, r = n && Array.isArray(n), i = Object.keys(t).reduce((l, g) => ((!r || !n.find((u) => u === g)) && (l[g] = t[g].type === "object" && t[g].properties ? $e(t[g]) : he(t[g].default)), l), {});
161
- if (e && (!r || !n.find((l) => l === "id"))) {
162
- const l = e.toLowerCase().replace(/-/g, "_");
163
- i.id = `${l}_${Math.random().toString().slice(2, 6)}`;
164
- }
165
- return i;
166
- }
167
- function Kt(o) {
168
- const { properties: t, title: e, required: n } = o;
169
- if (n && Array.isArray(n)) {
170
- const r = n.reduce((i, l) => (i[l] = t[l].type === "object" && t[l].properties ? $e(t[l]) : he(t[l].default), i), {});
171
- if (e && n.find((i) => i === "id")) {
172
- const i = e.toLowerCase().replace(/-/g, "_");
173
- r.id = `${i}_${Math.random().toString().slice(2, 6)}`;
174
- }
175
- return r;
176
- }
177
- return {
178
- type: e
179
- };
180
- }
181
- function be(o, t = {}, e) {
182
- const n = dt[o];
183
- if (n) {
184
- let r = Kt(n);
185
- const i = ft[o];
186
- return r = i ? i({ getSchemaByType: be }, r, t, e) : r, r;
187
- }
188
- return null;
189
- }
190
- function en(o, t) {
191
- const e = $e(t);
192
- return Object.keys(e).reduce((n, r) => (Object.prototype.hasOwnProperty.call(o, r) && (n[r] && nt(n[r]) && nt(o[r] || !o[r]) ? Object.assign(n[r], o[r] || {}) : n[r] = o[r]), n), e), e;
193
- }
194
- function pt(o, t) {
195
- return Object.keys(o).filter((n) => o[n] != null).reduce((n, r) => {
196
- if (t.has(r)) {
197
- const i = t.get(r);
198
- if (typeof i == "string")
199
- n[i] = o[r];
200
- else {
201
- const l = i(r, o[r], o);
202
- Object.assign(n, l);
203
- }
204
- } else
205
- n[r] = o[r];
206
- return n;
207
- }, {});
208
- }
209
- function tn(o, t, e = /* @__PURE__ */ new Map()) {
210
- const n = en(o, t);
211
- return pt(n, e);
212
- }
213
- function nn(o = {}) {
214
- function t(d, v, p, m) {
215
- if (typeof p == "number")
216
- return m[d].length === p;
217
- if (typeof p == "object") {
218
- const h = Object.keys(p)[0], c = p[h];
219
- if (h === "not")
220
- return Number(m[d].length) !== Number(c);
221
- if (h === "moreThan")
222
- return Number(m[d].length) >= Number(c);
223
- if (h === "lessThan")
224
- return Number(m[d].length) <= Number(c);
225
- }
226
- return !1;
227
- }
228
- function e(d, v, p, m) {
229
- return m[d] && m[d].propertyValue && String(m[d].propertyValue.value) === String(p);
230
- }
231
- const n = /* @__PURE__ */ new Map([
232
- ["length", t],
233
- ["getProperty", e]
234
- ]);
235
- Object.keys(o).reduce((d, v) => (d.set(v, o[v]), d), n);
236
- function r(d, v) {
237
- const p = d;
238
- return typeof v == "number" ? [{ target: p, operator: "length", param: null, value: Number(v) }] : typeof v == "boolean" ? [{ target: p, operator: "getProperty", param: d, value: !!v }] : typeof v == "object" ? Object.keys(v).map((m) => {
239
- if (m === "length")
240
- return { target: p, operator: "length", param: null, value: v[m] };
241
- const h = m, c = v[m];
242
- return { target: p, operator: "getProperty", param: h, value: c };
243
- }) : [];
244
- }
245
- function i(d) {
246
- return Object.keys(d).reduce((p, m) => {
247
- const h = r(m, d[m]);
248
- return p.push(...h), p;
249
- }, []);
250
- }
251
- function l(d, v) {
252
- if (n.has(d.operator)) {
253
- const p = n.get(d.operator);
254
- return p && p(d.target, d.param, d.value, v) || !1;
255
- }
256
- return !1;
257
- }
258
- function g(d, v) {
259
- return i(d).reduce((h, c) => h && l(c, v), !0);
260
- }
261
- function u(d, v) {
262
- const p = Object.keys(d), m = p.includes("allOf"), h = p.includes("anyOf"), c = m || h, N = (c ? d[c ? m ? "allOf" : "anyOf" : "allOf"] : [d]).map((B) => g(B, v));
263
- return m ? !N.includes(!1) : N.includes(!0);
264
- }
265
- return { parseValueSchema: u };
266
- }
267
- const on = {
268
- button: { type: "button", name: "按钮" },
269
- "response-toolbar": { type: "response-toolbar", name: "工具栏" },
270
- "response-toolbar-item": { type: "response-toolbar-item", name: "按钮" },
271
- "content-container": { type: "content-container", name: "容器" },
272
- "input-group": { type: "input-group", name: "文本" },
273
- textarea: { type: "textarea", name: "多行文本" },
274
- lookup: { type: "lookup", name: "帮助" },
275
- "number-spinner": { type: "number-spinner", name: "数值" },
276
- "date-picker": { type: "date-picker", name: "日期" },
277
- switch: { type: "switch", name: "开关" },
278
- "radio-group": { type: "radio-group", name: "单选组" },
279
- "check-box": { type: "check-box", name: "复选框" },
280
- "check-group": { type: "check-group", name: "复选框组" },
281
- "combo-list": { type: "combo-list", name: "下拉列表" },
282
- "response-form": { type: "response-form", name: "卡片面板" },
283
- "response-layout": { type: "response-layout", name: "布局容器", icon: "response-layout-3" },
284
- "response-layout-item": { type: "response-layout-item", name: "布局", icon: "response-layout-1" },
285
- "tree-grid": { type: "tree-grid", name: "树表格" },
286
- "tree-grid-column": { type: "tree-grid-column", name: "树表格列" },
287
- "data-grid": { type: "data-grid", name: "表格" },
288
- "data-grid-column": { type: "data-grid-column", name: "表格列" },
289
- module: { type: "Module", name: "模块" },
290
- component: { type: "component", name: "组件" },
291
- tabs: { type: "tabs", name: "标签页" },
292
- "tab-page": { type: "tab-page", name: "标签页项", dependentParentControl: "Tab" },
293
- "tab-toolbar-item": { type: "tab-toolbar-item", name: "标签页工具栏按钮" },
294
- "html-template": { type: "html-template", name: "模板容器" },
295
- "time-picker": { type: "time-picker", name: "时间选择" },
296
- section: { type: "section", name: "分组面板" },
297
- "section-toolbar": { type: "section-toolbar", name: "分组面板工具栏" },
298
- "section-toolbar-item": { type: "section-toolbar-item", name: "分组面板按钮" },
299
- splitter: { type: "splitter", name: "分栏面板" },
300
- "splitter-pane": { type: "splitter-pane", name: "分栏面板项", dependentParentControl: "Splitter" },
301
- "component-ref": { type: "component-ref", name: "组件引用节点" },
302
- uploader: { type: "uploader", name: "附件上传" },
303
- "page-header": { type: "page-header", name: "页头" },
304
- "page-footer": { type: "page-footer", name: "页脚" },
305
- "tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏" },
306
- fieldset: { type: "fieldset", name: "分组" },
307
- "query-solution": { type: "query-solution", name: "筛选方案" },
308
- drawer: { type: "drawer", name: "抽屉" },
309
- "external-container": { type: "external-container", name: "外部容器", icon: "content-container" },
310
- "list-nav": { type: "list-nav", name: "列表导航" },
311
- "filter-bar": { type: "filter-bar", name: "筛选条" }
312
- }, rn = {}, sn = {};
313
- nn();
314
- function gt(o, t, e = /* @__PURE__ */ new Map(), n = (l, g, u, d) => g, r = {}, i = (l) => l) {
315
- return dt[t.title] = t, ft[t.title] = n, rn[t.title] = r, sn[t.title] = i, (l = {}, g = !0) => {
316
- if (!g)
317
- return pt(l, e);
318
- const u = tn(l, t, e), d = Object.keys(o).reduce((v, p) => (v[p] = o[p].default, v), {});
319
- return Object.assign(d, u);
320
- };
321
- }
322
- function ln(o, t) {
323
- return { customClass: t.class, customStyle: t.style };
324
- }
325
- function an(o, t) {
326
- if (!o || o.length < 1)
327
- return null;
328
- for (const e of o) {
329
- if (e.id === t)
330
- return e;
331
- if (e.children) {
332
- const n = e.children.find((r) => r.id === t);
333
- if (n)
334
- return n;
335
- }
336
- }
337
- return null;
338
- }
339
- function cn() {
340
- function o(t, e) {
341
- const n = t.buttons;
342
- if (!n || n.length < 1)
343
- return null;
344
- const [r, i] = e.payloads, l = an(n, i);
345
- return l ? l.onClick || l.click : null;
346
- }
347
- return {
348
- resolve: o
349
- };
350
- }
351
- const un = /* @__PURE__ */ new Map([
352
- ["buttons", "items"],
353
- ["appearance", ln]
354
- ]);
355
- function ht(o, t, e) {
356
- return t;
357
- }
358
- const dn = "https://json-schema.org/draft/2020-12/schema", fn = "https://farris-design.gitee.io/response-toolbar.schema.json", pn = "response-toolbar", gn = "A Farris Toolbar Component", hn = "object", mn = {
359
- id: {
360
- description: "The unique identifier for a Response Toolbar",
361
- type: "string"
362
- },
363
- type: {
364
- description: "The type string of Response Toolbar",
365
- type: "string",
366
- default: "response-toolbar"
367
- },
368
- appearance: {
369
- description: "",
370
- type: "object",
371
- properties: {
372
- class: {
373
- type: "string",
374
- default: ""
375
- }
376
- }
377
- },
378
- alignment: {
379
- description: "The alignment of Response Toolbar Button.",
380
- type: "string",
381
- default: "right"
382
- },
383
- buttons: {
384
- description: "The items of Response Toolbar.",
385
- type: "array",
386
- default: []
387
- },
388
- buttonSize: {
389
- type: "string",
390
- default: ""
391
- },
392
- visible: {
393
- description: "",
394
- type: "boolean",
395
- default: !0
396
- }
397
- }, vn = [
398
- "id",
399
- "type",
400
- "buttons"
401
- ], bn = {
402
- onClick: "点击事件"
403
- }, yn = {
404
- $schema: dn,
405
- $id: fn,
406
- title: pn,
407
- description: gn,
408
- type: hn,
409
- properties: mn,
410
- required: vn,
411
- events: bn
412
- }, Cn = "https://json-schema.org/draft/2020-12/schema", wn = "https://farris-design.gitee.io/response-toolbar-item.schema.json", xn = "response-toolbar-item", Tn = "A Farris Toolbar Item Component", Sn = "object", En = {
413
- id: {
414
- description: "The unique identifier for a Response Toolbar",
415
- type: "string"
416
- },
417
- type: {
418
- description: "The type string of Response Toolbar",
419
- type: "string",
420
- default: "response-toolbar-item"
421
- },
422
- appearance: {
423
- description: "",
424
- type: "object",
425
- properties: {
426
- class: {
427
- type: "string",
428
- default: ""
429
- }
430
- }
431
- },
432
- alignment: {
433
- description: "对齐",
434
- type: "string",
435
- default: "right"
436
- },
437
- text: {
438
- description: "文本",
439
- type: "string",
440
- default: "按钮"
441
- },
442
- icon: {
443
- description: "图标",
444
- type: "string",
445
- default: ""
446
- },
447
- disabled: {
448
- description: "禁用",
449
- type: "boolean",
450
- default: !1
451
- },
452
- visible: {
453
- description: "是否可见",
454
- type: "boolean",
455
- default: !0
456
- },
457
- onClick: {
458
- description: "点击事件",
459
- type: "string",
460
- default: ""
461
- },
462
- tipsEnable: {
463
- description: "",
464
- type: "boolean",
465
- default: !1
466
- },
467
- tipsText: {
468
- description: "",
469
- type: "string",
470
- default: ""
471
- },
472
- dropdownClass: {
473
- description: "处于下拉菜单时的样式",
474
- type: "string",
475
- default: ""
476
- },
477
- split: {
478
- description: "",
479
- type: "boolean",
480
- default: !1
481
- }
482
- }, In = [
483
- "id",
484
- "type",
485
- "text"
486
- ], Pn = {
487
- $schema: Cn,
488
- $id: wn,
489
- title: xn,
490
- description: Tn,
491
- type: Sn,
492
- properties: En,
493
- required: In
494
- }, Le = {
495
- id: { type: String, default: "" },
496
- /** 组件自定义样式 */
497
- customClass: { type: String, default: "" },
498
- alignment: { Type: String, default: "right" },
499
- items: {
500
- Type: Array,
501
- default: []
502
- },
503
- /** 控制是否可见 */
504
- visible: { type: Boolean, default: !0 }
505
- }, Mn = Object.assign({}, Le, {
506
- componentId: { type: String, default: "" }
507
- }), qe = gt(
508
- Le,
509
- yn,
510
- un,
511
- ht
512
- ), mt = {
513
- id: { type: String, default: "" },
514
- item: { type: Object, default: {} },
515
- items: { type: Object, default: {} },
516
- class: { type: String, default: "btn-secondary" },
517
- text: { type: String, default: "" },
518
- disabled: { type: Boolean, default: !1 },
519
- icon: { type: String, default: "" },
520
- componentId: { type: String, default: "" },
521
- // 是否展开子级
522
- expanded: { type: Boolean, default: !1 },
523
- alignment: { Type: String, default: "right" },
524
- // 下拉按钮分离
525
- split: { type: Boolean, default: !1 },
526
- // 是否下拉
527
- isDP: { type: Boolean, default: !1 },
528
- // 是否下拉项
529
- isDPItem: { type: Boolean, default: !1 }
530
- }, kn = gt(
531
- mt,
532
- Pn,
533
- void 0,
534
- ht
535
- ), Dn = cn();
536
- function We() {
537
- function o(e) {
538
- const n = {
111
+ f(this, "split", !1);
112
+ f(this, "children", []);
113
+ f(this, "expanded", !1);
114
+ f(this, "shown", !0);
115
+ const b = ["visible", "icon", "isDP", "class", "dropdownClass", "menuClass", "placement", "split", "expanded"];
116
+ Object.keys(i).filter((p) => b.indexOf(p) > -1).forEach((p) => {
117
+ p === "visible" ? this[p] = i[p] === void 0 ? !0 : i[p] : this[p] = i[p];
118
+ }), this.shown = this.visible, i.children && i.children.length && (this.children = bn(i.children));
119
+ }
120
+ }
121
+ function gn() {
122
+ function d(i) {
123
+ const b = {
539
124
  "f-icon": !0
540
125
  };
541
- if (e.icon) {
542
- const r = e.icon.trim().split(" ");
543
- r && r.length && r.reduce((i, l) => (i[l] = !0, i), n);
126
+ if (i.icon) {
127
+ const p = i.icon.trim().split(" ");
128
+ p && p.length && p.reduce((g, R) => (g[R] = !0, g), b);
544
129
  }
545
- return n;
130
+ return b;
546
131
  }
547
- function t(e) {
548
- return !!(e.icon && e.icon.trim());
132
+ function s(i) {
133
+ return !!(i.icon && i.icon.trim());
549
134
  }
550
- return { iconClass: o, shouldShowIcon: t };
551
- }
552
- const Bn = ["moz", "ms", "webkit"];
553
- function Rn() {
554
- let o = 0;
555
- return (t) => {
556
- const e = (/* @__PURE__ */ new Date()).getTime(), n = Math.max(0, 16 - (e - o)), r = setTimeout(() => {
557
- t(e + n);
558
- }, n);
559
- return o = e + n, r;
560
- };
561
- }
562
- function On() {
563
- if (typeof window > "u")
564
- return () => 0;
565
- if (window.requestAnimationFrame)
566
- return window.requestAnimationFrame.bind(window);
567
- const o = Bn.filter((t) => `${t}RequestAnimationFrame` in window)[0];
568
- return o ? window[`${o}RequestAnimationFrame`] : Rn();
135
+ return { iconClass: d, shouldShowIcon: s };
569
136
  }
570
- On();
571
- function ge(o, t) {
572
- return ((t == null ? void 0 : t.split(" ")) || []).reduce((n, r) => (r && (n[r] = !0), n), o), o;
573
- }
574
- function An(o, t) {
575
- function e(f) {
576
- return ge({
137
+ function wn(d, s) {
138
+ function i(e) {
139
+ return P({
577
140
  "dropdown-menu": !0
578
- }, f.menuClass);
141
+ }, e.menuClass);
579
142
  }
580
- function n(f) {
581
- const s = {
582
- disabled: !f.enable,
143
+ function b(e) {
144
+ const n = {
145
+ disabled: !e.enable,
583
146
  "dropdown-submenu": !0,
584
147
  "f-rt-dropdown": !0,
585
148
  "text-truncate": !0
586
149
  };
587
- return ge(s, f.dropdownClass);
150
+ return P(n, e.dropdownClass);
588
151
  }
589
- function r(f) {
590
- const s = {
591
- disabled: !f.enable,
152
+ function p(e) {
153
+ const n = {
154
+ disabled: !e.enable,
592
155
  "dropdown-item": !0,
593
156
  "f-rt-btn": !0,
594
157
  "text-truncate": !0
595
158
  };
596
- return ge(s, f.dropdownClass);
159
+ return P(n, e.dropdownClass);
597
160
  }
598
- function i(f) {
599
- const s = {
600
- disabled: !f.enable,
161
+ function g(e) {
162
+ const n = {
163
+ disabled: !e.enable,
601
164
  "dropdown-item": !0,
602
165
  "f-rt-btn": !0,
603
166
  "text-truncate": !0,
604
- "f-rt-toggle": !f.split,
605
- "btn-icontext": !!(f.icon && f.icon.trim()),
606
- "dropdown-toggle": !f.split
167
+ "f-rt-toggle": !e.split,
168
+ "btn-icontext": !!(e.icon && e.icon.trim()),
169
+ "dropdown-toggle": !e.split
607
170
  };
608
- return ge(s, f.dropdownClass);
171
+ return P(n, e.dropdownClass);
609
172
  }
610
- function l(f) {
611
- const s = {
173
+ function R(e) {
174
+ const n = {
612
175
  "f-rt-btn": !0,
613
176
  "text-truncate": !0,
614
- "btn-icontext": !!(f.icon && f.icon.trim()),
177
+ "btn-icontext": !!(e.icon && e.icon.trim()),
615
178
  "d-block": !0
616
179
  };
617
- return ge(s, f.dropdownClass);
180
+ return P(n, e.dropdownClass);
618
181
  }
619
- let g;
620
- const u = /* @__PURE__ */ new Map();
621
- function d(f, s, w) {
622
- f.stopPropagation();
623
- const x = w ? w.id : "__top_item__";
624
- if (s.children && s.children.length && (s.expanded = !s.expanded, s.expanded)) {
625
- if (u.has(x) && u.get(x) !== s) {
626
- const k = u.get(x);
627
- k && (k.expanded = !1, u.delete(x));
182
+ let T;
183
+ const C = /* @__PURE__ */ new Map();
184
+ function S(e, n, l) {
185
+ e.stopPropagation();
186
+ const r = l ? l.id : "__top_item__";
187
+ if (n.children && n.children.length && (n.expanded = !n.expanded, n.expanded)) {
188
+ if (C.has(r) && C.get(r) !== n) {
189
+ const k = C.get(r);
190
+ k && (k.expanded = !1, C.delete(r));
628
191
  }
629
- u.set(x, s);
192
+ C.set(r, n);
630
193
  }
631
194
  }
632
- function v(f, s) {
633
- document.body.click(), s.enable && (f.stopPropagation(), typeof s.onClick == "function" && s.onClick(f, s.id), o.emit("click", f, s.id));
195
+ function E(e, n) {
196
+ document.body.click(), n.enable && (e.stopPropagation(), typeof n.onClick == "function" && n.onClick(e, n.id), d.emit("click", e, n.id));
634
197
  }
635
- function p(f, s) {
636
- const w = f.target;
637
- w.className.indexOf("dropdown-item") < 0 || (w.title = w.scrollWidth > w.clientWidth ? s : "");
198
+ function A(e, n) {
199
+ const l = e.target;
200
+ l.className.indexOf("dropdown-item") < 0 || (l.title = l.scrollWidth > l.clientWidth ? n : "");
638
201
  }
639
- function m(f, s, w) {
640
- if (s.tipsEnable && s.tipsText) {
641
- const x = we({
642
- content: s.tipsText,
643
- enable: s.tipsEnable
202
+ function q(e, n, l) {
203
+ if (n.tipsEnable && n.tipsText) {
204
+ const r = X({
205
+ content: n.tipsText,
206
+ enable: n.tipsEnable
644
207
  });
645
- return xe(O("li", {
646
- class: r(s),
647
- id: s.id,
648
- key: s.id + "_" + w,
649
- onClick: (k) => v(k, s)
650
- }, [O("span", {
651
- class: l(s)
652
- }, [t.shouldShowIcon(s) && O("i", {
653
- class: t.iconClass(s)
654
- }, null), s.text])]), [[Te("tooltip"), x]]);
655
- }
656
- return O("li", {
657
- class: r(s),
658
- id: s.id,
659
- onClick: (x) => v(x, s)
660
- }, [O("span", {
661
- class: l(s),
662
- onMouseenter: (x) => p(x, s.text)
663
- }, [t.shouldShowIcon(s) && O("i", {
664
- class: t.iconClass(s)
665
- }, null), s.text])]);
666
- }
667
- function h(f, s, w) {
668
- s.enable && (typeof s.onClick == "function" && w.onClick(f, s.id), o.emit("click", f, s.id), w.split || d(f, s, w));
669
- }
670
- function c(f, s, w) {
671
- f && f.stopPropagation(), d(f, s, w);
672
- }
673
- function S(f, s) {
674
- f.stopPropagation();
675
- const w = s.id;
676
- if (s.children && s.children.length && s.expanded && u.has(w)) {
677
- const x = u.get(w);
678
- x && (x.expanded = !1, u.delete(w));
679
- }
680
- }
681
- function j(f, s, w) {
682
- if (s.tipsEnable && s.tipsText) {
683
- const x = we({
684
- content: s.tipsText,
685
- enable: s.tipsEnable
208
+ return Z(u("li", {
209
+ class: p(n),
210
+ id: n.id,
211
+ key: n.id + "_" + l,
212
+ onClick: (k) => E(k, n)
213
+ }, [u("span", {
214
+ class: R(n)
215
+ }, [s.shouldShowIcon(n) && u("i", {
216
+ class: s.iconClass(n)
217
+ }, null), n.text])]), [[I("tooltip"), r]]);
218
+ }
219
+ return u("li", {
220
+ class: p(n),
221
+ id: n.id,
222
+ onClick: (r) => E(r, n)
223
+ }, [u("span", {
224
+ class: R(n),
225
+ onMouseenter: (r) => A(r, n.text)
226
+ }, [s.shouldShowIcon(n) && u("i", {
227
+ class: s.iconClass(n)
228
+ }, null), n.text])]);
229
+ }
230
+ function L(e, n, l) {
231
+ n.enable && (typeof n.onClick == "function" && l.onClick(e, n.id), d.emit("click", e, n.id), l.split || S(e, n, l));
232
+ }
233
+ function o(e, n, l) {
234
+ e && e.stopPropagation(), S(e, n, l);
235
+ }
236
+ function h(e, n) {
237
+ e.stopPropagation();
238
+ const l = n.id;
239
+ if (n.children && n.children.length && n.expanded && C.has(l)) {
240
+ const r = C.get(l);
241
+ r && (r.expanded = !1, C.delete(l));
242
+ }
243
+ }
244
+ function O(e, n, l) {
245
+ if (n.tipsEnable && n.tipsText) {
246
+ const r = X({
247
+ content: n.tipsText,
248
+ enable: n.tipsEnable
686
249
  });
687
- return O("li", {
688
- class: n(s),
689
- id: s.id,
690
- key: s.id + "_" + w,
691
- onClick: (k) => h(k, s, f)
692
- }, [xe(O("span", {
693
- class: i(s)
694
- }, [t.shouldShowIcon(s) && O("i", {
695
- class: t.iconClass(s)
696
- }, null), s.text]), [[Te("tooltip"), x]]), s.split && O("span", {
250
+ return u("li", {
251
+ class: b(n),
252
+ id: n.id,
253
+ key: n.id + "_" + l,
254
+ onClick: (k) => L(k, n, e)
255
+ }, [Z(u("span", {
256
+ class: g(n)
257
+ }, [s.shouldShowIcon(n) && u("i", {
258
+ class: s.iconClass(n)
259
+ }, null), n.text]), [[I("tooltip"), r]]), n.split && u("span", {
697
260
  class: "dropdown-toggle dropdown-toggle-split f-rt-toggle",
698
- onClick: (k) => c(k, s, f)
699
- }, null), g(s, s)]);
700
- }
701
- return O("li", {
702
- class: n(s),
703
- id: s.id,
704
- onClick: (x) => h(x, s, f),
705
- onMouseenter: (x) => p(x, s.text)
706
- }, [O("span", {
707
- class: i(s)
708
- }, [t.shouldShowIcon(s) && O("i", {
709
- class: t.iconClass(s)
710
- }, null), s.text]), s.split && O("span", {
261
+ onClick: (k) => o(k, n, e)
262
+ }, null), T(n, n)]);
263
+ }
264
+ return u("li", {
265
+ class: b(n),
266
+ id: n.id,
267
+ onClick: (r) => L(r, n, e),
268
+ onMouseenter: (r) => A(r, n.text)
269
+ }, [u("span", {
270
+ class: g(n)
271
+ }, [s.shouldShowIcon(n) && u("i", {
272
+ class: s.iconClass(n)
273
+ }, null), n.text]), n.split && u("span", {
711
274
  class: "dropdown-toggle dropdown-toggle-split f-rt-toggle",
712
- onClick: (x) => c(x, s, f)
713
- }, null), g(s, s)]);
275
+ onClick: (r) => o(r, n, e)
276
+ }, null), T(n, n)]);
714
277
  }
715
- function N(f) {
716
- return f.children.filter((s) => s.visible).map((s, w) => s.children && s.children.length ? j(f, s, w) : m(f, s, w));
278
+ function B(e) {
279
+ return e.children.filter((n) => n.visible).map((n, l) => n.children && n.children.length ? O(e, n, l) : q(e, n, l));
717
280
  }
718
- function A(f, s, w) {
719
- const x = {
720
- display: f.expanded ? "block" : "none",
281
+ function V(e, n, l) {
282
+ const r = {
283
+ display: e.expanded ? "block" : "none",
721
284
  position: "fixed",
722
285
  maxWidth: "300px",
723
286
  minWidth: "120px",
724
287
  zIndex: 1040,
725
288
  overflowY: "auto",
726
289
  maxHeight: "none"
727
- }, k = window.innerWidth, H = window.innerHeight, C = s, a = C == null ? void 0 : C.getClientRects();
728
- if (C && a && a.length) {
290
+ }, k = window.innerWidth, W = window.innerHeight, _ = n, j = _ == null ? void 0 : _.getClientRects();
291
+ if (_ && j && j.length) {
729
292
  const {
730
- top: E,
731
- width: P,
732
- left: y,
733
- right: I,
734
- height: D
735
- } = a[0], T = Math.ceil(D + E);
736
- x.top = `${T}px`, x.left = `${y}px`;
737
- const q = f.id + "_menu", L = s ? s.querySelector("#" + q) : null;
738
- if (L) {
739
- L.style.visibility = "hidden", L.style.display = "block";
740
- const V = L.offsetHeight;
741
- x.display === "block" && (L.style.display = "block");
742
- const _ = L.getBoundingClientRect();
743
- if (w) {
744
- x.top = `${E - 6}px`;
745
- const G = Math.ceil(P + y);
746
- x.left = `${G}px`;
293
+ top: M,
294
+ width: N,
295
+ left: $,
296
+ right: U,
297
+ height: F
298
+ } = j[0], t = Math.ceil(F + M);
299
+ r.top = `${t}px`, r.left = `${$}px`;
300
+ const c = e.id + "_menu", a = n ? n.querySelector("#" + c) : null;
301
+ if (a) {
302
+ a.style.visibility = "hidden", a.style.display = "block";
303
+ const x = a.offsetHeight;
304
+ r.display === "block" && (a.style.display = "block");
305
+ const D = a.getBoundingClientRect();
306
+ if (l) {
307
+ r.top = `${M - 6}px`;
308
+ const v = Math.ceil(N + $);
309
+ r.left = `${v}px`;
747
310
  }
748
- k - y - P < _.width && (x.left = `${(w ? y : I) - _.width}px`), H - E - D < V ? E > V ? (x.top = `${E - V - 6}px`, x.maxHeight = `${E - 16}px`) : (x.maxHeight = `${H - T}px`, E > H - E - D && (x.top = "10px", x.maxHeight = `${E - 16}px`)) : x.maxHeight = `${H - T}px`, L.style.visibility = "visible";
311
+ k - $ - N < D.width && (r.left = `${(l ? $ : U) - D.width}px`), W - M - F < x ? M > x ? (r.top = `${M - x - 6}px`, r.maxHeight = `${M - 16}px`) : (r.maxHeight = `${W - t}px`, M > W - M - F && (r.top = "10px", r.maxHeight = `${M - 16}px`)) : r.maxHeight = `${W - t}px`, a.style.visibility = "visible";
749
312
  }
750
313
  }
751
- return x;
314
+ return r;
752
315
  }
753
- g = function(f, s) {
754
- var H, C;
755
- const w = Wt(), x = s ? s.id : f.id, k = (C = (H = w == null ? void 0 : w.exposed) == null ? void 0 : H.elementRef.value) == null ? void 0 : C.querySelector("#" + x);
756
- return O("ul", {
757
- class: e(f),
758
- style: A(f, k, s),
759
- id: f.id + "_menu",
760
- onWheel: (a) => S(a, f)
761
- }, [N(f)]);
316
+ T = function(e, n) {
317
+ var W, _;
318
+ const l = cn(), r = n ? n.id : e.id, k = (_ = (W = l == null ? void 0 : l.exposed) == null ? void 0 : W.elementRef.value) == null ? void 0 : _.querySelector("#" + r);
319
+ return u("ul", {
320
+ class: i(e),
321
+ style: V(e, k, n),
322
+ id: e.id + "_menu",
323
+ onWheel: (j) => h(j, e)
324
+ }, [B(e)]);
762
325
  };
763
- function B() {
764
- u.forEach((f) => {
765
- f.expanded = !1;
766
- }), u.clear();
326
+ function G() {
327
+ C.forEach((e) => {
328
+ e.expanded = !1;
329
+ }), C.clear();
767
330
  }
768
331
  return {
769
- renderDropdownMenu: g,
770
- clearAllDropDownMenu: B
332
+ renderDropdownMenu: T,
333
+ clearAllDropDownMenu: G
771
334
  };
772
335
  }
773
- function Vn(o, t, e) {
774
- const n = X(o.alignment), {
775
- renderDropdownMenu: r,
776
- clearAllDropDownMenu: i
777
- } = An(t, e);
778
- function l(c) {
779
- const S = {
336
+ function xn(d, s, i) {
337
+ const b = z(d.alignment), {
338
+ renderDropdownMenu: p,
339
+ clearAllDropDownMenu: g
340
+ } = wn(s, i);
341
+ function R(o) {
342
+ const h = {
780
343
  "btn-group": !0,
781
344
  "f-rt-dropdown": !0,
782
- "f-btn-ml": n.value === "right" || n.value === "center",
783
- "f-btn-mr": n.value === "left"
345
+ "f-btn-ml": b.value === "right" || b.value === "center",
346
+ "f-btn-mr": b.value === "left"
784
347
  };
785
- return ge(S, c.dropdownClass);
348
+ return P(h, o.dropdownClass);
786
349
  }
787
- function g(c) {
788
- const S = {
350
+ function T(o) {
351
+ const h = {
789
352
  btn: !0,
790
- disabled: !c.enable,
353
+ disabled: !o.enable,
791
354
  "f-rt-btn": !0,
792
- "btn-icontext": !!(c.icon && c.icon.trim()),
793
- "f-rt-toggle": !c.split,
794
- "dropdown-toggle": !c.split
355
+ "btn-icontext": !!(o.icon && o.icon.trim()),
356
+ "f-rt-toggle": !o.split,
357
+ "dropdown-toggle": !o.split
795
358
  };
796
- return ge(S, c.class);
359
+ return P(h, o.class);
797
360
  }
798
- function u(c) {
799
- return ge({
361
+ function C(o) {
362
+ return P({
800
363
  btn: !0,
801
364
  "dropdown-toggle": !0,
802
365
  "dropdown-toggle-split": !0
803
- }, c.class);
366
+ }, o.class);
804
367
  }
805
- function d(c) {
806
- return c.split ? {
368
+ function S(o) {
369
+ return o.split ? {
807
370
  display: "flex"
808
371
  } : {
809
372
  display: "flex",
810
373
  "border-radius": "6px"
811
374
  };
812
375
  }
813
- function v(c, S) {
814
- c.stopPropagation();
815
- const j = S.expanded;
816
- document.body.click(), typeof S.onClick == "function" && S.onClick(c, S.id), t.emit("click", c, S.id), S.split || (S.expanded = !j);
376
+ function E(o, h) {
377
+ o.stopPropagation();
378
+ const O = h.expanded;
379
+ document.body.click(), typeof h.onClick == "function" && h.onClick(o, h.id), s.emit("click", o, h.id), h.split || (h.expanded = !O);
817
380
  }
818
- function p(c, S) {
819
- c.stopPropagation();
820
- const j = S.expanded;
821
- document.body.click(), S.expanded = !j;
381
+ function A(o, h) {
382
+ o.stopPropagation();
383
+ const O = h.expanded;
384
+ document.body.click(), h.expanded = !O;
822
385
  }
823
- function m(c, S = !0) {
824
- if (c.tipsEnable && c.tipsText) {
825
- const j = we({
826
- content: c.tipsText,
827
- enable: c.tipsEnable
386
+ function q(o, h = !0) {
387
+ if (o.tipsEnable && o.tipsText) {
388
+ const O = X({
389
+ content: o.tipsText,
390
+ enable: o.tipsEnable
828
391
  });
829
- return O("div", {
830
- id: c.id,
831
- class: l(c)
832
- }, [xe(O("div", {
833
- class: g(c),
834
- style: d(c),
835
- onClick: (N) => c.enable && v(N, c)
836
- }, [e.shouldShowIcon(c) && O("i", {
837
- class: e.iconClass(c)
838
- }, null), O("span", null, [c.text])]), [[Te("tooltip"), j]]), c.split && O("button", {
839
- class: u(c),
392
+ return u("div", {
393
+ id: o.id,
394
+ class: R(o)
395
+ }, [Z(u("div", {
396
+ class: T(o),
397
+ style: S(o),
398
+ onClick: (B) => o.enable && E(B, o)
399
+ }, [i.shouldShowIcon(o) && u("i", {
400
+ class: i.iconClass(o)
401
+ }, null), u("span", null, [o.text])]), [[I("tooltip"), O]]), o.split && u("button", {
402
+ class: C(o),
840
403
  style: "border-radius:0 6px 6px 0;",
841
- onClick: (N) => p(N, c)
842
- }, null), S && r(c)]);
404
+ onClick: (B) => A(B, o)
405
+ }, null), h && p(o)]);
843
406
  }
844
- return O("div", {
845
- id: c.id,
846
- class: l(c)
847
- }, [O("div", {
848
- class: g(c),
849
- style: d(c),
850
- onClick: (j) => c.enable && v(j, c)
851
- }, [e.shouldShowIcon(c) && O("i", {
852
- class: e.iconClass(c)
853
- }, null), O("span", null, [c.text])]), c.split && O("button", {
854
- class: u(c),
407
+ return u("div", {
408
+ id: o.id,
409
+ class: R(o)
410
+ }, [u("div", {
411
+ class: T(o),
412
+ style: S(o),
413
+ onClick: (O) => o.enable && E(O, o)
414
+ }, [i.shouldShowIcon(o) && u("i", {
415
+ class: i.iconClass(o)
416
+ }, null), u("span", null, [o.text])]), o.split && u("button", {
417
+ class: C(o),
855
418
  style: "border-radius:0 6px 6px 0;",
856
- onClick: (j) => p(j, c)
857
- }, null), S && r(c)]);
419
+ onClick: (O) => A(O, o)
420
+ }, null), h && p(o)]);
858
421
  }
859
- function h() {
860
- i();
422
+ function L() {
423
+ g();
861
424
  }
862
425
  return {
863
- renderToolbarDropdown: m,
864
- clearAllDropDown: h
426
+ renderToolbarDropdown: q,
427
+ clearAllDropDown: L
865
428
  };
866
429
  }
867
430
  const {
868
- buildResponseToolbarItems: ot
869
- } = ut(), Ee = /* @__PURE__ */ Ie({
431
+ buildResponseToolbarItems: en
432
+ } = on(), vn = /* @__PURE__ */ an({
870
433
  name: "FResponseToolbar",
871
- props: Le,
434
+ props: fn,
872
435
  emits: ["click"],
873
- setup(o, t) {
874
- const e = X(ot(o.items)), n = X(), r = X(), i = X(), l = {
436
+ setup(d, s) {
437
+ const i = z(en(d.items)), b = z(), p = z(), g = z(), R = {
875
438
  id: "__more_buttons__",
876
439
  text: "更多"
877
- }, g = X(new Ce(l)), u = {
878
- id: l.id + "width",
879
- text: l.text
880
- }, d = X(-1), v = We();
881
- let p = !1;
882
- const m = re(() => g.value.children.length > 0), h = re(() => {
883
- const T = {
440
+ }, T = z(new Q(R)), C = {
441
+ id: R.id + "width",
442
+ text: R.text
443
+ }, S = z(-1), E = gn();
444
+ let A = !1;
445
+ const q = J(() => T.value.children.length > 0), L = J(() => {
446
+ const t = {
884
447
  "f-toolbar": !0,
885
448
  "f-response-toolbar": !0,
886
449
  "position-relative": !0,
887
- "f-response-toolbar-sm": o.buttonSize === "sm",
888
- "f-response-toolbar-lg": o.buttonSize === "lg",
889
- "d-none": !o.visible
450
+ "f-response-toolbar-sm": d.buttonSize === "sm",
451
+ "f-response-toolbar-lg": d.buttonSize === "lg",
452
+ "d-none": !d.visible
890
453
  };
891
- return pe(T, o.customClass);
892
- }), c = re(() => ({
454
+ return P(t, d.customClass);
455
+ }), o = J(() => ({
893
456
  "w-100": !0,
894
457
  "d-flex": !0,
895
458
  "flex-nowrap": !0,
896
- "justify-content-end": o.alignment === "right",
897
- "justify-content-start": o.alignment === "left",
898
- "justify-content-center": o.alignment === "center"
459
+ "justify-content-end": d.alignment === "right",
460
+ "justify-content-start": d.alignment === "left",
461
+ "justify-content-center": d.alignment === "center"
899
462
  })), {
900
- renderToolbarDropdown: S,
901
- clearAllDropDown: j
902
- } = Vn(o, t, v);
903
- function N(T) {
904
- T && T.target.closest("ul.dropdown-menu") && T.type === "wheel" || (e.value.filter((q) => q.children && q.children.length > 0).forEach((q) => {
905
- q.expanded = !1;
906
- }), g.value.expanded = !1, j());
907
- }
908
- function A(T, q) {
909
- var _;
910
- const L = {
463
+ renderToolbarDropdown: h,
464
+ clearAllDropDown: O
465
+ } = xn(d, s, E);
466
+ function B(t) {
467
+ t && t.target.closest("ul.dropdown-menu") && t.type === "wheel" || (i.value.filter((c) => c.children && c.children.length > 0).forEach((c) => {
468
+ c.expanded = !1;
469
+ }), T.value.expanded = !1, O());
470
+ }
471
+ function V(t, c) {
472
+ var D;
473
+ const a = {
911
474
  btn: !0,
912
475
  "f-rt-btn": !0,
913
- "f-btn-ml": o.alignment === "right" || q > 0 && o.alignment === "center",
914
- "f-btn-mr": o.alignment === "left",
915
- "btn-icontext": !!(T.icon && T.icon.trim())
916
- }, V = ((_ = T == null ? void 0 : T.appearance) == null ? void 0 : _.class) || T.class || "btn-secondary";
917
- return pe(L, V);
918
- }
919
- function B(T, q) {
920
- document.body.click(), typeof q.onClick == "function" && q.onClick(T, q.id), t.emit("click", T, q.id);
921
- }
922
- function f(T, q) {
923
- if (T.tipsEnable && T.tipsText) {
924
- const L = we({
925
- content: T.tipsText,
926
- enable: T.tipsEnable
476
+ "f-btn-ml": d.alignment === "right" || c > 0 && d.alignment === "center",
477
+ "f-btn-mr": d.alignment === "left",
478
+ "btn-icontext": !!(t.icon && t.icon.trim())
479
+ }, x = ((D = t == null ? void 0 : t.appearance) == null ? void 0 : D.class) || t.class || "btn-secondary";
480
+ return P(a, x);
481
+ }
482
+ function G(t, c) {
483
+ document.body.click(), typeof c.onClick == "function" && c.onClick(t, c.id), s.emit("click", t, c.id);
484
+ }
485
+ function e(t, c) {
486
+ if (t.tipsEnable && t.tipsText) {
487
+ const a = X({
488
+ content: t.tipsText,
489
+ enable: t.tipsEnable
927
490
  });
928
- return xe(O("button", {
491
+ return Z(u("button", {
929
492
  type: "button",
930
- class: A(T, q),
931
- id: T.id,
932
- disabled: !T.enable,
933
- onClick: (V) => B(V, T)
934
- }, [v.shouldShowIcon(T) && O("i", {
935
- class: v.iconClass(T)
936
- }, null), T.text]), [[Te("tooltip"), L]]);
937
- }
938
- return O("button", {
493
+ class: V(t, c),
494
+ id: t.id,
495
+ disabled: !t.enable,
496
+ onClick: (x) => G(x, t)
497
+ }, [E.shouldShowIcon(t) && u("i", {
498
+ class: E.iconClass(t)
499
+ }, null), t.text]), [[I("tooltip"), a]]);
500
+ }
501
+ return u("button", {
939
502
  type: "button",
940
- class: A(T, q),
941
- id: T.id,
942
- disabled: !T.enable,
943
- onClick: (L) => B(L, T)
944
- }, [v.shouldShowIcon(T) && O("i", {
945
- class: v.iconClass(T)
946
- }, null), T.text]);
947
- }
948
- let s = /* @__PURE__ */ new Map(), w = [];
949
- function x(T) {
950
- const q = Math.ceil(parseFloat(getComputedStyle(T).getPropertyValue("margin-left"))), L = Math.ceil(parseFloat(getComputedStyle(T).getPropertyValue("margin-right")));
951
- return (q || 0) + T.getBoundingClientRect().width + (L || 0);
952
- }
953
- function k(T, q, L) {
954
- if (q < d.value) {
955
- let V = L - 1;
956
- for (; V >= 0; V--) {
957
- const _ = T[V], G = x(_);
958
- if (q += G, q >= d.value)
503
+ class: V(t, c),
504
+ id: t.id,
505
+ disabled: !t.enable,
506
+ onClick: (a) => G(a, t)
507
+ }, [E.shouldShowIcon(t) && u("i", {
508
+ class: E.iconClass(t)
509
+ }, null), t.text]);
510
+ }
511
+ let n = /* @__PURE__ */ new Map(), l = [];
512
+ function r(t) {
513
+ const c = Math.ceil(parseFloat(getComputedStyle(t).getPropertyValue("margin-left"))), a = Math.ceil(parseFloat(getComputedStyle(t).getPropertyValue("margin-right")));
514
+ return (c || 0) + t.getBoundingClientRect().width + (a || 0);
515
+ }
516
+ function k(t, c, a) {
517
+ if (c < S.value) {
518
+ let x = a - 1;
519
+ for (; x >= 0; x--) {
520
+ const D = t[x], v = r(D);
521
+ if (c += v, c >= S.value)
959
522
  break;
960
523
  }
961
- L = V;
524
+ a = x;
962
525
  }
963
- return q -= d.value, {
964
- start: L,
965
- space: q
526
+ return c -= S.value, {
527
+ start: a,
528
+ space: c
966
529
  };
967
530
  }
968
- function H(T) {
969
- const q = i.value;
970
- let L = T;
971
- const _ = Array.from(q.children).filter((ee) => ee.id !== "__more_buttons__"), G = _.length;
972
- let z = !1, Y = 0;
973
- for (; Y < G; Y++) {
974
- const ee = _[Y], ie = x(ee);
975
- if (ie <= L)
976
- L -= ie;
531
+ function W(t) {
532
+ const c = g.value;
533
+ let a = t;
534
+ const D = Array.from(c.children).filter((H) => H.id !== "__more_buttons__"), v = D.length;
535
+ let y = !1, w = 0;
536
+ for (; w < v; w++) {
537
+ const H = D[w], Y = r(H);
538
+ if (Y <= a)
539
+ a -= Y;
977
540
  else {
978
- const Z = k(_, L, Y);
979
- Y = Z.start, L = Z.space, z = !0;
541
+ const m = k(D, a, w);
542
+ w = m.start, a = m.space, y = !0;
980
543
  break;
981
544
  }
982
545
  }
983
- if (!z && w.length > 0) {
984
- const ee = k(_, L, Y);
985
- Y = ee.start, L = ee.space;
546
+ if (!y && l.length > 0) {
547
+ const H = k(D, a, w);
548
+ w = H.start, a = H.space;
986
549
  }
987
- const W = w.length > 0;
988
- for (; Y < G; Y++) {
989
- const ee = _[Y], ie = x(ee);
990
- s.set(ee.id, !0), w[W ? "unshift" : "push"]({
991
- id: ee.id,
992
- width: ie
550
+ const K = l.length > 0;
551
+ for (; w < v; w++) {
552
+ const H = D[w], Y = r(H);
553
+ n.set(H.id, !0), l[K ? "unshift" : "push"]({
554
+ id: H.id,
555
+ width: Y
993
556
  });
994
557
  }
995
- return L;
996
- }
997
- function C(T) {
998
- let q = H(T);
999
- if (w.length) {
1000
- let G = 0;
1001
- for (; G < w.length; G++) {
1002
- const z = o.items.find((Y) => Y.id === w[G].id);
1003
- if (z && z.visible !== !1) {
1004
- const Y = w[G].width;
1005
- if (q >= Y || G === w.length - 1 && q + d.value >= Y)
1006
- q -= Y;
558
+ return a;
559
+ }
560
+ function _(t) {
561
+ let c = W(t);
562
+ if (l.length) {
563
+ let v = 0;
564
+ for (; v < l.length; v++) {
565
+ const y = d.items.find((w) => w.id === l[v].id);
566
+ if (y && y.visible !== !1) {
567
+ const w = l[v].width;
568
+ if (c >= w || v === l.length - 1 && c + S.value >= w)
569
+ c -= w;
1007
570
  else
1008
571
  break;
1009
572
  }
1010
573
  }
1011
- for (let z = 0; z < G; z++)
1012
- s.delete(w[z].id);
1013
- w.splice(0, G - 1);
574
+ for (let y = 0; y < v; y++)
575
+ n.delete(l[y].id);
576
+ l.splice(0, v - 1);
1014
577
  }
1015
- const L = Object.assign({}, g.value);
1016
- L.children = [];
1017
- const V = new Ce(L), _ = e.value.reduce((G, z) => {
1018
- const Y = o.items.find((W) => W.id === z.id);
1019
- return s.has(z.id) ? (V.children.push(z), z.shown = !1) : z.shown = Y.visible !== !1, G.push(z), G;
578
+ const a = Object.assign({}, T.value);
579
+ a.children = [];
580
+ const x = new Q(a), D = i.value.reduce((v, y) => {
581
+ const w = d.items.find((K) => K.id === y.id);
582
+ return n.has(y.id) ? (x.children.push(y), y.shown = !1) : y.shown = w.visible !== !1, v.push(y), v;
1020
583
  }, []);
1021
- g.value = V, e.value = _;
584
+ T.value = x, i.value = D;
1022
585
  }
1023
- function a(T = -1) {
1024
- if (T === 0 || !i.value || !r.value)
586
+ function j(t = -1) {
587
+ if (t === 0 || !g.value || !p.value)
1025
588
  return;
1026
- T < 0 && (T = r.value.getBoundingClientRect().width);
1027
- const q = i.value.getBoundingClientRect().width;
1028
- (T >= 0 && T < q || w.length) && (C(T), N());
589
+ t < 0 && (t = p.value.getBoundingClientRect().width);
590
+ const c = g.value.getBoundingClientRect().width;
591
+ (t >= 0 && t < c || l.length) && (_(t), B());
1029
592
  }
1030
- function E() {
1031
- return d.value < 0 && O("div", {
593
+ function M() {
594
+ return S.value < 0 && u("div", {
1032
595
  style: "position:absolute;top:-30px;visibility:hidden;"
1033
- }, [S(new Ce(u))]);
596
+ }, [h(new Q(C))]);
1034
597
  }
1035
- const P = new ResizeObserver((T) => {
1036
- if (T.length) {
1037
- const L = T[0].contentRect.width;
1038
- a(L);
598
+ const N = new ResizeObserver((t) => {
599
+ if (t.length) {
600
+ const a = t[0].contentRect.width;
601
+ j(a);
1039
602
  }
1040
603
  });
1041
- function y() {
1042
- s = /* @__PURE__ */ new Map(), w = [];
604
+ function $() {
605
+ n = /* @__PURE__ */ new Map(), l = [];
1043
606
  }
1044
- function I() {
1045
- r.value && !p && (P.observe(r.value), p = !0);
607
+ function U() {
608
+ p.value && !A && (N.observe(p.value), A = !0);
1046
609
  }
1047
- function D() {
1048
- if (n.value && d.value < 0) {
1049
- const T = n.value.querySelector("#" + u.id);
1050
- T && (d.value = x(T));
610
+ function F() {
611
+ if (b.value && S.value < 0) {
612
+ const t = b.value.querySelector("#" + C.id);
613
+ t && (S.value = r(t));
1051
614
  }
1052
615
  }
1053
- return Pe(() => {
1054
- D(), a(), I(), document.body.addEventListener("click", N), document.body.addEventListener("wheel", N);
1055
- }), lt(() => {
1056
- P.disconnect(), document.body.removeEventListener("click", N), document.body.removeEventListener("wheel", N);
1057
- }), Se(() => o.items, () => {
1058
- e.value = ot(o.items), g.value.children = [], me(() => {
1059
- y(), a();
616
+ return un(() => {
617
+ F(), j(), U(), document.body.addEventListener("click", B), document.body.addEventListener("wheel", B);
618
+ }), pn(() => {
619
+ N.disconnect(), document.body.removeEventListener("click", B), document.body.removeEventListener("wheel", B);
620
+ }), nn(() => d.items, () => {
621
+ i.value = en(d.items), T.value.children = [], tn(() => {
622
+ $(), j();
1060
623
  });
1061
624
  }, {
1062
625
  deep: !0
1063
- }), Se(() => o.visible, (T) => {
1064
- T && me(() => {
1065
- D(), a(), I();
626
+ }), nn(() => d.visible, (t) => {
627
+ t && tn(() => {
628
+ F(), j(), U();
1066
629
  });
1067
- }), t.expose({
1068
- elementRef: n
1069
- }), () => O("div", {
1070
- class: h.value,
1071
- id: o.id,
1072
- ref: n,
630
+ }), s.expose({
631
+ elementRef: b
632
+ }), () => u("div", {
633
+ class: L.value,
634
+ id: d.id,
635
+ ref: b,
1073
636
  style: {
1074
- "overflow-y": d.value < 0 ? "hidden" : "initial"
637
+ "overflow-y": S.value < 0 ? "hidden" : "initial"
1075
638
  }
1076
- }, [o.visible && E(), o.visible && O("div", {
1077
- ref: r,
1078
- class: c.value
1079
- }, [O("div", {
1080
- ref: i,
639
+ }, [d.visible && M(), d.visible && u("div", {
640
+ ref: p,
641
+ class: o.value
642
+ }, [u("div", {
643
+ ref: g,
1081
644
  class: "d-inline-block f-response-content",
1082
645
  style: "white-space: nowrap;"
1083
- }, [e.value.filter((T) => T.shown).map((T, q) => T.children && T.children.length > 0 ? S(T) : f(T, q)), m.value && S(g.value)])])]);
1084
- }
1085
- }), _n = X(0);
1086
- function jn() {
1087
- _n.value++;
1088
- }
1089
- const ve = X(0);
1090
- function Nn(o, t) {
1091
- const e = t.getBoundingClientRect(), n = o.getBoundingClientRect(), r = n.top >= e.top, i = n.top <= e.bottom;
1092
- return r && i;
1093
- }
1094
- function vt(o) {
1095
- const t = o.querySelector(".component-btn-group");
1096
- if (!t)
1097
- return;
1098
- t.style.display = "";
1099
- const e = t.getBoundingClientRect();
1100
- if (!(e.top === 0 && e.left === 0)) {
1101
- const n = t.querySelector("div");
1102
- if (n) {
1103
- const r = n.getBoundingClientRect();
1104
- n.style.top = e.top + "px";
1105
- let i = e.left - r.width;
1106
- const l = document.querySelector(".editorDiv");
1107
- if (l) {
1108
- const g = l.getBoundingClientRect();
1109
- i < g.left && ({ left: i } = o.getBoundingClientRect());
1110
- }
1111
- n.style.left = i + "px";
1112
- }
1113
- }
1114
- }
1115
- function Fn(o) {
1116
- if (!window.scrollContainerList)
1117
- return;
1118
- const t = Array.from(window.scrollContainerList);
1119
- if (t.length && t.length === 1) {
1120
- const e = t[0], n = document.querySelector(`[id=${e}]`);
1121
- if (n && n.contains(o))
1122
- return n;
1123
- }
1124
- }
1125
- function bt(o) {
1126
- if (!o)
1127
- return;
1128
- const t = o.getBoundingClientRect();
1129
- if (t.width === 0 && t.height === 0)
1130
- return;
1131
- const e = o.querySelector(".component-btn-group");
1132
- if (e) {
1133
- let n = !0;
1134
- const r = Fn(o);
1135
- if (r && (n = Nn(o, r)), !n) {
1136
- e.style.display = "none";
1137
- return;
1138
- }
1139
- vt(o);
1140
- }
1141
- }
1142
- function $n(o) {
1143
- if (!o)
1144
- return;
1145
- let t;
1146
- o.className.includes("dgComponentSelected") ? t = o : t = o.querySelector(".dgComponentSelected"), t && bt(t);
1147
- }
1148
- function Ln(o) {
1149
- const { formSchemaUtils: t, formStateMachineUtils: e } = o;
1150
- function n(u, d = "") {
1151
- return {
1152
- path: d + u.code,
1153
- field: u.id,
1154
- fullPath: u.code
1155
- };
646
+ }, [i.value.filter((t) => t.shown).map((t, c) => t.children && t.children.length > 0 ? h(t) : e(t, c)), q.value && h(T.value)])])]);
1156
647
  }
1157
- function r(u, d = "") {
1158
- return t.getViewModelById(u).states.map((p) => n(p, d));
1159
- }
1160
- function i(u) {
1161
- const d = t.getRootViewModelId(), v = r(u);
1162
- if (u === d)
1163
- return v;
1164
- const p = r(d, "root-component.");
1165
- return [...v, ...p];
1166
- }
1167
- function l(u) {
1168
- return u.binding && u.binding.path || u.id || "";
1169
- }
1170
- function g() {
1171
- return e && e.getRenderStates() || [];
1172
- }
1173
- return { getVariables: i, getControlName: l, getStateMachines: g };
1174
- }
1175
- class qn {
1176
- constructor(t) {
1177
- U(this, "sessionVariables", [
1178
- {
1179
- key: "CurrentSysOrgName",
1180
- name: "当前组织Name",
1181
- description: "当前组织Name"
1182
- },
1183
- // {
1184
- // key: "CurrentSysOrgCode",
1185
- // name: "当前组织Code",
1186
- // description: "当前组织Code"
1187
- // },
1188
- {
1189
- key: "CurrentSysOrgId",
1190
- name: "当前组织Id",
1191
- description: "当前组织Id"
1192
- },
1193
- {
1194
- key: "CurrentUserName",
1195
- name: "当前用户Name",
1196
- description: "当前用户Name"
1197
- },
1198
- {
1199
- key: "CurrentUserCode",
1200
- name: "当前用户Code",
1201
- description: "当前用户Code"
1202
- },
1203
- {
1204
- key: "CurrentUserId",
1205
- name: "当前用户Id",
1206
- description: "当前用户Id"
1207
- },
1208
- {
1209
- key: "CurrentLanguage",
1210
- name: "当前语言编号",
1211
- description: "当前登录的语言编号,例如简体中文返回'zh-CHS',英文返回'en',繁体中文'zh-CHT'"
1212
- }
1213
- ]);
1214
- U(this, "expressionNames", {
1215
- compute: "计算表达式",
1216
- dependency: "依赖表达式",
1217
- validate: "验证表达式",
1218
- dataPicking: "帮助前表达式",
1219
- visible: "可见表达式",
1220
- readonly: "只读表达式",
1221
- required: "必填表达式"
1222
- });
1223
- U(this, "getExpressionConverter", (t, e) => ({
1224
- convertFrom: (n, r, i, l) => {
1225
- const g = i.getExpressionRuleValue(t, e || r);
1226
- return g && g.value || "";
1227
- },
1228
- convertTo: (n, r, i, l, g) => {
1229
- var u;
1230
- if (r === "dataPicking" && (i != null && i.target)) {
1231
- const d = `${i.target}_dataPicking`;
1232
- ((u = i.rules) == null ? void 0 : u.some(
1233
- (p) => p.id === d && p.value
1234
- )) ? n.dictPickingExpressionId = d : delete n.dictPickingExpressionId;
1235
- }
1236
- l.updateExpression(i);
1237
- }
1238
- }));
1239
- this.formSchemaService = t;
1240
- }
1241
- getExpressionRule(t, e) {
1242
- const n = this.formSchemaService.getExpressions();
1243
- if (!n)
1244
- return "";
1245
- const r = n.find((l) => l.target === t);
1246
- if (!r)
1247
- return "";
1248
- const i = r.rules.find((l) => l.type === e);
1249
- return i || "";
1250
- }
1251
- // 获取上下文表单变量
1252
- getContextFormVariables() {
1253
- const { module: t } = this.formSchemaService.getFormSchema();
1254
- if (!t.viewmodels || t.viewmodels.length === 0)
1255
- return [];
1256
- const e = this.formSchemaService.getRootViewModelId(), n = this.formSchemaService.getViewModelById(e);
1257
- if (!n || !n.states || n.states.length === 0)
1258
- return [];
1259
- const r = [];
1260
- return n.states.forEach((i) => {
1261
- r.push({
1262
- key: i.code,
1263
- name: i.name,
1264
- description: i.name,
1265
- category: i.category
1266
- });
1267
- }), r;
1268
- }
1269
- createTreeNode(t, e, n = "label") {
1270
- return {
1271
- id: t.id,
1272
- name: t.name,
1273
- bindingPath: t[n],
1274
- parents: e
1275
- };
1276
- }
1277
- buildEntityFieldsTreeData(t = null, e) {
1278
- const n = [];
1279
- return t == null || t.forEach((r) => {
1280
- var g;
1281
- const i = this.createTreeNode(r, e);
1282
- let l = [];
1283
- (g = r.type) != null && g.fields && (l = this.buildEntityFieldsTreeData(r.type.fields, [...e, r.label])), n.push({
1284
- data: i,
1285
- children: l,
1286
- expanded: !0
1287
- });
1288
- }), n;
1289
- }
1290
- buildChildEntityTreeData(t = null, e) {
1291
- const n = [];
1292
- return t == null || t.forEach((r) => {
1293
- var u, d;
1294
- const i = this.createTreeNode(r, e), l = this.buildEntityFieldsTreeData((u = r.type) == null ? void 0 : u.fields, [...e, r.label]), g = this.buildChildEntityTreeData((d = r.type) == null ? void 0 : d.entities, [...e, r.label]);
1295
- g != null && g.length && (l == null || l.push(...g)), n.push({
1296
- data: i,
1297
- children: l || [],
1298
- // 空值回退
1299
- expanded: !0
1300
- });
1301
- }), n;
1302
- }
1303
- getEntitiesTreeData() {
1304
- const t = this.formSchemaService.getSchemaEntities();
1305
- if (!(t != null && t.length))
1306
- return [];
1307
- const e = t[0];
1308
- if (!(e != null && e.type))
1309
- return [];
1310
- const n = this.buildEntityFieldsTreeData(e.type.fields, [e.code]), r = this.buildChildEntityTreeData(e.type.entities, [e.code]);
1311
- return r != null && r.length && (n == null || n.push(...r)), {
1312
- entityCode: e.code,
1313
- fields: [{
1314
- data: this.createTreeNode(e, [], "code"),
1315
- children: n || []
1316
- }]
1317
- };
1318
- }
1319
- getEntitiesAndVariables() {
1320
- return {
1321
- entities: this.getEntitiesTreeData(),
1322
- variables: {
1323
- session: {
1324
- name: "系统变量",
1325
- items: this.sessionVariables,
1326
- visible: !1
1327
- },
1328
- forms: {
1329
- name: "表单变量",
1330
- items: this.getContextFormVariables(),
1331
- visible: !0
1332
- }
1333
- }
1334
- };
648
+ });
649
+ class Dn {
650
+ constructor(s, i) {
651
+ f(this, "id");
652
+ f(this, "name");
653
+ /** 记录元素的Id */
654
+ f(this, "presetId", []);
655
+ /** 记录转变为下拉时元素的位置 */
656
+ f(this, "responsedIndex", []);
657
+ /** 记录宽度 */
658
+ f(this, "width");
659
+ this.id = s, this.name = i, this.width = 0;
1335
660
  }
1336
- onBeforeOpenExpression(t, e, n) {
1337
- const r = n === "Field" ? t.binding.field : t.id, i = this.getExpressionRule(r, e), l = this.getEntitiesAndVariables(), g = {
1338
- message: ["validate", "required", "dataPicking"].includes(e) && i ? i.message : "",
1339
- ...l
1340
- };
1341
- return i.messageType != null && (g.messageType = i.messageType), g;
661
+ // 设置宽度
662
+ setWidth(s) {
663
+ this.width = parseInt(s + "", 10);
1342
664
  }
1343
- buildRule(t, e, n, r) {
1344
- const { expression: i, message: l, messageType: g } = e, u = {
1345
- id: `${t}_${n}`,
1346
- type: n,
1347
- value: i
1348
- };
1349
- return (n === "validate" || n === "dataPicking" || n === "required") && (u.message = l), n === "dataPicking" && (u.messageType = g), n === "validate" && r && (u.elementId = r), u;
665
+ // 获取宽度
666
+ getWidth() {
667
+ return this.width;
1350
668
  }
1351
- getExpressionData() {
1352
- const { expressions: t } = this.formSchemaService.getFormSchema().module;
1353
- return t || [];
669
+ // 更新presetIndex
670
+ setPreset(s) {
671
+ Array.isArray(s) ? this.presetId = this.presetId.concat(s) : this.presetId.push(s);
1354
672
  }
1355
- updateExpression(t, e, n, r) {
1356
- const i = e === "Field" ? t.binding.field : t.id, l = this.buildRule(i, n, r, t.type === "form-group" ? t.id : "");
1357
- let u = this.getExpressionData().find((v) => v.targetType === e && v.target === i);
1358
- const d = (v) => v.value.trim() === "";
1359
- if (u) {
1360
- const v = u.rules.find((p) => p.id === l.id);
1361
- if (v)
1362
- d(l) ? u.rules = u.rules.filter((p) => p.id !== l.id) : (Object.assign(v, l), r === "validate" && t.type === "form-group" && (v.elementId = t.id));
1363
- else {
1364
- if (d(l))
1365
- return null;
1366
- u.rules = u.rules || [], u.rules.push(l);
1367
- }
1368
- } else {
1369
- if (d(l))
1370
- return null;
1371
- u = {
1372
- target: `${i}`,
1373
- rules: [l],
1374
- targetType: e
1375
- };
1376
- }
1377
- return u;
673
+ // 清除preset
674
+ delPreset() {
675
+ this.presetId = [];
1378
676
  }
1379
- getExpressionEditorOptions(t, e, n, r) {
1380
- return n.reduce((i, l) => {
1381
- var u, d;
1382
- const g = e === "Field" ? (u = t == null ? void 0 : t.binding) == null ? void 0 : u.field : t.id;
1383
- return i[l] = {
1384
- hide: e === "Field" ? !!((d = t == null ? void 0 : t.binding) != null && d.field) : !1,
1385
- description: "",
1386
- title: this.expressionNames[l],
1387
- type: "string",
1388
- $converter: this.getExpressionConverter(g),
1389
- editor: {
1390
- type: "expression-editor",
1391
- singleExpand: !1,
1392
- dialogTitle: `${this.expressionNames[l]}编辑器`,
1393
- showMessage: l === "validate" || l === "dataPicking" || l === "required",
1394
- showMessageType: l === "dataPicking",
1395
- beforeOpen: () => this.onBeforeOpenExpression(t, l, e),
1396
- onSubmitModal: (v) => {
1397
- const p = this.updateExpression(t, e, v, l);
1398
- if (r) {
1399
- const m = this.buildRule(g, v, l);
1400
- r(m);
1401
- }
1402
- return p;
1403
- }
1404
- }
1405
- }, i;
1406
- }, {});
677
+ // 删除
678
+ removeResponsed(s) {
679
+ this.responsedIndex.splice(s, 1);
1407
680
  }
1408
- getExpressionInfo(t, e, n) {
1409
- const r = e === "Field" ? t.binding.field : t.id, i = this.getExpressionRule(r, n), l = {
1410
- value: i && i.value,
1411
- targetId: r,
1412
- targetType: e,
1413
- expressionType: n
1414
- };
1415
- return i && i.message && (l.message = i.message), l;
681
+ // 更新responsedIndex
682
+ setResponsed(s) {
683
+ Array.isArray(s) ? this.responsedIndex = this.responsedIndex.concat(s) : this.responsedIndex.push(s);
1416
684
  }
1417
- getExpressionConfig(t, e, n = ["compute", "dependency", "validate"], r) {
1418
- return {
1419
- description: "表达式",
1420
- title: "表达式",
1421
- properties: {
1422
- ...this.getExpressionEditorOptions(t, e, n, r)
1423
- }
1424
- };
685
+ // 是否已经开始处理响应式
686
+ isResponsing() {
687
+ return this.responsedIndex.length > 0;
1425
688
  }
1426
- getExpressionOptions(t, e, n) {
1427
- const r = this.getExpressionInfo(t, e, n);
1428
- return {
1429
- dialogTitle: `${this.expressionNames[n]}编辑器`,
1430
- singleExpand: !1,
1431
- showMessage: n === "required",
1432
- beforeOpen: () => this.onBeforeOpenExpression(t, n, e),
1433
- expressionInfo: r
1434
- };
689
+ // 是否已经处理完响应式
690
+ isResponsed() {
691
+ return this.presetId.length === this.responsedIndex.length;
1435
692
  }
1436
693
  }
1437
- class yt {
1438
- constructor(t, e) {
1439
- U(this, "componentId");
1440
- U(this, "viewModelId");
1441
- U(this, "eventsEditorUtils");
1442
- U(this, "formSchemaUtils");
1443
- U(this, "formMetadataConverter");
1444
- U(this, "designViewModelUtils");
1445
- U(this, "designViewModelField");
1446
- U(this, "controlCreatorUtils");
1447
- U(this, "designerHostService");
1448
- U(this, "schemaService", null);
1449
- U(this, "metadataService", null);
1450
- U(this, "propertyConfig", {
1451
- type: "object",
1452
- categories: {}
1453
- });
1454
- var n;
1455
- this.componentId = t, this.designerHostService = e, this.eventsEditorUtils = e.eventsEditorUtils, this.formSchemaUtils = e.formSchemaUtils, this.formMetadataConverter = e.formMetadataConverter, this.viewModelId = ((n = this.formSchemaUtils) == null ? void 0 : n.getViewModelIdByComponentId(t)) || "", this.designViewModelUtils = e.designViewModelUtils, this.controlCreatorUtils = e.controlCreatorUtils, this.metadataService = e.metadataService, this.schemaService = e.schemaService;
1456
- }
1457
- getTableInfo() {
1458
- var t;
1459
- return (t = this.schemaService) == null ? void 0 : t.getTableInfoByViewModelId(this.viewModelId);
1460
- }
1461
- setDesignViewModelField(t) {
1462
- var n;
1463
- const e = t.binding && t.binding.type === "Form" && t.binding.field;
1464
- if (e) {
1465
- if (!this.designViewModelField) {
1466
- const r = this.designViewModelUtils.getDgViewModel(this.viewModelId);
1467
- this.designViewModelField = r.fields.find((i) => i.id === e);
1468
- }
1469
- t.updateOn = (n = this.designViewModelField) == null ? void 0 : n.updateOn;
1470
- }
1471
- }
1472
- getBasicPropConfig(t) {
1473
- return {
1474
- description: "Basic Information",
1475
- title: "基本信息",
1476
- properties: {
1477
- id: {
1478
- description: "组件标识",
1479
- title: "标识",
1480
- type: "string",
1481
- readonly: !0
1482
- },
1483
- type: {
1484
- description: "组件类型",
1485
- title: "控件类型",
1486
- type: "select",
1487
- editor: {
1488
- type: "combo-list",
1489
- textField: "name",
1490
- valueField: "value",
1491
- idField: "value",
1492
- editable: !1,
1493
- data: [{ value: t.type, name: on[t.type].name }]
1494
- }
1495
- }
1496
- }
1497
- };
1498
- }
1499
- getAppearanceConfig(t = null, e = {}, n) {
1500
- const r = {
1501
- title: "外观",
1502
- description: "Appearance"
1503
- }, i = {
1504
- class: {
1505
- title: "class样式",
1506
- type: "string",
1507
- description: "组件的CSS样式",
1508
- $converter: "/converter/appearance.converter"
1509
- },
1510
- style: {
1511
- title: "style样式",
1512
- type: "string",
1513
- description: "组件的样式",
1514
- $converter: "/converter/appearance.converter"
1515
- }
1516
- };
1517
- for (const l in e)
1518
- i[l] = Object.assign(i[l] || {}, e[l]);
1519
- return {
1520
- ...r,
1521
- properties: { ...i },
1522
- setPropertyRelates(l, g) {
1523
- if (l) {
1524
- switch (l && l.propertyID) {
1525
- case "class":
1526
- case "style": {
1527
- ve.value++;
1528
- break;
1529
- }
1530
- }
1531
- n && n(l, t, g);
1532
- }
1533
- }
1534
- };
1535
- }
1536
- getPropertyEditorParams(t, e = [], n = "visible", r = {}, i = {}) {
1537
- const { getVariables: l, getControlName: g, getStateMachines: u } = Ln(this.designerHostService), d = this.getRealTargetType(t), v = e && e.length > 0 ? e : ["Const", "Variable", "StateMachine", "Expression"], p = {
1538
- type: "property-editor",
1539
- propertyTypes: v
1540
- };
1541
- return v.map((m) => {
1542
- switch (m) {
1543
- case "Const":
1544
- Object.assign(p, {
1545
- constType: "enum",
1546
- constEnums: [{ id: !0, name: "是" }, { id: !1, name: "否" }]
1547
- }, r);
1548
- break;
1549
- case "Expression":
1550
- p.expressionConfig = this.getExpressionOptions(t, d, n);
1551
- break;
1552
- case "StateMachine":
1553
- p.stateMachines = u();
1554
- break;
1555
- case "Variable":
1556
- Object.assign(p, {
1557
- controlName: g(t),
1558
- newVariablePrefix: "is",
1559
- newVariableType: "Boolean",
1560
- variables: l(this.viewModelId),
1561
- onBeforeOpenVariables: (h) => {
1562
- h.value = l(this.viewModelId);
1563
- }
1564
- }, i);
1565
- break;
1566
- }
1567
- }), p;
1568
- }
1569
- getVisibleProperty(t, e = "") {
1570
- return {
1571
- visible: {
1572
- title: "是否可见",
1573
- type: "boolean",
1574
- description: "运行时组件是否可见",
1575
- editor: this.getPropertyEditorParams(t, e === "gridFieldEditor" ? ["Const", "Expression"] : ["Const", "Variable", "StateMachine", "Expression"], "visible")
1576
- }
1577
- };
1578
- }
1579
- /**
1580
- * 获取行为
1581
- * @param propertyData
1582
- * @param viewModelId
1583
- * @returns
1584
- */
1585
- getBehaviorConfig(t, e = "", n = {}, r) {
1586
- const i = {
1587
- title: "行为",
1588
- description: ""
1589
- }, l = this.getVisibleProperty(t, e);
1590
- for (const u in n)
1591
- l[u] = Object.assign(l[u] || {}, n[u]);
1592
- const g = this;
1593
- return {
1594
- ...i,
1595
- properties: { ...l },
1596
- setPropertyRelates(u, d) {
1597
- if (u) {
1598
- switch (u.propertyID) {
1599
- case "disabled":
1600
- case "readonly":
1601
- case "visible":
1602
- g.afterMutilEditorChanged(t, u);
1603
- break;
1604
- }
1605
- r && r(u, d);
1606
- }
1607
- }
1608
- };
1609
- }
1610
- /**
1611
- * 当多值编辑器变更时
1612
- * @param propertyData
1613
- * @param changeObject
1614
- */
1615
- afterMutilEditorChanged(t, e) {
1616
- this.addNewVariableToViewModel(e, this.viewModelId), this.updateExpressionValue(e), this.clearExpression(e, t);
1617
- }
1618
- /**
1619
- *
1620
- * @param propertyId
1621
- * @param componentInstance
1622
- * @returns
1623
- */
1624
- updateElementByParentContainer(t, e) {
1625
- const n = e && e.parent && e.parent.schema;
1626
- if (!n)
1627
- return;
1628
- const r = n.contents.findIndex((l) => l.id === t), i = he(n.contents[r]);
1629
- n.contents.splice(r, 1), n.contents.splice(r, 0, i), jn();
1630
- }
1631
- /**
1632
- * 属性编辑器,在编辑过程中会新增变量,此处需要将新增的变量追加到ViewModel中
1633
- * @param changeObject
1634
- * @param viewModelId
1635
- * @returns
1636
- */
1637
- addNewVariableToViewModel(t, e) {
1638
- const n = t.propertyValue;
1639
- if (!(n && typeof n == "object") || !(n.type === "Variable" && n.isNewVariable))
1640
- return;
1641
- const l = {
1642
- id: n.field,
1643
- category: "locale",
1644
- code: n.fullPath,
1645
- name: n.fullPath,
1646
- type: n.newVariableType || "String"
1647
- };
1648
- delete n.newVariableType, delete n.isNewVariable, this.formSchemaUtils.getVariableByCode(l.code) || this.formSchemaUtils.getViewModelById(e).states.push(l);
1649
- }
1650
- /**
1651
- * 更新表达式到expressions节点
1652
- * @param changeObject
1653
- */
1654
- updateExpressionValue(t) {
1655
- const e = t.propertyValue;
1656
- if (!((e && e.type) === "Expression" && e.expressionInfo))
1657
- return;
1658
- const { expressionId: i, expressionInfo: l } = e, { targetId: g, targetType: u, expressionType: d, value: v, message: p } = l, m = this.formSchemaUtils.getModule();
1659
- m.expressions ?? (m.expressions = []);
1660
- const { expressions: h } = m;
1661
- let c = h.find((j) => j.target === g);
1662
- c || (c = { target: g, rules: [], targetType: u }, h.push(c));
1663
- const S = c.rules.find((j) => j.type === d);
1664
- if (S)
1665
- S.value = v, S.message = p;
1666
- else {
1667
- const j = { id: i, type: d, value: v, message: p };
1668
- c.rules.push(j);
1669
- }
1670
- delete e.expressionInfo;
1671
- }
1672
- /**
1673
- * 属性类型切换为非表达式后,清除原表达式
1674
- * @param changeObject
1675
- * @param propertyData
1676
- * @returns
1677
- */
1678
- clearExpression(t, e) {
1679
- const n = t.propertyValue;
1680
- if (n && n.type === "Expression")
1681
- return;
1682
- const i = t.propertyID, l = this.formSchemaUtils.getExpressions(), g = e.binding ? e.binding.field : e.id, u = l.find((d) => d.target === g);
1683
- !u || !u.rules || (u.rules = u.rules.filter((d) => d.type !== i));
1684
- }
1685
- getExpressionOptions(t, e, n) {
1686
- return new qn(this.formSchemaUtils).getExpressionOptions(t, e, n);
1687
- }
1688
- getRealTargetType(t) {
1689
- return ["response-toolbar-item", "tab-toolbar-item", "section-toolbar-item"].indexOf(t.type) > -1 ? "Button" : t.binding && t.binding.field ? "Field" : "Container";
1690
- }
1691
- }
1692
- class Wn extends yt {
1693
- constructor(e, n, r = "response-toolbar") {
1694
- super(e, n);
1695
- // 有三类值 response-toolbar、section-toolbar、tab-toolbar
1696
- U(this, "toolbarType", "response-toolbar");
1697
- this.toolbarType = r;
1698
- }
1699
- getPropertyConfig(e) {
1700
- return this.propertyConfig.categories.basic = this.getBasicPropConfig(e), this.toolbarType !== "tab-toolbar" && this.getAppearancePropConfig(e), this.toolbarType === "response-toolbar" && (this.propertyConfig.categories.behavior = this.getBehaviorConfig(e)), this.propertyConfig;
1701
- }
1702
- getAppearancePropConfig(e) {
1703
- this.propertyConfig.categories.appearance = {
1704
- title: "外观",
1705
- description: "Appearance",
1706
- properties: {
1707
- class: {
1708
- title: "class样式",
1709
- type: "string",
1710
- description: "组件的CSS样式",
1711
- $converter: "/converter/appearance.converter"
1712
- }
1713
- }
1714
- };
1715
- }
1716
- getBehaviorProperties(e) {
1717
- this.propertyConfig.categories.behavior = {
1718
- title: "行为",
1719
- description: "",
1720
- properties: {
1721
- alignment: {
1722
- title: "对齐方式",
1723
- description: "在工具栏区域内按钮组的位置",
1724
- type: "enum",
1725
- editor: {
1726
- type: "combo-list",
1727
- textField: "name",
1728
- valueField: "value",
1729
- data: [
1730
- {
1731
- value: "left",
1732
- name: "左对齐"
1733
- },
1734
- {
1735
- value: "center",
1736
- name: "居中"
1737
- },
1738
- {
1739
- value: "right",
1740
- name: "右对齐"
1741
- }
1742
- ]
1743
- }
1744
- }
1745
- }
1746
- };
1747
- }
1748
- }
1749
- function Un(o, t, e) {
1750
- const n = o.schema;
1751
- function r() {
1752
- var S;
1753
- let c = ((S = o.parent) == null ? void 0 : S.schema.type) || "";
1754
- ["page-header", "tabs", "section"].findIndex((j) => j === c) === -1 && (c = ""), e.toolbarPosition = c;
1755
- }
1756
- r();
1757
- function i(c) {
1758
- return !1;
1759
- }
1760
- function l(c, S) {
1761
- return S.text = c.label, S;
1762
- }
1763
- function g() {
1764
- return !1;
1765
- }
1766
- function u() {
1767
- return !1;
1768
- }
1769
- function d() {
1770
- return !1;
1771
- }
1772
- function v() {
1773
- return !0;
1774
- }
1775
- function p(c) {
1776
- return new Wn(c, t, n.type).getPropertyConfig(n);
1777
- }
1778
- function m(c) {
1779
- var A;
1780
- c && (c.stopPropagation(), c.preventDefault());
1781
- const { schema: S } = o;
1782
- S.buttons || (S.buttons = []);
1783
- let j = "";
1784
- if (S.type)
1785
- j = S.type + "-item";
1786
- else {
1787
- const B = (A = o.parent) == null ? void 0 : A.schema.type;
1788
- j = B === "tabs" ? "tab-toolbar-item" : B === "section" ? "section-toolbar-item" : "response-toolbar-item";
1789
- }
1790
- const N = be(j);
1791
- N.id = `toolbar_item_${Math.random().toString().slice(2, 6)}`, S.buttons.push(N), e.updateToolbarItems(), e.changeSelectedId("");
1792
- }
1793
- function h() {
1794
- return [
1795
- {
1796
- id: "appendItem",
1797
- title: "新增按钮",
1798
- text: "",
1799
- icon: "f-icon f-icon-plus-circle text-white",
1800
- onClick: (c) => m(c)
1801
- }
1802
- ];
1803
- }
1804
- return {
1805
- canAccepts: i,
1806
- checkCanAddComponent: d,
1807
- checkCanDeleteComponent: u,
1808
- checkCanMoveComponent: g,
1809
- hideNestedPaddingInDesginerView: v,
1810
- onResolveNewComponentSchema: l,
1811
- getPropsConfig: p,
1812
- getCustomButtons: h
1813
- };
1814
- }
1815
- var fe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
1816
- function Hn(o) {
1817
- return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
1818
- }
1819
- function ye(o) {
1820
- throw new Error('Could not dynamically require "' + o + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
1821
- }
1822
- var Ct = { exports: {} };
1823
- (function(o, t) {
1824
- (function(e) {
1825
- o.exports = e();
1826
- })(function() {
1827
- return (/* @__PURE__ */ function() {
1828
- function e(n, r, i) {
1829
- function l(d, v) {
1830
- if (!r[d]) {
1831
- if (!n[d]) {
1832
- var p = typeof ye == "function" && ye;
1833
- if (!v && p) return p(d, !0);
1834
- if (g) return g(d, !0);
1835
- var m = new Error("Cannot find module '" + d + "'");
1836
- throw m.code = "MODULE_NOT_FOUND", m;
1837
- }
1838
- var h = r[d] = { exports: {} };
1839
- n[d][0].call(h.exports, function(c) {
1840
- var S = n[d][1][c];
1841
- return l(S || c);
1842
- }, h, h.exports, e, n, r, i);
1843
- }
1844
- return r[d].exports;
1845
- }
1846
- for (var g = typeof ye == "function" && ye, u = 0; u < i.length; u++) l(i[u]);
1847
- return l;
1848
- }
1849
- return e;
1850
- }())({
1851
- 1: [function(e, n, r) {
1852
- var i = {}, l = "(?:^|\\s)", g = "(?:\\s|$)";
1853
- function u(p) {
1854
- var m = i[p];
1855
- return m ? m.lastIndex = 0 : i[p] = m = new RegExp(l + p + g, "g"), m;
1856
- }
1857
- function d(p, m) {
1858
- var h = p.className;
1859
- h.length ? u(m).test(h) || (p.className += " " + m) : p.className = m;
1860
- }
1861
- function v(p, m) {
1862
- p.className = p.className.replace(u(m), " ").trim();
1863
- }
1864
- n.exports = {
1865
- add: d,
1866
- rm: v
1867
- };
1868
- }, {}],
1869
- 2: [function(e, n, r) {
1870
- (function(i) {
1871
- var l = e("contra/emitter"), g = e("crossvent"), u = e("./classes"), d = document, v = d.documentElement;
1872
- function p(a, E) {
1873
- var P = arguments.length;
1874
- P === 1 && Array.isArray(a) === !1 && (E = a, a = []);
1875
- var y, I, D, T, q, L, V, _, G, z = null, Y, W, ee = !1, ie = 0, Z, F = E || {};
1876
- F.moves === void 0 && (F.moves = A), F.accepts === void 0 && (F.accepts = A), F.invalid === void 0 && (F.invalid = Pt), F.containers === void 0 && (F.containers = a || []), F.isContainer === void 0 && (F.isContainer = N), F.copy === void 0 && (F.copy = !1), F.copySortSource === void 0 && (F.copySortSource = !1), F.revertOnSpill === void 0 && (F.revertOnSpill = !1), F.removeOnSpill === void 0 && (F.removeOnSpill = !1), F.direction === void 0 && (F.direction = "vertical"), F.ignoreInputTextSelection === void 0 && (F.ignoreInputTextSelection = !0), F.mirrorContainer === void 0 && (F.mirrorContainer = d.body);
1877
- var K = l({
1878
- containers: F.containers,
1879
- start: It,
1880
- end: Ye,
1881
- cancel: Ze,
1882
- remove: Je,
1883
- destroy: xt,
1884
- canMove: Et,
1885
- dragging: !1
1886
- });
1887
- return F.removeOnSpill === !0 && K.on("over", kt).on("out", Dt), Ue(), K;
1888
- function Me(b) {
1889
- return K.containers.indexOf(b) !== -1 || F.isContainer(b);
1890
- }
1891
- function Ue(b) {
1892
- var M = b ? "remove" : "add";
1893
- c(v, M, "mousedown", Tt), c(v, M, "mouseup", Be);
1894
- }
1895
- function ke(b) {
1896
- var M = b ? "remove" : "add";
1897
- c(v, M, "mousemove", St);
1898
- }
1899
- function He(b) {
1900
- var M = b ? "remove" : "add";
1901
- g[M](v, "selectstart", ze), g[M](v, "click", ze);
1902
- }
1903
- function xt() {
1904
- Ue(!0), Be({});
1905
- }
1906
- function ze(b) {
1907
- Y && b.preventDefault();
1908
- }
1909
- function Tt(b) {
1910
- T = b.clientX, q = b.clientY;
1911
- var M = S(b) !== 1 || b.metaKey || b.ctrlKey;
1912
- if (!M) {
1913
- var R = b.target, $ = De(R);
1914
- $ && (Y = $, ke(), b.type === "mousedown" && (w(R) ? R.focus() : b.preventDefault()));
1915
- }
1916
- }
1917
- function St(b) {
1918
- if (Y) {
1919
- if (S(b) === 0) {
1920
- Be({});
1921
- return;
1922
- }
1923
- if (!(b.clientX !== void 0 && Math.abs(b.clientX - T) <= (F.slideFactorX || 0) && b.clientY !== void 0 && Math.abs(b.clientY - q) <= (F.slideFactorY || 0))) {
1924
- if (F.ignoreInputTextSelection) {
1925
- var M = C("clientX", b) || 0, R = C("clientY", b) || 0, $ = d.elementFromPoint(M, R);
1926
- if (w($))
1927
- return;
1928
- }
1929
- var Q = Y;
1930
- ke(!0), He(), Ye(), Ge(Q), u.add(_ || D, "gu-transit"), Rt(), Bt(), ie = 0, Ae(b);
1931
- }
1932
- }
1933
- }
1934
- function De(b) {
1935
- if (!(K.dragging && y) && !Me(b)) {
1936
- for (var M = b; s(b) && Me(s(b)) === !1; )
1937
- if (F.invalid(b, M) || (b = s(b), !b))
1938
- return;
1939
- var R = s(b);
1940
- if (R && !F.invalid(b, M)) {
1941
- var $ = F.moves(b, R, M, k(b));
1942
- if ($)
1943
- return {
1944
- item: b,
1945
- source: R
1946
- };
1947
- }
1948
- }
1949
- }
1950
- function Et(b) {
1951
- return !!De(b);
1952
- }
1953
- function It(b) {
1954
- var M = De(b);
1955
- M && Ge(M);
1956
- }
1957
- function Ge(b) {
1958
- $t(b.item, b.source) && (_ = b.item.cloneNode(!0), K.emit("cloned", _, b.item, "copy")), I = b.source, D = b.item, L = V = k(b.item), K.dragging = !0, K.emit("drag", D, I);
1959
- }
1960
- function Pt() {
1961
- return !1;
1962
- }
1963
- function Ye() {
1964
- if (K.dragging) {
1965
- var b = _ || D;
1966
- Qe(b, s(b));
1967
- }
1968
- }
1969
- function Xe() {
1970
- Y = !1, ke(!0), He(!0);
1971
- }
1972
- function Be(b) {
1973
- if (Xe(), !!K.dragging) {
1974
- var M = _ || D, R = C("clientX", b) || 0, $ = C("clientY", b) || 0, Q = j(y, R, $), J = Ke(Q, R, $);
1975
- J && (_ && F.copySortSource || !_ || J !== I) ? Qe(M, J) : F.removeOnSpill ? Je() : Ze();
1976
- }
1977
- }
1978
- function Qe(b, M) {
1979
- var R = s(b);
1980
- _ && F.copySortSource && M === I && R.removeChild(D), Oe(M) ? K.emit("cancel", b, I) : K.emit("drop", b, M, I, V), Re();
1981
- }
1982
- function Je() {
1983
- if (K.dragging) {
1984
- var b = _ || D, M = s(b);
1985
- M && M.removeChild(b), K.emit(_ ? "cancel" : "remove", b, M, I), Re();
1986
- }
1987
- }
1988
- function Ze(b) {
1989
- if (K.dragging) {
1990
- var M = arguments.length > 0 ? b : F.revertOnSpill, R = _ || D, $ = s(R), Q = Oe($);
1991
- Q === !1 && M && (_ ? $ && $.removeChild(_) : I.insertBefore(R, L)), Q || M ? K.emit("cancel", R, I, I) : K.emit("drop", R, $, I, V), Re();
1992
- }
1993
- }
1994
- function Re() {
1995
- var b = _ || D;
1996
- Xe(), Ot(), At(), b && u.rm(b, "gu-transit"), G && clearTimeout(G), K.dragging = !1, z && K.emit("out", b, z, I), K.emit("dragend", b, ie), I = D = _ = L = V = G = z = null;
1997
- }
1998
- function Oe(b, M) {
1999
- var R;
2000
- return M !== void 0 ? R = M : y ? R = V : R = k(_ || D), b === I && R === L;
2001
- }
2002
- function Ke(b, M, R) {
2003
- for (var $ = b; $ && !Q(); )
2004
- $ = s($);
2005
- return $;
2006
- function Q() {
2007
- var J = Me($);
2008
- if (J === !1)
2009
- return !1;
2010
- var ae = et($, b), oe = tt($, ae, M, R), le = Oe($, oe);
2011
- return le ? !0 : F.accepts(D, $, I, oe);
2012
- }
2013
- }
2014
- function Ae(b) {
2015
- if (!y)
2016
- return;
2017
- b.preventDefault();
2018
- var M = C("clientX", b) || 0, R = C("clientY", b) || 0;
2019
- y.style.left = M - 2 + "px", y.style.top = R - 2 + "px";
2020
- var $ = _ || D, Q = j(y, M, R), J = Ke(Q, M, R), ae = J !== null && J !== z;
2021
- (ae || J === null) && (se(), z = J, de()), Ft(Q, R);
2022
- var oe = s($);
2023
- if (J === I && _ && !F.copySortSource) {
2024
- oe && oe.removeChild($);
2025
- return;
2026
- }
2027
- var le, ue = et(J, Q);
2028
- if (ee = Vt(ue, J), ue !== null)
2029
- le = tt(J, ue, M, R);
2030
- else if (F.revertOnSpill === !0 && !_)
2031
- le = L, J = I;
2032
- else {
2033
- _ && oe && oe.removeChild($), _ && W && (W.style.display = "none");
2034
- return;
2035
- }
2036
- W.style.display = "block", Mt(le, $, ae), le ? jt(ue, le) : Nt(J);
2037
- function te(ne) {
2038
- K.emit(ne, $, z, I);
2039
- }
2040
- function de() {
2041
- ae && te("over");
2042
- }
2043
- function se() {
2044
- z && te("out");
2045
- }
2046
- }
2047
- function Mt(b, M, R) {
2048
- (b === M || b === k(M)) && (V = k(M)), (b === null && R || b !== M && b !== k(M)) && (V = b);
2049
- }
2050
- function kt(b) {
2051
- u.rm(b, "gu-hide");
2052
- }
2053
- function Dt(b) {
2054
- K.dragging && u.add(b, "gu-hide");
2055
- }
2056
- function Bt() {
2057
- y || (y = document.createElement("div"), y.style = "background: grey; color: white; height: 24px; text-align: center; padding: 3px 10px; min-width: 100px;border-radius: 4px; box-shadow: 0 0 6px grey;", y.innerHTML = F.getMirrorText && F.getMirrorText(D) || "控件", u.add(y, "gu-mirror"), F.mirrorContainer.appendChild(y), c(v, "add", "mousemove", Ae), u.add(F.mirrorContainer, "gu-unselectable"), K.emit("cloned", y, D, "mirror"));
2058
- }
2059
- function Rt() {
2060
- if (W = document.createElement("div"), u.add(W, "gu-insertion"), D) {
2061
- var b = D.getBoundingClientRect();
2062
- W.style.left = b.left + "px", W.style.top = b.top + "px";
2063
- }
2064
- ee = !1, F.mirrorContainer.appendChild(W);
2065
- }
2066
- function Ot() {
2067
- y && (u.rm(F.mirrorContainer, "gu-unselectable"), c(v, "remove", "mousemove", Ae), s(y).removeChild(y), y = null);
2068
- }
2069
- function At() {
2070
- W && (s(W).removeChild(W), W = null);
2071
- }
2072
- function et(b, M) {
2073
- for (var R = M; R !== b && s(R) !== b; )
2074
- R = s(R);
2075
- return R === v ? null : R;
2076
- }
2077
- function Vt(b, M) {
2078
- if (!M)
2079
- return ee;
2080
- var R = b || M && M.lastElementChild;
2081
- if (!R)
2082
- return !0;
2083
- var $ = getComputedStyle(b), Q = /^inline/.test($.getPropertyValue("display")) || /^(left|right)$/.test($.getPropertyValue("float"));
2084
- if (Q)
2085
- return !0;
2086
- if (M) {
2087
- var J = getComputedStyle(M), ae = J.getPropertyValue("display");
2088
- if (/flex$/.test(ae)) {
2089
- var oe = J.getPropertyValue("flex-direction") || "row";
2090
- if (oe === "row" || oe === "row-reverse")
2091
- return !_t(M);
2092
- }
2093
- return !1;
2094
- }
2095
- return !0;
2096
- }
2097
- function _t(b) {
2098
- if (!b.children || !b.children.length)
2099
- return !1;
2100
- for (const M of Array.from(b.children)) {
2101
- const $ = (M.className && M.className.split(" ") || []).filter((Q) => /^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(Q));
2102
- if (!$.length)
2103
- return !1;
2104
- for (const Q of $) {
2105
- const J = Q.slice(Q.lastIndexOf("-") + 1);
2106
- if (parseInt(J, 10) !== 12)
2107
- return !1;
2108
- }
2109
- }
2110
- return !0;
2111
- }
2112
- function jt(b, M) {
2113
- const R = M.getBoundingClientRect();
2114
- if (W.style.left = R.left + "px", W.style.top = R.top + "px", ee) {
2115
- if (W.style.height = R.height + "px", W.style.width = "4px", b) {
2116
- const $ = b.getBoundingClientRect();
2117
- $.top !== R.top && (W.style.left = $.right + "px", W.style.top = $.top + "px", W.style.height = $.height + "px");
2118
- }
2119
- } else if (W.style.height = "4px", W.style.width = R.width + "px", Z) {
2120
- const $ = Z.getBoundingClientRect();
2121
- R.top < $.top && (W.style.display = "none");
2122
- }
2123
- M === D && D && (W.style.display = "none");
2124
- }
2125
- function Nt(b) {
2126
- V = null;
2127
- var M = b.lastElementChild;
2128
- if (M) {
2129
- var R = M.getBoundingClientRect();
2130
- ee ? (W.style.left = R.right + "px", W.style.top = R.top + "px", W.style.height = R.height + "px", W.style.width = "4px") : (W.style.left = R.left + "px", W.style.top = R.bottom + "px", W.style.height = "4px", W.style.width = R.width + "px"), M === D && D && (W.style.display = "none");
2131
- } else
2132
- W.style.display = "none";
2133
- }
2134
- function Ft(b, M) {
2135
- if (!F.mirrorContainer.contains(b) || !window.scrollContainerList || !Array.from(window.scrollContainerList).length || (Z = m(b), !Z || !Z.contains(b)))
2136
- return;
2137
- const R = document.querySelector(".dgComponentSelected"), $ = Z.getBoundingClientRect();
2138
- if (M - 30 < $.top && Z.scrollTop > 0) {
2139
- let Q = Z.scrollTop < 10 ? Z.scrollTop : 10;
2140
- Z.scrollBy(0, -1 * Q), R && Z.contains(R) && (ie = ie + -1 * Q);
2141
- }
2142
- if (M + 30 > $.bottom && Z.scrollTop < Z.scrollHeight - Z.clientHeight) {
2143
- const Q = Z.scrollHeight - Z.clientHeight - Z.scrollTop;
2144
- let J = Q < 10 ? Q : 10;
2145
- Z.scrollBy(0, J), R && Z.contains(R) && (ie = ie + J);
2146
- }
2147
- }
2148
- function tt(b, M, R, $) {
2149
- var Q = F.direction === "horizontal", J = F.direction === "mixed", ae = M !== b ? le() : oe();
2150
- return ae;
2151
- function oe() {
2152
- var te = b.children.length, de, se, ne;
2153
- for (de = 0; de < te; de++)
2154
- if (se = b.children[de], ne = se.getBoundingClientRect(), Q && ne.left + ne.width / 2 > R || !J && !Q && ne.top + ne.height / 2 > $ || J && ne.left + ne.width > R && ne.top + ne.height > $)
2155
- return se;
2156
- return null;
2157
- }
2158
- function le() {
2159
- var te = M.getBoundingClientRect();
2160
- if (J) {
2161
- var de = $ - te.top, se = R - te.left, ne = te.bottom - $, Ve = te.right - R, _e = Math.min(se, Ve, de, ne), je;
2162
- return ee ? je = Ve < se : je = ne === _e || Ve === _e || se === _e, ue(je);
2163
- }
2164
- return ue(Q ? R > te.left + B(te) / 2 : $ > te.top + f(te) / 2);
2165
- }
2166
- function ue(te) {
2167
- return te ? k(M) : M;
2168
- }
2169
- }
2170
- function $t(b, M) {
2171
- return typeof F.copy == "boolean" ? F.copy : F.copy(b, M);
2172
- }
2173
- }
2174
- function m(a) {
2175
- const E = Array.from(window.scrollContainerList);
2176
- if (E.length === 1) {
2177
- const y = Array.from(window.scrollContainerList)[0];
2178
- return document.getElementById(y);
2179
- }
2180
- const P = h(E);
2181
- for (const y of P)
2182
- if (y.contains(a))
2183
- return y;
2184
- return null;
2185
- }
2186
- function h(a) {
2187
- const E = [];
2188
- return a.forEach((P) => {
2189
- const y = document.getElementById(P);
2190
- y && E.push(y);
2191
- }), E.sort((P, y) => P.contains(y) ? 1 : y.contains(P) ? -1 : 0), E;
2192
- }
2193
- function c(a, E, P, y) {
2194
- var I = {
2195
- mouseup: "touchend",
2196
- mousedown: "touchstart",
2197
- mousemove: "touchmove"
2198
- }, D = {
2199
- mouseup: "pointerup",
2200
- mousedown: "pointerdown",
2201
- mousemove: "pointermove"
2202
- }, T = {
2203
- mouseup: "MSPointerUp",
2204
- mousedown: "MSPointerDown",
2205
- mousemove: "MSPointerMove"
2206
- };
2207
- i.navigator.pointerEnabled ? g[E](a, D[P], y) : i.navigator.msPointerEnabled ? g[E](a, T[P], y) : (g[E](a, I[P], y), g[E](a, P, y));
2208
- }
2209
- function S(a) {
2210
- if (a.touches !== void 0)
2211
- return a.touches.length;
2212
- if (a.which !== void 0 && a.which !== 0)
2213
- return a.which;
2214
- if (a.buttons !== void 0)
2215
- return a.buttons;
2216
- var E = a.button;
2217
- if (E !== void 0)
2218
- return E & 1 ? 1 : E & 2 ? 3 : E & 4 ? 2 : 0;
2219
- }
2220
- function j(a, E, P) {
2221
- a = a || {};
2222
- var y = a.className || "", I;
2223
- return a.className += " gu-hide", I = d.elementFromPoint(E, P), a.className = y, I;
2224
- }
2225
- function N() {
2226
- return !1;
2227
- }
2228
- function A() {
2229
- return !0;
2230
- }
2231
- function B(a) {
2232
- return a.width || a.right - a.left;
2233
- }
2234
- function f(a) {
2235
- return a.height || a.bottom - a.top;
2236
- }
2237
- function s(a) {
2238
- return a.parentNode === d ? null : a.parentNode;
2239
- }
2240
- function w(a) {
2241
- return a.tagName === "INPUT" || a.tagName === "TEXTAREA" || a.tagName === "SELECT" || x(a);
2242
- }
2243
- function x(a) {
2244
- return !a || a.contentEditable === "false" ? !1 : a.contentEditable === "true" ? !0 : x(s(a));
2245
- }
2246
- function k(a) {
2247
- return a.nextElementSibling || E();
2248
- function E() {
2249
- var P = a;
2250
- do
2251
- P = P.nextSibling;
2252
- while (P && P.nodeType !== 1);
2253
- return P;
2254
- }
2255
- }
2256
- function H(a) {
2257
- return a.targetTouches && a.targetTouches.length ? a.targetTouches[0] : a.changedTouches && a.changedTouches.length ? a.changedTouches[0] : a;
2258
- }
2259
- function C(a, E) {
2260
- var P = H(E), y = {
2261
- pageX: "clientX",
2262
- // IE8
2263
- pageY: "clientY"
2264
- // IE8
2265
- };
2266
- return a in y && !(a in P) && y[a] in P && (a = y[a]), P[a];
2267
- }
2268
- n.exports = p;
2269
- }).call(this, typeof fe < "u" ? fe : typeof self < "u" ? self : typeof window < "u" ? window : {});
2270
- }, { "./classes": 1, "contra/emitter": 5, crossvent: 6 }],
2271
- 3: [function(e, n, r) {
2272
- n.exports = function(l, g) {
2273
- return Array.prototype.slice.call(l, g);
2274
- };
2275
- }, {}],
2276
- 4: [function(e, n, r) {
2277
- var i = e("ticky");
2278
- n.exports = function(g, u, d) {
2279
- g && i(function() {
2280
- g.apply(d || null, u || []);
2281
- });
2282
- };
2283
- }, { ticky: 10 }],
2284
- 5: [function(e, n, r) {
2285
- var i = e("atoa"), l = e("./debounce");
2286
- n.exports = function(u, d) {
2287
- var v = d || {}, p = {};
2288
- return u === void 0 && (u = {}), u.on = function(m, h) {
2289
- return p[m] ? p[m].push(h) : p[m] = [h], u;
2290
- }, u.once = function(m, h) {
2291
- return h._once = !0, u.on(m, h), u;
2292
- }, u.off = function(m, h) {
2293
- var c = arguments.length;
2294
- if (c === 1)
2295
- delete p[m];
2296
- else if (c === 0)
2297
- p = {};
2298
- else {
2299
- var S = p[m];
2300
- if (!S)
2301
- return u;
2302
- S.splice(S.indexOf(h), 1);
2303
- }
2304
- return u;
2305
- }, u.emit = function() {
2306
- var m = i(arguments);
2307
- return u.emitterSnapshot(m.shift()).apply(this, m);
2308
- }, u.emitterSnapshot = function(m) {
2309
- var h = (p[m] || []).slice(0);
2310
- return function() {
2311
- var c = i(arguments), S = this || u;
2312
- if (m === "error" && v.throws !== !1 && !h.length)
2313
- throw c.length === 1 ? c[0] : c;
2314
- return h.forEach(function(N) {
2315
- v.async ? l(N, c, S) : N.apply(S, c), N._once && u.off(m, N);
2316
- }), u;
2317
- };
2318
- }, u;
2319
- };
2320
- }, { "./debounce": 4, atoa: 3 }],
2321
- 6: [function(e, n, r) {
2322
- (function(i) {
2323
- var l = e("custom-event"), g = e("./eventmap"), u = i.document, d = m, v = c, p = [];
2324
- i.addEventListener || (d = h, v = S), n.exports = {
2325
- add: d,
2326
- remove: v,
2327
- fabricate: j
2328
- };
2329
- function m(s, w, x, k) {
2330
- return s.addEventListener(w, x, k);
2331
- }
2332
- function h(s, w, x) {
2333
- return s.attachEvent("on" + w, A(s, w, x));
2334
- }
2335
- function c(s, w, x, k) {
2336
- return s.removeEventListener(w, x, k);
2337
- }
2338
- function S(s, w, x) {
2339
- var k = B(s, w, x);
2340
- if (k)
2341
- return s.detachEvent("on" + w, k);
2342
- }
2343
- function j(s, w, x) {
2344
- var k = g.indexOf(w) === -1 ? C() : H();
2345
- s.dispatchEvent ? s.dispatchEvent(k) : s.fireEvent("on" + w, k);
2346
- function H() {
2347
- var a;
2348
- return u.createEvent ? (a = u.createEvent("Event"), a.initEvent(w, !0, !0)) : u.createEventObject && (a = u.createEventObject()), a;
2349
- }
2350
- function C() {
2351
- return new l(w, { detail: x });
2352
- }
2353
- }
2354
- function N(s, w, x) {
2355
- return function(H) {
2356
- var C = H || i.event;
2357
- C.target = C.target || C.srcElement, C.preventDefault = C.preventDefault || function() {
2358
- C.returnValue = !1;
2359
- }, C.stopPropagation = C.stopPropagation || function() {
2360
- C.cancelBubble = !0;
2361
- }, C.which = C.which || C.keyCode, x.call(s, C);
2362
- };
2363
- }
2364
- function A(s, w, x) {
2365
- var k = B(s, w, x) || N(s, w, x);
2366
- return p.push({
2367
- wrapper: k,
2368
- element: s,
2369
- type: w,
2370
- fn: x
2371
- }), k;
2372
- }
2373
- function B(s, w, x) {
2374
- var k = f(s, w, x);
2375
- if (k) {
2376
- var H = p[k].wrapper;
2377
- return p.splice(k, 1), H;
2378
- }
2379
- }
2380
- function f(s, w, x) {
2381
- var k, H;
2382
- for (k = 0; k < p.length; k++)
2383
- if (H = p[k], H.element === s && H.type === w && H.fn === x)
2384
- return k;
2385
- }
2386
- }).call(this, typeof fe < "u" ? fe : typeof self < "u" ? self : typeof window < "u" ? window : {});
2387
- }, { "./eventmap": 7, "custom-event": 8 }],
2388
- 7: [function(e, n, r) {
2389
- (function(i) {
2390
- var l = [], g = "", u = /^on/;
2391
- for (g in i)
2392
- u.test(g) && l.push(g.slice(2));
2393
- n.exports = l;
2394
- }).call(this, typeof fe < "u" ? fe : typeof self < "u" ? self : typeof window < "u" ? window : {});
2395
- }, {}],
2396
- 8: [function(e, n, r) {
2397
- (function(i) {
2398
- var l = i.CustomEvent;
2399
- function g() {
2400
- try {
2401
- var u = new l("cat", { detail: { foo: "bar" } });
2402
- return u.type === "cat" && u.detail.foo === "bar";
2403
- } catch {
2404
- }
2405
- return !1;
2406
- }
2407
- n.exports = g() ? l : (
2408
- // IE >= 9
2409
- typeof document < "u" && typeof document.createEvent == "function" ? function(d, v) {
2410
- var p = document.createEvent("CustomEvent");
2411
- return v ? p.initCustomEvent(d, v.bubbles, v.cancelable, v.detail) : p.initCustomEvent(d, !1, !1, void 0), p;
2412
- } : (
2413
- // IE <= 8
2414
- function(d, v) {
2415
- var p = document.createEventObject();
2416
- return p.type = d, v ? (p.bubbles = !!v.bubbles, p.cancelable = !!v.cancelable, p.detail = v.detail) : (p.bubbles = !1, p.cancelable = !1, p.detail = void 0), p;
2417
- }
2418
- )
2419
- );
2420
- }).call(this, typeof fe < "u" ? fe : typeof self < "u" ? self : typeof window < "u" ? window : {});
2421
- }, {}],
2422
- 9: [function(e, n, r) {
2423
- var i = n.exports = {}, l, g;
2424
- function u() {
2425
- throw new Error("setTimeout has not been defined");
2426
- }
2427
- function d() {
2428
- throw new Error("clearTimeout has not been defined");
2429
- }
2430
- (function() {
2431
- try {
2432
- typeof setTimeout == "function" ? l = setTimeout : l = u;
2433
- } catch {
2434
- l = u;
2435
- }
2436
- try {
2437
- typeof clearTimeout == "function" ? g = clearTimeout : g = d;
2438
- } catch {
2439
- g = d;
2440
- }
2441
- })();
2442
- function v(f) {
2443
- if (l === setTimeout)
2444
- return setTimeout(f, 0);
2445
- if ((l === u || !l) && setTimeout)
2446
- return l = setTimeout, setTimeout(f, 0);
2447
- try {
2448
- return l(f, 0);
2449
- } catch {
2450
- try {
2451
- return l.call(null, f, 0);
2452
- } catch {
2453
- return l.call(this, f, 0);
2454
- }
2455
- }
2456
- }
2457
- function p(f) {
2458
- if (g === clearTimeout)
2459
- return clearTimeout(f);
2460
- if ((g === d || !g) && clearTimeout)
2461
- return g = clearTimeout, clearTimeout(f);
2462
- try {
2463
- return g(f);
2464
- } catch {
2465
- try {
2466
- return g.call(null, f);
2467
- } catch {
2468
- return g.call(this, f);
2469
- }
2470
- }
2471
- }
2472
- var m = [], h = !1, c, S = -1;
2473
- function j() {
2474
- !h || !c || (h = !1, c.length ? m = c.concat(m) : S = -1, m.length && N());
2475
- }
2476
- function N() {
2477
- if (!h) {
2478
- var f = v(j);
2479
- h = !0;
2480
- for (var s = m.length; s; ) {
2481
- for (c = m, m = []; ++S < s; )
2482
- c && c[S].run();
2483
- S = -1, s = m.length;
2484
- }
2485
- c = null, h = !1, p(f);
2486
- }
2487
- }
2488
- i.nextTick = function(f) {
2489
- var s = new Array(arguments.length - 1);
2490
- if (arguments.length > 1)
2491
- for (var w = 1; w < arguments.length; w++)
2492
- s[w - 1] = arguments[w];
2493
- m.push(new A(f, s)), m.length === 1 && !h && v(N);
2494
- };
2495
- function A(f, s) {
2496
- this.fun = f, this.array = s;
2497
- }
2498
- A.prototype.run = function() {
2499
- this.fun.apply(null, this.array);
2500
- }, i.title = "browser", i.browser = !0, i.env = {}, i.argv = [], i.version = "", i.versions = {};
2501
- function B() {
2502
- }
2503
- i.on = B, i.addListener = B, i.once = B, i.off = B, i.removeListener = B, i.removeAllListeners = B, i.emit = B, i.prependListener = B, i.prependOnceListener = B, i.listeners = function(f) {
2504
- return [];
2505
- }, i.binding = function(f) {
2506
- throw new Error("process.binding is not supported");
2507
- }, i.cwd = function() {
2508
- return "/";
2509
- }, i.chdir = function(f) {
2510
- throw new Error("process.chdir is not supported");
2511
- }, i.umask = function() {
2512
- return 0;
2513
- };
2514
- }, {}],
2515
- 10: [function(e, n, r) {
2516
- (function(i) {
2517
- var l = typeof i == "function", g;
2518
- l ? g = function(u) {
2519
- i(u);
2520
- } : g = function(u) {
2521
- setTimeout(u, 0);
2522
- }, n.exports = g;
2523
- }).call(this, e("timers").setImmediate);
2524
- }, { timers: 11 }],
2525
- 11: [function(e, n, r) {
2526
- (function(i, l) {
2527
- var g = e("process/browser.js").nextTick, u = Function.prototype.apply, d = Array.prototype.slice, v = {}, p = 0;
2528
- r.setTimeout = function() {
2529
- return new m(u.call(setTimeout, window, arguments), clearTimeout);
2530
- }, r.setInterval = function() {
2531
- return new m(u.call(setInterval, window, arguments), clearInterval);
2532
- }, r.clearTimeout = r.clearInterval = function(h) {
2533
- h.close();
2534
- };
2535
- function m(h, c) {
2536
- this._id = h, this._clearFn = c;
2537
- }
2538
- m.prototype.unref = m.prototype.ref = function() {
2539
- }, m.prototype.close = function() {
2540
- this._clearFn.call(window, this._id);
2541
- }, r.enroll = function(h, c) {
2542
- clearTimeout(h._idleTimeoutId), h._idleTimeout = c;
2543
- }, r.unenroll = function(h) {
2544
- clearTimeout(h._idleTimeoutId), h._idleTimeout = -1;
2545
- }, r._unrefActive = r.active = function(h) {
2546
- clearTimeout(h._idleTimeoutId);
2547
- var c = h._idleTimeout;
2548
- c >= 0 && (h._idleTimeoutId = setTimeout(function() {
2549
- h._onTimeout && h._onTimeout();
2550
- }, c));
2551
- }, r.setImmediate = typeof i == "function" ? i : function(h) {
2552
- var c = p++, S = arguments.length < 2 ? !1 : d.call(arguments, 1);
2553
- return v[c] = !0, g(function() {
2554
- v[c] && (S ? h.apply(null, S) : h.call(null), r.clearImmediate(c));
2555
- }), c;
2556
- }, r.clearImmediate = typeof l == "function" ? l : function(h) {
2557
- delete v[h];
2558
- };
2559
- }).call(this, e("timers").setImmediate, e("timers").clearImmediate);
2560
- }, { "process/browser.js": 9, timers: 11 }]
2561
- }, {}, [2])(2);
2562
- });
2563
- })(Ct);
2564
- var zn = Ct.exports;
2565
- const rt = /* @__PURE__ */ Hn(zn);
2566
- function Gn(o) {
2567
- let t;
2568
- function e(r, i, l, g) {
2569
- const u = o.schema;
2570
- if (!(u != null && u.buttons))
2571
- return;
2572
- let d;
2573
- if (l) {
2574
- const h = l.getAttribute("id");
2575
- d = Array.from(i.children).findIndex((c) => c.getAttribute("id") === h);
2576
- } else
2577
- d = Array.from(i.children).length;
2578
- const v = r.getAttribute("id"), p = Array.from(i.children).findIndex((h) => h.getAttribute("id") === v), m = u.buttons[p];
2579
- p !== d && p > -1 && d > -1 && (p < d && (d = d - 1), u.buttons.splice(p, 1), u.buttons.splice(d, 0, m), g(), me(() => {
2580
- const h = i.querySelector(".dgComponentSelected");
2581
- h != null && h.className.includes("dgComponentSelected") && (h.classList.remove("dgComponentSelected"), h.classList.remove("dgComponentFocused"), h.click()), ve.value++;
2582
- }));
2583
- }
2584
- function n(r, i, l) {
2585
- t && t.destroy(), !(!rt || !r || !i) && (t = rt([r], {
2586
- mirrorContainer: i,
2587
- direction: "horizontal",
2588
- getMirrorText(g) {
2589
- return g.innerText;
2590
- },
2591
- // 判断是否可移动
2592
- moves(g, u, d) {
2593
- let v = !0;
2594
- return d.classList.contains("dropdown-item") ? (v = !1, v) : (g.classList.contains("no-drag") && (v = !1), v);
2595
- }
2596
- }).on("drop", (g, u, d, v) => e(g, u, v, l)));
2597
- }
2598
- return {
2599
- dragulaInstance: t,
2600
- initDragula: n
2601
- };
2602
- }
2603
- function Yn(o, t, e) {
2604
- const {
2605
- renderToolbarItemDesigner: n,
2606
- actionHandlers: r
2607
- } = e;
2608
- let i;
2609
- function l(A) {
2610
- i = A;
2611
- }
2612
- function g(A, B = null) {
2613
- const f = t.value.find((s) => s.id === A.id);
2614
- if (f.isDP)
2615
- if (document.body.click(), typeof B == "boolean")
2616
- f.expanded = B;
2617
- else {
2618
- const s = A.expanded;
2619
- f.expanded = !s;
2620
- }
2621
- }
2622
- r.toggleDropdownMenu = g;
2623
- function u(A) {
2624
- var f;
2625
- const B = {
2626
- "dropdown-menu": !0
2627
- };
2628
- if (A.class) {
2629
- const s = (f = A.menuClass) == null ? void 0 : f.split(" ");
2630
- s && s.length && s.reduce((w, x) => (w[x] = !0, w), B);
2631
- }
2632
- return B;
2633
- }
2634
- function d(A) {
2635
- var s;
2636
- const B = {
2637
- disabled: A.disabled === !1,
2638
- "dropdown-submenu": !0,
2639
- "f-rt-dropdown": !0,
2640
- "text-truncate": !0
2641
- }, f = (s = A.dropdownClass) == null ? void 0 : s.split(" ");
2642
- return f && f.length && f.reduce((w, x) => (w[x] = !0, w), B), B;
2643
- }
2644
- function v(A) {
2645
- const B = {
2646
- disabled: !1,
2647
- "dropdown-item": !0,
2648
- "f-rt-btn": !0,
2649
- "position-relative": !0,
2650
- "farris-component": !0,
2651
- "text-truncate": !0
2652
- }, f = (A.class || "").split(" ");
2653
- return f && f.length && f.reduce((s, w) => (s[w] = !0, s), B), B;
2654
- }
2655
- let p;
2656
- const m = /* @__PURE__ */ new Map();
2657
- function h(A, B, f) {
2658
- A.stopPropagation();
2659
- const s = f ? f.id : "__top_item__";
2660
- if (B.children && B.children.length && (B.expanded = !B.expanded, B.expanded)) {
2661
- if (m.has(s) && m.get(s) !== B) {
2662
- const w = m.get(s);
2663
- w && (w.expanded = !1, m.delete(s));
2664
- }
2665
- m.set(s, B);
2666
- }
2667
- }
2668
- function c(A) {
2669
- var B;
2670
- return (B = A.children) == null ? void 0 : B.map((f, s) => f.children && f.children.length ? O("li", {
2671
- class: d(f),
2672
- id: f.id
2673
- }, [O("span", {
2674
- class: v(f),
2675
- onClick: (w) => h(w, f, A)
2676
- }, [f.text, O("i", {
2677
- class: "f-icon f-icon-arrow-chevron-right",
2678
- style: "display: inline-block;float: right;line-height: 1.25rem;"
2679
- }, null)]), p(f, f)]) : n(f, s, !0));
2680
- }
2681
- function S(A, B, f, s) {
2682
- const {
2683
- height: k,
2684
- left: H,
2685
- top: C
2686
- } = s[0], {
2687
- width: a,
2688
- height: E
2689
- } = f.getBoundingClientRect(), {
2690
- marginTop: P,
2691
- marginBottom: y
2692
- } = getComputedStyle(f), I = Math.ceil(parseFloat(P)) + Math.ceil(parseFloat(y)), D = C + k, T = B == null ? void 0 : B.getBoundingClientRect();
2693
- function q() {
2694
- let G = 0, z = "left";
2695
- const Y = T ? T.right : window.innerWidth, W = T ? T.left : 0;
2696
- return G = Y - H - 10, Y - H < a && H - W > Y - H && (z = "right", G = H - W - 10), {
2697
- hposition: z,
2698
- maxWidth: Math.min(G, 300)
2699
- };
2700
- }
2701
- let L = 0, V = "bottom";
2702
- if (A === "tabs" || A === "section")
2703
- L = B.getBoundingClientRect().bottom - D - I - 10;
2704
- else {
2705
- const G = T ? T.bottom : window.innerHeight;
2706
- L = A === "page-header" ? G - D : C, L = L - I - 10, V = A === "page-header" ? "bottom" : "top";
2707
- }
2708
- const _ = q();
2709
- return {
2710
- position: V + "-" + _.hposition,
2711
- maxWidth: _.maxWidth,
2712
- maxHeight: L
2713
- };
2714
- }
2715
- function j(A) {
2716
- var x, k, H;
2717
- const B = "300px", f = {
2718
- display: A.expanded === !0 ? "block" : "none",
2719
- position: "absolute",
2720
- maxWidth: B,
2721
- minWidth: "120px"
2722
- };
2723
- if (!(i != null && i.value))
2724
- return f;
2725
- const s = i.value.querySelector("#" + A.id), w = s == null ? void 0 : s.getClientRects();
2726
- if (s && w && w.length > 0) {
2727
- const C = s ? s.querySelector("#" + A.id + "_menu") : null;
2728
- if (!C || A.expanded !== !0)
2729
- return f;
2730
- C.style.visibility = "hidden", C.style.display = "block", C.style.maxHeight = "auto", C.style.maxWidth = B;
2731
- let a;
2732
- switch (r.toolbarPosition) {
2733
- case "tabs":
2734
- a = (x = i.value) == null ? void 0 : x.closest(".farris-tabs");
2735
- break;
2736
- case "section":
2737
- a = (k = i.value) == null ? void 0 : k.closest(".f-section");
2738
- break;
2739
- default:
2740
- a = (H = i.value) == null ? void 0 : H.closest(".f-page");
2741
- }
2742
- const E = S(r.toolbarPosition, a, C, w), {
2743
- position: P,
2744
- maxHeight: y,
2745
- maxWidth: I
2746
- } = E;
2747
- C.style.visibility = "visible";
2748
- const D = {
2749
- left: P.indexOf("left") > -1 ? 0 : "unset",
2750
- right: P.indexOf("left") > -1 ? "unset" : 0,
2751
- bottom: P.indexOf("bottom") > -1 ? "unset" : "100%",
2752
- top: P.indexOf("bottom") > -1 ? "!00%" : "unset",
2753
- maxWidth: I ? I + "px" : "300px",
2754
- maxHeight: y ? y + "px" : "auto",
2755
- overflowY: y ? "auto" : "unset"
2756
- };
2757
- Object.assign(f, D);
2758
- }
2759
- return f;
2760
- }
2761
- r.changeMenuPosition = j, p = function(A, B) {
2762
- return O("ul", {
2763
- class: u(A),
2764
- style: j(A),
2765
- id: A.id + "_menu"
2766
- }, [c(A)]);
2767
- };
2768
- function N(A = "") {
2769
- A && m.has(A) ? m.forEach((B, f) => {
2770
- f !== A && (B.expanded = !1, m.delete(f));
2771
- }) : (m.forEach((B) => {
2772
- B.expanded = !1;
2773
- }), m.clear());
2774
- }
2775
- return {
2776
- renderDropdownMenu: p,
2777
- clearAllDropDownMenu: N,
2778
- setResponseToolbarRef: l
2779
- };
2780
- }
2781
- const Xn = {
2782
- id: { type: String, default: "" },
2783
- componentId: { type: String, default: "" },
2784
- canAdd: { type: Boolean, default: !1 },
2785
- canDelete: { type: Boolean, default: !1 },
2786
- canMove: { type: Boolean, default: !1 },
2787
- contentKey: { type: String, default: "contents" },
2788
- childLabel: { type: String, default: "" },
2789
- childType: { type: String, default: "" },
2790
- /**
2791
- * 组件值
2792
- */
2793
- modelValue: { type: Object }
2794
- };
2795
- function Qn(o, t, e) {
2796
- var w;
2797
- const n = "", r = X();
2798
- function i() {
2799
- return !0;
2800
- }
2801
- function l() {
2802
- return !1;
2803
- }
2804
- function g() {
2805
- return !0;
2806
- }
2807
- function u() {
2808
- return !0;
2809
- }
2810
- function d() {
2811
- return !0;
2812
- }
2813
- function v(x) {
2814
- if (!x || !x.value)
2815
- return null;
2816
- const k = X(x == null ? void 0 : x.value.parent), H = v(k);
2817
- return H || null;
2818
- }
2819
- function p(x = t) {
2820
- var a;
2821
- const { componentInstance: k, designerItemElementRef: H } = x;
2822
- if (!k || !k.value)
2823
- return null;
2824
- const { getCustomButtons: C } = k.value;
2825
- return k.value.canMove || k.value.canAdd || k.value.canDelete || C && ((a = C()) != null && a.length) ? H : p(x.parent);
2826
- }
2827
- function m() {
2828
- }
2829
- function h(x) {
2830
- return !!e;
2831
- }
2832
- function c() {
2833
- return (t == null ? void 0 : t.schema.label) || (t == null ? void 0 : t.schema.title) || (t == null ? void 0 : t.schema.name);
2834
- }
2835
- function S() {
2836
- }
2837
- function j(x, k) {
2838
- }
2839
- function N(x) {
2840
- const { componentType: k } = x, H = ce("designer-host-service");
2841
- let C = be(k, x, H);
2842
- const a = k.toLowerCase().replace(/-/g, "_");
2843
- return C && !C.id && C.type === k && (C.id = `${a}_${Math.random().toString().slice(2, 6)}`), C;
2844
- }
2845
- function A(x) {
2846
- }
2847
- function B(...x) {
2848
- return [];
2849
- }
2850
- function f() {
2851
- }
2852
- function s(x) {
2853
- }
2854
- return r.value = {
2855
- canMove: i(),
2856
- canSelectParent: l(),
2857
- canAdd: u(),
2858
- canDelete: g(),
2859
- canNested: !d(),
2860
- contents: [],
2861
- elementRef: o,
2862
- parent: (w = t.parent) == null ? void 0 : w.componentInstance,
2863
- schema: t.schema,
2864
- styles: n,
2865
- canAccepts: h,
2866
- getBelongedComponentInstance: v,
2867
- getDraggableDesignItemElement: p,
2868
- getDraggingDisplayText: c,
2869
- getPropConfig: B,
2870
- getDragScopeElement: S,
2871
- onAcceptMovedChildElement: j,
2872
- onChildElementMovedOut: A,
2873
- addNewChildComponentSchema: N,
2874
- onRemoveComponent: f,
2875
- triggerBelongedComponentToMoveWhenMoved: X(!1),
2876
- triggerBelongedComponentToDeleteWhenDeleted: X(!1),
2877
- onPropertyChanged: s,
2878
- getCustomButtons: m
2879
- }, r;
2880
- }
2881
- const Jn = /* @__PURE__ */ Ie({
2882
- name: "FDesignerInnerItem",
2883
- props: Xn,
2884
- emits: ["selectionChange", "addComponent", "removeComponent", "clickButton"],
2885
- setup(o, t) {
2886
- const e = X(o.canMove), n = X(o.canAdd), r = X(o.canDelete), i = X(!1), l = X(o.contentKey), g = X(o.childType), u = X(o.childLabel), d = X(o.modelValue), v = X(""), p = X(), m = ce("canvas-dragula"), h = X(), c = ce("design-item-context"), S = {
2887
- designerItemElementRef: p,
2888
- componentInstance: h,
2889
- schema: d.value,
2890
- parent: c,
2891
- setupContext: t
2892
- };
2893
- at("design-item-context", S);
2894
- const j = re(() => {
2895
- var D;
2896
- const y = ((D = h.value) == null ? void 0 : D.getCustomButtons) && h.value.getCustomButtons();
2897
- return {
2898
- "farris-component": !0,
2899
- // 受position-relative影响,整个容器的高度不能被撑起
2900
- "flex-fill": o.id === "root-component",
2901
- "position-relative": e.value || r.value || (y == null ? void 0 : y.length),
2902
- "farris-nested": i.value,
2903
- "can-move": e.value,
2904
- "d-none": p.value && p.value.classList.contains("d-none")
2905
- };
2906
- }), N = re(() => {
2907
- const y = {};
2908
- return v.value && v.value.split(";").reduce((I, D) => {
2909
- const [T, q] = D.split(":");
2910
- return T && (I[T] = q), I;
2911
- }, y), y;
2912
- });
2913
- function A(y, I) {
2914
- if (c && c.schema[l.value]) {
2915
- const D = c.schema[l.value].findIndex((T) => T.id === I.id);
2916
- if (D > -1) {
2917
- const T = c.schema[l.value].length, q = c.schema[l.value][D % T];
2918
- c.designerItemElementRef.value.querySelector(`#${q.id}-design-item`), c.schema[l.value].splice(D, 1), ve.value++, t.emit("removeComponent"), t.emit("selectionChange");
2919
- }
2920
- }
2921
- }
2922
- function B(y) {
2923
- if (h.value.addNewChildComponentSchema) {
2924
- const I = {
2925
- componentType: g.value,
2926
- label: u.value,
2927
- parentComponentInstance: h.value,
2928
- targetPosition: -1
2929
- }, D = h.value.addNewChildComponentSchema(I);
2930
- d.value[l.value].push(D), t.emit("addComponent");
2931
- }
2932
- }
2933
- function f() {
2934
- return n.value && O("div", {
2935
- role: "button",
2936
- class: "btn component-settings-button",
2937
- title: "新增",
2938
- ref: "removeComponent",
2939
- onClick: (y) => {
2940
- B();
2941
- }
2942
- }, [O("i", {
2943
- class: "f-icon f-icon-plus-circle"
2944
- }, null)]);
2945
- }
2946
- function s(y) {
2947
- return r.value && O("div", {
2948
- role: "button",
2949
- class: "btn component-settings-button",
2950
- title: "删除",
2951
- ref: "removeComponent",
2952
- onClick: Ht((I) => A(I, y), ["stop"])
2953
- }, [O("i", {
2954
- class: "f-icon f-icon-yxs_delete"
2955
- }, null)]);
2956
- }
2957
- function w() {
2958
- return e.value && O("div", {
2959
- role: "button",
2960
- class: "btn component-settings-button",
2961
- title: "移动",
2962
- ref: "moveComponent"
2963
- }, [O("i", {
2964
- "data-dragging-icon": "true",
2965
- class: "cmp_move f-icon f-icon-yxs_move"
2966
- }, null)]);
2967
- }
2968
- function x() {
2969
- var I;
2970
- const y = ((I = h.value) == null ? void 0 : I.getCustomButtons) && h.value.getCustomButtons();
2971
- return y && !!y.length && y.map((D) => O("div", {
2972
- role: "button",
2973
- class: `btn component-settings-button ${D.class || ""} ${D.text ? "settings-button-extend" : ""}`,
2974
- title: D.title,
2975
- ref: D.id,
2976
- onClick: (T) => D.onClick && D.onClick(T)
2977
- }, [O("i", {
2978
- class: "f-icon " + D.icon
2979
- }, null), D.text && O("span", {
2980
- class: "icon-text"
2981
- }, [D.text])]));
2982
- }
2983
- function k(y) {
2984
- return O("div", {
2985
- class: "component-btn-group",
2986
- "data-noattach": "true"
2987
- }, [O("div", null, [f(), w(), s(y), x()])]);
2988
- }
2989
- Se(() => o.modelValue, (y) => {
2990
- d.value = y, S.schema = y;
2991
- });
2992
- function H(y) {
2993
- window.scrollContainerList || (window.scrollContainerList = /* @__PURE__ */ new Set());
2994
- const I = y.getAttribute("id");
2995
- I && window.scrollContainerList.add(I);
2996
- }
2997
- function C(y) {
2998
- const I = y.target;
2999
- H(I), $n(I);
3000
- }
3001
- function a() {
3002
- var y, I;
3003
- (I = (y = d.value) == null ? void 0 : y.contents) != null && I.length && p.value && p.value.addEventListener("scroll", C);
3004
- }
3005
- function E() {
3006
- const y = p.value, I = X(y.children[1]);
3007
- return Qn(I, S).value;
3008
- }
3009
- Pe(() => {
3010
- if (p.value) {
3011
- const y = p.value.querySelector(`[data-dragref='${d.value.id}-container']`);
3012
- h.value = y && y.componentInstance ? y.componentInstance.value : E(), m && y && m.attachComponents(y, d.value), i.value = h.value.canNested !== void 0 ? h.value.canNested : i.value, n.value = h.value.canAdd !== void 0 ? h.value.canAdd : n.value, r.value = h.value.canDelete !== void 0 ? h.value.canDelete : r.value, e.value = h.value.canMove !== void 0 ? h.value.canMove : e.value, v.value = h.value.styles || "", p.value && (p.value.componentInstance = h, p.value.designItemContext = S);
3013
- }
3014
- a(), ve.value++;
3015
- }), Ut(() => {
3016
- p.value && p.value.removeEventListener("scroll", C);
3017
- });
3018
- function P(y) {
3019
- y && (y.preventDefault(), y.stopPropagation());
3020
- let I = S.designerItemElementRef;
3021
- const D = p.value;
3022
- if (D) {
3023
- const T = document.getElementsByClassName("dgComponentFocused");
3024
- T && T.length === 1 && T[0] === p.value && p.value.classList.contains("dgComponentSelected") || (Array.from(T).forEach((L) => L.classList.remove("dgComponentFocused")), Array.from(document.getElementsByClassName("dgComponentSelected")).forEach((L) => L.classList.remove("dgComponentSelected")), D.classList.add("dgComponentFocused"), t.emit("selectionChange", d.value.type, d.value, o.componentId, h.value), h.value.getDraggableDesignItemElement && (I = h.value.getDraggableDesignItemElement(S), I && I.value && I.value.classList.add("dgComponentSelected")));
3025
- }
3026
- bt(I == null ? void 0 : I.value);
3027
- }
3028
- return () => O("div", {
3029
- id: `${o.id}-design-item`,
3030
- ref: p,
3031
- class: j.value,
3032
- style: N.value,
3033
- onClick: P
3034
- }, [k(d.value), t.slots.default && t.slots.default()]);
3035
- }
3036
- });
3037
- class Zn extends Qt {
3038
- constructor(t, e) {
3039
- super(t, e);
3040
- }
3041
- getPropertyConfig(t, e = !1) {
3042
- return this.propertyConfig.categories.basic = this.getBasicPropConfig(t), this.propertyConfig.categories.basic.properties.text = {
3043
- title: "文本",
3044
- type: "string",
3045
- description: "",
3046
- refreshPanelAfterChanged: !0
3047
- }, this.getAppearanceProperties(t, e), this.getbBehaviorConfig(t), this.getEventPropConfig(t), this.propertyConfig;
3048
- }
3049
- getAppearanceProperties(t, e = !1) {
3050
- this.propertyConfig.categories.appearance = {
3051
- title: "外观",
3052
- properties: {
3053
- class: {
3054
- description: "组件的CSS样式",
3055
- title: "class样式",
3056
- visible: !e
3057
- },
3058
- icon: {
3059
- title: "图标",
3060
- type: "string",
3061
- description: ""
3062
- },
3063
- split: {
3064
- title: "下拉按钮分离",
3065
- type: "boolean",
3066
- description: "启用下拉按钮分离,可以单独点击按钮。单独点击下拉按钮展开下拉面板",
3067
- visible: !!(t.children && t.children.length > 0)
3068
- }
3069
- }
3070
- };
3071
- }
3072
- getbBehaviorConfig(t) {
3073
- const e = this.getPropertyEditorParams(t, ["Const", "Variable", "StateMachine", "Expression"], "disabled");
3074
- this.propertyConfig.categories.behavior = this.getBehaviorConfig(t, "", {
3075
- disabled: {
3076
- title: "禁用",
3077
- type: "boolean",
3078
- description: "按钮禁用状态",
3079
- refreshPanelAfterChanged: !0,
3080
- editor: e
3081
- }
3082
- });
3083
- }
3084
- getEventPropConfig(t) {
3085
- const e = [
3086
- {
3087
- label: "onClick",
3088
- name: "点击事件"
3089
- }
3090
- ], n = this, r = n.eventsEditorUtils.formProperties(t, n.viewModelId, e), i = {};
3091
- i[n.viewModelId] = {
3092
- type: "events-editor",
3093
- editor: {
3094
- initialData: r
3095
- }
3096
- }, this.propertyConfig.categories.eventsEditor = {
3097
- title: "事件",
3098
- hideTitle: !0,
3099
- properties: i,
3100
- // 这个属性,标记当属性变更得时候触发重新更新属性
3101
- refreshPanelAfterChanged: !0,
3102
- tabId: "commands",
3103
- tabName: "交互",
3104
- setPropertyRelates(l, g) {
3105
- const u = l.propertyValue;
3106
- delete t[n.viewModelId], u && (u.setPropertyRelates = this.setPropertyRelates, n.eventsEditorUtils.saveRelatedParameters(t, n.viewModelId, u.events, u));
3107
- }
3108
- };
3109
- }
3110
- }
3111
- class Kn extends yt {
3112
- constructor(e, n, r = "response-toolbar-item") {
3113
- super(e, n);
3114
- U(this, "toolbarType", "response-toolbar-item");
3115
- this.toolbarType = r;
3116
- }
3117
- /**
3118
- *
3119
- * @param propertyData
3120
- * @param isDropdownItem 是否是下拉子项,有些属性在下拉子项上不应该显示
3121
- * @returns
3122
- */
3123
- getPropertyConfig(e, n = !1) {
3124
- this.propertyConfig.categories.basic = this.getBasicPropConfig(e), this.propertyConfig.categories.basic.properties.text = {
3125
- title: "文本",
3126
- type: "string",
3127
- description: "",
3128
- refreshPanelAfterChanged: !0
3129
- }, this.propertyConfig.categories.basic.setPropertyRelates = (i) => {
3130
- if (i)
3131
- switch (i && i.propertyID) {
3132
- case "text": {
3133
- i.needRefreshControlTree = !0;
3134
- break;
3135
- }
3136
- }
3137
- }, this.getAppearanceProperties(e, n);
3138
- const r = this.getPropertyEditorParams(e, ["Const", "Variable", "StateMachine", "Expression"], "disabled");
3139
- return this.propertyConfig.categories.behavior = this.getBehaviorConfig(e, "", {
3140
- disabled: {
3141
- title: "禁用",
3142
- type: "boolean",
3143
- description: "按钮禁用状态",
3144
- refreshPanelAfterChanged: !0,
3145
- editor: r
3146
- }
3147
- }), this.getEventPropConfig(e), this.propertyConfig;
3148
- }
3149
- getAppearanceProperties(e, n = !1) {
3150
- this.propertyConfig.categories.appearance = {
3151
- title: "外观",
3152
- description: "Appearance",
3153
- properties: {
3154
- class: {
3155
- title: "class样式",
3156
- type: "string",
3157
- description: "",
3158
- $converter: "/converter/appearance.converter",
3159
- visible: !n
3160
- },
3161
- // "dropdownClass": {
3162
- // "title": "在下拉菜单中的样式",
3163
- // "type": "string",
3164
- // "description": ""
3165
- // },
3166
- icon: {
3167
- title: "图标",
3168
- type: "string",
3169
- description: ""
3170
- },
3171
- split: {
3172
- title: "下拉按钮分离",
3173
- type: "boolean",
3174
- description: "启用下拉按钮分离,可以单独点击按钮。单独点击下拉按钮展开下拉面板",
3175
- visible: !!(e.children && e.children.length > 0)
3176
- },
3177
- tipsEnable: {
3178
- title: "启用提示",
3179
- type: "boolean",
3180
- description: "当启用提示时,鼠标滑过按钮会有消息提示框",
3181
- refreshPanelAfterChanged: !0,
3182
- visible: this.toolbarType === "response-toolbar-item"
3183
- },
3184
- tipsText: {
3185
- title: "提示消息内容",
3186
- type: "string",
3187
- description: "消息提示框内的展示内容",
3188
- visible: e.tipsEnable === !0
3189
- }
3190
- }
3191
- };
3192
- }
3193
- getEventPropConfig(e) {
3194
- const n = [
3195
- {
3196
- label: "onClick",
3197
- name: "点击事件"
3198
- }
3199
- ], r = this, i = r.eventsEditorUtils.formProperties(e, r.viewModelId, n), l = {};
3200
- l[r.viewModelId] = {
3201
- type: "events-editor",
3202
- editor: {
3203
- initialData: i
3204
- }
3205
- }, this.propertyConfig.categories.eventsEditor = {
3206
- title: "事件",
3207
- hideTitle: !0,
3208
- properties: l,
3209
- // 这个属性,标记当属性变更得时候触发重新更新属性
3210
- refreshPanelAfterChanged: !0,
3211
- tabId: "commands",
3212
- tabName: "交互",
3213
- setPropertyRelates(g, u) {
3214
- const d = g.propertyValue;
3215
- delete e[r.viewModelId], d && (d.setPropertyRelates = this.setPropertyRelates, r.eventsEditorUtils.saveRelatedParameters(e, r.viewModelId, d.events, d));
3216
- }
3217
- };
3218
- }
3219
- }
3220
- function Ne(o, t) {
3221
- if (!o)
3222
- return !1;
3223
- const e = t || [];
3224
- return (e == null ? void 0 : e.findIndex((r) => r.id === o)) === -1;
3225
- }
3226
- function it(o, t) {
3227
- const e = t || [];
3228
- let n = { parentIndex: -1, itemIndex: -1 };
3229
- return e.some((r, i) => {
3230
- if (r.children && r.children.length > 0) {
3231
- const l = r.children.findIndex((g) => g.id === o);
3232
- return l > -1 ? (n = { parentIndex: i, itemIndex: l }, !0) : !1;
3233
- }
3234
- }), n;
3235
- }
3236
- function st(o, t) {
3237
- const e = t || [];
3238
- let n = { parentIndex: -1, itemIndex: -1 };
3239
- const r = e == null ? void 0 : e.findIndex((i) => i.id === o);
3240
- return r > -1 ? { parent: null, item: e[r] } : (e.some((i, l) => {
3241
- if (i.children && i.children.length > 0) {
3242
- const g = i.children.findIndex((u) => u.id === o);
3243
- return g > -1 ? (n = { parentIndex: l, itemIndex: g }, !0) : !1;
3244
- }
3245
- }), n.parentIndex < 0 ? { parent: null, item: null } : { parent: e[n.parentIndex], item: e[n.parentIndex].children[n.itemIndex] });
3246
- }
3247
- function eo(o, t) {
3248
- const e = t || [], n = e == null ? void 0 : e.findIndex((r) => r.id === o);
3249
- return n > -1 && e[n].children && e[n].children.length > 0 ? e[n].expanded === !0 : !1;
3250
- }
3251
- function to(o, t, e) {
3252
- function n(C) {
3253
- return !1;
3254
- }
3255
- function r() {
3256
- return !1;
3257
- }
3258
- function i() {
3259
- return !1;
3260
- }
3261
- function l() {
3262
- return !1;
3263
- }
3264
- function g() {
3265
- return e.toolbarContext.schema.buttons || [];
3266
- }
3267
- function u(C, a = "") {
3268
- setTimeout(() => {
3269
- var I, D;
3270
- const E = (I = o.parent) == null ? void 0 : I.designerItemElementRef.value;
3271
- let P;
3272
- a && (P = E == null ? void 0 : E.querySelector("#" + a));
3273
- const y = (D = P || E) == null ? void 0 : D.querySelector("#" + C);
3274
- y == null || y.click();
3275
- }, 0);
3276
- }
3277
- function d(C, a) {
3278
- a.disabled && a.disabled.expressionId && (a.disabled.expressionId = `${a.id}_disabled`), a.visible && a.visible.expressionId && (a.visible.expressionId = `${a.id}_visible`);
3279
- const E = t.formSchemaUtils.getExpressions(), P = E.find((I) => I.target === C.id);
3280
- if (!P || !P.rules || !P.rules.length)
3281
- return;
3282
- const y = {
3283
- target: a.id,
3284
- rules: [],
3285
- targetType: "Button"
3286
- };
3287
- P.rules.forEach((I) => {
3288
- const D = Object.assign(he(I), {
3289
- id: `${a.id}_${I.type}`
3290
- });
3291
- y.rules.push(D);
3292
- }), E.push(y);
3293
- }
3294
- function v() {
3295
- const C = o.schema, a = Object.assign(
3296
- he(C),
3297
- {
3298
- id: `${o.schema.type}-cloned-${Math.random().toString(36).slice(2, 6)}`,
3299
- onClick: null
3300
- }
3301
- );
3302
- let E = [];
3303
- return a.children && a.children.length && (E = a.children.map((P) => {
3304
- const y = he(P);
3305
- return Object.assign(
3306
- y,
3307
- {
3308
- id: `${o.schema.type}-cloned-${Math.random().toString(36).slice(2, 6)}`,
3309
- onClick: null
3310
- }
3311
- ), d(P, y), y;
3312
- }), a.children = E), d(C, a), a;
3313
- }
3314
- function p() {
3315
- const C = o.schema.type || "response-toolbar-item", a = be(C), E = C.toLowerCase().replace("-", "_");
3316
- return a && !a.id && a.type === C && (a.id = `${E}_${Math.random().toString().slice(2, 6)}`, a.text = "按钮"), a;
3317
- }
3318
- function m(C) {
3319
- const a = g(), E = a == null ? void 0 : a.findIndex((y) => y.id === C), P = E === -1 ? null : a[E];
3320
- return { index: E, toolbarItem: P };
3321
- }
3322
- function h() {
3323
- const C = o.schema.id, a = g();
3324
- return Ne(C, a);
3325
- }
3326
- function c(C) {
3327
- const a = t.formSchemaUtils.getExpressions();
3328
- if (!a || !a.length)
3329
- return;
3330
- const E = (P) => {
3331
- const y = a && a.findIndex((I) => I.target === P.id);
3332
- y > -1 && a.splice(y, 1);
3333
- };
3334
- E(C), C.children && C.children.length && C.children.forEach((P) => {
3335
- E(P);
3336
- });
3337
- }
3338
- function S(C) {
3339
- e.changeSelectedId(C);
3340
- }
3341
- function j() {
3342
- var P, y;
3343
- const C = g(), { parentIndex: a, itemIndex: E } = it(o.schema.id, C);
3344
- a === -1 || E === -1 || (c(o.schema), C[a].children.splice(E, 1), e.updateToolbarItems(), (P = o.setupContext) == null || P.emit("removeComponent"), (y = o.setupContext) == null || y.emit("selectionChange"));
3345
- }
3346
- function N() {
3347
- var P, y;
3348
- const C = o.schema.id, a = g(), E = a == null ? void 0 : a.findIndex((I) => I.id === C);
3349
- E !== -1 && (c(a[E]), a == null || a.splice(E, 1), e.updateToolbarItems(), (P = o.setupContext) == null || P.emit("removeComponent"), (y = o.setupContext) == null || y.emit("selectionChange"), ve.value++);
3350
- }
3351
- function A(C = "Append") {
3352
- var D;
3353
- const a = g(), { parentIndex: E, itemIndex: P } = it(o.schema.id, a);
3354
- if (E === -1 || P === -1)
3355
- return;
3356
- const y = p(), I = C === "Copy" ? v() : Object.assign({}, y);
3357
- a[E].children.splice(P + 1, 0, I), e.updateToolbarItems(), S(I.id), (D = o.setupContext) == null || D.emit("addComponent");
3358
- }
3359
- function B(C, a) {
3360
- const { index: E } = m(a);
3361
- if (E === -1)
3362
- return { index: E, schema: null };
3363
- const P = p(), y = C === "Copy" ? v() : Object.assign({}, P);
3364
- return { index: E, schema: y };
3365
- }
3366
- function f() {
3367
- var P;
3368
- const C = o.schema.id, { index: a, schema: E } = B("Copy", C);
3369
- E && (g().splice(a + 1, 0, E), e.updateToolbarItems(), u(E.id), (P = o.setupContext) == null || P.emit("addComponent"));
3370
- }
3371
- function s() {
3372
- var P;
3373
- const C = o.schema.id, { index: a, schema: E } = B("Append", C);
3374
- if (E && o.parent) {
3375
- const I = g()[a].children || [];
3376
- I.push(E);
3377
- const D = g();
3378
- D[a].children = I, e.updateToolbarItems(), S(E.id), (P = o.setupContext) == null || P.emit("addComponent");
3379
- }
3380
- }
3381
- function w(C) {
3382
- let a;
3383
- switch (o.schema.type) {
3384
- case "tab-toolbar-item":
3385
- a = new Zn(C, t);
3386
- break;
3387
- default:
3388
- a = new Kn(C, t, o.schema.type);
3389
- }
3390
- return a.getPropertyConfig(o.schema, h());
3391
- }
3392
- function x(C) {
3393
- C.stopPropagation(), C.stopImmediatePropagation();
3394
- }
3395
- function k() {
3396
- const C = [{
3397
- id: "delete",
3398
- title: "删除",
3399
- text: "",
3400
- icon: "f-icon-yxs_delete",
3401
- onClick: (a) => {
3402
- x(a), h() ? j() : N();
3403
- }
3404
- }, {
3405
- id: "copy",
3406
- title: "复制",
3407
- icon: "f-icon-yxs_copy",
3408
- onClick: (a) => {
3409
- x(a);
3410
- const { activeElement: E } = document, P = E ? E.tagName.toLowerCase() : "";
3411
- P && P === "input" || P === "textarea" ? (E == null || E.blur(), me(() => {
3412
- h() ? A("Copy") : f();
3413
- })) : h() ? A("Copy") : f();
3414
- }
3415
- }];
3416
- return C.push(h() ? {
3417
- id: "appendSiblingButton",
3418
- title: "",
3419
- text: "新增同级",
3420
- icon: "f-icon-plus-circle",
3421
- onClick: (a) => {
3422
- x(a), A();
3423
- }
3424
- } : {
3425
- id: "appendChildButton",
3426
- title: "",
3427
- text: "新增子级",
3428
- icon: "f-icon-plus-circle",
3429
- onClick: (a) => {
3430
- x(a), s();
3431
- }
3432
- }), C;
3433
- }
3434
- function H() {
3435
- const { schema: C } = o;
3436
- c(C);
3437
- }
3438
- return {
3439
- canAccepts: n,
3440
- checkCanMoveComponent: r,
3441
- checkCanDeleteComponent: i,
3442
- checkCanAddComponent: l,
3443
- getPropsConfig: w,
3444
- getCustomButtons: k,
3445
- onRemoveComponent: H
3446
- };
3447
- }
3448
- const wt = /* @__PURE__ */ Ie({
3449
- name: "FResponseToolbarItemDesign",
3450
- props: mt,
3451
- emits: ["Click", "dropdown", "clearAll"],
3452
- setup(o, t) {
3453
- const e = X(o.alignment), n = We(), r = X(), i = ce("designer-host-service"), l = ce("design-item-context"), g = ce("toolbar-item-action"), u = to(l, i, g), d = Yt(r, l, u);
3454
- Pe(() => {
3455
- r.value.componentInstance = d;
3456
- }), t.expose(d.value);
3457
- function v() {
3458
- const f = {
3459
- "f-icon": !0
3460
- }, s = o.icon ? o.icon.trim() : "";
3461
- return pe(f, s);
3462
- }
3463
- function p() {
3464
- return !!(o.icon && o.icon.trim());
3465
- }
3466
- const m = re(() => {
3467
- const f = {
3468
- btn: !0,
3469
- "f-rt-btn": !0,
3470
- "f-btn-ml": !o.isDP && (e.value === "right" || e.value === "center"),
3471
- "f-btn-mr": !o.isDP && e.value === "left",
3472
- "btn-icontext": !!(o.icon && o.icon.trim()),
3473
- disabled: o.disabled === !0,
3474
- "no-drag": !0,
3475
- "text-truncate": !0
3476
- // 'f-rt-toggle':props.isDP&&!props.split
3477
- };
3478
- return pe(f, o.class);
3479
- }), h = re(() => o.split ? {
3480
- display: "flex",
3481
- "align-items": "center"
3482
- } : {
3483
- display: "flex",
3484
- "align-items": "center",
3485
- "border-radius": "6px",
3486
- "padding-right": "0.1rem",
3487
- "border-top-right-radius": "6px",
3488
- "border-bottom-right-radius": "6px"
3489
- }), c = re(() => {
3490
- const f = {
3491
- btn: !0,
3492
- "dropdown-toggle": !0,
3493
- "f-btn-mr": e.value === "left",
3494
- "dropdown-toggle-split": !0,
3495
- "no-drag": !0
3496
- };
3497
- return pe(f, o.class);
3498
- }), S = re(() => {
3499
- let f = {
3500
- btn: !o.isDPItem,
3501
- // 不是下拉按钮,不是下拉项
3502
- disabled: o.disabled === !0,
3503
- "dropdown-item": o.isDPItem,
3504
- "f-rt-btn": !0,
3505
- "text-truncate": !0,
3506
- "btn-icontext": !o.isDPItem && !!(o.icon && o.icon.trim()),
3507
- "dropdown-item-icontext": o.isDPItem && !!(o.icon && o.icon.trim()),
3508
- // 保证内部层级不被拖拽
3509
- "no-drag": !0
3510
- };
3511
- return o.isDPItem || (f = pe(f, o.class || "")), o.isDP && (f = pe(f, o.dropdownClass || "")), f;
3512
- });
3513
- function j(f, s) {
3514
- s && s.stopPropagation(), t.emit(f, {
3515
- id: o.id,
3516
- isDP: o.isDP
3517
- });
3518
- }
3519
- function N() {
3520
- return {
3521
- "btn-group": !0,
3522
- "no-drag": !0,
3523
- "f-rt-dropdown": !0,
3524
- "f-btn-ml": e.value === "right" || e.value === "center",
3525
- "f-btn-mr": e.value === "left"
3526
- };
3527
- }
3528
- function A() {
3529
- return O("div", {
3530
- ref: r,
3531
- "data-dragref": `${l.schema.id}-container`,
3532
- class: "farris-component position-relative",
3533
- style: "display:inline-block!important;"
3534
- }, [O("div", {
3535
- class: N(),
3536
- id: o.id
3537
- }, [O("div", {
3538
- class: m.value,
3539
- style: h.value,
3540
- onClick: () => j("clearAll")
3541
- }, [n.shouldShowIcon(o) && O("i", {
3542
- class: n.iconClass(o)
3543
- }, null), O("span", null, [o.text]), !o.split && O("span", {
3544
- class: "f-icon f-icon-arrow-chevron-down",
3545
- style: "margin:0 0.5rem 0 0.25rem;",
3546
- onClick: (f) => j("dropdown", f)
3547
- }, null)]), o.split && O("button", {
3548
- class: c.value,
3549
- style: "border-radius:0 6px 6px 0;",
3550
- onClick: (f) => j("dropdown", f)
3551
- }, null), g.renderDropdownMenu(o.item, o.item)])]);
3552
- }
3553
- function B() {
3554
- return O("li", {
3555
- ref: r,
3556
- "data-dragref": `${l.schema.id}-container`,
3557
- id: o.id,
3558
- class: S.value
3559
- }, [n.shouldShowIcon(o) && O("i", {
3560
- class: n.iconClass(o)
3561
- }, null), o.text]);
3562
- }
3563
- return () => o.isDP ? A() : o.isDPItem ? B() : O("div", {
3564
- ref: r,
3565
- "data-dragref": `${l.schema.id}-container`,
3566
- class: "farris-component position-relative",
3567
- style: "display:inline-block!important;"
3568
- }, [O("button", {
3569
- type: "button",
3570
- class: m.value,
3571
- id: o.id,
3572
- onClick: () => j("clearAll")
3573
- }, [p() && O("i", {
3574
- class: v()
3575
- }, null), o.text])]);
3576
- }
3577
- });
3578
- function no(o, t, e, n) {
3579
- function r(m, h, c, S) {
3580
- n.changeSelectedId((h == null ? void 0 : h.id) || ""), e && e.setupContext && e.setupContext.emit("selectionChange", m, h, c, S);
3581
- }
3582
- function i() {
3583
- }
3584
- function l(m) {
3585
- const h = m.expanded;
3586
- n.clearAllDropdown(), n.toggleDropdownMenu(m, !h);
3587
- }
3588
- function g(m) {
3589
- n.clearAllDropdown(m.isDP ? m.id : "");
3590
- }
3591
- function u(m, h = "") {
3592
- const c = o.items || [], S = h || m, j = c.find((N) => N.id === S);
3593
- return h ? j.children.find((N) => N.id === m) : j;
3594
- }
3595
- function d(m, h = !1) {
3596
- if (!h)
3597
- return;
3598
- const c = m.target;
3599
- c != null && c.classList.contains("dgComponentFocused") && (c == null || c.classList.add("dgComponentSelected"));
3600
- }
3601
- function v(m, h = !1) {
3602
- if (!h)
3603
- return;
3604
- const c = m.target;
3605
- c != null && c.classList.contains("dgComponentFocused") && (c == null || c.classList.remove("dgComponentSelected"));
3606
- }
3607
- function p(m, h, c = !1) {
3608
- const S = u(m.id, m.parent), j = X(S);
3609
- return O(Jn, {
3610
- key: S.id,
3611
- class: ["p-0", c ? "d-block no-drag" : "d-inline-block"],
3612
- modelValue: j.value,
3613
- "onUpdate:modelValue": (N) => j.value = N,
3614
- canMove: !1,
3615
- childType: "response-toolbar-item",
3616
- childLabel: "按钮",
3617
- contentKey: "buttons",
3618
- componentId: o.componentId,
3619
- id: S.id,
3620
- onSelectionChange: r,
3621
- onRemoveComponent: i,
3622
- onMouseenter: (N) => d(N, c),
3623
- onMouseleave: (N) => v(N, c)
3624
- }, {
3625
- default: () => {
3626
- var N;
3627
- return [O(wt, {
3628
- id: S.id,
3629
- disabled: S.disabled,
3630
- text: S.text,
3631
- icon: S.icon,
3632
- isDP: m.isDP,
3633
- item: m,
3634
- split: S.split,
3635
- isDPItem: m.isDPItem,
3636
- class: ((N = m.appearance) == null ? void 0 : N.class) || "btn-secondary",
3637
- alignment: o.alignment || "right",
3638
- onDropdown: () => l(m),
3639
- onClearAll: (A) => g(A),
3640
- componentId: o.componentId
3641
- }, null)];
3642
- }
3643
- });
3644
- }
3645
- return {
3646
- renderToolbarItemDesigner: p,
3647
- actionHandlers: n
3648
- };
3649
- }
3650
- function Fe(o, t = !1, e = "") {
3651
- const n = [];
3652
- return o.reduce((r, i) => {
3653
- if (i.children && i.children.length > 0) {
3654
- const l = Fe(i.children, !0, i.id);
3655
- r.push(Object.assign({}, i, {
3656
- children: l,
3657
- isDPItem: !1,
3658
- isDP: !0,
3659
- parent: "",
3660
- expanded: !1
3661
- }));
3662
- } else
3663
- r.push(Object.assign({}, i, {
3664
- isDPItem: t,
3665
- isDP: !1,
3666
- parent: e
3667
- }));
3668
- return r;
3669
- }, n), n;
3670
- }
3671
- const oo = /* @__PURE__ */ Ie({
3672
- name: "FResponseToolbarDesign",
3673
- props: Mn,
3674
- emits: ["Click"],
3675
- setup(o, t) {
3676
- const e = X(Fe(o.items)), n = X(), r = X(), i = X(), l = X("");
3677
- let g = 0;
3678
- const u = 15, d = ce("designer-host-service"), v = ce("design-item-context"), p = {
3679
- clearAllDropdown: (V) => {
3680
- },
3681
- toggleDropdownMenu: (V) => {
3682
- },
3683
- updateToolbarItems: () => {
3684
- },
3685
- changeSelectedId: (V) => {
3686
- l.value = V;
3687
- },
3688
- renderDropdownMenu: (V, _) => {
3689
- },
3690
- toolbarContext: v,
3691
- changeMenuPosition: (V, _, G) => ({}),
3692
- toolbarPosition: ""
3693
- }, m = Un(v, d, p), h = Xt(i, v, m), c = ce("toolbar-item-handler"), {
3694
- initDragula: S,
3695
- dragulaInstance: j
3696
- } = Gn(v), N = We(), A = no(o, r, v, p), B = Yn(N, e, A), {
3697
- renderToolbarItemDesigner: f
3698
- } = A, {
3699
- clearAllDropDownMenu: s,
3700
- renderDropdownMenu: w,
3701
- setResponseToolbarRef: x
3702
- } = B;
3703
- at("toolbar-item-action", p), p.renderDropdownMenu = w, x(i), c && (c.changeSelectedId = function(V) {
3704
- l.value = V;
3705
- });
3706
- function k() {
3707
- const V = r.value.querySelector(".dgComponentSelected");
3708
- V && vt(V);
3709
- }
3710
- function H() {
3711
- if (l.value)
3712
- if (Ne(l.value, e.value)) {
3713
- const {
3714
- parent: V,
3715
- item: _
3716
- } = st(l.value, e.value);
3717
- V && (p.toggleDropdownMenu(V, !0), setTimeout(() => {
3718
- var Y;
3719
- const G = i.value.querySelector("#" + V.id), z = G == null ? void 0 : G.querySelector("#" + _.id);
3720
- (((Y = z == null ? void 0 : z.parentElement) == null ? void 0 : Y.className) || "").indexOf("dgComponentFocused") < 0 && (z == null || z.click());
3721
- }, 0));
3722
- } else
3723
- k();
3724
- }
3725
- function C(V = "") {
3726
- e.value.filter((_) => _.id !== V && _.children && _.children.length > 0).forEach((_) => {
3727
- _.expanded = !1;
3728
- }), s(V);
3729
- }
3730
- p.clearAllDropdown = C;
3731
- function a() {
3732
- c && c.updateToolbarItems && c.updateToolbarItems();
3733
- }
3734
- p.updateToolbarItems = a;
3735
- function E(V) {
3736
- if (V) {
3737
- const _ = i.value.querySelector("#" + V.id), G = _.querySelector("#" + V.id + "_menu"), z = p.changeMenuPosition(V, _);
3738
- Object.keys(z).forEach((Y) => {
3739
- G.style[Y] = z[Y];
3740
- });
3741
- }
3742
- }
3743
- function P() {
3744
- const G = r.value.clientWidth, z = r.value.querySelectorAll(".farris-component>.f-rt-btn");
3745
- z && z.forEach((W) => {
3746
- W.style.maxWidth = G - 12 + "px";
3747
- });
3748
- const Y = r.value.querySelectorAll(".farris-component>.f-rt-dropdown");
3749
- Y && Y.forEach((W) => {
3750
- W.querySelector(".dropdown-toggle-split") ? W.querySelector(".f-rt-btn").style.maxWidth = G - 38 + "px" : W.style.maxWidth = G - 12 + "px";
3751
- });
3752
- }
3753
- const y = new ResizeObserver((V) => {
3754
- var _;
3755
- if (V.length) {
3756
- const z = V[0].contentRect.width;
3757
- if (z === 0) {
3758
- g = 0;
3759
- return;
3760
- }
3761
- if (Math.abs(z - g) > u) {
3762
- if (g = z, Ne(l.value, e.value)) {
3763
- const {
3764
- parent: Y,
3765
- item: W
3766
- } = st(l.value, e.value);
3767
- E(Y);
3768
- } else if (eo(l.value, e.value)) {
3769
- const Y = (_ = e.value) == null ? void 0 : _.find((W) => W.id === l.value);
3770
- E(Y);
3771
- } else
3772
- C();
3773
- P();
3774
- }
3775
- }
3776
- });
3777
- Pe(() => {
3778
- y.observe(i.value), g = i.value.clientWidth, i.value.componentInstance = h, S(r.value, n.value, a);
3779
- }), lt(() => {
3780
- y.disconnect(), j && j.destroy && j.destroy();
3781
- }), t.expose(h.value);
3782
- const I = re(() => {
3783
- const V = {
3784
- "f-toolbar": !0,
3785
- "f-response-toolbar": !0,
3786
- "position-relative": !0,
3787
- "f-response-toolbar-sm": o.buttonSize === "sm",
3788
- "f-response-toolbar-lg": o.buttonSize === "lg"
3789
- };
3790
- return pe(V, o.customClass);
3791
- }), D = re(() => ({
3792
- "text-left": o.alignment === "left",
3793
- "text-right": o.alignment === "right",
3794
- "justify-content-end": o.alignment === "right",
3795
- "justify-content-start": o.alignment === "left",
3796
- "justify-content-center": o.alignment === "center",
3797
- "no-drag": !0,
3798
- "w-100": !0
3799
- }));
3800
- Se(() => o.items, () => {
3801
- e.value = Fe(o.items), me(() => {
3802
- H(), P();
3803
- });
3804
- }, {
3805
- deep: !0
3806
- });
3807
- function T(V) {
3808
- V && (V.stopPropagation(), V.preventDefault());
3809
- const {
3810
- schema: _
3811
- } = v;
3812
- _.buttons || (_.buttons = []);
3813
- const G = be("response-toolbar-item");
3814
- G.id = `toolbar_item_${Math.random().toString().slice(2, 6)}`, G.appearance = {
3815
- class: "btn btn-secondary"
3816
- }, _.buttons.push(G);
3817
- }
3818
- function q() {
3819
- return O("li", {
3820
- style: "border-width: 1px;border-style: dashed;display: inline-block;padding: 0 8px;line-height: 24px; border-radius: 3px; cursor: default;color: #B4BCCC;",
3821
- onClick: T
3822
- }, [O("span", {
3823
- class: "f-icon f-icon-amplification mr-1",
3824
- style: "font-size: 12px;"
3825
- }, null), O("span", {
3826
- class: "farris-tag-add-text"
3827
- }, [zt("添加按钮")])]);
3828
- }
3829
- function L() {
3830
- return e.value.map((V, _) => f(V, _));
3831
- }
3832
- return () => {
3833
- var V;
3834
- return O("div", {
3835
- ref: i,
3836
- "data-dragref": `${v.schema.id}-container`,
3837
- class: I.value,
3838
- id: o.id
3839
- }, [O("div", {
3840
- ref: n,
3841
- class: D.value,
3842
- onClick: (_) => C(_)
3843
- }, [O("div", {
3844
- ref: r,
3845
- class: "d-block f-response-content"
3846
- }, [(V = e.value) != null && V.length ? L() : q()])])]);
3847
- };
3848
- }
3849
- }), po = qe;
3850
- Ee.register = (o, t, e, n) => {
3851
- o["response-toolbar"] = Ee, t["response-toolbar"] = qe, n["response-toolbar"] = { eventHandlerResolver: Dn };
3852
- };
3853
- Ee.registerDesigner = (o, t, e) => {
3854
- o["response-toolbar"] = oo, t["response-toolbar"] = qe, o["response-toolbar-item"] = wt, t["response-toolbar-item"] = kn;
3855
- };
3856
- const go = Gt(Ee);
694
+ const Tn = dn(vn);
3857
695
  export {
3858
- Ee as FResponseToolbar,
3859
- Ce as ResponseToolbarDropDownItem,
3860
- fo as ResponseToolbarGroup,
3861
- Jt as ResponseToolbarItem,
3862
- go as default,
3863
- po as responseToolbarResolver
696
+ vn as FResponseToolbar,
697
+ Q as ResponseToolbarDropDownItem,
698
+ Dn as ResponseToolbarGroup,
699
+ hn as ResponseToolbarItem,
700
+ Tn as default,
701
+ fn as responseToolbarProps
3864
702
  };