@roadtrip/components 3.33.1 → 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 +45 -39
- 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 +44 -42
- 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 +45 -39
- 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-3e36cd02.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 +143 -137
- package/hydrate/index.mjs +143 -137
- 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-3e36cd02.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,48 +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
|
-
|
|
17897
|
-
|
|
17898
|
-
|
|
17899
|
-
|
|
17900
|
-
|
|
17901
|
-
if (
|
|
17902
|
-
numericValue
|
|
17903
|
-
|
|
17904
|
-
|
|
17905
|
-
numericValue
|
|
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
|
|
17906
17911
|
}
|
|
17907
|
-
|
|
17912
|
+
this.value = newValue;
|
|
17908
17913
|
}
|
|
17909
|
-
|
|
17914
|
+
// Vérification si la valeur a réellement changé avant de la mettre à jour
|
|
17915
|
+
if (this.value !== newValue) {
|
|
17910
17916
|
this.value = newValue;
|
|
17911
|
-
|
|
17917
|
+
this.roadInput.emit(ev);
|
|
17912
17918
|
}
|
|
17913
|
-
this.roadInput.emit(ev);
|
|
17914
|
-
this.roadChange.emit({ value: newValue });
|
|
17915
17919
|
// Appeler enforceMinMaxValue à chaque modification de la valeur
|
|
17916
17920
|
this.enforceMinMaxValue();
|
|
17917
17921
|
};
|
|
17918
17922
|
this.onBlur = () => {
|
|
17919
17923
|
let value = this.getValue();
|
|
17920
|
-
const minValue = this.min !== undefined ? parseFloat(this.min) : undefined;
|
|
17921
|
-
const maxValue = this.max !== undefined ? parseFloat(this.max) : undefined;
|
|
17922
|
-
let numericValue = parseFloat(value);
|
|
17923
|
-
if (!isNaN(numericValue)) {
|
|
17924
|
-
if (minValue !== undefined && numericValue < minValue) {
|
|
17925
|
-
numericValue = minValue;
|
|
17926
|
-
}
|
|
17927
|
-
if (maxValue !== undefined && numericValue > maxValue) {
|
|
17928
|
-
numericValue = maxValue;
|
|
17929
|
-
}
|
|
17930
|
-
value = numericValue.toString();
|
|
17931
|
-
}
|
|
17932
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
|
+
}
|
|
17933
17937
|
this.value = value;
|
|
17934
17938
|
const input = document.getElementById(this.inputId);
|
|
17935
17939
|
input.value = value;
|
|
17936
17940
|
}
|
|
17937
|
-
|
|
17941
|
+
// Vérification si la valeur a changé avant mise à jour
|
|
17942
|
+
if (this.value !== value) {
|
|
17943
|
+
this.value = value;
|
|
17944
|
+
this.roadBlur.emit(value);
|
|
17945
|
+
this.roadChange.emit({ value });
|
|
17946
|
+
}
|
|
17938
17947
|
// Appeler enforceMinMaxValue lors de la perte de focus
|
|
17939
17948
|
this.enforceMinMaxValue();
|
|
17940
17949
|
};
|
|
@@ -17962,10 +17971,10 @@ const Input = class {
|
|
|
17962
17971
|
/**
|
|
17963
17972
|
* Update the native input element when the value changes
|
|
17964
17973
|
*/
|
|
17965
|
-
valueChanged() {
|
|
17966
|
-
|
|
17967
|
-
|
|
17968
|
-
|
|
17974
|
+
valueChanged(newValue, oldValue) {
|
|
17975
|
+
if (newValue !== oldValue) {
|
|
17976
|
+
this.debouncedRoadChange(newValue);
|
|
17977
|
+
}
|
|
17969
17978
|
}
|
|
17970
17979
|
async enforceMinMaxValue() {
|
|
17971
17980
|
let value = this.getValue();
|
|
@@ -17981,12 +17990,9 @@ const Input = class {
|
|
|
17981
17990
|
}
|
|
17982
17991
|
value = numericValue.toString();
|
|
17983
17992
|
}
|
|
17984
|
-
if (this.type === 'number') {
|
|
17985
|
-
this.value = value;
|
|
17986
|
-
const input = document.getElementById(this.inputId);
|
|
17987
|
-
input.value = value;
|
|
17993
|
+
if (this.type === 'number' && this.value !== value) {
|
|
17994
|
+
this.value = value; // Déclenche @Watch('value')
|
|
17988
17995
|
}
|
|
17989
|
-
this.roadChange.emit({ value });
|
|
17990
17996
|
}
|
|
17991
17997
|
getValue() {
|
|
17992
17998
|
return typeof this.value === 'number'
|
|
@@ -18002,7 +18008,7 @@ const Input = class {
|
|
|
18002
18008
|
const hasValueClass = this.value !== '' && this.value !== null ? 'has-value' : '';
|
|
18003
18009
|
const lessLabelClass = this.label !== '' ? '' : 'less-label';
|
|
18004
18010
|
const isInvalidClass = this.error !== undefined && this.error !== '' ? 'is-invalid' : '';
|
|
18005
|
-
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" })));
|
|
18006
18012
|
}
|
|
18007
18013
|
static get watchers() { return {
|
|
18008
18014
|
"debounce": ["debounceChanged"],
|