@koobiq/components 18.39.2 → 18.39.4
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/checkbox/checkbox.scss +5 -5
- package/code-block/code-block.d.ts +10 -3
- package/code-block/code-block.module.d.ts +1 -1
- package/code-block/code-block.scss +1 -0
- package/code-block/types.d.ts +9 -0
- package/core/highlight/highlight.pipe.d.ts +2 -0
- package/core/option/action.d.ts +5 -6
- package/core/pop-up/pop-up-trigger.d.ts +4 -1
- package/core/selection/pseudo-checkbox/pseudo-checkbox.scss +2 -2
- package/datepicker/datepicker-input.directive.d.ts +6 -1
- package/esm2022/checkbox/checkbox.mjs +2 -2
- package/esm2022/code-block/code-block.mjs +23 -6
- package/esm2022/code-block/code-block.module.mjs +8 -5
- package/esm2022/code-block/types.mjs +1 -1
- package/esm2022/core/highlight/highlight.pipe.mjs +23 -5
- package/esm2022/core/locales/en-US.mjs +2 -2
- package/esm2022/core/locales/es-LA.mjs +2 -2
- package/esm2022/core/locales/pt-BR.mjs +2 -2
- package/esm2022/core/locales/ru-RU.mjs +2 -2
- package/esm2022/core/locales/tk-TM.mjs +2 -2
- package/esm2022/core/option/action.mjs +21 -22
- package/esm2022/core/pop-up/pop-up-trigger.mjs +11 -3
- package/esm2022/core/version.mjs +2 -2
- package/esm2022/datepicker/datepicker-input.directive.mjs +9 -2
- package/esm2022/datepicker/datepicker.component.mjs +2 -2
- package/esm2022/dropdown/dropdown-trigger.directive.mjs +3 -2
- package/esm2022/filter-bar/pipes/pipe-date.mjs +7 -8
- package/esm2022/filter-bar/pipes/pipe-datetime.mjs +8 -9
- package/esm2022/filter-bar/pipes/pipe-multi-tree-select.mjs +3 -3
- package/esm2022/filter-bar/pipes/pipe-text.mjs +3 -3
- package/esm2022/form-field/cleaner.mjs +3 -3
- package/esm2022/form-field/fieldset.mjs +2 -2
- package/esm2022/form-field/form-field.mjs +2 -2
- package/esm2022/form-field/password-toggle.mjs +3 -3
- package/esm2022/form-field/stepper.mjs +3 -1
- package/esm2022/icon/icon-button.component.mjs +2 -2
- package/esm2022/inline-edit/inline-edit.mjs +4 -4
- package/esm2022/input/input-password.mjs +5 -4
- package/esm2022/input/input.mjs +5 -4
- package/esm2022/list/list-selection.component.mjs +12 -2
- package/esm2022/navbar/navbar-item.component.mjs +9 -2
- package/esm2022/popover/popover-confirm.component.mjs +3 -3
- package/esm2022/popover/popover.component.mjs +3 -3
- package/esm2022/progress-spinner/progress-spinner.component.mjs +4 -3
- package/esm2022/search-expandable/search-expandable.mjs +50 -23
- package/esm2022/select/select.component.mjs +10 -6
- package/esm2022/tabs/tab-header.component.mjs +2 -2
- package/esm2022/tabs/tab-nav-bar.mjs +3 -3
- package/esm2022/tags/tag-input.mjs +21 -24
- package/esm2022/tags/tag-list.component.mjs +14 -5
- package/esm2022/tags/tag.component.mjs +9 -3
- package/esm2022/textarea/textarea.component.mjs +4 -3
- package/esm2022/title/title.directive.mjs +16 -3
- package/esm2022/tooltip/tooltip.component.mjs +2 -2
- package/esm2022/tree-select/tree-select.component.mjs +4 -3
- package/fesm2022/koobiq-components-checkbox.mjs +2 -2
- package/fesm2022/koobiq-components-checkbox.mjs.map +1 -1
- package/fesm2022/koobiq-components-code-block.mjs +29 -9
- package/fesm2022/koobiq-components-code-block.mjs.map +1 -1
- package/fesm2022/koobiq-components-core.mjs +56 -32
- package/fesm2022/koobiq-components-core.mjs.map +1 -1
- package/fesm2022/koobiq-components-datepicker.mjs +9 -2
- package/fesm2022/koobiq-components-datepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-dropdown.mjs +2 -1
- package/fesm2022/koobiq-components-dropdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-filter-bar.mjs +24 -24
- package/fesm2022/koobiq-components-filter-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-form-field.mjs +10 -8
- package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
- package/fesm2022/koobiq-components-icon.mjs +2 -2
- package/fesm2022/koobiq-components-icon.mjs.map +1 -1
- package/fesm2022/koobiq-components-inline-edit.mjs +3 -3
- package/fesm2022/koobiq-components-inline-edit.mjs.map +1 -1
- package/fesm2022/koobiq-components-input.mjs +6 -4
- package/fesm2022/koobiq-components-input.mjs.map +1 -1
- package/fesm2022/koobiq-components-list.mjs +11 -1
- package/fesm2022/koobiq-components-list.mjs.map +1 -1
- package/fesm2022/koobiq-components-navbar.mjs +8 -1
- package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
- package/fesm2022/koobiq-components-popover.mjs +4 -4
- package/fesm2022/koobiq-components-popover.mjs.map +1 -1
- package/fesm2022/koobiq-components-progress-spinner.mjs +3 -2
- package/fesm2022/koobiq-components-progress-spinner.mjs.map +1 -1
- package/fesm2022/koobiq-components-search-expandable.mjs +49 -22
- package/fesm2022/koobiq-components-search-expandable.mjs.map +1 -1
- package/fesm2022/koobiq-components-select.mjs +9 -5
- package/fesm2022/koobiq-components-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-tabs.mjs +4 -4
- package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
- package/fesm2022/koobiq-components-tags.mjs +39 -27
- package/fesm2022/koobiq-components-tags.mjs.map +1 -1
- package/fesm2022/koobiq-components-textarea.mjs +3 -2
- package/fesm2022/koobiq-components-textarea.mjs.map +1 -1
- package/fesm2022/koobiq-components-title.mjs +15 -2
- package/fesm2022/koobiq-components-title.mjs.map +1 -1
- package/fesm2022/koobiq-components-tooltip.mjs +1 -1
- package/fesm2022/koobiq-components-tooltip.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree-select.mjs +3 -2
- package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
- package/filter-bar/pipes/pipe-date.scss +3 -15
- package/form-field/_form-field-theme.scss +2 -2
- package/form-field/form-field.scss +0 -1
- package/icon/icon-button.scss +9 -4
- package/inline-edit/inline-edit-tokens.scss +1 -1
- package/inline-edit/inline-edit.d.ts +2 -2
- package/inline-edit/inline-edit.scss +1 -1
- package/input/input-password.d.ts +1 -0
- package/input/input.d.ts +1 -0
- package/list/list-selection.component.d.ts +1 -0
- package/navbar/navbar-item.component.d.ts +3 -1
- package/package.json +10 -10
- package/popover/_popover-theme.scss +1 -1
- package/progress-spinner/_progress-spinner-theme.scss +14 -4
- package/progress-spinner/progress-spinner-tokens.scss +2 -0
- package/schematics/ng-add/index.js +2 -2
- package/search-expandable/search-expandable.d.ts +19 -4
- package/select/select.component.d.ts +3 -1
- package/tabs/_tabs-common.scss +2 -1
- package/tags/tag-input.d.ts +4 -3
- package/tags/tag-list.component.d.ts +8 -1
- package/tags/tag.component.d.ts +2 -0
- package/textarea/textarea.component.d.ts +1 -0
- package/title/title.directive.d.ts +3 -0
- package/tree-select/tree-select.component.d.ts +1 -0
|
@@ -5,7 +5,7 @@ import * as i3 from '@angular/forms';
|
|
|
5
5
|
import { hasModifierKey, isSelectAll, ENTER as ENTER$1, TAB as TAB$1, SPACE as SPACE$1, COMMA, SEMICOLON } from '@koobiq/cdk/keycodes';
|
|
6
6
|
import * as i3$1 from '@koobiq/components/autocomplete';
|
|
7
7
|
import * as i1 from '@koobiq/components/core';
|
|
8
|
-
import { KbqFieldSizingContent, KbqColorDirective, KbqComponentColors, isNull, KBQ_TITLE_TEXT_REF,
|
|
8
|
+
import { KbqFieldSizingContent, KbqColorDirective, KbqComponentColors, isNull, KBQ_TITLE_TEXT_REF, KBQ_VALIDATION } from '@koobiq/components/core';
|
|
9
9
|
import * as i1$1 from '@koobiq/components/form-field';
|
|
10
10
|
import { KbqFormFieldControl } from '@koobiq/components/form-field';
|
|
11
11
|
import { FocusMonitor } from '@angular/cdk/a11y';
|
|
@@ -107,6 +107,10 @@ class KbqTagEditInput {
|
|
|
107
107
|
this.tag = inject(KbqTag);
|
|
108
108
|
}
|
|
109
109
|
/** @docs-private */
|
|
110
|
+
handleClick(event) {
|
|
111
|
+
event.stopPropagation();
|
|
112
|
+
}
|
|
113
|
+
/** @docs-private */
|
|
110
114
|
handleKeydown(event) {
|
|
111
115
|
switch (event.keyCode) {
|
|
112
116
|
case ESCAPE: {
|
|
@@ -130,7 +134,7 @@ class KbqTagEditInput {
|
|
|
130
134
|
}
|
|
131
135
|
}
|
|
132
136
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTagEditInput, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
133
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: KbqTagEditInput, isStandalone: true, selector: "[kbqTagEditInput]", host: { listeners: { "keydown": "handleKeydown($event)" }, classAttribute: "kbq-tag-edit-input" }, exportAs: ["kbqTagEditInput"], hostDirectives: [{ directive: i1.KbqFieldSizingContent }], ngImport: i0 }); }
|
|
137
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: KbqTagEditInput, isStandalone: true, selector: "[kbqTagEditInput]", host: { listeners: { "keydown": "handleKeydown($event)", "click": "handleClick($event)" }, classAttribute: "kbq-tag-edit-input" }, exportAs: ["kbqTagEditInput"], hostDirectives: [{ directive: i1.KbqFieldSizingContent }], ngImport: i0 }); }
|
|
134
138
|
}
|
|
135
139
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTagEditInput, decorators: [{
|
|
136
140
|
type: Directive,
|
|
@@ -140,7 +144,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
140
144
|
exportAs: 'kbqTagEditInput',
|
|
141
145
|
host: {
|
|
142
146
|
class: 'kbq-tag-edit-input',
|
|
143
|
-
'(keydown)': 'handleKeydown($event)'
|
|
147
|
+
'(keydown)': 'handleKeydown($event)',
|
|
148
|
+
'(click)': 'handleClick($event)'
|
|
144
149
|
},
|
|
145
150
|
hostDirectives: [KbqFieldSizingContent]
|
|
146
151
|
}]
|
|
@@ -425,6 +430,7 @@ class KbqTag extends KbqColorDirective {
|
|
|
425
430
|
const input = this.editInputElementRef?.nativeElement;
|
|
426
431
|
if (!input)
|
|
427
432
|
throw getTagEditInputMissingError();
|
|
433
|
+
this.focusMonitor.focusVia(this.elementRef.nativeElement, 'keyboard');
|
|
428
434
|
input.select();
|
|
429
435
|
});
|
|
430
436
|
}
|
|
@@ -822,6 +828,7 @@ class KbqTagList {
|
|
|
822
828
|
this.parentForm = parentForm;
|
|
823
829
|
this.parentFormGroup = parentFormGroup;
|
|
824
830
|
this.ngControl = ngControl;
|
|
831
|
+
this.useLegacyValidation = inject(KBQ_VALIDATION, { optional: true })?.useValidation ?? false;
|
|
825
832
|
this.dropList = inject(CdkDropList, { host: true });
|
|
826
833
|
this.destroyRef = inject(DestroyRef);
|
|
827
834
|
this.focusMonitor = inject(FocusMonitor);
|
|
@@ -865,6 +872,11 @@ class KbqTagList {
|
|
|
865
872
|
this.selectable = true;
|
|
866
873
|
/** Whether the tags in the list are editable. */
|
|
867
874
|
this.editable = false;
|
|
875
|
+
/**
|
|
876
|
+
* Whether to emit change events when tags are added/removed.
|
|
877
|
+
* Set to `false` to prevent the form control from being marked as dirty during programmatic updates.
|
|
878
|
+
*/
|
|
879
|
+
this.emitOnTagChanges = true;
|
|
868
880
|
this._removable = true;
|
|
869
881
|
this._tabIndex = 0;
|
|
870
882
|
/**
|
|
@@ -958,7 +970,7 @@ class KbqTagList {
|
|
|
958
970
|
Promise.resolve().then(() => {
|
|
959
971
|
this.stateChanges.next();
|
|
960
972
|
// do not call on initial
|
|
961
|
-
if (currentTags) {
|
|
973
|
+
if (currentTags && this.emitOnTagChanges) {
|
|
962
974
|
this.propagateTagsChanges();
|
|
963
975
|
}
|
|
964
976
|
});
|
|
@@ -1277,7 +1289,7 @@ class KbqTagList {
|
|
|
1277
1289
|
}
|
|
1278
1290
|
/** Revalidate control. */
|
|
1279
1291
|
revalidate() {
|
|
1280
|
-
if (this.ngControl?.control) {
|
|
1292
|
+
if (this.useLegacyValidation && this.ngControl?.control) {
|
|
1281
1293
|
const control = this.ngControl.control;
|
|
1282
1294
|
control.updateValueAndValidity({ emitEvent: false });
|
|
1283
1295
|
control.statusChanges.emit(control.status);
|
|
@@ -1304,7 +1316,7 @@ class KbqTagList {
|
|
|
1304
1316
|
});
|
|
1305
1317
|
}
|
|
1306
1318
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTagList, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1.ErrorStateMatcher }, { token: i2$1.Directionality, optional: true }, { token: i3.NgForm, optional: true }, { token: i3.FormGroupDirective, optional: true }, { token: i3.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1307
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: KbqTagList, selector: "kbq-tag-list", inputs: { multiple: ["multiple", "multiple", booleanAttribute], compareWith: "compareWith", value: "value", required: "required", placeholder: "placeholder", disabled: ["disabled", "disabled", booleanAttribute], draggable: ["draggable", "draggable", booleanAttribute], selectable: ["selectable", "selectable", booleanAttribute], editable: ["editable", "editable", booleanAttribute], removable: ["removable", "removable", booleanAttribute], tabIndex: "tabIndex", errorStateMatcher: "errorStateMatcher", orientation: "orientation" }, outputs: { dropped: "dropped", valueChange: "valueChange", change: "change" }, host: { listeners: { "focus": "focus()", "blur": "blur()", "keydown": "keydown($event)" }, properties: { "class.kbq-disabled": "disabled", "class.kbq-invalid": "errorState", "class.kbq-tag-list_selectable": "selectable", "class.kbq-tag-list_editable": "editable", "class.kbq-tag-list_removable": "removable", "class.kbq-tag-list_draggable": "draggable", "attr.tabindex": "tabIndex", "id": "uid" }, classAttribute: "kbq-tag-list" }, providers: [{ provide: KbqFormFieldControl, useExisting: KbqTagList }], queries: [{ propertyName: "cleaner", first: true, predicate: ["kbqTagListCleaner"], descendants: true, static: true }, { propertyName: "tags", predicate: KbqTag, descendants: true }], exportAs: ["kbqTagList"], hostDirectives: [{ directive: i2.CdkDropList }], ngImport: i0, template: `
|
|
1319
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: KbqTagList, selector: "kbq-tag-list", inputs: { multiple: ["multiple", "multiple", booleanAttribute], compareWith: "compareWith", value: "value", required: "required", placeholder: "placeholder", disabled: ["disabled", "disabled", booleanAttribute], draggable: ["draggable", "draggable", booleanAttribute], selectable: ["selectable", "selectable", booleanAttribute], editable: ["editable", "editable", booleanAttribute], emitOnTagChanges: ["emitOnTagChanges", "emitOnTagChanges", booleanAttribute], removable: ["removable", "removable", booleanAttribute], tabIndex: "tabIndex", errorStateMatcher: "errorStateMatcher", orientation: "orientation" }, outputs: { dropped: "dropped", valueChange: "valueChange", change: "change" }, host: { listeners: { "focus": "focus()", "blur": "blur()", "keydown": "keydown($event)" }, properties: { "class.kbq-disabled": "disabled", "class.kbq-invalid": "errorState", "class.kbq-tag-list_selectable": "selectable", "class.kbq-tag-list_editable": "editable", "class.kbq-tag-list_removable": "removable", "class.kbq-tag-list_draggable": "draggable", "attr.tabindex": "tabIndex", "id": "uid" }, classAttribute: "kbq-tag-list" }, providers: [{ provide: KbqFormFieldControl, useExisting: KbqTagList }], queries: [{ propertyName: "cleaner", first: true, predicate: ["kbqTagListCleaner"], descendants: true, static: true }, { propertyName: "tags", predicate: KbqTag, descendants: true }], exportAs: ["kbqTagList"], hostDirectives: [{ directive: i2.CdkDropList }], ngImport: i0, template: `
|
|
1308
1320
|
<div class="kbq-tags-list__list-container">
|
|
1309
1321
|
<ng-content />
|
|
1310
1322
|
</div>
|
|
@@ -1377,6 +1389,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
1377
1389
|
}], editable: [{
|
|
1378
1390
|
type: Input,
|
|
1379
1391
|
args: [{ transform: booleanAttribute }]
|
|
1392
|
+
}], emitOnTagChanges: [{
|
|
1393
|
+
type: Input,
|
|
1394
|
+
args: [{ transform: booleanAttribute }]
|
|
1380
1395
|
}], removable: [{
|
|
1381
1396
|
type: Input,
|
|
1382
1397
|
args: [{ transform: booleanAttribute }]
|
|
@@ -1402,7 +1417,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
1402
1417
|
}]
|
|
1403
1418
|
}] } });
|
|
1404
1419
|
|
|
1405
|
-
const
|
|
1420
|
+
const KBQ_TAG_INPUT_DEFAULT_SEPARATORS = {
|
|
1406
1421
|
[ENTER$1]: { symbol: /\r?\n/, key: 'Enter' },
|
|
1407
1422
|
[TAB$1]: { symbol: /\t/, key: 'Tab' },
|
|
1408
1423
|
[SPACE$1]: { symbol: / /, key: ' ' },
|
|
@@ -1424,6 +1439,7 @@ class KbqTagInput {
|
|
|
1424
1439
|
set separatorKeyCodes(value) {
|
|
1425
1440
|
this._separatorKeyCodes = value || [];
|
|
1426
1441
|
}
|
|
1442
|
+
/** @docs-private */
|
|
1427
1443
|
get separators() {
|
|
1428
1444
|
return this._separatorKeyCodes.reduce((acc, key) => {
|
|
1429
1445
|
const separator = this.getSeparatorByKeyCode(key);
|
|
@@ -1446,15 +1462,6 @@ class KbqTagInput {
|
|
|
1446
1462
|
set addOnBlur(value) {
|
|
1447
1463
|
this._addOnBlur = coerceBooleanProperty(value);
|
|
1448
1464
|
}
|
|
1449
|
-
/**
|
|
1450
|
-
* Whether the tagEnd event will be emitted when the text pasted.
|
|
1451
|
-
*/
|
|
1452
|
-
get addOnPaste() {
|
|
1453
|
-
return this._addOnPaste;
|
|
1454
|
-
}
|
|
1455
|
-
set addOnPaste(value) {
|
|
1456
|
-
this._addOnPaste = coerceBooleanProperty(value);
|
|
1457
|
-
}
|
|
1458
1465
|
/** Whether the input is disabled. */
|
|
1459
1466
|
get disabled() {
|
|
1460
1467
|
return this._disabled || (this._tagList && this._tagList.disabled);
|
|
@@ -1475,6 +1482,7 @@ class KbqTagInput {
|
|
|
1475
1482
|
/** Whether the control is focused. */
|
|
1476
1483
|
this.focused = false;
|
|
1477
1484
|
this._separatorKeyCodes = this.defaultOptions.separatorKeyCodes;
|
|
1485
|
+
this._separators = this.defaultOptions.separators || KBQ_TAG_INPUT_DEFAULT_SEPARATORS;
|
|
1478
1486
|
/** Emitted when a tag is to be added. */
|
|
1479
1487
|
this.tagEnd = new EventEmitter();
|
|
1480
1488
|
/** A value indicating whether allow/prevent tags duplication */
|
|
@@ -1484,6 +1492,11 @@ class KbqTagInput {
|
|
|
1484
1492
|
/** Unique id for the input. */
|
|
1485
1493
|
this.id = `kbq-tag-list-input-${nextUniqueId++}`;
|
|
1486
1494
|
this._addOnBlur = true;
|
|
1495
|
+
/**
|
|
1496
|
+
* Whether the tagEnd event will be emitted when the text pasted.
|
|
1497
|
+
* @default true
|
|
1498
|
+
*/
|
|
1499
|
+
this.addOnPaste = this.defaultOptions.addOnPaste ?? true;
|
|
1487
1500
|
this._disabled = false;
|
|
1488
1501
|
/**
|
|
1489
1502
|
* @docs-private
|
|
@@ -1492,8 +1505,6 @@ class KbqTagInput {
|
|
|
1492
1505
|
*/
|
|
1493
1506
|
this.countOfSymbolsForUpdateWidth = 3;
|
|
1494
1507
|
this.inputElement = this.elementRef.nativeElement;
|
|
1495
|
-
this._separators = this.defaultOptions.separators || KbqTagInputDefaultSeparators;
|
|
1496
|
-
this._addOnPaste = isBoolean(this.defaultOptions.addOnPaste) ? this.defaultOptions.addOnPaste : true;
|
|
1497
1508
|
}
|
|
1498
1509
|
ngOnChanges() {
|
|
1499
1510
|
this._tagList.stateChanges.next();
|
|
@@ -1559,14 +1570,15 @@ class KbqTagInput {
|
|
|
1559
1570
|
const dividedString = separatorsInString.length > 0 ?
|
|
1560
1571
|
[...data.split(new RegExp(`${separatorsInString.join('|')}`))] :
|
|
1561
1572
|
[data];
|
|
1562
|
-
|
|
1573
|
+
let items = dividedString.map((item) => this.trimValue(item));
|
|
1563
1574
|
if (items.length === 0) {
|
|
1564
1575
|
items.push(data);
|
|
1565
1576
|
}
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
.filter((item) => !tagValues.includes(item))
|
|
1569
|
-
|
|
1577
|
+
if (this.distinct) {
|
|
1578
|
+
const tagValues = this._tagList.tags.map(({ value }) => value);
|
|
1579
|
+
items = items.filter((item) => !tagValues.includes(item));
|
|
1580
|
+
}
|
|
1581
|
+
items.forEach((item) => this.tagEnd.emit({ input: this.inputElement, value: item }));
|
|
1570
1582
|
$event.preventDefault();
|
|
1571
1583
|
$event.stopPropagation();
|
|
1572
1584
|
}
|
|
@@ -1588,8 +1600,8 @@ class KbqTagInput {
|
|
|
1588
1600
|
}
|
|
1589
1601
|
getSeparatorsForString(value) {
|
|
1590
1602
|
return this.separators
|
|
1591
|
-
.filter((separator) => value.search(separator.
|
|
1592
|
-
.map((separator) => separator.
|
|
1603
|
+
.filter((separator) => value.search(separator.symbol) > -1)
|
|
1604
|
+
.map((separator) => separator.symbol.source);
|
|
1593
1605
|
}
|
|
1594
1606
|
trimValue(value) {
|
|
1595
1607
|
return this.trimDirective ? this.trimDirective.trim(value) : value;
|
|
@@ -1609,7 +1621,7 @@ class KbqTagInput {
|
|
|
1609
1621
|
return this.separators.some((separator) => separator.key === event.key && !event.shiftKey);
|
|
1610
1622
|
}
|
|
1611
1623
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTagInput, deps: [{ token: i0.ElementRef }, { token: KBQ_TAGS_DEFAULT_OPTIONS }, { token: i1$1.KbqTrim, optional: true, self: true }, { token: i3.NgControl, optional: true, self: true }, { token: i3$1.KbqAutocompleteTrigger, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1612
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
1624
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.2.14", type: KbqTagInput, selector: "input[kbqTagInputFor]", inputs: { separatorKeyCodes: ["kbqTagInputSeparatorKeyCodes", "separatorKeyCodes"], distinct: "distinct", placeholder: "placeholder", id: "id", tagList: ["kbqTagInputFor", "tagList"], addOnBlur: ["kbqTagInputAddOnBlur", "addOnBlur"], addOnPaste: ["kbqTagInputAddOnPaste", "addOnPaste", booleanAttribute], disabled: "disabled" }, outputs: { tagEnd: "kbqTagInputTokenEnd" }, host: { listeners: { "keydown": "onKeydown($event)", "blur": "blur($event)", "focus": "onFocus()", "input": "onInput()", "paste": "onPaste($event)" }, properties: { "id": "id", "attr.disabled": "disabled || null", "attr.placeholder": "placeholder || null" }, classAttribute: "kbq-tag-input" }, exportAs: ["kbqTagInput", "kbqTagInputFor"], usesOnChanges: true, hostDirectives: [{ directive: i1.KbqFieldSizingContent }], ngImport: i0 }); }
|
|
1613
1625
|
}
|
|
1614
1626
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTagInput, decorators: [{
|
|
1615
1627
|
type: Directive,
|
|
@@ -1664,7 +1676,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
1664
1676
|
args: ['kbqTagInputAddOnBlur']
|
|
1665
1677
|
}], addOnPaste: [{
|
|
1666
1678
|
type: Input,
|
|
1667
|
-
args: ['kbqTagInputAddOnPaste']
|
|
1679
|
+
args: [{ alias: 'kbqTagInputAddOnPaste', transform: booleanAttribute }]
|
|
1668
1680
|
}], disabled: [{
|
|
1669
1681
|
type: Input
|
|
1670
1682
|
}] } });
|