@masterteam/components 0.0.185 → 0.0.186
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/README.md +70 -63
- package/assets/common.css +243 -2
- package/fesm2022/masterteam-components-table.mjs +1 -0
- package/fesm2022/masterteam-components-table.mjs.map +1 -1
- package/fesm2022/masterteam-components-text-field.mjs +8 -3
- package/fesm2022/masterteam-components-text-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-user-search-field.mjs +27 -6
- package/fesm2022/masterteam-components-user-search-field.mjs.map +1 -1
- package/package.json +2 -2
- package/types/masterteam-components-user-search-field.d.ts +3 -0
- package/fesm2022/masterteam-components-color-picker-field.mjs +0 -102
- package/fesm2022/masterteam-components-color-picker-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-drawer.mjs +0 -261
- package/fesm2022/masterteam-components-drawer.mjs.map +0 -1
- package/fesm2022/masterteam-components-editor-field.mjs +0 -99
- package/fesm2022/masterteam-components-editor-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-formula.mjs +0 -3618
- package/fesm2022/masterteam-components-formula.mjs.map +0 -1
- package/fesm2022/masterteam-components-icon-field.mjs +0 -161
- package/fesm2022/masterteam-components-icon-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-list.mjs +0 -31
- package/fesm2022/masterteam-components-list.mjs.map +0 -1
- package/fesm2022/masterteam-components-location-field.mjs +0 -315
- package/fesm2022/masterteam-components-location-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-menu.mjs +0 -135
- package/fesm2022/masterteam-components-menu.mjs.map +0 -1
- package/fesm2022/masterteam-components-module-summary-card.mjs +0 -34
- package/fesm2022/masterteam-components-module-summary-card.mjs.map +0 -1
- package/fesm2022/masterteam-components-page-header.mjs +0 -42
- package/fesm2022/masterteam-components-page-header.mjs.map +0 -1
- package/fesm2022/masterteam-components-page.mjs +0 -35
- package/fesm2022/masterteam-components-page.mjs.map +0 -1
- package/fesm2022/masterteam-components-pick-list-field.mjs +0 -206
- package/fesm2022/masterteam-components-pick-list-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-property-filter-builder.mjs +0 -386
- package/fesm2022/masterteam-components-property-filter-builder.mjs.map +0 -1
- package/fesm2022/masterteam-components-radio-button-field.mjs +0 -85
- package/fesm2022/masterteam-components-radio-button-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-radio-cards-field.mjs +0 -126
- package/fesm2022/masterteam-components-radio-cards-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-radio-cards.mjs +0 -74
- package/fesm2022/masterteam-components-radio-cards.mjs.map +0 -1
- package/fesm2022/masterteam-components-runtime-action.mjs +0 -406
- package/fesm2022/masterteam-components-runtime-action.mjs.map +0 -1
- package/fesm2022/masterteam-components-sidebar.mjs +0 -37
- package/fesm2022/masterteam-components-sidebar.mjs.map +0 -1
- package/fesm2022/masterteam-components-slider-field.mjs +0 -115
- package/fesm2022/masterteam-components-slider-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-statistic-card.mjs +0 -22
- package/fesm2022/masterteam-components-statistic-card.mjs.map +0 -1
- package/fesm2022/masterteam-components-textarea-field.mjs +0 -122
- package/fesm2022/masterteam-components-textarea-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-toast.mjs +0 -80
- package/fesm2022/masterteam-components-toast.mjs.map +0 -1
- package/fesm2022/masterteam-components-topbar.mjs +0 -32
- package/fesm2022/masterteam-components-topbar.mjs.map +0 -1
- package/fesm2022/masterteam-components-tree.mjs +0 -260
- package/fesm2022/masterteam-components-tree.mjs.map +0 -1
- package/types/masterteam-components-color-picker-field.d.ts +0 -35
- package/types/masterteam-components-drawer.d.ts +0 -61
- package/types/masterteam-components-editor-field.d.ts +0 -35
- package/types/masterteam-components-formula.d.ts +0 -734
- package/types/masterteam-components-icon-field.d.ts +0 -40
- package/types/masterteam-components-list.d.ts +0 -18
- package/types/masterteam-components-location-field.d.ts +0 -95
- package/types/masterteam-components-menu.d.ts +0 -55
- package/types/masterteam-components-module-summary-card.d.ts +0 -18
- package/types/masterteam-components-page-header.d.ts +0 -30
- package/types/masterteam-components-page.d.ts +0 -26
- package/types/masterteam-components-pick-list-field.d.ts +0 -61
- package/types/masterteam-components-property-filter-builder.d.ts +0 -90
- package/types/masterteam-components-radio-button-field.d.ts +0 -41
- package/types/masterteam-components-radio-cards-field.d.ts +0 -35
- package/types/masterteam-components-radio-cards.d.ts +0 -33
- package/types/masterteam-components-runtime-action.d.ts +0 -105
- package/types/masterteam-components-sidebar.d.ts +0 -28
- package/types/masterteam-components-slider-field.d.ts +0 -38
- package/types/masterteam-components-statistic-card.d.ts +0 -18
- package/types/masterteam-components-textarea-field.d.ts +0 -41
- package/types/masterteam-components-toast.d.ts +0 -27
- package/types/masterteam-components-topbar.d.ts +0 -20
- package/types/masterteam-components-tree.d.ts +0 -106
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"masterteam-components-radio-button-field.mjs","sources":["../../../../packages/masterteam/components/radio-button-field/radio-button-field.ts","../../../../packages/masterteam/components/radio-button-field/radio-button-field.html","../../../../packages/masterteam/components/radio-button-field/masterteam-components-radio-button-field.ts"],"sourcesContent":["import {\r\n Component,\r\n signal,\r\n input,\r\n output,\r\n inject,\r\n ChangeDetectionStrategy,\r\n computed,\r\n effect,\r\n} from '@angular/core';\r\nimport {\r\n ControlValueAccessor,\r\n FormsModule,\r\n NgControl,\r\n Validators,\r\n} from '@angular/forms';\r\nimport { RadioButton, RadioButtonModule } from 'primeng/radiobutton';\r\nimport { FieldValidation } from '@masterteam/components/field-validation';\r\nimport { isInvalid } from '@masterteam/components';\r\n\r\nexport interface radioOptions {\r\n label: string;\r\n value: string;\r\n}\r\n\r\n@Component({\r\n selector: 'mt-radio-button-field',\r\n standalone: true,\r\n imports: [FormsModule, RadioButtonModule, FieldValidation],\r\n templateUrl: './radio-button-field.html',\r\n styleUrls: ['./radio-button-field.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n class: 'grid gap-1',\r\n },\r\n})\r\nexport class RadioButtonField implements ControlValueAccessor {\r\n radioButton: RadioButton;\r\n labelPosition = input<'top' | 'start' | 'end' | 'bottom'>('end');\r\n orientation = input<'vertical' | 'horizontal'>('vertical');\r\n readonly = input<boolean>(false);\r\n pInputs = input<Partial<RadioButton>>();\r\n required = input<boolean>(false);\r\n options = input<radioOptions[]>([]);\r\n size = input<'small' | 'large' | undefined>();\r\n label = input<string>();\r\n onChange = output<string>();\r\n\r\n public ngControl = inject(NgControl, { self: true });\r\n\r\n isInvalid = isInvalid;\r\n\r\n isVertical = computed(\r\n () => this.labelPosition() === 'top' || this.labelPosition() === 'bottom',\r\n );\r\n\r\n requiredValidator = Validators.required;\r\n value = signal<string | null>(null);\r\n disabled = signal<boolean>(false);\r\n\r\n onTouched: () => void = () => {};\r\n onModelChange: (value: string | null) => void = () => {};\r\n\r\n constructor() {\r\n if (this.ngControl) {\r\n this.ngControl.valueAccessor = this;\r\n }\r\n\r\n // Effect to apply pInputs reactively when the pInputs signal changes\r\n effect(() => {\r\n const currentPInputs = this.pInputs();\r\n\r\n if (this.radioButton && currentPInputs) {\r\n this.applyInputsToRadioButton();\r\n }\r\n });\r\n\r\n // Effect to add required validator if required input is true\r\n effect(() => {\r\n if (this.ngControl?.control && this.required()) {\r\n this.ngControl.control.addValidators(Validators.required);\r\n this.ngControl.control.updateValueAndValidity();\r\n }\r\n });\r\n }\r\n\r\n applyInputsToRadioButton() {\r\n const currentPInputs = this.pInputs();\r\n if (currentPInputs) {\r\n Object.assign(this.radioButton, currentPInputs);\r\n }\r\n }\r\n\r\n onValueChange(value: string | null) {\r\n this.onModelChange(value);\r\n this.value.set(value);\r\n }\r\n\r\n writeValue(value: string | null) {\r\n this.value.set(value);\r\n }\r\n\r\n registerOnChange(fn: any) {\r\n this.onModelChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: any) {\r\n this.onTouched = fn;\r\n }\r\n\r\n setDisabledState(disabled: boolean) {\r\n this.disabled.set(disabled);\r\n }\r\n}\r\n","@if (label()) {\r\n <label\r\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\r\n >{{ label() }}</label\r\n >\r\n}\r\n\r\n<div\r\n class=\"flex gap-3\"\r\n [class.flex-col]=\"orientation() === 'vertical'\"\r\n [class.flex-row]=\"orientation() === 'horizontal'\"\r\n [class.flex-wrap]=\"orientation() === 'horizontal'\"\r\n>\r\n @for (option of options(); track option) {\r\n <div\r\n class=\"flex gap-1\"\r\n [class.items-center]=\"!isVertical()\"\r\n [class.gap-2]=\"!isVertical()\"\r\n [class.flex-col]=\"isVertical()\"\r\n [class.flex-col-reverse]=\"labelPosition() === 'top'\"\r\n [class.flex-row-reverse]=\"labelPosition() === 'start'\"\r\n [class.justify-end]=\"labelPosition() === 'start'\"\r\n >\r\n <p-radiobutton\r\n [size]=\"size()\"\r\n #radiobutton\r\n [ngModel]=\"value()\"\r\n [value]=\"option.value\"\r\n [inputId]=\"option?.label\"\r\n (ngModelChange)=\"onValueChange($event)\"\r\n (onClick)=\"onChange.emit($event)\"\r\n (onBlur)=\"onTouched()\"\r\n [disabled]=\"disabled() || readonly()\"\r\n [invalid]=\"isInvalid(ngControl?.control)\"\r\n class=\"leading-none\"\r\n ></p-radiobutton>\r\n\r\n @if (option?.label) {\r\n <label [for]=\"option?.label\">{{ option?.label }}</label>\r\n }\r\n </div>\r\n }\r\n</div>\r\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MAoCa,gBAAgB,CAAA;AAC3B,IAAA,WAAW;AACX,IAAA,aAAa,GAAG,KAAK,CAAqC,KAAK,oFAAC;AAChE,IAAA,WAAW,GAAG,KAAK,CAA4B,UAAU,kFAAC;AAC1D,IAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,+EAAC;IAChC,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EA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AgB,6qCCpC7B,g+CA4CA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDhBY,WAAW,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,2CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,qDAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,SAAA,EAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,iBAAiB,kTAAE,eAAe,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAQ9C,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAX5B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,uBAAuB,EAAA,UAAA,EACrB,IAAI,EAAA,OAAA,EACP,CAAC,WAAW,EAAE,iBAAiB,EAAE,eAAe,CAAC,EAAA,eAAA,EAGzC,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,KAAK,EAAE,YAAY;AACpB,qBAAA,EAAA,QAAA,EAAA,g+CAAA,EAAA;;;AElCH;;AAEG;;;;"}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, booleanAttribute, contentChild, TemplateRef, signal, computed, inject, effect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { Validators, NgControl, FormsModule } from '@angular/forms';
|
|
4
|
-
import { RadioCards } from '@masterteam/components/radio-cards';
|
|
5
|
-
import { FieldValidation } from '@masterteam/components/field-validation';
|
|
6
|
-
import { Tooltip } from '@masterteam/components/tooltip';
|
|
7
|
-
import { Icon } from '@masterteam/icons';
|
|
8
|
-
|
|
9
|
-
class RadioCardsField {
|
|
10
|
-
circle = input(false, { ...(ngDevMode ? { debugName: "circle" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
11
|
-
label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
12
|
-
hint = input(...(ngDevMode ? [undefined, { debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
13
|
-
readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
14
|
-
required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
15
|
-
color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
16
|
-
size = input('medium', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
17
|
-
optionLabel = input('label', ...(ngDevMode ? [{ debugName: "optionLabel" }] : /* istanbul ignore next */ []));
|
|
18
|
-
optionValue = input('value', ...(ngDevMode ? [{ debugName: "optionValue" }] : /* istanbul ignore next */ []));
|
|
19
|
-
options = input.required(...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
20
|
-
itemTemplate = contentChild('option', { ...(ngDevMode ? { debugName: "itemTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
21
|
-
selectedId = signal(null, ...(ngDevMode ? [{ debugName: "selectedId" }] : /* istanbul ignore next */ []));
|
|
22
|
-
isDisabled = signal(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
23
|
-
normalizedOptions = computed(() => this.options()
|
|
24
|
-
.map((option) => normalizeRadioItem(option, this.optionLabel(), this.optionValue()))
|
|
25
|
-
.filter((option) => option !== null), ...(ngDevMode ? [{ debugName: "normalizedOptions" }] : /* istanbul ignore next */ []));
|
|
26
|
-
requiredValidator = Validators.required;
|
|
27
|
-
ngControl = null;
|
|
28
|
-
constructor() {
|
|
29
|
-
try {
|
|
30
|
-
this.ngControl = inject(NgControl, { self: true, optional: true });
|
|
31
|
-
if (this.ngControl) {
|
|
32
|
-
this.ngControl.valueAccessor = this;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
catch (_e) {
|
|
36
|
-
this.ngControl = null;
|
|
37
|
-
}
|
|
38
|
-
effect(() => {
|
|
39
|
-
if (this.ngControl?.control && this.required()) {
|
|
40
|
-
this.ngControl.control.addValidators(Validators.required);
|
|
41
|
-
this.ngControl.control.updateValueAndValidity({ emitEvent: false });
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
// --- CVA Methods ---
|
|
46
|
-
onChange = () => { };
|
|
47
|
-
onTouched = () => { };
|
|
48
|
-
writeValue(value) {
|
|
49
|
-
this.selectedId.set(value ?? null);
|
|
50
|
-
}
|
|
51
|
-
registerOnChange(fn) {
|
|
52
|
-
this.onChange = fn;
|
|
53
|
-
}
|
|
54
|
-
registerOnTouched(fn) {
|
|
55
|
-
this.onTouched = fn;
|
|
56
|
-
}
|
|
57
|
-
setDisabledState(isDisabled) {
|
|
58
|
-
this.isDisabled.set(isDisabled);
|
|
59
|
-
}
|
|
60
|
-
onSelectionChange(selectedItem) {
|
|
61
|
-
if (this.isDisabled() || this.readonly()) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
const newId = selectedItem.id;
|
|
65
|
-
this.selectedId.set(newId);
|
|
66
|
-
const control = this.ngControl?.control;
|
|
67
|
-
if (control) {
|
|
68
|
-
control.setValue(newId);
|
|
69
|
-
control.markAsDirty();
|
|
70
|
-
control.markAsTouched();
|
|
71
|
-
control.updateValueAndValidity({ emitEvent: false });
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
this.onChange(newId);
|
|
75
|
-
this.onTouched();
|
|
76
|
-
}
|
|
77
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: RadioCardsField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
78
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: RadioCardsField, isStandalone: true, selector: "mt-radio-cards-field", inputs: { circle: { classPropertyName: "circle", publicName: "circle", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: false, transformFunction: null }, optionValue: { classPropertyName: "optionValue", publicName: "optionValue", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "grid gap-1" }, providers: [], queries: [{ propertyName: "itemTemplate", first: true, predicate: ["option"], descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "@if (label() || hint()) {\n <div class=\"flex items-center gap-1\">\n @if (label()) {\n <label\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\n [for]=\"ngControl?.name || label()\"\n >{{ label() }}</label\n >\n }\n @if (hint()) {\n <span\n class=\"inline-flex text-surface-400\"\n [mtTooltip]=\"hint()\"\n tooltipPosition=\"top\"\n >\n <mt-icon icon=\"general.help-circle\" />\n </span>\n }\n </div>\n}\n<div\n class=\"relative\"\n [class.opacity-50]=\"isDisabled()\"\n [class.pointer-events-none]=\"isDisabled()\"\n [id]=\"ngControl?.name || label()\"\n>\n <mt-radio-cards\n [options]=\"normalizedOptions()\"\n [activeId]=\"selectedId()\"\n [color]=\"color()\"\n [size]=\"size()\"\n [circle]=\"circle()\"\n (selectionChange)=\"onSelectionChange($event)\"\n [itemTemplate]=\"itemTemplate()\"\n ></mt-radio-cards>\n</div>\n\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: RadioCards, selector: "mt-radio-cards", inputs: ["circle", "color", "size", "columns", "options", "activeId", "itemTemplate"], outputs: ["optionsChange", "activeIdChange", "selectionChange"] }, { kind: "component", type: FieldValidation, selector: "mt-field-validation", inputs: ["control", "touched"] }, { kind: "directive", type: Tooltip, selector: "[mtTooltip]" }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
79
|
-
}
|
|
80
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: RadioCardsField, decorators: [{
|
|
81
|
-
type: Component,
|
|
82
|
-
args: [{ selector: 'mt-radio-cards-field', standalone: true, imports: [FormsModule, RadioCards, FieldValidation, Tooltip, Icon], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
83
|
-
class: 'grid gap-1',
|
|
84
|
-
}, providers: [], template: "@if (label() || hint()) {\n <div class=\"flex items-center gap-1\">\n @if (label()) {\n <label\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\n [for]=\"ngControl?.name || label()\"\n >{{ label() }}</label\n >\n }\n @if (hint()) {\n <span\n class=\"inline-flex text-surface-400\"\n [mtTooltip]=\"hint()\"\n tooltipPosition=\"top\"\n >\n <mt-icon icon=\"general.help-circle\" />\n </span>\n }\n </div>\n}\n<div\n class=\"relative\"\n [class.opacity-50]=\"isDisabled()\"\n [class.pointer-events-none]=\"isDisabled()\"\n [id]=\"ngControl?.name || label()\"\n>\n <mt-radio-cards\n [options]=\"normalizedOptions()\"\n [activeId]=\"selectedId()\"\n [color]=\"color()\"\n [size]=\"size()\"\n [circle]=\"circle()\"\n (selectionChange)=\"onSelectionChange($event)\"\n [itemTemplate]=\"itemTemplate()\"\n ></mt-radio-cards>\n</div>\n\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\n" }]
|
|
85
|
-
}], ctorParameters: () => [], propDecorators: { circle: [{ type: i0.Input, args: [{ isSignal: true, alias: "circle", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], itemTemplate: [{ type: i0.ContentChild, args: ['option', { ...{ read: TemplateRef }, isSignal: true }] }] } });
|
|
86
|
-
function normalizeRadioItem(option, optionLabel, optionValue) {
|
|
87
|
-
if (option === null || option === undefined) {
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
if (typeof option === 'string' || typeof option === 'number') {
|
|
91
|
-
return {
|
|
92
|
-
id: option,
|
|
93
|
-
name: String(option),
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
if (typeof option !== 'object') {
|
|
97
|
-
return null;
|
|
98
|
-
}
|
|
99
|
-
const source = option;
|
|
100
|
-
const id = readRadioItemValue(source, optionValue, ['id', 'value']);
|
|
101
|
-
if (typeof id !== 'string' && typeof id !== 'number') {
|
|
102
|
-
return null;
|
|
103
|
-
}
|
|
104
|
-
const name = readRadioItemValue(source, optionLabel, ['name', 'label']);
|
|
105
|
-
return {
|
|
106
|
-
...source,
|
|
107
|
-
id,
|
|
108
|
-
name: typeof name === 'string' ? name : String(name ?? id),
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
function readRadioItemValue(source, preferredKey, fallbackKeys) {
|
|
112
|
-
const candidateKeys = [preferredKey, ...fallbackKeys].filter(Boolean);
|
|
113
|
-
for (const key of candidateKeys) {
|
|
114
|
-
if (key in source) {
|
|
115
|
-
return source[key];
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
return undefined;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Generated bundle index. Do not edit.
|
|
123
|
-
*/
|
|
124
|
-
|
|
125
|
-
export { RadioCardsField };
|
|
126
|
-
//# sourceMappingURL=masterteam-components-radio-cards-field.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"masterteam-components-radio-cards-field.mjs","sources":["../../../../packages/masterteam/components/radio-cards-field/radio-cards-field.ts","../../../../packages/masterteam/components/radio-cards-field/radio-cards-field.html","../../../../packages/masterteam/components/radio-cards-field/masterteam-components-radio-cards-field.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n input,\n signal,\n TemplateRef,\n contentChild,\n inject,\n booleanAttribute,\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormsModule,\n NgControl,\n Validators,\n} from '@angular/forms';\nimport { RadioCards, RadioItem } from '@masterteam/components/radio-cards';\nimport { FieldValidation } from '@masterteam/components/field-validation';\nimport { Tooltip } from '@masterteam/components/tooltip';\nimport { Icon } from '@masterteam/icons';\n\n@Component({\n selector: 'mt-radio-cards-field',\n standalone: true,\n imports: [FormsModule, RadioCards, FieldValidation, Tooltip, Icon],\n templateUrl: './radio-cards-field.html',\n styleUrl: './radio-cards-field.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'grid gap-1',\n },\n providers: [],\n})\nexport class RadioCardsField implements ControlValueAccessor {\n readonly circle = input<boolean, unknown>(false, {\n transform: booleanAttribute,\n });\n readonly label = input<string>();\n readonly hint = input<string>();\n readonly readonly = input<boolean>(false);\n readonly required = input<boolean>(false);\n readonly color = input<string>('primary');\n readonly size = input<'small' | 'medium' | 'large'>('medium');\n readonly optionLabel = input<string>('label');\n readonly optionValue = input<string>('value');\n readonly options = input.required<unknown[]>();\n readonly itemTemplate = contentChild('option', { read: TemplateRef });\n\n protected selectedId = signal<string | number | null>(null);\n protected isDisabled = signal(false);\n protected readonly normalizedOptions = computed<RadioItem[]>(() =>\n this.options()\n .map((option) =>\n normalizeRadioItem(option, this.optionLabel(), this.optionValue()),\n )\n .filter((option): option is RadioItem => option !== null),\n );\n\n requiredValidator = Validators.required;\n\n public ngControl: NgControl | null = null;\n\n constructor() {\n try {\n this.ngControl = inject(NgControl, { self: true, optional: true });\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n } catch (_e) {\n this.ngControl = null;\n }\n\n effect(() => {\n if (this.ngControl?.control && this.required()) {\n this.ngControl.control.addValidators(Validators.required);\n this.ngControl.control.updateValueAndValidity({ emitEvent: false });\n }\n });\n }\n\n // --- CVA Methods ---\n private onChange: (value: string | number | null) => void = () => {};\n private onTouched: () => void = () => {};\n\n writeValue(value: string | number | null): void {\n this.selectedId.set(value ?? null);\n }\n\n registerOnChange(fn: (value: string | number | null) => 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.isDisabled.set(isDisabled);\n }\n\n onSelectionChange(selectedItem: RadioItem): void {\n if (this.isDisabled() || this.readonly()) {\n return;\n }\n\n const newId = selectedItem.id;\n this.selectedId.set(newId);\n\n const control = this.ngControl?.control;\n if (control) {\n control.setValue(newId);\n control.markAsDirty();\n control.markAsTouched();\n control.updateValueAndValidity({ emitEvent: false });\n return;\n }\n\n this.onChange(newId);\n this.onTouched();\n }\n}\n\nfunction normalizeRadioItem(\n option: unknown,\n optionLabel: string,\n optionValue: string,\n): RadioItem | null {\n if (option === null || option === undefined) {\n return null;\n }\n\n if (typeof option === 'string' || typeof option === 'number') {\n return {\n id: option,\n name: String(option),\n };\n }\n\n if (typeof option !== 'object') {\n return null;\n }\n\n const source = option as Record<string, unknown>;\n const id = readRadioItemValue(source, optionValue, ['id', 'value']);\n if (typeof id !== 'string' && typeof id !== 'number') {\n return null;\n }\n\n const name = readRadioItemValue(source, optionLabel, ['name', 'label']);\n\n return {\n ...source,\n id,\n name: typeof name === 'string' ? name : String(name ?? id),\n };\n}\n\nfunction readRadioItemValue(\n source: Record<string, unknown>,\n preferredKey: string,\n fallbackKeys: string[],\n): unknown {\n const candidateKeys = [preferredKey, ...fallbackKeys].filter(Boolean);\n\n for (const key of candidateKeys) {\n if (key in source) {\n return source[key];\n }\n }\n\n return undefined;\n}\n","@if (label() || hint()) {\n <div class=\"flex items-center gap-1\">\n @if (label()) {\n <label\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\n [for]=\"ngControl?.name || label()\"\n >{{ label() }}</label\n >\n }\n @if (hint()) {\n <span\n class=\"inline-flex text-surface-400\"\n [mtTooltip]=\"hint()\"\n tooltipPosition=\"top\"\n >\n <mt-icon icon=\"general.help-circle\" />\n </span>\n }\n </div>\n}\n<div\n class=\"relative\"\n [class.opacity-50]=\"isDisabled()\"\n [class.pointer-events-none]=\"isDisabled()\"\n [id]=\"ngControl?.name || label()\"\n>\n <mt-radio-cards\n [options]=\"normalizedOptions()\"\n [activeId]=\"selectedId()\"\n [color]=\"color()\"\n [size]=\"size()\"\n [circle]=\"circle()\"\n (selectionChange)=\"onSelectionChange($event)\"\n [itemTemplate]=\"itemTemplate()\"\n ></mt-radio-cards>\n</div>\n\n<mt-field-validation [control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,MAAM,KAAK,QAAQ,EAAE;AAC9B,QAAA,OAAO,IAAI;IACb;IAEA,MAAM,MAAM,GAAG,MAAiC;AAChD,IAAA,MAAM,EAAE,GAAG,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACnE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE;AACpD,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,MAAM,IAAI,GAAG,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEvE,OAAO;AACL,QAAA,GAAG,MAAM;QACT,EAAE;AACF,QAAA,IAAI,EAAE,OAAO,IAAI,KAAK,QAAQ,GAAG,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;KAC3D;AACH;AAEA,SAAS,kBAAkB,CACzB,MAA+B,EAC/B,YAAoB,EACpB,YAAsB,EAAA;AAEtB,IAAA,MAAM,aAAa,GAAG,CAAC,YAAY,EAAE,GAAG,YAAY,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;AAErE,IAAA,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE;AAC/B,QAAA,IAAI,GAAG,IAAI,MAAM,EAAE;AACjB,YAAA,OAAO,MAAM,CAAC,GAAG,CAAC;QACpB;IACF;AAEA,IAAA,OAAO,SAAS;AAClB;;AE7KA;;AAEG;;;;"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, booleanAttribute, computed, model, output, contentChild, TemplateRef, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { Avatar } from '@masterteam/components/avatar';
|
|
4
|
-
import { NgTemplateOutlet } from '@angular/common';
|
|
5
|
-
|
|
6
|
-
class RadioCards {
|
|
7
|
-
circle = input(false, { ...(ngDevMode ? { debugName: "circle" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
8
|
-
color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
9
|
-
size = input('medium', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
10
|
-
/** Number of columns for grid layout. If not set, uses flex wrap. */
|
|
11
|
-
columns = input(null, ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
12
|
-
avatarSize = computed(() => {
|
|
13
|
-
switch (this.size()) {
|
|
14
|
-
case 'small':
|
|
15
|
-
return 'normal';
|
|
16
|
-
case 'medium':
|
|
17
|
-
return 'large';
|
|
18
|
-
case 'large':
|
|
19
|
-
return 'xlarge';
|
|
20
|
-
default:
|
|
21
|
-
return 'normal';
|
|
22
|
-
}
|
|
23
|
-
}, ...(ngDevMode ? [{ debugName: "avatarSize" }] : /* istanbul ignore next */ []));
|
|
24
|
-
options = model.required(...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
25
|
-
activeId = model(...(ngDevMode ? [undefined, { debugName: "activeId" }] : /* istanbul ignore next */ []));
|
|
26
|
-
selectionChange = output();
|
|
27
|
-
itemTemplate = input(null, ...(ngDevMode ? [{ debugName: "itemTemplate" }] : /* istanbul ignore next */ []));
|
|
28
|
-
itemTemplateContent = contentChild('option', { ...(ngDevMode ? { debugName: "itemTemplateContent" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
29
|
-
textSizeClass = computed(() => {
|
|
30
|
-
switch (this.size()) {
|
|
31
|
-
case 'small':
|
|
32
|
-
return 'text-xs';
|
|
33
|
-
case 'large':
|
|
34
|
-
return 'text-2xl';
|
|
35
|
-
default:
|
|
36
|
-
return 'text-base';
|
|
37
|
-
}
|
|
38
|
-
}, ...(ngDevMode ? [{ debugName: "textSizeClass" }] : /* istanbul ignore next */ []));
|
|
39
|
-
/** Container classes based on columns setting */
|
|
40
|
-
containerClasses = computed(() => {
|
|
41
|
-
const cols = this.columns();
|
|
42
|
-
if (cols) {
|
|
43
|
-
return `grid gap-2 grid-cols-${cols}`;
|
|
44
|
-
}
|
|
45
|
-
return 'flex flex-wrap gap-3';
|
|
46
|
-
}, ...(ngDevMode ? [{ debugName: "containerClasses" }] : /* istanbul ignore next */ []));
|
|
47
|
-
activeColorClasses = computed(() => {
|
|
48
|
-
return [
|
|
49
|
-
'bg-primary-50',
|
|
50
|
-
'dark:bg-primary-800',
|
|
51
|
-
'border-primary-400',
|
|
52
|
-
'ring-primary-200',
|
|
53
|
-
];
|
|
54
|
-
}, ...(ngDevMode ? [{ debugName: "activeColorClasses" }] : /* istanbul ignore next */ []));
|
|
55
|
-
selectItem(item) {
|
|
56
|
-
if (this.activeId() !== item.id) {
|
|
57
|
-
this.activeId.set(item.id);
|
|
58
|
-
this.selectionChange.emit(item);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: RadioCards, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
62
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: RadioCards, isStandalone: true, selector: "mt-radio-cards", inputs: { circle: { classPropertyName: "circle", publicName: "circle", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, activeId: { classPropertyName: "activeId", publicName: "activeId", isSignal: true, isRequired: false, transformFunction: null }, itemTemplate: { classPropertyName: "itemTemplate", publicName: "itemTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { options: "optionsChange", activeId: "activeIdChange", selectionChange: "selectionChange" }, queries: [{ propertyName: "itemTemplateContent", first: true, predicate: ["option"], descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "<div>\r\n <div [class]=\"containerClasses()\">\r\n @for (item of options(); track item.id) {\r\n @let active = item.id === activeId();\r\n <div\r\n (click)=\"selectItem(item)\"\r\n class=\"flex items-center space-x-2 px-3 py-2 rounded-lg cursor-pointer border-2 border-dashed transition-all ease-in-out duration-300\"\r\n [class]=\"\r\n active\r\n ? 'bg-primary-50 dark:bg-primary-800 border-primary-400 ring-primary-200'\r\n : 'border-gray-300 hover:border-gray-400 hover:bg-gray-50 dark:hover:bg-gray-800 hover:text-gray-600 dark:hover:text-gray-100'\r\n \"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n itemTemplate() || itemTemplateContent() || defaultTemplate;\r\n context: {\r\n $implicit: item,\r\n active: active,\r\n size: size(),\r\n }\r\n \"\r\n >\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n\r\n<ng-template #defaultTemplate let-template let-active=\"active\" let-size=\"size\">\r\n @if (template.icon) {\r\n <mt-avatar\r\n [shape]=\"circle() ? 'circle' : 'square'\"\r\n [size]=\"avatarSize()\"\r\n [icon]=\"template.icon\"\r\n [style.--p-avatar-background]=\"\r\n active ? 'var(--p-primary-color)' : 'var(--p-surface-100)'\r\n \"\r\n [style.--p-avatar-color]=\"active ? '#ffffff' : ''\"\r\n ></mt-avatar>\r\n }\r\n @if (template.name) {\r\n <span\r\n [class]=\"[\r\n 'font-semibold',\r\n textSizeClass(),\r\n 'dark:text-gray-100',\r\n 'text-gray-600',\r\n ]\"\r\n >\r\n {{ template.name }}\r\n </span>\r\n }\r\n</ng-template>\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Avatar, selector: "mt-avatar", inputs: ["label", "icon", "image", "styleClass", "size", "shape", "badge", "badgeSize", "badgeSeverity"], outputs: ["onImageError"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
63
|
-
}
|
|
64
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: RadioCards, decorators: [{
|
|
65
|
-
type: Component,
|
|
66
|
-
args: [{ selector: 'mt-radio-cards', standalone: true, imports: [NgTemplateOutlet, Avatar], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div>\r\n <div [class]=\"containerClasses()\">\r\n @for (item of options(); track item.id) {\r\n @let active = item.id === activeId();\r\n <div\r\n (click)=\"selectItem(item)\"\r\n class=\"flex items-center space-x-2 px-3 py-2 rounded-lg cursor-pointer border-2 border-dashed transition-all ease-in-out duration-300\"\r\n [class]=\"\r\n active\r\n ? 'bg-primary-50 dark:bg-primary-800 border-primary-400 ring-primary-200'\r\n : 'border-gray-300 hover:border-gray-400 hover:bg-gray-50 dark:hover:bg-gray-800 hover:text-gray-600 dark:hover:text-gray-100'\r\n \"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n itemTemplate() || itemTemplateContent() || defaultTemplate;\r\n context: {\r\n $implicit: item,\r\n active: active,\r\n size: size(),\r\n }\r\n \"\r\n >\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n\r\n<ng-template #defaultTemplate let-template let-active=\"active\" let-size=\"size\">\r\n @if (template.icon) {\r\n <mt-avatar\r\n [shape]=\"circle() ? 'circle' : 'square'\"\r\n [size]=\"avatarSize()\"\r\n [icon]=\"template.icon\"\r\n [style.--p-avatar-background]=\"\r\n active ? 'var(--p-primary-color)' : 'var(--p-surface-100)'\r\n \"\r\n [style.--p-avatar-color]=\"active ? '#ffffff' : ''\"\r\n ></mt-avatar>\r\n }\r\n @if (template.name) {\r\n <span\r\n [class]=\"[\r\n 'font-semibold',\r\n textSizeClass(),\r\n 'dark:text-gray-100',\r\n 'text-gray-600',\r\n ]\"\r\n >\r\n {{ template.name }}\r\n </span>\r\n }\r\n</ng-template>\r\n", styles: [":host{display:block}\n"] }]
|
|
67
|
-
}], propDecorators: { circle: [{ type: i0.Input, args: [{ isSignal: true, alias: "circle", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }, { type: i0.Output, args: ["optionsChange"] }], activeId: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeId", required: false }] }, { type: i0.Output, args: ["activeIdChange"] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], itemTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemTemplate", required: false }] }], itemTemplateContent: [{ type: i0.ContentChild, args: ['option', { ...{ read: TemplateRef }, isSignal: true }] }] } });
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Generated bundle index. Do not edit.
|
|
71
|
-
*/
|
|
72
|
-
|
|
73
|
-
export { RadioCards };
|
|
74
|
-
//# sourceMappingURL=masterteam-components-radio-cards.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"masterteam-components-radio-cards.mjs","sources":["../../../../packages/masterteam/components/radio-cards/radio-cards.ts","../../../../packages/masterteam/components/radio-cards/radio-cards.html","../../../../packages/masterteam/components/radio-cards/masterteam-components-radio-cards.ts"],"sourcesContent":["import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n contentChild,\r\n input,\r\n output,\r\n TemplateRef,\r\n computed,\r\n model,\r\n booleanAttribute,\r\n} from '@angular/core';\r\nimport { MTIcon } from '@masterteam/icons';\r\nimport { Avatar } from '@masterteam/components/avatar';\r\nimport { NgTemplateOutlet } from '@angular/common';\r\n\r\nexport interface RadioItem {\r\n id: string | number;\r\n name?: string;\r\n icon?: MTIcon;\r\n [key: string]: any;\r\n}\r\n\r\n@Component({\r\n selector: 'mt-radio-cards',\r\n standalone: true,\r\n imports: [NgTemplateOutlet, Avatar],\r\n templateUrl: './radio-cards.html',\r\n styleUrl: './radio-cards.css',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class RadioCards {\r\n circle = input<boolean, unknown>(false, { transform: booleanAttribute });\r\n color = input<string>('primary');\r\n size = input<'small' | 'medium' | 'large'>('medium');\r\n /** Number of columns for grid layout. If not set, uses flex wrap. */\r\n columns = input<number | null>(null);\r\n avatarSize = computed(() => {\r\n switch (this.size()) {\r\n case 'small':\r\n return 'normal';\r\n case 'medium':\r\n return 'large';\r\n case 'large':\r\n return 'xlarge';\r\n default:\r\n return 'normal';\r\n }\r\n });\r\n options = model.required<RadioItem[]>();\r\n activeId = model<string | number>();\r\n selectionChange = output<RadioItem>();\r\n\r\n itemTemplate = input<TemplateRef<any> | null>(null);\r\n itemTemplateContent = contentChild('option', { read: TemplateRef });\r\n\r\n textSizeClass = computed(() => {\r\n switch (this.size()) {\r\n case 'small':\r\n return 'text-xs';\r\n\r\n case 'large':\r\n return 'text-2xl';\r\n\r\n default:\r\n return 'text-base';\r\n }\r\n });\r\n /** Container classes based on columns setting */\r\n containerClasses = computed(() => {\r\n const cols = this.columns();\r\n if (cols) {\r\n return `grid gap-2 grid-cols-${cols}`;\r\n }\r\n return 'flex flex-wrap gap-3';\r\n });\r\n\r\n protected activeColorClasses = computed(() => {\r\n return [\r\n 'bg-primary-50',\r\n 'dark:bg-primary-800',\r\n 'border-primary-400',\r\n 'ring-primary-200',\r\n ];\r\n });\r\n\r\n public selectItem(item: RadioItem): void {\r\n if (this.activeId() !== item.id) {\r\n this.activeId.set(item.id);\r\n this.selectionChange.emit(item);\r\n }\r\n }\r\n}\r\n","<div>\r\n <div [class]=\"containerClasses()\">\r\n @for (item of options(); track item.id) {\r\n @let active = item.id === activeId();\r\n <div\r\n (click)=\"selectItem(item)\"\r\n class=\"flex items-center space-x-2 px-3 py-2 rounded-lg cursor-pointer border-2 border-dashed transition-all ease-in-out duration-300\"\r\n [class]=\"\r\n active\r\n ? 'bg-primary-50 dark:bg-primary-800 border-primary-400 ring-primary-200'\r\n : 'border-gray-300 hover:border-gray-400 hover:bg-gray-50 dark:hover:bg-gray-800 hover:text-gray-600 dark:hover:text-gray-100'\r\n \"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n itemTemplate() || itemTemplateContent() || defaultTemplate;\r\n context: {\r\n $implicit: item,\r\n active: active,\r\n size: size(),\r\n }\r\n \"\r\n >\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n\r\n<ng-template #defaultTemplate let-template let-active=\"active\" let-size=\"size\">\r\n @if (template.icon) {\r\n <mt-avatar\r\n [shape]=\"circle() ? 'circle' : 'square'\"\r\n [size]=\"avatarSize()\"\r\n [icon]=\"template.icon\"\r\n [style.--p-avatar-background]=\"\r\n active ? 'var(--p-primary-color)' : 'var(--p-surface-100)'\r\n \"\r\n [style.--p-avatar-color]=\"active ? '#ffffff' : ''\"\r\n ></mt-avatar>\r\n }\r\n @if (template.name) {\r\n <span\r\n [class]=\"[\r\n 'font-semibold',\r\n textSizeClass(),\r\n 'dark:text-gray-100',\r\n 'text-gray-600',\r\n ]\"\r\n >\r\n {{ template.name }}\r\n </span>\r\n }\r\n</ng-template>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MA8Ba,UAAU,CAAA;IACrB,MAAM,GAAG,KAAK,CAAmB,KAAK,8EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AACxE,IAAA,KAAK,GAAG,KAAK,CAAS,SAAS,4EAAC;AAChC,IAAA,IAAI,GAAG,KAAK,CAA+B,QAAQ,2EAAC;;AAEpD,IAAA,OAAO,GAAG,KAAK,CAAgB,IAAI,8EAAC;AACpC,IAAA,UAAU,GAAG,QAAQ,CAAC,MAAK;AACzB,QAAA,QAAQ,IAAI,CAAC,IAAI,EAAE;AACjB,YAAA,K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