@nixweb/nixloc-ui 1.6.0 → 1.8.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/package.json
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<div>
|
|
4
|
-
<div class="div-btn side-by-side">
|
|
4
|
+
<div v-if="!showSearch" class="div-btn side-by-side">
|
|
5
5
|
<Button _key="btnShow" color="black" backGroundColor="#F0F0F0"
|
|
6
6
|
:title="' ' + quantitySelected + ' ' + title + ' selecionado(s)'"
|
|
7
7
|
classIcon="fa-sharp fa-solid fa-ballot-check" size="small" :clicked="showHide" />
|
|
8
8
|
</div>
|
|
9
9
|
<div v-show="show" class="side-by-side">
|
|
10
10
|
<div class="input-container">
|
|
11
|
-
<input type="text" v-model="baseParams.search" placeholder="Pesquisar..." />
|
|
11
|
+
<input type="text" v-model="baseParams.search" placeholder="Pesquisar..." @keyup.enter.prevent="getAll" />
|
|
12
|
+
<Button _key="btnSearch" :disabled="baseParams.search == ''" type="info"
|
|
13
|
+
classIcon="fa-solid fa-magnifying-glass" size="small" :clicked="getAll" />
|
|
14
|
+
<Button _key="btnClean" :disabled="baseParams.search == ''" type="info" classIcon="fa-solid fa-broom"
|
|
15
|
+
size="small" :clicked="clean" />
|
|
12
16
|
</div>
|
|
13
17
|
</div>
|
|
14
18
|
|
|
@@ -18,19 +22,26 @@
|
|
|
18
22
|
<Loading type="line" :center="false" v-show="loading" />
|
|
19
23
|
</div>
|
|
20
24
|
<ScrollBar :minHeight="0" :maxHeight="200">
|
|
21
|
-
<div class="div-check">
|
|
25
|
+
<div v-if="multipleSelection" class="div-check">
|
|
22
26
|
<div class="div-items" v-for="item in data" :key="item.id">
|
|
23
27
|
<b-form-checkbox v-model="item.selected" @change="add(item)">
|
|
24
28
|
<span class="title">{{ item.content }}</span>
|
|
25
29
|
</b-form-checkbox>
|
|
26
30
|
</div>
|
|
27
31
|
</div>
|
|
32
|
+
<div v-else class="div-check">
|
|
33
|
+
<b-form-group>
|
|
34
|
+
<b-form-radio-group v-model="selected" :options="options" :stacked="true"></b-form-radio-group>
|
|
35
|
+
</b-form-group>
|
|
36
|
+
</div>
|
|
28
37
|
<div v-if="totalRecords > 20 && data.length < totalRecords">
|
|
29
38
|
<div class="after-list text-center">
|
|
30
|
-
<Button key="loadingMore" type="info" title="Carregar mais..."
|
|
31
|
-
:clicked="loadingMore" />
|
|
39
|
+
<Button key="loadingMore" type="info" title="Carregar mais..." size="small" :clicked="loadingMore" />
|
|
32
40
|
</div>
|
|
33
41
|
</div>
|
|
42
|
+
<div class="title" v-if="data.length == 0">
|
|
43
|
+
Nenhum registro encontrado!
|
|
44
|
+
</div>
|
|
34
45
|
</ScrollBar>
|
|
35
46
|
</div>
|
|
36
47
|
</div>
|
|
@@ -52,8 +63,17 @@ export default {
|
|
|
52
63
|
props: {
|
|
53
64
|
title: String,
|
|
54
65
|
url: String,
|
|
66
|
+
multipleSelection: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: true
|
|
69
|
+
},
|
|
70
|
+
showSearch: {
|
|
71
|
+
type: Boolean,
|
|
72
|
+
default: false
|
|
73
|
+
},
|
|
55
74
|
propsParams: Object,
|
|
56
75
|
value: Array,
|
|
76
|
+
changed: Function,
|
|
57
77
|
},
|
|
58
78
|
data() {
|
|
59
79
|
return {
|
|
@@ -65,22 +85,29 @@ export default {
|
|
|
65
85
|
baseParams: {
|
|
66
86
|
search: "",
|
|
67
87
|
currentPage: 1,
|
|
68
|
-
totalPerPage:
|
|
88
|
+
totalPerPage: 50,
|
|
69
89
|
},
|
|
70
90
|
};
|
|
71
91
|
},
|
|
72
92
|
mounted() {
|
|
73
93
|
this.getAll();
|
|
74
|
-
|
|
94
|
+
if (this.showSearch) this.showHide();
|
|
75
95
|
if (this.value.length > 0) {
|
|
76
96
|
this.selected = this.value;
|
|
77
97
|
}
|
|
78
|
-
|
|
79
98
|
},
|
|
80
99
|
computed: {
|
|
81
100
|
...mapGetters("generic", ["showModal", "event"]),
|
|
82
101
|
quantitySelected() {
|
|
83
102
|
return this.selected.length > 0 ? this.selected.length : 0;
|
|
103
|
+
},
|
|
104
|
+
options() {
|
|
105
|
+
let final = [];
|
|
106
|
+
this.data.forEach(item => {
|
|
107
|
+
let obj = { text: item.content, value: item.id };
|
|
108
|
+
final.push(obj);
|
|
109
|
+
});
|
|
110
|
+
return final;
|
|
84
111
|
}
|
|
85
112
|
},
|
|
86
113
|
methods: {
|
|
@@ -104,7 +131,7 @@ export default {
|
|
|
104
131
|
this.markSelected();
|
|
105
132
|
|
|
106
133
|
this.loading = false;
|
|
107
|
-
this.removeLoading(["loadingMore"]);
|
|
134
|
+
this.removeLoading(["loadingMore", "btnSearch", "btnClean"]);
|
|
108
135
|
});
|
|
109
136
|
},
|
|
110
137
|
loadingMore() {
|
|
@@ -123,6 +150,14 @@ export default {
|
|
|
123
150
|
this.show = this.show == true ? false : true;
|
|
124
151
|
this.removeLoading(["btnShow"]);
|
|
125
152
|
},
|
|
153
|
+
clean() {
|
|
154
|
+
this.baseParams = {
|
|
155
|
+
search: "",
|
|
156
|
+
currentPage: 1,
|
|
157
|
+
totalPerPage: 50,
|
|
158
|
+
}
|
|
159
|
+
this.getAll();
|
|
160
|
+
},
|
|
126
161
|
markSelected() {
|
|
127
162
|
this.data.forEach(item => {
|
|
128
163
|
if (this.selected.includes(item.content)) {
|
|
@@ -134,13 +169,23 @@ export default {
|
|
|
134
169
|
watch: {
|
|
135
170
|
selected: {
|
|
136
171
|
handler(value) {
|
|
137
|
-
|
|
172
|
+
if (value) {
|
|
173
|
+
this.$emit("input", value);
|
|
174
|
+
if (this.changed) this.changed(value);
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
deep: true,
|
|
178
|
+
},
|
|
179
|
+
event: {
|
|
180
|
+
handler(event) {
|
|
181
|
+
if (event.name == "cleanCheckboxServer")
|
|
182
|
+
this.selected = "";
|
|
138
183
|
},
|
|
139
184
|
deep: true,
|
|
140
185
|
},
|
|
141
186
|
'baseParams.search': {
|
|
142
187
|
handler(value) {
|
|
143
|
-
this.getAll();
|
|
188
|
+
// this.getAll();
|
|
144
189
|
},
|
|
145
190
|
deep: true,
|
|
146
191
|
},
|
|
@@ -1,452 +1,193 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="date-
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<button class="date-year-month-nav date-year-month-year" @click="decYear" :disabled="disabled">
|
|
16
|
-
<i class="fa-solid fa-angle-left"></i>
|
|
17
|
-
</button>
|
|
18
|
-
<span class="date-year-month-label" :class="{ 'date-year-month-muted': disabled }">{{ year }}</span>
|
|
19
|
-
<button class="date-year-month-nav date-year-month-year" @click="incYear" :disabled="disabled">
|
|
20
|
-
<i class="fa-solid fa-angle-right"></i>
|
|
21
|
-
</button>
|
|
22
|
-
</div>
|
|
23
|
-
|
|
24
|
-
<div class="date-year-month-sep" v-if="mode === 'month'"></div>
|
|
25
|
-
|
|
26
|
-
<div class="date-year-month-group" v-if="mode === 'month'">
|
|
27
|
-
<button class="date-year-month-nav date-year-month-month" @click="decMonth" :disabled="disabled">
|
|
28
|
-
<i class="fa-solid fa-angle-left"></i>
|
|
29
|
-
</button>
|
|
30
|
-
<span class="date-year-month-label" :class="{ 'date-year-month-muted': disabled }">{{ monthName }}</span>
|
|
31
|
-
<button class="date-year-month-nav date-year-month-month" @click="incMonth" :disabled="disabled">
|
|
32
|
-
<i class="fa-solid fa-angle-right"></i>
|
|
33
|
-
</button>
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
<div class="date-year-month-actions">
|
|
37
|
-
<div class="date-year-month-dropdown" ref="dd">
|
|
38
|
-
<button class="date-year-month-btn" @click="toggleMenu" :disabled="disabled">
|
|
39
|
-
<i class="fa-solid fa-filters"></i>
|
|
40
|
-
<span>{{ currentOptionLabel }}</span>
|
|
41
|
-
<i class="fa-solid fa-chevron-down"></i>
|
|
42
|
-
</button>
|
|
43
|
-
<ul v-if="menuOpen" class="date-year-month-menu">
|
|
44
|
-
<li class="date-year-month-option" @click="selectOption('today')">Hoje</li>
|
|
45
|
-
<li class="date-year-month-option" @click="selectOption('year')">Ano</li>
|
|
46
|
-
<li class="date-year-month-option" @click="selectOption('all')">Todos</li>
|
|
47
|
-
<li class="date-year-month-option" @click="selectOption('periodCustom')">Vencimento</li>
|
|
48
|
-
</ul>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
|
|
53
|
-
<transition name="date-year-month-pop">
|
|
54
|
-
<div v-if="showRange && !disabled" class="date-year-month-popover" :style="popoverStyle">
|
|
55
|
-
<div class="date-year-month-title">Período</div>
|
|
56
|
-
<DateTime :confirm="true" :range="true" field="dueDate" format="DD/MM/YYYY" type="date" placeholder
|
|
57
|
-
:required="false" v-model="startEnd" />
|
|
58
|
-
<div class="date-year-month-actions-row">
|
|
59
|
-
<button class="date-year-month-btn date-year-month-btn-ghost" @click="closeRange">Cancelar</button>
|
|
60
|
-
<button class="date-year-month-btn date-year-month-btn-apply" :disabled="!startEnd.length"
|
|
61
|
-
@click="applyStaticRange">Aplicar</button>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
</transition>
|
|
65
|
-
|
|
66
|
-
<transition name="date-year-month-pop">
|
|
67
|
-
<div v-if="showYearPicker && !disabled" class="date-year-month-popover" :style="popoverStyle">
|
|
68
|
-
<div class="date-year-month-title">Ano</div>
|
|
69
|
-
<div class="date-year-month-year-div">
|
|
70
|
-
<div class="date-year-month-year-row">
|
|
71
|
-
<button class="date-year-month-year-ctrl" @click="tempYear--" :disabled="tempYear <= 0"><i
|
|
72
|
-
class="fa-solid fa-minus"></i></button>
|
|
73
|
-
<input class="date-year-month-year-input" type="number" v-model.number="tempYear" />
|
|
74
|
-
<button class="date-year-month-year-ctrl" @click="tempYear++"><i class="fa-solid fa-plus"></i></button>
|
|
75
|
-
</div>
|
|
76
|
-
<div class="date-year-month-actions-row">
|
|
77
|
-
<button class="date-year-month-btn date-year-month-btn-ghost" @click="closeYearPicker">Cancelar</button>
|
|
78
|
-
<button class="date-year-month-btn date-year-month-btn-apply" @click="applyYear">Aplicar</button>
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
</transition>
|
|
2
|
+
<div class="date-filter">
|
|
3
|
+
<button @click="previous" class="navigation-button" :class="[buttonClass, { 'disabled': disabled }]"
|
|
4
|
+
:disabled="disabled">
|
|
5
|
+
<i class="fa-solid fa-chevron-left"></i>
|
|
6
|
+
</button>
|
|
7
|
+
<span class="date-display" :class="{ 'title-disabled': disabled }">{{ displayValue }} </span>
|
|
8
|
+
<span class="date-icon" @click="resetSelection()" :class="{ 'disabled': disabled }">
|
|
9
|
+
<i class="fa-solid fa-calendar-week"></i>
|
|
10
|
+
</span>
|
|
11
|
+
<button @click="next" class="navigation-button" :class="[buttonClass, { 'disabled': disabled }]"
|
|
12
|
+
:disabled="disabled">
|
|
13
|
+
<i class="fa-solid fa-chevron-right"></i>
|
|
14
|
+
</button>
|
|
83
15
|
</div>
|
|
84
16
|
</template>
|
|
85
17
|
|
|
86
18
|
<script>
|
|
87
|
-
|
|
88
|
-
import DateTime from "@nixweb/nixloc-ui/src/component/forms/DateTime";
|
|
89
|
-
|
|
90
|
-
const PT_BR_MONTHS = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
|
19
|
+
import { mapMutations } from "vuex";
|
|
91
20
|
|
|
92
21
|
export default {
|
|
93
|
-
name: "DateYearMonth",
|
|
94
|
-
components: {
|
|
95
|
-
DateTime
|
|
96
|
-
},
|
|
97
|
-
model: { prop: "value", event: "input" },
|
|
98
22
|
props: {
|
|
99
|
-
mode: {
|
|
23
|
+
mode: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: true,
|
|
26
|
+
validator(value) {
|
|
27
|
+
return ['month', 'year'].includes(value);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
100
30
|
value: {
|
|
101
|
-
type:
|
|
102
|
-
|
|
103
|
-
optionSelected: "",
|
|
104
|
-
startEnd: [],
|
|
105
|
-
year: new Date().getFullYear(),
|
|
106
|
-
month: new Date().getMonth() + 1
|
|
107
|
-
})
|
|
31
|
+
type: Number,
|
|
32
|
+
required: false
|
|
108
33
|
},
|
|
109
|
-
disabled: {
|
|
34
|
+
disabled: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false
|
|
37
|
+
}
|
|
110
38
|
},
|
|
111
39
|
data() {
|
|
112
|
-
const v = this.value || {};
|
|
113
40
|
return {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
year: Number.isFinite(v.year) ? v.year : new Date().getFullYear(),
|
|
117
|
-
month: Number.isFinite(v.month) ? v.month : (new Date().getMonth() + 1),
|
|
118
|
-
showRange: false,
|
|
119
|
-
showYearPicker: false,
|
|
120
|
-
tempYear: Number.isFinite(v.year) ? v.year : new Date().getFullYear(),
|
|
121
|
-
popoverStyle: {},
|
|
122
|
-
menuOpen: false
|
|
41
|
+
currentMonth: new Date().getMonth(),
|
|
42
|
+
currentYear: new Date().getFullYear()
|
|
123
43
|
};
|
|
124
44
|
},
|
|
125
|
-
created() {
|
|
126
|
-
|
|
127
|
-
monthName() { return PT_BR_MONTHS[(this.month - 1 + 12) % 12]; },
|
|
128
|
-
hasSelection() { return ["all", "today", "periodCustom", "year"].includes(this.optionSelected); },
|
|
129
|
-
badgeLabel() {
|
|
130
|
-
if (this.optionSelected === "all") return "Todos";
|
|
131
|
-
if (this.optionSelected === "today") return "Hoje";
|
|
132
|
-
if (this.optionSelected === "year") return `Ano ${this.year}`;
|
|
133
|
-
if (this.optionSelected === "periodCustom") return `${this.startEnd[0]} — ${this.startEnd[1]}`;
|
|
134
|
-
return "";
|
|
135
|
-
},
|
|
136
|
-
currentOptionLabel() {
|
|
137
|
-
if (this.optionSelected === "all") return "Todos";
|
|
138
|
-
if (this.optionSelected === "today") return "Hoje";
|
|
139
|
-
if (this.optionSelected === "year") return "Ano";
|
|
140
|
-
if (this.optionSelected === "periodCustom") return "Personalizado";
|
|
141
|
-
return "Mais";
|
|
142
|
-
}
|
|
45
|
+
created() {
|
|
46
|
+
this.resetSelection();
|
|
143
47
|
},
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
this.
|
|
151
|
-
|
|
152
|
-
|
|
48
|
+
mounted() {
|
|
49
|
+
this.sendEvent();
|
|
50
|
+
},
|
|
51
|
+
computed: {
|
|
52
|
+
displayValue() {
|
|
53
|
+
if (this.mode === 'month') {
|
|
54
|
+
return this.monthNames[this.currentMonth];
|
|
55
|
+
} else {
|
|
56
|
+
return this.currentYear;
|
|
153
57
|
}
|
|
58
|
+
},
|
|
59
|
+
monthNames() {
|
|
60
|
+
return ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'];
|
|
61
|
+
},
|
|
62
|
+
buttonClass() {
|
|
63
|
+
return this.mode === 'month' ? 'month-mode' : 'year-mode';
|
|
154
64
|
}
|
|
155
65
|
},
|
|
156
66
|
methods: {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
optionSelected: this.optionSelected,
|
|
160
|
-
startEnd: this.optionSelected === "periodCustom" ? this.startEnd : [],
|
|
161
|
-
year: this.year,
|
|
162
|
-
month: this.month
|
|
163
|
-
};
|
|
164
|
-
},
|
|
165
|
-
emitChanged() {
|
|
166
|
-
const p = this.payload();
|
|
167
|
-
this.$emit("input", p);
|
|
168
|
-
this.$emit("changed", p);
|
|
169
|
-
},
|
|
170
|
-
// navegação padrão
|
|
171
|
-
decYear() { if (this.disabled) return; this.year--; this.emitChanged(); },
|
|
172
|
-
incYear() { if (this.disabled) return; this.year++; this.emitChanged(); },
|
|
173
|
-
decMonth() {
|
|
174
|
-
if (this.disabled || this.mode !== "month") return;
|
|
175
|
-
if (this.month === 1) { this.month = 12; this.year--; } else { this.month--; }
|
|
176
|
-
this.emitChanged();
|
|
177
|
-
},
|
|
178
|
-
incMonth() {
|
|
179
|
-
if (this.disabled || this.mode !== "month") return;
|
|
180
|
-
if (this.month === 12) { this.month = 1; this.year++; } else { this.month++; }
|
|
181
|
-
this.emitChanged();
|
|
182
|
-
},
|
|
183
|
-
// dropdown
|
|
184
|
-
toggleMenu() {
|
|
67
|
+
...mapMutations("generic", ["addEvent"]),
|
|
68
|
+
previous() {
|
|
185
69
|
if (this.disabled) return;
|
|
186
|
-
this.
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
this.
|
|
193
|
-
document.removeEventListener("click", this.onClickOutside);
|
|
70
|
+
if (this.mode === 'month') {
|
|
71
|
+
this.currentMonth = (this.currentMonth + 11) % 12;
|
|
72
|
+
if (this.currentMonth === 11) {
|
|
73
|
+
this.currentYear--;
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
this.currentYear--;
|
|
194
77
|
}
|
|
78
|
+
this.$emit('input', this.getValue());
|
|
79
|
+
this.sendEvent();
|
|
195
80
|
},
|
|
196
|
-
|
|
197
|
-
this.
|
|
198
|
-
if (
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
this.
|
|
208
|
-
this.showRange = false;
|
|
209
|
-
this.emitChanged();
|
|
81
|
+
next() {
|
|
82
|
+
if (this.disabled) return;
|
|
83
|
+
if (this.mode === 'month') {
|
|
84
|
+
this.currentMonth = (this.currentMonth + 1) % 12;
|
|
85
|
+
if (this.currentMonth === 0) {
|
|
86
|
+
this.currentYear++;
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
this.currentYear++;
|
|
90
|
+
}
|
|
91
|
+
this.$emit('input', this.getValue());
|
|
92
|
+
this.sendEvent();
|
|
210
93
|
},
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
this.
|
|
214
|
-
|
|
215
|
-
|
|
94
|
+
resetSelection() {
|
|
95
|
+
const now = new Date();
|
|
96
|
+
if (this.mode === 'month') {
|
|
97
|
+
this.currentMonth = now.getMonth();
|
|
98
|
+
this.currentYear = now.getFullYear();
|
|
99
|
+
} else {
|
|
100
|
+
this.currentYear = now.getFullYear();
|
|
101
|
+
}
|
|
102
|
+
this.sendEvent();
|
|
216
103
|
},
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
this.
|
|
222
|
-
this.optionSelected = "year";
|
|
223
|
-
this.emitChanged();
|
|
104
|
+
getValue() {
|
|
105
|
+
if (this.mode === 'month') {
|
|
106
|
+
return (this.currentMonth + 1).toString();
|
|
107
|
+
} else {
|
|
108
|
+
return this.currentYear.toString();
|
|
224
109
|
}
|
|
225
|
-
this.showYearPicker = false;
|
|
226
110
|
},
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
this.
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
this.
|
|
235
|
-
this.showYearPicker = false;
|
|
236
|
-
this.emitChanged();
|
|
111
|
+
sendEvent() {
|
|
112
|
+
this.addEvent({ name: "dateYearMonth", data: { mode: this.mode, value: this.getValue() } });
|
|
113
|
+
this.$emit('input', this.getValue());
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
watch: {
|
|
117
|
+
mode(newMode) {
|
|
118
|
+
this.resetSelection();
|
|
237
119
|
},
|
|
238
|
-
|
|
239
|
-
this
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
this.
|
|
243
|
-
}
|
|
120
|
+
value(newValue) {
|
|
121
|
+
if (this.mode === 'month') {
|
|
122
|
+
this.currentMonth = newValue - 1;
|
|
123
|
+
} else {
|
|
124
|
+
this.currentYear = newValue;
|
|
125
|
+
}
|
|
244
126
|
}
|
|
245
|
-
}
|
|
127
|
+
},
|
|
246
128
|
};
|
|
247
129
|
</script>
|
|
248
130
|
|
|
249
131
|
<style scoped>
|
|
250
|
-
.date-
|
|
251
|
-
position: relative;
|
|
252
|
-
display: inline-block
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
.date-year-month-row {
|
|
132
|
+
.date-filter {
|
|
256
133
|
display: flex;
|
|
257
134
|
align-items: center;
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
justify-content: flex-start
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
.date-year-month-actions {
|
|
264
|
-
margin-left: auto;
|
|
265
|
-
position: relative
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
.date-year-month-btn {
|
|
269
|
-
display: inline-flex;
|
|
270
|
-
align-items: center;
|
|
271
|
-
gap: 8px;
|
|
272
|
-
height: 32px;
|
|
273
|
-
padding: 0 12px;
|
|
274
|
-
border-radius: 999px;
|
|
275
|
-
background: #F0F0F0;
|
|
276
|
-
border: 1px solid #e5e7eb;
|
|
277
|
-
font-size: 13px;
|
|
278
|
-
letter-spacing: 1px;
|
|
279
|
-
cursor: pointer
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
.date-year-month-dropdown {
|
|
283
|
-
position: relative
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
.date-year-month-menu {
|
|
287
|
-
position: absolute;
|
|
288
|
-
top: 38px;
|
|
289
|
-
right: 0;
|
|
290
|
-
list-style: none;
|
|
291
|
-
margin: 0;
|
|
292
|
-
padding: 6px;
|
|
293
|
-
background: #fff;
|
|
294
|
-
border: 1px solid #e5e7eb;
|
|
295
|
-
border-radius: 10px;
|
|
296
|
-
min-width: 150px;
|
|
297
|
-
box-shadow: 0 10px 24px rgba(16, 24, 40, .12);
|
|
298
|
-
z-index: 1001
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
.date-year-month-menu li {
|
|
302
|
-
padding: 8px 10px;
|
|
303
|
-
border-radius: 8px;
|
|
304
|
-
cursor: pointer;
|
|
305
|
-
font-weight: 500;
|
|
306
|
-
color: #374151
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
.date-year-month-menu li:hover {
|
|
310
|
-
background: #f3f4f6
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
.date-year-month-group {
|
|
314
|
-
display: inline-flex;
|
|
315
|
-
align-items: center;
|
|
316
|
-
gap: 8px
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
.date-year-month-label {
|
|
320
|
-
font-weight: 700;
|
|
321
|
-
color: #1f2937
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
.date-year-month-muted {
|
|
325
|
-
color: #9ca3af
|
|
135
|
+
justify-content: center;
|
|
136
|
+
gap: 20px;
|
|
326
137
|
}
|
|
327
138
|
|
|
328
|
-
.
|
|
329
|
-
|
|
330
|
-
height: 22px;
|
|
331
|
-
background: #e5e7eb;
|
|
332
|
-
border-radius: 1px
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
.date-year-month-nav {
|
|
336
|
-
width: 32px;
|
|
337
|
-
height: 32px;
|
|
338
|
-
border-radius: 999px;
|
|
139
|
+
.navigation-button {
|
|
140
|
+
color: white;
|
|
339
141
|
border: none;
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
justify-content: center
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
.date-year-month-year {
|
|
348
|
-
background: #3b82f6
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
.date-year-month-month {
|
|
352
|
-
background: #f59e0b
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
.date-year-month-chip {
|
|
356
|
-
display: inline-flex;
|
|
142
|
+
border-radius: 50%;
|
|
143
|
+
width: 30px;
|
|
144
|
+
height: 30px;
|
|
145
|
+
display: flex;
|
|
357
146
|
align-items: center;
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
border-radius: 999px;
|
|
361
|
-
background: #f3f4f6;
|
|
362
|
-
border: 1px solid #e5e7eb;
|
|
363
|
-
font-weight: 600;
|
|
364
|
-
color: #111827
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
.date-year-month-chip-close {
|
|
368
|
-
border: none;
|
|
369
|
-
background: transparent;
|
|
147
|
+
justify-content: center;
|
|
148
|
+
font-size: 1.2em;
|
|
370
149
|
cursor: pointer;
|
|
371
|
-
|
|
372
|
-
display: inline-flex;
|
|
373
|
-
align-items: center
|
|
150
|
+
transition: background-color 0.3s, transform 0.2s;
|
|
374
151
|
}
|
|
375
152
|
|
|
376
|
-
.
|
|
377
|
-
.
|
|
378
|
-
transition: all .18s ease
|
|
153
|
+
.navigation-button:hover {
|
|
154
|
+
opacity: 0.8;
|
|
379
155
|
}
|
|
380
156
|
|
|
381
|
-
.
|
|
382
|
-
.
|
|
383
|
-
opacity: 0;
|
|
384
|
-
transform: translateY(-4px)
|
|
157
|
+
.navigation-button:active {
|
|
158
|
+
transform: scale(0.95);
|
|
385
159
|
}
|
|
386
160
|
|
|
387
|
-
.
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
border-radius: 12px;
|
|
392
|
-
padding: 12px;
|
|
393
|
-
box-shadow: 0 10px 24px rgba(16, 24, 40, .12)
|
|
161
|
+
.navigation-button.disabled {
|
|
162
|
+
background-color: #b0b0b0;
|
|
163
|
+
opacity: 0.5;
|
|
164
|
+
cursor: not-allowed;
|
|
394
165
|
}
|
|
395
166
|
|
|
396
|
-
.date-
|
|
397
|
-
font-
|
|
398
|
-
|
|
399
|
-
margin-bottom: 8px
|
|
167
|
+
.date-display {
|
|
168
|
+
font-size: 1.5em;
|
|
169
|
+
font-weight: bold;
|
|
400
170
|
}
|
|
401
171
|
|
|
402
|
-
.
|
|
403
|
-
|
|
172
|
+
.month-mode {
|
|
173
|
+
background-color: #ffa500;
|
|
404
174
|
}
|
|
405
175
|
|
|
406
|
-
.
|
|
407
|
-
|
|
408
|
-
justify-content: flex-end;
|
|
409
|
-
gap: 8px;
|
|
410
|
-
margin-top: 20px
|
|
176
|
+
.year-mode {
|
|
177
|
+
background-color: #007bff;
|
|
411
178
|
}
|
|
412
179
|
|
|
413
|
-
.date-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
.date-year-month-btn-apply {
|
|
419
|
-
background: #0ea5e9;
|
|
420
|
-
border: 1px solid #fff;
|
|
421
|
-
color: #fff
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
.date-year-month-btn-apply:hover {
|
|
425
|
-
background: #3E90B3;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
.date-year-month-year-row {
|
|
429
|
-
display: flex;
|
|
430
|
-
align-items: center;
|
|
431
|
-
gap: 8px;
|
|
432
|
-
margin: 6px 0 2px
|
|
180
|
+
.date-icon {
|
|
181
|
+
cursor: pointer;
|
|
182
|
+
color: rgb(73, 72, 72);
|
|
433
183
|
}
|
|
434
184
|
|
|
435
|
-
.
|
|
436
|
-
|
|
437
|
-
width: 110px;
|
|
438
|
-
text-align: center;
|
|
439
|
-
border: 1px solid #e5e7eb;
|
|
440
|
-
border-radius: 8px
|
|
185
|
+
.title-disabled {
|
|
186
|
+
color: #b0b0b0;
|
|
441
187
|
}
|
|
442
188
|
|
|
443
|
-
.date-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
border-radius: 50px;
|
|
447
|
-
border: 1px solid #3C82F6;
|
|
448
|
-
color: white;
|
|
449
|
-
background: #3C82F6;
|
|
450
|
-
cursor: pointer
|
|
189
|
+
.date-icon.disabled {
|
|
190
|
+
color: #b0b0b0;
|
|
191
|
+
cursor: not-allowed;
|
|
451
192
|
}
|
|
452
|
-
</style>
|
|
193
|
+
</style>
|