@clr/angular 18.0.0-beta.1 → 18.0.0-beta.2
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/fesm2022/clr-angular-button.mjs +2 -2
- package/fesm2022/clr-angular-button.mjs.map +1 -1
- package/fesm2022/clr-angular-data-datagrid.mjs +12 -26
- package/fesm2022/clr-angular-data-datagrid.mjs.map +1 -1
- package/fesm2022/clr-angular-data-tree-view.mjs +2 -2
- package/fesm2022/clr-angular-data-tree-view.mjs.map +1 -1
- package/fesm2022/clr-angular-data.mjs +13 -27
- package/fesm2022/clr-angular-data.mjs.map +1 -1
- package/fesm2022/clr-angular-emphasis-alert.mjs +2 -2
- package/fesm2022/clr-angular-emphasis-alert.mjs.map +1 -1
- package/fesm2022/clr-angular-emphasis.mjs +2 -2
- package/fesm2022/clr-angular-emphasis.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-checkbox.mjs +13 -44
- package/fesm2022/clr-angular-forms-checkbox.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-combobox.mjs +94 -61
- package/fesm2022/clr-angular-forms-combobox.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-common.mjs +61 -58
- package/fesm2022/clr-angular-forms-common.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-datalist.mjs +2 -14
- package/fesm2022/clr-angular-forms-datalist.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-datepicker.mjs +16 -24
- package/fesm2022/clr-angular-forms-datepicker.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-file-input.mjs +72 -55
- package/fesm2022/clr-angular-forms-file-input.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-input.mjs +4 -18
- package/fesm2022/clr-angular-forms-input.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-number-input.mjs +2 -14
- package/fesm2022/clr-angular-forms-number-input.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-password.mjs +2 -14
- package/fesm2022/clr-angular-forms-password.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-radio.mjs +13 -44
- package/fesm2022/clr-angular-forms-radio.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-range.mjs +3 -16
- package/fesm2022/clr-angular-forms-range.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-select.mjs +3 -16
- package/fesm2022/clr-angular-forms-select.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-textarea.mjs +4 -17
- package/fesm2022/clr-angular-forms-textarea.mjs.map +1 -1
- package/fesm2022/clr-angular-forms.mjs +258 -358
- package/fesm2022/clr-angular-forms.mjs.map +1 -1
- package/fesm2022/clr-angular-modal.mjs +2 -2
- package/fesm2022/clr-angular-modal.mjs.map +1 -1
- package/fesm2022/clr-angular-popover-common.mjs +151 -85
- package/fesm2022/clr-angular-popover-common.mjs.map +1 -1
- package/fesm2022/clr-angular-popover-dropdown.mjs +7 -4
- package/fesm2022/clr-angular-popover-dropdown.mjs.map +1 -1
- package/fesm2022/clr-angular-popover-signpost.mjs +27 -12
- package/fesm2022/clr-angular-popover-signpost.mjs.map +1 -1
- package/fesm2022/clr-angular-popover-tooltip.mjs +4 -4
- package/fesm2022/clr-angular-popover-tooltip.mjs.map +1 -1
- package/fesm2022/clr-angular-popover.mjs +186 -102
- package/fesm2022/clr-angular-popover.mjs.map +1 -1
- package/fesm2022/clr-angular-stepper.mjs +4 -4
- package/fesm2022/clr-angular-stepper.mjs.map +1 -1
- package/fesm2022/clr-angular-utils.mjs +12 -47
- package/fesm2022/clr-angular-utils.mjs.map +1 -1
- package/fesm2022/clr-angular-wizard.mjs +19 -11
- package/fesm2022/clr-angular-wizard.mjs.map +1 -1
- package/fesm2022/clr-angular.mjs +491 -548
- package/fesm2022/clr-angular.mjs.map +1 -1
- package/package.json +2 -2
- package/popover/common/README.md +14 -12
- package/types/clr-angular-data-datagrid.d.ts +0 -10
- package/types/clr-angular-data.d.ts +0 -10
- package/types/clr-angular-forms-combobox.d.ts +11 -4
- package/types/clr-angular-forms-common.d.ts +9 -9
- package/types/clr-angular-forms-datepicker.d.ts +7 -0
- package/types/clr-angular-forms-file-input.d.ts +5 -2
- package/types/clr-angular-forms.d.ts +31 -15
- package/types/clr-angular-popover-common.d.ts +38 -13
- package/types/clr-angular-popover-dropdown.d.ts +2 -1
- package/types/clr-angular-popover-signpost.d.ts +14 -6
- package/types/clr-angular-popover.d.ts +52 -18
- package/types/clr-angular-utils.d.ts +4 -14
- package/types/clr-angular-wizard.d.ts +7 -4
- package/types/clr-angular.d.ts +91 -59
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clr-angular-forms-checkbox.mjs","sources":["../../../projects/angular/forms/checkbox/checkbox-wrapper.ts","../../../projects/angular/forms/checkbox/checkbox.ts","../../../projects/angular/forms/checkbox/checkbox-container.ts","../../../projects/angular/forms/checkbox/checkbox.module.ts","../../../projects/angular/forms/checkbox/index.ts","../../../projects/angular/forms/checkbox/clr-angular-forms-checkbox.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n * The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\n\nimport { Component, ContentChild, forwardRef, Inject, InjectionToken, OnDestroy, OnInit } from '@angular/core';\nimport { ClrControlLabel, ControlIdService } from '@clr/angular/forms/common';\nimport { BehaviorSubject, Subscription } from 'rxjs';\n\nimport { ClrCheckbox } from './checkbox';\n\nexport const IS_TOGGLE = new InjectionToken<BehaviorSubject<boolean>>('IS_TOGGLE');\nexport function isToggleFactory() {\n return new BehaviorSubject<boolean>(false);\n}\nexport const IS_TOGGLE_PROVIDER = { provide: IS_TOGGLE, useFactory: isToggleFactory };\n\n@Component({\n selector: 'clr-checkbox-wrapper,clr-toggle-wrapper',\n template: `\n <ng-content select=\"[clrCheckbox],[clrToggle]\"></ng-content>\n <ng-content select=\"label\"></ng-content>\n @if (!label) {\n <label></label>\n }\n `,\n host: {\n '[class.clr-checkbox-wrapper]': '!toggle',\n '[class.clr-checkbox-wrapper-disabled]': 'checkbox?.controlDisabled',\n '[class.clr-toggle-wrapper]': 'toggle',\n },\n providers: [ControlIdService, IS_TOGGLE_PROVIDER],\n standalone: false,\n})\nexport class ClrCheckboxWrapper implements OnInit, OnDestroy {\n @ContentChild(ClrControlLabel, { static: true }) label: ClrControlLabel;\n @ContentChild(forwardRef(() => ClrCheckbox), { static: true }) checkbox: ClrCheckbox;\n toggle = false;\n private subscriptions: Subscription[] = [];\n\n constructor(@Inject(IS_TOGGLE) toggleService: BehaviorSubject<boolean>) {\n this.subscriptions.push(\n toggleService.subscribe(state => {\n this.toggle = state;\n })\n );\n }\n\n ngOnInit() {\n if (this.label) {\n this.label.disableGrid();\n }\n }\n\n ngOnDestroy() {\n this.subscriptions.forEach(sub => sub.unsubscribe());\n }\n}\n","/*\n * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n * The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\n\nimport { Attribute, Directive, ElementRef, Injector, Optional, Renderer2, Self, ViewContainerRef } from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { WrappedFormControl } from '@clr/angular/forms/common';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { ClrCheckboxWrapper, IS_TOGGLE } from './checkbox-wrapper';\n\n/**\n * This implements both the clrCheckbox and clrToggle functionality, since they are both just checkboxes with different\n * visual styling. The challenge is that the container needs to know which selector was used, which the @Attribute\n * decorator gets for us to determine if the toggle is used, and emits a value to the wrapper container to tell it\n * there is a toggle switch instead.\n */\n@Directive({\n selector: '[clrCheckbox],[clrToggle]',\n host: {\n '[attr.role]': 'toggle !== null ? \"switch\" : null',\n },\n standalone: false,\n})\nexport class ClrCheckbox extends WrappedFormControl<ClrCheckboxWrapper> {\n constructor(\n vcr: ViewContainerRef,\n injector: Injector,\n @Self()\n @Optional()\n private control: NgControl,\n renderer: Renderer2,\n el: ElementRef<HTMLInputElement>,\n @Attribute('clrToggle') protected toggle: string\n ) {\n super(vcr, ClrCheckboxWrapper, injector, control, renderer, el);\n }\n\n get controlDisabled() {\n return this.control?.disabled;\n }\n\n override ngOnInit() {\n super.ngOnInit();\n\n const toggleService = this.getProviderFromContainer<BehaviorSubject<boolean>>(IS_TOGGLE, null);\n\n if (toggleService && this.toggle !== null) {\n toggleService.next(true);\n }\n }\n}\n","/*\n * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n * The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\n\nimport { AfterContentInit, Component, ContentChildren, Input, Optional, QueryList } from '@angular/core';\nimport {\n ClrAbstractContainer,\n ContainerIdService,\n ControlClassService,\n LayoutService,\n NgControlService,\n} from '@clr/angular/forms/common';\n\nimport { ClrCheckbox } from './checkbox';\n\n@Component({\n selector: 'clr-checkbox-container,clr-toggle-container',\n template: `\n <ng-content select=\"label\"></ng-content>\n @if (!label && addGrid()) {\n <label></label>\n }\n <div class=\"clr-control-container\" [class.clr-control-inline]=\"clrInline\" [ngClass]=\"controlClass()\">\n <ng-content select=\"clr-checkbox-wrapper,clr-toggle-wrapper\"></ng-content>\n @if (showHelper) {\n <div class=\"clr-subtext-wrapper\">\n <ng-content select=\"clr-control-helper\"></ng-content>\n </div>\n }\n @if (showInvalid || showValid) {\n <div class=\"clr-subtext-wrapper\">\n @if (showInvalid) {\n <cds-icon\n class=\"clr-validate-icon\"\n shape=\"exclamation-circle\"\n status=\"danger\"\n aria-hidden=\"true\"\n ></cds-icon>\n }\n @if (showValid) {\n <cds-icon class=\"clr-validate-icon\" shape=\"check-circle\" status=\"success\" aria-hidden=\"true\"></cds-icon>\n }\n @if (showInvalid) {\n <ng-content select=\"clr-control-error\"></ng-content>\n }\n @if (showValid) {\n <ng-content select=\"clr-control-success\"></ng-content>\n }\n </div>\n }\n </div>\n `,\n host: {\n '[class.clr-form-control]': 'true',\n '[class.clr-form-control-disabled]': 'allCheckboxesDisabled',\n '[class.clr-row]': 'addGrid()',\n '[attr.role]': 'role',\n },\n providers: [NgControlService, ControlClassService, ContainerIdService],\n standalone: false,\n})\nexport class ClrCheckboxContainer extends ClrAbstractContainer implements AfterContentInit {\n role: string;\n\n @ContentChildren(ClrCheckbox, { descendants: true }) checkboxes: QueryList<ClrCheckbox>;\n\n private inline = false;\n\n constructor(\n @Optional() protected override layoutService: LayoutService,\n protected override controlClassService: ControlClassService,\n protected override ngControlService: NgControlService\n ) {\n super(layoutService, controlClassService, ngControlService);\n }\n\n /*\n * Here we want to support the following cases\n * clrInline - true by presence\n * clrInline=\"true|false\" - unless it is explicitly false, strings are considered true\n * [clrInline]=\"true|false\" - expect a boolean\n */\n @Input()\n get clrInline() {\n return this.inline;\n }\n set clrInline(value: boolean | string) {\n if (typeof value === 'string') {\n this.inline = value === 'false' ? false : true;\n } else {\n this.inline = !!value;\n }\n }\n\n protected get allCheckboxesDisabled() {\n if (!this.controls?.length) {\n return false;\n }\n\n return this.controls.every(control => control.disabled);\n }\n\n ngAfterContentInit() {\n this.setAriaRoles();\n }\n\n private setAriaRoles() {\n this.role = this.checkboxes?.length ? 'group' : null;\n }\n}\n","/*\n * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n * The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\n\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ClrCommonFormsModule } from '@clr/angular/forms/common';\nimport { checkCircleIcon, ClarityIcons, ClrIcon, exclamationCircleIcon } from '@clr/angular/icon';\nimport { ClrHostWrappingModule } from '@clr/angular/utils';\n\nimport { ClrCheckbox } from './checkbox';\nimport { ClrCheckboxContainer } from './checkbox-container';\nimport { ClrCheckboxWrapper } from './checkbox-wrapper';\n\n@NgModule({\n imports: [CommonModule, ClrIcon, ClrCommonFormsModule, ClrHostWrappingModule],\n declarations: [ClrCheckbox, ClrCheckboxContainer, ClrCheckboxWrapper],\n exports: [ClrCommonFormsModule, ClrCheckbox, ClrCheckboxContainer, ClrCheckboxWrapper],\n})\nexport class ClrCheckboxModule {\n constructor() {\n ClarityIcons.addIcons(exclamationCircleIcon, checkCircleIcon);\n }\n}\n","/*\n * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n * The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\n\nexport * from './checkbox';\nexport * from './checkbox-container';\nexport * from './checkbox-wrapper';\nexport * from './checkbox.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2"],"mappings":";;;;;;;;;;;;;AAAA;;;;;AAKG;MAQU,SAAS,GAAG,IAAI,cAAc,CAA2B,WAAW;SACjE,eAAe,GAAA;AAC7B,IAAA,OAAO,IAAI,eAAe,CAAU,KAAK,CAAC;AAC5C;AACO,MAAM,kBAAkB,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe;MAmBtE,kBAAkB,CAAA;AAM7B,IAAA,WAAA,CAA+B,aAAuC,EAAA;QAHtE,IAAA,CAAA,MAAM,GAAG,KAAK;QACN,IAAA,CAAA,aAAa,GAAmB,EAAE;QAGxC,IAAI,CAAC,aAAa,CAAC,IAAI,CACrB,aAAa,CAAC,SAAS,CAAC,KAAK,IAAG;AAC9B,YAAA,IAAI,CAAC,MAAM,GAAG,KAAK;QACrB,CAAC,CAAC,CACH;IACH;IAEA,QAAQ,GAAA;AACN,QAAA,IAAI,IAAI,CAAC,KAAK,EAAE;AACd,YAAA,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;QAC1B;IACF;IAEA,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,WAAW,EAAE,CAAC;IAC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","../../../projects/angular/forms/checkbox/checkbox-container.ts","../../../projects/angular/forms/checkbox/checkbox.module.ts","../../../projects/angular/forms/checkbox/index.ts","../../../projects/angular/forms/checkbox/clr-angular-forms-checkbox.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n * The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\n\nimport { Component, ContentChild, forwardRef, Inject, InjectionToken, OnDestroy, OnInit } from '@angular/core';\nimport { ClrControlLabel, ControlIdService } from '@clr/angular/forms/common';\nimport { BehaviorSubject, Subscription } from 'rxjs';\n\nimport { ClrCheckbox } from './checkbox';\n\nexport const IS_TOGGLE = new InjectionToken<BehaviorSubject<boolean>>('IS_TOGGLE');\nexport function isToggleFactory() {\n return new BehaviorSubject<boolean>(false);\n}\nexport const IS_TOGGLE_PROVIDER = { provide: IS_TOGGLE, useFactory: isToggleFactory };\n\n@Component({\n selector: 'clr-checkbox-wrapper,clr-toggle-wrapper',\n template: `\n <ng-content select=\"[clrCheckbox],[clrToggle]\"></ng-content>\n <ng-content select=\"label\"></ng-content>\n @if (!label) {\n <label></label>\n }\n `,\n host: {\n '[class.clr-checkbox-wrapper]': '!toggle',\n '[class.clr-checkbox-wrapper-disabled]': 'checkbox?.controlDisabled',\n '[class.clr-toggle-wrapper]': 'toggle',\n },\n providers: [ControlIdService, IS_TOGGLE_PROVIDER],\n standalone: false,\n})\nexport class ClrCheckboxWrapper implements OnInit, OnDestroy {\n @ContentChild(ClrControlLabel, { static: true }) label: ClrControlLabel;\n @ContentChild(forwardRef(() => ClrCheckbox), { static: true }) checkbox: ClrCheckbox;\n toggle = false;\n private subscriptions: Subscription[] = [];\n\n constructor(@Inject(IS_TOGGLE) toggleService: BehaviorSubject<boolean>) {\n this.subscriptions.push(\n toggleService.subscribe(state => {\n this.toggle = state;\n })\n );\n }\n\n ngOnInit() {\n if (this.label) {\n this.label.disableGrid();\n }\n }\n\n ngOnDestroy() {\n this.subscriptions.forEach(sub => sub.unsubscribe());\n }\n}\n","/*\n * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n * The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\n\nimport { Attribute, Directive, ElementRef, Injector, Optional, Renderer2, Self, ViewContainerRef } from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { WrappedFormControl } from '@clr/angular/forms/common';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { ClrCheckboxWrapper, IS_TOGGLE } from './checkbox-wrapper';\n\n/**\n * This implements both the clrCheckbox and clrToggle functionality, since they are both just checkboxes with different\n * visual styling. The challenge is that the container needs to know which selector was used, which the @Attribute\n * decorator gets for us to determine if the toggle is used, and emits a value to the wrapper container to tell it\n * there is a toggle switch instead.\n */\n@Directive({\n selector: '[clrCheckbox],[clrToggle]',\n host: {\n '[attr.role]': 'toggle !== null ? \"switch\" : null',\n },\n standalone: false,\n})\nexport class ClrCheckbox extends WrappedFormControl<ClrCheckboxWrapper> {\n constructor(\n vcr: ViewContainerRef,\n injector: Injector,\n @Self()\n @Optional()\n private control: NgControl,\n renderer: Renderer2,\n el: ElementRef<HTMLInputElement>,\n @Attribute('clrToggle') protected toggle: string\n ) {\n super(vcr, ClrCheckboxWrapper, injector, control, renderer, el);\n }\n\n get controlDisabled() {\n return this.control?.disabled;\n }\n\n override ngOnInit() {\n super.ngOnInit();\n\n const toggleService = this.getProviderFromContainer<BehaviorSubject<boolean>>(IS_TOGGLE, null);\n\n if (toggleService && this.toggle !== null) {\n toggleService.next(true);\n }\n }\n}\n","/*\n * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n * The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\n\nimport { AfterContentInit, Component, ContentChildren, Input, Optional, QueryList } from '@angular/core';\nimport {\n ClrAbstractContainer,\n ContainerIdService,\n ControlClassService,\n LayoutService,\n NgControlService,\n} from '@clr/angular/forms/common';\n\nimport { ClrCheckbox } from './checkbox';\n\n@Component({\n selector: 'clr-checkbox-container,clr-toggle-container',\n template: `\n <ng-content select=\"label\"></ng-content>\n @if (!label && addGrid()) {\n <label></label>\n }\n <div class=\"clr-control-container\" [class.clr-control-inline]=\"clrInline\" [ngClass]=\"controlClass()\">\n <ng-content select=\"clr-checkbox-wrapper,clr-toggle-wrapper\"></ng-content>\n @if (showHelper) {\n <div class=\"clr-subtext-wrapper\">\n <ng-content select=\"clr-control-helper\"></ng-content>\n </div>\n }\n @if (showInvalid) {\n <ng-content select=\"clr-control-error\"></ng-content>\n }\n @if (showValid) {\n <ng-content select=\"clr-control-success\"></ng-content>\n }\n </div>\n `,\n host: {\n '[class.clr-form-control]': 'true',\n '[class.clr-form-control-disabled]': 'allCheckboxesDisabled',\n '[class.clr-row]': 'addGrid()',\n '[attr.role]': 'role',\n },\n providers: [NgControlService, ControlClassService, ContainerIdService],\n standalone: false,\n})\nexport class ClrCheckboxContainer extends ClrAbstractContainer implements AfterContentInit {\n role: string;\n\n @ContentChildren(ClrCheckbox, { descendants: true }) checkboxes: QueryList<ClrCheckbox>;\n\n private inline = false;\n\n constructor(\n @Optional() protected override layoutService: LayoutService,\n protected override controlClassService: ControlClassService,\n protected override ngControlService: NgControlService\n ) {\n super(layoutService, controlClassService, ngControlService);\n }\n\n /*\n * Here we want to support the following cases\n * clrInline - true by presence\n * clrInline=\"true|false\" - unless it is explicitly false, strings are considered true\n * [clrInline]=\"true|false\" - expect a boolean\n */\n @Input()\n get clrInline() {\n return this.inline;\n }\n set clrInline(value: boolean | string) {\n if (typeof value === 'string') {\n this.inline = value === 'false' ? false : true;\n } else {\n this.inline = !!value;\n }\n }\n\n protected get allCheckboxesDisabled() {\n if (!this.controls?.length) {\n return false;\n }\n\n return this.controls.every(control => control.disabled);\n }\n\n ngAfterContentInit() {\n this.setAriaRoles();\n }\n\n private setAriaRoles() {\n this.role = this.checkboxes?.length ? 'group' : null;\n }\n}\n","/*\n * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n * The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\n\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ClrCommonFormsModule } from '@clr/angular/forms/common';\nimport { ClarityIcons, ClrIcon, errorStandardIcon, successStandardIcon } from '@clr/angular/icon';\nimport { ClrHostWrappingModule } from '@clr/angular/utils';\n\nimport { ClrCheckbox } from './checkbox';\nimport { ClrCheckboxContainer } from './checkbox-container';\nimport { ClrCheckboxWrapper } from './checkbox-wrapper';\n\n@NgModule({\n imports: [CommonModule, ClrIcon, ClrCommonFormsModule, ClrHostWrappingModule],\n declarations: [ClrCheckbox, ClrCheckboxContainer, ClrCheckboxWrapper],\n exports: [ClrCommonFormsModule, ClrCheckbox, ClrCheckboxContainer, ClrCheckboxWrapper],\n})\nexport class ClrCheckboxModule {\n constructor() {\n ClarityIcons.addIcons(successStandardIcon, errorStandardIcon);\n }\n}\n","/*\n * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n * The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\n\nexport * from './checkbox';\nexport * from './checkbox-container';\nexport * from './checkbox-wrapper';\nexport * from './checkbox.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2"],"mappings":";;;;;;;;;;;;AAAA;;;;;AAKG;MAQU,SAAS,GAAG,IAAI,cAAc,CAA2B,WAAW;SACjE,eAAe,GAAA;AAC7B,IAAA,OAAO,IAAI,eAAe,CAAU,KAAK,CAAC;AAC5C;AACO,MAAM,kBAAkB,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,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E,kBAAkB,CAAC;oBACrE,OAAO,EAAE,CAAC,oBAAoB,EAAE,WAAW,EAAE,oBAAoB,EAAE,kBAAkB,CAAC;AACvF,iBAAA;;;ACrBD;;;;;AAKG;;ACLH;;AAEG;;;;"}
|
|
@@ -6,14 +6,14 @@ import * as i1$1 from '@angular/forms';
|
|
|
6
6
|
import { FormsModule } from '@angular/forms';
|
|
7
7
|
import * as i1 from '@clr/angular/forms/common';
|
|
8
8
|
import { ClrAbstractContainer, NgControlService, ControlIdService, ControlClassService, WrappedFormControl, ClrCommonFormsModule } from '@clr/angular/forms/common';
|
|
9
|
-
import * as
|
|
10
|
-
import { ClarityIcons,
|
|
11
|
-
import * as i4
|
|
12
|
-
import {
|
|
9
|
+
import * as i8 from '@clr/angular/icon';
|
|
10
|
+
import { ClarityIcons, successStandardIcon, errorStandardIcon, angleIcon, windowCloseIcon, ClrIcon } from '@clr/angular/icon';
|
|
11
|
+
import * as i4 from '@clr/angular/popover/common';
|
|
12
|
+
import { POPOVER_HOST_ORIGIN, ClrPopoverPosition, ClrPopoverType, ClrPopoverHostDirective, ÇlrClrPopoverModuleNext as _lrClrPopoverModuleNext } from '@clr/angular/popover/common';
|
|
13
13
|
import * as i5 from '@clr/angular/progress/spinner';
|
|
14
14
|
import { ClrSpinnerModule } from '@clr/angular/progress/spinner';
|
|
15
15
|
import * as i3$1 from '@clr/angular/utils';
|
|
16
|
-
import { ArrowKeyDirection,
|
|
16
|
+
import { ArrowKeyDirection, Keys, customFocusableItemProvider, uniqueIdFactory, ClrLoadingState, IF_ACTIVE_ID, LoadingListener, IF_ACTIVE_ID_PROVIDER, FOCUS_SERVICE_PROVIDER, ClrConditionalModule, ClrKeyFocusModule } from '@clr/angular/utils';
|
|
17
17
|
import { take } from 'rxjs/operators';
|
|
18
18
|
import { BehaviorSubject, ReplaySubject } from 'rxjs';
|
|
19
19
|
|
|
@@ -63,12 +63,6 @@ class ClrComboboxContainer extends ClrAbstractContainer {
|
|
|
63
63
|
}
|
|
64
64
|
<div class="clr-control-container" [ngClass]="controlClass()" #controlContainer>
|
|
65
65
|
<ng-content select="clr-combobox"></ng-content>
|
|
66
|
-
@if (showInvalid) {
|
|
67
|
-
<cds-icon class="clr-validate-icon" shape="exclamation-circle" status="danger" aria-hidden="true"></cds-icon>
|
|
68
|
-
}
|
|
69
|
-
@if (showValid) {
|
|
70
|
-
<cds-icon class="clr-validate-icon" shape="check-circle" status="success" aria-hidden="true"></cds-icon>
|
|
71
|
-
}
|
|
72
66
|
@if (showHelper) {
|
|
73
67
|
<ng-content select="clr-control-helper"></ng-content>
|
|
74
68
|
}
|
|
@@ -79,7 +73,7 @@ class ClrComboboxContainer extends ClrAbstractContainer {
|
|
|
79
73
|
<ng-content select="clr-control-success"></ng-content>
|
|
80
74
|
}
|
|
81
75
|
</div>
|
|
82
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "
|
|
76
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.ClrControlLabel, selector: "label", inputs: ["id", "for"] }] }); }
|
|
83
77
|
}
|
|
84
78
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrComboboxContainer, decorators: [{
|
|
85
79
|
type: Component,
|
|
@@ -92,12 +86,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
92
86
|
}
|
|
93
87
|
<div class="clr-control-container" [ngClass]="controlClass()" #controlContainer>
|
|
94
88
|
<ng-content select="clr-combobox"></ng-content>
|
|
95
|
-
@if (showInvalid) {
|
|
96
|
-
<cds-icon class="clr-validate-icon" shape="exclamation-circle" status="danger" aria-hidden="true"></cds-icon>
|
|
97
|
-
}
|
|
98
|
-
@if (showValid) {
|
|
99
|
-
<cds-icon class="clr-validate-icon" shape="check-circle" status="success" aria-hidden="true"></cds-icon>
|
|
100
|
-
}
|
|
101
89
|
@if (showHelper) {
|
|
102
90
|
<ng-content select="clr-control-helper"></ng-content>
|
|
103
91
|
}
|
|
@@ -131,20 +119,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
131
119
|
* This software is released under MIT license.
|
|
132
120
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
133
121
|
*/
|
|
134
|
-
class
|
|
122
|
+
class ComboboxModel {
|
|
123
|
+
constructor() {
|
|
124
|
+
this.identityFn = (item) => item;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/*
|
|
129
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
130
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
131
|
+
* This software is released under MIT license.
|
|
132
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
133
|
+
*/
|
|
134
|
+
class MultiSelectComboboxModel extends ComboboxModel {
|
|
135
135
|
containsItem(item) {
|
|
136
|
-
if (this.model) {
|
|
137
|
-
|
|
138
|
-
const includes = this.model.some(modelItem => {
|
|
139
|
-
return modelItem[this.displayField] === item[this.displayField];
|
|
140
|
-
});
|
|
141
|
-
return includes;
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
return this.model.includes(item);
|
|
145
|
-
}
|
|
136
|
+
if (!this.model) {
|
|
137
|
+
return false;
|
|
146
138
|
}
|
|
147
|
-
return
|
|
139
|
+
return this.model.some(m => this.identityFn(m) === this.identityFn(item));
|
|
148
140
|
}
|
|
149
141
|
select(item) {
|
|
150
142
|
this.addItem(item);
|
|
@@ -207,7 +199,7 @@ class MultiSelectComboboxModel {
|
|
|
207
199
|
if (this.model === null || this.model === undefined) {
|
|
208
200
|
return;
|
|
209
201
|
}
|
|
210
|
-
const index = this.model.
|
|
202
|
+
const index = this.model.findIndex(m => this.identityFn(m) === this.identityFn(item));
|
|
211
203
|
if (index > -1) {
|
|
212
204
|
this.model.splice(index, 1);
|
|
213
205
|
}
|
|
@@ -224,9 +216,9 @@ class MultiSelectComboboxModel {
|
|
|
224
216
|
* This software is released under MIT license.
|
|
225
217
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
226
218
|
*/
|
|
227
|
-
class SingleSelectComboboxModel {
|
|
219
|
+
class SingleSelectComboboxModel extends ComboboxModel {
|
|
228
220
|
containsItem(item) {
|
|
229
|
-
return this.model === item;
|
|
221
|
+
return this.model !== null && this.identityFn(this.model) === this.identityFn(item);
|
|
230
222
|
}
|
|
231
223
|
select(item) {
|
|
232
224
|
this.model = item;
|
|
@@ -320,6 +312,7 @@ class OptionSelectionService {
|
|
|
320
312
|
this._currentInput = '';
|
|
321
313
|
this._inputChanged = new BehaviorSubject('');
|
|
322
314
|
this._selectionChanged = new ReplaySubject(1);
|
|
315
|
+
this._identityFn = (item) => item;
|
|
323
316
|
this.inputChanged = this._inputChanged.asObservable();
|
|
324
317
|
}
|
|
325
318
|
get displayField() {
|
|
@@ -350,6 +343,15 @@ class OptionSelectionService {
|
|
|
350
343
|
get multiselectable() {
|
|
351
344
|
return this.selectionModel instanceof MultiSelectComboboxModel;
|
|
352
345
|
}
|
|
346
|
+
get identityFn() {
|
|
347
|
+
return this._identityFn;
|
|
348
|
+
}
|
|
349
|
+
set identityFn(value) {
|
|
350
|
+
this._identityFn = value || ((item) => item);
|
|
351
|
+
if (this.selectionModel) {
|
|
352
|
+
this.selectionModel.identityFn = this._identityFn;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
353
355
|
select(item) {
|
|
354
356
|
if (item === null || item === undefined || this.selectionModel.containsItem(item)) {
|
|
355
357
|
return;
|
|
@@ -376,13 +378,12 @@ class OptionSelectionService {
|
|
|
376
378
|
this.selectionModel.unselect(item);
|
|
377
379
|
this._selectionChanged.next(this.selectionModel);
|
|
378
380
|
}
|
|
379
|
-
// TODO: Add support for trackBy and compareFn
|
|
380
381
|
setSelectionValue(value) {
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
if (
|
|
382
|
+
if (!this.selectionModel) {
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
const current = this.selectionModel.model;
|
|
386
|
+
if (this.valuesEqualByIdentity(current, value)) {
|
|
386
387
|
return;
|
|
387
388
|
}
|
|
388
389
|
this.selectionModel.model = value;
|
|
@@ -396,6 +397,39 @@ class OptionSelectionService {
|
|
|
396
397
|
}
|
|
397
398
|
return value;
|
|
398
399
|
}
|
|
400
|
+
valuesEqualByIdentity(current, value) {
|
|
401
|
+
if (current === value) {
|
|
402
|
+
return true;
|
|
403
|
+
}
|
|
404
|
+
// Check if both are null or undefined or empty string.
|
|
405
|
+
if ((current === null || current === undefined || current === '') &&
|
|
406
|
+
(value === null || value === undefined || value === '')) {
|
|
407
|
+
return true;
|
|
408
|
+
}
|
|
409
|
+
// Check if one is null or undefined or empty string and the other is not.
|
|
410
|
+
if (current === null ||
|
|
411
|
+
current === undefined ||
|
|
412
|
+
current === '' ||
|
|
413
|
+
value === null ||
|
|
414
|
+
value === undefined ||
|
|
415
|
+
value === '') {
|
|
416
|
+
return false;
|
|
417
|
+
}
|
|
418
|
+
if (this.multiselectable) {
|
|
419
|
+
const cur = current;
|
|
420
|
+
const val = value;
|
|
421
|
+
if (cur.length !== val.length) {
|
|
422
|
+
return false;
|
|
423
|
+
}
|
|
424
|
+
// We only consider values equal if they are ordered the same way.
|
|
425
|
+
const curIds = cur.map(this._identityFn);
|
|
426
|
+
const valIds = val.map(this._identityFn);
|
|
427
|
+
return curIds.every((id, i) => id === valIds[i]);
|
|
428
|
+
}
|
|
429
|
+
else {
|
|
430
|
+
return this._identityFn(current) === this._identityFn(value);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
399
433
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: OptionSelectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
400
434
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: OptionSelectionService }); }
|
|
401
435
|
}
|
|
@@ -520,7 +554,7 @@ class ComboboxFocusHandler {
|
|
|
520
554
|
// this service is only interested in keys that may move the focus
|
|
521
555
|
handleTextInput(event) {
|
|
522
556
|
let preventDefault = false;
|
|
523
|
-
const key =
|
|
557
|
+
const key = event.key;
|
|
524
558
|
if (event) {
|
|
525
559
|
switch (key) {
|
|
526
560
|
case Keys.Enter:
|
|
@@ -577,26 +611,20 @@ class ComboboxFocusHandler {
|
|
|
577
611
|
this.renderer.listen(el, 'blur', event => {
|
|
578
612
|
if (this.focusOutOfComponent(event)) {
|
|
579
613
|
this.popoverService.open = false;
|
|
580
|
-
// Workaround for popover close-on-outside-click timing issues in Edge browser
|
|
581
|
-
if (this.componentCdRef) {
|
|
582
|
-
this.componentCdRef.detectChanges();
|
|
583
|
-
}
|
|
584
614
|
}
|
|
585
615
|
});
|
|
586
616
|
}
|
|
587
617
|
}
|
|
588
618
|
focusOutOfComponent(event) {
|
|
589
|
-
|
|
590
|
-
// which points to the element that becomes active as the blur event occurs on the input.
|
|
591
|
-
const target = (event.relatedTarget || document.activeElement);
|
|
619
|
+
const target = event.relatedTarget;
|
|
592
620
|
return !(this.textInput.contains(target) || this.trigger.contains(target) || this.listbox.contains(target));
|
|
593
621
|
}
|
|
594
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ComboboxFocusHandler, deps: [{ token: i0.RendererFactory2 }, { token: i4
|
|
622
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ComboboxFocusHandler, deps: [{ token: i0.RendererFactory2 }, { token: i4.ClrPopoverService }, { token: OptionSelectionService }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
595
623
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ComboboxFocusHandler }); }
|
|
596
624
|
}
|
|
597
625
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ComboboxFocusHandler, decorators: [{
|
|
598
626
|
type: Injectable
|
|
599
|
-
}], ctorParameters: () => [{ type: i0.RendererFactory2 }, { type: i4
|
|
627
|
+
}], ctorParameters: () => [{ type: i0.RendererFactory2 }, { type: i4.ClrPopoverService }, { type: OptionSelectionService }, { type: undefined, decorators: [{
|
|
600
628
|
type: Inject,
|
|
601
629
|
args: [PLATFORM_ID]
|
|
602
630
|
}] }] });
|
|
@@ -780,7 +808,7 @@ class ClrOptions {
|
|
|
780
808
|
loadingStateChange(state) {
|
|
781
809
|
this.loading = state === ClrLoadingState.LOADING;
|
|
782
810
|
}
|
|
783
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrOptions, deps: [{ token: OptionSelectionService }, { token: IF_ACTIVE_ID }, { token: i0.ElementRef }, { token: i3$1.ClrCommonStringsService }, { token: ComboboxFocusHandler }, { token: i4
|
|
811
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrOptions, deps: [{ token: OptionSelectionService }, { token: IF_ACTIVE_ID }, { token: i0.ElementRef }, { token: i3$1.ClrCommonStringsService }, { token: ComboboxFocusHandler }, { token: i4.ClrPopoverService }, { token: POPOVER_HOST_ORIGIN, optional: true }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
784
812
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: ClrOptions, isStandalone: false, selector: "clr-options", inputs: { optionsId: ["id", "optionsId"] }, host: { properties: { "class.clr-combobox-options": "true", "class.clr-combobox-options-hidden": "emptyOptions && editable", "attr.role": "\"listbox\"", "id": "optionsId" } }, providers: [{ provide: LoadingListener, useExisting: ClrOptions }], queries: [{ propertyName: "items", predicate: ClrOption, descendants: true }], ngImport: i0, template: `
|
|
785
813
|
@if (optionSelectionService.loading) {
|
|
786
814
|
<div class="clr-combobox-options-loading">
|
|
@@ -846,11 +874,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
846
874
|
}], ctorParameters: () => [{ type: OptionSelectionService }, { type: undefined, decorators: [{
|
|
847
875
|
type: Inject,
|
|
848
876
|
args: [IF_ACTIVE_ID]
|
|
849
|
-
}] }, { type: i0.ElementRef }, { type: i3$1.ClrCommonStringsService }, { type: ComboboxFocusHandler }, { type: i4
|
|
877
|
+
}] }, { type: i0.ElementRef }, { type: i3$1.ClrCommonStringsService }, { type: ComboboxFocusHandler }, { type: i4.ClrPopoverService }, { type: i0.ElementRef, decorators: [{
|
|
850
878
|
type: Optional
|
|
851
879
|
}, {
|
|
852
880
|
type: Inject,
|
|
853
|
-
args: [
|
|
881
|
+
args: [POPOVER_HOST_ORIGIN]
|
|
854
882
|
}] }, { type: undefined, decorators: [{
|
|
855
883
|
type: Inject,
|
|
856
884
|
args: [DOCUMENT]
|
|
@@ -897,8 +925,7 @@ class ClrCombobox extends WrappedFormControl {
|
|
|
897
925
|
control.valueAccessor = this;
|
|
898
926
|
}
|
|
899
927
|
// default to SingleSelectComboboxModel, in case the optional input [ClrMulti] isn't used
|
|
900
|
-
|
|
901
|
-
this.updateControlValue();
|
|
928
|
+
this.multiSelect = false;
|
|
902
929
|
}
|
|
903
930
|
get editable() {
|
|
904
931
|
return this.optionSelectionService.editable;
|
|
@@ -906,6 +933,9 @@ class ClrCombobox extends WrappedFormControl {
|
|
|
906
933
|
set editable(value) {
|
|
907
934
|
this.optionSelectionService.editable = value;
|
|
908
935
|
}
|
|
936
|
+
set identityFn(value) {
|
|
937
|
+
this.optionSelectionService.identityFn = value;
|
|
938
|
+
}
|
|
909
939
|
get multiSelect() {
|
|
910
940
|
return this.optionSelectionService.multiselectable;
|
|
911
941
|
}
|
|
@@ -918,6 +948,7 @@ class ClrCombobox extends WrappedFormControl {
|
|
|
918
948
|
// since the initial call to writeValue (caused by [ngModel] input) should happen after this
|
|
919
949
|
this.optionSelectionService.selectionModel = new SingleSelectComboboxModel();
|
|
920
950
|
}
|
|
951
|
+
this.optionSelectionService.selectionModel.identityFn = this.optionSelectionService.identityFn;
|
|
921
952
|
this.updateControlValue();
|
|
922
953
|
}
|
|
923
954
|
// Override the id of WrappedFormControl, as we want to move it to the embedded input.
|
|
@@ -977,7 +1008,6 @@ class ClrCombobox extends WrappedFormControl {
|
|
|
977
1008
|
}
|
|
978
1009
|
}
|
|
979
1010
|
ngAfterViewInit() {
|
|
980
|
-
this.focusHandler.componentCdRef = this.cdr;
|
|
981
1011
|
this.focusHandler.textInput = this.textbox.nativeElement;
|
|
982
1012
|
this.focusHandler.trigger = this.trigger.nativeElement;
|
|
983
1013
|
// The text input is the actual element we are wrapping
|
|
@@ -1140,14 +1170,14 @@ class ClrCombobox extends WrappedFormControl {
|
|
|
1140
1170
|
}
|
|
1141
1171
|
return [this.optionSelectionService.selectionModel.model];
|
|
1142
1172
|
}
|
|
1143
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrCombobox, deps: [{ token: i0.ViewContainerRef }, { token: i0.Injector }, { token: i1$1.NgControl, optional: true, self: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: OptionSelectionService }, { token: i3$1.ClrCommonStringsService }, { token: i4
|
|
1144
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: ClrCombobox, isStandalone: false, selector: "clr-combobox", inputs: { placeholder: "placeholder", editable: ["clrEditable", "editable"], multiSelect: ["clrMulti", "multiSelect"] }, outputs: { clrInputChange: "clrInputChange", clrOpenChange: "clrOpenChange", clrSelectionChange: "clrSelectionChange" }, host: { listeners: { "keydown": "onKeyUp($event)" }, properties: { "class.aria-required": "true", "class.clr-combobox": "true", "class.clr-combobox-disabled": "control?.disabled" } }, providers: [
|
|
1173
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrCombobox, deps: [{ token: i0.ViewContainerRef }, { token: i0.Injector }, { token: i1$1.NgControl, optional: true, self: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: OptionSelectionService }, { token: i3$1.ClrCommonStringsService }, { token: i4.ClrPopoverService }, { token: ComboboxContainerService, optional: true }, { token: PLATFORM_ID }, { token: ComboboxFocusHandler }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1174
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: ClrCombobox, isStandalone: false, selector: "clr-combobox", inputs: { placeholder: "placeholder", editable: ["clrEditable", "editable"], identityFn: ["clrComboboxIdentityFn", "identityFn"], multiSelect: ["clrMulti", "multiSelect"] }, outputs: { clrInputChange: "clrInputChange", clrOpenChange: "clrOpenChange", clrSelectionChange: "clrSelectionChange" }, host: { listeners: { "keydown": "onKeyUp($event)" }, properties: { "class.aria-required": "true", "class.clr-combobox": "true", "class.clr-combobox-disabled": "control?.disabled" } }, providers: [
|
|
1145
1175
|
OptionSelectionService,
|
|
1146
1176
|
{ provide: LoadingListener, useExisting: ClrCombobox },
|
|
1147
1177
|
IF_ACTIVE_ID_PROVIDER,
|
|
1148
1178
|
FOCUS_SERVICE_PROVIDER,
|
|
1149
1179
|
COMBOBOX_FOCUS_HANDLER_PROVIDER,
|
|
1150
|
-
], queries: [{ propertyName: "optionSelected", first: true, predicate: ClrOptionSelected, descendants: true }, { propertyName: "options", first: true, predicate: ClrOptions, descendants: true }], viewQueries: [{ propertyName: "textbox", first: true, predicate: ["textboxInput"], descendants: true }, { propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true }], usesInheritance: true, hostDirectives: [{ directive: i4
|
|
1180
|
+
], queries: [{ propertyName: "optionSelected", first: true, predicate: ClrOptionSelected, descendants: true }, { propertyName: "options", first: true, predicate: ClrOptions, descendants: true }], viewQueries: [{ propertyName: "textbox", first: true, predicate: ["textboxInput"], descendants: true }, { propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true }], usesInheritance: true, hostDirectives: [{ directive: i4.ClrPopoverHostDirective }], ngImport: i0, template: "<!--\n ~ Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n ~ The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n\n<!-- The (click) handler is needed to auto-focus on input field which can not currently occupy the whole\nwidth of the component, after being wrapped to a new line -->\n<div\n class=\"clr-combobox-wrapper\"\n clrPopoverOrigin\n (click)=\"onWrapperClick($event)\"\n [class.multi]=\"multiSelect\"\n [class.invalid]=\"(control?.control.touched && control?.invalid)\"\n [class.disabled]=\"control?.disabled\"\n>\n @if (multiSelect && optionSelectionService.selectionModel.model && multiSelectModel.length > 0) {\n <span\n role=\"grid\"\n clrRovingTabindex\n [clrRovingTabindexDisabled]=\"control?.disabled\"\n clrDirection=\"both\"\n [attr.aria-label]=\"getSelectionAriaLabel()\"\n [attr.aria-disabled]=\"control?.disabled? true: null\"\n class=\"clr-combobox-pills\"\n >\n @for (item of multiSelectModel; track item; let i = $index) {\n <span class=\"label label-combobox-pill\" role=\"row\">\n <span role=\"gridcell\">\n <span class=\"clr-combobox-pill-content\" clrKeyFocusItem>\n @if (optionSelected) {\n <ng-container\n [ngTemplateOutlet]=\"optionSelected.template\"\n [ngTemplateOutletContext]=\"{$implicit: optionSelectionService.selectionModel.model[i]}\"\n ></ng-container>\n }\n </span>\n </span>\n <span role=\"gridcell\">\n <button\n clrKeyFocusItem\n type=\"button\"\n class=\"clr-combobox-remove-btn\"\n [disabled]=\"control?.disabled? true: null\"\n [attr.aria-label]=\"commonStrings.keys.comboboxDelete + ' ' + optionSelectionService.selectionModel.toString(displayField, i)\"\n (click)=\"unselect(item)\"\n >\n <cds-icon shape=\"window-close\" size=\"12\"></cds-icon>\n </button>\n </span>\n </span>\n }\n </span>\n }\n\n <input\n #textboxInput\n type=\"text\"\n role=\"combobox\"\n [id]=\"inputId()\"\n class=\"clr-input clr-combobox-input\"\n [(ngModel)]=\"searchText\"\n (blur)=\"onBlur($event)\"\n (focus)=\"onFocus()\"\n (change)=\"onChange()\"\n [attr.aria-expanded]=\"openState\"\n [attr.aria-owns]=\"ariaOwns\"\n aria-haspopup=\"listbox\"\n aria-autocomplete=\"list\"\n autocomplete=\"off\"\n [attr.aria-invalid]=\"control?.invalid? true: null\"\n [disabled]=\"control?.disabled? true: null\"\n [attr.aria-activedescendant]=\"getActiveDescendant()\"\n [attr.placeholder]=\"placeholder\"\n />\n\n <!-- No click handler, as it uses the handler on the .clr-combobox-wrapper -->\n <button\n #trigger\n type=\"button\"\n class=\"clr-combobox-trigger\"\n tabindex=\"-1\"\n [disabled]=\"control?.disabled || null\"\n [attr.aria-label]=\"commonStrings.keys.comboboxOpen\"\n >\n <cds-icon shape=\"angle\" direction=\"down\"></cds-icon>\n </button>\n\n <div class=\"clr-focus-indicator\" [class.clr-focus]=\"focused\"></div>\n</div>\n\n<!-- Both close handlers are handled manually.\n'outsideClickToClose' has complex handling that's necessary\nto be manual due to the component architecture -->\n<div role=\"dialog\" *clrPopoverContent=\"openState; at popoverPosition; type: popoverType;\">\n <ng-content></ng-content>\n</div>\n", dependencies: [{ kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i8.ClrIcon, selector: "clr-icon, cds-icon", inputs: ["shape", "size", "direction", "flip", "solid", "status", "inverse", "badge"] }, { kind: "component", type: i3$1.ClrRovingTabindex, selector: "[clrRovingTabindex]", inputs: ["clrRovingTabindex", "clrRovingTabindexDisabled"] }, { kind: "directive", type: i3$1.ClrKeyFocusItem, selector: "[clrKeyFocusItem]" }, { kind: "directive", type: i4.ClrPopoverOrigin, selector: "[clrPopoverOrigin]" }, { kind: "directive", type: i4.ClrPopoverContent, selector: "[clrPopoverContent]", inputs: ["clrPopoverContent", "clrPopoverContentAt", "clrPopoverContentAvailablePositions", "clrPopoverContentType", "clrPopoverContentOutsideClickToClose", "clrPopoverContentScrollToClose", "clrPopoverContentOrigin"] }] }); }
|
|
1151
1181
|
}
|
|
1152
1182
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrCombobox, decorators: [{
|
|
1153
1183
|
type: Component,
|
|
@@ -1161,12 +1191,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1161
1191
|
'[class.aria-required]': 'true',
|
|
1162
1192
|
'[class.clr-combobox]': 'true',
|
|
1163
1193
|
'[class.clr-combobox-disabled]': 'control?.disabled',
|
|
1164
|
-
}, standalone: false, template: "<!--\n ~ Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n ~ The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n\n<!-- The (click) handler is needed to auto-focus on input field which can not currently occupy the whole\nwidth of the component, after being wrapped to a new line -->\n<div\n class=\"clr-combobox-wrapper\"\n
|
|
1194
|
+
}, standalone: false, template: "<!--\n ~ Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n ~ The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n\n<!-- The (click) handler is needed to auto-focus on input field which can not currently occupy the whole\nwidth of the component, after being wrapped to a new line -->\n<div\n class=\"clr-combobox-wrapper\"\n clrPopoverOrigin\n (click)=\"onWrapperClick($event)\"\n [class.multi]=\"multiSelect\"\n [class.invalid]=\"(control?.control.touched && control?.invalid)\"\n [class.disabled]=\"control?.disabled\"\n>\n @if (multiSelect && optionSelectionService.selectionModel.model && multiSelectModel.length > 0) {\n <span\n role=\"grid\"\n clrRovingTabindex\n [clrRovingTabindexDisabled]=\"control?.disabled\"\n clrDirection=\"both\"\n [attr.aria-label]=\"getSelectionAriaLabel()\"\n [attr.aria-disabled]=\"control?.disabled? true: null\"\n class=\"clr-combobox-pills\"\n >\n @for (item of multiSelectModel; track item; let i = $index) {\n <span class=\"label label-combobox-pill\" role=\"row\">\n <span role=\"gridcell\">\n <span class=\"clr-combobox-pill-content\" clrKeyFocusItem>\n @if (optionSelected) {\n <ng-container\n [ngTemplateOutlet]=\"optionSelected.template\"\n [ngTemplateOutletContext]=\"{$implicit: optionSelectionService.selectionModel.model[i]}\"\n ></ng-container>\n }\n </span>\n </span>\n <span role=\"gridcell\">\n <button\n clrKeyFocusItem\n type=\"button\"\n class=\"clr-combobox-remove-btn\"\n [disabled]=\"control?.disabled? true: null\"\n [attr.aria-label]=\"commonStrings.keys.comboboxDelete + ' ' + optionSelectionService.selectionModel.toString(displayField, i)\"\n (click)=\"unselect(item)\"\n >\n <cds-icon shape=\"window-close\" size=\"12\"></cds-icon>\n </button>\n </span>\n </span>\n }\n </span>\n }\n\n <input\n #textboxInput\n type=\"text\"\n role=\"combobox\"\n [id]=\"inputId()\"\n class=\"clr-input clr-combobox-input\"\n [(ngModel)]=\"searchText\"\n (blur)=\"onBlur($event)\"\n (focus)=\"onFocus()\"\n (change)=\"onChange()\"\n [attr.aria-expanded]=\"openState\"\n [attr.aria-owns]=\"ariaOwns\"\n aria-haspopup=\"listbox\"\n aria-autocomplete=\"list\"\n autocomplete=\"off\"\n [attr.aria-invalid]=\"control?.invalid? true: null\"\n [disabled]=\"control?.disabled? true: null\"\n [attr.aria-activedescendant]=\"getActiveDescendant()\"\n [attr.placeholder]=\"placeholder\"\n />\n\n <!-- No click handler, as it uses the handler on the .clr-combobox-wrapper -->\n <button\n #trigger\n type=\"button\"\n class=\"clr-combobox-trigger\"\n tabindex=\"-1\"\n [disabled]=\"control?.disabled || null\"\n [attr.aria-label]=\"commonStrings.keys.comboboxOpen\"\n >\n <cds-icon shape=\"angle\" direction=\"down\"></cds-icon>\n </button>\n\n <div class=\"clr-focus-indicator\" [class.clr-focus]=\"focused\"></div>\n</div>\n\n<!-- Both close handlers are handled manually.\n'outsideClickToClose' has complex handling that's necessary\nto be manual due to the component architecture -->\n<div role=\"dialog\" *clrPopoverContent=\"openState; at popoverPosition; type: popoverType;\">\n <ng-content></ng-content>\n</div>\n" }]
|
|
1165
1195
|
}], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i0.Injector }, { type: i1$1.NgControl, decorators: [{
|
|
1166
1196
|
type: Self
|
|
1167
1197
|
}, {
|
|
1168
1198
|
type: Optional
|
|
1169
|
-
}] }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: OptionSelectionService }, { type: i3$1.ClrCommonStringsService }, { type: i4
|
|
1199
|
+
}] }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: OptionSelectionService }, { type: i3$1.ClrCommonStringsService }, { type: i4.ClrPopoverService }, { type: ComboboxContainerService, decorators: [{
|
|
1170
1200
|
type: Optional
|
|
1171
1201
|
}] }, { type: undefined, decorators: [{
|
|
1172
1202
|
type: Inject,
|
|
@@ -1198,6 +1228,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1198
1228
|
}], editable: [{
|
|
1199
1229
|
type: Input,
|
|
1200
1230
|
args: ['clrEditable']
|
|
1231
|
+
}], identityFn: [{
|
|
1232
|
+
type: Input,
|
|
1233
|
+
args: ['clrComboboxIdentityFn']
|
|
1201
1234
|
}], multiSelect: [{
|
|
1202
1235
|
type: Input,
|
|
1203
1236
|
args: ['clrMulti']
|
|
@@ -1359,7 +1392,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1359
1392
|
*/
|
|
1360
1393
|
class ClrComboboxModule {
|
|
1361
1394
|
constructor() {
|
|
1362
|
-
ClarityIcons.addIcons(
|
|
1395
|
+
ClarityIcons.addIcons(successStandardIcon, errorStandardIcon, angleIcon, windowCloseIcon);
|
|
1363
1396
|
}
|
|
1364
1397
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrComboboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1365
1398
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.3", ngImport: i0, type: ClrComboboxModule, declarations: [ClrCombobox,
|