@messaia/cdk 21.1.0-rc.24 → 21.1.0-rc.25
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/fesm2022/messaia-cdk.mjs +23 -21
- package/fesm2022/messaia-cdk.mjs.map +1 -1
- package/package.json +1 -1
package/fesm2022/messaia-cdk.mjs
CHANGED
|
@@ -17289,27 +17289,29 @@ class FilterInputComponent {
|
|
|
17289
17289
|
* @param event
|
|
17290
17290
|
*/
|
|
17291
17291
|
onKeyDown(event) {
|
|
17292
|
-
|
|
17293
|
-
|
|
17294
|
-
|
|
17295
|
-
|
|
17296
|
-
|
|
17297
|
-
|
|
17298
|
-
|
|
17299
|
-
|
|
17300
|
-
|
|
17301
|
-
|
|
17302
|
-
|
|
17303
|
-
|
|
17304
|
-
|
|
17305
|
-
|
|
17306
|
-
|
|
17307
|
-
|
|
17308
|
-
|
|
17309
|
-
|
|
17310
|
-
|
|
17311
|
-
|
|
17312
|
-
event.
|
|
17292
|
+
if (this.onlyNumber) {
|
|
17293
|
+
/* Allow navigation keys and control keys */
|
|
17294
|
+
const allowedKeys = ['Backspace', 'Delete', 'Tab', 'Escape', 'Enter', 'ArrowLeft', 'ArrowRight', 'Home', 'End'];
|
|
17295
|
+
/* Allow Ctrl+A, Ctrl+C, Ctrl+V, Ctrl+X */
|
|
17296
|
+
if ((event.ctrlKey || event.metaKey) && ['a', 'c', 'v', 'x'].includes(event.key.toLowerCase())) {
|
|
17297
|
+
return;
|
|
17298
|
+
}
|
|
17299
|
+
/* Allow Ctrl+Z, Ctrl+Y */
|
|
17300
|
+
if ((event.ctrlKey || event.metaKey) && ['z', 'y'].includes(event.key.toLowerCase())) {
|
|
17301
|
+
return;
|
|
17302
|
+
}
|
|
17303
|
+
/* Allow control keys */
|
|
17304
|
+
if (event.ctrlKey || event.metaKey) {
|
|
17305
|
+
return;
|
|
17306
|
+
}
|
|
17307
|
+
/* Allow navigation keys */
|
|
17308
|
+
if (allowedKeys.includes(event.key)) {
|
|
17309
|
+
return;
|
|
17310
|
+
}
|
|
17311
|
+
/* Block non-numeric characters */
|
|
17312
|
+
if (event.key < '0' || event.key > '9') {
|
|
17313
|
+
event.preventDefault();
|
|
17314
|
+
}
|
|
17313
17315
|
}
|
|
17314
17316
|
}
|
|
17315
17317
|
/**
|