@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.
@@ -2943,6 +2943,188 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
2943
2943
  }]
2944
2944
  }] });
2945
2945
 
2946
+ class TCloudUiAccordionService {
2947
+ constructor() {
2948
+ this._stateToggle = new Subject();
2949
+ this.stateToggle$ = this._stateToggle.asObservable();
2950
+ this._stateLoading = new Subject();
2951
+ this.stateLoading$ = this._stateLoading.asObservable();
2952
+ this._stateDisabled = new Subject();
2953
+ this.stateDisabled$ = this._stateDisabled.asObservable();
2954
+ }
2955
+ toggle(action) {
2956
+ this._stateToggle.next(action);
2957
+ }
2958
+ getLoading() {
2959
+ return this.loading;
2960
+ }
2961
+ setLoading(loading) {
2962
+ this.loading = loading;
2963
+ this._stateLoading.next(loading);
2964
+ }
2965
+ getShow() {
2966
+ return this.show;
2967
+ }
2968
+ setDisabled(disabled) {
2969
+ this._stateDisabled.next(disabled);
2970
+ }
2971
+ getDisabled() {
2972
+ return this.disabled;
2973
+ }
2974
+ }
2975
+ TCloudUiAccordionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2976
+ TCloudUiAccordionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionService });
2977
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionService, decorators: [{
2978
+ type: Injectable
2979
+ }] });
2980
+
2981
+ class TCloudUiAccordionComponent {
2982
+ constructor(_tCloudUiAccordionService) {
2983
+ this._tCloudUiAccordionService = _tCloudUiAccordionService;
2984
+ this._disabled = false;
2985
+ this._show = false;
2986
+ this.onAction = new EventEmitter();
2987
+ this._loading = false;
2988
+ }
2989
+ set disabled(v) {
2990
+ this._disabled = v;
2991
+ if (this._disabled) {
2992
+ setTimeout(() => {
2993
+ this._tCloudUiAccordionService.setDisabled(this._disabled);
2994
+ this._tCloudUiAccordionService.toggle(false);
2995
+ });
2996
+ }
2997
+ }
2998
+ get disabled() { return this._disabled; }
2999
+ set show(v) {
3000
+ if (this._show !== v) {
3001
+ this._show = v;
3002
+ if (!this.disabled) {
3003
+ setTimeout(() => { this._tCloudUiAccordionService.toggle(this._show); });
3004
+ }
3005
+ }
3006
+ }
3007
+ get show() { return this._show; }
3008
+ /**
3009
+ * loading - boolean - Coloca o modal em modo de carregamento - default false
3010
+ */
3011
+ set loading(loading) {
3012
+ this._loading = loading;
3013
+ this._tCloudUiAccordionService.setLoading(loading);
3014
+ }
3015
+ get loading() { return this._loading; }
3016
+ ngOnInit() {
3017
+ this._tCloudUiAccordionService.stateLoading$.subscribe((loading) => {
3018
+ this.loading = loading;
3019
+ });
3020
+ this._tCloudUiAccordionService.stateToggle$.subscribe((show) => {
3021
+ this.onAction.emit((show === true) ? 'open' : 'close');
3022
+ });
3023
+ }
3024
+ }
3025
+ TCloudUiAccordionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionComponent, deps: [{ token: TCloudUiAccordionService }], target: i0.ɵɵFactoryTarget.Component });
3026
+ 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: [
3027
+ TCloudUiAccordionService
3028
+ ], 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"] });
3029
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionComponent, decorators: [{
3030
+ type: Component,
3031
+ args: [{ selector: 'tcloud-ui-accordion', providers: [
3032
+ TCloudUiAccordionService
3033
+ ], 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"] }]
3034
+ }], ctorParameters: function () { return [{ type: TCloudUiAccordionService }]; }, propDecorators: { disabled: [{
3035
+ type: Input
3036
+ }], show: [{
3037
+ type: Input
3038
+ }], onAction: [{
3039
+ type: Output
3040
+ }], loading: [{
3041
+ type: Input
3042
+ }] } });
3043
+
3044
+ class TCloudUiAccordionTitleComponent {
3045
+ constructor(_tCloudUiAccordionService) {
3046
+ this._tCloudUiAccordionService = _tCloudUiAccordionService;
3047
+ this.show = false;
3048
+ this.loading = false;
3049
+ this.disabled = false;
3050
+ }
3051
+ ngOnInit() {
3052
+ this.loading = this._tCloudUiAccordionService.getLoading() || false;
3053
+ this._tCloudUiAccordionService.stateLoading$.subscribe((loading) => {
3054
+ this.loading = loading;
3055
+ });
3056
+ this.show = this._tCloudUiAccordionService.getShow() || false;
3057
+ this._tCloudUiAccordionService.stateToggle$.subscribe((show) => {
3058
+ this.show = show;
3059
+ });
3060
+ this.disabled = this._tCloudUiAccordionService.getDisabled() || false;
3061
+ this._tCloudUiAccordionService.stateDisabled$.subscribe((disabled) => {
3062
+ this.disabled = disabled;
3063
+ });
3064
+ }
3065
+ toggle() {
3066
+ console.log('this.disabled', this.disabled);
3067
+ if (this.disabled) {
3068
+ return;
3069
+ }
3070
+ this.show = !this.show;
3071
+ this._tCloudUiAccordionService.toggle(this.show);
3072
+ }
3073
+ }
3074
+ TCloudUiAccordionTitleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionTitleComponent, deps: [{ token: TCloudUiAccordionService }], target: i0.ɵɵFactoryTarget.Component });
3075
+ 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"] }] });
3076
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionTitleComponent, decorators: [{
3077
+ type: Component,
3078
+ 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"] }]
3079
+ }], ctorParameters: function () { return [{ type: TCloudUiAccordionService }]; } });
3080
+
3081
+ class TCloudUiAccordionBodyComponent {
3082
+ constructor(_tCloudUiAccordionService) {
3083
+ this._tCloudUiAccordionService = _tCloudUiAccordionService;
3084
+ this.show = false;
3085
+ }
3086
+ ngOnInit() {
3087
+ this.show = this._tCloudUiAccordionService.getShow() || false;
3088
+ this._tCloudUiAccordionService.stateToggle$.subscribe((show) => {
3089
+ this.show = show;
3090
+ });
3091
+ }
3092
+ }
3093
+ TCloudUiAccordionBodyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionBodyComponent, deps: [{ token: TCloudUiAccordionService }], target: i0.ɵɵFactoryTarget.Component });
3094
+ 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"] });
3095
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionBodyComponent, decorators: [{
3096
+ type: Component,
3097
+ 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"] }]
3098
+ }], ctorParameters: function () { return [{ type: TCloudUiAccordionService }]; } });
3099
+
3100
+ class TCloudUiAccordionModule {
3101
+ }
3102
+ TCloudUiAccordionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3103
+ TCloudUiAccordionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionModule, declarations: [TCloudUiAccordionComponent,
3104
+ TCloudUiAccordionTitleComponent,
3105
+ TCloudUiAccordionBodyComponent], imports: [CommonModule], exports: [TCloudUiAccordionComponent,
3106
+ TCloudUiAccordionTitleComponent,
3107
+ TCloudUiAccordionBodyComponent] });
3108
+ TCloudUiAccordionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionModule, imports: [CommonModule] });
3109
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiAccordionModule, decorators: [{
3110
+ type: NgModule,
3111
+ args: [{
3112
+ declarations: [
3113
+ TCloudUiAccordionComponent,
3114
+ TCloudUiAccordionTitleComponent,
3115
+ TCloudUiAccordionBodyComponent
3116
+ ],
3117
+ exports: [
3118
+ TCloudUiAccordionComponent,
3119
+ TCloudUiAccordionTitleComponent,
3120
+ TCloudUiAccordionBodyComponent
3121
+ ],
3122
+ imports: [
3123
+ CommonModule
3124
+ ]
3125
+ }]
3126
+ }] });
3127
+
2946
3128
  class TCloudUiModule {
2947
3129
  }
2948
3130
  TCloudUiModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
@@ -2960,6 +3142,7 @@ TCloudUiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
2960
3142
  TCloudUiNumberStepModule,
2961
3143
  TCloudUiScrollBoxModule,
2962
3144
  TCloudUiFiltersModule,
3145
+ TCloudUiAccordionModule,
2963
3146
  // Directives
2964
3147
  TCloudUiDirectiveModule,
2965
3148
  // Pipes
@@ -2977,6 +3160,7 @@ TCloudUiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
2977
3160
  TCloudUiNumberStepModule,
2978
3161
  TCloudUiScrollBoxModule,
2979
3162
  TCloudUiFiltersModule,
3163
+ TCloudUiAccordionModule,
2980
3164
  // Directives
2981
3165
  TCloudUiDirectiveModule,
2982
3166
  // Pipes
@@ -2998,6 +3182,7 @@ TCloudUiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version:
2998
3182
  TCloudUiNumberStepModule,
2999
3183
  TCloudUiScrollBoxModule,
3000
3184
  TCloudUiFiltersModule,
3185
+ TCloudUiAccordionModule,
3001
3186
  // Directives
3002
3187
  TCloudUiDirectiveModule,
3003
3188
  // Pipes
@@ -3015,6 +3200,7 @@ TCloudUiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version:
3015
3200
  TCloudUiNumberStepModule,
3016
3201
  TCloudUiScrollBoxModule,
3017
3202
  TCloudUiFiltersModule,
3203
+ TCloudUiAccordionModule,
3018
3204
  // Directives
3019
3205
  TCloudUiDirectiveModule,
3020
3206
  // Pipes
@@ -3037,6 +3223,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
3037
3223
  TCloudUiNumberStepModule,
3038
3224
  TCloudUiScrollBoxModule,
3039
3225
  TCloudUiFiltersModule,
3226
+ TCloudUiAccordionModule,
3040
3227
  // Directives
3041
3228
  TCloudUiDirectiveModule,
3042
3229
  // Pipes
@@ -3057,6 +3244,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
3057
3244
  TCloudUiNumberStepModule,
3058
3245
  TCloudUiScrollBoxModule,
3059
3246
  TCloudUiFiltersModule,
3247
+ TCloudUiAccordionModule,
3060
3248
  // Directives
3061
3249
  TCloudUiDirectiveModule,
3062
3250
  // Pipes
@@ -3077,5 +3265,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
3077
3265
  * Generated bundle index. Do not edit.
3078
3266
  */
3079
3267
 
3080
- 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 };
3268
+ 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 };
3081
3269
  //# sourceMappingURL=dev-tcloud-tcloud-ui.mjs.map