@optionfactory/ful 1.1.4 → 3.0.2

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
@@ -1437,24 +1437,29 @@ var ful = (function (exports, ftl) {
1437
1437
  <ful-field-error></ful-field-error>
1438
1438
  `;
1439
1439
  static formAssociated = true;
1440
- #input;
1441
- #fieldError;
1440
+ _input;
1441
+ _fieldError;
1442
1442
  constructor() {
1443
1443
  super();
1444
1444
  this.internals = this.attachInternals();
1445
1445
  this.internals.role = 'presentation';
1446
1446
  }
1447
+ _type(){
1448
+ return this.getAttribute("type") ?? 'text'; }
1449
+ _fragment(type, slots){
1450
+ return this.template().withOverlay({ type, slots }).render();
1451
+ }
1447
1452
  render({ slots, observed, disabled }) {
1448
- const type = this.getAttribute("type") ?? 'text';
1449
- const fragment = this.template().withOverlay({ type, slots }).render();
1450
- this.#input = fragment.querySelector("input,textarea");
1453
+ const type = this._type();
1454
+ const fragment = this._fragment(type, slots );
1455
+ this._input = fragment.querySelector("input,textarea");
1451
1456
 
1452
- ftl.Attributes.forward('input-', this, this.#input);
1457
+ ftl.Attributes.forward('input-', this, this._input);
1453
1458
  this.disabled = disabled;
1454
1459
  this.readonly = observed.readonly;
1455
1460
  this.value = observed.value;
1456
1461
 
1457
- this.#input.addEventListener('change', (evt) => {
1462
+ this._input.addEventListener('change', (evt) => {
1458
1463
  evt.stopPropagation();
1459
1464
  this.dispatchEvent(new CustomEvent('change', {
1460
1465
  bubbles: true,
@@ -1466,40 +1471,40 @@ var ful = (function (exports, ftl) {
1466
1471
  });
1467
1472
  const label = fragment.querySelector('label');
1468
1473
  label.addEventListener('click', () => this.focus());
1469
- this.#fieldError = fragment.querySelector('ful-field-error');
1470
- this.#input.ariaDescribedByElements = [this.#fieldError];
1471
- this.#input.ariaLabelledByElements = [label];
1474
+ this._fieldError = fragment.querySelector('ful-field-error');
1475
+ this._input.ariaDescribedByElements = [this._fieldError];
1476
+ this._input.ariaLabelledByElements = [label];
1472
1477
  this.replaceChildren(fragment);
1473
1478
  }
1474
1479
  get value() {
1475
- return this.#input.value === '' ? null : this.#input.value;
1480
+ return this._input.value === '' ? null : this._input.value;
1476
1481
  }
1477
1482
  set value(value) {
1478
- this.#input.value = value === '' ? null : value;
1483
+ this._input.value = value === '' ? null : value;
1479
1484
  }
1480
1485
  get readonly(){
1481
- return this.#input.readOnly;
1486
+ return this._input.readOnly;
1482
1487
  }
1483
1488
  set readonly(v) {
1484
- this.#input.readOnly = v;
1489
+ this._input.readOnly = v;
1485
1490
  }
1486
1491
  get disabled(){
1487
- return this.#input.hasAttribute('disabled');
1492
+ return this._input.hasAttribute('disabled');
1488
1493
  }
1489
1494
  set disabled(d){
1490
- ftl.Attributes.toggle(this.#input, 'disabled', d);
1495
+ ftl.Attributes.toggle(this._input, 'disabled', d);
1491
1496
  }
1492
1497
  focus(options) {
1493
- this.#input.focus(options);
1498
+ this._input.focus(options);
1494
1499
  }
1495
1500
  setCustomValidity(error) {
1496
1501
  if (!error) {
1497
1502
  this.internals.setValidity({});
1498
- this.#fieldError.innerText = "";
1503
+ this._fieldError.innerText = "";
1499
1504
  return;
1500
1505
  }
1501
1506
  this.internals.setValidity({ customError: true }, " ");
1502
- this.#fieldError.innerText = error;
1507
+ this._fieldError.innerText = error;
1503
1508
  }
1504
1509
  formResetCallback(){
1505
1510
  this.value = this.getAttribute("value");
@@ -2385,7 +2390,7 @@ var ful = (function (exports, ftl) {
2385
2390
  this.#paginator = ftl.Nodes.queryChildren(fragment, 'ful-pagination');
2386
2391
  this.#sorters = table.querySelectorAll(':scope > thead ful-sorter') ?? [];
2387
2392
  this.replaceChildren(fragment);
2388
- await ftl.registry.waitForChildrenRendered(this);
2393
+ await ftl.Rendering.waitForChildren(this);
2389
2394
  const orderFromSchema = schema.find(v => v.order);
2390
2395
 
2391
2396
  const maybeForm = /** @type any */(ftl.Nodes.queryChildren(this, 'ful-form'));