@sumaris-net/ngx-components 2.4.38 → 2.4.40
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/esm2020/src/app/core/services/model/referential.model.mjs +14 -3
- package/esm2020/src/app/shared/form/field.component.mjs +4 -2
- package/fesm2015/sumaris-net.ngx-components.mjs +17 -3
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +16 -3
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/core/services/model/referential.model.d.ts +4 -1
|
@@ -10196,6 +10196,8 @@ class AppFormField {
|
|
|
10196
10196
|
* @param value
|
|
10197
10197
|
*/
|
|
10198
10198
|
reloadItems(value) {
|
|
10199
|
+
if (!this._definition)
|
|
10200
|
+
return;
|
|
10199
10201
|
this._onDefinitionChanged(this._definition);
|
|
10200
10202
|
if (this.autocompleteField) {
|
|
10201
10203
|
setTimeout(() => this.autocompleteField?.reloadItems(value));
|
|
@@ -10249,7 +10251,7 @@ class AppFormField {
|
|
|
10249
10251
|
if (!this.type)
|
|
10250
10252
|
throw new Error('Invalid attribute \'definition\' in <app-form-field>. Missing type !');
|
|
10251
10253
|
this.placeholder = this.placeholder || (this._definition.label && this.translate.instant(this._definition.label));
|
|
10252
|
-
this.required = isNotNilBoolean(this.required) ? this.required : (this._definition.required || this.formControl
|
|
10254
|
+
this.required = isNotNilBoolean(this.required) ? this.required : (this._definition.required || this.formControl?.validator === Validators.required || isBlankString(this.required));
|
|
10253
10255
|
this.disabled = toBoolean(this.disabled, toBoolean(this._definition.disabled, false));
|
|
10254
10256
|
if (this.type === 'double') {
|
|
10255
10257
|
this.numberInputStep = this.computeNumberInputStep(definition);
|
|
@@ -15613,17 +15615,28 @@ class BaseReferential extends Entity {
|
|
|
15613
15615
|
}
|
|
15614
15616
|
// @dynamic
|
|
15615
15617
|
let Referential = class Referential extends BaseReferential {
|
|
15618
|
+
fromObject(source, opts) {
|
|
15619
|
+
super.fromObject(source, opts);
|
|
15620
|
+
this.meta = source.meta && { ...source.meta } || undefined;
|
|
15621
|
+
}
|
|
15622
|
+
asObject(opts) {
|
|
15623
|
+
const target = super.asObject(opts);
|
|
15624
|
+
if (opts?.minify) {
|
|
15625
|
+
delete target.meta;
|
|
15626
|
+
}
|
|
15627
|
+
return target;
|
|
15628
|
+
}
|
|
15616
15629
|
};
|
|
15617
15630
|
Referential = __decorate([
|
|
15618
15631
|
EntityClass({ typename: 'ReferentialVO' })
|
|
15619
15632
|
], Referential);
|
|
15620
15633
|
class ReferentialUtils {
|
|
15621
15634
|
// FIXME: remove this
|
|
15622
|
-
static fromObject(source) {
|
|
15635
|
+
static fromObject(source, opts) {
|
|
15623
15636
|
if (!source || source instanceof Referential)
|
|
15624
15637
|
return source;
|
|
15625
15638
|
const res = new Referential();
|
|
15626
|
-
res.fromObject(source);
|
|
15639
|
+
res.fromObject(source, opts);
|
|
15627
15640
|
return res;
|
|
15628
15641
|
}
|
|
15629
15642
|
static isNotEmpty(obj) {
|