@progressive-development/pd-calendar 0.2.14 → 0.2.16

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.2.14",
6
+ "version": "0.2.16",
7
7
  "main": "index.js",
8
8
  "module": "index.js",
9
9
  "scripts": {
package/src/PdCalendar.js CHANGED
@@ -125,7 +125,7 @@ export class PdCalendar extends LitElement {
125
125
  return {
126
126
  refDate: { type: Object },
127
127
  selectableDates: { type: Boolean},
128
- withYearPopup: { type: Boolean},
128
+ withYearPopup: { type: Array},
129
129
  showSelection: { type: Boolean},
130
130
  hideWeekend: { type: Boolean, reflect: true },
131
131
  prevMonthConstraint: { type: Number },
@@ -385,7 +385,7 @@ export class PdCalendar extends LitElement {
385
385
  </div>
386
386
 
387
387
  <div id="titleContentId" class="content-title">
388
- ${this._monthName} ${this.withYearPopup ? html`
388
+ ${this._monthName} ${this.withYearPopup && this.withYearPopup.length > 0 ? html`
389
389
  <span class="year-popup-link" @click="${this._openYearPopup}">${this._year}</span>
390
390
  ` : html`${this._year}`}
391
391
  </div>
@@ -415,7 +415,7 @@ export class PdCalendar extends LitElement {
415
415
  _openYearPopup() {
416
416
 
417
417
  const popup = new PdYearPopup();
418
- popup.yearSelection = ["2024", "2025"];
418
+ popup.yearSelection = this.withYearPopup;
419
419
  this.shadowRoot.getElementById("titleContentId").appendChild(popup);
420
420
 
421
421
  popup.addEventListener("abort-year-selection", () => {
@@ -513,8 +513,7 @@ export class PdCalendar extends LitElement {
513
513
 
514
514
  // eslint-disable-next-line class-methods-use-this
515
515
  _touchStartEvent(e) {
516
- this._wheelDelta = e.changedTouches[0].screenX;
517
- e.preventDefault();
516
+ this._wheelDelta = e.changedTouches[0].screenX;
518
517
  e.stopPropagation();
519
518
  }
520
519
 
@@ -527,8 +526,6 @@ export class PdCalendar extends LitElement {
527
526
  } else if (result > TOUCH_MIN_MOVE) {
528
527
  this._nextMonth();
529
528
  }
530
-
531
- e.preventDefault();
532
529
  e.stopPropagation();
533
530
  }
534
531