@progress/kendo-angular-dropdowns 7.2.1-dev.202209211135 → 7.2.1
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/common/util.d.ts
CHANGED
|
@@ -161,3 +161,15 @@ export declare const getFillModeClass: (component: string, fillMode: DropDownFil
|
|
|
161
161
|
* @hidden
|
|
162
162
|
*/
|
|
163
163
|
export declare const filterAndMap: (arr: any[], predicate: (item: any) => boolean, mapper: (item: any) => any) => any[];
|
|
164
|
+
/**
|
|
165
|
+
* @hidden
|
|
166
|
+
*
|
|
167
|
+
* Returns true if the used browser is Safari.
|
|
168
|
+
*/
|
|
169
|
+
export declare const isSafari: (userAgent: any) => boolean;
|
|
170
|
+
/**
|
|
171
|
+
* @hidden
|
|
172
|
+
*
|
|
173
|
+
* Checks if input is Japanese IME
|
|
174
|
+
*/
|
|
175
|
+
export declare const isJapanese: (input: any) => boolean;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { Component, Input, Output, EventEmitter, ViewChild, HostBinding } from '@angular/core';
|
|
6
6
|
import { isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
7
7
|
import { Keys } from '@progress/kendo-angular-common';
|
|
8
|
-
import { combineStr } from './util';
|
|
8
|
+
import { combineStr, isJapanese, isSafari } from './util';
|
|
9
9
|
import { Subscription } from 'rxjs';
|
|
10
10
|
import { NgControl } from '@angular/forms';
|
|
11
11
|
import * as i0 from "@angular/core";
|
|
@@ -99,17 +99,20 @@ export class SearchBarComponent {
|
|
|
99
99
|
else {
|
|
100
100
|
previousUserInput = this._previousValue;
|
|
101
101
|
}
|
|
102
|
-
const
|
|
103
|
-
const caretAtEnd = previousUserInput.length ===
|
|
102
|
+
const caretStart = this.input.nativeElement.selectionStart;
|
|
103
|
+
const caretAtEnd = previousUserInput.length === caretStart;
|
|
104
104
|
this.writeInputValue(this.suggestedText ? combineStr(this.userInput, this.suggestedText) : this.userInput);
|
|
105
105
|
if (this.suggestedText) {
|
|
106
106
|
this.setInputSelection(this.userInput.length, this.suggestedText.length);
|
|
107
107
|
}
|
|
108
|
+
else if (isSafari(navigator.userAgent) && !caretAtEnd) {
|
|
109
|
+
this.setInputSelection(caretStart, this.userInput.length);
|
|
110
|
+
}
|
|
108
111
|
else if (caretAtEnd) {
|
|
109
112
|
this.setInputSelection(this.userInput.length, this.userInput.length);
|
|
110
113
|
}
|
|
111
114
|
else {
|
|
112
|
-
this.setInputSelection(
|
|
115
|
+
this.setInputSelection(caretStart, caretStart);
|
|
113
116
|
}
|
|
114
117
|
this._previousValue = this.userInput;
|
|
115
118
|
}
|
|
@@ -160,7 +163,9 @@ export class SearchBarComponent {
|
|
|
160
163
|
}
|
|
161
164
|
}
|
|
162
165
|
handleInput(event) {
|
|
163
|
-
const
|
|
166
|
+
const target = event.target;
|
|
167
|
+
const isBrowserSafari = isSafari(navigator.userAgent);
|
|
168
|
+
const value = isBrowserSafari && isJapanese(target.value) ? event.data : target.value;
|
|
164
169
|
if (value !== this.userInput) {
|
|
165
170
|
this._previousValue = value;
|
|
166
171
|
this.valueChange.emit(value);
|
package/esm2015/common/util.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/* eslint-disable no-bitwise */
|
|
6
6
|
import { isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
7
|
-
import { getter as fieldAccessor } from '@progress/kendo-common';
|
|
7
|
+
import { detectDesktopBrowser, detectMobileOS, getter as fieldAccessor } from '@progress/kendo-common';
|
|
8
8
|
/**
|
|
9
9
|
* @hidden
|
|
10
10
|
*/
|
|
@@ -328,3 +328,21 @@ export const getFillModeClass = (component, fillMode) => {
|
|
|
328
328
|
* @hidden
|
|
329
329
|
*/
|
|
330
330
|
export const filterAndMap = (arr, predicate, mapper) => arr.reduce((acc, curr) => predicate(curr) ? [...acc, mapper(curr)] : acc, []);
|
|
331
|
+
/**
|
|
332
|
+
* @hidden
|
|
333
|
+
*
|
|
334
|
+
* Returns true if the used browser is Safari.
|
|
335
|
+
*/
|
|
336
|
+
export const isSafari = (userAgent) => {
|
|
337
|
+
return detectDesktopBrowser(userAgent).safari ||
|
|
338
|
+
(detectMobileOS(userAgent) && detectMobileOS(userAgent).browser === 'mobilesafari');
|
|
339
|
+
};
|
|
340
|
+
/**
|
|
341
|
+
* @hidden
|
|
342
|
+
*
|
|
343
|
+
* Checks if input is Japanese IME
|
|
344
|
+
*/
|
|
345
|
+
export const isJapanese = (input) => {
|
|
346
|
+
const japaneseRegex = /[\u3000-\u303F]|[\u3040-\u309F]|[\u30A0-\u30FF]|[\uFF00-\uFFEF]|[\u4E00-\u9FAF]|[\u2605-\u2606]|[\u2190-\u2195]|\u203B/g;
|
|
347
|
+
return japaneseRegex.test(input);
|
|
348
|
+
};
|
|
@@ -9,7 +9,7 @@ export const packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-dropdowns',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
12
|
+
publishDate: 1665041198,
|
|
13
13
|
version: '',
|
|
14
14
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
15
15
|
};
|
|
@@ -9,7 +9,7 @@ import { isDocumentAvailable, Keys, isChanged, hasObservers, KendoInput, anyChan
|
|
|
9
9
|
import * as i12 from '@angular/forms';
|
|
10
10
|
import { NgControl, NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
11
11
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
12
|
-
import { getter as getter$1, pointers, touchEnabled } from '@progress/kendo-common';
|
|
12
|
+
import { getter as getter$1, detectDesktopBrowser, detectMobileOS, pointers, touchEnabled } from '@progress/kendo-common';
|
|
13
13
|
import { Subscription, merge, fromEvent, Subject, of, interval } from 'rxjs';
|
|
14
14
|
import * as i1 from '@progress/kendo-angular-l10n';
|
|
15
15
|
import { ComponentMessages, LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
@@ -29,7 +29,7 @@ const packageMetadata = {
|
|
|
29
29
|
name: '@progress/kendo-angular-dropdowns',
|
|
30
30
|
productName: 'Kendo UI for Angular',
|
|
31
31
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
32
|
-
publishDate:
|
|
32
|
+
publishDate: 1665041198,
|
|
33
33
|
version: '',
|
|
34
34
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
35
35
|
};
|
|
@@ -358,6 +358,24 @@ const getFillModeClass = (component, fillMode) => {
|
|
|
358
358
|
* @hidden
|
|
359
359
|
*/
|
|
360
360
|
const filterAndMap = (arr, predicate, mapper) => arr.reduce((acc, curr) => predicate(curr) ? [...acc, mapper(curr)] : acc, []);
|
|
361
|
+
/**
|
|
362
|
+
* @hidden
|
|
363
|
+
*
|
|
364
|
+
* Returns true if the used browser is Safari.
|
|
365
|
+
*/
|
|
366
|
+
const isSafari = (userAgent) => {
|
|
367
|
+
return detectDesktopBrowser(userAgent).safari ||
|
|
368
|
+
(detectMobileOS(userAgent) && detectMobileOS(userAgent).browser === 'mobilesafari');
|
|
369
|
+
};
|
|
370
|
+
/**
|
|
371
|
+
* @hidden
|
|
372
|
+
*
|
|
373
|
+
* Checks if input is Japanese IME
|
|
374
|
+
*/
|
|
375
|
+
const isJapanese = (input) => {
|
|
376
|
+
const japaneseRegex = /[\u3000-\u303F]|[\u3040-\u309F]|[\u30A0-\u30FF]|[\uFF00-\uFFEF]|[\u4E00-\u9FAF]|[\u2605-\u2606]|[\u2190-\u2195]|\u203B/g;
|
|
377
|
+
return japaneseRegex.test(input);
|
|
378
|
+
};
|
|
361
379
|
|
|
362
380
|
/**
|
|
363
381
|
* @hidden
|
|
@@ -447,17 +465,20 @@ class SearchBarComponent {
|
|
|
447
465
|
else {
|
|
448
466
|
previousUserInput = this._previousValue;
|
|
449
467
|
}
|
|
450
|
-
const
|
|
451
|
-
const caretAtEnd = previousUserInput.length ===
|
|
468
|
+
const caretStart = this.input.nativeElement.selectionStart;
|
|
469
|
+
const caretAtEnd = previousUserInput.length === caretStart;
|
|
452
470
|
this.writeInputValue(this.suggestedText ? combineStr(this.userInput, this.suggestedText) : this.userInput);
|
|
453
471
|
if (this.suggestedText) {
|
|
454
472
|
this.setInputSelection(this.userInput.length, this.suggestedText.length);
|
|
455
473
|
}
|
|
474
|
+
else if (isSafari(navigator.userAgent) && !caretAtEnd) {
|
|
475
|
+
this.setInputSelection(caretStart, this.userInput.length);
|
|
476
|
+
}
|
|
456
477
|
else if (caretAtEnd) {
|
|
457
478
|
this.setInputSelection(this.userInput.length, this.userInput.length);
|
|
458
479
|
}
|
|
459
480
|
else {
|
|
460
|
-
this.setInputSelection(
|
|
481
|
+
this.setInputSelection(caretStart, caretStart);
|
|
461
482
|
}
|
|
462
483
|
this._previousValue = this.userInput;
|
|
463
484
|
}
|
|
@@ -508,7 +529,9 @@ class SearchBarComponent {
|
|
|
508
529
|
}
|
|
509
530
|
}
|
|
510
531
|
handleInput(event) {
|
|
511
|
-
const
|
|
532
|
+
const target = event.target;
|
|
533
|
+
const isBrowserSafari = isSafari(navigator.userAgent);
|
|
534
|
+
const value = isBrowserSafari && isJapanese(target.value) ? event.data : target.value;
|
|
512
535
|
if (value !== this.userInput) {
|
|
513
536
|
this._previousValue = value;
|
|
514
537
|
this.valueChange.emit(value);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-angular-dropdowns",
|
|
3
|
-
"version": "7.2.1
|
|
3
|
+
"version": "7.2.1",
|
|
4
4
|
"description": "A wide variety of native Angular dropdown components including AutoComplete, ComboBox, DropDownList, DropDownTree, MultiColumnComboBox, MultiSelect, and MultiSelectTree ",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "Progress",
|