@farris/ui-vue 1.6.5-beta.8 → 1.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/components/avatar/index.esm.js +335 -335
  2. package/components/avatar/index.umd.cjs +1 -1
  3. package/components/button-edit/index.esm.js +6 -6
  4. package/components/button-edit/index.umd.cjs +1 -1
  5. package/components/combo-list/index.esm.js +139 -134
  6. package/components/combo-list/index.umd.cjs +1 -1
  7. package/components/common/index.esm.js +1 -1
  8. package/components/common/index.umd.cjs +1 -1
  9. package/components/component/index.esm.js +300 -300
  10. package/components/component/index.umd.cjs +1 -1
  11. package/components/condition/index.esm.js +7 -6
  12. package/components/condition/index.umd.cjs +1 -1
  13. package/components/content-container/index.esm.js +295 -295
  14. package/components/content-container/index.umd.cjs +1 -1
  15. package/components/data-grid/index.esm.js +99 -99
  16. package/components/data-grid/index.umd.cjs +1 -1
  17. package/components/data-view/index.esm.js +3407 -3338
  18. package/components/data-view/index.umd.cjs +1 -1
  19. package/components/date-picker/index.esm.js +833 -832
  20. package/components/date-picker/index.umd.cjs +1 -1
  21. package/components/designer-canvas/index.esm.js +5 -5
  22. package/components/designer-canvas/index.umd.cjs +1 -1
  23. package/components/dynamic-form/index.esm.js +173 -172
  24. package/components/dynamic-form/index.umd.cjs +1 -1
  25. package/components/events-editor/index.esm.js +637 -637
  26. package/components/events-editor/index.umd.cjs +3 -3
  27. package/components/expression-editor/index.esm.js +737 -732
  28. package/components/expression-editor/index.umd.cjs +4 -4
  29. package/components/filter-bar/index.esm.js +728 -706
  30. package/components/filter-bar/index.umd.cjs +1 -1
  31. package/components/filter-condition-editor/index.esm.js +670 -665
  32. package/components/filter-condition-editor/index.umd.cjs +2 -2
  33. package/components/flow-canvas/index.esm.js +205 -205
  34. package/components/flow-canvas/index.umd.cjs +1 -1
  35. package/components/language-textbox/index.esm.js +77 -76
  36. package/components/language-textbox/index.umd.cjs +1 -1
  37. package/components/list-nav/index.esm.js +4 -2
  38. package/components/list-nav/index.umd.cjs +1 -1
  39. package/components/list-view/index.esm.js +42 -40
  40. package/components/list-view/index.umd.cjs +2 -2
  41. package/components/lookup/index.esm.js +118 -118
  42. package/components/lookup/index.umd.cjs +1 -1
  43. package/components/mapping-editor/index.esm.js +482 -483
  44. package/components/mapping-editor/index.umd.cjs +1 -1
  45. package/components/message-box/index.esm.js +424 -424
  46. package/components/message-box/index.umd.cjs +1 -1
  47. package/components/modal/index.esm.js +276 -276
  48. package/components/modal/index.umd.cjs +1 -1
  49. package/components/number-range/index.esm.js +161 -161
  50. package/components/number-range/index.umd.cjs +1 -1
  51. package/components/number-spinner/index.esm.js +322 -316
  52. package/components/number-spinner/index.umd.cjs +1 -1
  53. package/components/order/index.esm.js +541 -534
  54. package/components/order/index.umd.cjs +2 -2
  55. package/components/page-header/index.esm.js +1 -1
  56. package/components/page-header/index.umd.cjs +1 -1
  57. package/components/popover/index.esm.js +58 -56
  58. package/components/popover/index.umd.cjs +1 -1
  59. package/components/property-panel/index.esm.js +216 -216
  60. package/components/property-panel/index.umd.cjs +2 -2
  61. package/components/query-solution/index.esm.js +489 -467
  62. package/components/query-solution/index.umd.cjs +3 -3
  63. package/components/radio-group/index.esm.js +30 -30
  64. package/components/radio-group/index.umd.cjs +1 -1
  65. package/components/response-layout/index.esm.js +282 -282
  66. package/components/response-layout/index.umd.cjs +1 -1
  67. package/components/response-layout-editor/index.esm.js +875 -873
  68. package/components/response-layout-editor/index.umd.cjs +1 -1
  69. package/components/response-toolbar/index.esm.js +1 -1
  70. package/components/response-toolbar/index.umd.cjs +1 -1
  71. package/components/schema-selector/index.esm.js +504 -496
  72. package/components/schema-selector/index.umd.cjs +6 -6
  73. package/components/search-box/index.esm.js +76 -72
  74. package/components/search-box/index.umd.cjs +1 -1
  75. package/components/section/index.esm.js +212 -212
  76. package/components/section/index.umd.cjs +1 -1
  77. package/components/sort-condition-editor/index.esm.js +382 -377
  78. package/components/sort-condition-editor/index.umd.cjs +2 -2
  79. package/components/tabs/index.esm.js +584 -582
  80. package/components/tabs/index.umd.cjs +2 -2
  81. package/components/textarea/index.esm.js +362 -362
  82. package/components/textarea/index.umd.cjs +2 -2
  83. package/components/time-picker/index.css +1 -0
  84. package/components/time-picker/index.esm.js +9799 -0
  85. package/components/time-picker/index.umd.cjs +1 -0
  86. package/components/time-picker/package.json +8 -0
  87. package/components/time-picker/style.js +6 -0
  88. package/components/transfer/index.esm.js +81 -79
  89. package/components/transfer/index.umd.cjs +2 -2
  90. package/components/tree-grid/index.esm.js +100 -100
  91. package/components/tree-grid/index.umd.cjs +1 -1
  92. package/components/tree-view/index.esm.js +2361 -2279
  93. package/components/tree-view/index.umd.cjs +1 -1
  94. package/components/video/index.esm.js +220 -220
  95. package/components/video/index.umd.cjs +1 -1
  96. package/designer/button-edit/index.css +1 -0
  97. package/designer/button-edit/index.esm.js +4856 -0
  98. package/designer/button-edit/index.umd.cjs +1 -0
  99. package/designer/checkbox/index.esm.js +254 -0
  100. package/designer/checkbox/index.umd.cjs +1 -0
  101. package/designer/checkbox-group/index.esm.js +381 -0
  102. package/designer/checkbox-group/index.umd.cjs +1 -0
  103. package/designer/data-grid/index.css +1 -0
  104. package/designer/data-grid/index.esm.js +15445 -0
  105. package/designer/data-grid/index.umd.cjs +23 -0
  106. package/designer/data-view/index.esm.js +854 -0
  107. package/designer/data-view/index.umd.cjs +38 -0
  108. package/designer/drawer/index.css +1 -0
  109. package/designer/drawer/index.esm.js +525 -0
  110. package/designer/drawer/index.umd.cjs +1 -0
  111. package/designer/farris-designer.all.esm.js +22331 -0
  112. package/designer/farris-designer.all.umd.cjs +34 -0
  113. package/designer/index.css +1 -0
  114. package/designer/input-group/index.esm.js +1099 -0
  115. package/designer/input-group/index.umd.cjs +1 -0
  116. package/designer/list-view/index.css +1 -0
  117. package/designer/list-view/index.esm.js +4685 -0
  118. package/designer/list-view/index.umd.cjs +40 -0
  119. package/designer/radio-group/index.css +1 -0
  120. package/designer/radio-group/index.esm.js +6989 -0
  121. package/designer/radio-group/index.umd.cjs +1 -0
  122. package/designer/tree-grid/index.esm.js +1099 -0
  123. package/designer/tree-grid/index.umd.cjs +1 -0
  124. package/farris.all.esm.js +13299 -13177
  125. package/farris.all.umd.cjs +25 -25
  126. package/locales/data-grid/ui/en.json +4 -3
  127. package/locales/data-grid/ui/zh-CHS.json +2 -1
  128. package/locales/data-grid/ui/zh-CHT.json +2 -1
  129. package/locales/designer/en.json +9 -7
  130. package/locales/designer/zh-CHS.json +4 -2
  131. package/locales/designer/zh-CHT.json +4 -2
  132. package/locales/ui/en.json +9 -7
  133. package/locales/ui/zh-CHS.json +4 -2
  134. package/locales/ui/zh-CHT.json +4 -2
  135. package/package.json +1 -1
  136. package/types/combo-list/src/property-config/combo-list.property-config.d.ts +0 -6
  137. package/types/data-view/composition/types.d.ts +10 -4
@@ -1,4 +1,4 @@
1
- import { ref as g, computed as w, watch as at, nextTick as st, defineComponent as ut, onMounted as ct, onUnmounted as rt, createVNode as z, Teleport as vt, withDirectives as pt, vShow as dt } from "vue";
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 M(e, o) {
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 c = b.value, r = o.left - u.value + o.width / 2 + L.value, s = o.top - h.value - (e.height + l.height) + C.value;
93
- return { popoverLeft: r, popoverTop: s, arrowLeft: c };
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 k(e, o, l) {
96
- const c = o.top - h.value + (o.height + l.height) + C.value, r = M(e, c);
97
- return Math.min(c, r);
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), c = e <= l ? b.value : e - l;
101
- return { popoverLeft: Math.min(e, l), arrowLeft: c, maxHeight: 0 };
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), c = e <= l ? b.value : e - l;
105
- return { popoverLeft: e, arrowLeft: c, maxHeight: 0 };
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 c = o.left - u.value + L.value, { arrowLeft: r, popoverLeft: s } = R(c, e), { popoverTop: y } = A(e, o, l);
109
- return { popoverLeft: s, popoverTop: y, arrowLeft: r, maxHeight: 0 };
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 c = o.left - u.value + L.value, { arrowLeft: r, popoverLeft: s } = j(c, e), y = k(e, o, l);
117
- return { popoverLeft: s, popoverTop: y, arrowLeft: r, maxHeight: 0 };
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 c = o.left - u.value;
121
- let r = 0, s = 0, y = 0, W = 0, E = "bottom-left";
122
- window.innerWidth - c > e.width ? r = c + L.value : (r = o.right - e.width + L.value, y = e.width - l.width - 20);
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 q = { topHeight: o.top - h.value - l.height - 8, bottomHeight: B.value - o.bottom - l.height - 8 };
126
- I = Math.max(q.topHeight, q.bottomHeight), e.height > I && (W = I, a.value.classList.add("popover-limitmax"));
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: r, popoverTop: s, arrowLeft: y, maxHeight: W };
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 c = o.left + o.width, r = Math.max(o.top - (e.height / 2 - o.height / 2), h.value);
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 = r);
135
- const y = Math.min(r, s);
136
- return { popoverLeft: c, popoverTop: y, arrowLeft: 0, maxHeight: 0 };
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 c = o.left + o.width, r = Math.max(o.top - o.height, h.value);
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 = r);
142
- const y = Math.min(r, s);
143
- return { popoverLeft: c, popoverTop: y, arrowLeft: 0, maxHeight: 0 };
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", Q],
149
- ["bottom-left", Y],
148
+ ["bottom", Y],
149
+ ["bottom-left", $],
150
150
  ["right", et],
151
151
  ["right-top", ot],
152
152
  ["auto", tt]
153
153
  ]);
154
- function $(e) {
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 }, c = (s = a.value) == null ? void 0 : s.getBoundingClientRect();
160
- p.value = c.width;
161
- const r = nt.get(T.value);
162
- if (r) {
163
- const { arrowLeft: y, popoverLeft: W, popoverTop: E, maxHeight: I } = r(c, o, l);
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) && $(e);
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,13 +252,13 @@ 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 M = `popover in popover-${d}`, A = `bs-popover-${d}`, k = {
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[M] = !0, k[A] = !0;
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), k), k;
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
@@ -266,10 +268,10 @@ const Z = /* @__PURE__ */ ut({
266
268
  }), K = w(() => t.isSimpleTips ? !0 : t.showArrow), {
267
269
  delayedValue: X
268
270
  } = ht(V, 50);
269
- return ct(() => {
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
- }), rt(() => {
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: (M) => {
288
- M.stopPropagation();
289
+ onMousedown: (k) => {
290
+ k.stopPropagation();
289
291
  },
290
- onClick: (M) => {
291
- M.stopPropagation();
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 J(t, n, a) {
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 ? J(t, n, a) : _(t, n, a));
320
+ i && i.value && (i.value.isShow ? Q(t, n, a) : _(t, n, a));
319
321
  }
320
- function G(t, n, a) {
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) => J(i, n, t))) : n.modifiers.click ? t.addEventListener("click", (i) => G(i, n, t)) : t.addEventListener("click", (i) => G(i, n, t)), t.classList.add("v-popover");
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()||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),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"}})});