mergedBuiltinPlacements.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. const getBuiltInPlacements = popupOverflow => {
  7. const htmlRegion = popupOverflow === 'scroll' ? 'scroll' : 'visible';
  8. const sharedConfig = {
  9. overflow: {
  10. adjustX: true,
  11. adjustY: true,
  12. shiftY: true
  13. },
  14. htmlRegion,
  15. dynamicInset: true
  16. };
  17. return {
  18. bottomLeft: Object.assign(Object.assign({}, sharedConfig), {
  19. points: ['tl', 'bl'],
  20. offset: [0, 4]
  21. }),
  22. bottomRight: Object.assign(Object.assign({}, sharedConfig), {
  23. points: ['tr', 'br'],
  24. offset: [0, 4]
  25. }),
  26. topLeft: Object.assign(Object.assign({}, sharedConfig), {
  27. points: ['bl', 'tl'],
  28. offset: [0, -4]
  29. }),
  30. topRight: Object.assign(Object.assign({}, sharedConfig), {
  31. points: ['br', 'tr'],
  32. offset: [0, -4]
  33. })
  34. };
  35. };
  36. function mergedBuiltinPlacements(buildInPlacements, popupOverflow) {
  37. return buildInPlacements || getBuiltInPlacements(popupOverflow);
  38. }
  39. var _default = exports.default = mergedBuiltinPlacements;