@clr/angular
Version:
Angular components for Clarity
1 lines • 75.8 kB
Source Map (JSON)
{"version":3,"file":"clr-angular-forms-common.mjs","sources":["../../../projects/angular/forms/common/providers/control-id.service.ts","../../../projects/angular/forms/common/providers/container-id.service.ts","../../../projects/angular/forms/common/abstract-control.ts","../../../projects/angular/forms/common/control-subtexts/error.ts","../../../projects/angular/forms/common/control-subtexts/helper.ts","../../../projects/angular/forms/common/control-subtexts/success.ts","../../../projects/angular/forms/common/if-control-state/control-state.enum.ts","../../../projects/angular/forms/common/providers/layout.service.ts","../../../projects/angular/forms/common/providers/ng-control.service.ts","../../../projects/angular/forms/common/label.ts","../../../projects/angular/forms/common/providers/control-class.service.ts","../../../projects/angular/forms/common/abstract-container.ts","../../../projects/angular/forms/common/control-container.ts","../../../projects/angular/forms/common/providers/mark-control.service.ts","../../../projects/angular/forms/common/wrapped-control.ts","../../../projects/angular/forms/common/control.ts","../../../projects/angular/forms/common/form.ts","../../../projects/angular/forms/common/if-control-state/abstract-if-state.ts","../../../projects/angular/forms/common/if-control-state/if-error.ts","../../../projects/angular/forms/common/if-control-state/if-success.ts","../../../projects/angular/forms/common/layout.ts","../../../projects/angular/forms/common/common.module.ts","../../../projects/angular/forms/common/providers/focus.service.ts","../../../projects/angular/forms/common/index.ts","../../../projects/angular/forms/common/clr-angular-forms-common.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 { Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\n\nlet counter = 0;\n\n@Injectable()\nexport class ControlIdService {\n private _id = 'clr-form-control-' + ++counter;\n private _idChange = new BehaviorSubject(this._id);\n\n get id(): string {\n return this._id;\n }\n set id(value: string) {\n this._id = value;\n this._idChange.next(value);\n }\n\n get idChange(): Observable<string> {\n return this._idChange.asObservable();\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 { Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\n\nlet counter = 0;\n\n/**\n * @TODO No idea why I need to use provideIn .. without I'm getting error that\n * ContainerIdService is not defined - But this must be optional service!?\n *\n * There is something wrong - will come back to investigate it when I have more time\n *\n */\n@Injectable()\nexport class ContainerIdService {\n private _id = `clr-form-container-${++counter}`;\n private _idChange = new BehaviorSubject(this._id);\n\n get id(): string {\n return this._id;\n }\n set id(value: string) {\n this._id = value;\n this._idChange.next(value);\n }\n\n get idChange(): Observable<string> {\n return this._idChange.asObservable();\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 { Directive, Optional } from '@angular/core';\n\nimport { ContainerIdService } from './providers/container-id.service';\nimport { ControlIdService } from './providers/control-id.service';\n\nexport const CONTROL_SUFFIX: { [key: string]: string | null } = {\n HELPER: 'helper',\n ERROR: 'error',\n SUCCESS: 'success',\n NONE: null,\n};\n\n@Directive()\nexport abstract class ClrAbstractControl {\n /**\n * Hold the suffix for the ID\n */\n controlIdSuffix = 'abstract';\n\n protected constructor(\n @Optional() protected controlIdService: ControlIdService,\n @Optional() protected containerIdService: ContainerIdService\n ) {}\n\n get id(): string {\n /**\n * The order of witch the id will be pick is:\n * - Container ID (Wrapper arround multiple Controls like, Checkbox, Radio, ...)\n * - Control ID (Single Control wrapper like Input, Textarea, Password, ...)\n * - None\n */\n if (this.containerIdService) {\n return `${this.containerIdService.id}-${this.controlIdSuffix}`;\n }\n\n if (this.controlIdService) {\n return `${this.controlIdService.id}-${this.controlIdSuffix}`;\n }\n\n return 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 { Component, Optional } from '@angular/core';\n\nimport { ClrAbstractControl, CONTROL_SUFFIX } from '../abstract-control';\nimport { ContainerIdService } from '../providers/container-id.service';\nimport { ControlIdService } from '../providers/control-id.service';\n\n@Component({\n selector: 'clr-control-error',\n template: `\n <cds-icon class=\"clr-validate-icon\" shape=\"error-standard\" status=\"danger\" aria-hidden=\"true\"></cds-icon>\n <span class=\"clr-subtext\">\n <ng-content></ng-content>\n </span>\n `,\n host: {\n '[class.clr-subtext-wrapper]': 'true',\n '[class.error]': 'true',\n '[attr.id]': 'id',\n },\n standalone: false,\n})\nexport class ClrControlError extends ClrAbstractControl {\n override controlIdSuffix = CONTROL_SUFFIX.ERROR;\n\n constructor(\n @Optional() protected override controlIdService: ControlIdService,\n @Optional() protected override containerIdService: ContainerIdService\n ) {\n super(controlIdService, containerIdService);\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 { Component, Optional } from '@angular/core';\n\nimport { ClrAbstractControl, CONTROL_SUFFIX } from '../abstract-control';\nimport { ContainerIdService } from '../providers/container-id.service';\nimport { ControlIdService } from '../providers/control-id.service';\n\n@Component({\n selector: 'clr-control-helper',\n template: `<ng-content></ng-content>`,\n host: {\n '[class.clr-subtext]': 'true',\n '[attr.id]': 'id',\n },\n standalone: false,\n})\nexport class ClrControlHelper extends ClrAbstractControl {\n override controlIdSuffix = CONTROL_SUFFIX.HELPER;\n\n constructor(\n @Optional() protected override controlIdService: ControlIdService,\n @Optional() protected override containerIdService: ContainerIdService\n ) {\n super(controlIdService, containerIdService);\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 { Component, Optional } from '@angular/core';\n\nimport { ClrAbstractControl, CONTROL_SUFFIX } from '../abstract-control';\nimport { ContainerIdService } from '../providers/container-id.service';\nimport { ControlIdService } from '../providers/control-id.service';\n\n@Component({\n selector: 'clr-control-success',\n template: `\n <cds-icon class=\"clr-validate-icon\" shape=\"success-standard\" status=\"success\" aria-hidden=\"true\"></cds-icon>\n <span class=\"clr-subtext\">\n <ng-content></ng-content>\n </span>\n `,\n host: {\n '[class.clr-subtext-wrapper]': 'true',\n '[class.success]': 'true',\n '[attr.id]': 'id',\n },\n standalone: false,\n})\nexport class ClrControlSuccess extends ClrAbstractControl {\n override controlIdSuffix = CONTROL_SUFFIX.SUCCESS;\n\n constructor(\n @Optional() protected override controlIdService: ControlIdService,\n @Optional() protected override containerIdService: ContainerIdService\n ) {\n super(controlIdService, containerIdService);\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 enum CONTROL_STATE {\n VALID = 'VALID',\n INVALID = 'INVALID',\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 { Injectable } from '@angular/core';\n\nexport enum ClrFormLayout {\n VERTICAL = 'vertical',\n HORIZONTAL = 'horizontal',\n COMPACT = 'compact',\n}\n\n@Injectable()\nexport class LayoutService {\n readonly minLabelSize = 1;\n readonly maxLabelSize = 12;\n\n layout: ClrFormLayout | string = ClrFormLayout.HORIZONTAL;\n\n private layoutValues: string[] = Object.values(ClrFormLayout);\n private _labelSize = 2;\n\n get labelSize(): number {\n return this._labelSize;\n }\n set labelSize(size: number) {\n if (this.labelSizeIsValid(size)) {\n this._labelSize = size;\n }\n }\n\n get layoutClass(): string {\n return `clr-form-${this.layout}`;\n }\n\n isVertical(): boolean {\n return this.layout === ClrFormLayout.VERTICAL;\n }\n\n isHorizontal(): boolean {\n return this.layout === ClrFormLayout.HORIZONTAL;\n }\n\n isCompact(): boolean {\n return this.layout === ClrFormLayout.COMPACT;\n }\n\n isValid(layout: string): boolean {\n return this.layoutValues.indexOf(layout) > -1;\n }\n\n labelSizeIsValid(labelSize: number): boolean {\n return Number.isInteger(labelSize) && labelSize >= this.minLabelSize && labelSize <= this.maxLabelSize;\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 { Injectable } from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { Observable, Subject } from 'rxjs';\n\nimport { ClrAbstractContainer } from '../abstract-container';\n\nexport interface Helpers {\n show?: boolean;\n showInvalid?: boolean;\n showValid?: boolean;\n showHelper?: boolean;\n}\n\n@Injectable()\nexport class NgControlService {\n container: ClrAbstractContainer;\n private _controls: NgControl[] = [];\n\n // Observable to subscribe to the control, since its not available immediately for projected content\n private _controlsChanges = new Subject<NgControl[]>();\n\n get controls() {\n return this._controls;\n }\n\n get controlsChanges(): Observable<NgControl[]> {\n return this._controlsChanges.asObservable();\n }\n\n get hasMultipleControls() {\n return this._controls?.length > 1;\n }\n\n addControl(control: NgControl) {\n this._controls.push(control);\n\n this.emitControlsChange(this._controls);\n }\n\n emitControlsChange(controls: NgControl[]) {\n this._controlsChanges.next(controls);\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 {\n ContentChild,\n Directive,\n ElementRef,\n HostBinding,\n HostListener,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n Renderer2,\n} from '@angular/core';\nimport { ClrSignpost } from '@clr/angular/popover/signpost';\nimport { Subscription } from 'rxjs';\n\nimport { ControlIdService } from './providers/control-id.service';\nimport { LayoutService } from './providers/layout.service';\nimport { NgControlService } from './providers/ng-control.service';\n\n@Directive({\n selector: 'label',\n standalone: false,\n})\nexport class ClrControlLabel implements OnInit, OnDestroy {\n @Input('id') idInput: string;\n @HostBinding('attr.id') idAttr: string;\n\n @Input('for') @HostBinding('attr.for') forAttr: string;\n\n @ContentChild(ClrSignpost, { read: ElementRef }) private signpost: ElementRef;\n private enableGrid = true;\n private subscriptions: Subscription[] = [];\n\n constructor(\n @Optional() private controlIdService: ControlIdService,\n @Optional() private layoutService: LayoutService,\n @Optional() private ngControlService: NgControlService,\n private renderer: Renderer2,\n private el: ElementRef<HTMLLabelElement>\n ) {}\n\n get labelText(): string {\n return this.el.nativeElement && this.el.nativeElement.textContent;\n }\n\n ngOnInit() {\n // Prevent id attributes from being removed by the `undefined` host binding.\n // This happens when a `label` is used outside of a control container and other use cases.\n this.idAttr = this.idInput;\n\n // Only add the clr-control-label if it is inside a control container\n if (this.controlIdService || this.ngControlService) {\n this.renderer.addClass(this.el.nativeElement, 'clr-control-label');\n }\n // Only set the grid column classes if we are in the right context and if they aren't already set\n if (\n this.enableGrid &&\n this.layoutService &&\n !this.layoutService.isVertical() &&\n this.el.nativeElement &&\n this.el.nativeElement.className.indexOf('clr-col') < 0\n ) {\n this.renderer.addClass(this.el.nativeElement, 'clr-col-12');\n this.renderer.addClass(this.el.nativeElement, `clr-col-md-${this.layoutService.labelSize}`);\n }\n if (this.controlIdService && !this.forAttr) {\n this.subscriptions.push(\n this.controlIdService.idChange.subscribe(id => {\n this.forAttr = id;\n this.idAttr = this.idInput || `${id}-label`;\n })\n );\n }\n }\n\n ngOnDestroy() {\n this.subscriptions.forEach(sub => sub.unsubscribe());\n }\n\n disableGrid() {\n this.enableGrid = false;\n }\n\n /**\n * Allowing signposts inside labels to work without disabling default behavior. <label> is spreading a click event to its children so signposts get\n * automatically closed once clicked inside a <label>.\n * @param event\n */\n @HostListener('click', ['$event'])\n private onClick(event) {\n this.preventDefaultOnSignpostTarget(event);\n }\n\n private preventDefaultOnSignpostTarget(event) {\n if (this.signpost && this.signpost.nativeElement && this.signpost.nativeElement.contains(event.target)) {\n event.preventDefault();\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 { Injectable, Optional, Renderer2 } from '@angular/core';\n\nimport { LayoutService } from './layout.service';\nimport { CONTROL_STATE } from '../if-control-state/control-state.enum';\n\nconst CLASS_ERROR = 'clr-error';\nconst CLASS_SUCCESS = 'clr-success';\n\n@Injectable()\nexport class ControlClassService {\n className = '';\n\n constructor(@Optional() private layoutService: LayoutService) {}\n\n controlClass(state: string, grid = false, additional = '') {\n const controlClasses = [this.className, additional];\n\n switch (state) {\n case CONTROL_STATE.VALID:\n controlClasses.push(CLASS_SUCCESS);\n break;\n case CONTROL_STATE.INVALID:\n controlClasses.push(CLASS_ERROR);\n break;\n }\n\n if (grid && this.layoutService && this.className.indexOf('clr-col') === -1) {\n controlClasses.push(`clr-col-md-${this.layoutService.maxLabelSize - this.layoutService.labelSize} clr-col-12`);\n }\n return controlClasses.join(' ').trim();\n }\n\n // We want to remove the column classes from the input up to the container\n initControlClass(renderer: Renderer2, element: HTMLElement) {\n if (element && element.className) {\n const klasses = element.className.split(' ');\n const controlKlasses = [];\n\n klasses.forEach(klass => {\n if (klass.startsWith('clr-')) {\n controlKlasses.push(klass);\n }\n\n if (klass.startsWith('clr-col')) {\n renderer.removeClass(element, klass);\n }\n });\n\n this.className = controlKlasses.join(' ').trim();\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 { ContentChild, Directive, OnDestroy, Optional } from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { Subscription } from 'rxjs';\n\nimport { ClrControlError } from './control-subtexts/error';\nimport { ClrControlHelper } from './control-subtexts/helper';\nimport { ClrControlSuccess } from './control-subtexts/success';\nimport { CONTROL_STATE } from './if-control-state/control-state.enum';\nimport { ClrControlLabel } from './label';\nimport { ControlClassService } from './providers/control-class.service';\nimport { LayoutService } from './providers/layout.service';\nimport { NgControlService } from './providers/ng-control.service';\n\n@Directive()\nexport abstract class ClrAbstractContainer implements OnDestroy {\n @ContentChild(ClrControlLabel, { static: false }) label: ClrControlLabel;\n @ContentChild(ClrControlSuccess) controlSuccessComponent: ClrControlSuccess;\n @ContentChild(ClrControlError) controlErrorComponent: ClrControlError;\n @ContentChild(ClrControlHelper) controlHelperComponent: ClrControlHelper;\n\n controls: NgControl[] = [];\n\n protected subscriptions: Subscription[] = [];\n\n constructor(\n @Optional() protected layoutService: LayoutService,\n protected controlClassService: ControlClassService,\n protected ngControlService: NgControlService\n ) {\n this.subscriptions.push(\n ngControlService.controlsChanges.subscribe(controls => {\n this.controls = controls;\n })\n );\n\n ngControlService.container = this;\n }\n\n get control() {\n return this.controls[0];\n }\n\n /**\n * @NOTE\n * Helper control is a bit different than the others, it must be always visible:\n * - Labels and instructions must always accompany forms and are persistent.\n * - The recommendation here is to always have helper text or anything instructions visible.\n * - The expectation is to have error text + helper text in the errored state. this way all users will have the helper text information always available.\n */\n get showHelper(): boolean {\n /**\n * @NOTE\n * Saving the previous version in case something is changed. We'll return always true so we can be flexible\n * and keep the condition per components.\n *\n * return (\n * Helper Component exist and the state of the form is NONE (not touched)\n * (!!this.controlHelperComponent && (!this.touched || this.state === CONTROL_STATE.NONE)) ||\n * or there is no success component but the state of the form is VALID - show helper information\n * (!!this.controlSuccessComponent === false && this.state === CONTROL_STATE.VALID) ||\n * or there is no error component but the state of the form is INVALID - show helper information\n * (!!this.controlErrorComponent === false && this.state === CONTROL_STATE.INVALID)\n * );\n */\n return Boolean(this.controlHelperComponent);\n }\n\n /**\n * We gonna set the helper control state, after all or most of the components\n * are ready - also this will trigger some initial flows into wrappers and controls,\n * like locating IDs and setting attributes.\n */\n get helpers() {\n return {\n show: this.showInvalid || this.showHelper || this.showValid,\n showInvalid: this.showInvalid,\n showHelper: this.showHelper,\n showValid: this.showValid,\n };\n }\n\n get showValid(): boolean {\n return this.touched && this.state === CONTROL_STATE.VALID && this.successMessagePresent;\n }\n\n get showInvalid(): boolean {\n return this.touched && this.state === CONTROL_STATE.INVALID && this.errorMessagePresent;\n }\n\n protected get successMessagePresent() {\n return !!this.controlSuccessComponent;\n }\n\n protected get errorMessagePresent() {\n return !!this.controlErrorComponent;\n }\n\n private get touched() {\n return !!this.controls?.some(control => control.touched);\n }\n\n private get state() {\n const controlStatuses = this.controls.map((control: NgControl) => {\n return control.status;\n });\n\n // These status values are mutually exclusive, so a control\n // cannot be both valid AND invalid or invalid AND disabled.\n // if else order is important!\n if (controlStatuses.includes(CONTROL_STATE.INVALID)) {\n return CONTROL_STATE.INVALID;\n } else if (controlStatuses.includes(CONTROL_STATE.VALID)) {\n return CONTROL_STATE.VALID;\n } else {\n return null;\n }\n }\n\n ngOnDestroy() {\n this.subscriptions.forEach(subscription => subscription.unsubscribe());\n }\n\n controlClass() {\n /**\n * Decide what subtext to display:\n * - container is valid but no success component is implemented - use helper class\n * - container is valid and success component is implemented - use success class\n * - Pass form control state and return string of classes to be applied to the container.\n */\n const currentState = this.touched ? this.state : null;\n\n return this.controlClassService.controlClass(currentState, this.addGrid());\n }\n\n addGrid() {\n return this.layoutService && !this.layoutService.isVertical();\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 { Component } from '@angular/core';\n\nimport { ClrAbstractContainer } from './abstract-container';\nimport { ControlClassService } from './providers/control-class.service';\nimport { ControlIdService } from './providers/control-id.service';\nimport { NgControlService } from './providers/ng-control.service';\n\n@Component({\n selector: 'clr-control-container',\n template: `\n <ng-content select=\"label\"></ng-content>\n @if (!label && addGrid()) {\n <label></label>\n }\n <div class=\"clr-control-container\" [ngClass]=\"controlClass()\">\n <div class=\"clr-input-wrapper\">\n <ng-content></ng-content>\n </div>\n @if (showHelper) {\n <ng-content select=\"clr-control-helper\"></ng-content>\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]': 'control?.disabled',\n '[class.clr-row]': 'addGrid()',\n },\n providers: [NgControlService, ControlIdService, ControlClassService],\n standalone: false,\n})\nexport class ClrControlContainer extends ClrAbstractContainer {}\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 { Injectable } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\n\n@Injectable()\nexport class MarkControlService {\n private _touched = new Subject<void>();\n\n get touchedChange(): Observable<void> {\n return this._touched.asObservable();\n }\n\n markAsTouched() {\n this._touched.next();\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 {\n Directive,\n DoCheck,\n ElementRef,\n HostBinding,\n HostListener,\n InjectionToken,\n Injector,\n Input,\n KeyValueDiffer,\n KeyValueDiffers,\n OnDestroy,\n OnInit,\n Renderer2,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { HostWrapper } from '@clr/angular/utils';\nimport { Subscription } from 'rxjs';\n\nimport { CONTROL_SUFFIX } from './abstract-control';\nimport { ContainerIdService } from './providers/container-id.service';\nimport { ControlClassService } from './providers/control-class.service';\nimport { ControlIdService } from './providers/control-id.service';\nimport { MarkControlService } from './providers/mark-control.service';\nimport { NgControlService } from './providers/ng-control.service';\n\nexport enum CHANGE_KEYS {\n FORM = 'form',\n MODEL = 'model',\n}\n\n@Directive()\nexport class WrappedFormControl<W> implements OnInit, DoCheck, OnDestroy {\n _id: string;\n\n protected controlIdService: ControlIdService;\n protected ngControlService: NgControlService;\n protected index = 0;\n protected subscriptions: Subscription[] = [];\n\n private controlClassService: ControlClassService;\n private markControlService: MarkControlService;\n private containerIdService: ContainerIdService;\n private _containerInjector: Injector;\n private differs: KeyValueDiffers;\n private differ: KeyValueDiffer<any, any>;\n\n // I lost way too much time trying to make this work without injecting the ViewContainerRef and the Injector,\n // I'm giving up. So we have to inject these two manually for now.\n constructor(\n protected vcr: ViewContainerRef,\n protected wrapperType: Type<W>,\n injector: Injector,\n private ngControl: NgControl | null,\n protected renderer: Renderer2,\n protected el: ElementRef<HTMLElement>\n ) {\n if (injector) {\n this.ngControlService = injector.get(NgControlService, null);\n this.markControlService = injector.get(MarkControlService, null);\n this.differs = injector.get(KeyValueDiffers, null);\n }\n\n if (this.markControlService) {\n this.subscriptions.push(\n this.markControlService.touchedChange.subscribe(() => {\n this.markAsTouched();\n })\n );\n }\n }\n\n @Input()\n @HostBinding()\n get id() {\n return this._id;\n }\n set id(value: string) {\n this._id = value;\n if (this.controlIdService) {\n this.controlIdService.id = value;\n }\n }\n\n @HostBinding('attr.aria-describedby')\n private get ariaDescribedById(): string | null {\n const helpers = this.ngControlService?.container?.helpers;\n\n if (!helpers?.show) {\n return null;\n }\n\n const elementId = this.containerIdService?.id || this.controlIdService?.id;\n /**\n * If ContainerIdService or ControlIdService are missing don't try to guess\n * Don't set anything.\n */\n if (!elementId) {\n return null;\n }\n\n /**\n * As the helper text is now always visible. If we have error/success then we should use both ids.\n */\n const describedByIds = [`${elementId}-${CONTROL_SUFFIX.HELPER}`];\n if (helpers.showInvalid) {\n describedByIds.push(`${elementId}-${CONTROL_SUFFIX.ERROR}`);\n } else if (helpers.showValid) {\n describedByIds.push(`${elementId}-${CONTROL_SUFFIX.SUCCESS}`);\n }\n\n return describedByIds.join(' ');\n }\n\n ngOnInit() {\n this._containerInjector = new HostWrapper(this.wrapperType, this.vcr, this.index);\n this.controlIdService = this._containerInjector.get(ControlIdService);\n\n this.injectControlClassService(this._containerInjector);\n\n /**\n * not all containers will provide `ContainerIdService`\n */\n this.containerIdService = this._containerInjector.get(ContainerIdService, null);\n\n if (this._id) {\n this.controlIdService.id = this._id;\n } else {\n this._id = this.controlIdService.id;\n }\n\n // 4 possible variations\n // 1. NO ngControlService and NO ngControl\n // 2. NO ngControlService and YES ngControl\n // 3. YES ngControlService and NO ngControl\n // 4. YES ngControlService and YES ngControl\n\n if (this.ngControl) {\n this.differ = this.differs.find(this.ngControl).create();\n }\n\n if (this.ngControlService && this.ngControl) {\n this.ngControlService.addControl(this.ngControl);\n }\n }\n\n ngDoCheck() {\n if (this.ngControl) {\n this.triggerDoCheck(this.differ, this.ngControl);\n }\n }\n\n ngOnDestroy() {\n this.subscriptions.forEach(sub => sub?.unsubscribe());\n }\n\n // blur HostListener decorator MUST be 1 and on the parent.\n // overrides MUST NOT have HostListener decorator.\n @HostListener('blur')\n triggerValidation() {\n if (this.ngControl?.control?.markAsTouched) {\n this.ngControl.control.markAsTouched();\n }\n }\n\n // @TODO This method has a try/catch due to an unknown issue that came when building the clrToggle feature\n // We need to figure out why this fails for the ClrToggle scenario but works for Date picker...\n // To see the error, remove the try/catch here and run the ClrToggle suite to see issues getting the container\n // injector in time, and this ONLY HAPPENS in tests and not in dev/prod mode.\n protected getProviderFromContainer<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T): T {\n try {\n return this._containerInjector.get(token, notFoundValue);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (e) {\n return notFoundValue;\n }\n }\n\n private injectControlClassService(injector: Injector) {\n if (!this.controlClassService) {\n this.controlClassService = injector.get(ControlClassService, null);\n if (this.controlClassService) {\n this.controlClassService.initControlClass(this.renderer, this.el.nativeElement);\n }\n }\n }\n\n private triggerDoCheck(differ: KeyValueDiffer<any, any>, ngControl: NgControl) {\n if (differ) {\n const changes = differ.diff(ngControl);\n if (changes) {\n changes.forEachChangedItem(change => {\n if (\n (change.key === CHANGE_KEYS.FORM || change.key === CHANGE_KEYS.MODEL) &&\n change.currentValue !== change.previousValue\n ) {\n if (this.ngControlService) {\n this.ngControlService.emitControlsChange(this.ngControlService.controls);\n }\n\n this.triggerValidation();\n }\n });\n }\n }\n }\n\n private markAsTouched(): void {\n if (this.ngControlService && this.ngControlService.hasMultipleControls) {\n this.ngControlService.controls.forEach((ngControl: NgControl) => {\n ngControl.control.markAsTouched();\n ngControl.control.updateValueAndValidity();\n });\n\n return;\n }\n\n if (this.ngControl) {\n this.ngControl.control.markAsTouched();\n this.ngControl.control.updateValueAndValidity();\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 { Directive, ElementRef, Injector, Optional, Renderer2, Self, ViewContainerRef } from '@angular/core';\nimport { NgControl } from '@angular/forms';\n\nimport { ClrControlContainer } from './control-container';\nimport { WrappedFormControl } from './wrapped-control';\n\n@Directive({\n selector: '[clrControl]',\n host: { '[class.clr-input]': 'true' },\n standalone: false,\n})\nexport class ClrControl extends WrappedFormControl<ClrControlContainer> {\n protected override index = 1;\n\n constructor(\n vcr: ViewContainerRef,\n injector: Injector,\n @Self()\n @Optional()\n control: NgControl,\n renderer: Renderer2,\n el: ElementRef<HTMLElement>\n ) {\n super(vcr, ClrControlContainer, injector, control, renderer, el);\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 { ContentChildren, Directive, HostListener, Input, QueryList } from '@angular/core';\n\nimport { ClrControlLabel } from './label';\nimport { LayoutService } from './providers/layout.service';\nimport { MarkControlService } from './providers/mark-control.service';\n\n@Directive({\n selector: '[clrForm]',\n providers: [LayoutService, MarkControlService],\n host: {\n '[class.clr-form]': 'true',\n '[class.clr-form-horizontal]': 'layoutService.isHorizontal()',\n '[class.clr-form-compact]': 'layoutService.isCompact()',\n },\n standalone: false,\n})\nexport class ClrForm {\n @ContentChildren(ClrControlLabel, { descendants: true }) labels: QueryList<ClrControlLabel>;\n\n constructor(\n public layoutService: LayoutService,\n private markControlService: MarkControlService\n ) {}\n\n @Input('clrLabelSize')\n set labelSize(size: number | string) {\n const sizeNumber = parseInt(size as string, 10) || 2;\n this.layoutService.labelSize = sizeNumber;\n }\n\n @HostListener('submit')\n onFormSubmit() {\n this.markAsTouched();\n }\n\n // Trying to avoid adding an input and keep this backwards compatible at the same time\n markAsTouched() {\n this.markControlService.markAsTouched();\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 { Directive, Optional } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NgControl } from '@angular/forms';\nimport { merge, of, tap } from 'rxjs';\nimport { startWith, switchMap } from 'rxjs/operators';\n\nimport { NgControlService } from '../providers/ng-control.service';\n\n@Directive()\nexport abstract class AbstractIfState {\n protected displayedContent = false;\n protected controls: NgControl[];\n\n protected constructor(@Optional() protected ngControlService: NgControlService) {\n if (ngControlService) {\n ngControlService.controlsChanges\n .pipe(\n tap(controls => {\n this.controls = controls;\n }),\n switchMap(controls => {\n if (!controls || controls.length === 0) {\n return [];\n }\n\n const statusStreams = controls.map(c => this.getControlStatusChangesObservable(c));\n\n return merge(...statusStreams);\n }),\n takeUntilDestroyed()\n )\n .subscribe(status => {\n this.handleState(status);\n });\n }\n }\n\n protected handleState(_state: any): void {\n /* overwrite in implementation to handle status change */\n }\n\n private getControlStatusChangesObservable(control: NgControl) {\n if (!control.statusChanges) {\n return of(null);\n }\n\n return control.statusChanges.pipe(startWith(control.status));\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 { Directive, EmbeddedViewRef, Input, Optional, TemplateRef, ViewContainerRef } from '@angular/core';\n\nimport { AbstractIfState } from './abstract-if-state';\nimport { CONTROL_STATE } from './control-state.enum';\nimport { NgControlService } from '../providers/ng-control.service';\n\n@Directive({\n selector: '[clrIfError]',\n standalone: false,\n})\nexport class ClrIfError extends AbstractIfState {\n @Input('clrIfError') error: string;\n\n private embeddedViewRef: EmbeddedViewRef<any>;\n\n constructor(\n @Optional() ngControlService: NgControlService,\n private template: TemplateRef<any>,\n private container: ViewContainerRef\n ) {\n super(ngControlService);\n\n if (!ngControlService) {\n throw new Error('clrIfError can only be used within a form control container element like clr-input-container');\n }\n }\n /**\n * @param state CONTROL_STATE\n */\n protected override handleState(state: CONTROL_STATE) {\n if (this.error && !!this.controls?.length) {\n const invalidControl = this.controls?.filter(control => control.hasError(this.error))[0];\n this.displayError(!!invalidControl, invalidControl);\n } else {\n this.displayError(CONTROL_STATE.INVALID === state);\n }\n }\n\n private displayError(invalid: boolean, control = this.controls[0]) {\n /* if no container do nothing */\n if (!this.container) {\n return;\n }\n if (invalid) {\n if (this.displayedContent === false) {\n this.embeddedViewRef = this.container.createEmbeddedView(this.template, {\n error: control.getError(this.error),\n });\n this.displayedContent = true;\n } else if (this.embeddedViewRef && this.embeddedViewRef.context) {\n // if view is already rendered, update the error object to keep it in sync\n this.embeddedViewRef.context.error = control.getError(this.error);\n }\n } else {\n this.container.clear();\n this.displayedContent = false;\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 { Directive, Optional, TemplateRef, ViewContainerRef } from '@angular/core';\n\nimport { AbstractIfState } from './abstract-if-state';\nimport { CONTROL_STATE } from './control-state.enum';\nimport { NgControlService } from '../providers/ng-control.service';\n\n@Directive({\n selector: '[clrIfSuccess]',\n standalone: false,\n})\nexport class ClrIfSuccess extends AbstractIfState {\n constructor(\n @Optional() ngControlService: NgControlService,\n private template: TemplateRef<any>,\n private container: ViewContainerRef\n ) {\n super(ngControlService);\n\n if (!ngControlService) {\n throw new Error('ClrIfSuccess can only be used within a form control container element like clr-input-container');\n }\n }\n\n /**\n * @param state CONTROL_STATE\n */\n protected override handleState(state: CONTROL_STATE) {\n const isValid = CONTROL_STATE.VALID === state;\n\n if (isValid && !this.displayedContent) {\n this.container.createEmbeddedView(this.template);\n } else if (!isValid && this.container) {\n this.container.clear();\n }\n this.displayedContent = isValid;\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 { Directive, Input, OnInit } from '@angular/core';\n\nimport { ClrFormLayout, LayoutService } from './providers/layout.service';\n\n@Directive({\n selector: '[clrForm][clrLayout]',\n standalone: false,\n})\nexport class ClrLayout implements OnInit {\n @Input('clrLayout') layout: ClrFormLayout | string;\n\n constructor(public layoutService: LayoutService) {}\n\n ngOnInit() {\n // Only set the layout if it is a valid option\n if (this.layout && this.layoutService.isValid(this.layout)) {\n this.layoutService.layout = this.layout;\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 { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { ClarityIcons, ClrIcon, errorStandardIcon, successStandardIcon } from '@clr/angular/icon';\n\nimport { ClrControl } from './control';\nimport { ClrControlContainer } from './control-container';\nimport { ClrControlError } from './control-subtexts/error';\nimport { ClrControlHelper } from './control-subtexts/helper';\nimport { ClrControlSuccess } from './control-subtexts/success';\nimport { ClrForm } from './form';\nimport { ClrIfError } from './if-control-state/if-error';\nimport { ClrIfSuccess } from './if-control-state/if-success';\nimport { ClrControlLabel } from './label';\nimport { ClrLayout } from './layout';\n\n@NgModule({\n imports: [CommonModule, ClrIcon],\n declarations: [\n ClrControlLabel,\n ClrControlError,\n ClrControlSuccess,\n ClrControlHelper,\n ClrIfError,\n ClrIfSuccess,\n ClrForm,\n ClrLayout,\n ClrControlContainer,\n ClrControl,\n ],\n exports: [\n ClrControlLabel,\n ClrControlError,\n ClrControlSuccess,\n ClrControlHelper,\n ClrIfError,\n ClrIfSuccess,\n ClrForm,\n ClrLayout,\n ClrControlContainer,\n ClrControl,\n ClrIcon,\n ],\n})\nexport class ClrCommonFormsModule {\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\nimport { Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\n\n@Injectable()\nexport class FormsFocusService {\n private _focused = new BehaviorSubject(false);\n get focusChange(): Observable<boolean> {\n return this._focused.asObservable();\n }\n set focused(state: boolean) {\n this._focused.next(state);\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 './abstract-container';\nexport * from './common.module';\nexport * from './control';\nexport * from './control-container';\nexport * from './control-subtexts/helper';\nexport * from './control-subtexts/error';\nexport * from './control-subtexts/success';\nexport * from './form';\nexport * from './if-control-state/if-error';\nexport * from './if-control-state/if-success';\nexport * from './if-control-state/abstract-if-state';\nexport * from './label';\nexport * from './layout';\nexport * from './providers/container-id.service';\nexport * from './providers/control-class.service';\nexport * from './providers/control-id.service';\nexport * from './providers/focus.service';\nexport * from './providers/layout.service';\nexport * from './providers/mark-control.service';\nexport * from './providers/ng-control.service';\nexport * from './wrapped-control';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["counter","i1.ControlIdService","i2.ContainerIdService","i2.LayoutService","i3.NgControlService","i1.LayoutService","i2.ControlClassService","i2.ClrControlLabel","i1","i2.MarkControlService","i1.NgControlService"],"mappings":";;;;;;;;;;;;;AAAA;;;;;AAKG;AAKH,IAAIA,SAAO,GAAG,CAAC;MAGF,gBAAgB,CAAA;AAD7B,IAAA,WAAA,GAAA;AAEU,QAAA,IAAA,CAAA,GAAG,GAAG,mBAAmB,GAAG,EAAEA,SAAO;QACrC,IAAA,CAAA,SAAS,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC;AAalD,IAAA;AAXC,IAAA,IAAI,EAAE,GAAA;QACJ,OAAO,IAAI,CAAC,GAAG;IACjB;IACA,IAAI,EAAE,CAAC,KAAa,EAAA;AAClB,QAAA,IAAI,CAAC,GAAG,GAAG,KAAK;AAChB,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAA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