@skodaflow/web-library 4.2.0 → 6.0.0
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/README.md +61 -47
- package/cjs/components/accordion/accordion.d.ts +2 -2
- package/cjs/components/accordion/accordion.js +1 -1
- package/cjs/components/accordion/accordion.js.map +1 -1
- package/cjs/components/banner/banner.d.ts +13 -51
- package/cjs/components/banner/banner.js +1 -1
- package/cjs/components/banner/banner.js.map +1 -1
- package/cjs/components/button/button.d.ts +2 -1
- package/cjs/components/button/button.js +1 -1
- package/cjs/components/button/button.js.map +1 -1
- package/cjs/components/card/Card.d.ts +92 -0
- package/cjs/components/card/Card.js +2 -0
- package/cjs/components/card/Card.js.map +1 -0
- package/cjs/components/card/FlippingCard.d.ts +3 -0
- package/cjs/components/card/FlippingCard.js +2 -0
- package/cjs/components/card/FlippingCard.js.map +1 -0
- package/cjs/components/card/LinkCard.d.ts +3 -0
- package/cjs/components/card/LinkCard.js +2 -0
- package/cjs/components/card/LinkCard.js.map +1 -0
- package/cjs/components/card/SelectableCard.d.ts +3 -0
- package/cjs/components/card/SelectableCard.js +2 -0
- package/cjs/components/card/SelectableCard.js.map +1 -0
- package/cjs/components/card/SimpleCard.d.ts +3 -0
- package/cjs/components/card/SimpleCard.js +2 -0
- package/cjs/components/card/SimpleCard.js.map +1 -0
- package/cjs/components/card/index.d.ts +1 -0
- package/cjs/components/cardContainer/cardContainer.d.ts +1 -0
- package/cjs/components/cardContainer/cardContainer.js.map +1 -1
- package/cjs/components/cardMenu/cardMenu.d.ts +2 -1
- package/cjs/components/cardMenu/cardMenu.js +1 -1
- package/cjs/components/cardMenu/cardMenu.js.map +1 -1
- package/cjs/components/cardMenu/styled/menuListStyled.d.ts +1 -1
- package/cjs/components/chip/chipDropdownChildren/chipDropdownChildren.js +1 -1
- package/cjs/components/chip/chipDropdownChildren/chipDropdownChildren.js.map +1 -1
- package/cjs/components/chip/chipMultiselect/multiSelectChip.d.ts +2 -1
- package/cjs/components/chip/chipMultiselect/multiSelectChip.js +1 -1
- package/cjs/components/chip/chipMultiselect/multiSelectChip.js.map +1 -1
- package/cjs/components/chip/regular/chip.d.ts +2 -1
- package/cjs/components/chip/regular/chip.js +1 -1
- package/cjs/components/chip/regular/chip.js.map +1 -1
- package/cjs/components/closeDialogButton/index.js +1 -1
- package/cjs/components/closeDialogButton/index.js.map +1 -1
- package/cjs/components/common/hook/useWindowSize.js +1 -1
- package/cjs/components/common/hook/useWindowSize.js.map +1 -1
- package/cjs/components/common/interface/textInputInterface.d.ts +2 -1
- package/cjs/components/common/styled/textFieldStyled.d.ts +1 -1
- package/cjs/components/controls/controls.d.ts +2 -1
- package/cjs/components/controls/controls.js +1 -1
- package/cjs/components/controls/controls.js.map +1 -1
- package/cjs/components/icon/icon.d.ts +11 -2
- package/cjs/components/icon/icon.definitions.d.ts +847 -0
- package/cjs/components/icon/icon.definitions.js +2 -0
- package/cjs/components/icon/icon.definitions.js.map +1 -0
- package/cjs/components/icon/icon.js +1 -1
- package/cjs/components/icon/icon.js.map +1 -1
- package/cjs/components/icon/index.d.ts +1 -1
- package/cjs/components/iconButton/index.d.ts +1 -1
- package/cjs/components/index.d.ts +1 -0
- package/cjs/components/indicator/indicator.d.ts +9 -3
- package/cjs/components/indicator/indicator.js +1 -18
- package/cjs/components/indicator/indicator.js.map +1 -1
- package/cjs/components/label/label.js.map +1 -1
- package/cjs/components/labelFeature/labelFeature.js.map +1 -1
- package/cjs/components/labelStatus/labelStatus.d.ts +1 -0
- package/cjs/components/labelStatus/labelStatus.js.map +1 -1
- package/cjs/components/menu/menu.js +1 -1
- package/cjs/components/menu/menu.js.map +1 -1
- package/cjs/components/mobileStepper/index.d.ts +1 -0
- package/cjs/components/mobileStepper/mobileStepper.d.ts +1 -1
- package/cjs/components/mobileStepper/mobileStepper.js +1 -1
- package/cjs/components/mobileStepper/mobileStepper.js.map +1 -1
- package/cjs/components/mobileStepper/mobileStepperButton.d.ts +4 -0
- package/cjs/components/mobileStepper/mobileStepperButton.js +2 -0
- package/cjs/components/mobileStepper/mobileStepperButton.js.map +1 -0
- package/cjs/components/modal/modal.d.ts +12 -0
- package/cjs/components/modal/modal.js +1 -1
- package/cjs/components/modal/modal.js.map +1 -1
- package/cjs/components/pagination/pagination.js +1 -1
- package/cjs/components/pagination/pagination.js.map +1 -1
- package/cjs/components/progressBar/components/loader.js +1 -1
- package/cjs/components/progressBar/components/loader.js.map +1 -1
- package/cjs/components/progressBar/components/spinner.js +1 -1
- package/cjs/components/progressBar/components/spinner.js.map +1 -1
- package/cjs/components/selectInput/formControlSelectStyled.d.ts +1 -1
- package/cjs/components/selectInput/selectInput.d.ts +2 -1
- package/cjs/components/selectInput/selectInput.js +1 -1
- package/cjs/components/selectInput/selectInput.js.map +1 -1
- package/cjs/components/slider/slider.d.ts +3 -3
- package/cjs/components/slider/slider.js +1 -1
- package/cjs/components/slider/slider.js.map +1 -1
- package/cjs/components/snackbar/snackbarMessage.js +1 -1
- package/cjs/components/snackbar/snackbarMessage.js.map +1 -1
- package/cjs/components/stepper/stepper.d.ts +2 -2
- package/cjs/components/stepper/stepper.js +1 -1
- package/cjs/components/stepper/stepper.js.map +1 -1
- package/cjs/components/tab/hook/useTabs.d.ts +1 -0
- package/cjs/components/tab/hook/useTabs.js.map +1 -1
- package/cjs/components/tab/menuTab.d.ts +1 -0
- package/cjs/components/tab/menuTab.js +1 -1
- package/cjs/components/tab/menuTab.js.map +1 -1
- package/cjs/components/tab/secondaryNavigation/secondaryNavigationTabs.js +1 -1
- package/cjs/components/tab/secondaryNavigation/secondaryNavigationTabs.js.map +1 -1
- package/cjs/components/tab/tab.d.ts +1 -0
- package/cjs/components/tab/tab.js.map +1 -1
- package/cjs/components/tab/tabPanel.d.ts +1 -0
- package/cjs/components/tab/tabPanel.js.map +1 -1
- package/cjs/components/tab/tabStyled.d.ts +2 -1
- package/cjs/components/tab/tabStyled.js.map +1 -1
- package/cjs/components/tab/tabs.d.ts +1 -0
- package/cjs/components/tab/tabs.js.map +1 -1
- package/cjs/components/textInput/textInput.js +1 -1
- package/cjs/components/textInput/textInput.js.map +1 -1
- package/cjs/components/upload/UploadField.d.ts +2 -2
- package/cjs/components/upload/UploadField.js +1 -1
- package/cjs/components/upload/UploadField.js.map +1 -1
- package/cjs/components/upload/UploadPreview.d.ts +1 -1
- package/cjs/components/upload/UploadPreviewList.d.ts +1 -1
- package/cjs/components/upload/UploadPreviewList.js +1 -1
- package/cjs/components/upload/UploadPreviewList.js.map +1 -1
- package/cjs/design/skoda/components/accordion/accordion.theme.js +1 -1
- package/cjs/design/skoda/components/accordion/accordion.theme.js.map +1 -1
- package/cjs/design/skoda/components/accordion/accordionSummary.theme.js +1 -1
- package/cjs/design/skoda/components/accordion/accordionSummary.theme.js.map +1 -1
- package/cjs/design/skoda/components/autocomplete.theme.js +1 -1
- package/cjs/design/skoda/components/autocomplete.theme.js.map +1 -1
- package/cjs/design/skoda/components/{dialog.theme.js → dialog/dialog.theme.js} +1 -1
- package/cjs/design/skoda/components/dialog/dialog.theme.js.map +1 -0
- package/cjs/design/skoda/components/dialog/dialogActions.theme.js.map +1 -0
- package/cjs/design/skoda/components/dialog/dialogTitle.theme.js.map +1 -0
- package/cjs/design/skoda/components/form/filledInput.theme.js.map +1 -0
- package/cjs/design/skoda/components/form/formControl.theme.js.map +1 -0
- package/cjs/design/skoda/components/form/formControlLabel.theme.js.map +1 -0
- package/cjs/design/skoda/components/form/formHelperText.theme.js.map +1 -0
- package/cjs/design/skoda/components/form/formLabel.theme.js.map +1 -0
- package/cjs/design/skoda/components/form/input.theme.js.map +1 -0
- package/cjs/design/skoda/components/form/inputAdornment.theme.js.map +1 -0
- package/cjs/design/skoda/components/form/inputBase.theme.js.map +1 -0
- package/cjs/design/skoda/components/form/inputLabel.theme.js.map +1 -0
- package/cjs/design/skoda/components/form/radio.theme.js +2 -0
- package/cjs/design/skoda/components/form/radio.theme.js.map +1 -0
- package/cjs/design/skoda/components/form/select.theme.js +2 -0
- package/cjs/design/skoda/components/form/select.theme.js.map +1 -0
- package/cjs/design/skoda/components/form/slider.theme.js +2 -0
- package/cjs/design/skoda/components/form/slider.theme.js.map +1 -0
- package/cjs/design/skoda/components/form/switch.theme.js.map +1 -0
- package/cjs/design/skoda/components/form/textField.theme.js.map +1 -0
- package/cjs/design/skoda/components/layout/breakpoints.theme.js.map +1 -0
- package/cjs/design/skoda/components/layout/container.theme.js.map +1 -0
- package/cjs/design/skoda/components/layout/grid.theme.js.map +1 -0
- package/cjs/design/skoda/components/mobileStepper.theme.js +1 -1
- package/cjs/design/skoda/components/mobileStepper.theme.js.map +1 -1
- package/cjs/design/skoda/components/stepper/index.d.ts +1 -0
- package/cjs/design/skoda/components/stepper/stepIcon/errorStepIcon.d.ts +3 -0
- package/cjs/design/skoda/components/stepper/stepIcon/errorStepIcon.js +2 -0
- package/cjs/design/skoda/components/stepper/stepIcon/errorStepIcon.js.map +1 -0
- package/cjs/design/skoda/components/stepper/stepIcon/index.d.ts +2 -0
- package/cjs/design/skoda/components/stepper/stepIcon/index.js +2 -0
- package/cjs/design/skoda/components/stepper/stepIcon/index.js.map +1 -0
- package/cjs/design/skoda/components/stepper/stepIcon/qontoStepIcon.d.ts +2 -0
- package/cjs/design/skoda/components/stepper/stepIcon/qontoStepIcon.js +2 -0
- package/cjs/design/skoda/components/stepper/stepIcon/qontoStepIcon.js.map +1 -0
- package/cjs/design/skoda/components/stepper/stepper.theme.d.ts +3 -0
- package/cjs/design/skoda/components/stepper/stepper.theme.js +2 -0
- package/cjs/design/skoda/components/stepper/stepper.theme.js.map +1 -0
- package/cjs/design/skoda/components/tabs/tabs.theme.js +1 -1
- package/cjs/design/skoda/components/tabs/tabs.theme.js.map +1 -1
- package/cjs/design/skoda/theme.js +1 -1
- package/cjs/design/skoda/theme.js.map +1 -1
- package/cjs/index.js +1 -1
- package/cjs/layout/Error/ErrorContent.d.ts +6 -6
- package/cjs/layout/Error/ErrorContent.js +1 -1
- package/cjs/layout/Error/ErrorContent.js.map +1 -1
- package/cjs/layout/Footer/Footer.d.ts +3 -14
- package/cjs/layout/Footer/Footer.js +1 -1
- package/cjs/layout/Footer/Footer.js.map +1 -1
- package/cjs/layout/Footer/FooterAccordion.d.ts +18 -0
- package/cjs/layout/Footer/FooterAccordion.js +2 -0
- package/cjs/layout/Footer/FooterAccordion.js.map +1 -0
- package/cjs/layout/Footer/FooterIconButton.d.ts +6 -2
- package/cjs/layout/Footer/FooterIconButton.js +1 -1
- package/cjs/layout/Footer/FooterIconButton.js.map +1 -1
- package/cjs/layout/Footer/FooterLink.d.ts +15 -0
- package/cjs/layout/Footer/FooterLink.js +2 -0
- package/cjs/layout/Footer/FooterLink.js.map +1 -0
- package/cjs/layout/Footer/FooterMenu.d.ts +21 -0
- package/cjs/layout/Footer/FooterMenu.js +2 -0
- package/cjs/layout/Footer/FooterMenu.js.map +1 -0
- package/cjs/layout/Footer/FooterSectionContact.d.ts +12 -0
- package/cjs/layout/Footer/FooterSectionContact.js +2 -0
- package/cjs/layout/Footer/FooterSectionContact.js.map +1 -0
- package/cjs/layout/Footer/FooterSectionMenu.d.ts +5 -0
- package/cjs/layout/Footer/FooterSectionMenu.js +2 -0
- package/cjs/layout/Footer/FooterSectionMenu.js.map +1 -0
- package/cjs/layout/Footer/PredefinedFooterIconButtons.d.ts +5 -4
- package/cjs/layout/Footer/PredefinedFooterIconButtons.js +1 -1
- package/cjs/layout/Footer/PredefinedFooterIconButtons.js.map +1 -1
- package/cjs/layout/Footer/index.d.ts +5 -1
- package/cjs/layout/Header/HeaderButton.d.ts +3 -3
- package/cjs/layout/Header/HeaderButton.js +1 -1
- package/cjs/layout/Header/HeaderButton.js.map +1 -1
- package/cjs/layout/Header/PredefinedHeaderButtons.js +1 -1
- package/cjs/layout/Header/PredefinedHeaderButtons.js.map +1 -1
- package/cjs/layout/SideMenu/SideMenu.js +1 -1
- package/cjs/layout/SideMenu/SideMenu.js.map +1 -1
- package/cjs/layout/cookieModal/CookieModal.d.ts +69 -0
- package/cjs/layout/cookieModal/CookieModal.js +2 -0
- package/cjs/layout/cookieModal/CookieModal.js.map +1 -0
- package/cjs/layout/cookieModal/CookieModalItem.d.ts +37 -0
- package/cjs/layout/cookieModal/CookieModalItem.js +2 -0
- package/cjs/layout/cookieModal/CookieModalItem.js.map +1 -0
- package/cjs/layout/cookieModal/index.d.ts +2 -0
- package/cjs/layout/index.d.ts +1 -0
- package/cjs/organisms/cardOwnedVehicle/cardOwnedVehicleComponent.js +1 -1
- package/cjs/organisms/cardOwnedVehicle/cardOwnedVehicleComponent.js.map +1 -1
- package/cjs/organisms/cardPhotoAdjustable/cardPhotoAdjustable.js.map +1 -1
- package/cjs/organisms/cardPhotoFixed/cardPhotoFixed.js.map +1 -1
- package/cjs/organisms/cardTypeOnly/cardTypeOnly.js.map +1 -1
- package/cjs/organisms/carousel/carousel.d.ts +3 -2
- package/cjs/organisms/carousel/carouselTemplate.d.ts +2 -1
- package/cjs/organisms/carousel2/cardCarousel/cardCarousel.js +1 -1
- package/cjs/organisms/carousel2/cardCarousel/cardCarousel.js.map +1 -1
- package/cjs/organisms/carousel2/carousel2.d.ts +3 -2
- package/cjs/organisms/carousel2/components/NavButton.js +1 -1
- package/cjs/organisms/carousel2/components/NavButton.js.map +1 -1
- package/cjs/organisms/carousel2/heroCarousel/heroCarousel.js +1 -1
- package/cjs/organisms/carousel2/heroCarousel/heroCarousel.js.map +1 -1
- package/cjs/organisms/common/menuCardComponent/menuCardComponent.js +1 -1
- package/cjs/organisms/common/menuCardComponent/menuCardComponent.js.map +1 -1
- package/cjs/organisms/common/styled/cardStandardWrapperStyled.d.ts +1 -1
- package/cjs/organisms/gallery/Gallery.js +1 -1
- package/cjs/organisms/gallery/Gallery.js.map +1 -1
- package/cjs/organisms/gallery/GalleryTrigger.js +1 -1
- package/cjs/organisms/gallery/GalleryTrigger.js.map +1 -1
- package/cjs/organisms/heroImageCard/heroImageCard.js.map +1 -1
- package/cjs/organisms/heroImageCard/videoCardController.js +1 -1
- package/cjs/organisms/heroImageCard/videoCardController.js.map +1 -1
- package/cjs/organisms/hotspotCard/hotspotCard.d.ts +5 -12
- package/cjs/organisms/maps/mapComponents/infoWindowConfig.js.map +1 -1
- package/cjs/organisms/maps/maps.js.map +1 -1
- package/cjs/organisms/notification/Notification.js +1 -1
- package/cjs/organisms/notification/Notification.js.map +1 -1
- package/cjs/organisms/notification/NotificationCenterHeaderButton.d.ts +1 -1
- package/cjs/organisms/shortcutLink/shortcutLink.d.ts +2 -1
- package/cjs/organisms/shortcutLink/shortcutLink.js +1 -1
- package/cjs/organisms/shortcutLink/shortcutLink.js.map +1 -1
- package/cjs/organisms/textCta/textCta.d.ts +2 -1
- package/cjs/organisms/textCta/textCta.js +1 -1
- package/cjs/organisms/textCta/textCta.js.map +1 -1
- package/cjs/production/{Button.d.ts → Button/Button.d.ts} +1 -1
- package/cjs/production/Button/Button.js.map +1 -0
- package/cjs/production/Button/index.d.ts +1 -0
- package/cjs/production/index.js +1 -1
- package/cjs/utils/utilities.d.ts +1 -1
- package/components/accordion/accordion.d.ts +2 -2
- package/components/accordion/accordion.js +1 -1
- package/components/accordion/accordion.js.map +1 -1
- package/components/banner/banner.d.ts +13 -51
- package/components/banner/banner.js +1 -1
- package/components/banner/banner.js.map +1 -1
- package/components/button/button.d.ts +2 -1
- package/components/button/button.js +1 -1
- package/components/button/button.js.map +1 -1
- package/components/card/Card.d.ts +92 -0
- package/components/card/Card.js +2 -0
- package/components/card/Card.js.map +1 -0
- package/components/card/FlippingCard.d.ts +3 -0
- package/components/card/FlippingCard.js +2 -0
- package/components/card/FlippingCard.js.map +1 -0
- package/components/card/LinkCard.d.ts +3 -0
- package/components/card/LinkCard.js +2 -0
- package/components/card/LinkCard.js.map +1 -0
- package/components/card/SelectableCard.d.ts +3 -0
- package/components/card/SelectableCard.js +2 -0
- package/components/card/SelectableCard.js.map +1 -0
- package/components/card/SimpleCard.d.ts +3 -0
- package/components/card/SimpleCard.js +2 -0
- package/components/card/SimpleCard.js.map +1 -0
- package/components/card/index.d.ts +1 -0
- package/components/cardContainer/cardContainer.d.ts +1 -0
- package/components/cardContainer/cardContainer.js.map +1 -1
- package/components/cardMenu/cardMenu.d.ts +2 -1
- package/components/cardMenu/cardMenu.js +1 -1
- package/components/cardMenu/cardMenu.js.map +1 -1
- package/components/cardMenu/styled/menuListStyled.d.ts +1 -1
- package/components/chip/chipDropdownChildren/chipDropdownChildren.js +1 -1
- package/components/chip/chipDropdownChildren/chipDropdownChildren.js.map +1 -1
- package/components/chip/chipMultiselect/multiSelectChip.d.ts +2 -1
- package/components/chip/chipMultiselect/multiSelectChip.js +1 -1
- package/components/chip/chipMultiselect/multiSelectChip.js.map +1 -1
- package/components/chip/regular/chip.d.ts +2 -1
- package/components/chip/regular/chip.js +1 -1
- package/components/chip/regular/chip.js.map +1 -1
- package/components/closeDialogButton/index.js +1 -1
- package/components/closeDialogButton/index.js.map +1 -1
- package/components/common/hook/useWindowSize.js +1 -1
- package/components/common/hook/useWindowSize.js.map +1 -1
- package/components/common/interface/textInputInterface.d.ts +2 -1
- package/components/common/styled/textFieldStyled.d.ts +1 -1
- package/components/controls/controls.d.ts +2 -1
- package/components/controls/controls.js +1 -1
- package/components/controls/controls.js.map +1 -1
- package/components/icon/icon.d.ts +11 -2
- package/components/icon/icon.definitions.d.ts +847 -0
- package/components/icon/icon.definitions.js +2 -0
- package/components/icon/icon.definitions.js.map +1 -0
- package/components/icon/icon.js +1 -1
- package/components/icon/icon.js.map +1 -1
- package/components/icon/index.d.ts +1 -1
- package/components/iconButton/index.d.ts +1 -1
- package/components/index.d.ts +1 -0
- package/components/indicator/indicator.d.ts +9 -3
- package/components/indicator/indicator.js +1 -18
- package/components/indicator/indicator.js.map +1 -1
- package/components/label/label.js.map +1 -1
- package/components/labelFeature/labelFeature.js.map +1 -1
- package/components/labelStatus/labelStatus.d.ts +1 -0
- package/components/labelStatus/labelStatus.js.map +1 -1
- package/components/menu/menu.js +1 -1
- package/components/menu/menu.js.map +1 -1
- package/components/mobileStepper/index.d.ts +1 -0
- package/components/mobileStepper/mobileStepper.d.ts +1 -1
- package/components/mobileStepper/mobileStepper.js +1 -1
- package/components/mobileStepper/mobileStepper.js.map +1 -1
- package/components/mobileStepper/mobileStepperButton.d.ts +4 -0
- package/components/mobileStepper/mobileStepperButton.js +2 -0
- package/components/mobileStepper/mobileStepperButton.js.map +1 -0
- package/components/modal/modal.d.ts +12 -0
- package/components/modal/modal.js +1 -1
- package/components/modal/modal.js.map +1 -1
- package/components/pagination/pagination.js +1 -1
- package/components/pagination/pagination.js.map +1 -1
- package/components/progressBar/components/loader.js +1 -1
- package/components/progressBar/components/loader.js.map +1 -1
- package/components/progressBar/components/spinner.js +1 -1
- package/components/progressBar/components/spinner.js.map +1 -1
- package/components/selectInput/formControlSelectStyled.d.ts +1 -1
- package/components/selectInput/selectInput.d.ts +2 -1
- package/components/selectInput/selectInput.js +1 -1
- package/components/selectInput/selectInput.js.map +1 -1
- package/components/slider/slider.d.ts +3 -3
- package/components/slider/slider.js +1 -1
- package/components/slider/slider.js.map +1 -1
- package/components/snackbar/snackbarMessage.js +1 -1
- package/components/snackbar/snackbarMessage.js.map +1 -1
- package/components/stepper/stepper.d.ts +2 -2
- package/components/stepper/stepper.js +1 -1
- package/components/stepper/stepper.js.map +1 -1
- package/components/tab/hook/useTabs.d.ts +1 -0
- package/components/tab/hook/useTabs.js.map +1 -1
- package/components/tab/menuTab.d.ts +1 -0
- package/components/tab/menuTab.js +1 -1
- package/components/tab/menuTab.js.map +1 -1
- package/components/tab/secondaryNavigation/secondaryNavigationTabs.js +1 -1
- package/components/tab/secondaryNavigation/secondaryNavigationTabs.js.map +1 -1
- package/components/tab/tab.d.ts +1 -0
- package/components/tab/tab.js.map +1 -1
- package/components/tab/tabPanel.d.ts +1 -0
- package/components/tab/tabPanel.js.map +1 -1
- package/components/tab/tabStyled.d.ts +2 -1
- package/components/tab/tabStyled.js.map +1 -1
- package/components/tab/tabs.d.ts +1 -0
- package/components/tab/tabs.js.map +1 -1
- package/components/textInput/textInput.js +1 -1
- package/components/textInput/textInput.js.map +1 -1
- package/components/upload/UploadField.d.ts +2 -2
- package/components/upload/UploadField.js +1 -1
- package/components/upload/UploadField.js.map +1 -1
- package/components/upload/UploadPreview.d.ts +1 -1
- package/components/upload/UploadPreviewList.d.ts +1 -1
- package/components/upload/UploadPreviewList.js +1 -1
- package/components/upload/UploadPreviewList.js.map +1 -1
- package/design/skoda/components/accordion/accordion.theme.js +1 -1
- package/design/skoda/components/accordion/accordion.theme.js.map +1 -1
- package/design/skoda/components/accordion/accordionSummary.theme.js +1 -1
- package/design/skoda/components/accordion/accordionSummary.theme.js.map +1 -1
- package/design/skoda/components/autocomplete.theme.js +1 -1
- package/design/skoda/components/autocomplete.theme.js.map +1 -1
- package/design/skoda/components/dialog/dialog.theme.js +2 -0
- package/design/skoda/components/dialog/dialog.theme.js.map +1 -0
- package/design/skoda/components/dialog/dialogActions.theme.js.map +1 -0
- package/design/skoda/components/dialog/dialogTitle.theme.js.map +1 -0
- package/design/skoda/components/form/filledInput.theme.js.map +1 -0
- package/design/skoda/components/form/formControl.theme.js.map +1 -0
- package/design/skoda/components/form/formControlLabel.theme.js.map +1 -0
- package/design/skoda/components/form/formHelperText.theme.js.map +1 -0
- package/design/skoda/components/form/formLabel.theme.js.map +1 -0
- package/design/skoda/components/form/input.theme.js.map +1 -0
- package/design/skoda/components/form/inputAdornment.theme.js.map +1 -0
- package/design/skoda/components/form/inputBase.theme.js.map +1 -0
- package/design/skoda/components/form/inputLabel.theme.js.map +1 -0
- package/design/skoda/components/form/radio.theme.js +2 -0
- package/design/skoda/components/form/radio.theme.js.map +1 -0
- package/design/skoda/components/form/select.theme.js +2 -0
- package/design/skoda/components/form/select.theme.js.map +1 -0
- package/design/skoda/components/form/slider.theme.js +2 -0
- package/design/skoda/components/form/slider.theme.js.map +1 -0
- package/design/skoda/components/form/switch.theme.js.map +1 -0
- package/design/skoda/components/form/textField.theme.js.map +1 -0
- package/design/skoda/components/layout/breakpoints.theme.js.map +1 -0
- package/design/skoda/components/layout/container.theme.js.map +1 -0
- package/design/skoda/components/layout/grid.theme.js.map +1 -0
- package/design/skoda/components/mobileStepper.theme.js +1 -1
- package/design/skoda/components/mobileStepper.theme.js.map +1 -1
- package/design/skoda/components/stepper/index.d.ts +1 -0
- package/design/skoda/components/stepper/stepIcon/errorStepIcon.d.ts +3 -0
- package/design/skoda/components/stepper/stepIcon/errorStepIcon.js +2 -0
- package/design/skoda/components/stepper/stepIcon/errorStepIcon.js.map +1 -0
- package/design/skoda/components/stepper/stepIcon/index.d.ts +2 -0
- package/design/skoda/components/stepper/stepIcon/index.js +2 -0
- package/design/skoda/components/stepper/stepIcon/index.js.map +1 -0
- package/design/skoda/components/stepper/stepIcon/qontoStepIcon.d.ts +2 -0
- package/design/skoda/components/stepper/stepIcon/qontoStepIcon.js +2 -0
- package/design/skoda/components/stepper/stepIcon/qontoStepIcon.js.map +1 -0
- package/design/skoda/components/stepper/stepper.theme.d.ts +3 -0
- package/design/skoda/components/stepper/stepper.theme.js +2 -0
- package/design/skoda/components/stepper/stepper.theme.js.map +1 -0
- package/design/skoda/components/tabs/tabs.theme.js +1 -1
- package/design/skoda/components/tabs/tabs.theme.js.map +1 -1
- package/design/skoda/theme.js +1 -1
- package/design/skoda/theme.js.map +1 -1
- package/eula.txt +40 -0
- package/index.js +1 -1
- package/layout/Error/ErrorContent.d.ts +6 -6
- package/layout/Error/ErrorContent.js +1 -1
- package/layout/Error/ErrorContent.js.map +1 -1
- package/layout/Footer/Footer.d.ts +3 -14
- package/layout/Footer/Footer.js +1 -1
- package/layout/Footer/Footer.js.map +1 -1
- package/layout/Footer/FooterAccordion.d.ts +18 -0
- package/layout/Footer/FooterAccordion.js +2 -0
- package/layout/Footer/FooterAccordion.js.map +1 -0
- package/layout/Footer/FooterIconButton.d.ts +6 -2
- package/layout/Footer/FooterIconButton.js +1 -1
- package/layout/Footer/FooterIconButton.js.map +1 -1
- package/layout/Footer/FooterLink.d.ts +15 -0
- package/layout/Footer/FooterLink.js +2 -0
- package/layout/Footer/FooterLink.js.map +1 -0
- package/layout/Footer/FooterMenu.d.ts +21 -0
- package/layout/Footer/FooterMenu.js +2 -0
- package/layout/Footer/FooterMenu.js.map +1 -0
- package/layout/Footer/FooterSectionContact.d.ts +12 -0
- package/layout/Footer/FooterSectionContact.js +2 -0
- package/layout/Footer/FooterSectionContact.js.map +1 -0
- package/layout/Footer/FooterSectionMenu.d.ts +5 -0
- package/layout/Footer/FooterSectionMenu.js +2 -0
- package/layout/Footer/FooterSectionMenu.js.map +1 -0
- package/layout/Footer/PredefinedFooterIconButtons.d.ts +5 -4
- package/layout/Footer/PredefinedFooterIconButtons.js +1 -1
- package/layout/Footer/PredefinedFooterIconButtons.js.map +1 -1
- package/layout/Footer/index.d.ts +5 -1
- package/layout/Header/HeaderButton.d.ts +3 -3
- package/layout/Header/HeaderButton.js +1 -1
- package/layout/Header/HeaderButton.js.map +1 -1
- package/layout/Header/PredefinedHeaderButtons.js +1 -1
- package/layout/Header/PredefinedHeaderButtons.js.map +1 -1
- package/layout/SideMenu/SideMenu.js +1 -1
- package/layout/SideMenu/SideMenu.js.map +1 -1
- package/layout/cookieModal/CookieModal.d.ts +69 -0
- package/layout/cookieModal/CookieModal.js +2 -0
- package/layout/cookieModal/CookieModal.js.map +1 -0
- package/layout/cookieModal/CookieModalItem.d.ts +37 -0
- package/layout/cookieModal/CookieModalItem.js +2 -0
- package/layout/cookieModal/CookieModalItem.js.map +1 -0
- package/layout/cookieModal/index.d.ts +2 -0
- package/layout/index.d.ts +1 -0
- package/organisms/cardOwnedVehicle/cardOwnedVehicleComponent.js +1 -1
- package/organisms/cardOwnedVehicle/cardOwnedVehicleComponent.js.map +1 -1
- package/organisms/cardPhotoAdjustable/cardPhotoAdjustable.js.map +1 -1
- package/organisms/cardPhotoFixed/cardPhotoFixed.js.map +1 -1
- package/organisms/cardTypeOnly/cardTypeOnly.js.map +1 -1
- package/organisms/carousel/carousel.d.ts +3 -2
- package/organisms/carousel/carouselTemplate.d.ts +2 -1
- package/organisms/carousel2/cardCarousel/cardCarousel.js +1 -1
- package/organisms/carousel2/cardCarousel/cardCarousel.js.map +1 -1
- package/organisms/carousel2/carousel2.d.ts +3 -2
- package/organisms/carousel2/components/NavButton.js +1 -1
- package/organisms/carousel2/components/NavButton.js.map +1 -1
- package/organisms/carousel2/heroCarousel/heroCarousel.js +1 -1
- package/organisms/carousel2/heroCarousel/heroCarousel.js.map +1 -1
- package/organisms/common/menuCardComponent/menuCardComponent.js +1 -1
- package/organisms/common/menuCardComponent/menuCardComponent.js.map +1 -1
- package/organisms/common/styled/cardStandardWrapperStyled.d.ts +1 -1
- package/organisms/gallery/Gallery.js +1 -1
- package/organisms/gallery/Gallery.js.map +1 -1
- package/organisms/gallery/GalleryTrigger.js +1 -1
- package/organisms/gallery/GalleryTrigger.js.map +1 -1
- package/organisms/heroImageCard/heroImageCard.js.map +1 -1
- package/organisms/heroImageCard/videoCardController.js +1 -1
- package/organisms/heroImageCard/videoCardController.js.map +1 -1
- package/organisms/hotspotCard/hotspotCard.d.ts +5 -12
- package/organisms/maps/mapComponents/infoWindowConfig.js.map +1 -1
- package/organisms/maps/maps.js.map +1 -1
- package/organisms/notification/Notification.js +1 -1
- package/organisms/notification/Notification.js.map +1 -1
- package/organisms/notification/NotificationCenterHeaderButton.d.ts +1 -1
- package/organisms/shortcutLink/shortcutLink.d.ts +2 -1
- package/organisms/shortcutLink/shortcutLink.js +1 -1
- package/organisms/shortcutLink/shortcutLink.js.map +1 -1
- package/organisms/textCta/textCta.d.ts +2 -1
- package/organisms/textCta/textCta.js +1 -1
- package/organisms/textCta/textCta.js.map +1 -1
- package/package.json +1 -1
- package/production/{Button.d.ts → Button/Button.d.ts} +1 -1
- package/production/Button/Button.js.map +1 -0
- package/production/Button/index.d.ts +1 -0
- package/production/index.js +1 -1
- package/theme/skoda/icons.css +1 -1
- package/utils/utilities.d.ts +1 -1
- package/cjs/components/icon/availableIcons.d.ts +0 -1
- package/cjs/components/icon/availableIcons.js +0 -2
- package/cjs/components/icon/availableIcons.js.map +0 -1
- package/cjs/components/tab/examples.d.ts +0 -3
- package/cjs/design/skoda/components/breakpoints.theme.js.map +0 -1
- package/cjs/design/skoda/components/container.theme.js.map +0 -1
- package/cjs/design/skoda/components/dialog.theme.js.map +0 -1
- package/cjs/design/skoda/components/dialogActions.theme.js.map +0 -1
- package/cjs/design/skoda/components/dialogTitle.theme.js.map +0 -1
- package/cjs/design/skoda/components/filledInput.theme.js.map +0 -1
- package/cjs/design/skoda/components/formControl.theme.js.map +0 -1
- package/cjs/design/skoda/components/formControlLabel.theme.js.map +0 -1
- package/cjs/design/skoda/components/formHelperText.theme.js.map +0 -1
- package/cjs/design/skoda/components/formLabel.theme.js.map +0 -1
- package/cjs/design/skoda/components/grid.theme.js.map +0 -1
- package/cjs/design/skoda/components/input.theme.js.map +0 -1
- package/cjs/design/skoda/components/inputAdornment.theme.js.map +0 -1
- package/cjs/design/skoda/components/inputBase.theme.js.map +0 -1
- package/cjs/design/skoda/components/inputLabel.theme.js.map +0 -1
- package/cjs/design/skoda/components/radio.theme.js +0 -2
- package/cjs/design/skoda/components/radio.theme.js.map +0 -1
- package/cjs/design/skoda/components/select.theme.js +0 -2
- package/cjs/design/skoda/components/select.theme.js.map +0 -1
- package/cjs/design/skoda/components/slider.theme.js +0 -2
- package/cjs/design/skoda/components/slider.theme.js.map +0 -1
- package/cjs/design/skoda/components/stepper.theme.d.ts +0 -2
- package/cjs/design/skoda/components/stepper.theme.js +0 -2
- package/cjs/design/skoda/components/stepper.theme.js.map +0 -1
- package/cjs/design/skoda/components/switch.theme.js.map +0 -1
- package/cjs/design/skoda/components/textField.theme.js.map +0 -1
- package/cjs/layout/Footer/FooterNavItem.d.ts +0 -14
- package/cjs/layout/Footer/FooterNavItem.js +0 -2
- package/cjs/layout/Footer/FooterNavItem.js.map +0 -1
- package/cjs/production/Button.js.map +0 -1
- package/components/icon/availableIcons.d.ts +0 -1
- package/components/icon/availableIcons.js +0 -2
- package/components/icon/availableIcons.js.map +0 -1
- package/components/tab/examples.d.ts +0 -3
- package/design/skoda/components/breakpoints.theme.js.map +0 -1
- package/design/skoda/components/container.theme.js.map +0 -1
- package/design/skoda/components/dialog.theme.js +0 -2
- package/design/skoda/components/dialog.theme.js.map +0 -1
- package/design/skoda/components/dialogActions.theme.js.map +0 -1
- package/design/skoda/components/dialogTitle.theme.js.map +0 -1
- package/design/skoda/components/filledInput.theme.js.map +0 -1
- package/design/skoda/components/formControl.theme.js.map +0 -1
- package/design/skoda/components/formControlLabel.theme.js.map +0 -1
- package/design/skoda/components/formHelperText.theme.js.map +0 -1
- package/design/skoda/components/formLabel.theme.js.map +0 -1
- package/design/skoda/components/grid.theme.js.map +0 -1
- package/design/skoda/components/input.theme.js.map +0 -1
- package/design/skoda/components/inputAdornment.theme.js.map +0 -1
- package/design/skoda/components/inputBase.theme.js.map +0 -1
- package/design/skoda/components/inputLabel.theme.js.map +0 -1
- package/design/skoda/components/radio.theme.js +0 -2
- package/design/skoda/components/radio.theme.js.map +0 -1
- package/design/skoda/components/select.theme.js +0 -2
- package/design/skoda/components/select.theme.js.map +0 -1
- package/design/skoda/components/slider.theme.js +0 -2
- package/design/skoda/components/slider.theme.js.map +0 -1
- package/design/skoda/components/stepper.theme.d.ts +0 -2
- package/design/skoda/components/stepper.theme.js +0 -2
- package/design/skoda/components/stepper.theme.js.map +0 -1
- package/design/skoda/components/switch.theme.js.map +0 -1
- package/design/skoda/components/textField.theme.js.map +0 -1
- package/layout/Footer/FooterNavItem.d.ts +0 -14
- package/layout/Footer/FooterNavItem.js +0 -2
- package/layout/Footer/FooterNavItem.js.map +0 -1
- package/production/Button.js.map +0 -1
- /package/cjs/design/skoda/components/{dialog.theme.d.ts → dialog/dialog.theme.d.ts} +0 -0
- /package/cjs/design/skoda/components/{dialogActions.theme.d.ts → dialog/dialogActions.theme.d.ts} +0 -0
- /package/cjs/design/skoda/components/{dialogActions.theme.js → dialog/dialogActions.theme.js} +0 -0
- /package/cjs/design/skoda/components/{dialogTitle.theme.d.ts → dialog/dialogTitle.theme.d.ts} +0 -0
- /package/cjs/design/skoda/components/{dialogTitle.theme.js → dialog/dialogTitle.theme.js} +0 -0
- /package/cjs/design/skoda/components/{filledInput.theme.d.ts → form/filledInput.theme.d.ts} +0 -0
- /package/cjs/design/skoda/components/{filledInput.theme.js → form/filledInput.theme.js} +0 -0
- /package/cjs/design/skoda/components/{formControl.theme.d.ts → form/formControl.theme.d.ts} +0 -0
- /package/cjs/design/skoda/components/{formControl.theme.js → form/formControl.theme.js} +0 -0
- /package/cjs/design/skoda/components/{formControlLabel.theme.d.ts → form/formControlLabel.theme.d.ts} +0 -0
- /package/cjs/design/skoda/components/{formControlLabel.theme.js → form/formControlLabel.theme.js} +0 -0
- /package/cjs/design/skoda/components/{formHelperText.theme.d.ts → form/formHelperText.theme.d.ts} +0 -0
- /package/cjs/design/skoda/components/{formHelperText.theme.js → form/formHelperText.theme.js} +0 -0
- /package/cjs/design/skoda/components/{formLabel.theme.d.ts → form/formLabel.theme.d.ts} +0 -0
- /package/cjs/design/skoda/components/{formLabel.theme.js → form/formLabel.theme.js} +0 -0
- /package/cjs/design/skoda/components/{input.theme.d.ts → form/input.theme.d.ts} +0 -0
- /package/cjs/design/skoda/components/{input.theme.js → form/input.theme.js} +0 -0
- /package/cjs/design/skoda/components/{inputAdornment.theme.d.ts → form/inputAdornment.theme.d.ts} +0 -0
- /package/cjs/design/skoda/components/{inputAdornment.theme.js → form/inputAdornment.theme.js} +0 -0
- /package/cjs/design/skoda/components/{inputBase.theme.d.ts → form/inputBase.theme.d.ts} +0 -0
- /package/cjs/design/skoda/components/{inputBase.theme.js → form/inputBase.theme.js} +0 -0
- /package/cjs/design/skoda/components/{inputLabel.theme.d.ts → form/inputLabel.theme.d.ts} +0 -0
- /package/cjs/design/skoda/components/{inputLabel.theme.js → form/inputLabel.theme.js} +0 -0
- /package/cjs/design/skoda/components/{radio.theme.d.ts → form/radio.theme.d.ts} +0 -0
- /package/cjs/design/skoda/components/{select.theme.d.ts → form/select.theme.d.ts} +0 -0
- /package/cjs/design/skoda/components/{slider.theme.d.ts → form/slider.theme.d.ts} +0 -0
- /package/cjs/design/skoda/components/{switch.theme.d.ts → form/switch.theme.d.ts} +0 -0
- /package/cjs/design/skoda/components/{switch.theme.js → form/switch.theme.js} +0 -0
- /package/cjs/design/skoda/components/{textField.theme.d.ts → form/textField.theme.d.ts} +0 -0
- /package/cjs/design/skoda/components/{textField.theme.js → form/textField.theme.js} +0 -0
- /package/cjs/design/skoda/components/{breakpoints.theme.d.ts → layout/breakpoints.theme.d.ts} +0 -0
- /package/cjs/design/skoda/components/{breakpoints.theme.js → layout/breakpoints.theme.js} +0 -0
- /package/cjs/design/skoda/components/{container.theme.d.ts → layout/container.theme.d.ts} +0 -0
- /package/cjs/design/skoda/components/{container.theme.js → layout/container.theme.js} +0 -0
- /package/cjs/design/skoda/components/{grid.theme.d.ts → layout/grid.theme.d.ts} +0 -0
- /package/cjs/design/skoda/components/{grid.theme.js → layout/grid.theme.js} +0 -0
- /package/cjs/production/{Button.js → Button/Button.js} +0 -0
- /package/design/skoda/components/{dialog.theme.d.ts → dialog/dialog.theme.d.ts} +0 -0
- /package/design/skoda/components/{dialogActions.theme.d.ts → dialog/dialogActions.theme.d.ts} +0 -0
- /package/design/skoda/components/{dialogActions.theme.js → dialog/dialogActions.theme.js} +0 -0
- /package/design/skoda/components/{dialogTitle.theme.d.ts → dialog/dialogTitle.theme.d.ts} +0 -0
- /package/design/skoda/components/{dialogTitle.theme.js → dialog/dialogTitle.theme.js} +0 -0
- /package/design/skoda/components/{filledInput.theme.d.ts → form/filledInput.theme.d.ts} +0 -0
- /package/design/skoda/components/{filledInput.theme.js → form/filledInput.theme.js} +0 -0
- /package/design/skoda/components/{formControl.theme.d.ts → form/formControl.theme.d.ts} +0 -0
- /package/design/skoda/components/{formControl.theme.js → form/formControl.theme.js} +0 -0
- /package/design/skoda/components/{formControlLabel.theme.d.ts → form/formControlLabel.theme.d.ts} +0 -0
- /package/design/skoda/components/{formControlLabel.theme.js → form/formControlLabel.theme.js} +0 -0
- /package/design/skoda/components/{formHelperText.theme.d.ts → form/formHelperText.theme.d.ts} +0 -0
- /package/design/skoda/components/{formHelperText.theme.js → form/formHelperText.theme.js} +0 -0
- /package/design/skoda/components/{formLabel.theme.d.ts → form/formLabel.theme.d.ts} +0 -0
- /package/design/skoda/components/{formLabel.theme.js → form/formLabel.theme.js} +0 -0
- /package/design/skoda/components/{input.theme.d.ts → form/input.theme.d.ts} +0 -0
- /package/design/skoda/components/{input.theme.js → form/input.theme.js} +0 -0
- /package/design/skoda/components/{inputAdornment.theme.d.ts → form/inputAdornment.theme.d.ts} +0 -0
- /package/design/skoda/components/{inputAdornment.theme.js → form/inputAdornment.theme.js} +0 -0
- /package/design/skoda/components/{inputBase.theme.d.ts → form/inputBase.theme.d.ts} +0 -0
- /package/design/skoda/components/{inputBase.theme.js → form/inputBase.theme.js} +0 -0
- /package/design/skoda/components/{inputLabel.theme.d.ts → form/inputLabel.theme.d.ts} +0 -0
- /package/design/skoda/components/{inputLabel.theme.js → form/inputLabel.theme.js} +0 -0
- /package/design/skoda/components/{radio.theme.d.ts → form/radio.theme.d.ts} +0 -0
- /package/design/skoda/components/{select.theme.d.ts → form/select.theme.d.ts} +0 -0
- /package/design/skoda/components/{slider.theme.d.ts → form/slider.theme.d.ts} +0 -0
- /package/design/skoda/components/{switch.theme.d.ts → form/switch.theme.d.ts} +0 -0
- /package/design/skoda/components/{switch.theme.js → form/switch.theme.js} +0 -0
- /package/design/skoda/components/{textField.theme.d.ts → form/textField.theme.d.ts} +0 -0
- /package/design/skoda/components/{textField.theme.js → form/textField.theme.js} +0 -0
- /package/design/skoda/components/{breakpoints.theme.d.ts → layout/breakpoints.theme.d.ts} +0 -0
- /package/design/skoda/components/{breakpoints.theme.js → layout/breakpoints.theme.js} +0 -0
- /package/design/skoda/components/{container.theme.d.ts → layout/container.theme.d.ts} +0 -0
- /package/design/skoda/components/{container.theme.js → layout/container.theme.js} +0 -0
- /package/design/skoda/components/{grid.theme.d.ts → layout/grid.theme.d.ts} +0 -0
- /package/design/skoda/components/{grid.theme.js → layout/grid.theme.js} +0 -0
- /package/production/{Button.js → Button/Button.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.js","sources":["../../../../src/components/modal/modal.tsx"],"sourcesContent":["import { __rest } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useCallback, useEffect, useState, forwardRef } from 'react';\nimport { styled } from '@mui/material/styles';\nimport MuiModal from '@mui/material/Modal';\nimport { Button } from '../button';\nimport { Icon } from '../icon';\nimport { ContentDiv } from './contentDiv';\nimport { useTheme } from '@mui/material';\n/**\n * @description Styled SkodaFlow Modal component\n * @param props ModalProps\n * @returns React Functional Component\n */\nexport const Modal = forwardRef((_a, ref) => {\n var { children, open, handleClose, onClickTopButton, onClickBottomButton, ariaLabelledby, ariaDescribedBy, firstButton, secondButton, hasCloseButton, size, firstButtonVariant, secondButtonVariant, secondButtonVisible, defaultButtonSection = true, maxWidth, modalLoadedCallback } = _a, props = __rest(_a, [\"children\", \"open\", \"handleClose\", \"onClickTopButton\", \"onClickBottomButton\", \"ariaLabelledby\", \"ariaDescribedBy\", \"firstButton\", \"secondButton\", \"hasCloseButton\", \"size\", \"firstButtonVariant\", \"secondButtonVariant\", \"secondButtonVisible\", \"defaultButtonSection\", \"maxWidth\", \"modalLoadedCallback\"]);\n const [isOverFlowing, setIsOverFlowing] = useState(false);\n const [desktopView, setDesktopView] = useState(false);\n const theme = useTheme();\n useEffect(() => {\n const mq = window.matchMedia(`(min-width: ${theme.breakpoints.values.md}px)`);\n setDesktopView(mq.matches);\n }, [theme.breakpoints.values.md]);\n const isCompactButton = useCallback(() => {\n const isModalLarge = (size || 'large') === 'large';\n if (desktopView && isModalLarge)\n return false;\n }, [desktopView, size]);\n return (_jsx(ModalStyled, Object.assign({}, props, { ref: ref, open: open, size: size, onClose: handleClose, isOverFlowing: isOverFlowing, \"aria-labelledby\": ariaLabelledby, \"aria-describedby\": ariaDescribedBy, compactButtons: isCompactButton(), maxWidth: maxWidth, \"data-testid\": \"Modal\", children: _jsxs(\"div\", { className: \"modal-container\", \"data-testid\": \"Modal.container\", children: [hasCloseButton && (_jsx(\"button\", { onClick: handleClose, \"data-testid\": \"Modal.close\", children: _jsx(Icon, {
|
|
1
|
+
{"version":3,"file":"modal.js","sources":["../../../../src/components/modal/modal.tsx"],"sourcesContent":["import { __rest } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useCallback, useEffect, useState, forwardRef } from 'react';\nimport { styled } from '@mui/material/styles';\nimport MuiModal from '@mui/material/Modal';\nimport { Button } from '../button';\nimport { Icon } from '../icon';\nimport { ContentDiv } from './contentDiv';\nimport { useTheme } from '@mui/material';\n/**\n * @description Styled SkodaFlow Modal component\n * @param props ModalProps\n * @returns React Functional Component\n */\nexport const Modal = forwardRef((_a, ref) => {\n var { children, open, handleClose, onClickTopButton, onClickBottomButton, ariaLabelledby, ariaDescribedBy, firstButton, secondButton, hasCloseButton, size, firstButtonVariant, secondButtonVariant, secondButtonVisible, defaultButtonSection = true, maxWidth, modalLoadedCallback, disableAutoFocus, disableEnforceFocus } = _a, props = __rest(_a, [\"children\", \"open\", \"handleClose\", \"onClickTopButton\", \"onClickBottomButton\", \"ariaLabelledby\", \"ariaDescribedBy\", \"firstButton\", \"secondButton\", \"hasCloseButton\", \"size\", \"firstButtonVariant\", \"secondButtonVariant\", \"secondButtonVisible\", \"defaultButtonSection\", \"maxWidth\", \"modalLoadedCallback\", \"disableAutoFocus\", \"disableEnforceFocus\"]);\n const [isOverFlowing, setIsOverFlowing] = useState(false);\n const [desktopView, setDesktopView] = useState(false);\n const theme = useTheme();\n useEffect(() => {\n const mq = window.matchMedia(`(min-width: ${theme.breakpoints.values.md}px)`);\n setDesktopView(mq.matches);\n }, [theme.breakpoints.values.md]);\n const isCompactButton = useCallback(() => {\n const isModalLarge = (size || 'large') === 'large';\n if (desktopView && isModalLarge)\n return false;\n }, [desktopView, size]);\n return (_jsx(ModalStyled, Object.assign({}, props, { ref: ref, open: open, size: size, onClose: handleClose, isOverFlowing: isOverFlowing, \"aria-labelledby\": ariaLabelledby, \"aria-describedby\": ariaDescribedBy, compactButtons: isCompactButton(), maxWidth: maxWidth, \"data-testid\": \"Modal\", disableEnforceFocus: disableEnforceFocus, disableAutoFocus: disableAutoFocus, children: _jsxs(\"div\", { className: \"modal-container\", \"data-testid\": \"Modal.container\", children: [hasCloseButton && (_jsx(\"button\", { onClick: handleClose, \"data-testid\": \"Modal.close\", children: _jsx(Icon, { name: \"close\", fontSize: \"medium\" }) })), _jsx(ContentDiv, { setIsOverFlowing: setIsOverFlowing, className: \"modal-container--content\", modalLoadedCallback: modalLoadedCallback, \"data-testid\": \"Modal.content\", children: children }), defaultButtonSection && (_jsxs(\"div\", { className: \"modal-container--action-buttons\", \"data-testid\": \"Modal.buttons\", children: [_jsx(Button, { label: firstButton, onClick: onClickTopButton, fullWidth: true, variant: firstButtonVariant, compact: isCompactButton(), \"data-testid\": \"Modal.button1\", \"data-variant\": firstButtonVariant }), secondButtonVisible && (_jsx(Button, { label: secondButton, onClick: onClickBottomButton, fullWidth: true, variant: secondButtonVariant, compact: isCompactButton(), \"data-testid\": \"Modal.button2\", \"data-variant\": secondButtonVariant }))] }))] }) })));\n});\n/**\n * @description Modal styling definition\n */\nconst ModalStyled = styled(MuiModal, {\n shouldForwardProp: (prop) => prop !== 'compactButtons' && prop !== 'isOverFlowing' && prop !== 'maxWidth',\n})((_a) => {\n var { theme } = _a, args = __rest(_a, [\"theme\"]);\n const bottomButtonPadding = args.compactButtons ? '16px' : '24px';\n const smallModalWidth = '408px';\n const largeModalWidth = '624px';\n const fullWidthModal = args.maxWidth ? args.maxWidth : 'calc(100% - 40px)';\n const isModalLarge = (args.size || 'large') === 'large';\n const isModalFullWidth = args.size && args.size === 'full-width';\n const sizeBasedStyles = isModalLarge\n ? { maxWidth: largeModalWidth, marginTop: '40px', padding: '40px' }\n : isModalFullWidth\n ? { maxWidth: fullWidthModal, marginTop: '40px', padding: '40px' }\n : {\n maxWidth: smallModalWidth,\n marginTop: '48px',\n padding: '24px 40px 40px 40px',\n };\n return {\n '& .modal-container': {\n maxHeight: 'calc(100vh - 64px)',\n minHeight: '300px',\n display: 'flex',\n flexDirection: 'column',\n '&--content': {\n overflowX: 'hidden',\n overflowY: 'overlay',\n marginTop: '48px',\n padding: '0px 24px',\n },\n '&--action-buttons': {\n padding: '32px 24px',\n paddingBottom: bottomButtonPadding,\n boxShadow: args.isOverFlowing ? '0px 0px 32px rgba(0, 0, 0, 0.15)' : null,\n 'div:first-of-type': {\n marginBottom: '15px',\n },\n },\n },\n [theme.breakpoints.up('md')]: {\n '& .modal-container': {\n maxHeight: 'calc(100vh - 160px)',\n margin: '0px',\n width: '100%',\n maxWidth: sizeBasedStyles.maxWidth,\n '&--content': {\n marginTop: sizeBasedStyles.marginTop,\n padding: '0px 40px',\n },\n '&--action-buttons': {\n padding: sizeBasedStyles.padding,\n paddingBottom: bottomButtonPadding,\n },\n },\n },\n };\n});\n//# sourceMappingURL=modal.js.map"],"names":["Modal","forwardRef","_a","ref","children","open","handleClose","onClickTopButton","onClickBottomButton","ariaLabelledby","ariaDescribedBy","firstButton","secondButton","hasCloseButton","size","firstButtonVariant","secondButtonVariant","secondButtonVisible","defaultButtonSection","maxWidth","modalLoadedCallback","disableAutoFocus","disableEnforceFocus","props","__rest","isOverFlowing","setIsOverFlowing","useState","desktopView","setDesktopView","theme","useTheme","useEffect","mq","window","matchMedia","breakpoints","values","md","matches","isCompactButton","useCallback","_jsx","jsx","ModalStyled","Object","assign","onClose","compactButtons","_jsxs","jsxs","className","onClick","Icon","name","fontSize","ContentDiv","Button","label","fullWidth","variant","compact","styled","MuiModal","shouldForwardProp","prop","args","bottomButtonPadding","fullWidthModal","isModalLarge","isModalFullWidth","sizeBasedStyles","marginTop","padding","maxHeight","minHeight","display","flexDirection","overflowX","overflowY","paddingBottom","boxShadow","marginBottom","up","margin","width"],"mappings":"wXAcY,MAACA,EAAQC,EAAUA,YAAC,CAACC,EAAIC,KACjC,IAAIC,SAAEA,EAAQC,KAAEA,EAAIC,YAAEA,EAAWC,iBAAEA,EAAgBC,oBAAEA,EAAmBC,eAAEA,EAAcC,gBAAEA,EAAeC,YAAEA,EAAWC,aAAEA,EAAYC,eAAEA,EAAcC,KAAEA,EAAIC,mBAAEA,EAAkBC,oBAAEA,EAAmBC,oBAAEA,EAAmBC,qBAAEA,GAAuB,EAAIC,SAAEA,EAAQC,oBAAEA,EAAmBC,iBAAEA,EAAgBC,oBAAEA,GAAwBpB,EAAIqB,EAAQC,EAAAA,OAAOtB,EAAI,CAAC,WAAY,OAAQ,cAAe,mBAAoB,sBAAuB,iBAAkB,kBAAmB,cAAe,eAAgB,iBAAkB,OAAQ,qBAAsB,sBAAuB,sBAAuB,uBAAwB,WAAY,sBAAuB,mBAAoB,wBACvpB,MAAOuB,EAAeC,GAAoBC,EAAQA,UAAC,IAC5CC,EAAaC,GAAkBF,EAAQA,UAAC,GACzCG,EAAQC,EAAAA,WACdC,EAAAA,WAAU,KACN,MAAMC,EAAKC,OAAOC,WAAW,eAAeL,EAAMM,YAAYC,OAAOC,SACrET,EAAeI,EAAGM,QAAQ,GAC3B,CAACT,EAAMM,YAAYC,OAAOC,KAC7B,MAAME,EAAkBC,EAAAA,aAAY,KAEhC,GAAIb,GADuC,WAArBd,GAAQ,SAE1B,OAAO,CAAK,GACjB,CAACc,EAAad,IACjB,OAAQ4B,EAAIC,IAACC,EAAaC,OAAOC,OAAO,CAAE,EAAEvB,EAAO,CAAEpB,IAAKA,EAAKE,KAAMA,EAAMS,KAAMA,EAAMiC,QAASzC,EAAamB,cAAeA,EAAe,kBAAmBhB,EAAgB,mBAAoBC,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AS,QACzDH,EACI,CAAEnD,SAAUiD,EAAgBI,UAAW,OAAQC,QAAS,QACxD,CACEtD,SAVY,QAWZqD,UAAW,OACXC,QAAS,uBAErB,MAAO,CACH,qBAAsB,CAClBC,UAAW,qBACXC,UAAW,QACXC,QAAS,OACTC,cAAe,SACf,aAAc,CACVC,UAAW,SACXC,UAAW,UACXP,UAAW,OACXC,QAAS,YAEb,oBAAqB,CACjBA,QAAS,YACTO,cAAeb,EACfc,UAAWf,EAAKzC,cAAgB,mCAAqC,KACrE,oBAAqB,CACjByD,aAAc,UAI1B,CAACpD,EAAMM,YAAY+C,GAAG,OAAQ,CAC1B,qBAAsB,CAClBT,UAAW,sBACXU,OAAQ,MACRC,MAAO,OACPlE,SAAUoD,EAAgBpD,SAC1B,aAAc,CACVqD,UAAWD,EAAgBC,UAC3BC,QAAS,YAEb,oBAAqB,CACjBA,QAASF,EAAgBE,QACzBO,cAAeb,KAI9B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),t=require("react/jsx-runtime"),i=require("@mui/material/Pagination"),n=require("@mui/material/PaginationItem"),
|
|
1
|
+
"use strict";var e=require("tslib"),t=require("react/jsx-runtime"),i=require("@mui/material/Pagination"),n=require("@mui/material/PaginationItem"),o=require("@mui/material/TextField"),r=require("@mui/material/styles"),a=require("react"),s=require("../../design/skoda/palette.theme.js"),l=require("../../utils/utilities.js"),d=require("../iconButton/index.js"),u=require("../icon/icon.js");function p(e){return e&&e.__esModule?e:{default:e}}require("../icon/icon.definitions.js");var c=p(i),x=p(n),m=p(o);const f=(e,t)=>""===e||"number"==typeof e&&e-1>0&&e+1<=t||"number"==typeof parseInt(e)&&parseInt(e)>0&&parseInt(e)<=t,h=(e,i,n,o,r,a)=>t.jsxs(d.IconButton,{variant:"standard",onClick:i,disabled:n,children:["forward"===o&&!r&&a,t.jsx(u.Icon,{name:e}),"back"===o&&!r&&a]}),g=a.forwardRef(((i,n)=>{var{count:o,isDisabled:r,page:s,prevButtonLabel:d,nextButtonLabel:p,defaultPage:g,hideNextButton:j,hidePrevButton:v,hideFirstButton:B,hideLastButton:w,hideLabels:y,onValueChange:C}=i,I=e.__rest(i,["count","isDisabled","page","prevButtonLabel","nextButtonLabel","defaultPage","hideNextButton","hidePrevButton","hideFirstButton","hideLastButton","hideLabels","onValueChange"]);const L=g||1,[q,k]=a.useState(L),[P,S]=a.useState(!0),[F,M]=a.useState();a.useEffect((()=>{q&&C&&C(q)}),[q,C]),a.useEffect((()=>{P?S(!1):s&&!r&&k(s)}),[r,P,s]);const z=a.useCallback(((e,t)=>{k(t)}),[]);return t.jsxs(b,{"data-testid":"Pagination-wrapper",children:[t.jsx(c.default,Object.assign({className:"desktopView"},I,{shape:"rounded",count:o,disabled:r,page:q,hideNextButton:j,hidePrevButton:v,showFirstButton:!B,showLastButton:!w,ref:n,onChange:z,renderItem:e=>t.jsx(x.default,Object.assign({className:l.ternaryCondition(v,!1,"MuiPagination-prev",""),components:{first:()=>t.jsx(u.Icon,{name:"previous",fontSize:"small"}),last:()=>t.jsx(u.Icon,{name:"next",fontSize:"small"}),previous:()=>t.jsxs(t.Fragment,{children:[t.jsx(u.Icon,{name:"chevron-left",fontSize:"small"}),t.jsx(t.Fragment,{children:d})]}),next:()=>t.jsxs(t.Fragment,{children:[t.jsx(t.Fragment,{children:p}),t.jsx(u.Icon,{name:"chevron-right",fontSize:"small"})]})}},e))}))," ",t.jsx("div",{style:{display:"flex",flexDirection:"column"},className:"mobileView "+(r?"paginationDisabled":""),children:t.jsxs("div",{className:"mobileContainer",children:[h("chevron-previous",(()=>f(q-1,o)&&k(1)),!f(q-1,o)),h("chevron-left",(()=>f(q-1,o)&&k(q-1)),!f(q-1,o),"back",y,d),t.jsx(m.default,{className:"textFieldContainer",value:q,inputProps:{inputMode:"numeric",pattern:`[1-${o}]*`},onChange:e=>(e=>{""===e&&(M(q),k(e));const t=parseInt(e);"number"==typeof t&&f(t,o)&&(M(t),k(t))})(e.target.value),onBlur:()=>""===q&&k(F)}),h("chevron-right",(()=>f(q+1,o)&&k(q+1)),!f(q+1,o),"forward",y,p),h("chevron-next",(()=>f(q+1,o)&&k(o)),!f(q+1,o))]})})]})})),b=r.styled("div")((({theme:e})=>{let t={};const i={alignItems:"center",display:"flex",justifyContent:"center",width:"100%"};return t={[e.breakpoints.up("md")]:{"& .mobileView":{display:"none!important"}},[e.breakpoints.down("md")]:{"& .desktopView":{display:"none!important"}},"& .desktopView":{"& .MuiButton-startIcon":{marginRight:"8px",display:"inline-flex"},"& .MuiButton-endIcon":{marginLeft:"8px",display:"inline-flex"}},"& .mobileView":Object.assign(Object.assign({},i),{flexDirection:"column",flexWrap:"nowrap","& .mobileContainer":Object.assign(Object.assign({},i),{flexWrap:"nowrap"}),"& .textFieldContainer":{height:"36px",margin:"0 34px","& input, fieldset":{backgroundColor:s.flowColors.transparent.primary,border:0,borderRadius:"4px",fontSize:"16px",fontWeight:"400",height:"36px",lineHeight:"36px",minWidth:"44px",maxWidth:"50px",padding:"0 4px",textAlign:"center",color:s.flowColors.text.primary},"& fieldset":{visibility:"hidden"},"& div":{"&::before":{borderBottom:0},"&::after":{borderBottom:0}}},"& .controllerContainer":{"& .arrowLabel":{color:s.flowColors.text.primary,fontSize:"16px",fontWeight:"400",lineHeight:"16px"},"& .MuiButton-startIcon":{marginRight:"8px",display:"inline-flex"},"& .MuiButton-endIcon":{marginLeft:"8px",display:"inline-flex"},"& .MuiIcon-root":{fontSize:"16px",width:"20px",height:"20px"}},"& .counter_label":{color:s.flowColors.text.primary,fontSize:"12px",fontWeight:"400",lineHeight:"24px",marginTop:"4px"},"&.paginationDisabled":{pointerEvents:"none","& .counter_label, .MuiIcon-root,.arrowLabel, input, fieldset":{color:s.flowColors.disabled.primary}}})},t}));exports.Pagination=g;
|
|
2
2
|
//# sourceMappingURL=pagination.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.js","sources":["../../../../src/components/pagination/pagination.tsx"],"sourcesContent":["import { __rest } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport MuiPagination from '@mui/material/Pagination';\nimport MuiPaginationItem from '@mui/material/PaginationItem';\nimport TextField from '@mui/material/TextField';\nimport { styled } from '@mui/material/styles';\nimport { forwardRef, useCallback, useEffect, useState } from 'react';\nimport { flowColors } from '../../design/skoda/palette.theme';\nimport { ternaryCondition } from '../../utils/utilities';\nimport { IconButton } from '../iconButton';\nimport { Icon } from '../icon';\n/**\n * @description SkodaFlow Pagination component.\n * Properties are inherited from HTML div Attribetes element.\n * @param props PaginationProps\n * @returns React Functional Component\n */\nconst isPageNumberValid = (pageNumber, count) => {\n return (pageNumber === '' ||\n (typeof pageNumber === 'number' && pageNumber - 1 > 0 && pageNumber + 1 <= count) ||\n (typeof parseInt(pageNumber) === 'number' && parseInt(pageNumber) > 0 && parseInt(pageNumber) <= count));\n};\nconst mobileIconButton = (muiIcon, onClick, disabled, direction, hideLabel, label) => (_jsxs(IconButton, { variant: \"standard\", onClick: onClick, disabled: disabled, children: [direction === 'forward' && !hideLabel && label, _jsx(Icon, { className: muiIcon }), direction === 'back' && !hideLabel && label] }));\nexport const Pagination = forwardRef((_a, ref) => {\n var { count, isDisabled, page, prevButtonLabel, nextButtonLabel, defaultPage, hideNextButton, hidePrevButton, hideFirstButton, hideLastButton, hideLabels, onValueChange } = _a, props = __rest(_a, [\"count\", \"isDisabled\", \"page\", \"prevButtonLabel\", \"nextButtonLabel\", \"defaultPage\", \"hideNextButton\", \"hidePrevButton\", \"hideFirstButton\", \"hideLastButton\", \"hideLabels\", \"onValueChange\"]);\n const initialPage = defaultPage || 1;\n const [currentPageNumber, setCurrentPageNumber] = useState(initialPage);\n const [isFirstMount, setIsFirstMount] = useState(true);\n const [prevStatePageNumber, setPrevStatePageNumber] = useState();\n useEffect(() => {\n currentPageNumber && onValueChange && onValueChange(currentPageNumber);\n }, [currentPageNumber, onValueChange]);\n useEffect(() => {\n isFirstMount ? setIsFirstMount(false) : page && !isDisabled && setCurrentPageNumber(page);\n }, [isDisabled, isFirstMount, page]);\n const handleChange = useCallback((event, pageNumber) => {\n setCurrentPageNumber(pageNumber);\n }, []);\n const handleValueChange = (payload) => {\n if (payload === '') {\n setPrevStatePageNumber(currentPageNumber);\n setCurrentPageNumber(payload);\n }\n const castToNum = parseInt(payload);\n if (typeof castToNum === 'number' && isPageNumberValid(castToNum, count)) {\n setPrevStatePageNumber(castToNum);\n setCurrentPageNumber(castToNum);\n }\n };\n const mobilePagination = () => (_jsx(\"div\", { style: { display: 'flex', flexDirection: 'column' }, className: `mobileView ${isDisabled ? 'paginationDisabled' : ''}`, children: _jsxs(\"div\", { className: \"mobileContainer\", children: [mobileIconButton('chevron-previous', () => isPageNumberValid(currentPageNumber - 1, count) && setCurrentPageNumber(1), !isPageNumberValid(currentPageNumber - 1, count)), mobileIconButton('cehvron-left', () => isPageNumberValid(currentPageNumber - 1, count) && setCurrentPageNumber(currentPageNumber - 1), !isPageNumberValid(currentPageNumber - 1, count), 'back', hideLabels, prevButtonLabel), _jsx(TextField, { className: \"textFieldContainer\", value: currentPageNumber, inputProps: { inputMode: 'numeric', pattern: `[1-${count}]*` }, onChange: (val) => handleValueChange(val.target.value), onBlur: () => currentPageNumber === '' && setCurrentPageNumber(prevStatePageNumber) }), mobileIconButton('chevron-right', () => isPageNumberValid(currentPageNumber + 1, count) && setCurrentPageNumber(currentPageNumber + 1), !isPageNumberValid(currentPageNumber + 1, count), 'forward', hideLabels, nextButtonLabel), mobileIconButton('chevron-next', () => isPageNumberValid(currentPageNumber + 1, count) && setCurrentPageNumber(count), !isPageNumberValid(currentPageNumber + 1, count))] }) }));\n const desktopPagination = () => (_jsx(MuiPagination, Object.assign({ className: \"desktopView\" }, props, { shape: \"rounded\", count: count, disabled: isDisabled, page: currentPageNumber, hideNextButton: hideNextButton, hidePrevButton: hidePrevButton, showFirstButton: !hideFirstButton, showLastButton: !hideLastButton, ref: ref, onChange: handleChange, renderItem: (item) => (_jsx(MuiPaginationItem, Object.assign({ className: ternaryCondition(hidePrevButton, false, 'MuiPagination-prev', ''), components: {\n first: () => _jsx(Icon, { className: 'play-previous', fontSize: \"small\" }),\n last: () => _jsx(Icon, { className: 'play-next', fontSize: \"small\" }),\n previous: () => (_jsxs(_Fragment, { children: [_jsx(Icon, { className: 'cehvron-left', fontSize: \"small\" }), _jsx(_Fragment, { children: prevButtonLabel })] })),\n next: () => (_jsxs(_Fragment, { children: [_jsx(_Fragment, { children: nextButtonLabel }), _jsx(Icon, { className: 'chevron-right', fontSize: \"small\" })] })),\n } }, item))) })));\n return (_jsxs(PaginationStyled, { \"data-testid\": \"Pagination-wrapper\", children: [desktopPagination(), \" \", mobilePagination()] }));\n});\n/**\n * @description Pagination styling definition based on props\n */\nconst PaginationStyled = styled('div')(({ theme }) => {\n let style = {};\n const flexStyle = {\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'center',\n width: '100%',\n };\n style = {\n [theme.breakpoints.up('md')]: {\n '& .mobileView': {\n display: 'none!important',\n },\n },\n [theme.breakpoints.down('md')]: {\n '& .desktopView': {\n display: 'none!important',\n },\n },\n '& .desktopView': {\n '& .MuiButton-startIcon': {\n marginRight: '8px',\n display: 'inline-flex',\n },\n '& .MuiButton-endIcon': {\n marginLeft: '8px',\n display: 'inline-flex',\n },\n },\n '& .mobileView': Object.assign(Object.assign({}, flexStyle), { flexDirection: 'column', flexWrap: 'nowrap', '& .mobileContainer': Object.assign(Object.assign({}, flexStyle), { flexWrap: 'nowrap' }), '& .textFieldContainer': {\n height: '36px',\n margin: '0 34px',\n '& input, fieldset': {\n backgroundColor: flowColors.transparent.primary,\n border: 0,\n borderRadius: '4px',\n fontSize: '16px',\n fontWeight: '400',\n height: '36px',\n lineHeight: '36px',\n minWidth: '44px',\n maxWidth: '50px',\n padding: '0 4px',\n textAlign: 'center',\n color: flowColors.text.primary,\n },\n '& fieldset': {\n visibility: 'hidden',\n },\n '& div': {\n '&::before': {\n borderBottom: 0,\n },\n '&::after': {\n borderBottom: 0,\n },\n },\n }, '& .controllerContainer': {\n '& .arrowLabel': {\n color: flowColors.text.primary,\n fontSize: '16px',\n fontWeight: '400',\n lineHeight: '16px',\n },\n '& .MuiButton-startIcon': {\n marginRight: '8px',\n display: 'inline-flex',\n },\n '& .MuiButton-endIcon': {\n marginLeft: '8px',\n display: 'inline-flex',\n },\n '& .MuiIcon-root': {\n fontSize: '16px',\n width: '20px',\n height: '20px',\n },\n }, '& .counter_label': {\n color: flowColors.text.primary,\n fontSize: '12px',\n fontWeight: '400',\n lineHeight: '24px',\n marginTop: '4px',\n }, '&.paginationDisabled': {\n pointerEvents: 'none',\n '& .counter_label, .MuiIcon-root,.arrowLabel, input, fieldset': {\n color: flowColors.disabled.primary,\n },\n } }),\n };\n return style;\n});\n//# sourceMappingURL=pagination.js.map"],"names":["isPageNumberValid","pageNumber","count","parseInt","mobileIconButton","muiIcon","onClick","disabled","direction","hideLabel","label","_jsxs","jsxs","IconButton","variant","children","_jsx","jsx","Icon","className","Pagination","forwardRef","_a","ref","isDisabled","page","prevButtonLabel","nextButtonLabel","defaultPage","hideNextButton","hidePrevButton","hideFirstButton","hideLastButton","hideLabels","onValueChange","props","__rest","initialPage","currentPageNumber","setCurrentPageNumber","useState","isFirstMount","setIsFirstMount","prevStatePageNumber","setPrevStatePageNumber","useEffect","handleChange","useCallback","event","PaginationStyled","MuiPagination","Object","assign","shape","showFirstButton","showLastButton","onChange","renderItem","item","MuiPaginationItem","default","ternaryCondition","components","first","fontSize","last","previous","_Fragment","Fragment","next","style","display","flexDirection","TextField","value","inputProps","inputMode","pattern","val","payload","castToNum","handleValueChange","target","onBlur","styled","theme","flexStyle","alignItems","justifyContent","width","breakpoints","up","down","marginRight","marginLeft","flexWrap","height","margin","backgroundColor","flowColors","transparent","primary","border","borderRadius","fontWeight","lineHeight","minWidth","maxWidth","padding","textAlign","color","text","visibility","borderBottom","marginTop","pointerEvents"],"mappings":"idAiBA,MA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AAEkC,GAAY,CAAES,SAAU,WAAa,wBAAyB,CACxNC,OAAQ,OACRC,OAAQ,SACR,oBAAqB,CACjBC,gBAAiBC,EAAAA,WAAWC,YAAYC,QACxCC,OAAQ,EACRC,aAAc,MACdvC,SAAU,OACVwC,WAAY,MACZR,OAAQ,OACRS,WAAY,OACZC,SAAU,OACVC,SAAU,OACVC,QAAS,QACTC,UAAW,SACXC,MAAOX,EAAAA,WAAWY,KAAKV,SAE3B,aAAc,CACVW,WAAY,UAEhB,QAAS,CACL,YAAa,CACTC,aAAc,GAElB,WAAY,CACRA,aAAc,KAGvB,yBAA0B,CACzB,gBAAiB,CACbH,MAAOX,EAAAA,WAAWY,KAAKV,QACvBrC,SAAU,OACVwC,WAAY,MACZC,WAAY,QAEhB,yBAA0B,CACtBZ,YAAa,MACbtB,QAAS,eAEb,uBAAwB,CACpBuB,WAAY,MACZvB,QAAS,eAEb,kBAAmB,CACfP,SAAU,OACVyB,MAAO,OACPO,OAAQ,SAEb,mBAAoB,CACnBc,MAAOX,EAAAA,WAAWY,KAAKV,QACvBrC,SAAU,OACVwC,WAAY,MACZC,WAAY,OACZS,UAAW,OACZ,uBAAwB,CACvBC,cAAe,OACf,+DAAgE,CAC5DL,MAAOX,EAAAA,WAAW5F,SAAS8F,aAIpC/B,CAAK"}
|
|
1
|
+
{"version":3,"file":"pagination.js","sources":["../../../../src/components/pagination/pagination.tsx"],"sourcesContent":["import { __rest } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport MuiPagination from '@mui/material/Pagination';\nimport MuiPaginationItem from '@mui/material/PaginationItem';\nimport TextField from '@mui/material/TextField';\nimport { styled } from '@mui/material/styles';\nimport { forwardRef, useCallback, useEffect, useState } from 'react';\nimport { flowColors } from '../../design/skoda/palette.theme';\nimport { ternaryCondition } from '../../utils/utilities';\nimport { IconButton } from '../iconButton';\nimport { Icon } from '../icon';\n/**\n * @description SkodaFlow Pagination component.\n * Properties are inherited from HTML div Attribetes element.\n * @param props PaginationProps\n * @returns React Functional Component\n */\nconst isPageNumberValid = (pageNumber, count) => {\n return (pageNumber === '' ||\n (typeof pageNumber === 'number' && pageNumber - 1 > 0 && pageNumber + 1 <= count) ||\n (typeof parseInt(pageNumber) === 'number' && parseInt(pageNumber) > 0 && parseInt(pageNumber) <= count));\n};\nconst mobileIconButton = (muiIcon, onClick, disabled, direction, hideLabel, label) => (_jsxs(IconButton, { variant: \"standard\", onClick: onClick, disabled: disabled, children: [direction === 'forward' && !hideLabel && label, _jsx(Icon, { name: muiIcon }), direction === 'back' && !hideLabel && label] }));\nexport const Pagination = forwardRef((_a, ref) => {\n var { count, isDisabled, page, prevButtonLabel, nextButtonLabel, defaultPage, hideNextButton, hidePrevButton, hideFirstButton, hideLastButton, hideLabels, onValueChange } = _a, props = __rest(_a, [\"count\", \"isDisabled\", \"page\", \"prevButtonLabel\", \"nextButtonLabel\", \"defaultPage\", \"hideNextButton\", \"hidePrevButton\", \"hideFirstButton\", \"hideLastButton\", \"hideLabels\", \"onValueChange\"]);\n const initialPage = defaultPage || 1;\n const [currentPageNumber, setCurrentPageNumber] = useState(initialPage);\n const [isFirstMount, setIsFirstMount] = useState(true);\n const [prevStatePageNumber, setPrevStatePageNumber] = useState();\n useEffect(() => {\n currentPageNumber && onValueChange && onValueChange(currentPageNumber);\n }, [currentPageNumber, onValueChange]);\n useEffect(() => {\n isFirstMount ? setIsFirstMount(false) : page && !isDisabled && setCurrentPageNumber(page);\n }, [isDisabled, isFirstMount, page]);\n const handleChange = useCallback((event, pageNumber) => {\n setCurrentPageNumber(pageNumber);\n }, []);\n const handleValueChange = (payload) => {\n if (payload === '') {\n setPrevStatePageNumber(currentPageNumber);\n setCurrentPageNumber(payload);\n }\n const castToNum = parseInt(payload);\n if (typeof castToNum === 'number' && isPageNumberValid(castToNum, count)) {\n setPrevStatePageNumber(castToNum);\n setCurrentPageNumber(castToNum);\n }\n };\n const mobilePagination = () => (_jsx(\"div\", { style: { display: 'flex', flexDirection: 'column' }, className: `mobileView ${isDisabled ? 'paginationDisabled' : ''}`, children: _jsxs(\"div\", { className: \"mobileContainer\", children: [mobileIconButton('chevron-previous', () => isPageNumberValid(currentPageNumber - 1, count) && setCurrentPageNumber(1), !isPageNumberValid(currentPageNumber - 1, count)), mobileIconButton('chevron-left', () => isPageNumberValid(currentPageNumber - 1, count) && setCurrentPageNumber(currentPageNumber - 1), !isPageNumberValid(currentPageNumber - 1, count), 'back', hideLabels, prevButtonLabel), _jsx(TextField, { className: \"textFieldContainer\", value: currentPageNumber, inputProps: { inputMode: 'numeric', pattern: `[1-${count}]*` }, onChange: (val) => handleValueChange(val.target.value), onBlur: () => currentPageNumber === '' && setCurrentPageNumber(prevStatePageNumber) }), mobileIconButton('chevron-right', () => isPageNumberValid(currentPageNumber + 1, count) && setCurrentPageNumber(currentPageNumber + 1), !isPageNumberValid(currentPageNumber + 1, count), 'forward', hideLabels, nextButtonLabel), mobileIconButton('chevron-next', () => isPageNumberValid(currentPageNumber + 1, count) && setCurrentPageNumber(count), !isPageNumberValid(currentPageNumber + 1, count))] }) }));\n const desktopPagination = () => (_jsx(MuiPagination, Object.assign({ className: \"desktopView\" }, props, { shape: \"rounded\", count: count, disabled: isDisabled, page: currentPageNumber, hideNextButton: hideNextButton, hidePrevButton: hidePrevButton, showFirstButton: !hideFirstButton, showLastButton: !hideLastButton, ref: ref, onChange: handleChange, renderItem: (item) => (_jsx(MuiPaginationItem, Object.assign({ className: ternaryCondition(hidePrevButton, false, 'MuiPagination-prev', ''), components: {\n first: () => _jsx(Icon, { name: \"previous\", fontSize: \"small\" }),\n last: () => _jsx(Icon, { name: \"next\", fontSize: \"small\" }),\n previous: () => (_jsxs(_Fragment, { children: [_jsx(Icon, { name: \"chevron-left\", fontSize: \"small\" }), _jsx(_Fragment, { children: prevButtonLabel })] })),\n next: () => (_jsxs(_Fragment, { children: [_jsx(_Fragment, { children: nextButtonLabel }), _jsx(Icon, { name: \"chevron-right\", fontSize: \"small\" })] })),\n } }, item))) })));\n return (_jsxs(PaginationStyled, { \"data-testid\": \"Pagination-wrapper\", children: [desktopPagination(), \" \", mobilePagination()] }));\n});\n/**\n * @description Pagination styling definition based on props\n */\nconst PaginationStyled = styled('div')(({ theme }) => {\n let style = {};\n const flexStyle = {\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'center',\n width: '100%',\n };\n style = {\n [theme.breakpoints.up('md')]: {\n '& .mobileView': {\n display: 'none!important',\n },\n },\n [theme.breakpoints.down('md')]: {\n '& .desktopView': {\n display: 'none!important',\n },\n },\n '& .desktopView': {\n '& .MuiButton-startIcon': {\n marginRight: '8px',\n display: 'inline-flex',\n },\n '& .MuiButton-endIcon': {\n marginLeft: '8px',\n display: 'inline-flex',\n },\n },\n '& .mobileView': Object.assign(Object.assign({}, flexStyle), { flexDirection: 'column', flexWrap: 'nowrap', '& .mobileContainer': Object.assign(Object.assign({}, flexStyle), { flexWrap: 'nowrap' }), '& .textFieldContainer': {\n height: '36px',\n margin: '0 34px',\n '& input, fieldset': {\n backgroundColor: flowColors.transparent.primary,\n border: 0,\n borderRadius: '4px',\n fontSize: '16px',\n fontWeight: '400',\n height: '36px',\n lineHeight: '36px',\n minWidth: '44px',\n maxWidth: '50px',\n padding: '0 4px',\n textAlign: 'center',\n color: flowColors.text.primary,\n },\n '& fieldset': {\n visibility: 'hidden',\n },\n '& div': {\n '&::before': {\n borderBottom: 0,\n },\n '&::after': {\n borderBottom: 0,\n },\n },\n }, '& .controllerContainer': {\n '& .arrowLabel': {\n color: flowColors.text.primary,\n fontSize: '16px',\n fontWeight: '400',\n lineHeight: '16px',\n },\n '& .MuiButton-startIcon': {\n marginRight: '8px',\n display: 'inline-flex',\n },\n '& .MuiButton-endIcon': {\n marginLeft: '8px',\n display: 'inline-flex',\n },\n '& .MuiIcon-root': {\n fontSize: '16px',\n width: '20px',\n height: '20px',\n },\n }, '& .counter_label': {\n color: flowColors.text.primary,\n fontSize: '12px',\n fontWeight: '400',\n lineHeight: '24px',\n marginTop: '4px',\n }, '&.paginationDisabled': {\n pointerEvents: 'none',\n '& .counter_label, .MuiIcon-root,.arrowLabel, input, fieldset': {\n color: flowColors.disabled.primary,\n },\n } }),\n };\n return style;\n});\n//# sourceMappingURL=pagination.js.map"],"names":["isPageNumberValid","pageNumber","count","parseInt","mobileIconButton","muiIcon","onClick","disabled","direction","hideLabel","label","_jsxs","jsxs","IconButton","variant","children","_jsx","jsx","Icon","name","Pagination","forwardRef","_a","ref","isDisabled","page","prevButtonLabel","nextButtonLabel","defaultPage","hideNextButton","hidePrevButton","hideFirstButton","hideLastButton","hideLabels","onValueChange","props","__rest","initialPage","currentPageNumber","setCurrentPageNumber","useState","isFirstMount","setIsFirstMount","prevStatePageNumber","setPrevStatePageNumber","useEffect","handleChange","useCallback","event","PaginationStyled","MuiPagination","Object","assign","className","shape","showFirstButton","showLastButton","onChange","renderItem","item","MuiPaginationItem","default","ternaryCondition","components","first","fontSize","last","previous","_Fragment","Fragment","next","style","display","flexDirection","TextField","value","inputProps","inputMode","pattern","val","payload","castToNum","handleValueChange","target","onBlur","styled","theme","flexStyle","alignItems","justifyContent","width","breakpoints","up","down","marginRight","marginLeft","flexWrap","height","margin","backgroundColor","flowColors","transparent","primary","border","borderRadius","fontWeight","lineHeight","minWidth","maxWidth","padding","textAlign","color","text","visibility","borderBottom","marginTop","pointerEvents"],"mappings":"wfAiBA,MAAMA,EAAoB,CAACC,EAAYC,IACZ,KAAfD,GACmB,iBAAfA,GAA2BA,EAAa,EAAI,GAAKA,EAAa,GAAKC,GAC1C,iBAAzBC,SAASF,IAA4BE,SAASF,GAAc,GAAKE,SAASF,IAAeC,EAEnGE,EAAmB,CAACC,EAASC,EAASC,EAAUC,EAAWC,EAAWC,IAAWC,EAAKC,KAACC,EAAUA,WAAE,CAAEC,QAAS,WAAYR,QAASA,EAASC,SAAUA,EAAUQ,SAAU,CAAe,YAAdP,IAA4BC,GAAaC,EAAOM,EAAIC,IAACC,EAA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B,yBAA0B,CACzB,gBAAiB,CACbH,MAAOX,EAAAA,WAAWY,KAAKV,QACvBrC,SAAU,OACVwC,WAAY,MACZC,WAAY,QAEhB,yBAA0B,CACtBZ,YAAa,MACbtB,QAAS,eAEb,uBAAwB,CACpBuB,WAAY,MACZvB,QAAS,eAEb,kBAAmB,CACfP,SAAU,OACVyB,MAAO,OACPO,OAAQ,SAEb,mBAAoB,CACnBc,MAAOX,EAAAA,WAAWY,KAAKV,QACvBrC,SAAU,OACVwC,WAAY,MACZC,WAAY,OACZS,UAAW,OACZ,uBAAwB,CACvBC,cAAe,OACf,+DAAgE,CAC5DL,MAAOX,EAAAA,WAAW7F,SAAS+F,aAIpC/B,CAAK"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),a=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";var e=require("tslib"),a=require("react/jsx-runtime"),i=require("@mui/material"),r=require("react"),t=require("../../icon/icon.js");require("../../icon/icon.definitions.js");var s=require("./styledProgressBarMessage.js");const n=r.forwardRef(((i,r)=>{var{state:n,errorMessage:l,successMessage:d,loaderSize:c,loadingPercentage:g,loadingPercentageDescribeText:m}=i,x=e.__rest(i,["state","errorMessage","successMessage","loaderSize","loadingPercentage","loadingPercentageDescribeText"]);return"error"===n?a.jsxs(s.StyledProgressBarMessage,{state:n,hasJustifyContent:!0,"data-testid":"Loader",children:[a.jsx(t.Icon,{name:"circle-close",fontSize:"medium",iconStyle:"filled"}),a.jsx("span",{className:"message",children:l})]}):"success"===n?a.jsxs(s.StyledProgressBarMessage,{state:n,hasJustifyContent:!0,"data-testid":"Loader",children:[a.jsx(t.Icon,{name:"circle-check",fontSize:"medium",iconStyle:"filled",color:"primary"}),a.jsx("span",{className:"message",children:d})]}):a.jsxs(o,Object.assign({loaderSize:c,loadingPercentage:g},x,{ref:r,"data-testid":"Loader",children:[(Boolean(g)||0===g)&&a.jsx("span",{className:"loading-text","data-testid":"Loader.percentage",children:m?`${m} ${g} %`:`${g} %`}),a.jsx("div",{className:"bar",children:a.jsx("div",{className:"mainBar"})})]}))})),o=i.styled("div",{shouldForwardProp:e=>"loaderSize"!==e&&"loadingPercentage"!==e})((a=>{var{theme:i}=a,r=e.__rest(a,["theme"]);const t="small"===r.loaderSize?"4px":"8px",s={width:"100%",maxWidth:"0",height:t,background:i.palette.brand.primary,animation:"animate 8s infinite",transition:null};(r.loadingPercentage||0===r.loadingPercentage)&&(s.maxWidth=`${r.loadingPercentage}%`,s.animation=null,s.transition="max-width 1s");let n={};return n={fontSize:"14px",lineHeight:"20px",color:i.palette.onSurface.os900,display:"flex",flexDirection:"column",fontWeight:500,"& .loading-text":{alignSelf:"flex-end",marginBottom:"4px",fontSize:"14px",lineHeight:"20px",color:i.palette.onSurface.os900},"@keyframes animate":{" 0%":{maxWidth:"0%"},"20%":{maxWidth:"20%"},"50%":{maxWidth:"50%"},"100%":{maxWidth:"100%"}},"& .bar":{width:" 100%",height:t,overflow:"hidden",background:i.palette.onSurface.os100,display:"inline-block","& > .mainBar":s}},n}));exports.Loader=n;
|
|
2
2
|
//# sourceMappingURL=loader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","sources":["../../../../../src/components/progressBar/components/loader.tsx"],"sourcesContent":["import { __rest } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { styled } from '@mui/material';\nimport { forwardRef } from 'react';\nimport { Icon } from '../../icon';\nimport { StyledProgressBarMessage } from './styledProgressBarMessage';\nexport const Loader = forwardRef((_a, ref) => {\n var { state, errorMessage, successMessage, loaderSize, loadingPercentage, loadingPercentageDescribeText } = _a, props = __rest(_a, [\"state\", \"errorMessage\", \"successMessage\", \"loaderSize\", \"loadingPercentage\", \"loadingPercentageDescribeText\"]);\n if (state === 'error')\n return (_jsxs(StyledProgressBarMessage, { state: state, hasJustifyContent: true, \"data-testid\": \"Loader\", children: [_jsx(Icon, {
|
|
1
|
+
{"version":3,"file":"loader.js","sources":["../../../../../src/components/progressBar/components/loader.tsx"],"sourcesContent":["import { __rest } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { styled } from '@mui/material';\nimport { forwardRef } from 'react';\nimport { Icon } from '../../icon';\nimport { StyledProgressBarMessage } from './styledProgressBarMessage';\nexport const Loader = forwardRef((_a, ref) => {\n var { state, errorMessage, successMessage, loaderSize, loadingPercentage, loadingPercentageDescribeText } = _a, props = __rest(_a, [\"state\", \"errorMessage\", \"successMessage\", \"loaderSize\", \"loadingPercentage\", \"loadingPercentageDescribeText\"]);\n if (state === 'error')\n return (_jsxs(StyledProgressBarMessage, { state: state, hasJustifyContent: true, \"data-testid\": \"Loader\", children: [_jsx(Icon, { name: \"circle-close\", fontSize: \"medium\", iconStyle: \"filled\" }), _jsx(\"span\", { className: \"message\", children: errorMessage })] }));\n if (state === 'success')\n return (_jsxs(StyledProgressBarMessage, { state: state, hasJustifyContent: true, \"data-testid\": \"Loader\", children: [_jsx(Icon, { name: \"circle-check\", fontSize: \"medium\", iconStyle: \"filled\", color: \"primary\" }), _jsx(\"span\", { className: \"message\", children: successMessage })] }));\n return (_jsxs(StyledLoader, Object.assign({ loaderSize: loaderSize, loadingPercentage: loadingPercentage }, props, { ref: ref, \"data-testid\": \"Loader\", children: [(Boolean(loadingPercentage) || loadingPercentage === 0) && (_jsx(\"span\", { className: \"loading-text\", \"data-testid\": \"Loader.percentage\", children: loadingPercentageDescribeText\n ? `${loadingPercentageDescribeText} ${loadingPercentage} %`\n : `${loadingPercentage} %` })), _jsx(\"div\", { className: \"bar\", children: _jsx(\"div\", { className: \"mainBar\" }) })] })));\n});\nconst StyledLoader = styled('div', {\n shouldForwardProp: (prop) => prop !== 'loaderSize' && prop !== 'loadingPercentage',\n})((_a) => {\n var { theme } = _a, args = __rest(_a, [\"theme\"]);\n const height = args.loaderSize === 'small' ? '4px' : '8px';\n const mainBarStyles = {\n width: '100%',\n maxWidth: '0',\n height: height,\n background: theme.palette.brand.primary,\n animation: 'animate 8s infinite',\n transition: null,\n };\n if (args.loadingPercentage || args.loadingPercentage === 0) {\n mainBarStyles.maxWidth = `${args.loadingPercentage}%`;\n mainBarStyles.animation = null;\n mainBarStyles.transition = 'max-width 1s';\n }\n let styles = {};\n styles = {\n fontSize: '14px',\n lineHeight: '20px',\n color: theme.palette.onSurface.os900,\n display: 'flex',\n flexDirection: 'column',\n fontWeight: 500,\n '& .loading-text': {\n alignSelf: 'flex-end',\n marginBottom: '4px',\n fontSize: '14px',\n lineHeight: '20px',\n color: theme.palette.onSurface.os900,\n },\n '@keyframes animate': {\n ' 0%': {\n maxWidth: '0%',\n },\n '20%': {\n maxWidth: '20%',\n },\n '50%': {\n maxWidth: '50%',\n },\n '100%': {\n maxWidth: '100%',\n },\n },\n '& .bar': {\n width: ' 100%',\n height: height,\n overflow: 'hidden',\n background: theme.palette.onSurface.os100,\n display: 'inline-block',\n '& > .mainBar': mainBarStyles,\n },\n };\n return styles;\n});\n//# sourceMappingURL=loader.js.map"],"names":["Loader","forwardRef","_a","ref","state","errorMessage","successMessage","loaderSize","loadingPercentage","loadingPercentageDescribeText","props","__rest","_jsxs","jsxs","StyledProgressBarMessage","hasJustifyContent","children","_jsx","Icon","name","fontSize","iconStyle","className","color","jsx","StyledLoader","Object","assign","Boolean","styled","shouldForwardProp","prop","theme","args","height","mainBarStyles","width","maxWidth","background","palette","brand","primary","animation","transition","styles","lineHeight","onSurface","os900","display","flexDirection","fontWeight","alignSelf","marginBottom","overflow","os100"],"mappings":"0OAMY,MAACA,EAASC,EAAUA,YAAC,CAACC,EAAIC,KAClC,IAAIC,MAAEA,EAAKC,aAAEA,EAAYC,eAAEA,EAAcC,WAAEA,EAAUC,kBAAEA,EAAiBC,8BAAEA,GAAkCP,EAAIQ,EAAQC,EAAAA,OAAOT,EAAI,CAAC,QAAS,eAAgB,iBAAkB,aAAc,oBAAqB,kCAClN,MAAc,UAAVE,EACQQ,EAAKC,KA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jC2B,EAAcO,UAAY,KAC1BP,EAAcQ,WAAa,gBAE/B,IAAIC,EAAS,CAAA,EAsCb,OArCAA,EAAS,CACLxB,SAAU,OACVyB,WAAY,OACZtB,MAAOS,EAAMO,QAAQO,UAAUC,MAC/BC,QAAS,OACTC,cAAe,SACfC,WAAY,IACZ,kBAAmB,CACfC,UAAW,WACXC,aAAc,MACdhC,SAAU,OACVyB,WAAY,OACZtB,MAAOS,EAAMO,QAAQO,UAAUC,OAEnC,qBAAsB,CAClB,MAAO,CACHV,SAAU,MAEd,MAAO,CACHA,SAAU,OAEd,MAAO,CACHA,SAAU,OAEd,OAAQ,CACJA,SAAU,SAGlB,SAAU,CACND,MAAO,QACPF,OAAQA,EACRmB,SAAU,SACVf,WAAYN,EAAMO,QAAQO,UAAUQ,MACpCN,QAAS,eACT,eAAgBb,IAGjBS,CAAM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),r=require("react/jsx-runtime"),n=require("react"),t=require("@mui/material"),
|
|
1
|
+
"use strict";var e=require("tslib"),r=require("react/jsx-runtime"),n=require("react"),t=require("@mui/material"),i=require("../../icon/icon.js");require("../../icon/icon.definitions.js");var s=require("./styledProgressBarMessage.js");const a=n.forwardRef(((n,t)=>{var{state:a,errorMessage:l,successMessage:c,loadingPercentage:d,loadingPercentageDescribeText:p,spinnerControlledAnimation:g}=n,f=e.__rest(n,["state","errorMessage","successMessage","loadingPercentage","loadingPercentageDescribeText","spinnerControlledAnimation"]);return"error"===a?r.jsxs(s.StyledProgressBarMessage,{state:a,"data-testid":"Spinner",children:[r.jsx(i.Icon,{name:"circle-close",fontSize:"medium",iconStyle:"filled"}),r.jsx("span",{className:"message",children:l})]}):"success"===a?r.jsxs(s.StyledProgressBarMessage,{state:a,"data-testid":"Spinner",children:[r.jsx(i.Icon,{name:"circle-check",fontSize:"medium",iconStyle:"filled",color:"primary"}),r.jsx("span",{className:"message",children:c})]}):r.jsxs(o,Object.assign({},f,{ref:t,spinnerControlledAnimation:g,loadingPercentage:d,"data-testid":"Spinner",children:[r.jsx("svg",{viewBox:"0 0 50 50",width:"24",height:"24",children:r.jsx("circle",{cx:"25",cy:"25",r:"22.5"})}),(Boolean(d)||0===d)&&r.jsx("span",{className:"loading-text","data-testid":"Spinner.percentage",children:p?`${p} ${d} %`:`${d} %`})]}))})),o=t.styled("div",{shouldForwardProp:e=>"spinnerControlledAnimation"!==e&&"loaderSize"!==e&&"loadingPercentage"!==e})((r=>{var{theme:n}=r,t=e.__rest(r,["theme"]);const i="137.130521355",s=141.3716715,a=t.spinnerControlledAnimation&&"infinite"!==t.spinnerControlledAnimation?{animationCircle:null,animationSpinner:null,strokeDashoffset:s-1.4137167149999998*t.loadingPercentage,strokeLinecap:null}:{animationCircle:"2s ease-in-out infinite both spinner-circle",animationSpinner:"2s linear infinite spinner",strokeLinecap:"square",strokeDashoffset:null};let o={};return o={transitionProperty:"opacity",transitionDuration:"0.3s",transitionTimingFunction:"ease-in-out",backgroundColor:"transparent",fontSize:"14px",lineHeight:"20px",width:"100%",display:"flex",color:n.palette.onSurface.os900,alignItems:"center",fontWeight:400,"& .loading-text":{marginLeft:"8px"},"& circle":{animation:a.animationCircle,display:"block",fill:"transparent",stroke:n.palette.brand.primary,strokeLinecap:a.strokeLinecap,strokeDasharray:s,strokeDashoffset:a.strokeDashoffset,strokeWidth:"10px",transformOrigin:"50% 50%"},"& svg":{background:`radial-gradient(ellipse at center, transparent 0%,transparent 48%,${n.palette.onSurface.os100} 49%,${n.palette.onSurface.os100} 100%)`,borderRadius:"50%",animation:a.animationSpinner},"& .initial-spinner.-done":{opacity:"0",pointerEvents:"none"},"@keyframes spinner":{"0%":{transform:"rotateZ(0)"},"100%":{transform:"rotateZ(360deg)"}},"@keyframes spinner-circle":{"0%":{strokeDashoffset:i,transform:"rotate(0)"},"25%":{strokeDashoffset:i,transform:"rotate(0)"},"50%":{},"75%":{strokeDashoffset:"35.342917875",transform:"rotate(45deg)"},"100%":{strokeDashoffset:i,transform:"rotate(360deg)"}}},o}));exports.Spinner=a;
|
|
2
2
|
//# sourceMappingURL=spinner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.js","sources":["../../../../../src/components/progressBar/components/spinner.tsx"],"sourcesContent":["import { __rest } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { forwardRef } from 'react';\nimport { styled } from '@mui/material';\nimport { Icon } from '../../icon';\nimport { StyledProgressBarMessage } from './styledProgressBarMessage';\nexport const Spinner = forwardRef((_a, ref) => {\n var { state, errorMessage, successMessage, loadingPercentage, loadingPercentageDescribeText, spinnerControlledAnimation } = _a, props = __rest(_a, [\"state\", \"errorMessage\", \"successMessage\", \"loadingPercentage\", \"loadingPercentageDescribeText\", \"spinnerControlledAnimation\"]);\n if (state === 'error')\n return (_jsxs(StyledProgressBarMessage, { state: state, \"data-testid\": \"Spinner\", children: [_jsx(Icon, {
|
|
1
|
+
{"version":3,"file":"spinner.js","sources":["../../../../../src/components/progressBar/components/spinner.tsx"],"sourcesContent":["import { __rest } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { forwardRef } from 'react';\nimport { styled } from '@mui/material';\nimport { Icon } from '../../icon';\nimport { StyledProgressBarMessage } from './styledProgressBarMessage';\nexport const Spinner = forwardRef((_a, ref) => {\n var { state, errorMessage, successMessage, loadingPercentage, loadingPercentageDescribeText, spinnerControlledAnimation } = _a, props = __rest(_a, [\"state\", \"errorMessage\", \"successMessage\", \"loadingPercentage\", \"loadingPercentageDescribeText\", \"spinnerControlledAnimation\"]);\n if (state === 'error')\n return (_jsxs(StyledProgressBarMessage, { state: state, \"data-testid\": \"Spinner\", children: [_jsx(Icon, { name: \"circle-close\", fontSize: \"medium\", iconStyle: \"filled\" }), _jsx(\"span\", { className: \"message\", children: errorMessage })] }));\n if (state === 'success')\n return (_jsxs(StyledProgressBarMessage, { state: state, \"data-testid\": \"Spinner\", children: [_jsx(Icon, { name: \"circle-check\", fontSize: \"medium\", iconStyle: \"filled\", color: \"primary\" }), _jsx(\"span\", { className: \"message\", children: successMessage })] }));\n return (_jsxs(StyledSpinner, Object.assign({}, props, { ref: ref, spinnerControlledAnimation: spinnerControlledAnimation, loadingPercentage: loadingPercentage, \"data-testid\": \"Spinner\", children: [_jsx(\"svg\", { viewBox: \"0 0 50 50\", width: \"24\", height: \"24\", children: _jsx(\"circle\", { cx: \"25\", cy: \"25\", r: \"22.5\" }) }), (Boolean(loadingPercentage) || loadingPercentage === 0) && (_jsx(\"span\", { className: \"loading-text\", \"data-testid\": \"Spinner.percentage\", children: loadingPercentageDescribeText\n ? `${loadingPercentageDescribeText} ${loadingPercentage} %`\n : `${loadingPercentage} %` }))] })));\n});\nconst StyledSpinner = styled('div', {\n shouldForwardProp: (prop) => prop !== 'spinnerControlledAnimation' && prop !== 'loaderSize' && prop !== 'loadingPercentage',\n})((_a) => {\n var { theme } = _a, props = __rest(_a, [\"theme\"]);\n const strokeDashOffset = '137.130521355';\n const strokeDashArray = 141.3716715;\n const animationStyles = !props.spinnerControlledAnimation || props.spinnerControlledAnimation === 'infinite'\n ? {\n animationCircle: '2s ease-in-out infinite both spinner-circle',\n animationSpinner: '2s linear infinite spinner',\n strokeLinecap: 'square',\n strokeDashoffset: null,\n }\n : {\n animationCircle: null,\n animationSpinner: null,\n strokeDashoffset: strokeDashArray - (strokeDashArray / 100) * props.loadingPercentage,\n strokeLinecap: null,\n };\n let styles = {};\n styles = {\n transitionProperty: 'opacity',\n transitionDuration: '0.3s',\n transitionTimingFunction: 'ease-in-out',\n backgroundColor: 'transparent',\n fontSize: '14px',\n lineHeight: '20px',\n width: '100%',\n display: 'flex',\n color: theme.palette.onSurface.os900,\n alignItems: 'center',\n fontWeight: 400,\n '& .loading-text': {\n marginLeft: '8px',\n },\n '& circle': {\n animation: animationStyles.animationCircle,\n display: 'block',\n fill: 'transparent',\n stroke: theme.palette.brand.primary,\n strokeLinecap: animationStyles.strokeLinecap,\n strokeDasharray: strokeDashArray,\n strokeDashoffset: animationStyles.strokeDashoffset,\n strokeWidth: '10px',\n transformOrigin: '50% 50%',\n },\n '& svg': {\n background: `radial-gradient(ellipse at center, transparent 0%,transparent 48%,${theme.palette.onSurface.os100} 49%,${theme.palette.onSurface.os100} 100%)`,\n borderRadius: '50%',\n animation: animationStyles.animationSpinner,\n },\n '& .initial-spinner.-done': {\n opacity: '0',\n pointerEvents: 'none',\n },\n '@keyframes spinner': {\n '0%': { transform: 'rotateZ(0)' },\n '100%': { transform: 'rotateZ(360deg)' },\n },\n '@keyframes spinner-circle': {\n '0%': {\n strokeDashoffset: strokeDashOffset,\n transform: 'rotate(0)',\n },\n '25%': {\n strokeDashoffset: strokeDashOffset,\n transform: 'rotate(0)',\n },\n '50%': {},\n '75%': {\n strokeDashoffset: '35.342917875',\n transform: 'rotate(45deg)',\n },\n '100%': {\n strokeDashoffset: strokeDashOffset,\n transform: 'rotate(360deg)',\n },\n },\n };\n return styles;\n});\n//# sourceMappingURL=spinner.js.map"],"names":["Spinner","forwardRef","_a","ref","state","errorMessage","successMessage","loadingPercentage","loadingPercentageDescribeText","spinnerControlledAnimation","props","__rest","_jsxs","jsxs","StyledProgressBarMessage","children","_jsx","jsx","Icon","name","fontSize","iconStyle","className","color","StyledSpinner","Object","assign","viewBox","width","height","cx","cy","r","Boolean","styled","shouldForwardProp","prop","theme","strokeDashOffset","strokeDashArray","animationStyles","animationCircle","animationSpinner","strokeDashoffset","strokeLinecap","styles","transitionProperty","transitionDuration","transitionTimingFunction","backgroundColor","lineHeight","display","palette","onSurface","os900","alignItems","fontWeight","marginLeft","animation","fill","stroke","brand","primary","strokeDasharray","strokeWidth","transformOrigin","background","os100","borderRadius","opacity","pointerEvents","transform"],"mappings":"0OAMY,MAACA,EAAUC,EAAUA,YAAC,CAACC,EAAIC,KACnC,IAAIC,MAAEA,EAAKC,aAAEA,EAAYC,eAAEA,EAAcC,kBAAEA,EAA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,aAArCC,EAAMD,2BAO7D,CACEgC,gBAAiB,KACjBC,iBAAkB,KAClBC,iBAAkBJ,EAAkB,mBAA0B7B,EAAMH,kBACpEqC,cAAe,MAVjB,CACEH,gBAAiB,8CACjBC,iBAAkB,6BAClBE,cAAe,SACfD,iBAAkB,MAQ1B,IAAIE,EAAS,CAAA,EA4Db,OA3DAA,EAAS,CACLC,mBAAoB,UACpBC,mBAAoB,OACpBC,yBAA0B,cAC1BC,gBAAiB,cACjB7B,SAAU,OACV8B,WAAY,OACZtB,MAAO,OACPuB,QAAS,OACT5B,MAAOc,EAAMe,QAAQC,UAAUC,MAC/BC,WAAY,SACZC,WAAY,IACZ,kBAAmB,CACfC,WAAY,OAEhB,WAAY,CACRC,UAAWlB,EAAgBC,gBAC3BU,QAAS,QACTQ,KAAM,cACNC,OAAQvB,EAAMe,QAAQS,MAAMC,QAC5BlB,cAAeJ,EAAgBI,cAC/BmB,gBAAiBxB,EACjBI,iBAAkBH,EAAgBG,iBAClCqB,YAAa,OACbC,gBAAiB,WAErB,QAAS,CACLC,WAAY,qEAAqE7B,EAAMe,QAAQC,UAAUc,aAAa9B,EAAMe,QAAQC,UAAUc,cAC9IC,aAAc,MACdV,UAAWlB,EAAgBE,kBAE/B,2BAA4B,CACxB2B,QAAS,IACTC,cAAe,QAEnB,qBAAsB,CAClB,KAAM,CAAEC,UAAW,cACnB,OAAQ,CAAEA,UAAW,oBAEzB,4BAA6B,CACzB,KAAM,CACF5B,iBAAkBL,EAClBiC,UAAW,aAEf,MAAO,CACH5B,iBAAkBL,EAClBiC,UAAW,aAEf,MAAO,CAAE,EACT,MAAO,CACH5B,iBAAkB,eAClB4B,UAAW,iBAEf,OAAQ,CACJ5B,iBAAkBL,EAClBiC,UAAW,oBAIhB1B,CAAM"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const FormControlSelectStyled: import("@emotion/styled").StyledComponent<import("@mui/material/FormControl").FormControlOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
3
|
ref?: import("react").Ref<HTMLDivElement>;
|
|
4
|
-
}, "disabled" | "className" | "style" | "classes" | "children" | "sx" | "
|
|
4
|
+
}, "disabled" | "className" | "style" | "classes" | "children" | "sx" | "variant" | "color" | "margin" | "error" | "required" | "size" | "fullWidth" | "focused" | "hiddenLabel"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
5
5
|
component?: import("react").ElementType<any>;
|
|
6
6
|
} & {
|
|
7
7
|
disabled?: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { SelectChangeEvent } from '@mui/material/Select';
|
|
3
|
+
import { IconNameProp } from '../icon';
|
|
3
4
|
/**
|
|
4
5
|
* @interface SelectInputProps
|
|
5
6
|
* @description Base definition of SkodaFlow SelectInput independent on core implementation.
|
|
@@ -36,7 +37,7 @@ export interface SelectInputProps {
|
|
|
36
37
|
/**
|
|
37
38
|
* Icon name. For example "check". If no prefix is defined, default SKODA icon font is used
|
|
38
39
|
*/
|
|
39
|
-
icon?:
|
|
40
|
+
icon?: IconNameProp;
|
|
40
41
|
/**
|
|
41
42
|
*Boolean to check if the input returns an error or not
|
|
42
43
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),r=require("react/jsx-runtime"),t=require("react"),
|
|
1
|
+
"use strict";var e=require("tslib"),r=require("react/jsx-runtime"),t=require("react"),n=require("./formControlSelectStyled.js"),l=require("@mui/material/Select"),o=require("../icon/icon.js");require("../icon/icon.definitions.js");var u=require("./hook/useSelectInput.js"),a=require("@mui/material/styles"),i=require("./inputLabelSelect.js"),s=require("@mui/material"),c=require("../common/helperText.js"),d=require("lodash/noop");function h(e){return e&&e.__esModule?e:{default:e}}var p=h(l),x=h(d);const f=a.styled(p.default,{shouldForwardProp:e=>"hasIcon"!==e&&"fullWidth"!==e})((r=>{var t=e.__rest(r,["theme"]);if(!t.fullWidth)return null;return{"& > .MuiSelect-filled":{position:"absolute",left:0,top:0,width:t.hasIcon?"calc(100% - 102px) !important":"calc(100% - 62px) !important"}}}));exports.SelectInput=l=>{var{label:a=null,onChange:d,onBlur:h,onFocus:p,value:m,children:b,staticLabel:S,InputProps:j,fullWidth:v=!0,removeSelectMenuMaxWidth:q}=l,I=e.__rest(l,["label","onChange","onBlur","onFocus","value","children","staticLabel","InputProps","fullWidth","removeSelectMenuMaxWidth"]);const[M,g]=t.useState(""),[F,W]=t.useState(!1),[C,B]=t.useState(!1),[k,L]=t.useState(!1),[T,_]=t.useState(!1),[w,O]=t.useState(null),{handleOnBlur:y,handleOnChange:P,handleOnFocus:E}=u.useSelectInput(F,x.default,x.default,v,I.helpText,m,g,I.required,L),R=t.useRef(null),V=t.useRef(null),D={sx:w?{maxWidth:q?"unset":w,"& .MuiBackdrop-root":{background:"transparent",backdropFilter:"blur(0px)"}}:{"& .MuiBackdrop-root":{background:"transparent",backdropFilter:"blur(0px)"}}};return r.jsx(r.Fragment,{children:r.jsxs(n.FormControlSelectStyled,Object.assign({},I,{ref:V,staticLabel:S,sx:v?{}:{width:"200px"},disabled:I.disabled,error:I.hasError,value:M,hideBg:I.hideBg,onMouseEnter:()=>{!C&&!T&&B(!0)},onMouseLeave:()=>{C&&!T&&B(!1)},onMouseDown:e=>{const r=e.currentTarget.offsetWidth;O(r)},icon:I.icon,hovered:C,focused:F,variant:"filled",fullWidth:v,children:[I.icon&&r.jsx(o.Icon,{color:I.disabled?"disabled":"inherit",name:I.icon}),r.jsx(i.default,{staticLabel:S,label:a,opened:T,currentValue:M}),r.jsx(f,{MenuProps:D,required:k,onOpen:()=>{_(!0)},onClose:()=>{W(!1),B(!1),_(!1)},onBlur:()=>y(W,h),onFocus:()=>E(W,p),IconComponent:()=>T?r.jsx(o.Icon,{name:"chevron-up"}):r.jsx(o.Icon,{name:"chevron-down"}),labelId:a,id:I.id,name:I.name,value:M,onChange:e=>P(e,d,g),ref:R,hasIcon:!!I.icon,fullWidth:v,children:b}),r.jsx(s.FormHelperText,{children:r.jsx(c.default,{maxChars:0,currentValue:M,helpText:I.helpText})})]}))})};
|
|
2
2
|
//# sourceMappingURL=selectInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectInput.js","sources":["../../../../src/components/selectInput/selectInput.tsx"],"sourcesContent":["import { __rest } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { useRef, useState } from 'react';\nimport { FormControlSelectStyled } from './formControlSelectStyled';\nimport MuiSelect from '@mui/material/Select';\nimport { Icon } from '../icon';\nimport { useSelectInput } from './hook/useSelectInput';\nimport { styled } from '@mui/material/styles';\nimport InputLabelSelect from './inputLabelSelect';\nimport { FormHelperText } from '@mui/material';\nimport HelperText from '../common/helperText';\nimport noop from 'lodash/noop';\n/**\n * @description SkodaFlow SelectInput component.\n * Properties are inherited from HTML input element.\n * @param props SelectInputProps\n * @returns React Functional Component\n * @deprecated This component is deprecated. Use themed Select component from @mui/material instead.\n */\nexport const SelectInput = (_a) => {\n var { label = null, onChange, onBlur, onFocus, value, children, staticLabel, InputProps, fullWidth = true, removeSelectMenuMaxWidth } = _a, props = __rest(_a, [\"label\", \"onChange\", \"onBlur\", \"onFocus\", \"value\", \"children\", \"staticLabel\", \"InputProps\", \"fullWidth\", \"removeSelectMenuMaxWidth\"]);\n const [currentValue, setCurrentValue] = useState('');\n const [isFocused, setIsFocused] = useState(false);\n const [hovered, setHovered] = useState(false);\n const [isRequired, setIsRequired] = useState(false);\n const [opened, setOpened] = useState(false);\n const [inputWidth, setInputWidth] = useState(null);\n const { handleOnBlur, handleOnChange, handleOnFocus } = useSelectInput(isFocused, noop, noop, fullWidth, props.helpText, value, setCurrentValue, props.required, setIsRequired);\n const inputRef = useRef(null);\n const formControlSelectRef = useRef(null);\n const menuProps = {\n sx: inputWidth\n ? {\n maxWidth: removeSelectMenuMaxWidth ? 'unset' : inputWidth,\n '& .MuiBackdrop-root': {\n background: 'transparent',\n backdropFilter: 'blur(0px)',\n },\n }\n : {\n '& .MuiBackdrop-root': {\n background: 'transparent',\n backdropFilter: 'blur(0px)',\n },\n },\n };\n return (_jsx(_Fragment, { children: _jsxs(FormControlSelectStyled, Object.assign({}, props, { ref: formControlSelectRef, staticLabel: staticLabel, sx: !fullWidth ? { width: '200px' } : {}, disabled: props.disabled, error: props.hasError, value: currentValue, hideBg: props.hideBg, onMouseEnter: () => {\n !hovered && !opened && setHovered(true);\n }, onMouseLeave: () => {\n hovered && !opened && setHovered(false);\n }, onMouseDown: (e) => {\n const elemWidth = e.currentTarget.offsetWidth;\n setInputWidth(elemWidth);\n }, icon: props.icon, hovered: hovered, focused: isFocused, variant: \"filled\", fullWidth: fullWidth, children: [props.icon && _jsx(Icon, { color: props.disabled ? 'disabled' : 'inherit',
|
|
1
|
+
{"version":3,"file":"selectInput.js","sources":["../../../../src/components/selectInput/selectInput.tsx"],"sourcesContent":["import { __rest } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { useRef, useState } from 'react';\nimport { FormControlSelectStyled } from './formControlSelectStyled';\nimport MuiSelect from '@mui/material/Select';\nimport { Icon } from '../icon';\nimport { useSelectInput } from './hook/useSelectInput';\nimport { styled } from '@mui/material/styles';\nimport InputLabelSelect from './inputLabelSelect';\nimport { FormHelperText } from '@mui/material';\nimport HelperText from '../common/helperText';\nimport noop from 'lodash/noop';\n/**\n * @description SkodaFlow SelectInput component.\n * Properties are inherited from HTML input element.\n * @param props SelectInputProps\n * @returns React Functional Component\n * @deprecated This component is deprecated. Use themed Select component from @mui/material instead.\n */\nexport const SelectInput = (_a) => {\n var { label = null, onChange, onBlur, onFocus, value, children, staticLabel, InputProps, fullWidth = true, removeSelectMenuMaxWidth } = _a, props = __rest(_a, [\"label\", \"onChange\", \"onBlur\", \"onFocus\", \"value\", \"children\", \"staticLabel\", \"InputProps\", \"fullWidth\", \"removeSelectMenuMaxWidth\"]);\n const [currentValue, setCurrentValue] = useState('');\n const [isFocused, setIsFocused] = useState(false);\n const [hovered, setHovered] = useState(false);\n const [isRequired, setIsRequired] = useState(false);\n const [opened, setOpened] = useState(false);\n const [inputWidth, setInputWidth] = useState(null);\n const { handleOnBlur, handleOnChange, handleOnFocus } = useSelectInput(isFocused, noop, noop, fullWidth, props.helpText, value, setCurrentValue, props.required, setIsRequired);\n const inputRef = useRef(null);\n const formControlSelectRef = useRef(null);\n const menuProps = {\n sx: inputWidth\n ? {\n maxWidth: removeSelectMenuMaxWidth ? 'unset' : inputWidth,\n '& .MuiBackdrop-root': {\n background: 'transparent',\n backdropFilter: 'blur(0px)',\n },\n }\n : {\n '& .MuiBackdrop-root': {\n background: 'transparent',\n backdropFilter: 'blur(0px)',\n },\n },\n };\n return (_jsx(_Fragment, { children: _jsxs(FormControlSelectStyled, Object.assign({}, props, { ref: formControlSelectRef, staticLabel: staticLabel, sx: !fullWidth ? { width: '200px' } : {}, disabled: props.disabled, error: props.hasError, value: currentValue, hideBg: props.hideBg, onMouseEnter: () => {\n !hovered && !opened && setHovered(true);\n }, onMouseLeave: () => {\n hovered && !opened && setHovered(false);\n }, onMouseDown: (e) => {\n const elemWidth = e.currentTarget.offsetWidth;\n setInputWidth(elemWidth);\n }, icon: props.icon, hovered: hovered, focused: isFocused, variant: \"filled\", fullWidth: fullWidth, children: [props.icon && _jsx(Icon, { color: props.disabled ? 'disabled' : 'inherit', name: props.icon }), _jsx(InputLabelSelect, { staticLabel: staticLabel, label: label, opened: opened, currentValue: currentValue }), _jsx(SelectInputStyled, { MenuProps: menuProps, required: isRequired, onOpen: () => {\n setOpened(true);\n }, onClose: () => {\n setIsFocused(false);\n setHovered(false);\n setOpened(false);\n }, onBlur: () => handleOnBlur(setIsFocused, onBlur), onFocus: () => handleOnFocus(setIsFocused, onFocus), IconComponent: () => (opened ? _jsx(Icon, { name: \"chevron-up\" }) : _jsx(Icon, { name: \"chevron-down\" })), labelId: label, id: props.id, name: props.name, value: currentValue, onChange: (e) => handleOnChange(e, onChange, setCurrentValue), ref: inputRef, hasIcon: !!props.icon, fullWidth: fullWidth, children: children }), _jsx(FormHelperText, { children: _jsx(HelperText, { maxChars: 0, currentValue: currentValue, helpText: props.helpText }) })] })) }));\n};\n/**\n * @description Button styling defintion based on props\n */\nconst SelectInputStyled = styled(MuiSelect, {\n shouldForwardProp: (prop) => prop !== 'hasIcon' && prop !== 'fullWidth',\n})((_a) => {\n var { theme } = _a, args = __rest(_a, [\"theme\"]);\n if (!args.fullWidth)\n return null;\n const width = args.hasIcon ? 'calc(100% - 102px) !important' : 'calc(100% - 62px) !important';\n return {\n '& > .MuiSelect-filled': {\n position: 'absolute',\n left: 0,\n top: 0,\n width: width,\n },\n };\n});\n//# sourceMappingURL=selectInput.js.map"],"names":["SelectInputStyled","styled","MuiSelect","shouldForwardProp","prop","_a","args","__rest","fullWidth","position","left","top","width","hasIcon","label","onChange","onBlur","onFocus","value","children","staticLabel","InputProps","removeSelectMenuMaxWidth","props","currentValue","setCurrentValue","useState","isFocused","setIsFocused","hovered","setHovered","isRequired","setIsRequired","opened","setOpened","inputWidth","setInputWidth","handleOnBlur","handleOnChange","handleOnFocus","useSelectInput","noop","helpText","required","inputRef","useRef","formControlSelectRef","menuProps","sx","maxWidth","background","backdropFilter","_jsx","_Fragment","_jsxs","jsxs","FormControlSelectStyled","Object","assign","ref","disabled","error","hasError","hideBg","onMouseEnter","onMouseLeave","onMouseDown","e","elemWidth","currentTarget","offsetWidth","icon","focused","variant","Icon","color","name","InputLabelSelect","default","jsx","MenuProps","onOpen","onClose","IconComponent","labelId","id","FormHelperText","HelperText","maxChars"],"mappings":"mfAmBY,MA6CNA,EAAoBC,EAAMA,OAACC,UAAW,CACxCC,kBAAoBC,GAAkB,YAATA,GAA+B,cAATA,G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U,EAAGhE,aAAcA,EAAckB,SAAUnB,EAAMmB,kBAAwB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
2
|
-
import React from 'react';
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
3
2
|
export type ValueComponentType = 'default' | 'input' | 'labeledInput' | null;
|
|
3
|
+
export type SliderThousandsSeparatorType = '.' | ',' | ' ';
|
|
4
4
|
/**
|
|
5
5
|
* @interface Base defintion of SkodaFlow Slider component independent on core implementation.
|
|
6
6
|
* Properties are inherited from HTML Span element and component functionality is taken from @mui/material/Slider v5.0.1.
|
|
@@ -131,7 +131,7 @@ export interface SliderProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'colo
|
|
|
131
131
|
/**
|
|
132
132
|
* Thousands separator variants for formatting currency
|
|
133
133
|
*/
|
|
134
|
-
thousandsSeparator?:
|
|
134
|
+
thousandsSeparator?: SliderThousandsSeparatorType;
|
|
135
135
|
/**
|
|
136
136
|
* Decimal separator variants for formatting currency
|
|
137
137
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),a=require("react/jsx-runtime"),r=require("react"),t=require("@mui/material/Slider"),l=require("@mui/material/styles"),i=require("../common/resizableSliderInput.js"),d=require("../common/styled/sliderValuesStyled.js"),n=require("./containerStyled.js");function s(e){return e&&e.__esModule?e:{default:e}}var u=s(t);const o=r.forwardRef(((t,l)=>{var{min:s,max:u,defaultValue:o,valueComponentType:c,leftSideLabel:b,rightSideLabel:x,disabled:S,disableSwap:h,step:v,value:f,isCurrencyInFront:y,minTextDescription:g="",maxTextDescription:j="",onChange:C,onInputBlur:D,thousandsSeparator:I=" ",decimalSeparator:T=",",hiddenDecimalSeparator:$=!0}=t,F=e.__rest(t,["min","max","defaultValue","valueComponentType","leftSideLabel","rightSideLabel","disabled","disableSwap","step","value","isCurrencyInFront","minTextDescription","maxTextDescription","onChange","onInputBlur","thousandsSeparator","decimalSeparator","hiddenDecimalSeparator"]);const k=r.useMemo((()=>((e,a,r,t)=>void 0!==t?t:void 0!==r?r:a&&!e?[0,a]:!a&&e?e:0)(s,u,o,f)),[s,u,o,f]),[q,V]=r.useState(k);r.useEffect((()=>{f&&V((()=>f))}),[f]);const B=r.useCallback((e=>(e=>{let a=e?parseInt(e):-1;return isNaN(a)&&(a=-1),a})(e)),[]),L=r.useCallback(((e,a,r)=>{if(!Array.isArray(a))return V(a),void(C&&C(e,a,r));V(0===r?[Math.min(a[0],a[1]-v
|
|
1
|
+
"use strict";var e=require("tslib"),a=require("react/jsx-runtime"),r=require("react"),t=require("@mui/material/Slider"),l=require("@mui/material/styles"),i=require("../common/resizableSliderInput.js"),d=require("../common/styled/sliderValuesStyled.js"),n=require("./containerStyled.js");function s(e){return e&&e.__esModule?e:{default:e}}var u=s(t);const o=r.forwardRef(((t,l)=>{var{min:s,max:u,defaultValue:o,valueComponentType:c,leftSideLabel:b,rightSideLabel:x,disabled:S,disableSwap:h,step:v,value:f,isCurrencyInFront:y,minTextDescription:g="",maxTextDescription:j="",onChange:C,onInputBlur:D,thousandsSeparator:I=" ",decimalSeparator:T=",",hiddenDecimalSeparator:$=!0}=t,F=e.__rest(t,["min","max","defaultValue","valueComponentType","leftSideLabel","rightSideLabel","disabled","disableSwap","step","value","isCurrencyInFront","minTextDescription","maxTextDescription","onChange","onInputBlur","thousandsSeparator","decimalSeparator","hiddenDecimalSeparator"]);const k=r.useMemo((()=>((e,a,r,t)=>void 0!==t?t:void 0!==r?r:a&&!e?[0,a]:!a&&e?e:0)(s,u,o,f)),[s,u,o,f]),[q,V]=r.useState(k);r.useEffect((()=>{f&&V((()=>f))}),[f]);const B=r.useCallback((e=>(e=>{let a=e?parseInt(e):-1;return isNaN(a)&&(a=-1),a})(e)),[]),L=r.useCallback(((e,a,r)=>{if(!Array.isArray(a))return V(a),void(C&&C(e,a,r));V(0===r?[Math.min(a[0],a[1]-v),a[1]]:[a[0],Math.max(a[1],a[0]+v)]),C&&C(e,a,r)}),[C,v]),M=r.useCallback((e=>{let a=B(e.target.value);a>u&&(a=u),C&&C(e,a),V((()=>a))}),[B,u,C]),A=r.useCallback(((e,a)=>{let r=B(e.target.value);1===a&&r>u?r=u:0===a&&r>q[1]&&(r=q[1]),V((t=>{let l=[...t];return l[a]=r,l[0]>l[1]&&(l=[0,v]),C&&C(e,l,a),l}))}),[B,u,C,v,q]),N=r.useMemo((()=>Array.isArray(q)?((e,r,t,l,d,n,s,u,o,p,c,b,x)=>{if("default"===e||!e){const e=m("number"==typeof r[0]?r[0]:parseInt(r[0]),b,c,x),t=m("number"==typeof r[1]?r[1]:parseInt(r[1]),b,c,x);return a.jsxs("div",{className:"range-values",children:[a.jsx("div",{"data-testid":"Slider.minVal",children:p?`${d} ${e}`:`${e} ${d}`}),a.jsx("div",{className:"middle-side"}),a.jsx("div",{"data-testid":"Slider.maxVal",children:p?`${n} ${t}`:`${t} ${n}`})]})}return a.jsxs("div",{className:"range-values",children:[a.jsx(i.default,{id:"slider-double-value-left-label-input",onChange:s,onBlur:u,value:r[0],thousandsSeparator:c,decimalSeparator:b,hiddenDecimalSeparator:x,thumb:0,disabled:o,textDescription:d,labelText:"input"===e?null:t,isCurrencyInFront:p,"data-testid":"Slider.minVal"}),a.jsx("div",{className:"middle-side"}),a.jsx(i.default,{id:"slider-double-value-right-label-input",onChange:s,onBlur:u,value:r[1],thousandsSeparator:c,decimalSeparator:b,hiddenDecimalSeparator:x,thumb:1,disabled:o,textDescription:n,labelText:"labeledInput"===e?l:null,isCurrencyInFront:p,"data-testid":"Slider.maxVal"})]})})(c,q,b,x,g,j,A,D,S,y,I,T,$):((e,r,t,l,d,n,s,u,o,p,c)=>{if("default"===e||!e){const e=m("number"==typeof r?r:parseInt(r),p,o,c);return a.jsxs("div",{"data-testid":"Slider.minVal",children:[l&&u?`${l} ${e}`:l?`${e} ${l}`:e," "]})}return a.jsx(i.default,{id:"slider-single-value-label-input",value:r,thousandsSeparator:o,decimalSeparator:p,hiddenDecimalSeparator:c,onChange:d,onBlur:n,disabled:s,textDescription:l,labelText:"labeledInput"===e?t:null,isCurrencyInFront:u})})(c,q,b,g,M,D,S,y,I,T,$)),[S,y,b,j,g,A,M,D,x,c,q,I,T,$]);return a.jsxs(n.ContainerStyled,{value:q,marks:F.marks,"data-testid":"Slider","data-state":S?"disabled":void 0,children:[a.jsx(p,Object.assign({},F,{disabled:S,ref:l,onChange:L,min:s,max:u,step:v,disableSwap:h,valueLabelFormat:e=>m(e,T,I,$),value:q})),a.jsx(d.default,{disabled:S,children:N})]})})),p=l.styled(u.default,{shouldForwardProp:e=>"minTextDescription"!==e&&"maxTextDescription"!==e&&"leftSideLabel"!==e&&"rightSideLabel"!==e&&"valueComponentType"!==e})((a=>{var r=e.__rest(a,["theme"]);if(!r.marks)return null;let t={};Array.isArray(r.value)||(t={"& .MuiSlider-track":{left:"-3px !important"}});let l={"& .MuiSlider-rail":{left:"-3px",paddingRight:"6px"}};return l=Object.assign(Object.assign({},l),t),l})),m=(e,a,r,t)=>t?e.toFixed().replace(/\B(?=(\d{3})+(?!\d))/g,r):e.toFixed(2).replace(".",a).replace(/\B(?=(\d{3})+(?!\d))/g,r);exports.Slider=o;
|
|
2
2
|
//# sourceMappingURL=slider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.js","sources":["../../../../src/components/slider/slider.tsx"],"sourcesContent":["import { __rest } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/* eslint-disable sonarjs/cognitive-complexity */\nimport { forwardRef } from 'react';\nimport MuiSlider from '@mui/material/Slider';\nimport { styled } from '@mui/material/styles';\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport ResizableSliderInput from '../common/resizableSliderInput';\nimport SliderValuesStyled from '../common/styled/sliderValuesStyled';\nimport { ContainerStyled } from './containerStyled';\nconst getDoubleValueComponent = (type, values, leftSideLabel, rightSideLabel, minTextDescription, maxTextDescription, onChange, onBlur, disabled, isCurrencyInFront, thousandsSeparator, decimalSeparator, hiddenDecimalSeparator) => {\n if (type === 'default' || !type) {\n const minVal = getFormattedString(typeof values[0] === 'number' ? values[0] : parseInt(values[0]), decimalSeparator, thousandsSeparator, hiddenDecimalSeparator);\n const maxVal = getFormattedString(typeof values[1] === 'number' ? values[1] : parseInt(values[1]), decimalSeparator, thousandsSeparator, hiddenDecimalSeparator);\n return (_jsxs(\"div\", { className: \"range-values\", children: [_jsx(\"div\", { \"data-testid\": \"Slider.minVal\", children: isCurrencyInFront ? `${minTextDescription} ${minVal}` : `${minVal} ${minTextDescription}` }), _jsx(\"div\", { className: \"middle-side\" }), _jsx(\"div\", { \"data-testid\": \"Slider.maxVal\", children: isCurrencyInFront ? `${maxTextDescription} ${maxVal}` : `${maxVal} ${maxTextDescription}` })] }));\n }\n return (_jsxs(\"div\", { className: \"range-values\", children: [_jsx(ResizableSliderInput, { id: \"slider-double-value-left-label-input\", onChange: onChange, onBlur: onBlur, value: values[0], thousandsSeparator: thousandsSeparator, decimalSeparator: decimalSeparator, hiddenDecimalSeparator: hiddenDecimalSeparator, thumb: 0, disabled: disabled, textDescription: minTextDescription, labelText: type === 'input' ? null : leftSideLabel, isCurrencyInFront: isCurrencyInFront, \"data-testid\": \"Slider.minVal\" }), _jsx(\"div\", { className: \"middle-side\" }), _jsx(ResizableSliderInput, { id: \"slider-double-value-right-label-input\", onChange: onChange, onBlur: onBlur, value: values[1], thousandsSeparator: thousandsSeparator, decimalSeparator: decimalSeparator, hiddenDecimalSeparator: hiddenDecimalSeparator, thumb: 1, disabled: disabled, textDescription: maxTextDescription, labelText: type === 'labeledInput' ? rightSideLabel : null, isCurrencyInFront: isCurrencyInFront, \"data-testid\": \"Slider.maxVal\" })] }));\n};\nconst getSingleValueComponent = (type, values, leftSideLabel, minTextDescription, onChange, onBlur, disabled, isCurrencyInFront, thousandsSeparator, decimalSeparator, hiddenDecimalSeparator) => {\n if (type === 'default' || !type) {\n const val = getFormattedString(typeof values === 'number' ? values : parseInt(values), decimalSeparator, thousandsSeparator, hiddenDecimalSeparator);\n return (_jsxs(\"div\", { \"data-testid\": \"Slider.minVal\", children: [minTextDescription && isCurrencyInFront\n ? `${minTextDescription} ${val}`\n : minTextDescription\n ? `${val} ${minTextDescription}`\n : val, ' '] }));\n }\n return (_jsx(ResizableSliderInput, { id: \"slider-single-value-label-input\", value: values, thousandsSeparator: thousandsSeparator, decimalSeparator: decimalSeparator, hiddenDecimalSeparator: hiddenDecimalSeparator, onChange: onChange, onBlur: onBlur, disabled: disabled, textDescription: minTextDescription, labelText: type === 'labeledInput' ? leftSideLabel : null, isCurrencyInFront: isCurrencyInFront }));\n};\nconst getFormattedValue = (value) => {\n let result = value ? parseInt(value) : -1;\n if (isNaN(result))\n result = -1;\n return result;\n};\nconst getInitialValue = (min, max, defaultValue, value) => {\n if (value !== undefined)\n return value;\n if (defaultValue !== undefined)\n return defaultValue;\n if (max && !min)\n return [0, max];\n if (!max && min)\n return min;\n return 0;\n};\n/**\n * @description Styled SkodaFlow Slider component\n * @param props SliderProps\n * @returns React Functional Component\n */\nexport const Slider = forwardRef((_a, ref) => {\n var { min, max, defaultValue, valueComponentType, leftSideLabel, rightSideLabel, disabled, disableSwap, step, value, isCurrencyInFront, minTextDescription = '', maxTextDescription = '', onChange, onInputBlur, thousandsSeparator = ' ', decimalSeparator = ',', hiddenDecimalSeparator = true } = _a, props = __rest(_a, [\"min\", \"max\", \"defaultValue\", \"valueComponentType\", \"leftSideLabel\", \"rightSideLabel\", \"disabled\", \"disableSwap\", \"step\", \"value\", \"isCurrencyInFront\", \"minTextDescription\", \"maxTextDescription\", \"onChange\", \"onInputBlur\", \"thousandsSeparator\", \"decimalSeparator\", \"hiddenDecimalSeparator\"]);\n const getInitialValueWithUseCallBack = useMemo(() => {\n return getInitialValue(min, max, defaultValue, value);\n }, [min, max, defaultValue, value]);\n const [values, setValues] = useState(getInitialValueWithUseCallBack);\n useEffect(() => {\n if (value)\n setValues(() => value);\n }, [value]);\n const getFormattedValueWithUseCallBack = useCallback((_value) => {\n return getFormattedValue(_value);\n }, []);\n const onChangeHandler = useCallback((event, _value, activeThumb) => {\n if (!Array.isArray(_value)) {\n setValues(_value);\n onChange && onChange(event, _value, activeThumb);\n return;\n }\n if (activeThumb === 0) {\n setValues([Math.min(_value[0], _value[1] - step - 1), _value[1]]);\n }\n else {\n setValues([_value[0], Math.max(_value[1], _value[0] + step + 1)]);\n }\n onChange && onChange(event, _value, activeThumb);\n }, [onChange, step]);\n const onChangeSingleValue = useCallback((e) => {\n let newValue = getFormattedValueWithUseCallBack(e.target.value);\n if (newValue > max)\n newValue = max;\n onChange && onChange(e, newValue);\n setValues(() => newValue);\n }, [getFormattedValueWithUseCallBack, max, onChange]);\n const onChangeDoubleValue = useCallback((e, thumb) => {\n let newValue = getFormattedValueWithUseCallBack(e.target.value);\n if (thumb === 1 && newValue > max)\n newValue = max;\n else if (thumb === 0 && newValue > values[1])\n newValue = values[1];\n setValues((curr) => {\n let newArrayValue = [...curr];\n newArrayValue[thumb] = newValue;\n if (newArrayValue[0] > newArrayValue[1]) {\n newArrayValue = [0, step + 1];\n }\n onChange && onChange(e, newArrayValue, thumb);\n return newArrayValue;\n });\n }, [getFormattedValueWithUseCallBack, max, onChange, step, values]);\n const valuesComponent = useMemo(() => {\n return Array.isArray(values)\n ? getDoubleValueComponent(valueComponentType, values, leftSideLabel, rightSideLabel, minTextDescription, maxTextDescription, onChangeDoubleValue, onInputBlur, disabled, isCurrencyInFront, thousandsSeparator, decimalSeparator, hiddenDecimalSeparator)\n : getSingleValueComponent(valueComponentType, values, leftSideLabel, minTextDescription, onChangeSingleValue, onInputBlur, disabled, isCurrencyInFront, thousandsSeparator, decimalSeparator, hiddenDecimalSeparator);\n }, [\n disabled,\n isCurrencyInFront,\n leftSideLabel,\n maxTextDescription,\n minTextDescription,\n onChangeDoubleValue,\n onChangeSingleValue,\n onInputBlur,\n rightSideLabel,\n valueComponentType,\n values,\n thousandsSeparator,\n decimalSeparator,\n hiddenDecimalSeparator,\n ]);\n return (_jsxs(ContainerStyled, { value: values, marks: props.marks, \"data-testid\": \"Slider\", \"data-state\": disabled ? 'disabled' : undefined, children: [_jsx(SliderStyled, Object.assign({}, props, { disabled: disabled, ref: ref, onChange: onChangeHandler, min: min, max: max, step: step, disableSwap: disableSwap, valueLabelFormat: (v) => getFormattedString(v, decimalSeparator, thousandsSeparator, hiddenDecimalSeparator), value: values })), _jsx(SliderValuesStyled, { disabled: disabled, children: valuesComponent })] }));\n});\n/**\n * @description Slider styling definition\n */\nconst SliderStyled = styled(MuiSlider, {\n shouldForwardProp: (prop) => prop !== 'minTextDescription' &&\n prop !== 'maxTextDescription' &&\n prop !== 'leftSideLabel' &&\n prop !== 'rightSideLabel' &&\n prop !== 'valueComponentType',\n})((_a) => {\n var { theme } = _a, args = __rest(_a, [\"theme\"]);\n if (!args.marks)\n return null;\n let rule = {};\n const isArray = Array.isArray(args.value);\n if (!isArray)\n rule = {\n '& .MuiSlider-track': {\n left: '-3px !important',\n },\n };\n let style = {\n '& .MuiSlider-rail': {\n left: '-3px',\n paddingRight: '6px',\n },\n };\n style = Object.assign(Object.assign({}, style), rule);\n return style;\n});\nconst getFormattedString = (num, decimalSeparator, thousandsSeparator, hiddenDecimalSeparator) => {\n if (hiddenDecimalSeparator)\n return num.toFixed().replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousandsSeparator);\n return num\n .toFixed(2)\n .replace('.', decimalSeparator)\n .replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousandsSeparator);\n};\n//# sourceMappingURL=slider.js.map"],"names":["Slider","forwardRef","_a","ref","min","max","defaultValue","valueComponentType","leftSideLabel","rightSideLabel","disabled","disableSwap","step","value","isCurrencyInFront","minTextDescription","maxTextDescription","onChange","onInputBlur","thousandsSeparator","decimalSeparator","hiddenDecimalSeparator","props","__rest","getInitialValueWithUseCallBack","useMemo","undefined","getInitialValue","values","setValues","useState","useEffect","getFormattedValueWithUseCallBack","useCallback","_value","result","parseInt","isNaN","getFormattedValue","onChangeHandler","event","activeThumb","Array","isArray","Math","onChangeSingleValue","e","newValue","target","onChangeDoubleValue","thumb","curr","newArrayValue","valuesComponent","type","onBlur","minVal","getFormattedString","maxVal","_jsxs","className","children","_jsx","jsxs","jsx","ResizableSliderInput","id","textDescription","labelText","default","getDoubleValueComponent","val","getSingleValueComponent","ContainerStyled","marks","SliderStyled","Object","assign","valueLabelFormat","v","SliderValuesStyled","styled","MuiSlider","shouldForwardProp","prop","args","rule","left","style","paddingRight","num","toFixed","replace"],"mappings":"6VAUA,MAyCaA,EAASC,EAAUA,YAAC,CAACC,EAAIC,KAClC,IAAIC,IAAEA,EAAGC,IAAEA,EAAGC,aAAEA,EAAYC,mBAAEA,EAAkBC,cAAEA,EAAaC,eAAEA,EAAcC,SAAEA,EAAQC,YAAEA,EAAWC,KAAEA,EAAIC,MAAEA,EAAKC,kBAAEA,EAAiBC,mBAAEA,EAAqB,GAAEC,mBAAEA,EAAqB,GAAEC,SAAEA,EAAQC,YAAEA,EAAWC,mBAAEA,EAAqB,IAAGC,iBAAEA,EAAmB,IAAGC,uBAAEA,GAAyB,GAASnB,EAAIoB,EAAQC,SAAOrB,EAAI,CAAC,MAAO,MAAO,eAAgB,qBAAsB,gBAAiB,iBAAkB,WAAY,cAAe,OAAQ,QAAS,oBAAqB,qBAAsB,qBAAsB,WAAY,cAAe,qBAAsB,mBAAoB,2BACtkB,MAAMsB,EAAiCC,EAAAA,SAAQ,IAlB3B,EAACrB,EAAKC,EAAKC,EAAcO,SAC/Ba,IAAVb,EACOA,OACUa,IAAjBpB,EACOA,EACPD,IAAQD,EACD,CAAC,EAAGC,IACVA,GAAOD,EACDA,EACJ,EAUIuB,CAAgBvB,EAAKC,EAAKC,EAAcO,IAChD,CAACT,EAAKC,EAAKC,EAAcO,KACrBe,EAAQC,GAAaC,EAAQA,SAACN,GACrCO,EAAAA,WAAU,KACFlB,GACAgB,GAAU,IAAMhB,GAAM,GAC3B,CA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Kc,SAAUsB,EAAiBnC,IAAKA,EAAKC,IAAKA,EAAKO,KAAMA,EAAMD,YAAaA,EAAamE,iBAAmBC,GAAMtB,EAAmBsB,EAAG3D,EAAkBD,EAAoBE,GAAyBR,MAAOe,KAAYkC,EAAIE,IAACgB,EAAkBX,QAAE,CAAE3D,SAAUA,EAAUmD,SAAUR,MAAwB,IAK1gBsB,EAAeM,EAAMA,OAACC,UAAW,CACnCC,kBAAoBC,GAAkB,uBAATA,GAChB,uBAATA,GACS,kBAATA,GACS,mBAATA,GACS,uBAATA,GALaH,EAMjB/E,IACG,IAAiBmF,EAAO9D,EAAMA,OAACrB,EAAI,CAAC,UACvC,IAAKmF,EAAKX,MACN,OAAO,KACX,IAAIY,EAAO,CAAA,EACK5C,MAAMC,QAAQ0C,EAAKxE,SAE/ByE,EAAO,CACH,qBAAsB,CAClBC,KAAM,qBAGlB,IAAIC,EAAQ,CACR,oBAAqB,CACjBD,KAAM,OACNE,aAAc,QAItB,OADAD,EAAQZ,OAAOC,OAAOD,OAAOC,OAAO,GAAIW,GAAQF,GACzCE,CAAK,IAEV/B,EAAqB,CAACiC,EAAKtE,EAAkBD,EAAoBE,IAC/DA,EACOqE,EAAIC,UAAUC,QAAQ,wBAAyBzE,GACnDuE,EACFC,QAAQ,GACRC,QAAQ,IAAKxE,GACbwE,QAAQ,wBAAyBzE"}
|
|
1
|
+
{"version":3,"file":"slider.js","sources":["../../../../src/components/slider/slider.tsx"],"sourcesContent":["import { __rest } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/* eslint-disable sonarjs/cognitive-complexity */\nimport { forwardRef, useCallback, useEffect, useMemo, useState } from 'react';\nimport MuiSlider from '@mui/material/Slider';\nimport { styled } from '@mui/material/styles';\nimport ResizableSliderInput from '../common/resizableSliderInput';\nimport SliderValuesStyled from '../common/styled/sliderValuesStyled';\nimport { ContainerStyled } from './containerStyled';\nconst getDoubleValueComponent = (type, values, leftSideLabel, rightSideLabel, minTextDescription, maxTextDescription, onChange, onBlur, disabled, isCurrencyInFront, thousandsSeparator, decimalSeparator, hiddenDecimalSeparator) => {\n if (type === 'default' || !type) {\n const minVal = getFormattedString(typeof values[0] === 'number' ? values[0] : parseInt(values[0]), decimalSeparator, thousandsSeparator, hiddenDecimalSeparator);\n const maxVal = getFormattedString(typeof values[1] === 'number' ? values[1] : parseInt(values[1]), decimalSeparator, thousandsSeparator, hiddenDecimalSeparator);\n return (_jsxs(\"div\", { className: \"range-values\", children: [_jsx(\"div\", { \"data-testid\": \"Slider.minVal\", children: isCurrencyInFront ? `${minTextDescription} ${minVal}` : `${minVal} ${minTextDescription}` }), _jsx(\"div\", { className: \"middle-side\" }), _jsx(\"div\", { \"data-testid\": \"Slider.maxVal\", children: isCurrencyInFront ? `${maxTextDescription} ${maxVal}` : `${maxVal} ${maxTextDescription}` })] }));\n }\n return (_jsxs(\"div\", { className: \"range-values\", children: [_jsx(ResizableSliderInput, { id: \"slider-double-value-left-label-input\", onChange: onChange, onBlur: onBlur, value: values[0], thousandsSeparator: thousandsSeparator, decimalSeparator: decimalSeparator, hiddenDecimalSeparator: hiddenDecimalSeparator, thumb: 0, disabled: disabled, textDescription: minTextDescription, labelText: type === 'input' ? null : leftSideLabel, isCurrencyInFront: isCurrencyInFront, \"data-testid\": \"Slider.minVal\" }), _jsx(\"div\", { className: \"middle-side\" }), _jsx(ResizableSliderInput, { id: \"slider-double-value-right-label-input\", onChange: onChange, onBlur: onBlur, value: values[1], thousandsSeparator: thousandsSeparator, decimalSeparator: decimalSeparator, hiddenDecimalSeparator: hiddenDecimalSeparator, thumb: 1, disabled: disabled, textDescription: maxTextDescription, labelText: type === 'labeledInput' ? rightSideLabel : null, isCurrencyInFront: isCurrencyInFront, \"data-testid\": \"Slider.maxVal\" })] }));\n};\nconst getSingleValueComponent = (type, values, leftSideLabel, minTextDescription, onChange, onBlur, disabled, isCurrencyInFront, thousandsSeparator, decimalSeparator, hiddenDecimalSeparator) => {\n if (type === 'default' || !type) {\n const val = getFormattedString(typeof values === 'number' ? values : parseInt(values), decimalSeparator, thousandsSeparator, hiddenDecimalSeparator);\n return (_jsxs(\"div\", { \"data-testid\": \"Slider.minVal\", children: [minTextDescription && isCurrencyInFront\n ? `${minTextDescription} ${val}`\n : minTextDescription\n ? `${val} ${minTextDescription}`\n : val, ' '] }));\n }\n return (_jsx(ResizableSliderInput, { id: \"slider-single-value-label-input\", value: values, thousandsSeparator: thousandsSeparator, decimalSeparator: decimalSeparator, hiddenDecimalSeparator: hiddenDecimalSeparator, onChange: onChange, onBlur: onBlur, disabled: disabled, textDescription: minTextDescription, labelText: type === 'labeledInput' ? leftSideLabel : null, isCurrencyInFront: isCurrencyInFront }));\n};\nconst getFormattedValue = (value) => {\n let result = value ? parseInt(value) : -1;\n if (isNaN(result))\n result = -1;\n return result;\n};\nconst getInitialValue = (min, max, defaultValue, value) => {\n if (value !== undefined)\n return value;\n if (defaultValue !== undefined)\n return defaultValue;\n if (max && !min)\n return [0, max];\n if (!max && min)\n return min;\n return 0;\n};\n/**\n * @description Styled SkodaFlow Slider component\n * @param props SliderProps\n * @returns React Functional Component\n */\nexport const Slider = forwardRef((_a, ref) => {\n var { min, max, defaultValue, valueComponentType, leftSideLabel, rightSideLabel, disabled, disableSwap, step, value, isCurrencyInFront, minTextDescription = '', maxTextDescription = '', onChange, onInputBlur, thousandsSeparator = ' ', decimalSeparator = ',', hiddenDecimalSeparator = true } = _a, props = __rest(_a, [\"min\", \"max\", \"defaultValue\", \"valueComponentType\", \"leftSideLabel\", \"rightSideLabel\", \"disabled\", \"disableSwap\", \"step\", \"value\", \"isCurrencyInFront\", \"minTextDescription\", \"maxTextDescription\", \"onChange\", \"onInputBlur\", \"thousandsSeparator\", \"decimalSeparator\", \"hiddenDecimalSeparator\"]);\n const getInitialValueWithUseCallBack = useMemo(() => {\n return getInitialValue(min, max, defaultValue, value);\n }, [min, max, defaultValue, value]);\n const [values, setValues] = useState(getInitialValueWithUseCallBack);\n useEffect(() => {\n if (value)\n setValues(() => value);\n }, [value]);\n const getFormattedValueWithUseCallBack = useCallback((_value) => {\n return getFormattedValue(_value);\n }, []);\n const onChangeHandler = useCallback((event, _value, activeThumb) => {\n if (!Array.isArray(_value)) {\n setValues(_value);\n onChange && onChange(event, _value, activeThumb);\n return;\n }\n if (activeThumb === 0) {\n setValues([Math.min(_value[0], _value[1] - step), _value[1]]);\n }\n else {\n setValues([_value[0], Math.max(_value[1], _value[0] + step)]);\n }\n onChange && onChange(event, _value, activeThumb);\n }, [onChange, step]);\n const onChangeSingleValue = useCallback((e) => {\n let newValue = getFormattedValueWithUseCallBack(e.target.value);\n if (newValue > max)\n newValue = max;\n onChange && onChange(e, newValue);\n setValues(() => newValue);\n }, [getFormattedValueWithUseCallBack, max, onChange]);\n const onChangeDoubleValue = useCallback((e, thumb) => {\n let newValue = getFormattedValueWithUseCallBack(e.target.value);\n if (thumb === 1 && newValue > max)\n newValue = max;\n else if (thumb === 0 && newValue > values[1])\n newValue = values[1];\n setValues((curr) => {\n let newArrayValue = [...curr];\n newArrayValue[thumb] = newValue;\n if (newArrayValue[0] > newArrayValue[1]) {\n newArrayValue = [0, step];\n }\n onChange && onChange(e, newArrayValue, thumb);\n return newArrayValue;\n });\n }, [getFormattedValueWithUseCallBack, max, onChange, step, values]);\n const valuesComponent = useMemo(() => {\n return Array.isArray(values)\n ? getDoubleValueComponent(valueComponentType, values, leftSideLabel, rightSideLabel, minTextDescription, maxTextDescription, onChangeDoubleValue, onInputBlur, disabled, isCurrencyInFront, thousandsSeparator, decimalSeparator, hiddenDecimalSeparator)\n : getSingleValueComponent(valueComponentType, values, leftSideLabel, minTextDescription, onChangeSingleValue, onInputBlur, disabled, isCurrencyInFront, thousandsSeparator, decimalSeparator, hiddenDecimalSeparator);\n }, [\n disabled,\n isCurrencyInFront,\n leftSideLabel,\n maxTextDescription,\n minTextDescription,\n onChangeDoubleValue,\n onChangeSingleValue,\n onInputBlur,\n rightSideLabel,\n valueComponentType,\n values,\n thousandsSeparator,\n decimalSeparator,\n hiddenDecimalSeparator,\n ]);\n return (_jsxs(ContainerStyled, { value: values, marks: props.marks, \"data-testid\": \"Slider\", \"data-state\": disabled ? 'disabled' : undefined, children: [_jsx(SliderStyled, Object.assign({}, props, { disabled: disabled, ref: ref, onChange: onChangeHandler, min: min, max: max, step: step, disableSwap: disableSwap, valueLabelFormat: (v) => getFormattedString(v, decimalSeparator, thousandsSeparator, hiddenDecimalSeparator), value: values })), _jsx(SliderValuesStyled, { disabled: disabled, children: valuesComponent })] }));\n});\n/**\n * @description Slider styling definition\n */\nconst SliderStyled = styled(MuiSlider, {\n shouldForwardProp: (prop) => prop !== 'minTextDescription' &&\n prop !== 'maxTextDescription' &&\n prop !== 'leftSideLabel' &&\n prop !== 'rightSideLabel' &&\n prop !== 'valueComponentType',\n})((_a) => {\n var { theme } = _a, args = __rest(_a, [\"theme\"]);\n if (!args.marks)\n return null;\n let rule = {};\n const isArray = Array.isArray(args.value);\n if (!isArray)\n rule = {\n '& .MuiSlider-track': {\n left: '-3px !important',\n },\n };\n let style = {\n '& .MuiSlider-rail': {\n left: '-3px',\n paddingRight: '6px',\n },\n };\n style = Object.assign(Object.assign({}, style), rule);\n return style;\n});\nconst getFormattedString = (num, decimalSeparator, thousandsSeparator, hiddenDecimalSeparator) => {\n if (hiddenDecimalSeparator)\n return num.toFixed().replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousandsSeparator);\n return num\n .toFixed(2)\n .replace('.', decimalSeparator)\n .replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousandsSeparator);\n};\n//# sourceMappingURL=slider.js.map"],"names":["Slider","forwardRef","_a","ref","min","max","defaultValue","valueComponentType","leftSideLabel","rightSideLabel","disabled","disableSwap","step","value","isCurrencyInFront","minTextDescription","maxTextDescription","onChange","onInputBlur","thousandsSeparator","decimalSeparator","hiddenDecimalSeparator","props","__rest","getInitialValueWithUseCallBack","useMemo","undefined","getInitialValue","values","setValues","useState","useEffect","getFormattedValueWithUseCallBack","useCallback","_value","result","parseInt","isNaN","getFormattedValue","onChangeHandler","event","activeThumb","Array","isArray","Math","onChangeSingleValue","e","newValue","target","onChangeDoubleValue","thumb","curr","newArrayValue","valuesComponent","type","onBlur","minVal","getFormattedString","maxVal","_jsxs","className","children","_jsx","jsxs","jsx","ResizableSliderInput","id","textDescription","labelText","default","getDoubleValueComponent","val","getSingleValueComponent","ContainerStyled","marks","SliderStyled","Object","assign","valueLabelFormat","v","SliderValuesStyled","styled","MuiSlider","shouldForwardProp","prop","args","rule","left","style","paddingRight","num","toFixed","replace"],"mappings":"6VASA,MAyCaA,EAASC,EAAUA,YAAC,CAACC,EAAIC,KAClC,IAAIC,IAAEA,EAAGC,IAAEA,EAAGC,aAAEA,EAAYC,mBAAEA,EAAkBC,cAAEA,EAAaC,eAAEA,EAAcC,SAAEA,EAAQC,YAAEA,EAAWC,KAAEA,EAAIC,MAAEA,EAAKC,kBAAEA,EAAiBC,mBAAEA,EAAqB,GAAEC,mBAAEA,EAAqB,GAAEC,SAAEA,EAAQC,YAAEA,EAAWC,mBAAEA,EAAqB,IAAGC,iBAAEA,EAAmB,IAAGC,uBAAEA,GAAyB,GAASnB,EAAIoB,EAAQC,SAAOrB,EAAI,CAAC,MAAO,MAAO,eAAgB,qBAAsB,gBAAiB,iBAAkB,WAAY,cAAe,OAAQ,QAAS,oBAAqB,qBAAsB,qBAAsB,WAAY,cAAe,qBAAsB,mBAAoB,2BACtkB,MAAMsB,EAAiCC,EAAAA,SAAQ,IAlB3B,EAACrB,EAAKC,EAAKC,EAAcO,SAC/Ba,IAAVb,EACOA,OACUa,IAAjBpB,EACOA,EACPD,IAAQD,EACD,CAAC,EAAGC,IACVA,GAAOD,EACDA,EACJ,EAUIuB,CAAgBvB,EAAKC,EAAKC,EAAcO,IAChD,CAACT,EAAKC,EAAKC,EAAcO,KACrBe,EAAQC,GAAaC,EAAQA,SAACN,GACrCO,EAAAA,WAAU,KACFlB,GACAgB,GAAU,IAAMhB,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SAAUsB,EAAiBnC,IAAKA,EAAKC,IAAKA,EAAKO,KAAMA,EAAMD,YAAaA,EAAamE,iBAAmBC,GAAMtB,EAAmBsB,EAAG3D,EAAkBD,EAAoBE,GAAyBR,MAAOe,KAAYkC,EAAIE,IAACgB,EAAkBX,QAAE,CAAE3D,SAAUA,EAAUmD,SAAUR,MAAwB,IAK1gBsB,EAAeM,EAAMA,OAACC,UAAW,CACnCC,kBAAoBC,GAAkB,uBAATA,GAChB,uBAATA,GACS,kBAATA,GACS,mBAATA,GACS,uBAATA,GALaH,EAMjB/E,IACG,IAAiBmF,EAAO9D,EAAMA,OAACrB,EAAI,CAAC,UACvC,IAAKmF,EAAKX,MACN,OAAO,KACX,IAAIY,EAAO,CAAA,EACK5C,MAAMC,QAAQ0C,EAAKxE,SAE/ByE,EAAO,CACH,qBAAsB,CAClBC,KAAM,qBAGlB,IAAIC,EAAQ,CACR,oBAAqB,CACjBD,KAAM,OACNE,aAAc,QAItB,OADAD,EAAQZ,OAAOC,OAAOD,OAAOC,OAAO,GAAIW,GAAQF,GACzCE,CAAK,IAEV/B,EAAqB,CAACiC,EAAKtE,EAAkBD,EAAoBE,IAC/DA,EACOqE,EAAIC,UAAUC,QAAQ,wBAAyBzE,GACnDuE,EACFC,QAAQ,GACRC,QAAQ,IAAKxE,GACbwE,QAAQ,wBAAyBzE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),
|
|
1
|
+
"use strict";var e=require("tslib"),i=require("react/jsx-runtime"),s=require("../icon/icon.js");require("../icon/icon.definitions.js");var r=require("@mui/material/styles"),a=require("./snackbar.js");const n=r.styled("div")((i=>{var s=e.__rest(i,[]);return{"& .styled-message-header-message-container":{display:s.header?"block":"flex"},"& p":{display:s.header?"block":"inline",paddingBottom:s.header?"0px":"2px"},"& .snackbar-icon-wrapper":{"& span":{lineHeight:s.header?"20px":"unset"}},"& .custom-snackbar-divider":{paddingLeft:a.checkForIcon(s.icon)?"24px":"56px","& > div":{borderLeft:`1px solid ${s.theme.palette.onSurface.os600}`,height:s.header?"48px":"32px"}}}})),c=({icon:e})=>{let r=null;switch(e){case"alert":r=i.jsx(s.Icon,{name:"warning",fontSize:"inherit",iconStyle:"filled"});break;case"success":r=i.jsx(s.Icon,{name:"circle-check",fontSize:"inherit",iconStyle:"filled"});break;case"warning":r=i.jsx(s.Icon,{name:"circle-exclamation",fontSize:"inherit",iconStyle:"filled"})}return r?i.jsx("span",{className:"snackbar-icon-wrapper",children:r}):r};exports.SnackbarMessage=({header:e,icon:s,message:r})=>i.jsxs(n,{header:e,icon:s,children:[s&&i.jsx(c,{icon:s}),i.jsxs("div",{className:"styled-message-header-message-container",children:[e&&i.jsxs("h3",{children:[" ",e]}),i.jsxs("p",{children:[" ",r," "]})]}),i.jsx("div",{className:"custom-snackbar-divider",children:i.jsx("div",{})})]}),exports.SnackbarMessageStyled=n;
|
|
2
2
|
//# sourceMappingURL=snackbarMessage.js.map
|