@koobiq/components 18.35.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/accordion/accordion.component.d.ts +1 -1
- package/app-switcher/_app-switcher-theme.scss +34 -0
- package/app-switcher/app-switcher-animations.d.ts +5 -0
- package/app-switcher/app-switcher-dropdown-app.d.ts +11 -0
- package/app-switcher/app-switcher-dropdown-app.scss +85 -0
- package/app-switcher/app-switcher-dropdown-site.d.ts +9 -0
- package/app-switcher/app-switcher-dropdown-site.scss +53 -0
- package/app-switcher/app-switcher.d.ts +191 -0
- package/app-switcher/app-switcher.module.d.ts +10 -0
- package/app-switcher/app-switcher.scss +64 -0
- package/app-switcher/index.d.ts +1 -0
- package/app-switcher/kbq-app-switcher-list-item.d.ts +16 -0
- package/app-switcher/kbq-app-switcher-list-item.scss +180 -0
- package/app-switcher/public-api.d.ts +6 -0
- package/autocomplete/autocomplete.scss +2 -17
- package/badge/badge.component.d.ts +1 -1
- package/badge/badge.component.scss +2 -0
- package/breadcrumbs/breadcrumbs.d.ts +2 -1
- package/breadcrumbs/breadcrumbs.scss +8 -4
- package/button/button.component.d.ts +3 -2
- 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/clipboard.d.ts +1 -1
- package/core/common-behaviors/color.d.ts +5 -5
- package/core/common-behaviors/focus-monitor.d.ts +19 -0
- package/core/common-behaviors/hover.d.ts +15 -0
- package/core/common-behaviors/index.d.ts +4 -0
- package/core/common-behaviors/orientation.d.ts +4 -0
- package/core/common-behaviors/read-state.d.ts +12 -0
- package/core/locales/en-US.d.ts +62 -0
- package/core/locales/es-LA.d.ts +62 -0
- package/core/locales/formatters.d.ts +0 -72
- package/core/locales/index.d.ts +0 -2
- package/core/locales/locale-service.d.ts +292 -250
- package/core/locales/pt-BR.d.ts +62 -0
- package/core/locales/ru-RU.d.ts +62 -0
- package/core/locales/tk-TM.d.ts +62 -0
- package/core/locales/types.d.ts +22 -0
- package/core/navbar/rectangle-item.d.ts +1 -1
- package/core/option/action.d.ts +1 -1
- package/core/option/option.d.ts +3 -2
- package/core/pop-up/constants.d.ts +2 -1
- package/core/pop-up/pop-up-trigger.d.ts +3 -3
- package/core/pop-up/pop-up.d.ts +2 -1
- package/core/select/common.d.ts +6 -1
- package/core/select/constants.d.ts +5 -0
- package/core/styles/common/_select.scss +25 -0
- package/core/styles/typography/_typography.scss +23 -82
- package/core/utils/dom.d.ts +1 -6
- package/datepicker/datepicker-module.d.ts +2 -1
- package/divider/divider.scss +1 -0
- package/dropdown/dropdown-item.scss +8 -7
- package/dropdown/dropdown.component.d.ts +5 -1
- package/dropdown/dropdown.module.d.ts +1 -1
- package/dropdown/dropdown.scss +5 -14
- package/esm2022/accordion/accordion-content.mjs +3 -3
- package/esm2022/accordion/accordion-header.mjs +3 -3
- package/esm2022/accordion/accordion-item.mjs +3 -3
- package/esm2022/accordion/accordion-trigger.component.mjs +3 -3
- package/esm2022/accordion/accordion.component.mjs +5 -5
- package/esm2022/accordion/accordion.module.mjs +4 -4
- package/esm2022/actions-panel/actions-panel-container.mjs +3 -3
- package/esm2022/actions-panel/actions-panel.mjs +3 -3
- package/esm2022/actions-panel/module.mjs +4 -4
- package/esm2022/alert/alert.component.mjs +12 -12
- package/esm2022/alert/alert.module.mjs +4 -4
- package/esm2022/app-switcher/app-switcher-animations.mjs +18 -0
- package/esm2022/app-switcher/app-switcher-dropdown-app.mjs +75 -0
- package/esm2022/app-switcher/app-switcher-dropdown-site.mjs +60 -0
- package/esm2022/app-switcher/app-switcher.mjs +446 -0
- package/esm2022/app-switcher/app-switcher.module.mjs +45 -0
- package/esm2022/app-switcher/index.mjs +2 -0
- package/esm2022/app-switcher/kbq-app-switcher-list-item.mjs +84 -0
- package/esm2022/app-switcher/koobiq-components-app-switcher.mjs +5 -0
- package/esm2022/app-switcher/public-api.mjs +7 -0
- package/esm2022/autocomplete/autocomplete-origin.directive.mjs +3 -3
- package/esm2022/autocomplete/autocomplete-trigger.directive.mjs +7 -7
- package/esm2022/autocomplete/autocomplete.component.mjs +3 -3
- package/esm2022/autocomplete/autocomplete.module.mjs +4 -4
- package/esm2022/badge/badge.component.mjs +11 -11
- package/esm2022/badge/badge.module.mjs +4 -4
- package/esm2022/breadcrumbs/breadcrumbs.mjs +58 -49
- package/esm2022/breadcrumbs/breadcrumbs.module.mjs +4 -4
- package/esm2022/button/button.component.mjs +12 -10
- package/esm2022/button/button.dropdown-trigger.directive.mjs +3 -3
- package/esm2022/button/button.module.mjs +4 -4
- package/esm2022/button-toggle/button-toggle.component.mjs +8 -8
- package/esm2022/button-toggle/button-toggle.module.mjs +4 -4
- package/esm2022/checkbox/checkbox-module.mjs +4 -4
- package/esm2022/checkbox/checkbox-required-validator.mjs +3 -3
- package/esm2022/checkbox/checkbox.mjs +3 -3
- package/esm2022/clamped-text/clamped-text.mjs +3 -3
- package/esm2022/clamped-text/module.mjs +4 -4
- package/esm2022/code-block/code-block-highlight.mjs +12 -7
- package/esm2022/code-block/code-block.mjs +4 -4
- package/esm2022/code-block/code-block.module.mjs +4 -4
- package/esm2022/content-panel/content-panel.mjs +26 -26
- package/esm2022/content-panel/index.mjs +1 -2
- package/esm2022/content-panel/module.mjs +4 -4
- package/esm2022/core/common-behaviors/clipboard.mjs +4 -4
- package/esm2022/core/common-behaviors/color.mjs +7 -7
- package/esm2022/core/common-behaviors/common-module.mjs +6 -5
- package/esm2022/core/common-behaviors/disabled.mjs +2 -1
- package/esm2022/core/common-behaviors/error-state.mjs +2 -1
- package/esm2022/core/common-behaviors/focus-monitor.mjs +37 -0
- package/esm2022/core/common-behaviors/hover.mjs +34 -0
- package/esm2022/core/common-behaviors/index.mjs +5 -1
- package/esm2022/core/common-behaviors/orientation.mjs +2 -0
- package/esm2022/core/common-behaviors/read-state.mjs +33 -0
- package/esm2022/core/common-behaviors/tabindex.mjs +2 -1
- package/esm2022/core/error/error-state-matcher.mjs +9 -9
- package/esm2022/core/form-field/field-sizing-content.mjs +8 -5
- package/esm2022/core/formatters/date/formatter.mjs +3 -3
- package/esm2022/core/formatters/date/formatter.pipe.mjs +78 -78
- package/esm2022/core/formatters/filesize/formatter.mjs +3 -3
- package/esm2022/core/formatters/index.mjs +4 -4
- package/esm2022/core/formatters/number/formatter.mjs +14 -14
- package/esm2022/core/forms/forms-module.mjs +4 -4
- package/esm2022/core/forms/forms.directive.mjs +6 -6
- package/esm2022/core/highlight/highlight.pipe.mjs +3 -3
- package/esm2022/core/highlight/index.mjs +4 -4
- package/esm2022/core/line/line.mjs +7 -7
- package/esm2022/core/locales/en-US.mjs +105 -1
- package/esm2022/core/locales/es-LA.mjs +114 -10
- package/esm2022/core/locales/formatters.mjs +1 -73
- package/esm2022/core/locales/index.mjs +1 -3
- package/esm2022/core/locales/locale-service.mjs +5 -11
- package/esm2022/core/locales/locale-service.module.mjs +4 -4
- package/esm2022/core/locales/pt-BR.mjs +123 -19
- package/esm2022/core/locales/ru-RU.mjs +119 -1
- package/esm2022/core/locales/tk-TM.mjs +128 -24
- package/esm2022/core/locales/types.mjs +1 -1
- package/esm2022/core/navbar/rectangle-item.mjs +7 -6
- package/esm2022/core/option/action-container.mjs +3 -3
- package/esm2022/core/option/action.mjs +4 -4
- package/esm2022/core/option/optgroup.mjs +3 -3
- package/esm2022/core/option/option-module.mjs +4 -4
- package/esm2022/core/option/option.mjs +13 -9
- package/esm2022/core/pop-up/constants.mjs +2 -1
- package/esm2022/core/pop-up/pop-up-trigger.mjs +7 -6
- package/esm2022/core/pop-up/pop-up.mjs +4 -4
- package/esm2022/core/select/common.mjs +35 -19
- package/esm2022/core/select/constants.mjs +6 -1
- package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +3 -3
- package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.module.mjs +4 -4
- package/esm2022/core/services/measure-scrollbar.service.mjs +3 -3
- package/esm2022/core/services/theme.service.mjs +3 -3
- package/esm2022/core/utils/dom.mjs +2 -8
- package/esm2022/core/version.mjs +2 -2
- package/esm2022/datepicker/calendar-body.component.mjs +3 -3
- package/esm2022/datepicker/calendar-header.component.mjs +7 -6
- package/esm2022/datepicker/calendar.component.mjs +3 -3
- package/esm2022/datepicker/datepicker-input.directive.mjs +6 -6
- package/esm2022/datepicker/datepicker-intl.mjs +3 -3
- package/esm2022/datepicker/datepicker-module.mjs +11 -8
- package/esm2022/datepicker/datepicker-toggle.component.mjs +9 -9
- package/esm2022/datepicker/datepicker.component.mjs +6 -6
- package/esm2022/datepicker/month-view.component.mjs +3 -3
- package/esm2022/divider/divider.component.mjs +4 -4
- package/esm2022/divider/divider.module.mjs +4 -4
- package/esm2022/dl/dl.component.mjs +9 -9
- package/esm2022/dl/dl.module.mjs +4 -4
- package/esm2022/dropdown/dropdown-content.directive.mjs +3 -3
- package/esm2022/dropdown/dropdown-item.component.mjs +5 -5
- package/esm2022/dropdown/dropdown-trigger.directive.mjs +5 -5
- package/esm2022/dropdown/dropdown.component.mjs +18 -8
- package/esm2022/dropdown/dropdown.module.mjs +14 -10
- package/esm2022/dynamic-translation/dynamic-translation.mjs +9 -9
- package/esm2022/dynamic-translation/module.mjs +4 -4
- package/esm2022/ellipsis-center/ellipsis-center.directive.mjs +12 -9
- package/esm2022/empty-state/empty-state.component.mjs +15 -15
- package/esm2022/empty-state/empty-state.module.mjs +4 -4
- package/esm2022/file-upload/file-drop.mjs +7 -5
- package/esm2022/file-upload/file-upload.mjs +1 -1
- package/esm2022/file-upload/file-upload.module.mjs +4 -4
- package/esm2022/file-upload/multiple-file-upload.component.mjs +20 -13
- package/esm2022/file-upload/single-file-upload.component.mjs +19 -6
- package/esm2022/filter-bar/filter-bar-button.mjs +3 -3
- package/esm2022/filter-bar/filter-bar.mjs +8 -4
- package/esm2022/filter-bar/filter-bar.module.mjs +4 -4
- package/esm2022/filter-bar/filter-refresher.mjs +3 -3
- package/esm2022/filter-bar/filter-reset.mjs +3 -3
- package/esm2022/filter-bar/filter-search.mjs +6 -6
- package/esm2022/filter-bar/filters.mjs +12 -7
- package/esm2022/filter-bar/pipe-add.mjs +6 -5
- package/esm2022/filter-bar/pipe.directive.mjs +3 -3
- package/esm2022/filter-bar/pipes/base-pipe.mjs +17 -9
- package/esm2022/filter-bar/pipes/pipe-button.mjs +3 -3
- package/esm2022/filter-bar/pipes/pipe-date.mjs +6 -6
- package/esm2022/filter-bar/pipes/pipe-datetime.mjs +6 -6
- package/esm2022/filter-bar/pipes/pipe-multi-select.mjs +15 -9
- package/esm2022/filter-bar/pipes/pipe-multi-tree-select.mjs +12 -7
- package/esm2022/filter-bar/pipes/pipe-readonly.mjs +6 -6
- package/esm2022/filter-bar/pipes/pipe-select.mjs +6 -6
- package/esm2022/filter-bar/pipes/pipe-state.mjs +3 -3
- package/esm2022/filter-bar/pipes/pipe-text.mjs +6 -6
- package/esm2022/filter-bar/pipes/pipe-title.mjs +26 -21
- package/esm2022/filter-bar/pipes/pipe-tree-select.mjs +6 -6
- package/esm2022/form-field/cleaner.mjs +3 -3
- package/esm2022/form-field/error.mjs +3 -3
- package/esm2022/form-field/fieldset.mjs +11 -11
- package/esm2022/form-field/form-field.mjs +11 -11
- package/esm2022/form-field/form-field.module.mjs +4 -4
- package/esm2022/form-field/hint.mjs +3 -3
- package/esm2022/form-field/label.mjs +3 -3
- package/esm2022/form-field/password-hint.mjs +3 -3
- package/esm2022/form-field/password-toggle.mjs +7 -7
- package/esm2022/form-field/prefix.mjs +3 -3
- package/esm2022/form-field/reactive-password-hint.mjs +3 -3
- package/esm2022/form-field/stepper.mjs +44 -13
- package/esm2022/form-field/suffix.mjs +3 -3
- package/esm2022/form-field/validate.directive.mjs +3 -3
- package/esm2022/icon/icon-button.component.mjs +3 -3
- package/esm2022/icon/icon-item.component.mjs +3 -3
- package/esm2022/icon/icon.component.mjs +4 -4
- package/esm2022/icon/icon.module.mjs +4 -4
- package/esm2022/inline-edit/index.mjs +3 -0
- package/esm2022/inline-edit/inline-edit.mjs +382 -0
- package/esm2022/inline-edit/koobiq-components-inline-edit.mjs +5 -0
- package/esm2022/inline-edit/module.mjs +25 -0
- package/esm2022/input/input-number-validators.mjs +6 -6
- package/esm2022/input/input-number.mjs +10 -9
- package/esm2022/input/input-password.mjs +4 -4
- package/esm2022/input/input.mjs +7 -7
- package/esm2022/input/input.module.mjs +11 -8
- package/esm2022/link/link.component.mjs +6 -6
- package/esm2022/link/link.module.mjs +4 -4
- package/esm2022/list/list-selection.component.mjs +40 -24
- package/esm2022/list/list.component.mjs +6 -6
- package/esm2022/list/list.module.mjs +4 -4
- package/esm2022/loader-overlay/loader-overlay.component.mjs +13 -13
- package/esm2022/loader-overlay/loader-overlay.module.mjs +4 -4
- package/esm2022/markdown/markdown.component.mjs +10 -10
- package/esm2022/markdown/markdown.module.mjs +4 -4
- package/esm2022/markdown/markdown.service.mjs +3 -3
- package/esm2022/modal/css-unit.pipe.mjs +3 -3
- package/esm2022/modal/modal-control.service.mjs +3 -3
- package/esm2022/modal/modal-util.mjs +7 -3
- package/esm2022/modal/modal.component.mjs +5 -5
- package/esm2022/modal/modal.directive.mjs +12 -12
- package/esm2022/modal/modal.module.mjs +4 -4
- package/esm2022/modal/modal.service.mjs +5 -4
- package/esm2022/navbar/navbar-item.component.mjs +53 -44
- package/esm2022/navbar/navbar.component.mjs +17 -13
- package/esm2022/navbar/navbar.module.mjs +4 -4
- package/esm2022/navbar/vertical-navbar.component.mjs +6 -6
- package/esm2022/navbar-ic/navbar-ic-header.mjs +25 -9
- package/esm2022/navbar-ic/navbar-ic-item.mjs +35 -44
- package/esm2022/navbar-ic/navbar-ic.animation.mjs +10 -2
- package/esm2022/navbar-ic/navbar-ic.mjs +50 -21
- package/esm2022/navbar-ic/navbar-ic.module.mjs +4 -4
- package/esm2022/notification-center/index.mjs +2 -0
- package/esm2022/notification-center/koobiq-components-notification-center.mjs +5 -0
- package/esm2022/notification-center/notification-center-animations.mjs +18 -0
- package/esm2022/notification-center/notification-center.mjs +353 -0
- package/esm2022/notification-center/notification-center.module.mjs +38 -0
- package/esm2022/notification-center/notification-center.service.mjs +127 -0
- package/esm2022/notification-center/notification-item.mjs +70 -0
- package/esm2022/notification-center/public-api.mjs +5 -0
- package/esm2022/overflow-items/module.mjs +4 -4
- package/esm2022/overflow-items/overflow-items.mjs +95 -41
- package/esm2022/popover/popover-confirm.component.mjs +10 -10
- package/esm2022/popover/popover.component.mjs +31 -13
- package/esm2022/popover/popover.module.mjs +4 -4
- package/esm2022/progress-bar/progress-bar.component.mjs +9 -9
- package/esm2022/progress-bar/progress-bar.module.mjs +4 -4
- package/esm2022/progress-spinner/progress-spinner.component.mjs +9 -9
- package/esm2022/progress-spinner/progress-spinner.module.mjs +4 -4
- package/esm2022/radio/radio.component.mjs +6 -6
- package/esm2022/radio/radio.module.mjs +4 -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/risk-level/risk-level.component.mjs +3 -3
- package/esm2022/risk-level/risk-level.module.mjs +4 -4
- package/esm2022/scrollbar/scrollbar.component.mjs +3 -3
- package/esm2022/scrollbar/scrollbar.directive.mjs +7 -6
- package/esm2022/scrollbar/scrollbar.module.mjs +4 -4
- package/esm2022/search-expandable/index.mjs +2 -0
- package/esm2022/search-expandable/koobiq-components-search-expandable.mjs +5 -0
- package/esm2022/search-expandable/public-api.mjs +3 -0
- package/esm2022/search-expandable/search-expandable.mjs +177 -0
- package/esm2022/search-expandable/search-expandable.module.mjs +18 -0
- package/esm2022/select/select-option.directive.mjs +3 -3
- package/esm2022/select/select.component.mjs +38 -23
- package/esm2022/select/select.module.mjs +12 -8
- package/esm2022/sidebar/sidebar.component.mjs +9 -9
- package/esm2022/sidebar/sidebar.module.mjs +4 -4
- package/esm2022/sidepanel/sidepanel-container.component.mjs +5 -5
- package/esm2022/sidepanel/sidepanel-directives.mjs +15 -15
- package/esm2022/sidepanel/sidepanel.module.mjs +4 -4
- package/esm2022/sidepanel/sidepanel.service.mjs +3 -3
- package/esm2022/split-button/index.mjs +2 -0
- package/esm2022/split-button/koobiq-components-split-button.mjs +5 -0
- package/esm2022/split-button/public-api.mjs +3 -0
- package/esm2022/split-button/split-button.mjs +133 -0
- package/esm2022/split-button/split-button.module.mjs +18 -0
- package/esm2022/splitter/splitter.component.mjs +13 -13
- package/esm2022/splitter/splitter.module.mjs +4 -4
- package/esm2022/table/table.component.mjs +6 -6
- package/esm2022/table/table.module.mjs +4 -4
- package/esm2022/tabs/paginated-tab-header.mjs +4 -4
- package/esm2022/tabs/tab-body.component.mjs +6 -6
- package/esm2022/tabs/tab-content.directive.mjs +3 -3
- package/esm2022/tabs/tab-group.component.mjs +15 -15
- package/esm2022/tabs/tab-header.component.mjs +4 -4
- package/esm2022/tabs/tab-label-wrapper.directive.mjs +4 -4
- package/esm2022/tabs/tab-label.directive.mjs +3 -3
- package/esm2022/tabs/tab-nav-bar.mjs +10 -10
- package/esm2022/tabs/tab.component.mjs +3 -3
- package/esm2022/tabs/tabs.module.mjs +4 -4
- package/esm2022/tags/tag-input.mjs +38 -36
- package/esm2022/tags/tag-list.component.mjs +281 -250
- package/esm2022/tags/tag.component.mjs +206 -140
- package/esm2022/tags/tag.module.mjs +4 -4
- package/esm2022/textarea/textarea.component.mjs +5 -5
- package/esm2022/textarea/textarea.module.mjs +7 -6
- package/esm2022/time-range/constants.mjs +42 -0
- package/esm2022/time-range/index.mjs +8 -0
- package/esm2022/time-range/koobiq-components-time-range.mjs +5 -0
- package/esm2022/time-range/module.mjs +36 -0
- package/esm2022/time-range/time-range-editor.mjs +224 -0
- package/esm2022/time-range/time-range-title-as-form-field.mjs +60 -0
- package/esm2022/time-range/time-range-title.mjs +112 -0
- package/esm2022/time-range/time-range.mjs +234 -0
- package/esm2022/time-range/time-range.service.mjs +126 -0
- package/esm2022/time-range/types.mjs +2 -0
- package/esm2022/timepicker/timepicker.directive.mjs +4 -4
- package/esm2022/timepicker/timepicker.module.mjs +9 -8
- package/esm2022/timezone/cities-by-filter.pipe.mjs +3 -3
- package/esm2022/timezone/timezone-option.component.mjs +5 -5
- package/esm2022/timezone/timezone-option.directive.mjs +3 -3
- package/esm2022/timezone/timezone-select.component.mjs +9 -9
- package/esm2022/timezone/timezone.module.mjs +10 -8
- package/esm2022/timezone/utc-offset.pipe.mjs +3 -3
- package/esm2022/title/title.directive.mjs +9 -5
- package/esm2022/title/title.module.mjs +4 -4
- package/esm2022/toast/toast-container.component.mjs +3 -3
- package/esm2022/toast/toast.component.mjs +20 -14
- package/esm2022/toast/toast.module.mjs +4 -4
- package/esm2022/toast/toast.service.mjs +5 -4
- package/esm2022/toast/toast.type.mjs +1 -1
- package/esm2022/toggle/toggle.component.mjs +6 -6
- package/esm2022/toggle/toggle.module.mjs +4 -4
- package/esm2022/tooltip/tooltip.component.mjs +19 -19
- package/esm2022/tooltip/tooltip.module.mjs +4 -4
- package/esm2022/top-bar/module.mjs +4 -4
- package/esm2022/top-bar/top-bar.mjs +11 -11
- package/esm2022/tree/node.mjs +3 -3
- package/esm2022/tree/outlet.mjs +3 -3
- package/esm2022/tree/padding.directive.mjs +3 -3
- package/esm2022/tree/toggle.mjs +16 -12
- package/esm2022/tree/tree-base.mjs +7 -7
- package/esm2022/tree/tree-option.component.mjs +11 -14
- package/esm2022/tree/tree-selection.component.mjs +26 -16
- package/esm2022/tree/tree.mjs +3 -3
- package/esm2022/tree/tree.module.mjs +4 -4
- package/esm2022/tree-select/tree-select.component.mjs +142 -84
- package/esm2022/tree-select/tree-select.module.mjs +11 -8
- package/esm2022/username/module.mjs +4 -4
- package/esm2022/username/username.mjs +15 -15
- package/esm2022/username/username.pipe.mjs +8 -8
- package/fesm2022/koobiq-components-accordion.mjs +20 -20
- 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 +704 -0
- package/fesm2022/koobiq-components-app-switcher.mjs.map +1 -0
- package/fesm2022/koobiq-components-autocomplete.mjs +16 -16
- package/fesm2022/koobiq-components-autocomplete.mjs.map +1 -1
- package/fesm2022/koobiq-components-badge.mjs +14 -14
- package/fesm2022/koobiq-components-badge.mjs.map +1 -1
- package/fesm2022/koobiq-components-breadcrumbs.mjs +61 -52
- package/fesm2022/koobiq-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/koobiq-components-button-toggle.mjs +12 -12
- package/fesm2022/koobiq-components-button-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-button.mjs +18 -16
- package/fesm2022/koobiq-components-button.mjs.map +1 -1
- package/fesm2022/koobiq-components-checkbox.mjs +10 -10
- package/fesm2022/koobiq-components-clamped-text.mjs +7 -7
- package/fesm2022/koobiq-components-code-block.mjs +18 -13
- package/fesm2022/koobiq-components-code-block.mjs.map +1 -1
- package/fesm2022/koobiq-components-content-panel.mjs +31 -165
- package/fesm2022/koobiq-components-content-panel.mjs.map +1 -1
- package/fesm2022/koobiq-components-core.mjs +962 -581
- package/fesm2022/koobiq-components-core.mjs.map +1 -1
- package/fesm2022/koobiq-components-datepicker.mjs +47 -44
- package/fesm2022/koobiq-components-datepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-divider.mjs +8 -8
- package/fesm2022/koobiq-components-divider.mjs.map +1 -1
- package/fesm2022/koobiq-components-dl.mjs +13 -13
- package/fesm2022/koobiq-components-dropdown.mjs +41 -27
- 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 +11 -8
- package/fesm2022/koobiq-components-ellipsis-center.mjs.map +1 -1
- package/fesm2022/koobiq-components-empty-state.mjs +19 -19
- package/fesm2022/koobiq-components-file-upload.mjs +45 -25
- package/fesm2022/koobiq-components-file-upload.mjs.map +1 -1
- package/fesm2022/koobiq-components-filter-bar.mjs +147 -114
- package/fesm2022/koobiq-components-filter-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-form-field.mjs +100 -73
- package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
- package/fesm2022/koobiq-components-icon.mjs +13 -13
- package/fesm2022/koobiq-components-icon.mjs.map +1 -1
- package/fesm2022/koobiq-components-inline-edit.mjs +411 -0
- package/fesm2022/koobiq-components-inline-edit.mjs.map +1 -0
- package/fesm2022/koobiq-components-input.mjs +34 -31
- package/fesm2022/koobiq-components-input.mjs.map +1 -1
- package/fesm2022/koobiq-components-link.mjs +10 -10
- package/fesm2022/koobiq-components-link.mjs.map +1 -1
- package/fesm2022/koobiq-components-list.mjs +49 -33
- package/fesm2022/koobiq-components-list.mjs.map +1 -1
- package/fesm2022/koobiq-components-loader-overlay.mjs +16 -16
- package/fesm2022/koobiq-components-loader-overlay.mjs.map +1 -1
- package/fesm2022/koobiq-components-markdown.mjs +16 -16
- package/fesm2022/koobiq-components-markdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-modal.mjs +36 -31
- package/fesm2022/koobiq-components-modal.mjs.map +1 -1
- package/fesm2022/koobiq-components-navbar-ic.mjs +122 -81
- package/fesm2022/koobiq-components-navbar-ic.mjs.map +1 -1
- package/fesm2022/koobiq-components-navbar.mjs +77 -64
- package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
- package/fesm2022/koobiq-components-notification-center.mjs +586 -0
- package/fesm2022/koobiq-components-notification-center.mjs.map +1 -0
- package/fesm2022/koobiq-components-overflow-items.mjs +98 -44
- package/fesm2022/koobiq-components-overflow-items.mjs.map +1 -1
- package/fesm2022/koobiq-components-popover.mjs +43 -25
- 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 +156 -0
- package/fesm2022/koobiq-components-resizer.mjs.map +1 -0
- package/fesm2022/koobiq-components-risk-level.mjs +7 -7
- package/fesm2022/koobiq-components-scrollbar.mjs +13 -12
- package/fesm2022/koobiq-components-scrollbar.mjs.map +1 -1
- package/fesm2022/koobiq-components-search-expandable.mjs +199 -0
- package/fesm2022/koobiq-components-search-expandable.mjs.map +1 -0
- package/fesm2022/koobiq-components-select.mjs +51 -33
- package/fesm2022/koobiq-components-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-sidebar.mjs +13 -13
- package/fesm2022/koobiq-components-sidepanel.mjs +26 -26
- package/fesm2022/koobiq-components-sidepanel.mjs.map +1 -1
- package/fesm2022/koobiq-components-split-button.mjs +155 -0
- package/fesm2022/koobiq-components-split-button.mjs.map +1 -0
- package/fesm2022/koobiq-components-splitter.mjs +16 -16
- package/fesm2022/koobiq-components-splitter.mjs.map +1 -1
- package/fesm2022/koobiq-components-table.mjs +10 -10
- package/fesm2022/koobiq-components-tabs.mjs +52 -52
- package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
- package/fesm2022/koobiq-components-tags.mjs +522 -428
- package/fesm2022/koobiq-components-tags.mjs.map +1 -1
- package/fesm2022/koobiq-components-textarea.mjs +10 -10
- package/fesm2022/koobiq-components-textarea.mjs.map +1 -1
- package/fesm2022/koobiq-components-time-range.mjs +809 -0
- package/fesm2022/koobiq-components-time-range.mjs.map +1 -0
- package/fesm2022/koobiq-components-timepicker.mjs +11 -11
- package/fesm2022/koobiq-components-timepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-timezone.mjs +31 -29
- package/fesm2022/koobiq-components-timezone.mjs.map +1 -1
- package/fesm2022/koobiq-components-title.mjs +12 -8
- package/fesm2022/koobiq-components-title.mjs.map +1 -1
- package/fesm2022/koobiq-components-toast.mjs +28 -21
- package/fesm2022/koobiq-components-toast.mjs.map +1 -1
- package/fesm2022/koobiq-components-toggle.mjs +9 -9
- package/fesm2022/koobiq-components-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-tooltip.mjs +22 -22
- package/fesm2022/koobiq-components-tooltip.mjs.map +1 -1
- package/fesm2022/koobiq-components-top-bar.mjs +15 -15
- package/fesm2022/koobiq-components-top-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree-select.mjs +151 -91
- package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree.mjs +72 -61
- package/fesm2022/koobiq-components-tree.mjs.map +1 -1
- package/fesm2022/koobiq-components-username.mjs +27 -27
- package/file-upload/_file-upload-theme.scss +33 -35
- package/file-upload/file-upload-tokens.scss +1 -2
- package/file-upload/file-upload.d.ts +1 -1
- package/file-upload/file-upload.scss +4 -7
- package/file-upload/multiple-file-upload.component.d.ts +2 -1
- package/file-upload/multiple-file-upload.component.scss +12 -14
- package/file-upload/single-file-upload.component.d.ts +2 -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 +6 -2
- package/filter-bar/pipes/base-pipe.scss +3 -3
- package/filter-bar/pipes/pipe-date.scss +4 -1
- package/filter-bar/pipes/pipe-title.d.ts +2 -0
- package/form-field/fieldset-tokens.scss +1 -0
- package/form-field/form-field-tokens.scss +1 -1
- package/form-field/form-field.d.ts +1 -1
- package/form-field/form-field.scss +7 -7
- package/form-field/password-toggle.d.ts +1 -1
- package/form-field/stepper.d.ts +28 -6
- package/icon/icon.component.d.ts +2 -2
- package/inline-edit/index.d.ts +2 -0
- package/inline-edit/inline-edit-tokens.scss +8 -0
- package/inline-edit/inline-edit.d.ts +140 -0
- package/inline-edit/inline-edit.scss +208 -0
- package/inline-edit/module.d.ts +7 -0
- package/input/input-number.d.ts +1 -1
- package/input/input-password.d.ts +2 -2
- package/input/input.d.ts +2 -2
- package/input/input.module.d.ts +2 -1
- package/link/link.component.d.ts +3 -3
- package/list/list-selection.component.d.ts +13 -2
- package/loader-overlay/loader-overlay.component.d.ts +1 -1
- package/markdown/_markdown-theme.scss +1 -2
- package/markdown/markdown-tokens.scss +1 -0
- package/markdown/markdown.scss +10 -4
- package/modal/modal-tokens.scss +2 -1
- package/modal/modal-util.d.ts +5 -2
- package/modal/modal.component.d.ts +1 -1
- package/modal/modal.scss +3 -4
- package/navbar/_navbar-item_vertical.scss +10 -0
- package/navbar/navbar-brand.scss +5 -2
- package/navbar/navbar-item.component.d.ts +3 -2
- package/navbar/navbar.component.d.ts +4 -4
- package/navbar/vertical-navbar.component.d.ts +2 -2
- package/navbar/vertical-navbar.scss +1 -0
- package/navbar-ic/navbar-ic-header.d.ts +4 -3
- package/navbar-ic/navbar-ic-header.scss +0 -4
- package/navbar-ic/navbar-ic-item.d.ts +3 -2
- 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 +11 -2
- package/notification-center/_notification-center-theme.scss +27 -0
- package/notification-center/index.d.ts +1 -0
- package/notification-center/notification-center-animations.d.ts +5 -0
- package/notification-center/notification-center.d.ts +153 -0
- package/notification-center/notification-center.module.d.ts +7 -0
- package/notification-center/notification-center.scss +126 -0
- package/notification-center/notification-center.service.d.ts +72 -0
- package/notification-center/notification-item.d.ts +27 -0
- package/notification-center/notification-item.scss +157 -0
- package/notification-center/public-api.d.ts +4 -0
- package/overflow-items/overflow-items.d.ts +23 -9
- package/package.json +46 -4
- package/popover/popover-tokens.scss +1 -0
- package/popover/popover.component.d.ts +9 -1
- package/popover/popover.scss +18 -11
- 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/search-expandable/index.d.ts +1 -0
- package/search-expandable/public-api.d.ts +2 -0
- package/search-expandable/search-expandable.d.ts +70 -0
- package/search-expandable/search-expandable.module.d.ts +7 -0
- package/search-expandable/search-expandable.scss +21 -0
- package/select/select.component.d.ts +38 -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 +114 -0
- package/split-button/index.d.ts +1 -0
- package/split-button/public-api.d.ts +2 -0
- package/split-button/split-button.d.ts +37 -0
- package/split-button/split-button.module.d.ts +7 -0
- package/split-button/split-button.scss +72 -0
- package/splitter/splitter.component.d.ts +5 -5
- package/tabs/paginated-tab-header.d.ts +1 -1
- package/tabs/tab-header.component.d.ts +2 -2
- package/tabs/tab-label-wrapper.directive.d.ts +2 -2
- package/tabs/tab-nav-bar.d.ts +3 -3
- package/tags/_tag-theme.scss +21 -15
- package/tags/tag-input.d.ts +18 -7
- package/tags/tag-list.component.d.ts +175 -64
- package/tags/tag-list.scss +24 -14
- package/tags/tag-tokens.scss +17 -1
- package/tags/tag.component.d.ts +91 -27
- package/tags/tag.scss +9 -0
- package/textarea/textarea-tokens.scss +6 -1
- package/textarea/textarea.component.d.ts +2 -2
- package/textarea/textarea.module.d.ts +2 -1
- package/textarea/textarea.scss +4 -0
- package/time-range/constants.d.ts +19 -0
- package/time-range/index.d.ts +7 -0
- package/time-range/module.d.ts +10 -0
- package/time-range/time-range-editor.d.ts +65 -0
- package/time-range/time-range-title-as-form-field.d.ts +41 -0
- package/time-range/time-range-title.d.ts +18 -0
- package/time-range/time-range.d.ts +78 -0
- package/time-range/time-range.scss +66 -0
- package/time-range/time-range.service.d.ts +25 -0
- package/time-range/types.d.ts +69 -0
- package/timepicker/timepicker.directive.d.ts +2 -2
- 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/toast/toast.component.d.ts +6 -4
- package/toast/toast.component.scss +11 -1
- package/toast/toast.service.d.ts +1 -0
- package/toast/toast.type.d.ts +1 -0
- 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/toggle.d.ts +1 -1
- package/tree/tree-base.d.ts +2 -2
- package/tree/tree-option.component.d.ts +2 -1
- package/tree/tree-selection.component.d.ts +12 -3
- package/tree-select/tree-select.component.d.ts +49 -8
- package/tree-select/tree-select.module.d.ts +2 -1
- package/tree-select/tree-select.scss +4 -0
- package/core/locales/fa-IR.d.ts +0 -100
- package/core/locales/zh-CN.d.ts +0 -100
- package/esm2022/content-panel/resizable.mjs +0 -138
- package/esm2022/core/locales/fa-IR.mjs +0 -99
- package/esm2022/core/locales/zh-CN.mjs +0 -99
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Directive, inject, EventEmitter, signal, booleanAttribute,
|
|
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 {
|
|
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,
|
|
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
|
-
import
|
|
12
|
-
import
|
|
11
|
+
import { FocusMonitor } from '@angular/cdk/a11y';
|
|
12
|
+
import * as i2$1 from '@angular/cdk/bidi';
|
|
13
|
+
import * as i2 from '@angular/cdk/drag-drop';
|
|
14
|
+
import { CdkDrag, CdkDropList } from '@angular/cdk/drag-drop';
|
|
15
|
+
import { DELETE, SPACE, BACKSPACE, ENTER, ESCAPE, F2, LEFT_ARROW, TAB, HOME, END } from '@angular/cdk/keycodes';
|
|
13
16
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
14
17
|
import { FocusKeyManager } from '@koobiq/cdk/a11y';
|
|
15
18
|
import { Subject, merge } from 'rxjs';
|
|
16
|
-
import {
|
|
17
|
-
import { FocusMonitor } from '@angular/cdk/a11y';
|
|
18
|
-
import { SPACE, DELETE, BACKSPACE, ENTER, ESCAPE, F2 } from '@angular/cdk/keycodes';
|
|
19
|
+
import { startWith, filter } from 'rxjs/operators';
|
|
19
20
|
import { KbqIcon } from '@koobiq/components/icon';
|
|
20
21
|
import { PlatformModule } from '@angular/cdk/platform';
|
|
21
22
|
|
|
@@ -49,10 +50,10 @@ const getTagEditInputMissingError = () => {
|
|
|
49
50
|
* @docs-private
|
|
50
51
|
*/
|
|
51
52
|
class KbqTagAvatar {
|
|
52
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
53
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.
|
|
53
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTagAvatar, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
54
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: KbqTagAvatar, selector: "kbq-tag-avatar, [kbqTagAvatar]", host: { classAttribute: "kbq-tag-avatar" }, ngImport: i0 }); }
|
|
54
55
|
}
|
|
55
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
56
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTagAvatar, decorators: [{
|
|
56
57
|
type: Directive,
|
|
57
58
|
args: [{
|
|
58
59
|
selector: 'kbq-tag-avatar, [kbqTagAvatar]',
|
|
@@ -64,10 +65,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
64
65
|
* @docs-private
|
|
65
66
|
*/
|
|
66
67
|
class KbqTagTrailingIcon {
|
|
67
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
68
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.
|
|
68
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTagTrailingIcon, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
69
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: KbqTagTrailingIcon, selector: "kbq-tag-trailing-icon, [kbqTagTrailingIcon]", host: { classAttribute: "kbq-tag-trailing-icon" }, ngImport: i0 }); }
|
|
69
70
|
}
|
|
70
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTagTrailingIcon, decorators: [{
|
|
71
72
|
type: Directive,
|
|
72
73
|
args: [{
|
|
73
74
|
selector: 'kbq-tag-trailing-icon, [kbqTagTrailingIcon]',
|
|
@@ -82,10 +83,10 @@ class KbqTagEditSubmit {
|
|
|
82
83
|
/** @docs-private */
|
|
83
84
|
this.tag = inject(KbqTag);
|
|
84
85
|
}
|
|
85
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
86
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.
|
|
86
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTagEditSubmit, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
87
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", 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 }); }
|
|
87
88
|
}
|
|
88
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
89
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTagEditSubmit, decorators: [{
|
|
89
90
|
type: Directive,
|
|
90
91
|
args: [{
|
|
91
92
|
standalone: true,
|
|
@@ -118,20 +119,20 @@ class KbqTagEditInput {
|
|
|
118
119
|
this.tag.submitEditing('enter');
|
|
119
120
|
break;
|
|
120
121
|
}
|
|
121
|
-
// prevent KbqTag from receiving these keydown events
|
|
122
|
+
// We should prevent KbqTag from receiving these keydown events
|
|
122
123
|
case BACKSPACE:
|
|
123
|
-
case
|
|
124
|
-
case
|
|
124
|
+
case SPACE:
|
|
125
|
+
case DELETE: {
|
|
125
126
|
event.stopPropagation();
|
|
126
127
|
break;
|
|
127
128
|
}
|
|
128
129
|
default:
|
|
129
130
|
}
|
|
130
131
|
}
|
|
131
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
132
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.
|
|
132
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTagEditInput, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
133
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: KbqTagEditInput, isStandalone: true, selector: "[kbqTagEditInput]", host: { listeners: { "keydown": "handleKeydown($event)" }, classAttribute: "kbq-tag-edit-input" }, exportAs: ["kbqTagEditInput"], hostDirectives: [{ directive: i1.KbqFieldSizingContent }], ngImport: i0 }); }
|
|
133
134
|
}
|
|
134
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
135
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTagEditInput, decorators: [{
|
|
135
136
|
type: Directive,
|
|
136
137
|
args: [{
|
|
137
138
|
standalone: true,
|
|
@@ -145,17 +146,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
145
146
|
}]
|
|
146
147
|
}] });
|
|
147
148
|
class KbqTag extends KbqColorDirective {
|
|
148
|
-
/**
|
|
149
|
-
* Whether the tag list is editable.
|
|
150
|
-
*
|
|
151
|
-
* @docs-private
|
|
152
|
-
*/
|
|
153
|
-
get tagListEditable() {
|
|
154
|
-
return !!this.tagList?.editable;
|
|
155
|
-
}
|
|
156
149
|
/** Whether the tag is editable. */
|
|
157
150
|
get editable() {
|
|
158
|
-
return
|
|
151
|
+
return this._editable ?? !!this.tagList?.editable;
|
|
159
152
|
}
|
|
160
153
|
set editable(value) {
|
|
161
154
|
this._editable = value;
|
|
@@ -165,11 +158,7 @@ class KbqTag extends KbqColorDirective {
|
|
|
165
158
|
return this._selected;
|
|
166
159
|
}
|
|
167
160
|
set selected(value) {
|
|
168
|
-
|
|
169
|
-
if (coercedValue !== this._selected) {
|
|
170
|
-
this._selected = coercedValue;
|
|
171
|
-
this.dispatchSelectionChange();
|
|
172
|
-
}
|
|
161
|
+
this.setSelectedState(value, { emitEvent: true });
|
|
173
162
|
}
|
|
174
163
|
/** The value of the tag. Defaults to the content inside `<kbq-tag>` tags. */
|
|
175
164
|
get value() {
|
|
@@ -179,25 +168,22 @@ class KbqTag extends KbqColorDirective {
|
|
|
179
168
|
this._value = value;
|
|
180
169
|
}
|
|
181
170
|
/**
|
|
182
|
-
* Whether
|
|
183
|
-
* changes to its selected state are always ignored. By default a tag is
|
|
184
|
-
* selectable, and it becomes non-selectable if its parent tag list is
|
|
185
|
-
* not selectable.
|
|
171
|
+
* Whether the tag is selectable.
|
|
186
172
|
*/
|
|
187
173
|
get selectable() {
|
|
188
|
-
return this._selectable
|
|
174
|
+
return this._selectable || !!this.tagList?.selectable;
|
|
189
175
|
}
|
|
190
176
|
set selectable(value) {
|
|
191
|
-
this._selectable =
|
|
177
|
+
this._selectable = value;
|
|
192
178
|
}
|
|
193
179
|
/**
|
|
194
|
-
* Determines whether
|
|
180
|
+
* Determines whether the tag is removable.
|
|
195
181
|
*/
|
|
196
182
|
get removable() {
|
|
197
|
-
return this._removable;
|
|
183
|
+
return this._removable && (this.tagList?.removable ?? true);
|
|
198
184
|
}
|
|
199
185
|
set removable(value) {
|
|
200
|
-
this._removable =
|
|
186
|
+
this._removable = value;
|
|
201
187
|
}
|
|
202
188
|
get tabindex() {
|
|
203
189
|
return this.disabled ? null : this._tabindex;
|
|
@@ -205,32 +191,53 @@ class KbqTag extends KbqColorDirective {
|
|
|
205
191
|
set tabindex(value) {
|
|
206
192
|
this._tabindex = value;
|
|
207
193
|
}
|
|
194
|
+
/**
|
|
195
|
+
* Whether the tag is disabled.
|
|
196
|
+
*/
|
|
208
197
|
get disabled() {
|
|
209
|
-
return this._disabled;
|
|
198
|
+
return this._disabled || (this.tagList?.disabled ?? false);
|
|
210
199
|
}
|
|
211
200
|
set disabled(value) {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}
|
|
201
|
+
this._disabled = value;
|
|
202
|
+
this.syncDragDisabledState();
|
|
215
203
|
}
|
|
216
|
-
|
|
204
|
+
/**
|
|
205
|
+
* Whether the tag is draggable.
|
|
206
|
+
*
|
|
207
|
+
* @docs-private
|
|
208
|
+
*/
|
|
209
|
+
get draggable() {
|
|
210
|
+
return (this.tagList?.draggable ?? false) && !this.disabled;
|
|
211
|
+
}
|
|
212
|
+
constructor(changeDetectorRef) {
|
|
217
213
|
super();
|
|
218
214
|
this.changeDetectorRef = changeDetectorRef;
|
|
219
|
-
this._ngZone = _ngZone;
|
|
220
215
|
this.focusMonitor = inject(FocusMonitor);
|
|
221
216
|
this.tagList = inject(KbqTagList, { optional: true });
|
|
217
|
+
this.drag = inject(CdkDrag, { host: true });
|
|
218
|
+
this.destroyRef = inject(DestroyRef);
|
|
222
219
|
/** @docs-private */
|
|
223
|
-
this.elementRef =
|
|
224
|
-
/**
|
|
220
|
+
this.elementRef = inject(ElementRef);
|
|
221
|
+
/**
|
|
222
|
+
* Emits when the tag is focused.
|
|
223
|
+
*
|
|
224
|
+
* @docs-private
|
|
225
|
+
*/
|
|
225
226
|
this.onFocus = new Subject();
|
|
226
|
-
/**
|
|
227
|
+
/**
|
|
228
|
+
* Emits when the tag is blurred.
|
|
229
|
+
*
|
|
230
|
+
* @docs-private
|
|
231
|
+
*/
|
|
227
232
|
this.onBlur = new Subject();
|
|
228
233
|
/** @docs-private */
|
|
229
234
|
this.nativeElement = this.elementRef.nativeElement;
|
|
230
|
-
/**
|
|
235
|
+
/**
|
|
236
|
+
* Whether the tag has focus.
|
|
237
|
+
*
|
|
238
|
+
* @docs-private
|
|
239
|
+
*/
|
|
231
240
|
this.hasFocus = false;
|
|
232
|
-
/** Whether the tag list is selectable */
|
|
233
|
-
this.tagListSelectable = true;
|
|
234
241
|
/** Whether the tag edits can't be submitted. */
|
|
235
242
|
this.preventEditSubmit = false;
|
|
236
243
|
/**
|
|
@@ -248,26 +255,27 @@ class KbqTag extends KbqColorDirective {
|
|
|
248
255
|
/** Emitted when a tag is to be removed. */
|
|
249
256
|
this.removed = new EventEmitter();
|
|
250
257
|
this._selected = false;
|
|
251
|
-
this._selectable =
|
|
258
|
+
this._selectable = false;
|
|
252
259
|
this._removable = true;
|
|
253
260
|
this._tabindex = -1;
|
|
254
261
|
this._disabled = false;
|
|
255
262
|
this.color = KbqComponentColors.ContrastFade;
|
|
256
263
|
this.setDefaultColor(KbqComponentColors.ContrastFade);
|
|
257
264
|
this.addHostClassName();
|
|
265
|
+
this.setupDragInitialProperties();
|
|
258
266
|
}
|
|
259
267
|
ngAfterContentInit() {
|
|
260
268
|
this.addClassModificatorForIcons();
|
|
261
269
|
}
|
|
262
270
|
ngAfterViewInit() {
|
|
263
|
-
this.
|
|
264
|
-
isNull(focusOrigin) ? this.blur() : this.focus();
|
|
265
|
-
});
|
|
271
|
+
this.setupFocusMonitor();
|
|
266
272
|
}
|
|
267
273
|
ngOnDestroy() {
|
|
274
|
+
this.cancelEditing('destroy');
|
|
268
275
|
this.focusMonitor.stopMonitoring(this.elementRef);
|
|
269
276
|
this.destroyed.emit({ tag: this });
|
|
270
277
|
}
|
|
278
|
+
/** @docs-private */
|
|
271
279
|
addClassModificatorForIcons() {
|
|
272
280
|
const icons = this.contentChildren.map((item) => item.elementRef.nativeElement);
|
|
273
281
|
if (icons.length === 1) {
|
|
@@ -288,6 +296,7 @@ class KbqTag extends KbqColorDirective {
|
|
|
288
296
|
secondIconElement.classList.add('kbq-icon_right');
|
|
289
297
|
}
|
|
290
298
|
}
|
|
299
|
+
/** @docs-private */
|
|
291
300
|
addHostClassName() {
|
|
292
301
|
// Add class for the different tags
|
|
293
302
|
for (const attr of TAG_ATTRIBUTE_NAMES) {
|
|
@@ -299,42 +308,46 @@ class KbqTag extends KbqColorDirective {
|
|
|
299
308
|
}
|
|
300
309
|
this.elementRef.nativeElement.classList.add('kbq-standard-tag');
|
|
301
310
|
}
|
|
311
|
+
/**
|
|
312
|
+
* Selects the tag.
|
|
313
|
+
*/
|
|
302
314
|
select() {
|
|
303
|
-
if (!this.
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
}
|
|
315
|
+
if (this.disabled || !this.selectable)
|
|
316
|
+
return;
|
|
317
|
+
this.setSelectedState(true, { emitEvent: true });
|
|
307
318
|
}
|
|
319
|
+
/**
|
|
320
|
+
* Deselects the tag.
|
|
321
|
+
*/
|
|
308
322
|
deselect() {
|
|
309
|
-
if (this.
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
}
|
|
323
|
+
if (this.disabled || !this.selectable)
|
|
324
|
+
return;
|
|
325
|
+
this.setSelectedState(false, { emitEvent: true });
|
|
313
326
|
}
|
|
327
|
+
/**
|
|
328
|
+
* Selects the tag and emits event with isUserInput flag.
|
|
329
|
+
*
|
|
330
|
+
* @docs-private
|
|
331
|
+
*/
|
|
314
332
|
selectViaInteraction() {
|
|
315
|
-
if (!this.
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
}
|
|
333
|
+
if (this.disabled || !this.selectable)
|
|
334
|
+
return;
|
|
335
|
+
this.setSelectedState(true, { isUserInput: true, emitEvent: true });
|
|
319
336
|
}
|
|
337
|
+
/**
|
|
338
|
+
* Toggles the current selected state of the tag.
|
|
339
|
+
*/
|
|
320
340
|
toggleSelected(isUserInput = false) {
|
|
321
|
-
this.
|
|
322
|
-
|
|
341
|
+
if (this.disabled || !this.selectable)
|
|
342
|
+
return this.selected;
|
|
343
|
+
this.setSelectedState(!this.selected, { isUserInput, emitEvent: true });
|
|
323
344
|
return this.selected;
|
|
324
345
|
}
|
|
325
|
-
/**
|
|
346
|
+
/** Focuses the tag. */
|
|
326
347
|
focus() {
|
|
327
|
-
if (
|
|
348
|
+
if (this.disabled)
|
|
328
349
|
return;
|
|
329
|
-
|
|
330
|
-
if (!this.editing())
|
|
331
|
-
this.elementRef.nativeElement.focus();
|
|
332
|
-
this.onFocus.next({ tag: this });
|
|
333
|
-
Promise.resolve().then(() => {
|
|
334
|
-
this.hasFocus = true;
|
|
335
|
-
this.changeDetectorRef.markForCheck();
|
|
336
|
-
});
|
|
337
|
-
}
|
|
350
|
+
this.elementRef.nativeElement.focus();
|
|
338
351
|
}
|
|
339
352
|
/**
|
|
340
353
|
* Allows for programmatic removal of the tag. Called by the KbqTagList when the DELETE or
|
|
@@ -348,35 +361,43 @@ class KbqTag extends KbqColorDirective {
|
|
|
348
361
|
}
|
|
349
362
|
}
|
|
350
363
|
/** @docs-private */
|
|
351
|
-
|
|
352
|
-
if (this.disabled ||
|
|
364
|
+
handleClick(event) {
|
|
365
|
+
if (this.disabled || this.editing()) {
|
|
353
366
|
event.preventDefault();
|
|
367
|
+
return;
|
|
354
368
|
}
|
|
355
|
-
|
|
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')) {
|
|
375
|
+
this.toggleSelected(true);
|
|
376
|
+
// We should stop event propagation to prevent the tag list from handling the click event.
|
|
356
377
|
event.stopPropagation();
|
|
378
|
+
return;
|
|
357
379
|
}
|
|
358
380
|
}
|
|
359
381
|
/** @docs-private */
|
|
360
382
|
handleKeydown(event) {
|
|
361
|
-
if (this.disabled)
|
|
383
|
+
if (this.disabled || this.editing())
|
|
362
384
|
return;
|
|
363
|
-
}
|
|
364
385
|
switch (event.keyCode) {
|
|
365
386
|
case DELETE:
|
|
366
|
-
case BACKSPACE:
|
|
367
|
-
// If
|
|
368
|
-
this.remove();
|
|
387
|
+
case BACKSPACE: {
|
|
388
|
+
// If there is a tag list and it has selected tags, remove them, otherwise remove focused tag.
|
|
389
|
+
this.tagList?.selected.length ? this.tagList.removeSelected() : this.remove();
|
|
369
390
|
// Always prevent so page navigation does not occur
|
|
370
391
|
event.preventDefault();
|
|
371
392
|
break;
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
}
|
|
393
|
+
}
|
|
394
|
+
case SPACE: {
|
|
395
|
+
this.toggleSelected(true);
|
|
396
|
+
this.focusMonitor.focusVia(this.elementRef, 'keyboard');
|
|
377
397
|
// Always prevent space from scrolling the page since the list has focus
|
|
378
398
|
event.preventDefault();
|
|
379
399
|
break;
|
|
400
|
+
}
|
|
380
401
|
case F2:
|
|
381
402
|
case ENTER:
|
|
382
403
|
this.startEditing(event.key);
|
|
@@ -386,20 +407,7 @@ class KbqTag extends KbqColorDirective {
|
|
|
386
407
|
}
|
|
387
408
|
/** @docs-private */
|
|
388
409
|
blur() {
|
|
389
|
-
this.
|
|
390
|
-
// When animations are enabled, Angular may end up removing the tag from the DOM a little
|
|
391
|
-
// earlier than usual, causing it to be blurred and throwing off the logic in the tag list
|
|
392
|
-
// that moves focus not the next item. To work around the issue, we defer marking the tag
|
|
393
|
-
// as not focused until the next time the zone stabilizes.
|
|
394
|
-
this._ngZone.onStable
|
|
395
|
-
.asObservable()
|
|
396
|
-
.pipe(take(1))
|
|
397
|
-
.subscribe(() => {
|
|
398
|
-
this._ngZone.run(() => {
|
|
399
|
-
this.hasFocus = false;
|
|
400
|
-
this.onBlur.next({ tag: this });
|
|
401
|
-
});
|
|
402
|
-
});
|
|
410
|
+
this.elementRef.nativeElement.blur();
|
|
403
411
|
}
|
|
404
412
|
/** @docs-private */
|
|
405
413
|
handleDblClick(event) {
|
|
@@ -417,7 +425,6 @@ class KbqTag extends KbqColorDirective {
|
|
|
417
425
|
const input = this.editInputElementRef?.nativeElement;
|
|
418
426
|
if (!input)
|
|
419
427
|
throw getTagEditInputMissingError();
|
|
420
|
-
input.focus();
|
|
421
428
|
input.select();
|
|
422
429
|
});
|
|
423
430
|
}
|
|
@@ -427,7 +434,7 @@ class KbqTag extends KbqColorDirective {
|
|
|
427
434
|
return;
|
|
428
435
|
this.editing.set(false);
|
|
429
436
|
this.editChange.emit({ tag: this, type: 'cancel', reason });
|
|
430
|
-
this.textElement.nativeElement.scrollTo({ left: 0, behavior: 'instant' });
|
|
437
|
+
this.textElement.nativeElement.scrollTo?.({ left: 0, behavior: 'instant' });
|
|
431
438
|
}
|
|
432
439
|
/** @docs-private */
|
|
433
440
|
submitEditing(reason) {
|
|
@@ -435,17 +442,60 @@ class KbqTag extends KbqColorDirective {
|
|
|
435
442
|
return;
|
|
436
443
|
this.editing.set(false);
|
|
437
444
|
this.editChange.emit({ tag: this, type: 'submit', reason });
|
|
438
|
-
this.textElement.nativeElement.scrollTo({ left: 0, behavior: 'instant' });
|
|
445
|
+
this.textElement.nativeElement.scrollTo?.({ left: 0, behavior: 'instant' });
|
|
439
446
|
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
447
|
+
/**
|
|
448
|
+
* Sets the selected state of the tag.
|
|
449
|
+
*
|
|
450
|
+
* @docs-private
|
|
451
|
+
*/
|
|
452
|
+
setSelectedState(selected, options = {}) {
|
|
453
|
+
const { isUserInput = false, emitEvent = false } = options;
|
|
454
|
+
if (selected !== this.selected) {
|
|
455
|
+
this._selected = selected;
|
|
456
|
+
if (emitEvent) {
|
|
457
|
+
this.selectionChange.emit({
|
|
458
|
+
source: this,
|
|
459
|
+
isUserInput,
|
|
460
|
+
selected: this.selected
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
this.changeDetectorRef.markForCheck();
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
setupDragInitialProperties() {
|
|
467
|
+
this.syncDragDisabledState();
|
|
468
|
+
this.drag.started.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
|
469
|
+
this.drag.data = { tag: this };
|
|
445
470
|
});
|
|
446
471
|
}
|
|
447
|
-
|
|
448
|
-
|
|
472
|
+
syncDragDisabledState() {
|
|
473
|
+
this.drag.disabled = !this.draggable;
|
|
474
|
+
}
|
|
475
|
+
setupFocusMonitor() {
|
|
476
|
+
this.focusMonitor.monitor(this.elementRef, true).subscribe((origin) => {
|
|
477
|
+
if (this.disabled)
|
|
478
|
+
return;
|
|
479
|
+
const hasFocus = !isNull(origin);
|
|
480
|
+
if (hasFocus !== this.hasFocus) {
|
|
481
|
+
this.hasFocus = hasFocus;
|
|
482
|
+
if (this.hasFocus) {
|
|
483
|
+
this.onFocus.next({ tag: this, origin });
|
|
484
|
+
if (!this.tagList)
|
|
485
|
+
this.select();
|
|
486
|
+
}
|
|
487
|
+
else {
|
|
488
|
+
this.onBlur.next({ tag: this });
|
|
489
|
+
this.cancelEditing('blur');
|
|
490
|
+
if (!this.tagList)
|
|
491
|
+
this.deselect();
|
|
492
|
+
}
|
|
493
|
+
this.changeDetectorRef.markForCheck();
|
|
494
|
+
}
|
|
495
|
+
});
|
|
496
|
+
}
|
|
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 }); }
|
|
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: `
|
|
449
499
|
<div class="kbq-tag__wrapper">
|
|
450
500
|
<ng-content select="[kbq-icon]:not([kbqTagRemove]):not([kbqTagEditSubmit])" />
|
|
451
501
|
<span #kbqTitleText class="kbq-tag__text">
|
|
@@ -458,14 +508,16 @@ class KbqTag extends KbqColorDirective {
|
|
|
458
508
|
@if (editing()) {
|
|
459
509
|
<ng-content select="[kbqTagEditSubmit]" />
|
|
460
510
|
} @else {
|
|
461
|
-
|
|
511
|
+
@if (removable) {
|
|
512
|
+
<ng-content select="[kbqTagRemove]" />
|
|
513
|
+
}
|
|
462
514
|
}
|
|
463
515
|
</div>
|
|
464
|
-
`, 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%;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__wrapper{display:flex;align-items:center;height:100%;flex:1 1 100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
516
|
+
`, 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;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"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
465
517
|
}
|
|
466
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
518
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTag, decorators: [{
|
|
467
519
|
type: Component,
|
|
468
|
-
args: [{ selector: 'kbq-tag, [kbq-tag], kbq-basic-tag, [kbq-basic-tag]', exportAs: 'kbqTag', template: `
|
|
520
|
+
args: [{ selector: 'kbq-tag, [kbq-tag], kbq-basic-tag, [kbq-basic-tag]', exportAs: 'kbqTag', hostDirectives: [CdkDrag], template: `
|
|
469
521
|
<div class="kbq-tag__wrapper">
|
|
470
522
|
<ng-content select="[kbq-icon]:not([kbqTagRemove]):not([kbqTagEditSubmit])" />
|
|
471
523
|
<span #kbqTitleText class="kbq-tag__text">
|
|
@@ -478,7 +530,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
478
530
|
@if (editing()) {
|
|
479
531
|
<ng-content select="[kbqTagEditSubmit]" />
|
|
480
532
|
} @else {
|
|
481
|
-
|
|
533
|
+
@if (removable) {
|
|
534
|
+
<ng-content select="[kbqTagRemove]" />
|
|
535
|
+
}
|
|
482
536
|
}
|
|
483
537
|
</div>
|
|
484
538
|
`, host: {
|
|
@@ -486,18 +540,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
486
540
|
'[attr.tabindex]': 'tabindex',
|
|
487
541
|
'[attr.disabled]': 'disabled || null',
|
|
488
542
|
'[class.kbq-selected]': 'selected',
|
|
489
|
-
'[class.kbq-focused]': 'hasFocus',
|
|
490
543
|
'[class.kbq-tag-with-avatar]': 'avatar',
|
|
491
544
|
'[class.kbq-tag-with-icon]': 'contentChildren',
|
|
492
545
|
'[class.kbq-tag-with-trailing-icon]': 'trailingIcon || removeIcon',
|
|
493
546
|
'[class.kbq-disabled]': 'disabled',
|
|
494
547
|
'[class.kbq-tag_editable]': 'editable',
|
|
495
548
|
'[class.kbq-tag_editing]': 'editing()',
|
|
549
|
+
'[class.kbq-tag_removable]': 'removable',
|
|
550
|
+
'[class.kbq-tag_selectable]': 'selectable',
|
|
551
|
+
'[class.kbq-tag_draggable]': 'draggable',
|
|
496
552
|
'(dblclick)': 'handleDblClick($event)',
|
|
497
|
-
'(
|
|
553
|
+
'(click)': 'handleClick($event)',
|
|
498
554
|
'(keydown)': 'handleKeydown($event)'
|
|
499
|
-
}, 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%;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__wrapper{display:flex;align-items:center;height:100%;flex:1 1 100%}\n"] }]
|
|
500
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }
|
|
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"] }]
|
|
556
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { editable: [{
|
|
501
557
|
type: Input,
|
|
502
558
|
args: [{ transform: booleanAttribute }]
|
|
503
559
|
}], preventEditSubmit: [{
|
|
@@ -530,17 +586,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
530
586
|
}], removed: [{
|
|
531
587
|
type: Output
|
|
532
588
|
}], selected: [{
|
|
533
|
-
type: Input
|
|
589
|
+
type: Input,
|
|
590
|
+
args: [{ transform: booleanAttribute }]
|
|
534
591
|
}], value: [{
|
|
535
592
|
type: Input
|
|
536
593
|
}], selectable: [{
|
|
537
|
-
type: Input
|
|
594
|
+
type: Input,
|
|
595
|
+
args: [{ transform: booleanAttribute }]
|
|
538
596
|
}], removable: [{
|
|
539
|
-
type: Input
|
|
597
|
+
type: Input,
|
|
598
|
+
args: [{ transform: booleanAttribute }]
|
|
540
599
|
}], tabindex: [{
|
|
541
600
|
type: Input
|
|
542
601
|
}], disabled: [{
|
|
543
|
-
type: Input
|
|
602
|
+
type: Input,
|
|
603
|
+
args: [{ transform: booleanAttribute }]
|
|
544
604
|
}] } });
|
|
545
605
|
/**
|
|
546
606
|
*
|
|
@@ -557,10 +617,15 @@ class KbqTagRemove {
|
|
|
557
617
|
constructor(parentTag) {
|
|
558
618
|
this.parentTag = parentTag;
|
|
559
619
|
}
|
|
560
|
-
|
|
561
|
-
|
|
620
|
+
/** @docs-private */
|
|
621
|
+
focus(event) {
|
|
622
|
+
event.stopPropagation();
|
|
562
623
|
}
|
|
563
|
-
/**
|
|
624
|
+
/**
|
|
625
|
+
* Calls the parent tag's public `remove()` method if applicable.
|
|
626
|
+
*
|
|
627
|
+
* @docs-private
|
|
628
|
+
*/
|
|
564
629
|
handleClick(event) {
|
|
565
630
|
if (this.parentTag.removable) {
|
|
566
631
|
this.parentTag.hasFocus = true;
|
|
@@ -573,10 +638,10 @@ class KbqTagRemove {
|
|
|
573
638
|
// that the tag is being removed before the event bubbles up.
|
|
574
639
|
event.stopPropagation();
|
|
575
640
|
}
|
|
576
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
577
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.
|
|
641
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTagRemove, deps: [{ token: forwardRef(() => KbqTag) }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
642
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: KbqTagRemove, selector: "[kbqTagRemove]", host: { listeners: { "click": "handleClick($event)", "focus": "focus($event)" }, properties: { "attr.tabindex": "-1" }, classAttribute: "kbq-tag-remove kbq-tag-trailing-icon" }, ngImport: i0 }); }
|
|
578
643
|
}
|
|
579
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
644
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTagRemove, decorators: [{
|
|
580
645
|
type: Directive,
|
|
581
646
|
args: [{
|
|
582
647
|
selector: '[kbqTagRemove]',
|
|
@@ -602,55 +667,58 @@ class KbqTagListChange {
|
|
|
602
667
|
}
|
|
603
668
|
}
|
|
604
669
|
class KbqTagList {
|
|
605
|
-
/**
|
|
670
|
+
/**
|
|
671
|
+
* Combined stream of all of the child tags' selection change events.
|
|
672
|
+
*
|
|
673
|
+
* @docs-private
|
|
674
|
+
*/
|
|
606
675
|
get tagSelectionChanges() {
|
|
607
676
|
return merge(...this.tags.map((tag) => tag.selectionChange));
|
|
608
677
|
}
|
|
609
|
-
/**
|
|
678
|
+
/**
|
|
679
|
+
* Combined stream of all of the child tags' focus change events.
|
|
680
|
+
*
|
|
681
|
+
* @docs-private
|
|
682
|
+
*/
|
|
610
683
|
get tagFocusChanges() {
|
|
611
684
|
return merge(...this.tags.map((tag) => tag.onFocus));
|
|
612
685
|
}
|
|
613
|
-
/**
|
|
686
|
+
/**
|
|
687
|
+
* Combined stream of all of the child tags' blur change events.
|
|
688
|
+
*
|
|
689
|
+
* @docs-private
|
|
690
|
+
*/
|
|
614
691
|
get tagBlurChanges() {
|
|
615
692
|
return merge(...this.tags.map((tag) => tag.onBlur));
|
|
616
693
|
}
|
|
617
|
-
/**
|
|
694
|
+
/**
|
|
695
|
+
* Combined stream of all of the child tags' remove change events.
|
|
696
|
+
*
|
|
697
|
+
* @docs-private
|
|
698
|
+
*/
|
|
618
699
|
get tagRemoveChanges() {
|
|
619
700
|
return merge(...this.tags.map((tag) => tag.destroyed));
|
|
620
701
|
}
|
|
621
|
-
/**
|
|
702
|
+
/**
|
|
703
|
+
* Combined stream of all of the child tags' edit change events.
|
|
704
|
+
*
|
|
705
|
+
* @docs-private
|
|
706
|
+
*/
|
|
622
707
|
get tagEditChanges() {
|
|
623
708
|
return merge(...this.tags.map((tag) => tag.editChange));
|
|
624
709
|
}
|
|
625
|
-
/**
|
|
710
|
+
/**
|
|
711
|
+
* The array of selected tags inside tag list.
|
|
712
|
+
*
|
|
713
|
+
* @docs-private
|
|
714
|
+
*/
|
|
626
715
|
get selected() {
|
|
627
|
-
return this.
|
|
716
|
+
return this.tags.filter(({ selected }) => selected);
|
|
628
717
|
}
|
|
718
|
+
/** @docs-private */
|
|
629
719
|
get canShowCleaner() {
|
|
630
720
|
return this.cleaner && this.tags.length > 0;
|
|
631
721
|
}
|
|
632
|
-
/** Whether the user should be allowed to select multiple tags. */
|
|
633
|
-
get multiple() {
|
|
634
|
-
return this._multiple;
|
|
635
|
-
}
|
|
636
|
-
set multiple(value) {
|
|
637
|
-
this._multiple = coerceBooleanProperty(value);
|
|
638
|
-
}
|
|
639
|
-
/**
|
|
640
|
-
* A function to compare the option values with the selected values. The first argument
|
|
641
|
-
* is a value from an option. The second is a value from the selection. A boolean
|
|
642
|
-
* should be returned.
|
|
643
|
-
*/
|
|
644
|
-
get compareWith() {
|
|
645
|
-
return this._compareWith;
|
|
646
|
-
}
|
|
647
|
-
set compareWith(fn) {
|
|
648
|
-
this._compareWith = fn;
|
|
649
|
-
if (this.selectionModel) {
|
|
650
|
-
// A different comparator means the selection could change.
|
|
651
|
-
this.initializeSelection();
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
722
|
/**
|
|
655
723
|
* Implemented as part of KbqFormFieldControl.
|
|
656
724
|
* @docs-private
|
|
@@ -659,7 +727,6 @@ class KbqTagList {
|
|
|
659
727
|
return this._value;
|
|
660
728
|
}
|
|
661
729
|
set value(value) {
|
|
662
|
-
this.writeValue(value);
|
|
663
730
|
this._value = value;
|
|
664
731
|
}
|
|
665
732
|
/**
|
|
@@ -717,22 +784,31 @@ class KbqTagList {
|
|
|
717
784
|
return this.ngControl ? !!this.ngControl.disabled : this._disabled;
|
|
718
785
|
}
|
|
719
786
|
set disabled(value) {
|
|
720
|
-
this._disabled =
|
|
721
|
-
this.
|
|
787
|
+
this._disabled = value;
|
|
788
|
+
this.syncDropListDisabledState();
|
|
722
789
|
}
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
* the selected states for all the tags inside the tag list are always ignored.
|
|
726
|
-
*/
|
|
727
|
-
get selectable() {
|
|
728
|
-
return this._selectable;
|
|
790
|
+
get draggable() {
|
|
791
|
+
return this._draggable && !this.disabled;
|
|
729
792
|
}
|
|
730
|
-
set
|
|
731
|
-
this.
|
|
732
|
-
this.
|
|
793
|
+
set draggable(value) {
|
|
794
|
+
this._draggable = value;
|
|
795
|
+
this.syncDropListDisabledState();
|
|
733
796
|
}
|
|
797
|
+
/** Whether the tags in the list are removable. */
|
|
798
|
+
get removable() {
|
|
799
|
+
return this._removable;
|
|
800
|
+
}
|
|
801
|
+
set removable(value) {
|
|
802
|
+
this._removable = value;
|
|
803
|
+
this.syncTagsRemovableState();
|
|
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
|
+
*/
|
|
734
810
|
get tabIndex() {
|
|
735
|
-
return this._tabIndex;
|
|
811
|
+
return this.disabled || this.tagInput ? null : this._tabIndex;
|
|
736
812
|
}
|
|
737
813
|
set tabIndex(value) {
|
|
738
814
|
this.userTabIndex = value;
|
|
@@ -746,6 +822,14 @@ class KbqTagList {
|
|
|
746
822
|
this.parentForm = parentForm;
|
|
747
823
|
this.parentFormGroup = parentFormGroup;
|
|
748
824
|
this.ngControl = ngControl;
|
|
825
|
+
this.dropList = inject(CdkDropList, { host: true });
|
|
826
|
+
this.destroyRef = inject(DestroyRef);
|
|
827
|
+
this.focusMonitor = inject(FocusMonitor);
|
|
828
|
+
/**
|
|
829
|
+
* Implemented as part of KbqFormFieldControl.
|
|
830
|
+
*
|
|
831
|
+
* @docs-private
|
|
832
|
+
*/
|
|
749
833
|
this.controlType = 'tag-list';
|
|
750
834
|
/**
|
|
751
835
|
* Emits whenever the component state changes and should cause the parent
|
|
@@ -753,8 +837,35 @@ class KbqTagList {
|
|
|
753
837
|
* @docs-private
|
|
754
838
|
*/
|
|
755
839
|
this.stateChanges = new Subject();
|
|
756
|
-
/**
|
|
840
|
+
/**
|
|
841
|
+
* @deprecated Unused. Will be removed in next major release.
|
|
842
|
+
*
|
|
843
|
+
* @docs-private
|
|
844
|
+
*/
|
|
845
|
+
this.multiple = false;
|
|
846
|
+
/**
|
|
847
|
+
* A function to compare the option values with the selected values. The first argument
|
|
848
|
+
* is a value from an option. The second is a value from the selection. A boolean
|
|
849
|
+
* should be returned.
|
|
850
|
+
*
|
|
851
|
+
* @deprecated Unused. Will be removed in next major release.
|
|
852
|
+
*/
|
|
853
|
+
this.compareWith = (o1, o2) => o1 === o2;
|
|
854
|
+
this._required = false;
|
|
855
|
+
this._disabled = false;
|
|
856
|
+
this._draggable = false;
|
|
857
|
+
/**
|
|
858
|
+
* Emits when the user drops tag inside tag list container.
|
|
859
|
+
*/
|
|
860
|
+
this.dropped = new EventEmitter();
|
|
861
|
+
/**
|
|
862
|
+
* Whether or not this tag list is selectable. When a tag list is not selectable,
|
|
863
|
+
* the selected states for all the tags inside the tag list are always ignored.
|
|
864
|
+
*/
|
|
865
|
+
this.selectable = true;
|
|
866
|
+
/** Whether the tags in the list are editable. */
|
|
757
867
|
this.editable = false;
|
|
868
|
+
this._removable = true;
|
|
758
869
|
this._tabIndex = 0;
|
|
759
870
|
/**
|
|
760
871
|
* Event that emits whenever the raw value of the tag-list changes. This is here primarily
|
|
@@ -762,40 +873,49 @@ class KbqTagList {
|
|
|
762
873
|
* @docs-private
|
|
763
874
|
*/
|
|
764
875
|
this.valueChange = new EventEmitter();
|
|
876
|
+
/** @docs-private */
|
|
765
877
|
this.uid = `kbq-tag-list-${nextUniqueId$1++}`;
|
|
766
878
|
/**
|
|
767
879
|
* User defined tab index.
|
|
768
880
|
* When it is not null, use user defined tab index. Otherwise use tabIndex
|
|
881
|
+
*
|
|
882
|
+
* @docs-private
|
|
769
883
|
*/
|
|
770
884
|
this.userTabIndex = null;
|
|
885
|
+
/**
|
|
886
|
+
* @docs-private
|
|
887
|
+
*
|
|
888
|
+
* @deprecated Unused. Will be removed in next major release.
|
|
889
|
+
*/
|
|
771
890
|
this.tagChanges = new EventEmitter();
|
|
772
|
-
/**
|
|
891
|
+
/**
|
|
892
|
+
* Orientation of the tag list.
|
|
893
|
+
*
|
|
894
|
+
* @deprecated Unused. Will be removed in next major release.
|
|
895
|
+
*/
|
|
773
896
|
this.orientation = 'horizontal';
|
|
774
897
|
/** Event emitted when the selected tag list value has been changed by the user. */
|
|
775
898
|
this.change = new EventEmitter();
|
|
776
|
-
/**
|
|
899
|
+
/**
|
|
900
|
+
* Whether the component is in an error state.
|
|
901
|
+
*
|
|
902
|
+
* @docs-private
|
|
903
|
+
*/
|
|
777
904
|
this.errorState = false;
|
|
778
|
-
this._required = false;
|
|
779
|
-
this._disabled = false;
|
|
780
|
-
this._selectable = true;
|
|
781
|
-
this._multiple = false;
|
|
782
905
|
/**
|
|
783
906
|
* When a tag is destroyed, we store the index of the destroyed tag until the tags
|
|
784
907
|
* query list notifies about the update. This is necessary because we cannot determine an
|
|
785
908
|
* appropriate tag that should receive focus until the array of tags updated completely.
|
|
786
909
|
*/
|
|
787
910
|
this.lastDestroyedTagIndex = null;
|
|
788
|
-
|
|
911
|
+
/** @docs-private */
|
|
789
912
|
this.onTouched = () => { };
|
|
913
|
+
/** @docs-private */
|
|
790
914
|
this.onChange = () => { };
|
|
791
|
-
this._compareWith = (o1, o2) => o1 === o2;
|
|
792
915
|
if (this.ngControl) {
|
|
793
916
|
this.ngControl.valueAccessor = this;
|
|
794
917
|
}
|
|
795
|
-
|
|
796
|
-
ngOnInit() {
|
|
797
|
-
this.selectionModel = new SelectionModel(this.multiple, undefined, false);
|
|
798
|
-
this.stateChanges.next();
|
|
918
|
+
this.setupDropListInitialProperties();
|
|
799
919
|
}
|
|
800
920
|
ngDoCheck() {
|
|
801
921
|
if (this.ngControl) {
|
|
@@ -809,7 +929,7 @@ class KbqTagList {
|
|
|
809
929
|
this.keyManager = new FocusKeyManager(this.tags)
|
|
810
930
|
.withVerticalOrientation()
|
|
811
931
|
.withHorizontalOrientation(this.dir ? this.dir.value : 'ltr')
|
|
812
|
-
.skipPredicate((
|
|
932
|
+
.skipPredicate(({ disabled }) => disabled);
|
|
813
933
|
if (this.dir) {
|
|
814
934
|
this.dir.change
|
|
815
935
|
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
@@ -828,16 +948,7 @@ class KbqTagList {
|
|
|
828
948
|
this.tags.changes
|
|
829
949
|
.pipe(startWith(null), takeUntilDestroyed(this.destroyRef))
|
|
830
950
|
.subscribe((currentTags) => {
|
|
831
|
-
if (this.disabled) {
|
|
832
|
-
// Since this happens after the content has been
|
|
833
|
-
// checked, we need to defer it to the next tick.
|
|
834
|
-
Promise.resolve().then(() => {
|
|
835
|
-
this.syncTagsDisabledState();
|
|
836
|
-
});
|
|
837
|
-
}
|
|
838
951
|
this.resetTags();
|
|
839
|
-
// Reset tags selected/deselected status
|
|
840
|
-
this.initializeSelection();
|
|
841
952
|
// Check to see if we need to update our tab index
|
|
842
953
|
this.updateTabIndex();
|
|
843
954
|
// Check to see if we have a destroyed tag and need to refocus
|
|
@@ -845,7 +956,6 @@ class KbqTagList {
|
|
|
845
956
|
// Defer setting the value in order to avoid the "Expression
|
|
846
957
|
// has changed after it was checked" errors from Angular.
|
|
847
958
|
Promise.resolve().then(() => {
|
|
848
|
-
this.tagChanges.emit(this.tags.toArray());
|
|
849
959
|
this.stateChanges.next();
|
|
850
960
|
// do not call on initial
|
|
851
961
|
if (currentTags) {
|
|
@@ -853,12 +963,16 @@ class KbqTagList {
|
|
|
853
963
|
}
|
|
854
964
|
});
|
|
855
965
|
});
|
|
856
|
-
|
|
966
|
+
}
|
|
967
|
+
ngAfterViewInit() {
|
|
968
|
+
this.setupFocusMonitor();
|
|
857
969
|
}
|
|
858
970
|
ngOnDestroy() {
|
|
859
971
|
this.stateChanges.complete();
|
|
972
|
+
this.focusMonitor.stopMonitoring(this.elementRef);
|
|
860
973
|
this.dropSubscriptions();
|
|
861
974
|
}
|
|
975
|
+
/** @docs-private */
|
|
862
976
|
updateErrorState() {
|
|
863
977
|
const oldState = this.errorState;
|
|
864
978
|
const parent = this.parentFormGroup || this.parentForm;
|
|
@@ -870,7 +984,11 @@ class KbqTagList {
|
|
|
870
984
|
this.stateChanges.next();
|
|
871
985
|
}
|
|
872
986
|
}
|
|
873
|
-
/**
|
|
987
|
+
/**
|
|
988
|
+
* Associates an HTML input element with this tag list.
|
|
989
|
+
*
|
|
990
|
+
* @docs-private
|
|
991
|
+
*/
|
|
874
992
|
registerInput(inputElement) {
|
|
875
993
|
this.tagInput = inputElement;
|
|
876
994
|
// todo need rethink about it (#DS-3740)
|
|
@@ -878,57 +996,61 @@ class KbqTagList {
|
|
|
878
996
|
inputElement.ngControl.statusChanges.subscribe(() => this.ngControl.control.setErrors(inputElement.ngControl.errors));
|
|
879
997
|
}
|
|
880
998
|
}
|
|
881
|
-
|
|
999
|
+
/**
|
|
1000
|
+
* Implemented as part of ControlValueAccessor.
|
|
1001
|
+
*/
|
|
882
1002
|
writeValue(value) {
|
|
883
|
-
|
|
884
|
-
this.setSelectionByValue(value, false);
|
|
885
|
-
}
|
|
1003
|
+
this.value = value;
|
|
886
1004
|
}
|
|
887
|
-
|
|
1005
|
+
/**
|
|
1006
|
+
* Implemented as part of ControlValueAccessor.
|
|
1007
|
+
*/
|
|
888
1008
|
registerOnChange(fn) {
|
|
889
1009
|
this.onChange = fn;
|
|
890
1010
|
}
|
|
891
|
-
|
|
1011
|
+
/**
|
|
1012
|
+
* Implemented as part of ControlValueAccessor.
|
|
1013
|
+
*/
|
|
892
1014
|
registerOnTouched(fn) {
|
|
893
1015
|
this.onTouched = fn;
|
|
894
1016
|
}
|
|
895
|
-
|
|
1017
|
+
/**
|
|
1018
|
+
* Implemented as part of ControlValueAccessor.
|
|
1019
|
+
*/
|
|
896
1020
|
setDisabledState(isDisabled) {
|
|
897
1021
|
this.disabled = isDisabled;
|
|
898
1022
|
this.stateChanges.next();
|
|
899
1023
|
}
|
|
900
1024
|
/**
|
|
901
1025
|
* Implemented as part of KbqFormFieldControl.
|
|
1026
|
+
*
|
|
902
1027
|
* @docs-private
|
|
903
1028
|
*/
|
|
904
|
-
onContainerClick(
|
|
905
|
-
|
|
906
|
-
this.focus();
|
|
907
|
-
}
|
|
1029
|
+
onContainerClick() {
|
|
1030
|
+
this.focus();
|
|
908
1031
|
}
|
|
909
1032
|
/**
|
|
910
|
-
* Focuses the
|
|
911
|
-
* are no eligible tags.
|
|
1033
|
+
* Focuses the tag list. If there is a tag input, focuses that instead.
|
|
912
1034
|
*/
|
|
913
1035
|
focus() {
|
|
914
|
-
if (this.disabled)
|
|
1036
|
+
if (this.disabled)
|
|
915
1037
|
return;
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
// Focus on first element if there's no tagInput inside tag-list
|
|
919
|
-
if (this.tagInput && this.tagInput.focused) {
|
|
920
|
-
// do nothing
|
|
921
|
-
}
|
|
922
|
-
else if (this.tags.length > 0) {
|
|
923
|
-
this.keyManager.setFirstItemActive();
|
|
1038
|
+
if (this.tagInput) {
|
|
1039
|
+
this.focusInput();
|
|
924
1040
|
this.stateChanges.next();
|
|
1041
|
+
return;
|
|
925
1042
|
}
|
|
926
|
-
|
|
927
|
-
this.
|
|
1043
|
+
if (this.tags.length > 0) {
|
|
1044
|
+
this.keyManager.setFirstItemActive();
|
|
928
1045
|
this.stateChanges.next();
|
|
1046
|
+
return;
|
|
929
1047
|
}
|
|
930
1048
|
}
|
|
931
|
-
/**
|
|
1049
|
+
/**
|
|
1050
|
+
* Focuses the tag input inside the tag list.
|
|
1051
|
+
*
|
|
1052
|
+
* @docs-private
|
|
1053
|
+
*/
|
|
932
1054
|
focusInput() {
|
|
933
1055
|
if (this.tagInput) {
|
|
934
1056
|
this.tagInput.focus();
|
|
@@ -936,15 +1058,30 @@ class KbqTagList {
|
|
|
936
1058
|
}
|
|
937
1059
|
/**
|
|
938
1060
|
* Pass events to the keyboard manager. Available here for tests.
|
|
1061
|
+
*
|
|
1062
|
+
* @docs-private
|
|
939
1063
|
*/
|
|
940
1064
|
keydown(event) {
|
|
941
1065
|
const target = event.target;
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
1066
|
+
if (this.disabled || isNull(target))
|
|
1067
|
+
return;
|
|
1068
|
+
const shouldSelectAll = this.selectable && isSelectAll(event);
|
|
1069
|
+
if (this.isInputEmpty(target)) {
|
|
1070
|
+
if (event.keyCode === BACKSPACE ||
|
|
1071
|
+
event.keyCode === LEFT_ARROW ||
|
|
1072
|
+
(event.keyCode === TAB && event.shiftKey)) {
|
|
1073
|
+
this.keyManager.setLastItemActive();
|
|
1074
|
+
event.preventDefault();
|
|
1075
|
+
return;
|
|
1076
|
+
}
|
|
1077
|
+
if (shouldSelectAll) {
|
|
1078
|
+
this.selectAll();
|
|
1079
|
+
this.keyManager.setLastItemActive();
|
|
1080
|
+
event.preventDefault();
|
|
1081
|
+
return;
|
|
1082
|
+
}
|
|
946
1083
|
}
|
|
947
|
-
else if (
|
|
1084
|
+
else if (this.isTagElement(target)) {
|
|
948
1085
|
if (event.keyCode === HOME) {
|
|
949
1086
|
this.keyManager.setFirstItemActive();
|
|
950
1087
|
event.preventDefault();
|
|
@@ -953,29 +1090,23 @@ class KbqTagList {
|
|
|
953
1090
|
this.keyManager.setLastItemActive();
|
|
954
1091
|
event.preventDefault();
|
|
955
1092
|
}
|
|
1093
|
+
else if (shouldSelectAll) {
|
|
1094
|
+
this.selectAll();
|
|
1095
|
+
this.keyManager.setLastItemActive();
|
|
1096
|
+
event.preventDefault();
|
|
1097
|
+
}
|
|
956
1098
|
else {
|
|
957
1099
|
this.keyManager.onKeydown(event);
|
|
958
1100
|
}
|
|
959
1101
|
this.stateChanges.next();
|
|
960
1102
|
}
|
|
961
1103
|
}
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
this.sortValues();
|
|
969
|
-
}
|
|
970
|
-
else {
|
|
971
|
-
const correspondingTag = this.selectValue(value, isUserInput);
|
|
972
|
-
// Shift focus to the active item. Note that we shouldn't do this in multiple
|
|
973
|
-
// mode, because we don't know what tag the user interacted with last.
|
|
974
|
-
if (correspondingTag && isUserInput) {
|
|
975
|
-
this.keyManager.setActiveItem(correspondingTag);
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
}
|
|
1104
|
+
/**
|
|
1105
|
+
* @docs-private
|
|
1106
|
+
*
|
|
1107
|
+
* @deprecated Unused. Will be removed in next major release.
|
|
1108
|
+
*/
|
|
1109
|
+
setSelectionByValue(_value, _isUserInput = true) { }
|
|
979
1110
|
/** When blurred, mark the field as touched when focus moved outside the tag list. */
|
|
980
1111
|
blur() {
|
|
981
1112
|
if (!this.hasFocusedTag()) {
|
|
@@ -1009,6 +1140,8 @@ class KbqTagList {
|
|
|
1009
1140
|
}
|
|
1010
1141
|
/**
|
|
1011
1142
|
* Check the tab index as you should not be allowed to focus an empty list.
|
|
1143
|
+
*
|
|
1144
|
+
* @docs-private
|
|
1012
1145
|
*/
|
|
1013
1146
|
updateTabIndex() {
|
|
1014
1147
|
// If we have 0 tags, we should not allow keyboard focus
|
|
@@ -1017,6 +1150,8 @@ class KbqTagList {
|
|
|
1017
1150
|
/**
|
|
1018
1151
|
* If the amount of tags changed, we need to update the
|
|
1019
1152
|
* key manager state and focus the next closest tag.
|
|
1153
|
+
*
|
|
1154
|
+
* @docs-private
|
|
1020
1155
|
*/
|
|
1021
1156
|
updateFocusForDestroyedTags() {
|
|
1022
1157
|
if (this.lastDestroyedTagIndex != null) {
|
|
@@ -1039,85 +1174,35 @@ class KbqTagList {
|
|
|
1039
1174
|
isValidIndex(index) {
|
|
1040
1175
|
return index >= 0 && index < this.tags.length;
|
|
1041
1176
|
}
|
|
1177
|
+
isInputElement(element) {
|
|
1178
|
+
return element.nodeName.toLowerCase() === 'input';
|
|
1179
|
+
}
|
|
1042
1180
|
isInputEmpty(element) {
|
|
1043
|
-
if (
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
}
|
|
1047
|
-
return false;
|
|
1181
|
+
if (!this.isInputElement(element))
|
|
1182
|
+
return false;
|
|
1183
|
+
return !element.value;
|
|
1048
1184
|
}
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
const correspondingTag = this.tags.find((tag) => {
|
|
1055
|
-
return tag.value != null && this._compareWith(tag.value, value);
|
|
1056
|
-
});
|
|
1057
|
-
if (correspondingTag) {
|
|
1058
|
-
if (isUserInput) {
|
|
1059
|
-
correspondingTag.selectViaInteraction();
|
|
1060
|
-
}
|
|
1061
|
-
else {
|
|
1062
|
-
correspondingTag.select();
|
|
1063
|
-
}
|
|
1064
|
-
this.selectionModel.select(correspondingTag);
|
|
1065
|
-
}
|
|
1066
|
-
return correspondingTag;
|
|
1067
|
-
}
|
|
1068
|
-
initializeSelection() {
|
|
1069
|
-
// Defer setting the value in order to avoid the "Expression
|
|
1070
|
-
// has changed after it was checked" errors from Angular.
|
|
1071
|
-
Promise.resolve().then(() => {
|
|
1072
|
-
if (this.ngControl || this._value) {
|
|
1073
|
-
this.setSelectionByValue(this.ngControl ? this.ngControl.value : this._value, false);
|
|
1074
|
-
this.stateChanges.next();
|
|
1075
|
-
}
|
|
1076
|
-
});
|
|
1185
|
+
isTagElement(element) {
|
|
1186
|
+
return element.classList.contains('kbq-tag');
|
|
1187
|
+
}
|
|
1188
|
+
selectAll() {
|
|
1189
|
+
this.tags.forEach((tag) => tag.selectViaInteraction());
|
|
1077
1190
|
}
|
|
1078
1191
|
/**
|
|
1079
|
-
*
|
|
1080
|
-
*
|
|
1192
|
+
* Unselects all tags in the list.
|
|
1193
|
+
*
|
|
1194
|
+
* @docs-private
|
|
1081
1195
|
*/
|
|
1082
|
-
|
|
1083
|
-
this.
|
|
1084
|
-
this.tags.forEach((tag) => {
|
|
1085
|
-
if (tag !== skip) {
|
|
1086
|
-
tag.deselect();
|
|
1087
|
-
}
|
|
1088
|
-
});
|
|
1089
|
-
this.stateChanges.next();
|
|
1196
|
+
unselectAll() {
|
|
1197
|
+
this.tags.forEach((tag) => tag.setSelectedState(false));
|
|
1090
1198
|
}
|
|
1091
1199
|
/**
|
|
1092
|
-
*
|
|
1093
|
-
*
|
|
1200
|
+
* Removes all selected tags from the list.
|
|
1201
|
+
*
|
|
1202
|
+
* @docs-private
|
|
1094
1203
|
*/
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
this.selectionModel.clear();
|
|
1098
|
-
this.tags.forEach((tag) => {
|
|
1099
|
-
if (tag.selected) {
|
|
1100
|
-
this.selectionModel.select(tag);
|
|
1101
|
-
}
|
|
1102
|
-
});
|
|
1103
|
-
this.stateChanges.next();
|
|
1104
|
-
}
|
|
1105
|
-
}
|
|
1106
|
-
/** Emits change event to set the model value. */
|
|
1107
|
-
// todo need rethink this method and selection logic (#DS-3740)
|
|
1108
|
-
propagateChanges(fallbackValue) {
|
|
1109
|
-
let valueToEmit;
|
|
1110
|
-
if (Array.isArray(this.selected)) {
|
|
1111
|
-
valueToEmit = this.selected.map((tag) => tag.value);
|
|
1112
|
-
}
|
|
1113
|
-
else {
|
|
1114
|
-
valueToEmit = this.selected ? this.selected.value : fallbackValue;
|
|
1115
|
-
}
|
|
1116
|
-
this._value = valueToEmit;
|
|
1117
|
-
this.change.emit(new KbqTagListChange(this, valueToEmit));
|
|
1118
|
-
this.valueChange.emit(valueToEmit);
|
|
1119
|
-
this.onChange(valueToEmit);
|
|
1120
|
-
this.changeDetectorRef.markForCheck();
|
|
1204
|
+
removeSelected() {
|
|
1205
|
+
this.selected.forEach((tag) => tag.remove());
|
|
1121
1206
|
}
|
|
1122
1207
|
propagateTagsChanges() {
|
|
1123
1208
|
const valueToEmit = this.tags.map((tag) => tag.value);
|
|
@@ -1130,7 +1215,6 @@ class KbqTagList {
|
|
|
1130
1215
|
resetTags() {
|
|
1131
1216
|
this.dropSubscriptions();
|
|
1132
1217
|
this.listenToTagsFocus();
|
|
1133
|
-
this.listenToTagsSelection();
|
|
1134
1218
|
this.listenToTagsRemoved();
|
|
1135
1219
|
this.listenToTagsEdit();
|
|
1136
1220
|
}
|
|
@@ -1143,10 +1227,6 @@ class KbqTagList {
|
|
|
1143
1227
|
this.tagBlurSubscription.unsubscribe();
|
|
1144
1228
|
this.tagBlurSubscription = null;
|
|
1145
1229
|
}
|
|
1146
|
-
if (this.tagSelectionSubscription) {
|
|
1147
|
-
this.tagSelectionSubscription.unsubscribe();
|
|
1148
|
-
this.tagSelectionSubscription = null;
|
|
1149
|
-
}
|
|
1150
1230
|
if (this.tagRemoveSubscription) {
|
|
1151
1231
|
this.tagRemoveSubscription.unsubscribe();
|
|
1152
1232
|
this.tagRemoveSubscription = null;
|
|
@@ -1157,32 +1237,11 @@ class KbqTagList {
|
|
|
1157
1237
|
}
|
|
1158
1238
|
}
|
|
1159
1239
|
/** Listens to user-generated selection events on each tag. */
|
|
1160
|
-
listenToTagsSelection() {
|
|
1161
|
-
this.tagSelectionSubscription = this.tagSelectionChanges.subscribe((event) => {
|
|
1162
|
-
if (event.source.selected) {
|
|
1163
|
-
this.selectionModel.select(event.source);
|
|
1164
|
-
}
|
|
1165
|
-
else {
|
|
1166
|
-
this.selectionModel.deselect(event.source);
|
|
1167
|
-
}
|
|
1168
|
-
// For single selection tag list, make sure the deselected value is unselected.
|
|
1169
|
-
if (!this.multiple) {
|
|
1170
|
-
this.tags.forEach((tag) => {
|
|
1171
|
-
if (!this.selectionModel.isSelected(tag) && tag.selected) {
|
|
1172
|
-
tag.deselect();
|
|
1173
|
-
}
|
|
1174
|
-
});
|
|
1175
|
-
}
|
|
1176
|
-
if (event.isUserInput) {
|
|
1177
|
-
this.propagateChanges();
|
|
1178
|
-
}
|
|
1179
|
-
});
|
|
1180
|
-
}
|
|
1181
|
-
/** Listens to user-generated selection events on each tag. */
|
|
1182
1240
|
listenToTagsFocus() {
|
|
1183
|
-
this.tagFocusSubscription = this.tagFocusChanges.subscribe((
|
|
1184
|
-
const tagIndex = this.tags.toArray().indexOf(
|
|
1241
|
+
this.tagFocusSubscription = this.tagFocusChanges.subscribe(({ tag, origin }) => {
|
|
1242
|
+
const tagIndex = this.tags.toArray().indexOf(tag);
|
|
1185
1243
|
if (this.isValidIndex(tagIndex)) {
|
|
1244
|
+
this.keyManager.setFocusOrigin(origin);
|
|
1186
1245
|
this.keyManager.updateActiveItem(tagIndex);
|
|
1187
1246
|
}
|
|
1188
1247
|
this.stateChanges.next();
|
|
@@ -1209,28 +1268,12 @@ class KbqTagList {
|
|
|
1209
1268
|
.pipe(filter(({ type }) => type === 'submit'))
|
|
1210
1269
|
.subscribe(() => this.propagateTagsChanges());
|
|
1211
1270
|
}
|
|
1212
|
-
/** Checks whether an event comes from inside a tag element. */
|
|
1213
|
-
originatesFromTag(event) {
|
|
1214
|
-
let currentElement = event.target;
|
|
1215
|
-
while (currentElement && currentElement !== this.elementRef.nativeElement) {
|
|
1216
|
-
if (currentElement.classList.contains('kbq-tag')) {
|
|
1217
|
-
return true;
|
|
1218
|
-
}
|
|
1219
|
-
currentElement = currentElement.parentElement;
|
|
1220
|
-
}
|
|
1221
|
-
return false;
|
|
1222
|
-
}
|
|
1223
1271
|
/** Checks whether any of the tags is focused. */
|
|
1224
1272
|
hasFocusedTag() {
|
|
1225
1273
|
return this.tags.some((tag) => tag.hasFocus);
|
|
1226
1274
|
}
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
if (this.tags) {
|
|
1230
|
-
this.tags.forEach((tag) => {
|
|
1231
|
-
tag.disabled = this._disabled;
|
|
1232
|
-
});
|
|
1233
|
-
}
|
|
1275
|
+
syncTagsRemovableState() {
|
|
1276
|
+
this.tags?.forEach((tag) => (tag.removable = this.removable));
|
|
1234
1277
|
}
|
|
1235
1278
|
/** Revalidate control. */
|
|
1236
1279
|
revalidate() {
|
|
@@ -1240,27 +1283,66 @@ class KbqTagList {
|
|
|
1240
1283
|
control.statusChanges.emit(control.status);
|
|
1241
1284
|
}
|
|
1242
1285
|
}
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1286
|
+
setupDropListInitialProperties() {
|
|
1287
|
+
this.syncDropListDisabledState();
|
|
1288
|
+
this.dropList.elementContainerSelector = '.kbq-tags-list__list-container';
|
|
1289
|
+
this.dropList.orientation = 'mixed';
|
|
1290
|
+
this.dropList.dropped
|
|
1291
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
1292
|
+
.subscribe(({ currentIndex, previousIndex, event, item }) => {
|
|
1293
|
+
const { tag } = item.data;
|
|
1294
|
+
this.dropped.emit({ currentIndex, previousIndex, event, tag });
|
|
1295
|
+
});
|
|
1247
1296
|
}
|
|
1248
|
-
|
|
1249
|
-
|
|
1297
|
+
syncDropListDisabledState() {
|
|
1298
|
+
this.dropList.disabled = !this.draggable;
|
|
1299
|
+
}
|
|
1300
|
+
setupFocusMonitor() {
|
|
1301
|
+
this.focusMonitor.monitor(this.elementRef, true).subscribe((origin) => {
|
|
1302
|
+
if (!origin)
|
|
1303
|
+
this.unselectAll();
|
|
1304
|
+
});
|
|
1305
|
+
}
|
|
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 }); }
|
|
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: `
|
|
1308
|
+
<div class="kbq-tags-list__list-container">
|
|
1309
|
+
<ng-content />
|
|
1310
|
+
</div>
|
|
1311
|
+
|
|
1312
|
+
@if (canShowCleaner) {
|
|
1313
|
+
<div class="kbq-tags-list__cleaner">
|
|
1314
|
+
<ng-content select="kbq-cleaner" />
|
|
1315
|
+
</div>
|
|
1316
|
+
}
|
|
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 }); }
|
|
1250
1318
|
}
|
|
1251
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
1319
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTagList, decorators: [{
|
|
1252
1320
|
type: Component,
|
|
1253
|
-
args: [{ selector: 'kbq-tag-list', exportAs: 'kbqTagList',
|
|
1321
|
+
args: [{ selector: 'kbq-tag-list', exportAs: 'kbqTagList', template: `
|
|
1322
|
+
<div class="kbq-tags-list__list-container">
|
|
1323
|
+
<ng-content />
|
|
1324
|
+
</div>
|
|
1325
|
+
|
|
1326
|
+
@if (canShowCleaner) {
|
|
1327
|
+
<div class="kbq-tags-list__cleaner">
|
|
1328
|
+
<ng-content select="kbq-cleaner" />
|
|
1329
|
+
</div>
|
|
1330
|
+
}
|
|
1331
|
+
`, host: {
|
|
1254
1332
|
class: 'kbq-tag-list',
|
|
1255
1333
|
'[class.kbq-disabled]': 'disabled',
|
|
1256
1334
|
'[class.kbq-invalid]': 'errorState',
|
|
1257
|
-
'[
|
|
1335
|
+
'[class.kbq-tag-list_selectable]': 'selectable',
|
|
1336
|
+
'[class.kbq-tag-list_editable]': 'editable',
|
|
1337
|
+
'[class.kbq-tag-list_removable]': 'removable',
|
|
1338
|
+
'[class.kbq-tag-list_draggable]': 'draggable',
|
|
1339
|
+
'[attr.tabindex]': 'tabIndex',
|
|
1258
1340
|
'[id]': 'uid',
|
|
1259
1341
|
'(focus)': 'focus()',
|
|
1260
1342
|
'(blur)': 'blur()',
|
|
1261
1343
|
'(keydown)': 'keydown($event)'
|
|
1262
|
-
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: KbqFormFieldControl, useExisting: KbqTagList }],
|
|
1263
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1.ErrorStateMatcher }, { type: i2.Directionality, decorators: [{
|
|
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"] }]
|
|
1345
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1.ErrorStateMatcher }, { type: i2$1.Directionality, decorators: [{
|
|
1264
1346
|
type: Optional
|
|
1265
1347
|
}] }, { type: i3.NgForm, decorators: [{
|
|
1266
1348
|
type: Optional
|
|
@@ -1271,7 +1353,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
1271
1353
|
}, {
|
|
1272
1354
|
type: Self
|
|
1273
1355
|
}] }], propDecorators: { multiple: [{
|
|
1274
|
-
type: Input
|
|
1356
|
+
type: Input,
|
|
1357
|
+
args: [{ transform: booleanAttribute }]
|
|
1275
1358
|
}], compareWith: [{
|
|
1276
1359
|
type: Input
|
|
1277
1360
|
}], value: [{
|
|
@@ -1281,12 +1364,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
1281
1364
|
}], placeholder: [{
|
|
1282
1365
|
type: Input
|
|
1283
1366
|
}], disabled: [{
|
|
1284
|
-
type: Input
|
|
1367
|
+
type: Input,
|
|
1368
|
+
args: [{ transform: booleanAttribute }]
|
|
1369
|
+
}], draggable: [{
|
|
1370
|
+
type: Input,
|
|
1371
|
+
args: [{ transform: booleanAttribute }]
|
|
1372
|
+
}], dropped: [{
|
|
1373
|
+
type: Output
|
|
1285
1374
|
}], selectable: [{
|
|
1286
|
-
type: Input
|
|
1375
|
+
type: Input,
|
|
1376
|
+
args: [{ transform: booleanAttribute }]
|
|
1287
1377
|
}], editable: [{
|
|
1288
1378
|
type: Input,
|
|
1289
1379
|
args: [{ transform: booleanAttribute }]
|
|
1380
|
+
}], removable: [{
|
|
1381
|
+
type: Input,
|
|
1382
|
+
args: [{ transform: booleanAttribute }]
|
|
1290
1383
|
}], tabIndex: [{
|
|
1291
1384
|
type: Input
|
|
1292
1385
|
}], valueChange: [{
|
|
@@ -1311,7 +1404,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
1311
1404
|
|
|
1312
1405
|
const KbqTagInputDefaultSeparators = {
|
|
1313
1406
|
[ENTER$1]: { symbol: /\r?\n/, key: 'Enter' },
|
|
1314
|
-
[TAB]: { symbol: /\t/, key: 'Tab' },
|
|
1407
|
+
[TAB$1]: { symbol: /\t/, key: 'Tab' },
|
|
1315
1408
|
[SPACE$1]: { symbol: / /, key: ' ' },
|
|
1316
1409
|
[COMMA]: { symbol: /,/, key: ',' },
|
|
1317
1410
|
[SEMICOLON]: { symbol: /;/, key: ';' }
|
|
@@ -1373,9 +1466,8 @@ class KbqTagInput {
|
|
|
1373
1466
|
get empty() {
|
|
1374
1467
|
return !this.inputElement.value;
|
|
1375
1468
|
}
|
|
1376
|
-
constructor(elementRef,
|
|
1469
|
+
constructor(elementRef, defaultOptions, trimDirective, ngControl, autocompleteTrigger) {
|
|
1377
1470
|
this.elementRef = elementRef;
|
|
1378
|
-
this.renderer = renderer;
|
|
1379
1471
|
this.defaultOptions = defaultOptions;
|
|
1380
1472
|
this.trimDirective = trimDirective;
|
|
1381
1473
|
this.ngControl = ngControl;
|
|
@@ -1393,18 +1485,25 @@ class KbqTagInput {
|
|
|
1393
1485
|
this.id = `kbq-tag-list-input-${nextUniqueId++}`;
|
|
1394
1486
|
this._addOnBlur = true;
|
|
1395
1487
|
this._disabled = false;
|
|
1488
|
+
/**
|
|
1489
|
+
* @docs-private
|
|
1490
|
+
*
|
|
1491
|
+
* @deprecated Unused. Will be removed in next major release.
|
|
1492
|
+
*/
|
|
1396
1493
|
this.countOfSymbolsForUpdateWidth = 3;
|
|
1397
1494
|
this.inputElement = this.elementRef.nativeElement;
|
|
1398
|
-
this.setDefaultInputWidth();
|
|
1399
1495
|
this._separators = this.defaultOptions.separators || KbqTagInputDefaultSeparators;
|
|
1400
1496
|
this._addOnPaste = isBoolean(this.defaultOptions.addOnPaste) ? this.defaultOptions.addOnPaste : true;
|
|
1401
1497
|
}
|
|
1402
1498
|
ngOnChanges() {
|
|
1403
1499
|
this._tagList.stateChanges.next();
|
|
1404
1500
|
}
|
|
1501
|
+
/** @docs-private */
|
|
1405
1502
|
onKeydown(event) {
|
|
1406
1503
|
if (!this.inputElement.value) {
|
|
1407
1504
|
this._tagList.keydown(event);
|
|
1505
|
+
event.stopPropagation();
|
|
1506
|
+
return;
|
|
1408
1507
|
}
|
|
1409
1508
|
if (this.isSeparatorKey(event) && this.inputElement.value) {
|
|
1410
1509
|
this.emitTagEnd();
|
|
@@ -1436,7 +1535,6 @@ class KbqTagInput {
|
|
|
1436
1535
|
if (this.distinct && this.hasDuplicates)
|
|
1437
1536
|
return;
|
|
1438
1537
|
this.tagEnd.emit({ input: this.inputElement, value: this.trimValue(this.inputElement.value) });
|
|
1439
|
-
this.updateInputWidth();
|
|
1440
1538
|
}
|
|
1441
1539
|
}
|
|
1442
1540
|
get hasDuplicates() {
|
|
@@ -1445,7 +1543,6 @@ class KbqTagInput {
|
|
|
1445
1543
|
.some((tagValue) => tagValue === this.trimValue(this.inputElement.value));
|
|
1446
1544
|
}
|
|
1447
1545
|
onInput() {
|
|
1448
|
-
this.updateInputWidth();
|
|
1449
1546
|
// Let tag list know whenever the value changes.
|
|
1450
1547
|
this._tagList.stateChanges.next();
|
|
1451
1548
|
}
|
|
@@ -1457,13 +1554,12 @@ class KbqTagInput {
|
|
|
1457
1554
|
if ((data && data.length === 0) || !this.addOnPaste) {
|
|
1458
1555
|
return;
|
|
1459
1556
|
}
|
|
1460
|
-
const
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
}
|
|
1557
|
+
const separatorsInString = this.getSeparatorsForString(data);
|
|
1558
|
+
// prettier-ignore
|
|
1559
|
+
const dividedString = separatorsInString.length > 0 ?
|
|
1560
|
+
[...data.split(new RegExp(`${separatorsInString.join('|')}`))] :
|
|
1561
|
+
[data];
|
|
1562
|
+
const items = dividedString.map((item) => this.trimValue(item));
|
|
1467
1563
|
if (items.length === 0) {
|
|
1468
1564
|
items.push(data);
|
|
1469
1565
|
}
|
|
@@ -1471,30 +1567,30 @@ class KbqTagInput {
|
|
|
1471
1567
|
items
|
|
1472
1568
|
.filter((item) => !tagValues.includes(item))
|
|
1473
1569
|
.forEach((item) => this.tagEnd.emit({ input: this.inputElement, value: item }));
|
|
1474
|
-
this.updateInputWidth();
|
|
1475
1570
|
$event.preventDefault();
|
|
1476
1571
|
$event.stopPropagation();
|
|
1477
1572
|
}
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
}
|
|
1486
|
-
else {
|
|
1487
|
-
this.setDefaultInputWidth();
|
|
1488
|
-
}
|
|
1489
|
-
}
|
|
1573
|
+
/**
|
|
1574
|
+
* @docs-private
|
|
1575
|
+
*
|
|
1576
|
+
* @deprecated Unused. Will be removed in next major release.
|
|
1577
|
+
*/
|
|
1578
|
+
updateInputWidth() { }
|
|
1579
|
+
/** @docs-private */
|
|
1490
1580
|
onFocus() {
|
|
1491
1581
|
this.focused = true;
|
|
1582
|
+
this._tagList.unselectAll();
|
|
1492
1583
|
this._tagList.stateChanges.next();
|
|
1493
1584
|
}
|
|
1494
1585
|
/** Focuses the input. */
|
|
1495
1586
|
focus() {
|
|
1496
1587
|
this.inputElement.focus();
|
|
1497
1588
|
}
|
|
1589
|
+
getSeparatorsForString(value) {
|
|
1590
|
+
return this.separators
|
|
1591
|
+
.filter((separator) => value.search(separator.key) > -1)
|
|
1592
|
+
.map((separator) => separator.key);
|
|
1593
|
+
}
|
|
1498
1594
|
trimValue(value) {
|
|
1499
1595
|
return this.trimDirective ? this.trimDirective.trim(value) : value;
|
|
1500
1596
|
}
|
|
@@ -1508,17 +1604,14 @@ class KbqTagInput {
|
|
|
1508
1604
|
hasControl() {
|
|
1509
1605
|
return !!this.ngControl;
|
|
1510
1606
|
}
|
|
1511
|
-
setDefaultInputWidth() {
|
|
1512
|
-
this.renderer.setStyle(this.inputElement, 'width', '30px');
|
|
1513
|
-
}
|
|
1514
1607
|
/** Checks whether a keycode is one of the configured separators. */
|
|
1515
1608
|
isSeparatorKey(event) {
|
|
1516
1609
|
return this.separators.some((separator) => separator.key === event.key && !event.shiftKey);
|
|
1517
1610
|
}
|
|
1518
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
1519
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.
|
|
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 }); }
|
|
1520
1613
|
}
|
|
1521
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
1614
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTagInput, decorators: [{
|
|
1522
1615
|
type: Directive,
|
|
1523
1616
|
args: [{
|
|
1524
1617
|
selector: 'input[kbqTagInputFor]',
|
|
@@ -1533,9 +1626,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
1533
1626
|
'(focus)': 'onFocus()',
|
|
1534
1627
|
'(input)': 'onInput()',
|
|
1535
1628
|
'(paste)': 'onPaste($event)'
|
|
1536
|
-
}
|
|
1629
|
+
},
|
|
1630
|
+
hostDirectives: [KbqFieldSizingContent]
|
|
1537
1631
|
}]
|
|
1538
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type:
|
|
1632
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: undefined, decorators: [{
|
|
1539
1633
|
type: Inject,
|
|
1540
1634
|
args: [KBQ_TAGS_DEFAULT_OPTIONS]
|
|
1541
1635
|
}] }, { type: i1$1.KbqTrim, decorators: [{
|
|
@@ -1580,8 +1674,8 @@ const COMPONENTS = [
|
|
|
1580
1674
|
KbqTagEditInput
|
|
1581
1675
|
];
|
|
1582
1676
|
class KbqTagsModule {
|
|
1583
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.
|
|
1584
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.
|
|
1677
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTagsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1678
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: KbqTagsModule, declarations: [KbqTagList,
|
|
1585
1679
|
KbqTag,
|
|
1586
1680
|
KbqTagInput,
|
|
1587
1681
|
KbqTagTrailingIcon,
|
|
@@ -1594,14 +1688,14 @@ class KbqTagsModule {
|
|
|
1594
1688
|
KbqTagAvatar,
|
|
1595
1689
|
KbqTagRemove, KbqTagEditSubmit,
|
|
1596
1690
|
KbqTagEditInput] }); }
|
|
1597
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.
|
|
1691
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTagsModule, providers: [
|
|
1598
1692
|
{
|
|
1599
1693
|
provide: KBQ_TAGS_DEFAULT_OPTIONS,
|
|
1600
1694
|
useValue: { separatorKeyCodes: [ENTER$1] }
|
|
1601
1695
|
}
|
|
1602
1696
|
], imports: [PlatformModule] }); }
|
|
1603
1697
|
}
|
|
1604
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.
|
|
1698
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: KbqTagsModule, decorators: [{
|
|
1605
1699
|
type: NgModule,
|
|
1606
1700
|
args: [{
|
|
1607
1701
|
imports: [
|