@koobiq/components 19.8.3 → 20.1.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-trigger.component.scss +0 -18
- package/accordion/accordion.component.scss +9 -2
- package/accordion/index.d.ts +238 -1
- package/actions-panel/index.d.ts +304 -5
- package/alert/_alert-theme.scss +0 -4
- package/alert/alert-tokens.scss +4 -4
- package/alert/index.d.ts +54 -1
- package/app-switcher/app-switcher-dropdown-app.scss +2 -0
- package/app-switcher/index.d.ts +239 -1
- package/autocomplete/index.d.ts +265 -1
- package/badge/index.d.ts +57 -1
- package/breadcrumbs/breadcrumbs.scss +4 -0
- package/breadcrumbs/index.d.ts +244 -1
- package/button/button-group.scss +42 -2
- package/button/index.d.ts +153 -1
- package/button-toggle/button-toggle.scss +23 -0
- package/button-toggle/index.d.ts +157 -1
- package/checkbox/checkbox.scss +5 -4
- package/checkbox/index.d.ts +159 -1
- package/clamped-text/index.d.ts +145 -4
- package/code-block/_code-block-theme.scss +0 -6
- package/code-block/code-block-tokens.scss +0 -2
- package/code-block/index.d.ts +383 -1
- package/content-panel/content-panel.scss +0 -8
- package/content-panel/index.d.ts +158 -2
- package/core/highlight/_highlight-theme.scss +9 -0
- package/core/index.d.ts +4794 -1
- package/core/styles/_koobiq-theme.scss +1 -0
- package/core/styles/common/_animation.scss +4 -0
- package/core/styles/common/_overlay.scss +3 -4
- package/core/styles/theming/_components-theming.scss +1 -63
- package/core/styles/theming/_scrollbar-theme.scss +4 -0
- package/datepicker/_datepicker-theme.scss +1 -1
- package/datepicker/datepicker-toggle.scss +3 -3
- package/datepicker/index.d.ts +699 -1
- package/divider/index.d.ts +20 -1
- package/dl/index.d.ts +38 -1
- package/dropdown/dropdown.scss +2 -2
- package/dropdown/index.d.ts +473 -1
- package/dynamic-translation/index.d.ts +81 -2
- package/ellipsis-center/index.d.ts +38 -1
- package/empty-state/index.d.ts +45 -1
- package/fesm2022/koobiq-components-accordion.mjs +104 -115
- package/fesm2022/koobiq-components-accordion.mjs.map +1 -1
- package/fesm2022/koobiq-components-actions-panel.mjs +16 -16
- package/fesm2022/koobiq-components-actions-panel.mjs.map +1 -1
- package/fesm2022/koobiq-components-alert.mjs +35 -49
- package/fesm2022/koobiq-components-alert.mjs.map +1 -1
- package/fesm2022/koobiq-components-app-switcher.mjs +82 -87
- package/fesm2022/koobiq-components-app-switcher.mjs.map +1 -1
- package/fesm2022/koobiq-components-autocomplete.mjs +294 -304
- package/fesm2022/koobiq-components-autocomplete.mjs.map +1 -1
- package/fesm2022/koobiq-components-badge.mjs +35 -42
- package/fesm2022/koobiq-components-badge.mjs.map +1 -1
- package/fesm2022/koobiq-components-breadcrumbs.mjs +79 -101
- package/fesm2022/koobiq-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/koobiq-components-button-toggle.mjs +92 -88
- package/fesm2022/koobiq-components-button-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-button.mjs +56 -51
- package/fesm2022/koobiq-components-button.mjs.map +1 -1
- package/fesm2022/koobiq-components-checkbox.mjs +50 -52
- package/fesm2022/koobiq-components-checkbox.mjs.map +1 -1
- package/fesm2022/koobiq-components-clamped-text.mjs +46 -49
- package/fesm2022/koobiq-components-clamped-text.mjs.map +1 -1
- package/fesm2022/koobiq-components-code-block.mjs +115 -136
- package/fesm2022/koobiq-components-code-block.mjs.map +1 -1
- package/fesm2022/koobiq-components-content-panel.mjs +90 -107
- package/fesm2022/koobiq-components-content-panel.mjs.map +1 -1
- package/fesm2022/koobiq-components-core.mjs +2048 -703
- package/fesm2022/koobiq-components-core.mjs.map +1 -1
- package/fesm2022/koobiq-components-datepicker.mjs +285 -349
- package/fesm2022/koobiq-components-datepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-divider.mjs +14 -25
- package/fesm2022/koobiq-components-divider.mjs.map +1 -1
- package/fesm2022/koobiq-components-dl.mjs +30 -31
- package/fesm2022/koobiq-components-dl.mjs.map +1 -1
- package/fesm2022/koobiq-components-dropdown.mjs +159 -160
- package/fesm2022/koobiq-components-dropdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-dynamic-translation.mjs +23 -23
- package/fesm2022/koobiq-components-dynamic-translation.mjs.map +1 -1
- package/fesm2022/koobiq-components-ellipsis-center.mjs +16 -21
- package/fesm2022/koobiq-components-ellipsis-center.mjs.map +1 -1
- package/fesm2022/koobiq-components-empty-state.mjs +35 -39
- package/fesm2022/koobiq-components-empty-state.mjs.map +1 -1
- package/fesm2022/koobiq-components-file-upload.mjs +160 -248
- package/fesm2022/koobiq-components-file-upload.mjs.map +1 -1
- package/fesm2022/koobiq-components-filter-bar.mjs +1160 -1184
- package/fesm2022/koobiq-components-filter-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-flag.mjs +66 -0
- package/fesm2022/koobiq-components-flag.mjs.map +1 -0
- package/fesm2022/koobiq-components-form-field.mjs +211 -430
- package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
- package/fesm2022/koobiq-components-icon.mjs +42 -43
- package/fesm2022/koobiq-components-icon.mjs.map +1 -1
- package/fesm2022/koobiq-components-inline-edit.mjs +85 -61
- package/fesm2022/koobiq-components-inline-edit.mjs.map +1 -1
- package/fesm2022/koobiq-components-input.mjs +116 -155
- package/fesm2022/koobiq-components-input.mjs.map +1 -1
- package/fesm2022/koobiq-components-link.mjs +38 -53
- package/fesm2022/koobiq-components-link.mjs.map +1 -1
- package/fesm2022/koobiq-components-list.mjs +138 -128
- package/fesm2022/koobiq-components-list.mjs.map +1 -1
- package/fesm2022/koobiq-components-loader-overlay.mjs +38 -45
- package/fesm2022/koobiq-components-loader-overlay.mjs.map +1 -1
- package/fesm2022/koobiq-components-markdown.mjs +31 -35
- package/fesm2022/koobiq-components-markdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-modal.mjs +174 -164
- package/fesm2022/koobiq-components-modal.mjs.map +1 -1
- package/fesm2022/koobiq-components-navbar.mjs +164 -169
- package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
- package/fesm2022/koobiq-components-notification-center.mjs +80 -59
- package/fesm2022/koobiq-components-notification-center.mjs.map +1 -1
- package/fesm2022/koobiq-components-overflow-items.mjs +40 -36
- package/fesm2022/koobiq-components-overflow-items.mjs.map +1 -1
- package/fesm2022/koobiq-components-popover.mjs +94 -85
- package/fesm2022/koobiq-components-popover.mjs.map +1 -1
- package/fesm2022/koobiq-components-progress-bar.mjs +24 -30
- package/fesm2022/koobiq-components-progress-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-progress-spinner.mjs +25 -32
- package/fesm2022/koobiq-components-progress-spinner.mjs.map +1 -1
- package/fesm2022/koobiq-components-radio.mjs +95 -85
- package/fesm2022/koobiq-components-radio.mjs.map +1 -1
- package/fesm2022/koobiq-components-resizer.mjs +17 -17
- package/fesm2022/koobiq-components-resizer.mjs.map +1 -1
- package/fesm2022/koobiq-components-scrollbar.mjs +69 -60
- package/fesm2022/koobiq-components-scrollbar.mjs.map +1 -1
- package/fesm2022/koobiq-components-search-expandable.mjs +44 -35
- package/fesm2022/koobiq-components-search-expandable.mjs.map +1 -1
- package/fesm2022/koobiq-components-select.mjs +279 -244
- package/fesm2022/koobiq-components-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-sidebar.mjs +63 -55
- package/fesm2022/koobiq-components-sidebar.mjs.map +1 -1
- package/fesm2022/koobiq-components-sidepanel.mjs +88 -128
- package/fesm2022/koobiq-components-sidepanel.mjs.map +1 -1
- package/fesm2022/koobiq-components-skeleton.mjs +13 -13
- package/fesm2022/koobiq-components-skeleton.mjs.map +1 -1
- package/fesm2022/koobiq-components-split-button.mjs +29 -22
- package/fesm2022/koobiq-components-split-button.mjs.map +1 -1
- package/fesm2022/koobiq-components-splitter.mjs +114 -96
- package/fesm2022/koobiq-components-splitter.mjs.map +1 -1
- package/fesm2022/koobiq-components-table.mjs +23 -23
- package/fesm2022/koobiq-components-table.mjs.map +1 -1
- package/fesm2022/koobiq-components-tabs.mjs +260 -275
- package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
- package/fesm2022/koobiq-components-tags.mjs +179 -267
- package/fesm2022/koobiq-components-tags.mjs.map +1 -1
- package/fesm2022/koobiq-components-textarea.mjs +42 -68
- package/fesm2022/koobiq-components-textarea.mjs.map +1 -1
- package/fesm2022/koobiq-components-time-range.mjs +65 -66
- package/fesm2022/koobiq-components-time-range.mjs.map +1 -1
- package/fesm2022/koobiq-components-timepicker.mjs +46 -38
- package/fesm2022/koobiq-components-timepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-timezone.mjs +58 -58
- package/fesm2022/koobiq-components-timezone.mjs.map +1 -1
- package/fesm2022/koobiq-components-title.mjs +150 -39
- package/fesm2022/koobiq-components-title.mjs.map +1 -1
- package/fesm2022/koobiq-components-toast.mjs +54 -69
- package/fesm2022/koobiq-components-toast.mjs.map +1 -1
- package/fesm2022/koobiq-components-toggle.mjs +51 -63
- package/fesm2022/koobiq-components-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-tooltip.mjs +141 -121
- package/fesm2022/koobiq-components-tooltip.mjs.map +1 -1
- package/fesm2022/koobiq-components-top-bar.mjs +22 -25
- package/fesm2022/koobiq-components-top-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree-select.mjs +264 -231
- package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree.mjs +273 -239
- package/fesm2022/koobiq-components-tree.mjs.map +1 -1
- package/fesm2022/koobiq-components-username.mjs +62 -49
- package/fesm2022/koobiq-components-username.mjs.map +1 -1
- package/file-upload/file-upload-tokens.scss +1 -0
- package/file-upload/index.d.ts +577 -1
- package/filter-bar/_filter-bar-theme.scss +86 -0
- package/filter-bar/filter-bar-tokens.scss +6 -0
- package/filter-bar/filter-bar.scss +10 -4
- package/filter-bar/filter-refresher.scss +1 -1
- package/filter-bar/filters.scss +23 -19
- package/filter-bar/index.d.ts +1165 -1
- package/filter-bar/pipes/base-pipe.scss +14 -35
- package/filter-bar/pipes/pipe-date.scss +20 -14
- package/filter-bar/pipes/pipe-multi-tree-select.scss +5 -3
- package/filter-bar/pipes/pipe-multiselect.scss +5 -3
- package/filter-bar/pipes/pipe-readonly.scss +4 -13
- package/filter-bar/pipes/pipe-select.scss +3 -1
- package/filter-bar/pipes/pipe-tree-select.scss +3 -1
- package/flag/flag.scss +53 -0
- package/flag/index.d.ts +44 -0
- package/form-field/index.d.ts +569 -1
- package/icon/index.d.ts +162 -1
- package/index.d.ts +2 -1
- package/inline-edit/index.d.ts +176 -2
- package/inline-edit/inline-edit.scss +7 -7
- package/input/index.d.ts +339 -1
- package/link/index.d.ts +56 -1
- package/link/link-tokens.scss +2 -2
- package/list/index.d.ts +229 -1
- package/loader-overlay/index.d.ts +57 -1
- package/loader-overlay/loader-overlay-tokens.scss +1 -1
- package/markdown/index.d.ts +68 -1
- package/modal/_modal-animation.scss +6 -6
- package/modal/_modal-theme.scss +3 -6
- package/modal/index.d.ts +313 -1
- package/modal/modal.scss +15 -0
- package/navbar/index.d.ts +305 -1
- package/navbar/navbar.scss +1 -2
- package/notification-center/index.d.ts +322 -1
- package/notification-center/notification-center.scss +14 -9
- package/notification-center/notification-item.scss +2 -1
- package/overflow-items/index.d.ts +162 -2
- package/package.json +13 -17
- package/popover/index.d.ts +182 -1
- package/popover/popover.scss +8 -12
- package/prebuilt-themes/dark-theme.css +1 -1
- package/prebuilt-themes/light-theme.css +1 -1
- package/prebuilt-themes/theme.css +1 -1
- package/progress-bar/index.d.ts +31 -1
- package/progress-bar/progress-bar.scss +4 -0
- package/progress-spinner/index.d.ts +37 -1
- package/progress-spinner/progress-spinner.scss +5 -1
- package/radio/index.d.ts +203 -1
- package/radio/radio.scss +18 -4
- package/resizer/index.d.ts +85 -2
- package/schematics/collection.json +10 -0
- package/schematics/migrations/css-selectors/index.js +1 -1
- package/schematics/migrations/deprecated-icons/index.js +1 -1
- package/schematics/migrations/filter-bar-signals/README.md +66 -0
- package/schematics/migrations/filter-bar-signals/data.js +72 -0
- package/schematics/migrations/filter-bar-signals/index.js +316 -0
- package/schematics/migrations/filter-bar-signals/schema.json +20 -0
- package/schematics/migrations/new-icons-pack/index.js +1 -1
- package/schematics/migrations/v20-upgrade/README.md +72 -0
- package/schematics/migrations/v20-upgrade/data.js +274 -0
- package/schematics/migrations/v20-upgrade/index.js +222 -0
- package/schematics/migrations/v20-upgrade/schema.json +20 -0
- package/schematics/migrations.json +15 -0
- package/schematics/ng-add/index.js +3 -4
- package/scrollbar/index.d.ts +136 -1
- package/search-expandable/index.d.ts +98 -1
- package/select/index.d.ts +701 -1
- package/sidebar/index.d.ts +93 -1
- package/sidepanel/index.d.ts +263 -1
- package/sidepanel/sidepanel.scss +0 -8
- package/skeleton/index.d.ts +26 -2
- package/skeleton/skeleton.scss +4 -0
- package/split-button/_split-button-theme.scss +2 -2
- package/split-button/index.d.ts +46 -1
- package/splitter/_splitter-theme.scss +2 -2
- package/splitter/index.d.ts +142 -1
- package/table/_table-theme.scss +4 -0
- package/table/index.d.ts +24 -1
- package/tabs/index.d.ts +647 -1
- package/tabs/tab-header.scss +1 -0
- package/tabs/tabs-tokens.scss +1 -1
- package/tags/index.d.ts +706 -1
- package/textarea/index.d.ts +133 -1
- package/time-range/index.d.ts +310 -7
- package/time-range/time-range.scss +0 -8
- package/timepicker/index.d.ts +193 -1
- package/timepicker/timepicker.scss +2 -2
- package/timezone/index.d.ts +123 -1
- package/title/index.d.ts +131 -1
- package/toast/index.d.ts +164 -1
- package/toggle/index.d.ts +84 -1
- package/tooltip/index.d.ts +211 -1
- package/top-bar/index.d.ts +33 -1
- package/top-bar/top-bar.scss +1 -2
- package/tree/_tree-theme.scss +2 -7
- package/tree/index.d.ts +733 -1
- package/tree/toggle.scss +5 -0
- package/tree/tree-option.scss +20 -11
- package/tree-select/_tree-select-theme.scss +1 -1
- package/tree-select/index.d.ts +384 -1
- package/username/index.d.ts +194 -5
- package/accordion/accordion-content.d.ts +0 -6
- package/accordion/accordion-content.directive.d.ts +0 -27
- package/accordion/accordion-header.d.ts +0 -6
- package/accordion/accordion-header.directive.d.ts +0 -7
- package/accordion/accordion-item.d.ts +0 -77
- package/accordion/accordion-trigger.component.d.ts +0 -24
- package/accordion/accordion-trigger.directive.d.ts +0 -21
- package/accordion/accordion.component.d.ts +0 -79
- package/accordion/accordion.module.d.ts +0 -12
- package/accordion/public-api.d.ts +0 -9
- package/actions-panel/actions-panel-config.d.ts +0 -82
- package/actions-panel/actions-panel-container.d.ts +0 -90
- package/actions-panel/actions-panel-ref.d.ts +0 -44
- package/actions-panel/actions-panel.d.ts +0 -85
- package/actions-panel/module.d.ts +0 -7
- package/alert/alert.component.d.ts +0 -43
- package/alert/alert.module.d.ts +0 -9
- package/alert/public-api.d.ts +0 -2
- package/app-switcher/app-switcher-animations.d.ts +0 -5
- package/app-switcher/app-switcher-dropdown-app.d.ts +0 -11
- package/app-switcher/app-switcher-dropdown-site.d.ts +0 -9
- package/app-switcher/app-switcher.d.ts +0 -198
- package/app-switcher/app-switcher.module.d.ts +0 -10
- package/app-switcher/kbq-app-switcher-list-item.d.ts +0 -16
- package/app-switcher/public-api.d.ts +0 -6
- package/autocomplete/autocomplete-origin.directive.d.ts +0 -12
- package/autocomplete/autocomplete-trigger.directive.d.ts +0 -169
- package/autocomplete/autocomplete.component.d.ts +0 -88
- package/autocomplete/autocomplete.module.d.ts +0 -12
- package/autocomplete/public-api.d.ts +0 -4
- package/badge/badge.component.d.ts +0 -46
- package/badge/badge.module.d.ts +0 -9
- package/badge/public-api.d.ts +0 -2
- package/breadcrumbs/breadcrumbs.d.ts +0 -121
- package/breadcrumbs/breadcrumbs.module.d.ts +0 -7
- package/breadcrumbs/breadcrumbs.types.d.ts +0 -22
- package/breadcrumbs/public-api.d.ts +0 -5
- package/breadcrumbs/roving-focus-group.directive.d.ts +0 -50
- package/breadcrumbs/roving-focus-item.directive.d.ts +0 -50
- package/breadcrumbs/utils.d.ts +0 -19
- package/button/button-group.d.ts +0 -45
- package/button/button-slots.d.ts +0 -11
- package/button/button.component.d.ts +0 -74
- package/button/button.dropdown-trigger.directive.d.ts +0 -14
- package/button/button.module.d.ts +0 -13
- package/button/public-api.d.ts +0 -5
- package/button-toggle/button-toggle.component.d.ts +0 -146
- package/button-toggle/button-toggle.module.d.ts +0 -9
- package/button-toggle/public-api.d.ts +0 -2
- package/checkbox/checkbox-config.d.ts +0 -13
- package/checkbox/checkbox-module.d.ts +0 -9
- package/checkbox/checkbox-required-validator.d.ts +0 -13
- package/checkbox/checkbox.d.ts +0 -128
- package/checkbox/public-api.d.ts +0 -4
- package/clamped-text/clamped-list.d.ts +0 -41
- package/clamped-text/clamped-text.d.ts +0 -65
- package/clamped-text/constants.d.ts +0 -34
- package/clamped-text/module.d.ts +0 -8
- package/code-block/code-block-highlight.d.ts +0 -98
- package/code-block/code-block.d.ts +0 -259
- package/code-block/code-block.module.d.ts +0 -7
- package/code-block/public-api.d.ts +0 -4
- package/code-block/types.d.ts +0 -36
- package/content-panel/content-panel.d.ts +0 -149
- package/content-panel/module.d.ts +0 -7
- package/core/animation/animation.d.ts +0 -37
- package/core/animation/fade-animations.d.ts +0 -2
- package/core/animation/index.d.ts +0 -3
- package/core/animation/select-animations.d.ts +0 -12
- package/core/common-behaviors/checkbox.d.ts +0 -5
- package/core/common-behaviors/clipboard.d.ts +0 -12
- package/core/common-behaviors/color.d.ts +0 -50
- package/core/common-behaviors/common-module.d.ts +0 -38
- package/core/common-behaviors/constructor.d.ts +0 -9
- package/core/common-behaviors/disabled.d.ts +0 -8
- package/core/common-behaviors/error-state.d.ts +0 -46
- package/core/common-behaviors/flex.d.ts +0 -4
- package/core/common-behaviors/hover.d.ts +0 -15
- package/core/common-behaviors/index.d.ts +0 -14
- package/core/common-behaviors/orientation.d.ts +0 -4
- package/core/common-behaviors/read-state.d.ts +0 -12
- package/core/common-behaviors/size.d.ts +0 -4
- package/core/common-behaviors/tabindex.d.ts +0 -8
- package/core/datetime/date-adapter.d.ts +0 -12
- package/core/datetime/date-formats.d.ts +0 -4
- package/core/datetime/index.d.ts +0 -2
- package/core/error/error-state-matcher.d.ts +0 -39
- package/core/form-field/field-sizing-content.d.ts +0 -21
- package/core/form-field/form-field-ref.d.ts +0 -28
- package/core/form-field/index.d.ts +0 -2
- package/core/formatters/date/formatter.d.ts +0 -11
- package/core/formatters/date/formatter.pipe.d.ts +0 -139
- package/core/formatters/filesize/config.d.ts +0 -66
- package/core/formatters/filesize/formatter.d.ts +0 -17
- package/core/formatters/filesize/index.d.ts +0 -3
- package/core/formatters/filesize/size.d.ts +0 -52
- package/core/formatters/index.d.ts +0 -13
- package/core/formatters/number/formatter.d.ts +0 -101
- package/core/forms/forms-module.d.ts +0 -7
- package/core/forms/forms.directive.d.ts +0 -22
- package/core/forms/index.d.ts +0 -3
- package/core/forms/validators.d.ts +0 -120
- package/core/highlight/highlight.pipe.d.ts +0 -10
- package/core/highlight/index.d.ts +0 -9
- package/core/line/line.d.ts +0 -23
- package/core/locales/en-US.d.ts +0 -176
- package/core/locales/es-LA.d.ts +0 -175
- package/core/locales/formatters.d.ts +0 -190
- package/core/locales/index.d.ts +0 -9
- package/core/locales/locale-service.d.ts +0 -1117
- package/core/locales/locale-service.module.d.ts +0 -6
- package/core/locales/pt-BR.d.ts +0 -175
- package/core/locales/ru-RU.d.ts +0 -176
- package/core/locales/tk-TM.d.ts +0 -176
- package/core/locales/types.d.ts +0 -77
- package/core/navbar/index.d.ts +0 -1
- package/core/navbar/rectangle-item.d.ts +0 -14
- package/core/option/action-container.d.ts +0 -5
- package/core/option/action.d.ts +0 -38
- package/core/option/index.d.ts +0 -5
- package/core/option/optgroup.d.ts +0 -16
- package/core/option/option-module.d.ts +0 -10
- package/core/option/option.d.ts +0 -170
- package/core/overlay/overlay-position-map.d.ts +0 -40
- package/core/pop-up/constants.d.ts +0 -56
- package/core/pop-up/focus-trap-strategy.d.ts +0 -5
- package/core/pop-up/index.d.ts +0 -5
- package/core/pop-up/pop-up-styles.d.ts +0 -2
- package/core/pop-up/pop-up-trigger.d.ts +0 -104
- package/core/pop-up/pop-up.d.ts +0 -57
- package/core/public-api.d.ts +0 -23
- package/core/select/common.d.ts +0 -59
- package/core/select/constants.d.ts +0 -22
- package/core/select/errors.d.ts +0 -19
- package/core/select/events.d.ts +0 -1
- package/core/select/index.d.ts +0 -4
- package/core/selection/constants.d.ts +0 -4
- package/core/selection/index.d.ts +0 -3
- package/core/selection/pseudo-checkbox/pseudo-checkbox.d.ts +0 -23
- package/core/selection/pseudo-checkbox/pseudo-checkbox.module.d.ts +0 -8
- package/core/services/measure-scrollbar.service.d.ts +0 -11
- package/core/services/theme.service.d.ts +0 -41
- package/core/title/index.d.ts +0 -1
- package/core/title/title-text-ref.d.ts +0 -6
- package/core/tokens/index.d.ts +0 -1
- package/core/tokens/window.d.ts +0 -5
- package/core/utils/dom.d.ts +0 -4
- package/core/utils/index.d.ts +0 -2
- package/core/utils/public-api.d.ts +0 -1
- package/core/utils/utils.d.ts +0 -25
- package/core/validation/index.d.ts +0 -1
- package/core/validation/validation.d.ts +0 -29
- package/core/version.d.ts +0 -2
- package/datepicker/calendar-body.component.d.ts +0 -55
- package/datepicker/calendar-header.component.d.ts +0 -51
- package/datepicker/calendar.component.d.ts +0 -89
- package/datepicker/datepicker-animations.d.ts +0 -9
- package/datepicker/datepicker-errors.d.ts +0 -2
- package/datepicker/datepicker-input.directive.d.ts +0 -221
- package/datepicker/datepicker-intl.d.ts +0 -32
- package/datepicker/datepicker-module.d.ts +0 -21
- package/datepicker/datepicker-toggle.component.d.ts +0 -57
- package/datepicker/datepicker.component.d.ts +0 -148
- package/datepicker/month-view.component.d.ts +0 -73
- package/datepicker/public-api.d.ts +0 -10
- package/divider/divider.component.d.ts +0 -18
- package/divider/divider.module.d.ts +0 -8
- package/divider/public-api.d.ts +0 -2
- package/dl/dl.component.d.ts +0 -26
- package/dl/dl.module.d.ts +0 -9
- package/dl/public-api.d.ts +0 -2
- package/dropdown/dropdown-animations.d.ts +0 -11
- package/dropdown/dropdown-content.directive.d.ts +0 -32
- package/dropdown/dropdown-errors.d.ts +0 -17
- package/dropdown/dropdown-item.component.d.ts +0 -52
- package/dropdown/dropdown-trigger.directive.d.ts +0 -167
- package/dropdown/dropdown.component.d.ts +0 -134
- package/dropdown/dropdown.module.d.ts +0 -13
- package/dropdown/dropdown.types.d.ts +0 -67
- package/dropdown/public-api.d.ts +0 -8
- package/dynamic-translation/dynamic-translation.d.ts +0 -72
- package/dynamic-translation/module.d.ts +0 -7
- package/ellipsis-center/ellipsis-center.directive.d.ts +0 -36
- package/ellipsis-center/public-api.d.ts +0 -1
- package/empty-state/empty-state.component.d.ts +0 -36
- package/empty-state/empty-state.module.d.ts +0 -9
- package/empty-state/public-api.d.ts +0 -2
- package/fesm2022/koobiq-components-navbar-ic.mjs +0 -863
- package/fesm2022/koobiq-components-navbar-ic.mjs.map +0 -1
- package/fesm2022/koobiq-components-risk-level.mjs +0 -75
- package/fesm2022/koobiq-components-risk-level.mjs.map +0 -1
- package/file-upload/dropzone.d.ts +0 -147
- package/file-upload/file-upload.d.ts +0 -102
- package/file-upload/file-upload.module.d.ts +0 -20
- package/file-upload/multiple-file-upload.component.d.ts +0 -138
- package/file-upload/primitives/file-drop.d.ts +0 -35
- package/file-upload/primitives/file-picker.d.ts +0 -82
- package/file-upload/primitives/index.d.ts +0 -2
- package/file-upload/public-api.d.ts +0 -7
- package/file-upload/single-file-upload.component.d.ts +0 -118
- package/filter-bar/filter-bar-button.d.ts +0 -14
- package/filter-bar/filter-bar.d.ts +0 -81
- package/filter-bar/filter-bar.module.d.ts +0 -17
- package/filter-bar/filter-bar.types.d.ts +0 -143
- package/filter-bar/filter-refresher.d.ts +0 -5
- package/filter-bar/filter-reset.d.ts +0 -15
- package/filter-bar/filter-search.d.ts +0 -54
- package/filter-bar/filter-search.scss +0 -12
- package/filter-bar/filters.d.ts +0 -122
- package/filter-bar/pipe-add.d.ts +0 -28
- package/filter-bar/pipe.directive.d.ts +0 -13
- package/filter-bar/pipes/base-pipe.d.ts +0 -74
- package/filter-bar/pipes/pipe-button.d.ts +0 -21
- package/filter-bar/pipes/pipe-date.d.ts +0 -65
- package/filter-bar/pipes/pipe-datetime.d.ts +0 -66
- package/filter-bar/pipes/pipe-multi-select.d.ts +0 -56
- package/filter-bar/pipes/pipe-multi-tree-select.d.ts +0 -67
- package/filter-bar/pipes/pipe-readonly.d.ts +0 -7
- package/filter-bar/pipes/pipe-select.d.ts +0 -30
- package/filter-bar/pipes/pipe-state.d.ts +0 -21
- package/filter-bar/pipes/pipe-text.d.ts +0 -26
- package/filter-bar/pipes/pipe-title.d.ts +0 -27
- package/filter-bar/pipes/pipe-tree-select.d.ts +0 -42
- package/filter-bar/public-api.d.ts +0 -21
- package/form-field/cleaner.d.ts +0 -11
- package/form-field/error.d.ts +0 -8
- package/form-field/fieldset.d.ts +0 -27
- package/form-field/form-field-control.d.ts +0 -40
- package/form-field/form-field.d.ts +0 -298
- package/form-field/form-field.module.d.ts +0 -19
- package/form-field/hint.d.ts +0 -15
- package/form-field/label.d.ts +0 -6
- package/form-field/password-hint.d.ts +0 -53
- package/form-field/password-toggle.d.ts +0 -56
- package/form-field/prefix.d.ts +0 -6
- package/form-field/public-api.d.ts +0 -15
- package/form-field/reactive-password-hint.d.ts +0 -20
- package/form-field/stepper.d.ts +0 -59
- package/form-field/suffix.d.ts +0 -6
- package/form-field/validate.directive.d.ts +0 -53
- package/icon/icon-button.component.d.ts +0 -28
- package/icon/icon-item.component.d.ts +0 -11
- package/icon/icon-registry-providers.d.ts +0 -34
- package/icon/icon-registry.d.ts +0 -50
- package/icon/icon.component.d.ts +0 -33
- package/icon/icon.module.d.ts +0 -9
- package/icon/public-api.d.ts +0 -6
- package/inline-edit/inline-edit.d.ts +0 -161
- package/inline-edit/module.d.ts +0 -7
- package/input/input-errors.d.ts +0 -1
- package/input/input-number-validators.d.ts +0 -35
- package/input/input-number.d.ts +0 -96
- package/input/input-password.d.ts +0 -99
- package/input/input-value-accessor.d.ts +0 -4
- package/input/input.d.ts +0 -109
- package/input/input.module.d.ts +0 -14
- package/input/public-api.d.ts +0 -6
- package/link/link.component.d.ts +0 -53
- package/link/link.module.d.ts +0 -8
- package/link/public-api.d.ts +0 -2
- package/list/list-selection.component.d.ts +0 -196
- package/list/list.component.d.ts +0 -18
- package/list/list.module.d.ts +0 -11
- package/list/public-api.d.ts +0 -3
- package/loader-overlay/loader-overlay.component.d.ts +0 -47
- package/loader-overlay/loader-overlay.module.d.ts +0 -10
- package/loader-overlay/public-api.d.ts +0 -2
- package/markdown/markdown.component.d.ts +0 -31
- package/markdown/markdown.module.d.ts +0 -7
- package/markdown/markdown.service.d.ts +0 -19
- package/markdown/markdown.values.d.ts +0 -10
- package/markdown/public-api.d.ts +0 -4
- package/modal/css-unit.pipe.d.ts +0 -7
- package/modal/modal-control.service.d.ts +0 -20
- package/modal/modal-ref.class.d.ts +0 -37
- package/modal/modal-util.d.ts +0 -15
- package/modal/modal.component.d.ts +0 -141
- package/modal/modal.directive.d.ts +0 -20
- package/modal/modal.module.d.ts +0 -15
- package/modal/modal.service.d.ts +0 -42
- package/modal/modal.type.d.ts +0 -72
- package/modal/public-api.d.ts +0 -6
- package/navbar/navbar-brand.component.d.ts +0 -41
- package/navbar/navbar-item.component.d.ts +0 -131
- package/navbar/navbar-toggle.component.d.ts +0 -23
- package/navbar/navbar.component.d.ts +0 -68
- package/navbar/navbar.module.d.ts +0 -15
- package/navbar/public-api.d.ts +0 -6
- package/navbar/vertical-navbar.component.d.ts +0 -47
- package/navbar-ic/_navbar-ic-theme.scss +0 -81
- package/navbar-ic/index.d.ts +0 -1
- package/navbar-ic/navbar-ic-divider.scss +0 -7
- package/navbar-ic/navbar-ic-header.d.ts +0 -22
- package/navbar-ic/navbar-ic-header.scss +0 -49
- package/navbar-ic/navbar-ic-item.d.ts +0 -144
- package/navbar-ic/navbar-ic-item.scss +0 -92
- package/navbar-ic/navbar-ic-tokens.scss +0 -22
- package/navbar-ic/navbar-ic.animation.d.ts +0 -3
- package/navbar-ic/navbar-ic.d.ts +0 -118
- package/navbar-ic/navbar-ic.module.d.ts +0 -14
- package/navbar-ic/navbar-ic.scss +0 -32
- package/navbar-ic/public-api.d.ts +0 -4
- package/notification-center/notification-center-animations.d.ts +0 -5
- package/notification-center/notification-center.d.ts +0 -184
- package/notification-center/notification-center.module.d.ts +0 -7
- package/notification-center/notification-center.service.d.ts +0 -115
- package/notification-center/notification-item.d.ts +0 -27
- package/notification-center/public-api.d.ts +0 -4
- package/overflow-items/module.d.ts +0 -7
- package/overflow-items/overflow-items.d.ts +0 -152
- package/popover/popover-animations.d.ts +0 -4
- package/popover/popover-confirm.component.d.ts +0 -28
- package/popover/popover.component.d.ts +0 -139
- package/popover/popover.module.d.ts +0 -14
- package/popover/public-api.d.ts +0 -4
- package/progress-bar/progress-bar.component.d.ts +0 -20
- package/progress-bar/progress-bar.module.d.ts +0 -8
- package/progress-bar/public-api.d.ts +0 -2
- package/progress-spinner/progress-spinner.component.d.ts +0 -26
- package/progress-spinner/progress-spinner.module.d.ts +0 -9
- package/progress-spinner/public-api.d.ts +0 -2
- package/public-api.d.ts +0 -1
- package/radio/public-api.d.ts +0 -2
- package/radio/radio.component.d.ts +0 -200
- package/radio/radio.module.d.ts +0 -8
- package/resizer/module.d.ts +0 -7
- package/resizer/resizer.d.ts +0 -75
- package/risk-level/_risk-level-theme.scss +0 -74
- package/risk-level/index.d.ts +0 -1
- package/risk-level/public-api.d.ts +0 -2
- package/risk-level/risk-level-tokens.scss +0 -33
- package/risk-level/risk-level.component.d.ts +0 -21
- package/risk-level/risk-level.component.scss +0 -22
- package/risk-level/risk-level.module.d.ts +0 -12
- package/scrollbar/public-api.d.ts +0 -4
- package/scrollbar/scrollbar.component.d.ts +0 -37
- package/scrollbar/scrollbar.directive.d.ts +0 -29
- package/scrollbar/scrollbar.module.d.ts +0 -8
- package/scrollbar/scrollbar.types.d.ts +0 -33
- package/search-expandable/public-api.d.ts +0 -2
- package/search-expandable/search-expandable.d.ts +0 -89
- package/search-expandable/search-expandable.module.d.ts +0 -7
- package/select/public-api.d.ts +0 -4
- package/select/select-common.d.ts +0 -30
- package/select/select-option.directive.d.ts +0 -21
- package/select/select.component.d.ts +0 -627
- package/select/select.module.d.ts +0 -17
- package/sidebar/public-api.d.ts +0 -2
- package/sidebar/sidebar-animations.d.ts +0 -8
- package/sidebar/sidebar.component.d.ts +0 -80
- package/sidebar/sidebar.module.d.ts +0 -8
- package/sidepanel/public-api.d.ts +0 -6
- package/sidepanel/sidepanel-animations.d.ts +0 -20
- package/sidepanel/sidepanel-config.d.ts +0 -43
- package/sidepanel/sidepanel-container.component.d.ts +0 -67
- package/sidepanel/sidepanel-directives.d.ts +0 -61
- package/sidepanel/sidepanel-ref.d.ts +0 -36
- package/sidepanel/sidepanel.module.d.ts +0 -14
- package/sidepanel/sidepanel.service.d.ts +0 -58
- package/skeleton/module.d.ts +0 -7
- package/skeleton/skeleton.d.ts +0 -17
- package/split-button/public-api.d.ts +0 -2
- package/split-button/split-button.d.ts +0 -37
- package/split-button/split-button.module.d.ts +0 -7
- package/splitter/public-api.d.ts +0 -2
- package/splitter/splitter.component.d.ts +0 -136
- package/splitter/splitter.module.d.ts +0 -8
- package/table/public-api.d.ts +0 -2
- package/table/table.component.d.ts +0 -12
- package/table/table.module.d.ts +0 -9
- package/tabs/paginated-tab-header.d.ts +0 -182
- package/tabs/public-api.d.ts +0 -10
- package/tabs/tab-body.component.d.ts +0 -95
- package/tabs/tab-content.directive.d.ts +0 -9
- package/tabs/tab-group.component.d.ts +0 -137
- package/tabs/tab-header.component.d.ts +0 -34
- package/tabs/tab-label-wrapper.directive.d.ts +0 -29
- package/tabs/tab-label.directive.d.ts +0 -11
- package/tabs/tab-nav-bar.d.ts +0 -91
- package/tabs/tab.component.d.ts +0 -70
- package/tabs/tabs-animations.d.ts +0 -4
- package/tabs/tabs.module.d.ts +0 -20
- package/tags/public-api.d.ts +0 -5
- package/tags/tag-default-options.d.ts +0 -13
- package/tags/tag-input.d.ts +0 -110
- package/tags/tag-list.component.d.ts +0 -373
- package/tags/tag-text-control.d.ts +0 -10
- package/tags/tag.component.d.ts +0 -272
- package/tags/tag.module.d.ts +0 -10
- package/textarea/public-api.d.ts +0 -2
- package/textarea/textarea.component.d.ts +0 -123
- package/textarea/textarea.module.d.ts +0 -10
- package/time-range/constants.d.ts +0 -19
- package/time-range/module.d.ts +0 -10
- package/time-range/time-range-editor.d.ts +0 -65
- package/time-range/time-range-title-as-form-field.d.ts +0 -41
- package/time-range/time-range-title.d.ts +0 -18
- package/time-range/time-range.d.ts +0 -78
- package/time-range/time-range.service.d.ts +0 -25
- package/time-range/types.d.ts +0 -69
- package/timepicker/public-api.d.ts +0 -3
- package/timepicker/timepicker.constants.d.ts +0 -22
- package/timepicker/timepicker.directive.d.ts +0 -159
- package/timepicker/timepicker.module.d.ts +0 -11
- package/timezone/cities-by-filter.pipe.d.ts +0 -7
- package/timezone/public-api.d.ts +0 -6
- package/timezone/timezone-option.component.d.ts +0 -15
- package/timezone/timezone-option.directive.d.ts +0 -22
- package/timezone/timezone-select.component.d.ts +0 -16
- package/timezone/timezone.models.d.ts +0 -16
- package/timezone/timezone.module.d.ts +0 -20
- package/timezone/timezone.utils.d.ts +0 -22
- package/timezone/utc-offset.pipe.d.ts +0 -9
- package/title/public-api.d.ts +0 -2
- package/title/title.directive.d.ts +0 -33
- package/title/title.module.d.ts +0 -8
- package/toast/public-api.d.ts +0 -5
- package/toast/toast-animations.d.ts +0 -5
- package/toast/toast-container.component.d.ts +0 -19
- package/toast/toast.component.d.ts +0 -41
- package/toast/toast.module.d.ts +0 -8
- package/toast/toast.service.d.ts +0 -61
- package/toast/toast.type.d.ts +0 -44
- package/toggle/public-api.d.ts +0 -2
- package/toggle/toggle.component.d.ts +0 -77
- package/toggle/toggle.module.d.ts +0 -8
- package/tooltip/public-api.d.ts +0 -2
- package/tooltip/tooltip.animations.d.ts +0 -8
- package/tooltip/tooltip.component.d.ts +0 -156
- package/tooltip/tooltip.module.d.ts +0 -7
- package/top-bar/module.d.ts +0 -7
- package/top-bar/public-api.d.ts +0 -2
- package/top-bar/top-bar.d.ts +0 -25
- package/tree/control/base-tree-control.d.ts +0 -40
- package/tree/control/flat-tree-control.d.ts +0 -55
- package/tree/control/flat-tree-control.filters.d.ts +0 -27
- package/tree/control/nested-tree-control.d.ts +0 -19
- package/tree/control/tree-control.d.ts +0 -44
- package/tree/data-source/flat-data-source.d.ts +0 -80
- package/tree/data-source/nested-data-source.d.ts +0 -15
- package/tree/node.d.ts +0 -34
- package/tree/outlet.d.ts +0 -9
- package/tree/padding.directive.d.ts +0 -45
- package/tree/public-api.d.ts +0 -16
- package/tree/toggle.d.ts +0 -28
- package/tree/tree-base.d.ts +0 -96
- package/tree/tree-errors.d.ts +0 -25
- package/tree/tree-option.component.d.ts +0 -89
- package/tree/tree-selection.component.d.ts +0 -156
- package/tree/tree.d.ts +0 -6
- package/tree/tree.module.d.ts +0 -16
- package/tree-select/public-api.d.ts +0 -2
- package/tree-select/tree-select.component.d.ts +0 -360
- package/tree-select/tree-select.module.d.ts +0 -15
- package/username/constants.d.ts +0 -15
- package/username/module.d.ts +0 -8
- package/username/types.d.ts +0 -62
- package/username/username.d.ts +0 -68
- package/username/username.pipe.d.ts +0 -23
|
@@ -1,230 +1,37 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, InjectionToken,
|
|
3
|
-
import
|
|
2
|
+
import { inject, ElementRef, Directive, InjectionToken, forwardRef, ViewContainerRef, ChangeDetectorRef, NgZone, input, afterNextRender, Input, DestroyRef, viewChild, TemplateRef, contentChildren, output, numberAttribute, ContentChildren, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
3
|
+
import { Directionality } from '@angular/cdk/bidi';
|
|
4
4
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
5
|
-
import * as i1$1 from '@angular/cdk/overlay';
|
|
6
5
|
import { Overlay, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
|
|
7
6
|
import { _getFocusedElementPierceShadowDom, _getEventTarget } from '@angular/cdk/platform';
|
|
8
7
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
8
|
+
import { ViewportRuler } from '@angular/cdk/scrolling';
|
|
9
|
+
import { DOCUMENT } from '@angular/common';
|
|
11
10
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
12
|
-
import { ESCAPE, ENTER, TAB, DOWN_ARROW, UP_ARROW } from '@koobiq/
|
|
13
|
-
import {
|
|
14
|
-
import * as i1 from '@koobiq/components/form-field';
|
|
11
|
+
import { KBQ_WINDOW, KbqOptionSelectionChange, ESCAPE, ENTER, TAB, DOWN_ARROW, UP_ARROW, defaultOffsetY, KbqOptgroup, ActiveDescendantKeyManager, KbqOption, KBQ_OPTION_PARENT_COMPONENT, KbqOptionModule } from '@koobiq/components/core';
|
|
12
|
+
import { KbqFormField } from '@koobiq/components/form-field';
|
|
15
13
|
import { defer, merge, Subscription, Subject, of, fromEvent } from 'rxjs';
|
|
16
|
-
import {
|
|
14
|
+
import { take, switchMap, filter, map, tap, delay } from 'rxjs/operators';
|
|
17
15
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
18
|
-
import { ActiveDescendantKeyManager } from '@koobiq/cdk/a11y';
|
|
19
16
|
|
|
20
17
|
/**
|
|
21
18
|
* Directive applied to an element to make it usable
|
|
22
19
|
* as a connection point for an autocomplete panel.
|
|
23
20
|
*/
|
|
24
21
|
class KbqAutocompleteOrigin {
|
|
25
|
-
constructor(
|
|
26
|
-
this.elementRef =
|
|
22
|
+
constructor() {
|
|
23
|
+
this.elementRef = inject(ElementRef);
|
|
27
24
|
}
|
|
28
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
29
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
25
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAutocompleteOrigin, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
26
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.25", type: KbqAutocompleteOrigin, isStandalone: true, selector: "[kbqAutocompleteOrigin]", exportAs: ["kbqAutocompleteOrigin"], ngImport: i0 }); }
|
|
30
27
|
}
|
|
31
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAutocompleteOrigin, decorators: [{
|
|
32
29
|
type: Directive,
|
|
33
30
|
args: [{
|
|
34
31
|
selector: '[kbqAutocompleteOrigin]',
|
|
35
32
|
exportAs: 'kbqAutocompleteOrigin'
|
|
36
33
|
}]
|
|
37
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }] });
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Autocomplete IDs need to be unique across components, so this counter exists outside of
|
|
41
|
-
* the component definition.
|
|
42
|
-
*/
|
|
43
|
-
let uniqueAutocompleteIdCounter = 0;
|
|
44
|
-
/** Footer that is rendered below the autocomplete options panel. */
|
|
45
|
-
class KbqAutocompleteFooter {
|
|
46
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqAutocompleteFooter, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
47
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.21", type: KbqAutocompleteFooter, isStandalone: true, selector: "[kbqAutocompleteFooter], kbq-autocomplete-footer", host: { classAttribute: "kbq-autocomplete-footer" }, ngImport: i0 }); }
|
|
48
|
-
}
|
|
49
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqAutocompleteFooter, decorators: [{
|
|
50
|
-
type: Directive,
|
|
51
|
-
args: [{
|
|
52
|
-
selector: '[kbqAutocompleteFooter], kbq-autocomplete-footer',
|
|
53
|
-
host: { class: 'kbq-autocomplete-footer' }
|
|
54
|
-
}]
|
|
55
34
|
}] });
|
|
56
|
-
class KbqAutocompleteSelectedEvent {
|
|
57
|
-
constructor(source, option) {
|
|
58
|
-
this.source = source;
|
|
59
|
-
this.option = option;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
/** Injection token to be used to override the default options for `kbq-autocomplete`. */
|
|
63
|
-
const KBQ_AUTOCOMPLETE_DEFAULT_OPTIONS = new InjectionToken('kbq-autocomplete-default-options', {
|
|
64
|
-
providedIn: 'root',
|
|
65
|
-
factory: KBQ_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY
|
|
66
|
-
});
|
|
67
|
-
function KBQ_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY() {
|
|
68
|
-
return { autoActiveFirstOption: true };
|
|
69
|
-
}
|
|
70
|
-
class KbqAutocomplete {
|
|
71
|
-
/**
|
|
72
|
-
* Takes classes set on the host kbq-autocomplete element and applies them to the panel
|
|
73
|
-
* inside the overlay container to allow for easy styling.
|
|
74
|
-
*/
|
|
75
|
-
get classList() {
|
|
76
|
-
return this._classList;
|
|
77
|
-
}
|
|
78
|
-
set classList(value) {
|
|
79
|
-
if (value && value.length) {
|
|
80
|
-
value.split(' ').forEach((className) => (this._classList[className.trim()] = true));
|
|
81
|
-
this.elementRef.nativeElement.className = '';
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Whether the first option should be highlighted when the autocomplete panel is opened.
|
|
86
|
-
* Can be configured globally through the `KBQ_AUTOCOMPLETE_DEFAULT_OPTIONS` token.
|
|
87
|
-
*/
|
|
88
|
-
get autoActiveFirstOption() {
|
|
89
|
-
return this._autoActiveFirstOption;
|
|
90
|
-
}
|
|
91
|
-
set autoActiveFirstOption(value) {
|
|
92
|
-
this._autoActiveFirstOption = coerceBooleanProperty(value);
|
|
93
|
-
}
|
|
94
|
-
get isOpen() {
|
|
95
|
-
return this._isOpen && this.showPanel;
|
|
96
|
-
}
|
|
97
|
-
set isOpen(value) {
|
|
98
|
-
this._isOpen = value;
|
|
99
|
-
}
|
|
100
|
-
get openOnFocus() {
|
|
101
|
-
return this._openOnFocus;
|
|
102
|
-
}
|
|
103
|
-
set openOnFocus(value) {
|
|
104
|
-
this._openOnFocus = value;
|
|
105
|
-
}
|
|
106
|
-
constructor(changeDetectorRef, elementRef, defaults, parentFormField) {
|
|
107
|
-
this.changeDetectorRef = changeDetectorRef;
|
|
108
|
-
this.elementRef = elementRef;
|
|
109
|
-
this.parentFormField = parentFormField;
|
|
110
|
-
this.destroyRef = inject(DestroyRef);
|
|
111
|
-
/** Unique ID to be used by autocomplete trigger's "aria-owns" property. */
|
|
112
|
-
this.id = `kbq-autocomplete-${uniqueAutocompleteIdCounter++}`;
|
|
113
|
-
/** Whether the autocomplete panel should be visible, depending on option length. */
|
|
114
|
-
this.showPanel = false;
|
|
115
|
-
/** Function that maps an option's control value to its display value in the trigger. */
|
|
116
|
-
this.displayWith = null;
|
|
117
|
-
/**
|
|
118
|
-
* Minimum width of the panel in pixels.
|
|
119
|
-
* When panelWidth is not set, the panel will be at least as wide as its host and no less than panelMinWidth.
|
|
120
|
-
*/
|
|
121
|
-
this.panelMinWidth = 200;
|
|
122
|
-
/** Event that is emitted whenever an option from the list is selected. */
|
|
123
|
-
this.optionSelected = new EventEmitter();
|
|
124
|
-
/** Event that is emitted when the autocomplete panel is opened. */
|
|
125
|
-
this.opened = new EventEmitter();
|
|
126
|
-
/** Event that is emitted when the autocomplete panel is closed. */
|
|
127
|
-
this.closed = new EventEmitter();
|
|
128
|
-
this._classList = {};
|
|
129
|
-
this._isOpen = false;
|
|
130
|
-
this._openOnFocus = true;
|
|
131
|
-
this._autoActiveFirstOption = !!defaults.autoActiveFirstOption;
|
|
132
|
-
}
|
|
133
|
-
ngAfterContentInit() {
|
|
134
|
-
this.keyManager = new ActiveDescendantKeyManager(this.options);
|
|
135
|
-
this.setVisibility();
|
|
136
|
-
this.parentFormField?.control.ngControl?.valueChanges
|
|
137
|
-
?.pipe(delay(0), filter((value) => value === null || value === undefined || value === ''), takeUntilDestroyed(this.destroyRef))
|
|
138
|
-
.subscribe(() => {
|
|
139
|
-
this.options.filter(({ selected }) => selected).forEach((option) => option.deselect(false));
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
setScrollTop(scrollTop) {
|
|
143
|
-
if (this.panel) {
|
|
144
|
-
this.panel.nativeElement.scrollTop = scrollTop;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
getScrollTop() {
|
|
148
|
-
return this.panel ? this.panel.nativeElement.scrollTop : 0;
|
|
149
|
-
}
|
|
150
|
-
setVisibility() {
|
|
151
|
-
this.showPanel = !!this.options.length;
|
|
152
|
-
this._classList['kbq-autocomplete_visible'] = this.showPanel;
|
|
153
|
-
this._classList['kbq-autocomplete_hidden'] = !this.showPanel;
|
|
154
|
-
this.updateFocusClass();
|
|
155
|
-
this.changeDetectorRef.markForCheck();
|
|
156
|
-
}
|
|
157
|
-
emitSelectEvent(option) {
|
|
158
|
-
const event = new KbqAutocompleteSelectedEvent(this, option);
|
|
159
|
-
this.optionSelected.emit(event);
|
|
160
|
-
}
|
|
161
|
-
onKeydown(event) {
|
|
162
|
-
this.keyManager.onKeydown(event);
|
|
163
|
-
this.updateFocusClass();
|
|
164
|
-
}
|
|
165
|
-
updateFocusClass() {
|
|
166
|
-
this._classList['cdk-keyboard-focused'] = this.parentFormField?.focusOrigin === 'keyboard';
|
|
167
|
-
}
|
|
168
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqAutocomplete, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: KBQ_AUTOCOMPLETE_DEFAULT_OPTIONS }, { token: i1.KbqFormField, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
169
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.2.21", type: KbqAutocomplete, isStandalone: true, selector: "kbq-autocomplete", inputs: { displayWith: "displayWith", panelWidth: "panelWidth", panelMinWidth: ["panelMinWidth", "panelMinWidth", numberAttribute], classList: ["class", "classList"], autoActiveFirstOption: "autoActiveFirstOption", openOnFocus: "openOnFocus" }, outputs: { optionSelected: "optionSelected", opened: "opened", closed: "closed" }, host: { classAttribute: "kbq-autocomplete" }, providers: [
|
|
170
|
-
{
|
|
171
|
-
provide: KBQ_OPTION_PARENT_COMPONENT,
|
|
172
|
-
useExisting: KbqAutocomplete
|
|
173
|
-
}
|
|
174
|
-
], queries: [{ propertyName: "options", predicate: KbqOption, descendants: true }, { propertyName: "optionGroups", predicate: KbqOptgroup }], viewQueries: [{ propertyName: "template", first: true, predicate: TemplateRef, descendants: true, static: true }, { propertyName: "panel", first: true, predicate: ["panel"], descendants: true }], exportAs: ["kbqAutocomplete"], ngImport: i0, template: "<ng-template>\n <div class=\"kbq-autocomplete-panel\" [id]=\"id\" [ngClass]=\"classList\">\n <div #panel role=\"listbox\" class=\"kbq-autocomplete-panel__content kbq-scrollbar\">\n <ng-content />\n </div>\n <ng-content select=\"[kbqAutocompleteFooter], kbq-autocomplete-footer\" />\n </div>\n</ng-template>\n", styles: [".kbq-autocomplete-panel .kbq-autocomplete-footer{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;box-sizing:border-box;min-height:40px;border-top-width:1px;border-top-style:solid;padding:var(--kbq-size-xxs) var(--kbq-size-l)}.kbq-autocomplete-panel{visibility:hidden;position:relative;display:flex;flex-direction:column;box-sizing:border-box;min-width:100%;width:100%;max-width:none;border-radius:var(--kbq-autocomplete-size-panel-border-radius, var(--kbq-size-border-radius));max-height:var(--kbq-autocomplete-size-panel-max-height)}.kbq-autocomplete-panel .kbq-autocomplete-panel__content{flex:1;padding:var(--kbq-size-xxs);overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch}.kbq-autocomplete-panel .kbq-autocomplete-footer{border-color:var(--kbq-line-contrast-less)}.kbq-autocomplete-panel.kbq-autocomplete_visible{visibility:visible}.kbq-autocomplete-panel.kbq-autocomplete_hidden{visibility:hidden}.kbq-autocomplete-panel .kbq-option{position:relative}.kbq-autocomplete-panel .kbq-option:before,.kbq-autocomplete-panel .kbq-option:after{position:absolute;content:\"\";width:var(--kbq-size-xxs);height:calc(100% + var(--kbq-size-3xs) * 2)}.kbq-autocomplete-panel .kbq-option:before{right:calc(100% + var(--kbq-size-3xs))}.kbq-autocomplete-panel .kbq-option:after{left:calc(100% + var(--kbq-size-3xs))}.kbq-autocomplete-panel .kbq-divider-horizontal{margin-top:-1px}.kbq-autocomplete-panel{box-shadow:var(--kbq-select-panel-dropdown-shadow);background:var(--kbq-select-panel-dropdown-background)}\n", ".kbq-autocomplete-panel{--kbq-autocomplete-size-panel-padding: var(--kbq-size-xxs) 0;--kbq-autocomplete-size-panel-max-height: 256px;--kbq-autocomplete-size-panel-border-radius: var(--kbq-size-border-radius);--kbq-select-panel-dropdown-background: var(--kbq-background-card);--kbq-select-panel-dropdown-shadow: var(--kbq-shadow-popup)}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
175
|
-
}
|
|
176
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: KbqAutocomplete, decorators: [{
|
|
177
|
-
type: Component,
|
|
178
|
-
args: [{ selector: 'kbq-autocomplete', imports: [
|
|
179
|
-
NgClass
|
|
180
|
-
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'kbqAutocomplete', host: {
|
|
181
|
-
class: 'kbq-autocomplete'
|
|
182
|
-
}, providers: [
|
|
183
|
-
{
|
|
184
|
-
provide: KBQ_OPTION_PARENT_COMPONENT,
|
|
185
|
-
useExisting: KbqAutocomplete
|
|
186
|
-
}
|
|
187
|
-
], template: "<ng-template>\n <div class=\"kbq-autocomplete-panel\" [id]=\"id\" [ngClass]=\"classList\">\n <div #panel role=\"listbox\" class=\"kbq-autocomplete-panel__content kbq-scrollbar\">\n <ng-content />\n </div>\n <ng-content select=\"[kbqAutocompleteFooter], kbq-autocomplete-footer\" />\n </div>\n</ng-template>\n", styles: [".kbq-autocomplete-panel .kbq-autocomplete-footer{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;box-sizing:border-box;min-height:40px;border-top-width:1px;border-top-style:solid;padding:var(--kbq-size-xxs) var(--kbq-size-l)}.kbq-autocomplete-panel{visibility:hidden;position:relative;display:flex;flex-direction:column;box-sizing:border-box;min-width:100%;width:100%;max-width:none;border-radius:var(--kbq-autocomplete-size-panel-border-radius, var(--kbq-size-border-radius));max-height:var(--kbq-autocomplete-size-panel-max-height)}.kbq-autocomplete-panel .kbq-autocomplete-panel__content{flex:1;padding:var(--kbq-size-xxs);overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch}.kbq-autocomplete-panel .kbq-autocomplete-footer{border-color:var(--kbq-line-contrast-less)}.kbq-autocomplete-panel.kbq-autocomplete_visible{visibility:visible}.kbq-autocomplete-panel.kbq-autocomplete_hidden{visibility:hidden}.kbq-autocomplete-panel .kbq-option{position:relative}.kbq-autocomplete-panel .kbq-option:before,.kbq-autocomplete-panel .kbq-option:after{position:absolute;content:\"\";width:var(--kbq-size-xxs);height:calc(100% + var(--kbq-size-3xs) * 2)}.kbq-autocomplete-panel .kbq-option:before{right:calc(100% + var(--kbq-size-3xs))}.kbq-autocomplete-panel .kbq-option:after{left:calc(100% + var(--kbq-size-3xs))}.kbq-autocomplete-panel .kbq-divider-horizontal{margin-top:-1px}.kbq-autocomplete-panel{box-shadow:var(--kbq-select-panel-dropdown-shadow);background:var(--kbq-select-panel-dropdown-background)}\n", ".kbq-autocomplete-panel{--kbq-autocomplete-size-panel-padding: var(--kbq-size-xxs) 0;--kbq-autocomplete-size-panel-max-height: 256px;--kbq-autocomplete-size-panel-border-radius: var(--kbq-size-border-radius);--kbq-select-panel-dropdown-background: var(--kbq-background-card);--kbq-select-panel-dropdown-shadow: var(--kbq-shadow-popup)}\n"] }]
|
|
188
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: undefined, decorators: [{
|
|
189
|
-
type: Inject,
|
|
190
|
-
args: [KBQ_AUTOCOMPLETE_DEFAULT_OPTIONS]
|
|
191
|
-
}] }, { type: i1.KbqFormField, decorators: [{
|
|
192
|
-
type: Host
|
|
193
|
-
}, {
|
|
194
|
-
type: Optional
|
|
195
|
-
}] }], propDecorators: { template: [{
|
|
196
|
-
type: ViewChild,
|
|
197
|
-
args: [TemplateRef, { static: true }]
|
|
198
|
-
}], panel: [{
|
|
199
|
-
type: ViewChild,
|
|
200
|
-
args: ['panel', { static: false }]
|
|
201
|
-
}], options: [{
|
|
202
|
-
type: ContentChildren,
|
|
203
|
-
args: [KbqOption, { descendants: true }]
|
|
204
|
-
}], optionGroups: [{
|
|
205
|
-
type: ContentChildren,
|
|
206
|
-
args: [KbqOptgroup]
|
|
207
|
-
}], displayWith: [{
|
|
208
|
-
type: Input
|
|
209
|
-
}], panelWidth: [{
|
|
210
|
-
type: Input
|
|
211
|
-
}], panelMinWidth: [{
|
|
212
|
-
type: Input,
|
|
213
|
-
args: [{ transform: numberAttribute }]
|
|
214
|
-
}], optionSelected: [{
|
|
215
|
-
type: Output
|
|
216
|
-
}], opened: [{
|
|
217
|
-
type: Output
|
|
218
|
-
}], closed: [{
|
|
219
|
-
type: Output
|
|
220
|
-
}], classList: [{
|
|
221
|
-
type: Input,
|
|
222
|
-
args: ['class']
|
|
223
|
-
}], autoActiveFirstOption: [{
|
|
224
|
-
type: Input
|
|
225
|
-
}], openOnFocus: [{
|
|
226
|
-
type: Input
|
|
227
|
-
}] } });
|
|
228
35
|
|
|
229
36
|
/**
|
|
230
37
|
* The following style constants are necessary to save here in order
|
|
@@ -264,55 +71,63 @@ function getKbqAutocompleteMissingPanelError() {
|
|
|
264
71
|
class KbqAutocompleteTrigger {
|
|
265
72
|
/** The currently active option, coerced to MatOption type. */
|
|
266
73
|
get activeOption() {
|
|
267
|
-
return this.autocomplete?.keyManager?.activeItem;
|
|
74
|
+
return this.autocomplete()?.keyManager?.activeItem;
|
|
268
75
|
}
|
|
269
76
|
get panelOpen() {
|
|
270
|
-
return this.overlayAttached && this.autocomplete.showPanel;
|
|
77
|
+
return this.overlayAttached && this.autocomplete().showPanel;
|
|
271
78
|
}
|
|
272
79
|
/**
|
|
273
80
|
* Whether the autocomplete is disabled. When disabled, the element will
|
|
274
81
|
* act as a regular input and the user won't be able to open the panel.
|
|
275
82
|
*/
|
|
83
|
+
// TODO: Skipped for migration because:
|
|
84
|
+
// Accessor inputs cannot be migrated as they are too complex.
|
|
276
85
|
get autocompleteDisabled() {
|
|
277
86
|
return this._autocompleteDisabled;
|
|
278
87
|
}
|
|
279
88
|
set autocompleteDisabled(value) {
|
|
280
89
|
this._autocompleteDisabled = coerceBooleanProperty(value);
|
|
281
90
|
}
|
|
282
|
-
constructor(
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
this.
|
|
286
|
-
this.
|
|
287
|
-
this.
|
|
288
|
-
this.
|
|
289
|
-
this.
|
|
290
|
-
this.
|
|
291
|
-
this.formField = formField;
|
|
292
|
-
this.viewportRuler = viewportRuler;
|
|
91
|
+
constructor() {
|
|
92
|
+
this.elementRef = inject(ElementRef);
|
|
93
|
+
this.viewContainerRef = inject(ViewContainerRef);
|
|
94
|
+
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
95
|
+
this.overlay = inject(Overlay);
|
|
96
|
+
this.zone = inject(NgZone);
|
|
97
|
+
this.dir = inject(Directionality, { optional: true });
|
|
98
|
+
this.formField = inject(KbqFormField, { optional: true, host: true });
|
|
99
|
+
this.viewportRuler = inject(ViewportRuler);
|
|
293
100
|
this.document = inject(DOCUMENT);
|
|
294
101
|
this.optionSelections = defer(() => {
|
|
295
|
-
|
|
296
|
-
|
|
102
|
+
const autocomplete = this.autocomplete();
|
|
103
|
+
if (autocomplete && autocomplete.options) {
|
|
104
|
+
return merge(...autocomplete.options.map((option) => option.onSelectionChange));
|
|
297
105
|
}
|
|
298
106
|
// If there are any subscribers before `ngAfterViewInit`, the `autocomplete` will be undefined.
|
|
299
107
|
// Return a stream that we'll replace with the real one once everything is in place.
|
|
300
108
|
return this.zone.onStable.asObservable().pipe(take(1), switchMap(() => this.optionSelections));
|
|
301
109
|
});
|
|
110
|
+
/** The autocomplete panel to be attached to this trigger. */
|
|
111
|
+
this.autocomplete = input(undefined, ...(ngDevMode ? [{ debugName: "autocomplete", alias: 'kbqAutocomplete' }] : [{ alias: 'kbqAutocomplete' }]));
|
|
112
|
+
/**
|
|
113
|
+
* Reference relative to which to position the autocomplete panel.
|
|
114
|
+
* Defaults to the autocomplete trigger element.
|
|
115
|
+
*/
|
|
116
|
+
this.connectedTo = input(undefined, ...(ngDevMode ? [{ debugName: "connectedTo", alias: 'kbqAutocompleteConnectedTo' }] : [{ alias: 'kbqAutocompleteConnectedTo' }]));
|
|
302
117
|
/**
|
|
303
118
|
* `autocomplete` attribute to be set on the input element.
|
|
304
119
|
* @docs-private
|
|
305
120
|
*/
|
|
306
|
-
this.autocompleteAttribute = 'off';
|
|
121
|
+
this.autocompleteAttribute = input('off', ...(ngDevMode ? [{ debugName: "autocompleteAttribute", alias: 'autocomplete' }] : [{ alias: 'autocomplete' }]));
|
|
307
122
|
/**
|
|
308
123
|
* Event handler for input blur events.
|
|
309
124
|
* Determines whether the blur event is triggered outside the specific target
|
|
310
125
|
* @returns A boolean indicating if the blur event happened outside the target element
|
|
311
126
|
*/
|
|
312
|
-
this.onInputBlur = (event) => {
|
|
127
|
+
this.onInputBlur = input((event) => {
|
|
313
128
|
const target = event.relatedTarget;
|
|
314
129
|
return !target || target.tagName !== 'KBQ-OPTION';
|
|
315
|
-
};
|
|
130
|
+
}, ...(ngDevMode ? [{ debugName: "onInputBlur", alias: 'kbqAutocompleteOnBlur' }] : [{ alias: 'kbqAutocompleteOnBlur' }]));
|
|
316
131
|
this._autocompleteDisabled = false;
|
|
317
132
|
this.overlayAttached = false;
|
|
318
133
|
this.componentDestroyed = false;
|
|
@@ -341,20 +156,24 @@ class KbqAutocompleteTrigger {
|
|
|
341
156
|
// pane was closed, in order to avoid reopening it unintentionally.
|
|
342
157
|
this.canOpenOnNextFocus = this.document.activeElement !== this.elementRef.nativeElement || this.panelOpen;
|
|
343
158
|
};
|
|
159
|
+
const zone = this.zone;
|
|
160
|
+
const scrollStrategy = inject(KBQ_AUTOCOMPLETE_SCROLL_STRATEGY);
|
|
344
161
|
afterNextRender(() => {
|
|
345
162
|
zone.runOutsideAngular(() => this.window.addEventListener('blur', this.windowBlurHandler));
|
|
346
163
|
});
|
|
347
164
|
this.scrollStrategy = scrollStrategy;
|
|
348
165
|
}
|
|
349
166
|
ngAfterViewInit() {
|
|
350
|
-
|
|
351
|
-
|
|
167
|
+
const autocomplete = this.autocomplete();
|
|
168
|
+
if (autocomplete) {
|
|
169
|
+
autocomplete.keyManager?.change.subscribe(() => {
|
|
170
|
+
const autocompleteValue = this.autocomplete();
|
|
352
171
|
if (this.panelOpen) {
|
|
353
172
|
this.scrollActiveOptionIntoView();
|
|
354
173
|
this.elementRef.nativeElement.focus();
|
|
355
174
|
}
|
|
356
|
-
else if (!this.panelOpen &&
|
|
357
|
-
|
|
175
|
+
else if (!this.panelOpen && autocompleteValue.keyManager.activeItem) {
|
|
176
|
+
autocompleteValue.keyManager.activeItem?.selectViaInteraction();
|
|
358
177
|
}
|
|
359
178
|
});
|
|
360
179
|
}
|
|
@@ -370,21 +189,15 @@ class KbqAutocompleteTrigger {
|
|
|
370
189
|
open() {
|
|
371
190
|
this.attachOverlay();
|
|
372
191
|
}
|
|
373
|
-
/**
|
|
374
|
-
* @deprecated Will be removed in next major release. Use `open` instead.
|
|
375
|
-
* @docs-private
|
|
376
|
-
*/
|
|
377
|
-
openPanel() {
|
|
378
|
-
this.open();
|
|
379
|
-
}
|
|
380
192
|
closePanel() {
|
|
381
193
|
if (!this.overlayAttached) {
|
|
382
194
|
return;
|
|
383
195
|
}
|
|
384
196
|
if (this.panelOpen) {
|
|
385
|
-
|
|
197
|
+
// TODO: The 'emit' function requires a mandatory void argument
|
|
198
|
+
this.autocomplete().closed.emit();
|
|
386
199
|
}
|
|
387
|
-
this.autocomplete.isOpen = this.overlayAttached = false;
|
|
200
|
+
this.autocomplete().isOpen = this.overlayAttached = false;
|
|
388
201
|
if (this.overlayRef && this.overlayRef.hasAttached()) {
|
|
389
202
|
this.overlayRef.detach();
|
|
390
203
|
this.closingActionsSubscription.unsubscribe();
|
|
@@ -413,7 +226,7 @@ class KbqAutocompleteTrigger {
|
|
|
413
226
|
* when an option is selected, on blur, and when TAB is pressed.
|
|
414
227
|
*/
|
|
415
228
|
get panelClosingActions() {
|
|
416
|
-
return merge(this.optionSelections, this.autocomplete.keyManager.tabOut.pipe(filter(() => this.overlayAttached)), this.closeKeyEventStream, this.getOutsideClickStream(), this.overlayRef ? this.overlayRef.detachments().pipe(filter(() => this.overlayAttached)) : of()).pipe(
|
|
229
|
+
return merge(this.optionSelections, this.autocomplete().keyManager.tabOut.pipe(filter(() => this.overlayAttached)), this.closeKeyEventStream, this.getOutsideClickStream(), this.overlayRef ? this.overlayRef.detachments().pipe(filter(() => this.overlayAttached)) : of()).pipe(
|
|
417
230
|
// Normalize the output so we return a consistent type.
|
|
418
231
|
map((event) => (event instanceof KbqOptionSelectionChange ? event : null)));
|
|
419
232
|
}
|
|
@@ -422,12 +235,12 @@ class KbqAutocompleteTrigger {
|
|
|
422
235
|
Promise.resolve(null).then(() => this.setTriggerValue(value));
|
|
423
236
|
}
|
|
424
237
|
// Implemented as part of ControlValueAccessor.
|
|
425
|
-
// eslint-disable-next-line @typescript-eslint/
|
|
238
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
426
239
|
registerOnChange(fn) {
|
|
427
240
|
this.onChange = fn;
|
|
428
241
|
}
|
|
429
242
|
// Implemented as part of ControlValueAccessor.
|
|
430
|
-
// eslint-disable-next-line @typescript-eslint/
|
|
243
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
431
244
|
registerOnTouched(fn) {
|
|
432
245
|
this.onTouched = fn;
|
|
433
246
|
}
|
|
@@ -444,22 +257,23 @@ class KbqAutocompleteTrigger {
|
|
|
444
257
|
if (keyCode === ESCAPE) {
|
|
445
258
|
event.preventDefault();
|
|
446
259
|
}
|
|
260
|
+
const autocomplete = this.autocomplete();
|
|
447
261
|
if (this.activeOption && keyCode === ENTER && this.panelOpen) {
|
|
448
262
|
this.activeOption.selectViaInteraction();
|
|
449
263
|
this.resetActiveItem();
|
|
450
264
|
event.preventDefault();
|
|
451
265
|
}
|
|
452
|
-
else if (
|
|
453
|
-
const prevActiveItem =
|
|
266
|
+
else if (autocomplete) {
|
|
267
|
+
const prevActiveItem = autocomplete.keyManager.activeItem;
|
|
454
268
|
if (this.panelOpen || keyCode === TAB) {
|
|
455
|
-
|
|
269
|
+
autocomplete.onKeydown(event);
|
|
456
270
|
}
|
|
457
271
|
else if (!this.panelOpen && keyCode === DOWN_ARROW && this.canOpen()) {
|
|
458
|
-
this.
|
|
272
|
+
this.open();
|
|
459
273
|
}
|
|
460
274
|
const isArrowKey = keyCode === UP_ARROW || keyCode === DOWN_ARROW;
|
|
461
|
-
if (isArrowKey && event.shiftKey &&
|
|
462
|
-
|
|
275
|
+
if (isArrowKey && event.shiftKey && autocomplete.keyManager.activeItem !== prevActiveItem) {
|
|
276
|
+
autocomplete.keyManager.activeItem?.selectViaInteraction();
|
|
463
277
|
}
|
|
464
278
|
}
|
|
465
279
|
}
|
|
@@ -479,7 +293,7 @@ class KbqAutocompleteTrigger {
|
|
|
479
293
|
this.previousValue = value;
|
|
480
294
|
this.onChange(value);
|
|
481
295
|
if (this.canOpen() && _getFocusedElementPierceShadowDom() === target) {
|
|
482
|
-
this.
|
|
296
|
+
this.open();
|
|
483
297
|
}
|
|
484
298
|
}
|
|
485
299
|
}
|
|
@@ -487,25 +301,26 @@ class KbqAutocompleteTrigger {
|
|
|
487
301
|
if (!this.canOpenOnNextFocus) {
|
|
488
302
|
this.canOpenOnNextFocus = true;
|
|
489
303
|
}
|
|
490
|
-
else if (!this.panelOpen && this.canOpen() && this.autocomplete.openOnFocus) {
|
|
304
|
+
else if (!this.panelOpen && this.canOpen() && this.autocomplete().openOnFocus) {
|
|
491
305
|
this.previousValue = this.elementRef.nativeElement.value;
|
|
492
306
|
this.attachOverlay();
|
|
493
307
|
}
|
|
494
308
|
}
|
|
495
309
|
handleClick($event) {
|
|
496
310
|
if (!this.panelOpen && this.canOpen() && _getFocusedElementPierceShadowDom() === $event.target) {
|
|
497
|
-
this.
|
|
311
|
+
this.open();
|
|
498
312
|
}
|
|
499
313
|
}
|
|
500
314
|
scrollActiveOptionIntoView() {
|
|
501
|
-
this.autocomplete.keyManager.activeItem?.focus();
|
|
315
|
+
this.autocomplete().keyManager.activeItem?.focus();
|
|
502
316
|
}
|
|
503
317
|
/** Stream of clicks outside of the autocomplete panel. */
|
|
504
318
|
getOutsideClickStream() {
|
|
505
319
|
return merge(fromEvent(this.document, 'click'), fromEvent(this.document, 'auxclick'), fromEvent(this.document, 'touchend')).pipe(filter((event) => {
|
|
506
320
|
const clickTarget = _getEventTarget(event);
|
|
507
321
|
const formField = this.formField ? this.formField.elementRef.nativeElement : null;
|
|
508
|
-
const
|
|
322
|
+
const connectedTo = this.connectedTo();
|
|
323
|
+
const customOrigin = connectedTo ? connectedTo.elementRef.nativeElement : null;
|
|
509
324
|
return (this.overlayAttached &&
|
|
510
325
|
clickTarget !== this.elementRef.nativeElement &&
|
|
511
326
|
(!formField || !formField.contains(clickTarget)) &&
|
|
@@ -520,7 +335,7 @@ class KbqAutocompleteTrigger {
|
|
|
520
335
|
*/
|
|
521
336
|
subscribeToClosingActions() {
|
|
522
337
|
const firstStable = this.zone.onStable.asObservable().pipe(take(1));
|
|
523
|
-
const optionChanges = this.autocomplete.options.changes.pipe(tap(() => this.positionStrategy.reapplyLastPosition()),
|
|
338
|
+
const optionChanges = this.autocomplete().options.changes.pipe(tap(() => this.positionStrategy.reapplyLastPosition()),
|
|
524
339
|
// Defer emitting to the stream until the next tick, because changing
|
|
525
340
|
// bindings in here will cause "changed after checked" errors.
|
|
526
341
|
delay(0));
|
|
@@ -532,7 +347,7 @@ class KbqAutocompleteTrigger {
|
|
|
532
347
|
switchMap(() => {
|
|
533
348
|
const wasOpen = this.panelOpen;
|
|
534
349
|
this.resetActiveItem();
|
|
535
|
-
this.autocomplete.setVisibility();
|
|
350
|
+
this.autocomplete().setVisibility();
|
|
536
351
|
if (this.panelOpen) {
|
|
537
352
|
this.overlayRef.updatePosition();
|
|
538
353
|
// If the `panelOpen` state changed, we need to make sure to emit the `opened`
|
|
@@ -540,7 +355,8 @@ class KbqAutocompleteTrigger {
|
|
|
540
355
|
// can happen if the users opens the panel and there are no options, but the
|
|
541
356
|
// options come in slightly later or as a result of the value changing.
|
|
542
357
|
if (wasOpen !== this.panelOpen) {
|
|
543
|
-
|
|
358
|
+
// TODO: The 'emit' function requires a mandatory void argument
|
|
359
|
+
this.autocomplete().opened.emit();
|
|
544
360
|
}
|
|
545
361
|
}
|
|
546
362
|
return this.panelClosingActions;
|
|
@@ -559,14 +375,15 @@ class KbqAutocompleteTrigger {
|
|
|
559
375
|
}
|
|
560
376
|
}
|
|
561
377
|
setTriggerValue(value) {
|
|
562
|
-
const
|
|
378
|
+
const autocomplete = this.autocomplete();
|
|
379
|
+
const toDisplay = autocomplete && autocomplete.displayWith ? autocomplete.displayWith(value) : value;
|
|
563
380
|
// Simply falling back to an empty string if the display value is falsy does not work properly.
|
|
564
381
|
// The display value can also be the number zero and shouldn't fall back to an empty string.
|
|
565
382
|
const inputValue = toDisplay != null ? toDisplay : '';
|
|
566
383
|
// If it's used within a `MatFormField`, we should set it through the property so it can go
|
|
567
384
|
// through change detection.
|
|
568
385
|
if (this.formField) {
|
|
569
|
-
this.formField.control.value = inputValue;
|
|
386
|
+
this.formField.control().value = inputValue;
|
|
570
387
|
}
|
|
571
388
|
else {
|
|
572
389
|
this.elementRef.nativeElement.value = inputValue;
|
|
@@ -583,25 +400,26 @@ class KbqAutocompleteTrigger {
|
|
|
583
400
|
this.setTriggerValue(event.source.value);
|
|
584
401
|
this.onChange(event.source.value);
|
|
585
402
|
this.elementRef.nativeElement.focus();
|
|
586
|
-
this.autocomplete.emitSelectEvent(event.source);
|
|
403
|
+
this.autocomplete().emitSelectEvent(event.source);
|
|
587
404
|
}
|
|
588
405
|
this.closePanel();
|
|
589
406
|
}
|
|
590
407
|
/** Clear any previous selected option and emit a selection change event for this option */
|
|
591
408
|
clearPreviousSelectedOption(skip) {
|
|
592
|
-
this.autocomplete.options.forEach((option) => {
|
|
409
|
+
this.autocomplete().options.forEach((option) => {
|
|
593
410
|
if (option !== skip && option.selected) {
|
|
594
411
|
option.deselect();
|
|
595
412
|
}
|
|
596
413
|
});
|
|
597
414
|
}
|
|
598
415
|
attachOverlay() {
|
|
599
|
-
|
|
416
|
+
const autocomplete = this.autocomplete();
|
|
417
|
+
if (!autocomplete) {
|
|
600
418
|
throw getKbqAutocompleteMissingPanelError();
|
|
601
419
|
}
|
|
602
420
|
let overlayRef = this.overlayRef;
|
|
603
421
|
if (!overlayRef) {
|
|
604
|
-
this.portal = new TemplatePortal(
|
|
422
|
+
this.portal = new TemplatePortal(autocomplete.template(), this.viewContainerRef);
|
|
605
423
|
overlayRef = this.overlay.create(this.getOverlayConfig());
|
|
606
424
|
this.overlayRef = overlayRef;
|
|
607
425
|
// Use the `keydownEvents` in order to take advantage of
|
|
@@ -633,12 +451,13 @@ class KbqAutocompleteTrigger {
|
|
|
633
451
|
this.closingActionsSubscription = this.subscribeToClosingActions();
|
|
634
452
|
}
|
|
635
453
|
const wasOpen = this.panelOpen;
|
|
636
|
-
|
|
637
|
-
|
|
454
|
+
autocomplete.setVisibility();
|
|
455
|
+
autocomplete.isOpen = this.overlayAttached = true;
|
|
638
456
|
// We need to do an extra `panelOpen` check in here, because the
|
|
639
457
|
// autocomplete won't be shown if there are no options.
|
|
640
458
|
if (this.panelOpen && wasOpen !== this.panelOpen) {
|
|
641
|
-
|
|
459
|
+
// TODO: The 'emit' function requires a mandatory void argument
|
|
460
|
+
autocomplete.opened.emit();
|
|
642
461
|
}
|
|
643
462
|
this.zone.onStable
|
|
644
463
|
.asObservable()
|
|
@@ -678,16 +497,17 @@ class KbqAutocompleteTrigger {
|
|
|
678
497
|
return this.positionStrategy;
|
|
679
498
|
}
|
|
680
499
|
getConnectedElement() {
|
|
681
|
-
|
|
682
|
-
|
|
500
|
+
const connectedTo = this.connectedTo();
|
|
501
|
+
if (connectedTo) {
|
|
502
|
+
return connectedTo.elementRef;
|
|
683
503
|
}
|
|
684
504
|
return this.formField ? this.formField.getConnectedOverlayOrigin() : this.elementRef;
|
|
685
505
|
}
|
|
686
506
|
getPanelMinWidth() {
|
|
687
|
-
return Math.max(this.autocomplete.panelMinWidth, this.getHostWidth());
|
|
507
|
+
return Math.max(this.autocomplete().panelMinWidth, this.getHostWidth());
|
|
688
508
|
}
|
|
689
509
|
getOverlaySize() {
|
|
690
|
-
const panelWidth = this.autocomplete.panelWidth;
|
|
510
|
+
const panelWidth = this.autocomplete().panelWidth;
|
|
691
511
|
return panelWidth ? { width: panelWidth } : { minWidth: this.getPanelMinWidth() };
|
|
692
512
|
}
|
|
693
513
|
getHostWidth() {
|
|
@@ -698,27 +518,29 @@ class KbqAutocompleteTrigger {
|
|
|
698
518
|
* correct options, or to 0 if the consumer opted into it.
|
|
699
519
|
*/
|
|
700
520
|
resetActiveItem() {
|
|
701
|
-
|
|
702
|
-
|
|
521
|
+
const autocomplete = this.autocomplete();
|
|
522
|
+
if (autocomplete.autoActiveFirstOption) {
|
|
523
|
+
autocomplete.keyManager.setFirstItemActive();
|
|
703
524
|
}
|
|
704
525
|
else {
|
|
705
|
-
|
|
526
|
+
autocomplete.keyManager.setActiveItem(-1);
|
|
706
527
|
}
|
|
707
528
|
}
|
|
708
529
|
canOpen() {
|
|
709
530
|
const element = this.elementRef.nativeElement;
|
|
710
531
|
return !element.readOnly && !element.disabled && !this._autocompleteDisabled;
|
|
711
532
|
}
|
|
712
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
713
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
533
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAutocompleteTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
534
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.25", type: KbqAutocompleteTrigger, isStandalone: true, selector: "input[kbqAutocomplete], textarea[kbqAutocomplete]", inputs: { autocomplete: { classPropertyName: "autocomplete", publicName: "kbqAutocomplete", isSignal: true, isRequired: false, transformFunction: null }, connectedTo: { classPropertyName: "connectedTo", publicName: "kbqAutocompleteConnectedTo", isSignal: true, isRequired: false, transformFunction: null }, autocompleteAttribute: { classPropertyName: "autocompleteAttribute", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, autocompleteDisabled: { classPropertyName: "autocompleteDisabled", publicName: "kbqAutocompleteDisabled", isSignal: false, isRequired: false, transformFunction: null }, onInputBlur: { classPropertyName: "onInputBlur", publicName: "kbqAutocompleteOnBlur", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "focusin": "handleFocus()", "blur": "onTouched()", "input": "handleInput($event)", "keydown": "handleKeydown($event)", "click": "handleClick($event)" }, properties: { "attr.autocomplete": "autocompleteAttribute()" }, classAttribute: "kbq-autocomplete-trigger" }, providers: [KBQ_AUTOCOMPLETE_VALUE_ACCESSOR], exportAs: ["kbqAutocompleteTrigger"], ngImport: i0 }); }
|
|
714
535
|
}
|
|
715
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
536
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAutocompleteTrigger, decorators: [{
|
|
716
537
|
type: Directive,
|
|
717
538
|
args: [{
|
|
718
539
|
selector: `input[kbqAutocomplete], textarea[kbqAutocomplete]`,
|
|
540
|
+
providers: [KBQ_AUTOCOMPLETE_VALUE_ACCESSOR],
|
|
719
541
|
host: {
|
|
720
542
|
class: 'kbq-autocomplete-trigger',
|
|
721
|
-
'[attr.autocomplete]': 'autocompleteAttribute',
|
|
543
|
+
'[attr.autocomplete]': 'autocompleteAttribute()',
|
|
722
544
|
// Note: we use `focusin`, as opposed to `focus`, in order to open the panel
|
|
723
545
|
// a little earlier. This avoids issues where IE delays the focusing of the input.
|
|
724
546
|
'(focusin)': 'handleFocus()',
|
|
@@ -727,40 +549,209 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
|
|
|
727
549
|
'(keydown)': 'handleKeydown($event)',
|
|
728
550
|
'(click)': 'handleClick($event)'
|
|
729
551
|
},
|
|
730
|
-
exportAs: 'kbqAutocompleteTrigger'
|
|
731
|
-
providers: [KBQ_AUTOCOMPLETE_VALUE_ACCESSOR]
|
|
552
|
+
exportAs: 'kbqAutocompleteTrigger'
|
|
732
553
|
}]
|
|
733
|
-
}], ctorParameters: () => [{ type: i0.
|
|
734
|
-
type: Inject,
|
|
735
|
-
args: [KBQ_AUTOCOMPLETE_SCROLL_STRATEGY]
|
|
736
|
-
}] }, { type: i2.Directionality, decorators: [{
|
|
737
|
-
type: Optional
|
|
738
|
-
}] }, { type: i1.KbqFormField, decorators: [{
|
|
739
|
-
type: Optional
|
|
740
|
-
}, {
|
|
741
|
-
type: Host
|
|
742
|
-
}] }, { type: i4.ViewportRuler }], propDecorators: { autocomplete: [{
|
|
743
|
-
type: Input,
|
|
744
|
-
args: ['kbqAutocomplete']
|
|
745
|
-
}], connectedTo: [{
|
|
746
|
-
type: Input,
|
|
747
|
-
args: ['kbqAutocompleteConnectedTo']
|
|
748
|
-
}], autocompleteAttribute: [{
|
|
749
|
-
type: Input,
|
|
750
|
-
args: ['autocomplete']
|
|
751
|
-
}], autocompleteDisabled: [{
|
|
554
|
+
}], ctorParameters: () => [], propDecorators: { autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "kbqAutocomplete", required: false }] }], connectedTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "kbqAutocompleteConnectedTo", required: false }] }], autocompleteAttribute: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], autocompleteDisabled: [{
|
|
752
555
|
type: Input,
|
|
753
556
|
args: ['kbqAutocompleteDisabled']
|
|
754
|
-
}], onInputBlur: [{
|
|
557
|
+
}], onInputBlur: [{ type: i0.Input, args: [{ isSignal: true, alias: "kbqAutocompleteOnBlur", required: false }] }] } });
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* Autocomplete IDs need to be unique across components, so this counter exists outside of
|
|
561
|
+
* the component definition.
|
|
562
|
+
*/
|
|
563
|
+
let uniqueAutocompleteIdCounter = 0;
|
|
564
|
+
/** Footer that is rendered below the autocomplete options panel. */
|
|
565
|
+
class KbqAutocompleteFooter {
|
|
566
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAutocompleteFooter, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
567
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.25", type: KbqAutocompleteFooter, isStandalone: true, selector: "[kbqAutocompleteFooter], kbq-autocomplete-footer", host: { classAttribute: "kbq-autocomplete-footer" }, ngImport: i0 }); }
|
|
568
|
+
}
|
|
569
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAutocompleteFooter, decorators: [{
|
|
570
|
+
type: Directive,
|
|
571
|
+
args: [{
|
|
572
|
+
selector: '[kbqAutocompleteFooter], kbq-autocomplete-footer',
|
|
573
|
+
host: { class: 'kbq-autocomplete-footer' }
|
|
574
|
+
}]
|
|
575
|
+
}] });
|
|
576
|
+
class KbqAutocompleteSelectedEvent {
|
|
577
|
+
constructor(source, option) {
|
|
578
|
+
this.source = source;
|
|
579
|
+
this.option = option;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
/** Injection token to be used to override the default options for `kbq-autocomplete`. */
|
|
583
|
+
const KBQ_AUTOCOMPLETE_DEFAULT_OPTIONS = new InjectionToken('kbq-autocomplete-default-options', {
|
|
584
|
+
providedIn: 'root',
|
|
585
|
+
factory: KBQ_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY
|
|
586
|
+
});
|
|
587
|
+
function KBQ_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY() {
|
|
588
|
+
return { autoActiveFirstOption: true };
|
|
589
|
+
}
|
|
590
|
+
class KbqAutocomplete {
|
|
591
|
+
/**
|
|
592
|
+
* Takes classes set on the host kbq-autocomplete element and applies them to the panel
|
|
593
|
+
* inside the overlay container to allow for easy styling.
|
|
594
|
+
*/
|
|
595
|
+
// TODO: Skipped for migration because:
|
|
596
|
+
// Accessor inputs cannot be migrated as they are too complex.
|
|
597
|
+
get classList() {
|
|
598
|
+
return this._classList;
|
|
599
|
+
}
|
|
600
|
+
set classList(value) {
|
|
601
|
+
if (value && value.length) {
|
|
602
|
+
const classList = { ...this._classList };
|
|
603
|
+
value.split(' ').forEach((className) => (classList[className.trim()] = true));
|
|
604
|
+
// Reassign a new object reference so the native `[class]` binding picks up the change.
|
|
605
|
+
this._classList = classList;
|
|
606
|
+
this.elementRef.nativeElement.className = '';
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* Whether the first option should be highlighted when the autocomplete panel is opened.
|
|
611
|
+
* Can be configured globally through the `KBQ_AUTOCOMPLETE_DEFAULT_OPTIONS` token.
|
|
612
|
+
*/
|
|
613
|
+
// TODO: Skipped for migration because:
|
|
614
|
+
// Accessor inputs cannot be migrated as they are too complex.
|
|
615
|
+
get autoActiveFirstOption() {
|
|
616
|
+
return this._autoActiveFirstOption;
|
|
617
|
+
}
|
|
618
|
+
set autoActiveFirstOption(value) {
|
|
619
|
+
this._autoActiveFirstOption = coerceBooleanProperty(value);
|
|
620
|
+
}
|
|
621
|
+
get isOpen() {
|
|
622
|
+
return this._isOpen && this.showPanel;
|
|
623
|
+
}
|
|
624
|
+
set isOpen(value) {
|
|
625
|
+
this._isOpen = value;
|
|
626
|
+
}
|
|
627
|
+
// TODO: Skipped for migration because:
|
|
628
|
+
// Accessor inputs cannot be migrated as they are too complex.
|
|
629
|
+
get openOnFocus() {
|
|
630
|
+
return this._openOnFocus;
|
|
631
|
+
}
|
|
632
|
+
set openOnFocus(value) {
|
|
633
|
+
this._openOnFocus = value;
|
|
634
|
+
}
|
|
635
|
+
constructor() {
|
|
636
|
+
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
637
|
+
this.elementRef = inject(ElementRef);
|
|
638
|
+
this.parentFormField = inject(KbqFormField, { host: true, optional: true });
|
|
639
|
+
this.destroyRef = inject(DestroyRef);
|
|
640
|
+
/** Unique ID to be used by autocomplete trigger's "aria-owns" property. */
|
|
641
|
+
this.id = `kbq-autocomplete-${uniqueAutocompleteIdCounter++}`;
|
|
642
|
+
/** Whether the autocomplete panel should be visible, depending on option length. */
|
|
643
|
+
this.showPanel = false;
|
|
644
|
+
this.template = viewChild.required(TemplateRef);
|
|
645
|
+
this.panel = viewChild.required('panel');
|
|
646
|
+
this.optionGroups = contentChildren(KbqOptgroup, ...(ngDevMode ? [{ debugName: "optionGroups" }] : []));
|
|
647
|
+
/** Function that maps an option's control value to its display value in the trigger. */
|
|
648
|
+
// TODO: Skipped for migration because:
|
|
649
|
+
// Your application code writes to the input. This prevents migration.
|
|
650
|
+
this.displayWith = null;
|
|
651
|
+
/**
|
|
652
|
+
* Minimum width of the panel in pixels.
|
|
653
|
+
* When panelWidth is not set, the panel will be at least as wide as its host and no less than panelMinWidth.
|
|
654
|
+
*/
|
|
655
|
+
// TODO: Skipped for migration because:
|
|
656
|
+
// Your application code writes to the input. This prevents migration.
|
|
657
|
+
this.panelMinWidth = 200;
|
|
658
|
+
/** Event that is emitted whenever an option from the list is selected. */
|
|
659
|
+
this.optionSelected = output();
|
|
660
|
+
/** Event that is emitted when the autocomplete panel is opened. */
|
|
661
|
+
this.opened = output();
|
|
662
|
+
/** Event that is emitted when the autocomplete panel is closed. */
|
|
663
|
+
this.closed = output();
|
|
664
|
+
this._classList = {};
|
|
665
|
+
this._isOpen = false;
|
|
666
|
+
this._openOnFocus = true;
|
|
667
|
+
const defaults = inject(KBQ_AUTOCOMPLETE_DEFAULT_OPTIONS);
|
|
668
|
+
this._autoActiveFirstOption = !!defaults.autoActiveFirstOption;
|
|
669
|
+
}
|
|
670
|
+
ngAfterContentInit() {
|
|
671
|
+
this.keyManager = new ActiveDescendantKeyManager(this.options);
|
|
672
|
+
this.setVisibility();
|
|
673
|
+
this.parentFormField
|
|
674
|
+
?.control()
|
|
675
|
+
.ngControl?.valueChanges?.pipe(delay(0), filter((value) => value === null || value === undefined || value === ''), takeUntilDestroyed(this.destroyRef))
|
|
676
|
+
.subscribe(() => {
|
|
677
|
+
this.options.filter(({ selected }) => selected).forEach((option) => option.deselect(false));
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
setScrollTop(scrollTop) {
|
|
681
|
+
const panel = this.panel();
|
|
682
|
+
if (panel) {
|
|
683
|
+
panel.nativeElement.scrollTop = scrollTop;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
getScrollTop() {
|
|
687
|
+
const panel = this.panel();
|
|
688
|
+
return panel ? panel.nativeElement.scrollTop : 0;
|
|
689
|
+
}
|
|
690
|
+
setVisibility() {
|
|
691
|
+
this.showPanel = !!this.options.length;
|
|
692
|
+
this._classList = {
|
|
693
|
+
...this._classList,
|
|
694
|
+
'kbq-autocomplete_visible': this.showPanel,
|
|
695
|
+
'kbq-autocomplete_hidden': !this.showPanel
|
|
696
|
+
};
|
|
697
|
+
this.updateFocusClass();
|
|
698
|
+
this.changeDetectorRef.markForCheck();
|
|
699
|
+
}
|
|
700
|
+
emitSelectEvent(option) {
|
|
701
|
+
const event = new KbqAutocompleteSelectedEvent(this, option);
|
|
702
|
+
this.optionSelected.emit(event);
|
|
703
|
+
}
|
|
704
|
+
onKeydown(event) {
|
|
705
|
+
this.keyManager.onKeydown(event);
|
|
706
|
+
this.updateFocusClass();
|
|
707
|
+
}
|
|
708
|
+
updateFocusClass() {
|
|
709
|
+
this._classList = {
|
|
710
|
+
...this._classList,
|
|
711
|
+
'cdk-keyboard-focused': this.parentFormField?.focusOrigin === 'keyboard'
|
|
712
|
+
};
|
|
713
|
+
}
|
|
714
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAutocomplete, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
715
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.25", type: KbqAutocomplete, isStandalone: true, selector: "kbq-autocomplete", inputs: { displayWith: "displayWith", panelWidth: "panelWidth", panelMinWidth: ["panelMinWidth", "panelMinWidth", numberAttribute], classList: ["class", "classList"], autoActiveFirstOption: "autoActiveFirstOption", openOnFocus: "openOnFocus" }, outputs: { optionSelected: "optionSelected", opened: "opened", closed: "closed" }, host: { classAttribute: "kbq-autocomplete" }, providers: [
|
|
716
|
+
{
|
|
717
|
+
provide: KBQ_OPTION_PARENT_COMPONENT,
|
|
718
|
+
useExisting: KbqAutocomplete
|
|
719
|
+
}
|
|
720
|
+
], queries: [{ propertyName: "optionGroups", predicate: KbqOptgroup, isSignal: true }, { propertyName: "options", predicate: KbqOption, descendants: true }], viewQueries: [{ propertyName: "template", first: true, predicate: TemplateRef, descendants: true, isSignal: true }, { propertyName: "panel", first: true, predicate: ["panel"], descendants: true, isSignal: true }], exportAs: ["kbqAutocomplete"], ngImport: i0, template: "<ng-template>\n <div class=\"kbq-autocomplete-panel\" [id]=\"id\" [class]=\"classList\">\n <div #panel role=\"listbox\" class=\"kbq-autocomplete-panel__content kbq-scrollbar\">\n <ng-content />\n </div>\n <ng-content select=\"[kbqAutocompleteFooter], kbq-autocomplete-footer\" />\n </div>\n</ng-template>\n", styles: [".kbq-autocomplete-panel .kbq-autocomplete-footer{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;box-sizing:border-box;min-height:40px;border-top-width:1px;border-top-style:solid;padding:var(--kbq-size-xxs) var(--kbq-size-l)}.kbq-autocomplete-panel{visibility:hidden;position:relative;display:flex;flex-direction:column;box-sizing:border-box;min-width:100%;width:100%;max-width:none;border-radius:var(--kbq-autocomplete-size-panel-border-radius, var(--kbq-size-border-radius));max-height:var(--kbq-autocomplete-size-panel-max-height)}.kbq-autocomplete-panel .kbq-autocomplete-panel__content{flex:1;padding:var(--kbq-size-xxs);overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch}.kbq-autocomplete-panel .kbq-autocomplete-footer{border-color:var(--kbq-line-contrast-less)}.kbq-autocomplete-panel.kbq-autocomplete_visible{visibility:visible}.kbq-autocomplete-panel.kbq-autocomplete_hidden{visibility:hidden}.kbq-autocomplete-panel .kbq-option{position:relative}.kbq-autocomplete-panel .kbq-option:before,.kbq-autocomplete-panel .kbq-option:after{position:absolute;content:\"\";width:var(--kbq-size-xxs);height:calc(100% + var(--kbq-size-3xs) * 2)}.kbq-autocomplete-panel .kbq-option:before{right:calc(100% + var(--kbq-size-3xs))}.kbq-autocomplete-panel .kbq-option:after{left:calc(100% + var(--kbq-size-3xs))}.kbq-autocomplete-panel .kbq-divider-horizontal{margin-top:-1px}.kbq-autocomplete-panel{box-shadow:var(--kbq-select-panel-dropdown-shadow);background:var(--kbq-select-panel-dropdown-background)}\n", ".kbq-autocomplete-panel{--kbq-autocomplete-size-panel-padding: var(--kbq-size-xxs) 0;--kbq-autocomplete-size-panel-max-height: 256px;--kbq-autocomplete-size-panel-border-radius: var(--kbq-size-border-radius);--kbq-select-panel-dropdown-background: var(--kbq-background-card);--kbq-select-panel-dropdown-shadow: var(--kbq-shadow-popup)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
721
|
+
}
|
|
722
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAutocomplete, decorators: [{
|
|
723
|
+
type: Component,
|
|
724
|
+
args: [{ selector: 'kbq-autocomplete', imports: [], providers: [
|
|
725
|
+
{
|
|
726
|
+
provide: KBQ_OPTION_PARENT_COMPONENT,
|
|
727
|
+
useExisting: KbqAutocomplete
|
|
728
|
+
}
|
|
729
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
730
|
+
class: 'kbq-autocomplete'
|
|
731
|
+
}, exportAs: 'kbqAutocomplete', template: "<ng-template>\n <div class=\"kbq-autocomplete-panel\" [id]=\"id\" [class]=\"classList\">\n <div #panel role=\"listbox\" class=\"kbq-autocomplete-panel__content kbq-scrollbar\">\n <ng-content />\n </div>\n <ng-content select=\"[kbqAutocompleteFooter], kbq-autocomplete-footer\" />\n </div>\n</ng-template>\n", styles: [".kbq-autocomplete-panel .kbq-autocomplete-footer{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;box-sizing:border-box;min-height:40px;border-top-width:1px;border-top-style:solid;padding:var(--kbq-size-xxs) var(--kbq-size-l)}.kbq-autocomplete-panel{visibility:hidden;position:relative;display:flex;flex-direction:column;box-sizing:border-box;min-width:100%;width:100%;max-width:none;border-radius:var(--kbq-autocomplete-size-panel-border-radius, var(--kbq-size-border-radius));max-height:var(--kbq-autocomplete-size-panel-max-height)}.kbq-autocomplete-panel .kbq-autocomplete-panel__content{flex:1;padding:var(--kbq-size-xxs);overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch}.kbq-autocomplete-panel .kbq-autocomplete-footer{border-color:var(--kbq-line-contrast-less)}.kbq-autocomplete-panel.kbq-autocomplete_visible{visibility:visible}.kbq-autocomplete-panel.kbq-autocomplete_hidden{visibility:hidden}.kbq-autocomplete-panel .kbq-option{position:relative}.kbq-autocomplete-panel .kbq-option:before,.kbq-autocomplete-panel .kbq-option:after{position:absolute;content:\"\";width:var(--kbq-size-xxs);height:calc(100% + var(--kbq-size-3xs) * 2)}.kbq-autocomplete-panel .kbq-option:before{right:calc(100% + var(--kbq-size-3xs))}.kbq-autocomplete-panel .kbq-option:after{left:calc(100% + var(--kbq-size-3xs))}.kbq-autocomplete-panel .kbq-divider-horizontal{margin-top:-1px}.kbq-autocomplete-panel{box-shadow:var(--kbq-select-panel-dropdown-shadow);background:var(--kbq-select-panel-dropdown-background)}\n", ".kbq-autocomplete-panel{--kbq-autocomplete-size-panel-padding: var(--kbq-size-xxs) 0;--kbq-autocomplete-size-panel-max-height: 256px;--kbq-autocomplete-size-panel-border-radius: var(--kbq-size-border-radius);--kbq-select-panel-dropdown-background: var(--kbq-background-card);--kbq-select-panel-dropdown-shadow: var(--kbq-shadow-popup)}\n"] }]
|
|
732
|
+
}], ctorParameters: () => [], propDecorators: { template: [{ type: i0.ViewChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }], panel: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], options: [{
|
|
733
|
+
type: ContentChildren,
|
|
734
|
+
args: [KbqOption, { descendants: true }]
|
|
735
|
+
}], optionGroups: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => KbqOptgroup), { isSignal: true }] }], displayWith: [{
|
|
736
|
+
type: Input
|
|
737
|
+
}], panelWidth: [{
|
|
738
|
+
type: Input
|
|
739
|
+
}], panelMinWidth: [{
|
|
755
740
|
type: Input,
|
|
756
|
-
args: [
|
|
741
|
+
args: [{ transform: numberAttribute }]
|
|
742
|
+
}], optionSelected: [{ type: i0.Output, args: ["optionSelected"] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }], classList: [{
|
|
743
|
+
type: Input,
|
|
744
|
+
args: ['class']
|
|
745
|
+
}], autoActiveFirstOption: [{
|
|
746
|
+
type: Input
|
|
747
|
+
}], openOnFocus: [{
|
|
748
|
+
type: Input
|
|
757
749
|
}] } });
|
|
758
750
|
|
|
759
751
|
class KbqAutocompleteModule {
|
|
760
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
761
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
752
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAutocompleteModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
753
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.25", ngImport: i0, type: KbqAutocompleteModule, imports: [KbqOptionModule,
|
|
762
754
|
OverlayModule,
|
|
763
|
-
NgClass,
|
|
764
755
|
KbqAutocomplete,
|
|
765
756
|
KbqAutocompleteTrigger,
|
|
766
757
|
KbqAutocompleteOrigin,
|
|
@@ -769,29 +760,28 @@ class KbqAutocompleteModule {
|
|
|
769
760
|
KbqAutocompleteTrigger,
|
|
770
761
|
KbqAutocompleteOrigin,
|
|
771
762
|
KbqAutocompleteFooter] }); }
|
|
772
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
763
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAutocompleteModule, providers: [KBQ_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER], imports: [KbqOptionModule,
|
|
773
764
|
OverlayModule, KbqOptionModule] }); }
|
|
774
765
|
}
|
|
775
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
766
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAutocompleteModule, decorators: [{
|
|
776
767
|
type: NgModule,
|
|
777
768
|
args: [{
|
|
778
769
|
imports: [
|
|
779
770
|
KbqOptionModule,
|
|
780
771
|
OverlayModule,
|
|
781
|
-
NgClass,
|
|
782
772
|
KbqAutocomplete,
|
|
783
773
|
KbqAutocompleteTrigger,
|
|
784
774
|
KbqAutocompleteOrigin,
|
|
785
775
|
KbqAutocompleteFooter
|
|
786
776
|
],
|
|
777
|
+
providers: [KBQ_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER],
|
|
787
778
|
exports: [
|
|
788
779
|
KbqAutocomplete,
|
|
789
780
|
KbqOptionModule,
|
|
790
781
|
KbqAutocompleteTrigger,
|
|
791
782
|
KbqAutocompleteOrigin,
|
|
792
783
|
KbqAutocompleteFooter
|
|
793
|
-
]
|
|
794
|
-
providers: [KBQ_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER]
|
|
784
|
+
]
|
|
795
785
|
}]
|
|
796
786
|
}] });
|
|
797
787
|
|