powerpagestoolkit 2.1.2 → 2.3.0

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.
Files changed (2) hide show
  1. package/dist/bundle.js +10 -3
  2. package/package.json +1 -1
package/dist/bundle.js CHANGED
@@ -205,7 +205,7 @@ var ConditionalRenderingError = class extends Error {
205
205
 
206
206
  // src/DOMNodeReference.ts
207
207
  var _init = Symbol("_init");
208
- var DOMNodeReference = class {
208
+ var DOMNodeReference = class _DOMNodeReference {
209
209
  // properties initialized in the constructor
210
210
  target;
211
211
  isLoaded;
@@ -257,10 +257,14 @@ var DOMNodeReference = class {
257
257
  } else {
258
258
  this.element.addEventListener("input", this.updateValue.bind(this));
259
259
  }
260
+ this._observeValueChanges();
260
261
  }
261
262
  updateValue() {
262
263
  switch (this.element.type) {
263
264
  case "checkbox":
265
+ this.value = +this.element.checked;
266
+ this.checked = this.element.checked;
267
+ break;
264
268
  case "radio":
265
269
  this.value = this.element.checked;
266
270
  this.checked = this.element.checked;
@@ -270,6 +274,8 @@ var DOMNodeReference = class {
270
274
  this.element.selectedOptions
271
275
  ).map((option) => option.value);
272
276
  break;
277
+ case "select-one":
278
+ this.value = this.element.value;
273
279
  case "number":
274
280
  this.value = this.element.value !== "" ? Number(this.element.value) : null;
275
281
  break;
@@ -277,11 +283,12 @@ var DOMNodeReference = class {
277
283
  this.value = this.element.value;
278
284
  break;
279
285
  }
280
- if (this.element.classList.contains("boolean-radio")) {
286
+ if (this.yesRadio instanceof _DOMNodeReference) {
281
287
  this.yesRadio.updateValue();
282
288
  this.noRadio.updateValue();
289
+ this.checked = this.yesRadio.checked;
290
+ this.value = +this.yesRadio.checked;
283
291
  }
284
- this._observeValueChanges();
285
292
  }
286
293
  // Add a method to observe value changes using MutationObserver
287
294
  _observeValueChanges() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powerpagestoolkit",
3
- "version": "2.1.002",
3
+ "version": "2.3.0",
4
4
  "description": "Reference, manipulate, and engage with Power Pages sites through the nodes in the DOM; use a variety of custom methods that allow customizing your power pages site quicker and easier. ",
5
5
  "main": "./dist/bundle.js",
6
6
  "types": "./dist/index.d.ts",