@aotearoan/neon 21.0.3 → 22.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/components/layout/page/NeonPage.cjs.js +1 -1
  2. package/dist/components/layout/page/NeonPage.cjs.js.map +1 -1
  3. package/dist/components/layout/page/NeonPage.es.js +10 -10
  4. package/dist/components/layout/page/NeonPage.es.js.map +1 -1
  5. package/dist/components/layout/page/NeonPage.vue.cjs.js +1 -1
  6. package/dist/components/layout/page/NeonPage.vue.cjs.js.map +1 -1
  7. package/dist/components/layout/page/NeonPage.vue.es.js +2 -2
  8. package/dist/components/layout/page/NeonPage.vue.es.js.map +1 -1
  9. package/dist/components/layout/side-nav/NeonSideNav.cjs.js +1 -1
  10. package/dist/components/layout/side-nav/NeonSideNav.cjs.js.map +1 -1
  11. package/dist/components/layout/side-nav/NeonSideNav.es.js +6 -3
  12. package/dist/components/layout/side-nav/NeonSideNav.es.js.map +1 -1
  13. package/dist/components/layout/side-nav/NeonSideNav.vue.cjs.js +1 -1
  14. package/dist/components/layout/side-nav/NeonSideNav.vue.cjs.js.map +1 -1
  15. package/dist/components/layout/side-nav/NeonSideNav.vue.es.js +5 -5
  16. package/dist/components/layout/side-nav/NeonSideNav.vue.es.js.map +1 -1
  17. package/dist/components/user-input/search/NeonSearch.cjs.js +1 -1
  18. package/dist/components/user-input/search/NeonSearch.cjs.js.map +1 -1
  19. package/dist/components/user-input/search/NeonSearch.es.js +95 -82
  20. package/dist/components/user-input/search/NeonSearch.es.js.map +1 -1
  21. package/dist/components/user-input/search/NeonSearch.vue.cjs.js +1 -1
  22. package/dist/components/user-input/search/NeonSearch.vue.cjs.js.map +1 -1
  23. package/dist/components/user-input/search/NeonSearch.vue.es.js +19 -19
  24. package/dist/components/user-input/search/NeonSearch.vue.es.js.map +1 -1
  25. package/dist/components/user-input/toggle/NeonToggle.cjs.js +1 -1
  26. package/dist/components/user-input/toggle/NeonToggle.cjs.js.map +1 -1
  27. package/dist/components/user-input/toggle/NeonToggle.es.js +10 -10
  28. package/dist/components/user-input/toggle/NeonToggle.es.js.map +1 -1
  29. package/dist/components/user-input/toggle/NeonToggle.vue.cjs.js +1 -1
  30. package/dist/components/user-input/toggle/NeonToggle.vue.cjs.js.map +1 -1
  31. package/dist/components/user-input/toggle/NeonToggle.vue.es.js +1 -1
  32. package/dist/components/user-input/toggle/NeonToggle.vue.es.js.map +1 -1
  33. package/dist/src/components/layout/page/NeonPage.d.ts +5 -1
  34. package/dist/src/components/layout/side-nav/NeonSideNav.d.ts +5 -1
  35. package/dist/src/components/user-input/search/NeonSearch.d.ts +179 -182
  36. package/dist/src/components/user-input/toggle/NeonToggle.d.ts +1 -1
  37. package/package.json +1 -1
  38. package/src/sass/components/_badge.scss +1 -0
  39. package/src/sass/components/_card.scss +7 -7
  40. package/src/sass/components/_skeleton-loader.scss +3 -4
  41. package/src/sass/components/_slider.scss +1 -1
  42. package/src/sass/components/_toggle.scss +9 -3
  43. package/src/sass/variables.scss +10 -7
@@ -1,2 +1,2 @@
1
- "use strict";const n=require("vue"),s=n.defineComponent({name:"NeonPage",setup(){const e=()=>{const t=window.innerHeight*.01;document.documentElement.style.setProperty("--vh",`${t}rem`);const o=window.innerWidth*.01;document.documentElement.style.setProperty("--vw",`${o}rem`)};n.onMounted(()=>{window.addEventListener("resize",e,{passive:!0}),e()}),n.onUnmounted(()=>{window.removeEventListener("resize",e)})}});module.exports=s;
1
+ "use strict";const n=require("vue"),r=n.defineComponent({name:"NeonPage",setup(i,{slots:t}){const e=()=>{const o=window.innerHeight*.01;document.documentElement.style.setProperty("--vh",`${o}rem`);const s=window.innerWidth*.01;document.documentElement.style.setProperty("--vw",`${s}rem`)};return n.onMounted(()=>{window.addEventListener("resize",e,{passive:!0}),e()}),n.onUnmounted(()=>{window.removeEventListener("resize",e)}),{slots:t}}});module.exports=r;
2
2
  //# sourceMappingURL=NeonPage.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NeonPage.cjs.js","sources":["../../../../src/components/layout/page/NeonPage.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent, onMounted, onUnmounted } from 'vue';\n\n/**\n * A \"page\" component, this is defined as a wrapper around the contents (NeonGrid, etc) and footer which provides the\n * correct responsive layout accounting for NeonTopNav and NeonSideNav components being used.\n */\nexport default defineComponent({\n name: 'NeonPage',\n setup() {\n const handleResize = () => {\n const vh = window.innerHeight * 0.01;\n document.documentElement.style.setProperty('--vh', `${vh}rem`);\n const vw = window.innerWidth * 0.01;\n document.documentElement.style.setProperty('--vw', `${vw}rem`);\n };\n\n onMounted(() => {\n window.addEventListener('resize', handleResize, { passive: true });\n handleResize();\n });\n\n onUnmounted(() => {\n window.removeEventListener('resize', handleResize);\n });\n },\n});\n"],"names":["_sfc_main","defineComponent","handleResize","vh","vw","onMounted","onUnmounted"],"mappings":"oCAMAA,EAAeC,kBAAgB,CAC7B,KAAM,WACN,OAAQ,CACN,MAAMC,EAAe,IAAM,CACzB,MAAMC,EAAK,OAAO,YAAc,IAChC,SAAS,gBAAgB,MAAM,YAAY,OAAQ,GAAGA,CAAE,KAAK,EAC7D,MAAMC,EAAK,OAAO,WAAa,IAC/B,SAAS,gBAAgB,MAAM,YAAY,OAAQ,GAAGA,CAAE,KAAK,CAC/D,EAEAC,EAAAA,UAAU,IAAM,CACd,OAAO,iBAAiB,SAAUH,EAAc,CAAE,QAAS,GAAM,EACjEA,EAAA,CACF,CAAC,EAEDI,EAAAA,YAAY,IAAM,CAChB,OAAO,oBAAoB,SAAUJ,CAAY,CACnD,CAAC,CACH,CACF,CAAC"}
1
+ {"version":3,"file":"NeonPage.cjs.js","sources":["../../../../src/components/layout/page/NeonPage.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent, onMounted, onUnmounted } from 'vue';\n\n/**\n * A \"page\" component, this is defined as a wrapper around the contents (NeonGrid, etc) and footer which provides the\n * correct responsive layout accounting for NeonTopNav and NeonSideNav components being used.\n */\nexport default defineComponent({\n name: 'NeonPage',\n setup(_props, { slots }) {\n const handleResize = () => {\n const vh = window.innerHeight * 0.01;\n document.documentElement.style.setProperty('--vh', `${vh}rem`);\n const vw = window.innerWidth * 0.01;\n document.documentElement.style.setProperty('--vw', `${vw}rem`);\n };\n\n onMounted(() => {\n window.addEventListener('resize', handleResize, { passive: true });\n handleResize();\n });\n\n onUnmounted(() => {\n window.removeEventListener('resize', handleResize);\n });\n\n return { slots };\n },\n});\n"],"names":["_sfc_main","defineComponent","_props","slots","handleResize","vh","vw","onMounted","onUnmounted"],"mappings":"oCAMAA,EAAeC,kBAAgB,CAC7B,KAAM,WACN,MAAMC,EAAQ,CAAE,MAAAC,GAAS,CACvB,MAAMC,EAAe,IAAM,CACzB,MAAMC,EAAK,OAAO,YAAc,IAChC,SAAS,gBAAgB,MAAM,YAAY,OAAQ,GAAGA,CAAE,KAAK,EAC7D,MAAMC,EAAK,OAAO,WAAa,IAC/B,SAAS,gBAAgB,MAAM,YAAY,OAAQ,GAAGA,CAAE,KAAK,CAC/D,EAEAC,OAAAA,EAAAA,UAAU,IAAM,CACd,OAAO,iBAAiB,SAAUH,EAAc,CAAE,QAAS,GAAM,EACjEA,EAAA,CACF,CAAC,EAEDI,EAAAA,YAAY,IAAM,CAChB,OAAO,oBAAoB,SAAUJ,CAAY,CACnD,CAAC,EAEM,CAAE,MAAAD,CAAA,CACX,CACF,CAAC"}
@@ -1,21 +1,21 @@
1
- import { defineComponent as o, onMounted as s, onUnmounted as i } from "vue";
2
- const d = o({
1
+ import { defineComponent as r, onMounted as s, onUnmounted as i } from "vue";
2
+ const u = r({
3
3
  name: "NeonPage",
4
- setup() {
4
+ setup(d, { slots: n }) {
5
5
  const e = () => {
6
- const n = window.innerHeight * 0.01;
7
- document.documentElement.style.setProperty("--vh", `${n}rem`);
8
- const t = window.innerWidth * 0.01;
9
- document.documentElement.style.setProperty("--vw", `${t}rem`);
6
+ const t = window.innerHeight * 0.01;
7
+ document.documentElement.style.setProperty("--vh", `${t}rem`);
8
+ const o = window.innerWidth * 0.01;
9
+ document.documentElement.style.setProperty("--vw", `${o}rem`);
10
10
  };
11
- s(() => {
11
+ return s(() => {
12
12
  window.addEventListener("resize", e, { passive: !0 }), e();
13
13
  }), i(() => {
14
14
  window.removeEventListener("resize", e);
15
- });
15
+ }), { slots: n };
16
16
  }
17
17
  });
18
18
  export {
19
- d as default
19
+ u as default
20
20
  };
21
21
  //# sourceMappingURL=NeonPage.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NeonPage.es.js","sources":["../../../../src/components/layout/page/NeonPage.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent, onMounted, onUnmounted } from 'vue';\n\n/**\n * A \"page\" component, this is defined as a wrapper around the contents (NeonGrid, etc) and footer which provides the\n * correct responsive layout accounting for NeonTopNav and NeonSideNav components being used.\n */\nexport default defineComponent({\n name: 'NeonPage',\n setup() {\n const handleResize = () => {\n const vh = window.innerHeight * 0.01;\n document.documentElement.style.setProperty('--vh', `${vh}rem`);\n const vw = window.innerWidth * 0.01;\n document.documentElement.style.setProperty('--vw', `${vw}rem`);\n };\n\n onMounted(() => {\n window.addEventListener('resize', handleResize, { passive: true });\n handleResize();\n });\n\n onUnmounted(() => {\n window.removeEventListener('resize', handleResize);\n });\n },\n});\n"],"names":["_sfc_main","defineComponent","handleResize","vh","vw","onMounted","onUnmounted"],"mappings":";AAMA,MAAAA,IAAeC,EAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,QAAQ;AACN,UAAMC,IAAe,MAAM;AACzB,YAAMC,IAAK,OAAO,cAAc;AAChC,eAAS,gBAAgB,MAAM,YAAY,QAAQ,GAAGA,CAAE,KAAK;AAC7D,YAAMC,IAAK,OAAO,aAAa;AAC/B,eAAS,gBAAgB,MAAM,YAAY,QAAQ,GAAGA,CAAE,KAAK;AAAA,IAC/D;AAEA,IAAAC,EAAU,MAAM;AACd,aAAO,iBAAiB,UAAUH,GAAc,EAAE,SAAS,IAAM,GACjEA,EAAA;AAAA,IACF,CAAC,GAEDI,EAAY,MAAM;AAChB,aAAO,oBAAoB,UAAUJ,CAAY;AAAA,IACnD,CAAC;AAAA,EACH;AACF,CAAC;"}
1
+ {"version":3,"file":"NeonPage.es.js","sources":["../../../../src/components/layout/page/NeonPage.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent, onMounted, onUnmounted } from 'vue';\n\n/**\n * A \"page\" component, this is defined as a wrapper around the contents (NeonGrid, etc) and footer which provides the\n * correct responsive layout accounting for NeonTopNav and NeonSideNav components being used.\n */\nexport default defineComponent({\n name: 'NeonPage',\n setup(_props, { slots }) {\n const handleResize = () => {\n const vh = window.innerHeight * 0.01;\n document.documentElement.style.setProperty('--vh', `${vh}rem`);\n const vw = window.innerWidth * 0.01;\n document.documentElement.style.setProperty('--vw', `${vw}rem`);\n };\n\n onMounted(() => {\n window.addEventListener('resize', handleResize, { passive: true });\n handleResize();\n });\n\n onUnmounted(() => {\n window.removeEventListener('resize', handleResize);\n });\n\n return { slots };\n },\n});\n"],"names":["_sfc_main","defineComponent","_props","slots","handleResize","vh","vw","onMounted","onUnmounted"],"mappings":";AAMA,MAAAA,IAAeC,EAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,MAAMC,GAAQ,EAAE,OAAAC,KAAS;AACvB,UAAMC,IAAe,MAAM;AACzB,YAAMC,IAAK,OAAO,cAAc;AAChC,eAAS,gBAAgB,MAAM,YAAY,QAAQ,GAAGA,CAAE,KAAK;AAC7D,YAAMC,IAAK,OAAO,aAAa;AAC/B,eAAS,gBAAgB,MAAM,YAAY,QAAQ,GAAGA,CAAE,KAAK;AAAA,IAC/D;AAEA,WAAAC,EAAU,MAAM;AACd,aAAO,iBAAiB,UAAUH,GAAc,EAAE,SAAS,IAAM,GACjEA,EAAA;AAAA,IACF,CAAC,GAEDI,EAAY,MAAM;AAChB,aAAO,oBAAoB,UAAUJ,CAAY;AAAA,IACnD,CAAC,GAEM,EAAE,OAAAD,EAAA;AAAA,EACX;AACF,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";const o=require("./NeonPage.cjs.js"),e=require("vue"),s=require("../../../_virtual/_plugin-vue_export-helper.cjs.js"),t={class:"neon-page__container"};function r(n,l,i,p,c,d){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["neon-page",{"neon-page--with-top-nav":n.$slots["top-nav"],"neon-page--with-side-nav":n.$slots["side-nav"]}])},[e.renderSlot(n.$slots,"top-nav"),e.renderSlot(n.$slots,"side-nav"),e.createElementVNode("div",t,[e.renderSlot(n.$slots,"content")])],2)}const a=s(o,[["render",r]]);module.exports=a;
1
+ "use strict";const o=require("./NeonPage.cjs.js"),e=require("vue"),s=require("../../../_virtual/_plugin-vue_export-helper.cjs.js"),t={class:"neon-page__container"};function r(n,l,i,p,c,d){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([{"neon-page--with-top-nav":n.slots["top-nav"],"neon-page--with-side-nav":n.slots["side-nav"]},"neon-page"])},[e.renderSlot(n.$slots,"top-nav"),e.renderSlot(n.$slots,"side-nav"),e.createElementVNode("div",t,[e.renderSlot(n.$slots,"content")])],2)}const a=s(o,[["render",r]]);module.exports=a;
2
2
  //# sourceMappingURL=NeonPage.vue.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NeonPage.vue.cjs.js","sources":["../../../../src/components/layout/page/NeonPage.vue"],"sourcesContent":["<template>\n <div\n class=\"neon-page\"\n :class=\"{ 'neon-page--with-top-nav': $slots['top-nav'], 'neon-page--with-side-nav': $slots['side-nav'] }\"\n >\n <!-- @slot The <strong>NeonTopNav</strong> slot. This slot is required to ensure the correct responsive page layout. -->\n <slot name=\"top-nav\"></slot>\n <!-- @slot The <strong>NeonSideNav</strong> slot. This slot is required to ensure the correct responsive page layout. -->\n <slot name=\"side-nav\"></slot>\n <div class=\"neon-page__container\">\n <!-- @slot The main page content -->\n <slot name=\"content\"></slot>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" src=\"./NeonPage.ts\"></script>\n"],"names":["_hoisted_1","_createElementBlock","_normalizeClass","_ctx","_renderSlot","_createElementVNode"],"mappings":"mIASSA,EAAA,CAAA,MAAM,sBAAsB,+CARnCC,EAAAA,mBAYM,MAAA,CAXJ,MAAKC,EAAAA,eAAA,CAAC,YAAW,CAAA,0BACoBC,EAAA,6CAA+CA,EAAA,OAAM,UAAA,CAAA,CAAA,CAAA,IAG1FC,aAA4BD,EAAA,OAAA,SAAA,EAE5BC,aAA6BD,EAAA,OAAA,UAAA,EAC7BE,EAAAA,mBAGM,MAHNL,EAGM,CADJI,aAA4BD,EAAA,OAAA,SAAA"}
1
+ {"version":3,"file":"NeonPage.vue.cjs.js","sources":["../../../../src/components/layout/page/NeonPage.vue"],"sourcesContent":["<template>\n <div\n :class=\"{ 'neon-page--with-top-nav': slots['top-nav'], 'neon-page--with-side-nav': slots['side-nav'] }\"\n class=\"neon-page\"\n >\n <!-- @slot The <strong>NeonTopNav</strong> slot. This slot is required to ensure the correct responsive page layout. -->\n <slot name=\"top-nav\"></slot>\n <!-- @slot The <strong>NeonSideNav</strong> slot. This slot is required to ensure the correct responsive page layout. -->\n <slot name=\"side-nav\"></slot>\n <div class=\"neon-page__container\">\n <!-- @slot The main page content -->\n <slot name=\"content\"></slot>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" src=\"./NeonPage.ts\"></script>\n"],"names":["_hoisted_1","_createElementBlock","_normalizeClass","_ctx","_renderSlot","_createElementVNode"],"mappings":"mIASSA,EAAA,CAAA,MAAM,sBAAsB,+CARnCC,EAAAA,mBAYM,MAAA,CAXH,MAAKC,EAAAA,eAAA,CAAA,CAAA,0BAA+BC,EAAA,MAAK,SAAA,EAAA,2BAAyCA,EAAA,mBAC7E,WAAW,CAAA,IAGjBC,aAA4BD,EAAA,OAAA,SAAA,EAE5BC,aAA6BD,EAAA,OAAA,UAAA,EAC7BE,EAAAA,mBAGM,MAHNL,EAGM,CADJI,aAA4BD,EAAA,OAAA,SAAA"}
@@ -2,9 +2,9 @@ import n from "./NeonPage.es.js";
2
2
  import { openBlock as s, createElementBlock as t, normalizeClass as a, renderSlot as o, createElementVNode as r } from "vue";
3
3
  import p from "../../../_virtual/_plugin-vue_export-helper.es.js";
4
4
  const i = { class: "neon-page__container" };
5
- function l(e, c, d, m, $, f) {
5
+ function l(e, c, d, m, f, v) {
6
6
  return s(), t("div", {
7
- class: a(["neon-page", { "neon-page--with-top-nav": e.$slots["top-nav"], "neon-page--with-side-nav": e.$slots["side-nav"] }])
7
+ class: a([{ "neon-page--with-top-nav": e.slots["top-nav"], "neon-page--with-side-nav": e.slots["side-nav"] }, "neon-page"])
8
8
  }, [
9
9
  o(e.$slots, "top-nav"),
10
10
  o(e.$slots, "side-nav"),
@@ -1 +1 @@
1
- {"version":3,"file":"NeonPage.vue.es.js","sources":["../../../../src/components/layout/page/NeonPage.vue"],"sourcesContent":["<template>\n <div\n class=\"neon-page\"\n :class=\"{ 'neon-page--with-top-nav': $slots['top-nav'], 'neon-page--with-side-nav': $slots['side-nav'] }\"\n >\n <!-- @slot The <strong>NeonTopNav</strong> slot. This slot is required to ensure the correct responsive page layout. -->\n <slot name=\"top-nav\"></slot>\n <!-- @slot The <strong>NeonSideNav</strong> slot. This slot is required to ensure the correct responsive page layout. -->\n <slot name=\"side-nav\"></slot>\n <div class=\"neon-page__container\">\n <!-- @slot The main page content -->\n <slot name=\"content\"></slot>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" src=\"./NeonPage.ts\"></script>\n"],"names":["_hoisted_1","_createElementBlock","_normalizeClass","_ctx","_renderSlot","_createElementVNode"],"mappings":";;;AASS,MAAAA,IAAA,EAAA,OAAM,uBAAsB;;cARnCC,EAYM,OAAA;AAAA,IAXJ,OAAKC,EAAA,CAAC,aAAW,EAAA,2BACoBC,EAAA,+CAA+CA,EAAA,OAAM,UAAA,EAAA,CAAA,CAAA;AAAA;IAG1FC,EAA4BD,EAAA,QAAA,SAAA;AAAA,IAE5BC,EAA6BD,EAAA,QAAA,UAAA;AAAA,IAC7BE,EAGM,OAHNL,GAGM;AAAA,MADJI,EAA4BD,EAAA,QAAA,SAAA;AAAA;;;;"}
1
+ {"version":3,"file":"NeonPage.vue.es.js","sources":["../../../../src/components/layout/page/NeonPage.vue"],"sourcesContent":["<template>\n <div\n :class=\"{ 'neon-page--with-top-nav': slots['top-nav'], 'neon-page--with-side-nav': slots['side-nav'] }\"\n class=\"neon-page\"\n >\n <!-- @slot The <strong>NeonTopNav</strong> slot. This slot is required to ensure the correct responsive page layout. -->\n <slot name=\"top-nav\"></slot>\n <!-- @slot The <strong>NeonSideNav</strong> slot. This slot is required to ensure the correct responsive page layout. -->\n <slot name=\"side-nav\"></slot>\n <div class=\"neon-page__container\">\n <!-- @slot The main page content -->\n <slot name=\"content\"></slot>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" src=\"./NeonPage.ts\"></script>\n"],"names":["_hoisted_1","_createElementBlock","_normalizeClass","_ctx","_renderSlot","_createElementVNode"],"mappings":";;;AASS,MAAAA,IAAA,EAAA,OAAM,uBAAsB;;cARnCC,EAYM,OAAA;AAAA,IAXH,OAAKC,EAAA,CAAA,EAAA,2BAA+BC,EAAA,MAAK,SAAA,GAAA,4BAAyCA,EAAA,qBAC7E,WAAW,CAAA;AAAA;IAGjBC,EAA4BD,EAAA,QAAA,SAAA;AAAA,IAE5BC,EAA6BD,EAAA,QAAA,UAAA;AAAA,IAC7BE,EAGM,OAHNL,GAGM;AAAA,MADJI,EAA4BD,EAAA,QAAA,SAAA;AAAA;;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("vue"),n=e.defineComponent({name:"NeonSideNav",props:{fullWidth:{type:Boolean,default:!1}}});module.exports=n;
1
+ "use strict";const t=require("vue"),n=t.defineComponent({name:"NeonSideNav",props:{fullWidth:{type:Boolean,default:!1}},setup(o,{slots:e}){return{slots:e}}});module.exports=n;
2
2
  //# sourceMappingURL=NeonSideNav.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NeonSideNav.cjs.js","sources":["../../../../src/components/layout/side-nav/NeonSideNav.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent } from 'vue';\n\n/**\n * A side navigation component. This is displayed at the <em>larger-than-tablet</em> breakpoint and hidden at\n * <em>tablet</em> and below. Use this to display menus, navigation or other items related to the main page content. A\n * side nave had two slots, one for <em>sticky</em> content which remains visible at all times. The other is for\n * <em>scrolling content</em> which is allowed to overflow below the bottom of the page.\n */\nexport default defineComponent({\n name: 'NeonSideNav',\n props: {\n /**\n * If true, removes the side nav component's padding.\n */\n fullWidth: { type: Boolean, default: false },\n },\n});\n"],"names":["_sfc_main","defineComponent"],"mappings":"oCAQAA,EAAeC,kBAAgB,CAC7B,KAAM,cACN,MAAO,CAIL,UAAW,CAAE,KAAM,QAAS,QAAS,EAAA,CAAM,CAE/C,CAAC"}
1
+ {"version":3,"file":"NeonSideNav.cjs.js","sources":["../../../../src/components/layout/side-nav/NeonSideNav.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent } from 'vue';\n\n/**\n * A side navigation component. This is displayed at the <em>larger-than-tablet</em> breakpoint and hidden at\n * <em>tablet</em> and below. Use this to display menus, navigation or other items related to the main page content. A\n * side nave had two slots, one for <em>sticky</em> content which remains visible at all times. The other is for\n * <em>scrolling content</em> which is allowed to overflow below the bottom of the page.\n */\nexport default defineComponent({\n name: 'NeonSideNav',\n props: {\n /**\n * If true, removes the side nav component's padding.\n */\n fullWidth: { type: Boolean, default: false },\n },\n setup(_props, { slots }) {\n return { slots };\n },\n});\n"],"names":["_sfc_main","defineComponent","_props","slots"],"mappings":"oCAQAA,EAAeC,kBAAgB,CAC7B,KAAM,cACN,MAAO,CAIL,UAAW,CAAE,KAAM,QAAS,QAAS,EAAA,CAAM,EAE7C,MAAMC,EAAQ,CAAE,MAAAC,GAAS,CACvB,MAAO,CAAE,MAAAA,CAAA,CACX,CACF,CAAC"}
@@ -1,14 +1,17 @@
1
- import { defineComponent as e } from "vue";
2
- const a = e({
1
+ import { defineComponent as o } from "vue";
2
+ const p = o({
3
3
  name: "NeonSideNav",
4
4
  props: {
5
5
  /**
6
6
  * If true, removes the side nav component's padding.
7
7
  */
8
8
  fullWidth: { type: Boolean, default: !1 }
9
+ },
10
+ setup(t, { slots: e }) {
11
+ return { slots: e };
9
12
  }
10
13
  });
11
14
  export {
12
- a as default
15
+ p as default
13
16
  };
14
17
  //# sourceMappingURL=NeonSideNav.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NeonSideNav.es.js","sources":["../../../../src/components/layout/side-nav/NeonSideNav.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent } from 'vue';\n\n/**\n * A side navigation component. This is displayed at the <em>larger-than-tablet</em> breakpoint and hidden at\n * <em>tablet</em> and below. Use this to display menus, navigation or other items related to the main page content. A\n * side nave had two slots, one for <em>sticky</em> content which remains visible at all times. The other is for\n * <em>scrolling content</em> which is allowed to overflow below the bottom of the page.\n */\nexport default defineComponent({\n name: 'NeonSideNav',\n props: {\n /**\n * If true, removes the side nav component's padding.\n */\n fullWidth: { type: Boolean, default: false },\n },\n});\n"],"names":["_sfc_main","defineComponent"],"mappings":";AAQA,MAAAA,IAAeC,EAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,WAAW,EAAE,MAAM,SAAS,SAAS,GAAA;AAAA,EAAM;AAE/C,CAAC;"}
1
+ {"version":3,"file":"NeonSideNav.es.js","sources":["../../../../src/components/layout/side-nav/NeonSideNav.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent } from 'vue';\n\n/**\n * A side navigation component. This is displayed at the <em>larger-than-tablet</em> breakpoint and hidden at\n * <em>tablet</em> and below. Use this to display menus, navigation or other items related to the main page content. A\n * side nave had two slots, one for <em>sticky</em> content which remains visible at all times. The other is for\n * <em>scrolling content</em> which is allowed to overflow below the bottom of the page.\n */\nexport default defineComponent({\n name: 'NeonSideNav',\n props: {\n /**\n * If true, removes the side nav component's padding.\n */\n fullWidth: { type: Boolean, default: false },\n },\n setup(_props, { slots }) {\n return { slots };\n },\n});\n"],"names":["_sfc_main","defineComponent","_props","slots"],"mappings":";AAQA,MAAAA,IAAeC,EAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,WAAW,EAAE,MAAM,SAAS,SAAS,GAAA;AAAA,EAAM;AAAA,EAE7C,MAAMC,GAAQ,EAAE,OAAAC,KAAS;AACvB,WAAO,EAAE,OAAAA,EAAA;AAAA,EACX;AACF,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";const s=require("./NeonSideNav.cjs.js"),e=require("vue"),n=require("../../../_virtual/_plugin-vue_export-helper.cjs.js"),t={key:0,class:"neon-side-nav__sticky"},l={key:1},r={key:2,class:"neon-side-nav__scrolling"},c={class:"neon-side-nav__scrolling-container"};function i(o,d,_,u,k,p){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["neon-side-nav",{"neon-side-nav--full-width":o.fullWidth}])},[o.$slots.sticky?(e.openBlock(),e.createElementBlock("div",t,[e.renderSlot(o.$slots,"sticky")])):e.createCommentVNode("",!0),o.$slots.sticky&&o.$slots.scrolling?(e.openBlock(),e.createElementBlock("hr",l)):e.createCommentVNode("",!0),o.$slots.scrolling?(e.openBlock(),e.createElementBlock("div",r,[e.createElementVNode("div",c,[e.renderSlot(o.$slots,"scrolling")])])):e.createCommentVNode("",!0)],2)}const a=n(s,[["render",i]]);module.exports=a;
1
+ "use strict";const s=require("./NeonSideNav.cjs.js"),e=require("vue"),n=require("../../../_virtual/_plugin-vue_export-helper.cjs.js"),t={key:0,class:"neon-side-nav__sticky"},l={key:1},r={key:2,class:"neon-side-nav__scrolling"},c={class:"neon-side-nav__scrolling-container"};function i(o,d,_,u,k,p){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([{"neon-side-nav--full-width":o.fullWidth},"neon-side-nav"])},[o.slots.sticky?(e.openBlock(),e.createElementBlock("div",t,[e.renderSlot(o.$slots,"sticky")])):e.createCommentVNode("",!0),o.slots.sticky&&o.slots.scrolling?(e.openBlock(),e.createElementBlock("hr",l)):e.createCommentVNode("",!0),o.slots.scrolling?(e.openBlock(),e.createElementBlock("div",r,[e.createElementVNode("div",c,[e.renderSlot(o.$slots,"scrolling")])])):e.createCommentVNode("",!0)],2)}const a=n(s,[["render",i]]);module.exports=a;
2
2
  //# sourceMappingURL=NeonSideNav.vue.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NeonSideNav.vue.cjs.js","sources":["../../../../src/components/layout/side-nav/NeonSideNav.vue"],"sourcesContent":["<template>\n <div class=\"neon-side-nav\" :class=\"{ 'neon-side-nav--full-width': fullWidth }\">\n <div v-if=\"$slots.sticky\" class=\"neon-side-nav__sticky\">\n <!-- @slot sticky (fixed, non-scrolling) content -->\n <slot name=\"sticky\"></slot>\n </div>\n <hr v-if=\"$slots.sticky && $slots.scrolling\" />\n <div v-if=\"$slots.scrolling\" class=\"neon-side-nav__scrolling\">\n <!-- @slot scrolling content -->\n <div class=\"neon-side-nav__scrolling-container\">\n <slot name=\"scrolling\"></slot>\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" src=\"./NeonSideNav.ts\"></script>\n"],"names":["_hoisted_4","_createElementBlock","_normalizeClass","_ctx","_openBlock","_hoisted_1","_renderSlot","_hoisted_2","_hoisted_3","_createElementVNode"],"mappings":"+IAE8B,MAAM,4CAKH,MAAM,4BAE5BA,EAAA,CAAA,MAAM,oCAAoC,+CARnDC,EAAAA,mBAYM,MAAA,CAZD,MAAKC,EAAAA,eAAA,CAAC,gBAAe,CAAA,4BAAwCC,EAAA,UAAS,CAAA,IAC9DA,EAAA,OAAO,QAAlBC,EAAAA,YAAAH,EAAAA,mBAGM,MAHNI,EAGM,CADJC,aAA2BH,EAAA,OAAA,QAAA,iCAEnBA,EAAA,OAAO,QAAUA,EAAA,OAAO,yBAAlCF,EAAAA,mBAA+C,KAAAM,CAAA,+BACpCJ,EAAA,OAAO,WAAlBC,EAAAA,YAAAH,EAAAA,mBAKM,MALNO,EAKM,CAHJC,EAAAA,mBAEM,MAFNT,EAEM,CADJM,aAA8BH,EAAA,OAAA,WAAA"}
1
+ {"version":3,"file":"NeonSideNav.vue.cjs.js","sources":["../../../../src/components/layout/side-nav/NeonSideNav.vue"],"sourcesContent":["<template>\n <div :class=\"{ 'neon-side-nav--full-width': fullWidth }\" class=\"neon-side-nav\">\n <div v-if=\"slots.sticky\" class=\"neon-side-nav__sticky\">\n <!-- @slot sticky (fixed, non-scrolling) content -->\n <slot name=\"sticky\"></slot>\n </div>\n <hr v-if=\"slots.sticky && slots.scrolling\" />\n <div v-if=\"slots.scrolling\" class=\"neon-side-nav__scrolling\">\n <!-- @slot scrolling content -->\n <div class=\"neon-side-nav__scrolling-container\">\n <slot name=\"scrolling\"></slot>\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" src=\"./NeonSideNav.ts\"></script>\n"],"names":["_hoisted_4","_createElementBlock","_normalizeClass","_ctx","_openBlock","_hoisted_1","_renderSlot","_hoisted_2","_hoisted_3","_createElementVNode"],"mappings":"+IAE6B,MAAM,4CAKH,MAAM,4BAE3BA,EAAA,CAAA,MAAM,oCAAoC,+CARnDC,EAAAA,mBAYM,MAAA,CAZA,MAAKC,EAAAA,eAAA,CAAA,CAAA,4BAAiCC,EAAA,SAAS,EAAU,eAAe,CAAA,IACjEA,EAAA,MAAM,QAAjBC,EAAAA,YAAAH,EAAAA,mBAGM,MAHNI,EAGM,CADJC,aAA2BH,EAAA,OAAA,QAAA,iCAEnBA,EAAA,MAAM,QAAUA,EAAA,MAAM,yBAAhCF,EAAAA,mBAA6C,KAAAM,CAAA,+BAClCJ,EAAA,MAAM,WAAjBC,EAAAA,YAAAH,EAAAA,mBAKM,MALNO,EAKM,CAHJC,EAAAA,mBAEM,MAFNT,EAEM,CADJM,aAA8BH,EAAA,OAAA,WAAA"}
@@ -8,15 +8,15 @@ const d = {
8
8
  key: 2,
9
9
  class: "neon-side-nav__scrolling"
10
10
  }, m = { class: "neon-side-nav__scrolling-container" };
11
- function f(s, p, v, $, k, u) {
11
+ function f(s, p, v, k, u, h) {
12
12
  return e(), o("div", {
13
- class: l(["neon-side-nav", { "neon-side-nav--full-width": s.fullWidth }])
13
+ class: l([{ "neon-side-nav--full-width": s.fullWidth }, "neon-side-nav"])
14
14
  }, [
15
- s.$slots.sticky ? (e(), o("div", d, [
15
+ s.slots.sticky ? (e(), o("div", d, [
16
16
  t(s.$slots, "sticky")
17
17
  ])) : n("", !0),
18
- s.$slots.sticky && s.$slots.scrolling ? (e(), o("hr", a)) : n("", !0),
19
- s.$slots.scrolling ? (e(), o("div", _, [
18
+ s.slots.sticky && s.slots.scrolling ? (e(), o("hr", a)) : n("", !0),
19
+ s.slots.scrolling ? (e(), o("div", _, [
20
20
  r("div", m, [
21
21
  t(s.$slots, "scrolling")
22
22
  ])
@@ -1 +1 @@
1
- {"version":3,"file":"NeonSideNav.vue.es.js","sources":["../../../../src/components/layout/side-nav/NeonSideNav.vue"],"sourcesContent":["<template>\n <div class=\"neon-side-nav\" :class=\"{ 'neon-side-nav--full-width': fullWidth }\">\n <div v-if=\"$slots.sticky\" class=\"neon-side-nav__sticky\">\n <!-- @slot sticky (fixed, non-scrolling) content -->\n <slot name=\"sticky\"></slot>\n </div>\n <hr v-if=\"$slots.sticky && $slots.scrolling\" />\n <div v-if=\"$slots.scrolling\" class=\"neon-side-nav__scrolling\">\n <!-- @slot scrolling content -->\n <div class=\"neon-side-nav__scrolling-container\">\n <slot name=\"scrolling\"></slot>\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" src=\"./NeonSideNav.ts\"></script>\n"],"names":["_hoisted_4","_createElementBlock","_normalizeClass","_ctx","_openBlock","_hoisted_1","_renderSlot","_hoisted_2","_hoisted_3","_createElementVNode"],"mappings":";;;;;EAE8B,OAAM;;;EAKH,OAAM;GAE5BA,IAAA,EAAA,OAAM,qCAAoC;;cARnDC,EAYM,OAAA;AAAA,IAZD,OAAKC,EAAA,CAAC,iBAAe,EAAA,6BAAwCC,EAAA,WAAS,CAAA;AAAA;IAC9DA,EAAA,OAAO,UAAlBC,KAAAH,EAGM,OAHNI,GAGM;AAAA,MADJC,EAA2BH,EAAA,QAAA,QAAA;AAAA;IAEnBA,EAAA,OAAO,UAAUA,EAAA,OAAO,kBAAlCF,EAA+C,MAAAM,CAAA;IACpCJ,EAAA,OAAO,aAAlBC,KAAAH,EAKM,OALNO,GAKM;AAAA,MAHJC,EAEM,OAFNT,GAEM;AAAA,QADJM,EAA8BH,EAAA,QAAA,WAAA;AAAA;;;;;"}
1
+ {"version":3,"file":"NeonSideNav.vue.es.js","sources":["../../../../src/components/layout/side-nav/NeonSideNav.vue"],"sourcesContent":["<template>\n <div :class=\"{ 'neon-side-nav--full-width': fullWidth }\" class=\"neon-side-nav\">\n <div v-if=\"slots.sticky\" class=\"neon-side-nav__sticky\">\n <!-- @slot sticky (fixed, non-scrolling) content -->\n <slot name=\"sticky\"></slot>\n </div>\n <hr v-if=\"slots.sticky && slots.scrolling\" />\n <div v-if=\"slots.scrolling\" class=\"neon-side-nav__scrolling\">\n <!-- @slot scrolling content -->\n <div class=\"neon-side-nav__scrolling-container\">\n <slot name=\"scrolling\"></slot>\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" src=\"./NeonSideNav.ts\"></script>\n"],"names":["_hoisted_4","_createElementBlock","_normalizeClass","_ctx","_openBlock","_hoisted_1","_renderSlot","_hoisted_2","_hoisted_3","_createElementVNode"],"mappings":";;;;;EAE6B,OAAM;;;EAKH,OAAM;GAE3BA,IAAA,EAAA,OAAM,qCAAoC;;cARnDC,EAYM,OAAA;AAAA,IAZA,OAAKC,EAAA,CAAA,EAAA,6BAAiCC,EAAA,UAAS,GAAU,eAAe,CAAA;AAAA;IACjEA,EAAA,MAAM,UAAjBC,KAAAH,EAGM,OAHNI,GAGM;AAAA,MADJC,EAA2BH,EAAA,QAAA,QAAA;AAAA;IAEnBA,EAAA,MAAM,UAAUA,EAAA,MAAM,kBAAhCF,EAA6C,MAAAM,CAAA;IAClCJ,EAAA,MAAM,aAAjBC,KAAAH,EAKM,OALNO,GAKM;AAAA,MAHJC,EAEM,OAFNT,GAEM;AAAA,QADJM,EAA8BH,EAAA,QAAA,WAAA;AAAA;;;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";const o=require("vue"),A=require("../../../common/enums/NeonSize.cjs.js"),C=require("../../../common/enums/NeonFunctionalColor.cjs.js"),V=require("../../presentation/dropdown/NeonDropdown.vue.cjs.js"),B=require("../../presentation/icon/NeonIcon.vue.cjs.js"),L=require("../input/NeonInput.vue.cjs.js"),z=require("../chip/NeonChip.vue.cjs.js"),i=require("../../../common/enums/NeonDropdownPlacement.cjs.js"),E=require("../../../common/utils/NeonScrollUtils.cjs.js"),T=require("../../../common/enums/NeonInputMode.cjs.js"),U=o.defineComponent({name:"NeonSearch",components:{NeonChip:z,NeonDropdown:V,NeonIcon:B,NeonInput:L},props:{modelValue:{type:[String,Array],required:!0},placeholder:{type:String,required:!0},options:{type:Array,required:!0},multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},size:{type:String,default:A.NeonSize.Medium},color:{type:String,default:C.NeonFunctionalColor.Primary},autocomplete:{type:String,default:"on"},inputmode:{type:String,default:T.NeonInputMode.Text},placement:{type:String,default:i.NeonDropdownPlacement.BottomLeft}},emits:["update:modelValue","filter-changed"],setup(n,{emit:f}){const N=o.useAttrs(),p=o.ref(null),h=o.ref(null),s=o.ref(n.placement),r=o.ref(!1),c=o.ref(null),a=o.ref(-1),d=o.ref("");o.watch(()=>r.value,e=>{e&&n.options.length>0&&(c.value=n.options[0].key,a.value=0)});const S=()=>{switch(s.value){case i.NeonDropdownPlacement.TopLeft:case i.NeonDropdownPlacement.TopRight:case i.NeonDropdownPlacement.LeftBottom:case i.NeonDropdownPlacement.RightBottom:return!0}return!1},k=()=>{var t,l;const e=(l=(t=p.value)==null?void 0:t.dropdownContent)==null?void 0:l.querySelector(".neon-search__option--highlighted");e&&(e.focus(),E.NeonScrollUtils.scrollIntoView(e))},y=(e,t)=>{const l=a.value+e;l>=0&&l<=n.options.length-1&&(a.value=l,c.value=n.options[a.value].key,t.preventDefault(),setTimeout(k))},u=e=>{f("update:modelValue",e)},g=e=>{!n.multiple&&n.modelValue!==""&&u(""),d.value=e,f("filter-changed",e)},v=e=>{if(n.multiple){const t=n.modelValue.map(m=>m),l=t.findIndex(m=>m.key===e.key);l>=0?t.splice(l,1):t.push(e),u(t)}else u(e.key);g(n.multiple?"":e.label.toString())},w=e=>{var t;if(r.value)switch(e.code){case"ArrowUp":case"ArrowDown":{const l=S()?-1:1;e.code==="ArrowUp"?y(-1*l,e):y(1*l,e)}break;case"Enter":case"Space":e.target.classList.contains("neon-search__input")||(v(n.options[a.value]),e.preventDefault());break;case"Tab":document.activeElement!==((t=h.value)==null?void 0:t.neonInput)&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&(r.value=!1);break}},q=e=>{s.value=e};o.onMounted(()=>{document.addEventListener("keydown",w)}),o.onUnmounted(()=>{document.removeEventListener("keydown",w)});const I=o.computed(()=>{const{onFilterChanged:e,...t}=N;return t}),D=e=>{c.value=e,a.value=n.options.findIndex(t=>t.key===e)},b=()=>r.value=!0,P=e=>u(n.modelValue.filter(t=>t.key!==e.key)),x=o.computed(()=>n.multiple?n.options:n.options.filter(e=>e.label!==d.value));return{dropdown:p,searchInput:h,open:r,highlightedKey:c,filter:d,sanitizedAttributes:I,computedOptions:x,dropdownPlacement:s,onPlacement:q,onFilterChange:g,clickOption:v,changeHighlighted:D,showOptions:b,removeSelected:P}}});module.exports=U;
1
+ "use strict";const o=require("vue"),C=require("../../../common/enums/NeonSize.cjs.js"),B=require("../../../common/enums/NeonFunctionalColor.cjs.js"),L=require("../../presentation/dropdown/NeonDropdown.vue.cjs.js"),z=require("../../presentation/icon/NeonIcon.vue.cjs.js"),E=require("../input/NeonInput.vue.cjs.js"),O=require("../chip/NeonChip.vue.cjs.js"),c=require("../../../common/enums/NeonDropdownPlacement.cjs.js"),T=require("../../../common/utils/NeonScrollUtils.cjs.js"),U=require("../../../common/enums/NeonInputMode.cjs.js"),_=o.defineComponent({name:"NeonSearch",components:{NeonChip:O,NeonDropdown:L,NeonIcon:z,NeonInput:E},props:{modelValue:{type:[Object,Array]},placeholder:{type:String,required:!0},options:{type:Array,required:!0},multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},size:{type:String,default:C.NeonSize.Medium},color:{type:String,default:B.NeonFunctionalColor.Primary},autocomplete:{type:String,default:"on"},inputmode:{type:String,default:U.NeonInputMode.Text},placement:{type:String,default:c.NeonDropdownPlacement.BottomLeft}},emits:["update:modelValue","filter-changed"],setup(t,{emit:f}){var N;const k=o.useAttrs(),h=o.ref(null),y=o.ref(null),d=o.ref(t.placement),i=o.ref(!1),u=o.ref(null),a=o.ref(-1),r=o.ref(!t.multiple&&((N=t.modelValue)==null?void 0:N.label)||"");o.watch(()=>i.value,e=>{e&&t.options.length>0&&(u.value=t.options[0].key,a.value=0)}),o.watch(()=>t.modelValue,e=>{t.multiple||(r.value=(e==null?void 0:e.label)||"")});const S=()=>{switch(d.value){case c.NeonDropdownPlacement.TopLeft:case c.NeonDropdownPlacement.TopRight:case c.NeonDropdownPlacement.LeftBottom:case c.NeonDropdownPlacement.RightBottom:return!0}return!1},q=()=>{var n,l;const e=(l=(n=h.value)==null?void 0:n.dropdownContent)==null?void 0:l.querySelector(".neon-search__option--highlighted");e&&(e.focus(),T.NeonScrollUtils.scrollIntoView(e))},g=(e,n)=>{const l=a.value+e;l>=0&&l<=t.options.length-1&&(a.value=l,u.value=t.options[a.value].key,n.preventDefault(),setTimeout(q))},s=e=>{f("update:modelValue",e)},v=e=>{!t.multiple&&t.modelValue&&s(null),r.value=e,f("filter-changed",e)},p=e=>{if(t.multiple){const n=t.modelValue.map(m=>m),l=n.findIndex(m=>m.key===e.key);l>=0?n.splice(l,1):n.push(e),s(n)}else s(e);v(t.multiple?"":e.label.toString())},w=e=>{var n;if(i.value)switch(e.code){case"ArrowUp":case"ArrowDown":{const l=S()?-1:1;e.code==="ArrowUp"?g(-1*l,e):g(1*l,e)}break;case"Enter":case"Space":e.target.classList.contains("neon-search__input")||(p(t.options[a.value]),e.preventDefault());break;case"Tab":document.activeElement!==((n=y.value)==null?void 0:n.neonInput)&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&(i.value=!1);break}},b=e=>{d.value=e};o.onMounted(()=>{document.addEventListener("keydown",w)}),o.onUnmounted(()=>{document.removeEventListener("keydown",w)});const I=o.computed(()=>{const{onFilterChanged:e,...n}=k;return n}),D=e=>{u.value=e,a.value=t.options.findIndex(n=>n.key===e)},A=()=>i.value=!0,P=e=>s(t.modelValue.filter(n=>n.key!==e.key)),V=o.computed(()=>t.multiple?t.options:t.options.filter(e=>e.label!==r.value)),x=o.computed(()=>{var e;return t.multiple&&Array.isArray(t.modelValue)?t.modelValue[0]&&t.modelValue[0].key:((e=t.modelValue)==null?void 0:e.key)||null});return{dropdown:h,searchInput:y,open:i,highlightedKey:u,filter:r,sanitizedAttributes:I,computedOptions:V,dropdownPlacement:d,onPlacement:b,onFilterChange:v,clickOption:p,changeHighlighted:D,showOptions:A,removeSelected:P,activeDescendant:x}}});module.exports=_;
2
2
  //# sourceMappingURL=NeonSearch.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NeonSearch.cjs.js","sources":["../../../../src/components/user-input/search/NeonSearch.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { computed, defineComponent, onMounted, onUnmounted, ref, useAttrs, watch } from 'vue';\nimport { NeonSize } from '@/common/enums/NeonSize';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\nimport NeonDropdown from '@/components/presentation/dropdown/NeonDropdown.vue';\nimport NeonIcon from '@/components/presentation/icon/NeonIcon.vue';\nimport type { NeonSearchOption } from '@/common/models/NeonSearchOption';\nimport NeonInput from '@/components/user-input/input/NeonInput.vue';\nimport NeonChip from '@/components/user-input/chip/NeonChip.vue';\nimport { NeonDropdownPlacement } from '@/common/enums/NeonDropdownPlacement';\nimport { NeonScrollUtils } from '@/common/utils/NeonScrollUtils';\nimport { NeonInputMode } from '@/common/enums/NeonInputMode';\n\n/**\n * <p>\n * The <strong>NeonSearch</strong> component is equivalent to an HTML &lt;input type=\"search\"&gt; element. It is\n * useful as an alternative to <em>NeonSelect</em> to provide filtered results when the universe of results is very\n * large and/or the results need to be requested from a server side API.\n * </p>\n * <p><strong>NeonSearch</strong> provides input chips in the case the search allows multiple selection.</p>\n */\nexport default defineComponent({\n name: 'NeonSearch',\n components: {\n NeonChip,\n NeonDropdown,\n NeonIcon,\n NeonInput,\n },\n props: {\n /**\n * Either a string indicating the key of the selected option ('' if there is no selection) or an array of selected\n * NeonSearchOption in the case when multiple = true (necessary to display them as chips).\n */\n modelValue: { type: [String, Array as () => Array<NeonSearchOption>], required: true },\n /**\n * Placeholder to display in search input when there is no search string entered.\n */\n placeholder: { type: String, required: true },\n /**\n * The list of search results.\n */\n options: { type: Array as () => Array<NeonSearchOption>, required: true },\n /**\n * Allow multi-select.\n */\n multiple: { type: Boolean, default: false },\n /**\n * Disable the search\n */\n disabled: { type: Boolean, default: false },\n /**\n * The size of the dropdown - Small, Medium or Large.\n */\n size: { type: String as () => NeonSize, default: NeonSize.Medium },\n /**\n * The color of the search.\n */\n color: { type: String as () => NeonFunctionalColor, default: NeonFunctionalColor.Primary },\n /**\n * The HTML autocomplete mode as specified <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\">here</a>.\n * NOTE: No enum is provided in Neon as some values can be used in combination, please refer to the full list of values in the preceding link.\n */\n autocomplete: { type: String, default: 'on' },\n /**\n * The HTML input mode as specified <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode\">here</a>.\n * This can be used to simplify populating the filter field, e.g. providing the user's country from their address.\n */\n inputmode: { type: String as () => NeonInputMode, default: NeonInputMode.Text },\n /**\n * Placement of the dropdown contents.\n */\n placement: { type: String as () => NeonDropdownPlacement, default: NeonDropdownPlacement.BottomLeft },\n },\n emits: [\n /**\n * emitted when the user changes the selection.\n * @type {string | NeonSearchOption[]} either the selected option's key (single select) or an array of the\n * selected options (multi-select).\n */\n 'update:modelValue',\n /**\n * emitted when the user types in filter box.\n * @type {string} the current filter criteria. This can be used by the application to filter the displayed options.\n */\n 'filter-changed',\n ],\n setup(props, { emit }) {\n const attrs = useAttrs();\n\n const dropdown = ref<InstanceType<typeof NeonDropdown> | null>(null);\n const searchInput = ref<InstanceType<typeof NeonInput> | null>(null);\n const dropdownPlacement = ref<NeonDropdownPlacement | undefined>(props.placement);\n\n const open = ref(false);\n const highlightedKey = ref<string | null>(null);\n const highlightedIndex = ref(-1);\n const filter = ref('');\n\n watch(\n () => open.value,\n (open: boolean) => {\n if (open && props.options.length > 0) {\n highlightedKey.value = props.options[0].key;\n highlightedIndex.value = 0;\n }\n },\n );\n\n const isReverse = () => {\n switch (dropdownPlacement.value) {\n case NeonDropdownPlacement.TopLeft:\n case NeonDropdownPlacement.TopRight:\n case NeonDropdownPlacement.LeftBottom:\n case NeonDropdownPlacement.RightBottom:\n return true;\n }\n\n return false;\n };\n\n const onNavigate = () => {\n const element: HTMLElement | null = dropdown.value?.dropdownContent?.querySelector(\n '.neon-search__option--highlighted',\n ) as HTMLElement;\n\n if (element) {\n element.focus();\n NeonScrollUtils.scrollIntoView(element);\n }\n };\n\n const navigateBy = (offset: number, $event: KeyboardEvent) => {\n const newIndex = highlightedIndex.value + offset;\n if (newIndex >= 0 && newIndex <= props.options.length - 1) {\n highlightedIndex.value = newIndex;\n highlightedKey.value = props.options[highlightedIndex.value].key;\n $event.preventDefault();\n setTimeout(onNavigate);\n }\n };\n\n const emitInputEvent = (value: string | NeonSearchOption[]) => {\n emit('update:modelValue', value);\n };\n\n const onFilterChange = (_filter: string) => {\n if (!props.multiple && props.modelValue !== '') {\n emitInputEvent('');\n }\n\n filter.value = _filter;\n emit('filter-changed', _filter);\n };\n\n const clickOption = (option: NeonSearchOption) => {\n if (props.multiple) {\n const values = (props.modelValue as NeonSearchOption[]).map((v) => v);\n const index = values.findIndex((v) => v.key === option.key);\n if (index >= 0) {\n values.splice(index, 1);\n } else {\n values.push(option);\n }\n emitInputEvent(values);\n } else {\n emitInputEvent(option.key);\n }\n\n onFilterChange(props.multiple ? '' : option.label.toString());\n };\n\n const keyboardHandler = ($event: KeyboardEvent) => {\n if (open.value) {\n switch ($event.code) {\n case 'ArrowUp':\n case 'ArrowDown':\n {\n const reverseOffset = isReverse() ? -1 : 1;\n if ($event.code === 'ArrowUp') {\n navigateBy(-1 * reverseOffset, $event);\n } else {\n navigateBy(1 * reverseOffset, $event);\n }\n }\n break;\n case 'Enter':\n case 'Space':\n if (!($event.target as HTMLElement).classList.contains('neon-search__input')) {\n clickOption(props.options[highlightedIndex.value]);\n $event.preventDefault();\n }\n break;\n case 'Tab':\n if (\n document.activeElement !== searchInput.value?.neonInput &&\n !$event.ctrlKey &&\n !$event.metaKey &&\n !$event.altKey\n ) {\n open.value = false;\n }\n break;\n }\n }\n };\n\n const onPlacement = (placement: NeonDropdownPlacement) => {\n dropdownPlacement.value = placement;\n };\n\n onMounted(() => {\n document.addEventListener('keydown', keyboardHandler);\n });\n\n onUnmounted(() => {\n document.removeEventListener('keydown', keyboardHandler);\n });\n\n const sanitizedAttributes = computed(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { onFilterChanged, ...sanitized } = attrs;\n return sanitized;\n });\n\n const changeHighlighted = (key: string) => {\n highlightedKey.value = key;\n highlightedIndex.value = props.options.findIndex((opt) => opt.key === key);\n };\n\n const showOptions = () => (open.value = true);\n\n const removeSelected = (removed: NeonSearchOption) =>\n emitInputEvent((props.modelValue as NeonSearchOption[]).filter((v) => v.key !== removed.key));\n\n const computedOptions = computed(() => {\n return props.multiple ? props.options : props.options.filter((opt) => opt.label !== filter.value);\n });\n\n return {\n dropdown,\n searchInput,\n open,\n highlightedKey,\n filter,\n sanitizedAttributes,\n computedOptions,\n dropdownPlacement,\n onPlacement,\n onFilterChange,\n clickOption,\n changeHighlighted,\n showOptions,\n removeSelected,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonChip","NeonDropdown","NeonIcon","NeonInput","NeonSize","NeonFunctionalColor","NeonInputMode","NeonDropdownPlacement","props","emit","attrs","useAttrs","dropdown","ref","searchInput","dropdownPlacement","open","highlightedKey","highlightedIndex","filter","watch","isReverse","onNavigate","element","_b","_a","NeonScrollUtils","navigateBy","offset","$event","newIndex","emitInputEvent","value","onFilterChange","_filter","clickOption","option","values","v","index","keyboardHandler","reverseOffset","onPlacement","placement","onMounted","onUnmounted","sanitizedAttributes","computed","onFilterChanged","sanitized","changeHighlighted","key","opt","showOptions","removeSelected","removed","computedOptions"],"mappings":"qhBAoBAA,EAAeC,kBAAgB,CAC7B,KAAM,aACN,WAAY,CACV,SAAAC,EACA,aAAAC,EACA,SAAAC,EACA,UAAAC,CAAA,EAEF,MAAO,CAKL,WAAY,CAAE,KAAM,CAAC,OAAQ,KAAsC,EAAG,SAAU,EAAA,EAIhF,YAAa,CAAE,KAAM,OAAQ,SAAU,EAAA,EAIvC,QAAS,CAAE,KAAM,MAAwC,SAAU,EAAA,EAInE,SAAU,CAAE,KAAM,QAAS,QAAS,EAAA,EAIpC,SAAU,CAAE,KAAM,QAAS,QAAS,EAAA,EAIpC,KAAM,CAAE,KAAM,OAA0B,QAASC,EAAAA,SAAS,MAAA,EAI1D,MAAO,CAAE,KAAM,OAAqC,QAASC,EAAAA,oBAAoB,OAAA,EAKjF,aAAc,CAAE,KAAM,OAAQ,QAAS,IAAA,EAKvC,UAAW,CAAE,KAAM,OAA+B,QAASC,EAAAA,cAAc,IAAA,EAIzE,UAAW,CAAE,KAAM,OAAuC,QAASC,EAAAA,sBAAsB,UAAA,CAAW,EAEtG,MAAO,CA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,gBAAAC,EAAiB,GAAGC,CAAA,EAAcvC,EAC1C,OAAOuC,CACT,CAAC,EAEKC,EAAqBC,GAAgB,CACzClC,EAAe,MAAQkC,EACvBjC,EAAiB,MAAQV,EAAM,QAAQ,UAAW4C,GAAQA,EAAI,MAAQD,CAAG,CAC3E,EAEME,EAAc,IAAOrC,EAAK,MAAQ,GAElCsC,EAAkBC,GACtBxB,EAAgBvB,EAAM,WAAkC,OAAQ8B,GAAMA,EAAE,MAAQiB,EAAQ,GAAG,CAAC,EAExFC,EAAkBT,EAAAA,SAAS,IACxBvC,EAAM,SAAWA,EAAM,QAAUA,EAAM,QAAQ,OAAQ4C,GAAQA,EAAI,QAAUjC,EAAO,KAAK,CACjG,EAED,MAAO,CACL,SAAAP,EACA,YAAAE,EACA,KAAAE,EACA,eAAAC,EACA,OAAAE,EACA,oBAAA2B,EACA,gBAAAU,EACA,kBAAAzC,EACA,YAAA2B,EACA,eAAAT,EACA,YAAAE,EACA,kBAAAe,EACA,YAAAG,EACA,eAAAC,CAAA,CAEJ,CACF,CAAC"}
1
+ {"version":3,"file":"NeonSearch.cjs.js","sources":["../../../../src/components/user-input/search/NeonSearch.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { computed, defineComponent, onMounted, onUnmounted, ref, useAttrs, watch } from 'vue';\nimport { NeonSize } from '@/common/enums/NeonSize';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\nimport NeonDropdown from '@/components/presentation/dropdown/NeonDropdown.vue';\nimport NeonIcon from '@/components/presentation/icon/NeonIcon.vue';\nimport type { NeonSearchOption } from '@/common/models/NeonSearchOption';\nimport NeonInput from '@/components/user-input/input/NeonInput.vue';\nimport NeonChip from '@/components/user-input/chip/NeonChip.vue';\nimport { NeonDropdownPlacement } from '@/common/enums/NeonDropdownPlacement';\nimport { NeonScrollUtils } from '@/common/utils/NeonScrollUtils';\nimport { NeonInputMode } from '@/common/enums/NeonInputMode';\n\n/**\n * <p>\n * The <strong>NeonSearch</strong> component is equivalent to an HTML &lt;input type=\"search\"&gt; element. It is\n * useful as an alternative to <em>NeonSelect</em> to provide filtered results when the universe of results is very\n * large and/or the results need to be requested from a server side API.\n * </p>\n * <p><strong>NeonSearch</strong> provides input chips in the case the search allows multiple selection.</p>\n */\nexport default defineComponent({\n name: 'NeonSearch',\n components: {\n NeonChip,\n NeonDropdown,\n NeonIcon,\n NeonInput,\n },\n props: {\n /**\n * The selected model value(s). In the case of single select this should be set to a single NeonSearchOption or null.\n * In the case of multiple selection (multiple=true) pass an Array of selected NeonSearchOptions or an empty array\n * if nothing is selected.\n */\n modelValue: { type: [Object as () => NeonSearchOption, Array as () => Array<NeonSearchOption>] },\n /**\n * Placeholder to display in search input when there is no search string entered.\n */\n placeholder: { type: String, required: true },\n /**\n * The list of search results.\n */\n options: { type: Array as () => Array<NeonSearchOption>, required: true },\n /**\n * Allow multi-select.\n */\n multiple: { type: Boolean, default: false },\n /**\n * Disable the search\n */\n disabled: { type: Boolean, default: false },\n /**\n * The size of the dropdown - Small, Medium or Large.\n */\n size: { type: String as () => NeonSize, default: NeonSize.Medium },\n /**\n * The color of the search.\n */\n color: { type: String as () => NeonFunctionalColor, default: NeonFunctionalColor.Primary },\n /**\n * The HTML autocomplete mode as specified <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\">here</a>.\n * NOTE: No enum is provided in Neon as some values can be used in combination, please refer to the full list of values in the preceding link.\n */\n autocomplete: { type: String, default: 'on' },\n /**\n * The HTML input mode as specified <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode\">here</a>.\n * This can be used to simplify populating the filter field, e.g. providing the user's country from their address.\n */\n inputmode: { type: String as () => NeonInputMode, default: NeonInputMode.Text },\n /**\n * Placement of the dropdown contents.\n */\n placement: { type: String as () => NeonDropdownPlacement, default: NeonDropdownPlacement.BottomLeft },\n },\n emits: [\n /**\n * @type {NeonSearchOption | NeonSearchOption[] | null} either the selected option (single select) or an array of\n * the selected options (multi-select). In the case nothing is selected in single select mode <null> is returned &\n * for multiple selection an empty array is returned.\n */\n 'update:modelValue',\n /**\n * emitted when the user types in filter box.\n * @type {string} the current filter criteria. This can be used by the application to filter the displayed options.\n */\n 'filter-changed',\n ],\n setup(props, { emit }) {\n const attrs = useAttrs();\n\n const dropdown = ref<InstanceType<typeof NeonDropdown> | null>(null);\n const searchInput = ref<InstanceType<typeof NeonInput> | null>(null);\n const dropdownPlacement = ref<NeonDropdownPlacement | undefined>(props.placement);\n\n const open = ref(false);\n const highlightedKey = ref<string | null>(null);\n const highlightedIndex = ref(-1);\n\n const filter = ref<string>((!props.multiple && (props.modelValue as NeonSearchOption | null)?.label) || '');\n\n watch(\n () => open.value,\n (open: boolean) => {\n if (open && props.options.length > 0) {\n highlightedKey.value = props.options[0].key;\n highlightedIndex.value = 0;\n }\n },\n );\n\n watch(\n () => props.modelValue,\n (modelValue) => {\n if (!props.multiple) {\n filter.value = (modelValue as NeonSearchOption | null)?.label || '';\n }\n },\n );\n\n const isReverse = () => {\n switch (dropdownPlacement.value) {\n case NeonDropdownPlacement.TopLeft:\n case NeonDropdownPlacement.TopRight:\n case NeonDropdownPlacement.LeftBottom:\n case NeonDropdownPlacement.RightBottom:\n return true;\n }\n\n return false;\n };\n\n const onNavigate = () => {\n const element: HTMLElement | null = dropdown.value?.dropdownContent?.querySelector(\n '.neon-search__option--highlighted',\n ) as HTMLElement;\n\n if (element) {\n element.focus();\n NeonScrollUtils.scrollIntoView(element);\n }\n };\n\n const navigateBy = (offset: number, $event: KeyboardEvent) => {\n const newIndex = highlightedIndex.value + offset;\n if (newIndex >= 0 && newIndex <= props.options.length - 1) {\n highlightedIndex.value = newIndex;\n highlightedKey.value = props.options[highlightedIndex.value].key;\n $event.preventDefault();\n setTimeout(onNavigate);\n }\n };\n\n const emitInputEvent = (value: NeonSearchOption | NeonSearchOption[] | null) => {\n emit('update:modelValue', value);\n };\n\n const onFilterChange = (_filter: string) => {\n if (!props.multiple && props.modelValue) {\n emitInputEvent(null);\n }\n\n filter.value = _filter;\n emit('filter-changed', _filter);\n };\n\n const clickOption = (option: NeonSearchOption) => {\n if (props.multiple) {\n const values = (props.modelValue as NeonSearchOption[]).map((v) => v);\n const index = values.findIndex((v) => v.key === option.key);\n if (index >= 0) {\n values.splice(index, 1);\n } else {\n values.push(option);\n }\n emitInputEvent(values);\n } else {\n emitInputEvent(option);\n }\n\n onFilterChange(props.multiple ? '' : option.label.toString());\n };\n\n const keyboardHandler = ($event: KeyboardEvent) => {\n if (open.value) {\n switch ($event.code) {\n case 'ArrowUp':\n case 'ArrowDown':\n {\n const reverseOffset = isReverse() ? -1 : 1;\n if ($event.code === 'ArrowUp') {\n navigateBy(-1 * reverseOffset, $event);\n } else {\n navigateBy(1 * reverseOffset, $event);\n }\n }\n break;\n case 'Enter':\n case 'Space':\n if (!($event.target as HTMLElement).classList.contains('neon-search__input')) {\n clickOption(props.options[highlightedIndex.value]);\n $event.preventDefault();\n }\n break;\n case 'Tab':\n if (\n document.activeElement !== searchInput.value?.neonInput &&\n !$event.ctrlKey &&\n !$event.metaKey &&\n !$event.altKey\n ) {\n open.value = false;\n }\n break;\n }\n }\n };\n\n const onPlacement = (placement: NeonDropdownPlacement) => {\n dropdownPlacement.value = placement;\n };\n\n onMounted(() => {\n document.addEventListener('keydown', keyboardHandler);\n });\n\n onUnmounted(() => {\n document.removeEventListener('keydown', keyboardHandler);\n });\n\n const sanitizedAttributes = computed(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { onFilterChanged, ...sanitized } = attrs;\n return sanitized;\n });\n\n const changeHighlighted = (key: string) => {\n highlightedKey.value = key;\n highlightedIndex.value = props.options.findIndex((opt) => opt.key === key);\n };\n\n const showOptions = () => (open.value = true);\n\n const removeSelected = (removed: NeonSearchOption) =>\n emitInputEvent((props.modelValue as NeonSearchOption[]).filter((v) => v.key !== removed.key));\n\n const computedOptions = computed(() => {\n return props.multiple ? props.options : props.options.filter((opt) => opt.label !== filter.value);\n });\n\n const activeDescendant = computed(() =>\n props.multiple && Array.isArray(props.modelValue)\n ? props.modelValue[0] && props.modelValue[0].key\n : (props.modelValue as NeonSearchOption)?.key || null,\n );\n\n return {\n dropdown,\n searchInput,\n open,\n highlightedKey,\n filter,\n sanitizedAttributes,\n computedOptions,\n dropdownPlacement,\n onPlacement,\n onFilterChange,\n clickOption,\n changeHighlighted,\n showOptions,\n removeSelected,\n activeDescendant,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonChip","NeonDropdown","NeonIcon","NeonInput","NeonSize","NeonFunctionalColor","NeonInputMode","NeonDropdownPlacement","props","emit","attrs","useAttrs","dropdown","ref","searchInput","dropdownPlacement","open","highlightedKey","highlightedIndex","filter","_a","watch","modelValue","isReverse","onNavigate","element","_b","NeonScrollUtils","navigateBy","offset","$event","newIndex","emitInputEvent","value","onFilterChange","_filter","clickOption","option","values","v","index","keyboardHandler","reverseOffset","onPlacement","placement","onMounted","onUnmounted","sanitizedAttributes","computed","onFilterChanged","sanitized","changeHighlighted","key","opt","showOptions","removeSelected","removed","computedOptions","activeDescendant"],"mappings":"qhBAoBAA,EAAeC,kBAAgB,CAC7B,KAAM,aACN,WAAY,CACV,SAAAC,EACA,aAAAC,EACA,SAAAC,EACA,UAAAC,CAAA,EAEF,MAAO,CAML,WAAY,CAAE,KAAM,CAAC,OAAkC,KAAsC,CAAA,EAI7F,YAAa,CAAE,KAAM,OAAQ,SAAU,EAAA,EAIvC,QAAS,CAAE,KAAM,MAAwC,SAAU,EAAA,EAInE,SAAU,CAAE,KAAM,QAAS,QAAS,EAAA,EAIpC,SAAU,CAAE,KAAM,QAAS,QAAS,EAAA,EAIpC,KAAM,CAAE,KAAM,OAA0B,QAASC,EAAAA,SAAS,MAAA,EAI1D,MAAO,CAAE,KAAM,OAAqC,QAASC,EAAAA,oBAAoB,OAAA,EAKjF,aAAc,CAAE,KAAM,OAAQ,QAAS,IAAA,EAKvC,UAAW,CAAE,KAAM,OAA+B,QAASC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2
- import { NeonSize as q } from "../../../common/enums/NeonSize.es.js";
3
- import { NeonFunctionalColor as z } from "../../../common/enums/NeonFunctionalColor.es.js";
4
- import K from "../../presentation/dropdown/NeonDropdown.vue.es.js";
5
- import O from "../../presentation/icon/NeonIcon.vue.es.js";
6
- import P from "../input/NeonInput.vue.es.js";
7
- import U from "../chip/NeonChip.vue.es.js";
8
- import { NeonDropdownPlacement as r } from "../../../common/enums/NeonDropdownPlacement.es.js";
9
- import { NeonScrollUtils as F } from "../../../common/utils/NeonScrollUtils.es.js";
10
- import { NeonInputMode as M } from "../../../common/enums/NeonInputMode.es.js";
11
- const $ = L({
1
+ import { defineComponent as O, useAttrs as T, ref as l, watch as b, onMounted as _, onUnmounted as z, computed as f } from "vue";
2
+ import { NeonSize as K } from "../../../common/enums/NeonSize.es.js";
3
+ import { NeonFunctionalColor as P } from "../../../common/enums/NeonFunctionalColor.es.js";
4
+ import U from "../../presentation/dropdown/NeonDropdown.vue.es.js";
5
+ import q from "../../presentation/icon/NeonIcon.vue.es.js";
6
+ import F from "../input/NeonInput.vue.es.js";
7
+ import M from "../chip/NeonChip.vue.es.js";
8
+ import { NeonDropdownPlacement as u } from "../../../common/enums/NeonDropdownPlacement.es.js";
9
+ import { NeonScrollUtils as R } from "../../../common/utils/NeonScrollUtils.es.js";
10
+ import { NeonInputMode as H } from "../../../common/enums/NeonInputMode.es.js";
11
+ const te = O({
12
12
  name: "NeonSearch",
13
13
  components: {
14
- NeonChip: U,
15
- NeonDropdown: K,
16
- NeonIcon: O,
17
- NeonInput: P
14
+ NeonChip: M,
15
+ NeonDropdown: U,
16
+ NeonIcon: q,
17
+ NeonInput: F
18
18
  },
19
19
  props: {
20
20
  /**
21
- * Either a string indicating the key of the selected option ('' if there is no selection) or an array of selected
22
- * NeonSearchOption in the case when multiple = true (necessary to display them as chips).
21
+ * The selected model value(s). In the case of single select this should be set to a single NeonSearchOption or null.
22
+ * In the case of multiple selection (multiple=true) pass an Array of selected NeonSearchOptions or an empty array
23
+ * if nothing is selected.
23
24
  */
24
- modelValue: { type: [String, Array], required: !0 },
25
+ modelValue: { type: [Object, Array] },
25
26
  /**
26
27
  * Placeholder to display in search input when there is no search string entered.
27
28
  */
@@ -41,11 +42,11 @@ const $ = L({
41
42
  /**
42
43
  * The size of the dropdown - Small, Medium or Large.
43
44
  */
44
- size: { type: String, default: q.Medium },
45
+ size: { type: String, default: K.Medium },
45
46
  /**
46
47
  * The color of the search.
47
48
  */
48
- color: { type: String, default: z.Primary },
49
+ color: { type: String, default: P.Primary },
49
50
  /**
50
51
  * The HTML autocomplete mode as specified <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values">here</a>.
51
52
  * NOTE: No enum is provided in Neon as some values can be used in combination, please refer to the full list of values in the preceding link.
@@ -55,17 +56,17 @@ const $ = L({
55
56
  * The HTML input mode as specified <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode">here</a>.
56
57
  * This can be used to simplify populating the filter field, e.g. providing the user's country from their address.
57
58
  */
58
- inputmode: { type: String, default: M.Text },
59
+ inputmode: { type: String, default: H.Text },
59
60
  /**
60
61
  * Placement of the dropdown contents.
61
62
  */
62
- placement: { type: String, default: r.BottomLeft }
63
+ placement: { type: String, default: u.BottomLeft }
63
64
  },
64
65
  emits: [
65
66
  /**
66
- * emitted when the user changes the selection.
67
- * @type {string | NeonSearchOption[]} either the selected option's key (single select) or an array of the
68
- * selected options (multi-select).
67
+ * @type {NeonSearchOption | NeonSearchOption[] | null} either the selected option (single select) or an array of
68
+ * the selected options (multi-select). In the case nothing is selected in single select mode <null> is returned &
69
+ * for multiple selection an empty array is returned.
69
70
  */
70
71
  "update:modelValue",
71
72
  /**
@@ -74,95 +75,107 @@ const $ = L({
74
75
  */
75
76
  "filter-changed"
76
77
  ],
77
- setup(o, { emit: f }) {
78
- const S = D(), p = l(null), h = l(null), s = l(o.placement), i = l(!1), u = l(null), a = l(-1), d = l("");
79
- E(
78
+ setup(t, { emit: y }) {
79
+ var S;
80
+ const I = T(), h = l(null), p = l(null), d = l(t.placement), i = l(!1), c = l(null), a = l(-1), r = l(!t.multiple && ((S = t.modelValue) == null ? void 0 : S.label) || "");
81
+ b(
80
82
  () => i.value,
81
83
  (e) => {
82
- e && o.options.length > 0 && (u.value = o.options[0].key, a.value = 0);
84
+ e && t.options.length > 0 && (c.value = t.options[0].key, a.value = 0);
85
+ }
86
+ ), b(
87
+ () => t.modelValue,
88
+ (e) => {
89
+ t.multiple || (r.value = (e == null ? void 0 : e.label) || "");
83
90
  }
84
91
  );
85
- const I = () => {
86
- switch (s.value) {
87
- case r.TopLeft:
88
- case r.TopRight:
89
- case r.LeftBottom:
90
- case r.RightBottom:
92
+ const N = () => {
93
+ switch (d.value) {
94
+ case u.TopLeft:
95
+ case u.TopRight:
96
+ case u.LeftBottom:
97
+ case u.RightBottom:
91
98
  return !0;
92
99
  }
93
100
  return !1;
94
- }, N = () => {
95
- var t, n;
96
- const e = (n = (t = p.value) == null ? void 0 : t.dropdownContent) == null ? void 0 : n.querySelector(
101
+ }, A = () => {
102
+ var n, o;
103
+ const e = (o = (n = h.value) == null ? void 0 : n.dropdownContent) == null ? void 0 : o.querySelector(
97
104
  ".neon-search__option--highlighted"
98
105
  );
99
- e && (e.focus(), F.scrollIntoView(e));
100
- }, y = (e, t) => {
101
- const n = a.value + e;
102
- n >= 0 && n <= o.options.length - 1 && (a.value = n, u.value = o.options[a.value].key, t.preventDefault(), setTimeout(N));
103
- }, c = (e) => {
104
- f("update:modelValue", e);
105
- }, g = (e) => {
106
- !o.multiple && o.modelValue !== "" && c(""), d.value = e, f("filter-changed", e);
106
+ e && (e.focus(), R.scrollIntoView(e));
107
+ }, g = (e, n) => {
108
+ const o = a.value + e;
109
+ o >= 0 && o <= t.options.length - 1 && (a.value = o, c.value = t.options[a.value].key, n.preventDefault(), setTimeout(A));
110
+ }, s = (e) => {
111
+ y("update:modelValue", e);
107
112
  }, v = (e) => {
108
- if (o.multiple) {
109
- const t = o.modelValue.map((m) => m), n = t.findIndex((m) => m.key === e.key);
110
- n >= 0 ? t.splice(n, 1) : t.push(e), c(t);
111
- } else
112
- c(e.key);
113
- g(o.multiple ? "" : e.label.toString());
113
+ !t.multiple && t.modelValue && s(null), r.value = e, y("filter-changed", e);
114
114
  }, w = (e) => {
115
- var t;
115
+ if (t.multiple) {
116
+ const n = t.modelValue.map((m) => m), o = n.findIndex((m) => m.key === e.key);
117
+ o >= 0 ? n.splice(o, 1) : n.push(e), s(n);
118
+ } else
119
+ s(e);
120
+ v(t.multiple ? "" : e.label.toString());
121
+ }, k = (e) => {
122
+ var n;
116
123
  if (i.value)
117
124
  switch (e.code) {
118
125
  case "ArrowUp":
119
126
  case "ArrowDown":
120
127
  {
121
- const n = I() ? -1 : 1;
122
- e.code === "ArrowUp" ? y(-1 * n, e) : y(1 * n, e);
128
+ const o = N() ? -1 : 1;
129
+ e.code === "ArrowUp" ? g(-1 * o, e) : g(1 * o, e);
123
130
  }
124
131
  break;
125
132
  case "Enter":
126
133
  case "Space":
127
- e.target.classList.contains("neon-search__input") || (v(o.options[a.value]), e.preventDefault());
134
+ e.target.classList.contains("neon-search__input") || (w(t.options[a.value]), e.preventDefault());
128
135
  break;
129
136
  case "Tab":
130
- document.activeElement !== ((t = h.value) == null ? void 0 : t.neonInput) && !e.ctrlKey && !e.metaKey && !e.altKey && (i.value = !1);
137
+ document.activeElement !== ((n = p.value) == null ? void 0 : n.neonInput) && !e.ctrlKey && !e.metaKey && !e.altKey && (i.value = !1);
131
138
  break;
132
139
  }
133
- }, b = (e) => {
134
- s.value = e;
140
+ }, V = (e) => {
141
+ d.value = e;
135
142
  };
136
- T(() => {
137
- document.addEventListener("keydown", w);
138
- }), _(() => {
139
- document.removeEventListener("keydown", w);
143
+ _(() => {
144
+ document.addEventListener("keydown", k);
145
+ }), z(() => {
146
+ document.removeEventListener("keydown", k);
140
147
  });
141
- const x = k(() => {
142
- const { onFilterChanged: e, ...t } = S;
143
- return t;
144
- }), A = (e) => {
145
- u.value = e, a.value = o.options.findIndex((t) => t.key === e);
146
- }, V = () => i.value = !0, B = (e) => c(o.modelValue.filter((t) => t.key !== e.key)), C = k(() => o.multiple ? o.options : o.options.filter((e) => e.label !== d.value));
148
+ const x = f(() => {
149
+ const { onFilterChanged: e, ...n } = I;
150
+ return n;
151
+ }), B = (e) => {
152
+ c.value = e, a.value = t.options.findIndex((n) => n.key === e);
153
+ }, C = () => i.value = !0, D = (e) => s(t.modelValue.filter((n) => n.key !== e.key)), L = f(() => t.multiple ? t.options : t.options.filter((e) => e.label !== r.value)), E = f(
154
+ () => {
155
+ var e;
156
+ return t.multiple && Array.isArray(t.modelValue) ? t.modelValue[0] && t.modelValue[0].key : ((e = t.modelValue) == null ? void 0 : e.key) || null;
157
+ }
158
+ );
147
159
  return {
148
- dropdown: p,
149
- searchInput: h,
160
+ dropdown: h,
161
+ searchInput: p,
150
162
  open: i,
151
- highlightedKey: u,
152
- filter: d,
163
+ highlightedKey: c,
164
+ filter: r,
153
165
  sanitizedAttributes: x,
154
- computedOptions: C,
155
- dropdownPlacement: s,
156
- onPlacement: b,
157
- onFilterChange: g,
158
- clickOption: v,
159
- changeHighlighted: A,
160
- showOptions: V,
161
- removeSelected: B
166
+ computedOptions: L,
167
+ dropdownPlacement: d,
168
+ onPlacement: V,
169
+ onFilterChange: v,
170
+ clickOption: w,
171
+ changeHighlighted: B,
172
+ showOptions: C,
173
+ removeSelected: D,
174
+ activeDescendant: E
162
175
  };
163
176
  }
164
177
  });
165
178
  export {
166
- $ as default
179
+ te as default
167
180
  };
168
181
  //# sourceMappingURL=NeonSearch.es.js.map