@dev-tcloud/tcloud-ui 0.0.39 → 0.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.
- package/esm2020/lib/_modules/tcloud-ui-data-list/tcloud-ui-data-list.component.mjs +18 -12
- package/esm2020/lib/_modules/tcloud-ui-filters/tcloud-ui-filters.component.mjs +21 -9
- package/fesm2015/dev-tcloud-tcloud-ui.mjs +37 -20
- package/fesm2015/dev-tcloud-tcloud-ui.mjs.map +1 -1
- package/fesm2020/dev-tcloud-tcloud-ui.mjs +37 -19
- package/fesm2020/dev-tcloud-tcloud-ui.mjs.map +1 -1
- package/lib/_modules/tcloud-ui-data-list/tcloud-ui-data-list.component.d.ts +2 -0
- package/lib/_modules/tcloud-ui-filters/tcloud-ui-filters.component.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1166,8 +1166,8 @@ class TCloudUiDataListComponent {
|
|
|
1166
1166
|
this.onChangeCallback = noop$2;
|
|
1167
1167
|
}
|
|
1168
1168
|
set disabled(v) {
|
|
1169
|
-
|
|
1170
|
-
|
|
1169
|
+
if (v) {
|
|
1170
|
+
this._disabled = v;
|
|
1171
1171
|
this.selected_description = '';
|
|
1172
1172
|
this.selected_item = '';
|
|
1173
1173
|
this.toChange();
|
|
@@ -1175,8 +1175,8 @@ class TCloudUiDataListComponent {
|
|
|
1175
1175
|
}
|
|
1176
1176
|
get disabled() { return this._disabled; }
|
|
1177
1177
|
set loading(v) {
|
|
1178
|
-
|
|
1179
|
-
|
|
1178
|
+
if (v) {
|
|
1179
|
+
this._loading = v;
|
|
1180
1180
|
this.selected_description = '';
|
|
1181
1181
|
this.selected_item = '';
|
|
1182
1182
|
this.toChange();
|
|
@@ -1209,16 +1209,22 @@ class TCloudUiDataListComponent {
|
|
|
1209
1209
|
this.toClick();
|
|
1210
1210
|
}
|
|
1211
1211
|
ngAfterViewChecked() {
|
|
1212
|
+
this.t_fc = undefined;
|
|
1213
|
+
this.t_fc = this.get_selected_description();
|
|
1214
|
+
}
|
|
1215
|
+
get_selected_description() {
|
|
1212
1216
|
if (this.list_selected_options && (this.list_selected_options).length > 0) {
|
|
1213
1217
|
for (let i = 0; i < (this.list_selected_options).length; i++) {
|
|
1214
1218
|
const item = this.list_selected_options[i];
|
|
1215
1219
|
if (item.value === this.selected_item) {
|
|
1216
|
-
|
|
1217
|
-
if (
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
+
if (this.selected_description !== item.description) {
|
|
1221
|
+
if (item.description && item.description !== this.selected_description) {
|
|
1222
|
+
setTimeout(() => {
|
|
1223
|
+
this.selected_description = item.description;
|
|
1224
|
+
this.dataListService.setActiveItem(this.selected_item);
|
|
1225
|
+
});
|
|
1220
1226
|
}
|
|
1221
|
-
}
|
|
1227
|
+
}
|
|
1222
1228
|
break;
|
|
1223
1229
|
}
|
|
1224
1230
|
}
|
|
@@ -1376,13 +1382,13 @@ TCloudUiDataListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0"
|
|
|
1376
1382
|
TCloudUiDataListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: TCloudUiDataListComponent, selector: "tcloud-ui-data-list", inputs: { placeholder: "placeholder", disabled: "disabled", loading: "loading", search: "search", ngModel: "ngModel" }, outputs: { onInputChange: "onInputChange", onChange: "onChange", ngModelChange: "ngModelChange" }, providers: [
|
|
1377
1383
|
DataListService,
|
|
1378
1384
|
CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$2
|
|
1379
|
-
], ngImport: i0, template: "<div *ngIf=\"formulario\" id=\"area-{{ id }}\" class=\"tc-dropdown\" [class.disabled]=\"disabled || loading\">\r\n <div *ngIf=\"loading\" class=\"loading-area\">\r\n <i class=\"fas fa-spinner fa-spin\"></i>\r\n </div>\r\n <!-- [attr.data-bs-toggle]=\"'dropdown'\" -->\r\n <button \r\n [class.loading-box]=\"loading\"\r\n [disabled]=\"disabled || loading\"\r\n class=\"dropdown-toggle button-select no-margin-bottom\" \r\n type=\"button\" \r\n id=\"{{ id }}\" \r\n \r\n [attr.aria-haspopup]=\"'true'\" \r\n [attr.aria-expanded]=\"'false'\" \r\n (click)=\"toOpen()\" >\r\n\r\n <i *ngIf=\"(selected_description === undefined || selected_description === null || selected_description === '' ) && !loading \">{{ placeholder }}</i>\r\n {{ selected_description }}\r\n <span><i class=\"fas fa-angle-down\"></i></span>\r\n </button>\r\n <div class=\"tc-dropdown-menu {{ menu_on_top }}\" id=\"box-{{ id }}\" [attr.aria-labelledby]=\"id\" [class.to-hide]=\"!menu_show\" [style]=\"box_style\">\r\n\r\n <div class=\"line-search\" *ngIf=\"search\">\r\n <table class=\"box-search\">\r\n <tr>\r\n\r\n <td class=\"area-input\">\r\n <input type=\"text\" class=\"tc-form-control\" [(ngModel)]=\"search_text\" (input)=\"toSearch($event)\" placeholder=\"Buscar...\" > \r\n </td>\r\n\r\n <td class=\"area-icon\">\r\n <i *ngIf=\"search_text === ''\" class=\"fas fa-search icon-search\"></i>\r\n <button type=\"button\" *ngIf=\"search_text !== ''\" (click)=\"clearTextSearch()\"><i class=\"fas fa-times\"></i></button>\r\n </td>\r\n \r\n </tr>\r\n </table>\r\n </div>\r\n \r\n <div class=\"area-options\" id=\"{{ id }}-options\" (click)=\"toClose()\">\r\n <ng-content></ng-content> \r\n </div>\r\n </div>\r\n</div>\r\n\r\n<div *ngIf=\"formulario\">\r\n <form [formGroup]=\"formulario\" style=\"display: none;\" >\r\n <input id=\"{{ id }}-hidden\" formControlName=\"selected_item\" type=\"hidden\">\r\n </form>\r\n</div
|
|
1385
|
+
], ngImport: i0, template: "<div *ngIf=\"formulario\" id=\"area-{{ id }}\" class=\"tc-dropdown\" [class.disabled]=\"disabled || loading\">\r\n <div *ngIf=\"loading\" class=\"loading-area\">\r\n <i class=\"fas fa-spinner fa-spin\"></i>\r\n </div>\r\n <!-- [attr.data-bs-toggle]=\"'dropdown'\" -->\r\n <button \r\n [class.loading-box]=\"loading\"\r\n [disabled]=\"disabled || loading\"\r\n class=\"dropdown-toggle button-select no-margin-bottom\" \r\n type=\"button\" \r\n id=\"{{ id }}\" \r\n \r\n [attr.aria-haspopup]=\"'true'\" \r\n [attr.aria-expanded]=\"'false'\" \r\n (click)=\"toOpen()\" >\r\n\r\n <i *ngIf=\"(selected_description === undefined || selected_description === null || selected_description === '' ) && !loading \">{{ placeholder }}</i>\r\n {{ selected_description }}\r\n <span><i class=\"fas fa-angle-down\"></i></span>\r\n </button>\r\n <div class=\"tc-dropdown-menu {{ menu_on_top }}\" id=\"box-{{ id }}\" [attr.aria-labelledby]=\"id\" [class.to-hide]=\"!menu_show\" [style]=\"box_style\">\r\n\r\n <div class=\"line-search\" *ngIf=\"search\">\r\n <table class=\"box-search\">\r\n <tr>\r\n\r\n <td class=\"area-input\">\r\n <input type=\"text\" class=\"tc-form-control\" [(ngModel)]=\"search_text\" (input)=\"toSearch($event)\" placeholder=\"Buscar...\" > \r\n </td>\r\n\r\n <td class=\"area-icon\">\r\n <i *ngIf=\"search_text === ''\" class=\"fas fa-search icon-search\"></i>\r\n <button type=\"button\" *ngIf=\"search_text !== ''\" (click)=\"clearTextSearch()\"><i class=\"fas fa-times\"></i></button>\r\n </td>\r\n \r\n </tr>\r\n </table>\r\n </div>\r\n \r\n <div class=\"area-options\" id=\"{{ id }}-options\" (click)=\"toClose()\">\r\n <ng-content></ng-content> \r\n </div>\r\n </div>\r\n</div>\r\n\r\n<div *ngIf=\"formulario\">\r\n <form [formGroup]=\"formulario\" style=\"display: none;\" >\r\n <input id=\"{{ id }}-hidden\" formControlName=\"selected_item\" type=\"hidden\">\r\n </form>\r\n</div>\r\n", styles: [".dropdown-toggle:after{display:none!important}.tc-dropdown{position:relative}.tc-dropdown .button-select{width:100%;background-color:#fff;border:1px solid #ccc;height:35px;text-align:left;padding-left:15px;font-size:14px;color:#666}.tc-dropdown .button-select span{position:absolute;right:6px;top:7px}.tc-dropdown .tc-dropdown-menu{width:100%;border:1px solid #ccc;background-color:#fff;position:absolute;z-index:1}.tc-dropdown .area-options{max-height:200px;overflow-y:scroll;overflow-x:hidden}.tc-dropdown .menu-on-top{position:absolute}.line-search{padding:3px}.line-search .box-search{width:100%;border-collapse:collapse}.line-search .box-search td.area-icon{padding:4px 0 2px 8px;width:35px}.line-search .box-search td.area-icon .icon-search{color:#666}.line-search .box-search td.area-icon button{border:none;background-color:transparent;color:#999;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.line-search .box-search td.area-input{border:none}.line-search .box-search td.area-input input{width:100%}.line-search .box-search input{width:100%;font-size:13px;height:33px;border:1px solid #ccc;padding:10px}.loading-area{line-height:0;position:relative;height:0;bottom:-10px;left:10px}button:disabled{background-color:#eee!important;border:1px solid #ececec!important;cursor:not-allowed}.loading-box{cursor:progress!important}.disabled i{color:#999!important}.to-hide{display:none}.no-margin-bottom{margin-bottom:0!important}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
|
|
1380
1386
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiDataListComponent, decorators: [{
|
|
1381
1387
|
type: Component,
|
|
1382
1388
|
args: [{ selector: 'tcloud-ui-data-list', providers: [
|
|
1383
1389
|
DataListService,
|
|
1384
1390
|
CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$2
|
|
1385
|
-
], template: "<div *ngIf=\"formulario\" id=\"area-{{ id }}\" class=\"tc-dropdown\" [class.disabled]=\"disabled || loading\">\r\n <div *ngIf=\"loading\" class=\"loading-area\">\r\n <i class=\"fas fa-spinner fa-spin\"></i>\r\n </div>\r\n <!-- [attr.data-bs-toggle]=\"'dropdown'\" -->\r\n <button \r\n [class.loading-box]=\"loading\"\r\n [disabled]=\"disabled || loading\"\r\n class=\"dropdown-toggle button-select no-margin-bottom\" \r\n type=\"button\" \r\n id=\"{{ id }}\" \r\n \r\n [attr.aria-haspopup]=\"'true'\" \r\n [attr.aria-expanded]=\"'false'\" \r\n (click)=\"toOpen()\" >\r\n\r\n <i *ngIf=\"(selected_description === undefined || selected_description === null || selected_description === '' ) && !loading \">{{ placeholder }}</i>\r\n {{ selected_description }}\r\n <span><i class=\"fas fa-angle-down\"></i></span>\r\n </button>\r\n <div class=\"tc-dropdown-menu {{ menu_on_top }}\" id=\"box-{{ id }}\" [attr.aria-labelledby]=\"id\" [class.to-hide]=\"!menu_show\" [style]=\"box_style\">\r\n\r\n <div class=\"line-search\" *ngIf=\"search\">\r\n <table class=\"box-search\">\r\n <tr>\r\n\r\n <td class=\"area-input\">\r\n <input type=\"text\" class=\"tc-form-control\" [(ngModel)]=\"search_text\" (input)=\"toSearch($event)\" placeholder=\"Buscar...\" > \r\n </td>\r\n\r\n <td class=\"area-icon\">\r\n <i *ngIf=\"search_text === ''\" class=\"fas fa-search icon-search\"></i>\r\n <button type=\"button\" *ngIf=\"search_text !== ''\" (click)=\"clearTextSearch()\"><i class=\"fas fa-times\"></i></button>\r\n </td>\r\n \r\n </tr>\r\n </table>\r\n </div>\r\n \r\n <div class=\"area-options\" id=\"{{ id }}-options\" (click)=\"toClose()\">\r\n <ng-content></ng-content> \r\n </div>\r\n </div>\r\n</div>\r\n\r\n<div *ngIf=\"formulario\">\r\n <form [formGroup]=\"formulario\" style=\"display: none;\" >\r\n <input id=\"{{ id }}-hidden\" formControlName=\"selected_item\" type=\"hidden\">\r\n </form>\r\n</div
|
|
1391
|
+
], template: "<div *ngIf=\"formulario\" id=\"area-{{ id }}\" class=\"tc-dropdown\" [class.disabled]=\"disabled || loading\">\r\n <div *ngIf=\"loading\" class=\"loading-area\">\r\n <i class=\"fas fa-spinner fa-spin\"></i>\r\n </div>\r\n <!-- [attr.data-bs-toggle]=\"'dropdown'\" -->\r\n <button \r\n [class.loading-box]=\"loading\"\r\n [disabled]=\"disabled || loading\"\r\n class=\"dropdown-toggle button-select no-margin-bottom\" \r\n type=\"button\" \r\n id=\"{{ id }}\" \r\n \r\n [attr.aria-haspopup]=\"'true'\" \r\n [attr.aria-expanded]=\"'false'\" \r\n (click)=\"toOpen()\" >\r\n\r\n <i *ngIf=\"(selected_description === undefined || selected_description === null || selected_description === '' ) && !loading \">{{ placeholder }}</i>\r\n {{ selected_description }}\r\n <span><i class=\"fas fa-angle-down\"></i></span>\r\n </button>\r\n <div class=\"tc-dropdown-menu {{ menu_on_top }}\" id=\"box-{{ id }}\" [attr.aria-labelledby]=\"id\" [class.to-hide]=\"!menu_show\" [style]=\"box_style\">\r\n\r\n <div class=\"line-search\" *ngIf=\"search\">\r\n <table class=\"box-search\">\r\n <tr>\r\n\r\n <td class=\"area-input\">\r\n <input type=\"text\" class=\"tc-form-control\" [(ngModel)]=\"search_text\" (input)=\"toSearch($event)\" placeholder=\"Buscar...\" > \r\n </td>\r\n\r\n <td class=\"area-icon\">\r\n <i *ngIf=\"search_text === ''\" class=\"fas fa-search icon-search\"></i>\r\n <button type=\"button\" *ngIf=\"search_text !== ''\" (click)=\"clearTextSearch()\"><i class=\"fas fa-times\"></i></button>\r\n </td>\r\n \r\n </tr>\r\n </table>\r\n </div>\r\n \r\n <div class=\"area-options\" id=\"{{ id }}-options\" (click)=\"toClose()\">\r\n <ng-content></ng-content> \r\n </div>\r\n </div>\r\n</div>\r\n\r\n<div *ngIf=\"formulario\">\r\n <form [formGroup]=\"formulario\" style=\"display: none;\" >\r\n <input id=\"{{ id }}-hidden\" formControlName=\"selected_item\" type=\"hidden\">\r\n </form>\r\n</div>\r\n", styles: [".dropdown-toggle:after{display:none!important}.tc-dropdown{position:relative}.tc-dropdown .button-select{width:100%;background-color:#fff;border:1px solid #ccc;height:35px;text-align:left;padding-left:15px;font-size:14px;color:#666}.tc-dropdown .button-select span{position:absolute;right:6px;top:7px}.tc-dropdown .tc-dropdown-menu{width:100%;border:1px solid #ccc;background-color:#fff;position:absolute;z-index:1}.tc-dropdown .area-options{max-height:200px;overflow-y:scroll;overflow-x:hidden}.tc-dropdown .menu-on-top{position:absolute}.line-search{padding:3px}.line-search .box-search{width:100%;border-collapse:collapse}.line-search .box-search td.area-icon{padding:4px 0 2px 8px;width:35px}.line-search .box-search td.area-icon .icon-search{color:#666}.line-search .box-search td.area-icon button{border:none;background-color:transparent;color:#999;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.line-search .box-search td.area-input{border:none}.line-search .box-search td.area-input input{width:100%}.line-search .box-search input{width:100%;font-size:13px;height:33px;border:1px solid #ccc;padding:10px}.loading-area{line-height:0;position:relative;height:0;bottom:-10px;left:10px}button:disabled{background-color:#eee!important;border:1px solid #ececec!important;cursor:not-allowed}.loading-box{cursor:progress!important}.disabled i{color:#999!important}.to-hide{display:none}.no-margin-bottom{margin-bottom:0!important}\n"] }]
|
|
1386
1392
|
}], ctorParameters: function () { return [{ type: DataListService }, { type: i2.FormBuilder }]; }, propDecorators: { placeholder: [{
|
|
1387
1393
|
type: Input
|
|
1388
1394
|
}], disabled: [{
|
|
@@ -2777,7 +2783,7 @@ class TCloudUiFiltersComponent {
|
|
|
2777
2783
|
ngOnChanges(changes) {
|
|
2778
2784
|
if (changes && changes['data']) {
|
|
2779
2785
|
const data = changes['data'].currentValue;
|
|
2780
|
-
console.log('ngOnChanges data', data);
|
|
2786
|
+
//console.log('ngOnChanges data', data);
|
|
2781
2787
|
if (this._data !== data) {
|
|
2782
2788
|
this._data = JSON.parse(JSON.stringify(data));
|
|
2783
2789
|
this.search_data = JSON.parse(JSON.stringify(data));
|
|
@@ -2816,8 +2822,8 @@ class TCloudUiFiltersComponent {
|
|
|
2816
2822
|
const nextKeys = pathArray.slice(i + 1);
|
|
2817
2823
|
const index = key.substring(key.indexOf('[') + 1, key.indexOf(']'));
|
|
2818
2824
|
const arrayKey = key.substring(0, key.indexOf('['));
|
|
2819
|
-
if (current[arrayKey][index]) {
|
|
2820
|
-
console.log('current[arrayKey][index]', current[arrayKey][index]);
|
|
2825
|
+
if (current && current[arrayKey] && current[arrayKey][index]) {
|
|
2826
|
+
//console.log('current[arrayKey][index]', current[arrayKey][index]);
|
|
2821
2827
|
return this.collectionFind(current[arrayKey][index], nextKeys.join("."));
|
|
2822
2828
|
}
|
|
2823
2829
|
}
|
|
@@ -2838,6 +2844,9 @@ class TCloudUiFiltersComponent {
|
|
|
2838
2844
|
return results;
|
|
2839
2845
|
}
|
|
2840
2846
|
else {
|
|
2847
|
+
if (!current || (current && !current[key])) {
|
|
2848
|
+
return undefined;
|
|
2849
|
+
}
|
|
2841
2850
|
current = current[key];
|
|
2842
2851
|
if (current === undefined) {
|
|
2843
2852
|
return undefined;
|
|
@@ -2861,7 +2870,8 @@ class TCloudUiFiltersComponent {
|
|
|
2861
2870
|
}
|
|
2862
2871
|
}
|
|
2863
2872
|
for (let i = 0; i < (this.data).length; i++) {
|
|
2864
|
-
this.data[i]['tc_filter_accept'] = true;
|
|
2873
|
+
// this.data[i]['tc_filter_accept'] = true;
|
|
2874
|
+
this.setDataIndex(i, true);
|
|
2865
2875
|
for (let j = 0; j < (this.filters).length; j++) {
|
|
2866
2876
|
const filter_item = this.filters[j];
|
|
2867
2877
|
if (filter_item.searchText && typeof (filter_item.searchText) === 'string' && filter_item.searchText !== '') {
|
|
@@ -2870,9 +2880,12 @@ class TCloudUiFiltersComponent {
|
|
|
2870
2880
|
if (item_value) {
|
|
2871
2881
|
item_value = this.normalize(item_value);
|
|
2872
2882
|
if (!(item_value.includes(filter_item.searchText) || item_value === filter_item.searchText)) {
|
|
2873
|
-
this.
|
|
2883
|
+
this.setDataIndex(i, false);
|
|
2874
2884
|
}
|
|
2875
2885
|
}
|
|
2886
|
+
else {
|
|
2887
|
+
this.setDataIndex(i, false);
|
|
2888
|
+
}
|
|
2876
2889
|
}
|
|
2877
2890
|
if (typeof (filter_item.searchText) === 'boolean' && filter_item.searchText) {
|
|
2878
2891
|
let item_value = this.collectionFind(this.data[i], filter_item.searchIn);
|
|
@@ -2885,12 +2898,12 @@ class TCloudUiFiltersComponent {
|
|
|
2885
2898
|
}
|
|
2886
2899
|
}
|
|
2887
2900
|
if (qtd_is_true === 0) {
|
|
2888
|
-
this.
|
|
2901
|
+
this.setDataIndex(i, false);
|
|
2889
2902
|
}
|
|
2890
2903
|
}
|
|
2891
2904
|
else {
|
|
2892
2905
|
if (!(item_value === filter_item.searchText)) {
|
|
2893
|
-
this.
|
|
2906
|
+
this.setDataIndex(i, false);
|
|
2894
2907
|
}
|
|
2895
2908
|
}
|
|
2896
2909
|
}
|
|
@@ -2899,7 +2912,6 @@ class TCloudUiFiltersComponent {
|
|
|
2899
2912
|
this.toResult();
|
|
2900
2913
|
}
|
|
2901
2914
|
toResult() {
|
|
2902
|
-
var _a;
|
|
2903
2915
|
const search_data = [];
|
|
2904
2916
|
let is_filter = false;
|
|
2905
2917
|
for (let i = 0; i < (this.filters).length; i++) {
|
|
@@ -2909,7 +2921,7 @@ class TCloudUiFiltersComponent {
|
|
|
2909
2921
|
}
|
|
2910
2922
|
if (is_filter) {
|
|
2911
2923
|
for (let i = 0; i < (this.data).length; i++) {
|
|
2912
|
-
if (
|
|
2924
|
+
if (this.data && this.data[i] && this.data[i]['tc_filter_accept']) {
|
|
2913
2925
|
(search_data).push(this.data[i]);
|
|
2914
2926
|
}
|
|
2915
2927
|
}
|
|
@@ -2918,6 +2930,11 @@ class TCloudUiFiltersComponent {
|
|
|
2918
2930
|
}
|
|
2919
2931
|
this.result.emit(this.data);
|
|
2920
2932
|
}
|
|
2933
|
+
setDataIndex(index, value) {
|
|
2934
|
+
if (this.data && this.data[index]) {
|
|
2935
|
+
this.data[index]['tc_filter_accept'] = value;
|
|
2936
|
+
}
|
|
2937
|
+
}
|
|
2921
2938
|
}
|
|
2922
2939
|
TCloudUiFiltersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiFiltersComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2923
2940
|
TCloudUiFiltersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: TCloudUiFiltersComponent, selector: "tcloud-ui-filters", inputs: { data: "data", filters: "filters" }, outputs: { result: "result" }, usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"show_filters\" class=\"area-filter\">\n <ng-container *ngFor=\"let item of filters; let i = index\">\n\n <ng-container *ngIf=\"!item.type || (item.type && item.type !== 'boolean')\">\n \n <div class=\"box-filter-input\" [style]=\"(item.width !== '') ? 'width:'+item.width : ''\">\n <div class=\"m-description\"><i [class.to-active]=\"_input.value !== ''\" class=\"fas fa-filter icon-filter\"></i> {{ item.description }}</div>\n <div>\n <input \n #_input\n placeholder=\"{{ (item.placeholder !== '') ? item.placeholder : '' }}\"\n name=\"input_{{i+1}}\" \n type=\"text\" \n class=\"form-control tc-form-control\" \n (keyup)=\"searchIn(item, $event)\">\n <button class=\"btn-clear-filter-text\" [class.to-hide]=\"_input.value === ''\" (click)=\"searchIn(item, null); _input.value = ''\">\n <i class=\"fas fa-times\"></i>\n </button>\n </div>\n </div>\n \n </ng-container>\n\n <ng-container *ngIf=\"item.type && item.type === 'boolean'\">\n \n <div class=\"box-filter-input\" [style]=\"(item.width !== '') ? 'width:'+item.width : ''\">\n <div class=\"m-description\"><i [class.to-active]=\"_input.checked === true\" class=\"fas fa-filter icon-filter\"></i> {{ item.description }}</div>\n <div class=\"area-input-checkbox\">\n <div class=\"form-control tc-form-control\">\n <label>\n {{ item.placeholder }}\n <input \n #_input\n placeholder=\"{{ (item.placeholder !== '') ? item.placeholder : '' }}\"\n name=\"input_{{i+1}}\" \n type=\"checkbox\" \n (change)=\"searchIn(item, _input.checked)\"> \n </label>\n </div> \n </div>\n </div>\n\n </ng-container>\n\n\n </ng-container>\n</div>\n\n<!-- <pre>{{ inputs | json }}</pre> -->\n <!-- <pre> {{ data | json }} </pre> -->\n\n<!-- <p>FILTERS</p>\n<pre> {{ filters | json }}</pre> -->", styles: [".box-filter-input{display:inline-block;padding:10px 5px;position:relative}.area-filter{border:1px solid #eeeeee;border-radius:5px;margin-bottom:5px}.btn-clear-filter-text{position:absolute;right:8px;top:38px;background-color:#fff;border:none;cursor:pointer;color:#aaa}.to-hide{display:none}.icon-filter{color:#ccc}.to-active{color:var(--verde)}.area-input-checkbox label{cursor:pointer;margin-bottom:0;color:#9f9f9f}.m-description{margin-bottom:3px}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|