@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.
- package/components/batch-editor/index.esm.js +7332 -7299
- package/components/batch-editor/index.umd.cjs +22 -22
- package/components/button/index.esm.js +7334 -7301
- package/components/button/index.umd.cjs +22 -22
- package/components/component/index.esm.js +880 -874
- package/components/component/index.umd.cjs +2 -2
- package/components/data-grid/index.esm.js +841 -835
- package/components/data-grid/index.umd.cjs +2 -2
- package/components/data-view/index.esm.js +14551 -14472
- package/components/data-view/index.umd.cjs +27 -27
- package/components/designer-canvas/index.esm.js +820 -814
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +848 -842
- package/components/mapping-editor/index.umd.cjs +2 -2
- package/components/popover/index.esm.js +264 -243
- package/components/popover/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +315 -309
- package/components/tree-grid/index.umd.cjs +1 -1
- package/designer/data-grid/index.esm.js +8304 -8257
- package/designer/data-grid/index.umd.cjs +26 -26
- package/designer/farris-designer.all.esm.js +3235 -3223
- package/designer/farris-designer.all.umd.cjs +14 -14
- package/designer/radio-group/index.esm.js +80 -62
- package/designer/radio-group/index.umd.cjs +2 -2
- package/designer/tabs/index.esm.js +830 -824
- package/designer/tabs/index.umd.cjs +2 -2
- package/designer/tree-grid/index.esm.js +348 -342
- package/designer/tree-grid/index.umd.cjs +1 -1
- package/farris.all.esm.js +18917 -18820
- package/farris.all.umd.cjs +39 -39
- package/package.json +1 -1
- package/types/data-view/components/column-header/column-header.component.d.ts +2 -2
- package/types/data-view/composition/column/persist-column-widths.d.ts +15 -0
- package/types/data-view/composition/column/use-resize.d.ts +3 -2
- package/types/data-view/index.d.ts +1 -0
- package/types/popover/src/composition/measure-host.d.ts +10 -5
- package/types/popover/src/composition/types.d.ts +2 -2
- package/types/popover/src/composition/use-host.d.ts +1 -2
- package/types/radio-group/src/property-config/radio-group.property-config.d.ts +21 -0
- package/package.zip +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { getMaxZIndex as
|
|
3
|
-
const
|
|
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:
|
|
53
|
-
offsetY: { type: Object, default:
|
|
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
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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:
|
|
129
|
-
width:
|
|
130
|
-
height:
|
|
131
|
-
bottom:
|
|
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
|
|
137
|
-
const
|
|
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:
|
|
160
|
+
host: e,
|
|
140
161
|
hostLeft: i,
|
|
141
162
|
hostTop: s,
|
|
142
|
-
hostWidth:
|
|
143
|
-
hostHeight:
|
|
144
|
-
hostBottom:
|
|
145
|
-
measure: () =>
|
|
163
|
+
hostWidth: g,
|
|
164
|
+
hostHeight: v,
|
|
165
|
+
hostBottom: l,
|
|
166
|
+
measure: (d) => Bt(d, e, t.rightBoundary)
|
|
146
167
|
};
|
|
147
168
|
}
|
|
148
|
-
function
|
|
149
|
-
const
|
|
150
|
-
let
|
|
151
|
-
|
|
152
|
-
|
|
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
|
|
175
|
+
const f = x(() => {
|
|
155
176
|
const o = {
|
|
156
|
-
left: `${
|
|
157
|
-
top: `${
|
|
158
|
-
transform: `translate(${
|
|
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 &&
|
|
161
|
-
}),
|
|
162
|
-
left: `${
|
|
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
|
|
187
|
+
return C.left;
|
|
188
|
+
}
|
|
189
|
+
function b() {
|
|
190
|
+
return C.top;
|
|
170
191
|
}
|
|
171
|
-
function
|
|
172
|
-
return
|
|
192
|
+
function I() {
|
|
193
|
+
return C.width;
|
|
173
194
|
}
|
|
174
195
|
function X() {
|
|
175
|
-
return
|
|
196
|
+
return C.height;
|
|
176
197
|
}
|
|
177
|
-
function
|
|
178
|
-
return
|
|
198
|
+
function j() {
|
|
199
|
+
return C.bottom;
|
|
179
200
|
}
|
|
180
201
|
function H() {
|
|
181
|
-
return
|
|
202
|
+
return C.scrollLeft;
|
|
182
203
|
}
|
|
183
204
|
function a() {
|
|
184
|
-
return
|
|
205
|
+
return C.scrollTop;
|
|
185
206
|
}
|
|
186
207
|
function S(o) {
|
|
187
208
|
if (o && t.keepWidthWithReference) {
|
|
188
|
-
const
|
|
189
|
-
|
|
209
|
+
const n = o.getBoundingClientRect();
|
|
210
|
+
v.value = Math.max(t.minWidth, n.width);
|
|
190
211
|
}
|
|
191
212
|
}
|
|
192
|
-
function D(o,
|
|
193
|
-
const
|
|
194
|
-
return
|
|
213
|
+
function D(o, n) {
|
|
214
|
+
const u = I() - o.width - 4;
|
|
215
|
+
return u > 0 ? u : n;
|
|
195
216
|
}
|
|
196
|
-
function
|
|
197
|
-
const
|
|
198
|
-
return
|
|
217
|
+
function z(o, n) {
|
|
218
|
+
const u = X() - o.height - 12;
|
|
219
|
+
return u > 0 ? u : n;
|
|
199
220
|
}
|
|
200
|
-
function F(o,
|
|
201
|
-
const
|
|
202
|
-
return { popoverLeft:
|
|
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,
|
|
205
|
-
const
|
|
206
|
-
return Math.min(
|
|
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,
|
|
209
|
-
const
|
|
210
|
-
return { popoverLeft: Math.min(o,
|
|
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
|
|
213
|
-
const
|
|
214
|
-
return { popoverLeft: o, arrowLeft:
|
|
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
|
|
217
|
-
const
|
|
218
|
-
return { popoverLeft:
|
|
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
|
|
221
|
-
const
|
|
222
|
-
return { popoverLeft:
|
|
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
|
|
225
|
-
const
|
|
226
|
-
return { popoverLeft:
|
|
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
|
|
229
|
-
const
|
|
230
|
-
let
|
|
231
|
-
window.innerWidth -
|
|
232
|
-
let
|
|
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
|
|
235
|
-
topHeight:
|
|
236
|
-
bottomHeight:
|
|
255
|
+
const G = {
|
|
256
|
+
topHeight: n.top - b() - u.height - 8,
|
|
257
|
+
bottomHeight: j() - n.bottom - u.height - 8
|
|
237
258
|
};
|
|
238
|
-
|
|
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,
|
|
241
|
-
return
|
|
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
|
|
244
|
-
const
|
|
245
|
-
|
|
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
|
|
249
|
-
|
|
250
|
-
const T = Math.min(
|
|
251
|
-
return { popoverLeft:
|
|
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
|
|
254
|
-
const
|
|
255
|
-
|
|
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
|
|
259
|
-
|
|
260
|
-
const T = Math.min(
|
|
261
|
-
return { popoverLeft:
|
|
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
|
|
284
|
+
const at = /* @__PURE__ */ new Map([
|
|
264
285
|
["top", F],
|
|
265
|
-
["top-left",
|
|
266
|
-
["bottom",
|
|
267
|
-
["bottom-left",
|
|
268
|
-
["right",
|
|
269
|
-
["right-top",
|
|
270
|
-
["auto",
|
|
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
|
|
273
|
-
var
|
|
274
|
-
|
|
275
|
-
const
|
|
276
|
-
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
const
|
|
280
|
-
if (
|
|
281
|
-
const { arrowLeft: T, popoverLeft: M, popoverTop: k, maxHeight:
|
|
282
|
-
|
|
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
|
|
306
|
+
function rt(o) {
|
|
286
307
|
if (o) {
|
|
287
|
-
const
|
|
288
|
-
(
|
|
308
|
+
const n = o.getBoundingClientRect();
|
|
309
|
+
(n.left !== w.value || n.top !== B.value) && _(o);
|
|
289
310
|
}
|
|
290
311
|
}
|
|
291
|
-
function
|
|
292
|
-
|
|
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:
|
|
296
|
-
popoverStyle:
|
|
297
|
-
position:
|
|
298
|
-
popoverWidth:
|
|
316
|
+
arrowStyle: O,
|
|
317
|
+
popoverStyle: f,
|
|
318
|
+
position: L,
|
|
319
|
+
popoverWidth: v,
|
|
299
320
|
fitToReference: S,
|
|
300
|
-
followToReferencePosition:
|
|
301
|
-
locateToReference:
|
|
302
|
-
resetPosition:
|
|
321
|
+
followToReferencePosition: rt,
|
|
322
|
+
locateToReference: _,
|
|
323
|
+
resetPosition: ct
|
|
303
324
|
};
|
|
304
325
|
}
|
|
305
|
-
function
|
|
306
|
-
const
|
|
307
|
-
let
|
|
308
|
-
async function
|
|
309
|
-
|
|
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
|
-
|
|
312
|
-
var
|
|
313
|
-
if (!
|
|
332
|
+
m = (f) => {
|
|
333
|
+
var b;
|
|
334
|
+
if (!l.value)
|
|
314
335
|
return;
|
|
315
|
-
const
|
|
316
|
-
if (
|
|
317
|
-
|
|
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 (
|
|
341
|
+
if (f.target.closest(".time-picker-panel") || f.target.closest(".fv-grid"))
|
|
321
342
|
return;
|
|
322
|
-
const
|
|
323
|
-
if (
|
|
324
|
-
|
|
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 (!
|
|
328
|
-
const
|
|
329
|
-
|
|
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
|
|
333
|
-
if (i.value && (t.showArrow === !1 || t.showArrow && s.value) &&
|
|
334
|
-
|
|
335
|
-
const
|
|
336
|
-
|
|
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
|
|
360
|
+
return e.expose({ hide: W, popoverRef: i, show: C, shown: B, isShow: d }), { showPopover: d, hidePopverOnClickBodyHandler: m };
|
|
340
361
|
}
|
|
341
|
-
function
|
|
342
|
-
const { popoverWidth:
|
|
343
|
-
function
|
|
344
|
-
var
|
|
345
|
-
if (
|
|
346
|
-
|
|
347
|
-
const
|
|
348
|
-
i.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:
|
|
372
|
+
return { onResize: w };
|
|
352
373
|
}
|
|
353
|
-
const
|
|
374
|
+
const U = /* @__PURE__ */ vt({
|
|
354
375
|
name: "FPopover",
|
|
355
|
-
props:
|
|
376
|
+
props: bt,
|
|
356
377
|
emits: ["shown", "hidden"],
|
|
357
|
-
setup(t,
|
|
358
|
-
const s =
|
|
359
|
-
host:
|
|
360
|
-
} =
|
|
361
|
-
position:
|
|
362
|
-
arrowStyle:
|
|
363
|
-
popoverStyle:
|
|
364
|
-
fitToReference:
|
|
365
|
-
locateToReference:
|
|
366
|
-
} =
|
|
367
|
-
showPopover:
|
|
368
|
-
hidePopverOnClickBodyHandler:
|
|
369
|
-
} =
|
|
370
|
-
onResize:
|
|
371
|
-
} =
|
|
372
|
-
let a =
|
|
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}`,
|
|
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
|
-
|
|
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),
|
|
381
|
-
}),
|
|
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 =
|
|
387
|
-
}),
|
|
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
|
-
} =
|
|
390
|
-
return
|
|
410
|
+
} = Pt(X, 50);
|
|
411
|
+
return ht(() => {
|
|
391
412
|
var a;
|
|
392
|
-
|
|
393
|
-
}),
|
|
394
|
-
document.body.removeEventListener("click",
|
|
395
|
-
}), () => V(
|
|
396
|
-
to:
|
|
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 [
|
|
421
|
+
return [wt(V("div", {
|
|
401
422
|
tabindex: "-1",
|
|
402
423
|
ref: i,
|
|
403
|
-
class:
|
|
424
|
+
class: b.value,
|
|
404
425
|
style: {
|
|
405
|
-
...
|
|
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
|
-
}, [
|
|
435
|
+
}, [j.value && V("div", {
|
|
415
436
|
ref: s,
|
|
416
437
|
class: "popover-arrow arrow",
|
|
417
|
-
style:
|
|
418
|
-
}, null),
|
|
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:
|
|
422
|
-
}, [
|
|
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
|
-
}),
|
|
427
|
-
typeof window < "u" && (window[
|
|
428
|
-
function
|
|
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 =
|
|
431
|
-
i && i.value && !i.value.isShow && (i.value.show(s), window[
|
|
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
|
|
434
|
-
t.stopPropagation(),
|
|
454
|
+
function tt(t, e, s) {
|
|
455
|
+
t.stopPropagation(), e.value.value.hide(), window[q].delete(s);
|
|
435
456
|
}
|
|
436
|
-
function
|
|
457
|
+
function Ot(t, e, s) {
|
|
437
458
|
t.stopPropagation();
|
|
438
|
-
const i =
|
|
439
|
-
i && i.value && (i.value.isShow ?
|
|
459
|
+
const i = e.value;
|
|
460
|
+
i && i.value && (i.value.isShow ? tt(t, e, s) : Z(t, e, s));
|
|
440
461
|
}
|
|
441
|
-
function
|
|
442
|
-
|
|
462
|
+
function J(t, e, s) {
|
|
463
|
+
e.arg && e.arg === "toggle" ? Ot(t, e, s) : Z(t, e, s);
|
|
443
464
|
}
|
|
444
|
-
const
|
|
445
|
-
mounted: (t,
|
|
446
|
-
|
|
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,
|
|
469
|
+
unMounted: (t, e, s) => {
|
|
449
470
|
}
|
|
450
471
|
};
|
|
451
|
-
|
|
452
|
-
t.component(
|
|
472
|
+
U.install = (t) => {
|
|
473
|
+
t.component(U.name, U), t.directive("popover", St);
|
|
453
474
|
};
|
|
454
475
|
export {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
476
|
+
U as Popover,
|
|
477
|
+
St as PopoverDirective,
|
|
478
|
+
U as default,
|
|
479
|
+
bt as popoverProps
|
|
459
480
|
};
|