@ngx-uk-frontend/core
Version:
Core utilities and shared functionality for ngx-uk-frontend libraries
27 lines • 2.46 kB
JavaScript
import { booleanAttribute, Directive, input } from '@angular/core';
import * as i0 from "@angular/core";
/**
* Base radio option directive that provides common functionality
* for radio option components across different design systems.
*
* This directive handles:
* - Option label and value configuration
* - Optional hint text
* - Divided option support (for "Or" dividers)
*/
export class RadioOptionDirective {
/** The displayed text for the radio option */
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : []));
/** The value that will be submitted when the option is selected */
value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
/** Optional hint text to provide additional context */
hint = input(...(ngDevMode ? [undefined, { debugName: "hint" }] : []));
/** Whether this option should be preceded by a divider (e.g., "Or") */
isDivided = input(false, { ...(ngDevMode ? { debugName: "isDivided" } : {}), transform: booleanAttribute });
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: RadioOptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.6", type: RadioOptionDirective, isStandalone: true, inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, isDivided: { classPropertyName: "isDivided", publicName: "isDivided", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: RadioOptionDirective, decorators: [{
type: Directive
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], isDivided: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDivided", required: false }] }] } });
//# sourceMappingURL=radio-option.directive.js.map