powerpagestoolkit 2.3.0 → 2.3.201

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.
@@ -40,7 +40,6 @@ export declare const _init: unique symbol;
40
40
  [_init](): Promise<void>;
41
41
  private _initValueSync;
42
42
  updateValue(): void;
43
- private _observeValueChanges;
44
43
  private _attachVisibilityController;
45
44
  private _attachRadioButtons;
46
45
  /**
@@ -182,11 +181,11 @@ export declare const _init: unique symbol;
182
181
  /**
183
182
  * Sets the required level for the field by adding or removing the "required-field" class on the label.
184
183
  *
185
- * @param {boolean} isRequired - Determines whether the field should be marked as required.
184
+ * @param {Function | boolean} isRequired - Determines whether the field should be marked as required.
186
185
  * If true, the "required-field" class is added to the label; if false, it is removed.
187
186
  * @returns - Instance of this
188
187
  */
189
- setRequiredLevel(isRequired: Function | boolean): DOMNodeReference;
188
+ setRequiredLevel(isRequired: (() => boolean) | boolean): DOMNodeReference;
190
189
  /**
191
190
  * Executes a callback function once the element is fully loaded.
192
191
  * If the element is already loaded, the callback is called immediately.
package/dist/bundle.js CHANGED
@@ -257,7 +257,6 @@ var DOMNodeReference = class _DOMNodeReference {
257
257
  } else {
258
258
  this.element.addEventListener("input", this.updateValue.bind(this));
259
259
  }
260
- this._observeValueChanges();
261
260
  }
262
261
  updateValue() {
263
262
  switch (this.element.type) {
@@ -276,6 +275,7 @@ var DOMNodeReference = class _DOMNodeReference {
276
275
  break;
277
276
  case "select-one":
278
277
  this.value = this.element.value;
278
+ break;
279
279
  case "number":
280
280
  this.value = this.element.value !== "" ? Number(this.element.value) : null;
281
281
  break;
@@ -290,16 +290,6 @@ var DOMNodeReference = class _DOMNodeReference {
290
290
  this.value = +this.yesRadio.checked;
291
291
  }
292
292
  }
293
- // Add a method to observe value changes using MutationObserver
294
- _observeValueChanges() {
295
- const observer = new MutationObserver(() => {
296
- this.updateValue();
297
- });
298
- observer.observe(this.element, {
299
- attributes: true,
300
- attributeFilter: ["value"]
301
- });
302
- }
303
293
  _attachVisibilityController() {
304
294
  this.visibilityController = this.element;
305
295
  if (this.element.tagName === "TABLE") {
@@ -614,7 +604,7 @@ var DOMNodeReference = class _DOMNodeReference {
614
604
  /**
615
605
  * Sets the required level for the field by adding or removing the "required-field" class on the label.
616
606
  *
617
- * @param {boolean} isRequired - Determines whether the field should be marked as required.
607
+ * @param {Function | boolean} isRequired - Determines whether the field should be marked as required.
618
608
  * If true, the "required-field" class is added to the label; if false, it is removed.
619
609
  * @returns - Instance of this
620
610
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powerpagestoolkit",
3
- "version": "2.3.0",
3
+ "version": "2.3.201",
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",