@3mo/date-time-fields 0.0.14 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DateParser.js +21 -21
- package/dist/DateRangeParser.js +6 -6
- package/dist/FieldDate.d.ts +5 -15
- package/dist/FieldDate.d.ts.map +1 -1
- package/dist/FieldDate.js +6 -34
- package/dist/FieldDateRange.d.ts +5 -27
- package/dist/FieldDateRange.d.ts.map +1 -1
- package/dist/FieldDateRange.js +7 -113
- package/dist/FieldDateTime.d.ts +17 -0
- package/dist/FieldDateTime.d.ts.map +1 -0
- package/dist/FieldDateTime.js +36 -0
- package/dist/FieldDateTimeBase.d.ts +50 -0
- package/dist/FieldDateTimeBase.d.ts.map +1 -0
- package/dist/FieldDateTimeBase.js +236 -0
- package/dist/FieldDateTimeRange.d.ts +35 -0
- package/dist/FieldDateTimeRange.d.ts.map +1 -0
- package/dist/FieldDateTimeRange.js +91 -0
- package/dist/FieldTime.d.ts.map +1 -1
- package/dist/FieldTime.js +1 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/selection/DateList.d.ts +17 -0
- package/dist/selection/DateList.d.ts.map +1 -0
- package/dist/selection/DateList.js +68 -0
- package/dist/selection/HourList.d.ts +10 -0
- package/dist/selection/HourList.d.ts.map +1 -0
- package/dist/selection/HourList.js +23 -0
- package/dist/selection/MinuteList.d.ts +10 -0
- package/dist/selection/MinuteList.d.ts.map +1 -0
- package/dist/selection/MinuteList.js +23 -0
- package/dist/selection/MonthList.d.ts +12 -0
- package/dist/selection/MonthList.d.ts.map +1 -0
- package/dist/selection/MonthList.js +38 -0
- package/dist/selection/SecondList.d.ts +10 -0
- package/dist/selection/SecondList.d.ts.map +1 -0
- package/dist/selection/SecondList.js +23 -0
- package/dist/selection/YearList.d.ts +11 -0
- package/dist/selection/YearList.d.ts.map +1 -0
- package/dist/selection/YearList.js +27 -0
- package/dist/selection/calendar/Calendar.d.ts +18 -0
- package/dist/selection/calendar/Calendar.d.ts.map +1 -0
- package/dist/selection/calendar/Calendar.js +123 -0
- package/dist/selection/calendar/SelectableCalendar.d.ts +18 -0
- package/dist/selection/calendar/SelectableCalendar.d.ts.map +1 -0
- package/dist/selection/calendar/SelectableCalendar.js +34 -0
- package/dist/selection/calendar/SelectableRangeCalendar.d.ts +19 -0
- package/dist/selection/calendar/SelectableRangeCalendar.d.ts.map +1 -0
- package/dist/selection/calendar/SelectableRangeCalendar.js +45 -0
- package/dist/selection/calendar/index.d.ts +4 -0
- package/dist/selection/calendar/index.d.ts.map +1 -0
- package/dist/{calendar → selection/calendar}/index.js +1 -1
- package/dist/selection/index.d.ts +7 -0
- package/dist/selection/index.d.ts.map +1 -0
- package/dist/selection/index.js +6 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -7
- package/dist/FieldDateBase.d.ts +0 -29
- package/dist/FieldDateBase.d.ts.map +0 -1
- package/dist/FieldDateBase.js +0 -111
- package/dist/calendar/Calendar.d.ts +0 -30
- package/dist/calendar/Calendar.d.ts.map +0 -1
- package/dist/calendar/Calendar.js +0 -203
- package/dist/calendar/CalendarSelectionAdapter.d.ts +0 -11
- package/dist/calendar/CalendarSelectionAdapter.d.ts.map +0 -1
- package/dist/calendar/CalendarSelectionAdapter.js +0 -11
- package/dist/calendar/SelectableCalendar.d.ts +0 -17
- package/dist/calendar/SelectableCalendar.d.ts.map +0 -1
- package/dist/calendar/SelectableCalendar.js +0 -35
- package/dist/calendar/index.d.ts +0 -4
- package/dist/calendar/index.d.ts.map +0 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { component, html, range } from '@a11d/lit';
|
|
3
|
+
import { DateList } from './DateList.js';
|
|
4
|
+
let SecondList = class SecondList extends DateList {
|
|
5
|
+
get listItemsTemplate() {
|
|
6
|
+
return html `
|
|
7
|
+
${[...range(0, 60)].map(second => {
|
|
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>
|
|
15
|
+
`;
|
|
16
|
+
})}
|
|
17
|
+
`;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
SecondList = __decorate([
|
|
21
|
+
component('mo-second-list')
|
|
22
|
+
], SecondList);
|
|
23
|
+
export { SecondList };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DateList } from './DateList.js';
|
|
2
|
+
export declare class YearList extends DateList {
|
|
3
|
+
private years?;
|
|
4
|
+
protected get listItemsTemplate(): import("lit-html").TemplateResult<1>;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
interface HTMLElementTagNameMap {
|
|
8
|
+
'mo-year-list': YearList;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=YearList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"YearList.d.ts","sourceRoot":"","sources":["../../selection/YearList.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,qBACa,QAAS,SAAQ,QAAQ;IACrC,OAAO,CAAC,KAAK,CAAC,CAAe;IAE7B,cAAuB,iBAAiB,yCAavC;CACD;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,cAAc,EAAE,QAAQ,CAAA;KACxB;CACD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { component, html } from '@a11d/lit';
|
|
3
|
+
import { DateList } from './DateList.js';
|
|
4
|
+
let YearList = class YearList extends DateList {
|
|
5
|
+
get listItemsTemplate() {
|
|
6
|
+
var _a;
|
|
7
|
+
(_a = this.years) !== null && _a !== void 0 ? _a : (this.years = new Array(150)
|
|
8
|
+
.fill(undefined)
|
|
9
|
+
.map((_, i) => this.navigatingValue.year - 100 + i));
|
|
10
|
+
return html `
|
|
11
|
+
${this.years.map(year => {
|
|
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>
|
|
19
|
+
`;
|
|
20
|
+
})}
|
|
21
|
+
`;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
YearList = __decorate([
|
|
25
|
+
component('mo-year-list')
|
|
26
|
+
], YearList);
|
|
27
|
+
export { YearList };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Component, ClassInfo } from '@a11d/lit';
|
|
2
|
+
import '@a11d/array.prototype.group';
|
|
3
|
+
export declare class Calendar extends Component {
|
|
4
|
+
includeWeekNumbers: boolean;
|
|
5
|
+
navigatingValue: import("@3mo/date-time/DateTime.js").DateTime;
|
|
6
|
+
static get styles(): import("@a11d/lit").CSSResult;
|
|
7
|
+
protected get template(): import("lit-html").TemplateResult<1>;
|
|
8
|
+
private rangeOf;
|
|
9
|
+
protected getDayTemplate(day: DateTime): import("lit-html").TemplateResult<1>;
|
|
10
|
+
protected handleDayClick(day: DateTime): void;
|
|
11
|
+
protected getDayElementClasses(day: DateTime): ClassInfo;
|
|
12
|
+
}
|
|
13
|
+
declare global {
|
|
14
|
+
interface HTMLElementTagNameMap {
|
|
15
|
+
'mo-calendar': Calendar;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=Calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../selection/calendar/Calendar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA4D,SAAS,EAAE,MAAM,WAAW,CAAA;AAC1G,OAAO,6BAA6B,CAAA;AAEpC,qBACa,QAAS,SAAQ,SAAS;IACM,kBAAkB,UAAQ;IAC1C,eAAe,gDAAe;IAE1D,WAAoB,MAAM,kCAmDzB;IAED,cAAuB,QAAQ,yCA0B9B;IAED,OAAO,CAAG,OAAO;IAOjB,SAAS,CAAC,cAAc,CAAC,GAAG,EAAE,QAAQ;IAQtC,SAAS,CAAC,cAAc,CAAC,GAAG,EAAE,QAAQ;IAItC,SAAS,CAAC,oBAAoB,CAAC,GAAG,EAAE,QAAQ,GAAG,SAAS;CAQxD;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,aAAa,EAAE,QAAQ,CAAA;KACvB;CACD"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { Component, css, component, html, nothing, property, classMap, style } from '@a11d/lit';
|
|
3
|
+
import '@a11d/array.prototype.group';
|
|
4
|
+
let Calendar = class Calendar extends Component {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.includeWeekNumbers = false;
|
|
8
|
+
this.navigatingValue = new DateTime;
|
|
9
|
+
}
|
|
10
|
+
static get styles() {
|
|
11
|
+
return css `
|
|
12
|
+
:host {
|
|
13
|
+
--mo-calendar-day-size: 36px;
|
|
14
|
+
--mo-calendar-week-number-width: var(--mo-calendar-day-size);
|
|
15
|
+
padding-inline: 10px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.monthHeader {
|
|
19
|
+
color: var(--mo-color-gray);
|
|
20
|
+
align-items: center;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.week {
|
|
24
|
+
color: var(--mo-color-gray);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.day {
|
|
28
|
+
text-align: center;
|
|
29
|
+
border-radius: 100px;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
transition: 100ms;
|
|
32
|
+
font-weight: 500;
|
|
33
|
+
user-select: none;
|
|
34
|
+
font-size: medium;
|
|
35
|
+
width: var(--mo-calendar-day-size);
|
|
36
|
+
-webkit-user-select: none;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.day {
|
|
42
|
+
height: var(--mo-calendar-day-size);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.day:hover {
|
|
46
|
+
background: var(--mo-color-transparent-gray-3);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.day:not(.isInMonth) {
|
|
50
|
+
color: var(--mo-color-gray);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.day.today {
|
|
54
|
+
outline: 2px dashed var(--mo-color-gray-transparent);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.day.navigation {
|
|
58
|
+
background: var(--mo-color-transparent-gray-3);
|
|
59
|
+
}
|
|
60
|
+
`;
|
|
61
|
+
}
|
|
62
|
+
get template() {
|
|
63
|
+
const start = this.navigatingValue.monthStart.weekStart;
|
|
64
|
+
const end = this.navigatingValue.monthEnd.weekEnd;
|
|
65
|
+
const range = [...this.rangeOf(start, end)];
|
|
66
|
+
const weekDaysInMonth = [...range.groupToMap(d => String(d.weekOfYear))]
|
|
67
|
+
.sort(([, dates1], [, dates2]) => { var _a; return ((_a = dates1[0]) === null || _a === void 0 ? void 0 : _a.isBefore(dates2[0])) ? -1 : +1; });
|
|
68
|
+
return html `
|
|
69
|
+
<mo-grid class='month'
|
|
70
|
+
rows='repeat(auto-fill, var(--mo-calendar-day-size))'
|
|
71
|
+
columns=${this.includeWeekNumbers ? 'var(--mo-calendar-week-number-width) repeat(7, var(--mo-calendar-day-size))' : 'repeat(7, var(--mo-calendar-day-size))'}
|
|
72
|
+
${style({ alignItems: 'center', justifyItems: 'center' })}
|
|
73
|
+
>
|
|
74
|
+
${this.includeWeekNumbers === false ? nothing : html `<div></div>`}
|
|
75
|
+
|
|
76
|
+
${this.navigatingValue.weekDayNames.map(dayName => html `
|
|
77
|
+
<div class='monthHeader'>
|
|
78
|
+
${dayName.charAt(0).toUpperCase() + dayName.charAt(1)}
|
|
79
|
+
</div>
|
|
80
|
+
`)}
|
|
81
|
+
|
|
82
|
+
${weekDaysInMonth.map(([weekNumber, days]) => html `
|
|
83
|
+
${this.includeWeekNumbers === false ? nothing : html `<div class='week'>${weekNumber}</div>`}
|
|
84
|
+
${days.map(day => this.getDayTemplate(day))}
|
|
85
|
+
`)}
|
|
86
|
+
</mo-grid>
|
|
87
|
+
`;
|
|
88
|
+
}
|
|
89
|
+
*rangeOf(start, end) {
|
|
90
|
+
while (start.isBefore(end)) {
|
|
91
|
+
yield start;
|
|
92
|
+
start = start.add({ days: 1 });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
getDayTemplate(day) {
|
|
96
|
+
return html `
|
|
97
|
+
<mo-flex class=${classMap(this.getDayElementClasses(day))} @click=${() => this.handleDayClick(day)}>
|
|
98
|
+
${day.format({ day: 'numeric' })}
|
|
99
|
+
</mo-flex>
|
|
100
|
+
`;
|
|
101
|
+
}
|
|
102
|
+
handleDayClick(day) {
|
|
103
|
+
day;
|
|
104
|
+
}
|
|
105
|
+
getDayElementClasses(day) {
|
|
106
|
+
const now = new DateTime();
|
|
107
|
+
return {
|
|
108
|
+
day: true,
|
|
109
|
+
today: now.dayStart.equals(day.dayStart),
|
|
110
|
+
isInMonth: day.month === this.navigatingValue.month
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
__decorate([
|
|
115
|
+
property({ type: Boolean, reflect: true })
|
|
116
|
+
], Calendar.prototype, "includeWeekNumbers", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
property({ type: Object })
|
|
119
|
+
], Calendar.prototype, "navigatingValue", void 0);
|
|
120
|
+
Calendar = __decorate([
|
|
121
|
+
component('mo-calendar')
|
|
122
|
+
], Calendar);
|
|
123
|
+
export { Calendar };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Calendar } from './Calendar.js';
|
|
2
|
+
import { DateTime } from '@3mo/date-time';
|
|
3
|
+
/** @fires change {CustomEvent<T>} */
|
|
4
|
+
export declare class SelectableCalendar extends Calendar {
|
|
5
|
+
readonly change: EventDispatcher<DateTime>;
|
|
6
|
+
value?: DateTime;
|
|
7
|
+
static get styles(): import("@a11d/lit").CSSResult;
|
|
8
|
+
protected handleDayClick(day: DateTime): void;
|
|
9
|
+
protected getDayElementClasses(day: DateTime): {
|
|
10
|
+
selected: boolean;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
declare global {
|
|
14
|
+
interface HTMLElementTagNameMap {
|
|
15
|
+
'mo-selectable-calendar': SelectableCalendar;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=SelectableCalendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectableCalendar.d.ts","sourceRoot":"","sources":["../../../selection/calendar/SelectableCalendar.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,qCAAqC;AACrC,qBACa,kBAAmB,SAAQ,QAAQ;IACtC,QAAQ,CAAC,MAAM,EAAG,eAAe,CAAC,QAAQ,CAAC,CAAA;IAExB,KAAK,CAAC,EAAE,QAAQ,CAAA;IAE5C,WAAoB,MAAM,kCASzB;cAEkB,cAAc,CAAC,GAAG,EAAE,QAAQ;cAK5B,oBAAoB,CAAC,GAAG,EAAE,QAAQ;;;CAMrD;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,wBAAwB,EAAE,kBAAkB,CAAA;KAC5C;CACD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { component, css, event, property } from '@a11d/lit';
|
|
3
|
+
import { Calendar } from './Calendar.js';
|
|
4
|
+
/** @fires change {CustomEvent<T>} */
|
|
5
|
+
let SelectableCalendar = class SelectableCalendar extends Calendar {
|
|
6
|
+
static get styles() {
|
|
7
|
+
return css `
|
|
8
|
+
${super.styles}
|
|
9
|
+
|
|
10
|
+
.day.selected {
|
|
11
|
+
background: var(--mo-color-accent-transparent);
|
|
12
|
+
color: var(--mo-color-accent) !important;
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
}
|
|
16
|
+
handleDayClick(day) {
|
|
17
|
+
this.value = day;
|
|
18
|
+
this.change.dispatch(day);
|
|
19
|
+
}
|
|
20
|
+
getDayElementClasses(day) {
|
|
21
|
+
var _a;
|
|
22
|
+
return Object.assign(Object.assign({}, super.getDayElementClasses(day)), { selected: !!this.value && day.dayStart.equals((_a = this.value) === null || _a === void 0 ? void 0 : _a.dayStart) });
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
__decorate([
|
|
26
|
+
event()
|
|
27
|
+
], SelectableCalendar.prototype, "change", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
property({ type: Object })
|
|
30
|
+
], SelectableCalendar.prototype, "value", void 0);
|
|
31
|
+
SelectableCalendar = __decorate([
|
|
32
|
+
component('mo-selectable-calendar')
|
|
33
|
+
], SelectableCalendar);
|
|
34
|
+
export { SelectableCalendar };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DateTime } from '@3mo/date-time';
|
|
2
|
+
import { SelectableCalendar } from './SelectableCalendar.js';
|
|
3
|
+
/** @fires change {CustomEvent<T>} */
|
|
4
|
+
export declare class SelectableRangeCalendar extends SelectableCalendar {
|
|
5
|
+
dateRange?: DateTimeRange;
|
|
6
|
+
static get styles(): import("@a11d/lit").CSSResult;
|
|
7
|
+
protected getDayElementClasses(day: DateTime): {
|
|
8
|
+
isInRange: boolean;
|
|
9
|
+
first: boolean;
|
|
10
|
+
last: boolean;
|
|
11
|
+
selected: boolean;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
declare global {
|
|
15
|
+
interface HTMLElementTagNameMap {
|
|
16
|
+
'mo-selectable-range-calendar': SelectableRangeCalendar;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=SelectableRangeCalendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectableRangeCalendar.d.ts","sourceRoot":"","sources":["../../../selection/calendar/SelectableRangeCalendar.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAE5D,qCAAqC;AACrC,qBACa,uBAAwB,SAAQ,kBAAkB;IAClC,SAAS,CAAC,EAAE,aAAa,CAAA;IAErD,WAAoB,MAAM,kCAwBzB;cAEkB,oBAAoB,CAAC,GAAG,EAAE,QAAQ;;;;;;CAWrD;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,8BAA8B,EAAE,uBAAuB,CAAA;KACvD;CACD"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { component, css, property } from '@a11d/lit';
|
|
3
|
+
import { SelectableCalendar } from './SelectableCalendar.js';
|
|
4
|
+
/** @fires change {CustomEvent<T>} */
|
|
5
|
+
let SelectableRangeCalendar = class SelectableRangeCalendar extends SelectableCalendar {
|
|
6
|
+
static get styles() {
|
|
7
|
+
return css `
|
|
8
|
+
${super.styles}
|
|
9
|
+
|
|
10
|
+
.day.isInRange:not(.selected) {
|
|
11
|
+
background: rgba(var(--mo-color-accent-base), 0.08);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.day.isInRange {
|
|
15
|
+
border-radius: 0px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.day.selected.first {
|
|
19
|
+
border-radius: 100px 0 0 100px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.day.selected.last {
|
|
23
|
+
border-radius: 0 100px 100px 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.day.selected.first.last {
|
|
27
|
+
border-radius: 100px;
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
}
|
|
31
|
+
getDayElementClasses(day) {
|
|
32
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
33
|
+
const first = (_c = (_b = (_a = this.dateRange) === null || _a === void 0 ? void 0 : _a.start) === null || _b === void 0 ? void 0 : _b.dayStart.equals(day.dayStart)) !== null && _c !== void 0 ? _c : false;
|
|
34
|
+
const last = (_f = (_e = (_d = this.dateRange) === null || _d === void 0 ? void 0 : _d.end) === null || _e === void 0 ? void 0 : _e.dayStart.equals(day.dayStart)) !== null && _f !== void 0 ? _f : false;
|
|
35
|
+
return Object.assign(Object.assign({}, super.getDayElementClasses(day)), { isInRange: (_h = (_g = this.dateRange) === null || _g === void 0 ? void 0 : _g.includes(day)) !== null && _h !== void 0 ? _h : false, first,
|
|
36
|
+
last, selected: first || last });
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
__decorate([
|
|
40
|
+
property({ type: Object })
|
|
41
|
+
], SelectableRangeCalendar.prototype, "dateRange", void 0);
|
|
42
|
+
SelectableRangeCalendar = __decorate([
|
|
43
|
+
component('mo-selectable-range-calendar')
|
|
44
|
+
], SelectableRangeCalendar);
|
|
45
|
+
export { SelectableRangeCalendar };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../selection/calendar/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,yBAAyB,CAAA;AACvC,cAAc,8BAA8B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../selection/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA"}
|