itc-components-library20 1.0.1 → 2.0.1

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.
@@ -1,9 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, EventEmitter, Output, Input, inject, ViewChild, HostListener, InjectionToken, Inject, Injectable } from '@angular/core';
2
+ import { Component, EventEmitter, Output, Input, inject, ViewChild, HostListener, InjectionToken, Inject, Injectable, input, output, computed } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i2 from '@fortawesome/angular-fontawesome';
6
- import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
6
+ import { FontAwesomeModule, FaIconComponent } from '@fortawesome/angular-fontawesome';
7
7
  import { Router } from '@angular/router';
8
8
  import * as fas from '@fortawesome/free-solid-svg-icons';
9
9
  import { faCircle, faStroopwafel, faChevronLeft, faChevronRight, faCirclePlus, faCircleCheck } from '@fortawesome/free-solid-svg-icons';
@@ -3710,6 +3710,55 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImpor
3710
3710
  args: [API_CONFIG]
3711
3711
  }] }] });
3712
3712
 
3713
+ class Button {
3714
+ variant = input('fourth', ...(ngDevMode ? [{ debugName: "variant" }] : []));
3715
+ label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
3716
+ icon = input(...(ngDevMode ? [undefined, { debugName: "icon" }] : []));
3717
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
3718
+ ariaLabel = input(...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : [])); //necessario per accessibilità, se il bottone ha solo un'icona
3719
+ //colori personalizzabili - default nero
3720
+ bgColor = input('#000', ...(ngDevMode ? [{ debugName: "bgColor" }] : []));
3721
+ textColor = input('#fff', ...(ngDevMode ? [{ debugName: "textColor" }] : []));
3722
+ borderColor = input('#000', ...(ngDevMode ? [{ debugName: "borderColor" }] : []));
3723
+ iconColor = input('#fff', ...(ngDevMode ? [{ debugName: "iconColor" }] : []));
3724
+ //hover
3725
+ bgColorHover = input('#333', ...(ngDevMode ? [{ debugName: "bgColorHover" }] : []));
3726
+ textColorHover = input('#fff', ...(ngDevMode ? [{ debugName: "textColorHover" }] : []));
3727
+ borderColorHover = input('#333', ...(ngDevMode ? [{ debugName: "borderColorHover" }] : []));
3728
+ iconColorHover = input('#fff', ...(ngDevMode ? [{ debugName: "iconColorHover" }] : []));
3729
+ clicked = output();
3730
+ classes = computed(() => {
3731
+ const parts = ['btn', `btn--${this.variant()}`];
3732
+ if (this.icon() && !this.label())
3733
+ parts.push('btn--icon-only');
3734
+ else if (this.icon() && this.label())
3735
+ parts.push('btn--with-icon');
3736
+ else
3737
+ parts.push('btn--label-only');
3738
+ return parts.join(' ');
3739
+ }, ...(ngDevMode ? [{ debugName: "classes" }] : []));
3740
+ styles = computed(() => ({
3741
+ '--btn-bg': this.bgColor(),
3742
+ '--btn-color': this.textColor(),
3743
+ '--btn-border-color': this.borderColor(),
3744
+ '--btn-icon-color': this.iconColor(),
3745
+ //colori hover
3746
+ '--btn-bg-hover': this.bgColorHover(),
3747
+ '--btn-color-hover': this.textColorHover(),
3748
+ '--btn-border-color-hover': this.borderColorHover(),
3749
+ '--btn-icon-color-hover': this.iconColorHover()
3750
+ }), ...(ngDevMode ? [{ debugName: "styles" }] : []));
3751
+ handleClick() {
3752
+ this.clicked.emit();
3753
+ }
3754
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: Button, deps: [], target: i0.ɵɵFactoryTarget.Component });
3755
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.4", type: Button, isStandalone: true, selector: "lib-button", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, bgColor: { classPropertyName: "bgColor", publicName: "bgColor", isSignal: true, isRequired: false, transformFunction: null }, textColor: { classPropertyName: "textColor", publicName: "textColor", isSignal: true, isRequired: false, transformFunction: null }, borderColor: { classPropertyName: "borderColor", publicName: "borderColor", isSignal: true, isRequired: false, transformFunction: null }, iconColor: { classPropertyName: "iconColor", publicName: "iconColor", isSignal: true, isRequired: false, transformFunction: null }, bgColorHover: { classPropertyName: "bgColorHover", publicName: "bgColorHover", isSignal: true, isRequired: false, transformFunction: null }, textColorHover: { classPropertyName: "textColorHover", publicName: "textColorHover", isSignal: true, isRequired: false, transformFunction: null }, borderColorHover: { classPropertyName: "borderColorHover", publicName: "borderColorHover", isSignal: true, isRequired: false, transformFunction: null }, iconColorHover: { classPropertyName: "iconColorHover", publicName: "iconColorHover", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<button\r\n [class]=\"classes()\"\r\n [style]=\"styles()\"\r\n [disabled]=\"disabled()\"\r\n [attr.aria-label]=\"ariaLabel()\"\r\n (click)=\"handleClick()\" \r\n>\r\n\r\n @if (icon()) {\r\n <span class=\"btn__icon\">\r\n <fa-icon [icon]=\"icon()!\"></fa-icon>\r\n </span>\r\n }\r\n\r\n @if (label()) {\r\n <span class=\"btn__label\">\r\n {{ label() }}\r\n </span>\r\n }\r\n\r\n</button>", styles: [":host{--btn-bg: #000;--btn-color: #fff;--btn-border-color: #000;--btn-icon-color: #fff;--btn-bg-hover: var(--btn-bg);--btn-color-hover: var(--btn-color);--btn-border-color-hover: var(--btn-border-color);--btn-icon-color-hover: var(--btn-icon-color)}.btn{display:inline-flex;align-items:center;cursor:pointer;background-color:var(--btn-bg);color:var(--btn-color);border:1px solid var(--btn-border-color)}.btn:disabled{cursor:not-allowed;opacity:.5}.btn--primary{padding:12px 30px;gap:5px;font-size:17px;font-weight:600;border-radius:14px}.btn--secondary{padding:10px 20px;gap:3px;font-size:17px;border-radius:12px}.btn--third{padding:10px 15px;gap:3px;border-radius:10px}.btn--fourth{padding:8px 10px;gap:3px;font-size:14px;border-radius:12px}.btn__icon{display:inline-flex;align-items:center;justify-content:center;color:var(--btn-icon-color);flex-shrink:0}.btn:hover:not(:disabled){background-color:var(--btn-bg-hover);color:var(--btn-color-hover);border-color:var(--btn-border-color-hover)}.btn:hover:not(:disabled) .btn__icon{color:var(--btn-icon-color-hover)}\n"], dependencies: [{ kind: "component", type: FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"], outputs: ["iconChange", "titleChange", "animationChange", "maskChange", "flipChange", "sizeChange", "pullChange", "borderChange", "inverseChange", "symbolChange", "rotateChange", "fixedWidthChange", "transformChange", "a11yRoleChange"] }] });
3756
+ }
3757
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: Button, decorators: [{
3758
+ type: Component,
3759
+ args: [{ selector: 'lib-button', imports: [FaIconComponent], template: "<button\r\n [class]=\"classes()\"\r\n [style]=\"styles()\"\r\n [disabled]=\"disabled()\"\r\n [attr.aria-label]=\"ariaLabel()\"\r\n (click)=\"handleClick()\" \r\n>\r\n\r\n @if (icon()) {\r\n <span class=\"btn__icon\">\r\n <fa-icon [icon]=\"icon()!\"></fa-icon>\r\n </span>\r\n }\r\n\r\n @if (label()) {\r\n <span class=\"btn__label\">\r\n {{ label() }}\r\n </span>\r\n }\r\n\r\n</button>", styles: [":host{--btn-bg: #000;--btn-color: #fff;--btn-border-color: #000;--btn-icon-color: #fff;--btn-bg-hover: var(--btn-bg);--btn-color-hover: var(--btn-color);--btn-border-color-hover: var(--btn-border-color);--btn-icon-color-hover: var(--btn-icon-color)}.btn{display:inline-flex;align-items:center;cursor:pointer;background-color:var(--btn-bg);color:var(--btn-color);border:1px solid var(--btn-border-color)}.btn:disabled{cursor:not-allowed;opacity:.5}.btn--primary{padding:12px 30px;gap:5px;font-size:17px;font-weight:600;border-radius:14px}.btn--secondary{padding:10px 20px;gap:3px;font-size:17px;border-radius:12px}.btn--third{padding:10px 15px;gap:3px;border-radius:10px}.btn--fourth{padding:8px 10px;gap:3px;font-size:14px;border-radius:12px}.btn__icon{display:inline-flex;align-items:center;justify-content:center;color:var(--btn-icon-color);flex-shrink:0}.btn:hover:not(:disabled){background-color:var(--btn-bg-hover);color:var(--btn-color-hover);border-color:var(--btn-border-color-hover)}.btn:hover:not(:disabled) .btn__icon{color:var(--btn-icon-color-hover)}\n"] }]
3760
+ }] });
3761
+
3713
3762
  /*
3714
3763
  * Public API Surface of itc-library20
3715
3764
  */
@@ -3718,5 +3767,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImpor
3718
3767
  * Generated bundle index. Do not edit.
3719
3768
  */
3720
3769
 
3721
- export { API_CONFIG, ApiAccountDictionaryService, ApiAccountService, ApiAdministrationService, ApiEventService, ApiExamAppointmentService, ApiExamDictionaryService, ApiExamService, ApiGeographyService, ApiKitService, ApiPatientDictionaryService, ApiPatientService, ApiReportService, ApiRequestDictionaryService, ApiRequestService, ApiStructureDictionaryService, ApiStructureService, ApiSurveyDictionaryService, ApiSurveyService, BasicTable, Calendar, CalendarView, FormatDate, ItcLibrary20, Message, Minio, PRIMENG_ITALIAN_LOCALE, PrimaryButton, PrimengItalianLocale, SecondaryButton, SortableTable, Survey, SurveyRadio, SurveyText, SurveyValuebox, ThirdButton };
3770
+ export { API_CONFIG, ApiAccountDictionaryService, ApiAccountService, ApiAdministrationService, ApiEventService, ApiExamAppointmentService, ApiExamDictionaryService, ApiExamService, ApiGeographyService, ApiKitService, ApiPatientDictionaryService, ApiPatientService, ApiReportService, ApiRequestDictionaryService, ApiRequestService, ApiStructureDictionaryService, ApiStructureService, ApiSurveyDictionaryService, ApiSurveyService, BasicTable, Button, Calendar, CalendarView, FormatDate, ItcLibrary20, Message, Minio, PRIMENG_ITALIAN_LOCALE, PrimaryButton, PrimengItalianLocale, SecondaryButton, SortableTable, Survey, SurveyRadio, SurveyText, SurveyValuebox, ThirdButton };
3722
3771
  //# sourceMappingURL=itc-components-library20.mjs.map