@progressive-development/pd-calendar 0.2.4 → 0.2.6
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/PdCalendarCell.js +29 -0
package/package.json
CHANGED
package/src/PdCalendarCell.js
CHANGED
|
@@ -195,6 +195,8 @@ class PdCalendarCell extends LitElement {
|
|
|
195
195
|
return html` <div
|
|
196
196
|
@keypress="${this._selectableCellClicked}"
|
|
197
197
|
@click="${this._selectableCellClicked}"
|
|
198
|
+
@mouseenter="${this._mouseEnter}"
|
|
199
|
+
@mouseleave="${this._mouseLeave}"
|
|
198
200
|
data-date="${this.key}"
|
|
199
201
|
class="cell cell-day ${this.numberClass} ${this.special ? 'special' : 'free'}
|
|
200
202
|
${this.weekDayNumber === 6 ||
|
|
@@ -254,6 +256,33 @@ class PdCalendarCell extends LitElement {
|
|
|
254
256
|
);
|
|
255
257
|
}
|
|
256
258
|
}
|
|
259
|
+
|
|
260
|
+
_mouseEnter(e) {
|
|
261
|
+
// convert back to date
|
|
262
|
+
const userSelectedDate = parse(this.key, 'YYYY-MM-DD');
|
|
263
|
+
this.dispatchEvent(
|
|
264
|
+
new CustomEvent('mouse-enter-date', {
|
|
265
|
+
detail: {
|
|
266
|
+
dateKey: this.key,
|
|
267
|
+
date: userSelectedDate,
|
|
268
|
+
bubbles: true,
|
|
269
|
+
composed: true
|
|
270
|
+
},
|
|
271
|
+
})
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
_mouseLeave() {
|
|
276
|
+
this.dispatchEvent(
|
|
277
|
+
new CustomEvent('mouse-leave-date', {
|
|
278
|
+
detail: {
|
|
279
|
+
bubbles: true,
|
|
280
|
+
composed: true
|
|
281
|
+
},
|
|
282
|
+
})
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
|
|
257
286
|
}
|
|
258
287
|
|
|
259
288
|
window.customElements.define('pd-calendar-cell', PdCalendarCell);
|