@optionfactory/ful 0.93.0 → 0.95.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.
package/dist/ful.iife.js CHANGED
@@ -1376,10 +1376,10 @@ var ful = (function (exports) {
1376
1376
  enumerable: true,
1377
1377
  configurable: true,
1378
1378
  get() {
1379
- return this.internals.states.has(`--${attr}`);
1379
+ return this.internals.states ? this.internals.states.has(`--${attr}`) : this.hasAttribute(attr);
1380
1380
  },
1381
1381
  set(value) {
1382
- this.internals.states[value ? 'add' : 'delete'](`--${attr}`);
1382
+ this.internals.states?.[value ? 'add' : 'delete'](`--${attr}`);
1383
1383
  this.reflect(() => Attributes.toggle(this, attr, value));
1384
1384
  }
1385
1385
  });
@@ -1472,15 +1472,23 @@ var ful = (function (exports) {
1472
1472
  await this.submitter?.(this.values, this);
1473
1473
  });
1474
1474
  });
1475
+ if(this.hasAttribute("clear-invalid-on-change")){
1476
+ this.addEventListener('change', evt => {
1477
+ const target = /** @type HTMLElement */ (evt.target);
1478
+ target?.querySelectorAll(`.${CSS.escape(Form.INVALID_CLASS)}`).forEach(el => {
1479
+ el.classList.remove(Form.INVALID_CLASS);
1480
+ });
1481
+ });
1482
+ }
1475
1483
  this.replaceChildren(form);
1476
1484
  }
1477
1485
  spinner(spin) {
1478
1486
  this.querySelectorAll('ful-spinner').forEach(el => {
1479
- const hel = /** @type HTMLElement} */ (el);
1487
+ const hel = /** @type HTMLElement */ (el);
1480
1488
  hel.hidden = !spin;
1481
1489
  });
1482
1490
  this.querySelectorAll('[type=submit],[type=reset]').forEach(el => {
1483
- const hel = /** @type HTMLButtonElement} */ (el);
1491
+ const hel = /** @type HTMLButtonElement */ (el);
1484
1492
  hel.disabled = spin;
1485
1493
  });
1486
1494
  }