@roadtrip/components 3.33.3 → 3.33.4
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 +18 -2
- package/dist/cjs/road-badge_14.cjs.entry.js.map +1 -1
- package/dist/collection/components/counter/counter.js +17 -1
- package/dist/collection/components/counter/counter.js.map +1 -1
- package/dist/collection/components/drawer/drawer.css +1 -0
- package/dist/esm/road-badge_14.entry.js +18 -2
- package/dist/esm/road-badge_14.entry.js.map +1 -1
- package/dist/roadtrip/{p-a38bdba6.entry.js → p-678b1218.entry.js} +3 -3
- package/dist/roadtrip/p-678b1218.entry.js.map +1 -0
- package/dist/roadtrip/roadtrip.esm.js +1 -1
- package/dist/types/components/counter/counter.d.ts +2 -0
- package/hydrate/index.js +18 -2
- package/hydrate/index.mjs +18 -2
- package/package.json +1 -1
- package/dist/roadtrip/p-a38bdba6.entry.js.map +0 -1
|
@@ -244,8 +244,24 @@ const Counter = class {
|
|
|
244
244
|
componentWillLoad() {
|
|
245
245
|
this.onValueChange(this.value);
|
|
246
246
|
}
|
|
247
|
+
/** Vérifie et applique le `text-indent` si `prepend` est présent */
|
|
248
|
+
updateIndentation() {
|
|
249
|
+
const hasPrepend = !!this.el.querySelector('[slot="prepend"]');
|
|
250
|
+
const formControl = this.el.querySelector('.form-control');
|
|
251
|
+
const formLabel = this.el.querySelector('.form-label');
|
|
252
|
+
if (formControl) {
|
|
253
|
+
formControl.style.textIndent = hasPrepend ? '' : '';
|
|
254
|
+
}
|
|
255
|
+
if (formLabel) {
|
|
256
|
+
formLabel.style.textIndent = hasPrepend ? '' : '';
|
|
257
|
+
}
|
|
258
|
+
}
|
|
247
259
|
componentDidLoad() {
|
|
248
260
|
const buttons = this.el.querySelectorAll('road-button');
|
|
261
|
+
this.updateIndentation(); // Appliquer les styles au montage
|
|
262
|
+
// Observer les mutations (au cas où des éléments sont ajoutés dynamiquement)
|
|
263
|
+
const observer = new MutationObserver(() => this.updateIndentation());
|
|
264
|
+
observer.observe(this.el, { childList: true, subtree: true });
|
|
249
265
|
// Ajouter les événements pour chaque road-button
|
|
250
266
|
buttons.forEach((btn) => {
|
|
251
267
|
btn.addEventListener('touchstart', () => {
|
|
@@ -274,7 +290,7 @@ const Counter = class {
|
|
|
274
290
|
}
|
|
275
291
|
render() {
|
|
276
292
|
const dataCi = this.isDustbinVisible ? "road-dustbin" : "";
|
|
277
|
-
return (index.h("road-input-group", { key: '
|
|
293
|
+
return (index.h("road-input-group", { key: '0f8b1b0a35803e52ba57c371654f65069ee24eb1', class: this.size && `counter-${this.size}` }, index.h("road-button", { key: '769528d0e5b027e1b28cb9ef04b3c8f8c26f34d5', slot: "prepend", size: this.size, onClick: this.decrease, class: this.leftIconClasses, "data-cy": "road-decrease" }, index.h("road-icon", { key: 'fe666f6455a7dfd2f944df71fdac8fb858dc9d56', name: this.isDustbinVisible ? "delete-forever" : "navigation-add-less", ref: (el) => this.iconCounterLess = el, size: this.size, "data-cy": dataCi, role: "button" })), index.h("road-input", { key: '315b93bf129f7ae04138f584f060b1c9d5eac6c9', ref: (el) => this.inputElement = el, type: "number", min: this.min.toString(), max: (this.max && this.max.toString()), step: this.step, value: this.value, onRoadChange: this.onRoadChange, onKeyUp: this.checkValue, "data-cy": "road-input-counter", readonly: this.readonly, label: "Quantit\u00E9" }), index.h("road-button", { key: 'e17851794c015e99c34c8d04bccce046b57bad05', slot: "append", size: this.size, onClick: this.increase, class: this.rightIconClasses, "data-cy": "road-increase" }, index.h("road-icon", { key: 'e0b4898bdb9bab9f48acf38a4a6a2b31520c955d', name: "navigation-add-more", size: this.size, role: "button" }))));
|
|
278
294
|
}
|
|
279
295
|
get el() { return index.getElement(this); }
|
|
280
296
|
static get watchers() { return {
|
|
@@ -284,7 +300,7 @@ const Counter = class {
|
|
|
284
300
|
let counterIds = 0;
|
|
285
301
|
Counter.style = RoadCounterStyle0;
|
|
286
302
|
|
|
287
|
-
const drawerCss = ":host{--background:var(--road-surface);--color:var(--road-on-surface);--header-icon:var(--road-on-surface);--header-color:var(--road-on-surface);--header-background:var(--road-surface);--header-delimiter:0;--back-chevron-color:var(--road-icon);--max-height:auto;--z-index:10;position:fixed;top:0;left:0;z-index:var(--z-index);display:flex;justify-content:flex-start;width:100%;height:100%;overflow:hidden;font-family:var(--road-font, sans-serif);line-height:1.5;color:var(--color);visibility:hidden !important;opacity:0;transition:opacity 0.15s linear, visibility 0.15s}.drawer-overlay{position:absolute;top:0;right:0;bottom:0;left:0;display:block;touch-action:none;cursor:pointer;background:var(--road-overlay)}.drawer-dialog{position:relative;width:100%;pointer-events:none;transition:transform 0.3s ease-out;transform:translateX(-100%)}:host(.drawer-right){justify-content:flex-end}:host(.drawer-right) .drawer-dialog{transform:translateX(100%)}:host(.drawer-bottom){align-items:flex-end}:host(.drawer-bottom) .drawer-dialog{width:100%;max-height:var(--max-height);transform:translateY(100%)}:host(.drawer-bottom) .drawer-content{height:auto}.drawer-content{position:relative;display:flex;flex-direction:column;width:100%;height:100vh;pointer-events:auto;background-color:var(--background);background-clip:padding-box;box-shadow:var(--road-elevation-hight)}.drawer-header{display:flex;flex-shrink:0;align-items:center;justify-content:flex-end;height:3.5rem;color:var(--header-color);background:var(--header-background);border-color:var(--road-grey-300);border-style:solid;border-width:var(--header-delimiter)}.drawer-header road-icon{flex-shrink:0;color:var(--header-icon)}.drawer-footer{padding:var(--road-spacing-05);background-color:var(--road-surface)}.drawer-footer.remove-padding{padding:0}.drawer-header-inverse{--header-icon:var(--road-on-primary);--header-color:var(--road-on-primary);--header-background:var(--road-primary-variant);margin-bottom:2.5rem}.drawer-action,.drawer-close{display:flex;align-items:center;justify-content:center;height:3.5rem;padding:0.5rem;font-family:inherit;font-size:0.875rem;color:inherit;cursor:pointer;background:transparent;border:0;appearance:none;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}.drawer-header:not(.drawer-header-inverse) .drawer-action road-icon{color:var(--back-chevron-color)}.drawer-action~.drawer-title,.drawer-close~.drawer-title{padding-left:0}.drawer-action-left,.drawer-close-left{margin-right:auto}.drawer-title{display:flex;flex-grow:1;align-items:center;justify-content:center;height:3.5rem;padding-left:3.5rem;margin:0;font-size:var(--road-body-medium)}.drawer-body{overflow-y:auto;padding:0 var(--road-spacing-05) var(--road-spacing-05)}.drawer-body.remove-padding{padding:0}:host(.drawer-right) .drawer-body,:host(.drawer-left) .drawer-body{height:calc(100vh - 3.5rem)}.drawer-inner{padding:0 1rem 2.5rem}@media (min-width: 768px){.drawer-inner{padding:0 2rem 2.5rem}.drawer-body{padding:0 var(--road-spacing-08) var(--road-spacing-05)}.drawer-body.remove-padding{padding:0}.drawer-footer{padding:var(--road-spacing-05) var(--road-spacing-08)}.drawer-footer.remove-padding{padding:0}}:host(.drawer-open){visibility:visible !important;opacity:1}:host(.drawer-open) .drawer-dialog{transform:none}";
|
|
303
|
+
const drawerCss = ":host{--background:var(--road-surface);--color:var(--road-on-surface);--header-icon:var(--road-on-surface);--header-color:var(--road-on-surface);--header-background:var(--road-surface);--header-delimiter:0;--back-chevron-color:var(--road-icon);--max-height:auto;--z-index:10;position:fixed;top:0;left:0;z-index:var(--z-index);display:flex;justify-content:flex-start;width:100%;height:100%;overflow:hidden;font-family:var(--road-font, sans-serif);line-height:1.5;color:var(--color);visibility:hidden !important;opacity:0;transition:opacity 0.15s linear, visibility 0.15s}.drawer-overlay{position:absolute;top:0;right:0;bottom:0;left:0;display:block;touch-action:none;cursor:pointer;background:var(--road-overlay)}.drawer-dialog{position:relative;width:100%;pointer-events:none;transition:transform 0.3s ease-out;transform:translateX(-100%)}:host(.drawer-right){justify-content:flex-end}:host(.drawer-right) .drawer-dialog{transform:translateX(100%)}:host(.drawer-bottom){align-items:flex-end}:host(.drawer-bottom) .drawer-dialog{width:100%;max-height:var(--max-height);transform:translateY(100%)}:host(.drawer-bottom) .drawer-content{height:auto}.drawer-content{position:relative;display:flex;flex-direction:column;width:100%;height:100vh;max-height:100vh;pointer-events:auto;background-color:var(--background);background-clip:padding-box;box-shadow:var(--road-elevation-hight)}.drawer-header{display:flex;flex-shrink:0;align-items:center;justify-content:flex-end;height:3.5rem;color:var(--header-color);background:var(--header-background);border-color:var(--road-grey-300);border-style:solid;border-width:var(--header-delimiter)}.drawer-header road-icon{flex-shrink:0;color:var(--header-icon)}.drawer-footer{padding:var(--road-spacing-05);background-color:var(--road-surface)}.drawer-footer.remove-padding{padding:0}.drawer-header-inverse{--header-icon:var(--road-on-primary);--header-color:var(--road-on-primary);--header-background:var(--road-primary-variant);margin-bottom:2.5rem}.drawer-action,.drawer-close{display:flex;align-items:center;justify-content:center;height:3.5rem;padding:0.5rem;font-family:inherit;font-size:0.875rem;color:inherit;cursor:pointer;background:transparent;border:0;appearance:none;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}.drawer-header:not(.drawer-header-inverse) .drawer-action road-icon{color:var(--back-chevron-color)}.drawer-action~.drawer-title,.drawer-close~.drawer-title{padding-left:0}.drawer-action-left,.drawer-close-left{margin-right:auto}.drawer-title{display:flex;flex-grow:1;align-items:center;justify-content:center;height:3.5rem;padding-left:3.5rem;margin:0;font-size:var(--road-body-medium)}.drawer-body{overflow-y:auto;padding:0 var(--road-spacing-05) var(--road-spacing-05)}.drawer-body.remove-padding{padding:0}:host(.drawer-right) .drawer-body,:host(.drawer-left) .drawer-body{height:calc(100vh - 3.5rem)}.drawer-inner{padding:0 1rem 2.5rem}@media (min-width: 768px){.drawer-inner{padding:0 2rem 2.5rem}.drawer-body{padding:0 var(--road-spacing-08) var(--road-spacing-05)}.drawer-body.remove-padding{padding:0}.drawer-footer{padding:var(--road-spacing-05) var(--road-spacing-08)}.drawer-footer.remove-padding{padding:0}}:host(.drawer-open){visibility:visible !important;opacity:1}:host(.drawer-open) .drawer-dialog{transform:none}";
|
|
288
304
|
const RoadDrawerStyle0 = drawerCss;
|
|
289
305
|
|
|
290
306
|
const Drawer = class {
|