@dev-tcloud/tcloud-ui 0.0.60 → 0.0.62

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.
@@ -3167,13 +3167,35 @@ class TCloudUiFiltersComponent {
3167
3167
  this.first_active_filter = true;
3168
3168
  }
3169
3169
  }
3170
- console.log('this.filters', this.filters);
3171
- this.init();
3170
+ this.toSubmit();
3172
3171
  });
3173
3172
  }
3174
3173
  ngAfterViewInit() {
3175
3174
  // child is set
3176
3175
  }
3176
+ /*
3177
+ auto_filter(){
3178
+ setTimeout(() => {
3179
+ if( this.filters ){
3180
+ const filters = JSON.parse(JSON.stringify( this.filters ));
3181
+ for(let i = 0; i < (filters).length; i++){
3182
+ if( filters[i].value ){
3183
+ if( filters[i].type === 'datetime-local' ){
3184
+ try {
3185
+ filters[i].searchText = new Date( `${filters[i].value}` );
3186
+ } catch (error) {}
3187
+ }else{
3188
+ filters[i].searchText = filters[i].value;
3189
+ }
3190
+ this.first_active_filter = true;
3191
+ }
3192
+ }
3193
+ console.log('auto_filter onSubmit', filters);
3194
+ this.onSubmit.emit(filters);
3195
+ }
3196
+ });
3197
+ }
3198
+ */
3177
3199
  ngOnChanges(changes) {
3178
3200
  if (changes && changes['data']) {
3179
3201
  const data = changes['data'].currentValue;
@@ -3237,9 +3259,15 @@ class TCloudUiFiltersComponent {
3237
3259
  if ((!filter.searchText || filter.searchText && filter.searchText === '') && filter.type !== "boolean") {
3238
3260
  delete (filters[i]);
3239
3261
  }
3262
+ if (filter.type === "boolean") {
3263
+ if (!filter.searchText) {
3264
+ filter.searchText = false;
3265
+ }
3266
+ }
3240
3267
  });
3241
3268
  }
3242
- this.onSubmit.emit(JSON.parse(JSON.stringify(this.filters)));
3269
+ console.log('onSubmit', this.filters);
3270
+ this.onSubmit.emit(this.filters);
3243
3271
  }
3244
3272
  collectionFind(obj, path) {
3245
3273
  const pathArray = path.split(".");