29719ab4340cd578bb3f2bde89fbb774bc38ba08b12712da3224be231e567e1fb41f01e4a334245f375fa5d4aa619d7e517c7875cd5b74234084872c5ce165 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var vue = require('vue');
  4. var index = require('../../../../hooks/use-z-index/index.js');
  5. var index$1 = require('../../../../hooks/use-namespace/index.js');
  6. var types = require('../../../../utils/types.js');
  7. const usePopperContentDOM = (props, {
  8. attributes,
  9. styles,
  10. role
  11. }) => {
  12. const { nextZIndex } = index.useZIndex();
  13. const ns = index$1.useNamespace("popper");
  14. const contentAttrs = vue.computed(() => vue.unref(attributes).popper);
  15. const contentZIndex = vue.ref(types.isNumber(props.zIndex) ? props.zIndex : nextZIndex());
  16. const contentClass = vue.computed(() => [
  17. ns.b(),
  18. ns.is("pure", props.pure),
  19. ns.is(props.effect),
  20. props.popperClass
  21. ]);
  22. const contentStyle = vue.computed(() => {
  23. return [
  24. { zIndex: vue.unref(contentZIndex) },
  25. vue.unref(styles).popper,
  26. props.popperStyle || {}
  27. ];
  28. });
  29. const ariaModal = vue.computed(() => role.value === "dialog" ? "false" : void 0);
  30. const arrowStyle = vue.computed(() => vue.unref(styles).arrow || {});
  31. const updateZIndex = () => {
  32. contentZIndex.value = types.isNumber(props.zIndex) ? props.zIndex : nextZIndex();
  33. };
  34. return {
  35. ariaModal,
  36. arrowStyle,
  37. contentAttrs,
  38. contentClass,
  39. contentStyle,
  40. contentZIndex,
  41. updateZIndex
  42. };
  43. };
  44. exports.usePopperContentDOM = usePopperContentDOM;
  45. //# sourceMappingURL=use-content-dom.js.map