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.
- package/AI_CODING.md +97 -0
- package/AI_USAGE/catalog.md +111 -0
- package/AI_USAGE/components/alert.md +33 -0
- package/AI_USAGE/components/bar-chart.md +46 -0
- package/AI_USAGE/components/button.md +35 -0
- package/AI_USAGE/components/checkbox.md +34 -0
- package/AI_USAGE/components/color-picker.md +36 -0
- package/AI_USAGE/components/config-provider.md +58 -0
- package/AI_USAGE/components/date-picker.md +34 -0
- package/AI_USAGE/components/dialog.md +37 -0
- package/AI_USAGE/components/dropdown.md +38 -0
- package/AI_USAGE/components/empty.md +30 -0
- package/AI_USAGE/components/input.md +32 -0
- package/AI_USAGE/components/line-chart.md +45 -0
- package/AI_USAGE/components/message-box.md +39 -0
- package/AI_USAGE/components/message.md +36 -0
- package/AI_USAGE/components/notification.md +37 -0
- package/AI_USAGE/components/pagination.md +32 -0
- package/AI_USAGE/components/pie-chart.md +55 -0
- package/AI_USAGE/components/popconfirm.md +33 -0
- package/AI_USAGE/components/popover.md +35 -0
- package/AI_USAGE/components/progress.md +32 -0
- package/AI_USAGE/components/radio.md +35 -0
- package/AI_USAGE/components/rate.md +30 -0
- package/AI_USAGE/components/select.md +38 -0
- package/AI_USAGE/components/slider.md +34 -0
- package/AI_USAGE/components/steps.md +33 -0
- package/AI_USAGE/components/switch.md +32 -0
- package/AI_USAGE/components/tabs.md +33 -0
- package/AI_USAGE/components/textarea.md +31 -0
- package/AI_USAGE/components/time-picker.md +34 -0
- package/AI_USAGE/components/upload.md +60 -0
- package/AI_USAGE/core.md +37 -0
- package/AI_USAGE/index.md +52 -0
- package/AI_USAGE/recipes/form-on-demand.md +42 -0
- package/AI_USAGE.md +173 -46
- package/CHANGELOG.md +36 -1
- package/README.md +15 -2
- package/dist/_container/resize-trigger.vue.d.ts +1 -1
- package/dist/_hooks/use-dialog-focus.d.ts +7 -0
- package/dist/_hooks/use-pointer-drag.d.ts +6 -0
- package/dist/_hooks/use-popup-close.d.ts +11 -0
- package/dist/_hooks/use-popup-theme.d.ts +5 -0
- package/dist/_utils/palette.d.ts +2 -0
- package/dist/components/_components/picker/input-range.vue.d.ts +1 -3
- package/dist/components/_components/picker/input.vue.d.ts +1 -3
- package/dist/components/_components/select-view/select-view.d.ts +9 -0
- package/dist/components/alert/Alert.vue.d.ts +1 -1
- package/dist/components/alert/index.d.ts +3 -3
- package/dist/components/bar-chart/BarChart.d.ts +3 -3
- package/dist/components/bar-chart/index.d.ts +9 -9
- package/dist/components/color-picker/ColorPicker.d.ts +2 -1
- package/dist/components/color-picker/index.d.ts +2 -0
- package/dist/components/color-picker/panel.d.ts +6 -0
- package/dist/components/config-provider/context.d.ts +7 -1
- package/dist/components/date-picker/DatePicker.vue.d.ts +9 -12
- package/dist/components/date-picker/index.d.ts +19 -27
- package/dist/components/drawer/index.d.ts +51 -9
- package/dist/components/drawer/src/Drawer.vue.d.ts +19 -4
- package/dist/components/dropdown/Dropdown.vue.d.ts +6 -3
- package/dist/components/dropdown/DropdownButton.vue.d.ts +6 -3
- package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +6 -3
- package/dist/components/dropdown/dropdown-panel.vue.d.ts +6 -3
- package/dist/components/dropdown/index.d.ts +36 -18
- package/dist/components/form-select/Select.d.ts +18 -5
- package/dist/components/form-select/SelectDropdown.vue.d.ts +6 -3
- package/dist/components/form-select/SelectOption.vue.d.ts +1 -0
- package/dist/components/form-select/SelectOptionGroup.vue.d.ts +1 -0
- package/dist/components/form-select/hooks/use-options.d.ts +1 -1
- package/dist/components/form-select/hooks/use-select.d.ts +1 -1
- package/dist/components/form-select/index.d.ts +57 -17
- package/dist/components/form-select/interface.d.ts +8 -0
- package/dist/components/form-slider/Slider.vue.d.ts +1 -1
- package/dist/components/form-slider/index.d.ts +3 -3
- package/dist/components/form-textarea/Textarea.vue.d.ts +2 -4
- package/dist/components/form-textarea/index.d.ts +6 -12
- package/dist/components/image/Image.vue.d.ts +2 -4
- package/dist/components/image/index.d.ts +6 -12
- package/dist/components/layout/LayoutSidebar.vue.d.ts +5 -5
- package/dist/components/layout/index.d.ts +10 -10
- package/dist/components/line-chart/LineChart.d.ts +3 -3
- package/dist/components/line-chart/index.d.ts +9 -9
- package/dist/components/menu/Menu.d.ts +6 -3
- package/dist/components/menu/base-menu.vue.d.ts +6 -3
- package/dist/components/menu/index.d.ts +12 -6
- package/dist/components/menu/sub-menu-pop.vue.d.ts +6 -3
- package/dist/components/network/Network.vue.d.ts +1 -1
- package/dist/components/network/index.d.ts +3 -3
- package/dist/components/pagination/page-options.vue.d.ts +60 -32
- package/dist/components/pie-chart/PieChart.d.ts +1 -1
- package/dist/components/pie-chart/index.d.ts +3 -3
- package/dist/components/resize-box/ResizeBox.vue.d.ts +2 -2
- package/dist/components/resize-box/index.d.ts +5 -5
- package/dist/components/scrollbar-v2/Scrollbar.vue.d.ts +2 -1
- package/dist/components/scrollbar-v2/index.d.ts +6 -3
- package/dist/components/table/Table.d.ts +1 -1
- package/dist/components/table/index.d.ts +3 -3
- package/dist/components/tabs/Tabs.d.ts +1 -1
- package/dist/components/tabs/index.d.ts +3 -3
- package/dist/components/time-picker/TimeColumn.vue.d.ts +6 -3
- package/dist/components/time-picker/TimePanel.vue.d.ts +6 -3
- package/dist/components/time-picker/TimePicker.vue.d.ts +9 -12
- package/dist/components/time-picker/index.d.ts +19 -27
- package/dist/components/trend-chart/components/TrendChart.d.ts +5 -5
- package/dist/components/trend-chart/components/trend-chart-curve.d.ts +1 -1
- package/dist/components/trend-chart/index.d.ts +14 -14
- package/dist/components/trigger/interface.d.ts +2 -0
- package/dist/components/virtual-list-v2/virtual-list.vue.d.ts +7 -4
- package/dist/es/_hooks/use-dialog-focus.js +69 -0
- package/dist/es/_hooks/use-pointer-drag.js +18 -0
- package/dist/es/_hooks/use-popup-close.js +27 -0
- package/dist/es/_hooks/use-popup-manager.js +26 -24
- package/dist/es/_hooks/use-popup-theme.js +18 -0
- package/dist/es/_hooks/use-teleport-container.js +9 -10
- package/dist/es/_utils/palette.js +57 -52
- package/dist/es/components/_components/select-view/select-view.js +89 -78
- package/dist/es/components/button/Button.js +1 -1
- package/dist/es/components/color-picker/ColorPicker.js +131 -102
- package/dist/es/components/color-picker/gradient-slider.js +38 -40
- package/dist/es/components/color-picker/panel.js +221 -192
- package/dist/es/components/color-picker/sv-panel.js +51 -50
- package/dist/es/components/config-provider/ConfigProvider.js +58 -41
- package/dist/es/components/dialog/Dialog.js +133 -186
- package/dist/es/components/drawer/src/Drawer.vue.js +59 -51
- package/dist/es/components/drawer/src/Drawer.vue2.js +117 -107
- package/dist/es/components/form/FormItem.vue.js +12 -12
- package/dist/es/components/form-input-tag/InputTag.js +1 -1
- package/dist/es/components/form-select/Select.js +348 -300
- package/dist/es/components/form-select/SelectDropdown.vue.js +7 -7
- package/dist/es/components/form-select/SelectOption.vue.js +22 -17
- package/dist/es/components/form-select/SelectOption.vue2.js +59 -51
- package/dist/es/components/form-select/SelectOptionGroup.vue.js +17 -13
- package/dist/es/components/form-select/SelectOptionGroup.vue2.js +8 -5
- package/dist/es/components/form-select/hooks/use-options.js +40 -40
- package/dist/es/components/form-select/hooks/use-select.js +76 -71
- package/dist/es/components/form-switch/Switch.vue.js +24 -24
- package/dist/es/components/image/Image.vue.js +12 -12
- package/dist/es/components/link/Link.vue.js +6 -6
- package/dist/es/components/menu/sub-menu-inline.vue.js +11 -11
- package/dist/es/components/menu/sub-menu-pop.vue.js +12 -12
- package/dist/es/components/notification/Notification.js +59 -59
- package/dist/es/components/resize-box/ResizeBox.vue.js +19 -22
- package/dist/es/components/skeleton/Skeleton.vue.js +9 -9
- package/dist/es/components/tag/Tag.vue.js +7 -7
- package/dist/es/components/trigger/Trigger.js +171 -163
- package/dist/es/style.css +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.umd.js +3 -3
- package/dist/style/bar-chart.js +1 -0
- package/dist/style/base.css +1 -1
- package/dist/style/button.css +1 -1
- package/dist/style/color-picker.css +1 -1
- package/dist/style/color-picker.js +4 -0
- package/dist/style/date-picker.js +4 -0
- package/dist/style/dependencies.json +296 -0
- package/dist/style/dialog.js +2 -0
- package/dist/style/drawer.js +3 -0
- package/dist/style/dropdown.js +5 -0
- package/dist/style/form-checkbox.css +1 -1
- package/dist/style/form-input-number.js +2 -0
- package/dist/style/form-input.css +1 -1
- package/dist/style/form-input.js +1 -0
- package/dist/style/form-select.js +5 -0
- package/dist/style/form-slider.js +5 -0
- package/dist/style/form.js +3 -0
- package/dist/style/heatmap.js +1 -0
- package/dist/style/image.js +2 -0
- package/dist/style/layout.js +1 -0
- package/dist/style/line-chart.js +1 -0
- package/dist/style/menu.js +3 -0
- package/dist/style/message-box.js +3 -0
- package/dist/style/pagination.js +9 -0
- package/dist/style/pie-chart.js +1 -0
- package/dist/style/popconfirm.js +3 -0
- package/dist/style/popover.js +1 -0
- package/dist/style/popup.js +2 -0
- package/dist/style/table.js +12 -0
- package/dist/style/time-picker.js +3 -0
- package/dist/style/tooltip.js +1 -0
- package/dist/style/upload.js +4 -0
- package/dist/style.css +1 -1
- package/package.json +17 -7
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { getElementScrollRect as
|
|
3
|
-
import
|
|
4
|
-
import { on as $, off as
|
|
5
|
-
import { isEmptyChildren as
|
|
6
|
-
import
|
|
7
|
-
import { triggerInjectionKey as
|
|
8
|
-
import { throttleByRaf as
|
|
9
|
-
import
|
|
10
|
-
import { useResizeObserver as
|
|
11
|
-
import
|
|
12
|
-
import { useTeleportContainer as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { getClassNameMixin as
|
|
16
|
-
const
|
|
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:
|
|
332
|
+
slots: v,
|
|
333
333
|
attrs: n
|
|
334
334
|
}) {
|
|
335
335
|
const {
|
|
336
|
-
popupContainer:
|
|
337
|
-
} =
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
} =
|
|
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
|
-
}),
|
|
344
|
-
teleportContainer:
|
|
345
|
-
containerRef:
|
|
346
|
-
} =
|
|
347
|
-
popupContainer:
|
|
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:
|
|
352
|
-
} =
|
|
354
|
+
zIndex: he
|
|
355
|
+
} = Qe("popup", {
|
|
353
356
|
visible: l
|
|
354
357
|
});
|
|
355
|
-
let
|
|
356
|
-
const
|
|
357
|
-
|
|
358
|
-
},
|
|
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
|
-
},
|
|
372
|
+
}, Y = () => {
|
|
370
373
|
S.value = !0;
|
|
371
|
-
},
|
|
372
|
-
if (!
|
|
374
|
+
}, m = () => {
|
|
375
|
+
if (!T.value || !f.value || !O.value)
|
|
373
376
|
return;
|
|
374
|
-
const e =
|
|
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
|
-
} :
|
|
388
|
+
} : ae(T.value, e), a = () => (
|
|
386
389
|
// @ts-ignore
|
|
387
|
-
|
|
390
|
+
ae(f.value, e)
|
|
388
391
|
), d = a(), {
|
|
389
392
|
style: h,
|
|
390
393
|
position: w
|
|
391
|
-
} =
|
|
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:
|
|
399
|
-
}), o.autoFitPopupMinWidth ? h.minWidth = `${t.width}px` : o.autoFitPopupWidth && (h.width = `${t.width}px`),
|
|
400
|
-
K.value =
|
|
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
|
-
}),
|
|
403
|
-
}) :
|
|
405
|
+
}), Y();
|
|
406
|
+
}) : Y();
|
|
404
407
|
}, s = (e, t) => {
|
|
405
|
-
const a =
|
|
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 &&
|
|
410
|
-
|
|
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 (
|
|
414
|
-
e !== l.value && (
|
|
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
|
-
},
|
|
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.
|
|
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.
|
|
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.
|
|
434
|
-
},
|
|
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 || !
|
|
437
|
-
},
|
|
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 || !
|
|
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
|
-
|
|
442
|
-
onMouseenter:
|
|
443
|
-
onMouseleave:
|
|
444
|
+
ke(re, De({
|
|
445
|
+
onMouseenter: q,
|
|
446
|
+
onMouseleave: Q,
|
|
444
447
|
addChildRef: (e) => {
|
|
445
|
-
|
|
448
|
+
D.add(e), u == null || u.addChildRef(e);
|
|
446
449
|
},
|
|
447
450
|
removeChildRef: (e) => {
|
|
448
|
-
|
|
451
|
+
D.delete(e), u == null || u.removeChildRef(e);
|
|
449
452
|
}
|
|
450
453
|
}));
|
|
451
|
-
const
|
|
452
|
-
|
|
453
|
-
}, V =
|
|
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 &&
|
|
456
|
-
}),
|
|
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 =
|
|
459
|
-
for (const h of
|
|
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
|
-
|
|
465
|
+
N(), s(!1);
|
|
463
466
|
}
|
|
464
|
-
},
|
|
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
|
-
},
|
|
473
|
+
}, Z = (e) => {
|
|
471
474
|
if (!l.value) return;
|
|
472
|
-
const t =
|
|
473
|
-
o.scrollToClose && t &&
|
|
474
|
-
},
|
|
475
|
-
l.value &&
|
|
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 = [],
|
|
478
|
-
const
|
|
480
|
+
let R = [], x = !1;
|
|
481
|
+
const le = () => {
|
|
479
482
|
for (const e of R)
|
|
480
|
-
e.removeEventListener("scroll",
|
|
481
|
-
|
|
482
|
-
},
|
|
483
|
-
if (
|
|
484
|
-
R =
|
|
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
|
-
|
|
490
|
+
j.set(t, [t.scrollTop, t.scrollLeft]);
|
|
488
491
|
for (const t of R)
|
|
489
|
-
t.addEventListener("scroll",
|
|
492
|
+
t.addEventListener("scroll", ee, {
|
|
490
493
|
passive: !0
|
|
491
494
|
});
|
|
492
|
-
$(window, "scroll",
|
|
495
|
+
$(window, "scroll", oe, {
|
|
493
496
|
passive: !0
|
|
494
|
-
}),
|
|
495
|
-
},
|
|
496
|
-
l.value &&
|
|
497
|
-
},
|
|
498
|
-
|
|
499
|
-
},
|
|
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(
|
|
503
|
-
const
|
|
504
|
-
|
|
505
|
-
o.clickOutsideToClose && (!e &&
|
|
506
|
-
}),
|
|
507
|
-
e && l.value && !S.value &&
|
|
508
|
-
}),
|
|
509
|
-
l.value &&
|
|
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:
|
|
513
|
-
destroyResizeObserver:
|
|
514
|
-
} =
|
|
515
|
-
elementRef:
|
|
516
|
-
onResize:
|
|
515
|
+
createResizeObserver: Me,
|
|
516
|
+
destroyResizeObserver: ne
|
|
517
|
+
} = Ze({
|
|
518
|
+
elementRef: O,
|
|
519
|
+
onResize: I
|
|
517
520
|
});
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
}),
|
|
523
|
-
|
|
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
|
-
|
|
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
|
|
528
|
-
|
|
529
|
-
},
|
|
530
|
-
|
|
531
|
-
},
|
|
532
|
-
|
|
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
|
|
537
|
-
class:
|
|
538
|
-
onClick:
|
|
539
|
-
onMouseenter:
|
|
540
|
-
onMouseleave:
|
|
541
|
-
onFocusin:
|
|
542
|
-
onFocusout:
|
|
543
|
-
onContextmenu:
|
|
544
|
-
}), c(
|
|
545
|
-
onResize:
|
|
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: () => [
|
|
548
|
-
}) :
|
|
549
|
-
default: () => [c(
|
|
550
|
-
to:
|
|
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 ||
|
|
554
|
-
onResize:
|
|
560
|
+
default: () => [(!o.unmountOnClose || l.value || F.value) && !Se.value && c(se, {
|
|
561
|
+
onResize: I
|
|
555
562
|
}, {
|
|
556
|
-
default: () => [c("div",
|
|
557
|
-
ref:
|
|
558
|
-
class: [b.element("popup"), b.modifier(`position-${
|
|
559
|
-
|
|
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:
|
|
569
|
+
zIndex: he.value,
|
|
562
570
|
...l.value && !S.value ? {
|
|
563
571
|
visibility: "hidden"
|
|
564
572
|
} : {},
|
|
565
|
-
pointerEvents:
|
|
566
|
-
},
|
|
567
|
-
"trigger-placement":
|
|
568
|
-
onMouseenter:
|
|
569
|
-
onMouseleave:
|
|
570
|
-
onMousedown:
|
|
571
|
-
}
|
|
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:
|
|
576
|
-
onAfterEnter:
|
|
577
|
-
onBeforeLeave:
|
|
578
|
-
onAfterLeave:
|
|
583
|
+
onBeforeEnter: ue,
|
|
584
|
+
onAfterEnter: Oe,
|
|
585
|
+
onBeforeLeave: ue,
|
|
586
|
+
onAfterLeave: Be
|
|
579
587
|
}, {
|
|
580
588
|
default: () => {
|
|
581
589
|
var t;
|
|
582
|
-
return [
|
|
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 =
|
|
589
|
-
ref:
|
|
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)]), [[
|
|
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
|
-
|
|
610
|
+
Ro as default
|
|
603
611
|
};
|