vue-devui 1.0.0-beta.18 → 1.0.0-beta.19
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/README.md +200 -187
- package/accordion/index.es.js +221 -6
- package/accordion/index.umd.js +1 -1
- package/alert/index.es.js +28 -30
- package/alert/index.umd.js +1 -1
- package/auto-complete/index.es.js +131 -269
- package/auto-complete/index.umd.js +1 -1
- package/auto-complete/style.css +1 -1
- package/back-top/index.es.js +4 -2
- package/badge/index.es.js +13 -19
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/breadcrumb/index.es.js +2 -1
- package/button/index.es.js +39 -40
- package/button/index.umd.js +1 -1
- package/carousel/index.es.js +38 -53
- package/carousel/index.umd.js +1 -1
- package/cascader/index.es.js +16 -8
- package/cascader/style.css +1 -1
- package/color-picker/index.es.js +97 -89
- package/color-picker/index.umd.js +7 -7
- package/countdown/index.es.js +2 -1
- package/date-picker/index.es.js +40 -57
- package/date-picker/index.umd.js +1 -1
- package/date-picker/style.css +1 -1
- package/drawer/index.es.js +162 -5741
- package/drawer/index.umd.js +1 -27
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +459 -301
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +6 -3
- package/form/index.es.js +1953 -1550
- package/form/index.umd.js +18 -18
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +112 -133
- package/fullscreen/index.umd.js +1 -1
- package/fullscreen/style.css +1 -1
- package/icon/index.es.js +39 -57
- package/icon/index.umd.js +1 -1
- package/image-preview/index.es.js +2 -1
- package/input/style.css +1 -1
- package/input-icon/index.es.js +38 -37
- package/input-icon/index.umd.js +1 -1
- package/input-icon/style.css +1 -1
- package/input-number/index.es.js +46 -57
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/{time-axis → list}/index.d.ts +0 -0
- package/list/index.es.js +39 -0
- package/list/index.umd.js +1 -0
- package/{toast → list}/package.json +1 -1
- package/list/style.css +1 -0
- package/modal/index.es.js +300 -934
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/{toast → notification}/index.d.ts +0 -0
- package/notification/index.es.js +284 -0
- package/notification/index.umd.js +1 -0
- package/notification/package.json +7 -0
- package/notification/style.css +1 -0
- package/nuxt/components/DropdownMenu.js +3 -0
- package/nuxt/components/IFileOptions.js +3 -0
- package/nuxt/components/IUploadOptions.js +3 -0
- package/nuxt/components/List.js +3 -0
- package/nuxt/components/ListItem.js +3 -0
- package/nuxt/components/Notification.js +3 -0
- package/nuxt/components/NotificationService.js +3 -0
- package/nuxt/components/PanelBody.js +3 -0
- package/nuxt/components/PanelFooter.js +3 -0
- package/nuxt/components/PanelHeader.js +3 -0
- package/nuxt/components/Timeline.js +3 -0
- package/nuxt/components/TimelineItem.js +3 -0
- package/nuxt/components/UploadStatus.js +3 -0
- package/nuxt/components/alertProps.js +3 -0
- package/nuxt/components/badgeProps.js +3 -0
- package/nuxt/components/dropdownMenuProps.js +3 -0
- package/nuxt/components/fixedOverlayProps.js +3 -0
- package/nuxt/components/flexibleOverlayProps.js +3 -0
- package/nuxt/components/fullscreenProps.js +3 -0
- package/nuxt/components/iconProps.js +2 -0
- package/nuxt/components/notificationProps.js +3 -0
- package/nuxt/components/overlayEmits.js +3 -0
- package/nuxt/components/overlayProps.js +3 -0
- package/nuxt/components/paginationProps.js +3 -0
- package/nuxt/components/panelProps.js +3 -0
- package/nuxt/components/popoverProps.js +3 -0
- package/nuxt/components/searchProps.js +3 -0
- package/nuxt/components/tooltipProps.js +3 -0
- package/nuxt/components/uploadProps.js +3 -0
- package/overlay/index.es.js +152 -198
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +40 -87
- package/pagination/index.es.js +10 -12
- package/pagination/index.umd.js +1 -1
- package/panel/index.es.js +45 -32
- package/panel/index.umd.js +1 -1
- package/popover/index.es.js +5954 -201
- package/popover/index.umd.js +27 -1
- package/popover/style.css +1 -1
- package/read-tip/index.es.js +6 -3
- package/result/index.es.js +38 -53
- package/result/index.umd.js +1 -1
- package/ripple/index.es.js +9 -5
- package/search/index.es.js +19 -29
- package/search/index.umd.js +6 -6
- package/search/style.css +1 -1
- package/select/index.es.js +42 -42
- package/select/index.umd.js +1 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +17 -17
- package/skeleton/index.umd.js +1 -1
- package/slider/index.es.js +2 -1
- package/splitter/index.es.js +5814 -98
- package/splitter/index.umd.js +27 -1
- package/splitter/style.css +1 -1
- package/status/index.es.js +1 -4
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/steps-guide/index.es.js +6 -3
- package/style.css +1 -1
- package/table/index.es.js +456 -299
- package/table/index.umd.js +1 -1
- package/table/style.css +1 -1
- package/tabs/index.es.js +3 -4
- package/tabs/index.umd.js +1 -1
- package/tag/index.es.js +2 -1
- package/tag-input/index.es.js +4 -2
- package/textarea/style.css +1 -1
- package/time-picker/index.es.js +43 -42
- package/time-picker/index.umd.js +1 -1
- package/timeline/index.d.ts +7 -0
- package/{time-axis → timeline}/index.es.js +65 -78
- package/timeline/index.umd.js +1 -0
- package/{time-axis → timeline}/package.json +1 -1
- package/timeline/style.css +1 -0
- package/tooltip/index.es.js +5804 -94
- package/tooltip/index.umd.js +27 -1
- package/tooltip/style.css +1 -1
- package/transfer/index.es.js +440 -165
- package/transfer/index.umd.js +17 -17
- package/transfer/style.css +1 -1
- package/tree/index.es.js +12 -7
- package/tree/index.umd.js +10 -10
- package/tree-select/index.es.js +10 -6
- package/tree-select/index.umd.js +1 -1
- package/upload/index.es.js +335 -6068
- package/upload/index.umd.js +1 -27
- package/upload/style.css +1 -1
- package/vue-devui.es.js +2555 -2799
- package/vue-devui.umd.js +16 -16
- package/nuxt/components/TimeAxis.js +0 -3
- package/nuxt/components/TimeAxisItem.js +0 -3
- package/nuxt/components/Toast.js +0 -3
- package/nuxt/components/ToastService.js +0 -3
- package/time-axis/index.umd.js +0 -1
- package/time-axis/style.css +0 -1
- package/toast/index.es.js +0 -5918
- package/toast/index.umd.js +0 -27
- package/toast/style.css +0 -1
package/table/index.es.js
CHANGED
|
@@ -21,7 +21,9 @@ var __publicField = (obj, key, value) => {
|
|
|
21
21
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22
22
|
return value;
|
|
23
23
|
};
|
|
24
|
-
import { computed, ref, watch, defineComponent, inject, createVNode, mergeProps, toRef, provide,
|
|
24
|
+
import { computed, ref, watch, defineComponent, inject, createVNode, mergeProps, toRef, provide, toRefs, onMounted, onUnmounted, Teleport, Transition, renderSlot, isVNode, unref, nextTick, Fragment, withDirectives, vShow, shallowRef, getCurrentInstance, createTextVNode, resolveDirective, reactive, onBeforeMount, h, onBeforeUnmount, render } from "vue";
|
|
25
|
+
import { shift, offset, autoPlacement, arrow, computePosition } from "@floating-ui/dom";
|
|
26
|
+
import { onClickOutside } from "@vueuse/core";
|
|
25
27
|
const TableProps = {
|
|
26
28
|
data: {
|
|
27
29
|
type: Array,
|
|
@@ -686,14 +688,7 @@ const Sort = defineComponent({
|
|
|
686
688
|
}
|
|
687
689
|
});
|
|
688
690
|
const dropdownProps = {
|
|
689
|
-
|
|
690
|
-
type: Object
|
|
691
|
-
},
|
|
692
|
-
isOpen: {
|
|
693
|
-
type: Boolean,
|
|
694
|
-
default: false
|
|
695
|
-
},
|
|
696
|
-
disabled: {
|
|
691
|
+
visible: {
|
|
697
692
|
type: Boolean,
|
|
698
693
|
default: false
|
|
699
694
|
},
|
|
@@ -705,6 +700,18 @@ const dropdownProps = {
|
|
|
705
700
|
type: String,
|
|
706
701
|
default: "all"
|
|
707
702
|
},
|
|
703
|
+
position: {
|
|
704
|
+
type: Array,
|
|
705
|
+
default: ["bottom"]
|
|
706
|
+
},
|
|
707
|
+
align: {
|
|
708
|
+
type: String,
|
|
709
|
+
default: null
|
|
710
|
+
},
|
|
711
|
+
offset: {
|
|
712
|
+
type: [Number, Object],
|
|
713
|
+
default: 4
|
|
714
|
+
},
|
|
708
715
|
closeOnMouseLeaveMenu: {
|
|
709
716
|
type: Boolean,
|
|
710
717
|
default: false
|
|
@@ -713,14 +720,15 @@ const dropdownProps = {
|
|
|
713
720
|
type: Boolean,
|
|
714
721
|
default: true
|
|
715
722
|
},
|
|
716
|
-
|
|
717
|
-
type:
|
|
718
|
-
default: "
|
|
723
|
+
overlayClass: {
|
|
724
|
+
type: String,
|
|
725
|
+
default: ""
|
|
726
|
+
},
|
|
727
|
+
destroyOnHide: {
|
|
728
|
+
type: Boolean,
|
|
729
|
+
default: true
|
|
719
730
|
}
|
|
720
731
|
};
|
|
721
|
-
function isComponent(target) {
|
|
722
|
-
return !!(target == null ? void 0 : target.$el);
|
|
723
|
-
}
|
|
724
732
|
function getElement(element) {
|
|
725
733
|
if (element instanceof Element) {
|
|
726
734
|
return element;
|
|
@@ -730,85 +738,158 @@ function getElement(element) {
|
|
|
730
738
|
}
|
|
731
739
|
return null;
|
|
732
740
|
}
|
|
741
|
+
const dropdownMap = /* @__PURE__ */ new Map();
|
|
733
742
|
function subscribeEvent(dom, type, callback) {
|
|
734
743
|
dom == null ? void 0 : dom.addEventListener(type, callback);
|
|
735
744
|
return () => {
|
|
736
745
|
dom == null ? void 0 : dom.removeEventListener(type, callback);
|
|
737
746
|
};
|
|
738
747
|
}
|
|
739
|
-
const
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
const dropdownElRef = ref();
|
|
747
|
-
const closeByScope = () => {
|
|
748
|
-
if (closeScope.value === "none") {
|
|
749
|
-
return;
|
|
750
|
-
}
|
|
751
|
-
visible.value = false;
|
|
748
|
+
const useDropdownEvent = ({ id, isOpen, origin, dropdownRef, props, emit }) => {
|
|
749
|
+
let overlayEnter = false;
|
|
750
|
+
let originEnter = false;
|
|
751
|
+
const { trigger, closeScope, closeOnMouseLeaveMenu } = toRefs(props);
|
|
752
|
+
const toggle = (status) => {
|
|
753
|
+
isOpen.value = status;
|
|
754
|
+
emit("toggle", isOpen.value);
|
|
752
755
|
};
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
if (
|
|
756
|
+
const handleLeave = async (elementType, closeAll) => {
|
|
757
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
758
|
+
if (elementType === "origin" && overlayEnter || elementType === "dropdown" && originEnter) {
|
|
756
759
|
return;
|
|
757
760
|
}
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
761
|
+
if (closeAll) {
|
|
762
|
+
[...dropdownMap.values()].reverse().forEach((item) => {
|
|
763
|
+
setTimeout(() => {
|
|
764
|
+
var _a;
|
|
765
|
+
(_a = item.toggle) == null ? void 0 : _a.call(item);
|
|
766
|
+
}, 0);
|
|
767
|
+
});
|
|
768
|
+
}
|
|
769
|
+
toggle(false);
|
|
770
|
+
};
|
|
771
|
+
watch([trigger, origin, dropdownRef], ([triggerVal, originVal, dropdownEl], ov, onInvalidate) => {
|
|
772
|
+
const originEl = getElement(originVal);
|
|
773
|
+
const subscriptions = [];
|
|
774
|
+
setTimeout(() => {
|
|
775
|
+
subscriptions.push(subscribeEvent(document, "click", (e) => {
|
|
776
|
+
const dropdownValues = [...dropdownMap.values()];
|
|
777
|
+
if (!isOpen.value || closeScope.value === "none" || dropdownEl.contains(e.target) && closeScope.value === "blank" || dropdownValues.some((item) => {
|
|
778
|
+
var _a;
|
|
779
|
+
return (_a = item.toggleEl) == null ? void 0 : _a.contains(e.target);
|
|
780
|
+
}) && dropdownValues.some((item) => {
|
|
781
|
+
var _a;
|
|
782
|
+
return (_a = item.menuEl) == null ? void 0 : _a.contains(e.target);
|
|
783
|
+
})) {
|
|
773
784
|
return;
|
|
774
785
|
}
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
786
|
+
[...dropdownMap.values()].reverse().forEach((item) => {
|
|
787
|
+
setTimeout(() => {
|
|
788
|
+
var _a, _b;
|
|
789
|
+
if (!((_a = item.toggleEl) == null ? void 0 : _a.contains(e.target))) {
|
|
790
|
+
(_b = item.toggle) == null ? void 0 : _b.call(item);
|
|
791
|
+
}
|
|
792
|
+
}, 0);
|
|
793
|
+
});
|
|
794
|
+
overlayEnter = false;
|
|
780
795
|
}));
|
|
781
|
-
}
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
return;
|
|
796
|
+
}, 0);
|
|
797
|
+
if (triggerVal === "click") {
|
|
798
|
+
subscriptions.push(subscribeEvent(originEl, "click", () => toggle(!isOpen.value)), subscribeEvent(dropdownEl, "mouseleave", (e) => {
|
|
799
|
+
var _a;
|
|
800
|
+
if (closeOnMouseLeaveMenu.value && !((_a = dropdownMap.get(id).child) == null ? void 0 : _a.contains(e.relatedTarget))) {
|
|
801
|
+
handleLeave("dropdown", true);
|
|
788
802
|
}
|
|
789
|
-
|
|
790
|
-
|
|
803
|
+
}));
|
|
804
|
+
} else if (triggerVal === "hover") {
|
|
791
805
|
subscriptions.push(subscribeEvent(originEl, "mouseenter", () => {
|
|
792
806
|
originEnter = true;
|
|
793
|
-
|
|
807
|
+
toggle(true);
|
|
794
808
|
}), subscribeEvent(originEl, "mouseleave", () => {
|
|
795
809
|
originEnter = false;
|
|
796
|
-
|
|
797
|
-
handleLeave("origin");
|
|
798
|
-
}
|
|
810
|
+
handleLeave("origin");
|
|
799
811
|
}), subscribeEvent(dropdownEl, "mouseenter", () => {
|
|
800
812
|
overlayEnter = true;
|
|
801
|
-
|
|
802
|
-
}), subscribeEvent(dropdownEl, "mouseleave", () => {
|
|
813
|
+
isOpen.value = true;
|
|
814
|
+
}), subscribeEvent(dropdownEl, "mouseleave", (e) => {
|
|
815
|
+
var _a;
|
|
803
816
|
overlayEnter = false;
|
|
804
|
-
|
|
817
|
+
if (e.relatedTarget && ((originEl == null ? void 0 : originEl.contains(e.relatedTarget)) || ((_a = dropdownMap.get(id).child) == null ? void 0 : _a.contains(e.relatedTarget)))) {
|
|
818
|
+
return;
|
|
819
|
+
}
|
|
820
|
+
handleLeave("dropdown", true);
|
|
805
821
|
}));
|
|
806
822
|
}
|
|
807
823
|
onInvalidate(() => subscriptions.forEach((v) => v()));
|
|
808
824
|
});
|
|
809
|
-
return { dropdownEl: dropdownElRef };
|
|
810
825
|
};
|
|
811
|
-
|
|
826
|
+
function useDropdown(id, visible, isOpen, origin, dropdownRef, popDirection, emit) {
|
|
827
|
+
const calcPopDirection = (dropdownEl) => {
|
|
828
|
+
const elementHeight = dropdownEl.offsetHeight;
|
|
829
|
+
const bottomDistance = window.innerHeight - origin.value.getBoundingClientRect().bottom;
|
|
830
|
+
const isBottomEnough = bottomDistance >= elementHeight;
|
|
831
|
+
if (!isBottomEnough) {
|
|
832
|
+
popDirection.value = "top";
|
|
833
|
+
} else {
|
|
834
|
+
popDirection.value = "bottom";
|
|
835
|
+
}
|
|
836
|
+
};
|
|
837
|
+
watch(visible, (newVal, oldVal) => {
|
|
838
|
+
if (oldVal === void 0) {
|
|
839
|
+
return;
|
|
840
|
+
}
|
|
841
|
+
isOpen.value = newVal;
|
|
842
|
+
emit("toggle", isOpen.value);
|
|
843
|
+
}, { immediate: true });
|
|
844
|
+
watch([isOpen, dropdownRef], ([isOpenVal, dropdownEl]) => {
|
|
845
|
+
var _a;
|
|
846
|
+
if (isOpenVal) {
|
|
847
|
+
dropdownMap.set(id, __spreadProps(__spreadValues({}, dropdownMap.get(id)), {
|
|
848
|
+
menuEl: dropdownEl,
|
|
849
|
+
toggle: () => {
|
|
850
|
+
isOpen.value = false;
|
|
851
|
+
emit("toggle", isOpen.value);
|
|
852
|
+
}
|
|
853
|
+
}));
|
|
854
|
+
for (const value of dropdownMap.values()) {
|
|
855
|
+
if ((_a = value.menuEl) == null ? void 0 : _a.contains(origin.value)) {
|
|
856
|
+
value.child = dropdownEl;
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
if (dropdownEl) {
|
|
861
|
+
calcPopDirection(dropdownEl);
|
|
862
|
+
}
|
|
863
|
+
});
|
|
864
|
+
onMounted(() => {
|
|
865
|
+
dropdownMap.set(id, { toggleEl: origin.value });
|
|
866
|
+
});
|
|
867
|
+
onUnmounted(() => {
|
|
868
|
+
dropdownMap.delete(id);
|
|
869
|
+
});
|
|
870
|
+
}
|
|
871
|
+
function useOverlayProps(props, currentPosition, isOpen) {
|
|
872
|
+
const { showAnimation, overlayClass, destroyOnHide } = toRefs(props);
|
|
873
|
+
const overlayModelValue = ref(false);
|
|
874
|
+
const overlayShowValue = ref(false);
|
|
875
|
+
const styles = computed(() => ({
|
|
876
|
+
transformOrigin: currentPosition.value === "top" ? "0% 100%" : "0% 0%"
|
|
877
|
+
}));
|
|
878
|
+
const classes = computed(() => ({
|
|
879
|
+
"fade-in-bottom": showAnimation.value && isOpen.value && currentPosition.value === "bottom",
|
|
880
|
+
"fade-in-top": showAnimation.value && isOpen.value && currentPosition.value === "top",
|
|
881
|
+
[`${overlayClass.value}`]: true
|
|
882
|
+
}));
|
|
883
|
+
const handlePositionChange = (pos) => {
|
|
884
|
+
currentPosition.value = pos.includes("top") || pos.includes("end") ? "top" : "bottom";
|
|
885
|
+
};
|
|
886
|
+
watch(isOpen, (isOpenVal) => {
|
|
887
|
+
overlayModelValue.value = destroyOnHide.value ? isOpenVal : true;
|
|
888
|
+
overlayShowValue.value = isOpenVal;
|
|
889
|
+
});
|
|
890
|
+
return { overlayModelValue, overlayShowValue, styles, classes, handlePositionChange };
|
|
891
|
+
}
|
|
892
|
+
var baseOverlay = "";
|
|
812
893
|
function _isSlot(s) {
|
|
813
894
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
814
895
|
}
|
|
@@ -855,28 +936,13 @@ const overlayProps = {
|
|
|
855
936
|
default: true
|
|
856
937
|
}
|
|
857
938
|
};
|
|
858
|
-
const overlayEmits = ["update:visible", "backdropClick"];
|
|
859
939
|
const fixedOverlayProps = __spreadProps(__spreadValues({}, overlayProps), {
|
|
860
940
|
overlayStyle: {
|
|
861
941
|
type: [String, Object],
|
|
862
942
|
default: void 0
|
|
863
943
|
}
|
|
864
944
|
});
|
|
865
|
-
const
|
|
866
|
-
origin: {
|
|
867
|
-
type: Object,
|
|
868
|
-
require: true
|
|
869
|
-
},
|
|
870
|
-
position: {
|
|
871
|
-
type: Object,
|
|
872
|
-
default: () => ({
|
|
873
|
-
originX: "left",
|
|
874
|
-
originY: "top",
|
|
875
|
-
overlayX: "left",
|
|
876
|
-
overlayY: "top"
|
|
877
|
-
})
|
|
878
|
-
}
|
|
879
|
-
}, overlayProps);
|
|
945
|
+
const overlayEmits = ["update:visible", "backdropClick"];
|
|
880
946
|
function useOverlayLogic(props, ctx) {
|
|
881
947
|
const backgroundClass = computed(() => {
|
|
882
948
|
return [
|
|
@@ -927,7 +993,8 @@ function useOverlayLogic(props, ctx) {
|
|
|
927
993
|
handleOverlayBubbleCancel
|
|
928
994
|
};
|
|
929
995
|
}
|
|
930
|
-
|
|
996
|
+
var fixedOverlay = "";
|
|
997
|
+
defineComponent({
|
|
931
998
|
name: "DFixedOverlay",
|
|
932
999
|
props: fixedOverlayProps,
|
|
933
1000
|
emits: overlayEmits,
|
|
@@ -939,7 +1006,7 @@ const FixedOverlay = defineComponent({
|
|
|
939
1006
|
handleOverlayBubbleCancel
|
|
940
1007
|
} = useOverlayLogic(props, ctx);
|
|
941
1008
|
return () => createVNode(CommonOverlay, null, {
|
|
942
|
-
default: () => [
|
|
1009
|
+
default: () => [props.visible && createVNode("div", {
|
|
943
1010
|
"class": backgroundClass.value,
|
|
944
1011
|
"style": props.backgroundStyle,
|
|
945
1012
|
"onClick": handleBackdropClick
|
|
@@ -947,250 +1014,340 @@ const FixedOverlay = defineComponent({
|
|
|
947
1014
|
"class": overlayClass.value,
|
|
948
1015
|
"style": props.overlayStyle,
|
|
949
1016
|
"onClick": handleOverlayBubbleCancel
|
|
950
|
-
}, [renderSlot(ctx.slots, "default")])])
|
|
1017
|
+
}, [renderSlot(ctx.slots, "default")])])]
|
|
951
1018
|
});
|
|
952
1019
|
}
|
|
953
1020
|
});
|
|
954
|
-
const
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
watch([locationElements, visibleRef, positionRef], async ([locationElements2, visible, position], ov, onInvalidate) => {
|
|
983
|
-
if (!visible || !locationElements2) {
|
|
984
|
-
return;
|
|
985
|
-
}
|
|
986
|
-
const {
|
|
987
|
-
origin,
|
|
988
|
-
overlay: overlay2
|
|
989
|
-
} = locationElements2;
|
|
990
|
-
handleRectChange(position, overlay2.getBoundingClientRect(), origin);
|
|
991
|
-
const unsubscriptions = [subscribeLayoutEvent(() => handleRectChange(position, overlay2.getBoundingClientRect(), origin)), subscribeOverlayResize(overlay2, (entries) => handleRectChange(position, entries[0].contentRect, origin)), subscribeOriginResize(origin, () => handleRectChange(position, overlay2.getBoundingClientRect(), origin))];
|
|
992
|
-
onInvalidate(() => {
|
|
993
|
-
unsubscriptions.forEach((fn) => fn());
|
|
994
|
-
});
|
|
995
|
-
});
|
|
996
|
-
});
|
|
997
|
-
const {
|
|
998
|
-
backgroundClass,
|
|
999
|
-
overlayClass,
|
|
1000
|
-
handleBackdropClick,
|
|
1001
|
-
handleOverlayBubbleCancel
|
|
1002
|
-
} = useOverlayLogic(props, ctx);
|
|
1003
|
-
return () => createVNode(CommonOverlay, null, {
|
|
1004
|
-
default: () => [withDirectives(createVNode("div", {
|
|
1005
|
-
"style": props.backgroundStyle,
|
|
1006
|
-
"class": backgroundClass.value,
|
|
1007
|
-
"onClick": handleBackdropClick
|
|
1008
|
-
}, [createVNode("div", {
|
|
1009
|
-
"ref": overlayRef,
|
|
1010
|
-
"class": overlayClass.value,
|
|
1011
|
-
"style": positionedStyle,
|
|
1012
|
-
"onClick": handleOverlayBubbleCancel
|
|
1013
|
-
}, [renderSlot(ctx.slots, "default")])]), [[vShow, props.visible]])]
|
|
1014
|
-
});
|
|
1015
|
-
}
|
|
1016
|
-
});
|
|
1017
|
-
function getOrigin(origin) {
|
|
1018
|
-
if (origin instanceof Element) {
|
|
1019
|
-
return origin;
|
|
1020
|
-
}
|
|
1021
|
-
if (isRef(origin)) {
|
|
1022
|
-
return getElement(origin.value);
|
|
1023
|
-
}
|
|
1024
|
-
if (isComponent(origin)) {
|
|
1025
|
-
return getElement(origin);
|
|
1026
|
-
}
|
|
1027
|
-
return origin;
|
|
1028
|
-
}
|
|
1029
|
-
function calculatePosition(position, rect, origin) {
|
|
1030
|
-
const originRect = getOriginRect(origin);
|
|
1031
|
-
const originPoint = getOriginRelativePoint(originRect, position);
|
|
1032
|
-
return getOverlayPoint(originPoint, rect, position);
|
|
1033
|
-
}
|
|
1034
|
-
function getOriginRect(origin) {
|
|
1035
|
-
if (origin instanceof Element) {
|
|
1036
|
-
return origin.getBoundingClientRect();
|
|
1037
|
-
}
|
|
1038
|
-
const width = origin.width || 0;
|
|
1039
|
-
const height = origin.height || 0;
|
|
1040
|
-
return {
|
|
1041
|
-
top: origin.y,
|
|
1042
|
-
bottom: origin.y + height,
|
|
1043
|
-
left: origin.x,
|
|
1044
|
-
right: origin.x + width,
|
|
1045
|
-
height,
|
|
1046
|
-
width
|
|
1047
|
-
};
|
|
1048
|
-
}
|
|
1049
|
-
function getOverlayPoint(originPoint, rect, position) {
|
|
1050
|
-
let x;
|
|
1051
|
-
const {
|
|
1052
|
-
width,
|
|
1053
|
-
height
|
|
1054
|
-
} = rect;
|
|
1055
|
-
if (position.overlayX == "center") {
|
|
1056
|
-
x = originPoint.x - width / 2;
|
|
1057
|
-
} else {
|
|
1058
|
-
x = position.overlayX == "left" ? originPoint.x : originPoint.x - width;
|
|
1021
|
+
const flexibleOverlayProps = {
|
|
1022
|
+
modelValue: {
|
|
1023
|
+
type: Boolean,
|
|
1024
|
+
default: false
|
|
1025
|
+
},
|
|
1026
|
+
origin: {
|
|
1027
|
+
type: Object,
|
|
1028
|
+
require: true
|
|
1029
|
+
},
|
|
1030
|
+
position: {
|
|
1031
|
+
type: Array,
|
|
1032
|
+
default: ["bottom"]
|
|
1033
|
+
},
|
|
1034
|
+
offset: {
|
|
1035
|
+
type: [Number, Object],
|
|
1036
|
+
default: 8
|
|
1037
|
+
},
|
|
1038
|
+
align: {
|
|
1039
|
+
type: String,
|
|
1040
|
+
default: null
|
|
1041
|
+
},
|
|
1042
|
+
showArrow: {
|
|
1043
|
+
type: Boolean,
|
|
1044
|
+
default: false
|
|
1045
|
+
},
|
|
1046
|
+
isArrowCenter: {
|
|
1047
|
+
type: Boolean,
|
|
1048
|
+
default: true
|
|
1059
1049
|
}
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1050
|
+
};
|
|
1051
|
+
function getScrollParent(element) {
|
|
1052
|
+
const overflowRegex = /(auto|scroll|hidden)/;
|
|
1053
|
+
for (let parent = element; parent = parent.parentElement; parent.parentElement !== document.body) {
|
|
1054
|
+
const style = window.getComputedStyle(parent);
|
|
1055
|
+
if (overflowRegex.test(style.overflow + style.overflowX + style.overflowY)) {
|
|
1056
|
+
return parent;
|
|
1057
|
+
}
|
|
1065
1058
|
}
|
|
1066
|
-
return
|
|
1067
|
-
x,
|
|
1068
|
-
y
|
|
1069
|
-
};
|
|
1059
|
+
return window;
|
|
1070
1060
|
}
|
|
1071
|
-
function
|
|
1072
|
-
let x;
|
|
1073
|
-
if (
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
x
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
y
|
|
1061
|
+
function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
|
|
1062
|
+
let { x, y } = point;
|
|
1063
|
+
if (!isArrowCenter) {
|
|
1064
|
+
const { width, height } = originRect;
|
|
1065
|
+
if (x && placement.includes("start")) {
|
|
1066
|
+
x = 12;
|
|
1067
|
+
}
|
|
1068
|
+
if (x && placement.includes("end")) {
|
|
1069
|
+
x = Math.round(width - 24);
|
|
1070
|
+
}
|
|
1071
|
+
if (y && placement.includes("start")) {
|
|
1072
|
+
y = 10;
|
|
1073
|
+
}
|
|
1074
|
+
if (y && placement.includes("end")) {
|
|
1075
|
+
y = height - 14;
|
|
1076
|
+
}
|
|
1085
1077
|
}
|
|
1086
|
-
return {
|
|
1087
|
-
x,
|
|
1088
|
-
y
|
|
1089
|
-
};
|
|
1078
|
+
return { x, y };
|
|
1090
1079
|
}
|
|
1091
|
-
function
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1080
|
+
function useOverlay(props, emit) {
|
|
1081
|
+
const overlayRef = ref();
|
|
1082
|
+
const arrowRef = ref();
|
|
1083
|
+
const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
|
|
1084
|
+
const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
|
|
1085
|
+
const staticSide = {
|
|
1086
|
+
top: "bottom",
|
|
1087
|
+
right: "left",
|
|
1088
|
+
bottom: "top",
|
|
1089
|
+
left: "right"
|
|
1090
|
+
}[placement.split("-")[0]];
|
|
1091
|
+
Object.assign(arrowEl.style, {
|
|
1092
|
+
left: x ? `${x}px` : "",
|
|
1093
|
+
top: y ? `${y}px` : "",
|
|
1094
|
+
right: "",
|
|
1095
|
+
bottom: "",
|
|
1096
|
+
[staticSide]: "-4px"
|
|
1097
|
+
});
|
|
1099
1098
|
};
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
const
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1099
|
+
const updatePosition = async () => {
|
|
1100
|
+
const hostEl = props.origin;
|
|
1101
|
+
const overlayEl = unref(overlayRef.value);
|
|
1102
|
+
const arrowEl = unref(arrowRef.value);
|
|
1103
|
+
const middleware = [
|
|
1104
|
+
shift(),
|
|
1105
|
+
offset(props.offset),
|
|
1106
|
+
autoPlacement({
|
|
1107
|
+
alignment: props.align,
|
|
1108
|
+
allowedPlacements: props.position
|
|
1109
|
+
})
|
|
1110
|
+
];
|
|
1111
|
+
props.showArrow && middleware.push(arrow({ element: arrowEl }));
|
|
1112
|
+
const { x, y, placement, middlewareData } = await computePosition(hostEl, overlayEl, {
|
|
1113
|
+
strategy: "fixed",
|
|
1114
|
+
middleware
|
|
1115
|
+
});
|
|
1116
|
+
emit("positionChange", placement);
|
|
1117
|
+
Object.assign(overlayEl.style, { top: `${y}px`, left: `${x}px` });
|
|
1118
|
+
props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
|
|
1108
1119
|
};
|
|
1120
|
+
watch(() => props.modelValue, () => {
|
|
1121
|
+
const originParent = getScrollParent(props.origin);
|
|
1122
|
+
if (props.modelValue && props.origin) {
|
|
1123
|
+
nextTick(updatePosition);
|
|
1124
|
+
originParent.addEventListener("scroll", updatePosition);
|
|
1125
|
+
originParent !== window && window.addEventListener("scroll", updatePosition);
|
|
1126
|
+
window.addEventListener("resize", updatePosition);
|
|
1127
|
+
} else {
|
|
1128
|
+
originParent.removeEventListener("scroll", updatePosition);
|
|
1129
|
+
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
1130
|
+
window.removeEventListener("resize", updatePosition);
|
|
1131
|
+
}
|
|
1132
|
+
});
|
|
1133
|
+
onUnmounted(() => {
|
|
1134
|
+
const originParent = getScrollParent(props.origin);
|
|
1135
|
+
originParent.removeEventListener("scroll", updatePosition);
|
|
1136
|
+
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
1137
|
+
window.removeEventListener("resize", updatePosition);
|
|
1138
|
+
});
|
|
1139
|
+
return { arrowRef, overlayRef, updatePosition };
|
|
1109
1140
|
}
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1141
|
+
var flexibleOverlay = "";
|
|
1142
|
+
const FlexibleOverlay = defineComponent({
|
|
1143
|
+
name: "DFlexibleOverlay",
|
|
1144
|
+
inheritAttrs: false,
|
|
1145
|
+
props: flexibleOverlayProps,
|
|
1146
|
+
emits: ["update:modelValue", "positionChange"],
|
|
1147
|
+
setup(props, {
|
|
1148
|
+
slots,
|
|
1149
|
+
attrs,
|
|
1150
|
+
emit,
|
|
1151
|
+
expose
|
|
1152
|
+
}) {
|
|
1153
|
+
const {
|
|
1154
|
+
arrowRef,
|
|
1155
|
+
overlayRef,
|
|
1156
|
+
updatePosition
|
|
1157
|
+
} = useOverlay(props, emit);
|
|
1158
|
+
expose({
|
|
1159
|
+
updatePosition
|
|
1115
1160
|
});
|
|
1116
|
-
return () =>
|
|
1161
|
+
return () => {
|
|
1162
|
+
var _a;
|
|
1163
|
+
return props.modelValue && createVNode("div", mergeProps({
|
|
1164
|
+
"ref": overlayRef,
|
|
1165
|
+
"class": "devui-flexible-overlay"
|
|
1166
|
+
}, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), props.showArrow && createVNode("div", {
|
|
1167
|
+
"ref": arrowRef,
|
|
1168
|
+
"class": "devui-flexible-overlay-arrow"
|
|
1169
|
+
}, null)]);
|
|
1170
|
+
};
|
|
1117
1171
|
}
|
|
1118
|
-
|
|
1119
|
-
};
|
|
1120
|
-
}
|
|
1121
|
-
FlexibleOverlay.install = function(app) {
|
|
1122
|
-
app.component(FlexibleOverlay.name, FlexibleOverlay);
|
|
1123
|
-
};
|
|
1124
|
-
FixedOverlay.install = function(app) {
|
|
1125
|
-
app.component(FixedOverlay.name, FixedOverlay);
|
|
1126
|
-
};
|
|
1172
|
+
});
|
|
1127
1173
|
var dropdown = "";
|
|
1174
|
+
let dropdownId = 1;
|
|
1128
1175
|
var Dropdown = defineComponent({
|
|
1129
1176
|
name: "DDropdown",
|
|
1177
|
+
inheritAttrs: false,
|
|
1130
1178
|
props: dropdownProps,
|
|
1131
|
-
emits: [],
|
|
1132
|
-
setup(props,
|
|
1179
|
+
emits: ["toggle"],
|
|
1180
|
+
setup(props, {
|
|
1181
|
+
slots,
|
|
1182
|
+
attrs,
|
|
1183
|
+
emit,
|
|
1184
|
+
expose
|
|
1185
|
+
}) {
|
|
1133
1186
|
const {
|
|
1187
|
+
visible,
|
|
1188
|
+
position,
|
|
1189
|
+
align,
|
|
1190
|
+
offset: offset2,
|
|
1191
|
+
showAnimation
|
|
1192
|
+
} = toRefs(props);
|
|
1193
|
+
const origin = ref();
|
|
1194
|
+
const dropdownRef = ref();
|
|
1195
|
+
const overlayRef = ref();
|
|
1196
|
+
const id = `dropdown_${dropdownId++}`;
|
|
1197
|
+
const isOpen = ref(false);
|
|
1198
|
+
const currentPosition = ref("bottom");
|
|
1199
|
+
useDropdownEvent({
|
|
1200
|
+
id,
|
|
1134
1201
|
isOpen,
|
|
1135
1202
|
origin,
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
} = toRefs(props);
|
|
1140
|
-
const visible = ref(false);
|
|
1141
|
-
watch(isOpen, (value) => {
|
|
1142
|
-
visible.value = value;
|
|
1143
|
-
}, {
|
|
1144
|
-
immediate: true
|
|
1203
|
+
dropdownRef,
|
|
1204
|
+
props,
|
|
1205
|
+
emit
|
|
1145
1206
|
});
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1207
|
+
useDropdown(id, visible, isOpen, origin, dropdownRef, currentPosition, emit);
|
|
1208
|
+
const {
|
|
1209
|
+
overlayModelValue,
|
|
1210
|
+
overlayShowValue,
|
|
1211
|
+
styles,
|
|
1212
|
+
classes,
|
|
1213
|
+
handlePositionChange
|
|
1214
|
+
} = useOverlayProps(props, currentPosition, isOpen);
|
|
1215
|
+
expose({
|
|
1216
|
+
updatePosition: () => overlayRef.value.updatePosition()
|
|
1217
|
+
});
|
|
1218
|
+
return () => {
|
|
1219
|
+
var _a;
|
|
1220
|
+
return createVNode(Fragment, null, [createVNode("div", {
|
|
1221
|
+
"ref": origin,
|
|
1222
|
+
"class": "devui-dropdown-toggle"
|
|
1223
|
+
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]), createVNode(Teleport, {
|
|
1224
|
+
"to": "body"
|
|
1225
|
+
}, {
|
|
1226
|
+
default: () => [createVNode(Transition, {
|
|
1227
|
+
"name": showAnimation.value ? `devui-dropdown-fade-${currentPosition.value}` : ""
|
|
1228
|
+
}, {
|
|
1229
|
+
default: () => [withDirectives(createVNode(FlexibleOverlay, {
|
|
1230
|
+
"modelValue": overlayModelValue.value,
|
|
1231
|
+
"onUpdate:modelValue": ($event) => overlayModelValue.value = $event,
|
|
1232
|
+
"ref": overlayRef,
|
|
1233
|
+
"origin": origin.value,
|
|
1234
|
+
"position": position.value,
|
|
1235
|
+
"align": align.value,
|
|
1236
|
+
"offset": offset2.value,
|
|
1237
|
+
"onPositionChange": handlePositionChange,
|
|
1238
|
+
"class": classes.value,
|
|
1239
|
+
"style": styles.value
|
|
1240
|
+
}, {
|
|
1241
|
+
default: () => {
|
|
1242
|
+
var _a2;
|
|
1243
|
+
return [createVNode("div", mergeProps({
|
|
1244
|
+
"ref": dropdownRef,
|
|
1245
|
+
"class": "devui-dropdown-menu-wrap"
|
|
1246
|
+
}, attrs), [(_a2 = slots.menu) == null ? void 0 : _a2.call(slots)])];
|
|
1247
|
+
}
|
|
1248
|
+
}), [[vShow, overlayShowValue.value]])]
|
|
1249
|
+
})]
|
|
1250
|
+
})]);
|
|
1151
1251
|
};
|
|
1252
|
+
}
|
|
1253
|
+
});
|
|
1254
|
+
const dropdownMenuProps = {
|
|
1255
|
+
modelValue: {
|
|
1256
|
+
type: Boolean,
|
|
1257
|
+
default: false
|
|
1258
|
+
},
|
|
1259
|
+
origin: {
|
|
1260
|
+
type: Object,
|
|
1261
|
+
require: true
|
|
1262
|
+
},
|
|
1263
|
+
position: {
|
|
1264
|
+
type: Array,
|
|
1265
|
+
default: ["bottom"]
|
|
1266
|
+
},
|
|
1267
|
+
align: {
|
|
1268
|
+
type: String,
|
|
1269
|
+
default: null
|
|
1270
|
+
},
|
|
1271
|
+
offset: {
|
|
1272
|
+
type: [Number, Object],
|
|
1273
|
+
default: 4
|
|
1274
|
+
},
|
|
1275
|
+
clickOutside: {
|
|
1276
|
+
type: Function,
|
|
1277
|
+
default: () => true
|
|
1278
|
+
},
|
|
1279
|
+
showAnimation: {
|
|
1280
|
+
type: Boolean,
|
|
1281
|
+
default: true
|
|
1282
|
+
},
|
|
1283
|
+
overlayClass: {
|
|
1284
|
+
type: String,
|
|
1285
|
+
default: ""
|
|
1286
|
+
}
|
|
1287
|
+
};
|
|
1288
|
+
defineComponent({
|
|
1289
|
+
name: "DDropdownMenu",
|
|
1290
|
+
inheritAttrs: false,
|
|
1291
|
+
props: dropdownMenuProps,
|
|
1292
|
+
emits: ["update:modelValue"],
|
|
1293
|
+
setup(props, {
|
|
1294
|
+
slots,
|
|
1295
|
+
attrs,
|
|
1296
|
+
emit
|
|
1297
|
+
}) {
|
|
1152
1298
|
const {
|
|
1153
|
-
|
|
1154
|
-
} = useDropdown({
|
|
1155
|
-
visible,
|
|
1299
|
+
modelValue,
|
|
1156
1300
|
origin,
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
});
|
|
1164
|
-
const
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1301
|
+
position,
|
|
1302
|
+
align,
|
|
1303
|
+
offset: offset2,
|
|
1304
|
+
clickOutside,
|
|
1305
|
+
showAnimation,
|
|
1306
|
+
overlayClass
|
|
1307
|
+
} = toRefs(props);
|
|
1308
|
+
const dropdownMenuRef = ref(null);
|
|
1309
|
+
onClickOutside(dropdownMenuRef, (value) => {
|
|
1310
|
+
var _a, _b;
|
|
1311
|
+
if (((_a = clickOutside.value) == null ? void 0 : _a.call(clickOutside)) && !((_b = origin == null ? void 0 : origin.value) == null ? void 0 : _b.contains(value.target))) {
|
|
1312
|
+
emit("update:modelValue", false);
|
|
1313
|
+
}
|
|
1168
1314
|
});
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
"
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
"
|
|
1315
|
+
const currentPosition = ref("bottom");
|
|
1316
|
+
const handlePositionChange = (pos) => {
|
|
1317
|
+
currentPosition.value = pos.split("-")[0] === "top" ? "top" : "bottom";
|
|
1318
|
+
};
|
|
1319
|
+
const styles = computed(() => ({
|
|
1320
|
+
transformOrigin: currentPosition.value === "top" ? "0% 100%" : "0% 0%"
|
|
1321
|
+
}));
|
|
1322
|
+
return () => createVNode(Teleport, {
|
|
1323
|
+
"to": "body"
|
|
1175
1324
|
}, {
|
|
1176
1325
|
default: () => [createVNode(Transition, {
|
|
1177
|
-
"name":
|
|
1326
|
+
"name": showAnimation.value ? `devui-dropdown-fade-${currentPosition.value}` : ""
|
|
1178
1327
|
}, {
|
|
1179
|
-
default: () => {
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1328
|
+
default: () => [createVNode(FlexibleOverlay, {
|
|
1329
|
+
"modelValue": modelValue.value,
|
|
1330
|
+
"onUpdate:modelValue": ($event) => modelValue.value = $event,
|
|
1331
|
+
"origin": origin == null ? void 0 : origin.value,
|
|
1332
|
+
"position": position.value,
|
|
1333
|
+
"align": align.value,
|
|
1334
|
+
"offset": offset2.value,
|
|
1335
|
+
"onPositionChange": handlePositionChange,
|
|
1336
|
+
"class": overlayClass.value,
|
|
1337
|
+
"style": styles.value
|
|
1338
|
+
}, {
|
|
1339
|
+
default: () => {
|
|
1340
|
+
var _a;
|
|
1341
|
+
return [createVNode("div", mergeProps({
|
|
1342
|
+
"ref": dropdownMenuRef,
|
|
1343
|
+
"class": "devui-dropdown-menu-wrap"
|
|
1344
|
+
}, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots)])];
|
|
1345
|
+
}
|
|
1346
|
+
})]
|
|
1187
1347
|
})]
|
|
1188
1348
|
});
|
|
1189
1349
|
}
|
|
1190
1350
|
});
|
|
1191
|
-
Dropdown.install = function(app) {
|
|
1192
|
-
app.component(Dropdown.name, Dropdown);
|
|
1193
|
-
};
|
|
1194
1351
|
var filter = "";
|
|
1195
1352
|
const Filter = defineComponent({
|
|
1196
1353
|
props: {
|