@farm-investimentos/front-mfe-components 8.7.1 → 9.1.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/dist/front-mfe-components.common.js +2326 -2122
- package/dist/front-mfe-components.common.js.map +1 -1
- package/dist/front-mfe-components.css +1 -1
- package/dist/front-mfe-components.umd.js +2326 -2122
- package/dist/front-mfe-components.umd.js.map +1 -1
- package/dist/front-mfe-components.umd.min.js +1 -1
- package/dist/front-mfe-components.umd.min.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Buttons/ConfirmButton/ConfirmButton.vue +1 -5
- package/src/components/Buttons/DangerButton/DangerButton.stories.js +7 -18
- package/src/components/Buttons/DangerButton/DangerButton.vue +2 -6
- package/src/components/Buttons/DefaultButton/DefaultButton.scss +11 -2
- package/src/components/Buttons/DefaultButton/DefaultButton.stories.js +11 -7
- package/src/components/Buttons/DefaultButton/DefaultButton.vue +15 -15
- package/src/components/Buttons/DefaultButton/__tests__/DefaultButton.spec.js +0 -4
- package/src/components/Buttons/ExportButton/ExportButton.stories.js +3 -6
- package/src/components/Buttons/ExportButton/ExportButton.vue +1 -7
- package/src/components/Buttons/ImportButton/ImportButton.scss +9 -0
- package/src/components/Buttons/ImportButton/ImportButton.stories.js +5 -9
- package/src/components/Buttons/ImportButton/ImportButton.vue +4 -15
- package/src/components/Buttons/MultiImportButton/MultiImportButton.stories.js +2 -5
- package/src/components/Buttons/MultiImportButton/MultiImportButton.vue +0 -2
- package/src/components/Buttons/RemoveButton/RemoveButton.scss +5 -0
- package/src/components/Buttons/RemoveButton/RemoveButton.stories.js +2 -4
- package/src/components/Buttons/RemoveButton/RemoveButton.vue +2 -12
- package/src/components/Buttons/ToggleButton/ToggleButton.stories.js +5 -12
- package/src/components/Buttons/ToggleButton/ToggleButton.vue +3 -9
- package/src/{examples/Card.stories.ts → components/Card/CardComposition.stories.ts} +2 -29
- package/src/components/CardContext/CardContext.stories.js +14 -26
- package/src/components/CardContext/CardContext.vue +5 -5
- package/src/components/Checkbox/Checkbox.scss +29 -0
- package/src/components/Checkbox/Checkbox.stories.js +49 -0
- package/src/components/Checkbox/Checkbox.vue +48 -0
- package/src/components/Checkbox/__tests__/Checkbox.spec.js +20 -0
- package/src/components/Checkbox/index.ts +4 -0
- package/src/components/Chip/Chip.stories.js +44 -3
- package/src/{examples → components/Chip}/Chip.stories.scss +0 -0
- package/src/components/Chip/Chip.vue +4 -9
- package/src/components/ChipInviteStatus/ChipInviteStatus.stories.js +9 -12
- package/src/components/Collapsible/Collapsible.stories.js +41 -11
- package/src/components/Collapsible/Collapsible.vue +1 -10
- package/src/components/DataTableEmptyWrapper/DataTableEmptyWrapper.stories.js +5 -11
- package/src/components/DataTableHeader/DataTableHeader.stories.js +1 -2
- package/src/components/DataTablePaginator/DataTablePaginator.stories.js +4 -4
- package/src/components/DataTablePaginator/__tests__/DataTablePaginator.spec.js +1 -1
- package/src/components/DatePicker/DatePicker.vue +8 -1
- package/src/components/DialogFooter/DialogFooter.stories.js +31 -3
- package/src/components/DialogHeader/DialogHeader.stories.js +33 -7
- package/src/components/FilePicker/FilePicker.stories.js +1 -6
- package/src/components/Icon/Icon.stories.js +2 -2
- package/src/components/IconBox/IconBox.scss +17 -5
- package/src/components/IconBox/IconBox.stories.js +65 -5
- package/src/components/IconBox/IconBox.vue +18 -6
- package/src/components/IdCaption/IdCaption.scss +36 -0
- package/src/components/IdCaption/IdCaption.stories.js +116 -0
- package/src/components/IdCaption/IdCaption.vue +63 -0
- package/src/components/IdCaption/__tests__/IdCaption.spec.js +14 -0
- package/src/components/IdCaption/index.ts +3 -0
- package/src/components/Label/Label.stories.js +3 -12
- package/src/{examples → components/Loader}/Loader.stories.ts +2 -11
- package/src/components/Logger/Logger.stories.js +36 -6
- package/src/components/Logger/LoggerItem/LoggerItem.stories.js +42 -4
- package/src/components/Logger/LoggerItem/LoggerItem.vue +0 -4
- package/src/components/Logos/OriginatorLogo/OriginatorLogo.stories.js +2 -3
- package/src/components/Logos/ProductLogo/ProductLogo.stories.js +2 -3
- package/src/components/MainFilter/MainFilter.stories.js +19 -10
- package/src/components/MainFilter/MainFilter.vue +2 -12
- package/src/components/ManagersList/ManagersList.stories.js +2 -6
- package/src/components/ManagersList/ManagersList.vue +5 -3
- package/src/components/ModalPromptUser/ModalPromptUser.stories.js +22 -30
- package/src/components/ModalPromptUser/ModalPromptUser.vue +0 -4
- package/src/components/MultipleFilePicker/MultipleFilePicker.stories.js +1 -10
- package/src/components/MultipleSelectShortener/MultipleSelectShortener.stories.js +2 -7
- package/src/components/ProgressBar/ProgressBar.stories.js +16 -11
- package/src/components/PromptUserToConfirm/PromptUserToConfirm.stories.js +18 -12
- package/src/components/PromptUserToConfirm/PromptUserToConfirm.vue +5 -3
- package/src/components/ResetTableRowSelection/ResetTableRowSelection.stories.js +1 -4
- package/src/components/SelectModalOptions/SelectModalOptions.stories.js +3 -8
- package/src/components/Stepper/StepperHeader/StepperHeader.stories.js +54 -3
- package/src/components/Stepper/StepperHeader/StepperHeader.vue +0 -4
- package/src/components/TableContextMenu/TableContextMenu.stories.js +20 -40
- package/src/components/TableContextMenu/TableContextMenu.vue +0 -2
- package/src/components/Tabs/Tabs.stories.js +2 -5
- package/src/components/Tabs/Tabs.vue +4 -3
- package/src/components/TextField/TextField.stories.js +25 -10
- package/src/components/Typography/BodyText/BodyText.stories.js +34 -6
- package/src/components/Typography/BodyText/BodyText.vue +0 -3
- package/src/components/Typography/Caption/Caption.stories.js +30 -7
- package/src/components/Typography/Caption/Caption.vue +0 -2
- package/src/components/Typography/Heading/Heading.stories.js +7 -6
- package/src/components/Typography/Heading/Heading.vue +0 -2
- package/src/components/Typography/OverlayText/OverlayText.stories.js +0 -1
- package/src/components/Typography/OverlayText/OverlayText.vue +0 -2
- package/src/components/Typography/Subtitle/Subtitle.stories.js +34 -6
- package/src/components/Typography/Subtitle/Subtitle.vue +0 -2
- package/src/configurations/_theme-colors-base.scss +8 -0
- package/src/configurations/_theme-colors-variations.scss +9 -0
- package/src/examples/Colors.stories.js +28 -0
- package/src/examples/Colors.stories.scss +15 -0
- package/src/examples/ConfirmDialog.stories.js +1 -9
- package/src/examples/Container/Basic.stories.js +2 -16
- package/src/examples/Form/Full.stories.js +1 -7
- package/src/examples/Modal.stories.js +1 -55
- package/src/examples/Table.stories.js +2 -11
- package/src/examples/inputs/Password.stories.js +1 -1
- package/src/examples/inputs/Select.stories.js +1 -1
- package/src/main.ts +3 -0
- package/src/stories/Introduction.stories.mdx +1 -1
- package/src/components/Loader/Loader.stories.js +0 -13
- package/src/examples/Chip.stories.js +0 -53
- package/src/examples/Collapsible.stories.js +0 -52
- package/src/examples/Dialog/DialogFooter.stories.js +0 -42
- package/src/examples/Dialog/DialogHeader.stories.js +0 -43
- package/src/examples/Form/Label.stories.js +0 -18
- package/src/examples/Form/TextField.stories.js +0 -47
- package/src/examples/IconBox.stories.js +0 -62
- package/src/examples/Logger/Logger.stories.js +0 -59
- package/src/examples/Logger/LoggerItem.stories.js +0 -81
- package/src/examples/MainFilter.stories.js +0 -29
- package/src/examples/ProgressBar.stories.js +0 -71
- package/src/examples/Stepper/StepperHeader.stories.js +0 -99
- package/src/examples/Typography/BodyText.stories.js +0 -58
- package/src/examples/Typography/Caption.stories.js +0 -55
- package/src/examples/Typography/Heading.stories.js +0 -32
- package/src/examples/Typography/Subtitle.stories.js +0 -58
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import CardContext from './CardContext.vue';
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
export default {
|
|
5
|
-
title: '
|
|
4
|
+
title: 'Surfaces/CardContext',
|
|
6
5
|
component: CardContext,
|
|
7
|
-
|
|
6
|
+
parameters: {
|
|
8
7
|
docs: {
|
|
9
8
|
description: {
|
|
10
9
|
component: `Card Context<br />
|
|
@@ -17,62 +16,51 @@ export default {
|
|
|
17
16
|
};
|
|
18
17
|
|
|
19
18
|
export const Primary = () => ({
|
|
20
|
-
components: { CardContext },
|
|
21
19
|
template: `
|
|
22
|
-
<
|
|
20
|
+
<farm-card-context icon="mdi-currency-usd" title="Titulo do Card">
|
|
23
21
|
<p>Conteúdo do Card</p>
|
|
24
|
-
</
|
|
22
|
+
</farm-card-context>
|
|
25
23
|
`,
|
|
26
24
|
});
|
|
27
25
|
|
|
28
26
|
export const Secondary = () => ({
|
|
29
|
-
components: { CardContext },
|
|
30
27
|
template: `
|
|
31
|
-
<
|
|
28
|
+
<farm-card-context icon="mdi-currency-usd" title="Titulo do Card" bold>
|
|
32
29
|
<p>Conteúdo do Card</p>
|
|
33
|
-
</
|
|
30
|
+
</farm-card-context>
|
|
34
31
|
`,
|
|
35
32
|
});
|
|
36
33
|
|
|
37
34
|
export const WithLoading = () => ({
|
|
38
|
-
components: { CardContext },
|
|
39
35
|
template: `
|
|
40
|
-
<
|
|
36
|
+
<farm-card-context icon="mdi-currency-usd" title="Titulo do Card" isLoading>
|
|
41
37
|
<p>Conteúdo do Card</p>
|
|
42
|
-
</
|
|
38
|
+
</farm-card-context>
|
|
43
39
|
`,
|
|
44
40
|
});
|
|
45
41
|
|
|
46
42
|
export const WithLoadingLarge = () => ({
|
|
47
|
-
components: { CardContext },
|
|
48
43
|
template: `
|
|
49
|
-
<
|
|
44
|
+
<farm-card-context icon="mdi-currency-usd" title="Titulo do Card" isLoading largeLoading>
|
|
50
45
|
<p>Conteúdo do Card</p>
|
|
51
|
-
</
|
|
46
|
+
</farm-card-context>
|
|
52
47
|
`,
|
|
53
48
|
});
|
|
54
49
|
|
|
55
50
|
export const WithError = () => ({
|
|
56
51
|
components: { CardContext },
|
|
57
52
|
template: `
|
|
58
|
-
<
|
|
53
|
+
<farm-card-context icon="mdi-currency-usd" title="Titulo do Card" isError>
|
|
59
54
|
<p>Conteúdo do Card</p>
|
|
60
|
-
</
|
|
55
|
+
</farm-card-context>
|
|
61
56
|
`,
|
|
62
57
|
});
|
|
63
58
|
|
|
64
59
|
export const NoIcon = () => ({
|
|
65
60
|
components: { CardContext },
|
|
66
61
|
template: `
|
|
67
|
-
<
|
|
62
|
+
<farm-card-context title="Titulo do Card">
|
|
68
63
|
<p>Conteúdo do Card</p>
|
|
69
|
-
</
|
|
64
|
+
</farm-card-context>
|
|
70
65
|
`,
|
|
71
66
|
});
|
|
72
|
-
|
|
73
|
-
Primary.storyName = 'Básico';
|
|
74
|
-
Secondary.storyName = 'Título em Bold';
|
|
75
|
-
WithLoading.storyName = 'Com Loading';
|
|
76
|
-
WithLoadingLarge.storyName = 'Com Loading Large';
|
|
77
|
-
WithError.storyName = 'Com Erro';
|
|
78
|
-
NoIcon.storyName = 'No icon';
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
}"
|
|
8
8
|
>
|
|
9
9
|
<div class="card-context-header" v-if="isSuccess && title">
|
|
10
|
-
<farm-
|
|
10
|
+
<farm-icon-box v-if="icon" :icon="icon" />
|
|
11
11
|
<div class="card-context-content">
|
|
12
12
|
<p :class="{ 'card-context-title': true, 'card-context-content--bold': bold }">
|
|
13
13
|
{{ title }}
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
</div>
|
|
27
27
|
</template>
|
|
28
28
|
|
|
29
|
-
<script>
|
|
29
|
+
<script lang="ts">
|
|
30
30
|
import Vue from 'vue';
|
|
31
31
|
|
|
32
32
|
export default Vue.extend({
|
|
@@ -37,7 +37,7 @@ export default Vue.extend({
|
|
|
37
37
|
*/
|
|
38
38
|
title: {
|
|
39
39
|
type: String,
|
|
40
|
-
|
|
40
|
+
required: true,
|
|
41
41
|
},
|
|
42
42
|
/**
|
|
43
43
|
* Set bold text
|
|
@@ -105,6 +105,6 @@ export default Vue.extend({
|
|
|
105
105
|
});
|
|
106
106
|
</script>
|
|
107
107
|
|
|
108
|
-
<style lang="
|
|
109
|
-
@import './CardContext.scss'
|
|
108
|
+
<style lang="scss" scoped>
|
|
109
|
+
@import './CardContext.scss';
|
|
110
110
|
</style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.farm-checkbox__container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: row;
|
|
4
|
+
|
|
5
|
+
.farm-label {
|
|
6
|
+
margin-left: 8px;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.farm-checkbox {
|
|
11
|
+
width: 20px;
|
|
12
|
+
height: 20px;
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
border: 2px solid #5c5c5c;
|
|
16
|
+
border-radius: 2px;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
line-height: 0;
|
|
19
|
+
transition: all 0.4s;
|
|
20
|
+
|
|
21
|
+
&--checked {
|
|
22
|
+
background-color: var(--v-secondary-base);
|
|
23
|
+
border-color: var(--v-secondary-base);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.farm-icon {
|
|
27
|
+
color: white;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import Checkbox from './Checkbox';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Form/Checkbox',
|
|
5
|
+
component: Checkbox,
|
|
6
|
+
parameters: {
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: `Checkbox<br />
|
|
10
|
+
selector: <em>farm-checkbox</em>
|
|
11
|
+
`,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
viewMode: 'docs',
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const Primary = () => ({
|
|
19
|
+
data() {
|
|
20
|
+
return {
|
|
21
|
+
isChecked: false,
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
template: `<div>
|
|
25
|
+
<farm-checkbox v-model="isChecked" />
|
|
26
|
+
</div>`,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const DefaultTrue = () => ({
|
|
30
|
+
data() {
|
|
31
|
+
return {
|
|
32
|
+
isChecked: true,
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
template: `<div>
|
|
36
|
+
<farm-checkbox v-model="isChecked" />
|
|
37
|
+
</div>`,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export const WithLabel = () => ({
|
|
41
|
+
data() {
|
|
42
|
+
return {
|
|
43
|
+
isChecked: false,
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
template: `<div>
|
|
47
|
+
<farm-checkbox v-model="isChecked" label="custom label" />
|
|
48
|
+
</div>`,
|
|
49
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="farm-checkbox__container">
|
|
3
|
+
<span
|
|
4
|
+
:class="{ 'farm-checkbox': true, 'farm-checkbox--checked': innerValue }"
|
|
5
|
+
@click="toggleValue"
|
|
6
|
+
>
|
|
7
|
+
<farm-icon size="sm" v-if="innerValue">check</farm-icon>
|
|
8
|
+
</span>
|
|
9
|
+
<farm-label v-if="label">
|
|
10
|
+
{{ label }}
|
|
11
|
+
</farm-label>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
import Vue, { ref } from 'vue';
|
|
16
|
+
|
|
17
|
+
export default Vue.extend({
|
|
18
|
+
name: 'farm-checkbox',
|
|
19
|
+
props: {
|
|
20
|
+
/**
|
|
21
|
+
* v-model binding
|
|
22
|
+
*/
|
|
23
|
+
value: { type: Boolean, required: true },
|
|
24
|
+
/**
|
|
25
|
+
* Label
|
|
26
|
+
*/
|
|
27
|
+
label: { type: String, default: null },
|
|
28
|
+
},
|
|
29
|
+
setup(props, { emit }) {
|
|
30
|
+
const innerValue = ref(props.value);
|
|
31
|
+
const { label } = props;
|
|
32
|
+
|
|
33
|
+
const toggleValue = () => {
|
|
34
|
+
innerValue.value = !innerValue.value;
|
|
35
|
+
emit('input', innerValue.value);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
innerValue,
|
|
40
|
+
label,
|
|
41
|
+
toggleValue,
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
</script>
|
|
46
|
+
<style lang="scss" scoped>
|
|
47
|
+
@import './Checkbox.scss';
|
|
48
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import Checkbox from '../Checkbox';
|
|
3
|
+
|
|
4
|
+
describe('Checkbox component', () => {
|
|
5
|
+
let wrapper;
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
wrapper = shallowMount(Checkbox, {});
|
|
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
|
+
});
|
|
@@ -1,15 +1,56 @@
|
|
|
1
1
|
import Chip from './Chip.vue';
|
|
2
|
+
import('./Chip.stories.scss');
|
|
3
|
+
|
|
4
|
+
const colors = ['secondary', 'info', 'error'];
|
|
5
|
+
const variations = ['darken', 'lighten'];
|
|
2
6
|
|
|
3
7
|
export default {
|
|
4
|
-
title: '
|
|
8
|
+
title: 'Display/Chips',
|
|
5
9
|
component: Chip,
|
|
6
10
|
};
|
|
7
11
|
|
|
8
12
|
export const Primary = () => ({
|
|
9
|
-
components: { 'farm-chip': Chip },
|
|
10
13
|
template: `<div>
|
|
11
14
|
<farm-chip color="info">Chip</farm-chip>
|
|
12
15
|
</div>`,
|
|
13
16
|
});
|
|
14
17
|
|
|
15
|
-
|
|
18
|
+
export const Colors = () => ({
|
|
19
|
+
data() {
|
|
20
|
+
return {
|
|
21
|
+
colors,
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
template: `<div class="chips-container">
|
|
25
|
+
<h3>Base Colors</h3>
|
|
26
|
+
<farm-chip
|
|
27
|
+
v-for="color in colors"
|
|
28
|
+
:key="color"
|
|
29
|
+
:color="color">
|
|
30
|
+
{{ color }}
|
|
31
|
+
</farm-chip>
|
|
32
|
+
</div>`,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export const Variations = () => ({
|
|
36
|
+
data() {
|
|
37
|
+
return {
|
|
38
|
+
colors,
|
|
39
|
+
variations,
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
template: `
|
|
43
|
+
<div>
|
|
44
|
+
<h3>Variations</h3>
|
|
45
|
+
<div class="chips-container" v-for="color in colors">
|
|
46
|
+
<h4>{{ color }}</h4>
|
|
47
|
+
<farm-chip
|
|
48
|
+
v-for="variation in variations"
|
|
49
|
+
:key="color + '_' + variation"
|
|
50
|
+
:color="color"
|
|
51
|
+
:variation="variation">
|
|
52
|
+
{{ variation }}
|
|
53
|
+
</farm-chip>
|
|
54
|
+
</div>
|
|
55
|
+
</div>`,
|
|
56
|
+
});
|
|
File without changes
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<span :class="{ 'farm-chip': true }">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<farm-typography tag="span" size="sm">
|
|
4
|
+
<slot></slot>
|
|
5
|
+
</farm-typography>
|
|
6
6
|
</span>
|
|
7
7
|
</template>
|
|
8
8
|
<script lang="ts">
|
|
9
9
|
import Vue from 'vue';
|
|
10
|
-
import Typography from '../Typography';
|
|
11
10
|
|
|
12
11
|
export default Vue.extend({
|
|
13
12
|
name: 'farm-chip',
|
|
14
|
-
|
|
15
|
-
setup() {},
|
|
16
|
-
components: {
|
|
17
|
-
'farm-typography': Typography,
|
|
18
|
-
},
|
|
13
|
+
inheritAttrs: true,
|
|
19
14
|
});
|
|
20
15
|
</script>
|
|
21
16
|
<style lang="scss" scoped>
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import ChipInviteStatus from './ChipInviteStatus.vue';
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
title: '
|
|
4
|
+
title: 'Display/Chips/Onboarding/InviteStatus',
|
|
5
5
|
component: ChipInviteStatus,
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export const Primary = () => ({
|
|
9
|
-
components: { ChipInviteStatus },
|
|
10
9
|
template: `<div style="width: 120px;">
|
|
11
|
-
<
|
|
12
|
-
<
|
|
13
|
-
<
|
|
14
|
-
<
|
|
15
|
-
<
|
|
16
|
-
<
|
|
17
|
-
<
|
|
18
|
-
<
|
|
10
|
+
<farm-chip-invite :status="10" />
|
|
11
|
+
<farm-chip-invite :status="11" />
|
|
12
|
+
<farm-chip-invite :status="12" />
|
|
13
|
+
<farm-chip-invite :status="13" />
|
|
14
|
+
<farm-chip-invite :status="14" />
|
|
15
|
+
<farm-chip-invite :status="15" />
|
|
16
|
+
<farm-chip-invite :status="16" />
|
|
17
|
+
<farm-chip-invite :status="17" />
|
|
19
18
|
</div>`,
|
|
20
19
|
});
|
|
21
|
-
|
|
22
|
-
Primary.storyName = 'Básico';
|
|
@@ -1,19 +1,49 @@
|
|
|
1
|
-
import Collapsible from './Collapsible
|
|
1
|
+
import Collapsible from './Collapsible';
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
title: '
|
|
5
|
-
|
|
4
|
+
title: 'Surfaces/Collapsible',
|
|
5
|
+
components: Collapsible,
|
|
6
|
+
parameters: {
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: `Collapsible<br />selector: <em>farm-collapsible</em>`,
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
viewMode: 'docs',
|
|
13
|
+
},
|
|
6
14
|
};
|
|
7
15
|
|
|
8
|
-
export const
|
|
9
|
-
|
|
10
|
-
template: '<Collapsible title="Example" icon="home">Text or Components</Collapsible>',
|
|
16
|
+
export const Primary = () => ({
|
|
17
|
+
template: '<farm-collapsible title="">collapsible content</farm-collapsible>',
|
|
11
18
|
});
|
|
12
19
|
|
|
13
|
-
export const
|
|
14
|
-
|
|
15
|
-
template: '<Collapsible title="Example without icon">Text or Components</Collapsible>',
|
|
20
|
+
export const Title = () => ({
|
|
21
|
+
template: '<farm-collapsible title="Title">collapsible content</farm-collapsible>',
|
|
16
22
|
});
|
|
17
23
|
|
|
18
|
-
|
|
19
|
-
|
|
24
|
+
export const Icon = () => ({
|
|
25
|
+
template: '<farm-collapsible icon="book" title="With Icon">collapsible content</farm-collapsible>',
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export const Opened = () => ({
|
|
29
|
+
data() {
|
|
30
|
+
return {
|
|
31
|
+
isOpen: true,
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
template: `<div>
|
|
35
|
+
status: {{ isOpen }}
|
|
36
|
+
<farm-collapsible
|
|
37
|
+
title=""
|
|
38
|
+
:open="isOpen"
|
|
39
|
+
@open="value => isOpen = value"
|
|
40
|
+
>
|
|
41
|
+
collapsible content
|
|
42
|
+
</farm-collapsible>
|
|
43
|
+
</div>`,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
Primary.storyName = 'Basic';
|
|
47
|
+
Title.storyName = 'Title';
|
|
48
|
+
Icon.storyName = 'Icon';
|
|
49
|
+
Opened.storyName = 'Opened';
|
|
@@ -29,19 +29,10 @@
|
|
|
29
29
|
|
|
30
30
|
<script lang="ts">
|
|
31
31
|
import Vue from 'vue';
|
|
32
|
-
import Icon from '../Icon';
|
|
33
|
-
import Card from '../Card';
|
|
34
|
-
import CardContent from '../Card/CardContent';
|
|
35
|
-
import Typography from '../Typography';
|
|
36
32
|
|
|
37
33
|
export default Vue.extend({
|
|
38
34
|
name: 'farm-collapsible',
|
|
39
|
-
|
|
40
|
-
'farm-icon': Icon,
|
|
41
|
-
'farm-card': Card,
|
|
42
|
-
'farm-card-content': CardContent,
|
|
43
|
-
'farm-typography': Typography,
|
|
44
|
-
},
|
|
35
|
+
|
|
45
36
|
props: {
|
|
46
37
|
/**
|
|
47
38
|
* Title
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import DataTableEmptyWrapper from './DataTableEmptyWrapper.vue';
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
title: 'Display/Table/DataTableEmptyWrapper',
|
|
5
|
+
component: DataTableEmptyWrapper,
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export const Primary = () => ({
|
|
9
|
-
|
|
10
|
-
template: '<DataTableEmptyWrapper />',
|
|
9
|
+
template: '<DataTableEmptyWrapper />',
|
|
11
10
|
});
|
|
12
11
|
|
|
13
|
-
|
|
14
12
|
export const CustomTitles = () => ({
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
template:
|
|
14
|
+
'<DataTableEmptyWrapper title="Título customizado" subtitle="Subtítulo customizado" />',
|
|
17
15
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Primary.storyName = 'Básico';
|
|
21
|
-
CustomTitles.storyName = "Títulos";
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import DataTableHeader from './DataTableHeader.vue';
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
title: '
|
|
4
|
+
title: 'Display/Table/DataTableHeader',
|
|
5
5
|
component: DataTableHeader,
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export const Primary = () => ({
|
|
9
|
-
components: { DataTableHeader },
|
|
10
9
|
data() {
|
|
11
10
|
return {
|
|
12
11
|
headers: [
|
|
@@ -2,7 +2,7 @@ import { withDesign } from 'storybook-addon-designs';
|
|
|
2
2
|
import DataTablePaginator from './DataTablePaginator.vue';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
title: '
|
|
5
|
+
title: 'Display/Table/DataTablePaginator',
|
|
6
6
|
component: DataTablePaginator,
|
|
7
7
|
decorators: [withDesign],
|
|
8
8
|
parameters: {
|
|
@@ -26,19 +26,19 @@ export const Primary = () => ({
|
|
|
26
26
|
data() {
|
|
27
27
|
return {
|
|
28
28
|
totalPages: null
|
|
29
|
-
}
|
|
29
|
+
};
|
|
30
30
|
},
|
|
31
31
|
template: '<DataTablePaginator :totalPages="totalPages" :page="1" />',
|
|
32
32
|
mounted() {
|
|
33
33
|
setTimeout(() => {
|
|
34
34
|
this.totalPages = 2;
|
|
35
|
-
}, 1000)
|
|
35
|
+
}, 1000);
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
export const Secondary = () => ({
|
|
40
40
|
components: { DataTablePaginator },
|
|
41
|
-
template: '<DataTablePaginator :hidePerPageOptions="true" :totalPages="
|
|
41
|
+
template: '<DataTablePaginator :hidePerPageOptions="true" :totalPages="190000" :page="1" />',
|
|
42
42
|
});
|
|
43
43
|
|
|
44
44
|
export const Disabled = () => ({
|
|
@@ -136,7 +136,9 @@ export default Vue.extend({
|
|
|
136
136
|
timeZone: 'America/Sao_Paulo',
|
|
137
137
|
});
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
console.log(this.getUniversalDate(locatedSelectedDate), this.getUniversalDate(locatedMinDate));
|
|
140
|
+
|
|
141
|
+
return this.min && this.getUniversalDate(locatedSelectedDate) < this.getUniversalDate(locatedMinDate)
|
|
140
142
|
? 'A data está fora do período permitido'
|
|
141
143
|
: true;
|
|
142
144
|
},
|
|
@@ -174,6 +176,11 @@ export default Vue.extend({
|
|
|
174
176
|
this.save();
|
|
175
177
|
}
|
|
176
178
|
},
|
|
179
|
+
getUniversalDate(d) {
|
|
180
|
+
const onlyDMY = d.split(' ')[0];
|
|
181
|
+
const arr = onlyDMY.split('/');
|
|
182
|
+
return new Date(arr[2], arr[1] -1, arr[0]);
|
|
183
|
+
},
|
|
177
184
|
},
|
|
178
185
|
computed: {
|
|
179
186
|
inputVal: {
|
|
@@ -1,11 +1,39 @@
|
|
|
1
1
|
import DialogFooter from './DialogFooter.vue';
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
title: '
|
|
4
|
+
title: 'Display/Dialog/DialogFooter',
|
|
5
5
|
component: DialogFooter,
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export const Primary = () => ({
|
|
9
|
-
components: { DialogFooter },
|
|
10
|
-
template: '<
|
|
9
|
+
components: { 'farm-dialog-footer': DialogFooter },
|
|
10
|
+
template: '<farm-dialog-footer />',
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const ExtraButton = () => ({
|
|
14
|
+
data() {
|
|
15
|
+
return { extraButtons: [{ label: 'Random label', color: 'error', outlined: true }] };
|
|
16
|
+
},
|
|
17
|
+
template: `<farm-dialog-footer :extraButtons="extraButtons" />`,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const ConfirmIcon = () => ({
|
|
21
|
+
template: `<div>
|
|
22
|
+
<farm-dialog-footer confirmIcon="check" />
|
|
23
|
+
<farm-dialog-footer confirmIcon="check" confirmColor="yellow" />
|
|
24
|
+
<farm-dialog-footer confirmIcon="check" confirmColor="accent" />
|
|
25
|
+
</div>
|
|
26
|
+
`,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const Handlers = () => ({
|
|
30
|
+
template: '<farm-dialog-footer @onConfirm="onConfirm" @onClose="onClose" />',
|
|
31
|
+
methods: {
|
|
32
|
+
onConfirm() {
|
|
33
|
+
alert('onConfirm handler');
|
|
34
|
+
},
|
|
35
|
+
onClose() {
|
|
36
|
+
alert('onClose handler');
|
|
37
|
+
},
|
|
38
|
+
},
|
|
11
39
|
});
|