@creative-web-solution/front-library 7.1.53 → 7.1.54
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/CHANGELOG.md
CHANGED
|
@@ -8,12 +8,12 @@ export default abstract class AbstractAutocompleteAdapter<ItemDataType> {
|
|
|
8
8
|
query: string,
|
|
9
9
|
$input: HTMLElement,
|
|
10
10
|
): Record<string, any>;
|
|
11
|
-
|
|
11
|
+
markValue?(options: {
|
|
12
12
|
item: ItemDataType;
|
|
13
13
|
index: number;
|
|
14
14
|
query: string;
|
|
15
15
|
}): ItemDataType;
|
|
16
|
-
|
|
16
|
+
updateInputValueFromItem?(options: {
|
|
17
17
|
item: ItemDataType;
|
|
18
18
|
index: number;
|
|
19
19
|
query: string;
|
|
@@ -25,7 +25,6 @@ type AutocompleteOptions<ItemDataType> = {
|
|
|
25
25
|
results: ItemDataType[];
|
|
26
26
|
}) => void;
|
|
27
27
|
$searchField: HTMLInputElement;
|
|
28
|
-
shouldMarkValue?: boolean;
|
|
29
28
|
};
|
|
30
29
|
|
|
31
30
|
const PREVENT_DEFAULT_KEY_LIST = [
|
|
@@ -49,7 +48,6 @@ const DEFAULT_OPTIONS = {
|
|
|
49
48
|
layerPosition: "top",
|
|
50
49
|
$layerWrapper: document.body,
|
|
51
50
|
minChar: 3,
|
|
52
|
-
shouldMarkValue: false,
|
|
53
51
|
};
|
|
54
52
|
|
|
55
53
|
export default class Autocomplete<ItemDataType> {
|
|
@@ -222,13 +220,11 @@ export default class Autocomplete<ItemDataType> {
|
|
|
222
220
|
this.resetResults();
|
|
223
221
|
|
|
224
222
|
this.#currentResults = results.map((item, index) => {
|
|
225
|
-
const markedItem = this.#
|
|
226
|
-
? this.#adapter.markValue({
|
|
223
|
+
const markedItem = this.#adapter.markValue?.({
|
|
227
224
|
item,
|
|
228
225
|
index,
|
|
229
226
|
query: this.#currentQuery,
|
|
230
|
-
})
|
|
231
|
-
: item;
|
|
227
|
+
}) ?? item;
|
|
232
228
|
const $item = strToDOM(
|
|
233
229
|
this.#adapter.itemRender({
|
|
234
230
|
item: markedItem,
|
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@creative-web-solution/front-library",
|
|
3
3
|
"title": "Frontend library",
|
|
4
4
|
"description": "Frontend functions and modules",
|
|
5
|
-
"version": "7.1.
|
|
5
|
+
"version": "7.1.54",
|
|
6
6
|
"homepage": "https://github.com/creative-web-solution/front-library",
|
|
7
7
|
"author": "Creative Web Solution <contact@cws-studio.com> (https://www.cws-studio.com)",
|
|
8
8
|
"keywords": [],
|