y200subcontrols 0.0.391 → 0.0.392

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.
@@ -16,10 +16,10 @@ function filterElements() {
16
16
  elementsFilterd = elements;
17
17
  return;
18
18
  }
19
- searchQuery = searchQuery.toLowerCase();
19
+ const _searchQuery = searchQuery.toLowerCase();
20
20
  let _elements = [];
21
21
  for (const element of elements) {
22
- if (element.content.toLowerCase().includes(searchQuery)) {
22
+ if (element.content.toLowerCase().includes(_searchQuery)) {
23
23
  _elements.push(element);
24
24
  }
25
25
  }
@@ -7,6 +7,7 @@ export let busy = false;
7
7
  export let dialogSize = "md";
8
8
  export let showCloseButton = true;
9
9
  let dialog;
10
+ let isClickInside = false;
10
11
  export function openDialog() {
11
12
  setTimeout(() => {
12
13
  dialog.classList.add("scale-0");
@@ -26,9 +27,19 @@ function fireCancelDialog() {
26
27
  }
27
28
  function dialogClicked(event) {
28
29
  if (event.target === dialog) {
30
+ if (isClickInside) {
31
+ isClickInside = false;
32
+ return;
33
+ }
29
34
  fireCancelDialog();
30
35
  }
31
36
  }
37
+ function handleMouseDown(event) {
38
+ isClickInside = true;
39
+ }
40
+ function handeMouseUp(event) {
41
+ isClickInside = false;
42
+ }
32
43
  </script>
33
44
 
34
45
  <!-- svelte-ignore a11y-click-events-have-key-events -->
@@ -79,9 +90,12 @@ function dialogClicked(event) {
79
90
  </button>
80
91
  </div>
81
92
  {/if}
82
- </div>
83
- <slot />
93
+ </div>
84
94
 
95
+ <!-- svelte-ignore a11y-no-static-element-interactions -->
96
+ <div on:mousedown={handleMouseDown} on:mouseup={handeMouseUp}>
97
+ <slot />
98
+ </div>
85
99
  <div slot="buttons" class="grid {allowSubmit ? 'grid-cols-2' : 'grid-cols-1'} gap-2 my-2">
86
100
  <slot name="buttons">
87
101
  {#if allowSubmit}
@@ -6,7 +6,7 @@ export let isLight = false;
6
6
  {#if !isLight}
7
7
  <span
8
8
  class="inline-block text-center
9
- {size === 'sm' ? 'text-sm rounded-3xl px-3 py-1.5' : ''}
9
+ {size === 'sm' ? 'text-sm rounded-3xl px-3 py-1' : ''}
10
10
  {size === 'md' ? 'text-base rounded-3xl px-4 py-2' : ''}
11
11
  {size === 'lg' ? 'text-lg rounded-3xl px-6 py-3' : ''}
12
12
  {theme === 'teal' ? 'bg-teal-500 text-teal-50' : ''}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "y200subcontrols",
3
- "version": "0.0.391",
3
+ "version": "0.0.392",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",