@kws3/ui 4.5.7 → 4.5.9

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,11 @@
1
+ ## 4.5.9
2
+ - Remove left border radius on search button in `DataSearch`
3
+ - `FileUpload` Fix file name not populated in `getFile()`
4
+ - Fix form comparator so that new or removed object keys trigger `touched`
5
+
6
+ ## 4.5.8
7
+ - `MultiSelect` Stop overwriting options prop in async mode
8
+
1
9
  ## 4.5.7
2
10
  - Fix SCSS deprecation warnings
3
11
 
@@ -158,7 +158,8 @@ The following functions are returned in `event.detail`:
158
158
  _uploaded = 0,
159
159
  uploadInput,
160
160
  uploadField,
161
- formData;
161
+ formData,
162
+ name = "";
162
163
 
163
164
  let fileTypes, _progress, maxFileSize;
164
165
 
@@ -311,6 +312,7 @@ The following functions are returned in `event.detail`:
311
312
 
312
313
  if (valid) {
313
314
  _total = size;
315
+ name = file.name;
314
316
  formData.append("userfile", file);
315
317
  /**
316
318
  * Triggered when file is chosen by user.
@@ -46,7 +46,7 @@
46
46
  {/each}
47
47
  {/if}
48
48
 
49
- <div class="field has-addons action-buttons-field">
49
+ <div class="field has-addons control action-buttons-field">
50
50
  {#if changed}
51
51
  <div class="control is-expanded clear-search">
52
52
  <button
package/form/index.js CHANGED
@@ -40,6 +40,12 @@ const formMaker = (config) => {
40
40
  * @returns
41
41
  */
42
42
  let compare = (field, oldData, newData) => {
43
+ if (typeof oldData === "undefined" && typeof newData !== "undefined") {
44
+ return true;
45
+ }
46
+ if (typeof newData === "undefined" && typeof oldData !== "undefined") {
47
+ return true;
48
+ }
43
49
  if (Array.isArray(newData[field])) {
44
50
  if (
45
51
  !Array.isArray(oldData[field]) ||
@@ -131,7 +137,7 @@ const formMaker = (config) => {
131
137
  });
132
138
 
133
139
  const isValid = derived(errors, ($errors) =>
134
- Object.values($errors).every((v) => v === "")
140
+ Object.values($errors).every((v) => v === ""),
135
141
  );
136
142
 
137
143
  /** @param {{ [key: string]: any }} newData */
@@ -566,7 +566,12 @@ Default value: `<span>{option[search_key] || option}</span>`
566
566
  if (asyncMode) {
567
567
  // initally on async mode options are empty
568
568
  // so we need to fill selectedOptions with value if value is avaliable
569
- options = value ? [...(single ? [value] : [...value])] : [];
569
+ options =
570
+ options && options.length
571
+ ? options
572
+ : value
573
+ ? [...(single ? [value] : [...value])]
574
+ : [];
570
575
  searching = false;
571
576
  tick().then(() => {
572
577
  normaliseOptions();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kws3/ui",
3
- "version": "4.5.7",
3
+ "version": "4.5.9",
4
4
  "description": "UI components for use with Svelte v3 applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -67,5 +67,5 @@
67
67
  "devDependencies": {
68
68
  "typescript": "^5.2.2"
69
69
  },
70
- "gitHead": "ac1f52cbab18e465f845a3366f6b13a00ce331c0"
70
+ "gitHead": "d8d7a136c4f8eedceea82b98a46e0dd363b267ca"
71
71
  }
@@ -49,6 +49,14 @@ $popover-radius: $radius !default;
49
49
  $placements: "top", "bottom", "left", "right";
50
50
  $origins: bottom, top, right, left;
51
51
 
52
+ position: relative;
53
+ background-color: $background;
54
+ color: $color;
55
+ border-radius: $radius;
56
+ outline: 0;
57
+ box-shadow: $shadow;
58
+ transition-property: transform, visibility, opacity;
59
+
52
60
  &[data-animation="scale"] {
53
61
  @each $placement in $placements {
54
62
  &[data-placement^="#{$placement}"] {
@@ -69,14 +77,6 @@ $popover-radius: $radius !default;
69
77
  opacity: 0;
70
78
  }
71
79
 
72
- position: relative;
73
- background-color: $background;
74
- color: $color;
75
- border-radius: $radius;
76
- outline: 0;
77
- box-shadow: $shadow;
78
- transition-property: transform, visibility, opacity;
79
-
80
80
  @each $name, $pair in $theme-colors {
81
81
  &[data-theme~="#{$name}"] {
82
82
  color: cv.getVar($name, "", "-invert");