@farris/ui-vue 1.8.3 → 1.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/components/batch-editor/index.esm.js +7332 -7299
  2. package/components/batch-editor/index.umd.cjs +22 -22
  3. package/components/button/index.esm.js +7334 -7301
  4. package/components/button/index.umd.cjs +22 -22
  5. package/components/component/index.esm.js +880 -874
  6. package/components/component/index.umd.cjs +2 -2
  7. package/components/data-grid/index.esm.js +841 -835
  8. package/components/data-grid/index.umd.cjs +2 -2
  9. package/components/data-view/index.esm.js +14551 -14472
  10. package/components/data-view/index.umd.cjs +27 -27
  11. package/components/designer-canvas/index.esm.js +820 -814
  12. package/components/designer-canvas/index.umd.cjs +1 -1
  13. package/components/mapping-editor/index.esm.js +848 -842
  14. package/components/mapping-editor/index.umd.cjs +2 -2
  15. package/components/popover/index.esm.js +264 -243
  16. package/components/popover/index.umd.cjs +1 -1
  17. package/components/tree-grid/index.esm.js +315 -309
  18. package/components/tree-grid/index.umd.cjs +1 -1
  19. package/designer/data-grid/index.esm.js +8304 -8257
  20. package/designer/data-grid/index.umd.cjs +26 -26
  21. package/designer/farris-designer.all.esm.js +3235 -3223
  22. package/designer/farris-designer.all.umd.cjs +14 -14
  23. package/designer/radio-group/index.esm.js +80 -62
  24. package/designer/radio-group/index.umd.cjs +2 -2
  25. package/designer/tabs/index.esm.js +830 -824
  26. package/designer/tabs/index.umd.cjs +2 -2
  27. package/designer/tree-grid/index.esm.js +348 -342
  28. package/designer/tree-grid/index.umd.cjs +1 -1
  29. package/farris.all.esm.js +18917 -18820
  30. package/farris.all.umd.cjs +39 -39
  31. package/package.json +1 -1
  32. package/types/data-view/components/column-header/column-header.component.d.ts +2 -2
  33. package/types/data-view/composition/column/persist-column-widths.d.ts +15 -0
  34. package/types/data-view/composition/column/use-resize.d.ts +3 -2
  35. package/types/data-view/index.d.ts +1 -0
  36. package/types/popover/src/composition/measure-host.d.ts +10 -5
  37. package/types/popover/src/composition/types.d.ts +2 -2
  38. package/types/popover/src/composition/use-host.d.ts +1 -2
  39. package/types/radio-group/src/property-config/radio-group.property-config.d.ts +21 -0
  40. package/package.zip +0 -0
@@ -1,6 +1,6 @@
1
- import { ref as m, isRef as rt, computed as x, watch as ct, nextTick as ft, defineComponent as pt, onMounted as dt, onUnmounted as vt, createVNode as V, Teleport as ht, withDirectives as mt, vShow as wt } from "vue";
2
- import { getMaxZIndex as gt, useDelayedRef as yt } from "../common/index.esm.js";
3
- const Lt = {
1
+ import { ref as y, isRef as ft, computed as x, watch as dt, nextTick as pt, defineComponent as vt, onMounted as ht, onUnmounted as mt, createVNode as V, Teleport as gt, withDirectives as wt, vShow as yt } from "vue";
2
+ import { getMaxZIndex as Lt, useDelayedRef as Pt } from "../common/index.esm.js";
3
+ const bt = {
4
4
  /**
5
5
  * 组件标识
6
6
  */
@@ -49,8 +49,8 @@ const Lt = {
49
49
  * @default -1
50
50
  */
51
51
  minWidth: { type: Number, default: -1 },
52
- offsetX: { type: Object, default: m(0) },
53
- offsetY: { type: Object, default: m(0) },
52
+ offsetX: { type: Object, default: y(0) },
53
+ offsetY: { type: Object, default: y(0) },
54
54
  /**
55
55
  * 可选,气泡显示的位置
56
56
  * @default 'bottom'
@@ -93,316 +93,337 @@ const Lt = {
93
93
  limitContentBySpace: { type: Boolean, default: !1 },
94
94
  beforeClose: { type: Function }
95
95
  };
96
- function Pt(t) {
97
- const n = rt(t) ? t.value : t;
98
- return typeof n == "string" ? n === "body" || typeof document > "u" ? "body" : document.querySelector(n) || "body" : !!n && typeof n.getBoundingClientRect == "function" && typeof n.insertBefore == "function" ? n : "body";
99
- }
100
96
  function Tt(t) {
97
+ const e = ft(t) ? t.value : t;
98
+ return typeof e == "string" ? e === "body" || typeof document > "u" ? "body" : document.querySelector(e) || "body" : !!e && typeof e.getBoundingClientRect == "function" && typeof e.insertBefore == "function" ? e : "body";
99
+ }
100
+ function Q(t) {
101
101
  return typeof document > "u" ? null : t === "body" ? document.body : t;
102
102
  }
103
- function A(t, n) {
104
- const s = Tt(t);
105
- if (!s) {
106
- const g = typeof window < "u" ? window.innerHeight : 0;
107
- return {
108
- left: 0,
109
- top: 0,
110
- width: 0,
111
- height: g,
112
- bottom: g,
113
- scrollLeft: 0,
114
- scrollTop: 0
115
- };
116
- }
117
- const i = s.getBoundingClientRect(), p = t === "body" || s === document.body, w = typeof window < "u" ? window.innerHeight : i.height;
118
- let { width: d } = i;
119
- !p && n && (d -= n.getBoundingClientRect().width);
120
- const { top: h } = i;
121
- let { bottom: C, height: b } = i;
122
- if (p) {
123
- const g = Math.max(i.top, 0), y = Math.min(i.bottom, w);
124
- C = y, b = Math.max(y - g, 0) || w;
103
+ function $() {
104
+ const t = typeof window < "u" ? window.innerHeight : 0;
105
+ return {
106
+ left: 0,
107
+ top: 0,
108
+ width: typeof window < "u" ? window.innerWidth : 0,
109
+ height: t,
110
+ bottom: t,
111
+ scrollLeft: 0,
112
+ scrollTop: 0
113
+ };
114
+ }
115
+ function A(t, e) {
116
+ const s = Q(t);
117
+ if (!s)
118
+ return $();
119
+ const i = s.getBoundingClientRect(), l = t === "body" || s === document.body, g = typeof window < "u" ? window.innerHeight : i.height;
120
+ let { width: v } = i;
121
+ !l && e && (v -= e.getBoundingClientRect().width);
122
+ const { top: d } = i;
123
+ let { bottom: B, height: w } = i;
124
+ if (l) {
125
+ const L = Math.max(i.top, 0), h = Math.min(i.bottom, g);
126
+ B = h, w = Math.max(h - L, 0) || g;
125
127
  }
126
128
  return {
127
129
  left: i.left,
128
- top: h,
129
- width: d,
130
- height: b,
131
- bottom: C,
130
+ top: d,
131
+ width: v,
132
+ height: w,
133
+ bottom: B,
132
134
  scrollLeft: s.scrollLeft || 0,
133
135
  scrollTop: s.scrollTop || 0
134
136
  };
135
137
  }
136
- function bt(t) {
137
- const n = Pt(t.host), s = x(() => A(n, t.rightBoundary).top), i = x(() => A(n, t.rightBoundary).left), p = x(() => A(n, t.rightBoundary).bottom), w = x(() => A(n, t.rightBoundary).width), d = x(() => A(n, t.rightBoundary).height);
138
+ function Bt(t, e, s) {
139
+ const i = A(e, s);
140
+ if (!t || !t.isConnected)
141
+ return i;
142
+ const l = t.style, g = l.left, v = l.top, d = l.right, B = l.bottom;
143
+ l.left = "0px", l.top = "0px", l.right = "auto", l.bottom = "auto";
144
+ const w = t.getBoundingClientRect();
145
+ l.left = g, l.top = v, l.right = d, l.bottom = B;
146
+ const L = e === "body" || Q(e) === document.body, h = L ? $() : i;
147
+ return {
148
+ left: w.left,
149
+ top: w.top,
150
+ width: h.width,
151
+ height: h.height,
152
+ bottom: L ? h.bottom : w.top + h.height,
153
+ scrollLeft: 0,
154
+ scrollTop: 0
155
+ };
156
+ }
157
+ function xt(t) {
158
+ const e = Tt(t.host), s = x(() => A(e, t.rightBoundary).top), i = x(() => A(e, t.rightBoundary).left), l = x(() => A(e, t.rightBoundary).bottom), g = x(() => A(e, t.rightBoundary).width), v = x(() => A(e, t.rightBoundary).height);
138
159
  return {
139
- host: n,
160
+ host: e,
140
161
  hostLeft: i,
141
162
  hostTop: s,
142
- hostWidth: w,
143
- hostHeight: d,
144
- hostBottom: p,
145
- measure: () => A(n, t.rightBoundary)
163
+ hostWidth: g,
164
+ hostHeight: v,
165
+ hostBottom: l,
166
+ measure: (d) => Bt(d, e, t.rightBoundary)
146
167
  };
147
168
  }
148
- function xt(t, n, s, i) {
149
- const p = m(t.offsetX || 0), w = m(t.offsetY || 0), d = m(-1), h = m(-1), C = m(-1), b = m(-1), g = m(t.placement), y = m(0), v = m(0), O = m(0);
150
- let B = i.measure();
151
- ct(() => t.offsetX, (o) => {
152
- p.value = o;
169
+ function Ct(t, e, s, i) {
170
+ const l = y(t.offsetX || 0), g = y(t.offsetY || 0), v = y(-1), d = y(-1), B = y(-1), w = y(-1), L = y(t.placement), h = y(0), m = y(0), W = y(0);
171
+ let C = i.measure();
172
+ dt(() => t.offsetX, (o) => {
173
+ l.value = o;
153
174
  });
154
- const c = x(() => {
175
+ const f = x(() => {
155
176
  const o = {
156
- left: `${v.value}px`,
157
- top: `${O.value}px`,
158
- transform: `translate(${p.value}px, ${w.value}px)`
177
+ left: `${m.value}px`,
178
+ top: `${W.value}px`,
179
+ transform: `translate(${l.value}px, ${g.value}px)`
159
180
  };
160
- return t.zIndex !== -1 && (o["z-index"] = t.zIndex), t.fitContent ? t.keepWidthWithReference && s.value && d.value >= s.value.getBoundingClientRect().width && (o.width = `${d.value}px`) : d.value !== -1 && (o.width = `${d.value}px`), t.minWidth !== -1 && (o.minWidth = `${t.minWidth}px`), t.customStyles && Object.assign(o, t.customStyles), h.value > 0 && (o.maxHeight = h.value + "px"), o;
161
- }), W = x(() => ({
162
- left: `${y.value}px`,
181
+ return t.zIndex !== -1 && (o["z-index"] = t.zIndex), t.fitContent ? t.keepWidthWithReference && s.value && v.value >= s.value.getBoundingClientRect().width && (o.width = `${v.value}px`) : v.value !== -1 && (o.width = `${v.value}px`), t.minWidth !== -1 && (o.minWidth = `${t.minWidth}px`), t.customStyles && Object.assign(o, t.customStyles), d.value > 0 && (o.maxHeight = d.value + "px"), o;
182
+ }), O = x(() => ({
183
+ left: `${h.value}px`,
163
184
  transform: `translateX(${t.arrowOffsetX}px)`
164
185
  }));
165
- function L() {
166
- return B.left;
167
- }
168
186
  function P() {
169
- return B.top;
187
+ return C.left;
188
+ }
189
+ function b() {
190
+ return C.top;
170
191
  }
171
- function E() {
172
- return B.width;
192
+ function I() {
193
+ return C.width;
173
194
  }
174
195
  function X() {
175
- return B.height;
196
+ return C.height;
176
197
  }
177
- function I() {
178
- return B.bottom;
198
+ function j() {
199
+ return C.bottom;
179
200
  }
180
201
  function H() {
181
- return B.scrollLeft;
202
+ return C.scrollLeft;
182
203
  }
183
204
  function a() {
184
- return B.scrollTop;
205
+ return C.scrollTop;
185
206
  }
186
207
  function S(o) {
187
208
  if (o && t.keepWidthWithReference) {
188
- const e = o.getBoundingClientRect();
189
- d.value = Math.max(t.minWidth, e.width);
209
+ const n = o.getBoundingClientRect();
210
+ v.value = Math.max(t.minWidth, n.width);
190
211
  }
191
212
  }
192
- function D(o, e) {
193
- const l = E() - o.width - 4;
194
- return l > 0 ? l : e;
213
+ function D(o, n) {
214
+ const u = I() - o.width - 4;
215
+ return u > 0 ? u : n;
195
216
  }
196
- function j(o, e) {
197
- const l = X() - o.height - 12;
198
- return l > 0 ? l : e;
217
+ function z(o, n) {
218
+ const u = X() - o.height - 12;
219
+ return u > 0 ? u : n;
199
220
  }
200
- function F(o, e, l) {
201
- const f = y.value, r = e.left - L() + e.width / 2 + H(), u = e.top - P() - (o.height + l.height) + a();
202
- return { popoverLeft: r, popoverTop: u, arrowLeft: f };
221
+ function F(o, n, u) {
222
+ const p = h.value, c = n.left - P() + n.width / 2 + H(), r = n.top - b() - (o.height + u.height) + a();
223
+ return { popoverLeft: c, popoverTop: r, arrowLeft: p };
203
224
  }
204
- function N(o, e, l) {
205
- const f = e.top - P() + (e.height + l.height) + a(), r = j(o, f);
206
- return Math.min(f, r);
225
+ function N(o, n, u) {
226
+ const p = n.top - b() + (n.height + u.height) + a(), c = z(o, p);
227
+ return Math.min(p, c);
207
228
  }
208
- function Y(o, e) {
209
- const l = D(e, o), f = o <= l ? y.value : o - l;
210
- return { popoverLeft: Math.min(o, l), arrowLeft: f, maxHeight: 0 };
229
+ function Y(o, n) {
230
+ const u = D(n, o), p = o <= u ? h.value : o - u;
231
+ return { popoverLeft: Math.min(o, u), arrowLeft: p, maxHeight: 0 };
211
232
  }
212
- function $(o, e) {
213
- const l = o <= D(e, o) ? y.value : o - D(e, o);
214
- return { popoverLeft: o, arrowLeft: l, maxHeight: 0 };
233
+ function ot(o, n) {
234
+ const u = o <= D(n, o) ? h.value : o - D(n, o);
235
+ return { popoverLeft: o, arrowLeft: u, maxHeight: 0 };
215
236
  }
216
- function tt(o, e, l) {
217
- const f = e.left - L() + H(), { arrowLeft: r, popoverLeft: u } = $(f, o), { popoverTop: T } = F(o, e, l);
218
- return { popoverLeft: u, popoverTop: T, arrowLeft: r, maxHeight: 0 };
237
+ function et(o, n, u) {
238
+ const p = n.left - P() + H(), { arrowLeft: c, popoverLeft: r } = ot(p, o), { popoverTop: T } = F(o, n, u);
239
+ return { popoverLeft: r, popoverTop: T, arrowLeft: c, maxHeight: 0 };
219
240
  }
220
- function ot(o, e, l) {
221
- const f = e.left - L() + e.width / 2 - (l.width / 2 - (o.left - L())) + H(), { arrowLeft: r, popoverLeft: u } = Y(f, o), T = N(o, e, l);
222
- return { popoverLeft: u, popoverTop: T, arrowLeft: r, maxHeight: 0 };
241
+ function nt(o, n, u) {
242
+ const p = n.left - P() + n.width / 2 - (u.width / 2 - (o.left - P())) + H(), { arrowLeft: c, popoverLeft: r } = Y(p, o), T = N(o, n, u);
243
+ return { popoverLeft: r, popoverTop: T, arrowLeft: c, maxHeight: 0 };
223
244
  }
224
- function et(o, e, l) {
225
- const f = e.left - L() + H(), { arrowLeft: r, popoverLeft: u } = Y(f, o), T = N(o, e, l);
226
- return { popoverLeft: u, popoverTop: T, arrowLeft: r, maxHeight: 0 };
245
+ function it(o, n, u) {
246
+ const p = n.left - P() + H(), { arrowLeft: c, popoverLeft: r } = Y(p, o), T = N(o, n, u);
247
+ return { popoverLeft: r, popoverTop: T, arrowLeft: c, maxHeight: 0 };
227
248
  }
228
- function nt(o, e, l) {
229
- const f = e.left - L();
230
- let r = 0, u = 0, T = 0, M = 0, k = "bottom-left";
231
- window.innerWidth - f > o.width ? r = f + H() : (r = e.right - o.width - L() + H(), T = o.width - l.width - 20);
232
- let z = 0;
249
+ function st(o, n, u) {
250
+ const p = n.left - P();
251
+ let c = 0, r = 0, T = 0, M = 0, k = "bottom-left";
252
+ window.innerWidth - p > o.width ? c = p + H() : (c = n.right - o.width - P() + H(), T = o.width - u.width - 20);
253
+ let E = 0;
233
254
  if (t.limitContentBySpace) {
234
- const J = {
235
- topHeight: e.top - P() - l.height - 8,
236
- bottomHeight: I() - e.bottom - l.height - 8
255
+ const G = {
256
+ topHeight: n.top - b() - u.height - 8,
257
+ bottomHeight: j() - n.bottom - u.height - 8
237
258
  };
238
- z = Math.max(J.topHeight, J.bottomHeight), o.height > z && (M = z, s.value.classList.add("popover-limitmax"));
259
+ E = Math.max(G.topHeight, G.bottomHeight), o.height > E && (M = E, s.value.classList.add("popover-limitmax"));
239
260
  }
240
- const K = M ? Math.floor(M) : o.height, q = e.top - P() + (e.height + l.height);
241
- return I() - q > K ? u = q + a() : (u = e.top - P() - K - l.height + a(), I() - q > e.top - P() ? (u = q + a(), K > e.top - P() && (u = I() - P() - K + a())) : (u = u < 0 ? 0 : u, k = "top")), s.value.classList.add("popover-" + k, "bs-popover-" + k), { popoverLeft: r < 0 ? 5 : r, popoverTop: u, arrowLeft: T, maxHeight: M };
261
+ const K = M ? Math.floor(M) : o.height, R = n.top - b() + (n.height + u.height);
262
+ return j() - R > K ? r = R + a() : (r = n.top - b() - K - u.height + a(), j() - R > n.top - b() ? (r = R + a(), K > n.top - b() && (r = j() - b() - K + a())) : (r = r < 0 ? 0 : r, k = "top")), s.value.classList.add("popover-" + k, "bs-popover-" + k), { popoverLeft: c < 0 ? 5 : c, popoverTop: r, arrowLeft: T, maxHeight: M };
242
263
  }
243
- function it(o, e, l) {
244
- const f = e.left - L() + e.width + H(), r = Math.max(
245
- e.top - P() - (o.height / 2 - e.height / 2) + a(),
264
+ function lt(o, n, u) {
265
+ const p = n.left - P() + n.width + H(), c = Math.max(
266
+ n.top - b() - (o.height / 2 - n.height / 2) + a(),
246
267
  a()
247
268
  );
248
- let u = X() - o.height + a();
249
- u < 0 && (u = r);
250
- const T = Math.min(r, u);
251
- return { popoverLeft: f, popoverTop: T, arrowLeft: 0, maxHeight: 0 };
269
+ let r = X() - o.height + a();
270
+ r < 0 && (r = c);
271
+ const T = Math.min(c, r);
272
+ return { popoverLeft: p, popoverTop: T, arrowLeft: 0, maxHeight: 0 };
252
273
  }
253
- function st(o, e, l) {
254
- const f = e.left - L() + e.width + H(), r = Math.max(
255
- e.top - P() - e.height + a(),
274
+ function ut(o, n, u) {
275
+ const p = n.left - P() + n.width + H(), c = Math.max(
276
+ n.top - b() - n.height + a(),
256
277
  a()
257
278
  );
258
- let u = X() - o.height + a();
259
- u < 0 && (u = r);
260
- const T = Math.min(r, u);
261
- return { popoverLeft: f, popoverTop: T, arrowLeft: 0, maxHeight: 0 };
279
+ let r = X() - o.height + a();
280
+ r < 0 && (r = c);
281
+ const T = Math.min(c, r);
282
+ return { popoverLeft: p, popoverTop: T, arrowLeft: 0, maxHeight: 0 };
262
283
  }
263
- const lt = /* @__PURE__ */ new Map([
284
+ const at = /* @__PURE__ */ new Map([
264
285
  ["top", F],
265
- ["top-left", tt],
266
- ["bottom", ot],
267
- ["bottom-left", et],
268
- ["right", it],
269
- ["right-top", st],
270
- ["auto", nt]
286
+ ["top-left", et],
287
+ ["bottom", nt],
288
+ ["bottom-left", it],
289
+ ["right", lt],
290
+ ["right-top", ut],
291
+ ["auto", st]
271
292
  ]);
272
- function G(o) {
273
- var u;
274
- B = i.measure(), t.keepWidthWithReference && S(o);
275
- const e = o.getBoundingClientRect();
276
- C.value = e.top, b.value = e.left;
277
- const l = n.value ? n.value.getBoundingClientRect() : { height: 4, width: 4 }, f = (u = s.value) == null ? void 0 : u.getBoundingClientRect();
278
- d.value = f.width;
279
- const r = lt.get(g.value);
280
- if (r) {
281
- const { arrowLeft: T, popoverLeft: M, popoverTop: k, maxHeight: z } = r(f, e, l);
282
- y.value = T, v.value = M, O.value = k, h.value = z || -1;
293
+ function _(o) {
294
+ var r;
295
+ C = i.measure(s.value), t.keepWidthWithReference && S(o);
296
+ const n = o.getBoundingClientRect();
297
+ B.value = n.top, w.value = n.left;
298
+ const u = e.value ? e.value.getBoundingClientRect() : { height: 4, width: 4 }, p = (r = s.value) == null ? void 0 : r.getBoundingClientRect();
299
+ v.value = p.width;
300
+ const c = at.get(L.value);
301
+ if (c) {
302
+ const { arrowLeft: T, popoverLeft: M, popoverTop: k, maxHeight: E } = c(p, n, u);
303
+ h.value = T, m.value = M, W.value = k, d.value = E || -1;
283
304
  }
284
305
  }
285
- function at(o) {
306
+ function rt(o) {
286
307
  if (o) {
287
- const e = o.getBoundingClientRect();
288
- (e.left !== b.value || e.top !== C.value) && G(o);
308
+ const n = o.getBoundingClientRect();
309
+ (n.left !== w.value || n.top !== B.value) && _(o);
289
310
  }
290
311
  }
291
- function ut() {
292
- g.value = t.placement, y.value = 0, v.value = 0, O.value = 0, d.value = -1;
312
+ function ct() {
313
+ L.value = t.placement, h.value = 0, m.value = 0, W.value = 0, v.value = -1;
293
314
  }
294
315
  return {
295
- arrowStyle: W,
296
- popoverStyle: c,
297
- position: g,
298
- popoverWidth: d,
316
+ arrowStyle: O,
317
+ popoverStyle: f,
318
+ position: L,
319
+ popoverWidth: v,
299
320
  fitToReference: S,
300
- followToReferencePosition: at,
301
- locateToReference: G,
302
- resetPosition: ut
321
+ followToReferencePosition: rt,
322
+ locateToReference: _,
323
+ resetPosition: ct
303
324
  };
304
325
  }
305
- function Bt(t, n, s, i, p, w, d) {
306
- const h = m(t.visible), C = x(() => h.value), { fitToReference: b, locateToReference: g, resetPosition: y } = d;
307
- let v;
308
- async function O() {
309
- h.value && (t.beforeClose && typeof t.beforeClose == "function" && !await t.beforeClose() || (h.value = !1, document.body.removeEventListener("click", v), document.body.removeEventListener("mousedown", v), document.body.removeEventListener("wheel", v, !0), document.removeEventListener("scroll", v), y(), n.emit("hidden")));
326
+ function Ht(t, e, s, i, l, g, v) {
327
+ const d = y(t.visible), B = x(() => d.value), { fitToReference: w, locateToReference: L, resetPosition: h } = v;
328
+ let m;
329
+ async function W() {
330
+ d.value && (t.beforeClose && typeof t.beforeClose == "function" && !await t.beforeClose() || (d.value = !1, document.body.removeEventListener("click", m), document.body.removeEventListener("mousedown", m), document.body.removeEventListener("wheel", m, !0), document.removeEventListener("scroll", m), h(), e.emit("hidden")));
310
331
  }
311
- v = (c) => {
312
- var P;
313
- if (!p.value)
332
+ m = (f) => {
333
+ var b;
334
+ if (!l.value)
314
335
  return;
315
- const W = p.value.contains(c.target);
316
- if (c.type === "scroll" || c.type === "wheel" && W) {
317
- O();
336
+ const O = l.value.contains(f.target);
337
+ if (f.type === "scroll" || f.type === "wheel" && O) {
338
+ W();
318
339
  return;
319
340
  }
320
- if (c.target.closest(".time-picker-panel") || c.target.closest(".fv-grid"))
341
+ if (f.target.closest(".time-picker-panel") || f.target.closest(".fv-grid"))
321
342
  return;
322
- const L = (P = c.target) == null ? void 0 : P.closest(".popover");
323
- if (L && i.value && L === i.value) {
324
- c.type !== "scroll" && c.type !== "wheel" && c.stopPropagation();
343
+ const P = (b = f.target) == null ? void 0 : b.closest(".popover");
344
+ if (P && i.value && P === i.value) {
345
+ f.type !== "scroll" && f.type !== "wheel" && f.stopPropagation();
325
346
  return;
326
347
  }
327
- if (!W && h.value) {
328
- const E = p.value.closest(".popover");
329
- E && E.removeEventListener("click", v), O();
348
+ if (!O && d.value) {
349
+ const I = l.value.closest(".popover");
350
+ I && I.removeEventListener("click", m), W();
330
351
  }
331
352
  };
332
- async function B(c) {
333
- if (i.value && (t.showArrow === !1 || t.showArrow && s.value) && c) {
334
- h.value = !0, p.value = c, w.value && b(c), await ft(), g(c), document.body.addEventListener("click", v), document.body.addEventListener("mousedown", v), document.body.addEventListener("wheel", v, !0), document.addEventListener("scroll", v), (top == null ? void 0 : top.document) !== document && (top == null || top.document.addEventListener("mousedown", v));
335
- const W = c.closest(".popover");
336
- W && W.addEventListener("click", v), n.emit("shown");
353
+ async function C(f) {
354
+ if (i.value && (t.showArrow === !1 || t.showArrow && s.value) && f) {
355
+ d.value = !0, l.value = f, g.value && w(f), await pt(), L(f), document.body.addEventListener("click", m), document.body.addEventListener("mousedown", m), document.body.addEventListener("wheel", m, !0), document.addEventListener("scroll", m), (top == null ? void 0 : top.document) !== document && (top == null || top.document.addEventListener("mousedown", m));
356
+ const O = f.closest(".popover");
357
+ O && O.addEventListener("click", m), e.emit("shown");
337
358
  }
338
359
  }
339
- return n.expose({ hide: O, popoverRef: i, show: B, shown: C, isShow: h }), { showPopover: h, hidePopverOnClickBodyHandler: v };
360
+ return e.expose({ hide: W, popoverRef: i, show: C, shown: B, isShow: d }), { showPopover: d, hidePopverOnClickBodyHandler: m };
340
361
  }
341
- function Ct(t, n, s, i, p, w) {
342
- const { popoverWidth: d, fitToReference: h, followToReferencePosition: C } = p;
343
- function b() {
344
- var g;
345
- if (w.value && ((g = w.value.style) == null ? void 0 : g.display) !== "none" && s.value) {
346
- C(s.value);
347
- const y = s.value.getBoundingClientRect();
348
- i.value && y.width !== d.value && h(s.value);
362
+ function Wt(t, e, s, i, l, g) {
363
+ const { popoverWidth: v, fitToReference: d, followToReferencePosition: B } = l;
364
+ function w() {
365
+ var L;
366
+ if (g.value && ((L = g.value.style) == null ? void 0 : L.display) !== "none" && s.value) {
367
+ B(s.value);
368
+ const h = s.value.getBoundingClientRect();
369
+ i.value && h.width !== v.value && d(s.value);
349
370
  }
350
371
  }
351
- return { onResize: b };
372
+ return { onResize: w };
352
373
  }
353
- const Z = /* @__PURE__ */ pt({
374
+ const U = /* @__PURE__ */ vt({
354
375
  name: "FPopover",
355
- props: Lt,
376
+ props: bt,
356
377
  emits: ["shown", "hidden"],
357
- setup(t, n) {
358
- const s = m(), i = m(), p = m(t.reference), w = m(t.keepWidthWithReference), d = x(() => !!t.title), h = bt(t), {
359
- host: C
360
- } = h, b = xt(t, s, i, h), {
361
- position: g,
362
- arrowStyle: y,
363
- popoverStyle: v,
364
- fitToReference: O,
365
- locateToReference: B
366
- } = b, {
367
- showPopover: c,
368
- hidePopverOnClickBodyHandler: W
369
- } = Bt(t, n, s, i, p, w, b), {
370
- onResize: L
371
- } = Ct(t, n, p, w, b, i), P = x(() => {
372
- let a = g.value;
378
+ setup(t, e) {
379
+ const s = y(), i = y(), l = y(t.reference), g = y(t.keepWidthWithReference), v = x(() => !!t.title), d = xt(t), {
380
+ host: B
381
+ } = d, w = Ct(t, s, i, d), {
382
+ position: L,
383
+ arrowStyle: h,
384
+ popoverStyle: m,
385
+ fitToReference: W,
386
+ locateToReference: C
387
+ } = w, {
388
+ showPopover: f,
389
+ hidePopverOnClickBodyHandler: O
390
+ } = Ht(t, e, s, i, l, g, w), {
391
+ onResize: P
392
+ } = Wt(t, e, l, g, w, i), b = x(() => {
393
+ let a = L.value;
373
394
  a === "top-left" && (a = "top");
374
- const S = `popover in popover-${a}`, D = `bs-popover-${a}`, j = {
395
+ const S = `popover in popover-${a}`, D = `bs-popover-${a}`, z = {
375
396
  "popover-fitcontent": t.fitContent,
376
397
  fade: !0
377
398
  };
378
- j[S] = !0, j[D] = !0;
399
+ z[S] = !0, z[D] = !0;
379
400
  const F = (t.class || "").split(" ");
380
- return t.isSimpleTips && F.unshift("popover-tips"), F.reduce((N, Y) => (N[Y] = !0, N), j), j;
381
- }), E = x(() => ({
401
+ return t.isSimpleTips && F.unshift("popover-tips"), F.reduce((N, Y) => (N[Y] = !0, N), z), z;
402
+ }), I = x(() => ({
382
403
  "popover-content": !0,
383
404
  "popover-body": !0
384
405
  })), X = x(() => {
385
406
  const a = {};
386
- return a.opacity = c.value ? 1 : 0, a.visibility = c.value ? "visible" : "hidden", a.zIndex = gt() || 1060, a;
387
- }), I = x(() => t.isSimpleTips ? !0 : t.showArrow), {
407
+ return a.opacity = f.value ? 1 : 0, a.visibility = f.value ? "visible" : "hidden", a.zIndex = Lt() || 1060, a;
408
+ }), j = x(() => t.isSimpleTips ? !0 : t.showArrow), {
388
409
  delayedValue: H
389
- } = yt(X, 50);
390
- return dt(() => {
410
+ } = Pt(X, 50);
411
+ return ht(() => {
391
412
  var a;
392
- w.value && O(p.value), t.reference && B(p.value), window.addEventListener("resize", L), (a = i.value) == null || a.focus();
393
- }), vt(() => {
394
- document.body.removeEventListener("click", W), window.removeEventListener("resize", L), c.value = !1;
395
- }), () => V(ht, {
396
- to: C
413
+ g.value && W(l.value), t.reference && C(l.value), window.addEventListener("resize", P), (a = i.value) == null || a.focus();
414
+ }), mt(() => {
415
+ document.body.removeEventListener("click", O), window.removeEventListener("resize", P), f.value = !1;
416
+ }), () => V(gt, {
417
+ to: B
397
418
  }, {
398
419
  default: () => {
399
420
  var a;
400
- return [mt(V("div", {
421
+ return [wt(V("div", {
401
422
  tabindex: "-1",
402
423
  ref: i,
403
- class: P.value,
424
+ class: b.value,
404
425
  style: {
405
- ...v.value,
426
+ ...m.value,
406
427
  ...H.value
407
428
  },
408
429
  onMousedown: (S) => {
@@ -411,49 +432,49 @@ const Z = /* @__PURE__ */ pt({
411
432
  onClick: (S) => {
412
433
  S.stopPropagation();
413
434
  }
414
- }, [I.value && V("div", {
435
+ }, [j.value && V("div", {
415
436
  ref: s,
416
437
  class: "popover-arrow arrow",
417
- style: y.value
418
- }, null), d.value && V("h3", {
438
+ style: h.value
439
+ }, null), v.value && V("h3", {
419
440
  class: "popover-title popover-header"
420
441
  }, [t.title]), V("div", {
421
- class: E.value
422
- }, [n.slots.default && ((a = n.slots) == null ? void 0 : a.default())])]), [[wt, c.value]])];
442
+ class: I.value
443
+ }, [e.slots.default && ((a = e.slots) == null ? void 0 : a.default())])]), [[yt, f.value]])];
423
444
  }
424
445
  });
425
446
  }
426
- }), U = "FarrisVue_PopoverInstancesKey";
427
- typeof window < "u" && (window[U] = window[U] || /* @__PURE__ */ new WeakMap());
428
- function _(t, n, s) {
447
+ }), q = "FarrisVue_PopoverInstancesKey";
448
+ typeof window < "u" && (window[q] = window[q] || /* @__PURE__ */ new WeakMap());
449
+ function Z(t, e, s) {
429
450
  t.stopPropagation();
430
- const i = n.value;
431
- i && i.value && !i.value.isShow && (i.value.show(s), window[U].set(s, i.value));
451
+ const i = e.value;
452
+ i && i.value && !i.value.isShow && (i.value.show(s), window[q].set(s, i.value));
432
453
  }
433
- function R(t, n, s) {
434
- t.stopPropagation(), n.value.value.hide(), window[U].delete(s);
454
+ function tt(t, e, s) {
455
+ t.stopPropagation(), e.value.value.hide(), window[q].delete(s);
435
456
  }
436
- function Ht(t, n, s) {
457
+ function Ot(t, e, s) {
437
458
  t.stopPropagation();
438
- const i = n.value;
439
- i && i.value && (i.value.isShow ? R(t, n, s) : _(t, n, s));
459
+ const i = e.value;
460
+ i && i.value && (i.value.isShow ? tt(t, e, s) : Z(t, e, s));
440
461
  }
441
- function Q(t, n, s) {
442
- n.arg && n.arg === "toggle" ? Ht(t, n, s) : _(t, n, s);
462
+ function J(t, e, s) {
463
+ e.arg && e.arg === "toggle" ? Ot(t, e, s) : Z(t, e, s);
443
464
  }
444
- const Ot = {
445
- mounted: (t, n, s) => {
446
- n.modifiers.hover ? (t.addEventListener("mouseenter", (i) => _(i, n, t)), t.addEventListener("mouseleave", (i) => R(i, n, t))) : n.modifiers.click ? t.addEventListener("click", (i) => Q(i, n, t)) : t.addEventListener("click", (i) => Q(i, n, t)), t.classList.add("v-popover");
465
+ const St = {
466
+ mounted: (t, e, s) => {
467
+ e.modifiers.hover ? (t.addEventListener("mouseenter", (i) => Z(i, e, t)), t.addEventListener("mouseleave", (i) => tt(i, e, t))) : e.modifiers.click ? t.addEventListener("click", (i) => J(i, e, t)) : t.addEventListener("click", (i) => J(i, e, t)), t.classList.add("v-popover");
447
468
  },
448
- unMounted: (t, n, s) => {
469
+ unMounted: (t, e, s) => {
449
470
  }
450
471
  };
451
- Z.install = (t) => {
452
- t.component(Z.name, Z), t.directive("popover", Ot);
472
+ U.install = (t) => {
473
+ t.component(U.name, U), t.directive("popover", St);
453
474
  };
454
475
  export {
455
- Z as Popover,
456
- Ot as PopoverDirective,
457
- Z as default,
458
- Lt as popoverProps
476
+ U as Popover,
477
+ St as PopoverDirective,
478
+ U as default,
479
+ bt as popoverProps
459
480
  };