unpoly-rails 2.5.0 → 2.5.1

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.

Potentially problematic release.


This version of unpoly-rails might be problematic. Click here for more details.

@@ -8,7 +8,7 @@
8
8
  @module up
9
9
  */
10
10
  window.up = {
11
- version: '2.5.0'
11
+ version: '2.5.1'
12
12
  };
13
13
 
14
14
 
@@ -31,10 +31,14 @@ up.mockable = function (originalFn) {
31
31
  /* 3 */
32
32
  /***/ (function() {
33
33
 
34
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
35
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
36
- to[j] = from[i];
37
- return to;
34
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
35
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
36
+ if (ar || !(i in from)) {
37
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
38
+ ar[i] = from[i];
39
+ }
40
+ }
41
+ return to.concat(ar || Array.prototype.slice.call(from));
38
42
  };
39
43
  /*-
40
44
  Utility functions
@@ -176,7 +180,7 @@ up.util = (function () {
176
180
  // and also handles standard ports.
177
181
  // See https://developer.mozilla.org/en-US/docs/Web/API/URL/host
178
182
  if (!isStandardPort(parts.protocol, parts.port)) {
179
- normalized += ":" + parts.port;
183
+ normalized += ":".concat(parts.port);
180
184
  }
181
185
  }
182
186
  var pathname = parts.pathname;
@@ -890,7 +894,7 @@ up.util = (function () {
890
894
  for (var _i = 0; _i < arguments.length; _i++) {
891
895
  sources[_i] = arguments[_i];
892
896
  }
893
- return assign.apply(void 0, __spreadArray([{}], sources));
897
+ return assign.apply(void 0, __spreadArray([{}], sources, false));
894
898
  }
895
899
  /*-
896
900
  @function up.util.mergeDefined
@@ -1786,7 +1790,7 @@ up.util = (function () {
1786
1790
  for (var _i = 1; _i < arguments.length; _i++) {
1787
1791
  args[_i - 1] = arguments[_i];
1788
1792
  }
1789
- return (args[0] instanceof constructor) ? args[0] : new (constructor.bind.apply(constructor, __spreadArray([void 0], args)))();
1793
+ return (args[0] instanceof constructor) ? args[0] : new (constructor.bind.apply(constructor, __spreadArray([void 0], args, false)))();
1790
1794
  }
1791
1795
  // wrapArray = (objOrArray) ->
1792
1796
  // if isUndefined(objOrArray)
@@ -1899,20 +1903,20 @@ up.util = (function () {
1899
1903
  string = arg.toString();
1900
1904
  }
1901
1905
  else if (isArray(arg)) {
1902
- string = "[" + map(arg, stringifyArg).join(', ') + "]";
1906
+ string = "[".concat(map(arg, stringifyArg).join(', '), "]");
1903
1907
  closer = ']';
1904
1908
  }
1905
1909
  else if (isJQuery(arg)) {
1906
- string = "$(" + map(arg, stringifyArg).join(', ') + ")";
1910
+ string = "$(".concat(map(arg, stringifyArg).join(', '), ")");
1907
1911
  closer = ')';
1908
1912
  }
1909
1913
  else if (isElement(arg)) {
1910
- string = "<" + arg.tagName.toLowerCase();
1914
+ string = "<".concat(arg.tagName.toLowerCase());
1911
1915
  for (var _i = 0, _a = ['id', 'name', 'class']; _i < _a.length; _i++) {
1912
1916
  var attr = _a[_i];
1913
1917
  var value = arg.getAttribute(attr);
1914
1918
  if (value) {
1915
- string += " " + attr + "=\"" + value + "\"";
1919
+ string += " ".concat(attr, "=\"").concat(value, "\"");
1916
1920
  }
1917
1921
  }
1918
1922
  string += ">";
@@ -1935,7 +1939,7 @@ up.util = (function () {
1935
1939
  }
1936
1940
  }
1937
1941
  if (string.length > maxLength) {
1938
- string = string.substr(0, maxLength) + " \u2026";
1942
+ string = "".concat(string.substr(0, maxLength), " \u2026");
1939
1943
  string += closer;
1940
1944
  }
1941
1945
  return string;
@@ -1955,7 +1959,7 @@ up.util = (function () {
1955
1959
  for (var _i = 1; _i < arguments.length; _i++) {
1956
1960
  args[_i - 1] = arguments[_i];
1957
1961
  }
1958
- return sprintfWithFormattedArgs.apply(void 0, __spreadArray([identity, message], args));
1962
+ return sprintfWithFormattedArgs.apply(void 0, __spreadArray([identity, message], args, false));
1959
1963
  }
1960
1964
  /*-
1961
1965
  @function up.util.sprintfWithFormattedArgs
@@ -2153,10 +2157,10 @@ up.error = (function () {
2153
2157
  });
2154
2158
  var notImplemented = errorInterface('up.NotImplemented');
2155
2159
  var notApplicable = errorInterface('up.NotApplicable', function (change, reason) {
2156
- return build("Cannot apply change: " + change + " (" + reason + ")");
2160
+ return build("Cannot apply change: ".concat(change, " (").concat(reason, ")"));
2157
2161
  });
2158
2162
  var invalidSelector = errorInterface('up.InvalidSelector', function (selector) {
2159
- return build("Cannot parse selector: " + selector);
2163
+ return build("Cannot parse selector: ".concat(selector));
2160
2164
  });
2161
2165
  function emitGlobal(error) {
2162
2166
  // Emit an ErrorEvent on window.onerror for exception tracking tools
@@ -2325,10 +2329,14 @@ up.browser = (function () {
2325
2329
  /* 7 */
2326
2330
  /***/ (function() {
2327
2331
 
2328
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
2329
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
2330
- to[j] = from[i];
2331
- return to;
2332
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
2333
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
2334
+ if (ar || !(i in from)) {
2335
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
2336
+ ar[i] = from[i];
2337
+ }
2338
+ }
2339
+ return to.concat(ar || Array.prototype.slice.call(from));
2332
2340
  };
2333
2341
  /*-
2334
2342
  DOM helpers
@@ -2521,7 +2529,7 @@ up.element = (function () {
2521
2529
  return value;
2522
2530
  }
2523
2531
  else if (u.isString(value)) {
2524
- return first.apply(void 0, __spreadArray(__spreadArray([], args), [value]));
2532
+ return first.apply(void 0, __spreadArray(__spreadArray([], args, false), [value], false));
2525
2533
  }
2526
2534
  else if (u.isList(value)) {
2527
2535
  if (value.length > 1) {
@@ -2845,7 +2853,7 @@ up.element = (function () {
2845
2853
  var attrValues = [];
2846
2854
  var selectorWithoutAttrValues = selector.replace(/\[([\w-]+)(?:[~|^$*]?=(["'])?([^\2\]]*?)\2)?\]/g, function (_match, attrName, _quote, attrValue) {
2847
2855
  attrValues.push(attrValue || '');
2848
- return "[" + attrName + "]";
2856
+ return "[".concat(attrName, "]");
2849
2857
  });
2850
2858
  var depths = selectorWithoutAttrValues.split(/[ >]+/);
2851
2859
  var rootElement;
@@ -3006,14 +3014,14 @@ up.element = (function () {
3006
3014
  */
3007
3015
  function attributeSelector(attribute, value) {
3008
3016
  value = value.replace(/"/g, '\\"');
3009
- return "[" + attribute + "=\"" + value + "\"]";
3017
+ return "[".concat(attribute, "=\"").concat(value, "\"]");
3010
3018
  }
3011
3019
  function trueAttributeSelector(attribute) {
3012
- return "[" + attribute + "]:not([" + attribute + "=false])";
3020
+ return "[".concat(attribute, "]:not([").concat(attribute, "=false])");
3013
3021
  }
3014
3022
  function idSelector(id) {
3015
3023
  if (id.match(/^[a-z0-9\-_]+$/i)) {
3016
- return "#" + id;
3024
+ return "#".concat(id);
3017
3025
  }
3018
3026
  else {
3019
3027
  return attributeSelector('id', id);
@@ -3025,7 +3033,7 @@ up.element = (function () {
3025
3033
  */
3026
3034
  function classSelector(klass) {
3027
3035
  klass = klass.replace(/:/g, '\\:');
3028
- return "." + klass;
3036
+ return ".".concat(klass);
3029
3037
  }
3030
3038
  /*-
3031
3039
  Always creates a full document with a <html> root, even if the given `html`
@@ -3325,12 +3333,12 @@ up.element = (function () {
3325
3333
  var code = link.getAttribute(attr);
3326
3334
  if (code) {
3327
3335
  // Allow callbacks to refer to an exposed property directly instead of through `event.value`.
3328
- var callback_1 = (_a = up.NonceableCallback.fromString(code)).toFunction.apply(_a, __spreadArray(['event'], exposedKeys));
3336
+ var callback_1 = (_a = up.NonceableCallback.fromString(code)).toFunction.apply(_a, __spreadArray(['event'], exposedKeys, false));
3329
3337
  // Emulate the behavior of the `onclick` attribute,
3330
3338
  // where `this` refers to the clicked element.
3331
3339
  return function (event) {
3332
3340
  var exposedValues = u.values(u.pick(event, exposedKeys));
3333
- return callback_1.call.apply(callback_1, __spreadArray([link, event], exposedValues));
3341
+ return callback_1.call.apply(callback_1, __spreadArray([link, event], exposedValues, false));
3334
3342
  };
3335
3343
  }
3336
3344
  }
@@ -3655,10 +3663,14 @@ up.Config = /** @class */ (function () {
3655
3663
  /* 10 */
3656
3664
  /***/ (function() {
3657
3665
 
3658
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
3659
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
3660
- to[j] = from[i];
3661
- return to;
3666
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3667
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3668
+ if (ar || !(i in from)) {
3669
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
3670
+ ar[i] = from[i];
3671
+ }
3672
+ }
3673
+ return to.concat(ar || Array.prototype.slice.call(from));
3662
3674
  };
3663
3675
  var u = up.util;
3664
3676
  /*-
@@ -3719,8 +3731,8 @@ up.Cache = /** @class */ (function () {
3719
3731
  args[_i] = arguments[_i];
3720
3732
  }
3721
3733
  if (this.config.logPrefix) {
3722
- args[0] = "[" + this.config.logPrefix + "] " + args[0];
3723
- up.puts.apply(up, __spreadArray(['up.Cache'], args));
3734
+ args[0] = "[".concat(this.config.logPrefix, "] ").concat(args[0]);
3735
+ up.puts.apply(up, __spreadArray(['up.Cache'], args, false));
3724
3736
  }
3725
3737
  };
3726
3738
  Cache.prototype.keys = function () {
@@ -4309,7 +4321,7 @@ up.Change.OpenLayer = /** @class */ (function (_super) {
4309
4321
  throw this.notApplicable();
4310
4322
  }
4311
4323
  onApplicable();
4312
- up.puts('up.render()', "Opening element \"" + this.target + "\" in new overlay");
4324
+ up.puts('up.render()', "Opening element \"".concat(this.target, "\" in new overlay"));
4313
4325
  this.options.title = this.improveHistoryValue(this.options.title, responseDoc.getTitle());
4314
4326
  if (this.emitOpenEvent().defaultPrevented) {
4315
4327
  // We cannot use @abortWhenLayerClosed() here,
@@ -4429,7 +4441,7 @@ up.Change.OpenLayer = /** @class */ (function (_super) {
4429
4441
  return this.layer.emit('up:layer:opened', {
4430
4442
  origin: this.origin,
4431
4443
  callback: this.layer.callback('onOpened'),
4432
- log: "Opened new " + this.layer
4444
+ log: "Opened new ".concat(this.layer)
4433
4445
  });
4434
4446
  };
4435
4447
  return OpenLayer;
@@ -4540,7 +4552,7 @@ up.Change.UpdateLayer = /** @class */ (function (_super) {
4540
4552
  this.matchPostflight();
4541
4553
  onApplicable();
4542
4554
  // Don't log @target since that does not include hungry elements
4543
- up.puts('up.render()', "Updating \"" + this.bestPreflightSelector() + "\" in " + this.layer);
4555
+ up.puts('up.render()', "Updating \"".concat(this.bestPreflightSelector(), "\" in ").concat(this.layer));
4544
4556
  this.options.title = this.improveHistoryValue(this.options.title, this.responseDoc.getTitle());
4545
4557
  // Make sure only the first step will have scroll-related options.
4546
4558
  this.setScrollAndFocusOptions();
@@ -4794,7 +4806,7 @@ up.Change.UpdateLayer = /** @class */ (function (_super) {
4794
4806
  // Note that step.oldElement might already have been set by @parseSteps().
4795
4807
  step.oldElement || (step.oldElement = finder.find());
4796
4808
  if (!step.oldElement) {
4797
- throw this.notApplicable("Could not find element \"" + this.target + "\" in current page");
4809
+ throw this.notApplicable("Could not find element \"".concat(this.target, "\" in current page"));
4798
4810
  }
4799
4811
  }
4800
4812
  this.resolveOldNesting();
@@ -4813,7 +4825,7 @@ up.Change.UpdateLayer = /** @class */ (function (_super) {
4813
4825
  step.newElement = newElement;
4814
4826
  }
4815
4827
  else {
4816
- throw this.notApplicable("Could not find element \"" + this.target + "\" in server response");
4828
+ throw this.notApplicable("Could not find element \"".concat(this.target, "\" in server response"));
4817
4829
  }
4818
4830
  }
4819
4831
  // Only when we have a match in the required selectors, we
@@ -4952,13 +4964,13 @@ up.Change.CloseLayer = /** @class */ (function (_super) {
4952
4964
  };
4953
4965
  CloseLayer.prototype.emitCloseEvent = function () {
4954
4966
  // The close event is emitted on the layer that is about to close.
4955
- return this.layer.emit(this.buildEvent("up:layer:" + this.verb), {
4956
- callback: this.layer.callback("on" + u.upperCaseFirst(this.verb)),
4957
- log: "Will " + this.verb + " " + this.layer
4967
+ return this.layer.emit(this.buildEvent("up:layer:".concat(this.verb)), {
4968
+ callback: this.layer.callback("on".concat(u.upperCaseFirst(this.verb))),
4969
+ log: "Will ".concat(this.verb, " ").concat(this.layer)
4958
4970
  });
4959
4971
  };
4960
4972
  CloseLayer.prototype.emitClosedEvent = function (formerParent) {
4961
- var verbPast = this.verb + "ed";
4973
+ var verbPast = "".concat(this.verb, "ed");
4962
4974
  var verbPastUpperCaseFirst = u.upperCaseFirst(verbPast);
4963
4975
  // layer.emit({ ensureBubbles: true }) will automatically emit a second event on document
4964
4976
  // because the layer is detached. We do not want to emit it on the parent layer where users
@@ -4966,13 +4978,13 @@ up.Change.CloseLayer = /** @class */ (function (_super) {
4966
4978
  // is now detached, the event will no longer bubble up to the document where global
4967
4979
  // event listeners can receive it. So we explicitly emit the event a second time
4968
4980
  // on the document.
4969
- return this.layer.emit(this.buildEvent("up:layer:" + verbPast), {
4981
+ return this.layer.emit(this.buildEvent("up:layer:".concat(verbPast)), {
4970
4982
  // Set up.layer.current to the parent of the closed layer, which is now likely
4971
4983
  // to be the front layer.
4972
4984
  baseLayer: formerParent,
4973
- callback: this.layer.callback("on" + verbPastUpperCaseFirst),
4985
+ callback: this.layer.callback("on".concat(verbPastUpperCaseFirst)),
4974
4986
  ensureBubbles: true,
4975
- log: verbPastUpperCaseFirst + " " + this.layer
4987
+ log: "".concat(verbPastUpperCaseFirst, " ").concat(this.layer)
4976
4988
  });
4977
4989
  };
4978
4990
  CloseLayer.prototype.buildEvent = function (name) {
@@ -5612,7 +5624,7 @@ up.CSSTransition = /** @class */ (function () {
5612
5624
  CSSTransition.prototype.startMotion = function () {
5613
5625
  e.setStyle(this.element, {
5614
5626
  transitionProperty: Object.keys(this.lastFrameKebab).join(', '),
5615
- transitionDuration: this.duration + "ms",
5627
+ transitionDuration: "".concat(this.duration, "ms"),
5616
5628
  transitionTimingFunction: this.easing
5617
5629
  });
5618
5630
  e.setStyle(this.element, this.lastFrameKebab);
@@ -5697,10 +5709,14 @@ var __extends = (this && this.__extends) || (function () {
5697
5709
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
5698
5710
  };
5699
5711
  })();
5700
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
5701
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
5702
- to[j] = from[i];
5703
- return to;
5712
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
5713
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
5714
+ if (ar || !(i in from)) {
5715
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5716
+ ar[i] = from[i];
5717
+ }
5718
+ }
5719
+ return to.concat(ar || Array.prototype.slice.call(from));
5704
5720
  };
5705
5721
  var u = up.util;
5706
5722
  var e = up.element;
@@ -5741,7 +5757,7 @@ up.EventEmitter = /** @class */ (function (_super) {
5741
5757
  EventEmitter.prototype.assertEmitted = function () {
5742
5758
  var event = this.emit();
5743
5759
  if (event.defaultPrevented) {
5744
- throw up.error.aborted("Event " + event.type + " was prevented");
5760
+ throw up.error.aborted("Event ".concat(event.type, " was prevented"));
5745
5761
  }
5746
5762
  };
5747
5763
  EventEmitter.prototype.logEmission = function () {
@@ -5759,10 +5775,10 @@ up.EventEmitter = /** @class */ (function (_super) {
5759
5775
  }
5760
5776
  var type = this.event.type;
5761
5777
  if (u.isString(message)) {
5762
- up.puts.apply(up, __spreadArray([type, message], messageArgs));
5778
+ up.puts.apply(up, __spreadArray([type, message], messageArgs, false));
5763
5779
  }
5764
5780
  else if (message !== false) {
5765
- up.puts(type, "Event " + type);
5781
+ up.puts(type, "Event ".concat(type));
5766
5782
  }
5767
5783
  };
5768
5784
  EventEmitter.fromEmitArgs = function (args, defaults) {
@@ -5863,10 +5879,14 @@ var __extends = (this && this.__extends) || (function () {
5863
5879
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
5864
5880
  };
5865
5881
  })();
5866
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
5867
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
5868
- to[j] = from[i];
5869
- return to;
5882
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
5883
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
5884
+ if (ar || !(i in from)) {
5885
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5886
+ ar[i] = from[i];
5887
+ }
5888
+ }
5889
+ return to.concat(ar || Array.prototype.slice.call(from));
5870
5890
  };
5871
5891
  var u = up.util;
5872
5892
  var e = up.element;
@@ -5959,7 +5979,7 @@ up.EventListener = /** @class */ (function (_super) {
5959
5979
  var data = up.syntax.data(element);
5960
5980
  args.push(data);
5961
5981
  }
5962
- var applyCallback = (_a = this.callback).bind.apply(_a, __spreadArray([element], args));
5982
+ var applyCallback = (_a = this.callback).bind.apply(_a, __spreadArray([element], args, false));
5963
5983
  if (this.baseLayer) {
5964
5984
  // Unpoly will usually set up.layer.current when emitting an event.
5965
5985
  // But Unpoly-unaware code will not set up.layer.current when emitting events.
@@ -6682,11 +6702,11 @@ var e = up.element;
6682
6702
  up.HTMLWrapper = /** @class */ (function () {
6683
6703
  function HTMLWrapper(tagName) {
6684
6704
  this.tagName = tagName;
6685
- var openTag = "<" + this.tagName + "[^>]*>";
6686
- var closeTag = "</" + this.tagName + ">";
6705
+ var openTag = "<".concat(this.tagName, "[^>]*>");
6706
+ var closeTag = "</".concat(this.tagName, ">");
6687
6707
  var innerHTML = "(.|\\s)*?";
6688
6708
  this.pattern = new RegExp(openTag + innerHTML + closeTag, 'ig');
6689
- this.attrName = "up-wrapped-" + this.tagName;
6709
+ this.attrName = "up-wrapped-".concat(this.tagName);
6690
6710
  }
6691
6711
  HTMLWrapper.prototype.strip = function (html) {
6692
6712
  return html.replace(this.pattern, '');
@@ -6705,7 +6725,7 @@ up.HTMLWrapper = /** @class */ (function () {
6705
6725
  if (!this.didWrap) {
6706
6726
  return;
6707
6727
  }
6708
- for (var _i = 0, _a = element.querySelectorAll("meta[name='" + this.attrName + "']"); _i < _a.length; _i++) {
6728
+ for (var _i = 0, _a = element.querySelectorAll("meta[name='".concat(this.attrName, "']")); _i < _a.length; _i++) {
6709
6729
  var wrappedChild = _a[_i];
6710
6730
  var originalHTML = wrappedChild.getAttribute('value');
6711
6731
  var restoredElement = e.createFromHTML(originalHTML);
@@ -6735,10 +6755,14 @@ var __extends = (this && this.__extends) || (function () {
6735
6755
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
6736
6756
  };
6737
6757
  })();
6738
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
6739
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
6740
- to[j] = from[i];
6741
- return to;
6758
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
6759
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
6760
+ if (ar || !(i in from)) {
6761
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6762
+ ar[i] = from[i];
6763
+ }
6764
+ }
6765
+ return to.concat(ar || Array.prototype.slice.call(from));
6742
6766
  };
6743
6767
  var e = up.element;
6744
6768
  var u = up.util;
@@ -7465,7 +7489,7 @@ up.Layer = /** @class */ (function (_super) {
7465
7489
  for (var _i = 0; _i < arguments.length; _i++) {
7466
7490
  args[_i] = arguments[_i];
7467
7491
  }
7468
- return e.affix.apply(e, __spreadArray([this.getFirstSwappableElement()], args));
7492
+ return e.affix.apply(e, __spreadArray([this.getFirstSwappableElement()], args, false));
7469
7493
  };
7470
7494
  Layer.prototype[u.isEqual.key] = function (other) {
7471
7495
  return (this.constructor === other.constructor) && (this.element === other.element);
@@ -7722,12 +7746,13 @@ up.Layer.Overlay = /** @class */ (function (_super) {
7722
7746
  }
7723
7747
  };
7724
7748
  Overlay.prototype.registerClickCloser = function (attribute, closeFn) {
7749
+ var selector = "[".concat(attribute, "]");
7725
7750
  // Allow the fallbacks to be both vanilla links and Unpoly [up-target] links
7726
- this.on('up:click', "[" + attribute + "]", function (event) {
7751
+ this.on('up:click', selector, function (event) {
7727
7752
  // Since we're defining this handler on up.Overlay, we will not prevent
7728
7753
  // a link from being followed on the root layer.
7729
7754
  up.event.halt(event);
7730
- var origin = event.target;
7755
+ var origin = event.target.closest(selector);
7731
7756
  var value = e.jsonAttr(origin, attribute);
7732
7757
  var closeOptions = { origin: origin };
7733
7758
  var parser = new up.OptionsParser(closeOptions, origin);
@@ -7858,7 +7883,7 @@ up.Layer.Overlay = /** @class */ (function (_super) {
7858
7883
  return this.getContentElement().children[0];
7859
7884
  };
7860
7885
  Overlay.prototype.toString = function () {
7861
- return this.mode + " overlay";
7886
+ return "".concat(this.mode, " overlay");
7862
7887
  };
7863
7888
  return Overlay;
7864
7889
  }(up.Layer));
@@ -8234,10 +8259,14 @@ var __assign = (this && this.__assign) || function () {
8234
8259
  };
8235
8260
  return __assign.apply(this, arguments);
8236
8261
  };
8237
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
8238
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
8239
- to[j] = from[i];
8240
- return to;
8262
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
8263
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
8264
+ if (ar || !(i in from)) {
8265
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
8266
+ ar[i] = from[i];
8267
+ }
8268
+ }
8269
+ return to.concat(ar || Array.prototype.slice.call(from));
8241
8270
  };
8242
8271
  var u = up.util;
8243
8272
  var e = up.element;
@@ -8306,7 +8335,7 @@ up.LayerLookup = /** @class */ (function () {
8306
8335
  case 'any':
8307
8336
  // Return all layers, but prefer a layer that's either the current
8308
8337
  // layer, or closer to the front.
8309
- return __spreadArray([this.baseLayer], this.stack.reversed());
8338
+ return __spreadArray([this.baseLayer], this.stack.reversed(), true);
8310
8339
  case 'current':
8311
8340
  return this.baseLayer;
8312
8341
  case 'closest':
@@ -8370,10 +8399,14 @@ var __assign = (this && this.__assign) || function () {
8370
8399
  };
8371
8400
  return __assign.apply(this, arguments);
8372
8401
  };
8373
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
8374
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
8375
- to[j] = from[i];
8376
- return to;
8402
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
8403
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
8404
+ if (ar || !(i in from)) {
8405
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
8406
+ ar[i] = from[i];
8407
+ }
8408
+ }
8409
+ return to.concat(ar || Array.prototype.slice.call(from));
8377
8410
  };
8378
8411
  var u = up.util;
8379
8412
  up.LayerStack = /** @class */ (function (_super) {
@@ -8437,7 +8470,7 @@ up.LayerStack = /** @class */ (function (_super) {
8437
8470
  };
8438
8471
  LayerStack.prototype.selfAndAncestorsOf = function (layer) {
8439
8472
  // Order for layer.closest()
8440
- return __spreadArray([layer], layer.ancestors);
8473
+ return __spreadArray([layer], layer.ancestors, true);
8441
8474
  };
8442
8475
  LayerStack.prototype.descendantsOf = function (layer) {
8443
8476
  return this.slice(layer.index + 1);
@@ -8467,7 +8500,7 @@ up.LayerStack = /** @class */ (function (_super) {
8467
8500
  for (var _i = 0; _i < arguments.length; _i++) {
8468
8501
  args[_i] = arguments[_i];
8469
8502
  }
8470
- return new ((_a = up.LayerLookup).bind.apply(_a, __spreadArray([void 0, this], args)))().all();
8503
+ return new ((_a = up.LayerLookup).bind.apply(_a, __spreadArray([void 0, this], args, false)))().all();
8471
8504
  };
8472
8505
  LayerStack.prototype.sync = function () {
8473
8506
  for (var _i = 0, _a = this; _i < _a.length; _i++) {
@@ -8712,10 +8745,10 @@ var u = up.util;
8712
8745
  var e = up.element;
8713
8746
  up.MotionController = /** @class */ (function () {
8714
8747
  function MotionController(name) {
8715
- this.activeClass = "up-" + name;
8716
- this.dataKey = "up-" + name + "-finished";
8717
- this.selector = "." + this.activeClass;
8718
- this.finishEvent = "up:" + name + ":finish";
8748
+ this.activeClass = "up-".concat(name);
8749
+ this.dataKey = "up-".concat(name, "-finished");
8750
+ this.selector = ".".concat(this.activeClass);
8751
+ this.finishEvent = "up:".concat(name, ":finish");
8719
8752
  this.finishCount = 0;
8720
8753
  this.clusterCount = 0;
8721
8754
  }
@@ -8914,10 +8947,14 @@ up.MotionController = /** @class */ (function () {
8914
8947
  /* 49 */
8915
8948
  /***/ (function() {
8916
8949
 
8917
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
8918
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
8919
- to[j] = from[i];
8920
- return to;
8950
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
8951
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
8952
+ if (ar || !(i in from)) {
8953
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
8954
+ ar[i] = from[i];
8955
+ }
8956
+ }
8957
+ return to.concat(ar || Array.prototype.slice.call(from));
8921
8958
  };
8922
8959
  var u = up.util;
8923
8960
  var e = up.element;
@@ -8950,7 +8987,7 @@ up.NonceableCallback = /** @class */ (function () {
8950
8987
  argNames[_i] = arguments[_i];
8951
8988
  }
8952
8989
  if (up.browser.canEval()) {
8953
- return new (Function.bind.apply(Function, __spreadArray(__spreadArray([void 0], argNames), [this.script])))();
8990
+ return new (Function.bind.apply(Function, __spreadArray(__spreadArray([void 0], argNames, false), [this.script], false)))();
8954
8991
  }
8955
8992
  else if (this.nonce) {
8956
8993
  // Don't return a bound function so callers can re-bind to a different this.
@@ -8968,13 +9005,13 @@ up.NonceableCallback = /** @class */ (function () {
8968
9005
  }
8969
9006
  };
8970
9007
  NonceableCallback.prototype.toString = function () {
8971
- return "nonce-" + this.nonce + " " + this.script;
9008
+ return "nonce-".concat(this.nonce, " ").concat(this.script);
8972
9009
  };
8973
9010
  NonceableCallback.prototype.cannotRun = function () {
8974
- throw new Error("Your Content Security Policy disallows inline JavaScript (" + this.script + "). See https://unpoly.com/csp for solutions.");
9011
+ throw new Error("Your Content Security Policy disallows inline JavaScript (".concat(this.script, "). See https://unpoly.com/csp for solutions."));
8975
9012
  };
8976
9013
  NonceableCallback.prototype.runAsNoncedFunction = function (thisArg, argNames, args) {
8977
- var wrappedScript = "\n try {\n up.noncedEval.value = (function(" + argNames.join(',') + ") {\n " + this.script + "\n }).apply(up.noncedEval.thisArg, up.noncedEval.args)\n } catch (error) {\n up.noncedEval.error = error\n }\n ";
9014
+ var wrappedScript = "\n try {\n up.noncedEval.value = (function(".concat(argNames.join(','), ") {\n ").concat(this.script, "\n }).apply(up.noncedEval.thisArg, up.noncedEval.args)\n } catch (error) {\n up.noncedEval.error = error\n }\n ");
8978
9015
  var script;
8979
9016
  try {
8980
9017
  up.noncedEval = { args: args, thisArg: thisArg };
@@ -9006,7 +9043,7 @@ up.NonceableCallback = /** @class */ (function () {
9006
9043
  // a nonce, and only once per response.
9007
9044
  var getPageNonce = u.memoize(up.protocol.cspNonce);
9008
9045
  u.each(up.protocol.config.nonceableAttributes, function (attribute) {
9009
- var matches = e.subtree(element, "[" + attribute + "^=\"nonce-\"]");
9046
+ var matches = e.subtree(element, "[".concat(attribute, "^=\"nonce-\"]"));
9010
9047
  u.each(matches, function (match) {
9011
9048
  var attributeValue = match.getAttribute(attribute);
9012
9049
  var callback = _this.fromString(attributeValue);
@@ -9016,7 +9053,7 @@ up.NonceableCallback = /** @class */ (function () {
9016
9053
  for (var _i = 1; _i < arguments.length; _i++) {
9017
9054
  args[_i - 1] = arguments[_i];
9018
9055
  }
9019
- return (_a = up.log).warn.apply(_a, __spreadArray(['up.render()', "Cannot use callback [" + attribute + "=\"" + attributeValue + "\"]: " + message], args));
9056
+ return (_a = up.log).warn.apply(_a, __spreadArray(['up.render()', "Cannot use callback [".concat(attribute, "=\"").concat(attributeValue, "\"]: ").concat(message)], args, false));
9020
9057
  };
9021
9058
  if (!callback.allowedBy(allowedNonces)) {
9022
9059
  // Don't rewrite a nonce that the browser would have rejected.
@@ -9105,11 +9142,11 @@ up.OptionsParser = /** @class */ (function () {
9105
9142
  };
9106
9143
  OptionsParser.prototype.deriveFailAttrName = function (attr) {
9107
9144
  if (attr.indexOf('up-') === 0) {
9108
- return "up-fail-" + attr.slice(3);
9145
+ return "up-fail-".concat(attr.slice(3));
9109
9146
  }
9110
9147
  };
9111
9148
  OptionsParser.prototype.attrNameForKey = function (option) {
9112
- return "up-" + u.camelToKebabCase(option);
9149
+ return "up-".concat(u.camelToKebabCase(option));
9113
9150
  };
9114
9151
  return OptionsParser;
9115
9152
  }());
@@ -9816,7 +9853,7 @@ up.ProgressBar = /** @class */ (function () {
9816
9853
  function ProgressBar() {
9817
9854
  this.step = 0;
9818
9855
  this.element = e.affix(document.body, 'up-progress-bar');
9819
- this.element.style.transition = "width " + TRANSITION_DELAY + "ms ease-out";
9856
+ this.element.style.transition = "width ".concat(TRANSITION_DELAY, "ms ease-out");
9820
9857
  this.moveTo(0);
9821
9858
  // The element must be painted at width: 0 before we apply the target width.
9822
9859
  // If the first paint sees the bar at the target width, we don't get an animated transition.
@@ -9849,7 +9886,7 @@ up.ProgressBar = /** @class */ (function () {
9849
9886
  };
9850
9887
  ProgressBar.prototype.moveTo = function (width) {
9851
9888
  this.width = width;
9852
- this.element.style.width = width + "vw";
9889
+ this.element.style.width = "".concat(width, "vw");
9853
9890
  };
9854
9891
  ProgressBar.prototype.destroy = function () {
9855
9892
  clearTimeout(this.timeout);
@@ -13642,10 +13679,14 @@ up.protocol = (function () {
13642
13679
  /* 73 */
13643
13680
  /***/ (function() {
13644
13681
 
13645
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
13646
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
13647
- to[j] = from[i];
13648
- return to;
13682
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
13683
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
13684
+ if (ar || !(i in from)) {
13685
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
13686
+ ar[i] = from[i];
13687
+ }
13688
+ }
13689
+ return to.concat(ar || Array.prototype.slice.call(from));
13649
13690
  };
13650
13691
  /*-
13651
13692
  Logging
@@ -13713,7 +13754,7 @@ up.log = (function () {
13713
13754
  args[_i] = arguments[_i];
13714
13755
  }
13715
13756
  if (config.enabled) {
13716
- printToStream.apply(void 0, __spreadArray(['log'], args));
13757
+ printToStream.apply(void 0, __spreadArray(['log'], args, false));
13717
13758
  }
13718
13759
  }
13719
13760
  /*-
@@ -13725,7 +13766,7 @@ up.log = (function () {
13725
13766
  for (var _i = 0; _i < arguments.length; _i++) {
13726
13767
  args[_i] = arguments[_i];
13727
13768
  }
13728
- return printToStream.apply(void 0, __spreadArray(['warn'], args));
13769
+ return printToStream.apply(void 0, __spreadArray(['warn'], args, false));
13729
13770
  };
13730
13771
  /*-
13731
13772
  @function up.log.error
@@ -13736,7 +13777,7 @@ up.log = (function () {
13736
13777
  for (var _i = 0; _i < arguments.length; _i++) {
13737
13778
  args[_i] = arguments[_i];
13738
13779
  }
13739
- return printToStream.apply(void 0, __spreadArray(['error'], args));
13780
+ return printToStream.apply(void 0, __spreadArray(['error'], args, false));
13740
13781
  };
13741
13782
  function printToStream(stream, trace, message) {
13742
13783
  var args = [];
@@ -13747,12 +13788,12 @@ up.log = (function () {
13747
13788
  if (config.format) {
13748
13789
  args.unshift(''); // Reset
13749
13790
  args.unshift('color: #666666; padding: 1px 3px; border: 1px solid #bbbbbb; border-radius: 2px; font-size: 90%; display: inline-block');
13750
- message = "%c" + trace + "%c " + message;
13791
+ message = "%c".concat(trace, "%c ").concat(message);
13751
13792
  }
13752
13793
  else {
13753
- message = "[" + trace + "] " + message;
13794
+ message = "[".concat(trace, "] ").concat(message);
13754
13795
  }
13755
- console[stream].apply(console, __spreadArray([message], args));
13796
+ console[stream].apply(console, __spreadArray([message], args, false));
13756
13797
  }
13757
13798
  }
13758
13799
  function printBanner() {
@@ -13761,7 +13802,7 @@ up.log = (function () {
13761
13802
  }
13762
13803
  // The ASCII art looks broken in code since we need to escape backslashes
13763
13804
  var logo = " __ _____ ___ ___ / /_ __\n" +
13764
- ("/ // / _ \\/ _ \\/ _ \\/ / // / " + up.version + "\n") +
13805
+ "/ // / _ \\/ _ \\/ _ \\/ / // / ".concat(up.version, "\n") +
13765
13806
  "\\___/_//_/ .__/\\___/_/\\_. / \n" +
13766
13807
  " / / / /\n\n";
13767
13808
  var text = "";
@@ -13841,7 +13882,7 @@ up.log = (function () {
13841
13882
  for (var _i = 0; _i < arguments.length; _i++) {
13842
13883
  args[_i] = arguments[_i];
13843
13884
  }
13844
- printToError.apply(void 0, __spreadArray(['error'], args));
13885
+ printToError.apply(void 0, __spreadArray(['error'], args, false));
13845
13886
  throw up.error.failed(args);
13846
13887
  }
13847
13888
  /*-
@@ -14613,7 +14654,7 @@ up.history = (function () {
14613
14654
  if (options === void 0) { options = {}; }
14614
14655
  url = normalizeURL(url);
14615
14656
  if (manipulate('replaceState', url) && (options.event !== false)) {
14616
- emit('up:location:changed', { url: url, reason: 'replace', log: "Replaced state for " + url });
14657
+ emit('up:location:changed', { url: url, reason: 'replace', log: "Replaced state for ".concat(url) });
14617
14658
  }
14618
14659
  }
14619
14660
  /*-
@@ -14638,7 +14679,7 @@ up.history = (function () {
14638
14679
  function push(url) {
14639
14680
  url = normalizeURL(url);
14640
14681
  if (!isLocation(url) && manipulate('pushState', url)) {
14641
- up.emit('up:location:changed', { url: url, reason: 'push', log: "Advanced to location " + url });
14682
+ up.emit('up:location:changed', { url: url, reason: 'push', log: "Advanced to location ".concat(url) });
14642
14683
  }
14643
14684
  }
14644
14685
  /*-
@@ -14705,7 +14746,7 @@ up.history = (function () {
14705
14746
  case 1:
14706
14747
  _a.sent();
14707
14748
  url = currentLocation();
14708
- emit('up:location:changed', { url: url, reason: 'pop', log: "Restored location " + url });
14749
+ emit('up:location:changed', { url: url, reason: 'pop', log: "Restored location ".concat(url) });
14709
14750
  return [3 /*break*/, 3];
14710
14751
  case 2:
14711
14752
  up.puts('pop', 'Ignoring a state not pushed by Unpoly (%o)', state);
@@ -16669,10 +16710,14 @@ u.delegate(up, 'context', function () { return up.layer.current; });
16669
16710
  /* 78 */
16670
16711
  /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
16671
16712
 
16672
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
16673
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
16674
- to[j] = from[i];
16675
- return to;
16713
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
16714
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
16715
+ if (ar || !(i in from)) {
16716
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
16717
+ ar[i] = from[i];
16718
+ }
16719
+ }
16720
+ return to.concat(ar || Array.prototype.slice.call(from));
16676
16721
  };
16677
16722
  __webpack_require__(79);
16678
16723
  /*-
@@ -16995,7 +17040,7 @@ up.viewport = (function () {
16995
17040
  }
16996
17041
  function allSelector() {
16997
17042
  // On Edge the document viewport can be changed from CSS
16998
- return __spreadArray([rootSelector()], config.viewportSelectors).join(',');
17043
+ return __spreadArray([rootSelector()], config.viewportSelectors, true).join(',');
16999
17044
  }
17000
17045
  /*-
17001
17046
  Returns the scrolling container for the given element.
@@ -18196,15 +18241,15 @@ up.motion = (function () {
18196
18241
  registerOpacityAnimation('fade-in', 0, 1);
18197
18242
  registerOpacityAnimation('fade-out', 1, 0);
18198
18243
  function translateCSS(dx, dy) {
18199
- return { transform: "translate(" + dx + "px, " + dy + "px)" };
18244
+ return { transform: "translate(".concat(dx, "px, ").concat(dy, "px)") };
18200
18245
  }
18201
18246
  function untranslatedBox(element) {
18202
18247
  e.setStyle(element, translateCSS(0, 0));
18203
18248
  return element.getBoundingClientRect();
18204
18249
  }
18205
18250
  function registerMoveAnimations(direction, boxToTransform) {
18206
- var animationToName = "move-to-" + direction;
18207
- var animationFromName = "move-from-" + direction;
18251
+ var animationToName = "move-to-".concat(direction);
18252
+ var animationFromName = "move-from-".concat(direction);
18208
18253
  registerAnimation(animationToName, function (element, options) {
18209
18254
  var box = untranslatedBox(element);
18210
18255
  var transform = boxToTransform(box);
@@ -19265,10 +19310,14 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
19265
19310
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
19266
19311
  }
19267
19312
  };
19268
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
19269
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
19270
- to[j] = from[i];
19271
- return to;
19313
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
19314
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
19315
+ if (ar || !(i in from)) {
19316
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
19317
+ ar[i] = from[i];
19318
+ }
19319
+ }
19320
+ return to.concat(ar || Array.prototype.slice.call(from));
19272
19321
  };
19273
19322
  __webpack_require__(84);
19274
19323
  var u = up.util;
@@ -19593,7 +19642,7 @@ up.layer = (function () {
19593
19642
  if (handleDeprecatedConfig) {
19594
19643
  configs.forEach(handleDeprecatedConfig);
19595
19644
  }
19596
- options = u.mergeDefined.apply(u, __spreadArray(__spreadArray([], configs), [{ mode: mode, stack: stack }, options]));
19645
+ options = u.mergeDefined.apply(u, __spreadArray(__spreadArray([], configs, false), [{ mode: mode, stack: stack }, options], false));
19597
19646
  if (beforeNew) {
19598
19647
  options = beforeNew(options);
19599
19648
  }
@@ -19886,7 +19935,7 @@ up.layer = (function () {
19886
19935
  }
19887
19936
  function optionToString(option) {
19888
19937
  if (u.isString(option)) {
19889
- return "layer \"" + option + "\"";
19938
+ return "layer \"".concat(option, "\"");
19890
19939
  }
19891
19940
  else {
19892
19941
  return option.toString();
@@ -20559,10 +20608,14 @@ var __assign = (this && this.__assign) || function () {
20559
20608
  };
20560
20609
  return __assign.apply(this, arguments);
20561
20610
  };
20562
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
20563
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
20564
- to[j] = from[i];
20565
- return to;
20611
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
20612
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
20613
+ if (ar || !(i in from)) {
20614
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
20615
+ ar[i] = from[i];
20616
+ }
20617
+ }
20618
+ return to.concat(ar || Array.prototype.slice.call(from));
20566
20619
  };
20567
20620
  __webpack_require__(86);
20568
20621
  /*-
@@ -21160,7 +21213,7 @@ up.link = (function () {
21160
21213
  }
21161
21214
  // If user clicked on a child link of $link, or in an <input> within an [up-expand][up-href]
21162
21215
  // we want those other elements handle the click.
21163
- var betterTargetSelector = "a, [up-href], " + up.form.fieldSelector();
21216
+ var betterTargetSelector = "a, [up-href], ".concat(up.form.fieldSelector());
21164
21217
  var betterTarget = e.closest(event.target, betterTargetSelector);
21165
21218
  return !betterTarget || (betterTarget === link);
21166
21219
  }
@@ -21230,7 +21283,7 @@ up.link = (function () {
21230
21283
  return lastMousedownTarget && (lastMousedownTarget !== clickEvent.target);
21231
21284
  }
21232
21285
  function forkEventAsUpClick(originalEvent) {
21233
- var forwardedProps = __spreadArray(['clientX', 'clientY', 'button'], up.event.keyModifiers);
21286
+ var forwardedProps = __spreadArray(['clientX', 'clientY', 'button'], up.event.keyModifiers, true);
21234
21287
  var newEvent = up.event.fork(originalEvent, 'up:click', forwardedProps);
21235
21288
  up.emit(originalEvent.target, newEvent, { log: false });
21236
21289
  }
@@ -21260,10 +21313,13 @@ up.link = (function () {
21260
21313
  })
21261
21314
  ```
21262
21315
 
21263
- ### Cancelation is forwarded
21316
+ ### Cancelation
21317
+
21318
+ You may cancel an `up:click` event using `event.preventDefault()`.
21319
+
21320
+ Canceling `up:click` on a hyperlink will prevent any Unpoly from [following](/a-up-follow) that link.
21264
21321
 
21265
- If the user cancels an `up:click` event using `event.preventDefault()`,
21266
- the underlying `click` or `mousedown` event will also be canceled.
21322
+ The underlying `click` or `mousedown` event will also be canceled.
21267
21323
 
21268
21324
  ### Accessibility
21269
21325
 
@@ -21282,6 +21338,8 @@ up.link = (function () {
21282
21338
  The clicked element.
21283
21339
  @param {Event} event.originalEvent
21284
21340
  The underlying `click` or `mousedown` event.
21341
+ @param event.preventDefault()
21342
+ Prevents this event and also the original `click` or `mousedown` event.
21285
21343
  @stable
21286
21344
  */
21287
21345
  /*-
@@ -21337,6 +21395,14 @@ up.link = (function () {
21337
21395
 
21338
21396
  See [Handling all links and forms](/handling-everything).
21339
21397
 
21398
+ ### Preventing Unpoly from following links
21399
+
21400
+ To prevent Unpoly from following an `a[up-follow]` link, use one of the following options:
21401
+
21402
+ - Prevent the `up:link:follow` event on the link element
21403
+ - Prevent the `up:click` event on the link element
21404
+ - Set an `[up-follow=false]` attribute on the link element
21405
+
21340
21406
  @selector a[up-follow]
21341
21407
 
21342
21408
  @param [up-navigate='true']
@@ -22280,7 +22346,7 @@ up.form = (function () {
22280
22346
  else if (e.matches(field, 'input[type=radio]')) {
22281
22347
  var form = getContainer(field);
22282
22348
  var groupName = field.getAttribute('name');
22283
- var checkedButton = form.querySelector("input[type=radio]" + e.attributeSelector('name', groupName) + ":checked");
22349
+ var checkedButton = form.querySelector("input[type=radio]".concat(e.attributeSelector('name', groupName), ":checked"));
22284
22350
  if (checkedButton) {
22285
22351
  meta = ':checked';
22286
22352
  value = checkedButton.value;
@@ -22704,6 +22770,9 @@ up.form = (function () {
22704
22770
  /*-
22705
22771
  Show or hide elements when a form field is set to a given value.
22706
22772
 
22773
+ When the controlling form field gets an `up-switch` attribute, and that form field is nested inside a `<form>`
22774
+ parent, the targets elements must also be inside that same `<form>` parent.
22775
+
22707
22776
  ### Example: Select options
22708
22777
 
22709
22778
  The controlling form field gets an `up-switch` attribute with a selector for the elements to show or hide:
@@ -22782,6 +22851,26 @@ up.form = (function () {
22782
22851
  </div>
22783
22852
  ```
22784
22853
 
22854
+ ### Example: Radio button
22855
+
22856
+ ```html
22857
+ <input type="radio" name="advancedness" value="basic" up-switch=".target">
22858
+ <input type="radio" name="advancedness" value="advanced" up-switch=".target">
22859
+ <input type="radio" name="advancedness" value="very-advanced" up-switch=".target">
22860
+
22861
+ <div class="target" up-show-for="basic">
22862
+ only shown for advancedness = basic
22863
+ </div>
22864
+
22865
+ <div class="target" up-hide-for="basic">
22866
+ hidden for advancedness = basic
22867
+ </div>
22868
+
22869
+ <div class="target" up-show-for="advanced very-advanced">
22870
+ shown for advancedness = advanced or very-advanced
22871
+ </div>
22872
+ ```
22873
+
22785
22874
  @selector input[up-switch]
22786
22875
  @param up-switch
22787
22876
  A CSS selector for elements whose visibility depends on this field's value.
@@ -23679,9 +23768,9 @@ up.rails = (function () {
23679
23768
  ((_a = window.jQuery) === null || _a === void 0 ? void 0 : _a.rails); // legacy rails/jquery-ujs gem
23680
23769
  }
23681
23770
  return u.each(['method', 'confirm'], function (feature) {
23682
- var dataAttribute = "data-" + feature;
23683
- var upAttribute = "up-" + feature;
23684
- up.macro("a[" + dataAttribute + "]", function (link) {
23771
+ var dataAttribute = "data-".concat(feature);
23772
+ var upAttribute = "up-".concat(feature);
23773
+ up.macro("a[".concat(dataAttribute, "]"), function (link) {
23685
23774
  if (isRails() && up.link.isFollowable(link)) {
23686
23775
  e.setMissingAttr(link, upAttribute, link.getAttribute(dataAttribute));
23687
23776
  // Remove the [data-...] attribute so links will not be