@ozdao/prometheus-framework 0.2.118 → 0.2.119
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/community.server.js +1 -1
- package/dist/community.server.mjs +1 -1
- package/dist/events.server.js +1 -1
- package/dist/events.server.mjs +1 -1
- package/dist/gallery.server.js +9 -3
- package/dist/gallery.server.mjs +9 -3
- package/dist/main-DL3vRQCi.js +92 -0
- package/dist/main-Ds3Z5x5d.mjs +14206 -0
- package/dist/main.css +1 -1
- package/dist/orders.server.js +1 -1
- package/dist/orders.server.mjs +1 -1
- package/dist/organizations.server.js +1 -1
- package/dist/organizations.server.mjs +1 -1
- package/dist/products.server.js +1 -1
- package/dist/products.server.mjs +1 -1
- package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Block/Block.vue.js +1 -1
- package/dist/prometheus-framework/src/components/DatePicker/Calendar.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/DatePicker/Calendar.vue2.js +116 -117
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.js +58 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.js +1 -58
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +123 -109
- package/dist/prometheus-framework/src/components/FieldTags/BlockTags.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldTags/BlockTags.vue.js +32 -26
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +1 -73
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +77 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.js +1 -103
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +103 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +1 -45
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +45 -1
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +16 -17
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +1 -5
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +0 -66
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +5 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +66 -0
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +44 -69
- package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue.js +64 -0
- package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue2.js +1 -0
- package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.js +101 -14
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +165 -102
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/globals/components/elements/ButtonDate.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/elements/ButtonDate.vue.js +38 -1
- package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/globals/services/globals.store.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/services/globals.store.js +21 -21
- package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonBlogpost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonBlogpost.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonEvent.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonEventShort.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonEventShort.vue.js +5 -5
- package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonOrganization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonOrganization.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +13 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +1 -13
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +31 -32
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +4 -4
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/queryProcessor-g8208K6g.mjs +178 -0
- package/dist/queryProcessor-haY_gPGg.js +177 -0
- package/dist/style.css +1 -1
- package/dist/wallet.server.js +1 -1
- package/dist/wallet.server.mjs +1 -1
- package/dist/web-B8tq3Fda.mjs +54 -0
- package/dist/web-ByJkgGrt.js +1 -0
- package/package.json +1 -1
- package/src/components/DatePicker/Calendar.vue +82 -55
- package/src/components/Feed/Feed.vue +45 -16
- package/src/components/FieldTags/BlockTags.vue +30 -23
- package/src/components/Popup/Popup.vue +2 -2
- package/src/modules/events/components/pages/Events.vue +2 -48
- package/src/modules/gallery/components/blocks/PhotoViewer.vue +115 -0
- package/src/modules/gallery/components/pages/Gallery.vue +103 -6
- package/src/modules/gallery/components/sections/BackofficeGallery.vue +100 -32
- package/src/modules/gallery/controllers/gallery.controller.js +45 -38
- package/src/modules/globals/components/blocks/CardHeader.vue +1 -1
- package/src/modules/globals/components/elements/ButtonDate.vue +37 -43
- package/src/modules/globals/components/layouts/Client.vue +1 -1
- package/src/modules/globals/components/sections/SectionPageTitle.vue +1 -1
- package/src/modules/globals/controllers/utils/queryProcessor.js +21 -2
- package/src/modules/globals/services/globals.store.js +13 -17
- package/src/modules/icons/skeletons/SkeletonBlogpost.vue +1 -1
- package/src/modules/icons/skeletons/SkeletonEvent.vue +1 -1
- package/src/modules/icons/skeletons/SkeletonEventShort.vue +1 -1
- package/src/modules/icons/skeletons/SkeletonOrganization.vue +1 -1
- package/src/modules/products/components/sections/FilterProducts.vue +2 -1
- package/src/modules/gallery/components/sections/GalleryWithCategories.vue +0 -176
@@ -1,19 +1,18 @@
|
|
1
1
|
<template>
|
2
2
|
<div class="calendar">
|
3
|
-
<div v-if="allowRange" class="br-b br-solid br-grey gap-thin flex flex-nowrap pd-thin">
|
4
|
-
<button class="font-second pd-thin bg-main-transp-10 radius-small"
|
5
|
-
<button class="font-second pd-thin bg-main-transp-10 radius-small"
|
6
|
-
<button class="font-second pd-thin bg-main-transp-10 radius-small"
|
7
|
-
<button class="font-second pd-thin bg-main-transp-10 radius-small"
|
3
|
+
<div v-if="allowRange" class="br-b br-solid br-grey-transp-25 gap-thin flex flex-nowrap pd-thin">
|
4
|
+
<button @click="selectToday" class="font-second t-nowrap pd-thin bg-main-transp-10 radius-small" >Today</button>
|
5
|
+
<button @click="selectLastWeek" class="font-second t-nowrap pd-thin bg-main-transp-10 radius-small">Last Week</button>
|
6
|
+
<button @click="selectLastMonth" class="font-second t-nowrap pd-thin bg-main-transp-10 radius-small">Last Month</button>
|
7
|
+
<button @click="selectLastYear" class="font-second t-nowrap pd-thin bg-main-transp-10 radius-small">All time</button>
|
8
8
|
</div>
|
9
|
-
|
10
9
|
<div class="pd-thin flex flex-nowrap flex-v-center flex-justify-between">
|
11
|
-
<button class="aspect-ratio-1x1 w-10 pd-thin bg-main-transp-10 radius-small"
|
12
|
-
<span>{{ monthYear }}</span>
|
13
|
-
<button class="aspect-ratio-1x1 w-10 pd-thin bg-main-transp-10 radius-small"
|
10
|
+
<button @click.stop="prevMonth" class="aspect-ratio-1x1 w-10 pd-thin bg-main-transp-10 radius-small"><</button>
|
11
|
+
<span class="t-semi ">{{ monthYear }}</span>
|
12
|
+
<button @click.stop="nextMonth" class="aspect-ratio-1x1 w-10 pd-thin bg-main-transp-10 radius-small" >></button>
|
14
13
|
</div>
|
15
14
|
|
16
|
-
<div class="calendar__body">
|
15
|
+
<div class="pd-thin calendar__body">
|
17
16
|
<div class="calendar__week">
|
18
17
|
<div v-for="(day, index) in daysOfWeek" :key="index" class="calendar__weekday">
|
19
18
|
{{ day }}
|
@@ -30,7 +29,7 @@
|
|
30
29
|
{ 'calendar__date--range': isInRange(day.date) },
|
31
30
|
{ 'calendar__date--disabled': !isSameMonth(day.date) },
|
32
31
|
]"
|
33
|
-
@click="selectDate(day.date)"
|
32
|
+
@click.stop="selectDate(day.date)"
|
34
33
|
>
|
35
34
|
{{ day.day }}
|
36
35
|
</div>
|
@@ -50,6 +49,8 @@ const props = defineProps({
|
|
50
49
|
|
51
50
|
const emit = defineEmits(['update:modelValue'])
|
52
51
|
|
52
|
+
const dateCalendar = defineModel('date')
|
53
|
+
|
53
54
|
const today = new Date()
|
54
55
|
const currentDate = ref(today)
|
55
56
|
const selectedDate = ref(null)
|
@@ -62,6 +63,11 @@ const toUTC = (date) => {
|
|
62
63
|
return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()))
|
63
64
|
}
|
64
65
|
|
66
|
+
const toEndOfDayUTC = (date) => {
|
67
|
+
const endOfDay = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59));
|
68
|
+
return endOfDay;
|
69
|
+
}
|
70
|
+
|
65
71
|
const monthYear = computed(() => {
|
66
72
|
const month = currentDate.value.toLocaleString('default', { month: 'long', timeZone: 'UTC' })
|
67
73
|
const year = currentDate.value.getUTCFullYear()
|
@@ -84,7 +90,9 @@ const daysInMonth = computed(() => {
|
|
84
90
|
const firstDayOfWeek = firstDay.getUTCDay()
|
85
91
|
|
86
92
|
let date = new Date(firstDay)
|
93
|
+
|
87
94
|
date.setUTCDate(date.getUTCDate() - firstDayOfWeek)
|
95
|
+
|
88
96
|
for (let i = 0; i < firstDayOfWeek; i++) {
|
89
97
|
days.push({
|
90
98
|
date: new Date(date),
|
@@ -95,6 +103,7 @@ const daysInMonth = computed(() => {
|
|
95
103
|
}
|
96
104
|
|
97
105
|
let day = 1
|
106
|
+
|
98
107
|
for (date = firstDay; date <= lastDay; date.setUTCDate(date.getUTCDate() + 1)) {
|
99
108
|
days.push({
|
100
109
|
date: new Date(date),
|
@@ -105,6 +114,7 @@ const daysInMonth = computed(() => {
|
|
105
114
|
}
|
106
115
|
|
107
116
|
const lastDayOfWeek = days[days.length - 1].date.getUTCDay()
|
117
|
+
|
108
118
|
for (let i = lastDayOfWeek + 1; i <= 6; i++) {
|
109
119
|
days.push({
|
110
120
|
date: new Date(date),
|
@@ -136,18 +146,19 @@ const isSameMonth = (date) => {
|
|
136
146
|
const isSelected = (date) => {
|
137
147
|
if (props.allowRange) {
|
138
148
|
if (startDate.value && endDate.value) {
|
139
|
-
return date >= startDate.value && date <= endDate.value
|
149
|
+
return date >= new Date(startDate.value) && toEndOfDayUTC(date) <= new Date(endDate.value);
|
140
150
|
} else if (startDate.value) {
|
141
|
-
return date.getTime() === startDate.value.getTime()
|
151
|
+
return date.getTime() === new Date(startDate.value).getTime();
|
142
152
|
}
|
143
153
|
} else {
|
144
|
-
return selectedDate.value && date.getTime() === selectedDate.value.getTime()
|
154
|
+
return selectedDate.value && date.getTime() === new Date(selectedDate.value).getTime();
|
145
155
|
}
|
146
156
|
}
|
147
157
|
|
158
|
+
|
148
159
|
const isInRange = (date) => {
|
149
160
|
if (startDate.value && endDate.value) {
|
150
|
-
return date > startDate.value && date < endDate.value
|
161
|
+
return date > startDate.value && toEndOfDayUTC(date) < endDate.value
|
151
162
|
}
|
152
163
|
return false
|
153
164
|
}
|
@@ -156,25 +167,29 @@ const selectDate = (date) => {
|
|
156
167
|
const formattedDate = toUTC(date)
|
157
168
|
|
158
169
|
if (!props.allowRange) {
|
159
|
-
emit('update:modelValue', formattedDate)
|
160
170
|
selectedDate.value = formattedDate
|
171
|
+
dateCalendar.value = formattedDate
|
172
|
+
|
161
173
|
} else if (!startDate.value && !endDate.value) {
|
162
|
-
emit('update:modelValue', formattedDate)
|
163
174
|
startDate.value = formattedDate
|
175
|
+
dateCalendar.value.start = formattedDate
|
164
176
|
} else if (!endDate.value) {
|
165
|
-
|
177
|
+
|
178
|
+
endDate.value = toEndOfDayUTC(date)
|
179
|
+
|
166
180
|
if (formattedDate < startDate.value) {
|
167
|
-
const temp = startDate.value
|
181
|
+
const temp = toEndOfDayUTC(startDate.value)
|
182
|
+
|
168
183
|
startDate.value = formattedDate
|
169
184
|
endDate.value = temp
|
170
185
|
}
|
171
|
-
|
186
|
+
|
187
|
+
dateCalendar.value = { start: startDate.value, end: endDate.value }
|
172
188
|
} else {
|
173
189
|
startDate.value = formattedDate
|
174
190
|
endDate.value = null
|
175
|
-
|
191
|
+
dateCalendar.value = {start: formattedDate, end: null }
|
176
192
|
}
|
177
|
-
currentDate.value = formattedDate
|
178
193
|
}
|
179
194
|
|
180
195
|
const prevMonth = () => {
|
@@ -183,9 +198,6 @@ const prevMonth = () => {
|
|
183
198
|
currentDate.value.getUTCMonth() - 1,
|
184
199
|
1
|
185
200
|
))
|
186
|
-
// if (selectedDate.value && !isSameMonth(selectedDate.value)) {
|
187
|
-
// selectedDate.value = null
|
188
|
-
// }
|
189
201
|
}
|
190
202
|
|
191
203
|
const nextMonth = () => {
|
@@ -194,48 +206,63 @@ const nextMonth = () => {
|
|
194
206
|
currentDate.value.getUTCMonth() + 1,
|
195
207
|
1
|
196
208
|
))
|
197
|
-
// if (selectedDate.value && !isSameMonth(selectedDate.value)) {
|
198
|
-
// selectedDate.value = null
|
199
|
-
// }
|
200
209
|
}
|
201
210
|
|
202
211
|
const selectToday = () => {
|
203
|
-
const
|
204
|
-
todayStart.
|
205
|
-
const todayEnd = new Date(
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
emit('update:modelValue', { start: startDate.value, end: endDate.value });
|
212
|
+
const today = new Date(); // Предположим, что переменная today - это текущая дата
|
213
|
+
const todayStart = new Date(Date.UTC(today.getUTCFullYear(), today.getUTCMonth(), today.getUTCDate(), 0, 0, 0, 0)); // Начало дня в UTC
|
214
|
+
const todayEnd = new Date(Date.UTC(today.getUTCFullYear(), today.getUTCMonth(), today.getUTCDate(), 23, 59, 59, 999)); // Конец дня в UTC
|
215
|
+
|
216
|
+
startDate.value = todayStart.toISOString();
|
217
|
+
endDate.value = todayEnd.toISOString();
|
218
|
+
dateCalendar.value = { start: startDate.value, end: endDate.value };
|
211
219
|
}
|
212
220
|
|
213
221
|
const selectLastWeek = () => {
|
214
|
-
const
|
215
|
-
lastWeek
|
216
|
-
|
217
|
-
|
218
|
-
|
222
|
+
const today = new Date();
|
223
|
+
const lastWeek = new Date(today);
|
224
|
+
lastWeek.setUTCDate(today.getUTCDate() - 7);
|
225
|
+
lastWeek.setUTCHours(0, 0, 0, 0);
|
226
|
+
|
227
|
+
startDate.value = lastWeek;
|
228
|
+
endDate.value = toEndOfDayUTC(today);
|
229
|
+
|
230
|
+
today.setUTCHours(23, 59, 59, 999);
|
231
|
+
|
232
|
+
const start = lastWeek.toISOString();
|
233
|
+
const end = today.toISOString();
|
234
|
+
|
235
|
+
dateCalendar.value = { start: start, end: end };
|
219
236
|
}
|
220
237
|
|
221
238
|
const selectLastMonth = () => {
|
222
|
-
const
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
239
|
+
const today = new Date();
|
240
|
+
|
241
|
+
// Создаем дату для прошлого месяца
|
242
|
+
const lastMonth = new Date(today);
|
243
|
+
lastMonth.setUTCMonth(today.getUTCMonth() - 1);
|
244
|
+
lastMonth.setUTCHours(0, 0, 0, 0);
|
245
|
+
|
246
|
+
// Устанавливаем конец текущего дня до 23:59:59
|
247
|
+
startDate.value = lastMonth;
|
248
|
+
endDate.value = toEndOfDayUTC(today);
|
249
|
+
|
250
|
+
today.setUTCHours(23, 59, 59, 999);
|
251
|
+
|
252
|
+
// Форматируем даты в ISO строки
|
253
|
+
const start = lastMonth.toISOString();
|
254
|
+
const end = today.toISOString();
|
255
|
+
|
256
|
+
dateCalendar.value = { start: start, end: end };
|
231
257
|
}
|
232
258
|
|
259
|
+
|
260
|
+
|
233
261
|
const selectLastYear = () => {
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
emit('update:modelValue', { start: startDate.value, end: endDate.value })
|
262
|
+
|
263
|
+
startDate.value = null;
|
264
|
+
endDate.value = null;
|
265
|
+
dateCalendar.value = { start: null, end: null };
|
239
266
|
}
|
240
267
|
</script>
|
241
268
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<template>
|
2
2
|
|
3
|
-
<div v-if="search" class="flex-nowrap flex gap-thin mn-b-thin">
|
3
|
+
<div v-if="search || date || sort" class="flex-nowrap flex gap-thin mn-b-thin">
|
4
4
|
|
5
5
|
<BlockSearch
|
6
6
|
v-if="search"
|
@@ -9,17 +9,19 @@
|
|
9
9
|
@search="updateSearch"
|
10
10
|
/>
|
11
11
|
|
12
|
-
|
12
|
+
<!-- <div class="flex-center flex pd-thin bg-light radius-extra aspect-1x1 h-100">
|
13
13
|
<IconFilter class="w-1r h-auto"/>
|
14
|
-
</div>
|
14
|
+
</div> -->
|
15
15
|
|
16
16
|
<Dropdown
|
17
|
+
v-if="date"
|
17
18
|
:label="{
|
18
|
-
component: ButtonDate
|
19
|
+
component: ButtonDate,
|
20
|
+
props: { date: date }
|
19
21
|
}"
|
20
|
-
:class="
|
21
|
-
class="flex-child flex-child-
|
22
|
-
:align="'right'"
|
22
|
+
:class="date.class || 'bg-light'"
|
23
|
+
class="flex-child flex-child-shrink-0 pd-r-small pd-l-small pd-thin bg-light radius-big"
|
24
|
+
:align="search ? 'right' : 'left'"
|
23
25
|
>
|
24
26
|
|
25
27
|
<Calendar
|
@@ -37,9 +39,9 @@
|
|
37
39
|
props: { order: sort.order },
|
38
40
|
class: 'w-1r'
|
39
41
|
}"
|
40
|
-
:class="
|
42
|
+
:class="sort.class || 'bg-light'"
|
41
43
|
class="radius-extra aspect-1x1 h-100"
|
42
|
-
:align="'right'"
|
44
|
+
:align="search ? 'right' : 'left'"
|
43
45
|
>
|
44
46
|
|
45
47
|
<BlockSorting
|
@@ -181,8 +183,8 @@ let sentinel = ref(null)
|
|
181
183
|
let currentSkip = ref(props.options.skip ? props.options.skip : 0);
|
182
184
|
let currentLimit = ref(props.options.limit ? props.options.limit : 10);
|
183
185
|
|
184
|
-
let sortParam = ref(sort.value?.param || 'createdAt');
|
185
|
-
let sortOrder = ref(sort.value?.order || 'asc');
|
186
|
+
// let sortParam = ref(sort.value?.param || 'createdAt');
|
187
|
+
// let sortOrder = ref(sort.value?.order || 'asc');
|
186
188
|
|
187
189
|
let currentSearch = ref('');
|
188
190
|
|
@@ -203,8 +205,10 @@ const loadMoreItems = async () => {
|
|
203
205
|
skip: currentSkip.value,
|
204
206
|
limit: currentLimit.value,
|
205
207
|
search: currentSearch.value,
|
206
|
-
|
207
|
-
|
208
|
+
dateStart: date.value ? date.value.start : null,
|
209
|
+
dateEnd: date.value ? date.value.end : null,
|
210
|
+
sortParam: sort.value ? sort.value.param : null,
|
211
|
+
sortOrder: sort.value ? sort.value.order : null,
|
208
212
|
...props.options
|
209
213
|
});
|
210
214
|
|
@@ -223,11 +227,14 @@ const loadMoreItems = async () => {
|
|
223
227
|
};
|
224
228
|
|
225
229
|
const fetchItems = async () => {
|
230
|
+
console.log('Date is', date.value)
|
226
231
|
const data = await props.store.read({
|
227
232
|
skip: currentSkip.value,
|
228
233
|
limit: currentLimit.value,
|
229
|
-
|
230
|
-
|
234
|
+
dateStart: date.value ? date.value.start : null,
|
235
|
+
dateEnd: date.value ? date.value.end : null,
|
236
|
+
sortParam: sort.value ? sort.value.param : null,
|
237
|
+
sortOrder: sort.value ? sort.value.order : null,
|
231
238
|
search: currentSearch.value,
|
232
239
|
...props.options
|
233
240
|
});
|
@@ -252,6 +259,27 @@ watch(() => props.external, (newVal, oldVal) => {
|
|
252
259
|
}
|
253
260
|
}, { deep: true });
|
254
261
|
|
262
|
+
watch(() => date.value, (newVal, oldVal) => {
|
263
|
+
if (newVal !== oldVal) {
|
264
|
+
fetchItems();
|
265
|
+
}
|
266
|
+
}, { deep: true });
|
267
|
+
|
268
|
+
watch(() => sort.value?.order, (newVal, oldVal) => {
|
269
|
+
|
270
|
+
if (newVal !== oldVal) {
|
271
|
+
fetchItems();
|
272
|
+
}
|
273
|
+
}, { deep: true });
|
274
|
+
|
275
|
+
watch(() => sort.value?.param, (newVal, oldVal) => {
|
276
|
+
|
277
|
+
if (newVal !== oldVal) {
|
278
|
+
fetchItems();
|
279
|
+
}
|
280
|
+
}, { deep: true });
|
281
|
+
|
282
|
+
|
255
283
|
watch(() => props.options, (newVal, oldVal) => {
|
256
284
|
if (
|
257
285
|
newVal.organization !== oldVal.organization ||
|
@@ -261,7 +289,8 @@ watch(() => props.options, (newVal, oldVal) => {
|
|
261
289
|
newVal.search !== oldVal.search ||
|
262
290
|
newVal.status !== oldVal.status ||
|
263
291
|
newVal.hidden !== oldVal.hidden ||
|
264
|
-
newVal.type !== oldVal.type
|
292
|
+
newVal.type !== oldVal.type ||
|
293
|
+
newVal.tags !== oldVal.tags
|
265
294
|
) {
|
266
295
|
fetchItems();
|
267
296
|
}
|
@@ -17,40 +17,47 @@
|
|
17
17
|
class="mn-b-thin bg-light radius-medium pd-small"
|
18
18
|
/>
|
19
19
|
|
20
|
-
<p class="mn-b-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
<span v-else>You added all suggested tags</span>
|
33
|
-
</p>
|
20
|
+
<p class="p-small mn-b-thin">Suggested:</p>
|
21
|
+
|
22
|
+
<span
|
23
|
+
v-if="filteredSuggestedItems.length > 0"
|
24
|
+
v-for="(tag,index) in filteredSuggestedItems"
|
25
|
+
@click="addTag(tag)"
|
26
|
+
class="cursor-pointer t-medium ti-tag-toDefactor"
|
27
|
+
:class="{'mn-r-micro':index !== filteredSuggestedItems.length - 1}"
|
28
|
+
>
|
29
|
+
{{ tag.text }}
|
30
|
+
</span>
|
31
|
+
<span v-else>You added all suggested tags</span>
|
34
32
|
</div>
|
35
33
|
</template>
|
36
34
|
|
37
35
|
<script setup>
|
38
36
|
import FieldTags from '@pf/src/components/FieldTags/FieldTags.vue'
|
39
|
-
import { ref, computed,
|
37
|
+
import { ref, computed, onMounted } from 'vue';
|
40
38
|
|
41
39
|
const emits = defineEmits(['tags-changed']);
|
42
|
-
const props = defineProps(
|
40
|
+
const props = defineProps({
|
41
|
+
tags: {
|
42
|
+
type: Array
|
43
|
+
},
|
44
|
+
tagsSuggested: {
|
45
|
+
type: Array,
|
46
|
+
default: [
|
47
|
+
{ text: 'story' },
|
48
|
+
{ text: 'news' },
|
49
|
+
{ text: 'guide' },
|
50
|
+
{ text: 'discussion' },
|
51
|
+
{ text: 'photos' },
|
52
|
+
]
|
53
|
+
}
|
54
|
+
});
|
43
55
|
|
44
56
|
const tag = ref('');
|
45
57
|
|
46
58
|
const selectedTags = ref([]);
|
47
|
-
|
48
|
-
|
49
|
-
{ text: 'news' },
|
50
|
-
{ text: 'guide' },
|
51
|
-
{ text: 'discussion' },
|
52
|
-
{ text: 'photos' },
|
53
|
-
]);
|
59
|
+
|
60
|
+
const autocompleteItems = ref(props.tagsSuggested);
|
54
61
|
|
55
62
|
if (props.tags) selectedTags.value = props.tags.map(tag => ({text: tag}))
|
56
63
|
|
@@ -6,8 +6,8 @@
|
|
6
6
|
|
7
7
|
<transition name="TransitionTranslateY" mode="out-in">
|
8
8
|
<section class="pos-relative z-index-4" v-bind="$attrs" :class="$attrs.class">
|
9
|
-
<h4 class="mn-b-small">{{title}}</h4>
|
10
|
-
<IconCross @click="closePopup()" class="cursor-pointer pos-absolute pos-t-0 pos-r-0 mn-t-semi mn-r-semi hover-scale-1 i-
|
9
|
+
<h4 v-if="title" class="mn-b-small">{{title}}</h4>
|
10
|
+
<IconCross :fill="'rgb(var(--white))'" @click="closePopup()" class="cursor-pointer bg-second pd-micro radius-extra pos-absolute pos-t-0 pos-r-0 mn-t-semi mn-r-semi hover-scale-1 i-medium z-index-5"/>
|
11
11
|
<slot></slot>
|
12
12
|
</section>
|
13
13
|
</transition>
|
@@ -9,60 +9,14 @@
|
|
9
9
|
Featured
|
10
10
|
</h2>
|
11
11
|
</header>
|
12
|
+
|
12
13
|
<List
|
13
14
|
:user="auth.state.user._id"
|
14
15
|
class="bg-light mn-b-medium radius-big"
|
15
16
|
:phase="'planned'"
|
16
17
|
/>
|
17
18
|
|
18
|
-
|
19
|
-
<div class="cols-2 gap-medium pd-medium bg-light radius-big">
|
20
|
-
<div class="">
|
21
|
-
<h2
|
22
|
-
class="mn-b-medium"
|
23
|
-
>
|
24
|
-
Finished Events
|
25
|
-
</h2>
|
26
|
-
<List
|
27
|
-
:user="auth.state.user._id"
|
28
|
-
class="bg-white mn-b-medium radius-big"
|
29
|
-
:phase="'finished'"
|
30
|
-
/>
|
31
|
-
</div>
|
32
|
-
|
33
|
-
<div class="">
|
34
|
-
<h2
|
35
|
-
class="mn-b-medium"
|
36
|
-
>
|
37
|
-
Planned
|
38
|
-
</h2>
|
39
|
-
<List
|
40
|
-
:user="auth.state.user._id"
|
41
|
-
class="bg-white mn-b-medium radius-big"
|
42
|
-
:phase="'planned'"
|
43
|
-
/>
|
44
|
-
</div>
|
45
|
-
</div>
|
46
|
-
|
47
|
-
|
48
|
-
<header
|
49
|
-
class="mn-b-medium flex-v-center flex-nowrap flex"
|
50
|
-
>
|
51
|
-
<h2
|
52
|
-
class="mn-r-medium"
|
53
|
-
>
|
54
|
-
All Events
|
55
|
-
</h2>
|
56
|
-
|
57
|
-
<button
|
58
|
-
@click="router.push({name: 'Create Event'})"
|
59
|
-
class="radius-100 i-big hover-scale-1 cursor-pointer t-white bg-second"
|
60
|
-
>
|
61
|
-
+
|
62
|
-
</button>
|
63
|
-
</header>
|
64
|
-
|
65
|
-
<DatePicker
|
19
|
+
<DatePicker
|
66
20
|
v-model:date="events.state.filter.date"
|
67
21
|
:locale="$i18n.locale"
|
68
22
|
class="radius-semi o-hidden bg-light mn-b-thin pd-l-zero pd-r-zero pd-medium"
|
@@ -0,0 +1,115 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="photo-container" @wheel="handleWheel" @mousedown="startDrag" @touchstart="handleTouchStart" @touchmove="handleTouchMove" @touchend="handleTouchEnd">
|
3
|
+
<img :src="photoUrl" :style="imgStyle" ref="image" @load="initialize" />
|
4
|
+
</div>
|
5
|
+
</template>
|
6
|
+
|
7
|
+
<script setup>
|
8
|
+
import { ref, reactive, computed } from 'vue';
|
9
|
+
|
10
|
+
const props = defineProps({
|
11
|
+
photoUrl: String,
|
12
|
+
show: Boolean,
|
13
|
+
});
|
14
|
+
|
15
|
+
const scale = ref(1);
|
16
|
+
const position = reactive({ x: 0, y: 0 });
|
17
|
+
const dragging = ref(false);
|
18
|
+
const startPosition = reactive({ x: 0, y: 0 });
|
19
|
+
const startScale = ref(1);
|
20
|
+
const startDistance = ref(0);
|
21
|
+
|
22
|
+
const imgStyle = computed(() => ({
|
23
|
+
transform: `scale(${scale.value}) translate(${position.x}px, ${position.y}px)`,
|
24
|
+
}));
|
25
|
+
|
26
|
+
const handleWheel = (event) => {
|
27
|
+
event.preventDefault();
|
28
|
+
const delta = event.deltaY > 0 ? -0.1 : 0.1;
|
29
|
+
scale.value = Math.min(Math.max(1, scale.value + delta), 3);
|
30
|
+
};
|
31
|
+
|
32
|
+
const startDrag = (event) => {
|
33
|
+
event.preventDefault();
|
34
|
+
dragging.value = true;
|
35
|
+
startPosition.x = event.type === 'mousedown' ? event.clientX : event.touches[0].clientX;
|
36
|
+
startPosition.y = event.type === 'mousedown' ? event.clientY : event.touches[0].clientY;
|
37
|
+
const move = (moveEvent) => {
|
38
|
+
if (dragging.value) {
|
39
|
+
const currentX = moveEvent.type === 'mousemove' ? moveEvent.clientX : moveEvent.touches[0].clientX;
|
40
|
+
const currentY = moveEvent.type === 'mousemove' ? moveEvent.clientY : moveEvent.touches[0].clientY;
|
41
|
+
position.x += (currentX - startPosition.x) / scale.value;
|
42
|
+
position.y += (currentY - startPosition.y) / scale.value;
|
43
|
+
startPosition.x = currentX;
|
44
|
+
startPosition.y = currentY;
|
45
|
+
}
|
46
|
+
};
|
47
|
+
const endDrag = () => {
|
48
|
+
dragging.value = false;
|
49
|
+
document.removeEventListener('mousemove', move);
|
50
|
+
document.removeEventListener('mouseup', endDrag);
|
51
|
+
document.removeEventListener('touchmove', move);
|
52
|
+
document.removeEventListener('touchend', endDrag);
|
53
|
+
};
|
54
|
+
document.addEventListener('mousemove', move);
|
55
|
+
document.addEventListener('mouseup', endDrag);
|
56
|
+
document.addEventListener('touchmove', move);
|
57
|
+
document.addEventListener('touchend', endDrag);
|
58
|
+
};
|
59
|
+
|
60
|
+
const handleTouchStart = (event) => {
|
61
|
+
if (event.touches.length === 2) {
|
62
|
+
const touch1 = event.touches[0];
|
63
|
+
const touch2 = event.touches[1];
|
64
|
+
const distanceX = Math.abs(touch1.clientX - touch2.clientX);
|
65
|
+
const distanceY = Math.abs(touch1.clientY - touch2.clientY);
|
66
|
+
startDistance.value = Math.sqrt(distanceX ** 2 + distanceY ** 2);
|
67
|
+
startScale.value = scale.value;
|
68
|
+
} else {
|
69
|
+
startDrag(event);
|
70
|
+
}
|
71
|
+
};
|
72
|
+
|
73
|
+
const handleTouchMove = (event) => {
|
74
|
+
if (event.touches.length === 2) {
|
75
|
+
event.preventDefault();
|
76
|
+
const touch1 = event.touches[0];
|
77
|
+
const touch2 = event.touches[1];
|
78
|
+
const distanceX = Math.abs(touch1.clientX - touch2.clientX);
|
79
|
+
const distanceY = Math.abs(touch1.clientY - touch2.clientY);
|
80
|
+
const newDistance = Math.sqrt(distanceX ** 2 + distanceY ** 2);
|
81
|
+
const scaleFactor = newDistance / startDistance.value;
|
82
|
+
scale.value = Math.min(Math.max(1, startScale.value * scaleFactor), 3);
|
83
|
+
}
|
84
|
+
};
|
85
|
+
|
86
|
+
const handleTouchEnd = (event) => {
|
87
|
+
if (event.touches.length === 0) {
|
88
|
+
startDistance.value = 0;
|
89
|
+
}
|
90
|
+
};
|
91
|
+
|
92
|
+
const initialize = () => {
|
93
|
+
scale.value = 1;
|
94
|
+
position.x = 0;
|
95
|
+
position.y = 0;
|
96
|
+
};
|
97
|
+
</script>
|
98
|
+
|
99
|
+
<style scoped>
|
100
|
+
.photo-container {
|
101
|
+
width: 100%;
|
102
|
+
height: 100%;
|
103
|
+
background: black;
|
104
|
+
overflow: hidden;
|
105
|
+
position: relative;
|
106
|
+
cursor: grab;
|
107
|
+
}
|
108
|
+
|
109
|
+
.photo-container img {
|
110
|
+
width: 100%;
|
111
|
+
height: 100%;
|
112
|
+
object-fit: scale-down;
|
113
|
+
transition: transform 0.3s;
|
114
|
+
}
|
115
|
+
</style>
|