@farm-investimentos/front-mfe-components-vue3 1.1.1 → 1.1.4

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/package.json CHANGED
@@ -1,103 +1,103 @@
1
1
  {
2
- "name": "@farm-investimentos/front-mfe-components-vue3",
3
- "version": "1.1.1",
4
- "private": false,
5
- "repository": {
6
- "type": "git",
7
- "url": "git://github.com/Farm-Investimentos/front-mfe-components-vue3.git"
8
- },
9
- "author": "farm investimentos",
10
- "main": "./dist/front-mfe-components.common.js",
11
- "jsdelivr": "dist/front-mfe-components.umd.min.js",
12
- "unpkg": "dist/front-mfe-components.umd.min.js",
13
- "files": [
14
- "dist/*",
15
- "src/*"
16
- ],
17
- "scripts": {
18
- "build": "npm run build:components",
19
- "build-storybook": "storybook build",
20
- "build:components": "vue-cli-service build --target lib --name front-mfe-components src/main.ts",
21
- "lint": "vue-cli-service lint --fix",
22
- "serve": "vue-cli-service serve",
23
- "serve:storybook": "http-server ./storybook-static/",
24
- "storybook": "storybook dev -p 6006",
25
- "test:coverage": "jest --coverage --runInBand",
26
- "test:unit": "jest --runInBand",
27
- "prepare": "husky"
28
- },
29
- "browserslist": [
30
- "> 1%",
31
- "last 2 versions",
32
- "not dead"
33
- ],
34
- "dependencies": {
35
- "@storybook/test": "^8.2.9",
36
- "@vuepic/vue-datepicker": "8.2.0",
37
- "core-js": "3.33.1",
38
- "text-mask-addons": "^3.8.0",
39
- "v-mask": "2.3.0",
40
- "v-money3": "^3.24.0",
41
- "vuetify": "3.5.7",
42
- "webpack": "5.94.0"
43
- },
44
- "devDependencies": {
45
- "@babel/core": "7.17.9",
46
- "@babel/generator": "7.17.9",
47
- "@farm-investimentos/front-mfe-libs-ts": "3.0.5",
48
- "@storybook/addon-essentials": "^8.2.9",
49
- "@storybook/addon-interactions": "^8.2.9",
50
- "@storybook/addon-links": "^8.2.9",
51
- "@storybook/addon-mdx-gfm": "^8.2.9",
52
- "@storybook/blocks": "^8.2.9",
53
- "@storybook/manager-api": "^8.2.9",
54
- "@storybook/theming": "^8.2.9",
55
- "@storybook/vue3": "^8.2.9",
56
- "@storybook/vue3-vite": "^8.2.9",
57
- "@tsconfig/node18": "^18.2.2",
58
- "@types/jest": "^29.5.12",
59
- "@types/node": "^18.17.17",
60
- "@typescript-eslint/eslint-plugin": "^4.18.0",
61
- "@typescript-eslint/parser": "^4.18.0",
62
- "@vitejs/plugin-vue": "^4.6.2",
63
- "@vue/cli-plugin-babel": "^5.0.0",
64
- "@vue/cli-plugin-eslint": "^4.5.0",
65
- "@vue/cli-plugin-typescript": "^4.5.0",
66
- "@vue/cli-service": "^5.0.8",
67
- "@vue/compiler-sfc": "^3.0.0",
68
- "@vue/eslint-config-typescript": "^7.0.0",
69
- "@vue/test-utils": "^2.3.2",
70
- "@vue/tsconfig": "^0.4.0",
71
- "@vue/vue3-jest": "29.2.6",
72
- "babel-eslint": "^10.1.0",
73
- "babel-jest": "^29.5.0",
74
- "babel-loader": "^8.3.0",
75
- "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
76
- "eslint": "^6.7.2",
77
- "eslint-plugin-import": "^2.29.0",
78
- "eslint-plugin-vue": "^7.1.0",
79
- "husky": "^9.0.11",
80
- "jest": "29.7.0",
81
- "jest-environment-jsdom": "^29.0.0",
82
- "npm-run-all2": "^6.0.6",
83
- "react": "^18.2.0",
84
- "react-dom": "^18.2.0",
85
- "sass": "~1.32.0",
86
- "sass-loader": "10.4.1",
87
- "storybook": "^8.2.9",
88
- "style-loader": "^3.3.3",
89
- "ts-jest": "^29.0.0",
90
- "typescript": "~4.1.5",
91
- "vite": "^4.4.9",
92
- "vue": "3.4.37",
93
- "vue-loader": "^16.8.3",
94
- "vue-tsc": "^1.8.11",
95
- "webpack-cli": "^5.1.4"
96
- },
97
- "engines": {
98
- "node": "~20"
99
- },
100
- "publishConfig": {
101
- "@farm-investimentos:registry": "https://registry.npmjs.org"
102
- }
103
- }
2
+ "name": "@farm-investimentos/front-mfe-components-vue3",
3
+ "version": "1.1.4",
4
+ "private": false,
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git://github.com/Farm-Investimentos/front-mfe-components-vue3.git"
8
+ },
9
+ "author": "farm investimentos",
10
+ "main": "./dist/front-mfe-components.common.js",
11
+ "jsdelivr": "dist/front-mfe-components.umd.min.js",
12
+ "unpkg": "dist/front-mfe-components.umd.min.js",
13
+ "files": [
14
+ "dist/*",
15
+ "src/*"
16
+ ],
17
+ "scripts": {
18
+ "build": "npm run build:components",
19
+ "build-storybook": "storybook build",
20
+ "build:components": "vue-cli-service build --target lib --name front-mfe-components src/main.ts",
21
+ "lint": "vue-cli-service lint --fix",
22
+ "serve": "vue-cli-service serve",
23
+ "serve:storybook": "http-server ./storybook-static/",
24
+ "storybook": "storybook dev -p 6006",
25
+ "test:coverage": "jest --coverage --runInBand",
26
+ "test:unit": "jest --runInBand",
27
+ "prepare": "husky"
28
+ },
29
+ "browserslist": [
30
+ "> 1%",
31
+ "last 2 versions",
32
+ "not dead"
33
+ ],
34
+ "dependencies": {
35
+ "@storybook/test": "^8.2.9",
36
+ "@vuepic/vue-datepicker": "8.2.0",
37
+ "core-js": "3.33.1",
38
+ "text-mask-addons": "^3.8.0",
39
+ "v-mask": "2.3.0",
40
+ "v-money3": "^3.24.0",
41
+ "vuetify": "3.5.7",
42
+ "webpack": "5.94.0"
43
+ },
44
+ "devDependencies": {
45
+ "@babel/core": "7.17.9",
46
+ "@babel/generator": "7.17.9",
47
+ "@farm-investimentos/front-mfe-libs-ts": "3.0.5",
48
+ "@storybook/addon-essentials": "^8.2.9",
49
+ "@storybook/addon-interactions": "^8.2.9",
50
+ "@storybook/addon-links": "^8.2.9",
51
+ "@storybook/addon-mdx-gfm": "^8.2.9",
52
+ "@storybook/blocks": "^8.2.9",
53
+ "@storybook/manager-api": "^8.2.9",
54
+ "@storybook/theming": "^8.2.9",
55
+ "@storybook/vue3": "^8.2.9",
56
+ "@storybook/vue3-vite": "^8.2.9",
57
+ "@tsconfig/node18": "^18.2.2",
58
+ "@types/jest": "^29.5.12",
59
+ "@types/node": "^18.17.17",
60
+ "@typescript-eslint/eslint-plugin": "^4.18.0",
61
+ "@typescript-eslint/parser": "^4.18.0",
62
+ "@vitejs/plugin-vue": "^4.6.2",
63
+ "@vue/cli-plugin-babel": "^5.0.0",
64
+ "@vue/cli-plugin-eslint": "^4.5.0",
65
+ "@vue/cli-plugin-typescript": "^4.5.0",
66
+ "@vue/cli-service": "^5.0.8",
67
+ "@vue/compiler-sfc": "^3.0.0",
68
+ "@vue/eslint-config-typescript": "^7.0.0",
69
+ "@vue/test-utils": "^2.3.2",
70
+ "@vue/tsconfig": "^0.4.0",
71
+ "@vue/vue3-jest": "29.2.6",
72
+ "babel-eslint": "^10.1.0",
73
+ "babel-jest": "^29.5.0",
74
+ "babel-loader": "^8.3.0",
75
+ "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
76
+ "eslint": "^6.7.2",
77
+ "eslint-plugin-import": "^2.29.0",
78
+ "eslint-plugin-vue": "^7.1.0",
79
+ "husky": "^9.0.11",
80
+ "jest": "29.7.0",
81
+ "jest-environment-jsdom": "^29.0.0",
82
+ "npm-run-all2": "^6.0.6",
83
+ "react": "^18.2.0",
84
+ "react-dom": "^18.2.0",
85
+ "sass": "~1.32.0",
86
+ "sass-loader": "10.4.1",
87
+ "storybook": "^8.2.9",
88
+ "style-loader": "^3.3.3",
89
+ "ts-jest": "^29.0.0",
90
+ "typescript": "~4.1.5",
91
+ "vite": "^4.4.9",
92
+ "vue": "3.4.37",
93
+ "vue-loader": "^16.8.3",
94
+ "vue-tsc": "^1.8.11",
95
+ "webpack-cli": "^5.1.4"
96
+ },
97
+ "engines": {
98
+ "node": "~20"
99
+ },
100
+ "publishConfig": {
101
+ "@farm-investimentos:registry": "https://registry.npmjs.org"
102
+ }
103
+ }
@@ -3,7 +3,7 @@
3
3
  <farm-btn v-if="hasCancel" color="primary" plain @click="$emit('onClose')">
4
4
  {{ closeLabel }}
5
5
  </farm-btn>
6
-
6
+
7
7
  <farm-btn
8
8
  v-for="button in extraButtons"
9
9
  :key="button.label"
@@ -11,16 +11,17 @@
11
11
  :outlined="button.outlined"
12
12
  :disabled="button.disabled"
13
13
  :title="button.label"
14
- @click="$emit(button.listener ? button.listener : '')"
14
+ @click="emitExtraButtonListener(button)"
15
15
  >
16
16
  {{ button.label }}
17
17
  </farm-btn>
18
+
18
19
  <farm-btn
19
20
  v-if="hasConfirm"
20
21
  :color="confirmColor"
21
22
  :disabled="isConfirmDisabled"
22
23
  :title="confirmLabel"
23
- @click="$emit('onConfirm')"
24
+ @click="emitConfirm"
24
25
  >
25
26
  <farm-icon v-if="confirmIcon">{{ confirmIcon }}</farm-icon>
26
27
  {{ confirmLabel }}
@@ -28,76 +29,70 @@
28
29
  </div>
29
30
  </template>
30
31
 
31
- <script lang="ts">
32
- import { PropType } from 'vue';
32
+ <script setup lang="ts">
33
+ import { PropType, defineEmits } from 'vue';
33
34
 
34
- import IExtraButton from './IExtraButton';
35
+ interface IExtraButton {
36
+ label: string;
37
+ color: string;
38
+ outlined: boolean;
39
+ disabled: boolean;
40
+ listener: Function | null;
41
+ }
35
42
 
36
- /**
37
- * Footer de dialog/modal
38
- */
39
- export default {
43
+ defineOptions({
40
44
  name: 'farm-dialog-footer',
41
- props: {
42
- /**
43
- * Label do botão de confirmação
44
- */
45
- confirmLabel: {
46
- type: String,
47
- default: 'Confirmar',
48
- },
49
- /**
50
- * Label do botão de fechar
51
- */
52
- closeLabel: {
53
- type: String,
54
- default: 'Fechar',
55
- },
56
- /**
57
- * Exibe/esconde botão de confirmação
58
- */
59
- hasConfirm: {
60
- type: Boolean,
61
- default: true,
62
- },
63
- /**
64
- * Exibe/esconde botão de cancelar
65
- */
66
- hasCancel: {
67
- type: Boolean,
68
- default: true,
69
- },
70
- /**
71
- * Cor do botão de confirmação - usa as do tema do vuetify
72
- */
73
- confirmColor: {
74
- type: String,
75
- default: 'primary',
76
- },
77
- /**
78
- * Ícone no botão Confirmar
79
- */
80
- confirmIcon: {
81
- type: String,
82
- default: null,
83
- },
84
- /**
85
- * Desabilita botão de confirmação
86
- */
87
- isConfirmDisabled: {
88
- type: Boolean,
89
- default: false,
90
- },
91
- /**
92
- * lista de botões extra (IExtraButton)
93
- */
94
- extraButtons: {
95
- type: Array as PropType<Array<IExtraButton>>,
96
- default: () => [],
97
- },
45
+ });
46
+
47
+ defineProps({
48
+ confirmLabel: {
49
+ type: String,
50
+ default: 'Confirmar',
51
+ },
52
+ closeLabel: {
53
+ type: String,
54
+ default: 'Fechar',
55
+ },
56
+ hasConfirm: {
57
+ type: Boolean,
58
+ default: true,
59
+ },
60
+ hasCancel: {
61
+ type: Boolean,
62
+ default: true,
63
+ },
64
+ confirmColor: {
65
+ type: String,
66
+ default: 'primary',
67
+ },
68
+ confirmIcon: {
69
+ type: String,
70
+ default: null,
98
71
  },
72
+ isConfirmDisabled: {
73
+ type: Boolean,
74
+ default: false,
75
+ },
76
+ extraButtons: {
77
+ type: Array as PropType<IExtraButton[]>,
78
+ default: () => [],
79
+ },
80
+ });
81
+
82
+ const emit = defineEmits(['onClose', 'onConfirm']);
83
+
84
+ const emitConfirm = () => {
85
+ emit('onConfirm');
86
+ };
87
+
88
+
89
+ const emitExtraButtonListener = (button: IExtraButton) => {
90
+ if (button.listener) {
91
+ emit(button.listener);
92
+ }
99
93
  };
100
94
  </script>
95
+
101
96
  <style lang="scss" scoped>
102
97
  @import 'DialogFooter';
103
98
  </style>