@3mo/date-time-fields 0.5.12-preview.1 → 0.6.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/FieldDateTime.d.ts +1 -1
- package/dist/FieldDateTime.d.ts.map +1 -1
- package/dist/FieldDateTime.js +3 -1
- package/dist/FieldDateTimeBase.d.ts +4 -4
- package/dist/FieldDateTimeBase.d.ts.map +1 -1
- package/dist/FieldDateTimeBase.js +19 -141
- package/dist/FieldDateTimeRange.d.ts +1 -1
- package/dist/FieldDateTimeRange.d.ts.map +1 -1
- package/dist/FieldDateTimeRange.js +9 -6
- package/dist/custom-elements.json +2319 -8
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/selection/DateList.d.ts +10 -7
- package/dist/selection/DateList.d.ts.map +1 -1
- package/dist/selection/DateList.js +68 -27
- package/dist/selection/HourList.d.ts.map +1 -1
- package/dist/selection/HourList.js +2 -1
- package/dist/selection/MinuteList.d.ts.map +1 -1
- package/dist/selection/MinuteList.js +2 -1
- package/dist/selection/MonthList.d.ts.map +1 -1
- package/dist/selection/MonthList.js +2 -1
- package/dist/selection/SecondList.d.ts.map +1 -1
- package/dist/selection/SecondList.js +2 -1
- package/dist/selection/YearList.js +2 -2
- package/dist/selection/calendar/Calendar.d.ts.map +1 -1
- package/dist/selection/calendar/Calendar.js +36 -21
- package/dist/selection/calendar/SelectableRangeCalendar.d.ts.map +1 -1
- package/dist/selection/calendar/SelectableRangeCalendar.js +23 -22
- package/dist/selection/index.d.ts +0 -2
- package/dist/selection/index.d.ts.map +1 -1
- package/dist/selection/index.js +0 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/selection/FieldSelectMonth.d.ts +0 -17
- package/dist/selection/FieldSelectMonth.d.ts.map +0 -1
- package/dist/selection/FieldSelectMonth.js +0 -54
- package/dist/selection/FieldSelectYear.d.ts +0 -18
- package/dist/selection/FieldSelectYear.d.ts.map +0 -1
- package/dist/selection/FieldSelectYear.js +0 -52
package/package.json
CHANGED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { FieldSelect } from '@3mo/select-field';
|
|
2
|
-
export declare class FieldSelectMonth extends FieldSelect<string> {
|
|
3
|
-
navigatingDate: DateTime;
|
|
4
|
-
readonly optionsNodes: Array<HTMLElement>;
|
|
5
|
-
private get selectedMonthNode();
|
|
6
|
-
open: boolean;
|
|
7
|
-
readonly label: string;
|
|
8
|
-
readonly searchable = true;
|
|
9
|
-
private get monthNames();
|
|
10
|
-
protected get optionsTemplate(): import("lit-html").HTMLTemplateResult;
|
|
11
|
-
}
|
|
12
|
-
declare global {
|
|
13
|
-
interface HTMLElementTagNameMap {
|
|
14
|
-
'mo-field-month': FieldSelectMonth;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=FieldSelectMonth.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FieldSelectMonth.d.ts","sourceRoot":"","sources":["../../selection/FieldSelectMonth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAO/C,qBACa,gBAAiB,SAAQ,WAAW,CAAC,MAAM,CAAC;IAC5B,cAAc,EAAG,QAAQ,CAAA;IAE9B,QAAQ,CAAC,YAAY,EAAG,KAAK,CAAC,WAAW,CAAC,CAAA;IAEjE,OAAO,KAAK,iBAAiB,GAE5B;IAUW,IAAI,UAAQ;IAExB,SAAkB,KAAK,SAAa;IACpC,SAAkB,UAAU,QAAO;IAEnC,OAAO,KAAK,UAAU,GAKrB;IAED,cAAuB,eAAe,0CAQrC;CACD;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,gBAAgB,EAAE,gBAAgB,CAAA;KAClC;CACD"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { component, html, property, queryAll } from '@a11d/lit';
|
|
3
|
-
import { FieldSelect } from '@3mo/select-field';
|
|
4
|
-
import { Localizer } from '@3mo/localization';
|
|
5
|
-
Localizer.dictionaries.add('de', {
|
|
6
|
-
'Month': 'Monat',
|
|
7
|
-
});
|
|
8
|
-
let FieldSelectMonth = class FieldSelectMonth extends FieldSelect {
|
|
9
|
-
constructor() {
|
|
10
|
-
super(...arguments);
|
|
11
|
-
this.open = false;
|
|
12
|
-
this.label = t('Month');
|
|
13
|
-
this.searchable = true;
|
|
14
|
-
}
|
|
15
|
-
get selectedMonthNode() {
|
|
16
|
-
return this.optionsNodes.find(o => o.hasAttribute('selected'));
|
|
17
|
-
}
|
|
18
|
-
get monthNames() {
|
|
19
|
-
return new Array(this.navigatingDate.monthsInYear)
|
|
20
|
-
.fill(undefined)
|
|
21
|
-
.map((_, i) => this.navigatingDate.yearStart.add({ months: i }))
|
|
22
|
-
.map(date => [date.month - 1, date.format({ month: 'long' })]);
|
|
23
|
-
}
|
|
24
|
-
get optionsTemplate() {
|
|
25
|
-
return html `
|
|
26
|
-
${this.monthNames.map(([month, name]) => html `
|
|
27
|
-
<mo-option value=${month}>
|
|
28
|
-
${name}
|
|
29
|
-
</mo-option>
|
|
30
|
-
`)}
|
|
31
|
-
`;
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
__decorate([
|
|
35
|
-
property({ type: Object })
|
|
36
|
-
], FieldSelectMonth.prototype, "navigatingDate", void 0);
|
|
37
|
-
__decorate([
|
|
38
|
-
queryAll('mo-option')
|
|
39
|
-
], FieldSelectMonth.prototype, "optionsNodes", void 0);
|
|
40
|
-
__decorate([
|
|
41
|
-
property({
|
|
42
|
-
type: Boolean,
|
|
43
|
-
reflect: true,
|
|
44
|
-
updated(isOpen) {
|
|
45
|
-
if (isOpen) {
|
|
46
|
-
requestAnimationFrame(() => this.selectedMonthNode?.scrollIntoView());
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
})
|
|
50
|
-
], FieldSelectMonth.prototype, "open", void 0);
|
|
51
|
-
FieldSelectMonth = __decorate([
|
|
52
|
-
component('mo-field-month')
|
|
53
|
-
], FieldSelectMonth);
|
|
54
|
-
export { FieldSelectMonth };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { FieldSelect } from '@3mo/select-field';
|
|
2
|
-
export declare class FieldSelectYear extends FieldSelect<number> {
|
|
3
|
-
navigatingDate: DateTime;
|
|
4
|
-
readonly optionsNodes: Array<HTMLElement>;
|
|
5
|
-
private get activeYearNode();
|
|
6
|
-
open: boolean;
|
|
7
|
-
readonly label: string;
|
|
8
|
-
readonly searchable = true;
|
|
9
|
-
private readonly currentYear;
|
|
10
|
-
private years;
|
|
11
|
-
protected get optionsTemplate(): import("lit-html").HTMLTemplateResult;
|
|
12
|
-
}
|
|
13
|
-
declare global {
|
|
14
|
-
interface HTMLElementTagNameMap {
|
|
15
|
-
'mo-field-year': FieldSelectYear;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=FieldSelectYear.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FieldSelectYear.d.ts","sourceRoot":"","sources":["../../selection/FieldSelectYear.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAO/C,qBACa,eAAgB,SAAQ,WAAW,CAAC,MAAM,CAAC;IAC3B,cAAc,EAAG,QAAQ,CAAA;IAE9B,QAAQ,CAAC,YAAY,EAAG,KAAK,CAAC,WAAW,CAAC,CAAA;IAEjE,OAAO,KAAK,cAAc,GAEzB;IAUW,IAAI,UAAQ;IAExB,SAAkB,KAAK,SAAY;IACnC,SAAkB,UAAU,QAAO;IAEnC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAsB;IAElD,OAAO,CAAC,KAAK,CAE8B;IAE3C,cAAuB,eAAe,0CAQrC;CACD;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,eAAe,EAAE,eAAe,CAAA;KAChC;CACD"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { component, html, property, queryAll } from '@a11d/lit';
|
|
3
|
-
import { FieldSelect } from '@3mo/select-field';
|
|
4
|
-
import { Localizer } from '@3mo/localization';
|
|
5
|
-
Localizer.dictionaries.add('de', {
|
|
6
|
-
'Year': 'Jahr',
|
|
7
|
-
});
|
|
8
|
-
let FieldSelectYear = class FieldSelectYear extends FieldSelect {
|
|
9
|
-
constructor() {
|
|
10
|
-
super(...arguments);
|
|
11
|
-
this.open = false;
|
|
12
|
-
this.label = t('Year');
|
|
13
|
-
this.searchable = true;
|
|
14
|
-
this.currentYear = new DateTime().year;
|
|
15
|
-
this.years = new Array(150)
|
|
16
|
-
.fill(undefined)
|
|
17
|
-
.map((_, i) => this.currentYear - 100 + i);
|
|
18
|
-
}
|
|
19
|
-
get activeYearNode() {
|
|
20
|
-
return this.optionsNodes.find(o => o.hasAttribute('selected')) ?? this.optionsNodes.at(-1);
|
|
21
|
-
}
|
|
22
|
-
get optionsTemplate() {
|
|
23
|
-
return html `
|
|
24
|
-
${this.years.map(year => html `
|
|
25
|
-
<mo-option value=${year}>
|
|
26
|
-
${year.format()}
|
|
27
|
-
</mo-option>
|
|
28
|
-
`)}
|
|
29
|
-
`;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
__decorate([
|
|
33
|
-
property({ type: Object })
|
|
34
|
-
], FieldSelectYear.prototype, "navigatingDate", void 0);
|
|
35
|
-
__decorate([
|
|
36
|
-
queryAll('mo-option')
|
|
37
|
-
], FieldSelectYear.prototype, "optionsNodes", void 0);
|
|
38
|
-
__decorate([
|
|
39
|
-
property({
|
|
40
|
-
type: Boolean,
|
|
41
|
-
reflect: true,
|
|
42
|
-
updated(isOpen) {
|
|
43
|
-
if (isOpen) {
|
|
44
|
-
requestAnimationFrame(() => this.activeYearNode?.scrollIntoView());
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
})
|
|
48
|
-
], FieldSelectYear.prototype, "open", void 0);
|
|
49
|
-
FieldSelectYear = __decorate([
|
|
50
|
-
component('mo-field-year')
|
|
51
|
-
], FieldSelectYear);
|
|
52
|
-
export { FieldSelectYear };
|