@elite.framework/ng.core 1.0.39 → 1.0.41
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.
|
@@ -1338,13 +1338,14 @@ class AttachmentTypeComponent extends FieldType {
|
|
|
1338
1338
|
messageService;
|
|
1339
1339
|
defaultAcceptTypes = '.pdf,application/pdf,image/*,.txt,text/plain,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel';
|
|
1340
1340
|
maxFileSize = 1 * 1024 * 1024; // 1 MB
|
|
1341
|
-
url = '';
|
|
1342
1341
|
tenantId = 0;
|
|
1343
1342
|
env = inject(ENVIRONMENT);
|
|
1344
1343
|
constructor(messageService) {
|
|
1345
1344
|
super();
|
|
1346
1345
|
this.messageService = messageService;
|
|
1347
|
-
|
|
1346
|
+
}
|
|
1347
|
+
get url() {
|
|
1348
|
+
return this.env.apiUrl + (this.props['apiUrl'] ?? '/api/files');
|
|
1348
1349
|
}
|
|
1349
1350
|
get attachments() {
|
|
1350
1351
|
return Array.isArray(this.formControl.value)
|
|
@@ -4135,7 +4136,7 @@ class GenericSelectorTypeComponent extends FieldType {
|
|
|
4135
4136
|
loadDefaultValue() {
|
|
4136
4137
|
this.loading = true;
|
|
4137
4138
|
const vf = this.to['valueField'] || 'id';
|
|
4138
|
-
const fixedFilters = this.
|
|
4139
|
+
const fixedFilters = this.getFixedFilters();
|
|
4139
4140
|
const lf = this.to['loadDefaultField'] || 'isDefault';
|
|
4140
4141
|
const lfValue = this.to['loadDefaultValue'] || true;
|
|
4141
4142
|
const searchParams = {
|
|
@@ -4251,10 +4252,18 @@ class GenericSelectorTypeComponent extends FieldType {
|
|
|
4251
4252
|
});
|
|
4252
4253
|
}
|
|
4253
4254
|
}
|
|
4255
|
+
getFixedFilters() {
|
|
4256
|
+
const fixedFilters = this.to['fixedFilters'];
|
|
4257
|
+
if (typeof fixedFilters === 'function') {
|
|
4258
|
+
// Call with current model (and optionally field)
|
|
4259
|
+
return fixedFilters(this.model);
|
|
4260
|
+
}
|
|
4261
|
+
return fixedFilters || {};
|
|
4262
|
+
}
|
|
4254
4263
|
search(event) {
|
|
4255
4264
|
const q = event.query?.toString().toLowerCase() || '';
|
|
4256
4265
|
const lf = this.to['labelField'] || 'name';
|
|
4257
|
-
const fixedFilters = this.
|
|
4266
|
+
const fixedFilters = this.getFixedFilters();
|
|
4258
4267
|
if (this.to['offline']) {
|
|
4259
4268
|
this.options_ = this.to['offlineDataFn']
|
|
4260
4269
|
? this.to['offlineDataFn'](q)
|