@optionfactory/ful 6.0.6 → 6.0.7

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
@@ -1774,7 +1774,7 @@ var ful = (function (exports, ftl) {
1774
1774
  <ful-item data-tpl-each="files" data-tpl-var="file" data-tpl-data-name="file.name">
1775
1775
  <div>{{ file.name }}</div>
1776
1776
  <div>{{ #bytes:format(file.size) }}</div>
1777
- <button type="button" class="btn btn-sm btn-outline-danger bi bi-x-lg"></button>
1777
+ <button type="button" class="btn btn-sm btn-outline-danger bi bi-x-lg" alt="Rimuovi"></button>
1778
1778
  </ful-item>
1779
1779
  `,
1780
1780
  warning: `<ful-field-warning>{{ #l10n:t(key, args) }}</ful-field-warning>`
@@ -2023,20 +2023,22 @@ var ful = (function (exports, ftl) {
2023
2023
  if (this.#data !== null) {
2024
2024
  return
2025
2025
  }
2026
- const storageKey = `${this.#method}@${this.#url}`;
2027
- if (this.#revision !== null) {
2028
- const data = VersionedLocalStorage.load(storageKey, this.#revision);
2026
+ const raw = RemoteLoader.#revisionedData(this.#http, this.#method, this.#url, this.#revision);
2027
+ this.#data = this.#responseMapper(raw);
2028
+ }
2029
+ static async #revisionedData(http, method, url, revision){
2030
+ const storageKey = `${method}@${url}`;
2031
+ if (revision !== null) {
2032
+ const data = VersionedLocalStorage.load(storageKey, revision);
2029
2033
  if (data !== undefined) {
2030
- this.#data = data;
2031
- return;
2034
+ return data;
2032
2035
  }
2033
2036
  }
2034
- const data = await this.#http.request(this.#method, this.#url)
2035
- .fetchJson();
2036
- this.#data = this.#responseMapper(data);
2037
- if (this.#revision !== null) {
2038
- VersionedLocalStorage.save(storageKey, this.#revision, this.#data);
2037
+ const data = await http.request(method, url).fetchJson();
2038
+ if (revision !== null) {
2039
+ VersionedLocalStorage.save(storageKey, revision, data);
2039
2040
  }
2041
+ return data;
2040
2042
  }
2041
2043
  }
2042
2044
 
@@ -2689,6 +2691,13 @@ var ful = (function (exports, ftl) {
2689
2691
  return;
2690
2692
  }
2691
2693
  this.value = !this.value;
2694
+ this.dispatchEvent(new CustomEvent('change', {
2695
+ bubbles: true,
2696
+ cancelable: false,
2697
+ detail: {
2698
+ value: this.value
2699
+ }
2700
+ }));
2692
2701
  });
2693
2702
  this.#fieldError = fragment.querySelector('ful-field-error');
2694
2703
  this.#input.ariaDescribedByElements = [this.#fieldError];