@pedidopago/ui 1.6.9 → 1.6.11
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/@types/index.d.ts +1 -1
- package/dist/@types/index.d.ts.map +1 -1
- package/dist/components/Alert/alert.test.js +4 -11
- package/dist/components/Alert/index.js +9 -16
- package/dist/components/Alert/styles.js +0 -16
- package/dist/components/Alert/types.d.ts +2 -2
- package/dist/components/Alert/types.d.ts.map +1 -1
- package/dist/components/Avatar/avatar.test.js +4 -11
- package/dist/components/Avatar/index.js +15 -38
- package/dist/components/Avatar/styles.js +0 -16
- package/dist/components/Avatar/types.d.ts +2 -2
- package/dist/components/Avatar/types.d.ts.map +1 -1
- package/dist/components/Badge/badge.test.js +5 -16
- package/dist/components/Badge/index.js +5 -9
- package/dist/components/Badge/styles.js +1 -11
- package/dist/components/Badge/types.d.ts +3 -3
- package/dist/components/Badge/types.d.ts.map +1 -1
- package/dist/components/Button/Button.test.js +14 -32
- package/dist/components/Button/index.js +21 -37
- package/dist/components/Button/styles.js +6 -35
- package/dist/components/Button/types.d.ts +4 -4
- package/dist/components/Button/types.d.ts.map +1 -1
- package/dist/components/Card/card.test.js +8 -15
- package/dist/components/Card/index.js +15 -24
- package/dist/components/Card/styles.js +0 -8
- package/dist/components/Card/types.d.ts +2 -2
- package/dist/components/Card/types.d.ts.map +1 -1
- package/dist/components/CheckboxInput/checkbox-input.test.js +65 -89
- package/dist/components/CheckboxInput/components/MultipleCheckbox.js +27 -58
- package/dist/components/CheckboxInput/index.js +20 -41
- package/dist/components/CheckboxInput/styles.js +9 -33
- package/dist/components/CheckboxInput/types.d.ts +1 -1
- package/dist/components/CheckboxInput/types.d.ts.map +1 -1
- package/dist/components/CollapseCard/ExpandButton/index.js +3 -11
- package/dist/components/CollapseCard/ExpandButton/styles.d.ts +4 -2
- package/dist/components/CollapseCard/ExpandButton/styles.d.ts.map +1 -1
- package/dist/components/CollapseCard/ExpandButton/styles.js +0 -6
- package/dist/components/CollapseCard/expand-button.test.js +71 -110
- package/dist/components/CollapseCard/index.js +23 -44
- package/dist/components/CollapseCard/styles.d.ts +4 -1
- package/dist/components/CollapseCard/styles.d.ts.map +1 -1
- package/dist/components/CollapseCard/styles.js +0 -9
- package/dist/components/ColorPicker/colorpicker.test.js +6 -16
- package/dist/components/ColorPicker/components/ColorHue.js +1 -12
- package/dist/components/ColorPicker/components/ColorInput.js +10 -31
- package/dist/components/ColorPicker/components/ColorPickerBox.js +5 -17
- package/dist/components/ColorPicker/components/ColorPointer.js +3 -8
- package/dist/components/ColorPicker/components/ColorSelector.js +45 -77
- package/dist/components/ColorPicker/hooks/useCachedCallback.js +0 -3
- package/dist/components/ColorPicker/hooks/useHsva.js +7 -20
- package/dist/components/ColorPicker/index.js +18 -41
- package/dist/components/ColorPicker/styles.js +0 -24
- package/dist/components/ColorPicker/types.d.ts +11 -11
- package/dist/components/ColorPicker/types.d.ts.map +1 -1
- package/dist/components/ColorPicker/utils/checkers.js +0 -19
- package/dist/components/ColorPicker/utils/conversors.js +41 -88
- package/dist/components/ColorPicker/utils/parsers.js +11 -40
- package/dist/components/DateInput/DateInput-example.js +14 -23
- package/dist/components/DateInput/components/ModalWrapper/index.js +8 -12
- package/dist/components/DateInput/components/ModalWrapper/styles.d.ts +4 -1
- package/dist/components/DateInput/components/ModalWrapper/styles.d.ts.map +1 -1
- package/dist/components/DateInput/components/ModalWrapper/styles.js +1 -12
- package/dist/components/DateInput/dateInput.test.js +17 -26
- package/dist/components/DateInput/index.js +32 -54
- package/dist/components/DateInput/styles.js +0 -9
- package/dist/components/DateInput/types.d.ts +1 -1
- package/dist/components/DateInput/types.d.ts.map +1 -1
- package/dist/components/DatePicker/components/DatePickerContent.d.ts +1 -1
- package/dist/components/DatePicker/components/DatePickerContent.d.ts.map +1 -1
- package/dist/components/DatePicker/components/DatePickerContent.js +19 -43
- package/dist/components/DatePicker/components/DateYearPicker.js +11 -31
- package/dist/components/DatePicker/datepicker.test.js +44 -62
- package/dist/components/DatePicker/index.d.ts +1 -1
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/DatePicker/index.js +74 -118
- package/dist/components/DatePicker/styles.js +2 -35
- package/dist/components/DatePicker/types.d.ts +4 -4
- package/dist/components/DatePicker/types.d.ts.map +1 -1
- package/dist/components/DatePicker/utils/getMonthName.js +0 -2
- package/dist/components/Dialog/dialog-example.js +9 -22
- package/dist/components/Dialog/dialog.test.js +32 -45
- package/dist/components/Dialog/index.js +14 -22
- package/dist/components/Dialog/styles.js +0 -13
- package/dist/components/Dropzone/dropzone.test.js +35 -45
- package/dist/components/Dropzone/index.js +29 -68
- package/dist/components/Dropzone/styles.js +8 -32
- package/dist/components/Dropzone/types.d.ts +4 -4
- package/dist/components/Dropzone/types.d.ts.map +1 -1
- package/dist/components/Dropzone/utils/accepts.js +0 -5
- package/dist/components/Flex/flex.test.js +267 -286
- package/dist/components/Flex/index.js +16 -24
- package/dist/components/Flex/styles.js +0 -11
- package/dist/components/Flex/types.d.ts +13 -13
- package/dist/components/Flex/types.d.ts.map +1 -1
- package/dist/components/Grid/grid.test.js +0 -6
- package/dist/components/Grid/index.js +17 -25
- package/dist/components/Grid/styles.js +1 -9
- package/dist/components/Grid/types.d.ts +2 -2
- package/dist/components/Grid/types.d.ts.map +1 -1
- package/dist/components/Icon/data/beauty.js +1 -0
- package/dist/components/Icon/data/ecommerce.js +1 -0
- package/dist/components/Icon/data/form.js +1 -0
- package/dist/components/Icon/data/health.js +1 -0
- package/dist/components/Icon/data/illustrations.js +1 -0
- package/dist/components/Icon/data/men.js +1 -0
- package/dist/components/Icon/data/payment.js +1 -0
- package/dist/components/Icon/data/pedidoPago.js +1 -0
- package/dist/components/Icon/data/physicalPerfomance.js +1 -0
- package/dist/components/Icon/data/social.js +1 -0
- package/dist/components/Icon/data/status.js +1 -0
- package/dist/components/Icon/data/summer.js +1 -0
- package/dist/components/Icon/data/woman.js +1 -0
- package/dist/components/Icon/icon.test.js +19 -32
- package/dist/components/Icon/index.js +14 -28
- package/dist/components/Icon/scripts/build.js +14 -51
- package/dist/components/Icon/scripts/extractor.js +0 -6
- package/dist/components/Icon/scripts/run-build.js +0 -2
- package/dist/components/Icon/scripts/writers.d.ts +1 -1
- package/dist/components/Icon/scripts/writers.d.ts.map +1 -1
- package/dist/components/Icon/scripts/writers.js +1 -12
- package/dist/components/Icon/styles.d.ts +1 -1
- package/dist/components/Icon/styles.d.ts.map +1 -1
- package/dist/components/Icon/styles.js +3 -11
- package/dist/components/Icon/types.d.ts +2 -2
- package/dist/components/Icon/types.d.ts.map +1 -1
- package/dist/components/Icon/utils/allIcons.js +1 -22
- package/dist/components/Icon/utils/iconExists.d.ts +1 -1
- package/dist/components/Icon/utils/iconExists.d.ts.map +1 -1
- package/dist/components/Icon/utils/iconExists.js +0 -3
- package/dist/components/IconItem/IconItem.test.js +27 -37
- package/dist/components/IconItem/index.js +5 -12
- package/dist/components/IconItem/styles.js +2 -16
- package/dist/components/IconItem/types.d.ts +3 -3
- package/dist/components/IconItem/types.d.ts.map +1 -1
- package/dist/components/Illustration/AlternativeOrderSvg/index.js +0 -2
- package/dist/components/Illustration/BoletoSvg/index.js +0 -2
- package/dist/components/Illustration/BoxClosedSvg/index.js +0 -2
- package/dist/components/Illustration/BoxDeliverySvg/index.js +0 -2
- package/dist/components/Illustration/BoxOpenSvg/index.js +0 -2
- package/dist/components/Illustration/CalendarSvg/index.js +0 -2
- package/dist/components/Illustration/CardSvg/index.js +0 -2
- package/dist/components/Illustration/CollaboratorSvg/index.js +0 -2
- package/dist/components/Illustration/InquirySvg/index.js +0 -2
- package/dist/components/Illustration/OrderSvg/index.js +0 -2
- package/dist/components/Illustration/PixSvg/index.js +0 -2
- package/dist/components/Illustration/PrescriptionSvg/index.js +0 -2
- package/dist/components/Illustration/TransportSvg/index.js +0 -2
- package/dist/components/Illustration/illustration.test.js +20 -31
- package/dist/components/Illustration/index.js +11 -43
- package/dist/components/Illustration/styles.js +0 -14
- package/dist/components/ImageItem/imageFake.js +0 -2
- package/dist/components/ImageItem/index.js +18 -25
- package/dist/components/ImageItem/input.test.js +31 -51
- package/dist/components/ImageItem/styles.js +2 -22
- package/dist/components/ImageItem/types.d.ts +2 -2
- package/dist/components/ImageItem/types.d.ts.map +1 -1
- package/dist/components/Input/index.js +25 -47
- package/dist/components/Input/input.test.js +49 -73
- package/dist/components/Input/styles.js +12 -65
- package/dist/components/Input/types.d.ts +1 -1
- package/dist/components/Input/types.d.ts.map +1 -1
- package/dist/components/Label/index.js +9 -19
- package/dist/components/Label/label.test.js +32 -58
- package/dist/components/Label/styles.js +0 -6
- package/dist/components/Label/types.d.ts +2 -2
- package/dist/components/Label/types.d.ts.map +1 -1
- package/dist/components/List/index.js +9 -17
- package/dist/components/List/list.test.js +4 -11
- package/dist/components/List/styles.js +0 -11
- package/dist/components/Modal/ModalExample.js +9 -27
- package/dist/components/Modal/index.js +23 -47
- package/dist/components/Modal/modal.test.js +15 -33
- package/dist/components/Modal/styles.d.ts +8 -2
- package/dist/components/Modal/styles.d.ts.map +1 -1
- package/dist/components/Modal/styles.js +3 -16
- package/dist/components/Modal/types.d.ts +2 -2
- package/dist/components/Modal/types.d.ts.map +1 -1
- package/dist/components/MultipleSelect/MultipleSelect.test.js +106 -223
- package/dist/components/MultipleSelect/components/InputWrapper/index.js +1 -11
- package/dist/components/MultipleSelect/components/InputWrapper/types.d.ts +1 -1
- package/dist/components/MultipleSelect/components/InputWrapper/types.d.ts.map +1 -1
- package/dist/components/MultipleSelect/components/OptionsArea/index.js +36 -70
- package/dist/components/MultipleSelect/components/OptionsArea/styles.d.ts +4 -1
- package/dist/components/MultipleSelect/components/OptionsArea/styles.d.ts.map +1 -1
- package/dist/components/MultipleSelect/components/OptionsArea/styles.js +6 -19
- package/dist/components/MultipleSelect/components/SelectArea/ButtonsArea.js +0 -9
- package/dist/components/MultipleSelect/components/SelectArea/SelectAreaWrapper.js +2 -12
- package/dist/components/MultipleSelect/components/SelectArea/SelectedOptionsArea.js +0 -15
- package/dist/components/MultipleSelect/components/SelectArea/index.js +10 -20
- package/dist/components/MultipleSelect/components/SelectArea/styles.js +1 -12
- package/dist/components/MultipleSelect/components/SelectArea/types.d.ts +1 -1
- package/dist/components/MultipleSelect/components/SelectArea/types.d.ts.map +1 -1
- package/dist/components/MultipleSelect/components/index.js +0 -6
- package/dist/components/MultipleSelect/index.d.ts +1 -1
- package/dist/components/MultipleSelect/index.d.ts.map +1 -1
- package/dist/components/MultipleSelect/index.js +51 -94
- package/dist/components/MultipleSelect/types.d.ts +2 -2
- package/dist/components/MultipleSelect/types.d.ts.map +1 -1
- package/dist/components/Observer/index.js +10 -25
- package/dist/components/Observer/observer.test.js +0 -4
- package/dist/components/Observer/types.d.ts +1 -1
- package/dist/components/Observer/types.d.ts.map +1 -1
- package/dist/components/Pagination/hooks/usePagination.js +2 -18
- package/dist/components/Pagination/index.d.ts.map +1 -1
- package/dist/components/Pagination/index.js +53 -86
- package/dist/components/Pagination/pagination.test.js +16 -50
- package/dist/components/Pagination/styles.js +23 -45
- package/dist/components/Progress/Circle/index.js +15 -31
- package/dist/components/Progress/Circle/styles.js +1 -15
- package/dist/components/Progress/Circle/types.d.ts +1 -1
- package/dist/components/Progress/Circle/types.d.ts.map +1 -1
- package/dist/components/Progress/Linear/index.js +12 -30
- package/dist/components/Progress/Linear/styles.js +1 -14
- package/dist/components/Progress/Linear/types.d.ts +3 -3
- package/dist/components/Progress/Linear/types.d.ts.map +1 -1
- package/dist/components/Progress/getSteps.js +0 -3
- package/dist/components/Progress/index.js +10 -19
- package/dist/components/Progress/progress.test.js +47 -64
- package/dist/components/Progress/types.d.ts +2 -2
- package/dist/components/Progress/types.d.ts.map +1 -1
- package/dist/components/RadioInput/components/ChoiceList/index.js +14 -27
- package/dist/components/RadioInput/index.js +15 -26
- package/dist/components/RadioInput/radio-input.test.js +44 -68
- package/dist/components/RadioInput/styles.js +2 -21
- package/dist/components/RadioInput/types.d.ts +4 -4
- package/dist/components/RadioInput/types.d.ts.map +1 -1
- package/dist/components/RadioInput/utils/get-colors-props.js +0 -1
- package/dist/components/Rating/index.js +35 -66
- package/dist/components/Rating/rating.test.js +0 -16
- package/dist/components/Rating/styles.js +1 -12
- package/dist/components/ReactPortal/index.js +7 -22
- package/dist/components/ReactPortal/reactPortal.test.js +0 -5
- package/dist/components/ReactPortal/utils/createWrapperAndApprendToBody.js +0 -1
- package/dist/components/Select/components/OptionsSelect/index.js +25 -45
- package/dist/components/Select/components/OptionsSelect/styles.d.ts +4 -1
- package/dist/components/Select/components/OptionsSelect/styles.d.ts.map +1 -1
- package/dist/components/Select/components/OptionsSelect/styles.js +1 -12
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +37 -74
- package/dist/components/Select/select.test.js +13 -22
- package/dist/components/Select/styles.js +0 -12
- package/dist/components/Select/types.d.ts +2 -2
- package/dist/components/Select/types.d.ts.map +1 -1
- package/dist/components/Skeleton/index.js +6 -14
- package/dist/components/Skeleton/skeleton.test.js +35 -51
- package/dist/components/Skeleton/styles.js +0 -10
- package/dist/components/Skeleton/types.d.ts +1 -1
- package/dist/components/Skeleton/types.d.ts.map +1 -1
- package/dist/components/Slider/SliderExample.js +11 -25
- package/dist/components/Slider/components/SliderPointer.js +1 -7
- package/dist/components/Slider/components/SliderRail.js +49 -81
- package/dist/components/Slider/components/SliderSelector.js +22 -45
- package/dist/components/Slider/hooks/useEventCallback.js +0 -3
- package/dist/components/Slider/index.js +26 -62
- package/dist/components/Slider/slider.test.js +52 -65
- package/dist/components/Slider/styles.js +0 -25
- package/dist/components/Slider/types.d.ts +5 -5
- package/dist/components/Slider/types.d.ts.map +1 -1
- package/dist/components/Spinner/index.js +6 -10
- package/dist/components/Spinner/spinner.test.js +14 -24
- package/dist/components/Spinner/styles.js +5 -10
- package/dist/components/Spinner/types.d.ts +2 -2
- package/dist/components/Spinner/types.d.ts.map +1 -1
- package/dist/components/Steps/components/StepIcon/index.js +5 -14
- package/dist/components/Steps/components/StepIconMobile/index.js +5 -14
- package/dist/components/Steps/index.js +12 -37
- package/dist/components/Steps/steps.test.js +23 -33
- package/dist/components/Steps/styles.js +4 -27
- package/dist/components/Steps/types.d.ts +1 -1
- package/dist/components/Steps/types.d.ts.map +1 -1
- package/dist/components/Switch/index.d.ts.map +1 -1
- package/dist/components/Switch/index.js +22 -39
- package/dist/components/Switch/styles.js +4 -21
- package/dist/components/Switch/switch.test.js +41 -179
- package/dist/components/Switch/types.d.ts +2 -2
- package/dist/components/Switch/types.d.ts.map +1 -1
- package/dist/components/Table/components/MenuItem.js +5 -11
- package/dist/components/Table/components/TableSkeleton.js +3 -9
- package/dist/components/Table/index.js +38 -71
- package/dist/components/Table/styles.js +0 -19
- package/dist/components/Table/table.test.js +68 -84
- package/dist/components/Table/types.d.ts +3 -3
- package/dist/components/Table/types.d.ts.map +1 -1
- package/dist/components/Tabs/TabsExample.js +11 -24
- package/dist/components/Tabs/components/Tab.js +12 -20
- package/dist/components/Tabs/components/TabPanel.js +3 -7
- package/dist/components/Tabs/components/Tabs.js +25 -49
- package/dist/components/Tabs/index.js +0 -3
- package/dist/components/Tabs/styles.js +9 -29
- package/dist/components/Tabs/tabs.test.js +104 -117
- package/dist/components/Tabs/types.d.ts +7 -7
- package/dist/components/Tabs/types.d.ts.map +1 -1
- package/dist/components/Tag/index.js +6 -13
- package/dist/components/Tag/styles.js +7 -18
- package/dist/components/Tag/tag.test.js +3 -17
- package/dist/components/TextAreaInput/index.js +16 -35
- package/dist/components/TextAreaInput/styles.js +10 -23
- package/dist/components/TextAreaInput/text-area-input.test.js +21 -36
- package/dist/components/TextAreaInput/types.d.ts +3 -3
- package/dist/components/TextAreaInput/types.d.ts.map +1 -1
- package/dist/components/Thumbnail/index.js +31 -60
- package/dist/components/Thumbnail/styles.js +9 -26
- package/dist/components/Thumbnail/thumbnail.test.js +13 -29
- package/dist/components/Thumbnail/types.d.ts +1 -1
- package/dist/components/Thumbnail/types.d.ts.map +1 -1
- package/dist/components/Thumbnail/utils/index.js +0 -4
- package/dist/components/Thumbnail/utils/validate-file-size.js +0 -1
- package/dist/components/Thumbnail/utils/validate-file-type.js +0 -1
- package/dist/components/Timeline/components/Timeline.js +3 -8
- package/dist/components/Timeline/components/TimelineContent.js +7 -18
- package/dist/components/Timeline/components/TimelineItem.js +5 -13
- package/dist/components/Timeline/components/TimelineSeparator.js +1 -5
- package/dist/components/Timeline/index.js +0 -4
- package/dist/components/Timeline/styles.js +0 -17
- package/dist/components/Timeline/timeline.test.js +103 -115
- package/dist/components/Timeline/types.d.ts +4 -4
- package/dist/components/Timeline/types.d.ts.map +1 -1
- package/dist/components/Toast/button-example.js +1 -14
- package/dist/components/Toast/components/Toast.js +12 -21
- package/dist/components/Toast/contexts/ToastProvider.js +9 -31
- package/dist/components/Toast/hooks/useToast.js +1 -7
- package/dist/components/Toast/index.js +6 -17
- package/dist/components/Toast/styles.js +0 -12
- package/dist/components/Toast/toast.test.js +4 -14
- package/dist/components/Toast/types.d.ts +5 -5
- package/dist/components/Toast/types.d.ts.map +1 -1
- package/dist/components/Tooltip/components/TooltipLabel.js +12 -23
- package/dist/components/Tooltip/example.js +0 -4
- package/dist/components/Tooltip/index.js +29 -66
- package/dist/components/Tooltip/styles.js +0 -10
- package/dist/components/Tooltip/types.d.ts +3 -3
- package/dist/components/Tooltip/types.d.ts.map +1 -1
- package/dist/components/Typography/index.js +9 -21
- package/dist/components/Typography/styles.js +0 -7
- package/dist/components/Typography/types.d.ts +1 -1
- package/dist/components/Typography/types.d.ts.map +1 -1
- package/dist/components/Typography/typography.test.js +134 -171
- package/dist/index.js +0 -61
- package/dist/shared/components/FocusLock/index.js +17 -30
- package/dist/shared/formatters/format-number.js +4 -10
- package/dist/shared/hooks/devices.d.ts +1 -1
- package/dist/shared/hooks/devices.d.ts.map +1 -1
- package/dist/shared/hooks/useBreakpoints.d.ts +3 -3
- package/dist/shared/hooks/useBreakpoints.d.ts.map +1 -1
- package/dist/shared/hooks/useBreakpoints.js +5 -34
- package/dist/shared/hooks/useDebounce.js +1 -12
- package/dist/shared/hooks/useDevices.js +6 -20
- package/dist/shared/hooks/useDisableBodyScroll.js +6 -15
- package/dist/shared/hooks/useKeyPress.js +0 -3
- package/dist/shared/hooks/useObserver.js +1 -5
- package/dist/shared/hooks/useOnClickOutside.js +0 -7
- package/dist/shared/hooks/useWindowSize.d.ts +1 -1
- package/dist/shared/hooks/useWindowSize.d.ts.map +1 -1
- package/dist/shared/hooks/useWindowSize.js +8 -18
- package/dist/shared/tests/test-utils.js +5 -13
- package/dist/shared/tests/types.d.ts +1 -1
- package/dist/shared/tests/types.d.ts.map +1 -1
- package/dist/shared/theme/button-example.js +2 -12
- package/dist/shared/theme/contexts/ThemeContext.d.ts +2 -2
- package/dist/shared/theme/contexts/ThemeContext.d.ts.map +1 -1
- package/dist/shared/theme/contexts/ThemeContext.js +14 -37
- package/dist/shared/theme/hooks/useColorMode.js +2 -7
- package/dist/shared/theme/hooks/useColorModeValue.js +1 -5
- package/dist/shared/theme/hooks/useTheme.js +1 -7
- package/dist/shared/theme/index.js +0 -8
- package/dist/shared/theme/theme.js +5 -9
- package/dist/shared/theme/theme.test.js +35 -61
- package/dist/shared/theme/theme.types.d.ts +5 -5
- package/dist/shared/theme/theme.types.d.ts.map +1 -1
- package/dist/shared/theme/utils/extendTheme.js +0 -4
- package/dist/shared/types/credit-card.d.ts +1 -1
- package/dist/shared/types/credit-card.d.ts.map +1 -1
- package/dist/shared/types/file.d.ts +2 -2
- package/dist/shared/types/file.d.ts.map +1 -1
- package/dist/shared/types/name.d.ts +1 -1
- package/dist/shared/types/name.d.ts.map +1 -1
- package/dist/utils/GenerateKey.js +1 -3
- package/dist/utils/brightnessColorChange.js +0 -1
- package/dist/utils/colorCheck.d.ts +1 -1
- package/dist/utils/colorCheck.d.ts.map +1 -1
- package/dist/utils/colorCheck.js +9 -29
- package/dist/utils/colorFunctions.js +0 -6
- package/dist/utils/colorToGray.js +5 -22
- package/dist/utils/file.d.ts.map +1 -1
- package/dist/utils/file.js +56 -83
- package/dist/utils/formatters/bytes.js +0 -1
- package/dist/utils/formatters/capitalize.js +0 -1
- package/dist/utils/formatters/cep.js +1 -3
- package/dist/utils/formatters/cnpj.js +2 -9
- package/dist/utils/formatters/color.js +19 -20
- package/dist/utils/formatters/cpf.js +18 -25
- package/dist/utils/formatters/credit-card.js +6 -19
- package/dist/utils/formatters/index.js +0 -30
- package/dist/utils/formatters/name.js +1 -6
- package/dist/utils/formatters/number.js +0 -1
- package/dist/utils/formatters/passport.js +3 -7
- package/dist/utils/formatters/phone.js +17 -45
- package/dist/utils/formatters/price.js +1 -3
- package/dist/utils/formatters/rg.js +1 -3
- package/dist/utils/formatters/strings.js +0 -5
- package/dist/utils/fuctionsColors.js +0 -6
- package/dist/utils/generateUUID.js +0 -1
- package/dist/utils/getColorValue.js +0 -5
- package/dist/utils/getSvg.d.ts +1 -1
- package/dist/utils/getSvg.d.ts.map +1 -1
- package/dist/utils/getSvg.js +0 -3
- package/dist/utils/getValuesBySize.d.ts +2 -2
- package/dist/utils/getValuesBySize.d.ts.map +1 -1
- package/dist/utils/getValuesBySize.js +0 -1
- package/dist/utils/invertColor.js +7 -15
- package/package.json +18 -18
|
@@ -1,106 +1,78 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
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); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.Table = Table;
|
|
7
|
-
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
|
|
10
9
|
var _CheckboxInput = _interopRequireDefault(require("../CheckboxInput"));
|
|
11
|
-
|
|
12
10
|
var _Typography = _interopRequireDefault(require("../Typography"));
|
|
13
|
-
|
|
14
11
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
15
|
-
|
|
16
12
|
var _MenuItem = require("./components/MenuItem");
|
|
17
|
-
|
|
18
13
|
var _FocusLock = _interopRequireDefault(require("../../shared/components/FocusLock"));
|
|
19
|
-
|
|
20
14
|
var _TableSkeleton = require("./components/TableSkeleton");
|
|
21
|
-
|
|
22
15
|
var _styles = require("./styles");
|
|
23
|
-
|
|
24
16
|
var _useColorMode2 = require("../../shared/theme/hooks/useColorMode");
|
|
25
|
-
|
|
26
17
|
var _GenerateKey = require("../../utils/GenerateKey");
|
|
27
|
-
|
|
28
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
var _excluded = ["selectable", "primaryActions", "secondaryActions", "header", "rows", "isLoading", "skeletonRows", "skeletonHeight"]; // Components
|
|
20
|
+
// Styles
|
|
21
|
+
// Hooks
|
|
22
|
+
// Types
|
|
23
|
+
// Utils
|
|
32
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
|
-
|
|
34
25
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
35
|
-
|
|
36
26
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
37
|
-
|
|
38
27
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
39
|
-
|
|
40
28
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
41
|
-
|
|
42
29
|
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; }
|
|
43
|
-
|
|
44
30
|
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; }
|
|
45
|
-
|
|
46
|
-
function
|
|
47
|
-
|
|
31
|
+
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; }
|
|
32
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
33
|
+
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); }
|
|
48
34
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
49
|
-
|
|
50
35
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
51
|
-
|
|
52
36
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
53
|
-
|
|
54
|
-
function
|
|
55
|
-
|
|
56
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
57
|
-
|
|
37
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
38
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
58
39
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
59
|
-
|
|
60
40
|
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; }
|
|
61
|
-
|
|
62
41
|
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; }
|
|
63
|
-
|
|
64
42
|
function Table(_ref) {
|
|
65
43
|
var selectable = _ref.selectable,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
44
|
+
primaryActions = _ref.primaryActions,
|
|
45
|
+
secondaryActions = _ref.secondaryActions,
|
|
46
|
+
header = _ref.header,
|
|
47
|
+
rows = _ref.rows,
|
|
48
|
+
_ref$isLoading = _ref.isLoading,
|
|
49
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
50
|
+
_ref$skeletonRows = _ref.skeletonRows,
|
|
51
|
+
skeletonRows = _ref$skeletonRows === void 0 ? 5 : _ref$skeletonRows,
|
|
52
|
+
_ref$skeletonHeight = _ref.skeletonHeight,
|
|
53
|
+
skeletonHeight = _ref$skeletonHeight === void 0 ? '16px' : _ref$skeletonHeight,
|
|
54
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
78
55
|
var _useState = (0, _react.useState)([]),
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
56
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
57
|
+
selectedRows = _useState2[0],
|
|
58
|
+
setSelectedRows = _useState2[1];
|
|
83
59
|
var _useState3 = (0, _react.useState)(false),
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
60
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
61
|
+
allSelected = _useState4[0],
|
|
62
|
+
setAllSelected = _useState4[1];
|
|
88
63
|
var _useState5 = (0, _react.useState)({
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
64
|
+
state: false,
|
|
65
|
+
rowId: ''
|
|
66
|
+
}),
|
|
67
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
68
|
+
isMenuOpen = _useState6[0],
|
|
69
|
+
setIsMenuOpen = _useState6[1];
|
|
96
70
|
var _useState7 = (0, _react.useState)(false),
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
71
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
72
|
+
openSelectDropDownMenu = _useState8[0],
|
|
73
|
+
setOpenSelectDropDownMenu = _useState8[1];
|
|
101
74
|
var _useColorMode = (0, _useColorMode2.useColorMode)(),
|
|
102
|
-
|
|
103
|
-
|
|
75
|
+
colorMode = _useColorMode.colorMode;
|
|
104
76
|
var rowsWithKey = (0, _react.useMemo)(function () {
|
|
105
77
|
return rows.map(function (row) {
|
|
106
78
|
return _objectSpread({
|
|
@@ -116,7 +88,6 @@ function Table(_ref) {
|
|
|
116
88
|
return i === rowKey;
|
|
117
89
|
});
|
|
118
90
|
var selectedList = [];
|
|
119
|
-
|
|
120
91
|
if (checked) {
|
|
121
92
|
if (selectedRowArrayIndex < 0) {
|
|
122
93
|
selectedList = [].concat(_toConsumableArray(selectedRows), [rowKey]);
|
|
@@ -125,27 +96,23 @@ function Table(_ref) {
|
|
|
125
96
|
} else {
|
|
126
97
|
if (selectedRowArrayIndex >= 0) {
|
|
127
98
|
var updatedArray = _toConsumableArray(selectedRows);
|
|
128
|
-
|
|
129
99
|
updatedArray.splice(selectedRowArrayIndex, 1);
|
|
130
100
|
selectedList = updatedArray;
|
|
131
101
|
setSelectedRows(updatedArray);
|
|
132
102
|
}
|
|
133
103
|
}
|
|
134
|
-
|
|
135
104
|
if (selectedList.length === rows.length) {
|
|
136
105
|
setAllSelected(true);
|
|
137
106
|
} else {
|
|
138
107
|
setAllSelected(false);
|
|
139
108
|
}
|
|
140
109
|
}, [selectedRows, rows]);
|
|
141
|
-
|
|
142
110
|
var toggleSelectAll = function toggleSelectAll() {
|
|
143
111
|
setSelectedRows(allSelected ? [] : rowsWithKey.map(function (row) {
|
|
144
112
|
return row.key;
|
|
145
113
|
}));
|
|
146
114
|
setAllSelected(!allSelected);
|
|
147
115
|
};
|
|
148
|
-
|
|
149
116
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.StyledTable, _objectSpread(_objectSpread({}, rest), {}, {
|
|
150
117
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("thead", {
|
|
151
118
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("tr", {
|
|
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.VerticalPointsButton = exports.StyledTable = exports.SelectedHeader = exports.MenuItemWrapper = exports.MenuItemContent = exports.MenuItemContainer = exports.ActionsButton = void 0;
|
|
7
|
-
|
|
8
7
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
9
|
-
|
|
10
8
|
var _react = require("@emotion/react");
|
|
11
|
-
|
|
12
9
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
11
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
17
|
-
|
|
18
12
|
var StyledTable = _styled.default.table(function (props) {
|
|
19
13
|
var theme = props.theme;
|
|
20
14
|
return (0, _react.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n border-spacing: 0px;\n\n & > thead {\n & > tr {\n height: 64px;\n\n & > th {\n background: ", ";\n border-top: 1px solid\n ", ";\n border-bottom: 1px solid\n ", ";\n padding-left: 16px;\n padding-right: 16px;\n text-align: left;\n\n &:first-of-type {\n border-left: 1px solid\n ", ";\n border-radius: 8px 0px 0px 0px;\n }\n\n &:last-child {\n border-right: 1px solid\n ", ";\n border-radius: 0px 8px 0px 0px;\n }\n }\n }\n }\n\n & > tbody {\n tr {\n height: 64px;\n &:nth-of-type(even) {\n background: ", ";\n }\n &:not(:last-child) {\n & > td {\n border-bottom: 1px solid\n ", ";\n }\n }\n\n &:hover {\n & > td {\n background: ", ";\n\n &:first-of-type {\n border-radius: 4px 0px 0px 4px;\n }\n\n &:last-child {\n border-radius: 0px 4px 4px 0px;\n }\n }\n }\n\n &:focus {\n outline: 2px solid ", ";\n border-radius: 4px;\n }\n\n &[data-selected='true'] {\n & > td {\n background: ", ";\n }\n }\n\n & > td {\n padding-left: 16px;\n padding-right: 16px;\n\n text-align: left;\n\n color: ", ";\n }\n }\n }\n "])), {
|
|
@@ -46,13 +40,9 @@ var StyledTable = _styled.default.table(function (props) {
|
|
|
46
40
|
light: theme.colors.neutral.neutral1
|
|
47
41
|
}[theme.colorMode], theme.colors.neutral.neutral5);
|
|
48
42
|
});
|
|
49
|
-
|
|
50
43
|
exports.StyledTable = StyledTable;
|
|
51
|
-
|
|
52
44
|
var SelectedHeader = _styled.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n"])));
|
|
53
|
-
|
|
54
45
|
exports.SelectedHeader = SelectedHeader;
|
|
55
|
-
|
|
56
46
|
var ActionsButton = _styled.default.button(function (props) {
|
|
57
47
|
var theme = props.theme;
|
|
58
48
|
return (0, _react.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n appearance: none;\n font-family: inherit;\n\n display: flex;\n align-items: center;\n gap: 8px;\n\n margin: 0px -2px 0px 0px;\n outline: none;\n border: 2px solid\n ", ";\n padding: 0px 24px;\n height: 44px;\n\n white-space: nowrap;\n\n color: ", ";\n background: ", ";\n\n transition: background-color linear ", ";\n\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n\n &:first-of-type {\n color: ", ";\n border-radius: 8px 0px 0px 8px;\n }\n\n &:last-of-type {\n border-radius: 0px 8px 8px 0px;\n }\n\n &:only-child {\n border-radius: 8px;\n }\n\n &:hover,\n &:focus {\n z-index: 1;\n\n border-color: ", ";\n background: ", ";\n }\n\n &:active {\n background: ", ";\n }\n "])), {
|
|
@@ -72,21 +62,15 @@ var ActionsButton = _styled.default.button(function (props) {
|
|
|
72
62
|
light: theme.colors.neutral.neutral2
|
|
73
63
|
}[theme.colorMode]);
|
|
74
64
|
});
|
|
75
|
-
|
|
76
65
|
exports.ActionsButton = ActionsButton;
|
|
77
|
-
|
|
78
66
|
var MenuItemWrapper = _styled.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: relative;\n"])));
|
|
79
|
-
|
|
80
67
|
exports.MenuItemWrapper = MenuItemWrapper;
|
|
81
|
-
|
|
82
68
|
var VerticalPointsButton = _styled.default.button(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n border: 0;\n background-color: transparent;\n font-family: inherit;\n position: relative;\n cursor: pointer;\n\n border-radius: 50%;\n z-index: ", ";\n\n padding: 0.5rem;\n\n transition: background-color linear ", ";\n\n &:hover {\n background: rgba(0, 0, 0, 0.08);\n }\n"])), function (props) {
|
|
83
69
|
return props.theme.zIndex.level1;
|
|
84
70
|
}, function (props) {
|
|
85
71
|
return props.theme.transition.speed;
|
|
86
72
|
});
|
|
87
|
-
|
|
88
73
|
exports.VerticalPointsButton = VerticalPointsButton;
|
|
89
|
-
|
|
90
74
|
var MenuItemContainer = _styled.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: ", ";\n position: absolute;\n border-radius: 8px;\n background-color: ", ";\n box-shadow: 0px 8px 24px rgba(0, 0, 0, 0.1);\n right: ", "px;\n top: ", "px;\n padding: 10px;\n\n z-index: ", ";\n"])), function (props) {
|
|
91
75
|
return props.isOpen ? 'block' : 'none';
|
|
92
76
|
}, function (_ref) {
|
|
@@ -99,9 +83,7 @@ var MenuItemContainer = _styled.default.div(_templateObject6 || (_templateObject
|
|
|
99
83
|
}, function (props) {
|
|
100
84
|
return props.theme.zIndex.level2;
|
|
101
85
|
});
|
|
102
|
-
|
|
103
86
|
exports.MenuItemContainer = MenuItemContainer;
|
|
104
|
-
|
|
105
87
|
var MenuItemContent = _styled.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n border-radius: 8px;\n padding: 10px 35px;\n cursor: pointer;\n user-select: none;\n font-size: 1rem;\n white-space: nowrap;\n\n color: ", ";\n\n transition: background linear ", ";\n\n &:hover {\n background: ", ";\n }\n"])), function (_ref2) {
|
|
106
88
|
var theme = _ref2.theme;
|
|
107
89
|
return {
|
|
@@ -117,5 +99,4 @@ var MenuItemContent = _styled.default.div(_templateObject7 || (_templateObject7
|
|
|
117
99
|
light: theme.colors.neutral.neutral1
|
|
118
100
|
}[theme.colorMode];
|
|
119
101
|
});
|
|
120
|
-
|
|
121
102
|
exports.MenuItemContent = MenuItemContent;
|
|
@@ -1,129 +1,113 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _testUtils = require("../../shared/tests/test-utils");
|
|
4
|
-
|
|
5
4
|
var _react = require("@testing-library/react");
|
|
6
|
-
|
|
7
5
|
require("@testing-library/jest-dom/extend-expect");
|
|
8
|
-
|
|
9
6
|
var _ = require(".");
|
|
10
|
-
|
|
11
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
|
|
8
|
+
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); }
|
|
13
9
|
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; }
|
|
14
|
-
|
|
15
10
|
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; }
|
|
16
|
-
|
|
17
|
-
function
|
|
18
|
-
|
|
11
|
+
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; }
|
|
12
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
13
|
+
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); }
|
|
19
14
|
var setup = function setup(props) {
|
|
20
15
|
var utils = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Table, _objectSpread({}, props)));
|
|
21
16
|
return _objectSpread({}, utils);
|
|
22
17
|
};
|
|
23
|
-
|
|
24
18
|
describe('Table', function () {
|
|
25
19
|
it('should render the table component', function () {
|
|
26
20
|
var _setup = setup({
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
21
|
+
header: ['Header 1', 'Header 2'],
|
|
22
|
+
rows: [{
|
|
23
|
+
items: ['Row 1', 'Row 2']
|
|
24
|
+
}]
|
|
25
|
+
}),
|
|
26
|
+
container = _setup.container;
|
|
34
27
|
expect(container).toBeInTheDocument();
|
|
35
28
|
});
|
|
36
29
|
it('should render the table component with selectable prop', function () {
|
|
37
30
|
var _setup2 = setup({
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
31
|
+
header: ['Header 1', 'Header 2'],
|
|
32
|
+
rows: [{
|
|
33
|
+
items: ['Row 1', 'Row 2']
|
|
34
|
+
}],
|
|
35
|
+
selectable: true
|
|
36
|
+
}),
|
|
37
|
+
container = _setup2.container;
|
|
46
38
|
expect(container).toBeInTheDocument();
|
|
47
39
|
});
|
|
48
40
|
it('should render the table component with dropdown menu in rows', function () {
|
|
49
41
|
var _setup3 = setup({
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
42
|
+
header: ['Header 1', 'Header 2'],
|
|
43
|
+
rows: [{
|
|
44
|
+
items: ['Row 1', 'Row 2'],
|
|
45
|
+
actions: [{
|
|
46
|
+
label: 'Action 1',
|
|
47
|
+
handler: function handler() {}
|
|
48
|
+
}, {
|
|
49
|
+
label: 'Action 2',
|
|
50
|
+
handler: function handler() {}
|
|
51
|
+
}]
|
|
59
52
|
}]
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
container = _setup3.container;
|
|
63
|
-
|
|
53
|
+
}),
|
|
54
|
+
container = _setup3.container;
|
|
64
55
|
expect(container).toBeInTheDocument();
|
|
65
56
|
});
|
|
66
57
|
it('should select all elements', function () {
|
|
67
58
|
var _setup4 = setup({
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
59
|
+
header: ['Header 1', 'Header 2'],
|
|
60
|
+
rows: [{
|
|
61
|
+
items: ['Row collumn 1', 'Row collumn 2']
|
|
62
|
+
}, {
|
|
63
|
+
items: ['Row collumn 1', 'Row collumn 2']
|
|
64
|
+
}, {
|
|
65
|
+
items: ['Row collumn 1', 'Row collumn 2']
|
|
66
|
+
}],
|
|
67
|
+
selectable: true
|
|
68
|
+
}),
|
|
69
|
+
container = _setup4.container;
|
|
80
70
|
var firstCheckbox = container.querySelector('th input[type="checkbox"]');
|
|
81
|
-
|
|
82
71
|
_react.fireEvent.click(firstCheckbox);
|
|
83
|
-
|
|
84
72
|
var allSelectedRows = container.querySelectorAll('[data-selected="true"]');
|
|
85
73
|
expect(allSelectedRows.length).toEqual(3);
|
|
86
74
|
});
|
|
87
75
|
it('should open the dropdown menu in rows', function () {
|
|
88
76
|
var _firstRowMenuButton$p;
|
|
89
|
-
|
|
90
77
|
var _setup5 = setup({
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
78
|
+
header: ['Header 1', 'Header 2'],
|
|
79
|
+
rows: [{
|
|
80
|
+
items: ['Row collumn 1', 'Row collumn 2'],
|
|
81
|
+
actions: [{
|
|
82
|
+
label: 'Action 1',
|
|
83
|
+
handler: function handler() {}
|
|
84
|
+
}, {
|
|
85
|
+
label: 'Action 2',
|
|
86
|
+
handler: function handler() {}
|
|
87
|
+
}]
|
|
97
88
|
}, {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}, {
|
|
107
|
-
label: 'Action 2',
|
|
108
|
-
handler: function handler() {}
|
|
109
|
-
}]
|
|
110
|
-
}, {
|
|
111
|
-
items: ['Row collumn 1', 'Row collumn 2'],
|
|
112
|
-
actions: [{
|
|
113
|
-
label: 'Action 1',
|
|
114
|
-
handler: function handler() {}
|
|
89
|
+
items: ['Row collumn 1', 'Row collumn 2'],
|
|
90
|
+
actions: [{
|
|
91
|
+
label: 'Action 1',
|
|
92
|
+
handler: function handler() {}
|
|
93
|
+
}, {
|
|
94
|
+
label: 'Action 2',
|
|
95
|
+
handler: function handler() {}
|
|
96
|
+
}]
|
|
115
97
|
}, {
|
|
116
|
-
|
|
117
|
-
|
|
98
|
+
items: ['Row collumn 1', 'Row collumn 2'],
|
|
99
|
+
actions: [{
|
|
100
|
+
label: 'Action 1',
|
|
101
|
+
handler: function handler() {}
|
|
102
|
+
}, {
|
|
103
|
+
label: 'Action 2',
|
|
104
|
+
handler: function handler() {}
|
|
105
|
+
}]
|
|
118
106
|
}]
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
container = _setup5.container;
|
|
122
|
-
|
|
107
|
+
}),
|
|
108
|
+
container = _setup5.container;
|
|
123
109
|
var firstRowMenuButton = container.querySelector('tbody tr td button');
|
|
124
|
-
|
|
125
110
|
_react.fireEvent.click(firstRowMenuButton);
|
|
126
|
-
|
|
127
111
|
var firstRowMenu = (_firstRowMenuButton$p = firstRowMenuButton.parentElement) === null || _firstRowMenuButton$p === void 0 ? void 0 : _firstRowMenuButton$p.querySelector('div');
|
|
128
112
|
expect(firstRowMenu).toHaveStyle('display: block');
|
|
129
113
|
});
|
|
@@ -3,13 +3,13 @@ export interface TableAction {
|
|
|
3
3
|
label: ReactNode;
|
|
4
4
|
handler: (selectedRows?: string[], allSelected?: boolean) => void;
|
|
5
5
|
}
|
|
6
|
-
export
|
|
6
|
+
export type TableRow = {
|
|
7
7
|
items: ReactNode[];
|
|
8
8
|
actions?: TableAction[];
|
|
9
9
|
};
|
|
10
10
|
/** Corresponds to the content displayed inside a table cell. */
|
|
11
|
-
export
|
|
12
|
-
export
|
|
11
|
+
export type TableCell = ReactNode;
|
|
12
|
+
export type MenuStateProps = {
|
|
13
13
|
state: boolean;
|
|
14
14
|
rowId: string;
|
|
15
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Table/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,EAAE,WAAW,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACnE;AAED,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Table/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,EAAE,WAAW,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACnE;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;CACzB,CAAC;AAEF,gEAAgE;AAChE,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC;AAElC,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,kFAAkF;IAClF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mEAAmE;IACnE,cAAc,CAAC,EAAE,WAAW,EAAE,CAAC;IAC/B,mFAAmF;IACnF,gBAAgB,CAAC,EAAE,WAAW,EAAE,CAAC;IACjC,mFAAmF;IACnF,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,gJAAgJ;IAChJ,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,mEAAmE;IACnE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,SAAS;IACxB,qCAAqC;IACrC,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,qCAAqC;IACrC,MAAM,EAAE,OAAO,CAAC;IAChB,kDAAkD;IAClD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,4CAA4C;IAC5C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,+EAA+E;IAC/E,eAAe,EAAE,MAAM,CAAC;IACxB,4EAA4E;IAC5E,YAAY,EAAE,MAAM,CAAC;IACrB,+EAA+E;IAC/E,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAClC"}
|
|
@@ -1,44 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
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); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.TabsExample = void 0;
|
|
7
|
-
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
|
|
10
9
|
var _ = require(".");
|
|
11
|
-
|
|
12
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
|
|
14
11
|
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; }
|
|
15
|
-
|
|
16
12
|
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; }
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
13
|
+
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; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
+
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); }
|
|
20
16
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
21
|
-
|
|
22
17
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
23
|
-
|
|
24
18
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
29
|
-
|
|
19
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
20
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
30
21
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
31
|
-
|
|
22
|
+
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
32
23
|
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); }
|
|
33
|
-
|
|
34
24
|
var TabsExample = function TabsExample(_ref) {
|
|
35
|
-
var props = _extends({}, _ref);
|
|
36
|
-
|
|
25
|
+
var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
37
26
|
var _useState = (0, _react.useState)(props.value),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
27
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
28
|
+
currentTab = _useState2[0],
|
|
29
|
+
setCurrentTab = _useState2[1];
|
|
42
30
|
(0, _react.useEffect)(function () {
|
|
43
31
|
setCurrentTab(props.value);
|
|
44
32
|
}, [props.value]);
|
|
@@ -73,5 +61,4 @@ var TabsExample = function TabsExample(_ref) {
|
|
|
73
61
|
})]
|
|
74
62
|
});
|
|
75
63
|
};
|
|
76
|
-
|
|
77
64
|
exports.TabsExample = TabsExample;
|
|
@@ -4,32 +4,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Tab = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var _Tabs = require("./Tabs");
|
|
11
|
-
|
|
12
9
|
var _styles = require("../styles");
|
|
13
|
-
|
|
14
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
|
|
16
11
|
var Tab = function Tab(_ref) {
|
|
17
12
|
var label = _ref.label,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
value = _ref.value,
|
|
14
|
+
icon = _ref.icon,
|
|
15
|
+
_ref$iconPosition = _ref.iconPosition,
|
|
16
|
+
iconPosition = _ref$iconPosition === void 0 ? 'left' : _ref$iconPosition,
|
|
17
|
+
disabled = _ref.disabled;
|
|
24
18
|
var _useContext = (0, _react.useContext)(_Tabs.TabsContext),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
19
|
+
activeTabRef = _useContext.activeTabRef,
|
|
20
|
+
activeTab = _useContext.activeTab,
|
|
21
|
+
changeTab = _useContext.changeTab,
|
|
22
|
+
squeeze = _useContext.squeeze,
|
|
23
|
+
indicatorColor = _useContext.indicatorColor,
|
|
24
|
+
textColor = _useContext.textColor,
|
|
25
|
+
isLoading = _useContext.isLoading;
|
|
33
26
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.TabButton, {
|
|
34
27
|
id: "simple-tab-".concat(value),
|
|
35
28
|
type: "button",
|
|
@@ -53,5 +46,4 @@ var Tab = function Tab(_ref) {
|
|
|
53
46
|
})
|
|
54
47
|
});
|
|
55
48
|
};
|
|
56
|
-
|
|
57
49
|
exports.Tab = Tab;
|
|
@@ -4,16 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.TabPanel = void 0;
|
|
7
|
-
|
|
8
7
|
var _styles = require("../styles");
|
|
9
|
-
|
|
10
8
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
|
|
12
9
|
var TabPanel = function TabPanel(_ref) {
|
|
13
10
|
var children = _ref.children,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
index = _ref.index,
|
|
12
|
+
value = _ref.value,
|
|
13
|
+
noPadding = _ref.noPadding;
|
|
17
14
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.TabPanelContainer, {
|
|
18
15
|
id: "simple-tabpanel-".concat(index),
|
|
19
16
|
hidden: Number(value) !== Number(index),
|
|
@@ -25,5 +22,4 @@ var TabPanel = function TabPanel(_ref) {
|
|
|
25
22
|
})
|
|
26
23
|
});
|
|
27
24
|
};
|
|
28
|
-
|
|
29
25
|
exports.TabPanel = TabPanel;
|