@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.
@@ -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
- else {
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
- else {
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
- this.debouncedRoadChange(this.value);
17973
- // Appeler enforceMinMaxValue après chaque changement de valeur
17974
- this.enforceMinMaxValue();
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: '4af2964df51193dacd3ea36a1fd79f2c6b01fcfc', "aria-disabled": this.disabled ? 'true' : null, class: this.sizes && `input-${this.sizes}`, value: value, blockdecimal: this.blockdecimal }, index.h("input", { key: '82db811a6fff01df156a857bdf2168d62a5455b7', 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: '5d3fa862ed44249d044043892df85beada63b70b', class: "form-label", id: labelId, htmlFor: this.inputId }, this.label), this.error && this.error !== '' && index.h("p", { key: 'fc369a8e4fe6ae36fefb24063f025db5badb62a8', class: "invalid-feedback" }, index.h("road-icon", { key: '1371b9544470df3fc800af1b36e4ed1a6f292511', slot: "start", name: "alert-error-solid", "aria-hidden": "true", size: "sm" }), this.error), this.helper && this.helper !== '' && index.h("p", { key: 'a2ff9b16b7fac10183ef756ba8994db79dd8b205', class: "helper" }, this.helper), this.type && this.type == 'password' && index.h("slot", { key: 'aa664412f19a89162c4b89519dadded5d67954e3', name: "checklistPassword" })));
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"],