@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.
Files changed (170) hide show
  1. package/dist/community.server.js +1 -1
  2. package/dist/community.server.mjs +1 -1
  3. package/dist/events.server.js +1 -1
  4. package/dist/events.server.mjs +1 -1
  5. package/dist/gallery.server.js +9 -3
  6. package/dist/gallery.server.mjs +9 -3
  7. package/dist/main-DL3vRQCi.js +92 -0
  8. package/dist/main-Ds3Z5x5d.mjs +14206 -0
  9. package/dist/main.css +1 -1
  10. package/dist/orders.server.js +1 -1
  11. package/dist/orders.server.mjs +1 -1
  12. package/dist/organizations.server.js +1 -1
  13. package/dist/organizations.server.mjs +1 -1
  14. package/dist/products.server.js +1 -1
  15. package/dist/products.server.mjs +1 -1
  16. package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
  17. package/dist/prometheus-framework/src/components/Block/Block.vue.js +1 -1
  18. package/dist/prometheus-framework/src/components/DatePicker/Calendar.vue2.cjs +1 -1
  19. package/dist/prometheus-framework/src/components/DatePicker/Calendar.vue2.js +116 -117
  20. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.cjs +1 -1
  21. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.js +58 -1
  22. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.cjs +1 -1
  23. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.js +1 -58
  24. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  25. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +123 -109
  26. package/dist/prometheus-framework/src/components/FieldTags/BlockTags.vue.cjs +1 -1
  27. package/dist/prometheus-framework/src/components/FieldTags/BlockTags.vue.js +32 -26
  28. package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
  29. package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +1 -73
  30. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
  31. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +77 -1
  32. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
  33. package/dist/prometheus-framework/src/components/Select/Select.vue.js +1 -103
  34. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  35. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +103 -1
  36. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +1 -45
  38. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
  39. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +45 -1
  40. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  41. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
  42. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  43. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  44. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
  46. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
  48. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  49. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +16 -17
  50. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +1 -5
  51. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +0 -66
  52. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +5 -1
  53. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +66 -0
  54. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  55. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  56. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  57. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  58. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +2 -2
  60. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
  62. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  63. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +44 -69
  64. package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue.cjs +1 -0
  65. package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue.js +64 -0
  66. package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue2.cjs +1 -0
  67. package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue2.js +1 -0
  68. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.js +101 -14
  70. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +165 -102
  72. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +3 -3
  74. package/dist/prometheus-framework/src/modules/globals/components/elements/ButtonDate.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/globals/components/elements/ButtonDate.vue.js +38 -1
  76. package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.js +3 -3
  78. package/dist/prometheus-framework/src/modules/globals/services/globals.store.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/globals/services/globals.store.js +21 -21
  80. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonBlogpost.vue.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonBlogpost.vue.js +3 -3
  82. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonEvent.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonEvent.vue.js +1 -1
  84. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonEventShort.vue.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonEventShort.vue.js +5 -5
  86. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonOrganization.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonOrganization.vue.js +1 -1
  88. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  89. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
  90. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
  91. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +13 -1
  92. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
  93. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +1 -13
  94. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
  95. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
  96. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  97. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
  98. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  99. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
  100. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
  101. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
  102. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
  103. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
  104. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  105. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
  106. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  107. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +3 -3
  108. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  109. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  110. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  111. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  112. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
  113. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +1 -1
  114. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  115. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
  116. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  117. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  118. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  119. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +3 -3
  120. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  121. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  122. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
  123. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
  124. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  125. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
  126. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  127. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +2 -2
  128. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  129. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
  130. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  131. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
  132. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
  133. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +31 -32
  134. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  135. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
  136. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  137. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +2 -2
  138. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  139. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +4 -4
  140. package/dist/prometheus-framework.cjs.js +1 -1
  141. package/dist/prometheus-framework.es.js +1 -1
  142. package/dist/queryProcessor-g8208K6g.mjs +178 -0
  143. package/dist/queryProcessor-haY_gPGg.js +177 -0
  144. package/dist/style.css +1 -1
  145. package/dist/wallet.server.js +1 -1
  146. package/dist/wallet.server.mjs +1 -1
  147. package/dist/web-B8tq3Fda.mjs +54 -0
  148. package/dist/web-ByJkgGrt.js +1 -0
  149. package/package.json +1 -1
  150. package/src/components/DatePicker/Calendar.vue +82 -55
  151. package/src/components/Feed/Feed.vue +45 -16
  152. package/src/components/FieldTags/BlockTags.vue +30 -23
  153. package/src/components/Popup/Popup.vue +2 -2
  154. package/src/modules/events/components/pages/Events.vue +2 -48
  155. package/src/modules/gallery/components/blocks/PhotoViewer.vue +115 -0
  156. package/src/modules/gallery/components/pages/Gallery.vue +103 -6
  157. package/src/modules/gallery/components/sections/BackofficeGallery.vue +100 -32
  158. package/src/modules/gallery/controllers/gallery.controller.js +45 -38
  159. package/src/modules/globals/components/blocks/CardHeader.vue +1 -1
  160. package/src/modules/globals/components/elements/ButtonDate.vue +37 -43
  161. package/src/modules/globals/components/layouts/Client.vue +1 -1
  162. package/src/modules/globals/components/sections/SectionPageTitle.vue +1 -1
  163. package/src/modules/globals/controllers/utils/queryProcessor.js +21 -2
  164. package/src/modules/globals/services/globals.store.js +13 -17
  165. package/src/modules/icons/skeletons/SkeletonBlogpost.vue +1 -1
  166. package/src/modules/icons/skeletons/SkeletonEvent.vue +1 -1
  167. package/src/modules/icons/skeletons/SkeletonEventShort.vue +1 -1
  168. package/src/modules/icons/skeletons/SkeletonOrganization.vue +1 -1
  169. package/src/modules/products/components/sections/FilterProducts.vue +2 -1
  170. 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" @click="selectToday">Today</button>
5
- <button class="font-second pd-thin bg-main-transp-10 radius-small" @click="selectLastWeek">Last Week</button>
6
- <button class="font-second pd-thin bg-main-transp-10 radius-small" @click="selectLastMonth">Last Month</button>
7
- <button class="font-second pd-thin bg-main-transp-10 radius-small" @click="selectLastYear">All time</button>
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" @click="prevMonth">&lt;</button>
12
- <span>{{ monthYear }}</span>
13
- <button class="aspect-ratio-1x1 w-10 pd-thin bg-main-transp-10 radius-small" @click="nextMonth">&gt;</button>
10
+ <button @click.stop="prevMonth" class="aspect-ratio-1x1 w-10 pd-thin bg-main-transp-10 radius-small">&lt;</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" >&gt;</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
- endDate.value = formattedDate
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
- emit('update:modelValue', { start: startDate.value, end: endDate.value })
186
+
187
+ dateCalendar.value = { start: startDate.value, end: endDate.value }
172
188
  } else {
173
189
  startDate.value = formattedDate
174
190
  endDate.value = null
175
- emit('update:modelValue', formattedDate)
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 todayStart = new Date(today);
204
- todayStart.setUTCHours(0, 0, 0, 0); // Начало дня в UTC
205
- const todayEnd = new Date(todayStart);
206
- todayEnd.setUTCHours(24, 0, 0, -1); // Конец дня в UTC (23:59:59)
207
-
208
- startDate.value = toUTC(todayStart);
209
- endDate.value = toUTC(todayEnd);
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 lastWeek = new Date()
215
- lastWeek.setUTCDate(lastWeek.getUTCDate() - 7)
216
- startDate.value = toUTC(lastWeek)
217
- endDate.value = toUTC(today)
218
- emit('update:modelValue', { start: startDate.value, end: endDate.value })
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 lastMonth = new Date()
223
- lastMonth.setUTCMonth(lastMonth.getUTCMonth() - 1)
224
- startDate.value = new Date(Date.UTC(lastMonth.getUTCFullYear(), lastMonth.getUTCMonth(), 1))
225
- endDate.value = new Date(Date.UTC(
226
- lastMonth.getUTCFullYear(),
227
- lastMonth.getUTCMonth() + 1,
228
- 0
229
- ))
230
- emit('update:modelValue', { start: startDate.value, end: endDate.value })
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
- const lastYear = new Date()
235
- lastYear.setUTCFullYear(lastYear.getUTCFullYear() - 1)
236
- startDate.value = new Date(Date.UTC(lastYear.getUTCFullYear(), 0, 1))
237
- endDate.value = new Date(Date.UTC(lastYear.getUTCFullYear(), 11, 31))
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
- <div class="flex-center flex pd-thin bg-light radius-extra aspect-1x1 h-100">
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="search.class || 'bg-light'"
21
- class="flex-child flex-child-grow-1 flex-child-shrink-0 pd-r-small pd-l-small pd-thin bg-light radius-big"
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="search.class || 'bg-light'"
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
- sortParam: sortParam.value,
207
- sortOrder: sortOrder.value,
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
- sortParam: sortParam.value,
230
- sortOrder: sortOrder.value,
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-medium">
21
- <p class="p-small mn-b-thin">Suggested:</p>
22
-
23
- <span
24
- v-if="filteredSuggestedItems.length > 0"
25
- v-for="(tag,index) in filteredSuggestedItems"
26
- @click="addTag(tag)"
27
- class="cursor-pointer t-medium ti-tag-toDefactor"
28
- :class="{'mn-r-micro':index !== filteredSuggestedItems.length - 1}"
29
- >
30
- {{ tag.text }}
31
- </span>
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, defineEmits, onMounted } from 'vue';
37
+ import { ref, computed, onMounted } from 'vue';
40
38
 
41
39
  const emits = defineEmits(['tags-changed']);
42
- const props = defineProps(['tags']);
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
- const autocompleteItems = ref([
48
- { text: 'story' },
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-regular z-index-5"/>
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>