Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

1 riga
1.1 KiB

  1. {"ast":null,"code":"import clamp from 'lodash-es/clamp';\nexport function scrollIntoView(scrollbar, elem, _a) {\n var _b = _a === void 0 ? {} : _a,\n _c = _b.alignToTop,\n alignToTop = _c === void 0 ? true : _c,\n _d = _b.onlyScrollIfNeeded,\n onlyScrollIfNeeded = _d === void 0 ? false : _d,\n _e = _b.offsetTop,\n offsetTop = _e === void 0 ? 0 : _e,\n _f = _b.offsetLeft,\n offsetLeft = _f === void 0 ? 0 : _f,\n _g = _b.offsetBottom,\n offsetBottom = _g === void 0 ? 0 : _g;\n\n var containerEl = scrollbar.containerEl,\n bounding = scrollbar.bounding,\n offset = scrollbar.offset,\n limit = scrollbar.limit;\n if (!elem || !containerEl.contains(elem)) return;\n var targetBounding = elem.getBoundingClientRect();\n if (onlyScrollIfNeeded && scrollbar.isVisible(elem)) return;\n var delta = alignToTop ? targetBounding.top - bounding.top - offsetTop : targetBounding.bottom - bounding.bottom + offsetBottom;\n scrollbar.setMomentum(targetBounding.left - bounding.left - offsetLeft, clamp(delta, -offset.y, limit.y - offset.y));\n}","map":null,"metadata":{},"sourceType":"module"}