@aotearoan/neon 22.2.0 → 22.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/common/enums/NeonToggleStyle.cjs.js +1 -1
  2. package/dist/common/enums/NeonToggleStyle.cjs.js.map +1 -1
  3. package/dist/common/enums/NeonToggleStyle.es.js +2 -2
  4. package/dist/common/enums/NeonToggleStyle.es.js.map +1 -1
  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 +45 -39
  8. package/dist/common/utils/NeonDateUtils.es.js.map +1 -1
  9. package/dist/components/navigation/stepper/NeonStepper.vue.cjs.js +1 -1
  10. package/dist/components/navigation/stepper/NeonStepper.vue.cjs.js.map +1 -1
  11. package/dist/components/navigation/stepper/NeonStepper.vue.es.js +29 -21
  12. package/dist/components/navigation/stepper/NeonStepper.vue.es.js.map +1 -1
  13. package/dist/components/presentation/image-carousel/NeonImageCarousel.cjs.js +1 -1
  14. package/dist/components/presentation/image-carousel/NeonImageCarousel.cjs.js.map +1 -1
  15. package/dist/components/presentation/image-carousel/NeonImageCarousel.es.js +44 -32
  16. package/dist/components/presentation/image-carousel/NeonImageCarousel.es.js.map +1 -1
  17. package/dist/components/presentation/image-carousel/NeonImageCarousel.vue.cjs.js +1 -1
  18. package/dist/components/presentation/image-carousel/NeonImageCarousel.vue.cjs.js.map +1 -1
  19. package/dist/components/presentation/image-carousel/NeonImageCarousel.vue.es.js +116 -86
  20. package/dist/components/presentation/image-carousel/NeonImageCarousel.vue.es.js.map +1 -1
  21. package/dist/components/user-input/toggle/NeonToggle.cjs.js +1 -1
  22. package/dist/components/user-input/toggle/NeonToggle.cjs.js.map +1 -1
  23. package/dist/components/user-input/toggle/NeonToggle.es.js +19 -18
  24. package/dist/components/user-input/toggle/NeonToggle.es.js.map +1 -1
  25. package/dist/components/user-input/toggle/NeonToggle.vue.cjs.js +1 -1
  26. package/dist/components/user-input/toggle/NeonToggle.vue.cjs.js.map +1 -1
  27. package/dist/components/user-input/toggle/NeonToggle.vue.es.js +9 -9
  28. package/dist/components/user-input/toggle/NeonToggle.vue.es.js.map +1 -1
  29. package/dist/src/common/enums/NeonToggleStyle.d.ts +3 -1
  30. package/dist/src/common/models/NeonDate.d.ts +2 -0
  31. package/dist/src/components/presentation/image-carousel/NeonImageCarousel.d.ts +35 -22
  32. package/dist/src/components/user-input/toggle/NeonToggle.d.ts +1 -0
  33. package/package.json +1 -1
  34. package/src/sass/components/_badge.scss +2 -0
  35. package/src/sass/components/_image-carousel.scss +109 -14
  36. package/src/sass/components/_stepper.scss +8 -3
  37. package/src/sass/components/_toggle.scss +29 -6
  38. package/src/sass/variables.scss +30 -2
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e=(t=>(t.Toggle="toggle",t.RadioButtons="radio-buttons",t))(e||{});exports.NeonToggleStyle=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var r=(t=>(t.Toggle="toggle",t.RadioButtons="radio-buttons",t.Card="card",t))(r||{});exports.NeonToggleStyle=r;
2
2
  //# sourceMappingURL=NeonToggleStyle.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NeonToggleStyle.cjs.js","sources":["../../../src/common/enums/NeonToggleStyle.ts"],"sourcesContent":["/**\n * Describes the available <a href=\"/user-input/toggle\">NeonToggle</a> styles.\n */\nexport enum NeonToggleStyle {\n /** Toggle style which is a horizontal group of connected buttons with one active member. */\n Toggle = 'toggle',\n /** Traditional HTML radio button input style. */\n RadioButtons = 'radio-buttons',\n}\n"],"names":["NeonToggleStyle"],"mappings":"gFAGO,IAAKA,GAAAA,IAEVA,EAAA,OAAS,SAETA,EAAA,aAAe,gBAJLA,IAAAA,GAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"NeonToggleStyle.cjs.js","sources":["../../../src/common/enums/NeonToggleStyle.ts"],"sourcesContent":["/**\n * Describes the available <a href=\"/user-input/toggle\">NeonToggle</a> styles.\n */\nexport enum NeonToggleStyle {\n /** Toggle style which is a horizontal group of connected buttons with one active member. */\n Toggle = 'toggle',\n /** Traditional HTML radio button input style. */\n RadioButtons = 'radio-buttons',\n /** Card style radio buttons for more detailed content */\n Card = 'card',\n}\n"],"names":["NeonToggleStyle"],"mappings":"gFAGO,IAAKA,GAAAA,IAEVA,EAAA,OAAS,SAETA,EAAA,aAAe,gBAEfA,EAAA,KAAO,OANGA,IAAAA,GAAA,CAAA,CAAA"}
@@ -1,5 +1,5 @@
1
- var o = /* @__PURE__ */ ((t) => (t.Toggle = "toggle", t.RadioButtons = "radio-buttons", t))(o || {});
1
+ var a = /* @__PURE__ */ ((r) => (r.Toggle = "toggle", r.RadioButtons = "radio-buttons", r.Card = "card", r))(a || {});
2
2
  export {
3
- o as NeonToggleStyle
3
+ a as NeonToggleStyle
4
4
  };
5
5
  //# sourceMappingURL=NeonToggleStyle.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NeonToggleStyle.es.js","sources":["../../../src/common/enums/NeonToggleStyle.ts"],"sourcesContent":["/**\n * Describes the available <a href=\"/user-input/toggle\">NeonToggle</a> styles.\n */\nexport enum NeonToggleStyle {\n /** Toggle style which is a horizontal group of connected buttons with one active member. */\n Toggle = 'toggle',\n /** Traditional HTML radio button input style. */\n RadioButtons = 'radio-buttons',\n}\n"],"names":["NeonToggleStyle"],"mappings":"AAGO,IAAKA,sBAAAA,OAEVA,EAAA,SAAS,UAETA,EAAA,eAAe,iBAJLA,IAAAA,KAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"NeonToggleStyle.es.js","sources":["../../../src/common/enums/NeonToggleStyle.ts"],"sourcesContent":["/**\n * Describes the available <a href=\"/user-input/toggle\">NeonToggle</a> styles.\n */\nexport enum NeonToggleStyle {\n /** Toggle style which is a horizontal group of connected buttons with one active member. */\n Toggle = 'toggle',\n /** Traditional HTML radio button input style. */\n RadioButtons = 'radio-buttons',\n /** Card style radio buttons for more detailed content */\n Card = 'card',\n}\n"],"names":["NeonToggleStyle"],"mappings":"AAGO,IAAKA,sBAAAA,OAEVA,EAAA,SAAS,UAETA,EAAA,eAAe,iBAEfA,EAAA,OAAO,QANGA,IAAAA,KAAA,CAAA,CAAA;"}
@@ -1,2 +1,2 @@
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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class s{static stringToNeonDate(e,o,n=!1){const a=o||navigator.language,r=new Date,t=new Date(!n&&e.length===10?`${e}T${r.toISOString().split("T")[1]}`:e);let i;e.length>10&&(i=t.toLocaleString("en-GB",e.length<=16?{hour12:!1,hour:"2-digit",minute:"2-digit"}:{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}));const c={year:+t.toLocaleString("en-US",{year:"numeric"}),yearFormatted:t.toLocaleString(a,{year:"numeric"}),month:+t.toLocaleString("en-US",{month:"numeric"}),monthShortName:t.toLocaleString(a,{month:"short"}),monthLongName:t.toLocaleString(a,{month:"long"}),day:+t.toLocaleString("en-US",{day:"numeric"}),dayFormatted:t.toLocaleString(a,{day:"2-digit"})};return i&&(c.time=i,c.timeShort=t.toLocaleString("en-GB",{hour12:!1,hourCycle:"h23",hour:"2-digit",minute:"2-digit"})),c}static dateToIso(e,o=!1){const n=e.toISOString();return o?n:n.split("T")[0]}static dmyToIso(e,o,n){return`${n}-${o<10?"0"+o:o}-${e<10?"0"+e:e}`}static dowNames(e,o="short"){const n=e||navigator.language,a=new Date,r=[];for(;!r[a.getDay()];)r[a.getDay()]=a.toLocaleString(n,{weekday:o}),a.setDate(a.getDate()+1);const t=r.shift();return t&&r.push(t),r}static monthNames(e,o="short"){const n=e||navigator.language;return Array.from(Array(12).keys()).map(a=>new Date(2023,a,15).toLocaleString(n,{month:o}))}static toCalendarConfiguration(e,o,n,a,r){const t=r||navigator.language,i=s.stringToNeonDate(s.dateToIso(new Date),t),c=e?s.stringToNeonDate(e,t,!0):void 0,u=o||i.month,S=o&&n?new Date(n,o-1,15):null,L=(S==null?void 0:S.toLocaleString(t,{month:"long"}))||i.monthLongName,h=n||i.year,N=a||Math.floor(h/10)*10,m=new Date(h,(u+11)%12,1),f=new Date(h,(u+11)%12,1);f.setDate(f.getDate()-1);const d=[];let D=1,w=!1;for(let g=0;g<6;g++){d[g]=[];for(let l=0;l<7;l++)if(g===0&&l<f.getDay())d[g][l]=null;else if(d[g][l]=m.getDate(),D=m.getDate(),m.setDate(m.getDate()+1),m.getDate()===1){for(let y=l+1;y<7;y++)d[g][y]=null;w=!0;break}if(w)break}return{today:i,selected:c,pageMonth:u,pageMonthName:L,pageYear:h,pageDecadeStart:N,dowNames:s.dowNames(t),dowLongNames:s.dowNames(t,"long"),dates:d,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 * @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,CAA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,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
+ {"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 'en-GB', // use en-GB for 0-23 hr offset\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 // use en-GB for 0-23 hr offset\n result.timeShort = dateObj.toLocaleString('en-GB', {\n hour12: false,\n hourCycle: 'h23',\n hour: '2-digit',\n minute: '2-digit',\n });\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,eACb,QACAL,EAAK,QAAU,GACX,CAAE,OAAQ,GAAO,KAAM,UAAW,OAAQ,WAC1C,CAAE,OAAQ,GAAO,KAAM,UAAW,OAAQ,UAAW,OAAQ,SAA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,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 g {
1
+ class i {
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,29 @@ class g {
8
8
  *
9
9
  * @returns Object representing the provided date.
10
10
  */
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);
11
+ static stringToNeonDate(e, o, n = !1) {
12
+ const a = o || navigator.language, r = /* @__PURE__ */ new Date(), t = new Date(!n && e.length === 10 ? `${e}T${r.toISOString().split("T")[1]}` : e);
13
13
  let s;
14
14
  e.length > 10 && (s = t.toLocaleString(
15
- n,
15
+ "en-GB",
16
+ // use en-GB for 0-23 hr offset
16
17
  e.length <= 16 ? { hour12: !1, hour: "2-digit", minute: "2-digit" } : { hour12: !1, hour: "2-digit", minute: "2-digit", second: "2-digit" }
17
18
  ));
18
- const d = {
19
+ const c = {
19
20
  year: +t.toLocaleString("en-US", { year: "numeric" }),
20
- yearFormatted: t.toLocaleString(n, { year: "numeric" }),
21
+ yearFormatted: t.toLocaleString(a, { year: "numeric" }),
21
22
  month: +t.toLocaleString("en-US", { month: "numeric" }),
22
- monthShortName: t.toLocaleString(n, { month: "short" }),
23
- monthLongName: t.toLocaleString(n, { month: "long" }),
23
+ monthShortName: t.toLocaleString(a, { month: "short" }),
24
+ monthLongName: t.toLocaleString(a, { month: "long" }),
24
25
  day: +t.toLocaleString("en-US", { day: "numeric" }),
25
- dayFormatted: t.toLocaleString(n, { day: "2-digit" })
26
+ dayFormatted: t.toLocaleString(a, { day: "2-digit" })
26
27
  };
27
- return s && (d.time = s), d;
28
+ return s && (c.time = s, c.timeShort = t.toLocaleString("en-GB", {
29
+ hour12: !1,
30
+ hourCycle: "h23",
31
+ hour: "2-digit",
32
+ minute: "2-digit"
33
+ })), c;
28
34
  }
29
35
  /**
30
36
  * Convert a date object to an ISO 8601 formatted string. By default, the time is not considered.
@@ -35,8 +41,8 @@ class g {
35
41
  * @returns an ISO 8601 formatted date, optionally with the time as well.
36
42
  */
37
43
  static dateToIso(e, o = !1) {
38
- const a = e.toISOString();
39
- return o ? a : a.split("T")[0];
44
+ const n = e.toISOString();
45
+ return o ? n : n.split("T")[0];
40
46
  }
41
47
  /**
42
48
  * Convert the params received into an ISO 8601 formatted string with only date in it.
@@ -47,8 +53,8 @@ class g {
47
53
  *
48
54
  * @returns an ISO 8601 formatted date for the given parameters.
49
55
  */
50
- static dmyToIso(e, o, a) {
51
- return `${a}-${o < 10 ? "0" + o : o}-${e < 10 ? "0" + e : e}`;
56
+ static dmyToIso(e, o, n) {
57
+ return `${n}-${o < 10 ? "0" + o : o}-${e < 10 ? "0" + e : e}`;
52
58
  }
53
59
  /**
54
60
  * Returns the days of the week starting at Monday day name translated using the locale received as a first element.
@@ -59,9 +65,9 @@ class g {
59
65
  * @returns an array with the days of the week named according to the locale received.
60
66
  */
61
67
  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);
68
+ const n = e || navigator.language, a = /* @__PURE__ */ new Date(), r = [];
69
+ for (; !r[a.getDay()]; )
70
+ r[a.getDay()] = a.toLocaleString(n, { weekday: o }), a.setDate(a.getDate() + 1);
65
71
  const t = r.shift();
66
72
  return t && r.push(t), r;
67
73
  }
@@ -74,8 +80,8 @@ class g {
74
80
  * @returns an array with the month names of the year, all named according to the locale received.
75
81
  */
76
82
  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 }));
83
+ const n = e || navigator.language;
84
+ return Array.from(Array(12).keys()).map((a) => new Date(2023, a, 15).toLocaleString(n, { month: o }));
79
85
  }
80
86
  /**
81
87
  * Collate & return the data required to drive the calendar popup in
@@ -89,19 +95,19 @@ class g {
89
95
  *
90
96
  * @returns The calendar configuration.
91
97
  */
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);
94
- S.setDate(S.getDate() - 1);
95
- const m = [];
98
+ static toCalendarConfiguration(e, o, n, a, r) {
99
+ const t = r || navigator.language, s = i.stringToNeonDate(i.dateToIso(/* @__PURE__ */ new Date()), t), c = e ? i.stringToNeonDate(e, t, !0) : void 0, u = o || s.month, S = o && n ? new Date(n, o - 1, 15) : null, L = (S == null ? void 0 : S.toLocaleString(t, { month: "long" })) || s.monthLongName, d = n || s.year, N = a || Math.floor(d / 10) * 10, m = new Date(d, (u + 11) % 12, 1), f = new Date(d, (u + 11) % 12, 1);
100
+ f.setDate(f.getDate() - 1);
101
+ const h = [];
96
102
  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;
103
+ for (let g = 0; g < 6; g++) {
104
+ h[g] = [];
105
+ for (let l = 0; l < 7; l++)
106
+ if (g === 0 && l < f.getDay())
107
+ h[g][l] = null;
108
+ else if (h[g][l] = m.getDate(), w = m.getDate(), m.setDate(m.getDate() + 1), m.getDate() === 1) {
109
+ for (let y = l + 1; y < 7; y++)
110
+ h[g][y] = null;
105
111
  D = !0;
106
112
  break;
107
113
  }
@@ -110,21 +116,21 @@ class g {
110
116
  }
111
117
  return {
112
118
  today: s,
113
- selected: d,
119
+ selected: c,
114
120
  pageMonth: u,
115
121
  pageMonthName: L,
116
- pageYear: h,
122
+ pageYear: d,
117
123
  pageDecadeStart: N,
118
- dowNames: g.dowNames(t),
119
- dowLongNames: g.dowNames(t, "long"),
120
- dates: m,
124
+ dowNames: i.dowNames(t),
125
+ dowLongNames: i.dowNames(t, "long"),
126
+ dates: h,
121
127
  lastDayOfMonth: w,
122
- months: g.monthNames(t),
123
- monthLongNames: g.monthNames(t, "long")
128
+ months: i.monthNames(t),
129
+ monthLongNames: i.monthNames(t, "long")
124
130
  };
125
131
  }
126
132
  }
127
133
  export {
128
- g as NeonDateUtils
134
+ i as NeonDateUtils
129
135
  };
130
136
  //# 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 * @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,I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pC,gBAAgBJ,EAAc,WAAWI,GAAK,MAAM;AAAA,IAAA;AAAA,EAExD;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 'en-GB', // use en-GB for 0-23 hr offset\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 // use en-GB for 0-23 hr offset\n result.timeShort = dateObj.toLocaleString('en-GB', {\n hour12: false,\n hourCycle: 'h23',\n hour: '2-digit',\n minute: '2-digit',\n });\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,MACb;AAAA;AAAA,MACAL,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;AAAA,MAC5D,gBAAgBA,EAAQ,eAAeF,GAAK,EAAE,OAAO,SAAS;AAAA,MAC9D,eAAeE,EAAQ,eAAeF,GAAK,EAAE,OAAO,QAAQ;AAAA,MAC5D,KAAK,CAACE,EAAQ,eAAe,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C,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 l=require("./NeonStepper.cjs.js"),e=require("vue"),r=require("../../../_virtual/_plugin-vue_export-helper.cjs.js"),c=["onClick"],a={class:"neon-stepper__step-indicator"},m=["onClick"];function d(o,_,u,k,v,V){const n=e.resolveComponent("neon-icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([`neon-stepper--${o.color}`,"neon-stepper"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.steps,(p,t)=>(e.openBlock(),e.createElementBlock("div",{key:p,class:e.normalizeClass([{"neon-stepper__step--has-value":t<=o.modelValue||t<=o.completedIndex,"neon-stepper__step--active":t===o.modelValue,"neon-stepper__step--display-stepper":t<=o.completedIndex},"neon-stepper__step"])},[e.createElementVNode("div",{class:"neon-stepper__step-indicator-wrapper",onClick:s=>t!==o.modelValue&&t<=o.completedIndex&&o.emit("update:modelValue",t)},[e.createElementVNode("div",a,[t<o.completedIndex?(e.openBlock(),e.createBlock(n,{key:0,class:"neon-stepper__step-completed-icon",name:"check"})):t===o.completedIndex?(e.openBlock(),e.createBlock(n,{key:1,class:"neon-stepper__step-completing-icon",name:"dot"})):e.createCommentVNode("",!0)])],8,c),e.createElementVNode("span",{class:"neon-stepper__step-title",onClick:s=>t!==o.modelValue&&t<=o.completedIndex&&o.emit("update:modelValue",t)},e.toDisplayString(p),9,m)],2))),128))],2)}const i=r(l,[["render",d]]);module.exports=i;
1
+ "use strict";const s=require("./NeonStepper.cjs.js"),e=require("vue"),r=require("../../../_virtual/_plugin-vue_export-helper.cjs.js"),a=["aria-label","onClick"],c=["tabindex","onKeydown"],d=["onClick"];function m(o,u,_,k,V,v){const l=e.resolveComponent("neon-icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([`neon-stepper--${o.color}`,"neon-stepper"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.steps,(t,n)=>(e.openBlock(),e.createElementBlock("div",{key:t,class:e.normalizeClass([{"neon-stepper__step--has-value":n<=o.modelValue||n<=o.completedIndex,"neon-stepper__step--active":n===o.modelValue,"neon-stepper__step--display-stepper":n<=o.completedIndex},"neon-stepper__step"])},[e.createElementVNode("div",{"aria-label":t,class:"neon-stepper__step-indicator-wrapper",role:"button",tabindex:"-1",onClick:p=>n!==o.modelValue&&n<=o.completedIndex&&o.emit("update:modelValue",n)},[e.createElementVNode("div",{tabindex:n<=o.completedIndex?0:-1,class:"neon-stepper__step-indicator",onKeydown:e.withKeys(p=>n!==o.modelValue&&n<=o.completedIndex&&o.emit("update:modelValue",n),["enter"])},[n<o.completedIndex?(e.openBlock(),e.createBlock(l,{key:0,class:"neon-stepper__step-completed-icon",name:"check"})):n===o.completedIndex?(e.openBlock(),e.createBlock(l,{key:1,class:"neon-stepper__step-completing-icon",name:"dot"})):e.createCommentVNode("",!0)],40,c)],8,a),e.createElementVNode("span",{class:"neon-stepper__step-title",tabindex:"-1",onClick:p=>n!==o.modelValue&&n<=o.completedIndex&&o.emit("update:modelValue",n)},e.toDisplayString(t),9,d)],2))),128))],2)}const i=r(s,[["render",m]]);module.exports=i;
2
2
  //# sourceMappingURL=NeonStepper.vue.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NeonStepper.vue.cjs.js","sources":["../../../../src/components/navigation/stepper/NeonStepper.vue"],"sourcesContent":["<template>\n <div :class=\"`neon-stepper--${color}`\" class=\"neon-stepper\">\n <div\n v-for=\"(step, index) in steps\"\n :key=\"step\"\n :class=\"{\n 'neon-stepper__step--has-value': index <= modelValue || index <= completedIndex,\n 'neon-stepper__step--active': index === modelValue,\n 'neon-stepper__step--display-stepper': index <= completedIndex,\n }\"\n class=\"neon-stepper__step\"\n >\n <div\n class=\"neon-stepper__step-indicator-wrapper\"\n @click=\"index !== modelValue && index <= completedIndex && emit('update:modelValue', index)\"\n >\n <div class=\"neon-stepper__step-indicator\">\n <neon-icon v-if=\"index < completedIndex\" class=\"neon-stepper__step-completed-icon\" name=\"check\" />\n <neon-icon v-else-if=\"index === completedIndex\" class=\"neon-stepper__step-completing-icon\" name=\"dot\" />\n </div>\n </div>\n <span\n class=\"neon-stepper__step-title\"\n @click=\"index !== modelValue && index <= completedIndex && emit('update:modelValue', index)\"\n >\n {{ step }}\n </span>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" src=\"./NeonStepper.ts\" />\n"],"names":["_hoisted_2","_createElementBlock","_normalizeClass","_ctx","_openBlock","_Fragment","_renderList","step","index","_createElementVNode","$event","_createBlock","_component_neon_icon","_hoisted_3"],"mappings":"oJAgBaA,EAAA,CAAA,MAAM,8BAA8B,qGAf/CC,EAAAA,mBA2BM,MAAA,CA3BA,MAAKC,EAAAA,eAAA,CAAA,iBAAmBC,EAAA,KAAK,GAAU,cAAc,CAAA,KACzDC,EAAAA,UAAA,EAAA,EAAAH,EAAAA,mBAyBMI,WAAA,KAAAC,EAAAA,WAxBoBH,EAAA,MAAK,CAArBI,EAAMC,mBADhBP,EAAAA,mBAyBM,MAAA,CAvBH,IAAKM,EACL,MAAKL,EAAAA,eAAA,CAAA,CAA6C,gCAAAM,GAASL,EAAA,YAAcK,GAASL,EAAA,eAAsD,6BAAAK,IAAUL,EAAA,WAA2D,sCAAAK,GAASL,EAAA,gBAKjN,oBAAoB,CAAA,IAE1BM,EAAAA,mBAQM,MAAA,CAPJ,MAAM,uCACL,QAAKC,GAAEF,IAAUL,EAAA,YAAcK,GAASL,EAAA,gBAAkBA,EAAA,KAAI,oBAAsBK,CAAK,IAE1FC,EAAAA,mBAGM,MAHNT,EAGM,CAFaQ,EAAQL,EAAA,8BAAzBQ,EAAAA,YAAkGC,EAAA,OAAzD,MAAM,oCAAoC,KAAK,WAClEJ,IAAUL,EAAA,8BAAhCQ,EAAAA,YAAwGC,EAAA,OAAxD,MAAM,qCAAqC,KAAK,6CAGpGH,EAAAA,mBAKO,OAAA,CAJL,MAAM,2BACL,QAAKC,GAAEF,IAAUL,EAAA,YAAcK,GAASL,EAAA,gBAAkBA,EAAA,KAAI,oBAAsBK,CAAK,qBAEvFD,CAAI,EAAA,EAAAM,CAAA"}
1
+ {"version":3,"file":"NeonStepper.vue.cjs.js","sources":["../../../../src/components/navigation/stepper/NeonStepper.vue"],"sourcesContent":["<template>\n <div :class=\"`neon-stepper--${color}`\" class=\"neon-stepper\">\n <div\n v-for=\"(step, index) in steps\"\n :key=\"step\"\n :class=\"{\n 'neon-stepper__step--has-value': index <= modelValue || index <= completedIndex,\n 'neon-stepper__step--active': index === modelValue,\n 'neon-stepper__step--display-stepper': index <= completedIndex,\n }\"\n class=\"neon-stepper__step\"\n >\n <div\n :aria-label=\"step\"\n class=\"neon-stepper__step-indicator-wrapper\"\n role=\"button\"\n tabindex=\"-1\"\n @click=\"index !== modelValue && index <= completedIndex && emit('update:modelValue', index)\"\n >\n <div\n :tabindex=\"index <= completedIndex ? 0 : -1\"\n class=\"neon-stepper__step-indicator\"\n @keydown.enter=\"index !== modelValue && index <= completedIndex && emit('update:modelValue', index)\"\n >\n <neon-icon v-if=\"index < completedIndex\" class=\"neon-stepper__step-completed-icon\" name=\"check\" />\n <neon-icon v-else-if=\"index === completedIndex\" class=\"neon-stepper__step-completing-icon\" name=\"dot\" />\n </div>\n </div>\n <span\n class=\"neon-stepper__step-title\"\n tabindex=\"-1\"\n @click=\"index !== modelValue && index <= completedIndex && emit('update:modelValue', index)\"\n >\n {{ step }}\n </span>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" src=\"./NeonStepper.ts\" />\n"],"names":["_createElementBlock","_normalizeClass","_ctx","_openBlock","_Fragment","_renderList","step","index","_createElementVNode","$event","_withKeys","_createBlock","_component_neon_icon","_hoisted_3"],"mappings":"+RACEA,EAAAA,mBAmCM,MAAA,CAnCA,MAAKC,EAAAA,eAAA,CAAA,iBAAmBC,EAAA,KAAK,GAAU,cAAc,CAAA,KACzDC,EAAAA,UAAA,EAAA,EAAAH,EAAAA,mBAiCMI,WAAA,KAAAC,EAAAA,WAhCoBH,EAAA,MAAK,CAArBI,EAAMC,mBADhBP,EAAAA,mBAiCM,MAAA,CA/BH,IAAKM,EACL,MAAKL,EAAAA,eAAA,CAAA,CAA6C,gCAAAM,GAASL,EAAA,YAAcK,GAASL,EAAA,eAAsD,6BAAAK,IAAUL,EAAA,WAA2D,sCAAAK,GAASL,EAAA,gBAKjN,oBAAoB,CAAA,IAE1BM,EAAAA,mBAeM,MAAA,CAdH,aAAYF,EACb,MAAM,uCACN,KAAK,SACL,SAAS,KACR,QAAKG,GAAEF,IAAUL,EAAA,YAAcK,GAASL,EAAA,gBAAkBA,EAAA,KAAI,oBAAsBK,CAAK,IAE1FC,EAAAA,mBAOM,MAAA,CANH,SAAUD,GAASL,EAAA,eAAc,EAAA,GAClC,MAAM,+BACL,UAAOQ,EAAAA,SAAAD,GAAQF,IAAUL,EAAA,YAAcK,GAASL,EAAA,gBAAkBA,EAAA,KAAI,oBAAsBK,CAAK,EAAA,CAAA,OAAA,CAAA,IAEjFA,EAAQL,EAAA,8BAAzBS,EAAAA,YAAkGC,EAAA,OAAzD,MAAM,oCAAoC,KAAK,WAClEL,IAAUL,EAAA,8BAAhCS,EAAAA,YAAwGC,EAAA,OAAxD,MAAM,qCAAqC,KAAK,kDAGpGJ,EAAAA,mBAMO,OAAA,CALL,MAAM,2BACN,SAAS,KACR,QAAKC,GAAEF,IAAUL,EAAA,YAAcK,GAASL,EAAA,gBAAkBA,EAAA,KAAI,oBAAsBK,CAAK,qBAEvFD,CAAI,EAAA,EAAAO,CAAA"}
@@ -1,45 +1,53 @@
1
- import m from "./NeonStepper.es.js";
2
- import { resolveComponent as d, openBlock as n, createElementBlock as t, normalizeClass as r, Fragment as i, renderList as _, createElementVNode as p, createBlock as a, createCommentVNode as u, toDisplayString as k } from "vue";
3
- import v from "../../../_virtual/_plugin-vue_export-helper.es.js";
4
- const f = ["onClick"], V = { class: "neon-stepper__step-indicator" }, C = ["onClick"];
5
- function $(e, h, I, y, g, B) {
6
- const s = d("neon-icon");
7
- return n(), t("div", {
1
+ import d from "./NeonStepper.es.js";
2
+ import { resolveComponent as c, openBlock as n, createElementBlock as p, normalizeClass as r, Fragment as i, renderList as u, createElementVNode as s, withKeys as _, createBlock as m, createCommentVNode as k, toDisplayString as v } from "vue";
3
+ import V from "../../../_virtual/_plugin-vue_export-helper.es.js";
4
+ const f = ["aria-label", "onClick"], y = ["tabindex", "onKeydown"], I = ["onClick"];
5
+ function $(e, b, h, C, w, g) {
6
+ const l = c("neon-icon");
7
+ return n(), p("div", {
8
8
  class: r([`neon-stepper--${e.color}`, "neon-stepper"])
9
9
  }, [
10
- (n(!0), t(i, null, _(e.steps, (l, o) => (n(), t("div", {
11
- key: l,
10
+ (n(!0), p(i, null, u(e.steps, (t, o) => (n(), p("div", {
11
+ key: t,
12
12
  class: r([{
13
13
  "neon-stepper__step--has-value": o <= e.modelValue || o <= e.completedIndex,
14
14
  "neon-stepper__step--active": o === e.modelValue,
15
15
  "neon-stepper__step--display-stepper": o <= e.completedIndex
16
16
  }, "neon-stepper__step"])
17
17
  }, [
18
- p("div", {
18
+ s("div", {
19
+ "aria-label": t,
19
20
  class: "neon-stepper__step-indicator-wrapper",
20
- onClick: (c) => o !== e.modelValue && o <= e.completedIndex && e.emit("update:modelValue", o)
21
+ role: "button",
22
+ tabindex: "-1",
23
+ onClick: (a) => o !== e.modelValue && o <= e.completedIndex && e.emit("update:modelValue", o)
21
24
  }, [
22
- p("div", V, [
23
- o < e.completedIndex ? (n(), a(s, {
25
+ s("div", {
26
+ tabindex: o <= e.completedIndex ? 0 : -1,
27
+ class: "neon-stepper__step-indicator",
28
+ onKeydown: _((a) => o !== e.modelValue && o <= e.completedIndex && e.emit("update:modelValue", o), ["enter"])
29
+ }, [
30
+ o < e.completedIndex ? (n(), m(l, {
24
31
  key: 0,
25
32
  class: "neon-stepper__step-completed-icon",
26
33
  name: "check"
27
- })) : o === e.completedIndex ? (n(), a(s, {
34
+ })) : o === e.completedIndex ? (n(), m(l, {
28
35
  key: 1,
29
36
  class: "neon-stepper__step-completing-icon",
30
37
  name: "dot"
31
- })) : u("", !0)
32
- ])
38
+ })) : k("", !0)
39
+ ], 40, y)
33
40
  ], 8, f),
34
- p("span", {
41
+ s("span", {
35
42
  class: "neon-stepper__step-title",
36
- onClick: (c) => o !== e.modelValue && o <= e.completedIndex && e.emit("update:modelValue", o)
37
- }, k(l), 9, C)
43
+ tabindex: "-1",
44
+ onClick: (a) => o !== e.modelValue && o <= e.completedIndex && e.emit("update:modelValue", o)
45
+ }, v(t), 9, I)
38
46
  ], 2))), 128))
39
47
  ], 2);
40
48
  }
41
- const w = /* @__PURE__ */ v(m, [["render", $]]);
49
+ const E = /* @__PURE__ */ V(d, [["render", $]]);
42
50
  export {
43
- w as default
51
+ E as default
44
52
  };
45
53
  //# sourceMappingURL=NeonStepper.vue.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NeonStepper.vue.es.js","sources":["../../../../src/components/navigation/stepper/NeonStepper.vue"],"sourcesContent":["<template>\n <div :class=\"`neon-stepper--${color}`\" class=\"neon-stepper\">\n <div\n v-for=\"(step, index) in steps\"\n :key=\"step\"\n :class=\"{\n 'neon-stepper__step--has-value': index <= modelValue || index <= completedIndex,\n 'neon-stepper__step--active': index === modelValue,\n 'neon-stepper__step--display-stepper': index <= completedIndex,\n }\"\n class=\"neon-stepper__step\"\n >\n <div\n class=\"neon-stepper__step-indicator-wrapper\"\n @click=\"index !== modelValue && index <= completedIndex && emit('update:modelValue', index)\"\n >\n <div class=\"neon-stepper__step-indicator\">\n <neon-icon v-if=\"index < completedIndex\" class=\"neon-stepper__step-completed-icon\" name=\"check\" />\n <neon-icon v-else-if=\"index === completedIndex\" class=\"neon-stepper__step-completing-icon\" name=\"dot\" />\n </div>\n </div>\n <span\n class=\"neon-stepper__step-title\"\n @click=\"index !== modelValue && index <= completedIndex && emit('update:modelValue', index)\"\n >\n {{ step }}\n </span>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" src=\"./NeonStepper.ts\" />\n"],"names":["_hoisted_2","_createElementBlock","_normalizeClass","_ctx","_openBlock","_Fragment","_renderList","step","index","_createElementVNode","$event","_createBlock","_component_neon_icon","_hoisted_3"],"mappings":";;;uBAgBaA,IAAA,EAAA,OAAM,+BAA8B;;;cAf/CC,EA2BM,OAAA;AAAA,IA3BA,OAAKC,EAAA,CAAA,iBAAmBC,EAAA,KAAK,IAAU,cAAc,CAAA;AAAA;KACzDC,EAAA,EAAA,GAAAH,EAyBMI,GAAA,MAAAC,EAxBoBH,EAAA,OAAK,CAArBI,GAAMC,YADhBP,EAyBM,OAAA;AAAA,MAvBH,KAAKM;AAAA,MACL,OAAKL,EAAA,CAAA;AAAA,QAA6C,iCAAAM,KAASL,EAAA,cAAcK,KAASL,EAAA;AAAA,QAAsD,8BAAAK,MAAUL,EAAA;AAAA,QAA2D,uCAAAK,KAASL,EAAA;AAAA,SAKjN,oBAAoB,CAAA;AAAA;MAE1BM,EAQM,OAAA;AAAA,QAPJ,OAAM;AAAA,QACL,SAAK,CAAAC,MAAEF,MAAUL,EAAA,cAAcK,KAASL,EAAA,kBAAkBA,EAAA,KAAI,qBAAsBK,CAAK;AAAA;QAE1FC,EAGM,OAHNT,GAGM;AAAA,UAFaQ,IAAQL,EAAA,uBAAzBQ,EAAkGC,GAAA;AAAA;YAAzD,OAAM;AAAA,YAAoC,MAAK;AAAA,gBAClEJ,MAAUL,EAAA,uBAAhCQ,EAAwGC,GAAA;AAAA;YAAxD,OAAM;AAAA,YAAqC,MAAK;AAAA;;;MAGpGH,EAKO,QAAA;AAAA,QAJL,OAAM;AAAA,QACL,SAAK,CAAAC,MAAEF,MAAUL,EAAA,cAAcK,KAASL,EAAA,kBAAkBA,EAAA,KAAI,qBAAsBK,CAAK;AAAA,WAEvFD,CAAI,GAAA,GAAAM,CAAA;AAAA;;;;"}
1
+ {"version":3,"file":"NeonStepper.vue.es.js","sources":["../../../../src/components/navigation/stepper/NeonStepper.vue"],"sourcesContent":["<template>\n <div :class=\"`neon-stepper--${color}`\" class=\"neon-stepper\">\n <div\n v-for=\"(step, index) in steps\"\n :key=\"step\"\n :class=\"{\n 'neon-stepper__step--has-value': index <= modelValue || index <= completedIndex,\n 'neon-stepper__step--active': index === modelValue,\n 'neon-stepper__step--display-stepper': index <= completedIndex,\n }\"\n class=\"neon-stepper__step\"\n >\n <div\n :aria-label=\"step\"\n class=\"neon-stepper__step-indicator-wrapper\"\n role=\"button\"\n tabindex=\"-1\"\n @click=\"index !== modelValue && index <= completedIndex && emit('update:modelValue', index)\"\n >\n <div\n :tabindex=\"index <= completedIndex ? 0 : -1\"\n class=\"neon-stepper__step-indicator\"\n @keydown.enter=\"index !== modelValue && index <= completedIndex && emit('update:modelValue', index)\"\n >\n <neon-icon v-if=\"index < completedIndex\" class=\"neon-stepper__step-completed-icon\" name=\"check\" />\n <neon-icon v-else-if=\"index === completedIndex\" class=\"neon-stepper__step-completing-icon\" name=\"dot\" />\n </div>\n </div>\n <span\n class=\"neon-stepper__step-title\"\n tabindex=\"-1\"\n @click=\"index !== modelValue && index <= completedIndex && emit('update:modelValue', index)\"\n >\n {{ step }}\n </span>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" src=\"./NeonStepper.ts\" />\n"],"names":["_createElementBlock","_normalizeClass","_ctx","_openBlock","_Fragment","_renderList","step","index","_createElementVNode","$event","_withKeys","_createBlock","_component_neon_icon","_hoisted_3"],"mappings":";;;;;;cACEA,EAmCM,OAAA;AAAA,IAnCA,OAAKC,EAAA,CAAA,iBAAmBC,EAAA,KAAK,IAAU,cAAc,CAAA;AAAA;KACzDC,EAAA,EAAA,GAAAH,EAiCMI,GAAA,MAAAC,EAhCoBH,EAAA,OAAK,CAArBI,GAAMC,YADhBP,EAiCM,OAAA;AAAA,MA/BH,KAAKM;AAAA,MACL,OAAKL,EAAA,CAAA;AAAA,QAA6C,iCAAAM,KAASL,EAAA,cAAcK,KAASL,EAAA;AAAA,QAAsD,8BAAAK,MAAUL,EAAA;AAAA,QAA2D,uCAAAK,KAASL,EAAA;AAAA,SAKjN,oBAAoB,CAAA;AAAA;MAE1BM,EAeM,OAAA;AAAA,QAdH,cAAYF;AAAA,QACb,OAAM;AAAA,QACN,MAAK;AAAA,QACL,UAAS;AAAA,QACR,SAAK,CAAAG,MAAEF,MAAUL,EAAA,cAAcK,KAASL,EAAA,kBAAkBA,EAAA,KAAI,qBAAsBK,CAAK;AAAA;QAE1FC,EAOM,OAAA;AAAA,UANH,UAAUD,KAASL,EAAA,iBAAc,IAAA;AAAA,UAClC,OAAM;AAAA,UACL,WAAOQ,EAAA,CAAAD,MAAQF,MAAUL,EAAA,cAAcK,KAASL,EAAA,kBAAkBA,EAAA,KAAI,qBAAsBK,CAAK,GAAA,CAAA,OAAA,CAAA;AAAA;UAEjFA,IAAQL,EAAA,uBAAzBS,EAAkGC,GAAA;AAAA;YAAzD,OAAM;AAAA,YAAoC,MAAK;AAAA,gBAClEL,MAAUL,EAAA,uBAAhCS,EAAwGC,GAAA;AAAA;YAAxD,OAAM;AAAA,YAAqC,MAAK;AAAA;;;MAGpGJ,EAMO,QAAA;AAAA,QALL,OAAM;AAAA,QACN,UAAS;AAAA,QACR,SAAK,CAAAC,MAAEF,MAAUL,EAAA,cAAcK,KAASL,EAAA,kBAAkBA,EAAA,KAAI,qBAAsBK,CAAK;AAAA,WAEvFD,CAAI,GAAA,GAAAO,CAAA;AAAA;;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";const o=require("vue"),b=require("../../navigation/link/NeonLink.vue.cjs.js"),I=require("../../user-input/button/NeonButton.vue.cjs.js"),L=o.defineComponent({name:"NeonImageCarousel",components:{NeonButton:I,NeonLink:b},props:{images:{type:Array,required:!0},imageCountLabel:{type:String,default:void 0},hideLabel:{type:Boolean,default:!1},previousLabel:{type:String,default:"Previous"},nextLabel:{type:String,default:"Next"}},emits:["current-image"],setup(a,{emit:u}){const r=o.ref(!1),n=o.ref(0),t=o.ref(null),l=o.ref([]),i=o.ref([]),c=e=>{e!==n.value&&(n.value=e,u("current-image",e))},s=e=>{t.value&&a.images.length>0&&(c(e),t.value.scrollTo(t.value.clientWidth*e,0))},f=()=>{n.value<a.images.length-1&&s(n.value+1)},m=()=>{n.value!==0&&s(n.value-1)};return o.onMounted(()=>{const e={root:t.value,rootMargin:"0px",threshold:.6};i.value=l.value.map((g,p)=>{const v=new IntersectionObserver(d=>{d.forEach(h=>{r.value&&h.isIntersecting&&c(p)})},e);return v.observe(g),v}),setTimeout(()=>{t.value&&t.value.scrollLeft!==0&&(t.value.scrollLeft=0),r.value=!0},50)}),o.onUnmounted(()=>{i.value.forEach(e=>e.disconnect())}),{emit:u,currentImage:n,carouselItem:l,carouselItems:t,initialised:r,next:f,previous:m,scrollTo:s}}});module.exports=L;
1
+ "use strict";const t=require("vue"),L=require("../../navigation/link/NeonLink.vue.cjs.js"),y=require("../../user-input/button/NeonButton.vue.cjs.js"),I=require("../../layout/stack/NeonStack.vue.cjs.js"),q=t.defineComponent({name:"NeonImageCarousel",components:{NeonButton:y,NeonLink:L,NeonStack:I},props:{images:{type:Array,required:!0},imageCountLabel:{type:String,default:void 0},hideLabel:{type:Boolean,default:!1},closeLabel:{type:String,default:"Close"},previousLabel:{type:String,default:"Previous"},nextLabel:{type:String,default:"Next"}},emits:["current-image"],setup(l,{emit:r}){const s=t.ref(!1),n=t.ref(0),o=t.ref(null),u=t.ref([]),c=t.ref([]),i=t.ref(!1),v=e=>{e!==n.value&&(n.value=e,r("current-image",e))},a=e=>{o.value&&l.images.length>0&&(v(e),o.value.scrollTo(o.value.clientWidth*e,0))},m=()=>{n.value<l.images.length-1&&a(n.value+1)},d=()=>{n.value!==0&&a(n.value-1)};return t.onMounted(()=>{const e={root:o.value,rootMargin:"0px",threshold:.6};c.value=u.value.map((g,p)=>{const f=new IntersectionObserver(b=>{b.forEach(h=>{s.value&&h.isIntersecting&&v(p)})},e);return f.observe(g),f}),setTimeout(()=>{o.value&&o.value.scrollLeft!==0&&(o.value.scrollLeft=0),s.value=!0},50)}),t.onUnmounted(()=>{c.value.forEach(e=>e.disconnect())}),t.watch(()=>i.value,e=>{e?document.body.classList.add("neon-closable--open"):document.body.classList.remove("neon-closable--open")}),{emit:r,currentImage:n,carouselItem:u,carouselItems:o,initialised:s,expanded:i,next:m,previous:d,scrollTo:a}}});module.exports=q;
2
2
  //# sourceMappingURL=NeonImageCarousel.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NeonImageCarousel.cjs.js","sources":["../../../../src/components/presentation/image-carousel/NeonImageCarousel.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent, onMounted, onUnmounted, ref } from 'vue';\nimport type { NeonCarouselImage } from '@/common/models/NeonCarouselImage';\nimport NeonLink from '@/components/navigation/link/NeonLink.vue';\nimport NeonButton from '@/components/user-input/button/NeonButton.vue';\n\n/**\n * <p>\n * The <strong>NeonImageCarousel</strong> is used to display a carousel of images for the user to swipe\n * through. NOTE: It is recommended to explicitly set the width & height of the carousel via CSS, this will\n * ensure it will not be impacted by images with different aspect ratios. Images are automatically resized to fit the\n * carousel dimensions.\n * </p>\n */\nexport default defineComponent({\n name: 'NeonImageCarousel',\n components: {\n NeonButton,\n NeonLink,\n },\n props: {\n /**\n * The images to be displayed in the carousel.\n */\n images: { type: Array as () => Array<NeonCarouselImage>, required: true },\n /**\n * Provide an alternative image count label. This can be useful for translations. The default is e.g.\n * <em>2 images</em>.\n */\n imageCountLabel: { type: String, default: undefined },\n /**\n * Hide the label under the dot navigation.\n */\n hideLabel: { type: Boolean, default: false },\n /**\n * Provide an alternative label for the Previous button.\n */\n previousLabel: { type: String, default: 'Previous' },\n /**\n * Provide an alternative label for the Next button.\n */\n nextLabel: { type: String, default: 'Next' },\n },\n emits: [\n /**\n * The index of the currently visible image.\n *\n * @type {number}\n */\n 'current-image',\n ],\n setup(props, { emit }) {\n const initialised = ref<boolean>(false);\n const currentImage = ref<number>(0);\n const carouselItems = ref<HTMLUListElement | null>(null);\n const carouselItem = ref<Array<HTMLLIElement>>([]);\n const observers = ref<Array<IntersectionObserver>>([]);\n\n const changeImage = (index: number) => {\n if (index !== currentImage.value) {\n currentImage.value = index;\n emit('current-image', index);\n }\n };\n\n const scrollTo = (index: number) => {\n if (carouselItems.value && props.images.length > 0) {\n changeImage(index);\n carouselItems.value.scrollTo(carouselItems.value.clientWidth * index, 0);\n }\n };\n\n const next = () => {\n if (currentImage.value < props.images.length - 1) {\n scrollTo(currentImage.value + 1);\n }\n };\n\n const previous = () => {\n if (currentImage.value !== 0) {\n scrollTo(currentImage.value - 1);\n }\n };\n\n onMounted(() => {\n const options = {\n root: carouselItems.value,\n rootMargin: '0px',\n threshold: 0.6,\n };\n\n observers.value = carouselItem.value.map((el, index) => {\n const obs = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n // filter out the observations on initialization\n if (initialised.value && entry.isIntersecting) {\n changeImage(index);\n }\n });\n }, options);\n obs.observe(el);\n\n return obs;\n });\n\n setTimeout(() => {\n // initialise scroll position to first element\n if (carouselItems.value && carouselItems.value.scrollLeft !== 0) {\n carouselItems.value.scrollLeft = 0;\n }\n initialised.value = true;\n }, 50);\n });\n\n onUnmounted(() => {\n observers.value.forEach((observer) => observer.disconnect());\n });\n\n return {\n emit,\n currentImage,\n carouselItem,\n carouselItems,\n initialised,\n next,\n previous,\n scrollTo,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonButton","NeonLink","props","emit","initialised","ref","currentImage","carouselItems","carouselItem","observers","changeImage","index","scrollTo","next","previous","onMounted","options","el","obs","entries","entry","onUnmounted","observer"],"mappings":"sJAaAA,EAAeC,kBAAgB,CAC7B,KAAM,oBACN,WAAY,CACV,WAAAC,EACA,SAAAC,CAAA,EAEF,MAAO,CAIL,OAAQ,CAAE,KAAM,MAAyC,SAAU,EAAA,EAKnE,gBAAiB,CAAE,KAAM,OAAQ,QAAS,MAAA,EAI1C,UAAW,CAAE,KAAM,QAAS,QAAS,EAAA,EAIrC,cAAe,CAAE,KAAM,OAAQ,QAAS,UAAA,EAIxC,UAAW,CAAE,KAAM,OAAQ,QAAS,MAAA,CAAO,EAE7C,MAAO,CAML,eAAA,EAEF,MAAMC,EAAO,CAAE,KAAAC,GAAQ,CACrB,MAAMC,EAAcC,EAAAA,IAAa,EAAK,EAChCC,EAAeD,EAAAA,IAAY,CAAC,EAC5BE,EAAgBF,EAAAA,IAA6B,IAAI,EACjDG,EAAeH,EAAAA,IAA0B,EAAE,EAC3CI,EAAYJ,EAAAA,IAAiC,EAAE,EAE/CK,EAAeC,GAAkB,CACjCA,IAAUL,EAAa,QACzBA,EAAa,MAAQK,EACrBR,EAAK,gBAAiBQ,CAAK,EAE/B,EAEMC,EAAYD,GAAkB,CAC9BJ,EAAc,OAASL,EAAM,OAAO,OAAS,IAC/CQ,EAAYC,CAAK,EACjBJ,EAAc,MAAM,SAASA,EAAc,MAAM,YAAcI,EAAO,CAAC,EAE3E,EAEME,EAAO,IAAM,CACbP,EAAa,MAAQJ,EAAM,OAAO,OAAS,GAC7CU,EAASN,EAAa,MAAQ,CAAC,CAEnC,EAEMQ,EAAW,IAAM,CACjBR,EAAa,QAAU,GACzBM,EAASN,EAAa,MAAQ,CAAC,CAEnC,EAEAS,OAAAA,EAAAA,UAAU,IAAM,CACd,MAAMC,EAAU,CACd,KAAMT,EAAc,MACpB,WAAY,MACZ,UAAW,EAAA,EAGbE,EAAU,MAAQD,EAAa,MAAM,IAAI,CAACS,EAAIN,IAAU,CACtD,MAAMO,EAAM,IAAI,qBAAsBC,GAAY,CAChDA,EAAQ,QAASC,GAAU,CAErBhB,EAAY,OAASgB,EAAM,gBAC7BV,EAAYC,CAAK,CAErB,CAAC,CACH,EAAGK,CAAO,EACV,OAAAE,EAAI,QAAQD,CAAE,EAEPC,CACT,CAAC,EAED,WAAW,IAAM,CAEXX,EAAc,OAASA,EAAc,MAAM,aAAe,IAC5DA,EAAc,MAAM,WAAa,GAEnCH,EAAY,MAAQ,EACtB,EAAG,EAAE,CACP,CAAC,EAEDiB,EAAAA,YAAY,IAAM,CAChBZ,EAAU,MAAM,QAASa,GAAaA,EAAS,YAAY,CAC7D,CAAC,EAEM,CACL,KAAAnB,EACA,aAAAG,EACA,aAAAE,EACA,cAAAD,EACA,YAAAH,EACA,KAAAS,EACA,SAAAC,EACA,SAAAF,CAAA,CAEJ,CACF,CAAC"}
1
+ {"version":3,"file":"NeonImageCarousel.cjs.js","sources":["../../../../src/components/presentation/image-carousel/NeonImageCarousel.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent, onMounted, onUnmounted, ref, watch } from 'vue';\nimport type { NeonCarouselImage } from '@/common/models/NeonCarouselImage';\nimport NeonLink from '@/components/navigation/link/NeonLink.vue';\nimport NeonButton from '@/components/user-input/button/NeonButton.vue';\nimport NeonStack from '@/components/layout/stack/NeonStack.vue';\n\n/**\n * <p>\n * The <strong>NeonImageCarousel</strong> is used to display a carousel of images for the user to swipe\n * through. NOTE: It is recommended to explicitly set the width & height of the carousel via CSS, this will\n * ensure it will not be impacted by images with different aspect ratios. Images are automatically resized to fit the\n * carousel dimensions.\n * </p>\n */\nexport default defineComponent({\n name: 'NeonImageCarousel',\n components: {\n NeonButton,\n NeonLink,\n NeonStack,\n },\n props: {\n /**\n * The images to be displayed in the carousel.\n */\n images: { type: Array as () => Array<NeonCarouselImage>, required: true },\n /**\n * Provide an alternative image count label. This can be useful for translations. The default is e.g.\n * <em>2 images</em>.\n */\n imageCountLabel: { type: String, default: undefined },\n /**\n * Hide the label under the dot navigation.\n */\n hideLabel: { type: Boolean, default: false },\n /**\n * Provide an alternative label for the Previous button.\n */\n closeLabel: { type: String, default: 'Close' },\n /**\n * Provide an alternative label for the Previous button.\n */\n previousLabel: { type: String, default: 'Previous' },\n /**\n * Provide an alternative label for the Next button.\n */\n nextLabel: { type: String, default: 'Next' },\n },\n emits: [\n /**\n * The index of the currently visible image.\n *\n * @type {number}\n */\n 'current-image',\n ],\n setup(props, { emit }) {\n const initialised = ref<boolean>(false);\n const currentImage = ref<number>(0);\n const carouselItems = ref<HTMLUListElement | null>(null);\n const carouselItem = ref<Array<HTMLLIElement>>([]);\n const observers = ref<Array<IntersectionObserver>>([]);\n const expanded = ref<boolean>(false);\n\n const changeImage = (index: number) => {\n if (index !== currentImage.value) {\n currentImage.value = index;\n emit('current-image', index);\n }\n };\n\n const scrollTo = (index: number) => {\n if (carouselItems.value && props.images.length > 0) {\n changeImage(index);\n carouselItems.value.scrollTo(carouselItems.value.clientWidth * index, 0);\n }\n };\n\n const next = () => {\n if (currentImage.value < props.images.length - 1) {\n scrollTo(currentImage.value + 1);\n }\n };\n\n const previous = () => {\n if (currentImage.value !== 0) {\n scrollTo(currentImage.value - 1);\n }\n };\n\n onMounted(() => {\n const options = {\n root: carouselItems.value,\n rootMargin: '0px',\n threshold: 0.6,\n };\n\n observers.value = carouselItem.value.map((el, index) => {\n const obs = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n // filter out the observations on initialization\n if (initialised.value && entry.isIntersecting) {\n changeImage(index);\n }\n });\n }, options);\n obs.observe(el);\n\n return obs;\n });\n\n setTimeout(() => {\n // initialise scroll position to first element\n if (carouselItems.value && carouselItems.value.scrollLeft !== 0) {\n carouselItems.value.scrollLeft = 0;\n }\n initialised.value = true;\n }, 50);\n });\n\n onUnmounted(() => {\n observers.value.forEach((observer) => observer.disconnect());\n });\n\n watch(\n () => expanded.value,\n (value: boolean) => {\n if (value) {\n document.body.classList.add('neon-closable--open');\n } else {\n document.body.classList.remove('neon-closable--open');\n }\n },\n );\n\n return {\n emit,\n currentImage,\n carouselItem,\n carouselItems,\n initialised,\n expanded,\n next,\n previous,\n scrollTo,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonButton","NeonLink","NeonStack","props","emit","initialised","ref","currentImage","carouselItems","carouselItem","observers","expanded","changeImage","index","scrollTo","next","previous","onMounted","options","el","obs","entries","entry","onUnmounted","observer","watch","value"],"mappings":"2MAcAA,EAAeC,kBAAgB,CAC7B,KAAM,oBACN,WAAY,CACV,WAAAC,EACA,SAAAC,EACA,UAAAC,CAAA,EAEF,MAAO,CAIL,OAAQ,CAAE,KAAM,MAAyC,SAAU,EAAA,EAKnE,gBAAiB,CAAE,KAAM,OAAQ,QAAS,MAAA,EAI1C,UAAW,CAAE,KAAM,QAAS,QAAS,EAAA,EAIrC,WAAY,CAAE,KAAM,OAAQ,QAAS,OAAA,EAIrC,cAAe,CAAE,KAAM,OAAQ,QAAS,UAAA,EAIxC,UAAW,CAAE,KAAM,OAAQ,QAAS,MAAA,CAAO,EAE7C,MAAO,CAML,eAAA,EAEF,MAAMC,EAAO,CAAE,KAAAC,GAAQ,CACrB,MAAMC,EAAcC,EAAAA,IAAa,EAAK,EAChCC,EAAeD,EAAAA,IAAY,CAAC,EAC5BE,EAAgBF,EAAAA,IAA6B,IAAI,EACjDG,EAAeH,EAAAA,IAA0B,EAAE,EAC3CI,EAAYJ,EAAAA,IAAiC,EAAE,EAC/CK,EAAWL,EAAAA,IAAa,EAAK,EAE7BM,EAAe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AF,CAAA,CAEJ,CACF,CAAC"}
@@ -1,11 +1,13 @@
1
- import { defineComponent as b, ref as n, onMounted as I, onUnmounted as L } from "vue";
2
- import y from "../../navigation/link/NeonLink.vue.es.js";
3
- import N from "../../user-input/button/NeonButton.vue.es.js";
4
- const x = b({
1
+ import { defineComponent as L, ref as n, onMounted as y, onUnmounted as I, watch as N } from "vue";
2
+ import S from "../../navigation/link/NeonLink.vue.es.js";
3
+ import C from "../../user-input/button/NeonButton.vue.es.js";
4
+ import x from "../../layout/stack/NeonStack.vue.es.js";
5
+ const E = L({
5
6
  name: "NeonImageCarousel",
6
7
  components: {
7
- NeonButton: N,
8
- NeonLink: y
8
+ NeonButton: C,
9
+ NeonLink: S,
10
+ NeonStack: x
9
11
  },
10
12
  props: {
11
13
  /**
@@ -21,6 +23,10 @@ const x = b({
21
23
  * Hide the label under the dot navigation.
22
24
  */
23
25
  hideLabel: { type: Boolean, default: !1 },
26
+ /**
27
+ * Provide an alternative label for the Previous button.
28
+ */
29
+ closeLabel: { type: String, default: "Close" },
24
30
  /**
25
31
  * Provide an alternative label for the Previous button.
26
32
  */
@@ -38,47 +44,53 @@ const x = b({
38
44
  */
39
45
  "current-image"
40
46
  ],
41
- setup(l, { emit: s }) {
42
- const a = n(!1), o = n(0), t = n(null), u = n([]), i = n([]), c = (e) => {
43
- e !== o.value && (o.value = e, s("current-image", e));
44
- }, r = (e) => {
45
- t.value && l.images.length > 0 && (c(e), t.value.scrollTo(t.value.clientWidth * e, 0));
46
- }, m = () => {
47
- o.value < l.images.length - 1 && r(o.value + 1);
48
- }, f = () => {
49
- o.value !== 0 && r(o.value - 1);
47
+ setup(s, { emit: r }) {
48
+ const a = n(!1), t = n(0), o = n(null), u = n([]), i = n([]), c = n(!1), m = (e) => {
49
+ e !== t.value && (t.value = e, r("current-image", e));
50
+ }, l = (e) => {
51
+ o.value && s.images.length > 0 && (m(e), o.value.scrollTo(o.value.clientWidth * e, 0));
52
+ }, v = () => {
53
+ t.value < s.images.length - 1 && l(t.value + 1);
54
+ }, p = () => {
55
+ t.value !== 0 && l(t.value - 1);
50
56
  };
51
- return I(() => {
57
+ return y(() => {
52
58
  const e = {
53
- root: t.value,
59
+ root: o.value,
54
60
  rootMargin: "0px",
55
61
  threshold: 0.6
56
62
  };
57
- i.value = u.value.map((g, p) => {
58
- const v = new IntersectionObserver((d) => {
59
- d.forEach((h) => {
60
- a.value && h.isIntersecting && c(p);
63
+ i.value = u.value.map((d, g) => {
64
+ const f = new IntersectionObserver((b) => {
65
+ b.forEach((h) => {
66
+ a.value && h.isIntersecting && m(g);
61
67
  });
62
68
  }, e);
63
- return v.observe(g), v;
69
+ return f.observe(d), f;
64
70
  }), setTimeout(() => {
65
- t.value && t.value.scrollLeft !== 0 && (t.value.scrollLeft = 0), a.value = !0;
71
+ o.value && o.value.scrollLeft !== 0 && (o.value.scrollLeft = 0), a.value = !0;
66
72
  }, 50);
67
- }), L(() => {
73
+ }), I(() => {
68
74
  i.value.forEach((e) => e.disconnect());
69
- }), {
70
- emit: s,
71
- currentImage: o,
75
+ }), N(
76
+ () => c.value,
77
+ (e) => {
78
+ e ? document.body.classList.add("neon-closable--open") : document.body.classList.remove("neon-closable--open");
79
+ }
80
+ ), {
81
+ emit: r,
82
+ currentImage: t,
72
83
  carouselItem: u,
73
- carouselItems: t,
84
+ carouselItems: o,
74
85
  initialised: a,
75
- next: m,
76
- previous: f,
77
- scrollTo: r
86
+ expanded: c,
87
+ next: v,
88
+ previous: p,
89
+ scrollTo: l
78
90
  };
79
91
  }
80
92
  });
81
93
  export {
82
- x as default
94
+ E as default
83
95
  };
84
96
  //# sourceMappingURL=NeonImageCarousel.es.js.map