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