@progressive-development/pd-calendar 0.0.12 → 0.0.13
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/package.json +1 -1
- package/src/PdCalendar.js +10 -3
- package/stories/index.stories.js +1 -3
package/package.json
CHANGED
package/src/PdCalendar.js
CHANGED
|
@@ -261,6 +261,7 @@ export class PdCalendar extends LitElement {
|
|
|
261
261
|
?selectEnabled="${infoTxt !== undefined}"
|
|
262
262
|
?special="${special}"
|
|
263
263
|
numberClass="${this.numberClass}"
|
|
264
|
+
@select-date="${this._forwardEvent}"
|
|
264
265
|
></pd-calendar-cell>
|
|
265
266
|
`);
|
|
266
267
|
}
|
|
@@ -341,9 +342,6 @@ export class PdCalendar extends LitElement {
|
|
|
341
342
|
}
|
|
342
343
|
|
|
343
344
|
_initFromDate(date) {
|
|
344
|
-
|
|
345
|
-
console.log("Init date with: ", date);
|
|
346
|
-
|
|
347
345
|
this._monthName = date.toLocaleString('default', { month: 'long' });
|
|
348
346
|
this._year = date.getFullYear();
|
|
349
347
|
this._daysFromPreviousMonth = PdCalendar._getPreviousMonthDays(date);
|
|
@@ -382,4 +380,13 @@ export class PdCalendar extends LitElement {
|
|
|
382
380
|
}
|
|
383
381
|
return true;
|
|
384
382
|
}
|
|
383
|
+
|
|
384
|
+
// Forward Event from Calendar Cell, could be refactored
|
|
385
|
+
_forwardEvent(e) {
|
|
386
|
+
this.dispatchEvent(
|
|
387
|
+
new CustomEvent('select-date', {
|
|
388
|
+
detail: e.detail
|
|
389
|
+
})
|
|
390
|
+
);
|
|
391
|
+
}
|
|
385
392
|
}
|
package/stories/index.stories.js
CHANGED
|
@@ -4,9 +4,7 @@ import { format } from 'fecha';
|
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
title: 'PdCalendar/Calendar',
|
|
7
|
-
component: 'pd-calendar',
|
|
8
|
-
argTypes: {
|
|
9
|
-
},
|
|
7
|
+
component: 'pd-calendar',
|
|
10
8
|
};
|
|
11
9
|
|
|
12
10
|
function CalendarTemplate({ refDate, data, prevMonthConstraint, nextMonthConstraint, addSlot}) {
|