vue-devui 1.6.3-markdown.2 → 1.6.3-select.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.
@@ -9416,8 +9416,16 @@ var Select = defineComponent({
9416
9416
  toggleChange
9417
9417
  });
9418
9418
  const isRender = ref(false);
9419
+ const currentPosition = ref("bottom");
9419
9420
  const position = ref(["bottom-start", "top-start"]);
9420
9421
  const dropdownWidth = ref("0");
9422
+ const handlePositionChange = (pos) => {
9423
+ currentPosition.value = pos.split("-")[0] === "top" ? "top" : "bottom";
9424
+ };
9425
+ const styles = computed(() => ({
9426
+ transformOrigin: currentPosition.value === "top" ? "0% 100%" : "0% 0%",
9427
+ "z-index": "var(--devui-z-index-dropdown, 1052)"
9428
+ }));
9421
9429
  const updateDropdownWidth = () => {
9422
9430
  var _a;
9423
9431
  dropdownWidth.value = ((_a = originRef == null ? void 0 : originRef.value) == null ? void 0 : _a.clientWidth) ? originRef.value.clientWidth + "px" : "100%";
@@ -9472,9 +9480,9 @@ var Select = defineComponent({
9472
9480
  "to": "body"
9473
9481
  }, {
9474
9482
  default: () => [createVNode(Transition, {
9475
- "name": "fade"
9483
+ "name": `fade-${currentPosition.value}`
9476
9484
  }, {
9477
- default: () => [createVNode(FlexibleOverlay, {
9485
+ default: () => [withDirectives(createVNode(FlexibleOverlay, {
9478
9486
  "modelValue": isRender.value,
9479
9487
  "onUpdate:modelValue": ($event) => isRender.value = $event,
9480
9488
  "ref": dropdownRef,
@@ -9482,18 +9490,15 @@ var Select = defineComponent({
9482
9490
  "align": "start",
9483
9491
  "offset": 4,
9484
9492
  "position": position.value,
9485
- "style": {
9486
- visibility: isOpen.value ? "visible" : "hidden",
9487
- "z-index": isOpen.value ? "var(--devui-z-index-dropdown, 1052)" : -1
9488
- }
9493
+ "onPositionChange": handlePositionChange,
9494
+ "style": styles.value
9489
9495
  }, {
9490
9496
  default: () => {
9491
9497
  var _a, _b, _c, _d;
9492
9498
  return [createVNode("div", {
9493
9499
  "class": dropdownCls,
9494
9500
  "style": {
9495
- width: `${dropdownWidth.value}`,
9496
- visibility: isOpen.value ? "visible" : "hidden"
9501
+ width: `${dropdownWidth.value}`
9497
9502
  }
9498
9503
  }, [withDirectives(createVNode("ul", {
9499
9504
  "class": listCls,
@@ -9522,7 +9527,7 @@ var Select = defineComponent({
9522
9527
  "class": dropdownEmptyCls
9523
9528
  }, [emptyText.value])])])];
9524
9529
  }
9525
- })]
9530
+ }), [[vShow, isOpen.value]])]
9526
9531
  })]
9527
9532
  })]);
9528
9533
  };