@kiva/kv-components 7.0.0 → 7.1.1
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/vue/KvCarousel.css +1 -1
- package/dist/vue/KvCarousel.js +107 -88
- package/package.json +3 -3
package/dist/vue/KvCarousel.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@media (min-width: 64rem){.aside-controls-content[data-v-
|
|
1
|
+
@media (min-width: 64rem){.aside-controls-content[data-v-7c085f82]{width:82%}}.circle-slide[data-v-7c085f82]{width:auto}.circle-slide.is-selected[data-v-7c085f82]{opacity:1;transform:scale(1.2);max-width:300px}.circle-slide[data-v-7c085f82]:not(.is-selected){opacity:.5;transform:scale(.7)}.circle-carousel[data-v-7c085f82]{margin:0 auto}
|
package/dist/vue/KvCarousel.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { mdiArrowLeft as
|
|
2
|
-
import { carouselUtil as
|
|
3
|
-
import
|
|
4
|
-
import { resolveComponent as
|
|
1
|
+
import { mdiArrowLeft as j, mdiArrowRight as A, mdiChevronLeft as B, mdiChevronRight as L } from "@mdi/js";
|
|
2
|
+
import { carouselUtil as K } from "../utils/carousels.js";
|
|
3
|
+
import U from "./KvMaterialIcon.js";
|
|
4
|
+
import { resolveComponent as V, openBlock as r, createElementBlock as n, normalizeClass as d, createElementVNode as i, Fragment as u, renderList as g, normalizeStyle as E, renderSlot as M, createVNode as c, toDisplayString as h, createCommentVNode as f } from "vue";
|
|
5
5
|
import "./KvCarousel.css";
|
|
6
|
-
import
|
|
7
|
-
const
|
|
6
|
+
import N from "../_virtual/_plugin-vue_export-helper.js";
|
|
7
|
+
const O = {
|
|
8
|
+
name: "KvCarousel",
|
|
8
9
|
components: {
|
|
9
|
-
KvMaterialIcon:
|
|
10
|
+
KvMaterialIcon: U
|
|
10
11
|
},
|
|
11
12
|
props: {
|
|
12
13
|
/**
|
|
@@ -52,7 +53,7 @@ const W = {
|
|
|
52
53
|
slidesToScroll: {
|
|
53
54
|
type: String,
|
|
54
55
|
default: "auto",
|
|
55
|
-
validator: (
|
|
56
|
+
validator: (w) => ["visible", "auto"].indexOf(w) !== -1
|
|
56
57
|
},
|
|
57
58
|
/**
|
|
58
59
|
* CSS value and unit to set the max width on responsive slides.
|
|
@@ -83,164 +84,182 @@ const W = {
|
|
|
83
84
|
inCircle: {
|
|
84
85
|
type: Boolean,
|
|
85
86
|
default: !1
|
|
87
|
+
},
|
|
88
|
+
/**
|
|
89
|
+
* Position carousel controls in the top right corner
|
|
90
|
+
* */
|
|
91
|
+
controlsTopRight: {
|
|
92
|
+
type: Boolean,
|
|
93
|
+
default: !1
|
|
86
94
|
}
|
|
87
95
|
},
|
|
88
96
|
emits: [
|
|
89
97
|
"change",
|
|
90
98
|
"interact-carousel"
|
|
91
99
|
],
|
|
92
|
-
setup(
|
|
100
|
+
setup(w, { emit: l, slots: e }) {
|
|
93
101
|
const {
|
|
94
102
|
componentSlotKeys: t,
|
|
95
103
|
currentIndex: m,
|
|
96
|
-
embla:
|
|
97
|
-
goToSlide:
|
|
98
|
-
handleUserInteraction:
|
|
99
|
-
isAriaHidden:
|
|
100
|
-
isAutoplaying:
|
|
101
|
-
nextIndex:
|
|
104
|
+
embla: b,
|
|
105
|
+
goToSlide: s,
|
|
106
|
+
handleUserInteraction: o,
|
|
107
|
+
isAriaHidden: a,
|
|
108
|
+
isAutoplaying: y,
|
|
109
|
+
nextIndex: x,
|
|
102
110
|
previousIndex: v,
|
|
103
111
|
reInit: C,
|
|
104
112
|
reInitVisible: I,
|
|
105
113
|
rootEl: k,
|
|
106
114
|
slideIndicatorCount: S,
|
|
107
115
|
slideIndicatorListLength: _,
|
|
108
|
-
slides:
|
|
109
|
-
toggleAutoPlay:
|
|
110
|
-
} =
|
|
116
|
+
slides: R,
|
|
117
|
+
toggleAutoPlay: T
|
|
118
|
+
} = K(w, { emit: l, slots: e });
|
|
111
119
|
return {
|
|
112
120
|
componentSlotKeys: t,
|
|
113
121
|
currentIndex: m,
|
|
114
|
-
embla:
|
|
115
|
-
goToSlide:
|
|
116
|
-
handleUserInteraction:
|
|
117
|
-
isAriaHidden:
|
|
118
|
-
isAutoplaying:
|
|
119
|
-
mdiArrowLeft:
|
|
120
|
-
mdiArrowRight:
|
|
121
|
-
mdiChevronLeft:
|
|
122
|
-
mdiChevronRight:
|
|
123
|
-
nextIndex:
|
|
122
|
+
embla: b,
|
|
123
|
+
goToSlide: s,
|
|
124
|
+
handleUserInteraction: o,
|
|
125
|
+
isAriaHidden: a,
|
|
126
|
+
isAutoplaying: y,
|
|
127
|
+
mdiArrowLeft: j,
|
|
128
|
+
mdiArrowRight: A,
|
|
129
|
+
mdiChevronLeft: B,
|
|
130
|
+
mdiChevronRight: L,
|
|
131
|
+
nextIndex: x,
|
|
124
132
|
previousIndex: v,
|
|
125
133
|
reInit: C,
|
|
126
134
|
reInitVisible: I,
|
|
127
135
|
rootEl: k,
|
|
128
136
|
slideIndicatorCount: S,
|
|
129
137
|
slideIndicatorListLength: _,
|
|
130
|
-
slides:
|
|
131
|
-
toggleAutoPlay:
|
|
138
|
+
slides: R,
|
|
139
|
+
toggleAutoPlay: T
|
|
132
140
|
};
|
|
133
141
|
}
|
|
134
|
-
},
|
|
142
|
+
}, W = ["aria-label", "aria-current", "aria-hidden", "tab-index"], D = ["disabled"], H = ["aria-label"], P = ["disabled"], z = {
|
|
135
143
|
key: 1,
|
|
136
144
|
class: "kv-carousel__controls tw-flex tw-justify-center tw-items-center tw-gap-1.5 tw-mt-4 tw-w-full"
|
|
137
|
-
}, F = ["onClick"],
|
|
145
|
+
}, F = ["onClick"], q = {
|
|
138
146
|
class: "tw-hidden lg:tw-flex tw-absolute tw-h-full tw-top-0 tw-items-center",
|
|
139
147
|
style: { background: "linear-gradient(90deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 100%)", width: "8%" }
|
|
140
|
-
},
|
|
148
|
+
}, G = ["disabled"], J = {
|
|
141
149
|
class: "tw-hidden lg:tw-flex tw-absolute tw-h-full tw-top-0 tw-right-0 tw-items-center tw-justify-end tw-w-16",
|
|
142
150
|
style: { background: "linear-gradient(270deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 100%)", width: "8%" }
|
|
143
|
-
},
|
|
144
|
-
function
|
|
145
|
-
const
|
|
146
|
-
return
|
|
151
|
+
}, Q = ["disabled"];
|
|
152
|
+
function X(w, l, e, t, m, b) {
|
|
153
|
+
const s = V("kv-material-icon");
|
|
154
|
+
return r(), n("section", {
|
|
147
155
|
ref: "rootEl",
|
|
148
|
-
class:
|
|
156
|
+
class: d(["kv-carousel tw-overflow-hidden tw-w-full", { "lg:tw-relative": e.asideControls, "tw-relative tw-pt-8": e.controlsTopRight }]),
|
|
149
157
|
"aria-label": "carousel"
|
|
150
158
|
}, [
|
|
151
159
|
i("div", {
|
|
152
|
-
class:
|
|
153
|
-
"tw-mx-auto aside-controls-content":
|
|
154
|
-
"circle-carousel":
|
|
160
|
+
class: d(["tw-flex tw-gap-x-4", {
|
|
161
|
+
"tw-mx-auto aside-controls-content": e.asideControls,
|
|
162
|
+
"circle-carousel": e.inCircle
|
|
155
163
|
}])
|
|
156
164
|
}, [
|
|
157
|
-
(
|
|
158
|
-
key:
|
|
159
|
-
class:
|
|
165
|
+
(r(!0), n(u, null, g(t.componentSlotKeys, (o, a) => (r(), n("div", {
|
|
166
|
+
key: a,
|
|
167
|
+
class: d(["tw-flex-none tw-relative", { "tw-w-full": !e.multipleSlidesVisible || e.slideMaxWidth, "circle-slide": e.inCircle }]),
|
|
160
168
|
role: "group",
|
|
161
|
-
"aria-label": `slide ${
|
|
162
|
-
"aria-current": t.currentIndex ===
|
|
163
|
-
"aria-hidden": t.isAriaHidden(
|
|
164
|
-
"tab-index": t.isAriaHidden(
|
|
165
|
-
style:
|
|
169
|
+
"aria-label": `slide ${a + 1} of ${t.componentSlotKeys.length}`,
|
|
170
|
+
"aria-current": t.currentIndex === a ? "true" : "false",
|
|
171
|
+
"aria-hidden": t.isAriaHidden(a) ? "true" : "false",
|
|
172
|
+
"tab-index": t.isAriaHidden(a) ? "-1" : !1,
|
|
173
|
+
style: E(e.slideMaxWidth ? `max-width:${e.slideMaxWidth}` : "")
|
|
166
174
|
}, [
|
|
167
|
-
|
|
168
|
-
], 14,
|
|
175
|
+
M(w.$slots, o, {}, void 0, !0)
|
|
176
|
+
], 14, W))), 128))
|
|
169
177
|
], 2),
|
|
170
|
-
t.slideIndicatorCount > 1 && !
|
|
178
|
+
t.slideIndicatorCount > 1 && !e.isDotted ? (r(), n("div", {
|
|
171
179
|
key: 0,
|
|
172
|
-
class:
|
|
180
|
+
class: d(["kv-carousel__controls tw-flex tw-justify-between tw-items-center tw-w-full", {
|
|
181
|
+
"lg:tw-hidden": e.asideControls,
|
|
182
|
+
"tw-mt-4 md:tw-justify-center": !e.controlsTopRight,
|
|
183
|
+
"md:tw-justify-end tw-absolute tw-top-0 tw-right-0 tw-w-auto tw-gap-2 tw-pr-1": e.controlsTopRight
|
|
184
|
+
}])
|
|
173
185
|
}, [
|
|
174
186
|
i("button", {
|
|
175
|
-
class: "tw-text-primary tw-
|
|
187
|
+
class: d(["tw-text-primary tw-h-4 tw-w-4 tw-rounded-full tw-border-primary tw-flex tw-items-center tw-justify-center disabled:tw-opacity-low disabled:tw-cursor-default", {
|
|
188
|
+
"tw-border-2": !e.controlsTopRight,
|
|
189
|
+
"tw-bg-white tw-shadow-lg": e.controlsTopRight
|
|
190
|
+
}]),
|
|
176
191
|
disabled: t.embla && !t.embla.canScrollPrev(),
|
|
177
|
-
onClick:
|
|
192
|
+
onClick: l[0] || (l[0] = (o) => t.handleUserInteraction(t.previousIndex, "click-left-arrow"))
|
|
178
193
|
}, [
|
|
179
|
-
c(
|
|
194
|
+
c(s, {
|
|
180
195
|
class: "tw-w-4",
|
|
181
|
-
icon:
|
|
196
|
+
icon: e.asideControls ? t.mdiArrowLeft : t.mdiChevronLeft
|
|
182
197
|
}, null, 8, ["icon"]),
|
|
183
|
-
|
|
184
|
-
],
|
|
185
|
-
|
|
198
|
+
l[4] || (l[4] = i("span", { class: "tw-sr-only" }, "Show previous slide", -1))
|
|
199
|
+
], 10, D),
|
|
200
|
+
e.controlsTopRight ? f("", !0) : (r(), n("div", {
|
|
201
|
+
key: 0,
|
|
186
202
|
"aria-label": `screen ${t.currentIndex + 1} of ${t.slideIndicatorCount}`,
|
|
187
203
|
class: "tw-mx-2 md:tw-mx-3 lg:tw-mx-4 tw-invisible md:tw-visible"
|
|
188
|
-
},
|
|
204
|
+
}, h(t.currentIndex + 1) + "/" + h(t.slideIndicatorCount), 9, H)),
|
|
189
205
|
i("button", {
|
|
190
|
-
class: "tw-text-primary tw-
|
|
206
|
+
class: d(["tw-text-primary tw-h-4 tw-w-4 tw-rounded-full tw-border-primary tw-flex tw-items-center tw-justify-center disabled:tw-opacity-low disabled:tw-cursor-default", {
|
|
207
|
+
"tw-border-2": !e.controlsTopRight,
|
|
208
|
+
"tw-bg-white tw-shadow-lg": e.controlsTopRight
|
|
209
|
+
}]),
|
|
191
210
|
disabled: t.embla && !t.embla.canScrollNext(),
|
|
192
|
-
onClick:
|
|
211
|
+
onClick: l[1] || (l[1] = (o) => t.handleUserInteraction(t.nextIndex, "click-right-arrow"))
|
|
193
212
|
}, [
|
|
194
|
-
c(
|
|
213
|
+
c(s, {
|
|
195
214
|
class: "tw-w-4",
|
|
196
|
-
icon:
|
|
215
|
+
icon: e.asideControls ? t.mdiArrowRight : t.mdiChevronRight
|
|
197
216
|
}, null, 8, ["icon"]),
|
|
198
|
-
|
|
199
|
-
],
|
|
200
|
-
], 2)) : t.slideIndicatorCount > 1 ? (
|
|
201
|
-
(
|
|
202
|
-
key:
|
|
203
|
-
onClick: (
|
|
217
|
+
l[5] || (l[5] = i("span", { class: "tw-sr-only" }, "Show next slide", -1))
|
|
218
|
+
], 10, P)
|
|
219
|
+
], 2)) : t.slideIndicatorCount > 1 ? (r(), n("div", z, [
|
|
220
|
+
(r(!0), n(u, null, g(t.slideIndicatorCount, (o) => (r(), n("button", {
|
|
221
|
+
key: o,
|
|
222
|
+
onClick: (a) => t.goToSlide(o - 1)
|
|
204
223
|
}, [
|
|
205
224
|
i("div", {
|
|
206
|
-
class:
|
|
207
|
-
{ "tw-bg-black tw-border-black tw-h-1.5 tw-w-1.5": t.currentIndex ===
|
|
208
|
-
{ "tw-bg-tertiary tw-border-tertiary tw-h-1 tw-w-1": t.currentIndex !==
|
|
225
|
+
class: d(["tw-rounded-full tw-border tw-transition tw-duration-500 tw-ease-in-out", [
|
|
226
|
+
{ "tw-bg-black tw-border-black tw-h-1.5 tw-w-1.5": t.currentIndex === o - 1 },
|
|
227
|
+
{ "tw-bg-tertiary tw-border-tertiary tw-h-1 tw-w-1": t.currentIndex !== o - 1 }
|
|
209
228
|
]])
|
|
210
229
|
}, null, 2)
|
|
211
230
|
], 8, F))), 128))
|
|
212
|
-
])) :
|
|
213
|
-
|
|
214
|
-
i("div",
|
|
231
|
+
])) : f("", !0),
|
|
232
|
+
e.asideControls ? (r(), n(u, { key: 2 }, [
|
|
233
|
+
i("div", q, [
|
|
215
234
|
i("button", {
|
|
216
235
|
class: "tw-text-primary tw-bg-gray-100 tw-rounded-full tw-h-6 tw-w-6 tw-ml-3 tw-flex tw-items-center tw-justify-center disabled:tw-opacity-low disabled:tw-cursor-default",
|
|
217
236
|
disabled: t.embla && !t.embla.canScrollPrev(),
|
|
218
|
-
onClick:
|
|
237
|
+
onClick: l[2] || (l[2] = (o) => t.handleUserInteraction(t.previousIndex, "click-left-arrow"))
|
|
219
238
|
}, [
|
|
220
|
-
c(
|
|
239
|
+
c(s, {
|
|
221
240
|
class: "tw-w-4",
|
|
222
241
|
icon: t.mdiArrowLeft
|
|
223
242
|
}, null, 8, ["icon"]),
|
|
224
|
-
|
|
225
|
-
], 8,
|
|
243
|
+
l[6] || (l[6] = i("span", { class: "tw-sr-only" }, "Show previous slide", -1))
|
|
244
|
+
], 8, G)
|
|
226
245
|
]),
|
|
227
|
-
i("div",
|
|
246
|
+
i("div", J, [
|
|
228
247
|
i("button", {
|
|
229
248
|
class: "tw-text-primary tw-bg-gray-100 tw-rounded-full tw-h-6 tw-w-6 tw-mr-3 tw-flex tw-items-center tw-justify-center disabled:tw-opacity-low disabled:tw-cursor-default",
|
|
230
249
|
disabled: t.embla && !t.embla.canScrollNext(),
|
|
231
|
-
onClick:
|
|
250
|
+
onClick: l[3] || (l[3] = (o) => t.handleUserInteraction(t.nextIndex, "click-right-arrow"))
|
|
232
251
|
}, [
|
|
233
|
-
c(
|
|
252
|
+
c(s, {
|
|
234
253
|
class: "tw-w-4",
|
|
235
254
|
icon: t.mdiArrowRight
|
|
236
255
|
}, null, 8, ["icon"]),
|
|
237
|
-
|
|
238
|
-
], 8,
|
|
256
|
+
l[7] || (l[7] = i("span", { class: "tw-sr-only" }, "Show next slide", -1))
|
|
257
|
+
], 8, Q)
|
|
239
258
|
])
|
|
240
|
-
], 64)) :
|
|
259
|
+
], 64)) : f("", !0)
|
|
241
260
|
], 2);
|
|
242
261
|
}
|
|
243
|
-
const lt = /* @__PURE__ */
|
|
262
|
+
const lt = /* @__PURE__ */ N(O, [["render", X], ["__scopeId", "data-v-7c085f82"]]);
|
|
244
263
|
export {
|
|
245
264
|
lt as default
|
|
246
265
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@babel/preset-env": "^7.24.8",
|
|
22
22
|
"@babel/preset-react": "^7.24.7",
|
|
23
23
|
"@babel/preset-typescript": "^7.24.7",
|
|
24
|
-
"@kiva/kv-tokens": "^3.5.
|
|
24
|
+
"@kiva/kv-tokens": "^3.5.1",
|
|
25
25
|
"@kiva/vite-plugin-vue-lib-css": "^2.0.0",
|
|
26
26
|
"@laynezh/vite-plugin-lib-assets": "^0.6.1",
|
|
27
27
|
"@mdi/js": "^7.4.47",
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"embla-carousel-fade",
|
|
115
115
|
"popper.js"
|
|
116
116
|
],
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "68824d91cf73da7a300823b297446636863362a0"
|
|
118
118
|
}
|