@3mo/date-time-fields 0.1.2 → 0.1.3

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 CHANGED
@@ -1,3 +1,3 @@
1
- # Date Time Fields
2
-
1
+ # Date Time Fields
2
+
3
3
  A set of date-time related fields.
@@ -7,12 +7,12 @@ let FieldDateTime = class FieldDateTime extends FieldDateTimeBase {
7
7
  get navigatingDate() { return this.value ? new DateTime(this.value) : new DateTime(); }
8
8
  get selectedDate() { return this.value ? new DateTime(this.value) : undefined; }
9
9
  get calendarTemplate() {
10
- return html `
11
- <mo-selectable-calendar
12
- .navigatingValue=${this.navigatingDate}
13
- .value=${this.selectedDate}
14
- @change=${(e) => this.handleSelectedDateChange(e.detail, "day" /* FieldDateTimePrecision.Day */)}
15
- ></mo-selectable-calendar>
10
+ return html `
11
+ <mo-selectable-calendar
12
+ .navigatingValue=${this.navigatingDate}
13
+ .value=${this.selectedDate}
14
+ @change=${(e) => this.handleSelectedDateChange(e.detail, "day" /* FieldDateTimePrecision.Day */)}
15
+ ></mo-selectable-calendar>
16
16
  `;
17
17
  }
18
18
  handleSelectedDateChange(date, precision) {
@@ -59,107 +59,107 @@ export class FieldDateTimeBase extends InputFieldComponent {
59
59
  return super.isActive || this.open;
60
60
  }
61
61
  static get styles() {
62
- return css `
63
- ${super.styles}
64
-
65
- :host {
66
- position: relative;
67
- }
68
-
69
- mo-popover {
70
- background: var(--mo-color-background);
71
- box-shadow: var(--mo-shadow);
72
- border-radius: var(--mo-border-radius);
73
- color: var(--mo-color-foreground);
74
- }
75
-
76
- #selector {
77
- min-height: 175px;
78
- }
79
-
80
- .timezone {
81
- padding: 3px;
82
- font-size: small;
83
- text-align: end;
84
- font-weight: 500;
85
- color: var(--mo-color-gray);
86
- }
62
+ return css `
63
+ ${super.styles}
64
+
65
+ :host {
66
+ position: relative;
67
+ }
68
+
69
+ mo-popover {
70
+ background: var(--mo-color-background);
71
+ box-shadow: var(--mo-shadow);
72
+ border-radius: var(--mo-border-radius);
73
+ color: var(--mo-color-foreground);
74
+ }
75
+
76
+ #selector {
77
+ min-height: 175px;
78
+ }
79
+
80
+ .timezone {
81
+ padding: 3px;
82
+ font-size: small;
83
+ text-align: end;
84
+ font-weight: 500;
85
+ color: var(--mo-color-gray);
86
+ }
87
87
  `;
88
88
  }
89
89
  get template() {
90
- return html `
91
- ${super.template}
92
- ${this.popoverTemplate}
90
+ return html `
91
+ ${super.template}
92
+ ${this.popoverTemplate}
93
93
  `;
94
94
  }
95
95
  get endSlotTemplate() {
96
- return html `
97
- ${super.endSlotTemplate}
98
- ${this.calendarIconButtonTemplate}
96
+ return html `
97
+ ${super.endSlotTemplate}
98
+ ${this.calendarIconButtonTemplate}
99
99
  `;
100
100
  }
101
101
  get inputTemplate() {
102
- return html `
103
- <input
104
- part='input'
105
- ?readonly=${this.readonly}
106
- ?required=${this.required}
107
- ?disabled=${this.disabled}
108
- .value=${live(this.inputStringValue || '')}
109
- @input=${(e) => this.handleInput(this.inputValueToValue(this.inputElement.value || ''), e)}
110
- @change=${(e) => this.handleChange(this.inputValueToValue(this.inputElement.value || ''), e)}
111
- >
102
+ return html `
103
+ <input
104
+ part='input'
105
+ ?readonly=${this.readonly}
106
+ ?required=${this.required}
107
+ ?disabled=${this.disabled}
108
+ .value=${live(this.inputStringValue || '')}
109
+ @input=${(e) => this.handleInput(this.inputValueToValue(this.inputElement.value || ''), e)}
110
+ @change=${(e) => this.handleChange(this.inputValueToValue(this.inputElement.value || ''), e)}
111
+ >
112
112
  `;
113
113
  }
114
114
  get calendarIconButtonTemplate() {
115
- return this.hideDatePicker ? nothing : html `
116
- <mo-icon-button tabindex='-1' dense slot='end'
117
- icon=${this.calendarIconButtonIcon}
118
- ${style({ color: this.isActive ? 'var(--mo-color-accent)' : 'var(--mo-color-gray)' })}
119
- @click=${() => this.open = !this.open}>
120
- </mo-icon-button>
115
+ return this.hideDatePicker ? nothing : html `
116
+ <mo-icon-button tabindex='-1' dense slot='end'
117
+ icon=${this.calendarIconButtonIcon}
118
+ ${style({ color: this.isActive ? 'var(--mo-color-accent)' : 'var(--mo-color-gray)' })}
119
+ @click=${() => this.open = !this.open}>
120
+ </mo-icon-button>
121
121
  `;
122
122
  }
123
123
  get popoverTemplate() {
124
- return this.hideDatePicker ? nothing : html `
125
- <mo-popover tabindex='-1' fixed openOnFocus
126
- .anchor=${this}
127
- ?open=${this.open}
128
- @openChange=${(e) => this.open = e.detail}
129
- >${cache(!this.open ? nothing : this.popoverContentTemplate)}</mo-popover>
124
+ return this.hideDatePicker ? nothing : html `
125
+ <mo-popover tabindex='-1' fixed openOnFocus
126
+ .anchor=${this}
127
+ ?open=${this.open}
128
+ @openChange=${(e) => this.open = e.detail}
129
+ >${cache(!this.open ? nothing : this.popoverContentTemplate)}</mo-popover>
130
130
  `;
131
131
  }
132
132
  get popoverContentTemplate() {
133
- return html `
134
- <mo-flex id='selector' direction='horizontal' style='height: 100%'>
135
- ${this.dateTemplate}
136
- ${this.timeTemplate}
137
- </mo-flex>
133
+ return html `
134
+ <mo-flex id='selector' direction='horizontal' style='height: 100%'>
135
+ ${this.dateTemplate}
136
+ ${this.timeTemplate}
137
+ </mo-flex>
138
138
  `;
139
139
  }
140
140
  get dateTemplate() {
141
- return html `
142
- ${this.yearListTemplate}
143
- ${this.monthListTemplate}
144
- ${this.dayTemplate}
141
+ return html `
142
+ ${this.yearListTemplate}
143
+ ${this.monthListTemplate}
144
+ ${this.dayTemplate}
145
145
  `;
146
146
  }
147
147
  get yearListTemplate() {
148
- return html `
149
- <mo-year-list
150
- .navigatingValue=${this.navigatingDate}
151
- .value=${this.selectedDate}
152
- @change=${(e) => this.handleSelectedDateChange(e.detail, "year" /* FieldDateTimePrecision.Year */)}
153
- ></mo-year-list>
148
+ return html `
149
+ <mo-year-list
150
+ .navigatingValue=${this.navigatingDate}
151
+ .value=${this.selectedDate}
152
+ @change=${(e) => this.handleSelectedDateChange(e.detail, "year" /* FieldDateTimePrecision.Year */)}
153
+ ></mo-year-list>
154
154
  `;
155
155
  }
156
156
  get monthListTemplate() {
157
- return ["year" /* FieldDateTimePrecision.Year */].includes(this.precision) ? nothing : html `
158
- <mo-month-list
159
- .navigatingValue=${this.navigatingDate}
160
- .value=${this.selectedDate}
161
- @change=${(e) => this.handleSelectedDateChange(e.detail, "month" /* FieldDateTimePrecision.Month */)}
162
- ></mo-month-list>
157
+ return ["year" /* FieldDateTimePrecision.Year */].includes(this.precision) ? nothing : html `
158
+ <mo-month-list
159
+ .navigatingValue=${this.navigatingDate}
160
+ .value=${this.selectedDate}
161
+ @change=${(e) => this.handleSelectedDateChange(e.detail, "month" /* FieldDateTimePrecision.Month */)}
162
+ ></mo-month-list>
163
163
  `;
164
164
  }
165
165
  get dayTemplate() {
@@ -167,45 +167,45 @@ export class FieldDateTimeBase extends InputFieldComponent {
167
167
  }
168
168
  get timeTemplate() {
169
169
  var _a, _b, _c, _d;
170
- return ["year" /* FieldDateTimePrecision.Year */, "month" /* FieldDateTimePrecision.Month */, "day" /* FieldDateTimePrecision.Day */].includes(this.precision) ? nothing : html `
171
- <mo-flex gap='6px'>
172
- <div class='timezone'>
173
- ${(_b = (_a = this.navigatingDate) === null || _a === void 0 ? void 0 : _a.formatToParts({ timeZoneName: 'long' }).find(x => x.type === 'timeZoneName')) === null || _b === void 0 ? void 0 : _b.value}
174
- (${(_d = (_c = this.navigatingDate) === null || _c === void 0 ? void 0 : _c.formatToParts({ timeZoneName: 'shortOffset' }).find(x => x.type === 'timeZoneName')) === null || _d === void 0 ? void 0 : _d.value})
175
- </div>
176
- <mo-flex direction='horizontal' style='flex: 1'>
177
- ${this.hourListTemplate}
178
- ${this.minuteListTemplate}
179
- ${this.secondListTemplate}
180
- </mo-flex>
181
- </mo-flex>
170
+ return ["year" /* FieldDateTimePrecision.Year */, "month" /* FieldDateTimePrecision.Month */, "day" /* FieldDateTimePrecision.Day */].includes(this.precision) ? nothing : html `
171
+ <mo-flex gap='6px'>
172
+ <div class='timezone'>
173
+ ${(_b = (_a = this.navigatingDate) === null || _a === void 0 ? void 0 : _a.formatToParts({ timeZoneName: 'long' }).find(x => x.type === 'timeZoneName')) === null || _b === void 0 ? void 0 : _b.value}
174
+ (${(_d = (_c = this.navigatingDate) === null || _c === void 0 ? void 0 : _c.formatToParts({ timeZoneName: 'shortOffset' }).find(x => x.type === 'timeZoneName')) === null || _d === void 0 ? void 0 : _d.value})
175
+ </div>
176
+ <mo-flex direction='horizontal' style='flex: 1'>
177
+ ${this.hourListTemplate}
178
+ ${this.minuteListTemplate}
179
+ ${this.secondListTemplate}
180
+ </mo-flex>
181
+ </mo-flex>
182
182
  `;
183
183
  }
184
184
  get hourListTemplate() {
185
- return html `
186
- <mo-hour-list style='flex: 1'
187
- .navigatingValue=${this.navigatingDate}
188
- .value=${this.selectedDate}
189
- @change=${(e) => this.handleSelectedDateChange(e.detail, "hour" /* FieldDateTimePrecision.Hour */)}
190
- ></mo-hour-list>
185
+ return html `
186
+ <mo-hour-list style='flex: 1'
187
+ .navigatingValue=${this.navigatingDate}
188
+ .value=${this.selectedDate}
189
+ @change=${(e) => this.handleSelectedDateChange(e.detail, "hour" /* FieldDateTimePrecision.Hour */)}
190
+ ></mo-hour-list>
191
191
  `;
192
192
  }
193
193
  get minuteListTemplate() {
194
- return ["hour" /* FieldDateTimePrecision.Hour */].includes(this.precision) ? nothing : html `
195
- <mo-minute-list style='flex: 1'
196
- .navigatingValue=${this.navigatingDate}
197
- .value=${this.selectedDate}
198
- @change=${(e) => this.handleSelectedDateChange(e.detail, "minute" /* FieldDateTimePrecision.Minute */)}
199
- ></mo-minute-list>
194
+ return ["hour" /* FieldDateTimePrecision.Hour */].includes(this.precision) ? nothing : html `
195
+ <mo-minute-list style='flex: 1'
196
+ .navigatingValue=${this.navigatingDate}
197
+ .value=${this.selectedDate}
198
+ @change=${(e) => this.handleSelectedDateChange(e.detail, "minute" /* FieldDateTimePrecision.Minute */)}
199
+ ></mo-minute-list>
200
200
  `;
201
201
  }
202
202
  get secondListTemplate() {
203
- return ["hour" /* FieldDateTimePrecision.Hour */, "minute" /* FieldDateTimePrecision.Minute */].includes(this.precision) ? nothing : html `
204
- <mo-second-list style='flex: 1'
205
- .navigatingValue=${this.navigatingDate}
206
- .value=${this.selectedDate}
207
- @change=${(e) => this.handleSelectedDateChange(e.detail, "second" /* FieldDateTimePrecision.Second */)}
208
- ></mo-second-list>
203
+ return ["hour" /* FieldDateTimePrecision.Hour */, "minute" /* FieldDateTimePrecision.Minute */].includes(this.precision) ? nothing : html `
204
+ <mo-second-list style='flex: 1'
205
+ .navigatingValue=${this.navigatingDate}
206
+ .value=${this.selectedDate}
207
+ @change=${(e) => this.handleSelectedDateChange(e.detail, "second" /* FieldDateTimePrecision.Second */)}
208
+ ></mo-second-list>
209
209
  `;
210
210
  }
211
211
  handleSelectedDateChange(date, precision) {
@@ -20,43 +20,43 @@ let FieldDateTimeRange = class FieldDateTimeRange extends FieldDateTimeBase {
20
20
  get navigatingDate() { var _a, _b, _c; return (_c = (this.selection === "start" /* FieldDateRangeSelection.Start */ ? (_a = this.value) === null || _a === void 0 ? void 0 : _a.start : (_b = this.value) === null || _b === void 0 ? void 0 : _b.end)) !== null && _c !== void 0 ? _c : new DateTime(); }
21
21
  get selectedDate() { var _a, _b; return this.selection === "start" /* FieldDateRangeSelection.Start */ ? (_a = this.value) === null || _a === void 0 ? void 0 : _a.start : (_b = this.value) === null || _b === void 0 ? void 0 : _b.end; }
22
22
  static get styles() {
23
- return css `
24
- ${super.styles}
25
-
26
- mo-tab-bar {
27
- max-width: 200px;
28
- place-self: center;
29
- padding-block: 4px;
30
- }
31
-
32
- mo-tab {
33
- --mdc-tab-height: 40px;
34
- }
35
-
36
- mo-tab:not([active]) {
37
- opacity: 0.5;
38
- }
23
+ return css `
24
+ ${super.styles}
25
+
26
+ mo-tab-bar {
27
+ max-width: 200px;
28
+ place-self: center;
29
+ padding-block: 4px;
30
+ }
31
+
32
+ mo-tab {
33
+ --mdc-tab-height: 40px;
34
+ }
35
+
36
+ mo-tab:not([active]) {
37
+ opacity: 0.5;
38
+ }
39
39
  `;
40
40
  }
41
41
  get calendarTemplate() {
42
- return html `
43
- <mo-selectable-range-calendar
44
- .navigatingValue=${this.navigatingDate}
45
- .dateRange=${this.value}
46
- @change=${(e) => this.handleSelectedDateChange(e.detail, "day" /* FieldDateTimePrecision.Day */)}
47
- ></mo-selectable-range-calendar>
42
+ return html `
43
+ <mo-selectable-range-calendar
44
+ .navigatingValue=${this.navigatingDate}
45
+ .dateRange=${this.value}
46
+ @change=${(e) => this.handleSelectedDateChange(e.detail, "day" /* FieldDateTimePrecision.Day */)}
47
+ ></mo-selectable-range-calendar>
48
48
  `;
49
49
  }
50
50
  get popoverContentTemplate() {
51
- return html `
52
- <mo-flex>
53
- <mo-tab-bar value=${this.selection} @change=${(e) => this.selection = e.detail}>
54
- <mo-tab value=${"start" /* FieldDateRangeSelection.Start */} label=${t('Start')}></mo-tab>
55
- <mo-tab value=${"end" /* FieldDateRangeSelection.End */} label=${t('End')}></mo-tab>
56
- </mo-tab-bar>
57
- </mo-flex>
58
-
59
- ${super.popoverContentTemplate}
51
+ return html `
52
+ <mo-flex>
53
+ <mo-tab-bar value=${this.selection} @change=${(e) => this.selection = e.detail}>
54
+ <mo-tab value=${"start" /* FieldDateRangeSelection.Start */} label=${t('Start')}></mo-tab>
55
+ <mo-tab value=${"end" /* FieldDateRangeSelection.End */} label=${t('End')}></mo-tab>
56
+ </mo-tab-bar>
57
+ </mo-flex>
58
+
59
+ ${super.popoverContentTemplate}
60
60
  `;
61
61
  }
62
62
  handleSelectedDateChange(date, precision) {
package/dist/FieldTime.js CHANGED
@@ -8,9 +8,9 @@ let FieldTime = class FieldTime extends FieldText {
8
8
  this.inputType = 'time';
9
9
  }
10
10
  get startSlotTemplate() {
11
- return html `
12
- <mo-icon slot='start' @click=${() => this.focus()} icon='schedule' ${style({ color: 'var(--mo-color-gray)' })}></mo-icon>
13
- ${super.startSlotTemplate}
11
+ return html `
12
+ <mo-icon slot='start' @click=${() => this.focus()} icon='schedule' ${style({ color: 'var(--mo-color-gray)' })}></mo-icon>
13
+ ${super.startSlotTemplate}
14
14
  `;
15
15
  }
16
16
  };
@@ -14,36 +14,36 @@ export class DateList extends Component {
14
14
  }
15
15
  get now() { return new DateTime(); }
16
16
  static get styles() {
17
- return css `
18
- mo-scroller {
19
- min-width: 70px;
20
- }
21
-
22
- .pad {
23
- height: 50px;
24
- }
25
-
26
- mo-selectable-list-item {
27
- height: 32px;
28
- }
29
-
30
- mo-selectable-list-item[data-now] {
31
- outline: 2px dashed var(--mo-color-gray-transparent);
32
- }
17
+ return css `
18
+ mo-scroller {
19
+ min-width: 70px;
20
+ }
21
+
22
+ .pad {
23
+ height: 50px;
24
+ }
25
+
26
+ mo-selectable-list-item {
27
+ height: 32px;
28
+ }
29
+
30
+ mo-selectable-list-item[data-now] {
31
+ outline: 2px dashed var(--mo-color-gray-transparent);
32
+ }
33
33
  `;
34
34
  }
35
35
  connected() {
36
36
  this.scrollIntoSelectedItem();
37
37
  }
38
38
  get template() {
39
- return this.navigatingValue === undefined ? nothing : html `
40
- <mo-scroller @pointerenter=${() => this.preventIntervalScrolling = true} @pointerleave=${() => this.preventIntervalScrolling = false}>
41
- <mo-selectable-list @change=${() => this.scrollIntoSelectedItem()}>
42
- <div class='pad'></div>
43
- ${this.listItemsTemplate}
44
- <div class='pad'></div>
45
- </mo-selectable-list>
46
- </mo-scroller>
39
+ return this.navigatingValue === undefined ? nothing : html `
40
+ <mo-scroller @pointerenter=${() => this.preventIntervalScrolling = true} @pointerleave=${() => this.preventIntervalScrolling = false}>
41
+ <mo-selectable-list @change=${() => this.scrollIntoSelectedItem()}>
42
+ <div class='pad'></div>
43
+ ${this.listItemsTemplate}
44
+ <div class='pad'></div>
45
+ </mo-selectable-list>
46
+ </mo-scroller>
47
47
  `;
48
48
  }
49
49
  async scrollIntoSelectedItem() {
@@ -3,17 +3,17 @@ import { component, html, range } from '@a11d/lit';
3
3
  import { DateList } from './DateList.js';
4
4
  let HourList = class HourList extends DateList {
5
5
  get listItemsTemplate() {
6
- return html `
6
+ return html `
7
7
  ${[...range(0, this.navigatingValue.hoursInDay)].map(hour => {
8
8
  var _a;
9
- return html `
10
- <mo-selectable-list-item
11
- ?selected=${((_a = this.value) === null || _a === void 0 ? void 0 : _a.hour) === hour}
12
- ?data-now=${this.now.hour === hour}
13
- @change=${(e) => { var _a; return !e.selected ? void 0 : this.change.dispatch(((_a = this.value) !== null && _a !== void 0 ? _a : new DateTime).with({ hour })); }}
14
- >${hour.format().padStart(2, 0.0.format())}</mo-selectable-list-item>
9
+ return html `
10
+ <mo-selectable-list-item
11
+ ?selected=${((_a = this.value) === null || _a === void 0 ? void 0 : _a.hour) === hour}
12
+ ?data-now=${this.now.hour === hour}
13
+ @change=${(e) => { var _a; return !e.selected ? void 0 : this.change.dispatch(((_a = this.value) !== null && _a !== void 0 ? _a : new DateTime).with({ hour })); }}
14
+ >${hour.format().padStart(2, 0.0.format())}</mo-selectable-list-item>
15
15
  `;
16
- })}
16
+ })}
17
17
  `;
18
18
  }
19
19
  };
@@ -3,17 +3,17 @@ import { component, html, range } from '@a11d/lit';
3
3
  import { DateList } from './DateList.js';
4
4
  let MinuteList = class MinuteList extends DateList {
5
5
  get listItemsTemplate() {
6
- return html `
6
+ return html `
7
7
  ${[...range(0, 60)].map(minute => {
8
8
  var _a;
9
- return html `
10
- <mo-selectable-list-item
11
- ?selected=${((_a = this.value) === null || _a === void 0 ? void 0 : _a.minute) === minute}
12
- ?data-now=${this.now.minute === minute}
13
- @change=${(e) => { var _a; return !e.selected ? void 0 : this.change.dispatch(((_a = this.value) !== null && _a !== void 0 ? _a : new DateTime).with({ minute })); }}
14
- >${minute.format().padStart(2, 0.0.format())}</mo-selectable-list-item>
9
+ return html `
10
+ <mo-selectable-list-item
11
+ ?selected=${((_a = this.value) === null || _a === void 0 ? void 0 : _a.minute) === minute}
12
+ ?data-now=${this.now.minute === minute}
13
+ @change=${(e) => { var _a; return !e.selected ? void 0 : this.change.dispatch(((_a = this.value) !== null && _a !== void 0 ? _a : new DateTime).with({ minute })); }}
14
+ >${minute.format().padStart(2, 0.0.format())}</mo-selectable-list-item>
15
15
  `;
16
- })}
16
+ })}
17
17
  `;
18
18
  }
19
19
  };
@@ -3,12 +3,12 @@ import { component, css, html } from '@a11d/lit';
3
3
  import { DateList } from './DateList.js';
4
4
  let MonthList = class MonthList extends DateList {
5
5
  static get styles() {
6
- return css `
7
- ${super.styles}
8
-
9
- mo-scroller {
10
- min-width: 125px;
11
- }
6
+ return css `
7
+ ${super.styles}
8
+
9
+ mo-scroller {
10
+ min-width: 125px;
11
+ }
12
12
  `;
13
13
  }
14
14
  get monthNames() {
@@ -18,17 +18,17 @@ let MonthList = class MonthList extends DateList {
18
18
  .map(date => [date.month, date.format({ month: 'long' })]);
19
19
  }
20
20
  get listItemsTemplate() {
21
- return html `
21
+ return html `
22
22
  ${this.monthNames.map(([month, name]) => {
23
23
  var _a;
24
- return html `
25
- <mo-selectable-list-item
26
- ?selected=${((_a = this.value) === null || _a === void 0 ? void 0 : _a.month) === month}
27
- ?data-now=${this.now.month === month}
28
- @change=${(e) => { var _a; return !e.selected ? void 0 : this.change.dispatch(((_a = this.value) !== null && _a !== void 0 ? _a : new DateTime).with({ month })); }}
29
- >${name}</mo-selectable-list-item>
24
+ return html `
25
+ <mo-selectable-list-item
26
+ ?selected=${((_a = this.value) === null || _a === void 0 ? void 0 : _a.month) === month}
27
+ ?data-now=${this.now.month === month}
28
+ @change=${(e) => { var _a; return !e.selected ? void 0 : this.change.dispatch(((_a = this.value) !== null && _a !== void 0 ? _a : new DateTime).with({ month })); }}
29
+ >${name}</mo-selectable-list-item>
30
30
  `;
31
- })}
31
+ })}
32
32
  `;
33
33
  }
34
34
  };
@@ -3,17 +3,17 @@ import { component, html, range } from '@a11d/lit';
3
3
  import { DateList } from './DateList.js';
4
4
  let SecondList = class SecondList extends DateList {
5
5
  get listItemsTemplate() {
6
- return html `
6
+ return html `
7
7
  ${[...range(0, 60)].map(second => {
8
8
  var _a;
9
- return html `
10
- <mo-selectable-list-item
11
- ?selected=${((_a = this.value) === null || _a === void 0 ? void 0 : _a.second) === second}
12
- ?data-now=${this.now.second === second}
13
- @change=${(e) => { var _a; return !e.selected ? void 0 : this.change.dispatch(((_a = this.value) !== null && _a !== void 0 ? _a : new DateTime).with({ second })); }}
14
- >${second.format().padStart(2, 0.0.format())}</mo-selectable-list-item>
9
+ return html `
10
+ <mo-selectable-list-item
11
+ ?selected=${((_a = this.value) === null || _a === void 0 ? void 0 : _a.second) === second}
12
+ ?data-now=${this.now.second === second}
13
+ @change=${(e) => { var _a; return !e.selected ? void 0 : this.change.dispatch(((_a = this.value) !== null && _a !== void 0 ? _a : new DateTime).with({ second })); }}
14
+ >${second.format().padStart(2, 0.0.format())}</mo-selectable-list-item>
15
15
  `;
16
- })}
16
+ })}
17
17
  `;
18
18
  }
19
19
  };
@@ -7,17 +7,17 @@ let YearList = class YearList extends DateList {
7
7
  (_a = this.years) !== null && _a !== void 0 ? _a : (this.years = new Array(150)
8
8
  .fill(undefined)
9
9
  .map((_, i) => this.navigatingValue.year - 100 + i));
10
- return html `
10
+ return html `
11
11
  ${this.years.map(year => {
12
12
  var _a;
13
- return html `
14
- <mo-selectable-list-item
15
- ?selected=${((_a = this.value) === null || _a === void 0 ? void 0 : _a.year) === year}
16
- ?data-now=${this.now.year === year}
17
- @change=${(e) => !e.selected || !this.value ? void 0 : this.change.dispatch(this.value.with({ year }))}
18
- >${year.format()}</mo-selectable-list-item>
13
+ return html `
14
+ <mo-selectable-list-item
15
+ ?selected=${((_a = this.value) === null || _a === void 0 ? void 0 : _a.year) === year}
16
+ ?data-now=${this.now.year === year}
17
+ @change=${(e) => !e.selected || !this.value ? void 0 : this.change.dispatch(this.value.with({ year }))}
18
+ >${year.format()}</mo-selectable-list-item>
19
19
  `;
20
- })}
20
+ })}
21
21
  `;
22
22
  }
23
23
  };