@kws3/ui 2.3.0 → 2.3.2

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,15 @@
1
+ # 2.3.2
2
+ - `MultiSelect` - fixed issue where raw object were initially outputted (if provided)
3
+ - `SearchableSelect and `MultiSelect` (Async): resolved issue with the 'active' class not attaching to the most matched item in dropdown options
4
+ - `SearchableSelect` - improved behavior, ensuring the `tab` key correctly loses focus
5
+ - `AutoComplete` - dropdown now closes on loss of focus triggered by the `tab` key
6
+
7
+
8
+ # 2.3.1
9
+ - `DatePicker` - add support for configurable border radius
10
+ - `DatePicker` - add support for configurable box shadow
11
+ - `DatePicker` - bug fix on date range selection colors
12
+
1
13
  # 2.3.0
2
14
  - New component `InfiniteList` Added
3
15
 
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kws3/ui",
3
- "version": "2.3.0",
3
+ "version": "2.3.2",
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": "85d7e7534391508f6376907b57142d2eba457d7e"
38
+ "gitHead": "87ea45639e414b8f652e3a0457516ad1decb5f4f"
39
39
  }
@@ -1,6 +1,9 @@
1
1
  $kws-theme-colors: $colors !default;
2
2
  $kws-datepicker-background: $scheme-main-ter !default;
3
3
  $kws-datepicker-text: $text !default;
4
+ $kws-datepicker-shadow: 0 2px 5px rgba(0, 0, 0, 0.3),
5
+ 0 0 0 0.0625rem rgba(0, 0, 0, 0.1) !default;
6
+ $kws-datepicker-radius: 0px !default;
4
7
 
5
8
  .flatpickr-calendar {
6
9
  $inRangeBg: lighten($kws-datepicker-text, 55);
@@ -8,10 +11,21 @@ $kws-datepicker-text: $text !default;
8
11
  $inRangeBg: darken($kws-datepicker-text, 55);
9
12
  }
10
13
 
11
- box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3), 0 0 0 0.0625rem rgba(0, 0, 0, 0.1);
14
+ box-shadow: $kws-datepicker-shadow;
12
15
  background: $kws-datepicker-background;
13
16
  color: $kws-datepicker-text;
14
17
 
18
+ border-radius: $kws-datepicker-radius;
19
+ .flatpickr-months {
20
+ border-radius: $kws-datepicker-radius $kws-datepicker-radius 0 0;
21
+ .flatpickr-month {
22
+ border-radius: $kws-datepicker-radius $kws-datepicker-radius 0 0;
23
+ }
24
+ }
25
+ .flatpickr-innerContainer {
26
+ border-radius: 0 0 $kws-datepicker-radius $kws-datepicker-radius;
27
+ }
28
+
15
29
  @each $name, $pair in $kws-theme-colors {
16
30
  $color: nth($pair, 1);
17
31
  $color-invert: nth($pair, 2);
@@ -94,6 +108,24 @@ $kws-datepicker-text: $text !default;
94
108
  color: $color-dark;
95
109
  }
96
110
  }
111
+
112
+ .flatpickr-day.inRange,
113
+ .flatpickr-day.prevMonthDay.inRange,
114
+ .flatpickr-day.nextMonthDay.inRange,
115
+ .flatpickr-day.today.inRange,
116
+ .flatpickr-day.prevMonthDay.today.inRange,
117
+ .flatpickr-day.nextMonthDay.today.inRange {
118
+ color: $color-dark;
119
+ background: $color-light;
120
+ border-color: $color-light;
121
+ box-shadow: -5px 0 0 $color-light, 5px 0 0 $color-light;
122
+ }
123
+ .flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n + 1)),
124
+ .flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n + 1)),
125
+ .flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n + 1)) {
126
+ box-shadow: -10px 0 0 $color;
127
+ }
128
+
97
129
  .flatpickr-innerContainer {
98
130
  border-bottom: 1px solid $color;
99
131
  }