@aotearoan/neon 18.2.13 → 19.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.
- package/dist/components/navigation/dropdown-menu/NeonDropdownMenu.cjs.js +1 -1
- package/dist/components/navigation/dropdown-menu/NeonDropdownMenu.cjs.js.map +1 -1
- package/dist/components/navigation/dropdown-menu/NeonDropdownMenu.es.js +36 -34
- package/dist/components/navigation/dropdown-menu/NeonDropdownMenu.es.js.map +1 -1
- package/dist/components/navigation/dropdown-menu/NeonDropdownMenu.vue.cjs.js +1 -1
- package/dist/components/navigation/dropdown-menu/NeonDropdownMenu.vue.cjs.js.map +1 -1
- package/dist/components/navigation/dropdown-menu/NeonDropdownMenu.vue.es.js +1 -0
- package/dist/components/navigation/dropdown-menu/NeonDropdownMenu.vue.es.js.map +1 -1
- package/dist/components/navigation/stepper/NeonStepper.cjs.js +1 -1
- package/dist/components/navigation/stepper/NeonStepper.cjs.js.map +1 -1
- package/dist/components/navigation/stepper/NeonStepper.es.js +1 -1
- package/dist/components/navigation/stepper/NeonStepper.es.js.map +1 -1
- package/dist/components/presentation/dropdown/NeonDropdown.cjs.js +1 -1
- package/dist/components/presentation/dropdown/NeonDropdown.cjs.js.map +1 -1
- package/dist/components/presentation/dropdown/NeonDropdown.es.js +18 -18
- package/dist/components/presentation/dropdown/NeonDropdown.es.js.map +1 -1
- package/dist/components/user-input/button/NeonButton.cjs.js +1 -1
- package/dist/components/user-input/button/NeonButton.cjs.js.map +1 -1
- package/dist/components/user-input/button/NeonButton.es.js +1 -1
- package/dist/components/user-input/button/NeonButton.es.js.map +1 -1
- package/dist/components/user-input/chip/NeonChip.cjs.js +1 -1
- package/dist/components/user-input/chip/NeonChip.cjs.js.map +1 -1
- package/dist/components/user-input/chip/NeonChip.es.js +6 -6
- package/dist/components/user-input/chip/NeonChip.es.js.map +1 -1
- package/dist/components/user-input/color/NeonColor.cjs.js +1 -1
- package/dist/components/user-input/color/NeonColor.cjs.js.map +1 -1
- package/dist/components/user-input/color/NeonColor.es.js +8 -8
- package/dist/components/user-input/color/NeonColor.es.js.map +1 -1
- package/dist/components/user-input/date-picker/NeonDatePicker.vue.cjs.js +1 -1
- package/dist/components/user-input/date-picker/NeonDatePicker.vue.cjs.js.map +1 -1
- package/dist/components/user-input/date-picker/NeonDatePicker.vue.es.js +15 -13
- package/dist/components/user-input/date-picker/NeonDatePicker.vue.es.js.map +1 -1
- package/dist/components/user-input/file/NeonFile.cjs.js +1 -1
- package/dist/components/user-input/file/NeonFile.cjs.js.map +1 -1
- package/dist/components/user-input/file/NeonFile.es.js +6 -6
- package/dist/components/user-input/file/NeonFile.es.js.map +1 -1
- package/dist/components/user-input/input/NeonInput.cjs.js +1 -1
- package/dist/components/user-input/input/NeonInput.cjs.js.map +1 -1
- package/dist/components/user-input/input/NeonInput.es.js +37 -32
- package/dist/components/user-input/input/NeonInput.es.js.map +1 -1
- package/dist/components/user-input/input/NeonInput.vue.cjs.js +1 -1
- package/dist/components/user-input/input/NeonInput.vue.cjs.js.map +1 -1
- package/dist/components/user-input/input/NeonInput.vue.es.js +21 -19
- package/dist/components/user-input/input/NeonInput.vue.es.js.map +1 -1
- package/dist/components/user-input/number/NeonNumber.cjs.js +1 -1
- package/dist/components/user-input/number/NeonNumber.cjs.js.map +1 -1
- package/dist/components/user-input/number/NeonNumber.es.js +10 -10
- package/dist/components/user-input/number/NeonNumber.es.js.map +1 -1
- package/dist/components/user-input/range-slider/NeonRangeSlider.cjs.js +1 -1
- package/dist/components/user-input/range-slider/NeonRangeSlider.cjs.js.map +1 -1
- package/dist/components/user-input/range-slider/NeonRangeSlider.es.js +5 -5
- package/dist/components/user-input/range-slider/NeonRangeSlider.es.js.map +1 -1
- package/dist/components/user-input/search/NeonSearch.cjs.js +1 -1
- package/dist/components/user-input/search/NeonSearch.cjs.js.map +1 -1
- package/dist/components/user-input/search/NeonSearch.es.js +60 -45
- package/dist/components/user-input/search/NeonSearch.es.js.map +1 -1
- package/dist/components/user-input/search/NeonSearch.vue.cjs.js +1 -1
- package/dist/components/user-input/search/NeonSearch.vue.cjs.js.map +1 -1
- package/dist/components/user-input/search/NeonSearch.vue.es.js +15 -11
- package/dist/components/user-input/search/NeonSearch.vue.es.js.map +1 -1
- package/dist/components/user-input/select/NeonSelect.cjs.js +1 -1
- package/dist/components/user-input/select/NeonSelect.cjs.js.map +1 -1
- package/dist/components/user-input/select/NeonSelect.es.js +58 -56
- package/dist/components/user-input/select/NeonSelect.es.js.map +1 -1
- package/dist/components/user-input/select/NeonSelect.vue.cjs.js +1 -1
- package/dist/components/user-input/select/NeonSelect.vue.cjs.js.map +1 -1
- package/dist/components/user-input/select/NeonSelect.vue.es.js +1 -0
- package/dist/components/user-input/select/NeonSelect.vue.es.js.map +1 -1
- package/dist/components/user-input/slider/NeonSlider.cjs.js +1 -1
- package/dist/components/user-input/slider/NeonSlider.cjs.js.map +1 -1
- package/dist/components/user-input/slider/NeonSlider.es.js +4 -4
- package/dist/components/user-input/slider/NeonSlider.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 +4 -4
- package/dist/components/user-input/toggle/NeonToggle.es.js.map +1 -1
- package/dist/src/components/layout/card-list/NeonCardList.d.ts +0 -6
- package/dist/src/components/navigation/dropdown-menu/NeonDropdownMenu.d.ts +1505 -1
- package/dist/src/components/navigation/menu/NeonMenu.d.ts +1511 -31
- package/dist/src/components/presentation/dropdown/NeonDropdown.d.ts +12 -3
- package/dist/src/components/user-input/chip/NeonChip.d.ts +0 -10
- package/dist/src/components/user-input/color/NeonColor.d.ts +9 -0
- package/dist/src/components/user-input/date-picker/NeonDatePicker.d.ts +43 -62
- package/dist/src/components/user-input/file/NeonFile.d.ts +21 -8
- package/dist/src/components/user-input/input/NeonInput.d.ts +17 -0
- package/dist/src/components/user-input/number/NeonNumber.d.ts +51 -18
- package/dist/src/components/user-input/password/NeonPassword.d.ts +9 -0
- package/dist/src/components/user-input/search/NeonSearch.d.ts +2271 -28
- package/dist/src/components/user-input/select/NeonSelect.d.ts +1623 -38
- package/package.json +1 -1
- package/src/sass/components/_badge.scss +1 -3
- package/src/sass/components/_button.scss +3 -2
- package/src/sass/components/_drawer.scss +1 -1
- package/src/sass/components/_dropdown-menu.scss +1 -0
- package/src/sass/components/_dropdown.scss +1 -1
- package/src/sass/components/_input.scss +2 -11
- package/src/sass/components/_search.scss +7 -2
- package/src/sass/components/_select.scss +1 -0
- package/src/sass/variables.scss +12 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const n=require("vue"),q=require("../../../common/enums/NeonSize.cjs.js"),D=require("../../../common/enums/NeonFunctionalColor.cjs.js"),S=require("../../presentation/dropdown/NeonDropdown.vue.cjs.js"),s=require("../../../common/enums/NeonDropdownPlacement.cjs.js"),P=require("../../../common/utils/NeonScrollUtils.cjs.js"),B=require("../../presentation/icon/NeonIcon.vue.cjs.js"),
|
|
1
|
+
"use strict";const n=require("vue"),q=require("../../../common/enums/NeonSize.cjs.js"),D=require("../../../common/enums/NeonFunctionalColor.cjs.js"),S=require("../../presentation/dropdown/NeonDropdown.vue.cjs.js"),s=require("../../../common/enums/NeonDropdownPlacement.cjs.js"),P=require("../../../common/utils/NeonScrollUtils.cjs.js"),B=require("../../presentation/icon/NeonIcon.vue.cjs.js"),C=require("../link/NeonLink.vue.cjs.js"),I=n.defineComponent({name:"NeonDropdownMenu",components:{NeonDropdown:S,NeonIcon:B,NeonLink:C},props:{model:{type:Array,required:!0},size:{type:String,default:q.NeonSize.Medium},color:{type:String,default:D.NeonFunctionalColor.LowContrast},disabled:{type:Boolean,default:!1},openOnHover:{type:Boolean,default:!1}},emits:["click","button-ref"],setup(t,{emit:d}){const h=n.useAttrs(),f=n.ref(null),m=n.ref(null),v=n.ref([]),r=n.ref(!1),c=n.ref(null),l=n.ref(-1),y=e=>{c.value=e,l.value=t.model.findIndex(o=>o.key===e)},g=e=>{m.value=e},p=()=>{switch(m.value){case s.NeonDropdownPlacement.TopLeft:case s.NeonDropdownPlacement.TopRight:case s.NeonDropdownPlacement.LeftBottom:case s.NeonDropdownPlacement.RightBottom:return!0}return!1},N=()=>{var o,a;const e=(a=(o=f.value)==null?void 0:o.dropdownContent)==null?void 0:a.querySelector(".neon-dropdown-menu__item--highlighted");e&&(e.focus(),P.NeonScrollUtils.scrollIntoView(e))},u=(e,o)=>{const a=l.value+e;a>=0&&a<=t.model.length-1&&(l.value=a,c.value=t.model[l.value].key,o.preventDefault(),setTimeout(N))},i=e=>{if(!t.disabled&&r.value)switch(e.code){case"ArrowUp":case"ArrowDown":{const o=p()?-1:1;e.code==="ArrowUp"?u(-1*o,e):u(1*o,e)}break;case"Enter":case"Space":t.model[l.value]&&!t.model[l.value].disabled&&(w(t.model[l.value]),e.preventDefault());break;case"Tab":!e.ctrlKey&&!e.metaKey&&!e.altKey&&(r.value=!1);break;case"Escape":r.value=!1;break}},w=e=>{var o;if(!e.disabled){if(e.href){const a=(o=v.value[l.value])==null?void 0:o.firstElementChild;a&&a.click()}else d("click",e);r.value=!1}},k=()=>{t.openOnHover&&(r.value=!0)},b=()=>{t.openOnHover&&(r.value=!1)};return n.onMounted(()=>{document.addEventListener("keydown",i)}),n.onUnmounted(()=>{document.removeEventListener("keydown",i)}),n.watch(()=>r.value,e=>{e&&(c.value=t.model[0].key,l.value=0)}),{dropdown:f,items:v,open:r,highlightedKey:c,highlightedIndex:l,attrs:h,emit:d,changeHighlighted:y,keyboardHandler:i,onBlur:b,onFocus:k,clickItem:w,navigateBy:u,onPlacement:g}}});module.exports=I;
|
|
2
2
|
//# sourceMappingURL=NeonDropdownMenu.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonDropdownMenu.cjs.js","sources":["../../../../src/components/navigation/dropdown-menu/NeonDropdownMenu.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent, onMounted, onUnmounted, ref, useAttrs, watch } from 'vue';\nimport type { NeonDropdownMenuItem } from '@/common/models/NeonDropdownMenuItem';\nimport { NeonSize } from '@/common/enums/NeonSize';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\nimport NeonDropdown from '@/components/presentation/dropdown/NeonDropdown.vue';\nimport { NeonDropdownPlacement } from '@/common/enums/NeonDropdownPlacement';\nimport { NeonScrollUtils } from '@/common/utils/NeonScrollUtils';\nimport NeonIcon from '@/components/presentation/icon/NeonIcon.vue';\nimport NeonLink from '@/components/navigation/link/NeonLink.vue';\n\n/**\n * <p>A dropdown menu consisting of a button to open the menu and a list of menu items. Clicking on a menu item will\n * result in navigating to the provided URL or notifying the parent component via the @click event.</p>\n * <p><strong>Note:</strong> As well as the options described below, pass through attributes supported by\n * <a href=\"/presentation/dropdown\">NeonDropdown</a> to change the style of the dropdown button.</p>\n */\nexport default defineComponent({\n name: 'NeonDropdownMenu',\n components: {\n NeonDropdown,\n NeonIcon,\n NeonLink,\n },\n props: {\n /**\n * A list of menu items to render in the dropdown menu.\n */\n model: { type: Array as () => Array<NeonDropdownMenuItem>, required: true },\n /**\n * The size of the dropdown - Small, Medium or Large.\n */\n size: { type: String as () => NeonSize, default: NeonSize.Medium },\n /**\n * The dropdown color.\n */\n color: { type: String as () => NeonFunctionalColor, default: NeonFunctionalColor.LowContrast },\n /**\n * Whether the dropdown button is disabled or not.\n */\n disabled: { type: Boolean, default: false },\n /**\n * Instead of opening on click (default), open on hover.\n */\n openOnHover: { type: Boolean, default: false },\n },\n emits: [\n /**\n * emitted when the user clicks on a menu item.\n * @type {NeonDropdownMenuItem} the menu item the user clicked on.\n */\n 'click',\n /**\n * emitted on initialisation\n * @type {HTMLElement} the reference to the HTMLElement for the dropdown menu button.\n */\n 'button-ref',\n ],\n setup(props, { emit }) {\n const attrs = useAttrs();\n const dropdown = ref<
|
|
1
|
+
{"version":3,"file":"NeonDropdownMenu.cjs.js","sources":["../../../../src/components/navigation/dropdown-menu/NeonDropdownMenu.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent, onMounted, onUnmounted, ref, useAttrs, watch } from 'vue';\nimport type { NeonDropdownMenuItem } from '@/common/models/NeonDropdownMenuItem';\nimport { NeonSize } from '@/common/enums/NeonSize';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\nimport NeonDropdown from '@/components/presentation/dropdown/NeonDropdown.vue';\nimport { NeonDropdownPlacement } from '@/common/enums/NeonDropdownPlacement';\nimport { NeonScrollUtils } from '@/common/utils/NeonScrollUtils';\nimport NeonIcon from '@/components/presentation/icon/NeonIcon.vue';\nimport NeonLink from '@/components/navigation/link/NeonLink.vue';\n\n/**\n * <p>A dropdown menu consisting of a button to open the menu and a list of menu items. Clicking on a menu item will\n * result in navigating to the provided URL or notifying the parent component via the @click event.</p>\n * <p><strong>Note:</strong> As well as the options described below, pass through attributes supported by\n * <a href=\"/presentation/dropdown\">NeonDropdown</a> to change the style of the dropdown button.</p>\n */\nexport default defineComponent({\n name: 'NeonDropdownMenu',\n components: {\n NeonDropdown,\n NeonIcon,\n NeonLink,\n },\n props: {\n /**\n * A list of menu items to render in the dropdown menu.\n */\n model: { type: Array as () => Array<NeonDropdownMenuItem>, required: true },\n /**\n * The size of the dropdown - Small, Medium or Large.\n */\n size: { type: String as () => NeonSize, default: NeonSize.Medium },\n /**\n * The dropdown color.\n */\n color: { type: String as () => NeonFunctionalColor, default: NeonFunctionalColor.LowContrast },\n /**\n * Whether the dropdown button is disabled or not.\n */\n disabled: { type: Boolean, default: false },\n /**\n * Instead of opening on click (default), open on hover.\n */\n openOnHover: { type: Boolean, default: false },\n },\n emits: [\n /**\n * emitted when the user clicks on a menu item.\n * @type {NeonDropdownMenuItem} the menu item the user clicked on.\n */\n 'click',\n /**\n * emitted on initialisation\n * @type {HTMLElement} the reference to the HTMLElement for the dropdown menu button.\n */\n 'button-ref',\n ],\n setup(props, { emit }) {\n const attrs = useAttrs();\n const dropdown = ref<InstanceType<typeof NeonDropdown> | null>(null);\n const dropdownPlacement = ref<NeonDropdownPlacement | null>(null);\n const items = ref<Array<HTMLLIElement>>([]);\n const open = ref(false);\n const highlightedKey = ref<string | null>(null);\n const highlightedIndex = ref(-1);\n\n const changeHighlighted = (key: string) => {\n highlightedKey.value = key;\n highlightedIndex.value = props.model.findIndex((item) => item.key === key);\n };\n\n const onPlacement = (placement: NeonDropdownPlacement) => {\n dropdownPlacement.value = placement;\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-dropdown-menu__item--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.model.length - 1) {\n highlightedIndex.value = newIndex;\n highlightedKey.value = props.model[highlightedIndex.value].key;\n $event.preventDefault();\n setTimeout(onNavigate);\n }\n };\n\n const keyboardHandler = ($event: KeyboardEvent) => {\n if (!props.disabled) {\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 (props.model[highlightedIndex.value] && !props.model[highlightedIndex.value].disabled) {\n clickItem(props.model[highlightedIndex.value]);\n $event.preventDefault();\n }\n break;\n case 'Tab':\n if (!$event.ctrlKey && !$event.metaKey && !$event.altKey) {\n open.value = false;\n }\n break;\n case 'Escape':\n open.value = false;\n break;\n }\n }\n }\n };\n\n const clickItem = (item: NeonDropdownMenuItem) => {\n if (!item.disabled) {\n if (item.href) {\n const anchor = items.value[highlightedIndex.value]?.firstElementChild as HTMLAnchorElement;\n anchor && anchor.click();\n } else {\n emit('click', item);\n }\n open.value = false;\n }\n };\n\n const onFocus = () => {\n if (props.openOnHover) {\n open.value = true;\n }\n };\n\n const onBlur = () => {\n if (props.openOnHover) {\n open.value = false;\n }\n };\n\n onMounted(() => {\n document.addEventListener('keydown', keyboardHandler);\n });\n\n onUnmounted(() => {\n document.removeEventListener('keydown', keyboardHandler);\n });\n\n watch(\n () => open.value,\n (open: boolean) => {\n if (open) {\n highlightedKey.value = props.model[0].key;\n highlightedIndex.value = 0;\n }\n },\n );\n\n return {\n dropdown,\n items,\n open,\n highlightedKey,\n highlightedIndex,\n attrs,\n emit,\n changeHighlighted,\n keyboardHandler,\n onBlur,\n onFocus,\n clickItem,\n navigateBy,\n onPlacement,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonDropdown","NeonIcon","NeonLink","NeonSize","NeonFunctionalColor","props","emit","attrs","useAttrs","dropdown","ref","dropdownPlacement","items","open","highlightedKey","highlightedIndex","changeHighlighted","key","item","onPlacement","placement","isReverse","NeonDropdownPlacement","onNavigate","element","_b","_a","NeonScrollUtils","navigateBy","offset","$event","newIndex","keyboardHandler","reverseOffset","clickItem","anchor","onFocus","onBlur","onMounted","onUnmounted","watch"],"mappings":"kbAgBAA,EAAeC,kBAAgB,CAC7B,KAAM,mBACN,WAAY,CACV,aAAAC,EACA,SAAAC,EACA,SAAAC,CAAA,EAEF,MAAO,CAIL,MAAO,CAAE,KAAM,MAA4C,SAAU,EAAA,EAIrE,KAAM,CAAE,KAAM,OAA0B,QAASC,EAAAA,SAAS,MAAA,EAI1D,MAAO,CAAE,KAAM,OAAqC,QAASC,EAAAA,oBAAoB,WAAA,EAIjF,SAAU,CAAE,KAAM,QAAS,QAAS,EAAA,EAIpC,YAAa,CAAE,KAAM,Q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OAAAK,EACA,QAAAD,EACA,UAAAF,EACA,WAAAN,EACA,YAAAT,CAAA,CAEJ,CACF,CAAC"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { defineComponent as B, useAttrs as D, ref as r, onMounted as I, onUnmounted as L, watch as S } from "vue";
|
|
2
2
|
import { NeonSize as A } from "../../../common/enums/NeonSize.es.js";
|
|
3
|
-
import { NeonFunctionalColor as
|
|
4
|
-
import
|
|
3
|
+
import { NeonFunctionalColor as C } from "../../../common/enums/NeonFunctionalColor.es.js";
|
|
4
|
+
import E from "../../presentation/dropdown/NeonDropdown.vue.es.js";
|
|
5
5
|
import { NeonDropdownPlacement as s } from "../../../common/enums/NeonDropdownPlacement.es.js";
|
|
6
|
-
import { NeonScrollUtils as
|
|
6
|
+
import { NeonScrollUtils as H } from "../../../common/utils/NeonScrollUtils.es.js";
|
|
7
7
|
import x from "../../presentation/icon/NeonIcon.vue.es.js";
|
|
8
|
-
import
|
|
8
|
+
import K from "../link/NeonLink.vue.es.js";
|
|
9
9
|
const z = B({
|
|
10
10
|
name: "NeonDropdownMenu",
|
|
11
11
|
components: {
|
|
12
|
-
NeonDropdown:
|
|
12
|
+
NeonDropdown: E,
|
|
13
13
|
NeonIcon: x,
|
|
14
|
-
NeonLink:
|
|
14
|
+
NeonLink: K
|
|
15
15
|
},
|
|
16
16
|
props: {
|
|
17
17
|
/**
|
|
@@ -25,7 +25,7 @@ const z = B({
|
|
|
25
25
|
/**
|
|
26
26
|
* The dropdown color.
|
|
27
27
|
*/
|
|
28
|
-
color: { type: String, default:
|
|
28
|
+
color: { type: String, default: C.LowContrast },
|
|
29
29
|
/**
|
|
30
30
|
* Whether the dropdown button is disabled or not.
|
|
31
31
|
*/
|
|
@@ -47,9 +47,9 @@ const z = B({
|
|
|
47
47
|
*/
|
|
48
48
|
"button-ref"
|
|
49
49
|
],
|
|
50
|
-
setup(
|
|
51
|
-
const p = D(), f = r(null), m = r(null), v = r([]),
|
|
52
|
-
c.value = e,
|
|
50
|
+
setup(n, { emit: u }) {
|
|
51
|
+
const p = D(), f = r(null), m = r(null), v = r([]), a = r(!1), c = r(null), t = r(-1), w = (e) => {
|
|
52
|
+
c.value = e, t.value = n.model.findIndex((o) => o.key === e);
|
|
53
53
|
}, y = (e) => {
|
|
54
54
|
m.value = e;
|
|
55
55
|
}, g = () => {
|
|
@@ -62,14 +62,16 @@ const z = B({
|
|
|
62
62
|
}
|
|
63
63
|
return !1;
|
|
64
64
|
}, k = () => {
|
|
65
|
-
var o;
|
|
66
|
-
const e = (o = f.value) == null ? void 0 : o.querySelector(
|
|
67
|
-
|
|
65
|
+
var o, l;
|
|
66
|
+
const e = (l = (o = f.value) == null ? void 0 : o.dropdownContent) == null ? void 0 : l.querySelector(
|
|
67
|
+
".neon-dropdown-menu__item--highlighted"
|
|
68
|
+
);
|
|
69
|
+
e && (e.focus(), H.scrollIntoView(e));
|
|
68
70
|
}, i = (e, o) => {
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
},
|
|
72
|
-
if (!
|
|
71
|
+
const l = t.value + e;
|
|
72
|
+
l >= 0 && l <= n.model.length - 1 && (t.value = l, c.value = n.model[t.value].key, o.preventDefault(), setTimeout(k));
|
|
73
|
+
}, d = (e) => {
|
|
74
|
+
if (!n.disabled && a.value)
|
|
73
75
|
switch (e.code) {
|
|
74
76
|
case "ArrowUp":
|
|
75
77
|
case "ArrowDown":
|
|
@@ -80,49 +82,49 @@ const z = B({
|
|
|
80
82
|
break;
|
|
81
83
|
case "Enter":
|
|
82
84
|
case "Space":
|
|
83
|
-
|
|
85
|
+
n.model[t.value] && !n.model[t.value].disabled && (h(n.model[t.value]), e.preventDefault());
|
|
84
86
|
break;
|
|
85
87
|
case "Tab":
|
|
86
|
-
!e.ctrlKey && !e.metaKey && !e.altKey && (
|
|
88
|
+
!e.ctrlKey && !e.metaKey && !e.altKey && (a.value = !1);
|
|
87
89
|
break;
|
|
88
90
|
case "Escape":
|
|
89
|
-
|
|
91
|
+
a.value = !1;
|
|
90
92
|
break;
|
|
91
93
|
}
|
|
92
94
|
}, h = (e) => {
|
|
93
95
|
var o;
|
|
94
96
|
if (!e.disabled) {
|
|
95
97
|
if (e.href) {
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
+
const l = (o = v.value[t.value]) == null ? void 0 : o.firstElementChild;
|
|
99
|
+
l && l.click();
|
|
98
100
|
} else
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
u("click", e);
|
|
102
|
+
a.value = !1;
|
|
101
103
|
}
|
|
102
104
|
}, b = () => {
|
|
103
|
-
|
|
105
|
+
n.openOnHover && (a.value = !0);
|
|
104
106
|
}, N = () => {
|
|
105
|
-
|
|
107
|
+
n.openOnHover && (a.value = !1);
|
|
106
108
|
};
|
|
107
109
|
return I(() => {
|
|
108
|
-
document.addEventListener("keydown",
|
|
110
|
+
document.addEventListener("keydown", d);
|
|
109
111
|
}), L(() => {
|
|
110
|
-
document.removeEventListener("keydown",
|
|
112
|
+
document.removeEventListener("keydown", d);
|
|
111
113
|
}), S(
|
|
112
|
-
() =>
|
|
114
|
+
() => a.value,
|
|
113
115
|
(e) => {
|
|
114
|
-
e && (c.value =
|
|
116
|
+
e && (c.value = n.model[0].key, t.value = 0);
|
|
115
117
|
}
|
|
116
118
|
), {
|
|
117
119
|
dropdown: f,
|
|
118
120
|
items: v,
|
|
119
|
-
open:
|
|
121
|
+
open: a,
|
|
120
122
|
highlightedKey: c,
|
|
121
|
-
highlightedIndex:
|
|
123
|
+
highlightedIndex: t,
|
|
122
124
|
attrs: p,
|
|
123
|
-
emit:
|
|
125
|
+
emit: u,
|
|
124
126
|
changeHighlighted: w,
|
|
125
|
-
keyboardHandler:
|
|
127
|
+
keyboardHandler: d,
|
|
126
128
|
onBlur: N,
|
|
127
129
|
onFocus: b,
|
|
128
130
|
clickItem: h,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonDropdownMenu.es.js","sources":["../../../../src/components/navigation/dropdown-menu/NeonDropdownMenu.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent, onMounted, onUnmounted, ref, useAttrs, watch } from 'vue';\nimport type { NeonDropdownMenuItem } from '@/common/models/NeonDropdownMenuItem';\nimport { NeonSize } from '@/common/enums/NeonSize';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\nimport NeonDropdown from '@/components/presentation/dropdown/NeonDropdown.vue';\nimport { NeonDropdownPlacement } from '@/common/enums/NeonDropdownPlacement';\nimport { NeonScrollUtils } from '@/common/utils/NeonScrollUtils';\nimport NeonIcon from '@/components/presentation/icon/NeonIcon.vue';\nimport NeonLink from '@/components/navigation/link/NeonLink.vue';\n\n/**\n * <p>A dropdown menu consisting of a button to open the menu and a list of menu items. Clicking on a menu item will\n * result in navigating to the provided URL or notifying the parent component via the @click event.</p>\n * <p><strong>Note:</strong> As well as the options described below, pass through attributes supported by\n * <a href=\"/presentation/dropdown\">NeonDropdown</a> to change the style of the dropdown button.</p>\n */\nexport default defineComponent({\n name: 'NeonDropdownMenu',\n components: {\n NeonDropdown,\n NeonIcon,\n NeonLink,\n },\n props: {\n /**\n * A list of menu items to render in the dropdown menu.\n */\n model: { type: Array as () => Array<NeonDropdownMenuItem>, required: true },\n /**\n * The size of the dropdown - Small, Medium or Large.\n */\n size: { type: String as () => NeonSize, default: NeonSize.Medium },\n /**\n * The dropdown color.\n */\n color: { type: String as () => NeonFunctionalColor, default: NeonFunctionalColor.LowContrast },\n /**\n * Whether the dropdown button is disabled or not.\n */\n disabled: { type: Boolean, default: false },\n /**\n * Instead of opening on click (default), open on hover.\n */\n openOnHover: { type: Boolean, default: false },\n },\n emits: [\n /**\n * emitted when the user clicks on a menu item.\n * @type {NeonDropdownMenuItem} the menu item the user clicked on.\n */\n 'click',\n /**\n * emitted on initialisation\n * @type {HTMLElement} the reference to the HTMLElement for the dropdown menu button.\n */\n 'button-ref',\n ],\n setup(props, { emit }) {\n const attrs = useAttrs();\n const dropdown = ref<HTMLElement | null>(null);\n const dropdownPlacement = ref<NeonDropdownPlacement | null>(null);\n const items = ref<Array<HTMLLIElement>>([]);\n const open = ref(false);\n const highlightedKey = ref<string | null>(null);\n const highlightedIndex = ref(-1);\n\n const changeHighlighted = (key: string) => {\n highlightedKey.value = key;\n highlightedIndex.value = props.model.findIndex((item) => item.key === key);\n };\n\n const onPlacement = (placement: NeonDropdownPlacement) => {\n dropdownPlacement.value = placement;\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 scrollOnNavigate = () => {\n const element = dropdown.value?.querySelector('.neon-dropdown-menu__item--highlighted') as HTMLElement;\n NeonScrollUtils.scrollIntoView(element);\n };\n\n const navigateBy = (offset: number, $event: KeyboardEvent) => {\n const newIndex = highlightedIndex.value + offset;\n if (newIndex >= 0 && newIndex <= props.model.length - 1) {\n highlightedIndex.value = newIndex;\n highlightedKey.value = props.model[highlightedIndex.value].key;\n $event.preventDefault();\n setTimeout(scrollOnNavigate);\n }\n };\n\n const keyboardHandler = ($event: KeyboardEvent) => {\n if (!props.disabled) {\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 (props.model[highlightedIndex.value] && !props.model[highlightedIndex.value].disabled) {\n clickItem(props.model[highlightedIndex.value]);\n $event.preventDefault();\n }\n break;\n case 'Tab':\n if (!$event.ctrlKey && !$event.metaKey && !$event.altKey) {\n open.value = false;\n }\n break;\n case 'Escape':\n open.value = false;\n break;\n }\n }\n }\n };\n\n const clickItem = (item: NeonDropdownMenuItem) => {\n if (!item.disabled) {\n if (item.href) {\n const anchor = items.value[highlightedIndex.value]?.firstElementChild as HTMLAnchorElement;\n anchor && anchor.click();\n } else {\n emit('click', item);\n }\n open.value = false;\n }\n };\n\n const onFocus = () => {\n if (props.openOnHover) {\n open.value = true;\n }\n };\n\n const onBlur = () => {\n if (props.openOnHover) {\n open.value = false;\n }\n };\n\n onMounted(() => {\n document.addEventListener('keydown', keyboardHandler);\n });\n\n onUnmounted(() => {\n document.removeEventListener('keydown', keyboardHandler);\n });\n\n watch(\n () => open.value,\n (open: boolean) => {\n if (open) {\n highlightedKey.value = props.model[0].key;\n highlightedIndex.value = 0;\n }\n },\n );\n\n return {\n dropdown,\n items,\n open,\n highlightedKey,\n highlightedIndex,\n attrs,\n emit,\n changeHighlighted,\n keyboardHandler,\n onBlur,\n onFocus,\n clickItem,\n navigateBy,\n onPlacement,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonDropdown","NeonIcon","NeonLink","NeonSize","NeonFunctionalColor","props","emit","attrs","useAttrs","dropdown","ref","dropdownPlacement","items","open","highlightedKey","highlightedIndex","changeHighlighted","key","item","onPlacement","placement","isReverse","NeonDropdownPlacement","scrollOnNavigate","element","_a","NeonScrollUtils","navigateBy","offset","$event","newIndex","keyboardHandler","reverseOffset","clickItem","anchor","onFocus","onBlur","onMounted","onUnmounted","watch"],"mappings":";;;;;;;;AAgBA,MAAAA,IAAeC,EAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,IACV,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,EAAA;AAAA,EAEF,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,OAAO,EAAE,MAAM,OAA4C,UAAU,GAAA;AAAA;AAAA;AAAA;AAAA,IAIrE,MAAM,EAAE,MAAM,QAA0B,SAASC,EAAS,OAAA;AAAA;AAAA;AAAA;AAAA,IAI1D,OAAO,EAAE,MAAM,QAAqC,SAASC,EAAoB,YAAA;AAAA;AAAA;AAAA;AAAA,IAIjF,UAAU,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;AAAA,IACzD,CAAC,GAEDQ;AAAA,MACE,MAAM1B,EAAK;AAAA,MACX,CAACA,MAAkB;AACjB,QAAIA,MACFC,EAAe,QAAQT,EAAM,MAAM,CAAC,EAAE,KACtCU,EAAiB,QAAQ;AAAA,MAE7B;AAAA,IAAA,GAGK;AAAA,MACL,UAAAN;AAAA,MACA,OAAAG;AAAA,MACA,MAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,OAAAR;AAAA,MACA,MAAAD;AAAA,MACA,mBAAAU;AAAA,MACA,iBAAAe;AAAA,MACA,QAAAK;AAAA,MACA,SAAAD;AAAA,MACA,WAAAF;AAAA,MACA,YAAAN;AAAA,MACA,aAAAR;AAAA,IAAA;AAAA,EAEJ;AACF,CAAC;"}
|
|
1
|
+
{"version":3,"file":"NeonDropdownMenu.es.js","sources":["../../../../src/components/navigation/dropdown-menu/NeonDropdownMenu.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent, onMounted, onUnmounted, ref, useAttrs, watch } from 'vue';\nimport type { NeonDropdownMenuItem } from '@/common/models/NeonDropdownMenuItem';\nimport { NeonSize } from '@/common/enums/NeonSize';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\nimport NeonDropdown from '@/components/presentation/dropdown/NeonDropdown.vue';\nimport { NeonDropdownPlacement } from '@/common/enums/NeonDropdownPlacement';\nimport { NeonScrollUtils } from '@/common/utils/NeonScrollUtils';\nimport NeonIcon from '@/components/presentation/icon/NeonIcon.vue';\nimport NeonLink from '@/components/navigation/link/NeonLink.vue';\n\n/**\n * <p>A dropdown menu consisting of a button to open the menu and a list of menu items. Clicking on a menu item will\n * result in navigating to the provided URL or notifying the parent component via the @click event.</p>\n * <p><strong>Note:</strong> As well as the options described below, pass through attributes supported by\n * <a href=\"/presentation/dropdown\">NeonDropdown</a> to change the style of the dropdown button.</p>\n */\nexport default defineComponent({\n name: 'NeonDropdownMenu',\n components: {\n NeonDropdown,\n NeonIcon,\n NeonLink,\n },\n props: {\n /**\n * A list of menu items to render in the dropdown menu.\n */\n model: { type: Array as () => Array<NeonDropdownMenuItem>, required: true },\n /**\n * The size of the dropdown - Small, Medium or Large.\n */\n size: { type: String as () => NeonSize, default: NeonSize.Medium },\n /**\n * The dropdown color.\n */\n color: { type: String as () => NeonFunctionalColor, default: NeonFunctionalColor.LowContrast },\n /**\n * Whether the dropdown button is disabled or not.\n */\n disabled: { type: Boolean, default: false },\n /**\n * Instead of opening on click (default), open on hover.\n */\n openOnHover: { type: Boolean, default: false },\n },\n emits: [\n /**\n * emitted when the user clicks on a menu item.\n * @type {NeonDropdownMenuItem} the menu item the user clicked on.\n */\n 'click',\n /**\n * emitted on initialisation\n * @type {HTMLElement} the reference to the HTMLElement for the dropdown menu button.\n */\n 'button-ref',\n ],\n setup(props, { emit }) {\n const attrs = useAttrs();\n const dropdown = ref<InstanceType<typeof NeonDropdown> | null>(null);\n const dropdownPlacement = ref<NeonDropdownPlacement | null>(null);\n const items = ref<Array<HTMLLIElement>>([]);\n const open = ref(false);\n const highlightedKey = ref<string | null>(null);\n const highlightedIndex = ref(-1);\n\n const changeHighlighted = (key: string) => {\n highlightedKey.value = key;\n highlightedIndex.value = props.model.findIndex((item) => item.key === key);\n };\n\n const onPlacement = (placement: NeonDropdownPlacement) => {\n dropdownPlacement.value = placement;\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-dropdown-menu__item--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.model.length - 1) {\n highlightedIndex.value = newIndex;\n highlightedKey.value = props.model[highlightedIndex.value].key;\n $event.preventDefault();\n setTimeout(onNavigate);\n }\n };\n\n const keyboardHandler = ($event: KeyboardEvent) => {\n if (!props.disabled) {\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 (props.model[highlightedIndex.value] && !props.model[highlightedIndex.value].disabled) {\n clickItem(props.model[highlightedIndex.value]);\n $event.preventDefault();\n }\n break;\n case 'Tab':\n if (!$event.ctrlKey && !$event.metaKey && !$event.altKey) {\n open.value = false;\n }\n break;\n case 'Escape':\n open.value = false;\n break;\n }\n }\n }\n };\n\n const clickItem = (item: NeonDropdownMenuItem) => {\n if (!item.disabled) {\n if (item.href) {\n const anchor = items.value[highlightedIndex.value]?.firstElementChild as HTMLAnchorElement;\n anchor && anchor.click();\n } else {\n emit('click', item);\n }\n open.value = false;\n }\n };\n\n const onFocus = () => {\n if (props.openOnHover) {\n open.value = true;\n }\n };\n\n const onBlur = () => {\n if (props.openOnHover) {\n open.value = false;\n }\n };\n\n onMounted(() => {\n document.addEventListener('keydown', keyboardHandler);\n });\n\n onUnmounted(() => {\n document.removeEventListener('keydown', keyboardHandler);\n });\n\n watch(\n () => open.value,\n (open: boolean) => {\n if (open) {\n highlightedKey.value = props.model[0].key;\n highlightedIndex.value = 0;\n }\n },\n );\n\n return {\n dropdown,\n items,\n open,\n highlightedKey,\n highlightedIndex,\n attrs,\n emit,\n changeHighlighted,\n keyboardHandler,\n onBlur,\n onFocus,\n clickItem,\n navigateBy,\n onPlacement,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonDropdown","NeonIcon","NeonLink","NeonSize","NeonFunctionalColor","props","emit","attrs","useAttrs","dropdown","ref","dropdownPlacement","items","open","highlightedKey","highlightedIndex","changeHighlighted","key","item","onPlacement","placement","isReverse","NeonDropdownPlacement","onNavigate","element","_b","_a","NeonScrollUtils","navigateBy","offset","$event","newIndex","keyboardHandler","reverseOffset","clickItem","anchor","onFocus","onBlur","onMounted","onUnmounted","watch"],"mappings":";;;;;;;;AAgBA,MAAAA,IAAeC,EAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,IACV,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,EAAA;AAAA,EAEF,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,OAAO,EAAE,MAAM,OAA4C,UAAU,GAAA;AAAA;AAAA;AAAA;AAAA,IAIrE,MAAM,EAAE,MAAM,QAA0B,SAASC,EAAS,OAAA;AAAA;AAAA;AAAA;AAAA,IAI1D,OAAO,EAAE,MAAM,QAAqC,SAASC,EAAoB,YAAA;AAAA;AAAA;AAAA;AAAA,IAIjF,UAAU,EAAE,MAAM,SAAS,SAAS,GAAA;AAAA;AAAA;AAAA;AAAA,IAIpC,aAAa,EAAE,MAAM,SAAS,SAAS,GAAA;AAAA,EAAM;AAAA,EAE/C,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA,EAAA;AAAA,EAEF,MAAMC,GAAO,EAAE,MAAAC,KAAQ;AACrB,UAAMC,IAAQC,EAAA,GACRC,IAAWC,EAA8C,IAAI,GAC7DC,IAAoBD,EAAkC,IAAI,GAC1DE,IAAQF,EAA0B,EAAE,GACpCG,IAAOH,EAAI,EAAK,GAChBI,IAAiBJ,EAAmB,IAAI,GACxCK,IAAmBL,EAAI,EAAE,GAEzBM,IAAoB,CAACC,MAAgB;AACzC,MAAAH,EAAe,QAAQG,GACvBF,EAAiB,QAAQV,EAAM,MAAM,UAAU,CAACa,MAASA,EAAK,QAAQD,CAAG;AAAA,IAC3E,GAEME,IAAc,CAACC,MAAqC;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.js"),e=require("vue"),i=require("../../../_virtual/_plugin-vue_export-helper.cjs.js"),p={class:"no-style neon-dropdown-menu__items",role:"menu"},u=["onMouseover"],c={key:0,class:"neon-dropdown-menu__item-container"},m={class:"neon-dropdown-menu__item-label"},_={class:"neon-dropdown-menu__item-label"},k=["onClick"],w={class:"neon-dropdown-menu__item-label"};function b(n,l,y,g,v,f){const r=e.resolveComponent("neon-icon"),d=e.resolveComponent("neon-link"),s=e.resolveComponent("neon-dropdown");return e.openBlock(),e.createBlock(s,e.mergeProps({ref:"dropdown",modelValue:n.open,"onUpdate:modelValue":l[0]||(l[0]=o=>n.open=o),class:[`neon-dropdown-menu--${n.color}`,"neon-dropdown-menu"],color:n.color,disabled:n.disabled,openOnHover:n.openOnHover,size:n.size},n.attrs,{onBlur:l[1]||(l[1]=o=>n.onBlur()),onButton:l[2]||(l[2]=o=>n.emit("button-ref",o)),onFocus:l[3]||(l[3]=o=>n.onFocus()),"onUpdate:modelValue":l[4]||(l[4]=o=>n.open=o),onDropdownPlacement:n.onPlacement}),{default:e.withCtx(()=>[e.createElementVNode("ul",p,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.model,o=>(e.openBlock(),e.createElementBlock("li",{key:o.key,ref_for:!0,ref:"items",class:e.normalizeClass([[{"neon-dropdown-menu__item--disabled":o.disabled,"neon-dropdown-menu__item--separator-before":o.separatorBefore,"neon-dropdown-menu__item--group-title":o.isGroup,"neon-dropdown-menu__item--grouped":o.grouped,"neon-dropdown-menu__item--highlighted":o.key===n.highlightedKey},`neon-dropdown-menu__item--${n.size}`],"neon-dropdown-menu__item"]),onMouseover:t=>n.changeHighlighted(o.key)},[o.isGroup?(e.openBlock(),e.createElementBlock("div",c,[o.icon?(e.openBlock(),e.createBlock(r,{key:0,disabled:o.disabled,name:o.icon,class:"neon-dropdown-menu__item-icon"},null,8,["disabled","name"])):e.createCommentVNode("",!0),e.createElementVNode("span",m,e.toDisplayString(o.label),1)])):o.href&&!o.disabled?(e.openBlock(),e.createBlock(d,{key:1,href:o.href,"no-style":!0,"outline-style":"none",role:"menuitem"},{default:e.withCtx(()=>[o.icon?(e.openBlock(),e.createBlock(r,{key:0,disabled:o.disabled,name:o.icon,class:"neon-dropdown-menu__item-icon"},null,8,["disabled","name"])):e.createCommentVNode("",!0),e.createElementVNode("span",_,e.toDisplayString(o.label),1)]),_:2},1032,["href"])):(e.openBlock(),e.createElementBlock("div",{key:2,class:"neon-dropdown-menu__item-container",role:"menuitem",onClick:t=>n.clickItem(o)},[o.icon?(e.openBlock(),e.createBlock(r,{key:0,disabled:o.disabled,name:o.icon,class:"neon-dropdown-menu__item-icon"},null,8,["disabled","name"])):e.createCommentVNode("",!0),e.createElementVNode("span",w,e.toDisplayString(o.label),1)],8,k))],42,u))),128))])]),_:1},16,["modelValue","class","color","disabled","openOnHover","size","onDropdownPlacement"])}const B=i(a,[["render",b]]);module.exports=B;
|
|
1
|
+
"use strict";const a=require("./NeonDropdownMenu.cjs.js"),e=require("vue"),i=require("../../../_virtual/_plugin-vue_export-helper.cjs.js"),p={class:"no-style neon-dropdown-menu__items",role:"menu"},u=["onMouseover"],c={key:0,class:"neon-dropdown-menu__item-container"},m={class:"neon-dropdown-menu__item-label"},_={class:"neon-dropdown-menu__item-label"},k=["onClick"],w={class:"neon-dropdown-menu__item-label"};function b(n,l,y,g,v,f){const r=e.resolveComponent("neon-icon"),d=e.resolveComponent("neon-link"),s=e.resolveComponent("neon-dropdown");return e.openBlock(),e.createBlock(s,e.mergeProps({ref:"dropdown",modelValue:n.open,"onUpdate:modelValue":l[0]||(l[0]=o=>n.open=o),class:[`neon-dropdown-menu--${n.color}`,"neon-dropdown-menu"],color:n.color,disabled:n.disabled,openOnHover:n.openOnHover,size:n.size},n.attrs,{onBlur:l[1]||(l[1]=o=>n.onBlur()),onButton:l[2]||(l[2]=o=>n.emit("button-ref",o)),onFocus:l[3]||(l[3]=o=>n.onFocus()),"onUpdate:modelValue":l[4]||(l[4]=o=>n.open=o),onDropdownPlacement:n.onPlacement}),{default:e.withCtx(()=>[e.createElementVNode("ul",p,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.model,o=>(e.openBlock(),e.createElementBlock("li",{key:o.key,ref_for:!0,ref:"items",class:e.normalizeClass([[{"neon-dropdown-menu__item--disabled":o.disabled,"neon-dropdown-menu__item--separator-before":o.separatorBefore,"neon-dropdown-menu__item--group-title":o.isGroup,"neon-dropdown-menu__item--grouped":o.grouped,"neon-dropdown-menu__item--highlighted":o.key===n.highlightedKey},`neon-dropdown-menu__item--${n.size}`],"neon-dropdown-menu__item"]),tabindex:"0",onMouseover:t=>n.changeHighlighted(o.key)},[o.isGroup?(e.openBlock(),e.createElementBlock("div",c,[o.icon?(e.openBlock(),e.createBlock(r,{key:0,disabled:o.disabled,name:o.icon,class:"neon-dropdown-menu__item-icon"},null,8,["disabled","name"])):e.createCommentVNode("",!0),e.createElementVNode("span",m,e.toDisplayString(o.label),1)])):o.href&&!o.disabled?(e.openBlock(),e.createBlock(d,{key:1,href:o.href,"no-style":!0,"outline-style":"none",role:"menuitem"},{default:e.withCtx(()=>[o.icon?(e.openBlock(),e.createBlock(r,{key:0,disabled:o.disabled,name:o.icon,class:"neon-dropdown-menu__item-icon"},null,8,["disabled","name"])):e.createCommentVNode("",!0),e.createElementVNode("span",_,e.toDisplayString(o.label),1)]),_:2},1032,["href"])):(e.openBlock(),e.createElementBlock("div",{key:2,class:"neon-dropdown-menu__item-container",role:"menuitem",onClick:t=>n.clickItem(o)},[o.icon?(e.openBlock(),e.createBlock(r,{key:0,disabled:o.disabled,name:o.icon,class:"neon-dropdown-menu__item-icon"},null,8,["disabled","name"])):e.createCommentVNode("",!0),e.createElementVNode("span",w,e.toDisplayString(o.label),1)],8,k))],42,u))),128))])]),_:1},16,["modelValue","class","color","disabled","openOnHover","size","onDropdownPlacement"])}const B=i(a,[["render",b]]);module.exports=B;
|
|
2
2
|
//# sourceMappingURL=NeonDropdownMenu.vue.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonDropdownMenu.vue.cjs.js","sources":["../../../../src/components/navigation/dropdown-menu/NeonDropdownMenu.vue"],"sourcesContent":["<template>\n <neon-dropdown\n ref=\"dropdown\"\n v-model=\"open\"\n :class=\"`neon-dropdown-menu--${color}`\"\n :color=\"color\"\n :disabled=\"disabled\"\n :openOnHover=\"openOnHover\"\n :size=\"size\"\n class=\"neon-dropdown-menu\"\n v-bind=\"attrs\"\n @blur=\"onBlur()\"\n @button=\"emit('button-ref', $event)\"\n @focus=\"onFocus()\"\n @update:modelValue=\"open = $event\"\n @dropdown-placement=\"onPlacement\"\n >\n <ul class=\"no-style neon-dropdown-menu__items\" role=\"menu\">\n <li\n v-for=\"item in model\"\n :key=\"item.key\"\n ref=\"items\"\n :class=\"[\n {\n 'neon-dropdown-menu__item--disabled': item.disabled,\n 'neon-dropdown-menu__item--separator-before': item.separatorBefore,\n 'neon-dropdown-menu__item--group-title': item.isGroup,\n 'neon-dropdown-menu__item--grouped': item.grouped,\n 'neon-dropdown-menu__item--highlighted': item.key === highlightedKey,\n },\n `neon-dropdown-menu__item--${size}`,\n ]\"\n class=\"neon-dropdown-menu__item\"\n @mouseover=\"changeHighlighted(item.key)\"\n >\n <div v-if=\"item.isGroup\" class=\"neon-dropdown-menu__item-container\">\n <neon-icon\n v-if=\"item.icon\"\n :disabled=\"item.disabled\"\n :name=\"item.icon\"\n class=\"neon-dropdown-menu__item-icon\"\n />\n <span class=\"neon-dropdown-menu__item-label\">{{ item.label }}</span>\n </div>\n <neon-link\n v-else-if=\"item.href && !item.disabled\"\n :href=\"item.href\"\n :no-style=\"true\"\n outline-style=\"none\"\n role=\"menuitem\"\n >\n <neon-icon\n v-if=\"item.icon\"\n :disabled=\"item.disabled\"\n :name=\"item.icon\"\n class=\"neon-dropdown-menu__item-icon\"\n />\n <span class=\"neon-dropdown-menu__item-label\">{{ item.label }}</span>\n </neon-link>\n <div v-else class=\"neon-dropdown-menu__item-container\" role=\"menuitem\" @click=\"clickItem(item)\">\n <neon-icon\n v-if=\"item.icon\"\n :disabled=\"item.disabled\"\n :name=\"item.icon\"\n class=\"neon-dropdown-menu__item-icon\"\n />\n <span class=\"neon-dropdown-menu__item-label\">{{ item.label }}</span>\n </div>\n </li>\n </ul>\n </neon-dropdown>\n</template>\n\n<script lang=\"ts\" src=\"./NeonDropdownMenu.ts\"></script>\n"],"names":["_hoisted_4","_hoisted_5","_hoisted_7","_openBlock","_createBlock","_component_neon_dropdown","_mergeProps","_ctx","$event","_cache","_createElementVNode","_hoisted_1","_createElementBlock","_Fragment","_renderList","item","_normalizeClass","_hoisted_3","_component_neon_icon","_toDisplayString","_component_neon_link"],"mappings":"8IAiBQ,MAAM,qCAAqC,KAAK,
|
|
1
|
+
{"version":3,"file":"NeonDropdownMenu.vue.cjs.js","sources":["../../../../src/components/navigation/dropdown-menu/NeonDropdownMenu.vue"],"sourcesContent":["<template>\n <neon-dropdown\n ref=\"dropdown\"\n v-model=\"open\"\n :class=\"`neon-dropdown-menu--${color}`\"\n :color=\"color\"\n :disabled=\"disabled\"\n :openOnHover=\"openOnHover\"\n :size=\"size\"\n class=\"neon-dropdown-menu\"\n v-bind=\"attrs\"\n @blur=\"onBlur()\"\n @button=\"emit('button-ref', $event)\"\n @focus=\"onFocus()\"\n @update:modelValue=\"open = $event\"\n @dropdown-placement=\"onPlacement\"\n >\n <ul class=\"no-style neon-dropdown-menu__items\" role=\"menu\">\n <li\n v-for=\"item in model\"\n :key=\"item.key\"\n ref=\"items\"\n :class=\"[\n {\n 'neon-dropdown-menu__item--disabled': item.disabled,\n 'neon-dropdown-menu__item--separator-before': item.separatorBefore,\n 'neon-dropdown-menu__item--group-title': item.isGroup,\n 'neon-dropdown-menu__item--grouped': item.grouped,\n 'neon-dropdown-menu__item--highlighted': item.key === highlightedKey,\n },\n `neon-dropdown-menu__item--${size}`,\n ]\"\n class=\"neon-dropdown-menu__item\"\n tabindex=\"0\"\n @mouseover=\"changeHighlighted(item.key)\"\n >\n <div v-if=\"item.isGroup\" class=\"neon-dropdown-menu__item-container\">\n <neon-icon\n v-if=\"item.icon\"\n :disabled=\"item.disabled\"\n :name=\"item.icon\"\n class=\"neon-dropdown-menu__item-icon\"\n />\n <span class=\"neon-dropdown-menu__item-label\">{{ item.label }}</span>\n </div>\n <neon-link\n v-else-if=\"item.href && !item.disabled\"\n :href=\"item.href\"\n :no-style=\"true\"\n outline-style=\"none\"\n role=\"menuitem\"\n >\n <neon-icon\n v-if=\"item.icon\"\n :disabled=\"item.disabled\"\n :name=\"item.icon\"\n class=\"neon-dropdown-menu__item-icon\"\n />\n <span class=\"neon-dropdown-menu__item-label\">{{ item.label }}</span>\n </neon-link>\n <div v-else class=\"neon-dropdown-menu__item-container\" role=\"menuitem\" @click=\"clickItem(item)\">\n <neon-icon\n v-if=\"item.icon\"\n :disabled=\"item.disabled\"\n :name=\"item.icon\"\n class=\"neon-dropdown-menu__item-icon\"\n />\n <span class=\"neon-dropdown-menu__item-label\">{{ item.label }}</span>\n </div>\n </li>\n </ul>\n </neon-dropdown>\n</template>\n\n<script lang=\"ts\" src=\"./NeonDropdownMenu.ts\"></script>\n"],"names":["_hoisted_4","_hoisted_5","_hoisted_7","_openBlock","_createBlock","_component_neon_dropdown","_mergeProps","_ctx","$event","_cache","_createElementVNode","_hoisted_1","_createElementBlock","_Fragment","_renderList","item","_normalizeClass","_hoisted_3","_component_neon_icon","_toDisplayString","_component_neon_link"],"mappings":"8IAiBQ,MAAM,qCAAqC,KAAK,mCAmBvB,MAAM,sCAOvBA,EAAA,CAAA,MAAM,gCAAgC,EAetCC,EAAA,CAAA,MAAM,gCAAgC,gBAStCC,EAAA,CAAA,MAAM,gCAAgC,0IAlEpD,OAAAC,YAAA,EAAAC,cAsEgBC,EAtEhBC,EAAAA,WAsEgB,CArEd,IAAI,sBACKC,EAAA,0CAAAA,EAAA,KAAIC,GACZ,MAAK,CAAA,uBAAyBD,EAAA,KAAK,GAK9B,o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,mBAAoE,OAApET,EAAoEkB,EAAAA,gBAApBJ,EAAK,KAAK,EAAA,CAAA,wCAE5DH,EAAAA,mBAQM,MAAA,OARM,MAAM,qCAAqC,KAAK,WAAY,QAAKJ,GAAED,EAAA,UAAUQ,CAAI,IAEnFA,EAAK,oBADbX,EAAAA,YAKEc,EAAA,OAHC,SAAUH,EAAK,SACf,KAAMA,EAAK,KACZ,MAAM,0FAERL,EAAAA,mBAAoE,OAApER,EAAoEiB,EAAAA,gBAApBJ,EAAK,KAAK,EAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonDropdownMenu.vue.es.js","sources":["../../../../src/components/navigation/dropdown-menu/NeonDropdownMenu.vue"],"sourcesContent":["<template>\n <neon-dropdown\n ref=\"dropdown\"\n v-model=\"open\"\n :class=\"`neon-dropdown-menu--${color}`\"\n :color=\"color\"\n :disabled=\"disabled\"\n :openOnHover=\"openOnHover\"\n :size=\"size\"\n class=\"neon-dropdown-menu\"\n v-bind=\"attrs\"\n @blur=\"onBlur()\"\n @button=\"emit('button-ref', $event)\"\n @focus=\"onFocus()\"\n @update:modelValue=\"open = $event\"\n @dropdown-placement=\"onPlacement\"\n >\n <ul class=\"no-style neon-dropdown-menu__items\" role=\"menu\">\n <li\n v-for=\"item in model\"\n :key=\"item.key\"\n ref=\"items\"\n :class=\"[\n {\n 'neon-dropdown-menu__item--disabled': item.disabled,\n 'neon-dropdown-menu__item--separator-before': item.separatorBefore,\n 'neon-dropdown-menu__item--group-title': item.isGroup,\n 'neon-dropdown-menu__item--grouped': item.grouped,\n 'neon-dropdown-menu__item--highlighted': item.key === highlightedKey,\n },\n `neon-dropdown-menu__item--${size}`,\n ]\"\n class=\"neon-dropdown-menu__item\"\n @mouseover=\"changeHighlighted(item.key)\"\n >\n <div v-if=\"item.isGroup\" class=\"neon-dropdown-menu__item-container\">\n <neon-icon\n v-if=\"item.icon\"\n :disabled=\"item.disabled\"\n :name=\"item.icon\"\n class=\"neon-dropdown-menu__item-icon\"\n />\n <span class=\"neon-dropdown-menu__item-label\">{{ item.label }}</span>\n </div>\n <neon-link\n v-else-if=\"item.href && !item.disabled\"\n :href=\"item.href\"\n :no-style=\"true\"\n outline-style=\"none\"\n role=\"menuitem\"\n >\n <neon-icon\n v-if=\"item.icon\"\n :disabled=\"item.disabled\"\n :name=\"item.icon\"\n class=\"neon-dropdown-menu__item-icon\"\n />\n <span class=\"neon-dropdown-menu__item-label\">{{ item.label }}</span>\n </neon-link>\n <div v-else class=\"neon-dropdown-menu__item-container\" role=\"menuitem\" @click=\"clickItem(item)\">\n <neon-icon\n v-if=\"item.icon\"\n :disabled=\"item.disabled\"\n :name=\"item.icon\"\n class=\"neon-dropdown-menu__item-icon\"\n />\n <span class=\"neon-dropdown-menu__item-label\">{{ item.label }}</span>\n </div>\n </li>\n </ul>\n </neon-dropdown>\n</template>\n\n<script lang=\"ts\" src=\"./NeonDropdownMenu.ts\"></script>\n"],"names":["_hoisted_4","_hoisted_5","_hoisted_7","_openBlock","_createBlock","_component_neon_dropdown","_mergeProps","_ctx","$event","_cache","_createElementVNode","_hoisted_1","_createElementBlock","_Fragment","_renderList","item","_normalizeClass","_hoisted_3","_component_neon_icon","_toDisplayString","_component_neon_link"],"mappings":";;;;EAiBQ,OAAM;AAAA,EAAqC,MAAK;;;
|
|
1
|
+
{"version":3,"file":"NeonDropdownMenu.vue.es.js","sources":["../../../../src/components/navigation/dropdown-menu/NeonDropdownMenu.vue"],"sourcesContent":["<template>\n <neon-dropdown\n ref=\"dropdown\"\n v-model=\"open\"\n :class=\"`neon-dropdown-menu--${color}`\"\n :color=\"color\"\n :disabled=\"disabled\"\n :openOnHover=\"openOnHover\"\n :size=\"size\"\n class=\"neon-dropdown-menu\"\n v-bind=\"attrs\"\n @blur=\"onBlur()\"\n @button=\"emit('button-ref', $event)\"\n @focus=\"onFocus()\"\n @update:modelValue=\"open = $event\"\n @dropdown-placement=\"onPlacement\"\n >\n <ul class=\"no-style neon-dropdown-menu__items\" role=\"menu\">\n <li\n v-for=\"item in model\"\n :key=\"item.key\"\n ref=\"items\"\n :class=\"[\n {\n 'neon-dropdown-menu__item--disabled': item.disabled,\n 'neon-dropdown-menu__item--separator-before': item.separatorBefore,\n 'neon-dropdown-menu__item--group-title': item.isGroup,\n 'neon-dropdown-menu__item--grouped': item.grouped,\n 'neon-dropdown-menu__item--highlighted': item.key === highlightedKey,\n },\n `neon-dropdown-menu__item--${size}`,\n ]\"\n class=\"neon-dropdown-menu__item\"\n tabindex=\"0\"\n @mouseover=\"changeHighlighted(item.key)\"\n >\n <div v-if=\"item.isGroup\" class=\"neon-dropdown-menu__item-container\">\n <neon-icon\n v-if=\"item.icon\"\n :disabled=\"item.disabled\"\n :name=\"item.icon\"\n class=\"neon-dropdown-menu__item-icon\"\n />\n <span class=\"neon-dropdown-menu__item-label\">{{ item.label }}</span>\n </div>\n <neon-link\n v-else-if=\"item.href && !item.disabled\"\n :href=\"item.href\"\n :no-style=\"true\"\n outline-style=\"none\"\n role=\"menuitem\"\n >\n <neon-icon\n v-if=\"item.icon\"\n :disabled=\"item.disabled\"\n :name=\"item.icon\"\n class=\"neon-dropdown-menu__item-icon\"\n />\n <span class=\"neon-dropdown-menu__item-label\">{{ item.label }}</span>\n </neon-link>\n <div v-else class=\"neon-dropdown-menu__item-container\" role=\"menuitem\" @click=\"clickItem(item)\">\n <neon-icon\n v-if=\"item.icon\"\n :disabled=\"item.disabled\"\n :name=\"item.icon\"\n class=\"neon-dropdown-menu__item-icon\"\n />\n <span class=\"neon-dropdown-menu__item-label\">{{ item.label }}</span>\n </div>\n </li>\n </ul>\n </neon-dropdown>\n</template>\n\n<script lang=\"ts\" src=\"./NeonDropdownMenu.ts\"></script>\n"],"names":["_hoisted_4","_hoisted_5","_hoisted_7","_openBlock","_createBlock","_component_neon_dropdown","_mergeProps","_ctx","$event","_cache","_createElementVNode","_hoisted_1","_createElementBlock","_Fragment","_renderList","item","_normalizeClass","_hoisted_3","_component_neon_ic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A,kBAAkBQ,EAAK,GAAG;AAAA;UAE3BA,EAAK,WAAhBZ,KAAAS,EAQM,OARNK,GAQM;AAAA,YANIF,EAAK,aADbX,EAKEc,GAAA;AAAA;cAHC,UAAUH,EAAK;AAAA,cACf,MAAMA,EAAK;AAAA,cACZ,OAAM;AAAA;YAERL,EAAoE,QAApEV,GAAoEmB,EAApBJ,EAAK,KAAK,GAAA,CAAA;AAAA,gBAG/CA,EAAK,QAAI,CAAKA,EAAK,iBADhCX,EAcYgB,GAAA;AAAA;YAZT,MAAML,EAAK;AAAA,YACX,YAAU;AAAA,YACX,iBAAc;AAAA,YACd,MAAK;AAAA;uBAEL,MAKE;AAAA,cAJMA,EAAK,aADbX,EAKEc,GAAA;AAAA;gBAHC,UAAUH,EAAK;AAAA,gBACf,MAAMA,EAAK;AAAA,gBACZ,OAAM;AAAA;cAERL,EAAoE,QAApET,GAAoEkB,EAApBJ,EAAK,KAAK,GAAA,CAAA;AAAA;;sCAE5DH,EAQM,OAAA;AAAA;YARM,OAAM;AAAA,YAAqC,MAAK;AAAA,YAAY,SAAK,CAAAJ,MAAED,EAAA,UAAUQ,CAAI;AAAA;YAEnFA,EAAK,aADbX,EAKEc,GAAA;AAAA;cAHC,UAAUH,EAAK;AAAA,cACf,MAAMA,EAAK;AAAA,cACZ,OAAM;AAAA;YAERL,EAAoE,QAApER,GAAoEiB,EAApBJ,EAAK,KAAK,GAAA,CAAA;AAAA;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const o=require("vue"),t=require("../../presentation/icon/NeonIcon.vue.cjs.js"),r=require("../../../common/enums/NeonFunctionalColor.cjs.js"),n=o.defineComponent({name:"NeonStepper",components:{NeonIcon:t},props:{steps:{type:Array,required:!0},completedIndex:{type:Number,default:-1},modelValue:{type:Number,default:0},color:{type:String,default:r.NeonFunctionalColor.
|
|
1
|
+
"use strict";const o=require("vue"),t=require("../../presentation/icon/NeonIcon.vue.cjs.js"),r=require("../../../common/enums/NeonFunctionalColor.cjs.js"),n=o.defineComponent({name:"NeonStepper",components:{NeonIcon:t},props:{steps:{type:Array,required:!0},completedIndex:{type:Number,default:-1},modelValue:{type:Number,default:0},color:{type:String,default:r.NeonFunctionalColor.Primary}},emits:["update:modelValue"],setup(u,{emit:e}){return{emit:e}}});module.exports=n;
|
|
2
2
|
//# sourceMappingURL=NeonStepper.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonStepper.cjs.js","sources":["../../../../src/components/navigation/stepper/NeonStepper.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent } from 'vue';\nimport NeonIcon from '@/components/presentation/icon/NeonIcon.vue';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\n\n/**\n * A stepper component for assisting users in navigating through complex flows.\n */\nexport default defineComponent({\n name: 'NeonStepper',\n components: { NeonIcon },\n props: {\n /**\n * An ordered list of the step names, these values are used for display purposes.\n */\n steps: { type: Array as () => Array<string>, required: true },\n /**\n * The index of the highest completed step (regardless of the current step the user has selected).\n * This is used to display the completed steps to the user.\n */\n completedIndex: { type: Number, default: -1 },\n /**\n * The index of the step that is currently selected.\n */\n modelValue: { type: Number, default: 0 },\n /**\n * The color of the Stepper component.\n */\n color: { type: String as () => NeonFunctionalColor, default: NeonFunctionalColor.
|
|
1
|
+
{"version":3,"file":"NeonStepper.cjs.js","sources":["../../../../src/components/navigation/stepper/NeonStepper.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent } from 'vue';\nimport NeonIcon from '@/components/presentation/icon/NeonIcon.vue';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\n\n/**\n * A stepper component for assisting users in navigating through complex flows.\n */\nexport default defineComponent({\n name: 'NeonStepper',\n components: { NeonIcon },\n props: {\n /**\n * An ordered list of the step names, these values are used for display purposes.\n */\n steps: { type: Array as () => Array<string>, required: true },\n /**\n * The index of the highest completed step (regardless of the current step the user has selected).\n * This is used to display the completed steps to the user.\n */\n completedIndex: { type: Number, default: -1 },\n /**\n * The index of the step that is currently selected.\n */\n modelValue: { type: Number, default: 0 },\n /**\n * The color of the Stepper component.\n */\n color: { type: String as () => NeonFunctionalColor, default: NeonFunctionalColor.Primary },\n },\n emits: [\n /**\n * Emitted when the selected step is changed.\n * @type {number} The index of the selected step.\n */\n 'update:modelValue',\n ],\n setup(_props, { emit }) {\n return {\n emit,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonIcon","NeonFunctionalColor","_props","emit"],"mappings":"2JAOAA,EAAeC,kBAAgB,CAC7B,KAAM,cACN,WAAY,CAAE,SAAAC,CAAA,EACd,MAAO,CAIL,MAAO,CAAE,KAAM,MAA8B,SAAU,EAAA,EAKvD,eAAgB,CAAE,KAAM,OAAQ,QAAS,EAAA,EAIzC,WAAY,CAAE,KAAM,OAAQ,QAAS,CAAA,EAIrC,MAAO,CAAE,KAAM,OAAqC,QAASC,EAAAA,oBAAoB,OAAA,CAAQ,EAE3F,MAAO,CAKL,mBAAA,EAEF,MAAMC,EAAQ,CAAE,KAAAC,GAAQ,CACtB,MAAO,CACL,KAAAA,CAAA,CAEJ,CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonStepper.es.js","sources":["../../../../src/components/navigation/stepper/NeonStepper.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent } from 'vue';\nimport NeonIcon from '@/components/presentation/icon/NeonIcon.vue';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\n\n/**\n * A stepper component for assisting users in navigating through complex flows.\n */\nexport default defineComponent({\n name: 'NeonStepper',\n components: { NeonIcon },\n props: {\n /**\n * An ordered list of the step names, these values are used for display purposes.\n */\n steps: { type: Array as () => Array<string>, required: true },\n /**\n * The index of the highest completed step (regardless of the current step the user has selected).\n * This is used to display the completed steps to the user.\n */\n completedIndex: { type: Number, default: -1 },\n /**\n * The index of the step that is currently selected.\n */\n modelValue: { type: Number, default: 0 },\n /**\n * The color of the Stepper component.\n */\n color: { type: String as () => NeonFunctionalColor, default: NeonFunctionalColor.
|
|
1
|
+
{"version":3,"file":"NeonStepper.es.js","sources":["../../../../src/components/navigation/stepper/NeonStepper.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent } from 'vue';\nimport NeonIcon from '@/components/presentation/icon/NeonIcon.vue';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\n\n/**\n * A stepper component for assisting users in navigating through complex flows.\n */\nexport default defineComponent({\n name: 'NeonStepper',\n components: { NeonIcon },\n props: {\n /**\n * An ordered list of the step names, these values are used for display purposes.\n */\n steps: { type: Array as () => Array<string>, required: true },\n /**\n * The index of the highest completed step (regardless of the current step the user has selected).\n * This is used to display the completed steps to the user.\n */\n completedIndex: { type: Number, default: -1 },\n /**\n * The index of the step that is currently selected.\n */\n modelValue: { type: Number, default: 0 },\n /**\n * The color of the Stepper component.\n */\n color: { type: String as () => NeonFunctionalColor, default: NeonFunctionalColor.Primary },\n },\n emits: [\n /**\n * Emitted when the selected step is changed.\n * @type {number} The index of the selected step.\n */\n 'update:modelValue',\n ],\n setup(_props, { emit }) {\n return {\n emit,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonIcon","NeonFunctionalColor","_props","emit"],"mappings":";;;AAOA,MAAAA,IAAeC,EAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY,EAAE,UAAAC,EAAA;AAAA,EACd,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,OAAO,EAAE,MAAM,OAA8B,UAAU,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKvD,gBAAgB,EAAE,MAAM,QAAQ,SAAS,GAAA;AAAA;AAAA;AAAA;AAAA,IAIzC,YAAY,EAAE,MAAM,QAAQ,SAAS,EAAA;AAAA;AAAA;AAAA;AAAA,IAIrC,OAAO,EAAE,MAAM,QAAqC,SAASC,EAAoB,QAAA;AAAA,EAAQ;AAAA,EAE3F,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL;AAAA,EAAA;AAAA,EAEF,MAAMC,GAAQ,EAAE,MAAAC,KAAQ;AACtB,WAAO;AAAA,MACL,MAAAA;AAAA,IAAA;AAAA,EAEJ;AACF,CAAC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const n=require("vue"),p=require("../../../common/enums/NeonDropdownPlacement.cjs.js"),v=require("../../../common/utils/NeonDropdownPlacementUtils.cjs.js"),w=require("../../../common/utils/NeonClosableUtils.cjs.js"),y=require("../../../common/enums/NeonSize.cjs.js"),N=require("../../../common/enums/NeonFunctionalColor.cjs.js"),S=require("../../../common/enums/NeonDropdownStyle.cjs.js"),g=require("../badge/NeonBadge.vue.cjs.js"),C=require("../../user-input/button/NeonButton.vue.cjs.js"),b=require("../expansion-indicator/NeonExpansionIndicator.vue.cjs.js"),q=n.defineComponent({name:"NeonDropdown",components:{NeonBadge:g,NeonButton:C,NeonExpansionIndicator:b},props:{id:{type:String},modelValue:{type:Boolean,required:!0},label:{type:String,default:null},image:{type:String,default:null},imageAlt:{type:String,default:null},icon:{type:String,default:null},indicator:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},size:{type:String,default:y.NeonSize.Medium},color:{type:String,default:N.NeonFunctionalColor.LowContrast},alternateColor:{type:String,default:null},dropdownStyle:{type:String,default:S.NeonDropdownStyle.SolidButton},placement:{type:String,default:p.NeonDropdownPlacement.BottomLeft},placementContainer:{type:Object,default:null},openOnHover:{type:Boolean,default:!1}},emits:["update:modelValue","dropdown-placement","blur","focus","button-ref"],setup(e,{emit:o}){const r=n.ref(null),l=n.ref(null),a=n.ref(e.placement),u=n.ref(null),d=()=>{o("update:modelValue",!1)},c=()=>{e.modelValue&&d()},t=()=>{if(e.modelValue&&r.value&&l.value){const i=a.value;a.value=v.NeonDropdownPlacementUtils.calculatePlacement(r.value,l.value,e.placement,e.placementContainer),i!==a.value&&o("dropdown-placement",a.value)}},s=()=>{!e.disabled&&!e.openOnHover&&(o("update:modelValue",!e.modelValue),setTimeout(t))},
|
|
1
|
+
"use strict";const n=require("vue"),p=require("../../../common/enums/NeonDropdownPlacement.cjs.js"),v=require("../../../common/utils/NeonDropdownPlacementUtils.cjs.js"),w=require("../../../common/utils/NeonClosableUtils.cjs.js"),y=require("../../../common/enums/NeonSize.cjs.js"),N=require("../../../common/enums/NeonFunctionalColor.cjs.js"),S=require("../../../common/enums/NeonDropdownStyle.cjs.js"),g=require("../badge/NeonBadge.vue.cjs.js"),C=require("../../user-input/button/NeonButton.vue.cjs.js"),b=require("../expansion-indicator/NeonExpansionIndicator.vue.cjs.js"),q=n.defineComponent({name:"NeonDropdown",components:{NeonBadge:g,NeonButton:C,NeonExpansionIndicator:b},props:{id:{type:String},modelValue:{type:Boolean,required:!0},label:{type:String,default:null},image:{type:String,default:null},imageAlt:{type:String,default:null},icon:{type:String,default:null},indicator:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},size:{type:String,default:y.NeonSize.Medium},color:{type:String,default:N.NeonFunctionalColor.LowContrast},alternateColor:{type:String,default:null},dropdownStyle:{type:String,default:S.NeonDropdownStyle.SolidButton},placement:{type:String,default:p.NeonDropdownPlacement.BottomLeft},placementContainer:{type:Object,default:null},openOnHover:{type:Boolean,default:!1}},emits:["update:modelValue","dropdown-placement","blur","focus","button-ref"],setup(e,{emit:o}){const r=n.ref(null),l=n.ref(null),a=n.ref(e.placement),u=n.ref(null),d=()=>{o("update:modelValue",!1)},c=()=>{e.modelValue&&d()},t=()=>{if(e.modelValue&&r.value&&l.value){const i=a.value;a.value=v.NeonDropdownPlacementUtils.calculatePlacement(r.value,l.value,e.placement,e.placementContainer),i!==a.value&&o("dropdown-placement",a.value)}},s=()=>{!e.disabled&&!e.openOnHover&&(o("update:modelValue",!e.modelValue),setTimeout(t))},f=()=>{o("blur")},m=()=>{o("focus")};return n.onMounted(()=>{!e.openOnHover&&l.value&&(u.value=new w.NeonClosableUtils(l.value,c)),window.addEventListener("resize",t,{passive:!0}),window.addEventListener("scroll",t,{passive:!0}),e.placementContainer&&e.placementContainer.addEventListener("scroll",t,{passive:!0})}),n.onUnmounted(()=>{e.openOnHover||u.value&&u.value.destroy(),window.removeEventListener("resize",t),window.removeEventListener("scroll",t),e.placementContainer&&e.placementContainer.removeEventListener("scroll",t)}),n.watch(()=>r.value,i=>o("button-ref",i),{immediate:!0}),n.defineExpose({dropdownContent:l}),{dropdownButton:r,dropdownContent:l,dropdownPlacement:a,closableUtils:u,onClose:d,close:c,toggleOpen:s,onBlur:f,onFocus:m}}});module.exports=q;
|
|
2
2
|
//# sourceMappingURL=NeonDropdown.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonDropdown.cjs.js","sources":["../../../../src/components/presentation/dropdown/NeonDropdown.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent, onMounted, onUnmounted, ref, watch } from 'vue';\nimport { NeonDropdownPlacement } from '@/common/enums/NeonDropdownPlacement';\nimport { NeonDropdownPlacementUtils } from '@/common/utils/NeonDropdownPlacementUtils';\nimport { NeonClosableUtils } from '@/common/utils/NeonClosableUtils';\nimport { NeonSize } from '@/common/enums/NeonSize';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\nimport { NeonDropdownStyle } from '@/common/enums/NeonDropdownStyle';\nimport NeonBadge from '@/components/presentation/badge/NeonBadge.vue';\nimport NeonButton from '@/components/user-input/button/NeonButton.vue';\nimport NeonExpansionIndicator from '@/components/presentation/expansion-indicator/NeonExpansionIndicator.vue';\n\n/**\n * <p>A general purpose dropdown component. This component consists of a button, to trigger the dropdown to open, and\n * the dropdown content which is displayed above the page when the user clicks the button.</p>\n * <p>This can be useful for secondary (perhaps more complex) actions for which there is not enough space on the page or\n * the action is asynchronous allowing the user to perform the action and continue what they were doing. Examples are\n * providing links to copy and letting the user send feedback.</p>\n * <p><strong>NeonDropdown</strong> is the basis for the <strong>NeonDropdownMenu</strong> component and the\n * <strong>NeonSelect</strong> form component.</p>\n */\nexport default defineComponent({\n name: 'NeonDropdown',\n components: {\n NeonBadge,\n NeonButton,\n NeonExpansionIndicator,\n },\n props: {\n /**\n * Id for the dropdown button.\n */\n id: { type: String },\n /**\n * Whether the dropdown is currently open.\n */\n modelValue: { type: Boolean, required: true },\n /**\n * The label for the dropdown button.\n */\n label: { type: String, default: null },\n /**\n * URL of image to display if the button style is a square or circular badge.\n */\n image: { type: String, default: null },\n /**\n * Badge image ALT text.\n */\n imageAlt: { type: String, default: null },\n /**\n * An icon to display on the dropdown button. This will be to the left of any label, but can also be used on its own.\n */\n icon: { type: String, default: null },\n /**\n * Show the dropdown button's indicator (chevron).\n */\n indicator: { type: Boolean, default: true },\n /**\n * Disable the dropdown button\n */\n disabled: { type: Boolean, default: false },\n /**\n * The size of the dropdown button - Small, Medium or Large.\n */\n size: { type: String as () => NeonSize, default: NeonSize.Medium },\n /**\n * The color of the dropdown button\n */\n color: { type: String as () => NeonFunctionalColor, default: NeonFunctionalColor.LowContrast },\n /**\n * The alternate color of the dropdown button (for gradient buttons).\n */\n alternateColor: { type: String as () => NeonFunctionalColor, default: null },\n /**\n * The style of the dropdown button\n */\n dropdownStyle: { type: String as () => NeonDropdownStyle, default: NeonDropdownStyle.SolidButton },\n /**\n * Placement of the dropdown contents.\n */\n placement: { type: String as () => NeonDropdownPlacement, default: NeonDropdownPlacement.BottomLeft },\n /**\n * Restrict placement to within this container.\n */\n placementContainer: { type: Object as () => HTMLElement, default: null },\n /**\n * Instead of opening on click (default), open on hover.\n */\n openOnHover: { type: Boolean, default: false },\n },\n emits: [\n /**\n * Emitted when the dropdown button is toggled.\n * @type {boolean} the open state of the dropdown.\n */\n 'update:modelValue',\n /**\n * Emitted on initialisation.\n * @type {NeonDropdownPlacement} the placement of the dropdown.\n */\n 'dropdown-placement',\n /**\n * Emitted when the dropdown button is blurred.\n * @type {void}\n */\n 'blur',\n /**\n * Emitted when the dropdown button is focussed.\n * @type {void}\n */\n 'focus',\n /**\n * emitted on initialisation\n * @type {HTMLElement} the reference to the HTMLElement for the dropdown menu button.\n */\n 'button-ref',\n ],\n setup(props, { emit }) {\n const dropdownButton = ref<HTMLElement | null>(null);\n const dropdownContent = ref<HTMLDivElement | null>(null);\n\n const dropdownPlacement = ref<NeonDropdownPlacement>(props.placement);\n const closableUtils = ref<NeonClosableUtils | null>(null);\n\n const onClose = () => {\n emit('update:modelValue', false);\n };\n\n const close = () => {\n if (props.modelValue) {\n onClose();\n }\n };\n\n const recalculatePlacement = () => {\n if (props.modelValue && dropdownButton.value && dropdownContent.value) {\n const previousValue = dropdownPlacement.value;\n dropdownPlacement.value = NeonDropdownPlacementUtils.calculatePlacement(\n dropdownButton.value,\n dropdownContent.value,\n props.placement,\n props.placementContainer,\n );\n\n if (previousValue !== dropdownPlacement.value) {\n emit('dropdown-placement', dropdownPlacement.value);\n }\n }\n };\n\n const toggleOpen = () => {\n if (!props.disabled && !props.openOnHover) {\n emit('update:modelValue', !props.modelValue);\n setTimeout(recalculatePlacement);\n }\n };\n\n const onBlur = () => {\n emit('blur');\n };\n\n const onFocus = () => {\n emit('focus');\n };\n\n onMounted(() => {\n if (!props.openOnHover && dropdownContent.value) {\n closableUtils.value = new NeonClosableUtils(dropdownContent.value, close);\n }\n window.addEventListener('resize', recalculatePlacement, { passive: true });\n window.addEventListener('scroll', recalculatePlacement, { passive: true });\n if (props.placementContainer) {\n props.placementContainer.addEventListener('scroll', recalculatePlacement, { passive: true });\n }\n });\n\n onUnmounted(() => {\n if (!props.openOnHover) {\n closableUtils.value && closableUtils.value.destroy();\n }\n window.removeEventListener('resize', recalculatePlacement);\n window.removeEventListener('scroll', recalculatePlacement);\n if (props.placementContainer) {\n props.placementContainer.removeEventListener('scroll', recalculatePlacement);\n }\n });\n\n watch(\n () => dropdownButton.value,\n (value) => emit('button-ref', value),\n { immediate: true },\n );\n\n return {\n dropdownButton,\n dropdownContent,\n dropdownPlacement,\n closableUtils,\n onClose,\n close,\n toggleOpen,\n onBlur,\n onFocus,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonBadge","NeonButton","NeonExpansionIndicator","NeonSize","NeonFunctionalColor","NeonDropdownStyle","NeonDropdownPlacement","props","emit","dropdownButton","ref","dropdownContent","dropdownPlacement","closableUtils","onClose","close","recalculatePlacement","previousValue","NeonDropdownPlacementUtils","toggleOpen","onBlur","onFocus","onMounted","NeonClosableUtils","onUnmounted","watch","value"],"mappings":"8jBAoBAA,EAAeC,kBAAgB,CAC7B,KAAM,eACN,WAAY,CACV,UAAAC,EACA,WAAAC,EACA,uBAAAC,CAAA,EAEF,MAAO,CAIL,GAAI,CAAE,KAAM,MAAA,EAIZ,WAAY,CAAE,KAAM,QAAS,SAAU,EAAA,EAIvC,MAAO,CAAE,KAAM,OAAQ,QAAS,IAAA,EAIhC,MAAO,CAAE,KAAM,OAAQ,QAAS,IAAA,EAIhC,SAAU,CAAE,KAAM,OAAQ,QAAS,IAAA,EAInC,KAAM,CAAE,KAAM,OAAQ,QAAS,IAAA,EAI/B,UAAW,CAAE,KAAM,QAAS,QAAS,EAAA,EAIrC,SAAU,CAAE,KAAM,QAAS,QAAS,EAAA,EAIpC,KAAM,CAAE,KAAM,OAA0B,QAASC,EAAAA,SAAS,MAAA,EAI1D,MAAO,CAAE,KAAM,OAAqC,QAASC,EAAAA,oBAAoB,WAAA,EAIjF,eAAgB,CAAE,KAAM,OAAqC,QAAS,IAAA,EAItE,cAAe,CAAE,KAAM,OAAmC,QAASC,EAAAA,kBAAkB,WAAA,EAIrF,UAAW,CAAE,KAAM,OAAuC,QAASC,EAAAA,sBAAsB,UAAA,EAIzF,mBAAoB,CAAE,KAAM,OAA6B,QAAS,IAAA,EAIlE,YAAa,CAAE,KAAM,QAAS,QAAS,EAAA,CAAM,EAE/C,MAAO,CAKL,oBAKA,qBAKA,OAKA,QAKA,YAAA,EAEF,MAAMC,EAAO,CAAE,KAAAC,GAAQ,CACrB,MAAMC,EAAiBC,EAAAA,IAAwB,I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AAUS,CAAoB,CAE/E,CAAC,EAEDS,EAAAA,MACE,IAAMhB,EAAe,MACpBiB,GAAUlB,EAAK,aAAckB,CAAK,EACnC,CAAE,UAAW,EAAA,CAAK,
|
|
1
|
+
{"version":3,"file":"NeonDropdown.cjs.js","sources":["../../../../src/components/presentation/dropdown/NeonDropdown.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent, defineExpose, onMounted, onUnmounted, ref, watch } from 'vue';\nimport { NeonDropdownPlacement } from '@/common/enums/NeonDropdownPlacement';\nimport { NeonDropdownPlacementUtils } from '@/common/utils/NeonDropdownPlacementUtils';\nimport { NeonClosableUtils } from '@/common/utils/NeonClosableUtils';\nimport { NeonSize } from '@/common/enums/NeonSize';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\nimport { NeonDropdownStyle } from '@/common/enums/NeonDropdownStyle';\nimport NeonBadge from '@/components/presentation/badge/NeonBadge.vue';\nimport NeonButton from '@/components/user-input/button/NeonButton.vue';\nimport NeonExpansionIndicator from '@/components/presentation/expansion-indicator/NeonExpansionIndicator.vue';\n\n/**\n * <p>A general purpose dropdown component. This component consists of a button, to trigger the dropdown to open, and\n * the dropdown content which is displayed above the page when the user clicks the button.</p>\n * <p>This can be useful for secondary (perhaps more complex) actions for which there is not enough space on the page or\n * the action is asynchronous allowing the user to perform the action and continue what they were doing. Examples are\n * providing links to copy and letting the user send feedback.</p>\n * <p><strong>NeonDropdown</strong> is the basis for the <strong>NeonDropdownMenu</strong> component and the\n * <strong>NeonSelect</strong> form component.</p>\n */\nexport default defineComponent({\n name: 'NeonDropdown',\n components: {\n NeonBadge,\n NeonButton,\n NeonExpansionIndicator,\n },\n props: {\n /**\n * Id for the dropdown button.\n */\n id: { type: String },\n /**\n * Whether the dropdown is currently open.\n */\n modelValue: { type: Boolean, required: true },\n /**\n * The label for the dropdown button.\n */\n label: { type: String, default: null },\n /**\n * URL of image to display if the button style is a square or circular badge.\n */\n image: { type: String, default: null },\n /**\n * Badge image ALT text.\n */\n imageAlt: { type: String, default: null },\n /**\n * An icon to display on the dropdown button. This will be to the left of any label, but can also be used on its own.\n */\n icon: { type: String, default: null },\n /**\n * Show the dropdown button's indicator (chevron).\n */\n indicator: { type: Boolean, default: true },\n /**\n * Disable the dropdown button\n */\n disabled: { type: Boolean, default: false },\n /**\n * The size of the dropdown button - Small, Medium or Large.\n */\n size: { type: String as () => NeonSize, default: NeonSize.Medium },\n /**\n * The color of the dropdown button\n */\n color: { type: String as () => NeonFunctionalColor, default: NeonFunctionalColor.LowContrast },\n /**\n * The alternate color of the dropdown button (for gradient buttons).\n */\n alternateColor: { type: String as () => NeonFunctionalColor, default: null },\n /**\n * The style of the dropdown button\n */\n dropdownStyle: { type: String as () => NeonDropdownStyle, default: NeonDropdownStyle.SolidButton },\n /**\n * Placement of the dropdown contents.\n */\n placement: { type: String as () => NeonDropdownPlacement, default: NeonDropdownPlacement.BottomLeft },\n /**\n * Restrict placement to within this container.\n */\n placementContainer: { type: Object as () => HTMLElement, default: null },\n /**\n * Instead of opening on click (default), open on hover.\n */\n openOnHover: { type: Boolean, default: false },\n },\n emits: [\n /**\n * Emitted when the dropdown button is toggled.\n * @type {boolean} the open state of the dropdown.\n */\n 'update:modelValue',\n /**\n * Emitted on initialisation.\n * @type {NeonDropdownPlacement} the placement of the dropdown.\n */\n 'dropdown-placement',\n /**\n * Emitted when the dropdown button is blurred.\n * @type {void}\n */\n 'blur',\n /**\n * Emitted when the dropdown button is focussed.\n * @type {void}\n */\n 'focus',\n /**\n * emitted on initialisation\n * @type {HTMLElement} the reference to the HTMLElement for the dropdown menu button.\n */\n 'button-ref',\n ],\n setup(props, { emit }) {\n const dropdownButton = ref<HTMLElement | null>(null);\n const dropdownContent = ref<HTMLDivElement | null>(null);\n\n const dropdownPlacement = ref<NeonDropdownPlacement>(props.placement);\n const closableUtils = ref<NeonClosableUtils | null>(null);\n\n const onClose = () => {\n emit('update:modelValue', false);\n };\n\n const close = () => {\n if (props.modelValue) {\n onClose();\n }\n };\n\n const recalculatePlacement = () => {\n if (props.modelValue && dropdownButton.value && dropdownContent.value) {\n const previousValue = dropdownPlacement.value;\n dropdownPlacement.value = NeonDropdownPlacementUtils.calculatePlacement(\n dropdownButton.value,\n dropdownContent.value,\n props.placement,\n props.placementContainer,\n );\n\n if (previousValue !== dropdownPlacement.value) {\n emit('dropdown-placement', dropdownPlacement.value);\n }\n }\n };\n\n const toggleOpen = () => {\n if (!props.disabled && !props.openOnHover) {\n emit('update:modelValue', !props.modelValue);\n setTimeout(recalculatePlacement);\n }\n };\n\n const onBlur = () => {\n emit('blur');\n };\n\n const onFocus = () => {\n emit('focus');\n };\n\n onMounted(() => {\n if (!props.openOnHover && dropdownContent.value) {\n closableUtils.value = new NeonClosableUtils(dropdownContent.value, close);\n }\n window.addEventListener('resize', recalculatePlacement, { passive: true });\n window.addEventListener('scroll', recalculatePlacement, { passive: true });\n if (props.placementContainer) {\n props.placementContainer.addEventListener('scroll', recalculatePlacement, { passive: true });\n }\n });\n\n onUnmounted(() => {\n if (!props.openOnHover) {\n closableUtils.value && closableUtils.value.destroy();\n }\n window.removeEventListener('resize', recalculatePlacement);\n window.removeEventListener('scroll', recalculatePlacement);\n if (props.placementContainer) {\n props.placementContainer.removeEventListener('scroll', recalculatePlacement);\n }\n });\n\n watch(\n () => dropdownButton.value,\n (value) => emit('button-ref', value),\n { immediate: true },\n );\n\n defineExpose({ dropdownContent });\n\n return {\n dropdownButton,\n dropdownContent,\n dropdownPlacement,\n closableUtils,\n onClose,\n close,\n toggleOpen,\n onBlur,\n onFocus,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonBadge","NeonButton","NeonExpansionIndicator","NeonSize","NeonFunctionalColor","NeonDropdownStyle","NeonDropdownPlacement","props","emit","dropdownButton","ref","dropdownContent","dropdownPlacement","closableUtils","onClose","close","recalculatePlacement","previousValue","NeonDropdownPlacementUtils","toggleOpen","onBlur","onFocus","onMounted","NeonClosableUtils","onUnmounted","watch","value","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ACA,OAAAC,EACA,QAAAC,CAAA,CAEJ,CACF,CAAC"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as p, ref as u, onMounted as v, onUnmounted as w, watch as y } from "vue";
|
|
2
|
-
import { NeonDropdownPlacement as
|
|
3
|
-
import { NeonDropdownPlacementUtils as
|
|
4
|
-
import { NeonClosableUtils as
|
|
5
|
-
import { NeonSize as
|
|
6
|
-
import { NeonFunctionalColor as
|
|
7
|
-
import { NeonDropdownStyle as
|
|
1
|
+
import { defineComponent as p, ref as u, onMounted as v, onUnmounted as w, watch as y, defineExpose as g } from "vue";
|
|
2
|
+
import { NeonDropdownPlacement as S } from "../../../common/enums/NeonDropdownPlacement.es.js";
|
|
3
|
+
import { NeonDropdownPlacementUtils as C } from "../../../common/utils/NeonDropdownPlacementUtils.es.js";
|
|
4
|
+
import { NeonClosableUtils as b } from "../../../common/utils/NeonClosableUtils.es.js";
|
|
5
|
+
import { NeonSize as B } from "../../../common/enums/NeonSize.es.js";
|
|
6
|
+
import { NeonFunctionalColor as N } from "../../../common/enums/NeonFunctionalColor.es.js";
|
|
7
|
+
import { NeonDropdownStyle as E } from "../../../common/enums/NeonDropdownStyle.es.js";
|
|
8
8
|
import L from "../badge/NeonBadge.vue.es.js";
|
|
9
9
|
import V from "../../user-input/button/NeonButton.vue.es.js";
|
|
10
|
-
import
|
|
11
|
-
const
|
|
10
|
+
import O from "../expansion-indicator/NeonExpansionIndicator.vue.es.js";
|
|
11
|
+
const j = p({
|
|
12
12
|
name: "NeonDropdown",
|
|
13
13
|
components: {
|
|
14
14
|
NeonBadge: L,
|
|
15
15
|
NeonButton: V,
|
|
16
|
-
NeonExpansionIndicator:
|
|
16
|
+
NeonExpansionIndicator: O
|
|
17
17
|
},
|
|
18
18
|
props: {
|
|
19
19
|
/**
|
|
@@ -51,11 +51,11 @@ const h = p({
|
|
|
51
51
|
/**
|
|
52
52
|
* The size of the dropdown button - Small, Medium or Large.
|
|
53
53
|
*/
|
|
54
|
-
size: { type: String, default:
|
|
54
|
+
size: { type: String, default: B.Medium },
|
|
55
55
|
/**
|
|
56
56
|
* The color of the dropdown button
|
|
57
57
|
*/
|
|
58
|
-
color: { type: String, default:
|
|
58
|
+
color: { type: String, default: N.LowContrast },
|
|
59
59
|
/**
|
|
60
60
|
* The alternate color of the dropdown button (for gradient buttons).
|
|
61
61
|
*/
|
|
@@ -63,11 +63,11 @@ const h = p({
|
|
|
63
63
|
/**
|
|
64
64
|
* The style of the dropdown button
|
|
65
65
|
*/
|
|
66
|
-
dropdownStyle: { type: String, default:
|
|
66
|
+
dropdownStyle: { type: String, default: E.SolidButton },
|
|
67
67
|
/**
|
|
68
68
|
* Placement of the dropdown contents.
|
|
69
69
|
*/
|
|
70
|
-
placement: { type: String, default:
|
|
70
|
+
placement: { type: String, default: S.BottomLeft },
|
|
71
71
|
/**
|
|
72
72
|
* Restrict placement to within this container.
|
|
73
73
|
*/
|
|
@@ -112,7 +112,7 @@ const h = p({
|
|
|
112
112
|
}, t = () => {
|
|
113
113
|
if (e.modelValue && a.value && o.value) {
|
|
114
114
|
const i = l.value;
|
|
115
|
-
l.value =
|
|
115
|
+
l.value = C.calculatePlacement(
|
|
116
116
|
a.value,
|
|
117
117
|
o.value,
|
|
118
118
|
e.placement,
|
|
@@ -127,14 +127,14 @@ const h = p({
|
|
|
127
127
|
n("focus");
|
|
128
128
|
};
|
|
129
129
|
return v(() => {
|
|
130
|
-
!e.openOnHover && o.value && (r.value = new
|
|
130
|
+
!e.openOnHover && o.value && (r.value = new b(o.value, m)), window.addEventListener("resize", t, { passive: !0 }), window.addEventListener("scroll", t, { passive: !0 }), e.placementContainer && e.placementContainer.addEventListener("scroll", t, { passive: !0 });
|
|
131
131
|
}), w(() => {
|
|
132
132
|
e.openOnHover || r.value && r.value.destroy(), window.removeEventListener("resize", t), window.removeEventListener("scroll", t), e.placementContainer && e.placementContainer.removeEventListener("scroll", t);
|
|
133
133
|
}), y(
|
|
134
134
|
() => a.value,
|
|
135
135
|
(i) => n("button-ref", i),
|
|
136
136
|
{ immediate: !0 }
|
|
137
|
-
), {
|
|
137
|
+
), g({ dropdownContent: o }), {
|
|
138
138
|
dropdownButton: a,
|
|
139
139
|
dropdownContent: o,
|
|
140
140
|
dropdownPlacement: l,
|
|
@@ -148,6 +148,6 @@ const h = p({
|
|
|
148
148
|
}
|
|
149
149
|
});
|
|
150
150
|
export {
|
|
151
|
-
|
|
151
|
+
j as default
|
|
152
152
|
};
|
|
153
153
|
//# sourceMappingURL=NeonDropdown.es.js.map
|