@aotearoan/neon 22.2.0 → 22.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/enums/NeonToggleStyle.cjs.js +1 -1
- package/dist/common/enums/NeonToggleStyle.cjs.js.map +1 -1
- package/dist/common/enums/NeonToggleStyle.es.js +2 -2
- package/dist/common/enums/NeonToggleStyle.es.js.map +1 -1
- package/dist/common/utils/NeonDateUtils.cjs.js +1 -1
- package/dist/common/utils/NeonDateUtils.cjs.js.map +1 -1
- package/dist/common/utils/NeonDateUtils.es.js +45 -39
- package/dist/common/utils/NeonDateUtils.es.js.map +1 -1
- package/dist/components/layout/swiper/NeonSwiper.cjs.js +1 -1
- package/dist/components/layout/swiper/NeonSwiper.cjs.js.map +1 -1
- package/dist/components/layout/swiper/NeonSwiper.es.js +27 -14
- package/dist/components/layout/swiper/NeonSwiper.es.js.map +1 -1
- package/dist/components/layout/swiper/NeonSwiper.vue.cjs.js +1 -1
- package/dist/components/layout/swiper/NeonSwiper.vue.cjs.js.map +1 -1
- package/dist/components/layout/swiper/NeonSwiper.vue.es.js +21 -16
- package/dist/components/layout/swiper/NeonSwiper.vue.es.js.map +1 -1
- package/dist/components/navigation/stepper/NeonStepper.vue.cjs.js +1 -1
- package/dist/components/navigation/stepper/NeonStepper.vue.cjs.js.map +1 -1
- package/dist/components/navigation/stepper/NeonStepper.vue.es.js +29 -21
- package/dist/components/navigation/stepper/NeonStepper.vue.es.js.map +1 -1
- package/dist/components/presentation/image-carousel/NeonImageCarousel.cjs.js +1 -1
- package/dist/components/presentation/image-carousel/NeonImageCarousel.cjs.js.map +1 -1
- package/dist/components/presentation/image-carousel/NeonImageCarousel.es.js +44 -32
- package/dist/components/presentation/image-carousel/NeonImageCarousel.es.js.map +1 -1
- package/dist/components/presentation/image-carousel/NeonImageCarousel.vue.cjs.js +1 -1
- package/dist/components/presentation/image-carousel/NeonImageCarousel.vue.cjs.js.map +1 -1
- package/dist/components/presentation/image-carousel/NeonImageCarousel.vue.es.js +116 -86
- package/dist/components/presentation/image-carousel/NeonImageCarousel.vue.es.js.map +1 -1
- package/dist/components/user-input/toggle/NeonToggle.cjs.js +1 -1
- package/dist/components/user-input/toggle/NeonToggle.cjs.js.map +1 -1
- package/dist/components/user-input/toggle/NeonToggle.es.js +19 -18
- package/dist/components/user-input/toggle/NeonToggle.es.js.map +1 -1
- package/dist/components/user-input/toggle/NeonToggle.vue.cjs.js +1 -1
- package/dist/components/user-input/toggle/NeonToggle.vue.cjs.js.map +1 -1
- package/dist/components/user-input/toggle/NeonToggle.vue.es.js +9 -9
- package/dist/components/user-input/toggle/NeonToggle.vue.es.js.map +1 -1
- package/dist/src/common/enums/NeonToggleStyle.d.ts +3 -1
- package/dist/src/common/models/NeonDate.d.ts +2 -0
- package/dist/src/components/layout/swiper/NeonSwiper.d.ts +46 -0
- package/dist/src/components/presentation/image-carousel/NeonImageCarousel.d.ts +35 -22
- package/dist/src/components/user-input/toggle/NeonToggle.d.ts +1 -0
- package/package.json +1 -1
- package/src/sass/components/_badge.scss +2 -0
- package/src/sass/components/_image-carousel.scss +109 -14
- package/src/sass/components/_stepper.scss +8 -3
- package/src/sass/components/_swiper.scss +91 -27
- package/src/sass/components/_toggle.scss +29 -6
- package/src/sass/variables.scss +30 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var
|
|
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,
|
|
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
|
|
1
|
+
var a = /* @__PURE__ */ ((r) => (r.Toggle = "toggle", r.RadioButtons = "radio-buttons", r.Card = "card", r))(a || {});
|
|
2
2
|
export {
|
|
3
|
-
|
|
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,
|
|
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,
|
|
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,S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AKC,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
|
+
{"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,CAA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EC,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
|
|
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,
|
|
12
|
-
const
|
|
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
|
-
|
|
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
|
|
19
|
+
const c = {
|
|
19
20
|
year: +t.toLocaleString("en-US", { year: "numeric" }),
|
|
20
|
-
yearFormatted: t.toLocaleString(
|
|
21
|
+
yearFormatted: t.toLocaleString(a, { year: "numeric" }),
|
|
21
22
|
month: +t.toLocaleString("en-US", { month: "numeric" }),
|
|
22
|
-
monthShortName: t.toLocaleString(
|
|
23
|
-
monthLongName: t.toLocaleString(
|
|
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(
|
|
26
|
+
dayFormatted: t.toLocaleString(a, { day: "2-digit" })
|
|
26
27
|
};
|
|
27
|
-
return s && (
|
|
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
|
|
39
|
-
return o ?
|
|
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,
|
|
51
|
-
return `${
|
|
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
|
|
63
|
-
for (; !r[
|
|
64
|
-
r[
|
|
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
|
|
78
|
-
return Array.from(Array(12).keys()).map((
|
|
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,
|
|
93
|
-
const t = r || navigator.language, s =
|
|
94
|
-
|
|
95
|
-
const
|
|
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
|
|
98
|
-
|
|
99
|
-
for (let
|
|
100
|
-
if (
|
|
101
|
-
|
|
102
|
-
else if (
|
|
103
|
-
for (let y =
|
|
104
|
-
|
|
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:
|
|
119
|
+
selected: c,
|
|
114
120
|
pageMonth: u,
|
|
115
121
|
pageMonthName: L,
|
|
116
|
-
pageYear:
|
|
122
|
+
pageYear: d,
|
|
117
123
|
pageDecadeStart: N,
|
|
118
|
-
dowNames:
|
|
119
|
-
dowLongNames:
|
|
120
|
-
dates:
|
|
124
|
+
dowNames: i.dowNames(t),
|
|
125
|
+
dowLongNames: i.dowNames(t, "long"),
|
|
126
|
+
dates: h,
|
|
121
127
|
lastDayOfMonth: w,
|
|
122
|
-
months:
|
|
123
|
-
monthLongNames:
|
|
128
|
+
months: i.monthNames(t),
|
|
129
|
+
monthLongNames: i.monthNames(t, "long")
|
|
124
130
|
};
|
|
125
131
|
}
|
|
126
132
|
}
|
|
127
133
|
export {
|
|
128
|
-
|
|
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,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;AAAA,MAC5D,gBAAgBA,EAAQ,eAAeF,GAAK,EAAE,OAAO,SAAS;AAAA,MAC9D,eAAeE,EAAQ,eAAeF,GAAK,EAAE,OAAO,QAAQ;AAAA,MAC5D,KAAK,CAACE,EAAQ,eAAe,SAAS,EAAE,KAAK,WAAW;AAAA,MACxD,cAAcA,EAAQ,eAAeF,GAAK,EAAE,KAAK,WAAW;AAAA,IAAA;AAG9D,WAAIG,MACFC,EAAO,OAAOD,IAGTC;AAAA,EACT;AAAA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EJ;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
|
+
{"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,SA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,IAAqC,CAAA;AAE3C,QAAIC,IAAiB,GACjBC,IAAO;AAEX,aAASC,IAAM,GAAGA,IAAM,GAAGA,KAAO;AAChC,MAAAH,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 l=require("vue"),
|
|
1
|
+
"use strict";const l=require("vue"),s=require("../../../common/enums/NeonOrientation.cjs.js"),v=l.defineComponent({name:"NeonSwiper",props:{fade:{type:Boolean,default:!0},orientation:{type:String,default:s.NeonOrientation.Horizontal},hideFadeStart:{type:Boolean,default:!1},hideFadeEnd:{type:Boolean,default:!1}},setup(u){const e=l.ref(null),n=l.ref(!1),a=l.ref(!1),o=l.ref(!1),i=()=>{e.value?u.orientation===s.NeonOrientation.Horizontal?(a.value=e.value.scrollLeft<=0,o.value=e.value.scrollLeft+e.value.clientWidth>e.value.scrollWidth-1):(a.value=e.value.scrollTop<=0,o.value=e.value.scrollTop+e.value.clientHeight>e.value.scrollHeight-1):(a.value=!1,o.value=!1)},r=()=>{e.value?u.orientation===s.NeonOrientation.Horizontal?n.value=e.value.scrollWidth>e.value.clientWidth:n.value=e.value.scrollHeight>e.value.clientHeight:n.value=!1,i()};return l.onMounted(()=>{var t;window.addEventListener("resize",r,{passive:!0}),(t=e.value)==null||t.addEventListener("scroll",i,{passive:!0}),r()}),l.onUnmounted(()=>{var t;window.removeEventListener("resize",r),(t=e.value)==null||t.removeEventListener("scroll",i)}),{isOverflowing:n,isScrollStart:a,isScrollEnd:o,scrollable:e}}});module.exports=v;
|
|
2
2
|
//# sourceMappingURL=NeonSwiper.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonSwiper.cjs.js","sources":["../../../../src/components/layout/swiper/NeonSwiper.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent, onMounted, onUnmounted, ref } from 'vue';\n\n/**\n * Automatically handle horizontally overflowing content by placing it in a NeonSwiper component allowing for smooth\n * horizontal scrolling with all input devices.\n */\nexport default defineComponent({\n name: 'NeonSwiper',\n props: {\n /**\n * Display fade in / fade out styling when there is an overflow.\n */\n fade: { type: Boolean, default: true },\n },\n setup() {\n const scrollable = ref<HTMLElement | null>(null);\n const isOverflowing = ref<boolean>(false);\n const isScrollStart = ref<boolean>(false);\n const isScrollEnd = ref<boolean>(false);\n\n const handleScroll = () => {\n if (scrollable.value) {\n isScrollStart.value = scrollable.value.scrollLeft <= 0;\n
|
|
1
|
+
{"version":3,"file":"NeonSwiper.cjs.js","sources":["../../../../src/components/layout/swiper/NeonSwiper.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent, onMounted, onUnmounted, ref } from 'vue';\nimport { NeonOrientation } from '@/common/enums/NeonOrientation';\n\n/**\n * Automatically handle horizontally overflowing content by placing it in a NeonSwiper component allowing for smooth\n * horizontal scrolling with all input devices.\n */\nexport default defineComponent({\n name: 'NeonSwiper',\n props: {\n /**\n * Display fade in / fade out styling when there is an overflow.\n */\n fade: { type: Boolean, default: true },\n /**\n * Swiper orientation, i.e. whether to manage overflow horizontally or vertically.\n */\n orientation: { type: String as () => NeonOrientation, default: NeonOrientation.Horizontal },\n /**\n * Hide the starting fade (left or top depending on the orientation).\n */\n hideFadeStart: { type: Boolean, default: false },\n /**\n * Hide the ending fade (right or bottom depending on the orientation).\n */\n hideFadeEnd: { type: Boolean, default: false },\n },\n setup(props) {\n const scrollable = ref<HTMLElement | null>(null);\n const isOverflowing = ref<boolean>(false);\n const isScrollStart = ref<boolean>(false);\n const isScrollEnd = ref<boolean>(false);\n\n const handleScroll = () => {\n if (scrollable.value) {\n if (props.orientation === NeonOrientation.Horizontal) {\n isScrollStart.value = scrollable.value.scrollLeft <= 0;\n isScrollEnd.value =\n scrollable.value.scrollLeft + scrollable.value.clientWidth > scrollable.value.scrollWidth - 1;\n } else {\n isScrollStart.value = scrollable.value.scrollTop <= 0;\n isScrollEnd.value =\n scrollable.value.scrollTop + scrollable.value.clientHeight > scrollable.value.scrollHeight - 1;\n }\n } else {\n isScrollStart.value = false;\n isScrollEnd.value = false;\n }\n };\n\n const handleResize = () => {\n if (scrollable.value) {\n if (props.orientation === NeonOrientation.Horizontal) {\n isOverflowing.value = scrollable.value.scrollWidth > scrollable.value.clientWidth;\n } else {\n isOverflowing.value = scrollable.value.scrollHeight > scrollable.value.clientHeight;\n }\n } else {\n isOverflowing.value = false;\n }\n\n handleScroll();\n };\n\n onMounted(() => {\n window.addEventListener('resize', handleResize, { passive: true });\n scrollable.value?.addEventListener('scroll', handleScroll, { passive: true });\n handleResize();\n });\n\n onUnmounted(() => {\n window.removeEventListener('resize', handleResize);\n scrollable.value?.removeEventListener('scroll', handleScroll);\n });\n\n return {\n isOverflowing,\n isScrollStart,\n isScrollEnd,\n scrollable,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonOrientation","props","scrollable","ref","isOverflowing","isScrollStart","isScrollEnd","handleScroll","handleResize","onMounted","_a","onUnmounted"],"mappings":"8FAOAA,EAAeC,kBAAgB,CAC7B,KAAM,aACN,MAAO,CAIL,KAAM,CAAE,KAAM,QAAS,QAAS,EAAA,EAIhC,YAAa,CAAE,KAAM,OAAiC,QAASC,EAAAA,gBAAgB,UAAA,EAI/E,cAAe,CAAE,KAAM,QAAS,QAAS,EAAA,EAIzC,YAAa,CAAE,KAAM,QAAS,QAAS,EAAA,CAAM,EAE/C,MAAMC,EAAO,CACX,MAAMC,EAAaC,EAAAA,IAAwB,IAAI,EACzCC,EAAgBD,EAAAA,IAAa,EAAK,EAClCE,EAAgBF,EAAAA,IAAa,EAAK,EAClCG,EAAcH,EAAAA,IAAa,EAAK,EAEhCI,EAAe,IAAM,CACrBL,EAAW,MACTD,EAAM,cAAgBD,EAAAA,gBAAgB,YACxCK,EAAc,MAAQH,EAAW,MAAM,YAAc,EACrDI,EAAY,MACVJ,EAAW,MAAM,WAAaA,EAAW,MAAM,YAAcA,EAAW,MAAM,YAAc,IAE9FG,EAAc,MAAQH,EAAW,MAAM,WAAa,EACpDI,EAAY,MACVJ,EAAW,MAAM,UAAYA,EAAW,MAAM,aAAeA,EAAW,MAAM,aAAe,IAGjGG,EAAc,MAAQ,GACtBC,EAAY,MAAQ,GAExB,EAEME,EAAe,IAAM,CACrBN,EAAW,MACTD,EAAM,cAAgBD,EAAAA,gBAAgB,WACxCI,EAAc,MAAQF,EAAW,MAAM,YAAcA,EAAW,MAAM,YAEtEE,EAAc,MAAQF,EAAW,MAAM,aAAeA,EAAW,MAAM,aAGzEE,EAAc,MAAQ,GAGxBG,EAAA,CACF,EAEAE,OAAAA,EAAAA,UAAU,IAAM,OACd,OAAO,iBAAiB,SAAUD,EAAc,CAAE,QAAS,GAAM,GACjEE,EAAAR,EAAW,QAAX,MAAAQ,EAAkB,iBAAiB,SAAUH,EAAc,CAAE,QAAS,KACtEC,EAAA,CACF,CAAC,EAEDG,EAAAA,YAAY,IAAM,OAChB,OAAO,oBAAoB,SAAUH,CAAY,GACjDE,EAAAR,EAAW,QAAX,MAAAQ,EAAkB,oBAAoB,SAAUH,EAClD,CAAC,EAEM,CACL,cAAAH,EACA,cAAAC,EACA,YAAAC,EACA,WAAAJ,CAAA,CAEJ,CACF,CAAC"}
|
|
@@ -1,33 +1,46 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
1
|
+
import { defineComponent as v, ref as n, onMounted as d, onUnmounted as c } from "vue";
|
|
2
|
+
import { NeonOrientation as r } from "../../../common/enums/NeonOrientation.es.js";
|
|
3
|
+
const h = v({
|
|
3
4
|
name: "NeonSwiper",
|
|
4
5
|
props: {
|
|
5
6
|
/**
|
|
6
7
|
* Display fade in / fade out styling when there is an overflow.
|
|
7
8
|
*/
|
|
8
|
-
fade: { type: Boolean, default: !0 }
|
|
9
|
+
fade: { type: Boolean, default: !0 },
|
|
10
|
+
/**
|
|
11
|
+
* Swiper orientation, i.e. whether to manage overflow horizontally or vertically.
|
|
12
|
+
*/
|
|
13
|
+
orientation: { type: String, default: r.Horizontal },
|
|
14
|
+
/**
|
|
15
|
+
* Hide the starting fade (left or top depending on the orientation).
|
|
16
|
+
*/
|
|
17
|
+
hideFadeStart: { type: Boolean, default: !1 },
|
|
18
|
+
/**
|
|
19
|
+
* Hide the ending fade (right or bottom depending on the orientation).
|
|
20
|
+
*/
|
|
21
|
+
hideFadeEnd: { type: Boolean, default: !1 }
|
|
9
22
|
},
|
|
10
|
-
setup() {
|
|
11
|
-
const e =
|
|
12
|
-
e.value ? (a.value = e.value.scrollLeft <= 0,
|
|
13
|
-
},
|
|
14
|
-
e.value ? t.value = e.value.scrollWidth > e.value.clientWidth : t.value = !1,
|
|
23
|
+
setup(u) {
|
|
24
|
+
const e = n(null), t = n(!1), a = n(!1), o = n(!1), i = () => {
|
|
25
|
+
e.value ? u.orientation === r.Horizontal ? (a.value = e.value.scrollLeft <= 0, o.value = e.value.scrollLeft + e.value.clientWidth > e.value.scrollWidth - 1) : (a.value = e.value.scrollTop <= 0, o.value = e.value.scrollTop + e.value.clientHeight > e.value.scrollHeight - 1) : (a.value = !1, o.value = !1);
|
|
26
|
+
}, s = () => {
|
|
27
|
+
e.value ? u.orientation === r.Horizontal ? t.value = e.value.scrollWidth > e.value.clientWidth : t.value = e.value.scrollHeight > e.value.clientHeight : t.value = !1, i();
|
|
15
28
|
};
|
|
16
|
-
return
|
|
29
|
+
return d(() => {
|
|
17
30
|
var l;
|
|
18
|
-
window.addEventListener("resize",
|
|
19
|
-
}),
|
|
31
|
+
window.addEventListener("resize", s, { passive: !0 }), (l = e.value) == null || l.addEventListener("scroll", i, { passive: !0 }), s();
|
|
32
|
+
}), c(() => {
|
|
20
33
|
var l;
|
|
21
|
-
window.removeEventListener("resize",
|
|
34
|
+
window.removeEventListener("resize", s), (l = e.value) == null || l.removeEventListener("scroll", i);
|
|
22
35
|
}), {
|
|
23
36
|
isOverflowing: t,
|
|
24
37
|
isScrollStart: a,
|
|
25
|
-
isScrollEnd:
|
|
38
|
+
isScrollEnd: o,
|
|
26
39
|
scrollable: e
|
|
27
40
|
};
|
|
28
41
|
}
|
|
29
42
|
});
|
|
30
43
|
export {
|
|
31
|
-
|
|
44
|
+
h as default
|
|
32
45
|
};
|
|
33
46
|
//# sourceMappingURL=NeonSwiper.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonSwiper.es.js","sources":["../../../../src/components/layout/swiper/NeonSwiper.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent, onMounted, onUnmounted, ref } from 'vue';\n\n/**\n * Automatically handle horizontally overflowing content by placing it in a NeonSwiper component allowing for smooth\n * horizontal scrolling with all input devices.\n */\nexport default defineComponent({\n name: 'NeonSwiper',\n props: {\n /**\n * Display fade in / fade out styling when there is an overflow.\n */\n fade: { type: Boolean, default: true },\n },\n setup() {\n const scrollable = ref<HTMLElement | null>(null);\n const isOverflowing = ref<boolean>(false);\n const isScrollStart = ref<boolean>(false);\n const isScrollEnd = ref<boolean>(false);\n\n const handleScroll = () => {\n if (scrollable.value) {\n isScrollStart.value = scrollable.value.scrollLeft <= 0;\n
|
|
1
|
+
{"version":3,"file":"NeonSwiper.es.js","sources":["../../../../src/components/layout/swiper/NeonSwiper.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent, onMounted, onUnmounted, ref } from 'vue';\nimport { NeonOrientation } from '@/common/enums/NeonOrientation';\n\n/**\n * Automatically handle horizontally overflowing content by placing it in a NeonSwiper component allowing for smooth\n * horizontal scrolling with all input devices.\n */\nexport default defineComponent({\n name: 'NeonSwiper',\n props: {\n /**\n * Display fade in / fade out styling when there is an overflow.\n */\n fade: { type: Boolean, default: true },\n /**\n * Swiper orientation, i.e. whether to manage overflow horizontally or vertically.\n */\n orientation: { type: String as () => NeonOrientation, default: NeonOrientation.Horizontal },\n /**\n * Hide the starting fade (left or top depending on the orientation).\n */\n hideFadeStart: { type: Boolean, default: false },\n /**\n * Hide the ending fade (right or bottom depending on the orientation).\n */\n hideFadeEnd: { type: Boolean, default: false },\n },\n setup(props) {\n const scrollable = ref<HTMLElement | null>(null);\n const isOverflowing = ref<boolean>(false);\n const isScrollStart = ref<boolean>(false);\n const isScrollEnd = ref<boolean>(false);\n\n const handleScroll = () => {\n if (scrollable.value) {\n if (props.orientation === NeonOrientation.Horizontal) {\n isScrollStart.value = scrollable.value.scrollLeft <= 0;\n isScrollEnd.value =\n scrollable.value.scrollLeft + scrollable.value.clientWidth > scrollable.value.scrollWidth - 1;\n } else {\n isScrollStart.value = scrollable.value.scrollTop <= 0;\n isScrollEnd.value =\n scrollable.value.scrollTop + scrollable.value.clientHeight > scrollable.value.scrollHeight - 1;\n }\n } else {\n isScrollStart.value = false;\n isScrollEnd.value = false;\n }\n };\n\n const handleResize = () => {\n if (scrollable.value) {\n if (props.orientation === NeonOrientation.Horizontal) {\n isOverflowing.value = scrollable.value.scrollWidth > scrollable.value.clientWidth;\n } else {\n isOverflowing.value = scrollable.value.scrollHeight > scrollable.value.clientHeight;\n }\n } else {\n isOverflowing.value = false;\n }\n\n handleScroll();\n };\n\n onMounted(() => {\n window.addEventListener('resize', handleResize, { passive: true });\n scrollable.value?.addEventListener('scroll', handleScroll, { passive: true });\n handleResize();\n });\n\n onUnmounted(() => {\n window.removeEventListener('resize', handleResize);\n scrollable.value?.removeEventListener('scroll', handleScroll);\n });\n\n return {\n isOverflowing,\n isScrollStart,\n isScrollEnd,\n scrollable,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonOrientation","props","scrollable","ref","isOverflowing","isScrollStart","isScrollEnd","handleScroll","handleResize","onMounted","_a","onUnmounted"],"mappings":";;AAOA,MAAAA,IAAeC,EAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,MAAM,EAAE,MAAM,SAAS,SAAS,GAAA;AAAA;AAAA;AAAA;AAAA,IAIhC,aAAa,EAAE,MAAM,QAAiC,SAASC,EAAgB,WAAA;AAAA;AAAA;AAAA;AAAA,IAI/E,eAAe,EAAE,MAAM,SAAS,SAAS,GAAA;AAAA;AAAA;AAAA;AAAA,IAIzC,aAAa,EAAE,MAAM,SAAS,SAAS,GAAA;AAAA,EAAM;AAAA,EAE/C,MAAMC,GAAO;AACX,UAAMC,IAAaC,EAAwB,IAAI,GACzCC,IAAgBD,EAAa,EAAK,GAClCE,IAAgBF,EAAa,EAAK,GAClCG,IAAcH,EAAa,EAAK,GAEhCI,IAAe,MAAM;AACzB,MAAIL,EAAW,QACTD,EAAM,gBAAgBD,EAAgB,cACxCK,EAAc,QAAQH,EAAW,MAAM,cAAc,GACrDI,EAAY,QACVJ,EAAW,MAAM,aAAaA,EAAW,MAAM,cAAcA,EAAW,MAAM,cAAc,MAE9FG,EAAc,QAAQH,EAAW,MAAM,aAAa,GACpDI,EAAY,QACVJ,EAAW,MAAM,YAAYA,EAAW,MAAM,eAAeA,EAAW,MAAM,eAAe,MAGjGG,EAAc,QAAQ,IACtBC,EAAY,QAAQ;AAAA,IAExB,GAEME,IAAe,MAAM;AACzB,MAAIN,EAAW,QACTD,EAAM,gBAAgBD,EAAgB,aACxCI,EAAc,QAAQF,EAAW,MAAM,cAAcA,EAAW,MAAM,cAEtEE,EAAc,QAAQF,EAAW,MAAM,eAAeA,EAAW,MAAM,eAGzEE,EAAc,QAAQ,IAGxBG,EAAA;AAAA,IACF;AAEA,WAAAE,EAAU,MAAM;;AACd,aAAO,iBAAiB,UAAUD,GAAc,EAAE,SAAS,IAAM,IACjEE,IAAAR,EAAW,UAAX,QAAAQ,EAAkB,iBAAiB,UAAUH,GAAc,EAAE,SAAS,OACtEC,EAAA;AAAA,IACF,CAAC,GAEDG,EAAY,MAAM;;AAChB,aAAO,oBAAoB,UAAUH,CAAY,IACjDE,IAAAR,EAAW,UAAX,QAAAQ,EAAkB,oBAAoB,UAAUH;AAAA,IAClD,CAAC,GAEM;AAAA,MACL,eAAAH;AAAA,MACA,eAAAC;AAAA,MACA,aAAAC;AAAA,MACA,YAAAJ;AAAA,IAAA;AAAA,EAEJ;AACF,CAAC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const o=require("./NeonSwiper.cjs.js"),n=require("vue"),s=require("../../../_virtual/_plugin-vue_export-helper.cjs.js"),i={ref:"scrollable",class:"neon-swiper__container"};function t(e,r,d,a,p,u){return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass([[`neon-swiper--${e.orientation}`,{"neon-swiper--fade":e.fade,"neon-swiper--overflowing":e.isOverflowing,"neon-swiper--start":e.isScrollStart,"neon-swiper--end":e.isScrollEnd,"neon-swiper--hide-fade-start":e.hideFadeStart,"neon-swiper--hide-fade-end":e.hideFadeEnd}],"neon-swiper"])},[n.createElementVNode("div",i,[n.renderSlot(e.$slots,"default")],512),r[0]||(r[0]=n.createElementVNode("div",{class:"neon-swiper__fade-out"},null,-1))],2)}const l=s(o,[["render",t]]);module.exports=l;
|
|
2
2
|
//# sourceMappingURL=NeonSwiper.vue.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonSwiper.vue.cjs.js","sources":["../../../../src/components/layout/swiper/NeonSwiper.vue"],"sourcesContent":["<template>\n <div\n :class=\"{\n
|
|
1
|
+
{"version":3,"file":"NeonSwiper.vue.cjs.js","sources":["../../../../src/components/layout/swiper/NeonSwiper.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n `neon-swiper--${orientation}`,\n {\n 'neon-swiper--fade': fade,\n 'neon-swiper--overflowing': isOverflowing,\n 'neon-swiper--start': isScrollStart,\n 'neon-swiper--end': isScrollEnd,\n 'neon-swiper--hide-fade-start': hideFadeStart,\n 'neon-swiper--hide-fade-end': hideFadeEnd,\n },\n ]\"\n class=\"neon-swiper\"\n >\n <div ref=\"scrollable\" class=\"neon-swiper__container\">\n <!-- @slot contents of swiper with which to apply overflow scrolling. -->\n <slot></slot>\n </div>\n <div class=\"neon-swiper__fade-out\"></div>\n </div>\n</template>\n\n<script lang=\"ts\" src=\"./NeonSwiper.ts\"></script>\n"],"names":["_createElementBlock","_normalizeClass","_ctx","_createElementVNode","_hoisted_1","_renderSlot"],"mappings":"wIAeS,IAAI,aAAa,MAAM,uEAd9BA,EAAAA,mBAmBM,MAAA,CAlBH,MAAKC,EAAAA,eAAA,CAAA,iBAA0BC,EAAA,WAAW,wBAAyCA,EAAA,gCAA0CA,EAAA,mCAA6CA,EAAA,iCAA2CA,EAAA,2CAAqDA,EAAA,2CAAqDA,EAAA,cAW1T,aAAa,CAAA,IAEnBC,EAAAA,mBAGM,MAHNC,EAGM,CADJC,aAAaH,EAAA,OAAA,SAAA,oBAEfC,EAAAA,mBAAyC,MAAA,CAApC,MAAM,yBAAuB,KAAA,EAAA"}
|
|
@@ -1,27 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { openBlock as s, createElementBlock as i, normalizeClass as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import r from "./NeonSwiper.es.js";
|
|
2
|
+
import { openBlock as s, createElementBlock as i, normalizeClass as a, createElementVNode as o, renderSlot as d } from "vue";
|
|
3
|
+
import t from "../../../_virtual/_plugin-vue_export-helper.es.js";
|
|
4
|
+
const l = {
|
|
5
5
|
ref: "scrollable",
|
|
6
6
|
class: "neon-swiper__container"
|
|
7
7
|
};
|
|
8
|
-
function
|
|
8
|
+
function p(e, n, f, w, m, c) {
|
|
9
9
|
return s(), i("div", {
|
|
10
|
-
class:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
class: a([[
|
|
11
|
+
`neon-swiper--${e.orientation}`,
|
|
12
|
+
{
|
|
13
|
+
"neon-swiper--fade": e.fade,
|
|
14
|
+
"neon-swiper--overflowing": e.isOverflowing,
|
|
15
|
+
"neon-swiper--start": e.isScrollStart,
|
|
16
|
+
"neon-swiper--end": e.isScrollEnd,
|
|
17
|
+
"neon-swiper--hide-fade-start": e.hideFadeStart,
|
|
18
|
+
"neon-swiper--hide-fade-end": e.hideFadeEnd
|
|
19
|
+
}
|
|
20
|
+
], "neon-swiper"])
|
|
16
21
|
}, [
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
o("div", l, [
|
|
23
|
+
d(e.$slots, "default")
|
|
19
24
|
], 512),
|
|
20
|
-
|
|
25
|
+
n[0] || (n[0] = o("div", { class: "neon-swiper__fade-out" }, null, -1))
|
|
21
26
|
], 2);
|
|
22
27
|
}
|
|
23
|
-
const
|
|
28
|
+
const v = /* @__PURE__ */ t(r, [["render", p]]);
|
|
24
29
|
export {
|
|
25
|
-
|
|
30
|
+
v as default
|
|
26
31
|
};
|
|
27
32
|
//# sourceMappingURL=NeonSwiper.vue.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonSwiper.vue.es.js","sources":["../../../../src/components/layout/swiper/NeonSwiper.vue"],"sourcesContent":["<template>\n <div\n :class=\"{\n
|
|
1
|
+
{"version":3,"file":"NeonSwiper.vue.es.js","sources":["../../../../src/components/layout/swiper/NeonSwiper.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n `neon-swiper--${orientation}`,\n {\n 'neon-swiper--fade': fade,\n 'neon-swiper--overflowing': isOverflowing,\n 'neon-swiper--start': isScrollStart,\n 'neon-swiper--end': isScrollEnd,\n 'neon-swiper--hide-fade-start': hideFadeStart,\n 'neon-swiper--hide-fade-end': hideFadeEnd,\n },\n ]\"\n class=\"neon-swiper\"\n >\n <div ref=\"scrollable\" class=\"neon-swiper__container\">\n <!-- @slot contents of swiper with which to apply overflow scrolling. -->\n <slot></slot>\n </div>\n <div class=\"neon-swiper__fade-out\"></div>\n </div>\n</template>\n\n<script lang=\"ts\" src=\"./NeonSwiper.ts\"></script>\n"],"names":["_createElementBlock","_normalizeClass","_ctx","_createElementVNode","_hoisted_1","_renderSlot"],"mappings":";;;;EAeS,KAAI;AAAA,EAAa,OAAM;;;cAd9BA,EAmBM,OAAA;AAAA,IAlBH,OAAKC,EAAA,CAAA;AAAA,sBAA0BC,EAAA,WAAW;AAAA;6BAAyCA,EAAA;AAAA,oCAA0CA,EAAA;AAAA,8BAA6CA,EAAA;AAAA,4BAA2CA,EAAA;AAAA,wCAAqDA,EAAA;AAAA,sCAAqDA,EAAA;AAAA;OAW1T,aAAa,CAAA;AAAA;IAEnBC,EAGM,OAHNC,GAGM;AAAA,MADJC,EAAaH,EAAA,QAAA,SAAA;AAAA;oBAEfC,EAAyC,OAAA,EAApC,OAAM,2BAAuB,MAAA,EAAA;AAAA;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const
|
|
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":["
|
|
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"}
|