unpoly-rails 3.2.0 → 3.2.2
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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/assets/unpoly/unpoly-bootstrap3.css +2 -2
- data/assets/unpoly/unpoly-bootstrap3.min.css +0 -1
- data/assets/unpoly/unpoly-bootstrap4.css +2 -2
- data/assets/unpoly/unpoly-bootstrap4.min.css +0 -1
- data/assets/unpoly/unpoly-bootstrap5.css +2 -2
- data/assets/unpoly/unpoly-bootstrap5.min.css +0 -1
- data/assets/unpoly/unpoly.css +108 -78
- data/assets/unpoly/unpoly.es6.js +78 -61
- data/assets/unpoly/unpoly.es6.min.js +1 -1
- data/assets/unpoly/unpoly.js +76 -59
- data/assets/unpoly/unpoly.min.css +1 -7
- 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: daf4abb8b087b111de90afd35e1d9ff4438ae3b933e996c0d18ff0d0c5c4f45e
|
4
|
+
data.tar.gz: 6e842eeded7fcdf22368de54a5ebc5b38651273c7daeae24a5380d2e56272f24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ba599fa01552bc68b252fba438a204ee07d763a2e0c4672067b81dd304c6fb8631562999a7060c681d347da2a38b694b7ddc442368a94489ef2162131aeafa8
|
7
|
+
data.tar.gz: e7e1a9bc897528d53c9331e0b1961b9b4db336645f8f5ec0065156d809034c3b410a36bffdf74e70b1bf5bc8b2a970e334b8140d1696588f709de315037ac7e1
|
data/README.md
CHANGED
@@ -494,7 +494,7 @@ What you still need to do manually
|
|
494
494
|
|
495
495
|
### Failed form submissions must return a non-200 status code
|
496
496
|
|
497
|
-
Unpoly lets you submit forms via AJAX by using the [`form[up-
|
497
|
+
Unpoly lets you submit forms via AJAX by using the [`form[up-submit]`](https://unpoly.com/form-up-submit) selector or [`up.submit()`](https://unpoly.com/up.submit) function.
|
498
498
|
|
499
499
|
For Unpoly to be able to detect a failed form submission,
|
500
500
|
the form must be re-rendered with a non-200 HTTP status code.
|
data/assets/unpoly/unpoly.css
CHANGED
@@ -1,17 +1,19 @@
|
|
1
1
|
[hidden][hidden] {
|
2
|
-
display: none !important;
|
3
|
-
|
2
|
+
display: none !important;
|
3
|
+
}
|
4
4
|
up-wrapper {
|
5
|
-
display: inline-block;
|
6
|
-
|
5
|
+
display: inline-block;
|
6
|
+
}
|
7
7
|
up-bounds {
|
8
|
-
position: absolute;
|
8
|
+
position: absolute;
|
9
|
+
}
|
9
10
|
|
10
11
|
.up-focusable-content:focus, .up-focusable-content:focus-visible {
|
11
|
-
outline: 0;
|
12
|
-
|
12
|
+
outline: 0;
|
13
|
+
}
|
13
14
|
.up-request-loader {
|
14
|
-
display: none;
|
15
|
+
display: none;
|
16
|
+
}
|
15
17
|
|
16
18
|
up-progress-bar {
|
17
19
|
position: fixed;
|
@@ -19,136 +21,164 @@ up-progress-bar {
|
|
19
21
|
left: 0;
|
20
22
|
z-index: 999999999;
|
21
23
|
height: 3px;
|
22
|
-
background-color: #007bff;
|
23
|
-
|
24
|
+
background-color: #007bff;
|
25
|
+
}
|
24
26
|
up-focus-trap {
|
25
27
|
position: fixed;
|
26
28
|
top: 0;
|
27
29
|
left: 0;
|
28
30
|
width: 0;
|
29
|
-
height: 0;
|
31
|
+
height: 0;
|
32
|
+
}
|
30
33
|
|
31
|
-
up-
|
34
|
+
up-cover-viewport, up-drawer-viewport, up-modal-viewport, up-drawer-backdrop, up-modal-backdrop, up-cover, up-drawer, up-modal {
|
32
35
|
top: 0;
|
33
36
|
left: 0;
|
34
37
|
bottom: 0;
|
35
|
-
right: 0;
|
38
|
+
right: 0;
|
39
|
+
}
|
36
40
|
|
37
|
-
up-
|
38
|
-
box-shadow: 0 0 10px 1px rgba(0, 0, 0, 0.3);
|
41
|
+
up-drawer-box, up-modal-box {
|
42
|
+
box-shadow: 0 0 10px 1px rgba(0, 0, 0, 0.3);
|
43
|
+
}
|
39
44
|
|
40
45
|
up-popup {
|
41
|
-
box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
|
46
|
+
box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
|
47
|
+
}
|
42
48
|
|
43
|
-
up-
|
44
|
-
outline: none;
|
49
|
+
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 {
|
50
|
+
outline: none;
|
51
|
+
}
|
45
52
|
|
46
|
-
up-
|
53
|
+
up-cover, up-drawer, up-modal {
|
47
54
|
z-index: 2000;
|
48
|
-
position: fixed;
|
55
|
+
position: fixed;
|
56
|
+
}
|
49
57
|
|
50
|
-
up-
|
58
|
+
up-drawer-backdrop, up-modal-backdrop {
|
51
59
|
position: absolute;
|
52
|
-
background: rgba(0, 0, 0, 0.4);
|
60
|
+
background: rgba(0, 0, 0, 0.4);
|
61
|
+
}
|
53
62
|
|
54
|
-
up-
|
63
|
+
up-cover-viewport, up-drawer-viewport, up-modal-viewport {
|
55
64
|
position: absolute;
|
56
65
|
overflow-y: scroll;
|
57
66
|
overflow-x: hidden;
|
58
67
|
overscroll-behavior: contain;
|
59
68
|
display: flex;
|
60
69
|
align-items: flex-start;
|
61
|
-
justify-content: center;
|
70
|
+
justify-content: center;
|
71
|
+
}
|
62
72
|
|
63
|
-
up-
|
73
|
+
up-popup, up-cover-box, up-drawer-box, up-modal-box {
|
64
74
|
position: relative;
|
65
75
|
box-sizing: border-box;
|
66
76
|
max-width: 100%;
|
67
77
|
background-color: #fff;
|
68
78
|
padding: 20px;
|
69
|
-
overflow-x: hidden;
|
79
|
+
overflow-x: hidden;
|
80
|
+
}
|
70
81
|
|
71
|
-
up-
|
72
|
-
display: block;
|
82
|
+
up-popup-content, up-cover-content, up-drawer-content, up-modal-content {
|
83
|
+
display: block;
|
84
|
+
}
|
73
85
|
|
74
86
|
up-popup {
|
75
|
-
z-index: 1000;
|
87
|
+
z-index: 1000;
|
88
|
+
}
|
76
89
|
|
77
|
-
up-
|
90
|
+
up-popup-dismiss, up-cover-dismiss, up-drawer-dismiss, up-modal-dismiss {
|
78
91
|
color: #888;
|
79
92
|
position: absolute;
|
80
93
|
top: 10px;
|
81
94
|
right: 10px;
|
82
95
|
font-size: 1.7rem;
|
83
|
-
line-height: 0.5;
|
96
|
+
line-height: 0.5;
|
97
|
+
}
|
84
98
|
|
85
99
|
up-modal[nesting="0"] up-modal-viewport {
|
86
|
-
padding: 25px 15px;
|
87
|
-
|
100
|
+
padding: 25px 15px;
|
101
|
+
}
|
88
102
|
up-modal[nesting="1"] up-modal-viewport {
|
89
|
-
padding: 50px 30px;
|
90
|
-
|
103
|
+
padding: 50px 30px;
|
104
|
+
}
|
91
105
|
up-modal[nesting="2"] up-modal-viewport {
|
92
|
-
padding: 75px 45px;
|
93
|
-
|
106
|
+
padding: 75px 45px;
|
107
|
+
}
|
94
108
|
up-modal[nesting="3"] up-modal-viewport {
|
95
|
-
padding: 100px 60px;
|
96
|
-
|
109
|
+
padding: 100px 60px;
|
110
|
+
}
|
97
111
|
up-modal[nesting="4"] up-modal-viewport {
|
98
|
-
padding: 125px 75px;
|
112
|
+
padding: 125px 75px;
|
113
|
+
}
|
99
114
|
|
100
115
|
up-modal[size=small] up-modal-box {
|
101
|
-
width: 350px;
|
102
|
-
|
116
|
+
width: 350px;
|
117
|
+
}
|
103
118
|
up-modal[size=medium] up-modal-box {
|
104
|
-
width: 650px;
|
105
|
-
|
119
|
+
width: 650px;
|
120
|
+
}
|
106
121
|
up-modal[size=large] up-modal-box {
|
107
|
-
width: 1000px;
|
108
|
-
|
122
|
+
width: 1000px;
|
123
|
+
}
|
109
124
|
up-modal[size=grow] up-modal-box {
|
110
|
-
width: auto;
|
111
|
-
|
125
|
+
width: auto;
|
126
|
+
}
|
112
127
|
up-modal[size=full] up-modal-box {
|
113
|
-
width: 100%;
|
128
|
+
width: 100%;
|
129
|
+
}
|
114
130
|
|
115
131
|
up-drawer-viewport {
|
116
|
-
justify-content: flex-start;
|
117
|
-
|
118
|
-
|
132
|
+
justify-content: flex-start;
|
133
|
+
}
|
134
|
+
up-drawer[position=right] up-drawer-viewport {
|
135
|
+
justify-content: flex-end;
|
136
|
+
}
|
119
137
|
|
120
138
|
up-drawer-box {
|
121
|
-
min-height: 100vh;
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
139
|
+
min-height: 100vh;
|
140
|
+
}
|
141
|
+
up-drawer[size=small] up-drawer-box {
|
142
|
+
width: 150px;
|
143
|
+
}
|
144
|
+
up-drawer[size=medium] up-drawer-box {
|
145
|
+
width: 340px;
|
146
|
+
}
|
147
|
+
up-drawer[size=large] up-drawer-box {
|
148
|
+
width: 600px;
|
149
|
+
}
|
150
|
+
up-drawer[size=grow] up-drawer-box {
|
151
|
+
width: auto;
|
152
|
+
}
|
153
|
+
up-drawer[size=full] up-drawer-box {
|
154
|
+
width: 100%;
|
155
|
+
}
|
132
156
|
|
133
157
|
up-cover-box {
|
134
158
|
width: 100%;
|
135
159
|
min-height: 100vh;
|
136
|
-
padding: 0;
|
160
|
+
padding: 0;
|
161
|
+
}
|
137
162
|
|
138
163
|
up-popup {
|
139
164
|
padding: 15px;
|
140
|
-
text-align: left;
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
165
|
+
text-align: left;
|
166
|
+
}
|
167
|
+
up-popup[size=small] {
|
168
|
+
width: 180px;
|
169
|
+
}
|
170
|
+
up-popup[size=medium] {
|
171
|
+
width: 300px;
|
172
|
+
}
|
173
|
+
up-popup[size=large] {
|
174
|
+
width: 550px;
|
175
|
+
}
|
176
|
+
up-popup[size=grow] up-popup {
|
177
|
+
width: auto;
|
178
|
+
}
|
179
|
+
up-popup[size=full] up-popup {
|
180
|
+
width: 100%;
|
181
|
+
}
|
152
182
|
[up-href], [up-clickable] {
|
153
|
-
cursor: pointer;
|
154
|
-
|
183
|
+
cursor: pointer;
|
184
|
+
}
|
data/assets/unpoly/unpoly.es6.js
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
/***/ (() => {
|
6
6
|
|
7
7
|
window.up = {
|
8
|
-
version: '3.2.
|
8
|
+
version: '3.2.2'
|
9
9
|
};
|
10
10
|
|
11
11
|
|
@@ -834,10 +834,6 @@ up.util = (function () {
|
|
834
834
|
/***/ (() => {
|
835
835
|
|
836
836
|
up.error = (function () {
|
837
|
-
function emitGlobal(error) {
|
838
|
-
const { message } = error;
|
839
|
-
up.emit(window, 'error', { message, error, log: false });
|
840
|
-
}
|
841
837
|
function fail(...args) {
|
842
838
|
throw new up.Error(args);
|
843
839
|
}
|
@@ -845,17 +841,27 @@ up.error = (function () {
|
|
845
841
|
return (typeof error !== 'object') || ((error.name !== 'AbortError') && !(error instanceof up.RenderResult) && !(error instanceof up.Response));
|
846
842
|
}
|
847
843
|
function muteUncriticalRejection(promise) {
|
848
|
-
return promise.catch(
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
844
|
+
return promise.catch(rethrowCritical);
|
845
|
+
}
|
846
|
+
function muteUncriticalSync(block) {
|
847
|
+
try {
|
848
|
+
return block();
|
849
|
+
}
|
850
|
+
catch (e) {
|
851
|
+
rethrowCritical(e);
|
852
|
+
}
|
853
|
+
}
|
854
|
+
function rethrowCritical(value) {
|
855
|
+
if (isCritical(value)) {
|
856
|
+
throw value;
|
857
|
+
}
|
853
858
|
}
|
854
859
|
return {
|
855
860
|
fail,
|
856
|
-
|
861
|
+
rethrowCritical,
|
857
862
|
isCritical,
|
858
863
|
muteUncriticalRejection,
|
864
|
+
muteUncriticalSync,
|
859
865
|
};
|
860
866
|
})();
|
861
867
|
up.fail = up.error.fail;
|
@@ -937,9 +943,9 @@ up.element = (function () {
|
|
937
943
|
results.push(...root.querySelectorAll(selector));
|
938
944
|
return results;
|
939
945
|
}
|
940
|
-
function
|
946
|
+
function contains(root, selectorOrElement) {
|
941
947
|
const element = getOne(selectorOrElement);
|
942
|
-
return
|
948
|
+
return Node.prototype.contains.call(root, element);
|
943
949
|
}
|
944
950
|
function ancestor(element, selector) {
|
945
951
|
let parentElement = element.parentElement;
|
@@ -1182,7 +1188,7 @@ up.element = (function () {
|
|
1182
1188
|
}
|
1183
1189
|
}
|
1184
1190
|
function classSelector(klass) {
|
1185
|
-
klass = klass.replace(
|
1191
|
+
klass = klass.replace(/[^\w-]/g, '\\$&');
|
1186
1192
|
return `.${klass}`;
|
1187
1193
|
}
|
1188
1194
|
function createBrokenDocumentFromHTML(html) {
|
@@ -1438,7 +1444,7 @@ up.element = (function () {
|
|
1438
1444
|
}
|
1439
1445
|
return {
|
1440
1446
|
subtree,
|
1441
|
-
|
1447
|
+
contains,
|
1442
1448
|
closestAttr,
|
1443
1449
|
ancestor,
|
1444
1450
|
around,
|
@@ -1899,7 +1905,7 @@ up.RenderJob = (_a = class RenderJob {
|
|
1899
1905
|
if (result instanceof up.RenderResult) {
|
1900
1906
|
if (!result.none)
|
1901
1907
|
(_b = (_a = result.options).onRendered) === null || _b === void 0 ? void 0 : _b.call(_a, result);
|
1902
|
-
result.finished.then(result.options.onFinished);
|
1908
|
+
result.finished.then(result.options.onFinished, u.noop);
|
1903
1909
|
return true;
|
1904
1910
|
}
|
1905
1911
|
}
|
@@ -2093,8 +2099,8 @@ up.Change.OpenLayer = class OpenLayer extends up.Change.Addition {
|
|
2093
2099
|
if (this.emitOpenEvent().defaultPrevented) {
|
2094
2100
|
throw new up.Aborted('Open event was prevented');
|
2095
2101
|
}
|
2096
|
-
this.baseLayer.peel();
|
2097
2102
|
this.layer = this.buildLayer();
|
2103
|
+
this.baseLayer.peel({ history: !this.layer.history });
|
2098
2104
|
up.layer.stack.push(this.layer);
|
2099
2105
|
this.layer.createElements(this.content);
|
2100
2106
|
this.layer.setupHandlers();
|
@@ -2235,7 +2241,7 @@ up.Change.UpdateLayer = (_a = class UpdateLayer extends up.Change.Addition {
|
|
2235
2241
|
up.viewport.saveFocus({ layer: this.layer });
|
2236
2242
|
}
|
2237
2243
|
if (this.options.peel) {
|
2238
|
-
this.layer.peel();
|
2244
|
+
this.layer.peel({ history: !this.hasHistory() });
|
2239
2245
|
}
|
2240
2246
|
if (this.options.abort !== false) {
|
2241
2247
|
up.fragment.abort(this.getFragments(), { reason: 'Fragment is being replaced' });
|
@@ -2499,7 +2505,7 @@ up.Change.UpdateLayer = (_a = class UpdateLayer extends up.Change.Addition {
|
|
2499
2505
|
const u = up.util;
|
2500
2506
|
up.Change.CloseLayer = class CloseLayer extends up.Change.Removal {
|
2501
2507
|
constructor(options) {
|
2502
|
-
var _a;
|
2508
|
+
var _a, _b;
|
2503
2509
|
super(options);
|
2504
2510
|
this.verb = options.verb;
|
2505
2511
|
this.layer = up.layer.get(options);
|
@@ -2507,6 +2513,7 @@ up.Change.CloseLayer = class CloseLayer extends up.Change.Removal {
|
|
2507
2513
|
this.value = options.value;
|
2508
2514
|
this.preventable = (_a = options.preventable) !== null && _a !== void 0 ? _a : true;
|
2509
2515
|
this.response = options.response;
|
2516
|
+
this.history = (_b = options.history) !== null && _b !== void 0 ? _b : true;
|
2510
2517
|
}
|
2511
2518
|
execute() {
|
2512
2519
|
if (!this.layer.isOpen()) {
|
@@ -2520,7 +2527,9 @@ up.Change.CloseLayer = class CloseLayer extends up.Change.Removal {
|
|
2520
2527
|
const { parent } = this.layer;
|
2521
2528
|
this.layer.peel();
|
2522
2529
|
this.layer.stack.remove(this.layer);
|
2523
|
-
|
2530
|
+
if (this.history) {
|
2531
|
+
parent.restoreHistory();
|
2532
|
+
}
|
2524
2533
|
this.handleFocus(parent);
|
2525
2534
|
this.layer.teardownHandlers();
|
2526
2535
|
this.layer.destroyElements(this.options);
|
@@ -3004,7 +3013,6 @@ up.CompilerPass = class CompilerPass {
|
|
3004
3013
|
catch (error) {
|
3005
3014
|
this.errors.push(error);
|
3006
3015
|
up.log.error('up.hello()', 'While compiling %o: %o', elementOrElements, error);
|
3007
|
-
up.error.emitGlobal(error);
|
3008
3016
|
}
|
3009
3017
|
}
|
3010
3018
|
destructorPresence(result) {
|
@@ -3177,7 +3185,6 @@ up.DestructorPass = class DestructorPass {
|
|
3177
3185
|
catch (error) {
|
3178
3186
|
this.errors.push(error);
|
3179
3187
|
up.log.error('up.destroy()', 'While destroying %o: %o', element, error);
|
3180
|
-
up.error.emitGlobal(error);
|
3181
3188
|
}
|
3182
3189
|
}
|
3183
3190
|
};
|
@@ -3349,6 +3356,9 @@ up.EventListener = class EventListener extends up.Record {
|
|
3349
3356
|
const data = up.syntax.data(element);
|
3350
3357
|
args.push(data);
|
3351
3358
|
}
|
3359
|
+
if (this.eventType === 'click' && element.disabled) {
|
3360
|
+
return;
|
3361
|
+
}
|
3352
3362
|
const applyCallback = this.callback.bind(element, ...args);
|
3353
3363
|
if (this.baseLayer) {
|
3354
3364
|
this.baseLayer.asCurrent(applyCallback);
|
@@ -4091,9 +4101,7 @@ up.FragmentPolling = class FragmentPolling {
|
|
4091
4101
|
}
|
4092
4102
|
onReloadFailure(reason) {
|
4093
4103
|
this.scheduleReload();
|
4094
|
-
|
4095
|
-
throw reason;
|
4096
|
-
}
|
4104
|
+
up.error.rethrowCritical(reason);
|
4097
4105
|
}
|
4098
4106
|
onFragmentSwapped(newFragment) {
|
4099
4107
|
this.stop();
|
@@ -4585,7 +4593,7 @@ up.Layer.Overlay = class Overlay extends up.Layer {
|
|
4585
4593
|
parser.string('easing');
|
4586
4594
|
parser.number('duration');
|
4587
4595
|
parser.string('confirm');
|
4588
|
-
closeFn(value, closeOptions);
|
4596
|
+
up.error.muteUncriticalSync(() => closeFn(value, closeOptions));
|
4589
4597
|
});
|
4590
4598
|
}
|
4591
4599
|
registerEventCloser(eventTypes, closeFn) {
|
@@ -4763,13 +4771,13 @@ up.Layer.OverlayWithViewport = (_a = class OverlayWithViewport extends up.Layer.
|
|
4763
4771
|
var _a;
|
4764
4772
|
const e = up.element;
|
4765
4773
|
up.Layer.Root = (_a = class Root extends up.Layer {
|
4774
|
+
get element() {
|
4775
|
+
return e.root;
|
4776
|
+
}
|
4766
4777
|
constructor(options) {
|
4767
4778
|
super(options);
|
4768
4779
|
this.setupHandlers();
|
4769
4780
|
}
|
4770
|
-
get element() {
|
4771
|
-
return e.root;
|
4772
|
-
}
|
4773
4781
|
getFirstSwappableElement() {
|
4774
4782
|
return document.body;
|
4775
4783
|
}
|
@@ -5930,27 +5938,6 @@ up.RenderResult = class RenderResult extends up.Record {
|
|
5930
5938
|
var _a;
|
5931
5939
|
const u = up.util;
|
5932
5940
|
up.Request = (_a = class Request extends up.Record {
|
5933
|
-
constructor(options) {
|
5934
|
-
var _a;
|
5935
|
-
super(options);
|
5936
|
-
this.params = new up.Params(this.params);
|
5937
|
-
if (this.wrapMethod == null) {
|
5938
|
-
this.wrapMethod = up.network.config.wrapMethod;
|
5939
|
-
}
|
5940
|
-
this.normalize();
|
5941
|
-
if ((this.target || this.layer || this.origin) && !options.basic) {
|
5942
|
-
const layerLookupOptions = { origin: this.origin };
|
5943
|
-
this.layer = up.layer.get(this.layer, layerLookupOptions);
|
5944
|
-
this.failLayer = up.layer.get(this.failLayer || this.layer, layerLookupOptions);
|
5945
|
-
this.context || (this.context = this.layer.context || {});
|
5946
|
-
this.failContext || (this.failContext = this.failLayer.context || {});
|
5947
|
-
this.mode || (this.mode = this.layer.mode);
|
5948
|
-
this.failMode || (this.failMode = this.failLayer.mode);
|
5949
|
-
}
|
5950
|
-
this.deferred = u.newDeferred();
|
5951
|
-
(_a = this.badResponseTime) !== null && _a !== void 0 ? _a : (this.badResponseTime = u.evalOption(up.network.config.badResponseTime, this));
|
5952
|
-
this.addAutoHeaders();
|
5953
|
-
}
|
5954
5941
|
keys() {
|
5955
5942
|
return [
|
5956
5943
|
'method',
|
@@ -5993,6 +5980,27 @@ up.Request = (_a = class Request extends up.Record {
|
|
5993
5980
|
builtAt: new Date(),
|
5994
5981
|
};
|
5995
5982
|
}
|
5983
|
+
constructor(options) {
|
5984
|
+
var _a;
|
5985
|
+
super(options);
|
5986
|
+
this.params = new up.Params(this.params);
|
5987
|
+
if (this.wrapMethod == null) {
|
5988
|
+
this.wrapMethod = up.network.config.wrapMethod;
|
5989
|
+
}
|
5990
|
+
this.normalize();
|
5991
|
+
if ((this.target || this.layer || this.origin) && !options.basic) {
|
5992
|
+
const layerLookupOptions = { origin: this.origin };
|
5993
|
+
this.layer = up.layer.get(this.layer, layerLookupOptions);
|
5994
|
+
this.failLayer = up.layer.get(this.failLayer || this.layer, layerLookupOptions);
|
5995
|
+
this.context || (this.context = this.layer.context || {});
|
5996
|
+
this.failContext || (this.failContext = this.failLayer.context || {});
|
5997
|
+
this.mode || (this.mode = this.layer.mode);
|
5998
|
+
this.failMode || (this.failMode = this.failLayer.mode);
|
5999
|
+
}
|
6000
|
+
this.deferred = u.newDeferred();
|
6001
|
+
(_a = this.badResponseTime) !== null && _a !== void 0 ? _a : (this.badResponseTime = u.evalOption(up.network.config.badResponseTime, this));
|
6002
|
+
this.addAutoHeaders();
|
6003
|
+
}
|
5996
6004
|
get xhr() {
|
5997
6005
|
var _a;
|
5998
6006
|
return (_a = this._xhr) !== null && _a !== void 0 ? _a : (this._xhr = new XMLHttpRequest());
|
@@ -7798,6 +7806,7 @@ up.history = (function () {
|
|
7798
7806
|
}
|
7799
7807
|
function onPop(event) {
|
7800
7808
|
trackCurrentLocation();
|
7809
|
+
let location = currentLocation();
|
7801
7810
|
emitLocationChanged({ location, reason: 'pop', log: `Navigated to history entry ${location}` });
|
7802
7811
|
up.viewport.saveFocus({ location: previousLocation });
|
7803
7812
|
up.viewport.saveScroll({ location: previousLocation });
|
@@ -7997,8 +8006,13 @@ up.fragment = (function () {
|
|
7997
8006
|
selector = buildSelector(selector, element, options);
|
7998
8007
|
return selector.subtree(element);
|
7999
8008
|
}
|
8000
|
-
function contains(
|
8001
|
-
|
8009
|
+
function contains(root, selectorOrElement) {
|
8010
|
+
if (u.isElement(selectorOrElement)) {
|
8011
|
+
return e.contains(root, selectorOrElement) && up.layer.get(root).contains(selectorOrElement);
|
8012
|
+
}
|
8013
|
+
else {
|
8014
|
+
return getSubtree(root, selectorOrElement).length > 0;
|
8015
|
+
}
|
8002
8016
|
}
|
8003
8017
|
function closest(element, selector, options) {
|
8004
8018
|
element = e.get(element);
|
@@ -8643,7 +8657,7 @@ up.viewport = (function () {
|
|
8643
8657
|
}
|
8644
8658
|
function focusedElementWithin(scopeElement) {
|
8645
8659
|
const focusedElement = document.activeElement;
|
8646
|
-
if (
|
8660
|
+
if (up.fragment.contains(scopeElement, focusedElement)) {
|
8647
8661
|
return focusedElement;
|
8648
8662
|
}
|
8649
8663
|
}
|
@@ -8913,8 +8927,11 @@ up.motion = (function () {
|
|
8913
8927
|
function translateCSS(dx, dy) {
|
8914
8928
|
return { transform: `translate(${dx}px, ${dy}px)` };
|
8915
8929
|
}
|
8930
|
+
function noTranslateCSS() {
|
8931
|
+
return { transform: null };
|
8932
|
+
}
|
8916
8933
|
function untranslatedBox(element) {
|
8917
|
-
e.setStyle(element,
|
8934
|
+
e.setStyle(element, noTranslateCSS());
|
8918
8935
|
return element.getBoundingClientRect();
|
8919
8936
|
}
|
8920
8937
|
function registerMoveAnimations(direction, boxToTransform) {
|
@@ -8929,7 +8946,7 @@ up.motion = (function () {
|
|
8929
8946
|
const box = untranslatedBox(element);
|
8930
8947
|
const transform = boxToTransform(box);
|
8931
8948
|
e.setStyle(element, transform);
|
8932
|
-
return animateNow(element,
|
8949
|
+
return animateNow(element, noTranslateCSS(), options);
|
8933
8950
|
});
|
8934
8951
|
}
|
8935
8952
|
registerMoveAnimations('top', function (box) {
|
@@ -9733,13 +9750,13 @@ up.form = (function () {
|
|
9733
9750
|
}
|
9734
9751
|
function submittingButton(form) {
|
9735
9752
|
const selector = submitButtonSelector();
|
9736
|
-
const focusedElement =
|
9737
|
-
if (focusedElement && focusedElement.
|
9738
|
-
|
9739
|
-
|
9740
|
-
|
9741
|
-
return e.get(form, selector);
|
9753
|
+
const focusedElement = document.activeElement;
|
9754
|
+
if (focusedElement && focusedElement.form === form) {
|
9755
|
+
if (focusedElement.matches(selector)) {
|
9756
|
+
return focusedElement;
|
9757
|
+
}
|
9742
9758
|
}
|
9759
|
+
return e.get(form, selector);
|
9743
9760
|
}
|
9744
9761
|
function submitButtonSelector() {
|
9745
9762
|
return config.submitButtonSelectors.join(',');
|