@quidgest/ui 0.16.20 → 0.16.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/manifest/components.json +1 -0
- package/dist/ui.css +249 -1
- package/dist/ui.esm.js +5242 -4967
- package/dist/ui.js +19 -19
- package/dist/ui.min.css +1 -1
- package/dist/ui.min.js +789 -765
- package/dist/ui.scss +221 -2
- package/esm/components/QCarousel/QCarousel.d.ts +44 -0
- package/esm/components/QCarousel/QCarousel.d.ts.map +1 -0
- package/esm/components/QCarousel/QCarousel.vue.js +355 -0
- package/esm/components/QCarousel/QCarousel.vue2.js +4 -0
- package/esm/components/QCarousel/constants.d.ts +14 -0
- package/esm/components/QCarousel/constants.d.ts.map +1 -0
- package/esm/components/QCarousel/constants.js +16 -0
- package/esm/components/QCarousel/index.d.ts +119 -0
- package/esm/components/QCarousel/index.d.ts.map +1 -0
- package/esm/components/QCarousel/index.js +6 -0
- package/esm/components/QCarousel/types.d.ts +79 -0
- package/esm/components/QCarousel/types.d.ts.map +1 -0
- package/esm/components/QCombobox/QCombobox.d.ts +22 -72
- package/esm/components/QCombobox/QCombobox.d.ts.map +1 -1
- package/esm/components/QCombobox/index.d.ts +19 -44
- package/esm/components/QCombobox/index.d.ts.map +1 -1
- package/esm/components/QDropdownMenu/QDropdownMenuContent.d.ts +18 -68
- package/esm/components/QDropdownMenu/QDropdownMenuContent.d.ts.map +1 -1
- package/esm/components/QGrid/QRow.d.ts +1 -1
- package/esm/components/QGrid/index.d.ts +3 -3
- package/esm/components/QList/QList.d.ts +5 -10
- package/esm/components/QList/QList.d.ts.map +1 -1
- package/esm/components/QList/QList.vue.js +94 -96
- package/esm/components/QList/index.d.ts +10 -48
- package/esm/components/QList/index.d.ts.map +1 -1
- package/esm/components/QList/types.d.ts +5 -1
- package/esm/components/QList/types.d.ts.map +1 -1
- package/esm/components/QSelect/QSelect.d.ts +22 -72
- package/esm/components/QSelect/QSelect.d.ts.map +1 -1
- package/esm/components/QSelect/QSelect.vue.js +18 -18
- package/esm/components/QSelect/index.d.ts +19 -44
- package/esm/components/QSelect/index.d.ts.map +1 -1
- package/esm/components/QTextArea/QTextArea.d.ts +1 -1
- package/esm/components/QTextArea/index.d.ts +3 -3
- package/esm/components/QToggleGroup/types.d.ts +1 -1
- package/esm/components/index.d.ts +1 -0
- package/esm/components/index.d.ts.map +1 -1
- package/esm/components/index.js +90 -88
- package/esm/composables/useGroup/index.d.ts +4 -2
- package/esm/composables/useGroup/index.d.ts.map +1 -1
- package/esm/composables/useGroup/index.js +26 -24
- package/esm/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/ui.scss
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Quidgest UI v0.16.
|
|
2
|
+
* Quidgest UI v0.16.22
|
|
3
3
|
* (c) 2025 Quidgest - Consultores de Gestão, S.A.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -255,6 +255,7 @@ $outline-color: rgb(var(--q-theme-info-rgb) / 50%) !default;
|
|
|
255
255
|
$outline: $outline-width $outline-style $outline-color;
|
|
256
256
|
$scrollbar-thumb: var(--q-theme-neutral-light);
|
|
257
257
|
$scrollbar-track: rgb(var(--q-theme-neutral-light-rgb) / 25%);
|
|
258
|
+
$headings-text-transform: uppercase !default;
|
|
258
259
|
$input-padding-y: 0.26rem !default;
|
|
259
260
|
$input-padding-x: 0.25rem !default;
|
|
260
261
|
:root {
|
|
@@ -316,6 +317,14 @@ a {
|
|
|
316
317
|
outline: $outline;
|
|
317
318
|
}
|
|
318
319
|
}
|
|
320
|
+
h1,
|
|
321
|
+
h2,
|
|
322
|
+
h3,
|
|
323
|
+
h4,
|
|
324
|
+
h5,
|
|
325
|
+
h6 {
|
|
326
|
+
text-transform: $headings-text-transform;
|
|
327
|
+
}
|
|
319
328
|
$transition-duration: 0.2s !default;
|
|
320
329
|
.fade-enter-from,
|
|
321
330
|
.fade-leave-to {
|
|
@@ -985,6 +994,217 @@ $transition-duration: 0.2s !default;
|
|
|
985
994
|
--card-width: 100%;
|
|
986
995
|
}
|
|
987
996
|
}
|
|
997
|
+
$q-carousel-height: 360px;
|
|
998
|
+
$q-carousel-height-md: 300px;
|
|
999
|
+
.q-carousel {
|
|
1000
|
+
--q-carousel-height: #{$q-carousel-height};
|
|
1001
|
+
position: relative;
|
|
1002
|
+
overflow: hidden;
|
|
1003
|
+
width: 100%;
|
|
1004
|
+
height: var(--q-carousel-height);
|
|
1005
|
+
border-radius: $border-radius;
|
|
1006
|
+
background-color: $neutral-light;
|
|
1007
|
+
outline: none;
|
|
1008
|
+
}
|
|
1009
|
+
.q-carousel__track {
|
|
1010
|
+
display: flex;
|
|
1011
|
+
width: 100%;
|
|
1012
|
+
height: 100%;
|
|
1013
|
+
will-change: transform;
|
|
1014
|
+
}
|
|
1015
|
+
.q-carousel__slide {
|
|
1016
|
+
flex: 0 0 100%;
|
|
1017
|
+
width: 100%;
|
|
1018
|
+
height: 100%;
|
|
1019
|
+
position: relative;
|
|
1020
|
+
cursor: pointer;
|
|
1021
|
+
user-select: none;
|
|
1022
|
+
overflow: hidden;
|
|
1023
|
+
}
|
|
1024
|
+
.q-carousel__image {
|
|
1025
|
+
width: 100%;
|
|
1026
|
+
height: 100%;
|
|
1027
|
+
object-fit: cover;
|
|
1028
|
+
}
|
|
1029
|
+
.q-carousel__caption-global {
|
|
1030
|
+
position: absolute;
|
|
1031
|
+
bottom: 3.5rem;
|
|
1032
|
+
left: 50%;
|
|
1033
|
+
transform: translateX(-50%);
|
|
1034
|
+
text-align: center;
|
|
1035
|
+
color: white;
|
|
1036
|
+
z-index: 20;
|
|
1037
|
+
max-width: 80%;
|
|
1038
|
+
}
|
|
1039
|
+
.q-carousel__title {
|
|
1040
|
+
margin: 0 0 0.25rem;
|
|
1041
|
+
font-size: 2rem;
|
|
1042
|
+
font-weight: 600;
|
|
1043
|
+
text-shadow: 0 2px 4px rgb(0 0 0 / 50%);
|
|
1044
|
+
}
|
|
1045
|
+
.q-carousel__subtitle {
|
|
1046
|
+
margin: 0;
|
|
1047
|
+
font-size: 1.1rem;
|
|
1048
|
+
opacity: 0.9;
|
|
1049
|
+
text-shadow: 0 1px 2px rgb(0 0 0 / 50%);
|
|
1050
|
+
}
|
|
1051
|
+
.q-carousel__indicators {
|
|
1052
|
+
position: absolute;
|
|
1053
|
+
bottom: 1rem;
|
|
1054
|
+
left: 50%;
|
|
1055
|
+
transform: translateX(-50%);
|
|
1056
|
+
display: flex;
|
|
1057
|
+
gap: 0.5rem;
|
|
1058
|
+
margin: 0;
|
|
1059
|
+
padding: 0;
|
|
1060
|
+
list-style: none;
|
|
1061
|
+
z-index: 10;
|
|
1062
|
+
}
|
|
1063
|
+
.q-carousel__indicator {
|
|
1064
|
+
position: relative;
|
|
1065
|
+
width: 30px;
|
|
1066
|
+
height: 4px;
|
|
1067
|
+
border-radius: 2px;
|
|
1068
|
+
background-color: rgb(255 255 255 / 50%);
|
|
1069
|
+
cursor: pointer;
|
|
1070
|
+
transition: all 0.3s ease;
|
|
1071
|
+
overflow: hidden;
|
|
1072
|
+
}
|
|
1073
|
+
.q-carousel__indicator:hover {
|
|
1074
|
+
background-color: rgb(255 255 255 / 80%);
|
|
1075
|
+
}
|
|
1076
|
+
.q-carousel__indicator--active {
|
|
1077
|
+
background-color: white;
|
|
1078
|
+
box-shadow: 0 2px 8px rgb(0 0 0 / 30%);
|
|
1079
|
+
}
|
|
1080
|
+
.q-carousel__indicator--active::before {
|
|
1081
|
+
content: '';
|
|
1082
|
+
position: absolute;
|
|
1083
|
+
top: 0;
|
|
1084
|
+
left: 0;
|
|
1085
|
+
height: 100%;
|
|
1086
|
+
background-color: rgb(0 0 0 / 20%);
|
|
1087
|
+
width: var(--q-carousel-progress-width);
|
|
1088
|
+
transition: width 0.05s linear;
|
|
1089
|
+
will-change: width;
|
|
1090
|
+
}
|
|
1091
|
+
.q-carousel__control {
|
|
1092
|
+
position: absolute;
|
|
1093
|
+
top: 50%;
|
|
1094
|
+
transform: translateY(-50%);
|
|
1095
|
+
background: rgb(0 0 0 / 50%);
|
|
1096
|
+
border: none;
|
|
1097
|
+
border-radius: 50%;
|
|
1098
|
+
width: 48px;
|
|
1099
|
+
height: 48px;
|
|
1100
|
+
display: flex;
|
|
1101
|
+
align-items: center;
|
|
1102
|
+
justify-content: center;
|
|
1103
|
+
cursor: pointer;
|
|
1104
|
+
z-index: 10;
|
|
1105
|
+
backdrop-filter: blur(4px);
|
|
1106
|
+
color: white;
|
|
1107
|
+
}
|
|
1108
|
+
.q-carousel__control:hover {
|
|
1109
|
+
background: rgb(0 0 0 / 70%);
|
|
1110
|
+
}
|
|
1111
|
+
.q-carousel__control--prev {
|
|
1112
|
+
left: 1rem;
|
|
1113
|
+
}
|
|
1114
|
+
.q-carousel__control--next {
|
|
1115
|
+
right: 1rem;
|
|
1116
|
+
}
|
|
1117
|
+
.q-carousel__control-icon.q-icon {
|
|
1118
|
+
width: 24px;
|
|
1119
|
+
height: 24px;
|
|
1120
|
+
}
|
|
1121
|
+
.q-carousel__skeleton {
|
|
1122
|
+
position: relative;
|
|
1123
|
+
width: 100%;
|
|
1124
|
+
height: 100%;
|
|
1125
|
+
}
|
|
1126
|
+
.q-carousel__skeleton-caption {
|
|
1127
|
+
position: absolute;
|
|
1128
|
+
bottom: 20%;
|
|
1129
|
+
left: 50%;
|
|
1130
|
+
transform: translateX(-50%);
|
|
1131
|
+
display: flex;
|
|
1132
|
+
flex-direction: column;
|
|
1133
|
+
align-items: center;
|
|
1134
|
+
gap: 8px;
|
|
1135
|
+
width: 100%;
|
|
1136
|
+
max-width: 600px;
|
|
1137
|
+
}
|
|
1138
|
+
.q-carousel__skeleton-controls {
|
|
1139
|
+
position: absolute;
|
|
1140
|
+
top: 50%;
|
|
1141
|
+
left: 0;
|
|
1142
|
+
right: 0;
|
|
1143
|
+
display: flex;
|
|
1144
|
+
justify-content: space-between;
|
|
1145
|
+
padding: 0 16px;
|
|
1146
|
+
transform: translateY(-50%);
|
|
1147
|
+
}
|
|
1148
|
+
.q-carousel__skeleton-caption,
|
|
1149
|
+
.q-carousel__skeleton-controls {
|
|
1150
|
+
.q-skeleton-loader__bone {
|
|
1151
|
+
background-color: var(--q-theme-neutral);
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
.q-carousel__empty-container {
|
|
1155
|
+
display: flex;
|
|
1156
|
+
align-items: center;
|
|
1157
|
+
justify-content: center;
|
|
1158
|
+
width: 100%;
|
|
1159
|
+
height: 100%;
|
|
1160
|
+
}
|
|
1161
|
+
.q-carousel__sr-only {
|
|
1162
|
+
position: absolute;
|
|
1163
|
+
width: 1px;
|
|
1164
|
+
height: 1px;
|
|
1165
|
+
padding: 0;
|
|
1166
|
+
margin: -1px;
|
|
1167
|
+
overflow: hidden;
|
|
1168
|
+
clip: rect(0, 0, 0, 0);
|
|
1169
|
+
white-space: nowrap;
|
|
1170
|
+
border: 0;
|
|
1171
|
+
}
|
|
1172
|
+
@media (max-width: $breakpoint-md) {
|
|
1173
|
+
.q-carousel {
|
|
1174
|
+
--q-carousel-height: #{$q-carousel-height-md};
|
|
1175
|
+
}
|
|
1176
|
+
.q-carousel__caption-global {
|
|
1177
|
+
bottom: 3rem;
|
|
1178
|
+
max-width: 90%;
|
|
1179
|
+
}
|
|
1180
|
+
.q-carousel__title {
|
|
1181
|
+
font-size: 1.5rem;
|
|
1182
|
+
}
|
|
1183
|
+
.q-carousel__subtitle {
|
|
1184
|
+
font-size: 1rem;
|
|
1185
|
+
}
|
|
1186
|
+
.q-carousel__control {
|
|
1187
|
+
width: 40px;
|
|
1188
|
+
height: 40px;
|
|
1189
|
+
}
|
|
1190
|
+
.q-carousel__control-icon svg {
|
|
1191
|
+
width: 16px;
|
|
1192
|
+
height: 16px;
|
|
1193
|
+
}
|
|
1194
|
+
.q-carousel__control--prev {
|
|
1195
|
+
left: 0.5rem;
|
|
1196
|
+
}
|
|
1197
|
+
.q-carousel__control--next {
|
|
1198
|
+
right: 0.5rem;
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
.q-carousel:focus-visible {
|
|
1202
|
+
outline: $outline;
|
|
1203
|
+
}
|
|
1204
|
+
.q-carousel__control:focus-visible,
|
|
1205
|
+
.q-carousel__indicator:focus-visible {
|
|
1206
|
+
outline: $outline;
|
|
1207
|
+
}
|
|
988
1208
|
.q-checkbox {
|
|
989
1209
|
$this: &;
|
|
990
1210
|
--box-size: 1.15rem;
|
|
@@ -1138,7 +1358,6 @@ $transition-duration: 0.2s !default;
|
|
|
1138
1358
|
letter-spacing: 0.02rem;
|
|
1139
1359
|
h4 {
|
|
1140
1360
|
margin: 0;
|
|
1141
|
-
text-transform: uppercase;
|
|
1142
1361
|
}
|
|
1143
1362
|
}
|
|
1144
1363
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { DEFAULT_ICONS, DEFAULT_TEXTS } from './constants';
|
|
2
|
+
import { QCarouselProps, Slide } from './types';
|
|
3
|
+
type __VLS_Props = QCarouselProps;
|
|
4
|
+
type __VLS_PublicProps = {
|
|
5
|
+
'currentSlide'?: number;
|
|
6
|
+
} & __VLS_Props;
|
|
7
|
+
declare function __VLS_template(): {
|
|
8
|
+
attrs: Partial<{}>;
|
|
9
|
+
slots: {
|
|
10
|
+
empty?(_: {}): any;
|
|
11
|
+
};
|
|
12
|
+
refs: {};
|
|
13
|
+
rootEl: HTMLDivElement;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
16
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
17
|
+
"slide:before-change": (newId: string, oldId?: string | undefined) => any;
|
|
18
|
+
"slide:after-change": (newId: string, oldId?: string | undefined) => any;
|
|
19
|
+
"slide:click": (id: string) => any;
|
|
20
|
+
"update:currentSlide": (value: number) => any;
|
|
21
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
22
|
+
"onSlide:before-change"?: ((newId: string, oldId?: string | undefined) => any) | undefined;
|
|
23
|
+
"onSlide:after-change"?: ((newId: string, oldId?: string | undefined) => any) | undefined;
|
|
24
|
+
"onSlide:click"?: ((id: string) => any) | undefined;
|
|
25
|
+
"onUpdate:currentSlide"?: ((value: number) => any) | undefined;
|
|
26
|
+
}>, {
|
|
27
|
+
icons: typeof DEFAULT_ICONS;
|
|
28
|
+
texts: typeof DEFAULT_TEXTS;
|
|
29
|
+
slides: Slide[];
|
|
30
|
+
autoCycleInterval: number;
|
|
31
|
+
autoCyclePause: "hover" | "false";
|
|
32
|
+
ride: "carousel" | "false";
|
|
33
|
+
swipeThreshold: number;
|
|
34
|
+
wrap: boolean;
|
|
35
|
+
animationDuration: number;
|
|
36
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
37
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
38
|
+
export default _default;
|
|
39
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
40
|
+
new (): {
|
|
41
|
+
$slots: S;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=QCarousel.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QCarousel.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QCarousel/QCarousel.vue"],"names":[],"mappings":"AA+IA;AAueC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAS1D,OAAO,KAAK,EAAkB,cAAc,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAKpE,KAAK,WAAW,GAAG,cAAc,CAAC;AAqVnC,KAAK,iBAAiB,GAAG;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,WAAW,CAAC;AAKhB,iBAAS,cAAc;WAqQT,OAAO,IAA6B;;uBAVtB,GAAG;;;;EAe9B;AA4BD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;wFASnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import { defineComponent as ne, mergeModels as z, useModel as re, ref as E, computed as N, watch as B, onMounted as ie, onUnmounted as ce, createElementBlock as l, openBlock as s, normalizeClass as L, createCommentVNode as a, createVNode as u, createElementVNode as q, unref as d, Fragment as p, normalizeStyle as $, renderList as Q, withModifiers as ue, renderSlot as de, toDisplayString as b, withCtx as F, mergeProps as U, nextTick as fe } from "vue";
|
|
2
|
+
import { DEFAULT_TEXTS as he, DEFAULT_ICONS as _e } from "./constants.js";
|
|
3
|
+
import { QButton as K } from "../QButton/index.js";
|
|
4
|
+
import { QIcon as O } from "../QIcon/index.js";
|
|
5
|
+
import { QSkeletonLoader as m } from "../QSkeletonLoader/index.js";
|
|
6
|
+
const ve = ["id"], pe = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "q-carousel__skeleton"
|
|
9
|
+
}, me = { class: "q-carousel__skeleton-caption" }, ye = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "q-carousel__skeleton-controls"
|
|
12
|
+
}, ge = ["onClick"], ke = ["src", "alt"], we = {
|
|
13
|
+
key: 1,
|
|
14
|
+
class: "q-carousel__empty-container"
|
|
15
|
+
}, Ce = {
|
|
16
|
+
key: 2,
|
|
17
|
+
class: "q-carousel__caption-global"
|
|
18
|
+
}, qe = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "q-carousel__title"
|
|
21
|
+
}, be = {
|
|
22
|
+
key: 1,
|
|
23
|
+
class: "q-carousel__subtitle"
|
|
24
|
+
}, Te = {
|
|
25
|
+
key: 3,
|
|
26
|
+
class: "q-carousel__indicators"
|
|
27
|
+
}, Se = ["aria-label", "aria-current", "onClick"], Ie = { class: "q-carousel__sr-only" }, De = { class: "q-carousel__sr-only" }, Le = /* @__PURE__ */ ne({
|
|
28
|
+
__name: "QCarousel",
|
|
29
|
+
props: /* @__PURE__ */ z({
|
|
30
|
+
id: {},
|
|
31
|
+
class: {},
|
|
32
|
+
slides: { default: () => [] },
|
|
33
|
+
showIndicators: { type: Boolean },
|
|
34
|
+
showControls: { type: Boolean },
|
|
35
|
+
autoCycleInterval: { default: 5e3 },
|
|
36
|
+
autoCyclePause: { default: "hover" },
|
|
37
|
+
ride: { default: "carousel" },
|
|
38
|
+
swipeThreshold: { default: 50 },
|
|
39
|
+
wrap: { type: Boolean, default: !0 },
|
|
40
|
+
animationDuration: { default: 500 },
|
|
41
|
+
loading: { type: Boolean },
|
|
42
|
+
icons: { default: () => _e },
|
|
43
|
+
texts: { default: () => he }
|
|
44
|
+
}, {
|
|
45
|
+
currentSlide: { default: 0 },
|
|
46
|
+
currentSlideModifiers: {}
|
|
47
|
+
}),
|
|
48
|
+
emits: /* @__PURE__ */ z(["slide:before-change", "slide:after-change", "slide:click"], ["update:currentSlide"]),
|
|
49
|
+
setup(X, { emit: V }) {
|
|
50
|
+
const t = X, y = V, T = re(X, "currentSlide"), o = E(0);
|
|
51
|
+
let f = !1, S = !1, I = 0, D = 0;
|
|
52
|
+
const P = E(0), M = E(0);
|
|
53
|
+
let g, k;
|
|
54
|
+
const H = N(() => ({
|
|
55
|
+
transform: `translateX(-${o.value * 100}%)`,
|
|
56
|
+
transition: f ? `transform ${t.animationDuration}ms cubic-bezier(0.4, 0, 0.2, 1)` : "none"
|
|
57
|
+
})), R = N(() => ({
|
|
58
|
+
"--q-carousel-progress-duration": `${t.autoCycleInterval}ms`,
|
|
59
|
+
"--q-carousel-progress-width": `${P.value}%`
|
|
60
|
+
}));
|
|
61
|
+
function r(e) {
|
|
62
|
+
if (e < 0 || e >= t.slides.length || e === o.value || f) return;
|
|
63
|
+
const i = o.value, n = t.slides[i], v = t.slides[e];
|
|
64
|
+
y("slide:before-change", v.id, n == null ? void 0 : n.id), o.value = e, T.value = e, t.animationDuration > 0 ? (f = !0, setTimeout(() => {
|
|
65
|
+
f = !1, y("slide:after-change", v.id, n == null ? void 0 : n.id);
|
|
66
|
+
}, t.animationDuration)) : fe(() => {
|
|
67
|
+
y("slide:after-change", v.id, n == null ? void 0 : n.id);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function w() {
|
|
71
|
+
const e = o.value + 1;
|
|
72
|
+
e >= t.slides.length ? t.wrap && r(0) : r(e);
|
|
73
|
+
}
|
|
74
|
+
function A() {
|
|
75
|
+
const e = o.value - 1;
|
|
76
|
+
e < 0 ? t.wrap && r(t.slides.length - 1) : r(e);
|
|
77
|
+
}
|
|
78
|
+
function j(e) {
|
|
79
|
+
const i = window.getSelection();
|
|
80
|
+
if (i != null && i.toString().length) return;
|
|
81
|
+
const n = t.slides[e];
|
|
82
|
+
y("slide:click", n.id);
|
|
83
|
+
}
|
|
84
|
+
function G(e) {
|
|
85
|
+
const i = {};
|
|
86
|
+
return e != null && e.colorPlaceholder && (i["background-color"] = e.colorPlaceholder), i;
|
|
87
|
+
}
|
|
88
|
+
function J() {
|
|
89
|
+
t.autoCycleInterval && (k = window.setInterval(() => {
|
|
90
|
+
P.value = (Date.now() - M.value) / t.autoCycleInterval * 100;
|
|
91
|
+
}, 50));
|
|
92
|
+
}
|
|
93
|
+
function C() {
|
|
94
|
+
!t.autoCycleInterval || t.slides.length <= 1 || (_(), t.ride === "carousel" && !S && (M.value = Date.now(), J(), g = window.setTimeout(w, t.autoCycleInterval)));
|
|
95
|
+
}
|
|
96
|
+
function _() {
|
|
97
|
+
g && window.clearTimeout(g), k && window.clearInterval(k), g = void 0, k = void 0, M.value = 0, P.value = 0;
|
|
98
|
+
}
|
|
99
|
+
function W() {
|
|
100
|
+
_(), C();
|
|
101
|
+
}
|
|
102
|
+
function Y() {
|
|
103
|
+
t.autoCyclePause === "hover" && (S = !0, _());
|
|
104
|
+
}
|
|
105
|
+
function Z() {
|
|
106
|
+
t.autoCyclePause === "hover" && (S = !1, C());
|
|
107
|
+
}
|
|
108
|
+
function ee(e) {
|
|
109
|
+
if (!f)
|
|
110
|
+
switch (e.key) {
|
|
111
|
+
case "ArrowLeft":
|
|
112
|
+
e.preventDefault(), A();
|
|
113
|
+
break;
|
|
114
|
+
case "ArrowRight":
|
|
115
|
+
e.preventDefault(), w();
|
|
116
|
+
break;
|
|
117
|
+
case "Home":
|
|
118
|
+
e.preventDefault(), r(0);
|
|
119
|
+
break;
|
|
120
|
+
case "End":
|
|
121
|
+
e.preventDefault(), r(t.slides.length - 1);
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function te(e) {
|
|
126
|
+
f || (I = e.touches[0].clientX, _());
|
|
127
|
+
}
|
|
128
|
+
function oe(e) {
|
|
129
|
+
f || (D = e.touches[0].clientX);
|
|
130
|
+
}
|
|
131
|
+
function le() {
|
|
132
|
+
if (f) return;
|
|
133
|
+
const e = I - D;
|
|
134
|
+
Math.abs(e) > t.swipeThreshold && (e > 0 ? w() : A()), I = 0, D = 0, C();
|
|
135
|
+
}
|
|
136
|
+
function se(e) {
|
|
137
|
+
return t.texts.goToSlide.replace("{0}", `${e + 1}`);
|
|
138
|
+
}
|
|
139
|
+
function ae(e) {
|
|
140
|
+
if (e.length === 0) {
|
|
141
|
+
o.value = 0, T.value = 0, _();
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
o.value >= e.length && r(0);
|
|
145
|
+
}
|
|
146
|
+
return B(() => t.slides, ae, { immediate: !0, deep: !0 }), B(o, W), B(T, (e) => {
|
|
147
|
+
e !== o.value && r(e);
|
|
148
|
+
}), ie(C), ce(_), (e, i) => {
|
|
149
|
+
var n, v, x;
|
|
150
|
+
return s(), l("div", {
|
|
151
|
+
id: t.id,
|
|
152
|
+
class: L(["q-carousel", t.class]),
|
|
153
|
+
tabindex: "0",
|
|
154
|
+
onMouseenter: Y,
|
|
155
|
+
onMouseleave: Z,
|
|
156
|
+
onKeydown: ee
|
|
157
|
+
}, [
|
|
158
|
+
a(" Skeleton Loader "),
|
|
159
|
+
e.loading ? (s(), l("div", pe, [
|
|
160
|
+
a(" Image placeholder "),
|
|
161
|
+
u(d(m), {
|
|
162
|
+
width: "100%",
|
|
163
|
+
height: "100%"
|
|
164
|
+
}),
|
|
165
|
+
a(" Overlay skeletons for text/captions "),
|
|
166
|
+
q("div", me, [
|
|
167
|
+
u(d(m), {
|
|
168
|
+
type: "text",
|
|
169
|
+
width: "40%",
|
|
170
|
+
height: "24px",
|
|
171
|
+
class: "q-carousel__skeleton-title"
|
|
172
|
+
}),
|
|
173
|
+
u(d(m), {
|
|
174
|
+
type: "text",
|
|
175
|
+
width: "60%",
|
|
176
|
+
height: "16px",
|
|
177
|
+
class: "q-carousel__skeleton-subtitle"
|
|
178
|
+
})
|
|
179
|
+
]),
|
|
180
|
+
a(" Controls "),
|
|
181
|
+
t.showControls ? (s(), l("div", ye, [
|
|
182
|
+
u(d(m), {
|
|
183
|
+
type: "icon",
|
|
184
|
+
width: "40px",
|
|
185
|
+
height: "40px",
|
|
186
|
+
class: "q-carousel__skeleton-control"
|
|
187
|
+
}),
|
|
188
|
+
u(d(m), {
|
|
189
|
+
type: "icon",
|
|
190
|
+
width: "40px",
|
|
191
|
+
height: "40px",
|
|
192
|
+
class: "q-carousel__skeleton-control"
|
|
193
|
+
})
|
|
194
|
+
])) : a("v-if", !0)
|
|
195
|
+
])) : (s(), l(
|
|
196
|
+
p,
|
|
197
|
+
{ key: 1 },
|
|
198
|
+
[
|
|
199
|
+
(n = e.slides) != null && n.length ? (s(), l(
|
|
200
|
+
p,
|
|
201
|
+
{ key: 0 },
|
|
202
|
+
[
|
|
203
|
+
a(" Carousel Content "),
|
|
204
|
+
q(
|
|
205
|
+
"div",
|
|
206
|
+
{
|
|
207
|
+
class: "q-carousel__track",
|
|
208
|
+
style: $(H.value),
|
|
209
|
+
onTouchstart: te,
|
|
210
|
+
onTouchmove: oe,
|
|
211
|
+
onTouchend: le
|
|
212
|
+
},
|
|
213
|
+
[
|
|
214
|
+
(s(!0), l(
|
|
215
|
+
p,
|
|
216
|
+
null,
|
|
217
|
+
Q(e.slides, (h, c) => (s(), l("div", {
|
|
218
|
+
key: h.id,
|
|
219
|
+
class: L([
|
|
220
|
+
"q-carousel__slide",
|
|
221
|
+
{ "q-carousel__slide--active": c === o.value }
|
|
222
|
+
]),
|
|
223
|
+
style: $(G(h)),
|
|
224
|
+
onClick: ue(() => j(c), ["stop", "prevent"])
|
|
225
|
+
}, [
|
|
226
|
+
h.image ? (s(), l("img", {
|
|
227
|
+
key: 0,
|
|
228
|
+
src: h.image,
|
|
229
|
+
alt: h.title || `Slide ${c + 1}`,
|
|
230
|
+
class: "q-carousel__image",
|
|
231
|
+
decoding: "async",
|
|
232
|
+
loading: "lazy"
|
|
233
|
+
}, null, 8, ke)) : a("v-if", !0)
|
|
234
|
+
], 14, ge))),
|
|
235
|
+
128
|
|
236
|
+
/* KEYED_FRAGMENT */
|
|
237
|
+
))
|
|
238
|
+
],
|
|
239
|
+
36
|
|
240
|
+
/* STYLE, NEED_HYDRATION */
|
|
241
|
+
)
|
|
242
|
+
],
|
|
243
|
+
64
|
|
244
|
+
/* STABLE_FRAGMENT */
|
|
245
|
+
)) : (s(), l("div", we, [
|
|
246
|
+
de(e.$slots, "empty")
|
|
247
|
+
])),
|
|
248
|
+
a(" Captions (centered, above indicators) "),
|
|
249
|
+
e.slides[o.value] ? (s(), l("div", Ce, [
|
|
250
|
+
(v = e.slides[o.value]) != null && v.title ? (s(), l(
|
|
251
|
+
"h2",
|
|
252
|
+
qe,
|
|
253
|
+
b(e.slides[o.value].title),
|
|
254
|
+
1
|
|
255
|
+
/* TEXT */
|
|
256
|
+
)) : a("v-if", !0),
|
|
257
|
+
(x = e.slides[o.value]) != null && x.subtitle ? (s(), l(
|
|
258
|
+
"p",
|
|
259
|
+
be,
|
|
260
|
+
b(e.slides[o.value].subtitle),
|
|
261
|
+
1
|
|
262
|
+
/* TEXT */
|
|
263
|
+
)) : a("v-if", !0)
|
|
264
|
+
])) : a("v-if", !0),
|
|
265
|
+
a(" Indicators "),
|
|
266
|
+
e.showIndicators && e.slides.length > 1 ? (s(), l("ol", Te, [
|
|
267
|
+
(s(!0), l(
|
|
268
|
+
p,
|
|
269
|
+
null,
|
|
270
|
+
Q(e.slides, (h, c) => (s(), l("li", {
|
|
271
|
+
key: h.id,
|
|
272
|
+
class: L([
|
|
273
|
+
"q-carousel__indicator",
|
|
274
|
+
{ "q-carousel__indicator--active": c === o.value }
|
|
275
|
+
]),
|
|
276
|
+
"data-testid": "carousel-indicator",
|
|
277
|
+
style: $(c === o.value ? R.value : {}),
|
|
278
|
+
"aria-label": se(c),
|
|
279
|
+
"aria-current": c === o.value,
|
|
280
|
+
onClick: () => r(c)
|
|
281
|
+
}, null, 14, Se))),
|
|
282
|
+
128
|
|
283
|
+
/* KEYED_FRAGMENT */
|
|
284
|
+
))
|
|
285
|
+
])) : a("v-if", !0),
|
|
286
|
+
a(" Controls "),
|
|
287
|
+
e.showControls && e.slides.length > 1 ? (s(), l(
|
|
288
|
+
p,
|
|
289
|
+
{ key: 4 },
|
|
290
|
+
[
|
|
291
|
+
u(d(K), {
|
|
292
|
+
class: "q-carousel__control q-carousel__control--prev",
|
|
293
|
+
"data-testid": "carousel-prev",
|
|
294
|
+
"aria-label": e.texts.previousText,
|
|
295
|
+
onClick: A
|
|
296
|
+
}, {
|
|
297
|
+
default: F(() => [
|
|
298
|
+
u(
|
|
299
|
+
d(O),
|
|
300
|
+
U({ class: "q-carousel__control-icon q-carousel__control-icon--prev" }, t.icons.back),
|
|
301
|
+
null,
|
|
302
|
+
16
|
|
303
|
+
/* FULL_PROPS */
|
|
304
|
+
),
|
|
305
|
+
q(
|
|
306
|
+
"span",
|
|
307
|
+
Ie,
|
|
308
|
+
b(e.texts.previousText),
|
|
309
|
+
1
|
|
310
|
+
/* TEXT */
|
|
311
|
+
)
|
|
312
|
+
]),
|
|
313
|
+
_: 1
|
|
314
|
+
/* STABLE */
|
|
315
|
+
}, 8, ["aria-label"]),
|
|
316
|
+
u(d(K), {
|
|
317
|
+
class: "q-carousel__control q-carousel__control--next",
|
|
318
|
+
"data-testid": "carousel-next",
|
|
319
|
+
"aria-label": e.texts.nextText,
|
|
320
|
+
onClick: w
|
|
321
|
+
}, {
|
|
322
|
+
default: F(() => [
|
|
323
|
+
u(
|
|
324
|
+
d(O),
|
|
325
|
+
U({ class: "q-carousel__control-icon q-carousel__control-icon--next" }, t.icons.forward),
|
|
326
|
+
null,
|
|
327
|
+
16
|
|
328
|
+
/* FULL_PROPS */
|
|
329
|
+
),
|
|
330
|
+
q(
|
|
331
|
+
"span",
|
|
332
|
+
De,
|
|
333
|
+
b(e.texts.nextText),
|
|
334
|
+
1
|
|
335
|
+
/* TEXT */
|
|
336
|
+
)
|
|
337
|
+
]),
|
|
338
|
+
_: 1
|
|
339
|
+
/* STABLE */
|
|
340
|
+
}, 8, ["aria-label"])
|
|
341
|
+
],
|
|
342
|
+
64
|
|
343
|
+
/* STABLE_FRAGMENT */
|
|
344
|
+
)) : a("v-if", !0)
|
|
345
|
+
],
|
|
346
|
+
64
|
|
347
|
+
/* STABLE_FRAGMENT */
|
|
348
|
+
))
|
|
349
|
+
], 42, ve);
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
export {
|
|
354
|
+
Le as default
|
|
355
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const DEFAULT_ICONS: {
|
|
2
|
+
back: {
|
|
3
|
+
icon: string;
|
|
4
|
+
};
|
|
5
|
+
forward: {
|
|
6
|
+
icon: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export declare const DEFAULT_TEXTS: {
|
|
10
|
+
previousText: string;
|
|
11
|
+
nextText: string;
|
|
12
|
+
goToSlide: string;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/QCarousel/constants.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa;;;;;;;CAOM,CAAA;AAGhC,eAAO,MAAM,aAAa;;;;CAIQ,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const o = {
|
|
2
|
+
back: {
|
|
3
|
+
icon: "chevron-left"
|
|
4
|
+
},
|
|
5
|
+
forward: {
|
|
6
|
+
icon: "chevron-right"
|
|
7
|
+
}
|
|
8
|
+
}, e = {
|
|
9
|
+
previousText: "Previous",
|
|
10
|
+
nextText: "Next",
|
|
11
|
+
goToSlide: "Go to slide {0}"
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
o as DEFAULT_ICONS,
|
|
15
|
+
e as DEFAULT_TEXTS
|
|
16
|
+
};
|