@elderbyte/ngx-starter 16.2.5 → 16.2.7
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/esm2022/lib/common/forms/elder-form-field-control-base.directive.mjs +26 -16
- package/esm2022/lib/components/select/multi/elder-multi-select-chips/elder-multi-select-chips.component.mjs +4 -2
- package/esm2022/lib/components/select/single/elder-select/elder-select.component.mjs +3 -5
- package/fesm2022/elderbyte-ngx-starter.mjs +29 -19
- package/fesm2022/elderbyte-ngx-starter.mjs.map +1 -1
- package/lib/common/forms/elder-form-field-control-base.directive.d.ts +4 -4
- package/package.json +1 -1
|
@@ -6348,9 +6348,9 @@ class ElderFormFieldControlBase extends ValueAccessorBase {
|
|
|
6348
6348
|
constructor(hostRef, controlType, focusMonitor, translateService, ngControl) {
|
|
6349
6349
|
super();
|
|
6350
6350
|
this.hostRef = hostRef;
|
|
6351
|
-
this.
|
|
6352
|
-
this.
|
|
6353
|
-
this.
|
|
6351
|
+
this.disabled$ = new BehaviorSubject(false);
|
|
6352
|
+
this.required$ = new BehaviorSubject(false);
|
|
6353
|
+
this.readonly$ = new BehaviorSubject(false);
|
|
6354
6354
|
this._focused = false;
|
|
6355
6355
|
this.stateChangePusher$ = new Subject();
|
|
6356
6356
|
this.destroy$ = new Subject();
|
|
@@ -6404,28 +6404,37 @@ class ElderFormFieldControlBase extends ValueAccessorBase {
|
|
|
6404
6404
|
return this._placeholder;
|
|
6405
6405
|
}
|
|
6406
6406
|
set required(value) {
|
|
6407
|
-
|
|
6408
|
-
this.
|
|
6407
|
+
const newValue = coerceBooleanProperty(value);
|
|
6408
|
+
if (this.required != newValue) {
|
|
6409
|
+
this.required$.next(newValue);
|
|
6410
|
+
this.emitStateChange();
|
|
6411
|
+
}
|
|
6409
6412
|
}
|
|
6410
6413
|
get required() {
|
|
6411
|
-
return this.
|
|
6414
|
+
return this.required$.getValue();
|
|
6412
6415
|
}
|
|
6413
6416
|
set disabled(value) {
|
|
6414
|
-
|
|
6415
|
-
this.
|
|
6417
|
+
const newValue = coerceBooleanProperty(value);
|
|
6418
|
+
if (this.disabled != newValue) {
|
|
6419
|
+
this.disabled$.next(newValue);
|
|
6420
|
+
this.emitStateChange();
|
|
6421
|
+
}
|
|
6416
6422
|
}
|
|
6417
6423
|
get disabled() {
|
|
6418
|
-
return this.
|
|
6424
|
+
return this.disabled$.getValue();
|
|
6419
6425
|
}
|
|
6420
6426
|
set readonly(value) {
|
|
6421
|
-
|
|
6422
|
-
this.
|
|
6427
|
+
const newValue = coerceBooleanProperty(value);
|
|
6428
|
+
if (this.readonly != newValue) {
|
|
6429
|
+
this.readonly$.next(newValue);
|
|
6430
|
+
this.emitStateChange();
|
|
6431
|
+
}
|
|
6423
6432
|
}
|
|
6424
6433
|
get readonly() {
|
|
6425
|
-
return this.
|
|
6434
|
+
return this.readonly$.getValue();
|
|
6426
6435
|
}
|
|
6427
6436
|
get isLocked() {
|
|
6428
|
-
return this.
|
|
6437
|
+
return this.disabled || this.readonly;
|
|
6429
6438
|
}
|
|
6430
6439
|
get stateChanges() {
|
|
6431
6440
|
return this.value$.pipe(map(x => x), mergeWith(this.stateChangePusher$));
|
|
@@ -6466,7 +6475,8 @@ class ElderFormFieldControlBase extends ValueAccessorBase {
|
|
|
6466
6475
|
emitStateChange() {
|
|
6467
6476
|
this.stateChangePusher$.next();
|
|
6468
6477
|
}
|
|
6469
|
-
writeToControl(value) {
|
|
6478
|
+
writeToControl(value) {
|
|
6479
|
+
}
|
|
6470
6480
|
onFocusInternal() {
|
|
6471
6481
|
if (!this.disabled) {
|
|
6472
6482
|
this._focused = true;
|
|
@@ -19919,13 +19929,11 @@ class ElderSelectComponent extends ElderSelectBase {
|
|
|
19919
19929
|
}
|
|
19920
19930
|
}
|
|
19921
19931
|
selectEntityById(id) {
|
|
19922
|
-
console.warn('Current Entity: ' + this.entity);
|
|
19923
|
-
console.warn('id: ' + id);
|
|
19924
19932
|
const currentEntity = this.entity;
|
|
19925
19933
|
if (currentEntity && this.getEntityId(currentEntity) === id) {
|
|
19926
19934
|
return; // Entity already loaded
|
|
19927
19935
|
}
|
|
19928
|
-
if (id === null || id === undefined) {
|
|
19936
|
+
if (id === null || id === undefined || id === "") {
|
|
19929
19937
|
if (currentEntity !== null && currentEntity !== undefined) {
|
|
19930
19938
|
this.entity = null;
|
|
19931
19939
|
}
|
|
@@ -19960,7 +19968,7 @@ class ElderSelectComponent extends ElderSelectBase {
|
|
|
19960
19968
|
.find(v => this.getEntityId(v) === id);
|
|
19961
19969
|
}
|
|
19962
19970
|
entityToValue(entity) {
|
|
19963
|
-
if (this.valueAsId
|
|
19971
|
+
if (this.valueAsId) {
|
|
19964
19972
|
const id = this.getEntityId(entity);
|
|
19965
19973
|
return id;
|
|
19966
19974
|
}
|
|
@@ -21649,7 +21657,9 @@ class ElderMultiSelectChipsComponent extends ElderMultiSelectBase {
|
|
|
21649
21657
|
this.entities$,
|
|
21650
21658
|
this.entityIds$,
|
|
21651
21659
|
this.state$,
|
|
21652
|
-
this.displayPropertyResolver
|
|
21660
|
+
this.displayPropertyResolver$,
|
|
21661
|
+
this.readonly$,
|
|
21662
|
+
this.disabled$
|
|
21653
21663
|
]).pipe(map(([entities, entityIds, state, dPR]) => this.buildChipModelsOrFallback(entities, entityIds, state, dPR)));
|
|
21654
21664
|
this.templates$ = combineLatest([
|
|
21655
21665
|
this.chipTemplate$,
|