@watermarkinsights/ripple 5.21.0-alpha.1 → 5.21.0-alpha.3
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/cjs/{app-globals-84a1a262.js → app-globals-b999e811.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/priv-calendar.cjs.entry.js +10 -10
- package/dist/cjs/ripple.cjs.js +1 -1
- package/dist/cjs/wm-date-range.cjs.entry.js +10 -6
- package/dist/cjs/wm-datepicker.cjs.entry.js +10 -6
- package/dist/cjs/wm-input.cjs.entry.js +1 -1
- package/dist/cjs/wm-nested-select.cjs.entry.js +1 -1
- package/dist/cjs/wm-option_2.cjs.entry.js +1 -1
- package/dist/cjs/wm-tag-input.cjs.entry.js +1 -1
- package/dist/cjs/wm-textarea.cjs.entry.js +1 -1
- package/dist/cjs/wm-timepicker.cjs.entry.js +1 -1
- package/dist/cjs/wm-uploader.cjs.entry.js +1 -1
- package/dist/collection/components/datepickers/datepicker.css +1 -1
- package/dist/collection/components/datepickers/priv-calendar/priv-calendar.css +7 -10
- package/dist/collection/components/datepickers/priv-calendar/priv-calendar.js +9 -9
- package/dist/collection/components/datepickers/wm-date-range.js +9 -5
- package/dist/collection/components/datepickers/wm-datepicker.js +10 -6
- package/dist/collection/components/selects/wm-nested-select/wm-nested-select.css +1 -1
- package/dist/collection/components/selects/wm-select/wm-select.css +1 -1
- package/dist/collection/components/wm-input/wm-input.css +1 -1
- package/dist/collection/components/wm-tag-input/wm-tag-input.css +1 -1
- package/dist/collection/components/wm-textarea/wm-textarea.css +1 -1
- package/dist/collection/components/wm-timepicker/wm-timepicker.css +1 -1
- package/dist/collection/components/wm-uploader/wm-uploader.css +1 -1
- package/dist/esm/{app-globals-1505b33c.js → app-globals-3da2b209.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/priv-calendar.entry.js +10 -10
- package/dist/esm/ripple.js +1 -1
- package/dist/esm/wm-date-range.entry.js +10 -6
- package/dist/esm/wm-datepicker.entry.js +10 -6
- package/dist/esm/wm-input.entry.js +1 -1
- package/dist/esm/wm-nested-select.entry.js +1 -1
- package/dist/esm/wm-option_2.entry.js +1 -1
- package/dist/esm/wm-tag-input.entry.js +1 -1
- package/dist/esm/wm-textarea.entry.js +1 -1
- package/dist/esm/wm-timepicker.entry.js +1 -1
- package/dist/esm/wm-uploader.entry.js +1 -1
- package/dist/esm-es5/{app-globals-1505b33c.js → app-globals-3da2b209.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/priv-calendar.entry.js +1 -1
- package/dist/esm-es5/ripple.js +1 -1
- package/dist/esm-es5/wm-date-range.entry.js +1 -1
- package/dist/esm-es5/wm-datepicker.entry.js +1 -1
- package/dist/esm-es5/wm-input.entry.js +1 -1
- package/dist/esm-es5/wm-nested-select.entry.js +1 -1
- package/dist/esm-es5/wm-option_2.entry.js +1 -1
- package/dist/esm-es5/wm-tag-input.entry.js +1 -1
- package/dist/esm-es5/wm-textarea.entry.js +1 -1
- package/dist/esm-es5/wm-timepicker.entry.js +1 -1
- package/dist/esm-es5/wm-uploader.entry.js +1 -1
- package/dist/ripple/p-22cbfae3.entry.js +1 -0
- package/dist/ripple/{p-736dc15d.system.entry.js → p-2e6a00b8.system.entry.js} +1 -1
- package/dist/ripple/{p-321d4148.system.entry.js → p-466e929a.system.entry.js} +1 -1
- package/dist/ripple/{p-99a2a45c.entry.js → p-52809f00.entry.js} +1 -1
- package/dist/ripple/{p-65ba88b7.system.js → p-5c11ded6.system.js} +1 -1
- package/dist/ripple/{p-0460b298.entry.js → p-5f54cc72.entry.js} +1 -1
- package/dist/ripple/{p-61f780ab.entry.js → p-6324b988.entry.js} +1 -1
- package/dist/ripple/{p-0a47f460.entry.js → p-6eeec16f.entry.js} +1 -1
- package/dist/ripple/{p-dab72fca.system.entry.js → p-7176d77c.system.entry.js} +1 -1
- package/dist/ripple/{p-73d1ec58.js → p-73f5e414.js} +1 -1
- package/dist/ripple/{p-3b9ddb71.system.entry.js → p-822d0762.system.entry.js} +1 -1
- package/dist/ripple/{p-140d1765.system.entry.js → p-87e4a0d5.system.entry.js} +1 -1
- package/dist/ripple/p-8a14c33d.entry.js +1 -0
- package/dist/ripple/{p-020e58d2.system.entry.js → p-8f6aa68c.system.entry.js} +1 -1
- package/dist/ripple/{p-e9d745e1.system.js → p-9a0ebc18.system.js} +1 -1
- package/dist/ripple/{p-4086d2f2.system.entry.js → p-a2646792.system.entry.js} +1 -1
- package/dist/ripple/{p-eb68ec38.entry.js → p-a76fd8bc.entry.js} +1 -1
- package/dist/ripple/{p-3ef56754.system.entry.js → p-b1b9f0de.system.entry.js} +1 -1
- package/dist/ripple/p-be4f76b4.entry.js +1 -0
- package/dist/ripple/{p-21361a84.entry.js → p-cc1ab21b.entry.js} +1 -1
- package/dist/ripple/{p-7a68fd88.system.entry.js → p-e9e069bb.system.entry.js} +1 -1
- package/dist/ripple/{p-5e15c72a.system.entry.js → p-ee423b70.system.entry.js} +1 -1
- package/dist/ripple/{p-742451fa.entry.js → p-f7543de4.entry.js} +1 -1
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/package.json +2 -2
- package/dist/ripple/p-8e59cec0.entry.js +0 -1
- package/dist/ripple/p-9f27c966.entry.js +0 -1
- package/dist/ripple/p-ef3a4568.entry.js +0 -1
|
@@ -1277,13 +1277,16 @@
|
|
|
1277
1277
|
flex-basis: 42px;
|
|
1278
1278
|
}
|
|
1279
1279
|
.popup-wrapper .month-view .months {
|
|
1280
|
-
border-top: 2px solid;
|
|
1281
|
-
border-top-color: var(--wmcolor-datepicker-month-border);
|
|
1282
1280
|
display: -webkit-box;
|
|
1283
1281
|
display: -webkit-flex;
|
|
1284
1282
|
display: -ms-flexbox;
|
|
1285
1283
|
display: flex;
|
|
1286
1284
|
flex-wrap: wrap;
|
|
1285
|
+
gap: 0.125rem;
|
|
1286
|
+
background-color: var(--wmcolor-datepicker-month-border);
|
|
1287
|
+
border-top: 0.125rem solid;
|
|
1288
|
+
border-bottom: 0.125rem solid;
|
|
1289
|
+
border-color: transparent;
|
|
1287
1290
|
}
|
|
1288
1291
|
.popup-wrapper .month-view .month-row {
|
|
1289
1292
|
display: -webkit-box;
|
|
@@ -1295,8 +1298,7 @@
|
|
|
1295
1298
|
-webkit-justify-content: space-between;
|
|
1296
1299
|
justify-content: space-between;
|
|
1297
1300
|
width: 100%;
|
|
1298
|
-
|
|
1299
|
-
border-bottom-color: var(--wmcolor-datepicker-month-border);
|
|
1301
|
+
gap: 0.125rem;
|
|
1300
1302
|
}
|
|
1301
1303
|
.popup-wrapper .month-view .month {
|
|
1302
1304
|
border: none;
|
|
@@ -1309,12 +1311,7 @@
|
|
|
1309
1311
|
font-weight: 500;
|
|
1310
1312
|
color: var(--wmcolor-datepicker-month-text);
|
|
1311
1313
|
}
|
|
1312
|
-
.popup-wrapper .month-view .month:not(:last-child) {
|
|
1313
|
-
border-right: 2px solid;
|
|
1314
|
-
border-right-color: var(--wmcolor-datepicker-month-border);
|
|
1315
|
-
}
|
|
1316
1314
|
.popup-wrapper .month-view .month:hover {
|
|
1317
|
-
border-right-color: transparent;
|
|
1318
1315
|
background-color: var(--wmcolor-datepicker-month-background-hover);
|
|
1319
1316
|
}
|
|
1320
1317
|
.popup-wrapper .month-view .month:active, .popup-wrapper .month-view .month.selected {
|
|
@@ -1326,8 +1323,8 @@
|
|
|
1326
1323
|
.popup-wrapper .date-cell:focus-visible:not(.preview-start, .preview-end) {
|
|
1327
1324
|
outline: 3px solid var(--wmcolor-interactive-focus);
|
|
1328
1325
|
outline-offset: -2px;
|
|
1329
|
-
border: none;
|
|
1330
1326
|
z-index: 11;
|
|
1327
|
+
box-shadow: inset 0 0 0 4px #ffffff;
|
|
1331
1328
|
}
|
|
1332
1329
|
.popup-wrapper button:focus-visible:not(.preview-start, .preview-end)[aria-selected=true],
|
|
1333
1330
|
.popup-wrapper .month.focused:focus-visible:not(.preview-start, .preview-end)[aria-selected=true],
|
|
@@ -176,7 +176,7 @@ export class PrivCalendar {
|
|
|
176
176
|
classesArr.push("preview-end");
|
|
177
177
|
}
|
|
178
178
|
const classes = classesArr.join(" ");
|
|
179
|
-
return (h("div", { role: "gridcell", id: `cell-${date}`, class: classes, "aria-selected": selected, "aria-label": `${isToday
|
|
179
|
+
return (h("div", { role: "gridcell", id: `cell-${date}-${this.uid}`, class: classes, "aria-selected": selected, "aria-label": `${isToday
|
|
180
180
|
? `${intl.formatMessage({
|
|
181
181
|
id: "date.today",
|
|
182
182
|
defaultMessage: "today",
|
|
@@ -237,10 +237,10 @@ export class PrivCalendar {
|
|
|
237
237
|
newCell.tabIndex = 0;
|
|
238
238
|
}
|
|
239
239
|
else {
|
|
240
|
-
const oldMonthEl = this.el.querySelector(`#month-${dateFind.month.asInt(oldVal)}`);
|
|
240
|
+
const oldMonthEl = this.el.querySelector(`#month-${dateFind.month.asInt(oldVal)}-${this.uid}`);
|
|
241
241
|
if (oldMonthEl)
|
|
242
242
|
oldMonthEl.tabIndex = -1;
|
|
243
|
-
const newMonthEl = this.el.querySelector(`#month-${dateFind.month.asInt(newVal)}`);
|
|
243
|
+
const newMonthEl = this.el.querySelector(`#month-${dateFind.month.asInt(newVal)}-${this.uid}`);
|
|
244
244
|
if (newMonthEl)
|
|
245
245
|
newMonthEl.tabIndex = 0;
|
|
246
246
|
//monthToFocus.focus();
|
|
@@ -447,7 +447,7 @@ export class PrivCalendar {
|
|
|
447
447
|
return [...cellsBefore, ...dates, ...cellsAfter];
|
|
448
448
|
}
|
|
449
449
|
getCell(date) {
|
|
450
|
-
return this.el.querySelector(`#cell-${date}`);
|
|
450
|
+
return this.el.querySelector(`#cell-${date}-${this.uid}`);
|
|
451
451
|
}
|
|
452
452
|
async focusFirstFocusable() {
|
|
453
453
|
this.prevBtnEl.focus();
|
|
@@ -484,7 +484,7 @@ export class PrivCalendar {
|
|
|
484
484
|
this.el.querySelector("#wm-container").setAttribute("aria-busy", state);
|
|
485
485
|
}
|
|
486
486
|
renderMonth(month, index) {
|
|
487
|
-
return (h("button", { id: `month-${index + 1}`, class: `month ${this._focus.month.asInt() === index + 1 ? "selected focused" : ""}`, role: "gridcell", tabindex: index + 1 === this._focus.month.asInt() ? 0 : -1, onBlur: (ev) => ev.stopPropagation(), onClick: () => {
|
|
487
|
+
return (h("button", { id: `month-${index + 1}-${this.uid}`, class: `month ${this._focus.month.asInt() === index + 1 ? "selected focused" : ""}`, role: "gridcell", tabindex: index + 1 === this._focus.month.asInt() ? 0 : -1, onBlur: (ev) => ev.stopPropagation(), onClick: () => {
|
|
488
488
|
this._focus.month.set(index + 1);
|
|
489
489
|
this.view = "day";
|
|
490
490
|
this.focusCell();
|
|
@@ -500,14 +500,14 @@ export class PrivCalendar {
|
|
|
500
500
|
else if (this.view == "month") {
|
|
501
501
|
this._focus.year.decrease(1);
|
|
502
502
|
}
|
|
503
|
-
}, class: "header-btn arw-btn", ref: (el) => (this.prevBtnEl = el), "aria-label": previousButtonLabel, onMouseOver: () => showTooltip("right", this.prevBtnEl, previousButtonLabel), onMouseLeave: () => hideTooltip(), onFocus: () => showTooltip("right", this.prevBtnEl, previousButtonLabel), onBlur: () => hideTooltip() }, h("span", { class: "svg-icon svg-previous" })), h("span", { class: "header-title" }, calendar_months[this._focus.month.asInt() - 1], " ", this._focus.year.asString()),
|
|
503
|
+
}, class: "header-btn arw-btn", ref: (el) => (this.prevBtnEl = el), "aria-label": previousButtonLabel, onMouseOver: () => showTooltip("right", this.prevBtnEl, previousButtonLabel), onMouseLeave: () => hideTooltip(), onFocus: () => showTooltip("right", this.prevBtnEl, previousButtonLabel), onBlur: () => hideTooltip() }, h("span", { class: "svg-icon svg-previous" })), h("span", { class: "header-title" }, calendar_months[this._focus.month.asInt() - 1], " ", this._focus.year.asString()), h("button", { onClick: () => {
|
|
504
504
|
if (this.view == "day") {
|
|
505
505
|
this._focus.month.increase(1);
|
|
506
506
|
}
|
|
507
507
|
else if (this.view == "month") {
|
|
508
508
|
this._focus.year.increase(1);
|
|
509
509
|
}
|
|
510
|
-
}, "aria-label": nextButtonLabel, class: "header-btn arw-btn", ref: (el) => (this.nextBtnEl = el), onMouseOver: () => showTooltip("right", this.nextBtnEl, nextButtonLabel), onMouseLeave: () => hideTooltip(), onFocus: () => showTooltip("right", this.nextBtnEl, nextButtonLabel), onBlur: () => hideTooltip() }, h("span", { class: "svg-icon svg-next" }))));
|
|
510
|
+
}, "aria-label": nextButtonLabel, class: "header-btn arw-btn", ref: (el) => (this.nextBtnEl = el), onMouseOver: () => showTooltip("right", this.nextBtnEl, nextButtonLabel), onMouseLeave: () => hideTooltip(), onFocus: () => showTooltip("right", this.nextBtnEl, nextButtonLabel), onBlur: () => hideTooltip() }, h("span", { class: "svg-icon svg-next" })), this.renderToggleButton()));
|
|
511
511
|
}
|
|
512
512
|
renderToggleButton() {
|
|
513
513
|
return (h("div", { class: "toggle-button" }, h("div", { class: "input-wrapper left" }, h("input", { type: "radio", id: `month-radio-${this.uid}`, "aria-label": intl.formatMessage({
|
|
@@ -567,11 +567,11 @@ export class PrivCalendar {
|
|
|
567
567
|
return (h("div", { class: "month-view" }, h("div", { "aria-labelledby": "popup-title-year", role: "grid", class: "months" }, h("div", { role: "row", class: "month-row" }, calendar_months.slice(0, 3).map((month, index) => this.renderMonth(month, index))), h("div", { role: "row", class: "month-row" }, calendar_months.slice(3, 6).map((month, index) => this.renderMonth(month, index + 3))), h("div", { role: "row", class: "month-row" }, calendar_months.slice(6, 9).map((month, index) => this.renderMonth(month, index + 6))), h("div", { role: "row", class: "month-row" }, calendar_months.slice(9).map((month, index) => this.renderMonth(month, index + 9))))));
|
|
568
568
|
}
|
|
569
569
|
render() {
|
|
570
|
-
return (h(Host, { key: '
|
|
570
|
+
return (h(Host, { key: '3787997230f2db89ba8e051b757d986a1b41f51d', onMouseOut: (ev) => {
|
|
571
571
|
// @ts-ignore
|
|
572
572
|
if (!this.el.parentElement.contains(ev.toElement))
|
|
573
573
|
this.outOfCal.emit();
|
|
574
|
-
}, role: "application", "aria-describedby":
|
|
574
|
+
}, role: "application", "aria-describedby": `application-${this.uid}` }, h("div", { key: 'c82e165ff59c7e1fb5f955410c8db3d7c604c285', class: `popup ${this.view}-view` }, this.renderHeader(), this.view === "day" ? this.renderDayView() : this.renderMonthView()), h("div", { key: '2e5e1276ed683f6893bec62dd461cc250b61a7b8', id: `application-${this.uid}`, class: "sr-only" }, this.calName, this.calInstructions)));
|
|
575
575
|
}
|
|
576
576
|
static get is() { return "priv-calendar"; }
|
|
577
577
|
static get originalStyleUrls() {
|
|
@@ -176,6 +176,10 @@ export class DateRange {
|
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
+
window.setTimeout(() => {
|
|
180
|
+
// ensure focused element is visible if popup opens below the fold
|
|
181
|
+
this.startCalEl.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
182
|
+
}, 250);
|
|
179
183
|
}
|
|
180
184
|
handleFocus() {
|
|
181
185
|
this.wrapperEl.classList.add("focus");
|
|
@@ -440,23 +444,23 @@ export class DateRange {
|
|
|
440
444
|
}
|
|
441
445
|
}
|
|
442
446
|
render() {
|
|
443
|
-
return (h(Host, { key: '
|
|
447
|
+
return (h(Host, { key: '3ef7ed01702cd08cb88153b157c05870f357b83d', "aria-busy": "false" }, h("div", { key: 'a26ffe7e83d668c81c361a2baf5111d338074f4f', ref: (d) => (this.wrapperEl = d), class: "wrapper" }, h("div", { key: '5110a41705760e61460ae63222d33983f50cbbcc', class: `range-wrapper ${this.calWidth <= this.availSpace ? "cal" : ""}` }, h("div", { key: 'cd73ac4cd1156a08f8433cd5172c308e73f468e5', class: "label-wrapper", id: "start-label-wrapper" }, h("label", { key: '7fa4734f43aecd6a5cb73d93c1162fd5783ad2ac', ref: (e) => (this.labelEl = e), id: "startlabel", htmlFor: "start-date-input", class: "label", title: `${this.labelStart} (${this.dateFormat})` }, this.labelStart, this.requiredField && (h("span", { key: 'be4ad3de3b7b1fa8b1f20ae86502e661d5561f9c', "aria-hidden": "true", class: "required" }, "*")))), h("div", { key: '274e44b68f05bdc28ab25836ee5162876ba2dc37', class: "label-wrapper", id: "end-label-wrapper" }, h("label", { key: '439389958522c3245d79cf03ad3f8abf621adfdd', id: "endlabel", htmlFor: "end-date-input", class: "label", title: `${this.labelEnd} (${this.dateFormat})` }, this.labelEnd, this.requiredField && (h("span", { key: '20a1a75cfc195d9503d7f079d56435f3ac7a3ce2', "aria-hidden": "true", class: "required" }, "*")))), h("input", { key: 'c850bd46e4835f8878e2c7d39fe930e38917671c', disabled: this._disabled, type: "text", id: "start-date-input", class: `date-input input ${this.invalidStart ? "invalid" : ""}`, name: "start-date", placeholder: this.dateFormat, value: this.valueStart, onFocus: () => this.handleFocus(), onInput: (ev) => this.handleStartInput(ev), onBlur: () => this.handleStartInputBlur(), ref: (input) => (this.startInputEl = input), "aria-describedby": "error", "aria-label": this.labelStart, "aria-required": this.requiredField ? "true" : null }), h("div", { key: '4cb1a5498a6378b08915563e628f45367892fe4d', id: "hyphen" }, "\u00A0-\u00A0"), h("input", { key: 'a321356204252e7c57dff7b3b392f44d6d0b9cf3', disabled: this._disabled, type: "text", id: "end-date-input", class: `date-input input ${this.invalidEnd ? "invalid" : ""}`, name: "end-date", placeholder: this.dateFormat, value: this.valueEnd, onFocus: () => this.handleFocus(), onInput: (ev) => this.handleEndInput(ev), onBlur: () => this.handleEndInputBlur(), ref: (input) => (this.endInputEl = input), "aria-describedby": "error", "aria-label": this.labelEnd, "aria-required": this.requiredField ? "true" : null }), h("div", { key: 'f6be34dda1f360b99a3708545a151c004b479635', class: "toggle-wrapper", id: "toggle-wrapper" }, this.calWidth <= this.availSpace && (h("button", { key: '5af514ad9b7fd30f5e83ebe83fd35890fdb53ee5', disabled: this.disabled, onClick: this.togglePopup.bind(this), "aria-describedby": "start-date-input end-date-input", "aria-label": intl.formatMessage({
|
|
444
448
|
id: "date.selectRange",
|
|
445
449
|
defaultMessage: "Select range",
|
|
446
450
|
description: "Button text for screen readers.",
|
|
447
|
-
}), ref: (el) => (this.toggleEl = el), "aria-expanded": `${this.isExpanded}`, class: "toggle", id: "toggle" }, h("span", { key: '
|
|
451
|
+
}), ref: (el) => (this.toggleEl = el), "aria-expanded": `${this.isExpanded}`, class: "toggle", id: "toggle" }, h("span", { key: 'ed9caf670fd667a9959363834c1accebfb0b82cb', class: "svg-icon svg-date" }), h("span", { key: '10bc0a7086071adad12d6cbe5c5c92a82260a619', class: "calendar", title: intl.formatMessage({
|
|
448
452
|
id: "date.calendarView",
|
|
449
453
|
defaultMessage: "Calendar View",
|
|
450
454
|
description: "Calendar button",
|
|
451
|
-
}) })))), this.renderCalendars()), h("div", { key: '
|
|
455
|
+
}) })))), this.renderCalendars()), h("div", { key: '6bcacc7025eef282cacfdc9c8ba44c88d01dfb3c' }, h("div", { key: '45942b8f722908db886d39fe23c7ae2e9c39eca5', id: "live-region", "aria-live": "polite", "aria-relevant": "text", class: "sr-only" }), h("div", { key: 'f3613e50ea33148b7027b2fbb9147f8eee2c98a5', id: "month-title", class: "sr-only" }, intl.formatMessage({
|
|
452
456
|
id: "date.selectMonth",
|
|
453
457
|
defaultMessage: "Activate to select a month.",
|
|
454
458
|
description: "Calendar button",
|
|
455
|
-
})), h("div", { key: '
|
|
459
|
+
})), h("div", { key: 'ca798dd858d872a87852078781058699e3ebc5f6', id: "year-title", class: "sr-only" }, intl.formatMessage({
|
|
456
460
|
id: "date.selectYear",
|
|
457
461
|
defaultMessage: "Activate to select a year.",
|
|
458
462
|
description: "Calendar button",
|
|
459
|
-
}))), h("div", { key: '
|
|
463
|
+
}))), h("div", { key: 'e77548bc61a4d4c9bf0b0985694aa298383caf3e', id: "error", class: "error" }, this.errorMessage), h("div", { key: 'ec8b80ac48c0c65cfa7be019dc242e8fa7901332', ref: (el) => (this.liveRegionEl = el), class: "sr-only", "aria-live": "polite", "aria-atomic": "true" }))));
|
|
460
464
|
}
|
|
461
465
|
static get is() { return "wm-date-range"; }
|
|
462
466
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
|
-
import { intl, toBool, handleDisabledAttribute, hasRoomRight, shouldOpenUp, dateToISO, showTooltip, hideTooltip, findAllScrollableParents, debounce } from "../../global/functions";
|
|
2
|
+
import { intl, toBool, handleDisabledAttribute, hasRoomRight, shouldOpenUp, dateToISO, showTooltip, hideTooltip, findAllScrollableParents, debounce, } from "../../global/functions";
|
|
3
3
|
export class DatePicker {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.openUp = false;
|
|
@@ -95,6 +95,10 @@ export class DatePicker {
|
|
|
95
95
|
this.calEl.focusDate = this.calendarDate;
|
|
96
96
|
this.calEl.startDate = this.calendarDate;
|
|
97
97
|
this.calEl.focusCell();
|
|
98
|
+
window.setTimeout(() => {
|
|
99
|
+
// ensure focused element is visible if popup opens below the fold
|
|
100
|
+
this.calEl.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
101
|
+
}, 250);
|
|
98
102
|
}
|
|
99
103
|
handleInput(ev) {
|
|
100
104
|
// keep component's value in sync with input's value
|
|
@@ -240,23 +244,23 @@ export class DatePicker {
|
|
|
240
244
|
this.liveRegionEl.textContent = message;
|
|
241
245
|
}
|
|
242
246
|
render() {
|
|
243
|
-
return (h(Host, { key: '
|
|
247
|
+
return (h(Host, { key: 'e708a7b702e16ab896628a40da86ab055f470239', "aria-busy": "false", class: `${this.errorMessage ? "invalid" : ""}` }, h("div", { key: '95a725cba2a6584498d6b4bdd06528b6f503b0e6', ref: (d) => (this.dpWrapperEl = d), class: `wrapper label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, h("div", { key: 'd9c06fd00f24195c975098879221347aa3d15bf4', class: "label-wrapper", ref: (e) => (this.labelWrapperEl = e) }, this.labelPosition !== "none" && (h("label", { key: 'a0415f77ff7b905e046b683c0f812207b33cd9b5', id: "datepickerLabel", htmlFor: "date-input", class: "label", title: `${this.label} (${this.dateFormat})`, onMouseEnter: (ev) => this.handleLabelMouseEnter(ev), onMouseLeave: () => hideTooltip() }, this.label)), this.labelPosition !== "none" && this.requiredField && (h("div", { key: 'f9f5b2dffd291ad9ef8efa549cbe188cdd91ab46', "aria-hidden": "true", class: "required" }, "*"))), h("div", { key: '5de094b2394f9517aafbf2a354e08b8d28812d54' }, h("div", { key: '2db3f838409242080ca11817e6e7edd74cd63f5f', class: "single-wrapper input" }, h("input", { key: 'cf2d4bee304b2c8fe8f0ed17265d94a8e0c7f750', disabled: this.isDisabled, type: "text", id: "single-date-input", class: "date-input", name: "date", placeholder: this.dateFormat, value: this.value, onFocus: () => this.handleInputFocus(), onInput: (ev) => this.handleInput(ev), onBlur: () => this.handleInputBlur(), onChange: () => this.handleInputChange(), ref: (input) => (this.inputEl = input), "aria-describedby": "error", "aria-label": this.label, "aria-required": this.requiredField ? "true" : null }), h("div", { key: '95a4200f59d4e590440ca26e1778a07e65cad511', ref: (el) => (this.buttonContainerEl = el), class: "container", id: "wm-container" }, h("button", { key: 'fef2ff2c96d6f4acabaeeb41f777268ccbbdafbb', disabled: this.disabled, onClick: this.togglePopup.bind(this), "aria-label": intl.formatMessage({
|
|
244
248
|
id: "date.selectDate",
|
|
245
249
|
defaultMessage: "Select date",
|
|
246
250
|
description: "Button text for screen readers.",
|
|
247
|
-
}), "aria-describedby": "single-date-input", ref: (el) => (this.toggleEl = el), "aria-expanded": `${this.isExpanded}`, class: "toggle", id: "toggle" }, h("span", { key: '
|
|
251
|
+
}), "aria-describedby": "single-date-input", ref: (el) => (this.toggleEl = el), "aria-expanded": `${this.isExpanded}`, class: "toggle", id: "toggle" }, h("span", { key: '8840e4a6e51836b8202e886c996c40450dff54f4', class: "svg-icon svg-date" }), h("span", { key: 'ae9853231c111e69b1fb5bc2da1ad1338a8ddff6', class: "calendar", title: intl.formatMessage({
|
|
248
252
|
id: "date.calendarView",
|
|
249
253
|
defaultMessage: "Calendar View",
|
|
250
254
|
description: "Calendar button",
|
|
251
|
-
}) })), h("div", { key: '
|
|
255
|
+
}) })), h("div", { key: '7fa85ff7fb7c8c0ef74792afbfa4963c748c6faf', class: `popup-wrapper ${this.calEl && this.calEl.view}-view ${this.openUp ? "expand-upwards" : ""}`, id: "popup-wrapper", ref: (el) => (this.popupEl = el), onClick: () => (this.popupClicked = true) }, h("div", { key: 'fb71ae8319b5867b521ff45b983c8dd92368a5ff', tabIndex: 0, onFocus: () => this.calEl.focusLastFocusable() }), h("priv-calendar", { key: 'b5d831730977c2f23013b5173bfe4819e870c7fd', ref: (el) => (this.calEl = el), startDate: this.calendarDate, focusDate: this.calendarDate, class: "inside" }), h("div", { key: 'e988546871ed5520f8ba1c175b144afef8e8a3da', tabIndex: 0, onFocus: () => this.calEl.focusFirstFocusable() })), h("div", { key: 'ed118033c782ffdf40f2cec2d014215bbf8b7f8f', id: "live-region", "aria-live": "polite", "aria-relevant": "text", class: "sr-only" }), h("div", { key: '5ccca72007a577bf6c7652dcce65c38c7d6142c6', id: "month-title", class: "sr-only" }, intl.formatMessage({
|
|
252
256
|
id: "date.selectMonth",
|
|
253
257
|
defaultMessage: "Activate to select a month.",
|
|
254
258
|
description: "Calendar button",
|
|
255
|
-
})), h("div", { key: '
|
|
259
|
+
})), h("div", { key: 'cd0f6ae54b21dff099969f83699670e324919d45', id: "year-title", class: "sr-only" }, intl.formatMessage({
|
|
256
260
|
id: "date.selectYear",
|
|
257
261
|
defaultMessage: "Activate to select a year.",
|
|
258
262
|
description: "Calendar button",
|
|
259
|
-
})))), h("div", { key: '
|
|
263
|
+
})))), h("div", { key: '66b8fe166a802681107b0546ec615ffaa4d6e280', id: "error", class: "error" }, this.errorMessage), h("div", { key: '71fdd1819720a5b6f91d25c37f2b1011ead21c3d', ref: (el) => (this.liveRegionEl = el), class: "sr-only", "aria-live": "polite", "aria-atomic": "true" })))));
|
|
260
264
|
}
|
|
261
265
|
static get is() { return "wm-datepicker"; }
|
|
262
266
|
static get encapsulation() { return "shadow"; }
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { b as bootstrapLazy } from './index-130e07bb.js';
|
|
2
2
|
export { s as setNonce } from './index-130e07bb.js';
|
|
3
|
-
import { g as globalScripts } from './app-globals-
|
|
3
|
+
import { g as globalScripts } from './app-globals-3da2b209.js';
|
|
4
4
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|