@wcstack/router 4.23.0 → 4.24.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.
package/dist/index.d.ts CHANGED
@@ -769,6 +769,14 @@ declare class Link extends HTMLElement implements ILink {
769
769
  private _onClick?;
770
770
  constructor();
771
771
  get uuid(): string;
772
+ /**
773
+ * The destination, as a property: it writes the `to` attribute (`null` removes it, `undefined` puts back what
774
+ * the markup had). A binding that writes the property — `data-wcs="to: .href"` in place of `attr.to:` — left an
775
+ * own property on the element that nothing read: the `<a>` had no `href`, and nothing said so
776
+ * (docs/seam-apps.md, town-archive).
777
+ */
778
+ get to(): string;
779
+ set to(value: string | null | undefined);
772
780
  /**
773
781
  * 最寄りの Router を返す。
774
782
  *
package/dist/index.esm.js CHANGED
@@ -78,7 +78,7 @@ function setConfig(partialConfig) {
78
78
  }
79
79
 
80
80
  var name = "@wcstack/router";
81
- var version = "4.23.0";
81
+ var version = "4.24.1";
82
82
  var pkg = {
83
83
  name: name,
84
84
  version: version};
@@ -4155,6 +4155,18 @@ class Link extends HTMLElement {
4155
4155
  get uuid() {
4156
4156
  return this._uuid;
4157
4157
  }
4158
+ /**
4159
+ * The destination, as a property: it writes the `to` attribute (`null` removes it, `undefined` puts back what
4160
+ * the markup had). A binding that writes the property — `data-wcs="to: .href"` in place of `attr.to:` — left an
4161
+ * own property on the element that nothing read: the `<a>` had no `href`, and nothing said so
4162
+ * (docs/seam-apps.md, town-archive).
4163
+ */
4164
+ get to() {
4165
+ return this.getAttribute("to") ?? "";
4166
+ }
4167
+ set to(value) {
4168
+ reflectAttribute(this, "to", value);
4169
+ }
4158
4170
  /**
4159
4171
  * 最寄りの Router を返す。
4160
4172
  *
@@ -4275,6 +4287,13 @@ class Link extends HTMLElement {
4275
4287
  return null;
4276
4288
  }
4277
4289
  _connect() {
4290
+ // a `to` assigned before the element was defined (state loaded before the router) is an own property that
4291
+ // hides the accessor: take it in through the setter
4292
+ if (Object.prototype.hasOwnProperty.call(this, "to")) {
4293
+ const value = this.to;
4294
+ delete this.to;
4295
+ this.to = value;
4296
+ }
4278
4297
  if (!this._initialized) {
4279
4298
  this._initialize();
4280
4299
  }