@watermarkinsights/ripple 3.8.1 → 3.8.2-0
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/{global-2cc7a0dc.js → global-607c6123.js} +6 -11
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/priv-datepicker.cjs.entry.js +96 -111
- package/dist/cjs/ripple.cjs.js +2 -2
- package/dist/cjs/wm-chart.cjs.entry.js +7 -10
- package/dist/cjs/wm-datepicker.cjs.entry.js +1 -7
- package/dist/cjs/wm-network-uploader.cjs.entry.js +1 -1
- package/dist/cjs/wm-option_2.cjs.entry.js +12 -22
- package/dist/cjs/wm-snackbar.cjs.entry.js +2 -2
- package/dist/cjs/wm-uploader.cjs.entry.js +1 -1
- package/dist/collection/components/wm-chart/wm-chart.js +7 -10
- package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.js +96 -111
- package/dist/collection/components/wm-datepicker/wm-datepicker.js +1 -13
- package/dist/collection/components/wm-option/wm-option.js +9 -17
- package/dist/collection/components/wm-select/wm-select.js +3 -5
- package/dist/collection/components/wm-snackbar/wm-snackbar.js +2 -2
- package/dist/collection/components/wm-uploader/wm-network-uploader/wm-network-uploader.js +1 -1
- package/dist/collection/components/wm-uploader/wm-uploader.js +1 -1
- package/dist/collection/global/global.js +5 -10
- package/dist/esm/{global-a647e01e.js → global-d0dc1f12.js} +6 -11
- package/dist/esm/loader.js +2 -2
- package/dist/esm/priv-datepicker.entry.js +96 -111
- package/dist/esm/ripple.js +2 -2
- package/dist/esm/wm-chart.entry.js +7 -10
- package/dist/esm/wm-datepicker.entry.js +1 -7
- package/dist/esm/wm-network-uploader.entry.js +1 -1
- package/dist/esm/wm-option_2.entry.js +12 -22
- package/dist/esm/wm-snackbar.entry.js +2 -2
- package/dist/esm/wm-uploader.entry.js +1 -1
- package/dist/esm-es5/global-d0dc1f12.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/priv-datepicker.entry.js +1 -1
- package/dist/esm-es5/ripple.js +1 -1
- package/dist/esm-es5/wm-chart.entry.js +1 -1
- package/dist/esm-es5/wm-datepicker.entry.js +1 -1
- package/dist/esm-es5/wm-network-uploader.entry.js +1 -1
- package/dist/esm-es5/wm-option_2.entry.js +1 -1
- package/dist/esm-es5/wm-snackbar.entry.js +1 -1
- package/dist/esm-es5/wm-uploader.entry.js +1 -1
- package/dist/ripple/p-0c2b2d14.js +1 -0
- package/dist/ripple/{p-a605a78b.system.entry.js → p-268622b5.system.entry.js} +1 -1
- package/dist/ripple/p-29d3ca15.system.entry.js +1 -0
- package/dist/ripple/p-2a27dba5.entry.js +1 -0
- package/dist/ripple/p-36d3ae67.system.js +1 -0
- package/dist/ripple/p-4de0799d.entry.js +1 -0
- package/dist/ripple/p-69735b23.system.entry.js +1 -0
- package/dist/ripple/p-81c023a7.entry.js +1 -0
- package/dist/ripple/p-8e1ad7c1.system.js +1 -0
- package/dist/ripple/p-b53962af.entry.js +1 -0
- package/dist/ripple/{p-5bc67a90.system.entry.js → p-b53cecad.system.entry.js} +1 -1
- package/dist/ripple/{p-142d292c.system.entry.js → p-bdbc14ee.system.entry.js} +1 -1
- package/dist/ripple/p-c58520e4.entry.js +1 -0
- package/dist/ripple/p-c7660ed9.entry.js +1 -0
- package/dist/ripple/p-e597d7bb.system.entry.js +1 -0
- package/dist/ripple/p-e6bcfdd5.entry.js +1 -0
- package/dist/ripple/{p-c043d040.system.entry.js → p-fc254870.system.entry.js} +1 -1
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/dist/types/components/wm-datepicker/priv-datepicker/priv-datepicker.d.ts +12 -12
- package/dist/types/components/wm-datepicker/wm-datepicker.d.ts +0 -1
- package/package.json +1 -1
- package/dist/esm-es5/global-a647e01e.js +0 -1
- package/dist/ripple/p-0019a53b.entry.js +0 -1
- package/dist/ripple/p-111494c9.js +0 -1
- package/dist/ripple/p-44342459.system.entry.js +0 -1
- package/dist/ripple/p-71a400fd.entry.js +0 -1
- package/dist/ripple/p-7b42dd24.system.js +0 -1
- package/dist/ripple/p-8af7c223.entry.js +0 -1
- package/dist/ripple/p-9de1bcc5.system.entry.js +0 -1
- package/dist/ripple/p-adde97b9.entry.js +0 -1
- package/dist/ripple/p-bd449bb6.entry.js +0 -1
- package/dist/ripple/p-bdd8caf1.entry.js +0 -1
- package/dist/ripple/p-c006e95b.system.js +0 -1
- package/dist/ripple/p-dd6b9aee.entry.js +0 -1
- package/dist/ripple/p-f6b0fd8d.system.entry.js +0 -1
|
@@ -30,48 +30,40 @@ let Option = class {
|
|
|
30
30
|
return (_a = this.el.parentElement) === null || _a === void 0 ? void 0 : _a.multiple;
|
|
31
31
|
}
|
|
32
32
|
handleKeydown(ev) {
|
|
33
|
-
switch (ev.
|
|
34
|
-
|
|
35
|
-
case 38:
|
|
33
|
+
switch (ev.key) {
|
|
34
|
+
case "ArrowUp":
|
|
36
35
|
ev.preventDefault();
|
|
37
36
|
this.wmKeyUpPressed.emit();
|
|
38
37
|
break;
|
|
39
|
-
|
|
40
|
-
case 40:
|
|
38
|
+
case "ArrowDown":
|
|
41
39
|
ev.preventDefault();
|
|
42
40
|
this.wmKeyDownPressed.emit(this.el);
|
|
43
41
|
break;
|
|
44
|
-
|
|
45
|
-
case 13:
|
|
42
|
+
case "Enter":
|
|
46
43
|
ev.preventDefault();
|
|
47
44
|
if (!this.disabled) {
|
|
48
45
|
this.el.click();
|
|
49
46
|
this.wmEnterKeyPressed.emit(this.el);
|
|
50
47
|
}
|
|
51
48
|
break;
|
|
52
|
-
|
|
53
|
-
case 32:
|
|
49
|
+
case " ":
|
|
54
50
|
ev.preventDefault();
|
|
55
51
|
this.el.click();
|
|
56
52
|
break;
|
|
57
|
-
|
|
58
|
-
case 27:
|
|
53
|
+
case "Escape":
|
|
59
54
|
ev.preventDefault();
|
|
60
55
|
ev.stopPropagation(); // for instance if select is in a modal, esc should close the select but not the modal
|
|
61
56
|
this.wmEscKeyPressed.emit();
|
|
62
57
|
break;
|
|
63
|
-
|
|
64
|
-
case 36:
|
|
58
|
+
case "Home":
|
|
65
59
|
ev.preventDefault();
|
|
66
60
|
this.wmHomeKeyPressed.emit();
|
|
67
61
|
break;
|
|
68
|
-
|
|
69
|
-
case 35:
|
|
62
|
+
case "End":
|
|
70
63
|
ev.preventDefault();
|
|
71
64
|
this.wmEndKeyPressed.emit();
|
|
72
65
|
break;
|
|
73
|
-
|
|
74
|
-
case 9:
|
|
66
|
+
case "Tab":
|
|
75
67
|
this.wmTabKeyPressed.emit();
|
|
76
68
|
break;
|
|
77
69
|
default:
|
|
@@ -237,16 +229,14 @@ let Select = class {
|
|
|
237
229
|
}
|
|
238
230
|
}
|
|
239
231
|
handleKey(ev) {
|
|
240
|
-
switch (ev.
|
|
241
|
-
|
|
242
|
-
case 40:
|
|
232
|
+
switch (ev.key) {
|
|
233
|
+
case "ArrowDown":
|
|
243
234
|
if (this.isExpanded === false) {
|
|
244
235
|
ev.preventDefault();
|
|
245
236
|
this.open("next");
|
|
246
237
|
}
|
|
247
238
|
break;
|
|
248
|
-
|
|
249
|
-
case 38:
|
|
239
|
+
case "ArrowUp":
|
|
250
240
|
if (this.isExpanded === false) {
|
|
251
241
|
ev.preventDefault();
|
|
252
242
|
this.open("previous");
|
|
@@ -61,7 +61,7 @@ let Snackbar = class {
|
|
|
61
61
|
this.newNotification = false;
|
|
62
62
|
}
|
|
63
63
|
checkForTabbing(ev) {
|
|
64
|
-
if (ev.
|
|
64
|
+
if (ev.key === "Tab") {
|
|
65
65
|
this.toggleTabbingOn();
|
|
66
66
|
}
|
|
67
67
|
}
|
|
@@ -151,7 +151,7 @@ let Snackbar = class {
|
|
|
151
151
|
renderSnackbars() {
|
|
152
152
|
return this.parsedNotifications.map((notification) => (index.h("div", { class: "wm-snack-wrapper" }, index.h("div", { id: `snack-${this.uid}`, class: "wm-snackbar active neutral" }, index.h("div", { class: "sr-only", tabindex: notification.link ? 0 : -1, onFocus: () => notification.link && this.snackDismissed(notification) }), index.h("div", { class: "wm-snackbarmsg" }, index.h("div", { class: "msgtext" }, index.h("span", null, notification.message), notification.link && (index.h("a", { id: `action-${notification.id}`, class: `link ${notification.newWindow ? "new-window" : ""}`, "aria-label": `Click to ${notification.link}...${notification.newWindow ? " " + this.newWindowMessage : ""}`, tabindex: 0, onClick: () => {
|
|
153
153
|
this.snackLinkClicked(notification);
|
|
154
|
-
}, onKeyDown: (ev) => ev.
|
|
154
|
+
}, onKeyDown: (ev) => ev.key === "Enter" && this.snackLinkClicked(notification) }, index.h("span", { "aria-hidden": "true" }, notification.link)))), index.h("button", { id: `close-button-${notification.id}`, "aria-label": "Close this notification", class: "closesnack", tabindex: notification.link ? 0 : -1, onClick: () => this.snackDismissed(notification) }, index.h("span", { class: "tooltip", "aria-hidden": "true" }, "Close"))), index.h("div", { class: "sr-only", tabindex: notification.link ? 0 : -1, onFocus: () => notification.link && this.snackDismissed(notification) })))));
|
|
155
155
|
}
|
|
156
156
|
renderLiveRegion() {
|
|
157
157
|
const latestNotification = this.parsedNotifications[0];
|
|
@@ -271,7 +271,7 @@ let Uploader = class {
|
|
|
271
271
|
// then add an even listener to force a click event when Enter key is pressed
|
|
272
272
|
this.inputEl &&
|
|
273
273
|
this.inputEl.addEventListener("keydown", (ev) => {
|
|
274
|
-
if (this.inputEl && ev.
|
|
274
|
+
if (this.inputEl && ev.key === "Enter") {
|
|
275
275
|
this.inputEl.click();
|
|
276
276
|
}
|
|
277
277
|
});
|
|
@@ -123,26 +123,23 @@ export class Chart {
|
|
|
123
123
|
this.isTabbing = false;
|
|
124
124
|
}
|
|
125
125
|
handleKeydown(ev) {
|
|
126
|
-
switch (ev.
|
|
127
|
-
|
|
128
|
-
case
|
|
129
|
-
case 38:
|
|
126
|
+
switch (ev.key) {
|
|
127
|
+
case "ArrowUp":
|
|
128
|
+
case "ArrowLeft":
|
|
130
129
|
ev.preventDefault();
|
|
131
130
|
this.isTabbing = true; // shd already be true. just in case user clicked on chart then pressed an arrow key
|
|
132
131
|
this.focusPrevious();
|
|
133
132
|
break;
|
|
134
|
-
|
|
135
|
-
case
|
|
136
|
-
case 40:
|
|
133
|
+
case "ArrowRight":
|
|
134
|
+
case "ArrowDown":
|
|
137
135
|
ev.preventDefault();
|
|
138
136
|
this.isTabbing = true; // shd already be true. just in case user clicked on chart then pressed an arrow key
|
|
139
137
|
this.focusNext();
|
|
140
138
|
break;
|
|
141
|
-
|
|
142
|
-
case 9:
|
|
139
|
+
case "Tab":
|
|
143
140
|
this.exitChart();
|
|
144
141
|
break;
|
|
145
|
-
case
|
|
142
|
+
case "Escape":
|
|
146
143
|
this.popoverEl.open = false;
|
|
147
144
|
break;
|
|
148
145
|
}
|
|
@@ -112,47 +112,40 @@ export class PrivDatepicker {
|
|
|
112
112
|
handleKey(ev) {
|
|
113
113
|
this.prevClicked = false;
|
|
114
114
|
this.nextClicked = false;
|
|
115
|
-
switch (ev.
|
|
116
|
-
|
|
117
|
-
case 13:
|
|
115
|
+
switch (ev.key) {
|
|
116
|
+
case "Enter":
|
|
118
117
|
ev.preventDefault();
|
|
119
118
|
//Clunky exception for blur validation. Remove when blur reworked.
|
|
120
119
|
!ev.target.id.includes("popup-title") && ev.target.click();
|
|
121
120
|
break;
|
|
122
|
-
|
|
123
|
-
case 27:
|
|
121
|
+
case "Escape":
|
|
124
122
|
ev.preventDefault();
|
|
125
123
|
if (this.isExpanded) {
|
|
126
124
|
ev.stopPropagation(); // prevents closing of parent modal
|
|
127
|
-
this.closePopup();
|
|
125
|
+
this.closePopup(true);
|
|
128
126
|
}
|
|
129
127
|
break;
|
|
130
|
-
|
|
131
|
-
case 33:
|
|
128
|
+
case "PageUp":
|
|
132
129
|
ev.preventDefault();
|
|
133
130
|
this.backOneMonth();
|
|
134
131
|
break;
|
|
135
|
-
|
|
136
|
-
case 34:
|
|
132
|
+
case "PageDown":
|
|
137
133
|
ev.preventDefault();
|
|
138
134
|
this.forwardOneMonth();
|
|
139
135
|
break;
|
|
140
|
-
|
|
141
|
-
case 36:
|
|
136
|
+
case "Home":
|
|
142
137
|
ev.preventDefault();
|
|
143
138
|
this.unfocusCell();
|
|
144
139
|
this.dayInFocus = 1;
|
|
145
140
|
forceUpdate(this.el);
|
|
146
141
|
break;
|
|
147
|
-
|
|
148
|
-
case 35:
|
|
142
|
+
case "End":
|
|
149
143
|
ev.preventDefault();
|
|
150
144
|
this.unfocusCell();
|
|
151
145
|
this.dayInFocus = this.getMonthDays(this.monthInFocus, this.yearInFocus);
|
|
152
146
|
forceUpdate(this.el);
|
|
153
147
|
break;
|
|
154
|
-
|
|
155
|
-
case 37:
|
|
148
|
+
case "ArrowLeft":
|
|
156
149
|
ev.preventDefault();
|
|
157
150
|
if (this.view === "day") {
|
|
158
151
|
this.unfocusCell();
|
|
@@ -176,8 +169,7 @@ export class PrivDatepicker {
|
|
|
176
169
|
}
|
|
177
170
|
}
|
|
178
171
|
break;
|
|
179
|
-
|
|
180
|
-
case 39:
|
|
172
|
+
case "ArrowRight":
|
|
181
173
|
ev.preventDefault();
|
|
182
174
|
if (this.view === "day") {
|
|
183
175
|
this.unfocusCell();
|
|
@@ -201,8 +193,7 @@ export class PrivDatepicker {
|
|
|
201
193
|
}
|
|
202
194
|
}
|
|
203
195
|
break;
|
|
204
|
-
|
|
205
|
-
case 38:
|
|
196
|
+
case "ArrowUp":
|
|
206
197
|
ev.preventDefault();
|
|
207
198
|
if (this.view === "day") {
|
|
208
199
|
this.unfocusCell();
|
|
@@ -227,8 +218,7 @@ export class PrivDatepicker {
|
|
|
227
218
|
}
|
|
228
219
|
}
|
|
229
220
|
break;
|
|
230
|
-
|
|
231
|
-
case 40:
|
|
221
|
+
case "ArrowDown":
|
|
232
222
|
ev.preventDefault();
|
|
233
223
|
if (!this.isExpanded) {
|
|
234
224
|
this.openPopup();
|
|
@@ -297,24 +287,52 @@ export class PrivDatepicker {
|
|
|
297
287
|
this.popupBlurred.emit({ relatedTarget: ev.target });
|
|
298
288
|
}
|
|
299
289
|
}
|
|
300
|
-
|
|
301
|
-
this.
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
290
|
+
componentDidUpdate() {
|
|
291
|
+
this.handleSelectedDate();
|
|
292
|
+
if (this.isExpanded) {
|
|
293
|
+
this.prevClicked
|
|
294
|
+
? this.prevButton.focus()
|
|
295
|
+
: this.nextClicked
|
|
296
|
+
? this.nextButton.focus()
|
|
297
|
+
: this.view === "day"
|
|
298
|
+
? this.focusCell()
|
|
299
|
+
: this.focusMonth();
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
componentDidLoad() {
|
|
303
|
+
this.handleSelectedDate();
|
|
304
|
+
this.setDateValuesForView();
|
|
305
|
+
}
|
|
306
|
+
zeroPad(value, length) {
|
|
307
|
+
if (!String.prototype.padStart) {
|
|
308
|
+
String.prototype.padStart = function padStart(targetLength, padString) {
|
|
309
|
+
targetLength = targetLength - this.length;
|
|
310
|
+
if (targetLength > padString.length) {
|
|
311
|
+
padString += padString.repeat(targetLength / padString.length);
|
|
312
|
+
}
|
|
313
|
+
return padString.slice(0, targetLength) + String(this);
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
return `${value.toString()}`.padStart(length, "0");
|
|
317
|
+
}
|
|
318
|
+
removeZeroes(date) {
|
|
319
|
+
return +date < 10 ? +date.slice(1) : +date;
|
|
320
|
+
}
|
|
321
|
+
isDateToday(date) {
|
|
322
|
+
const today = new Date();
|
|
323
|
+
const todayDateArray = [
|
|
324
|
+
today.getFullYear().toString(),
|
|
325
|
+
(today.getMonth() + 1).toString(),
|
|
326
|
+
today.getDate().toString(),
|
|
327
|
+
];
|
|
328
|
+
//Compare today's date to date and return true if they match
|
|
329
|
+
return todayDateArray.reduce((result, val, index) => result && this.removeZeroes(date[index]).toString() === val, true);
|
|
308
330
|
}
|
|
309
331
|
togglePopup() {
|
|
310
332
|
this.isExpanded ? this.closePopup() : this.openPopup();
|
|
311
333
|
this.buttonClicked = true;
|
|
312
334
|
}
|
|
313
|
-
|
|
314
|
-
let liveRegion = this.el.querySelector("#live-region");
|
|
315
|
-
liveRegion.innerHTML = text;
|
|
316
|
-
}
|
|
317
|
-
closePopup() {
|
|
335
|
+
closePopup(returnFocus = false) {
|
|
318
336
|
this.isExpanded = false;
|
|
319
337
|
this.popupEl.classList.remove("open");
|
|
320
338
|
window.setTimeout(() => {
|
|
@@ -329,14 +347,9 @@ export class PrivDatepicker {
|
|
|
329
347
|
this.yearInFocus = this.selectedYear;
|
|
330
348
|
this.dayInFocus = this.selectedDay;
|
|
331
349
|
this.changeView("day");
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
if (this.isTabbing) {
|
|
336
|
-
this.popupClosed.emit();
|
|
337
|
-
this.buttonEl.focus();
|
|
338
|
-
}
|
|
339
|
-
});
|
|
350
|
+
if (returnFocus) {
|
|
351
|
+
this.buttonEl.focus();
|
|
352
|
+
}
|
|
340
353
|
}
|
|
341
354
|
openPopup() {
|
|
342
355
|
this.panelPosition();
|
|
@@ -350,42 +363,11 @@ export class PrivDatepicker {
|
|
|
350
363
|
this.isExpanded = true;
|
|
351
364
|
this.focusCell();
|
|
352
365
|
}
|
|
353
|
-
panelPosition() {
|
|
354
|
-
// getting a ref to the input el (in datepicker.tsx)
|
|
355
|
-
let host = document.getElementById(this.parentId);
|
|
356
|
-
const labelHeight = host.shadowRoot.querySelector(".label-wrapper").clientHeight;
|
|
357
|
-
this.openUp = shouldOpenUp(host, this.popupEl, labelHeight);
|
|
358
|
-
if (hasRoomRight(host, 336)) {
|
|
359
|
-
this.popupEl.style.left = "0";
|
|
360
|
-
this.popupEl.style.right = "auto";
|
|
361
|
-
}
|
|
362
|
-
else {
|
|
363
|
-
this.popupEl.style.right = "0";
|
|
364
|
-
this.popupEl.style.left = "auto";
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
changeView(newView) {
|
|
368
|
-
this.view = newView;
|
|
369
|
-
//Ensure month view always opens to the month last visited in date view
|
|
370
|
-
this.monthNumInFocus = this.monthInFocus - 1;
|
|
371
|
-
}
|
|
372
366
|
getMonthDays(month, year) {
|
|
373
367
|
const months30 = [4, 6, 9, 11];
|
|
374
368
|
const leapYear = year % 4 === 0;
|
|
375
369
|
return month === 2 ? (leapYear ? 29 : 28) : months30.includes(month) ? 30 : 31;
|
|
376
370
|
}
|
|
377
|
-
zeroPad(value, length) {
|
|
378
|
-
if (!String.prototype.padStart) {
|
|
379
|
-
String.prototype.padStart = function padStart(targetLength, padString) {
|
|
380
|
-
targetLength = targetLength - this.length;
|
|
381
|
-
if (targetLength > padString.length) {
|
|
382
|
-
padString += padString.repeat(targetLength / padString.length);
|
|
383
|
-
}
|
|
384
|
-
return padString.slice(0, targetLength) + String(this);
|
|
385
|
-
};
|
|
386
|
-
}
|
|
387
|
-
return `${value.toString()}`.padStart(length, "0");
|
|
388
|
-
}
|
|
389
371
|
// 1 => Sunday, 7 => Saturday
|
|
390
372
|
getMonthFirstDay(month, year) {
|
|
391
373
|
return +new Date(year, month - 1, 1, 12, 0, 0).getDay() + 1;
|
|
@@ -457,7 +439,7 @@ export class PrivDatepicker {
|
|
|
457
439
|
handleTriggeredDate(el) {
|
|
458
440
|
this.cellTriggered.emit(el);
|
|
459
441
|
// change of input value will trigger the function updating selectedDate
|
|
460
|
-
this.closePopup();
|
|
442
|
+
this.closePopup(true);
|
|
461
443
|
}
|
|
462
444
|
handleSelectedDate() {
|
|
463
445
|
//Remove old selection status
|
|
@@ -497,25 +479,6 @@ export class PrivDatepicker {
|
|
|
497
479
|
monthToFocus.tabIndex = 0;
|
|
498
480
|
monthToFocus.focus();
|
|
499
481
|
}
|
|
500
|
-
removeZeroes(date) {
|
|
501
|
-
return +date < 10 ? +date.slice(1) : +date;
|
|
502
|
-
}
|
|
503
|
-
isDateToday(date) {
|
|
504
|
-
const today = new Date();
|
|
505
|
-
const todayDateArray = [
|
|
506
|
-
today.getFullYear().toString(),
|
|
507
|
-
(today.getMonth() + 1).toString(),
|
|
508
|
-
today.getDate().toString(),
|
|
509
|
-
];
|
|
510
|
-
//Compare today's date to date and return true if they match
|
|
511
|
-
return todayDateArray.reduce((result, val, index) => result && this.removeZeroes(date[index]).toString() === val, true);
|
|
512
|
-
}
|
|
513
|
-
renderMonths(month, index) {
|
|
514
|
-
return (h("div", { id: `month-${index}-${this.parentId}`, class: `month ${this.selectedMonth - 1 === index ? "selected" : ""}`, role: "gridcell", tabindex: index + 1 === this.monthInFocus ? 0 : -1, onKeyDown: (ev) => this.trapFocusEnd(ev), onBlur: (ev) => ev.stopPropagation(), onClick: () => {
|
|
515
|
-
this.monthInFocus = index + 1;
|
|
516
|
-
this.changeView("day");
|
|
517
|
-
} }, month));
|
|
518
|
-
}
|
|
519
482
|
trapFocusLeft(ev) {
|
|
520
483
|
if (ev.shiftKey && ev.key === "Tab") {
|
|
521
484
|
ev.preventDefault();
|
|
@@ -542,24 +505,46 @@ export class PrivDatepicker {
|
|
|
542
505
|
this.focusMonth();
|
|
543
506
|
}
|
|
544
507
|
}
|
|
545
|
-
|
|
546
|
-
this.
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
508
|
+
toggleBusyAttribute(state) {
|
|
509
|
+
this.el.querySelector("#wm-container").setAttribute("aria-busy", state);
|
|
510
|
+
}
|
|
511
|
+
setDateValuesForView() {
|
|
512
|
+
this.selectedYear = this.date.getUTCFullYear();
|
|
513
|
+
this.selectedMonth = this.date.getUTCMonth() + 1;
|
|
514
|
+
this.selectedDay = this.date.getUTCDate();
|
|
515
|
+
this.monthInFocus = this.selectedMonth;
|
|
516
|
+
this.yearInFocus = this.selectedYear;
|
|
517
|
+
this.dayInFocus = this.selectedDay;
|
|
518
|
+
this.monthNumInFocus = this.selectedMonth - 1;
|
|
519
|
+
}
|
|
520
|
+
updateLiveRegion(text) {
|
|
521
|
+
let liveRegion = this.el.querySelector("#live-region");
|
|
522
|
+
liveRegion.innerHTML = text;
|
|
523
|
+
}
|
|
524
|
+
panelPosition() {
|
|
525
|
+
// getting a ref to the input el (in datepicker.tsx)
|
|
526
|
+
let host = document.getElementById(this.parentId);
|
|
527
|
+
const labelHeight = host.shadowRoot.querySelector(".label-wrapper").clientHeight;
|
|
528
|
+
this.openUp = shouldOpenUp(host, this.popupEl, labelHeight);
|
|
529
|
+
if (hasRoomRight(host, 336)) {
|
|
530
|
+
this.popupEl.style.left = "0";
|
|
531
|
+
this.popupEl.style.right = "auto";
|
|
532
|
+
}
|
|
533
|
+
else {
|
|
534
|
+
this.popupEl.style.right = "0";
|
|
535
|
+
this.popupEl.style.left = "auto";
|
|
555
536
|
}
|
|
556
537
|
}
|
|
557
|
-
|
|
558
|
-
this.
|
|
559
|
-
|
|
538
|
+
changeView(newView) {
|
|
539
|
+
this.view = newView;
|
|
540
|
+
//Ensure month view always opens to the month last visited in date view
|
|
541
|
+
this.monthNumInFocus = this.monthInFocus - 1;
|
|
560
542
|
}
|
|
561
|
-
|
|
562
|
-
this.
|
|
543
|
+
renderMonths(month, index) {
|
|
544
|
+
return (h("div", { id: `month-${index}-${this.parentId}`, class: `month ${this.selectedMonth - 1 === index ? "selected" : ""}`, role: "gridcell", tabindex: index + 1 === this.monthInFocus ? 0 : -1, onKeyDown: (ev) => this.trapFocusEnd(ev), onBlur: (ev) => ev.stopPropagation(), onClick: () => {
|
|
545
|
+
this.monthInFocus = index + 1;
|
|
546
|
+
this.changeView("day");
|
|
547
|
+
} }, month));
|
|
563
548
|
}
|
|
564
549
|
render() {
|
|
565
550
|
const dates = this.getCalendarDates(this.monthInFocus, this.yearInFocus);
|
|
@@ -583,7 +568,7 @@ export class PrivDatepicker {
|
|
|
583
568
|
}) },
|
|
584
569
|
h("span", { class: "mdi" }, "\uF141")),
|
|
585
570
|
h("div", { id: `popup-title-month-${this.parentId}`, class: "title-box", tabindex: 0, role: "button", onKeyDown: (ev) => {
|
|
586
|
-
if (ev.
|
|
571
|
+
if (ev.key === "Enter" || ev.key === " ") {
|
|
587
572
|
ev.preventDefault();
|
|
588
573
|
this.changeView("month");
|
|
589
574
|
}
|
|
@@ -672,7 +657,7 @@ export class PrivDatepicker {
|
|
|
672
657
|
}), ref: (el) => (this.prevButton = el), class: "arw-btn" },
|
|
673
658
|
h("span", { class: "mdi" }, "\uF141")),
|
|
674
659
|
h("div", { id: `popup-title-year-${this.parentId}`, tabindex: 0, class: "title-box year", role: "button", onClick: this.changeView.bind(this, "day"), onKeyDown: (ev) => {
|
|
675
|
-
if (ev.
|
|
660
|
+
if (ev.key === "Enter" || ev.key === " ") {
|
|
676
661
|
ev.preventDefault();
|
|
677
662
|
this.changeView("day");
|
|
678
663
|
}
|
|
@@ -66,10 +66,6 @@ export class DatePicker {
|
|
|
66
66
|
focusHandler() {
|
|
67
67
|
this.dpWrapper.classList.add("focus");
|
|
68
68
|
}
|
|
69
|
-
handlePopupClosed() {
|
|
70
|
-
this.el.tabIndex = 0;
|
|
71
|
-
this.el.focus();
|
|
72
|
-
}
|
|
73
69
|
handlePopupBlurred(ev) {
|
|
74
70
|
// emit blur event when leaving component from priv-datepicker
|
|
75
71
|
if (ev.detail.relatedTarget !== this.el) {
|
|
@@ -259,9 +255,7 @@ export class DatePicker {
|
|
|
259
255
|
id: "date.format",
|
|
260
256
|
defaultMessage: "{dateFormat, select, us {mm/dd/yyyy} int {dd/mm/yyyy} other {yyyy/mm/dd}}",
|
|
261
257
|
}, { dateFormat: this.dateFormat.toLowerCase() });
|
|
262
|
-
return (h(Host, { id: this.uid,
|
|
263
|
-
this.el.removeAttribute("tabindex");
|
|
264
|
-
}, "aria-busy": "false", class: `${this.displayError ? "invalid" : ""}`, invalid: this.displayError ? "true" : null },
|
|
258
|
+
return (h(Host, { id: this.uid, "aria-busy": "false", class: `${this.displayError ? "invalid" : ""}`, invalid: this.displayError ? "true" : null },
|
|
265
259
|
h("div", { ref: (d) => (this.dpWrapper = d), class: `wrapper label-${this.labelPosition} ${this.displayError ? "invalid" : ""}` },
|
|
266
260
|
h("div", { class: "label-wrapper" }, this.labelPosition !== "none" && (h("label", { id: `datepickerLabel-${this.uid}`, htmlFor: `date-input-${this.uid}`, class: "label", title: `${this.label} (${dateFormat})` },
|
|
267
261
|
this.label,
|
|
@@ -461,12 +455,6 @@ export class DatePicker {
|
|
|
461
455
|
"target": undefined,
|
|
462
456
|
"capture": false,
|
|
463
457
|
"passive": false
|
|
464
|
-
}, {
|
|
465
|
-
"name": "popupClosed",
|
|
466
|
-
"method": "handlePopupClosed",
|
|
467
|
-
"target": undefined,
|
|
468
|
-
"capture": false,
|
|
469
|
-
"passive": false
|
|
470
458
|
}, {
|
|
471
459
|
"name": "popupBlurred",
|
|
472
460
|
"method": "handlePopupBlurred",
|
|
@@ -11,48 +11,40 @@ export class Option {
|
|
|
11
11
|
return (_a = this.el.parentElement) === null || _a === void 0 ? void 0 : _a.multiple;
|
|
12
12
|
}
|
|
13
13
|
handleKeydown(ev) {
|
|
14
|
-
switch (ev.
|
|
15
|
-
|
|
16
|
-
case 38:
|
|
14
|
+
switch (ev.key) {
|
|
15
|
+
case "ArrowUp":
|
|
17
16
|
ev.preventDefault();
|
|
18
17
|
this.wmKeyUpPressed.emit();
|
|
19
18
|
break;
|
|
20
|
-
|
|
21
|
-
case 40:
|
|
19
|
+
case "ArrowDown":
|
|
22
20
|
ev.preventDefault();
|
|
23
21
|
this.wmKeyDownPressed.emit(this.el);
|
|
24
22
|
break;
|
|
25
|
-
|
|
26
|
-
case 13:
|
|
23
|
+
case "Enter":
|
|
27
24
|
ev.preventDefault();
|
|
28
25
|
if (!this.disabled) {
|
|
29
26
|
this.el.click();
|
|
30
27
|
this.wmEnterKeyPressed.emit(this.el);
|
|
31
28
|
}
|
|
32
29
|
break;
|
|
33
|
-
|
|
34
|
-
case 32:
|
|
30
|
+
case " ":
|
|
35
31
|
ev.preventDefault();
|
|
36
32
|
this.el.click();
|
|
37
33
|
break;
|
|
38
|
-
|
|
39
|
-
case 27:
|
|
34
|
+
case "Escape":
|
|
40
35
|
ev.preventDefault();
|
|
41
36
|
ev.stopPropagation(); // for instance if select is in a modal, esc should close the select but not the modal
|
|
42
37
|
this.wmEscKeyPressed.emit();
|
|
43
38
|
break;
|
|
44
|
-
|
|
45
|
-
case 36:
|
|
39
|
+
case "Home":
|
|
46
40
|
ev.preventDefault();
|
|
47
41
|
this.wmHomeKeyPressed.emit();
|
|
48
42
|
break;
|
|
49
|
-
|
|
50
|
-
case 35:
|
|
43
|
+
case "End":
|
|
51
44
|
ev.preventDefault();
|
|
52
45
|
this.wmEndKeyPressed.emit();
|
|
53
46
|
break;
|
|
54
|
-
|
|
55
|
-
case 9:
|
|
47
|
+
case "Tab":
|
|
56
48
|
this.wmTabKeyPressed.emit();
|
|
57
49
|
break;
|
|
58
50
|
default:
|
|
@@ -107,16 +107,14 @@ export class Select {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
handleKey(ev) {
|
|
110
|
-
switch (ev.
|
|
111
|
-
|
|
112
|
-
case 40:
|
|
110
|
+
switch (ev.key) {
|
|
111
|
+
case "ArrowDown":
|
|
113
112
|
if (this.isExpanded === false) {
|
|
114
113
|
ev.preventDefault();
|
|
115
114
|
this.open("next");
|
|
116
115
|
}
|
|
117
116
|
break;
|
|
118
|
-
|
|
119
|
-
case 38:
|
|
117
|
+
case "ArrowUp":
|
|
120
118
|
if (this.isExpanded === false) {
|
|
121
119
|
ev.preventDefault();
|
|
122
120
|
this.open("previous");
|
|
@@ -49,7 +49,7 @@ export class Snackbar {
|
|
|
49
49
|
this.newNotification = false;
|
|
50
50
|
}
|
|
51
51
|
checkForTabbing(ev) {
|
|
52
|
-
if (ev.
|
|
52
|
+
if (ev.key === "Tab") {
|
|
53
53
|
this.toggleTabbingOn();
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -145,7 +145,7 @@ export class Snackbar {
|
|
|
145
145
|
h("span", null, notification.message),
|
|
146
146
|
notification.link && (h("a", { id: `action-${notification.id}`, class: `link ${notification.newWindow ? "new-window" : ""}`, "aria-label": `Click to ${notification.link}...${notification.newWindow ? " " + this.newWindowMessage : ""}`, tabindex: 0, onClick: () => {
|
|
147
147
|
this.snackLinkClicked(notification);
|
|
148
|
-
}, onKeyDown: (ev) => ev.
|
|
148
|
+
}, onKeyDown: (ev) => ev.key === "Enter" && this.snackLinkClicked(notification) },
|
|
149
149
|
h("span", { "aria-hidden": "true" }, notification.link)))),
|
|
150
150
|
h("button", { id: `close-button-${notification.id}`, "aria-label": "Close this notification", class: "closesnack", tabindex: notification.link ? 0 : -1, onClick: () => this.snackDismissed(notification) },
|
|
151
151
|
h("span", { class: "tooltip", "aria-hidden": "true" }, "Close"))),
|
|
@@ -354,7 +354,7 @@ export class NetworkUploader {
|
|
|
354
354
|
// then add an even listener to force a click event when Enter key is pressed
|
|
355
355
|
this.inputEl &&
|
|
356
356
|
this.inputEl.addEventListener("keydown", (ev) => {
|
|
357
|
-
if (this.inputEl && ev.
|
|
357
|
+
if (this.inputEl && ev.key === "Enter") {
|
|
358
358
|
this.inputEl.click();
|
|
359
359
|
}
|
|
360
360
|
});
|
|
@@ -258,7 +258,7 @@ export class Uploader {
|
|
|
258
258
|
// then add an even listener to force a click event when Enter key is pressed
|
|
259
259
|
this.inputEl &&
|
|
260
260
|
this.inputEl.addEventListener("keydown", (ev) => {
|
|
261
|
-
if (this.inputEl && ev.
|
|
261
|
+
if (this.inputEl && ev.key === "Enter") {
|
|
262
262
|
this.inputEl.click();
|
|
263
263
|
}
|
|
264
264
|
});
|
|
@@ -9,20 +9,15 @@ if (window.navigator.plugins.length > 0) {
|
|
|
9
9
|
// USER-IS-TABBING CLASSES (FOR FOCUS INDICATORS)
|
|
10
10
|
// Dispatching events to track whether user is navigating with keyboard or mouse
|
|
11
11
|
function wmComponentKeys(ev) {
|
|
12
|
-
|
|
13
|
-
if (key == "Tab" || key === 9) {
|
|
12
|
+
if (ev.key == "Tab") {
|
|
14
13
|
var event = new Event("wmUserIsTabbing");
|
|
15
14
|
window.dispatchEvent(event);
|
|
16
15
|
document.querySelector("body").classList.add("wmcl-user-is-tabbing");
|
|
17
16
|
}
|
|
18
|
-
if (key == "ArrowLeft" ||
|
|
19
|
-
key
|
|
20
|
-
key == "
|
|
21
|
-
key
|
|
22
|
-
key == "ArrowRight" ||
|
|
23
|
-
key === 39 ||
|
|
24
|
-
key == "ArrowDown" ||
|
|
25
|
-
key === 40) {
|
|
17
|
+
if (ev.key == "ArrowLeft" ||
|
|
18
|
+
ev.key == "ArrowUp" ||
|
|
19
|
+
ev.key == "ArrowRight" ||
|
|
20
|
+
ev.key == "ArrowDown") {
|
|
26
21
|
var event = new Event("wmUserIsKeying");
|
|
27
22
|
window.dispatchEvent(event);
|
|
28
23
|
document.querySelector("body").classList.add("wmcl-user-is-keying");
|