@openedx/paragon 21.12.0 → 21.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActionRow/index.js +7 -8
- package/dist/ActionRow/index.js.map +1 -1
- package/dist/Alert/index.js +33 -25
- package/dist/Alert/index.js.map +1 -1
- package/dist/Annotation/index.js +7 -9
- package/dist/Annotation/index.js.map +1 -1
- package/dist/Avatar/index.js +5 -7
- package/dist/Avatar/index.js.map +1 -1
- package/dist/AvatarButton/index.js +10 -12
- package/dist/AvatarButton/index.js.map +1 -1
- package/dist/Badge/index.js +6 -4
- package/dist/Badge/index.js.map +1 -1
- package/dist/Breadcrumb/BreadcrumbLink.js +11 -14
- package/dist/Breadcrumb/BreadcrumbLink.js.map +1 -1
- package/dist/Breadcrumb/index.js +29 -29
- package/dist/Breadcrumb/index.js.map +1 -1
- package/dist/Bubble/index.js +11 -13
- package/dist/Bubble/index.js.map +1 -1
- package/dist/Button/deprecated/index.js +87 -66
- package/dist/Button/deprecated/index.js.map +1 -1
- package/dist/Button/index.js +10 -11
- package/dist/Button/index.js.map +1 -1
- package/dist/Card/CardBody.js +4 -6
- package/dist/Card/CardBody.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarousel.js +11 -13
- package/dist/Card/CardCarousel/CardCarousel.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarouselControls.js +6 -7
- package/dist/Card/CardCarousel/CardCarouselControls.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarouselHeader.js +9 -12
- package/dist/Card/CardCarousel/CardCarouselHeader.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarouselItems.js +6 -9
- package/dist/Card/CardCarousel/CardCarouselItems.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarouselProvider.js +27 -28
- package/dist/Card/CardCarousel/CardCarouselProvider.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarouselSubtitle.js +4 -6
- package/dist/Card/CardCarousel/CardCarouselSubtitle.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarouselTitle.js +4 -6
- package/dist/Card/CardCarousel/CardCarouselTitle.js.map +1 -1
- package/dist/Card/CardContext.js +8 -10
- package/dist/Card/CardContext.js.map +1 -1
- package/dist/Card/CardDeck.js +19 -17
- package/dist/Card/CardDeck.js.map +1 -1
- package/dist/Card/CardDivider.js +3 -5
- package/dist/Card/CardDivider.js.map +1 -1
- package/dist/Card/CardFooter.js +15 -18
- package/dist/Card/CardFooter.js.map +1 -1
- package/dist/Card/CardGrid.js +13 -11
- package/dist/Card/CardGrid.js.map +1 -1
- package/dist/Card/CardHeader.js +17 -22
- package/dist/Card/CardHeader.js.map +1 -1
- package/dist/Card/CardImageCap.js +48 -33
- package/dist/Card/CardImageCap.js.map +1 -1
- package/dist/Card/CardSection.js +11 -14
- package/dist/Card/CardSection.js.map +1 -1
- package/dist/Card/CardStatus.js +11 -14
- package/dist/Card/CardStatus.js.map +1 -1
- package/dist/Card/index.js +18 -20
- package/dist/Card/index.js.map +1 -1
- package/dist/Carousel/index.js +17 -11
- package/dist/Carousel/index.js.map +1 -1
- package/dist/CheckBox/index.js +66 -36
- package/dist/CheckBox/index.js.map +1 -1
- package/dist/Chip/index.js +14 -16
- package/dist/Chip/index.js.map +1 -1
- package/dist/ChipCarousel/index.js +29 -30
- package/dist/ChipCarousel/index.js.map +1 -1
- package/dist/Collapsible/CollapsibleAdvanced.js +82 -62
- package/dist/Collapsible/CollapsibleAdvanced.js.map +1 -1
- package/dist/Collapsible/CollapsibleBody.js +13 -15
- package/dist/Collapsible/CollapsibleBody.js.map +1 -1
- package/dist/Collapsible/CollapsibleTrigger.js +18 -20
- package/dist/Collapsible/CollapsibleTrigger.js.map +1 -1
- package/dist/Collapsible/CollapsibleVisible.js +6 -9
- package/dist/Collapsible/CollapsibleVisible.js.map +1 -1
- package/dist/Collapsible/index.js +17 -18
- package/dist/Collapsible/index.js.map +1 -1
- package/dist/ColorPicker/index.js +58 -33
- package/dist/ColorPicker/index.js.map +1 -1
- package/dist/Container/index.js +14 -11
- package/dist/Container/index.js.map +1 -1
- package/dist/DataTable/ActionDisplay.js +8 -9
- package/dist/DataTable/ActionDisplay.js.map +1 -1
- package/dist/DataTable/BulkActions.js +23 -20
- package/dist/DataTable/BulkActions.js.map +1 -1
- package/dist/DataTable/CardView.js +46 -43
- package/dist/DataTable/CardView.js.map +1 -1
- package/dist/DataTable/CollapsibleButtonGroup.js +57 -39
- package/dist/DataTable/CollapsibleButtonGroup.js.map +1 -1
- package/dist/DataTable/DataTableContext.js +1 -1
- package/dist/DataTable/DataTableContext.js.map +1 -1
- package/dist/DataTable/DataTableLayout.js +6 -9
- package/dist/DataTable/DataTableLayout.js.map +1 -1
- package/dist/DataTable/DataViewToggle.js +25 -20
- package/dist/DataTable/DataViewToggle.js.map +1 -1
- package/dist/DataTable/DropdownFilters.js +41 -28
- package/dist/DataTable/DropdownFilters.js.map +1 -1
- package/dist/DataTable/EmptyTable.js +6 -9
- package/dist/DataTable/EmptyTable.js.map +1 -1
- package/dist/DataTable/ExpandAll.js +2 -4
- package/dist/DataTable/ExpandAll.js.map +1 -1
- package/dist/DataTable/ExpandRow.js +2 -4
- package/dist/DataTable/ExpandRow.js.map +1 -1
- package/dist/DataTable/FilterStatus.js +18 -17
- package/dist/DataTable/FilterStatus.js.map +1 -1
- package/dist/DataTable/RowStatus.js +15 -18
- package/dist/DataTable/RowStatus.js.map +1 -1
- package/dist/DataTable/SidebarFilters.js +16 -13
- package/dist/DataTable/SidebarFilters.js.map +1 -1
- package/dist/DataTable/SmartStatus.js +14 -16
- package/dist/DataTable/SmartStatus.js.map +1 -1
- package/dist/DataTable/Table.js +17 -19
- package/dist/DataTable/Table.js.map +1 -1
- package/dist/DataTable/TableActions.js +11 -13
- package/dist/DataTable/TableActions.js.map +1 -1
- package/dist/DataTable/TableCell.js +6 -10
- package/dist/DataTable/TableCell.js.map +1 -1
- package/dist/DataTable/TableControlBar.js +7 -12
- package/dist/DataTable/TableControlBar.js.map +1 -1
- package/dist/DataTable/TableFilters.js +14 -12
- package/dist/DataTable/TableFilters.js.map +1 -1
- package/dist/DataTable/TableFooter.js +5 -8
- package/dist/DataTable/TableFooter.js.map +1 -1
- package/dist/DataTable/TableHeaderCell.js +11 -15
- package/dist/DataTable/TableHeaderCell.js.map +1 -1
- package/dist/DataTable/TableHeaderRow.js +6 -4
- package/dist/DataTable/TableHeaderRow.js.map +1 -1
- package/dist/DataTable/TablePagination.js +8 -7
- package/dist/DataTable/TablePagination.js.map +1 -1
- package/dist/DataTable/TablePaginationMinimal.js +9 -8
- package/dist/DataTable/TablePaginationMinimal.js.map +1 -1
- package/dist/DataTable/TableRow.js +15 -18
- package/dist/DataTable/TableRow.js.map +1 -1
- package/dist/DataTable/filters/CheckboxFilter.js +23 -22
- package/dist/DataTable/filters/CheckboxFilter.js.map +1 -1
- package/dist/DataTable/filters/DropdownFilter.js +14 -19
- package/dist/DataTable/filters/DropdownFilter.js.map +1 -1
- package/dist/DataTable/filters/MultiSelectDropdownFilter.js +19 -20
- package/dist/DataTable/filters/MultiSelectDropdownFilter.js.map +1 -1
- package/dist/DataTable/filters/TextFilter.js +10 -13
- package/dist/DataTable/filters/TextFilter.js.map +1 -1
- package/dist/DataTable/hooks.js +29 -25
- package/dist/DataTable/hooks.js.map +1 -1
- package/dist/DataTable/index.js +120 -104
- package/dist/DataTable/index.js.map +1 -1
- package/dist/DataTable/selection/BaseSelectionStatus.js +29 -31
- package/dist/DataTable/selection/BaseSelectionStatus.js.map +1 -1
- package/dist/DataTable/selection/ControlledSelect.js +13 -9
- package/dist/DataTable/selection/ControlledSelect.js.map +1 -1
- package/dist/DataTable/selection/ControlledSelectHeader.js +19 -15
- package/dist/DataTable/selection/ControlledSelectHeader.js.map +1 -1
- package/dist/DataTable/selection/ControlledSelectionStatus.js +34 -24
- package/dist/DataTable/selection/ControlledSelectionStatus.js.map +1 -1
- package/dist/DataTable/selection/SelectionStatus.js +23 -23
- package/dist/DataTable/selection/SelectionStatus.js.map +1 -1
- package/dist/DataTable/utils/getVisibleColumns.js +36 -44
- package/dist/DataTable/utils/getVisibleColumns.js.map +1 -1
- package/dist/Dropdown/deprecated/DropdownButton.js +9 -13
- package/dist/Dropdown/deprecated/DropdownButton.js.map +1 -1
- package/dist/Dropdown/deprecated/DropdownItem.js +7 -8
- package/dist/Dropdown/deprecated/DropdownItem.js.map +1 -1
- package/dist/Dropdown/deprecated/DropdownMenu.js +8 -12
- package/dist/Dropdown/deprecated/DropdownMenu.js.map +1 -1
- package/dist/Dropdown/deprecated/index.js +136 -103
- package/dist/Dropdown/deprecated/index.js.map +1 -1
- package/dist/Dropdown/index.js +32 -29
- package/dist/Dropdown/index.js.map +1 -1
- package/dist/Dropzone/DefaultContent.js +13 -13
- package/dist/Dropzone/DefaultContent.js.map +1 -1
- package/dist/Dropzone/DragError.js +1 -3
- package/dist/Dropzone/DragError.js.map +1 -1
- package/dist/Dropzone/GenericError.js +7 -7
- package/dist/Dropzone/GenericError.js.map +1 -1
- package/dist/Dropzone/UploadProgress.js +6 -8
- package/dist/Dropzone/UploadProgress.js.map +1 -1
- package/dist/Dropzone/index.js +145 -86
- package/dist/Dropzone/index.js.map +1 -1
- package/dist/Fieldset/index.js +82 -57
- package/dist/Fieldset/index.js.map +1 -1
- package/dist/Form/FormAutosuggest.js +137 -95
- package/dist/Form/FormAutosuggest.js.map +1 -1
- package/dist/Form/FormAutosuggestOption.js +4 -6
- package/dist/Form/FormAutosuggestOption.js.map +1 -1
- package/dist/Form/FormCheckbox.js +35 -42
- package/dist/Form/FormCheckbox.js.map +1 -1
- package/dist/Form/FormCheckboxSet.js +13 -16
- package/dist/Form/FormCheckboxSet.js.map +1 -1
- package/dist/Form/FormCheckboxSetContext.js +39 -34
- package/dist/Form/FormCheckboxSetContext.js.map +1 -1
- package/dist/Form/FormControl.js +41 -35
- package/dist/Form/FormControl.js.map +1 -1
- package/dist/Form/FormControlDecorator.js +3 -5
- package/dist/Form/FormControlDecorator.js.map +1 -1
- package/dist/Form/FormControlDecoratorGroup.js +8 -10
- package/dist/Form/FormControlDecoratorGroup.js.map +1 -1
- package/dist/Form/FormControlFeedback.js +12 -15
- package/dist/Form/FormControlFeedback.js.map +1 -1
- package/dist/Form/FormControlFloatingLabel.js +3 -6
- package/dist/Form/FormControlFloatingLabel.js.map +1 -1
- package/dist/Form/FormControlSet.js +8 -9
- package/dist/Form/FormControlSet.js.map +1 -1
- package/dist/Form/FormGroup.js +11 -12
- package/dist/Form/FormGroup.js.map +1 -1
- package/dist/Form/FormGroupContext.js +64 -39
- package/dist/Form/FormGroupContext.js.map +1 -1
- package/dist/Form/FormLabel.js +15 -17
- package/dist/Form/FormLabel.js.map +1 -1
- package/dist/Form/FormRadio.js +19 -22
- package/dist/Form/FormRadio.js.map +1 -1
- package/dist/Form/FormRadioSet.js +13 -16
- package/dist/Form/FormRadioSet.js.map +1 -1
- package/dist/Form/FormRadioSetContext.js +39 -34
- package/dist/Form/FormRadioSetContext.js.map +1 -1
- package/dist/Form/FormSwitch.js +19 -20
- package/dist/Form/FormSwitch.js.map +1 -1
- package/dist/Form/FormText.js +20 -29
- package/dist/Form/FormText.js.map +1 -1
- package/dist/Form/useCheckboxSetValues.js +46 -23
- package/dist/Form/useCheckboxSetValues.js.map +1 -1
- package/dist/Hyperlink/index.js +32 -31
- package/dist/Hyperlink/index.js.map +1 -1
- package/dist/Hyperlink/index.scss +2 -2
- package/dist/Icon/index.js +38 -30
- package/dist/Icon/index.js.map +1 -1
- package/dist/IconButton/index.js +31 -33
- package/dist/IconButton/index.js.map +1 -1
- package/dist/IconButtonToggle/index.js +16 -16
- package/dist/IconButtonToggle/index.js.map +1 -1
- package/dist/Input/index.js +122 -92
- package/dist/Input/index.js.map +1 -1
- package/dist/InputSelect/index.js +78 -51
- package/dist/InputSelect/index.js.map +1 -1
- package/dist/InputText/index.js +11 -9
- package/dist/InputText/index.js.map +1 -1
- package/dist/Layout/index.js +33 -29
- package/dist/Layout/index.js.map +1 -1
- package/dist/ListBox/index.js +112 -80
- package/dist/ListBox/index.js.map +1 -1
- package/dist/ListBoxOption/index.js +68 -45
- package/dist/ListBoxOption/index.js.map +1 -1
- package/dist/MailtoLink/index.js +37 -34
- package/dist/MailtoLink/index.js.map +1 -1
- package/dist/Menu/MenuItem.js +13 -14
- package/dist/Menu/MenuItem.js.map +1 -1
- package/dist/Menu/SelectMenu.js +68 -44
- package/dist/Menu/SelectMenu.js.map +1 -1
- package/dist/Menu/index.js +10 -11
- package/dist/Menu/index.js.map +1 -1
- package/dist/Modal/AlertModal.js +5 -7
- package/dist/Modal/AlertModal.js.map +1 -1
- package/dist/Modal/FullscreenModal.js +6 -8
- package/dist/Modal/FullscreenModal.js.map +1 -1
- package/dist/Modal/MarketingModal.js +8 -10
- package/dist/Modal/MarketingModal.js.map +1 -1
- package/dist/Modal/ModalCloseButton.js +13 -15
- package/dist/Modal/ModalCloseButton.js.map +1 -1
- package/dist/Modal/ModalContext.js +13 -13
- package/dist/Modal/ModalContext.js.map +1 -1
- package/dist/Modal/ModalDialog.js +25 -23
- package/dist/Modal/ModalDialog.js.map +1 -1
- package/dist/Modal/ModalDialogBody.js +22 -11
- package/dist/Modal/ModalDialogBody.js.map +1 -1
- package/dist/Modal/ModalDialogFooter.js +6 -7
- package/dist/Modal/ModalDialogFooter.js.map +1 -1
- package/dist/Modal/ModalDialogHeader.js +6 -7
- package/dist/Modal/ModalDialogHeader.js.map +1 -1
- package/dist/Modal/ModalDialogHero.js +6 -7
- package/dist/Modal/ModalDialogHero.js.map +1 -1
- package/dist/Modal/ModalDialogHeroBackground.js +8 -9
- package/dist/Modal/ModalDialogHeroBackground.js.map +1 -1
- package/dist/Modal/ModalDialogHeroContent.js +6 -7
- package/dist/Modal/ModalDialogHeroContent.js.map +1 -1
- package/dist/Modal/ModalDialogTitle.js +6 -7
- package/dist/Modal/ModalDialogTitle.js.map +1 -1
- package/dist/Modal/ModalLayer.js +11 -17
- package/dist/Modal/ModalLayer.js.map +1 -1
- package/dist/Modal/ModalPopup.js +17 -17
- package/dist/Modal/ModalPopup.js.map +1 -1
- package/dist/Modal/PopperElement.js +25 -18
- package/dist/Modal/PopperElement.js.map +1 -1
- package/dist/Modal/Portal.js +40 -18
- package/dist/Modal/Portal.js.map +1 -1
- package/dist/Modal/StandardModal.js +6 -8
- package/dist/Modal/StandardModal.js.map +1 -1
- package/dist/Modal/index.js +226 -193
- package/dist/Modal/index.js.map +1 -1
- package/dist/Nav/index.js +3 -2
- package/dist/Nav/index.js.map +1 -1
- package/dist/Navbar/index.js +7 -6
- package/dist/Navbar/index.js.map +1 -1
- package/dist/OverflowScroll/OverflowScroll.js +45 -37
- package/dist/OverflowScroll/OverflowScroll.js.map +1 -1
- package/dist/OverflowScroll/OverflowScrollContext.js +1 -1
- package/dist/OverflowScroll/OverflowScrollContext.js.map +1 -1
- package/dist/OverflowScroll/OverflowScrollItems.js +2 -4
- package/dist/OverflowScroll/OverflowScrollItems.js.map +1 -1
- package/dist/Overlay/index.js +4 -4
- package/dist/Overlay/index.js.map +1 -1
- package/dist/PageBanner/index.js +11 -13
- package/dist/PageBanner/index.js.map +1 -1
- package/dist/Pagination/index.js +331 -296
- package/dist/Pagination/index.js.map +1 -1
- package/dist/Popover/index.js +18 -21
- package/dist/Popover/index.js.map +1 -1
- package/dist/ProductTour/Checkpoint.js +39 -30
- package/dist/ProductTour/Checkpoint.js.map +1 -1
- package/dist/ProductTour/CheckpointActionRow.js +18 -16
- package/dist/ProductTour/CheckpointActionRow.js.map +1 -1
- package/dist/ProductTour/CheckpointBody.js +2 -4
- package/dist/ProductTour/CheckpointBody.js.map +1 -1
- package/dist/ProductTour/CheckpointBreadcrumbs.js +16 -16
- package/dist/ProductTour/CheckpointBreadcrumbs.js.map +1 -1
- package/dist/ProductTour/CheckpointTitle.js +2 -4
- package/dist/ProductTour/CheckpointTitle.js.map +1 -1
- package/dist/ProductTour/index.js +66 -47
- package/dist/ProductTour/index.js.map +1 -1
- package/dist/ProductTour/messages.js +16 -0
- package/dist/ProgressBar/index.js +37 -35
- package/dist/ProgressBar/index.js.map +1 -1
- package/dist/RadioButtonGroup/index.js +133 -102
- package/dist/RadioButtonGroup/index.js.map +1 -1
- package/dist/Scrollable/index.js +30 -15
- package/dist/Scrollable/index.js.map +1 -1
- package/dist/SearchField/SearchFieldAdvanced.js +66 -51
- package/dist/SearchField/SearchFieldAdvanced.js.map +1 -1
- package/dist/SearchField/SearchFieldClearButton.js +7 -8
- package/dist/SearchField/SearchFieldClearButton.js.map +1 -1
- package/dist/SearchField/SearchFieldInput.js +8 -9
- package/dist/SearchField/SearchFieldInput.js.map +1 -1
- package/dist/SearchField/SearchFieldLabel.js +8 -11
- package/dist/SearchField/SearchFieldLabel.js.map +1 -1
- package/dist/SearchField/SearchFieldSubmitButton.js +12 -15
- package/dist/SearchField/SearchFieldSubmitButton.js.map +1 -1
- package/dist/SearchField/index.js +22 -23
- package/dist/SearchField/index.js.map +1 -1
- package/dist/SelectableBox/SelectableBoxSet.js +25 -26
- package/dist/SelectableBox/SelectableBoxSet.js.map +1 -1
- package/dist/SelectableBox/index.js +42 -38
- package/dist/SelectableBox/index.js.map +1 -1
- package/dist/Sheet/SheetContainer.js +38 -16
- package/dist/Sheet/SheetContainer.js.map +1 -1
- package/dist/Sheet/index.js +65 -43
- package/dist/Sheet/index.js.map +1 -1
- package/dist/Spinner/index.js +8 -9
- package/dist/Spinner/index.js.map +1 -1
- package/dist/Stack/index.js +9 -11
- package/dist/Stack/index.js.map +1 -1
- package/dist/StatefulButton/index.js +15 -17
- package/dist/StatefulButton/index.js.map +1 -1
- package/dist/StatusAlert/index.js +120 -82
- package/dist/StatusAlert/index.js.map +1 -1
- package/dist/Stepper/Stepper.js +2 -4
- package/dist/Stepper/Stepper.js.map +1 -1
- package/dist/Stepper/StepperActionRow.js +7 -10
- package/dist/Stepper/StepperActionRow.js.map +1 -1
- package/dist/Stepper/StepperContext.js +64 -32
- package/dist/Stepper/StepperContext.js.map +1 -1
- package/dist/Stepper/StepperHeader.js +23 -30
- package/dist/Stepper/StepperHeader.js.map +1 -1
- package/dist/Stepper/StepperHeaderStep.js +14 -17
- package/dist/Stepper/StepperHeaderStep.js.map +1 -1
- package/dist/Stepper/StepperStep.js +23 -24
- package/dist/Stepper/StepperStep.js.map +1 -1
- package/dist/Sticky/index.js +30 -22
- package/dist/Sticky/index.js.map +1 -1
- package/dist/Table/index.js +178 -109
- package/dist/Table/index.js.map +1 -1
- package/dist/Tabs/deprecated/index.js +99 -66
- package/dist/Tabs/deprecated/index.js.map +1 -1
- package/dist/Tabs/index.js +72 -56
- package/dist/Tabs/index.js.map +1 -1
- package/dist/TextArea/index.js +10 -8
- package/dist/TextArea/index.js.map +1 -1
- package/dist/Toast/ToastContainer.js +38 -16
- package/dist/Toast/ToastContainer.js.map +1 -1
- package/dist/Toast/index.js +33 -18
- package/dist/Toast/index.js.map +1 -1
- package/dist/Tooltip/index.js +8 -9
- package/dist/Tooltip/index.js.map +1 -1
- package/dist/TransitionReplace/DemoTransitionReplace.js +12 -3
- package/dist/TransitionReplace/DemoTransitionReplace.js.map +1 -1
- package/dist/TransitionReplace/index.js +136 -100
- package/dist/TransitionReplace/index.js.map +1 -1
- package/dist/Truncate/index.js +30 -24
- package/dist/Truncate/index.js.map +1 -1
- package/dist/ValidationFormGroup/index.js +38 -37
- package/dist/ValidationFormGroup/index.js.map +1 -1
- package/dist/ValidationMessage/index.js +76 -51
- package/dist/ValidationMessage/index.js.map +1 -1
- package/dist/asInput/index.js +251 -202
- package/dist/asInput/index.js.map +1 -1
- package/dist/hooks/useArrowKeyNavigation.js +46 -43
- package/dist/hooks/useArrowKeyNavigation.js.map +1 -1
- package/dist/hooks/useIndexOfLastVisibleChild.js +50 -41
- package/dist/hooks/useIndexOfLastVisibleChild.js.map +1 -1
- package/dist/hooks/useIsVisible.js +20 -13
- package/dist/hooks/useIsVisible.js.map +1 -1
- package/dist/hooks/useToggle.js +18 -11
- package/dist/hooks/useToggle.js.map +1 -1
- package/dist/hooks/useWindowSize.js +17 -6
- package/dist/hooks/useWindowSize.js.map +1 -1
- package/dist/i18n/messages/ar.json +2 -1
- package/dist/i18n/messages/ca.json +2 -1
- package/dist/i18n/messages/es_419.json +2 -1
- package/dist/i18n/messages/es_AR.json +2 -1
- package/dist/i18n/messages/es_ES.json +2 -1
- package/dist/i18n/messages/fr.json +2 -1
- package/dist/i18n/messages/he.json +2 -1
- package/dist/i18n/messages/id.json +2 -1
- package/dist/i18n/messages/it_IT.json +2 -1
- package/dist/i18n/messages/ko_KR.json +2 -1
- package/dist/i18n/messages/pl.json +2 -1
- package/dist/i18n/messages/pt_BR.json +2 -1
- package/dist/i18n/messages/pt_PT.json +2 -1
- package/dist/i18n/messages/ru.json +2 -1
- package/dist/i18n/messages/th.json +2 -1
- package/dist/i18n/messages/tr_TR.json +2 -1
- package/dist/i18n/messages/uk.json +2 -1
- package/dist/i18n/messages/zh_CN.json +2 -1
- package/dist/paragon.css +1 -1
- package/dist/withDeprecatedProps.js +79 -58
- package/dist/withDeprecatedProps.js.map +1 -1
- package/package.json +1 -5
- package/src/Button/index.jsx +2 -2
- package/src/Container/index.jsx +4 -0
- package/src/Dropdown/index.jsx +4 -0
- package/src/Dropzone/index.jsx +1 -1
- package/src/Form/FormSwitch.jsx +3 -0
- package/src/Hyperlink/index.jsx +7 -6
- package/src/Hyperlink/index.scss +2 -2
- package/src/Icon/index.jsx +18 -11
- package/src/IconButton/__snapshots__/IconButton.test.jsx.snap +12 -10
- package/src/IconButton/index.jsx +2 -2
- package/src/Layout/index.jsx +1 -4
- package/src/Menu/MenuItem.jsx +2 -2
- package/src/Modal/ModalDialog.jsx +3 -0
- package/src/Modal/index.jsx +11 -6
- package/src/Overlay/README.md +1 -1
- package/src/Overlay/index.jsx +1 -1
- package/src/Popover/README.md +0 -1
- package/src/Popover/index.jsx +11 -11
- package/src/ProductTour/Checkpoint.jsx +9 -6
- package/src/ProductTour/messages.js +16 -0
- package/src/SearchField/SearchFieldAdvanced.jsx +12 -7
- package/src/SearchField/SearchFieldLabel.jsx +3 -3
- package/src/SearchField/index.jsx +0 -1
- package/src/Tabs/index.jsx +19 -13
- package/src/hooks/tests/useIndexOfLastVisibleChild.test.jsx +3 -3
- package/src/hooks/useIndexOfLastVisibleChild.jsx +36 -38
- package/src/hooks/useIndexOfLastVisibleChild.mdx +3 -3
- package/src/i18n/messages/ar.json +2 -1
- package/src/i18n/messages/ca.json +2 -1
- package/src/i18n/messages/es_419.json +2 -1
- package/src/i18n/messages/es_AR.json +2 -1
- package/src/i18n/messages/es_ES.json +2 -1
- package/src/i18n/messages/fr.json +2 -1
- package/src/i18n/messages/he.json +2 -1
- package/src/i18n/messages/id.json +2 -1
- package/src/i18n/messages/it_IT.json +2 -1
- package/src/i18n/messages/ko_KR.json +2 -1
- package/src/i18n/messages/pl.json +2 -1
- package/src/i18n/messages/pt_BR.json +2 -1
- package/src/i18n/messages/pt_PT.json +2 -1
- package/src/i18n/messages/ru.json +2 -1
- package/src/i18n/messages/th.json +2 -1
- package/src/i18n/messages/tr_TR.json +2 -1
- package/src/i18n/messages/uk.json +2 -1
- package/src/i18n/messages/zh_CN.json +2 -1
package/dist/Input/index.js
CHANGED
|
@@ -1,110 +1,138 @@
|
|
|
1
|
-
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["value", "label", "group"],
|
|
2
3
|
_excluded2 = ["type", "className", "options", "forwardedRef"];
|
|
3
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
6
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
7
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
7
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
9
8
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
9
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
11
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
12
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
14
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
15
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
16
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
17
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
19
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
20
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
21
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
11
22
|
import React from 'react';
|
|
12
23
|
import classNames from 'classnames';
|
|
13
24
|
import PropTypes from 'prop-types';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
25
|
+
var Input = /*#__PURE__*/function (_React$Component) {
|
|
26
|
+
_inherits(Input, _React$Component);
|
|
27
|
+
var _super = _createSuper(Input);
|
|
28
|
+
function Input() {
|
|
29
|
+
_classCallCheck(this, Input);
|
|
30
|
+
return _super.apply(this, arguments);
|
|
19
31
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
32
|
+
_createClass(Input, [{
|
|
33
|
+
key: "componentDidMount",
|
|
34
|
+
value: function componentDidMount() {
|
|
35
|
+
if (process.env.NODE_ENV === 'development') {
|
|
36
|
+
this.checkHasLabel();
|
|
37
|
+
}
|
|
26
38
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return 'form-check-input';
|
|
36
|
-
default:
|
|
37
|
-
return 'form-control';
|
|
39
|
+
}, {
|
|
40
|
+
key: "getHTMLTagForType",
|
|
41
|
+
value: function getHTMLTagForType() {
|
|
42
|
+
var type = this.props.type;
|
|
43
|
+
if (type === 'select' || type === 'textarea') {
|
|
44
|
+
return type;
|
|
45
|
+
}
|
|
46
|
+
return 'input';
|
|
38
47
|
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
}, {
|
|
49
|
+
key: "getClassNameForType",
|
|
50
|
+
value: function getClassNameForType() {
|
|
51
|
+
switch (this.props.type) {
|
|
52
|
+
case 'file':
|
|
53
|
+
return 'form-control-file';
|
|
54
|
+
case 'checkbox':
|
|
55
|
+
case 'radio':
|
|
56
|
+
return 'form-check-input';
|
|
57
|
+
default:
|
|
58
|
+
return 'form-control';
|
|
59
|
+
}
|
|
44
60
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
61
|
+
}, {
|
|
62
|
+
key: "setRef",
|
|
63
|
+
value: function setRef(forwardedRef) {
|
|
64
|
+
var _this = this;
|
|
65
|
+
// In production just return the optional forwardedRef
|
|
66
|
+
if (process.env.NODE_ENV !== 'development') {
|
|
67
|
+
return forwardedRef;
|
|
68
|
+
}
|
|
69
|
+
return function (element) {
|
|
70
|
+
if (forwardedRef) {
|
|
71
|
+
forwardedRef.current = element;
|
|
72
|
+
} // eslint-disable-line no-param-reassign
|
|
73
|
+
_this.inputEl = element;
|
|
74
|
+
};
|
|
55
75
|
}
|
|
56
|
-
|
|
57
|
-
|
|
76
|
+
}, {
|
|
77
|
+
key: "checkHasLabel",
|
|
78
|
+
value: function checkHasLabel() {
|
|
79
|
+
if (this.inputEl.labels.length > 0) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (this.inputEl.getAttribute('aria-label') !== null) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (this.inputEl.getAttribute('aria-labelledby') !== null) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (console) {
|
|
89
|
+
// eslint-disable-next-line no-console
|
|
90
|
+
console.warn('Input[a11y]: There is no associated label for this Input');
|
|
91
|
+
}
|
|
58
92
|
}
|
|
59
|
-
|
|
60
|
-
|
|
93
|
+
}, {
|
|
94
|
+
key: "renderOptions",
|
|
95
|
+
value: function renderOptions(options) {
|
|
96
|
+
var _this2 = this;
|
|
97
|
+
return options.map(function (option) {
|
|
98
|
+
var value = option.value,
|
|
99
|
+
label = option.label,
|
|
100
|
+
group = option.group,
|
|
101
|
+
attributes = _objectWithoutProperties(option, _excluded);
|
|
102
|
+
if (group) {
|
|
103
|
+
return /*#__PURE__*/React.createElement("optgroup", _extends({
|
|
104
|
+
key: "optgroup-".concat(label),
|
|
105
|
+
label: label
|
|
106
|
+
}, attributes), _this2.renderOptions(group));
|
|
107
|
+
}
|
|
108
|
+
return /*#__PURE__*/React.createElement("option", _extends({
|
|
109
|
+
key: value,
|
|
110
|
+
value: value
|
|
111
|
+
}, attributes), label);
|
|
112
|
+
}, this);
|
|
61
113
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
114
|
+
}, {
|
|
115
|
+
key: "render",
|
|
116
|
+
value: function render() {
|
|
117
|
+
var _this$props = this.props,
|
|
118
|
+
type = _this$props.type,
|
|
119
|
+
className = _this$props.className,
|
|
120
|
+
options = _this$props.options,
|
|
121
|
+
forwardedRef = _this$props.forwardedRef,
|
|
122
|
+
attributes = _objectWithoutProperties(_this$props, _excluded2);
|
|
123
|
+
var htmlTag = this.getHTMLTagForType();
|
|
124
|
+
var htmlProps = _objectSpread(_objectSpread({
|
|
125
|
+
className: classNames(this.getClassNameForType(), className),
|
|
126
|
+
type: htmlTag === 'input' ? type : undefined
|
|
127
|
+
}, attributes), {}, {
|
|
128
|
+
ref: this.setRef(forwardedRef)
|
|
129
|
+
});
|
|
130
|
+
var htmlChildren = type === 'select' ? this.renderOptions(options) : null;
|
|
131
|
+
return /*#__PURE__*/React.createElement(htmlTag, htmlProps, htmlChildren);
|
|
65
132
|
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const {
|
|
70
|
-
value,
|
|
71
|
-
label,
|
|
72
|
-
group
|
|
73
|
-
} = option,
|
|
74
|
-
attributes = _objectWithoutProperties(option, _excluded);
|
|
75
|
-
if (group) {
|
|
76
|
-
return /*#__PURE__*/React.createElement("optgroup", _extends({
|
|
77
|
-
key: `optgroup-${label}`,
|
|
78
|
-
label: label
|
|
79
|
-
}, attributes), this.renderOptions(group));
|
|
80
|
-
}
|
|
81
|
-
return /*#__PURE__*/React.createElement("option", _extends({
|
|
82
|
-
key: value,
|
|
83
|
-
value: value
|
|
84
|
-
}, attributes), label);
|
|
85
|
-
}, this);
|
|
86
|
-
}
|
|
87
|
-
render() {
|
|
88
|
-
const _this$props = this.props,
|
|
89
|
-
{
|
|
90
|
-
type,
|
|
91
|
-
className,
|
|
92
|
-
options,
|
|
93
|
-
forwardedRef // eslint-disable-line react/prop-types
|
|
94
|
-
// eslint-disable-line react/prop-types
|
|
95
|
-
} = _this$props,
|
|
96
|
-
attributes = _objectWithoutProperties(_this$props, _excluded2);
|
|
97
|
-
const htmlTag = this.getHTMLTagForType();
|
|
98
|
-
const htmlProps = _objectSpread(_objectSpread({
|
|
99
|
-
className: classNames(this.getClassNameForType(), className),
|
|
100
|
-
type: htmlTag === 'input' ? type : undefined
|
|
101
|
-
}, attributes), {}, {
|
|
102
|
-
ref: this.setRef(forwardedRef)
|
|
103
|
-
});
|
|
104
|
-
const htmlChildren = type === 'select' ? this.renderOptions(options) : null;
|
|
105
|
-
return /*#__PURE__*/React.createElement(htmlTag, htmlProps, htmlChildren);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
133
|
+
}]);
|
|
134
|
+
return Input;
|
|
135
|
+
}(React.Component);
|
|
108
136
|
Input.propTypes = {
|
|
109
137
|
/** specifies the type of component.
|
|
110
138
|
* One of select, textarea, or any valid type for an html input tag. */
|
|
@@ -129,8 +157,10 @@ Input.defaultProps = {
|
|
|
129
157
|
};
|
|
130
158
|
|
|
131
159
|
// eslint-disable-next-line react/no-multi-comp
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
160
|
+
var InputWithRefForwarding = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
161
|
+
return /*#__PURE__*/React.createElement(Input, _extends({
|
|
162
|
+
forwardedRef: ref
|
|
163
|
+
}, props));
|
|
164
|
+
});
|
|
135
165
|
export default InputWithRefForwarding;
|
|
136
166
|
//# sourceMappingURL=index.js.map
|
package/dist/Input/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","classNames","PropTypes","Input","Component","componentDidMount","process","env","NODE_ENV","checkHasLabel","getHTMLTagForType","type","props","getClassNameForType","setRef","forwardedRef","element","current","inputEl","labels","length","getAttribute","console","warn","renderOptions","options","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","classNames","PropTypes","Input","_React$Component","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","componentDidMount","process","env","NODE_ENV","checkHasLabel","getHTMLTagForType","type","props","getClassNameForType","setRef","forwardedRef","_this","element","current","inputEl","labels","length","getAttribute","console","warn","renderOptions","options","_this2","map","option","label","group","attributes","_objectWithoutProperties","_excluded","createElement","_extends","concat","render","_this$props","className","_excluded2","htmlTag","htmlProps","_objectSpread","undefined","ref","htmlChildren","Component","propTypes","oneOf","isRequired","string","arrayOf","shape","oneOfType","number","disabled","bool","defaultProps","InputWithRefForwarding","forwardRef"],"sources":["../../src/Input/index.jsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\n\nclass Input extends React.Component {\n componentDidMount() {\n if (process.env.NODE_ENV === 'development') {\n this.checkHasLabel();\n }\n }\n\n getHTMLTagForType() {\n const { type } = this.props;\n if (type === 'select' || type === 'textarea') { return type; }\n return 'input';\n }\n\n getClassNameForType() {\n switch (this.props.type) {\n case 'file':\n return 'form-control-file';\n case 'checkbox':\n case 'radio':\n return 'form-check-input';\n default:\n return 'form-control';\n }\n }\n\n setRef(forwardedRef) {\n // In production just return the optional forwardedRef\n if (process.env.NODE_ENV !== 'development') { return forwardedRef; }\n\n return (element) => {\n if (forwardedRef) { forwardedRef.current = element; } // eslint-disable-line no-param-reassign\n this.inputEl = element;\n };\n }\n\n checkHasLabel() {\n if (this.inputEl.labels.length > 0) { return; }\n if (this.inputEl.getAttribute('aria-label') !== null) { return; }\n if (this.inputEl.getAttribute('aria-labelledby') !== null) { return; }\n\n if (console) {\n // eslint-disable-next-line no-console\n console.warn('Input[a11y]: There is no associated label for this Input');\n }\n }\n\n renderOptions(options) {\n return options.map((option) => {\n const {\n value,\n label,\n group,\n ...attributes\n } = option;\n\n if (group) {\n return (\n <optgroup key={`optgroup-${label}`} label={label} {...attributes}>\n {this.renderOptions(group)}\n </optgroup>\n );\n }\n return (\n <option key={value} value={value} {...attributes}>\n {label}\n </option>\n );\n }, this);\n }\n\n render() {\n const {\n type,\n className,\n options,\n forwardedRef, // eslint-disable-line react/prop-types\n ...attributes // eslint-disable-line react/prop-types\n } = this.props;\n\n const htmlTag = this.getHTMLTagForType();\n const htmlProps = {\n className: classNames(this.getClassNameForType(), className),\n type: htmlTag === 'input' ? type : undefined,\n ...attributes,\n ref: this.setRef(forwardedRef),\n };\n const htmlChildren = type === 'select' ? this.renderOptions(options) : null;\n\n return React.createElement(htmlTag, htmlProps, htmlChildren);\n }\n}\n\nInput.propTypes = {\n /** specifies the type of component.\n * One of select, textarea, or any valid type for an html input tag. */\n type: PropTypes.oneOf([\n 'textarea',\n 'select',\n 'checkbox',\n 'color',\n 'date',\n 'datetime',\n 'datetime-local',\n 'email',\n 'file',\n 'hidden',\n 'image',\n 'month',\n 'number',\n 'password',\n 'radio',\n 'range',\n 'reset',\n 'search',\n 'submit',\n 'tel',\n 'text',\n 'time',\n 'url',\n 'week',\n ]).isRequired,\n /** specifies the className in addition to a bootstrap class name. */\n className: PropTypes.string,\n /** should be used to specify the options of an Input of type select */\n options: PropTypes.arrayOf(PropTypes.shape({\n label: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n disabled: PropTypes.bool,\n group: PropTypes.arrayOf(PropTypes.shape({\n label: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n disabled: PropTypes.bool,\n })),\n })),\n};\n\nInput.defaultProps = {\n className: undefined,\n options: [],\n};\n\n// eslint-disable-next-line react/no-multi-comp\nconst InputWithRefForwarding = React.forwardRef((props, ref) => (\n <Input forwardedRef={ref} {...props} />\n));\n\nexport default InputWithRefForwarding;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,YAAY;AAAC,IAE7BC,KAAK,0BAAAC,gBAAA;EAAAC,SAAA,CAAAF,KAAA,EAAAC,gBAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,KAAA;EAAA,SAAAA,MAAA;IAAAK,eAAA,OAAAL,KAAA;IAAA,OAAAG,MAAA,CAAAG,KAAA,OAAAC,SAAA;EAAA;EAAAC,YAAA,CAAAR,KAAA;IAAAS,GAAA;IAAAC,KAAA,EACT,SAAAC,kBAAA,EAAoB;MAClB,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,aAAa,EAAE;QAC1C,IAAI,CAACC,aAAa,CAAC,CAAC;MACtB;IACF;EAAC;IAAAN,GAAA;IAAAC,KAAA,EAED,SAAAM,kBAAA,EAAoB;MAClB,IAAQC,IAAI,GAAK,IAAI,CAACC,KAAK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AC+D,MAAM,CAAC,CAAC;MAChEpD,KAAK,EAAEX,SAAS,CAAC8D,SAAS,CAAC,CAAC9D,SAAS,CAAC2D,MAAM,EAAE3D,SAAS,CAAC+D,MAAM,CAAC,CAAC;MAChEC,QAAQ,EAAEhE,SAAS,CAACiE;IACtB,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC;AAEDhE,KAAK,CAACiE,YAAY,GAAG;EACnBnB,SAAS,EAAEK,SAAS;EACpBnB,OAAO,EAAE;AACX,CAAC;;AAED;AACA,IAAMkC,sBAAsB,gBAAGrE,KAAK,CAACsE,UAAU,CAAC,UAACjD,KAAK,EAAEkC,GAAG;EAAA,oBACzDvD,KAAA,CAAA4C,aAAA,CAACzC,KAAK,EAAA0C,QAAA;IAACrB,YAAY,EAAE+B;EAAI,GAAKlC,KAAK,CAAG,CAAC;AAAA,CACxC,CAAC;AAEF,eAAegD,sBAAsB"}
|
|
@@ -1,60 +1,83 @@
|
|
|
1
|
-
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["className", "inputRef"];
|
|
2
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
4
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
8
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
9
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
12
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
13
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
15
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
16
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
17
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
5
18
|
import React from 'react';
|
|
6
19
|
import PropTypes from 'prop-types';
|
|
7
20
|
import asInput from '../asInput';
|
|
8
21
|
import withDeprecatedProps, { DeprTypes } from '../withDeprecatedProps';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
label,
|
|
16
|
-
value
|
|
17
|
-
} = option;
|
|
18
|
-
if (typeof option === 'string') {
|
|
19
|
-
label = option;
|
|
20
|
-
value = option;
|
|
21
|
-
}
|
|
22
|
-
return /*#__PURE__*/React.createElement("option", {
|
|
23
|
-
key: `option-${i}`,
|
|
24
|
-
value: value,
|
|
25
|
-
disabled: disabled
|
|
26
|
-
}, label);
|
|
22
|
+
var Select = /*#__PURE__*/function (_React$Component) {
|
|
23
|
+
_inherits(Select, _React$Component);
|
|
24
|
+
var _super = _createSuper(Select);
|
|
25
|
+
function Select() {
|
|
26
|
+
_classCallCheck(this, Select);
|
|
27
|
+
return _super.apply(this, arguments);
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
_createClass(Select, [{
|
|
30
|
+
key: "getOptions",
|
|
31
|
+
value: function getOptions() {
|
|
32
|
+
return this.props.options.map(function (option, i) {
|
|
33
|
+
var section;
|
|
34
|
+
if (option.options) {
|
|
35
|
+
var groupOpts = option.options.map(function (opt, j) {
|
|
36
|
+
return Select.getOption(opt, j);
|
|
37
|
+
});
|
|
38
|
+
section = /*#__PURE__*/React.createElement("optgroup", {
|
|
39
|
+
label: option.label,
|
|
40
|
+
key: option.label
|
|
41
|
+
}, groupOpts);
|
|
42
|
+
} else {
|
|
43
|
+
section = Select.getOption(option, i);
|
|
44
|
+
}
|
|
45
|
+
return section;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}, {
|
|
49
|
+
key: "render",
|
|
50
|
+
value: function render() {
|
|
51
|
+
var _this$props = this.props,
|
|
52
|
+
className = _this$props.className,
|
|
53
|
+
inputRef = _this$props.inputRef,
|
|
54
|
+
others = _objectWithoutProperties(_this$props, _excluded);
|
|
55
|
+
var options = this.getOptions();
|
|
56
|
+
return /*#__PURE__*/React.createElement("select", _extends({}, others, {
|
|
57
|
+
className: className,
|
|
58
|
+
type: "select",
|
|
59
|
+
ref: inputRef
|
|
60
|
+
}), options);
|
|
61
|
+
}
|
|
62
|
+
}], [{
|
|
63
|
+
key: "getOption",
|
|
64
|
+
value: function getOption(option, i) {
|
|
65
|
+
var disabled = option.disabled;
|
|
66
|
+
var label = option.label,
|
|
67
|
+
value = option.value;
|
|
68
|
+
if (typeof option === 'string') {
|
|
69
|
+
label = option;
|
|
70
|
+
value = option;
|
|
39
71
|
}
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
others = _objectWithoutProperties(_this$props, _excluded);
|
|
50
|
-
const options = this.getOptions();
|
|
51
|
-
return /*#__PURE__*/React.createElement("select", _extends({}, others, {
|
|
52
|
-
className: className,
|
|
53
|
-
type: "select",
|
|
54
|
-
ref: inputRef
|
|
55
|
-
}), options);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
72
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
73
|
+
key: "option-".concat(i),
|
|
74
|
+
value: value,
|
|
75
|
+
disabled: disabled
|
|
76
|
+
}, label);
|
|
77
|
+
}
|
|
78
|
+
}]);
|
|
79
|
+
return Select;
|
|
80
|
+
}(React.Component);
|
|
58
81
|
Select.propTypes = {
|
|
59
82
|
className: PropTypes.string,
|
|
60
83
|
inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
@@ -66,11 +89,15 @@ Select.defaultProps = {
|
|
|
66
89
|
className: undefined,
|
|
67
90
|
inputRef: undefined
|
|
68
91
|
};
|
|
69
|
-
|
|
92
|
+
var InputSelect = asInput(withDeprecatedProps(Select, 'InputSelect', {
|
|
70
93
|
className: {
|
|
71
94
|
deprType: DeprTypes.FORMAT,
|
|
72
|
-
expect:
|
|
73
|
-
|
|
95
|
+
expect: function expect(value) {
|
|
96
|
+
return typeof value === 'string';
|
|
97
|
+
},
|
|
98
|
+
transform: function transform(value) {
|
|
99
|
+
return Array.isArray(value) ? value.join(' ') : value;
|
|
100
|
+
},
|
|
74
101
|
message: 'It should be a string.'
|
|
75
102
|
}
|
|
76
103
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","asInput","withDeprecatedProps","DeprTypes","Select","Component","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","asInput","withDeprecatedProps","DeprTypes","Select","_React$Component","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","getOptions","props","options","map","option","i","section","groupOpts","opt","j","getOption","createElement","label","render","_this$props","className","inputRef","others","_objectWithoutProperties","_excluded","_extends","type","ref","disabled","concat","Component","propTypes","string","oneOfType","func","shape","current","instanceOf","element","arrayOf","isRequired","defaultProps","undefined","InputSelect","deprType","FORMAT","expect","transform","Array","isArray","join","message"],"sources":["../../src/InputSelect/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport asInput from '../asInput';\nimport withDeprecatedProps, { DeprTypes } from '../withDeprecatedProps';\n\nclass Select extends React.Component {\n static getOption(option, i) {\n const { disabled } = option;\n let { label, value } = option;\n\n if (typeof option === 'string') {\n label = option;\n value = option;\n }\n\n return (\n <option\n key={`option-${i}`}\n value={value}\n disabled={disabled}\n >\n {label}\n </option>\n );\n }\n\n getOptions() {\n return this.props.options.map((option, i) => {\n let section;\n if (option.options) {\n const groupOpts = option.options.map((opt, j) => Select.getOption(opt, j));\n section = (\n <optgroup label={option.label} key={option.label}>\n {groupOpts}\n </optgroup>\n );\n } else {\n section = Select.getOption(option, i);\n }\n return section;\n });\n }\n\n render() {\n const {\n className,\n inputRef,\n ...others\n } = this.props;\n const options = this.getOptions();\n\n return (\n <select\n {...others}\n className={className}\n type=\"select\"\n ref={inputRef}\n >\n {options}\n </select>\n );\n }\n}\n\nSelect.propTypes = {\n className: PropTypes.string,\n inputRef: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({ current: PropTypes.instanceOf(PropTypes.element) }),\n ]),\n options: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.string),\n PropTypes.arrayOf(PropTypes.shape({})),\n ]).isRequired,\n};\n\nSelect.defaultProps = {\n className: undefined,\n inputRef: undefined,\n};\n\nconst InputSelect = asInput(withDeprecatedProps(Select, 'InputSelect', {\n className: {\n deprType: DeprTypes.FORMAT,\n expect: value => typeof value === 'string',\n transform: value => (Array.isArray(value) ? value.join(' ') : value),\n message: 'It should be a string.',\n },\n}));\n\nexport default InputSelect;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,OAAO,MAAM,YAAY;AAChC,OAAOC,mBAAmB,IAAIC,SAAS,QAAQ,wBAAwB;AAAC,IAElEC,MAAM,0BAAAC,gBAAA;EAAAC,SAAA,CAAAF,MAAA,EAAAC,gBAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,MAAA;EAAA,SAAAA,OAAA;IAAAK,eAAA,OAAAL,MAAA;IAAA,OAAAG,MAAA,CAAAG,KAAA,OAAAC,SAAA;EAAA;EAAAC,YAAA,CAAAR,MAAA;IAAAS,GAAA;IAAAC,KAAA,EAqBV,SAAAC,WAAA,EAAa;MACX,OAAO,IAAI,CAACC,KAAK,CAACC,OAAO,CAACC,GAAG,CAAC,UAACC,MAAM,EAAEC,CAAC,EAAK;QAC3C,IAAIC,OAAO;QACX,IAAIF,MAAM,CAACF,OAAO,EAAE;UAClB,IAAMK,SAAS,GAAGH,MAAM,CAACF,OAAO,CAACC,GAAG,CAAC,UAACK,GAAG,EAAEC,CAAC;YAAA,OAAKpB,MAAM,CAACqB,SAAS,CAACF,GAAG,EAAEC,CAAC,CAAC;UAAA,EAAC;UAC1EH,OAAO,gBACLtB,KAAA,CAAA2B,aAAA;YAAUC,KAAK,EAAER,MAAM,CAACQ,KAAM;YAACd,GAAG,EAAEM,MAAM,CAACQ;UAAM,GAC9CL,SACO,CACX;QACH,CAAC,MAAM;UACLD,OAAO,GAAGjB,MAAM,CAACqB,SAAS,CAACN,MAAM,EAAEC,CAAC,CAAC;QACvC;QACA,OAAOC,OAAO;MAChB,CAAC,CAAC;IACJ;EAAC;IAAAR,GAAA;IAAAC,KAAA,EAED,SAAAc,OAAA,EAAS;MACP,IAAAC,WAAA,GAII,IAAI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AS,CAAC2C,SAAS,CAAC,CAC3B3C,SAAS,CAACiD,OAAO,CAACjD,SAAS,CAAC0C,MAAM,CAAC,EACnC1C,SAAS,CAACiD,OAAO,CAACjD,SAAS,CAAC6C,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CACvC,CAAC,CAACK;AACL,CAAC;AAED9C,MAAM,CAAC+C,YAAY,GAAG;EACpBrB,SAAS,EAAEsB,SAAS;EACpBrB,QAAQ,EAAEqB;AACZ,CAAC;AAED,IAAMC,WAAW,GAAGpD,OAAO,CAACC,mBAAmB,CAACE,MAAM,EAAE,aAAa,EAAE;EACrE0B,SAAS,EAAE;IACTwB,QAAQ,EAAEnD,SAAS,CAACoD,MAAM;IAC1BC,MAAM,EAAE,SAAAA,OAAA1C,KAAK;MAAA,OAAI,OAAOA,KAAK,KAAK,QAAQ;IAAA;IAC1C2C,SAAS,EAAE,SAAAA,UAAA3C,KAAK;MAAA,OAAK4C,KAAK,CAACC,OAAO,CAAC7C,KAAK,CAAC,GAAGA,KAAK,CAAC8C,IAAI,CAAC,GAAG,CAAC,GAAG9C,KAAK;IAAA,CAAC;IACpE+C,OAAO,EAAE;EACX;AACF,CAAC,CAAC,CAAC;AAEH,eAAeR,WAAW"}
|
package/dist/InputText/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["className", "inputRef", "type"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -7,11 +7,9 @@ import PropTypes from 'prop-types';
|
|
|
7
7
|
import asInput from '../asInput';
|
|
8
8
|
import withDeprecatedProps, { DeprTypes } from '../withDeprecatedProps';
|
|
9
9
|
function Text(props) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
type
|
|
14
|
-
} = props,
|
|
10
|
+
var className = props.className,
|
|
11
|
+
inputRef = props.inputRef,
|
|
12
|
+
type = props.type,
|
|
15
13
|
others = _objectWithoutProperties(props, _excluded);
|
|
16
14
|
return /*#__PURE__*/React.createElement("input", _extends({}, others, {
|
|
17
15
|
className: className,
|
|
@@ -31,11 +29,15 @@ Text.defaultProps = {
|
|
|
31
29
|
inputRef: undefined,
|
|
32
30
|
type: 'text'
|
|
33
31
|
};
|
|
34
|
-
|
|
32
|
+
var InputText = asInput(withDeprecatedProps(Text, 'InputText', {
|
|
35
33
|
className: {
|
|
36
34
|
deprType: DeprTypes.FORMAT,
|
|
37
|
-
expect:
|
|
38
|
-
|
|
35
|
+
expect: function expect(value) {
|
|
36
|
+
return typeof value === 'string';
|
|
37
|
+
},
|
|
38
|
+
transform: function transform(value) {
|
|
39
|
+
return Array.isArray(value) ? value.join(' ') : value;
|
|
40
|
+
},
|
|
39
41
|
message: 'It should be a string.'
|
|
40
42
|
}
|
|
41
43
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","asInput","withDeprecatedProps","DeprTypes","Text","props","className","inputRef","type","others","_objectWithoutProperties","_excluded","createElement","_extends","ref","propTypes","string","oneOfType","func","shape","current","instanceOf","element","defaultProps","undefined","InputText","deprType","FORMAT","expect","value","transform","Array","isArray","join","message"],"sources":["../../src/InputText/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport asInput from '../asInput';\nimport withDeprecatedProps, { DeprTypes } from '../withDeprecatedProps';\n\nfunction Text(props) {\n const {\n className,\n inputRef,\n type,\n ...others\n } = props;\n\n return (\n <input\n {...others}\n className={className}\n type={type || 'text'}\n ref={inputRef}\n />\n );\n}\n\nText.propTypes = {\n className: PropTypes.string,\n inputRef: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({ current: PropTypes.instanceOf(PropTypes.element) }),\n ]),\n type: PropTypes.string,\n};\n\nText.defaultProps = {\n className: undefined,\n inputRef: undefined,\n type: 'text',\n};\n\nconst InputText = asInput(withDeprecatedProps(Text, 'InputText', {\n className: {\n deprType: DeprTypes.FORMAT,\n expect: value => typeof value === 'string',\n transform: value => (Array.isArray(value) ? value.join(' ') : value),\n message: 'It should be a string.',\n },\n}));\n\nexport default InputText;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,OAAO,MAAM,YAAY;AAChC,OAAOC,mBAAmB,IAAIC,SAAS,QAAQ,wBAAwB;AAEvE,SAASC,IAAIA,CAACC,KAAK,EAAE;EACnB,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","asInput","withDeprecatedProps","DeprTypes","Text","props","className","inputRef","type","others","_objectWithoutProperties","_excluded","createElement","_extends","ref","propTypes","string","oneOfType","func","shape","current","instanceOf","element","defaultProps","undefined","InputText","deprType","FORMAT","expect","value","transform","Array","isArray","join","message"],"sources":["../../src/InputText/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport asInput from '../asInput';\nimport withDeprecatedProps, { DeprTypes } from '../withDeprecatedProps';\n\nfunction Text(props) {\n const {\n className,\n inputRef,\n type,\n ...others\n } = props;\n\n return (\n <input\n {...others}\n className={className}\n type={type || 'text'}\n ref={inputRef}\n />\n );\n}\n\nText.propTypes = {\n className: PropTypes.string,\n inputRef: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({ current: PropTypes.instanceOf(PropTypes.element) }),\n ]),\n type: PropTypes.string,\n};\n\nText.defaultProps = {\n className: undefined,\n inputRef: undefined,\n type: 'text',\n};\n\nconst InputText = asInput(withDeprecatedProps(Text, 'InputText', {\n className: {\n deprType: DeprTypes.FORMAT,\n expect: value => typeof value === 'string',\n transform: value => (Array.isArray(value) ? value.join(' ') : value),\n message: 'It should be a string.',\n },\n}));\n\nexport default InputText;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,OAAO,MAAM,YAAY;AAChC,OAAOC,mBAAmB,IAAIC,SAAS,QAAQ,wBAAwB;AAEvE,SAASC,IAAIA,CAACC,KAAK,EAAE;EACnB,IACEC,SAAS,GAIPD,KAAK,CAJPC,SAAS;IACTC,QAAQ,GAGNF,KAAK,CAHPE,QAAQ;IACRC,IAAI,GAEFH,KAAK,CAFPG,IAAI;IACDC,MAAM,GAAAC,wBAAA,CACPL,KAAK,EAAAM,SAAA;EAET,oBACEZ,KAAA,CAAAa,aAAA,UAAAC,QAAA,KACMJ,MAAM;IACVH,SAAS,EAAEA,SAAU;IACrBE,IAAI,EAAEA,IAAI,IAAI,MAAO;IACrBM,GAAG,EAAEP;EAAS,EACf,CAAC;AAEN;AAEAH,IAAI,CAACW,SAAS,GAAG;EACfT,SAAS,EAAEN,SAAS,CAACgB,MAAM;EAC3BT,QAAQ,EAAEP,SAAS,CAACiB,SAAS,CAAC,CAC5BjB,SAAS,CAACkB,IAAI,EACdlB,SAAS,CAACmB,KAAK,CAAC;IAAEC,OAAO,EAAEpB,SAAS,CAACqB,UAAU,CAACrB,SAAS,CAACsB,OAAO;EAAE,CAAC,CAAC,CACtE,CAAC;EACFd,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