ngx-com 0.0.20 → 0.0.21
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/ngx-com-components-checkbox.mjs +16 -7
- package/fesm2022/ngx-com-components-checkbox.mjs.map +1 -1
- package/fesm2022/ngx-com-components-dropdown.mjs +18 -10
- package/fesm2022/ngx-com-components-dropdown.mjs.map +1 -1
- package/fesm2022/ngx-com-components-form-field.mjs +48 -8
- package/fesm2022/ngx-com-components-form-field.mjs.map +1 -1
- package/fesm2022/ngx-com-components-radio.mjs +15 -8
- package/fesm2022/ngx-com-components-radio.mjs.map +1 -1
- package/fesm2022/ngx-com-components-separator.mjs +102 -0
- package/fesm2022/ngx-com-components-separator.mjs.map +1 -0
- package/package.json +5 -1
- package/types/ngx-com-components-checkbox.d.ts +7 -2
- package/types/ngx-com-components-dropdown.d.ts +8 -5
- package/types/ngx-com-components-form-field.d.ts +19 -3
- package/types/ngx-com-components-radio.d.ts +5 -3
- package/types/ngx-com-components-separator.d.ts +75 -0
|
@@ -127,8 +127,13 @@ class ComCheckbox {
|
|
|
127
127
|
checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : []));
|
|
128
128
|
indeterminate = model(false, ...(ngDevMode ? [{ debugName: "indeterminate" }] : []));
|
|
129
129
|
disabled = model(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
130
|
-
|
|
130
|
+
htmlValue = input(undefined, { ...(ngDevMode ? { debugName: "htmlValue" } : {}), alias: 'value' });
|
|
131
131
|
name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : []));
|
|
132
|
+
// Signal Forms inputs — set automatically by [formField] via setInputOnDirectives
|
|
133
|
+
touched = model(false, ...(ngDevMode ? [{ debugName: "touched" }] : []));
|
|
134
|
+
invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : []));
|
|
135
|
+
sfErrors = input([], { ...(ngDevMode ? { debugName: "sfErrors" } : {}), alias: 'errors' });
|
|
136
|
+
sfRequired = input(false, { ...(ngDevMode ? { debugName: "sfRequired" } : {}), alias: 'required' });
|
|
132
137
|
id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : []));
|
|
133
138
|
ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : {}), alias: 'aria-label' });
|
|
134
139
|
ariaLabelledby = input(null, { ...(ngDevMode ? { debugName: "ariaLabelledby" } : {}), alias: 'aria-labelledby' });
|
|
@@ -170,6 +175,10 @@ class ComCheckbox {
|
|
|
170
175
|
this.disabled.set(isDisabled);
|
|
171
176
|
}
|
|
172
177
|
// Event handlers
|
|
178
|
+
onBlur() {
|
|
179
|
+
this.onTouched();
|
|
180
|
+
this.touched.set(true);
|
|
181
|
+
}
|
|
173
182
|
onInputChange(event) {
|
|
174
183
|
const input = event.target;
|
|
175
184
|
const newChecked = input.checked;
|
|
@@ -199,7 +208,7 @@ class ComCheckbox {
|
|
|
199
208
|
this.changed.emit({ checked: newChecked, source: this });
|
|
200
209
|
}
|
|
201
210
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ComCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
202
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: ComCheckbox, isStandalone: true, selector: "com-checkbox", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null },
|
|
211
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: ComCheckbox, isStandalone: true, selector: "com-checkbox", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, htmlValue: { classPropertyName: "htmlValue", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, sfErrors: { classPropertyName: "sfErrors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, sfRequired: { classPropertyName: "sfRequired", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", indeterminate: "indeterminateChange", disabled: "disabledChange", touched: "touchedChange", changed: "changed" }, host: { properties: { "class.com-checkbox--disabled": "disabled()", "class.com-checkbox--checked": "checked()", "class.com-checkbox--indeterminate": "indeterminate()" }, classAttribute: "com-checkbox inline-block align-middle" }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputElement"], descendants: true, isSignal: true }], exportAs: ["comCheckbox"], ngImport: i0, template: `
|
|
203
212
|
<label
|
|
204
213
|
class="group relative inline-flex items-center"
|
|
205
214
|
[class.cursor-pointer]="!disabled()"
|
|
@@ -213,12 +222,12 @@ class ComCheckbox {
|
|
|
213
222
|
[checked]="checked()"
|
|
214
223
|
[disabled]="disabled()"
|
|
215
224
|
[attr.name]="name()"
|
|
216
|
-
[attr.value]="
|
|
225
|
+
[attr.value]="htmlValue()"
|
|
217
226
|
[attr.aria-label]="ariaLabel()"
|
|
218
227
|
[attr.aria-labelledby]="ariaLabelledby()"
|
|
219
228
|
[attr.aria-describedby]="ariaDescribedby()"
|
|
220
229
|
(change)="onInputChange($event)"
|
|
221
|
-
(blur)="
|
|
230
|
+
(blur)="onBlur()"
|
|
222
231
|
/></span>
|
|
223
232
|
<span [class]="boxClasses()">
|
|
224
233
|
@if (checked() && !indeterminate()) {
|
|
@@ -278,12 +287,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
278
287
|
[checked]="checked()"
|
|
279
288
|
[disabled]="disabled()"
|
|
280
289
|
[attr.name]="name()"
|
|
281
|
-
[attr.value]="
|
|
290
|
+
[attr.value]="htmlValue()"
|
|
282
291
|
[attr.aria-label]="ariaLabel()"
|
|
283
292
|
[attr.aria-labelledby]="ariaLabelledby()"
|
|
284
293
|
[attr.aria-describedby]="ariaDescribedby()"
|
|
285
294
|
(change)="onInputChange($event)"
|
|
286
|
-
(blur)="
|
|
295
|
+
(blur)="onBlur()"
|
|
287
296
|
/></span>
|
|
288
297
|
<span [class]="boxClasses()">
|
|
289
298
|
@if (checked() && !indeterminate()) {
|
|
@@ -331,7 +340,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
331
340
|
'[class.com-checkbox--checked]': 'checked()',
|
|
332
341
|
'[class.com-checkbox--indeterminate]': 'indeterminate()',
|
|
333
342
|
}, styles: [".sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}\n"] }]
|
|
334
|
-
}], ctorParameters: () => [], propDecorators: { inputRef: [{ type: i0.ViewChild, args: ['inputElement', { isSignal: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }, { type: i0.Output, args: ["indeterminateChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }],
|
|
343
|
+
}], ctorParameters: () => [], propDecorators: { inputRef: [{ type: i0.ViewChild, args: ['inputElement', { isSignal: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }, { type: i0.Output, args: ["indeterminateChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], htmlValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], sfErrors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], sfRequired: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], ariaDescribedby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], changed: [{ type: i0.Output, args: ["changed"] }] } });
|
|
335
344
|
|
|
336
345
|
// Public API for the checkbox component
|
|
337
346
|
// Main component
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-com-components-checkbox.mjs","sources":["../../../projects/com/components/checkbox/checkbox.variants.ts","../../../projects/com/components/checkbox/checkbox.component.ts","../../../projects/com/components/checkbox/index.ts","../../../projects/com/components/checkbox/ngx-com-components-checkbox.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\n/** Checkbox size variants. */\nexport type CheckboxSize = 'sm' | 'md' | 'lg';\n\n/** Checkbox color variants. */\nexport type CheckboxVariant = 'primary' | 'accent' | 'warn';\n\n/**\n * CVA variants for the visual checkbox box.\n *\n * Uses `peer` selectors to style based on native input state:\n * - `peer-checked:` for checked state\n * - `peer-indeterminate:` for indeterminate state\n * - `peer-focus-visible:` for keyboard focus\n * - `peer-disabled:` for disabled state\n *\n * @tokens `--color-border`, `--color-primary`, `--color-primary-foreground`, `--color-primary-hover`,\n * `--color-accent`, `--color-accent-foreground`, `--color-accent-hover`,\n * `--color-warn`, `--color-warn-foreground`, `--color-warn-hover`,\n * `--color-disabled`, `--color-disabled-foreground`, `--color-ring`, `--radius-interactive-sm`\n */\nexport const checkboxBoxVariants: (props?: {\n variant?: CheckboxVariant;\n size?: CheckboxSize;\n}) => string = cva(\n [\n 'com-checkbox__box',\n 'inline-flex shrink-0 items-center justify-center',\n 'rounded-interactive-sm border-2 border-border',\n 'transition-colors duration-150',\n 'peer-focus-visible:outline-[1px] peer-focus-visible:outline-offset-2 peer-focus-visible:outline-ring',\n 'peer-disabled:cursor-not-allowed peer-disabled:border-disabled peer-disabled:bg-disabled peer-disabled:text-disabled-foreground',\n ],\n {\n variants: {\n variant: {\n primary: [\n 'peer-checked:border-primary peer-checked:bg-primary peer-checked:text-primary-foreground',\n 'peer-indeterminate:border-primary peer-indeterminate:bg-primary peer-indeterminate:text-primary-foreground',\n 'group-hover:border-primary-hover',\n 'peer-checked:group-hover:bg-primary-hover peer-checked:group-hover:border-primary-hover',\n 'peer-indeterminate:group-hover:bg-primary-hover peer-indeterminate:group-hover:border-primary-hover',\n ],\n accent: [\n 'peer-checked:border-accent peer-checked:bg-accent peer-checked:text-accent-foreground',\n 'peer-indeterminate:border-accent peer-indeterminate:bg-accent peer-indeterminate:text-accent-foreground',\n 'group-hover:border-accent-hover',\n 'peer-checked:group-hover:bg-accent-hover peer-checked:group-hover:border-accent-hover',\n 'peer-indeterminate:group-hover:bg-accent-hover peer-indeterminate:group-hover:border-accent-hover',\n ],\n warn: [\n 'peer-checked:border-warn peer-checked:bg-warn peer-checked:text-warn-foreground',\n 'peer-indeterminate:border-warn peer-indeterminate:bg-warn peer-indeterminate:text-warn-foreground',\n 'group-hover:border-warn-hover',\n 'peer-checked:group-hover:bg-warn-hover peer-checked:group-hover:border-warn-hover',\n 'peer-indeterminate:group-hover:bg-warn-hover peer-indeterminate:group-hover:border-warn-hover',\n ],\n },\n size: {\n sm: 'size-4',\n md: 'size-5',\n lg: 'size-6',\n },\n },\n defaultVariants: {\n variant: 'primary',\n size: 'md',\n },\n }\n);\n\n/** Size-based classes for the checkmark SVG icon. */\nexport const CHECKBOX_ICON_SIZES: Record<CheckboxSize, string> = {\n sm: 'size-3',\n md: 'size-3.5',\n lg: 'size-4',\n};\n\n/** Size-based classes for the label content. */\nexport const CHECKBOX_LABEL_SIZES: Record<CheckboxSize, string> = {\n sm: 'text-sm ms-2',\n md: 'text-base ms-2.5',\n lg: 'text-lg ms-3',\n};\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n input,\n model,\n output,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport type {\n InputSignal,\n ModelSignal,\n OutputEmitterRef,\n Signal,\n} from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport type { ControlValueAccessor } from '@angular/forms';\nimport {\n checkboxBoxVariants,\n CHECKBOX_ICON_SIZES,\n CHECKBOX_LABEL_SIZES,\n} from './checkbox.variants';\nimport type { CheckboxSize, CheckboxVariant } from './checkbox.variants';\n\n/** Event emitted when checkbox state changes. */\nexport interface CheckboxChange {\n checked: boolean;\n source: ComCheckbox;\n}\n\n/** Auto-incrementing ID counter for unique checkbox IDs. */\nlet nextId = 0;\n\n/**\n * Production-grade checkbox component with full accessibility support.\n *\n * Uses a native `<input type=\"checkbox\">` for built-in keyboard handling,\n * `:checked` and `:indeterminate` pseudo-classes, and screen reader support.\n *\n * Implements `ControlValueAccessor` for Reactive Forms integration via\n * `NgControl` injection pattern (no `NG_VALUE_ACCESSOR` provider).\n *\n * @tokens `--color-border`, `--color-primary`, `--color-primary-foreground`, `--color-primary-hover`,\n * `--color-accent`, `--color-accent-foreground`, `--color-accent-hover`,\n * `--color-warn`, `--color-warn-foreground`, `--color-warn-hover`,\n * `--color-disabled`, `--color-disabled-foreground`, `--color-ring`\n *\n * @example Basic usage\n * ```html\n * <com-checkbox [(checked)]=\"isActive\">Enable feature</com-checkbox>\n * ```\n *\n * @example With reactive forms\n * ```html\n * <com-checkbox formControlName=\"acceptTerms\">\n * I accept the <a href=\"/terms\">terms and conditions</a>\n * </com-checkbox>\n * ```\n *\n * @example Indeterminate state\n * ```html\n * <com-checkbox [(indeterminate)]=\"hasPartialSelection\" (changed)=\"onSelectAll($event)\">\n * Select all\n * </com-checkbox>\n * ```\n *\n * @example Variants and sizes\n * ```html\n * <com-checkbox variant=\"accent\" size=\"lg\">Large accent checkbox</com-checkbox>\n * <com-checkbox variant=\"warn\" size=\"sm\">Small warning checkbox</com-checkbox>\n * ```\n */\n@Component({\n selector: 'com-checkbox',\n exportAs: 'comCheckbox',\n template: `\n <label\n class=\"group relative inline-flex items-center\"\n [class.cursor-pointer]=\"!disabled()\"\n [class.cursor-not-allowed]=\"disabled()\"\n >\n <span><input\n #inputElement\n type=\"checkbox\"\n class=\"peer sr-only\"\n [id]=\"inputId()\"\n [checked]=\"checked()\"\n [disabled]=\"disabled()\"\n [attr.name]=\"name()\"\n [attr.value]=\"value()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onTouched()\"\n /></span>\n <span [class]=\"boxClasses()\">\n @if (checked() && !indeterminate()) {\n <svg\n class=\"pointer-events-none\"\n [class]=\"iconSizeClass()\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <polyline points=\"4 12 9 17 20 6\" />\n </svg>\n }\n @if (indeterminate()) {\n <svg\n class=\"pointer-events-none\"\n [class]=\"iconSizeClass()\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\" />\n </svg>\n }\n </span>\n <span\n class=\"com-checkbox__label select-none peer-disabled:cursor-not-allowed peer-disabled:text-disabled-foreground\"\n [class]=\"labelSizeClass()\"\n >\n <ng-content />\n </span>\n </label>\n `,\n styles: `\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'com-checkbox inline-block align-middle',\n '[class.com-checkbox--disabled]': 'disabled()',\n '[class.com-checkbox--checked]': 'checked()',\n '[class.com-checkbox--indeterminate]': 'indeterminate()',\n },\n})\nexport class ComCheckbox implements ControlValueAccessor {\n /** Optional NgControl for reactive forms integration. */\n readonly ngControl: NgControl | null = inject(NgControl, { optional: true, self: true });\n\n /** Reference to the native input element. */\n readonly inputRef: Signal<ElementRef<HTMLInputElement> | undefined> =\n viewChild<ElementRef<HTMLInputElement>>('inputElement');\n\n /** Unique ID for this checkbox instance. */\n private readonly uniqueId: string = `com-checkbox-${nextId++}`;\n\n // Inputs\n readonly size: InputSignal<CheckboxSize> = input<CheckboxSize>('md');\n readonly variant: InputSignal<CheckboxVariant> = input<CheckboxVariant>('primary');\n readonly checked: ModelSignal<boolean> = model<boolean>(false);\n readonly indeterminate: ModelSignal<boolean> = model<boolean>(false);\n readonly disabled: ModelSignal<boolean> = model<boolean>(false);\n readonly value: InputSignal<string | undefined> = input<string>();\n readonly name: InputSignal<string | undefined> = input<string>();\n readonly id: InputSignal<string | undefined> = input<string>();\n readonly ariaLabel: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-label' });\n readonly ariaLabelledby: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-labelledby' });\n readonly ariaDescribedby: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-describedby' });\n\n // Outputs\n readonly changed: OutputEmitterRef<CheckboxChange> = output<CheckboxChange>();\n\n // Computed state\n readonly inputId: Signal<string> = computed(() => this.id() ?? this.uniqueId);\n\n protected readonly boxClasses: Signal<string> = computed(() =>\n checkboxBoxVariants({ variant: this.variant(), size: this.size() })\n );\n\n protected readonly iconSizeClass: Signal<string> = computed(() => CHECKBOX_ICON_SIZES[this.size()]);\n protected readonly labelSizeClass: Signal<string> = computed(() => CHECKBOX_LABEL_SIZES[this.size()]);\n\n // CVA callbacks\n private onChange: (value: boolean) => void = () => {};\n protected onTouched: () => void = () => {};\n\n constructor() {\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n\n // Sync indeterminate state to DOM (needed because [indeterminate] is a property, not attribute)\n effect(() => {\n const isIndeterminate = this.indeterminate();\n const inputEl = this.inputRef()?.nativeElement;\n if (inputEl) {\n inputEl.indeterminate = isIndeterminate;\n }\n });\n }\n\n // ControlValueAccessor implementation\n writeValue(value: boolean): void {\n this.checked.set(value ?? false);\n }\n\n registerOnChange(fn: (value: boolean) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled.set(isDisabled);\n }\n\n // Event handlers\n protected onInputChange(event: Event): void {\n const input = event.target as HTMLInputElement;\n const newChecked = input.checked;\n\n // Clear indeterminate on user interaction\n if (this.indeterminate()) {\n this.indeterminate.set(false);\n input.indeterminate = false;\n }\n\n this.checked.set(newChecked);\n this.onChange(newChecked);\n this.changed.emit({ checked: newChecked, source: this });\n }\n\n // Public API\n /** Focuses this checkbox's input element. */\n focus(): void {\n this.inputRef()?.nativeElement.focus();\n }\n\n /** Toggles the checkbox state programmatically. */\n toggle(): void {\n if (this.disabled()) {\n return;\n }\n\n const newChecked = !this.checked();\n this.checked.set(newChecked);\n this.indeterminate.set(false);\n this.onChange(newChecked);\n this.changed.emit({ checked: newChecked, source: this });\n }\n}\n","// Public API for the checkbox component\n\n// Main component\nexport { ComCheckbox } from './checkbox.component';\n\n// Types\nexport type { CheckboxChange } from './checkbox.component';\n\n// Variants (for advanced customization)\nexport {\n checkboxBoxVariants,\n CHECKBOX_ICON_SIZES,\n CHECKBOX_LABEL_SIZES,\n} from './checkbox.variants';\n\nexport type { CheckboxSize, CheckboxVariant } from './checkbox.variants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAQA;;;;;;;;;;;;;AAaG;AACI,MAAM,mBAAmB,GAGjB,GAAG,CAChB;IACE,mBAAmB;IACnB,kDAAkD;IAClD,+CAA+C;IAC/C,gCAAgC;IAChC,sGAAsG;IACtG,iIAAiI;CAClI,EACD;AACE,IAAA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AA,EAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,kBAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACzK1D;AAEA;;ACFA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-com-components-checkbox.mjs","sources":["../../../projects/com/components/checkbox/checkbox.variants.ts","../../../projects/com/components/checkbox/checkbox.component.ts","../../../projects/com/components/checkbox/index.ts","../../../projects/com/components/checkbox/ngx-com-components-checkbox.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\n/** Checkbox size variants. */\nexport type CheckboxSize = 'sm' | 'md' | 'lg';\n\n/** Checkbox color variants. */\nexport type CheckboxVariant = 'primary' | 'accent' | 'warn';\n\n/**\n * CVA variants for the visual checkbox box.\n *\n * Uses `peer` selectors to style based on native input state:\n * - `peer-checked:` for checked state\n * - `peer-indeterminate:` for indeterminate state\n * - `peer-focus-visible:` for keyboard focus\n * - `peer-disabled:` for disabled state\n *\n * @tokens `--color-border`, `--color-primary`, `--color-primary-foreground`, `--color-primary-hover`,\n * `--color-accent`, `--color-accent-foreground`, `--color-accent-hover`,\n * `--color-warn`, `--color-warn-foreground`, `--color-warn-hover`,\n * `--color-disabled`, `--color-disabled-foreground`, `--color-ring`, `--radius-interactive-sm`\n */\nexport const checkboxBoxVariants: (props?: {\n variant?: CheckboxVariant;\n size?: CheckboxSize;\n}) => string = cva(\n [\n 'com-checkbox__box',\n 'inline-flex shrink-0 items-center justify-center',\n 'rounded-interactive-sm border-2 border-border',\n 'transition-colors duration-150',\n 'peer-focus-visible:outline-[1px] peer-focus-visible:outline-offset-2 peer-focus-visible:outline-ring',\n 'peer-disabled:cursor-not-allowed peer-disabled:border-disabled peer-disabled:bg-disabled peer-disabled:text-disabled-foreground',\n ],\n {\n variants: {\n variant: {\n primary: [\n 'peer-checked:border-primary peer-checked:bg-primary peer-checked:text-primary-foreground',\n 'peer-indeterminate:border-primary peer-indeterminate:bg-primary peer-indeterminate:text-primary-foreground',\n 'group-hover:border-primary-hover',\n 'peer-checked:group-hover:bg-primary-hover peer-checked:group-hover:border-primary-hover',\n 'peer-indeterminate:group-hover:bg-primary-hover peer-indeterminate:group-hover:border-primary-hover',\n ],\n accent: [\n 'peer-checked:border-accent peer-checked:bg-accent peer-checked:text-accent-foreground',\n 'peer-indeterminate:border-accent peer-indeterminate:bg-accent peer-indeterminate:text-accent-foreground',\n 'group-hover:border-accent-hover',\n 'peer-checked:group-hover:bg-accent-hover peer-checked:group-hover:border-accent-hover',\n 'peer-indeterminate:group-hover:bg-accent-hover peer-indeterminate:group-hover:border-accent-hover',\n ],\n warn: [\n 'peer-checked:border-warn peer-checked:bg-warn peer-checked:text-warn-foreground',\n 'peer-indeterminate:border-warn peer-indeterminate:bg-warn peer-indeterminate:text-warn-foreground',\n 'group-hover:border-warn-hover',\n 'peer-checked:group-hover:bg-warn-hover peer-checked:group-hover:border-warn-hover',\n 'peer-indeterminate:group-hover:bg-warn-hover peer-indeterminate:group-hover:border-warn-hover',\n ],\n },\n size: {\n sm: 'size-4',\n md: 'size-5',\n lg: 'size-6',\n },\n },\n defaultVariants: {\n variant: 'primary',\n size: 'md',\n },\n }\n);\n\n/** Size-based classes for the checkmark SVG icon. */\nexport const CHECKBOX_ICON_SIZES: Record<CheckboxSize, string> = {\n sm: 'size-3',\n md: 'size-3.5',\n lg: 'size-4',\n};\n\n/** Size-based classes for the label content. */\nexport const CHECKBOX_LABEL_SIZES: Record<CheckboxSize, string> = {\n sm: 'text-sm ms-2',\n md: 'text-base ms-2.5',\n lg: 'text-lg ms-3',\n};\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n input,\n model,\n output,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport type {\n InputSignal,\n ModelSignal,\n OutputEmitterRef,\n Signal,\n} from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport type { ControlValueAccessor } from '@angular/forms';\nimport {\n checkboxBoxVariants,\n CHECKBOX_ICON_SIZES,\n CHECKBOX_LABEL_SIZES,\n} from './checkbox.variants';\nimport type { CheckboxSize, CheckboxVariant } from './checkbox.variants';\n\n/** Event emitted when checkbox state changes. */\nexport interface CheckboxChange {\n checked: boolean;\n source: ComCheckbox;\n}\n\n/** Auto-incrementing ID counter for unique checkbox IDs. */\nlet nextId = 0;\n\n/**\n * Production-grade checkbox component with full accessibility support.\n *\n * Uses a native `<input type=\"checkbox\">` for built-in keyboard handling,\n * `:checked` and `:indeterminate` pseudo-classes, and screen reader support.\n *\n * Implements `ControlValueAccessor` for Reactive Forms integration via\n * `NgControl` injection pattern (no `NG_VALUE_ACCESSOR` provider).\n *\n * @tokens `--color-border`, `--color-primary`, `--color-primary-foreground`, `--color-primary-hover`,\n * `--color-accent`, `--color-accent-foreground`, `--color-accent-hover`,\n * `--color-warn`, `--color-warn-foreground`, `--color-warn-hover`,\n * `--color-disabled`, `--color-disabled-foreground`, `--color-ring`\n *\n * @example Basic usage\n * ```html\n * <com-checkbox [(checked)]=\"isActive\">Enable feature</com-checkbox>\n * ```\n *\n * @example With reactive forms\n * ```html\n * <com-checkbox formControlName=\"acceptTerms\">\n * I accept the <a href=\"/terms\">terms and conditions</a>\n * </com-checkbox>\n * ```\n *\n * @example Indeterminate state\n * ```html\n * <com-checkbox [(indeterminate)]=\"hasPartialSelection\" (changed)=\"onSelectAll($event)\">\n * Select all\n * </com-checkbox>\n * ```\n *\n * @example Variants and sizes\n * ```html\n * <com-checkbox variant=\"accent\" size=\"lg\">Large accent checkbox</com-checkbox>\n * <com-checkbox variant=\"warn\" size=\"sm\">Small warning checkbox</com-checkbox>\n * ```\n */\n@Component({\n selector: 'com-checkbox',\n exportAs: 'comCheckbox',\n template: `\n <label\n class=\"group relative inline-flex items-center\"\n [class.cursor-pointer]=\"!disabled()\"\n [class.cursor-not-allowed]=\"disabled()\"\n >\n <span><input\n #inputElement\n type=\"checkbox\"\n class=\"peer sr-only\"\n [id]=\"inputId()\"\n [checked]=\"checked()\"\n [disabled]=\"disabled()\"\n [attr.name]=\"name()\"\n [attr.value]=\"htmlValue()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onBlur()\"\n /></span>\n <span [class]=\"boxClasses()\">\n @if (checked() && !indeterminate()) {\n <svg\n class=\"pointer-events-none\"\n [class]=\"iconSizeClass()\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <polyline points=\"4 12 9 17 20 6\" />\n </svg>\n }\n @if (indeterminate()) {\n <svg\n class=\"pointer-events-none\"\n [class]=\"iconSizeClass()\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\" />\n </svg>\n }\n </span>\n <span\n class=\"com-checkbox__label select-none peer-disabled:cursor-not-allowed peer-disabled:text-disabled-foreground\"\n [class]=\"labelSizeClass()\"\n >\n <ng-content />\n </span>\n </label>\n `,\n styles: `\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'com-checkbox inline-block align-middle',\n '[class.com-checkbox--disabled]': 'disabled()',\n '[class.com-checkbox--checked]': 'checked()',\n '[class.com-checkbox--indeterminate]': 'indeterminate()',\n },\n})\nexport class ComCheckbox implements ControlValueAccessor {\n /** Optional NgControl for reactive forms integration. */\n readonly ngControl: NgControl | null = inject(NgControl, { optional: true, self: true });\n\n /** Reference to the native input element. */\n readonly inputRef: Signal<ElementRef<HTMLInputElement> | undefined> =\n viewChild<ElementRef<HTMLInputElement>>('inputElement');\n\n /** Unique ID for this checkbox instance. */\n private readonly uniqueId: string = `com-checkbox-${nextId++}`;\n\n // Inputs\n readonly size: InputSignal<CheckboxSize> = input<CheckboxSize>('md');\n readonly variant: InputSignal<CheckboxVariant> = input<CheckboxVariant>('primary');\n readonly checked: ModelSignal<boolean> = model<boolean>(false);\n readonly indeterminate: ModelSignal<boolean> = model<boolean>(false);\n readonly disabled: ModelSignal<boolean> = model<boolean>(false);\n readonly htmlValue: InputSignal<string | undefined> = input<string | undefined>(undefined, { alias: 'value' });\n readonly name: InputSignal<string | undefined> = input<string>();\n\n // Signal Forms inputs — set automatically by [formField] via setInputOnDirectives\n readonly touched: ModelSignal<boolean> = model<boolean>(false);\n readonly invalid: InputSignal<boolean> = input<boolean>(false);\n readonly sfErrors: InputSignal<readonly unknown[]> = input<readonly unknown[]>([], { alias: 'errors' });\n readonly sfRequired: InputSignal<boolean> = input<boolean>(false, { alias: 'required' });\n readonly id: InputSignal<string | undefined> = input<string>();\n readonly ariaLabel: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-label' });\n readonly ariaLabelledby: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-labelledby' });\n readonly ariaDescribedby: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-describedby' });\n\n // Outputs\n readonly changed: OutputEmitterRef<CheckboxChange> = output<CheckboxChange>();\n\n // Computed state\n readonly inputId: Signal<string> = computed(() => this.id() ?? this.uniqueId);\n\n protected readonly boxClasses: Signal<string> = computed(() =>\n checkboxBoxVariants({ variant: this.variant(), size: this.size() })\n );\n\n protected readonly iconSizeClass: Signal<string> = computed(() => CHECKBOX_ICON_SIZES[this.size()]);\n protected readonly labelSizeClass: Signal<string> = computed(() => CHECKBOX_LABEL_SIZES[this.size()]);\n\n // CVA callbacks\n private onChange: (value: boolean) => void = () => {};\n protected onTouched: () => void = () => {};\n\n constructor() {\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n\n // Sync indeterminate state to DOM (needed because [indeterminate] is a property, not attribute)\n effect(() => {\n const isIndeterminate = this.indeterminate();\n const inputEl = this.inputRef()?.nativeElement;\n if (inputEl) {\n inputEl.indeterminate = isIndeterminate;\n }\n });\n }\n\n // ControlValueAccessor implementation\n writeValue(value: boolean): void {\n this.checked.set(value ?? false);\n }\n\n registerOnChange(fn: (value: boolean) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled.set(isDisabled);\n }\n\n // Event handlers\n protected onBlur(): void {\n this.onTouched();\n this.touched.set(true);\n }\n\n protected onInputChange(event: Event): void {\n const input = event.target as HTMLInputElement;\n const newChecked = input.checked;\n\n // Clear indeterminate on user interaction\n if (this.indeterminate()) {\n this.indeterminate.set(false);\n input.indeterminate = false;\n }\n\n this.checked.set(newChecked);\n this.onChange(newChecked);\n this.changed.emit({ checked: newChecked, source: this });\n }\n\n // Public API\n /** Focuses this checkbox's input element. */\n focus(): void {\n this.inputRef()?.nativeElement.focus();\n }\n\n /** Toggles the checkbox state programmatically. */\n toggle(): void {\n if (this.disabled()) {\n return;\n }\n\n const newChecked = !this.checked();\n this.checked.set(newChecked);\n this.indeterminate.set(false);\n this.onChange(newChecked);\n this.changed.emit({ checked: newChecked, source: this });\n }\n}\n","// Public API for the checkbox component\n\n// Main component\nexport { ComCheckbox } from './checkbox.component';\n\n// Types\nexport type { CheckboxChange } from './checkbox.component';\n\n// Variants (for advanced customization)\nexport {\n checkboxBoxVariants,\n CHECKBOX_ICON_SIZES,\n CHECKBOX_LABEL_SIZES,\n} from './checkbox.variants';\n\nexport type { CheckboxSize, CheckboxVariant } from './checkbox.variants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAQA;;;;;;;;;;;;;AAaG;AACI,MAAM,mBAAmB,GAGjB,GAAG,CAChB;IACE,mBAAmB;IACnB,kDAAkD;IAClD,+CAA+C;IAC/C,gCAAgC;IAChC,sGAAsG;IACtG,iIAAiI;CAClI,EACD;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE;gBACP,0FAA0F;gBAC1F,4GAA4G;gBAC5G,kCAAkC;gBAClC,yFAAyF;gBACzF,qGAAqG;AACtG,aAAA;AACD,YAAA,MAAM,EAAE;gBACN,uFAAuF;gBACvF,yGAAyG;gBACzG,iCAAiC;gBACjC,uFAAuF;gBACvF,mGAAmG;AACpG,aAAA;AACD,YAAA,IAAI,EAAE;gBACJ,iFAAiF;gBACjF,mGAAmG;gBACnG,+BAA+B;gBAC/B,mFAAmF;gBACnF,+FAA+F;AAChG,aAAA;AACF,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,EAAE,EAAE,QAAQ;AACZ,YAAA,EAAE,EAAE,QAAQ;AACZ,YAAA,EAAE,EAAE,QAAQ;AACb,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,IAAI,EAAE,IAAI;AACX,KAAA;AACF,CAAA;AAGH;AACO,MAAM,mBAAmB,GAAiC;AAC/D,IAAA,EAAE,EAAE,QAAQ;AACZ,IAAA,EAAE,EAAE,UAAU;AACd,IAAA,EAAE,EAAE,QAAQ;;AAGd;AACO,MAAM,oBAAoB,GAAiC;AAChE,IAAA,EAAE,EAAE,cAAc;AAClB,IAAA,EAAE,EAAE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ACzK1D;AAEA;;ACFA;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { viewChild, input, output, computed, ChangeDetectionStrategy, Component, inject, DestroyRef, signal, TemplateRef, Directive, ElementRef, ViewContainerRef, contentChild, linkedSignal, forwardRef } from '@angular/core';
|
|
2
|
+
import { viewChild, input, output, computed, ChangeDetectionStrategy, Component, inject, DestroyRef, signal, TemplateRef, Directive, ElementRef, ViewContainerRef, contentChild, model, linkedSignal, forwardRef } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
4
|
import { NgTemplateOutlet } from '@angular/common';
|
|
5
5
|
import { NgForm, FormGroupDirective, NgControl } from '@angular/forms';
|
|
@@ -1602,7 +1602,7 @@ class ComDropdown {
|
|
|
1602
1602
|
/** Array of options to display. */
|
|
1603
1603
|
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
1604
1604
|
/** Current value (single or array for multiple). */
|
|
1605
|
-
value =
|
|
1605
|
+
value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
1606
1606
|
/** Placeholder text when no value is selected. */
|
|
1607
1607
|
placeholder = input('Select...', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
1608
1608
|
/** Enable multi-select mode. */
|
|
@@ -1647,9 +1647,11 @@ class ComDropdown {
|
|
|
1647
1647
|
maxVisibleTags = input(2, ...(ngDevMode ? [{ debugName: "maxVisibleTags" }] : []));
|
|
1648
1648
|
/** Custom error state matcher for determining when to show errors. */
|
|
1649
1649
|
errorStateMatcher = input(...(ngDevMode ? [undefined, { debugName: "errorStateMatcher" }] : []));
|
|
1650
|
+
// Signal Forms inputs — set automatically by [formField] via setInputOnDirectives
|
|
1651
|
+
touched = model(false, ...(ngDevMode ? [{ debugName: "touched" }] : []));
|
|
1652
|
+
invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : []));
|
|
1653
|
+
sfErrors = input([], { ...(ngDevMode ? { debugName: "sfErrors" } : {}), alias: 'errors' });
|
|
1650
1654
|
// ============ OUTPUTS ============
|
|
1651
|
-
/** Emitted when the value changes. */
|
|
1652
|
-
valueChange = output();
|
|
1653
1655
|
/** Emitted when search query changes. */
|
|
1654
1656
|
searchChange = output();
|
|
1655
1657
|
/** Emitted when panel opens. */
|
|
@@ -1697,13 +1699,19 @@ class ComDropdown {
|
|
|
1697
1699
|
shouldLabelFloat = computed(() => this.focused() || this.hasValue(), ...(ngDevMode ? [{ debugName: "shouldLabelFloat" }] : []));
|
|
1698
1700
|
/** Whether the control is in an error state. Implements FormFieldControl. */
|
|
1699
1701
|
errorState = computed(() => {
|
|
1700
|
-
|
|
1702
|
+
if (!this.ngControl) {
|
|
1703
|
+
// Signal Forms: gate on invalid AND touched (mirrors ErrorStateMatcher default)
|
|
1704
|
+
return this.invalid() && this.touched();
|
|
1705
|
+
}
|
|
1706
|
+
// Reactive Forms: use ErrorStateMatcher (existing logic)
|
|
1701
1707
|
this.isOpen();
|
|
1702
1708
|
this.hasValue();
|
|
1703
1709
|
const matcher = this.errorStateMatcher() ?? this.defaultErrorStateMatcher;
|
|
1704
1710
|
const form = this.parentFormGroup ?? this.parentForm;
|
|
1705
|
-
return matcher.isErrorState(this.ngControl
|
|
1711
|
+
return matcher.isErrorState(this.ngControl.control ?? null, form);
|
|
1706
1712
|
}, ...(ngDevMode ? [{ debugName: "errorState" }] : []));
|
|
1713
|
+
/** Structured validation errors from Signal Forms, exposed for the parent form field. */
|
|
1714
|
+
errors = computed(() => !this.ngControl ? this.sfErrors() : null, ...(ngDevMode ? [{ debugName: "errors" }] : []));
|
|
1707
1715
|
/** Unique ID for the control. Implements FormFieldControl. */
|
|
1708
1716
|
id = this.triggerId;
|
|
1709
1717
|
/**
|
|
@@ -1932,6 +1940,7 @@ class ComDropdown {
|
|
|
1932
1940
|
this.activeOptionId.set(null);
|
|
1933
1941
|
this.closed.emit();
|
|
1934
1942
|
this.onTouched();
|
|
1943
|
+
this.touched.set(true);
|
|
1935
1944
|
}
|
|
1936
1945
|
/** Toggles the dropdown panel. */
|
|
1937
1946
|
toggle() {
|
|
@@ -2168,9 +2177,8 @@ class ComDropdown {
|
|
|
2168
2177
|
return { width: config };
|
|
2169
2178
|
}
|
|
2170
2179
|
updateValue(value) {
|
|
2171
|
-
this.
|
|
2180
|
+
this.value.set(value);
|
|
2172
2181
|
this.onChange(value);
|
|
2173
|
-
this.valueChange.emit(value);
|
|
2174
2182
|
// Announce selection
|
|
2175
2183
|
if (value !== null && !Array.isArray(value)) {
|
|
2176
2184
|
this.announce(`${this.displayWith()(value)} selected`);
|
|
@@ -2272,7 +2280,7 @@ class ComDropdown {
|
|
|
2272
2280
|
this.liveAnnouncer.announce(message, 'polite');
|
|
2273
2281
|
}
|
|
2274
2282
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ComDropdown, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2275
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: ComDropdown, isStandalone: true, selector: "com-dropdown", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null }, displayWith: { classPropertyName: "displayWith", publicName: "displayWith", isSignal: true, isRequired: false, transformFunction: null }, filterWith: { classPropertyName: "filterWith", publicName: "filterWith", isSignal: true, isRequired: false, transformFunction: null }, groupBy: { classPropertyName: "groupBy", publicName: "groupBy", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, panelClass: { classPropertyName: "panelClass", publicName: "panelClass", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, panelWidth: { classPropertyName: "panelWidth", publicName: "panelWidth", isSignal: true, isRequired: false, transformFunction: null }, searchDebounceMs: { classPropertyName: "searchDebounceMs", publicName: "searchDebounceMs", isSignal: true, isRequired: false, transformFunction: null }, virtualScrollThreshold: { classPropertyName: "virtualScrollThreshold", publicName: "virtualScrollThreshold", isSignal: true, isRequired: false, transformFunction: null }, maxVisibleTags: { classPropertyName: "maxVisibleTags", publicName: "maxVisibleTags", isSignal: true, isRequired: false, transformFunction: null }, errorStateMatcher: { classPropertyName: "errorStateMatcher", publicName: "errorStateMatcher", isSignal: true, isRequired: false, transformFunction: null } }, outputs: {
|
|
2283
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: ComDropdown, isStandalone: true, selector: "com-dropdown", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null }, displayWith: { classPropertyName: "displayWith", publicName: "displayWith", isSignal: true, isRequired: false, transformFunction: null }, filterWith: { classPropertyName: "filterWith", publicName: "filterWith", isSignal: true, isRequired: false, transformFunction: null }, groupBy: { classPropertyName: "groupBy", publicName: "groupBy", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, panelClass: { classPropertyName: "panelClass", publicName: "panelClass", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, panelWidth: { classPropertyName: "panelWidth", publicName: "panelWidth", isSignal: true, isRequired: false, transformFunction: null }, searchDebounceMs: { classPropertyName: "searchDebounceMs", publicName: "searchDebounceMs", isSignal: true, isRequired: false, transformFunction: null }, virtualScrollThreshold: { classPropertyName: "virtualScrollThreshold", publicName: "virtualScrollThreshold", isSignal: true, isRequired: false, transformFunction: null }, maxVisibleTags: { classPropertyName: "maxVisibleTags", publicName: "maxVisibleTags", isSignal: true, isRequired: false, transformFunction: null }, errorStateMatcher: { classPropertyName: "errorStateMatcher", publicName: "errorStateMatcher", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, sfErrors: { classPropertyName: "sfErrors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touched: "touchedChange", searchChange: "searchChange", opened: "opened", closed: "closed" }, host: { properties: { "class.com-dropdown-disabled": "disabled()", "class.com-dropdown-open": "isOpen()" }, classAttribute: "com-dropdown-host inline-block" }, providers: [{ provide: FormFieldControl, useExisting: forwardRef(() => ComDropdown) }], queries: [{ propertyName: "optionTemplate", first: true, predicate: (ComDropdownOptionTpl), descendants: true, isSignal: true }, { propertyName: "selectedTemplate", first: true, predicate: (ComDropdownSelectedTpl), descendants: true, isSignal: true }, { propertyName: "emptyTemplate", first: true, predicate: ComDropdownEmptyTpl, descendants: true, isSignal: true }, { propertyName: "groupTemplate", first: true, predicate: ComDropdownGroupTpl, descendants: true, isSignal: true }, { propertyName: "tagTemplate", first: true, predicate: (ComDropdownTagTpl), descendants: true, isSignal: true }], viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["triggerElement"], descendants: true, isSignal: true }, { propertyName: "panelTemplateRef", first: true, predicate: ["panelTemplate"], descendants: true, isSignal: true }], exportAs: ["comDropdown"], ngImport: i0, template: `
|
|
2276
2284
|
<!-- Trigger button -->
|
|
2277
2285
|
<button
|
|
2278
2286
|
#triggerElement
|
|
@@ -2678,7 +2686,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
2678
2686
|
'[class.com-dropdown-disabled]': 'disabled()',
|
|
2679
2687
|
'[class.com-dropdown-open]': 'isOpen()',
|
|
2680
2688
|
}, styles: [".sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}\n"] }]
|
|
2681
|
-
}], ctorParameters: () => [], propDecorators: { triggerRef: [{ type: i0.ViewChild, args: ['triggerElement', { isSignal: true }] }], panelTemplateRef: [{ type: i0.ViewChild, args: ['panelTemplate', { isSignal: true }] }], optionTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ComDropdownOptionTpl), { isSignal: true }] }], selectedTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ComDropdownSelectedTpl), { isSignal: true }] }], emptyTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ComDropdownEmptyTpl), { isSignal: true }] }], groupTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ComDropdownGroupTpl), { isSignal: true }] }], tagTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ComDropdownTagTpl), { isSignal: true }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], compareWith: [{ type: i0.Input, args: [{ isSignal: true, alias: "compareWith", required: false }] }], displayWith: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayWith", required: false }] }], filterWith: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterWith", required: false }] }], groupBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupBy", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], panelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelClass", required: false }] }], maxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxHeight", required: false }] }], panelWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelWidth", required: false }] }], searchDebounceMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchDebounceMs", required: false }] }], virtualScrollThreshold: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScrollThreshold", required: false }] }], maxVisibleTags: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxVisibleTags", required: false }] }], errorStateMatcher: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorStateMatcher", required: false }] }],
|
|
2689
|
+
}], ctorParameters: () => [], propDecorators: { triggerRef: [{ type: i0.ViewChild, args: ['triggerElement', { isSignal: true }] }], panelTemplateRef: [{ type: i0.ViewChild, args: ['panelTemplate', { isSignal: true }] }], optionTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ComDropdownOptionTpl), { isSignal: true }] }], selectedTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ComDropdownSelectedTpl), { isSignal: true }] }], emptyTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ComDropdownEmptyTpl), { isSignal: true }] }], groupTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ComDropdownGroupTpl), { isSignal: true }] }], tagTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ComDropdownTagTpl), { isSignal: true }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], compareWith: [{ type: i0.Input, args: [{ isSignal: true, alias: "compareWith", required: false }] }], displayWith: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayWith", required: false }] }], filterWith: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterWith", required: false }] }], groupBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupBy", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], panelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelClass", required: false }] }], maxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxHeight", required: false }] }], panelWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelWidth", required: false }] }], searchDebounceMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchDebounceMs", required: false }] }], virtualScrollThreshold: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScrollThreshold", required: false }] }], maxVisibleTags: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxVisibleTags", required: false }] }], errorStateMatcher: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorStateMatcher", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], sfErrors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], searchChange: [{ type: i0.Output, args: ["searchChange"] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
2682
2690
|
|
|
2683
2691
|
// Public API for the dropdown component
|
|
2684
2692
|
// Main component
|