@koobiq/components 18.36.0 → 18.37.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/autocomplete/autocomplete.scss +2 -17
- package/breadcrumbs/breadcrumbs.d.ts +2 -1
- package/breadcrumbs/breadcrumbs.scss +4 -4
- package/button/button.component.d.ts +1 -0
- package/button-toggle/button-toggle.scss +0 -2
- package/content-panel/content-panel.d.ts +1 -1
- package/content-panel/index.d.ts +0 -1
- package/core/common-behaviors/hover.d.ts +15 -0
- package/core/common-behaviors/index.d.ts +1 -1
- package/core/locales/formatters.d.ts +0 -72
- package/core/locales/index.d.ts +0 -2
- package/core/locales/locale-service.d.ts +0 -392
- package/core/option/option.d.ts +3 -2
- package/core/select/common.d.ts +3 -1
- package/core/styles/common/_select.scss +20 -0
- package/core/styles/typography/_typography.scss +23 -82
- package/datepicker/datepicker-module.d.ts +2 -1
- package/dropdown/dropdown-item.scss +8 -7
- package/dropdown/dropdown.scss +5 -14
- package/esm2022/autocomplete/autocomplete-trigger.directive.mjs +4 -4
- package/esm2022/breadcrumbs/breadcrumbs.mjs +46 -37
- package/esm2022/button/button.component.mjs +6 -4
- package/esm2022/button-toggle/button-toggle.component.mjs +2 -2
- package/esm2022/code-block/code-block-highlight.mjs +6 -1
- package/esm2022/content-panel/content-panel.mjs +2 -2
- package/esm2022/content-panel/index.mjs +1 -2
- package/esm2022/core/common-behaviors/color.mjs +2 -1
- package/esm2022/core/common-behaviors/common-module.mjs +2 -1
- package/esm2022/core/common-behaviors/disabled.mjs +2 -1
- package/esm2022/core/common-behaviors/error-state.mjs +2 -1
- package/esm2022/core/common-behaviors/hover.mjs +34 -0
- package/esm2022/core/common-behaviors/index.mjs +2 -2
- package/esm2022/core/common-behaviors/tabindex.mjs +2 -1
- package/esm2022/core/form-field/field-sizing-content.mjs +5 -2
- package/esm2022/core/formatters/number/formatter.mjs +2 -2
- package/esm2022/core/locales/es-LA.mjs +10 -10
- package/esm2022/core/locales/formatters.mjs +1 -73
- package/esm2022/core/locales/index.mjs +1 -3
- package/esm2022/core/locales/locale-service.mjs +2 -8
- package/esm2022/core/locales/pt-BR.mjs +19 -19
- package/esm2022/core/locales/tk-TM.mjs +24 -24
- package/esm2022/core/option/option.mjs +10 -6
- package/esm2022/core/pop-up/pop-up-trigger.mjs +2 -1
- package/esm2022/core/select/common.mjs +10 -4
- package/esm2022/core/version.mjs +2 -2
- package/esm2022/datepicker/calendar-header.component.mjs +5 -4
- package/esm2022/datepicker/datepicker-module.mjs +7 -4
- package/esm2022/dropdown/dropdown-item.component.mjs +2 -2
- package/esm2022/dropdown/dropdown.component.mjs +3 -3
- package/esm2022/ellipsis-center/ellipsis-center.directive.mjs +5 -2
- package/esm2022/file-upload/file-drop.mjs +5 -3
- package/esm2022/file-upload/multiple-file-upload.component.mjs +9 -13
- package/esm2022/file-upload/single-file-upload.component.mjs +9 -4
- package/esm2022/filter-bar/filter-bar.mjs +6 -2
- package/esm2022/filter-bar/filter-search.mjs +3 -3
- package/esm2022/filter-bar/filters.mjs +10 -5
- package/esm2022/filter-bar/pipe-add.mjs +3 -2
- package/esm2022/filter-bar/pipes/base-pipe.mjs +11 -3
- package/esm2022/filter-bar/pipes/pipe-date.mjs +3 -3
- package/esm2022/filter-bar/pipes/pipe-datetime.mjs +3 -3
- package/esm2022/filter-bar/pipes/pipe-multi-select.mjs +5 -4
- package/esm2022/filter-bar/pipes/pipe-multi-tree-select.mjs +2 -2
- package/esm2022/filter-bar/pipes/pipe-select.mjs +2 -2
- package/esm2022/filter-bar/pipes/pipe-text.mjs +2 -2
- package/esm2022/filter-bar/pipes/pipe-title.mjs +24 -19
- package/esm2022/filter-bar/pipes/pipe-tree-select.mjs +2 -2
- package/esm2022/form-field/fieldset.mjs +2 -2
- package/esm2022/form-field/form-field.mjs +2 -2
- package/esm2022/form-field/stepper.mjs +41 -10
- package/esm2022/inline-edit/inline-edit.mjs +9 -5
- package/esm2022/input/input-number.mjs +7 -6
- package/esm2022/input/input.module.mjs +7 -4
- package/esm2022/list/list-selection.component.mjs +31 -15
- package/esm2022/markdown/markdown.component.mjs +7 -7
- package/esm2022/modal/modal-util.mjs +7 -3
- package/esm2022/modal/modal.component.mjs +2 -2
- package/esm2022/modal/modal.service.mjs +2 -1
- package/esm2022/navbar/navbar-item.component.mjs +5 -7
- package/esm2022/navbar/navbar.component.mjs +8 -4
- package/esm2022/navbar/vertical-navbar.component.mjs +2 -2
- package/esm2022/navbar-ic/navbar-ic-header.mjs +20 -4
- package/esm2022/navbar-ic/navbar-ic-item.mjs +7 -8
- package/esm2022/navbar-ic/navbar-ic.animation.mjs +10 -2
- package/esm2022/navbar-ic/navbar-ic.mjs +33 -9
- package/esm2022/popover/popover-confirm.component.mjs +3 -3
- package/esm2022/popover/popover.component.mjs +17 -4
- package/esm2022/resizer/index.mjs +3 -0
- package/esm2022/resizer/koobiq-components-resizer.mjs +5 -0
- package/esm2022/resizer/module.mjs +17 -0
- package/esm2022/resizer/resizer.mjs +135 -0
- package/esm2022/scrollbar/scrollbar.directive.mjs +4 -3
- package/esm2022/search-expandable/search-expandable.mjs +5 -5
- package/esm2022/select/select.component.mjs +2 -14
- package/esm2022/select/select.module.mjs +8 -4
- package/esm2022/sidepanel/sidepanel-container.component.mjs +3 -3
- package/esm2022/split-button/split-button.mjs +47 -6
- package/esm2022/tags/tag-input.mjs +24 -28
- package/esm2022/tags/tag-list.component.mjs +76 -87
- package/esm2022/tags/tag.component.mjs +29 -34
- package/esm2022/textarea/textarea.module.mjs +5 -4
- package/esm2022/time-range/constants.mjs +22 -1
- package/esm2022/time-range/time-range-editor.mjs +11 -6
- package/esm2022/time-range/time-range-title-as-form-field.mjs +2 -1
- package/esm2022/time-range/time-range.mjs +8 -3
- package/esm2022/time-range/time-range.service.mjs +43 -106
- package/esm2022/time-range/types.mjs +1 -1
- package/esm2022/timepicker/timepicker.module.mjs +5 -4
- package/esm2022/timezone/timezone-option.component.mjs +2 -2
- package/esm2022/timezone/timezone.module.mjs +6 -4
- package/esm2022/title/title.directive.mjs +6 -2
- package/esm2022/toggle/toggle.component.mjs +3 -3
- package/esm2022/top-bar/top-bar.mjs +2 -2
- package/esm2022/tree/tree-option.component.mjs +7 -6
- package/esm2022/tree/tree-selection.component.mjs +23 -13
- package/esm2022/tree-select/tree-select.component.mjs +97 -79
- package/esm2022/tree-select/tree-select.module.mjs +7 -4
- package/fesm2022/koobiq-components-autocomplete.mjs +3 -3
- package/fesm2022/koobiq-components-autocomplete.mjs.map +1 -1
- package/fesm2022/koobiq-components-breadcrumbs.mjs +45 -36
- package/fesm2022/koobiq-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/koobiq-components-button-toggle.mjs +2 -2
- package/fesm2022/koobiq-components-button-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-button.mjs +5 -3
- package/fesm2022/koobiq-components-button.mjs.map +1 -1
- package/fesm2022/koobiq-components-code-block.mjs +5 -0
- package/fesm2022/koobiq-components-code-block.mjs.map +1 -1
- package/fesm2022/koobiq-components-content-panel.mjs +3 -137
- package/fesm2022/koobiq-components-content-panel.mjs.map +1 -1
- package/fesm2022/koobiq-components-core.mjs +90 -478
- package/fesm2022/koobiq-components-core.mjs.map +1 -1
- package/fesm2022/koobiq-components-datepicker.mjs +8 -5
- package/fesm2022/koobiq-components-datepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-dropdown.mjs +4 -4
- package/fesm2022/koobiq-components-dropdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-ellipsis-center.mjs +4 -1
- package/fesm2022/koobiq-components-ellipsis-center.mjs.map +1 -1
- package/fesm2022/koobiq-components-file-upload.mjs +19 -17
- package/fesm2022/koobiq-components-file-upload.mjs.map +1 -1
- package/fesm2022/koobiq-components-filter-bar.mjs +64 -41
- package/fesm2022/koobiq-components-filter-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-form-field.mjs +44 -17
- package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
- package/fesm2022/koobiq-components-inline-edit.mjs +8 -4
- package/fesm2022/koobiq-components-inline-edit.mjs.map +1 -1
- package/fesm2022/koobiq-components-input.mjs +12 -9
- package/fesm2022/koobiq-components-input.mjs.map +1 -1
- package/fesm2022/koobiq-components-list.mjs +30 -14
- package/fesm2022/koobiq-components-list.mjs.map +1 -1
- package/fesm2022/koobiq-components-markdown.mjs +6 -6
- package/fesm2022/koobiq-components-markdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-modal.mjs +9 -4
- package/fesm2022/koobiq-components-modal.mjs.map +1 -1
- package/fesm2022/koobiq-components-navbar-ic.mjs +70 -26
- package/fesm2022/koobiq-components-navbar-ic.mjs.map +1 -1
- package/fesm2022/koobiq-components-navbar.mjs +13 -11
- package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
- package/fesm2022/koobiq-components-popover.mjs +18 -5
- package/fesm2022/koobiq-components-popover.mjs.map +1 -1
- package/fesm2022/koobiq-components-resizer.mjs +156 -0
- package/fesm2022/koobiq-components-resizer.mjs.map +1 -0
- package/fesm2022/koobiq-components-scrollbar.mjs +3 -2
- package/fesm2022/koobiq-components-scrollbar.mjs.map +1 -1
- package/fesm2022/koobiq-components-search-expandable.mjs +4 -4
- package/fesm2022/koobiq-components-search-expandable.mjs.map +1 -1
- package/fesm2022/koobiq-components-select.mjs +8 -17
- package/fesm2022/koobiq-components-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-sidepanel.mjs +2 -2
- package/fesm2022/koobiq-components-sidepanel.mjs.map +1 -1
- package/fesm2022/koobiq-components-split-button.mjs +46 -5
- package/fesm2022/koobiq-components-split-button.mjs.map +1 -1
- package/fesm2022/koobiq-components-tags.mjs +125 -146
- package/fesm2022/koobiq-components-tags.mjs.map +1 -1
- package/fesm2022/koobiq-components-textarea.mjs +4 -4
- package/fesm2022/koobiq-components-textarea.mjs.map +1 -1
- package/fesm2022/koobiq-components-time-range.mjs +81 -112
- package/fesm2022/koobiq-components-time-range.mjs.map +1 -1
- package/fesm2022/koobiq-components-timepicker.mjs +4 -4
- package/fesm2022/koobiq-components-timepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-timezone.mjs +7 -5
- package/fesm2022/koobiq-components-timezone.mjs.map +1 -1
- package/fesm2022/koobiq-components-title.mjs +5 -1
- package/fesm2022/koobiq-components-title.mjs.map +1 -1
- package/fesm2022/koobiq-components-toggle.mjs +2 -2
- package/fesm2022/koobiq-components-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-top-bar.mjs +2 -2
- package/fesm2022/koobiq-components-top-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree-select.mjs +102 -82
- package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree.mjs +28 -17
- package/fesm2022/koobiq-components-tree.mjs.map +1 -1
- package/file-upload/_file-upload-theme.scss +32 -34
- package/file-upload/file-upload-tokens.scss +1 -2
- package/file-upload/file-upload.scss +4 -7
- package/file-upload/multiple-file-upload.component.d.ts +1 -1
- package/file-upload/multiple-file-upload.component.scss +12 -14
- package/file-upload/single-file-upload.component.d.ts +1 -0
- package/file-upload/single-file-upload.component.scss +5 -7
- package/filter-bar/filter-bar.d.ts +3 -1
- package/filter-bar/filter-search.scss +1 -3
- package/filter-bar/filters.d.ts +1 -0
- package/filter-bar/pipes/base-pipe.d.ts +5 -1
- package/filter-bar/pipes/pipe-date.scss +4 -2
- package/filter-bar/pipes/pipe-title.d.ts +2 -0
- package/form-field/fieldset-tokens.scss +2 -1
- package/form-field/form-field-tokens.scss +2 -2
- package/form-field/form-field.scss +9 -1
- package/form-field/stepper.d.ts +28 -6
- package/inline-edit/inline-edit.d.ts +5 -1
- package/input/input.module.d.ts +2 -1
- package/list/list-selection.component.d.ts +12 -1
- package/markdown/_markdown-theme.scss +0 -1
- package/markdown/markdown.scss +2 -4
- package/modal/modal-tokens.scss +2 -1
- package/modal/modal-util.d.ts +5 -2
- package/modal/modal.scss +3 -4
- package/navbar/_navbar-item_vertical.scss +10 -0
- package/navbar/navbar-brand.scss +5 -2
- package/navbar/vertical-navbar.scss +1 -0
- package/navbar-ic/navbar-ic-header.d.ts +3 -2
- package/navbar-ic/navbar-ic-header.scss +0 -4
- package/navbar-ic/navbar-ic-item.d.ts +1 -0
- package/navbar-ic/navbar-ic-item.scss +0 -4
- package/navbar-ic/navbar-ic.animation.d.ts +1 -0
- package/navbar-ic/navbar-ic.d.ts +7 -0
- package/package.json +16 -10
- package/popover/popover-tokens.scss +1 -0
- package/popover/popover.component.d.ts +5 -1
- package/popover/popover.scss +3 -4
- package/prebuilt-themes/dark-theme.css +1 -1
- package/prebuilt-themes/light-theme.css +1 -1
- package/prebuilt-themes/theme.css +1 -1
- package/resizer/index.d.ts +2 -0
- package/resizer/module.d.ts +7 -0
- package/{content-panel/resizable.d.ts → resizer/resizer.d.ts} +18 -13
- package/schematics/collection.json +5 -0
- package/schematics/migrations/icons-replacement/README.md +93 -0
- package/schematics/migrations/icons-replacement/data.js +92 -0
- package/schematics/migrations/icons-replacement/index.js +84 -0
- package/schematics/migrations/icons-replacement/schema.json +32 -0
- package/schematics/ng-add/index.js +6 -6
- package/scrollbar/scrollbar.component.scss +2 -3
- package/select/select.module.d.ts +2 -1
- package/select/select.scss +1 -17
- package/sidepanel/sidepanel-tokens.scss +2 -0
- package/sidepanel/sidepanel.scss +2 -0
- package/split-button/_split-button-theme.scss +89 -34
- package/split-button/split-button.d.ts +11 -5
- package/split-button/split-button.scss +40 -51
- package/tags/tag-input.d.ts +16 -7
- package/tags/tag-list.component.d.ts +44 -21
- package/tags/tag-list.scss +13 -14
- package/tags/tag.component.d.ts +20 -15
- package/textarea/textarea-tokens.scss +6 -1
- package/textarea/textarea.module.d.ts +2 -1
- package/textarea/textarea.scss +4 -0
- package/time-range/constants.d.ts +12 -1
- package/time-range/time-range-editor.d.ts +7 -9
- package/time-range/time-range-title-as-form-field.d.ts +1 -0
- package/time-range/time-range.d.ts +5 -2
- package/time-range/time-range.service.d.ts +7 -11
- package/time-range/types.d.ts +37 -11
- package/timepicker/timepicker.module.d.ts +2 -1
- package/timezone/timezone-option.component.scss +6 -0
- package/timezone/timezone.module.d.ts +1 -1
- package/toggle/_toggle-theme.scss +8 -5
- package/toggle/toggle-tokens.scss +0 -1
- package/toggle/toggle.scss +11 -15
- package/top-bar/top-bar-tokens.scss +1 -1
- package/top-bar/top-bar.scss +3 -0
- package/tree/tree-option.component.d.ts +1 -0
- package/tree/tree-selection.component.d.ts +11 -2
- package/tree-select/tree-select.component.d.ts +5 -5
- package/tree-select/tree-select.module.d.ts +2 -1
- package/tree-select/tree-select.scss +4 -0
- package/core/common-behaviors/hovered.d.ts +0 -13
- package/core/locales/fa-IR.d.ts +0 -162
- package/core/locales/zh-CN.d.ts +0 -162
- package/esm2022/content-panel/resizable.mjs +0 -138
- package/esm2022/core/common-behaviors/hovered.mjs +0 -31
- package/esm2022/core/locales/fa-IR.mjs +0 -173
- package/esm2022/core/locales/zh-CN.mjs +0 -161
|
@@ -2,20 +2,20 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { InjectionToken, Directive, inject, DestroyRef, ElementRef, EventEmitter, signal, booleanAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, ContentChild, Output, ViewChild, ContentChildren, forwardRef, Inject, Optional, Self, NgModule } from '@angular/core';
|
|
3
3
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
4
4
|
import * as i3 from '@angular/forms';
|
|
5
|
-
import { hasModifierKey, isSelectAll, ENTER as ENTER$1, TAB, SPACE as SPACE$1, COMMA, SEMICOLON } from '@koobiq/cdk/keycodes';
|
|
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, isBoolean } 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';
|
|
12
12
|
import * as i2$1 from '@angular/cdk/bidi';
|
|
13
13
|
import * as i2 from '@angular/cdk/drag-drop';
|
|
14
14
|
import { CdkDrag, CdkDropList } from '@angular/cdk/drag-drop';
|
|
15
|
-
import { DELETE, SPACE, BACKSPACE, ENTER, ESCAPE, F2, HOME, END } from '@angular/cdk/keycodes';
|
|
15
|
+
import { DELETE, SPACE, BACKSPACE, ENTER, ESCAPE, F2, LEFT_ARROW, TAB, HOME, END } from '@angular/cdk/keycodes';
|
|
16
16
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
17
17
|
import { FocusKeyManager } from '@koobiq/cdk/a11y';
|
|
18
|
-
import { Subject,
|
|
18
|
+
import { Subject, merge } from 'rxjs';
|
|
19
19
|
import { startWith, filter } from 'rxjs/operators';
|
|
20
20
|
import { KbqIcon } from '@koobiq/components/icon';
|
|
21
21
|
import { PlatformModule } from '@angular/cdk/platform';
|
|
@@ -168,13 +168,10 @@ class KbqTag extends KbqColorDirective {
|
|
|
168
168
|
this._value = value;
|
|
169
169
|
}
|
|
170
170
|
/**
|
|
171
|
-
* Whether
|
|
172
|
-
* changes to its selected state are always ignored. By default a tag is
|
|
173
|
-
* selectable, and it becomes non-selectable if its parent tag list is
|
|
174
|
-
* not selectable.
|
|
171
|
+
* Whether the tag is selectable.
|
|
175
172
|
*/
|
|
176
173
|
get selectable() {
|
|
177
|
-
return this._selectable
|
|
174
|
+
return this._selectable || !!this.tagList?.selectable;
|
|
178
175
|
}
|
|
179
176
|
set selectable(value) {
|
|
180
177
|
this._selectable = value;
|
|
@@ -241,7 +238,6 @@ class KbqTag extends KbqColorDirective {
|
|
|
241
238
|
* @docs-private
|
|
242
239
|
*/
|
|
243
240
|
this.hasFocus = false;
|
|
244
|
-
this.focusOrigin = null;
|
|
245
241
|
/** Whether the tag edits can't be submitted. */
|
|
246
242
|
this.preventEditSubmit = false;
|
|
247
243
|
/**
|
|
@@ -259,7 +255,7 @@ class KbqTag extends KbqColorDirective {
|
|
|
259
255
|
/** Emitted when a tag is to be removed. */
|
|
260
256
|
this.removed = new EventEmitter();
|
|
261
257
|
this._selected = false;
|
|
262
|
-
this._selectable =
|
|
258
|
+
this._selectable = false;
|
|
263
259
|
this._removable = true;
|
|
264
260
|
this._tabindex = -1;
|
|
265
261
|
this._disabled = false;
|
|
@@ -365,12 +361,22 @@ class KbqTag extends KbqColorDirective {
|
|
|
365
361
|
}
|
|
366
362
|
}
|
|
367
363
|
/** @docs-private */
|
|
368
|
-
|
|
369
|
-
if (this.disabled ||
|
|
370
|
-
|
|
371
|
-
|
|
364
|
+
handleClick(event) {
|
|
365
|
+
if (this.disabled || this.editing()) {
|
|
366
|
+
event.preventDefault();
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
if (
|
|
370
|
+
// We should toggle selection only if tag inside of a tag list.
|
|
371
|
+
// Single tag can only be toggled on focus or blur.
|
|
372
|
+
this.tagList &&
|
|
373
|
+
this.selectable &&
|
|
374
|
+
hasModifierKey(event, 'metaKey', 'ctrlKey', 'shiftKey')) {
|
|
372
375
|
this.toggleSelected(true);
|
|
373
|
-
|
|
376
|
+
// We should stop event propagation to prevent the tag list from handling the click event.
|
|
377
|
+
event.stopPropagation();
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
374
380
|
}
|
|
375
381
|
/** @docs-private */
|
|
376
382
|
handleKeydown(event) {
|
|
@@ -379,16 +385,15 @@ class KbqTag extends KbqColorDirective {
|
|
|
379
385
|
switch (event.keyCode) {
|
|
380
386
|
case DELETE:
|
|
381
387
|
case BACKSPACE: {
|
|
382
|
-
const hasSelectedTags = this.tagList &&
|
|
383
|
-
(Array.isArray(this.tagList.selected) ? this.tagList.selected.length > 0 : !!this.tagList.selected);
|
|
384
388
|
// If there is a tag list and it has selected tags, remove them, otherwise remove focused tag.
|
|
385
|
-
|
|
389
|
+
this.tagList?.selected.length ? this.tagList.removeSelected() : this.remove();
|
|
386
390
|
// Always prevent so page navigation does not occur
|
|
387
391
|
event.preventDefault();
|
|
388
392
|
break;
|
|
389
393
|
}
|
|
390
394
|
case SPACE: {
|
|
391
395
|
this.toggleSelected(true);
|
|
396
|
+
this.focusMonitor.focusVia(this.elementRef, 'keyboard');
|
|
392
397
|
// Always prevent space from scrolling the page since the list has focus
|
|
393
398
|
event.preventDefault();
|
|
394
399
|
break;
|
|
@@ -461,31 +466,21 @@ class KbqTag extends KbqColorDirective {
|
|
|
461
466
|
setupDragInitialProperties() {
|
|
462
467
|
this.syncDragDisabledState();
|
|
463
468
|
this.drag.started.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
|
464
|
-
this.drag.data = {
|
|
465
|
-
tag: this,
|
|
466
|
-
hasFocus: this.hasFocus,
|
|
467
|
-
focusOrigin: this.focusOrigin
|
|
468
|
-
};
|
|
469
|
+
this.drag.data = { tag: this };
|
|
469
470
|
});
|
|
470
471
|
}
|
|
471
472
|
syncDragDisabledState() {
|
|
472
473
|
this.drag.disabled = !this.draggable;
|
|
473
474
|
}
|
|
474
475
|
setupFocusMonitor() {
|
|
475
|
-
this.focusMonitor
|
|
476
|
-
.monitor(this.elementRef, true)
|
|
477
|
-
.pipe(
|
|
478
|
-
// Debounce to ensure correct hasFocus and focusOrigin state during drag start operations
|
|
479
|
-
debounceTime(0))
|
|
480
|
-
.subscribe((origin) => {
|
|
476
|
+
this.focusMonitor.monitor(this.elementRef, true).subscribe((origin) => {
|
|
481
477
|
if (this.disabled)
|
|
482
478
|
return;
|
|
483
|
-
this.focusOrigin = origin;
|
|
484
479
|
const hasFocus = !isNull(origin);
|
|
485
480
|
if (hasFocus !== this.hasFocus) {
|
|
486
481
|
this.hasFocus = hasFocus;
|
|
487
482
|
if (this.hasFocus) {
|
|
488
|
-
this.onFocus.next({ tag: this });
|
|
483
|
+
this.onFocus.next({ tag: this, origin });
|
|
489
484
|
if (!this.tagList)
|
|
490
485
|
this.select();
|
|
491
486
|
}
|
|
@@ -500,7 +495,7 @@ class KbqTag extends KbqColorDirective {
|
|
|
500
495
|
});
|
|
501
496
|
}
|
|
502
497
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTag, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
503
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: KbqTag, 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)", "
|
|
498
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: KbqTag, 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: `
|
|
504
499
|
<div class="kbq-tag__wrapper">
|
|
505
500
|
<ng-content select="[kbq-icon]:not([kbqTagRemove]):not([kbqTagEditSubmit])" />
|
|
506
501
|
<span #kbqTitleText class="kbq-tag__text">
|
|
@@ -522,7 +517,7 @@ class KbqTag extends KbqColorDirective {
|
|
|
522
517
|
}
|
|
523
518
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTag, decorators: [{
|
|
524
519
|
type: Component,
|
|
525
|
-
args: [{ selector: 'kbq-tag, [kbq-tag], kbq-basic-tag, [kbq-basic-tag]', exportAs: 'kbqTag', hostDirectives: [
|
|
520
|
+
args: [{ selector: 'kbq-tag, [kbq-tag], kbq-basic-tag, [kbq-basic-tag]', exportAs: 'kbqTag', hostDirectives: [CdkDrag], template: `
|
|
526
521
|
<div class="kbq-tag__wrapper">
|
|
527
522
|
<ng-content select="[kbq-icon]:not([kbqTagRemove]):not([kbqTagEditSubmit])" />
|
|
528
523
|
<span #kbqTitleText class="kbq-tag__text">
|
|
@@ -555,7 +550,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
555
550
|
'[class.kbq-tag_selectable]': 'selectable',
|
|
556
551
|
'[class.kbq-tag_draggable]': 'draggable',
|
|
557
552
|
'(dblclick)': 'handleDblClick($event)',
|
|
558
|
-
'(
|
|
553
|
+
'(click)': 'handleClick($event)',
|
|
559
554
|
'(keydown)': 'handleKeydown($event)'
|
|
560
555
|
}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [{ provide: KBQ_TITLE_TEXT_REF, useExisting: KbqTag }], 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;min-width:var(--kbq-size-xs);max-width:100%}.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.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"] }]
|
|
561
556
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { editable: [{
|
|
@@ -672,23 +667,43 @@ class KbqTagListChange {
|
|
|
672
667
|
}
|
|
673
668
|
}
|
|
674
669
|
class KbqTagList {
|
|
675
|
-
/**
|
|
670
|
+
/**
|
|
671
|
+
* Combined stream of all of the child tags' selection change events.
|
|
672
|
+
*
|
|
673
|
+
* @docs-private
|
|
674
|
+
*/
|
|
676
675
|
get tagSelectionChanges() {
|
|
677
676
|
return merge(...this.tags.map((tag) => tag.selectionChange));
|
|
678
677
|
}
|
|
679
|
-
/**
|
|
678
|
+
/**
|
|
679
|
+
* Combined stream of all of the child tags' focus change events.
|
|
680
|
+
*
|
|
681
|
+
* @docs-private
|
|
682
|
+
*/
|
|
680
683
|
get tagFocusChanges() {
|
|
681
684
|
return merge(...this.tags.map((tag) => tag.onFocus));
|
|
682
685
|
}
|
|
683
|
-
/**
|
|
686
|
+
/**
|
|
687
|
+
* Combined stream of all of the child tags' blur change events.
|
|
688
|
+
*
|
|
689
|
+
* @docs-private
|
|
690
|
+
*/
|
|
684
691
|
get tagBlurChanges() {
|
|
685
692
|
return merge(...this.tags.map((tag) => tag.onBlur));
|
|
686
693
|
}
|
|
687
|
-
/**
|
|
694
|
+
/**
|
|
695
|
+
* Combined stream of all of the child tags' remove change events.
|
|
696
|
+
*
|
|
697
|
+
* @docs-private
|
|
698
|
+
*/
|
|
688
699
|
get tagRemoveChanges() {
|
|
689
700
|
return merge(...this.tags.map((tag) => tag.destroyed));
|
|
690
701
|
}
|
|
691
|
-
/**
|
|
702
|
+
/**
|
|
703
|
+
* Combined stream of all of the child tags' edit change events.
|
|
704
|
+
*
|
|
705
|
+
* @docs-private
|
|
706
|
+
*/
|
|
692
707
|
get tagEditChanges() {
|
|
693
708
|
return merge(...this.tags.map((tag) => tag.editChange));
|
|
694
709
|
}
|
|
@@ -698,8 +713,7 @@ class KbqTagList {
|
|
|
698
713
|
* @docs-private
|
|
699
714
|
*/
|
|
700
715
|
get selected() {
|
|
701
|
-
|
|
702
|
-
return this.multiple ? selected : selected[0];
|
|
716
|
+
return this.tags.filter(({ selected }) => selected);
|
|
703
717
|
}
|
|
704
718
|
/** @docs-private */
|
|
705
719
|
get canShowCleaner() {
|
|
@@ -788,8 +802,13 @@ class KbqTagList {
|
|
|
788
802
|
this._removable = value;
|
|
789
803
|
this.syncTagsRemovableState();
|
|
790
804
|
}
|
|
805
|
+
/**
|
|
806
|
+
* Tab index of the tag list. This property is ignored when the tag list contains a tag input or is disabled.
|
|
807
|
+
*
|
|
808
|
+
* @docs-private
|
|
809
|
+
*/
|
|
791
810
|
get tabIndex() {
|
|
792
|
-
return this._tabIndex;
|
|
811
|
+
return this.disabled || this.tagInput ? null : this._tabIndex;
|
|
793
812
|
}
|
|
794
813
|
set tabIndex(value) {
|
|
795
814
|
this.userTabIndex = value;
|
|
@@ -819,9 +838,9 @@ class KbqTagList {
|
|
|
819
838
|
*/
|
|
820
839
|
this.stateChanges = new Subject();
|
|
821
840
|
/**
|
|
822
|
-
*
|
|
841
|
+
* @deprecated Unused. Will be removed in next major release.
|
|
823
842
|
*
|
|
824
|
-
*
|
|
843
|
+
* @docs-private
|
|
825
844
|
*/
|
|
826
845
|
this.multiple = false;
|
|
827
846
|
/**
|
|
@@ -910,7 +929,7 @@ class KbqTagList {
|
|
|
910
929
|
this.keyManager = new FocusKeyManager(this.tags)
|
|
911
930
|
.withVerticalOrientation()
|
|
912
931
|
.withHorizontalOrientation(this.dir ? this.dir.value : 'ltr')
|
|
913
|
-
.skipPredicate((
|
|
932
|
+
.skipPredicate(({ disabled }) => disabled);
|
|
914
933
|
if (this.dir) {
|
|
915
934
|
this.dir.change
|
|
916
935
|
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
@@ -1007,34 +1026,31 @@ class KbqTagList {
|
|
|
1007
1026
|
*
|
|
1008
1027
|
* @docs-private
|
|
1009
1028
|
*/
|
|
1010
|
-
onContainerClick(
|
|
1011
|
-
|
|
1012
|
-
this.focus();
|
|
1013
|
-
}
|
|
1029
|
+
onContainerClick() {
|
|
1030
|
+
this.focus();
|
|
1014
1031
|
}
|
|
1015
1032
|
/**
|
|
1016
|
-
* Focuses the
|
|
1017
|
-
* are no eligible tags.
|
|
1033
|
+
* Focuses the tag list. If there is a tag input, focuses that instead.
|
|
1018
1034
|
*/
|
|
1019
1035
|
focus() {
|
|
1020
|
-
if (this.disabled)
|
|
1036
|
+
if (this.disabled)
|
|
1021
1037
|
return;
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
// Focus on first element if there's no tagInput inside tag-list
|
|
1025
|
-
if (this.tagInput && this.tagInput.focused) {
|
|
1026
|
-
// do nothing
|
|
1027
|
-
}
|
|
1028
|
-
else if (this.tags.length > 0) {
|
|
1029
|
-
this.keyManager.setFirstItemActive();
|
|
1038
|
+
if (this.tagInput) {
|
|
1039
|
+
this.focusInput();
|
|
1030
1040
|
this.stateChanges.next();
|
|
1041
|
+
return;
|
|
1031
1042
|
}
|
|
1032
|
-
|
|
1033
|
-
this.
|
|
1043
|
+
if (this.tags.length > 0) {
|
|
1044
|
+
this.keyManager.setFirstItemActive();
|
|
1034
1045
|
this.stateChanges.next();
|
|
1046
|
+
return;
|
|
1035
1047
|
}
|
|
1036
1048
|
}
|
|
1037
|
-
/**
|
|
1049
|
+
/**
|
|
1050
|
+
* Focuses the tag input inside the tag list.
|
|
1051
|
+
*
|
|
1052
|
+
* @docs-private
|
|
1053
|
+
*/
|
|
1038
1054
|
focusInput() {
|
|
1039
1055
|
if (this.tagInput) {
|
|
1040
1056
|
this.tagInput.focus();
|
|
@@ -1049,16 +1065,20 @@ class KbqTagList {
|
|
|
1049
1065
|
const target = event.target;
|
|
1050
1066
|
if (this.disabled || isNull(target))
|
|
1051
1067
|
return;
|
|
1052
|
-
const
|
|
1068
|
+
const shouldSelectAll = this.selectable && isSelectAll(event);
|
|
1053
1069
|
if (this.isInputEmpty(target)) {
|
|
1054
|
-
if (event.keyCode === BACKSPACE
|
|
1070
|
+
if (event.keyCode === BACKSPACE ||
|
|
1071
|
+
event.keyCode === LEFT_ARROW ||
|
|
1072
|
+
(event.keyCode === TAB && event.shiftKey)) {
|
|
1055
1073
|
this.keyManager.setLastItemActive();
|
|
1056
1074
|
event.preventDefault();
|
|
1075
|
+
return;
|
|
1057
1076
|
}
|
|
1058
|
-
|
|
1077
|
+
if (shouldSelectAll) {
|
|
1059
1078
|
this.selectAll();
|
|
1060
1079
|
this.keyManager.setLastItemActive();
|
|
1061
1080
|
event.preventDefault();
|
|
1081
|
+
return;
|
|
1062
1082
|
}
|
|
1063
1083
|
}
|
|
1064
1084
|
else if (this.isTagElement(target)) {
|
|
@@ -1070,7 +1090,7 @@ class KbqTagList {
|
|
|
1070
1090
|
this.keyManager.setLastItemActive();
|
|
1071
1091
|
event.preventDefault();
|
|
1072
1092
|
}
|
|
1073
|
-
else if (
|
|
1093
|
+
else if (shouldSelectAll) {
|
|
1074
1094
|
this.selectAll();
|
|
1075
1095
|
this.keyManager.setLastItemActive();
|
|
1076
1096
|
event.preventDefault();
|
|
@@ -1154,12 +1174,13 @@ class KbqTagList {
|
|
|
1154
1174
|
isValidIndex(index) {
|
|
1155
1175
|
return index >= 0 && index < this.tags.length;
|
|
1156
1176
|
}
|
|
1177
|
+
isInputElement(element) {
|
|
1178
|
+
return element.nodeName.toLowerCase() === 'input';
|
|
1179
|
+
}
|
|
1157
1180
|
isInputEmpty(element) {
|
|
1158
|
-
if (
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
}
|
|
1162
|
-
return false;
|
|
1181
|
+
if (!this.isInputElement(element))
|
|
1182
|
+
return false;
|
|
1183
|
+
return !element.value;
|
|
1163
1184
|
}
|
|
1164
1185
|
isTagElement(element) {
|
|
1165
1186
|
return element.classList.contains('kbq-tag');
|
|
@@ -1181,7 +1202,7 @@ class KbqTagList {
|
|
|
1181
1202
|
* @docs-private
|
|
1182
1203
|
*/
|
|
1183
1204
|
removeSelected() {
|
|
1184
|
-
|
|
1205
|
+
this.selected.forEach((tag) => tag.remove());
|
|
1185
1206
|
}
|
|
1186
1207
|
propagateTagsChanges() {
|
|
1187
1208
|
const valueToEmit = this.tags.map((tag) => tag.value);
|
|
@@ -1194,7 +1215,6 @@ class KbqTagList {
|
|
|
1194
1215
|
resetTags() {
|
|
1195
1216
|
this.dropSubscriptions();
|
|
1196
1217
|
this.listenToTagsFocus();
|
|
1197
|
-
this.listenToTagsSelection();
|
|
1198
1218
|
this.listenToTagsRemoved();
|
|
1199
1219
|
this.listenToTagsEdit();
|
|
1200
1220
|
}
|
|
@@ -1207,10 +1227,6 @@ class KbqTagList {
|
|
|
1207
1227
|
this.tagBlurSubscription.unsubscribe();
|
|
1208
1228
|
this.tagBlurSubscription = null;
|
|
1209
1229
|
}
|
|
1210
|
-
if (this.tagSelectionSubscription) {
|
|
1211
|
-
this.tagSelectionSubscription.unsubscribe();
|
|
1212
|
-
this.tagSelectionSubscription = null;
|
|
1213
|
-
}
|
|
1214
1230
|
if (this.tagRemoveSubscription) {
|
|
1215
1231
|
this.tagRemoveSubscription.unsubscribe();
|
|
1216
1232
|
this.tagRemoveSubscription = null;
|
|
@@ -1221,31 +1237,17 @@ class KbqTagList {
|
|
|
1221
1237
|
}
|
|
1222
1238
|
}
|
|
1223
1239
|
/** Listens to user-generated selection events on each tag. */
|
|
1224
|
-
listenToTagsSelection() {
|
|
1225
|
-
this.tagSelectionSubscription = this.tagSelectionChanges.subscribe((event) => {
|
|
1226
|
-
if (!this.multiple) {
|
|
1227
|
-
this.tags.forEach((tag) => {
|
|
1228
|
-
if (tag !== event.source)
|
|
1229
|
-
tag.setSelectedState(false);
|
|
1230
|
-
});
|
|
1231
|
-
}
|
|
1232
|
-
});
|
|
1233
|
-
}
|
|
1234
|
-
/** Listens to user-generated selection events on each tag. */
|
|
1235
1240
|
listenToTagsFocus() {
|
|
1236
|
-
this.tagFocusSubscription = this.tagFocusChanges.subscribe((
|
|
1237
|
-
const tagIndex = this.tags.toArray().indexOf(
|
|
1241
|
+
this.tagFocusSubscription = this.tagFocusChanges.subscribe(({ tag, origin }) => {
|
|
1242
|
+
const tagIndex = this.tags.toArray().indexOf(tag);
|
|
1238
1243
|
if (this.isValidIndex(tagIndex)) {
|
|
1244
|
+
this.keyManager.setFocusOrigin(origin);
|
|
1239
1245
|
this.keyManager.updateActiveItem(tagIndex);
|
|
1240
1246
|
}
|
|
1241
|
-
if (!this.multiple)
|
|
1242
|
-
event.tag.select();
|
|
1243
1247
|
this.stateChanges.next();
|
|
1244
1248
|
});
|
|
1245
|
-
this.tagBlurSubscription = this.tagBlurChanges.subscribe((
|
|
1249
|
+
this.tagBlurSubscription = this.tagBlurChanges.subscribe(() => {
|
|
1246
1250
|
this.blur();
|
|
1247
|
-
if (!this.multiple)
|
|
1248
|
-
event.tag.deselect();
|
|
1249
1251
|
this.stateChanges.next();
|
|
1250
1252
|
});
|
|
1251
1253
|
}
|
|
@@ -1266,17 +1268,6 @@ class KbqTagList {
|
|
|
1266
1268
|
.pipe(filter(({ type }) => type === 'submit'))
|
|
1267
1269
|
.subscribe(() => this.propagateTagsChanges());
|
|
1268
1270
|
}
|
|
1269
|
-
/** Checks whether an event comes from inside a tag element. */
|
|
1270
|
-
originatesFromTag(event) {
|
|
1271
|
-
let currentElement = event.target;
|
|
1272
|
-
while (currentElement && currentElement !== this.elementRef.nativeElement) {
|
|
1273
|
-
if (this.isTagElement(currentElement)) {
|
|
1274
|
-
return true;
|
|
1275
|
-
}
|
|
1276
|
-
currentElement = currentElement.parentElement;
|
|
1277
|
-
}
|
|
1278
|
-
return false;
|
|
1279
|
-
}
|
|
1280
1271
|
/** Checks whether any of the tags is focused. */
|
|
1281
1272
|
hasFocusedTag() {
|
|
1282
1273
|
return this.tags.some((tag) => tag.hasFocus);
|
|
@@ -1299,14 +1290,8 @@ class KbqTagList {
|
|
|
1299
1290
|
this.dropList.dropped
|
|
1300
1291
|
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
1301
1292
|
.subscribe(({ currentIndex, previousIndex, event, item }) => {
|
|
1302
|
-
const { tag
|
|
1293
|
+
const { tag } = item.data;
|
|
1303
1294
|
this.dropped.emit({ currentIndex, previousIndex, event, tag });
|
|
1304
|
-
if (this.tagInput) {
|
|
1305
|
-
return this.tagInput.focus();
|
|
1306
|
-
}
|
|
1307
|
-
if (hasFocus) {
|
|
1308
|
-
return setTimeout(() => this.focusMonitor.focusVia(tag.nativeElement, focusOrigin));
|
|
1309
|
-
}
|
|
1310
1295
|
});
|
|
1311
1296
|
}
|
|
1312
1297
|
syncDropListDisabledState() {
|
|
@@ -1319,7 +1304,7 @@ class KbqTagList {
|
|
|
1319
1304
|
});
|
|
1320
1305
|
}
|
|
1321
1306
|
/** @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 }); }
|
|
1322
|
-
/** @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-
|
|
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: `
|
|
1323
1308
|
<div class="kbq-tags-list__list-container">
|
|
1324
1309
|
<ng-content />
|
|
1325
1310
|
</div>
|
|
@@ -1329,7 +1314,7 @@ class KbqTagList {
|
|
|
1329
1314
|
<ng-content select="kbq-cleaner" />
|
|
1330
1315
|
</div>
|
|
1331
1316
|
}
|
|
1332
|
-
`, 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{
|
|
1317
|
+
`, 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;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::-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.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-line-warning);--kbq-tag-warning-fade-states-selected-background: var(--kbq-background-warning);--kbq-tag-warning-fade-states-selected-text: var(--kbq-foreground-white);--kbq-tag-warning-fade-states-selected-icon: var(--kbq-icon-white);--kbq-tag-warning-fade-states-selected-close-button: var(--kbq-icon-white);--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 }); }
|
|
1333
1318
|
}
|
|
1334
1319
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTagList, decorators: [{
|
|
1335
1320
|
type: Component,
|
|
@@ -1347,17 +1332,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
1347
1332
|
class: 'kbq-tag-list',
|
|
1348
1333
|
'[class.kbq-disabled]': 'disabled',
|
|
1349
1334
|
'[class.kbq-invalid]': 'errorState',
|
|
1350
|
-
'[class.kbq-tag-list_multiple]': 'multiple',
|
|
1351
1335
|
'[class.kbq-tag-list_selectable]': 'selectable',
|
|
1352
1336
|
'[class.kbq-tag-list_editable]': 'editable',
|
|
1353
1337
|
'[class.kbq-tag-list_removable]': 'removable',
|
|
1354
1338
|
'[class.kbq-tag-list_draggable]': 'draggable',
|
|
1355
|
-
'[attr.tabindex]': '
|
|
1339
|
+
'[attr.tabindex]': 'tabIndex',
|
|
1356
1340
|
'[id]': 'uid',
|
|
1357
1341
|
'(focus)': 'focus()',
|
|
1358
1342
|
'(blur)': 'blur()',
|
|
1359
1343
|
'(keydown)': 'keydown($event)'
|
|
1360
|
-
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: KbqFormFieldControl, useExisting: KbqTagList }], hostDirectives: [CdkDropList], 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{
|
|
1344
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: KbqFormFieldControl, useExisting: KbqTagList }], hostDirectives: [CdkDropList], 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;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::-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.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-line-warning);--kbq-tag-warning-fade-states-selected-background: var(--kbq-background-warning);--kbq-tag-warning-fade-states-selected-text: var(--kbq-foreground-white);--kbq-tag-warning-fade-states-selected-icon: var(--kbq-icon-white);--kbq-tag-warning-fade-states-selected-close-button: var(--kbq-icon-white);--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"] }]
|
|
1361
1345
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1.ErrorStateMatcher }, { type: i2$1.Directionality, decorators: [{
|
|
1362
1346
|
type: Optional
|
|
1363
1347
|
}] }, { type: i3.NgForm, decorators: [{
|
|
@@ -1420,7 +1404,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
1420
1404
|
|
|
1421
1405
|
const KbqTagInputDefaultSeparators = {
|
|
1422
1406
|
[ENTER$1]: { symbol: /\r?\n/, key: 'Enter' },
|
|
1423
|
-
[TAB]: { symbol: /\t/, key: 'Tab' },
|
|
1407
|
+
[TAB$1]: { symbol: /\t/, key: 'Tab' },
|
|
1424
1408
|
[SPACE$1]: { symbol: / /, key: ' ' },
|
|
1425
1409
|
[COMMA]: { symbol: /,/, key: ',' },
|
|
1426
1410
|
[SEMICOLON]: { symbol: /;/, key: ';' }
|
|
@@ -1482,9 +1466,8 @@ class KbqTagInput {
|
|
|
1482
1466
|
get empty() {
|
|
1483
1467
|
return !this.inputElement.value;
|
|
1484
1468
|
}
|
|
1485
|
-
constructor(elementRef,
|
|
1469
|
+
constructor(elementRef, defaultOptions, trimDirective, ngControl, autocompleteTrigger) {
|
|
1486
1470
|
this.elementRef = elementRef;
|
|
1487
|
-
this.renderer = renderer;
|
|
1488
1471
|
this.defaultOptions = defaultOptions;
|
|
1489
1472
|
this.trimDirective = trimDirective;
|
|
1490
1473
|
this.ngControl = ngControl;
|
|
@@ -1502,18 +1485,25 @@ class KbqTagInput {
|
|
|
1502
1485
|
this.id = `kbq-tag-list-input-${nextUniqueId++}`;
|
|
1503
1486
|
this._addOnBlur = true;
|
|
1504
1487
|
this._disabled = false;
|
|
1488
|
+
/**
|
|
1489
|
+
* @docs-private
|
|
1490
|
+
*
|
|
1491
|
+
* @deprecated Unused. Will be removed in next major release.
|
|
1492
|
+
*/
|
|
1505
1493
|
this.countOfSymbolsForUpdateWidth = 3;
|
|
1506
1494
|
this.inputElement = this.elementRef.nativeElement;
|
|
1507
|
-
this.setDefaultInputWidth();
|
|
1508
1495
|
this._separators = this.defaultOptions.separators || KbqTagInputDefaultSeparators;
|
|
1509
1496
|
this._addOnPaste = isBoolean(this.defaultOptions.addOnPaste) ? this.defaultOptions.addOnPaste : true;
|
|
1510
1497
|
}
|
|
1511
1498
|
ngOnChanges() {
|
|
1512
1499
|
this._tagList.stateChanges.next();
|
|
1513
1500
|
}
|
|
1501
|
+
/** @docs-private */
|
|
1514
1502
|
onKeydown(event) {
|
|
1515
1503
|
if (!this.inputElement.value) {
|
|
1516
1504
|
this._tagList.keydown(event);
|
|
1505
|
+
event.stopPropagation();
|
|
1506
|
+
return;
|
|
1517
1507
|
}
|
|
1518
1508
|
if (this.isSeparatorKey(event) && this.inputElement.value) {
|
|
1519
1509
|
this.emitTagEnd();
|
|
@@ -1545,7 +1535,6 @@ class KbqTagInput {
|
|
|
1545
1535
|
if (this.distinct && this.hasDuplicates)
|
|
1546
1536
|
return;
|
|
1547
1537
|
this.tagEnd.emit({ input: this.inputElement, value: this.trimValue(this.inputElement.value) });
|
|
1548
|
-
this.updateInputWidth();
|
|
1549
1538
|
}
|
|
1550
1539
|
}
|
|
1551
1540
|
get hasDuplicates() {
|
|
@@ -1554,7 +1543,6 @@ class KbqTagInput {
|
|
|
1554
1543
|
.some((tagValue) => tagValue === this.trimValue(this.inputElement.value));
|
|
1555
1544
|
}
|
|
1556
1545
|
onInput() {
|
|
1557
|
-
this.updateInputWidth();
|
|
1558
1546
|
// Let tag list know whenever the value changes.
|
|
1559
1547
|
this._tagList.stateChanges.next();
|
|
1560
1548
|
}
|
|
@@ -1579,22 +1567,15 @@ class KbqTagInput {
|
|
|
1579
1567
|
items
|
|
1580
1568
|
.filter((item) => !tagValues.includes(item))
|
|
1581
1569
|
.forEach((item) => this.tagEnd.emit({ input: this.inputElement, value: item }));
|
|
1582
|
-
this.updateInputWidth();
|
|
1583
1570
|
$event.preventDefault();
|
|
1584
1571
|
$event.stopPropagation();
|
|
1585
1572
|
}
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
this.renderer.setStyle(this.inputElement, 'width', `${length * this.oneSymbolWidth}px`);
|
|
1593
|
-
}
|
|
1594
|
-
else {
|
|
1595
|
-
this.setDefaultInputWidth();
|
|
1596
|
-
}
|
|
1597
|
-
}
|
|
1573
|
+
/**
|
|
1574
|
+
* @docs-private
|
|
1575
|
+
*
|
|
1576
|
+
* @deprecated Unused. Will be removed in next major release.
|
|
1577
|
+
*/
|
|
1578
|
+
updateInputWidth() { }
|
|
1598
1579
|
/** @docs-private */
|
|
1599
1580
|
onFocus() {
|
|
1600
1581
|
this.focused = true;
|
|
@@ -1623,15 +1604,12 @@ class KbqTagInput {
|
|
|
1623
1604
|
hasControl() {
|
|
1624
1605
|
return !!this.ngControl;
|
|
1625
1606
|
}
|
|
1626
|
-
setDefaultInputWidth() {
|
|
1627
|
-
this.renderer.setStyle(this.inputElement, 'width', '30px');
|
|
1628
|
-
}
|
|
1629
1607
|
/** Checks whether a keycode is one of the configured separators. */
|
|
1630
1608
|
isSeparatorKey(event) {
|
|
1631
1609
|
return this.separators.some((separator) => separator.key === event.key && !event.shiftKey);
|
|
1632
1610
|
}
|
|
1633
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTagInput, deps: [{ token: i0.ElementRef }, { token:
|
|
1634
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.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"], 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, ngImport: i0 }); }
|
|
1611
|
+
/** @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: "14.0.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"], 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 }); }
|
|
1635
1613
|
}
|
|
1636
1614
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTagInput, decorators: [{
|
|
1637
1615
|
type: Directive,
|
|
@@ -1648,9 +1626,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
1648
1626
|
'(focus)': 'onFocus()',
|
|
1649
1627
|
'(input)': 'onInput()',
|
|
1650
1628
|
'(paste)': 'onPaste($event)'
|
|
1651
|
-
}
|
|
1629
|
+
},
|
|
1630
|
+
hostDirectives: [KbqFieldSizingContent]
|
|
1652
1631
|
}]
|
|
1653
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type:
|
|
1632
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: undefined, decorators: [{
|
|
1654
1633
|
type: Inject,
|
|
1655
1634
|
args: [KBQ_TAGS_DEFAULT_OPTIONS]
|
|
1656
1635
|
}] }, { type: i1$1.KbqTrim, decorators: [{
|