@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,133 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<farm-tooltip v-model="show" :color="tooltipColor || buttonColor">
|
|
3
|
+
{{ feedbackMessage }}
|
|
4
|
+
<template v-slot:activator="{}">
|
|
5
|
+
<farm-btn
|
|
6
|
+
v-if="isIcon"
|
|
7
|
+
title="Copiar"
|
|
8
|
+
icon
|
|
9
|
+
:disabled="disabled"
|
|
10
|
+
:color="buttonColor"
|
|
11
|
+
@click="onClick"
|
|
12
|
+
>
|
|
13
|
+
<farm-icon :size="sizeIcon">content-copy</farm-icon>
|
|
14
|
+
</farm-btn>
|
|
15
|
+
<farm-btn v-else outlined title="Copiar" :disabled="disabled" @click="onClick">
|
|
16
|
+
<farm-icon :size="sizeIcon">content-copy</farm-icon>
|
|
17
|
+
Copiar
|
|
18
|
+
</farm-btn>
|
|
19
|
+
</template>
|
|
20
|
+
</farm-tooltip>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script lang="ts">
|
|
24
|
+
import { PropType, ref, toRefs } from 'vue';
|
|
25
|
+
import { toClipboard } from '@farm-investimentos/front-mfe-libs-ts';
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
name: 'farm-copytoclipboard',
|
|
29
|
+
props: {
|
|
30
|
+
/**
|
|
31
|
+
* Content to be copied to clipboard
|
|
32
|
+
*/
|
|
33
|
+
toCopy: { type: String, required: true },
|
|
34
|
+
/**
|
|
35
|
+
* Is button with icon?
|
|
36
|
+
*/
|
|
37
|
+
isIcon: { type: Boolean, default: true },
|
|
38
|
+
/**
|
|
39
|
+
* sizeIcon: icon size setting
|
|
40
|
+
*/
|
|
41
|
+
sizeIcon: {
|
|
42
|
+
type: String as PropType<
|
|
43
|
+
'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'other (examples: 12px, 3rem)'
|
|
44
|
+
>,
|
|
45
|
+
default: 'xs',
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* Success message content after copy
|
|
49
|
+
*/
|
|
50
|
+
successMessage: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: 'Conteúdo copiado para a área de trabalho',
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* Button color
|
|
56
|
+
*/
|
|
57
|
+
buttonColor: {
|
|
58
|
+
type: String as PropType<
|
|
59
|
+
| 'primary'
|
|
60
|
+
| 'secondary'
|
|
61
|
+
| 'secondary-green'
|
|
62
|
+
| 'secondary-golden'
|
|
63
|
+
| 'neutral'
|
|
64
|
+
| 'info'
|
|
65
|
+
| 'success'
|
|
66
|
+
| 'error'
|
|
67
|
+
| 'warning'
|
|
68
|
+
| 'extra-1'
|
|
69
|
+
| 'extra-2'
|
|
70
|
+
>,
|
|
71
|
+
default: 'primary',
|
|
72
|
+
},
|
|
73
|
+
/**
|
|
74
|
+
* Tooltip color
|
|
75
|
+
*/
|
|
76
|
+
tooltipColor: {
|
|
77
|
+
type: String as PropType<
|
|
78
|
+
| 'primary'
|
|
79
|
+
| 'secondary'
|
|
80
|
+
| 'secondary-green'
|
|
81
|
+
| 'secondary-golden'
|
|
82
|
+
| 'neutral'
|
|
83
|
+
| 'info'
|
|
84
|
+
| 'success'
|
|
85
|
+
| 'error'
|
|
86
|
+
| 'warning'
|
|
87
|
+
| 'extra-1'
|
|
88
|
+
| 'extra-2'
|
|
89
|
+
>,
|
|
90
|
+
default: null,
|
|
91
|
+
},
|
|
92
|
+
/**
|
|
93
|
+
* Success message timeout (in ms)
|
|
94
|
+
*/
|
|
95
|
+
successTimeout: {
|
|
96
|
+
type: [Number, String],
|
|
97
|
+
default: 2000,
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
setup(props) {
|
|
101
|
+
const show = ref(false);
|
|
102
|
+
const feedbackMessage = ref('');
|
|
103
|
+
const disabled = ref(false);
|
|
104
|
+
const sizeIcon = ref(props.sizeIcon);
|
|
105
|
+
const { toCopy, isIcon, successMessage, successTimeout } = toRefs(props);
|
|
106
|
+
|
|
107
|
+
const onClick = async () => {
|
|
108
|
+
disabled.value = true;
|
|
109
|
+
try {
|
|
110
|
+
await toClipboard(toCopy.value);
|
|
111
|
+
feedbackMessage.value = successMessage.value;
|
|
112
|
+
} catch (e) {
|
|
113
|
+
feedbackMessage.value = 'Ocorreu um erro: ' + e;
|
|
114
|
+
}
|
|
115
|
+
show.value = true;
|
|
116
|
+
|
|
117
|
+
setTimeout(() => {
|
|
118
|
+
show.value = false;
|
|
119
|
+
disabled.value = false;
|
|
120
|
+
}, parseInt(successTimeout.value as string, 10));
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
return {
|
|
124
|
+
show,
|
|
125
|
+
isIcon,
|
|
126
|
+
sizeIcon,
|
|
127
|
+
feedbackMessage,
|
|
128
|
+
disabled,
|
|
129
|
+
onClick,
|
|
130
|
+
};
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
</script>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import CopyToClipboard from '../CopyToClipboard';
|
|
3
|
+
|
|
4
|
+
describe('CopyToClipboard component', () => {
|
|
5
|
+
let wrapper;
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
wrapper = shallowMount(CopyToClipboard, {
|
|
9
|
+
propsData: {
|
|
10
|
+
toCopy: 'test',
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test('Created hook', () => {
|
|
16
|
+
expect(wrapper).toBeDefined();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
describe('mount component', () => {
|
|
20
|
+
it('renders correctly', () => {
|
|
21
|
+
expect(wrapper.element).toMatchSnapshot();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
div {
|
|
2
|
+
padding: 64px 24px 32px;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
text-align: center;
|
|
7
|
+
|
|
8
|
+
p {
|
|
9
|
+
&:first-of-type {
|
|
10
|
+
margin: 24px auto;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&.farm-emptywrapper--bordered {
|
|
15
|
+
border-top: 1px solid var(--farm-stroke-divider);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import DataTableEmptyWrapper from './DataTableEmptyWrapper.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Display/Table/DataTableEmptyWrapper',
|
|
5
|
+
component: DataTableEmptyWrapper,
|
|
6
|
+
parameters: {
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: `Message for empty list/data<br />
|
|
10
|
+
selector: <em>farm-emptywrapper</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
|
+
template: '<farm-emptywrapper />',
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export const CustomTitles = () => ({
|
|
24
|
+
template:
|
|
25
|
+
'<farm-emptywrapper title="Título customizado" subtitle="Subtítulo customizado" />',
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export const NoBorder = () => ({
|
|
29
|
+
template: '<farm-emptywrapper :bordered="false" />',
|
|
30
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="{
|
|
4
|
+
'farm-emptywrapper': true,
|
|
5
|
+
'farm-emptywrapper--bordered': bordered,
|
|
6
|
+
}"
|
|
7
|
+
>
|
|
8
|
+
<farm-icon size="xl" color="gray">magnify</farm-icon>
|
|
9
|
+
<farm-bodytext type="2" variation="bold" color="black" color-variation="40">
|
|
10
|
+
{{ title }}
|
|
11
|
+
</farm-bodytext>
|
|
12
|
+
<farm-caption v-if="subtitle" variation="regular" color-variation="30">
|
|
13
|
+
{{ subtitle }}
|
|
14
|
+
</farm-caption>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
<script lang="ts">
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
name: 'farm-emptywrapper',
|
|
22
|
+
props: {
|
|
23
|
+
/**
|
|
24
|
+
* Title
|
|
25
|
+
*/
|
|
26
|
+
title: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: 'Nenhuma informação para exibir aqui',
|
|
29
|
+
},
|
|
30
|
+
/**
|
|
31
|
+
* Subtitle
|
|
32
|
+
*/
|
|
33
|
+
subtitle: {
|
|
34
|
+
type: String,
|
|
35
|
+
default:
|
|
36
|
+
'Tente filtrar novamente sua pesquisa.',
|
|
37
|
+
},
|
|
38
|
+
/**
|
|
39
|
+
* Has border?
|
|
40
|
+
*/
|
|
41
|
+
bordered: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: true,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
</script>
|
|
48
|
+
<style scoped lang="scss">
|
|
49
|
+
@import './DataTableEmptyWrapper';
|
|
50
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import DataTableEmptyWrapper from '../DataTableEmptyWrapper';
|
|
3
|
+
|
|
4
|
+
describe('DataTableEmptyWrapper component', () => {
|
|
5
|
+
let wrapper;
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
wrapper = shallowMount(DataTableEmptyWrapper, {});
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
test('Created hook', () => {
|
|
12
|
+
expect(wrapper).toBeDefined();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
describe('mount component', () => {
|
|
16
|
+
it('renders correctly', () => {
|
|
17
|
+
expect(wrapper.element).toMatchSnapshot();
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
.header-text {
|
|
2
|
+
position: relative;
|
|
3
|
+
color: var(--farm-secondary-green-darken);
|
|
4
|
+
font-size: 14px;
|
|
5
|
+
font-weight: 700;
|
|
6
|
+
|
|
7
|
+
.farm-icon {
|
|
8
|
+
position: absolute;
|
|
9
|
+
right: -20px;
|
|
10
|
+
top: -1px;
|
|
11
|
+
transition: transform 0.8s ease-in-out;
|
|
12
|
+
|
|
13
|
+
&.farm-icon--asc {
|
|
14
|
+
transform: rotateX(180deg);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
th.sortable {
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
.farm-icon::before {
|
|
22
|
+
transition: all 0.3s linear;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&:not(.active) {
|
|
26
|
+
&:hover {
|
|
27
|
+
.farm-icon::before {
|
|
28
|
+
color: var(--farm-bw-black-10) !important;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
th span.span-checkbox {
|
|
35
|
+
display: flex;
|
|
36
|
+
justify-content: flex-start;
|
|
37
|
+
padding-left: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
thead {
|
|
41
|
+
height: 51px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
th {
|
|
45
|
+
color: var(--farm-secondary-base);
|
|
46
|
+
font-size: 14px;
|
|
47
|
+
font-weight: 700;
|
|
48
|
+
text-transform: uppercase;
|
|
49
|
+
box-shadow: 0px -1px 0px var(--farm-gray-lighten), 0px 1px 0px var(--farm-gray-lighten);
|
|
50
|
+
&.checkbox-container {
|
|
51
|
+
width: 60px !important;
|
|
52
|
+
min-width: 60px !important;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:deep(.mdi-sort-reverse-variant)::before {
|
|
57
|
+
color: var(--farm-bw-black-30);
|
|
58
|
+
font-size: 16px;
|
|
59
|
+
font-weight: 400;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.farm-icon--desc,
|
|
63
|
+
.farm-icon--asc {
|
|
64
|
+
margin-top: 3px;
|
|
65
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// import { withDesign } from 'storybook-addon-designs';
|
|
2
|
+
import DataTableHeader from './DataTableHeader.vue';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Display/Table/DataTableHeader',
|
|
6
|
+
component: DataTableHeader,
|
|
7
|
+
// decorators: [withDesign],
|
|
8
|
+
parameters: {
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component: `DataTable Header<br />
|
|
12
|
+
selector: <em>farm-datatable-header</em><br />
|
|
13
|
+
<span style="color: var(--farm-primary-base);">ready for use</span>
|
|
14
|
+
`,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
viewMode: 'docs',
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const Primary = () => ({
|
|
22
|
+
data() {
|
|
23
|
+
return {
|
|
24
|
+
headers,
|
|
25
|
+
sortClick: [],
|
|
26
|
+
firstSelected: true,
|
|
27
|
+
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
template: `<farm-datatable-header
|
|
31
|
+
:headers="headers"
|
|
32
|
+
:sortClick="sortClick"
|
|
33
|
+
:showCheckbox="false"
|
|
34
|
+
:firstSelected="firstSelected"
|
|
35
|
+
:selectedIndex="1"
|
|
36
|
+
/>`,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const SetDescInititalOrder = () => ({
|
|
40
|
+
data() {
|
|
41
|
+
let customHeaders = [...headers];
|
|
42
|
+
customHeaders[1].order = 'DESC';
|
|
43
|
+
return {
|
|
44
|
+
headers: customHeaders,
|
|
45
|
+
sortClick: [],
|
|
46
|
+
firstSelected: true,
|
|
47
|
+
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
template: `<farm-datatable-header
|
|
51
|
+
:headers="headers"
|
|
52
|
+
:sortClick="sortClick"
|
|
53
|
+
:showCheckbox="false"
|
|
54
|
+
:firstSelected="firstSelected"
|
|
55
|
+
:selectedIndex="1"
|
|
56
|
+
/>`,
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export const CheckBox = () => ({
|
|
60
|
+
data() {
|
|
61
|
+
return {
|
|
62
|
+
headers: [
|
|
63
|
+
{
|
|
64
|
+
text: 'check',
|
|
65
|
+
sortable: true,
|
|
66
|
+
value: 'data-table-select',
|
|
67
|
+
align: 'left',
|
|
68
|
+
},
|
|
69
|
+
...headers,
|
|
70
|
+
],
|
|
71
|
+
headerProps,
|
|
72
|
+
sortClick: [],
|
|
73
|
+
firstSelected: false,
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
template: `<farm-datatable-header
|
|
77
|
+
:headers="headers"
|
|
78
|
+
:headerProps="headerProps"
|
|
79
|
+
:sortClick="sortClick"
|
|
80
|
+
:firstSelected="firstSelected"
|
|
81
|
+
:showCheckbox="true"
|
|
82
|
+
:selectedIndex="1" />`,
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const headerProps = { someItems: true, everyItem: true };
|
|
86
|
+
|
|
87
|
+
const headers = [
|
|
88
|
+
{
|
|
89
|
+
text: 'Grupo',
|
|
90
|
+
sortable: true,
|
|
91
|
+
value: 'name',
|
|
92
|
+
align: 'left',
|
|
93
|
+
width: 120,
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
text: 'Aprovado',
|
|
97
|
+
sortable: true,
|
|
98
|
+
value: 'approvedAmount',
|
|
99
|
+
align: 'center',
|
|
100
|
+
width: 160,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
text: 'Disponível',
|
|
104
|
+
sortable: false,
|
|
105
|
+
value: 'availableAmount',
|
|
106
|
+
align: 'center',
|
|
107
|
+
width: 160,
|
|
108
|
+
},
|
|
109
|
+
];
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<thead>
|
|
3
|
+
<tr>
|
|
4
|
+
<th
|
|
5
|
+
v-for="(item, $index) in headers"
|
|
6
|
+
:key="item.value"
|
|
7
|
+
v-bind:class="[
|
|
8
|
+
item.sortable ? 'sortable' : '',
|
|
9
|
+
sortClick[$index].clicked ? 'active' : '',
|
|
10
|
+
item.sortable ? (sortClick[$index].descending === 'DESC' ? 'DESC' : 'ASC') : '',
|
|
11
|
+
showCheckbox && $index == 0 ? 'checkbox-container' : '',
|
|
12
|
+
]"
|
|
13
|
+
v-bind:style="{
|
|
14
|
+
textAlign: item.align ? item.align : '',
|
|
15
|
+
width: thWidth(item),
|
|
16
|
+
minWidth: thWidth(item),
|
|
17
|
+
}"
|
|
18
|
+
@click="item.sortable ? clickSort(item.value, $index) : ''"
|
|
19
|
+
@mouseover="changeShow($index)"
|
|
20
|
+
@mouseout="changeHidden($index)"
|
|
21
|
+
>
|
|
22
|
+
<span
|
|
23
|
+
class="header-text"
|
|
24
|
+
v-if="!isTHDataTableSelect(item)"
|
|
25
|
+
:title="
|
|
26
|
+
item.sortable && sortClick[$index].show ? `Ordernar por ${item.text}` : null
|
|
27
|
+
"
|
|
28
|
+
>
|
|
29
|
+
{{ item.text }}
|
|
30
|
+
|
|
31
|
+
<farm-icon
|
|
32
|
+
v-if="item.sortable && sortClick[$index].show"
|
|
33
|
+
v-bind:class="[
|
|
34
|
+
sortClick[$index][item.value] ? 'farm-icon--desc' : 'farm-icon--asc',
|
|
35
|
+
]"
|
|
36
|
+
class="ml-2"
|
|
37
|
+
size="16px"
|
|
38
|
+
color="black"
|
|
39
|
+
variation="30"
|
|
40
|
+
>
|
|
41
|
+
sort-reverse-variant
|
|
42
|
+
</farm-icon>
|
|
43
|
+
</span>
|
|
44
|
+
|
|
45
|
+
<span v-if="isTHDataTableSelect(item) && showCheckbox" class="span-checkbox">
|
|
46
|
+
<farm-checkbox
|
|
47
|
+
size="sm"
|
|
48
|
+
v-model="inputVal"
|
|
49
|
+
:value="true"
|
|
50
|
+
:indeterminate="headerProps.someItems && !headerProps.everyItem"
|
|
51
|
+
@input="selectAll"
|
|
52
|
+
/>
|
|
53
|
+
</span>
|
|
54
|
+
</th>
|
|
55
|
+
</tr>
|
|
56
|
+
</thead>
|
|
57
|
+
</template>
|
|
58
|
+
|
|
59
|
+
<script lang="ts">
|
|
60
|
+
/* eslint-disable */
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
export default {
|
|
64
|
+
name: 'farm-datatable-header',
|
|
65
|
+
props: {
|
|
66
|
+
/**
|
|
67
|
+
* Headers
|
|
68
|
+
*/
|
|
69
|
+
headers: {
|
|
70
|
+
type: Array,
|
|
71
|
+
required: true,
|
|
72
|
+
},
|
|
73
|
+
/**
|
|
74
|
+
* Array para controle da exibição da ordenação
|
|
75
|
+
*/
|
|
76
|
+
sortClick: {
|
|
77
|
+
type: Array,
|
|
78
|
+
required: true,
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* Começar selecionado
|
|
82
|
+
*/
|
|
83
|
+
firstSelected: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
default: false,
|
|
86
|
+
},
|
|
87
|
+
/**
|
|
88
|
+
* Index do item do cabeçalho que deve começar selecionado
|
|
89
|
+
*/
|
|
90
|
+
selectedIndex: {
|
|
91
|
+
type: Number,
|
|
92
|
+
default: 0,
|
|
93
|
+
},
|
|
94
|
+
/**
|
|
95
|
+
* v-model for data-table-select
|
|
96
|
+
*/
|
|
97
|
+
value: {
|
|
98
|
+
default: false,
|
|
99
|
+
},
|
|
100
|
+
/**
|
|
101
|
+
* Original header props
|
|
102
|
+
*/
|
|
103
|
+
headerProps: {
|
|
104
|
+
type: Object,
|
|
105
|
+
},
|
|
106
|
+
/**
|
|
107
|
+
* Hide/show checkbox
|
|
108
|
+
*/
|
|
109
|
+
showCheckbox: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: true,
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
computed: {
|
|
115
|
+
inputVal: {
|
|
116
|
+
get() {
|
|
117
|
+
return this.value;
|
|
118
|
+
},
|
|
119
|
+
set(val) {
|
|
120
|
+
this.$emit('input', val);
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
methods: {
|
|
125
|
+
getTypeSort(value) {
|
|
126
|
+
return value ? 'DESC' : 'ASC';
|
|
127
|
+
},
|
|
128
|
+
clickSort(value, index) {
|
|
129
|
+
const isClicked = this.sortClick[index].clicked;
|
|
130
|
+
this.removeClicked();
|
|
131
|
+
this.sortClick[index].clicked = true;
|
|
132
|
+
this.sortClick[index].show = true;
|
|
133
|
+
if (isClicked) {
|
|
134
|
+
this.sortClick[index][value] = !this.sortClick[index][value];
|
|
135
|
+
}
|
|
136
|
+
this.sortClick[index].descending = this.getTypeSort(this.sortClick[index][value]);
|
|
137
|
+
this.$emit('onClickSort', this.sortClick[index]);
|
|
138
|
+
},
|
|
139
|
+
changeShow(index) {
|
|
140
|
+
setTimeout(() => {
|
|
141
|
+
this.sortClick[index].show = true;
|
|
142
|
+
}, 10);
|
|
143
|
+
},
|
|
144
|
+
changeHidden(index) {
|
|
145
|
+
setTimeout(() => {
|
|
146
|
+
if (this.sortClick[index].clicked) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
this.sortClick[index].show = false;
|
|
150
|
+
}, 10);
|
|
151
|
+
},
|
|
152
|
+
removeClicked() {
|
|
153
|
+
for (let i = 0; i < this.sortClick.length; i += 1) {
|
|
154
|
+
this.sortClick[i].clicked = false;
|
|
155
|
+
this.sortClick[i].show = false;
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
checkFirstSelected(index) {
|
|
159
|
+
if (index === this.selectedIndex) {
|
|
160
|
+
return this.firstSelected;
|
|
161
|
+
}
|
|
162
|
+
return false;
|
|
163
|
+
},
|
|
164
|
+
thWidth(item) {
|
|
165
|
+
if (this.isTHDataTableSelect(item)) {
|
|
166
|
+
return '72px';
|
|
167
|
+
}
|
|
168
|
+
return item.width ? item.width + 'px' : 'auto';
|
|
169
|
+
},
|
|
170
|
+
isTHDataTableSelect(item) {
|
|
171
|
+
return item.value === 'data-table-select';
|
|
172
|
+
},
|
|
173
|
+
selectAll(value) {
|
|
174
|
+
this.$emit('toggleSelectAll', value);
|
|
175
|
+
this.inputVal = value;
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
created() {
|
|
179
|
+
for (let i = 0; i < this.headers.length; i += 1) {
|
|
180
|
+
this.sortClick.push({
|
|
181
|
+
[this.headers[i].value]:
|
|
182
|
+
this.firstSelected &&
|
|
183
|
+
i === this.selectedIndex &&
|
|
184
|
+
this.headers[i].order === 'DESC',
|
|
185
|
+
descending: this.headers[i].order || 'ASC',
|
|
186
|
+
field: this.headers[i].value,
|
|
187
|
+
clicked: this.checkFirstSelected(i),
|
|
188
|
+
show: this.checkFirstSelected(i),
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
};
|
|
193
|
+
</script>
|
|
194
|
+
|
|
195
|
+
<style lang="scss" scoped>
|
|
196
|
+
@import './DataTableHeader.scss';
|
|
197
|
+
</style>
|