@progressive-development/pd-calendar 0.9.2 → 1.0.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.
Files changed (118) hide show
  1. package/LICENSE +21 -2
  2. package/README.md +32 -57
  3. package/dist/generated/locales/be.d.ts +3 -0
  4. package/dist/generated/locales/be.d.ts.map +1 -1
  5. package/dist/generated/locales/de.d.ts +3 -0
  6. package/dist/generated/locales/de.d.ts.map +1 -1
  7. package/dist/generated/locales/en.d.ts +3 -0
  8. package/dist/generated/locales/en.d.ts.map +1 -1
  9. package/dist/index.d.ts +10 -1
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +16 -0
  12. package/dist/locales/be.js +4 -1
  13. package/dist/locales/de.js +3 -0
  14. package/dist/locales/en.js +4 -1
  15. package/dist/pd-calendar/PdCalendar.d.ts +101 -18
  16. package/dist/pd-calendar/PdCalendar.d.ts.map +1 -1
  17. package/dist/pd-calendar/PdCalendar.js +380 -264
  18. package/dist/pd-calendar/pd-calendar-cell/PdCalendarCell.d.ts +40 -33
  19. package/dist/pd-calendar/pd-calendar-cell/PdCalendarCell.d.ts.map +1 -1
  20. package/dist/pd-calendar/pd-calendar-cell/PdCalendarCell.js +173 -113
  21. package/dist/pd-calendar/pd-calendar-day-events-panel/PdCalendarDayEventsPanel.d.ts +27 -0
  22. package/dist/pd-calendar/pd-calendar-day-events-panel/PdCalendarDayEventsPanel.d.ts.map +1 -0
  23. package/dist/pd-calendar/pd-calendar-day-events-panel/PdCalendarDayEventsPanel.js +160 -0
  24. package/dist/pd-calendar/pd-calendar-day-events-panel/pd-calendar-day-events-panel.d.ts +3 -0
  25. package/dist/pd-calendar/pd-calendar-day-events-panel/pd-calendar-day-events-panel.d.ts.map +1 -0
  26. package/dist/pd-calendar/pd-calendar-day-events-panel/pd-calendar-day-events-panel.js +8 -0
  27. package/dist/pd-calendar/pd-calendar-event-cell/PdCalendarEventCell.d.ts +55 -0
  28. package/dist/pd-calendar/pd-calendar-event-cell/PdCalendarEventCell.d.ts.map +1 -0
  29. package/dist/pd-calendar/pd-calendar-event-cell/PdCalendarEventCell.js +341 -0
  30. package/dist/pd-calendar/pd-calendar-event-cell/pd-calendar-event-cell.d.ts +3 -0
  31. package/dist/pd-calendar/pd-calendar-event-cell/pd-calendar-event-cell.d.ts.map +1 -0
  32. package/dist/pd-calendar/pd-calendar-event-cell/pd-calendar-event-cell.js +8 -0
  33. package/dist/pd-calendar/pd-calendar-event-info-panel/PdCalendarEventInfoPanel.d.ts +29 -0
  34. package/dist/pd-calendar/pd-calendar-event-info-panel/PdCalendarEventInfoPanel.d.ts.map +1 -0
  35. package/dist/pd-calendar/pd-calendar-event-info-panel/PdCalendarEventInfoPanel.js +211 -0
  36. package/dist/pd-calendar/pd-calendar-event-info-panel/pd-calendar-event-info-panel.d.ts +3 -0
  37. package/dist/pd-calendar/pd-calendar-event-info-panel/pd-calendar-event-info-panel.d.ts.map +1 -0
  38. package/dist/pd-calendar/pd-calendar-event-info-panel/pd-calendar-event-info-panel.js +8 -0
  39. package/dist/pd-calendar/pd-calendar-list-cell/PdCalendarListCell.d.ts +28 -0
  40. package/dist/pd-calendar/pd-calendar-list-cell/PdCalendarListCell.d.ts.map +1 -0
  41. package/dist/pd-calendar/pd-calendar-list-cell/PdCalendarListCell.js +252 -0
  42. package/dist/pd-calendar/pd-calendar-list-cell/pd-calendar-list-cell.d.ts +3 -0
  43. package/dist/pd-calendar/pd-calendar-list-cell/pd-calendar-list-cell.d.ts.map +1 -0
  44. package/dist/pd-calendar/pd-calendar-list-cell/pd-calendar-list-cell.js +8 -0
  45. package/dist/pd-calendar/pd-calendar-list-view/PdCalendarListView.d.ts +26 -0
  46. package/dist/pd-calendar/pd-calendar-list-view/PdCalendarListView.d.ts.map +1 -0
  47. package/dist/pd-calendar/pd-calendar-list-view/PdCalendarListView.js +165 -0
  48. package/dist/pd-calendar/pd-calendar-list-view/pd-calendar-list-view.d.ts +3 -0
  49. package/dist/pd-calendar/pd-calendar-list-view/pd-calendar-list-view.d.ts.map +1 -0
  50. package/dist/pd-calendar/pd-calendar-list-view/pd-calendar-list-view.js +8 -0
  51. package/dist/pd-calendar/pd-calendar-month-view/PdCalendarMonthView.d.ts +55 -0
  52. package/dist/pd-calendar/pd-calendar-month-view/PdCalendarMonthView.d.ts.map +1 -0
  53. package/dist/pd-calendar/pd-calendar-month-view/PdCalendarMonthView.js +461 -0
  54. package/dist/pd-calendar/pd-calendar-month-view/pd-calendar-month-view.d.ts +3 -0
  55. package/dist/pd-calendar/pd-calendar-month-view/pd-calendar-month-view.d.ts.map +1 -0
  56. package/dist/pd-calendar/pd-calendar-month-view/pd-calendar-month-view.js +8 -0
  57. package/dist/pd-calendar/pd-calendar-time-grid-view/PdCalendarTimeGridView.d.ts +32 -0
  58. package/dist/pd-calendar/pd-calendar-time-grid-view/PdCalendarTimeGridView.d.ts.map +1 -0
  59. package/dist/pd-calendar/pd-calendar-time-grid-view/PdCalendarTimeGridView.js +468 -0
  60. package/dist/pd-calendar/pd-calendar-time-grid-view/pd-calendar-time-grid-view.d.ts +3 -0
  61. package/dist/pd-calendar/pd-calendar-time-grid-view/pd-calendar-time-grid-view.d.ts.map +1 -0
  62. package/dist/pd-calendar/pd-calendar-time-grid-view/pd-calendar-time-grid-view.js +8 -0
  63. package/dist/pd-calendar/pd-calendar-week-cell/PdCalendarWeekCell.d.ts +31 -0
  64. package/dist/pd-calendar/pd-calendar-week-cell/PdCalendarWeekCell.d.ts.map +1 -0
  65. package/dist/pd-calendar/pd-calendar-week-cell/PdCalendarWeekCell.js +134 -0
  66. package/dist/pd-calendar/pd-calendar-week-cell/pd-calendar-week-cell.d.ts +3 -0
  67. package/dist/pd-calendar/pd-calendar-week-cell/pd-calendar-week-cell.d.ts.map +1 -0
  68. package/dist/pd-calendar/pd-calendar-week-cell/pd-calendar-week-cell.js +8 -0
  69. package/dist/pd-calendar/pd-calendar.stories.d.ts +79 -19
  70. package/dist/pd-calendar/pd-calendar.stories.d.ts.map +1 -1
  71. package/dist/pd-calendar/pd-year-popup/PdYearPopup.d.ts +22 -11
  72. package/dist/pd-calendar/pd-year-popup/PdYearPopup.d.ts.map +1 -1
  73. package/dist/pd-calendar/pd-year-popup/PdYearPopup.js +152 -34
  74. package/dist/pd-datepicker/PdDatepicker.d.ts +76 -7
  75. package/dist/pd-datepicker/PdDatepicker.d.ts.map +1 -1
  76. package/dist/pd-datepicker/PdDatepicker.js +257 -50
  77. package/dist/pd-datepicker/pd-date-picker.stories.d.ts +78 -20
  78. package/dist/pd-datepicker/pd-date-picker.stories.d.ts.map +1 -1
  79. package/dist/pd-slot-picker/PdSlotPicker.d.ts +102 -0
  80. package/dist/pd-slot-picker/PdSlotPicker.d.ts.map +1 -0
  81. package/dist/pd-slot-picker/PdSlotPicker.js +339 -0
  82. package/dist/pd-slot-picker/pd-slot-cell/PdSlotCell.d.ts +35 -0
  83. package/dist/pd-slot-picker/pd-slot-cell/PdSlotCell.d.ts.map +1 -0
  84. package/dist/pd-slot-picker/pd-slot-cell/PdSlotCell.js +188 -0
  85. package/dist/pd-slot-picker/pd-slot-cell/pd-slot-cell.d.ts +3 -0
  86. package/dist/pd-slot-picker/pd-slot-cell/pd-slot-cell.d.ts.map +1 -0
  87. package/dist/pd-slot-picker/pd-slot-cell/pd-slot-cell.js +8 -0
  88. package/dist/pd-slot-picker/pd-slot-picker.d.ts +3 -0
  89. package/dist/pd-slot-picker/pd-slot-picker.d.ts.map +1 -0
  90. package/dist/pd-slot-picker/pd-slot-picker.stories.d.ts +67 -0
  91. package/dist/pd-slot-picker/pd-slot-picker.stories.d.ts.map +1 -0
  92. package/dist/pd-slot-picker.d.ts +2 -0
  93. package/dist/pd-slot-picker.js +8 -0
  94. package/dist/shared/PdBaseCell.d.ts +68 -0
  95. package/dist/shared/PdBaseCell.d.ts.map +1 -0
  96. package/dist/shared/PdBaseCell.js +120 -0
  97. package/dist/shared/PdBaseView.d.ts +22 -0
  98. package/dist/shared/PdBaseView.d.ts.map +1 -0
  99. package/dist/shared/PdBaseView.js +46 -0
  100. package/dist/shared/PdCalendarPanelBase.d.ts +34 -0
  101. package/dist/shared/PdCalendarPanelBase.d.ts.map +1 -0
  102. package/dist/shared/PdCalendarPanelBase.js +169 -0
  103. package/dist/shared/calendar-button-bar/calendar-button-bar.d.ts +41 -0
  104. package/dist/shared/calendar-button-bar/calendar-button-bar.d.ts.map +1 -0
  105. package/dist/shared/calendar-button-bar/calendar-button-bar.js +435 -0
  106. package/dist/shared/calendar-locales.d.ts +9 -0
  107. package/dist/shared/calendar-locales.d.ts.map +1 -0
  108. package/dist/shared/calendar-locales.js +30 -0
  109. package/dist/shared/calendar-utils.d.ts +34 -0
  110. package/dist/shared/calendar-utils.d.ts.map +1 -0
  111. package/dist/shared/calendar-utils.js +99 -0
  112. package/dist/shared/calendar-utils.test.d.ts +2 -0
  113. package/dist/shared/calendar-utils.test.d.ts.map +1 -0
  114. package/dist/types.d.ts +102 -1
  115. package/dist/types.d.ts.map +1 -1
  116. package/package.json +10 -5
  117. package/dist/pd-calendar/pd-calendar-cell/pd-calendar-cell.stories.d.ts +0 -15
  118. package/dist/pd-calendar/pd-calendar-cell/pd-calendar-cell.stories.d.ts.map +0 -1
@@ -0,0 +1,211 @@
1
+ import { css, nothing, html } from 'lit';
2
+ import { property } from 'lit/decorators.js';
3
+ import { formatShortDate } from '@progressive-development/pd-utils';
4
+ import { pdIcons } from '@progressive-development/pd-icon';
5
+ import { PdCalendarPanelBase } from '../../shared/PdCalendarPanelBase.js';
6
+ import { LOCALES } from '../../shared/calendar-locales.js';
7
+
8
+ var __defProp = Object.defineProperty;
9
+ var __decorateClass = (decorators, target, key, kind) => {
10
+ var result = void 0 ;
11
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
12
+ if (decorator = decorators[i])
13
+ result = (decorator(target, key, result) ) || result;
14
+ if (result) __defProp(target, key, result);
15
+ return result;
16
+ };
17
+ class PdCalendarEventInfoPanel extends PdCalendarPanelBase {
18
+ constructor() {
19
+ super(...arguments);
20
+ this.dateKey = "";
21
+ this.actions = {
22
+ detail: true,
23
+ edit: true,
24
+ delete: true
25
+ };
26
+ }
27
+ static {
28
+ this.styles = [
29
+ PdCalendarPanelBase.panelBaseStyles,
30
+ css`
31
+ .category-stripe {
32
+ width: 4px;
33
+ align-self: stretch;
34
+ border-radius: 2px;
35
+ flex-shrink: 0;
36
+ }
37
+
38
+ .header-text {
39
+ font-size: 0.8rem;
40
+ color: var(--pd-default-font-light-col, #6b7280);
41
+ white-space: nowrap;
42
+ overflow: hidden;
43
+ text-overflow: ellipsis;
44
+ }
45
+
46
+ .title {
47
+ font-size: 1rem;
48
+ font-weight: 600;
49
+ color: var(--pd-default-font-col, #111827);
50
+ }
51
+
52
+ .description {
53
+ font-size: 0.85rem;
54
+ color: var(--pd-default-font-light-col, #6b7280);
55
+ }
56
+
57
+ .location {
58
+ font-size: 0.8rem;
59
+ color: var(--pd-default-font-light-col, #6b7280);
60
+ }
61
+
62
+ .participants {
63
+ font-size: 0.8rem;
64
+ color: var(--pd-default-font-light-col, #6b7280);
65
+ }
66
+
67
+ .divider {
68
+ border: none;
69
+ border-top: 1px solid var(--pd-default-disabled-light-col, #e5e7eb);
70
+ margin: var(--pd-spacing-xs, 0.25rem) 0;
71
+ }
72
+
73
+ .actions {
74
+ display: flex;
75
+ align-items: center;
76
+ justify-content: center;
77
+ gap: var(--pd-spacing-md, 1rem);
78
+ padding: var(--pd-spacing-xs, 0.25rem) 0;
79
+ }
80
+
81
+ .action-icon {
82
+ cursor: pointer;
83
+ opacity: 0.6;
84
+ transition: opacity 0.15s ease;
85
+ --pd-icon-size: 20px;
86
+ }
87
+
88
+ .action-icon:hover {
89
+ opacity: 1;
90
+ }
91
+ `
92
+ ];
93
+ }
94
+ render() {
95
+ if (!this.entry) return nothing;
96
+ return super.render();
97
+ }
98
+ renderHeaderContent() {
99
+ const categoryConfig = this._resolveCategoryConfig(this.entry?.category);
100
+ const headerInfo = this._formatHeaderInfo();
101
+ return html`
102
+ ${categoryConfig?.color ? html`<span
103
+ class="category-stripe"
104
+ style="background-color: ${categoryConfig.color}"
105
+ ></span>` : nothing}
106
+ <span class="header-text">${headerInfo}</span>
107
+ `;
108
+ }
109
+ renderBody() {
110
+ if (!this.entry) return nothing;
111
+ const participantNames = this._formatParticipants();
112
+ const hasActions = this.actions.detail || this.actions.edit || this.actions.delete;
113
+ return html`
114
+ ${this.entry.info ? html`<span class="title">${this.entry.info}</span>` : nothing}
115
+ ${this.entry.desc ? html`<span class="description">${this.entry.desc}</span>` : nothing}
116
+ ${this.entry.location ? html`<span class="location">${this.entry.location}</span>` : nothing}
117
+ ${participantNames ? html`<span class="participants">${participantNames}</span>` : nothing}
118
+ ${hasActions ? html`
119
+ <hr class="divider" />
120
+ <div class="actions">
121
+ ${this.actions.detail ? html`
122
+ <pd-icon
123
+ class="action-icon"
124
+ icon="${pdIcons.ICON_DETAIL}"
125
+ @click="${() => this._onAction("detail")}"
126
+ ></pd-icon>
127
+ ` : nothing}
128
+ ${this.actions.edit ? html`
129
+ <pd-icon
130
+ class="action-icon"
131
+ icon="${pdIcons.ICON_EDIT_NEW}"
132
+ @click="${() => this._onAction("edit")}"
133
+ ></pd-icon>
134
+ ` : nothing}
135
+ ${this.actions.delete ? html`
136
+ <pd-icon
137
+ class="action-icon"
138
+ icon="${pdIcons.ICON_DELETE_NEW}"
139
+ @click="${() => this._onAction("delete")}"
140
+ ></pd-icon>
141
+ ` : nothing}
142
+ </div>
143
+ ` : nothing}
144
+ `;
145
+ }
146
+ // ===========================================================================
147
+ // Actions
148
+ // ===========================================================================
149
+ _onAction(action) {
150
+ this.dispatchEvent(
151
+ new CustomEvent("event-action", {
152
+ detail: { action, dateKey: this.dateKey, entry: this.entry },
153
+ bubbles: true,
154
+ composed: true
155
+ })
156
+ );
157
+ }
158
+ // ===========================================================================
159
+ // Formatting
160
+ // ===========================================================================
161
+ _formatHeaderInfo() {
162
+ const datePart = this._formatDateShort();
163
+ const timePart = this._formatTimeShort();
164
+ if (datePart && timePart) return `${datePart} · ${timePart}`;
165
+ return datePart || timePart;
166
+ }
167
+ _formatDateShort() {
168
+ if (!this.dateKey) return "";
169
+ const [yearStr, monthStr, dayStr] = this.dateKey.split("-");
170
+ const date = new Date(
171
+ Number(yearStr),
172
+ Number(monthStr) - 1,
173
+ Number(dayStr)
174
+ );
175
+ const dayOfWeek = date.getDay();
176
+ const localeIdx = dayOfWeek === 0 ? 6 : dayOfWeek - 1;
177
+ const weekday = LOCALES.weekdaysShort[localeIdx];
178
+ return `${weekday}, ${formatShortDate(date, false)}`;
179
+ }
180
+ _formatTimeShort() {
181
+ if (!this.entry) return "";
182
+ if (this.entry.fullDay) return "24h";
183
+ if (this.entry.startTime && this.entry.endTime) {
184
+ return `${this.entry.startTime}-${this.entry.endTime}`;
185
+ }
186
+ if (this.entry.startTime) return this.entry.startTime;
187
+ return "";
188
+ }
189
+ _formatParticipants() {
190
+ if (!this.entry?.participants?.length) return "";
191
+ return this.entry.participants.map((p) => p.name || p.email || "").filter(Boolean).join(", ");
192
+ }
193
+ _resolveCategoryConfig(category) {
194
+ if (!category) return void 0;
195
+ return this.config?.categories?.[category];
196
+ }
197
+ }
198
+ __decorateClass([
199
+ property({ type: Object })
200
+ ], PdCalendarEventInfoPanel.prototype, "entry");
201
+ __decorateClass([
202
+ property({ type: String })
203
+ ], PdCalendarEventInfoPanel.prototype, "dateKey");
204
+ __decorateClass([
205
+ property({ type: Object })
206
+ ], PdCalendarEventInfoPanel.prototype, "actions");
207
+ __decorateClass([
208
+ property({ type: Object })
209
+ ], PdCalendarEventInfoPanel.prototype, "config");
210
+
211
+ export { PdCalendarEventInfoPanel };
@@ -0,0 +1,3 @@
1
+ import { PdCalendarEventInfoPanel } from './PdCalendarEventInfoPanel.js';
2
+ export { PdCalendarEventInfoPanel };
3
+ //# sourceMappingURL=pd-calendar-event-info-panel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pd-calendar-event-info-panel.d.ts","sourceRoot":"","sources":["../../../src/pd-calendar/pd-calendar-event-info-panel/pd-calendar-event-info-panel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAOzE,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { PdCalendarEventInfoPanel } from './PdCalendarEventInfoPanel.js';
2
+
3
+ const tag = "pd-calendar-event-info-panel";
4
+ if (!customElements.get(tag)) {
5
+ customElements.define(tag, PdCalendarEventInfoPanel);
6
+ }
7
+
8
+ export { PdCalendarEventInfoPanel };
@@ -0,0 +1,28 @@
1
+ import { CSSResultGroup } from 'lit';
2
+ import { PdBaseCell } from '../../shared/PdBaseCell.js';
3
+ import { CalendarCellInfo } from '../../types.js';
4
+ /**
5
+ * A list cell component for displaying calendar entries in list view.
6
+ * Shows date, weekday, title, and optional description in a horizontal row.
7
+ */
8
+ export declare class PdCalendarListCell extends PdBaseCell {
9
+ /** The month number (1-12). */
10
+ monthNumber: number;
11
+ /** The year (e.g., 2026). */
12
+ yearNumber: number;
13
+ /** The full entry object for this cell. */
14
+ entry?: CalendarCellInfo;
15
+ /** Index of this entry within the day's entries array. */
16
+ entryIndex: number;
17
+ /** Weekday abbreviations (German). */
18
+ private _weekDayNames;
19
+ static styles: CSSResultGroup;
20
+ render(): import('lit').TemplateResult<1>;
21
+ protected _handleSelect(): void;
22
+ /**
23
+ * Formats the date as dd.mm.yy
24
+ */
25
+ private _formatDate;
26
+ private _handleClick;
27
+ }
28
+ //# sourceMappingURL=PdCalendarListCell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PdCalendarListCell.d.ts","sourceRoot":"","sources":["../../../src/pd-calendar/pd-calendar-list-cell/PdCalendarListCell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAa,MAAM,KAAK,CAAC;AAGhD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;;GAGG;AACH,qBACa,kBAAmB,SAAQ,UAAU;IAChD,+BAA+B;IAE/B,WAAW,SAAK;IAEhB,6BAA6B;IAE7B,UAAU,SAAK;IAEf,2CAA2C;IAE3C,KAAK,CAAC,EAAE,gBAAgB,CAAC;IAEzB,0DAA0D;IAE1D,UAAU,SAAK;IAEf,sCAAsC;IACtC,OAAO,CAAC,aAAa,CAA8C;IAEnE,OAAgB,MAAM,EAAE,cAAc,CAyJpC;IAEO,MAAM;cAkCI,aAAa,IAAI,IAAI;IAiBxC;;OAEG;IACH,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,YAAY;CAGrB"}
@@ -0,0 +1,252 @@
1
+ import { css, html } from 'lit';
2
+ import { property, customElement } from 'lit/decorators.js';
3
+ import { PdBaseCell } from '../../shared/PdBaseCell.js';
4
+
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 PdCalendarListCell = class extends PdBaseCell {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.monthNumber = 0;
19
+ this.yearNumber = 0;
20
+ this.entryIndex = 0;
21
+ /** Weekday abbreviations (German). */
22
+ this._weekDayNames = ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"];
23
+ }
24
+ render() {
25
+ const dateFormatted = this._formatDate();
26
+ const weekDay = this._weekDayNames[this.weekDayNumber];
27
+ const timeInfo = this._formatTime("-");
28
+ const cellClasses = this.category ? "list-cell categorized" : "list-cell";
29
+ const style = this._getCategoryStyle(
30
+ "--pd-calendar-list-cell-category-bg-col",
31
+ "--pd-calendar-list-cell-category-text-col"
32
+ );
33
+ return html`
34
+ <div
35
+ class="${cellClasses}"
36
+ style="${style}"
37
+ data-date="${this.key}"
38
+ @click="${this._handleClick}"
39
+ @keydown="${this._handleKeyDown}"
40
+ >
41
+ <div class="date-group">
42
+ <span class="date-formatted">${dateFormatted}</span>
43
+ <span class="weekday"
44
+ >${weekDay}${timeInfo ? html` ${timeInfo}` : ""}</span
45
+ >
46
+ </div>
47
+ <div class="content-group">
48
+ ${this.title ? html`<span class="title">${this.title}</span>` : ""}
49
+ ${this.desc ? html`<span class="description">${this.desc}</span>` : ""}
50
+ </div>
51
+ </div>
52
+ `;
53
+ }
54
+ _handleSelect() {
55
+ if (this.disabled) return;
56
+ this.dispatchEvent(
57
+ new CustomEvent("select-event", {
58
+ detail: {
59
+ dateKey: this.key,
60
+ entry: this.entry,
61
+ index: this.entryIndex,
62
+ anchorRect: this.getBoundingClientRect()
63
+ },
64
+ bubbles: true,
65
+ composed: true
66
+ })
67
+ );
68
+ }
69
+ /**
70
+ * Formats the date as dd.mm.yy
71
+ */
72
+ _formatDate() {
73
+ const day = this.dayNumber.toString().padStart(2, "0");
74
+ const month = this.monthNumber.toString().padStart(2, "0");
75
+ const year = this.yearNumber.toString().slice(-2);
76
+ return `${day}.${month}.${year}`;
77
+ }
78
+ _handleClick() {
79
+ this._handleSelect();
80
+ }
81
+ };
82
+ PdCalendarListCell.styles = [
83
+ css`
84
+ :host {
85
+ display: block;
86
+ container-type: inline-size;
87
+ }
88
+
89
+ .list-cell {
90
+ display: flex;
91
+ flex-direction: column;
92
+ gap: var(--pd-spacing-xs, 0.25rem);
93
+ padding: var(--pd-spacing-sm, 0.5rem) var(--pd-spacing-md, 1rem);
94
+ background-color: var(
95
+ --pd-calendar-list-cell-bg-col,
96
+ var(--pd-default-lightest-col, #f9fafb)
97
+ );
98
+ border-radius: var(--pd-radius-sm, 4px);
99
+ cursor: pointer;
100
+ transition: background-color 0.15s ease;
101
+ }
102
+
103
+ .list-cell:hover {
104
+ background-color: var(
105
+ --pd-calendar-list-cell-bg-col-hover,
106
+ var(--pd-default-light-col, #f3f4f6)
107
+ );
108
+ }
109
+
110
+ :host([selected]) .list-cell {
111
+ background-color: var(
112
+ --pd-calendar-list-cell-selected-bg-col,
113
+ var(--pd-default-success-light-col, #dcfce7)
114
+ );
115
+ border-left: 3px solid
116
+ var(
117
+ --pd-calendar-list-cell-selected-border-col,
118
+ var(--pd-default-success-col, #22c55e)
119
+ );
120
+ }
121
+
122
+ :host([disabled]) .list-cell {
123
+ opacity: 0.4;
124
+ cursor: not-allowed;
125
+ pointer-events: none;
126
+ }
127
+
128
+ /* Categorized cells - colors set via inline style from category config */
129
+ .list-cell.categorized {
130
+ background-color: var(
131
+ --pd-calendar-list-cell-category-bg-col,
132
+ var(--pd-default-success-light-col, #dcfce7)
133
+ );
134
+ }
135
+
136
+ .list-cell.categorized .date-formatted,
137
+ .list-cell.categorized .weekday,
138
+ .list-cell.categorized .title,
139
+ .list-cell.categorized .description {
140
+ color: var(--pd-calendar-list-cell-category-text-col);
141
+ }
142
+
143
+ /* === COMPACT LAYOUT (default, < 400px) === */
144
+ /* Row 1: Date, Weekday, Title inline */
145
+ .date-group {
146
+ display: flex;
147
+ align-items: center;
148
+ gap: var(--pd-spacing-sm, 0.5rem);
149
+ }
150
+
151
+ .content-group {
152
+ display: contents;
153
+ }
154
+
155
+ .date-formatted {
156
+ font-size: var(--pd-calendar-list-cell-date-size, 0.9rem);
157
+ font-weight: 600;
158
+ color: var(
159
+ --pd-calendar-list-cell-date-col,
160
+ var(--pd-default-font-col, #374151)
161
+ );
162
+ white-space: nowrap;
163
+ }
164
+
165
+ .weekday {
166
+ font-size: var(--pd-calendar-list-cell-weekday-size, 0.75rem);
167
+ color: var(
168
+ --pd-calendar-list-cell-weekday-col,
169
+ var(--pd-default-font-light-col, #6b7280)
170
+ );
171
+ text-transform: uppercase;
172
+ white-space: nowrap;
173
+ }
174
+
175
+ .title {
176
+ font-size: var(--pd-calendar-list-cell-title-size, 1rem);
177
+ font-weight: 500;
178
+ color: var(
179
+ --pd-calendar-list-cell-title-col,
180
+ var(--pd-default-font-col, #111827)
181
+ );
182
+ overflow: hidden;
183
+ text-overflow: ellipsis;
184
+ }
185
+
186
+ /* Row 2: Description full width */
187
+ .description {
188
+ font-size: var(--pd-calendar-list-cell-desc-size, 0.875rem);
189
+ color: var(
190
+ --pd-calendar-list-cell-desc-col,
191
+ var(--pd-default-font-light-col, #6b7280)
192
+ );
193
+ white-space: nowrap;
194
+ overflow: hidden;
195
+ text-overflow: ellipsis;
196
+ }
197
+
198
+ /* === WIDE LAYOUT (>= 400px) === */
199
+ @container (min-width: 400px) {
200
+ .list-cell {
201
+ flex-direction: row;
202
+ align-items: flex-start;
203
+ gap: var(--pd-spacing-md, 1rem);
204
+ }
205
+
206
+ /* Left column: Date + Weekday stacked */
207
+ .date-group {
208
+ flex-direction: column;
209
+ align-items: flex-start;
210
+ gap: 0;
211
+ min-width: 5.5em;
212
+ }
213
+
214
+ /* Right column: Title + Description stacked */
215
+ .content-group {
216
+ display: flex;
217
+ flex-direction: column;
218
+ flex: 1;
219
+ min-width: 0;
220
+ gap: var(--pd-spacing-xs, 0.25rem);
221
+ }
222
+
223
+ .title {
224
+ white-space: nowrap;
225
+ }
226
+ }
227
+
228
+ /* Focus styles for keyboard navigation */
229
+ :host(:focus-visible) .list-cell {
230
+ outline: 2px solid
231
+ var(--pd-focus-ring-col, var(--pd-default-info-col, #3b82f6));
232
+ outline-offset: 2px;
233
+ }
234
+ `
235
+ ];
236
+ __decorateClass([
237
+ property({ type: Number })
238
+ ], PdCalendarListCell.prototype, "monthNumber", 2);
239
+ __decorateClass([
240
+ property({ type: Number })
241
+ ], PdCalendarListCell.prototype, "yearNumber", 2);
242
+ __decorateClass([
243
+ property({ type: Object })
244
+ ], PdCalendarListCell.prototype, "entry", 2);
245
+ __decorateClass([
246
+ property({ type: Number })
247
+ ], PdCalendarListCell.prototype, "entryIndex", 2);
248
+ PdCalendarListCell = __decorateClass([
249
+ customElement("pd-calendar-list-cell")
250
+ ], PdCalendarListCell);
251
+
252
+ export { PdCalendarListCell };
@@ -0,0 +1,3 @@
1
+ import { PdCalendarListCell } from './PdCalendarListCell.js';
2
+ export { PdCalendarListCell };
3
+ //# sourceMappingURL=pd-calendar-list-cell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pd-calendar-list-cell.d.ts","sourceRoot":"","sources":["../../../src/pd-calendar/pd-calendar-list-cell/pd-calendar-list-cell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAO7D,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { PdCalendarListCell } from './PdCalendarListCell.js';
2
+
3
+ const tag = "pd-calendar-list-cell";
4
+ if (!customElements.get(tag)) {
5
+ customElements.define(tag, PdCalendarListCell);
6
+ }
7
+
8
+ export { PdCalendarListCell };
@@ -0,0 +1,26 @@
1
+ import { CSSResultGroup } from 'lit';
2
+ import { PdBaseView } from '../../shared/PdBaseView.js';
3
+ import { CalendarListRange } from '../../types.js';
4
+ /**
5
+ * List view component for the calendar.
6
+ * Shows only dates that have data entries (info or desc).
7
+ *
8
+ * @internal - Not exported from package, used only by PdCalendar.
9
+ */
10
+ export declare class PdCalendarListView extends PdBaseView {
11
+ /** Current date for determining the displayed month. */
12
+ currentDate: Date;
13
+ /** Custom date range. When set, shows entries within this range instead of current month. */
14
+ listRange?: CalendarListRange;
15
+ static styles: CSSResultGroup;
16
+ render(): import('lit').TemplateResult<1>;
17
+ /**
18
+ * Parses a date from Date object or string (YYYY-MM-DD format).
19
+ */
20
+ private _parseDate;
21
+ /**
22
+ * Gets list entries from calendar data for the current month or custom range.
23
+ */
24
+ private _getListEntries;
25
+ }
26
+ //# sourceMappingURL=PdCalendarListView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PdCalendarListView.d.ts","sourceRoot":"","sources":["../../../src/pd-calendar/pd-calendar-list-view/PdCalendarListView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,cAAc,EAAE,MAAM,KAAK,CAAC;AAKhD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAoB,MAAM,gBAAgB,CAAC;AAErE,OAAO,mDAAmD,CAAC;AAE3D;;;;;GAKG;AACH,qBACa,kBAAmB,SAAQ,UAAU;IAChD,wDAAwD;IAExD,WAAW,OAAc;IAEzB,6FAA6F;IAE7F,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAE9B,OAAgB,MAAM,EAAE,cAAc,CAkCpC;IAEO,MAAM;IA2Cf;;OAEG;IACH,OAAO,CAAC,UAAU;IAMlB;;OAEG;IACH,OAAO,CAAC,eAAe;CA8FxB"}