@solcre-org/core-ui 2.11.19 → 2.11.20
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/solcre-org-core-ui.mjs +98 -14
- package/fesm2022/solcre-org-core-ui.mjs.map +1 -1
- package/index.d.ts +13 -0
- package/package.json +1 -1
|
@@ -285,7 +285,8 @@ class CheckboxFieldComponent extends BaseFieldComponent {
|
|
|
285
285
|
});
|
|
286
286
|
options = computed(() => {
|
|
287
287
|
const checkboxField = this.field();
|
|
288
|
-
|
|
288
|
+
const opts = checkboxField.checkboxConfig?.options || [];
|
|
289
|
+
return opts;
|
|
289
290
|
});
|
|
290
291
|
allowMultiple = computed(() => {
|
|
291
292
|
const checkboxField = this.field();
|
|
@@ -6202,17 +6203,35 @@ class FilterModalComponent {
|
|
|
6202
6203
|
}));
|
|
6203
6204
|
constructor() {
|
|
6204
6205
|
this.initializeForm();
|
|
6206
|
+
effect(() => {
|
|
6207
|
+
const values = this.filterValues();
|
|
6208
|
+
});
|
|
6205
6209
|
}
|
|
6206
6210
|
ngOnChanges(changes) {
|
|
6207
6211
|
if (changes['filters'] && !changes['filters'].firstChange) {
|
|
6208
|
-
|
|
6209
|
-
|
|
6212
|
+
const oldFilters = changes['filters'].previousValue || [];
|
|
6213
|
+
const newFilters = changes['filters'].currentValue || [];
|
|
6214
|
+
const structureChanged = oldFilters.length !== newFilters.length ||
|
|
6215
|
+
oldFilters.some((oldFilter, index) => {
|
|
6216
|
+
const newFilter = newFilters[index];
|
|
6217
|
+
return !newFilter || oldFilter.key !== newFilter.key || oldFilter.type !== newFilter.type;
|
|
6218
|
+
});
|
|
6219
|
+
if (structureChanged) {
|
|
6220
|
+
this.initializeForm();
|
|
6221
|
+
this.resetValues();
|
|
6222
|
+
}
|
|
6210
6223
|
}
|
|
6211
6224
|
if (changes['currentFilterValues']) {
|
|
6212
|
-
this.filterValues
|
|
6213
|
-
|
|
6225
|
+
const hasLocalChanges = this.filterValues().size > 0;
|
|
6226
|
+
if (!hasLocalChanges) {
|
|
6227
|
+
this.filterValues.set(new Map(changes['currentFilterValues'].currentValue || new Map()));
|
|
6228
|
+
this.updateFormWithFilterValues();
|
|
6229
|
+
}
|
|
6214
6230
|
}
|
|
6215
6231
|
if (changes['isOpen'] && changes['isOpen'].currentValue === true) {
|
|
6232
|
+
if (this.filterValues().size === 0) {
|
|
6233
|
+
this.filterValues.set(new Map(this.currentFilterValues()));
|
|
6234
|
+
}
|
|
6216
6235
|
this.updateFormWithFilterValues();
|
|
6217
6236
|
}
|
|
6218
6237
|
}
|
|
@@ -6256,7 +6275,7 @@ class FilterModalComponent {
|
|
|
6256
6275
|
});
|
|
6257
6276
|
}
|
|
6258
6277
|
getFieldConfig(filter) {
|
|
6259
|
-
|
|
6278
|
+
const config = {
|
|
6260
6279
|
...filter,
|
|
6261
6280
|
modes: {
|
|
6262
6281
|
[ModalMode.FILTER]: {
|
|
@@ -6265,23 +6284,88 @@ class FilterModalComponent {
|
|
|
6265
6284
|
}
|
|
6266
6285
|
}
|
|
6267
6286
|
};
|
|
6287
|
+
return config;
|
|
6268
6288
|
}
|
|
6289
|
+
visibleFilters = computed(() => {
|
|
6290
|
+
const allFilters = this.filters();
|
|
6291
|
+
const currentValues = this.filterValues();
|
|
6292
|
+
const visibleFilters = [];
|
|
6293
|
+
allFilters.forEach(filter => {
|
|
6294
|
+
if (filter.conditionalVisibility) {
|
|
6295
|
+
const parentValue = currentValues.get(filter.conditionalVisibility.dependsOn);
|
|
6296
|
+
const isVisible = filter.conditionalVisibility.showWhen(parentValue);
|
|
6297
|
+
if (isVisible) {
|
|
6298
|
+
if (filter.conditionalVisibility.updateOptions) {
|
|
6299
|
+
const newOptions = filter.conditionalVisibility.updateOptions(parentValue);
|
|
6300
|
+
let updatedFilter;
|
|
6301
|
+
if (filter.type === 'checkbox' && 'checkboxConfig' in filter) {
|
|
6302
|
+
updatedFilter = {
|
|
6303
|
+
...filter,
|
|
6304
|
+
checkboxConfig: {
|
|
6305
|
+
...filter.checkboxConfig,
|
|
6306
|
+
options: newOptions
|
|
6307
|
+
}
|
|
6308
|
+
};
|
|
6309
|
+
}
|
|
6310
|
+
else {
|
|
6311
|
+
updatedFilter = {
|
|
6312
|
+
...filter,
|
|
6313
|
+
options: newOptions
|
|
6314
|
+
};
|
|
6315
|
+
}
|
|
6316
|
+
visibleFilters.push(updatedFilter);
|
|
6317
|
+
}
|
|
6318
|
+
else {
|
|
6319
|
+
visibleFilters.push(filter);
|
|
6320
|
+
}
|
|
6321
|
+
}
|
|
6322
|
+
}
|
|
6323
|
+
else {
|
|
6324
|
+
visibleFilters.push(filter);
|
|
6325
|
+
}
|
|
6326
|
+
});
|
|
6327
|
+
return visibleFilters;
|
|
6328
|
+
});
|
|
6269
6329
|
getFieldValue(filterKey) {
|
|
6270
6330
|
const trigger = this.clearTrigger();
|
|
6271
6331
|
return this.filterValues().get(filterKey) ?? '';
|
|
6272
6332
|
}
|
|
6273
6333
|
updateFilter(key, value) {
|
|
6334
|
+
let processedValue = value;
|
|
6335
|
+
if (Array.isArray(value)) {
|
|
6336
|
+
processedValue = value.filter(v => v !== '' && v !== null && v !== undefined);
|
|
6337
|
+
}
|
|
6274
6338
|
const newValues = new Map(this.filterValues());
|
|
6275
|
-
if (
|
|
6339
|
+
if (processedValue === '' || processedValue === null || processedValue === undefined ||
|
|
6340
|
+
(Array.isArray(processedValue) && processedValue.length === 0)) {
|
|
6276
6341
|
newValues.delete(key);
|
|
6277
6342
|
}
|
|
6278
6343
|
else {
|
|
6279
|
-
newValues.set(key,
|
|
6344
|
+
newValues.set(key, processedValue);
|
|
6280
6345
|
}
|
|
6281
6346
|
this.filterValues.set(newValues);
|
|
6347
|
+
const filter = this.filters().find(f => f.key.toString() === key);
|
|
6348
|
+
if (filter?.onValueChange) {
|
|
6349
|
+
filter.onValueChange(processedValue);
|
|
6350
|
+
}
|
|
6282
6351
|
const control = this.form().get(key);
|
|
6283
6352
|
if (control) {
|
|
6284
|
-
control.setValue(
|
|
6353
|
+
control.setValue(processedValue, { emitEvent: false });
|
|
6354
|
+
}
|
|
6355
|
+
const dependentFilters = this.filters().filter(f => f.conditionalVisibility?.dependsOn === key);
|
|
6356
|
+
if (dependentFilters.length > 0) {
|
|
6357
|
+
if (value === '' || value === null || value === undefined ||
|
|
6358
|
+
(Array.isArray(value) && value.length === 0)) {
|
|
6359
|
+
dependentFilters.forEach(depFilter => {
|
|
6360
|
+
const depKey = depFilter.key.toString();
|
|
6361
|
+
newValues.delete(depKey);
|
|
6362
|
+
const depControl = this.form().get(depKey);
|
|
6363
|
+
if (depControl) {
|
|
6364
|
+
depControl.setValue('', { emitEvent: false });
|
|
6365
|
+
}
|
|
6366
|
+
});
|
|
6367
|
+
this.filterValues.set(newValues);
|
|
6368
|
+
}
|
|
6285
6369
|
}
|
|
6286
6370
|
}
|
|
6287
6371
|
updateGlobalFilterValue(value) {
|
|
@@ -6339,11 +6423,11 @@ class FilterModalComponent {
|
|
|
6339
6423
|
overlay.addEventListener('animationend', onAnimationEnd);
|
|
6340
6424
|
}
|
|
6341
6425
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: FilterModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6342
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: FilterModalComponent, isStandalone: true, selector: "core-filter-modal", inputs: { isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null }, currentFilterValues: { classPropertyName: "currentFilterValues", publicName: "currentFilterValues", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close", filterChange: "filterChange", clearFilters: "clearFilters", globalFilterChange: "globalFilterChange" }, usesOnChanges: true, hostDirectives: [{ directive: CoreHostDirective }], ngImport: i0, template: "<div class=\"c-modal\" [class.is-visible]=\"isOpen()\" [class.is-closing]=\"isClosing()\">\n <div class=\"c-modal__overlay\" (click)=\"onClose()\"></div>\n <div class=\"c-modal__holder\">\n <div class=\"c-modal__header\">\n <p class=\"c-modal__title\">\n {{ \"table.filterBy\" | translate }}\n </p>\n <core-generic-button\n [config]=\"closeButtonConfig()\"\n (buttonClick)=\"onClose()\">\n </core-generic-button>\n </div>\n <div class=\"c-modal__body\">\n <form class=\"c-entry-group\">\n @for (filter of
|
|
6426
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: FilterModalComponent, isStandalone: true, selector: "core-filter-modal", inputs: { isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null }, currentFilterValues: { classPropertyName: "currentFilterValues", publicName: "currentFilterValues", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close", filterChange: "filterChange", clearFilters: "clearFilters", globalFilterChange: "globalFilterChange" }, usesOnChanges: true, hostDirectives: [{ directive: CoreHostDirective }], ngImport: i0, template: "<div class=\"c-modal\" [class.is-visible]=\"isOpen()\" [class.is-closing]=\"isClosing()\">\n <div class=\"c-modal__overlay\" (click)=\"onClose()\"></div>\n <div class=\"c-modal__holder\">\n <div class=\"c-modal__header\">\n <p class=\"c-modal__title\">\n {{ \"table.filterBy\" | translate }}\n </p>\n <core-generic-button\n [config]=\"closeButtonConfig()\"\n (buttonClick)=\"onClose()\">\n </core-generic-button>\n </div>\n <div class=\"c-modal__body\">\n <form class=\"c-entry-group\">\n @for (filter of visibleFilters(); track filter.key.toString() + '-' + clearTrigger()) {\n <div coreDynamicField [field]=\"getFieldConfig(filter)\" [value]=\"getFieldValue(filter.key.toString())\"\n [mode]=\"ModalMode.FILTER\" (valueChange)=\"updateFilter(filter.key.toString(), $event)\">\n </div>\n }\n </form>\n </div>\n <div class=\"c-modal__bottom\">\n <core-generic-button\n [config]=\"clearButtonConfig()\"\n (buttonClick)=\"onClear()\">\n </core-generic-button>\n <core-generic-button\n [config]=\"applyButtonConfig()\"\n (buttonClick)=\"onApply()\">\n </core-generic-button>\n </div>\n </div>\n</div>", styles: [".c-link.disabled{opacity:.5;cursor:not-allowed}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: DynamicFieldDirective, selector: "[coreDynamicField]", inputs: ["field", "value", "mode", "errors", "rowData", "formValue"], outputs: ["valueChange", "onBlurEvent", "onEnterEvent", "selectionChange"] }, { kind: "component", type: GenericButtonComponent, selector: "core-generic-button", inputs: ["config", "data"], outputs: ["buttonClick"] }] });
|
|
6343
6427
|
}
|
|
6344
6428
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: FilterModalComponent, decorators: [{
|
|
6345
6429
|
type: Component,
|
|
6346
|
-
args: [{ selector: 'core-filter-modal', standalone: true, imports: [CommonModule, TranslateModule, FormsModule, ReactiveFormsModule, DynamicFieldDirective, GenericButtonComponent], hostDirectives: [CoreHostDirective], template: "<div class=\"c-modal\" [class.is-visible]=\"isOpen()\" [class.is-closing]=\"isClosing()\">\n <div class=\"c-modal__overlay\" (click)=\"onClose()\"></div>\n <div class=\"c-modal__holder\">\n <div class=\"c-modal__header\">\n <p class=\"c-modal__title\">\n {{ \"table.filterBy\" | translate }}\n </p>\n <core-generic-button\n [config]=\"closeButtonConfig()\"\n (buttonClick)=\"onClose()\">\n </core-generic-button>\n </div>\n <div class=\"c-modal__body\">\n <form class=\"c-entry-group\">\n @for (filter of
|
|
6430
|
+
args: [{ selector: 'core-filter-modal', standalone: true, imports: [CommonModule, TranslateModule, FormsModule, ReactiveFormsModule, DynamicFieldDirective, GenericButtonComponent], hostDirectives: [CoreHostDirective], template: "<div class=\"c-modal\" [class.is-visible]=\"isOpen()\" [class.is-closing]=\"isClosing()\">\n <div class=\"c-modal__overlay\" (click)=\"onClose()\"></div>\n <div class=\"c-modal__holder\">\n <div class=\"c-modal__header\">\n <p class=\"c-modal__title\">\n {{ \"table.filterBy\" | translate }}\n </p>\n <core-generic-button\n [config]=\"closeButtonConfig()\"\n (buttonClick)=\"onClose()\">\n </core-generic-button>\n </div>\n <div class=\"c-modal__body\">\n <form class=\"c-entry-group\">\n @for (filter of visibleFilters(); track filter.key.toString() + '-' + clearTrigger()) {\n <div coreDynamicField [field]=\"getFieldConfig(filter)\" [value]=\"getFieldValue(filter.key.toString())\"\n [mode]=\"ModalMode.FILTER\" (valueChange)=\"updateFilter(filter.key.toString(), $event)\">\n </div>\n }\n </form>\n </div>\n <div class=\"c-modal__bottom\">\n <core-generic-button\n [config]=\"clearButtonConfig()\"\n (buttonClick)=\"onClear()\">\n </core-generic-button>\n <core-generic-button\n [config]=\"applyButtonConfig()\"\n (buttonClick)=\"onApply()\">\n </core-generic-button>\n </div>\n </div>\n</div>", styles: [".c-link.disabled{opacity:.5;cursor:not-allowed}\n"] }]
|
|
6347
6431
|
}], ctorParameters: () => [] });
|
|
6348
6432
|
|
|
6349
6433
|
class TableActionService {
|
|
@@ -10113,11 +10197,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
10113
10197
|
// Este archivo es generado automáticamente por scripts/update-version.js
|
|
10114
10198
|
// No edites manualmente este archivo
|
|
10115
10199
|
const VERSION = {
|
|
10116
|
-
full: '2.11.
|
|
10200
|
+
full: '2.11.20',
|
|
10117
10201
|
major: 2,
|
|
10118
10202
|
minor: 11,
|
|
10119
|
-
patch:
|
|
10120
|
-
timestamp: '2025-08-27T16:
|
|
10203
|
+
patch: 20,
|
|
10204
|
+
timestamp: '2025-08-27T16:52:12.959Z',
|
|
10121
10205
|
buildDate: '27/8/2025'
|
|
10122
10206
|
};
|
|
10123
10207
|
|