unpoly-rails 3.10.0 → 3.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/unpoly/unpoly.es6.js +26 -21
- data/assets/unpoly/unpoly.es6.min.js +1 -1
- data/assets/unpoly/unpoly.js +26 -21
- data/assets/unpoly/unpoly.min.js +1 -1
- data/lib/unpoly/rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37db81cf31bc9480ba80407d23344ca9e4bfad195071a655852da126d4f56097
|
4
|
+
data.tar.gz: d4c8ee2ec83656a6e419002eca43f52f9eaa0656b02fa64087826e18cefcb299
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b959922764b4dafdf7b1756effcd3673bc834f652383da79ee4cb90e34d987b27a15c79ca156e5ef0d0a59e664ef96639c8abbb3c6deb5951b7736eb4d484866
|
7
|
+
data.tar.gz: 7209ed9ae1f2253689db9ce1aa4db9ee520c7f7794d1b4bce9e4305c945ba367f72e1d1800f4379a0dbeb78aeb7aba304cd739e73f0bf8b6d669c81509c62e1f
|
data/assets/unpoly/unpoly.es6.js
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
/***/ (() => {
|
6
6
|
|
7
7
|
window.up = {
|
8
|
-
version: '3.10.
|
8
|
+
version: '3.10.2'
|
9
9
|
};
|
10
10
|
|
11
11
|
|
@@ -639,8 +639,8 @@ up.util = (function () {
|
|
639
639
|
});
|
640
640
|
}
|
641
641
|
}
|
642
|
-
function delegatePromise(object,
|
643
|
-
return defineDelegates(object, ['then', 'catch', 'finally'],
|
642
|
+
function delegatePromise(object, targetProvider) {
|
643
|
+
return defineDelegates(object, ['then', 'catch', 'finally'], targetProvider);
|
644
644
|
}
|
645
645
|
function stringifyArg(arg, placeholder = '%o') {
|
646
646
|
let string;
|
@@ -2280,7 +2280,7 @@ up.RenderJob = (_a = class RenderJob {
|
|
2280
2280
|
}
|
2281
2281
|
},
|
2282
2282
|
(() => {
|
2283
|
-
u.delegatePromise(_a.prototype,
|
2283
|
+
u.delegatePromise(_a.prototype, function () { return this._rendered; });
|
2284
2284
|
u.memoizeMethod(_a.prototype, {
|
2285
2285
|
_awaitFinished: true,
|
2286
2286
|
_getChange: true,
|
@@ -2876,9 +2876,8 @@ up.Change.CloseLayer = class CloseLayer extends up.Change {
|
|
2876
2876
|
this._history = (_b = options.history) !== null && _b !== void 0 ? _b : true;
|
2877
2877
|
}
|
2878
2878
|
execute() {
|
2879
|
-
if (!this._layer.isOpen())
|
2880
|
-
return
|
2881
|
-
}
|
2879
|
+
if (!this._layer.isOpen())
|
2880
|
+
return;
|
2882
2881
|
up.browser.assertConfirmed(this.options);
|
2883
2882
|
if (this._emitCloseEvent().defaultPrevented && this._preventable) {
|
2884
2883
|
throw new up.Aborted('Close event was prevented');
|
@@ -2928,10 +2927,13 @@ up.Change.CloseLayer = class CloseLayer extends up.Change {
|
|
2928
2927
|
}
|
2929
2928
|
_handleFocus(formerParent) {
|
2930
2929
|
var _a;
|
2930
|
+
let hadFocus = this._layer.hasFocus();
|
2931
2931
|
this._layer.overlayFocus.teardown();
|
2932
2932
|
(_a = formerParent.overlayFocus) === null || _a === void 0 ? void 0 : _a.moveToFront();
|
2933
|
-
|
2934
|
-
|
2933
|
+
if (hadFocus) {
|
2934
|
+
let newFocusElement = this._layer.origin || formerParent.element;
|
2935
|
+
up.focus(newFocusElement, { preventScroll: true });
|
2936
|
+
}
|
2935
2937
|
}
|
2936
2938
|
};
|
2937
2939
|
|
@@ -4174,15 +4176,21 @@ up.FormValidator = class FormValidator {
|
|
4174
4176
|
/***/ (() => {
|
4175
4177
|
|
4176
4178
|
up.FocusCapsule = class FocusCapsule {
|
4177
|
-
constructor(element, target
|
4179
|
+
constructor(element, target) {
|
4178
4180
|
this._element = element;
|
4179
4181
|
this._target = target;
|
4180
|
-
this._cursorProps =
|
4182
|
+
this._cursorProps = up.viewport.copyCursorProps(this._element);
|
4181
4183
|
}
|
4182
4184
|
wasLost() {
|
4183
|
-
return document.activeElement !== this._element;
|
4185
|
+
return document.activeElement !== this._element && !this._voided;
|
4186
|
+
}
|
4187
|
+
autoVoid() {
|
4188
|
+
up.on('focusin', { once: true }, () => this._voided = true);
|
4184
4189
|
}
|
4185
4190
|
restore(layer, focusOptions) {
|
4191
|
+
if (!this.wasLost()) {
|
4192
|
+
return false;
|
4193
|
+
}
|
4186
4194
|
let rediscoveredElement = up.fragment.get(this._target, { layer });
|
4187
4195
|
if (rediscoveredElement) {
|
4188
4196
|
up.viewport.copyCursorProps(this._cursorProps, rediscoveredElement);
|
@@ -4197,8 +4205,7 @@ up.FocusCapsule = class FocusCapsule {
|
|
4197
4205
|
let target = up.fragment.tryToTarget(focusedElement);
|
4198
4206
|
if (!target)
|
4199
4207
|
return;
|
4200
|
-
|
4201
|
-
return new this(focusedElement, target, cursorProps);
|
4208
|
+
return new this(focusedElement, target);
|
4202
4209
|
}
|
4203
4210
|
};
|
4204
4211
|
|
@@ -4374,9 +4381,7 @@ up.FragmentFocus = class FragmentFocus extends up.FragmentProcessor {
|
|
4374
4381
|
}
|
4375
4382
|
_restoreLostFocus() {
|
4376
4383
|
var _a;
|
4377
|
-
|
4378
|
-
return (_a = this.focusCapsule) === null || _a === void 0 ? void 0 : _a.restore(this.layer, PREVENT_SCROLL_OPTIONS);
|
4379
|
-
}
|
4384
|
+
return (_a = this.focusCapsule) === null || _a === void 0 ? void 0 : _a.restore(this.layer, PREVENT_SCROLL_OPTIONS);
|
4380
4385
|
}
|
4381
4386
|
_restorePreviousFocusForLocation() {
|
4382
4387
|
return up.viewport.restoreFocus({ layer: this.layer });
|
@@ -6927,7 +6932,7 @@ up.Request = (_a = class Request extends up.Record {
|
|
6927
6932
|
}
|
6928
6933
|
},
|
6929
6934
|
(() => {
|
6930
|
-
u.delegatePromise(_a.prototype,
|
6935
|
+
u.delegatePromise(_a.prototype, function () { return this._deferred; });
|
6931
6936
|
})(),
|
6932
6937
|
_a);
|
6933
6938
|
|
@@ -7091,14 +7096,14 @@ up.Request.Cache = class Cache {
|
|
7091
7096
|
_isUsable(request) {
|
7092
7097
|
return request.age < up.network.config.cacheEvictAge;
|
7093
7098
|
}
|
7094
|
-
get
|
7099
|
+
get currentSize() {
|
7095
7100
|
return this._requests.length;
|
7096
7101
|
}
|
7097
7102
|
get _capacity() {
|
7098
7103
|
return up.network.config.cacheSize;
|
7099
7104
|
}
|
7100
7105
|
_limitSize() {
|
7101
|
-
for (let i = 0; i < (this.
|
7106
|
+
for (let i = 0; i < (this.currentSize - this._capacity); i++) {
|
7102
7107
|
this._delete(this._requests[0]);
|
7103
7108
|
}
|
7104
7109
|
}
|
@@ -11104,7 +11109,7 @@ up.status = (function () {
|
|
11104
11109
|
let focusCapsule = up.FocusCapsule.preserve(bindLayer);
|
11105
11110
|
let applyPreviews = () => doRunPreviews(request, renderOptions);
|
11106
11111
|
let revertPreviews = bindLayer.asCurrent(applyPreviews);
|
11107
|
-
|
11112
|
+
focusCapsule === null || focusCapsule === void 0 ? void 0 : focusCapsule.autoVoid();
|
11108
11113
|
return () => {
|
11109
11114
|
bindLayer.asCurrent(revertPreviews);
|
11110
11115
|
focusCapsule === null || focusCapsule === void 0 ? void 0 : focusCapsule.restore(bindLayer, { preventScroll: true });
|