@symfony/ux-live-component 2.33.0 → 2.35.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/dist/live.min.css +1 -1
- package/dist/live_controller.js +9 -6
- package/package.json +1 -1
package/dist/live.min.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[data-loading=""],[data-loading=show],[data-loading*=\|show]{display:none}
|
|
1
|
+
[data-loading=""],[data-loading=show],[data-loading*=\|show]{display:none}
|
package/dist/live_controller.js
CHANGED
|
@@ -2262,14 +2262,17 @@ var LiveControllerDefault = class LiveControllerDefault extends Controller {
|
|
|
2262
2262
|
if (false === modelBinding.debounce) if (modelBinding.targetEventName === "input") modelBinding.debounce = true;
|
|
2263
2263
|
else modelBinding.debounce = 0;
|
|
2264
2264
|
const finalValue = getValueFromElement(element, this.component.valueStore);
|
|
2265
|
+
const finalValueIsEmpty = finalValue === "" || finalValue === null || finalValue === void 0;
|
|
2265
2266
|
if (isTextualInputElement(element) || isTextareaElement(element)) {
|
|
2266
|
-
if (modelBinding.minLength !== null && typeof finalValue === "string" && finalValue.length < modelBinding.minLength) return;
|
|
2267
|
-
if (modelBinding.maxLength !== null && typeof finalValue === "string" && finalValue.length > modelBinding.maxLength) return;
|
|
2267
|
+
if (!finalValueIsEmpty && modelBinding.minLength !== null && typeof finalValue === "string" && finalValue.length < modelBinding.minLength) return;
|
|
2268
|
+
if (!finalValueIsEmpty && modelBinding.maxLength !== null && typeof finalValue === "string" && finalValue.length > modelBinding.maxLength) return;
|
|
2268
2269
|
}
|
|
2269
2270
|
if (isNumericalInputElement(element)) {
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2271
|
+
if (!finalValueIsEmpty) {
|
|
2272
|
+
const numericValue = Number(finalValue);
|
|
2273
|
+
if (modelBinding.minValue !== null && numericValue < modelBinding.minValue) return;
|
|
2274
|
+
if (modelBinding.maxValue !== null && numericValue > modelBinding.maxValue) return;
|
|
2275
|
+
}
|
|
2273
2276
|
}
|
|
2274
2277
|
this.component.set(modelBinding.modelName, finalValue, modelBinding.shouldRender, modelBinding.debounce);
|
|
2275
2278
|
}
|
|
@@ -2334,4 +2337,4 @@ LiveControllerDefault.values = {
|
|
|
2334
2337
|
}
|
|
2335
2338
|
};
|
|
2336
2339
|
LiveControllerDefault.backendFactory = (controller) => new Backend_default(controller.urlValue, controller.requestMethodValue, controller.fetchCredentialsValue);
|
|
2337
|
-
export { Component, LiveControllerDefault as default, getComponent };
|
|
2340
|
+
export { Component, LiveControllerDefault as default, getComponent };
|
package/package.json
CHANGED