@roadtrip/components 3.33.2 → 3.33.3
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/cjs/road-badge_14.cjs.entry.js +42 -42
- package/dist/cjs/road-badge_14.cjs.entry.js.map +1 -1
- package/dist/cjs/road-spinner.cjs.entry.js +1 -1
- package/dist/cjs/road-spinner.cjs.entry.js.map +1 -1
- package/dist/collection/components/counter/counter.css +1 -0
- package/dist/collection/components/input/input.js +41 -45
- package/dist/collection/components/input/input.js.map +1 -1
- package/dist/collection/components/spinner/spinner.css +1 -1
- package/dist/esm/road-badge_14.entry.js +42 -42
- package/dist/esm/road-badge_14.entry.js.map +1 -1
- package/dist/esm/road-spinner.entry.js +1 -1
- package/dist/esm/road-spinner.entry.js.map +1 -1
- package/dist/roadtrip/p-6d3d947e.entry.js +2 -0
- package/dist/roadtrip/p-6d3d947e.entry.js.map +1 -0
- package/dist/roadtrip/{p-55897254.entry.js → p-a38bdba6.entry.js} +3 -3
- package/dist/roadtrip/p-a38bdba6.entry.js.map +1 -0
- package/dist/roadtrip/roadtrip.esm.js +1 -1
- package/dist/types/components/input/input.d.ts +1 -1
- package/hydrate/index.js +43 -43
- package/hydrate/index.mjs +43 -43
- package/package.json +1 -1
- package/dist/roadtrip/p-04913d58.entry.js +0 -2
- package/dist/roadtrip/p-04913d58.entry.js.map +0 -1
- package/dist/roadtrip/p-55897254.entry.js.map +0 -1
|
@@ -129,7 +129,7 @@ const Col = class {
|
|
|
129
129
|
};
|
|
130
130
|
Col.style = RoadColStyle0;
|
|
131
131
|
|
|
132
|
-
const counterCss = ".sc-road-counter-h{position:relative;z-index:0;display:block}road-input.sc-road-counter{--input-text-align:center;--border-radius:0;--margin-bottom:0}road-button.sc-road-counter{width:3rem;font-size:var(--road-font-size-24);line-height:1.4;background:var(--road-surface);border:1px solid var(--road-button-tertiary-outline)}road-button.sc-road-counter:hover,road-button.sc-road-counter:focus{background:var(--road-button-tertiary-variant)}road-button.sc-road-counter road-icon.sc-road-counter{display:flex;fill:var(--road-primary)}.disabled.sc-road-counter{margin-right:-1px;margin-left:-1px;pointer-events:none;cursor:not-allowed;background:var(--road-surface-disabled);border:1px solid var(--road-on-surface-disabled);opacity:inherit}.disabled.sc-road-counter:focus{background:var(--road-disabled)}.disabled.sc-road-counter road-icon.sc-road-counter{fill:var(--road-grey-50)}road-button.btn-md.sc-road-counter{width:2.5rem}road-button.btn-sm.sc-road-counter{width:2rem}.counter-md.sc-road-counter{height:2.5rem}.counter-sm.sc-road-counter{height:2rem}.counter-md.sc-road-counter road-input.sc-road-counter{--height:2.5rem}.counter-md.sc-road-counter road-button.sc-road-counter{min-width:2.5rem}.counter-sm.sc-road-counter road-input.sc-road-counter{--height:2rem}.counter-sm.sc-road-counter road-button.sc-road-counter{min-width:2rem}";
|
|
132
|
+
const counterCss = ".sc-road-counter-h{position:relative;z-index:0;display:block}road-input.sc-road-counter{--input-text-align:center;--border-radius:0;--margin-bottom:0}road-button.sc-road-counter{position:relative;width:3rem;font-size:var(--road-font-size-24);line-height:1.4;background:var(--road-surface);border:1px solid var(--road-button-tertiary-outline)}road-button.sc-road-counter:hover,road-button.sc-road-counter:focus{background:var(--road-button-tertiary-variant)}road-button.sc-road-counter road-icon.sc-road-counter{display:flex;fill:var(--road-primary)}.disabled.sc-road-counter{margin-right:-1px;margin-left:-1px;pointer-events:none;cursor:not-allowed;background:var(--road-surface-disabled);border:1px solid var(--road-on-surface-disabled);opacity:inherit}.disabled.sc-road-counter:focus{background:var(--road-disabled)}.disabled.sc-road-counter road-icon.sc-road-counter{fill:var(--road-grey-50)}road-button.btn-md.sc-road-counter{width:2.5rem}road-button.btn-sm.sc-road-counter{width:2rem}.counter-md.sc-road-counter{height:2.5rem}.counter-sm.sc-road-counter{height:2rem}.counter-md.sc-road-counter road-input.sc-road-counter{--height:2.5rem}.counter-md.sc-road-counter road-button.sc-road-counter{min-width:2.5rem}.counter-sm.sc-road-counter road-input.sc-road-counter{--height:2rem}.counter-sm.sc-road-counter road-button.sc-road-counter{min-width:2rem}";
|
|
133
133
|
const RoadCounterStyle0 = counterCss;
|
|
134
134
|
|
|
135
135
|
const Counter = class {
|
|
@@ -17893,54 +17893,57 @@ const Input = class {
|
|
|
17893
17893
|
if (this.type === 'number' && this.blockdecimal) {
|
|
17894
17894
|
newValue = newValue.replace(/[.,]/g, ''); // Supprime les décimales si `blockdecimal` est activé
|
|
17895
17895
|
}
|
|
17896
|
-
// Convertir en nombre et ajuster selon min/max
|
|
17897
|
-
let numericValue = parseFloat(newValue);
|
|
17898
|
-
const minValue = this.min !== undefined ? parseFloat(this.min) : undefined;
|
|
17899
|
-
const maxValue = this.max !== undefined ? parseFloat(this.max) : undefined;
|
|
17900
|
-
if (!isNaN(numericValue)) {
|
|
17901
|
-
if (minValue !== undefined && numericValue < minValue) {
|
|
17902
|
-
numericValue = minValue;
|
|
17903
|
-
}
|
|
17904
|
-
if (maxValue !== undefined && numericValue > maxValue) {
|
|
17905
|
-
numericValue = maxValue;
|
|
17906
|
-
}
|
|
17907
|
-
newValue = numericValue.toString();
|
|
17908
|
-
}
|
|
17909
17896
|
if (this.type === 'number') {
|
|
17897
|
+
// Convertir en nombre et ajuster selon min/max
|
|
17898
|
+
let numericValue = parseFloat(newValue);
|
|
17899
|
+
const minValue = this.min !== undefined ? parseFloat(this.min) : undefined;
|
|
17900
|
+
const maxValue = this.max !== undefined ? parseFloat(this.max) : undefined;
|
|
17901
|
+
if (!isNaN(numericValue)) {
|
|
17902
|
+
if (minValue !== undefined && numericValue < minValue) {
|
|
17903
|
+
numericValue = minValue;
|
|
17904
|
+
}
|
|
17905
|
+
if (maxValue !== undefined && numericValue > maxValue) {
|
|
17906
|
+
numericValue = maxValue;
|
|
17907
|
+
}
|
|
17908
|
+
newValue = numericValue.toString();
|
|
17909
|
+
input.value = newValue; // Force l'affichage de la valeur max
|
|
17910
|
+
ev.preventDefault(); // Empêche la saisie supplémentaire
|
|
17911
|
+
}
|
|
17910
17912
|
this.value = newValue;
|
|
17911
|
-
input.value = newValue; // Mise à jour immédiate du champ
|
|
17912
17913
|
}
|
|
17913
|
-
|
|
17914
|
+
// Vérification si la valeur a réellement changé avant de la mettre à jour
|
|
17915
|
+
if (this.value !== newValue) {
|
|
17914
17916
|
this.value = newValue;
|
|
17917
|
+
this.roadInput.emit(ev);
|
|
17915
17918
|
}
|
|
17916
|
-
this.roadInput.emit(ev);
|
|
17917
|
-
this.roadChange.emit({ value: newValue });
|
|
17918
17919
|
// Appeler enforceMinMaxValue à chaque modification de la valeur
|
|
17919
17920
|
this.enforceMinMaxValue();
|
|
17920
17921
|
};
|
|
17921
17922
|
this.onBlur = () => {
|
|
17922
17923
|
let value = this.getValue();
|
|
17923
|
-
const minValue = this.min !== undefined ? parseFloat(this.min) : undefined;
|
|
17924
|
-
const maxValue = this.max !== undefined ? parseFloat(this.max) : undefined;
|
|
17925
|
-
let numericValue = parseFloat(value);
|
|
17926
|
-
if (!isNaN(numericValue)) {
|
|
17927
|
-
if (minValue !== undefined && numericValue < minValue) {
|
|
17928
|
-
numericValue = minValue;
|
|
17929
|
-
}
|
|
17930
|
-
if (maxValue !== undefined && numericValue > maxValue) {
|
|
17931
|
-
numericValue = maxValue;
|
|
17932
|
-
}
|
|
17933
|
-
value = numericValue.toString();
|
|
17934
|
-
}
|
|
17935
17924
|
if (this.type === 'number') {
|
|
17925
|
+
const minValue = this.min !== undefined ? parseFloat(this.min) : undefined;
|
|
17926
|
+
const maxValue = this.max !== undefined ? parseFloat(this.max) : undefined;
|
|
17927
|
+
let numericValue = parseFloat(value);
|
|
17928
|
+
if (!isNaN(numericValue)) {
|
|
17929
|
+
if (minValue !== undefined && numericValue < minValue) {
|
|
17930
|
+
numericValue = minValue;
|
|
17931
|
+
}
|
|
17932
|
+
if (maxValue !== undefined && numericValue > maxValue) {
|
|
17933
|
+
numericValue = maxValue;
|
|
17934
|
+
}
|
|
17935
|
+
value = numericValue.toString();
|
|
17936
|
+
}
|
|
17936
17937
|
this.value = value;
|
|
17937
17938
|
const input = document.getElementById(this.inputId);
|
|
17938
17939
|
input.value = value;
|
|
17939
17940
|
}
|
|
17940
|
-
|
|
17941
|
+
// Vérification si la valeur a changé avant mise à jour
|
|
17942
|
+
if (this.value !== value) {
|
|
17941
17943
|
this.value = value;
|
|
17944
|
+
this.roadBlur.emit(value);
|
|
17945
|
+
this.roadChange.emit({ value });
|
|
17942
17946
|
}
|
|
17943
|
-
this.roadBlur.emit(value);
|
|
17944
17947
|
// Appeler enforceMinMaxValue lors de la perte de focus
|
|
17945
17948
|
this.enforceMinMaxValue();
|
|
17946
17949
|
};
|
|
@@ -17968,10 +17971,10 @@ const Input = class {
|
|
|
17968
17971
|
/**
|
|
17969
17972
|
* Update the native input element when the value changes
|
|
17970
17973
|
*/
|
|
17971
|
-
valueChanged() {
|
|
17972
|
-
|
|
17973
|
-
|
|
17974
|
-
|
|
17974
|
+
valueChanged(newValue, oldValue) {
|
|
17975
|
+
if (newValue !== oldValue) {
|
|
17976
|
+
this.debouncedRoadChange(newValue);
|
|
17977
|
+
}
|
|
17975
17978
|
}
|
|
17976
17979
|
async enforceMinMaxValue() {
|
|
17977
17980
|
let value = this.getValue();
|
|
@@ -17987,12 +17990,9 @@ const Input = class {
|
|
|
17987
17990
|
}
|
|
17988
17991
|
value = numericValue.toString();
|
|
17989
17992
|
}
|
|
17990
|
-
if (this.type === 'number') {
|
|
17991
|
-
this.value = value;
|
|
17992
|
-
const input = document.getElementById(this.inputId);
|
|
17993
|
-
input.value = value;
|
|
17993
|
+
if (this.type === 'number' && this.value !== value) {
|
|
17994
|
+
this.value = value; // Déclenche @Watch('value')
|
|
17994
17995
|
}
|
|
17995
|
-
this.roadChange.emit({ value });
|
|
17996
17996
|
}
|
|
17997
17997
|
getValue() {
|
|
17998
17998
|
return typeof this.value === 'number'
|
|
@@ -18008,7 +18008,7 @@ const Input = class {
|
|
|
18008
18008
|
const hasValueClass = this.value !== '' && this.value !== null ? 'has-value' : '';
|
|
18009
18009
|
const lessLabelClass = this.label !== '' ? '' : 'less-label';
|
|
18010
18010
|
const isInvalidClass = this.error !== undefined && this.error !== '' ? 'is-invalid' : '';
|
|
18011
|
-
return (index.h(index.Host, { key: '
|
|
18011
|
+
return (index.h(index.Host, { key: 'e8296b902967681ad3483560e720236c98dc4f9f', "aria-disabled": this.disabled ? 'true' : null, class: this.sizes && `input-${this.sizes}`, value: value, blockdecimal: this.blockdecimal }, index.h("input", { key: '8ad175738f8fca4ca345aff156e3124db00afbdf', class: `form-control ${hasValueClass} ${isInvalidClass} ${lessLabelClass}`, id: this.inputId, "aria-disabled": this.disabled ? 'true' : null, "aria-labelledby": labelId, disabled: this.disabled, autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, enterKeyHint: this.enterkeyhint, autoFocus: this.autofocus, inputMode: this.inputmode, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, name: this.name, pattern: this.pattern, placeholder: this.placeholder, readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, step: this.step, size: this.size, type: this.type, value: value, onInput: this.onInput, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.type === 'number' ? (event) => this.handleKeyDown(event) : undefined, "data-cy": 'road-input' }), index.h("label", { key: 'f9e63512f533d2cf89a8bbfd6fffd8824a721211', class: "form-label", id: labelId, htmlFor: this.inputId }, this.label), this.error && this.error !== '' && index.h("p", { key: 'ec34468bc61c42943ee5b275081e02be859e45e2', class: "invalid-feedback" }, index.h("road-icon", { key: '83204d0fecc77eb3d8e8bc9697cd9bfc7ddb3be5', slot: "start", name: "alert-error-solid", "aria-hidden": "true", size: "sm" }), this.error), this.helper && this.helper !== '' && index.h("p", { key: 'b639735e1508e1aac0ba5800edf9649fb1847155', class: "helper" }, this.helper), this.type && this.type == 'password' && index.h("slot", { key: 'c33c73bc53ae22f3b3bd97021a5c4f320cff89f9', name: "checklistPassword" })));
|
|
18012
18012
|
}
|
|
18013
18013
|
static get watchers() { return {
|
|
18014
18014
|
"debounce": ["debounceChanged"],
|