@aotearoan/neon 22.2.0 → 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/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/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/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/src/common/enums/NeonToggleStyle.d.ts +3 -1
- package/dist/src/common/models/NeonDate.d.ts +2 -0
- package/dist/src/components/presentation/image-carousel/NeonImageCarousel.d.ts +35 -22
- package/dist/src/components/user-input/toggle/NeonToggle.d.ts +1 -0
- package/package.json +1 -1
- package/src/sass/components/_badge.scss +2 -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/variables.scss +30 -2
|
@@ -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,WA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qB,CAACC,MAAY;AAChD,UAAAA,EAAQ,QAAQ,CAACC,MAAU;AAEzB,YAAIjB,EAAY,SAASiB,EAAM,kBAC7BV,EAAYC,CAAK;AAAA,UAErB,CAAC;AAAA,QACH,GAAGK,CAAO;AACV,eAAAE,EAAI,QAAQD,CAAE,GAEPC;AAAA,MACT,CAAC,GAED,WAAW,MAAM;AAEf,QAAIZ,EAAc,SAASA,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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: "-1"
|
|
7
|
-
}, I = {
|
|
1
|
+
import $ from "./NeonImageCarousel.es.js";
|
|
2
|
+
import { resolveComponent as m, openBlock as s, createElementBlock as r, createElementVNode as l, withKeys as i, withModifiers as t, normalizeClass as d, createBlock as v, createCommentVNode as c, createVNode as g, Fragment as b, renderList as C, toDisplayString as k, withCtx as f } from "vue";
|
|
3
|
+
import w from "../../../_virtual/_plugin-vue_export-helper.es.js";
|
|
4
|
+
const I = { class: "neon-image-carousel-wrapper" }, L = {
|
|
8
5
|
ref: "carouselItems",
|
|
9
6
|
class: "no-style neon-image-carousel__items"
|
|
10
|
-
},
|
|
7
|
+
}, z = ["alt", "src"], K = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "neon-image-carousel__item-title"
|
|
10
|
+
}, N = {
|
|
11
11
|
class: "neon-image-carousel__nav",
|
|
12
12
|
tabindex: "-1"
|
|
13
|
-
},
|
|
13
|
+
}, B = ["onClickCapture"], T = {
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "neon-image-carousel__label",
|
|
16
16
|
tabindex: "-1"
|
|
17
17
|
};
|
|
18
|
-
function
|
|
19
|
-
const
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
18
|
+
function V(e, n, D, E, h, F) {
|
|
19
|
+
const u = m("neon-button"), _ = m("neon-link"), y = m("neon-stack");
|
|
20
|
+
return s(), r("div", I, [
|
|
21
|
+
l("div", {
|
|
22
|
+
class: d([{
|
|
23
|
+
"neon-image-carousel--initialised": e.initialised,
|
|
24
|
+
"neon-image-carousel--expanded": e.expanded
|
|
25
|
+
}, "neon-image-carousel"]),
|
|
26
|
+
tabindex: "0",
|
|
27
|
+
onKeydown: [
|
|
28
|
+
n[4] || (n[4] = i(t((...o) => e.previous && e.previous(...o), ["stop", "prevent"]), ["left"])),
|
|
29
|
+
n[5] || (n[5] = i(t((...o) => e.next && e.next(...o), ["stop", "prevent"]), ["right"])),
|
|
30
|
+
n[6] || (n[6] = i((o) => e.expanded = !1, ["esc"]))
|
|
31
|
+
]
|
|
32
|
+
}, [
|
|
33
|
+
l("div", {
|
|
34
|
+
class: "neon-image-carousel__container",
|
|
35
|
+
tabindex: "-1",
|
|
36
|
+
onClick: n[2] || (n[2] = t((o) => e.expanded = !1, ["stop"]))
|
|
37
|
+
}, [
|
|
38
|
+
e.expanded ? (s(), v(u, {
|
|
39
|
+
key: 0,
|
|
40
|
+
title: e.closeLabel,
|
|
41
|
+
"button-style": "text",
|
|
42
|
+
class: "neon-image-carousel__close",
|
|
43
|
+
color: "low-contrast",
|
|
44
|
+
icon: "close",
|
|
45
|
+
size: "l",
|
|
46
|
+
transparent: "",
|
|
47
|
+
onClick: n[0] || (n[0] = (o) => e.expanded = !1)
|
|
48
|
+
}, null, 8, ["title"])) : c("", !0),
|
|
49
|
+
g(u, {
|
|
50
|
+
disabled: e.currentImage === 0,
|
|
51
|
+
title: e.previousLabel,
|
|
52
|
+
transparent: !0,
|
|
53
|
+
"button-style": "text",
|
|
54
|
+
class: "neon-image-carousel__previous",
|
|
55
|
+
color: "neutral",
|
|
56
|
+
icon: "arrow-left-1",
|
|
57
|
+
size: "l",
|
|
58
|
+
onClickCapture: t(e.previous, ["stop"])
|
|
59
|
+
}, null, 8, ["disabled", "title", "onClickCapture"]),
|
|
60
|
+
l("ul", L, [
|
|
61
|
+
(s(!0), r(b, null, C(e.images, (o, a) => (s(), r("li", {
|
|
62
|
+
key: o.src,
|
|
63
|
+
ref_for: !0,
|
|
64
|
+
ref: "carouselItem",
|
|
65
|
+
class: d([{ "neon-image-carousel__item--active": a === e.currentImage }, "neon-image-carousel__item"])
|
|
66
|
+
}, [
|
|
67
|
+
l("img", {
|
|
68
|
+
alt: o.alt,
|
|
69
|
+
src: o.src,
|
|
70
|
+
class: "neon-image-carousel__image",
|
|
71
|
+
onClick: n[1] || (n[1] = t((p) => e.expanded = !e.expanded, ["stop"]))
|
|
72
|
+
}, null, 8, z),
|
|
73
|
+
e.expanded ? (s(), r("p", K, k(o.alt), 1)) : c("", !0)
|
|
74
|
+
], 2))), 128))
|
|
75
|
+
], 512),
|
|
76
|
+
g(u, {
|
|
77
|
+
disabled: e.currentImage === e.images.length - 1,
|
|
78
|
+
title: e.nextLabel,
|
|
79
|
+
transparent: !0,
|
|
80
|
+
"button-style": "text",
|
|
81
|
+
class: "neon-image-carousel__next",
|
|
82
|
+
color: "neutral",
|
|
83
|
+
icon: "arrow-right-1",
|
|
84
|
+
size: "l",
|
|
85
|
+
onClickCapture: t(e.next, ["stop"])
|
|
86
|
+
}, null, 8, ["disabled", "title", "onClickCapture"])
|
|
87
|
+
]),
|
|
88
|
+
g(y, {
|
|
89
|
+
class: "neon-image-carousel__nav-container",
|
|
90
|
+
gap: "s",
|
|
91
|
+
onClick: n[3] || (n[3] = t((o) => e.expanded = !1, ["stop"]))
|
|
80
92
|
}, {
|
|
81
|
-
default:
|
|
82
|
-
l("div",
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
93
|
+
default: f(() => [
|
|
94
|
+
l("div", N, [
|
|
95
|
+
(s(!0), r(b, null, C(e.images, (o, a) => (s(), v(_, {
|
|
96
|
+
key: a,
|
|
97
|
+
"aria-label": `Display image ${a + 1}`,
|
|
98
|
+
class: "neon-image-carousel__nav-item-link",
|
|
99
|
+
"outline-style": "none",
|
|
100
|
+
role: "button",
|
|
101
|
+
tabindex: "0",
|
|
102
|
+
onKeydownCapture: [
|
|
103
|
+
i(t((p) => e.scrollTo(a), ["stop", "prevent"]), ["enter"]),
|
|
104
|
+
i(t((p) => e.scrollTo(a), ["stop", "prevent"]), ["space"])
|
|
105
|
+
]
|
|
106
|
+
}, {
|
|
107
|
+
default: f(() => [
|
|
108
|
+
l("div", {
|
|
109
|
+
class: d([{ "neon-image-carousel__nav-item--active": a === e.currentImage }, "neon-image-carousel__nav-item"]),
|
|
110
|
+
tabindex: "-1",
|
|
111
|
+
onClickCapture: t((p) => e.scrollTo(a), ["stop"])
|
|
112
|
+
}, [...n[7] || (n[7] = [
|
|
113
|
+
l("div", { class: "neon-image-carousel__nav-item-indicator" }, null, -1)
|
|
114
|
+
])], 42, B)
|
|
115
|
+
]),
|
|
116
|
+
_: 2
|
|
117
|
+
}, 1032, ["aria-label", "onKeydownCapture"]))), 128))
|
|
118
|
+
]),
|
|
119
|
+
e.hideLabel ? c("", !0) : (s(), r("span", T, k(e.imageCountLabel || `${e.images.length} ${e.images.length === 1 ? "image" : "images"}`), 1))
|
|
89
120
|
]),
|
|
90
|
-
_:
|
|
91
|
-
}
|
|
92
|
-
])
|
|
93
|
-
|
|
94
|
-
], 34);
|
|
121
|
+
_: 1
|
|
122
|
+
})
|
|
123
|
+
], 34)
|
|
124
|
+
]);
|
|
95
125
|
}
|
|
96
|
-
const
|
|
126
|
+
const q = /* @__PURE__ */ w($, [["render", V]]);
|
|
97
127
|
export {
|
|
98
|
-
|
|
128
|
+
q as default
|
|
99
129
|
};
|
|
100
130
|
//# sourceMappingURL=NeonImageCarousel.vue.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonImageCarousel.vue.es.js","sources":["../../../../src/components/presentation/image-carousel/NeonImageCarousel.vue"],"sourcesContent":["<template>\n <div\n :class=\"{
|
|
1
|
+
{"version":3,"file":"NeonImageCarousel.vue.es.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":";;;AACO,MAAAA,IAAA,EAAA,OAAM,8BAA6B;EAmC9B,KAAI;AAAA,EAAgB,OAAM;;;EAcP,OAAM;;EAgBxB,OAAM;AAAA,EAA2B,UAAS;;;EAsBvB,OAAM;AAAA,EAA6B,UAAS;;;;AAvF1E,SAA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ASS,CAAK,GAAA,CAAA,QAAA,SAAA,CAAA,GAAA,CAAA,OAAA,CAAA;AAAA;;yBAEnD,MAOM;AAAA,gBAPNX,EAOM,OAAA;AAAA,kBANH,OAAKC,EAAA,CAAA,EAAA,yCAA6CU,MAAUT,EAAA,gBACvD,+BAA+B,CAAA;AAAA,kBACrC,UAAS;AAAA,kBACY,gBAAAW,EAAA,CAAAC,MAAAZ,EAAA,SAASS,CAAK,GAAA,CAAA,MAAA,CAAA;AAAA;kBAEnCX,EAA2D,OAAA,EAAtD,OAAM,0CAAyC,GAAA,MAAA,EAAA;AAAA;;;;;UAI7CE,EAAA,8BAAbH,EAEO,QAFPuB,GAEON,EADFd,EAAA,mBAAe,GAAOA,EAAA,OAAO,MAAM,IAAIA,EAAA,OAAO,WAAM,IAAA,UAAA,QAAA,EAAA,GAAA,CAAA;AAAA;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const n=require("vue"),
|
|
1
|
+
"use strict";const n=require("vue"),c=require("../../../common/enums/NeonSize.cjs.js"),g=require("../../../common/enums/NeonFunctionalColor.cjs.js"),i=require("../../../common/enums/NeonToggleStyle.cjs.js"),y=require("../../../common/enums/NeonOrientation.cjs.js"),m=require("../../presentation/icon/NeonIcon.vue.cjs.js"),p=n.defineComponent({name:"NeonToggle",components:{NeonIcon:m},props:{name:{type:String,required:!0},modelValue:{type:String,required:!0},model:{type:Array,required:!0},toggleStyle:{type:String,default:()=>i.NeonToggleStyle.Toggle},size:{type:String,default:()=>c.NeonSize.Medium},orientation:{type:String,default:()=>y.NeonOrientation.Vertical},color:{type:String,default:()=>g.NeonFunctionalColor.Primary},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:r,slots:l}){const u=n.useAttrs(),o=e=>{r("update:modelValue",e)},s=e=>{!t.disabled&&!e.disabled&&t.modelValue!==e.key&&o(e.key)},a=n.computed(()=>{const{onClick:e,...d}=u;return d});return{selectOption:e=>{!t.disabled&&!e.disabled&&o(e.key)},onInput:s,sanitizedAttributes:a,slots:l,NeonToggleStyle:i.NeonToggleStyle}}});module.exports=p;
|
|
2
2
|
//# sourceMappingURL=NeonToggle.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonToggle.cjs.js","sources":["../../../../src/components/user-input/toggle/NeonToggle.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { computed, defineComponent, useAttrs } from 'vue';\nimport type { NeonToggleModel } from '@/common/models/NeonToggleModel';\nimport { NeonSize } from '@/common/enums/NeonSize';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\nimport { NeonToggleStyle } from '@/common/enums/NeonToggleStyle';\nimport { NeonOrientation } from '@/common/enums/NeonOrientation';\nimport NeonIcon from '@/components/presentation/icon/NeonIcon.vue';\n\n/**\n * <p>A toggle component for selecting one value from a range of options. This is equivalent to a radio button group. It can be styled as a <em>Toggle</em> or as <em>Radio buttons</em>.\n */\nexport default defineComponent({\n name: 'NeonToggle',\n components: {\n NeonIcon,\n },\n props: {\n /**\n * The name of the radio button group.\n */\n name: { type: String, required: true },\n /**\n * The key of the selected option.\n */\n modelValue: { type: String, required: true },\n /**\n * The list of options to present to the user.\n */\n model: { type: Array as () => Array<NeonToggleModel>, required: true },\n /**\n * The style of toggle to display to the user.\n */\n toggleStyle: { type: String as () => NeonToggleStyle, default: () => NeonToggleStyle.Toggle },\n /**\n * The size of the toggle.\n */\n size: { type: String as () => NeonSize, default: () => NeonSize.Medium },\n /**\n * The orientation of the toggle if the style is a radio button group.\n */\n orientation: { type: String as () => NeonOrientation, default: () => NeonOrientation.Vertical },\n /**\n * The color of the toggle.\n */\n color: { type: String as () => NeonFunctionalColor, default: () => NeonFunctionalColor.Primary },\n /**\n * Whether the toggle is disabled.\n */\n disabled: { type: Boolean, default: false },\n },\n emits: [\n /**\n * Emitted when the selected value changes.\n * @type {string} The key of the selected model item.\n */\n 'update:modelValue',\n ],\n setup(props, { emit, slots }) {\n const attrs = useAttrs();\n const emitInput = (key: string) => {\n emit('update:modelValue', key);\n };\n\n const onInput = (option: NeonToggleModel) => {\n if (!props.disabled && !option.disabled && props.modelValue !== option.key) {\n emitInput(option.key);\n }\n };\n\n const sanitizedAttributes = computed(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { onClick, ...sanitized } = attrs;\n return sanitized;\n });\n\n const selectOption = (option: NeonToggleModel) => {\n if (!props.disabled && !option.disabled) {\n emitInput(option.key);\n }\n };\n\n return {\n selectOption,\n onInput,\n sanitizedAttributes,\n slots,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonIcon","NeonToggleStyle","NeonSize","NeonOrientation","NeonFunctionalColor","props","emit","slots","attrs","useAttrs","emitInput","key","onInput","option","sanitizedAttributes","computed","onClick","sanitized"],"mappings":"kUAWAA,EAAeC,kBAAgB,CAC7B,KAAM,aACN,WAAY,CACV,SAAAC,CAAA,EAEF,MAAO,CAIL,KAAM,CAAE,KAAM,OAAQ,SAAU,EAAA,EAIhC,WAAY,CAAE,KAAM,OAAQ,SAAU,EAAA,EAItC,MAAO,CAAE,KAAM,MAAuC,SAAU,EAAA,EAIhE,YAAa,CAAE,KAAM,OAAiC,QAAS,IAAMC,EAAAA,gBAAgB,MAAA,EAIrF,KAAM,CAAE,KAAM,OAA0B,QAAS,IAAMC,EAAAA,SAAS,MAAA,EAIhE,YAAa,CAAE,KAAM,OAAiC,QAAS,IAAMC,EAAAA,gBAAgB,QAAA,EAIrF,MAAO,CAAE,KAAM,OAAqC,QAAS,IAAMC,EAAAA,oBAAoB,OAAA,EAIvF,SAAU,CAAE,KAAM,QAAS,QAAS,EAAA,CAAM,EAE5C,MAAO,CAKL,mBAAA,EAEF,MAAMC,EAAO,CAAE,KAAAC,EAAM,MAAAC,GAAS,CAC5B,MAAMC,EAAQC,EAAAA,SAAA,EACRC,EAAaC,GAAgB,CACjCL,EAAK,oBAAqBK,CAAG,CAC/B,EAEMC,EAAWC,GAA4B,CACvC,CAACR,EAAM,UAAY,CAACQ,EAAO,UAAYR,EAAM,aAAeQ,EAAO,KACrEH,EAAUG,EAAO,GAAG,CAExB,EAEMC,EAAsBC,EAAAA,SAAS,IAAM,CAEzC,KAAM,CAAE,QAAAC,EAAS,GAAGC,CAAA,EAAcT,EAClC,OAAOS,CACT,CAAC,EAQD,MAAO,CACL,aAPoBJ,GAA4B,CAC5C,CAACR,EAAM,UAAY,CAACQ,EAAO,UAC7BH,EAAUG,EAAO,GAAG,CAExB,EAIE,QAAAD,EACA,oBAAAE,EACA,MAAAP,
|
|
1
|
+
{"version":3,"file":"NeonToggle.cjs.js","sources":["../../../../src/components/user-input/toggle/NeonToggle.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { computed, defineComponent, useAttrs } from 'vue';\nimport type { NeonToggleModel } from '@/common/models/NeonToggleModel';\nimport { NeonSize } from '@/common/enums/NeonSize';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\nimport { NeonToggleStyle } from '@/common/enums/NeonToggleStyle';\nimport { NeonOrientation } from '@/common/enums/NeonOrientation';\nimport NeonIcon from '@/components/presentation/icon/NeonIcon.vue';\n\n/**\n * <p>A toggle component for selecting one value from a range of options. This is equivalent to a radio button group. It can be styled as a <em>Toggle</em> or as <em>Radio buttons</em>.\n */\nexport default defineComponent({\n name: 'NeonToggle',\n components: {\n NeonIcon,\n },\n props: {\n /**\n * The name of the radio button group.\n */\n name: { type: String, required: true },\n /**\n * The key of the selected option.\n */\n modelValue: { type: String, required: true },\n /**\n * The list of options to present to the user.\n */\n model: { type: Array as () => Array<NeonToggleModel>, required: true },\n /**\n * The style of toggle to display to the user.\n */\n toggleStyle: { type: String as () => NeonToggleStyle, default: () => NeonToggleStyle.Toggle },\n /**\n * The size of the toggle.\n */\n size: { type: String as () => NeonSize, default: () => NeonSize.Medium },\n /**\n * The orientation of the toggle if the style is a radio button group.\n */\n orientation: { type: String as () => NeonOrientation, default: () => NeonOrientation.Vertical },\n /**\n * The color of the toggle.\n */\n color: { type: String as () => NeonFunctionalColor, default: () => NeonFunctionalColor.Primary },\n /**\n * Whether the toggle is disabled.\n */\n disabled: { type: Boolean, default: false },\n },\n emits: [\n /**\n * Emitted when the selected value changes.\n * @type {string} The key of the selected model item.\n */\n 'update:modelValue',\n ],\n setup(props, { emit, slots }) {\n const attrs = useAttrs();\n const emitInput = (key: string) => {\n emit('update:modelValue', key);\n };\n\n const onInput = (option: NeonToggleModel) => {\n if (!props.disabled && !option.disabled && props.modelValue !== option.key) {\n emitInput(option.key);\n }\n };\n\n const sanitizedAttributes = computed(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { onClick, ...sanitized } = attrs;\n return sanitized;\n });\n\n const selectOption = (option: NeonToggleModel) => {\n if (!props.disabled && !option.disabled) {\n emitInput(option.key);\n }\n };\n\n return {\n selectOption,\n onInput,\n sanitizedAttributes,\n slots,\n NeonToggleStyle,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonIcon","NeonToggleStyle","NeonSize","NeonOrientation","NeonFunctionalColor","props","emit","slots","attrs","useAttrs","emitInput","key","onInput","option","sanitizedAttributes","computed","onClick","sanitized"],"mappings":"kUAWAA,EAAeC,kBAAgB,CAC7B,KAAM,aACN,WAAY,CACV,SAAAC,CAAA,EAEF,MAAO,CAIL,KAAM,CAAE,KAAM,OAAQ,SAAU,EAAA,EAIhC,WAAY,CAAE,KAAM,OAAQ,SAAU,EAAA,EAItC,MAAO,CAAE,KAAM,MAAuC,SAAU,EAAA,EAIhE,YAAa,CAAE,KAAM,OAAiC,QAAS,IAAMC,EAAAA,gBAAgB,MAAA,EAIrF,KAAM,CAAE,KAAM,OAA0B,QAAS,IAAMC,EAAAA,SAAS,MAAA,EAIhE,YAAa,CAAE,KAAM,OAAiC,QAAS,IAAMC,EAAAA,gBAAgB,QAAA,EAIrF,MAAO,CAAE,KAAM,OAAqC,QAAS,IAAMC,EAAAA,oBAAoB,OAAA,EAIvF,SAAU,CAAE,KAAM,QAAS,QAAS,EAAA,CAAM,EAE5C,MAAO,CAKL,mBAAA,EAEF,MAAMC,EAAO,CAAE,KAAAC,EAAM,MAAAC,GAAS,CAC5B,MAAMC,EAAQC,EAAAA,SAAA,EACRC,EAAaC,GAAgB,CACjCL,EAAK,oBAAqBK,CAAG,CAC/B,EAEMC,EAAWC,GAA4B,CACvC,CAACR,EAAM,UAAY,CAACQ,EAAO,UAAYR,EAAM,aAAeQ,EAAO,KACrEH,EAAUG,EAAO,GAAG,CAExB,EAEMC,EAAsBC,EAAAA,SAAS,IAAM,CAEzC,KAAM,CAAE,QAAAC,EAAS,GAAGC,CAAA,EAAcT,EAClC,OAAOS,CACT,CAAC,EAQD,MAAO,CACL,aAPoBJ,GAA4B,CAC5C,CAACR,EAAM,UAAY,CAACQ,EAAO,UAC7BH,EAAUG,EAAO,GAAG,CAExB,EAIE,QAAAD,EACA,oBAAAE,EACA,MAAAP,EAAA,gBACAN,EAAAA,eAAA,CAEJ,CACF,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { NeonSize as
|
|
3
|
-
import { NeonFunctionalColor as
|
|
4
|
-
import { NeonToggleStyle as
|
|
1
|
+
import { defineComponent as m, useAttrs as s, computed as p } from "vue";
|
|
2
|
+
import { NeonSize as c } from "../../../common/enums/NeonSize.es.js";
|
|
3
|
+
import { NeonFunctionalColor as f } from "../../../common/enums/NeonFunctionalColor.es.js";
|
|
4
|
+
import { NeonToggleStyle as r } from "../../../common/enums/NeonToggleStyle.es.js";
|
|
5
5
|
import { NeonOrientation as y } from "../../../common/enums/NeonOrientation.es.js";
|
|
6
6
|
import g from "../../presentation/icon/NeonIcon.vue.es.js";
|
|
7
|
-
const A =
|
|
7
|
+
const A = m({
|
|
8
8
|
name: "NeonToggle",
|
|
9
9
|
components: {
|
|
10
10
|
NeonIcon: g
|
|
@@ -25,11 +25,11 @@ const A = u({
|
|
|
25
25
|
/**
|
|
26
26
|
* The style of toggle to display to the user.
|
|
27
27
|
*/
|
|
28
|
-
toggleStyle: { type: String, default: () =>
|
|
28
|
+
toggleStyle: { type: String, default: () => r.Toggle },
|
|
29
29
|
/**
|
|
30
30
|
* The size of the toggle.
|
|
31
31
|
*/
|
|
32
|
-
size: { type: String, default: () =>
|
|
32
|
+
size: { type: String, default: () => c.Medium },
|
|
33
33
|
/**
|
|
34
34
|
* The orientation of the toggle if the style is a radio button group.
|
|
35
35
|
*/
|
|
@@ -37,7 +37,7 @@ const A = u({
|
|
|
37
37
|
/**
|
|
38
38
|
* The color of the toggle.
|
|
39
39
|
*/
|
|
40
|
-
color: { type: String, default: () =>
|
|
40
|
+
color: { type: String, default: () => f.Primary },
|
|
41
41
|
/**
|
|
42
42
|
* Whether the toggle is disabled.
|
|
43
43
|
*/
|
|
@@ -50,22 +50,23 @@ const A = u({
|
|
|
50
50
|
*/
|
|
51
51
|
"update:modelValue"
|
|
52
52
|
],
|
|
53
|
-
setup(t, { emit:
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
},
|
|
53
|
+
setup(t, { emit: n, slots: i }) {
|
|
54
|
+
const l = s(), o = (e) => {
|
|
55
|
+
n("update:modelValue", e);
|
|
56
|
+
}, a = (e) => {
|
|
57
57
|
!t.disabled && !e.disabled && t.modelValue !== e.key && o(e.key);
|
|
58
|
-
},
|
|
59
|
-
const { onClick: e, ...
|
|
60
|
-
return
|
|
58
|
+
}, d = p(() => {
|
|
59
|
+
const { onClick: e, ...u } = l;
|
|
60
|
+
return u;
|
|
61
61
|
});
|
|
62
62
|
return {
|
|
63
63
|
selectOption: (e) => {
|
|
64
64
|
!t.disabled && !e.disabled && o(e.key);
|
|
65
65
|
},
|
|
66
|
-
onInput:
|
|
67
|
-
sanitizedAttributes:
|
|
68
|
-
slots:
|
|
66
|
+
onInput: a,
|
|
67
|
+
sanitizedAttributes: d,
|
|
68
|
+
slots: i,
|
|
69
|
+
NeonToggleStyle: r
|
|
69
70
|
};
|
|
70
71
|
}
|
|
71
72
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonToggle.es.js","sources":["../../../../src/components/user-input/toggle/NeonToggle.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { computed, defineComponent, useAttrs } from 'vue';\nimport type { NeonToggleModel } from '@/common/models/NeonToggleModel';\nimport { NeonSize } from '@/common/enums/NeonSize';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\nimport { NeonToggleStyle } from '@/common/enums/NeonToggleStyle';\nimport { NeonOrientation } from '@/common/enums/NeonOrientation';\nimport NeonIcon from '@/components/presentation/icon/NeonIcon.vue';\n\n/**\n * <p>A toggle component for selecting one value from a range of options. This is equivalent to a radio button group. It can be styled as a <em>Toggle</em> or as <em>Radio buttons</em>.\n */\nexport default defineComponent({\n name: 'NeonToggle',\n components: {\n NeonIcon,\n },\n props: {\n /**\n * The name of the radio button group.\n */\n name: { type: String, required: true },\n /**\n * The key of the selected option.\n */\n modelValue: { type: String, required: true },\n /**\n * The list of options to present to the user.\n */\n model: { type: Array as () => Array<NeonToggleModel>, required: true },\n /**\n * The style of toggle to display to the user.\n */\n toggleStyle: { type: String as () => NeonToggleStyle, default: () => NeonToggleStyle.Toggle },\n /**\n * The size of the toggle.\n */\n size: { type: String as () => NeonSize, default: () => NeonSize.Medium },\n /**\n * The orientation of the toggle if the style is a radio button group.\n */\n orientation: { type: String as () => NeonOrientation, default: () => NeonOrientation.Vertical },\n /**\n * The color of the toggle.\n */\n color: { type: String as () => NeonFunctionalColor, default: () => NeonFunctionalColor.Primary },\n /**\n * Whether the toggle is disabled.\n */\n disabled: { type: Boolean, default: false },\n },\n emits: [\n /**\n * Emitted when the selected value changes.\n * @type {string} The key of the selected model item.\n */\n 'update:modelValue',\n ],\n setup(props, { emit, slots }) {\n const attrs = useAttrs();\n const emitInput = (key: string) => {\n emit('update:modelValue', key);\n };\n\n const onInput = (option: NeonToggleModel) => {\n if (!props.disabled && !option.disabled && props.modelValue !== option.key) {\n emitInput(option.key);\n }\n };\n\n const sanitizedAttributes = computed(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { onClick, ...sanitized } = attrs;\n return sanitized;\n });\n\n const selectOption = (option: NeonToggleModel) => {\n if (!props.disabled && !option.disabled) {\n emitInput(option.key);\n }\n };\n\n return {\n selectOption,\n onInput,\n sanitizedAttributes,\n slots,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonIcon","NeonToggleStyle","NeonSize","NeonOrientation","NeonFunctionalColor","props","emit","slots","attrs","useAttrs","emitInput","key","onInput","option","sanitizedAttributes","computed","onClick","sanitized"],"mappings":";;;;;;AAWA,MAAAA,IAAeC,EAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,IACV,UAAAC;AAAA,EAAA;AAAA,EAEF,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,MAAM,EAAE,MAAM,QAAQ,UAAU,GAAA;AAAA;AAAA;AAAA;AAAA,IAIhC,YAAY,EAAE,MAAM,QAAQ,UAAU,GAAA;AAAA;AAAA;AAAA;AAAA,IAItC,OAAO,EAAE,MAAM,OAAuC,UAAU,GAAA;AAAA;AAAA;AAAA;AAAA,IAIhE,aAAa,EAAE,MAAM,QAAiC,SAAS,MAAMC,EAAgB,OAAA;AAAA;AAAA;AAAA;AAAA,IAIrF,MAAM,EAAE,MAAM,QAA0B,SAAS,MAAMC,EAAS,OAAA;AAAA;AAAA;AAAA;AAAA,IAIhE,aAAa,EAAE,MAAM,QAAiC,SAAS,MAAMC,EAAgB,SAAA;AAAA;AAAA;AAAA;AAAA,IAIrF,OAAO,EAAE,MAAM,QAAqC,SAAS,MAAMC,EAAoB,QAAA;AAAA;AAAA;AAAA;AAAA,IAIvF,UAAU,EAAE,MAAM,SAAS,SAAS,GAAA;AAAA,EAAM;AAAA,EAE5C,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL;AAAA,EAAA;AAAA,EAEF,MAAMC,GAAO,EAAE,MAAAC,GAAM,OAAAC,KAAS;AAC5B,UAAMC,IAAQC,EAAA,GACRC,IAAY,CAACC,MAAgB;AACjC,MAAAL,EAAK,qBAAqBK,CAAG;AAAA,IAC/B,GAEMC,IAAU,CAACC,MAA4B;AAC3C,MAAI,CAACR,EAAM,YAAY,CAACQ,EAAO,YAAYR,EAAM,eAAeQ,EAAO,OACrEH,EAAUG,EAAO,GAAG;AAAA,IAExB,GAEMC,IAAsBC,EAAS,MAAM;AAEzC,YAAM,EAAE,SAAAC,GAAS,GAAGC,EAAA,IAAcT;AAClC,aAAOS;AAAA,IACT,CAAC;AAQD,WAAO;AAAA,MACL,cAPmB,CAACJ,MAA4B;AAChD,QAAI,CAACR,EAAM,YAAY,CAACQ,EAAO,YAC7BH,EAAUG,EAAO,GAAG;AAAA,MAExB;AAAA,MAIE,SAAAD;AAAA,MACA,qBAAAE;AAAA,MACA,OAAAP;AAAA,IAAA;AAAA,EAEJ;AACF,CAAC;"}
|
|
1
|
+
{"version":3,"file":"NeonToggle.es.js","sources":["../../../../src/components/user-input/toggle/NeonToggle.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { computed, defineComponent, useAttrs } from 'vue';\nimport type { NeonToggleModel } from '@/common/models/NeonToggleModel';\nimport { NeonSize } from '@/common/enums/NeonSize';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\nimport { NeonToggleStyle } from '@/common/enums/NeonToggleStyle';\nimport { NeonOrientation } from '@/common/enums/NeonOrientation';\nimport NeonIcon from '@/components/presentation/icon/NeonIcon.vue';\n\n/**\n * <p>A toggle component for selecting one value from a range of options. This is equivalent to a radio button group. It can be styled as a <em>Toggle</em> or as <em>Radio buttons</em>.\n */\nexport default defineComponent({\n name: 'NeonToggle',\n components: {\n NeonIcon,\n },\n props: {\n /**\n * The name of the radio button group.\n */\n name: { type: String, required: true },\n /**\n * The key of the selected option.\n */\n modelValue: { type: String, required: true },\n /**\n * The list of options to present to the user.\n */\n model: { type: Array as () => Array<NeonToggleModel>, required: true },\n /**\n * The style of toggle to display to the user.\n */\n toggleStyle: { type: String as () => NeonToggleStyle, default: () => NeonToggleStyle.Toggle },\n /**\n * The size of the toggle.\n */\n size: { type: String as () => NeonSize, default: () => NeonSize.Medium },\n /**\n * The orientation of the toggle if the style is a radio button group.\n */\n orientation: { type: String as () => NeonOrientation, default: () => NeonOrientation.Vertical },\n /**\n * The color of the toggle.\n */\n color: { type: String as () => NeonFunctionalColor, default: () => NeonFunctionalColor.Primary },\n /**\n * Whether the toggle is disabled.\n */\n disabled: { type: Boolean, default: false },\n },\n emits: [\n /**\n * Emitted when the selected value changes.\n * @type {string} The key of the selected model item.\n */\n 'update:modelValue',\n ],\n setup(props, { emit, slots }) {\n const attrs = useAttrs();\n const emitInput = (key: string) => {\n emit('update:modelValue', key);\n };\n\n const onInput = (option: NeonToggleModel) => {\n if (!props.disabled && !option.disabled && props.modelValue !== option.key) {\n emitInput(option.key);\n }\n };\n\n const sanitizedAttributes = computed(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { onClick, ...sanitized } = attrs;\n return sanitized;\n });\n\n const selectOption = (option: NeonToggleModel) => {\n if (!props.disabled && !option.disabled) {\n emitInput(option.key);\n }\n };\n\n return {\n selectOption,\n onInput,\n sanitizedAttributes,\n slots,\n NeonToggleStyle,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonIcon","NeonToggleStyle","NeonSize","NeonOrientation","NeonFunctionalColor","props","emit","slots","attrs","useAttrs","emitInput","key","onInput","option","sanitizedAttributes","computed","onClick","sanitized"],"mappings":";;;;;;AAWA,MAAAA,IAAeC,EAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,IACV,UAAAC;AAAA,EAAA;AAAA,EAEF,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,MAAM,EAAE,MAAM,QAAQ,UAAU,GAAA;AAAA;AAAA;AAAA;AAAA,IAIhC,YAAY,EAAE,MAAM,QAAQ,UAAU,GAAA;AAAA;A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const
|
|
1
|
+
"use strict";const t=require("./NeonToggle.cjs.js"),e=require("vue"),s=require("../../../_virtual/_plugin-vue_export-helper.cjs.js"),r=["aria-checked","aria-disabled","tabindex","onKeydown"],i=["checked","disabled","name","value","onClick"],c={key:0,class:"neon-toggle__radio-button"},g={key:0,class:"neon-toggle__radio-button-indicator"},b={key:1};function u(l,m,y,_,h,p){const a=e.resolveComponent("neon-icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([[`neon-toggle--${l.toggleStyle}`,`neon-toggle--${l.disabled?"low-contrast":l.color}`,`neon-toggle--${l.orientation}`,`neon-toggle--${l.size}`,{"neon-toggle--disabled":l.disabled}],"neon-toggle"]),role:"radiogroup"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.model,(n,d)=>(e.openBlock(),e.createElementBlock("label",{key:n.key,"aria-checked":n.key===l.modelValue,"aria-disabled":l.disabled||n.disabled,class:e.normalizeClass([{"neon-toggle__label--disabled":l.disabled||n.disabled,"neon-toggle__label--checked":n.key===l.modelValue,"neon-toggle__label--with-icon":n.icon,"neon-toggle__label--with-slot-override":l.slots.option,"neon-toggle__label--with-text":n.label},"neon-toggle__label no-style"]),tabindex:!l.disabled&&!n.disabled?0:void 0,role:"radio",onKeydown:[e.withKeys(o=>l.selectOption(n),["enter"]),e.withKeys(e.withModifiers(o=>l.selectOption(n),["prevent"]),["space"])]},[e.createElementVNode("input",e.mergeProps({checked:n.key===l.modelValue,disabled:l.disabled||n.disabled,name:l.name,tabindex:-1,value:n.key,class:"neon-toggle__input",type:"radio"},{ref_for:!0},l.sanitizedAttributes,{onClick:o=>l.onInput(n)}),null,16,i),l.toggleStyle!==l.NeonToggleStyle.Toggle?(e.openBlock(),e.createElementBlock("div",c,[n.key===l.modelValue?(e.openBlock(),e.createElementBlock("div",g)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"option",{index:d,option:n},()=>[n.icon?(e.openBlock(),e.createBlock(a,{key:0,disabled:l.disabled||n.disabled,name:n.icon},null,8,["disabled","name"])):e.createCommentVNode("",!0),n.label?(e.openBlock(),e.createElementBlock("span",b,e.toDisplayString(n.label),1)):e.createCommentVNode("",!0)])],42,r))),128))],2)}const k=s(t,[["render",u]]);module.exports=k;
|
|
2
2
|
//# sourceMappingURL=NeonToggle.vue.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonToggle.vue.cjs.js","sources":["../../../../src/components/user-input/toggle/NeonToggle.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n `neon-toggle--${toggleStyle}`,\n `neon-toggle--${disabled ? 'low-contrast' : color}`,\n `neon-toggle--${orientation}`,\n `neon-toggle--${size}`,\n { 'neon-toggle--disabled': disabled },\n ]\"\n class=\"neon-toggle\"\n role=\"radiogroup\"\n >\n <label\n v-for=\"(option, index) in model\"\n :key=\"option.key\"\n :aria-checked=\"option.key === modelValue\"\n :aria-disabled=\"disabled || option.disabled\"\n :class=\"{\n 'neon-toggle__label--disabled': disabled || option.disabled,\n 'neon-toggle__label--checked': option.key === modelValue,\n 'neon-toggle__label--with-icon': option.icon,\n 'neon-toggle__label--with-slot-override': slots.option,\n 'neon-toggle__label--with-text': option.label,\n }\"\n :tabindex=\"!disabled && !option.disabled ? 0 : undefined\"\n class=\"neon-toggle__label no-style\"\n role=\"radio\"\n @keydown.enter=\"selectOption(option)\"\n @keydown.space.prevent=\"selectOption(option)\"\n >\n <input\n :checked=\"option.key === modelValue\"\n :disabled=\"disabled || option.disabled\"\n :name=\"name\"\n :tabindex=\"-1\"\n :value=\"option.key\"\n class=\"neon-toggle__input\"\n type=\"radio\"\n v-bind=\"sanitizedAttributes\"\n @click=\"onInput(option)\"\n />\n <div v-if=\"toggleStyle
|
|
1
|
+
{"version":3,"file":"NeonToggle.vue.cjs.js","sources":["../../../../src/components/user-input/toggle/NeonToggle.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n `neon-toggle--${toggleStyle}`,\n `neon-toggle--${disabled ? 'low-contrast' : color}`,\n `neon-toggle--${orientation}`,\n `neon-toggle--${size}`,\n { 'neon-toggle--disabled': disabled },\n ]\"\n class=\"neon-toggle\"\n role=\"radiogroup\"\n >\n <label\n v-for=\"(option, index) in model\"\n :key=\"option.key\"\n :aria-checked=\"option.key === modelValue\"\n :aria-disabled=\"disabled || option.disabled\"\n :class=\"{\n 'neon-toggle__label--disabled': disabled || option.disabled,\n 'neon-toggle__label--checked': option.key === modelValue,\n 'neon-toggle__label--with-icon': option.icon,\n 'neon-toggle__label--with-slot-override': slots.option,\n 'neon-toggle__label--with-text': option.label,\n }\"\n :tabindex=\"!disabled && !option.disabled ? 0 : undefined\"\n class=\"neon-toggle__label no-style\"\n role=\"radio\"\n @keydown.enter=\"selectOption(option)\"\n @keydown.space.prevent=\"selectOption(option)\"\n >\n <input\n :checked=\"option.key === modelValue\"\n :disabled=\"disabled || option.disabled\"\n :name=\"name\"\n :tabindex=\"-1\"\n :value=\"option.key\"\n class=\"neon-toggle__input\"\n type=\"radio\"\n v-bind=\"sanitizedAttributes\"\n @click=\"onInput(option)\"\n />\n <div v-if=\"toggleStyle !== NeonToggleStyle.Toggle\" class=\"neon-toggle__radio-button\">\n <div v-if=\"option.key === modelValue\" class=\"neon-toggle__radio-button-indicator\"></div>\n </div>\n <!-- @slot This slot is for overriding the option rendering, it is passed two arguments, <em>option</em> - the option model & <em>index</em> -->\n <slot :index=\"index\" :option=\"option\" name=\"option\">\n <neon-icon v-if=\"option.icon\" :disabled=\"disabled || option.disabled\" :name=\"option.icon\" />\n <span v-if=\"option.label\">{{ option.label }}</span>\n </slot>\n </label>\n </div>\n</template>\n\n<script lang=\"ts\" src=\"./NeonToggle.ts\" />\n"],"names":["_createElementBlock","_normalizeClass","_ctx","_openBlock","_Fragment","_renderList","option","index","_withKeys","$event","_withModifiers","_createElementVNode","_mergeProps","_hoisted_3","_hoisted_4","_renderSlot","_createBlock","_component_neon_icon","_hoisted_5","_toDisplayString"],"mappings":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