@dev-tcloud/tcloud-ui 0.0.37 → 0.0.38

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.
@@ -2935,6 +2935,188 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
2935
2935
  }]
2936
2936
  }] });
2937
2937
 
2938
+ class TCloudUiAccordionService {
2939
+ constructor() {
2940
+ this._stateToggle = new Subject();
2941
+ this.stateToggle$ = this._stateToggle.asObservable();
2942
+ this._stateLoading = new Subject();
2943
+ this.stateLoading$ = this._stateLoading.asObservable();
2944
+ this._stateDisabled = new Subject();
2945
+ this.stateDisabled$ = this._stateDisabled.asObservable();
2946
+ }
2947
+ toggle(action) {
2948
+ this._stateToggle.next(action);
2949
+ }
2950
+ getLoading() {
2951
+ return this.loading;
2952
+ }
2953
+ setLoading(loading) {
2954
+ this.loading = loading;
2955
+ this._stateLoading.next(loading);
2956
+ }
2957
+ getShow() {
2958
+ return this.show;
2959
+ }
2960
+ setDisabled(disabled) {
2961
+ this._stateDisabled.next(disabled);
2962
+ }
2963
+ getDisabled() {
2964
+ return this.disabled;
2965
+ }
2966
+ }
2967
+ TCloudUiAccordionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2968
+ TCloudUiAccordionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionService });
2969
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionService, decorators: [{
2970
+ type: Injectable
2971
+ }] });
2972
+
2973
+ class TCloudUiAccordionComponent {
2974
+ constructor(_tCloudUiAccordionService) {
2975
+ this._tCloudUiAccordionService = _tCloudUiAccordionService;
2976
+ this._disabled = false;
2977
+ this._show = false;
2978
+ this.onAction = new EventEmitter();
2979
+ this._loading = false;
2980
+ }
2981
+ set disabled(v) {
2982
+ this._disabled = v;
2983
+ if (this._disabled) {
2984
+ setTimeout(() => {
2985
+ this._tCloudUiAccordionService.setDisabled(this._disabled);
2986
+ this._tCloudUiAccordionService.toggle(false);
2987
+ });
2988
+ }
2989
+ }
2990
+ get disabled() { return this._disabled; }
2991
+ set show(v) {
2992
+ if (this._show !== v) {
2993
+ this._show = v;
2994
+ if (!this.disabled) {
2995
+ setTimeout(() => { this._tCloudUiAccordionService.toggle(this._show); });
2996
+ }
2997
+ }
2998
+ }
2999
+ get show() { return this._show; }
3000
+ /**
3001
+ * loading - boolean - Coloca o modal em modo de carregamento - default false
3002
+ */
3003
+ set loading(loading) {
3004
+ this._loading = loading;
3005
+ this._tCloudUiAccordionService.setLoading(loading);
3006
+ }
3007
+ get loading() { return this._loading; }
3008
+ ngOnInit() {
3009
+ this._tCloudUiAccordionService.stateLoading$.subscribe((loading) => {
3010
+ this.loading = loading;
3011
+ });
3012
+ this._tCloudUiAccordionService.stateToggle$.subscribe((show) => {
3013
+ this.onAction.emit((show === true) ? 'open' : 'close');
3014
+ });
3015
+ }
3016
+ }
3017
+ TCloudUiAccordionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionComponent, deps: [{ token: TCloudUiAccordionService }], target: i0.ɵɵFactoryTarget.Component });
3018
+ TCloudUiAccordionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: TCloudUiAccordionComponent, selector: "tcloud-ui-accordion", inputs: { disabled: "disabled", show: "show", loading: "loading" }, outputs: { onAction: "onAction" }, providers: [
3019
+ TCloudUiAccordionService
3020
+ ], ngImport: i0, template: "<div class=\"tc-accordion\" [class.tc-accordion-disabled]=\"disabled\">\n <ng-content></ng-content>\n</div>", styles: [".tc-accordion{border:1px solid #ccc;padding:8px 12px;border-radius:15px;margin-bottom:5px}.tc-accordion-disabled{background-color:#e3e3e3;opacity:.6}\n"] });
3021
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionComponent, decorators: [{
3022
+ type: Component,
3023
+ args: [{ selector: 'tcloud-ui-accordion', providers: [
3024
+ TCloudUiAccordionService
3025
+ ], template: "<div class=\"tc-accordion\" [class.tc-accordion-disabled]=\"disabled\">\n <ng-content></ng-content>\n</div>", styles: [".tc-accordion{border:1px solid #ccc;padding:8px 12px;border-radius:15px;margin-bottom:5px}.tc-accordion-disabled{background-color:#e3e3e3;opacity:.6}\n"] }]
3026
+ }], ctorParameters: function () { return [{ type: TCloudUiAccordionService }]; }, propDecorators: { disabled: [{
3027
+ type: Input
3028
+ }], show: [{
3029
+ type: Input
3030
+ }], onAction: [{
3031
+ type: Output
3032
+ }], loading: [{
3033
+ type: Input
3034
+ }] } });
3035
+
3036
+ class TCloudUiAccordionTitleComponent {
3037
+ constructor(_tCloudUiAccordionService) {
3038
+ this._tCloudUiAccordionService = _tCloudUiAccordionService;
3039
+ this.show = false;
3040
+ this.loading = false;
3041
+ this.disabled = false;
3042
+ }
3043
+ ngOnInit() {
3044
+ this.loading = this._tCloudUiAccordionService.getLoading() || false;
3045
+ this._tCloudUiAccordionService.stateLoading$.subscribe((loading) => {
3046
+ this.loading = loading;
3047
+ });
3048
+ this.show = this._tCloudUiAccordionService.getShow() || false;
3049
+ this._tCloudUiAccordionService.stateToggle$.subscribe((show) => {
3050
+ this.show = show;
3051
+ });
3052
+ this.disabled = this._tCloudUiAccordionService.getDisabled() || false;
3053
+ this._tCloudUiAccordionService.stateDisabled$.subscribe((disabled) => {
3054
+ this.disabled = disabled;
3055
+ });
3056
+ }
3057
+ toggle() {
3058
+ console.log('this.disabled', this.disabled);
3059
+ if (this.disabled) {
3060
+ return;
3061
+ }
3062
+ this.show = !this.show;
3063
+ this._tCloudUiAccordionService.toggle(this.show);
3064
+ }
3065
+ }
3066
+ TCloudUiAccordionTitleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionTitleComponent, deps: [{ token: TCloudUiAccordionService }], target: i0.ɵɵFactoryTarget.Component });
3067
+ TCloudUiAccordionTitleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: TCloudUiAccordionTitleComponent, selector: "tcloud-ui-accordion-title", ngImport: i0, template: "<div class=\"tc-accordion-title\">\n <table class=\"tc-accordion-table\">\n <tr>\n <td style=\"width: 100;\">\n <ng-content></ng-content>\n </td>\n <td class=\"tc-accordion-actions\">\n <button type=\"button\" class=\"tc-btn-accordion-toggle\" [disabled]=\"disabled\" (click)=\"toggle()\" >\n\n <i class=\"fas fa-chevron-right icon-toggle\" *ngIf=\"!show\"></i>\n <i class=\"fas fa-chevron-down icon-toggle\" *ngIf=\"show\"></i>\n\n </button>\n </td>\n </tr>\n </table>\n</div>", styles: [".tc-accordion-table{width:100%}.tc-accordion-actions{width:15px}.tc-btn-accordion-toggle{font-size:20px;border:none;background-color:transparent;background:none;cursor:pointer}.tc-btn-accordion-toggle:disabled{cursor:not-allowed!important;opacity:.6}.icon-toggle{color:var(--verde)}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
3068
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionTitleComponent, decorators: [{
3069
+ type: Component,
3070
+ args: [{ selector: 'tcloud-ui-accordion-title', template: "<div class=\"tc-accordion-title\">\n <table class=\"tc-accordion-table\">\n <tr>\n <td style=\"width: 100;\">\n <ng-content></ng-content>\n </td>\n <td class=\"tc-accordion-actions\">\n <button type=\"button\" class=\"tc-btn-accordion-toggle\" [disabled]=\"disabled\" (click)=\"toggle()\" >\n\n <i class=\"fas fa-chevron-right icon-toggle\" *ngIf=\"!show\"></i>\n <i class=\"fas fa-chevron-down icon-toggle\" *ngIf=\"show\"></i>\n\n </button>\n </td>\n </tr>\n </table>\n</div>", styles: [".tc-accordion-table{width:100%}.tc-accordion-actions{width:15px}.tc-btn-accordion-toggle{font-size:20px;border:none;background-color:transparent;background:none;cursor:pointer}.tc-btn-accordion-toggle:disabled{cursor:not-allowed!important;opacity:.6}.icon-toggle{color:var(--verde)}\n"] }]
3071
+ }], ctorParameters: function () { return [{ type: TCloudUiAccordionService }]; } });
3072
+
3073
+ class TCloudUiAccordionBodyComponent {
3074
+ constructor(_tCloudUiAccordionService) {
3075
+ this._tCloudUiAccordionService = _tCloudUiAccordionService;
3076
+ this.show = false;
3077
+ }
3078
+ ngOnInit() {
3079
+ this.show = this._tCloudUiAccordionService.getShow() || false;
3080
+ this._tCloudUiAccordionService.stateToggle$.subscribe((show) => {
3081
+ this.show = show;
3082
+ });
3083
+ }
3084
+ }
3085
+ TCloudUiAccordionBodyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionBodyComponent, deps: [{ token: TCloudUiAccordionService }], target: i0.ɵɵFactoryTarget.Component });
3086
+ TCloudUiAccordionBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: TCloudUiAccordionBodyComponent, selector: "tcloud-ui-accordion-body", ngImport: i0, template: "<div class=\"tc-accordion-content\" style=\"display: none;\" [class.show]=\"show\">\n <ng-content></ng-content>\n</div>", styles: [".show{display:block!important}.tc-accordion-content{padding-top:15px;padding-bottom:15px}\n"] });
3087
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionBodyComponent, decorators: [{
3088
+ type: Component,
3089
+ args: [{ selector: 'tcloud-ui-accordion-body', template: "<div class=\"tc-accordion-content\" style=\"display: none;\" [class.show]=\"show\">\n <ng-content></ng-content>\n</div>", styles: [".show{display:block!important}.tc-accordion-content{padding-top:15px;padding-bottom:15px}\n"] }]
3090
+ }], ctorParameters: function () { return [{ type: TCloudUiAccordionService }]; } });
3091
+
3092
+ class TCloudUiAccordionModule {
3093
+ }
3094
+ TCloudUiAccordionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3095
+ TCloudUiAccordionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionModule, declarations: [TCloudUiAccordionComponent,
3096
+ TCloudUiAccordionTitleComponent,
3097
+ TCloudUiAccordionBodyComponent], imports: [CommonModule], exports: [TCloudUiAccordionComponent,
3098
+ TCloudUiAccordionTitleComponent,
3099
+ TCloudUiAccordionBodyComponent] });
3100
+ TCloudUiAccordionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionModule, imports: [CommonModule] });
3101
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionModule, decorators: [{
3102
+ type: NgModule,
3103
+ args: [{
3104
+ declarations: [
3105
+ TCloudUiAccordionComponent,
3106
+ TCloudUiAccordionTitleComponent,
3107
+ TCloudUiAccordionBodyComponent
3108
+ ],
3109
+ exports: [
3110
+ TCloudUiAccordionComponent,
3111
+ TCloudUiAccordionTitleComponent,
3112
+ TCloudUiAccordionBodyComponent
3113
+ ],
3114
+ imports: [
3115
+ CommonModule
3116
+ ]
3117
+ }]
3118
+ }] });
3119
+
2938
3120
  class TCloudUiModule {
2939
3121
  }
2940
3122
  TCloudUiModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
@@ -2952,6 +3134,7 @@ TCloudUiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
2952
3134
  TCloudUiNumberStepModule,
2953
3135
  TCloudUiScrollBoxModule,
2954
3136
  TCloudUiFiltersModule,
3137
+ TCloudUiAccordionModule,
2955
3138
  // Directives
2956
3139
  TCloudUiDirectiveModule,
2957
3140
  // Pipes
@@ -2969,6 +3152,7 @@ TCloudUiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
2969
3152
  TCloudUiNumberStepModule,
2970
3153
  TCloudUiScrollBoxModule,
2971
3154
  TCloudUiFiltersModule,
3155
+ TCloudUiAccordionModule,
2972
3156
  // Directives
2973
3157
  TCloudUiDirectiveModule,
2974
3158
  // Pipes
@@ -2990,6 +3174,7 @@ TCloudUiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version:
2990
3174
  TCloudUiNumberStepModule,
2991
3175
  TCloudUiScrollBoxModule,
2992
3176
  TCloudUiFiltersModule,
3177
+ TCloudUiAccordionModule,
2993
3178
  // Directives
2994
3179
  TCloudUiDirectiveModule,
2995
3180
  // Pipes
@@ -3007,6 +3192,7 @@ TCloudUiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version:
3007
3192
  TCloudUiNumberStepModule,
3008
3193
  TCloudUiScrollBoxModule,
3009
3194
  TCloudUiFiltersModule,
3195
+ TCloudUiAccordionModule,
3010
3196
  // Directives
3011
3197
  TCloudUiDirectiveModule,
3012
3198
  // Pipes
@@ -3029,6 +3215,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
3029
3215
  TCloudUiNumberStepModule,
3030
3216
  TCloudUiScrollBoxModule,
3031
3217
  TCloudUiFiltersModule,
3218
+ TCloudUiAccordionModule,
3032
3219
  // Directives
3033
3220
  TCloudUiDirectiveModule,
3034
3221
  // Pipes
@@ -3049,6 +3236,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
3049
3236
  TCloudUiNumberStepModule,
3050
3237
  TCloudUiScrollBoxModule,
3051
3238
  TCloudUiFiltersModule,
3239
+ TCloudUiAccordionModule,
3052
3240
  // Directives
3053
3241
  TCloudUiDirectiveModule,
3054
3242
  // Pipes
@@ -3069,5 +3257,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
3069
3257
  * Generated bundle index. Do not edit.
3070
3258
  */
3071
3259
 
3072
- 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 };
3260
+ export { BytesPipe, CNPJPipe, CPFPipe, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$2 as CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR, MonthNamePipe, RespectivePipe, StatusInfoPipe, TCloudUiAccordionBodyComponent, TCloudUiAccordionComponent, TCloudUiAccordionModule, TCloudUiAccordionTitleComponent, 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 };
3073
3261
  //# sourceMappingURL=dev-tcloud-tcloud-ui.mjs.map