@farm-investimentos/front-mfe-components-vue3 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -0
- package/dist/demo.html +10 -0
- package/dist/front-mfe-components.common.js +17771 -0
- package/dist/front-mfe-components.common.js.map +1 -0
- package/dist/front-mfe-components.css +1 -0
- package/dist/front-mfe-components.umd.js +17781 -0
- package/dist/front-mfe-components.umd.js.map +1 -0
- package/dist/front-mfe-components.umd.min.js +2 -0
- package/dist/front-mfe-components.umd.min.js.map +1 -0
- package/package.json +91 -0
- package/src/components/AlertBox/AlertBox.scss +52 -0
- package/src/components/AlertBox/AlertBox.stories.js +79 -0
- package/src/components/AlertBox/AlertBox.vue +127 -0
- package/src/components/AlertBox/__tests__/AlertBox.spec.js +32 -0
- package/src/components/AlertBox/__tests__/valueWatcher.spec.js +15 -0
- package/src/components/AlertBox/index.ts +4 -0
- package/src/components/AlertBox/valueWatcher.ts +10 -0
- package/src/components/AlertReload/AlertReload.scss +33 -0
- package/src/components/AlertReload/AlertReload.stories.js +34 -0
- package/src/components/AlertReload/AlertReload.vue +46 -0
- package/src/components/AlertReload/__tests__/AlertReload.spec.js +18 -0
- package/src/components/AlertReload/index.ts +4 -0
- package/src/components/ButtonToggle/ButtonToggle.scss +14 -0
- package/src/components/ButtonToggle/ButtonToggle.stories.js +50 -0
- package/src/components/ButtonToggle/ButtonToggle.vue +53 -0
- package/src/components/ButtonToggle/IButtonToggle.ts +5 -0
- package/src/components/ButtonToggle/__tests__/ButtonToggle.spec.js +35 -0
- package/src/components/ButtonToggle/index.ts +4 -0
- package/src/components/Buttons/ConfirmButton/ConfirmButton.stories.js +50 -0
- package/src/components/Buttons/ConfirmButton/ConfirmButton.vue +33 -0
- package/src/components/Buttons/ConfirmButton/__tests__/ConfirmButton.spec.js +14 -0
- package/src/components/Buttons/ConfirmButton/index.ts +4 -0
- package/src/components/Buttons/DangerButton/DangerButton.stories.js +49 -0
- package/src/components/Buttons/DangerButton/DangerButton.vue +32 -0
- package/src/components/Buttons/DangerButton/__tests__/DangerButton.spec.js +14 -0
- package/src/components/Buttons/DangerButton/index.ts +4 -0
- package/src/components/Buttons/DefaultButton/Buttons.stories.scss +10 -0
- package/src/components/Buttons/DefaultButton/DefaultButton.scss +328 -0
- package/src/components/Buttons/DefaultButton/DefaultButton.stories.js +317 -0
- package/src/components/Buttons/DefaultButton/DefaultButton.vue +128 -0
- package/src/components/Buttons/DefaultButton/__tests__/DefaultButton.spec.js +32 -0
- package/src/components/Buttons/DefaultButton/index.ts +4 -0
- package/src/components/Buttons/ExportButton/ExportButton.stories.js +40 -0
- package/src/components/Buttons/ExportButton/ExportButton.vue +82 -0
- package/src/components/Buttons/ExportButton/__tests__/ExportButton.spec.js +14 -0
- package/src/components/Buttons/ExportButton/index.ts +4 -0
- package/src/components/Buttons/ImportButton/ImportButton.scss +8 -0
- package/src/components/Buttons/ImportButton/ImportButton.stories.js +23 -0
- package/src/components/Buttons/ImportButton/ImportButton.vue +35 -0
- package/src/components/Buttons/ImportButton/__tests__/ImportButton.spec.js +23 -0
- package/src/components/Buttons/ImportButton/index.ts +4 -0
- package/src/components/Buttons/MultiImportButton/MultiImportButton.stories.js +35 -0
- package/src/components/Buttons/MultiImportButton/MultiImportButton.vue +54 -0
- package/src/components/Buttons/MultiImportButton/__tests__/MultiImportButton.spec.js +14 -0
- package/src/components/Buttons/MultiImportButton/index.ts +4 -0
- package/src/components/Buttons/RemoveButton/RemoveButton.scss +5 -0
- package/src/components/Buttons/RemoveButton/RemoveButton.stories.js +17 -0
- package/src/components/Buttons/RemoveButton/RemoveButton.vue +44 -0
- package/src/components/Buttons/RemoveButton/__tests__/RemoveButton.spec.js +23 -0
- package/src/components/Buttons/RemoveButton/index.ts +4 -0
- package/src/components/Buttons/ToggleButton/ToggleButton.stories.js +22 -0
- package/src/components/Buttons/ToggleButton/ToggleButton.vue +75 -0
- package/src/components/Buttons/ToggleButton/__tests__/ToggleButton.spec.js +21 -0
- package/src/components/Buttons/ToggleButton/index.ts +4 -0
- package/src/components/Card/Card.scss +18 -0
- package/src/components/Card/Card.stories.js +40 -0
- package/src/components/Card/Card.vue +24 -0
- package/src/components/Card/CardComposition.stories.ts +69 -0
- package/src/components/Card/CardContent/CardContent.scss +17 -0
- package/src/components/Card/CardContent/CardContent.stories.js +47 -0
- package/src/components/Card/CardContent/CardContent.vue +39 -0
- package/src/components/Card/CardContent/__tests__/CardContent.spec.js +20 -0
- package/src/components/Card/CardContent/index.ts +4 -0
- package/src/components/Card/__tests__/Card.spec.js +20 -0
- package/src/components/Card/index.ts +5 -0
- package/src/components/Checkbox/Checkbox.scss +108 -0
- package/src/components/Checkbox/Checkbox.stories.js +194 -0
- package/src/components/Checkbox/Checkbox.vue +193 -0
- package/src/components/Checkbox/__tests__/Checkbox.spec.js +34 -0
- package/src/components/Checkbox/__tests__/modelValueWatcher.spec.js +43 -0
- package/src/components/Checkbox/index.ts +4 -0
- package/src/components/Checkbox/modelValueWatcher.ts +12 -0
- package/src/components/Chip/Chip.scss +109 -0
- package/src/components/Chip/Chip.stories.js +96 -0
- package/src/components/Chip/Chip.stories.scss +13 -0
- package/src/components/Chip/Chip.vue +66 -0
- package/src/components/Chip/__tests__/Chip.spec.js +20 -0
- package/src/components/Chip/index.ts +4 -0
- package/src/components/ChipInviteStatus/ChipInviteStatus.stories.js +30 -0
- package/src/components/ChipInviteStatus/ChipInviteStatus.vue +38 -0
- package/src/components/ChipInviteStatus/__tests__/ChipInviteStatus.spec.js +22 -0
- package/src/components/ChipInviteStatus/index.ts +4 -0
- package/src/components/ChipInviteStatus/keys.ts +11 -0
- package/src/components/Collapsible/Collapsible.scss +48 -0
- package/src/components/Collapsible/Collapsible.stories.js +150 -0
- package/src/components/Collapsible/Collapsible.vue +189 -0
- package/src/components/Collapsible/__tests__/Collapsible.spec.js +38 -0
- package/src/components/Collapsible/index.ts +3 -0
- package/src/components/ContextMenu/ContextMenu.scss +33 -0
- package/src/components/ContextMenu/ContextMenu.stories.js +248 -0
- package/src/components/ContextMenu/ContextMenu.vue +250 -0
- package/src/components/ContextMenu/__tests__/ContextMenu.spec.js +29 -0
- package/src/components/ContextMenu/index.ts +5 -0
- package/src/components/CopyToClipboard/CopyToClipboard.stories.js +83 -0
- package/src/components/CopyToClipboard/CopyToClipboard.vue +133 -0
- package/src/components/CopyToClipboard/__tests__/CopyToClipboard.spec.js +24 -0
- package/src/components/CopyToClipboard/index.ts +4 -0
- package/src/components/DataTableEmptyWrapper/DataTableEmptyWrapper.scss +17 -0
- package/src/components/DataTableEmptyWrapper/DataTableEmptyWrapper.stories.js +30 -0
- package/src/components/DataTableEmptyWrapper/DataTableEmptyWrapper.vue +50 -0
- package/src/components/DataTableEmptyWrapper/__tests__/DataTableEmptyWrapper.spec.js +20 -0
- package/src/components/DataTableEmptyWrapper/index.ts +4 -0
- package/src/components/DataTableHeader/DataTableHeader.scss +65 -0
- package/src/components/DataTableHeader/DataTableHeader.stories.js +109 -0
- package/src/components/DataTableHeader/DataTableHeader.vue +197 -0
- package/src/components/DataTableHeader/__tests__/DataTableHeader.spec.js +95 -0
- package/src/components/DataTableHeader/index.ts +3 -0
- package/src/components/DataTablePaginator/DataTablePaginator.scss +90 -0
- package/src/components/DataTablePaginator/DataTablePaginator.stories.js +49 -0
- package/src/components/DataTablePaginator/DataTablePaginator.vue +218 -0
- package/src/components/DataTablePaginator/__tests__/DataTablePaginator.spec.js +32 -0
- package/src/components/DataTablePaginator/index.ts +3 -0
- package/src/components/DatePicker/DatePicker.scss +18 -0
- package/src/components/DatePicker/DatePicker.stories.js +134 -0
- package/src/components/DatePicker/DatePicker.vue +292 -0
- package/src/components/DatePicker/__tests__/DatePicker.spec.js +108 -0
- package/src/components/DatePicker/customDatePicker.scss +79 -0
- package/src/components/DatePicker/index.ts +3 -0
- package/src/components/DatePicker/vDatePicker.scss +214 -0
- package/src/components/DialogFooter/DialogFooter.scss +34 -0
- package/src/components/DialogFooter/DialogFooter.stories.js +49 -0
- package/src/components/DialogFooter/DialogFooter.vue +102 -0
- package/src/components/DialogFooter/IExtraButton.ts +9 -0
- package/src/components/DialogFooter/__tests__/DialogFooter.spec.js +20 -0
- package/src/components/DialogFooter/index.ts +3 -0
- package/src/components/DialogHeader/DialogHeader.scss +32 -0
- package/src/components/DialogHeader/DialogHeader.stories.js +69 -0
- package/src/components/DialogHeader/DialogHeader.vue +61 -0
- package/src/components/DialogHeader/__tests__/DialogHeader.spec.js +24 -0
- package/src/components/DialogHeader/index.ts +3 -0
- package/src/components/Form/Form.stories.js +390 -0
- package/src/components/Form/Form.vue +100 -0
- package/src/components/Form/__tests__/Form.spec.js +14 -0
- package/src/components/Form/index.ts +4 -0
- package/src/components/Icon/Icon.scss +61 -0
- package/src/components/Icon/Icon.stories.js +156 -0
- package/src/components/Icon/Icon.vue +100 -0
- package/src/components/Icon/Icons.stories.scss +31 -0
- package/src/components/Icon/__tests__/Icon.spec.js +34 -0
- package/src/components/Icon/icons_list.ts +2557 -0
- package/src/components/Icon/index.ts +4 -0
- package/src/components/IconBox/IconBox.scss +42 -0
- package/src/components/IconBox/IconBox.stories.js +92 -0
- package/src/components/IconBox/IconBox.vue +78 -0
- package/src/components/IconBox/__tests__/IconBox.spec.js +37 -0
- package/src/components/IconBox/index.ts +3 -0
- package/src/components/IdCaption/IdCaption.scss +51 -0
- package/src/components/IdCaption/IdCaption.stories.js +224 -0
- package/src/components/IdCaption/IdCaption.vue +168 -0
- package/src/components/IdCaption/__tests__/IdCaption.spec.js +14 -0
- package/src/components/IdCaption/index.ts +3 -0
- package/src/components/Label/Label.scss +33 -0
- package/src/components/Label/Label.stories.js +60 -0
- package/src/components/Label/Label.vue +27 -0
- package/src/components/Label/__tests__/Label.spec.js +20 -0
- package/src/components/Label/index.ts +4 -0
- package/src/components/List/List.scss +0 -0
- package/src/components/List/List.stories.js +30 -0
- package/src/components/List/List.vue +75 -0
- package/src/components/List/__tests__/List.spec.js +33 -0
- package/src/components/List/composition/index.ts +3 -0
- package/src/components/List/composition/useFocus.ts +49 -0
- package/src/components/List/index.ts +4 -0
- package/src/components/ListItem/ListItem.scss +37 -0
- package/src/components/ListItem/ListItem.stories.js +81 -0
- package/src/components/ListItem/ListItem.vue +76 -0
- package/src/components/ListItem/ListItem.vue.bkpv2 +84 -0
- package/src/components/ListItem/__tests__/ListItem.spec.js +20 -0
- package/src/components/ListItem/index.ts +4 -0
- package/src/components/Loader/Loader.scss +116 -0
- package/src/components/Loader/Loader.stories.ts +48 -0
- package/src/components/Loader/Loader.vue +83 -0
- package/src/components/Loader/__tests__/Loader.spec.js +35 -0
- package/src/components/Loader/index.ts +3 -0
- package/src/components/Logger/Logger.scss +56 -0
- package/src/components/Logger/Logger.stories.js +228 -0
- package/src/components/Logger/Logger.vue +49 -0
- package/src/components/Logger/LoggerItem/ILoggerItem.ts +11 -0
- package/src/components/Logger/LoggerItem/LoggerItem.scss +99 -0
- package/src/components/Logger/LoggerItem/LoggerItem.stories.js +144 -0
- package/src/components/Logger/LoggerItem/LoggerItem.vue +98 -0
- package/src/components/Logger/LoggerItem/__tests__/LoggerItem.spec.js +93 -0
- package/src/components/Logger/LoggerItem/index.ts +4 -0
- package/src/components/Logger/LoggerItem/mappingIconKeys.ts +5 -0
- package/src/components/Logger/__tests__/Logger.spec.js +75 -0
- package/src/components/Logger/index.ts +4 -0
- package/src/components/MainFilter/MainFilter.scss +16 -0
- package/src/components/MainFilter/MainFilter.stories.js +84 -0
- package/src/components/MainFilter/MainFilter.vue +147 -0
- package/src/components/MainFilter/__tests__/MainFilter.spec.js +45 -0
- package/src/components/MainFilter/index.ts +3 -0
- package/src/components/ManagersList/ManagersList.stories.js +10 -0
- package/src/components/ManagersList/ManagersList.vue +29 -0
- package/src/components/ManagersList/__tests__/ManagersList.spec.js +27 -0
- package/src/components/ManagersList/index.ts +3 -0
- package/src/components/Modal/Modal.scss +110 -0
- package/src/components/Modal/Modal.stories.js +299 -0
- package/src/components/Modal/Modal.vue +135 -0
- package/src/components/Modal/__tests__/Modal.spec.js +19 -0
- package/src/components/Modal/index.ts +4 -0
- package/src/components/ModalPromptUser/ModalPromptUser.scss +3 -0
- package/src/components/ModalPromptUser/ModalPromptUser.stories.js +121 -0
- package/src/components/ModalPromptUser/ModalPromptUser.vue +135 -0
- package/src/components/ModalPromptUser/__tests__/ModalPromptUser.spec.js +27 -0
- package/src/components/ModalPromptUser/index.ts +3 -0
- package/src/components/MultipleFilePicker/MultipleFilePicker.scss +168 -0
- package/src/components/MultipleFilePicker/MultipleFilePicker.stories.js +74 -0
- package/src/components/MultipleFilePicker/MultipleFilePicker.vue +261 -0
- package/src/components/MultipleFilePicker/__tests__/MultipleFilePicker.spec.js +184 -0
- package/src/components/MultipleFilePicker/index.ts +3 -0
- package/src/components/MultipleSelectShortener/MultipleSelectShortener.stories.js +32 -0
- package/src/components/MultipleSelectShortener/MultipleSelectShortener.vue +48 -0
- package/src/components/MultipleSelectShortener/__tests__/MultipleSelectShortener.spec.js +21 -0
- package/src/components/MultipleSelectShortener/index.ts +4 -0
- package/src/components/ProgressBar/ProgressBar.scss +25 -0
- package/src/components/ProgressBar/ProgressBar.stories.js +49 -0
- package/src/components/ProgressBar/ProgressBar.vue +111 -0
- package/src/components/ProgressBar/__tests__/ProgressBar.spec.js +31 -0
- package/src/components/ProgressBar/index.ts +4 -0
- package/src/components/PromptUserToConfirm/PromptUserToConfirm.stories.js +51 -0
- package/src/components/PromptUserToConfirm/PromptUserToConfirm.vue +62 -0
- package/src/components/PromptUserToConfirm/__tests__/PromptUserToConfirm.spec.js +24 -0
- package/src/components/PromptUserToConfirm/index.ts +3 -0
- package/src/components/Radio/Radio.scss +109 -0
- package/src/components/Radio/Radio.stories.js +147 -0
- package/src/components/Radio/Radio.vue +110 -0
- package/src/components/Radio/__tests__/Radio.spec.js +27 -0
- package/src/components/Radio/index.ts +4 -0
- package/src/components/RadioGroup/RadioGroup.stories.js +85 -0
- package/src/components/RadioGroup/RadioGroup.vue +95 -0
- package/src/components/RadioGroup/__tests__/RadioGroup.spec.js +24 -0
- package/src/components/RadioGroup/index.ts +4 -0
- package/src/components/RangeDatePicker/RangeDatePicker.stories.js +76 -0
- package/src/components/RangeDatePicker/RangeDatePicker.vue +201 -0
- package/src/components/RangeDatePicker/__tests__/RangeDatePicker.spec.js +107 -0
- package/src/components/RangeDatePicker/index.ts +3 -0
- package/src/components/ResetTableRowSelection/ResetTableRowSelection.stories.js +15 -0
- package/src/components/ResetTableRowSelection/ResetTableRowSelection.vue +35 -0
- package/src/components/ResetTableRowSelection/__tests__/ResetTableRowSelection.spec.js +33 -0
- package/src/components/ResetTableRowSelection/index.ts +4 -0
- package/src/components/ResourceMetaInfo/ResourceMetaInfo.scss +14 -0
- package/src/components/ResourceMetaInfo/ResourceMetaInfo.stories.js +138 -0
- package/src/components/ResourceMetaInfo/ResourceMetaInfo.vue +140 -0
- package/src/components/ResourceMetaInfo/__tests__/ResourceMetaInfo.spec.js +182 -0
- package/src/components/ResourceMetaInfo/index.ts +4 -0
- package/src/components/Select/Select.scss +49 -0
- package/src/components/Select/Select.stories.js +346 -0
- package/src/components/Select/Select.vue +439 -0
- package/src/components/Select/__tests__/Select.spec.js +174 -0
- package/src/components/Select/__tests__/composition.spec.js +27 -0
- package/src/components/Select/composition/buildData.ts +34 -0
- package/src/components/Select/composition/index.ts +3 -0
- package/src/components/Select/index.ts +4 -0
- package/src/components/SelectAutoComplete/SelectAutoComplete.scss +49 -0
- package/src/components/SelectAutoComplete/SelectAutoComplete.stories.js +328 -0
- package/src/components/SelectAutoComplete/SelectAutoComplete.vue +535 -0
- package/src/components/SelectAutoComplete/__tests__/SelectAutoComplete.spec.js +130 -0
- package/src/components/SelectAutoComplete/__tests__/useSelectAutoComplete.spec.js +28 -0
- package/src/components/SelectAutoComplete/composables/index.ts +3 -0
- package/src/components/SelectAutoComplete/composables/useSelectAutoComplete.ts +37 -0
- package/src/components/SelectAutoComplete/index.ts +4 -0
- package/src/components/SelectModalOptions/SelectModalOptions.scss +15 -0
- package/src/components/SelectModalOptions/SelectModalOptions.stories.js +46 -0
- package/src/components/SelectModalOptions/SelectModalOptions.vue +298 -0
- package/src/components/SelectModalOptions/__tests__/SelectModalOptions.spec.js +132 -0
- package/src/components/SelectModalOptions/index.ts +4 -0
- package/src/components/Stepper/StepperHeader/IStep.ts +6 -0
- package/src/components/Stepper/StepperHeader/StepperHeader.scss +127 -0
- package/src/components/Stepper/StepperHeader/StepperHeader.stories.js +89 -0
- package/src/components/Stepper/StepperHeader/StepperHeader.vue +106 -0
- package/src/components/Stepper/StepperHeader/__tests__/StepperHeader.spec.js +63 -0
- package/src/components/Stepper/StepperHeader/_mixins.scss +46 -0
- package/src/components/Stepper/StepperHeader/index.ts +4 -0
- package/src/components/Stepper/index.ts +5 -0
- package/src/components/Switcher/Switcher.scss +71 -0
- package/src/components/Switcher/Switcher.stories.js +112 -0
- package/src/components/Switcher/Switcher.vue +94 -0
- package/src/components/Switcher/__tests__/Switcher.spec.js +26 -0
- package/src/components/Switcher/index.ts +4 -0
- package/src/components/TableContextMenu/TableContextMenu.scss +9 -0
- package/src/components/TableContextMenu/TableContextMenu.stories.js +92 -0
- package/src/components/TableContextMenu/TableContextMenu.vue +89 -0
- package/src/components/TableContextMenu/__tests__/TableContextMenu.spec.js +45 -0
- package/src/components/TableContextMenu/index.ts +3 -0
- package/src/components/Tabs/Tabs.scss +72 -0
- package/src/components/Tabs/Tabs.stories.js +68 -0
- package/src/components/Tabs/Tabs.vue +130 -0
- package/src/components/Tabs/__tests__/Tabs.spec.js +59 -0
- package/src/components/Tabs/index.ts +4 -0
- package/src/components/TextArea/TextArea.scss +75 -0
- package/src/components/TextArea/TextArea.stories.js +147 -0
- package/src/components/TextArea/TextArea.vue +224 -0
- package/src/components/TextArea/__tests__/TextArea.spec.js +48 -0
- package/src/components/TextArea/index.ts +4 -0
- package/src/components/TextFieldV2/TextFieldV2.scss +99 -0
- package/src/components/TextFieldV2/TextFieldV2.stories.js +260 -0
- package/src/components/TextFieldV2/TextFieldV2.vue +276 -0
- package/src/components/TextFieldV2/__tests__/TextFieldV2.spec.js +52 -0
- package/src/components/TextFieldV2/index.ts +4 -0
- package/src/components/Tooltip/Tooltip.scss +38 -0
- package/src/components/Tooltip/Tooltip.stories.js +100 -0
- package/src/components/Tooltip/Tooltip.vue +125 -0
- package/src/components/Tooltip/__tests__/Tooltip.spec.js +20 -0
- package/src/components/Tooltip/index.ts +5 -0
- package/src/components/Typography/BodyText/BodyText.scss +8 -0
- package/src/components/Typography/BodyText/BodyText.stories.js +58 -0
- package/src/components/Typography/BodyText/BodyText.vue +51 -0
- package/src/components/Typography/BodyText/__tests__/BodyText.spec.js +31 -0
- package/src/components/Typography/BodyText/configurations.ts +10 -0
- package/src/components/Typography/Caption/Caption.scss +8 -0
- package/src/components/Typography/Caption/Caption.stories.js +54 -0
- package/src/components/Typography/Caption/Caption.vue +51 -0
- package/src/components/Typography/Caption/__tests__/Caption.spec.js +31 -0
- package/src/components/Typography/Caption/configurations.ts +7 -0
- package/src/components/Typography/Heading/Heading.scss +20 -0
- package/src/components/Typography/Heading/Heading.stories.js +32 -0
- package/src/components/Typography/Heading/Heading.vue +50 -0
- package/src/components/Typography/Heading/__tests__/Heading.spec.js +38 -0
- package/src/components/Typography/Heading/configurations.ts +10 -0
- package/src/components/Typography/OverlayText/OverlayText.scss +3 -0
- package/src/components/Typography/OverlayText/OverlayText.stories.js +25 -0
- package/src/components/Typography/OverlayText/OverlayText.vue +22 -0
- package/src/components/Typography/OverlayText/__tests__/OverlayText.spec.js +20 -0
- package/src/components/Typography/Small/Small.scss +3 -0
- package/src/components/Typography/Small/Small.stories.js +34 -0
- package/src/components/Typography/Small/Small.vue +47 -0
- package/src/components/Typography/Small/__tests__/Small.spec.js +31 -0
- package/src/components/Typography/Small/configurations.ts +7 -0
- package/src/components/Typography/Subtitle/Subtitle.scss +8 -0
- package/src/components/Typography/Subtitle/Subtitle.stories.js +57 -0
- package/src/components/Typography/Subtitle/Subtitle.vue +52 -0
- package/src/components/Typography/Subtitle/__tests__/Subtitle.spec.js +31 -0
- package/src/components/Typography/Subtitle/configurations.ts +8 -0
- package/src/components/Typography/Typography.scss +87 -0
- package/src/components/Typography/Typography.stories.js +210 -0
- package/src/components/Typography/Typography.vue +132 -0
- package/src/components/Typography/__tests__/Typography.spec.js +60 -0
- package/src/components/Typography/index.ts +11 -0
- package/src/components/ValueCaption/ValueCaption.scss +19 -0
- package/src/components/ValueCaption/ValueCaption.stories.js +58 -0
- package/src/components/ValueCaption/ValueCaption.vue +63 -0
- package/src/components/ValueCaption/__tests__/ValueCaption.spec.js +14 -0
- package/src/components/ValueCaption/index.ts +4 -0
- package/src/components/layout/Basic.stories.js +113 -0
- package/src/components/layout/Box/Box.scss +15 -0
- package/src/components/layout/Box/Box.stories.js +41 -0
- package/src/components/layout/Box/Box.vue +37 -0
- package/src/components/layout/Box/__tests__/Box.spec.js +20 -0
- package/src/components/layout/Box/index.ts +4 -0
- package/src/components/layout/Col/Col.scss +110 -0
- package/src/components/layout/Col/Col.stories.js +174 -0
- package/src/components/layout/Col/Col.vue +141 -0
- package/src/components/layout/Col/__tests__/Col.spec.js +20 -0
- package/src/components/layout/Col/index.ts +4 -0
- package/src/components/layout/Container/Container.scss +35 -0
- package/src/components/layout/Container/Container.stories.js +23 -0
- package/src/components/layout/Container/Container.vue +18 -0
- package/src/components/layout/Container/index.ts +4 -0
- package/src/components/layout/ContainerFooter/Container.stories.js +29 -0
- package/src/components/layout/ContainerFooter/ContainerFooter.scss +13 -0
- package/src/components/layout/ContainerFooter/ContainerFooter.vue +27 -0
- package/src/components/layout/ContainerFooter/index.ts +4 -0
- package/src/components/layout/DisplayBreakpoints.stories.mdx +90 -0
- package/src/components/layout/GridSystem.stories.js +138 -0
- package/src/components/layout/Line/Line.scss +25 -0
- package/src/components/layout/Line/Line.stories.js +53 -0
- package/src/components/layout/Line/Line.vue +58 -0
- package/src/components/layout/Line/__tests__/Line.spec.js +22 -0
- package/src/components/layout/Line/index.ts +4 -0
- package/src/components/layout/PropsValues.stories.mdx +30 -0
- package/src/components/layout/Row/Row.scss +42 -0
- package/src/components/layout/Row/Row.stories.js +112 -0
- package/src/components/layout/Row/Row.vue +77 -0
- package/src/components/layout/Row/__tests__/Row.spec.js +20 -0
- package/src/components/layout/Row/index.ts +4 -0
- package/src/composition/__tests__/deepEqual.spec.js +13 -0
- package/src/composition/__tests__/validateFormFieldBuilder.spec.js +34 -0
- package/src/composition/__tests__/validateFormStateBuilder.spec.js +8 -0
- package/src/composition/deepEqual.ts +24 -0
- package/src/composition/validateFormFieldBuilder.ts +18 -0
- package/src/composition/validateFormMethodBuilder.ts +9 -0
- package/src/composition/validateFormStateBuilder.ts +13 -0
- package/src/configurations/_functions.scss +9 -0
- package/src/configurations/_mixins.scss +103 -0
- package/src/configurations/_theme-colors-background.scss +10 -0
- package/src/configurations/_theme-colors-base.module.scss +8 -0
- package/src/configurations/_theme-colors-bw.module.scss +10 -0
- package/src/configurations/_theme-colors-stroke.scss +10 -0
- package/src/configurations/_theme-colors-text.scss +10 -0
- package/src/configurations/_theme-colors-variations.scss +9 -0
- package/src/configurations/_theme-colors.scss +122 -0
- package/src/configurations/_variables.scss +36 -0
- package/src/configurations/colors.ts +12 -0
- package/src/configurations/flexVariables.ts +5 -0
- package/src/configurations/gutters.ts +1 -0
- package/src/configurations/sizes.ts +1 -0
- package/src/configurations/typographyHtmlTags.ts +16 -0
- package/src/examples/Colors.stories.js +122 -0
- package/src/examples/Colors.stories.scss +21 -0
- package/src/examples/Table.stories.js +200 -0
- package/src/examples/VuetifyDialog.stories.js +129 -0
- package/src/helpers/calculateMainZindex.js +12 -0
- package/src/helpers/date.ts +94 -0
- package/src/helpers/formatDatePickerHeader.ts +19 -0
- package/src/helpers/index.ts +4 -0
- package/src/helpers/isChildOfFixedElement.js +16 -0
- package/src/helpers/randomId.ts +9 -0
- package/src/main.ts +92 -0
- package/src/scss/Sticky-table.scss +112 -0
- package/src/scss/Table.scss +2 -0
- package/src/scss/VMenuOverrides.scss +17 -0
- package/src/scss/VuejsDialog.scss +93 -0
- package/src/scss/cssVariablesGenerator.scss +25 -0
- package/src/scss/utils.scss +51 -0
- package/src/shims-libs.d.ts +4 -0
- package/src/shims-tsx.d.ts +11 -0
- package/src/shims-vue.d.ts +4 -0
- package/src/stories/Introduction.stories.mdx +118 -0
- package/src/stories/assets/code-brackets.svg +1 -0
- package/src/stories/assets/colors.svg +1 -0
- package/src/stories/assets/comments.svg +1 -0
- package/src/stories/assets/direction.svg +1 -0
- package/src/stories/assets/flow.svg +1 -0
- package/src/stories/assets/logo_farmtech.svg +21 -0
- package/src/stories/assets/plugin.svg +1 -0
- package/src/stories/assets/repo.svg +1 -0
- package/src/vue-file-import.d.ts +4 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import TableContextMenu from './TableContextMenu';
|
|
2
|
+
// import { withDesign } from 'storybook-addon-designs';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Navigation/TableContextMenu',
|
|
6
|
+
// decorators: [withDesign],
|
|
7
|
+
component: TableContextMenu,
|
|
8
|
+
parameters: {
|
|
9
|
+
design: {
|
|
10
|
+
type: 'figma',
|
|
11
|
+
url: 'https://www.figma.com/file/rkkAsX4IP0tzv1udIDXlqe/%E2%9C%8D---Onboarding---PJ?node-id=3516%3A11516',
|
|
12
|
+
},
|
|
13
|
+
docs: {
|
|
14
|
+
description: {
|
|
15
|
+
component: `TableContextMenu<br />
|
|
16
|
+
selector: <em>farm-context-menu</em><br />
|
|
17
|
+
<span style="color: var(--farm-primary-base);">ready for use</span>
|
|
18
|
+
`,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
viewMode: 'docs',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const Primary = () => ({
|
|
26
|
+
template: `<div style="padding-left: 80px">
|
|
27
|
+
<farm-context-menu :items="[{ label: 'Remover', icon: { color: 'error', type: 'open-in-new' } }]" />
|
|
28
|
+
</div>`,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export const Disabled = () => ({
|
|
32
|
+
template: `<div style="padding-left: 80px">
|
|
33
|
+
<farm-context-menu disabled :items="[{ label: 'Remover', icon: { color: 'error', type: 'open-in-new' } }]" />
|
|
34
|
+
</div>`,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export const Icons = () => ({
|
|
38
|
+
template: `<div style="padding-left: 80px">
|
|
39
|
+
<farm-context-menu
|
|
40
|
+
ref="icons"
|
|
41
|
+
:items="[{ label: 'Remover', icon: { color: 'error', type: 'delete' } }]"
|
|
42
|
+
/>
|
|
43
|
+
</div>`,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export const Multi = () => ({
|
|
47
|
+
data() {
|
|
48
|
+
return {
|
|
49
|
+
items: [
|
|
50
|
+
{ label: 'Novo', icon: { type: 'open-in-new' } },
|
|
51
|
+
{ label: 'Editar', icon: { color: 'secondary', type: 'open-in-new' } },
|
|
52
|
+
{ label: 'Remover', icon: { color: 'error', type: 'delete' } },
|
|
53
|
+
{ label: 'Outro', icon: { color: 'black', type: 'cog' } },
|
|
54
|
+
{ label: 'Book', icon: { color: 'gray', type: 'book' } },
|
|
55
|
+
],
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
template: `<div style="padding-left: 80px">
|
|
59
|
+
<farm-context-menu ref="multi" :items="items" />
|
|
60
|
+
</div>`,
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export const ClickHandler = () => ({
|
|
64
|
+
data() {
|
|
65
|
+
return {
|
|
66
|
+
editItem: () => {
|
|
67
|
+
alert('Click handler');
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
template: `<div style="padding-left: 80px">
|
|
72
|
+
<farm-context-menu :items="[{ label: 'Click me', icon: { type: 'open-in-new' }, handler: 'edit' }]" @edit="editItem()" />
|
|
73
|
+
</div>`,
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
export const OnRightSide = () => ({
|
|
77
|
+
data() {
|
|
78
|
+
return {
|
|
79
|
+
items: [
|
|
80
|
+
{ label: 'Novo', icon: { type: 'open-in-new' } },
|
|
81
|
+
{
|
|
82
|
+
label: 'Nome bem longo sem quebrar linha',
|
|
83
|
+
icon: { color: 'secondary', type: 'open-in-new' },
|
|
84
|
+
},
|
|
85
|
+
{ label: 'Remover', icon: { color: 'error', type: 'delete' } },
|
|
86
|
+
],
|
|
87
|
+
};
|
|
88
|
+
},
|
|
89
|
+
template: `<div style="padding-left: 80px; display: flex; justify-content: end;">
|
|
90
|
+
<farm-context-menu ref="multi" :items="items" />
|
|
91
|
+
</div>`,
|
|
92
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<farm-contextmenu
|
|
3
|
+
:class="{ 'farm-context-menu': true, 'farm-context-menu--disabled': disabled }"
|
|
4
|
+
v-model="value"
|
|
5
|
+
>
|
|
6
|
+
<template v-slot:activator>
|
|
7
|
+
<farm-btn
|
|
8
|
+
icon
|
|
9
|
+
title="Ver opções"
|
|
10
|
+
color="secondary-green"
|
|
11
|
+
:disabled="disabled"
|
|
12
|
+
@click="toggleValue"
|
|
13
|
+
>
|
|
14
|
+
<farm-icon size="md">dots-horizontal</farm-icon>
|
|
15
|
+
</farm-btn>
|
|
16
|
+
</template>
|
|
17
|
+
<farm-list>
|
|
18
|
+
<farm-listitem
|
|
19
|
+
v-for="item in items"
|
|
20
|
+
clickable
|
|
21
|
+
hoverColorVariation="lighten"
|
|
22
|
+
:key="'tablecontextmenu_item_' + item.label"
|
|
23
|
+
:hoverColor="item.icon.color || 'primary'"
|
|
24
|
+
@click="onClick(item.handler)"
|
|
25
|
+
>
|
|
26
|
+
<farm-icon v-if="item.icon" size="sm" :color="item.icon.color || 'primary'">
|
|
27
|
+
{{ item.icon.type }}
|
|
28
|
+
</farm-icon>
|
|
29
|
+
<farm-caption bold tag="span" :color="item.icon.color || 'primary'">{{
|
|
30
|
+
item.label
|
|
31
|
+
}}</farm-caption>
|
|
32
|
+
</farm-listitem>
|
|
33
|
+
</farm-list>
|
|
34
|
+
</farm-contextmenu>
|
|
35
|
+
</template>
|
|
36
|
+
<script lang="ts">
|
|
37
|
+
import { PropType } from 'vue';
|
|
38
|
+
|
|
39
|
+
export interface IContextMenuOption {
|
|
40
|
+
label: string;
|
|
41
|
+
handler: string;
|
|
42
|
+
icon: IContextMenuOptionIcon;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface IContextMenuOptionIcon {
|
|
46
|
+
color?: string;
|
|
47
|
+
type: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default {
|
|
51
|
+
name: 'farm-context-menu',
|
|
52
|
+
components: {},
|
|
53
|
+
props: {
|
|
54
|
+
/**
|
|
55
|
+
* Items to populate the context menu
|
|
56
|
+
*/
|
|
57
|
+
items: {
|
|
58
|
+
type: Array as PropType<Array<IContextMenuOption>>,
|
|
59
|
+
required: true,
|
|
60
|
+
},
|
|
61
|
+
/**
|
|
62
|
+
* Is disabled?
|
|
63
|
+
*/
|
|
64
|
+
disabled: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: false,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
data() {
|
|
70
|
+
return {
|
|
71
|
+
value: false,
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
methods: {
|
|
75
|
+
onClick(handler) {
|
|
76
|
+
if (handler !== undefined) {
|
|
77
|
+
this.$emit(handler);
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
toggleValue(event: MouseEvent) {
|
|
81
|
+
this.value = !this.value;
|
|
82
|
+
event.stopPropagation();
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
</script>
|
|
87
|
+
<style lang="scss" scoped>
|
|
88
|
+
@import 'TableContextMenu';
|
|
89
|
+
</style>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import TableContextMenu from '../TableContextMenu';
|
|
3
|
+
const items = [{ label: 'Remover', icon: { color: 'error', type: 'delete' }, handler: 'test' }];
|
|
4
|
+
|
|
5
|
+
describe('TableContextMenu component', () => {
|
|
6
|
+
let wrapper;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
wrapper = shallowMount(TableContextMenu, {
|
|
10
|
+
propsData: {
|
|
11
|
+
items,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test('Created hook', () => {
|
|
17
|
+
expect(wrapper).toBeDefined();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
describe('mount component', () => {
|
|
21
|
+
it('renders correctly', () => {
|
|
22
|
+
expect(wrapper.element).toMatchSnapshot();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
describe('computed values', () => {
|
|
27
|
+
it('should items to be created correctly', async () => {
|
|
28
|
+
expect(wrapper.vm.items).toBeInstanceOf(Array);
|
|
29
|
+
expect(wrapper.vm.items).toEqual(items);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
describe('emitted', () => {
|
|
34
|
+
it('should emit event', async () => {
|
|
35
|
+
wrapper.vm.onClick('test');
|
|
36
|
+
await wrapper.vm.$nextTick();
|
|
37
|
+
expect(wrapper.emitted().test).toBeTruthy();
|
|
38
|
+
});
|
|
39
|
+
it('should not emit click event without value', async () => {
|
|
40
|
+
wrapper.vm.onClick();
|
|
41
|
+
await wrapper.vm.$nextTick();
|
|
42
|
+
expect(wrapper.emitted()).toEqual({});
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
@import '../../configurations/theme-colors';
|
|
2
|
+
|
|
3
|
+
.farm-tabs {
|
|
4
|
+
width: 100%;
|
|
5
|
+
}
|
|
6
|
+
.tabs {
|
|
7
|
+
display: flex;
|
|
8
|
+
margin-bottom: -1px;
|
|
9
|
+
|
|
10
|
+
&__tab {
|
|
11
|
+
border-bottom: 1px solid var(--farm-primary-lighten);
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
padding: 18px 24px 14px;
|
|
15
|
+
height: 54px;
|
|
16
|
+
transition: all 0.5s ease;
|
|
17
|
+
&:hover {
|
|
18
|
+
background-color: transparentize(themeColor('primary', 'base'), 0.86);
|
|
19
|
+
|
|
20
|
+
div.rounded-circle {
|
|
21
|
+
opacity: 0.86;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
span {
|
|
26
|
+
font-weight: 400;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&--selected {
|
|
30
|
+
|
|
31
|
+
border-bottom: 4px solid var(--farm-primary-base);
|
|
32
|
+
|
|
33
|
+
span {
|
|
34
|
+
font-size: 14px;
|
|
35
|
+
font-weight: 500;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&--disabled {
|
|
41
|
+
.tabs__tab {
|
|
42
|
+
cursor: default;
|
|
43
|
+
|
|
44
|
+
&:hover {
|
|
45
|
+
background-color: transparent;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&--selected {
|
|
49
|
+
&:hover {
|
|
50
|
+
background-color: transparent;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.farm-tabs {
|
|
58
|
+
border-bottom: 1px solid var(--farm-primary-lighten);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
div.rounded-circle {
|
|
63
|
+
background-color: var(--farm-gray-lighten);
|
|
64
|
+
width: 24px;
|
|
65
|
+
height: 24px;
|
|
66
|
+
margin-top: -2px;
|
|
67
|
+
margin-left: -2px;
|
|
68
|
+
|
|
69
|
+
&.is-selected {
|
|
70
|
+
background-color: var(--farm-primary-base);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import Tabs from './Tabs.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Display/Tabs',
|
|
5
|
+
component: Tabs,
|
|
6
|
+
parameters: {
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: `Tabs<br />
|
|
10
|
+
selector: <em>farm-tabs</em><br />
|
|
11
|
+
<span style="color: var(--farm-primary-base);">ready for use</span>
|
|
12
|
+
`,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
viewMode: 'docs',
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const Primary = () => ({
|
|
20
|
+
data() {
|
|
21
|
+
return {
|
|
22
|
+
v: 'Seleção',
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
methods: {
|
|
26
|
+
updateValue(value) {
|
|
27
|
+
this.v = value.name;
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
template: `<div>
|
|
31
|
+
<farm-tabs @update="updateValue" />
|
|
32
|
+
<p class="mt-2">selected: {{v}}</p>
|
|
33
|
+
</div>`,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export const WithoutCounter = () => ({
|
|
37
|
+
data() {
|
|
38
|
+
return {
|
|
39
|
+
v: 'Seleção',
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
methods: {
|
|
43
|
+
updateValue(value) {
|
|
44
|
+
this.v = value.name;
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
template: `<div>
|
|
48
|
+
<farm-tabs :showCounter="false" @update="updateValue" />
|
|
49
|
+
<p class="mt-2">selected: {{v}}</p>
|
|
50
|
+
</div>`,
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export const Disabled = () => ({
|
|
54
|
+
data() {
|
|
55
|
+
return {
|
|
56
|
+
v: 'Seleção',
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
methods: {
|
|
60
|
+
updateValue(value) {
|
|
61
|
+
this.v = value.name;
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
template: `<div>
|
|
65
|
+
<farm-tabs :showCounter="false" :allow-user-change="false" @update="updateValue" />
|
|
66
|
+
<p class="mt-2">selected: {{v}}</p>
|
|
67
|
+
</div>`,
|
|
68
|
+
});
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="farm-tabs">
|
|
3
|
+
<div class="tabs" :class="{ 'tabs--disabled': !allowUserChange }">
|
|
4
|
+
<div
|
|
5
|
+
v-for="(tab, index) in tabs"
|
|
6
|
+
class="tabs__tab"
|
|
7
|
+
:key="index"
|
|
8
|
+
:class="{ hideCounter: !showCounter, 'tabs__tab--selected': isSelected(index) }"
|
|
9
|
+
@click="changeTab(tab, index)"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
v-if="showCounter"
|
|
13
|
+
class="
|
|
14
|
+
mr-2
|
|
15
|
+
rounded-circle
|
|
16
|
+
d-inline-flex
|
|
17
|
+
align-center
|
|
18
|
+
justify-center
|
|
19
|
+
white--text
|
|
20
|
+
"
|
|
21
|
+
:class="{ 'is-selected': isSelected(index) }"
|
|
22
|
+
>
|
|
23
|
+
<farm-subtitle
|
|
24
|
+
color="white"
|
|
25
|
+
tag="span"
|
|
26
|
+
:type="2"
|
|
27
|
+
:color-variation="isSelected(index) ? 'base' : 'darken'"
|
|
28
|
+
>
|
|
29
|
+
{{ index + 1 }}
|
|
30
|
+
</farm-subtitle>
|
|
31
|
+
</div>
|
|
32
|
+
<farm-subtitle
|
|
33
|
+
tag="span"
|
|
34
|
+
:type="2"
|
|
35
|
+
:color="isSelected(index) ? 'primary' : 'gray'"
|
|
36
|
+
:color-variation="isSelected(index) ? 'base' : 'darken'"
|
|
37
|
+
>
|
|
38
|
+
{{ forceUppercase ? tab.name.toUpperCase() : tab.name }}
|
|
39
|
+
</farm-subtitle>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script lang="ts">
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
export default {
|
|
49
|
+
name: 'farm-tabs',
|
|
50
|
+
data() {
|
|
51
|
+
return {
|
|
52
|
+
selected: 0,
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
props: {
|
|
56
|
+
tabs: {
|
|
57
|
+
type: Array,
|
|
58
|
+
default: () => [
|
|
59
|
+
{
|
|
60
|
+
name: 'Seleção',
|
|
61
|
+
path: 'selection',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'Revisão',
|
|
65
|
+
path: 'review',
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
showCounter: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: true,
|
|
72
|
+
},
|
|
73
|
+
/**
|
|
74
|
+
* Initial tab selected
|
|
75
|
+
*/
|
|
76
|
+
initialSelect: {
|
|
77
|
+
type: Number,
|
|
78
|
+
default: 0,
|
|
79
|
+
},
|
|
80
|
+
allowUserChange: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: true,
|
|
83
|
+
},
|
|
84
|
+
/**
|
|
85
|
+
* Force uppercase in tab
|
|
86
|
+
*/
|
|
87
|
+
forceUppercase: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
default: true,
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
methods: {
|
|
93
|
+
isSelected(index) {
|
|
94
|
+
return index === this.selected;
|
|
95
|
+
},
|
|
96
|
+
changeTab(_, index) {
|
|
97
|
+
if (!this.allowUserChange) return;
|
|
98
|
+
this.selected = index;
|
|
99
|
+
this.$emit('update', this.tabs[index]);
|
|
100
|
+
},
|
|
101
|
+
next() {
|
|
102
|
+
if (this.tabs.length - 1 > this.selected + 1)
|
|
103
|
+
return this.$emit('update', this.tabs[this.selected]);
|
|
104
|
+
this.selected = this.selected + 1;
|
|
105
|
+
this.$emit('update', this.tabs[this.selected]);
|
|
106
|
+
},
|
|
107
|
+
previous() {
|
|
108
|
+
if (this.selected - 1 < 0) return this.$emit('update', this.tabs[this.selected]);
|
|
109
|
+
this.selected = this.selected - 1;
|
|
110
|
+
this.$emit('update', this.tabs[this.selected]);
|
|
111
|
+
},
|
|
112
|
+
toIndex(index) {
|
|
113
|
+
this.selected = index;
|
|
114
|
+
this.$emit('update', this.tabs[index]);
|
|
115
|
+
},
|
|
116
|
+
updateTabRouting: (component, item, nextRoutePrefix) => {
|
|
117
|
+
component.currentTab = item.path;
|
|
118
|
+
const nextRoute = `${nextRoutePrefix}/${item.path}`;
|
|
119
|
+
const currentRoute = component.$router.history.current.path;
|
|
120
|
+
if (nextRoute !== currentRoute) component.$router.push(nextRoute);
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
created() {
|
|
124
|
+
this.selected = this.initialSelect;
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
</script>
|
|
128
|
+
<style scoped lang="scss">
|
|
129
|
+
@import './Tabs.scss';
|
|
130
|
+
</style>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import Tabs from '../Tabs';
|
|
3
|
+
|
|
4
|
+
describe('Tabs component', () => {
|
|
5
|
+
let wrapper;
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
wrapper = shallowMount(Tabs);
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
test('Created hook', () => {
|
|
12
|
+
expect(wrapper).toBeDefined();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
describe('methods', () => {
|
|
16
|
+
it('Should check isSelected', () => {
|
|
17
|
+
expect(wrapper.vm.isSelected(1)).toBeFalsy();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('Should emit event when tab is changed', () => {
|
|
21
|
+
wrapper.vm.changeTab();
|
|
22
|
+
expect(wrapper.emitted().update).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('Should emit event when next is triggeredx', () => {
|
|
26
|
+
wrapper.vm.next();
|
|
27
|
+
expect(wrapper.emitted().update).toBeTruthy();
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('Should emit event when previous is triggered', () => {
|
|
31
|
+
wrapper.vm.previous();
|
|
32
|
+
expect(wrapper.emitted().update).toBeTruthy();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('Should emit event when toIndex is triggered', () => {
|
|
36
|
+
wrapper.vm.toIndex(1);
|
|
37
|
+
expect(wrapper.vm.selected).toEqual(1);
|
|
38
|
+
expect(wrapper.emitted().update).toBeTruthy();
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('Should updateTab in parent and route', () => {
|
|
42
|
+
const _component = {
|
|
43
|
+
currentTab: '',
|
|
44
|
+
$router: {
|
|
45
|
+
history: {
|
|
46
|
+
current: {
|
|
47
|
+
path: 'some',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
push: () => {},
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
const spyObj = jest.spyOn(_component.$router, 'push');
|
|
54
|
+
wrapper.vm.updateTabRouting(_component, { path: 'desembolso' }, 'nextRoutePrefix');
|
|
55
|
+
expect(_component.currentTab).toEqual('desembolso');
|
|
56
|
+
expect(spyObj).toHaveBeenCalled();
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
@import '../../configurations/mixins';
|
|
2
|
+
|
|
3
|
+
.farm-textarea {
|
|
4
|
+
min-height: 64px;
|
|
5
|
+
|
|
6
|
+
&--hiddendetails {
|
|
7
|
+
height: auto;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&--textarea {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: 8px;
|
|
14
|
+
border: 1px solid;
|
|
15
|
+
border-color: var(--farm-bw-black-10);
|
|
16
|
+
min-height: 36px;
|
|
17
|
+
border-radius: 5px;
|
|
18
|
+
padding: 8px 0 0 8px;
|
|
19
|
+
margin-bottom: 4px;
|
|
20
|
+
background-color: white;
|
|
21
|
+
width: 100%;
|
|
22
|
+
|
|
23
|
+
& > textarea {
|
|
24
|
+
flex: 1;
|
|
25
|
+
outline: none;
|
|
26
|
+
color: var(--farm-bw-black-50);
|
|
27
|
+
font-size: 12px;
|
|
28
|
+
font-weight: 400;
|
|
29
|
+
max-width: 100%;
|
|
30
|
+
max-height: 100%;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&--focused .farm-textarea--textarea {
|
|
35
|
+
border-color: var(--farm-bw-black-30);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&--disabled {
|
|
39
|
+
textarea {
|
|
40
|
+
color: var(--farm-bw-black-30);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.farm-caption {
|
|
45
|
+
line-height: 12px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&__hint-text {
|
|
49
|
+
@include hintText;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.farm-textarea--touched.farm-textarea--validatable {
|
|
54
|
+
&.farm-textarea--error {
|
|
55
|
+
.farm-textarea {
|
|
56
|
+
&--textarea {
|
|
57
|
+
border-color: var(--farm-error-base);
|
|
58
|
+
|
|
59
|
+
& > textarea {
|
|
60
|
+
color: var(--farm-neutral-darken);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.farm-textarea--blured.farm-textarea--validatable:not(.farm-textarea--error) {
|
|
68
|
+
.farm-textarea--textarea {
|
|
69
|
+
border-color: var(--farm-primary-base);
|
|
70
|
+
|
|
71
|
+
& > textarea {
|
|
72
|
+
color: var(--farm-neutral-darken);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|