@farm-investimentos/front-mfe-components-vue3 0.3.1 → 0.3.3
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 +10 -10
- 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 +10 -10
- 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/ContextMenu/ContextMenu.vue +9 -3
- package/src/components/DialogFooter/DialogFooter.scss +1 -1
- package/src/components/Modal/Modal.stories.js +2 -0
- package/src/components/SelectAutoComplete/SelectAutoComplete.stories.js +17 -0
- package/src/examples/Dialog.stories.js +37 -1
- package/src/plugins/DialogPrompt/index.ts +2 -1
- package/src/plugins/DialogPrompt/utils/bootstrap.ts +10 -2
- package/src/stories/Introduction.stories.mdx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farm-investimentos/front-mfe-components-vue3",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -93,4 +93,4 @@
|
|
|
93
93
|
"publishConfig": {
|
|
94
94
|
"@farm-investimentos:registry": "https://registry.npmjs.org"
|
|
95
95
|
}
|
|
96
|
-
}
|
|
96
|
+
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
2
|
+
<div
|
|
3
|
+
class="farm-contextmenu"
|
|
4
|
+
ref="parent"
|
|
5
|
+
>
|
|
6
|
+
<span
|
|
7
|
+
ref="activator"
|
|
8
|
+
@click="click"
|
|
9
|
+
>
|
|
4
10
|
<slot name="activator"></slot>
|
|
5
11
|
</span>
|
|
6
12
|
|
|
@@ -78,7 +84,7 @@ export default {
|
|
|
78
84
|
minWidth: 0,
|
|
79
85
|
top: 0,
|
|
80
86
|
zIndex: 1,
|
|
81
|
-
maxHeight: parseInt(
|
|
87
|
+
maxHeight: parseInt(maxHeight.value as any) + 'px',
|
|
82
88
|
} as any);
|
|
83
89
|
|
|
84
90
|
const inputValue = ref(props.modelValue);
|
|
@@ -14,6 +14,23 @@ export const Primary = () => ({
|
|
|
14
14
|
{ value: 1, text: 'value 1' },
|
|
15
15
|
{ value: 2, text: 'value 2' },
|
|
16
16
|
{ value: 3, text: 'value 3' },
|
|
17
|
+
{ value: 4, text: 'value 4' },
|
|
18
|
+
{ value: 5, text: 'value 5' },
|
|
19
|
+
{ value: 6, text: 'value 6' },
|
|
20
|
+
{ value: 7, text: 'value 7' },
|
|
21
|
+
{ value: 8, text: 'value 8' },
|
|
22
|
+
{ value: 9, text: 'value 9' },
|
|
23
|
+
{ value: 10, text: 'value 10' },
|
|
24
|
+
{ value: 11, text: 'value 11' },
|
|
25
|
+
{ value: 12, text: 'value 12' },
|
|
26
|
+
{ value: 13, text: 'value 13' },
|
|
27
|
+
{ value: 14, text: 'value 14' },
|
|
28
|
+
{ value: 15, text: 'value 15' },
|
|
29
|
+
{ value: 16, text: 'value 16' },
|
|
30
|
+
{ value: 17, text: 'value 17' },
|
|
31
|
+
{ value: 18, text: 'value 18' },
|
|
32
|
+
{ value: 19, text: 'value 19' },
|
|
33
|
+
{ value: 20, text: 'value 20' },
|
|
17
34
|
],
|
|
18
35
|
};
|
|
19
36
|
},
|
|
@@ -126,4 +126,40 @@ export const CustomHtml = () => ({
|
|
|
126
126
|
Open
|
|
127
127
|
</farm-btn>
|
|
128
128
|
</div>`,
|
|
129
|
-
});
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
export const OpenTwice = () => ({
|
|
132
|
+
methods: {
|
|
133
|
+
openDialog() {
|
|
134
|
+
this.$dialog.confirm(
|
|
135
|
+
{
|
|
136
|
+
title: 'Dialog title',
|
|
137
|
+
body: 'Dialog content',
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
html: true,
|
|
141
|
+
okText: 'OK',
|
|
142
|
+
cancelText: 'Cancel',
|
|
143
|
+
}
|
|
144
|
+
).finally( () => {});
|
|
145
|
+
|
|
146
|
+
setTimeout(() => {
|
|
147
|
+
this.$dialog.alert(
|
|
148
|
+
{
|
|
149
|
+
title: 'Dialog title',
|
|
150
|
+
body: 'Dialog content',
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
html: true,
|
|
154
|
+
okText: 'Cancel',
|
|
155
|
+
}
|
|
156
|
+
).finally( () => {});
|
|
157
|
+
}, 2000);
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
template: `<div style="display: flex; flex-direction: column; max-width: 160px; width: 100%;">
|
|
161
|
+
<farm-btn @click="openDialog">
|
|
162
|
+
Open
|
|
163
|
+
</farm-btn>
|
|
164
|
+
</div>`,
|
|
165
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import calculateMainZindex from '../../helpers/calculateMainZindex';
|
|
2
1
|
import { bootstrap, modalFooter, modalHeader } from './utils';
|
|
3
2
|
|
|
3
|
+
import calculateMainZindex from '../../helpers/calculateMainZindex';
|
|
4
|
+
|
|
4
5
|
export interface IDialogPromptOptions {
|
|
5
6
|
title: string;
|
|
6
7
|
body: string;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
const DIALOG_ID = 'farm-dialog-prompt-identifier';
|
|
2
|
+
const OVERLAY_CLASS = 'farm-modal--overlay';
|
|
3
|
+
const CONTAINER_CLASS = 'farm-modal--container';
|
|
2
4
|
|
|
3
5
|
export default function (): { container: HTMLElement; backdrop: HTMLElement; modal: HTMLElement } {
|
|
4
6
|
let container;
|
|
5
7
|
if (document.getElementById(DIALOG_ID)) {
|
|
6
8
|
container = document.getElementById(DIALOG_ID);
|
|
9
|
+
if(document.getElementsByClassName(OVERLAY_CLASS).length > 0) {
|
|
10
|
+
container.removeChild(document.getElementsByClassName(OVERLAY_CLASS)[0]);
|
|
11
|
+
}
|
|
12
|
+
if(document.getElementsByClassName(CONTAINER_CLASS).length > 0) {
|
|
13
|
+
container.removeChild(document.getElementsByClassName(CONTAINER_CLASS)[0]);
|
|
14
|
+
}
|
|
7
15
|
} else {
|
|
8
16
|
container = document.createElement('div');
|
|
9
17
|
container.className = 'farm-modal';
|
|
@@ -11,10 +19,10 @@ export default function (): { container: HTMLElement; backdrop: HTMLElement; mod
|
|
|
11
19
|
}
|
|
12
20
|
|
|
13
21
|
const backdrop = document.createElement('div');
|
|
14
|
-
backdrop.className =
|
|
22
|
+
backdrop.className = OVERLAY_CLASS;
|
|
15
23
|
|
|
16
24
|
const modal = document.createElement('div');
|
|
17
|
-
modal.className =
|
|
25
|
+
modal.className = CONTAINER_CLASS;
|
|
18
26
|
|
|
19
27
|
modal.style.width = '98%';
|
|
20
28
|
modal.style.maxWidth = '400px';
|
|
@@ -113,6 +113,6 @@ import imageFile from './assets/logo_farmtech.svg';
|
|
|
113
113
|
|
|
114
114
|
<img src={imageFile} />
|
|
115
115
|
|
|
116
|
-
Here you can find the components from the Farmtech's Design System on the top of Vue
|
|
116
|
+
Here you can find the components from the Farmtech's Design System on the top of Vue 3.
|
|
117
117
|
|
|
118
118
|
Currrent version: {VERSION}
|