@sam-senior/virtual-keyboard 1.0.2 → 2.0.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/README.md +30 -30
- package/esm2022/lib/virtual-keyboard.directive.mjs +232 -0
- package/esm2022/lib/virtual-keyboard.module.mjs +16 -0
- package/esm2022/public_api.mjs +6 -0
- package/esm2022/sam-senior-virtual-keyboard.mjs +5 -0
- package/{fesm2015/sam-senior-virtual-keyboard.js → fesm2022/sam-senior-virtual-keyboard.mjs} +91 -175
- package/fesm2022/sam-senior-virtual-keyboard.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/virtual-keyboard.directive.d.ts +7 -2
- package/lib/virtual-keyboard.module.d.ts +5 -0
- package/package.json +18 -14
- package/public_api.d.ts +1 -0
- package/bundles/sam-senior-virtual-keyboard.umd.js +0 -404
- package/bundles/sam-senior-virtual-keyboard.umd.js.map +0 -1
- package/bundles/sam-senior-virtual-keyboard.umd.min.js +0 -2
- package/bundles/sam-senior-virtual-keyboard.umd.min.js.map +0 -1
- package/esm2015/lib/virtual-keyboard.directive.js +0 -355
- package/esm2015/lib/virtual-keyboard.module.js +0 -15
- package/esm2015/public_api.js +0 -9
- package/esm2015/sam-senior-virtual-keyboard.js +0 -10
- package/esm5/lib/virtual-keyboard.directive.js +0 -412
- package/esm5/lib/virtual-keyboard.module.js +0 -19
- package/esm5/public_api.js +0 -9
- package/esm5/sam-senior-virtual-keyboard.js +0 -10
- package/fesm2015/sam-senior-virtual-keyboard.js.map +0 -1
- package/fesm5/sam-senior-virtual-keyboard.js +0 -399
- package/fesm5/sam-senior-virtual-keyboard.js.map +0 -1
- package/sam-senior-virtual-keyboard.d.ts +0 -5
- package/sam-senior-virtual-keyboard.metadata.json +0 -1
package/{fesm2015/sam-senior-virtual-keyboard.js → fesm2022/sam-senior-virtual-keyboard.mjs}
RENAMED
|
@@ -1,81 +1,55 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, Directive, Optional, Input, Output, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* Devido ficar fora, o webpack não ficará aqui, portando não
|
|
13
|
-
* tem jQuery na lib;
|
|
14
|
-
* **************************************************************
|
|
15
|
-
* @type {?}
|
|
16
|
-
*/
|
|
17
|
-
const jQueryInstance = (/**
|
|
18
|
-
* @param {?} element
|
|
19
|
-
* @return {?}
|
|
20
|
-
*/
|
|
21
|
-
(element) => {
|
|
22
|
-
/** @type {?} */
|
|
23
|
-
const windowInstance = (/** @type {?} */ (window));
|
|
5
|
+
/***************************************************************
|
|
6
|
+
* Método que retonar instancia do elemento jQuery, pois
|
|
7
|
+
* o projeto que implementa esta diretiva fica fora da lib.
|
|
8
|
+
* Devido ficar fora, o webpack não ficará aqui, portando não
|
|
9
|
+
* tem jQuery na lib;
|
|
10
|
+
****************************************************************/
|
|
11
|
+
const jQueryInstance = (element) => {
|
|
12
|
+
const windowInstance = window;
|
|
24
13
|
return windowInstance.jQuery ? windowInstance.jQuery(element) : null;
|
|
25
|
-
}
|
|
14
|
+
};
|
|
26
15
|
class VirtualKeyboardDirective {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
constructor(elementRef, fieldControl) {
|
|
32
|
-
this.elementRef = elementRef;
|
|
33
|
-
this.fieldControl = fieldControl;
|
|
34
|
-
this.keyboardPosition = 'bottom';
|
|
35
|
-
this.keyboardType = 'email';
|
|
36
|
-
this.showOnFocus = true;
|
|
37
|
-
this.keyboardValueAccepted = new EventEmitter();
|
|
38
|
-
this.showKeyboardChange = new EventEmitter();
|
|
39
|
-
this._showKeyboard = false;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* @param {?} activateKeyboard
|
|
43
|
-
* @return {?}
|
|
44
|
-
*/
|
|
16
|
+
elementRef;
|
|
17
|
+
fieldControl;
|
|
18
|
+
keyboardPosition = 'bottom';
|
|
19
|
+
keyboardType = 'email';
|
|
45
20
|
set activateKeyboard(activateKeyboard) {
|
|
46
21
|
if (activateKeyboard) {
|
|
47
|
-
this.keyboardElement =
|
|
22
|
+
this.keyboardElement = this.elementRef.nativeElement;
|
|
48
23
|
this.keyboardjQueryElement = jQueryInstance(this.keyboardElement);
|
|
49
24
|
if (this.keyboardjQueryElement) {
|
|
50
25
|
this.keyboardjQueryElement.keyboard(this.createKeyboardOptions());
|
|
51
26
|
}
|
|
52
27
|
}
|
|
53
28
|
}
|
|
54
|
-
|
|
55
|
-
* @return {?}
|
|
56
|
-
*/
|
|
29
|
+
showOnFocus = true;
|
|
57
30
|
get showKeyboard() {
|
|
58
31
|
return this._showKeyboard;
|
|
59
32
|
}
|
|
60
|
-
/**
|
|
61
|
-
* @param {?} revealKeyboard
|
|
62
|
-
* @return {?}
|
|
63
|
-
*/
|
|
64
33
|
set showKeyboard(revealKeyboard) {
|
|
65
34
|
this._showKeyboard = revealKeyboard;
|
|
66
35
|
this.showKeyboardChange.emit(this._showKeyboard);
|
|
67
36
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
37
|
+
keyboardValueAccepted = new EventEmitter();
|
|
38
|
+
showKeyboardChange = new EventEmitter();
|
|
39
|
+
_showKeyboard = false;
|
|
40
|
+
keyboardElement;
|
|
41
|
+
value = '';
|
|
42
|
+
// Any devido a ser referência do jQuery;
|
|
43
|
+
keyboardjQueryElement;
|
|
44
|
+
constructor(elementRef, fieldControl) {
|
|
45
|
+
this.elementRef = elementRef;
|
|
46
|
+
this.fieldControl = fieldControl;
|
|
47
|
+
}
|
|
71
48
|
ngOnChanges() {
|
|
72
49
|
if (this.showKeyboard && this.isKeyboardCreated()) {
|
|
73
50
|
this.keyboardjQueryElement.getkeyboard().reveal();
|
|
74
51
|
}
|
|
75
52
|
}
|
|
76
|
-
/**
|
|
77
|
-
* @return {?}
|
|
78
|
-
*/
|
|
79
53
|
ngOnDestroy() {
|
|
80
54
|
if (this.isKeyboardCreated()) {
|
|
81
55
|
this.keyboardjQueryElement
|
|
@@ -84,37 +58,23 @@ class VirtualKeyboardDirective {
|
|
|
84
58
|
.destroy();
|
|
85
59
|
}
|
|
86
60
|
}
|
|
87
|
-
/**
|
|
88
|
-
* @private
|
|
89
|
-
* @return {?}
|
|
90
|
-
*/
|
|
91
61
|
isKeyboardCreated() {
|
|
92
62
|
return (this.keyboardjQueryElement &&
|
|
93
63
|
this.keyboardjQueryElement.keyboard() &&
|
|
94
64
|
this.keyboardjQueryElement.keyboard().getkeyboard());
|
|
95
65
|
}
|
|
96
|
-
/**
|
|
97
|
-
* @private
|
|
98
|
-
* @return {?}
|
|
99
|
-
*/
|
|
100
66
|
getDefaultKeyboardOptions() {
|
|
101
|
-
|
|
102
|
-
const keyboardOptions = (/** @type {?} */ ({}));
|
|
67
|
+
const keyboardOptions = {};
|
|
103
68
|
if (!this.showOnFocus) {
|
|
104
69
|
keyboardOptions.openOn = '';
|
|
105
70
|
}
|
|
106
71
|
keyboardOptions.usePreview = false;
|
|
107
|
-
keyboardOptions.autoAccept = true;
|
|
108
72
|
keyboardOptions.accepted = this.onValueAccepted.bind(this);
|
|
109
73
|
keyboardOptions.visible = this.onKeyboardVisible.bind(this);
|
|
110
74
|
keyboardOptions.beforeClose = this.onBeforeClose.bind(this);
|
|
111
75
|
keyboardOptions.change = this.onChange.bind(this);
|
|
112
76
|
return keyboardOptions;
|
|
113
77
|
}
|
|
114
|
-
/**
|
|
115
|
-
* @private
|
|
116
|
-
* @return {?}
|
|
117
|
-
*/
|
|
118
78
|
getKeyboardDisplayOptions() {
|
|
119
79
|
return {
|
|
120
80
|
bksp: '\u2190',
|
|
@@ -124,12 +84,7 @@ class VirtualKeyboardDirective {
|
|
|
124
84
|
accept: 'OK'
|
|
125
85
|
};
|
|
126
86
|
}
|
|
127
|
-
/**
|
|
128
|
-
* @private
|
|
129
|
-
* @return {?}
|
|
130
|
-
*/
|
|
131
87
|
getKeyboardLayout() {
|
|
132
|
-
/** @type {?} */
|
|
133
88
|
let customLayout = {};
|
|
134
89
|
if (this.keyboardType === 'alphanumeric') {
|
|
135
90
|
customLayout = {
|
|
@@ -146,10 +101,6 @@ class VirtualKeyboardDirective {
|
|
|
146
101
|
}
|
|
147
102
|
return customLayout;
|
|
148
103
|
}
|
|
149
|
-
/**
|
|
150
|
-
* @private
|
|
151
|
-
* @return {?}
|
|
152
|
-
*/
|
|
153
104
|
getCustomKeyboardForEmail() {
|
|
154
105
|
return {
|
|
155
106
|
normal: [
|
|
@@ -179,12 +130,7 @@ class VirtualKeyboardDirective {
|
|
|
179
130
|
]
|
|
180
131
|
};
|
|
181
132
|
}
|
|
182
|
-
/**
|
|
183
|
-
* @private
|
|
184
|
-
* @return {?}
|
|
185
|
-
*/
|
|
186
133
|
createKeyboardOptions() {
|
|
187
|
-
/** @type {?} */
|
|
188
134
|
const keyboardOptions = this.getDefaultKeyboardOptions();
|
|
189
135
|
if (this.keyboardPosition !== 'relative') {
|
|
190
136
|
keyboardOptions.position = false;
|
|
@@ -200,46 +146,31 @@ class VirtualKeyboardDirective {
|
|
|
200
146
|
keyboardOptions.customLayout = this.getKeyboardLayout();
|
|
201
147
|
return keyboardOptions;
|
|
202
148
|
}
|
|
203
|
-
/**
|
|
204
|
-
* @private
|
|
205
|
-
* @return {?}
|
|
206
|
-
*/
|
|
207
149
|
onKeyboardVisible() {
|
|
208
150
|
this.addCustomKeyboardFocusClass();
|
|
209
151
|
}
|
|
210
|
-
/**
|
|
211
|
-
* @private
|
|
212
|
-
* @return {?}
|
|
213
|
-
*/
|
|
214
152
|
onBeforeClose() {
|
|
153
|
+
// O elemente do jQuery limpa tudo o que não passou pelo accept
|
|
154
|
+
// Necessário setar o valor quando somente fechado a modal.
|
|
155
|
+
const formControl = this.fieldControl.control;
|
|
156
|
+
formControl.setValue(this.value);
|
|
215
157
|
this.showKeyboard = false;
|
|
216
158
|
}
|
|
217
|
-
/**
|
|
218
|
-
* @private
|
|
219
|
-
* @return {?}
|
|
220
|
-
*/
|
|
221
159
|
onValueAccepted() {
|
|
222
|
-
|
|
223
|
-
const casted = (/** @type {?} */ (this.keyboardElement));
|
|
160
|
+
const casted = this.keyboardElement;
|
|
224
161
|
this.keyboardValueAccepted.emit(casted.value);
|
|
225
162
|
}
|
|
226
|
-
/**
|
|
227
|
-
* @private
|
|
228
|
-
* @param {?} event
|
|
229
|
-
* @return {?}
|
|
230
|
-
*/
|
|
231
163
|
onChange(event) {
|
|
232
|
-
/** @type {?} */
|
|
233
164
|
const virtualkeyboardevent = new CustomEvent('virtualkeyboardevent', event);
|
|
234
165
|
document.dispatchEvent(virtualkeyboardevent);
|
|
235
166
|
if (this.keyboardElement instanceof HTMLInputElement) {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
const inputVal = keyboardElement.value;
|
|
167
|
+
const keyboardElement = this.keyboardElement;
|
|
168
|
+
// Arquivo possui referecia do jQuery que é alterado ao fechar o teclado.
|
|
169
|
+
// Necessário clonar a string.
|
|
170
|
+
const inputVal = JSON.stringify(keyboardElement.value).replace('"', '').replace('"', '');
|
|
240
171
|
if (this.fieldControl) {
|
|
241
|
-
/** @type {?} */
|
|
242
172
|
const formControl = this.fieldControl.control;
|
|
173
|
+
this.value = inputVal;
|
|
243
174
|
formControl.setValue(inputVal);
|
|
244
175
|
formControl.markAsDirty();
|
|
245
176
|
formControl.updateValueAndValidity();
|
|
@@ -247,94 +178,79 @@ class VirtualKeyboardDirective {
|
|
|
247
178
|
// Este setTimeout é necessário para fazer com que o
|
|
248
179
|
// cursor do input sempre esteja no final da string digitada
|
|
249
180
|
// e o final da string sempre esteja visivel.
|
|
250
|
-
setTimeout((
|
|
251
|
-
* @return {?}
|
|
252
|
-
*/
|
|
253
|
-
() => {
|
|
181
|
+
setTimeout(() => {
|
|
254
182
|
keyboardElement.value = inputVal;
|
|
255
183
|
keyboardElement.scrollLeft = keyboardElement.scrollWidth;
|
|
256
|
-
})
|
|
184
|
+
});
|
|
257
185
|
}
|
|
258
186
|
}
|
|
259
|
-
/**
|
|
260
|
-
* @private
|
|
261
|
-
* @return {?}
|
|
262
|
-
*/
|
|
263
187
|
addBottomKeyboardClass() {
|
|
264
|
-
this.injectCssRule(`.ui-keyboard {
|
|
265
|
-
border-radius: 0;
|
|
266
|
-
left: 0;
|
|
267
|
-
top: auto;
|
|
268
|
-
bottom: 0;
|
|
269
|
-
position: fixed;
|
|
270
|
-
width: 100%;
|
|
188
|
+
this.injectCssRule(`.ui-keyboard {
|
|
189
|
+
border-radius: 0;
|
|
190
|
+
left: 0;
|
|
191
|
+
top: auto;
|
|
192
|
+
bottom: 0;
|
|
193
|
+
position: fixed;
|
|
194
|
+
width: 100%;
|
|
271
195
|
}`);
|
|
272
196
|
}
|
|
273
|
-
/**
|
|
274
|
-
* @private
|
|
275
|
-
* @return {?}
|
|
276
|
-
*/
|
|
277
197
|
addCustomKeyboardFocusClass() {
|
|
278
|
-
this.injectCssRule(`.ui-keyboard-has-focus {
|
|
279
|
-
z-index: 900;
|
|
198
|
+
this.injectCssRule(`.ui-keyboard-has-focus {
|
|
199
|
+
z-index: 900;
|
|
280
200
|
}`);
|
|
281
201
|
}
|
|
282
|
-
/**
|
|
283
|
-
* @private
|
|
284
|
-
* @param {?} rule
|
|
285
|
-
* @return {?}
|
|
286
|
-
*/
|
|
287
202
|
injectCssRule(rule) {
|
|
288
|
-
|
|
289
|
-
const style = (/** @type {?} */ (document.createElement('style')));
|
|
203
|
+
const style = document.createElement('style');
|
|
290
204
|
style.appendChild(document.createTextNode(''));
|
|
291
205
|
document.head.appendChild(style);
|
|
292
206
|
style.sheet.insertRule(rule);
|
|
293
207
|
}
|
|
208
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: VirtualKeyboardDirective, deps: [{ token: i0.ElementRef }, { token: i1.NgControl, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
209
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: VirtualKeyboardDirective, selector: "[samVirtualKeyboard]", inputs: { keyboardPosition: "keyboardPosition", keyboardType: "keyboardType", activateKeyboard: "activateKeyboard", showOnFocus: "showOnFocus", showKeyboard: "showKeyboard" }, outputs: { keyboardValueAccepted: "keyboardValueAccepted", showKeyboardChange: "showKeyboardChange" }, usesOnChanges: true, ngImport: i0 });
|
|
294
210
|
}
|
|
295
|
-
VirtualKeyboardDirective
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
]
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
]
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
211
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: VirtualKeyboardDirective, decorators: [{
|
|
212
|
+
type: Directive,
|
|
213
|
+
args: [{
|
|
214
|
+
selector: '[samVirtualKeyboard]'
|
|
215
|
+
}]
|
|
216
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.NgControl, decorators: [{
|
|
217
|
+
type: Optional
|
|
218
|
+
}] }], propDecorators: { keyboardPosition: [{
|
|
219
|
+
type: Input
|
|
220
|
+
}], keyboardType: [{
|
|
221
|
+
type: Input
|
|
222
|
+
}], activateKeyboard: [{
|
|
223
|
+
type: Input
|
|
224
|
+
}], showOnFocus: [{
|
|
225
|
+
type: Input
|
|
226
|
+
}], showKeyboard: [{
|
|
227
|
+
type: Input
|
|
228
|
+
}], keyboardValueAccepted: [{
|
|
229
|
+
type: Output
|
|
230
|
+
}], showKeyboardChange: [{
|
|
231
|
+
type: Output
|
|
232
|
+
}] } });
|
|
314
233
|
|
|
315
|
-
/**
|
|
316
|
-
* @fileoverview added by tsickle
|
|
317
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
318
|
-
*/
|
|
319
234
|
class VirtualKeyboardModule {
|
|
235
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: VirtualKeyboardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
236
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: VirtualKeyboardModule, declarations: [VirtualKeyboardDirective], exports: [VirtualKeyboardDirective] });
|
|
237
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: VirtualKeyboardModule });
|
|
320
238
|
}
|
|
321
|
-
VirtualKeyboardModule
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
]
|
|
239
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: VirtualKeyboardModule, decorators: [{
|
|
240
|
+
type: NgModule,
|
|
241
|
+
args: [{
|
|
242
|
+
declarations: [VirtualKeyboardDirective],
|
|
243
|
+
exports: [VirtualKeyboardDirective]
|
|
244
|
+
}]
|
|
245
|
+
}] });
|
|
327
246
|
|
|
328
|
-
|
|
329
|
-
*
|
|
330
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
247
|
+
/*
|
|
248
|
+
* Public API Surface of virtual-keyboard
|
|
331
249
|
*/
|
|
332
250
|
|
|
333
251
|
/**
|
|
334
|
-
*
|
|
335
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
252
|
+
* Generated bundle index. Do not edit.
|
|
336
253
|
*/
|
|
337
254
|
|
|
338
|
-
export {
|
|
339
|
-
|
|
340
|
-
//# sourceMappingURL=sam-senior-virtual-keyboard.js.map
|
|
255
|
+
export { VirtualKeyboardDirective, VirtualKeyboardModule };
|
|
256
|
+
//# sourceMappingURL=sam-senior-virtual-keyboard.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sam-senior-virtual-keyboard.mjs","sources":["../../../projects/sam-virtual-keyboard/src/lib/virtual-keyboard.directive.ts","../../../projects/sam-virtual-keyboard/src/lib/virtual-keyboard.module.ts","../../../projects/sam-virtual-keyboard/src/public_api.ts","../../../projects/sam-virtual-keyboard/src/sam-senior-virtual-keyboard.ts"],"sourcesContent":["import { Directive, OnDestroy, OnChanges, ElementRef, Optional, Input, Output, EventEmitter } from '@angular/core';\r\nimport { NgControl } from '@angular/forms';\r\n\r\nimport { KeyboardOptions } from 'virtual-keyboard';\r\n\r\n/***************************************************************\r\n* Método que retonar instancia do elemento jQuery, pois\r\n* o projeto que implementa esta diretiva fica fora da lib.\r\n* Devido ficar fora, o webpack não ficará aqui, portando não\r\n* tem jQuery na lib;\r\n****************************************************************/\r\nconst jQueryInstance = (element) => {\r\n const windowInstance = window as any;\r\n return windowInstance.jQuery ? windowInstance.jQuery(element) : null;\r\n};\r\n\r\n@Directive({\r\n selector: '[samVirtualKeyboard]'\r\n})\r\nexport class VirtualKeyboardDirective\r\n implements OnDestroy, OnChanges {\r\n\r\n @Input() private keyboardPosition: 'relative' | 'bottom' = 'bottom';\r\n @Input() private keyboardType: 'email' | 'alphanumeric' = 'email';\r\n @Input() public set activateKeyboard(activateKeyboard: boolean) {\r\n if (activateKeyboard) {\r\n this.keyboardElement = this.elementRef.nativeElement as HTMLElement;\r\n this.keyboardjQueryElement = jQueryInstance(this.keyboardElement);\r\n if (this.keyboardjQueryElement) {\r\n this.keyboardjQueryElement.keyboard(this.createKeyboardOptions());\r\n }\r\n }\r\n }\r\n @Input() private showOnFocus = true;\r\n @Input()\r\n public get showKeyboard(): boolean {\r\n return this._showKeyboard;\r\n }\r\n public set showKeyboard(revealKeyboard: boolean) {\r\n this._showKeyboard = revealKeyboard;\r\n this.showKeyboardChange.emit(this._showKeyboard);\r\n }\r\n\r\n @Output() private keyboardValueAccepted = new EventEmitter();\r\n @Output() public showKeyboardChange = new EventEmitter<boolean>();\r\n\r\n public _showKeyboard = false;\r\n private keyboardElement: HTMLElement;\r\n private value = '';\r\n\r\n // Any devido a ser referência do jQuery;\r\n private keyboardjQueryElement: any;\r\n\r\n constructor(\r\n public elementRef: ElementRef,\r\n @Optional() public fieldControl: NgControl\r\n ) { }\r\n\r\n ngOnChanges() {\r\n if (this.showKeyboard && this.isKeyboardCreated()) {\r\n this.keyboardjQueryElement.getkeyboard().reveal();\r\n }\r\n }\r\n\r\n ngOnDestroy() {\r\n if (this.isKeyboardCreated()) {\r\n this.keyboardjQueryElement\r\n .keyboard()\r\n .getkeyboard()\r\n .destroy();\r\n }\r\n }\r\n\r\n private isKeyboardCreated(): boolean {\r\n return (\r\n this.keyboardjQueryElement &&\r\n this.keyboardjQueryElement.keyboard() &&\r\n this.keyboardjQueryElement.keyboard().getkeyboard()\r\n );\r\n }\r\n\r\n private getDefaultKeyboardOptions() {\r\n const keyboardOptions = {} as KeyboardOptions;\r\n if (!this.showOnFocus) {\r\n keyboardOptions.openOn = '';\r\n }\r\n keyboardOptions.usePreview = false;\r\n keyboardOptions.accepted = this.onValueAccepted.bind(this);\r\n keyboardOptions.visible = this.onKeyboardVisible.bind(this);\r\n keyboardOptions.beforeClose = this.onBeforeClose.bind(this);\r\n keyboardOptions.change = this.onChange.bind(this);\r\n return keyboardOptions;\r\n }\r\n\r\n private getKeyboardDisplayOptions() {\r\n return {\r\n bksp: '\\u2190',\r\n normal: 'ABC',\r\n meta1: '%?@',\r\n meta2: '#+=',\r\n accept: 'OK'\r\n };\r\n }\r\n\r\n private getKeyboardLayout() {\r\n let customLayout = {};\r\n if (this.keyboardType === 'alphanumeric') {\r\n customLayout = {\r\n normal: [\r\n '1 2 3 4 5 6 7 8 9 0',\r\n 'Q W E R T Y U I O P {bksp}',\r\n 'A S D F G H J K L Ç',\r\n 'Z X C V B N M {accept}'\r\n ]\r\n };\r\n } else if (this.keyboardType === 'email') {\r\n customLayout = this.getCustomKeyboardForEmail();\r\n }\r\n return customLayout;\r\n }\r\n\r\n private getCustomKeyboardForEmail() {\r\n return {\r\n normal: [\r\n '1 2 3 4 5 6 7 8 9 0',\r\n 'q w e r t y u i o p {bksp}',\r\n 'a s d f g h j k l ç',\r\n '{s} z x c v b n m .',\r\n '{meta1} {space} _ - {accept}'\r\n ],\r\n shift: [\r\n '1 2 3 4 5 6 7 8 9 0',\r\n 'Q W E R T Y U I O P {bksp}',\r\n 'A S D F G H J K L Ç',\r\n '{s} Z X C V B N M .',\r\n '{meta1} {space} _ - {accept}'\r\n ],\r\n meta1: [\r\n \"` | { } % ^ * / ' {bksp}\",\r\n '{meta2} $ & ~ # = + @',\r\n '{normal} {space} ! ? {accept}'\r\n ],\r\n meta2: [\r\n '[ ] { } \\u2039 \\u203a ^ * \" , {bksp}',\r\n '\\\\ | / < > $ \\u00a3 \\u00a5 \\u2022',\r\n '{meta1} \\u20ac & ~ # = + .',\r\n '{normal} {space} ! ? {accept}'\r\n ]\r\n };\r\n }\r\n\r\n private createKeyboardOptions(): KeyboardOptions {\r\n const keyboardOptions = this.getDefaultKeyboardOptions();\r\n if (this.keyboardPosition !== 'relative') {\r\n keyboardOptions.position = false;\r\n }\r\n if (this.keyboardPosition === 'bottom') {\r\n this.addBottomKeyboardClass();\r\n }\r\n keyboardOptions.css = {\r\n buttonDefault: 'keyboard-button-override'\r\n };\r\n\r\n keyboardOptions.display = this.getKeyboardDisplayOptions();\r\n keyboardOptions.layout = 'custom';\r\n keyboardOptions.customLayout = this.getKeyboardLayout();\r\n\r\n return keyboardOptions;\r\n }\r\n\r\n private onKeyboardVisible() {\r\n this.addCustomKeyboardFocusClass();\r\n }\r\n\r\n private onBeforeClose() {\r\n // O elemente do jQuery limpa tudo o que não passou pelo accept\r\n // Necessário setar o valor quando somente fechado a modal.\r\n const formControl = this.fieldControl.control;\r\n formControl.setValue(this.value);\r\n this.showKeyboard = false;\r\n }\r\n\r\n private onValueAccepted() {\r\n const casted = this.keyboardElement as any;\r\n this.keyboardValueAccepted.emit(casted.value);\r\n }\r\n\r\n private onChange(event) {\r\n const virtualkeyboardevent = new CustomEvent('virtualkeyboardevent', event);\r\n document.dispatchEvent(virtualkeyboardevent);\r\n if (this.keyboardElement instanceof HTMLInputElement) {\r\n const keyboardElement = this.keyboardElement as HTMLInputElement;\r\n // Arquivo possui referecia do jQuery que é alterado ao fechar o teclado.\r\n // Necessário clonar a string.\r\n const inputVal = JSON.stringify(keyboardElement.value).replace('\"', '').replace('\"', '');\r\n if (this.fieldControl) {\r\n const formControl = this.fieldControl.control;\r\n this.value = inputVal;\r\n formControl.setValue(inputVal);\r\n formControl.markAsDirty();\r\n formControl.updateValueAndValidity();\r\n }\r\n // Este setTimeout é necessário para fazer com que o\r\n // cursor do input sempre esteja no final da string digitada\r\n // e o final da string sempre esteja visivel.\r\n setTimeout(() => {\r\n keyboardElement.value = inputVal;\r\n keyboardElement.scrollLeft = keyboardElement.scrollWidth;\r\n });\r\n }\r\n }\r\n\r\n private addBottomKeyboardClass() {\r\n this.injectCssRule(\r\n `.ui-keyboard {\r\n border-radius: 0;\r\n left: 0;\r\n top: auto;\r\n bottom: 0;\r\n position: fixed;\r\n width: 100%;\r\n }`\r\n );\r\n }\r\n\r\n private addCustomKeyboardFocusClass() {\r\n this.injectCssRule(\r\n `.ui-keyboard-has-focus {\r\n z-index: 900;\r\n }`\r\n );\r\n }\r\n\r\n private injectCssRule(rule) {\r\n const style = document.createElement('style') as any;\r\n style.appendChild(document.createTextNode(''));\r\n document.head.appendChild(style);\r\n style.sheet.insertRule(rule);\r\n }\r\n}\r\n\r\n","import { NgModule } from '@angular/core';\r\nimport { VirtualKeyboardDirective } from './virtual-keyboard.directive';\r\n\r\n@NgModule({\r\n declarations: [VirtualKeyboardDirective],\r\n exports: [VirtualKeyboardDirective]\r\n})\r\nexport class VirtualKeyboardModule { }\r\n","/*\r\n * Public API Surface of virtual-keyboard\r\n */\r\nexport * from './lib/virtual-keyboard.directive';\r\nexport * from './lib/virtual-keyboard.module';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;AAKA;;;;;AAKiE;AACjE,MAAM,cAAc,GAAG,CAAC,OAAO,KAAI;IACjC,MAAM,cAAc,GAAG,MAAa,CAAC;AACrC,IAAA,OAAO,cAAc,CAAC,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;AACvE,CAAC,CAAC;MAKW,wBAAwB,CAAA;AAmC1B,IAAA,UAAA,CAAA;AACY,IAAA,YAAA,CAAA;IAjCJ,gBAAgB,GAA0B,QAAQ,CAAC;IACnD,YAAY,GAA6B,OAAO,CAAC;IAClE,IAAoB,gBAAgB,CAAC,gBAAyB,EAAA;QAC5D,IAAI,gBAAgB,EAAE;YACpB,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,UAAU,CAAC,aAA4B,CAAC;YACpE,IAAI,CAAC,qBAAqB,GAAG,cAAc,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AAClE,YAAA,IAAI,IAAI,CAAC,qBAAqB,EAAE;gBAC9B,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC;aACnE;SACF;KACF;IACgB,WAAW,GAAG,IAAI,CAAC;AACpC,IAAA,IACW,YAAY,GAAA;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;KAC3B;IACD,IAAW,YAAY,CAAC,cAAuB,EAAA;AAC7C,QAAA,IAAI,CAAC,aAAa,GAAG,cAAc,CAAC;QACpC,IAAI,CAAC,kBAAkB,CAAC,IAAI,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AAA,EAAA,CAAA,CAAA;yGAArB,qBAAqB,EAAA,YAAA,EAAA,CAHjB,wBAAwB,CAAA,EAAA,OAAA,EAAA,CAC7B,wBAAwB,CAAA,EAAA,CAAA,CAAA;yGAEvB,qBAAqB,EAAA,CAAA,CAAA;;4FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAJjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,wBAAwB,CAAC;oBACxC,OAAO,EAAE,CAAC,wBAAwB,CAAC;AACpC,iBAAA,CAAA;;;ACND;;AAEG;;ACFH;;AAEG;;;;"}
|
package/index.d.ts
ADDED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { OnDestroy, OnChanges, ElementRef, EventEmitter } from '@angular/core';
|
|
2
2
|
import { NgControl } from '@angular/forms';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
3
4
|
export declare class VirtualKeyboardDirective implements OnDestroy, OnChanges {
|
|
4
5
|
elementRef: ElementRef;
|
|
5
6
|
fieldControl: NgControl;
|
|
6
7
|
private keyboardPosition;
|
|
7
8
|
private keyboardType;
|
|
8
|
-
activateKeyboard: boolean;
|
|
9
|
+
set activateKeyboard(activateKeyboard: boolean);
|
|
9
10
|
private showOnFocus;
|
|
10
|
-
showKeyboard: boolean;
|
|
11
|
+
get showKeyboard(): boolean;
|
|
12
|
+
set showKeyboard(revealKeyboard: boolean);
|
|
11
13
|
private keyboardValueAccepted;
|
|
12
14
|
showKeyboardChange: EventEmitter<boolean>;
|
|
13
15
|
_showKeyboard: boolean;
|
|
14
16
|
private keyboardElement;
|
|
17
|
+
private value;
|
|
15
18
|
private keyboardjQueryElement;
|
|
16
19
|
constructor(elementRef: ElementRef, fieldControl: NgControl);
|
|
17
20
|
ngOnChanges(): void;
|
|
@@ -29,4 +32,6 @@ export declare class VirtualKeyboardDirective implements OnDestroy, OnChanges {
|
|
|
29
32
|
private addBottomKeyboardClass;
|
|
30
33
|
private addCustomKeyboardFocusClass;
|
|
31
34
|
private injectCssRule;
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VirtualKeyboardDirective, [null, { optional: true; }]>;
|
|
36
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<VirtualKeyboardDirective, "[samVirtualKeyboard]", never, { "keyboardPosition": { "alias": "keyboardPosition"; "required": false; }; "keyboardType": { "alias": "keyboardType"; "required": false; }; "activateKeyboard": { "alias": "activateKeyboard"; "required": false; }; "showOnFocus": { "alias": "showOnFocus"; "required": false; }; "showKeyboard": { "alias": "showKeyboard"; "required": false; }; }, { "keyboardValueAccepted": "keyboardValueAccepted"; "showKeyboardChange": "showKeyboardChange"; }, never, never, false, never>;
|
|
32
37
|
}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./virtual-keyboard.directive";
|
|
1
3
|
export declare class VirtualKeyboardModule {
|
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VirtualKeyboardModule, never>;
|
|
5
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<VirtualKeyboardModule, [typeof i1.VirtualKeyboardDirective], never, [typeof i1.VirtualKeyboardDirective]>;
|
|
6
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<VirtualKeyboardModule>;
|
|
2
7
|
}
|
package/package.json
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sam-senior/virtual-keyboard",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/common": "^
|
|
6
|
-
"@angular/core": "^
|
|
5
|
+
"@angular/common": "^18.0.0",
|
|
6
|
+
"@angular/core": "^18.0.0"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"virtual-keyboard": "^1.28.1",
|
|
10
|
-
"tslib": "^
|
|
10
|
+
"tslib": "^2.3.0"
|
|
11
|
+
},
|
|
12
|
+
"module": "fesm2022/sam-senior-virtual-keyboard.mjs",
|
|
13
|
+
"typings": "index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": {
|
|
16
|
+
"default": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./index.d.ts",
|
|
20
|
+
"esm2022": "./esm2022/sam-senior-virtual-keyboard.mjs",
|
|
21
|
+
"esm": "./esm2022/sam-senior-virtual-keyboard.mjs",
|
|
22
|
+
"default": "./fesm2022/sam-senior-virtual-keyboard.mjs"
|
|
23
|
+
}
|
|
11
24
|
},
|
|
12
|
-
"main": "bundles/sam-senior-virtual-keyboard.umd.js",
|
|
13
|
-
"module": "fesm5/sam-senior-virtual-keyboard.js",
|
|
14
|
-
"es2015": "fesm2015/sam-senior-virtual-keyboard.js",
|
|
15
|
-
"esm5": "esm5/sam-senior-virtual-keyboard.js",
|
|
16
|
-
"esm2015": "esm2015/sam-senior-virtual-keyboard.js",
|
|
17
|
-
"fesm5": "fesm5/sam-senior-virtual-keyboard.js",
|
|
18
|
-
"fesm2015": "fesm2015/sam-senior-virtual-keyboard.js",
|
|
19
|
-
"typings": "sam-senior-virtual-keyboard.d.ts",
|
|
20
|
-
"metadata": "sam-senior-virtual-keyboard.metadata.json",
|
|
21
25
|
"sideEffects": false
|
|
22
|
-
}
|
|
26
|
+
}
|
package/public_api.d.ts
CHANGED