unpoly-rails 3.9.2 → 3.9.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2c3e3f16e60500d2464237ee852af167d26afeda07e02acb0169eb2925a7a88
4
- data.tar.gz: a1cdcf1e69c6a2e5bfc5639f72e878b63323b6ea2fcdf7f2f7dd1fc30b250483
3
+ metadata.gz: 5c6831a0bfebe95987455e4915056cf4ad5825ee247f90dfdceecf19a28eefea
4
+ data.tar.gz: 35b6daab0dee551131eb7b37c6ea395412b518e5278748dce5d6d6fab6b17409
5
5
  SHA512:
6
- metadata.gz: d5f5815d06d9c08b26daa9d72adac45fc603f524d45b4c621b3a83f9418b916ba5aa6541c515610db36da0245744b85bdd1e63faf10bad2a5a632f84fcbcefbc
7
- data.tar.gz: b3b940b2780ec684381eedf0b07eeea537f28227b7d86bf6882806a96ccaa6e50f70818f717ed45e504f245e141cab0137d1bdd21e75baf493a808cb90e7f160
6
+ metadata.gz: e3fca5ae5d5803d90bb4e245aee670303798005c4eb1d5cebb046eafe4414eec4e62e9a6bce17574a24e35a3d5cdde0320f6eca578285b53d56d915a8a8032f4
7
+ data.tar.gz: eed4b071eaea2b83ebdc3e63bea474303a1ff0a0c2f4eb512b9b0a4caba877daa2b627a62799f334c5a4657f70d03d1491b57c727d0f311d4d0d479e2d7196a4
data/README.md CHANGED
@@ -121,7 +121,7 @@ class NotesController < ApplicationController
121
121
  @note = Note.new(note_params)
122
122
  if @note.save
123
123
  if up.layer.overlay?
124
- up.accept_layer(@note.id)
124
+ up.layer.accept(@note.id)
125
125
  head :no_content
126
126
  else
127
127
  redirect_to @note
@@ -102,6 +102,7 @@ up-popup-dismiss, up-cover-dismiss, up-drawer-dismiss, up-modal-dismiss {
102
102
  right: 10px;
103
103
  font-size: 1.7rem;
104
104
  line-height: 0.5;
105
+ cursor: pointer;
105
106
  }
106
107
 
107
108
  up-modal[nesting="0"] up-modal-viewport {
@@ -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
 
@@ -4743,6 +4743,7 @@ up.Layer.Overlay = class Overlay extends up.Layer {
4743
4743
  'dismissable',
4744
4744
  'dismissLabel',
4745
4745
  'dismissAriaLabel',
4746
+ 'trapFocus',
4746
4747
  'onOpened',
4747
4748
  'onAccept',
4748
4749
  'onAccepted',
@@ -5671,33 +5672,38 @@ up.OverlayFocus = class OverlayFocus {
5671
5672
  constructor(layer) {
5672
5673
  this._layer = layer;
5673
5674
  this._focusElement = this._layer.getFocusElement();
5675
+ this._trapFocus = this._layer.trapFocus;
5674
5676
  }
5675
5677
  moveToFront() {
5676
- if (this._enabled) {
5678
+ if (this._active) {
5677
5679
  return;
5678
5680
  }
5679
- this._enabled = true;
5680
- this._untrapFocus = up.on('focusin', event => this._onFocus(event));
5681
+ this._active = true;
5681
5682
  this._unsetAttrs = e.setTemporaryAttrs(this._focusElement, {
5682
5683
  'tabindex': '0',
5683
5684
  'role': 'dialog',
5684
- 'aria-modal': 'true'
5685
+ 'aria-modal': this._trapFocus.toString()
5685
5686
  });
5686
- this._focusTrapBefore = e.affix(this._focusElement, 'beforebegin', 'up-focus-trap[tabindex=0]');
5687
- this._focusTrapAfter = e.affix(this._focusElement, 'afterend', 'up-focus-trap[tabindex=0]');
5687
+ if (this._trapFocus) {
5688
+ this._untrapFocus = up.on('focusin', event => this._onFocus(event));
5689
+ this._focusTrapBefore = e.affix(this._focusElement, 'beforebegin', 'up-focus-trap[tabindex=0]');
5690
+ this._focusTrapAfter = e.affix(this._focusElement, 'afterend', 'up-focus-trap[tabindex=0]');
5691
+ }
5688
5692
  }
5689
5693
  moveToBack() {
5690
5694
  this.teardown();
5691
5695
  }
5692
5696
  teardown() {
5693
- if (!this._enabled) {
5697
+ if (!this._active) {
5694
5698
  return;
5695
5699
  }
5696
- this._enabled = false;
5697
- this._untrapFocus();
5700
+ this._active = false;
5698
5701
  this._unsetAttrs();
5699
- this._focusTrapBefore.remove();
5700
- this._focusTrapAfter.remove();
5702
+ if (this._trapFocus) {
5703
+ this._untrapFocus();
5704
+ this._focusTrapBefore.remove();
5705
+ this._focusTrapAfter.remove();
5706
+ }
5701
5707
  }
5702
5708
  _onFocus(event) {
5703
5709
  const { target } = event;
@@ -6692,13 +6698,13 @@ up.Request.Cache = class Cache {
6692
6698
  }
6693
6699
  reindex(request) {
6694
6700
  this._delete(request);
6701
+ delete request.cacheRoute;
6695
6702
  this.put(request);
6696
6703
  }
6697
6704
  _delete(request) {
6698
6705
  var _a;
6699
6706
  u.remove(this._requests, request);
6700
6707
  (_a = request.cacheRoute) === null || _a === void 0 ? void 0 : _a.delete(request);
6701
- delete request.cacheRoute;
6702
6708
  }
6703
6709
  _getRoute(request) {
6704
6710
  var _a, _b;
@@ -9694,7 +9700,8 @@ up.layer = (function () {
9694
9700
  dismissLabel: '×',
9695
9701
  dismissAriaLabel: 'Dismiss dialog',
9696
9702
  dismissable: true,
9697
- history: 'auto'
9703
+ history: 'auto',
9704
+ trapFocus: true,
9698
9705
  },
9699
9706
  cover: {
9700
9707
  mainTargets: ['[up-main~=cover]']
@@ -9727,7 +9734,8 @@ up.layer = (function () {
9727
9734
  position: 'bottom',
9728
9735
  size: 'medium',
9729
9736
  align: 'left',
9730
- dismissable: 'outside key'
9737
+ dismissable: 'outside key',
9738
+ trapFocus: false,
9731
9739
  },
9732
9740
  foreignOverlaySelectors: ['dialog']
9733
9741
  };