@progressive-development/pd-calendar 0.9.2 → 1.0.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/LICENSE +21 -2
- package/README.md +32 -57
- package/dist/generated/locales/be.d.ts +3 -0
- package/dist/generated/locales/be.d.ts.map +1 -1
- package/dist/generated/locales/de.d.ts +3 -0
- package/dist/generated/locales/de.d.ts.map +1 -1
- package/dist/generated/locales/en.d.ts +3 -0
- package/dist/generated/locales/en.d.ts.map +1 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -0
- package/dist/locales/be.js +4 -1
- package/dist/locales/de.js +3 -0
- package/dist/locales/en.js +4 -1
- package/dist/pd-calendar/PdCalendar.d.ts +101 -18
- package/dist/pd-calendar/PdCalendar.d.ts.map +1 -1
- package/dist/pd-calendar/PdCalendar.js +380 -264
- package/dist/pd-calendar/pd-calendar-cell/PdCalendarCell.d.ts +40 -33
- package/dist/pd-calendar/pd-calendar-cell/PdCalendarCell.d.ts.map +1 -1
- package/dist/pd-calendar/pd-calendar-cell/PdCalendarCell.js +173 -113
- package/dist/pd-calendar/pd-calendar-day-events-panel/PdCalendarDayEventsPanel.d.ts +27 -0
- package/dist/pd-calendar/pd-calendar-day-events-panel/PdCalendarDayEventsPanel.d.ts.map +1 -0
- package/dist/pd-calendar/pd-calendar-day-events-panel/PdCalendarDayEventsPanel.js +160 -0
- package/dist/pd-calendar/pd-calendar-day-events-panel/pd-calendar-day-events-panel.d.ts +3 -0
- package/dist/pd-calendar/pd-calendar-day-events-panel/pd-calendar-day-events-panel.d.ts.map +1 -0
- package/dist/pd-calendar/pd-calendar-day-events-panel/pd-calendar-day-events-panel.js +8 -0
- package/dist/pd-calendar/pd-calendar-event-cell/PdCalendarEventCell.d.ts +55 -0
- package/dist/pd-calendar/pd-calendar-event-cell/PdCalendarEventCell.d.ts.map +1 -0
- package/dist/pd-calendar/pd-calendar-event-cell/PdCalendarEventCell.js +341 -0
- package/dist/pd-calendar/pd-calendar-event-cell/pd-calendar-event-cell.d.ts +3 -0
- package/dist/pd-calendar/pd-calendar-event-cell/pd-calendar-event-cell.d.ts.map +1 -0
- package/dist/pd-calendar/pd-calendar-event-cell/pd-calendar-event-cell.js +8 -0
- package/dist/pd-calendar/pd-calendar-event-info-panel/PdCalendarEventInfoPanel.d.ts +29 -0
- package/dist/pd-calendar/pd-calendar-event-info-panel/PdCalendarEventInfoPanel.d.ts.map +1 -0
- package/dist/pd-calendar/pd-calendar-event-info-panel/PdCalendarEventInfoPanel.js +211 -0
- package/dist/pd-calendar/pd-calendar-event-info-panel/pd-calendar-event-info-panel.d.ts +3 -0
- package/dist/pd-calendar/pd-calendar-event-info-panel/pd-calendar-event-info-panel.d.ts.map +1 -0
- package/dist/pd-calendar/pd-calendar-event-info-panel/pd-calendar-event-info-panel.js +8 -0
- package/dist/pd-calendar/pd-calendar-list-cell/PdCalendarListCell.d.ts +28 -0
- package/dist/pd-calendar/pd-calendar-list-cell/PdCalendarListCell.d.ts.map +1 -0
- package/dist/pd-calendar/pd-calendar-list-cell/PdCalendarListCell.js +252 -0
- package/dist/pd-calendar/pd-calendar-list-cell/pd-calendar-list-cell.d.ts +3 -0
- package/dist/pd-calendar/pd-calendar-list-cell/pd-calendar-list-cell.d.ts.map +1 -0
- package/dist/pd-calendar/pd-calendar-list-cell/pd-calendar-list-cell.js +8 -0
- package/dist/pd-calendar/pd-calendar-list-view/PdCalendarListView.d.ts +26 -0
- package/dist/pd-calendar/pd-calendar-list-view/PdCalendarListView.d.ts.map +1 -0
- package/dist/pd-calendar/pd-calendar-list-view/PdCalendarListView.js +165 -0
- package/dist/pd-calendar/pd-calendar-list-view/pd-calendar-list-view.d.ts +3 -0
- package/dist/pd-calendar/pd-calendar-list-view/pd-calendar-list-view.d.ts.map +1 -0
- package/dist/pd-calendar/pd-calendar-list-view/pd-calendar-list-view.js +8 -0
- package/dist/pd-calendar/pd-calendar-month-view/PdCalendarMonthView.d.ts +55 -0
- package/dist/pd-calendar/pd-calendar-month-view/PdCalendarMonthView.d.ts.map +1 -0
- package/dist/pd-calendar/pd-calendar-month-view/PdCalendarMonthView.js +461 -0
- package/dist/pd-calendar/pd-calendar-month-view/pd-calendar-month-view.d.ts +3 -0
- package/dist/pd-calendar/pd-calendar-month-view/pd-calendar-month-view.d.ts.map +1 -0
- package/dist/pd-calendar/pd-calendar-month-view/pd-calendar-month-view.js +8 -0
- package/dist/pd-calendar/pd-calendar-time-grid-view/PdCalendarTimeGridView.d.ts +32 -0
- package/dist/pd-calendar/pd-calendar-time-grid-view/PdCalendarTimeGridView.d.ts.map +1 -0
- package/dist/pd-calendar/pd-calendar-time-grid-view/PdCalendarTimeGridView.js +468 -0
- package/dist/pd-calendar/pd-calendar-time-grid-view/pd-calendar-time-grid-view.d.ts +3 -0
- package/dist/pd-calendar/pd-calendar-time-grid-view/pd-calendar-time-grid-view.d.ts.map +1 -0
- package/dist/pd-calendar/pd-calendar-time-grid-view/pd-calendar-time-grid-view.js +8 -0
- package/dist/pd-calendar/pd-calendar-week-cell/PdCalendarWeekCell.d.ts +31 -0
- package/dist/pd-calendar/pd-calendar-week-cell/PdCalendarWeekCell.d.ts.map +1 -0
- package/dist/pd-calendar/pd-calendar-week-cell/PdCalendarWeekCell.js +134 -0
- package/dist/pd-calendar/pd-calendar-week-cell/pd-calendar-week-cell.d.ts +3 -0
- package/dist/pd-calendar/pd-calendar-week-cell/pd-calendar-week-cell.d.ts.map +1 -0
- package/dist/pd-calendar/pd-calendar-week-cell/pd-calendar-week-cell.js +8 -0
- package/dist/pd-calendar/pd-calendar.stories.d.ts +79 -19
- package/dist/pd-calendar/pd-calendar.stories.d.ts.map +1 -1
- package/dist/pd-calendar/pd-year-popup/PdYearPopup.d.ts +22 -11
- package/dist/pd-calendar/pd-year-popup/PdYearPopup.d.ts.map +1 -1
- package/dist/pd-calendar/pd-year-popup/PdYearPopup.js +152 -34
- package/dist/pd-datepicker/PdDatepicker.d.ts +76 -7
- package/dist/pd-datepicker/PdDatepicker.d.ts.map +1 -1
- package/dist/pd-datepicker/PdDatepicker.js +257 -50
- package/dist/pd-datepicker/pd-date-picker.stories.d.ts +78 -20
- package/dist/pd-datepicker/pd-date-picker.stories.d.ts.map +1 -1
- package/dist/pd-slot-picker/PdSlotPicker.d.ts +102 -0
- package/dist/pd-slot-picker/PdSlotPicker.d.ts.map +1 -0
- package/dist/pd-slot-picker/PdSlotPicker.js +339 -0
- package/dist/pd-slot-picker/pd-slot-cell/PdSlotCell.d.ts +35 -0
- package/dist/pd-slot-picker/pd-slot-cell/PdSlotCell.d.ts.map +1 -0
- package/dist/pd-slot-picker/pd-slot-cell/PdSlotCell.js +188 -0
- package/dist/pd-slot-picker/pd-slot-cell/pd-slot-cell.d.ts +3 -0
- package/dist/pd-slot-picker/pd-slot-cell/pd-slot-cell.d.ts.map +1 -0
- package/dist/pd-slot-picker/pd-slot-cell/pd-slot-cell.js +8 -0
- package/dist/pd-slot-picker/pd-slot-picker.d.ts +3 -0
- package/dist/pd-slot-picker/pd-slot-picker.d.ts.map +1 -0
- package/dist/pd-slot-picker/pd-slot-picker.stories.d.ts +67 -0
- package/dist/pd-slot-picker/pd-slot-picker.stories.d.ts.map +1 -0
- package/dist/pd-slot-picker.d.ts +2 -0
- package/dist/pd-slot-picker.js +8 -0
- package/dist/shared/PdBaseCell.d.ts +68 -0
- package/dist/shared/PdBaseCell.d.ts.map +1 -0
- package/dist/shared/PdBaseCell.js +120 -0
- package/dist/shared/PdBaseView.d.ts +22 -0
- package/dist/shared/PdBaseView.d.ts.map +1 -0
- package/dist/shared/PdBaseView.js +46 -0
- package/dist/shared/PdCalendarPanelBase.d.ts +34 -0
- package/dist/shared/PdCalendarPanelBase.d.ts.map +1 -0
- package/dist/shared/PdCalendarPanelBase.js +169 -0
- package/dist/shared/calendar-button-bar/calendar-button-bar.d.ts +41 -0
- package/dist/shared/calendar-button-bar/calendar-button-bar.d.ts.map +1 -0
- package/dist/shared/calendar-button-bar/calendar-button-bar.js +435 -0
- package/dist/shared/calendar-locales.d.ts +9 -0
- package/dist/shared/calendar-locales.d.ts.map +1 -0
- package/dist/shared/calendar-locales.js +30 -0
- package/dist/shared/calendar-utils.d.ts +34 -0
- package/dist/shared/calendar-utils.d.ts.map +1 -0
- package/dist/shared/calendar-utils.js +99 -0
- package/dist/shared/calendar-utils.test.d.ts +2 -0
- package/dist/shared/calendar-utils.test.d.ts.map +1 -0
- package/dist/types.d.ts +102 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +10 -5
- package/dist/pd-calendar/pd-calendar-cell/pd-calendar-cell.stories.d.ts +0 -15
- package/dist/pd-calendar/pd-calendar-cell/pd-calendar-cell.stories.d.ts.map +0 -1
|
@@ -1,47 +1,54 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CSSResultGroup } from 'lit';
|
|
2
|
+
import { PdBaseCell } from '../../shared/PdBaseCell.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
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
|
|
4
|
+
* A single calendar day cell component for use within monthly calendar views.
|
|
9
5
|
*
|
|
10
6
|
* @tagname pd-calendar-cell
|
|
7
|
+
* @summary Single day cell with info text, selection, hover, and focus states.
|
|
8
|
+
*
|
|
9
|
+
* @event select-date - Fired when a selectable cell is clicked. Detail: `{ dateKey: string, date: Date }`.
|
|
10
|
+
* @event mouse-enter-date - Fired when hovering over a selectable cell. Detail: `{ dateKey: string, date: Date }`.
|
|
11
|
+
* @event mouse-leave-date - Fired when leaving a cell.
|
|
12
|
+
*
|
|
13
|
+
* @cssprop --pd-calendar-cell-day-bg-col - Background color for day cells. Default: `var(--pd-default-light-col)`.
|
|
14
|
+
* @cssprop --pd-calendar-cell-day-we-bg-col - Background color for weekend cells. Default: `var(--pd-default-bg-light-col)`.
|
|
15
|
+
* @cssprop --pd-calendar-cell-day-free-bg-col - Background color for selectable cells. Default: `var(--pd-default-col)`.
|
|
16
|
+
* @cssprop --pd-calendar-cell-day-category-bg-col - Background color for categorized cells. Set dynamically via categoryColor.
|
|
17
|
+
* @cssprop --pd-calendar-cell-day-category-text-col - Text color for categorized cells. Set dynamically via categoryTextColor.
|
|
18
|
+
* @cssprop --pd-calendar-cell-day-bg-col-hover - Background color on hover. Default: `var(--pd-default-hover-col)`.
|
|
19
|
+
* @cssprop --pd-calendar-cell-day-info-col - Text color for info text. Default: `var(--pd-on-primary-col)`.
|
|
20
|
+
* @cssprop --pd-calendar-cell-day-number-col - Text color for day numbers. Default: `var(--pd-default-dark-col)`.
|
|
21
|
+
* @cssprop --pd-calendar-cell-day-info-free-col - Text color for selectable cells. Default: `var(--pd-on-primary-col)`.
|
|
22
|
+
* @cssprop --pd-calendar-cell-selectable-shadow - Box shadow for selectable cells. Default: `var(--pd-shadow-sm)`.
|
|
23
|
+
* @cssprop --pd-calendar-cell-focus-outline-col - Focus outline color for keyboard navigation. Default: `var(--pd-default-info-col)`.
|
|
24
|
+
* @cssprop --pd-calendar-cell-today-border-col - Border color for today's date. Default: `var(--pd-default-error-col)`.
|
|
25
|
+
* @cssprop --pd-calendar-cell-selected-bg-col - Background color for selected date. Default: `var(--pd-default-col)`.
|
|
26
|
+
* @cssprop --pd-calendar-info-font-size - Font size for info text. Default: `1.5em`.
|
|
27
|
+
* @cssprop --pd-calendar-number-font-size - Font size for day number. Default: `0.9em`.
|
|
28
|
+
* @cssprop --pd-calendar-cell-day-info-selection-col - Text color for day number when the cell is selected. Default: `var(--pd-on-primary-col)`.
|
|
11
29
|
*/
|
|
12
|
-
export declare class PdCalendarCell extends
|
|
13
|
-
/**
|
|
14
|
-
* If enabled, cell could be selected (with visible hover element and pointer)
|
|
15
|
-
* vy the user => results in fire cell-selected.
|
|
16
|
-
*/
|
|
30
|
+
export declare class PdCalendarCell extends PdBaseCell {
|
|
31
|
+
/** Whether the cell can be selected by the user. */
|
|
17
32
|
selectEnabled: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* If enabled, highlight the current day
|
|
20
|
-
*/
|
|
33
|
+
/** Highlight as today's date. */
|
|
21
34
|
today: boolean;
|
|
35
|
+
/** Whether this cell has keyboard focus. */
|
|
36
|
+
focused: boolean;
|
|
37
|
+
/** CSS class for day number positioning ('top-left' or 'center'). */
|
|
38
|
+
numberClass: string;
|
|
39
|
+
static styles: CSSResultGroup;
|
|
40
|
+
render(): import('lit').TemplateResult<1>;
|
|
41
|
+
protected _handleSelect(): void;
|
|
22
42
|
/**
|
|
23
|
-
*
|
|
24
|
-
*/
|
|
25
|
-
selected: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* If enabled the cell gets an special class (e.g. green day).
|
|
28
|
-
*/
|
|
29
|
-
special: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* If set shows info text in the middle (hack) of the cell (e.g. price info).
|
|
43
|
+
* Determines if this is a weekend day.
|
|
32
44
|
*/
|
|
33
|
-
|
|
45
|
+
private _isWeekend;
|
|
34
46
|
/**
|
|
35
|
-
* CSS class for
|
|
47
|
+
* Builds CSS class string for the cell.
|
|
36
48
|
*/
|
|
37
|
-
|
|
38
|
-
key: string;
|
|
39
|
-
weekDayNumber: number;
|
|
40
|
-
dayNumber: number;
|
|
41
|
-
static styles: CSSResultGroup;
|
|
42
|
-
render(): import('lit').TemplateResult<1>;
|
|
49
|
+
private _getCellClasses;
|
|
43
50
|
private _renderSelectableCell;
|
|
44
|
-
private
|
|
51
|
+
private _renderNonSelectableCell;
|
|
45
52
|
private _selectableCellClicked;
|
|
46
53
|
private _mouseEnter;
|
|
47
54
|
private _mouseLeave;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdCalendarCell.d.ts","sourceRoot":"","sources":["../../../src/pd-calendar/pd-calendar-cell/PdCalendarCell.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"PdCalendarCell.d.ts","sourceRoot":"","sources":["../../../src/pd-calendar/pd-calendar-cell/PdCalendarCell.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAa,cAAc,EAAW,MAAM,KAAK,CAAC;AAKzD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,cAAe,SAAQ,UAAU;IAC5C,oDAAoD;IAEpD,aAAa,UAAS;IAEtB,iCAAiC;IAEjC,KAAK,UAAS;IAEd,4CAA4C;IAE5C,OAAO,UAAS;IAEhB,qEAAqE;IAErE,WAAW,SAAc;IAEzB,OAAgB,MAAM,EAAE,cAAc,CA4MpC;IAEO,MAAM;cAOI,aAAa,IAAI,IAAI;IAaxC;;OAEG;IACH,OAAO,CAAC,UAAU;IAIlB;;OAEG;IACH,OAAO,CAAC,eAAe;IAmBvB,OAAO,CAAC,qBAAqB;IA8B7B,OAAO,CAAC,wBAAwB;IAWhC,OAAO,CAAC,sBAAsB;IAI9B,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,WAAW;CAQpB"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { css, nothing, html } from 'lit';
|
|
2
2
|
import { property } from 'lit/decorators.js';
|
|
3
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
3
4
|
import { parse } from 'fecha';
|
|
5
|
+
import { PdBaseCell } from '../../shared/PdBaseCell.js';
|
|
4
6
|
|
|
5
7
|
var __defProp = Object.defineProperty;
|
|
6
8
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -11,18 +13,13 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
11
13
|
if (result) __defProp(target, key, result);
|
|
12
14
|
return result;
|
|
13
15
|
};
|
|
14
|
-
class PdCalendarCell extends
|
|
16
|
+
class PdCalendarCell extends PdBaseCell {
|
|
15
17
|
constructor() {
|
|
16
18
|
super(...arguments);
|
|
17
19
|
this.selectEnabled = false;
|
|
18
20
|
this.today = false;
|
|
19
|
-
this.
|
|
20
|
-
this.special = false;
|
|
21
|
-
this.infoTxt = "";
|
|
21
|
+
this.focused = false;
|
|
22
22
|
this.numberClass = "top-left";
|
|
23
|
-
this.key = "";
|
|
24
|
-
this.weekDayNumber = -1;
|
|
25
|
-
this.dayNumber = -1;
|
|
26
23
|
}
|
|
27
24
|
static {
|
|
28
25
|
this.styles = [
|
|
@@ -35,197 +32,275 @@ class PdCalendarCell extends LitElement {
|
|
|
35
32
|
width: 100%;
|
|
36
33
|
height: 100%;
|
|
37
34
|
min-height: 30px;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var(--pd-default-bg)
|
|
44
|
-
);
|
|
35
|
+
border-radius: var(--pd-radius-sm, 2px);
|
|
36
|
+
transition:
|
|
37
|
+
background-color 0.15s ease,
|
|
38
|
+
box-shadow 0.15s ease,
|
|
39
|
+
transform 0.1s ease;
|
|
45
40
|
}
|
|
46
41
|
|
|
47
42
|
.cell-day {
|
|
48
43
|
position: relative;
|
|
49
|
-
/*background-image: linear-gradient(to right, rgb(51, 101, 138) , rgb(38, 76, 104)); */
|
|
50
|
-
/*box-shadow: 2px 2px 3px;*/
|
|
51
44
|
background-color: var(
|
|
52
45
|
--pd-calendar-cell-day-bg-col,
|
|
53
|
-
var(--pd-default-
|
|
46
|
+
var(--pd-default-bg-col)
|
|
54
47
|
);
|
|
55
|
-
/*border-radius: 2px 2px 2px 2px;*/
|
|
56
48
|
}
|
|
57
49
|
|
|
58
50
|
.cell-day.we {
|
|
59
51
|
background-color: var(
|
|
60
52
|
--pd-calendar-cell-day-we-bg-col,
|
|
61
|
-
var(--pd-default-
|
|
53
|
+
var(--pd-default-light-col)
|
|
62
54
|
);
|
|
63
55
|
}
|
|
64
56
|
|
|
57
|
+
/* Selectable (free) cells */
|
|
65
58
|
.free {
|
|
66
|
-
/*background-image: linear-gradient(to right, green, darkgreen);
|
|
67
|
-
background-color: var(--my-info-cell-bg1-color);*/
|
|
68
59
|
background-color: var(
|
|
69
60
|
--pd-calendar-cell-day-free-bg-col,
|
|
70
61
|
var(--pd-default-col)
|
|
71
62
|
);
|
|
72
|
-
|
|
73
|
-
|
|
63
|
+
box-shadow: var(
|
|
64
|
+
--pd-calendar-cell-selectable-shadow,
|
|
65
|
+
var(--pd-shadow-md)
|
|
66
|
+
);
|
|
74
67
|
}
|
|
75
68
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
background-color: var(--my-info-cell-bg1-color);*/
|
|
69
|
+
/* Categorized cells - color set via inline style */
|
|
70
|
+
.categorized {
|
|
79
71
|
background-color: var(
|
|
80
|
-
--pd-calendar-cell-day-
|
|
72
|
+
--pd-calendar-cell-day-category-bg-col,
|
|
81
73
|
var(--pd-default-success-col)
|
|
82
74
|
);
|
|
83
|
-
|
|
84
|
-
|
|
75
|
+
box-shadow: var(
|
|
76
|
+
--pd-calendar-cell-selectable-shadow,
|
|
77
|
+
var(--pd-shadow-md)
|
|
78
|
+
);
|
|
85
79
|
}
|
|
86
80
|
|
|
87
|
-
|
|
81
|
+
/* Hover states for selectable cells */
|
|
82
|
+
.categorized:hover,
|
|
88
83
|
.free:hover {
|
|
89
84
|
background-color: var(
|
|
90
85
|
--pd-calendar-cell-day-bg-col-hover,
|
|
91
86
|
var(--pd-default-hover-col)
|
|
92
87
|
);
|
|
93
|
-
/*background-image: linear-gradient(to right, var(--my-info-cell-bg1-hover), var(--my-info-cell-bg2-hover));*/
|
|
94
88
|
cursor: pointer;
|
|
89
|
+
box-shadow: var(--pd-shadow-md);
|
|
90
|
+
transform: translateY(-1px);
|
|
95
91
|
}
|
|
96
92
|
|
|
93
|
+
.categorized:active,
|
|
94
|
+
.free:active {
|
|
95
|
+
transform: translateY(0);
|
|
96
|
+
box-shadow: var(--pd-shadow-md);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* Focus styles for keyboard navigation */
|
|
100
|
+
:host([focused]) .cell-day {
|
|
101
|
+
outline: 2px solid
|
|
102
|
+
var(--pd-calendar-cell-focus-outline-col, var(--pd-default-info-col));
|
|
103
|
+
outline-offset: -2px;
|
|
104
|
+
z-index: 1;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* Disabled state */
|
|
108
|
+
:host([disabled]) .cell-day {
|
|
109
|
+
opacity: 0.4;
|
|
110
|
+
cursor: not-allowed;
|
|
111
|
+
pointer-events: none;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* Info text (e.g., price) */
|
|
97
115
|
.cell-info {
|
|
98
116
|
display: flex;
|
|
99
117
|
align-items: center;
|
|
100
118
|
justify-content: center;
|
|
101
119
|
height: 100%;
|
|
102
|
-
|
|
120
|
+
/* Task? */
|
|
121
|
+
color: var(--pd-calendar-cell-day-info-col, var(--pd-on-primary-col));
|
|
103
122
|
font-family: var(--pd-default-font-title-family);
|
|
104
|
-
font-weight:
|
|
123
|
+
font-weight: 600;
|
|
105
124
|
font-size: var(--pd-calendar-info-font-size, 1.5em);
|
|
106
|
-
text-shadow:
|
|
125
|
+
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
|
|
107
126
|
pointer-events: none;
|
|
108
127
|
}
|
|
109
128
|
|
|
129
|
+
/* Day number */
|
|
110
130
|
.cell-number {
|
|
111
131
|
pointer-events: none;
|
|
112
|
-
font-size: var(--pd-calendar-number-font-size,
|
|
113
|
-
font-weight:
|
|
114
|
-
color: var(
|
|
132
|
+
font-size: var(--pd-calendar-number-font-size, 0.9em);
|
|
133
|
+
font-weight: 600;
|
|
134
|
+
color: var(
|
|
135
|
+
--pd-calendar-cell-day-number-col,
|
|
136
|
+
var(--pd-default-dark-col)
|
|
137
|
+
);
|
|
115
138
|
font-family: var(--pd-default-font-content-family);
|
|
139
|
+
position: relative;
|
|
140
|
+
z-index: 1;
|
|
116
141
|
}
|
|
117
142
|
|
|
118
143
|
.cell-number.top-left {
|
|
119
144
|
position: absolute;
|
|
120
|
-
left:
|
|
121
|
-
top:
|
|
145
|
+
left: var(--pd-spacing-xs);
|
|
146
|
+
top: var(--pd-spacing-xs);
|
|
122
147
|
}
|
|
123
148
|
|
|
124
|
-
/* Noch umstellen, passt nicht für alle größen (die anderen auf flex/center umgestellt) */
|
|
125
149
|
.center {
|
|
126
150
|
display: flex;
|
|
127
151
|
align-items: center;
|
|
128
152
|
justify-content: center;
|
|
153
|
+
height: 100%;
|
|
129
154
|
}
|
|
130
155
|
|
|
156
|
+
/* Selectable cells have light text on colored background */
|
|
131
157
|
.free .cell-number,
|
|
132
|
-
.
|
|
158
|
+
.categorized .cell-number {
|
|
133
159
|
color: var(
|
|
134
|
-
--pd-calendar-cell-day-
|
|
135
|
-
var(--pd-
|
|
160
|
+
--pd-calendar-cell-day-category-text-col,
|
|
161
|
+
var(--pd-calendar-cell-day-info-free-col, var(--pd-on-primary-col))
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.free .cell-info,
|
|
166
|
+
.categorized .cell-info {
|
|
167
|
+
color: var(
|
|
168
|
+
--pd-calendar-cell-day-category-text-col,
|
|
169
|
+
var(--pd-calendar-cell-day-info-free-col, var(--pd-on-primary-col))
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.selection .cell-number {
|
|
174
|
+
color: var(
|
|
175
|
+
--pd-calendar-cell-day-info-selection-col,
|
|
176
|
+
var(--pd-on-primary-col)
|
|
136
177
|
);
|
|
137
178
|
}
|
|
138
179
|
|
|
180
|
+
/* Today and selected indicators */
|
|
139
181
|
.number-ring {
|
|
140
182
|
position: absolute;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
border-radius: 50%;
|
|
144
|
-
display: inline-block;
|
|
183
|
+
inset: 15% 10%;
|
|
184
|
+
border-radius: var(--pd-radius-sm, 3px);
|
|
145
185
|
}
|
|
146
186
|
|
|
147
187
|
.today {
|
|
148
|
-
border: 2px solid
|
|
149
|
-
|
|
188
|
+
border: 2px solid
|
|
189
|
+
var(--pd-calendar-cell-today-border-col, var(--pd-default-error-col));
|
|
150
190
|
}
|
|
151
191
|
|
|
152
192
|
.selected {
|
|
153
|
-
border: 2px solid
|
|
193
|
+
border: 2px solid transparent;
|
|
194
|
+
background-color: var(
|
|
195
|
+
--pd-calendar-cell-selected-bg-col,
|
|
196
|
+
var(--pd-default-col)
|
|
197
|
+
);
|
|
154
198
|
}
|
|
155
199
|
|
|
156
|
-
|
|
157
|
-
not from window size, this is a topic for container queries, which are not available right now... */
|
|
158
|
-
@media (max-width: 800px) {
|
|
200
|
+
@container (max-width: 800px) {
|
|
159
201
|
.cell-info {
|
|
160
|
-
font-size: 1.
|
|
202
|
+
font-size: 1.2em;
|
|
161
203
|
}
|
|
162
204
|
.cell-number {
|
|
163
205
|
font-size: 0.8em;
|
|
164
206
|
}
|
|
165
207
|
}
|
|
166
208
|
|
|
167
|
-
@
|
|
209
|
+
@container (max-width: 500px) {
|
|
168
210
|
.cell-info {
|
|
169
|
-
font-weight:
|
|
170
|
-
font-size:
|
|
211
|
+
font-weight: 500;
|
|
212
|
+
font-size: 0.95em;
|
|
213
|
+
}
|
|
214
|
+
.cell-number {
|
|
215
|
+
font-size: 0.75em;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
@container (max-width: 300px) {
|
|
220
|
+
.cell-number.top-left {
|
|
221
|
+
left: 2px;
|
|
222
|
+
top: 2px;
|
|
223
|
+
}
|
|
224
|
+
.cell-info {
|
|
225
|
+
font-size: 0.85em;
|
|
171
226
|
}
|
|
172
227
|
}
|
|
173
228
|
`
|
|
174
229
|
];
|
|
175
230
|
}
|
|
176
231
|
render() {
|
|
177
|
-
return this.selectEnabled ? this._renderSelectableCell() : this.
|
|
232
|
+
return this.selectEnabled && !this.disabled ? this._renderSelectableCell() : this._renderNonSelectableCell();
|
|
233
|
+
}
|
|
234
|
+
_handleSelect() {
|
|
235
|
+
const userSelectedDate = parse(this.key, "YYYY-MM-DD");
|
|
236
|
+
if (this.key && userSelectedDate) {
|
|
237
|
+
this.dispatchEvent(
|
|
238
|
+
new CustomEvent("select-date", {
|
|
239
|
+
detail: { dateKey: this.key, date: userSelectedDate },
|
|
240
|
+
bubbles: true,
|
|
241
|
+
composed: true
|
|
242
|
+
})
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Determines if this is a weekend day.
|
|
248
|
+
*/
|
|
249
|
+
_isWeekend() {
|
|
250
|
+
return this.weekDayNumber === 0 || this.weekDayNumber === 6;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Builds CSS class string for the cell.
|
|
254
|
+
*/
|
|
255
|
+
_getCellClasses(isSelectable) {
|
|
256
|
+
const classes = ["cell", "cell-day", this.numberClass];
|
|
257
|
+
const hasCategory = !!this.category;
|
|
258
|
+
if (isSelectable) {
|
|
259
|
+
classes.push(hasCategory ? "categorized" : "free");
|
|
260
|
+
}
|
|
261
|
+
if (this._isWeekend() && !hasCategory) {
|
|
262
|
+
classes.push("we");
|
|
263
|
+
}
|
|
264
|
+
if (this.selected) {
|
|
265
|
+
classes.push("selection");
|
|
266
|
+
}
|
|
267
|
+
return classes.join(" ");
|
|
178
268
|
}
|
|
179
269
|
_renderSelectableCell() {
|
|
180
|
-
const
|
|
181
|
-
"cell",
|
|
182
|
-
"cell-day"
|
|
183
|
-
|
|
184
|
-
this.special ? "special" : "free",
|
|
185
|
-
(this.weekDayNumber === 6 || this.weekDayNumber === 0) && !this.special ? "we" : ""
|
|
186
|
-
].join(" ");
|
|
270
|
+
const style = this._getCategoryStyle(
|
|
271
|
+
"--pd-calendar-cell-day-category-bg-col",
|
|
272
|
+
"--pd-calendar-cell-day-category-text-col"
|
|
273
|
+
);
|
|
187
274
|
return html`
|
|
188
275
|
<div
|
|
189
|
-
@click
|
|
190
|
-
@mouseenter
|
|
191
|
-
@mouseleave
|
|
192
|
-
class="${
|
|
193
|
-
|
|
276
|
+
@click="${this._selectableCellClicked}"
|
|
277
|
+
@mouseenter="${this._mouseEnter}"
|
|
278
|
+
@mouseleave="${this._mouseLeave}"
|
|
279
|
+
class="${this._getCellClasses(true)}"
|
|
280
|
+
style="${style}"
|
|
281
|
+
data-date="${this.key}"
|
|
194
282
|
>
|
|
195
|
-
${this.
|
|
196
|
-
${this.today ? html`<div
|
|
197
|
-
|
|
283
|
+
${this.title ? html`<div class="cell-info">${this.title}</div>` : nothing}
|
|
284
|
+
${this.today || this.selected ? html`<div
|
|
285
|
+
class="number-ring ${classMap({
|
|
286
|
+
today: this.today,
|
|
287
|
+
selected: this.selected
|
|
288
|
+
})}"
|
|
289
|
+
></div>` : nothing}
|
|
198
290
|
<div class="cell-number ${this.numberClass}">${this.dayNumber}</div>
|
|
199
291
|
</div>
|
|
200
292
|
`;
|
|
201
293
|
}
|
|
202
|
-
|
|
203
|
-
const baseClasses = [
|
|
204
|
-
"cell",
|
|
205
|
-
"cell-day",
|
|
206
|
-
this.numberClass,
|
|
207
|
-
(this.weekDayNumber === 6 || this.weekDayNumber === 0) && !this.special ? "we" : ""
|
|
208
|
-
].join(" ");
|
|
294
|
+
_renderNonSelectableCell() {
|
|
209
295
|
return html`
|
|
210
|
-
<div class="${
|
|
211
|
-
${this.
|
|
296
|
+
<div class="${this._getCellClasses(false)}">
|
|
297
|
+
${this.title ? html`<div class="cell-info">${this.title}</div>` : nothing}
|
|
212
298
|
<div class="cell-number ${this.numberClass}">${this.dayNumber}</div>
|
|
213
299
|
</div>
|
|
214
300
|
`;
|
|
215
301
|
}
|
|
216
|
-
_selectableCellClicked(
|
|
217
|
-
|
|
218
|
-
const dateKey = target.dataset.date;
|
|
219
|
-
if (dateKey) {
|
|
220
|
-
const userSelectedDate = parse(dateKey, "YYYY-MM-DD");
|
|
221
|
-
this.dispatchEvent(
|
|
222
|
-
new CustomEvent("select-date", {
|
|
223
|
-
detail: { dateKey, date: userSelectedDate },
|
|
224
|
-
bubbles: true,
|
|
225
|
-
composed: true
|
|
226
|
-
})
|
|
227
|
-
);
|
|
228
|
-
}
|
|
302
|
+
_selectableCellClicked() {
|
|
303
|
+
this._handleSelect();
|
|
229
304
|
}
|
|
230
305
|
_mouseEnter() {
|
|
231
306
|
const userSelectedDate = parse(this.key, "YYYY-MM-DD");
|
|
@@ -253,25 +328,10 @@ __decorateClass([
|
|
|
253
328
|
property({ type: Boolean })
|
|
254
329
|
], PdCalendarCell.prototype, "today");
|
|
255
330
|
__decorateClass([
|
|
256
|
-
property({ type: Boolean })
|
|
257
|
-
], PdCalendarCell.prototype, "
|
|
258
|
-
__decorateClass([
|
|
259
|
-
property({ type: Boolean })
|
|
260
|
-
], PdCalendarCell.prototype, "special");
|
|
261
|
-
__decorateClass([
|
|
262
|
-
property({ type: String })
|
|
263
|
-
], PdCalendarCell.prototype, "infoTxt");
|
|
331
|
+
property({ type: Boolean, reflect: true })
|
|
332
|
+
], PdCalendarCell.prototype, "focused");
|
|
264
333
|
__decorateClass([
|
|
265
334
|
property({ type: String })
|
|
266
335
|
], PdCalendarCell.prototype, "numberClass");
|
|
267
|
-
__decorateClass([
|
|
268
|
-
property({ type: String })
|
|
269
|
-
], PdCalendarCell.prototype, "key");
|
|
270
|
-
__decorateClass([
|
|
271
|
-
property({ type: Number })
|
|
272
|
-
], PdCalendarCell.prototype, "weekDayNumber");
|
|
273
|
-
__decorateClass([
|
|
274
|
-
property({ type: Number })
|
|
275
|
-
], PdCalendarCell.prototype, "dayNumber");
|
|
276
336
|
|
|
277
337
|
export { PdCalendarCell };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { nothing, CSSResultGroup } from 'lit';
|
|
2
|
+
import { PdCalendarPanelBase } from '../../shared/PdCalendarPanelBase.js';
|
|
3
|
+
import { CalendarCellInfo, CalendarConfig } from '../../types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Panel showing all events for a given day.
|
|
6
|
+
* Opens when clicking the overflow indicator ("+N weitere") in the month view.
|
|
7
|
+
*
|
|
8
|
+
* @tagname pd-calendar-day-events-panel
|
|
9
|
+
*
|
|
10
|
+
* @event select-event - Fired when an entry row is clicked.
|
|
11
|
+
* Detail: `{ dateKey: string, entry: CalendarCellInfo, index: number, anchorRect: DOMRect }`.
|
|
12
|
+
* @event close-panel - Fired when the panel should close.
|
|
13
|
+
*/
|
|
14
|
+
export declare class PdCalendarDayEventsPanel extends PdCalendarPanelBase {
|
|
15
|
+
entries: CalendarCellInfo[];
|
|
16
|
+
dateKey: string;
|
|
17
|
+
config?: CalendarConfig;
|
|
18
|
+
static styles: CSSResultGroup;
|
|
19
|
+
render(): typeof nothing | import('lit').TemplateResult;
|
|
20
|
+
protected renderHeaderContent(): import('lit').TemplateResult<1>;
|
|
21
|
+
protected renderBody(): import('lit').TemplateResult<1>;
|
|
22
|
+
private _onEntryClick;
|
|
23
|
+
private _formatDateShort;
|
|
24
|
+
private _formatEntryTime;
|
|
25
|
+
private _resolveCategoryConfig;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=PdCalendarDayEventsPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PdCalendarDayEventsPanel.d.ts","sourceRoot":"","sources":["../../../src/pd-calendar/pd-calendar-day-events-panel/PdCalendarDayEventsPanel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAKzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EAEf,MAAM,gBAAgB,CAAC;AAGxB;;;;;;;;;GASG;AACH,qBAAa,wBAAyB,SAAQ,mBAAmB;IACpC,OAAO,EAAE,gBAAgB,EAAE,CAAM;IAChC,OAAO,SAAM;IACb,MAAM,CAAC,EAAE,cAAc,CAAC;IAEpD,OAAgB,MAAM,EAAE,cAAc,CAkDpC;IAEO,MAAM;cAKI,mBAAmB;cAQnB,UAAU;IA4B7B,OAAO,CAAC,aAAa;IAwBrB,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,sBAAsB;CAM/B"}
|