x-next 1.10.0 → 1.11.0

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 (182) hide show
  1. package/AI_CODING.md +97 -0
  2. package/AI_USAGE/catalog.md +111 -0
  3. package/AI_USAGE/components/alert.md +33 -0
  4. package/AI_USAGE/components/bar-chart.md +46 -0
  5. package/AI_USAGE/components/button.md +35 -0
  6. package/AI_USAGE/components/checkbox.md +34 -0
  7. package/AI_USAGE/components/color-picker.md +36 -0
  8. package/AI_USAGE/components/config-provider.md +58 -0
  9. package/AI_USAGE/components/date-picker.md +34 -0
  10. package/AI_USAGE/components/dialog.md +37 -0
  11. package/AI_USAGE/components/dropdown.md +38 -0
  12. package/AI_USAGE/components/empty.md +30 -0
  13. package/AI_USAGE/components/input.md +32 -0
  14. package/AI_USAGE/components/line-chart.md +45 -0
  15. package/AI_USAGE/components/message-box.md +39 -0
  16. package/AI_USAGE/components/message.md +36 -0
  17. package/AI_USAGE/components/notification.md +37 -0
  18. package/AI_USAGE/components/pagination.md +32 -0
  19. package/AI_USAGE/components/pie-chart.md +55 -0
  20. package/AI_USAGE/components/popconfirm.md +33 -0
  21. package/AI_USAGE/components/popover.md +35 -0
  22. package/AI_USAGE/components/progress.md +32 -0
  23. package/AI_USAGE/components/radio.md +35 -0
  24. package/AI_USAGE/components/rate.md +30 -0
  25. package/AI_USAGE/components/select.md +38 -0
  26. package/AI_USAGE/components/slider.md +34 -0
  27. package/AI_USAGE/components/steps.md +33 -0
  28. package/AI_USAGE/components/switch.md +32 -0
  29. package/AI_USAGE/components/tabs.md +33 -0
  30. package/AI_USAGE/components/textarea.md +31 -0
  31. package/AI_USAGE/components/time-picker.md +34 -0
  32. package/AI_USAGE/components/upload.md +60 -0
  33. package/AI_USAGE/core.md +37 -0
  34. package/AI_USAGE/index.md +52 -0
  35. package/AI_USAGE/recipes/form-on-demand.md +42 -0
  36. package/AI_USAGE.md +173 -46
  37. package/CHANGELOG.md +36 -1
  38. package/README.md +15 -2
  39. package/dist/_container/resize-trigger.vue.d.ts +1 -1
  40. package/dist/_hooks/use-dialog-focus.d.ts +7 -0
  41. package/dist/_hooks/use-pointer-drag.d.ts +6 -0
  42. package/dist/_hooks/use-popup-close.d.ts +11 -0
  43. package/dist/_hooks/use-popup-theme.d.ts +5 -0
  44. package/dist/_utils/palette.d.ts +2 -0
  45. package/dist/components/_components/picker/input-range.vue.d.ts +1 -3
  46. package/dist/components/_components/picker/input.vue.d.ts +1 -3
  47. package/dist/components/_components/select-view/select-view.d.ts +9 -0
  48. package/dist/components/alert/Alert.vue.d.ts +1 -1
  49. package/dist/components/alert/index.d.ts +3 -3
  50. package/dist/components/bar-chart/BarChart.d.ts +3 -3
  51. package/dist/components/bar-chart/index.d.ts +9 -9
  52. package/dist/components/color-picker/ColorPicker.d.ts +2 -1
  53. package/dist/components/color-picker/index.d.ts +2 -0
  54. package/dist/components/color-picker/panel.d.ts +6 -0
  55. package/dist/components/config-provider/context.d.ts +7 -1
  56. package/dist/components/date-picker/DatePicker.vue.d.ts +9 -12
  57. package/dist/components/date-picker/index.d.ts +19 -27
  58. package/dist/components/drawer/index.d.ts +51 -9
  59. package/dist/components/drawer/src/Drawer.vue.d.ts +19 -4
  60. package/dist/components/dropdown/Dropdown.vue.d.ts +6 -3
  61. package/dist/components/dropdown/DropdownButton.vue.d.ts +6 -3
  62. package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +6 -3
  63. package/dist/components/dropdown/dropdown-panel.vue.d.ts +6 -3
  64. package/dist/components/dropdown/index.d.ts +36 -18
  65. package/dist/components/form-select/Select.d.ts +18 -5
  66. package/dist/components/form-select/SelectDropdown.vue.d.ts +6 -3
  67. package/dist/components/form-select/SelectOption.vue.d.ts +1 -0
  68. package/dist/components/form-select/SelectOptionGroup.vue.d.ts +1 -0
  69. package/dist/components/form-select/hooks/use-options.d.ts +1 -1
  70. package/dist/components/form-select/hooks/use-select.d.ts +1 -1
  71. package/dist/components/form-select/index.d.ts +57 -17
  72. package/dist/components/form-select/interface.d.ts +8 -0
  73. package/dist/components/form-slider/Slider.vue.d.ts +1 -1
  74. package/dist/components/form-slider/index.d.ts +3 -3
  75. package/dist/components/form-textarea/Textarea.vue.d.ts +2 -4
  76. package/dist/components/form-textarea/index.d.ts +6 -12
  77. package/dist/components/image/Image.vue.d.ts +2 -4
  78. package/dist/components/image/index.d.ts +6 -12
  79. package/dist/components/layout/LayoutSidebar.vue.d.ts +5 -5
  80. package/dist/components/layout/index.d.ts +10 -10
  81. package/dist/components/line-chart/LineChart.d.ts +3 -3
  82. package/dist/components/line-chart/index.d.ts +9 -9
  83. package/dist/components/menu/Menu.d.ts +6 -3
  84. package/dist/components/menu/base-menu.vue.d.ts +6 -3
  85. package/dist/components/menu/index.d.ts +12 -6
  86. package/dist/components/menu/sub-menu-pop.vue.d.ts +6 -3
  87. package/dist/components/network/Network.vue.d.ts +1 -1
  88. package/dist/components/network/index.d.ts +3 -3
  89. package/dist/components/pagination/page-options.vue.d.ts +60 -32
  90. package/dist/components/pie-chart/PieChart.d.ts +1 -1
  91. package/dist/components/pie-chart/index.d.ts +3 -3
  92. package/dist/components/resize-box/ResizeBox.vue.d.ts +2 -2
  93. package/dist/components/resize-box/index.d.ts +5 -5
  94. package/dist/components/scrollbar-v2/Scrollbar.vue.d.ts +2 -1
  95. package/dist/components/scrollbar-v2/index.d.ts +6 -3
  96. package/dist/components/table/Table.d.ts +1 -1
  97. package/dist/components/table/index.d.ts +3 -3
  98. package/dist/components/tabs/Tabs.d.ts +1 -1
  99. package/dist/components/tabs/index.d.ts +3 -3
  100. package/dist/components/time-picker/TimeColumn.vue.d.ts +6 -3
  101. package/dist/components/time-picker/TimePanel.vue.d.ts +6 -3
  102. package/dist/components/time-picker/TimePicker.vue.d.ts +9 -12
  103. package/dist/components/time-picker/index.d.ts +19 -27
  104. package/dist/components/trend-chart/components/TrendChart.d.ts +5 -5
  105. package/dist/components/trend-chart/components/trend-chart-curve.d.ts +1 -1
  106. package/dist/components/trend-chart/index.d.ts +14 -14
  107. package/dist/components/trigger/interface.d.ts +2 -0
  108. package/dist/components/virtual-list-v2/virtual-list.vue.d.ts +7 -4
  109. package/dist/es/_hooks/use-dialog-focus.js +69 -0
  110. package/dist/es/_hooks/use-pointer-drag.js +18 -0
  111. package/dist/es/_hooks/use-popup-close.js +27 -0
  112. package/dist/es/_hooks/use-popup-manager.js +26 -24
  113. package/dist/es/_hooks/use-popup-theme.js +18 -0
  114. package/dist/es/_hooks/use-teleport-container.js +9 -10
  115. package/dist/es/_utils/palette.js +57 -52
  116. package/dist/es/components/_components/select-view/select-view.js +89 -78
  117. package/dist/es/components/button/Button.js +1 -1
  118. package/dist/es/components/color-picker/ColorPicker.js +131 -102
  119. package/dist/es/components/color-picker/gradient-slider.js +38 -40
  120. package/dist/es/components/color-picker/panel.js +221 -192
  121. package/dist/es/components/color-picker/sv-panel.js +51 -50
  122. package/dist/es/components/config-provider/ConfigProvider.js +58 -41
  123. package/dist/es/components/dialog/Dialog.js +133 -186
  124. package/dist/es/components/drawer/src/Drawer.vue.js +59 -51
  125. package/dist/es/components/drawer/src/Drawer.vue2.js +117 -107
  126. package/dist/es/components/form/FormItem.vue.js +12 -12
  127. package/dist/es/components/form-input-tag/InputTag.js +1 -1
  128. package/dist/es/components/form-select/Select.js +348 -300
  129. package/dist/es/components/form-select/SelectDropdown.vue.js +7 -7
  130. package/dist/es/components/form-select/SelectOption.vue.js +22 -17
  131. package/dist/es/components/form-select/SelectOption.vue2.js +59 -51
  132. package/dist/es/components/form-select/SelectOptionGroup.vue.js +17 -13
  133. package/dist/es/components/form-select/SelectOptionGroup.vue2.js +8 -5
  134. package/dist/es/components/form-select/hooks/use-options.js +40 -40
  135. package/dist/es/components/form-select/hooks/use-select.js +76 -71
  136. package/dist/es/components/form-switch/Switch.vue.js +24 -24
  137. package/dist/es/components/image/Image.vue.js +12 -12
  138. package/dist/es/components/link/Link.vue.js +6 -6
  139. package/dist/es/components/menu/sub-menu-inline.vue.js +11 -11
  140. package/dist/es/components/menu/sub-menu-pop.vue.js +12 -12
  141. package/dist/es/components/notification/Notification.js +59 -59
  142. package/dist/es/components/resize-box/ResizeBox.vue.js +19 -22
  143. package/dist/es/components/skeleton/Skeleton.vue.js +9 -9
  144. package/dist/es/components/tag/Tag.vue.js +7 -7
  145. package/dist/es/components/trigger/Trigger.js +171 -163
  146. package/dist/es/style.css +1 -1
  147. package/dist/index.cjs +3 -3
  148. package/dist/index.umd.js +3 -3
  149. package/dist/style/bar-chart.js +1 -0
  150. package/dist/style/base.css +1 -1
  151. package/dist/style/button.css +1 -1
  152. package/dist/style/color-picker.css +1 -1
  153. package/dist/style/color-picker.js +4 -0
  154. package/dist/style/date-picker.js +4 -0
  155. package/dist/style/dependencies.json +296 -0
  156. package/dist/style/dialog.js +2 -0
  157. package/dist/style/drawer.js +3 -0
  158. package/dist/style/dropdown.js +5 -0
  159. package/dist/style/form-checkbox.css +1 -1
  160. package/dist/style/form-input-number.js +2 -0
  161. package/dist/style/form-input.css +1 -1
  162. package/dist/style/form-input.js +1 -0
  163. package/dist/style/form-select.js +5 -0
  164. package/dist/style/form-slider.js +5 -0
  165. package/dist/style/form.js +3 -0
  166. package/dist/style/heatmap.js +1 -0
  167. package/dist/style/image.js +2 -0
  168. package/dist/style/layout.js +1 -0
  169. package/dist/style/line-chart.js +1 -0
  170. package/dist/style/menu.js +3 -0
  171. package/dist/style/message-box.js +3 -0
  172. package/dist/style/pagination.js +9 -0
  173. package/dist/style/pie-chart.js +1 -0
  174. package/dist/style/popconfirm.js +3 -0
  175. package/dist/style/popover.js +1 -0
  176. package/dist/style/popup.js +2 -0
  177. package/dist/style/table.js +12 -0
  178. package/dist/style/time-picker.js +3 -0
  179. package/dist/style/tooltip.js +1 -0
  180. package/dist/style/upload.js +4 -0
  181. package/dist/style.css +1 -1
  182. package/package.json +17 -7
@@ -1,19 +1,19 @@
1
- import { defineComponent as Ee, toRefs as Oe, computed as P, inject as Be, ref as i, provide as Fe, reactive as Ae, watch as F, nextTick as I, onMounted as Le, onUpdated as ke, onDeactivated as De, onBeforeUnmount as ze, createVNode as c, Fragment as Ve, Teleport as je, mergeProps as Ne, Transition as We, withDirectives as xe, vShow as Ie } from "vue";
2
- import { getElementScrollRect as ne, getPopupStyle as $e, getTransformOrigin as Ge, getArrowStyle as He, getScrollElements as Ue } from "./utils.js";
3
- import ue from "../../_container/resize-observer-v2.js";
4
- import { on as $, off as ae } from "../../_utils/dom.js";
5
- import { isEmptyChildren as Ke, mergeFirstChild as Xe } from "../../_utils/vue-eco.js";
6
- import Ye from "../../_hooks/use-pick-slots.js";
7
- import { triggerInjectionKey as ie } from "./context.js";
8
- import { throttleByRaf as _e } from "../../_utils/throttle-by-raf.js";
9
- import qe from "../../_hooks/use-popup-manager.js";
10
- import { useResizeObserver as Je } from "../../_hooks/use-resize-observer.js";
11
- import Qe from "../../_container/client-only.js";
12
- import { useTeleportContainer as Ze } from "../../_hooks/use-teleport-container.js";
13
- import { useFirstElement as eo } from "../../_hooks/use-first-element.js";
14
- import { omit as oo } from "../../_utils/omit.js";
15
- import { getClassNameMixin as to } from "../../_utils/config.js";
16
- const lo = ["onClick", "onMouseenter", "onMouseleave", "onFocusin", "onFocusout", "onContextmenu"], So = /* @__PURE__ */ Ee({
1
+ import { defineComponent as Fe, toRefs as Ae, computed as L, inject as Le, ref as i, provide as ke, reactive as De, watch as P, nextTick as k, onMounted as je, onUpdated as ze, onDeactivated as Ne, onBeforeUnmount as Ve, createVNode as c, Fragment as We, Teleport as xe, mergeProps as Ie, Transition as $e, withDirectives as Ge, vShow as He } from "vue";
2
+ import { getElementScrollRect as ae, getPopupStyle as Ue, getTransformOrigin as Ke, getArrowStyle as Xe, getScrollElements as ie } from "./utils.js";
3
+ import se from "../../_container/resize-observer-v2.js";
4
+ import { on as $, off as ce } from "../../_utils/dom.js";
5
+ import { isEmptyChildren as Ye, mergeFirstChild as _e } from "../../_utils/vue-eco.js";
6
+ import qe from "../../_hooks/use-pick-slots.js";
7
+ import { triggerInjectionKey as re } from "./context.js";
8
+ import { throttleByRaf as Je } from "../../_utils/throttle-by-raf.js";
9
+ import Qe from "../../_hooks/use-popup-manager.js";
10
+ import { useResizeObserver as Ze } from "../../_hooks/use-resize-observer.js";
11
+ import eo from "../../_container/client-only.js";
12
+ import { useTeleportContainer as oo } from "../../_hooks/use-teleport-container.js";
13
+ import { usePopupTheme as to } from "../../_hooks/use-popup-theme.js";
14
+ import { useFirstElement as lo } from "../../_hooks/use-first-element.js";
15
+ import { getClassNameMixin as no } from "../../_utils/config.js";
16
+ const uo = ["onClick", "onMouseenter", "onMouseleave", "onFocusin", "onFocusout", "onContextmenu"], Ro = /* @__PURE__ */ Fe({
17
17
  name: "Trigger",
18
18
  inheritAttrs: !1,
19
19
  props: {
@@ -329,33 +329,36 @@ const lo = ["onClick", "onMouseenter", "onMouseleave", "onFocusin", "onFocusout"
329
329
  */
330
330
  setup(o, {
331
331
  emit: C,
332
- slots: f,
332
+ slots: v,
333
333
  attrs: n
334
334
  }) {
335
335
  const {
336
- popupContainer: se
337
- } = Oe(o), b = to("trigger"), ce = P(() => oo(n, lo)), m = P(() => [].concat(o.trigger)), A = /* @__PURE__ */ new Set(), u = Be(ie, void 0), {
338
- children: M,
339
- firstElement: g
340
- } = eo(), v = i(), G = i(o.defaultPopupVisible), E = i(o.position), H = i({}), U = i({}), K = i({}), S = i(!1), re = i(), r = i({
336
+ popupContainer: de
337
+ } = Ae(o), b = no("trigger"), {
338
+ popupThemeStyle: fe,
339
+ popupThemeName: me
340
+ } = to(), ve = () => Object.fromEntries(Object.entries(n).filter(([e]) => ![...uo, "class", "style"].includes(e))), p = L(() => [].concat(o.trigger)), D = /* @__PURE__ */ new Set(), u = Le(re, void 0), {
341
+ children: E,
342
+ firstElement: T
343
+ } = lo(), f = i(), G = i(o.defaultPopupVisible), M = i(o.position), H = i({}), U = i({}), K = i({}), S = i(!1), pe = i(), r = i({
341
344
  top: 0,
342
345
  left: 0
343
- }), L = /* @__PURE__ */ new Map(), l = P(() => o.popupVisible ?? G.value), {
344
- teleportContainer: de,
345
- containerRef: k
346
- } = Ze({
347
- popupContainer: se,
346
+ }), j = /* @__PURE__ */ new Map(), l = L(() => o.popupVisible ?? G.value), {
347
+ teleportContainer: ye,
348
+ containerRef: O
349
+ } = oo({
350
+ popupContainer: de,
348
351
  visible: l,
349
352
  documentContainer: !0
350
353
  }), {
351
- zIndex: fe
352
- } = qe("popup", {
354
+ zIndex: he
355
+ } = Qe("popup", {
353
356
  visible: l
354
357
  });
355
- let T = 0, p = !1;
356
- const me = () => {
357
- T && (window.clearTimeout(T), T = 0);
358
- }, D = (e) => {
358
+ let g = 0, y = !1;
359
+ const X = () => {
360
+ g && (window.clearTimeout(g), g = 0);
361
+ }, z = (e) => {
359
362
  if (o.alignPoint) {
360
363
  const {
361
364
  pageX: t,
@@ -366,12 +369,12 @@ const lo = ["onClick", "onMouseenter", "onMouseleave", "onFocusin", "onFocusout"
366
369
  left: t
367
370
  };
368
371
  }
369
- }, X = () => {
372
+ }, Y = () => {
370
373
  S.value = !0;
371
- }, y = () => {
372
- if (!g.value || !v.value || !k.value)
374
+ }, m = () => {
375
+ if (!T.value || !f.value || !O.value)
373
376
  return;
374
- const e = k.value.getBoundingClientRect(), t = o.alignPoint ? {
377
+ const e = O.value.getBoundingClientRect(), t = o.alignPoint ? {
375
378
  top: r.value.top,
376
379
  bottom: r.value.top,
377
380
  left: r.value.left,
@@ -382,214 +385,219 @@ const lo = ["onClick", "onMouseenter", "onMouseleave", "onFocusin", "onFocusout"
382
385
  scrollRight: r.value.left,
383
386
  width: 0,
384
387
  height: 0
385
- } : ne(g.value, e), a = () => (
388
+ } : ae(T.value, e), a = () => (
386
389
  // @ts-ignore
387
- ne(v.value, e)
390
+ ae(f.value, e)
388
391
  ), d = a(), {
389
392
  style: h,
390
393
  position: w
391
- } = $e(o.position, e, t, d, {
394
+ } = Ue(o.position, e, t, d, {
392
395
  offset: o.popupOffset,
393
396
  translate: o.popupTranslate,
394
397
  customStyle: o.popupStyle,
395
398
  autoFitPosition: o.autoFitPosition
396
399
  });
397
400
  o.autoFitTransformOrigin && (U.value = {
398
- transformOrigin: Ge(w)
399
- }), o.autoFitPopupMinWidth ? h.minWidth = `${t.width}px` : o.autoFitPopupWidth && (h.width = `${t.width}px`), E.value !== w && (E.value = w), H.value = h, o.showArrow ? I(() => {
400
- K.value = He(w, t, a(), {
401
+ transformOrigin: Ke(w)
402
+ }), o.autoFitPopupMinWidth ? h.minWidth = `${t.width}px` : o.autoFitPopupWidth && (h.width = `${t.width}px`), M.value !== w && (M.value = w), H.value = h, o.showArrow ? k(() => {
403
+ K.value = Xe(w, t, a(), {
401
404
  customStyle: o.arrowStyle
402
- }), X();
403
- }) : X();
405
+ }), Y();
406
+ }) : Y();
404
407
  }, s = (e, t) => {
405
- const a = T !== 0;
408
+ const a = g !== 0;
406
409
  if (e === l.value && !a)
407
410
  return;
408
411
  const d = () => {
409
- e && (S.value = !1), G.value = e, C("update:popupVisible", e), C("popupVisibleChange", e), e && I(() => {
410
- y();
412
+ e && (S.value = !1), G.value = e, C("update:popupVisible", e), C("popupVisibleChange", e), e && k(() => {
413
+ m();
411
414
  });
412
415
  };
413
- if (me(), t) {
414
- e !== l.value && (T = window.setTimeout(d, t));
416
+ if (X(), t) {
417
+ e !== l.value && (g = window.setTimeout(d, t));
415
418
  return;
416
419
  }
417
420
  e === l.value && a || d();
418
- }, ve = (e) => {
419
- var t;
420
- (t = n.onClick) == null || t.call(n, e), !(o.disabled || l.value && !o.clickToClose) && (m.value.includes("click") ? (D(e), s(!l.value)) : m.value.includes("contextMenu") && l.value && s(!1));
421
- }, Y = (e) => {
421
+ }, we = (e) => {
422
422
  var t;
423
- (t = n.onMouseenter) == null || t.call(n, e), !(o.disabled || !m.value.includes("hover")) && (D(e), s(!0, o.mouseEnterDelay));
423
+ (t = n.onClick) == null || t.call(n, e), !(o.disabled || l.value && !o.clickToClose) && (p.value.includes("click") ? (z(e), s(!l.value)) : p.value.includes("contextMenu") && l.value && s(!1));
424
424
  }, _ = (e) => {
425
- u == null || u.onMouseenter(e), Y(e);
426
- }, q = (e) => {
427
425
  var t;
428
- (t = n.onMouseleave) == null || t.call(n, e), !(o.disabled || !m.value.includes("hover")) && s(!1, o.mouseLeaveDelay);
426
+ (t = n.onMouseenter) == null || t.call(n, e), !(o.disabled || !p.value.includes("hover")) && (z(e), s(!0, o.mouseEnterDelay));
427
+ }, q = (e) => {
428
+ u == null || u.onMouseenter(e), _(e);
429
429
  }, J = (e) => {
430
- u == null || u.onMouseleave(e), q(e);
431
- }, pe = (e) => {
432
430
  var t;
433
- (t = n.onFocusin) == null || t.call(n, e), !(o.disabled || !m.value.includes("focus")) && s(!0, o.focusDelay);
434
- }, ye = (e) => {
431
+ (t = n.onMouseleave) == null || t.call(n, e), !(o.disabled || !p.value.includes("hover")) && s(!1, o.mouseLeaveDelay);
432
+ }, Q = (e) => {
433
+ u == null || u.onMouseleave(e), J(e);
434
+ }, Ce = (e) => {
435
+ var t;
436
+ (t = n.onFocusin) == null || t.call(n, e), !(o.disabled || !p.value.includes("focus")) && s(!0, o.focusDelay);
437
+ }, be = (e) => {
435
438
  var t;
436
- (t = n.onFocusout) == null || t.call(n, e), !(o.disabled || !m.value.includes("focus")) && o.blurToClose && s(!1);
437
- }, he = (e) => {
439
+ (t = n.onFocusout) == null || t.call(n, e), !(o.disabled || !p.value.includes("focus")) && o.blurToClose && s(!1);
440
+ }, Te = (e) => {
438
441
  var t;
439
- (t = n.onContextmenu) == null || t.call(n, e), !(o.disabled || !m.value.includes("contextMenu") || l.value && !o.clickToClose) && (D(e), s(!l.value), e.preventDefault());
442
+ (t = n.onContextmenu) == null || t.call(n, e), !(o.disabled || !p.value.includes("contextMenu") || l.value && !o.clickToClose) && (z(e), s(!l.value), e.preventDefault());
440
443
  };
441
- Fe(ie, Ae({
442
- onMouseenter: _,
443
- onMouseleave: J,
444
+ ke(re, De({
445
+ onMouseenter: q,
446
+ onMouseleave: Q,
444
447
  addChildRef: (e) => {
445
- A.add(e), u == null || u.addChildRef(e);
448
+ D.add(e), u == null || u.addChildRef(e);
446
449
  },
447
450
  removeChildRef: (e) => {
448
- A.delete(e), u == null || u.removeChildRef(e);
451
+ D.delete(e), u == null || u.removeChildRef(e);
449
452
  }
450
453
  }));
451
- const z = () => {
452
- ae(document.documentElement, "mousedown", j), p = !1;
453
- }, V = Ye(f, "content"), we = P(() => {
454
+ const N = () => {
455
+ ce(document.documentElement, "mousedown", W), y = !1;
456
+ }, V = qe(v, "content"), Se = L(() => {
454
457
  var e;
455
- return o.hideEmpty && Ke((e = V.value) == null ? void 0 : e.call(V));
456
- }), j = (e) => {
458
+ return o.hideEmpty && Ye((e = V.value) == null ? void 0 : e.call(V));
459
+ }), W = (e) => {
457
460
  var t, a, d;
458
- if (!((t = g.value) != null && t.contains(e.target) || (a = v.value) != null && a.contains(e.target))) {
459
- for (const h of A)
461
+ if (!((t = T.value) != null && t.contains(e.target) || (a = f.value) != null && a.contains(e.target))) {
462
+ for (const h of D)
460
463
  if ((d = h.value) != null && d.contains(e.target))
461
464
  return;
462
- z(), s(!1);
465
+ N(), s(!1);
463
466
  }
464
- }, Ce = (e, t) => {
467
+ }, ge = (e, t) => {
465
468
  const [a, d] = e, {
466
469
  scrollTop: h,
467
470
  scrollLeft: w
468
471
  } = t;
469
472
  return Math.abs(h - a) >= o.scrollToCloseDistance || Math.abs(w - d) >= o.scrollToCloseDistance;
470
- }, Q = (e) => {
473
+ }, Z = (e) => {
471
474
  if (!l.value) return;
472
- const t = L.get(e);
473
- o.scrollToClose && t && Ce(t, e) ? s(!1) : o.updateAtScroll && oe();
474
- }, Z = (e) => Q(e.currentTarget), ee = () => Q(document.scrollingElement ?? document.documentElement), oe = _e(() => {
475
- l.value && y();
475
+ const t = j.get(e);
476
+ o.scrollToClose && t && ge(t, e) ? s(!1) : o.updateAtScroll && te();
477
+ }, ee = (e) => Z(e.currentTarget), oe = () => Z(document.scrollingElement ?? document.documentElement), te = Je(() => {
478
+ l.value && m();
476
479
  });
477
- let R = [], N = !1;
478
- const te = () => {
480
+ let R = [], x = !1;
481
+ const le = () => {
479
482
  for (const e of R)
480
- e.removeEventListener("scroll", Z);
481
- N && (ae(window, "scroll", ee), N = !1), R = [], L.clear(), oe.cancel();
482
- }, W = () => {
483
- if (te(), !l.value || !(o.updateAtScroll || o.scrollToClose)) return;
484
- R = Ue(g.value);
483
+ e.removeEventListener("scroll", ee);
484
+ x && (ce(window, "scroll", oe), x = !1), R = [], j.clear(), te.cancel();
485
+ }, B = () => {
486
+ if (le(), !l.value || !(o.updateAtScroll || o.scrollToClose)) return;
487
+ R = [.../* @__PURE__ */ new Set([...ie(T.value), ...ie(f.value)])];
485
488
  const e = document.scrollingElement ?? document.documentElement;
486
489
  for (const t of [...R, e])
487
- L.set(t, [t.scrollTop, t.scrollLeft]);
490
+ j.set(t, [t.scrollTop, t.scrollLeft]);
488
491
  for (const t of R)
489
- t.addEventListener("scroll", Z, {
492
+ t.addEventListener("scroll", ee, {
490
493
  passive: !0
491
494
  });
492
- $(window, "scroll", ee, {
495
+ $(window, "scroll", oe, {
493
496
  passive: !0
494
- }), N = !0;
495
- }, x = () => {
496
- l.value && y();
497
- }, be = () => {
498
- x(), C("resize");
499
- }, ge = (e) => {
497
+ }), x = !0;
498
+ }, I = () => {
499
+ l.value && m();
500
+ }, Re = () => {
501
+ I(), C("resize");
502
+ }, Pe = (e) => {
500
503
  o.preventFocus && e.preventDefault();
501
504
  };
502
- u == null || u.addChildRef(v);
503
- const Se = P(() => l.value ? o.openedClass : void 0);
504
- F(l, (e) => {
505
- o.clickOutsideToClose && (!e && p ? z() : e && !p && ($(document.documentElement, "mousedown", j), p = !0)), W(), e && (S.value = !1, O.value = !0);
506
- }), F(() => [o.updateAtScroll, o.scrollToClose, g.value], W), F(v, (e) => {
507
- e && l.value && !S.value && I(() => y());
508
- }), F(() => [o.autoFitPopupWidth, o.autoFitPopupMinWidth], () => {
509
- l.value && y();
505
+ u == null || u.addChildRef(f);
506
+ const Ee = L(() => l.value ? o.openedClass : void 0);
507
+ P(l, (e) => {
508
+ o.clickOutsideToClose && (!e && y ? N() : e && !y && ($(document.documentElement, "mousedown", W), y = !0)), B(), e && (S.value = !1, F.value = !0);
509
+ }), P(() => [o.updateAtScroll, o.scrollToClose, T.value], B), P(f, (e) => {
510
+ e && l.value && !S.value && k(() => m());
511
+ }), P(() => [o.autoFitPopupWidth, o.autoFitPopupMinWidth], () => {
512
+ l.value && m();
510
513
  });
511
514
  const {
512
- createResizeObserver: Te,
513
- destroyResizeObserver: Re
514
- } = Je({
515
- elementRef: k,
516
- onResize: x
515
+ createResizeObserver: Me,
516
+ destroyResizeObserver: ne
517
+ } = Ze({
518
+ elementRef: O,
519
+ onResize: I
517
520
  });
518
- Le(() => {
519
- Te(), l.value && (O.value = !0, y(), o.clickOutsideToClose && !p && ($(document.documentElement, "mousedown", j), p = !0), W());
520
- }), ke(() => {
521
- l.value && y();
522
- }), De(() => {
523
- s(!1);
521
+ P(O, () => {
522
+ ne(), Me(), B(), l.value && k(m);
523
+ }, {
524
+ flush: "post"
525
+ }), je(() => {
526
+ l.value && (F.value = !0, m(), o.clickOutsideToClose && !y && ($(document.documentElement, "mousedown", W), y = !0), B());
524
527
  }), ze(() => {
525
- u == null || u.removeChildRef(v), Re(), p && z(), te();
528
+ l.value && m();
529
+ }), Ne(() => {
530
+ s(!1);
531
+ }), Ve(() => {
532
+ X(), u == null || u.removeChildRef(f), ne(), y && N(), le();
526
533
  });
527
- const O = i(l.value), B = i(!1), le = () => {
528
- B.value = !0;
529
- }, Pe = () => {
530
- B.value = !1, l.value && C("show");
531
- }, Me = () => {
532
- B.value = !1, l.value || (O.value = !1, C("hide"));
534
+ const F = i(l.value), A = i(!1), ue = () => {
535
+ A.value = !0;
536
+ }, Oe = () => {
537
+ A.value = !1, l.value && C("show");
538
+ }, Be = () => {
539
+ A.value = !1, l.value || (F.value = !1, C("hide"));
533
540
  };
534
541
  return () => {
535
542
  var e;
536
- return M.value = ((e = f.default) == null ? void 0 : e.call(f)) ?? [], Xe(M.value, {
537
- class: Se.value,
538
- onClick: ve,
539
- onMouseenter: Y,
540
- onMouseleave: q,
541
- onFocusin: pe,
542
- onFocusout: ye,
543
- onContextmenu: he
544
- }), c(Ve, null, [o.autoFixPosition ? c(ue, {
545
- onResize: be
543
+ return E.value = ((e = v.default) == null ? void 0 : e.call(v)) ?? [], _e(E.value, {
544
+ class: Ee.value,
545
+ onClick: we,
546
+ onMouseenter: _,
547
+ onMouseleave: J,
548
+ onFocusin: Ce,
549
+ onFocusout: be,
550
+ onContextmenu: Te
551
+ }), c(We, null, [o.autoFixPosition ? c(se, {
552
+ onResize: Re
546
553
  }, {
547
- default: () => [M.value]
548
- }) : M.value, c(Qe, null, {
549
- default: () => [c(je, {
550
- to: de.value,
554
+ default: () => [E.value]
555
+ }) : E.value, c(eo, null, {
556
+ default: () => [c(xe, {
557
+ to: ye.value,
551
558
  disabled: !o.renderToBody
552
559
  }, {
553
- default: () => [(!o.unmountOnClose || l.value || O.value) && !we.value && c(ue, {
554
- onResize: x
560
+ default: () => [(!o.unmountOnClose || l.value || F.value) && !Se.value && c(se, {
561
+ onResize: I
555
562
  }, {
556
- default: () => [c("div", Ne({
557
- ref: v,
558
- class: [b.element("popup"), b.modifier(`position-${E.value}`)],
559
- style: {
563
+ default: () => [c("div", Ie(ve(), {
564
+ ref: f,
565
+ class: [b.element("popup"), b.modifier(`position-${M.value}`), n.class],
566
+ "data-theme": me.value,
567
+ style: [fe.value, n.style, {
560
568
  ...H.value,
561
- zIndex: fe.value,
569
+ zIndex: he.value,
562
570
  ...l.value && !S.value ? {
563
571
  visibility: "hidden"
564
572
  } : {},
565
- pointerEvents: B.value ? "none" : "auto"
566
- },
567
- "trigger-placement": E.value,
568
- onMouseenter: _,
569
- onMouseleave: J,
570
- onMousedown: ge
571
- }, ce.value), [c(We, {
573
+ pointerEvents: A.value ? "none" : "auto"
574
+ }],
575
+ "trigger-placement": M.value,
576
+ onMouseenter: q,
577
+ onMouseleave: Q,
578
+ onMousedown: Pe
579
+ }), [c($e, {
572
580
  name: o.animationName,
573
581
  duration: o.duration,
574
582
  appear: !0,
575
- onBeforeEnter: le,
576
- onAfterEnter: Pe,
577
- onBeforeLeave: le,
578
- onAfterLeave: Me
583
+ onBeforeEnter: ue,
584
+ onAfterEnter: Oe,
585
+ onBeforeLeave: ue,
586
+ onAfterLeave: Be
579
587
  }, {
580
588
  default: () => {
581
589
  var t;
582
- return [xe(c("div", {
590
+ return [Ge(c("div", {
583
591
  class: b.element("popup-wrapper"),
584
592
  style: U.value
585
593
  }, [c("div", {
586
594
  class: [b.element("content"), o.contentClass],
587
595
  style: o.contentStyle
588
- }, [(t = f.content) == null ? void 0 : t.call(f)]), o.showArrow && c("div", {
589
- ref: re,
596
+ }, [(t = v.content) == null ? void 0 : t.call(v)]), o.showArrow && c("div", {
597
+ ref: pe,
590
598
  class: [b.element("arrow"), o.arrowClass],
591
599
  style: K.value
592
- }, null)]), [[Ie, l.value]])];
600
+ }, null)]), [[He, l.value]])];
593
601
  }
594
602
  })])]
595
603
  })]
@@ -599,5 +607,5 @@ const lo = ["onClick", "onMouseenter", "onMouseleave", "onFocusin", "onFocusout"
599
607
  }
600
608
  });
601
609
  export {
602
- So as default
610
+ Ro as default
603
611
  };