@koobiq/components 19.6.0 → 19.8.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/accordion/accordion-content.directive.d.ts +1 -0
- package/autocomplete/autocomplete-trigger.directive.d.ts +2 -1
- package/autocomplete/autocomplete.component.d.ts +7 -1
- package/breadcrumbs/breadcrumbs.scss +0 -4
- package/code-block/_code-block-theme.scss +1 -10
- package/code-block/code-block-highlight.d.ts +62 -7
- package/code-block/code-block-tokens.scss +5 -10
- package/code-block/code-block.d.ts +10 -1
- package/code-block/code-block.scss +8 -7
- package/core/forms/forms-tokens.scss +1 -1
- package/core/option/option.d.ts +10 -1
- package/core/styles/common/_groups-mixins.scss +2 -2
- package/core/styles/common/_groups.scss +6 -6
- package/core/validation/validation.d.ts +1 -1
- package/dropdown/dropdown-item.scss +9 -6
- package/dropdown/dropdown-tokens.scss +1 -1
- package/dropdown/dropdown-trigger.directive.d.ts +8 -1
- package/dropdown/dropdown.component.d.ts +6 -6
- package/dropdown/dropdown.scss +1 -1
- package/dropdown/dropdown.types.d.ts +19 -7
- package/fesm2022/koobiq-components-accordion.mjs +32 -29
- package/fesm2022/koobiq-components-accordion.mjs.map +1 -1
- package/fesm2022/koobiq-components-actions-panel.mjs +10 -10
- package/fesm2022/koobiq-components-alert.mjs +16 -16
- package/fesm2022/koobiq-components-app-switcher.mjs +25 -25
- package/fesm2022/koobiq-components-app-switcher.mjs.map +1 -1
- package/fesm2022/koobiq-components-autocomplete.mjs +35 -23
- package/fesm2022/koobiq-components-autocomplete.mjs.map +1 -1
- package/fesm2022/koobiq-components-badge.mjs +13 -13
- package/fesm2022/koobiq-components-breadcrumbs.mjs +26 -26
- package/fesm2022/koobiq-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/koobiq-components-button-toggle.mjs +10 -10
- package/fesm2022/koobiq-components-button.mjs +19 -19
- package/fesm2022/koobiq-components-button.mjs.map +1 -1
- package/fesm2022/koobiq-components-checkbox.mjs +10 -10
- package/fesm2022/koobiq-components-clamped-text.mjs +13 -13
- package/fesm2022/koobiq-components-clamped-text.mjs.map +1 -1
- package/fesm2022/koobiq-components-code-block.mjs +126 -51
- package/fesm2022/koobiq-components-code-block.mjs.map +1 -1
- package/fesm2022/koobiq-components-content-panel.mjs +28 -28
- package/fesm2022/koobiq-components-core.mjs +249 -232
- package/fesm2022/koobiq-components-core.mjs.map +1 -1
- package/fesm2022/koobiq-components-datepicker.mjs +37 -42
- package/fesm2022/koobiq-components-datepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-divider.mjs +7 -7
- package/fesm2022/koobiq-components-dl.mjs +13 -13
- package/fesm2022/koobiq-components-dropdown.mjs +69 -38
- package/fesm2022/koobiq-components-dropdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-dynamic-translation.mjs +13 -13
- package/fesm2022/koobiq-components-ellipsis-center.mjs +7 -7
- package/fesm2022/koobiq-components-empty-state.mjs +19 -19
- package/fesm2022/koobiq-components-file-upload.mjs +39 -39
- package/fesm2022/koobiq-components-file-upload.mjs.map +1 -1
- package/fesm2022/koobiq-components-filter-bar.mjs +85 -85
- package/fesm2022/koobiq-components-filter-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-form-field.mjs +83 -81
- package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
- package/fesm2022/koobiq-components-icon.mjs +343 -21
- package/fesm2022/koobiq-components-icon.mjs.map +1 -1
- package/fesm2022/koobiq-components-inline-edit.mjs +19 -17
- package/fesm2022/koobiq-components-inline-edit.mjs.map +1 -1
- package/fesm2022/koobiq-components-input.mjs +22 -22
- package/fesm2022/koobiq-components-link.mjs +7 -7
- package/fesm2022/koobiq-components-list.mjs +19 -19
- package/fesm2022/koobiq-components-loader-overlay.mjs +16 -16
- package/fesm2022/koobiq-components-markdown.mjs +10 -10
- package/fesm2022/koobiq-components-modal.mjs +34 -32
- package/fesm2022/koobiq-components-modal.mjs.map +1 -1
- package/fesm2022/koobiq-components-navbar-ic.mjs +40 -40
- package/fesm2022/koobiq-components-navbar-ic.mjs.map +1 -1
- package/fesm2022/koobiq-components-navbar.mjs +82 -56
- package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
- package/fesm2022/koobiq-components-notification-center.mjs +16 -16
- package/fesm2022/koobiq-components-notification-center.mjs.map +1 -1
- package/fesm2022/koobiq-components-overflow-items.mjs +16 -16
- package/fesm2022/koobiq-components-popover.mjs +18 -18
- package/fesm2022/koobiq-components-popover.mjs.map +1 -1
- package/fesm2022/koobiq-components-progress-bar.mjs +13 -13
- package/fesm2022/koobiq-components-progress-spinner.mjs +13 -13
- package/fesm2022/koobiq-components-radio.mjs +10 -10
- package/fesm2022/koobiq-components-resizer.mjs +10 -10
- package/fesm2022/koobiq-components-risk-level.mjs +7 -7
- package/fesm2022/koobiq-components-scrollbar.mjs +12 -12
- package/fesm2022/koobiq-components-scrollbar.mjs.map +1 -1
- package/fesm2022/koobiq-components-search-expandable.mjs +7 -7
- package/fesm2022/koobiq-components-select.mjs +155 -68
- package/fesm2022/koobiq-components-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-sidebar.mjs +13 -13
- package/fesm2022/koobiq-components-sidepanel.mjs +28 -28
- package/fesm2022/koobiq-components-sidepanel.mjs.map +1 -1
- package/fesm2022/koobiq-components-skeleton.mjs +10 -10
- package/fesm2022/koobiq-components-split-button.mjs +7 -7
- package/fesm2022/koobiq-components-splitter.mjs +16 -16
- package/fesm2022/koobiq-components-table.mjs +10 -10
- package/fesm2022/koobiq-components-tabs.mjs +52 -52
- package/fesm2022/koobiq-components-tags.mjs +87 -65
- package/fesm2022/koobiq-components-tags.mjs.map +1 -1
- package/fesm2022/koobiq-components-textarea.mjs +7 -7
- package/fesm2022/koobiq-components-time-range.mjs +22 -22
- package/fesm2022/koobiq-components-timepicker.mjs +11 -26
- package/fesm2022/koobiq-components-timepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-timezone.mjs +62 -41
- package/fesm2022/koobiq-components-timezone.mjs.map +1 -1
- package/fesm2022/koobiq-components-title.mjs +7 -7
- package/fesm2022/koobiq-components-toast.mjs +58 -39
- package/fesm2022/koobiq-components-toast.mjs.map +1 -1
- package/fesm2022/koobiq-components-toggle.mjs +7 -7
- package/fesm2022/koobiq-components-tooltip.mjs +17 -17
- package/fesm2022/koobiq-components-tooltip.mjs.map +1 -1
- package/fesm2022/koobiq-components-top-bar.mjs +17 -25
- package/fesm2022/koobiq-components-top-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree-select.mjs +16 -10
- package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree.mjs +75 -40
- package/fesm2022/koobiq-components-tree.mjs.map +1 -1
- package/fesm2022/koobiq-components-username.mjs +28 -28
- package/fesm2022/koobiq-components-username.mjs.map +1 -1
- package/file-upload/multiple-file-upload.component.scss +6 -0
- package/file-upload/single-file-upload.component.scss +6 -0
- package/form-field/_form-field-theme.scss +19 -6
- package/form-field/fieldset-tokens.scss +1 -0
- package/form-field/fieldset.scss +1 -0
- package/form-field/form-field-tokens.scss +2 -0
- package/form-field/form-field.scss +19 -0
- package/form-field/password-toggle.scss +1 -1
- package/icon/icon-button.scss +5 -0
- package/icon/icon-item.scss +5 -0
- package/icon/icon-registry-providers.d.ts +34 -0
- package/icon/icon-registry.d.ts +50 -0
- package/icon/icon.component.d.ts +16 -3
- package/icon/icon.scss +7 -0
- package/icon/public-api.d.ts +2 -0
- package/inline-edit/inline-edit.d.ts +3 -1
- package/inline-edit/inline-edit.scss +1 -11
- package/link/_link-theme.scss +9 -2
- package/navbar/_navbar-theme.scss +0 -4
- package/navbar/navbar-brand.component.d.ts +3 -1
- package/navbar/navbar-item.component.d.ts +1 -0
- package/navbar/navbar.component.d.ts +1 -0
- package/package.json +4 -4
- package/popover/popover.scss +3 -3
- package/prebuilt-themes/dark-theme.css +1 -1
- package/prebuilt-themes/light-theme.css +1 -1
- package/prebuilt-themes/theme.css +1 -1
- package/schematics/ng-add/index.js +4 -4
- package/scrollbar/scrollbar-tokens.scss +1 -1
- package/select/select-option.directive.d.ts +9 -10
- package/select/select-tokens.scss +2 -2
- package/select/select.component.d.ts +51 -3
- package/tags/tag-list.component.d.ts +15 -11
- package/tags/tag.component.d.ts +5 -2
- package/timepicker/timepicker.directive.d.ts +1 -0
- package/timezone/timezone-option-tokens.scss +0 -10
- package/timezone/timezone-option.directive.d.ts +12 -9
- package/toast/toast.service.d.ts +5 -3
- package/tooltip/_tooltip-theme.scss +5 -1
- package/top-bar/top-bar.d.ts +0 -7
- package/top-bar/top-bar.scss +3 -9
- package/tree/tree-selection.component.d.ts +7 -0
|
@@ -16,7 +16,7 @@ import { DELETE, SPACE, BACKSPACE, ENTER, ESCAPE, F2, LEFT_ARROW, TAB, HOME, END
|
|
|
16
16
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
17
17
|
import { FocusKeyManager } from '@koobiq/cdk/a11y';
|
|
18
18
|
import { Subject, merge } from 'rxjs';
|
|
19
|
-
import { startWith, filter } from 'rxjs/operators';
|
|
19
|
+
import { startWith, takeUntil, filter } from 'rxjs/operators';
|
|
20
20
|
import { KbqIcon } from '@koobiq/components/icon';
|
|
21
21
|
import { PlatformModule } from '@angular/cdk/platform';
|
|
22
22
|
|
|
@@ -50,10 +50,10 @@ const getTagEditInputMissingError = () => {
|
|
|
50
50
|
* @docs-private
|
|
51
51
|
*/
|
|
52
52
|
class KbqTagAvatar {
|
|
53
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
54
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
53
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqTagAvatar, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
54
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.21", type: KbqTagAvatar, isStandalone: true, selector: "kbq-tag-avatar, [kbqTagAvatar]", host: { classAttribute: "kbq-tag-avatar" }, ngImport: i0 }); }
|
|
55
55
|
}
|
|
56
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
56
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqTagAvatar, decorators: [{
|
|
57
57
|
type: Directive,
|
|
58
58
|
args: [{
|
|
59
59
|
selector: 'kbq-tag-avatar, [kbqTagAvatar]',
|
|
@@ -65,10 +65,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
65
65
|
* @docs-private
|
|
66
66
|
*/
|
|
67
67
|
class KbqTagTrailingIcon {
|
|
68
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
69
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
68
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqTagTrailingIcon, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
69
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.21", type: KbqTagTrailingIcon, isStandalone: true, selector: "kbq-tag-trailing-icon, [kbqTagTrailingIcon]", host: { classAttribute: "kbq-tag-trailing-icon" }, ngImport: i0 }); }
|
|
70
70
|
}
|
|
71
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqTagTrailingIcon, decorators: [{
|
|
72
72
|
type: Directive,
|
|
73
73
|
args: [{
|
|
74
74
|
selector: 'kbq-tag-trailing-icon, [kbqTagTrailingIcon]',
|
|
@@ -83,10 +83,10 @@ class KbqTagEditSubmit {
|
|
|
83
83
|
/** @docs-private */
|
|
84
84
|
this.tag = inject(KbqTag);
|
|
85
85
|
}
|
|
86
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
87
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
86
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqTagEditSubmit, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
87
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.21", type: KbqTagEditSubmit, isStandalone: true, selector: "[kbqTagEditSubmit]", host: { listeners: { "click": "tag.submitEditing(\"click\")" }, properties: { "attr.tabindex": "-1" }, classAttribute: "kbq-tag-edit-submit" }, exportAs: ["kbqTagEditSubmit"], ngImport: i0 }); }
|
|
88
88
|
}
|
|
89
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
89
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqTagEditSubmit, decorators: [{
|
|
90
90
|
type: Directive,
|
|
91
91
|
args: [{
|
|
92
92
|
selector: '[kbqTagEditSubmit]',
|
|
@@ -132,10 +132,10 @@ class KbqTagEditInput {
|
|
|
132
132
|
default:
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
136
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
135
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqTagEditInput, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
136
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.21", 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 }); }
|
|
137
137
|
}
|
|
138
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
138
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqTagEditInput, decorators: [{
|
|
139
139
|
type: Directive,
|
|
140
140
|
args: [{
|
|
141
141
|
selector: '[kbqTagEditInput]',
|
|
@@ -189,7 +189,11 @@ class KbqTag extends KbqColorDirective {
|
|
|
189
189
|
this._removable = value;
|
|
190
190
|
}
|
|
191
191
|
get tabindex() {
|
|
192
|
-
|
|
192
|
+
if (this.disabled)
|
|
193
|
+
return null;
|
|
194
|
+
if (this._tabindex === -1 && this.selectable && !this.tagList)
|
|
195
|
+
return 0;
|
|
196
|
+
return this._tabindex;
|
|
193
197
|
}
|
|
194
198
|
set tabindex(value) {
|
|
195
199
|
this._tabindex = value;
|
|
@@ -253,9 +257,12 @@ class KbqTag extends KbqColorDirective {
|
|
|
253
257
|
this.editing = signal(false);
|
|
254
258
|
/** Emitted when the tag is selected or deselected. */
|
|
255
259
|
this.selectionChange = new EventEmitter();
|
|
256
|
-
/** Emitted when the tag is destroyed. */
|
|
260
|
+
/** Emitted when the tag is destroyed and leaving the DOM. */
|
|
257
261
|
this.destroyed = new EventEmitter();
|
|
258
|
-
/**
|
|
262
|
+
/**
|
|
263
|
+
* Emitted when a tag is to be removed.
|
|
264
|
+
* Fires on programmatic and UI removal (click or keyboard).
|
|
265
|
+
*/
|
|
259
266
|
this.removed = new EventEmitter();
|
|
260
267
|
this._selected = false;
|
|
261
268
|
this._selectable = false;
|
|
@@ -380,6 +387,9 @@ class KbqTag extends KbqColorDirective {
|
|
|
380
387
|
event.stopPropagation();
|
|
381
388
|
return;
|
|
382
389
|
}
|
|
390
|
+
if (!this.tagList && this.selectable) {
|
|
391
|
+
this.toggleSelected(true);
|
|
392
|
+
}
|
|
383
393
|
}
|
|
384
394
|
/** @docs-private */
|
|
385
395
|
handleKeydown(event) {
|
|
@@ -485,7 +495,7 @@ class KbqTag extends KbqColorDirective {
|
|
|
485
495
|
this.hasFocus = hasFocus;
|
|
486
496
|
if (this.hasFocus) {
|
|
487
497
|
this.onFocus.next({ tag: this, origin });
|
|
488
|
-
if (!this.tagList)
|
|
498
|
+
if (!this.tagList && origin !== 'mouse')
|
|
489
499
|
this.select();
|
|
490
500
|
}
|
|
491
501
|
else {
|
|
@@ -498,8 +508,8 @@ class KbqTag extends KbqColorDirective {
|
|
|
498
508
|
}
|
|
499
509
|
});
|
|
500
510
|
}
|
|
501
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
502
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
511
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqTag, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
512
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: KbqTag, isStandalone: true, selector: "kbq-tag, [kbq-tag], kbq-basic-tag, [kbq-basic-tag]", inputs: { editable: ["editable", "editable", booleanAttribute], preventEditSubmit: ["preventEditSubmit", "preventEditSubmit", booleanAttribute], selected: ["selected", "selected", booleanAttribute], value: "value", selectable: ["selectable", "selectable", booleanAttribute], removable: ["removable", "removable", booleanAttribute], tabindex: "tabindex", disabled: ["disabled", "disabled", booleanAttribute] }, outputs: { editChange: "editChange", selectionChange: "selectionChange", destroyed: "destroyed", removed: "removed" }, host: { listeners: { "dblclick": "handleDblClick($event)", "click": "handleClick($event)", "keydown": "handleKeydown($event)" }, properties: { "attr.tabindex": "tabindex", "attr.disabled": "disabled || null", "class.kbq-selected": "selected", "class.kbq-tag-with-avatar": "avatar", "class.kbq-tag-with-icon": "contentChildren", "class.kbq-tag-with-trailing-icon": "trailingIcon || removeIcon", "class.kbq-disabled": "disabled", "class.kbq-tag_editable": "editable", "class.kbq-tag_editing": "editing()", "class.kbq-tag_removable": "removable", "class.kbq-tag_selectable": "selectable", "class.kbq-tag_draggable": "draggable" }, classAttribute: "kbq-tag" }, providers: [{ provide: KBQ_TITLE_TEXT_REF, useExisting: KbqTag }], queries: [{ propertyName: "editInputElementRef", first: true, predicate: KbqTagEditInput, descendants: true, read: ElementRef }, { propertyName: "avatar", first: true, predicate: KbqTagAvatar, descendants: true }, { propertyName: "trailingIcon", first: true, predicate: KbqTagTrailingIcon, descendants: true }, { propertyName: "removeIcon", first: true, predicate: i0.forwardRef(() => KbqTagRemove), descendants: true }, { propertyName: "contentChildren", predicate: KbqIcon }], viewQueries: [{ propertyName: "textElement", first: true, predicate: ["kbqTitleText"], descendants: true }], exportAs: ["kbqTag"], usesInheritance: true, hostDirectives: [{ directive: i2.CdkDrag }], ngImport: i0, template: `
|
|
503
513
|
<div class="kbq-tag__wrapper">
|
|
504
514
|
<ng-content select="[kbq-icon]:not([kbqTagRemove]):not([kbqTagEditSubmit])" />
|
|
505
515
|
<span #kbqTitleText class="kbq-tag__text">
|
|
@@ -519,7 +529,7 @@ class KbqTag extends KbqColorDirective {
|
|
|
519
529
|
</div>
|
|
520
530
|
`, isInline: true, styles: [".kbq-tag{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;display:inline-block;max-width:100%;height:var(--kbq-size-xxl);padding:var(--kbq-tag-size-padding-vertical) var(--kbq-tag-size-padding-horizontal);border-radius:4px;cursor:default;outline:none;box-sizing:border-box}.kbq-tag .kbq-icon.kbq-tag-remove{display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-right:var(--kbq-tag-size-close-button-margin-right)}.kbq-tag .kbq-icon.kbq-tag-remove:hover{cursor:pointer}.kbq-tag.kbq-disabled .kbq-icon.kbq-tag-remove:hover{cursor:default}.kbq-tag .kbq-tag__text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;margin:0 var(--kbq-tag-size-content-gap-horizontal)}.kbq-tag .kbq-icon_left{margin-left:var(--kbq-tag-size-icon-margin-left)}.kbq-tag .kbq-tag-edit-input{background:transparent;padding:0;margin:0;border:none;outline:none}.kbq-tag .kbq-tag-edit-input::-ms-clear{display:none;width:0;height:0}.kbq-tag .kbq-tag-edit-input::-ms-reveal{display:none;width:0;height:0}.kbq-tag .kbq-tag-edit-input::-webkit-search-decoration,.kbq-tag .kbq-tag-edit-input::-webkit-search-cancel-button,.kbq-tag .kbq-tag-edit-input::-webkit-search-results-button,.kbq-tag .kbq-tag-edit-input::-webkit-search-results-decoration{display:none}.kbq-tag .kbq-tag-edit-input{min-width:var(--kbq-size-xs);max-width:100%}.kbq-tag .kbq-tag-edit-input.kbq-input{min-height:unset!important;border-radius:unset!important;padding:unset!important}.kbq-tag .kbq-tag-edit-submit{margin-right:var(--kbq-size-3xs)}.kbq-tag.cdk-drag-placeholder{opacity:var(--kbq-opacity-disabled)}.kbq-tag.cdk-drag-animating{transition:transform .3s cubic-bezier(0,0,.2,1)}.kbq-tag__wrapper{display:flex;align-items:center;height:100%;flex:1 1 100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
521
531
|
}
|
|
522
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
532
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqTag, decorators: [{
|
|
523
533
|
type: Component,
|
|
524
534
|
args: [{ selector: 'kbq-tag, [kbq-tag], kbq-basic-tag, [kbq-basic-tag]', template: `
|
|
525
535
|
<div class="kbq-tag__wrapper">
|
|
@@ -642,10 +652,10 @@ class KbqTagRemove {
|
|
|
642
652
|
// that the tag is being removed before the event bubbles up.
|
|
643
653
|
event.stopPropagation();
|
|
644
654
|
}
|
|
645
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
646
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
655
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqTagRemove, deps: [{ token: forwardRef(() => KbqTag) }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
656
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.21", type: KbqTagRemove, isStandalone: true, selector: "[kbqTagRemove]", host: { listeners: { "click": "handleClick($event)", "focus": "focus($event)" }, properties: { "attr.tabindex": "-1" }, classAttribute: "kbq-tag-remove kbq-tag-trailing-icon" }, ngImport: i0 }); }
|
|
647
657
|
}
|
|
648
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
658
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqTagRemove, decorators: [{
|
|
649
659
|
type: Directive,
|
|
650
660
|
args: [{
|
|
651
661
|
selector: '[kbqTagRemove]',
|
|
@@ -696,13 +706,21 @@ class KbqTagList {
|
|
|
696
706
|
return merge(...this.tags.map((tag) => tag.onBlur));
|
|
697
707
|
}
|
|
698
708
|
/**
|
|
699
|
-
* Combined stream of all of the child tags'
|
|
709
|
+
* Combined stream of all of the child tags' destroyed events.
|
|
700
710
|
*
|
|
701
711
|
* @docs-private
|
|
702
712
|
*/
|
|
703
713
|
get tagRemoveChanges() {
|
|
704
714
|
return merge(...this.tags.map((tag) => tag.destroyed));
|
|
705
715
|
}
|
|
716
|
+
/**
|
|
717
|
+
* Combined stream of all of the child tags' removal request events.
|
|
718
|
+
*
|
|
719
|
+
* @docs-private
|
|
720
|
+
*/
|
|
721
|
+
get tagBeforeRemoveChanges() {
|
|
722
|
+
return merge(...this.tags.map((tag) => tag.removed));
|
|
723
|
+
}
|
|
706
724
|
/**
|
|
707
725
|
* Combined stream of all of the child tags' edit change events.
|
|
708
726
|
*
|
|
@@ -872,7 +890,8 @@ class KbqTagList {
|
|
|
872
890
|
this.editable = false;
|
|
873
891
|
/**
|
|
874
892
|
* Whether to emit change events when tags are added/removed.
|
|
875
|
-
*
|
|
893
|
+
*
|
|
894
|
+
* @deprecated No longer needed. Will be removed in the next major release.
|
|
876
895
|
*/
|
|
877
896
|
this.emitOnTagChanges = true;
|
|
878
897
|
this._removable = true;
|
|
@@ -912,12 +931,16 @@ class KbqTagList {
|
|
|
912
931
|
* @docs-private
|
|
913
932
|
*/
|
|
914
933
|
this.errorState = false;
|
|
934
|
+
/** True when the next `tags.changes` emission is triggered by a UI action, not programmatic update. */
|
|
935
|
+
this.pendingUIChange = false;
|
|
915
936
|
/**
|
|
916
937
|
* When a tag is destroyed, we store the index of the destroyed tag until the tags
|
|
917
938
|
* query list notifies about the update. This is necessary because we cannot determine an
|
|
918
939
|
* appropriate tag that should receive focus until the array of tags updated completely.
|
|
919
940
|
*/
|
|
920
941
|
this.lastDestroyedTagIndex = null;
|
|
942
|
+
/** Triggers unsubscription from all per-tags streams when tags are reset. */
|
|
943
|
+
this.tagsSubscriptions$ = new Subject();
|
|
921
944
|
/** @docs-private */
|
|
922
945
|
this.onTouched = () => { };
|
|
923
946
|
/** @docs-private */
|
|
@@ -967,8 +990,8 @@ class KbqTagList {
|
|
|
967
990
|
// has changed after it was checked" errors from Angular.
|
|
968
991
|
Promise.resolve().then(() => {
|
|
969
992
|
this.stateChanges.next();
|
|
970
|
-
|
|
971
|
-
|
|
993
|
+
if (currentTags && this.pendingUIChange) {
|
|
994
|
+
this.pendingUIChange = false;
|
|
972
995
|
this.propagateTagsChanges();
|
|
973
996
|
}
|
|
974
997
|
});
|
|
@@ -980,7 +1003,7 @@ class KbqTagList {
|
|
|
980
1003
|
ngOnDestroy() {
|
|
981
1004
|
this.stateChanges.complete();
|
|
982
1005
|
this.focusMonitor.stopMonitoring(this.elementRef);
|
|
983
|
-
this.
|
|
1006
|
+
this.tagsSubscriptions$.next();
|
|
984
1007
|
}
|
|
985
1008
|
/** @docs-private */
|
|
986
1009
|
updateErrorState() {
|
|
@@ -994,6 +1017,10 @@ class KbqTagList {
|
|
|
994
1017
|
this.stateChanges.next();
|
|
995
1018
|
}
|
|
996
1019
|
}
|
|
1020
|
+
/** Notifies that the next `tags.changes` emission is UI-initiated. */
|
|
1021
|
+
notifyPendingTagChange() {
|
|
1022
|
+
this.pendingUIChange = true;
|
|
1023
|
+
}
|
|
997
1024
|
/**
|
|
998
1025
|
* Associates an HTML input element with this tag list.
|
|
999
1026
|
*
|
|
@@ -1223,32 +1250,14 @@ class KbqTagList {
|
|
|
1223
1250
|
this.changeDetectorRef.markForCheck();
|
|
1224
1251
|
}
|
|
1225
1252
|
resetTags() {
|
|
1226
|
-
this.
|
|
1253
|
+
this.tagsSubscriptions$.next();
|
|
1227
1254
|
this.listenToTagsFocus();
|
|
1228
1255
|
this.listenToTagsRemoved();
|
|
1229
1256
|
this.listenToTagsEdit();
|
|
1230
1257
|
}
|
|
1231
|
-
dropSubscriptions() {
|
|
1232
|
-
if (this.tagFocusSubscription) {
|
|
1233
|
-
this.tagFocusSubscription.unsubscribe();
|
|
1234
|
-
this.tagFocusSubscription = null;
|
|
1235
|
-
}
|
|
1236
|
-
if (this.tagBlurSubscription) {
|
|
1237
|
-
this.tagBlurSubscription.unsubscribe();
|
|
1238
|
-
this.tagBlurSubscription = null;
|
|
1239
|
-
}
|
|
1240
|
-
if (this.tagRemoveSubscription) {
|
|
1241
|
-
this.tagRemoveSubscription.unsubscribe();
|
|
1242
|
-
this.tagRemoveSubscription = null;
|
|
1243
|
-
}
|
|
1244
|
-
if (this.tagEditSubscription) {
|
|
1245
|
-
this.tagEditSubscription.unsubscribe();
|
|
1246
|
-
this.tagEditSubscription = null;
|
|
1247
|
-
}
|
|
1248
|
-
}
|
|
1249
1258
|
/** Listens to user-generated selection events on each tag. */
|
|
1250
1259
|
listenToTagsFocus() {
|
|
1251
|
-
this.
|
|
1260
|
+
this.tagFocusChanges.pipe(takeUntil(this.tagsSubscriptions$)).subscribe(({ tag, origin }) => {
|
|
1252
1261
|
const tagIndex = this.tags.toArray().indexOf(tag);
|
|
1253
1262
|
if (this.isValidIndex(tagIndex)) {
|
|
1254
1263
|
this.keyManager.setFocusOrigin(origin);
|
|
@@ -1256,13 +1265,13 @@ class KbqTagList {
|
|
|
1256
1265
|
}
|
|
1257
1266
|
this.stateChanges.next();
|
|
1258
1267
|
});
|
|
1259
|
-
this.
|
|
1268
|
+
this.tagBlurChanges.pipe(takeUntil(this.tagsSubscriptions$)).subscribe(() => {
|
|
1260
1269
|
this.blur();
|
|
1261
1270
|
this.stateChanges.next();
|
|
1262
1271
|
});
|
|
1263
1272
|
}
|
|
1264
1273
|
listenToTagsRemoved() {
|
|
1265
|
-
this.
|
|
1274
|
+
this.tagRemoveChanges.pipe(takeUntil(this.tagsSubscriptions$)).subscribe((event) => {
|
|
1266
1275
|
const tag = event.tag;
|
|
1267
1276
|
const tagIndex = this.tags.toArray().indexOf(event.tag);
|
|
1268
1277
|
// In case the tag that will be removed is currently focused, we temporarily store
|
|
@@ -1272,10 +1281,14 @@ class KbqTagList {
|
|
|
1272
1281
|
this.lastDestroyedTagIndex = tagIndex;
|
|
1273
1282
|
}
|
|
1274
1283
|
});
|
|
1284
|
+
// Set the pending flag so the subsequent `tags.changes` is treated as UI action.
|
|
1285
|
+
this.tagBeforeRemoveChanges
|
|
1286
|
+
.pipe(takeUntil(this.tagsSubscriptions$))
|
|
1287
|
+
.subscribe(() => (this.pendingUIChange = true));
|
|
1275
1288
|
}
|
|
1276
1289
|
listenToTagsEdit() {
|
|
1277
|
-
this.
|
|
1278
|
-
.pipe(filter(({ type }) => type === 'submit'))
|
|
1290
|
+
this.tagEditChanges
|
|
1291
|
+
.pipe(filter(({ type }) => type === 'submit'), takeUntil(this.tagsSubscriptions$))
|
|
1279
1292
|
.subscribe(() => this.propagateTagsChanges());
|
|
1280
1293
|
}
|
|
1281
1294
|
/** Checks whether any of the tags is focused. */
|
|
@@ -1300,6 +1313,7 @@ class KbqTagList {
|
|
|
1300
1313
|
this.dropList.dropped
|
|
1301
1314
|
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
1302
1315
|
.subscribe(({ currentIndex, previousIndex, event, item }) => {
|
|
1316
|
+
this.pendingUIChange = true;
|
|
1303
1317
|
const { tag } = item.data;
|
|
1304
1318
|
this.dropped.emit({ currentIndex, previousIndex, event, tag });
|
|
1305
1319
|
});
|
|
@@ -1313,8 +1327,8 @@ class KbqTagList {
|
|
|
1313
1327
|
this.unselectAll();
|
|
1314
1328
|
});
|
|
1315
1329
|
}
|
|
1316
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
1317
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
1330
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", 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 }); }
|
|
1331
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: KbqTagList, isStandalone: true, 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: i0.forwardRef(() => KbqTag), descendants: true }], exportAs: ["kbqTagList"], hostDirectives: [{ directive: i2.CdkDropList }], ngImport: i0, template: `
|
|
1318
1332
|
<div class="kbq-tags-list__list-container">
|
|
1319
1333
|
<ng-content />
|
|
1320
1334
|
</div>
|
|
@@ -1326,7 +1340,7 @@ class KbqTagList {
|
|
|
1326
1340
|
}
|
|
1327
1341
|
`, isInline: true, styles: [".kbq-tag-list{display:flex;flex-direction:row;min-height:var(--kbq-size-xxl);box-sizing:border-box}.kbq-tag-list:focus-visible{outline:none}.kbq-tag-list.cdk-drop-list-dragging .cdk-drag{transition:transform .25s cubic-bezier(0,0,.2,1)}.kbq-tag-input{background:transparent;padding:0;margin:0;border:none;outline:none}.kbq-tag-input::-ms-clear{display:none;width:0;height:0}.kbq-tag-input::-ms-reveal{display:none;width:0;height:0}.kbq-tag-input::-webkit-search-decoration,.kbq-tag-input::-webkit-search-cancel-button,.kbq-tag-input::-webkit-search-results-button,.kbq-tag-input::-webkit-search-results-decoration{display:none}.kbq-tag-input{padding-top:var(--kbq-tag-size-padding-vertical);padding-bottom:var(--kbq-tag-size-padding-vertical);padding-left:var(--kbq-size-xxs);padding-right:unset;min-width:var(--kbq-size-3xl);max-width:100%;flex-grow:1}.kbq-tag-input.kbq-input{--kbq-input-size-padding-vertical: 0;--kbq-form-field-size-border-radius: 0;padding-left:var(--kbq-size-xxs);min-height:unset!important;width:auto}.kbq-tags-list__list-container{display:flex;flex-wrap:wrap;flex:1 1 100%;box-sizing:border-box;min-width:0;gap:var(--kbq-tag-list-size-content-gap)}.kbq-tags-list__list-container .kbq-tag-input:first-child{padding-left:var(--kbq-size-s)}.kbq-tags-list__cleaner .kbq-cleaner{max-height:24px}.kbq-form-field-type-tag-list .kbq-form-field__container{padding-top:calc(var(--kbq-tag-input-size-padding-vertical) - var(--kbq-form-field-size-border-width));padding-bottom:calc(var(--kbq-tag-input-size-padding-vertical) - var(--kbq-form-field-size-border-width))}body:has(.kbq-tag-list.cdk-drop-list-dragging){cursor:grabbing}\n", ".kbq-tag,.kbq-tag-list,.kbq-tag-input{--kbq-tag-list-size-content-gap: var(--kbq-size-xxs);--kbq-tag-size-padding-horizontal: var(--kbq-size-xxs);--kbq-tag-size-padding-vertical: var(--kbq-size-3xs);--kbq-tag-size-content-gap-horizontal: var(--kbq-size-3xs);--kbq-tag-size-icon-margin-left: var(--kbq-size-3xs);--kbq-tag-size-close-button-margin-right: var(--kbq-size-3xs);--kbq-tag-theme-fade-on-default-background: var(--kbq-background-theme-fade);--kbq-tag-theme-fade-on-default-text: var(--kbq-foreground-theme);--kbq-tag-theme-fade-on-default-icon: var(--kbq-icon-theme);--kbq-tag-theme-fade-on-default-close-button: var(--kbq-icon-theme);--kbq-tag-theme-fade-on-states-hover-background: var(--kbq-states-background-theme-fade-hover);--kbq-tag-theme-fade-on-states-hover-text: var(--kbq-foreground-theme);--kbq-tag-theme-fade-on-states-hover-icon: var(--kbq-icon-theme);--kbq-tag-theme-fade-on-states-hover-close-button: var(--kbq-icon-theme);--kbq-tag-theme-fade-on-states-focus-background: var(--kbq-background-theme-fade);--kbq-tag-theme-fade-on-states-focus-text: var(--kbq-foreground-theme);--kbq-tag-theme-fade-on-states-focus-icon: var(--kbq-icon-theme);--kbq-tag-theme-fade-on-states-focus-close-button: var(--kbq-icon-theme);--kbq-tag-theme-fade-on-states-focus-outline: var(--kbq-states-line-focus-theme);--kbq-tag-theme-fade-on-states-selected-background: var(--kbq-background-theme);--kbq-tag-theme-fade-on-states-selected-text: var(--kbq-foreground-white);--kbq-tag-theme-fade-on-states-selected-icon: var(--kbq-icon-white);--kbq-tag-theme-fade-on-states-selected-close-button: var(--kbq-icon-white);--kbq-tag-theme-fade-on-states-disabled-background: var(--kbq-states-background-disabled);--kbq-tag-theme-fade-on-states-disabled-text: var(--kbq-states-foreground-disabled);--kbq-tag-theme-fade-on-states-disabled-icon: var(--kbq-states-icon-disabled);--kbq-tag-theme-fade-on-states-disabled-close-button: var(--kbq-states-icon-disabled);--kbq-tag-contrast-fade-on-default-background: var(--kbq-background-contrast-fade);--kbq-tag-contrast-fade-on-default-text: var(--kbq-foreground-contrast);--kbq-tag-contrast-fade-on-default-icon: var(--kbq-icon-contrast-fade);--kbq-tag-contrast-fade-on-default-close-button: var(--kbq-icon-contrast-fade);--kbq-tag-contrast-fade-on-states-hover-background: var(--kbq-states-background-contrast-fade-hover);--kbq-tag-contrast-fade-on-states-hover-text: var(--kbq-foreground-contrast);--kbq-tag-contrast-fade-on-states-hover-icon: var(--kbq-icon-contrast-fade);--kbq-tag-contrast-fade-on-states-hover-close-button: var(--kbq-icon-contrast-fade);--kbq-tag-contrast-fade-on-states-focus-background: var(--kbq-background-contrast-fade);--kbq-tag-contrast-fade-on-states-focus-text: var(--kbq-foreground-contrast);--kbq-tag-contrast-fade-on-states-focus-icon: var(--kbq-icon-contrast-fade);--kbq-tag-contrast-fade-on-states-focus-close-button: var(--kbq-icon-contrast-fade);--kbq-tag-contrast-fade-on-states-focus-outline: var(--kbq-states-line-focus-theme);--kbq-tag-contrast-fade-on-states-selected-background: var(--kbq-background-theme);--kbq-tag-contrast-fade-on-states-selected-text: var(--kbq-foreground-white);--kbq-tag-contrast-fade-on-states-selected-icon: var(--kbq-icon-white);--kbq-tag-contrast-fade-on-states-selected-close-button: var(--kbq-icon-white);--kbq-tag-contrast-fade-on-states-disabled-background: var(--kbq-states-background-disabled);--kbq-tag-contrast-fade-on-states-disabled-text: var(--kbq-states-foreground-disabled);--kbq-tag-contrast-fade-on-states-disabled-icon: var(--kbq-states-icon-disabled);--kbq-tag-contrast-fade-on-states-disabled-close-button: var(--kbq-states-icon-disabled);--kbq-tag-error-fade-on-default-background: var(--kbq-background-error-fade);--kbq-tag-error-fade-on-default-text: var(--kbq-foreground-error);--kbq-tag-error-fade-on-default-icon: var(--kbq-icon-error);--kbq-tag-error-fade-on-default-close-button: var(--kbq-icon-error);--kbq-tag-error-fade-on-states-hover-background: var(--kbq-states-background-error-fade-hover);--kbq-tag-error-fade-on-states-hover-text: var(--kbq-foreground-error);--kbq-tag-error-fade-on-states-hover-icon: var(--kbq-icon-error);--kbq-tag-error-fade-on-states-hover-close-button: var(--kbq-icon-error);--kbq-tag-error-fade-on-states-focus-background: var(--kbq-background-error-fade);--kbq-tag-error-fade-on-states-focus-text: var(--kbq-foreground-error);--kbq-tag-error-fade-on-states-focus-icon: var(--kbq-icon-error);--kbq-tag-error-fade-on-states-focus-close-button: var(--kbq-icon-error);--kbq-tag-error-fade-on-states-focus-outline: var(--kbq-states-line-focus-error);--kbq-tag-error-fade-on-states-selected-background: var(--kbq-background-error);--kbq-tag-error-fade-on-states-selected-text: var(--kbq-foreground-white);--kbq-tag-error-fade-on-states-selected-icon: var(--kbq-icon-white);--kbq-tag-error-fade-on-states-selected-close-button: var(--kbq-icon-white);--kbq-tag-error-fade-on-states-disabled-background: var(--kbq-states-background-disabled);--kbq-tag-error-fade-on-states-disabled-text: var(--kbq-states-foreground-disabled);--kbq-tag-error-fade-on-states-disabled-icon: var(--kbq-states-icon-disabled);--kbq-tag-error-fade-on-states-disabled-close-button: var(--kbq-states-icon-disabled);--kbq-tag-warning-fade-default-background: var(--kbq-background-warning-fade);--kbq-tag-warning-fade-default-text: var(--kbq-foreground-warning);--kbq-tag-warning-fade-default-icon: var(--kbq-icon-warning);--kbq-tag-warning-fade-default-close-button: var(--kbq-icon-warning);--kbq-tag-warning-fade-states-hover-background: var(--kbq-states-background-warning-fade-hover);--kbq-tag-warning-fade-states-hover-text: var(--kbq-foreground-warning);--kbq-tag-warning-fade-states-hover-icon: var(--kbq-icon-warning);--kbq-tag-warning-fade-states-hover-close-button: var(--kbq-icon-warning);--kbq-tag-warning-fade-states-focus-background: var(--kbq-background-warning-fade);--kbq-tag-warning-fade-states-focus-text: var(--kbq-foreground-warning);--kbq-tag-warning-fade-states-focus-icon: var(--kbq-icon-warning);--kbq-tag-warning-fade-states-focus-close-button: var(--kbq-icon-warning);--kbq-tag-warning-fade-states-focus-outline: var(--kbq-states-line-focus-theme);--kbq-tag-warning-fade-states-selected-background: var(--kbq-background-warning);--kbq-tag-warning-fade-states-selected-text: var(--kbq-foreground-contrast);--kbq-tag-warning-fade-states-selected-icon: var(--kbq-icon-contrast);--kbq-tag-warning-fade-states-selected-close-button: var(--kbq-icon-contrast);--kbq-tag-warning-fade-states-disabled-background: var(--kbq-states-background-disabled);--kbq-tag-warning-fade-states-disabled-text: var(--kbq-states-foreground-disabled);--kbq-tag-warning-fade-states-disabled-icon: var(--kbq-states-icon-disabled);--kbq-tag-warning-fade-states-disabled-close-button: var(--kbq-states-icon-disabled)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1328
1342
|
}
|
|
1329
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
1343
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqTagList, decorators: [{
|
|
1330
1344
|
type: Component,
|
|
1331
1345
|
args: [{ selector: 'kbq-tag-list', exportAs: 'kbqTagList', template: `
|
|
1332
1346
|
<div class="kbq-tags-list__list-container">
|
|
@@ -1408,7 +1422,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1408
1422
|
args: ['kbqTagListCleaner', { static: true }]
|
|
1409
1423
|
}], tags: [{
|
|
1410
1424
|
type: ContentChildren,
|
|
1411
|
-
args: [KbqTag, {
|
|
1425
|
+
args: [forwardRef(() => KbqTag), {
|
|
1412
1426
|
// Need to use `descendants: true`,
|
|
1413
1427
|
// Ivy will no longer match indirect descendants if it's left as false.
|
|
1414
1428
|
descendants: true
|
|
@@ -1509,12 +1523,16 @@ class KbqTagInput {
|
|
|
1509
1523
|
}
|
|
1510
1524
|
/** @docs-private */
|
|
1511
1525
|
onKeydown(event) {
|
|
1526
|
+
const isSeparatorKey = this.isSeparatorKey(event);
|
|
1512
1527
|
if (!this.inputElement.value) {
|
|
1528
|
+
if (isSeparatorKey) {
|
|
1529
|
+
event.preventDefault();
|
|
1530
|
+
}
|
|
1513
1531
|
this._tagList.keydown(event);
|
|
1514
1532
|
event.stopPropagation();
|
|
1515
1533
|
return;
|
|
1516
1534
|
}
|
|
1517
|
-
if (
|
|
1535
|
+
if (isSeparatorKey) {
|
|
1518
1536
|
this.emitTagEnd();
|
|
1519
1537
|
event.preventDefault();
|
|
1520
1538
|
}
|
|
@@ -1543,6 +1561,7 @@ class KbqTagInput {
|
|
|
1543
1561
|
if (!this.hasControl() || (this.hasControl() && !this.ngControl.invalid)) {
|
|
1544
1562
|
if (this.distinct && this.hasDuplicates)
|
|
1545
1563
|
return;
|
|
1564
|
+
this._tagList?.notifyPendingTagChange();
|
|
1546
1565
|
this.tagEnd.emit({ input: this.inputElement, value: this.trimValue(this.inputElement.value) });
|
|
1547
1566
|
}
|
|
1548
1567
|
}
|
|
@@ -1576,6 +1595,9 @@ class KbqTagInput {
|
|
|
1576
1595
|
const tagValues = this._tagList.tags.map(({ value }) => value);
|
|
1577
1596
|
items = items.filter((item) => !tagValues.includes(item));
|
|
1578
1597
|
}
|
|
1598
|
+
if (items.length) {
|
|
1599
|
+
this._tagList?.notifyPendingTagChange();
|
|
1600
|
+
}
|
|
1579
1601
|
items.forEach((item) => this.tagEnd.emit({ input: this.inputElement, value: item }));
|
|
1580
1602
|
$event.preventDefault();
|
|
1581
1603
|
$event.stopPropagation();
|
|
@@ -1616,12 +1638,12 @@ class KbqTagInput {
|
|
|
1616
1638
|
}
|
|
1617
1639
|
/** Checks whether a keycode is one of the configured separators. */
|
|
1618
1640
|
isSeparatorKey(event) {
|
|
1619
|
-
return this.separators.some((separator) => separator.key === event.key && !event
|
|
1641
|
+
return this.separators.some((separator) => separator.key === event.key && !hasModifierKey(event));
|
|
1620
1642
|
}
|
|
1621
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
1622
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.2.
|
|
1643
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", 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 }); }
|
|
1644
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.2.21", type: KbqTagInput, isStandalone: true, 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 }); }
|
|
1623
1645
|
}
|
|
1624
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
1646
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqTagInput, decorators: [{
|
|
1625
1647
|
type: Directive,
|
|
1626
1648
|
args: [{
|
|
1627
1649
|
selector: 'input[kbqTagInputFor]',
|
|
@@ -1684,8 +1706,8 @@ const COMPONENTS = [
|
|
|
1684
1706
|
KbqTagEditInput
|
|
1685
1707
|
];
|
|
1686
1708
|
class KbqTagsModule {
|
|
1687
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
1688
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.
|
|
1709
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqTagsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1710
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.21", ngImport: i0, type: KbqTagsModule, imports: [PlatformModule, KbqTagEditSubmit,
|
|
1689
1711
|
KbqTagEditInput, KbqTagList,
|
|
1690
1712
|
KbqTag,
|
|
1691
1713
|
KbqTagInput,
|
|
@@ -1698,14 +1720,14 @@ class KbqTagsModule {
|
|
|
1698
1720
|
KbqTagAvatar,
|
|
1699
1721
|
KbqTagRemove, KbqTagEditSubmit,
|
|
1700
1722
|
KbqTagEditInput] }); }
|
|
1701
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.
|
|
1723
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqTagsModule, providers: [
|
|
1702
1724
|
{
|
|
1703
1725
|
provide: KBQ_TAGS_DEFAULT_OPTIONS,
|
|
1704
1726
|
useValue: { separatorKeyCodes: [ENTER$1] }
|
|
1705
1727
|
}
|
|
1706
1728
|
], imports: [PlatformModule] }); }
|
|
1707
1729
|
}
|
|
1708
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
1730
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqTagsModule, decorators: [{
|
|
1709
1731
|
type: NgModule,
|
|
1710
1732
|
args: [{
|
|
1711
1733
|
imports: [
|