@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 CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "progressive development calendar web component",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "author": "PD Progressive Development",
6
- "version": "0.0.12",
6
+ "version": "0.0.13",
7
7
  "main": "index.js",
8
8
  "module": "index.js",
9
9
  "scripts": {
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
  }
@@ -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}) {