matcha-components 20.175.0 → 20.178.0
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/matcha-components.mjs +141 -2
- package/fesm2022/matcha-components.mjs.map +1 -1
- package/index.d.ts +36 -2
- package/package.json +1 -1
|
@@ -2704,6 +2704,141 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
2704
2704
|
type: Output
|
|
2705
2705
|
}] } });
|
|
2706
2706
|
|
|
2707
|
+
let nextUniqueId = 0;
|
|
2708
|
+
class MatchaRadioGroupComponent {
|
|
2709
|
+
get value() { return this._value; }
|
|
2710
|
+
set value(newValue) {
|
|
2711
|
+
if (this._value !== newValue) {
|
|
2712
|
+
this._value = newValue;
|
|
2713
|
+
this.updateSelectedRadioFromValue();
|
|
2714
|
+
this.onChange(this._value);
|
|
2715
|
+
this._cdr.markForCheck();
|
|
2716
|
+
}
|
|
2717
|
+
}
|
|
2718
|
+
get disabled() { return this._disabled; }
|
|
2719
|
+
set disabled(value) {
|
|
2720
|
+
this._disabled = value;
|
|
2721
|
+
this.updateDisabledState();
|
|
2722
|
+
}
|
|
2723
|
+
constructor(_cdr) {
|
|
2724
|
+
this._cdr = _cdr;
|
|
2725
|
+
this._value = null;
|
|
2726
|
+
this.name = `matcha-radio-group-${nextUniqueId++}`;
|
|
2727
|
+
this._disabled = false;
|
|
2728
|
+
this.change = new EventEmitter();
|
|
2729
|
+
this.onChange = () => { };
|
|
2730
|
+
this.onTouched = () => { };
|
|
2731
|
+
this._unsubscribeAll = new Subject();
|
|
2732
|
+
this._radioSubscriptions = [];
|
|
2733
|
+
this._isInitialized = false;
|
|
2734
|
+
}
|
|
2735
|
+
ngAfterContentInit() {
|
|
2736
|
+
this._isInitialized = true;
|
|
2737
|
+
// Initial setup
|
|
2738
|
+
this.updateSelectedRadioFromValue();
|
|
2739
|
+
this.updateDisabledState();
|
|
2740
|
+
this.updateNames();
|
|
2741
|
+
this.subscribeToRadios();
|
|
2742
|
+
// Handle dynamic additions/removals
|
|
2743
|
+
this.radios.changes.pipe(takeUntil(this._unsubscribeAll)).subscribe(() => {
|
|
2744
|
+
this.updateSelectedRadioFromValue();
|
|
2745
|
+
this.updateDisabledState();
|
|
2746
|
+
this.updateNames();
|
|
2747
|
+
this.subscribeToRadios();
|
|
2748
|
+
});
|
|
2749
|
+
}
|
|
2750
|
+
updateNames() {
|
|
2751
|
+
if (this.radios) {
|
|
2752
|
+
this.radios.forEach(radio => {
|
|
2753
|
+
radio.name = this.name;
|
|
2754
|
+
radio['cdr'].markForCheck();
|
|
2755
|
+
});
|
|
2756
|
+
}
|
|
2757
|
+
}
|
|
2758
|
+
subscribeToRadios() {
|
|
2759
|
+
this._radioSubscriptions.forEach(sub => sub.unsubscribe());
|
|
2760
|
+
this._radioSubscriptions = [];
|
|
2761
|
+
if (this.radios) {
|
|
2762
|
+
this.radios.forEach(radio => {
|
|
2763
|
+
const sub = radio.change.pipe(takeUntil(this._unsubscribeAll)).subscribe((event) => {
|
|
2764
|
+
this.onTouched();
|
|
2765
|
+
if (this.value !== event.value) {
|
|
2766
|
+
this._value = event.value; // Update internal value without triggering setter logic again if unnecessary, but setter updates radios.
|
|
2767
|
+
// Actually, if clicked, the radio is already checked.
|
|
2768
|
+
// Just update value and emit.
|
|
2769
|
+
this.onChange(this._value);
|
|
2770
|
+
this.change.emit(event);
|
|
2771
|
+
}
|
|
2772
|
+
});
|
|
2773
|
+
this._radioSubscriptions.push(sub);
|
|
2774
|
+
});
|
|
2775
|
+
}
|
|
2776
|
+
}
|
|
2777
|
+
writeValue(value) {
|
|
2778
|
+
this._value = value;
|
|
2779
|
+
this.updateSelectedRadioFromValue();
|
|
2780
|
+
this._cdr.markForCheck();
|
|
2781
|
+
}
|
|
2782
|
+
registerOnChange(fn) {
|
|
2783
|
+
this.onChange = fn;
|
|
2784
|
+
}
|
|
2785
|
+
registerOnTouched(fn) {
|
|
2786
|
+
this.onTouched = fn;
|
|
2787
|
+
}
|
|
2788
|
+
setDisabledState(isDisabled) {
|
|
2789
|
+
this.disabled = isDisabled;
|
|
2790
|
+
}
|
|
2791
|
+
updateSelectedRadioFromValue() {
|
|
2792
|
+
if (this.radios && this._isInitialized) {
|
|
2793
|
+
this.radios.forEach(radio => {
|
|
2794
|
+
radio.checked = this._value === radio.value;
|
|
2795
|
+
});
|
|
2796
|
+
}
|
|
2797
|
+
}
|
|
2798
|
+
updateDisabledState() {
|
|
2799
|
+
if (this.radios && this._isInitialized && this.disabled !== undefined) {
|
|
2800
|
+
this.radios.forEach(radio => {
|
|
2801
|
+
radio.disabled = this.disabled;
|
|
2802
|
+
});
|
|
2803
|
+
}
|
|
2804
|
+
}
|
|
2805
|
+
ngOnDestroy() {
|
|
2806
|
+
this._unsubscribeAll.next();
|
|
2807
|
+
this._unsubscribeAll.complete();
|
|
2808
|
+
}
|
|
2809
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaRadioGroupComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2810
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.0", type: MatchaRadioGroupComponent, isStandalone: false, selector: "matcha-radio-group", inputs: { value: "value", name: "name", disabled: "disabled" }, outputs: { change: "change" }, host: { attributes: { "role": "radiogroup" } }, providers: [
|
|
2811
|
+
{
|
|
2812
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2813
|
+
useExisting: forwardRef(() => MatchaRadioGroupComponent),
|
|
2814
|
+
multi: true
|
|
2815
|
+
}
|
|
2816
|
+
], queries: [{ propertyName: "radios", predicate: i0.forwardRef(() => MatchaRadioComponent), descendants: true }], ngImport: i0, template: "<ng-content></ng-content>", styles: [".matcha-radio-group{display:block}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2817
|
+
}
|
|
2818
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaRadioGroupComponent, decorators: [{
|
|
2819
|
+
type: Component,
|
|
2820
|
+
args: [{ selector: 'matcha-radio-group', providers: [
|
|
2821
|
+
{
|
|
2822
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2823
|
+
useExisting: forwardRef(() => MatchaRadioGroupComponent),
|
|
2824
|
+
multi: true
|
|
2825
|
+
}
|
|
2826
|
+
], host: {
|
|
2827
|
+
'role': 'radiogroup',
|
|
2828
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<ng-content></ng-content>", styles: [".matcha-radio-group{display:block}\n"] }]
|
|
2829
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { radios: [{
|
|
2830
|
+
type: ContentChildren,
|
|
2831
|
+
args: [forwardRef(() => MatchaRadioComponent), { descendants: true }]
|
|
2832
|
+
}], value: [{
|
|
2833
|
+
type: Input
|
|
2834
|
+
}], name: [{
|
|
2835
|
+
type: Input
|
|
2836
|
+
}], disabled: [{
|
|
2837
|
+
type: Input
|
|
2838
|
+
}], change: [{
|
|
2839
|
+
type: Output
|
|
2840
|
+
}] } });
|
|
2841
|
+
|
|
2707
2842
|
class MatchaSpinComponent {
|
|
2708
2843
|
set progress(value) {
|
|
2709
2844
|
this._progress = Number(value);
|
|
@@ -13403,7 +13538,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
13403
13538
|
|
|
13404
13539
|
class MatchaRadioModule {
|
|
13405
13540
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaRadioModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
13406
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.0", ngImport: i0, type: MatchaRadioModule, declarations: [MatchaRadioComponent
|
|
13541
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.0", ngImport: i0, type: MatchaRadioModule, declarations: [MatchaRadioComponent,
|
|
13542
|
+
MatchaRadioGroupComponent], imports: [CommonModule, MatchaRippleModule], exports: [MatchaRadioComponent,
|
|
13543
|
+
MatchaRadioGroupComponent] }); }
|
|
13407
13544
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaRadioModule, imports: [CommonModule, MatchaRippleModule] }); }
|
|
13408
13545
|
}
|
|
13409
13546
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MatchaRadioModule, decorators: [{
|
|
@@ -13411,10 +13548,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
13411
13548
|
args: [{
|
|
13412
13549
|
declarations: [
|
|
13413
13550
|
MatchaRadioComponent,
|
|
13551
|
+
MatchaRadioGroupComponent
|
|
13414
13552
|
],
|
|
13415
13553
|
imports: [CommonModule, MatchaRippleModule],
|
|
13416
13554
|
exports: [
|
|
13417
13555
|
MatchaRadioComponent,
|
|
13556
|
+
MatchaRadioGroupComponent
|
|
13418
13557
|
],
|
|
13419
13558
|
}]
|
|
13420
13559
|
}] });
|
|
@@ -14063,5 +14202,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
14063
14202
|
* Generated bundle index. Do not edit.
|
|
14064
14203
|
*/
|
|
14065
14204
|
|
|
14066
|
-
export { CopyButtonComponent, INITIAL_CONFIG, MATCHA_MASK_CONFIG, MATCHA_OPTION_PARENT, MatchaAccordionComponent, MatchaAccordionContentComponent, MatchaAccordionHeaderComponent, MatchaAccordionItemComponent, MatchaAccordionModule, MatchaAutocompleteComponent, MatchaAutocompleteModule, MatchaAutocompleteTriggerDirective, MatchaAvatarComponent, MatchaAvatarModule, MatchaBreakpointObservableModule, MatchaBreakpointObserver, MatchaButtonComponent, MatchaButtonModule, MatchaButtonToggleComponent, MatchaButtonToggleModule, MatchaCardComponent, MatchaCardModule, MatchaCheckboxComponent, MatchaCheckboxModule, MatchaChipComponent, MatchaChipListComponent, MatchaChipModule, MatchaComponentsModule, MatchaDateComponent, MatchaDateModule, MatchaDateRangeComponent, MatchaDateRangeModule, MatchaDividerComponent, MatchaDividerModule, MatchaDragDirective, MatchaDragHandleDirective, MatchaDrawerComponent, MatchaDrawerContainerComponent, MatchaDrawerContentComponent, MatchaDrawerModule, MatchaDropListComponent, MatchaDropListModule, MatchaElevationDirective, MatchaElevationModule, MatchaErrorComponent, MatchaFormFieldComponent, MatchaFormFieldModule, MatchaGridComponent, MatchaGridModule, MatchaHighlightComponent, MatchaHighlightModule, MatchaHintTextComponent, MatchaHintTextModule, MatchaIconComponent, MatchaIconModule, MatchaInfiniteScrollComponent, MatchaInfiniteScrollDataComponent, MatchaInfiniteScrollModule, MatchaInputPhoneComponent, MatchaInputPhoneModule, MatchaLabelComponent, MatchaLazyloadComponent, MatchaLazyloadDataComponent, MatchaLazyloadModule, MatchaMaskApplierService, MatchaMaskCompatibleDirective, MatchaMaskModule, MatchaMaskPipe, MatchaMaskService, MatchaMasonryComponent, MatchaMasonryModule, MatchaModalComponent, MatchaModalContentComponent, MatchaModalFooterComponent, MatchaModalHeaderComponent, MatchaModalModule, MatchaModalOptionsComponent, MatchaModalService, MatchaOptionComponent, MatchaOptionModule, MatchaOverlayService, MatchaPageLayoutComponent, MatchaPageLayoutModule, MatchaPaginatorComponent, MatchaPaginatorIntl, MatchaPaginatorModule, MatchaPanelComponent, MatchaPanelModule, MatchaRadioComponent, MatchaRadioModule, MatchaRippleDirective, MatchaRippleModule, MatchaSelectComponent, MatchaSelectModule, MatchaSelectTriggerDirective, MatchaSkeletonComponent, MatchaSkeletonModule, MatchaSlideToggleComponent, MatchaSlideToggleModule, MatchaSliderComponent, MatchaSliderModule, MatchaSpinComponent, MatchaSpinModule, MatchaSpinnerComponent, MatchaSpinnerModule, MatchaStepperComponent, MatchaStepperContentComponent, MatchaStepperControllerComponent, MatchaStepperModule, MatchaStepperStateService, MatchaTabItemComponent, MatchaTableComponent, MatchaTableModule, MatchaTabsComponent, MatchaTabsModule, MatchaTimeComponent, MatchaTimeModule, MatchaTitleComponent, MatchaTitleModule, MatchaToolbarButtonComponent, MatchaToolbarComponent, MatchaToolbarContentComponent, MatchaToolbarCustomButtonComponent, MatchaToolbarMainButtonComponent, MatchaToolbarModule, MatchaTooltipDirective, MatchaTooltipModule, NEW_CONFIG, NextStepDirective, PrevStepDirective, StepComponent, StepContentDirective, compatibleOptions, initialConfig, timeMasks, withoutValidation };
|
|
14205
|
+
export { CopyButtonComponent, INITIAL_CONFIG, MATCHA_MASK_CONFIG, MATCHA_OPTION_PARENT, MatchaAccordionComponent, MatchaAccordionContentComponent, MatchaAccordionHeaderComponent, MatchaAccordionItemComponent, MatchaAccordionModule, MatchaAutocompleteComponent, MatchaAutocompleteModule, MatchaAutocompleteTriggerDirective, MatchaAvatarComponent, MatchaAvatarModule, MatchaBreakpointObservableModule, MatchaBreakpointObserver, MatchaButtonComponent, MatchaButtonModule, MatchaButtonToggleComponent, MatchaButtonToggleModule, MatchaCardComponent, MatchaCardModule, MatchaCheckboxComponent, MatchaCheckboxModule, MatchaChipComponent, MatchaChipListComponent, MatchaChipModule, MatchaComponentsModule, MatchaDateComponent, MatchaDateModule, MatchaDateRangeComponent, MatchaDateRangeModule, MatchaDividerComponent, MatchaDividerModule, MatchaDragDirective, MatchaDragHandleDirective, MatchaDrawerComponent, MatchaDrawerContainerComponent, MatchaDrawerContentComponent, MatchaDrawerModule, MatchaDropListComponent, MatchaDropListModule, MatchaElevationDirective, MatchaElevationModule, MatchaErrorComponent, MatchaFormFieldComponent, MatchaFormFieldModule, MatchaGridComponent, MatchaGridModule, MatchaHighlightComponent, MatchaHighlightModule, MatchaHintTextComponent, MatchaHintTextModule, MatchaIconComponent, MatchaIconModule, MatchaInfiniteScrollComponent, MatchaInfiniteScrollDataComponent, MatchaInfiniteScrollModule, MatchaInputPhoneComponent, MatchaInputPhoneModule, MatchaLabelComponent, MatchaLazyloadComponent, MatchaLazyloadDataComponent, MatchaLazyloadModule, MatchaMaskApplierService, MatchaMaskCompatibleDirective, MatchaMaskModule, MatchaMaskPipe, MatchaMaskService, MatchaMasonryComponent, MatchaMasonryModule, MatchaModalComponent, MatchaModalContentComponent, MatchaModalFooterComponent, MatchaModalHeaderComponent, MatchaModalModule, MatchaModalOptionsComponent, MatchaModalService, MatchaOptionComponent, MatchaOptionModule, MatchaOverlayService, MatchaPageLayoutComponent, MatchaPageLayoutModule, MatchaPaginatorComponent, MatchaPaginatorIntl, MatchaPaginatorModule, MatchaPanelComponent, MatchaPanelModule, MatchaRadioComponent, MatchaRadioGroupComponent, MatchaRadioModule, MatchaRippleDirective, MatchaRippleModule, MatchaSelectComponent, MatchaSelectModule, MatchaSelectTriggerDirective, MatchaSkeletonComponent, MatchaSkeletonModule, MatchaSlideToggleComponent, MatchaSlideToggleModule, MatchaSliderComponent, MatchaSliderModule, MatchaSpinComponent, MatchaSpinModule, MatchaSpinnerComponent, MatchaSpinnerModule, MatchaStepperComponent, MatchaStepperContentComponent, MatchaStepperControllerComponent, MatchaStepperModule, MatchaStepperStateService, MatchaTabItemComponent, MatchaTableComponent, MatchaTableModule, MatchaTabsComponent, MatchaTabsModule, MatchaTimeComponent, MatchaTimeModule, MatchaTitleComponent, MatchaTitleModule, MatchaToolbarButtonComponent, MatchaToolbarComponent, MatchaToolbarContentComponent, MatchaToolbarCustomButtonComponent, MatchaToolbarMainButtonComponent, MatchaToolbarModule, MatchaTooltipDirective, MatchaTooltipModule, NEW_CONFIG, NextStepDirective, PrevStepDirective, StepComponent, StepContentDirective, compatibleOptions, initialConfig, timeMasks, withoutValidation };
|
|
14067
14206
|
//# sourceMappingURL=matcha-components.mjs.map
|