@skyux/core 7.0.0 → 7.1.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.
@@ -3112,7 +3112,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
3112
3112
  type: Injectable
3113
3113
  }] });
3114
3114
 
3115
- var _SkyViewkeeper_instances, _SkyViewkeeper_boundaryEl, _SkyViewkeeper_el, _SkyViewkeeper_id, _SkyViewkeeper_setWidth, _SkyViewkeeper_verticalOffset, _SkyViewkeeper_verticalOffsetEl, _SkyViewkeeper_viewportMarginTop, _SkyViewkeeper_currentElFixedLeft, _SkyViewkeeper_currentElFixedTop, _SkyViewkeeper_currentElFixedWidth, _SkyViewkeeper_isDestroyed, _SkyViewkeeper_scrollableHost, _SkyViewkeeper_syncElPositionHandler, _SkyViewkeeper_getSpacerId, _SkyViewkeeper_unfixEl, _SkyViewkeeper_calculateVerticalOffset, _SkyViewkeeper_shouldFixEl, _SkyViewkeeper_getFixedStyles, _SkyViewkeeper_needsUpdating, _SkyViewkeeper_fixEl, _SkyViewkeeper_getBoundaryInfo;
3115
+ var _SkyViewkeeper_instances, _SkyViewkeeper_boundaryEl, _SkyViewkeeper_el, _SkyViewkeeper_id, _SkyViewkeeper_setWidth, _SkyViewkeeper_verticalOffset, _SkyViewkeeper_verticalOffsetEl, _SkyViewkeeper_viewportMarginTop, _SkyViewkeeper_currentElFixedLeft, _SkyViewkeeper_currentElFixedTop, _SkyViewkeeper_currentElFixedWidth, _SkyViewkeeper_currentElClipLeft, _SkyViewkeeper_currentElClipTop, _SkyViewkeeper_isDestroyed, _SkyViewkeeper_scrollableHost, _SkyViewkeeper_syncElPositionHandler, _SkyViewkeeper_intersectionObserver, _SkyViewkeeper_getSpacerId, _SkyViewkeeper_unfixEl, _SkyViewkeeper_calculateVerticalOffset, _SkyViewkeeper_shouldFixEl, _SkyViewkeeper_getFixedStyles, _SkyViewkeeper_needsUpdating, _SkyViewkeeper_fixEl, _SkyViewkeeper_getBoundaryInfo;
3116
3116
  const CLS_VIEWKEEPER_FIXED = 'sky-viewkeeper-fixed';
3117
3117
  const EVT_AFTER_VIEWKEEPER_SYNC = 'afterViewkeeperSync';
3118
3118
  let styleEl;
@@ -3156,10 +3156,12 @@ function px(value) {
3156
3156
  }
3157
3157
  return pxValue;
3158
3158
  }
3159
- function setElPosition(el, left, top, width, marginTop) {
3159
+ function setElPosition(el, left, top, width, marginTop, clipTop, clipLeft) {
3160
3160
  el.style.top = px(top);
3161
3161
  el.style.left = px(left);
3162
3162
  el.style.marginTop = px(marginTop);
3163
+ el.style.clipPath =
3164
+ clipTop || clipLeft ? `inset(${px(clipTop)} 0 0 ${px(clipLeft)})` : 'none';
3163
3165
  /*istanbul ignore else*/
3164
3166
  /* sanity check */
3165
3167
  if (width !== null) {
@@ -3190,9 +3192,12 @@ class SkyViewkeeper {
3190
3192
  _SkyViewkeeper_currentElFixedLeft.set(this, void 0);
3191
3193
  _SkyViewkeeper_currentElFixedTop.set(this, void 0);
3192
3194
  _SkyViewkeeper_currentElFixedWidth.set(this, void 0);
3195
+ _SkyViewkeeper_currentElClipLeft.set(this, void 0);
3196
+ _SkyViewkeeper_currentElClipTop.set(this, void 0);
3193
3197
  _SkyViewkeeper_isDestroyed.set(this, false);
3194
3198
  _SkyViewkeeper_scrollableHost.set(this, void 0);
3195
3199
  _SkyViewkeeper_syncElPositionHandler.set(this, void 0);
3200
+ _SkyViewkeeper_intersectionObserver.set(this, void 0);
3196
3201
  options = options || /* istanbul ignore next */ {};
3197
3202
  __classPrivateFieldSet(this, _SkyViewkeeper_el, options.el, "f");
3198
3203
  __classPrivateFieldSet(this, _SkyViewkeeper_boundaryEl, options.boundaryEl, "f");
@@ -3245,6 +3250,7 @@ class SkyViewkeeper {
3245
3250
  }
3246
3251
  destroy() {
3247
3252
  if (!__classPrivateFieldGet(this, _SkyViewkeeper_isDestroyed, "f")) {
3253
+ __classPrivateFieldGet(this, _SkyViewkeeper_intersectionObserver, "f")?.disconnect();
3248
3254
  window.removeEventListener('scroll', __classPrivateFieldGet(this, _SkyViewkeeper_syncElPositionHandler, "f"), true);
3249
3255
  window.removeEventListener('resize', __classPrivateFieldGet(this, _SkyViewkeeper_syncElPositionHandler, "f"));
3250
3256
  window.removeEventListener('orientationchange', __classPrivateFieldGet(this, _SkyViewkeeper_syncElPositionHandler, "f"));
@@ -3259,7 +3265,7 @@ class SkyViewkeeper {
3259
3265
  }
3260
3266
  }
3261
3267
  }
3262
- _SkyViewkeeper_boundaryEl = new WeakMap(), _SkyViewkeeper_el = new WeakMap(), _SkyViewkeeper_id = new WeakMap(), _SkyViewkeeper_setWidth = new WeakMap(), _SkyViewkeeper_verticalOffset = new WeakMap(), _SkyViewkeeper_verticalOffsetEl = new WeakMap(), _SkyViewkeeper_viewportMarginTop = new WeakMap(), _SkyViewkeeper_currentElFixedLeft = new WeakMap(), _SkyViewkeeper_currentElFixedTop = new WeakMap(), _SkyViewkeeper_currentElFixedWidth = new WeakMap(), _SkyViewkeeper_isDestroyed = new WeakMap(), _SkyViewkeeper_scrollableHost = new WeakMap(), _SkyViewkeeper_syncElPositionHandler = new WeakMap(), _SkyViewkeeper_instances = new WeakSet(), _SkyViewkeeper_getSpacerId = function _SkyViewkeeper_getSpacerId() {
3268
+ _SkyViewkeeper_boundaryEl = new WeakMap(), _SkyViewkeeper_el = new WeakMap(), _SkyViewkeeper_id = new WeakMap(), _SkyViewkeeper_setWidth = new WeakMap(), _SkyViewkeeper_verticalOffset = new WeakMap(), _SkyViewkeeper_verticalOffsetEl = new WeakMap(), _SkyViewkeeper_viewportMarginTop = new WeakMap(), _SkyViewkeeper_currentElFixedLeft = new WeakMap(), _SkyViewkeeper_currentElFixedTop = new WeakMap(), _SkyViewkeeper_currentElFixedWidth = new WeakMap(), _SkyViewkeeper_currentElClipLeft = new WeakMap(), _SkyViewkeeper_currentElClipTop = new WeakMap(), _SkyViewkeeper_isDestroyed = new WeakMap(), _SkyViewkeeper_scrollableHost = new WeakMap(), _SkyViewkeeper_syncElPositionHandler = new WeakMap(), _SkyViewkeeper_intersectionObserver = new WeakMap(), _SkyViewkeeper_instances = new WeakSet(), _SkyViewkeeper_getSpacerId = function _SkyViewkeeper_getSpacerId() {
3263
3269
  return __classPrivateFieldGet(this, _SkyViewkeeper_id, "f") + '-spacer';
3264
3270
  }, _SkyViewkeeper_unfixEl = function _SkyViewkeeper_unfixEl(el) {
3265
3271
  const spacerEl = document.getElementById(__classPrivateFieldGet(this, _SkyViewkeeper_instances, "m", _SkyViewkeeper_getSpacerId).call(this));
@@ -3273,7 +3279,7 @@ _SkyViewkeeper_boundaryEl = new WeakMap(), _SkyViewkeeper_el = new WeakMap(), _S
3273
3279
  if (__classPrivateFieldGet(this, _SkyViewkeeper_setWidth, "f")) {
3274
3280
  width = 'auto';
3275
3281
  }
3276
- setElPosition(el, '', '', width, '');
3282
+ setElPosition(el, '', '', width, '', 0, 0);
3277
3283
  }, _SkyViewkeeper_calculateVerticalOffset = function _SkyViewkeeper_calculateVerticalOffset() {
3278
3284
  let offset = __classPrivateFieldGet(this, _SkyViewkeeper_verticalOffset, "f");
3279
3285
  if (__classPrivateFieldGet(this, _SkyViewkeeper_verticalOffsetEl, "f")) {
@@ -3301,20 +3307,27 @@ _SkyViewkeeper_boundaryEl = new WeakMap(), _SkyViewkeeper_el = new WeakMap(), _S
3301
3307
  // will be 0 (fully visible) unless the user is scrolling the boundary out of view.
3302
3308
  // In that case, the element should begin to scroll out of view with the
3303
3309
  // rest of the boundary by setting its top position to a negative value.
3304
- const elFixedTop = Math.min(boundaryInfo.boundaryBottom -
3310
+ const elTop = boundaryInfo.boundaryBottom -
3305
3311
  boundaryInfo.elHeight -
3306
- boundaryInfo.scrollTop, verticalOffset);
3312
+ boundaryInfo.scrollTop;
3313
+ const elClipTop = elTop < verticalOffset ? verticalOffset - elTop : 0;
3314
+ const elFixedTop = Math.min(elTop, verticalOffset);
3307
3315
  const elFixedWidth = boundaryInfo.boundaryEl.getBoundingClientRect().width;
3308
3316
  const elFixedLeft = boundaryInfo.boundaryOffset.left - boundaryInfo.scrollLeft;
3317
+ const elClipLeft = elFixedLeft < 0 ? 0 - elFixedLeft : 0;
3309
3318
  return {
3310
3319
  elFixedLeft,
3311
3320
  elFixedTop,
3312
3321
  elFixedWidth,
3322
+ elClipLeft,
3323
+ elClipTop,
3313
3324
  };
3314
3325
  }, _SkyViewkeeper_needsUpdating = function _SkyViewkeeper_needsUpdating(doFixEl, fixedStyles) {
3315
3326
  if ((doFixEl &&
3316
3327
  __classPrivateFieldGet(this, _SkyViewkeeper_currentElFixedLeft, "f") === fixedStyles.elFixedLeft &&
3317
3328
  __classPrivateFieldGet(this, _SkyViewkeeper_currentElFixedTop, "f") === fixedStyles.elFixedTop &&
3329
+ __classPrivateFieldGet(this, _SkyViewkeeper_currentElClipLeft, "f") === fixedStyles.elClipLeft &&
3330
+ __classPrivateFieldGet(this, _SkyViewkeeper_currentElClipTop, "f") === fixedStyles.elClipTop &&
3318
3331
  __classPrivateFieldGet(this, _SkyViewkeeper_currentElFixedWidth, "f") === fixedStyles.elFixedWidth) ||
3319
3332
  (!doFixEl &&
3320
3333
  !(__classPrivateFieldGet(this, _SkyViewkeeper_currentElFixedLeft, "f") !== undefined &&
@@ -3341,12 +3354,14 @@ _SkyViewkeeper_boundaryEl = new WeakMap(), _SkyViewkeeper_el = new WeakMap(), _S
3341
3354
  el.classList.add(CLS_VIEWKEEPER_FIXED);
3342
3355
  __classPrivateFieldSet(this, _SkyViewkeeper_currentElFixedTop, fixedStyles.elFixedTop, "f");
3343
3356
  __classPrivateFieldSet(this, _SkyViewkeeper_currentElFixedLeft, fixedStyles.elFixedLeft, "f");
3357
+ __classPrivateFieldSet(this, _SkyViewkeeper_currentElClipTop, fixedStyles.elClipTop, "f");
3358
+ __classPrivateFieldSet(this, _SkyViewkeeper_currentElClipLeft, fixedStyles.elClipLeft, "f");
3344
3359
  __classPrivateFieldSet(this, _SkyViewkeeper_currentElFixedWidth, fixedStyles.elFixedWidth, "f");
3345
3360
  let width = 0;
3346
3361
  if (__classPrivateFieldGet(this, _SkyViewkeeper_setWidth, "f")) {
3347
3362
  width = fixedStyles.elFixedWidth;
3348
3363
  }
3349
- setElPosition(el, fixedStyles.elFixedLeft, fixedStyles.elFixedTop, width, __classPrivateFieldGet(this, _SkyViewkeeper_viewportMarginTop, "f"));
3364
+ setElPosition(el, fixedStyles.elFixedLeft, fixedStyles.elFixedTop, width, __classPrivateFieldGet(this, _SkyViewkeeper_viewportMarginTop, "f"), fixedStyles.elClipTop, fixedStyles.elClipLeft);
3350
3365
  }, _SkyViewkeeper_getBoundaryInfo = function _SkyViewkeeper_getBoundaryInfo(el, boundaryEl) {
3351
3366
  const spacerId = __classPrivateFieldGet(this, _SkyViewkeeper_instances, "m", _SkyViewkeeper_getSpacerId).call(this);
3352
3367
  const spacerEl = document.getElementById(spacerId);