@roadtrip/components 3.51.0 → 3.51.2
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 +25 -3
- package/dist/cjs/road-badge_14.cjs.entry.js.map +1 -1
- package/dist/collection/components/drawer/drawer.js +2 -1
- package/dist/collection/components/drawer/drawer.js.map +1 -1
- package/dist/collection/components/drawer/drawer.stories.js +1 -1
- package/dist/collection/components/input/input.js +23 -2
- package/dist/collection/components/input/input.js.map +1 -1
- package/dist/esm/road-badge_14.entry.js +25 -3
- package/dist/esm/road-badge_14.entry.js.map +1 -1
- package/dist/roadtrip/{p-b2df7b64.entry.js → p-ce281723.entry.js} +4 -4
- package/dist/roadtrip/p-ce281723.entry.js.map +1 -0
- package/dist/roadtrip/roadtrip.esm.js +1 -1
- package/dist/types/components/input/input.d.ts +4 -0
- package/hydrate/index.js +25 -3
- package/hydrate/index.mjs +25 -3
- package/package.json +1 -1
- package/dist/roadtrip/p-b2df7b64.entry.js.map +0 -1
|
@@ -2049,6 +2049,7 @@ const Drawer = class {
|
|
|
2049
2049
|
tabbableOptions: {
|
|
2050
2050
|
getShadowRoot: true,
|
|
2051
2051
|
},
|
|
2052
|
+
preventScroll: true,
|
|
2052
2053
|
});
|
|
2053
2054
|
}
|
|
2054
2055
|
return this.focusTrap;
|
|
@@ -2067,7 +2068,7 @@ const Drawer = class {
|
|
|
2067
2068
|
const backIconElement = this.hasBackIcon ? (index.h("button", { type: "button", class: "drawer-action", "aria-label": ariaLabelBack, onClick: this.onClickBack }, index.h("road-icon", { icon: index$1.navigationChevron, rotate: "180" }), this.backText)) : null;
|
|
2068
2069
|
const closeIconElement = this.hasCloseIcon ? (index.h("button", { type: "button", class: "drawer-close", onClick: this.onClick, "aria-label": ariaLabelClose }, index.h("road-icon", { icon: index$1.navigationClose, "aria-hidden": "true" }))) : null;
|
|
2069
2070
|
const drawerWidthValue = this.position === "bottom" ? "100%" : `${this.drawerWidth}px`;
|
|
2070
|
-
return (index.h(index.Host, { key: '
|
|
2071
|
+
return (index.h(index.Host, { key: 'f3f7bb36db4476325b4e7a879a739529bc79d964', class: `${drawerIsOpenClass} drawer-${this.position}`, tabindex: "0", role: "dialog", "aria-label": ariaLabel }, index.h("div", { key: '407cd4cc74d0f94f43cb306e8e7c819b771493dd', class: "road-drawer-wrapper" }, index.h("div", { key: '2f09ca1bfff5bf81ed94a277910dbb6017d0b984', class: "drawer-overlay", onClick: this.onClick, tabindex: "-1" }), index.h("div", { key: 'ae71f5011512dd1dd2a3cdd69b7ca6c8838b787f', class: "drawer-dialog", style: { maxWidth: drawerWidthValue }, role: "document" }, index.h("div", { key: '94cf3ed5d1a5e62cf15ec3a20a6bb786a240d61a', class: "drawer-content" }, index.h("header", { key: '58c9716838a98d57a0f147aed96c7b06d98ac9cf', class: `drawer-header ${inverseHeaderClass} ${drawerDelimiterClass}` }, backIconElement, this.drawerTitle ? (index.h("h2", { class: "drawer-title" }, this.drawerTitle)) : (index.h("div", { class: "drawer-title" }, index.h("slot", { name: "title" }))), closeIconElement), index.h("div", { key: '5d97f008d5514de90fac3c7d6c517882216aee00', class: `drawer-body ${removePaddingClass}` }, index.h("slot", { key: '53a401cd8b6295017d4903e7626d2ab643ad8b26' })), index.h("footer", { key: 'e1c65d15af977b46484d35c6b93def36c3523fdb', class: `drawer-footer ${removePaddingClass}`, hidden: !this.hasFooterContent }, index.h("slot", { key: 'c7b7694a70fb98a9057d5292acbf6bdda42267c5', name: "footer", onSlotchange: this.onFooterSlotChange })))))));
|
|
2071
2072
|
}
|
|
2072
2073
|
get el() { return index.getElement(this); }
|
|
2073
2074
|
static get watchers() { return {
|
|
@@ -19542,6 +19543,8 @@ const Input = class {
|
|
|
19542
19543
|
this.debounce = 0;
|
|
19543
19544
|
this.debouncedRoadChange = this.createDebouncedRoadChange();
|
|
19544
19545
|
this.onInput = (ev) => {
|
|
19546
|
+
if (this.isComposing)
|
|
19547
|
+
return;
|
|
19545
19548
|
const input = ev.target;
|
|
19546
19549
|
let newValue = input.value;
|
|
19547
19550
|
if (this.type === 'number' && this.blockdecimal) {
|
|
@@ -19574,6 +19577,14 @@ const Input = class {
|
|
|
19574
19577
|
this.enforceMinMaxValue();
|
|
19575
19578
|
};
|
|
19576
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
|
+
}
|
|
19577
19588
|
let value = this.getValue();
|
|
19578
19589
|
if (this.type === 'number') {
|
|
19579
19590
|
const minValue = this.min !== undefined ? parseFloat(this.min) : undefined;
|
|
@@ -19607,6 +19618,17 @@ const Input = class {
|
|
|
19607
19618
|
this.onFocus = () => {
|
|
19608
19619
|
this.roadFocus.emit();
|
|
19609
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
|
+
};
|
|
19610
19632
|
}
|
|
19611
19633
|
handleKeyDown(event) {
|
|
19612
19634
|
if (this.type === 'number' && this.blockdecimal) {
|
|
@@ -19670,11 +19692,11 @@ const Input = class {
|
|
|
19670
19692
|
const lessLabelClass = this.label !== '' ? '' : 'less-label';
|
|
19671
19693
|
const isInvalidClass = this.error !== undefined && this.error !== '' ? 'is-invalid' : '';
|
|
19672
19694
|
const isValidClass = this.success == true ? 'is-valid' : '';
|
|
19673
|
-
return (index.h(index.Host, { key: '
|
|
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)
|
|
19674
19696
|
? // Si error est un tableau, on itère et génère un <p> pour chaque élément
|
|
19675
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(), " ")))
|
|
19676
19698
|
: // Si error est une chaîne, on la divise avec split et génère un <p> pour chaque élément
|
|
19677
|
-
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: '
|
|
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" })));
|
|
19678
19700
|
}
|
|
19679
19701
|
static get watchers() { return {
|
|
19680
19702
|
"debounce": ["debounceChanged"],
|