@farris/ui-vue 1.6.5-beta.7 → 1.6.5
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/accordion/index.esm.js +65 -65
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +360 -361
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +524 -520
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +134 -134
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +192 -192
- package/components/capsule/index.umd.cjs +1 -1
- package/components/code-editor/index.esm.js +8 -8
- package/components/code-editor/index.umd.cjs +3 -3
- package/components/collection-property-editor/index.esm.js +72 -72
- package/components/collection-property-editor/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +291 -289
- package/components/color-picker/index.umd.cjs +1 -1
- package/components/combo-list/index.esm.js +190 -181
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +113 -112
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/common/index.esm.js +3 -1
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +309 -309
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +1125 -1124
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +472 -472
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +99 -99
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +3387 -3321
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +1604 -1601
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +1082 -1079
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/discussion-editor/index.esm.js +973 -1040
- package/components/discussion-editor/index.umd.cjs +6 -6
- package/components/dropdown/index.esm.js +335 -330
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +177 -177
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +6 -6
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/dynamic-view/index.esm.js +344 -344
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +644 -644
- package/components/events-editor/index.umd.cjs +3 -3
- package/components/expression-editor/index.esm.js +1773 -1760
- package/components/expression-editor/index.umd.cjs +4 -4
- package/components/fieldset/index.esm.js +55 -55
- package/components/fieldset/index.umd.cjs +1 -1
- package/components/filter-bar/index.esm.js +879 -869
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/filter-condition-editor/index.esm.js +1091 -1077
- package/components/filter-condition-editor/index.umd.cjs +3 -3
- package/components/flow-canvas/index.esm.js +215 -215
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/html-template/index.esm.js +164 -164
- package/components/html-template/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +198 -198
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/json-editor/index.esm.js +64 -64
- package/components/json-editor/index.umd.cjs +1 -1
- package/components/language-textbox/index.esm.js +140 -140
- package/components/language-textbox/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +111 -111
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +90 -90
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +139 -141
- package/components/list-view/index.umd.cjs +3 -3
- package/components/locale/index.esm.js +833 -901
- package/components/locale/index.umd.cjs +6 -6
- package/components/lookup/index.esm.js +1352 -1351
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +1387 -1383
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/menu-lookup/index.esm.js +1059 -1127
- package/components/menu-lookup/index.umd.cjs +6 -6
- package/components/message-box/index.esm.js +217 -217
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.esm.js +283 -283
- package/components/modal/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +106 -106
- package/components/nav/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +194 -194
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +463 -462
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +883 -876
- package/components/order/index.umd.cjs +4 -4
- package/components/page-footer/index.esm.js +94 -94
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +942 -939
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +82 -82
- package/components/pagination/index.umd.cjs +1 -1
- package/components/popover/index.esm.js +59 -57
- package/components/popover/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +113 -113
- package/components/progress/index.umd.cjs +2 -2
- package/components/property-editor/index.esm.js +151 -150
- package/components/property-editor/index.umd.cjs +1 -1
- package/components/property-panel/index.esm.js +739 -739
- package/components/property-panel/index.umd.cjs +2 -2
- package/components/query-solution/index.esm.js +4142 -4190
- package/components/query-solution/index.umd.cjs +6 -6
- package/components/radio-button/index.esm.js +182 -182
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +106 -106
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +535 -535
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +1456 -1443
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +779 -776
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +1875 -1866
- package/components/schema-selector/index.umd.cjs +7 -7
- package/components/search-box/index.esm.js +151 -147
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +1236 -1233
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +163 -163
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/sort-condition-editor/index.esm.js +1097 -1083
- package/components/sort-condition-editor/index.umd.cjs +3 -3
- package/components/splitter/index.esm.js +3 -3
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +133 -133
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +103 -98
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +1596 -1593
- package/components/tabs/index.umd.cjs +2 -2
- package/components/tags/index.esm.js +93 -93
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +138 -138
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +684 -684
- package/components/textarea/index.umd.cjs +2 -2
- package/components/time-picker/index.esm.js +935 -929
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/tooltip/index.esm.js +173 -171
- package/components/tooltip/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +190 -192
- package/components/transfer/index.umd.cjs +4 -4
- package/components/tree-grid/index.esm.js +124 -124
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +2363 -2278
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +170 -170
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +196 -196
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +227 -227
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +9 -9
- package/components/weather/index.umd.cjs +2 -2
- package/designer/button-edit/index.esm.js +353 -353
- package/designer/button-edit/index.umd.cjs +1 -1
- package/designer/checkbox/index.esm.js +7 -3
- package/designer/checkbox/index.umd.cjs +1 -1
- package/designer/checkbox-group/index.esm.js +38 -33
- package/designer/checkbox-group/index.umd.cjs +1 -1
- package/designer/data-grid/index.esm.js +3562 -3536
- package/designer/data-grid/index.umd.cjs +6 -6
- package/designer/data-view/index.esm.js +3 -3
- package/designer/data-view/index.umd.cjs +3 -3
- package/designer/farris-designer.all.esm.js +4203 -4193
- package/designer/farris-designer.all.umd.cjs +9 -9
- package/designer/input-group/index.esm.js +97 -97
- package/designer/input-group/index.umd.cjs +1 -1
- package/designer/list-view/index.esm.js +1868 -1854
- package/designer/list-view/index.umd.cjs +8 -8
- package/designer/radio-group/index.esm.js +954 -949
- package/designer/radio-group/index.umd.cjs +1 -1
- package/farris.all.esm.js +16195 -16126
- package/farris.all.umd.cjs +30 -30
- package/locales/data-grid/ui/en.json +2 -2
- package/locales/designer/en.json +7 -6
- package/locales/designer/zh-CHS.json +2 -1
- package/locales/designer/zh-CHT.json +2 -1
- package/locales/ui/en.json +7 -6
- package/locales/ui/zh-CHS.json +2 -1
- package/locales/ui/zh-CHT.json +2 -1
- package/package.json +1 -1
- package/types/combo-list/src/property-config/combo-list.property-config.d.ts +0 -6
- package/types/data-view/composition/types.d.ts +10 -4
- package/types/lookup/src/composition/use-dialog.d.ts +2 -0
- package/types/lookup/src/composition/use-input-change.d.ts +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as g, computed as w, watch as at, nextTick as st, defineComponent as ut, onMounted as
|
|
1
|
+
import { ref as g, computed as w, watch as at, nextTick as st, defineComponent as ut, onMounted as rt, onUnmounted as ct, createVNode as z, Teleport as vt, withDirectives as pt, vShow as dt } from "vue";
|
|
2
2
|
import { getMaxZIndex as ft, useDelayedRef as ht } from "../common/index.esm.js";
|
|
3
3
|
const mt = {
|
|
4
4
|
id: { type: String },
|
|
@@ -84,90 +84,90 @@ function wt(t, n, a, i) {
|
|
|
84
84
|
const l = S.value - e.width - 4;
|
|
85
85
|
return l > 0 ? l : o;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function k(e, o) {
|
|
88
88
|
const l = H.value - e.height - 4;
|
|
89
89
|
return l > 0 ? l : o;
|
|
90
90
|
}
|
|
91
91
|
function A(e, o, l) {
|
|
92
|
-
const
|
|
93
|
-
return { popoverLeft:
|
|
92
|
+
const r = b.value, c = o.left - u.value + o.width / 2 + L.value, s = o.top - h.value - (e.height + l.height) + C.value;
|
|
93
|
+
return { popoverLeft: c, popoverTop: s, arrowLeft: r };
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
const
|
|
97
|
-
return Math.min(
|
|
95
|
+
function M(e, o, l) {
|
|
96
|
+
const r = o.top - h.value + (o.height + l.height) + C.value, c = k(e, r);
|
|
97
|
+
return Math.min(r, c);
|
|
98
98
|
}
|
|
99
99
|
function j(e, o) {
|
|
100
|
-
const l = d(o, e),
|
|
101
|
-
return { popoverLeft: Math.min(e, l), arrowLeft:
|
|
100
|
+
const l = d(o, e), r = e <= l ? b.value : e - l;
|
|
101
|
+
return { popoverLeft: Math.min(e, l), arrowLeft: r, maxHeight: 0 };
|
|
102
102
|
}
|
|
103
103
|
function R(e, o) {
|
|
104
|
-
const l = d(o, e),
|
|
105
|
-
return { popoverLeft: e, arrowLeft:
|
|
104
|
+
const l = d(o, e), r = e <= l ? b.value : e - l;
|
|
105
|
+
return { popoverLeft: e, arrowLeft: r, maxHeight: 0 };
|
|
106
106
|
}
|
|
107
107
|
function U(e, o, l) {
|
|
108
|
-
const
|
|
109
|
-
return { popoverLeft: s, popoverTop: y, arrowLeft:
|
|
110
|
-
}
|
|
111
|
-
function Q(e, o, l) {
|
|
112
|
-
const c = o.left - u.value + o.width / 2 - (l.width / 2 - (e.left - u.value)) + L.value, { arrowLeft: r, popoverLeft: s } = j(c, e), y = k(e, o, l);
|
|
113
|
-
return { popoverLeft: s, popoverTop: y, arrowLeft: r, maxHeight: 0 };
|
|
108
|
+
const r = o.left - u.value + L.value, { arrowLeft: c, popoverLeft: s } = R(r, e), { popoverTop: y } = A(e, o, l);
|
|
109
|
+
return { popoverLeft: s, popoverTop: y, arrowLeft: c, maxHeight: 0 };
|
|
114
110
|
}
|
|
115
111
|
function Y(e, o, l) {
|
|
116
|
-
const
|
|
117
|
-
return { popoverLeft: s, popoverTop: y, arrowLeft:
|
|
112
|
+
const r = o.left - u.value + o.width / 2 - (l.width / 2 - (e.left - u.value)) + L.value, { arrowLeft: c, popoverLeft: s } = j(r, e), y = M(e, o, l);
|
|
113
|
+
return { popoverLeft: s, popoverTop: y, arrowLeft: c, maxHeight: 0 };
|
|
114
|
+
}
|
|
115
|
+
function $(e, o, l) {
|
|
116
|
+
const r = o.left - u.value + L.value, { arrowLeft: c, popoverLeft: s } = j(r, e), y = M(e, o, l);
|
|
117
|
+
return { popoverLeft: s, popoverTop: y, arrowLeft: c, maxHeight: 0 };
|
|
118
118
|
}
|
|
119
119
|
function tt(e, o, l) {
|
|
120
|
-
const
|
|
121
|
-
let
|
|
122
|
-
window.innerWidth -
|
|
120
|
+
const r = o.left - u.value;
|
|
121
|
+
let c = 0, s = 0, y = 0, W = 0, E = "bottom-left";
|
|
122
|
+
window.innerWidth - r > e.width ? c = r + L.value : (c = o.right - e.width + L.value, y = e.width - l.width - 20);
|
|
123
123
|
let I = 0;
|
|
124
124
|
if (t.limitContentBySpace) {
|
|
125
|
-
const
|
|
126
|
-
I = Math.max(
|
|
125
|
+
const G = { topHeight: o.top - h.value - l.height - 8, bottomHeight: B.value - o.bottom - l.height - 8 };
|
|
126
|
+
I = Math.max(G.topHeight, G.bottomHeight), e.height > I && (W = I, a.value.classList.add("popover-limitmax"));
|
|
127
127
|
}
|
|
128
128
|
const D = W ? Math.floor(W) : e.height, F = o.top - h.value + (o.height + l.height);
|
|
129
|
-
return B.value - F > D ? s = F + C.value : (s = o.top - D - l.height + C.value, B.value - F > o.top ? (s = F + C.value, D > o.top && (s = B.value - D)) : (s = s < 0 ? 0 : s, E = "top")), a.value.classList.add("popover-" + E, "bs-popover-" + E), { popoverLeft:
|
|
129
|
+
return B.value - F > D ? s = F + C.value : (s = o.top - D - l.height + C.value, B.value - F > o.top ? (s = F + C.value, D > o.top && (s = B.value - D)) : (s = s < 0 ? 0 : s, E = "top")), a.value.classList.add("popover-" + E, "bs-popover-" + E), { popoverLeft: c, popoverTop: s, arrowLeft: y, maxHeight: W };
|
|
130
130
|
}
|
|
131
131
|
function et(e, o, l) {
|
|
132
|
-
const
|
|
132
|
+
const r = o.left + o.width, c = Math.max(o.top - (e.height / 2 - o.height / 2), h.value);
|
|
133
133
|
let s = h.value + H.value - e.height;
|
|
134
|
-
s < 0 && (s =
|
|
135
|
-
const y = Math.min(
|
|
136
|
-
return { popoverLeft:
|
|
134
|
+
s < 0 && (s = c);
|
|
135
|
+
const y = Math.min(c, s);
|
|
136
|
+
return { popoverLeft: r, popoverTop: y, arrowLeft: 0, maxHeight: 0 };
|
|
137
137
|
}
|
|
138
138
|
function ot(e, o, l) {
|
|
139
|
-
const
|
|
139
|
+
const r = o.left + o.width, c = Math.max(o.top - o.height, h.value);
|
|
140
140
|
let s = h.value + H.value - e.height;
|
|
141
|
-
s < 0 && (s =
|
|
142
|
-
const y = Math.min(
|
|
143
|
-
return { popoverLeft:
|
|
141
|
+
s < 0 && (s = c);
|
|
142
|
+
const y = Math.min(c, s);
|
|
143
|
+
return { popoverLeft: r, popoverTop: y, arrowLeft: 0, maxHeight: 0 };
|
|
144
144
|
}
|
|
145
145
|
const nt = /* @__PURE__ */ new Map([
|
|
146
146
|
["top", A],
|
|
147
147
|
["top-left", U],
|
|
148
|
-
["bottom",
|
|
149
|
-
["bottom-left",
|
|
148
|
+
["bottom", Y],
|
|
149
|
+
["bottom-left", $],
|
|
150
150
|
["right", et],
|
|
151
151
|
["right-top", ot],
|
|
152
152
|
["auto", tt]
|
|
153
153
|
]);
|
|
154
|
-
function
|
|
154
|
+
function q(e) {
|
|
155
155
|
var s;
|
|
156
156
|
t.keepWidthWithReference && X(e);
|
|
157
157
|
const o = e.getBoundingClientRect();
|
|
158
158
|
m.value = o.top, x.value = o.left;
|
|
159
|
-
const l = n.value ? n.value.getBoundingClientRect() : { height: 4, width: 4 },
|
|
160
|
-
p.value =
|
|
161
|
-
const
|
|
162
|
-
if (
|
|
163
|
-
const { arrowLeft: y, popoverLeft: W, popoverTop: E, maxHeight: I } = r
|
|
159
|
+
const l = n.value ? n.value.getBoundingClientRect() : { height: 4, width: 4 }, r = (s = a.value) == null ? void 0 : s.getBoundingClientRect();
|
|
160
|
+
p.value = r.width;
|
|
161
|
+
const c = nt.get(T.value);
|
|
162
|
+
if (c) {
|
|
163
|
+
const { arrowLeft: y, popoverLeft: W, popoverTop: E, maxHeight: I } = c(r, o, l);
|
|
164
164
|
b.value = y, O.value = W, v.value = E, P.value = I || -1;
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
function it(e) {
|
|
168
168
|
if (e) {
|
|
169
169
|
const o = e.getBoundingClientRect();
|
|
170
|
-
(o.left !== x.value || o.top !== m.value) &&
|
|
170
|
+
(o.left !== x.value || o.top !== m.value) && q(e);
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
function lt() {
|
|
@@ -180,7 +180,7 @@ function wt(t, n, a, i) {
|
|
|
180
180
|
popoverWidth: p,
|
|
181
181
|
fitToReference: X,
|
|
182
182
|
followToReferencePosition: it,
|
|
183
|
-
locateToReference:
|
|
183
|
+
locateToReference: q,
|
|
184
184
|
resetPosition: lt
|
|
185
185
|
};
|
|
186
186
|
}
|
|
@@ -199,6 +199,8 @@ function yt(t, n, a, i, f, p, P) {
|
|
|
199
199
|
L();
|
|
200
200
|
return;
|
|
201
201
|
}
|
|
202
|
+
if (u.target.closest(".time-picker-panel"))
|
|
203
|
+
return;
|
|
202
204
|
const S = (H = u.target) == null ? void 0 : H.closest(".popover");
|
|
203
205
|
if (S && i.value && S === i.value) {
|
|
204
206
|
u.type !== "scroll" && u.type !== "wheel" && u.stopPropagation();
|
|
@@ -250,26 +252,26 @@ const Z = /* @__PURE__ */ ut({
|
|
|
250
252
|
} = Lt(t, n, f, p, T), H = w(() => {
|
|
251
253
|
let d = b.value;
|
|
252
254
|
d === "top-left" && (d = "top");
|
|
253
|
-
const
|
|
255
|
+
const k = `popover in popover-${d}`, A = `bs-popover-${d}`, M = {
|
|
254
256
|
"popover-fitcontent": t.fitContent,
|
|
255
257
|
fade: !0
|
|
256
258
|
};
|
|
257
|
-
k
|
|
259
|
+
M[k] = !0, M[A] = !0;
|
|
258
260
|
const j = (t.class || "").split(" ");
|
|
259
|
-
return t.isSimpleTips && j.unshift("popover-tips"), j.reduce((R, U) => (R[U] = !0, R),
|
|
261
|
+
return t.isSimpleTips && j.unshift("popover-tips"), j.reduce((R, U) => (R[U] = !0, R), M), M;
|
|
260
262
|
}), B = w(() => ({
|
|
261
263
|
"popover-content": !0,
|
|
262
264
|
"popover-body": !0
|
|
263
265
|
})), V = w(() => {
|
|
264
266
|
const d = {};
|
|
265
|
-
return d.opacity = u.value ? 1 : 0, d.visibility = u.value ? "visible" : "hidden", d.zIndex = ft() ||
|
|
267
|
+
return d.opacity = u.value ? 1 : 0, d.visibility = u.value ? "visible" : "hidden", d.zIndex = ft() || 1060, d;
|
|
266
268
|
}), K = w(() => t.isSimpleTips ? !0 : t.showArrow), {
|
|
267
269
|
delayedValue: X
|
|
268
270
|
} = ht(V, 50);
|
|
269
|
-
return
|
|
271
|
+
return rt(() => {
|
|
270
272
|
var d;
|
|
271
273
|
p.value && L(f.value), t.reference && C(f.value), window.addEventListener("resize", S), (d = i.value) == null || d.focus();
|
|
272
|
-
}),
|
|
274
|
+
}), ct(() => {
|
|
273
275
|
document.body.removeEventListener("click", h), window.removeEventListener("resize", S), u.value = !1;
|
|
274
276
|
}), () => z(vt, {
|
|
275
277
|
to: x
|
|
@@ -284,11 +286,11 @@ const Z = /* @__PURE__ */ ut({
|
|
|
284
286
|
...v.value,
|
|
285
287
|
...X.value
|
|
286
288
|
},
|
|
287
|
-
onMousedown: (
|
|
288
|
-
|
|
289
|
+
onMousedown: (k) => {
|
|
290
|
+
k.stopPropagation();
|
|
289
291
|
},
|
|
290
|
-
onClick: (
|
|
291
|
-
|
|
292
|
+
onClick: (k) => {
|
|
293
|
+
k.stopPropagation();
|
|
292
294
|
}
|
|
293
295
|
}, [K.value && z("div", {
|
|
294
296
|
ref: a,
|
|
@@ -309,20 +311,20 @@ function _(t, n, a) {
|
|
|
309
311
|
const i = n.value;
|
|
310
312
|
i && i.value && !i.value.isShow && (i.value.show(a), window[N].set(a, i.value));
|
|
311
313
|
}
|
|
312
|
-
function
|
|
314
|
+
function Q(t, n, a) {
|
|
313
315
|
t.stopPropagation(), n.value.value.hide(), window[N].delete(a);
|
|
314
316
|
}
|
|
315
317
|
function Pt(t, n, a) {
|
|
316
318
|
t.stopPropagation();
|
|
317
319
|
const i = n.value;
|
|
318
|
-
i && i.value && (i.value.isShow ?
|
|
320
|
+
i && i.value && (i.value.isShow ? Q(t, n, a) : _(t, n, a));
|
|
319
321
|
}
|
|
320
|
-
function
|
|
322
|
+
function J(t, n, a) {
|
|
321
323
|
n.arg && n.arg === "toggle" ? Pt(t, n, a) : _(t, n, a);
|
|
322
324
|
}
|
|
323
325
|
const Tt = {
|
|
324
326
|
mounted: (t, n, a) => {
|
|
325
|
-
n.modifiers.hover ? (t.addEventListener("mouseenter", (i) => _(i, n, t)), t.addEventListener("mouseleave", (i) =>
|
|
327
|
+
n.modifiers.hover ? (t.addEventListener("mouseenter", (i) => _(i, n, t)), t.addEventListener("mouseleave", (i) => Q(i, n, t))) : n.modifiers.click ? t.addEventListener("click", (i) => J(i, n, t)) : t.addEventListener("click", (i) => J(i, n, t)), t.classList.add("v-popover");
|
|
326
328
|
},
|
|
327
329
|
unMounted: (t, n, a) => {
|
|
328
330
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(L,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("../common/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../common/index.umd.js"],i):(L=typeof globalThis<"u"?globalThis:L||self,i(L.popover={},L.Vue,L.common))})(this,function(L,i,U){"use strict";const Z={id:{type:String},arrowOffsetX:{type:Number,default:0},class:{type:String,default:""},customStyles:{type:Object,default:null},isSimpleTips:{type:Boolean,default:!1},fitContent:{type:Boolean,default:!1},host:{type:Object},leftBoundary:{type:Object},keepWidthWithReference:{type:Boolean,default:!1},minWidth:{type:Number,default:-1},offsetX:{type:Object,default:i.ref(0)},placement:{type:String,default:"bottom"},reference:{type:Object},rightBoundary:{type:Object},showArrow:{type:Boolean,default:!1},title:{type:String},visible:{type:Boolean,default:!1},zIndex:{type:Number,default:-1},limitContentBySpace:{type:Boolean,default:!1},beforeClose:{type:Function}};function tt(t){const n=t.host?t.host:"body",a=i.computed(()=>n==="body"?0:n?n.getBoundingClientRect().top:0),l=i.computed(()=>n==="body"?window.innerHeight:n?n.getBoundingClientRect().bottom:window.innerHeight),h=i.computed(()=>n==="body"?0:n?n.getBoundingClientRect().left:0),f=i.computed(()=>n==="body"?document.body.getBoundingClientRect().width:n?n.getBoundingClientRect().width-(t.rightBoundary?t.rightBoundary.getBoundingClientRect().width:0):document.body.getBoundingClientRect().width),P=i.computed(()=>n==="body"?window.innerHeight:n?n.getBoundingClientRect().height:window.innerHeight);return{host:n,hostLeft:h,hostTop:a,hostWidth:f,hostHeight:P,hostBottom:l}}function et(t,n,a,l){const h=i.ref(t.offsetX||0),f=i.ref(-1),P=i.ref(-1),g=i.ref(-1),x=i.ref(-1),T=i.ref(t.placement),b=i.ref(0),S=i.ref(0),p=i.ref(0),y=i.computed(()=>document.documentElement.scrollLeft),C=i.computed(()=>document.documentElement.scrollTop),{hostLeft:c,hostTop:m,hostWidth:W,hostHeight:H,hostBottom:B}=l;i.watch(()=>t.offsetX,e=>{h.value=e});const _=i.computed(()=>{const e={left:`${S.value}px`,top:`${p.value}px`,transform:`translateX(${h.value}px)`};return t.zIndex!==-1&&(e["z-index"]=t.zIndex),t.fitContent?t.keepWidthWithReference&&a.value&&f.value>=a.value.getBoundingClientRect().width&&(e.width=`${f.value}px`):f.value!==-1&&(e.width=`${f.value}px`),t.minWidth!==-1&&(e.minWidth=`${t.minWidth}px`),t.customStyles&&Object.assign(e,t.customStyles),P.value>0&&(e.maxHeight=P.value+"px"),e}),q=i.computed(()=>({left:`${b.value}px`,transform:`translateX(${t.arrowOffsetX}px)`}));function V(e){if(e&&t.keepWidthWithReference){const o=e.getBoundingClientRect();f.value=Math.max(t.minWidth,o.width)}}function v(e,o){const s=W.value-e.width-4;return s>0?s:o}function M(e,o){const s=H.value-e.height-4;return s>0?s:o}function X(e,o,s){const r=b.value,d=o.left-c.value+o.width/2+y.value,u=o.top-m.value-(e.height+s.height)+C.value;return{popoverLeft:d,popoverTop:u,arrowLeft:r}}function k(e,o,s){const r=o.top-m.value+(o.height+s.height)+C.value,d=M(e,r);return Math.min(r,d)}function z(e,o){const s=v(o,e),r=e<=s?b.value:e-s;return{popoverLeft:Math.min(e,s),arrowLeft:r,maxHeight:0}}function A(e,o){const s=v(o,e),r=e<=s?b.value:e-s;return{popoverLeft:e,arrowLeft:r,maxHeight:0}}function K(e,o,s){const r=o.left-c.value+y.value,{arrowLeft:d,popoverLeft:u}=A(r,e),{popoverTop:w}=X(e,o,s);return{popoverLeft:u,popoverTop:w,arrowLeft:d,maxHeight:0}}function lt(e,o,s){const r=o.left-c.value+o.width/2-(s.width/2-(e.left-c.value))+y.value,{arrowLeft:d,popoverLeft:u}=z(r,e),w=k(e,o,s);return{popoverLeft:u,popoverTop:w,arrowLeft:d,maxHeight:0}}function st(e,o,s){const r=o.left-c.value+y.value,{arrowLeft:d,popoverLeft:u}=z(r,e),w=k(e,o,s);return{popoverLeft:u,popoverTop:w,arrowLeft:d,maxHeight:0}}function at(e,o,s){const r=o.left-c.value;let d=0,u=0,w=0,O=0,j="bottom-left";window.innerWidth-r>e.width?d=r+y.value:(d=o.right-e.width+y.value,w=e.width-s.width-20);let E=0;if(t.limitContentBySpace){const Y={topHeight:o.top-m.value-s.height-8,bottomHeight:B.value-o.bottom-s.height-8};E=Math.max(Y.topHeight,Y.bottomHeight),e.height>E&&(O=E,a.value.classList.add("popover-limitmax"))}const R=O?Math.floor(O):e.height,D=o.top-m.value+(o.height+s.height);return B.value-D>R?u=D+C.value:(u=o.top-R-s.height+C.value,B.value-D>o.top?(u=D+C.value,R>o.top&&(u=B.value-R)):(u=u<0?0:u,j="top")),a.value.classList.add("popover-"+j,"bs-popover-"+j),{popoverLeft:d,popoverTop:u,arrowLeft:w,maxHeight:O}}function ut(e,o,s){const r=o.left+o.width,d=Math.max(o.top-(e.height/2-o.height/2),m.value);let u=m.value+H.value-e.height;u<0&&(u=d);const w=Math.min(d,u);return{popoverLeft:r,popoverTop:w,arrowLeft:0,maxHeight:0}}function ct(e,o,s){const r=o.left+o.width,d=Math.max(o.top-o.height,m.value);let u=m.value+H.value-e.height;u<0&&(u=d);const w=Math.min(d,u);return{popoverLeft:r,popoverTop:w,arrowLeft:0,maxHeight:0}}const rt=new Map([["top",X],["top-left",K],["bottom",lt],["bottom-left",st],["right",ut],["right-top",ct],["auto",at]]);function Q(e){var u;t.keepWidthWithReference&&V(e);const o=e.getBoundingClientRect();g.value=o.top,x.value=o.left;const s=n.value?n.value.getBoundingClientRect():{height:4,width:4},r=(u=a.value)==null?void 0:u.getBoundingClientRect();f.value=r.width;const d=rt.get(T.value);if(d){const{arrowLeft:w,popoverLeft:O,popoverTop:j,maxHeight:E}=d(r,o,s);b.value=w,S.value=O,p.value=j,P.value=E||-1}}function dt(e){if(e){const o=e.getBoundingClientRect();(o.left!==x.value||o.top!==g.value)&&Q(e)}}function pt(){T.value=t.placement,b.value=0,S.value=0,p.value=0,f.value=-1}return{arrowStyle:q,popoverStyle:_,position:T,popoverWidth:f,fitToReference:V,followToReferencePosition:dt,locateToReference:Q,resetPosition:pt}}function ot(t,n,a,l,h,f,P){const g=i.ref(t.visible),x=i.computed(()=>g.value),{fitToReference:T,locateToReference:b,resetPosition:S}=P;let p;async function y(){g.value&&(t.beforeClose&&typeof t.beforeClose=="function"&&!await t.beforeClose()||(g.value=!1,document.body.removeEventListener("click",p),document.body.removeEventListener("mousedown",p),document.body.removeEventListener("wheel",p,!0),document.removeEventListener("scroll",p),S(),n.emit("hidden")))}p=c=>{var H;if(!h.value)return;const m=h.value.contains(c.target);if(c.type==="scroll"||c.type==="wheel"&&m){y();return}const W=(H=c.target)==null?void 0:H.closest(".popover");if(W&&l.value&&W===l.value){c.type!=="scroll"&&c.type!=="wheel"&&c.stopPropagation();return}if(!m&&g.value){const B=h.value.closest(".popover");B&&B.removeEventListener("click",p),y()}};async function C(c){if(l.value&&(t.showArrow===!1||t.showArrow&&a.value)&&c){g.value=!0,h.value=c,f.value&&T(c),await i.nextTick(),b(c),document.body.addEventListener("click",p),document.body.addEventListener("mousedown",p),document.body.addEventListener("wheel",p,!0),document.addEventListener("scroll",p),(top==null?void 0:top.document)!==document&&(top==null||top.document.addEventListener("mousedown",p));const m=c.closest(".popover");m&&m.addEventListener("click",p),n.emit("shown")}}return n.expose({hide:y,popoverRef:l,show:C,shown:x,isShow:g}),{showPopover:g,hidePopverOnClickBodyHandler:p}}function nt(t,n,a,l,h){const{popoverWidth:f,fitToReference:P,followToReferencePosition:g}=h;function x(){if(a.value){g(a.value);const T=a.value.getBoundingClientRect();l.value&&T.width!==f.value&&P(a.value)}}return{onResize:x}}const I=i.defineComponent({name:"FPopover",props:Z,emits:["shown","hidden"],setup(t,n){const a=i.ref(),l=i.ref(),h=i.ref(t.reference),f=i.ref(t.keepWidthWithReference),P=i.computed(()=>!!t.title),g=tt(t),{host:x}=g,T=et(t,a,l,g),{position:b,arrowStyle:S,popoverStyle:p,fitToReference:y,locateToReference:C}=T,{showPopover:c,hidePopverOnClickBodyHandler:m}=ot(t,n,a,l,h,f,T),{onResize:W}=nt(t,n,h,f,T),H=i.computed(()=>{let v=b.value;v==="top-left"&&(v="top");const M=`popover in popover-${v}`,X=`bs-popover-${v}`,k={"popover-fitcontent":t.fitContent,fade:!0};k[M]=!0,k[X]=!0;const z=(t.class||"").split(" ");return t.isSimpleTips&&z.unshift("popover-tips"),z.reduce((A,K)=>(A[K]=!0,A),k),k}),B=i.computed(()=>({"popover-content":!0,"popover-body":!0})),_=i.computed(()=>{const v={};return v.opacity=c.value?1:0,v.visibility=c.value?"visible":"hidden",v.zIndex=U.getMaxZIndex()||1050,v}),q=i.computed(()=>t.isSimpleTips?!0:t.showArrow),{delayedValue:V}=U.useDelayedRef(_,50);return i.onMounted(()=>{var v;f.value&&y(h.value),t.reference&&C(h.value),window.addEventListener("resize",W),(v=l.value)==null||v.focus()}),i.onUnmounted(()=>{document.body.removeEventListener("click",m),window.removeEventListener("resize",W),c.value=!1}),()=>i.createVNode(i.Teleport,{to:x},{default:()=>{var v;return[i.withDirectives(i.createVNode("div",{tabindex:"-1",ref:l,class:H.value,style:{...p.value,...V.value},onMousedown:M=>{M.stopPropagation()},onClick:M=>{M.stopPropagation()}},[q.value&&i.createVNode("div",{ref:a,class:"popover-arrow arrow",style:S.value},null),P.value&&i.createVNode("h3",{class:"popover-title popover-header"},[t.title]),i.createVNode("div",{class:B.value},[n.slots.default&&((v=n.slots)==null?void 0:v.default())])]),[[i.vShow,c.value]])]}})}}),N="FarrisVue_PopoverInstancesKey";window[N]=window[N]||new WeakMap;function F(t,n,a){t.stopPropagation();const l=n.value;l&&l.value&&!l.value.isShow&&(l.value.show(a),window[N].set(a,l.value))}function $(t,n,a){t.stopPropagation(),n.value.value.hide(),window[N].delete(a)}function it(t,n,a){t.stopPropagation();const l=n.value;l&&l.value&&(l.value.isShow?$(t,n,a):F(t,n,a))}function G(t,n,a){n.arg&&n.arg==="toggle"?it(t,n,a):F(t,n,a)}const J={mounted:(t,n,a)=>{n.modifiers.hover?(t.addEventListener("mouseenter",l=>F(l,n,t)),t.addEventListener("mouseleave",l=>$(l,n,t))):n.modifiers.click?t.addEventListener("click",l=>G(l,n,t)):t.addEventListener("click",l=>G(l,n,t)),t.classList.add("v-popover")},unMounted:(t,n,a)=>{}};I.install=t=>{t.component(I.name,I),t.directive("popover",J)},L.Popover=I,L.PopoverDirective=J,L.default=I,L.popoverProps=Z,Object.defineProperties(L,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(L,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("../common/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../common/index.umd.js"],i):(L=typeof globalThis<"u"?globalThis:L||self,i(L.popover={},L.Vue,L.common))})(this,function(L,i,U){"use strict";const Z={id:{type:String},arrowOffsetX:{type:Number,default:0},class:{type:String,default:""},customStyles:{type:Object,default:null},isSimpleTips:{type:Boolean,default:!1},fitContent:{type:Boolean,default:!1},host:{type:Object},leftBoundary:{type:Object},keepWidthWithReference:{type:Boolean,default:!1},minWidth:{type:Number,default:-1},offsetX:{type:Object,default:i.ref(0)},placement:{type:String,default:"bottom"},reference:{type:Object},rightBoundary:{type:Object},showArrow:{type:Boolean,default:!1},title:{type:String},visible:{type:Boolean,default:!1},zIndex:{type:Number,default:-1},limitContentBySpace:{type:Boolean,default:!1},beforeClose:{type:Function}};function tt(t){const n=t.host?t.host:"body",a=i.computed(()=>n==="body"?0:n?n.getBoundingClientRect().top:0),l=i.computed(()=>n==="body"?window.innerHeight:n?n.getBoundingClientRect().bottom:window.innerHeight),h=i.computed(()=>n==="body"?0:n?n.getBoundingClientRect().left:0),f=i.computed(()=>n==="body"?document.body.getBoundingClientRect().width:n?n.getBoundingClientRect().width-(t.rightBoundary?t.rightBoundary.getBoundingClientRect().width:0):document.body.getBoundingClientRect().width),P=i.computed(()=>n==="body"?window.innerHeight:n?n.getBoundingClientRect().height:window.innerHeight);return{host:n,hostLeft:h,hostTop:a,hostWidth:f,hostHeight:P,hostBottom:l}}function et(t,n,a,l){const h=i.ref(t.offsetX||0),f=i.ref(-1),P=i.ref(-1),g=i.ref(-1),x=i.ref(-1),T=i.ref(t.placement),b=i.ref(0),S=i.ref(0),p=i.ref(0),y=i.computed(()=>document.documentElement.scrollLeft),C=i.computed(()=>document.documentElement.scrollTop),{hostLeft:r,hostTop:m,hostWidth:W,hostHeight:H,hostBottom:B}=l;i.watch(()=>t.offsetX,e=>{h.value=e});const _=i.computed(()=>{const e={left:`${S.value}px`,top:`${p.value}px`,transform:`translateX(${h.value}px)`};return t.zIndex!==-1&&(e["z-index"]=t.zIndex),t.fitContent?t.keepWidthWithReference&&a.value&&f.value>=a.value.getBoundingClientRect().width&&(e.width=`${f.value}px`):f.value!==-1&&(e.width=`${f.value}px`),t.minWidth!==-1&&(e.minWidth=`${t.minWidth}px`),t.customStyles&&Object.assign(e,t.customStyles),P.value>0&&(e.maxHeight=P.value+"px"),e}),q=i.computed(()=>({left:`${b.value}px`,transform:`translateX(${t.arrowOffsetX}px)`}));function V(e){if(e&&t.keepWidthWithReference){const o=e.getBoundingClientRect();f.value=Math.max(t.minWidth,o.width)}}function v(e,o){const s=W.value-e.width-4;return s>0?s:o}function M(e,o){const s=H.value-e.height-4;return s>0?s:o}function X(e,o,s){const c=b.value,d=o.left-r.value+o.width/2+y.value,u=o.top-m.value-(e.height+s.height)+C.value;return{popoverLeft:d,popoverTop:u,arrowLeft:c}}function k(e,o,s){const c=o.top-m.value+(o.height+s.height)+C.value,d=M(e,c);return Math.min(c,d)}function z(e,o){const s=v(o,e),c=e<=s?b.value:e-s;return{popoverLeft:Math.min(e,s),arrowLeft:c,maxHeight:0}}function A(e,o){const s=v(o,e),c=e<=s?b.value:e-s;return{popoverLeft:e,arrowLeft:c,maxHeight:0}}function K(e,o,s){const c=o.left-r.value+y.value,{arrowLeft:d,popoverLeft:u}=A(c,e),{popoverTop:w}=X(e,o,s);return{popoverLeft:u,popoverTop:w,arrowLeft:d,maxHeight:0}}function lt(e,o,s){const c=o.left-r.value+o.width/2-(s.width/2-(e.left-r.value))+y.value,{arrowLeft:d,popoverLeft:u}=z(c,e),w=k(e,o,s);return{popoverLeft:u,popoverTop:w,arrowLeft:d,maxHeight:0}}function st(e,o,s){const c=o.left-r.value+y.value,{arrowLeft:d,popoverLeft:u}=z(c,e),w=k(e,o,s);return{popoverLeft:u,popoverTop:w,arrowLeft:d,maxHeight:0}}function at(e,o,s){const c=o.left-r.value;let d=0,u=0,w=0,O=0,j="bottom-left";window.innerWidth-c>e.width?d=c+y.value:(d=o.right-e.width+y.value,w=e.width-s.width-20);let E=0;if(t.limitContentBySpace){const $={topHeight:o.top-m.value-s.height-8,bottomHeight:B.value-o.bottom-s.height-8};E=Math.max($.topHeight,$.bottomHeight),e.height>E&&(O=E,a.value.classList.add("popover-limitmax"))}const R=O?Math.floor(O):e.height,D=o.top-m.value+(o.height+s.height);return B.value-D>R?u=D+C.value:(u=o.top-R-s.height+C.value,B.value-D>o.top?(u=D+C.value,R>o.top&&(u=B.value-R)):(u=u<0?0:u,j="top")),a.value.classList.add("popover-"+j,"bs-popover-"+j),{popoverLeft:d,popoverTop:u,arrowLeft:w,maxHeight:O}}function ut(e,o,s){const c=o.left+o.width,d=Math.max(o.top-(e.height/2-o.height/2),m.value);let u=m.value+H.value-e.height;u<0&&(u=d);const w=Math.min(d,u);return{popoverLeft:c,popoverTop:w,arrowLeft:0,maxHeight:0}}function rt(e,o,s){const c=o.left+o.width,d=Math.max(o.top-o.height,m.value);let u=m.value+H.value-e.height;u<0&&(u=d);const w=Math.min(d,u);return{popoverLeft:c,popoverTop:w,arrowLeft:0,maxHeight:0}}const ct=new Map([["top",X],["top-left",K],["bottom",lt],["bottom-left",st],["right",ut],["right-top",rt],["auto",at]]);function Y(e){var u;t.keepWidthWithReference&&V(e);const o=e.getBoundingClientRect();g.value=o.top,x.value=o.left;const s=n.value?n.value.getBoundingClientRect():{height:4,width:4},c=(u=a.value)==null?void 0:u.getBoundingClientRect();f.value=c.width;const d=ct.get(T.value);if(d){const{arrowLeft:w,popoverLeft:O,popoverTop:j,maxHeight:E}=d(c,o,s);b.value=w,S.value=O,p.value=j,P.value=E||-1}}function dt(e){if(e){const o=e.getBoundingClientRect();(o.left!==x.value||o.top!==g.value)&&Y(e)}}function pt(){T.value=t.placement,b.value=0,S.value=0,p.value=0,f.value=-1}return{arrowStyle:q,popoverStyle:_,position:T,popoverWidth:f,fitToReference:V,followToReferencePosition:dt,locateToReference:Y,resetPosition:pt}}function ot(t,n,a,l,h,f,P){const g=i.ref(t.visible),x=i.computed(()=>g.value),{fitToReference:T,locateToReference:b,resetPosition:S}=P;let p;async function y(){g.value&&(t.beforeClose&&typeof t.beforeClose=="function"&&!await t.beforeClose()||(g.value=!1,document.body.removeEventListener("click",p),document.body.removeEventListener("mousedown",p),document.body.removeEventListener("wheel",p,!0),document.removeEventListener("scroll",p),S(),n.emit("hidden")))}p=r=>{var H;if(!h.value)return;const m=h.value.contains(r.target);if(r.type==="scroll"||r.type==="wheel"&&m){y();return}if(r.target.closest(".time-picker-panel"))return;const W=(H=r.target)==null?void 0:H.closest(".popover");if(W&&l.value&&W===l.value){r.type!=="scroll"&&r.type!=="wheel"&&r.stopPropagation();return}if(!m&&g.value){const B=h.value.closest(".popover");B&&B.removeEventListener("click",p),y()}};async function C(r){if(l.value&&(t.showArrow===!1||t.showArrow&&a.value)&&r){g.value=!0,h.value=r,f.value&&T(r),await i.nextTick(),b(r),document.body.addEventListener("click",p),document.body.addEventListener("mousedown",p),document.body.addEventListener("wheel",p,!0),document.addEventListener("scroll",p),(top==null?void 0:top.document)!==document&&(top==null||top.document.addEventListener("mousedown",p));const m=r.closest(".popover");m&&m.addEventListener("click",p),n.emit("shown")}}return n.expose({hide:y,popoverRef:l,show:C,shown:x,isShow:g}),{showPopover:g,hidePopverOnClickBodyHandler:p}}function nt(t,n,a,l,h){const{popoverWidth:f,fitToReference:P,followToReferencePosition:g}=h;function x(){if(a.value){g(a.value);const T=a.value.getBoundingClientRect();l.value&&T.width!==f.value&&P(a.value)}}return{onResize:x}}const I=i.defineComponent({name:"FPopover",props:Z,emits:["shown","hidden"],setup(t,n){const a=i.ref(),l=i.ref(),h=i.ref(t.reference),f=i.ref(t.keepWidthWithReference),P=i.computed(()=>!!t.title),g=tt(t),{host:x}=g,T=et(t,a,l,g),{position:b,arrowStyle:S,popoverStyle:p,fitToReference:y,locateToReference:C}=T,{showPopover:r,hidePopverOnClickBodyHandler:m}=ot(t,n,a,l,h,f,T),{onResize:W}=nt(t,n,h,f,T),H=i.computed(()=>{let v=b.value;v==="top-left"&&(v="top");const M=`popover in popover-${v}`,X=`bs-popover-${v}`,k={"popover-fitcontent":t.fitContent,fade:!0};k[M]=!0,k[X]=!0;const z=(t.class||"").split(" ");return t.isSimpleTips&&z.unshift("popover-tips"),z.reduce((A,K)=>(A[K]=!0,A),k),k}),B=i.computed(()=>({"popover-content":!0,"popover-body":!0})),_=i.computed(()=>{const v={};return v.opacity=r.value?1:0,v.visibility=r.value?"visible":"hidden",v.zIndex=U.getMaxZIndex()||1060,v}),q=i.computed(()=>t.isSimpleTips?!0:t.showArrow),{delayedValue:V}=U.useDelayedRef(_,50);return i.onMounted(()=>{var v;f.value&&y(h.value),t.reference&&C(h.value),window.addEventListener("resize",W),(v=l.value)==null||v.focus()}),i.onUnmounted(()=>{document.body.removeEventListener("click",m),window.removeEventListener("resize",W),r.value=!1}),()=>i.createVNode(i.Teleport,{to:x},{default:()=>{var v;return[i.withDirectives(i.createVNode("div",{tabindex:"-1",ref:l,class:H.value,style:{...p.value,...V.value},onMousedown:M=>{M.stopPropagation()},onClick:M=>{M.stopPropagation()}},[q.value&&i.createVNode("div",{ref:a,class:"popover-arrow arrow",style:S.value},null),P.value&&i.createVNode("h3",{class:"popover-title popover-header"},[t.title]),i.createVNode("div",{class:B.value},[n.slots.default&&((v=n.slots)==null?void 0:v.default())])]),[[i.vShow,r.value]])]}})}}),N="FarrisVue_PopoverInstancesKey";window[N]=window[N]||new WeakMap;function F(t,n,a){t.stopPropagation();const l=n.value;l&&l.value&&!l.value.isShow&&(l.value.show(a),window[N].set(a,l.value))}function G(t,n,a){t.stopPropagation(),n.value.value.hide(),window[N].delete(a)}function it(t,n,a){t.stopPropagation();const l=n.value;l&&l.value&&(l.value.isShow?G(t,n,a):F(t,n,a))}function J(t,n,a){n.arg&&n.arg==="toggle"?it(t,n,a):F(t,n,a)}const Q={mounted:(t,n,a)=>{n.modifiers.hover?(t.addEventListener("mouseenter",l=>F(l,n,t)),t.addEventListener("mouseleave",l=>G(l,n,t))):n.modifiers.click?t.addEventListener("click",l=>J(l,n,t)):t.addEventListener("click",l=>J(l,n,t)),t.classList.add("v-popover")},unMounted:(t,n,a)=>{}};I.install=t=>{t.component(I.name,I),t.directive("popover",Q)},L.Popover=I,L.PopoverDirective=Q,L.default=I,L.popoverProps=Z,Object.defineProperties(L,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|