@kws3/ui 4.5.8 → 5.0.0-alpha.7

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": "5.0.0-alpha.7",
4
4
  "description": "UI components for use with Svelte v3 applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -11,6 +11,7 @@
11
11
  "keywords": [
12
12
  "components",
13
13
  "svelte3",
14
+ "svelte4",
14
15
  "ui"
15
16
  ],
16
17
  "author": "Khaled Ahmed <me.khaled@gmail.com>",
@@ -55,7 +56,7 @@
55
56
  },
56
57
  "peerDependencies": {
57
58
  "bulma": "^1.0.0",
58
- "svelte": "^4.2.10"
59
+ "svelte": "^4.2.10 || ^5.51.2"
59
60
  },
60
61
  "dependencies": {
61
62
  "@kws3/text-mask-core": "^5.1.5",
@@ -66,6 +67,5 @@
66
67
  },
67
68
  "devDependencies": {
68
69
  "typescript": "^5.2.2"
69
- },
70
- "gitHead": "a549b4270c569fb5ec4baa2a5c11c61aff0b24d0"
70
+ }
71
71
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 KWS3 Media Ltd
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.