@intechstudio/grid-uikit 1.20241126.1622 → 1.20241203.904

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.
@@ -24,23 +24,31 @@ function handleValueChange(value) {
24
24
  $: {
25
25
  handleValueChange(inputValue);
26
26
  }
27
+ $:
28
+ displayText, suggestions, filterSuggestions();
29
+ function filterSuggestions() {
30
+ let searchTerm = displayText.toLowerCase();
31
+ let filteredSuggestions = suggestions.filter((e) => e.info.toLowerCase().includes(searchTerm) || e.value.toLowerCase().includes(searchTerm));
32
+ updateSuggestions(filteredSuggestions);
33
+ }
27
34
  function handleBlur(e) {
28
35
  if (inputValue !== displayText) {
29
36
  sendData(displayText);
30
37
  }
38
+ updateSuggestions([]);
31
39
  }
32
40
  function sendData(value) {
33
41
  dispatch("change", value);
34
42
  }
35
43
  function handleFocus(e) {
36
44
  dispatch("focus");
37
- updateSuggestions();
45
+ updateSuggestions(suggestions);
38
46
  }
39
- function updateSuggestions() {
47
+ function updateSuggestions(suggestions2) {
40
48
  if (typeof suggestionTarget !== "undefined") {
41
49
  const event = new CustomEvent("display", {
42
50
  detail: {
43
- data: suggestions,
51
+ data: suggestions2,
44
52
  sender: inputComponent
45
53
  }
46
54
  });
@@ -7,9 +7,6 @@ function handleDisplay(e) {
7
7
  target = sender;
8
8
  suggestions = data;
9
9
  }
10
- function handleClickOutside(e) {
11
- suggestions = [];
12
- }
13
10
  function handleSuggestionSelected(value) {
14
11
  const event = new CustomEvent("suggestion-select", {
15
12
  detail: {
@@ -26,8 +23,6 @@ function handleSuggestionSelected(value) {
26
23
  class:hidden={suggestions.length === 0}
27
24
  bind:this={component}
28
25
  on:display={handleDisplay}
29
- use:clickOutside={{ useCapture: false }}
30
- on:click-outside={handleClickOutside}
31
26
  >
32
27
  <div class="w-full p-1 neumorph rounded-lg border border-select bg-secondary">
33
28
  <ul
@@ -37,7 +32,7 @@ function handleSuggestionSelected(value) {
37
32
  <!-- svelte-ignore a11y-click-events-have-key-events -->
38
33
  <!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
39
34
  <li
40
- on:click={() => handleSuggestionSelected(suggestion.value)}
35
+ on:mousedown={() => handleSuggestionSelected(suggestion.value)}
41
36
  class="hover:bg-black p-1 pl-2"
42
37
  >
43
38
  {suggestion.info}
@@ -37,7 +37,7 @@ $: {
37
37
  <div
38
38
  {...$root}
39
39
  use:root
40
- class="text-white overflow-auto
40
+ class="text-white overflow-visible
41
41
  {size == 'full' && orientation == 'horizontal' ? 'w-full' : ''}
42
42
  {orientation === 'vertical'
43
43
  ? 'grid grid-flow-row my-2 gap-4'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intechstudio/grid-uikit",
3
- "version": "1.20241126.1622",
3
+ "version": "1.20241203.904",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "vite build",