ember-power-calendar 0.22.0-beta.8 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/dist/components/power-calendar/days.js +1 -1
- package/dist/components/power-calendar-multiple/days.js +1 -1
- package/dist/components/power-calendar-range/days.js +1 -1
- package/dist/{days-utils-Dbeo4Hq7.js → days-utils-D13uOiMt.js} +2 -2
- package/dist/days-utils-D13uOiMt.js.map +1 -0
- package/package.json +8 -8
- package/dist/days-utils-Dbeo4Hq7.js.map +0 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ import { action } from '@ember/object';
|
|
|
4
4
|
import { scheduleOnce } from '@ember/runloop';
|
|
5
5
|
import { inject } from '@ember/service';
|
|
6
6
|
import { withLocale, isBefore, add, normalizeDate, isSame, getWeekdaysMin, getWeekdaysShort, getWeekdays } from '../../utils.js';
|
|
7
|
-
import { l as localeStartOfWeekOrFallback, w as weekdaysNames, a as lastDay, f as firstDay, b as buildDay, c as weeks, h as handleDayKeyDown, d as focusDate, e as handleClick } from '../../days-utils-
|
|
7
|
+
import { l as localeStartOfWeekOrFallback, w as weekdaysNames, a as lastDay, f as firstDay, b as buildDay, c as weeks, h as handleDayKeyDown, d as focusDate, e as handleClick } from '../../days-utils-D13uOiMt.js';
|
|
8
8
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
9
9
|
import { g, i, n } from 'decorator-transforms/runtime';
|
|
10
10
|
import { setComponentTemplate } from '@ember/component';
|
|
@@ -4,7 +4,7 @@ import { action } from '@ember/object';
|
|
|
4
4
|
import { scheduleOnce } from '@ember/runloop';
|
|
5
5
|
import { inject } from '@ember/service';
|
|
6
6
|
import { withLocale, isBefore, add, normalizeDate, isSame, getWeekdaysMin, getWeekdaysShort, getWeekdays } from '../../utils.js';
|
|
7
|
-
import { l as localeStartOfWeekOrFallback, w as weekdaysNames, a as lastDay, f as firstDay, b as buildDay, c as weeks, h as handleDayKeyDown, d as focusDate, e as handleClick, g as dayIsDisabled } from '../../days-utils-
|
|
7
|
+
import { l as localeStartOfWeekOrFallback, w as weekdaysNames, a as lastDay, f as firstDay, b as buildDay, c as weeks, h as handleDayKeyDown, d as focusDate, e as handleClick, g as dayIsDisabled } from '../../days-utils-D13uOiMt.js';
|
|
8
8
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
9
9
|
import { g, i, n } from 'decorator-transforms/runtime';
|
|
10
10
|
import { setComponentTemplate } from '@ember/component';
|
|
@@ -4,7 +4,7 @@ import { action } from '@ember/object';
|
|
|
4
4
|
import { scheduleOnce } from '@ember/runloop';
|
|
5
5
|
import { inject } from '@ember/service';
|
|
6
6
|
import { withLocale, isBefore, add, normalizeDate, isBetween, isSame, diff, getWeekdaysMin, getWeekdaysShort, getWeekdays } from '../../utils.js';
|
|
7
|
-
import { l as localeStartOfWeekOrFallback, w as weekdaysNames, a as lastDay, f as firstDay, c as weeks, h as handleDayKeyDown, d as focusDate, e as handleClick, b as buildDay } from '../../days-utils-
|
|
7
|
+
import { l as localeStartOfWeekOrFallback, w as weekdaysNames, a as lastDay, f as firstDay, c as weeks, h as handleDayKeyDown, d as focusDate, e as handleClick, b as buildDay } from '../../days-utils-D13uOiMt.js';
|
|
8
8
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
9
9
|
import { g, i, n } from 'decorator-transforms/runtime';
|
|
10
10
|
import { setComponentTemplate } from '@ember/component';
|
|
@@ -113,7 +113,7 @@ function buildDay(date, today, calendar, focusedId, currentCenter, dayIsSelected
|
|
|
113
113
|
date: new Date(date),
|
|
114
114
|
isDisabled: isDisabled,
|
|
115
115
|
isFocused: focusedId === id,
|
|
116
|
-
isCurrentMonth: date
|
|
116
|
+
isCurrentMonth: isSame(date, currentCenter, 'month'),
|
|
117
117
|
isToday: isSame(date, today, 'day'),
|
|
118
118
|
isSelected: dayIsSelected(date, calendar)
|
|
119
119
|
});
|
|
@@ -160,4 +160,4 @@ function handleClick(e, days, calendar) {
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
export { lastDay as a, buildDay as b, weeks as c, focusDate as d, handleClick as e, firstDay as f, dayIsDisabled as g, handleDayKeyDown as h, localeStartOfWeekOrFallback as l, weekdaysNames as w };
|
|
163
|
-
//# sourceMappingURL=days-utils-
|
|
163
|
+
//# sourceMappingURL=days-utils-D13uOiMt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"days-utils-D13uOiMt.js","sources":["../src/-private/days-utils.ts"],"sourcesContent":["import { assert } from '@ember/debug';\nimport type { CalendarAPI } from '../components/power-calendar.ts';\nimport {\n endOf,\n endOfWeek,\n formatDate,\n isAfter,\n isBefore,\n isSame,\n localeStartOfWeek,\n normalizeCalendarDay,\n startOf,\n startOfWeek,\n type PowerCalendarDay,\n} from '../utils.ts';\n\nexport const WEEK_DAYS = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];\nexport type TWeekdayFormat = 'min' | 'short' | 'long';\n\nexport interface Week {\n id: string;\n days: PowerCalendarDay[];\n missingDays: number;\n}\n\nexport function localeStartOfWeekOrFallback(\n startOfWeek: string | undefined,\n locale: string,\n): number {\n if (startOfWeek) {\n return parseInt(startOfWeek, 10);\n }\n return localeStartOfWeek(locale);\n}\n\nexport function weekdaysNames(\n localeStartOfWeek: number,\n weekdayFormat: TWeekdayFormat,\n weekdays: string[],\n weekdaysMin: string[],\n weekdaysShort: string[],\n): string[] {\n let weekdaysNames;\n if (weekdayFormat === 'long') {\n weekdaysNames = weekdays;\n } else if (weekdayFormat === 'min') {\n weekdaysNames = weekdaysMin;\n } else {\n weekdaysNames = weekdaysShort;\n }\n return weekdaysNames\n .slice(localeStartOfWeek)\n .concat(weekdaysNames.slice(0, localeStartOfWeek));\n}\n\nexport function firstDay(currentCenter: Date, localeStartOfWeek: number): Date {\n const firstDay = startOf(currentCenter, 'month');\n return startOfWeek(firstDay, localeStartOfWeek);\n}\n\nexport function weeks(\n days: PowerCalendarDay[],\n showDaysAround: boolean,\n): Week[] {\n const weeks: Week[] = [];\n let i = 0;\n while (days[i]) {\n let daysOfWeek = days.slice(i, i + 7);\n if (!showDaysAround) {\n daysOfWeek = daysOfWeek.filter((d) => d.isCurrentMonth);\n }\n weeks.push({\n id: `week-of-${daysOfWeek[0]?.id}`,\n days: daysOfWeek,\n missingDays: 7 - daysOfWeek.length,\n });\n i += 7;\n }\n return weeks;\n}\n\nexport function handleDayKeyDown(\n e: KeyboardEvent,\n focusedId: string | null,\n days: PowerCalendarDay[],\n): PowerCalendarDay | undefined {\n if (!focusedId) {\n return;\n }\n let day, index: number | undefined;\n for (let i = 0; i < days.length; i++) {\n if (days[i]?.id === focusedId) {\n index = i;\n break;\n }\n }\n\n if (!index) {\n return;\n }\n\n if (e.key === 'ArrowUp') {\n e.preventDefault();\n const newIndex = Math.max(index - 7, 0);\n day = days[newIndex];\n if (day?.isDisabled) {\n for (let i = newIndex + 1; i <= index; i++) {\n day = days[i];\n if (!day?.isDisabled) {\n break;\n }\n }\n }\n } else if (e.key === 'ArrowDown') {\n e.preventDefault();\n const newIndex = Math.min(index + 7, days.length - 1);\n day = days[newIndex];\n if (day?.isDisabled) {\n for (let i = newIndex - 1; i >= index; i--) {\n day = days[i];\n if (!day?.isDisabled) {\n break;\n }\n }\n }\n } else if (e.key === 'ArrowLeft') {\n day = days[Math.max(index - 1, 0)];\n if (day?.isDisabled) {\n return;\n }\n } else if (e.key === 'ArrowRight') {\n day = days[Math.min(index + 1, days.length - 1)];\n if (day?.isDisabled) {\n return;\n }\n } else {\n return;\n }\n\n return day;\n}\n\nexport function focusDate(uniqueId: string, id: string): void {\n const dayElement: HTMLElement | null = document.querySelector(\n `[data-power-calendar-id=\"${uniqueId}\"] [data-date=\"${id}\"]`,\n );\n if (dayElement) {\n dayElement.focus();\n }\n}\n\nexport function buildDay(\n date: Date,\n today: Date,\n calendar: CalendarAPI,\n focusedId: string | null,\n currentCenter: Date,\n dayIsSelected: (date: Date, calendar: CalendarAPI) => boolean,\n minDate?: Date,\n maxDate?: Date,\n disabledDates?: Array<Date | string>,\n dayIsDisabledExtended?: (\n date: Date,\n calendar: CalendarAPI,\n minDate?: Date,\n maxDate?: Date,\n disabledDates?: Array<Date | string>,\n ) => boolean,\n): PowerCalendarDay {\n const id = formatDate(date, 'YYYY-MM-DD');\n\n let isDisabled = false;\n if (typeof dayIsDisabledExtended === 'function') {\n isDisabled = dayIsDisabledExtended(\n date,\n calendar,\n minDate,\n maxDate,\n disabledDates,\n );\n } else {\n isDisabled = dayIsDisabled(date, calendar, minDate, maxDate, disabledDates);\n }\n\n return normalizeCalendarDay({\n id,\n number: date.getDate(),\n date: new Date(date),\n isDisabled: isDisabled,\n isFocused: focusedId === id,\n isCurrentMonth: isSame(date, currentCenter, 'month'),\n isToday: isSame(date, today, 'day'),\n isSelected: dayIsSelected(date, calendar),\n } as PowerCalendarDay);\n}\n\nexport function dayIsDisabled(\n date: Date,\n calendar: CalendarAPI,\n minDate?: Date,\n maxDate?: Date,\n disabledDates?: Array<Date | string>,\n): boolean {\n const isDisabled = !calendar.actions.select;\n if (isDisabled) {\n return true;\n }\n\n if (minDate && isBefore(date, startOf(minDate, 'day'))) {\n return true;\n }\n\n if (maxDate && isAfter(date, endOf(maxDate, 'day'))) {\n return true;\n }\n\n if (disabledDates) {\n const disabledInRange = disabledDates.some((d) => {\n const isSameDay = isSame(date, d as Date, 'day');\n const isWeekDayIncludes =\n WEEK_DAYS.indexOf(d as string) !== -1 && formatDate(date, 'ddd') === d;\n return isSameDay || isWeekDayIncludes;\n });\n\n if (disabledInRange) {\n return true;\n }\n }\n\n return false;\n}\n\nexport function lastDay(localeStartOfWeek: number, currentCenter: Date): Date {\n assert(\n 'The center of the calendar is an invalid date.',\n !isNaN(currentCenter.getTime()),\n );\n const lastDay = endOf(currentCenter, 'month');\n return endOfWeek(lastDay, localeStartOfWeek);\n}\n\nexport function handleClick(\n e: MouseEvent,\n days: PowerCalendarDay[],\n calendar: CalendarAPI,\n): void {\n const dayEl: HTMLElement | null | undefined = (\n e.target as HTMLElement | null\n )?.closest('[data-date]');\n if (dayEl) {\n const dateStr = dayEl.dataset['date'];\n const day = days.find((d) => d.id === dateStr);\n if (day) {\n if (calendar.actions.select) {\n calendar.actions.select(day, calendar, e);\n }\n }\n }\n}\n"],"names":["WEEK_DAYS","localeStartOfWeekOrFallback","startOfWeek","locale","parseInt","localeStartOfWeek","weekdaysNames","weekdayFormat","weekdays","weekdaysMin","weekdaysShort","slice","concat","firstDay","currentCenter","startOf","weeks","days","showDaysAround","i","daysOfWeek","filter","d","isCurrentMonth","push","id","missingDays","length","handleDayKeyDown","e","focusedId","day","index","key","preventDefault","newIndex","Math","max","isDisabled","min","focusDate","uniqueId","dayElement","document","querySelector","focus","buildDay","date","today","calendar","dayIsSelected","minDate","maxDate","disabledDates","dayIsDisabledExtended","formatDate","dayIsDisabled","normalizeCalendarDay","number","getDate","Date","isFocused","isSame","isToday","isSelected","actions","select","isBefore","isAfter","endOf","disabledInRange","some","isSameDay","isWeekDayIncludes","indexOf","lastDay","assert","isNaN","getTime","endOfWeek","handleClick","dayEl","target","closest","dateStr","dataset","find"],"mappings":";;;AAgBO,MAAMA,SAAS,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;AASnE,SAASC,2BAA2BA,CACzCC,WAA+B,EAC/BC,MAAc,EACN;AACR,EAAA,IAAID,WAAW,EAAE;AACf,IAAA,OAAOE,QAAQ,CAACF,WAAW,EAAE,EAAE,CAAC,CAAA;AAClC,GAAA;EACA,OAAOG,iBAAiB,CAACF,MAAM,CAAC,CAAA;AAClC,CAAA;AAEO,SAASG,aAAaA,CAC3BD,iBAAyB,EACzBE,aAA6B,EAC7BC,QAAkB,EAClBC,WAAqB,EACrBC,aAAuB,EACb;AACV,EAAA,IAAIJ,aAAa,CAAA;EACjB,IAAIC,aAAa,KAAK,MAAM,EAA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a,EAAE,OAAO,CAAC,CAAA;AAC7C,EAAA,OAAOiE,SAAS,CAACJ,OAAO,EAAEtE,iBAAiB,CAAC,CAAA;AAC9C,CAAA;AAEO,SAAS2E,WAAWA,CACzBnD,CAAa,EACbZ,IAAwB,EACxBgC,QAAqB,EACf;EACN,MAAMgC,KAAqC,GACzCpD,CAAC,CAACqD,MAAM,EACPC,OAAO,CAAC,aAAa,CAAC,CAAA;AACzB,EAAA,IAAIF,KAAK,EAAE;AACT,IAAA,MAAMG,OAAO,GAAGH,KAAK,CAACI,OAAO,CAAC,MAAM,CAAC,CAAA;AACrC,IAAA,MAAMtD,GAAG,GAAGd,IAAI,CAACqE,IAAI,CAAEhE,CAAC,IAAKA,CAAC,CAACG,EAAE,KAAK2D,OAAO,CAAC,CAAA;AAC9C,IAAA,IAAIrD,GAAG,EAAE;AACP,MAAA,IAAIkB,QAAQ,CAACgB,OAAO,CAACC,MAAM,EAAE;QAC3BjB,QAAQ,CAACgB,OAAO,CAACC,MAAM,CAACnC,GAAG,EAAEkB,QAAQ,EAAEpB,CAAC,CAAC,CAAA;AAC3C,OAAA;AACF,KAAA;AACF,GAAA;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-power-calendar",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Powerful and customizable calendar component for Ember",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@embroider/addon-shim": "^1.8.7",
|
|
69
69
|
"decorator-transforms": "^1.0.1",
|
|
70
|
-
"@embroider/util": "^1.
|
|
70
|
+
"@embroider/util": "^1.13.0",
|
|
71
71
|
"@ember/render-modifiers": "^2.1.0",
|
|
72
|
-
"@embroider/macros": "^1.
|
|
72
|
+
"@embroider/macros": "^1.15.0",
|
|
73
73
|
"ember-assign-helper": "^0.5.0",
|
|
74
74
|
"ember-element-helper": "^0.8.5",
|
|
75
75
|
"ember-truth-helpers": "^4.0.3"
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"@glimmer/component": "^1.1.2",
|
|
89
89
|
"@glimmer/tracking": "^1.1.2",
|
|
90
90
|
"@rollup/plugin-babel": "^6.0.4",
|
|
91
|
-
"@tsconfig/ember": "^3.0.
|
|
91
|
+
"@tsconfig/ember": "^3.0.5",
|
|
92
92
|
"@types/ember": "^4.0.11",
|
|
93
93
|
"@types/ember__application": "^4.0.11",
|
|
94
94
|
"@types/ember__array": "^4.0.10",
|
|
@@ -113,8 +113,8 @@
|
|
|
113
113
|
"@typescript-eslint/parser": "^7.1.0",
|
|
114
114
|
"babel-plugin-ember-template-compilation": "^2.2.1",
|
|
115
115
|
"concurrently": "^8.2.2",
|
|
116
|
-
"ember-concurrency": "^4.0.
|
|
117
|
-
"ember-source": "~5.
|
|
116
|
+
"ember-concurrency": "^4.0.1",
|
|
117
|
+
"ember-source": "~5.7.0",
|
|
118
118
|
"ember-template-lint": "^5.13.0",
|
|
119
119
|
"eslint": "^8.57.0",
|
|
120
120
|
"eslint-config-prettier": "^9.1.0",
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
"postcss": "^8.4.33",
|
|
126
126
|
"prettier": "^3.2.2",
|
|
127
127
|
"prettier-plugin-ember-template-tag": "^2.0.0",
|
|
128
|
-
"rollup": "^4.12.
|
|
128
|
+
"rollup": "^4.12.1",
|
|
129
129
|
"rollup-plugin-styles": "^4.0.0",
|
|
130
130
|
"rsvp": "^4.8.5",
|
|
131
131
|
"sass": "^1.71.1",
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
"@ember/test-helpers": "^2.9.4 || ^3.2.1",
|
|
161
161
|
"@glimmer/component": "^1.1.2",
|
|
162
162
|
"@glimmer/tracking": "^1.1.2",
|
|
163
|
-
"ember-concurrency": "^4.0.
|
|
163
|
+
"ember-concurrency": "^4.0.1",
|
|
164
164
|
"ember-source": "^3.28.0 || ^4.0.0 || >=5.0.0"
|
|
165
165
|
}
|
|
166
166
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"days-utils-Dbeo4Hq7.js","sources":["../src/-private/days-utils.ts"],"sourcesContent":["import { assert } from '@ember/debug';\nimport type { CalendarAPI } from '../components/power-calendar.ts';\nimport {\n endOf,\n endOfWeek,\n formatDate,\n isAfter,\n isBefore,\n isSame,\n localeStartOfWeek,\n normalizeCalendarDay,\n startOf,\n startOfWeek,\n type PowerCalendarDay,\n} from '../utils.ts';\n\nexport const WEEK_DAYS = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];\nexport type TWeekdayFormat = 'min' | 'short' | 'long';\n\nexport interface Week {\n id: string;\n days: PowerCalendarDay[];\n missingDays: number;\n}\n\nexport function localeStartOfWeekOrFallback(\n startOfWeek: string | undefined,\n locale: string,\n): number {\n if (startOfWeek) {\n return parseInt(startOfWeek, 10);\n }\n return localeStartOfWeek(locale);\n}\n\nexport function weekdaysNames(\n localeStartOfWeek: number,\n weekdayFormat: TWeekdayFormat,\n weekdays: string[],\n weekdaysMin: string[],\n weekdaysShort: string[],\n): string[] {\n let weekdaysNames;\n if (weekdayFormat === 'long') {\n weekdaysNames = weekdays;\n } else if (weekdayFormat === 'min') {\n weekdaysNames = weekdaysMin;\n } else {\n weekdaysNames = weekdaysShort;\n }\n return weekdaysNames\n .slice(localeStartOfWeek)\n .concat(weekdaysNames.slice(0, localeStartOfWeek));\n}\n\nexport function firstDay(currentCenter: Date, localeStartOfWeek: number): Date {\n const firstDay = startOf(currentCenter, 'month');\n return startOfWeek(firstDay, localeStartOfWeek);\n}\n\nexport function weeks(\n days: PowerCalendarDay[],\n showDaysAround: boolean,\n): Week[] {\n const weeks: Week[] = [];\n let i = 0;\n while (days[i]) {\n let daysOfWeek = days.slice(i, i + 7);\n if (!showDaysAround) {\n daysOfWeek = daysOfWeek.filter((d) => d.isCurrentMonth);\n }\n weeks.push({\n id: `week-of-${daysOfWeek[0]?.id}`,\n days: daysOfWeek,\n missingDays: 7 - daysOfWeek.length,\n });\n i += 7;\n }\n return weeks;\n}\n\nexport function handleDayKeyDown(\n e: KeyboardEvent,\n focusedId: string | null,\n days: PowerCalendarDay[],\n): PowerCalendarDay | undefined {\n if (!focusedId) {\n return;\n }\n let day, index: number | undefined;\n for (let i = 0; i < days.length; i++) {\n if (days[i]?.id === focusedId) {\n index = i;\n break;\n }\n }\n\n if (!index) {\n return;\n }\n\n if (e.key === 'ArrowUp') {\n e.preventDefault();\n const newIndex = Math.max(index - 7, 0);\n day = days[newIndex];\n if (day?.isDisabled) {\n for (let i = newIndex + 1; i <= index; i++) {\n day = days[i];\n if (!day?.isDisabled) {\n break;\n }\n }\n }\n } else if (e.key === 'ArrowDown') {\n e.preventDefault();\n const newIndex = Math.min(index + 7, days.length - 1);\n day = days[newIndex];\n if (day?.isDisabled) {\n for (let i = newIndex - 1; i >= index; i--) {\n day = days[i];\n if (!day?.isDisabled) {\n break;\n }\n }\n }\n } else if (e.key === 'ArrowLeft') {\n day = days[Math.max(index - 1, 0)];\n if (day?.isDisabled) {\n return;\n }\n } else if (e.key === 'ArrowRight') {\n day = days[Math.min(index + 1, days.length - 1)];\n if (day?.isDisabled) {\n return;\n }\n } else {\n return;\n }\n\n return day;\n}\n\nexport function focusDate(uniqueId: string, id: string): void {\n const dayElement: HTMLElement | null = document.querySelector(\n `[data-power-calendar-id=\"${uniqueId}\"] [data-date=\"${id}\"]`,\n );\n if (dayElement) {\n dayElement.focus();\n }\n}\n\nexport function buildDay(\n date: Date,\n today: Date,\n calendar: CalendarAPI,\n focusedId: string | null,\n currentCenter: Date,\n dayIsSelected: (date: Date, calendar: CalendarAPI) => boolean,\n minDate?: Date,\n maxDate?: Date,\n disabledDates?: Array<Date | string>,\n dayIsDisabledExtended?: (\n date: Date,\n calendar: CalendarAPI,\n minDate?: Date,\n maxDate?: Date,\n disabledDates?: Array<Date | string>,\n ) => boolean,\n): PowerCalendarDay {\n const id = formatDate(date, 'YYYY-MM-DD');\n\n let isDisabled = false;\n if (typeof dayIsDisabledExtended === 'function') {\n isDisabled = dayIsDisabledExtended(\n date,\n calendar,\n minDate,\n maxDate,\n disabledDates,\n );\n } else {\n isDisabled = dayIsDisabled(date, calendar, minDate, maxDate, disabledDates);\n }\n\n return normalizeCalendarDay({\n id,\n number: date.getDate(),\n date: new Date(date),\n isDisabled: isDisabled,\n isFocused: focusedId === id,\n isCurrentMonth: date.getMonth() === currentCenter.getMonth(),\n isToday: isSame(date, today, 'day'),\n isSelected: dayIsSelected(date, calendar),\n } as PowerCalendarDay);\n}\n\nexport function dayIsDisabled(\n date: Date,\n calendar: CalendarAPI,\n minDate?: Date,\n maxDate?: Date,\n disabledDates?: Array<Date | string>,\n): boolean {\n const isDisabled = !calendar.actions.select;\n if (isDisabled) {\n return true;\n }\n\n if (minDate && isBefore(date, startOf(minDate, 'day'))) {\n return true;\n }\n\n if (maxDate && isAfter(date, endOf(maxDate, 'day'))) {\n return true;\n }\n\n if (disabledDates) {\n const disabledInRange = disabledDates.some((d) => {\n const isSameDay = isSame(date, d as Date, 'day');\n const isWeekDayIncludes =\n WEEK_DAYS.indexOf(d as string) !== -1 && formatDate(date, 'ddd') === d;\n return isSameDay || isWeekDayIncludes;\n });\n\n if (disabledInRange) {\n return true;\n }\n }\n\n return false;\n}\n\nexport function lastDay(localeStartOfWeek: number, currentCenter: Date): Date {\n assert(\n 'The center of the calendar is an invalid date.',\n !isNaN(currentCenter.getTime()),\n );\n const lastDay = endOf(currentCenter, 'month');\n return endOfWeek(lastDay, localeStartOfWeek);\n}\n\nexport function handleClick(\n e: MouseEvent,\n days: PowerCalendarDay[],\n calendar: CalendarAPI,\n): void {\n const dayEl: HTMLElement | null | undefined = (\n e.target as HTMLElement | null\n )?.closest('[data-date]');\n if (dayEl) {\n const dateStr = dayEl.dataset['date'];\n const day = days.find((d) => d.id === dateStr);\n if (day) {\n if (calendar.actions.select) {\n calendar.actions.select(day, calendar, e);\n }\n }\n }\n}\n"],"names":["WEEK_DAYS","localeStartOfWeekOrFallback","startOfWeek","locale","parseInt","localeStartOfWeek","weekdaysNames","weekdayFormat","weekdays","weekdaysMin","weekdaysShort","slice","concat","firstDay","currentCenter","startOf","weeks","days","showDaysAround","i","daysOfWeek","filter","d","isCurrentMonth","push","id","missingDays","length","handleDayKeyDown","e","focusedId","day","index","key","preventDefault","newIndex","Math","max","isDisabled","min","focusDate","uniqueId","dayElement","document","querySelector","focus","buildDay","date","today","calendar","dayIsSelected","minDate","maxDate","disabledDates","dayIsDisabledExtended","formatDate","dayIsDisabled","normalizeCalendarDay","number","getDate","Date","isFocused","getMonth","isToday","isSame","isSelected","actions","select","isBefore","isAfter","endOf","disabledInRange","some","isSameDay","isWeekDayIncludes","indexOf","lastDay","assert","isNaN","getTime","endOfWeek","handleClick","dayEl","target","closest","dateStr","dataset","find"],"mappings":";;;AAgBO,MAAMA,SAAS,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;AASnE,SAASC,2BAA2BA,CACzCC,WAA+B,EAC/BC,MAAc,EACN;AACR,EAAA,IAAID,WAAW,EAAE;AACf,IAAA,OAAOE,QAAQ,CAACF,WAAW,EAAE,EAAE,CAAC,CAAA;AAClC,GAAA;EACA,OAAOG,iBAAiB,CAACF,MAAM,CAAC,CAAA;AAClC,CAAA;AAEO,SAASG,aAAaA,CAC3BD,iBAAyB,EACzBE,aAA6B,EAC7BC,QAAkB,EAClBC,WAAqB,EACrBC,aAAuB,EACb;AACV,EAAA,IAAIJ,aAAa,CAAA;EACjB,IAAIC,aAAa,KAAK,MAAM,EAAE;AAC5BD,IAAAA,aAAa,GAAGE,QAAQ,CAAA;AAC1B,GAAC,MAAM,IAAID,aAAa,KAAK,KAAK,EAAE;AAClCD,IAAAA,aAAa,GAAGG,WAAW,CAAA;A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