@dev-tcloud/tcloud-ui 0.0.57 → 0.0.58
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-datepicker-time/tcloud-ui-datepicker-time.component.mjs +5 -2
- package/esm2020/lib/_modules/tcloud-ui-filters/tcloud-ui-filters.component.mjs +21 -9
- package/esm2020/lib/_modules/tcloud-ui-filters/tcloud-ui-filters.mjs +1 -1
- package/esm2020/lib/_modules/tcloud-ui-filters/tcloud-ui-filters.module.mjs +5 -2
- package/fesm2015/dev-tcloud-tcloud-ui.mjs +27 -9
- package/fesm2015/dev-tcloud-tcloud-ui.mjs.map +1 -1
- package/fesm2020/dev-tcloud-tcloud-ui.mjs +27 -9
- package/fesm2020/dev-tcloud-tcloud-ui.mjs.map +1 -1
- package/lib/_modules/tcloud-ui-filters/tcloud-ui-filters.d.ts +1 -0
- package/lib/_modules/tcloud-ui-filters/tcloud-ui-filters.module.d.ts +1 -1
- package/package.json +1 -1
|
@@ -3091,8 +3091,11 @@ class TCloudUiDatepickerTimeComponent {
|
|
|
3091
3091
|
//From ControlValueAccessor interface
|
|
3092
3092
|
writeValue(value) {
|
|
3093
3093
|
if (value !== this.innerValue) {
|
|
3094
|
+
try {
|
|
3095
|
+
value = new Date(`${value}`);
|
|
3096
|
+
}
|
|
3097
|
+
catch (error) { }
|
|
3094
3098
|
this.innerValue = value;
|
|
3095
|
-
console.log('writeValue this.innerValue', this.innerValue);
|
|
3096
3099
|
if (this.checkIsDate(value)) {
|
|
3097
3100
|
this.to_date_hh_mm(value);
|
|
3098
3101
|
}
|
|
@@ -3153,6 +3156,23 @@ class TCloudUiFiltersComponent {
|
|
|
3153
3156
|
}
|
|
3154
3157
|
get filters() { return this._filters; }
|
|
3155
3158
|
ngOnInit() {
|
|
3159
|
+
setTimeout(() => {
|
|
3160
|
+
for (let i = 0; i < (this.filters).length; i++) {
|
|
3161
|
+
if (this.filters[i].value) {
|
|
3162
|
+
if (this.filters[i].type === 'datetime-local') {
|
|
3163
|
+
try {
|
|
3164
|
+
this.filters[i].searchText = new Date(`${this.filters[i].value}`);
|
|
3165
|
+
}
|
|
3166
|
+
catch (error) { }
|
|
3167
|
+
}
|
|
3168
|
+
else {
|
|
3169
|
+
this.filters[i].searchText = this.filters[i].value;
|
|
3170
|
+
}
|
|
3171
|
+
}
|
|
3172
|
+
}
|
|
3173
|
+
console.log('this.filters', this.filters);
|
|
3174
|
+
this.init();
|
|
3175
|
+
});
|
|
3156
3176
|
}
|
|
3157
3177
|
ngAfterViewInit() {
|
|
3158
3178
|
// child is set
|
|
@@ -3179,7 +3199,6 @@ class TCloudUiFiltersComponent {
|
|
|
3179
3199
|
this.show_filters = true;
|
|
3180
3200
|
if (this.filters && (this.filters).length > 0) {
|
|
3181
3201
|
(this.filters).forEach((filter) => {
|
|
3182
|
-
console.log('init filter', filter);
|
|
3183
3202
|
this.searchIn(filter, 'sync');
|
|
3184
3203
|
});
|
|
3185
3204
|
}
|
|
@@ -3268,11 +3287,8 @@ class TCloudUiFiltersComponent {
|
|
|
3268
3287
|
}
|
|
3269
3288
|
searchIn(item, event, value) {
|
|
3270
3289
|
var _a, _b;
|
|
3290
|
+
//console.log('item TCDataFilters', item);
|
|
3271
3291
|
this.start_filter_fc = undefined;
|
|
3272
|
-
if (value) {
|
|
3273
|
-
console.log('searchIn item', item);
|
|
3274
|
-
console.log('searchIn event', event);
|
|
3275
|
-
}
|
|
3276
3292
|
let isValid = true;
|
|
3277
3293
|
if (event === 'sync' && isValid) {
|
|
3278
3294
|
isValid = false;
|
|
@@ -3290,7 +3306,6 @@ class TCloudUiFiltersComponent {
|
|
|
3290
3306
|
}
|
|
3291
3307
|
if ((event === null || event === void 0 ? void 0 : event.datepickertime) && isValid) {
|
|
3292
3308
|
isValid = false;
|
|
3293
|
-
console.log('is a date', event === null || event === void 0 ? void 0 : event.innerValue);
|
|
3294
3309
|
item.searchText = event === null || event === void 0 ? void 0 : event.innerValue;
|
|
3295
3310
|
this.onChange.emit(true);
|
|
3296
3311
|
}
|
|
@@ -3488,10 +3503,10 @@ class TCloudUiFiltersComponent {
|
|
|
3488
3503
|
}
|
|
3489
3504
|
}
|
|
3490
3505
|
TCloudUiFiltersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiFiltersComponent, deps: [{ token: i1.DatePipe }], target: i0.ɵɵFactoryTarget.Component });
|
|
3491
|
-
TCloudUiFiltersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: TCloudUiFiltersComponent, selector: "tcloud-ui-filters", inputs: { data: "data", filters: "filters", submitText: "submitText", useOnChangeSubmit: "useOnChangeSubmit", useButtonSubmit: "useButtonSubmit", useNormalizeCaseSensitive: "useNormalizeCaseSensitive" }, outputs: { result: "result", onFilter: "onFilter", onChange: "onChange", onSubmit: "onSubmit" }, viewQueries: [{ propertyName: "_formulario", first: true, predicate: ["_formulario"], descendants: true }], 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 type-{{item.type}}\" [style]=\"(item.width !== '') ? 'width:'+item.width : ''\">\n\n <ng-container *ngIf=\"item.type === 'datetime-local'\">\n <div class=\"m-description\"><i [class.to-active]=\"(
|
|
3506
|
+
TCloudUiFiltersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: TCloudUiFiltersComponent, selector: "tcloud-ui-filters", inputs: { data: "data", filters: "filters", submitText: "submitText", useOnChangeSubmit: "useOnChangeSubmit", useButtonSubmit: "useButtonSubmit", useNormalizeCaseSensitive: "useNormalizeCaseSensitive" }, outputs: { result: "result", onFilter: "onFilter", onChange: "onChange", onSubmit: "onSubmit" }, viewQueries: [{ propertyName: "_formulario", first: true, predicate: ["_formulario"], descendants: true }], 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 type-{{item.type}}\" [style]=\"(item.width !== '') ? 'width:'+item.width : ''\">\n\n <ng-container *ngIf=\"item.type === 'datetime-local'\">\n <div class=\"m-description\"><i [class.to-active]=\"(item.value !== undefined && item.value !== null && item.value !== '')\" class=\"fas fa-filter icon-filter\"></i> {{ item.description }}</div>\n <div>\n <tcloud-ui-datepicker-time #_input [(ngModel)]=\"item.value\" name=\"input_{{i+1}}\" (eventChange)=\"searchIn(item, _input, 'teste')\" ></tcloud-ui-datepicker-time>\n <button class=\"btn-clear-filter-text\" [class.to-hide]=\"!(item.value !== undefined && item.value !== null && item.value !== '')\" (click)=\"searchIn(item, null); item.searchText = undefined; item.value = ''\">\n <i class=\"fas fa-times\"></i>\n </button>\n </div> \n </ng-container>\n \n <ng-container *ngIf=\"item.type !== 'select' && item.type !== 'datetime-local'\">\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 [(ngModel)]=\"item.value\"\n placeholder=\"{{ (item.placeholder !== '') ? item.placeholder : '' }}\"\n name=\"input_{{i+1}}\" \n type=\"{{ (item.type === 'number') ? 'text' : item.type }}\" \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 </ng-container>\n\n <ng-container *ngIf=\"item.type === 'select' && item.data && (item.data).length > 0\" >\n <div class=\"m-description\"><i [class.to-active]=\"_input.value !== ''\" class=\"fas fa-filter icon-filter\"></i> {{ item.description }}</div>\n <div>\n <select \n #_input\n [(ngModel)]=\"item.value\"\n name=\"input_{{i+1}}\" \n class=\"form-control tc-form-control\" \n (change)=\"searchIn(item, $event)\">\n <option [ngValue]=\"\"></option>\n <ng-container *ngFor=\"let v of item.data\">\n <option [value]=\"v.value\">{{ v.description }}</option>\n </ng-container>\n </select>\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 </ng-container>\n\n </div>\n\n\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\n <div class=\"text-right mb-1 mr-1\" *ngIf=\"useButtonSubmit\">\n <button type=\"button\" class=\"tc-btn btn-new-grey\" (click)=\"toSubmit()\" >{{ submitText }} <i class=\"fas fa-filter icon-filter\"></i></button>\n </div>\n\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-grid;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}input{color:#535353}.type-hidden{display:none;width:0px!important}\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"] }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { 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.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: TCloudUiDatepickerTimeComponent, selector: "tcloud-ui-datepicker-time", inputs: ["ngModel"], outputs: ["ngModelChange", "onChange", "eventChange"] }] });
|
|
3492
3507
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiFiltersComponent, decorators: [{
|
|
3493
3508
|
type: Component,
|
|
3494
|
-
args: [{ selector: 'tcloud-ui-filters', 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 type-{{item.type}}\" [style]=\"(item.width !== '') ? 'width:'+item.width : ''\">\n\n <ng-container *ngIf=\"item.type === 'datetime-local'\">\n <div class=\"m-description\"><i [class.to-active]=\"(
|
|
3509
|
+
args: [{ selector: 'tcloud-ui-filters', 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 type-{{item.type}}\" [style]=\"(item.width !== '') ? 'width:'+item.width : ''\">\n\n <ng-container *ngIf=\"item.type === 'datetime-local'\">\n <div class=\"m-description\"><i [class.to-active]=\"(item.value !== undefined && item.value !== null && item.value !== '')\" class=\"fas fa-filter icon-filter\"></i> {{ item.description }}</div>\n <div>\n <tcloud-ui-datepicker-time #_input [(ngModel)]=\"item.value\" name=\"input_{{i+1}}\" (eventChange)=\"searchIn(item, _input, 'teste')\" ></tcloud-ui-datepicker-time>\n <button class=\"btn-clear-filter-text\" [class.to-hide]=\"!(item.value !== undefined && item.value !== null && item.value !== '')\" (click)=\"searchIn(item, null); item.searchText = undefined; item.value = ''\">\n <i class=\"fas fa-times\"></i>\n </button>\n </div> \n </ng-container>\n \n <ng-container *ngIf=\"item.type !== 'select' && item.type !== 'datetime-local'\">\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 [(ngModel)]=\"item.value\"\n placeholder=\"{{ (item.placeholder !== '') ? item.placeholder : '' }}\"\n name=\"input_{{i+1}}\" \n type=\"{{ (item.type === 'number') ? 'text' : item.type }}\" \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 </ng-container>\n\n <ng-container *ngIf=\"item.type === 'select' && item.data && (item.data).length > 0\" >\n <div class=\"m-description\"><i [class.to-active]=\"_input.value !== ''\" class=\"fas fa-filter icon-filter\"></i> {{ item.description }}</div>\n <div>\n <select \n #_input\n [(ngModel)]=\"item.value\"\n name=\"input_{{i+1}}\" \n class=\"form-control tc-form-control\" \n (change)=\"searchIn(item, $event)\">\n <option [ngValue]=\"\"></option>\n <ng-container *ngFor=\"let v of item.data\">\n <option [value]=\"v.value\">{{ v.description }}</option>\n </ng-container>\n </select>\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 </ng-container>\n\n </div>\n\n\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\n <div class=\"text-right mb-1 mr-1\" *ngIf=\"useButtonSubmit\">\n <button type=\"button\" class=\"tc-btn btn-new-grey\" (click)=\"toSubmit()\" >{{ submitText }} <i class=\"fas fa-filter icon-filter\"></i></button>\n </div>\n\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-grid;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}input{color:#535353}.type-hidden{display:none;width:0px!important}\n"] }]
|
|
3495
3510
|
}], ctorParameters: function () { return [{ type: i1.DatePipe }]; }, propDecorators: { _formulario: [{
|
|
3496
3511
|
type: ViewChild,
|
|
3497
3512
|
args: ['_formulario']
|
|
@@ -3577,9 +3592,11 @@ class TCloudUiFiltersModule {
|
|
|
3577
3592
|
TCloudUiFiltersModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiFiltersModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3578
3593
|
TCloudUiFiltersModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiFiltersModule, declarations: [TCloudUiFiltersComponent], imports: [CommonModule,
|
|
3579
3594
|
FormsModule,
|
|
3595
|
+
ReactiveFormsModule,
|
|
3580
3596
|
TCloudUiDatepickerTimeModule], exports: [TCloudUiFiltersComponent] });
|
|
3581
3597
|
TCloudUiFiltersModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiFiltersModule, imports: [CommonModule,
|
|
3582
3598
|
FormsModule,
|
|
3599
|
+
ReactiveFormsModule,
|
|
3583
3600
|
TCloudUiDatepickerTimeModule] });
|
|
3584
3601
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiFiltersModule, decorators: [{
|
|
3585
3602
|
type: NgModule,
|
|
@@ -3593,6 +3610,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
3593
3610
|
imports: [
|
|
3594
3611
|
CommonModule,
|
|
3595
3612
|
FormsModule,
|
|
3613
|
+
ReactiveFormsModule,
|
|
3596
3614
|
TCloudUiDatepickerTimeModule
|
|
3597
3615
|
]
|
|
3598
3616
|
}]
|