@kws3/ui 2.1.2 → 2.1.4
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,10 @@
|
|
|
1
|
+
# 2.1.4
|
|
2
|
+
- Fix bug where disabled Checkbox components wrongly appeared as if they were checked
|
|
3
|
+
|
|
4
|
+
# 2.1.3
|
|
5
|
+
- `PasswordInput` - add support for field `autocomplete` and `required`
|
|
6
|
+
- `PasswordValidator` - fix `valid` field binding
|
|
7
|
+
|
|
1
8
|
# 2.1.2
|
|
2
9
|
- `PasswordInput` - add support for field `name`
|
|
3
10
|
- `PasswordInput` - fix spacing when icons are turned off
|
|
@@ -14,6 +14,7 @@ This will be overridden if `min` is higher, or `max` is lower, Default: `0`
|
|
|
14
14
|
@param {boolean} [disabled=false] - Disables the NumberInput, Default: `false`
|
|
15
15
|
@param {boolean} [fullwidth=false] - Forces the NumberInput to occupy the full width of it's container, Default: `false`
|
|
16
16
|
@param {boolean} [typeable=true] - Allows typing the value into the input, Default: `true`
|
|
17
|
+
@param {string} [input_class=""] - Adds a css class to the input field, Default: `""`
|
|
17
18
|
@param {string} [minus_icon="minus"] - Name of the icon that is to be displayed in the minus button, Default: `"minus"`
|
|
18
19
|
@param {ColorOptions} [minus_icon_color=danger] - Color of the Minus Icon, Default: `danger`
|
|
19
20
|
@param {ColorOptions} [minus_button_color=] - Color of the Minus Button, Default: ``
|
|
@@ -35,8 +36,8 @@ This will be overridden if `min` is higher, or `max` is lower, Default: `0`
|
|
|
35
36
|
<input
|
|
36
37
|
{style}
|
|
37
38
|
data-testid="input"
|
|
38
|
-
class="input has-text-centered {klass} is-{size} is-{value <
|
|
39
|
-
|
|
39
|
+
class="input has-text-centered {klass} {input_class} is-{size} is-{value <
|
|
40
|
+
min || value > max
|
|
40
41
|
? 'danger'
|
|
41
42
|
: ''}"
|
|
42
43
|
type="number"
|
|
@@ -67,8 +68,10 @@ This will be overridden if `min` is higher, or `max` is lower, Default: `0`
|
|
|
67
68
|
</div>
|
|
68
69
|
<div class="control is-{fullwidth ? 'expanded' : 'narrow'}">
|
|
69
70
|
<input
|
|
71
|
+
style="z-index:1"
|
|
70
72
|
data-testid="input"
|
|
71
|
-
class="input has-text-centered is-{size} is-{value <
|
|
73
|
+
class="input has-text-centered {input_class} is-{size} is-{value <
|
|
74
|
+
min || value > max
|
|
72
75
|
? 'danger'
|
|
73
76
|
: ''}"
|
|
74
77
|
type="number"
|
|
@@ -172,6 +175,10 @@ This will be overridden if `min` is higher, or `max` is lower, Default: `0`
|
|
|
172
175
|
* Allows typing the value into the input
|
|
173
176
|
*/
|
|
174
177
|
typeable = true,
|
|
178
|
+
/**
|
|
179
|
+
* Adds a css class to the input field
|
|
180
|
+
*/
|
|
181
|
+
input_class = "",
|
|
175
182
|
/**
|
|
176
183
|
* Name of the icon that is to be displayed in the minus button
|
|
177
184
|
*/
|
|
@@ -26,6 +26,8 @@ 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: `""`
|
|
30
32
|
@param {string} [name="password"] - Input HTML name, Default: `"password"`
|
|
31
33
|
@param {string} [class=""] - CSS classes of the PasswordInput, Default: `""`
|
|
@@ -52,6 +54,8 @@ This property can be bound to, to fetch the current value, Default: ``
|
|
|
52
54
|
bind:this={PASSWORD_INPUT}
|
|
53
55
|
{style}
|
|
54
56
|
bind:value
|
|
57
|
+
{autocomplete}
|
|
58
|
+
{required}
|
|
55
59
|
class="input is-{size} is-{color} {klass} {style}"
|
|
56
60
|
on:focus
|
|
57
61
|
on:blur
|
|
@@ -198,6 +202,16 @@ This property can be bound to, to fetch the current value, Default: ``
|
|
|
198
202
|
* @type {boolean}
|
|
199
203
|
*/
|
|
200
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";
|
|
201
215
|
/**
|
|
202
216
|
* Input placeholder
|
|
203
217
|
* @type {string}
|
|
@@ -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.
|
|
3
|
+
"version": "2.1.4",
|
|
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": "
|
|
38
|
+
"gitHead": "801fdf5363f25ccb04d1a6506bb2c51e0a8506cc"
|
|
39
39
|
}
|
package/styles/CheckRadio.scss
CHANGED
|
@@ -130,10 +130,16 @@ $kws-checkradio-focus-box-shadow-color: $input-focus-box-shadow-color !default;
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
input[type="checkbox"]:disabled + .kws-checkbox-label,
|
|
134
|
-
input[type="radio"]:disabled + .kws-checkbox-label,
|
|
135
133
|
input[type="checkbox"]:disabled ~ .icon,
|
|
136
134
|
input[type="radio"]:disabled ~ .icon {
|
|
135
|
+
opacity: 0;
|
|
136
|
+
cursor: not-allowed;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
input[type="checkbox"]:disabled + .kws-checkbox-label,
|
|
140
|
+
input[type="radio"]:disabled + .kws-checkbox-label,
|
|
141
|
+
input[type="checkbox"]:checked:disabled ~ .icon,
|
|
142
|
+
input[type="radio"]:checked:disabled ~ .icon {
|
|
137
143
|
opacity: 0.5;
|
|
138
144
|
cursor: not-allowed;
|
|
139
145
|
}
|