@aotearoan/neon 21.0.0 → 21.0.2

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 (82) hide show
  1. package/dist/common/enums/NeonBadgeSize.cjs.js +2 -0
  2. package/dist/common/enums/NeonBadgeSize.cjs.js.map +1 -0
  3. package/dist/common/enums/NeonBadgeSize.es.js +5 -0
  4. package/dist/common/enums/NeonBadgeSize.es.js.map +1 -0
  5. package/dist/common/utils/NeonDateUtils.cjs.js +1 -1
  6. package/dist/common/utils/NeonDateUtils.cjs.js.map +1 -1
  7. package/dist/common/utils/NeonDateUtils.es.js +52 -48
  8. package/dist/common/utils/NeonDateUtils.es.js.map +1 -1
  9. package/dist/components/navigation/link/NeonLink.vue.cjs.js +1 -1
  10. package/dist/components/navigation/link/NeonLink.vue.cjs.js.map +1 -1
  11. package/dist/components/navigation/link/NeonLink.vue.es.js +27 -33
  12. package/dist/components/navigation/link/NeonLink.vue.es.js.map +1 -1
  13. package/dist/components/navigation/menu/NeonMenu.vue.cjs.js +1 -1
  14. package/dist/components/navigation/menu/NeonMenu.vue.cjs.js.map +1 -1
  15. package/dist/components/navigation/menu/NeonMenu.vue.es.js +15 -15
  16. package/dist/components/navigation/menu/NeonMenu.vue.es.js.map +1 -1
  17. package/dist/components/presentation/badge/NeonBadge.cjs.js +1 -1
  18. package/dist/components/presentation/badge/NeonBadge.cjs.js.map +1 -1
  19. package/dist/components/presentation/badge/NeonBadge.es.js +8 -8
  20. package/dist/components/presentation/badge/NeonBadge.es.js.map +1 -1
  21. package/dist/components/presentation/dropdown/NeonDropdown.cjs.js +1 -1
  22. package/dist/components/presentation/dropdown/NeonDropdown.cjs.js.map +1 -1
  23. package/dist/components/presentation/dropdown/NeonDropdown.es.js +28 -24
  24. package/dist/components/presentation/dropdown/NeonDropdown.es.js.map +1 -1
  25. package/dist/components/presentation/dropdown/NeonDropdown.vue.cjs.js +1 -1
  26. package/dist/components/presentation/dropdown/NeonDropdown.vue.cjs.js.map +1 -1
  27. package/dist/components/presentation/dropdown/NeonDropdown.vue.es.js +23 -21
  28. package/dist/components/presentation/dropdown/NeonDropdown.vue.es.js.map +1 -1
  29. package/dist/components/user-input/button/NeonButton.cjs.js +1 -1
  30. package/dist/components/user-input/button/NeonButton.cjs.js.map +1 -1
  31. package/dist/components/user-input/button/NeonButton.es.js +26 -22
  32. package/dist/components/user-input/button/NeonButton.es.js.map +1 -1
  33. package/dist/components/user-input/button/NeonButton.vue.cjs.js +1 -1
  34. package/dist/components/user-input/button/NeonButton.vue.cjs.js.map +1 -1
  35. package/dist/components/user-input/button/NeonButton.vue.es.js +11 -10
  36. package/dist/components/user-input/button/NeonButton.vue.es.js.map +1 -1
  37. package/dist/components/user-input/date-picker/NeonDatePicker.cjs.js +1 -1
  38. package/dist/components/user-input/date-picker/NeonDatePicker.cjs.js.map +1 -1
  39. package/dist/components/user-input/date-picker/NeonDatePicker.es.js +27 -23
  40. package/dist/components/user-input/date-picker/NeonDatePicker.es.js.map +1 -1
  41. package/dist/components/user-input/date-picker/NeonDatePicker.vue.cjs.js +1 -1
  42. package/dist/components/user-input/date-picker/NeonDatePicker.vue.cjs.js.map +1 -1
  43. package/dist/components/user-input/date-picker/NeonDatePicker.vue.es.js +99 -114
  44. package/dist/components/user-input/date-picker/NeonDatePicker.vue.es.js.map +1 -1
  45. package/dist/components/user-input/input/NeonInput.cjs.js +1 -1
  46. package/dist/components/user-input/input/NeonInput.cjs.js.map +1 -1
  47. package/dist/components/user-input/input/NeonInput.es.js +30 -30
  48. package/dist/components/user-input/input/NeonInput.es.js.map +1 -1
  49. package/dist/neon.cjs.js +1 -1
  50. package/dist/neon.es.js +93 -91
  51. package/dist/neon.es.js.map +1 -1
  52. package/dist/src/common/enums/NeonBadgeSize.d.ts +15 -0
  53. package/dist/src/common/models/NeonCalendarConfig.d.ts +10 -0
  54. package/dist/src/common/utils/NeonDateUtils.d.ts +4 -2
  55. package/dist/src/components/feedback/dialog/NeonDialog.d.ts +12 -0
  56. package/dist/src/components/feedback/note/NeonNote.d.ts +6 -0
  57. package/dist/src/components/layout/card-list/NeonCardList.d.ts +20 -4
  58. package/dist/src/components/layout/modal/NeonModal.d.ts +6 -0
  59. package/dist/src/components/navigation/dropdown-menu/NeonDropdownMenu.d.ts +123 -39
  60. package/dist/src/components/navigation/menu/NeonMenu.d.ts +99 -27
  61. package/dist/src/components/navigation/mobile-menu/NeonMobileMenu.d.ts +57 -39
  62. package/dist/src/components/presentation/badge/NeonBadge.d.ts +12 -20
  63. package/dist/src/components/presentation/dropdown/NeonDropdown.d.ts +45 -23
  64. package/dist/src/components/presentation/image-carousel/NeonImageCarousel.d.ts +6 -0
  65. package/dist/src/components/user-input/button/NeonButton.d.ts +15 -1
  66. package/dist/src/components/user-input/date-picker/NeonDatePicker.d.ts +144 -116
  67. package/dist/src/components/user-input/file/NeonFile.d.ts +16 -14
  68. package/dist/src/components/user-input/input/NeonInput.d.ts +5 -9
  69. package/dist/src/components/user-input/number/NeonNumber.d.ts +20 -46
  70. package/dist/src/components/user-input/search/NeonSearch.d.ts +165 -165
  71. package/dist/src/components/user-input/select/NeonSelect.d.ts +261 -81
  72. package/dist/src/neon.d.ts +1 -0
  73. package/package.json +1 -1
  74. package/src/sass/components/_action-menu.scss +2 -7
  75. package/src/sass/components/_badge.scss +16 -42
  76. package/src/sass/components/_button.scss +0 -6
  77. package/src/sass/components/_card-list.scss +1 -6
  78. package/src/sass/components/_date-picker.scss +20 -0
  79. package/src/sass/components/_link.scss +3 -5
  80. package/src/sass/components/_search.scss +12 -0
  81. package/src/sass/components/_tree-menu.scss +1 -0
  82. package/src/sass/variables.scss +7 -1
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var t=(r=>(r.Small="s",r.Medium="m",r.Large="l",r.ExtraLarge="xl",r.ExtraExtraLarge="xxl",r))(t||{});exports.NeonBadgeSize=t;
2
+ //# sourceMappingURL=NeonBadgeSize.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NeonBadgeSize.cjs.js","sources":["../../../src/common/enums/NeonBadgeSize.ts"],"sourcesContent":["/**\n * Describes the available sizing options for <a href=\"/presentation/badge\">NeonBadge</a>.\n */\nexport enum NeonBadgeSize {\n /** A small badge size, typically has a default of 32 rem. */\n Small = 's',\n /** A medium badge size, usually the default size. Which typically has a default of 40 rem. */\n Medium = 'm',\n /** A large badge size, typically has a default of 48 rem. */\n Large = 'l',\n /** An extra large badge size, typically has a default of 64 rem. */\n ExtraLarge = 'xl',\n /** An extra, extra large badge size, typically has a default of 80 rem. */\n ExtraExtraLarge = 'xxl',\n}\n"],"names":["NeonBadgeSize"],"mappings":"gFAGO,IAAKA,GAAAA,IAEVA,EAAA,MAAQ,IAERA,EAAA,OAAS,IAETA,EAAA,MAAQ,IAERA,EAAA,WAAa,KAEbA,EAAA,gBAAkB,MAVRA,IAAAA,GAAA,CAAA,CAAA"}
@@ -0,0 +1,5 @@
1
+ var x = /* @__PURE__ */ ((r) => (r.Small = "s", r.Medium = "m", r.Large = "l", r.ExtraLarge = "xl", r.ExtraExtraLarge = "xxl", r))(x || {});
2
+ export {
3
+ x as NeonBadgeSize
4
+ };
5
+ //# sourceMappingURL=NeonBadgeSize.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NeonBadgeSize.es.js","sources":["../../../src/common/enums/NeonBadgeSize.ts"],"sourcesContent":["/**\n * Describes the available sizing options for <a href=\"/presentation/badge\">NeonBadge</a>.\n */\nexport enum NeonBadgeSize {\n /** A small badge size, typically has a default of 32 rem. */\n Small = 's',\n /** A medium badge size, usually the default size. Which typically has a default of 40 rem. */\n Medium = 'm',\n /** A large badge size, typically has a default of 48 rem. */\n Large = 'l',\n /** An extra large badge size, typically has a default of 64 rem. */\n ExtraLarge = 'xl',\n /** An extra, extra large badge size, typically has a default of 80 rem. */\n ExtraExtraLarge = 'xxl',\n}\n"],"names":["NeonBadgeSize"],"mappings":"AAGO,IAAKA,sBAAAA,OAEVA,EAAA,QAAQ,KAERA,EAAA,SAAS,KAETA,EAAA,QAAQ,KAERA,EAAA,aAAa,MAEbA,EAAA,kBAAkB,OAVRA,IAAAA,KAAA,CAAA,CAAA;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class i{static stringToNeonDate(t,o,e=!1){const a=o||navigator.language,g=new Date,n=new Date(!e&&t.length===10?`${t}T${g.toISOString().split("T")[1]}`:t);let r;t.length>10&&(r=n.toLocaleString(a,t.length<=16?{hour12:!1,hour:"2-digit",minute:"2-digit"}:{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}));const d={year:+n.toLocaleString("en-US",{year:"numeric"}),yearFormatted:n.toLocaleString(a,{year:"numeric"}),month:+n.toLocaleString("en-US",{month:"numeric"}),monthShortName:n.toLocaleString(a,{month:"short"}),monthLongName:n.toLocaleString(a,{month:"long"}),day:+n.toLocaleString("en-US",{day:"numeric"}),dayFormatted:n.toLocaleString(a,{day:"2-digit"})};return r&&(d.time=r),d}static dateToIso(t,o=!1){const e=t.toISOString();return o?e:e.split("T")[0]}static dmyToIso(t,o,e){return`${e}-${o<10?"0"+o:o}-${t<10?"0"+t:t}`}static dowNames(t){const o=t||navigator.language,e=new Date,a=[];for(;!a[e.getDay()];)a[e.getDay()]=e.toLocaleString(o,{weekday:"short"}),e.setDate(e.getDate()+1);const g=a.shift();return g&&a.push(g),a}static monthNames(t){const o=t||navigator.language;return Array.from(Array(12).keys()).map(e=>new Date(2023,e,15).toLocaleString(o,{month:"short"}))}static toCalendarConfiguration(t,o,e,a,g){const n=g||navigator.language,r=i.stringToNeonDate(i.dateToIso(new Date),n),d=t?i.stringToNeonDate(t,n,!0):void 0,h=o||r.month,S=o&&e?new Date(e,o-1,15):null,L=(S==null?void 0:S.toLocaleString(n,{month:"long"}))||r.monthLongName,u=e||r.year,T=a||Math.floor(u/10)*10,c=new Date(u,(h+11)%12,1),f=new Date(u,(h+11)%12,1);f.setDate(f.getDate()-1);const m=[];let D=1,w=!1;for(let s=0;s<6;s++){m[s]=[];for(let l=0;l<7;l++)if(s===0&&l<f.getDay())m[s][l]=null;else if(m[s][l]=c.getDate(),D=c.getDate(),c.setDate(c.getDate()+1),c.getDate()===1){for(let y=l+1;y<7;y++)m[s][y]=null;w=!0;break}if(w)break}return{today:r,selected:d,pageMonth:h,pageMonthName:L,pageYear:u,pageDecadeStart:T,dowNames:i.dowNames(n),dates:m,lastDayOfMonth:D,months:i.monthNames(n)}}}exports.NeonDateUtils=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class s{static stringToNeonDate(e,o,a=!1){const n=o||navigator.language,r=new Date,t=new Date(!a&&e.length===10?`${e}T${r.toISOString().split("T")[1]}`:e);let i;e.length>10&&(i=t.toLocaleString(n,e.length<=16?{hour12:!1,hour:"2-digit",minute:"2-digit"}:{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}));const d={year:+t.toLocaleString("en-US",{year:"numeric"}),yearFormatted:t.toLocaleString(n,{year:"numeric"}),month:+t.toLocaleString("en-US",{month:"numeric"}),monthShortName:t.toLocaleString(n,{month:"short"}),monthLongName:t.toLocaleString(n,{month:"long"}),day:+t.toLocaleString("en-US",{day:"numeric"}),dayFormatted:t.toLocaleString(n,{day:"2-digit"})};return i&&(d.time=i),d}static dateToIso(e,o=!1){const a=e.toISOString();return o?a:a.split("T")[0]}static dmyToIso(e,o,a){return`${a}-${o<10?"0"+o:o}-${e<10?"0"+e:e}`}static dowNames(e,o="short"){const a=e||navigator.language,n=new Date,r=[];for(;!r[n.getDay()];)r[n.getDay()]=n.toLocaleString(a,{weekday:o}),n.setDate(n.getDate()+1);const t=r.shift();return t&&r.push(t),r}static monthNames(e,o="short"){const a=e||navigator.language;return Array.from(Array(12).keys()).map(n=>new Date(2023,n,15).toLocaleString(a,{month:o}))}static toCalendarConfiguration(e,o,a,n,r){const t=r||navigator.language,i=s.stringToNeonDate(s.dateToIso(new Date),t),d=e?s.stringToNeonDate(e,t,!0):void 0,u=o||i.month,S=o&&a?new Date(a,o-1,15):null,L=(S==null?void 0:S.toLocaleString(t,{month:"long"}))||i.monthLongName,h=a||i.year,N=n||Math.floor(h/10)*10,c=new Date(h,(u+11)%12,1),f=new Date(h,(u+11)%12,1);f.setDate(f.getDate()-1);const m=[];let D=1,w=!1;for(let g=0;g<6;g++){m[g]=[];for(let l=0;l<7;l++)if(g===0&&l<f.getDay())m[g][l]=null;else if(m[g][l]=c.getDate(),D=c.getDate(),c.setDate(c.getDate()+1),c.getDate()===1){for(let y=l+1;y<7;y++)m[g][y]=null;w=!0;break}if(w)break}return{today:i,selected:d,pageMonth:u,pageMonthName:L,pageYear:h,pageDecadeStart:N,dowNames:s.dowNames(t),dowLongNames:s.dowNames(t,"long"),dates:m,lastDayOfMonth:D,months:s.monthNames(t),monthLongNames:s.monthNames(t,"long")}}}exports.NeonDateUtils=s;
2
2
  //# sourceMappingURL=NeonDateUtils.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NeonDateUtils.cjs.js","sources":["../../../src/common/utils/NeonDateUtils.ts"],"sourcesContent":["import type { NeonCalendarConfig } from '@/common/models/NeonCalendarConfig';\nimport type { NeonDate } from '@/common/models/NeonDate';\n\n/**\n * Date utilities for general application use as well as internally with the\n * <a href=\"/user-input/date-picker\">NeonDatePicker</a> component.\n */\nexport class NeonDateUtils {\n /**\n * Convert an ISO 8601 formatted string to a locale formatted date with a three letter month, a 2 digit day and a locale formatted time.\n *\n * @param date The date/time as an <a href=\"https://en.wikipedia.org/wiki/ISO_8601\">ISO 8601</a> string.\n * @param locale The locale for which to convert the date for display purposes, defaults to browser locale.\n * @param strict Do not add time component to localise the date.\n *\n * @returns Object representing the provided date.\n */\n public static stringToNeonDate(date: string, locale?: string, strict = false): NeonDate {\n const loc = locale || navigator.language;\n const now = new Date();\n const dateObj = new Date(!strict && date.length === 10 ? `${date}T${now.toISOString().split('T')[1]}` : date);\n let time;\n if (date.length > 10) {\n time = dateObj.toLocaleString(\n loc,\n date.length <= 16\n ? { hour12: false, hour: '2-digit', minute: '2-digit' }\n : { hour12: false, hour: '2-digit', minute: '2-digit', second: '2-digit' },\n );\n }\n\n const result: NeonDate = {\n year: +dateObj.toLocaleString('en-US', { year: 'numeric' }),\n yearFormatted: dateObj.toLocaleString(loc, { year: 'numeric' }),\n month: +dateObj.toLocaleString('en-US', { month: 'numeric' }),\n monthShortName: dateObj.toLocaleString(loc, { month: 'short' }),\n monthLongName: dateObj.toLocaleString(loc, { month: 'long' }),\n day: +dateObj.toLocaleString('en-US', { day: 'numeric' }),\n dayFormatted: dateObj.toLocaleString(loc, { day: '2-digit' }),\n };\n\n if (time) {\n result.time = time;\n }\n\n return result;\n }\n\n /**\n * Convert a date object to an ISO 8601 formatted string. By default, the time is not considered.\n *\n * @param date Javascript date object.\n * @param time Whether to consider the time as part of the conversion to the ISO string.\n *\n * @returns an ISO 8601 formatted date, optionally with the time as well.\n */\n public static dateToIso(date: Date, time = false): string {\n const dateString = date.toISOString();\n return time ? dateString : dateString.split('T')[0];\n }\n\n /**\n * Convert the params received into an ISO 8601 formatted string with only date in it.\n *\n * @param day The number of the day to be used.\n * @param month The number of the month to be used.\n * @param year The number of the year to be used.\n *\n * @returns an ISO 8601 formatted date for the given parameters.\n */\n public static dmyToIso(day: number, month: number, year: number): string {\n return `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`;\n }\n\n /**\n * Returns the days of the week starting at Monday day name translated using the locale received as a first element.\n *\n * @param locale The locale for which to convert the date for display purposes, defaults to browser locale.\n *\n * @returns an array with the days of the week named according to the locale received.\n */\n public static dowNames(locale?: string): Array<string> {\n const loc = locale || navigator.language;\n const date = new Date();\n\n const weekdays = [];\n while (!weekdays[date.getDay()]) {\n weekdays[date.getDay()] = date.toLocaleString(loc, { weekday: 'short' });\n date.setDate(date.getDate() + 1);\n }\n\n const sunday = weekdays.shift();\n if (sunday) {\n weekdays.push(sunday);\n }\n\n return weekdays;\n }\n\n /**\n * Returns the months of the year starting at January month name translated using the locale received as a first element.\n *\n * @param locale The locale for which to convert the date for display purposes, defaults to browser locale.\n *\n * @returns an array with the month names of the year, all named according to the locale received.\n */\n public static monthNames(locale?: string): Array<string> {\n const loc = locale || navigator.language;\n\n return Array.from(Array(12).keys()).map((key) => {\n const date = new Date(2023, key, 15);\n return date.toLocaleString(loc, { month: 'short' });\n });\n }\n\n /**\n * Collate & return the data required to drive the calendar popup in\n * <a href=\"/user-input/date-picker\">NeonDatePicker</a>.\n *\n * @param selectedDate ISO-8601 date-only string for the selected date.\n * @param currentPageMonth month of the current calendar page.\n * @param currentPageYear year of the current calendar page.\n * @param currentPageDecadeStart decade start year of the current calendar page.\n * @param locale user's locale.\n *\n * @returns The calendar configuration.\n */\n public static toCalendarConfiguration(\n selectedDate?: string,\n currentPageMonth?: number,\n currentPageYear?: number,\n currentPageDecadeStart?: number,\n locale?: string,\n ): NeonCalendarConfig {\n const loc = locale || navigator.language;\n const today = NeonDateUtils.stringToNeonDate(NeonDateUtils.dateToIso(new Date()), loc);\n const selected = selectedDate ? NeonDateUtils.stringToNeonDate(selectedDate, loc, true) : undefined;\n // month indexed from 1-12\n const pageMonth = currentPageMonth || today.month;\n\n // month indexed from 0-11\n const pageDate = currentPageMonth && currentPageYear ? new Date(currentPageYear, currentPageMonth - 1, 15) : null;\n const pageMonthName = pageDate?.toLocaleString(loc, { month: 'long' }) || today.monthLongName;\n const pageYear = currentPageYear || today.year;\n const pageDecadeStart = currentPageDecadeStart || Math.floor(pageYear / 10) * 10;\n\n // determine dow of first day of month. Months are indexed from 0 here\n const date = new Date(pageYear, (pageMonth + 11) % 12, 1);\n const offsetDate = new Date(pageYear, (pageMonth + 11) % 12, 1);\n offsetDate.setDate(offsetDate.getDate() - 1);\n\n const dates: Array<Array<number | null>> = [];\n\n let lastDayOfMonth = 1;\n let done = false;\n\n for (let row = 0; row < 6; row++) {\n dates[row] = [];\n\n for (let col = 0; col < 7; col++) {\n if (row === 0 && col < offsetDate.getDay()) {\n dates[row][col] = null;\n } else {\n dates[row][col] = date.getDate();\n lastDayOfMonth = date.getDate();\n date.setDate(date.getDate() + 1);\n\n if (date.getDate() === 1) {\n for (let i = col + 1; i < 7; i++) {\n dates[row][i] = null;\n }\n done = true;\n break;\n }\n }\n }\n\n if (done) {\n break;\n }\n }\n\n return {\n today,\n selected,\n pageMonth,\n pageMonthName,\n pageYear,\n pageDecadeStart,\n dowNames: NeonDateUtils.dowNames(loc),\n dates,\n lastDayOfMonth,\n months: NeonDateUtils.monthNames(loc),\n };\n }\n}\n"],"names":["NeonDateUtils","date","locale","strict","loc","now","dateObj","time","result","dateString","day","month","year","weekdays","sunday","key","selectedDate","currentPageMonth","currentPageYear","currentPageDecadeStart","today","selected","pageMonth","pageDate","pageMonthName","pageYear","pageDecadeStart","offsetDate","dates","lastDayOfMonth","done","row","col","i"],"mappings":"gFAOO,MAAMA,CAAc,CAUzB,OAAc,iBAAiBC,EAAcC,EAAiBC,EAAS,GAAiB,CACtF,MAAMC,EAAMF,GAAU,UAAU,SAC1BG,MAAU,KACVC,EAAU,IAAI,KAAK,CAACH,GAAUF,EAAK,SAAW,GAAK,GAAGA,CAAI,IAAII,EAAI,YAAA,EAAc,MAAM,GAAG,EAAE,CAAC,CAAC,GAAKJ,CAAI,EAC5G,IAAIM,EACAN,EAAK,OAAS,KAChBM,EAAOD,EAAQ,eACbF,EACAH,EAAK,QAAU,GACX,CAAE,OAAQ,GAAO,KAAM,UAAW,OAAQ,WAC1C,CAAE,OAAQ,GAAO,KAAM,UAAW,OAAQ,UAAW,OAAQ,SAAA,CAAU,GAI/E,MAAMO,EAAmB,CACvB,KAAM,CAACF,EAAQ,eAAe,QAAS,CAAE,KAAM,UAAW,EAC1D,cAAeA,EAAQ,eAAeF,EAAK,CAAE,KAAM,UAAW,EAC9D,MAAO,CAACE,EAAQ,eAAe,QAAS,CAAE,MAAO,UAAW,EAC5D,eAAgBA,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CAAG,CAAA,CAExC,CACF"}
1
+ {"version":3,"file":"NeonDateUtils.cjs.js","sources":["../../../src/common/utils/NeonDateUtils.ts"],"sourcesContent":["import type { NeonCalendarConfig } from '@/common/models/NeonCalendarConfig';\nimport type { NeonDate } from '@/common/models/NeonDate';\n\n/**\n * Date utilities for general application use as well as internally with the\n * <a href=\"/user-input/date-picker\">NeonDatePicker</a> component.\n */\nexport class NeonDateUtils {\n /**\n * Convert an ISO 8601 formatted string to a locale formatted date with a three letter month, a 2 digit day and a locale formatted time.\n *\n * @param date The date/time as an <a href=\"https://en.wikipedia.org/wiki/ISO_8601\">ISO 8601</a> string.\n * @param locale The locale for which to convert the date for display purposes, defaults to browser locale.\n * @param strict Do not add time component to localise the date.\n *\n * @returns Object representing the provided date.\n */\n public static stringToNeonDate(date: string, locale?: string, strict = false): NeonDate {\n const loc = locale || navigator.language;\n const now = new Date();\n const dateObj = new Date(!strict && date.length === 10 ? `${date}T${now.toISOString().split('T')[1]}` : date);\n let time;\n if (date.length > 10) {\n time = dateObj.toLocaleString(\n loc,\n date.length <= 16\n ? { hour12: false, hour: '2-digit', minute: '2-digit' }\n : { hour12: false, hour: '2-digit', minute: '2-digit', second: '2-digit' },\n );\n }\n\n const result: NeonDate = {\n year: +dateObj.toLocaleString('en-US', { year: 'numeric' }),\n yearFormatted: dateObj.toLocaleString(loc, { year: 'numeric' }),\n month: +dateObj.toLocaleString('en-US', { month: 'numeric' }),\n monthShortName: dateObj.toLocaleString(loc, { month: 'short' }),\n monthLongName: dateObj.toLocaleString(loc, { month: 'long' }),\n day: +dateObj.toLocaleString('en-US', { day: 'numeric' }),\n dayFormatted: dateObj.toLocaleString(loc, { day: '2-digit' }),\n };\n\n if (time) {\n result.time = time;\n }\n\n return result;\n }\n\n /**\n * Convert a date object to an ISO 8601 formatted string. By default, the time is not considered.\n *\n * @param date Javascript date object.\n * @param time Whether to consider the time as part of the conversion to the ISO string.\n *\n * @returns an ISO 8601 formatted date, optionally with the time as well.\n */\n public static dateToIso(date: Date, time = false): string {\n const dateString = date.toISOString();\n return time ? dateString : dateString.split('T')[0];\n }\n\n /**\n * Convert the params received into an ISO 8601 formatted string with only date in it.\n *\n * @param day The number of the day to be used.\n * @param month The number of the month to be used.\n * @param year The number of the year to be used.\n *\n * @returns an ISO 8601 formatted date for the given parameters.\n */\n public static dmyToIso(day: number, month: number, year: number): string {\n return `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`;\n }\n\n /**\n * Returns the days of the week starting at Monday day name translated using the locale received as a first element.\n *\n * @param locale The locale for which to convert the date for display purposes, defaults to browser locale.\n * @param format The format of the returned values\n *\n * @returns an array with the days of the week named according to the locale received.\n */\n public static dowNames(locale?: string, format: 'long' | 'short' | 'narrow' = 'short'): Array<string> {\n const loc = locale || navigator.language;\n const date = new Date();\n\n const weekdays = [];\n while (!weekdays[date.getDay()]) {\n weekdays[date.getDay()] = date.toLocaleString(loc, { weekday: format });\n date.setDate(date.getDate() + 1);\n }\n\n const sunday = weekdays.shift();\n if (sunday) {\n weekdays.push(sunday);\n }\n\n return weekdays;\n }\n\n /**\n * Returns the months of the year starting at January month name translated using the locale received as a first element.\n *\n * @param locale The locale for which to convert the date for display purposes, defaults to browser locale.\n * @param format The format of the month names to return\n *\n * @returns an array with the month names of the year, all named according to the locale received.\n */\n public static monthNames(\n locale?: string,\n format: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow' = 'short',\n ): Array<string> {\n const loc = locale || navigator.language;\n\n return Array.from(Array(12).keys()).map((key) => {\n const date = new Date(2023, key, 15);\n return date.toLocaleString(loc, { month: format });\n });\n }\n\n /**\n * Collate & return the data required to drive the calendar popup in\n * <a href=\"/user-input/date-picker\">NeonDatePicker</a>.\n *\n * @param selectedDate ISO-8601 date-only string for the selected date.\n * @param currentPageMonth month of the current calendar page.\n * @param currentPageYear year of the current calendar page.\n * @param currentPageDecadeStart decade start year of the current calendar page.\n * @param locale user's locale.\n *\n * @returns The calendar configuration.\n */\n public static toCalendarConfiguration(\n selectedDate?: string,\n currentPageMonth?: number,\n currentPageYear?: number,\n currentPageDecadeStart?: number,\n locale?: string,\n ): NeonCalendarConfig {\n const loc = locale || navigator.language;\n const today = NeonDateUtils.stringToNeonDate(NeonDateUtils.dateToIso(new Date()), loc);\n const selected = selectedDate ? NeonDateUtils.stringToNeonDate(selectedDate, loc, true) : undefined;\n // month indexed from 1-12\n const pageMonth = currentPageMonth || today.month;\n\n // month indexed from 0-11\n const pageDate = currentPageMonth && currentPageYear ? new Date(currentPageYear, currentPageMonth - 1, 15) : null;\n const pageMonthName = pageDate?.toLocaleString(loc, { month: 'long' }) || today.monthLongName;\n const pageYear = currentPageYear || today.year;\n const pageDecadeStart = currentPageDecadeStart || Math.floor(pageYear / 10) * 10;\n\n // determine dow of first day of month. Months are indexed from 0 here\n const date = new Date(pageYear, (pageMonth + 11) % 12, 1);\n const offsetDate = new Date(pageYear, (pageMonth + 11) % 12, 1);\n offsetDate.setDate(offsetDate.getDate() - 1);\n\n const dates: Array<Array<number | null>> = [];\n\n let lastDayOfMonth = 1;\n let done = false;\n\n for (let row = 0; row < 6; row++) {\n dates[row] = [];\n\n for (let col = 0; col < 7; col++) {\n if (row === 0 && col < offsetDate.getDay()) {\n dates[row][col] = null;\n } else {\n dates[row][col] = date.getDate();\n lastDayOfMonth = date.getDate();\n date.setDate(date.getDate() + 1);\n\n if (date.getDate() === 1) {\n for (let i = col + 1; i < 7; i++) {\n dates[row][i] = null;\n }\n done = true;\n break;\n }\n }\n }\n\n if (done) {\n break;\n }\n }\n\n return {\n today,\n selected,\n pageMonth,\n pageMonthName,\n pageYear,\n pageDecadeStart,\n dowNames: NeonDateUtils.dowNames(loc),\n dowLongNames: NeonDateUtils.dowNames(loc, 'long'),\n dates,\n lastDayOfMonth,\n months: NeonDateUtils.monthNames(loc),\n monthLongNames: NeonDateUtils.monthNames(loc, 'long'),\n };\n }\n}\n"],"names":["NeonDateUtils","date","locale","strict","loc","now","dateObj","time","result","dateString","day","month","year","format","weekdays","sunday","key","selectedDate","currentPageMonth","currentPageYear","currentPageDecadeStart","today","selected","pageMonth","pageDate","pageMonthName","pageYear","pageDecadeStart","offsetDate","dates","lastDayOfMonth","done","row","col","i"],"mappings":"gFAOO,MAAMA,CAAc,CAUzB,OAAc,iBAAiBC,EAAcC,EAAiBC,EAAS,GAAiB,CACtF,MAAMC,EAAMF,GAAU,UAAU,SAC1BG,MAAU,KACVC,EAAU,IAAI,KAAK,CAACH,GAAUF,EAAK,SAAW,GAAK,GAAGA,CAAI,IAAII,EAAI,YAAA,EAAc,MAAM,GAAG,EAAE,CAAC,CAAC,GAAKJ,CAAI,EAC5G,IAAIM,EACAN,EAAK,OAAS,KAChBM,EAAOD,EAAQ,eACbF,EACAH,EAAK,QAAU,GACX,CAAE,OAAQ,GAAO,KAAM,UAAW,OAAQ,WAC1C,CAAE,OAAQ,GAAO,KAAM,UAAW,OAAQ,UAAW,OAAQ,SAAA,CAAU,GAI/E,MAAMO,EAAmB,CACvB,KAAM,CAACF,EAAQ,eAAe,QAAS,CAAE,KAAM,UAAW,EAC1D,cAAeA,EAAQ,eAAeF,EAAK,CAAE,KAAM,UAAW,EAC9D,MAAO,CAACE,EAAQ,eAAe,QAAS,CAAE,MAAO,UAAW,EAC5D,eAAgBA,EAAQ,eAAeF,EAAK,CAAE,MAAO,QAAS,EAC9D,cAAeE,EAAQ,eAAeF,EAAK,CAAE,MAAO,OAAQ,EAC5D,IAAK,CAACE,EAAQ,eAAe,QAAS,CAAE,IAAK,UAAW,EACxD,aAAcA,EAAQ,eAAeF,EAAK,CAAE,IAAK,UAAW,CAAA,EAG9D,OAAIG,IACFC,EAAO,KAAOD,GAGTC,CACT,CAUA,OAAc,UAAUP,EAAYM,EAAO,GAAe,CACxD,MAAME,EAAaR,EAAK,YAAA,EACxB,OAAOM,EAAOE,EAAaA,EAAW,MAAM,GAAG,EAAE,CAAC,CACpD,CAWA,OAAc,SAASC,EAAaC,EAAeC,EAAsB,CACvE,MAAO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AAC,EAClDK,EAAa,IAAI,KAAKF,GAAWH,EAAY,IAAM,GAAI,CAAC,EAC9DK,EAAW,QAAQA,EAAW,QAAA,EAAY,CAAC,EAE3C,MAAMC,EAAqC,CAAA,EAE3C,IAAIC,EAAiB,EACjBC,EAAO,GAEX,QAASC,EAAM,EAAGA,EAAM,EAAGA,IAAO,CAChCH,EAAMG,CAAG,EAAI,CAAA,EAEb,QAASC,EAAM,EAAGA,EAAM,EAAGA,IACzB,GAAID,IAAQ,GAAKC,EAAML,EAAW,SAChCC,EAAMG,CAAG,EAAEC,CAAG,EAAI,aAElBJ,EAAMG,CAAG,EAAEC,CAAG,EAAIhC,EAAK,QAAA,EACvB6B,EAAiB7B,EAAK,QAAA,EACtBA,EAAK,QAAQA,EAAK,QAAA,EAAY,CAAC,EAE3BA,EAAK,QAAA,IAAc,EAAG,CACxB,QAASiC,EAAID,EAAM,EAAGC,EAAI,EAAGA,IAC3BL,EAAMG,CAAG,EAAEE,CAAC,EAAI,KAElBH,EAAO,GACP,KACF,CAIJ,GAAIA,EACF,KAEJ,CAEA,MAAO,CACL,MAAAV,EACA,SAAAC,EACA,UAAAC,EACA,cAAAE,EACA,SAAAC,EACA,gBAAAC,EACA,SAAU3B,EAAc,SAASI,CAAG,EACpC,aAAcJ,EAAc,SAASI,EAAK,MAAM,EAChD,MAAAyB,EACA,eAAAC,EACA,OAAQ9B,EAAc,WAAWI,CAAG,EACpC,eAAgBJ,EAAc,WAAWI,EAAK,MAAM,CAAA,CAExD,CACF"}
@@ -1,4 +1,4 @@
1
- class c {
1
+ class g {
2
2
  /**
3
3
  * Convert an ISO 8601 formatted string to a locale formatted date with a three letter month, a 2 digit day and a locale formatted time.
4
4
  *
@@ -8,23 +8,23 @@ class c {
8
8
  *
9
9
  * @returns Object representing the provided date.
10
10
  */
11
- static stringToNeonDate(t, o, e = !1) {
12
- const a = o || navigator.language, i = /* @__PURE__ */ new Date(), n = new Date(!e && t.length === 10 ? `${t}T${i.toISOString().split("T")[1]}` : t);
13
- let r;
14
- t.length > 10 && (r = n.toLocaleString(
15
- a,
16
- t.length <= 16 ? { hour12: !1, hour: "2-digit", minute: "2-digit" } : { hour12: !1, hour: "2-digit", minute: "2-digit", second: "2-digit" }
11
+ static stringToNeonDate(e, o, a = !1) {
12
+ const n = o || navigator.language, r = /* @__PURE__ */ new Date(), t = new Date(!a && e.length === 10 ? `${e}T${r.toISOString().split("T")[1]}` : e);
13
+ let s;
14
+ e.length > 10 && (s = t.toLocaleString(
15
+ n,
16
+ e.length <= 16 ? { hour12: !1, hour: "2-digit", minute: "2-digit" } : { hour12: !1, hour: "2-digit", minute: "2-digit", second: "2-digit" }
17
17
  ));
18
18
  const d = {
19
- year: +n.toLocaleString("en-US", { year: "numeric" }),
20
- yearFormatted: n.toLocaleString(a, { year: "numeric" }),
21
- month: +n.toLocaleString("en-US", { month: "numeric" }),
22
- monthShortName: n.toLocaleString(a, { month: "short" }),
23
- monthLongName: n.toLocaleString(a, { month: "long" }),
24
- day: +n.toLocaleString("en-US", { day: "numeric" }),
25
- dayFormatted: n.toLocaleString(a, { day: "2-digit" })
19
+ year: +t.toLocaleString("en-US", { year: "numeric" }),
20
+ yearFormatted: t.toLocaleString(n, { year: "numeric" }),
21
+ month: +t.toLocaleString("en-US", { month: "numeric" }),
22
+ monthShortName: t.toLocaleString(n, { month: "short" }),
23
+ monthLongName: t.toLocaleString(n, { month: "long" }),
24
+ day: +t.toLocaleString("en-US", { day: "numeric" }),
25
+ dayFormatted: t.toLocaleString(n, { day: "2-digit" })
26
26
  };
27
- return r && (d.time = r), d;
27
+ return s && (d.time = s), d;
28
28
  }
29
29
  /**
30
30
  * Convert a date object to an ISO 8601 formatted string. By default, the time is not considered.
@@ -34,9 +34,9 @@ class c {
34
34
  *
35
35
  * @returns an ISO 8601 formatted date, optionally with the time as well.
36
36
  */
37
- static dateToIso(t, o = !1) {
38
- const e = t.toISOString();
39
- return o ? e : e.split("T")[0];
37
+ static dateToIso(e, o = !1) {
38
+ const a = e.toISOString();
39
+ return o ? a : a.split("T")[0];
40
40
  }
41
41
  /**
42
42
  * Convert the params received into an ISO 8601 formatted string with only date in it.
@@ -47,33 +47,35 @@ class c {
47
47
  *
48
48
  * @returns an ISO 8601 formatted date for the given parameters.
49
49
  */
50
- static dmyToIso(t, o, e) {
51
- return `${e}-${o < 10 ? "0" + o : o}-${t < 10 ? "0" + t : t}`;
50
+ static dmyToIso(e, o, a) {
51
+ return `${a}-${o < 10 ? "0" + o : o}-${e < 10 ? "0" + e : e}`;
52
52
  }
53
53
  /**
54
54
  * Returns the days of the week starting at Monday day name translated using the locale received as a first element.
55
55
  *
56
56
  * @param locale The locale for which to convert the date for display purposes, defaults to browser locale.
57
+ * @param format The format of the returned values
57
58
  *
58
59
  * @returns an array with the days of the week named according to the locale received.
59
60
  */
60
- static dowNames(t) {
61
- const o = t || navigator.language, e = /* @__PURE__ */ new Date(), a = [];
62
- for (; !a[e.getDay()]; )
63
- a[e.getDay()] = e.toLocaleString(o, { weekday: "short" }), e.setDate(e.getDate() + 1);
64
- const i = a.shift();
65
- return i && a.push(i), a;
61
+ static dowNames(e, o = "short") {
62
+ const a = e || navigator.language, n = /* @__PURE__ */ new Date(), r = [];
63
+ for (; !r[n.getDay()]; )
64
+ r[n.getDay()] = n.toLocaleString(a, { weekday: o }), n.setDate(n.getDate() + 1);
65
+ const t = r.shift();
66
+ return t && r.push(t), r;
66
67
  }
67
68
  /**
68
69
  * Returns the months of the year starting at January month name translated using the locale received as a first element.
69
70
  *
70
71
  * @param locale The locale for which to convert the date for display purposes, defaults to browser locale.
72
+ * @param format The format of the month names to return
71
73
  *
72
74
  * @returns an array with the month names of the year, all named according to the locale received.
73
75
  */
74
- static monthNames(t) {
75
- const o = t || navigator.language;
76
- return Array.from(Array(12).keys()).map((e) => new Date(2023, e, 15).toLocaleString(o, { month: "short" }));
76
+ static monthNames(e, o = "short") {
77
+ const a = e || navigator.language;
78
+ return Array.from(Array(12).keys()).map((n) => new Date(2023, n, 15).toLocaleString(a, { month: o }));
77
79
  }
78
80
  /**
79
81
  * Collate & return the data required to drive the calendar popup in
@@ -87,40 +89,42 @@ class c {
87
89
  *
88
90
  * @returns The calendar configuration.
89
91
  */
90
- static toCalendarConfiguration(t, o, e, a, i) {
91
- const n = i || navigator.language, r = c.stringToNeonDate(c.dateToIso(/* @__PURE__ */ new Date()), n), d = t ? c.stringToNeonDate(t, n, !0) : void 0, u = o || r.month, f = o && e ? new Date(e, o - 1, 15) : null, L = (f == null ? void 0 : f.toLocaleString(n, { month: "long" })) || r.monthLongName, h = e || r.year, T = a || Math.floor(h / 10) * 10, l = new Date(h, (u + 11) % 12, 1), S = new Date(h, (u + 11) % 12, 1);
92
+ static toCalendarConfiguration(e, o, a, n, r) {
93
+ const t = r || navigator.language, s = g.stringToNeonDate(g.dateToIso(/* @__PURE__ */ new Date()), t), d = e ? g.stringToNeonDate(e, t, !0) : void 0, u = o || s.month, f = o && a ? new Date(a, o - 1, 15) : null, L = (f == null ? void 0 : f.toLocaleString(t, { month: "long" })) || s.monthLongName, h = a || s.year, N = n || Math.floor(h / 10) * 10, l = new Date(h, (u + 11) % 12, 1), S = new Date(h, (u + 11) % 12, 1);
92
94
  S.setDate(S.getDate() - 1);
93
95
  const m = [];
94
- let y = 1, w = !1;
95
- for (let s = 0; s < 6; s++) {
96
- m[s] = [];
97
- for (let g = 0; g < 7; g++)
98
- if (s === 0 && g < S.getDay())
99
- m[s][g] = null;
100
- else if (m[s][g] = l.getDate(), y = l.getDate(), l.setDate(l.getDate() + 1), l.getDate() === 1) {
101
- for (let D = g + 1; D < 7; D++)
102
- m[s][D] = null;
103
- w = !0;
96
+ let w = 1, D = !1;
97
+ for (let i = 0; i < 6; i++) {
98
+ m[i] = [];
99
+ for (let c = 0; c < 7; c++)
100
+ if (i === 0 && c < S.getDay())
101
+ m[i][c] = null;
102
+ else if (m[i][c] = l.getDate(), w = l.getDate(), l.setDate(l.getDate() + 1), l.getDate() === 1) {
103
+ for (let y = c + 1; y < 7; y++)
104
+ m[i][y] = null;
105
+ D = !0;
104
106
  break;
105
107
  }
106
- if (w)
108
+ if (D)
107
109
  break;
108
110
  }
109
111
  return {
110
- today: r,
112
+ today: s,
111
113
  selected: d,
112
114
  pageMonth: u,
113
115
  pageMonthName: L,
114
116
  pageYear: h,
115
- pageDecadeStart: T,
116
- dowNames: c.dowNames(n),
117
+ pageDecadeStart: N,
118
+ dowNames: g.dowNames(t),
119
+ dowLongNames: g.dowNames(t, "long"),
117
120
  dates: m,
118
- lastDayOfMonth: y,
119
- months: c.monthNames(n)
121
+ lastDayOfMonth: w,
122
+ months: g.monthNames(t),
123
+ monthLongNames: g.monthNames(t, "long")
120
124
  };
121
125
  }
122
126
  }
123
127
  export {
124
- c as NeonDateUtils
128
+ g as NeonDateUtils
125
129
  };
126
130
  //# sourceMappingURL=NeonDateUtils.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NeonDateUtils.es.js","sources":["../../../src/common/utils/NeonDateUtils.ts"],"sourcesContent":["import type { NeonCalendarConfig } from '@/common/models/NeonCalendarConfig';\nimport type { NeonDate } from '@/common/models/NeonDate';\n\n/**\n * Date utilities for general application use as well as internally with the\n * <a href=\"/user-input/date-picker\">NeonDatePicker</a> component.\n */\nexport class NeonDateUtils {\n /**\n * Convert an ISO 8601 formatted string to a locale formatted date with a three letter month, a 2 digit day and a locale formatted time.\n *\n * @param date The date/time as an <a href=\"https://en.wikipedia.org/wiki/ISO_8601\">ISO 8601</a> string.\n * @param locale The locale for which to convert the date for display purposes, defaults to browser locale.\n * @param strict Do not add time component to localise the date.\n *\n * @returns Object representing the provided date.\n */\n public static stringToNeonDate(date: string, locale?: string, strict = false): NeonDate {\n const loc = locale || navigator.language;\n const now = new Date();\n const dateObj = new Date(!strict && date.length === 10 ? `${date}T${now.toISOString().split('T')[1]}` : date);\n let time;\n if (date.length > 10) {\n time = dateObj.toLocaleString(\n loc,\n date.length <= 16\n ? { hour12: false, hour: '2-digit', minute: '2-digit' }\n : { hour12: false, hour: '2-digit', minute: '2-digit', second: '2-digit' },\n );\n }\n\n const result: NeonDate = {\n year: +dateObj.toLocaleString('en-US', { year: 'numeric' }),\n yearFormatted: dateObj.toLocaleString(loc, { year: 'numeric' }),\n month: +dateObj.toLocaleString('en-US', { month: 'numeric' }),\n monthShortName: dateObj.toLocaleString(loc, { month: 'short' }),\n monthLongName: dateObj.toLocaleString(loc, { month: 'long' }),\n day: +dateObj.toLocaleString('en-US', { day: 'numeric' }),\n dayFormatted: dateObj.toLocaleString(loc, { day: '2-digit' }),\n };\n\n if (time) {\n result.time = time;\n }\n\n return result;\n }\n\n /**\n * Convert a date object to an ISO 8601 formatted string. By default, the time is not considered.\n *\n * @param date Javascript date object.\n * @param time Whether to consider the time as part of the conversion to the ISO string.\n *\n * @returns an ISO 8601 formatted date, optionally with the time as well.\n */\n public static dateToIso(date: Date, time = false): string {\n const dateString = date.toISOString();\n return time ? dateString : dateString.split('T')[0];\n }\n\n /**\n * Convert the params received into an ISO 8601 formatted string with only date in it.\n *\n * @param day The number of the day to be used.\n * @param month The number of the month to be used.\n * @param year The number of the year to be used.\n *\n * @returns an ISO 8601 formatted date for the given parameters.\n */\n public static dmyToIso(day: number, month: number, year: number): string {\n return `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`;\n }\n\n /**\n * Returns the days of the week starting at Monday day name translated using the locale received as a first element.\n *\n * @param locale The locale for which to convert the date for display purposes, defaults to browser locale.\n *\n * @returns an array with the days of the week named according to the locale received.\n */\n public static dowNames(locale?: string): Array<string> {\n const loc = locale || navigator.language;\n const date = new Date();\n\n const weekdays = [];\n while (!weekdays[date.getDay()]) {\n weekdays[date.getDay()] = date.toLocaleString(loc, { weekday: 'short' });\n date.setDate(date.getDate() + 1);\n }\n\n const sunday = weekdays.shift();\n if (sunday) {\n weekdays.push(sunday);\n }\n\n return weekdays;\n }\n\n /**\n * Returns the months of the year starting at January month name translated using the locale received as a first element.\n *\n * @param locale The locale for which to convert the date for display purposes, defaults to browser locale.\n *\n * @returns an array with the month names of the year, all named according to the locale received.\n */\n public static monthNames(locale?: string): Array<string> {\n const loc = locale || navigator.language;\n\n return Array.from(Array(12).keys()).map((key) => {\n const date = new Date(2023, key, 15);\n return date.toLocaleString(loc, { month: 'short' });\n });\n }\n\n /**\n * Collate & return the data required to drive the calendar popup in\n * <a href=\"/user-input/date-picker\">NeonDatePicker</a>.\n *\n * @param selectedDate ISO-8601 date-only string for the selected date.\n * @param currentPageMonth month of the current calendar page.\n * @param currentPageYear year of the current calendar page.\n * @param currentPageDecadeStart decade start year of the current calendar page.\n * @param locale user's locale.\n *\n * @returns The calendar configuration.\n */\n public static toCalendarConfiguration(\n selectedDate?: string,\n currentPageMonth?: number,\n currentPageYear?: number,\n currentPageDecadeStart?: number,\n locale?: string,\n ): NeonCalendarConfig {\n const loc = locale || navigator.language;\n const today = NeonDateUtils.stringToNeonDate(NeonDateUtils.dateToIso(new Date()), loc);\n const selected = selectedDate ? NeonDateUtils.stringToNeonDate(selectedDate, loc, true) : undefined;\n // month indexed from 1-12\n const pageMonth = currentPageMonth || today.month;\n\n // month indexed from 0-11\n const pageDate = currentPageMonth && currentPageYear ? new Date(currentPageYear, currentPageMonth - 1, 15) : null;\n const pageMonthName = pageDate?.toLocaleString(loc, { month: 'long' }) || today.monthLongName;\n const pageYear = currentPageYear || today.year;\n const pageDecadeStart = currentPageDecadeStart || Math.floor(pageYear / 10) * 10;\n\n // determine dow of first day of month. Months are indexed from 0 here\n const date = new Date(pageYear, (pageMonth + 11) % 12, 1);\n const offsetDate = new Date(pageYear, (pageMonth + 11) % 12, 1);\n offsetDate.setDate(offsetDate.getDate() - 1);\n\n const dates: Array<Array<number | null>> = [];\n\n let lastDayOfMonth = 1;\n let done = false;\n\n for (let row = 0; row < 6; row++) {\n dates[row] = [];\n\n for (let col = 0; col < 7; col++) {\n if (row === 0 && col < offsetDate.getDay()) {\n dates[row][col] = null;\n } else {\n dates[row][col] = date.getDate();\n lastDayOfMonth = date.getDate();\n date.setDate(date.getDate() + 1);\n\n if (date.getDate() === 1) {\n for (let i = col + 1; i < 7; i++) {\n dates[row][i] = null;\n }\n done = true;\n break;\n }\n }\n }\n\n if (done) {\n break;\n }\n }\n\n return {\n today,\n selected,\n pageMonth,\n pageMonthName,\n pageYear,\n pageDecadeStart,\n dowNames: NeonDateUtils.dowNames(loc),\n dates,\n lastDayOfMonth,\n months: NeonDateUtils.monthNames(loc),\n };\n }\n}\n"],"names":["NeonDateUtils","date","locale","strict","loc","now","dateObj","time","result","dateString","day","month","year","weekdays","sunday","key","selectedDate","currentPageMonth","currentPageYear","currentPageDecadeStart","today","selected","pageMonth","pageDate","pageMonthName","pageYear","pageDecadeStart","offsetDate","dates","lastDayOfMonth","done","row","col","i"],"mappings":"AAOO,MAAMA,EAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUzB,OAAc,iBAAiBC,GAAcC,GAAiBC,IAAS,IAAiB;AACtF,UAAMC,IAAMF,KAAU,UAAU,UAC1BG,wBAAU,KAAA,GACVC,IAAU,IAAI,KAAK,CAACH,KAAUF,EAAK,WAAW,KAAK,GAAGA,CAAI,IAAII,EAAI,YAAA,EAAc,MAAM,GAAG,EAAE,CAAC,CAAC,KAAKJ,CAAI;AAC5G,QAAIM;AACJ,IAAIN,EAAK,SAAS,OAChBM,IAAOD,EAAQ;AAAA,MACbF;AAAA,MACAH,EAAK,UAAU,KACX,EAAE,QAAQ,IAAO,MAAM,WAAW,QAAQ,cAC1C,EAAE,QAAQ,IAAO,MAAM,WAAW,QAAQ,WAAW,QAAQ,UAAA;AAAA,IAAU;AAI/E,UAAMO,IAAmB;AAAA,MACvB,MAAM,CAACF,EAAQ,eAAe,SAAS,EAAE,MAAM,WAAW;AAAA,MAC1D,eAAeA,EAAQ,eAAeF,GAAK,EAAE,MAAM,WAAW;AAAA,MAC9D,OAAO,CAACE,EAAQ,eAAe,SAAS,EAAE,OAAO,WAAW;AA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4B,IAAiB5B,EAAK,QAAA,GACtBA,EAAK,QAAQA,EAAK,QAAA,IAAY,CAAC,GAE3BA,EAAK,QAAA,MAAc,GAAG;AACxB,mBAASgC,IAAID,IAAM,GAAGC,IAAI,GAAGA;AAC3B,YAAAL,EAAMG,CAAG,EAAEE,CAAC,IAAI;AAElB,UAAAH,IAAO;AACP;AAAA,QACF;AAIJ,UAAIA;AACF;AAAA,IAEJ;AAEA,WAAO;AAAA,MACL,OAAAV;AAAA,MACA,UAAAC;AAAA,MACA,WAAAC;AAAA,MACA,eAAAE;AAAA,MACA,UAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,UAAU1B,EAAc,SAASI,CAAG;AAAA,MACpC,OAAAwB;AAAA,MACA,gBAAAC;AAAA,MACA,QAAQ7B,EAAc,WAAWI,CAAG;AAAA,IAAA;AAAA,EAExC;AACF;"}
1
+ {"version":3,"file":"NeonDateUtils.es.js","sources":["../../../src/common/utils/NeonDateUtils.ts"],"sourcesContent":["import type { NeonCalendarConfig } from '@/common/models/NeonCalendarConfig';\nimport type { NeonDate } from '@/common/models/NeonDate';\n\n/**\n * Date utilities for general application use as well as internally with the\n * <a href=\"/user-input/date-picker\">NeonDatePicker</a> component.\n */\nexport class NeonDateUtils {\n /**\n * Convert an ISO 8601 formatted string to a locale formatted date with a three letter month, a 2 digit day and a locale formatted time.\n *\n * @param date The date/time as an <a href=\"https://en.wikipedia.org/wiki/ISO_8601\">ISO 8601</a> string.\n * @param locale The locale for which to convert the date for display purposes, defaults to browser locale.\n * @param strict Do not add time component to localise the date.\n *\n * @returns Object representing the provided date.\n */\n public static stringToNeonDate(date: string, locale?: string, strict = false): NeonDate {\n const loc = locale || navigator.language;\n const now = new Date();\n const dateObj = new Date(!strict && date.length === 10 ? `${date}T${now.toISOString().split('T')[1]}` : date);\n let time;\n if (date.length > 10) {\n time = dateObj.toLocaleString(\n loc,\n date.length <= 16\n ? { hour12: false, hour: '2-digit', minute: '2-digit' }\n : { hour12: false, hour: '2-digit', minute: '2-digit', second: '2-digit' },\n );\n }\n\n const result: NeonDate = {\n year: +dateObj.toLocaleString('en-US', { year: 'numeric' }),\n yearFormatted: dateObj.toLocaleString(loc, { year: 'numeric' }),\n month: +dateObj.toLocaleString('en-US', { month: 'numeric' }),\n monthShortName: dateObj.toLocaleString(loc, { month: 'short' }),\n monthLongName: dateObj.toLocaleString(loc, { month: 'long' }),\n day: +dateObj.toLocaleString('en-US', { day: 'numeric' }),\n dayFormatted: dateObj.toLocaleString(loc, { day: '2-digit' }),\n };\n\n if (time) {\n result.time = time;\n }\n\n return result;\n }\n\n /**\n * Convert a date object to an ISO 8601 formatted string. By default, the time is not considered.\n *\n * @param date Javascript date object.\n * @param time Whether to consider the time as part of the conversion to the ISO string.\n *\n * @returns an ISO 8601 formatted date, optionally with the time as well.\n */\n public static dateToIso(date: Date, time = false): string {\n const dateString = date.toISOString();\n return time ? dateString : dateString.split('T')[0];\n }\n\n /**\n * Convert the params received into an ISO 8601 formatted string with only date in it.\n *\n * @param day The number of the day to be used.\n * @param month The number of the month to be used.\n * @param year The number of the year to be used.\n *\n * @returns an ISO 8601 formatted date for the given parameters.\n */\n public static dmyToIso(day: number, month: number, year: number): string {\n return `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`;\n }\n\n /**\n * Returns the days of the week starting at Monday day name translated using the locale received as a first element.\n *\n * @param locale The locale for which to convert the date for display purposes, defaults to browser locale.\n * @param format The format of the returned values\n *\n * @returns an array with the days of the week named according to the locale received.\n */\n public static dowNames(locale?: string, format: 'long' | 'short' | 'narrow' = 'short'): Array<string> {\n const loc = locale || navigator.language;\n const date = new Date();\n\n const weekdays = [];\n while (!weekdays[date.getDay()]) {\n weekdays[date.getDay()] = date.toLocaleString(loc, { weekday: format });\n date.setDate(date.getDate() + 1);\n }\n\n const sunday = weekdays.shift();\n if (sunday) {\n weekdays.push(sunday);\n }\n\n return weekdays;\n }\n\n /**\n * Returns the months of the year starting at January month name translated using the locale received as a first element.\n *\n * @param locale The locale for which to convert the date for display purposes, defaults to browser locale.\n * @param format The format of the month names to return\n *\n * @returns an array with the month names of the year, all named according to the locale received.\n */\n public static monthNames(\n locale?: string,\n format: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow' = 'short',\n ): Array<string> {\n const loc = locale || navigator.language;\n\n return Array.from(Array(12).keys()).map((key) => {\n const date = new Date(2023, key, 15);\n return date.toLocaleString(loc, { month: format });\n });\n }\n\n /**\n * Collate & return the data required to drive the calendar popup in\n * <a href=\"/user-input/date-picker\">NeonDatePicker</a>.\n *\n * @param selectedDate ISO-8601 date-only string for the selected date.\n * @param currentPageMonth month of the current calendar page.\n * @param currentPageYear year of the current calendar page.\n * @param currentPageDecadeStart decade start year of the current calendar page.\n * @param locale user's locale.\n *\n * @returns The calendar configuration.\n */\n public static toCalendarConfiguration(\n selectedDate?: string,\n currentPageMonth?: number,\n currentPageYear?: number,\n currentPageDecadeStart?: number,\n locale?: string,\n ): NeonCalendarConfig {\n const loc = locale || navigator.language;\n const today = NeonDateUtils.stringToNeonDate(NeonDateUtils.dateToIso(new Date()), loc);\n const selected = selectedDate ? NeonDateUtils.stringToNeonDate(selectedDate, loc, true) : undefined;\n // month indexed from 1-12\n const pageMonth = currentPageMonth || today.month;\n\n // month indexed from 0-11\n const pageDate = currentPageMonth && currentPageYear ? new Date(currentPageYear, currentPageMonth - 1, 15) : null;\n const pageMonthName = pageDate?.toLocaleString(loc, { month: 'long' }) || today.monthLongName;\n const pageYear = currentPageYear || today.year;\n const pageDecadeStart = currentPageDecadeStart || Math.floor(pageYear / 10) * 10;\n\n // determine dow of first day of month. Months are indexed from 0 here\n const date = new Date(pageYear, (pageMonth + 11) % 12, 1);\n const offsetDate = new Date(pageYear, (pageMonth + 11) % 12, 1);\n offsetDate.setDate(offsetDate.getDate() - 1);\n\n const dates: Array<Array<number | null>> = [];\n\n let lastDayOfMonth = 1;\n let done = false;\n\n for (let row = 0; row < 6; row++) {\n dates[row] = [];\n\n for (let col = 0; col < 7; col++) {\n if (row === 0 && col < offsetDate.getDay()) {\n dates[row][col] = null;\n } else {\n dates[row][col] = date.getDate();\n lastDayOfMonth = date.getDate();\n date.setDate(date.getDate() + 1);\n\n if (date.getDate() === 1) {\n for (let i = col + 1; i < 7; i++) {\n dates[row][i] = null;\n }\n done = true;\n break;\n }\n }\n }\n\n if (done) {\n break;\n }\n }\n\n return {\n today,\n selected,\n pageMonth,\n pageMonthName,\n pageYear,\n pageDecadeStart,\n dowNames: NeonDateUtils.dowNames(loc),\n dowLongNames: NeonDateUtils.dowNames(loc, 'long'),\n dates,\n lastDayOfMonth,\n months: NeonDateUtils.monthNames(loc),\n monthLongNames: NeonDateUtils.monthNames(loc, 'long'),\n };\n }\n}\n"],"names":["NeonDateUtils","date","locale","strict","loc","now","dateObj","time","result","dateString","day","month","year","format","weekdays","sunday","key","selectedDate","currentPageMonth","currentPageYear","currentPageDecadeStart","today","selected","pageMonth","pageDate","pageMonthName","pageYear","pageDecadeStart","offsetDate","dates","lastDayOfMonth","done","row","col","i"],"mappings":"AAOO,MAAMA,EAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUzB,OAAc,iBAAiBC,GAAcC,GAAiBC,IAAS,IAAiB;AACtF,UAAMC,IAAMF,KAAU,UAAU,UAC1BG,wBAAU,KAAA,GACVC,IAAU,IAAI,KAAK,CAACH,KAAUF,EAAK,WAAW,KAAK,GAAGA,CAAI,IAAII,EAAI,YAAA,EAAc,MAAM,GAAG,EAAE,CAAC,CAAC,KAAKJ,CAAI;AAC5G,QAAIM;AACJ,IAAIN,EAAK,SAAS,OAChBM,IAAOD,EAAQ;AAAA,MACbF;AAAA,MACAH,EAAK,UAAU,KACX,EAAE,QAAQ,IAAO,MAAM,WAAW,QAAQ,cAC1C,EAAE,QAAQ,IAAO,MAAM,WAAW,QAAQ,WAAW,QAAQ,UAAA;AAAA,IAAU;AAI/E,UAAMO,IAAmB;AAAA,MACvB,MAAM,C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EAAMG,CAAG,IAAI,CAAA;AAEb,eAASC,IAAM,GAAGA,IAAM,GAAGA;AACzB,YAAID,MAAQ,KAAKC,IAAML,EAAW;AAChC,UAAAC,EAAMG,CAAG,EAAEC,CAAG,IAAI;AAAA,iBAElBJ,EAAMG,CAAG,EAAEC,CAAG,IAAIhC,EAAK,QAAA,GACvB6B,IAAiB7B,EAAK,QAAA,GACtBA,EAAK,QAAQA,EAAK,QAAA,IAAY,CAAC,GAE3BA,EAAK,QAAA,MAAc,GAAG;AACxB,mBAASiC,IAAID,IAAM,GAAGC,IAAI,GAAGA;AAC3B,YAAAL,EAAMG,CAAG,EAAEE,CAAC,IAAI;AAElB,UAAAH,IAAO;AACP;AAAA,QACF;AAIJ,UAAIA;AACF;AAAA,IAEJ;AAEA,WAAO;AAAA,MACL,OAAAV;AAAA,MACA,UAAAC;AAAA,MACA,WAAAC;AAAA,MACA,eAAAE;AAAA,MACA,UAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,UAAU3B,EAAc,SAASI,CAAG;AAAA,MACpC,cAAcJ,EAAc,SAASI,GAAK,MAAM;AAAA,MAChD,OAAAyB;AAAA,MACA,gBAAAC;AAAA,MACA,QAAQ9B,EAAc,WAAWI,CAAG;AAAA,MACpC,gBAAgBJ,EAAc,WAAWI,GAAK,MAAM;AAAA,IAAA;AAAA,EAExD;AACF;"}
@@ -1,2 +1,2 @@
1
- "use strict";const r=require("./NeonLink.cjs.js"),n=require("vue"),s=require("../../../_virtual/_plugin-vue_export-helper.cjs.js"),a={class:"neon-link__label"},k=["href"],p={class:"neon-link__label"},d={class:"neon-link__label"};function u(e,o,c,C,w,m){const i=n.resolveComponent("router-link"),t=n.resolveComponent("neon-icon");return e.routerUrl?(n.openBlock(),n.createBlock(i,n.mergeProps({key:0,class:[[{"neon-link--no-style":e.noStyle,"neon-link--active":e.activeRoute,"neon-link--exact-active":e.exactRoute},`neon-link--outline-${e.outlineStyle}`],"neon-link neon-link--router-link"],to:e.routerUrl,tabindex:"0"},e.sanitizedAttributes,{onClick:e.onClick,onKeydown:[n.withKeys(e.onClick,["enter"]),n.withKeys(n.withModifiers(e.onSpace,["prevent"]),["space"])]}),{default:n.withCtx(()=>[n.createElementVNode("span",a,[n.renderSlot(e.$slots,"default")])]),_:3},16,["class","to","onClick","onKeydown"])):e.href?(n.openBlock(),n.createElementBlock("a",n.mergeProps({key:1,class:[[{"neon-link--no-style":e.noStyle,"neon-link--with-external-indicator":e.externalIndicator,"neon-link--active":e.activeRoute,"neon-link--exact-active":e.exactRoute},`neon-link--outline-${e.outlineStyle}`],"neon-link neon-link--external-link"],href:e.href,rel:"noopener",tabindex:"0"},e.sanitizedAttributes,{onClick:o[0]||(o[0]=(...l)=>e.onClick&&e.onClick(...l)),onKeydown:[o[1]||(o[1]=n.withKeys((...l)=>e.onClick&&e.onClick(...l),["enter"])),o[2]||(o[2]=n.withKeys(n.withModifiers((...l)=>e.onSpace&&e.onSpace(...l),["prevent"]),["space"]))]}),[n.createElementVNode("span",p,[n.renderSlot(e.$slots,"default"),e.externalIndicator?(n.openBlock(),n.createBlock(t,{key:0,class:"neon-link__external-indicator",color:"low-contrast",name:"link-external"})):n.createCommentVNode("",!0)])],16,k)):(n.openBlock(),n.createElementBlock("a",n.mergeProps({key:2,class:[[{"neon-link--no-style":e.noStyle},`neon-link--outline-${e.outlineStyle}`],"neon-link"],tabindex:"0"},e.sanitizedAttributes,{onClick:o[3]||(o[3]=(...l)=>e.onClick&&e.onClick(...l)),onKeydown:[o[4]||(o[4]=n.withKeys((...l)=>e.onClick&&e.onClick(...l),["enter"])),o[5]||(o[5]=n.withKeys(n.withModifiers((...l)=>e.onSpace&&e.onSpace(...l),["prevent"]),["space"]))]}),[n.createElementVNode("span",d,[n.renderSlot(e.$slots,"default")])],16))}const y=s(r,[["render",u]]);module.exports=y;
1
+ "use strict";const r=require("./NeonLink.cjs.js"),n=require("vue"),s=require("../../../_virtual/_plugin-vue_export-helper.cjs.js"),k=["href"];function a(e,o,p,d,y,C){const l=n.resolveComponent("router-link"),t=n.resolveComponent("neon-icon");return e.routerUrl?(n.openBlock(),n.createBlock(l,n.mergeProps({key:0,class:[[{"neon-link--no-style":e.noStyle,"neon-link--active":e.activeRoute,"neon-link--exact-active":e.exactRoute},`neon-link--outline-${e.outlineStyle}`],"neon-link neon-link--router-link"],to:e.routerUrl,tabindex:"0"},e.sanitizedAttributes,{onClick:e.onClick,onKeydown:[n.withKeys(e.onClick,["enter"]),n.withKeys(n.withModifiers(e.onSpace,["prevent"]),["space"])]}),{default:n.withCtx(()=>[n.renderSlot(e.$slots,"default")]),_:3},16,["class","to","onClick","onKeydown"])):e.href?(n.openBlock(),n.createElementBlock("a",n.mergeProps({key:1,class:[[{"neon-link--no-style":e.noStyle,"neon-link--with-external-indicator":e.externalIndicator,"neon-link--active":e.activeRoute,"neon-link--exact-active":e.exactRoute},`neon-link--outline-${e.outlineStyle}`],"neon-link neon-link--external-link"],href:e.href,rel:"noopener",tabindex:"0"},e.sanitizedAttributes,{onClick:o[0]||(o[0]=(...i)=>e.onClick&&e.onClick(...i)),onKeydown:[o[1]||(o[1]=n.withKeys((...i)=>e.onClick&&e.onClick(...i),["enter"])),o[2]||(o[2]=n.withKeys(n.withModifiers((...i)=>e.onSpace&&e.onSpace(...i),["prevent"]),["space"]))]}),[n.renderSlot(e.$slots,"default"),e.externalIndicator?(n.openBlock(),n.createBlock(t,{key:0,class:"neon-link__external-indicator",color:"low-contrast",name:"share-external-link-1"})):n.createCommentVNode("",!0)],16,k)):(n.openBlock(),n.createElementBlock("a",n.mergeProps({key:2,class:[[{"neon-link--no-style":e.noStyle},`neon-link--outline-${e.outlineStyle}`],"neon-link"],tabindex:"0"},e.sanitizedAttributes,{onClick:o[3]||(o[3]=(...i)=>e.onClick&&e.onClick(...i)),onKeydown:[o[4]||(o[4]=n.withKeys((...i)=>e.onClick&&e.onClick(...i),["enter"])),o[5]||(o[5]=n.withKeys(n.withModifiers((...i)=>e.onSpace&&e.onSpace(...i),["prevent"]),["space"]))]}),[n.renderSlot(e.$slots,"default")],16))}const u=s(r,[["render",a]]);module.exports=u;
2
2
  //# sourceMappingURL=NeonLink.vue.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NeonLink.vue.cjs.js","sources":["../../../../src/components/navigation/link/NeonLink.vue"],"sourcesContent":["<template>\n <router-link\n v-if=\"routerUrl\"\n :class=\"[\n { 'neon-link--no-style': noStyle, 'neon-link--active': activeRoute, 'neon-link--exact-active': exactRoute },\n `neon-link--outline-${outlineStyle}`,\n ]\"\n :to=\"routerUrl\"\n class=\"neon-link neon-link--router-link\"\n tabindex=\"0\"\n v-bind=\"sanitizedAttributes\"\n @click=\"onClick\"\n @keydown.enter=\"onClick\"\n @keydown.space.prevent=\"onSpace\"\n >\n <span class=\"neon-link__label\">\n <!-- @slot the content of the link -->\n <slot></slot>\n </span>\n </router-link>\n <a\n v-else-if=\"href\"\n :class=\"[\n {\n 'neon-link--no-style': noStyle,\n 'neon-link--with-external-indicator': externalIndicator,\n 'neon-link--active': activeRoute,\n 'neon-link--exact-active': exactRoute,\n },\n `neon-link--outline-${outlineStyle}`,\n ]\"\n :href=\"href\"\n class=\"neon-link neon-link--external-link\"\n rel=\"noopener\"\n tabindex=\"0\"\n v-bind=\"sanitizedAttributes\"\n @click=\"onClick\"\n @keydown.enter=\"onClick\"\n @keydown.space.prevent=\"onSpace\"\n >\n <span class=\"neon-link__label\">\n <!-- @slot the content of the link -->\n <slot></slot>\n <neon-icon\n v-if=\"externalIndicator\"\n class=\"neon-link__external-indicator\"\n color=\"low-contrast\"\n name=\"link-external\"\n />\n </span>\n </a>\n <a\n v-else\n :class=\"[{ 'neon-link--no-style': noStyle }, `neon-link--outline-${outlineStyle}`]\"\n class=\"neon-link\"\n tabindex=\"0\"\n v-bind=\"sanitizedAttributes\"\n @click=\"onClick\"\n @keydown.enter=\"onClick\"\n @keydown.space.prevent=\"onSpace\"\n >\n <span class=\"neon-link__label\">\n <!-- @slot the content of the link -->\n <slot></slot>\n </span>\n </a>\n</template>\n\n<script lang=\"ts\" src=\"./NeonLink.ts\" />\n"],"names":["_hoisted_1","_hoisted_3","_hoisted_4","_ctx","_openBlock","_createBlock","_component_router_link","_mergeProps","_createElementVNode","_renderSlot","_createElementBlock","args","_component_neon_icon"],"mappings":"mIAeUA,EAAA,CAAA,MAAM,kBAAkB,aAyBxBC,EAAA,CAAA,MAAM,kBAAkB,EAqBxBC,EAAA,CAAA,MAAM,kBAAkB,6GA3DxBC,EAAA,WADRC,EAAAA,YAAAC,EAAAA,YAkBcC,EAlBdC,aAkBc,OAhBX,MAAK,CAAA,wBAAmCJ,EAAA,QAAO,oBAAuBA,EAAA,YAAW,0BAA6BA,EAAA,UAAU,wBAAgCA,EAAA,YAAY,IAK/J,kCAAkC,EADvC,GAAIA,EAAA,UAEL,SAAS,KACDA,EAAA,oBAAmB,CAC1B,QAAOA,EAAA,QACP,UAAO,YAAQA,EAAA,QAAO,CAAA,OAAA,CAAA,6BACCA,EAAA,QAAO,CAAA,SAAA,CAAA,EAAA,CAAA,OAAA,CAAA,wBAE/B,IAGO,CAHPK,EAAAA,mBAGO,OAHPR,EAGO,CADLS,aAAaN,EAAA,OAAA,SAAA,qDAIJA,EAAA,MADbC,EAAAA,YAAAM,EAAAA,mBA8BI,IA9BJH,aA8BI,OA5BD,MAAK,CAAA,wBAA2CJ,EAAA,6CAAuDA,EAAA,sCAAgDA,EAAA,sCAAgDA,EAAA,kCAAiDA,EAAA,YAAY,IAU/P,oCAAoC,EADzC,KAAMA,EAAA,KAEP,IAAI,WACJ,SAAS,KACDA,EAAA,oBAAmB,CAC1B,4BAAOA,EAAA,SAAAA,EAAA,QAAA,GAAAQ,CAAA,GACP,UAAO,gCAAQR,EAAA,SAAAA,EAAA,QAAA,GAAAQ,CAAA,EAAO,CAAA,OAAA,CAAA,kDACCR,EAAA,SAAAA,EAAA,QAAA,GAAAQ,CAAA,EAAO,CAAA,SAAA,CAAA,EAAA,CAAA,OAAA,CAAA,OAE/BH,EAAAA,mBASO,OATPP,EASO,CAPLQ,aAAaN,EAAA,OAAA,SAAA,EAELA,EAAA,iCADRE,EAAAA,YAKEO,EAAA,OAHA,MAAM,gCACN,MAAM,eACN,KAAK,0DAIXR,EAAAA,YAAAM,EAAAA,mBAcI,IAdJH,aAcI,OAZD,MAAK,CAAA,CAAA,CAAA,sBAA4BJ,EAAA,OAAO,EAAA,sBAA0BA,EAAA,YAAY,IACzE,WAAW,EACjB,SAAS,KACDA,EAAA,oBAAmB,CAC1B,4BAAOA,EAAA,SAAAA,EAAA,QAAA,GAAAQ,CAAA,GACP,UAAO,gCAAQR,EAAA,SAAAA,EAAA,QAAA,GAAAQ,CAAA,EAAO,CAAA,OAAA,CAAA,kDACCR,EAAA,SAAAA,EAAA,QAAA,GAAAQ,CAAA,EAAO,CAAA,SAAA,CAAA,EAAA,CAAA,OAAA,CAAA,OAE/BH,EAAAA,mBAGO,OAHPN,EAGO,CADLO,aAAaN,EAAA,OAAA,SAAA"}
1
+ {"version":3,"file":"NeonLink.vue.cjs.js","sources":["../../../../src/components/navigation/link/NeonLink.vue"],"sourcesContent":["<template>\n <router-link\n v-if=\"routerUrl\"\n :class=\"[\n { 'neon-link--no-style': noStyle, 'neon-link--active': activeRoute, 'neon-link--exact-active': exactRoute },\n `neon-link--outline-${outlineStyle}`,\n ]\"\n :to=\"routerUrl\"\n class=\"neon-link neon-link--router-link\"\n tabindex=\"0\"\n v-bind=\"sanitizedAttributes\"\n @click=\"onClick\"\n @keydown.enter=\"onClick\"\n @keydown.space.prevent=\"onSpace\"\n >\n <!-- @slot the content of the link -->\n <slot></slot>\n </router-link>\n <a\n v-else-if=\"href\"\n :class=\"[\n {\n 'neon-link--no-style': noStyle,\n 'neon-link--with-external-indicator': externalIndicator,\n 'neon-link--active': activeRoute,\n 'neon-link--exact-active': exactRoute,\n },\n `neon-link--outline-${outlineStyle}`,\n ]\"\n :href=\"href\"\n class=\"neon-link neon-link--external-link\"\n rel=\"noopener\"\n tabindex=\"0\"\n v-bind=\"sanitizedAttributes\"\n @click=\"onClick\"\n @keydown.enter=\"onClick\"\n @keydown.space.prevent=\"onSpace\"\n >\n <!-- @slot the content of the link -->\n <slot></slot>\n <neon-icon\n v-if=\"externalIndicator\"\n class=\"neon-link__external-indicator\"\n color=\"low-contrast\"\n name=\"share-external-link-1\"\n />\n </a>\n <a\n v-else\n :class=\"[{ 'neon-link--no-style': noStyle }, `neon-link--outline-${outlineStyle}`]\"\n class=\"neon-link\"\n tabindex=\"0\"\n v-bind=\"sanitizedAttributes\"\n @click=\"onClick\"\n @keydown.enter=\"onClick\"\n @keydown.space.prevent=\"onSpace\"\n >\n <!-- @slot the content of the link -->\n <slot></slot>\n </a>\n</template>\n\n<script lang=\"ts\" src=\"./NeonLink.ts\" />\n"],"names":["_ctx","_openBlock","_createBlock","_component_router_link","_mergeProps","_renderSlot","_createElementBlock","args","_component_neon_icon"],"mappings":"yPAEUA,EAAA,WADRC,EAAAA,YAAAC,EAAAA,YAgBcC,EAhBdC,aAgBc,OAdX,MAAK,CAAA,wBAAmCJ,EAAA,QAAO,oBAAuBA,EAAA,YAAW,0BAA6BA,EAAA,UAAU,wBAAgCA,EAAA,YAAY,IAK/J,kCAAkC,EADvC,GAAIA,EAAA,UAEL,SAAS,KACDA,EAAA,oBAAmB,CAC1B,QAAOA,EAAA,QACP,UAAO,YAAQA,EAAA,QAAO,CAAA,OAAA,CAAA,6BACCA,EAAA,QAAO,CAAA,SAAA,CAAA,EAAA,CAAA,OAAA,CAAA,wBAG/B,IAAa,CAAbK,aAAaL,EAAA,OAAA,SAAA,mDAGFA,EAAA,MADbC,EAAAA,YAAAK,EAAAA,mBA4BI,IA5BJF,aA4BI,OA1BD,MAAK,CAAA,wBAA2CJ,EAAA,6CAAuDA,EAAA,sCAAgDA,EAAA,sCAAgDA,EAAA,kCAAiDA,EAAA,YAAY,IAU/P,oCAAoC,EADzC,KAAMA,EAAA,KAEP,IAAI,WACJ,SAAS,KACDA,EAAA,oBAAmB,CAC1B,4BAAOA,EAAA,SAAAA,EAAA,QAAA,GAAAO,CAAA,GACP,UAAO,gCAAQP,EAAA,SAAAA,EAAA,QAAA,GAAAO,CAAA,EAAO,CAAA,OAAA,CAAA,kDACCP,EAAA,SAAAA,EAAA,QAAA,GAAAO,CAAA,EAAO,CAAA,SAAA,CAAA,EAAA,CAAA,OAAA,CAAA,OAG/BF,aAAaL,EAAA,OAAA,SAAA,EAELA,EAAA,iCADRE,EAAAA,YAKEM,EAAA,OAHA,MAAM,gCACN,MAAM,eACN,KAAK,gEAGTP,EAAAA,YAAAK,EAAAA,mBAYI,IAZJF,aAYI,OAVD,MAAK,CAAA,CAAA,CAAA,sBAA4BJ,EAAA,OAAO,EAAA,sBAA0BA,EAAA,YAAY,IACzE,WAAW,EACjB,SAAS,KACDA,EAAA,oBAAmB,CAC1B,4BAAOA,EAAA,SAAAA,EAAA,QAAA,GAAAO,CAAA,GACP,UAAO,gCAAQP,EAAA,SAAAA,EAAA,QAAA,GAAAO,CAAA,EAAO,CAAA,OAAA,CAAA,kDACCP,EAAA,SAAAA,EAAA,QAAA,GAAAO,CAAA,EAAO,CAAA,SAAA,CAAA,EAAA,CAAA,OAAA,CAAA,OAG/BF,aAAaL,EAAA,OAAA,SAAA"}
@@ -1,10 +1,10 @@
1
- import f from "./NeonLink.es.js";
2
- import { resolveComponent as k, openBlock as i, createBlock as d, mergeProps as t, withKeys as l, withModifiers as r, withCtx as C, createElementVNode as s, renderSlot as a, createElementBlock as p, createCommentVNode as m } from "vue";
3
- import S from "../../../_virtual/_plugin-vue_export-helper.es.js";
4
- const c = { class: "neon-link__label" }, v = ["href"], $ = { class: "neon-link__label" }, b = { class: "neon-link__label" };
5
- function w(n, e, K, R, z, A) {
6
- const u = k("router-link"), y = k("neon-icon");
7
- return n.routerUrl ? (i(), d(u, t({
1
+ import y from "./NeonLink.es.js";
2
+ import { resolveComponent as a, openBlock as l, createBlock as k, mergeProps as t, withKeys as i, withModifiers as r, withCtx as f, renderSlot as s, createElementBlock as u, createCommentVNode as C } from "vue";
3
+ import m from "../../../_virtual/_plugin-vue_export-helper.es.js";
4
+ const S = ["href"];
5
+ function v(n, e, $, w, b, K) {
6
+ const d = a("router-link"), p = a("neon-icon");
7
+ return n.routerUrl ? (l(), k(d, t({
8
8
  key: 0,
9
9
  class: [[
10
10
  { "neon-link--no-style": n.noStyle, "neon-link--active": n.activeRoute, "neon-link--exact-active": n.exactRoute },
@@ -15,17 +15,15 @@ function w(n, e, K, R, z, A) {
15
15
  }, n.sanitizedAttributes, {
16
16
  onClick: n.onClick,
17
17
  onKeydown: [
18
- l(n.onClick, ["enter"]),
19
- l(r(n.onSpace, ["prevent"]), ["space"])
18
+ i(n.onClick, ["enter"]),
19
+ i(r(n.onSpace, ["prevent"]), ["space"])
20
20
  ]
21
21
  }), {
22
- default: C(() => [
23
- s("span", c, [
24
- a(n.$slots, "default")
25
- ])
22
+ default: f(() => [
23
+ s(n.$slots, "default")
26
24
  ]),
27
25
  _: 3
28
- }, 16, ["class", "to", "onClick", "onKeydown"])) : n.href ? (i(), p("a", t({
26
+ }, 16, ["class", "to", "onClick", "onKeydown"])) : n.href ? (l(), u("a", t({
29
27
  key: 1,
30
28
  class: [[
31
29
  {
@@ -42,37 +40,33 @@ function w(n, e, K, R, z, A) {
42
40
  }, n.sanitizedAttributes, {
43
41
  onClick: e[0] || (e[0] = (...o) => n.onClick && n.onClick(...o)),
44
42
  onKeydown: [
45
- e[1] || (e[1] = l((...o) => n.onClick && n.onClick(...o), ["enter"])),
46
- e[2] || (e[2] = l(r((...o) => n.onSpace && n.onSpace(...o), ["prevent"]), ["space"]))
43
+ e[1] || (e[1] = i((...o) => n.onClick && n.onClick(...o), ["enter"])),
44
+ e[2] || (e[2] = i(r((...o) => n.onSpace && n.onSpace(...o), ["prevent"]), ["space"]))
47
45
  ]
48
46
  }), [
49
- s("span", $, [
50
- a(n.$slots, "default"),
51
- n.externalIndicator ? (i(), d(y, {
52
- key: 0,
53
- class: "neon-link__external-indicator",
54
- color: "low-contrast",
55
- name: "link-external"
56
- })) : m("", !0)
57
- ])
58
- ], 16, v)) : (i(), p("a", t({
47
+ s(n.$slots, "default"),
48
+ n.externalIndicator ? (l(), k(p, {
49
+ key: 0,
50
+ class: "neon-link__external-indicator",
51
+ color: "low-contrast",
52
+ name: "share-external-link-1"
53
+ })) : C("", !0)
54
+ ], 16, S)) : (l(), u("a", t({
59
55
  key: 2,
60
56
  class: [[{ "neon-link--no-style": n.noStyle }, `neon-link--outline-${n.outlineStyle}`], "neon-link"],
61
57
  tabindex: "0"
62
58
  }, n.sanitizedAttributes, {
63
59
  onClick: e[3] || (e[3] = (...o) => n.onClick && n.onClick(...o)),
64
60
  onKeydown: [
65
- e[4] || (e[4] = l((...o) => n.onClick && n.onClick(...o), ["enter"])),
66
- e[5] || (e[5] = l(r((...o) => n.onSpace && n.onSpace(...o), ["prevent"]), ["space"]))
61
+ e[4] || (e[4] = i((...o) => n.onClick && n.onClick(...o), ["enter"])),
62
+ e[5] || (e[5] = i(r((...o) => n.onSpace && n.onSpace(...o), ["prevent"]), ["space"]))
67
63
  ]
68
64
  }), [
69
- s("span", b, [
70
- a(n.$slots, "default")
71
- ])
65
+ s(n.$slots, "default")
72
66
  ], 16));
73
67
  }
74
- const I = /* @__PURE__ */ S(f, [["render", w]]);
68
+ const A = /* @__PURE__ */ m(y, [["render", v]]);
75
69
  export {
76
- I as default
70
+ A as default
77
71
  };
78
72
  //# sourceMappingURL=NeonLink.vue.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NeonLink.vue.es.js","sources":["../../../../src/components/navigation/link/NeonLink.vue"],"sourcesContent":["<template>\n <router-link\n v-if=\"routerUrl\"\n :class=\"[\n { 'neon-link--no-style': noStyle, 'neon-link--active': activeRoute, 'neon-link--exact-active': exactRoute },\n `neon-link--outline-${outlineStyle}`,\n ]\"\n :to=\"routerUrl\"\n class=\"neon-link neon-link--router-link\"\n tabindex=\"0\"\n v-bind=\"sanitizedAttributes\"\n @click=\"onClick\"\n @keydown.enter=\"onClick\"\n @keydown.space.prevent=\"onSpace\"\n >\n <span class=\"neon-link__label\">\n <!-- @slot the content of the link -->\n <slot></slot>\n </span>\n </router-link>\n <a\n v-else-if=\"href\"\n :class=\"[\n {\n 'neon-link--no-style': noStyle,\n 'neon-link--with-external-indicator': externalIndicator,\n 'neon-link--active': activeRoute,\n 'neon-link--exact-active': exactRoute,\n },\n `neon-link--outline-${outlineStyle}`,\n ]\"\n :href=\"href\"\n class=\"neon-link neon-link--external-link\"\n rel=\"noopener\"\n tabindex=\"0\"\n v-bind=\"sanitizedAttributes\"\n @click=\"onClick\"\n @keydown.enter=\"onClick\"\n @keydown.space.prevent=\"onSpace\"\n >\n <span class=\"neon-link__label\">\n <!-- @slot the content of the link -->\n <slot></slot>\n <neon-icon\n v-if=\"externalIndicator\"\n class=\"neon-link__external-indicator\"\n color=\"low-contrast\"\n name=\"link-external\"\n />\n </span>\n </a>\n <a\n v-else\n :class=\"[{ 'neon-link--no-style': noStyle }, `neon-link--outline-${outlineStyle}`]\"\n class=\"neon-link\"\n tabindex=\"0\"\n v-bind=\"sanitizedAttributes\"\n @click=\"onClick\"\n @keydown.enter=\"onClick\"\n @keydown.space.prevent=\"onSpace\"\n >\n <span class=\"neon-link__label\">\n <!-- @slot the content of the link -->\n <slot></slot>\n </span>\n </a>\n</template>\n\n<script lang=\"ts\" src=\"./NeonLink.ts\" />\n"],"names":["_hoisted_1","_hoisted_3","_hoisted_4","_ctx","_openBlock","_createBlock","_component_router_link","_mergeProps","_createElementVNode","_renderSlot","_createElementBlock","args","_component_neon_icon"],"mappings":";;;AAeU,MAAAA,IAAA,EAAA,OAAM,mBAAkB,iBAyBxBC,IAAA,EAAA,OAAM,mBAAkB,GAqBxBC,IAAA,EAAA,OAAM,mBAAkB;;;SA3DxBC,EAAA,aADRC,KAAAC,EAkBcC,GAlBdC,EAkBc;AAAA;IAhBX,OAAK,CAAA;AAAA,+BAAmCJ,EAAA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AA,QAAO,GAAA,sBAA0BA,EAAA,YAAY,KACzE,WAAW;AAAA,IACjB,UAAS;AAAA,KACDA,EAAA,qBAAmB;AAAA,IAC1B,mCAAOA,EAAA,WAAAA,EAAA,QAAA,GAAAQ,CAAA;AAAA,IACP,WAAO;AAAA,kCAAQR,EAAA,WAAAA,EAAA,QAAA,GAAAQ,CAAA,GAAO,CAAA,OAAA,CAAA;AAAA,oCACCR,EAAA,WAAAA,EAAA,QAAA,GAAAQ,CAAA,GAAO,CAAA,SAAA,CAAA,GAAA,CAAA,OAAA,CAAA;AAAA;;IAE/BH,EAGO,QAHPN,GAGO;AAAA,MADLO,EAAaN,EAAA,QAAA,SAAA;AAAA;;;;"}
1
+ {"version":3,"file":"NeonLink.vue.es.js","sources":["../../../../src/components/navigation/link/NeonLink.vue"],"sourcesContent":["<template>\n <router-link\n v-if=\"routerUrl\"\n :class=\"[\n { 'neon-link--no-style': noStyle, 'neon-link--active': activeRoute, 'neon-link--exact-active': exactRoute },\n `neon-link--outline-${outlineStyle}`,\n ]\"\n :to=\"routerUrl\"\n class=\"neon-link neon-link--router-link\"\n tabindex=\"0\"\n v-bind=\"sanitizedAttributes\"\n @click=\"onClick\"\n @keydown.enter=\"onClick\"\n @keydown.space.prevent=\"onSpace\"\n >\n <!-- @slot the content of the link -->\n <slot></slot>\n </router-link>\n <a\n v-else-if=\"href\"\n :class=\"[\n {\n 'neon-link--no-style': noStyle,\n 'neon-link--with-external-indicator': externalIndicator,\n 'neon-link--active': activeRoute,\n 'neon-link--exact-active': exactRoute,\n },\n `neon-link--outline-${outlineStyle}`,\n ]\"\n :href=\"href\"\n class=\"neon-link neon-link--external-link\"\n rel=\"noopener\"\n tabindex=\"0\"\n v-bind=\"sanitizedAttributes\"\n @click=\"onClick\"\n @keydown.enter=\"onClick\"\n @keydown.space.prevent=\"onSpace\"\n >\n <!-- @slot the content of the link -->\n <slot></slot>\n <neon-icon\n v-if=\"externalIndicator\"\n class=\"neon-link__external-indicator\"\n color=\"low-contrast\"\n name=\"share-external-link-1\"\n />\n </a>\n <a\n v-else\n :class=\"[{ 'neon-link--no-style': noStyle }, `neon-link--outline-${outlineStyle}`]\"\n class=\"neon-link\"\n tabindex=\"0\"\n v-bind=\"sanitizedAttributes\"\n @click=\"onClick\"\n @keydown.enter=\"onClick\"\n @keydown.space.prevent=\"onSpace\"\n >\n <!-- @slot the content of the link -->\n <slot></slot>\n </a>\n</template>\n\n<script lang=\"ts\" src=\"./NeonLink.ts\" />\n"],"names":["_ctx","_openBlock","_createBlock","_component_router_link","_mergeProps","_renderSlot","_createElementBlock","args","_component_neon_icon"],"mappings":";;;;;;SAEUA,EAAA,aADRC,KAAAC,EAgBcC,GAhBdC,EAgBc;AAAA;IAdX,OAAK,CAAA;AAAA,+BAAmCJ,EAAA,SAAO,qBAAuBA,EAAA,aAAW,2BAA6BA,EAAA,WAAU;AAAA,4BAAgCA,EAAA,YAAY;AAAA,OAK/J,kCAAkC;AAAA,IADvC,IAAIA,EAAA;AAAA,IAEL,UAAS;AAAA,KACDA,EAAA,qBAAmB;AAAA,IAC1B,SAAOA,EAAA;AAAA,IACP,WAAO;AAAA,QAAQA,EAAA,SAAO,CAAA,OAAA,CAAA;AAAA,UACCA,EAAA,SAAO,CAAA,SAAA,CAAA,GAAA,CAAA,OAAA,CAAA;AAAA;;eAG/B,MAAa;AAAA,MAAbK,EAAaL,EAAA,QAAA,SAAA;AAAA;;qDAGFA,EAAA,QADbC,KAAAK,EA4BI,KA5BJF,EA4BI;AAAA;IA1BD,OAAK,CAAA;AAAA;+BAA2CJ,EAAA;AAAA,8CAAuDA,EAAA;AAAA,6BAAgDA,EAAA;AAAA,mCAAgDA,EAAA;AAAA;4BAAiDA,EAAA,YAAY;AAAA,OAU/P,oCAAoC;AAAA,IADzC,MAAMA,EAAA;AAAA,IAEP,KAAI;AAAA,IACJ,UAAS;AAAA,KACDA,EAAA,qBAAmB;AAAA,IAC1B,mCAAOA,EAAA,WAAAA,EAAA,QAAA,GAAAO,CAAA;AAAA,IACP,WAAO;AAAA,kCAAQP,EAAA,WAAAA,EAAA,QAAA,GAAAO,CAAA,GAAO,CAAA,OAAA,CAAA;AAAA,oCACCP,EAAA,WAAAA,EAAA,QAAA,GAAAO,CAAA,GAAO,CAAA,SAAA,CAAA,GAAA,CAAA,OAAA,CAAA;AAAA;;IAG/BF,EAAaL,EAAA,QAAA,SAAA;AAAA,IAELA,EAAA,0BADRE,EAKEM,GAAA;AAAA;MAHA,OAAM;AAAA,MACN,OAAM;AAAA,MACN,MAAK;AAAA;gBAGTP,KAAAK,EAYI,KAZJF,EAYI;AAAA;IAVD,OAAK,CAAA,CAAA,EAAA,uBAA4BJ,EAAA,QAAO,GAAA,sBAA0BA,EAAA,YAAY,KACzE,WAAW;AAAA,IACjB,UAAS;AAAA,KACDA,EAAA,qBAAmB;AAAA,IAC1B,mCAAOA,EAAA,WAAAA,EAAA,QAAA,GAAAO,CAAA;AAAA,IACP,WAAO;AAAA,kCAAQP,EAAA,WAAAA,EAAA,QAAA,GAAAO,CAAA,GAAO,CAAA,OAAA,CAAA;AAAA,oCACCP,EAAA,WAAAA,EAAA,QAAA,GAAAO,CAAA,GAAO,CAAA,SAAA,CAAA,GAAA,CAAA,OAAA,CAAA;AAAA;;IAG/BF,EAAaL,EAAA,QAAA,SAAA;AAAA;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";const c=require("./NeonMenu.cjs.js"),e=require("vue"),i=require("../../../_virtual/_plugin-vue_export-helper.cjs.js"),u={ref:"menuWrapper",class:"neon-menu__wrapper"},d={class:"neon-menu__item-label"};function p(o,l,m,_,y,b){const s=e.resolveComponent("neon-dropdown-menu"),t=e.resolveComponent("neon-icon"),a=e.resolveComponent("neon-link");return e.openBlock(),e.createElementBlock("nav",u,[e.createElementVNode("ul",{class:e.normalizeClass([[`neon-menu--${o.color}`,`neon-menu--${o.size}`],"neon-menu no-style"]),role:"menubar"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.menu,n=>(e.openBlock(),e.createElementBlock("li",{key:n.key,ref_for:!0,ref:"menuItem",class:e.normalizeClass([{"neon-menu__item--disabled":n.disabled},"neon-menu__item"])},[n.children?(e.openBlock(),e.createBlock(s,{key:`${n.key}DropdownMenu`,class:e.normalizeClass({"router-link-active":o.routeMatches(n.href)}),color:o.color,disabled:n.disabled,icon:n.icon,label:n.label,model:n.children,openOnHover:!n.disabled,size:o.size,"dropdown-style":"text-button"},null,8,["class","color","disabled","icon","label","model","openOnHover","size"])):(e.openBlock(),e.createBlock(a,{key:`${n.key}Link`,class:e.normalizeClass({"router-link-active":o.routeMatches(n.href)}),href:n.href,"no-style":!0,tabindex:n.disabled?-1:0,"outline-style":"none",role:"menuitem",onClick:r=>!n.disabled&&o.onClick(n.key),onKeydown:[e.withKeys(r=>!n.disabled&&o.onClick(n.key),["enter"]),e.withKeys(e.withModifiers(r=>!n.disabled&&o.onClick(n.key),["prevent"]),["space"])]},{default:e.withCtx(()=>[n.icon?(e.openBlock(),e.createBlock(t,{key:`${n.key}LinkIcon`,name:n.icon,class:"neon-menu__item-icon",color:"neutral"},null,8,["name"])):e.createCommentVNode("",!0),e.createElementVNode("span",d,e.toDisplayString(n.label),1)]),_:2},1032,["class","href","tabindex","onClick","onKeydown"]))],2))),128))],2),e.createVNode(s,{class:e.normalizeClass([{"neon-menu__responsive-menu--hidden":o.responsiveMenuItems.length===0},"neon-menu__responsive-menu"]),color:o.color,indicator:!1,model:o.responsiveMenuItems,openOnHover:!0,size:o.size,"dropdown-style":"text-button",icon:"ellipsis",placement:"bottom-right",onButtonRef:l[0]||(l[0]=n=>o.responsiveButton=n)},null,8,["class","color","model","size"])],512)}const k=i(c,[["render",p]]);module.exports=k;
1
+ "use strict";const c=require("./NeonMenu.cjs.js"),e=require("vue"),i=require("../../../_virtual/_plugin-vue_export-helper.cjs.js"),u={ref:"menuWrapper",class:"neon-menu__wrapper"},d={class:"neon-menu__item-label"};function p(o,l,m,_,y,v){const s=e.resolveComponent("neon-dropdown-menu"),a=e.resolveComponent("neon-icon"),t=e.resolveComponent("neon-link");return e.openBlock(),e.createElementBlock("nav",u,[e.createElementVNode("ul",{class:e.normalizeClass([[`neon-menu--${o.color}`,`neon-menu--${o.size}`],"neon-menu no-style"]),role:"menubar"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.menu,n=>(e.openBlock(),e.createElementBlock("li",{key:n.key,ref_for:!0,ref:"menuItem",class:e.normalizeClass([{"neon-menu__item--disabled":n.disabled},"neon-menu__item"])},[n.children?(e.openBlock(),e.createBlock(s,{key:`${n.key}DropdownMenu`,class:e.normalizeClass({"router-link-active":o.routeMatches(n.href)}),color:o.color,disabled:n.disabled,icon:n.icon,label:n.label,model:n.children,openOnHover:!n.disabled,size:o.size,"dropdown-style":"text"},null,8,["class","color","disabled","icon","label","model","openOnHover","size"])):(e.openBlock(),e.createBlock(t,{key:`${n.key}Link`,class:e.normalizeClass({"router-link-active":o.routeMatches(n.href)}),href:n.href,"no-style":!0,tabindex:n.disabled?-1:0,"outline-style":"none",role:"menuitem",onClick:r=>!n.disabled&&o.onClick(n.key),onKeydown:[e.withKeys(r=>!n.disabled&&o.onClick(n.key),["enter"]),e.withKeys(e.withModifiers(r=>!n.disabled&&o.onClick(n.key),["prevent"]),["space"])]},{default:e.withCtx(()=>[n.icon?(e.openBlock(),e.createBlock(a,{key:`${n.key}LinkIcon`,name:n.icon,class:"neon-menu__item-icon",color:"neutral"},null,8,["name"])):e.createCommentVNode("",!0),e.createElementVNode("span",d,e.toDisplayString(n.label),1)]),_:2},1032,["class","href","tabindex","onClick","onKeydown"]))],2))),128))],2),e.createVNode(s,{class:e.normalizeClass([{"neon-menu__responsive-menu--hidden":o.responsiveMenuItems.length===0},"neon-menu__responsive-menu"]),color:o.color,indicator:!1,model:o.responsiveMenuItems,openOnHover:!0,size:o.size,"dropdown-style":"text",icon:"ellipsis",placement:"bottom-right",onButtonRef:l[0]||(l[0]=n=>o.responsiveButton=n)},null,8,["class","color","model","size"])],512)}const k=i(c,[["render",p]]);module.exports=k;
2
2
  //# sourceMappingURL=NeonMenu.vue.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NeonMenu.vue.cjs.js","sources":["../../../../src/components/navigation/menu/NeonMenu.vue"],"sourcesContent":["<template>\n <nav ref=\"menuWrapper\" class=\"neon-menu__wrapper\">\n <ul :class=\"[`neon-menu--${color}`, `neon-menu--${size}`]\" class=\"neon-menu no-style\" role=\"menubar\">\n <li\n v-for=\"item in menu\"\n :key=\"item.key\"\n ref=\"menuItem\"\n :class=\"{ 'neon-menu__item--disabled': item.disabled }\"\n class=\"neon-menu__item\"\n >\n <neon-dropdown-menu\n v-if=\"item.children\"\n :key=\"`${item.key}DropdownMenu`\"\n :class=\"{ 'router-link-active': routeMatches(item.href) }\"\n :color=\"color\"\n :disabled=\"item.disabled\"\n :icon=\"item.icon\"\n :label=\"item.label\"\n :model=\"item.children\"\n :openOnHover=\"!item.disabled\"\n :size=\"size\"\n dropdown-style=\"text-button\"\n />\n <neon-link\n v-else\n :key=\"`${item.key}Link`\"\n :class=\"{ 'router-link-active': routeMatches(item.href) }\"\n :href=\"item.href\"\n :no-style=\"true\"\n :tabindex=\"item.disabled ? -1 : 0\"\n outline-style=\"none\"\n role=\"menuitem\"\n @click=\"!item.disabled && onClick(item.key)\"\n @keydown.enter=\"!item.disabled && onClick(item.key)\"\n @keydown.space.prevent=\"!item.disabled && onClick(item.key)\"\n >\n <neon-icon\n v-if=\"item.icon\"\n :key=\"`${item.key}LinkIcon`\"\n :name=\"item.icon\"\n class=\"neon-menu__item-icon\"\n color=\"neutral\"\n />\n <span class=\"neon-menu__item-label\">{{ item.label }}</span>\n </neon-link>\n </li>\n </ul>\n <neon-dropdown-menu\n :class=\"{ 'neon-menu__responsive-menu--hidden': responsiveMenuItems.length === 0 }\"\n :color=\"color\"\n :indicator=\"false\"\n :model=\"responsiveMenuItems\"\n :openOnHover=\"true\"\n :size=\"size\"\n class=\"neon-menu__responsive-menu\"\n dropdown-style=\"text-button\"\n icon=\"ellipsis\"\n placement=\"bottom-right\"\n @button-ref=\"responsiveButton = $event\"\n />\n </nav>\n</template>\n\n<script lang=\"ts\" src=\"./NeonMenu.ts\" />\n"],"names":["_hoisted_2","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_normalizeClass","_ctx","_Fragment","_renderList","item","_createBlock","_component_neon_dropdown_menu","_component_neon_link","$event","_withKeys","_withModifiers","_component_neon_icon","_toDisplayString","_createVNode","_cache"],"mappings":"sIACO,IAAI,cAAc,MAAM,sBA0CfA,EAAA,CAAA,MAAM,uBAAuB,+IA1C3C,OAAAC,YAAA,EAAAC,qBA2DM,MA3DNC,EA2DM,CA1DJC,EAAAA,mBA4CK,KAAA,CA5CA,MAAKC,EAAAA,eAAA,CAAA,CAAA,cAAiBC,EAAA,KAAK,GAAA,cAAkBA,EAAA,IAAI,IAAW,oBAAoB,CAAA,EAAC,KAAK,6BACzFJ,EAAAA,mBA0CKK,EAAAA,SAAA,KAAAC,EAAAA,WAzCYF,EAAA,KAARG,kBADTP,EAAAA,mBA0CK,KAAA,CAxCF,IAAKO,EAAK,eACX,IAAI,WACH,MAAKJ,EAAAA,eAAA,CAAA,CAAA,4BAAiCI,EAAK,QAAQ,EAC9C,iBAAiB,CAAA,IAGfA,EAAK,wBADbC,EAAAA,YAYEC,EAAA,CAVC,IAAG,GAAKF,EAAK,GAAG,eAChB,MAAKJ,EAAAA,eAAA,CAAA,qBAA0BC,EAAA,aAAaG,EAAK,IAAI,EAAA,EACrD,MAAOH,EAAA,MACP,SAAUG,EAAK,SACf,KAAMA,EAAK,KACX,MAAOA,EAAK,MACZ,MAAOA,EAAK,SACZ,YAAW,CAAGA,EAAK,SACnB,KAAMH,EAAA,KACP,iBAAe,gHAEjBI,EAAAA,YAqBYE,EAAA,CAnBT,IAAG,GAAKH,EAAK,GAAG,OAChB,MAAKJ,EAAAA,eAAA,CAAA,qBAA0BC,EAAA,aAAaG,EAAK,IAAI,EAAA,EACrD,KAAMA,EAAK,KACX,WAAU,GACV,SAAUA,EAAK,SAAQ,GAAA,EACxB,gBAAc,OACd,KAAK,WACJ,QAAKI,GAAA,CAAGJ,EAAK,UAAYH,EAAA,QAAQG,EAAK,GAAG,EACzC,UAAO,CAASK,EAAAA,SAAAD,GAAA,CAAAJ,EAAK,UAAYH,UAAQG,EAAK,GAAG,EAAA,CAAA,OAAA,CAAA,EACzBK,EAAAA,SAAAC,EAAAA,cAAAF,GAAA,CAAAJ,EAAK,UAAYH,UAAQG,EAAK,GAAG,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,OAAA,CAAA,uBAE1D,IAME,CALMA,EAAK,oBADbC,EAAAA,YAMEM,EAAA,CAJC,IAAG,GAAKP,EAAK,GAAG,WAChB,KAAMA,EAAK,KACZ,MAAM,uBACN,MAAM,yDAERL,EAAAA,mBAA2D,OAA3DJ,EAA2DiB,EAAAA,gBAApBR,EAAK,KAAK,EAAA,CAAA,kFAIvDS,EAAAA,YAYEP,EAAA,CAXC,MAAKN,EAAAA,eAAA,CAAA,CAAA,qCAA0CC,EAAA,oBAAoB,YAM9D,4BAA4B,CAAA,EALjC,MAAOA,EAAA,MACP,UAAW,GACX,MAAOA,EAAA,oBACP,YAAa,GACb,KAAMA,EAAA,KAEP,iBAAe,cACf,KAAK,WACL,UAAU,eACT,YAAUa,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAN,GAAEP,EAAA,iBAAmBO"}
1
+ {"version":3,"file":"NeonMenu.vue.cjs.js","sources":["../../../../src/components/navigation/menu/NeonMenu.vue"],"sourcesContent":["<template>\n <nav ref=\"menuWrapper\" class=\"neon-menu__wrapper\">\n <ul :class=\"[`neon-menu--${color}`, `neon-menu--${size}`]\" class=\"neon-menu no-style\" role=\"menubar\">\n <li\n v-for=\"item in menu\"\n :key=\"item.key\"\n ref=\"menuItem\"\n :class=\"{ 'neon-menu__item--disabled': item.disabled }\"\n class=\"neon-menu__item\"\n >\n <neon-dropdown-menu\n v-if=\"item.children\"\n :key=\"`${item.key}DropdownMenu`\"\n :class=\"{ 'router-link-active': routeMatches(item.href) }\"\n :color=\"color\"\n :disabled=\"item.disabled\"\n :icon=\"item.icon\"\n :label=\"item.label\"\n :model=\"item.children\"\n :openOnHover=\"!item.disabled\"\n :size=\"size\"\n dropdown-style=\"text\"\n />\n <neon-link\n v-else\n :key=\"`${item.key}Link`\"\n :class=\"{ 'router-link-active': routeMatches(item.href) }\"\n :href=\"item.href\"\n :no-style=\"true\"\n :tabindex=\"item.disabled ? -1 : 0\"\n outline-style=\"none\"\n role=\"menuitem\"\n @click=\"!item.disabled && onClick(item.key)\"\n @keydown.enter=\"!item.disabled && onClick(item.key)\"\n @keydown.space.prevent=\"!item.disabled && onClick(item.key)\"\n >\n <neon-icon\n v-if=\"item.icon\"\n :key=\"`${item.key}LinkIcon`\"\n :name=\"item.icon\"\n class=\"neon-menu__item-icon\"\n color=\"neutral\"\n />\n <span class=\"neon-menu__item-label\">{{ item.label }}</span>\n </neon-link>\n </li>\n </ul>\n <neon-dropdown-menu\n :class=\"{ 'neon-menu__responsive-menu--hidden': responsiveMenuItems.length === 0 }\"\n :color=\"color\"\n :indicator=\"false\"\n :model=\"responsiveMenuItems\"\n :openOnHover=\"true\"\n :size=\"size\"\n class=\"neon-menu__responsive-menu\"\n dropdown-style=\"text\"\n icon=\"ellipsis\"\n placement=\"bottom-right\"\n @button-ref=\"responsiveButton = $event\"\n />\n </nav>\n</template>\n\n<script lang=\"ts\" src=\"./NeonMenu.ts\" />\n"],"names":["_hoisted_2","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_normalizeClass","_ctx","_Fragment","_renderList","item","_createBlock","_component_neon_dropdown_menu","_component_neon_link","$event","_withKeys","_withModifiers","_component_neon_icon","_toDisplayString","_createVNode","_cache"],"mappings":"sIACO,IAAI,cAAc,MAAM,sBA0CfA,EAAA,CAAA,MAAM,uBAAuB,+IA1C3C,OAAAC,YAAA,EAAAC,qBA2DM,MA3DNC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