@dev-tcloud/tcloud-ui 0.0.31 → 0.0.33
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/README.md +1 -0
- package/esm2020/lib/_modules/tcloud-ui-data-list/tcloud-ui-data-list.component.mjs +2 -1
- package/esm2020/lib/_modules/tcloud-ui-filters/tcloud-ui-filters.component.mjs +123 -0
- package/esm2020/lib/_modules/tcloud-ui-filters/tcloud-ui-filters.mjs +2 -0
- package/esm2020/lib/_modules/tcloud-ui-filters/tcloud-ui-filters.module.mjs +28 -0
- package/esm2020/lib/tcloud-ui.module.mjs +8 -1
- package/esm2020/public-api.mjs +5 -1
- package/fesm2015/dev-tcloud-tcloud-ui.mjs +152 -1
- package/fesm2015/dev-tcloud-tcloud-ui.mjs.map +1 -1
- package/fesm2020/dev-tcloud-tcloud-ui.mjs +151 -1
- package/fesm2020/dev-tcloud-tcloud-ui.mjs.map +1 -1
- package/lib/_modules/tcloud-ui-filters/tcloud-ui-filters.component.d.ts +25 -0
- package/lib/_modules/tcloud-ui-filters/tcloud-ui-filters.d.ts +9 -0
- package/lib/_modules/tcloud-ui-filters/tcloud-ui-filters.module.d.ts +9 -0
- package/lib/tcloud-ui.module.d.ts +4 -3
- package/package.json +1 -1
- package/public-api.d.ts +3 -0
|
@@ -1266,6 +1266,7 @@ class TCloudUiDataListComponent {
|
|
|
1266
1266
|
}
|
|
1267
1267
|
}
|
|
1268
1268
|
if (this.selected_item === undefined || this.selected_item === null || this.selected_item === '') {
|
|
1269
|
+
this.selected_description = '';
|
|
1269
1270
|
this.toChange();
|
|
1270
1271
|
}
|
|
1271
1272
|
}
|
|
@@ -2753,6 +2754,150 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
2753
2754
|
}]
|
|
2754
2755
|
}], ctorParameters: function () { return []; } });
|
|
2755
2756
|
|
|
2757
|
+
class TCloudUiFiltersComponent {
|
|
2758
|
+
constructor() {
|
|
2759
|
+
this.inputs = [];
|
|
2760
|
+
this.show_filters = false;
|
|
2761
|
+
this.result = new EventEmitter();
|
|
2762
|
+
}
|
|
2763
|
+
set data(data) {
|
|
2764
|
+
//this._data = data;
|
|
2765
|
+
}
|
|
2766
|
+
get data() { return this._data; }
|
|
2767
|
+
set filters(filters) {
|
|
2768
|
+
//this._filters = filters;
|
|
2769
|
+
}
|
|
2770
|
+
get filters() { return this._filters; }
|
|
2771
|
+
ngOnInit() {
|
|
2772
|
+
}
|
|
2773
|
+
ngOnChanges(changes) {
|
|
2774
|
+
const data = changes['data'].currentValue;
|
|
2775
|
+
if (this._data !== data) {
|
|
2776
|
+
this._data = JSON.parse(JSON.stringify(data));
|
|
2777
|
+
this.search_data = JSON.parse(JSON.stringify(data));
|
|
2778
|
+
this.init();
|
|
2779
|
+
}
|
|
2780
|
+
const filters = changes['filters'].currentValue;
|
|
2781
|
+
if (this._filters !== filters) {
|
|
2782
|
+
this._filters = JSON.parse(JSON.stringify(filters));
|
|
2783
|
+
this.init();
|
|
2784
|
+
}
|
|
2785
|
+
}
|
|
2786
|
+
init() {
|
|
2787
|
+
if (this.data && this.filters) {
|
|
2788
|
+
this.show_filters = true;
|
|
2789
|
+
this.toResult();
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2792
|
+
normalize(text) {
|
|
2793
|
+
const v = (((`${text}`).normalize('NFD').replace(/[\u0300-\u036f]/g, "")).trim()).toLowerCase();
|
|
2794
|
+
return v;
|
|
2795
|
+
}
|
|
2796
|
+
fetchFromObject(obj, prop) {
|
|
2797
|
+
if (typeof obj === 'undefined') {
|
|
2798
|
+
return false;
|
|
2799
|
+
}
|
|
2800
|
+
var _index = `${prop}`.indexOf('.');
|
|
2801
|
+
if (_index > -1) {
|
|
2802
|
+
return this.fetchFromObject(obj[prop.substring(0, _index)], prop.substr(_index + 1));
|
|
2803
|
+
}
|
|
2804
|
+
return obj[prop];
|
|
2805
|
+
}
|
|
2806
|
+
searchIn(item, event) {
|
|
2807
|
+
if (typeof event === 'boolean') {
|
|
2808
|
+
item.searchText = event;
|
|
2809
|
+
}
|
|
2810
|
+
else {
|
|
2811
|
+
if (event === null) {
|
|
2812
|
+
item.searchText = '';
|
|
2813
|
+
}
|
|
2814
|
+
else {
|
|
2815
|
+
item.searchText = (event.target.value).toUpperCase();
|
|
2816
|
+
}
|
|
2817
|
+
}
|
|
2818
|
+
for (let i = 0; i < (this.data).length; i++) {
|
|
2819
|
+
this.data[i]['tc_filter_accept'] = true;
|
|
2820
|
+
for (let j = 0; j < (this.filters).length; j++) {
|
|
2821
|
+
const filter_item = this.filters[j];
|
|
2822
|
+
if (filter_item.searchText && typeof (filter_item.searchText) === 'string' && filter_item.searchText !== '') {
|
|
2823
|
+
filter_item.searchText = this.normalize(filter_item.searchText);
|
|
2824
|
+
let item_value = this.fetchFromObject(this.data[i], filter_item.searchIn);
|
|
2825
|
+
if (item_value) {
|
|
2826
|
+
item_value = this.normalize(item_value);
|
|
2827
|
+
if (!(item_value.includes(filter_item.searchText) || item_value === filter_item.searchText)) {
|
|
2828
|
+
this.data[i]['tc_filter_accept'] = false;
|
|
2829
|
+
}
|
|
2830
|
+
}
|
|
2831
|
+
}
|
|
2832
|
+
if (typeof (filter_item.searchText) === 'boolean') {
|
|
2833
|
+
let item_value = this.fetchFromObject(this.data[i], filter_item.searchIn);
|
|
2834
|
+
if (filter_item.searchText) {
|
|
2835
|
+
if (!(item_value === filter_item.searchText)) {
|
|
2836
|
+
this.data[i]['tc_filter_accept'] = false;
|
|
2837
|
+
}
|
|
2838
|
+
}
|
|
2839
|
+
}
|
|
2840
|
+
}
|
|
2841
|
+
}
|
|
2842
|
+
this.toResult();
|
|
2843
|
+
}
|
|
2844
|
+
toResult() {
|
|
2845
|
+
var _a;
|
|
2846
|
+
const search_data = [];
|
|
2847
|
+
let is_filter = false;
|
|
2848
|
+
for (let i = 0; i < (this.filters).length; i++) {
|
|
2849
|
+
if (this.filters[i].searchText && this.filters[i].searchText !== '') {
|
|
2850
|
+
is_filter = true;
|
|
2851
|
+
}
|
|
2852
|
+
}
|
|
2853
|
+
if (is_filter) {
|
|
2854
|
+
for (let i = 0; i < (this.data).length; i++) {
|
|
2855
|
+
if ((_a = this.data[i]) === null || _a === void 0 ? void 0 : _a['tc_filter_accept']) {
|
|
2856
|
+
(search_data).push(this.data[i]);
|
|
2857
|
+
}
|
|
2858
|
+
}
|
|
2859
|
+
this.result.emit(search_data);
|
|
2860
|
+
return;
|
|
2861
|
+
}
|
|
2862
|
+
this.result.emit(this.data);
|
|
2863
|
+
}
|
|
2864
|
+
}
|
|
2865
|
+
TCloudUiFiltersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiFiltersComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2866
|
+
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><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=\"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><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=\"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;max-width:400px;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}\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"] }] });
|
|
2867
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiFiltersComponent, decorators: [{
|
|
2868
|
+
type: Component,
|
|
2869
|
+
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\" [style]=\"(item.width !== '') ? 'width:'+item.width : ''\">\n <div><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=\"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><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=\"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;max-width:400px;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}\n"] }]
|
|
2870
|
+
}], ctorParameters: function () { return []; }, propDecorators: { data: [{
|
|
2871
|
+
type: Input
|
|
2872
|
+
}], filters: [{
|
|
2873
|
+
type: Input
|
|
2874
|
+
}], result: [{
|
|
2875
|
+
type: Output
|
|
2876
|
+
}] } });
|
|
2877
|
+
|
|
2878
|
+
class TCloudUiFiltersModule {
|
|
2879
|
+
}
|
|
2880
|
+
TCloudUiFiltersModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiFiltersModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2881
|
+
TCloudUiFiltersModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiFiltersModule, declarations: [TCloudUiFiltersComponent], imports: [CommonModule,
|
|
2882
|
+
FormsModule], exports: [TCloudUiFiltersComponent] });
|
|
2883
|
+
TCloudUiFiltersModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiFiltersModule, imports: [CommonModule,
|
|
2884
|
+
FormsModule] });
|
|
2885
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiFiltersModule, decorators: [{
|
|
2886
|
+
type: NgModule,
|
|
2887
|
+
args: [{
|
|
2888
|
+
declarations: [
|
|
2889
|
+
TCloudUiFiltersComponent
|
|
2890
|
+
],
|
|
2891
|
+
exports: [
|
|
2892
|
+
TCloudUiFiltersComponent
|
|
2893
|
+
],
|
|
2894
|
+
imports: [
|
|
2895
|
+
CommonModule,
|
|
2896
|
+
FormsModule
|
|
2897
|
+
]
|
|
2898
|
+
}]
|
|
2899
|
+
}] });
|
|
2900
|
+
|
|
2756
2901
|
class TCloudUiModule {
|
|
2757
2902
|
}
|
|
2758
2903
|
TCloudUiModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -2769,6 +2914,7 @@ TCloudUiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
|
|
|
2769
2914
|
TCloudUiTableModule,
|
|
2770
2915
|
TCloudUiNumberStepModule,
|
|
2771
2916
|
TCloudUiScrollBoxModule,
|
|
2917
|
+
TCloudUiFiltersModule,
|
|
2772
2918
|
// Directives
|
|
2773
2919
|
TCloudUiDirectiveModule,
|
|
2774
2920
|
// Pipes
|
|
@@ -2785,6 +2931,7 @@ TCloudUiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
|
|
|
2785
2931
|
TCloudUiTableModule,
|
|
2786
2932
|
TCloudUiNumberStepModule,
|
|
2787
2933
|
TCloudUiScrollBoxModule,
|
|
2934
|
+
TCloudUiFiltersModule,
|
|
2788
2935
|
// Directives
|
|
2789
2936
|
TCloudUiDirectiveModule,
|
|
2790
2937
|
// Pipes
|
|
@@ -2805,6 +2952,7 @@ TCloudUiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version:
|
|
|
2805
2952
|
TCloudUiTableModule,
|
|
2806
2953
|
TCloudUiNumberStepModule,
|
|
2807
2954
|
TCloudUiScrollBoxModule,
|
|
2955
|
+
TCloudUiFiltersModule,
|
|
2808
2956
|
// Directives
|
|
2809
2957
|
TCloudUiDirectiveModule,
|
|
2810
2958
|
// Pipes
|
|
@@ -2821,6 +2969,7 @@ TCloudUiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version:
|
|
|
2821
2969
|
TCloudUiTableModule,
|
|
2822
2970
|
TCloudUiNumberStepModule,
|
|
2823
2971
|
TCloudUiScrollBoxModule,
|
|
2972
|
+
TCloudUiFiltersModule,
|
|
2824
2973
|
// Directives
|
|
2825
2974
|
TCloudUiDirectiveModule,
|
|
2826
2975
|
// Pipes
|
|
@@ -2842,6 +2991,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
2842
2991
|
TCloudUiTableModule,
|
|
2843
2992
|
TCloudUiNumberStepModule,
|
|
2844
2993
|
TCloudUiScrollBoxModule,
|
|
2994
|
+
TCloudUiFiltersModule,
|
|
2845
2995
|
// Directives
|
|
2846
2996
|
TCloudUiDirectiveModule,
|
|
2847
2997
|
// Pipes
|
|
@@ -2861,6 +3011,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
2861
3011
|
TCloudUiTableModule,
|
|
2862
3012
|
TCloudUiNumberStepModule,
|
|
2863
3013
|
TCloudUiScrollBoxModule,
|
|
3014
|
+
TCloudUiFiltersModule,
|
|
2864
3015
|
// Directives
|
|
2865
3016
|
TCloudUiDirectiveModule,
|
|
2866
3017
|
// Pipes
|
|
@@ -2881,5 +3032,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
2881
3032
|
* Generated bundle index. Do not edit.
|
|
2882
3033
|
*/
|
|
2883
3034
|
|
|
2884
|
-
export { BytesPipe, CNPJPipe, CPFPipe, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$2 as CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR, MonthNamePipe, RespectivePipe, StatusInfoPipe, TCloudUiAlignDirective, TCloudUiChoiceIssuesComponent, TCloudUiChoiceIssuesModule, TCloudUiDataListComponent, TCloudUiDataListModule, TCloudUiDataListOptionComponent, TCloudUiDirectiveModule, TCloudUiInputSearchComponent, TCloudUiInputSearchModule, TCloudUiLineStepCircleComponent, TCloudUiLineStepCircleModule, TCloudUiLinhaLogoComponent, TCloudUiLinhaLogoModule, TCloudUiLoadingTransitionsService, TCloudUiModalBodyComponent, TCloudUiModalComponent, TCloudUiModalFooterComponent, TCloudUiModalHeaderComponent, TCloudUiModalModule, TCloudUiModule, TCloudUiMultiInputComponent, TCloudUiMultiInputModule, TCloudUiMultiSelectComponent, TCloudUiMultiSelectModule, TCloudUiNotFoundComponent, TCloudUiNotFoundModule, TCloudUiNumberStepComponent, TCloudUiNumberStepModule, TCloudUiPipesModule, TCloudUiScrollBoxComponent, TCloudUiScrollBoxModule, TCloudUiSearchInObjectService, TCloudUiTabContentComponent, TCloudUiTabHeadComponent, TCloudUiTabMenuComponent, TCloudUiTabMenuModule, TCloudUiTabSubtitleComponent, TCloudUiTabTitleComponent, TCloudUiTableComponent, TCloudUiTableModule, TCloudUiTooltipDirective };
|
|
3035
|
+
export { BytesPipe, CNPJPipe, CPFPipe, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$2 as CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR, MonthNamePipe, RespectivePipe, StatusInfoPipe, TCloudUiAlignDirective, TCloudUiChoiceIssuesComponent, TCloudUiChoiceIssuesModule, TCloudUiDataListComponent, TCloudUiDataListModule, TCloudUiDataListOptionComponent, TCloudUiDirectiveModule, TCloudUiFiltersComponent, TCloudUiFiltersModule, TCloudUiInputSearchComponent, TCloudUiInputSearchModule, TCloudUiLineStepCircleComponent, TCloudUiLineStepCircleModule, TCloudUiLinhaLogoComponent, TCloudUiLinhaLogoModule, TCloudUiLoadingTransitionsService, TCloudUiModalBodyComponent, TCloudUiModalComponent, TCloudUiModalFooterComponent, TCloudUiModalHeaderComponent, TCloudUiModalModule, TCloudUiModule, TCloudUiMultiInputComponent, TCloudUiMultiInputModule, TCloudUiMultiSelectComponent, TCloudUiMultiSelectModule, TCloudUiNotFoundComponent, TCloudUiNotFoundModule, TCloudUiNumberStepComponent, TCloudUiNumberStepModule, TCloudUiPipesModule, TCloudUiScrollBoxComponent, TCloudUiScrollBoxModule, TCloudUiSearchInObjectService, TCloudUiTabContentComponent, TCloudUiTabHeadComponent, TCloudUiTabMenuComponent, TCloudUiTabMenuModule, TCloudUiTabSubtitleComponent, TCloudUiTabTitleComponent, TCloudUiTableComponent, TCloudUiTableModule, TCloudUiTooltipDirective };
|
|
2885
3036
|
//# sourceMappingURL=dev-tcloud-tcloud-ui.mjs.map
|