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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79d3f5ddf6f561f66076b280f84e1fd3ed1316a0f637dd523e7dd5b849ed3da2
4
- data.tar.gz: 54c53c6d4b275b167ad05710d3bc27cab77c20e2ddf4cbc29583865c619a328d
3
+ metadata.gz: 5c6831a0bfebe95987455e4915056cf4ad5825ee247f90dfdceecf19a28eefea
4
+ data.tar.gz: 35b6daab0dee551131eb7b37c6ea395412b518e5278748dce5d6d6fab6b17409
5
5
  SHA512:
6
- metadata.gz: b521facc126c240a43ad81f61b6db302f3756c3b6d6cea330b76f9e7381bd147d2e2274a9f5dba6cc8759f603a30ff9d7e7c2d68e5abbf4ce23c3e4d8023fc92
7
- data.tar.gz: 81b3fcfab6706e0c0e9b78c64a6420eb148796c521ed4a7e0392addb82b1e7a6f7edc74dcfb8fe691977362499509685c5fd5913e57ec21b6d64f6f389e55683
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;
@@ -6141,7 +6147,6 @@ up.RenderOptions = (function () {
6141
6147
  finalize,
6142
6148
  assertContentGiven,
6143
6149
  deriveFailOptions,
6144
- lookupLayers: rememberOriginLayer,
6145
6150
  };
6146
6151
  })();
6147
6152
 
@@ -6693,13 +6698,13 @@ up.Request.Cache = class Cache {
6693
6698
  }
6694
6699
  reindex(request) {
6695
6700
  this._delete(request);
6701
+ delete request.cacheRoute;
6696
6702
  this.put(request);
6697
6703
  }
6698
6704
  _delete(request) {
6699
6705
  var _a;
6700
6706
  u.remove(this._requests, request);
6701
6707
  (_a = request.cacheRoute) === null || _a === void 0 ? void 0 : _a.delete(request);
6702
- delete request.cacheRoute;
6703
6708
  }
6704
6709
  _getRoute(request) {
6705
6710
  var _a, _b;
@@ -9695,7 +9700,8 @@ up.layer = (function () {
9695
9700
  dismissLabel: '×',
9696
9701
  dismissAriaLabel: 'Dismiss dialog',
9697
9702
  dismissable: true,
9698
- history: 'auto'
9703
+ history: 'auto',
9704
+ trapFocus: true,
9699
9705
  },
9700
9706
  cover: {
9701
9707
  mainTargets: ['[up-main~=cover]']
@@ -9728,7 +9734,8 @@ up.layer = (function () {
9728
9734
  position: 'bottom',
9729
9735
  size: 'medium',
9730
9736
  align: 'left',
9731
- dismissable: 'outside key'
9737
+ dismissable: 'outside key',
9738
+ trapFocus: false,
9732
9739
  },
9733
9740
  foreignOverlaySelectors: ['dialog']
9734
9741
  };