@ngrdt/forms 0.0.64 → 0.0.66
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/ngrdt-forms.mjs +14 -8
- package/fesm2022/ngrdt-forms.mjs.map +1 -1
- package/index.d.ts +5 -2
- package/package.json +3 -3
package/fesm2022/ngrdt-forms.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Injector, signal, model, linkedSignal, input, booleanAttribute, computed, effect, untracked, Directive, InjectionToken,
|
|
2
|
+
import { inject, Injector, signal, model, linkedSignal, input, booleanAttribute, computed, effect, untracked, Directive, InjectionToken, output, forwardRef, numberAttribute, ElementRef, Pipe } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed, toSignal, toObservable } from '@angular/core/rxjs-interop';
|
|
4
4
|
import { FormControlName, FormControlDirective, NgModel, NgControl, Validators, NG_VALUE_ACCESSOR, FormControl, FormGroup } from '@angular/forms';
|
|
5
5
|
import { RdtInteractiveElementComponent, RdtComponentOutletDirective } from '@ngrdt/core';
|
|
@@ -235,12 +235,16 @@ const RDT_CHECKBOX_BASE_PROVIDER = new InjectionToken('RdtCheckbox');
|
|
|
235
235
|
|
|
236
236
|
class RdtCheckboxOutletDirective extends RdtFormInputOutletDirective {
|
|
237
237
|
componentClass = inject(RDT_CHECKBOX_BASE_PROVIDER);
|
|
238
|
+
checkedChange = output();
|
|
238
239
|
constructor() {
|
|
239
240
|
super();
|
|
240
241
|
this.initComponentRef();
|
|
242
|
+
this.componentRef?.instance.checkedChange.subscribe((val) => {
|
|
243
|
+
this.checkedChange.emit(val);
|
|
244
|
+
});
|
|
241
245
|
}
|
|
242
246
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: RdtCheckboxOutletDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
243
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: RdtCheckboxOutletDirective, isStandalone: true, selector: "[rdtCheckboxOutlet]", providers: [
|
|
247
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: RdtCheckboxOutletDirective, isStandalone: true, selector: "[rdtCheckboxOutlet]", outputs: { checkedChange: "checkedChange" }, providers: [
|
|
244
248
|
{
|
|
245
249
|
provide: NG_VALUE_ACCESSOR,
|
|
246
250
|
useExisting: forwardRef(() => RdtCheckboxOutletDirective),
|
|
@@ -725,7 +729,7 @@ function getRdtSelectStore(initialState = rdtSelectInitialState) {
|
|
|
725
729
|
selected: selectedMap.has(it.id),
|
|
726
730
|
}));
|
|
727
731
|
}
|
|
728
|
-
const selected =
|
|
732
|
+
const selected = [];
|
|
729
733
|
const missingPlaceholder = state.missingValuePlaceholder();
|
|
730
734
|
const placeholders = missing.map((id) => ({
|
|
731
735
|
id,
|
|
@@ -735,9 +739,7 @@ function getRdtSelectStore(initialState = rdtSelectInitialState) {
|
|
|
735
739
|
}));
|
|
736
740
|
placeholders.forEach((pl) => selected.push(pl));
|
|
737
741
|
items.forEach((item) => {
|
|
738
|
-
|
|
739
|
-
selected.push({ ...item, selected: false });
|
|
740
|
-
}
|
|
742
|
+
selected.push({ ...item, selected: selectedMap.has(item.id) });
|
|
741
743
|
});
|
|
742
744
|
return selected;
|
|
743
745
|
}),
|
|
@@ -1126,6 +1128,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
1126
1128
|
}] });
|
|
1127
1129
|
|
|
1128
1130
|
class RdtBaseSelectCommonComponent extends RdtBaseFormInputComponent {
|
|
1131
|
+
manualInitInput = input(false, {
|
|
1132
|
+
alias: 'manualInit',
|
|
1133
|
+
});
|
|
1134
|
+
manualInit = linkedSignal(() => this.manualInitInput());
|
|
1129
1135
|
datasourceInput = input(null);
|
|
1130
1136
|
store = inject(RdtSelectStore);
|
|
1131
1137
|
visibleOptions = this.store.visibleOptions;
|
|
@@ -1179,7 +1185,7 @@ class RdtBaseSelectCommonComponent extends RdtBaseFormInputComponent {
|
|
|
1179
1185
|
: [control.value];
|
|
1180
1186
|
this.store.init(arr);
|
|
1181
1187
|
}
|
|
1182
|
-
else {
|
|
1188
|
+
else if (!this.manualInit()) {
|
|
1183
1189
|
this.store.init(null);
|
|
1184
1190
|
}
|
|
1185
1191
|
this.debouncedInput$
|
|
@@ -1228,7 +1234,7 @@ class RdtBaseSelectCommonComponent extends RdtBaseFormInputComponent {
|
|
|
1228
1234
|
}
|
|
1229
1235
|
});
|
|
1230
1236
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: RdtBaseSelectCommonComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
1231
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.0", type: RdtBaseSelectCommonComponent, isStandalone: true, inputs: { datasourceInput: { classPropertyName: "datasourceInput", publicName: "datasourceInput", isSignal: true, isRequired: false, transformFunction: null }, queryValidatorFnInput: { classPropertyName: "queryValidatorFnInput", publicName: "inputValidator", isSignal: true, isRequired: false, transformFunction: null }, debounceTimeInput: { classPropertyName: "debounceTimeInput", publicName: "debounce", isSignal: true, isRequired: false, transformFunction: null }, pageSizeInput: { classPropertyName: "pageSizeInput", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 });
|
|
1237
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.0", type: RdtBaseSelectCommonComponent, isStandalone: true, inputs: { manualInitInput: { classPropertyName: "manualInitInput", publicName: "manualInit", isSignal: true, isRequired: false, transformFunction: null }, datasourceInput: { classPropertyName: "datasourceInput", publicName: "datasourceInput", isSignal: true, isRequired: false, transformFunction: null }, queryValidatorFnInput: { classPropertyName: "queryValidatorFnInput", publicName: "inputValidator", isSignal: true, isRequired: false, transformFunction: null }, debounceTimeInput: { classPropertyName: "debounceTimeInput", publicName: "debounce", isSignal: true, isRequired: false, transformFunction: null }, pageSizeInput: { classPropertyName: "pageSizeInput", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 });
|
|
1232
1238
|
}
|
|
1233
1239
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: RdtBaseSelectCommonComponent, decorators: [{
|
|
1234
1240
|
type: Directive
|