@farm-investimentos/front-mfe-components 3.4.1 → 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 (45) hide show
  1. package/dist/front-mfe-components.common.js +80 -68
  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 +80 -68
  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.stories.js +8 -6
  20. package/src/components/ChipInviteStatus/ChipInviteStatus.vue +21 -9
  21. package/src/components/ChipInviteStatus/__tests__/ChipInviteStatus.spec.js +1 -1
  22. package/src/components/DataTableEmptyWrapper/DataTableEmptyWrapper.stories.js +1 -1
  23. package/src/components/DataTableHeader/DataTableHeader.stories.js +1 -1
  24. package/src/components/DataTablePaginator/DataTablePaginator.stories.js +25 -5
  25. package/src/components/DatePicker/DatePicker.stories.js +1 -1
  26. package/src/components/DefaultTextField/DefaultTextField.stories.js +1 -1
  27. package/src/components/DialogFooter/DialogFooter.stories.js +1 -1
  28. package/src/components/DialogHeader/DialogHeader.stories.js +1 -1
  29. package/src/components/FilePicker/FilePicker.stories.js +1 -1
  30. package/src/components/IconBox/IconBox.stories.js +1 -1
  31. package/src/components/Loader/Loader.stories.js +1 -1
  32. package/src/components/Logos/OriginatorLogo/OriginatorLogo.stories.js +1 -1
  33. package/src/components/Logos/ProductLogo/ProductLogo.stories.js +1 -1
  34. package/src/components/MainFilter/MainFilter.stories.js +1 -1
  35. package/src/components/ManagersList/ManagersList.stories.js +1 -1
  36. package/src/components/ModalPromptUser/ModalPromptUser.stories.js +1 -1
  37. package/src/components/MultipleSelectShortener/MultipleSelectShortener.stories.js +1 -1
  38. package/src/components/PromptUserToConfirm/PromptUserToConfirm.stories.js +1 -1
  39. package/src/components/RangeDatePicker/RangeDatePicker.stories.js +23 -4
  40. package/src/components/ResetTableRowSelection/ResetTableRowSelection.stories.js +1 -1
  41. package/src/components/SelectModalOptions/SelectModalOptions.stories.js +1 -1
  42. package/src/components/TableContextMenu/TableContextMenu.stories.js +1 -1
  43. package/src/components/Tabs/Tabs.stories.js +1 -1
  44. package/src/examples/Modal.stories.js +47 -0
  45. package/src/examples/Table.stories.js +84 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farm-investimentos/front-mfe-components",
3
- "version": "3.4.1",
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
 
@@ -1,18 +1,20 @@
1
1
  import ChipInviteStatus from './ChipInviteStatus.vue';
2
2
 
3
3
  export default {
4
- title: 'Example/Onboarding/ChipInviteStatus',
4
+ title: 'API/Onboarding/ChipInviteStatus',
5
5
  component: ChipInviteStatus,
6
6
  };
7
7
 
8
8
  export const Primary = () => ({
9
9
  components: { ChipInviteStatus },
10
10
  template: `<div style="width: 120px;">
11
- <ChipInviteStatus status="CONVIDAR" />
12
- <ChipInviteStatus status="CONVIDADO" />
13
- <ChipInviteStatus status="INCOMPLETO" />
14
- <ChipInviteStatus status="CONCLUIDO" />
15
- <ChipInviteStatus status="FALHA/ERRO" />
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" />
16
18
  </div>`,
17
19
  });
18
20
 
@@ -14,12 +14,24 @@
14
14
  </template>
15
15
  <script>
16
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
+
17
27
  const StatusColor = {
18
- CONVIDAR: 'secondary',
19
- CONVIDADO: 'yellow',
20
- INCOMPLETO: 'yellow',
21
- CONCLUIDO: 'success',
22
- 'FALHA/ERRO': 'error',
28
+ 10: 'secondary',
29
+ 11: 'yellow',
30
+ 12: 'yellow',
31
+ 13: 'success',
32
+ 14: 'error',
33
+ 15: 'accent',
34
+ 16: 'primary',
23
35
  };
24
36
 
25
37
  import VChip from 'vuetify/lib/components/VChip/';
@@ -34,8 +46,8 @@ export default Vue.extend({
34
46
  * Invite status
35
47
  */
36
48
  status: {
37
- type: String,
38
- default: '',
49
+ type: Number,
50
+ default: 10,
39
51
  },
40
52
  /**
41
53
  * Full width (from parent)
@@ -47,13 +59,13 @@ export default Vue.extend({
47
59
  },
48
60
  computed: {
49
61
  textColor() {
50
- return this.status === 'CONVIDAR' ? '' : StatusColor[this.status];
62
+ return this.status === 10 || this.status === 16 ? '' : StatusColor[this.status];
51
63
  },
52
64
  color() {
53
65
  return !this.status ? '' : StatusColor[this.status];
54
66
  },
55
67
  label() {
56
- return this.status;
68
+ return StatusLabel[this.status];
57
69
  },
58
70
  },
59
71
  });
@@ -7,7 +7,7 @@ describe('ChipInviteStatus component', () => {
7
7
  beforeEach(() => {
8
8
  wrapper = shallowMount(ChipInviteStatus, {
9
9
  propsData: {
10
- status: 'CONVIDAR',
10
+ status: 10,
11
11
  },
12
12
  });
13
13
  component = wrapper.vm;
@@ -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
+ };
@@ -0,0 +1,84 @@
1
+ import { withDesign } from 'storybook-addon-designs';
2
+ import { DataTableEmptyWrapper } from '../main';
3
+
4
+ const headers = [
5
+ {
6
+ text: 'ID',
7
+ sortable: false,
8
+ value: 'id',
9
+ width: 80,
10
+ align: 'left',
11
+ },
12
+ ];
13
+
14
+ export default {
15
+ title: 'Examples/Table',
16
+ decorators: [withDesign],
17
+ };
18
+
19
+ export const TableNoData = () => ({
20
+ components: {
21
+ DataTableEmptyWrapper,
22
+ },
23
+ data() {
24
+ return {
25
+ headers,
26
+ };
27
+ },
28
+ template: `<div>
29
+ <v-data-table
30
+ hide-default-footer
31
+ :headers="headers"
32
+ >
33
+ <template slot="no-data">
34
+ <DataTableEmptyWrapper
35
+ subtitle="Tente filtrar novamente sua pesquisa"
36
+ />
37
+ </template>
38
+ </v-data-table>
39
+ </div>`,
40
+ });
41
+
42
+ export const TableSampleData = () => ({
43
+ components: {
44
+ DataTableEmptyWrapper,
45
+ },
46
+ data() {
47
+ return {
48
+ headers,
49
+ items: [{ id: 1 }, { id: 2 }, { id: 3 }],
50
+ };
51
+ },
52
+ template: `<div>
53
+ <v-data-table
54
+ hide-default-footer
55
+ :headers="headers"
56
+ :items="items"
57
+ >
58
+
59
+ </v-data-table>
60
+ </div>`,
61
+ });
62
+
63
+ TableNoData.story = {
64
+ name: 'No data',
65
+ parameters: {
66
+ design: {
67
+ type: 'figma',
68
+ url:
69
+ 'https://www.figma.com/file/rkkAsX4IP0tzv1udIDXlqe/%E2%9C%8D---Onboarding---PJ?node-id=2867%3A10594',
70
+ },
71
+ },
72
+ };
73
+
74
+ TableSampleData.story = {
75
+ name: 'With data',
76
+ parameters: {
77
+ design: {
78
+ type: 'figma',
79
+ url:
80
+ 'https://www.figma.com/file/rkkAsX4IP0tzv1udIDXlqe/%E2%9C%8D---Onboarding---PJ?node-id=2867%3A10594',
81
+ },
82
+ },
83
+ };
84
+