saasufy-components 3.16.2 → 3.17.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.
Files changed (2) hide show
  1. package/model-input.js +14 -3
  2. package/package.json +1 -1
package/model-input.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { SocketConsumer } from './socket.js';
2
- import { debouncer, updateConsumerElements } from './utils.js';
2
+ import { debouncer, updateConsumerElements, convertStringToFieldParams } from './utils.js';
3
3
  import AGModel from '/node_modules/ag-model/ag-model.js';
4
4
 
5
5
  class ModelInput extends SocketConsumer {
@@ -21,7 +21,6 @@ class ModelInput extends SocketConsumer {
21
21
 
22
22
  static get observedAttributes() {
23
23
  return [
24
- 'input-id',
25
24
  'list',
26
25
  'socket-instance-property',
27
26
  'type',
@@ -40,7 +39,9 @@ class ModelInput extends SocketConsumer {
40
39
  'value',
41
40
  'hide-error-logs',
42
41
  'autocapitalize',
43
- 'autocorrect'
42
+ 'autocorrect',
43
+ 'input-id',
44
+ 'input-props'
44
45
  ];
45
46
  }
46
47
 
@@ -112,6 +113,7 @@ class ModelInput extends SocketConsumer {
112
113
  let height = this.getAttribute('height');
113
114
  let hideErrorLogs = this.hasAttribute('hide-error-logs');
114
115
  let enableRebound = this.hasAttribute('enable-rebound');
116
+ let inputProps = this.getAttribute('input-props');
115
117
  let hasConsumers = this.hasAttribute('consumers');
116
118
  let writeOnly = type === 'file' && !hasConsumers;
117
119
 
@@ -210,6 +212,15 @@ class ModelInput extends SocketConsumer {
210
212
  if (accept) {
211
213
  this.inputElement.setAttribute('accept', accept);
212
214
  }
215
+ if (inputProps) {
216
+ let {
217
+ fieldNames: attrNames,
218
+ fieldValues: attrValues
219
+ } = convertStringToFieldParams(inputProps);
220
+ for (let attr of attrNames) {
221
+ this.inputElement.setAttribute(attr, attrValues[attr]);
222
+ }
223
+ }
213
224
  let errorMessageContainer = null;
214
225
  if (showErrorMessage) {
215
226
  errorMessageContainer = document.createElement('div');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saasufy-components",
3
- "version": "3.16.2",
3
+ "version": "3.17.0",
4
4
  "description": "Components for Saasufy.",
5
5
  "main": "index.js",
6
6
  "scripts": {