@optionfactory/ful 4.0.2 → 4.0.4

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.mjs CHANGED
@@ -1498,6 +1498,9 @@ class Input extends ParsedElement {
1498
1498
  }
1499
1499
  set readonly(v) {
1500
1500
  this._input.readOnly = v;
1501
+ this.reflect(() => {
1502
+ Attributes.toggle(this, 'readonly', v);
1503
+ });
1501
1504
  }
1502
1505
  //@ts-ignore
1503
1506
  get disabled() {
@@ -1718,7 +1721,7 @@ class RemoteLoader {
1718
1721
  }
1719
1722
  async load(needle) {
1720
1723
  await this.#ensureFetched();
1721
- return this.#data.filter(([k, v]) => (v ?? '').includes(needle?.toLowerCase()));
1724
+ return this.#data.filter(([k, v]) => (v ?? '').toLowerCase().includes(needle?.toLowerCase()));
1722
1725
  }
1723
1726
  async #ensureFetched() {
1724
1727
  if (this.#data !== null) {
@@ -1786,7 +1789,7 @@ class InMemoryLoader {
1786
1789
  return this.#data.filter(([k, v]) => keys.some(r => r == k));
1787
1790
  }
1788
1791
  load(needle) {
1789
- return this.#data.filter(([k, v]) => (v ?? '').includes(needle?.toLowerCase()));
1792
+ return this.#data.filter(([k, v]) => (v ?? '').toLowerCase().includes(needle?.toLowerCase()));
1790
1793
  }
1791
1794
  }
1792
1795
 
@@ -2076,7 +2079,7 @@ class Select extends ParsedElement {
2076
2079
  const b = document.createElement('badge');
2077
2080
  b.setAttribute("role", "button");
2078
2081
  b.setAttribute("value", k);
2079
- b.innerText = v;
2082
+ b.innerText = v[0];
2080
2083
  return b;
2081
2084
  });
2082
2085
  this.#badges.innerHTML = '';
@@ -2114,10 +2117,13 @@ class Select extends ParsedElement {
2114
2117
  Attributes.toggle(this.#input, 'disabled', d);
2115
2118
  }
2116
2119
  get readonly(){
2117
- return this.#input.readOnly;
2120
+ return this.#input.readOnly;
2118
2121
  }
2119
2122
  set readonly(v) {
2120
2123
  this.#input.readOnly = v;
2124
+ this.reflect(() => {
2125
+ Attributes.toggle(this, 'readonly', v);
2126
+ });
2121
2127
  }
2122
2128
  focus(options) {
2123
2129
  this.#input.focus(options);
@@ -2227,6 +2233,9 @@ class RadioGroup extends ParsedElement {
2227
2233
  }
2228
2234
  set readonly(v) {
2229
2235
  this.#fieldset.inert = v;
2236
+ this.reflect(() => {
2237
+ Attributes.toggle(this, 'readonly', v);
2238
+ });
2230
2239
  }
2231
2240
  //@ts-ignore
2232
2241
  get disabled(){
@@ -2316,6 +2325,9 @@ class Checkbox extends ParsedElement {
2316
2325
  }
2317
2326
  set readonly(v) {
2318
2327
  this.#container.inert = v;
2328
+ this.reflect(() => {
2329
+ Attributes.toggle(this, 'readonly', v);
2330
+ });
2319
2331
  }
2320
2332
  //@ts-ignore
2321
2333
  get disabled() {