saasufy-components 7.6.0 → 7.7.1
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/app-router.js +1 -1
- package/input-provider.js +9 -9
- package/model-input.js +15 -7
- package/package.json +1 -1
package/app-router.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { toSafeHTML, renderTemplate, debouncer } from './utils.js';
|
|
2
2
|
import { SocketConsumer } from './socket.js';
|
|
3
3
|
|
|
4
|
-
const DEFAULT_DEBOUNCE_DELAY =
|
|
4
|
+
const DEFAULT_DEBOUNCE_DELAY = 200;
|
|
5
5
|
const DEFAULT_MAX_REDIRECTS = 5;
|
|
6
6
|
|
|
7
7
|
export class AppRouter extends SocketConsumer {
|
package/input-provider.js
CHANGED
|
@@ -133,21 +133,21 @@ class InputProvider extends HTMLElement {
|
|
|
133
133
|
}
|
|
134
134
|
this.inputElement = document.createElement(elementType);
|
|
135
135
|
if (type === 'select') {
|
|
136
|
-
if (options) {
|
|
136
|
+
if (options != null) {
|
|
137
137
|
let {
|
|
138
138
|
fieldNames: optionNames,
|
|
139
139
|
fieldValues: optionValues
|
|
140
140
|
} = convertStringToFieldParams(options, true);
|
|
141
141
|
|
|
142
142
|
let optionElements = optionNames
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
143
|
+
.map((optionName) => {
|
|
144
|
+
let optionValue = optionValues[optionName] || optionName;
|
|
145
|
+
if (optionName === placeholder) {
|
|
146
|
+
return `<option value="" selected class="select-default-option">${optionName}</option>`;
|
|
147
|
+
}
|
|
148
|
+
return `<option value="${optionValue}">${optionName}</option>`;
|
|
149
|
+
})
|
|
150
|
+
.join('');
|
|
151
151
|
this.inputElement.innerHTML = optionElements;
|
|
152
152
|
}
|
|
153
153
|
} else if (elementType === 'input') {
|
package/model-input.js
CHANGED
|
@@ -207,13 +207,21 @@ class ModelInput extends SocketConsumer {
|
|
|
207
207
|
let optionList = null;
|
|
208
208
|
if (type === 'select') {
|
|
209
209
|
if (options != null) {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
210
|
+
let {
|
|
211
|
+
fieldNames: optionNames,
|
|
212
|
+
fieldValues: optionValues
|
|
213
|
+
} = convertStringToFieldParams(options, true);
|
|
214
|
+
|
|
215
|
+
let optionElements = optionNames
|
|
216
|
+
.map((optionName) => {
|
|
217
|
+
let optionValue = optionValues[optionName] || optionName;
|
|
218
|
+
if (optionName === placeholder) {
|
|
219
|
+
return `<option value="" selected class="select-default-option">${optionName}</option>`;
|
|
220
|
+
}
|
|
221
|
+
return `<option value="${optionValue}">${optionName}</option>`;
|
|
214
222
|
})
|
|
215
223
|
.join('');
|
|
216
|
-
|
|
224
|
+
this.inputElement.innerHTML = optionElements;
|
|
217
225
|
}
|
|
218
226
|
} else if (elementType === 'input') {
|
|
219
227
|
if (inputList) {
|
|
@@ -345,7 +353,7 @@ class ModelInput extends SocketConsumer {
|
|
|
345
353
|
let onInputChange = (event) => {
|
|
346
354
|
inputElement.classList.remove(successStyleClass);
|
|
347
355
|
debounce(async () => {
|
|
348
|
-
if (event.target.value === String(model.value[fieldName]
|
|
356
|
+
if (event.target.value === String(model.value[fieldName] ?? '')) return;
|
|
349
357
|
let providerTemplate = this.getAttribute('provider-template');
|
|
350
358
|
try {
|
|
351
359
|
if (inputElement.type === 'checkbox') {
|
|
@@ -406,7 +414,7 @@ class ModelInput extends SocketConsumer {
|
|
|
406
414
|
inputElement.classList.remove(successStyleClass);
|
|
407
415
|
if (this.hasAttribute('disable-instant-flush')) return;
|
|
408
416
|
debounce(async () => {
|
|
409
|
-
if (event.target.value === String(model.value[fieldName]
|
|
417
|
+
if (event.target.value === String(model.value[fieldName] ?? '')) return;
|
|
410
418
|
let providerTemplate = this.getAttribute('provider-template');
|
|
411
419
|
try {
|
|
412
420
|
if (event.target.value === '') {
|