@progressive-development/pd-calendar 0.6.7 → 0.9.2
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/locales/be.d.ts +4 -0
- package/dist/generated/locales/be.d.ts.map +1 -1
- package/dist/generated/locales/de.d.ts +4 -0
- package/dist/generated/locales/de.d.ts.map +1 -1
- package/dist/generated/locales/en.d.ts +4 -0
- package/dist/generated/locales/en.d.ts.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -10
- package/dist/locales/be.js +7 -4
- package/dist/locales/de.js +7 -4
- package/dist/locales/en.js +7 -4
- package/dist/pd-calendar/PdCalendar.d.ts +50 -0
- package/dist/pd-calendar/PdCalendar.d.ts.map +1 -0
- package/dist/pd-calendar/PdCalendar.js +434 -0
- package/dist/{pd-calendar-cell.d.ts → pd-calendar/pd-calendar-cell/PdCalendarCell.d.ts} +4 -2
- package/dist/pd-calendar/pd-calendar-cell/PdCalendarCell.d.ts.map +1 -0
- package/dist/{pd-calendar-cell.js → pd-calendar/pd-calendar-cell/PdCalendarCell.js} +97 -102
- package/dist/pd-calendar/pd-calendar-cell/pd-calendar-cell.d.ts +3 -0
- package/dist/pd-calendar/pd-calendar-cell/pd-calendar-cell.d.ts.map +1 -0
- package/dist/pd-calendar/pd-calendar-cell/pd-calendar-cell.js +8 -0
- package/dist/{stories/cell.stories.d.ts → pd-calendar/pd-calendar-cell/pd-calendar-cell.stories.d.ts} +2 -2
- package/dist/pd-calendar/pd-calendar-cell/pd-calendar-cell.stories.d.ts.map +1 -0
- package/dist/pd-calendar/pd-calendar.d.ts +3 -0
- package/dist/pd-calendar/pd-calendar.d.ts.map +1 -0
- package/dist/{stories/index.stories.d.ts → pd-calendar/pd-calendar.stories.d.ts} +2 -2
- package/dist/pd-calendar/pd-calendar.stories.d.ts.map +1 -0
- package/dist/{pd-year-popup.d.ts → pd-calendar/pd-year-popup/PdYearPopup.d.ts} +4 -2
- package/dist/pd-calendar/pd-year-popup/PdYearPopup.d.ts.map +1 -0
- package/dist/{pd-year-popup.js → pd-calendar/pd-year-popup/PdYearPopup.js} +57 -62
- package/dist/pd-calendar/pd-year-popup/pd-year-popup.d.ts +3 -0
- package/dist/pd-calendar/pd-year-popup/pd-year-popup.d.ts.map +1 -0
- package/dist/pd-calendar/pd-year-popup/pd-year-popup.js +8 -0
- package/dist/pd-calendar.d.ts +2 -48
- package/dist/pd-calendar.js +6 -437
- package/dist/pd-datepicker/PdDatepicker.d.ts +112 -0
- package/dist/pd-datepicker/PdDatepicker.d.ts.map +1 -0
- package/dist/pd-datepicker/PdDatepicker.js +494 -0
- package/dist/pd-datepicker/pd-date-picker.stories.d.ts +23 -0
- package/dist/pd-datepicker/pd-date-picker.stories.d.ts.map +1 -0
- package/dist/pd-datepicker/pd-datepicker.d.ts +3 -0
- package/dist/pd-datepicker/pd-datepicker.d.ts.map +1 -0
- package/dist/pd-datepicker.d.ts +2 -0
- package/dist/pd-datepicker.js +8 -0
- package/package.json +29 -46
- package/dist/pd-calendar-cell.d.ts.map +0 -1
- package/dist/pd-calendar.d.ts.map +0 -1
- package/dist/pd-year-popup.d.ts.map +0 -1
- package/dist/stories/cell.stories.d.ts.map +0 -1
- package/dist/stories/index.stories.d.ts.map +0 -1
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { property
|
|
3
|
-
import { parse } from
|
|
4
|
-
|
|
1
|
+
import { LitElement, css, html } from 'lit';
|
|
2
|
+
import { property } from 'lit/decorators.js';
|
|
3
|
+
import { parse } from 'fecha';
|
|
4
|
+
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
6
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
8
|
-
var result =
|
|
7
|
+
var result = void 0 ;
|
|
9
8
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
10
9
|
if (decorator = decorators[i])
|
|
11
|
-
result = (
|
|
12
|
-
if (
|
|
10
|
+
result = (decorator(target, key, result) ) || result;
|
|
11
|
+
if (result) __defProp(target, key, result);
|
|
13
12
|
return result;
|
|
14
13
|
};
|
|
15
|
-
|
|
14
|
+
class PdCalendarCell extends LitElement {
|
|
16
15
|
constructor() {
|
|
17
16
|
super(...arguments);
|
|
18
17
|
this.selectEnabled = false;
|
|
@@ -25,83 +24,9 @@ let PdCalendarCell = class extends LitElement {
|
|
|
25
24
|
this.weekDayNumber = -1;
|
|
26
25
|
this.dayNumber = -1;
|
|
27
26
|
}
|
|
28
|
-
|
|
29
|
-
|
|
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`
|
|
27
|
+
static {
|
|
28
|
+
this.styles = [
|
|
29
|
+
css`
|
|
105
30
|
:host {
|
|
106
31
|
display: block;
|
|
107
32
|
}
|
|
@@ -246,37 +171,107 @@ PdCalendarCell.styles = [
|
|
|
246
171
|
}
|
|
247
172
|
}
|
|
248
173
|
`
|
|
249
|
-
];
|
|
174
|
+
];
|
|
175
|
+
}
|
|
176
|
+
render() {
|
|
177
|
+
return this.selectEnabled ? this._renderSelectableCell() : this._renderEmptyCell();
|
|
178
|
+
}
|
|
179
|
+
_renderSelectableCell() {
|
|
180
|
+
const baseClasses = [
|
|
181
|
+
"cell",
|
|
182
|
+
"cell-day",
|
|
183
|
+
this.numberClass,
|
|
184
|
+
this.special ? "special" : "free",
|
|
185
|
+
(this.weekDayNumber === 6 || this.weekDayNumber === 0) && !this.special ? "we" : ""
|
|
186
|
+
].join(" ");
|
|
187
|
+
return html`
|
|
188
|
+
<div
|
|
189
|
+
@click=${this._selectableCellClicked}
|
|
190
|
+
@mouseenter=${this._mouseEnter}
|
|
191
|
+
@mouseleave=${this._mouseLeave}
|
|
192
|
+
class="${baseClasses}"
|
|
193
|
+
data-date=${this.key}
|
|
194
|
+
>
|
|
195
|
+
${this.infoTxt ? html`<div class="cell-info">${this.infoTxt}</div>` : ""}
|
|
196
|
+
${this.today ? html`<div class="number-ring today"></div>` : ""}
|
|
197
|
+
${this.selected ? html`<div class="number-ring selected"></div>` : ""}
|
|
198
|
+
<div class="cell-number ${this.numberClass}">${this.dayNumber}</div>
|
|
199
|
+
</div>
|
|
200
|
+
`;
|
|
201
|
+
}
|
|
202
|
+
_renderEmptyCell() {
|
|
203
|
+
const baseClasses = [
|
|
204
|
+
"cell",
|
|
205
|
+
"cell-day",
|
|
206
|
+
this.numberClass,
|
|
207
|
+
(this.weekDayNumber === 6 || this.weekDayNumber === 0) && !this.special ? "we" : ""
|
|
208
|
+
].join(" ");
|
|
209
|
+
return html`
|
|
210
|
+
<div class="${baseClasses}">
|
|
211
|
+
${this.infoTxt ? html`<div class="cell-info">${this.infoTxt}</div>` : ""}
|
|
212
|
+
<div class="cell-number ${this.numberClass}">${this.dayNumber}</div>
|
|
213
|
+
</div>
|
|
214
|
+
`;
|
|
215
|
+
}
|
|
216
|
+
_selectableCellClicked(e) {
|
|
217
|
+
const target = e.currentTarget;
|
|
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
|
+
}
|
|
229
|
+
}
|
|
230
|
+
_mouseEnter() {
|
|
231
|
+
const userSelectedDate = parse(this.key, "YYYY-MM-DD");
|
|
232
|
+
this.dispatchEvent(
|
|
233
|
+
new CustomEvent("mouse-enter-date", {
|
|
234
|
+
detail: { dateKey: this.key, date: userSelectedDate },
|
|
235
|
+
bubbles: true,
|
|
236
|
+
composed: true
|
|
237
|
+
})
|
|
238
|
+
);
|
|
239
|
+
}
|
|
240
|
+
_mouseLeave() {
|
|
241
|
+
this.dispatchEvent(
|
|
242
|
+
new CustomEvent("mouse-leave-date", {
|
|
243
|
+
bubbles: true,
|
|
244
|
+
composed: true
|
|
245
|
+
})
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
250
249
|
__decorateClass([
|
|
251
250
|
property({ type: Boolean })
|
|
252
|
-
], PdCalendarCell.prototype, "selectEnabled"
|
|
251
|
+
], PdCalendarCell.prototype, "selectEnabled");
|
|
253
252
|
__decorateClass([
|
|
254
253
|
property({ type: Boolean })
|
|
255
|
-
], PdCalendarCell.prototype, "today"
|
|
254
|
+
], PdCalendarCell.prototype, "today");
|
|
256
255
|
__decorateClass([
|
|
257
256
|
property({ type: Boolean })
|
|
258
|
-
], PdCalendarCell.prototype, "selected"
|
|
257
|
+
], PdCalendarCell.prototype, "selected");
|
|
259
258
|
__decorateClass([
|
|
260
259
|
property({ type: Boolean })
|
|
261
|
-
], PdCalendarCell.prototype, "special"
|
|
260
|
+
], PdCalendarCell.prototype, "special");
|
|
262
261
|
__decorateClass([
|
|
263
262
|
property({ type: String })
|
|
264
|
-
], PdCalendarCell.prototype, "infoTxt"
|
|
263
|
+
], PdCalendarCell.prototype, "infoTxt");
|
|
265
264
|
__decorateClass([
|
|
266
265
|
property({ type: String })
|
|
267
|
-
], PdCalendarCell.prototype, "numberClass"
|
|
266
|
+
], PdCalendarCell.prototype, "numberClass");
|
|
268
267
|
__decorateClass([
|
|
269
268
|
property({ type: String })
|
|
270
|
-
], PdCalendarCell.prototype, "key"
|
|
269
|
+
], PdCalendarCell.prototype, "key");
|
|
271
270
|
__decorateClass([
|
|
272
271
|
property({ type: Number })
|
|
273
|
-
], PdCalendarCell.prototype, "weekDayNumber"
|
|
272
|
+
], PdCalendarCell.prototype, "weekDayNumber");
|
|
274
273
|
__decorateClass([
|
|
275
274
|
property({ type: Number })
|
|
276
|
-
], PdCalendarCell.prototype, "dayNumber"
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
], PdCalendarCell);
|
|
280
|
-
export {
|
|
281
|
-
PdCalendarCell
|
|
282
|
-
};
|
|
275
|
+
], PdCalendarCell.prototype, "dayNumber");
|
|
276
|
+
|
|
277
|
+
export { PdCalendarCell };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pd-calendar-cell.d.ts","sourceRoot":"","sources":["../../../src/pd-calendar/pd-calendar-cell/pd-calendar-cell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAOrD,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/web-components';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
render: ({ infoTxt }: import('@storybook/web-components').Args) => import('lit
|
|
4
|
+
render: ({ infoTxt }: import('@storybook/web-components').Args) => import('lit').TemplateResult<1>;
|
|
5
5
|
argTypes: {};
|
|
6
6
|
parameters: {
|
|
7
7
|
actions: {
|
|
@@ -12,4 +12,4 @@ declare const meta: {
|
|
|
12
12
|
export default meta;
|
|
13
13
|
type Story = StoryObj;
|
|
14
14
|
export declare const BasicCell: Story;
|
|
15
|
-
//# sourceMappingURL=cell.stories.d.ts.map
|
|
15
|
+
//# sourceMappingURL=pd-calendar-cell.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pd-calendar-cell.stories.d.ts","sourceRoot":"","sources":["../../../src/pd-calendar/pd-calendar-cell/pd-calendar-cell.stories.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,uBAAuB,CAAC;AAG/B,QAAA,MAAM,IAAI;;;;;;;;;CAuCM,CAAC;AAEjB,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC;AAEtB,eAAO,MAAM,SAAS,EAAE,KAQvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pd-calendar.d.ts","sourceRoot":"","sources":["../../src/pd-calendar/pd-calendar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAO7C,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/web-components';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
render: ({ hideWeekend, refDate, data, prevMonthConstraint, nextMonthConstraint, addSlot, }: import('@storybook/web-components').Args) => import('lit
|
|
4
|
+
render: ({ hideWeekend, refDate, data, prevMonthConstraint, nextMonthConstraint, addSlot, }: import('@storybook/web-components').Args) => import('lit').TemplateResult<1>;
|
|
5
5
|
argTypes: {};
|
|
6
6
|
parameters: {
|
|
7
7
|
actions: {
|
|
@@ -20,4 +20,4 @@ export declare const BasicSmall: Story;
|
|
|
20
20
|
export declare const BasicSmallHugeYearSelection: Story;
|
|
21
21
|
export declare const BasicSmallWithRefDate: Story;
|
|
22
22
|
export declare const BasicSmallWithoutWeekend: Story;
|
|
23
|
-
//# sourceMappingURL=
|
|
23
|
+
//# sourceMappingURL=pd-calendar.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pd-calendar.stories.d.ts","sourceRoot":"","sources":["../../src/pd-calendar/pd-calendar.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAIhE,OAAO,kBAAkB,CAAC;AAG1B,QAAA,MAAM,IAAI;;;;;;;;;CAwBM,CAAC;AAEjB,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC;AActB,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAC;AAUF,eAAO,MAAM,sBAAsB,EAAE,KAOpC,CAAC;AAiBF,eAAO,MAAM,eAAe,EAAE,KAO7B,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,KAQxC,CAAC;AAIF,eAAO,MAAM,8BAA8B,EAAE,KAM5C,CAAC;AA2CF,eAAO,MAAM,UAAU,EAAE,KA0BxB,CAAC;AAOF,eAAO,MAAM,2BAA2B,EAAE,KA2BzC,CAAC;AAIF,eAAO,MAAM,qBAAqB,EAAE,KA+BnC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,KA0BtC,CAAC"}
|
|
@@ -7,6 +7,8 @@ import { LitElement, CSSResultGroup } from 'lit';
|
|
|
7
7
|
*
|
|
8
8
|
* @fires change-year-selection – wenn ein Jahr ausgewählt wurde
|
|
9
9
|
* @fires abort-year-selection – wenn außerhalb geklickt wird / keine Auswahl
|
|
10
|
+
*
|
|
11
|
+
* @tagname pd-year-popup
|
|
10
12
|
*/
|
|
11
13
|
export declare class PdYearPopup extends LitElement {
|
|
12
14
|
/**
|
|
@@ -18,8 +20,8 @@ export declare class PdYearPopup extends LitElement {
|
|
|
18
20
|
*/
|
|
19
21
|
currentYear: string;
|
|
20
22
|
static styles: CSSResultGroup;
|
|
21
|
-
render(): import('lit
|
|
23
|
+
render(): import('lit').TemplateResult<1>;
|
|
22
24
|
private _yearSelection;
|
|
23
25
|
private _closeSelection;
|
|
24
26
|
}
|
|
25
|
-
//# sourceMappingURL=
|
|
27
|
+
//# sourceMappingURL=PdYearPopup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PdYearPopup.d.ts","sourceRoot":"","sources":["../../../src/pd-calendar/pd-year-popup/PdYearPopup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAa,cAAc,EAAE,MAAM,KAAK,CAAC;AAG5D;;;;;;;;;;GAUG;AACH,qBAAa,WAAY,SAAQ,UAAU;IACzC;;OAEG;IAEH,aAAa,EAAE,MAAM,EAAE,CAAM;IAE7B;;OAEG;IAEH,WAAW,SAAM;IAEjB,OAAgB,MAAM,EAAE,cAAc,CA6DpC;IAEO,MAAM;IAkBf,OAAO,CAAC,cAAc;IAgBtB,OAAO,CAAC,eAAe;CAQxB"}
|
|
@@ -1,67 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { property
|
|
3
|
-
|
|
1
|
+
import { LitElement, css, html } from 'lit';
|
|
2
|
+
import { property } from 'lit/decorators.js';
|
|
3
|
+
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
5
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
7
|
-
var result =
|
|
6
|
+
var result = void 0 ;
|
|
8
7
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9
8
|
if (decorator = decorators[i])
|
|
10
|
-
result = (
|
|
11
|
-
if (
|
|
9
|
+
result = (decorator(target, key, result) ) || result;
|
|
10
|
+
if (result) __defProp(target, key, result);
|
|
12
11
|
return result;
|
|
13
12
|
};
|
|
14
|
-
|
|
13
|
+
class PdYearPopup extends LitElement {
|
|
15
14
|
constructor() {
|
|
16
15
|
super(...arguments);
|
|
17
16
|
this.yearSelection = [];
|
|
18
17
|
this.currentYear = "";
|
|
19
18
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
${this.yearSelection.map(
|
|
24
|
-
(year) => html`
|
|
25
|
-
<li
|
|
26
|
-
class="${this.currentYear === year ? "current" : "selectable"}"
|
|
27
|
-
data-year="${year}"
|
|
28
|
-
@click=${this._yearSelection}
|
|
29
|
-
>
|
|
30
|
-
${year}
|
|
31
|
-
</li>
|
|
32
|
-
`
|
|
33
|
-
)}
|
|
34
|
-
</ul>
|
|
35
|
-
`;
|
|
36
|
-
}
|
|
37
|
-
_yearSelection(event) {
|
|
38
|
-
const target = event.currentTarget;
|
|
39
|
-
const year = target.dataset.year;
|
|
40
|
-
if (year) {
|
|
41
|
-
this.dispatchEvent(
|
|
42
|
-
new CustomEvent("change-year-selection", {
|
|
43
|
-
detail: { year },
|
|
44
|
-
bubbles: true,
|
|
45
|
-
composed: true
|
|
46
|
-
})
|
|
47
|
-
);
|
|
48
|
-
} else {
|
|
49
|
-
this._closeSelection();
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
_closeSelection() {
|
|
53
|
-
this.dispatchEvent(
|
|
54
|
-
new CustomEvent("abort-year-selection", {
|
|
55
|
-
bubbles: true,
|
|
56
|
-
composed: true
|
|
57
|
-
})
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
PdYearPopup.styles = [
|
|
62
|
-
PdColorStyles,
|
|
63
|
-
PdFontStyles,
|
|
64
|
-
css`
|
|
19
|
+
static {
|
|
20
|
+
this.styles = [
|
|
21
|
+
css`
|
|
65
22
|
:host {
|
|
66
23
|
position: absolute;
|
|
67
24
|
z-index: 10;
|
|
@@ -121,16 +78,54 @@ PdYearPopup.styles = [
|
|
|
121
78
|
font-weight: bold;
|
|
122
79
|
}
|
|
123
80
|
`
|
|
124
|
-
];
|
|
81
|
+
];
|
|
82
|
+
}
|
|
83
|
+
render() {
|
|
84
|
+
return html`
|
|
85
|
+
<ul>
|
|
86
|
+
${this.yearSelection.map(
|
|
87
|
+
(year) => html`
|
|
88
|
+
<li
|
|
89
|
+
class="${this.currentYear === year ? "current" : "selectable"}"
|
|
90
|
+
data-year="${year}"
|
|
91
|
+
@click=${this._yearSelection}
|
|
92
|
+
>
|
|
93
|
+
${year}
|
|
94
|
+
</li>
|
|
95
|
+
`
|
|
96
|
+
)}
|
|
97
|
+
</ul>
|
|
98
|
+
`;
|
|
99
|
+
}
|
|
100
|
+
_yearSelection(event) {
|
|
101
|
+
const target = event.currentTarget;
|
|
102
|
+
const year = target.dataset.year;
|
|
103
|
+
if (year) {
|
|
104
|
+
this.dispatchEvent(
|
|
105
|
+
new CustomEvent("change-year-selection", {
|
|
106
|
+
detail: { year },
|
|
107
|
+
bubbles: true,
|
|
108
|
+
composed: true
|
|
109
|
+
})
|
|
110
|
+
);
|
|
111
|
+
} else {
|
|
112
|
+
this._closeSelection();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
_closeSelection() {
|
|
116
|
+
this.dispatchEvent(
|
|
117
|
+
new CustomEvent("abort-year-selection", {
|
|
118
|
+
bubbles: true,
|
|
119
|
+
composed: true
|
|
120
|
+
})
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
125
124
|
__decorateClass([
|
|
126
125
|
property({ type: Array })
|
|
127
|
-
], PdYearPopup.prototype, "yearSelection"
|
|
126
|
+
], PdYearPopup.prototype, "yearSelection");
|
|
128
127
|
__decorateClass([
|
|
129
128
|
property({ type: String })
|
|
130
|
-
], PdYearPopup.prototype, "currentYear"
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
], PdYearPopup);
|
|
134
|
-
export {
|
|
135
|
-
PdYearPopup
|
|
136
|
-
};
|
|
129
|
+
], PdYearPopup.prototype, "currentYear");
|
|
130
|
+
|
|
131
|
+
export { PdYearPopup };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pd-year-popup.d.ts","sourceRoot":"","sources":["../../../src/pd-calendar/pd-year-popup/pd-year-popup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAO/C,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/pd-calendar.d.ts
CHANGED
|
@@ -1,48 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
}
|
|
48
|
-
//# sourceMappingURL=pd-calendar.d.ts.map
|
|
1
|
+
export * from './pd-calendar/pd-calendar'
|
|
2
|
+
export {}
|