@kws3/ui 4.1.1 → 4.1.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/CHANGELOG.mdx CHANGED
@@ -1,3 +1,13 @@
1
+ # 4.1.3
2
+ - Ensure transitions are global for `Modal`, `CardModal` and `ActionSheet` components
3
+ - `InfiniteList` - do not fake a scroll event on a resize event, fixes loading bugs
4
+
5
+ # 4.1.2
6
+ - `MultiSelect` - fixed issue where raw object were initially outputted (if provided)
7
+ - `SearchableSelect and `MultiSelect` (Async): resolved issue with the 'active' class not attaching to the most matched item in dropdown options
8
+ - `SearchableSelect` - improved behavior, ensuring the `tab` key correctly loses focus
9
+ - `AutoComplete` - dropdown now closes on loss of focus triggered by the `tab` key
10
+
1
11
  # 4.1.1
2
12
  - `DatePicker` - add support for configurable border radius
3
13
  - `DatePicker` - add support for configurable box shadow
@@ -19,6 +29,16 @@
19
29
  - add svelte 4 compatibility
20
30
 
21
31
  --------------
32
+ # 2.3.3
33
+ - `InfiniteList` - do not fake a scroll event on a resize event, fixes loading bugs
34
+
35
+ # 2.3.2
36
+ - `MultiSelect` - fixed issue where raw object were initially outputted (if provided)
37
+ - `SearchableSelect and `MultiSelect` (Async): resolved issue with the 'active' class not attaching to the most matched item in dropdown options
38
+ - `SearchableSelect` - improved behavior, ensuring the `tab` key correctly loses focus
39
+ - `AutoComplete` - dropdown now closes on loss of focus triggered by the `tab` key
40
+
41
+
22
42
  # 2.3.1
23
43
  - `DatePicker` - add support for configurable border radius
24
44
  - `DatePicker` - add support for configurable box shadow
@@ -421,7 +421,12 @@ Default value: `<span>{option.label}</span>`
421
421
  });
422
422
  } else {
423
423
  active_option = "";
424
- searching = true;
424
+
425
+ if (event.key === `Tab`) {
426
+ searching = false;
427
+ } else {
428
+ searching = true;
429
+ }
425
430
  }
426
431
  }
427
432
 
@@ -470,7 +470,7 @@ Default value: `<span>{option[search_key] || option}</span>`
470
470
  ) {
471
471
  activeOption = filteredOptions[0];
472
472
  } else {
473
- if (allow_fuzzy_match) {
473
+ if (asyncMode || allow_fuzzy_match) {
474
474
  activeOption = filteredOptions.find((opts) =>
475
475
  matchesValue(activeOption, opts)
476
476
  );
@@ -557,22 +557,28 @@ Default value: `<span>{option[search_key] || option}</span>`
557
557
  //normalize value for single versus multiselect
558
558
  if (value === null || typeof value == "undefined") {
559
559
  value = single ? null : [];
560
- }
561
-
562
- if (asyncMode) {
563
- // initally on async mode options are empty
564
- // so we need to fill selectedOptions with value if value is avaliable
565
- options = value ? [...(single ? [value] : [...value])] : [];
566
- searching = false;
567
- tick().then(() => {
568
- normaliseOptions();
569
- value = normaliseArraysToObjects(options).map((v) => v[used_value_key]);
570
- if (single && Array.isArray(value)) {
571
- value = value[0];
572
- }
573
- fillSelectedOptions();
574
- clearDropDownResults();
575
- });
560
+ } else {
561
+ if (asyncMode) {
562
+ // initally on async mode options are empty
563
+ // so we need to fill selectedOptions with value if value is avaliable
564
+ options = value ? [...(single ? [value] : [...value])] : [];
565
+ searching = false;
566
+ tick().then(() => {
567
+ normaliseOptions();
568
+ value = normaliseArraysToObjects(options).map(
569
+ (v) => v[used_value_key]
570
+ );
571
+ if (single && Array.isArray(value)) {
572
+ value = value[0];
573
+ }
574
+ fillSelectedOptions();
575
+ clearDropDownResults();
576
+ });
577
+ } else {
578
+ value = single
579
+ ? value
580
+ : normaliseArraysToObjects(value).map((v) => v[used_value_key]);
581
+ }
576
582
  }
577
583
 
578
584
  return () => {
@@ -729,6 +735,10 @@ Default value: `<span>{option[search_key] || option}</span>`
729
735
  searching = true;
730
736
  }
731
737
  } else {
738
+ if (event.key === `Tab`) {
739
+ searching = false;
740
+ return;
741
+ }
732
742
  //for a single select
733
743
  //if a value is already selected,
734
744
  //ignore keys other than navigation, enter and backspace
@@ -23,11 +23,11 @@ If `false` , the component won't have a close button, and will not close on clic
23
23
  class="modal kws-action-sheet-outer {klass} {is_active ? 'is-active' : ''}"
24
24
  {style}>
25
25
  {#if is_active}<div
26
- transition:fade={{ duration: transitionDuration }}
26
+ transition:fade|global={{ duration: transitionDuration }}
27
27
  class="modal-background"
28
28
  on:click={clickOutside} />
29
29
  <div
30
- transition:fly={{
30
+ transition:fly|global={{
31
31
  duration: transitionDuration,
32
32
  y: 300,
33
33
  delay: transitionDelay,
@@ -31,11 +31,11 @@ Only visible when the
31
31
  -->
32
32
  <div class="modal {klass} {is_active ? 'is-active' : ''}" {style} data-cy={cy}>
33
33
  {#if is_active}<div
34
- transition:fade={{ duration: transitionDuration }}
34
+ transition:fade|global={{ duration: transitionDuration }}
35
35
  class="modal-background"
36
36
  on:click={clickOutside} />
37
37
  <div
38
- transition:scale={{
38
+ transition:scale|global={{
39
39
  duration: transitionDuration,
40
40
  // @ts-ignore
41
41
  from: 0.8,
@@ -131,6 +131,5 @@ while more items are loading
131
131
 
132
132
  const resize = () => {
133
133
  viewport_height = viewport.offsetHeight;
134
- handle_scroll();
135
134
  };
136
135
  </script>
@@ -23,11 +23,11 @@ Only programmatic closing is possible, Default: `true`
23
23
 
24
24
  <div class="modal {klass} {is_active ? 'is-active' : ''}" {style} data-cy={cy}>
25
25
  {#if is_active}<div
26
- transition:fade={{ duration: transitionDuration }}
26
+ transition:fade|global={{ duration: transitionDuration }}
27
27
  class="modal-background"
28
28
  on:click={clickOutside} />
29
29
  <div
30
- transition:scale={{
30
+ transition:scale|global={{
31
31
  duration: transitionDuration,
32
32
  // @ts-ignore
33
33
  from: 0.8,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kws3/ui",
3
- "version": "4.1.1",
3
+ "version": "4.1.3",
4
4
  "description": "UI components for use with Svelte v3 applications.",
5
5
  "main": "index.js",
6
6
  "svelte": "index.js",
@@ -35,5 +35,5 @@
35
35
  "devDependencies": {
36
36
  "typescript": "^5.0.4"
37
37
  },
38
- "gitHead": "454b927449e2b576dfe0335c72834f126204971f"
38
+ "gitHead": "4fd2b4a801628800fc5498495277ad45b40a01c6"
39
39
  }