@progressive-development/pd-calendar 0.5.4 → 0.6.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.
- package/dist/generated/locale-codes.d.ts +14 -0
- package/dist/generated/locale-codes.d.ts.map +1 -0
- package/dist/generated/locales/be.d.ts +22 -0
- package/dist/generated/locales/be.d.ts.map +1 -0
- package/dist/generated/locales/de.d.ts +22 -0
- package/dist/generated/locales/de.d.ts.map +1 -0
- package/dist/generated/locales/en.d.ts +22 -0
- package/dist/generated/locales/en.d.ts.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/locales/be.d.ts +2 -0
- package/dist/locales/be.js +0 -7
- package/dist/locales/de.d.ts +2 -0
- package/dist/locales/de.js +0 -7
- package/dist/locales/en.d.ts +2 -0
- package/dist/locales/en.js +0 -7
- package/dist/pd-calendar-cell.d.ts +47 -0
- package/dist/pd-calendar-cell.d.ts.map +1 -0
- package/dist/pd-calendar-cell.js +282 -0
- package/dist/pd-calendar.d.ts +51 -0
- package/dist/pd-calendar.d.ts.map +1 -0
- package/dist/pd-calendar.js +452 -3
- package/dist/pd-year-popup.d.ts +25 -0
- package/dist/pd-year-popup.d.ts.map +1 -0
- package/dist/pd-year-popup.js +136 -0
- package/dist/stories/cell.stories.d.ts +15 -0
- package/dist/stories/cell.stories.d.ts.map +1 -0
- package/dist/stories/index.stories.d.ts +23 -0
- package/dist/stories/index.stories.d.ts.map +1 -0
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +29 -45
- package/dist/src/PdCalendar.js +0 -513
- package/dist/src/PdCalendarCell.js +0 -246
- package/dist/src/PdYearPopup.js +0 -108
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The locale code that templates in this source code are written in.
|
|
3
|
+
*/
|
|
4
|
+
export declare const sourceLocale = "dev";
|
|
5
|
+
/**
|
|
6
|
+
* The other locale codes that this application is localized into. Sorted
|
|
7
|
+
* lexicographically.
|
|
8
|
+
*/
|
|
9
|
+
export declare const targetLocales: readonly ["be", "de", "en"];
|
|
10
|
+
/**
|
|
11
|
+
* All valid project locale codes. Sorted lexicographically.
|
|
12
|
+
*/
|
|
13
|
+
export declare const allLocales: readonly ["be", "de", "dev", "en"];
|
|
14
|
+
//# sourceMappingURL=locale-codes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locale-codes.d.ts","sourceRoot":"","sources":["../../src/generated/locale-codes.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,YAAY,QAAQ,CAAC;AAElC;;;GAGG;AACH,eAAO,MAAM,aAAa,6BAA8B,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,UAAU,oCAAqC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const templates: {
|
|
2
|
+
"pd.datepicker.month.apr": string;
|
|
3
|
+
"pd.datepicker.month.aug": string;
|
|
4
|
+
"pd.datepicker.month.dec": string;
|
|
5
|
+
"pd.datepicker.month.feb": string;
|
|
6
|
+
"pd.datepicker.month.jan": string;
|
|
7
|
+
"pd.datepicker.month.jul": string;
|
|
8
|
+
"pd.datepicker.month.jun": string;
|
|
9
|
+
"pd.datepicker.month.mar": string;
|
|
10
|
+
"pd.datepicker.month.may": string;
|
|
11
|
+
"pd.datepicker.month.nov": string;
|
|
12
|
+
"pd.datepicker.month.oct": string;
|
|
13
|
+
"pd.datepicker.month.sep": string;
|
|
14
|
+
"pd.datepicker.shortday.fri": string;
|
|
15
|
+
"pd.datepicker.shortday.mon": string;
|
|
16
|
+
"pd.datepicker.shortday.sat": string;
|
|
17
|
+
"pd.datepicker.shortday.sun": string;
|
|
18
|
+
"pd.datepicker.shortday.thi": string;
|
|
19
|
+
"pd.datepicker.shortday.tue": string;
|
|
20
|
+
"pd.datepicker.shortday.wed": string;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=be.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"be.d.ts","sourceRoot":"","sources":["../../../src/generated/locales/be.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;CAoBrB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const templates: {
|
|
2
|
+
"pd.datepicker.month.jan": string;
|
|
3
|
+
"pd.datepicker.month.feb": string;
|
|
4
|
+
"pd.datepicker.month.mar": string;
|
|
5
|
+
"pd.datepicker.month.apr": string;
|
|
6
|
+
"pd.datepicker.month.may": string;
|
|
7
|
+
"pd.datepicker.month.jun": string;
|
|
8
|
+
"pd.datepicker.month.jul": string;
|
|
9
|
+
"pd.datepicker.month.aug": string;
|
|
10
|
+
"pd.datepicker.month.sep": string;
|
|
11
|
+
"pd.datepicker.month.oct": string;
|
|
12
|
+
"pd.datepicker.month.nov": string;
|
|
13
|
+
"pd.datepicker.month.dec": string;
|
|
14
|
+
"pd.datepicker.shortday.mon": string;
|
|
15
|
+
"pd.datepicker.shortday.tue": string;
|
|
16
|
+
"pd.datepicker.shortday.wed": string;
|
|
17
|
+
"pd.datepicker.shortday.thi": string;
|
|
18
|
+
"pd.datepicker.shortday.fri": string;
|
|
19
|
+
"pd.datepicker.shortday.sat": string;
|
|
20
|
+
"pd.datepicker.shortday.sun": string;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=de.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"de.d.ts","sourceRoot":"","sources":["../../../src/generated/locales/de.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;CAoBrB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const templates: {
|
|
2
|
+
"pd.datepicker.month.apr": string;
|
|
3
|
+
"pd.datepicker.month.aug": string;
|
|
4
|
+
"pd.datepicker.month.dec": string;
|
|
5
|
+
"pd.datepicker.month.feb": string;
|
|
6
|
+
"pd.datepicker.month.jan": string;
|
|
7
|
+
"pd.datepicker.month.jul": string;
|
|
8
|
+
"pd.datepicker.month.jun": string;
|
|
9
|
+
"pd.datepicker.month.mar": string;
|
|
10
|
+
"pd.datepicker.month.may": string;
|
|
11
|
+
"pd.datepicker.month.nov": string;
|
|
12
|
+
"pd.datepicker.month.oct": string;
|
|
13
|
+
"pd.datepicker.month.sep": string;
|
|
14
|
+
"pd.datepicker.shortday.fri": string;
|
|
15
|
+
"pd.datepicker.shortday.mon": string;
|
|
16
|
+
"pd.datepicker.shortday.sat": string;
|
|
17
|
+
"pd.datepicker.shortday.sun": string;
|
|
18
|
+
"pd.datepicker.shortday.thi": string;
|
|
19
|
+
"pd.datepicker.shortday.tue": string;
|
|
20
|
+
"pd.datepicker.shortday.wed": string;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=en.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../src/generated/locales/en.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;CAoBrB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { PdCalendar } from './pd-calendar.js';
|
|
2
|
+
export type { CalendarCellInfo, CalendarData } from './types.ts';
|
|
3
|
+
export { templates as beTemplates } from './generated/locales/be.js';
|
|
4
|
+
export { templates as deTemplates } from './generated/locales/de.js';
|
|
5
|
+
export { templates as enTemplates } from './generated/locales/en.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEjE,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/locales/be.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
const templates = {
|
|
2
|
-
"pd.datepicker.day.fri": `Vrijdag`,
|
|
3
|
-
"pd.datepicker.day.mon": `Maandag`,
|
|
4
|
-
"pd.datepicker.day.sat": `Zaterdag`,
|
|
5
|
-
"pd.datepicker.day.sun": `Zondag`,
|
|
6
|
-
"pd.datepicker.day.thi": `Donderdag`,
|
|
7
|
-
"pd.datepicker.day.tue": `Dinsdag`,
|
|
8
|
-
"pd.datepicker.day.wed": `Woensdag`,
|
|
9
2
|
"pd.datepicker.month.apr": `April`,
|
|
10
3
|
"pd.datepicker.month.aug": `Augustus`,
|
|
11
4
|
"pd.datepicker.month.dec": `December`,
|
package/dist/locales/de.js
CHANGED
|
@@ -11,13 +11,6 @@ const templates = {
|
|
|
11
11
|
"pd.datepicker.month.oct": `Oktober`,
|
|
12
12
|
"pd.datepicker.month.nov": `November`,
|
|
13
13
|
"pd.datepicker.month.dec": `Dezember`,
|
|
14
|
-
"pd.datepicker.day.sun": `Sonntag`,
|
|
15
|
-
"pd.datepicker.day.mon": `Montag`,
|
|
16
|
-
"pd.datepicker.day.tue": `Dienstag`,
|
|
17
|
-
"pd.datepicker.day.wed": `Mittwoch`,
|
|
18
|
-
"pd.datepicker.day.thi": `Donnerstag`,
|
|
19
|
-
"pd.datepicker.day.fri": `Freitag`,
|
|
20
|
-
"pd.datepicker.day.sat": `Samstag`,
|
|
21
14
|
"pd.datepicker.shortday.mon": `Mo`,
|
|
22
15
|
"pd.datepicker.shortday.tue": `Di`,
|
|
23
16
|
"pd.datepicker.shortday.wed": `Mi`,
|
package/dist/locales/en.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
const templates = {
|
|
2
|
-
"pd.datepicker.day.fri": `Friday`,
|
|
3
|
-
"pd.datepicker.day.mon": `Monday`,
|
|
4
|
-
"pd.datepicker.day.sat": `Saturday`,
|
|
5
|
-
"pd.datepicker.day.sun": `Sunday`,
|
|
6
|
-
"pd.datepicker.day.thi": `Thursday`,
|
|
7
|
-
"pd.datepicker.day.tue": `Tuesday`,
|
|
8
|
-
"pd.datepicker.day.wed": `Wednesday`,
|
|
9
2
|
"pd.datepicker.month.apr": `April`,
|
|
10
3
|
"pd.datepicker.month.aug": `August`,
|
|
11
4
|
"pd.datepicker.month.dec": `December`,
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { LitElement, CSSResultGroup } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Ein einzelnes Kalendertag-Element zur Anzeige in Monatsübersichten.
|
|
4
|
+
*
|
|
5
|
+
* Events:
|
|
6
|
+
* - `select-date`: Wird bei Klick auf ein auswählbares Feld ausgelöst
|
|
7
|
+
* - `mouse-enter-date`: Wird beim Hover über ein auswählbares Feld ausgelöst
|
|
8
|
+
* - `mouse-leave-date`: Wird beim Verlassen des Feldes ausgelöst
|
|
9
|
+
*/
|
|
10
|
+
export declare class PdCalendarCell extends LitElement {
|
|
11
|
+
/**
|
|
12
|
+
* If enabled, cell could be selected (with visible hover element and pointer)
|
|
13
|
+
* vy the user => results in fire cell-selected.
|
|
14
|
+
*/
|
|
15
|
+
selectEnabled: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* If enabled, highlight the current day
|
|
18
|
+
*/
|
|
19
|
+
today: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* If enabled, highlight the selected day
|
|
22
|
+
*/
|
|
23
|
+
selected: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* If enabled the cell gets an special class (e.g. green day).
|
|
26
|
+
*/
|
|
27
|
+
special: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* If set shows info text in the middle (hack) of the cell (e.g. price info).
|
|
30
|
+
*/
|
|
31
|
+
infoTxt: string;
|
|
32
|
+
/**
|
|
33
|
+
* CSS class for day number inside the cell, top-left and center available
|
|
34
|
+
*/
|
|
35
|
+
numberClass: string;
|
|
36
|
+
key: string;
|
|
37
|
+
weekDayNumber: number;
|
|
38
|
+
dayNumber: number;
|
|
39
|
+
static styles: CSSResultGroup;
|
|
40
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
41
|
+
private _renderSelectableCell;
|
|
42
|
+
private _renderEmptyCell;
|
|
43
|
+
private _selectableCellClicked;
|
|
44
|
+
private _mouseEnter;
|
|
45
|
+
private _mouseLeave;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=pd-calendar-cell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pd-calendar-cell.d.ts","sourceRoot":"","sources":["../src/pd-calendar-cell.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAa,cAAc,EAAE,MAAM,KAAK,CAAC;AAS5D;;;;;;;GAOG;AACH,qBACa,cAAe,SAAQ,UAAU;IAC5C;;;OAGG;IAEH,aAAa,UAAS;IAEtB;;OAEG;IAEH,KAAK,UAAS;IAEd;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IAEH,OAAO,UAAS;IAEhB;;OAEG;IAEH,OAAO,SAAM;IAEb;;OAEG;IAEH,WAAW,SAAc;IAKzB,GAAG,SAAM;IAGT,aAAa,SAAM;IAGnB,SAAS,SAAM;IAEf,OAAgB,MAAM,EAAE,cAAc,CAoJpC;IAEO,MAAM;IAMf,OAAO,CAAC,qBAAqB;IA6B7B,OAAO,CAAC,gBAAgB;IAoBxB,OAAO,CAAC,sBAAsB;IAe9B,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,WAAW;CAQpB"}
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { css, LitElement, html } from "lit";
|
|
2
|
+
import { property, customElement } from "lit/decorators.js";
|
|
3
|
+
import { parse } from "fecha";
|
|
4
|
+
import { PdColorStyles, PdFontStyles } from "@progressive-development/pd-shared-styles";
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
8
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
9
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
10
|
+
if (decorator = decorators[i])
|
|
11
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
12
|
+
if (kind && result) __defProp(target, key, result);
|
|
13
|
+
return result;
|
|
14
|
+
};
|
|
15
|
+
let PdCalendarCell = class extends LitElement {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.selectEnabled = false;
|
|
19
|
+
this.today = false;
|
|
20
|
+
this.selected = false;
|
|
21
|
+
this.special = false;
|
|
22
|
+
this.infoTxt = "";
|
|
23
|
+
this.numberClass = "top-left";
|
|
24
|
+
this.key = "";
|
|
25
|
+
this.weekDayNumber = -1;
|
|
26
|
+
this.dayNumber = -1;
|
|
27
|
+
}
|
|
28
|
+
render() {
|
|
29
|
+
return this.selectEnabled ? this._renderSelectableCell() : this._renderEmptyCell();
|
|
30
|
+
}
|
|
31
|
+
_renderSelectableCell() {
|
|
32
|
+
const baseClasses = [
|
|
33
|
+
"cell",
|
|
34
|
+
"cell-day",
|
|
35
|
+
this.numberClass,
|
|
36
|
+
this.special ? "special" : "free",
|
|
37
|
+
(this.weekDayNumber === 6 || this.weekDayNumber === 0) && !this.special ? "we" : ""
|
|
38
|
+
].join(" ");
|
|
39
|
+
return html`
|
|
40
|
+
<div
|
|
41
|
+
@click=${this._selectableCellClicked}
|
|
42
|
+
@mouseenter=${this._mouseEnter}
|
|
43
|
+
@mouseleave=${this._mouseLeave}
|
|
44
|
+
class="${baseClasses}"
|
|
45
|
+
data-date=${this.key}
|
|
46
|
+
>
|
|
47
|
+
${this.infoTxt ? html`<div class="cell-info">${this.infoTxt}</div>` : ""}
|
|
48
|
+
${this.today ? html`<div class="number-ring today"></div>` : ""}
|
|
49
|
+
${this.selected ? html`<div class="number-ring selected"></div>` : ""}
|
|
50
|
+
<div class="cell-number ${this.numberClass}">${this.dayNumber}</div>
|
|
51
|
+
</div>
|
|
52
|
+
`;
|
|
53
|
+
}
|
|
54
|
+
_renderEmptyCell() {
|
|
55
|
+
const baseClasses = [
|
|
56
|
+
"cell",
|
|
57
|
+
"cell-day",
|
|
58
|
+
this.numberClass,
|
|
59
|
+
(this.weekDayNumber === 6 || this.weekDayNumber === 0) && !this.special ? "we" : ""
|
|
60
|
+
].join(" ");
|
|
61
|
+
return html`
|
|
62
|
+
<div class="${baseClasses}">
|
|
63
|
+
${this.infoTxt ? html`<div class="cell-info">${this.infoTxt}</div>` : ""}
|
|
64
|
+
<div class="cell-number ${this.numberClass}">${this.dayNumber}</div>
|
|
65
|
+
</div>
|
|
66
|
+
`;
|
|
67
|
+
}
|
|
68
|
+
_selectableCellClicked(e) {
|
|
69
|
+
const target = e.currentTarget;
|
|
70
|
+
const dateKey = target.dataset.date;
|
|
71
|
+
if (dateKey) {
|
|
72
|
+
const userSelectedDate = parse(dateKey, "YYYY-MM-DD");
|
|
73
|
+
this.dispatchEvent(
|
|
74
|
+
new CustomEvent("select-date", {
|
|
75
|
+
detail: { dateKey, date: userSelectedDate },
|
|
76
|
+
bubbles: true,
|
|
77
|
+
composed: true
|
|
78
|
+
})
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
_mouseEnter() {
|
|
83
|
+
const userSelectedDate = parse(this.key, "YYYY-MM-DD");
|
|
84
|
+
this.dispatchEvent(
|
|
85
|
+
new CustomEvent("mouse-enter-date", {
|
|
86
|
+
detail: { dateKey: this.key, date: userSelectedDate },
|
|
87
|
+
bubbles: true,
|
|
88
|
+
composed: true
|
|
89
|
+
})
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
_mouseLeave() {
|
|
93
|
+
this.dispatchEvent(
|
|
94
|
+
new CustomEvent("mouse-leave-date", {
|
|
95
|
+
bubbles: true,
|
|
96
|
+
composed: true
|
|
97
|
+
})
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
PdCalendarCell.styles = [
|
|
102
|
+
PdColorStyles,
|
|
103
|
+
PdFontStyles,
|
|
104
|
+
css`
|
|
105
|
+
:host {
|
|
106
|
+
display: block;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.cell {
|
|
110
|
+
width: 100%;
|
|
111
|
+
height: 100%;
|
|
112
|
+
min-height: 30px;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.cell-empty {
|
|
116
|
+
background-color: var(
|
|
117
|
+
--pd-calendar-cell-empty-bg-col,
|
|
118
|
+
var(--pd-default-bg)
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.cell-day {
|
|
123
|
+
position: relative;
|
|
124
|
+
/*background-image: linear-gradient(to right, rgb(51, 101, 138) , rgb(38, 76, 104)); */
|
|
125
|
+
/*box-shadow: 2px 2px 3px;*/
|
|
126
|
+
background-color: var(
|
|
127
|
+
--pd-calendar-cell-day-bg-col,
|
|
128
|
+
var(--pd-default-light-col)
|
|
129
|
+
);
|
|
130
|
+
/*border-radius: 2px 2px 2px 2px;*/
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.cell-day.we {
|
|
134
|
+
background-color: var(
|
|
135
|
+
--pd-calendar-cell-day-we-bg-col,
|
|
136
|
+
var(--pd-default-disabled-light-col)
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.free {
|
|
141
|
+
/*background-image: linear-gradient(to right, green, darkgreen);
|
|
142
|
+
background-color: var(--my-info-cell-bg1-color);*/
|
|
143
|
+
background-color: var(
|
|
144
|
+
--pd-calendar-cell-day-free-bg-col,
|
|
145
|
+
var(--pd-default-col)
|
|
146
|
+
);
|
|
147
|
+
/*background-image: linear-gradient(to right, var(--my-info-cell-bg1-color), var(--my-info-cell-bg2-color));*/
|
|
148
|
+
box-shadow: var(--pd-calendar-cell-selectable-shadow, 1px 2px 2px);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.special {
|
|
152
|
+
/*background-image: linear-gradient(to right, green, darkgreen);
|
|
153
|
+
background-color: var(--my-info-cell-bg1-color);*/
|
|
154
|
+
background-color: var(
|
|
155
|
+
--pd-calendar-cell-day-special-bg-col,
|
|
156
|
+
var(--pd-default-success-col)
|
|
157
|
+
);
|
|
158
|
+
/*background-image: linear-gradient(to right, var(--my-info-cell-bg1-color), var(--my-info-cell-bg2-color));*/
|
|
159
|
+
box-shadow: var(--pd-calendar-cell-selectable-shadow, 1px 2px 2px);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.special:hover,
|
|
163
|
+
.free:hover {
|
|
164
|
+
background-color: var(
|
|
165
|
+
--pd-calendar-cell-day-bg-col-hover,
|
|
166
|
+
var(--pd-default-hover-col)
|
|
167
|
+
);
|
|
168
|
+
/*background-image: linear-gradient(to right, var(--my-info-cell-bg1-hover), var(--my-info-cell-bg2-hover));*/
|
|
169
|
+
cursor: pointer;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.cell-info {
|
|
173
|
+
display: flex;
|
|
174
|
+
align-items: center;
|
|
175
|
+
justify-content: center;
|
|
176
|
+
height: 100%;
|
|
177
|
+
color: var(--pd-calendar-cell-day-info-col, var(--pd-default-bg-col));
|
|
178
|
+
font-family: var(--pd-default-font-title-family);
|
|
179
|
+
font-weight: bold;
|
|
180
|
+
font-size: var(--pd-calendar-info-font-size, 1.5em);
|
|
181
|
+
text-shadow: 1px 1px var(--pd-default-dark-col);
|
|
182
|
+
pointer-events: none;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.cell-number {
|
|
186
|
+
pointer-events: none;
|
|
187
|
+
font-size: var(--pd-calendar-number-font-size, 1em);
|
|
188
|
+
font-weight: bold;
|
|
189
|
+
color: var(--pd-calendar-cell-day-info-col, var(--pd-default-bg-col));
|
|
190
|
+
font-family: var(--pd-default-font-content-family);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.cell-number.top-left {
|
|
194
|
+
position: absolute;
|
|
195
|
+
left: 3px;
|
|
196
|
+
top: 2px;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/* Noch umstellen, passt nicht für alle größen (die anderen auf flex/center umgestellt) */
|
|
200
|
+
.center {
|
|
201
|
+
display: flex;
|
|
202
|
+
align-items: center;
|
|
203
|
+
justify-content: center;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.free .cell-number,
|
|
207
|
+
.special .cell-number {
|
|
208
|
+
color: var(
|
|
209
|
+
--pd-calendar-cell-day-info-free-col,
|
|
210
|
+
var(--pd-default-bg-col)
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.number-ring {
|
|
215
|
+
position: absolute;
|
|
216
|
+
height: 28px;
|
|
217
|
+
width: 28px;
|
|
218
|
+
border-radius: 50%;
|
|
219
|
+
display: inline-block;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.today {
|
|
223
|
+
border: 2px solid blue;
|
|
224
|
+
pointer-events: none;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.selected {
|
|
228
|
+
border: 2px solid red;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/* ToDo: Dont work for calendars sized by custom properties. Needed to calculate from calendar size
|
|
232
|
+
not from window size, this is a topic for container queries, which are not available right now... */
|
|
233
|
+
@media (max-width: 800px) {
|
|
234
|
+
.cell-info {
|
|
235
|
+
font-size: 1.3em;
|
|
236
|
+
}
|
|
237
|
+
.cell-number {
|
|
238
|
+
font-size: 0.8em;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
@media (max-width: 500px) {
|
|
243
|
+
.cell-info {
|
|
244
|
+
font-weight: normal;
|
|
245
|
+
font-size: 1em;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
`
|
|
249
|
+
];
|
|
250
|
+
__decorateClass([
|
|
251
|
+
property({ type: Boolean })
|
|
252
|
+
], PdCalendarCell.prototype, "selectEnabled", 2);
|
|
253
|
+
__decorateClass([
|
|
254
|
+
property({ type: Boolean })
|
|
255
|
+
], PdCalendarCell.prototype, "today", 2);
|
|
256
|
+
__decorateClass([
|
|
257
|
+
property({ type: Boolean })
|
|
258
|
+
], PdCalendarCell.prototype, "selected", 2);
|
|
259
|
+
__decorateClass([
|
|
260
|
+
property({ type: Boolean })
|
|
261
|
+
], PdCalendarCell.prototype, "special", 2);
|
|
262
|
+
__decorateClass([
|
|
263
|
+
property({ type: String })
|
|
264
|
+
], PdCalendarCell.prototype, "infoTxt", 2);
|
|
265
|
+
__decorateClass([
|
|
266
|
+
property({ type: String })
|
|
267
|
+
], PdCalendarCell.prototype, "numberClass", 2);
|
|
268
|
+
__decorateClass([
|
|
269
|
+
property({ type: String })
|
|
270
|
+
], PdCalendarCell.prototype, "key", 2);
|
|
271
|
+
__decorateClass([
|
|
272
|
+
property({ type: Number })
|
|
273
|
+
], PdCalendarCell.prototype, "weekDayNumber", 2);
|
|
274
|
+
__decorateClass([
|
|
275
|
+
property({ type: Number })
|
|
276
|
+
], PdCalendarCell.prototype, "dayNumber", 2);
|
|
277
|
+
PdCalendarCell = __decorateClass([
|
|
278
|
+
customElement("pd-calendar-cell")
|
|
279
|
+
], PdCalendarCell);
|
|
280
|
+
export {
|
|
281
|
+
PdCalendarCell
|
|
282
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { LitElement, PropertyValues, CSSResultGroup } from 'lit';
|
|
2
|
+
import { CalendarData } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* PdCalendar displays monthly view with information (selectable day cell).
|
|
5
|
+
*
|
|
6
|
+
* @fires change-month
|
|
7
|
+
* @fires select-date
|
|
8
|
+
* @fires mouse-enter-date
|
|
9
|
+
* @fires mouse-leave-date
|
|
10
|
+
*/
|
|
11
|
+
export declare class PdCalendar extends LitElement {
|
|
12
|
+
refDate?: Date;
|
|
13
|
+
selectableDates: boolean;
|
|
14
|
+
withYearPopup: string[];
|
|
15
|
+
withWheelNavigation: boolean;
|
|
16
|
+
withTouchNavigation: boolean;
|
|
17
|
+
showSelection: boolean;
|
|
18
|
+
hideWeekend: boolean;
|
|
19
|
+
prevMonthConstraint: number;
|
|
20
|
+
nextMonthConstraint: number;
|
|
21
|
+
data: CalendarData;
|
|
22
|
+
numberClass: string;
|
|
23
|
+
private _viewType;
|
|
24
|
+
private _currentDate;
|
|
25
|
+
private _wheelDelta;
|
|
26
|
+
private _monthName;
|
|
27
|
+
private _year;
|
|
28
|
+
private _numberOfDays;
|
|
29
|
+
private _daysFromPreviousMonth;
|
|
30
|
+
private _currentMonthNavNr;
|
|
31
|
+
static styles: CSSResultGroup;
|
|
32
|
+
connectedCallback(): void;
|
|
33
|
+
update(changedProperties: PropertyValues<this>): void;
|
|
34
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
35
|
+
private renderMonthCalendar;
|
|
36
|
+
private _openYearPopup;
|
|
37
|
+
private _getWeekDays;
|
|
38
|
+
private _nextMonth;
|
|
39
|
+
private _previousMonth;
|
|
40
|
+
private _wheelEvent;
|
|
41
|
+
private _touchStartEvent;
|
|
42
|
+
private _touchEndEvent;
|
|
43
|
+
private _initFromDate;
|
|
44
|
+
private static _getPreviousMonthDays;
|
|
45
|
+
private _checkNextMonthConstraint;
|
|
46
|
+
private _checkPrevMonthConstraint;
|
|
47
|
+
private _forwardEvent;
|
|
48
|
+
private _forwardEnterEvent;
|
|
49
|
+
private _forwardLeaveEvent;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=pd-calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pd-calendar.d.ts","sourceRoot":"","sources":["../src/pd-calendar.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAa,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAK5E,OAAO,0CAA0C,CAAC;AASlD,OAAO,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAqD1C;;;;;;;GAOG;AACH,qBAEa,UAAW,SAAQ,UAAU;IAExC,OAAO,CAAC,EAAE,IAAI,CAAC;IAGf,eAAe,UAAS;IAGxB,aAAa,EAAE,MAAM,EAAE,CAAM;IAG7B,mBAAmB,UAAS;IAG5B,mBAAmB,UAAS;IAG5B,aAAa,UAAS;IAGtB,WAAW,UAAS;IAGpB,mBAAmB,SAAM;IAGzB,mBAAmB,SAAM;IAGzB,IAAI,EAAE,YAAY,CAAM;IAGxB,WAAW,SAAc;IAGzB,OAAO,CAAC,SAAS,CAAc;IAG/B,OAAO,CAAC,YAAY,CAAc;IAGlC,OAAO,CAAC,WAAW,CAAK;IAExB,OAAO,CAAC,UAAU,CAAM;IACxB,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,sBAAsB,CAAc;IAC5C,OAAO,CAAC,kBAAkB,CAAK;IAE/B,OAAgB,MAAM,EAAE,cAAc,CAsHpC;IAEO,iBAAiB,IAAI,IAAI;IAKzB,MAAM,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAOrD,MAAM;IAOf,OAAO,CAAC,mBAAmB;IAgF3B,OAAO,CAAC,cAAc;IAqBtB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,cAAc;IAiBtB,OAAO,CAAC,WAAW;IAenB,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAUpC,OAAO,CAAC,yBAAyB;IAOjC,OAAO,CAAC,yBAAyB;IAQjC,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,kBAAkB;CAG3B"}
|