@farm-investimentos/front-mfe-components 2.2.7 → 2.3.0
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 +156 -24
- package/dist/front-mfe-components.common.js.map +1 -1
- package/dist/front-mfe-components.umd.js +156 -24
- 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 +1 -1
- package/src/components/Logos/OriginatorLogo/OriginatorLogo.stories.js +13 -0
- package/src/components/Logos/OriginatorLogo/OriginatorLogo.vue +31 -0
- package/src/components/Logos/OriginatorLogo/__tests__/OriginatorLogo.spec.js +32 -0
- package/src/components/Logos/OriginatorLogo/index.js +4 -0
- package/src/components/Logos/ProductLogo/ProductLogo.stories.js +13 -0
- package/src/components/Logos/ProductLogo/ProductLogo.vue +31 -0
- package/src/components/Logos/ProductLogo/__tests__/ProductLogo.spec.js +32 -0
- package/src/components/Logos/ProductLogo/index.js +4 -0
- package/src/components/Logos/index.js +2 -0
- package/src/main.js +3 -1
package/package.json
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import OriginatorLogo from './OriginatorLogo.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Example/Logos/OriginatorLogo',
|
|
5
|
+
component: OriginatorLogo,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const Primary = () => ({
|
|
9
|
+
components: { OriginatorLogo },
|
|
10
|
+
template: '<OriginatorLogo alt="primary" id="1" />',
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
Primary.storyName = 'Básico';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<img :src="imgSrc" />
|
|
3
|
+
</template>
|
|
4
|
+
<script>
|
|
5
|
+
import Vue from 'vue';
|
|
6
|
+
|
|
7
|
+
export default Vue.extend({
|
|
8
|
+
name: 'farm-imglogo-originator',
|
|
9
|
+
inheritAttrs: true,
|
|
10
|
+
props: {
|
|
11
|
+
/**
|
|
12
|
+
* Product id
|
|
13
|
+
*/
|
|
14
|
+
id: {
|
|
15
|
+
required: true,
|
|
16
|
+
},
|
|
17
|
+
/**
|
|
18
|
+
* Logo variation
|
|
19
|
+
*/
|
|
20
|
+
variation: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: 'full',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
computed: {
|
|
26
|
+
imgSrc() {
|
|
27
|
+
return `/public/logos/originadores/${this.id}/${this.variation}.svg`;
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
</script>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import OriginatorLogo from '../OriginatorLogo';
|
|
3
|
+
|
|
4
|
+
describe('OriginatorLogo component', () => {
|
|
5
|
+
let wrapper;
|
|
6
|
+
let component;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
wrapper = shallowMount(OriginatorLogo, {
|
|
10
|
+
propsData: {
|
|
11
|
+
id: 10,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
component = wrapper.vm;
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test('Created hook', () => {
|
|
18
|
+
expect(wrapper).toBeDefined();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
describe('mount component', () => {
|
|
22
|
+
it('renders correctly', () => {
|
|
23
|
+
expect(wrapper.element).toMatchSnapshot();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
describe('Computed properties', () => {
|
|
28
|
+
it('Should have imgSrc', () => {
|
|
29
|
+
expect(component.imgSrc).toEqual('/public/logos/originadores/10/full.svg');
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import ProductLogo from './ProductLogo.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Example/Logos/ProductLogo',
|
|
5
|
+
component: ProductLogo,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const Primary = () => ({
|
|
9
|
+
components: { ProductLogo },
|
|
10
|
+
template: '<ProductLogo alt="primary" id="1" />',
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
Primary.storyName = 'Básico';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<img :src="imgSrc" />
|
|
3
|
+
</template>
|
|
4
|
+
<script>
|
|
5
|
+
import Vue from 'vue';
|
|
6
|
+
|
|
7
|
+
export default Vue.extend({
|
|
8
|
+
name: 'farm-imglogo-product',
|
|
9
|
+
inheritAttrs: true,
|
|
10
|
+
props: {
|
|
11
|
+
/**
|
|
12
|
+
* Product id
|
|
13
|
+
*/
|
|
14
|
+
id: {
|
|
15
|
+
required: true,
|
|
16
|
+
},
|
|
17
|
+
/**
|
|
18
|
+
* Logo variation
|
|
19
|
+
*/
|
|
20
|
+
variation: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: 'full',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
computed: {
|
|
26
|
+
imgSrc() {
|
|
27
|
+
return `/public/logos/products/${this.id}/${this.variation}.svg`;
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
</script>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import ProductLogo from '../ProductLogo';
|
|
3
|
+
|
|
4
|
+
describe('ProductLogo component', () => {
|
|
5
|
+
let wrapper;
|
|
6
|
+
let component;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
wrapper = shallowMount(ProductLogo, {
|
|
10
|
+
propsData: {
|
|
11
|
+
id: 10,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
component = wrapper.vm;
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test('Created hook', () => {
|
|
18
|
+
expect(wrapper).toBeDefined();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
describe('mount component', () => {
|
|
22
|
+
it('renders correctly', () => {
|
|
23
|
+
expect(wrapper.element).toMatchSnapshot();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
describe('Computed properties', () => {
|
|
28
|
+
it('Should have imgSrc', () => {
|
|
29
|
+
expect(component.imgSrc).toEqual('/public/logos/products/10/full.svg');
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
});
|
package/src/main.js
CHANGED
|
@@ -16,7 +16,7 @@ import PromptUserToConfirm from './components/PromptUserToConfirm';
|
|
|
16
16
|
import ModalPromptUser from './components/ModalPromptUser';
|
|
17
17
|
|
|
18
18
|
import TableContextMenu from './components/TableContextMenu';
|
|
19
|
-
import DefaultButton from './components/Buttons/DefaultButton/DefaultButton
|
|
19
|
+
import DefaultButton from './components/Buttons/DefaultButton/DefaultButton';
|
|
20
20
|
|
|
21
21
|
export {
|
|
22
22
|
DataTableEmptyWrapper,
|
|
@@ -46,3 +46,5 @@ export * from './components/Buttons/ExportButton/';
|
|
|
46
46
|
export * from './components/Buttons/ImportButton/';
|
|
47
47
|
export * from './components/Buttons/ToggleButton/';
|
|
48
48
|
export * from './components/Buttons/RemoveButton/';
|
|
49
|
+
export * from './components/Logos/ProductLogo/';
|
|
50
|
+
export * from './components/Logos/OriginatorLogo/';
|