@farm-investimentos/front-mfe-components 15.8.2 → 15.8.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/dist/front-mfe-components.common.js +212 -184
- 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 +212 -184
- 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/Buttons/DefaultButton/DefaultButton.vue +1 -1
- package/src/components/ContextMenu/ContextMenu.scss +8 -1
- package/src/components/ContextMenu/ContextMenu.vue +8 -0
- package/src/components/DatePicker/DatePicker.stories.js +12 -6
- package/src/components/DatePicker/DatePicker.vue +10 -1
- package/src/components/RangeDatePicker/RangeDatePicker.stories.js +12 -0
- package/src/components/RangeDatePicker/RangeDatePicker.vue +8 -0
package/package.json
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
:class="{
|
|
10
10
|
'farm-contextmenu__popup': true,
|
|
11
11
|
'farm-contextmenu__popup--visible': inputValue,
|
|
12
|
+
'farm-contextmenu__popup--fixed': fixedCentered,
|
|
12
13
|
}"
|
|
13
14
|
:style="styles"
|
|
14
15
|
>
|
|
@@ -66,6 +67,13 @@ export default defineComponent({
|
|
|
66
67
|
type: [Number, String],
|
|
67
68
|
default: null,
|
|
68
69
|
},
|
|
70
|
+
/**
|
|
71
|
+
* Should be in the center of the screen
|
|
72
|
+
*/
|
|
73
|
+
fixedCentered: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: false,
|
|
76
|
+
},
|
|
69
77
|
},
|
|
70
78
|
setup(props, { emit }) {
|
|
71
79
|
const parent = ref(null);
|
|
@@ -85,11 +85,11 @@ export const OnlyAllowedDates = () => ({
|
|
|
85
85
|
},
|
|
86
86
|
props: {
|
|
87
87
|
allowedDates: {
|
|
88
|
-
default: () =>
|
|
88
|
+
default: () => value => {
|
|
89
89
|
const day = parseInt(value.split('-')[2], 10);
|
|
90
90
|
return [5, 10, 15, 20, 25].includes(day);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
93
|
},
|
|
94
94
|
template: `<div style='max-width: 320px'><farm-input-datepicker position="bottom" :allowed-dates="allowedDates" inputId="input-custom-id-1" v-model="date" /></div>`,
|
|
95
95
|
});
|
|
@@ -98,7 +98,7 @@ export const WithInitialMonth = () => ({
|
|
|
98
98
|
data() {
|
|
99
99
|
return {
|
|
100
100
|
date: '',
|
|
101
|
-
pickerDate: '2023-01'
|
|
101
|
+
pickerDate: '2023-01',
|
|
102
102
|
};
|
|
103
103
|
},
|
|
104
104
|
template: `<div style='max-width: 320px'>
|
|
@@ -140,10 +140,16 @@ export const MultipleDates = () => ({
|
|
|
140
140
|
computed: {
|
|
141
141
|
dates() {
|
|
142
142
|
return this.date.join(' /// ');
|
|
143
|
-
}
|
|
143
|
+
},
|
|
144
144
|
},
|
|
145
145
|
template: `<div style='max-width: 320px'>
|
|
146
146
|
<farm-input-datepicker inputId="input-custom-id-0" v-model="date" multiple />
|
|
147
147
|
{{ dates }}
|
|
148
148
|
</div>`,
|
|
149
|
-
});
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
export const Disabled = () => ({
|
|
152
|
+
template: `<div style='max-width: 320px'>
|
|
153
|
+
<farm-input-datepicker :disabled="true" value="2021-08-01" inputId="input-custom-id-3"/>
|
|
154
|
+
</div>`,
|
|
155
|
+
});
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
maxHeight="auto"
|
|
7
7
|
:bottom="position === 'bottom'"
|
|
8
8
|
:top="position === 'top'"
|
|
9
|
+
:fixedCentered="position === 'fixed-centered'"
|
|
9
10
|
popup-width="320"
|
|
10
11
|
>
|
|
11
12
|
<v-date-picker
|
|
@@ -50,6 +51,7 @@
|
|
|
50
51
|
:mask="`${isReadonly ? '' : '##/##/####'}`"
|
|
51
52
|
:id="inputId"
|
|
52
53
|
:rules="rules"
|
|
54
|
+
:disabled="disabled"
|
|
53
55
|
@keyup="keyUpInput"
|
|
54
56
|
/>
|
|
55
57
|
</template>
|
|
@@ -105,7 +107,7 @@ export default defineComponent({
|
|
|
105
107
|
* Min date (ISO format)
|
|
106
108
|
*/
|
|
107
109
|
position: {
|
|
108
|
-
type: String as PropType<'top' | 'bottom' | 'center'>,
|
|
110
|
+
type: String as PropType<'top' | 'bottom' | 'center' | 'fixed-centered'>,
|
|
109
111
|
default: 'bottom',
|
|
110
112
|
},
|
|
111
113
|
/**
|
|
@@ -137,6 +139,13 @@ export default defineComponent({
|
|
|
137
139
|
type: Boolean,
|
|
138
140
|
default: false,
|
|
139
141
|
},
|
|
142
|
+
/**
|
|
143
|
+
* Disabled field
|
|
144
|
+
*/
|
|
145
|
+
disabled: {
|
|
146
|
+
type: Boolean,
|
|
147
|
+
default: false,
|
|
148
|
+
},
|
|
140
149
|
},
|
|
141
150
|
data() {
|
|
142
151
|
const s = this.formatDateRange(this.value);
|
|
@@ -81,3 +81,15 @@ export const Reset = () => ({
|
|
|
81
81
|
</farm-btn>
|
|
82
82
|
</div>`,
|
|
83
83
|
});
|
|
84
|
+
|
|
85
|
+
export const disabled = () => ({
|
|
86
|
+
data() {
|
|
87
|
+
return {
|
|
88
|
+
date: ['2023-08-01', '2023-08-05'],
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
template: `<div style='max-width: 320px'>
|
|
92
|
+
<RangeDatePicker disabled inputId="input-custom-id" :value="date" />
|
|
93
|
+
date: {{ date }}
|
|
94
|
+
</div>`,
|
|
95
|
+
});
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
:id="inputId"
|
|
50
50
|
:mask="`${readonly ? [''] : ['##/##/####' + ' a ' + '##/##/####']}`"
|
|
51
51
|
:rules="[checkDateValid, checkRequire]"
|
|
52
|
+
:disabled="disabled"
|
|
52
53
|
@keyup="keyUpInput"
|
|
53
54
|
/>
|
|
54
55
|
</template>
|
|
@@ -115,6 +116,13 @@ export default defineComponent({
|
|
|
115
116
|
type: Boolean,
|
|
116
117
|
default: false,
|
|
117
118
|
},
|
|
119
|
+
/**
|
|
120
|
+
* Disabled field
|
|
121
|
+
*/
|
|
122
|
+
disabled: {
|
|
123
|
+
type: Boolean,
|
|
124
|
+
default: false,
|
|
125
|
+
},
|
|
118
126
|
},
|
|
119
127
|
data() {
|
|
120
128
|
const s = this.formatDateRange(this.value);
|