@optionfactory/ful 5.0.1 → 5.0.3
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 +16 -13
- package/dist/ful.iife.js.map +1 -1
- package/dist/ful.iife.min.js +1 -1
- package/dist/ful.iife.min.js.map +1 -1
- package/dist/ful.min.mjs +1 -1
- package/dist/ful.min.mjs.map +1 -1
- package/dist/ful.mjs +16 -13
- package/dist/ful.mjs.map +1 -1
- package/package.json +2 -2
package/dist/ful.mjs
CHANGED
|
@@ -1983,16 +1983,16 @@ class PartialRemoteLoader {
|
|
|
1983
1983
|
this.#responseMapper = responseMapper;
|
|
1984
1984
|
}
|
|
1985
1985
|
async exact(...keys) {
|
|
1986
|
-
const
|
|
1986
|
+
const response = await this.#http.request(this.#method, this.#url)
|
|
1987
1987
|
.param("k", ...keys)
|
|
1988
1988
|
.fetchJson();
|
|
1989
|
-
return this.#responseMapper(
|
|
1989
|
+
return this.#responseMapper(response);
|
|
1990
1990
|
}
|
|
1991
1991
|
async load(needle) {
|
|
1992
|
-
const
|
|
1992
|
+
const response = await this.#http.request(this.#method, this.#url)
|
|
1993
1993
|
.param("s", needle)
|
|
1994
1994
|
.fetchJson();
|
|
1995
|
-
return this.#responseMapper(
|
|
1995
|
+
return this.#responseMapper(response);
|
|
1996
1996
|
}
|
|
1997
1997
|
}
|
|
1998
1998
|
|
|
@@ -2044,19 +2044,22 @@ class SelectLoader {
|
|
|
2044
2044
|
}
|
|
2045
2045
|
static #responseMapperFrom(el) {
|
|
2046
2046
|
if (el.hasAttribute("k-expr") && el.hasAttribute("l-expr")) {
|
|
2047
|
-
return
|
|
2048
|
-
const
|
|
2049
|
-
return
|
|
2050
|
-
evaluator.
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2047
|
+
return response => {
|
|
2048
|
+
const rows = registry.evaluator().withOverlay(response).evaluateExpression(el.getAttribute("d-expr") ?? 'self');
|
|
2049
|
+
return rows.map(row => {
|
|
2050
|
+
const evaluator = registry.evaluator().withOverlay(row);
|
|
2051
|
+
return [
|
|
2052
|
+
evaluator.evaluateExpression(el.getAttribute("k-expr")),
|
|
2053
|
+
evaluator.evaluateExpression(el.getAttribute("l-expr")),
|
|
2054
|
+
evaluator.evaluateExpression(el.getAttribute("m-expr") ?? 'self'),
|
|
2055
|
+
];
|
|
2056
|
+
})
|
|
2054
2057
|
};
|
|
2055
2058
|
}
|
|
2056
2059
|
if (el.hasAttribute("response-mapper")) {
|
|
2057
2060
|
return registry.component(el.getAttribute("response-mapper"));
|
|
2058
2061
|
}
|
|
2059
|
-
return
|
|
2062
|
+
return response => response;
|
|
2060
2063
|
}
|
|
2061
2064
|
}
|
|
2062
2065
|
|
|
@@ -2200,7 +2203,7 @@ class Select extends ParsedElement {
|
|
|
2200
2203
|
}
|
|
2201
2204
|
async render({ slots, observed, disabled }) {
|
|
2202
2205
|
const name = this.getAttribute("name");
|
|
2203
|
-
this.#loader = registry.component(this.getAttribute("loader") ?? 'loaders:select').create(this, {options: slots.options});
|
|
2206
|
+
this.#loader = registry.component(this.getAttribute("loader") ?? 'loaders:select').create(this, { options: slots.options });
|
|
2204
2207
|
|
|
2205
2208
|
this.#multiple = this.hasAttribute("multiple");
|
|
2206
2209
|
await this.#loader.prefetch?.();
|