@sixbell-telco/sdk 0.1.3 → 0.1.5
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/CHANGELOG.md +128 -4
- package/README.md +53 -45
- package/components/accordion/accordion-item/accordion-item.component.d.ts +9 -6
- package/components/avatar/src/avatar.component.d.ts +17 -12
- package/components/button/src/button.component.d.ts +29 -28
- package/components/card/src/card.component.d.ts +18 -12
- package/components/dropdown/src/dropdown.component.d.ts +29 -27
- package/components/dual-list/src/dual-list.component.d.ts +47 -37
- package/components/file-upload/file-uploader/src/file-uploader.component.d.ts +20 -11
- package/components/forms/checkbox/src/checkbox.component.d.ts +7 -3
- package/components/forms/combobox/src/combobox.component.d.ts +17 -16
- package/components/forms/input/src/input.component.d.ts +20 -15
- package/components/forms/radio/src/radio.component.d.ts +14 -1
- package/components/forms/range/src/range.component.d.ts +11 -11
- package/components/forms/select/src/select.component.d.ts +17 -15
- package/components/forms/switch/src/switch.component.d.ts +11 -11
- package/components/forms/textarea/src/textarea.component.d.ts +20 -16
- package/components/forms/toggle/src/toggle.component.d.ts +12 -7
- package/components/icon/src/icon.component.d.ts +12 -7
- package/components/link/src/link.component.d.ts +27 -16
- package/components/modal/src/modal.component.d.ts +18 -7
- package/components/notification/src/notification.component.d.ts +15 -7
- package/components/paginator/components/pagination-item/pagination-item.component.d.ts +18 -7
- package/components/product-card/src/product-card.component.d.ts +42 -17
- package/components/progress/src/progress.component.d.ts +9 -7
- package/components/tab/directives/tab-content/tab-content.directive.d.ts +8 -10
- package/components/tab/directives/tab-header/tab-header.directive.d.ts +9 -12
- package/components/tab/src/tab.component.d.ts +14 -9
- package/components/table/src/table.component.d.ts +28 -17
- package/components/toast/toast-message/toast-message.component.d.ts +9 -7
- package/components/tooltip/src/tooltip.component.d.ts +12 -7
- package/components/wizard/wizard-content/wizard-content.component.d.ts +3 -3
- package/directives/typography/src/typography.directive.d.ts +13 -12
- package/esm2022/components/accordion/accordion-item/accordion-item.component.mjs +7 -7
- package/esm2022/components/accordion/src/accordion.component.mjs +3 -3
- package/esm2022/components/avatar/src/avatar.component.mjs +7 -7
- package/esm2022/components/button/src/button.component.mjs +13 -11
- package/esm2022/components/card/src/card.component.mjs +7 -7
- package/esm2022/components/dropdown/src/dropdown.component.mjs +15 -11
- package/esm2022/components/dual-list/src/dual-list.component.mjs +53 -33
- package/esm2022/components/file-upload/file-dropzone/src/file-dropzone.component.mjs +3 -4
- package/esm2022/components/file-upload/file-uploader/src/file-uploader.component.mjs +28 -22
- package/esm2022/components/forms/checkbox/src/checkbox.component.mjs +9 -9
- package/esm2022/components/forms/combobox/src/combobox.component.mjs +31 -28
- package/esm2022/components/forms/datepicker/src/datepicker.component.mjs +3 -3
- package/esm2022/components/forms/form-error/src/form-error.component.mjs +3 -3
- package/esm2022/components/forms/input/src/input.component.mjs +34 -34
- package/esm2022/components/forms/radio/src/radio.component.mjs +53 -4
- package/esm2022/components/forms/range/src/range.component.mjs +14 -13
- package/esm2022/components/forms/select/src/select.component.mjs +30 -28
- package/esm2022/components/forms/switch/src/switch.component.mjs +15 -14
- package/esm2022/components/forms/textarea/src/textarea.component.mjs +35 -36
- package/esm2022/components/forms/toggle/src/toggle.component.mjs +113 -90
- package/esm2022/components/icon/src/icon.component.mjs +9 -8
- package/esm2022/components/link/src/link.component.mjs +26 -20
- package/esm2022/components/modal/src/modal.component.mjs +17 -13
- package/esm2022/components/notification/src/notification.component.mjs +10 -8
- package/esm2022/components/paginator/components/pagination-item/pagination-item.component.mjs +18 -15
- package/esm2022/components/paginator/src/paginator.component.mjs +3 -3
- package/esm2022/components/product-card/src/product-card.component.mjs +52 -46
- package/esm2022/components/progress/src/progress.component.mjs +11 -11
- package/esm2022/components/tab/directives/tab-content/tab-content.directive.mjs +14 -13
- package/esm2022/components/tab/directives/tab-header/tab-header.directive.mjs +17 -15
- package/esm2022/components/tab/src/tab.component.mjs +17 -15
- package/esm2022/components/table/src/table.component.mjs +32 -23
- package/esm2022/components/table/table-header-checkbox/table-header-checkbox.component.mjs +1 -1
- package/esm2022/components/table/table-row-checkbox/table-row-checkbox.component.mjs +1 -1
- package/esm2022/components/toast/toast-message/toast-message.component.mjs +22 -17
- package/esm2022/components/toast/toasts-container/toasts-container.component.mjs +2 -2
- package/esm2022/components/tooltip/src/tooltip.component.mjs +12 -10
- package/esm2022/components/wizard/wizard-content/wizard-content.component.mjs +6 -6
- package/esm2022/components/wizard/wizard-marker/wizard-marker.component.mjs +3 -3
- package/esm2022/components/wizard/wizard-step/wizard-step.component.mjs +3 -4
- package/esm2022/components/wizard/wizard-wrapper/wizard-wrapper.component.mjs +3 -11
- package/esm2022/directives/typography/src/typography.directive.mjs +9 -6
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs +9 -9
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs +7 -7
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-button.mjs +13 -11
- package/fesm2022/sixbell-telco-sdk-components-button.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-card.mjs +7 -7
- package/fesm2022/sixbell-telco-sdk-components-card.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +15 -11
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +51 -31
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-file-upload-file-dropzone.mjs +2 -3
- package/fesm2022/sixbell-telco-sdk-components-file-upload-file-dropzone.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-file-upload-file-uploader.mjs +27 -21
- package/fesm2022/sixbell-telco-sdk-components-file-upload-file-uploader.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs +8 -8
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +30 -27
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-datepicker.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-datepicker.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +33 -33
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs +52 -3
- package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs +13 -12
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +29 -27
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs +14 -13
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs +34 -35
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs +113 -90
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-icon.mjs +9 -8
- package/fesm2022/sixbell-telco-sdk-components-icon.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-link.mjs +26 -20
- package/fesm2022/sixbell-telco-sdk-components-link.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-modal.mjs +17 -13
- package/fesm2022/sixbell-telco-sdk-components-modal.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-notification.mjs +10 -8
- package/fesm2022/sixbell-telco-sdk-components-notification.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +20 -17
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-product-card.mjs +52 -46
- package/fesm2022/sixbell-telco-sdk-components-product-card.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-progress.mjs +11 -11
- package/fesm2022/sixbell-telco-sdk-components-progress.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs +46 -41
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-table.mjs +35 -25
- package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-toast.mjs +23 -18
- package/fesm2022/sixbell-telco-sdk-components-toast.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs +12 -10
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs +11 -19
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-typography.mjs +8 -5
- package/fesm2022/sixbell-telco-sdk-directives-typography.mjs.map +1 -1
- package/package.json +9 -3
|
@@ -2,7 +2,6 @@ import { NgClass } from '@angular/common';
|
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { input, output, model, Component } from '@angular/core';
|
|
4
4
|
import { ButtonComponent } from '@sixbell-telco/sdk/components/button';
|
|
5
|
-
import { IconComponent } from '@sixbell-telco/sdk/components/icon';
|
|
6
5
|
import { TableComponent } from '@sixbell-telco/sdk/components/table';
|
|
7
6
|
import { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';
|
|
8
7
|
import { ExtractExtensionPipe } from '@sixbell-telco/sdk/utils/pipes/extract-extension';
|
|
@@ -28,11 +27,11 @@ class DropzoneComponent {
|
|
|
28
27
|
this.files.set(files);
|
|
29
28
|
}
|
|
30
29
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: DropzoneComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
31
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.8", type: DropzoneComponent, isStandalone: true, selector: "app-file-dropzone", inputs: { maxFiles: { classPropertyName: "maxFiles", publicName: "maxFiles", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null }, showFiles: { classPropertyName: "showFiles", publicName: "showFiles", isSignal: true, isRequired: false, transformFunction: null }, extensions: { classPropertyName: "extensions", publicName: "extensions", isSignal: true, isRequired: false, transformFunction: null }, uploading: { classPropertyName: "uploading", publicName: "uploading", isSignal: true, isRequired: false, transformFunction: null }, files: { classPropertyName: "files", publicName: "files", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onDrop: "onDrop", files: "filesChange" }, ngImport: i0, template: "<ngx-dropzone (change)=\"handleDrop($event.addedFiles)\" [disabled]=\"uploading()\">\n\t<ngx-dropzone-label>\n\t\t@if (!uploading()) {\n\t\t\t<div [
|
|
30
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.8", type: DropzoneComponent, isStandalone: true, selector: "app-file-dropzone", inputs: { maxFiles: { classPropertyName: "maxFiles", publicName: "maxFiles", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null }, showFiles: { classPropertyName: "showFiles", publicName: "showFiles", isSignal: true, isRequired: false, transformFunction: null }, extensions: { classPropertyName: "extensions", publicName: "extensions", isSignal: true, isRequired: false, transformFunction: null }, uploading: { classPropertyName: "uploading", publicName: "uploading", isSignal: true, isRequired: false, transformFunction: null }, files: { classPropertyName: "files", publicName: "files", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onDrop: "onDrop", files: "filesChange" }, ngImport: i0, template: "<ngx-dropzone (change)=\"handleDrop($event.addedFiles)\" [disabled]=\"uploading()\">\n\t<ngx-dropzone-label>\n\t\t@if (!uploading()) {\n\t\t\t<div typography [typographyVariant]=\"'body-sm'\">Haga clic y seleccione archivos o su\u00E9ltelos aqu\u00ED</div>\n\n\t\t\t@if (maxFileSize() > 0) {\n\t\t\t\t<div class=\"mt-1\">\n\t\t\t\t\t<span typography [typographyVariant]=\"'body-xs'\">\n\t\t\t\t\t\tTama\u00F1o m\u00E1ximo por archivo: <span class=\"primary-text\">{{ maxFileSize() | toBytes }}</span>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t}\n\n\t\t\t@if (extensions().length > 0) {\n\t\t\t\t<div class=\"mt-1\">\n\t\t\t\t\t<span typography [typographyVariant]=\"'body-xs'\">\n\t\t\t\t\t\tArchivos aceptados: <span class=\"primary-text\">{{ extensions().join(', ') }}</span>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t}\n\t\t} @else {\n\t\t\t<div class=\"upload-progress\">\n\t\t\t\t<div class=\"mini-text mb-2\">Cargando archivos...</div>\n\t\t\t\t<div class=\"progress\"></div>\n\t\t\t</div>\n\t\t}\n\t</ngx-dropzone-label>\n</ngx-dropzone>\n\n@if (maxFiles() > 0) {\n\t<div class=\"mt-1 flex justify-end\">\n\t\t<div typography [typographyVariant]=\"'body-xs'\">\n\t\t\t<span [ngClass]=\"{ 'text-error': files().length > maxFiles() }\">\n\t\t\t\t{{ files().length }} {{ files().length === 1 ? 'archivo' : 'archivos' }} cargado de un maximo de {{ maxFiles() }}\n\t\t\t\t{{ maxFiles() === 1 ? 'archivo' : 'archivos' }}</span\n\t\t\t>\n\t\t</div>\n\t</div>\n}\n\n<!-- TODO: hacer la tabla mas chiquita y bonita :) -->\n@if (showFiles() && files().length > 0) {\n\t<app-table variant=\"zebra\" size=\"sm\" [data]=\"files()\">\n\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th scope=\"col\">Archivo</th>\n\t\t\t\t<th scope=\"col\"></th>\n\t\t\t\t<th scope=\"col\"></th>\n\t\t\t</tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t@for (file of files(); track $index) {\n\t\t\t\t<tr>\n\t\t\t\t\t@let tooBig = file.size > maxFileSize();\n\t\t\t\t\t@let extensionsList = extensions();\n\t\t\t\t\t@let hasExtension = extensionsList.length === 0 || (extensionsList.length > 0 && extensionsList.includes(file.name | extractExtension));\n\n\t\t\t\t\t<td [ngClass]=\"{ 'text-error': tooBig || !hasExtension }\">\n\t\t\t\t\t\t<span typography [typographyVariant]=\"'body-xs'\" [typographyColor]=\"'inherit'\">{{ file.name }}</span>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t@if (!hasExtension) {\n\t\t\t\t\t\t\t<span typography [typographyVariant]=\"'body-xs'\">La extensi\u00F3n del archivo no es v\u00E1lida</span>\n\t\t\t\t\t\t} @else if (tooBig) {\n\t\t\t\t\t\t\t<span typography [typographyVariant]=\"'body-xs'\">El tama\u00F1o del archivo excede el l\u00EDmite permitido</span>\n\t\t\t\t\t\t}\n\t\t\t\t\t</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<app-button variant=\"icon\" shape=\"round-sm\" iconName=\"trash-can\" (click)=\"handleRemove(file)\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t}\n\t\t</tbody>\n\t</app-table>\n}\n", dependencies: [{ kind: "ngmodule", type: NgxDropzoneModule }, { kind: "component", type: i1.NgxDropzoneComponent, selector: "ngx-dropzone, [ngx-dropzone]", inputs: ["accept", "disabled", "multiple", "maxFileSize", "expandable", "disableClick", "processDirectoryDrop", "id", "aria-label", "aria-labelledby", "aria-describedby"], outputs: ["change"] }, { kind: "directive", type: i1.NgxDropzoneLabelDirective, selector: "ngx-dropzone-label" }, { kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["typographyVariant", "typographyColor", "typographyFontWeight", "classes"] }, { kind: "pipe", type: ToBytesPipe, name: "toBytes" }, { kind: "pipe", type: ExtractExtensionPipe, name: "extractExtension" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: TableComponent, selector: "app-table", inputs: ["variant", "size", "height", "shadow", "shape", "contentClasses", "containerClasses", "paginatorType", "data", "totalItems", "error", "pagination", "maxSize", "showItemsPerPage", "showEntries"], outputs: ["onPageChange", "onPageSizeChange", "onCheck"] }, { kind: "component", type: ButtonComponent, selector: "app-button", inputs: ["variant", "shape", "padding", "height", "width", "alignment", "iconPosition", "fontSize", "containerClasses", "iconClasses", "label", "type", "iconName", "disabled"] }] });
|
|
32
31
|
}
|
|
33
32
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: DropzoneComponent, decorators: [{
|
|
34
33
|
type: Component,
|
|
35
|
-
args: [{ selector: 'app-file-dropzone', standalone: true, imports: [NgxDropzoneModule, TypographyDirective, ToBytesPipe, ExtractExtensionPipe, NgClass, TableComponent,
|
|
34
|
+
args: [{ selector: 'app-file-dropzone', standalone: true, imports: [NgxDropzoneModule, TypographyDirective, ToBytesPipe, ExtractExtensionPipe, NgClass, TableComponent, ButtonComponent], template: "<ngx-dropzone (change)=\"handleDrop($event.addedFiles)\" [disabled]=\"uploading()\">\n\t<ngx-dropzone-label>\n\t\t@if (!uploading()) {\n\t\t\t<div typography [typographyVariant]=\"'body-sm'\">Haga clic y seleccione archivos o su\u00E9ltelos aqu\u00ED</div>\n\n\t\t\t@if (maxFileSize() > 0) {\n\t\t\t\t<div class=\"mt-1\">\n\t\t\t\t\t<span typography [typographyVariant]=\"'body-xs'\">\n\t\t\t\t\t\tTama\u00F1o m\u00E1ximo por archivo: <span class=\"primary-text\">{{ maxFileSize() | toBytes }}</span>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t}\n\n\t\t\t@if (extensions().length > 0) {\n\t\t\t\t<div class=\"mt-1\">\n\t\t\t\t\t<span typography [typographyVariant]=\"'body-xs'\">\n\t\t\t\t\t\tArchivos aceptados: <span class=\"primary-text\">{{ extensions().join(', ') }}</span>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t}\n\t\t} @else {\n\t\t\t<div class=\"upload-progress\">\n\t\t\t\t<div class=\"mini-text mb-2\">Cargando archivos...</div>\n\t\t\t\t<div class=\"progress\"></div>\n\t\t\t</div>\n\t\t}\n\t</ngx-dropzone-label>\n</ngx-dropzone>\n\n@if (maxFiles() > 0) {\n\t<div class=\"mt-1 flex justify-end\">\n\t\t<div typography [typographyVariant]=\"'body-xs'\">\n\t\t\t<span [ngClass]=\"{ 'text-error': files().length > maxFiles() }\">\n\t\t\t\t{{ files().length }} {{ files().length === 1 ? 'archivo' : 'archivos' }} cargado de un maximo de {{ maxFiles() }}\n\t\t\t\t{{ maxFiles() === 1 ? 'archivo' : 'archivos' }}</span\n\t\t\t>\n\t\t</div>\n\t</div>\n}\n\n<!-- TODO: hacer la tabla mas chiquita y bonita :) -->\n@if (showFiles() && files().length > 0) {\n\t<app-table variant=\"zebra\" size=\"sm\" [data]=\"files()\">\n\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th scope=\"col\">Archivo</th>\n\t\t\t\t<th scope=\"col\"></th>\n\t\t\t\t<th scope=\"col\"></th>\n\t\t\t</tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t@for (file of files(); track $index) {\n\t\t\t\t<tr>\n\t\t\t\t\t@let tooBig = file.size > maxFileSize();\n\t\t\t\t\t@let extensionsList = extensions();\n\t\t\t\t\t@let hasExtension = extensionsList.length === 0 || (extensionsList.length > 0 && extensionsList.includes(file.name | extractExtension));\n\n\t\t\t\t\t<td [ngClass]=\"{ 'text-error': tooBig || !hasExtension }\">\n\t\t\t\t\t\t<span typography [typographyVariant]=\"'body-xs'\" [typographyColor]=\"'inherit'\">{{ file.name }}</span>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t@if (!hasExtension) {\n\t\t\t\t\t\t\t<span typography [typographyVariant]=\"'body-xs'\">La extensi\u00F3n del archivo no es v\u00E1lida</span>\n\t\t\t\t\t\t} @else if (tooBig) {\n\t\t\t\t\t\t\t<span typography [typographyVariant]=\"'body-xs'\">El tama\u00F1o del archivo excede el l\u00EDmite permitido</span>\n\t\t\t\t\t\t}\n\t\t\t\t\t</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<app-button variant=\"icon\" shape=\"round-sm\" iconName=\"trash-can\" (click)=\"handleRemove(file)\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t}\n\t\t</tbody>\n\t</app-table>\n}\n" }]
|
|
36
35
|
}] });
|
|
37
36
|
|
|
38
37
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sixbell-telco-sdk-components-file-upload-file-dropzone.mjs","sources":["../../../projects/sdk/components/file-upload/file-dropzone/src/file-dropzone.component.ts","../../../projects/sdk/components/file-upload/file-dropzone/src/file-dropzone.component.html","../../../projects/sdk/components/file-upload/file-dropzone/sixbell-telco-sdk-components-file-upload-file-dropzone.ts"],"sourcesContent":["import { NgClass } from '@angular/common';\nimport { Component, input, model, output } from '@angular/core';\nimport { ButtonComponent } from '@sixbell-telco/sdk/components/button';\nimport {
|
|
1
|
+
{"version":3,"file":"sixbell-telco-sdk-components-file-upload-file-dropzone.mjs","sources":["../../../projects/sdk/components/file-upload/file-dropzone/src/file-dropzone.component.ts","../../../projects/sdk/components/file-upload/file-dropzone/src/file-dropzone.component.html","../../../projects/sdk/components/file-upload/file-dropzone/sixbell-telco-sdk-components-file-upload-file-dropzone.ts"],"sourcesContent":["import { NgClass } from '@angular/common';\nimport { Component, input, model, output } from '@angular/core';\nimport { ButtonComponent } from '@sixbell-telco/sdk/components/button';\nimport { TableComponent } from '@sixbell-telco/sdk/components/table';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\nimport { ExtractExtensionPipe } from '@sixbell-telco/sdk/utils/pipes/extract-extension';\nimport { ToBytesPipe } from '@sixbell-telco/sdk/utils/pipes/to-bytes-extesion';\nimport { NgxDropzoneModule } from 'ngx-dropzone';\n\n@Component({\n\tselector: 'app-file-dropzone',\n\tstandalone: true,\n\timports: [NgxDropzoneModule, TypographyDirective, ToBytesPipe, ExtractExtensionPipe, NgClass, TableComponent, ButtonComponent],\n\ttemplateUrl: './file-dropzone.component.html',\n})\nexport class DropzoneComponent {\n\tmaxFiles = input(1);\n\tmaxFileSize = input(0);\n\tshowFiles = input(true);\n\textensions = input<string[]>([]);\n\tuploading = input(false);\n\tonDrop = output<File[]>();\n\n\tfiles = model<File[]>([]);\n\n\thandleDrop(files: File[]) {\n\t\tthis.files.update((currentFiles) => [...currentFiles, ...files]);\n\t\tthis.onDrop.emit(files);\n\t}\n\n\thandleRemove(file: File) {\n\t\tconst files = this.files();\n\t\tfiles.splice(files.indexOf(file), 1);\n\t\tthis.files.set(files);\n\t}\n}\n","<ngx-dropzone (change)=\"handleDrop($event.addedFiles)\" [disabled]=\"uploading()\">\n\t<ngx-dropzone-label>\n\t\t@if (!uploading()) {\n\t\t\t<div typography [typographyVariant]=\"'body-sm'\">Haga clic y seleccione archivos o suéltelos aquí</div>\n\n\t\t\t@if (maxFileSize() > 0) {\n\t\t\t\t<div class=\"mt-1\">\n\t\t\t\t\t<span typography [typographyVariant]=\"'body-xs'\">\n\t\t\t\t\t\tTamaño máximo por archivo: <span class=\"primary-text\">{{ maxFileSize() | toBytes }}</span>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t}\n\n\t\t\t@if (extensions().length > 0) {\n\t\t\t\t<div class=\"mt-1\">\n\t\t\t\t\t<span typography [typographyVariant]=\"'body-xs'\">\n\t\t\t\t\t\tArchivos aceptados: <span class=\"primary-text\">{{ extensions().join(', ') }}</span>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t}\n\t\t} @else {\n\t\t\t<div class=\"upload-progress\">\n\t\t\t\t<div class=\"mini-text mb-2\">Cargando archivos...</div>\n\t\t\t\t<div class=\"progress\"></div>\n\t\t\t</div>\n\t\t}\n\t</ngx-dropzone-label>\n</ngx-dropzone>\n\n@if (maxFiles() > 0) {\n\t<div class=\"mt-1 flex justify-end\">\n\t\t<div typography [typographyVariant]=\"'body-xs'\">\n\t\t\t<span [ngClass]=\"{ 'text-error': files().length > maxFiles() }\">\n\t\t\t\t{{ files().length }} {{ files().length === 1 ? 'archivo' : 'archivos' }} cargado de un maximo de {{ maxFiles() }}\n\t\t\t\t{{ maxFiles() === 1 ? 'archivo' : 'archivos' }}</span\n\t\t\t>\n\t\t</div>\n\t</div>\n}\n\n<!-- TODO: hacer la tabla mas chiquita y bonita :) -->\n@if (showFiles() && files().length > 0) {\n\t<app-table variant=\"zebra\" size=\"sm\" [data]=\"files()\">\n\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th scope=\"col\">Archivo</th>\n\t\t\t\t<th scope=\"col\"></th>\n\t\t\t\t<th scope=\"col\"></th>\n\t\t\t</tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t@for (file of files(); track $index) {\n\t\t\t\t<tr>\n\t\t\t\t\t@let tooBig = file.size > maxFileSize();\n\t\t\t\t\t@let extensionsList = extensions();\n\t\t\t\t\t@let hasExtension = extensionsList.length === 0 || (extensionsList.length > 0 && extensionsList.includes(file.name | extractExtension));\n\n\t\t\t\t\t<td [ngClass]=\"{ 'text-error': tooBig || !hasExtension }\">\n\t\t\t\t\t\t<span typography [typographyVariant]=\"'body-xs'\" [typographyColor]=\"'inherit'\">{{ file.name }}</span>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t@if (!hasExtension) {\n\t\t\t\t\t\t\t<span typography [typographyVariant]=\"'body-xs'\">La extensión del archivo no es válida</span>\n\t\t\t\t\t\t} @else if (tooBig) {\n\t\t\t\t\t\t\t<span typography [typographyVariant]=\"'body-xs'\">El tamaño del archivo excede el límite permitido</span>\n\t\t\t\t\t\t}\n\t\t\t\t\t</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<app-button variant=\"icon\" shape=\"round-sm\" iconName=\"trash-can\" (click)=\"handleRemove(file)\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t}\n\t\t</tbody>\n\t</app-table>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;MAea,iBAAiB,CAAA;AAC7B,IAAA,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AACpB,IAAA,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AACvB,IAAA,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;AACxB,IAAA,UAAU,GAAG,KAAK,CAAW,EAAE,CAAC,CAAC;AACjC,IAAA,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;IACzB,MAAM,GAAG,MAAM,EAAU,CAAC;AAE1B,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,CAAC,CAAC;AAE1B,IAAA,UAAU,CAAC,KAAa,EAAA;AACvB,QAAA,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,YAAY,KAAK,CAAC,GAAG,YAAY,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC;AACjE,QAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACxB;AAED,IAAA,YAAY,CAAC,IAAU,EAAA;AACtB,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;AAC3B,QAAA,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;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i1FAAA,EAAA,CAAA;;;AEZ/H;;AAEG;;;;"}
|
|
@@ -7,8 +7,11 @@ import { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';
|
|
|
7
7
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
8
8
|
class FileUploaderComponent {
|
|
9
9
|
// Base input properties
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
variant = input('secondary');
|
|
11
|
+
shape = input('round-sm');
|
|
12
|
+
size = input('md');
|
|
13
|
+
padding = input('md');
|
|
14
|
+
classes = input('');
|
|
12
15
|
label = input('');
|
|
13
16
|
name = input(null);
|
|
14
17
|
placeholder = input('');
|
|
@@ -73,46 +76,49 @@ class FileUploaderComponent {
|
|
|
73
76
|
this._onChange(null);
|
|
74
77
|
}
|
|
75
78
|
// Style Getters
|
|
76
|
-
|
|
77
|
-
return
|
|
79
|
+
componentClass() {
|
|
80
|
+
return {
|
|
81
|
+
variant: 'secondary',
|
|
82
|
+
shape: 'round-md',
|
|
83
|
+
size: 'md',
|
|
84
|
+
padding: 'md',
|
|
85
|
+
};
|
|
78
86
|
}
|
|
79
|
-
|
|
80
|
-
const variants = this.variants();
|
|
87
|
+
errorClass() {
|
|
81
88
|
return {
|
|
82
89
|
variant: 'error',
|
|
83
|
-
shape:
|
|
84
|
-
size:
|
|
85
|
-
padding:
|
|
90
|
+
shape: this.shape(),
|
|
91
|
+
size: this.size(),
|
|
92
|
+
padding: this.padding(),
|
|
86
93
|
};
|
|
87
94
|
}
|
|
88
|
-
|
|
89
|
-
const variants = this.variants();
|
|
95
|
+
successClass() {
|
|
90
96
|
return {
|
|
91
97
|
variant: 'success',
|
|
92
|
-
shape:
|
|
93
|
-
size:
|
|
94
|
-
padding:
|
|
98
|
+
shape: this.shape(),
|
|
99
|
+
size: this.size(),
|
|
100
|
+
padding: this.padding(),
|
|
95
101
|
};
|
|
96
102
|
}
|
|
97
|
-
|
|
103
|
+
validationClass() {
|
|
98
104
|
if (!this.formField)
|
|
99
|
-
return this.
|
|
105
|
+
return this.componentClass();
|
|
100
106
|
if (this.formField.dirty || this.formField.touched) {
|
|
101
107
|
if (this.formField.invalid) {
|
|
102
|
-
return this.
|
|
108
|
+
return this.errorClass();
|
|
103
109
|
}
|
|
104
110
|
else if (this.formField.valid) {
|
|
105
|
-
return this.
|
|
111
|
+
return this.successClass();
|
|
106
112
|
}
|
|
107
113
|
}
|
|
108
|
-
return this.
|
|
114
|
+
return this.componentClass();
|
|
109
115
|
}
|
|
110
116
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: FileUploaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
111
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.8", type: FileUploaderComponent, isStandalone: true, selector: "app-file-uploader", inputs: {
|
|
117
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.8", type: FileUploaderComponent, isStandalone: true, selector: "app-file-uploader", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, classes: { classPropertyName: "classes", publicName: "classes", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, showExtensions: { classPropertyName: "showExtensions", publicName: "showExtensions", isSignal: true, isRequired: false, transformFunction: null }, extensions: { classPropertyName: "extensions", publicName: "extensions", isSignal: true, isRequired: false, transformFunction: null }, parentForm: { classPropertyName: "parentForm", publicName: "parentForm", isSignal: true, isRequired: false, transformFunction: null }, formControlName: { classPropertyName: "formControlName", publicName: "formControlName", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onFileChange: "onFileChange", value: "valueChange", disabled: "disabledChange" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => FileUploaderComponent), multi: true }], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["uploader"], descendants: true, isSignal: true }], ngImport: i0, template: "<app-input\n\t[label]=\"label()\"\n\t[placeholder]=\"placeholder()\"\n\tplaceholder=\"Seleccione un archivo...\"\n\t[readonly]=\"true\"\n\t(click)=\"handleClick()\"\n\t[(value)]=\"filename\"\n\t[name]=\"name()\"\n\t[variant]=\"validationClass().variant\"\n\t[size]=\"validationClass().size\"\n\t[shape]=\"validationClass().shape\"\n\t[padding]=\"validationClass().padding\"\n\t[classes]=\"classes()\"\n\t(onBlur)=\"_onTouched()\"\n\t[disabled]=\"disabled()\"\n>\n\t<div class=\"flex justify-between\">\n\t\t<div>\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\t\t@if (extensions().length > 0 && showExtensions()) {\n\t\t\t<div class=\"mt-1\">\n\t\t\t\t<span typography [typographyVariant]=\"'body-xs'\">Archivos aceptados: {{ formattedExtensions() }}</span>\n\t\t\t</div>\n\t\t}\n\t</div>\n</app-input>\n@if (parentForm()) {\n\t<input type=\"file\" [(value)]=\"fileValue\" #uploader hidden (change)=\"handleReadFile($event)\" (blur)=\"_onTouched()\" required />\n} @else {\n\t<input type=\"file\" [(value)]=\"fileValue\" #uploader hidden (change)=\"handleAddFile($event)\" required />\n}\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: InputComponent, selector: "app-input", inputs: ["variant", "shape", "size", "padding", "classes", "label", "type", "name", "placeholder", "icon", "readonly", "value", "parentForm", "formControlName", "disabled", "debounceTime"], outputs: ["valueChange", "disabledChange", "onEnter", "onBlur", "onDebounceChange"] }, { kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["typographyVariant", "typographyColor", "typographyFontWeight", "classes"] }], changeDetection: i0.ChangeDetectionStrategy.Default });
|
|
112
118
|
}
|
|
113
119
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: FileUploaderComponent, decorators: [{
|
|
114
120
|
type: Component,
|
|
115
|
-
args: [{ selector: 'app-file-uploader', standalone: true, imports: [FormsModule, InputComponent, TypographyDirective], providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => FileUploaderComponent), multi: true }], changeDetection: ChangeDetectionStrategy.Default, template: "<app-input\n\t[label]=\"label()\"\n\t[placeholder]=\"placeholder()\"\n\tplaceholder=\"Seleccione un archivo...\"\n\t[readonly]=\"true\"\n\t(click)=\"handleClick()\"\n\t[(value)]=\"filename\"\n\t[name]=\"name()\"\n\t[
|
|
121
|
+
args: [{ selector: 'app-file-uploader', standalone: true, imports: [FormsModule, InputComponent, TypographyDirective], providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => FileUploaderComponent), multi: true }], changeDetection: ChangeDetectionStrategy.Default, template: "<app-input\n\t[label]=\"label()\"\n\t[placeholder]=\"placeholder()\"\n\tplaceholder=\"Seleccione un archivo...\"\n\t[readonly]=\"true\"\n\t(click)=\"handleClick()\"\n\t[(value)]=\"filename\"\n\t[name]=\"name()\"\n\t[variant]=\"validationClass().variant\"\n\t[size]=\"validationClass().size\"\n\t[shape]=\"validationClass().shape\"\n\t[padding]=\"validationClass().padding\"\n\t[classes]=\"classes()\"\n\t(onBlur)=\"_onTouched()\"\n\t[disabled]=\"disabled()\"\n>\n\t<div class=\"flex justify-between\">\n\t\t<div>\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\t\t@if (extensions().length > 0 && showExtensions()) {\n\t\t\t<div class=\"mt-1\">\n\t\t\t\t<span typography [typographyVariant]=\"'body-xs'\">Archivos aceptados: {{ formattedExtensions() }}</span>\n\t\t\t</div>\n\t\t}\n\t</div>\n</app-input>\n@if (parentForm()) {\n\t<input type=\"file\" [(value)]=\"fileValue\" #uploader hidden (change)=\"handleReadFile($event)\" (blur)=\"_onTouched()\" required />\n} @else {\n\t<input type=\"file\" [(value)]=\"fileValue\" #uploader hidden (change)=\"handleAddFile($event)\" required />\n}\n" }]
|
|
116
122
|
}] });
|
|
117
123
|
|
|
118
124
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sixbell-telco-sdk-components-file-upload-file-uploader.mjs","sources":["../../../projects/sdk/components/file-upload/file-uploader/src/file-uploader.component.ts","../../../projects/sdk/components/file-upload/file-uploader/src/file-uploader.component.html","../../../projects/sdk/components/file-upload/file-uploader/sixbell-telco-sdk-components-file-upload-file-uploader.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ChangeDetectionStrategy, Component, computed, ElementRef, forwardRef, input, model, output, viewChild } from '@angular/core';\nimport { ControlValueAccessor, FormControl, FormGroup, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { InputComponent, NativeInputVariantProps } from '@sixbell-telco/sdk/components/forms/input';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\n\n// Create a new type by excluding specific values from the variant property\ntype FileUploadVariantProps = Omit<NativeInputVariantProps, 'variant'> & {\n\tvariant?: Exclude<NativeInputVariantProps['variant'], 'search' | 'search-ghost'>;\n};\n\n@Component({\n\tselector: 'app-file-uploader',\n\tstandalone: true,\n\timports: [FormsModule, InputComponent, TypographyDirective],\n\tproviders: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => FileUploaderComponent), multi: true }],\n\ttemplateUrl: './file-uploader.component.html',\n\tchangeDetection: ChangeDetectionStrategy.Default,\n})\nexport class FileUploaderComponent implements ControlValueAccessor {\n\t// Base input properties\n\tvariants = input<FileUploadVariantProps>({ variant: 'secondary', shape: 'round-sm', size: 'md', padding: 'md' });\n\tclass = input<string>('');\n\tlabel = input<string>('');\n\tname = input<string | null>(null);\n\tplaceholder = input<string>('');\n\tshowExtensions = input<boolean>(true);\n\textensions = input<string[]>([]);\n\tonFileChange = output<File>();\n\n\tfilename = '';\n\tfileValue: File | null = null;\n\tformattedExtensions = computed(() => this.extensions().join(', '));\n\tfileInput = viewChild<ElementRef>('uploader');\n\n\t// Form control properties\n\tparentForm = input<FormGroup | null>(null);\n\tformControlName = input<string>('');\n\tvalue = model<File | null>(null);\n\n\t// ControlValueAccessor attributes\n\t_onChange: any;\n\t_onTouched: any;\n\tdisabled = model<boolean>(false);\n\n\tget formField(): FormControl | null {\n\t\tif (!this.parentForm()) return null;\n\t\treturn this.parentForm()?.get(this.formControlName()) as FormControl;\n\t}\n\n\twriteValue(value: any): void {\n\t\tthis.value.set(value);\n\t\tthis.filename = value?.name || '';\n\t}\n\tregisterOnChange(fn: any): void {\n\t\tthis._onChange = fn; // Register this as a change callback function\n\t}\n\tregisterOnTouched(fn: any): void {\n\t\tthis._onTouched = fn; // Register this as a blur callback function\n\t}\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.disabled.set(isDisabled);\n\t}\n\n\t// Input functions\n\thandleClick() {\n\t\tif (!this.fileInput()) return;\n\t\tthis.fileInput()?.nativeElement.click(); // Access the element to trigger click\n\t}\n\n\thandleReadFile(event: Event) {\n\t\tconst file: File | undefined = (event.target as HTMLInputElement).files?.[0];\n\t\tif (file instanceof File) {\n\t\t\tthis.filename = file.name;\n\t\t\tthis._onChange(file);\n\t\t\tthis.value.set(file);\n\t\t\tthis.onFileChange.emit(file);\n\t\t}\n\t}\n\n\thandleAddFile(event: Event) {\n\t\tconst file: File | undefined = (event.target as HTMLInputElement).files?.[0];\n\t\tif (file instanceof File) {\n\t\t\tthis.filename = file.name;\n\t\t\tthis.onFileChange.emit(file);\n\t\t}\n\t}\n\n\tremoveFile() {\n\t\tthis.filename = '';\n\t\tthis.value.set(null);\n\t\tthis._onChange(null);\n\t}\n\n\t// Style Getters\n\tget classes(): NativeInputVariantProps {\n\t\treturn this.variants();\n\t}\n\n\tget errorClasses(): NativeInputVariantProps {\n\t\tconst variants = this.variants();\n\t\treturn {\n\t\t\tvariant: 'error',\n\t\t\tshape: variants.shape,\n\t\t\tsize: variants.size,\n\t\t\tpadding: variants.padding,\n\t\t};\n\t}\n\n\tget successClasses(): NativeInputVariantProps {\n\t\tconst variants = this.variants();\n\t\treturn {\n\t\t\tvariant: 'success',\n\t\t\tshape: variants.shape,\n\t\t\tsize: variants.size,\n\t\t\tpadding: variants.padding,\n\t\t};\n\t}\n\n\tget validationClasses(): NativeInputVariantProps {\n\t\tif (!this.formField) return this.classes;\n\t\tif (this.formField.dirty || this.formField.touched) {\n\t\t\tif (this.formField.invalid) {\n\t\t\t\treturn this.errorClasses;\n\t\t\t} else if (this.formField.valid) {\n\t\t\t\treturn this.successClasses;\n\t\t\t}\n\t\t}\n\n\t\treturn this.classes;\n\t}\n}\n","<app-input\n\t[label]=\"label()\"\n\t[placeholder]=\"placeholder()\"\n\tplaceholder=\"Seleccione un archivo...\"\n\t[readonly]=\"true\"\n\t(click)=\"handleClick()\"\n\t[(value)]=\"filename\"\n\t[name]=\"name()\"\n\t[variants]=\"validationClasses\"\n\t[class]=\"class()\"\n\t(onBlur)=\"_onTouched()\"\n\t[disabled]=\"disabled()\"\n>\n\t<div class=\"flex justify-between\">\n\t\t<div>\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\t\t@if (extensions().length > 0 && showExtensions()) {\n\t\t\t<span [typography]=\"{ variant: 'body-xs' }\" class=\"mt-1\">Archivos aceptados: {{ formattedExtensions() }}</span>\n\t\t}\n\t</div>\n</app-input>\n@if (parentForm()) {\n\t<input type=\"file\" [(value)]=\"fileValue\" #uploader hidden (change)=\"handleReadFile($event)\" (blur)=\"_onTouched()\" required />\n} @else {\n\t<input type=\"file\" [(value)]=\"fileValue\" #uploader hidden (change)=\"handleAddFile($event)\" required />\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAAA;MAmBa,qBAAqB,CAAA;;IAEjC,QAAQ,GAAG,KAAK,CAAyB,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AACjH,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,CAAC,CAAC;AAC1B,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,CAAC,CAAC;AAC1B,IAAA,IAAI,GAAG,KAAK,CAAgB,IAAI,CAAC,CAAC;AAClC,IAAA,WAAW,GAAG,KAAK,CAAS,EAAE,CAAC,CAAC;AAChC,IAAA,cAAc,GAAG,KAAK,CAAU,IAAI,CAAC,CAAC;AACtC,IAAA,UAAU,GAAG,KAAK,CAAW,EAAE,CAAC,CAAC;IACjC,YAAY,GAAG,MAAM,EAAQ,CAAC;IAE9B,QAAQ,GAAG,EAAE,CAAC;IACd,SAAS,GAAgB,IAAI,CAAC;AAC9B,IAAA,mBAAmB,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACnE,IAAA,SAAS,GAAG,SAAS,CAAa,UAAU,CAAC,CAAC;;AAG9C,IAAA,UAAU,GAAG,KAAK,CAAmB,IAAI,CAAC,CAAC;AAC3C,IAAA,eAAe,GAAG,KAAK,CAAS,EAAE,CAAC,CAAC;AACpC,IAAA,KAAK,GAAG,KAAK,CAAc,IAAI,CAAC,CAAC;;AAGjC,IAAA,SAAS,CAAM;AACf,IAAA,UAAU,CAAM;AAChB,IAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,CAAC,CAAC;AAEjC,IAAA,IAAI,SAAS,GAAA;AACZ,QAAA,IAAI,CAAC,IAAI,CAAC,UAAU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WAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,+5BA2BA,EDbW,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,WAAW,EAAE,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,cAAc,4SAAE,mBAAmB,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,YAAA,EAAA,OAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,OAAA,EAAA,CAAA,CAAA;;2FAK9C,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBARjC,SAAS;AACC,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,mBAAmB,EACjB,UAAA,EAAA,IAAI,EACP,OAAA,EAAA,CAAC,WAAW,EAAE,cAAc,EAAE,mBAAmB,CAAC,EAChD,SAAA,EAAA,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAC,2BAA2B,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAE7F,eAAA,EAAA,uBAAuB,CAAC,OAAO,EAAA,QAAA,EAAA,+5BAAA,EAAA,CAAA;;;AEjBjD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"sixbell-telco-sdk-components-file-upload-file-uploader.mjs","sources":["../../../projects/sdk/components/file-upload/file-uploader/src/file-uploader.component.ts","../../../projects/sdk/components/file-upload/file-uploader/src/file-uploader.component.html","../../../projects/sdk/components/file-upload/file-uploader/sixbell-telco-sdk-components-file-upload-file-uploader.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ChangeDetectionStrategy, Component, computed, ElementRef, forwardRef, input, model, output, viewChild } from '@angular/core';\nimport { ControlValueAccessor, FormControl, FormGroup, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { InputComponent, InputPaddingProps, InputShapeProps, InputSizeProps, InputVariantProps } from '@sixbell-telco/sdk/components/forms/input';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\n\n// Create a new type by excluding specific values from the variant property\nexport type FileUploaderVariantProps = Exclude<InputVariantProps, 'search' | 'search-ghost'>;\nexport type FileUploaderShapeProps = InputShapeProps;\nexport type FileUploaderSizeProps = InputSizeProps;\nexport type FileUploaderPaddingProps = InputPaddingProps;\n\nexport type FileUploaderProps = {\n\tvariant?: FileUploaderVariantProps;\n\tshape?: FileUploaderShapeProps;\n\tsize?: FileUploaderSizeProps;\n\tpadding?: FileUploaderPaddingProps;\n};\n\n@Component({\n\tselector: 'app-file-uploader',\n\tstandalone: true,\n\timports: [FormsModule, InputComponent, TypographyDirective],\n\tproviders: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => FileUploaderComponent), multi: true }],\n\ttemplateUrl: './file-uploader.component.html',\n\tchangeDetection: ChangeDetectionStrategy.Default,\n})\nexport class FileUploaderComponent implements ControlValueAccessor {\n\t// Base input properties\n\tvariant = input<FileUploaderVariantProps>('secondary');\n\tshape = input<FileUploaderShapeProps>('round-sm');\n\tsize = input<FileUploaderSizeProps>('md');\n\tpadding = input<FileUploaderPaddingProps>('md');\n\tclasses = input<string>('');\n\tlabel = input<string>('');\n\tname = input<string | null>(null);\n\tplaceholder = input<string>('');\n\tshowExtensions = input<boolean>(true);\n\textensions = input<string[]>([]);\n\tonFileChange = output<File>();\n\n\tfilename = '';\n\tfileValue: File | null = null;\n\tformattedExtensions = computed(() => this.extensions().join(', '));\n\tfileInput = viewChild<ElementRef>('uploader');\n\n\t// Form control properties\n\tparentForm = input<FormGroup | null>(null);\n\tformControlName = input<string>('');\n\tvalue = model<File | null>(null);\n\n\t// ControlValueAccessor attributes\n\t_onChange: any;\n\t_onTouched: any;\n\tdisabled = model<boolean>(false);\n\n\tget formField(): FormControl | null {\n\t\tif (!this.parentForm()) return null;\n\t\treturn this.parentForm()?.get(this.formControlName()) as FormControl;\n\t}\n\n\twriteValue(value: any): void {\n\t\tthis.value.set(value);\n\t\tthis.filename = value?.name || '';\n\t}\n\tregisterOnChange(fn: any): void {\n\t\tthis._onChange = fn; // Register this as a change callback function\n\t}\n\tregisterOnTouched(fn: any): void {\n\t\tthis._onTouched = fn; // Register this as a blur callback function\n\t}\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.disabled.set(isDisabled);\n\t}\n\n\t// Input functions\n\thandleClick() {\n\t\tif (!this.fileInput()) return;\n\t\tthis.fileInput()?.nativeElement.click(); // Access the element to trigger click\n\t}\n\n\thandleReadFile(event: Event) {\n\t\tconst file: File | undefined = (event.target as HTMLInputElement).files?.[0];\n\t\tif (file instanceof File) {\n\t\t\tthis.filename = file.name;\n\t\t\tthis._onChange(file);\n\t\t\tthis.value.set(file);\n\t\t\tthis.onFileChange.emit(file);\n\t\t}\n\t}\n\n\thandleAddFile(event: Event) {\n\t\tconst file: File | undefined = (event.target as HTMLInputElement).files?.[0];\n\t\tif (file instanceof File) {\n\t\t\tthis.filename = file.name;\n\t\t\tthis.onFileChange.emit(file);\n\t\t}\n\t}\n\n\tremoveFile() {\n\t\tthis.filename = '';\n\t\tthis.value.set(null);\n\t\tthis._onChange(null);\n\t}\n\n\t// Style Getters\n\tcomponentClass(): FileUploaderProps {\n\t\treturn {\n\t\t\tvariant: 'secondary',\n\t\t\tshape: 'round-md',\n\t\t\tsize: 'md',\n\t\t\tpadding: 'md',\n\t\t};\n\t}\n\n\terrorClass(): FileUploaderProps {\n\t\treturn {\n\t\t\tvariant: 'error',\n\t\t\tshape: this.shape(),\n\t\t\tsize: this.size(),\n\t\t\tpadding: this.padding(),\n\t\t};\n\t}\n\n\tsuccessClass(): FileUploaderProps {\n\t\treturn {\n\t\t\tvariant: 'success',\n\t\t\tshape: this.shape(),\n\t\t\tsize: this.size(),\n\t\t\tpadding: this.padding(),\n\t\t};\n\t}\n\n\tvalidationClass(): FileUploaderProps {\n\t\tif (!this.formField) return this.componentClass();\n\t\tif (this.formField.dirty || this.formField.touched) {\n\t\t\tif (this.formField.invalid) {\n\t\t\t\treturn this.errorClass();\n\t\t\t} else if (this.formField.valid) {\n\t\t\t\treturn this.successClass();\n\t\t\t}\n\t\t}\n\n\t\treturn this.componentClass();\n\t}\n}\n","<app-input\n\t[label]=\"label()\"\n\t[placeholder]=\"placeholder()\"\n\tplaceholder=\"Seleccione un archivo...\"\n\t[readonly]=\"true\"\n\t(click)=\"handleClick()\"\n\t[(value)]=\"filename\"\n\t[name]=\"name()\"\n\t[variant]=\"validationClass().variant\"\n\t[size]=\"validationClass().size\"\n\t[shape]=\"validationClass().shape\"\n\t[padding]=\"validationClass().padding\"\n\t[classes]=\"classes()\"\n\t(onBlur)=\"_onTouched()\"\n\t[disabled]=\"disabled()\"\n>\n\t<div class=\"flex justify-between\">\n\t\t<div>\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\t\t@if (extensions().length > 0 && showExtensions()) {\n\t\t\t<div class=\"mt-1\">\n\t\t\t\t<span typography [typographyVariant]=\"'body-xs'\">Archivos aceptados: {{ formattedExtensions() }}</span>\n\t\t\t</div>\n\t\t}\n\t</div>\n</app-input>\n@if (parentForm()) {\n\t<input type=\"file\" [(value)]=\"fileValue\" #uploader hidden (change)=\"handleReadFile($event)\" (blur)=\"_onTouched()\" required />\n} @else {\n\t<input type=\"file\" [(value)]=\"fileValue\" #uploader hidden (change)=\"handleAddFile($event)\" required />\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAAA;MA2Ba,qBAAqB,CAAA;;AAEjC,IAAA,OAAO,GAAG,KAAK,CAA2B,WAAW,CAAC,CAAC;AACvD,IAAA,KAAK,GAAG,KAAK,CAAyB,UAAU,CAAC,CAAC;AAClD,IAAA,IAAI,GAAG,KAAK,CAAwB,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/utils/cn';
|
|
|
7
7
|
import { cva } from 'class-variance-authority';
|
|
8
8
|
|
|
9
9
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
10
|
-
const
|
|
10
|
+
const checkboxComponent = cva(['checkbox', 'border-secondary'], {
|
|
11
11
|
variants: {
|
|
12
12
|
variant: {
|
|
13
13
|
primary: ['checkbox-primary'],
|
|
@@ -33,7 +33,7 @@ class CheckboxComponent {
|
|
|
33
33
|
// Base checkbox properties
|
|
34
34
|
variant = input();
|
|
35
35
|
size = input();
|
|
36
|
-
|
|
36
|
+
classes = input('');
|
|
37
37
|
label = input('');
|
|
38
38
|
name = input(null);
|
|
39
39
|
value = model(false);
|
|
@@ -65,21 +65,21 @@ class CheckboxComponent {
|
|
|
65
65
|
this.onControlTouch();
|
|
66
66
|
}
|
|
67
67
|
// classes
|
|
68
|
-
get
|
|
69
|
-
return cn(
|
|
68
|
+
get componentClass() {
|
|
69
|
+
return cn(checkboxComponent({
|
|
70
70
|
variant: this.variant(),
|
|
71
71
|
size: this.size(),
|
|
72
|
-
class: this.
|
|
72
|
+
class: this.classes(),
|
|
73
73
|
}));
|
|
74
74
|
}
|
|
75
75
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: CheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
76
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.8", type: CheckboxComponent, isStandalone: true, selector: "app-checkbox", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null },
|
|
76
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.8", type: CheckboxComponent, isStandalone: true, selector: "app-checkbox", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, classes: { classPropertyName: "classes", publicName: "classes", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", disabled: "disabledChange", onChange: "onChange" }, providers: [
|
|
77
77
|
{
|
|
78
78
|
provide: NG_VALUE_ACCESSOR,
|
|
79
79
|
useExisting: CheckboxComponent,
|
|
80
80
|
multi: true,
|
|
81
81
|
},
|
|
82
|
-
], ngImport: i0, template: "<label class=\"flex cursor-pointer items-center justify-start gap-4\">\n\t<input\n\t\ttype=\"checkbox\"\n\t\t[class]=\"
|
|
82
|
+
], ngImport: i0, template: "<label class=\"flex cursor-pointer items-center justify-start gap-4\">\n\t<input\n\t\ttype=\"checkbox\"\n\t\t[class]=\"componentClass\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabled()\"\n\t\t[attr.name]=\"name()\"\n\t\t(change)=\"handleChange()\"\n\t\t(blur)=\"handleBlur()\"\n\t/>\n\t<span typography [typographyVariant]=\"'body'\" [typographyColor]=\"'black'\">{{ label() }}</span>\n</label>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["typographyVariant", "typographyColor", "typographyFontWeight", "classes"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
83
83
|
}
|
|
84
84
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: CheckboxComponent, decorators: [{
|
|
85
85
|
type: Component,
|
|
@@ -89,7 +89,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImpor
|
|
|
89
89
|
useExisting: CheckboxComponent,
|
|
90
90
|
multi: true,
|
|
91
91
|
},
|
|
92
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<label class=\"flex cursor-pointer items-center justify-start gap-4\">\n\t<input\n\t\ttype=\"checkbox\"\n\t\t[class]=\"
|
|
92
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<label class=\"flex cursor-pointer items-center justify-start gap-4\">\n\t<input\n\t\ttype=\"checkbox\"\n\t\t[class]=\"componentClass\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabled()\"\n\t\t[attr.name]=\"name()\"\n\t\t(change)=\"handleChange()\"\n\t\t(blur)=\"handleBlur()\"\n\t/>\n\t<span typography [typographyVariant]=\"'body'\" [typographyColor]=\"'black'\">{{ label() }}</span>\n</label>\n" }]
|
|
93
93
|
}] });
|
|
94
94
|
|
|
95
95
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sixbell-telco-sdk-components-forms-checkbox.mjs","sources":["../../../projects/sdk/components/forms/checkbox/src/checkbox.component.ts","../../../projects/sdk/components/forms/checkbox/src/checkbox.component.html","../../../projects/sdk/components/forms/checkbox/sixbell-telco-sdk-components-forms-checkbox.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ChangeDetectionStrategy, Component, input, model, output } from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { cva } from 'class-variance-authority';\n\nconst
|
|
1
|
+
{"version":3,"file":"sixbell-telco-sdk-components-forms-checkbox.mjs","sources":["../../../projects/sdk/components/forms/checkbox/src/checkbox.component.ts","../../../projects/sdk/components/forms/checkbox/src/checkbox.component.html","../../../projects/sdk/components/forms/checkbox/sixbell-telco-sdk-components-forms-checkbox.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ChangeDetectionStrategy, Component, input, model, output } from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { cva } from 'class-variance-authority';\n\nconst checkboxComponent = cva(['checkbox', 'border-secondary'], {\n\tvariants: {\n\t\tvariant: {\n\t\t\tprimary: ['checkbox-primary'],\n\t\t\tsuccess: ['checkbox-success'],\n\t\t\terror: ['checkbox-error'],\n\t\t\twarning: ['checkbox-warning'],\n\t\t\tinfo: ['checkbox-info'],\n\t\t},\n\t\tsize: {\n\t\t\txs: ['checkbox-xs'],\n\t\t\tsm: ['checkbox-sm'],\n\t\t\tmd: ['checkbox-md'],\n\t\t\tlg: ['checkbox-lg'],\n\t\t},\n\t},\n\tcompoundVariants: [],\n\tdefaultVariants: {\n\t\tvariant: 'primary',\n\t\tsize: 'md',\n\t},\n});\n\nexport type CheckboxVariantProps = 'primary' | 'success' | 'error' | 'warning' | 'info' | null | undefined;\nexport type CheckboxSizeProps = 'xs' | 'sm' | 'md' | 'lg' | null | undefined;\n\nexport type CheckboxProps = {\n\tvariant?: CheckboxVariantProps;\n\tsize?: CheckboxSizeProps;\n};\n\n@Component({\n\tselector: 'app-checkbox',\n\tstandalone: true,\n\timports: [FormsModule, TypographyDirective],\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: CheckboxComponent,\n\t\t\tmulti: true,\n\t\t},\n\t],\n\ttemplateUrl: './checkbox.component.html',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class CheckboxComponent implements ControlValueAccessor {\n\t// Base checkbox properties\n\tvariant = input<CheckboxVariantProps>();\n\tsize = input<CheckboxSizeProps>();\n\tclasses = input<string>('');\n\tlabel = input<string>('');\n\tname = input<string | null>(null);\n\n\tvalue = model<boolean>(false);\n\n\t// ControlValueAccessor attributes\n\tprivate onControlChange: any = () => {};\n\tprivate onControlTouch: any = () => {};\n\tdisabled = model<boolean>(false);\n\n\t// ControlValueAccessor methods\n\twriteValue(obj: any): void {\n\t\tthis.value.set(obj);\n\t}\n\n\tregisterOnChange(fn: any): void {\n\t\tthis.onControlChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any): void {\n\t\tthis.onControlTouch = fn;\n\t}\n\n\tsetDisabledState?(isDisabled: boolean): void {\n\t\tthis.disabled.set(isDisabled);\n\t}\n\n\t// Change handler\n\tonChange = output<boolean>();\n\thandleChange(): void {\n\t\tthis.onControlChange(this.value());\n\t\tthis.onChange.emit(this.value());\n\t}\n\n\t// Blur handler\n\thandleBlur() {\n\t\tthis.onControlTouch();\n\t}\n\n\t// classes\n\tget componentClass() {\n\t\treturn cn(\n\t\t\tcheckboxComponent({\n\t\t\t\tvariant: this.variant(),\n\t\t\t\tsize: this.size(),\n\t\t\t\tclass: this.classes(),\n\t\t\t}),\n\t\t);\n\t}\n}\n","<label class=\"flex cursor-pointer items-center justify-start gap-4\">\n\t<input\n\t\ttype=\"checkbox\"\n\t\t[class]=\"componentClass\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabled()\"\n\t\t[attr.name]=\"name()\"\n\t\t(change)=\"handleChange()\"\n\t\t(blur)=\"handleBlur()\"\n\t/>\n\t<span typography [typographyVariant]=\"'body'\" [typographyColor]=\"'black'\">{{ label() }}</span>\n</label>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"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
10
|
import { cva } from 'class-variance-authority';
|
|
11
11
|
|
|
12
12
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
13
|
-
const
|
|
13
|
+
const comboboxComponent = cva(['[&>*]:w-full', 'font-body', 'custom-ng-select'], {
|
|
14
14
|
variants: {
|
|
15
15
|
variant: {
|
|
16
16
|
primary: ['combobox-primary'],
|
|
@@ -47,8 +47,11 @@ const combobox = cva(['[&>*]:w-full', 'font-body', 'custom-ng-select'], {
|
|
|
47
47
|
*/
|
|
48
48
|
class ComboboxComponent {
|
|
49
49
|
// Basi input properties
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
// { variant: 'secondary', shape: 'round-sm', height: 'md' }
|
|
51
|
+
variant = input('secondary');
|
|
52
|
+
shape = input('round-sm');
|
|
53
|
+
height = input('md');
|
|
54
|
+
classes = input('');
|
|
52
55
|
name = input(null);
|
|
53
56
|
label = input('');
|
|
54
57
|
value = model();
|
|
@@ -106,51 +109,51 @@ class ComboboxComponent {
|
|
|
106
109
|
optionsEffect = effect(() => {
|
|
107
110
|
this.simpleOption = this.options().every((option) => typeof option !== 'object');
|
|
108
111
|
});
|
|
109
|
-
get
|
|
110
|
-
return cn(
|
|
111
|
-
variant: this.
|
|
112
|
-
shape: this.
|
|
113
|
-
height: this.
|
|
114
|
-
class: this.
|
|
112
|
+
get componentClass() {
|
|
113
|
+
return cn(comboboxComponent({
|
|
114
|
+
variant: this.variant(),
|
|
115
|
+
shape: this.shape(),
|
|
116
|
+
height: this.height(),
|
|
117
|
+
class: this.classes(),
|
|
115
118
|
}));
|
|
116
119
|
}
|
|
117
|
-
get
|
|
118
|
-
return cn(
|
|
120
|
+
get errorClass() {
|
|
121
|
+
return cn(comboboxComponent({
|
|
119
122
|
variant: 'error',
|
|
120
|
-
shape: this.
|
|
121
|
-
height: this.
|
|
122
|
-
class: this.
|
|
123
|
+
shape: this.shape(),
|
|
124
|
+
height: this.height(),
|
|
125
|
+
class: this.classes(),
|
|
123
126
|
}));
|
|
124
127
|
}
|
|
125
|
-
get
|
|
126
|
-
return cn(
|
|
128
|
+
get successClass() {
|
|
129
|
+
return cn(comboboxComponent({
|
|
127
130
|
variant: 'success',
|
|
128
|
-
shape: this.
|
|
129
|
-
height: this.
|
|
130
|
-
class: this.
|
|
131
|
+
shape: this.shape(),
|
|
132
|
+
height: this.height(),
|
|
133
|
+
class: this.classes(),
|
|
131
134
|
}));
|
|
132
135
|
}
|
|
133
|
-
get
|
|
136
|
+
get validationClass() {
|
|
134
137
|
if (!this.formField)
|
|
135
|
-
return this.
|
|
138
|
+
return this.componentClass;
|
|
136
139
|
if (this.formField.dirty || this.formField.touched) {
|
|
137
140
|
if (this.formField.invalid) {
|
|
138
|
-
return this.
|
|
141
|
+
return this.errorClass;
|
|
139
142
|
}
|
|
140
143
|
else if (this.formField.valid) {
|
|
141
|
-
return this.
|
|
144
|
+
return this.successClass;
|
|
142
145
|
}
|
|
143
146
|
}
|
|
144
|
-
return this.
|
|
147
|
+
return this.componentClass;
|
|
145
148
|
}
|
|
146
149
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: ComboboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
147
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.8", type: ComboboxComponent, isStandalone: true, selector: "app-combobox", inputs: {
|
|
150
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.8", type: ComboboxComponent, isStandalone: true, selector: "app-combobox", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, classes: { classPropertyName: "classes", publicName: "classes", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, emptyOptionText: { classPropertyName: "emptyOptionText", publicName: "emptyOptionText", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null }, key: { classPropertyName: "key", publicName: "key", isSignal: true, isRequired: false, transformFunction: null }, parentForm: { classPropertyName: "parentForm", publicName: "parentForm", isSignal: true, isRequired: false, transformFunction: null }, formControlName: { classPropertyName: "formControlName", publicName: "formControlName", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", disabled: "disabledChange", onChange: "onChange", onSearch: "onSearch" }, providers: [
|
|
148
151
|
{
|
|
149
152
|
provide: NG_VALUE_ACCESSOR,
|
|
150
153
|
useExisting: ComboboxComponent,
|
|
151
154
|
multi: true,
|
|
152
155
|
},
|
|
153
|
-
], ngImport: i0, template: "<div class=\"flex flex-col gap-1\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\" class=\"block\"\n\t\t\t><span [
|
|
156
|
+
], ngImport: i0, template: "<div class=\"flex flex-col gap-1\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\" class=\"block\"\n\t\t\t><span typography [typographyVariant]=\"'body'\" [typographyColor]=\"'black'\" [typographyFontWeight]=\"'normal'\">{{ label() }}</span></label\n\t\t>\n\t}\n\t<ng-select\n\t\t#select\n\t\tnotFoundText=\"Ning\u00FAn elemento encontrado...\"\n\t\tloadingText=\"Cargando...\"\n\t\t[searchable]=\"false\"\n\t\t[clearable]=\"false\"\n\t\t[(ngModel)]=\"value\"\n\t\t[bindLabel]=\"key()\"\n\t\t[disabled]=\"disabled()\"\n\t\t(change)=\"handleSelect()\"\n\t\t(blur)=\"handleBlur()\"\n\t\t[class]=\"validationClass\"\n\t>\n\t\t@if (emptyOptionText() && !search) {\n\t\t\t<ng-option value=\"\">\n\t\t\t\t<span typography [typographyVariant]=\"'body-sm'\" [typographyColor]=\"'black'\" [typographyFontWeight]=\"'normal'\">{{\n\t\t\t\t\temptyOptionText()\n\t\t\t\t}}</span></ng-option\n\t\t\t>\n\t\t}\n\t\t@if (simpleOption) {\n\t\t\t@for (option of options(); track option) {\n\t\t\t\t<ng-option [value]=\"option\">\n\t\t\t\t\t<span typography [typographyVariant]=\"'body-sm'\" [typographyColor]=\"'black'\" [typographyFontWeight]=\"'normal'\">{{ option }}</span>\n\t\t\t\t</ng-option>\n\t\t\t}\n\t\t} @else {\n\t\t\t@for (option of options(); track option[trackBy()]) {\n\t\t\t\t<ng-option [value]=\"option\">\n\t\t\t\t\t<span typography [typographyVariant]=\"'body-sm'\" [typographyColor]=\"'black'\" [typographyFontWeight]=\"'normal'\">{{ option[key()] }}</span>\n\t\t\t\t</ng-option>\n\t\t\t}\n\t\t}\n\t\t<ng-template ng-header-tmp>\n\t\t\t<app-input placeholder=\"Buscar...\" (onDebounceChange)=\"handleSearch($event)\" [variant]=\"'search-ghost'\" [size]=\"'sm'\" class=\"text-sm\" />\n\t\t\t<!-- TODO: loader -->\n\t\t</ng-template>\n\t</ng-select>\n\t<ng-content></ng-content>\n</div>\n", dependencies: [{ kind: "ngmodule", type: NgSelectModule }, { kind: "component", type: i1.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "component", type: i1.NgOptionComponent, selector: "ng-option", inputs: ["value", "disabled"] }, { kind: "directive", type: i1.NgHeaderTemplateDirective, selector: "[ng-header-tmp]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: InputComponent, selector: "app-input", inputs: ["variant", "shape", "size", "padding", "classes", "label", "type", "name", "placeholder", "icon", "readonly", "value", "parentForm", "formControlName", "disabled", "debounceTime"], outputs: ["valueChange", "disabledChange", "onEnter", "onBlur", "onDebounceChange"] }, { kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["typographyVariant", "typographyColor", "typographyFontWeight", "classes"] }, { kind: "ngmodule", type: ReactiveFormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
154
157
|
}
|
|
155
158
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: ComboboxComponent, decorators: [{
|
|
156
159
|
type: Component,
|
|
@@ -160,7 +163,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImpor
|
|
|
160
163
|
useExisting: ComboboxComponent,
|
|
161
164
|
multi: true,
|
|
162
165
|
},
|
|
163
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col gap-1\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\" class=\"block\"\n\t\t\t><span [
|
|
166
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col gap-1\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\" class=\"block\"\n\t\t\t><span typography [typographyVariant]=\"'body'\" [typographyColor]=\"'black'\" [typographyFontWeight]=\"'normal'\">{{ label() }}</span></label\n\t\t>\n\t}\n\t<ng-select\n\t\t#select\n\t\tnotFoundText=\"Ning\u00FAn elemento encontrado...\"\n\t\tloadingText=\"Cargando...\"\n\t\t[searchable]=\"false\"\n\t\t[clearable]=\"false\"\n\t\t[(ngModel)]=\"value\"\n\t\t[bindLabel]=\"key()\"\n\t\t[disabled]=\"disabled()\"\n\t\t(change)=\"handleSelect()\"\n\t\t(blur)=\"handleBlur()\"\n\t\t[class]=\"validationClass\"\n\t>\n\t\t@if (emptyOptionText() && !search) {\n\t\t\t<ng-option value=\"\">\n\t\t\t\t<span typography [typographyVariant]=\"'body-sm'\" [typographyColor]=\"'black'\" [typographyFontWeight]=\"'normal'\">{{\n\t\t\t\t\temptyOptionText()\n\t\t\t\t}}</span></ng-option\n\t\t\t>\n\t\t}\n\t\t@if (simpleOption) {\n\t\t\t@for (option of options(); track option) {\n\t\t\t\t<ng-option [value]=\"option\">\n\t\t\t\t\t<span typography [typographyVariant]=\"'body-sm'\" [typographyColor]=\"'black'\" [typographyFontWeight]=\"'normal'\">{{ option }}</span>\n\t\t\t\t</ng-option>\n\t\t\t}\n\t\t} @else {\n\t\t\t@for (option of options(); track option[trackBy()]) {\n\t\t\t\t<ng-option [value]=\"option\">\n\t\t\t\t\t<span typography [typographyVariant]=\"'body-sm'\" [typographyColor]=\"'black'\" [typographyFontWeight]=\"'normal'\">{{ option[key()] }}</span>\n\t\t\t\t</ng-option>\n\t\t\t}\n\t\t}\n\t\t<ng-template ng-header-tmp>\n\t\t\t<app-input placeholder=\"Buscar...\" (onDebounceChange)=\"handleSearch($event)\" [variant]=\"'search-ghost'\" [size]=\"'sm'\" class=\"text-sm\" />\n\t\t\t<!-- TODO: loader -->\n\t\t</ng-template>\n\t</ng-select>\n\t<ng-content></ng-content>\n</div>\n" }]
|
|
164
167
|
}] });
|
|
165
168
|
|
|
166
169
|
/**
|