@3mo/date-time-fields 0.11.0-preview.0 → 0.11.0-preview.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.
@@ -1,7 +1,8 @@
1
1
  var Calendar_1;
2
2
  import { __decorate } from "tslib";
3
- import { Component, css, component, html, property, event, repeat, state } from '@a11d/lit';
3
+ import { Component, css, component, html, property, event, repeat, state, unsafeCSS } from '@a11d/lit';
4
4
  import { CalendarDatesController } from './CalendarDatesController.js';
5
+ import { FieldDateTimePrecision } from '../FieldDateTimePrecision.js';
5
6
  /**
6
7
  * @fires dateClick - Dispatched when a date is clicked, with the clicked date as detail.
7
8
  */
@@ -9,7 +10,7 @@ let Calendar = Calendar_1 = class Calendar extends Component {
9
10
  constructor() {
10
11
  super(...arguments);
11
12
  this.includeWeek = false;
12
- this.view = 'day';
13
+ this.view = FieldDateTimePrecision.Day;
13
14
  this.datesController = new CalendarDatesController(this);
14
15
  this.handleItemClick = (date, precision) => {
15
16
  return () => {
@@ -20,10 +21,10 @@ let Calendar = Calendar_1 = class Calendar extends Component {
20
21
  else {
21
22
  const nextView = this.view !== precision
22
23
  ? precision
23
- : this.view === 'year'
24
- ? 'month'
25
- : this.view === 'month'
26
- ? 'day'
24
+ : this.view === FieldDateTimePrecision.Year
25
+ ? FieldDateTimePrecision.Month
26
+ : this.view === FieldDateTimePrecision.Month
27
+ ? FieldDateTimePrecision.Day
27
28
  : this.view;
28
29
  this.setView(nextView, date);
29
30
  }
@@ -32,45 +33,47 @@ let Calendar = Calendar_1 = class Calendar extends Component {
32
33
  }
33
34
  get navigationDate() { return this.datesController.navigationDate; }
34
35
  async setNavigatingValue(date, behavior = 'instant') {
36
+ this.datesController.disableObservers = true;
35
37
  this.datesController.navigationDate = date;
36
38
  await this.updateComplete;
37
- this.scrollToNavigatingItem(behavior);
38
- }
39
- scrollToNavigatingItem(behavior = 'instant') {
40
- this.renderRoot
41
- .querySelector(`.${this.view}[data-navigating]`)
39
+ await new Promise(r => setTimeout(r, 10));
40
+ this.renderRoot.querySelector(`.${this.view}[data-navigating]`)
42
41
  ?.scrollIntoView({ block: 'center', behavior });
42
+ await new Promise(r => setTimeout(r, behavior === 'instant' ? 10 : 100));
43
+ this.datesController.disableObservers = false;
43
44
  }
44
- setView(view, navigatingDate = this.datesController.navigationDate) {
45
+ setView(view, navigationDate = this.datesController.navigationDate) {
45
46
  this.view = view;
46
- this.setNavigatingValue(navigatingDate);
47
+ this.setNavigatingValue(navigationDate);
47
48
  }
48
49
  static get styles() {
50
+ const year = unsafeCSS(FieldDateTimePrecision.Year.key);
51
+ const month = unsafeCSS(FieldDateTimePrecision.Month.key);
52
+ const day = unsafeCSS(FieldDateTimePrecision.Day.key);
49
53
  return css `
50
54
  :host {
51
55
  --mo-calendar-item-size: 2.25rem;
56
+ flex: 1;
52
57
  }
53
58
 
54
- mo-scroller {
59
+ .scroller {
55
60
  height: min(450px, 100vh);
56
61
 
57
- &::part(container) {
58
- display: grid;
59
- position: relative;
60
- scrollbar-width: none;
61
- overflow-x: hidden;
62
- scroll-behavior: smooth;
63
- }
62
+ display: grid;
63
+ position: relative;
64
+ scrollbar-width: none;
65
+ overflow-x: hidden;
66
+ scroll-behavior: smooth;
64
67
 
65
- &[data-view=day]::part(container) {
68
+ &[data-view=${day}] {
66
69
  grid-template-columns: repeat(1, 1fr);
67
70
  }
68
71
 
69
- &[data-view=month]::part(container) {
72
+ &[data-view=${month}] {
70
73
  grid-template-columns: repeat(3, 1fr);
71
74
  }
72
75
 
73
- &[data-view=year]::part(container) {
76
+ &[data-view=${year}] {
74
77
  grid-template-columns: repeat(5, 1fr);
75
78
  }
76
79
  }
@@ -108,7 +111,7 @@ let Calendar = Calendar_1 = class Calendar extends Component {
108
111
  }
109
112
 
110
113
  /* Headings */
111
- .year[data-view=month], .month[data-view=day] {
114
+ .year[data-view=${month}], .month[data-view=${day}] {
112
115
  font-size: 1.125rem;
113
116
  font-weight: 500;
114
117
  height: 2rem;
@@ -116,7 +119,7 @@ let Calendar = Calendar_1 = class Calendar extends Component {
116
119
  }
117
120
 
118
121
  /* Selection */
119
- .year[data-view=year], .month[data-view=month], .day {
122
+ .year[data-view=${year}], .month[data-view=${month}], .day {
120
123
  opacity: 0.875;
121
124
  font-size: 0.94rem;
122
125
  cursor: pointer;
@@ -124,10 +127,10 @@ let Calendar = Calendar_1 = class Calendar extends Component {
124
127
  }
125
128
 
126
129
  .year {
127
- &[data-view=day] {
130
+ &[data-view=${day}] {
128
131
  display: none;
129
132
  }
130
- &:not([data-view=year]) {
133
+ &:not([data-view=${year}]) {
131
134
  grid-column: -1 / 1;
132
135
  border-block-start: 1px solid var(--mo-color-transparent-gray-3);
133
136
  }
@@ -137,7 +140,7 @@ let Calendar = Calendar_1 = class Calendar extends Component {
137
140
  .month-container {
138
141
  width: 100%;
139
142
  position: relative;
140
- &[data-view=day] {
143
+ &[data-view=${day}] {
141
144
  &::before {
142
145
  content: ' ';
143
146
  position: absolute;
@@ -164,7 +167,7 @@ let Calendar = Calendar_1 = class Calendar extends Component {
164
167
  margin-block-start: -0.375rem;
165
168
  }
166
169
 
167
- &[data-view=month] {
170
+ &[data-view=${month}] {
168
171
  & > mo-grid {
169
172
  display: none;
170
173
  }
@@ -210,25 +213,25 @@ let Calendar = Calendar_1 = class Calendar extends Component {
210
213
  }
211
214
  get template() {
212
215
  return html `
213
- <mo-scroller data-view=${this.view}>
216
+ <div class='scroller' data-view=${this.view.key}>
214
217
  ${repeat(this.datesController.data, d => d.toString(), d => html `
215
218
  ${this.getYearTemplate(d)}
216
219
  ${this.getMonthTemplate(d)}
217
220
  `)}
218
- </mo-scroller>
221
+ </div>
219
222
  `;
220
223
  }
221
224
  getYearTemplate(date) {
222
225
  return date.dayOfYear !== 1 ? html.nothing : html `
223
226
  <div class='year' role='button'
224
- data-view=${this.view}
225
- ?data-navigating=${this.isNavigating(date, 'year')}
226
- ?data-now=${this.isNow(date, 'year')}
227
- ?data-start=${this.isStart(date, 'year')}
228
- ?data-end=${this.isEnd(date, 'year')}
229
- ?data-in-range=${this.isInRange(date, 'year')}
230
- @click=${this.handleItemClick(date, 'year')}
231
- ${this.datesController.observerIntersectionNavigation(date, 'month', 'year')}
227
+ data-view=${this.view.key}
228
+ ?data-navigating=${this.isNavigating(date, FieldDateTimePrecision.Year)}
229
+ ?data-now=${this.isNow(date, FieldDateTimePrecision.Year)}
230
+ ?data-start=${this.isStart(date, FieldDateTimePrecision.Year)}
231
+ ?data-end=${this.isEnd(date, FieldDateTimePrecision.Year)}
232
+ ?data-in-range=${this.isInRange(date, FieldDateTimePrecision.Year)}
233
+ @click=${this.handleItemClick(date, FieldDateTimePrecision.Year)}
234
+ ${this.datesController.observerIntersectionNavigation(date, FieldDateTimePrecision.Month, FieldDateTimePrecision.Year)}
232
235
  >
233
236
  ${date.format({ year: 'numeric' })}
234
237
  </div>
@@ -253,40 +256,40 @@ let Calendar = Calendar_1 = class Calendar extends Component {
253
256
  `;
254
257
  }
255
258
  getMonthTemplate(date) {
256
- return this.view === 'year' || date.day !== 1 ? html.nothing : html `
257
- <mo-flex class='month-container' data-view=${this.view}>
259
+ return this.view === FieldDateTimePrecision.Year || date.day !== 1 ? html.nothing : html `
260
+ <mo-flex class='month-container' data-view=${this.view.key}>
258
261
  <div class='month' role='button'
259
- data-view=${this.view}
260
- ?data-navigating=${this.isNavigating(date, 'month')}
261
- ?data-now=${this.isNow(date, 'month')}
262
- ?data-start=${this.isStart(date, 'month')}
263
- ?data-end=${this.isEnd(date, 'month')}
264
- ?data-in-range=${this.isInRange(date, 'month')}
265
- @click=${this.handleItemClick(date, 'month')}
266
- ${this.datesController.observerIntersectionNavigation(date, 'day')}
262
+ data-view=${this.view.key}
263
+ ?data-navigating=${this.isNavigating(date, FieldDateTimePrecision.Month)}
264
+ ?data-now=${this.isNow(date, FieldDateTimePrecision.Month)}
265
+ ?data-start=${this.isStart(date, FieldDateTimePrecision.Month)}
266
+ ?data-end=${this.isEnd(date, FieldDateTimePrecision.Month)}
267
+ ?data-in-range=${this.isInRange(date, FieldDateTimePrecision.Month)}
268
+ @click=${this.handleItemClick(date, FieldDateTimePrecision.Month)}
269
+ ${this.datesController.observerIntersectionNavigation(date, FieldDateTimePrecision.Day)}
267
270
  >
268
- ${this.view === 'day' ? date.format({ year: 'numeric', month: 'long' }) : date.format({ month: 'long' })}
271
+ ${this.view === FieldDateTimePrecision.Day ? date.format({ year: 'numeric', month: 'long' }) : date.format({ month: 'long' })}
269
272
  </div>
270
- <mo-grid autoRows='var(--mo-calendar-item-size)' columns=${this.view === 'day' ? this.columns : 'auto'}>
271
- ${this.view !== 'day' ? html.nothing : Calendar_1.weekDaysTemplate}
273
+ <mo-grid justifyContent='center' autoRows='var(--mo-calendar-item-size)' columns=${this.view === FieldDateTimePrecision.Day ? this.columns : 'auto'}>
274
+ ${this.view !== FieldDateTimePrecision.Day ? html.nothing : Calendar_1.weekDaysTemplate}
272
275
  ${this.datesController.data.filter(d => d.year === date.year && d.month === date.month).map(day => this.getDayTemplate(day))}
273
276
  </mo-grid>
274
277
  </mo-flex>
275
278
  `;
276
279
  }
277
280
  getDayTemplate(day) {
278
- return this.view === 'month' ? html.nothing : html `
281
+ return this.view === FieldDateTimePrecision.Month ? html.nothing : html `
279
282
  ${this.includeWeek === false || day.dayOfWeek !== 1 ? html.nothing : html `
280
283
  <div class='week' style='grid-column: week'>${day.weekOfYear}</div>
281
284
  `}
282
285
  <div tabindex='0' role='button' class='day'
283
286
  style='grid-column: ${this.getColumnName(day)}'
284
- ?data-navigating=${this.isNavigating(day, 'day')}
285
- ?data-now=${this.isNow(day, 'day')}
286
- ?data-start=${this.isStart(day, 'day')}
287
- ?data-end=${this.isEnd(day, 'day')}
288
- ?data-in-range=${this.isInRange(day, 'day')}
289
- @click=${this.handleItemClick(day, 'day')}
287
+ ?data-navigating=${this.isNavigating(day, FieldDateTimePrecision.Day)}
288
+ ?data-now=${this.isNow(day, FieldDateTimePrecision.Day)}
289
+ ?data-start=${this.isStart(day, FieldDateTimePrecision.Day)}
290
+ ?data-end=${this.isEnd(day, FieldDateTimePrecision.Day)}
291
+ ?data-in-range=${this.isInRange(day, FieldDateTimePrecision.Day)}
292
+ @click=${this.handleItemClick(day, FieldDateTimePrecision.Day)}
290
293
  >
291
294
  ${day.format({ day: 'numeric' })}
292
295
  </div>
@@ -295,18 +298,18 @@ let Calendar = Calendar_1 = class Calendar extends Component {
295
298
  isNavigating(date, precision) {
296
299
  return this.view === precision
297
300
  && this.navigationDate.year === date.year
298
- && (precision === 'year' || this.navigationDate.month === date.month)
299
- && (precision !== 'day' || this.navigationDate.day === date.day);
301
+ && (precision === FieldDateTimePrecision.Year || this.navigationDate.month === date.month)
302
+ && (precision !== FieldDateTimePrecision.Day || this.navigationDate.day === date.day);
300
303
  }
301
304
  isEqual(precision, left, right) {
302
305
  return left.year === right.year
303
- && (precision === 'year' || left.month === right.month)
304
- && (precision !== 'day' || left.day === right.day);
306
+ && (precision === FieldDateTimePrecision.Year || left.month === right.month)
307
+ && (precision !== FieldDateTimePrecision.Day || left.day === right.day);
305
308
  }
306
309
  isLower(precision, left, right) {
307
310
  return left.year < right.year
308
- || (precision !== 'year' && left.year === right.year && left.month < right.month)
309
- || (precision === 'day' && left.year === right.year && left.month === right.month && left.day < right.day);
311
+ || (precision !== FieldDateTimePrecision.Year && left.year === right.year && left.month < right.month)
312
+ || (precision === FieldDateTimePrecision.Day && left.year === right.year && left.month === right.month && left.day < right.day);
310
313
  }
311
314
  isNow(date, precision) {
312
315
  return this.view === precision && this.isEqual(precision, date, CalendarDatesController.today);
@@ -330,7 +333,7 @@ __decorate([
330
333
  property({ type: Object })
331
334
  ], Calendar.prototype, "value", void 0);
332
335
  __decorate([
333
- property({ updated() { this.setView(this.precision); } })
336
+ property({ type: Object, updated() { this.setView(this.precision); } })
334
337
  ], Calendar.prototype, "precision", void 0);
335
338
  __decorate([
336
339
  property({ type: Boolean, reflect: true })
@@ -1,5 +1,6 @@
1
1
  import { Controller, type DirectiveResult } from '@a11d/lit';
2
- import type { Calendar, DatePrecision } from './Calendar.js';
2
+ import type { Calendar } from './Calendar.js';
3
+ import { FieldDateTimePrecision } from '../FieldDateTimePrecision.js';
3
4
  export declare class CalendarDatesController extends Controller {
4
5
  readonly host: Calendar;
5
6
  static get today(): import("@3mo/date-time/DateTime.js").DateTime;
@@ -7,7 +8,8 @@ export declare class CalendarDatesController extends Controller {
7
8
  private static _sampleWeek;
8
9
  static get sampleWeek(): ReadonlyArray<DateTime>;
9
10
  private static generateWeek;
10
- observerIntersectionNavigation(date: DateTime, ...views: Array<DatePrecision>): DirectiveResult<any>;
11
+ disableObservers: boolean;
12
+ observerIntersectionNavigation(date: DateTime, ...views: Array<FieldDateTimePrecision>): DirectiveResult<any>;
11
13
  constructor(host: Calendar);
12
14
  private days;
13
15
  private months;
@@ -1 +1 @@
1
- {"version":3,"file":"CalendarDatesController.d.ts","sourceRoot":"","sources":["../../selection/CalendarDatesController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,KAAK,eAAe,EAAE,MAAM,WAAW,CAAA;AAGlE,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAE5D,qBAAa,uBAAwB,SAAQ,UAAU;aAgCxB,IAAI,EAAE,QAAQ;IA9B5C,MAAM,KAAK,KAAK,kDAAqC;IAErD,OAAO,CAAC,MAAM,CAAE,QAAQ;IAMxB,OAAO,CAAC,MAAM,CAAC,WAAW,CAAwB;IAClD,MAAM,KAAK,UAAU,IAAgC,aAAa,CAAC,QAAQ,CAAC,CAAE;IAE9E,OAAO,CAAC,MAAM,CAAC,YAAY;IAW3B,8BAA8B,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC;gBAQ/C,IAAI,EAAE,QAAQ;IAK5C,OAAO,CAAC,IAAI,CAAwB;IACpC,OAAO,CAAC,MAAM,CAAwB;IACtC,OAAO,CAAC,KAAK,CAAwB;IAErC,IAAI,IAAI,oDASP;IAED,OAAO,CAAC,eAAe,CAAW;IAClC,IAAI,cAAc,kDAAkC;IACpD,IAAI,cAAc,CAAC,KAAK,+CAAA,EAsCvB;CACD"}
1
+ {"version":3,"file":"CalendarDatesController.d.ts","sourceRoot":"","sources":["../../selection/CalendarDatesController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,KAAK,eAAe,EAAE,MAAM,WAAW,CAAA;AAGlE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAErE,qBAAa,uBAAwB,SAAQ,UAAU;aAkCxB,IAAI,EAAE,QAAQ;IAhC5C,MAAM,KAAK,KAAK,kDAAqC;IAErD,OAAO,CAAC,MAAM,CAAE,QAAQ;IAMxB,OAAO,CAAC,MAAM,CAAC,WAAW,CAAwB;IAClD,MAAM,KAAK,UAAU,IAAgC,aAAa,CAAC,QAAQ,CAAC,CAAE;IAE9E,OAAO,CAAC,MAAM,CAAC,YAAY;IAW3B,gBAAgB,UAAQ;IAExB,8BAA8B,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,KAAK,CAAC,sBAAsB,CAAC;gBAQxD,IAAI,EAAE,QAAQ;IAK5C,OAAO,CAAC,IAAI,CAAwB;IACpC,OAAO,CAAC,MAAM,CAAwB;IACtC,OAAO,CAAC,KAAK,CAAwB;IAErC,IAAI,IAAI,oDASP;IAED,OAAO,CAAC,eAAe,CAAW;IAClC,IAAI,cAAc,kDAAkC;IACpD,IAAI,cAAc,CAAC,KAAK,+CAAA,EAsCvB;CACD"}
@@ -2,23 +2,24 @@ import { __decorate } from "tslib";
2
2
  import { Controller, html } from '@a11d/lit';
3
3
  import { observeIntersection } from '@3mo/intersection-observer';
4
4
  import { MemoizeExpiring as memoizeExpiring } from 'typescript-memoize';
5
+ import { FieldDateTimePrecision } from '../FieldDateTimePrecision.js';
5
6
  export class CalendarDatesController extends Controller {
6
7
  static get today() { return new DateTime().dayStart; }
7
- static *generate(start, count, step = 'days') {
8
+ static *generate(start, count, step) {
8
9
  for (let i = 0; i < count; i++) {
9
10
  yield start.add({ [step]: i });
10
11
  }
11
12
  }
12
13
  static get sampleWeek() { return this._sampleWeek; }
13
14
  static generateWeek() {
14
- const sample = [...CalendarDatesController.generate(CalendarDatesController.today, CalendarDatesController.today.daysInWeek * 2)];
15
+ const sample = [...CalendarDatesController.generate(CalendarDatesController.today, CalendarDatesController.today.daysInWeek * 2, 'days')];
15
16
  const indexOfFirstWeekStart = sample.findIndex(d => d.dayOfWeek === 1);
16
17
  const daysInWeek = sample[0].daysInWeek;
17
18
  CalendarDatesController._sampleWeek = sample.slice(indexOfFirstWeekStart, indexOfFirstWeekStart + daysInWeek).map(d => d.dayStart);
18
19
  }
19
20
  observerIntersectionNavigation(date, ...views) {
20
21
  return !views.includes(this.host.view) ? html.nothing : observeIntersection(data => {
21
- if (data.some(entry => entry.isIntersecting)) {
22
+ if (!this.disableObservers && data.some(entry => entry.isIntersecting)) {
22
23
  this.navigationDate = date;
23
24
  }
24
25
  });
@@ -26,6 +27,7 @@ export class CalendarDatesController extends Controller {
26
27
  constructor(host) {
27
28
  super(host);
28
29
  this.host = host;
30
+ this.disableObservers = false;
29
31
  this.days = new Array();
30
32
  this.months = new Array();
31
33
  this.years = new Array();
@@ -33,9 +35,9 @@ export class CalendarDatesController extends Controller {
33
35
  }
34
36
  get data() {
35
37
  switch (this.host.view) {
36
- case 'year':
38
+ case FieldDateTimePrecision.Year:
37
39
  return this.years;
38
- case 'month':
40
+ case FieldDateTimePrecision.Month:
39
41
  return this.months;
40
42
  default:
41
43
  return this.days;
@@ -45,17 +47,17 @@ export class CalendarDatesController extends Controller {
45
47
  set navigationDate(value) {
46
48
  let changed = false;
47
49
  const daysOffset = 75;
48
- if (this.host.view === 'day' && (!this.days.length || value.isBefore(this.days.at(daysOffset)) || value.isAfter(this.days.at(-daysOffset)))) {
50
+ if (this.host.view === FieldDateTimePrecision.Day && (!this.days.length || value.isBefore(this.days.at(daysOffset)) || value.isAfter(this.days.at(-daysOffset)))) {
49
51
  this.days = [...CalendarDatesController.generate(value.yearStart.add({ years: -1 }), value.daysInYear * 3, 'days')];
50
52
  changed = true;
51
53
  }
52
54
  const monthsOffset = 25;
53
- if (this.host.view === 'month' && (!this.months.length || value.isBefore(this.months.at(monthsOffset)) || value.isAfter(this.months.at(-monthsOffset)))) {
55
+ if (this.host.view === FieldDateTimePrecision.Month && (!this.months.length || value.isBefore(this.months.at(monthsOffset)) || value.isAfter(this.months.at(-monthsOffset)))) {
54
56
  this.months = [...CalendarDatesController.generate(value.yearStart.add({ years: -10 }), value.monthsInYear * 20, 'months')];
55
57
  changed = true;
56
58
  }
57
59
  const yearsOffset = 15;
58
- if (this.host.view === 'year' && (!this.years.length || value.isBefore(this.years.at(yearsOffset)) || value.isAfter(this.years.at(-yearsOffset)))) {
60
+ if (this.host.view === FieldDateTimePrecision.Year && (!this.years.length || value.isBefore(this.years.at(yearsOffset)) || value.isAfter(this.years.at(-yearsOffset)))) {
59
61
  this.years = [...CalendarDatesController.generate(value.yearStart.add({ years: -100 }), 200, 'years')];
60
62
  changed = true;
61
63
  }
@@ -2,7 +2,7 @@ import { Component, type HTMLTemplateResult } from '@a11d/lit';
2
2
  export declare abstract class DateList extends Component {
3
3
  readonly change: EventDispatcher<DateTime>;
4
4
  readonly navigate: EventDispatcher<DateTime>;
5
- navigatingValue: DateTime;
5
+ navigationDate: DateTime;
6
6
  value?: DateTime;
7
7
  private readonly selector;
8
8
  private readonly items;
@@ -1 +1 @@
1
- {"version":3,"file":"DateList.d.ts","sourceRoot":"","sources":["../../selection/DateList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,kBAAkB,EAA6D,MAAM,WAAW,CAAA;AAGzH,8BAAsB,QAAS,SAAQ,SAAS;IACtC,QAAQ,CAAC,MAAM,EAAG,eAAe,CAAC,QAAQ,CAAC,CAAA;IAC3C,QAAQ,CAAC,QAAQ,EAAG,eAAe,CAAC,QAAQ,CAAC,CAAA;IAEP,eAAe,EAAG,QAAQ,CAAA;IAC7C,KAAK,CAAC,EAAE,QAAQ,CAAA;IAExB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAc;IACtB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA4B;IACpC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAoB;IAC3D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAoB;IAE9F,IAAI,IAAI,WAAe;IAEvB,WAAoB,MAAM,kCA+BzB;cAEkB,SAAS;IAI5B,cAAuB,QAAQ,uBAkB9B;YAEa,cAAc;IAM5B,OAAO,CAAC,iBAAiB,CAAQ;IACjC,IAAI,gBAAgB,YAAoC;IACxD,IAAI,gBAAgB,CAAC,KAAK,SAAA,EAMzB;IAID,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,KAAK;IAe/B,SAAS,CAAC,QAAQ,KAAK,iBAAiB,IAAI,kBAAkB,CAAA;CAC9D"}
1
+ {"version":3,"file":"DateList.d.ts","sourceRoot":"","sources":["../../selection/DateList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,kBAAkB,EAA6D,MAAM,WAAW,CAAA;AAGzH,8BAAsB,QAAS,SAAQ,SAAS;IACtC,QAAQ,CAAC,MAAM,EAAG,eAAe,CAAC,QAAQ,CAAC,CAAA;IAC3C,QAAQ,CAAC,QAAQ,EAAG,eAAe,CAAC,QAAQ,CAAC,CAAA;IAEP,cAAc,EAAG,QAAQ,CAAA;IAC5C,KAAK,CAAC,EAAE,QAAQ,CAAA;IAExB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAc;IACtB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA4B;IACpC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAoB;IAC3D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAoB;IAE9F,IAAI,IAAI,WAAe;IAEvB,WAAoB,MAAM,kCA+BzB;cAEkB,SAAS;IAI5B,cAAuB,QAAQ,uBAkB9B;YAEa,cAAc;IAM5B,OAAO,CAAC,iBAAiB,CAAQ;IACjC,IAAI,gBAAgB,YAAoC;IACxD,IAAI,gBAAgB,CAAC,KAAK,SAAA,EAMzB;IAID,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,KAAK;IAe/B,SAAS,CAAC,QAAQ,KAAK,iBAAiB,IAAI,kBAAkB,CAAA;CAC9D"}
@@ -42,7 +42,7 @@ export class DateList extends Component {
42
42
  this.scrollIntoItem('navigating', 'instant');
43
43
  }
44
44
  get template() {
45
- return this.navigatingValue === undefined ? html.nothing : html `
45
+ return this.navigationDate === undefined ? html.nothing : html `
46
46
  <div class='selector'></div>
47
47
  <mo-scroller snapType='y mandatory'
48
48
  @scroll=${this.handleScroll}
@@ -97,7 +97,7 @@ __decorate([
97
97
  ], DateList.prototype, "navigate", void 0);
98
98
  __decorate([
99
99
  property({ type: Object, event: 'navigate' })
100
- ], DateList.prototype, "navigatingValue", void 0);
100
+ ], DateList.prototype, "navigationDate", void 0);
101
101
  __decorate([
102
102
  property({ type: Object })
103
103
  ], DateList.prototype, "value", void 0);
@@ -4,11 +4,11 @@ import { DateList } from './DateList.js';
4
4
  let HourList = class HourList extends DateList {
5
5
  get listItemsTemplate() {
6
6
  return html `
7
- ${[...range(0, this.navigatingValue.hoursInDay)].map(hour => html `
7
+ ${[...range(0, this.navigationDate.hoursInDay)].map(hour => html `
8
8
  <mo-selectable-list-item
9
9
  ?selected=${this.value?.hour === hour}
10
- ?data-navigating=${this.navigatingValue.hour === hour}
11
- @navigate=${() => this.navigate.dispatch(this.navigatingValue.with({ hour }))}
10
+ ?data-navigating=${this.navigationDate.hour === hour}
11
+ @navigate=${() => this.navigate.dispatch(this.navigationDate.with({ hour }))}
12
12
  @change=${(e) => !e.selected ? void 0 : this.change.dispatch((this.value ?? new DateTime).with({ hour }))}
13
13
  >${hour.format().padStart(2, this.zero.format())}</mo-selectable-list-item>
14
14
  `)}
@@ -7,8 +7,8 @@ let MinuteList = class MinuteList extends DateList {
7
7
  ${[...range(0, 60)].map(minute => html `
8
8
  <mo-selectable-list-item
9
9
  ?selected=${this.value?.minute === minute}
10
- ?data-navigating=${this.navigatingValue.minute === minute}
11
- @navigate=${() => this.navigate.dispatch(this.navigatingValue.with({ minute }))}
10
+ ?data-navigating=${this.navigationDate.minute === minute}
11
+ @navigate=${() => this.navigate.dispatch(this.navigationDate.with({ minute }))}
12
12
  @change=${(e) => !e.selected ? void 0 : this.change.dispatch((this.value ?? new DateTime).with({ minute }))}
13
13
  >${minute.format().padStart(2, this.zero.format())}</mo-selectable-list-item>
14
14
  `)}
@@ -7,8 +7,8 @@ let SecondList = class SecondList extends DateList {
7
7
  ${[...range(0, 60)].map(second => html `
8
8
  <mo-selectable-list-item
9
9
  ?selected=${this.value?.second === second}
10
- ?data-navigating=${this.navigatingValue.second === second}
11
- @navigate=${() => this.navigate.dispatch(this.navigatingValue.with({ second }))}
10
+ ?data-navigating=${this.navigationDate.second === second}
11
+ @navigate=${() => this.navigate.dispatch(this.navigationDate.with({ second }))}
12
12
  @change=${(e) => !e.selected ? void 0 : this.change.dispatch((this.value ?? new DateTime).with({ second }))}
13
13
  >${second.format().padStart(2, this.zero.format())}</mo-selectable-list-item>
14
14
  `)}