@kws3/ui 4.5.8 → 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,8 @@
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
+
1
6
  ## 4.5.8
2
7
  - `MultiSelect` Stop overwriting options prop in async mode
3
8
 
@@ -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 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kws3/ui",
3
- "version": "4.5.8",
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": "a549b4270c569fb5ec4baa2a5c11c61aff0b24d0"
70
+ "gitHead": "d8d7a136c4f8eedceea82b98a46e0dd363b267ca"
71
71
  }