@optionfactory/ful 0.91.0 → 0.92.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
@@ -468,6 +468,7 @@ var ful = (function (exports) {
468
468
  const builder = new HttpMultipartRequestCustomizer(formData);
469
469
  callback(builder);
470
470
  this.#body = formData;
471
+ return this;
471
472
  }
472
473
  /**
473
474
  * Sets a fetch options for the request.
@@ -617,7 +618,21 @@ var ful = (function (exports) {
617
618
  blob(name, value, filename){
618
619
  this.#formData.append(name, value, filename);
619
620
  return this;
620
- }
621
+ }
622
+ /**
623
+ * Appends multiple Blobs to the FormData with the same name.
624
+ * The default filename for Blob objects is "blob";
625
+ * The default filename for File objects is the file's filename.
626
+ * @param {string} name
627
+ * @param {Blob[]} values
628
+ * @returns this builder
629
+ */
630
+ blobs(name, values){
631
+ for(let v of values){
632
+ this.#formData.append(name, v);
633
+ }
634
+ return this;
635
+ }
621
636
  /**
622
637
  * Appends a JSON serialized blob to the FormData.
623
638
  * @param {string} name
@@ -1401,6 +1416,7 @@ var ful = (function (exports) {
1401
1416
  static IGNORED_CHILDREN_SELECTOR = '.d-none, [hidden]';
1402
1417
  static SCROLL_OFFSET = 50;
1403
1418
  static INVALID_CLASS = 'is-invalid';
1419
+ submitter;
1404
1420
  render() {
1405
1421
  const form = document.createElement('form');
1406
1422
  form.replaceChildren(...this.childNodes);
@@ -1413,8 +1429,14 @@ var ful = (function (exports) {
1413
1429
  this.replaceChildren(form);
1414
1430
  }
1415
1431
  spinner(spin) {
1416
- this.querySelectorAll('ful-spinner').forEach(el => el.hidden = !spin);
1417
- this.querySelectorAll('[type=submit],[type=reset]').forEach(el => el.disabled = spin);
1432
+ this.querySelectorAll('ful-spinner').forEach(el => {
1433
+ const hel = /** @type HTMLElement} */ (el);
1434
+ hel.hidden = !spin;
1435
+ });
1436
+ this.querySelectorAll('[type=submit],[type=reset]').forEach(el => {
1437
+ const hel = /** @type HTMLButtonElement} */ (el);
1438
+ hel.disabled = spin;
1439
+ });
1418
1440
  }
1419
1441
  async remoting(fn) {
1420
1442
  try {
@@ -1449,7 +1471,7 @@ var ful = (function (exports) {
1449
1471
  }
1450
1472
  }
1451
1473
  get values() {
1452
- return Array.from(this.querySelectorAll('[name]'))
1474
+ return Array.from(/** @type {NodeListOf<HTMLElement>} */ (this.querySelectorAll('[name]')))
1453
1475
  .filter(el => {
1454
1476
  if (el.dataset['fulBindInclude'] === 'never') {
1455
1477
  return false;
@@ -1473,10 +1495,14 @@ var ful = (function (exports) {
1473
1495
  const validationTargetsSelector = `[name='${CSS.escape(name)}'] [ful-validation-target],[name='${CSS.escape(name)}']:not(:has([ful-validation-target]))`;
1474
1496
  this.querySelectorAll(validationTargetsSelector).forEach(input => input.classList.add(Form.INVALID_CLASS));
1475
1497
  const fieldErrorsSelector = `ful-field-error[field='${CSS.escape(name)}']`;
1476
- this.querySelectorAll(fieldErrorsSelector).forEach(el => el.innerText = e.reason);
1498
+ this.querySelectorAll(fieldErrorsSelector).forEach(el => {
1499
+ const hel = /** @type HTMLElement} */ (el);
1500
+ hel.innerText = e.reason;
1501
+ });
1477
1502
  });
1478
1503
  this.querySelectorAll("ful-errors").forEach(el => {
1479
- el.innerText = globalErrors.map(e => e.reason).join("\n");
1504
+ const hel = /** @type HTMLElement} */ (el);
1505
+ hel.innerText = globalErrors.map(e => e.reason).join("\n");
1480
1506
  if (globalErrors.length !== 0) {
1481
1507
  el.removeAttribute('hidden');
1482
1508
  }
@@ -1575,6 +1601,8 @@ var ful = (function (exports) {
1575
1601
  </div>
1576
1602
  `
1577
1603
  }) {
1604
+ shouldLoad;
1605
+ _unwrappedRemoteLoad;
1578
1606
  constructor(tsConfig) {
1579
1607
  super();
1580
1608
  this.tsConfig = tsConfig;
@@ -1626,6 +1654,7 @@ var ful = (function (exports) {
1626
1654
  }
1627
1655
  callback(data);
1628
1656
  };
1657
+ // @ts-ignore
1629
1658
  this.ts = new TomSelect(input, Object.assign(remote ? {
1630
1659
  preload: 'focus',
1631
1660
  load: this._unwrappedRemoteLoad,