@agorapulse/ui-components 22.4.13-beta.2 → 22.5.1
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/agorapulse-ui-components-22.5.1.tgz +0 -0
- package/fesm2022/agorapulse-ui-components-directives.mjs +7 -1
- package/fesm2022/agorapulse-ui-components-directives.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-dropdown-base.mjs +1 -2
- package/fesm2022/agorapulse-ui-components-dropdown-base.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-filter-chips-list.mjs +2 -2
- package/fesm2022/agorapulse-ui-components-filter-chips-list.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-filter-dropdown.mjs +2 -2
- package/fesm2022/agorapulse-ui-components-filter-dropdown.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-form-field.mjs +5 -8
- package/fesm2022/agorapulse-ui-components-form-field.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-segmented-control.mjs +2 -2
- package/fesm2022/agorapulse-ui-components-segmented-control.mjs.map +1 -1
- package/package.json +1 -1
- package/types/agorapulse-ui-components-directives.d.ts +7 -1
- package/types/agorapulse-ui-components-form-field.d.ts +2 -5
- package/agorapulse-ui-components-22.4.13-beta.2.tgz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agorapulse-ui-components-form-field.mjs","sources":["../../../libs/ui-components/form-field/src/form-field.component.ts","../../../libs/ui-components/form-field/src/form-field.component.html","../../../libs/ui-components/form-field/src/form-field-control.directive.ts","../../../libs/ui-components/form-field/src/agorapulse-ui-components-form-field.ts"],"sourcesContent":["import {\n afterRenderEffect,\n APP_ID,\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n signal,\n untracked,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { FormFieldControl } from './form-field-control';\n\n@Component({\n selector: 'ap-form-field',\n templateUrl: './form-field.component.html',\n styleUrls: ['./form-field.component.scss'],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n '(click)': 'onClick($event)',\n },\n})\nexport class FormFieldComponent {\n /**\n * Combines the application id — federated Angular apps can share a page — with a per-instance random suffix.\n * Not `crypto.randomUUID()`, which browsers refuse outside a secure context.\n */\n private readonly uid = `${inject(APP_ID)}-form-field-${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;\n\n private readonly content = viewChild.required<ElementRef<HTMLElement>>('content');\n private readonly control = signal<FormFieldControl | undefined>(undefined);\n private readonly descriptions = signal<readonly string[]>([]);\n\n private readonly labelledById = signal<string | undefined>(undefined);\n private readonly labelled = signal(false);\n\n /**\n * The label's id when `aria-labelledby` has to carry the association — never on the native branch, where `for` suffices.\n * Undefined until the first render, and when the field has no label: a control must not emit a dangling reference.\n */\n readonly labelledBy = this.labelledById.asReadonly();\n\n /** Whether a label already names the control, by `for` or by `aria-labelledby`. */\n readonly hasLabel = this.labelled.asReadonly();\n\n /** The ids of everything describing the control, for its `aria-describedby`. */\n readonly describedBy = computed(() => this.descriptions().join(' ') || undefined);\n\n constructor() {\n // After render, so outside change detection: the projected content exists and writing signals\n // here cannot trigger NG0100. Re-runs when the control registers, since it picks the branch.\n afterRenderEffect(() => {\n this.content();\n this.control();\n untracked(() => this.associate());\n });\n }\n\n /**\n * Links the projected label to the registered control.\n *\n * Public because `detectChanges()` does not run after-render hooks in a zone.js harness, so a spec has to force the pass —\n * as does a consumer whose label only appears after the first render.\n */\n associate(): void {\n // `:scope >` and not `querySelector('label')`: `ng-content select=\"label\"` only projects direct\n // children, so a deeper label belongs to something else. Among several, the first names the field.\n const label = this.content().nativeElement.querySelector<HTMLLabelElement>(':scope > label');\n if (!label) {\n this.labelledById.set(undefined);\n this.labelled.set(false);\n return;\n }\n\n // When the control offers a target `for` can reach, the browser supplies the name and the focusing click, so no ARIA is owed;\n // an author's `for` that reaches no control — one aimed at a component host — names nothing, so it is re-aimed.\n const target = this.control()?.labelTarget(`${this.uid}-control`);\n if (target) {\n if (!label.control) {\n label.htmlFor = target;\n }\n this.labelledById.set(undefined);\n this.labelled.set(true);\n return;\n }\n\n this.labelledById.set(this.ensureId(label, 'label'));\n this.labelled.set(true);\n }\n\n registerControl(control: FormFieldControl): void {\n this.control.set(control);\n }\n\n unregisterControl(control: FormFieldControl): void {\n // By identity: a destruction racing a new registration must not clear the live control.\n this.control.update(current => (current === control ? undefined : current));\n }\n\n registerDescription(id: string): void {\n this.descriptions.update(ids => (ids.includes(id) ? ids : [...ids, id]));\n }\n\n unregisterDescription(id: string): void {\n this.descriptions.update(ids => ids.filter(current => current !== id));\n }\n\n /** Only stamps what has no id yet: the author's own may already be referenced elsewhere. */\n private ensureId(element: HTMLElement, suffix: string): string {\n if (!element.id) {\n element.id = `${this.uid}-${suffix}`;\n }\n return element.id;\n }\n\n protected onClick(event: MouseEvent): void {\n const control = this.control();\n if (!control) {\n return;\n }\n\n const label = (event.target as HTMLElement | null)?.closest('label');\n if (!label || label.parentElement !== this.content().nativeElement) {\n return;\n }\n\n // `label.control` is null exactly when the `for` reaches nothing, the case this exists for.\n // `hasAttribute('for')` would instead let an inert `for` through — precisely what is repaired.\n if (label.control) {\n return;\n }\n\n control.focus();\n }\n}\n","<div\n #content\n class=\"ap-form-field\">\n <ng-content select=\"label\"></ng-content>\n <ng-content></ng-content>\n <ng-content select=\"ap-form-message\"></ng-content>\n</div>\n","import { booleanAttribute, computed, DestroyRef, Directive, effect, ElementRef, inject, input, Renderer2, Signal } from '@angular/core';\nimport type { FormFieldControl } from './form-field-control';\nimport { FormFieldComponent } from './form-field.component';\n\n/** The elements a `<label for>` can reach. Everything else has to go through `aria-labelledby`. */\nconst LABELABLE = ['BUTTON', 'INPUT', 'METER', 'OUTPUT', 'PROGRESS', 'SELECT', 'TEXTAREA'];\n\n/** Finds the first focusable descendant, for when the designated element is not focusable itself. */\nconst FOCUSABLE =\n 'button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * Points the surrounding `ap-form-field` at a control's focusable element, and carries the naming that follows.\n *\n * Put it on the element the user actually focuses: the component host when that is it (via `hostDirectives`), otherwise the\n * inner element, in the component's template. With no `ap-form-field` around, it falls back to the `aria-label` it is given.\n */\n@Directive({\n selector: '[apFormFieldControl]',\n})\nexport class FormFieldControlDirective implements FormFieldControl {\n /** Fallback name, for a field with no visible label. */\n readonly ariaLabel = input<string | undefined>(undefined, { alias: 'apFormFieldControl' });\n\n /** A disabled control does not take focus from a click on its label. */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n private readonly element: HTMLElement = inject(ElementRef).nativeElement;\n private readonly renderer = inject(Renderer2);\n private readonly formField = inject(FormFieldComponent, { optional: true });\n private readonly authoredDescribedBy = this.element.getAttribute('aria-describedby');\n\n /** Empty on the native branch, where the label's `for` already carries the association. */\n protected readonly labelledBy = computed(() => this.formField?.labelledBy());\n\n /** The fallback only: an `aria-label` wins over a visible label, so it goes out only when no label names the control. */\n protected readonly label = computed(() => (this.formField?.hasLabel() ? undefined : this.ariaLabel() || undefined));\n\n protected readonly describedBy = computed(\n () => [this.authoredDescribedBy, this.formField?.describedBy()].filter(Boolean).join(' ') || undefined\n );\n\n constructor() {\n this.formField?.registerControl(this);\n inject(DestroyRef).onDestroy(() => this.formField?.unregisterControl(this));\n this.reflect('aria-labelledby', this.labelledBy);\n this.reflect('aria-label', this.label);\n this.reflect('aria-describedby', this.describedBy);\n }\n\n labelTarget(fallbackId: string): string | undefined {\n if (!LABELABLE.includes(this.element.tagName)) {\n return undefined;\n }\n if (!this.element.id) {\n this.element.id = fallbackId;\n }\n return this.element.id;\n }\n\n /**\n * Writes the attribute only while there is a value for it, and gives back what the author wrote after: a host binding would\n * clear an author's own `aria-label`, static or bound, whenever the field has nothing to say.\n */\n private reflect(name: string, value: Signal<string | undefined>): void {\n const authored = this.element.getAttribute(name);\n let written = false;\n effect(() => {\n const next = value();\n if (next !== undefined) {\n this.renderer.setAttribute(this.element, name, next);\n written = true;\n } else if (written) {\n if (authored === null) {\n this.renderer.removeAttribute(this.element, name);\n } else {\n this.renderer.setAttribute(this.element, name, authored);\n }\n written = false;\n }\n });\n }\n\n focus(): void {\n if (this.disabled()) {\n return;\n }\n\n this.element.focus();\n // A named container — `role=\"group\"`, `role=\"listbox\"` — is not always in the tab order; the\n // label should then reach its first focusable element.\n if (document.activeElement !== this.element) {\n this.element.querySelector<HTMLElement>(FOCUSABLE)?.focus();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;MA0Ba,kBAAkB,CAAA;AAC3B;;;AAGG;AACc,IAAA,GAAG,GAAG,CAAA,EAAG,MAAM,CAAC,MAAM,CAAC,CAAA,YAAA,EAAe,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA,EAAG,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE;AAErG,IAAA,OAAO,GAAG,SAAS,CAAC,QAAQ,CAA0B,SAAS,CAAC;IAChE,OAAO,GAAG,MAAM,CAA+B,SAAS;gFAAC;IACzD,YAAY,GAAG,MAAM,CAAoB,EAAE;qFAAC;IAE5C,YAAY,GAAG,MAAM,CAAqB,SAAS;qFAAC;IACpD,QAAQ,GAAG,MAAM,CAAC,KAAK;iFAAC;AAEzC;;;AAGG;AACM,IAAA,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE;;AAG3C,IAAA,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;;AAGrC,IAAA,WAAW,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS;oFAAC;AAEjF,IAAA,WAAA,GAAA;;;QAGI,iBAAiB,CAAC,MAAK;YAC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AAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAzB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAHrC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,sBAAsB;AACnC,iBAAA;;;ACnBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"agorapulse-ui-components-form-field.mjs","sources":["../../../libs/ui-components/form-field/src/form-field.component.ts","../../../libs/ui-components/form-field/src/form-field.component.html","../../../libs/ui-components/form-field/src/form-field-control.directive.ts","../../../libs/ui-components/form-field/src/agorapulse-ui-components-form-field.ts"],"sourcesContent":["import {\n afterRenderEffect,\n APP_ID,\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n signal,\n untracked,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { FormFieldControl } from './form-field-control';\n\nlet nextUniqueId = 0;\n\n@Component({\n selector: 'ap-form-field',\n templateUrl: './form-field.component.html',\n styleUrls: ['./form-field.component.scss'],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n '(click)': 'onClick($event)',\n },\n})\nexport class FormFieldComponent {\n /** Prefixed with the application id, since federated Angular apps can share a page and each counts from zero. */\n private readonly uid = `${inject(APP_ID)}-form-field-${nextUniqueId++}`;\n\n private readonly content = viewChild.required<ElementRef<HTMLElement>>('content');\n private readonly control = signal<FormFieldControl | undefined>(undefined);\n private readonly descriptions = signal<readonly string[]>([]);\n\n private readonly labelledById = signal<string | undefined>(undefined);\n private readonly labelled = signal(false);\n\n /**\n * The label's id when `aria-labelledby` has to carry the association — never on the native branch, where `for` suffices.\n * Undefined until the first render, and when the field has no label: a control must not emit a dangling reference.\n */\n readonly labelledBy = this.labelledById.asReadonly();\n\n /** Whether a label already names the control, by `for` or by `aria-labelledby`. */\n readonly hasLabel = this.labelled.asReadonly();\n\n /** The ids of everything describing the control, for its `aria-describedby`. */\n readonly describedBy = computed(() => this.descriptions().join(' ') || undefined);\n\n constructor() {\n // After render, so outside change detection: the projected content exists and writing signals\n // here cannot trigger NG0100. Re-runs when the control registers, since it picks the branch.\n afterRenderEffect(() => {\n this.content();\n this.control();\n untracked(() => this.associate());\n });\n }\n\n /**\n * Links the projected label to the registered control.\n *\n * Public because `detectChanges()` does not run after-render hooks in a zone.js harness, so a spec has to force the pass —\n * as does a consumer whose label only appears after the first render.\n */\n associate(): void {\n // `:scope >` and not `querySelector('label')`: `ng-content select=\"label\"` only projects direct\n // children, so a deeper label belongs to something else. Among several, the first names the field.\n const label = this.content().nativeElement.querySelector<HTMLLabelElement>(':scope > label');\n if (!label) {\n this.labelledById.set(undefined);\n this.labelled.set(false);\n return;\n }\n\n // When the control offers a target `for` can reach, the browser supplies the name and the focusing click, so no ARIA is owed;\n // an author's `for` that reaches no control — one aimed at a component host — names nothing, so it is re-aimed.\n const target = this.control()?.labelTarget(`${this.uid}-control`);\n if (target) {\n if (!label.control) {\n label.htmlFor = target;\n }\n this.labelledById.set(undefined);\n this.labelled.set(true);\n return;\n }\n\n this.labelledById.set(this.ensureId(label, 'label'));\n this.labelled.set(true);\n }\n\n registerControl(control: FormFieldControl): void {\n this.control.set(control);\n }\n\n unregisterControl(control: FormFieldControl): void {\n // By identity: a destruction racing a new registration must not clear the live control.\n this.control.update(current => (current === control ? undefined : current));\n }\n\n registerDescription(id: string): void {\n this.descriptions.update(ids => (ids.includes(id) ? ids : [...ids, id]));\n }\n\n unregisterDescription(id: string): void {\n this.descriptions.update(ids => ids.filter(current => current !== id));\n }\n\n /** Only stamps what has no id yet: the author's own may already be referenced elsewhere. */\n private ensureId(element: HTMLElement, suffix: string): string {\n if (!element.id) {\n element.id = `${this.uid}-${suffix}`;\n }\n return element.id;\n }\n\n protected onClick(event: MouseEvent): void {\n const control = this.control();\n if (!control) {\n return;\n }\n\n const label = (event.target as HTMLElement | null)?.closest('label');\n if (!label || label.parentElement !== this.content().nativeElement) {\n return;\n }\n\n // `label.control` is null exactly when the `for` reaches nothing, the case this exists for.\n // `hasAttribute('for')` would instead let an inert `for` through — precisely what is repaired.\n if (label.control) {\n return;\n }\n\n control.focus();\n }\n}\n","<div\n #content\n class=\"ap-form-field\">\n <ng-content select=\"label\"></ng-content>\n <ng-content></ng-content>\n <ng-content select=\"ap-form-message\"></ng-content>\n</div>\n","import { FOCUSABLE_INSIDE } from '@agorapulse/ui-components/directives';\nimport { booleanAttribute, computed, DestroyRef, Directive, effect, ElementRef, inject, input, Renderer2, Signal } from '@angular/core';\nimport type { FormFieldControl } from './form-field-control';\nimport { FormFieldComponent } from './form-field.component';\n\n/** The elements a `<label for>` can reach. Everything else has to go through `aria-labelledby`. */\nconst LABELABLE = ['BUTTON', 'INPUT', 'METER', 'OUTPUT', 'PROGRESS', 'SELECT', 'TEXTAREA'];\n\n/**\n * Points the surrounding `ap-form-field` at a control's focusable element, and carries the naming that follows.\n *\n * Put it on the element the user actually focuses: the component host when that is it (via `hostDirectives`), otherwise the\n * inner element, in the component's template. With no `ap-form-field` around, it falls back to the `aria-label` it is given.\n */\n@Directive({\n selector: '[apFormFieldControl]',\n})\nexport class FormFieldControlDirective implements FormFieldControl {\n /** Fallback name, for a field with no visible label. */\n readonly ariaLabel = input<string | null | undefined>(undefined, { alias: 'apFormFieldControl' });\n\n /** A disabled control does not take focus from a click on its label. */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n private readonly element: HTMLElement = inject(ElementRef).nativeElement;\n private readonly renderer = inject(Renderer2);\n private readonly formField = inject(FormFieldComponent, { optional: true });\n private readonly authoredDescribedBy = this.element.getAttribute('aria-describedby');\n\n /** Empty on the native branch, where the label's `for` already carries the association. */\n protected readonly labelledBy = computed(() => this.formField?.labelledBy());\n\n /** The fallback only: an `aria-label` wins over a visible label, so it goes out only when no label names the control. */\n protected readonly label = computed(() => (this.formField?.hasLabel() ? undefined : this.ariaLabel() || undefined));\n\n protected readonly describedBy = computed(\n () => [this.authoredDescribedBy, this.formField?.describedBy()].filter(Boolean).join(' ') || undefined\n );\n\n constructor() {\n this.formField?.registerControl(this);\n inject(DestroyRef).onDestroy(() => this.formField?.unregisterControl(this));\n this.reflect('aria-labelledby', this.labelledBy);\n this.reflect('aria-label', this.label);\n this.reflect('aria-describedby', this.describedBy);\n }\n\n labelTarget(fallbackId: string): string | undefined {\n if (!LABELABLE.includes(this.element.tagName)) {\n return undefined;\n }\n if (!this.element.id) {\n this.element.id = fallbackId;\n }\n return this.element.id;\n }\n\n /**\n * Writes the attribute only while there is a value for it, and gives back what the author wrote after: a host binding would\n * clear an author's own `aria-label`, static or bound, whenever the field has nothing to say.\n */\n private reflect(name: string, value: Signal<string | undefined>): void {\n const authored = this.element.getAttribute(name);\n let written = false;\n effect(() => {\n const next = value();\n if (next !== undefined) {\n this.renderer.setAttribute(this.element, name, next);\n written = true;\n } else if (written) {\n if (authored === null) {\n this.renderer.removeAttribute(this.element, name);\n } else {\n this.renderer.setAttribute(this.element, name, authored);\n }\n written = false;\n }\n });\n }\n\n focus(): void {\n if (this.disabled()) {\n return;\n }\n\n this.element.focus();\n // A named container — `role=\"group\"`, `role=\"listbox\"` — is not always in the tab order; the\n // label should then reach its first focusable element.\n if (document.activeElement !== this.element) {\n this.element.querySelector<HTMLElement>(FOCUSABLE_INSIDE)?.focus();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;AAeA,IAAI,YAAY,GAAG,CAAC;MAaP,kBAAkB,CAAA;;IAEV,GAAG,GAAG,CAAA,EAAG,MAAM,CAAC,MAAM,CAAC,CAAA,YAAA,EAAe,YAAY,EAAE,CAAA,CAAE;AAEtD,IAAA,OAAO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B;QACJ;AAEA,QAAA,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;;;QAGpB,IAAI,QAAQ,CAAC,aAAa,KAAK,IAAI,CAAC,OAAO,EAAE;YACzC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAc,gBAAgB,CAAC,EAAE,KAAK,EAAE;QACtE;IACJ;uGA1ES,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAzB,yBAAyB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,UAAA,EAAA,oBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAzB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAHrC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,sBAAsB;AACnC,iBAAA;;;AChBD;;AAEG;;;;"}
|
|
@@ -50,13 +50,13 @@ class SegmentedControlComponent {
|
|
|
50
50
|
this.value.set(option.value);
|
|
51
51
|
}
|
|
52
52
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SegmentedControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
53
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: SegmentedControlComponent, isStandalone: true, selector: "ap-segmented-control", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class.ap-segmented-control--full-width": "fullWidth()" } }, ngImport: i0, template: "<div\n class=\"ap-segmented-control\"\n role=\"group\"\n [apFormFieldControl]=\"ariaLabel()
|
|
53
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: SegmentedControlComponent, isStandalone: true, selector: "ap-segmented-control", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class.ap-segmented-control--full-width": "fullWidth()" } }, ngImport: i0, template: "<div\n class=\"ap-segmented-control\"\n role=\"group\"\n [apFormFieldControl]=\"ariaLabel()\"\n [disabled]=\"disabled()\">\n @for (option of options(); track option.value) {\n <button\n type=\"button\"\n class=\"ap-segmented-control__segment\"\n [class.ap-segmented-control__segment--selected]=\"value() === option.value\"\n [attr.aria-pressed]=\"value() === option.value\"\n [disabled]=\"disabled() || (option.disabled ?? false)\"\n (click)=\"select(option)\">\n @if (option.symbolId) {\n <ap-symbol\n class=\"ap-segmented-control__icon\"\n [symbolId]=\"option.symbolId\"\n [size]=\"16\"\n [color]=\"value() === option.value ? 'blue' : 'grey-blue'\" />\n }\n <span class=\"ap-segmented-control__label\">{{ option.label }}</span>\n </button>\n }\n</div>\n", styles: ["ap-segmented-control{display:inline-block}ap-segmented-control.ap-segmented-control--full-width{display:block}ap-segmented-control.ap-segmented-control--full-width .ap-segmented-control{display:flex;width:100%}ap-segmented-control.ap-segmented-control--full-width .ap-segmented-control__segment{flex:1 1 0}.ap-segmented-control{display:inline-flex;align-items:center}.ap-segmented-control .ap-segmented-control__segment{display:inline-flex;align-items:center;justify-content:center;gap:var(--ref-spacing-xxs);box-sizing:border-box;min-height:36px;margin:0;padding:var(--ref-spacing-xxs) var(--ref-spacing-sm);border:1px solid var(--ref-color-grey-20);background-color:var(--ref-color-white);color:var(--ref-color-grey-100);font-family:var(--ref-font-family);font-size:var(--ref-font-size-sm);font-weight:var(--ref-font-weight-bold);line-height:var(--ref-font-line-height-md);white-space:nowrap;cursor:pointer;transition:color .15s ease,border-color .15s ease,background-color .15s ease}.ap-segmented-control .ap-segmented-control__segment:not(:first-child){margin-left:-1px}.ap-segmented-control .ap-segmented-control__segment:first-child{border-top-left-radius:var(--ref-border-radius-sm);border-bottom-left-radius:var(--ref-border-radius-sm)}.ap-segmented-control .ap-segmented-control__segment:last-child{border-top-right-radius:var(--ref-border-radius-sm);border-bottom-right-radius:var(--ref-border-radius-sm)}.ap-segmented-control .ap-segmented-control__segment:hover:not(:disabled){z-index:1;border-color:var(--ref-color-electric-blue-100)}.ap-segmented-control .ap-segmented-control__segment:focus-visible{z-index:2;outline:none;border-color:var(--ref-color-electric-blue-100);box-shadow:0 0 0 1px var(--ref-color-white),0 0 0 3px var(--ref-color-electric-blue-100)}.ap-segmented-control .ap-segmented-control__segment.ap-segmented-control__segment--selected{z-index:1;border-color:var(--ref-color-electric-blue-100);color:var(--ref-color-electric-blue-100)}.ap-segmented-control .ap-segmented-control__segment:disabled{border-color:var(--ref-color-grey-20);background-color:var(--ref-color-grey-05);color:var(--ref-color-grey-40);cursor:not-allowed}.ap-segmented-control .ap-segmented-control__label{font:inherit;min-width:0;overflow:hidden;text-overflow:ellipsis}\n"], dependencies: [{ kind: "directive", type: FormFieldControlDirective, selector: "[apFormFieldControl]", inputs: ["apFormFieldControl", "disabled"] }, { kind: "component", type: SymbolComponent, selector: "ap-symbol", inputs: ["symbolId", "color", "size"], outputs: ["sizeChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
54
54
|
}
|
|
55
55
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SegmentedControlComponent, decorators: [{
|
|
56
56
|
type: Component,
|
|
57
57
|
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-segmented-control', imports: [FormFieldControlDirective, SymbolComponent], host: {
|
|
58
58
|
'[class.ap-segmented-control--full-width]': 'fullWidth()',
|
|
59
|
-
}, encapsulation: ViewEncapsulation.None, template: "<div\n class=\"ap-segmented-control\"\n role=\"group\"\n [apFormFieldControl]=\"ariaLabel()
|
|
59
|
+
}, encapsulation: ViewEncapsulation.None, template: "<div\n class=\"ap-segmented-control\"\n role=\"group\"\n [apFormFieldControl]=\"ariaLabel()\"\n [disabled]=\"disabled()\">\n @for (option of options(); track option.value) {\n <button\n type=\"button\"\n class=\"ap-segmented-control__segment\"\n [class.ap-segmented-control__segment--selected]=\"value() === option.value\"\n [attr.aria-pressed]=\"value() === option.value\"\n [disabled]=\"disabled() || (option.disabled ?? false)\"\n (click)=\"select(option)\">\n @if (option.symbolId) {\n <ap-symbol\n class=\"ap-segmented-control__icon\"\n [symbolId]=\"option.symbolId\"\n [size]=\"16\"\n [color]=\"value() === option.value ? 'blue' : 'grey-blue'\" />\n }\n <span class=\"ap-segmented-control__label\">{{ option.label }}</span>\n </button>\n }\n</div>\n", styles: ["ap-segmented-control{display:inline-block}ap-segmented-control.ap-segmented-control--full-width{display:block}ap-segmented-control.ap-segmented-control--full-width .ap-segmented-control{display:flex;width:100%}ap-segmented-control.ap-segmented-control--full-width .ap-segmented-control__segment{flex:1 1 0}.ap-segmented-control{display:inline-flex;align-items:center}.ap-segmented-control .ap-segmented-control__segment{display:inline-flex;align-items:center;justify-content:center;gap:var(--ref-spacing-xxs);box-sizing:border-box;min-height:36px;margin:0;padding:var(--ref-spacing-xxs) var(--ref-spacing-sm);border:1px solid var(--ref-color-grey-20);background-color:var(--ref-color-white);color:var(--ref-color-grey-100);font-family:var(--ref-font-family);font-size:var(--ref-font-size-sm);font-weight:var(--ref-font-weight-bold);line-height:var(--ref-font-line-height-md);white-space:nowrap;cursor:pointer;transition:color .15s ease,border-color .15s ease,background-color .15s ease}.ap-segmented-control .ap-segmented-control__segment:not(:first-child){margin-left:-1px}.ap-segmented-control .ap-segmented-control__segment:first-child{border-top-left-radius:var(--ref-border-radius-sm);border-bottom-left-radius:var(--ref-border-radius-sm)}.ap-segmented-control .ap-segmented-control__segment:last-child{border-top-right-radius:var(--ref-border-radius-sm);border-bottom-right-radius:var(--ref-border-radius-sm)}.ap-segmented-control .ap-segmented-control__segment:hover:not(:disabled){z-index:1;border-color:var(--ref-color-electric-blue-100)}.ap-segmented-control .ap-segmented-control__segment:focus-visible{z-index:2;outline:none;border-color:var(--ref-color-electric-blue-100);box-shadow:0 0 0 1px var(--ref-color-white),0 0 0 3px var(--ref-color-electric-blue-100)}.ap-segmented-control .ap-segmented-control__segment.ap-segmented-control__segment--selected{z-index:1;border-color:var(--ref-color-electric-blue-100);color:var(--ref-color-electric-blue-100)}.ap-segmented-control .ap-segmented-control__segment:disabled{border-color:var(--ref-color-grey-20);background-color:var(--ref-color-grey-05);color:var(--ref-color-grey-40);cursor:not-allowed}.ap-segmented-control .ap-segmented-control__label{font:inherit;min-width:0;overflow:hidden;text-overflow:ellipsis}\n"] }]
|
|
60
60
|
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
61
61
|
|
|
62
62
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agorapulse-ui-components-segmented-control.mjs","sources":["../../../libs/ui-components/segmented-control/src/segmented-control.component.ts","../../../libs/ui-components/segmented-control/src/segmented-control.component.html","../../../libs/ui-components/segmented-control/src/agorapulse-ui-components-segmented-control.ts"],"sourcesContent":["import { FormFieldControlDirective } from '@agorapulse/ui-components/form-field';\nimport { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';\nimport { agorapulseSymbol, SymbolComponent, SymbolRegistry } from '@agorapulse/ui-symbol';\nimport { ChangeDetectionStrategy, Component, effect, inject, input, model, untracked, ViewEncapsulation } from '@angular/core';\n\nexport interface SegmentedControlOption {\n /** The value bound to the control when this option is selected. */\n value: string;\n /** The text shown on the segment. */\n label: string;\n /** Optional leading icon symbol id. */\n symbolId?: agorapulseSymbol;\n /** Disables this segment only. */\n disabled?: boolean;\n}\n\n/**\n * A single-select control for switching between a small set (2–4) of mutually\n * exclusive options laid out side by side.\n *\n * @example\n * ```html\n * <ap-segmented-control\n * [options]=\"[{ value: 'list', label: 'List' }, { value: 'board', label: 'Board' }]\"\n * [(value)]=\"view\"\n * ariaLabel=\"Choose a view\" />\n * ```\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-segmented-control',\n templateUrl: './segmented-control.component.html',\n styleUrls: ['./segmented-control.component.scss'],\n imports: [FormFieldControlDirective, SymbolComponent],\n host: {\n '[class.ap-segmented-control--full-width]': 'fullWidth()',\n },\n // Emit plain, global `.ap-segmented-control*` classes (no Angular scoping) so the\n // styling stays framework-agnostic and readable/reusable outside Angular.\n encapsulation: ViewEncapsulation.None,\n})\nexport class SegmentedControlComponent {\n private readonly symbolRegistry = inject(SymbolRegistry);\n\n readonly options = input.required<SegmentedControlOption[]>();\n /** The currently selected value. Supports two-way binding via `[(value)]`. Defaults to the first option's value when unset. */\n readonly value = model<string>('');\n /** Disables the whole control. */\n readonly disabled = input(false);\n /** When true, the control fills its container width and segments share it equally instead of fitting their text. */\n readonly fullWidth = input(false);\n /** Accessible name for the group of segments. */\n readonly ariaLabel = input('');\n\n // Keep `value` defined: fall back to the first option whenever it is unset.\n private readonly defaultValueEffect = effect(() => {\n const [firstOption] = this.options();\n if (!this.value() && firstOption) {\n untracked(() => this.value.set(firstOption.value));\n }\n });\n\n constructor() {\n this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));\n }\n\n protected select(option: SegmentedControlOption): void {\n if (this.disabled() || option.disabled) {\n return;\n }\n this.value.set(option.value);\n }\n}\n","<div\n class=\"ap-segmented-control\"\n role=\"group\"\n [apFormFieldControl]=\"ariaLabel()
|
|
1
|
+
{"version":3,"file":"agorapulse-ui-components-segmented-control.mjs","sources":["../../../libs/ui-components/segmented-control/src/segmented-control.component.ts","../../../libs/ui-components/segmented-control/src/segmented-control.component.html","../../../libs/ui-components/segmented-control/src/agorapulse-ui-components-segmented-control.ts"],"sourcesContent":["import { FormFieldControlDirective } from '@agorapulse/ui-components/form-field';\nimport { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';\nimport { agorapulseSymbol, SymbolComponent, SymbolRegistry } from '@agorapulse/ui-symbol';\nimport { ChangeDetectionStrategy, Component, effect, inject, input, model, untracked, ViewEncapsulation } from '@angular/core';\n\nexport interface SegmentedControlOption {\n /** The value bound to the control when this option is selected. */\n value: string;\n /** The text shown on the segment. */\n label: string;\n /** Optional leading icon symbol id. */\n symbolId?: agorapulseSymbol;\n /** Disables this segment only. */\n disabled?: boolean;\n}\n\n/**\n * A single-select control for switching between a small set (2–4) of mutually\n * exclusive options laid out side by side.\n *\n * @example\n * ```html\n * <ap-segmented-control\n * [options]=\"[{ value: 'list', label: 'List' }, { value: 'board', label: 'Board' }]\"\n * [(value)]=\"view\"\n * ariaLabel=\"Choose a view\" />\n * ```\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-segmented-control',\n templateUrl: './segmented-control.component.html',\n styleUrls: ['./segmented-control.component.scss'],\n imports: [FormFieldControlDirective, SymbolComponent],\n host: {\n '[class.ap-segmented-control--full-width]': 'fullWidth()',\n },\n // Emit plain, global `.ap-segmented-control*` classes (no Angular scoping) so the\n // styling stays framework-agnostic and readable/reusable outside Angular.\n encapsulation: ViewEncapsulation.None,\n})\nexport class SegmentedControlComponent {\n private readonly symbolRegistry = inject(SymbolRegistry);\n\n readonly options = input.required<SegmentedControlOption[]>();\n /** The currently selected value. Supports two-way binding via `[(value)]`. Defaults to the first option's value when unset. */\n readonly value = model<string>('');\n /** Disables the whole control. */\n readonly disabled = input(false);\n /** When true, the control fills its container width and segments share it equally instead of fitting their text. */\n readonly fullWidth = input(false);\n /** Accessible name for the group of segments. */\n readonly ariaLabel = input('');\n\n // Keep `value` defined: fall back to the first option whenever it is unset.\n private readonly defaultValueEffect = effect(() => {\n const [firstOption] = this.options();\n if (!this.value() && firstOption) {\n untracked(() => this.value.set(firstOption.value));\n }\n });\n\n constructor() {\n this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));\n }\n\n protected select(option: SegmentedControlOption): void {\n if (this.disabled() || option.disabled) {\n return;\n }\n this.value.set(option.value);\n }\n}\n","<div\n class=\"ap-segmented-control\"\n role=\"group\"\n [apFormFieldControl]=\"ariaLabel()\"\n [disabled]=\"disabled()\">\n @for (option of options(); track option.value) {\n <button\n type=\"button\"\n class=\"ap-segmented-control__segment\"\n [class.ap-segmented-control__segment--selected]=\"value() === option.value\"\n [attr.aria-pressed]=\"value() === option.value\"\n [disabled]=\"disabled() || (option.disabled ?? false)\"\n (click)=\"select(option)\">\n @if (option.symbolId) {\n <ap-symbol\n class=\"ap-segmented-control__icon\"\n [symbolId]=\"option.symbolId\"\n [size]=\"16\"\n [color]=\"value() === option.value ? 'blue' : 'grey-blue'\" />\n }\n <span class=\"ap-segmented-control__label\">{{ option.label }}</span>\n </button>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;AAgBA;;;;;;;;;;;AAWG;MAcU,yBAAyB,CAAA;AACjB,IAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;IAE/C,OAAO,GAAG,KAAK,CAAC,QAAQ;gFAA4B;;IAEpD,KAAK,GAAG,KAAK,CAAS,EAAE;8EAAC;;IAEzB,QAAQ,GAAG,KAAK,CAAC,KAAK;iFAAC;;IAEvB,SAAS,GAAG,KAAK,CAAC,KAAK;kFAAC;;IAExB,SAAS,GAAG,KAAK,CAAC,EAAE;kFAAC;;AAGb,IAAA,kBAAkB,GAAG,MAAM,CAAC,MAAK;QAC9C,MAAM,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE;QACpC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,WAAW,EAAE;AAC9B,YAAA,SAAS,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QACtD;IACJ,CAAC;2FAAC;AAEF,IAAA,WAAA,GAAA;QACI,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,MAAM,CAAC,qBAAqB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IACzG;AAEU,IAAA,MAAM,CAAC,MAA8B,EAAA;QAC3C,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,MAAM,CAAC,QAAQ,EAAE;YACpC;QACJ;QACA,I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QAAA,EAAA,EAAA,EAAA,QAAA,ECzCtC,m9BAwBA,EAAA,MAAA,EAAA,CAAA,quEAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDSc,yBAAyB,6GAAE,eAAe,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,OAAA,EAAA,MAAA,CAAA,EAAA,OAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAQ3C,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAbrC,SAAS;sCACW,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC,sBAAsB,EAAA,OAAA,EAGvB,CAAC,yBAAyB,EAAE,eAAe,CAAC,EAAA,IAAA,EAC/C;AACF,wBAAA,0CAA0C,EAAE,aAAa;qBAC5D,EAAA,aAAA,EAGc,iBAAiB,CAAC,IAAI,EAAA,QAAA,EAAA,m9BAAA,EAAA,MAAA,EAAA,CAAA,quEAAA,CAAA,EAAA;;;AEvCzC;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -147,6 +147,12 @@ declare class EqualValidatorDirective implements Validator {
|
|
|
147
147
|
static ɵdir: i0.ɵɵDirectiveDeclaration<EqualValidatorDirective, "[validateEqual][formControlName],[validateEqual][formControl],[validateEqual][ngModel]", never, {}, {}, never, never, true, never>;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
+
/**
|
|
151
|
+
* The elements that can take keyboard focus inside a wrapper, for reaching the real control behind a component host.
|
|
152
|
+
* `tabindex="-1"` is left out: it marks a focus target, not an entry point.
|
|
153
|
+
*/
|
|
154
|
+
declare const FOCUSABLE_INSIDE = "button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])";
|
|
155
|
+
|
|
150
156
|
declare class GifService {
|
|
151
157
|
static isGif(src: string): boolean | "";
|
|
152
158
|
}
|
|
@@ -331,5 +337,5 @@ declare class TableColumnDragDirective implements OnInit, OnDestroy {
|
|
|
331
337
|
static ɵdir: i0.ɵɵDirectiveDeclaration<TableColumnDragDirective, "table[apTableColumnDrag]", never, {}, {}, never, never, true, never>;
|
|
332
338
|
}
|
|
333
339
|
|
|
334
|
-
export { AP_INTERACTIVE_ELEMENT, AutosizeTextareaDirective, BaseButtonDirective, CheckboxDirective, ClickDirective, DefaultImageDirective, EllipsisDirective, EqualValidatorDirective, FrozenGifDirective, GifService, MultiStyleTextDirective, OverflowCountDirective, OverflowCounterDirective, OverflowItemDirective, StopPropagationDirective, TableColumnDragDirective };
|
|
340
|
+
export { AP_INTERACTIVE_ELEMENT, AutosizeTextareaDirective, BaseButtonDirective, CheckboxDirective, ClickDirective, DefaultImageDirective, EllipsisDirective, EqualValidatorDirective, FOCUSABLE_INSIDE, FrozenGifDirective, GifService, MultiStyleTextDirective, OverflowCountDirective, OverflowCounterDirective, OverflowItemDirective, StopPropagationDirective, TableColumnDragDirective };
|
|
335
341
|
export type { ApInteractiveElement };
|
|
@@ -21,7 +21,7 @@ interface FormFieldControl {
|
|
|
21
21
|
*/
|
|
22
22
|
declare class FormFieldControlDirective implements FormFieldControl {
|
|
23
23
|
/** Fallback name, for a field with no visible label. */
|
|
24
|
-
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
24
|
+
readonly ariaLabel: _angular_core.InputSignal<string | null | undefined>;
|
|
25
25
|
/** A disabled control does not take focus from a click on its label. */
|
|
26
26
|
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
27
27
|
private readonly element;
|
|
@@ -46,10 +46,7 @@ declare class FormFieldControlDirective implements FormFieldControl {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
declare class FormFieldComponent {
|
|
49
|
-
/**
|
|
50
|
-
* Combines the application id — federated Angular apps can share a page — with a per-instance random suffix.
|
|
51
|
-
* Not `crypto.randomUUID()`, which browsers refuse outside a secure context.
|
|
52
|
-
*/
|
|
49
|
+
/** Prefixed with the application id, since federated Angular apps can share a page and each counts from zero. */
|
|
53
50
|
private readonly uid;
|
|
54
51
|
private readonly content;
|
|
55
52
|
private readonly control;
|
|
Binary file
|