@dev-tcloud/tcloud-ui 0.0.59 → 0.0.61

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.
@@ -1971,7 +1971,7 @@ class RespectivePipe {
1971
1971
  ];
1972
1972
  }
1973
1973
  transform(v) {
1974
- if (v !== '') {
1974
+ if (v !== undefined && v !== null && v !== '') {
1975
1975
  for (let i = 0; i < (this.map).length; i++) {
1976
1976
  let custom_v = v;
1977
1977
  custom_v = (custom_v).toLowerCase();
@@ -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,16 @@ 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
+ filters = filters.filter(Boolean);
3270
+ console.log('onSubmit', filters);
3271
+ this.onSubmit.emit(filters);
3243
3272
  }
3244
3273
  collectionFind(obj, path) {
3245
3274
  const pathArray = path.split(".");