@kws3/ui 2.1.1 → 2.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,5 +1,13 @@
1
+ # 2.1.3
2
+ - `PasswordInput` - add support for field `autocomplete` and `required`
3
+ - `PasswordValidator` - fix `valid` field binding
4
+
5
+ # 2.1.2
6
+ - `PasswordInput` - add support for field `name`
7
+ - `PasswordInput` - fix spacing when icons are turned off
8
+
1
9
  # 2.1.1
2
- - Package `text-mask-core` moved to @kws3 namespace and removed from dependencies.
10
+ - Package `text-mask-core` moved to @kws3 namespace.
3
11
 
4
12
  # 2.1.0
5
13
  - Bugfix with Colorpicker component, where colors could not be typed in manually.
@@ -26,7 +26,10 @@ This property can be bound to, to fetch the current value, Default: ``
26
26
  @param {ColorOptions} [color=] - Colour of the PasswordInput, Default: ``
27
27
  @param {string} [style=""] - Inline CSS for the PasswordInput, Default: `""`
28
28
  @param {boolean} [disabled=false] - Disables the PasswordInput, Default: `false`
29
+ @param {boolean} [required=false] - Whether Input is required or not, Default: `false`
30
+ @param {string} [autocomplete="on"] - Whether autocompletion turned off or on, Default: `"on"`
29
31
  @param {string} [placeholder=""] - Input placeholder, Default: `""`
32
+ @param {string} [name="password"] - Input HTML name, Default: `"password"`
30
33
  @param {string} [class=""] - CSS classes of the PasswordInput, Default: `""`
31
34
 
32
35
  ### Events
@@ -41,12 +44,18 @@ This property can be bound to, to fetch the current value, Default: ``
41
44
  -->
42
45
 
43
46
  <div class="field is-marginless">
44
- <p class="control has-icons-left has-icons-right is-marginless">
47
+ <p
48
+ class="control is-marginless"
49
+ class:has-icons-left={show_field_icon}
50
+ class:has-icons-right={show_visibility_switch}>
45
51
  <input
52
+ {name}
46
53
  type="password"
47
54
  bind:this={PASSWORD_INPUT}
48
55
  {style}
49
56
  bind:value
57
+ {autocomplete}
58
+ {required}
50
59
  class="input is-{size} is-{color} {klass} {style}"
51
60
  on:focus
52
61
  on:blur
@@ -193,11 +202,26 @@ This property can be bound to, to fetch the current value, Default: ``
193
202
  * @type {boolean}
194
203
  */
195
204
  export let disabled = false;
205
+ /**
206
+ * Whether Input is required or not
207
+ * @type {boolean}
208
+ */
209
+ export let required = false;
210
+ /**
211
+ * Whether autocompletion turned off or on
212
+ * @type {string}
213
+ */
214
+ export let autocomplete = "on";
196
215
  /**
197
216
  * Input placeholder
198
217
  * @type {string}
199
218
  */
200
219
  export let placeholder = "";
220
+ /**
221
+ * Input HTML name
222
+ * @type {string}
223
+ */
224
+ export let name = "password";
201
225
 
202
226
  /**
203
227
  * CSS classes of the PasswordInput
@@ -210,11 +210,7 @@ Should be used with `bind` from parent component, Default: `false`
210
210
 
211
211
  $: result = validate(password, sanitizedOptions);
212
212
 
213
- $: {
214
- if (result.overall) {
215
- valid = true;
216
- }
217
- }
213
+ $: valid = result && result.overall;
218
214
 
219
215
  function getSanitizedCustomRules(cr) {
220
216
  return cr.map((el) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kws3/ui",
3
- "version": "2.1.1",
3
+ "version": "2.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": "e13405d2772906f133ca6e37f73f6222a636005f"
38
+ "gitHead": "021ed6b77f9600a544b6fe567104887a0a3f0358"
39
39
  }