itc-components-library20 1.0.1 → 2.0.0

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,45 @@ 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
+ clicked = output();
3725
+ classes = computed(() => {
3726
+ const parts = ['btn', `btn--${this.variant()}`];
3727
+ if (this.icon() && !this.label())
3728
+ parts.push('btn--icon-only');
3729
+ else if (this.icon() && this.label())
3730
+ parts.push('btn--with-icon');
3731
+ else
3732
+ parts.push('btn--label-only');
3733
+ return parts.join(' ');
3734
+ }, ...(ngDevMode ? [{ debugName: "classes" }] : []));
3735
+ styles = computed(() => ({
3736
+ '--btn-bg': this.bgColor(),
3737
+ '--btn-color': this.textColor(),
3738
+ '--btn-border-color': this.borderColor(),
3739
+ '--btn-icon-color': this.iconColor()
3740
+ }), ...(ngDevMode ? [{ debugName: "styles" }] : []));
3741
+ handleClick() {
3742
+ this.clicked.emit();
3743
+ }
3744
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: Button, deps: [], target: i0.ɵɵFactoryTarget.Component });
3745
+ 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 } }, 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{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: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}\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"] }] });
3746
+ }
3747
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: Button, decorators: [{
3748
+ type: Component,
3749
+ 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{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: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}\n"] }]
3750
+ }] });
3751
+
3713
3752
  /*
3714
3753
  * Public API Surface of itc-library20
3715
3754
  */
@@ -3718,5 +3757,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImpor
3718
3757
  * Generated bundle index. Do not edit.
3719
3758
  */
3720
3759
 
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 };
3760
+ 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
3761
  //# sourceMappingURL=itc-components-library20.mjs.map