@aotearoan/neon 22.1.2 → 22.3.0
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/common/enums/NeonToggleStyle.cjs.js +1 -1
- package/dist/common/enums/NeonToggleStyle.cjs.js.map +1 -1
- package/dist/common/enums/NeonToggleStyle.es.js +2 -2
- package/dist/common/enums/NeonToggleStyle.es.js.map +1 -1
- package/dist/common/utils/NeonDateUtils.cjs.js +1 -1
- package/dist/common/utils/NeonDateUtils.cjs.js.map +1 -1
- package/dist/common/utils/NeonDateUtils.es.js +45 -39
- package/dist/common/utils/NeonDateUtils.es.js.map +1 -1
- package/dist/common/utils/NeonFileUtils.cjs.js +2 -0
- package/dist/common/utils/NeonFileUtils.cjs.js.map +1 -0
- package/dist/common/utils/NeonFileUtils.es.js +10 -0
- package/dist/common/utils/NeonFileUtils.es.js.map +1 -0
- package/dist/components/navigation/stepper/NeonStepper.vue.cjs.js +1 -1
- package/dist/components/navigation/stepper/NeonStepper.vue.cjs.js.map +1 -1
- package/dist/components/navigation/stepper/NeonStepper.vue.es.js +29 -21
- package/dist/components/navigation/stepper/NeonStepper.vue.es.js.map +1 -1
- package/dist/components/presentation/badge/NeonBadge.cjs.js +1 -1
- package/dist/components/presentation/badge/NeonBadge.cjs.js.map +1 -1
- package/dist/components/presentation/badge/NeonBadge.es.js +51 -26
- package/dist/components/presentation/badge/NeonBadge.es.js.map +1 -1
- package/dist/components/presentation/badge/NeonBadge.vue.cjs.js +1 -1
- package/dist/components/presentation/badge/NeonBadge.vue.cjs.js.map +1 -1
- package/dist/components/presentation/badge/NeonBadge.vue.es.js +28 -14
- package/dist/components/presentation/badge/NeonBadge.vue.es.js.map +1 -1
- package/dist/components/presentation/image-carousel/NeonImageCarousel.cjs.js +1 -1
- package/dist/components/presentation/image-carousel/NeonImageCarousel.cjs.js.map +1 -1
- package/dist/components/presentation/image-carousel/NeonImageCarousel.es.js +44 -32
- package/dist/components/presentation/image-carousel/NeonImageCarousel.es.js.map +1 -1
- package/dist/components/presentation/image-carousel/NeonImageCarousel.vue.cjs.js +1 -1
- package/dist/components/presentation/image-carousel/NeonImageCarousel.vue.cjs.js.map +1 -1
- package/dist/components/presentation/image-carousel/NeonImageCarousel.vue.es.js +116 -86
- package/dist/components/presentation/image-carousel/NeonImageCarousel.vue.es.js.map +1 -1
- package/dist/components/user-input/file/NeonFile.cjs.js +1 -1
- package/dist/components/user-input/file/NeonFile.cjs.js.map +1 -1
- package/dist/components/user-input/file/NeonFile.es.js +20 -12
- package/dist/components/user-input/file/NeonFile.es.js.map +1 -1
- package/dist/components/user-input/file/NeonFile.vue.cjs.js +1 -1
- package/dist/components/user-input/file/NeonFile.vue.cjs.js.map +1 -1
- package/dist/components/user-input/file/NeonFile.vue.es.js +7 -5
- package/dist/components/user-input/file/NeonFile.vue.es.js.map +1 -1
- package/dist/components/user-input/toggle/NeonToggle.cjs.js +1 -1
- package/dist/components/user-input/toggle/NeonToggle.cjs.js.map +1 -1
- package/dist/components/user-input/toggle/NeonToggle.es.js +19 -18
- package/dist/components/user-input/toggle/NeonToggle.es.js.map +1 -1
- package/dist/components/user-input/toggle/NeonToggle.vue.cjs.js +1 -1
- package/dist/components/user-input/toggle/NeonToggle.vue.cjs.js.map +1 -1
- package/dist/components/user-input/toggle/NeonToggle.vue.es.js +9 -9
- package/dist/components/user-input/toggle/NeonToggle.vue.es.js.map +1 -1
- package/dist/neon.cjs.js +1 -1
- package/dist/neon.es.js +40 -38
- package/dist/neon.es.js.map +1 -1
- package/dist/src/common/enums/NeonToggleStyle.d.ts +3 -1
- package/dist/src/common/models/NeonDate.d.ts +2 -0
- package/dist/src/common/utils/NeonFileUtils.d.ts +6 -0
- package/dist/src/components/feedback/dialog/NeonDialog.d.ts +2 -2
- package/dist/src/components/feedback/note/NeonNote.d.ts +1 -1
- package/dist/src/components/layout/card-list/NeonCardList.d.ts +1 -1
- package/dist/src/components/layout/modal/NeonModal.d.ts +1 -1
- package/dist/src/components/navigation/dropdown-menu/NeonDropdownMenu.d.ts +4953 -471
- package/dist/src/components/navigation/menu/NeonMenu.d.ts +4920 -402
- package/dist/src/components/navigation/mobile-menu/NeonMobileMenu.d.ts +4897 -469
- package/dist/src/components/presentation/badge/NeonBadge.d.ts +1501 -3
- package/dist/src/components/presentation/dropdown/NeonDropdown.d.ts +1529 -17
- package/dist/src/components/presentation/image-carousel/NeonImageCarousel.d.ts +36 -23
- package/dist/src/components/user-input/button/NeonButton.d.ts +1 -1
- package/dist/src/components/user-input/chip/NeonChip.d.ts +1 -1
- package/dist/src/components/user-input/date-picker/NeonDatePicker.d.ts +1801 -218
- package/dist/src/components/user-input/drop-zone/NeonDropZone.d.ts +1 -1
- package/dist/src/components/user-input/file/NeonFile.d.ts +636 -7
- package/dist/src/components/user-input/filter-list/NeonFilterList.d.ts +1 -1
- package/dist/src/components/user-input/number/NeonNumber.d.ts +1 -1
- package/dist/src/components/user-input/search/NeonSearch.d.ts +5247 -693
- package/dist/src/components/user-input/select/NeonSelect.d.ts +4571 -71
- package/dist/src/components/user-input/toggle/NeonToggle.d.ts +1 -0
- package/dist/src/neon.d.ts +1 -0
- package/package.json +1 -1
- package/src/sass/components/_badge.scss +79 -0
- package/src/sass/components/_image-carousel.scss +109 -14
- package/src/sass/components/_stepper.scss +8 -3
- package/src/sass/components/_toggle.scss +29 -6
- package/src/sass/includes/_dependencies.scss +1 -1
- package/src/sass/variables.scss +33 -2
|
@@ -1,14 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as f, computed as a } from "vue";
|
|
2
2
|
import { NeonFunctionalColor as e } from "../../../common/enums/NeonFunctionalColor.es.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
3
|
+
import c from "../../user-input/file/NeonFile.vue.es.js";
|
|
4
|
+
import p from "../icon/NeonIcon.vue.es.js";
|
|
5
|
+
import { NeonJazziconUtils as s } from "../../../common/utils/NeonJazziconUtils.es.js";
|
|
6
|
+
import { NeonColorUtils as y } from "../../../common/utils/NeonColorUtils.es.js";
|
|
7
|
+
import { NeonBadgeSize as n } from "../../../common/enums/NeonBadgeSize.es.js";
|
|
8
|
+
const j = f({
|
|
8
9
|
name: "NeonBadge",
|
|
9
10
|
components: {
|
|
10
|
-
|
|
11
|
+
NeonFile: c,
|
|
12
|
+
NeonIcon: p
|
|
11
13
|
},
|
|
14
|
+
emits: [
|
|
15
|
+
/**
|
|
16
|
+
* emitted when the user selects or clears their image in edit mode.
|
|
17
|
+
* NOTE: This emit event DOES NOT set the badge image, it is the responsibility of the parent component to pass an
|
|
18
|
+
* image URL back into the component's image property to set it, e.g. a data URI.
|
|
19
|
+
* @type {File}
|
|
20
|
+
*/
|
|
21
|
+
"change-image"
|
|
22
|
+
],
|
|
12
23
|
props: {
|
|
13
24
|
/**
|
|
14
25
|
* The two character <em>initials</em> to display on the badge.
|
|
@@ -29,15 +40,24 @@ const N = d({
|
|
|
29
40
|
/**
|
|
30
41
|
* The size of the badge - s, m, l, xl, xxl.
|
|
31
42
|
*/
|
|
32
|
-
size: { type: String, default:
|
|
43
|
+
size: { type: String, default: n.Medium },
|
|
33
44
|
/**
|
|
34
45
|
* The color of the badge. This is one of the provided NeonFunctionalColors.
|
|
35
46
|
*/
|
|
36
|
-
color: { type: String, default: e.
|
|
47
|
+
color: { type: String, default: e.Primary },
|
|
37
48
|
/**
|
|
38
49
|
* Alternate color for creating gradient badges. NOTE: can also be the same color as 'color'.
|
|
39
50
|
*/
|
|
40
51
|
alternateColor: { type: String, default: null },
|
|
52
|
+
/**
|
|
53
|
+
* Allow editing of the image. This will place an image file lookup button on top of the image allowing the user to
|
|
54
|
+
* choose a new image to upload.
|
|
55
|
+
*/
|
|
56
|
+
editable: { type: Boolean, default: !1 },
|
|
57
|
+
/**
|
|
58
|
+
* Accept string for the filetype to support selecting.
|
|
59
|
+
*/
|
|
60
|
+
accept: { type: String, default: "image/*" },
|
|
41
61
|
/**
|
|
42
62
|
* Display the badge in the disable style
|
|
43
63
|
*/
|
|
@@ -49,15 +69,19 @@ const N = d({
|
|
|
49
69
|
/**
|
|
50
70
|
* Badge image alt text.
|
|
51
71
|
*/
|
|
52
|
-
imageAlt: { type: String, default: "Badge" }
|
|
72
|
+
imageAlt: { type: String, default: "Badge" },
|
|
73
|
+
/**
|
|
74
|
+
* Title for the file upload button in edit mode.
|
|
75
|
+
*/
|
|
76
|
+
editButtonTitle: { type: String, default: "Edit" }
|
|
53
77
|
},
|
|
54
|
-
setup(o) {
|
|
55
|
-
const t = (
|
|
56
|
-
let
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
return
|
|
60
|
-
},
|
|
78
|
+
setup(o, { emit: r }) {
|
|
79
|
+
const t = (u) => {
|
|
80
|
+
let l = getComputedStyle(document.documentElement).getPropertyValue(`--neon-rgb-${u}-l1`);
|
|
81
|
+
l.length === 0 && (l = "0, 0, 0");
|
|
82
|
+
const d = l.trim().split(", ").map((g) => +g);
|
|
83
|
+
return y.rgbToHex(d);
|
|
84
|
+
}, i = a(() => [
|
|
61
85
|
"#000000",
|
|
62
86
|
t(e.Brand),
|
|
63
87
|
t(e.Primary),
|
|
@@ -65,19 +89,20 @@ const N = d({
|
|
|
65
89
|
t(e.Success),
|
|
66
90
|
t(e.Warn),
|
|
67
91
|
t(e.Error)
|
|
68
|
-
])
|
|
92
|
+
]), m = a(
|
|
93
|
+
() => o.jazziconId ? s.genSvg(
|
|
94
|
+
i.value,
|
|
95
|
+
o.jazziconId,
|
|
96
|
+
o.size === n.Small ? 32 : o.size === n.Medium ? 40 : 48
|
|
97
|
+
) : null
|
|
98
|
+
);
|
|
69
99
|
return {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
a.value,
|
|
73
|
-
o.jazziconId,
|
|
74
|
-
o.size === l.Small ? 32 : o.size === l.Medium ? 40 : 48
|
|
75
|
-
) : null
|
|
76
|
-
)
|
|
100
|
+
emit: r,
|
|
101
|
+
svg: m
|
|
77
102
|
};
|
|
78
103
|
}
|
|
79
104
|
});
|
|
80
105
|
export {
|
|
81
|
-
|
|
106
|
+
j as default
|
|
82
107
|
};
|
|
83
108
|
//# sourceMappingURL=NeonBadge.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonBadge.es.js","sources":["../../../../src/components/presentation/badge/NeonBadge.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { computed, defineComponent } from 'vue';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\nimport NeonIcon from '@/components/presentation/icon/NeonIcon.vue';\nimport { NeonJazziconUtils } from '@/common/utils/NeonJazziconUtils';\nimport { NeonColorUtils } from '@/common/utils/NeonColorUtils';\nimport { NeonBadgeSize } from '@/common/enums/NeonBadgeSize';\n\n/**\n * A badge is a small square or circular component for representing user avatars. These can be in the form of an image, an icon or a two character string (e.g. the user's initials).\n */\nexport default defineComponent({\n name: 'NeonBadge',\n components: {\n NeonIcon,\n },\n props: {\n /**\n * The two character <em>initials</em> to display on the badge.\n */\n label: { type: String, default: null },\n /**\n * URL of the image to display on the badge.\n */\n image: { type: String, default: null },\n /**\n * An icon to display on the badge.\n */\n icon: { type: String, default: null },\n /**\n * If true, render the badge as a circle, instead of a square.\n */\n circular: { type: Boolean, default: false },\n /**\n * The size of the badge - s, m, l, xl, xxl.\n */\n size: { type: String as () => NeonBadgeSize, default: NeonBadgeSize.Medium },\n /**\n * The color of the badge. This is one of the provided NeonFunctionalColors.\n */\n color: { type: String as () => NeonFunctionalColor, default: NeonFunctionalColor.
|
|
1
|
+
{"version":3,"file":"NeonBadge.es.js","sources":["../../../../src/components/presentation/badge/NeonBadge.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { computed, defineComponent } from 'vue';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\nimport NeonFile from '@/components/user-input/file/NeonFile.vue';\nimport NeonIcon from '@/components/presentation/icon/NeonIcon.vue';\nimport { NeonJazziconUtils } from '@/common/utils/NeonJazziconUtils';\nimport { NeonColorUtils } from '@/common/utils/NeonColorUtils';\nimport { NeonBadgeSize } from '@/common/enums/NeonBadgeSize';\n\n/**\n * A badge is a small square or circular component for representing user avatars. These can be in the form of an image, an icon or a two character string (e.g. the user's initials).\n */\nexport default defineComponent({\n name: 'NeonBadge',\n components: {\n NeonFile,\n NeonIcon,\n },\n emits: [\n /**\n * emitted when the user selects or clears their image in edit mode.\n * NOTE: This emit event DOES NOT set the badge image, it is the responsibility of the parent component to pass an\n * image URL back into the component's image property to set it, e.g. a data URI.\n * @type {File}\n */\n 'change-image',\n ],\n props: {\n /**\n * The two character <em>initials</em> to display on the badge.\n */\n label: { type: String, default: null },\n /**\n * URL of the image to display on the badge.\n */\n image: { type: String, default: null },\n /**\n * An icon to display on the badge.\n */\n icon: { type: String, default: null },\n /**\n * If true, render the badge as a circle, instead of a square.\n */\n circular: { type: Boolean, default: false },\n /**\n * The size of the badge - s, m, l, xl, xxl.\n */\n size: { type: String as () => NeonBadgeSize, default: NeonBadgeSize.Medium },\n /**\n * The color of the badge. This is one of the provided NeonFunctionalColors.\n */\n color: { type: String as () => NeonFunctionalColor, default: NeonFunctionalColor.Primary },\n /**\n * Alternate color for creating gradient badges. NOTE: can also be the same color as 'color'.\n */\n alternateColor: { type: String as () => NeonFunctionalColor, default: null },\n /**\n * Allow editing of the image. This will place an image file lookup button on top of the image allowing the user to\n * choose a new image to upload.\n */\n editable: { type: Boolean, default: false },\n /**\n * Accept string for the filetype to support selecting.\n */\n accept: { type: String, default: 'image/*' },\n /**\n * Display the badge in the disable style\n */\n disabled: { type: Boolean, default: false },\n /**\n * Apply the generated Jazzicon style based on the unique identified provided (e.g. a wallet address, name, etc)\n */\n jazziconId: { type: String, default: null },\n /**\n * Badge image alt text.\n */\n imageAlt: { type: String, default: 'Badge' },\n /**\n * Title for the file upload button in edit mode.\n */\n editButtonTitle: { type: String, default: 'Edit' },\n },\n setup(props, { emit }) {\n const getColor = (key: NeonFunctionalColor) => {\n let colorString = getComputedStyle(document.documentElement).getPropertyValue(`--neon-rgb-${key}-l1`);\n if (colorString.length === 0) {\n colorString = '0, 0, 0';\n }\n const colorRgb = colorString\n .trim()\n .split(', ')\n .map((str) => +str);\n return NeonColorUtils.rgbToHex(colorRgb);\n };\n\n const palette = computed(() => [\n '#000000',\n getColor(NeonFunctionalColor.Brand),\n getColor(NeonFunctionalColor.Primary),\n getColor(NeonFunctionalColor.Info),\n getColor(NeonFunctionalColor.Success),\n getColor(NeonFunctionalColor.Warn),\n getColor(NeonFunctionalColor.Error),\n ]);\n\n const svg = computed(() =>\n props.jazziconId\n ? NeonJazziconUtils.genSvg(\n palette.value,\n props.jazziconId,\n props.size === NeonBadgeSize.Small ? 32 : props.size === NeonBadgeSize.Medium ? 40 : 48,\n )\n : null,\n );\n\n return {\n emit,\n svg,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonFile","NeonIcon","NeonBadgeSize","NeonFunctionalColor","props","emit","getColor","key","colorString","colorRgb","str","NeonColorUtils","palette","computed","svg","NeonJazziconUtils"],"mappings":";;;;;;;AAWA,MAAAA,IAAeC,EAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,IACV,UAAAC;AAAA,IACA,UAAAC;AAAA,EAAA;AAAA,EAEF,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOL;AAAA,EAAA;AAAA,EAEF,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,OAAO,EAAE,MAAM,QAAQ,SAAS,KAAA;AAAA;AAAA;AAAA;AAAA,IAIhC,OAAO,EAAE,MAAM,QAAQ,SAAS,KAAA;AAAA;AAAA;AAAA;AAAA,IAIhC,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAA;AAAA;AAAA;AAAA;AAAA,IAI/B,UAAU,EAAE,MAAM,SAAS,SAAS,GAAA;AAAA;AAAA;AAAA;AAAA,IAIpC,MAAM,EAAE,MAAM,Q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,QAChBH,EAAQ;AAAA,QACRR,EAAM;AAAA,QACNA,EAAM,SAASF,EAAc,QAAQ,KAAKE,EAAM,SAASF,EAAc,SAAS,KAAK;AAAA,MAAA,IAEvF;AAAA,IAAA;AAGN,WAAO;AAAA,MACL,MAAAG;AAAA,MACA,KAAAS;AAAA,IAAA;AAAA,EAEJ;AACF,CAAC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const r=require("./NeonBadge.cjs.js"),n=require("vue"),s=require("../../../_virtual/_plugin-vue_export-helper.cjs.js"),d=["innerHTML"],t={key:1,class:"neon-badge__label"},c=["alt","src"];function b(e,o,p,u,m,k){const l=n.resolveComponent("neon-icon"),a=n.resolveComponent("neon-file");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass([[`neon-badge--${e.color}`,e.alternateColor?`neon-badge--alternate-color-${e.alternateColor}`:"",`neon-badge--${e.size}`,{"neon-badge--with-label":e.label,"neon-badge--disabled":e.disabled,"neon-badge--with-image":e.image,"neon-badge--with-icon":e.icon,"neon-badge--editable":e.editable},e.circular?"neon-badge--circular":"neon-badge--square"],"neon-badge"])},[e.jazziconId?(n.openBlock(),n.createElementBlock("div",{key:0,class:"neon-badge__image",innerHTML:e.svg},null,8,d)):e.label?(n.openBlock(),n.createElementBlock("span",t,n.toDisplayString(e.label),1)):e.image?(n.openBlock(),n.createElementBlock("img",{key:2,alt:e.imageAlt,src:e.image,class:"neon-badge__image"},null,8,c)):e.icon?(n.openBlock(),n.createBlock(l,{key:3,disabled:e.disabled,inverse:!!e.color,name:e.icon,class:"neon-badge__icon"},null,8,["disabled","inverse","name"])):n.createCommentVNode("",!0),e.editable?(n.openBlock(),n.createBlock(a,{key:4,accept:e.accept,circular:e.circular,color:e.color,"direct-upload":!0,disabled:e.disabled,size:e.size,title:e.editButtonTitle,class:"neon-badge__upload",icon:"pencil","onUpdate:modelValue":o[0]||(o[0]=i=>e.emit("change-image",i))},null,8,["accept","circular","color","disabled","size","title"])):n.createCommentVNode("",!0)],2)}const g=s(r,[["render",b]]);module.exports=g;
|
|
2
2
|
//# sourceMappingURL=NeonBadge.vue.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonBadge.vue.cjs.js","sources":["../../../../src/components/presentation/badge/NeonBadge.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n `neon-badge--${color}`,\n alternateColor ? `neon-badge--alternate-color-${alternateColor}` : '',\n `neon-badge--${size}`,\n {\n 'neon-badge--with-label': label,\n 'neon-badge--disabled': disabled,\n 'neon-badge--with-image': image,\n 'neon-badge--with-icon': icon,\n },\n circular ? 'neon-badge--circular' : 'neon-badge--square',\n ]\"\n class=\"neon-badge\"\n >\n <div v-if=\"jazziconId\" class=\"neon-badge__image\" v-html=\"svg\" />\n <span v-else-if=\"label\" class=\"neon-badge__label\">{{ label }}</span>\n <img v-else-if=\"image\" :alt=\"imageAlt\" :src=\"image\" class=\"neon-badge__image\" />\n <neon-icon v-else-if=\"icon\" :disabled=\"disabled\" :inverse=\"!!color\" :name=\"icon\" class=\"neon-badge__icon\" />\n </div>\n</template>\n\n<script lang=\"ts\" src=\"./NeonBadge.ts\" />\n"],"names":["_createElementBlock","_normalizeClass","_ctx","_hoisted_2","_toDisplayString","_createBlock","_component_neon_icon"],"mappings":"
|
|
1
|
+
{"version":3,"file":"NeonBadge.vue.cjs.js","sources":["../../../../src/components/presentation/badge/NeonBadge.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n `neon-badge--${color}`,\n alternateColor ? `neon-badge--alternate-color-${alternateColor}` : '',\n `neon-badge--${size}`,\n {\n 'neon-badge--with-label': label,\n 'neon-badge--disabled': disabled,\n 'neon-badge--with-image': image,\n 'neon-badge--with-icon': icon,\n 'neon-badge--editable': editable,\n },\n circular ? 'neon-badge--circular' : 'neon-badge--square',\n ]\"\n class=\"neon-badge\"\n >\n <div v-if=\"jazziconId\" class=\"neon-badge__image\" v-html=\"svg\" />\n <span v-else-if=\"label\" class=\"neon-badge__label\">{{ label }}</span>\n <img v-else-if=\"image\" :alt=\"imageAlt\" :src=\"image\" class=\"neon-badge__image\" />\n <neon-icon v-else-if=\"icon\" :disabled=\"disabled\" :inverse=\"!!color\" :name=\"icon\" class=\"neon-badge__icon\" />\n <neon-file\n v-if=\"editable\"\n :accept=\"accept\"\n :circular=\"circular\"\n :color=\"color\"\n :direct-upload=\"true\"\n :disabled=\"disabled\"\n :size=\"size\"\n :title=\"editButtonTitle\"\n class=\"neon-badge__upload\"\n icon=\"pencil\"\n @update:modelValue=\"emit('change-image', $event)\"\n />\n </div>\n</template>\n\n<script lang=\"ts\" src=\"./NeonBadge.ts\" />\n"],"names":["_createElementBlock","_normalizeClass","_ctx","_hoisted_2","_toDisplayString","_createBlock","_component_neon_icon","_component_neon_file","_cache","$event"],"mappings":"6JAkB4B,MAAM,4JAjBhCA,EAAAA,mBAiCM,MAAA,CAhCH,MAAKC,EAAAA,eAAA,CAAA,gBAAyBC,EAAA,KAAK,GAAUA,EAAA,8CAAgDA,EAAA,cAAc,GAAA,kBAA8BA,EAAA,IAAI,6BAA8CA,EAAA,6BAAuCA,EAAA,kCAA4CA,EAAA,8BAAwCA,EAAA,4BAAsCA,EAAA,UAAyBA,EAAA,SAAQ,uBAAA,sBAaxX,YAAY,CAAA,IAEPA,EAAA,0BAAXF,EAAAA,mBAAgE,MAAA,OAAzC,MAAM,oBAAoB,UAAQE,EAAA,gBACxCA,EAAA,qBAAjBF,EAAAA,mBAAoE,OAApEG,EAAoEC,EAAAA,gBAAfF,EAAA,KAAK,EAAA,CAAA,GAC1CA,EAAA,qBAAhBF,EAAAA,mBAAgF,MAAA,OAAxD,IAAKE,EAAA,SAAW,IAAKA,EAAA,MAAO,MAAM,gCACpCA,EAAA,oBAAtBG,EAAAA,YAA4GC,EAAA,OAA/E,SAAUJ,EAAA,SAAW,UAAWA,EAAA,MAAQ,KAAMA,EAAA,KAAM,MAAM,uFAE/EA,EAAA,wBADRG,EAAAA,YAYEE,EAAA,OAVC,OAAQL,EAAA,OACR,SAAUA,EAAA,SACV,MAAOA,EAAA,MACP,gBAAe,GACf,SAAUA,EAAA,SACV,KAAMA,EAAA,KACN,MAAOA,EAAA,gBACR,MAAM,qBACN,KAAK,SACJ,sBAAiBM,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAEP,EAAA,KAAI,eAAiBO,CAAM"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { resolveComponent as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import b from "./NeonBadge.es.js";
|
|
2
|
+
import { resolveComponent as l, openBlock as n, createElementBlock as o, normalizeClass as c, toDisplayString as g, createBlock as i, createCommentVNode as d } from "vue";
|
|
3
|
+
import m from "../../../_virtual/_plugin-vue_export-helper.es.js";
|
|
4
|
+
const p = ["innerHTML"], u = {
|
|
5
5
|
key: 1,
|
|
6
6
|
class: "neon-badge__label"
|
|
7
|
-
},
|
|
8
|
-
function
|
|
9
|
-
const
|
|
7
|
+
}, f = ["alt", "src"];
|
|
8
|
+
function k(e, a, z, $, h, v) {
|
|
9
|
+
const r = l("neon-icon"), s = l("neon-file");
|
|
10
10
|
return n(), o("div", {
|
|
11
|
-
class:
|
|
11
|
+
class: c([[
|
|
12
12
|
`neon-badge--${e.color}`,
|
|
13
13
|
e.alternateColor ? `neon-badge--alternate-color-${e.alternateColor}` : "",
|
|
14
14
|
`neon-badge--${e.size}`,
|
|
@@ -16,7 +16,8 @@ function p(e, u, f, h, k, $) {
|
|
|
16
16
|
"neon-badge--with-label": e.label,
|
|
17
17
|
"neon-badge--disabled": e.disabled,
|
|
18
18
|
"neon-badge--with-image": e.image,
|
|
19
|
-
"neon-badge--with-icon": e.icon
|
|
19
|
+
"neon-badge--with-icon": e.icon,
|
|
20
|
+
"neon-badge--editable": e.editable
|
|
20
21
|
},
|
|
21
22
|
e.circular ? "neon-badge--circular" : "neon-badge--square"
|
|
22
23
|
], "neon-badge"])
|
|
@@ -25,22 +26,35 @@ function p(e, u, f, h, k, $) {
|
|
|
25
26
|
key: 0,
|
|
26
27
|
class: "neon-badge__image",
|
|
27
28
|
innerHTML: e.svg
|
|
28
|
-
}, null, 8,
|
|
29
|
+
}, null, 8, p)) : e.label ? (n(), o("span", u, g(e.label), 1)) : e.image ? (n(), o("img", {
|
|
29
30
|
key: 2,
|
|
30
31
|
alt: e.imageAlt,
|
|
31
32
|
src: e.image,
|
|
32
33
|
class: "neon-badge__image"
|
|
33
|
-
}, null, 8,
|
|
34
|
+
}, null, 8, f)) : e.icon ? (n(), i(r, {
|
|
34
35
|
key: 3,
|
|
35
36
|
disabled: e.disabled,
|
|
36
37
|
inverse: !!e.color,
|
|
37
38
|
name: e.icon,
|
|
38
39
|
class: "neon-badge__icon"
|
|
39
|
-
}, null, 8, ["disabled", "inverse", "name"])) :
|
|
40
|
+
}, null, 8, ["disabled", "inverse", "name"])) : d("", !0),
|
|
41
|
+
e.editable ? (n(), i(s, {
|
|
42
|
+
key: 4,
|
|
43
|
+
accept: e.accept,
|
|
44
|
+
circular: e.circular,
|
|
45
|
+
color: e.color,
|
|
46
|
+
"direct-upload": !0,
|
|
47
|
+
disabled: e.disabled,
|
|
48
|
+
size: e.size,
|
|
49
|
+
title: e.editButtonTitle,
|
|
50
|
+
class: "neon-badge__upload",
|
|
51
|
+
icon: "pencil",
|
|
52
|
+
"onUpdate:modelValue": a[0] || (a[0] = (t) => e.emit("change-image", t))
|
|
53
|
+
}, null, 8, ["accept", "circular", "color", "disabled", "size", "title"])) : d("", !0)
|
|
40
54
|
], 2);
|
|
41
55
|
}
|
|
42
|
-
const
|
|
56
|
+
const w = /* @__PURE__ */ m(b, [["render", k]]);
|
|
43
57
|
export {
|
|
44
|
-
|
|
58
|
+
w as default
|
|
45
59
|
};
|
|
46
60
|
//# sourceMappingURL=NeonBadge.vue.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonBadge.vue.es.js","sources":["../../../../src/components/presentation/badge/NeonBadge.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n `neon-badge--${color}`,\n alternateColor ? `neon-badge--alternate-color-${alternateColor}` : '',\n `neon-badge--${size}`,\n {\n 'neon-badge--with-label': label,\n 'neon-badge--disabled': disabled,\n 'neon-badge--with-image': image,\n 'neon-badge--with-icon': icon,\n },\n circular ? 'neon-badge--circular' : 'neon-badge--square',\n ]\"\n class=\"neon-badge\"\n >\n <div v-if=\"jazziconId\" class=\"neon-badge__image\" v-html=\"svg\" />\n <span v-else-if=\"label\" class=\"neon-badge__label\">{{ label }}</span>\n <img v-else-if=\"image\" :alt=\"imageAlt\" :src=\"image\" class=\"neon-badge__image\" />\n <neon-icon v-else-if=\"icon\" :disabled=\"disabled\" :inverse=\"!!color\" :name=\"icon\" class=\"neon-badge__icon\" />\n </div>\n</template>\n\n<script lang=\"ts\" src=\"./NeonBadge.ts\" />\n"],"names":["_createElementBlock","_normalizeClass","_ctx","_hoisted_2","_toDisplayString","_createBlock","_component_neon_icon"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"NeonBadge.vue.es.js","sources":["../../../../src/components/presentation/badge/NeonBadge.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n `neon-badge--${color}`,\n alternateColor ? `neon-badge--alternate-color-${alternateColor}` : '',\n `neon-badge--${size}`,\n {\n 'neon-badge--with-label': label,\n 'neon-badge--disabled': disabled,\n 'neon-badge--with-image': image,\n 'neon-badge--with-icon': icon,\n 'neon-badge--editable': editable,\n },\n circular ? 'neon-badge--circular' : 'neon-badge--square',\n ]\"\n class=\"neon-badge\"\n >\n <div v-if=\"jazziconId\" class=\"neon-badge__image\" v-html=\"svg\" />\n <span v-else-if=\"label\" class=\"neon-badge__label\">{{ label }}</span>\n <img v-else-if=\"image\" :alt=\"imageAlt\" :src=\"image\" class=\"neon-badge__image\" />\n <neon-icon v-else-if=\"icon\" :disabled=\"disabled\" :inverse=\"!!color\" :name=\"icon\" class=\"neon-badge__icon\" />\n <neon-file\n v-if=\"editable\"\n :accept=\"accept\"\n :circular=\"circular\"\n :color=\"color\"\n :direct-upload=\"true\"\n :disabled=\"disabled\"\n :size=\"size\"\n :title=\"editButtonTitle\"\n class=\"neon-badge__upload\"\n icon=\"pencil\"\n @update:modelValue=\"emit('change-image', $event)\"\n />\n </div>\n</template>\n\n<script lang=\"ts\" src=\"./NeonBadge.ts\" />\n"],"names":["_createElementBlock","_normalizeClass","_ctx","_hoisted_2","_toDisplayString","_createBlock","_component_neon_icon","_component_neon_file","_cache","$event"],"mappings":";;;;;EAkB4B,OAAM;;;;cAjBhCA,EAiCM,OAAA;AAAA,IAhCH,OAAKC,EAAA,CAAA;AAAA,qBAAyBC,EAAA,KAAK;AAAA,MAAUA,EAAA,gDAAgDA,EAAA,cAAc,KAAA;AAAA,qBAA8BA,EAAA,IAAI;AAAA;kCAA8CA,EAAA;AAAA,gCAAuCA,EAAA;AAAA,kCAA4CA,EAAA;AAAA,iCAAwCA,EAAA;AAAA,gCAAsCA,EAAA;AAAA;MAAyBA,EAAA,WAAQ,yBAAA;AAAA,OAaxX,YAAY,CAAA;AAAA;IAEPA,EAAA,mBAAXF,EAAgE,OAAA;AAAA;MAAzC,OAAM;AAAA,MAAoB,WAAQE,EAAA;AAAA,sBACxCA,EAAA,cAAjBF,EAAoE,QAApEG,GAAoEC,EAAfF,EAAA,KAAK,GAAA,CAAA,KAC1CA,EAAA,cAAhBF,EAAgF,OAAA;AAAA;MAAxD,KAAKE,EAAA;AAAA,MAAW,KAAKA,EAAA;AAAA,MAAO,OAAM;AAAA,sBACpCA,EAAA,aAAtBG,EAA4GC,GAAA;AAAA;MAA/E,UAAUJ,EAAA;AAAA,MAAW,WAAWA,EAAA;AAAA,MAAQ,MAAMA,EAAA;AAAA,MAAM,OAAM;AAAA;IAE/EA,EAAA,iBADRG,EAYEE,GAAA;AAAA;MAVC,QAAQL,EAAA;AAAA,MACR,UAAUA,EAAA;AAAA,MACV,OAAOA,EAAA;AAAA,MACP,iBAAe;AAAA,MACf,UAAUA,EAAA;AAAA,MACV,MAAMA,EAAA;AAAA,MACN,OAAOA,EAAA;AAAA,MACR,OAAM;AAAA,MACN,MAAK;AAAA,MACJ,uBAAiBM,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAEP,EAAA,KAAI,gBAAiBO,CAAM;AAAA;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const t=require("vue"),L=require("../../navigation/link/NeonLink.vue.cjs.js"),y=require("../../user-input/button/NeonButton.vue.cjs.js"),I=require("../../layout/stack/NeonStack.vue.cjs.js"),q=t.defineComponent({name:"NeonImageCarousel",components:{NeonButton:y,NeonLink:L,NeonStack:I},props:{images:{type:Array,required:!0},imageCountLabel:{type:String,default:void 0},hideLabel:{type:Boolean,default:!1},closeLabel:{type:String,default:"Close"},previousLabel:{type:String,default:"Previous"},nextLabel:{type:String,default:"Next"}},emits:["current-image"],setup(l,{emit:r}){const s=t.ref(!1),n=t.ref(0),o=t.ref(null),u=t.ref([]),c=t.ref([]),i=t.ref(!1),v=e=>{e!==n.value&&(n.value=e,r("current-image",e))},a=e=>{o.value&&l.images.length>0&&(v(e),o.value.scrollTo(o.value.clientWidth*e,0))},m=()=>{n.value<l.images.length-1&&a(n.value+1)},d=()=>{n.value!==0&&a(n.value-1)};return t.onMounted(()=>{const e={root:o.value,rootMargin:"0px",threshold:.6};c.value=u.value.map((g,p)=>{const f=new IntersectionObserver(b=>{b.forEach(h=>{s.value&&h.isIntersecting&&v(p)})},e);return f.observe(g),f}),setTimeout(()=>{o.value&&o.value.scrollLeft!==0&&(o.value.scrollLeft=0),s.value=!0},50)}),t.onUnmounted(()=>{c.value.forEach(e=>e.disconnect())}),t.watch(()=>i.value,e=>{e?document.body.classList.add("neon-closable--open"):document.body.classList.remove("neon-closable--open")}),{emit:r,currentImage:n,carouselItem:u,carouselItems:o,initialised:s,expanded:i,next:m,previous:d,scrollTo:a}}});module.exports=q;
|
|
2
2
|
//# sourceMappingURL=NeonImageCarousel.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonImageCarousel.cjs.js","sources":["../../../../src/components/presentation/image-carousel/NeonImageCarousel.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent, onMounted, onUnmounted, ref } from 'vue';\nimport type { NeonCarouselImage } from '@/common/models/NeonCarouselImage';\nimport NeonLink from '@/components/navigation/link/NeonLink.vue';\nimport NeonButton from '@/components/user-input/button/NeonButton.vue';\n\n/**\n * <p>\n * The <strong>NeonImageCarousel</strong> is used to display a carousel of images for the user to swipe\n * through. NOTE: It is recommended to explicitly set the width & height of the carousel via CSS, this will\n * ensure it will not be impacted by images with different aspect ratios. Images are automatically resized to fit the\n * carousel dimensions.\n * </p>\n */\nexport default defineComponent({\n name: 'NeonImageCarousel',\n components: {\n NeonButton,\n NeonLink,\n },\n props: {\n /**\n * The images to be displayed in the carousel.\n */\n images: { type: Array as () => Array<NeonCarouselImage>, required: true },\n /**\n * Provide an alternative image count label. This can be useful for translations. The default is e.g.\n * <em>2 images</em>.\n */\n imageCountLabel: { type: String, default: undefined },\n /**\n * Hide the label under the dot navigation.\n */\n hideLabel: { type: Boolean, default: false },\n /**\n * Provide an alternative label for the Previous button.\n */\n previousLabel: { type: String, default: 'Previous' },\n /**\n * Provide an alternative label for the Next button.\n */\n nextLabel: { type: String, default: 'Next' },\n },\n emits: [\n /**\n * The index of the currently visible image.\n *\n * @type {number}\n */\n 'current-image',\n ],\n setup(props, { emit }) {\n const initialised = ref<boolean>(false);\n const currentImage = ref<number>(0);\n const carouselItems = ref<HTMLUListElement | null>(null);\n const carouselItem = ref<Array<HTMLLIElement>>([]);\n const observers = ref<Array<IntersectionObserver>>([]);\n\n const changeImage = (index: number) => {\n if (index !== currentImage.value) {\n currentImage.value = index;\n emit('current-image', index);\n }\n };\n\n const scrollTo = (index: number) => {\n if (carouselItems.value && props.images.length > 0) {\n changeImage(index);\n carouselItems.value.scrollTo(carouselItems.value.clientWidth * index, 0);\n }\n };\n\n const next = () => {\n if (currentImage.value < props.images.length - 1) {\n scrollTo(currentImage.value + 1);\n }\n };\n\n const previous = () => {\n if (currentImage.value !== 0) {\n scrollTo(currentImage.value - 1);\n }\n };\n\n onMounted(() => {\n const options = {\n root: carouselItems.value,\n rootMargin: '0px',\n threshold: 0.6,\n };\n\n observers.value = carouselItem.value.map((el, index) => {\n const obs = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n // filter out the observations on initialization\n if (initialised.value && entry.isIntersecting) {\n changeImage(index);\n }\n });\n }, options);\n obs.observe(el);\n\n return obs;\n });\n\n setTimeout(() => {\n // initialise scroll position to first element\n if (carouselItems.value && carouselItems.value.scrollLeft !== 0) {\n carouselItems.value.scrollLeft = 0;\n }\n initialised.value = true;\n }, 50);\n });\n\n onUnmounted(() => {\n observers.value.forEach((observer) => observer.disconnect());\n });\n\n return {\n emit,\n currentImage,\n carouselItem,\n carouselItems,\n initialised,\n next,\n previous,\n scrollTo,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonButton","NeonLink","props","emit","initialised","ref","currentImage","carouselItems","carouselItem","observers","changeImage","index","scrollTo","next","previous","onMounted","options","el","obs","entries","entry","onUnmounted","observer"],"mappings":"
|
|
1
|
+
{"version":3,"file":"NeonImageCarousel.cjs.js","sources":["../../../../src/components/presentation/image-carousel/NeonImageCarousel.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent, onMounted, onUnmounted, ref, watch } from 'vue';\nimport type { NeonCarouselImage } from '@/common/models/NeonCarouselImage';\nimport NeonLink from '@/components/navigation/link/NeonLink.vue';\nimport NeonButton from '@/components/user-input/button/NeonButton.vue';\nimport NeonStack from '@/components/layout/stack/NeonStack.vue';\n\n/**\n * <p>\n * The <strong>NeonImageCarousel</strong> is used to display a carousel of images for the user to swipe\n * through. NOTE: It is recommended to explicitly set the width & height of the carousel via CSS, this will\n * ensure it will not be impacted by images with different aspect ratios. Images are automatically resized to fit the\n * carousel dimensions.\n * </p>\n */\nexport default defineComponent({\n name: 'NeonImageCarousel',\n components: {\n NeonButton,\n NeonLink,\n NeonStack,\n },\n props: {\n /**\n * The images to be displayed in the carousel.\n */\n images: { type: Array as () => Array<NeonCarouselImage>, required: true },\n /**\n * Provide an alternative image count label. This can be useful for translations. The default is e.g.\n * <em>2 images</em>.\n */\n imageCountLabel: { type: String, default: undefined },\n /**\n * Hide the label under the dot navigation.\n */\n hideLabel: { type: Boolean, default: false },\n /**\n * Provide an alternative label for the Previous button.\n */\n closeLabel: { type: String, default: 'Close' },\n /**\n * Provide an alternative label for the Previous button.\n */\n previousLabel: { type: String, default: 'Previous' },\n /**\n * Provide an alternative label for the Next button.\n */\n nextLabel: { type: String, default: 'Next' },\n },\n emits: [\n /**\n * The index of the currently visible image.\n *\n * @type {number}\n */\n 'current-image',\n ],\n setup(props, { emit }) {\n const initialised = ref<boolean>(false);\n const currentImage = ref<number>(0);\n const carouselItems = ref<HTMLUListElement | null>(null);\n const carouselItem = ref<Array<HTMLLIElement>>([]);\n const observers = ref<Array<IntersectionObserver>>([]);\n const expanded = ref<boolean>(false);\n\n const changeImage = (index: number) => {\n if (index !== currentImage.value) {\n currentImage.value = index;\n emit('current-image', index);\n }\n };\n\n const scrollTo = (index: number) => {\n if (carouselItems.value && props.images.length > 0) {\n changeImage(index);\n carouselItems.value.scrollTo(carouselItems.value.clientWidth * index, 0);\n }\n };\n\n const next = () => {\n if (currentImage.value < props.images.length - 1) {\n scrollTo(currentImage.value + 1);\n }\n };\n\n const previous = () => {\n if (currentImage.value !== 0) {\n scrollTo(currentImage.value - 1);\n }\n };\n\n onMounted(() => {\n const options = {\n root: carouselItems.value,\n rootMargin: '0px',\n threshold: 0.6,\n };\n\n observers.value = carouselItem.value.map((el, index) => {\n const obs = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n // filter out the observations on initialization\n if (initialised.value && entry.isIntersecting) {\n changeImage(index);\n }\n });\n }, options);\n obs.observe(el);\n\n return obs;\n });\n\n setTimeout(() => {\n // initialise scroll position to first element\n if (carouselItems.value && carouselItems.value.scrollLeft !== 0) {\n carouselItems.value.scrollLeft = 0;\n }\n initialised.value = true;\n }, 50);\n });\n\n onUnmounted(() => {\n observers.value.forEach((observer) => observer.disconnect());\n });\n\n watch(\n () => expanded.value,\n (value: boolean) => {\n if (value) {\n document.body.classList.add('neon-closable--open');\n } else {\n document.body.classList.remove('neon-closable--open');\n }\n },\n );\n\n return {\n emit,\n currentImage,\n carouselItem,\n carouselItems,\n initialised,\n expanded,\n next,\n previous,\n scrollTo,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonButton","NeonLink","NeonStack","props","emit","initialised","ref","currentImage","carouselItems","carouselItem","observers","expanded","changeImage","index","scrollTo","next","previous","onMounted","options","el","obs","entries","entry","onUnmounted","observer","watch","value"],"mappings":"2MAcAA,EAAeC,kBAAgB,CAC7B,KAAM,oBACN,WAAY,CACV,WAAAC,EACA,SAAAC,EACA,UAAAC,CAAA,EAEF,MAAO,CAIL,OAAQ,CAAE,KAAM,MAAyC,SAAU,EAAA,EAKnE,gBAAiB,CAAE,KAAM,OAAQ,QAAS,MAAA,EAI1C,UAAW,CAAE,KAAM,QAAS,QAAS,EAAA,EAIrC,WAAY,CAAE,KAAM,OAAQ,QAAS,OAAA,EAIrC,cAAe,CAAE,KAAM,OAAQ,QAAS,UAAA,EAIxC,UAAW,CAAE,KAAM,OAAQ,QAAS,MAAA,CAAO,EAE7C,MAAO,CAML,eAAA,EAEF,MAAMC,EAAO,CAAE,KAAAC,GAAQ,CACrB,MAAMC,EAAcC,EAAAA,IAAa,EAAK,EAChCC,EAAeD,EAAAA,IAAY,CAAC,EAC5BE,EAAgBF,EAAAA,IAA6B,IAAI,EACjDG,EAAeH,EAAAA,IAA0B,EAAE,EAC3CI,EAAYJ,EAAAA,IAAiC,EAAE,EAC/CK,EAAWL,EAAAA,IA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I,EACA,SAAAC,EACA,SAAAF,CAAA,CAEJ,CACF,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { defineComponent as L, ref as n, onMounted as y, onUnmounted as I, watch as N } from "vue";
|
|
2
|
+
import S from "../../navigation/link/NeonLink.vue.es.js";
|
|
3
|
+
import C from "../../user-input/button/NeonButton.vue.es.js";
|
|
4
|
+
import x from "../../layout/stack/NeonStack.vue.es.js";
|
|
5
|
+
const E = L({
|
|
5
6
|
name: "NeonImageCarousel",
|
|
6
7
|
components: {
|
|
7
|
-
NeonButton:
|
|
8
|
-
NeonLink:
|
|
8
|
+
NeonButton: C,
|
|
9
|
+
NeonLink: S,
|
|
10
|
+
NeonStack: x
|
|
9
11
|
},
|
|
10
12
|
props: {
|
|
11
13
|
/**
|
|
@@ -21,6 +23,10 @@ const x = b({
|
|
|
21
23
|
* Hide the label under the dot navigation.
|
|
22
24
|
*/
|
|
23
25
|
hideLabel: { type: Boolean, default: !1 },
|
|
26
|
+
/**
|
|
27
|
+
* Provide an alternative label for the Previous button.
|
|
28
|
+
*/
|
|
29
|
+
closeLabel: { type: String, default: "Close" },
|
|
24
30
|
/**
|
|
25
31
|
* Provide an alternative label for the Previous button.
|
|
26
32
|
*/
|
|
@@ -38,47 +44,53 @@ const x = b({
|
|
|
38
44
|
*/
|
|
39
45
|
"current-image"
|
|
40
46
|
],
|
|
41
|
-
setup(
|
|
42
|
-
const a = n(!1),
|
|
43
|
-
e !==
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
|
|
47
|
+
setup(s, { emit: r }) {
|
|
48
|
+
const a = n(!1), t = n(0), o = n(null), u = n([]), i = n([]), c = n(!1), m = (e) => {
|
|
49
|
+
e !== t.value && (t.value = e, r("current-image", e));
|
|
50
|
+
}, l = (e) => {
|
|
51
|
+
o.value && s.images.length > 0 && (m(e), o.value.scrollTo(o.value.clientWidth * e, 0));
|
|
52
|
+
}, v = () => {
|
|
53
|
+
t.value < s.images.length - 1 && l(t.value + 1);
|
|
54
|
+
}, p = () => {
|
|
55
|
+
t.value !== 0 && l(t.value - 1);
|
|
50
56
|
};
|
|
51
|
-
return
|
|
57
|
+
return y(() => {
|
|
52
58
|
const e = {
|
|
53
|
-
root:
|
|
59
|
+
root: o.value,
|
|
54
60
|
rootMargin: "0px",
|
|
55
61
|
threshold: 0.6
|
|
56
62
|
};
|
|
57
|
-
i.value = u.value.map((
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
a.value && h.isIntersecting &&
|
|
63
|
+
i.value = u.value.map((d, g) => {
|
|
64
|
+
const f = new IntersectionObserver((b) => {
|
|
65
|
+
b.forEach((h) => {
|
|
66
|
+
a.value && h.isIntersecting && m(g);
|
|
61
67
|
});
|
|
62
68
|
}, e);
|
|
63
|
-
return
|
|
69
|
+
return f.observe(d), f;
|
|
64
70
|
}), setTimeout(() => {
|
|
65
|
-
|
|
71
|
+
o.value && o.value.scrollLeft !== 0 && (o.value.scrollLeft = 0), a.value = !0;
|
|
66
72
|
}, 50);
|
|
67
|
-
}),
|
|
73
|
+
}), I(() => {
|
|
68
74
|
i.value.forEach((e) => e.disconnect());
|
|
69
|
-
}),
|
|
70
|
-
|
|
71
|
-
|
|
75
|
+
}), N(
|
|
76
|
+
() => c.value,
|
|
77
|
+
(e) => {
|
|
78
|
+
e ? document.body.classList.add("neon-closable--open") : document.body.classList.remove("neon-closable--open");
|
|
79
|
+
}
|
|
80
|
+
), {
|
|
81
|
+
emit: r,
|
|
82
|
+
currentImage: t,
|
|
72
83
|
carouselItem: u,
|
|
73
|
-
carouselItems:
|
|
84
|
+
carouselItems: o,
|
|
74
85
|
initialised: a,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
86
|
+
expanded: c,
|
|
87
|
+
next: v,
|
|
88
|
+
previous: p,
|
|
89
|
+
scrollTo: l
|
|
78
90
|
};
|
|
79
91
|
}
|
|
80
92
|
});
|
|
81
93
|
export {
|
|
82
|
-
|
|
94
|
+
E as default
|
|
83
95
|
};
|
|
84
96
|
//# sourceMappingURL=NeonImageCarousel.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonImageCarousel.es.js","sources":["../../../../src/components/presentation/image-carousel/NeonImageCarousel.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent, onMounted, onUnmounted, ref } from 'vue';\nimport type { NeonCarouselImage } from '@/common/models/NeonCarouselImage';\nimport NeonLink from '@/components/navigation/link/NeonLink.vue';\nimport NeonButton from '@/components/user-input/button/NeonButton.vue';\n\n/**\n * <p>\n * The <strong>NeonImageCarousel</strong> is used to display a carousel of images for the user to swipe\n * through. NOTE: It is recommended to explicitly set the width & height of the carousel via CSS, this will\n * ensure it will not be impacted by images with different aspect ratios. Images are automatically resized to fit the\n * carousel dimensions.\n * </p>\n */\nexport default defineComponent({\n name: 'NeonImageCarousel',\n components: {\n NeonButton,\n NeonLink,\n },\n props: {\n /**\n * The images to be displayed in the carousel.\n */\n images: { type: Array as () => Array<NeonCarouselImage>, required: true },\n /**\n * Provide an alternative image count label. This can be useful for translations. The default is e.g.\n * <em>2 images</em>.\n */\n imageCountLabel: { type: String, default: undefined },\n /**\n * Hide the label under the dot navigation.\n */\n hideLabel: { type: Boolean, default: false },\n /**\n * Provide an alternative label for the Previous button.\n */\n previousLabel: { type: String, default: 'Previous' },\n /**\n * Provide an alternative label for the Next button.\n */\n nextLabel: { type: String, default: 'Next' },\n },\n emits: [\n /**\n * The index of the currently visible image.\n *\n * @type {number}\n */\n 'current-image',\n ],\n setup(props, { emit }) {\n const initialised = ref<boolean>(false);\n const currentImage = ref<number>(0);\n const carouselItems = ref<HTMLUListElement | null>(null);\n const carouselItem = ref<Array<HTMLLIElement>>([]);\n const observers = ref<Array<IntersectionObserver>>([]);\n\n const changeImage = (index: number) => {\n if (index !== currentImage.value) {\n currentImage.value = index;\n emit('current-image', index);\n }\n };\n\n const scrollTo = (index: number) => {\n if (carouselItems.value && props.images.length > 0) {\n changeImage(index);\n carouselItems.value.scrollTo(carouselItems.value.clientWidth * index, 0);\n }\n };\n\n const next = () => {\n if (currentImage.value < props.images.length - 1) {\n scrollTo(currentImage.value + 1);\n }\n };\n\n const previous = () => {\n if (currentImage.value !== 0) {\n scrollTo(currentImage.value - 1);\n }\n };\n\n onMounted(() => {\n const options = {\n root: carouselItems.value,\n rootMargin: '0px',\n threshold: 0.6,\n };\n\n observers.value = carouselItem.value.map((el, index) => {\n const obs = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n // filter out the observations on initialization\n if (initialised.value && entry.isIntersecting) {\n changeImage(index);\n }\n });\n }, options);\n obs.observe(el);\n\n return obs;\n });\n\n setTimeout(() => {\n // initialise scroll position to first element\n if (carouselItems.value && carouselItems.value.scrollLeft !== 0) {\n carouselItems.value.scrollLeft = 0;\n }\n initialised.value = true;\n }, 50);\n });\n\n onUnmounted(() => {\n observers.value.forEach((observer) => observer.disconnect());\n });\n\n return {\n emit,\n currentImage,\n carouselItem,\n carouselItems,\n initialised,\n next,\n previous,\n scrollTo,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonButton","NeonLink","props","emit","initialised","ref","currentImage","carouselItems","carouselItem","observers","changeImage","index","scrollTo","next","previous","onMounted","options","el","obs","entries","entry","onUnmounted","observer"],"mappings":"
|
|
1
|
+
{"version":3,"file":"NeonImageCarousel.es.js","sources":["../../../../src/components/presentation/image-carousel/NeonImageCarousel.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent, onMounted, onUnmounted, ref, watch } from 'vue';\nimport type { NeonCarouselImage } from '@/common/models/NeonCarouselImage';\nimport NeonLink from '@/components/navigation/link/NeonLink.vue';\nimport NeonButton from '@/components/user-input/button/NeonButton.vue';\nimport NeonStack from '@/components/layout/stack/NeonStack.vue';\n\n/**\n * <p>\n * The <strong>NeonImageCarousel</strong> is used to display a carousel of images for the user to swipe\n * through. NOTE: It is recommended to explicitly set the width & height of the carousel via CSS, this will\n * ensure it will not be impacted by images with different aspect ratios. Images are automatically resized to fit the\n * carousel dimensions.\n * </p>\n */\nexport default defineComponent({\n name: 'NeonImageCarousel',\n components: {\n NeonButton,\n NeonLink,\n NeonStack,\n },\n props: {\n /**\n * The images to be displayed in the carousel.\n */\n images: { type: Array as () => Array<NeonCarouselImage>, required: true },\n /**\n * Provide an alternative image count label. This can be useful for translations. The default is e.g.\n * <em>2 images</em>.\n */\n imageCountLabel: { type: String, default: undefined },\n /**\n * Hide the label under the dot navigation.\n */\n hideLabel: { type: Boolean, default: false },\n /**\n * Provide an alternative label for the Previous button.\n */\n closeLabel: { type: String, default: 'Close' },\n /**\n * Provide an alternative label for the Previous button.\n */\n previousLabel: { type: String, default: 'Previous' },\n /**\n * Provide an alternative label for the Next button.\n */\n nextLabel: { type: String, default: 'Next' },\n },\n emits: [\n /**\n * The index of the currently visible image.\n *\n * @type {number}\n */\n 'current-image',\n ],\n setup(props, { emit }) {\n const initialised = ref<boolean>(false);\n const currentImage = ref<number>(0);\n const carouselItems = ref<HTMLUListElement | null>(null);\n const carouselItem = ref<Array<HTMLLIElement>>([]);\n const observers = ref<Array<IntersectionObserver>>([]);\n const expanded = ref<boolean>(false);\n\n const changeImage = (index: number) => {\n if (index !== currentImage.value) {\n currentImage.value = index;\n emit('current-image', index);\n }\n };\n\n const scrollTo = (index: number) => {\n if (carouselItems.value && props.images.length > 0) {\n changeImage(index);\n carouselItems.value.scrollTo(carouselItems.value.clientWidth * index, 0);\n }\n };\n\n const next = () => {\n if (currentImage.value < props.images.length - 1) {\n scrollTo(currentImage.value + 1);\n }\n };\n\n const previous = () => {\n if (currentImage.value !== 0) {\n scrollTo(currentImage.value - 1);\n }\n };\n\n onMounted(() => {\n const options = {\n root: carouselItems.value,\n rootMargin: '0px',\n threshold: 0.6,\n };\n\n observers.value = carouselItem.value.map((el, index) => {\n const obs = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n // filter out the observations on initialization\n if (initialised.value && entry.isIntersecting) {\n changeImage(index);\n }\n });\n }, options);\n obs.observe(el);\n\n return obs;\n });\n\n setTimeout(() => {\n // initialise scroll position to first element\n if (carouselItems.value && carouselItems.value.scrollLeft !== 0) {\n carouselItems.value.scrollLeft = 0;\n }\n initialised.value = true;\n }, 50);\n });\n\n onUnmounted(() => {\n observers.value.forEach((observer) => observer.disconnect());\n });\n\n watch(\n () => expanded.value,\n (value: boolean) => {\n if (value) {\n document.body.classList.add('neon-closable--open');\n } else {\n document.body.classList.remove('neon-closable--open');\n }\n },\n );\n\n return {\n emit,\n currentImage,\n carouselItem,\n carouselItems,\n initialised,\n expanded,\n next,\n previous,\n scrollTo,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonButton","NeonLink","NeonStack","props","emit","initialised","ref","currentImage","carouselItems","carouselItem","observers","expanded","changeImage","index","scrollTo","next","previous","onMounted","options","el","obs","entries","entry","onUnmounted","observer","watch","value"],"mappings":";;;;AAcA,MAAAA,IAAeC,EAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,IACV,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,EAAA;AAAA,EAEF,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,QAAQ,EAAE,MAAM,OAAyC,UAAU,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKnE,iBAAiB,EAAE,MAAM,QAAQ,SAAS,OAAA;AAAA;AAAA;AAAA;AAAA,IAI1C,WAAW,EAAE,MAAM,SAAS,SAAS,GAAA;AAAA;AAAA;AAAA;AAAA,IAIrC,YAAY,EAAE,MAAM,QAAQ,SAAS,QAAA;AAAA;AAAA;AAAA;AAAA,IAIrC,eAAe,EAAE,MAAM,QAAQ,SAAS,WAAA;AAAA;AAAA;AAAA;AAAA,IAIxC,WAAW,EAAE,MAAM,QAAQ,SAAS,OAAA;AAAA,EAAO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ASA,EAAc,MAAM,eAAe,MAC5DA,EAAc,MAAM,aAAa,IAEnCH,EAAY,QAAQ;AAAA,MACtB,GAAG,EAAE;AAAA,IACP,CAAC,GAEDkB,EAAY,MAAM;AAChB,MAAAb,EAAU,MAAM,QAAQ,CAACc,MAAaA,EAAS,YAAY;AAAA,IAC7D,CAAC,GAEDC;AAAA,MACE,MAAMd,EAAS;AAAA,MACf,CAACe,MAAmB;AAClB,QAAIA,IACF,SAAS,KAAK,UAAU,IAAI,qBAAqB,IAEjD,SAAS,KAAK,UAAU,OAAO,qBAAqB;AAAA,MAExD;AAAA,IAAA,GAGK;AAAA,MACL,MAAAtB;AAAA,MACA,cAAAG;AAAA,MACA,cAAAE;AAAA,MACA,eAAAD;AAAA,MACA,aAAAH;AAAA,MACA,UAAAM;AAAA,MACA,MAAAI;AAAA,MACA,UAAAC;AAAA,MACA,UAAAF;AAAA,IAAA;AAAA,EAEJ;AACF,CAAC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const u=require("./NeonImageCarousel.cjs.js"),e=require("vue"),d=require("../../../_virtual/_plugin-vue_export-helper.cjs.js"),c={class:"neon-image-carousel-wrapper"},m={ref:"carouselItems",class:"no-style neon-image-carousel__items"},p=["alt","src"],g={key:0,class:"neon-image-carousel__item-title"},k={class:"neon-image-carousel__nav",tabindex:"-1"},v=["onClickCapture"],C={key:0,class:"neon-image-carousel__label",tabindex:"-1"};function b(n,o,w,_,y,B){const s=e.resolveComponent("neon-button"),r=e.resolveComponent("neon-link"),i=e.resolveComponent("neon-stack");return e.openBlock(),e.createElementBlock("div",c,[e.createElementVNode("div",{class:e.normalizeClass([{"neon-image-carousel--initialised":n.initialised,"neon-image-carousel--expanded":n.expanded},"neon-image-carousel"]),tabindex:"0",onKeydown:[o[4]||(o[4]=e.withKeys(e.withModifiers((...t)=>n.previous&&n.previous(...t),["stop","prevent"]),["left"])),o[5]||(o[5]=e.withKeys(e.withModifiers((...t)=>n.next&&n.next(...t),["stop","prevent"]),["right"])),o[6]||(o[6]=e.withKeys(t=>n.expanded=!1,["esc"]))]},[e.createElementVNode("div",{class:"neon-image-carousel__container",tabindex:"-1",onClick:o[2]||(o[2]=e.withModifiers(t=>n.expanded=!1,["stop"]))},[n.expanded?(e.openBlock(),e.createBlock(s,{key:0,title:n.closeLabel,"button-style":"text",class:"neon-image-carousel__close",color:"low-contrast",icon:"close",size:"l",transparent:"",onClick:o[0]||(o[0]=t=>n.expanded=!1)},null,8,["title"])):e.createCommentVNode("",!0),e.createVNode(s,{disabled:n.currentImage===0,title:n.previousLabel,transparent:!0,"button-style":"text",class:"neon-image-carousel__previous",color:"neutral",icon:"arrow-left-1",size:"l",onClickCapture:e.withModifiers(n.previous,["stop"])},null,8,["disabled","title","onClickCapture"]),e.createElementVNode("ul",m,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.images,(t,l)=>(e.openBlock(),e.createElementBlock("li",{key:t.src,ref_for:!0,ref:"carouselItem",class:e.normalizeClass([{"neon-image-carousel__item--active":l===n.currentImage},"neon-image-carousel__item"])},[e.createElementVNode("img",{alt:t.alt,src:t.src,class:"neon-image-carousel__image",onClick:o[1]||(o[1]=e.withModifiers(a=>n.expanded=!n.expanded,["stop"]))},null,8,p),n.expanded?(e.openBlock(),e.createElementBlock("p",g,e.toDisplayString(t.alt),1)):e.createCommentVNode("",!0)],2))),128))],512),e.createVNode(s,{disabled:n.currentImage===n.images.length-1,title:n.nextLabel,transparent:!0,"button-style":"text",class:"neon-image-carousel__next",color:"neutral",icon:"arrow-right-1",size:"l",onClickCapture:e.withModifiers(n.next,["stop"])},null,8,["disabled","title","onClickCapture"])]),e.createVNode(i,{class:"neon-image-carousel__nav-container",gap:"s",onClick:o[3]||(o[3]=e.withModifiers(t=>n.expanded=!1,["stop"]))},{default:e.withCtx(()=>[e.createElementVNode("div",k,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.images,(t,l)=>(e.openBlock(),e.createBlock(r,{key:l,"aria-label":`Display image ${l+1}`,class:"neon-image-carousel__nav-item-link","outline-style":"none",role:"button",tabindex:"0",onKeydownCapture:[e.withKeys(e.withModifiers(a=>n.scrollTo(l),["stop","prevent"]),["enter"]),e.withKeys(e.withModifiers(a=>n.scrollTo(l),["stop","prevent"]),["space"])]},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass([{"neon-image-carousel__nav-item--active":l===n.currentImage},"neon-image-carousel__nav-item"]),tabindex:"-1",onClickCapture:e.withModifiers(a=>n.scrollTo(l),["stop"])},[...o[7]||(o[7]=[e.createElementVNode("div",{class:"neon-image-carousel__nav-item-indicator"},null,-1)])],42,v)]),_:2},1032,["aria-label","onKeydownCapture"]))),128))]),n.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",C,e.toDisplayString(n.imageCountLabel||`${n.images.length} ${n.images.length===1?"image":"images"}`),1))]),_:1})],34)])}const f=d(u,[["render",b]]);module.exports=f;
|
|
2
2
|
//# sourceMappingURL=NeonImageCarousel.vue.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonImageCarousel.vue.cjs.js","sources":["../../../../src/components/presentation/image-carousel/NeonImageCarousel.vue"],"sourcesContent":["<template>\n <div\n :class=\"{
|
|
1
|
+
{"version":3,"file":"NeonImageCarousel.vue.cjs.js","sources":["../../../../src/components/presentation/image-carousel/NeonImageCarousel.vue"],"sourcesContent":["<template>\n <div class=\"neon-image-carousel-wrapper\">\n <div\n :class=\"{\n 'neon-image-carousel--initialised': initialised,\n 'neon-image-carousel--expanded': expanded,\n }\"\n class=\"neon-image-carousel\"\n tabindex=\"0\"\n @keydown.stop.prevent.left=\"previous\"\n @keydown.stop.prevent.right=\"next\"\n @keydown.esc=\"expanded = false\"\n >\n <div class=\"neon-image-carousel__container\" tabindex=\"-1\" @click.stop=\"expanded = false\">\n <neon-button\n v-if=\"expanded\"\n :title=\"closeLabel\"\n button-style=\"text\"\n class=\"neon-image-carousel__close\"\n color=\"low-contrast\"\n icon=\"close\"\n size=\"l\"\n transparent\n @click=\"expanded = false\"\n />\n <neon-button\n :disabled=\"currentImage === 0\"\n :title=\"previousLabel\"\n :transparent=\"true\"\n button-style=\"text\"\n class=\"neon-image-carousel__previous\"\n color=\"neutral\"\n icon=\"arrow-left-1\"\n size=\"l\"\n @click.capture.stop=\"previous\"\n />\n <ul ref=\"carouselItems\" class=\"no-style neon-image-carousel__items\">\n <li\n v-for=\"(image, index) in images\"\n :key=\"image.src\"\n ref=\"carouselItem\"\n :class=\"{ 'neon-image-carousel__item--active': index === currentImage }\"\n class=\"neon-image-carousel__item\"\n >\n <img\n :alt=\"image.alt\"\n :src=\"image.src\"\n class=\"neon-image-carousel__image\"\n @click.stop=\"expanded = !expanded\"\n />\n <p v-if=\"expanded\" class=\"neon-image-carousel__item-title\">{{ image.alt }}</p>\n </li>\n </ul>\n <neon-button\n :disabled=\"currentImage === images.length - 1\"\n :title=\"nextLabel\"\n :transparent=\"true\"\n button-style=\"text\"\n class=\"neon-image-carousel__next\"\n color=\"neutral\"\n icon=\"arrow-right-1\"\n size=\"l\"\n @click.capture.stop=\"next\"\n />\n </div>\n <neon-stack class=\"neon-image-carousel__nav-container\" gap=\"s\" @click.stop=\"expanded = false\">\n <div class=\"neon-image-carousel__nav\" tabindex=\"-1\">\n <neon-link\n v-for=\"(_image, index) in images\"\n :key=\"index\"\n :aria-label=\"`Display image ${index + 1}`\"\n class=\"neon-image-carousel__nav-item-link\"\n outline-style=\"none\"\n role=\"button\"\n tabindex=\"0\"\n @keydown.stop.prevent.capture.enter=\"scrollTo(index)\"\n @keydown.stop.prevent.capture.space=\"scrollTo(index)\"\n >\n <div\n :class=\"{ 'neon-image-carousel__nav-item--active': index === currentImage }\"\n class=\"neon-image-carousel__nav-item\"\n tabindex=\"-1\"\n @click.capture.stop=\"scrollTo(index)\"\n >\n <div class=\"neon-image-carousel__nav-item-indicator\"></div>\n </div>\n </neon-link>\n </div>\n <span v-if=\"!hideLabel\" class=\"neon-image-carousel__label\" tabindex=\"-1\">\n {{ imageCountLabel || `${images.length} ${images.length === 1 ? 'image' : 'images'}` }}\n </span>\n </neon-stack>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" src=\"./NeonImageCarousel.ts\" />\n"],"names":["_hoisted_1","_openBlock","_createElementBlock","_createElementVNode","_normalizeClass","_ctx","args","_createBlock","_component_neon_button","_createVNode","_hoisted_2","_Fragment","_renderList","image","index","_cache","_withModifiers","$event","_hoisted_4","_toDisplayString","_component_neon_stack","_hoisted_5","_image","_component_neon_link","_withKeys","_hoisted_7"],"mappings":"4IACOA,EAAA,CAAA,MAAM,6BAA6B,KAmC9B,IAAI,gBAAgB,MAAM,gEAcP,MAAM,sCAgBxB,MAAM,2BAA2B,SAAS,oCAsBvB,MAAM,6BAA6B,SAAS,6IAvF1E,OAAAC,YAAA,EAAAC,qBA4FM,MA5FNF,EA4FM,CA3FJG,EAAAA,mBA0FM,MAAA,CAzFH,MAAKC,EAAAA,eAAA,CAAA,oCAAgDC,EAAA,4CAAsDA,EAAA,UAItG,qBAAqB,CAAA,EAC3B,SAAS,IACR,UAAO,gDAAoBA,EAAA,UAAAA,EAAA,SAAA,GAAAC,CAAA,EAAQ,CAAA,OAAA,SAAA,CAAA,EAAA,CAAA,MAAA,CAAA,kDACPD,EAAA,MAAAA,EAAA,KAAA,GAAAC,CAAA,EAAI,CAAA,OAAA,SAAA,CAAA,EAAA,CAAA,OAAA,CAAA,6BACnBD,EAAA,SAAQ,GAAA,CAAA,KAAA,CAAA,MAEtBF,EAAAA,mBAmDM,MAAA,CAnDD,MAAM,iCAAiC,SAAS,KAAM,uCAAYE,EAAA,SAAQ,GAAA,CAAA,MAAA,CAAA,KAErEA,EAAA,wBADRE,EAAAA,YAUEC,EAAA,OARC,MAAOH,EAAA,WACR,eAAa,OACb,MAAM,6BACN,MAAM,eACN,KAAK,QACL,KAAK,IACL,YAAA,GACC,uBAAOA,E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