saasufy-components 3.17.1 → 3.18.0
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/README.md +1 -0
- package/input-provider.js +15 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -566,6 +566,7 @@ This component can be configured to provide its data to multiple components (con
|
|
|
566
566
|
- `computable-value`: If this attribute is present, it will be possible to execute expressions using the `{{expression}}` syntax inside the `value` attribute.
|
|
567
567
|
- `autocapitalize`: Can be `on` or `off` - It will set the auto-capitalize attribute on the inner input element. This is useful for mobile devices to enable or disable auto-capitalization of the first character which is typed into the input element.
|
|
568
568
|
- `autocorrect`: Can be `on` or `off` - It will set the auto-correct attribute on the inner input element. This is useful for mobile devices to enable or disable auto-correct.
|
|
569
|
+
- `input-props`: Can be used to set additional attributes on the inner `input` element. Must be in the format `attr1=value1,attr2=value2`.
|
|
569
570
|
|
|
570
571
|
### input-combiner
|
|
571
572
|
|
package/input-provider.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
debouncer,
|
|
3
3
|
renderTemplate,
|
|
4
|
-
updateConsumerElements
|
|
4
|
+
updateConsumerElements,
|
|
5
|
+
convertStringToFieldParams
|
|
5
6
|
} from './utils.js';
|
|
6
7
|
|
|
7
8
|
const DEFAULT_DEBOUNCE_DELAY = 800;
|
|
@@ -24,7 +25,6 @@ class InputProvider extends HTMLElement {
|
|
|
24
25
|
|
|
25
26
|
static get observedAttributes() {
|
|
26
27
|
return [
|
|
27
|
-
'input-id',
|
|
28
28
|
'list',
|
|
29
29
|
'type',
|
|
30
30
|
'placeholder',
|
|
@@ -34,7 +34,9 @@ class InputProvider extends HTMLElement {
|
|
|
34
34
|
'value',
|
|
35
35
|
'height',
|
|
36
36
|
'autocapitalize',
|
|
37
|
-
'autocorrect'
|
|
37
|
+
'autocorrect',
|
|
38
|
+
'input-id',
|
|
39
|
+
'input-props'
|
|
38
40
|
];
|
|
39
41
|
}
|
|
40
42
|
|
|
@@ -99,6 +101,7 @@ class InputProvider extends HTMLElement {
|
|
|
99
101
|
let options = this.getAttribute('options');
|
|
100
102
|
let height = this.getAttribute('height');
|
|
101
103
|
let value = this.getAttribute('value') || '';
|
|
104
|
+
let inputProps = this.getAttribute('input-props');
|
|
102
105
|
|
|
103
106
|
let elementType;
|
|
104
107
|
if (type === 'select') {
|
|
@@ -140,6 +143,15 @@ class InputProvider extends HTMLElement {
|
|
|
140
143
|
if (placeholder) {
|
|
141
144
|
this.inputElement.setAttribute('placeholder', placeholder);
|
|
142
145
|
}
|
|
146
|
+
if (inputProps) {
|
|
147
|
+
let {
|
|
148
|
+
fieldNames: attrNames,
|
|
149
|
+
fieldValues: attrValues
|
|
150
|
+
} = convertStringToFieldParams(inputProps);
|
|
151
|
+
for (let attr of attrNames) {
|
|
152
|
+
this.inputElement.setAttribute(attr, attrValues[attr]);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
143
155
|
|
|
144
156
|
this.appendChild(this.inputElement);
|
|
145
157
|
|