bkui-vue 0.0.1-beta.103 → 0.0.1-beta.104

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/dist/index.esm.js CHANGED
@@ -18674,7 +18674,13 @@ const Message$1 = (constructor, options) => {
18674
18674
  };
18675
18675
  render(vm, container2);
18676
18676
  instances[position].push(vm);
18677
- document.body.appendChild(container2.firstElementChild);
18677
+ let target;
18678
+ if (vm.props.getContainer && isElement$2(vm.props.getContainer)) {
18679
+ target = vm.props.getContainer;
18680
+ } else {
18681
+ target = document.body;
18682
+ }
18683
+ target.appendChild(container2.firstElementChild);
18678
18684
  };
18679
18685
  function close(id, position, spacing, userOnClose) {
18680
18686
  userOnClose == null ? void 0 : userOnClose();
@@ -18703,7 +18709,8 @@ const messageProps = {
18703
18709
  offsetY: PropTypes.number.def(30),
18704
18710
  spacing: PropTypes.number.def(10),
18705
18711
  extCls: PropTypes.string.def(""),
18706
- onClose: PropTypes.func
18712
+ onClose: PropTypes.func,
18713
+ getContainer: PropTypes.instanceOf(HTMLElement)
18707
18714
  };
18708
18715
  var MessageConstructor = defineComponent({
18709
18716
  name: "Message",
@@ -18714,9 +18721,11 @@ var MessageConstructor = defineComponent({
18714
18721
  }) {
18715
18722
  const classNames = computed(() => ["bk-message", `bk-message-${props.theme}`, `${props.extCls}`]);
18716
18723
  const zIndex = bkZIndexManager.getMessageNextIndex();
18724
+ const isGetContainer = computed(() => props.getContainer && isElement$2(props.getContainer));
18717
18725
  const styles = computed(() => ({
18718
18726
  top: `${props.offsetY}px`,
18719
- zIndex
18727
+ zIndex,
18728
+ position: isGetContainer.value ? "absolute" : "fixed"
18720
18729
  }));
18721
18730
  const visible = ref(false);
18722
18731
  let timer = null;