@farris/ui-vue 1.3.4 → 1.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/components/accordion/index.esm.js +16 -16
  2. package/components/accordion/index.umd.cjs +1 -1
  3. package/components/avatar/index.esm.js +65 -65
  4. package/components/avatar/index.umd.cjs +1 -1
  5. package/components/button-edit/index.esm.js +13 -13
  6. package/components/button-edit/index.umd.cjs +1 -1
  7. package/components/calendar/index.esm.js +504 -490
  8. package/components/calendar/index.umd.cjs +1 -1
  9. package/components/capsule/index.esm.js +247 -233
  10. package/components/capsule/index.umd.cjs +1 -1
  11. package/components/checkbox/index.esm.js +356 -344
  12. package/components/checkbox/index.umd.cjs +1 -1
  13. package/components/color-picker/index.esm.js +159 -145
  14. package/components/color-picker/index.umd.cjs +2 -2
  15. package/components/combo-list/index.esm.js +127 -128
  16. package/components/combo-list/index.umd.cjs +1 -1
  17. package/components/combo-tree/index.esm.js +15 -15
  18. package/components/combo-tree/index.umd.cjs +1 -1
  19. package/components/component/index.esm.js +101 -87
  20. package/components/component/index.umd.cjs +1 -1
  21. package/components/condition/index.esm.js +9 -7
  22. package/components/condition/index.umd.cjs +1 -1
  23. package/components/content-container/index.esm.js +181 -167
  24. package/components/content-container/index.umd.cjs +1 -1
  25. package/components/data-grid/index.esm.js +746 -730
  26. package/components/data-grid/index.umd.cjs +1 -1
  27. package/components/data-view/index.esm.js +9 -7
  28. package/components/data-view/index.umd.cjs +1 -1
  29. package/components/date-picker/index.esm.js +789 -777
  30. package/components/date-picker/index.umd.cjs +1 -1
  31. package/components/designer-canvas/index.esm.js +3096 -3069
  32. package/components/designer-canvas/index.umd.cjs +1 -1
  33. package/components/dropdown/index.esm.js +257 -243
  34. package/components/dropdown/index.umd.cjs +2 -2
  35. package/components/dynamic-form/index.esm.js +322 -306
  36. package/components/dynamic-form/index.umd.cjs +1 -1
  37. package/components/dynamic-resolver/index.esm.js +177 -163
  38. package/components/dynamic-resolver/index.umd.cjs +1 -1
  39. package/components/event-parameter/index.esm.js +78 -82
  40. package/components/event-parameter/index.umd.cjs +1 -1
  41. package/components/events-editor/index.esm.js +501 -487
  42. package/components/events-editor/index.umd.cjs +1 -1
  43. package/components/expression-editor/index.esm.js +37 -37
  44. package/components/expression-editor/index.umd.cjs +1 -1
  45. package/components/external-container/index.esm.js +487 -472
  46. package/components/external-container/index.umd.cjs +1 -1
  47. package/components/field-selector/index.esm.js +440 -433
  48. package/components/field-selector/index.umd.cjs +1 -1
  49. package/components/filter-bar/index.esm.js +594 -587
  50. package/components/filter-bar/index.umd.cjs +1 -1
  51. package/components/flow-canvas/index.esm.js +2766 -2739
  52. package/components/flow-canvas/index.umd.cjs +1 -1
  53. package/components/image-cropper/index.esm.js +402 -388
  54. package/components/image-cropper/index.umd.cjs +1 -1
  55. package/components/input-group/index.esm.js +201 -202
  56. package/components/input-group/index.umd.cjs +1 -1
  57. package/components/layout/index.esm.js +264 -245
  58. package/components/layout/index.umd.cjs +1 -1
  59. package/components/list-nav/index.esm.js +157 -143
  60. package/components/list-nav/index.umd.cjs +1 -1
  61. package/components/list-view/index.esm.js +314 -298
  62. package/components/list-view/index.umd.cjs +1 -1
  63. package/components/lookup/index.esm.js +862 -843
  64. package/components/lookup/index.umd.cjs +1 -1
  65. package/components/mapping-editor/index.esm.js +1031 -1015
  66. package/components/mapping-editor/index.umd.cjs +1 -1
  67. package/components/nav/index.esm.js +169 -155
  68. package/components/nav/index.umd.cjs +2 -2
  69. package/components/number-range/index.esm.js +150 -137
  70. package/components/number-range/index.umd.cjs +1 -1
  71. package/components/number-spinner/index.esm.js +207 -194
  72. package/components/number-spinner/index.umd.cjs +1 -1
  73. package/components/order/index.esm.js +427 -414
  74. package/components/order/index.umd.cjs +1 -1
  75. package/components/page-footer/index.esm.js +22 -22
  76. package/components/page-footer/index.umd.cjs +1 -1
  77. package/components/page-header/index.esm.js +510 -492
  78. package/components/page-header/index.umd.cjs +1 -1
  79. package/components/pagination/index.esm.js +192 -178
  80. package/components/pagination/index.umd.cjs +1 -1
  81. package/components/progress/index.esm.js +234 -220
  82. package/components/progress/index.umd.cjs +3 -3
  83. package/components/property-editor/index.esm.js +288 -277
  84. package/components/property-editor/index.umd.cjs +2 -2
  85. package/components/property-panel/index.esm.js +62 -61
  86. package/components/property-panel/index.umd.cjs +1 -1
  87. package/components/query-solution/index.esm.js +776 -770
  88. package/components/query-solution/index.umd.cjs +6 -6
  89. package/components/radio-button/index.esm.js +64 -64
  90. package/components/radio-button/index.umd.cjs +1 -1
  91. package/components/radio-group/index.esm.js +296 -283
  92. package/components/radio-group/index.umd.cjs +1 -1
  93. package/components/rate/index.esm.js +222 -208
  94. package/components/rate/index.umd.cjs +1 -1
  95. package/components/response-layout/index.esm.js +187 -173
  96. package/components/response-layout/index.umd.cjs +1 -1
  97. package/components/response-layout-editor/index.esm.js +554 -542
  98. package/components/response-layout-editor/index.umd.cjs +1 -1
  99. package/components/response-toolbar/index.esm.js +483 -469
  100. package/components/response-toolbar/index.umd.cjs +1 -1
  101. package/components/schema-selector/index.esm.js +634 -619
  102. package/components/schema-selector/index.umd.cjs +2 -2
  103. package/components/search-box/index.esm.js +228 -214
  104. package/components/search-box/index.umd.cjs +1 -1
  105. package/components/section/index.esm.js +419 -406
  106. package/components/section/index.umd.cjs +1 -1
  107. package/components/smoke-detector/index.esm.js +162 -148
  108. package/components/smoke-detector/index.umd.cjs +1 -1
  109. package/components/splitter/index.esm.js +308 -284
  110. package/components/splitter/index.umd.cjs +1 -1
  111. package/components/step/index.esm.js +279 -265
  112. package/components/step/index.umd.cjs +1 -1
  113. package/components/switch/index.esm.js +183 -170
  114. package/components/switch/index.umd.cjs +1 -1
  115. package/components/tabs/index.esm.js +307 -294
  116. package/components/tabs/index.umd.cjs +1 -1
  117. package/components/tags/index.esm.js +320 -306
  118. package/components/tags/index.umd.cjs +1 -1
  119. package/components/text/index.esm.js +245 -231
  120. package/components/text/index.umd.cjs +1 -1
  121. package/components/textarea/index.esm.js +260 -247
  122. package/components/textarea/index.umd.cjs +1 -1
  123. package/components/time-picker/index.esm.js +409 -396
  124. package/components/time-picker/index.umd.cjs +1 -1
  125. package/components/transfer/index.esm.js +424 -410
  126. package/components/transfer/index.umd.cjs +1 -1
  127. package/components/tree-grid/index.esm.js +383 -376
  128. package/components/tree-grid/index.umd.cjs +1 -1
  129. package/components/tree-view/index.esm.js +595 -575
  130. package/components/tree-view/index.umd.cjs +1 -1
  131. package/components/uploader/index.esm.js +325 -311
  132. package/components/uploader/index.umd.cjs +2 -2
  133. package/components/verify-detail/index.esm.js +304 -290
  134. package/components/verify-detail/index.umd.cjs +1 -1
  135. package/components/video/index.esm.js +99 -85
  136. package/components/video/index.umd.cjs +1 -1
  137. package/components/weather/index.esm.js +947 -933
  138. package/components/weather/index.umd.cjs +4 -4
  139. package/farris.all.esm.js +5492 -5470
  140. package/farris.all.umd.cjs +13 -13
  141. package/index.css +1 -1
  142. package/package.json +1 -1
  143. package/types/condition/src/composition/condition-value/input-group-value.d.ts +1 -1
  144. package/types/entity-binding-selector/composition/use-entity-tree.d.ts +3 -0
  145. package/types/entity-binding-selector/composition/use-field-tree.d.ts +1 -0
@@ -1,5 +1,5 @@
1
- import { defineComponent as F, ref as m, watch as P, computed as S, onMounted as T, createVNode as w, nextTick as k, inject as Q } from "vue";
2
- import { isPlainObject as L, cloneDeep as U } from "lodash-es";
1
+ import { defineComponent as C, ref as m, watch as E, computed as R, onMounted as T, createVNode as M, nextTick as k, inject as U } from "vue";
2
+ import { isPlainObject as L, cloneDeep as W } from "lodash-es";
3
3
  import { withInstall as X } from "../common/index.esm.js";
4
4
  const Y = "https://json-schema.org/draft/2020-12/schema", Z = "https://farris-design.gitee.io/capsule.schema.json", I = "capsule", K = "A Farris Component", x = "object", ee = {
5
5
  id: {
@@ -74,119 +74,133 @@ const Y = "https://json-schema.org/draft/2020-12/schema", Z = "https://farris-de
74
74
  type: x,
75
75
  properties: ee,
76
76
  required: te
77
- }, q = {}, _ = {};
78
- function C(t) {
79
- const { properties: e, title: r, ignore: l } = t, s = l && Array.isArray(l), o = Object.keys(e).reduce((i, h) => ((!s || !l.find((A) => A === h)) && (i[h] = e[h].type === "object" && e[h].properties ? C(e[h]) : U(e[h].default)), i), {});
80
- if (r && (!s || !l.find((i) => i === "id"))) {
81
- const i = r.toLowerCase().replace(/-/g, "_");
82
- o.id = `${i}_${Math.random().toString().slice(2, 6)}`;
77
+ }, _ = {}, H = {};
78
+ function F(t) {
79
+ const { properties: e, title: u, ignore: a } = t, l = a && Array.isArray(a), r = Object.keys(e).reduce((o, h) => ((!l || !a.find((A) => A === h)) && (o[h] = e[h].type === "object" && e[h].properties ? F(e[h]) : W(e[h].default)), o), {});
80
+ if (u && (!l || !a.find((o) => o === "id"))) {
81
+ const o = u.toLowerCase().replace(/-/g, "_");
82
+ r.id = `${o}_${Math.random().toString().slice(2, 6)}`;
83
83
  }
84
- return o;
84
+ return r;
85
85
  }
86
- function H(t, e = {}, r) {
87
- const l = q[t];
88
- if (l) {
89
- let s = C(l);
90
- const o = _[t];
91
- return s = o ? o({ getSchemaByType: H }, s, e, r) : s, s;
86
+ function ae(t) {
87
+ const { properties: e, title: u, required: a } = t;
88
+ if (a && Array.isArray(a)) {
89
+ const l = a.reduce((r, o) => (r[o] = e[o].type === "object" && e[o].properties ? F(e[o]) : W(e[o].default), r), {});
90
+ if (u && a.find((r) => r === "id")) {
91
+ const r = u.toLowerCase().replace(/-/g, "_");
92
+ l.id = `${r}_${Math.random().toString().slice(2, 6)}`;
93
+ }
94
+ return l;
92
95
  }
93
- return null;
96
+ return {
97
+ type: u
98
+ };
94
99
  }
95
- function ae(t, e) {
96
- const r = C(e);
97
- return Object.keys(r).reduce((l, s) => (l[s] && L(l[s]) && L(t[s] || !t[s]) ? Object.assign(l[s], t[s] || {}) : l[s] = t[s], l), r), r;
100
+ function z(t, e = {}, u) {
101
+ const a = _[t];
102
+ if (a) {
103
+ let l = ae(a);
104
+ const r = H[t];
105
+ return l = r ? r({ getSchemaByType: z }, l, e, u) : l, l;
106
+ }
107
+ return null;
98
108
  }
99
109
  function le(t, e) {
100
- return Object.keys(t).filter((l) => t[l] != null).reduce((l, s) => {
101
- if (e.has(s)) {
102
- const o = e.get(s);
103
- if (typeof o == "string")
104
- l[o] = t[s];
110
+ const u = F(e);
111
+ return Object.keys(u).reduce((a, l) => (Object.prototype.hasOwnProperty.call(t, l) && (a[l] && L(a[l]) && L(t[l] || !t[l]) ? Object.assign(a[l], t[l] || {}) : a[l] = t[l]), a), u), u;
112
+ }
113
+ function se(t, e) {
114
+ return Object.keys(t).filter((a) => t[a] != null).reduce((a, l) => {
115
+ if (e.has(l)) {
116
+ const r = e.get(l);
117
+ if (typeof r == "string")
118
+ a[r] = t[l];
105
119
  else {
106
- const i = o(s, t[s], t);
107
- Object.assign(l, i);
120
+ const o = r(l, t[l], t);
121
+ Object.assign(a, o);
108
122
  }
109
123
  } else
110
- l[s] = t[s];
111
- return l;
124
+ a[l] = t[l];
125
+ return a;
112
126
  }, {});
113
127
  }
114
- function se(t, e, r = /* @__PURE__ */ new Map()) {
115
- const l = ae(t, e);
116
- return le(l, r);
128
+ function ce(t, e, u = /* @__PURE__ */ new Map()) {
129
+ const a = le(t, e);
130
+ return se(a, u);
117
131
  }
118
- function ce(t = {}) {
119
- function e(c, p, f, v) {
132
+ function re(t = {}) {
133
+ function e(c, p, f, d) {
120
134
  if (typeof f == "number")
121
- return v[c].length === f;
135
+ return d[c].length === f;
122
136
  if (typeof f == "object") {
123
- const y = Object.keys(f)[0], b = f[y];
137
+ const y = Object.keys(f)[0], g = f[y];
124
138
  if (y === "not")
125
- return Number(v[c].length) !== Number(b);
139
+ return Number(d[c].length) !== Number(g);
126
140
  if (y === "moreThan")
127
- return Number(v[c].length) >= Number(b);
141
+ return Number(d[c].length) >= Number(g);
128
142
  if (y === "lessThan")
129
- return Number(v[c].length) <= Number(b);
143
+ return Number(d[c].length) <= Number(g);
130
144
  }
131
145
  return !1;
132
146
  }
133
- function r(c, p, f, v) {
134
- return v[c] && v[c].propertyValue && String(v[c].propertyValue.value) === String(f);
147
+ function u(c, p, f, d) {
148
+ return d[c] && d[c].propertyValue && String(d[c].propertyValue.value) === String(f);
135
149
  }
136
- const l = /* @__PURE__ */ new Map([
150
+ const a = /* @__PURE__ */ new Map([
137
151
  ["length", e],
138
- ["getProperty", r]
152
+ ["getProperty", u]
139
153
  ]);
140
- Object.keys(t).reduce((c, p) => (c.set(p, t[p]), c), l);
141
- function s(c, p) {
154
+ Object.keys(t).reduce((c, p) => (c.set(p, t[p]), c), a);
155
+ function l(c, p) {
142
156
  const f = c;
143
- return typeof p == "number" ? [{ target: f, operator: "length", param: null, value: Number(p) }] : typeof p == "boolean" ? [{ target: f, operator: "getProperty", param: c, value: !!p }] : typeof p == "object" ? Object.keys(p).map((v) => {
144
- if (v === "length")
145
- return { target: f, operator: "length", param: null, value: p[v] };
146
- const y = v, b = p[v];
147
- return { target: f, operator: "getProperty", param: y, value: b };
157
+ return typeof p == "number" ? [{ target: f, operator: "length", param: null, value: Number(p) }] : typeof p == "boolean" ? [{ target: f, operator: "getProperty", param: c, value: !!p }] : typeof p == "object" ? Object.keys(p).map((d) => {
158
+ if (d === "length")
159
+ return { target: f, operator: "length", param: null, value: p[d] };
160
+ const y = d, g = p[d];
161
+ return { target: f, operator: "getProperty", param: y, value: g };
148
162
  }) : [];
149
163
  }
150
- function o(c) {
151
- return Object.keys(c).reduce((f, v) => {
152
- const y = s(v, c[v]);
164
+ function r(c) {
165
+ return Object.keys(c).reduce((f, d) => {
166
+ const y = l(d, c[d]);
153
167
  return f.push(...y), f;
154
168
  }, []);
155
169
  }
156
- function i(c, p) {
157
- if (l.has(c.operator)) {
158
- const f = l.get(c.operator);
170
+ function o(c, p) {
171
+ if (a.has(c.operator)) {
172
+ const f = a.get(c.operator);
159
173
  return f && f(c.target, c.param, c.value, p) || !1;
160
174
  }
161
175
  return !1;
162
176
  }
163
177
  function h(c, p) {
164
- return o(c).reduce((y, b) => y && i(b, p), !0);
178
+ return r(c).reduce((y, g) => y && o(g, p), !0);
165
179
  }
166
180
  function A(c, p) {
167
- const f = Object.keys(c), v = f.includes("allOf"), y = f.includes("anyOf"), b = v || y, $ = (b ? c[b ? v ? "allOf" : "anyOf" : "allOf"] : [c]).map((B) => h(B, p));
168
- return v ? !$.includes(!1) : $.includes(!0);
181
+ const f = Object.keys(c), d = f.includes("allOf"), y = f.includes("anyOf"), g = d || y, B = (g ? c[g ? d ? "allOf" : "anyOf" : "allOf"] : [c]).map(($) => h($, p));
182
+ return d ? !B.includes(!1) : B.includes(!0);
169
183
  }
170
184
  return { parseValueSchema: A };
171
185
  }
172
- const ue = {}, re = {};
173
- ce();
174
- function oe(t, e, r = /* @__PURE__ */ new Map(), l = (i, h, A, c) => h, s = {}, o = (i) => i) {
175
- return q[e.title] = e, _[e.title] = l, ue[e.title] = s, re[e.title] = o, (i = {}) => {
176
- const h = se(i, e, r), A = Object.keys(t).reduce((c, p) => (c[p] = t[p].default, c), {});
186
+ const ue = {}, oe = {};
187
+ re();
188
+ function ie(t, e, u = /* @__PURE__ */ new Map(), a = (o, h, A, c) => h, l = {}, r = (o) => o) {
189
+ return _[e.title] = e, H[e.title] = a, ue[e.title] = l, oe[e.title] = r, (o = {}) => {
190
+ const h = ce(o, e, u), A = Object.keys(t).reduce((c, p) => (c[p] = t[p].default, c), {});
177
191
  return Object.assign(A, h);
178
192
  };
179
193
  }
180
- function ie(t, e) {
194
+ function pe(t, e) {
181
195
  return { customClass: e.class, customStyle: e.style };
182
196
  }
183
- const pe = /* @__PURE__ */ new Map([
184
- ["appearance", ie]
197
+ const fe = /* @__PURE__ */ new Map([
198
+ ["appearance", pe]
185
199
  ]);
186
- function fe(t, e, r) {
200
+ function de(t, e, u) {
187
201
  return e;
188
202
  }
189
- const ve = "capsule", de = "A Farris Component", me = "object", ye = {
203
+ const ve = "capsule", me = "A Farris Component", ye = "object", he = {
190
204
  basic: {
191
205
  description: "Basic Infomation",
192
206
  title: "基本信息",
@@ -208,12 +222,12 @@ const ve = "capsule", de = "A Farris Component", me = "object", ye = {
208
222
  }
209
223
  }
210
224
  }
211
- }, he = {
225
+ }, ge = {
212
226
  title: ve,
213
- description: de,
214
- type: me,
215
- categories: ye
216
- }, W = {
227
+ description: me,
228
+ type: ye,
229
+ categories: he
230
+ }, q = {
217
231
  items: {
218
232
  Type: Array,
219
233
  default: [
@@ -234,124 +248,124 @@ const ve = "capsule", de = "A Farris Component", me = "object", ye = {
234
248
  index: { type: Number, default: 0 },
235
249
  show: { type: Boolean, default: !0 },
236
250
  disabled: { type: Boolean, default: !1 }
237
- }, z = oe(W, ne, pe, fe, he), G = /* @__PURE__ */ F({
251
+ }, G = ie(q, ne, fe, de, ge), J = /* @__PURE__ */ C({
238
252
  name: "FCapsuleItem",
239
253
  props: be,
240
254
  emits: ["mounted", "active"],
241
255
  setup(t, e) {
242
- const r = m(), l = m(t.isActive);
243
- P(() => t.isActive, (i) => {
244
- l.value = i;
256
+ const u = m(), a = m(t.isActive);
257
+ E(() => t.isActive, (o) => {
258
+ a.value = o;
245
259
  });
246
- const s = S(() => ({
260
+ const l = R(() => ({
247
261
  "f-capsule-item": !0,
248
- "f-capsule-active-item": l.value,
262
+ "f-capsule-active-item": a.value,
249
263
  "f-capsule-disabled": t.disabled
250
264
  }));
251
265
  T(() => {
252
- e.emit("mounted", r, t.value);
266
+ e.emit("mounted", u, t.value);
253
267
  });
254
- function o(i) {
255
- t.disabled || e.emit("active", i, {
268
+ function r(o) {
269
+ t.disabled || e.emit("active", o, {
256
270
  name: t.name,
257
271
  value: t.value
258
272
  });
259
273
  }
260
- return () => w("div", {
261
- ref: r,
262
- class: s.value,
263
- onClick: (i) => o(i)
264
- }, [t.icon && w("i", {
274
+ return () => M("div", {
275
+ ref: u,
276
+ class: l.value,
277
+ onClick: (o) => r(o)
278
+ }, [t.icon && M("i", {
265
279
  class: t.icon
266
280
  }, null), t.name]);
267
281
  }
268
- }), N = /* @__PURE__ */ F({
282
+ }), N = /* @__PURE__ */ C({
269
283
  name: "FCapsule",
270
- props: W,
284
+ props: q,
271
285
  emits: ["change", "update:modelValue"],
272
286
  setup(t, e) {
273
- const r = m(t.items), l = m(), s = 2, o = m(t.modelValue), i = m("none"), h = m(t.type), A = S(() => {
274
- const a = {
287
+ const u = m(t.items), a = m(), l = 2, r = m(t.modelValue), o = m("none"), h = m(t.type), A = R(() => {
288
+ const s = {
275
289
  "f-capsule-container": !0
276
290
  };
277
- return h.value && (a[h.value] = !0), a;
278
- }), c = S(() => ({})), p = S(() => ({
291
+ return h.value && (s[h.value] = !0), s;
292
+ }), c = R(() => ({})), p = R(() => ({
279
293
  "f-capsule": !0
280
- })), f = m(s), v = m(0), y = m(0), b = S(() => ({
294
+ })), f = m(l), d = m(0), y = m(0), g = R(() => ({
281
295
  left: `${f.value}px`,
282
- width: `${v.value}px`,
283
- transition: i.value
284
- })), V = S(() => ({
296
+ width: `${d.value}px`,
297
+ transition: o.value
298
+ })), V = R(() => ({
285
299
  width: `${y.value}px`
286
- })), M = /* @__PURE__ */ new Map();
287
- function $(a) {
300
+ })), w = /* @__PURE__ */ new Map();
301
+ function B(s) {
288
302
  var n;
289
- if (M.has(a.value)) {
290
- const u = (n = M.get(a.value)) == null ? void 0 : n.value;
291
- if (u) {
292
- const j = u.getBoundingClientRect(), D = l.value.getBoundingClientRect();
293
- f.value = j.left - D.left + s + l.value.scrollLeft, v.value = j.width - 2 * s;
303
+ if (w.has(s.value)) {
304
+ const i = (n = w.get(s.value)) == null ? void 0 : n.value;
305
+ if (i) {
306
+ const j = i.getBoundingClientRect(), D = a.value.getBoundingClientRect();
307
+ f.value = j.left - D.left + l + a.value.scrollLeft, d.value = j.width - 2 * l;
294
308
  }
295
309
  }
296
310
  }
297
- function R(a, n) {
298
- const u = a.value;
299
- o.value = u, e.emit("update:modelValue", u), $(a), n && e.emit("change", u);
311
+ function S(s, n) {
312
+ const i = s.value;
313
+ r.value = i, e.emit("update:modelValue", i), B(s), n && e.emit("change", i);
300
314
  }
301
- function B(a) {
302
- const n = r.value.findIndex((u) => u.value === a);
303
- n > -1 && R(r.value[n], !1);
315
+ function $(s) {
316
+ const n = u.value.findIndex((i) => i.value === s);
317
+ n > -1 && S(u.value[n], !1);
304
318
  }
305
- P(() => t.modelValue, (a) => {
306
- o.value = a, B(o.value);
319
+ E(() => t.modelValue, (s) => {
320
+ r.value = s, $(r.value);
307
321
  }), T(async () => {
308
- B(o.value), await k(), i.value = "0.1s ease-out all", y.value = Array.from(M.values()).reduce((a, n) => (a += n.value.clientWidth, a), 0);
322
+ $(r.value), await k(), o.value = "0.1s ease-out all", y.value = Array.from(w.values()).reduce((s, n) => (s += n.value.clientWidth, s), 0);
309
323
  });
310
- function E(a, n) {
311
- R(n, !0);
324
+ function P(s, n) {
325
+ S(n, !0);
312
326
  }
313
- function d(a, n) {
314
- M.set(n, a);
327
+ function v(s, n) {
328
+ w.set(n, s);
315
329
  }
316
- function O(a) {
317
- Array.from(M.keys()).forEach((n) => {
318
- a.find((j) => j.value === n) || M.delete(n);
330
+ function O(s) {
331
+ Array.from(w.keys()).forEach((n) => {
332
+ s.find((j) => j.value === n) || w.delete(n);
319
333
  });
320
334
  }
321
- function g(a, n) {
322
- return w(G, {
323
- name: a.name,
324
- value: a.value,
325
- isActive: a.value === o.value,
335
+ function b(s, n) {
336
+ return M(J, {
337
+ name: s.name,
338
+ value: s.value,
339
+ isActive: s.value === r.value,
326
340
  index: n,
327
- disabled: a.disabled,
328
- key: a.value,
329
- onMounted: d,
330
- onActive: E
341
+ disabled: s.disabled,
342
+ key: s.value,
343
+ onMounted: v,
344
+ onActive: P
331
345
  }, null);
332
346
  }
333
- return P(() => t.items, async (a) => {
334
- const n = a.filter((u) => u.show);
335
- O(n), r.value = n, await k(), B(o.value), y.value = Array.from(M.values()).reduce((u, j) => (u += j.value.clientWidth, u), 0);
336
- }), () => w("span", {
337
- ref: l,
347
+ return E(() => t.items, async (s) => {
348
+ const n = s.filter((i) => i.show);
349
+ O(n), u.value = n, await k(), $(r.value), y.value = Array.from(w.values()).reduce((i, j) => (i += j.value.clientWidth, i), 0);
350
+ }), () => M("span", {
351
+ ref: a,
338
352
  class: A.value,
339
353
  style: c.value
340
- }, [w("span", {
354
+ }, [M("span", {
341
355
  class: "f-capsule-pane"
342
- }, [r.value.map((a, n) => g(a, n))]), w("small", {
356
+ }, [u.value.map((s, n) => b(s, n))]), M("small", {
343
357
  class: p.value,
344
- style: b.value
345
- }, null), w("div", {
358
+ style: g.value
359
+ }, null), M("div", {
346
360
  class: "f-capsule-board",
347
361
  style: V.value
348
362
  }, null)]);
349
363
  }
350
364
  });
351
- function ge(t, e, r) {
352
- var E;
353
- const l = "", s = "", o = m();
354
- function i() {
365
+ function je(t, e, u) {
366
+ var P;
367
+ const a = "", l = "", r = m();
368
+ function o() {
355
369
  return (e == null ? void 0 : e.schema.componentType) !== "frame";
356
370
  }
357
371
  function h() {
@@ -363,162 +377,162 @@ function ge(t, e, r) {
363
377
  function c() {
364
378
  return (e == null ? void 0 : e.schema.componentType) === "frame";
365
379
  }
366
- function p(d) {
367
- if (!d || !d.value)
380
+ function p(v) {
381
+ if (!v || !v.value)
368
382
  return null;
369
- if (d.value.schema && d.value.schema.type === "component")
370
- return d.value;
371
- const O = m(d == null ? void 0 : d.value.parent), g = p(O);
372
- return g || null;
383
+ if (v.value.schema && v.value.schema.type === "component")
384
+ return v.value;
385
+ const O = m(v == null ? void 0 : v.value.parent), b = p(O);
386
+ return b || null;
373
387
  }
374
- function f(d = e) {
375
- const { componentInstance: O, designerItemElementRef: g } = d;
376
- return !O || !O.value ? null : O.value.canMove ? g : f(d.parent);
388
+ function f(v = e) {
389
+ const { componentInstance: O, designerItemElementRef: b } = v;
390
+ return !O || !O.value ? null : O.value.canMove ? b : f(v.parent);
377
391
  }
378
- function v(d) {
379
- return !!r;
392
+ function d(v) {
393
+ return !!u;
380
394
  }
381
395
  function y() {
382
396
  return (e == null ? void 0 : e.schema.label) || (e == null ? void 0 : e.schema.title) || (e == null ? void 0 : e.schema.name);
383
397
  }
384
- function b() {
398
+ function g() {
385
399
  }
386
- function V(d, O) {
400
+ function V(v, O) {
387
401
  }
388
- function M(d, O) {
389
- const { componentType: g } = d;
390
- let a = H(g, d, O);
391
- const n = g.toLowerCase().replace(/-/g, "_");
392
- return a && !a.id && a.type === g && (a.id = `${n}_${Math.random().toString().slice(2, 6)}`), a;
402
+ function w(v, O) {
403
+ const { componentType: b } = v;
404
+ let s = z(b, v, O);
405
+ const n = b.toLowerCase().replace(/-/g, "_");
406
+ return s && !s.id && s.type === b && (s.id = `${n}_${Math.random().toString().slice(2, 6)}`), s;
393
407
  }
394
- function $(d) {
408
+ function B(v) {
395
409
  }
396
- function R(...d) {
410
+ function S(...v) {
397
411
  }
398
- function B() {
399
- e != null && e.schema.contents && e.schema.contents.map((d) => {
400
- var a;
401
- let O = d.id;
402
- d.type === "component-ref" && (O = d.component);
403
- const g = t.value.querySelector(`#${O}-design-item`);
404
- (a = g == null ? void 0 : g.componentInstance) != null && a.value.onRemoveComponent && g.componentInstance.value.onRemoveComponent();
412
+ function $() {
413
+ e != null && e.schema.contents && e.schema.contents.map((v) => {
414
+ var s;
415
+ let O = v.id;
416
+ v.type === "component-ref" && (O = v.component);
417
+ const b = t.value.querySelector(`#${O}-design-item`);
418
+ (s = b == null ? void 0 : b.componentInstance) != null && s.value.onRemoveComponent && b.componentInstance.value.onRemoveComponent();
405
419
  });
406
420
  }
407
- return o.value = {
408
- canMove: i(),
421
+ return r.value = {
422
+ canMove: o(),
409
423
  canSelectParent: h(),
410
424
  canDelete: A(),
411
425
  canNested: !c(),
412
426
  contents: e == null ? void 0 : e.schema.contents,
413
427
  elementRef: t,
414
- parent: (E = e == null ? void 0 : e.parent) == null ? void 0 : E.componentInstance,
428
+ parent: (P = e == null ? void 0 : e.parent) == null ? void 0 : P.componentInstance,
415
429
  schema: e == null ? void 0 : e.schema,
416
- styles: l,
417
- designerClass: s,
418
- canAccepts: v,
430
+ styles: a,
431
+ designerClass: l,
432
+ canAccepts: d,
419
433
  getBelongedComponentInstance: p,
420
434
  getDraggableDesignItemElement: f,
421
435
  getDraggingDisplayText: y,
422
- getPropConfig: R,
423
- getDragScopeElement: b,
436
+ getPropConfig: S,
437
+ getDragScopeElement: g,
424
438
  onAcceptMovedChildElement: V,
425
- onChildElementMovedOut: $,
426
- addNewChildComponentSchema: M,
439
+ onChildElementMovedOut: B,
440
+ addNewChildComponentSchema: w,
427
441
  triggerBelongedComponentToMoveWhenMoved: m(!1),
428
442
  triggerBelongedComponentToDeleteWhenDeleted: m(!1),
429
- onRemoveComponent: B
430
- }, o;
443
+ onRemoveComponent: $
444
+ }, r;
431
445
  }
432
- const je = /* @__PURE__ */ F({
446
+ const Oe = /* @__PURE__ */ C({
433
447
  name: "FCapsuleDesign",
434
- props: W,
448
+ props: q,
435
449
  emits: ["change", "update:modelValue"],
436
450
  setup(t, e) {
437
- const r = m(t.items), l = m(), s = 2, o = m(t.modelValue), i = m("none"), h = m(t.type), A = Q("design-item-context"), c = ge(l, A);
451
+ const u = m(t.items), a = m(), l = 2, r = m(t.modelValue), o = m("none"), h = m(t.type), A = U("design-item-context"), c = je(a, A);
438
452
  T(() => {
439
- l.value.componentInstance = c;
453
+ a.value.componentInstance = c;
440
454
  }), e.expose(c.value);
441
- const p = S(() => {
455
+ const p = R(() => {
442
456
  const n = {
443
457
  "f-capsule-container": !0
444
458
  };
445
459
  return h.value && (n[h.value] = !0), n;
446
- }), f = S(() => ({})), v = S(() => ({
460
+ }), f = R(() => ({})), d = R(() => ({
447
461
  "f-capsule": !0
448
- })), y = m(s), b = m(0), V = m(0), M = S(() => ({
462
+ })), y = m(l), g = m(0), V = m(0), w = R(() => ({
449
463
  left: `${y.value}px`,
450
- width: `${b.value}px`,
451
- transition: i.value
452
- })), $ = S(() => ({
464
+ width: `${g.value}px`,
465
+ transition: o.value
466
+ })), B = R(() => ({
453
467
  width: `${V.value}px`
454
- })), R = /* @__PURE__ */ new Map();
455
- function B(n) {
456
- var u;
457
- if (R.has(n.value)) {
458
- const j = (u = R.get(n.value)) == null ? void 0 : u.value;
468
+ })), S = /* @__PURE__ */ new Map();
469
+ function $(n) {
470
+ var i;
471
+ if (S.has(n.value)) {
472
+ const j = (i = S.get(n.value)) == null ? void 0 : i.value;
459
473
  if (j) {
460
- const D = j.getBoundingClientRect(), J = l.value.getBoundingClientRect();
461
- y.value = D.left - J.left + s + l.value.scrollLeft, b.value = D.width - 2 * s;
474
+ const D = j.getBoundingClientRect(), Q = a.value.getBoundingClientRect();
475
+ y.value = D.left - Q.left + l + a.value.scrollLeft, g.value = D.width - 2 * l;
462
476
  }
463
477
  }
464
478
  }
465
- function E(n, u) {
479
+ function P(n, i) {
466
480
  const j = n.value;
467
- o.value = j, e.emit("update:modelValue", j), B(n), u && e.emit("change", j);
481
+ r.value = j, e.emit("update:modelValue", j), $(n), i && e.emit("change", j);
468
482
  }
469
- function d(n) {
470
- const u = r.value.findIndex((j) => j.value === n);
471
- u > -1 && E(r.value[u], !1);
483
+ function v(n) {
484
+ const i = u.value.findIndex((j) => j.value === n);
485
+ i > -1 && P(u.value[i], !1);
472
486
  }
473
- P(() => t.modelValue, (n) => {
474
- o.value = n, d(o.value);
475
- }), P(() => t.items, async (n) => {
476
- r.value = n, await k(), d(o.value), V.value = Array.from(R.values()).reduce((u, j) => (u += j.value.clientWidth, u), 0);
487
+ E(() => t.modelValue, (n) => {
488
+ r.value = n, v(r.value);
489
+ }), E(() => t.items, async (n) => {
490
+ u.value = n, await k(), v(r.value), V.value = Array.from(S.values()).reduce((i, j) => (i += j.value.clientWidth, i), 0);
477
491
  }), T(async () => {
478
- d(o.value), await k(), i.value = "0.1s ease-out all", V.value = Array.from(R.values()).reduce((n, u) => (n += u.value.clientWidth, n), 0);
492
+ v(r.value), await k(), o.value = "0.1s ease-out all", V.value = Array.from(S.values()).reduce((n, i) => (n += i.value.clientWidth, n), 0);
479
493
  });
480
- function O(n, u) {
481
- E(u, !0);
494
+ function O(n, i) {
495
+ P(i, !0);
482
496
  }
483
- function g(n, u) {
484
- R.set(u, n);
497
+ function b(n, i) {
498
+ S.set(i, n);
485
499
  }
486
- function a(n, u) {
487
- return w(G, {
500
+ function s(n, i) {
501
+ return M(J, {
488
502
  name: n.name,
489
503
  value: n.value,
490
- isActive: n.value === o.value,
491
- index: u,
492
- onMounted: g,
504
+ isActive: n.value === r.value,
505
+ index: i,
506
+ onMounted: b,
493
507
  onActive: O
494
508
  }, null);
495
509
  }
496
- return () => w("span", {
497
- ref: l,
510
+ return () => M("span", {
511
+ ref: a,
498
512
  class: p.value,
499
513
  style: f.value
500
- }, [w("span", {
514
+ }, [M("span", {
501
515
  class: "f-capsule-pane"
502
- }, [r.value.map((n, u) => a(n, u))]), w("small", {
503
- class: v.value,
504
- style: M.value
505
- }, null), w("div", {
516
+ }, [u.value.map((n, i) => s(n, i))]), M("small", {
517
+ class: d.value,
518
+ style: w.value
519
+ }, null), M("div", {
506
520
  class: "f-capsule-board",
507
- style: $.value
521
+ style: B.value
508
522
  }, null)]);
509
523
  }
510
524
  });
511
- N.register = (t, e, r) => {
512
- t.capsule = N, e.capsule = z;
525
+ N.register = (t, e, u) => {
526
+ t.capsule = N, e.capsule = G;
513
527
  };
514
- N.registerDesigner = (t, e, r) => {
515
- t.capsule = je, e.capsule = z;
528
+ N.registerDesigner = (t, e, u) => {
529
+ t.capsule = Oe, e.capsule = G;
516
530
  };
517
- const we = X(N);
531
+ const Se = X(N);
518
532
  export {
519
533
  N as FCapsule,
520
534
  be as capsuleItemProps,
521
- W as capsuleProps,
522
- we as default,
523
- z as propsResolver
535
+ q as capsuleProps,
536
+ Se as default,
537
+ G as propsResolver
524
538
  };