@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
@@ -0,0 +1,3015 @@
1
+ var Lt = Object.defineProperty;
2
+ var $t = (e, c, n) => c in e ? Lt(e, c, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[c] = n;
3
+ var J = (e, c, n) => $t(e, typeof c != "symbol" ? c + "" : c, n);
4
+ import { getCustomClass as te, withInstall as Nt } from "../../components/common/index.esm.js";
5
+ import { resolveAppearance as Wt, createPropsResolver as ot, createResponseToolbarEventHandlerResolver as Ft, getSchemaByType as Le } from "../../components/dynamic-resolver/index.esm.js";
6
+ import { responseToolbarProps as rt } from "../../components/response-toolbar/index.esm.js";
7
+ import { computed as ie, getCurrentInstance as qt, createVNode as A, reactive as be, withDirectives as ye, resolveDirective as Ce, ref as U, defineComponent as Te, onMounted as Se, onUnmounted as it, watch as we, nextTick as ge, inject as ue, provide as st, onBeforeUnmount as Ht, withModifiers as zt, createTextVNode as Vt } from "vue";
8
+ import { canvasChanged as lt, useDesignerInnerComponent as Gt, useDesignerComponent as Yt, setPositionForSelectedElement as Ut } from "../../components/designer-canvas/index.esm.js";
9
+ import { BaseControlProperty as at } from "../../components/property-panel/index.esm.js";
10
+ import { cloneDeep as he } from "lodash-es";
11
+ import { TabToolbarItemProperty as Xt } from "../../components/tabs/index.esm.js";
12
+ const Qt = /* @__PURE__ */ new Map([
13
+ ["buttons", "items"],
14
+ ["appearance", Wt]
15
+ ]);
16
+ function ct(e, c, n) {
17
+ return c;
18
+ }
19
+ const Jt = "https://json-schema.org/draft/2020-12/schema", Zt = "https://farris-design.gitee.io/response-toolbar.schema.json", Kt = "response-toolbar", en = "A Farris Toolbar Component", tn = "object", nn = {
20
+ id: {
21
+ description: "The unique identifier for a Response Toolbar",
22
+ type: "string"
23
+ },
24
+ type: {
25
+ description: "The type string of Response Toolbar",
26
+ type: "string",
27
+ default: "response-toolbar"
28
+ },
29
+ appearance: {
30
+ description: "",
31
+ type: "object",
32
+ properties: {
33
+ class: {
34
+ type: "string",
35
+ default: ""
36
+ }
37
+ }
38
+ },
39
+ alignment: {
40
+ description: "The alignment of Response Toolbar Button.",
41
+ type: "string",
42
+ default: "right"
43
+ },
44
+ buttons: {
45
+ description: "The items of Response Toolbar.",
46
+ type: "array",
47
+ default: []
48
+ },
49
+ buttonSize: {
50
+ type: "string",
51
+ default: ""
52
+ },
53
+ visible: {
54
+ description: "",
55
+ type: "boolean",
56
+ default: !0
57
+ }
58
+ }, on = [
59
+ "id",
60
+ "type",
61
+ "buttons"
62
+ ], rn = {
63
+ onClick: "点击事件"
64
+ }, sn = {
65
+ $schema: Jt,
66
+ $id: Zt,
67
+ title: Kt,
68
+ description: en,
69
+ type: tn,
70
+ properties: nn,
71
+ required: on,
72
+ events: rn
73
+ }, ln = "https://json-schema.org/draft/2020-12/schema", an = "https://farris-design.gitee.io/response-toolbar-item.schema.json", cn = "response-toolbar-item", un = "A Farris Toolbar Item Component", dn = "object", fn = {
74
+ id: {
75
+ description: "The unique identifier for a Response Toolbar",
76
+ type: "string"
77
+ },
78
+ type: {
79
+ description: "The type string of Response Toolbar",
80
+ type: "string",
81
+ default: "response-toolbar-item"
82
+ },
83
+ appearance: {
84
+ description: "",
85
+ type: "object",
86
+ properties: {
87
+ class: {
88
+ type: "string",
89
+ default: ""
90
+ }
91
+ }
92
+ },
93
+ alignment: {
94
+ description: "对齐",
95
+ type: "string",
96
+ default: "right"
97
+ },
98
+ text: {
99
+ description: "文本",
100
+ type: "string",
101
+ default: "按钮"
102
+ },
103
+ icon: {
104
+ description: "图标",
105
+ type: "string",
106
+ default: ""
107
+ },
108
+ disabled: {
109
+ description: "禁用",
110
+ type: "boolean",
111
+ default: !1
112
+ },
113
+ visible: {
114
+ description: "是否可见",
115
+ type: "boolean",
116
+ default: !0
117
+ },
118
+ onClick: {
119
+ description: "点击事件",
120
+ type: "string",
121
+ default: ""
122
+ },
123
+ tipsEnable: {
124
+ description: "",
125
+ type: "boolean",
126
+ default: !1
127
+ },
128
+ tipsText: {
129
+ description: "",
130
+ type: "string",
131
+ default: ""
132
+ },
133
+ dropdownClass: {
134
+ description: "处于下拉菜单时的样式",
135
+ type: "string",
136
+ default: ""
137
+ },
138
+ split: {
139
+ description: "",
140
+ type: "boolean",
141
+ default: !1
142
+ }
143
+ }, pn = [
144
+ "id",
145
+ "type",
146
+ "text"
147
+ ], hn = {
148
+ $schema: ln,
149
+ $id: an,
150
+ title: cn,
151
+ description: un,
152
+ type: dn,
153
+ properties: fn,
154
+ required: pn
155
+ }, gn = Object.assign({}, rt, {
156
+ componentId: { type: String, default: "" }
157
+ }), $e = ot(
158
+ rt,
159
+ sn,
160
+ Qt,
161
+ ct
162
+ ), ut = {
163
+ id: { type: String, default: "" },
164
+ item: { type: Object, default: {} },
165
+ items: { type: Object, default: {} },
166
+ class: { type: String, default: "btn-secondary" },
167
+ text: { type: String, default: "" },
168
+ disabled: { type: Boolean, default: !1 },
169
+ icon: { type: String, default: "" },
170
+ componentId: { type: String, default: "" },
171
+ // 是否展开子级
172
+ expanded: { type: Boolean, default: !1 },
173
+ alignment: { Type: String, default: "right" },
174
+ // 下拉按钮分离
175
+ split: { type: Boolean, default: !1 },
176
+ // 是否下拉
177
+ isDP: { type: Boolean, default: !1 },
178
+ // 是否下拉项
179
+ isDPItem: { type: Boolean, default: !1 }
180
+ }, vn = ot(
181
+ ut,
182
+ hn,
183
+ void 0,
184
+ ct
185
+ ), mn = Ft(), bn = {
186
+ id: { type: String, default: "" },
187
+ /** 组件自定义样式 */
188
+ customClass: { type: String, default: "" },
189
+ alignment: { Type: String, default: "right" },
190
+ items: {
191
+ Type: Array,
192
+ default: []
193
+ },
194
+ /** 控制是否可见 */
195
+ visible: { type: Boolean, default: !0 }
196
+ };
197
+ class dt {
198
+ constructor(c) {
199
+ /** 工具栏项标识 */
200
+ J(this, "id", "");
201
+ /** 工具栏项自定义样式 */
202
+ J(this, "class", "btn-secondary");
203
+ /** 图标 */
204
+ J(this, "icon", "");
205
+ /** 所属分组 */
206
+ J(this, "groupId", "");
207
+ /** 收藏顺序 */
208
+ J(this, "order", -1);
209
+ /** 是否作为下拉菜单的顶层按钮 */
210
+ J(this, "asDropDownTop", !1);
211
+ /** 文本 */
212
+ J(this, "text", "");
213
+ /** 是否可见原值 */
214
+ J(this, "visible", !0);
215
+ /** 控制界面是否显示 */
216
+ J(this, "shown", !0);
217
+ J(this, "responsed", !1);
218
+ /** 是否启用提示消息 */
219
+ J(this, "tipsEnable", !1);
220
+ /** 提示消息内容 */
221
+ J(this, "tipsText", "");
222
+ /** 记录宽度 */
223
+ J(this, "width", 0);
224
+ /** 下拉时的样式名 */
225
+ J(this, "dropdownClass", "");
226
+ J(this, "onClick", () => {
227
+ });
228
+ J(this, "options");
229
+ var a, l;
230
+ this.options = c;
231
+ const n = [
232
+ "id",
233
+ "class",
234
+ "icon",
235
+ "groupId",
236
+ "order",
237
+ "asDropDownTop",
238
+ "text",
239
+ "isDP",
240
+ "visible",
241
+ "responsed",
242
+ "width",
243
+ "tipsEnable",
244
+ "tipsText",
245
+ "dropdownClass",
246
+ "onClick"
247
+ ];
248
+ Object.keys(c).filter((s) => n.indexOf(s) > -1).forEach((s) => {
249
+ s === "visible" ? this[s] = c[s] === void 0 ? !0 : c[s] : this[s] = c[s];
250
+ }), this.shown = this.visible, (a = c.appearance) != null && a.class && (this.class = (l = c.appearance) == null ? void 0 : l.class);
251
+ }
252
+ /** 是否可用 */
253
+ get enable() {
254
+ return Object.keys(this.options).indexOf("disabled") > -1 ? !this.options.disabled : ie(() => !0);
255
+ }
256
+ /** 设置宽度 */
257
+ setWidth(c) {
258
+ this.width = parseInt(c, 10);
259
+ }
260
+ /** 获取宽度 */
261
+ getWidth() {
262
+ return this.visible ? this.width : !1;
263
+ }
264
+ }
265
+ class yn extends dt {
266
+ constructor(c) {
267
+ super(c);
268
+ }
269
+ }
270
+ function ft() {
271
+ function e(c) {
272
+ const n = [];
273
+ return c.reduce((a, l) => (l.children && l.children.length > 0 ? a.push(new me(l)) : a.push(new yn(l)), a), n), n;
274
+ }
275
+ return { buildResponseToolbarItems: e };
276
+ }
277
+ const { buildResponseToolbarItems: Cn } = ft();
278
+ class me extends dt {
279
+ constructor(n) {
280
+ super(n);
281
+ J(this, "placement", "");
282
+ // 下拉位置
283
+ /** 是否可见 */
284
+ J(this, "visible", !0);
285
+ /** 下拉class */
286
+ J(this, "dropdownClass", "");
287
+ /** 下拉菜单class */
288
+ J(this, "menuClass", "");
289
+ /** 是否用分开的下拉按钮 */
290
+ J(this, "split", !1);
291
+ J(this, "children", []);
292
+ J(this, "expanded", !1);
293
+ J(this, "shown", !0);
294
+ const a = ["visible", "icon", "isDP", "class", "dropdownClass", "menuClass", "placement", "split", "expanded"];
295
+ Object.keys(n).filter((l) => a.indexOf(l) > -1).forEach((l) => {
296
+ l === "visible" ? this[l] = n[l] === void 0 ? !0 : n[l] : this[l] = n[l];
297
+ }), this.shown = this.visible, n.children && n.children.length && (this.children = Cn(n.children));
298
+ }
299
+ }
300
+ function Ne() {
301
+ function e(n) {
302
+ const a = {
303
+ "f-icon": !0
304
+ };
305
+ if (n.icon) {
306
+ const l = n.icon.trim().split(" ");
307
+ l && l.length && l.reduce((s, p) => (s[p] = !0, s), a);
308
+ }
309
+ return a;
310
+ }
311
+ function c(n) {
312
+ return !!(n.icon && n.icon.trim());
313
+ }
314
+ return { iconClass: e, shouldShowIcon: c };
315
+ }
316
+ function wn(e, c) {
317
+ function n(i) {
318
+ return te({
319
+ "dropdown-menu": !0
320
+ }, i.menuClass);
321
+ }
322
+ function a(i) {
323
+ const t = {
324
+ disabled: !i.enable,
325
+ "dropdown-submenu": !0,
326
+ "f-rt-dropdown": !0,
327
+ "text-truncate": !0
328
+ };
329
+ return te(t, i.dropdownClass);
330
+ }
331
+ function l(i) {
332
+ const t = {
333
+ disabled: !i.enable,
334
+ "dropdown-item": !0,
335
+ "f-rt-btn": !0,
336
+ "text-truncate": !0
337
+ };
338
+ return te(t, i.dropdownClass);
339
+ }
340
+ function s(i) {
341
+ const t = {
342
+ disabled: !i.enable,
343
+ "dropdown-item": !0,
344
+ "f-rt-btn": !0,
345
+ "text-truncate": !0,
346
+ "f-rt-toggle": !i.split,
347
+ "btn-icontext": !!(i.icon && i.icon.trim()),
348
+ "dropdown-toggle": !i.split
349
+ };
350
+ return te(t, i.dropdownClass);
351
+ }
352
+ function p(i) {
353
+ const t = {
354
+ "f-rt-btn": !0,
355
+ "text-truncate": !0,
356
+ "btn-icontext": !!(i.icon && i.icon.trim()),
357
+ "d-block": !0
358
+ };
359
+ return te(t, i.dropdownClass);
360
+ }
361
+ let h;
362
+ const g = /* @__PURE__ */ new Map();
363
+ function x(i, t, b) {
364
+ i.stopPropagation();
365
+ const C = b ? b.id : "__top_item__";
366
+ if (t.children && t.children.length && (t.expanded = !t.expanded, t.expanded)) {
367
+ if (g.has(C) && g.get(C) !== t) {
368
+ const k = g.get(C);
369
+ k && (k.expanded = !1, g.delete(C));
370
+ }
371
+ g.set(C, t);
372
+ }
373
+ }
374
+ function I(i, t) {
375
+ document.body.click(), t.enable && (i.stopPropagation(), typeof t.onClick == "function" && t.onClick(i, t.id), e.emit("click", i, t.id));
376
+ }
377
+ function y(i, t) {
378
+ const b = i.target;
379
+ b.className.indexOf("dropdown-item") < 0 || (b.title = b.scrollWidth > b.clientWidth ? t : "");
380
+ }
381
+ function m(i, t, b) {
382
+ if (t.tipsEnable && t.tipsText) {
383
+ const C = be({
384
+ content: t.tipsText,
385
+ enable: t.tipsEnable
386
+ });
387
+ return ye(A("li", {
388
+ class: l(t),
389
+ id: t.id,
390
+ key: t.id + "_" + b,
391
+ onClick: (k) => I(k, t)
392
+ }, [A("span", {
393
+ class: p(t)
394
+ }, [c.shouldShowIcon(t) && A("i", {
395
+ class: c.iconClass(t)
396
+ }, null), t.text])]), [[Ce("tooltip"), C]]);
397
+ }
398
+ return A("li", {
399
+ class: l(t),
400
+ id: t.id,
401
+ onClick: (C) => I(C, t)
402
+ }, [A("span", {
403
+ class: p(t),
404
+ onMouseenter: (C) => y(C, t.text)
405
+ }, [c.shouldShowIcon(t) && A("i", {
406
+ class: c.iconClass(t)
407
+ }, null), t.text])]);
408
+ }
409
+ function f(i, t, b) {
410
+ t.enable && (typeof t.onClick == "function" && b.onClick(i, t.id), e.emit("click", i, t.id), b.split || x(i, t, b));
411
+ }
412
+ function r(i, t, b) {
413
+ i && i.stopPropagation(), x(i, t, b);
414
+ }
415
+ function S(i, t) {
416
+ i.stopPropagation();
417
+ const b = t.id;
418
+ if (t.children && t.children.length && t.expanded && g.has(b)) {
419
+ const C = g.get(b);
420
+ C && (C.expanded = !1, g.delete(b));
421
+ }
422
+ }
423
+ function L(i, t, b) {
424
+ if (t.tipsEnable && t.tipsText) {
425
+ const C = be({
426
+ content: t.tipsText,
427
+ enable: t.tipsEnable
428
+ });
429
+ return A("li", {
430
+ class: a(t),
431
+ id: t.id,
432
+ key: t.id + "_" + b,
433
+ onClick: (k) => f(k, t, i)
434
+ }, [ye(A("span", {
435
+ class: s(t)
436
+ }, [c.shouldShowIcon(t) && A("i", {
437
+ class: c.iconClass(t)
438
+ }, null), t.text]), [[Ce("tooltip"), C]]), t.split && A("span", {
439
+ class: "dropdown-toggle dropdown-toggle-split f-rt-toggle",
440
+ onClick: (k) => r(k, t, i)
441
+ }, null), h(t, t)]);
442
+ }
443
+ return A("li", {
444
+ class: a(t),
445
+ id: t.id,
446
+ onClick: (C) => f(C, t, i),
447
+ onMouseenter: (C) => y(C, t.text)
448
+ }, [A("span", {
449
+ class: s(t)
450
+ }, [c.shouldShowIcon(t) && A("i", {
451
+ class: c.iconClass(t)
452
+ }, null), t.text]), t.split && A("span", {
453
+ class: "dropdown-toggle dropdown-toggle-split f-rt-toggle",
454
+ onClick: (C) => r(C, t, i)
455
+ }, null), h(t, t)]);
456
+ }
457
+ function W(i) {
458
+ return i.children.filter((t) => t.visible).map((t, b) => t.children && t.children.length ? L(i, t, b) : m(i, t, b));
459
+ }
460
+ function _(i, t, b) {
461
+ const C = {
462
+ display: i.expanded ? "block" : "none",
463
+ position: "fixed",
464
+ maxWidth: "300px",
465
+ minWidth: "120px",
466
+ zIndex: 1040,
467
+ overflowY: "auto",
468
+ maxHeight: "none"
469
+ }, k = window.innerWidth, z = window.innerHeight, v = t, o = v == null ? void 0 : v.getClientRects();
470
+ if (v && o && o.length) {
471
+ const {
472
+ top: T,
473
+ width: P,
474
+ left: d,
475
+ right: D,
476
+ height: M
477
+ } = o[0], w = Math.ceil(M + T);
478
+ C.top = `${w}px`, C.left = `${d}px`;
479
+ const q = i.id + "_menu", F = t ? t.querySelector("#" + q) : null;
480
+ if (F) {
481
+ F.style.visibility = "hidden", F.style.display = "block";
482
+ const O = F.offsetHeight;
483
+ C.display === "block" && (F.style.display = "block");
484
+ const j = F.getBoundingClientRect();
485
+ if (b) {
486
+ C.top = `${T - 6}px`;
487
+ const G = Math.ceil(P + d);
488
+ C.left = `${G}px`;
489
+ }
490
+ k - d - P < j.width && (C.left = `${(b ? d : D) - j.width}px`), z - T - M < O ? T > O ? (C.top = `${T - O - 6}px`, C.maxHeight = `${T - 16}px`) : (C.maxHeight = `${z - w}px`, T > z - T - M && (C.top = "10px", C.maxHeight = `${T - 16}px`)) : C.maxHeight = `${z - w}px`, F.style.visibility = "visible";
491
+ }
492
+ }
493
+ return C;
494
+ }
495
+ h = function(i, t) {
496
+ var z, v;
497
+ const b = qt(), C = t ? t.id : i.id, k = (v = (z = b == null ? void 0 : b.exposed) == null ? void 0 : z.elementRef.value) == null ? void 0 : v.querySelector("#" + C);
498
+ return A("ul", {
499
+ class: n(i),
500
+ style: _(i, k, t),
501
+ id: i.id + "_menu",
502
+ onWheel: (o) => S(o, i)
503
+ }, [W(i)]);
504
+ };
505
+ function B() {
506
+ g.forEach((i) => {
507
+ i.expanded = !1;
508
+ }), g.clear();
509
+ }
510
+ return {
511
+ renderDropdownMenu: h,
512
+ clearAllDropDownMenu: B
513
+ };
514
+ }
515
+ function xn(e, c, n) {
516
+ const a = U(e.alignment), {
517
+ renderDropdownMenu: l,
518
+ clearAllDropDownMenu: s
519
+ } = wn(c, n);
520
+ function p(r) {
521
+ const S = {
522
+ "btn-group": !0,
523
+ "f-rt-dropdown": !0,
524
+ "f-btn-ml": a.value === "right" || a.value === "center",
525
+ "f-btn-mr": a.value === "left"
526
+ };
527
+ return te(S, r.dropdownClass);
528
+ }
529
+ function h(r) {
530
+ const S = {
531
+ btn: !0,
532
+ disabled: !r.enable,
533
+ "f-rt-btn": !0,
534
+ "btn-icontext": !!(r.icon && r.icon.trim()),
535
+ "f-rt-toggle": !r.split,
536
+ "dropdown-toggle": !r.split
537
+ };
538
+ return te(S, r.class);
539
+ }
540
+ function g(r) {
541
+ return te({
542
+ btn: !0,
543
+ "dropdown-toggle": !0,
544
+ "dropdown-toggle-split": !0
545
+ }, r.class);
546
+ }
547
+ function x(r) {
548
+ return r.split ? {
549
+ display: "flex"
550
+ } : {
551
+ display: "flex",
552
+ "border-radius": "6px"
553
+ };
554
+ }
555
+ function I(r, S) {
556
+ r.stopPropagation();
557
+ const L = S.expanded;
558
+ document.body.click(), typeof S.onClick == "function" && S.onClick(r, S.id), c.emit("click", r, S.id), S.split || (S.expanded = !L);
559
+ }
560
+ function y(r, S) {
561
+ r.stopPropagation();
562
+ const L = S.expanded;
563
+ document.body.click(), S.expanded = !L;
564
+ }
565
+ function m(r, S = !0) {
566
+ if (r.tipsEnable && r.tipsText) {
567
+ const L = be({
568
+ content: r.tipsText,
569
+ enable: r.tipsEnable
570
+ });
571
+ return A("div", {
572
+ id: r.id,
573
+ class: p(r)
574
+ }, [ye(A("div", {
575
+ class: h(r),
576
+ style: x(r),
577
+ onClick: (W) => r.enable && I(W, r)
578
+ }, [n.shouldShowIcon(r) && A("i", {
579
+ class: n.iconClass(r)
580
+ }, null), A("span", null, [r.text])]), [[Ce("tooltip"), L]]), r.split && A("button", {
581
+ class: g(r),
582
+ style: "border-radius:0 6px 6px 0;",
583
+ onClick: (W) => y(W, r)
584
+ }, null), S && l(r)]);
585
+ }
586
+ return A("div", {
587
+ id: r.id,
588
+ class: p(r)
589
+ }, [A("div", {
590
+ class: h(r),
591
+ style: x(r),
592
+ onClick: (L) => r.enable && I(L, r)
593
+ }, [n.shouldShowIcon(r) && A("i", {
594
+ class: n.iconClass(r)
595
+ }, null), A("span", null, [r.text])]), r.split && A("button", {
596
+ class: g(r),
597
+ style: "border-radius:0 6px 6px 0;",
598
+ onClick: (L) => y(L, r)
599
+ }, null), S && l(r)]);
600
+ }
601
+ function f() {
602
+ s();
603
+ }
604
+ return {
605
+ renderToolbarDropdown: m,
606
+ clearAllDropDown: f
607
+ };
608
+ }
609
+ const {
610
+ buildResponseToolbarItems: Ze
611
+ } = ft(), Tn = /* @__PURE__ */ Te({
612
+ name: "FResponseToolbar",
613
+ props: bn,
614
+ emits: ["click"],
615
+ setup(e, c) {
616
+ const n = U(Ze(e.items)), a = U(), l = U(), s = U(), p = {
617
+ id: "__more_buttons__",
618
+ text: "更多"
619
+ }, h = U(new me(p)), g = {
620
+ id: p.id + "width",
621
+ text: p.text
622
+ }, x = U(-1), I = Ne();
623
+ let y = !1;
624
+ const m = ie(() => h.value.children.length > 0), f = ie(() => {
625
+ const w = {
626
+ "f-toolbar": !0,
627
+ "f-response-toolbar": !0,
628
+ "position-relative": !0,
629
+ "f-response-toolbar-sm": e.buttonSize === "sm",
630
+ "f-response-toolbar-lg": e.buttonSize === "lg",
631
+ "d-none": !e.visible
632
+ };
633
+ return te(w, e.customClass);
634
+ }), r = ie(() => ({
635
+ "w-100": !0,
636
+ "d-flex": !0,
637
+ "flex-nowrap": !0,
638
+ "justify-content-end": e.alignment === "right",
639
+ "justify-content-start": e.alignment === "left",
640
+ "justify-content-center": e.alignment === "center"
641
+ })), {
642
+ renderToolbarDropdown: S,
643
+ clearAllDropDown: L
644
+ } = xn(e, c, I);
645
+ function W(w) {
646
+ w && w.target.closest("ul.dropdown-menu") && w.type === "wheel" || (n.value.filter((q) => q.children && q.children.length > 0).forEach((q) => {
647
+ q.expanded = !1;
648
+ }), h.value.expanded = !1, L());
649
+ }
650
+ function _(w, q) {
651
+ var j;
652
+ const F = {
653
+ btn: !0,
654
+ "f-rt-btn": !0,
655
+ "f-btn-ml": e.alignment === "right" || q > 0 && e.alignment === "center",
656
+ "f-btn-mr": e.alignment === "left",
657
+ "btn-icontext": !!(w.icon && w.icon.trim())
658
+ }, O = ((j = w == null ? void 0 : w.appearance) == null ? void 0 : j.class) || w.class || "btn-secondary";
659
+ return te(F, O);
660
+ }
661
+ function B(w, q) {
662
+ document.body.click(), typeof q.onClick == "function" && q.onClick(w, q.id), c.emit("click", w, q.id);
663
+ }
664
+ function i(w, q) {
665
+ if (w.tipsEnable && w.tipsText) {
666
+ const F = be({
667
+ content: w.tipsText,
668
+ enable: w.tipsEnable
669
+ });
670
+ return ye(A("button", {
671
+ type: "button",
672
+ class: _(w, q),
673
+ id: w.id,
674
+ disabled: !w.enable,
675
+ onClick: (O) => B(O, w)
676
+ }, [I.shouldShowIcon(w) && A("i", {
677
+ class: I.iconClass(w)
678
+ }, null), w.text]), [[Ce("tooltip"), F]]);
679
+ }
680
+ return A("button", {
681
+ type: "button",
682
+ class: _(w, q),
683
+ id: w.id,
684
+ disabled: !w.enable,
685
+ onClick: (F) => B(F, w)
686
+ }, [I.shouldShowIcon(w) && A("i", {
687
+ class: I.iconClass(w)
688
+ }, null), w.text]);
689
+ }
690
+ let t = /* @__PURE__ */ new Map(), b = [];
691
+ function C(w) {
692
+ const q = Math.ceil(parseFloat(getComputedStyle(w).getPropertyValue("margin-left"))), F = Math.ceil(parseFloat(getComputedStyle(w).getPropertyValue("margin-right")));
693
+ return (q || 0) + w.getBoundingClientRect().width + (F || 0);
694
+ }
695
+ function k(w, q, F) {
696
+ if (q < x.value) {
697
+ let O = F - 1;
698
+ for (; O >= 0; O--) {
699
+ const j = w[O], G = C(j);
700
+ if (q += G, q >= x.value)
701
+ break;
702
+ }
703
+ F = O;
704
+ }
705
+ return q -= x.value, {
706
+ start: F,
707
+ space: q
708
+ };
709
+ }
710
+ function z(w) {
711
+ const q = s.value;
712
+ let F = w;
713
+ const j = Array.from(q.children).filter((ee) => ee.id !== "__more_buttons__"), G = j.length;
714
+ let V = !1, Y = 0;
715
+ for (; Y < G; Y++) {
716
+ const ee = j[Y], se = C(ee);
717
+ if (se <= F)
718
+ F -= se;
719
+ else {
720
+ const Z = k(j, F, Y);
721
+ Y = Z.start, F = Z.space, V = !0;
722
+ break;
723
+ }
724
+ }
725
+ if (!V && b.length > 0) {
726
+ const ee = k(j, F, Y);
727
+ Y = ee.start, F = ee.space;
728
+ }
729
+ const H = b.length > 0;
730
+ for (; Y < G; Y++) {
731
+ const ee = j[Y], se = C(ee);
732
+ t.set(ee.id, !0), b[H ? "unshift" : "push"]({
733
+ id: ee.id,
734
+ width: se
735
+ });
736
+ }
737
+ return F;
738
+ }
739
+ function v(w) {
740
+ let q = z(w);
741
+ if (b.length) {
742
+ let G = 0;
743
+ for (; G < b.length; G++) {
744
+ const V = e.items.find((Y) => Y.id === b[G].id);
745
+ if (V && V.visible !== !1) {
746
+ const Y = b[G].width;
747
+ if (q >= Y || G === b.length - 1 && q + x.value >= Y)
748
+ q -= Y;
749
+ else
750
+ break;
751
+ }
752
+ }
753
+ for (let V = 0; V < G; V++)
754
+ t.delete(b[V].id);
755
+ b.splice(0, G - 1);
756
+ }
757
+ const F = Object.assign({}, h.value);
758
+ F.children = [];
759
+ const O = new me(F), j = n.value.reduce((G, V) => {
760
+ const Y = e.items.find((H) => H.id === V.id);
761
+ return t.has(V.id) ? (O.children.push(V), V.shown = !1) : V.shown = Y.visible !== !1, G.push(V), G;
762
+ }, []);
763
+ h.value = O, n.value = j;
764
+ }
765
+ function o(w = -1) {
766
+ if (w === 0 || !s.value || !l.value)
767
+ return;
768
+ w < 0 && (w = l.value.getBoundingClientRect().width);
769
+ const q = s.value.getBoundingClientRect().width;
770
+ (w >= 0 && w < q || b.length) && (v(w), W());
771
+ }
772
+ function T() {
773
+ return x.value < 0 && A("div", {
774
+ style: "position:absolute;top:-30px;visibility:hidden;"
775
+ }, [S(new me(g))]);
776
+ }
777
+ const P = new ResizeObserver((w) => {
778
+ if (w.length) {
779
+ const F = w[0].contentRect.width;
780
+ o(F);
781
+ }
782
+ });
783
+ function d() {
784
+ t = /* @__PURE__ */ new Map(), b = [];
785
+ }
786
+ function D() {
787
+ l.value && !y && (P.observe(l.value), y = !0);
788
+ }
789
+ function M() {
790
+ if (a.value && x.value < 0) {
791
+ const w = a.value.querySelector("#" + g.id);
792
+ w && (x.value = C(w));
793
+ }
794
+ }
795
+ return Se(() => {
796
+ M(), o(), D(), document.body.addEventListener("click", W), document.body.addEventListener("wheel", W);
797
+ }), it(() => {
798
+ P.disconnect(), document.body.removeEventListener("click", W), document.body.removeEventListener("wheel", W);
799
+ }), we(() => e.items, () => {
800
+ n.value = Ze(e.items), h.value.children = [], ge(() => {
801
+ d(), o();
802
+ });
803
+ }, {
804
+ deep: !0
805
+ }), we(() => e.visible, (w) => {
806
+ w && ge(() => {
807
+ M(), o(), D();
808
+ });
809
+ }), c.expose({
810
+ elementRef: a
811
+ }), () => A("div", {
812
+ class: f.value,
813
+ id: e.id,
814
+ ref: a,
815
+ style: {
816
+ "overflow-y": x.value < 0 ? "hidden" : "initial"
817
+ }
818
+ }, [e.visible && T(), e.visible && A("div", {
819
+ ref: l,
820
+ class: r.value
821
+ }, [A("div", {
822
+ ref: s,
823
+ class: "d-inline-block f-response-content",
824
+ style: "white-space: nowrap;"
825
+ }, [n.value.filter((w) => w.shown).map((w, q) => w.children && w.children.length > 0 ? S(w) : i(w, q)), m.value && S(h.value)])])]);
826
+ }
827
+ });
828
+ class Sn extends at {
829
+ constructor(n, a, l = "response-toolbar") {
830
+ super(n, a);
831
+ // 有三类值 response-toolbar、section-toolbar、tab-toolbar
832
+ J(this, "toolbarType", "response-toolbar");
833
+ this.toolbarType = l;
834
+ }
835
+ getPropertyConfig(n) {
836
+ return this.propertyConfig.categories.basic = this.getBasicPropConfig(n), this.toolbarType !== "tab-toolbar" && this.getAppearancePropConfig(n), this.toolbarType === "response-toolbar" && (this.propertyConfig.categories.behavior = this.getBehaviorConfig(n)), this.propertyConfig;
837
+ }
838
+ getAppearancePropConfig(n) {
839
+ this.propertyConfig.categories.appearance = {
840
+ title: "外观",
841
+ description: "Appearance",
842
+ properties: {
843
+ class: {
844
+ title: "class样式",
845
+ type: "string",
846
+ description: "组件的CSS样式",
847
+ $converter: "/converter/appearance.converter"
848
+ }
849
+ }
850
+ };
851
+ }
852
+ getBehaviorProperties(n) {
853
+ this.propertyConfig.categories.behavior = {
854
+ title: "行为",
855
+ description: "",
856
+ properties: {
857
+ alignment: {
858
+ title: "对齐方式",
859
+ description: "在工具栏区域内按钮组的位置",
860
+ type: "enum",
861
+ editor: {
862
+ type: "combo-list",
863
+ textField: "name",
864
+ valueField: "value",
865
+ data: [
866
+ {
867
+ value: "left",
868
+ name: "左对齐"
869
+ },
870
+ {
871
+ value: "center",
872
+ name: "居中"
873
+ },
874
+ {
875
+ value: "right",
876
+ name: "右对齐"
877
+ }
878
+ ]
879
+ }
880
+ }
881
+ }
882
+ };
883
+ }
884
+ }
885
+ function Dn(e, c, n) {
886
+ const a = e.schema;
887
+ function l() {
888
+ var S;
889
+ let r = ((S = e.parent) == null ? void 0 : S.schema.type) || "";
890
+ ["page-header", "tabs", "section"].findIndex((L) => L === r) === -1 && (r = ""), n.toolbarPosition = r;
891
+ }
892
+ l();
893
+ function s(r) {
894
+ return !1;
895
+ }
896
+ function p(r, S) {
897
+ return S.text = r.label, S;
898
+ }
899
+ function h() {
900
+ return !1;
901
+ }
902
+ function g() {
903
+ return !1;
904
+ }
905
+ function x() {
906
+ return !1;
907
+ }
908
+ function I() {
909
+ return !0;
910
+ }
911
+ function y(r) {
912
+ return new Sn(r, c, a.type).getPropertyConfig(a);
913
+ }
914
+ function m(r) {
915
+ var _;
916
+ r && (r.stopPropagation(), r.preventDefault());
917
+ const { schema: S } = e;
918
+ S.buttons || (S.buttons = []);
919
+ let L = "";
920
+ if (S.type)
921
+ L = S.type + "-item";
922
+ else {
923
+ const B = (_ = e.parent) == null ? void 0 : _.schema.type;
924
+ L = B === "tabs" ? "tab-toolbar-item" : B === "section" ? "section-toolbar-item" : "response-toolbar-item";
925
+ }
926
+ const W = Le(L);
927
+ W.id = `toolbar_item_${Math.random().toString().slice(2, 6)}`, S.buttons.push(W), n.updateToolbarItems(), n.changeSelectedId("");
928
+ }
929
+ function f() {
930
+ return [
931
+ {
932
+ id: "appendItem",
933
+ title: "新增按钮",
934
+ text: "",
935
+ icon: "f-icon f-icon-plus-circle text-white",
936
+ onClick: (r) => m(r)
937
+ }
938
+ ];
939
+ }
940
+ return {
941
+ canAccepts: s,
942
+ checkCanAddComponent: x,
943
+ checkCanDeleteComponent: g,
944
+ checkCanMoveComponent: h,
945
+ hideNestedPaddingInDesginerView: I,
946
+ onResolveNewComponentSchema: p,
947
+ getPropsConfig: y,
948
+ getCustomButtons: f
949
+ };
950
+ }
951
+ var pe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
952
+ function In(e) {
953
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
954
+ }
955
+ function ve(e) {
956
+ throw new Error('Could not dynamically require "' + e + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
957
+ }
958
+ var pt = { exports: {} };
959
+ (function(e, c) {
960
+ (function(n) {
961
+ e.exports = n();
962
+ })(function() {
963
+ return (/* @__PURE__ */ function() {
964
+ function n(a, l, s) {
965
+ function p(x, I) {
966
+ if (!l[x]) {
967
+ if (!a[x]) {
968
+ var y = typeof ve == "function" && ve;
969
+ if (!I && y) return y(x, !0);
970
+ if (h) return h(x, !0);
971
+ var m = new Error("Cannot find module '" + x + "'");
972
+ throw m.code = "MODULE_NOT_FOUND", m;
973
+ }
974
+ var f = l[x] = { exports: {} };
975
+ a[x][0].call(f.exports, function(r) {
976
+ var S = a[x][1][r];
977
+ return p(S || r);
978
+ }, f, f.exports, n, a, l, s);
979
+ }
980
+ return l[x].exports;
981
+ }
982
+ for (var h = typeof ve == "function" && ve, g = 0; g < s.length; g++) p(s[g]);
983
+ return p;
984
+ }
985
+ return n;
986
+ }())({
987
+ 1: [function(n, a, l) {
988
+ var s = {}, p = "(?:^|\\s)", h = "(?:\\s|$)";
989
+ function g(y) {
990
+ var m = s[y];
991
+ return m ? m.lastIndex = 0 : s[y] = m = new RegExp(p + y + h, "g"), m;
992
+ }
993
+ function x(y, m) {
994
+ var f = y.className;
995
+ f.length ? g(m).test(f) || (y.className += " " + m) : y.className = m;
996
+ }
997
+ function I(y, m) {
998
+ y.className = y.className.replace(g(m), " ").trim();
999
+ }
1000
+ a.exports = {
1001
+ add: x,
1002
+ rm: I
1003
+ };
1004
+ }, {}],
1005
+ 2: [function(n, a, l) {
1006
+ (function(s) {
1007
+ var p = n("contra/emitter"), h = n("crossvent"), g = n("./classes"), x = document, I = x.documentElement;
1008
+ function y(o, T) {
1009
+ var P = arguments.length;
1010
+ P === 1 && Array.isArray(o) === !1 && (T = o, o = []);
1011
+ var d, D, M, w, q, F, O, j, G, V = null, Y, H, ee = !1, se = 0, Z, $ = T || {};
1012
+ $.moves === void 0 && ($.moves = _), $.accepts === void 0 && ($.accepts = _), $.invalid === void 0 && ($.invalid = Tt), $.containers === void 0 && ($.containers = o || []), $.isContainer === void 0 && ($.isContainer = W), $.copy === void 0 && ($.copy = !1), $.copySortSource === void 0 && ($.copySortSource = !1), $.revertOnSpill === void 0 && ($.revertOnSpill = !1), $.removeOnSpill === void 0 && ($.removeOnSpill = !1), $.direction === void 0 && ($.direction = "vertical"), $.ignoreInputTextSelection === void 0 && ($.ignoreInputTextSelection = !0), $.mirrorContainer === void 0 && ($.mirrorContainer = x.body);
1013
+ var K = p({
1014
+ containers: $.containers,
1015
+ start: xt,
1016
+ end: ze,
1017
+ cancel: Ue,
1018
+ remove: Ye,
1019
+ destroy: bt,
1020
+ canMove: wt,
1021
+ dragging: !1
1022
+ });
1023
+ return $.removeOnSpill === !0 && K.on("over", Dt).on("out", It), We(), K;
1024
+ function De(u) {
1025
+ return K.containers.indexOf(u) !== -1 || $.isContainer(u);
1026
+ }
1027
+ function We(u) {
1028
+ var E = u ? "remove" : "add";
1029
+ r(I, E, "mousedown", yt), r(I, E, "mouseup", Ee);
1030
+ }
1031
+ function Ie(u) {
1032
+ var E = u ? "remove" : "add";
1033
+ r(I, E, "mousemove", Ct);
1034
+ }
1035
+ function Fe(u) {
1036
+ var E = u ? "remove" : "add";
1037
+ h[E](I, "selectstart", qe), h[E](I, "click", qe);
1038
+ }
1039
+ function bt() {
1040
+ We(!0), Ee({});
1041
+ }
1042
+ function qe(u) {
1043
+ Y && u.preventDefault();
1044
+ }
1045
+ function yt(u) {
1046
+ w = u.clientX, q = u.clientY;
1047
+ var E = S(u) !== 1 || u.metaKey || u.ctrlKey;
1048
+ if (!E) {
1049
+ var R = u.target, N = Pe(R);
1050
+ N && (Y = N, Ie(), u.type === "mousedown" && (b(R) ? R.focus() : u.preventDefault()));
1051
+ }
1052
+ }
1053
+ function Ct(u) {
1054
+ if (Y) {
1055
+ if (S(u) === 0) {
1056
+ Ee({});
1057
+ return;
1058
+ }
1059
+ if (!(u.clientX !== void 0 && Math.abs(u.clientX - w) <= ($.slideFactorX || 0) && u.clientY !== void 0 && Math.abs(u.clientY - q) <= ($.slideFactorY || 0))) {
1060
+ if ($.ignoreInputTextSelection) {
1061
+ var E = v("clientX", u) || 0, R = v("clientY", u) || 0, N = x.elementFromPoint(E, R);
1062
+ if (b(N))
1063
+ return;
1064
+ }
1065
+ var X = Y;
1066
+ Ie(!0), Fe(), ze(), He(X), g.add(j || M, "gu-transit"), Et(), Pt(), se = 0, Be(u);
1067
+ }
1068
+ }
1069
+ }
1070
+ function Pe(u) {
1071
+ if (!(K.dragging && d) && !De(u)) {
1072
+ for (var E = u; t(u) && De(t(u)) === !1; )
1073
+ if ($.invalid(u, E) || (u = t(u), !u))
1074
+ return;
1075
+ var R = t(u);
1076
+ if (R && !$.invalid(u, E)) {
1077
+ var N = $.moves(u, R, E, k(u));
1078
+ if (N)
1079
+ return {
1080
+ item: u,
1081
+ source: R
1082
+ };
1083
+ }
1084
+ }
1085
+ }
1086
+ function wt(u) {
1087
+ return !!Pe(u);
1088
+ }
1089
+ function xt(u) {
1090
+ var E = Pe(u);
1091
+ E && He(E);
1092
+ }
1093
+ function He(u) {
1094
+ jt(u.item, u.source) && (j = u.item.cloneNode(!0), K.emit("cloned", j, u.item, "copy")), D = u.source, M = u.item, F = O = k(u.item), K.dragging = !0, K.emit("drag", M, D);
1095
+ }
1096
+ function Tt() {
1097
+ return !1;
1098
+ }
1099
+ function ze() {
1100
+ if (K.dragging) {
1101
+ var u = j || M;
1102
+ Ge(u, t(u));
1103
+ }
1104
+ }
1105
+ function Ve() {
1106
+ Y = !1, Ie(!0), Fe(!0);
1107
+ }
1108
+ function Ee(u) {
1109
+ if (Ve(), !!K.dragging) {
1110
+ var E = j || M, R = v("clientX", u) || 0, N = v("clientY", u) || 0, X = L(d, R, N), Q = Xe(X, R, N);
1111
+ Q && (j && $.copySortSource || !j || Q !== D) ? Ge(E, Q) : $.removeOnSpill ? Ye() : Ue();
1112
+ }
1113
+ }
1114
+ function Ge(u, E) {
1115
+ var R = t(u);
1116
+ j && $.copySortSource && E === D && R.removeChild(M), Me(E) ? K.emit("cancel", u, D) : K.emit("drop", u, E, D, O), ke();
1117
+ }
1118
+ function Ye() {
1119
+ if (K.dragging) {
1120
+ var u = j || M, E = t(u);
1121
+ E && E.removeChild(u), K.emit(j ? "cancel" : "remove", u, E, D), ke();
1122
+ }
1123
+ }
1124
+ function Ue(u) {
1125
+ if (K.dragging) {
1126
+ var E = arguments.length > 0 ? u : $.revertOnSpill, R = j || M, N = t(R), X = Me(N);
1127
+ X === !1 && E && (j ? N && N.removeChild(j) : D.insertBefore(R, F)), X || E ? K.emit("cancel", R, D, D) : K.emit("drop", R, N, D, O), ke();
1128
+ }
1129
+ }
1130
+ function ke() {
1131
+ var u = j || M;
1132
+ Ve(), kt(), Mt(), u && g.rm(u, "gu-transit"), G && clearTimeout(G), K.dragging = !1, V && K.emit("out", u, V, D), K.emit("dragend", u, se), D = M = j = F = O = G = V = null;
1133
+ }
1134
+ function Me(u, E) {
1135
+ var R;
1136
+ return E !== void 0 ? R = E : d ? R = O : R = k(j || M), u === D && R === F;
1137
+ }
1138
+ function Xe(u, E, R) {
1139
+ for (var N = u; N && !X(); )
1140
+ N = t(N);
1141
+ return N;
1142
+ function X() {
1143
+ var Q = De(N);
1144
+ if (Q === !1)
1145
+ return !1;
1146
+ var ce = Qe(N, u), re = Je(N, ce, E, R), ae = Me(N, re);
1147
+ return ae ? !0 : $.accepts(M, N, D, re);
1148
+ }
1149
+ }
1150
+ function Be(u) {
1151
+ if (!d)
1152
+ return;
1153
+ u.preventDefault();
1154
+ var E = v("clientX", u) || 0, R = v("clientY", u) || 0;
1155
+ d.style.left = E - 2 + "px", d.style.top = R - 2 + "px";
1156
+ var N = j || M, X = L(d, E, R), Q = Xe(X, E, R), ce = Q !== null && Q !== V;
1157
+ (ce || Q === null) && (le(), V = Q, fe()), _t(X, R);
1158
+ var re = t(N);
1159
+ if (Q === D && j && !$.copySortSource) {
1160
+ re && re.removeChild(N);
1161
+ return;
1162
+ }
1163
+ var ae, de = Qe(Q, X);
1164
+ if (ee = Bt(de, Q), de !== null)
1165
+ ae = Je(Q, de, E, R);
1166
+ else if ($.revertOnSpill === !0 && !j)
1167
+ ae = F, Q = D;
1168
+ else {
1169
+ j && re && re.removeChild(N), j && H && (H.style.display = "none");
1170
+ return;
1171
+ }
1172
+ H.style.display = "block", St(ae, N, ce), ae ? At(de, ae) : Ot(Q);
1173
+ function ne(oe) {
1174
+ K.emit(oe, N, V, D);
1175
+ }
1176
+ function fe() {
1177
+ ce && ne("over");
1178
+ }
1179
+ function le() {
1180
+ V && ne("out");
1181
+ }
1182
+ }
1183
+ function St(u, E, R) {
1184
+ (u === E || u === k(E)) && (O = k(E)), (u === null && R || u !== E && u !== k(E)) && (O = u);
1185
+ }
1186
+ function Dt(u) {
1187
+ g.rm(u, "gu-hide");
1188
+ }
1189
+ function It(u) {
1190
+ K.dragging && g.add(u, "gu-hide");
1191
+ }
1192
+ function Pt() {
1193
+ d || (d = document.createElement("div"), d.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;", d.innerHTML = $.getMirrorText && $.getMirrorText(M) || "控件", g.add(d, "gu-mirror"), $.mirrorContainer.appendChild(d), r(I, "add", "mousemove", Be), g.add($.mirrorContainer, "gu-unselectable"), K.emit("cloned", d, M, "mirror"));
1194
+ }
1195
+ function Et() {
1196
+ if (H = document.createElement("div"), g.add(H, "gu-insertion"), M) {
1197
+ var u = M.getBoundingClientRect();
1198
+ H.style.left = u.left + "px", H.style.top = u.top + "px";
1199
+ }
1200
+ ee = !1, $.mirrorContainer.appendChild(H);
1201
+ }
1202
+ function kt() {
1203
+ d && (g.rm($.mirrorContainer, "gu-unselectable"), r(I, "remove", "mousemove", Be), t(d).removeChild(d), d = null);
1204
+ }
1205
+ function Mt() {
1206
+ H && (t(H).removeChild(H), H = null);
1207
+ }
1208
+ function Qe(u, E) {
1209
+ for (var R = E; R !== u && t(R) !== u; )
1210
+ R = t(R);
1211
+ return R === I ? null : R;
1212
+ }
1213
+ function Bt(u, E) {
1214
+ if (!E)
1215
+ return ee;
1216
+ var R = u || E && E.lastElementChild;
1217
+ if (!R)
1218
+ return !0;
1219
+ var N = getComputedStyle(u), X = /^inline/.test(N.getPropertyValue("display")) || /^(left|right)$/.test(N.getPropertyValue("float"));
1220
+ if (X)
1221
+ return !0;
1222
+ if (E) {
1223
+ var Q = getComputedStyle(E), ce = Q.getPropertyValue("display");
1224
+ if (/flex$/.test(ce)) {
1225
+ var re = Q.getPropertyValue("flex-direction") || "row";
1226
+ if (re === "row" || re === "row-reverse")
1227
+ return !Rt(E);
1228
+ }
1229
+ return !1;
1230
+ }
1231
+ return !0;
1232
+ }
1233
+ function Rt(u) {
1234
+ if (!u.children || !u.children.length)
1235
+ return !1;
1236
+ for (const E of Array.from(u.children)) {
1237
+ const N = (E.className && E.className.split(" ") || []).filter((X) => /^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(X));
1238
+ if (!N.length)
1239
+ return !1;
1240
+ for (const X of N) {
1241
+ const Q = X.slice(X.lastIndexOf("-") + 1);
1242
+ if (parseInt(Q, 10) !== 12)
1243
+ return !1;
1244
+ }
1245
+ }
1246
+ return !0;
1247
+ }
1248
+ function At(u, E) {
1249
+ const R = E.getBoundingClientRect();
1250
+ if (H.style.left = R.left + "px", H.style.top = R.top + "px", ee) {
1251
+ if (H.style.height = R.height + "px", H.style.width = "4px", u) {
1252
+ const N = u.getBoundingClientRect();
1253
+ N.top !== R.top && (H.style.left = N.right + "px", H.style.top = N.top + "px", H.style.height = N.height + "px");
1254
+ }
1255
+ } else if (H.style.height = "4px", H.style.width = R.width + "px", Z) {
1256
+ const N = Z.getBoundingClientRect();
1257
+ R.top < N.top && (H.style.display = "none");
1258
+ }
1259
+ E === M && M && (H.style.display = "none");
1260
+ }
1261
+ function Ot(u) {
1262
+ O = null;
1263
+ var E = u.lastElementChild;
1264
+ if (E) {
1265
+ var R = E.getBoundingClientRect();
1266
+ ee ? (H.style.left = R.right + "px", H.style.top = R.top + "px", H.style.height = R.height + "px", H.style.width = "4px") : (H.style.left = R.left + "px", H.style.top = R.bottom + "px", H.style.height = "4px", H.style.width = R.width + "px"), E === M && M && (H.style.display = "none");
1267
+ } else
1268
+ H.style.display = "none";
1269
+ }
1270
+ function _t(u, E) {
1271
+ if (!$.mirrorContainer.contains(u) || !window.scrollContainerList || !Array.from(window.scrollContainerList).length || (Z = m(u), !Z || !Z.contains(u)))
1272
+ return;
1273
+ const R = document.querySelector(".dgComponentSelected"), N = Z.getBoundingClientRect();
1274
+ if (E - 30 < N.top && Z.scrollTop > 0) {
1275
+ let X = Z.scrollTop < 10 ? Z.scrollTop : 10;
1276
+ Z.scrollBy(0, -1 * X), R && Z.contains(R) && (se = se + -1 * X);
1277
+ }
1278
+ if (E + 30 > N.bottom && Z.scrollTop < Z.scrollHeight - Z.clientHeight) {
1279
+ const X = Z.scrollHeight - Z.clientHeight - Z.scrollTop;
1280
+ let Q = X < 10 ? X : 10;
1281
+ Z.scrollBy(0, Q), R && Z.contains(R) && (se = se + Q);
1282
+ }
1283
+ }
1284
+ function Je(u, E, R, N) {
1285
+ var X = $.direction === "horizontal", Q = $.direction === "mixed", ce = E !== u ? ae() : re();
1286
+ return ce;
1287
+ function re() {
1288
+ var ne = u.children.length, fe, le, oe;
1289
+ for (fe = 0; fe < ne; fe++)
1290
+ if (le = u.children[fe], oe = le.getBoundingClientRect(), X && oe.left + oe.width / 2 > R || !Q && !X && oe.top + oe.height / 2 > N || Q && oe.left + oe.width > R && oe.top + oe.height > N)
1291
+ return le;
1292
+ return null;
1293
+ }
1294
+ function ae() {
1295
+ var ne = E.getBoundingClientRect();
1296
+ if (Q) {
1297
+ var fe = N - ne.top, le = R - ne.left, oe = ne.bottom - N, Re = ne.right - R, Ae = Math.min(le, Re, fe, oe), Oe;
1298
+ return ee ? Oe = Re < le : Oe = oe === Ae || Re === Ae || le === Ae, de(Oe);
1299
+ }
1300
+ return de(X ? R > ne.left + B(ne) / 2 : N > ne.top + i(ne) / 2);
1301
+ }
1302
+ function de(ne) {
1303
+ return ne ? k(E) : E;
1304
+ }
1305
+ }
1306
+ function jt(u, E) {
1307
+ return typeof $.copy == "boolean" ? $.copy : $.copy(u, E);
1308
+ }
1309
+ }
1310
+ function m(o) {
1311
+ const T = Array.from(window.scrollContainerList);
1312
+ if (T.length === 1) {
1313
+ const d = Array.from(window.scrollContainerList)[0];
1314
+ return document.getElementById(d);
1315
+ }
1316
+ const P = f(T);
1317
+ for (const d of P)
1318
+ if (d.contains(o))
1319
+ return d;
1320
+ return null;
1321
+ }
1322
+ function f(o) {
1323
+ const T = [];
1324
+ return o.forEach((P) => {
1325
+ const d = document.getElementById(P);
1326
+ d && T.push(d);
1327
+ }), T.sort((P, d) => P.contains(d) ? 1 : d.contains(P) ? -1 : 0), T;
1328
+ }
1329
+ function r(o, T, P, d) {
1330
+ var D = {
1331
+ mouseup: "touchend",
1332
+ mousedown: "touchstart",
1333
+ mousemove: "touchmove"
1334
+ }, M = {
1335
+ mouseup: "pointerup",
1336
+ mousedown: "pointerdown",
1337
+ mousemove: "pointermove"
1338
+ }, w = {
1339
+ mouseup: "MSPointerUp",
1340
+ mousedown: "MSPointerDown",
1341
+ mousemove: "MSPointerMove"
1342
+ };
1343
+ s.navigator.pointerEnabled ? h[T](o, M[P], d) : s.navigator.msPointerEnabled ? h[T](o, w[P], d) : (h[T](o, D[P], d), h[T](o, P, d));
1344
+ }
1345
+ function S(o) {
1346
+ if (o.touches !== void 0)
1347
+ return o.touches.length;
1348
+ if (o.which !== void 0 && o.which !== 0)
1349
+ return o.which;
1350
+ if (o.buttons !== void 0)
1351
+ return o.buttons;
1352
+ var T = o.button;
1353
+ if (T !== void 0)
1354
+ return T & 1 ? 1 : T & 2 ? 3 : T & 4 ? 2 : 0;
1355
+ }
1356
+ function L(o, T, P) {
1357
+ o = o || {};
1358
+ var d = o.className || "", D;
1359
+ return o.className += " gu-hide", D = x.elementFromPoint(T, P), o.className = d, D;
1360
+ }
1361
+ function W() {
1362
+ return !1;
1363
+ }
1364
+ function _() {
1365
+ return !0;
1366
+ }
1367
+ function B(o) {
1368
+ return o.width || o.right - o.left;
1369
+ }
1370
+ function i(o) {
1371
+ return o.height || o.bottom - o.top;
1372
+ }
1373
+ function t(o) {
1374
+ return o.parentNode === x ? null : o.parentNode;
1375
+ }
1376
+ function b(o) {
1377
+ return o.tagName === "INPUT" || o.tagName === "TEXTAREA" || o.tagName === "SELECT" || C(o);
1378
+ }
1379
+ function C(o) {
1380
+ return !o || o.contentEditable === "false" ? !1 : o.contentEditable === "true" ? !0 : C(t(o));
1381
+ }
1382
+ function k(o) {
1383
+ return o.nextElementSibling || T();
1384
+ function T() {
1385
+ var P = o;
1386
+ do
1387
+ P = P.nextSibling;
1388
+ while (P && P.nodeType !== 1);
1389
+ return P;
1390
+ }
1391
+ }
1392
+ function z(o) {
1393
+ return o.targetTouches && o.targetTouches.length ? o.targetTouches[0] : o.changedTouches && o.changedTouches.length ? o.changedTouches[0] : o;
1394
+ }
1395
+ function v(o, T) {
1396
+ var P = z(T), d = {
1397
+ pageX: "clientX",
1398
+ // IE8
1399
+ pageY: "clientY"
1400
+ // IE8
1401
+ };
1402
+ return o in d && !(o in P) && d[o] in P && (o = d[o]), P[o];
1403
+ }
1404
+ a.exports = y;
1405
+ }).call(this, typeof pe < "u" ? pe : typeof self < "u" ? self : typeof window < "u" ? window : {});
1406
+ }, { "./classes": 1, "contra/emitter": 5, crossvent: 6 }],
1407
+ 3: [function(n, a, l) {
1408
+ a.exports = function(p, h) {
1409
+ return Array.prototype.slice.call(p, h);
1410
+ };
1411
+ }, {}],
1412
+ 4: [function(n, a, l) {
1413
+ var s = n("ticky");
1414
+ a.exports = function(h, g, x) {
1415
+ h && s(function() {
1416
+ h.apply(x || null, g || []);
1417
+ });
1418
+ };
1419
+ }, { ticky: 10 }],
1420
+ 5: [function(n, a, l) {
1421
+ var s = n("atoa"), p = n("./debounce");
1422
+ a.exports = function(g, x) {
1423
+ var I = x || {}, y = {};
1424
+ return g === void 0 && (g = {}), g.on = function(m, f) {
1425
+ return y[m] ? y[m].push(f) : y[m] = [f], g;
1426
+ }, g.once = function(m, f) {
1427
+ return f._once = !0, g.on(m, f), g;
1428
+ }, g.off = function(m, f) {
1429
+ var r = arguments.length;
1430
+ if (r === 1)
1431
+ delete y[m];
1432
+ else if (r === 0)
1433
+ y = {};
1434
+ else {
1435
+ var S = y[m];
1436
+ if (!S)
1437
+ return g;
1438
+ S.splice(S.indexOf(f), 1);
1439
+ }
1440
+ return g;
1441
+ }, g.emit = function() {
1442
+ var m = s(arguments);
1443
+ return g.emitterSnapshot(m.shift()).apply(this, m);
1444
+ }, g.emitterSnapshot = function(m) {
1445
+ var f = (y[m] || []).slice(0);
1446
+ return function() {
1447
+ var r = s(arguments), S = this || g;
1448
+ if (m === "error" && I.throws !== !1 && !f.length)
1449
+ throw r.length === 1 ? r[0] : r;
1450
+ return f.forEach(function(W) {
1451
+ I.async ? p(W, r, S) : W.apply(S, r), W._once && g.off(m, W);
1452
+ }), g;
1453
+ };
1454
+ }, g;
1455
+ };
1456
+ }, { "./debounce": 4, atoa: 3 }],
1457
+ 6: [function(n, a, l) {
1458
+ (function(s) {
1459
+ var p = n("custom-event"), h = n("./eventmap"), g = s.document, x = m, I = r, y = [];
1460
+ s.addEventListener || (x = f, I = S), a.exports = {
1461
+ add: x,
1462
+ remove: I,
1463
+ fabricate: L
1464
+ };
1465
+ function m(t, b, C, k) {
1466
+ return t.addEventListener(b, C, k);
1467
+ }
1468
+ function f(t, b, C) {
1469
+ return t.attachEvent("on" + b, _(t, b, C));
1470
+ }
1471
+ function r(t, b, C, k) {
1472
+ return t.removeEventListener(b, C, k);
1473
+ }
1474
+ function S(t, b, C) {
1475
+ var k = B(t, b, C);
1476
+ if (k)
1477
+ return t.detachEvent("on" + b, k);
1478
+ }
1479
+ function L(t, b, C) {
1480
+ var k = h.indexOf(b) === -1 ? v() : z();
1481
+ t.dispatchEvent ? t.dispatchEvent(k) : t.fireEvent("on" + b, k);
1482
+ function z() {
1483
+ var o;
1484
+ return g.createEvent ? (o = g.createEvent("Event"), o.initEvent(b, !0, !0)) : g.createEventObject && (o = g.createEventObject()), o;
1485
+ }
1486
+ function v() {
1487
+ return new p(b, { detail: C });
1488
+ }
1489
+ }
1490
+ function W(t, b, C) {
1491
+ return function(z) {
1492
+ var v = z || s.event;
1493
+ v.target = v.target || v.srcElement, v.preventDefault = v.preventDefault || function() {
1494
+ v.returnValue = !1;
1495
+ }, v.stopPropagation = v.stopPropagation || function() {
1496
+ v.cancelBubble = !0;
1497
+ }, v.which = v.which || v.keyCode, C.call(t, v);
1498
+ };
1499
+ }
1500
+ function _(t, b, C) {
1501
+ var k = B(t, b, C) || W(t, b, C);
1502
+ return y.push({
1503
+ wrapper: k,
1504
+ element: t,
1505
+ type: b,
1506
+ fn: C
1507
+ }), k;
1508
+ }
1509
+ function B(t, b, C) {
1510
+ var k = i(t, b, C);
1511
+ if (k) {
1512
+ var z = y[k].wrapper;
1513
+ return y.splice(k, 1), z;
1514
+ }
1515
+ }
1516
+ function i(t, b, C) {
1517
+ var k, z;
1518
+ for (k = 0; k < y.length; k++)
1519
+ if (z = y[k], z.element === t && z.type === b && z.fn === C)
1520
+ return k;
1521
+ }
1522
+ }).call(this, typeof pe < "u" ? pe : typeof self < "u" ? self : typeof window < "u" ? window : {});
1523
+ }, { "./eventmap": 7, "custom-event": 8 }],
1524
+ 7: [function(n, a, l) {
1525
+ (function(s) {
1526
+ var p = [], h = "", g = /^on/;
1527
+ for (h in s)
1528
+ g.test(h) && p.push(h.slice(2));
1529
+ a.exports = p;
1530
+ }).call(this, typeof pe < "u" ? pe : typeof self < "u" ? self : typeof window < "u" ? window : {});
1531
+ }, {}],
1532
+ 8: [function(n, a, l) {
1533
+ (function(s) {
1534
+ var p = s.CustomEvent;
1535
+ function h() {
1536
+ try {
1537
+ var g = new p("cat", { detail: { foo: "bar" } });
1538
+ return g.type === "cat" && g.detail.foo === "bar";
1539
+ } catch {
1540
+ }
1541
+ return !1;
1542
+ }
1543
+ a.exports = h() ? p : (
1544
+ // IE >= 9
1545
+ typeof document < "u" && typeof document.createEvent == "function" ? function(x, I) {
1546
+ var y = document.createEvent("CustomEvent");
1547
+ return I ? y.initCustomEvent(x, I.bubbles, I.cancelable, I.detail) : y.initCustomEvent(x, !1, !1, void 0), y;
1548
+ } : (
1549
+ // IE <= 8
1550
+ function(x, I) {
1551
+ var y = document.createEventObject();
1552
+ return y.type = x, I ? (y.bubbles = !!I.bubbles, y.cancelable = !!I.cancelable, y.detail = I.detail) : (y.bubbles = !1, y.cancelable = !1, y.detail = void 0), y;
1553
+ }
1554
+ )
1555
+ );
1556
+ }).call(this, typeof pe < "u" ? pe : typeof self < "u" ? self : typeof window < "u" ? window : {});
1557
+ }, {}],
1558
+ 9: [function(n, a, l) {
1559
+ var s = a.exports = {}, p, h;
1560
+ function g() {
1561
+ throw new Error("setTimeout has not been defined");
1562
+ }
1563
+ function x() {
1564
+ throw new Error("clearTimeout has not been defined");
1565
+ }
1566
+ (function() {
1567
+ try {
1568
+ typeof setTimeout == "function" ? p = setTimeout : p = g;
1569
+ } catch {
1570
+ p = g;
1571
+ }
1572
+ try {
1573
+ typeof clearTimeout == "function" ? h = clearTimeout : h = x;
1574
+ } catch {
1575
+ h = x;
1576
+ }
1577
+ })();
1578
+ function I(i) {
1579
+ if (p === setTimeout)
1580
+ return setTimeout(i, 0);
1581
+ if ((p === g || !p) && setTimeout)
1582
+ return p = setTimeout, setTimeout(i, 0);
1583
+ try {
1584
+ return p(i, 0);
1585
+ } catch {
1586
+ try {
1587
+ return p.call(null, i, 0);
1588
+ } catch {
1589
+ return p.call(this, i, 0);
1590
+ }
1591
+ }
1592
+ }
1593
+ function y(i) {
1594
+ if (h === clearTimeout)
1595
+ return clearTimeout(i);
1596
+ if ((h === x || !h) && clearTimeout)
1597
+ return h = clearTimeout, clearTimeout(i);
1598
+ try {
1599
+ return h(i);
1600
+ } catch {
1601
+ try {
1602
+ return h.call(null, i);
1603
+ } catch {
1604
+ return h.call(this, i);
1605
+ }
1606
+ }
1607
+ }
1608
+ var m = [], f = !1, r, S = -1;
1609
+ function L() {
1610
+ !f || !r || (f = !1, r.length ? m = r.concat(m) : S = -1, m.length && W());
1611
+ }
1612
+ function W() {
1613
+ if (!f) {
1614
+ var i = I(L);
1615
+ f = !0;
1616
+ for (var t = m.length; t; ) {
1617
+ for (r = m, m = []; ++S < t; )
1618
+ r && r[S].run();
1619
+ S = -1, t = m.length;
1620
+ }
1621
+ r = null, f = !1, y(i);
1622
+ }
1623
+ }
1624
+ s.nextTick = function(i) {
1625
+ var t = new Array(arguments.length - 1);
1626
+ if (arguments.length > 1)
1627
+ for (var b = 1; b < arguments.length; b++)
1628
+ t[b - 1] = arguments[b];
1629
+ m.push(new _(i, t)), m.length === 1 && !f && I(W);
1630
+ };
1631
+ function _(i, t) {
1632
+ this.fun = i, this.array = t;
1633
+ }
1634
+ _.prototype.run = function() {
1635
+ this.fun.apply(null, this.array);
1636
+ }, s.title = "browser", s.browser = !0, s.env = {}, s.argv = [], s.version = "", s.versions = {};
1637
+ function B() {
1638
+ }
1639
+ s.on = B, s.addListener = B, s.once = B, s.off = B, s.removeListener = B, s.removeAllListeners = B, s.emit = B, s.prependListener = B, s.prependOnceListener = B, s.listeners = function(i) {
1640
+ return [];
1641
+ }, s.binding = function(i) {
1642
+ throw new Error("process.binding is not supported");
1643
+ }, s.cwd = function() {
1644
+ return "/";
1645
+ }, s.chdir = function(i) {
1646
+ throw new Error("process.chdir is not supported");
1647
+ }, s.umask = function() {
1648
+ return 0;
1649
+ };
1650
+ }, {}],
1651
+ 10: [function(n, a, l) {
1652
+ (function(s) {
1653
+ var p = typeof s == "function", h;
1654
+ p ? h = function(g) {
1655
+ s(g);
1656
+ } : h = function(g) {
1657
+ setTimeout(g, 0);
1658
+ }, a.exports = h;
1659
+ }).call(this, n("timers").setImmediate);
1660
+ }, { timers: 11 }],
1661
+ 11: [function(n, a, l) {
1662
+ (function(s, p) {
1663
+ var h = n("process/browser.js").nextTick, g = Function.prototype.apply, x = Array.prototype.slice, I = {}, y = 0;
1664
+ l.setTimeout = function() {
1665
+ return new m(g.call(setTimeout, window, arguments), clearTimeout);
1666
+ }, l.setInterval = function() {
1667
+ return new m(g.call(setInterval, window, arguments), clearInterval);
1668
+ }, l.clearTimeout = l.clearInterval = function(f) {
1669
+ f.close();
1670
+ };
1671
+ function m(f, r) {
1672
+ this._id = f, this._clearFn = r;
1673
+ }
1674
+ m.prototype.unref = m.prototype.ref = function() {
1675
+ }, m.prototype.close = function() {
1676
+ this._clearFn.call(window, this._id);
1677
+ }, l.enroll = function(f, r) {
1678
+ clearTimeout(f._idleTimeoutId), f._idleTimeout = r;
1679
+ }, l.unenroll = function(f) {
1680
+ clearTimeout(f._idleTimeoutId), f._idleTimeout = -1;
1681
+ }, l._unrefActive = l.active = function(f) {
1682
+ clearTimeout(f._idleTimeoutId);
1683
+ var r = f._idleTimeout;
1684
+ r >= 0 && (f._idleTimeoutId = setTimeout(function() {
1685
+ f._onTimeout && f._onTimeout();
1686
+ }, r));
1687
+ }, l.setImmediate = typeof s == "function" ? s : function(f) {
1688
+ var r = y++, S = arguments.length < 2 ? !1 : x.call(arguments, 1);
1689
+ return I[r] = !0, h(function() {
1690
+ I[r] && (S ? f.apply(null, S) : f.call(null), l.clearImmediate(r));
1691
+ }), r;
1692
+ }, l.clearImmediate = typeof p == "function" ? p : function(f) {
1693
+ delete I[f];
1694
+ };
1695
+ }).call(this, n("timers").setImmediate, n("timers").clearImmediate);
1696
+ }, { "process/browser.js": 9, timers: 11 }]
1697
+ }, {}, [2])(2);
1698
+ });
1699
+ })(pt);
1700
+ var Pn = pt.exports;
1701
+ const Ke = /* @__PURE__ */ In(Pn);
1702
+ function En(e) {
1703
+ let c;
1704
+ function n(l, s, p, h) {
1705
+ const g = e.schema;
1706
+ if (!(g != null && g.buttons))
1707
+ return;
1708
+ let x;
1709
+ if (p) {
1710
+ const f = p.getAttribute("id");
1711
+ x = Array.from(s.children).findIndex((r) => r.getAttribute("id") === f);
1712
+ } else
1713
+ x = Array.from(s.children).length;
1714
+ const I = l.getAttribute("id"), y = Array.from(s.children).findIndex((f) => f.getAttribute("id") === I), m = g.buttons[y];
1715
+ y !== x && y > -1 && x > -1 && (y < x && (x = x - 1), g.buttons.splice(y, 1), g.buttons.splice(x, 0, m), h(), ge(() => {
1716
+ const f = s.querySelector(".dgComponentSelected");
1717
+ f != null && f.className.includes("dgComponentSelected") && (f.classList.remove("dgComponentSelected"), f.classList.remove("dgComponentFocused"), f.click()), lt.value++;
1718
+ }));
1719
+ }
1720
+ function a(l, s, p) {
1721
+ c && c.destroy(), !(!Ke || !l || !s) && (c = Ke([l], {
1722
+ mirrorContainer: s,
1723
+ direction: "horizontal",
1724
+ getMirrorText(h) {
1725
+ return h.innerText;
1726
+ },
1727
+ // 判断是否可移动
1728
+ moves(h, g, x) {
1729
+ let I = !0;
1730
+ return x.classList.contains("dropdown-item") ? (I = !1, I) : (h.classList.contains("no-drag") && (I = !1), I);
1731
+ }
1732
+ }).on("drop", (h, g, x, I) => n(h, g, I, p)));
1733
+ }
1734
+ return {
1735
+ dragulaInstance: c,
1736
+ initDragula: a
1737
+ };
1738
+ }
1739
+ function kn(e, c, n) {
1740
+ const {
1741
+ renderToolbarItemDesigner: a,
1742
+ actionHandlers: l
1743
+ } = n;
1744
+ let s;
1745
+ function p(_) {
1746
+ s = _;
1747
+ }
1748
+ function h(_, B = null) {
1749
+ const i = c.value.find((t) => t.id === _.id);
1750
+ if (i.isDP)
1751
+ if (document.body.click(), typeof B == "boolean")
1752
+ i.expanded = B;
1753
+ else {
1754
+ const t = _.expanded;
1755
+ i.expanded = !t;
1756
+ }
1757
+ }
1758
+ l.toggleDropdownMenu = h;
1759
+ function g(_) {
1760
+ var i;
1761
+ const B = {
1762
+ "dropdown-menu": !0
1763
+ };
1764
+ if (_.class) {
1765
+ const t = (i = _.menuClass) == null ? void 0 : i.split(" ");
1766
+ t && t.length && t.reduce((b, C) => (b[C] = !0, b), B);
1767
+ }
1768
+ return B;
1769
+ }
1770
+ function x(_) {
1771
+ var t;
1772
+ const B = {
1773
+ disabled: _.disabled === !1,
1774
+ "dropdown-submenu": !0,
1775
+ "f-rt-dropdown": !0,
1776
+ "text-truncate": !0
1777
+ }, i = (t = _.dropdownClass) == null ? void 0 : t.split(" ");
1778
+ return i && i.length && i.reduce((b, C) => (b[C] = !0, b), B), B;
1779
+ }
1780
+ function I(_) {
1781
+ const B = {
1782
+ disabled: !1,
1783
+ "dropdown-item": !0,
1784
+ "f-rt-btn": !0,
1785
+ "position-relative": !0,
1786
+ "farris-component": !0,
1787
+ "text-truncate": !0
1788
+ }, i = (_.class || "").split(" ");
1789
+ return i && i.length && i.reduce((t, b) => (t[b] = !0, t), B), B;
1790
+ }
1791
+ let y;
1792
+ const m = /* @__PURE__ */ new Map();
1793
+ function f(_, B, i) {
1794
+ _.stopPropagation();
1795
+ const t = i ? i.id : "__top_item__";
1796
+ if (B.children && B.children.length && (B.expanded = !B.expanded, B.expanded)) {
1797
+ if (m.has(t) && m.get(t) !== B) {
1798
+ const b = m.get(t);
1799
+ b && (b.expanded = !1, m.delete(t));
1800
+ }
1801
+ m.set(t, B);
1802
+ }
1803
+ }
1804
+ function r(_) {
1805
+ var B;
1806
+ return (B = _.children) == null ? void 0 : B.map((i, t) => i.children && i.children.length ? A("li", {
1807
+ class: x(i),
1808
+ id: i.id
1809
+ }, [A("span", {
1810
+ class: I(i),
1811
+ onClick: (b) => f(b, i, _)
1812
+ }, [i.text, A("i", {
1813
+ class: "f-icon f-icon-arrow-chevron-right",
1814
+ style: "display: inline-block;float: right;line-height: 1.25rem;"
1815
+ }, null)]), y(i, i)]) : a(i, t, !0));
1816
+ }
1817
+ function S(_, B, i, t) {
1818
+ const {
1819
+ height: k,
1820
+ left: z,
1821
+ top: v
1822
+ } = t[0], {
1823
+ width: o,
1824
+ height: T
1825
+ } = i.getBoundingClientRect(), {
1826
+ marginTop: P,
1827
+ marginBottom: d
1828
+ } = getComputedStyle(i), D = Math.ceil(parseFloat(P)) + Math.ceil(parseFloat(d)), M = v + k, w = B == null ? void 0 : B.getBoundingClientRect();
1829
+ function q() {
1830
+ let G = 0, V = "left";
1831
+ const Y = w ? w.right : window.innerWidth, H = w ? w.left : 0;
1832
+ return G = Y - z - 10, Y - z < o && z - H > Y - z && (V = "right", G = z - H - 10), {
1833
+ hposition: V,
1834
+ maxWidth: Math.min(G, 300)
1835
+ };
1836
+ }
1837
+ let F = 0, O = "bottom";
1838
+ if (_ === "tabs" || _ === "section")
1839
+ F = B.getBoundingClientRect().bottom - M - D - 10;
1840
+ else {
1841
+ const G = w ? w.bottom : window.innerHeight;
1842
+ F = _ === "page-header" ? G - M : v, F = F - D - 10, O = _ === "page-header" ? "bottom" : "top";
1843
+ }
1844
+ const j = q();
1845
+ return {
1846
+ position: O + "-" + j.hposition,
1847
+ maxWidth: j.maxWidth,
1848
+ maxHeight: F
1849
+ };
1850
+ }
1851
+ function L(_) {
1852
+ var C, k, z;
1853
+ const B = "300px", i = {
1854
+ display: _.expanded === !0 ? "block" : "none",
1855
+ position: "absolute",
1856
+ maxWidth: B,
1857
+ minWidth: "120px"
1858
+ };
1859
+ if (!(s != null && s.value))
1860
+ return i;
1861
+ const t = s.value.querySelector("#" + _.id), b = t == null ? void 0 : t.getClientRects();
1862
+ if (t && b && b.length > 0) {
1863
+ const v = t ? t.querySelector("#" + _.id + "_menu") : null;
1864
+ if (!v || _.expanded !== !0)
1865
+ return i;
1866
+ v.style.visibility = "hidden", v.style.display = "block", v.style.maxHeight = "auto", v.style.maxWidth = B;
1867
+ let o;
1868
+ switch (l.toolbarPosition) {
1869
+ case "tabs":
1870
+ o = (C = s.value) == null ? void 0 : C.closest(".farris-tabs");
1871
+ break;
1872
+ case "section":
1873
+ o = (k = s.value) == null ? void 0 : k.closest(".f-section");
1874
+ break;
1875
+ default:
1876
+ o = (z = s.value) == null ? void 0 : z.closest(".f-page");
1877
+ }
1878
+ const T = S(l.toolbarPosition, o, v, b), {
1879
+ position: P,
1880
+ maxHeight: d,
1881
+ maxWidth: D
1882
+ } = T;
1883
+ v.style.visibility = "visible";
1884
+ const M = {
1885
+ left: P.indexOf("left") > -1 ? 0 : "unset",
1886
+ right: P.indexOf("left") > -1 ? "unset" : 0,
1887
+ bottom: P.indexOf("bottom") > -1 ? "unset" : "100%",
1888
+ top: P.indexOf("bottom") > -1 ? "!00%" : "unset",
1889
+ maxWidth: D ? D + "px" : "300px",
1890
+ maxHeight: d ? d + "px" : "auto",
1891
+ overflowY: d ? "auto" : "unset"
1892
+ };
1893
+ Object.assign(i, M);
1894
+ }
1895
+ return i;
1896
+ }
1897
+ l.changeMenuPosition = L, y = function(_, B) {
1898
+ return A("ul", {
1899
+ class: g(_),
1900
+ style: L(_),
1901
+ id: _.id + "_menu"
1902
+ }, [r(_)]);
1903
+ };
1904
+ function W(_ = "") {
1905
+ _ && m.has(_) ? m.forEach((B, i) => {
1906
+ i !== _ && (B.expanded = !1, m.delete(i));
1907
+ }) : (m.forEach((B) => {
1908
+ B.expanded = !1;
1909
+ }), m.clear());
1910
+ }
1911
+ return {
1912
+ renderDropdownMenu: y,
1913
+ clearAllDropDownMenu: W,
1914
+ setResponseToolbarRef: p
1915
+ };
1916
+ }
1917
+ const Mn = {
1918
+ id: { type: String, default: "" },
1919
+ componentId: { type: String, default: "" },
1920
+ canAdd: { type: Boolean, default: !1 },
1921
+ canDelete: { type: Boolean, default: !1 },
1922
+ canMove: { type: Boolean, default: !1 },
1923
+ contentKey: { type: String, default: "contents" },
1924
+ childLabel: { type: String, default: "" },
1925
+ childType: { type: String, default: "" },
1926
+ /**
1927
+ * 组件值
1928
+ */
1929
+ modelValue: { type: Object }
1930
+ }, et = U(0);
1931
+ function Bn(e, c) {
1932
+ const n = c.getBoundingClientRect(), a = e.getBoundingClientRect(), l = a.top >= n.top, s = a.top <= n.bottom;
1933
+ return l && s;
1934
+ }
1935
+ function Rn(e) {
1936
+ const c = e.querySelector(".component-btn-group");
1937
+ if (!c)
1938
+ return;
1939
+ c.style.display = "";
1940
+ const n = c.getBoundingClientRect();
1941
+ if (!(n.top === 0 && n.left === 0)) {
1942
+ const a = c.querySelector("div");
1943
+ if (a) {
1944
+ const l = a.getBoundingClientRect();
1945
+ a.style.top = n.top + "px";
1946
+ let s = n.left - l.width;
1947
+ const p = document.querySelector(".editorDiv");
1948
+ if (p) {
1949
+ const h = p.getBoundingClientRect();
1950
+ s < h.left && ({ left: s } = e.getBoundingClientRect());
1951
+ }
1952
+ a.style.left = s + "px";
1953
+ }
1954
+ }
1955
+ }
1956
+ function An(e) {
1957
+ if (!window.scrollContainerList)
1958
+ return;
1959
+ const c = Array.from(window.scrollContainerList);
1960
+ if (c.length && c.length === 1) {
1961
+ const n = c[0], a = document.querySelector(`[id=${n}]`);
1962
+ if (a && a.contains(e))
1963
+ return a;
1964
+ }
1965
+ }
1966
+ function ht(e) {
1967
+ if (!e)
1968
+ return;
1969
+ const c = e.getBoundingClientRect();
1970
+ if (c.width === 0 && c.height === 0)
1971
+ return;
1972
+ const n = e.querySelector(".component-btn-group");
1973
+ if (n) {
1974
+ let a = !0;
1975
+ const l = An(e);
1976
+ if (l && (a = Bn(e, l)), !a) {
1977
+ n.style.display = "none";
1978
+ return;
1979
+ }
1980
+ Rn(e);
1981
+ }
1982
+ }
1983
+ function On(e) {
1984
+ if (!e)
1985
+ return;
1986
+ let c;
1987
+ e.className.includes("dgComponentSelected") ? c = e : c = e.querySelector(".dgComponentSelected"), c && ht(c);
1988
+ }
1989
+ const _n = {}, jn = {};
1990
+ function gt(e) {
1991
+ const { properties: c, title: n, ignore: a } = e, l = a && Array.isArray(a), s = Object.keys(c).reduce((p, h) => ((!l || !a.find((g) => g === h)) && (p[h] = c[h].type === "object" && c[h].properties ? gt(c[h]) : he(c[h].default)), p), {});
1992
+ if (n && (!l || !a.find((p) => p === "id"))) {
1993
+ const p = n.toLowerCase().replace(/-/g, "_");
1994
+ s.id = `${p}_${Math.random().toString().slice(2, 6)}`;
1995
+ }
1996
+ return s;
1997
+ }
1998
+ function Ln(e) {
1999
+ const { properties: c, title: n, required: a } = e;
2000
+ if (a && Array.isArray(a)) {
2001
+ const l = a.reduce((s, p) => (s[p] = c[p].type === "object" && c[p].properties ? gt(c[p]) : he(c[p].default), s), {});
2002
+ if (n && a.find((s) => s === "id")) {
2003
+ const s = n.toLowerCase().replace(/-/g, "_");
2004
+ l.id = `${s}_${Math.random().toString().slice(2, 6)}`;
2005
+ }
2006
+ return l;
2007
+ }
2008
+ return {
2009
+ type: n
2010
+ };
2011
+ }
2012
+ function vt(e, c = {}, n) {
2013
+ const a = _n[e];
2014
+ if (a) {
2015
+ let l = Ln(a);
2016
+ const s = jn[e];
2017
+ return l = s ? s({ getSchemaByType: vt }, l, c, n) : l, l;
2018
+ }
2019
+ return null;
2020
+ }
2021
+ function $n(e, c, n) {
2022
+ var b;
2023
+ const a = "", l = U();
2024
+ function s() {
2025
+ return !0;
2026
+ }
2027
+ function p() {
2028
+ return !1;
2029
+ }
2030
+ function h() {
2031
+ return !0;
2032
+ }
2033
+ function g() {
2034
+ return !0;
2035
+ }
2036
+ function x() {
2037
+ return !0;
2038
+ }
2039
+ function I(C) {
2040
+ if (!C || !C.value)
2041
+ return null;
2042
+ const k = U(C == null ? void 0 : C.value.parent), z = I(k);
2043
+ return z || null;
2044
+ }
2045
+ function y(C = c) {
2046
+ var o;
2047
+ const { componentInstance: k, designerItemElementRef: z } = C;
2048
+ if (!k || !k.value)
2049
+ return null;
2050
+ const { getCustomButtons: v } = k.value;
2051
+ return k.value.canMove || k.value.canAdd || k.value.canDelete || v && ((o = v()) != null && o.length) ? z : y(C.parent);
2052
+ }
2053
+ function m() {
2054
+ }
2055
+ function f(C) {
2056
+ return !!n;
2057
+ }
2058
+ function r() {
2059
+ return (c == null ? void 0 : c.schema.label) || (c == null ? void 0 : c.schema.title) || (c == null ? void 0 : c.schema.name);
2060
+ }
2061
+ function S() {
2062
+ }
2063
+ function L(C, k) {
2064
+ }
2065
+ function W(C) {
2066
+ const { componentType: k } = C, z = ue("designer-host-service");
2067
+ let v = vt(k, C, z);
2068
+ const o = k.toLowerCase().replace(/-/g, "_");
2069
+ return v && !v.id && v.type === k && (v.id = `${o}_${Math.random().toString().slice(2, 6)}`), v;
2070
+ }
2071
+ function _(C) {
2072
+ }
2073
+ function B(...C) {
2074
+ return [];
2075
+ }
2076
+ function i() {
2077
+ }
2078
+ function t(C) {
2079
+ }
2080
+ return l.value = {
2081
+ canMove: s(),
2082
+ canSelectParent: p(),
2083
+ canAdd: g(),
2084
+ canDelete: h(),
2085
+ canNested: !x(),
2086
+ contents: [],
2087
+ elementRef: e,
2088
+ parent: (b = c.parent) == null ? void 0 : b.componentInstance,
2089
+ schema: c.schema,
2090
+ styles: a,
2091
+ canAccepts: f,
2092
+ getBelongedComponentInstance: I,
2093
+ getDraggableDesignItemElement: y,
2094
+ getDraggingDisplayText: r,
2095
+ getPropConfig: B,
2096
+ getDragScopeElement: S,
2097
+ onAcceptMovedChildElement: L,
2098
+ onChildElementMovedOut: _,
2099
+ addNewChildComponentSchema: W,
2100
+ onRemoveComponent: i,
2101
+ triggerBelongedComponentToMoveWhenMoved: U(!1),
2102
+ triggerBelongedComponentToDeleteWhenDeleted: U(!1),
2103
+ onPropertyChanged: t,
2104
+ getCustomButtons: m
2105
+ }, l;
2106
+ }
2107
+ const Nn = /* @__PURE__ */ Te({
2108
+ name: "FDesignerInnerItem",
2109
+ props: Mn,
2110
+ emits: ["selectionChange", "addComponent", "removeComponent", "clickButton"],
2111
+ setup(e, c) {
2112
+ const n = U(e.canMove), a = U(e.canAdd), l = U(e.canDelete), s = U(!1), p = U(e.contentKey), h = U(e.childType), g = U(e.childLabel), x = U(e.modelValue), I = U(""), y = U(), m = ue("canvas-dragula"), f = U(), r = ue("design-item-context"), S = {
2113
+ designerItemElementRef: y,
2114
+ componentInstance: f,
2115
+ schema: x.value,
2116
+ parent: r,
2117
+ setupContext: c
2118
+ };
2119
+ st("design-item-context", S);
2120
+ const L = ie(() => {
2121
+ var M;
2122
+ const d = ((M = f.value) == null ? void 0 : M.getCustomButtons) && f.value.getCustomButtons();
2123
+ return {
2124
+ "farris-component": !0,
2125
+ // 受position-relative影响,整个容器的高度不能被撑起
2126
+ "flex-fill": e.id === "root-component",
2127
+ "position-relative": n.value || l.value || (d == null ? void 0 : d.length),
2128
+ "farris-nested": s.value,
2129
+ "can-move": n.value,
2130
+ "d-none": y.value && y.value.classList.contains("d-none")
2131
+ };
2132
+ }), W = ie(() => {
2133
+ const d = {};
2134
+ return I.value && I.value.split(";").reduce((D, M) => {
2135
+ const [w, q] = M.split(":");
2136
+ return w && (D[w] = q), D;
2137
+ }, d), d;
2138
+ });
2139
+ function _(d, D) {
2140
+ if (r && r.schema[p.value]) {
2141
+ const M = r.schema[p.value].findIndex((w) => w.id === D.id);
2142
+ if (M > -1) {
2143
+ const w = r.schema[p.value].length, q = r.schema[p.value][M % w];
2144
+ r.designerItemElementRef.value.querySelector(`#${q.id}-design-item`), r.schema[p.value].splice(M, 1), et.value++, c.emit("removeComponent"), c.emit("selectionChange");
2145
+ }
2146
+ }
2147
+ }
2148
+ function B(d) {
2149
+ if (f.value.addNewChildComponentSchema) {
2150
+ const D = {
2151
+ componentType: h.value,
2152
+ label: g.value,
2153
+ parentComponentInstance: f.value,
2154
+ targetPosition: -1
2155
+ }, M = f.value.addNewChildComponentSchema(D);
2156
+ x.value[p.value].push(M), c.emit("addComponent");
2157
+ }
2158
+ }
2159
+ function i() {
2160
+ return a.value && A("div", {
2161
+ role: "button",
2162
+ class: "btn component-settings-button",
2163
+ title: "新增",
2164
+ ref: "removeComponent",
2165
+ onClick: (d) => {
2166
+ B();
2167
+ }
2168
+ }, [A("i", {
2169
+ class: "f-icon f-icon-plus-circle"
2170
+ }, null)]);
2171
+ }
2172
+ function t(d) {
2173
+ return l.value && A("div", {
2174
+ role: "button",
2175
+ class: "btn component-settings-button",
2176
+ title: "删除",
2177
+ ref: "removeComponent",
2178
+ onClick: zt((D) => _(D, d), ["stop"])
2179
+ }, [A("i", {
2180
+ class: "f-icon f-icon-yxs_delete"
2181
+ }, null)]);
2182
+ }
2183
+ function b() {
2184
+ return n.value && A("div", {
2185
+ role: "button",
2186
+ class: "btn component-settings-button",
2187
+ title: "移动",
2188
+ ref: "moveComponent"
2189
+ }, [A("i", {
2190
+ "data-dragging-icon": "true",
2191
+ class: "cmp_move f-icon f-icon-yxs_move"
2192
+ }, null)]);
2193
+ }
2194
+ function C() {
2195
+ var D;
2196
+ const d = ((D = f.value) == null ? void 0 : D.getCustomButtons) && f.value.getCustomButtons();
2197
+ return d && !!d.length && d.map((M) => A("div", {
2198
+ role: "button",
2199
+ class: `btn component-settings-button ${M.class || ""} ${M.text ? "settings-button-extend" : ""}`,
2200
+ title: M.title,
2201
+ ref: M.id,
2202
+ onClick: (w) => M.onClick && M.onClick(w)
2203
+ }, [A("i", {
2204
+ class: "f-icon " + M.icon
2205
+ }, null), M.text && A("span", {
2206
+ class: "icon-text"
2207
+ }, [M.text])]));
2208
+ }
2209
+ function k(d) {
2210
+ return A("div", {
2211
+ class: "component-btn-group",
2212
+ "data-noattach": "true"
2213
+ }, [A("div", null, [i(), b(), t(d), C()])]);
2214
+ }
2215
+ we(() => e.modelValue, (d) => {
2216
+ x.value = d, S.schema = d;
2217
+ });
2218
+ function z(d) {
2219
+ window.scrollContainerList || (window.scrollContainerList = /* @__PURE__ */ new Set());
2220
+ const D = d.getAttribute("id");
2221
+ D && window.scrollContainerList.add(D);
2222
+ }
2223
+ function v(d) {
2224
+ const D = d.target;
2225
+ z(D), On(D);
2226
+ }
2227
+ function o() {
2228
+ var d, D;
2229
+ (D = (d = x.value) == null ? void 0 : d.contents) != null && D.length && y.value && y.value.addEventListener("scroll", v);
2230
+ }
2231
+ function T() {
2232
+ const d = y.value, D = U(d.children[1]);
2233
+ return $n(D, S).value;
2234
+ }
2235
+ Se(() => {
2236
+ if (y.value) {
2237
+ const d = y.value.querySelector(`[data-dragref='${x.value.id}-container']`);
2238
+ f.value = d && d.componentInstance ? d.componentInstance.value : T(), m && d && m.attachComponents(d, x.value), s.value = f.value.canNested !== void 0 ? f.value.canNested : s.value, a.value = f.value.canAdd !== void 0 ? f.value.canAdd : a.value, l.value = f.value.canDelete !== void 0 ? f.value.canDelete : l.value, n.value = f.value.canMove !== void 0 ? f.value.canMove : n.value, I.value = f.value.styles || "", y.value && (y.value.componentInstance = f, y.value.designItemContext = S);
2239
+ }
2240
+ o(), et.value++;
2241
+ }), Ht(() => {
2242
+ y.value && y.value.removeEventListener("scroll", v);
2243
+ });
2244
+ function P(d) {
2245
+ d && (d.preventDefault(), d.stopPropagation());
2246
+ let D = S.designerItemElementRef;
2247
+ const M = y.value;
2248
+ if (M) {
2249
+ const w = document.getElementsByClassName("dgComponentFocused");
2250
+ w && w.length === 1 && w[0] === y.value && y.value.classList.contains("dgComponentSelected") || (Array.from(w).forEach((F) => F.classList.remove("dgComponentFocused")), Array.from(document.getElementsByClassName("dgComponentSelected")).forEach((F) => F.classList.remove("dgComponentSelected")), M.classList.add("dgComponentFocused"), c.emit("selectionChange", x.value.type, x.value, e.componentId, f.value), f.value.getDraggableDesignItemElement && (D = f.value.getDraggableDesignItemElement(S), D && D.value && D.value.classList.add("dgComponentSelected")));
2251
+ }
2252
+ ht(D == null ? void 0 : D.value);
2253
+ }
2254
+ return () => A("div", {
2255
+ id: `${e.id}-design-item`,
2256
+ ref: y,
2257
+ class: L.value,
2258
+ style: W.value,
2259
+ onClick: P
2260
+ }, [k(x.value), c.slots.default && c.slots.default()]);
2261
+ }
2262
+ });
2263
+ class Wn extends at {
2264
+ constructor(n, a, l = "response-toolbar-item") {
2265
+ super(n, a);
2266
+ J(this, "toolbarType", "response-toolbar-item");
2267
+ this.toolbarType = l;
2268
+ }
2269
+ /**
2270
+ *
2271
+ * @param propertyData
2272
+ * @param isDropdownItem 是否是下拉子项,有些属性在下拉子项上不应该显示
2273
+ * @returns
2274
+ */
2275
+ getPropertyConfig(n, a = !1) {
2276
+ this.propertyConfig.categories.basic = this.getBasicPropConfig(n), this.propertyConfig.categories.basic.properties.text = {
2277
+ title: "文本",
2278
+ type: "string",
2279
+ description: "",
2280
+ refreshPanelAfterChanged: !0
2281
+ }, this.propertyConfig.categories.basic.setPropertyRelates = (s) => {
2282
+ if (s)
2283
+ switch (s && s.propertyID) {
2284
+ case "text": {
2285
+ s.needRefreshControlTree = !0;
2286
+ break;
2287
+ }
2288
+ }
2289
+ }, this.getAppearanceProperties(n, a);
2290
+ const l = this.getPropertyEditorParams(n, ["Const", "Variable", "StateMachine", "Expression"], "disabled");
2291
+ return this.propertyConfig.categories.behavior = this.getBehaviorConfig(n, "", {
2292
+ disabled: {
2293
+ title: "禁用",
2294
+ type: "boolean",
2295
+ description: "按钮禁用状态",
2296
+ refreshPanelAfterChanged: !0,
2297
+ editor: l
2298
+ }
2299
+ }), this.getEventPropConfig(n), this.propertyConfig;
2300
+ }
2301
+ getAppearanceProperties(n, a = !1) {
2302
+ this.propertyConfig.categories.appearance = {
2303
+ title: "外观",
2304
+ description: "Appearance",
2305
+ properties: {
2306
+ class: {
2307
+ title: "class样式",
2308
+ type: "string",
2309
+ description: "",
2310
+ $converter: "/converter/appearance.converter",
2311
+ visible: !a
2312
+ },
2313
+ // "dropdownClass": {
2314
+ // "title": "在下拉菜单中的样式",
2315
+ // "type": "string",
2316
+ // "description": ""
2317
+ // },
2318
+ icon: {
2319
+ title: "图标",
2320
+ type: "string",
2321
+ description: ""
2322
+ },
2323
+ split: {
2324
+ title: "下拉按钮分离",
2325
+ type: "boolean",
2326
+ description: "启用下拉按钮分离,可以单独点击按钮。单独点击下拉按钮展开下拉面板",
2327
+ visible: !!(n.children && n.children.length > 0)
2328
+ },
2329
+ tipsEnable: {
2330
+ title: "启用提示",
2331
+ type: "boolean",
2332
+ description: "当启用提示时,鼠标滑过按钮会有消息提示框",
2333
+ refreshPanelAfterChanged: !0,
2334
+ visible: this.toolbarType === "response-toolbar-item"
2335
+ },
2336
+ tipsText: {
2337
+ title: "提示消息内容",
2338
+ type: "string",
2339
+ description: "消息提示框内的展示内容",
2340
+ visible: n.tipsEnable === !0
2341
+ }
2342
+ }
2343
+ };
2344
+ }
2345
+ getEventPropConfig(n) {
2346
+ const a = [
2347
+ {
2348
+ label: "onClick",
2349
+ name: "点击事件"
2350
+ }
2351
+ ], l = this, s = l.eventsEditorUtils.formProperties(n, l.viewModelId, a), p = {};
2352
+ p[l.viewModelId] = {
2353
+ type: "events-editor",
2354
+ editor: {
2355
+ initialData: s
2356
+ }
2357
+ }, this.propertyConfig.categories.eventsEditor = {
2358
+ title: "事件",
2359
+ hideTitle: !0,
2360
+ properties: p,
2361
+ // 这个属性,标记当属性变更得时候触发重新更新属性
2362
+ refreshPanelAfterChanged: !0,
2363
+ tabId: "commands",
2364
+ tabName: "交互",
2365
+ setPropertyRelates(h, g) {
2366
+ const x = h.propertyValue;
2367
+ delete n[l.viewModelId], x && (x.setPropertyRelates = this.setPropertyRelates, l.eventsEditorUtils.saveRelatedParameters(n, l.viewModelId, x.events, x));
2368
+ }
2369
+ };
2370
+ }
2371
+ }
2372
+ function _e(e, c) {
2373
+ if (!e)
2374
+ return !1;
2375
+ const n = c || [];
2376
+ return (n == null ? void 0 : n.findIndex((l) => l.id === e)) === -1;
2377
+ }
2378
+ function tt(e, c) {
2379
+ const n = c || [];
2380
+ let a = { parentIndex: -1, itemIndex: -1 };
2381
+ return n.some((l, s) => {
2382
+ if (l.children && l.children.length > 0) {
2383
+ const p = l.children.findIndex((h) => h.id === e);
2384
+ return p > -1 ? (a = { parentIndex: s, itemIndex: p }, !0) : !1;
2385
+ }
2386
+ }), a;
2387
+ }
2388
+ function nt(e, c) {
2389
+ const n = c || [];
2390
+ let a = { parentIndex: -1, itemIndex: -1 };
2391
+ const l = n == null ? void 0 : n.findIndex((s) => s.id === e);
2392
+ return l > -1 ? { parent: null, item: n[l] } : (n.some((s, p) => {
2393
+ if (s.children && s.children.length > 0) {
2394
+ const h = s.children.findIndex((g) => g.id === e);
2395
+ return h > -1 ? (a = { parentIndex: p, itemIndex: h }, !0) : !1;
2396
+ }
2397
+ }), a.parentIndex < 0 ? { parent: null, item: null } : { parent: n[a.parentIndex], item: n[a.parentIndex].children[a.itemIndex] });
2398
+ }
2399
+ function Fn(e, c) {
2400
+ const n = c || [], a = n == null ? void 0 : n.findIndex((l) => l.id === e);
2401
+ return a > -1 && n[a].children && n[a].children.length > 0 ? n[a].expanded === !0 : !1;
2402
+ }
2403
+ function qn(e, c, n) {
2404
+ function a(v) {
2405
+ return !1;
2406
+ }
2407
+ function l() {
2408
+ return !1;
2409
+ }
2410
+ function s() {
2411
+ return !1;
2412
+ }
2413
+ function p() {
2414
+ return !1;
2415
+ }
2416
+ function h() {
2417
+ return n.toolbarContext.schema.buttons || [];
2418
+ }
2419
+ function g(v, o = "") {
2420
+ setTimeout(() => {
2421
+ var D, M;
2422
+ const T = (D = e.parent) == null ? void 0 : D.designerItemElementRef.value;
2423
+ let P;
2424
+ o && (P = T == null ? void 0 : T.querySelector("#" + o));
2425
+ const d = (M = P || T) == null ? void 0 : M.querySelector("#" + v);
2426
+ d == null || d.click();
2427
+ }, 0);
2428
+ }
2429
+ function x(v, o) {
2430
+ o.disabled && o.disabled.expressionId && (o.disabled.expressionId = `${o.id}_disabled`), o.visible && o.visible.expressionId && (o.visible.expressionId = `${o.id}_visible`);
2431
+ const T = c.formSchemaUtils.getExpressions(), P = T.find((D) => D.target === v.id);
2432
+ if (!P || !P.rules || !P.rules.length)
2433
+ return;
2434
+ const d = {
2435
+ target: o.id,
2436
+ rules: [],
2437
+ targetType: "Button"
2438
+ };
2439
+ P.rules.forEach((D) => {
2440
+ const M = Object.assign(he(D), {
2441
+ id: `${o.id}_${D.type}`
2442
+ });
2443
+ d.rules.push(M);
2444
+ }), T.push(d);
2445
+ }
2446
+ function I() {
2447
+ const v = e.schema, o = Object.assign(
2448
+ he(v),
2449
+ {
2450
+ id: `${e.schema.type}-cloned-${Math.random().toString(36).slice(2, 6)}`,
2451
+ onClick: null
2452
+ }
2453
+ );
2454
+ let T = [];
2455
+ return o.children && o.children.length && (T = o.children.map((P) => {
2456
+ const d = he(P);
2457
+ return Object.assign(
2458
+ d,
2459
+ {
2460
+ id: `${e.schema.type}-cloned-${Math.random().toString(36).slice(2, 6)}`,
2461
+ onClick: null
2462
+ }
2463
+ ), x(P, d), d;
2464
+ }), o.children = T), x(v, o), o;
2465
+ }
2466
+ function y() {
2467
+ const v = e.schema.type || "response-toolbar-item", o = Le(v), T = v.toLowerCase().replace("-", "_");
2468
+ return o && !o.id && o.type === v && (o.id = `${T}_${Math.random().toString().slice(2, 6)}`, o.text = "按钮"), o;
2469
+ }
2470
+ function m(v) {
2471
+ const o = h(), T = o == null ? void 0 : o.findIndex((d) => d.id === v), P = T === -1 ? null : o[T];
2472
+ return { index: T, toolbarItem: P };
2473
+ }
2474
+ function f() {
2475
+ const v = e.schema.id, o = h();
2476
+ return _e(v, o);
2477
+ }
2478
+ function r(v) {
2479
+ const o = c.formSchemaUtils.getExpressions();
2480
+ if (!o || !o.length)
2481
+ return;
2482
+ const T = (P) => {
2483
+ const d = o && o.findIndex((D) => D.target === P.id);
2484
+ d > -1 && o.splice(d, 1);
2485
+ };
2486
+ T(v), v.children && v.children.length && v.children.forEach((P) => {
2487
+ T(P);
2488
+ });
2489
+ }
2490
+ function S(v) {
2491
+ n.changeSelectedId(v);
2492
+ }
2493
+ function L() {
2494
+ var P, d;
2495
+ const v = h(), { parentIndex: o, itemIndex: T } = tt(e.schema.id, v);
2496
+ o === -1 || T === -1 || (r(e.schema), v[o].children.splice(T, 1), n.updateToolbarItems(), (P = e.setupContext) == null || P.emit("removeComponent"), (d = e.setupContext) == null || d.emit("selectionChange"));
2497
+ }
2498
+ function W() {
2499
+ var P, d;
2500
+ const v = e.schema.id, o = h(), T = o == null ? void 0 : o.findIndex((D) => D.id === v);
2501
+ T !== -1 && (r(o[T]), o == null || o.splice(T, 1), n.updateToolbarItems(), (P = e.setupContext) == null || P.emit("removeComponent"), (d = e.setupContext) == null || d.emit("selectionChange"), lt.value++);
2502
+ }
2503
+ function _(v = "Append") {
2504
+ var M;
2505
+ const o = h(), { parentIndex: T, itemIndex: P } = tt(e.schema.id, o);
2506
+ if (T === -1 || P === -1)
2507
+ return;
2508
+ const d = y(), D = v === "Copy" ? I() : Object.assign({}, d);
2509
+ o[T].children.splice(P + 1, 0, D), n.updateToolbarItems(), S(D.id), (M = e.setupContext) == null || M.emit("addComponent");
2510
+ }
2511
+ function B(v, o) {
2512
+ const { index: T } = m(o);
2513
+ if (T === -1)
2514
+ return { index: T, schema: null };
2515
+ const P = y(), d = v === "Copy" ? I() : Object.assign({}, P);
2516
+ return { index: T, schema: d };
2517
+ }
2518
+ function i() {
2519
+ var P;
2520
+ const v = e.schema.id, { index: o, schema: T } = B("Copy", v);
2521
+ T && (h().splice(o + 1, 0, T), n.updateToolbarItems(), g(T.id), (P = e.setupContext) == null || P.emit("addComponent"));
2522
+ }
2523
+ function t() {
2524
+ var P;
2525
+ const v = e.schema.id, { index: o, schema: T } = B("Append", v);
2526
+ if (T && e.parent) {
2527
+ const D = h()[o].children || [];
2528
+ D.push(T);
2529
+ const M = h();
2530
+ M[o].children = D, n.updateToolbarItems(), S(T.id), (P = e.setupContext) == null || P.emit("addComponent");
2531
+ }
2532
+ }
2533
+ function b(v) {
2534
+ let o;
2535
+ switch (e.schema.type) {
2536
+ case "tab-toolbar-item":
2537
+ o = new Xt(v, c);
2538
+ break;
2539
+ default:
2540
+ o = new Wn(v, c, e.schema.type);
2541
+ }
2542
+ return o.getPropertyConfig(e.schema, f());
2543
+ }
2544
+ function C(v) {
2545
+ v.stopPropagation(), v.stopImmediatePropagation();
2546
+ }
2547
+ function k() {
2548
+ const v = [{
2549
+ id: "delete",
2550
+ title: "删除",
2551
+ text: "",
2552
+ icon: "f-icon-yxs_delete",
2553
+ onClick: (o) => {
2554
+ C(o), f() ? L() : W();
2555
+ }
2556
+ }, {
2557
+ id: "copy",
2558
+ title: "复制",
2559
+ icon: "f-icon-yxs_copy",
2560
+ onClick: (o) => {
2561
+ C(o);
2562
+ const { activeElement: T } = document, P = T ? T.tagName.toLowerCase() : "";
2563
+ P && P === "input" || P === "textarea" ? (T == null || T.blur(), ge(() => {
2564
+ f() ? _("Copy") : i();
2565
+ })) : f() ? _("Copy") : i();
2566
+ }
2567
+ }];
2568
+ return v.push(f() ? {
2569
+ id: "appendSiblingButton",
2570
+ title: "",
2571
+ text: "新增同级",
2572
+ icon: "f-icon-plus-circle",
2573
+ onClick: (o) => {
2574
+ C(o), _();
2575
+ }
2576
+ } : {
2577
+ id: "appendChildButton",
2578
+ title: "",
2579
+ text: "新增子级",
2580
+ icon: "f-icon-plus-circle",
2581
+ onClick: (o) => {
2582
+ C(o), t();
2583
+ }
2584
+ }), v;
2585
+ }
2586
+ function z() {
2587
+ const { schema: v } = e;
2588
+ r(v);
2589
+ }
2590
+ return {
2591
+ canAccepts: a,
2592
+ checkCanMoveComponent: l,
2593
+ checkCanDeleteComponent: s,
2594
+ checkCanAddComponent: p,
2595
+ getPropsConfig: b,
2596
+ getCustomButtons: k,
2597
+ onRemoveComponent: z
2598
+ };
2599
+ }
2600
+ const mt = /* @__PURE__ */ Te({
2601
+ name: "FResponseToolbarItemDesign",
2602
+ props: ut,
2603
+ emits: ["Click", "dropdown", "clearAll"],
2604
+ setup(e, c) {
2605
+ const n = U(e.alignment), a = Ne(), l = U(), s = ue("designer-host-service"), p = ue("design-item-context"), h = ue("toolbar-item-action"), g = qn(p, s, h), x = Gt(l, p, g);
2606
+ Se(() => {
2607
+ l.value.componentInstance = x;
2608
+ }), c.expose(x.value);
2609
+ function I() {
2610
+ const i = {
2611
+ "f-icon": !0
2612
+ }, t = e.icon ? e.icon.trim() : "";
2613
+ return te(i, t);
2614
+ }
2615
+ function y() {
2616
+ return !!(e.icon && e.icon.trim());
2617
+ }
2618
+ const m = ie(() => {
2619
+ const i = {
2620
+ btn: !0,
2621
+ "f-rt-btn": !0,
2622
+ "f-btn-ml": !e.isDP && (n.value === "right" || n.value === "center"),
2623
+ "f-btn-mr": !e.isDP && n.value === "left",
2624
+ "btn-icontext": !!(e.icon && e.icon.trim()),
2625
+ disabled: e.disabled === !0,
2626
+ "no-drag": !0,
2627
+ "text-truncate": !0
2628
+ // 'f-rt-toggle':props.isDP&&!props.split
2629
+ };
2630
+ return te(i, e.class);
2631
+ }), f = ie(() => e.split ? {
2632
+ display: "flex",
2633
+ "align-items": "center"
2634
+ } : {
2635
+ display: "flex",
2636
+ "align-items": "center",
2637
+ "border-radius": "6px",
2638
+ "padding-right": "0.1rem",
2639
+ "border-top-right-radius": "6px",
2640
+ "border-bottom-right-radius": "6px"
2641
+ }), r = ie(() => {
2642
+ const i = {
2643
+ btn: !0,
2644
+ "dropdown-toggle": !0,
2645
+ "f-btn-mr": n.value === "left",
2646
+ "dropdown-toggle-split": !0,
2647
+ "no-drag": !0
2648
+ };
2649
+ return te(i, e.class);
2650
+ }), S = ie(() => {
2651
+ let i = {
2652
+ btn: !e.isDPItem,
2653
+ // 不是下拉按钮,不是下拉项
2654
+ disabled: e.disabled === !0,
2655
+ "dropdown-item": e.isDPItem,
2656
+ "f-rt-btn": !0,
2657
+ "text-truncate": !0,
2658
+ "btn-icontext": !e.isDPItem && !!(e.icon && e.icon.trim()),
2659
+ "dropdown-item-icontext": e.isDPItem && !!(e.icon && e.icon.trim()),
2660
+ // 保证内部层级不被拖拽
2661
+ "no-drag": !0
2662
+ };
2663
+ return e.isDPItem || (i = te(i, e.class || "")), e.isDP && (i = te(i, e.dropdownClass || "")), i;
2664
+ });
2665
+ function L(i, t) {
2666
+ t && t.stopPropagation(), c.emit(i, {
2667
+ id: e.id,
2668
+ isDP: e.isDP
2669
+ });
2670
+ }
2671
+ function W() {
2672
+ return {
2673
+ "btn-group": !0,
2674
+ "no-drag": !0,
2675
+ "f-rt-dropdown": !0,
2676
+ "f-btn-ml": n.value === "right" || n.value === "center",
2677
+ "f-btn-mr": n.value === "left"
2678
+ };
2679
+ }
2680
+ function _() {
2681
+ return A("div", {
2682
+ ref: l,
2683
+ "data-dragref": `${p.schema.id}-container`,
2684
+ class: "farris-component position-relative",
2685
+ style: "display:inline-block!important;"
2686
+ }, [A("div", {
2687
+ class: W(),
2688
+ id: e.id
2689
+ }, [A("div", {
2690
+ class: m.value,
2691
+ style: f.value,
2692
+ onClick: () => L("clearAll")
2693
+ }, [a.shouldShowIcon(e) && A("i", {
2694
+ class: a.iconClass(e)
2695
+ }, null), A("span", null, [e.text]), !e.split && A("span", {
2696
+ class: "f-icon f-icon-arrow-chevron-down",
2697
+ style: "margin:0 0.5rem 0 0.25rem;",
2698
+ onClick: (i) => L("dropdown", i)
2699
+ }, null)]), e.split && A("button", {
2700
+ class: r.value,
2701
+ style: "border-radius:0 6px 6px 0;",
2702
+ onClick: (i) => L("dropdown", i)
2703
+ }, null), h.renderDropdownMenu(e.item, e.item)])]);
2704
+ }
2705
+ function B() {
2706
+ return A("li", {
2707
+ ref: l,
2708
+ "data-dragref": `${p.schema.id}-container`,
2709
+ id: e.id,
2710
+ class: S.value
2711
+ }, [a.shouldShowIcon(e) && A("i", {
2712
+ class: a.iconClass(e)
2713
+ }, null), e.text]);
2714
+ }
2715
+ return () => e.isDP ? _() : e.isDPItem ? B() : A("div", {
2716
+ ref: l,
2717
+ "data-dragref": `${p.schema.id}-container`,
2718
+ class: "farris-component position-relative",
2719
+ style: "display:inline-block!important;"
2720
+ }, [A("button", {
2721
+ type: "button",
2722
+ class: m.value,
2723
+ id: e.id,
2724
+ onClick: () => L("clearAll")
2725
+ }, [y() && A("i", {
2726
+ class: I()
2727
+ }, null), e.text])]);
2728
+ }
2729
+ });
2730
+ function Hn(e, c, n, a) {
2731
+ function l(m, f, r, S) {
2732
+ a.changeSelectedId((f == null ? void 0 : f.id) || ""), n && n.setupContext && n.setupContext.emit("selectionChange", m, f, r, S);
2733
+ }
2734
+ function s() {
2735
+ }
2736
+ function p(m) {
2737
+ const f = m.expanded;
2738
+ a.clearAllDropdown(), a.toggleDropdownMenu(m, !f);
2739
+ }
2740
+ function h(m) {
2741
+ a.clearAllDropdown(m.isDP ? m.id : "");
2742
+ }
2743
+ function g(m, f = "") {
2744
+ const r = e.items || [], S = f || m, L = r.find((W) => W.id === S);
2745
+ return f ? L.children.find((W) => W.id === m) : L;
2746
+ }
2747
+ function x(m, f = !1) {
2748
+ if (!f)
2749
+ return;
2750
+ const r = m.target;
2751
+ r != null && r.classList.contains("dgComponentFocused") && (r == null || r.classList.add("dgComponentSelected"));
2752
+ }
2753
+ function I(m, f = !1) {
2754
+ if (!f)
2755
+ return;
2756
+ const r = m.target;
2757
+ r != null && r.classList.contains("dgComponentFocused") && (r == null || r.classList.remove("dgComponentSelected"));
2758
+ }
2759
+ function y(m, f, r = !1) {
2760
+ const S = g(m.id, m.parent), L = U(S);
2761
+ return A(Nn, {
2762
+ key: S.id,
2763
+ class: ["p-0", r ? "d-block no-drag" : "d-inline-block"],
2764
+ modelValue: L.value,
2765
+ "onUpdate:modelValue": (W) => L.value = W,
2766
+ canMove: !1,
2767
+ childType: "response-toolbar-item",
2768
+ childLabel: "按钮",
2769
+ contentKey: "buttons",
2770
+ componentId: e.componentId,
2771
+ id: S.id,
2772
+ onSelectionChange: l,
2773
+ onRemoveComponent: s,
2774
+ onMouseenter: (W) => x(W, r),
2775
+ onMouseleave: (W) => I(W, r)
2776
+ }, {
2777
+ default: () => {
2778
+ var W;
2779
+ return [A(mt, {
2780
+ id: S.id,
2781
+ disabled: S.disabled,
2782
+ text: S.text,
2783
+ icon: S.icon,
2784
+ isDP: m.isDP,
2785
+ item: m,
2786
+ split: S.split,
2787
+ isDPItem: m.isDPItem,
2788
+ class: ((W = m.appearance) == null ? void 0 : W.class) || "btn-secondary",
2789
+ alignment: e.alignment || "right",
2790
+ onDropdown: () => p(m),
2791
+ onClearAll: (_) => h(_),
2792
+ componentId: e.componentId
2793
+ }, null)];
2794
+ }
2795
+ });
2796
+ }
2797
+ return {
2798
+ renderToolbarItemDesigner: y,
2799
+ actionHandlers: a
2800
+ };
2801
+ }
2802
+ function je(e, c = !1, n = "") {
2803
+ const a = [];
2804
+ return e.reduce((l, s) => {
2805
+ if (s.children && s.children.length > 0) {
2806
+ const p = je(s.children, !0, s.id);
2807
+ l.push(Object.assign({}, s, {
2808
+ children: p,
2809
+ isDPItem: !1,
2810
+ isDP: !0,
2811
+ parent: "",
2812
+ expanded: !1
2813
+ }));
2814
+ } else
2815
+ l.push(Object.assign({}, s, {
2816
+ isDPItem: c,
2817
+ isDP: !1,
2818
+ parent: n
2819
+ }));
2820
+ return l;
2821
+ }, a), a;
2822
+ }
2823
+ const xe = /* @__PURE__ */ Te({
2824
+ name: "FResponseToolbarDesign",
2825
+ props: gn,
2826
+ emits: ["Click"],
2827
+ setup(e, c) {
2828
+ const n = U(je(e.items)), a = U(), l = U(), s = U(), p = U("");
2829
+ let h = 0;
2830
+ const g = 15, x = ue("designer-host-service"), I = ue("design-item-context"), y = {
2831
+ clearAllDropdown: (O) => {
2832
+ },
2833
+ toggleDropdownMenu: (O) => {
2834
+ },
2835
+ updateToolbarItems: () => {
2836
+ },
2837
+ changeSelectedId: (O) => {
2838
+ p.value = O;
2839
+ },
2840
+ renderDropdownMenu: (O, j) => {
2841
+ },
2842
+ toolbarContext: I,
2843
+ changeMenuPosition: (O, j, G) => ({}),
2844
+ toolbarPosition: ""
2845
+ }, m = Dn(I, x, y), f = Yt(s, I, m), r = ue("toolbar-item-handler"), {
2846
+ initDragula: S,
2847
+ dragulaInstance: L
2848
+ } = En(I), W = Ne(), _ = Hn(e, l, I, y), B = kn(W, n, _), {
2849
+ renderToolbarItemDesigner: i
2850
+ } = _, {
2851
+ clearAllDropDownMenu: t,
2852
+ renderDropdownMenu: b,
2853
+ setResponseToolbarRef: C
2854
+ } = B;
2855
+ st("toolbar-item-action", y), y.renderDropdownMenu = b, C(s), r && (r.changeSelectedId = function(O) {
2856
+ p.value = O;
2857
+ });
2858
+ function k() {
2859
+ const O = l.value.querySelector(".dgComponentSelected");
2860
+ O && Ut(O);
2861
+ }
2862
+ function z() {
2863
+ if (p.value)
2864
+ if (_e(p.value, n.value)) {
2865
+ const {
2866
+ parent: O,
2867
+ item: j
2868
+ } = nt(p.value, n.value);
2869
+ O && (y.toggleDropdownMenu(O, !0), setTimeout(() => {
2870
+ var Y;
2871
+ const G = s.value.querySelector("#" + O.id), V = G == null ? void 0 : G.querySelector("#" + j.id);
2872
+ (((Y = V == null ? void 0 : V.parentElement) == null ? void 0 : Y.className) || "").indexOf("dgComponentFocused") < 0 && (V == null || V.click());
2873
+ }, 0));
2874
+ } else
2875
+ k();
2876
+ }
2877
+ function v(O = "") {
2878
+ n.value.filter((j) => j.id !== O && j.children && j.children.length > 0).forEach((j) => {
2879
+ j.expanded = !1;
2880
+ }), t(O);
2881
+ }
2882
+ y.clearAllDropdown = v;
2883
+ function o() {
2884
+ r && r.updateToolbarItems && r.updateToolbarItems();
2885
+ }
2886
+ y.updateToolbarItems = o;
2887
+ function T(O) {
2888
+ if (O) {
2889
+ const j = s.value.querySelector("#" + O.id), G = j.querySelector("#" + O.id + "_menu"), V = y.changeMenuPosition(O, j);
2890
+ Object.keys(V).forEach((Y) => {
2891
+ G.style[Y] = V[Y];
2892
+ });
2893
+ }
2894
+ }
2895
+ function P() {
2896
+ const G = l.value.clientWidth, V = l.value.querySelectorAll(".farris-component>.f-rt-btn");
2897
+ V && V.forEach((H) => {
2898
+ H.style.maxWidth = G - 12 + "px";
2899
+ });
2900
+ const Y = l.value.querySelectorAll(".farris-component>.f-rt-dropdown");
2901
+ Y && Y.forEach((H) => {
2902
+ H.querySelector(".dropdown-toggle-split") ? H.querySelector(".f-rt-btn").style.maxWidth = G - 38 + "px" : H.style.maxWidth = G - 12 + "px";
2903
+ });
2904
+ }
2905
+ const d = new ResizeObserver((O) => {
2906
+ var j;
2907
+ if (O.length) {
2908
+ const V = O[0].contentRect.width;
2909
+ if (V === 0) {
2910
+ h = 0;
2911
+ return;
2912
+ }
2913
+ if (Math.abs(V - h) > g) {
2914
+ if (h = V, _e(p.value, n.value)) {
2915
+ const {
2916
+ parent: Y,
2917
+ item: H
2918
+ } = nt(p.value, n.value);
2919
+ T(Y);
2920
+ } else if (Fn(p.value, n.value)) {
2921
+ const Y = (j = n.value) == null ? void 0 : j.find((H) => H.id === p.value);
2922
+ T(Y);
2923
+ } else
2924
+ v();
2925
+ P();
2926
+ }
2927
+ }
2928
+ });
2929
+ Se(() => {
2930
+ d.observe(s.value), h = s.value.clientWidth, s.value.componentInstance = f, S(l.value, a.value, o);
2931
+ }), it(() => {
2932
+ d.disconnect(), L && L.destroy && L.destroy();
2933
+ }), c.expose(f.value);
2934
+ const D = ie(() => {
2935
+ const O = {
2936
+ "f-toolbar": !0,
2937
+ "f-response-toolbar": !0,
2938
+ "position-relative": !0,
2939
+ "f-response-toolbar-sm": e.buttonSize === "sm",
2940
+ "f-response-toolbar-lg": e.buttonSize === "lg"
2941
+ };
2942
+ return te(O, e.customClass);
2943
+ }), M = ie(() => ({
2944
+ "text-left": e.alignment === "left",
2945
+ "text-right": e.alignment === "right",
2946
+ "justify-content-end": e.alignment === "right",
2947
+ "justify-content-start": e.alignment === "left",
2948
+ "justify-content-center": e.alignment === "center",
2949
+ "no-drag": !0,
2950
+ "w-100": !0
2951
+ }));
2952
+ we(() => e.items, () => {
2953
+ n.value = je(e.items), ge(() => {
2954
+ z(), P();
2955
+ });
2956
+ }, {
2957
+ deep: !0
2958
+ });
2959
+ function w(O) {
2960
+ O && (O.stopPropagation(), O.preventDefault());
2961
+ const {
2962
+ schema: j
2963
+ } = I;
2964
+ j.buttons || (j.buttons = []);
2965
+ const G = Le("response-toolbar-item");
2966
+ G.id = `toolbar_item_${Math.random().toString().slice(2, 6)}`, G.appearance = {
2967
+ class: "btn btn-secondary"
2968
+ }, j.buttons.push(G);
2969
+ }
2970
+ function q() {
2971
+ return A("li", {
2972
+ style: "border-width: 1px;border-style: dashed;display: inline-block;padding: 0 8px;line-height: 24px; border-radius: 3px; cursor: default;color: #B4BCCC;",
2973
+ onClick: w
2974
+ }, [A("span", {
2975
+ class: "f-icon f-icon-amplification mr-1",
2976
+ style: "font-size: 12px;"
2977
+ }, null), A("span", {
2978
+ class: "farris-tag-add-text"
2979
+ }, [Vt("添加按钮")])]);
2980
+ }
2981
+ function F() {
2982
+ return n.value.map((O, j) => i(O, j));
2983
+ }
2984
+ return () => {
2985
+ var O;
2986
+ return A("div", {
2987
+ ref: s,
2988
+ "data-dragref": `${I.schema.id}-container`,
2989
+ class: D.value,
2990
+ id: e.id
2991
+ }, [A("div", {
2992
+ ref: a,
2993
+ class: M.value,
2994
+ onClick: (j) => v(j)
2995
+ }, [A("div", {
2996
+ ref: l,
2997
+ class: "d-block f-response-content"
2998
+ }, [(O = n.value) != null && O.length ? F() : q()])])]);
2999
+ };
3000
+ }
3001
+ }), Kn = $e;
3002
+ xe.register = (e, c, n, a) => {
3003
+ e["response-toolbar"] = Tn, c["response-toolbar"] = $e, a["response-toolbar"] = { eventHandlerResolver: mn };
3004
+ };
3005
+ xe.registerDesigner = (e, c, n) => {
3006
+ e["response-toolbar"] = xe, c["response-toolbar"] = $e, e["response-toolbar-item"] = mt, c["response-toolbar-item"] = vn;
3007
+ };
3008
+ const eo = Nt(xe);
3009
+ export {
3010
+ xe as FResponseToolbarDesign,
3011
+ mt as FResponseToolbarItemDesign,
3012
+ eo as default,
3013
+ Kn as responseToolbarResolver,
3014
+ ct as schemaResolver
3015
+ };