@roadtrip/components 3.51.1 → 3.51.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.
@@ -19543,6 +19543,8 @@ const Input = class {
19543
19543
  this.debounce = 0;
19544
19544
  this.debouncedRoadChange = this.createDebouncedRoadChange();
19545
19545
  this.onInput = (ev) => {
19546
+ if (this.isComposing)
19547
+ return;
19546
19548
  const input = ev.target;
19547
19549
  let newValue = input.value;
19548
19550
  if (this.type === 'number' && this.blockdecimal) {
@@ -19575,6 +19577,14 @@ const Input = class {
19575
19577
  this.enforceMinMaxValue();
19576
19578
  };
19577
19579
  this.onBlur = () => {
19580
+ var _a, _b;
19581
+ if (this.isComposing) {
19582
+ this.isComposing = false;
19583
+ const domValue = (_b = (_a = this.inputEl) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '';
19584
+ if (this.value !== domValue) {
19585
+ this.value = domValue;
19586
+ }
19587
+ }
19578
19588
  let value = this.getValue();
19579
19589
  if (this.type === 'number') {
19580
19590
  const minValue = this.min !== undefined ? parseFloat(this.min) : undefined;
@@ -19608,6 +19618,17 @@ const Input = class {
19608
19618
  this.onFocus = () => {
19609
19619
  this.roadFocus.emit();
19610
19620
  };
19621
+ this.isComposing = false;
19622
+ this.onCompositionStart = () => {
19623
+ this.isComposing = true;
19624
+ };
19625
+ this.onCompositionUpdate = (ev) => {
19626
+ this.onInput(ev);
19627
+ };
19628
+ this.onCompositionEnd = (ev) => {
19629
+ this.isComposing = false;
19630
+ this.onInput(ev);
19631
+ };
19611
19632
  }
19612
19633
  handleKeyDown(event) {
19613
19634
  if (this.type === 'number' && this.blockdecimal) {
@@ -19671,11 +19692,11 @@ const Input = class {
19671
19692
  const lessLabelClass = this.label !== '' ? '' : 'less-label';
19672
19693
  const isInvalidClass = this.error !== undefined && this.error !== '' ? 'is-invalid' : '';
19673
19694
  const isValidClass = this.success == true ? 'is-valid' : '';
19674
- return (index.h(index.Host, { key: 'be099a0ea8338c8c4ed1ad3e73b0036156410d9e', "aria-disabled": this.disabled ? 'true' : null, class: this.sizes && `input-${this.sizes}`, value: value, blockdecimal: this.blockdecimal }, index.h("input", { key: '6bdc1d4f3648314134cd7790804430ca4292c5cd', class: `form-control ${hasValueClass} ${isInvalidClass} ${isValidClass} ${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, list: this.list, value: value, onInput: this.onInput, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.type === 'number' ? (event) => this.handleKeyDown(event) : undefined, "data-cy": 'road-input', ref: el => (this.inputEl = el) }), index.h("label", { key: '38884ef3e266eece5f45a3746ab366fd5aa2810c', class: "form-label", id: labelId, htmlFor: this.inputId }, this.label), this.error && this.error !== '' && (Array.isArray(this.error)
19695
+ return (index.h(index.Host, { key: '1a723a76c79f3d505845abd0a1e78f42f85d79d3', "aria-disabled": this.disabled ? 'true' : null, class: this.sizes && `input-${this.sizes}`, value: value, blockdecimal: this.blockdecimal }, index.h("input", { key: '44fa837d7d2fd3acf01c0728778e2dad3e8a5bb4', class: `form-control ${hasValueClass} ${isInvalidClass} ${isValidClass} ${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, list: this.list, value: value, onInput: this.onInput, onCompositionstart: this.onCompositionStart, onCompositionupdate: this.onCompositionUpdate, onCompositionend: this.onCompositionEnd, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.type === 'number' ? (event) => this.handleKeyDown(event) : undefined, "data-cy": 'road-input', ref: el => (this.inputEl = el) }), index.h("label", { key: 'b6b196160326ed5d3ffe65741f6aae0037c355ce', class: "form-label", id: labelId, htmlFor: this.inputId }, this.label), this.error && this.error !== '' && (Array.isArray(this.error)
19675
19696
  ? // Si error est un tableau, on itère et génère un <p> pour chaque élément
19676
19697
  this.error.map((err, index$1) => (index.h("p", { key: index$1, class: "invalid-feedback" }, index.h("road-icon", { slot: "start", name: "alert-error-solid", "aria-hidden": "true", size: "sm" }), err.trim(), " ")))
19677
19698
  : // Si error est une chaîne, on la divise avec split et génère un <p> pour chaque élément
19678
- this.error.split(',').map((err, index$1) => (index.h("p", { key: index$1, class: "invalid-feedback" }, index.h("road-icon", { slot: "start", name: "alert-error-solid", "aria-hidden": "true", size: "sm" }), err.trim(), " ")))), this.helper && this.helper !== '' && index.h("p", { key: 'eda924baf7920edab4432565e020d8f21a5f70f1', class: "helper" }, this.helper), this.type && this.type == 'password' && index.h("slot", { key: '52dbaeb8362e4949c48297ba32ae331143044f78', name: "checklistPassword" })));
19699
+ this.error.split(',').map((err, index$1) => (index.h("p", { key: index$1, class: "invalid-feedback" }, index.h("road-icon", { slot: "start", name: "alert-error-solid", "aria-hidden": "true", size: "sm" }), err.trim(), " ")))), this.helper && this.helper !== '' && index.h("p", { key: 'a8af4a8359dd410e54ffc0a5668550d6c0cd8d6b', class: "helper" }, this.helper), this.type && this.type == 'password' && index.h("slot", { key: '4550347f0788d382ba515d1e5489c72b9c9cf44f', name: "checklistPassword" })));
19679
19700
  }
19680
19701
  static get watchers() { return {
19681
19702
  "debounce": ["debounceChanged"],