unpoly-rails 3.9.2.1 → 3.9.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@
5
5
  /***/ (() => {
6
6
 
7
7
  window.up = {
8
- version: '3.9.2'
8
+ version: '3.9.3'
9
9
  };
10
10
 
11
11
 
@@ -4664,6 +4664,7 @@ up.Layer.Overlay = class Overlay extends up.Layer {
4664
4664
  'dismissable',
4665
4665
  'dismissLabel',
4666
4666
  'dismissAriaLabel',
4667
+ 'trapFocus',
4667
4668
  'onOpened',
4668
4669
  'onAccept',
4669
4670
  'onAccepted',
@@ -5570,33 +5571,38 @@ up.OverlayFocus = class OverlayFocus {
5570
5571
  constructor(layer) {
5571
5572
  this._layer = layer;
5572
5573
  this._focusElement = this._layer.getFocusElement();
5574
+ this._trapFocus = this._layer.trapFocus;
5573
5575
  }
5574
5576
  moveToFront() {
5575
- if (this._enabled) {
5577
+ if (this._active) {
5576
5578
  return;
5577
5579
  }
5578
- this._enabled = true;
5579
- this._untrapFocus = up.on('focusin', event => this._onFocus(event));
5580
+ this._active = true;
5580
5581
  this._unsetAttrs = e.setTemporaryAttrs(this._focusElement, {
5581
5582
  'tabindex': '0',
5582
5583
  'role': 'dialog',
5583
- 'aria-modal': 'true'
5584
+ 'aria-modal': this._trapFocus.toString()
5584
5585
  });
5585
- this._focusTrapBefore = e.affix(this._focusElement, 'beforebegin', 'up-focus-trap[tabindex=0]');
5586
- this._focusTrapAfter = e.affix(this._focusElement, 'afterend', 'up-focus-trap[tabindex=0]');
5586
+ if (this._trapFocus) {
5587
+ this._untrapFocus = up.on('focusin', event => this._onFocus(event));
5588
+ this._focusTrapBefore = e.affix(this._focusElement, 'beforebegin', 'up-focus-trap[tabindex=0]');
5589
+ this._focusTrapAfter = e.affix(this._focusElement, 'afterend', 'up-focus-trap[tabindex=0]');
5590
+ }
5587
5591
  }
5588
5592
  moveToBack() {
5589
5593
  this.teardown();
5590
5594
  }
5591
5595
  teardown() {
5592
- if (!this._enabled) {
5596
+ if (!this._active) {
5593
5597
  return;
5594
5598
  }
5595
- this._enabled = false;
5596
- this._untrapFocus();
5599
+ this._active = false;
5597
5600
  this._unsetAttrs();
5598
- this._focusTrapBefore.remove();
5599
- this._focusTrapAfter.remove();
5601
+ if (this._trapFocus) {
5602
+ this._untrapFocus();
5603
+ this._focusTrapBefore.remove();
5604
+ this._focusTrapAfter.remove();
5605
+ }
5600
5606
  }
5601
5607
  _onFocus(event) {
5602
5608
  const { target } = event;
@@ -6049,7 +6055,6 @@ up.RenderOptions = (function () {
6049
6055
  finalize,
6050
6056
  assertContentGiven,
6051
6057
  deriveFailOptions,
6052
- lookupLayers: rememberOriginLayer,
6053
6058
  };
6054
6059
  })();
6055
6060
 
@@ -6571,12 +6576,12 @@ up.Request.Cache = class Cache {
6571
6576
  }
6572
6577
  reindex(request) {
6573
6578
  this._delete(request);
6579
+ delete request.cacheRoute;
6574
6580
  this.put(request);
6575
6581
  }
6576
6582
  _delete(request) {
6577
6583
  u.remove(this._requests, request);
6578
6584
  request.cacheRoute?.delete(request);
6579
- delete request.cacheRoute;
6580
6585
  }
6581
6586
  _getRoute(request) {
6582
6587
  return request.cacheRoute || (this._routes[request.description] ||= new Route());
@@ -9547,7 +9552,8 @@ up.layer = (function () {
9547
9552
  dismissLabel: '×',
9548
9553
  dismissAriaLabel: 'Dismiss dialog',
9549
9554
  dismissable: true,
9550
- history: 'auto'
9555
+ history: 'auto',
9556
+ trapFocus: true,
9551
9557
  },
9552
9558
  cover: {
9553
9559
  mainTargets: ['[up-main~=cover]']
@@ -9580,7 +9586,8 @@ up.layer = (function () {
9580
9586
  position: 'bottom',
9581
9587
  size: 'medium',
9582
9588
  align: 'left',
9583
- dismissable: 'outside key'
9589
+ dismissable: 'outside key',
9590
+ trapFocus: false,
9584
9591
  },
9585
9592
  foreignOverlaySelectors: ['dialog']
9586
9593
  };
@@ -2,5 +2,5 @@
2
2
  up-wrapper{display:inline-block}
3
3
  up-bounds{position:absolute}.up-focus-hidden:focus-visible{outline:none !important}body.up-scrollbar-away{overflow-y:hidden !important;padding-right:calc(var(--up-scrollbar-width) + var(--up-original-padding-right)) !important}body.up-scrollbar-away .up-scrollbar-away{right:calc(var(--up-scrollbar-width) + var(--up-original-right)) !important}
4
4
  .up-request-loader{display:none}up-progress-bar{position:fixed;top:0;left:0;z-index:999999999;height:3px;background-color:#007bff}
5
- up-focus-trap{position:fixed;top:0;left:0;width:0;height:0}up-cover-viewport,up-drawer-viewport,up-modal-viewport,up-drawer-backdrop,up-modal-backdrop,up-cover,up-drawer,up-modal{top:0;left:0;bottom:0;right:0}up-drawer-box,up-modal-box{box-shadow:0 0 10px 1px rgba(0,0,0,.3)}up-popup{box-shadow:0 0 4px rgba(0,0,0,.3)}up-popup:focus,up-cover-box:focus,up-drawer-box:focus,up-modal-box:focus,up-cover:focus,up-drawer:focus,up-modal:focus,up-popup:focus-visible,up-cover-box:focus-visible,up-drawer-box:focus-visible,up-modal-box:focus-visible,up-cover:focus-visible,up-drawer:focus-visible,up-modal:focus-visible{outline:none}up-cover,up-drawer,up-modal{z-index:2000;position:fixed}up-drawer-backdrop,up-modal-backdrop{position:absolute;background:rgba(0,0,0,.4)}up-cover-viewport,up-drawer-viewport,up-modal-viewport{position:absolute;overflow-y:scroll;overflow-x:hidden;overscroll-behavior:contain;display:flex;align-items:flex-start;justify-content:center}up-popup,up-cover-box,up-drawer-box,up-modal-box{position:relative;box-sizing:border-box;max-width:100%;background-color:#fff;padding:20px;overflow-x:hidden}up-popup-content,up-cover-content,up-drawer-content,up-modal-content{display:block}up-popup{z-index:1000}up-popup-dismiss,up-cover-dismiss,up-drawer-dismiss,up-modal-dismiss{color:#888;position:absolute;top:10px;right:10px;font-size:1.7rem;line-height:.5}up-modal[nesting="0"] up-modal-viewport{padding:25px 15px}up-modal[nesting="1"] up-modal-viewport{padding:50px 30px}up-modal[nesting="2"] up-modal-viewport{padding:75px 45px}up-modal[nesting="3"] up-modal-viewport{padding:100px 60px}up-modal[nesting="4"] up-modal-viewport{padding:125px 75px}up-modal[size=small] up-modal-box{width:350px}up-modal[size=medium] up-modal-box{width:650px}up-modal[size=large] up-modal-box{width:1000px}up-modal[size=grow] up-modal-box{width:auto}up-modal[size=full] up-modal-box{width:100%}up-drawer-viewport{justify-content:flex-start}up-drawer[position=right] up-drawer-viewport{justify-content:flex-end}up-drawer-box{min-height:100vh}up-drawer[size=small] up-drawer-box{width:150px}up-drawer[size=medium] up-drawer-box{width:340px}up-drawer[size=large] up-drawer-box{width:600px}up-drawer[size=grow] up-drawer-box{width:auto}up-drawer[size=full] up-drawer-box{width:100%}up-cover-box{width:100%;min-height:100vh;padding:0}up-popup{padding:15px;text-align:left}up-popup[size=small]{width:180px}up-popup[size=medium]{width:300px}up-popup[size=large]{width:550px}up-popup[size=grow] up-popup{width:auto}up-popup[size=full] up-popup{width:100%}
5
+ up-focus-trap{position:fixed;top:0;left:0;width:0;height:0}up-cover-viewport,up-drawer-viewport,up-modal-viewport,up-drawer-backdrop,up-modal-backdrop,up-cover,up-drawer,up-modal{top:0;left:0;bottom:0;right:0}up-drawer-box,up-modal-box{box-shadow:0 0 10px 1px rgba(0,0,0,.3)}up-popup{box-shadow:0 0 4px rgba(0,0,0,.3)}up-popup:focus,up-cover-box:focus,up-drawer-box:focus,up-modal-box:focus,up-cover:focus,up-drawer:focus,up-modal:focus,up-popup:focus-visible,up-cover-box:focus-visible,up-drawer-box:focus-visible,up-modal-box:focus-visible,up-cover:focus-visible,up-drawer:focus-visible,up-modal:focus-visible{outline:none}up-cover,up-drawer,up-modal{z-index:2000;position:fixed}up-drawer-backdrop,up-modal-backdrop{position:absolute;background:rgba(0,0,0,.4)}up-cover-viewport,up-drawer-viewport,up-modal-viewport{position:absolute;overflow-y:scroll;overflow-x:hidden;overscroll-behavior:contain;display:flex;align-items:flex-start;justify-content:center}up-popup,up-cover-box,up-drawer-box,up-modal-box{position:relative;box-sizing:border-box;max-width:100%;background-color:#fff;padding:20px;overflow-x:hidden}up-popup-content,up-cover-content,up-drawer-content,up-modal-content{display:block}up-popup{z-index:1000}up-popup-dismiss,up-cover-dismiss,up-drawer-dismiss,up-modal-dismiss{color:#888;position:absolute;top:10px;right:10px;font-size:1.7rem;line-height:.5;cursor:pointer}up-modal[nesting="0"] up-modal-viewport{padding:25px 15px}up-modal[nesting="1"] up-modal-viewport{padding:50px 30px}up-modal[nesting="2"] up-modal-viewport{padding:75px 45px}up-modal[nesting="3"] up-modal-viewport{padding:100px 60px}up-modal[nesting="4"] up-modal-viewport{padding:125px 75px}up-modal[size=small] up-modal-box{width:350px}up-modal[size=medium] up-modal-box{width:650px}up-modal[size=large] up-modal-box{width:1000px}up-modal[size=grow] up-modal-box{width:auto}up-modal[size=full] up-modal-box{width:100%}up-drawer-viewport{justify-content:flex-start}up-drawer[position=right] up-drawer-viewport{justify-content:flex-end}up-drawer-box{min-height:100vh}up-drawer[size=small] up-drawer-box{width:150px}up-drawer[size=medium] up-drawer-box{width:340px}up-drawer[size=large] up-drawer-box{width:600px}up-drawer[size=grow] up-drawer-box{width:auto}up-drawer[size=full] up-drawer-box{width:100%}up-cover-box{width:100%;min-height:100vh;padding:0}up-popup{padding:15px;text-align:left}up-popup[size=small]{width:180px}up-popup[size=medium]{width:300px}up-popup[size=large]{width:550px}up-popup[size=grow] up-popup{width:auto}up-popup[size=full] up-popup{width:100%}
6
6
  [up-clickable][role=link]{cursor:pointer}[up-expand]:not([role]),[up-expand][role=link]{cursor:pointer}