@roadtrip/components 3.32.1 → 3.32.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/{index-aadb3ac9.js → index-fee0103c.js} +253 -158
- package/dist/cjs/index-fee0103c.js.map +1 -0
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/road-accordion.cjs.entry.js +1 -1
- package/dist/cjs/road-alert.cjs.entry.js +1 -1
- package/dist/cjs/road-area-code.cjs.entry.js +1 -1
- package/dist/cjs/road-asset.cjs.entry.js +2 -2
- package/dist/cjs/road-autocomplete.cjs.entry.js +1 -1
- package/dist/cjs/road-avatar.cjs.entry.js +1 -1
- package/dist/cjs/road-badge_14.cjs.entry.js +14 -12
- package/dist/cjs/road-badge_14.cjs.entry.js.map +1 -1
- package/dist/cjs/road-banner.cjs.entry.js +1 -1
- package/dist/cjs/road-button-floating.cjs.entry.js +1 -1
- package/dist/cjs/road-card.cjs.entry.js +1 -1
- package/dist/cjs/road-carousel-item.cjs.entry.js +1 -1
- package/dist/cjs/road-carousel.cjs.entry.js +1 -1
- package/dist/cjs/road-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/road-chip.cjs.entry.js +1 -1
- package/dist/cjs/road-collapse.cjs.entry.js +1 -1
- package/dist/cjs/road-content-card.cjs.entry.js +1 -1
- package/dist/cjs/road-dialog.cjs.entry.js +1 -1
- package/dist/cjs/road-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/road-duration.cjs.entry.js +1 -1
- package/dist/cjs/road-flap.cjs.entry.js +1 -1
- package/dist/cjs/road-global-navigation-v2.cjs.entry.js +1 -1
- package/dist/cjs/road-global-navigation.cjs.entry.js +1 -1
- package/dist/cjs/road-illustration.cjs.entry.js +2 -2
- package/dist/cjs/road-img.cjs.entry.js +1 -1
- package/dist/cjs/road-modal.cjs.entry.js +1 -1
- package/dist/cjs/road-navbar-item-v2.cjs.entry.js +1 -1
- package/dist/cjs/road-navbar-item.cjs.entry.js +1 -1
- package/dist/cjs/road-navbar-v2.cjs.entry.js +1 -1
- package/dist/cjs/road-navbar.cjs.entry.js +1 -1
- package/dist/cjs/road-phone-number-input.cjs.entry.js +1 -1
- package/dist/cjs/road-plate-number.cjs.entry.js +1 -1
- package/dist/cjs/road-profil-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/road-progress-indicator-horizontal.cjs.entry.js +1 -1
- package/dist/cjs/road-progress-indicator-vertical-item.cjs.entry.js +1 -1
- package/dist/cjs/road-progress-indicator-vertical.cjs.entry.js +1 -1
- package/dist/cjs/road-progress-tracker-item.cjs.entry.js +1 -1
- package/dist/cjs/road-progress-tracker.cjs.entry.js +1 -1
- package/dist/cjs/road-progress.cjs.entry.js +1 -1
- package/dist/cjs/road-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/road-radio.cjs.entry.js +1 -1
- package/dist/cjs/road-range.cjs.entry.js +1 -1
- package/dist/cjs/road-rating.cjs.entry.js +1 -1
- package/dist/cjs/road-segmented-button-bar.cjs.entry.js +1 -1
- package/dist/cjs/road-segmented-button.cjs.entry.js +1 -1
- package/dist/cjs/road-segmented-buttons.cjs.entry.js +1 -1
- package/dist/cjs/road-select-filter.cjs.entry.js +1 -1
- package/dist/cjs/road-select.cjs.entry.js +1 -1
- package/dist/cjs/road-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/road-spinner.cjs.entry.js +1 -1
- package/dist/cjs/road-switch.cjs.entry.js +1 -1
- package/dist/cjs/road-tab-bar.cjs.entry.js +1 -1
- package/dist/cjs/road-tab-button.cjs.entry.js +1 -1
- package/dist/cjs/road-tab.cjs.entry.js +1 -1
- package/dist/cjs/road-table.cjs.entry.js +1 -1
- package/dist/cjs/road-tabs.cjs.entry.js +1 -1
- package/dist/cjs/road-tag.cjs.entry.js +1 -1
- package/dist/cjs/road-text.cjs.entry.js +1 -1
- package/dist/cjs/road-textarea.cjs.entry.js +1 -1
- package/dist/cjs/road-toast.cjs.entry.js +1 -1
- package/dist/cjs/road-toggle.cjs.entry.js +1 -1
- package/dist/cjs/road-toolbar-title-page.cjs.entry.js +1 -1
- package/dist/cjs/road-toolbar-title.cjs.entry.js +1 -1
- package/dist/cjs/road-toolbar-v2.cjs.entry.js +1 -1
- package/dist/cjs/road-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/roadtrip.cjs.js +3 -3
- package/dist/cjs/roadtrip.cjs.js.map +1 -1
- package/dist/cjs/{utils-e0016ab3.js → utils-3baff577.js} +2 -2
- package/dist/cjs/{utils-e0016ab3.js.map → utils-3baff577.js.map} +1 -1
- package/dist/cjs/{utils-25752683.js → utils-9c190d4e.js} +2 -2
- package/dist/cjs/{utils-25752683.js.map → utils-9c190d4e.js.map} +1 -1
- package/dist/cjs/{utils-11a0a9e6.js → utils-e8a9cb28.js} +2 -2
- package/dist/cjs/{utils-11a0a9e6.js.map → utils-e8a9cb28.js.map} +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/accordion/accordion.stories.js +2 -1
- package/dist/collection/components/alert/alert.stories.js +1 -1
- package/dist/collection/components/asset/asset.stories.js +1 -1
- package/dist/collection/components/autocomplete/autocomplete.stories.js +1 -1
- package/dist/collection/components/avatar/avatar.stories.js +1 -1
- package/dist/collection/components/badge/badge.stories.js +1 -1
- package/dist/collection/components/banner/banner.stories.js +1 -1
- package/dist/collection/components/button/button.js +1 -1
- package/dist/collection/components/button/button.js.map +1 -1
- package/dist/collection/components/button/button.stories.js +1 -1
- package/dist/collection/components/button-floating/button-floating.stories.js +1 -1
- package/dist/collection/components/card/card.stories.js +1 -1
- package/dist/collection/components/carousel/carousel.stories.js +1 -1
- package/dist/collection/components/checkbox/checkbox.stories.js +1 -1
- package/dist/collection/components/chip/chip.stories.js +1 -1
- package/dist/collection/components/collapse/collapse.stories.js +1 -1
- package/dist/collection/components/content-card/content-card.stories.js +1 -1
- package/dist/collection/components/counter/counter.stories.js +1 -1
- package/dist/collection/components/dialog/dialog.stories.js +1 -1
- package/dist/collection/components/drawer/drawer.stories.js +1 -1
- package/dist/collection/components/dropdown/dropdown.stories.js +1 -1
- package/dist/collection/components/duration/duration.stories.js +1 -1
- package/dist/collection/components/flap/flap.stories.js +1 -1
- package/dist/collection/components/global-navigation/global-navigation.stories.js +1 -1
- package/dist/collection/components/global-navigation-v2/global-navigation-v2.stories.js +1 -1
- package/dist/collection/components/grid/grid.stories.js +1 -1
- package/dist/collection/components/icon/icon.js +7 -5
- package/dist/collection/components/icon/icon.js.map +1 -1
- package/dist/collection/components/icon/icon.stories.js +1 -1
- package/dist/collection/components/illustration/illustration.stories.js +1 -1
- package/dist/collection/components/img/img.stories.js +1 -1
- package/dist/collection/components/input/input.js +6 -6
- package/dist/collection/components/input/input.js.map +1 -1
- package/dist/collection/components/input/input.stories.js +6 -1
- package/dist/collection/components/input-group/input-group.stories.js +1 -1
- package/dist/collection/components/item/item.stories.js +1 -1
- package/dist/collection/components/list/list.stories.js +1 -1
- package/dist/collection/components/modal/modal.stories.js +1 -1
- package/dist/collection/components/navbar/navbar.stories.js +1 -1
- package/dist/collection/components/navbar-v2/navbar-v2.stories.js +1 -1
- package/dist/collection/components/patterns/breadcrumb.stories.js +1 -1
- package/dist/collection/components/patterns/crossselling.stories.js +1 -1
- package/dist/collection/components/patterns/filter.stories.js +1 -1
- package/dist/collection/components/patterns/link.stories.js +1 -1
- package/dist/collection/components/phone-number-input/phone-number-input.stories.js +1 -1
- package/dist/collection/components/plate-number/plate-number.stories.js +1 -1
- package/dist/collection/components/profil-dropdown/profil-dropdown.stories.js +1 -1
- package/dist/collection/components/progress/progress.stories.js +1 -1
- package/dist/collection/components/progress-indicator-horizontal/progress-indicator-horizontal.stories.js +1 -1
- package/dist/collection/components/progress-indicator-vertical/progress-indicator-vertical.stories.js +1 -1
- package/dist/collection/components/progress-tracker/progress-tracker.stories.js +1 -1
- package/dist/collection/components/radio/radio.stories.js +1 -1
- package/dist/collection/components/range/range.stories.js +1 -1
- package/dist/collection/components/rating/rating.stories.js +1 -1
- package/dist/collection/components/segmented-buttons/segmented-buttons.stories.js +1 -1
- package/dist/collection/components/select/select.stories.js +1 -1
- package/dist/collection/components/select-filter/select-filter.stories.js +1 -1
- package/dist/collection/components/skeleton/skeleton.stories.js +1 -1
- package/dist/collection/components/spinner/spinner.stories.js +1 -1
- package/dist/collection/components/table/table.stories.js +1 -1
- package/dist/collection/components/tabs/tabs.stories.js +1 -1
- package/dist/collection/components/tag/tag.stories.js +1 -1
- package/dist/collection/components/text/text.stories.js +1 -1
- package/dist/collection/components/textarea/textarea.stories.js +1 -1
- package/dist/collection/components/toast/toast.stories.js +1 -1
- package/dist/collection/components/toggle/toggle.stories.js +1 -1
- package/dist/collection/components/toolbar/toolbar.stories.js +1 -1
- package/dist/collection/components/toolbar-v2/toolbar-v2.stories.js +1 -1
- package/dist/collection/components/tooltip/tooltip.stories.js +1 -1
- package/dist/collection/components/utilities/border.stories.js +1 -1
- package/dist/collection/components/utilities/color.stories.js +1 -1
- package/dist/collection/components/utilities/flexbox.stories.js +1 -1
- package/dist/collection/components/utilities/text.stories.js +1 -1
- package/dist/collection/components/utilities/typography.stories.js +1 -1
- package/dist/esm/{index-f3c5b68e.js → index-8dc34f94.js} +253 -158
- package/dist/esm/index-8dc34f94.js.map +1 -0
- package/dist/esm/index.js +4 -4
- package/dist/esm/loader.js +3 -3
- package/dist/esm/road-accordion.entry.js +1 -1
- package/dist/esm/road-alert.entry.js +1 -1
- package/dist/esm/road-area-code.entry.js +1 -1
- package/dist/esm/road-asset.entry.js +2 -2
- package/dist/esm/road-autocomplete.entry.js +1 -1
- package/dist/esm/road-avatar.entry.js +1 -1
- package/dist/esm/road-badge_14.entry.js +14 -12
- package/dist/esm/road-badge_14.entry.js.map +1 -1
- package/dist/esm/road-banner.entry.js +1 -1
- package/dist/esm/road-button-floating.entry.js +1 -1
- package/dist/esm/road-card.entry.js +1 -1
- package/dist/esm/road-carousel-item.entry.js +1 -1
- package/dist/esm/road-carousel.entry.js +1 -1
- package/dist/esm/road-checkbox.entry.js +1 -1
- package/dist/esm/road-chip.entry.js +1 -1
- package/dist/esm/road-collapse.entry.js +1 -1
- package/dist/esm/road-content-card.entry.js +1 -1
- package/dist/esm/road-dialog.entry.js +1 -1
- package/dist/esm/road-dropdown.entry.js +1 -1
- package/dist/esm/road-duration.entry.js +1 -1
- package/dist/esm/road-flap.entry.js +1 -1
- package/dist/esm/road-global-navigation-v2.entry.js +1 -1
- package/dist/esm/road-global-navigation.entry.js +1 -1
- package/dist/esm/road-illustration.entry.js +2 -2
- package/dist/esm/road-img.entry.js +1 -1
- package/dist/esm/road-modal.entry.js +1 -1
- package/dist/esm/road-navbar-item-v2.entry.js +1 -1
- package/dist/esm/road-navbar-item.entry.js +1 -1
- package/dist/esm/road-navbar-v2.entry.js +1 -1
- package/dist/esm/road-navbar.entry.js +1 -1
- package/dist/esm/road-phone-number-input.entry.js +1 -1
- package/dist/esm/road-plate-number.entry.js +1 -1
- package/dist/esm/road-profil-dropdown.entry.js +1 -1
- package/dist/esm/road-progress-indicator-horizontal.entry.js +1 -1
- package/dist/esm/road-progress-indicator-vertical-item.entry.js +1 -1
- package/dist/esm/road-progress-indicator-vertical.entry.js +1 -1
- package/dist/esm/road-progress-tracker-item.entry.js +1 -1
- package/dist/esm/road-progress-tracker.entry.js +1 -1
- package/dist/esm/road-progress.entry.js +1 -1
- package/dist/esm/road-radio-group.entry.js +1 -1
- package/dist/esm/road-radio.entry.js +1 -1
- package/dist/esm/road-range.entry.js +1 -1
- package/dist/esm/road-rating.entry.js +1 -1
- package/dist/esm/road-segmented-button-bar.entry.js +1 -1
- package/dist/esm/road-segmented-button.entry.js +1 -1
- package/dist/esm/road-segmented-buttons.entry.js +1 -1
- package/dist/esm/road-select-filter.entry.js +1 -1
- package/dist/esm/road-select.entry.js +1 -1
- package/dist/esm/road-skeleton.entry.js +1 -1
- package/dist/esm/road-spinner.entry.js +1 -1
- package/dist/esm/road-switch.entry.js +1 -1
- package/dist/esm/road-tab-bar.entry.js +1 -1
- package/dist/esm/road-tab-button.entry.js +1 -1
- package/dist/esm/road-tab.entry.js +1 -1
- package/dist/esm/road-table.entry.js +1 -1
- package/dist/esm/road-tabs.entry.js +1 -1
- package/dist/esm/road-tag.entry.js +1 -1
- package/dist/esm/road-text.entry.js +1 -1
- package/dist/esm/road-textarea.entry.js +1 -1
- package/dist/esm/road-toast.entry.js +1 -1
- package/dist/esm/road-toggle.entry.js +1 -1
- package/dist/esm/road-toolbar-title-page.entry.js +1 -1
- package/dist/esm/road-toolbar-title.entry.js +1 -1
- package/dist/esm/road-toolbar-v2.entry.js +1 -1
- package/dist/esm/road-tooltip.entry.js +1 -1
- package/dist/esm/roadtrip.js +4 -4
- package/dist/esm/roadtrip.js.map +1 -1
- package/dist/esm/{utils-65e8eef3.js → utils-2656386e.js} +2 -2
- package/dist/esm/{utils-65e8eef3.js.map → utils-2656386e.js.map} +1 -1
- package/dist/esm/{utils-d3cec86c.js → utils-3ba26df8.js} +2 -2
- package/dist/esm/{utils-d3cec86c.js.map → utils-3ba26df8.js.map} +1 -1
- package/dist/esm/{utils-8148deff.js → utils-e88238c5.js} +2 -2
- package/dist/esm/{utils-8148deff.js.map → utils-e88238c5.js.map} +1 -1
- package/dist/html.html-data.json +1 -1
- package/dist/roadtrip/index.esm.js +1 -1
- package/dist/roadtrip/{p-4b2920f6.entry.js → p-01be5517.entry.js} +2 -2
- package/dist/roadtrip/{p-18db551b.entry.js → p-03656f9a.entry.js} +2 -2
- package/dist/roadtrip/{p-9e7807f4.entry.js → p-07217e78.entry.js} +2 -2
- package/dist/roadtrip/{p-dac4736d.entry.js → p-0cacf829.entry.js} +2 -2
- package/dist/roadtrip/{p-3c567881.entry.js → p-10e65612.entry.js} +2 -2
- package/dist/roadtrip/{p-b18add2d.entry.js → p-14e42c8d.entry.js} +2 -2
- package/dist/roadtrip/{p-b85b7e2b.entry.js → p-1e61ca1f.entry.js} +2 -2
- package/dist/roadtrip/{p-1e73c3ce.entry.js → p-2301f208.entry.js} +2 -2
- package/dist/roadtrip/{p-6709e3f4.entry.js → p-233b3f06.entry.js} +2 -2
- package/dist/roadtrip/{p-6e822465.entry.js → p-2903bdc0.entry.js} +2 -2
- package/dist/roadtrip/{p-c8438d35.entry.js → p-2a4a0928.entry.js} +2 -2
- package/dist/roadtrip/{p-71769ef4.entry.js → p-2caa518b.entry.js} +2 -2
- package/dist/roadtrip/{p-d9195195.js → p-31b0c1df.js} +2 -2
- package/dist/roadtrip/{p-4a14e21e.entry.js → p-32845e72.entry.js} +2 -2
- package/dist/roadtrip/{p-5dfc9c10.entry.js → p-3f478922.entry.js} +2 -2
- package/dist/roadtrip/{p-2e26072a.entry.js → p-427bd935.entry.js} +2 -2
- package/dist/roadtrip/{p-1fd97505.entry.js → p-443187de.entry.js} +2 -2
- package/dist/roadtrip/{p-b55e3657.entry.js → p-456e1ffe.entry.js} +2 -2
- package/dist/roadtrip/{p-98fdbcfb.entry.js → p-494aab48.entry.js} +2 -2
- package/dist/roadtrip/{p-eec578a2.entry.js → p-4a47999a.entry.js} +2 -2
- package/dist/roadtrip/{p-0801cc18.entry.js → p-4a81230f.entry.js} +2 -2
- package/dist/roadtrip/{p-4ad903fe.js → p-4b2ba695.js} +2 -2
- package/dist/roadtrip/p-4bbc889b.entry.js +2 -0
- package/dist/roadtrip/{p-c4ffc419.entry.js.map → p-4bbc889b.entry.js.map} +1 -1
- package/dist/roadtrip/{p-23142511.entry.js → p-4e779fd6.entry.js} +2 -2
- package/dist/roadtrip/{p-a8b369c3.entry.js → p-517aeeca.entry.js} +2 -2
- package/dist/roadtrip/{p-37135c95.entry.js → p-5a6fbd7f.entry.js} +2 -2
- package/dist/roadtrip/{p-7684978a.entry.js → p-5fab1bc3.entry.js} +2 -2
- package/dist/roadtrip/{p-668553e9.entry.js → p-64ec0508.entry.js} +2 -2
- package/dist/roadtrip/{p-44b6f632.entry.js → p-733a80a1.entry.js} +2 -2
- package/dist/roadtrip/{p-f155064c.entry.js → p-78b51033.entry.js} +2 -2
- package/dist/roadtrip/{p-cff73fff.entry.js → p-7bb1dbc4.entry.js} +2 -2
- package/dist/roadtrip/{p-c5b01dda.entry.js → p-833c1e78.entry.js} +2 -2
- package/dist/roadtrip/{p-38ab0443.js → p-84c28ebc.js} +2 -2
- package/dist/roadtrip/{p-d8dcd2d2.entry.js → p-87c1ff76.entry.js} +2 -2
- package/dist/roadtrip/{p-79acc6ae.entry.js → p-8ca23318.entry.js} +2 -2
- package/dist/roadtrip/{p-05088511.entry.js → p-8f7375bc.entry.js} +2 -2
- package/dist/roadtrip/{p-aa2721e5.entry.js → p-9737182c.entry.js} +2 -2
- package/dist/roadtrip/{p-00c5b2d9.entry.js → p-9fce16aa.entry.js} +2 -2
- package/dist/roadtrip/{p-200d5c89.entry.js → p-a0a95c0a.entry.js} +2 -2
- package/dist/roadtrip/{p-ad43e5f0.entry.js → p-a254df6d.entry.js} +2 -2
- package/dist/roadtrip/{p-d6867247.entry.js → p-a8cfee66.entry.js} +2 -2
- package/dist/roadtrip/{p-c70a6f75.entry.js → p-a925ff64.entry.js} +2 -2
- package/dist/roadtrip/{p-3750f911.entry.js → p-a990a8b6.entry.js} +2 -2
- package/dist/roadtrip/{p-52f26ae9.entry.js → p-abe3e334.entry.js} +2 -2
- package/dist/roadtrip/{p-4de6e537.entry.js → p-adf7d473.entry.js} +2 -2
- package/dist/roadtrip/{p-eabdd6ce.entry.js → p-b0b18e60.entry.js} +2 -2
- package/dist/roadtrip/{p-484f7c99.entry.js → p-b18cda16.entry.js} +2 -2
- package/dist/roadtrip/{p-504c0354.entry.js → p-b7dc61c8.entry.js} +2 -2
- package/dist/roadtrip/{p-848de0f1.entry.js → p-bba18327.entry.js} +2 -2
- package/dist/roadtrip/{p-d8ff2277.entry.js → p-c1e2aa67.entry.js} +2 -2
- package/dist/roadtrip/{p-6fc769fc.entry.js → p-c30a1032.entry.js} +2 -2
- package/dist/roadtrip/{p-63582e9c.entry.js → p-c3ef32ef.entry.js} +2 -2
- package/dist/roadtrip/{p-908e3634.entry.js → p-c465f551.entry.js} +2 -2
- package/dist/roadtrip/{p-698abbdb.entry.js → p-c62b9df1.entry.js} +2 -2
- package/dist/roadtrip/{p-4dc8a165.entry.js → p-c68fc795.entry.js} +2 -2
- package/dist/roadtrip/{p-c8ea6b4e.entry.js → p-cda925e3.entry.js} +2 -2
- package/dist/roadtrip/{p-3823247f.entry.js → p-cffedeca.entry.js} +2 -2
- package/dist/roadtrip/{p-4688d888.entry.js → p-d4089fb9.entry.js} +2 -2
- package/dist/roadtrip/{p-6dfdd9e2.entry.js → p-d68e64a8.entry.js} +2 -2
- package/dist/roadtrip/p-d7aae05d.js +3 -0
- package/dist/roadtrip/p-d7aae05d.js.map +1 -0
- package/dist/roadtrip/p-db243855.entry.js +2 -0
- package/dist/roadtrip/{p-f9c66715.entry.js.map → p-db243855.entry.js.map} +1 -1
- package/dist/roadtrip/{p-c1fc3902.entry.js → p-e0421465.entry.js} +2 -2
- package/dist/roadtrip/{p-b4ba1b47.entry.js → p-e2a00f9c.entry.js} +3 -3
- package/dist/roadtrip/p-e2a00f9c.entry.js.map +1 -0
- package/dist/roadtrip/{p-bb33c1b5.entry.js → p-edbbe884.entry.js} +2 -2
- package/dist/roadtrip/p-ee92b78d.entry.js +2 -0
- package/dist/roadtrip/{p-30d74a80.entry.js → p-f8817c0e.entry.js} +2 -2
- package/dist/roadtrip/{p-0236ce0a.entry.js → p-f9754547.entry.js} +2 -2
- package/dist/roadtrip/{p-43335414.entry.js → p-fb26ed7e.entry.js} +2 -2
- package/dist/roadtrip/roadtrip.esm.js +1 -1
- package/dist/roadtrip/roadtrip.esm.js.map +1 -1
- package/dist/types/components/input/input.d.ts +1 -1
- package/dist/types/components.d.ts +724 -2
- package/hydrate/index.d.ts +22 -5
- package/hydrate/index.js +783 -293
- package/hydrate/index.mjs +783 -293
- package/package.json +16 -17
- package/dist/cjs/index-aadb3ac9.js.map +0 -1
- package/dist/esm/index-f3c5b68e.js.map +0 -1
- package/dist/roadtrip/p-763109be.js +0 -3
- package/dist/roadtrip/p-763109be.js.map +0 -1
- package/dist/roadtrip/p-a1ea2f84.entry.js +0 -2
- package/dist/roadtrip/p-b4ba1b47.entry.js.map +0 -1
- package/dist/roadtrip/p-c4ffc419.entry.js +0 -2
- package/dist/roadtrip/p-f9c66715.entry.js +0 -2
- /package/dist/roadtrip/{p-4b2920f6.entry.js.map → p-01be5517.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-18db551b.entry.js.map → p-03656f9a.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-9e7807f4.entry.js.map → p-07217e78.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-dac4736d.entry.js.map → p-0cacf829.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-3c567881.entry.js.map → p-10e65612.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-b18add2d.entry.js.map → p-14e42c8d.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-b85b7e2b.entry.js.map → p-1e61ca1f.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-1e73c3ce.entry.js.map → p-2301f208.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-6709e3f4.entry.js.map → p-233b3f06.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-6e822465.entry.js.map → p-2903bdc0.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-c8438d35.entry.js.map → p-2a4a0928.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-71769ef4.entry.js.map → p-2caa518b.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-d9195195.js.map → p-31b0c1df.js.map} +0 -0
- /package/dist/roadtrip/{p-4a14e21e.entry.js.map → p-32845e72.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-5dfc9c10.entry.js.map → p-3f478922.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-2e26072a.entry.js.map → p-427bd935.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-1fd97505.entry.js.map → p-443187de.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-b55e3657.entry.js.map → p-456e1ffe.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-98fdbcfb.entry.js.map → p-494aab48.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-eec578a2.entry.js.map → p-4a47999a.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-0801cc18.entry.js.map → p-4a81230f.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-4ad903fe.js.map → p-4b2ba695.js.map} +0 -0
- /package/dist/roadtrip/{p-23142511.entry.js.map → p-4e779fd6.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-a8b369c3.entry.js.map → p-517aeeca.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-37135c95.entry.js.map → p-5a6fbd7f.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-7684978a.entry.js.map → p-5fab1bc3.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-668553e9.entry.js.map → p-64ec0508.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-44b6f632.entry.js.map → p-733a80a1.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-f155064c.entry.js.map → p-78b51033.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-cff73fff.entry.js.map → p-7bb1dbc4.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-c5b01dda.entry.js.map → p-833c1e78.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-38ab0443.js.map → p-84c28ebc.js.map} +0 -0
- /package/dist/roadtrip/{p-d8dcd2d2.entry.js.map → p-87c1ff76.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-79acc6ae.entry.js.map → p-8ca23318.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-05088511.entry.js.map → p-8f7375bc.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-aa2721e5.entry.js.map → p-9737182c.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-00c5b2d9.entry.js.map → p-9fce16aa.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-200d5c89.entry.js.map → p-a0a95c0a.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-ad43e5f0.entry.js.map → p-a254df6d.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-d6867247.entry.js.map → p-a8cfee66.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-c70a6f75.entry.js.map → p-a925ff64.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-3750f911.entry.js.map → p-a990a8b6.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-52f26ae9.entry.js.map → p-abe3e334.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-4de6e537.entry.js.map → p-adf7d473.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-eabdd6ce.entry.js.map → p-b0b18e60.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-484f7c99.entry.js.map → p-b18cda16.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-504c0354.entry.js.map → p-b7dc61c8.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-848de0f1.entry.js.map → p-bba18327.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-d8ff2277.entry.js.map → p-c1e2aa67.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-6fc769fc.entry.js.map → p-c30a1032.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-63582e9c.entry.js.map → p-c3ef32ef.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-908e3634.entry.js.map → p-c465f551.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-698abbdb.entry.js.map → p-c62b9df1.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-4dc8a165.entry.js.map → p-c68fc795.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-c8ea6b4e.entry.js.map → p-cda925e3.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-3823247f.entry.js.map → p-cffedeca.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-4688d888.entry.js.map → p-d4089fb9.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-6dfdd9e2.entry.js.map → p-d68e64a8.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-c1fc3902.entry.js.map → p-e0421465.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-bb33c1b5.entry.js.map → p-edbbe884.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-a1ea2f84.entry.js.map → p-ee92b78d.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-30d74a80.entry.js.map → p-f8817c0e.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-0236ce0a.entry.js.map → p-f9754547.entry.js.map} +0 -0
- /package/dist/roadtrip/{p-43335414.entry.js.map → p-fb26ed7e.entry.js.map} +0 -0
|
@@ -74,12 +74,14 @@ export class Icon {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
render() {
|
|
77
|
-
const colorClass = this.color
|
|
78
|
-
const sizeClass = this.size
|
|
79
|
-
const rotateClass = this.rotate
|
|
80
|
-
|
|
77
|
+
const colorClass = this.color ? `icon-${this.color}` : '';
|
|
78
|
+
const sizeClass = this.size ? `icon-${this.size}` : '';
|
|
79
|
+
const rotateClass = this.rotate ? `icon-rotate-${this.rotate}` : '';
|
|
80
|
+
// Ajouter une classe "default" si aucune des valeurs n'est définie
|
|
81
|
+
const classes = [colorClass, sizeClass, rotateClass].filter(Boolean).join(' ');
|
|
82
|
+
return (h(Host, { key: '1da1702db901bcfb80638d9ae30a8c5cc4a2ac26', class: classes, "aria-hidden": "true" }, this.svgContent !== ''
|
|
81
83
|
? h("div", { class: "icon-inner", innerHTML: this.svgContent })
|
|
82
|
-
: h("div", { class: "icon-inner" })))
|
|
84
|
+
: h("div", { class: "icon-inner" })));
|
|
83
85
|
}
|
|
84
86
|
static get is() { return "road-icon"; }
|
|
85
87
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../src/components/icon/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Build, Component, Element, Host, Prop, State, Watch, h } from '@stencil/core';\nimport { getSvgContent, roadiconContent } from './request';\nimport { getName, getUrl } from './utils';\n\nimport { Color } from '../../interface';\n\n@Component({\n tag: 'road-icon',\n assetsDirs: ['svg'],\n styleUrl: 'icon.css',\n shadow: true,\n})\nexport class Icon {\n private io?: IntersectionObserver;\n\n @Element() el!: HTMLRoadIconElement;\n\n @State() private svgContent?: string;\n\n @State() private isVisible = false;\n\n /**\n * Color of the icon\n */\n @Prop() color?: Color | 'white';\n\n /**\n * Specifies the label to use for accessibility. Defaults to the icon name.\n */\n @Prop({ mutable: true, reflect: true }) ariaLabel?: string;\n\n /**\n * Set the icon to hidden, respectively `true`, to remove it from the accessibility tree.\n */\n @Prop({ reflect: true }) ariaHidden?: string;\n\n /**\n * Specifies which icon to use from the built-in set of icons.\n */\n @Prop() name?: string;\n\n /**\n * Specifies the exact `src` of an SVG file to use.\n */\n @Prop() src?: string;\n\n /**\n * A combination of both `name` and `src`. If a `src` url is detected\n * it will set the `src` property. Otherwise it assumes it's a built-in named\n * SVG and set the `name` property.\n */\n @Prop() icon?: any;\n\n /**\n * The size of the icon.\n * Available options are: `\"sm\"`, `\"md\"`, `\"lg\"`, `\"3x\"` and `\"4x\"`.\n */\n @Prop() size?: 'sm' | 'md' | 'lg' | '3x' | '4x' = \"lg\";\n\n /**\n * The rotation of the icon.\n * Available options are: `\"90\"`, `\"180\"`, `\"270\"`.\n */\n @Prop() rotate?: '90' | '180' | '270';\n\n /**\n * If enabled, road-icon will be loaded lazily when it's visible in the viewport.\n * Default, `false`.\n */\n @Prop() lazy: boolean = false;\n\n /**\n * When set to `false`, SVG content that is HTTP fetched will not be checked\n * if the response SVG content has any `<script>` elements, or any attributes\n * that start with `on`, such as `onclick`.\n */\n @Prop() sanitize = true;\n\n componentWillLoad() {\n\n this.waitUntilVisible(this.el, '50px', () => {\n this.isVisible = true;\n this.loadIcon();\n });\n }\n\n disconnectedCallback() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n }\n\n private waitUntilVisible(el: HTMLRoadIconElement, rootMargin: string, cb: () => void) {\n if (this.lazy && (window as any).IntersectionObserver) {\n const io = this.io = new (window as any).IntersectionObserver((data: IntersectionObserverEntry[]) => {\n if (data[0].isIntersecting) {\n io.disconnect();\n this.io = undefined;\n cb();\n }\n }, { rootMargin });\n\n io.observe(el);\n\n } else {\n // browser doesn't support IntersectionObserver\n // so just fallback to always show it\n cb();\n }\n }\n\n @Watch('name')\n @Watch('src')\n @Watch('icon')\n loadIcon() {\n if (Build.isBrowser && this.isVisible) {\n const url = getUrl(this);\n if (url) {\n if (roadiconContent.has(url)) {\n // sync if it's already loaded\n this.svgContent = roadiconContent.get(url);\n } else {\n // async if it hasn't been loaded\n getSvgContent(url, this.sanitize).then(() => (this.svgContent = roadiconContent.get(url)));\n }\n }\n }\n\n if (!this.ariaLabel && this.ariaHidden !== 'true') {\n const label = getName(this.name, this.icon);\n // user did not provide a label\n // come up with the label based on the icon name\n if (label) {\n this.ariaLabel = label.replace(/-/g, ' ');\n }\n }\n }\n\n render() {\n const colorClass = this.color ? `icon-${this.color}` : '';\n const sizeClass = this.size ? `icon-${this.size}` : '';\n const rotateClass = this.rotate ? `icon-rotate-${this.rotate}` : '';\n\n // Ajouter une classe \"default\" si aucune des valeurs n'est définie\n const classes = [colorClass, sizeClass, rotateClass].filter(Boolean).join(' ');\n\n return (\n <Host class={classes} aria-hidden=\"true\">\n {this.svgContent !== ''\n ? <div class=\"icon-inner\" innerHTML={this.svgContent}></div>\n : <div class=\"icon-inner\"></div>\n }\n </Host>\n );\n\n }\n}"]}
|
|
@@ -30,7 +30,7 @@ export class Input {
|
|
|
30
30
|
/**
|
|
31
31
|
* If `true`, block decimal.
|
|
32
32
|
*/
|
|
33
|
-
this.
|
|
33
|
+
this.blockdecimal = false;
|
|
34
34
|
/**
|
|
35
35
|
* Whether auto correction should be enabled when the user is entering/editing the text value.
|
|
36
36
|
*/
|
|
@@ -83,7 +83,7 @@ export class Input {
|
|
|
83
83
|
this.onInput = (ev) => {
|
|
84
84
|
const input = ev.target;
|
|
85
85
|
let newValue = input.value;
|
|
86
|
-
if (this.type === 'number' && this.
|
|
86
|
+
if (this.type === 'number' && this.blockdecimal) {
|
|
87
87
|
newValue = newValue.replace(/[.,]/g, ''); // Supprime les décimales si blockDecimal est activé
|
|
88
88
|
}
|
|
89
89
|
this.value = newValue;
|
|
@@ -108,7 +108,7 @@ export class Input {
|
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
110
|
handleKeyDown(event) {
|
|
111
|
-
if (this.type === 'number' && this.
|
|
111
|
+
if (this.type === 'number' && this.blockdecimal) {
|
|
112
112
|
const forbiddenKeys = ['.', ',', 'e', '-', '¨', '^', '`', '+'];
|
|
113
113
|
if (forbiddenKeys.includes(event.key)) {
|
|
114
114
|
event.preventDefault();
|
|
@@ -157,7 +157,7 @@ export class Input {
|
|
|
157
157
|
const hasValueClass = this.value !== '' && this.value !== null ? 'has-value' : '';
|
|
158
158
|
const lessLabelClass = this.label !== '' ? '' : 'less-label';
|
|
159
159
|
const isInvalidClass = this.error !== undefined && this.error !== '' ? 'is-invalid' : '';
|
|
160
|
-
return (h(Host, { key: '
|
|
160
|
+
return (h(Host, { key: '9251985e0b07d2b85f319d30bd6e4cc46cf78147', "aria-disabled": this.disabled ? 'true' : null, class: this.sizes && `input-${this.sizes}`, value: value, blockdecimal: this.blockdecimal }, h("input", { key: 'b0d87d5bde0d232615d200c1b4c611a997931595', 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, onKeyUp: (event) => this.enforceMinMax(event.target), "data-cy": 'road-input' }), h("label", { key: '910506a3f147908dd802d645c9d985862cf4126b', class: "form-label", id: labelId, htmlFor: this.inputId }, this.label), this.error && this.error !== '' && h("p", { key: 'feb2985f978e936bcde5328233a433eda6f2d16c', class: "invalid-feedback" }, h("road-icon", { key: 'f5d8a3c8edc1ccac2d5b9f9d6b2bcc3f3f7bc283', slot: "start", name: "alert-error-solid", "aria-hidden": "true", size: "sm" }), this.error), this.helper && this.helper !== '' && h("p", { key: '3e11fd43dc68951c17d3ab267bc4a25316e1efce', class: "helper" }, this.helper), this.type && this.type == 'password' && h("slot", { key: '0a2df2f8c92a52d18b6d1063765eaf47809a60b3', name: "checklistPassword" })));
|
|
161
161
|
}
|
|
162
162
|
static get is() { return "road-input"; }
|
|
163
163
|
static get encapsulation() { return "scoped"; }
|
|
@@ -239,7 +239,7 @@ export class Input {
|
|
|
239
239
|
"reflect": false,
|
|
240
240
|
"defaultValue": "'off'"
|
|
241
241
|
},
|
|
242
|
-
"
|
|
242
|
+
"blockdecimal": {
|
|
243
243
|
"type": "boolean",
|
|
244
244
|
"mutable": false,
|
|
245
245
|
"complexType": {
|
|
@@ -255,7 +255,7 @@ export class Input {
|
|
|
255
255
|
},
|
|
256
256
|
"getter": false,
|
|
257
257
|
"setter": false,
|
|
258
|
-
"attribute": "
|
|
258
|
+
"attribute": "blockdecimal",
|
|
259
259
|
"reflect": false,
|
|
260
260
|
"defaultValue": "false"
|
|
261
261
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/components/input/input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,QAAQ,CAAC;AAGpD;;;;;;;;;;;;GAYG;AAOH,MAAM,OAAO,KAAK;IALlB;QAME;;WAEG;QACK,YAAO,GAAW,cAAc,QAAQ,EAAE,EAAE,CAAC;QAErD;;WAEG;QACK,mBAAc,GAAG,KAAK,CAAC;QAE/B;;WAEG;QACK,iBAAY,GAAsB,KAAK,CAAC;QAEhD;;WAEG;QACK,iBAAY,GAAY,KAAK,CAAC;QAGtC;;WAEG;QACK,gBAAW,GAAiB,KAAK,CAAC;QAE1C;;WAEG;QACK,cAAS,GAAG,KAAK,CAAC;QAE1B;;WAEG;QACK,aAAQ,GAAG,KAAK,CAAC;QAmCzB;;WAEG;QACK,SAAI,GAAW,IAAI,CAAC,OAAO,CAAC;QAYpC;;WAEG;QACK,aAAQ,GAAG,KAAK,CAAC;QAEzB;;WAEG;QACK,aAAQ,GAAG,KAAK,CAAC;QAEzB;;WAEG;QACK,eAAU,GAAG,KAAK,CAAC;QAa3B;;WAEG;QACK,UAAK,GAAgB,IAAI,CAAC;QAElC;;WAEG;QACK,SAAI,GAAmB,MAAM,CAAC;QAEtC;;WAEG;QACsB,UAAK,GAA4B,EAAE,CAAC;QAE7D;;WAEG;QACK,UAAK,GAAY,EAAE,CAAC;QAY5B;;WAEG;QACK,aAAQ,GAAG,CAAC,CAAC;QAYb,wBAAmB,GAAG,IAAI,CAAC,yBAAyB,EAAE,CAAC;QA0DvD,YAAO,GAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAED,IAAI,QAAQ,GAAG,CAAC,CAAC","sourcesContent":["import { Component, Event, EventEmitter, Host, Prop, Watch, h } from '@stencil/core';\nimport { debounce as lodashDebounce } from 'lodash';\nimport { AutocompleteTypes, TextFieldTypes } from '../../interface';\n\n/**\n * @slot checklistPassword - Content the checklist Password exemple.\n * `<div class=\"checklist-password mt-16\" slot=\"checklistPassword\">`\n * `<span class=\"checklist-password-label\"><strong>Low Safety</strong></span>`\n * `<road-progress color=\"danger\" value=\"25\" class=\"mt-8 mb-16\"></road-progress>`\n * `<p class=\"text-medium mb-8\">For optimal safety your password must have at least :</p>`\n * `<ul class=\"m-0 pl-16\">`\n * `<li id=\"letter\" class=\"invalid mb-8\">1 lowercase and 1 uppercase</li>`\n * `<li id=\"number\" class=\"invalid mb-8\">1 digit</li>`\n * `<li id=\"length\" class=\"invalid\">8 characters minimum</li>`\n * `</ul>`\n * `</div>`\n */\n\n@Component({\n tag: 'road-input',\n styleUrl: 'input.css',\n scoped: true,\n})\nexport class Input {\n /**\n * The id of input\n */\n @Prop() inputId: string = `road-input-${inputIds++}`;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n */\n @Prop() autocapitalize = 'off';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: AutocompleteTypes = 'off';\n\n /**\n * If `true`, block decimal.\n */\n @Prop() blockDecimal: boolean = false;\n\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /**\n * This Boolean attribute lets you specify that a form control should have input focus when the page loads.\n */\n @Prop() autofocus = false;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop() disabled = false;\n\n /**\n * A hint to the browser for which enter key to display.\n * Possible values: `\"enter\"`, `\"done\"`, `\"go\"`, `\"next\"`,\n * `\"previous\"`, `\"search\"`, and `\"send\"`.\n */\n @Prop() enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';\n\n /**\n * A hint to the browser for which keyboard to display.\n * This attribute applies when the value of the type attribute is `\"text\"`, `\"password\"`, `\"email\"`, or `\"url\"`. Possible values are: `\"verbatim\"`, `\"latin\"`, `\"latin-name\"`, `\"latin-prose\"`, `\"full-width-latin\"`, `\"kana\"`, `\"katakana\"`, `\"numeric\"`, `\"tel\"`, `\"email\"`, `\"url\"`.\n */\n @Prop() inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, or `\"password\"`, otherwise it is ignored.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n */\n @Prop() placeholder?: string;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop() readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n @Prop() spellcheck = false;\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The initial size of the control. This value is in pixels unless the value of the type attribute is `\"text\"` or `\"password\"`, in which case it is an integer number of characters. This attribute applies only when the `type` attribute is set to `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, or `\"password\"`, otherwise it is ignored.\n */\n @Prop() size?: number;\n\n /**\n * The sizes of the input.\n */\n @Prop() sizes: 'lg' | 'xl' = 'lg';\n\n /**\n * The type of control to display. The default type is text.\n */\n @Prop() type: TextFieldTypes = 'text';\n\n /**\n * The value of the input.(for dynamic use use v-model for vue instead)\n */\n @Prop({ mutable: true }) value?: string | number | null = '';\n\n /**\n * Label for the field\n */\n @Prop() label?: string = '';\n\n /**\n * Error message for the field\n */\n @Prop() error?: string;\n\n /**\n * Helper message for the field\n */\n @Prop() helper?: string;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `roadChange` event after each keystroke.\n */\n @Prop() debounce = 0;\n\n private handleKeyDown(event: KeyboardEvent) {\n if (this.type === 'number' && this.blockDecimal) {\n const forbiddenKeys = ['.', ',', 'e', '-', '¨', '^', '`', '+'];\n if (forbiddenKeys.includes(event.key)) {\n event.preventDefault();\n }\n }\n }\n\n\n private debouncedRoadChange = this.createDebouncedRoadChange();\n\n private createDebouncedRoadChange() {\n return lodashDebounce((value: any) => {\n this.roadChange.emit({ value: value == null ? value : value.toString() });\n }, this.debounce);\n }\n\n @Watch('debounce')\n debounceChanged() {\n // Créez une nouvelle fonction debouncedRoadChange avec la nouvelle valeur de debounce\n this.debouncedRoadChange = this.createDebouncedRoadChange();\n }\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n this.debouncedRoadChange(this.value);\n }\n\n /**\n * Emitted when a keyboard input occurred.\n */\n\n /** @internal */\n @Event() roadInput!: EventEmitter<KeyboardEvent>;\n\n /**\n * Emitted when the value has changed.\n */\n\n /** @internal */\n @Event() roadChange!: EventEmitter<{\n value: string | undefined | null;\n }>;\n\n /**\n * Emitted when the input loses focus.\n */\n\n /** @internal */\n @Event() roadBlur!: EventEmitter<string | null>;\n\n /**\n * Emitted when the input has focus.\n */\n\n /** @internal */\n @Event() roadFocus!: EventEmitter<void>;\n\n private getValue(): string {\n return typeof this.value === 'number'\n ? this.value.toString()\n : (this.value || '').toString();\n }\n\n private onInput = (ev: Event) => {\n const input = ev.target as HTMLInputElement;\n let newValue = input.value;\n\n if (this.type === 'number' && this.blockDecimal) {\n newValue = newValue.replace(/[.,]/g, ''); // Supprime les décimales si blockDecimal est activé\n }\n\n this.value = newValue;\n this.roadInput.emit(ev as KeyboardEvent);\n this.roadChange.emit({ value: newValue });\n };\n\n private onBlur = () => {\n let value = this.getValue();\n\n // Vérifier si les contraintes min et max sont définies\n if (this.min !== undefined && value !== '' && parseFloat(value) < parseFloat(this.min)) {\n value = this.min; // Ajuster la valeur à la valeur minimale\n }\n\n if (this.max !== undefined && value !== '' && parseFloat(value) > parseFloat(this.max)) {\n value = this.max; // Ajuster la valeur à la valeur maximale\n }\n\n this.value = value; // Mettre à jour la valeur avec la valeur ajustée\n\n // Émettre l'événement roadblur avec la valeur ajustée\n this.roadBlur.emit(value);\n };\n\n private onFocus = () => {\n this.roadFocus.emit();\n };\n\n private enforceMinMax(el: HTMLInputElement): void {\n if (el.value !== \"\") {\n const value: number = parseInt(el.value);\n const minValue: number = parseInt(el.min);\n const maxValue: number = parseInt(el.max);\n\n if (value < minValue) {\n el.value = el.min;\n }\n\n if (value > maxValue) {\n el.value = el.max;\n }\n }\n }\n\n componentWillLoad() {\n this.debounceChanged(); // Initialize debounce on component load\n }\n\n render() {\n const value = this.getValue();\n const labelId = this.inputId + '-label';\n const hasValueClass = this.value !== '' && this.value !== null ? 'has-value' : '';\n const lessLabelClass = this.label !== '' ? '' : 'less-label';\n const isInvalidClass = this.error !== undefined && this.error !== '' ? 'is-invalid' : '';\n\n return (\n <Host aria-disabled={this.disabled ? 'true' : null} class={this.sizes && `input-${this.sizes}`} value={value}>\n <input\n class={`form-control ${hasValueClass} ${isInvalidClass} ${lessLabelClass}`}\n id={this.inputId}\n aria-disabled={this.disabled ? 'true' : null}\n aria-labelledby={labelId}\n disabled={this.disabled}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n enterKeyHint={this.enterkeyhint}\n autoFocus={this.autofocus}\n inputMode={this.inputmode}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n step={this.step}\n size={this.size}\n type={this.type}\n value={value}\n onInput={this.onInput}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n onKeyDown={this.type === 'number' ? (event: KeyboardEvent) => this.handleKeyDown(event) : undefined}\n onKeyUp={(event: Event) => this.enforceMinMax(event.target as HTMLInputElement)}\n data-cy='road-input'\n />\n <label class=\"form-label\" id={labelId} htmlFor={this.inputId}>{this.label}</label>\n {this.error && this.error !== '' && <p class=\"invalid-feedback\"><road-icon slot=\"start\" name=\"alert-error-solid\" aria-hidden=\"true\" size=\"sm\"></road-icon>{this.error}</p>}\n {this.helper && this.helper !== '' && <p class=\"helper\">{this.helper}</p>}\n {this.type && this.type == 'password' && <slot name=\"checklistPassword\" />}\n </Host>\n );\n }\n}\n\nlet inputIds = 0;\n"]}
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/components/input/input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,KAAK,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAED,IAAI,QAAQ,GAAG,CAAC,CAAC","sourcesContent":["import { Component, Event, EventEmitter, Host, Prop, Watch, h } from '@stencil/core';\nimport { debounce as lodashDebounce } from 'lodash';\nimport { AutocompleteTypes, TextFieldTypes } from '../../interface';\n\n/**\n * @slot checklistPassword - Content the checklist Password exemple.\n * `<div class=\"checklist-password mt-16\" slot=\"checklistPassword\">`\n * `<span class=\"checklist-password-label\"><strong>Low Safety</strong></span>`\n * `<road-progress color=\"danger\" value=\"25\" class=\"mt-8 mb-16\"></road-progress>`\n * `<p class=\"text-medium mb-8\">For optimal safety your password must have at least :</p>`\n * `<ul class=\"m-0 pl-16\">`\n * `<li id=\"letter\" class=\"invalid mb-8\">1 lowercase and 1 uppercase</li>`\n * `<li id=\"number\" class=\"invalid mb-8\">1 digit</li>`\n * `<li id=\"length\" class=\"invalid\">8 characters minimum</li>`\n * `</ul>`\n * `</div>`\n */\n\n@Component({\n tag: 'road-input',\n styleUrl: 'input.css',\n scoped: true,\n})\nexport class Input {\n /**\n * The id of input\n */\n @Prop() inputId: string = `road-input-${inputIds++}`;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n */\n @Prop() autocapitalize = 'off';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: AutocompleteTypes = 'off';\n\n /**\n * If `true`, block decimal.\n */\n @Prop() blockdecimal = false;\n\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /**\n * This Boolean attribute lets you specify that a form control should have input focus when the page loads.\n */\n @Prop() autofocus = false;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop() disabled = false;\n\n /**\n * A hint to the browser for which enter key to display.\n * Possible values: `\"enter\"`, `\"done\"`, `\"go\"`, `\"next\"`,\n * `\"previous\"`, `\"search\"`, and `\"send\"`.\n */\n @Prop() enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';\n\n /**\n * A hint to the browser for which keyboard to display.\n * This attribute applies when the value of the type attribute is `\"text\"`, `\"password\"`, `\"email\"`, or `\"url\"`. Possible values are: `\"verbatim\"`, `\"latin\"`, `\"latin-name\"`, `\"latin-prose\"`, `\"full-width-latin\"`, `\"kana\"`, `\"katakana\"`, `\"numeric\"`, `\"tel\"`, `\"email\"`, `\"url\"`.\n */\n @Prop() inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, or `\"password\"`, otherwise it is ignored.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n */\n @Prop() placeholder?: string;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop() readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n @Prop() spellcheck = false;\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The initial size of the control. This value is in pixels unless the value of the type attribute is `\"text\"` or `\"password\"`, in which case it is an integer number of characters. This attribute applies only when the `type` attribute is set to `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, or `\"password\"`, otherwise it is ignored.\n */\n @Prop() size?: number;\n\n /**\n * The sizes of the input.\n */\n @Prop() sizes: 'lg' | 'xl' = 'lg';\n\n /**\n * The type of control to display. The default type is text.\n */\n @Prop() type: TextFieldTypes = 'text';\n\n /**\n * The value of the input.(for dynamic use use v-model for vue instead)\n */\n @Prop({ mutable: true }) value?: string | number | null = '';\n\n /**\n * Label for the field\n */\n @Prop() label?: string = '';\n\n /**\n * Error message for the field\n */\n @Prop() error?: string;\n\n /**\n * Helper message for the field\n */\n @Prop() helper?: string;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `roadChange` event after each keystroke.\n */\n @Prop() debounce = 0;\n\n private handleKeyDown(event: KeyboardEvent) {\n if (this.type === 'number' && this.blockdecimal) {\n const forbiddenKeys = ['.', ',', 'e', '-', '¨', '^', '`', '+'];\n if (forbiddenKeys.includes(event.key)) {\n event.preventDefault();\n }\n }\n }\n\n\n private debouncedRoadChange = this.createDebouncedRoadChange();\n\n private createDebouncedRoadChange() {\n return lodashDebounce((value: any) => {\n this.roadChange.emit({ value: value == null ? value : value.toString() });\n }, this.debounce);\n }\n\n @Watch('debounce')\n debounceChanged() {\n // Créez une nouvelle fonction debouncedRoadChange avec la nouvelle valeur de debounce\n this.debouncedRoadChange = this.createDebouncedRoadChange();\n }\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n this.debouncedRoadChange(this.value);\n }\n\n /**\n * Emitted when a keyboard input occurred.\n */\n\n /** @internal */\n @Event() roadInput!: EventEmitter<KeyboardEvent>;\n\n /**\n * Emitted when the value has changed.\n */\n\n /** @internal */\n @Event() roadChange!: EventEmitter<{\n value: string | undefined | null;\n }>;\n\n /**\n * Emitted when the input loses focus.\n */\n\n /** @internal */\n @Event() roadBlur!: EventEmitter<string | null>;\n\n /**\n * Emitted when the input has focus.\n */\n\n /** @internal */\n @Event() roadFocus!: EventEmitter<void>;\n\n private getValue(): string {\n return typeof this.value === 'number'\n ? this.value.toString()\n : (this.value || '').toString();\n }\n\n private onInput = (ev: Event) => {\n const input = ev.target as HTMLInputElement;\n let newValue = input.value;\n\n if (this.type === 'number' && this.blockdecimal) {\n newValue = newValue.replace(/[.,]/g, ''); // Supprime les décimales si blockDecimal est activé\n }\n\n this.value = newValue;\n this.roadInput.emit(ev as KeyboardEvent);\n this.roadChange.emit({ value: newValue });\n };\n\n private onBlur = () => {\n let value = this.getValue();\n\n // Vérifier si les contraintes min et max sont définies\n if (this.min !== undefined && value !== '' && parseFloat(value) < parseFloat(this.min)) {\n value = this.min; // Ajuster la valeur à la valeur minimale\n }\n\n if (this.max !== undefined && value !== '' && parseFloat(value) > parseFloat(this.max)) {\n value = this.max; // Ajuster la valeur à la valeur maximale\n }\n\n this.value = value; // Mettre à jour la valeur avec la valeur ajustée\n\n // Émettre l'événement roadblur avec la valeur ajustée\n this.roadBlur.emit(value);\n };\n\n private onFocus = () => {\n this.roadFocus.emit();\n };\n\n private enforceMinMax(el: HTMLInputElement): void {\n if (el.value !== \"\") {\n const value: number = parseInt(el.value);\n const minValue: number = parseInt(el.min);\n const maxValue: number = parseInt(el.max);\n\n if (value < minValue) {\n el.value = el.min;\n }\n\n if (value > maxValue) {\n el.value = el.max;\n }\n }\n }\n\n componentWillLoad() {\n this.debounceChanged(); // Initialize debounce on component load\n }\n\n render() {\n const value = this.getValue();\n const labelId = this.inputId + '-label';\n const hasValueClass = this.value !== '' && this.value !== null ? 'has-value' : '';\n const lessLabelClass = this.label !== '' ? '' : 'less-label';\n const isInvalidClass = this.error !== undefined && this.error !== '' ? 'is-invalid' : '';\n\n return (\n <Host aria-disabled={this.disabled ? 'true' : null} class={this.sizes && `input-${this.sizes}`} value={value} blockdecimal={this.blockdecimal}>\n <input\n class={`form-control ${hasValueClass} ${isInvalidClass} ${lessLabelClass}`}\n id={this.inputId}\n aria-disabled={this.disabled ? 'true' : null}\n aria-labelledby={labelId}\n disabled={this.disabled}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n enterKeyHint={this.enterkeyhint}\n autoFocus={this.autofocus}\n inputMode={this.inputmode}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n step={this.step}\n size={this.size}\n type={this.type}\n value={value}\n onInput={this.onInput}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n onKeyDown={this.type === 'number' ? (event: KeyboardEvent) => this.handleKeyDown(event) : undefined}\n onKeyUp={(event: Event) => this.enforceMinMax(event.target as HTMLInputElement)}\n data-cy='road-input'\n />\n <label class=\"form-label\" id={labelId} htmlFor={this.inputId}>{this.label}</label>\n {this.error && this.error !== '' && <p class=\"invalid-feedback\"><road-icon slot=\"start\" name=\"alert-error-solid\" aria-hidden=\"true\" size=\"sm\"></road-icon>{this.error}</p>}\n {this.helper && this.helper !== '' && <p class=\"helper\">{this.helper}</p>}\n {this.type && this.type == 'password' && <slot name=\"checklistPassword\" />}\n </Host>\n );\n }\n}\n\nlet inputIds = 0;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { html } from 'lit
|
|
1
|
+
import { html } from 'lit';
|
|
2
2
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
3
3
|
import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
|
|
4
4
|
|
|
@@ -26,6 +26,9 @@ export default {
|
|
|
26
26
|
spellcheck: {
|
|
27
27
|
control: 'boolean',
|
|
28
28
|
},
|
|
29
|
+
blockdecimal: {
|
|
30
|
+
control: 'boolean',
|
|
31
|
+
},
|
|
29
32
|
error: {
|
|
30
33
|
control: 'text',
|
|
31
34
|
},
|
|
@@ -181,6 +184,7 @@ export default {
|
|
|
181
184
|
required: null,
|
|
182
185
|
autofocus: null,
|
|
183
186
|
spellcheck: null,
|
|
187
|
+
blockdecimal: null,
|
|
184
188
|
'checklistPassword': ``,
|
|
185
189
|
},
|
|
186
190
|
};
|
|
@@ -204,6 +208,7 @@ const Template = (args) => html`
|
|
|
204
208
|
value="${ifDefined(args.value)}"
|
|
205
209
|
pattern="${ifDefined(args.pattern)}"
|
|
206
210
|
spellcheck="${ifDefined(args.spellcheck)}"
|
|
211
|
+
blockdecimal="${ifDefined(args.blockdecimal)}"
|
|
207
212
|
placeholder="${ifDefined(args.placeholder)}"
|
|
208
213
|
type="${ifDefined(args.type)}"
|
|
209
214
|
autocapitalize="${ifDefined(args.autocapitalize)}"
|