|
@@ -29,11 +29,10 @@
|
|
|
:class="{ 'scroll-wrapper--single': visibleSolicitations.length === 1 }"
|
|
:class="{ 'scroll-wrapper--single': visibleSolicitations.length === 1 }"
|
|
|
>
|
|
>
|
|
|
<div
|
|
<div
|
|
|
|
|
+ ref="trackRef"
|
|
|
class="no-wrap row scroll-track"
|
|
class="no-wrap row scroll-track"
|
|
|
- :class="{
|
|
|
|
|
- 'q-gutter-x-md': visibleSolicitations.length > 1,
|
|
|
|
|
- 'scroll-track--single': visibleSolicitations.length === 1,
|
|
|
|
|
- }"
|
|
|
|
|
|
|
+ :class="{ 'scroll-track--single': visibleSolicitations.length === 1 }"
|
|
|
|
|
+ @scroll="onTrackScroll"
|
|
|
>
|
|
>
|
|
|
<q-card
|
|
<q-card
|
|
|
v-for="item in visibleSolicitations"
|
|
v-for="item in visibleSolicitations"
|
|
@@ -189,6 +188,11 @@
|
|
|
</q-card>
|
|
</q-card>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
|
|
+ <DefaultCarouselIndicator
|
|
|
|
|
+ :active="activeIndex"
|
|
|
|
|
+ :count="pageCount"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -196,8 +200,11 @@
|
|
|
import { avatarColors, formatCurrency, getFirstName } from "src/helpers/utils";
|
|
import { avatarColors, formatCurrency, getFirstName } from "src/helpers/utils";
|
|
|
import { computed } from "vue";
|
|
import { computed } from "vue";
|
|
|
import { labelsPeriodTypes } from "src/helpers/labelsPeriodTypes.js";
|
|
import { labelsPeriodTypes } from "src/helpers/labelsPeriodTypes.js";
|
|
|
|
|
+import { useCarouselIndicator } from "src/composables/useCarouselIndicator";
|
|
|
import { useI18n } from "vue-i18n";
|
|
import { useI18n } from "vue-i18n";
|
|
|
|
|
|
|
|
|
|
+import DefaultCarouselIndicator from "src/components/defaults/DefaultCarouselIndicator.vue";
|
|
|
|
|
+
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
|
data: {
|
|
data: {
|
|
|
default: () => [],
|
|
default: () => [],
|
|
@@ -233,6 +240,9 @@ const visibleSolicitations = computed(() =>
|
|
|
groupedSolicitations.value.slice(0, 3)
|
|
groupedSolicitations.value.slice(0, 3)
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
|
|
+const { activeIndex, onTrackScroll, pageCount, trackRef } =
|
|
|
|
|
+ useCarouselIndicator(() => visibleSolicitations.value);
|
|
|
|
|
+
|
|
|
const periodTypeLabel = (item) => {
|
|
const periodTypeLabel = (item) => {
|
|
|
const label = labelsPeriodTypes.find(
|
|
const label = labelsPeriodTypes.find(
|
|
|
(periodType) => periodType.value == item.period_type,
|
|
(periodType) => periodType.value == item.period_type,
|
|
@@ -306,21 +316,24 @@ const formatTimeSinceRequest = (value) => {
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.scroll-wrapper {
|
|
.scroll-wrapper {
|
|
|
- overflow-x: auto;
|
|
|
|
|
- padding: 0 0 8px 8px;
|
|
|
|
|
-
|
|
|
|
|
- &::-webkit-scrollbar {
|
|
|
|
|
- display: none;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ overflow: hidden;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.scroll-wrapper--single {
|
|
.scroll-wrapper--single {
|
|
|
- overflow-x: visible;
|
|
|
|
|
- padding: 0 0 8px 0;
|
|
|
|
|
|
|
+ overflow: visible;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.scroll-track {
|
|
.scroll-track {
|
|
|
align-items: flex-start;
|
|
align-items: flex-start;
|
|
|
|
|
+ gap: 12px;
|
|
|
|
|
+ overflow-x: auto;
|
|
|
|
|
+ overscroll-behavior-x: contain;
|
|
|
|
|
+ padding: 0 0 8px 0;
|
|
|
|
|
+ scroll-snap-type: x mandatory;
|
|
|
|
|
+
|
|
|
|
|
+ &::-webkit-scrollbar {
|
|
|
|
|
+ display: none;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.solicitation-card {
|
|
.solicitation-card {
|
|
@@ -335,15 +348,17 @@ const formatTimeSinceRequest = (value) => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.solicitation-card--multiple {
|
|
.solicitation-card--multiple {
|
|
|
|
|
+ scroll-snap-align: start;
|
|
|
flex: 0 0 82vw;
|
|
flex: 0 0 82vw;
|
|
|
- margin-left: 8px !important;
|
|
|
|
|
- margin-right: 8px !important;
|
|
|
|
|
|
|
+ margin-left: 0 !important;
|
|
|
|
|
+ margin-right: 0 !important;
|
|
|
max-width: 82vw;
|
|
max-width: 82vw;
|
|
|
min-width: 82vw;
|
|
min-width: 82vw;
|
|
|
width: 82vw;
|
|
width: 82vw;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.scroll-track--single {
|
|
.scroll-track--single {
|
|
|
|
|
+ overflow-x: visible;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
}
|
|
}
|
|
|
|
|
|