@farm-investimentos/front-mfe-components 3.3.0 → 3.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/front-mfe-components.common.js +159 -32
  2. package/dist/front-mfe-components.common.js.map +1 -1
  3. package/dist/front-mfe-components.css +1 -1
  4. package/dist/front-mfe-components.umd.js +159 -32
  5. package/dist/front-mfe-components.umd.js.map +1 -1
  6. package/dist/front-mfe-components.umd.min.js +1 -1
  7. package/dist/front-mfe-components.umd.min.js.map +1 -1
  8. package/package.json +2 -2
  9. package/src/components/AlertReload/AlertReload.stories.js +1 -1
  10. package/src/components/Buttons/ConfirmButton/ConfirmButton.stories.js +1 -1
  11. package/src/components/Buttons/DangerButton/DangerButton.stories.js +1 -1
  12. package/src/components/Buttons/DefaultButton/DefaultButton.stories.js +1 -1
  13. package/src/components/Buttons/ExportButton/ExportButton.stories.js +1 -1
  14. package/src/components/Buttons/ImportButton/ImportButton.stories.js +1 -1
  15. package/src/components/Buttons/MultiImportButton/MultiImportButton.stories.js +1 -1
  16. package/src/components/Buttons/RemoveButton/RemoveButton.stories.js +1 -1
  17. package/src/components/Buttons/ToggleButton/ToggleButton.stories.js +1 -1
  18. package/src/components/CardContext/CardContext.stories.js +1 -1
  19. package/src/components/ChipInviteStatus/ChipInviteStatus.scss +26 -0
  20. package/src/components/ChipInviteStatus/ChipInviteStatus.stories.js +21 -0
  21. package/src/components/ChipInviteStatus/ChipInviteStatus.vue +75 -0
  22. package/src/components/ChipInviteStatus/__tests__/ChipInviteStatus.spec.js +36 -0
  23. package/src/components/ChipInviteStatus/index.js +4 -0
  24. package/src/components/DataTableEmptyWrapper/DataTableEmptyWrapper.stories.js +1 -1
  25. package/src/components/DataTableHeader/DataTableHeader.stories.js +1 -1
  26. package/src/components/DataTablePaginator/DataTablePaginator.stories.js +25 -5
  27. package/src/components/DatePicker/DatePicker.stories.js +1 -1
  28. package/src/components/DefaultTextField/DefaultTextField.stories.js +1 -1
  29. package/src/components/DialogFooter/DialogFooter.stories.js +1 -1
  30. package/src/components/DialogHeader/DialogHeader.stories.js +1 -1
  31. package/src/components/FilePicker/FilePicker.stories.js +1 -1
  32. package/src/components/IconBox/IconBox.stories.js +1 -1
  33. package/src/components/Loader/Loader.stories.js +1 -1
  34. package/src/components/Logos/OriginatorLogo/OriginatorLogo.stories.js +1 -1
  35. package/src/components/Logos/ProductLogo/ProductLogo.stories.js +1 -1
  36. package/src/components/MainFilter/MainFilter.stories.js +1 -1
  37. package/src/components/ManagersList/ManagersList.stories.js +1 -1
  38. package/src/components/ModalPromptUser/ModalPromptUser.stories.js +1 -1
  39. package/src/components/MultipleSelectShortener/MultipleSelectShortener.stories.js +1 -1
  40. package/src/components/PromptUserToConfirm/PromptUserToConfirm.stories.js +1 -1
  41. package/src/components/RangeDatePicker/RangeDatePicker.stories.js +23 -4
  42. package/src/components/ResetTableRowSelection/ResetTableRowSelection.stories.js +1 -1
  43. package/src/components/SelectModalOptions/SelectModalOptions.stories.js +1 -1
  44. package/src/components/TableContextMenu/TableContextMenu.stories.js +1 -1
  45. package/src/components/Tabs/Tabs.stories.js +1 -1
  46. package/src/examples/Modal.stories.js +47 -0
  47. package/src/examples/Table.stories.js +84 -0
  48. package/src/main.js +1 -0
  49. package/src/scss/Status-Chip.scss +5 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farm-investimentos/front-mfe-components",
3
- "version": "3.3.0",
3
+ "version": "3.4.2",
4
4
  "author": "farm investimentos",
5
5
  "private": false,
6
6
  "main": "./dist/front-mfe-components.common.js",
@@ -45,7 +45,7 @@
45
45
  "eslint": "^6.7.2",
46
46
  "eslint-plugin-vue": "^6.2.2",
47
47
  "jest": "^25.5.4",
48
- "jsdoc": "^3.6.7",
48
+ "storybook-addon-designs": "^6.2.1",
49
49
  "vue-template-compiler": "^2.6.11",
50
50
  "webpack-cli": "^4.9.0"
51
51
  },
@@ -1,7 +1,7 @@
1
1
  import AlertReload from './AlertReload.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/AlertReload',
4
+ title: 'API/AlertReload',
5
5
  component: AlertReload,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import ConfirmButton from './ConfirmButton.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/Buttons/Confirm',
4
+ title: 'API/Buttons/Confirm',
5
5
  component: ConfirmButton,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import DangerButton from './DangerButton.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/Buttons/DangerButton',
4
+ title: 'API/Buttons/DangerButton',
5
5
  component: DangerButton,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import DefaultButton from './DefaultButton.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/Buttons/Default',
4
+ title: 'API/Buttons/Default',
5
5
  component: DefaultButton,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import ExportButton from './ExportButton.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/Buttons/Export',
4
+ title: 'API/Buttons/Export',
5
5
  component: ExportButton,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import ImportButton from './ImportButton.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/Buttons/Import',
4
+ title: 'API/Buttons/Import',
5
5
  component: ImportButton,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import MultiImport from './MultiImportButton.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/Buttons/MultiImport',
4
+ title: 'API/Buttons/MultiImport',
5
5
  component: MultiImport,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import RemoveButton from './RemoveButton.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/Buttons/Remove',
4
+ title: 'API/Buttons/Remove',
5
5
  component: RemoveButton,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import ToggleButton from './ToggleButton.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/Buttons/ToggleButton',
4
+ title: 'API/Buttons/ToggleButton',
5
5
  component: ToggleButton,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import CardContext from './CardContext.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/CardContext',
4
+ title: 'API/CardContext',
5
5
  component: CardContext,
6
6
  };
7
7
 
@@ -0,0 +1,26 @@
1
+ .status-chip--onboarding {
2
+ font-weight: bold;
3
+ .status-chip-yellow {
4
+ color: black;
5
+ }
6
+ &.status-chip.status-chip-accent {
7
+ color: var(--v-accent-base) !important;
8
+ border: 2px solid var(--v-accent-base) !important;
9
+ background-color: white !important;
10
+ }
11
+ &.status-chip.status-chip-yellow {
12
+ color: black !important;
13
+ border: 2px solid var(--v-yellow-lighten1) !important;
14
+ background-color: white !important;
15
+ }
16
+ &.status-chip.status-chip-error {
17
+ color: var(--v-error-base) !important;
18
+ border: 2px solid var(--v-error-base) !important;
19
+ background-color: white !important;
20
+ }
21
+ &.status-chip.status-chip-success {
22
+ color: var(--v-secondary-base) !important;
23
+ border: 2px solid var(--v-success-base) !important;
24
+ background-color: white !important;
25
+ }
26
+ }
@@ -0,0 +1,21 @@
1
+ import ChipInviteStatus from './ChipInviteStatus.vue';
2
+
3
+ export default {
4
+ title: 'API/Onboarding/ChipInviteStatus',
5
+ component: ChipInviteStatus,
6
+ };
7
+
8
+ export const Primary = () => ({
9
+ components: { ChipInviteStatus },
10
+ template: `<div style="width: 120px;">
11
+ <ChipInviteStatus :status="10" />
12
+ <ChipInviteStatus :status="11" />
13
+ <ChipInviteStatus :status="12" />
14
+ <ChipInviteStatus :status="13" />
15
+ <ChipInviteStatus :status="14" />
16
+ <ChipInviteStatus :status="15" />
17
+ <ChipInviteStatus :status="16" />
18
+ </div>`,
19
+ });
20
+
21
+ Primary.storyName = 'Básico';
@@ -0,0 +1,75 @@
1
+ <template>
2
+ <v-chip
3
+ small
4
+ :class="
5
+ `status-chip ${
6
+ isFull ? 'status-chip--fullwidth' : ''
7
+ } status-chip-${color} status-chip--onboarding`
8
+ "
9
+ >
10
+ <span :class="`${textColor}--text`">
11
+ {{ label }}
12
+ </span>
13
+ </v-chip>
14
+ </template>
15
+ <script>
16
+ import Vue from 'vue';
17
+ const StatusLabel = {
18
+ 10: 'CONVIDAR',
19
+ 11: 'CONVIDADO',
20
+ 12: 'INCOMPLETO',
21
+ 13: 'CONCLUÍDO',
22
+ 14: 'FALHA/ERRO',
23
+ 15: 'EM ANÁLISE',
24
+ 16: 'EM ANDAMENTO',
25
+ };
26
+
27
+ const StatusColor = {
28
+ 10: 'secondary',
29
+ 11: 'yellow',
30
+ 12: 'yellow',
31
+ 13: 'success',
32
+ 14: 'error',
33
+ 15: 'accent',
34
+ 16: 'primary',
35
+ };
36
+
37
+ import VChip from 'vuetify/lib/components/VChip/';
38
+
39
+ export default Vue.extend({
40
+ name: 'farm-chip-invite',
41
+ components: {
42
+ VChip,
43
+ },
44
+ props: {
45
+ /**
46
+ * Invite status
47
+ */
48
+ status: {
49
+ type: Number,
50
+ default: 10,
51
+ },
52
+ /**
53
+ * Full width (from parent)
54
+ */
55
+ isFull: {
56
+ type: Boolean,
57
+ default: true,
58
+ },
59
+ },
60
+ computed: {
61
+ textColor() {
62
+ return this.status === 10 || this.status === 16 ? '' : StatusColor[this.status];
63
+ },
64
+ color() {
65
+ return !this.status ? '' : StatusColor[this.status];
66
+ },
67
+ label() {
68
+ return StatusLabel[this.status];
69
+ },
70
+ },
71
+ });
72
+ </script>
73
+ <style lang="scss" scoped>
74
+ @import './ChipInviteStatus.scss';
75
+ </style>
@@ -0,0 +1,36 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import ChipInviteStatus from '../ChipInviteStatus.vue';
3
+ describe('ChipInviteStatus component', () => {
4
+ let wrapper;
5
+ let component;
6
+
7
+ beforeEach(() => {
8
+ wrapper = shallowMount(ChipInviteStatus, {
9
+ propsData: {
10
+ status: 10,
11
+ },
12
+ });
13
+ component = wrapper.vm;
14
+ });
15
+ test('ChipInviteStatus created', () => {
16
+ expect(wrapper).toBeDefined();
17
+ });
18
+
19
+ describe('mount component', () => {
20
+ it('renders correctly', () => {
21
+ expect(wrapper.element).toMatchSnapshot();
22
+ });
23
+ });
24
+
25
+ describe('Computed properties', () => {
26
+ it('Should have text color', () => {
27
+ expect(component.textColor).toBeDefined();
28
+ });
29
+ it('Should have color', () => {
30
+ expect(component.color).toBeDefined();
31
+ });
32
+ it('Should have label', () => {
33
+ expect(component.label).toBeDefined();
34
+ });
35
+ });
36
+ });
@@ -0,0 +1,4 @@
1
+ import ChipInviteStatus from './ChipInviteStatus.vue';
2
+
3
+ export { ChipInviteStatus };
4
+ export default ChipInviteStatus;
@@ -1,7 +1,7 @@
1
1
  import DataTableEmptyWrapper from './DataTableEmptyWrapper.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/Table/DataTableEmptyWrapper',
4
+ title: 'API/Table/DataTableEmptyWrapper',
5
5
  component: DataTableEmptyWrapper,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import DataTableHeader from './DataTableHeader.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/Table/DataTableHeader',
4
+ title: 'API/Table/DataTableHeader',
5
5
  component: DataTableHeader,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import DataTablePaginator from './DataTablePaginator.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/Table/DataTablePaginator',
4
+ title: 'API/Table/DataTablePaginator',
5
5
  component: DataTablePaginator,
6
6
  };
7
7
 
@@ -26,7 +26,27 @@ export const CustomPerPage = () => ({
26
26
  '<DataTablePaginator :perPageOptions="[1, 2, 4, 12, 27]" :totalPages="19" :page="1" />',
27
27
  });
28
28
 
29
- Primary.storyName = 'Básico';
30
- Secondary.storyName = 'Sem limite por páginas';
31
- Disabled.storyName = 'Desabilitado';
32
- CustomPerPage.storyName = 'Lista de registros por página customizada';
29
+ const parameters = {
30
+ design: {
31
+ type: 'figma',
32
+ url:
33
+ 'https://www.figma.com/file/1f84J4m1IBghWhozQvdyyt/%E2%9C%8D---Design-System?node-id=1503%3A921',
34
+ },
35
+ };
36
+
37
+ Primary.story = {
38
+ name: 'Básico',
39
+ parameters,
40
+ };
41
+ Secondary.story = {
42
+ name: 'Sem limite por páginas',
43
+ parameters,
44
+ };
45
+ Disabled.story = {
46
+ name: 'Desabilitado',
47
+ parameters,
48
+ };
49
+ CustomPerPage.story = {
50
+ name: 'Lista de registros por página customizada',
51
+ parameters,
52
+ };
@@ -1,7 +1,7 @@
1
1
  import DatePicker from './DatePicker';
2
2
 
3
3
  export default {
4
- title: 'Example/Form/DatePicker',
4
+ title: 'API/Form/DatePicker',
5
5
  component: DatePicker,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import DefaultTextField from './DefaultTextField.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/Form/DefaultTextField',
4
+ title: 'API/Form/DefaultTextField',
5
5
  component: DefaultTextField,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import DialogFooter from './DialogFooter.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/Dialog/DialogFooter',
4
+ title: 'API/Dialog/DialogFooter',
5
5
  component: DialogFooter,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import DialogHeader from './DialogHeader.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/Dialog/DialogHeader',
4
+ title: 'API/Dialog/DialogHeader',
5
5
  component: DialogHeader,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import FilePicker from './FilePicker.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/FilePicker',
4
+ title: 'API/FilePicker',
5
5
  component: FilePicker,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import IconBox from './IconBox.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/IconBox',
4
+ title: 'API/IconBox',
5
5
  component: IconBox,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import Loader from './Loader.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/Loader',
4
+ title: 'API/Loader',
5
5
  component: Loader,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import OriginatorLogo from './OriginatorLogo.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/Logos/OriginatorLogo',
4
+ title: 'API/Logos/OriginatorLogo',
5
5
  component: OriginatorLogo,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import ProductLogo from './ProductLogo.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/Logos/ProductLogo',
4
+ title: 'API/Logos/ProductLogo',
5
5
  component: ProductLogo,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import MainFilter from './MainFilter.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/MainFilter',
4
+ title: 'API/MainFilter',
5
5
  component: MainFilter,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import ManagersList from './ManagersList';
2
2
 
3
3
  export default {
4
- title: 'Example/ManagersList',
4
+ title: 'API/ManagersList',
5
5
  component: ManagersList,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import ModalPromptUser from './ModalPromptUser.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/ModalPromptUser',
4
+ title: 'API/ModalPromptUser',
5
5
  component: ModalPromptUser,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import MultipleSelectShortener from './MultipleSelectShortener';
2
2
 
3
3
  export default {
4
- title: 'Example/MultipleSelectShortener',
4
+ title: 'API/MultipleSelectShortener',
5
5
  component: MultipleSelectShortener,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import PromptUserToConfirm from './PromptUserToConfirm';
2
2
 
3
3
  export default {
4
- title: 'Example/PromptUserToConfirm',
4
+ title: 'API/PromptUserToConfirm',
5
5
  component: PromptUserToConfirm,
6
6
  };
7
7
 
@@ -1,8 +1,10 @@
1
+ import { withDesign } from 'storybook-addon-designs';
1
2
  import RangeDatePicker from './RangeDatePicker';
2
3
 
3
4
  export default {
4
- title: 'Example/Form/RangeDatePicker',
5
+ title: 'API/Form/RangeDatePicker',
5
6
  component: RangeDatePicker,
7
+ decorators: [withDesign],
6
8
  };
7
9
 
8
10
  export const Primary = () => ({
@@ -20,6 +22,23 @@ export const MinMax = () => ({
20
22
  template: `<RangeDatePicker inputId="input-custom-id" min="2022-01-17" max="2022-02-15" />`,
21
23
  });
22
24
 
23
- Primary.storyName = 'Básico';
24
- Secondary.storyName = 'Data inicial';
25
- MinMax.storyName = 'Data Mínima e Máxima';
25
+ const parameters = {
26
+ design: {
27
+ type: 'figma',
28
+ url:
29
+ 'https://www.figma.com/file/1f84J4m1IBghWhozQvdyyt/%E2%9C%8D---Design-System?node-id=1503%3A810',
30
+ },
31
+ };
32
+
33
+ Primary.story = {
34
+ name: 'Básico',
35
+ parameters
36
+ };
37
+ Secondary.story = {
38
+ name: 'Data Inicial',
39
+ parameters
40
+ };
41
+ MinMax.story = {
42
+ name: 'Data Mínima e Máxima',
43
+ parameters
44
+ };
@@ -1,7 +1,7 @@
1
1
  import ResetTableRowSelection from './ResetTableRowSelection';
2
2
 
3
3
  export default {
4
- title: 'Example/ResetTableRowSelection',
4
+ title: 'API/ResetTableRowSelection',
5
5
  component: ResetTableRowSelection,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import SelectModalOptions from './SelectModalOptions';
2
2
 
3
3
  export default {
4
- title: 'Example/SelectModalOptions',
4
+ title: 'API/SelectModalOptions',
5
5
  component: SelectModalOptions,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import TableContextMenu from './TableContextMenu';
2
2
 
3
3
  export default {
4
- title: 'Example/TableContextMenu',
4
+ title: 'API/TableContextMenu',
5
5
  component: TableContextMenu,
6
6
  };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import Tabs from './Tabs.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/Tabs',
4
+ title: 'API/Tabs',
5
5
  component: Tabs,
6
6
  };
7
7
 
@@ -0,0 +1,47 @@
1
+ import { withDesign } from 'storybook-addon-designs';
2
+ import { DialogHeader, DialogFooter } from '../main';
3
+
4
+ export default {
5
+ title: 'Examples/Modal',
6
+ decorators: [withDesign],
7
+ component: Modal,
8
+ };
9
+
10
+ export const Modal = () => ({
11
+ /*
12
+ * How to create the default modal following FARM's Design System guideline
13
+ */
14
+ components: {
15
+ DialogHeader,
16
+ DialogFooter,
17
+ },
18
+ data() {
19
+ return {
20
+ inputVal: false,
21
+ };
22
+ },
23
+ template: `<div>
24
+ <v-dialog content-class="modal-default" v-model="inputVal">
25
+ <DialogHeader title="Exemplo" @onClose="inputVal = false;" />
26
+ <v-main class="pa-6 pt-12">
27
+ Place dialog content here!
28
+ </v-main>
29
+ <DialogFooter :hasConfirm="false" @onClose="inputVal = false;" />
30
+ </v-dialog>
31
+ <v-btn @click="inputVal = true;" color="secondary">
32
+ Clique para abrir
33
+ </v-btn>
34
+ </div>`,
35
+ });
36
+
37
+ // Modal.storyName = 'Básico';
38
+ Modal.story = {
39
+ name: 'Básico',
40
+ parameters: {
41
+ design: {
42
+ type: 'figma',
43
+ url:
44
+ 'https://www.figma.com/file/rkkAsX4IP0tzv1udIDXlqe/%E2%9C%8D---Onboarding---PJ?node-id=2867%3A10594',
45
+ },
46
+ },
47
+ };