@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,117 +1,131 @@
1
- import { ref as S, onMounted as _, defineComponent as F, createVNode as y, withDirectives as L, vShow as N, Teleport as x, Fragment as Y, inject as C } from "vue";
2
- import { isPlainObject as V, cloneDeep as P } from "lodash-es";
3
- const Z = {}, G = {};
4
- function M(e) {
5
- const { properties: t, title: a, ignore: o } = e, i = o && Array.isArray(o), f = Object.keys(t).reduce((m, c) => ((!i || !o.find((D) => D === c)) && (m[c] = t[c].type === "object" && t[c].properties ? M(t[c]) : P(t[c].default)), m), {});
6
- if (a && (!i || !o.find((m) => m === "id"))) {
7
- const m = a.toLowerCase().replace(/-/g, "_");
8
- f.id = `${m}_${Math.random().toString().slice(2, 6)}`;
1
+ import { ref as S, onMounted as X, defineComponent as A, createVNode as y, withDirectives as L, vShow as N, Teleport as C, Fragment as Y, inject as P } from "vue";
2
+ import { isPlainObject as V, cloneDeep as Z } from "lodash-es";
3
+ const G = {}, J = {};
4
+ function F(e) {
5
+ const { properties: t, title: l, ignore: n } = e, i = n && Array.isArray(n), c = Object.keys(t).reduce((u, d) => ((!i || !n.find((D) => D === d)) && (u[d] = t[d].type === "object" && t[d].properties ? F(t[d]) : Z(t[d].default)), u), {});
6
+ if (l && (!i || !n.find((u) => u === "id"))) {
7
+ const u = l.toLowerCase().replace(/-/g, "_");
8
+ c.id = `${u}_${Math.random().toString().slice(2, 6)}`;
9
9
  }
10
- return f;
10
+ return c;
11
11
  }
12
- function J(e, t = {}, a) {
13
- const o = Z[e];
14
- if (o) {
15
- let i = M(o);
16
- const f = G[e];
17
- return i = f ? f({ getSchemaByType: J }, i, t, a) : i, i;
12
+ function K(e) {
13
+ const { properties: t, title: l, required: n } = e;
14
+ if (n && Array.isArray(n)) {
15
+ const i = n.reduce((c, u) => (c[u] = t[u].type === "object" && t[u].properties ? F(t[u]) : Z(t[u].default), c), {});
16
+ if (l && n.find((c) => c === "id")) {
17
+ const c = l.toLowerCase().replace(/-/g, "_");
18
+ i.id = `${c}_${Math.random().toString().slice(2, 6)}`;
19
+ }
20
+ return i;
18
21
  }
19
- return null;
22
+ return {
23
+ type: l
24
+ };
20
25
  }
21
- function K(e, t) {
22
- const a = M(t);
23
- return Object.keys(a).reduce((o, i) => (o[i] && V(o[i]) && V(e[i] || !e[i]) ? Object.assign(o[i], e[i] || {}) : o[i] = e[i], o), a), a;
26
+ function Q(e, t = {}, l) {
27
+ const n = G[e];
28
+ if (n) {
29
+ let i = K(n);
30
+ const c = J[e];
31
+ return i = c ? c({ getSchemaByType: Q }, i, t, l) : i, i;
32
+ }
33
+ return null;
24
34
  }
25
35
  function I(e, t) {
26
- return Object.keys(e).filter((o) => e[o] != null).reduce((o, i) => {
36
+ const l = F(t);
37
+ return Object.keys(l).reduce((n, i) => (Object.prototype.hasOwnProperty.call(e, i) && (n[i] && V(n[i]) && V(e[i] || !e[i]) ? Object.assign(n[i], e[i] || {}) : n[i] = e[i]), n), l), l;
38
+ }
39
+ function ee(e, t) {
40
+ return Object.keys(e).filter((n) => e[n] != null).reduce((n, i) => {
27
41
  if (t.has(i)) {
28
- const f = t.get(i);
29
- if (typeof f == "string")
30
- o[f] = e[i];
42
+ const c = t.get(i);
43
+ if (typeof c == "string")
44
+ n[c] = e[i];
31
45
  else {
32
- const m = f(i, e[i], e);
33
- Object.assign(o, m);
46
+ const u = c(i, e[i], e);
47
+ Object.assign(n, u);
34
48
  }
35
49
  } else
36
- o[i] = e[i];
37
- return o;
50
+ n[i] = e[i];
51
+ return n;
38
52
  }, {});
39
53
  }
40
- function ee(e, t, a = /* @__PURE__ */ new Map()) {
41
- const o = K(e, t);
42
- return I(o, a);
54
+ function te(e, t, l = /* @__PURE__ */ new Map()) {
55
+ const n = I(e, t);
56
+ return ee(n, l);
43
57
  }
44
- function te(e = {}) {
45
- function t(r, u, s, p) {
58
+ function ne(e = {}) {
59
+ function t(r, f, s, m) {
46
60
  if (typeof s == "number")
47
- return p[r].length === s;
61
+ return m[r].length === s;
48
62
  if (typeof s == "object") {
49
63
  const b = Object.keys(s)[0], g = s[b];
50
64
  if (b === "not")
51
- return Number(p[r].length) !== Number(g);
65
+ return Number(m[r].length) !== Number(g);
52
66
  if (b === "moreThan")
53
- return Number(p[r].length) >= Number(g);
67
+ return Number(m[r].length) >= Number(g);
54
68
  if (b === "lessThan")
55
- return Number(p[r].length) <= Number(g);
69
+ return Number(m[r].length) <= Number(g);
56
70
  }
57
71
  return !1;
58
72
  }
59
- function a(r, u, s, p) {
60
- return p[r] && p[r].propertyValue && String(p[r].propertyValue.value) === String(s);
73
+ function l(r, f, s, m) {
74
+ return m[r] && m[r].propertyValue && String(m[r].propertyValue.value) === String(s);
61
75
  }
62
- const o = /* @__PURE__ */ new Map([
76
+ const n = /* @__PURE__ */ new Map([
63
77
  ["length", t],
64
- ["getProperty", a]
78
+ ["getProperty", l]
65
79
  ]);
66
- Object.keys(e).reduce((r, u) => (r.set(u, e[u]), r), o);
67
- function i(r, u) {
80
+ Object.keys(e).reduce((r, f) => (r.set(f, e[f]), r), n);
81
+ function i(r, f) {
68
82
  const s = r;
69
- return typeof u == "number" ? [{ target: s, operator: "length", param: null, value: Number(u) }] : typeof u == "boolean" ? [{ target: s, operator: "getProperty", param: r, value: !!u }] : typeof u == "object" ? Object.keys(u).map((p) => {
70
- if (p === "length")
71
- return { target: s, operator: "length", param: null, value: u[p] };
72
- const b = p, g = u[p];
83
+ return typeof f == "number" ? [{ target: s, operator: "length", param: null, value: Number(f) }] : typeof f == "boolean" ? [{ target: s, operator: "getProperty", param: r, value: !!f }] : typeof f == "object" ? Object.keys(f).map((m) => {
84
+ if (m === "length")
85
+ return { target: s, operator: "length", param: null, value: f[m] };
86
+ const b = m, g = f[m];
73
87
  return { target: s, operator: "getProperty", param: b, value: g };
74
88
  }) : [];
75
89
  }
76
- function f(r) {
77
- return Object.keys(r).reduce((s, p) => {
78
- const b = i(p, r[p]);
90
+ function c(r) {
91
+ return Object.keys(r).reduce((s, m) => {
92
+ const b = i(m, r[m]);
79
93
  return s.push(...b), s;
80
94
  }, []);
81
95
  }
82
- function m(r, u) {
83
- if (o.has(r.operator)) {
84
- const s = o.get(r.operator);
85
- return s && s(r.target, r.param, r.value, u) || !1;
96
+ function u(r, f) {
97
+ if (n.has(r.operator)) {
98
+ const s = n.get(r.operator);
99
+ return s && s(r.target, r.param, r.value, f) || !1;
86
100
  }
87
101
  return !1;
88
102
  }
89
- function c(r, u) {
90
- return f(r).reduce((b, g) => b && m(g, u), !0);
103
+ function d(r, f) {
104
+ return c(r).reduce((b, g) => b && u(g, f), !0);
91
105
  }
92
- function D(r, u) {
93
- const s = Object.keys(r), p = s.includes("allOf"), b = s.includes("anyOf"), g = p || b, d = (g ? r[g ? p ? "allOf" : "anyOf" : "allOf"] : [r]).map((B) => c(B, u));
94
- return p ? !d.includes(!1) : d.includes(!0);
106
+ function D(r, f) {
107
+ const s = Object.keys(r), m = s.includes("allOf"), b = s.includes("anyOf"), g = m || b, p = (g ? r[g ? m ? "allOf" : "anyOf" : "allOf"] : [r]).map((B) => d(B, f));
108
+ return m ? !p.includes(!1) : p.includes(!0);
95
109
  }
96
110
  return { parseValueSchema: D };
97
111
  }
98
- const ne = {}, oe = {};
99
- te();
100
- function ie(e, t, a = /* @__PURE__ */ new Map(), o = (m, c, D, r) => c, i = {}, f = (m) => m) {
101
- return Z[t.title] = t, G[t.title] = o, ne[t.title] = i, oe[t.title] = f, (m = {}) => {
102
- const c = ee(m, t, a), D = Object.keys(e).reduce((r, u) => (r[u] = e[u].default, r), {});
103
- return Object.assign(D, c);
112
+ const oe = {}, ie = {};
113
+ ne();
114
+ function re(e, t, l = /* @__PURE__ */ new Map(), n = (u, d, D, r) => d, i = {}, c = (u) => u) {
115
+ return G[t.title] = t, J[t.title] = n, oe[t.title] = i, ie[t.title] = c, (u = {}) => {
116
+ const d = te(u, t, l), D = Object.keys(e).reduce((r, f) => (r[f] = e[f].default, r), {});
117
+ return Object.assign(D, d);
104
118
  };
105
119
  }
106
- function re(e, t) {
120
+ function se(e, t) {
107
121
  return { customClass: t.class, customStyle: t.style };
108
122
  }
109
- function se(e, t, a) {
123
+ function ae(e, t, l) {
110
124
  return t;
111
125
  }
112
126
  const le = /* @__PURE__ */ new Map([
113
- ["appearance", re]
114
- ]), ae = "https://json-schema.org/draft/2020-12/schema", ce = "https://farris-design.gitee.io/dropdown.schema.json", ue = "dropdown", de = "A Farris Component", fe = "object", pe = {
127
+ ["appearance", se]
128
+ ]), ce = "https://json-schema.org/draft/2020-12/schema", ue = "https://farris-design.gitee.io/dropdown.schema.json", de = "dropdown", fe = "A Farris Component", pe = "object", me = {
115
129
  id: {
116
130
  description: "The unique identifier for dropdown",
117
131
  type: "string"
@@ -173,18 +187,18 @@ const le = /* @__PURE__ */ new Map([
173
187
  type: "boolean",
174
188
  default: !0
175
189
  }
176
- }, me = [
190
+ }, ye = [
177
191
  "id",
178
192
  "type"
179
- ], ye = {
180
- $schema: ae,
181
- $id: ce,
182
- title: ue,
183
- description: de,
184
- type: fe,
185
- properties: pe,
186
- required: me
187
- }, ge = "dropdown", be = "A Farris Component", we = "object", ve = {
193
+ ], ge = {
194
+ $schema: ce,
195
+ $id: ue,
196
+ title: de,
197
+ description: fe,
198
+ type: pe,
199
+ properties: me,
200
+ required: ye
201
+ }, be = "dropdown", we = "A Farris Component", he = "object", ve = {
188
202
  basic: {
189
203
  description: "Basic Infomation",
190
204
  title: "基本信息",
@@ -237,12 +251,12 @@ const le = /* @__PURE__ */ new Map([
237
251
  }
238
252
  }
239
253
  }
240
- }, he = {
241
- title: ge,
242
- description: be,
243
- type: we,
254
+ }, Se = {
255
+ title: be,
256
+ description: we,
257
+ type: he,
244
258
  categories: ve
245
- }, W = {
259
+ }, M = {
246
260
  /** 默认展开或折叠 */
247
261
  show: { type: Boolean, default: !1 },
248
262
  /** 下拉按钮是否禁用 */
@@ -272,15 +286,15 @@ const le = /* @__PURE__ */ new Map([
272
286
  },
273
287
  onSelect: { type: Function, default: () => {
274
288
  } }
275
- }, X = ie(W, ye, le, se, he);
276
- function Q(e, t) {
277
- let a;
278
- const o = S(e.show), i = S(), f = S(), m = S(), c = 10;
279
- _(() => {
280
- a = f.value;
289
+ }, _ = re(M, ge, le, ae, Se);
290
+ function U(e, t) {
291
+ let l;
292
+ const n = S(e.show), i = S(), c = S(), u = S(), d = 10;
293
+ X(() => {
294
+ l = c.value;
281
295
  });
282
- const D = (d = 1) => {
283
- const n = [
296
+ const D = (p = 1) => {
297
+ const o = [
284
298
  "body>.f-datagrid-settings-simple-host",
285
299
  "body>div",
286
300
  "body>farris-dialog>.farris-modal.show",
@@ -290,75 +304,75 @@ function Q(e, t) {
290
304
  "body>.popover.show",
291
305
  "body>filter-row-panel>.f-datagrid-filter-panel",
292
306
  "body>.f-section-maximize"
293
- ], B = Array.from(document.body.querySelectorAll(n.join(","))).filter((l) => l).map((l) => {
294
- const { display: v, zIndex: w } = window.getComputedStyle(l);
295
- return v === "none" ? 0 : parseInt(w, 10);
296
- }).filter((l) => l);
297
- let h = Math.max(...B);
298
- return h < 1040 && (h = 1040), h + d;
299
- }, r = (d, n) => {
307
+ ], B = Array.from(document.body.querySelectorAll(o.join(","))).filter((a) => a).map((a) => {
308
+ const { display: h, zIndex: w } = window.getComputedStyle(a);
309
+ return h === "none" ? 0 : parseInt(w, 10);
310
+ }).filter((a) => a);
311
+ let v = Math.max(...B);
312
+ return v < 1040 && (v = 1040), v + p;
313
+ }, r = (p, o) => {
300
314
  const {
301
315
  height: B,
302
- left: h,
303
- top: l,
304
- width: v
305
- } = d.getBoundingClientRect(), { width: w, height: k, top: A } = n.getBoundingClientRect();
306
- if (d.className.indexOf("dropdown-submenu") > -1 || d.closest(".dropdown-submenu") || d.classList.contains("dropright")) {
307
- const O = window.innerWidth - h - d.offsetWidth, j = window.innerHeight - l, { position: R } = getComputedStyle(n);
308
- if (R === "fixed") {
309
- let $ = h + d.offsetWidth;
310
- n.offsetWidth > O && h > O && ($ = h - w), n.style.left = $ + "px", n.style.right = "auto", window.innerHeight - 2 * c < n.offsetHeight ? (n.style.top = c + "px", n.style.bottom = c + "px", n.style.maxHeight = window.innerHeight - 2 * c + "px", n.style.overflowY = "auto", n.className += " dropdown-menu-maxheight") : j < n.offsetHeight ? (n.style.top = "auto", n.style.bottom = c + "px") : (n.style.top = l + "px", n.style.bottom = "auto");
316
+ left: v,
317
+ top: a,
318
+ width: h
319
+ } = p.getBoundingClientRect(), { width: w, height: k, top: W } = o.getBoundingClientRect();
320
+ if (p.className.indexOf("dropdown-submenu") > -1 || p.closest(".dropdown-submenu") || p.classList.contains("dropright")) {
321
+ const O = window.innerWidth - v - p.offsetWidth, j = window.innerHeight - a, { position: H } = getComputedStyle(o);
322
+ if (H === "fixed") {
323
+ let E = v + p.offsetWidth;
324
+ o.offsetWidth > O && v > O && (E = v - w), o.style.left = E + "px", o.style.right = "auto", window.innerHeight - 2 * d < o.offsetHeight ? (o.style.top = d + "px", o.style.bottom = d + "px", o.style.maxHeight = window.innerHeight - 2 * d + "px", o.style.overflowY = "auto", o.className += " dropdown-menu-maxheight") : j < o.offsetHeight ? (o.style.top = "auto", o.style.bottom = d + "px") : (o.style.top = a + "px", o.style.bottom = "auto");
311
325
  } else {
312
- if (n.offsetWidth > O) {
313
- const $ = -w;
314
- n.style.left = $ + "px";
326
+ if (o.offsetWidth > O) {
327
+ const E = -w;
328
+ o.style.left = E + "px";
315
329
  }
316
- window.innerHeight - 2 * c < n.offsetHeight ? (n.style.top = -1 * (l - c) + "px", n.style.bottom = "auto", n.style.maxHeight = window.innerHeight - 2 * c + "px", n.style.overflowY = "auto", n.className += " dropdown-menu-maxheight") : j < n.offsetHeight && (n.style.top = j - n.offsetHeight - c + "px", n.style.bottom = "auto");
330
+ window.innerHeight - 2 * d < o.offsetHeight ? (o.style.top = -1 * (a - d) + "px", o.style.bottom = "auto", o.style.maxHeight = window.innerHeight - 2 * d + "px", o.style.overflowY = "auto", o.className += " dropdown-menu-maxheight") : j < o.offsetHeight && (o.style.top = j - o.offsetHeight - d + "px", o.style.bottom = "auto");
317
331
  }
318
332
  } else {
319
- const { marginTop: O, marginBottom: j } = getComputedStyle(n);
320
- let R = 0;
321
- const $ = Math.ceil(parseFloat(O)) + Math.ceil(parseFloat(j));
322
- let T = l + B, q = h;
323
- window.innerHeight - T - $ < k && (T = l - k, T < 0 && (window.innerHeight - l - B > l ? (T = l + B, R = window.innerHeight - T - $ - c) : (T = c, R = l - T - $))), window.innerWidth - h < w && window.innerWidth - h < h + v && (q = h - w + v), document.body.append(n), n.style.cssText = `position:fixed;bottom:unset;left:${q}px
324
- !important;top:${T}px !important;right: unset;${R ? "max-height:" + R + "px;overflow-y:auto;" : ""}`, R && (n.className += " dropdown-menu-maxheight"), n.style.zIndex = D().toString();
333
+ const { marginTop: O, marginBottom: j } = getComputedStyle(o);
334
+ let H = 0;
335
+ const E = Math.ceil(parseFloat(O)) + Math.ceil(parseFloat(j));
336
+ let R = a + B, q = v;
337
+ window.innerHeight - R - E < k && (R = a - k, R < 0 && (window.innerHeight - a - B > a ? (R = a + B, H = window.innerHeight - R - E - d) : (R = d, H = a - R - E))), window.innerWidth - v < w && window.innerWidth - v < v + h && (q = v - w + h), document.body.append(o), o.style.cssText = `position:fixed;bottom:unset;left:${q}px
338
+ !important;top:${R}px !important;right: unset;${H ? "max-height:" + H + "px;overflow-y:auto;" : ""}`, H && (o.className += " dropdown-menu-maxheight"), o.style.zIndex = D().toString();
325
339
  }
326
- }, u = () => {
327
- r(i.value, f.value);
340
+ }, f = () => {
341
+ r(i.value, c.value);
328
342
  }, s = () => {
329
- e.hover || (o.value = !1, document.removeEventListener("click", s), a.removeEventListener("click", s), document.removeEventListener("scroll", s), a.removeEventListener("scroll", s));
343
+ e.hover || (n.value = !1, document.removeEventListener("click", s), l.removeEventListener("click", s), document.removeEventListener("scroll", s), l.removeEventListener("scroll", s));
330
344
  };
331
345
  return {
332
- show: o,
346
+ show: n,
333
347
  dropdownRef: i,
334
- dropdownMenuRef: f,
335
- clickEventRef: m,
336
- showDropMenu: (d) => {
337
- e.hover || e.disabled || (d == null || d.stopPropagation(), o.value || setTimeout(() => {
338
- u();
339
- }), o.value = !o.value, document.addEventListener("click", s), document.addEventListener("scroll", s), e.hideOnClick || (a.addEventListener("click", (n) => {
340
- n.stopPropagation();
341
- }), a.addEventListener("scroll", (n) => {
342
- n.stopPropagation();
348
+ dropdownMenuRef: c,
349
+ clickEventRef: u,
350
+ showDropMenu: (p) => {
351
+ e.hover || e.disabled || (p == null || p.stopPropagation(), n.value || setTimeout(() => {
352
+ f();
353
+ }), n.value = !n.value, document.addEventListener("click", s), document.addEventListener("scroll", s), e.hideOnClick || (l.addEventListener("click", (o) => {
354
+ o.stopPropagation();
355
+ }), l.addEventListener("scroll", (o) => {
356
+ o.stopPropagation();
343
357
  })));
344
358
  },
345
- hoverDropdown: (d) => {
346
- e.hover && (o.value || setTimeout(() => {
347
- }), o.value = !o.value);
359
+ hoverDropdown: (p) => {
360
+ e.hover && (n.value || setTimeout(() => {
361
+ }), n.value = !n.value);
348
362
  },
349
363
  leftButtonClick: () => {
350
364
  },
351
365
  closeDropMenu: s,
352
- selectItem: (d) => {
353
- t.emit("select", d);
366
+ selectItem: (p) => {
367
+ t.emit("select", p);
354
368
  },
355
- resolveSize: (d) => {
356
- const n = /px|em|rem|pt|%/;
357
- return n.test(d) ? `${parseInt(d, 10)}${d.match(n)[0]}` : `${d}px`;
369
+ resolveSize: (p) => {
370
+ const o = /px|em|rem|pt|%/;
371
+ return o.test(p) ? `${parseInt(p, 10)}${p.match(o)[0]}` : `${p}px`;
358
372
  }
359
373
  };
360
374
  }
361
- const Se = {
375
+ const De = {
362
376
  /** 下拉框标签 */
363
377
  label: { type: String, default: "XM1" },
364
378
  /** 下拉框名称 */
@@ -369,44 +383,44 @@ const Se = {
369
383
  divide: { type: Boolean, default: !1 },
370
384
  onSelect: { type: Function, default: () => {
371
385
  } }
372
- }, U = /* @__PURE__ */ F({
386
+ }, x = /* @__PURE__ */ A({
373
387
  name: "FDropdownItem",
374
- props: Se,
388
+ props: De,
375
389
  emits: ["select"],
376
390
  setup(e, t) {
377
- const a = S(e.value), o = S(e.label), i = S(e.disabled), f = S(e.active), m = S(e.divide), c = () => {
391
+ const l = S(e.value), n = S(e.label), i = S(e.disabled), c = S(e.active), u = S(e.divide), d = () => {
378
392
  i.value || t.emit("select", e);
379
393
  };
380
394
  return () => y("div", null, [L(y("div", {
381
395
  class: "dropdown-divider"
382
- }, null), [[N, m.value]]), y("li", {
383
- class: `dropdown-item${f.value ? " active" : ""} ${i.value ? " disabled" : ""}`,
384
- onClick: c,
385
- title: a.value.toString()
386
- }, [o.value])]);
396
+ }, null), [[N, u.value]]), y("li", {
397
+ class: `dropdown-item${c.value ? " active" : ""} ${i.value ? " disabled" : ""}`,
398
+ onClick: d,
399
+ title: l.value.toString()
400
+ }, [n.value])]);
387
401
  }
388
- }), z = /* @__PURE__ */ F({
402
+ }), z = /* @__PURE__ */ A({
389
403
  name: "FDropdown",
390
- props: W,
404
+ props: M,
391
405
  emits: ["select"],
392
406
  setup(e, t) {
393
- const a = S(e.model), {
394
- show: o,
407
+ const l = S(e.model), {
408
+ show: n,
395
409
  dropdownMenuRef: i,
396
- dropdownRef: f,
397
- clickEventRef: m,
398
- showDropMenu: c,
410
+ dropdownRef: c,
411
+ clickEventRef: u,
412
+ showDropMenu: d,
399
413
  hoverDropdown: D,
400
414
  leftButtonClick: r,
401
- closeDropMenu: u,
415
+ closeDropMenu: f,
402
416
  selectItem: s,
403
- resolveSize: p
404
- } = Q(e, t);
417
+ resolveSize: m
418
+ } = U(e, t);
405
419
  function b(g) {
406
420
  t.emit("select", g);
407
421
  }
408
422
  return () => y("div", {
409
- ref: f
423
+ ref: c
410
424
  }, [y("div", {
411
425
  class: ["farris-dropdown", "btn-group", {
412
426
  dropup: e.position === "top"
@@ -438,7 +452,7 @@ const Se = {
438
452
  style: "width:100%",
439
453
  onClick: r
440
454
  }, [e.title]), y("span", {
441
- ref: m,
455
+ ref: u,
442
456
  class: ["dropdown-toggle", {
443
457
  btn: !e.nest
444
458
  }, {
@@ -467,43 +481,43 @@ const Se = {
467
481
  disabled: e.disabled
468
482
  }],
469
483
  style: "width:100%",
470
- onClick: c,
484
+ onClick: d,
471
485
  onMouseenter: D,
472
486
  onMouseleave: D
473
487
  }, [L(y("span", {
474
488
  class: "sr-only"
475
489
  }, null), [[N, e.splitButton]]), e.splitButton ? "" : e.title, L(y("span", {
476
490
  class: `f-icon ${e.iconClass.toString()}`
477
- }, null), [[N, e.iconClass]])]), y(x, {
491
+ }, null), [[N, e.iconClass]])]), y(C, {
478
492
  to: "body"
479
493
  }, {
480
494
  default: () => [y("div", {
481
495
  ref: i,
482
- class: `dropdown-menu${o.value ? " show" : ""}`
483
- }, [y(Y, null, [a.value.map(({
496
+ class: `dropdown-menu${n.value ? " show" : ""}`
497
+ }, [y(Y, null, [l.value.map(({
484
498
  label: g,
485
- value: E,
486
- disabled: H,
487
- active: d,
488
- divide: n
489
- }) => y(U, {
490
- value: E.toString(),
499
+ value: $,
500
+ disabled: T,
501
+ active: p,
502
+ divide: o
503
+ }) => y(x, {
504
+ value: $.toString(),
491
505
  label: g,
492
- disabled: H,
493
- active: d,
494
- divide: n,
506
+ disabled: T,
507
+ active: p,
508
+ divide: o,
495
509
  onSelect: (B) => b(B)
496
510
  }, null))])])]
497
511
  })])]);
498
512
  }
499
513
  });
500
- function De(e, t, a) {
501
- var h;
502
- const o = "", i = "", f = S();
503
- function m() {
514
+ function Be(e, t, l) {
515
+ var v;
516
+ const n = "", i = "", c = S();
517
+ function u() {
504
518
  return (t == null ? void 0 : t.schema.componentType) !== "frame";
505
519
  }
506
- function c() {
520
+ function d() {
507
521
  return !1;
508
522
  }
509
523
  function D() {
@@ -512,91 +526,91 @@ function De(e, t, a) {
512
526
  function r() {
513
527
  return (t == null ? void 0 : t.schema.componentType) === "frame";
514
528
  }
515
- function u(l) {
516
- if (!l || !l.value)
529
+ function f(a) {
530
+ if (!a || !a.value)
517
531
  return null;
518
- if (l.value.schema && l.value.schema.type === "component")
519
- return l.value;
520
- const v = S(l == null ? void 0 : l.value.parent), w = u(v);
532
+ if (a.value.schema && a.value.schema.type === "component")
533
+ return a.value;
534
+ const h = S(a == null ? void 0 : a.value.parent), w = f(h);
521
535
  return w || null;
522
536
  }
523
- function s(l = t) {
524
- const { componentInstance: v, designerItemElementRef: w } = l;
525
- return !v || !v.value ? null : v.value.canMove ? w : s(l.parent);
537
+ function s(a = t) {
538
+ const { componentInstance: h, designerItemElementRef: w } = a;
539
+ return !h || !h.value ? null : h.value.canMove ? w : s(a.parent);
526
540
  }
527
- function p(l) {
528
- return !!a;
541
+ function m(a) {
542
+ return !!l;
529
543
  }
530
544
  function b() {
531
545
  return (t == null ? void 0 : t.schema.label) || (t == null ? void 0 : t.schema.title) || (t == null ? void 0 : t.schema.name);
532
546
  }
533
547
  function g() {
534
548
  }
535
- function E(l, v) {
549
+ function $(a, h) {
536
550
  }
537
- function H(l, v) {
538
- const { componentType: w } = l;
539
- let k = J(w, l, v);
540
- const A = w.toLowerCase().replace(/-/g, "_");
541
- return k && !k.id && k.type === w && (k.id = `${A}_${Math.random().toString().slice(2, 6)}`), k;
551
+ function T(a, h) {
552
+ const { componentType: w } = a;
553
+ let k = Q(w, a, h);
554
+ const W = w.toLowerCase().replace(/-/g, "_");
555
+ return k && !k.id && k.type === w && (k.id = `${W}_${Math.random().toString().slice(2, 6)}`), k;
542
556
  }
543
- function d(l) {
557
+ function p(a) {
544
558
  }
545
- function n(...l) {
559
+ function o(...a) {
546
560
  }
547
561
  function B() {
548
- t != null && t.schema.contents && t.schema.contents.map((l) => {
562
+ t != null && t.schema.contents && t.schema.contents.map((a) => {
549
563
  var k;
550
- let v = l.id;
551
- l.type === "component-ref" && (v = l.component);
552
- const w = e.value.querySelector(`#${v}-design-item`);
564
+ let h = a.id;
565
+ a.type === "component-ref" && (h = a.component);
566
+ const w = e.value.querySelector(`#${h}-design-item`);
553
567
  (k = w == null ? void 0 : w.componentInstance) != null && k.value.onRemoveComponent && w.componentInstance.value.onRemoveComponent();
554
568
  });
555
569
  }
556
- return f.value = {
557
- canMove: m(),
558
- canSelectParent: c(),
570
+ return c.value = {
571
+ canMove: u(),
572
+ canSelectParent: d(),
559
573
  canDelete: D(),
560
574
  canNested: !r(),
561
575
  contents: t == null ? void 0 : t.schema.contents,
562
576
  elementRef: e,
563
- parent: (h = t == null ? void 0 : t.parent) == null ? void 0 : h.componentInstance,
577
+ parent: (v = t == null ? void 0 : t.parent) == null ? void 0 : v.componentInstance,
564
578
  schema: t == null ? void 0 : t.schema,
565
- styles: o,
579
+ styles: n,
566
580
  designerClass: i,
567
- canAccepts: p,
568
- getBelongedComponentInstance: u,
581
+ canAccepts: m,
582
+ getBelongedComponentInstance: f,
569
583
  getDraggableDesignItemElement: s,
570
584
  getDraggingDisplayText: b,
571
- getPropConfig: n,
585
+ getPropConfig: o,
572
586
  getDragScopeElement: g,
573
- onAcceptMovedChildElement: E,
574
- onChildElementMovedOut: d,
575
- addNewChildComponentSchema: H,
587
+ onAcceptMovedChildElement: $,
588
+ onChildElementMovedOut: p,
589
+ addNewChildComponentSchema: T,
576
590
  triggerBelongedComponentToMoveWhenMoved: S(!1),
577
591
  triggerBelongedComponentToDeleteWhenDeleted: S(!1),
578
592
  onRemoveComponent: B
579
- }, f;
593
+ }, c;
580
594
  }
581
- const Be = /* @__PURE__ */ F({
595
+ const ke = /* @__PURE__ */ A({
582
596
  name: "FDropdownDesign",
583
- props: W,
597
+ props: M,
584
598
  emits: ["select"],
585
599
  setup(e, t) {
586
- const a = S(e.model), {
587
- show: o,
600
+ const l = S(e.model), {
601
+ show: n,
588
602
  showDropMenu: i,
589
- hoverDropdown: f,
590
- leftButtonClick: m,
591
- closeDropMenu: c,
603
+ hoverDropdown: c,
604
+ leftButtonClick: u,
605
+ closeDropMenu: d,
592
606
  selectItem: D,
593
607
  resolveSize: r
594
- } = Q(e, t);
595
- function u(g) {
608
+ } = U(e, t);
609
+ function f(g) {
596
610
  t.emit("select", g);
597
611
  }
598
- const s = S(), p = C("design-item-context"), b = De(s, p);
599
- return _(() => {
612
+ const s = S(), m = P("design-item-context"), b = Be(s, m);
613
+ return X(() => {
600
614
  s.value.componentInstance = b;
601
615
  }), t.expose(b.value), () => y("div", {
602
616
  ref: s
@@ -632,7 +646,7 @@ const Be = /* @__PURE__ */ F({
632
646
  "btn-info": e.type === "info"
633
647
  }],
634
648
  style: "width:100%",
635
- onClick: m
649
+ onClick: u
636
650
  }, [e.title]), y("span", {
637
651
  class: ["dropdown-toggle", {
638
652
  btn: !e.nest
@@ -663,43 +677,43 @@ const Be = /* @__PURE__ */ F({
663
677
  }],
664
678
  style: "width:100%",
665
679
  onClick: i,
666
- onMouseenter: f,
667
- onMouseleave: f
680
+ onMouseenter: c,
681
+ onMouseleave: c
668
682
  }, [L(y("span", {
669
683
  class: "sr-only"
670
684
  }, null), [[N, e.splitButton]]), e.splitButton ? "" : e.title, L(y("span", {
671
685
  class: `f-icon ${e.iconClass.toString()}`
672
686
  }, null), [[N, e.iconClass]])]), y("div", {
673
- class: `dropdown-menu${o.value ? " show" : ""}`
674
- }, [y(Y, null, [a.value.map(({
687
+ class: `dropdown-menu${n.value ? " show" : ""}`
688
+ }, [y(Y, null, [l.value.map(({
675
689
  label: g,
676
- value: E,
677
- disabled: H,
678
- active: d,
679
- divide: n
680
- }) => y(U, {
681
- value: E.toString(),
690
+ value: $,
691
+ disabled: T,
692
+ active: p,
693
+ divide: o
694
+ }) => y(x, {
695
+ value: $.toString(),
682
696
  label: g,
683
- disabled: H,
684
- active: d,
685
- divide: n,
686
- onSelect: (B) => u(B)
697
+ disabled: T,
698
+ active: p,
699
+ divide: o,
700
+ onSelect: (B) => f(B)
687
701
  }, null))])])])]);
688
702
  }
689
703
  }), Te = {
690
704
  install(e) {
691
705
  e.component(z.name, z);
692
706
  },
693
- register(e, t, a, o) {
694
- e.dropdown = z, t.dropdown = X;
707
+ register(e, t, l, n) {
708
+ e.dropdown = z, t.dropdown = _;
695
709
  },
696
- registerDesigner(e, t, a) {
697
- e.dropdown = Be, t.dropdown = X;
710
+ registerDesigner(e, t, l) {
711
+ e.dropdown = ke, t.dropdown = _;
698
712
  }
699
713
  };
700
714
  export {
701
715
  z as Dropdown,
702
716
  Te as default,
703
- W as dropdownProps,
704
- X as propsResolver
717
+ M as dropdownProps,
718
+ _ as propsResolver
705
719
  };