calcite-date-picker_4.cjs.entry.js 62 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888
  1. /*!
  2. * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  3. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
  4. * v1.0.0-beta.82
  5. */
  6. 'use strict';
  7. Object.defineProperty(exports, '__esModule', { value: true });
  8. const index = require('./index-5c65e149.js');
  9. const resources = require('./resources-247d05d5.js');
  10. const dom = require('./dom-9ac0341c.js');
  11. const interactive = require('./interactive-e294111f.js');
  12. const Heading = require('./Heading-0cb5902d.js');
  13. require('./locale-f2ebe4fa.js');
  14. require('./number-364babbc.js');
  15. require('./guid-8b6d6cb4.js');
  16. const datePickerCss = "@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{position:relative;display:inline-block;width:100%;overflow:visible;border-radius:0px;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-2);background-color:var(--calcite-ui-foreground-1);vertical-align:top}:host([scale=s]){max-width:216px}:host([scale=m]){max-width:286px}:host([scale=l]){max-width:398px}";
  17. const DatePicker = class {
  18. constructor(hostRef) {
  19. index.registerInstance(this, hostRef);
  20. this.calciteDatePickerChange = index.createEvent(this, "calciteDatePickerChange", 7);
  21. this.calciteDatePickerRangeChange = index.createEvent(this, "calciteDatePickerRangeChange", 7);
  22. /** Localized string for "previous month" (used for aria label)
  23. * @default "Previous month"
  24. */
  25. this.intlPrevMonth = resources.TEXT.prevMonth;
  26. /** Localized string for "next month" (used for aria label)
  27. * @default "Next month"
  28. */
  29. this.intlNextMonth = resources.TEXT.nextMonth;
  30. /** Localized string for "year" (used for aria label)
  31. * @default "Year"
  32. */
  33. this.intlYear = resources.TEXT.year;
  34. /** BCP 47 language tag for desired language and country format */
  35. this.locale = document.documentElement.lang || "en";
  36. /** specify the scale of the date picker */
  37. this.scale = "m";
  38. /** Range mode activation */
  39. this.range = false;
  40. /** Disables the default behaviour on the third click of narrowing or extending the range and instead starts a new range. */
  41. this.proximitySelectionDisabled = false;
  42. //--------------------------------------------------------------------------
  43. //
  44. // Private Methods
  45. //
  46. //--------------------------------------------------------------------------
  47. this.keyUpHandler = (e) => {
  48. if (e.key === "Escape") {
  49. this.reset();
  50. }
  51. };
  52. this.monthHeaderSelectChange = (e) => {
  53. const date = new Date(e.detail);
  54. if (!this.range) {
  55. this.activeDate = date;
  56. }
  57. else {
  58. if (this.activeRange === "end") {
  59. this.activeEndDate = date;
  60. }
  61. else {
  62. this.activeStartDate = date;
  63. }
  64. this.mostRecentRangeValue = date;
  65. }
  66. };
  67. this.monthActiveDateChange = (e) => {
  68. const date = new Date(e.detail);
  69. if (!this.range) {
  70. this.activeDate = date;
  71. }
  72. else {
  73. if (this.activeRange === "end") {
  74. this.activeEndDate = date;
  75. }
  76. else {
  77. this.activeStartDate = date;
  78. }
  79. this.mostRecentRangeValue = date;
  80. }
  81. };
  82. this.monthHoverChange = (e) => {
  83. if (!this.startAsDate) {
  84. this.hoverRange = undefined;
  85. return;
  86. }
  87. const date = new Date(e.detail);
  88. this.hoverRange = {
  89. focused: this.activeRange || "start",
  90. start: this.startAsDate,
  91. end: this.endAsDate
  92. };
  93. if (!this.proximitySelectionDisabled) {
  94. if (this.endAsDate) {
  95. const startDiff = resources.getDaysDiff(date, this.startAsDate);
  96. const endDiff = resources.getDaysDiff(date, this.endAsDate);
  97. if (endDiff > 0) {
  98. this.hoverRange.end = date;
  99. this.hoverRange.focused = "end";
  100. }
  101. else if (startDiff < 0) {
  102. this.hoverRange.start = date;
  103. this.hoverRange.focused = "start";
  104. }
  105. else if (startDiff > endDiff) {
  106. this.hoverRange.start = date;
  107. this.hoverRange.focused = "start";
  108. }
  109. else {
  110. this.hoverRange.end = date;
  111. this.hoverRange.focused = "end";
  112. }
  113. }
  114. else {
  115. if (date < this.startAsDate) {
  116. this.hoverRange = {
  117. focused: "start",
  118. start: date,
  119. end: this.startAsDate
  120. };
  121. }
  122. else {
  123. this.hoverRange.end = date;
  124. this.hoverRange.focused = "end";
  125. }
  126. }
  127. }
  128. else {
  129. if (!this.endAsDate) {
  130. if (date < this.startAsDate) {
  131. this.hoverRange = {
  132. focused: "start",
  133. start: date,
  134. end: this.startAsDate
  135. };
  136. }
  137. else {
  138. this.hoverRange.end = date;
  139. this.hoverRange.focused = "end";
  140. }
  141. }
  142. else {
  143. this.hoverRange = undefined;
  144. }
  145. }
  146. };
  147. this.monthMouseOutChange = () => {
  148. if (this.hoverRange) {
  149. this.hoverRange = undefined;
  150. }
  151. };
  152. /**
  153. * Reset active date and close
  154. */
  155. this.reset = () => {
  156. var _a, _b, _c, _d, _e, _f;
  157. if (!Array.isArray(this.valueAsDate) &&
  158. this.valueAsDate &&
  159. ((_a = this.valueAsDate) === null || _a === void 0 ? void 0 : _a.getTime()) !== ((_b = this.activeDate) === null || _b === void 0 ? void 0 : _b.getTime())) {
  160. this.activeDate = new Date(this.valueAsDate);
  161. }
  162. if (this.startAsDate && ((_c = this.startAsDate) === null || _c === void 0 ? void 0 : _c.getTime()) !== ((_d = this.activeStartDate) === null || _d === void 0 ? void 0 : _d.getTime())) {
  163. this.activeStartDate = new Date(this.startAsDate);
  164. }
  165. if (this.endAsDate && ((_e = this.endAsDate) === null || _e === void 0 ? void 0 : _e.getTime()) !== ((_f = this.activeEndDate) === null || _f === void 0 ? void 0 : _f.getTime())) {
  166. this.activeEndDate = new Date(this.endAsDate);
  167. }
  168. };
  169. /**
  170. * Event handler for when the selected date changes
  171. */
  172. this.monthDateChange = (e) => {
  173. const date = new Date(e.detail);
  174. if (!this.range) {
  175. this.value = date ? resources.dateToISO(date) : "";
  176. this.valueAsDate = date || null;
  177. this.activeDate = date || null;
  178. this.calciteDatePickerChange.emit(date);
  179. return;
  180. }
  181. if (!this.startAsDate || (!this.endAsDate && date < this.startAsDate)) {
  182. if (this.startAsDate) {
  183. this.setEndDate(new Date(this.startAsDate));
  184. }
  185. if (this.activeRange == "end") {
  186. this.setEndDate(date);
  187. }
  188. else {
  189. this.setStartDate(date);
  190. }
  191. }
  192. else if (!this.endAsDate) {
  193. this.setEndDate(date);
  194. }
  195. else {
  196. if (!this.proximitySelectionDisabled) {
  197. if (this.activeRange) {
  198. if (this.activeRange == "end") {
  199. this.setEndDate(date);
  200. }
  201. else {
  202. this.setStartDate(date);
  203. }
  204. }
  205. else {
  206. const startDiff = resources.getDaysDiff(date, this.startAsDate);
  207. const endDiff = resources.getDaysDiff(date, this.endAsDate);
  208. if (endDiff === 0 || startDiff < 0) {
  209. this.setStartDate(date);
  210. }
  211. else if (startDiff === 0 || endDiff < 0) {
  212. this.setEndDate(date);
  213. }
  214. else if (startDiff < endDiff) {
  215. this.setStartDate(date);
  216. }
  217. else {
  218. this.setEndDate(date);
  219. }
  220. }
  221. }
  222. else {
  223. this.setStartDate(date);
  224. this.endAsDate = this.activeEndDate = this.end = undefined;
  225. }
  226. }
  227. this.calciteDatePickerChange.emit(date);
  228. };
  229. }
  230. handleValueAsDate(date) {
  231. if (!Array.isArray(date) && date && date !== this.activeDate) {
  232. this.activeDate = date;
  233. }
  234. }
  235. handleRangeChange() {
  236. const { startAsDate: startDate, endAsDate: endDate } = this;
  237. this.activeEndDate = endDate;
  238. this.activeStartDate = startDate;
  239. }
  240. onMinChanged(min) {
  241. if (min) {
  242. this.minAsDate = resources.dateFromISO(min);
  243. }
  244. }
  245. onMaxChanged(max) {
  246. if (max) {
  247. this.maxAsDate = resources.dateFromISO(max);
  248. }
  249. }
  250. // --------------------------------------------------------------------------
  251. //
  252. // Lifecycle
  253. //
  254. // --------------------------------------------------------------------------
  255. connectedCallback() {
  256. if (Array.isArray(this.value)) {
  257. this.valueAsDate = this.value.map((v) => resources.dateFromISO(v));
  258. this.start = this.value[0];
  259. this.end = this.value[1];
  260. }
  261. else if (this.value) {
  262. this.valueAsDate = resources.dateFromISO(this.value);
  263. }
  264. if (this.start) {
  265. this.setStartAsDate(resources.dateFromISO(this.start));
  266. }
  267. if (this.end) {
  268. this.setEndAsDate(resources.dateFromISO(this.end));
  269. }
  270. if (this.min) {
  271. this.minAsDate = resources.dateFromISO(this.min);
  272. }
  273. if (this.max) {
  274. this.maxAsDate = resources.dateFromISO(this.max);
  275. }
  276. }
  277. async componentWillLoad() {
  278. await this.loadLocaleData();
  279. this.onMinChanged(this.min);
  280. this.onMaxChanged(this.max);
  281. }
  282. render() {
  283. var _a;
  284. const date = resources.dateFromRange(this.range ? this.startAsDate : this.valueAsDate, this.minAsDate, this.maxAsDate);
  285. const activeStartDate = this.range
  286. ? this.getActiveStartDate(date, this.minAsDate, this.maxAsDate)
  287. : this.getActiveDate(date, this.minAsDate, this.maxAsDate);
  288. let activeDate = activeStartDate;
  289. const endDate = this.range
  290. ? resources.dateFromRange(this.endAsDate, this.minAsDate, this.maxAsDate)
  291. : null;
  292. const activeEndDate = this.getActiveEndDate(endDate, this.minAsDate, this.maxAsDate);
  293. if ((this.activeRange === "end" ||
  294. (((_a = this.hoverRange) === null || _a === void 0 ? void 0 : _a.focused) === "end" && (!this.proximitySelectionDisabled || endDate))) &&
  295. activeEndDate) {
  296. activeDate = activeEndDate;
  297. }
  298. if (this.range && this.mostRecentRangeValue) {
  299. activeDate = this.mostRecentRangeValue;
  300. }
  301. const minDate = this.range && this.activeRange
  302. ? this.activeRange === "start"
  303. ? this.minAsDate
  304. : date || this.minAsDate
  305. : this.minAsDate;
  306. const maxDate = this.range && this.activeRange
  307. ? this.activeRange === "start"
  308. ? endDate || this.maxAsDate
  309. : this.maxAsDate
  310. : this.maxAsDate;
  311. return (index.h(index.Host, { onBlur: this.reset, onKeyUp: this.keyUpHandler, role: "application" }, this.renderCalendar(activeDate, maxDate, minDate, date, endDate)));
  312. }
  313. valueHandler(value) {
  314. if (Array.isArray(value)) {
  315. this.valueAsDate = value.map((v) => resources.dateFromISO(v));
  316. this.start = value[0];
  317. this.end = value[1];
  318. }
  319. else if (value) {
  320. this.valueAsDate = resources.dateFromISO(value);
  321. this.start = "";
  322. this.end = "";
  323. }
  324. }
  325. startWatcher(start) {
  326. this.setStartAsDate(resources.dateFromISO(start));
  327. }
  328. endWatcher(end) {
  329. this.setEndAsDate(resources.dateFromISO(end));
  330. }
  331. async loadLocaleData() {
  332. const { locale } = this;
  333. this.localeData = await resources.getLocaleData(locale);
  334. }
  335. /**
  336. * Render calcite-date-picker-month-header and calcite-date-picker-month
  337. */
  338. renderCalendar(activeDate, maxDate, minDate, date, endDate) {
  339. return (this.localeData && [
  340. index.h("calcite-date-picker-month-header", { activeDate: activeDate, headingLevel: this.headingLevel || resources.HEADING_LEVEL, intlNextMonth: this.intlNextMonth, intlPrevMonth: this.intlPrevMonth, intlYear: this.intlYear, localeData: this.localeData, max: maxDate, min: minDate, onCalciteDatePickerSelect: this.monthHeaderSelectChange, scale: this.scale, selectedDate: this.activeRange === "end" ? endDate : date || new Date() }),
  341. index.h("calcite-date-picker-month", { activeDate: activeDate, endDate: this.range ? endDate : undefined, hoverRange: this.hoverRange, localeData: this.localeData, max: maxDate, min: minDate, onCalciteDatePickerActiveDateChange: this.monthActiveDateChange, onCalciteDatePickerHover: this.monthHoverChange, onCalciteDatePickerMouseOut: this.monthMouseOutChange, onCalciteDatePickerSelect: this.monthDateChange, scale: this.scale, selectedDate: this.activeRange === "end" ? endDate : date, startDate: this.range ? date : undefined })
  342. ]);
  343. }
  344. /**
  345. * Update date instance of start if valid
  346. */
  347. setStartAsDate(startDate, emit) {
  348. this.startAsDate = startDate;
  349. this.mostRecentRangeValue = this.startAsDate;
  350. if (emit) {
  351. this.calciteDatePickerRangeChange.emit({
  352. startDate,
  353. endDate: this.endAsDate
  354. });
  355. }
  356. }
  357. /**
  358. * Update date instance of end if valid
  359. */
  360. setEndAsDate(endDate, emit) {
  361. this.endAsDate = endDate;
  362. this.mostRecentRangeValue = this.endAsDate;
  363. if (emit) {
  364. this.calciteDatePickerRangeChange.emit({
  365. startDate: this.startAsDate,
  366. endDate
  367. });
  368. }
  369. }
  370. setEndDate(date) {
  371. this.end = date ? resources.dateToISO(date) : "";
  372. this.setEndAsDate(date, true);
  373. this.activeEndDate = date || null;
  374. }
  375. setStartDate(date) {
  376. this.start = date ? resources.dateToISO(date) : "";
  377. this.setStartAsDate(date, true);
  378. this.activeStartDate = date || null;
  379. }
  380. /**
  381. * Get an active date using the value, or current date as default
  382. */
  383. getActiveDate(value, min, max) {
  384. return resources.dateFromRange(this.activeDate, min, max) || value || resources.dateFromRange(new Date(), min, max);
  385. }
  386. getActiveStartDate(value, min, max) {
  387. return (resources.dateFromRange(this.activeStartDate, min, max) || value || resources.dateFromRange(new Date(), min, max));
  388. }
  389. getActiveEndDate(value, min, max) {
  390. return (resources.dateFromRange(this.activeEndDate, min, max) || value || resources.dateFromRange(new Date(), min, max));
  391. }
  392. static get assetsDirs() { return ["assets"]; }
  393. get el() { return index.getElement(this); }
  394. static get watchers() { return {
  395. "valueAsDate": ["handleValueAsDate"],
  396. "startAsDate": ["handleRangeChange"],
  397. "endAsDate": ["handleRangeChange"],
  398. "min": ["onMinChanged"],
  399. "max": ["onMaxChanged"],
  400. "value": ["valueHandler"],
  401. "start": ["startWatcher"],
  402. "end": ["endWatcher"],
  403. "locale": ["loadLocaleData"]
  404. }; }
  405. };
  406. DatePicker.style = datePickerCss;
  407. const datePickerDayCss = "@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:-ms-flexbox;display:flex;min-width:0px;cursor:pointer;-ms-flex-pack:center;justify-content:center;color:var(--calcite-ui-text-3);width:14.2857142857%}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.day-v-wrapper{-ms-flex:1 1 auto;flex:1 1 auto}.day-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.day{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:9999px;font-size:var(--calcite-font-size--2);line-height:1rem;line-height:1;color:var(--calcite-ui-text-3);opacity:var(--calcite-ui-opacity-disabled);-webkit-transition-property:all;transition-property:all;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:150ms;transition-duration:150ms;background:none;-webkit-box-shadow:0 0 0 2px transparent, 0 0 0 0px transparent;box-shadow:0 0 0 2px transparent, 0 0 0 0px transparent}.text{margin-top:1px;margin-right:0px;margin-bottom:0px;margin-left:1px}:host([scale=s]) .day-v-wrapper{padding-top:0.125rem;padding-bottom:0.125rem}:host([scale=s]) .day-wrapper{padding:0px}:host([scale=s]) .day{height:27px;width:27px;font-size:var(--calcite-font-size--2)}:host([scale=m]) .day-v-wrapper{padding-top:0.25rem;padding-bottom:0.25rem}:host([scale=m]) .day-wrapper{padding-left:0.25rem;padding-right:0.25rem}:host([scale=m]) .day{height:33px;width:33px;font-size:var(--calcite-font-size--1)}:host([scale=l]) .day-v-wrapper{padding-top:0.25rem;padding-bottom:0.25rem}:host([scale=l]) .day-wrapper{padding-left:0.25rem;padding-right:0.25rem}:host([scale=l]) .day{height:43px;width:43px;font-size:var(--calcite-font-size-0)}:host([current-month]) .day{opacity:1}:host(:hover:not([disabled])) .day,:host([active]:not([range])) .day{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}:host(:focus),:host([active]){outline:2px solid transparent;outline-offset:2px;z-index:1}:host(:focus:not([disabled])) .day{-webkit-box-shadow:0 0 0 2px var(--calcite-ui-foreground-1), 0 0 0 4px var(--calcite-ui-brand);box-shadow:0 0 0 2px var(--calcite-ui-foreground-1), 0 0 0 4px var(--calcite-ui-brand)}:host([selected]) .day{font-weight:var(--calcite-font-weight-medium);background-color:var(--calcite-ui-brand) !important;color:var(--calcite-ui-foreground-1) !important;z-index:1}:host([range][selected]) .day-wrapper{background-color:var(--calcite-ui-foreground-current)}:host([start-of-range]) .day-wrapper{border-start-start-radius:40%;border-end-start-radius:40%}:host([end-of-range]) .day-wrapper{border-start-end-radius:40%;border-end-end-radius:40%}:host([start-of-range]) :not(.calcite--rtl) .day-wrapper,:host([end-of-range]) .calcite--rtl .day-wrapper{-webkit-box-shadow:inset 4px 0 var(--calcite-ui-foreground-1);box-shadow:inset 4px 0 var(--calcite-ui-foreground-1)}:host([start-of-range]) :not(.calcite--rtl) .day,:host([end-of-range]) .calcite--rtl .day{opacity:1}:host([start-of-range]:not(:focus)) :not(.calcite--rtl) .day,:host([end-of-range]:not(:focus)) .calcite--rtl .day{-webkit-box-shadow:0 0 0 2px var(--calcite-ui-foreground-1);box-shadow:0 0 0 2px var(--calcite-ui-foreground-1)}:host([end-of-range]) :not(.calcite--rtl) .day-wrapper,:host([start-of-range]) .calcite--rtl .day-wrapper{-webkit-box-shadow:inset -4px 0 var(--calcite-ui-foreground-1);box-shadow:inset -4px 0 var(--calcite-ui-foreground-1)}:host([end-of-range]) :not(.calcite--rtl) .day,:host([start-of-range]) .calcite--rtl .day{opacity:1}:host([end-of-range]:not(:focus)) :not(.calcite--rtl) .day,:host([start-of-range]:not(:focus)) .calcite--rtl .day{-webkit-box-shadow:0 0 0 2px var(--calcite-ui-foreground-1);box-shadow:0 0 0 2px var(--calcite-ui-foreground-1)}:host([end-of-range][scale=l]) :not(.calcite--rtl) .day-wrapper,:host([start-of-range][scale=l]) .calcite--rtl .day-wrapper{-webkit-box-shadow:inset -8px 0 var(--calcite-ui-foreground-1);box-shadow:inset -8px 0 var(--calcite-ui-foreground-1)}:host([start-of-range][scale=l]) :not(.calcite--rtl) .day-wrapper,:host([end-of-range][scale=l]) .calcite--rtl .day-wrapper{-webkit-box-shadow:inset 8px 0 var(--calcite-ui-foreground-1);box-shadow:inset 8px 0 var(--calcite-ui-foreground-1)}:host([highlighted]) .day-wrapper{background-color:var(--calcite-ui-foreground-current)}:host([highlighted]) .day-wrapper .day{color:var(--calcite-ui-text-1)}:host([highlighted]:not([active]:focus)) .day{border-radius:0px;color:var(--calcite-ui-text-1)}:host([range-hover]:not([selected])) .day-wrapper{background-color:var(--calcite-ui-foreground-2)}:host([range-hover]:not([selected])) .day{border-radius:0px}:host([end-of-range][range-hover]) :not(.calcite--rtl) .day-wrapper,:host([start-of-range][range-hover]) .calcite--rtl .day-wrapper{background-image:-webkit-gradient(linear, left top, right top, from(var(--calcite-ui-foreground-current)), color-stop(var(--calcite-ui-foreground-current)), color-stop(var(--calcite-ui-foreground-2)), to(var(--calcite-ui-foreground-2)));background-image:linear-gradient(to right, var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-2));border-radius:0px;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host([start-of-range][range-hover]) :not(.calcite--rtl) .day-wrapper,:host([end-of-range][range-hover]) .calcite--rtl .day-wrapper{background-image:-webkit-gradient(linear, right top, left top, from(var(--calcite-ui-foreground-current)), color-stop(var(--calcite-ui-foreground-current)), color-stop(var(--calcite-ui-foreground-2)), to(var(--calcite-ui-foreground-2)));background-image:linear-gradient(to left, var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-2));border-radius:0px;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host(:hover[end-of-range][range-hover]) :not(.calcite--rtl) .day-wrapper,:host(:hover[start-of-range][range-hover]) .calcite--rtl .day-wrapper{background-image:-webkit-gradient(linear, left top, right top, from(var(--calcite-ui-foreground-current)), color-stop(var(--calcite-ui-foreground-current)), color-stop(var(--calcite-ui-foreground-1)), to(var(--calcite-ui-foreground-1)));background-image:linear-gradient(to right, var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-1), var(--calcite-ui-foreground-1));border-radius:0px;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host(:hover[start-of-range][range-hover]) :not(.calcite--rtl) .day-wrapper,:host(:hover[end-of-range][range-hover]) .calcite--rtl .day-wrapper{background-image:-webkit-gradient(linear, right top, left top, from(var(--calcite-ui-foreground-current)), color-stop(var(--calcite-ui-foreground-current)), color-stop(var(--calcite-ui-foreground-1)), to(var(--calcite-ui-foreground-1)));background-image:linear-gradient(to left, var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-1), var(--calcite-ui-foreground-1));border-radius:0px;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host(:hover[range-hover]:not([selected]).focused--end) :not(.calcite--rtl) .day-wrapper,:host(:hover[range-hover]:not([selected]).focused--start) .calcite--rtl .day-wrapper{background-image:-webkit-gradient(linear, left top, right top, from(var(--calcite-ui-foreground-2)), color-stop(var(--calcite-ui-foreground-2)), color-stop(var(--calcite-ui-foreground-current)), to(var(--calcite-ui-foreground-current)));background-image:linear-gradient(to right, var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-current))}:host(:hover[range-hover]:not([selected]).focused--end) :not(.calcite--rtl) .day,:host(:hover[range-hover]:not([selected]).focused--start) .calcite--rtl .day{border-radius:9999px;opacity:1;-webkit-box-shadow:0 0 0 2px var(--calcite-ui-foreground-1);box-shadow:0 0 0 2px var(--calcite-ui-foreground-1)}:host(:hover[range-hover]:not([selected]).focused--start) :not(.calcite--rtl) .day-wrapper,:host(:hover[range-hover]:not([selected]).focused--end) .calcite--rtl .day-wrapper{background-image:-webkit-gradient(linear, left top, right top, from(var(--calcite-ui-foreground-current)), color-stop(var(--calcite-ui-foreground-current)), color-stop(var(--calcite-ui-foreground-2)), to(var(--calcite-ui-foreground-2)));background-image:linear-gradient(to right, var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-current), var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-2))}:host(:hover[range-hover]:not([selected]).focused--start) :not(.calcite--rtl) .day,:host(:hover[range-hover]:not([selected]).focused--end) .calcite--rtl .day{border-radius:9999px;opacity:1;-webkit-box-shadow:0 0 0 2px var(--calcite-ui-foreground-1);box-shadow:0 0 0 2px var(--calcite-ui-foreground-1)}:host(:hover[range-hover]:not([selected]).focused--start.hover--outside-range) :not(.calcite--rtl) .day-wrapper,:host(:hover[range-hover]:not([selected]).focused--end.hover--outside-range) .calcite--rtl .day-wrapper{background-image:-webkit-gradient(linear, left top, right top, from(var(--calcite-ui-foreground-1)), color-stop(var(--calcite-ui-foreground-1)), color-stop(var(--calcite-ui-foreground-2)), to(var(--calcite-ui-foreground-2)));background-image:linear-gradient(to right, var(--calcite-ui-foreground-1), var(--calcite-ui-foreground-1), var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-2))}:host(:hover[range-hover]:not([selected]).focused--start.hover--outside-range) :not(.calcite--rtl) .day,:host(:hover[range-hover]:not([selected]).focused--end.hover--outside-range) .calcite--rtl .day{border-radius:9999px;opacity:1;-webkit-box-shadow:0 0 0 2px var(--calcite-ui-foreground-1);box-shadow:0 0 0 2px var(--calcite-ui-foreground-1)}:host(:hover[range-hover]:not([selected]).focused--end.hover--outside-range) :not(.calcite--rtl) .day-wrapper,:host(:hover[range-hover]:not([selected]).focused--start.hover--outside-range) .calcite--rtl .day-wrapper{background-image:-webkit-gradient(linear, left top, right top, from(var(--calcite-ui-foreground-2)), color-stop(var(--calcite-ui-foreground-2)), color-stop(var(--calcite-ui-foreground-1)), to(var(--calcite-ui-foreground-1)));background-image:linear-gradient(to right, var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-2), var(--calcite-ui-foreground-1), var(--calcite-ui-foreground-1))}:host(:hover[range-hover]:not([selected]).focused--end.hover--outside-range) :not(.calcite--rtl) .day,:host(:hover[range-hover]:not([selected]).focused--start.hover--outside-range) .calcite--rtl .day{border-radius:9999px;opacity:1;-webkit-box-shadow:0 0 0 2px var(--calcite-ui-foreground-1);box-shadow:0 0 0 2px var(--calcite-ui-foreground-1)}:host(:hover[start-of-range].hover--inside-range.focused--end) .day-wrapper,:host(:hover[end-of-range].hover--inside-range.focused--start) .day-wrapper{background-image:none}:host([start-of-range].hover--inside-range.focused--end) .day-wrapper,:host([end-of-range].hover--inside-range.focused--start) .day-wrapper{background-color:var(--calcite-ui-foreground-2)}:host([highlighted]:last-child) :not(.calcite--rtl) .day-wrapper,:host([range-hover]:last-child) :not(.calcite--rtl) .day-wrapper,:host([highlighted]:first-child) .calcite--rtl .day-wrapper,:host([range-hover]:first-child) .calcite--rtl .day-wrapper{-webkit-box-shadow:inset -4px 0px 0px 0px var(--calcite-ui-foreground-1);box-shadow:inset -4px 0px 0px 0px var(--calcite-ui-foreground-1)}:host([highlighted]:first-child) :not(.calcite--rtl) .day-wrapper,:host([range-hover]:first-child) :not(.calcite--rtl) .day-wrapper,:host([highlighted]:last-child) .calcite--rtl .day-wrapper,:host([range-hover]:last-child) .calcite--rtl .day-wrapper{-webkit-box-shadow:inset 4px 0px 0px 0px var(--calcite-ui-foreground-1);box-shadow:inset 4px 0px 0px 0px var(--calcite-ui-foreground-1)}:host([scale=s][highlighted]:last-child) :not(.calcite--rtl) .day-wrapper,:host([scale=s][range-hover]:last-child) :not(.calcite--rtl) .day-wrapper,:host([scale=s][highlighted]:first-child) .calcite--rtl .day-wrapper,:host([scale=s][range-hover]:first-child) .calcite--rtl .day-wrapper{-webkit-box-shadow:inset -1px 0px 0px 0px var(--calcite-ui-foreground-1);box-shadow:inset -1px 0px 0px 0px var(--calcite-ui-foreground-1)}:host([scale=s][highlighted]:first-child) :not(.calcite--rtl) .day-wrapper,:host([scale=s][range-hover]:first-child) :not(.calcite--rtl) .day-wrapper,:host([scale=s][highlighted]:last-child) .calcite--rtl .day-wrapper,:host([scale=s][range-hover]:last-child) .calcite--rtl .day-wrapper{-webkit-box-shadow:inset 1px 0px 0px 0px var(--calcite-ui-foreground-1);box-shadow:inset 1px 0px 0px 0px var(--calcite-ui-foreground-1)}:host([scale=l][highlighted]:first-child) :not(.calcite--rtl) .day-wrapper,:host([scale=l][range-hover]:first-child) :not(.calcite--rtl) .day-wrapper,:host([scale=l][highlighted]:last-child) .calcite--rtl .day-wrapper,:host([scale=l][range-hover]:last-child) .calcite--rtl .day-wrapper{-webkit-box-shadow:inset 6px 0px 0px 0px var(--calcite-ui-foreground-1);box-shadow:inset 6px 0px 0px 0px var(--calcite-ui-foreground-1)}:host([highlighted]:first-child) .day-wrapper,:host([range-hover]:first-child) .day-wrapper{border-start-start-radius:45%;border-end-start-radius:45%}:host([highlighted]:last-child) .day-wrapper,:host([range-hover]:last-child) .day-wrapper{border-start-end-radius:45%;border-end-end-radius:45%}:host([scale=l][highlighted]:last-child) :not(.calcite--rtl) .day-wrapper,:host([scale=l][range-hover]:last-child) :not(.calcite--rtl) .day-wrapper,:host([scale=l][highlighted]:first-child) .calcite--rtl .day-wrapper,:host([scale=l][range-hover]:first-child) .calcite--rtl .day-wrapper{-webkit-box-shadow:inset -6px 0px 0px 0px var(--calcite-ui-foreground-1);box-shadow:inset -6px 0px 0px 0px var(--calcite-ui-foreground-1)}@media (forced-colors: active){:host(:hover:not([disabled])) .day,:host([active]:not([range])) .day{border-radius:0px}:host([selected]){outline:2px solid canvasText;z-index:1}:host([selected]) .day{border-radius:0px;background-color:highlight}:host([range][selected]) .day-wrapper,:host([highlighted]) .day-wrapper,:host([range-hover]:not([selected])) .day-wrapper{background-color:highlight}:host([range][selected][start-of-range]) .day-wrapper,:host([range][selected][end-of-range]) .day-wrapper{background-color:canvas}}";
  408. const DatePickerDay = class {
  409. constructor(hostRef) {
  410. index.registerInstance(this, hostRef);
  411. this.calciteDaySelect = index.createEvent(this, "calciteDaySelect", 7);
  412. this.calciteDayHover = index.createEvent(this, "calciteDayHover", 7);
  413. /** Date is outside of range and can't be selected */
  414. this.disabled = false;
  415. /** Date is in the current month. */
  416. this.currentMonth = false;
  417. /** Date is the current selected date of the picker */
  418. this.selected = false;
  419. /** Date is currently highlighted as part of the range */
  420. this.highlighted = false;
  421. /** Showing date range */
  422. this.range = false;
  423. /** Date is the start of date range */
  424. this.startOfRange = false;
  425. /** Date is the end of date range */
  426. this.endOfRange = false;
  427. /** Date is being hovered and within the set range */
  428. this.rangeHover = false;
  429. /** Date is actively in focus for keyboard navigation */
  430. this.active = false;
  431. //--------------------------------------------------------------------------
  432. //
  433. // Event Listeners
  434. //
  435. //--------------------------------------------------------------------------
  436. this.onClick = () => {
  437. !this.disabled && this.calciteDaySelect.emit();
  438. };
  439. this.keyDownHandler = (e) => {
  440. const key = e.key;
  441. if (key === " " || key === "Enter") {
  442. !this.disabled && this.calciteDaySelect.emit();
  443. }
  444. };
  445. }
  446. mouseoverHandler() {
  447. this.calciteDayHover.emit({
  448. disabled: this.disabled
  449. });
  450. }
  451. //--------------------------------------------------------------------------
  452. //
  453. // Lifecycle
  454. //
  455. //--------------------------------------------------------------------------
  456. render() {
  457. const formattedDay = String(this.day)
  458. .split("")
  459. .map((i) => this.localeData.numerals[i])
  460. .join("");
  461. const dir = dom.getElementDir(this.el);
  462. return (index.h(index.Host, { onClick: this.onClick, onKeyDown: this.keyDownHandler, role: "gridcell" }, index.h("div", { class: { "day-v-wrapper": true, [dom.CSS_UTILITY.rtl]: dir === "rtl" } }, index.h("div", { class: "day-wrapper" }, index.h("span", { class: "day" }, index.h("span", { class: "text" }, formattedDay))))));
  463. }
  464. componentDidRender() {
  465. interactive.updateHostInteraction(this, this.isTabbable);
  466. }
  467. isTabbable() {
  468. return this.active;
  469. }
  470. get el() { return index.getElement(this); }
  471. };
  472. DatePickerDay.style = datePickerDayCss;
  473. const datePickerMonthCss = "@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}.calender{margin-bottom:0.25rem}.week-headers{display:-ms-flexbox;display:flex;border-width:0px;border-top-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3);padding-top:0px;padding-bottom:0px;padding-left:0.25rem;padding-right:0.25rem}.week-header{text-align:center;font-weight:var(--calcite-font-weight-bold);color:var(--calcite-ui-text-3);width:14.2857142857%}:host([scale=s]) .week-header{padding-left:0px;padding-right:0px;padding-top:0.5rem;padding-bottom:0.75rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]) .week-header{padding-left:0px;padding-right:0px;padding-top:0.75rem;padding-bottom:1rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=l]) .week-header{padding-left:0px;padding-right:0px;padding-top:1rem;padding-bottom:1.25rem;font-size:var(--calcite-font-size--1);line-height:1rem}.week-days{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;padding-top:0px;padding-bottom:0px;padding-left:6px;padding-right:6px}.week-days:focus{outline:2px solid transparent;outline-offset:2px}";
  474. const DatePickerMonth = class {
  475. constructor(hostRef) {
  476. index.registerInstance(this, hostRef);
  477. this.calciteDatePickerSelect = index.createEvent(this, "calciteDatePickerSelect", 7);
  478. this.calciteDatePickerHover = index.createEvent(this, "calciteDatePickerHover", 7);
  479. this.calciteDatePickerActiveDateChange = index.createEvent(this, "calciteDatePickerActiveDateChange", 7);
  480. this.calciteDatePickerMouseOut = index.createEvent(this, "calciteDatePickerMouseOut", 7);
  481. /** Date currently active.*/
  482. this.activeDate = new Date();
  483. //--------------------------------------------------------------------------
  484. //
  485. // Event Listeners
  486. //
  487. //--------------------------------------------------------------------------
  488. this.keyDownHandler = (e) => {
  489. const isRTL = this.el.dir === "rtl";
  490. switch (e.key) {
  491. case "ArrowUp":
  492. e.preventDefault();
  493. this.addDays(-7);
  494. break;
  495. case "ArrowRight":
  496. e.preventDefault();
  497. this.addDays(isRTL ? -1 : 1);
  498. break;
  499. case "ArrowDown":
  500. e.preventDefault();
  501. this.addDays(7);
  502. break;
  503. case "ArrowLeft":
  504. e.preventDefault();
  505. this.addDays(isRTL ? 1 : -1);
  506. break;
  507. case "PageUp":
  508. e.preventDefault();
  509. this.addMonths(-1);
  510. break;
  511. case "PageDown":
  512. e.preventDefault();
  513. this.addMonths(1);
  514. break;
  515. case "Home":
  516. e.preventDefault();
  517. this.activeDate.setDate(1);
  518. this.addDays();
  519. break;
  520. case "End":
  521. e.preventDefault();
  522. this.activeDate.setDate(new Date(this.activeDate.getFullYear(), this.activeDate.getMonth() + 1, 0).getDate());
  523. this.addDays();
  524. break;
  525. case "Enter":
  526. case " ":
  527. e.preventDefault();
  528. break;
  529. case "Tab":
  530. this.activeFocus = false;
  531. }
  532. };
  533. /**
  534. * Once user is not interacting via keyboard,
  535. * disable auto focusing of active date
  536. */
  537. this.disableActiveFocus = () => {
  538. this.activeFocus = false;
  539. };
  540. this.dayHover = (e) => {
  541. const target = e.target;
  542. if (e.detail.disabled) {
  543. this.calciteDatePickerMouseOut.emit();
  544. }
  545. else {
  546. this.calciteDatePickerHover.emit(target.value);
  547. }
  548. };
  549. this.daySelect = (e) => {
  550. const target = e.target;
  551. this.calciteDatePickerSelect.emit(target.value);
  552. };
  553. }
  554. mouseoutHandler() {
  555. this.calciteDatePickerMouseOut.emit();
  556. }
  557. //--------------------------------------------------------------------------
  558. //
  559. // Lifecycle
  560. //
  561. //--------------------------------------------------------------------------
  562. render() {
  563. const month = this.activeDate.getMonth();
  564. const year = this.activeDate.getFullYear();
  565. const startOfWeek = this.localeData.weekStart % 7;
  566. const { abbreviated, short, narrow } = this.localeData.days;
  567. const weekDays = this.scale === "s" ? narrow || short || abbreviated : short || abbreviated || narrow;
  568. const adjustedWeekDays = [...weekDays.slice(startOfWeek, 7), ...weekDays.slice(0, startOfWeek)];
  569. const curMonDays = this.getCurrentMonthDays(month, year);
  570. const prevMonDays = this.getPrevMonthdays(month, year, startOfWeek);
  571. const nextMonDays = this.getNextMonthDays(month, year, startOfWeek);
  572. const days = [
  573. ...prevMonDays.map((day) => {
  574. const date = new Date(year, month - 1, day);
  575. return this.renderDateDay(false, day, date);
  576. }),
  577. ...curMonDays.map((day) => {
  578. const date = new Date(year, month, day);
  579. const active = resources.sameDate(date, this.activeDate);
  580. return this.renderDateDay(active, day, date, true, true);
  581. }),
  582. ...nextMonDays.map((day) => {
  583. const date = new Date(year, month + 1, day);
  584. return this.renderDateDay(false, day, date);
  585. })
  586. ];
  587. const weeks = [];
  588. for (let i = 0; i < days.length; i += 7) {
  589. weeks.push(days.slice(i, i + 7));
  590. }
  591. return (index.h(index.Host, { onFocusOut: this.disableActiveFocus, onKeyDown: this.keyDownHandler }, index.h("div", { class: "calender", role: "grid" }, index.h("div", { class: "week-headers", role: "row" }, adjustedWeekDays.map((weekday) => (index.h("span", { class: "week-header", role: "columnheader" }, weekday)))), weeks.map((days) => (index.h("div", { class: "week-days", role: "row" }, days))))));
  592. }
  593. //--------------------------------------------------------------------------
  594. //
  595. // Private Methods
  596. //
  597. //--------------------------------------------------------------------------
  598. /**
  599. * Add n months to the current month
  600. */
  601. addMonths(step) {
  602. const nextDate = new Date(this.activeDate);
  603. nextDate.setMonth(this.activeDate.getMonth() + step);
  604. this.calciteDatePickerActiveDateChange.emit(resources.dateFromRange(nextDate, this.min, this.max));
  605. this.activeFocus = true;
  606. }
  607. /**
  608. * Add n days to the current date
  609. */
  610. addDays(step = 0) {
  611. const nextDate = new Date(this.activeDate);
  612. nextDate.setDate(this.activeDate.getDate() + step);
  613. this.calciteDatePickerActiveDateChange.emit(resources.dateFromRange(nextDate, this.min, this.max));
  614. this.activeFocus = true;
  615. }
  616. /**
  617. * Get dates for last days of the previous month
  618. */
  619. getPrevMonthdays(month, year, startOfWeek) {
  620. const lastDate = new Date(year, month, 0);
  621. const date = lastDate.getDate();
  622. const day = lastDate.getDay();
  623. const days = [];
  624. if (day - 6 === startOfWeek) {
  625. return days;
  626. }
  627. for (let i = Math.abs(lastDate.getDay() - startOfWeek); i >= 0; i--) {
  628. days.push(date - i);
  629. }
  630. return days;
  631. }
  632. /**
  633. * Get dates for the current month
  634. */
  635. getCurrentMonthDays(month, year) {
  636. const num = new Date(year, month + 1, 0).getDate();
  637. const days = [];
  638. for (let i = 0; i < num; i++) {
  639. days.push(i + 1);
  640. }
  641. return days;
  642. }
  643. /**
  644. * Get dates for first days of the next month
  645. */
  646. getNextMonthDays(month, year, startOfWeek) {
  647. const endDay = new Date(year, month + 1, 0).getDay();
  648. const days = [];
  649. if (endDay === (startOfWeek + 6) % 7) {
  650. return days;
  651. }
  652. for (let i = 0; i < (6 - (endDay - startOfWeek)) % 7; i++) {
  653. days.push(i + 1);
  654. }
  655. return days;
  656. }
  657. /**
  658. * Determine if the date is in between the start and end dates
  659. */
  660. betweenSelectedRange(date) {
  661. return !!(this.startDate &&
  662. this.endDate &&
  663. date > this.startDate &&
  664. date < this.endDate &&
  665. !this.isRangeHover(date));
  666. }
  667. /**
  668. * Determine if the date should be in selected state
  669. */
  670. isSelected(date) {
  671. return !!(resources.sameDate(date, this.selectedDate) ||
  672. (this.startDate && resources.sameDate(date, this.startDate)) ||
  673. (this.endDate && resources.sameDate(date, this.endDate)));
  674. }
  675. /**
  676. * Determine if the date is the start of the date range
  677. */
  678. isStartOfRange(date) {
  679. return !!(this.startDate &&
  680. !resources.sameDate(this.startDate, this.endDate) &&
  681. resources.sameDate(this.startDate, date) &&
  682. !this.isEndOfRange(date));
  683. }
  684. isEndOfRange(date) {
  685. return !!((this.endDate && !resources.sameDate(this.startDate, this.endDate) && resources.sameDate(this.endDate, date)) ||
  686. (!this.endDate &&
  687. this.hoverRange &&
  688. resources.sameDate(this.startDate, this.hoverRange.end) &&
  689. resources.sameDate(date, this.hoverRange.end)));
  690. }
  691. /**
  692. * Render calcite-date-picker-day
  693. */
  694. renderDateDay(active, day, date, currentMonth, ref) {
  695. var _a;
  696. const isFocusedOnStart = this.isFocusedOnStart();
  697. const isHoverInRange = this.isHoverInRange() ||
  698. (!this.endDate && this.hoverRange && resources.sameDate((_a = this.hoverRange) === null || _a === void 0 ? void 0 : _a.end, this.startDate));
  699. return (index.h("calcite-date-picker-day", { active: active, class: {
  700. "hover--inside-range": this.startDate && isHoverInRange,
  701. "hover--outside-range": this.startDate && !isHoverInRange,
  702. "focused--start": isFocusedOnStart,
  703. "focused--end": !isFocusedOnStart
  704. }, currentMonth: currentMonth, day: day, disabled: !resources.inRange(date, this.min, this.max), endOfRange: this.isEndOfRange(date), highlighted: this.betweenSelectedRange(date), key: date.toDateString(), localeData: this.localeData, onCalciteDayHover: this.dayHover, onCalciteDaySelect: this.daySelect, range: !!this.startDate && !!this.endDate && !resources.sameDate(this.startDate, this.endDate), rangeHover: this.isRangeHover(date), ref: (el) => {
  705. // when moving via keyboard, focus must be updated on active date
  706. if (ref && active && this.activeFocus) {
  707. el === null || el === void 0 ? void 0 : el.focus();
  708. }
  709. }, scale: this.scale, selected: this.isSelected(date), startOfRange: this.isStartOfRange(date), value: date }));
  710. }
  711. isFocusedOnStart() {
  712. var _a;
  713. return ((_a = this.hoverRange) === null || _a === void 0 ? void 0 : _a.focused) === "start";
  714. }
  715. isHoverInRange() {
  716. if (!this.hoverRange) {
  717. return false;
  718. }
  719. const { start, end } = this.hoverRange;
  720. return !!((!this.isFocusedOnStart() && this.startDate && (!this.endDate || end < this.endDate)) ||
  721. (this.isFocusedOnStart() && this.startDate && start > this.startDate));
  722. }
  723. isRangeHover(date) {
  724. if (!this.hoverRange) {
  725. return false;
  726. }
  727. const { start, end } = this.hoverRange;
  728. const isStart = this.isFocusedOnStart();
  729. const insideRange = this.isHoverInRange();
  730. const cond1 = insideRange &&
  731. ((!isStart && date > this.startDate && (date < end || resources.sameDate(date, end))) ||
  732. (isStart && date < this.endDate && (date > start || resources.sameDate(date, start))));
  733. const cond2 = !insideRange &&
  734. ((!isStart && date >= this.endDate && (date < end || resources.sameDate(date, end))) ||
  735. (isStart &&
  736. (date < this.startDate || (this.endDate && resources.sameDate(date, this.startDate))) &&
  737. (date > start || resources.sameDate(date, start))));
  738. return cond1 || cond2;
  739. }
  740. get el() { return index.getElement(this); }
  741. };
  742. DatePickerMonth.style = datePickerMonthCss;
  743. const datePickerMonthHeaderCss = "@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:block}.header{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding-top:0px;padding-bottom:0px;padding-left:0.25rem;padding-right:0.25rem}:host([scale=s]) .text{margin-top:0.5rem;margin-bottom:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=s]) .chevron{height:2.25rem}:host([scale=m]) .text{margin-top:0.75rem;margin-bottom:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=m]) .chevron{height:3rem}:host([scale=l]) .text{margin-top:1rem;margin-bottom:1rem;font-size:var(--calcite-font-size-1);line-height:1.5rem}:host([scale=l]) .chevron{height:3.5rem}.chevron{margin-left:-0.25rem;margin-right:-0.25rem;-webkit-box-sizing:content-box;box-sizing:content-box;display:-ms-flexbox;display:flex;-ms-flex-positive:0;flex-grow:0;cursor:pointer;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-style:none;background-color:var(--calcite-ui-foreground-1);padding-left:0.25rem;padding-right:0.25rem;color:var(--calcite-ui-text-3);outline:2px solid transparent;outline-offset:2px;-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:150ms;transition-duration:150ms;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);outline-offset:0;outline-color:transparent;-webkit-transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;width:14.2857142857%}.chevron:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}.chevron:hover,.chevron:focus{background-color:var(--calcite-ui-foreground-2);fill:var(--calcite-ui-text-1);color:var(--calcite-ui-text-1)}.chevron:active{background-color:var(--calcite-ui-foreground-3)}.chevron[aria-disabled=true]{pointer-events:none;opacity:0}.text{margin-top:auto;margin-bottom:auto;width:100%;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;text-align:center;line-height:1}.text-nreverse{-ms-flex-direction:row-reverse;flex-direction:row-reverse}.month,.year,.suffix{margin-left:0.25rem;margin-right:0.25rem;margin-top:auto;margin-bottom:auto;display:inline-block;background-color:var(--calcite-ui-foreground-1);font-weight:var(--calcite-font-weight-medium);line-height:1.25;color:var(--calcite-ui-text-1);font-size:inherit}.year{position:relative;width:3rem;border-style:none;background-color:transparent;text-align:center;font-family:inherit;outline-offset:0;outline-color:transparent;-webkit-transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;z-index:2}.year:hover{-webkit-transition-duration:100ms;transition-duration:100ms;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-property:outline-color;transition-property:outline-color;outline:2px solid var(--calcite-ui-border-2);outline-offset:2px}.year:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}.year--suffix{width:4rem;text-align:left}.year-wrap{position:relative}.suffix{position:absolute;top:0px;left:0px;width:4rem;white-space:nowrap;text-align:left}.suffix__invisible{visibility:hidden}";
  744. const DatePickerMonthHeader = class {
  745. constructor(hostRef) {
  746. index.registerInstance(this, hostRef);
  747. this.calciteDatePickerSelect = index.createEvent(this, "calciteDatePickerSelect", 7);
  748. //--------------------------------------------------------------------------
  749. //
  750. // Private Methods
  751. //
  752. //--------------------------------------------------------------------------
  753. /**
  754. * Increment year on UP/DOWN keys
  755. */
  756. this.onYearKey = (e) => {
  757. const localizedYear = e.target.value;
  758. switch (e.key) {
  759. case "ArrowDown":
  760. e.preventDefault();
  761. this.setYear({ localizedYear, offset: -1 });
  762. break;
  763. case "ArrowUp":
  764. e.preventDefault();
  765. this.setYear({ localizedYear, offset: 1 });
  766. break;
  767. }
  768. };
  769. this.onYearChange = (event) => {
  770. this.setYear({ localizedYear: event.target.value });
  771. };
  772. this.onYearInput = (event) => {
  773. this.setYear({ localizedYear: event.target.value, commit: false });
  774. };
  775. this.prevMonthClick = (e) => {
  776. this.handleArrowClick(e, this.prevMonthDate);
  777. };
  778. this.prevMonthKeydown = (e) => {
  779. const key = e.key;
  780. if (key === " " || key === "Enter") {
  781. this.prevMonthClick(e);
  782. }
  783. };
  784. this.nextMonthClick = (e) => {
  785. this.handleArrowClick(e, this.nextMonthDate);
  786. };
  787. this.nextMonthKeydown = (e) => {
  788. const key = e.key;
  789. if (key === " " || key === "Enter") {
  790. this.nextMonthClick(e);
  791. }
  792. };
  793. /*
  794. * Update active month on clicks of left/right arrows
  795. */
  796. this.handleArrowClick = (e, date) => {
  797. e === null || e === void 0 ? void 0 : e.preventDefault();
  798. e.stopPropagation();
  799. this.calciteDatePickerSelect.emit(date);
  800. };
  801. }
  802. //--------------------------------------------------------------------------
  803. //
  804. // Lifecycle
  805. //
  806. //--------------------------------------------------------------------------
  807. connectedCallback() {
  808. this.setNextPrevMonthDates();
  809. }
  810. render() {
  811. return index.h("div", { class: "header" }, this.renderContent());
  812. }
  813. renderContent() {
  814. var _a;
  815. if (!this.activeDate || !this.localeData) {
  816. return null;
  817. }
  818. const activeMonth = this.activeDate.getMonth();
  819. const { months, unitOrder } = this.localeData;
  820. const localizedMonth = (months.wide || months.narrow || months.abbreviated)[activeMonth];
  821. const localizedYear = resources.localizeNumber(this.activeDate.getFullYear(), this.localeData);
  822. const iconScale = this.scale === "l" ? "m" : "s";
  823. const order = resources.getOrder(unitOrder);
  824. const reverse = order.indexOf("y") < order.indexOf("m");
  825. const suffix = (_a = this.localeData.year) === null || _a === void 0 ? void 0 : _a.suffix;
  826. return (index.h(index.Fragment, null, index.h("a", { "aria-disabled": (this.prevMonthDate.getMonth() === activeMonth).toString(), "aria-label": this.intlPrevMonth, class: "chevron", href: "#", onClick: this.prevMonthClick, onKeyDown: this.prevMonthKeydown, role: "button", tabindex: this.prevMonthDate.getMonth() === activeMonth ? -1 : 0 }, index.h("calcite-icon", { "flip-rtl": true, icon: "chevron-left", scale: iconScale })), index.h("div", { class: { text: true, "text--reverse": reverse } }, index.h(Heading.Heading, { class: "month", level: this.headingLevel }, localizedMonth), index.h("span", { class: "year-wrap" }, index.h("input", { "aria-label": this.intlYear, class: {
  827. year: true,
  828. "year--suffix": !!suffix
  829. }, inputmode: "numeric", maxlength: "4", minlength: "1", onChange: this.onYearChange, onInput: this.onYearInput, onKeyDown: this.onYearKey, pattern: "\\d*", ref: (el) => (this.yearInput = el), type: "text", value: localizedYear }), suffix && (index.h("span", { class: "suffix" }, index.h("span", { "aria-hidden": "true", class: "suffix__invisible" }, localizedYear), " " + suffix)))), index.h("a", { "aria-disabled": (this.nextMonthDate.getMonth() === activeMonth).toString(), "aria-label": this.intlNextMonth, class: "chevron", href: "#", onClick: this.nextMonthClick, onKeyDown: this.nextMonthKeydown, role: "button", tabindex: this.nextMonthDate.getMonth() === activeMonth ? -1 : 0 }, index.h("calcite-icon", { "flip-rtl": true, icon: "chevron-right", scale: iconScale }))));
  830. }
  831. setNextPrevMonthDates() {
  832. if (!this.activeDate) {
  833. return;
  834. }
  835. this.nextMonthDate = resources.dateFromRange(resources.nextMonth(this.activeDate), this.min, this.max);
  836. this.prevMonthDate = resources.dateFromRange(resources.prevMonth(this.activeDate), this.min, this.max);
  837. }
  838. getInRangeDate({ localizedYear, offset = 0 }) {
  839. const { min, max, activeDate, localeData } = this;
  840. const parsedYear = resources.parseNumber(localizedYear, localeData);
  841. const length = parsedYear.toString().length;
  842. const year = isNaN(parsedYear) ? false : parsedYear + offset;
  843. const inRange = year && (!min || min.getFullYear() <= year) && (!max || max.getFullYear() >= year);
  844. // if you've supplied a year and it's in range
  845. if (year && inRange && length === localizedYear.length) {
  846. const nextDate = new Date(activeDate);
  847. nextDate.setFullYear(year);
  848. return resources.dateFromRange(nextDate, min, max);
  849. }
  850. }
  851. /**
  852. * Parse localized year string from input,
  853. * set to active if in range
  854. */
  855. setYear({ localizedYear, commit = true, offset = 0 }) {
  856. const { yearInput, activeDate, localeData } = this;
  857. const inRangeDate = this.getInRangeDate({ localizedYear, offset });
  858. // if you've supplied a year and it's in range, update active date
  859. if (inRangeDate) {
  860. this.calciteDatePickerSelect.emit(inRangeDate);
  861. }
  862. if (commit) {
  863. yearInput.value = resources.localizeNumber((inRangeDate || activeDate).getFullYear(), localeData);
  864. }
  865. }
  866. get el() { return index.getElement(this); }
  867. static get watchers() { return {
  868. "min": ["setNextPrevMonthDates"],
  869. "max": ["setNextPrevMonthDates"],
  870. "activeDate": ["setNextPrevMonthDates"]
  871. }; }
  872. };
  873. DatePickerMonthHeader.style = datePickerMonthHeaderCss;
  874. exports.calcite_date_picker = DatePicker;
  875. exports.calcite_date_picker_day = DatePickerDay;
  876. exports.calcite_date_picker_month = DatePickerMonth;
  877. exports.calcite_date_picker_month_header = DatePickerMonthHeader;